38fa785f558485f2ac9bb92435b55fb7768a2e5b6ed6cf6497ad98ba7666b4ed.json 5.2 KB

1
  1. {"ast":null,"code":"import * as React from 'react';\nimport ResizeObserver from 'rc-resize-observer';\nimport MeasureCell from \"./MeasureCell\";\nimport isVisible from \"rc-util/es/Dom/isVisible\";\nimport { useContext } from '@rc-component/context';\nimport TableContext from \"../context/TableContext\";\nexport default function MeasureRow(_ref) {\n var prefixCls = _ref.prefixCls,\n columnsKey = _ref.columnsKey,\n onColumnResize = _ref.onColumnResize,\n columns = _ref.columns;\n var ref = React.useRef(null);\n var _useContext = useContext(TableContext, ['measureRowRender']),\n measureRowRender = _useContext.measureRowRender;\n var measureRow = /*#__PURE__*/React.createElement(\"tr\", {\n \"aria-hidden\": \"true\",\n className: \"\".concat(prefixCls, \"-measure-row\"),\n style: {\n height: 0\n },\n ref: ref\n }, /*#__PURE__*/React.createElement(ResizeObserver.Collection, {\n onBatchResize: function onBatchResize(infoList) {\n if (isVisible(ref.current)) {\n infoList.forEach(function (_ref2) {\n var columnKey = _ref2.data,\n size = _ref2.size;\n onColumnResize(columnKey, size.offsetWidth);\n });\n }\n }\n }, columnsKey.map(function (columnKey) {\n var column = columns.find(function (col) {\n return col.key === columnKey;\n });\n return /*#__PURE__*/React.createElement(MeasureCell, {\n key: columnKey,\n columnKey: columnKey,\n onColumnResize: onColumnResize,\n column: column\n });\n })));\n return measureRowRender ? measureRowRender(measureRow) : measureRow;\n}","map":{"version":3,"names":["React","ResizeObserver","MeasureCell","isVisible","useContext","TableContext","MeasureRow","_ref","prefixCls","columnsKey","onColumnResize","columns","ref","useRef","_useContext","measureRowRender","measureRow","createElement","className","concat","style","height","Collection","onBatchResize","infoList","current","forEach","_ref2","columnKey","data","size","offsetWidth","map","column","find","col","key"],"sources":["/Users/max_liu/max_liu/company/tools_auto_pt/node_modules/rc-table/es/Body/MeasureRow.js"],"sourcesContent":["import * as React from 'react';\nimport ResizeObserver from 'rc-resize-observer';\nimport MeasureCell from \"./MeasureCell\";\nimport isVisible from \"rc-util/es/Dom/isVisible\";\nimport { useContext } from '@rc-component/context';\nimport TableContext from \"../context/TableContext\";\nexport default function MeasureRow(_ref) {\n var prefixCls = _ref.prefixCls,\n columnsKey = _ref.columnsKey,\n onColumnResize = _ref.onColumnResize,\n columns = _ref.columns;\n var ref = React.useRef(null);\n var _useContext = useContext(TableContext, ['measureRowRender']),\n measureRowRender = _useContext.measureRowRender;\n var measureRow = /*#__PURE__*/React.createElement(\"tr\", {\n \"aria-hidden\": \"true\",\n className: \"\".concat(prefixCls, \"-measure-row\"),\n style: {\n height: 0\n },\n ref: ref\n }, /*#__PURE__*/React.createElement(ResizeObserver.Collection, {\n onBatchResize: function onBatchResize(infoList) {\n if (isVisible(ref.current)) {\n infoList.forEach(function (_ref2) {\n var columnKey = _ref2.data,\n size = _ref2.size;\n onColumnResize(columnKey, size.offsetWidth);\n });\n }\n }\n }, columnsKey.map(function (columnKey) {\n var column = columns.find(function (col) {\n return col.key === columnKey;\n });\n return /*#__PURE__*/React.createElement(MeasureCell, {\n key: columnKey,\n columnKey: columnKey,\n onColumnResize: onColumnResize,\n column: column\n });\n })));\n return measureRowRender ? measureRowRender(measureRow) : measureRow;\n}"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,SAAS,MAAM,0BAA0B;AAChD,SAASC,UAAU,QAAQ,uBAAuB;AAClD,OAAOC,YAAY,MAAM,yBAAyB;AAClD,eAAe,SAASC,UAAUA,CAACC,IAAI,EAAE;EACvC,IAAIC,SAAS,GAAGD,IAAI,CAACC,SAAS;IAC5BC,UAAU,GAAGF,IAAI,CAACE,UAAU;IAC5BC,cAAc,GAAGH,IAAI,CAACG,cAAc;IACpCC,OAAO,GAAGJ,IAAI,CAACI,OAAO;EACxB,IAAIC,GAAG,GAAGZ,KAAK,CAACa,MAAM,CAAC,IAAI,CAAC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