UNPKG

2.13 kBJavaScriptView Raw
1"use strict";
2
3var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4var _typeof = require("@babel/runtime/helpers/typeof");
5Object.defineProperty(exports, "__esModule", {
6 value: true
7});
8exports.default = MeasureRow;
9var React = _interopRequireWildcard(require("react"));
10var _rcResizeObserver = _interopRequireDefault(require("rc-resize-observer"));
11var _MeasureCell = _interopRequireDefault(require("./MeasureCell"));
12function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14function MeasureRow(_ref) {
15 var prefixCls = _ref.prefixCls,
16 columnsKey = _ref.columnsKey,
17 onColumnResize = _ref.onColumnResize;
18 return /*#__PURE__*/React.createElement("tr", {
19 "aria-hidden": "true",
20 className: "".concat(prefixCls, "-measure-row"),
21 style: {
22 height: 0,
23 fontSize: 0
24 }
25 }, /*#__PURE__*/React.createElement(_rcResizeObserver.default.Collection, {
26 onBatchResize: function onBatchResize(infoList) {
27 infoList.forEach(function (_ref2) {
28 var columnKey = _ref2.data,
29 size = _ref2.size;
30 onColumnResize(columnKey, size.offsetWidth);
31 });
32 }
33 }, columnsKey.map(function (columnKey) {
34 return /*#__PURE__*/React.createElement(_MeasureCell.default, {
35 key: columnKey,
36 columnKey: columnKey,
37 onColumnResize: onColumnResize
38 });
39 })));
40}
\No newline at end of file