32d5cd0d7bc49b4db078581cba52b100.json
4.62 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nexport function renderExpandIcon(_ref) {\n var _classNames;\n\n var prefixCls = _ref.prefixCls,\n record = _ref.record,\n onExpand = _ref.onExpand,\n expanded = _ref.expanded,\n expandable = _ref.expandable;\n var expandClassName = \"\".concat(prefixCls, \"-row-expand-icon\");\n\n if (!expandable) {\n return React.createElement(\"span\", {\n className: classNames(expandClassName, \"\".concat(prefixCls, \"-row-spaced\"))\n });\n }\n\n var onClick = function onClick(event) {\n onExpand(record, event);\n event.stopPropagation();\n };\n\n return React.createElement(\"span\", {\n className: classNames(expandClassName, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-row-expanded\"), expanded), _defineProperty(_classNames, \"\".concat(prefixCls, \"-row-collapsed\"), !expanded), _classNames)),\n onClick: onClick\n });\n}\nexport function findAllChildrenKeys(data, getRowKey, childrenColumnName) {\n var keys = [];\n\n function dig(list) {\n (list || []).forEach(function (item, index) {\n keys.push(getRowKey(item, index));\n dig(item[childrenColumnName]);\n });\n }\n\n dig(data);\n return keys;\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-table/es/utils/expandUtil.js"],"names":["_defineProperty","React","classNames","renderExpandIcon","_ref","_classNames","prefixCls","record","onExpand","expanded","expandable","expandClassName","concat","createElement","className","onClick","event","stopPropagation","findAllChildrenKeys","data","getRowKey","childrenColumnName","keys","dig","list","forEach","item","index","push"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,2CAA5B;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAO,SAASC,gBAAT,CAA0BC,IAA1B,EAAgC;AACrC,MAAIC,WAAJ;;AAEA,MAAIC,SAAS,GAAGF,IAAI,CAACE,SAArB;AAAA,MACIC,MAAM,GAAG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hB,EAAuB;AAC1CL,MAAAA,IAAI,CAACM,IAAL,CAAUR,SAAS,CAACM,IAAD,EAAOC,KAAP,CAAnB;AACAJ,MAAAA,GAAG,CAACG,IAAI,CAACL,kBAAD,CAAL,CAAH;AACD,KAHD;AAID;;AAEDE,EAAAA,GAAG,CAACJ,IAAD,CAAH;AACA,SAAOG,IAAP;AACD","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nexport function renderExpandIcon(_ref) {\n var _classNames;\n\n var prefixCls = _ref.prefixCls,\n record = _ref.record,\n onExpand = _ref.onExpand,\n expanded = _ref.expanded,\n expandable = _ref.expandable;\n var expandClassName = \"\".concat(prefixCls, \"-row-expand-icon\");\n\n if (!expandable) {\n return React.createElement(\"span\", {\n className: classNames(expandClassName, \"\".concat(prefixCls, \"-row-spaced\"))\n });\n }\n\n var onClick = function onClick(event) {\n onExpand(record, event);\n event.stopPropagation();\n };\n\n return React.createElement(\"span\", {\n className: classNames(expandClassName, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-row-expanded\"), expanded), _defineProperty(_classNames, \"\".concat(prefixCls, \"-row-collapsed\"), !expanded), _classNames)),\n onClick: onClick\n });\n}\nexport function findAllChildrenKeys(data, getRowKey, childrenColumnName) {\n var keys = [];\n\n function dig(list) {\n (list || []).forEach(function (item, index) {\n keys.push(getRowKey(item, index));\n dig(item[childrenColumnName]);\n });\n }\n\n dig(data);\n return keys;\n}"]},"metadata":{},"sourceType":"module"}