62a3d2da3ea0c96b850b6243ce3fc861.json 5.16 KB
{"ast":null,"code":"import * as React from 'react';\nimport Cell from '../Cell';\nimport TableContext from '../context/TableContext';\n\nfunction ExpandedRow(_ref) {\n  var prefixCls = _ref.prefixCls,\n      children = _ref.children,\n      Component = _ref.component,\n      cellComponent = _ref.cellComponent,\n      fixHeader = _ref.fixHeader,\n      fixColumn = _ref.fixColumn,\n      horizonScroll = _ref.horizonScroll,\n      className = _ref.className,\n      expanded = _ref.expanded,\n      componentWidth = _ref.componentWidth,\n      colSpan = _ref.colSpan;\n\n  var _React$useContext = React.useContext(TableContext),\n      scrollbarSize = _React$useContext.scrollbarSize; // Cache render node\n\n\n  return React.useMemo(function () {\n    var contentNode = children;\n\n    if (fixColumn) {\n      contentNode = React.createElement(\"div\", {\n        style: {\n          width: componentWidth - (fixHeader ? scrollbarSize : 0),\n          position: 'sticky',\n          left: 0,\n          overflow: 'hidden'\n        },\n        className: \"\".concat(prefixCls, \"-expanded-row-fixed\")\n      }, contentNode);\n    }\n\n    return React.createElement(Component, {\n      className: className,\n      style: {\n        display: expanded ? null : 'none'\n      }\n    }, React.createElement(Cell, {\n      component: cellComponent,\n      prefixCls: prefixCls,\n      colSpan: colSpan\n    }, contentNode));\n  }, [children, Component, fixHeader, horizonScroll, className, expanded, componentWidth, colSpan, scrollbarSize]);\n}\n\nexport default ExpandedRow;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-table/es/Body/ExpandedRow.js"],"names":["React","Cell","TableContext","ExpandedRow","_ref","prefixCls","children","Component","component","cellComponent","fixHeader","fixColumn","horizonScroll","className","expanded","componentWidth","colSpan","_React$useContext","useContext","scrollbarSize","useMemo","contentNode","createElement","style","width","position","left","overflow","concat","display"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,OAAOC,YAAP,MAAyB,yBAAzB;;AAEA,SAASC,WAAT,CAAqB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yB;AAEpCU,MAAAA,KAAK,EAAE;AACLM,QAAAA,OAAO,EAAEf,QAAQ,GAAG,IAAH,GAAU;AADtB;AAF6B,KAA/B,EAKJd,KAAK,CAACsB,aAAN,CAAoBrB,IAApB,EAA0B;AAC3BO,MAAAA,SAAS,EAAEC,aADgB;AAE3BJ,MAAAA,SAAS,EAAEA,SAFgB;AAG3BW,MAAAA,OAAO,EAAEA;AAHkB,KAA1B,EAIAK,WAJA,CALI,CAAP;AAUD,GAzBM,EAyBJ,CAACf,QAAD,EAAWC,SAAX,EAAsBG,SAAtB,EAAiCE,aAAjC,EAAgDC,SAAhD,EAA2DC,QAA3D,EAAqEC,cAArE,EAAqFC,OAArF,EAA8FG,aAA9F,CAzBI,CAAP;AA0BD;;AAED,eAAehB,WAAf","sourcesContent":["import * as React from 'react';\nimport Cell from '../Cell';\nimport TableContext from '../context/TableContext';\n\nfunction ExpandedRow(_ref) {\n  var prefixCls = _ref.prefixCls,\n      children = _ref.children,\n      Component = _ref.component,\n      cellComponent = _ref.cellComponent,\n      fixHeader = _ref.fixHeader,\n      fixColumn = _ref.fixColumn,\n      horizonScroll = _ref.horizonScroll,\n      className = _ref.className,\n      expanded = _ref.expanded,\n      componentWidth = _ref.componentWidth,\n      colSpan = _ref.colSpan;\n\n  var _React$useContext = React.useContext(TableContext),\n      scrollbarSize = _React$useContext.scrollbarSize; // Cache render node\n\n\n  return React.useMemo(function () {\n    var contentNode = children;\n\n    if (fixColumn) {\n      contentNode = React.createElement(\"div\", {\n        style: {\n          width: componentWidth - (fixHeader ? scrollbarSize : 0),\n          position: 'sticky',\n          left: 0,\n          overflow: 'hidden'\n        },\n        className: \"\".concat(prefixCls, \"-expanded-row-fixed\")\n      }, contentNode);\n    }\n\n    return React.createElement(Component, {\n      className: className,\n      style: {\n        display: expanded ? null : 'none'\n      }\n    }, React.createElement(Cell, {\n      component: cellComponent,\n      prefixCls: prefixCls,\n      colSpan: colSpan\n    }, contentNode));\n  }, [children, Component, fixHeader, horizonScroll, className, expanded, componentWidth, colSpan, scrollbarSize]);\n}\n\nexport default ExpandedRow;"]},"metadata":{},"sourceType":"module"}