@economic/taco 2.26.15 → 2.26.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -9754,7 +9754,7 @@ function configureReactTableOptions(options, props) {
9754
9754
  }
9755
9755
  function useReactTableInitialState(props, columns, persistedSettings, defaults) {
9756
9756
  return React__default.useMemo(() => {
9757
- var _persistedSettings$co, _props$defaultSetting, _ref, _persistedSettings$co2, _props$defaultSetting2, _columnPinning$left, _ref2, _persistedSettings$co3, _props$defaultSetting3, _ref3, _ref4, _persistedSettings$co4, _props$defaultSetting4, _ref5, _ref6, _persistedSettings$co5, _props$defaultSetting5, _persistedSettings$se, _props$defaultSetting6, _props$defaultSetting7, _props$defaultSetting8;
9757
+ var _persistedSettings$co, _props$defaultSetting, _ref, _persistedSettings$co2, _props$defaultSetting2, _columnPinning$left, _ref2, _persistedSettings$co3, _props$defaultSetting3, _ref3, _ref4, _persistedSettings$co4, _props$defaultSetting4, _ref5, _ref6, _persistedSettings$co5, _props$defaultSetting5, _persistedSettings$se, _props$defaultSetting6, _props$defaultSetting7, _props$defaultSetting8, _ref7, _persistedSettings$gr, _persistedSettings$gr2, _props$defaultSetting9, _props$defaultSetting10;
9758
9758
  const ignoreNotDefinedColumns = column => columns.find(definedColumn => definedColumn.id === column.id);
9759
9759
  const columnOrder = ensureOrdering(columns, (_persistedSettings$co = persistedSettings.columnOrder) !== null && _persistedSettings$co !== void 0 ? _persistedSettings$co : (_props$defaultSetting = props.defaultSettings) === null || _props$defaultSetting === void 0 ? void 0 : _props$defaultSetting.columnOrder);
9760
9760
  const columnPinning = (_ref = (_persistedSettings$co2 = persistedSettings.columnPinning) !== null && _persistedSettings$co2 !== void 0 ? _persistedSettings$co2 : (_props$defaultSetting2 = props.defaultSettings) === null || _props$defaultSetting2 === void 0 ? void 0 : _props$defaultSetting2.columnPinning) !== null && _ref !== void 0 ? _ref : {};
@@ -9775,7 +9775,7 @@ function useReactTableInitialState(props, columns, persistedSettings, defaults)
9775
9775
  globalFilter: (_persistedSettings$se = persistedSettings.searchQuery) !== null && _persistedSettings$se !== void 0 ? _persistedSettings$se : (_props$defaultSetting6 = props.defaultSettings) === null || _props$defaultSetting6 === void 0 ? void 0 : _props$defaultSetting6.searchQuery,
9776
9776
  sorting: persistedSettings.sorting ? persistedSettings.sorting.filter(ignoreNotDefinedColumns) : (_props$defaultSetting7 = (_props$defaultSetting8 = props.defaultSettings) === null || _props$defaultSetting8 === void 0 ? void 0 : _props$defaultSetting8.sorting) !== null && _props$defaultSetting7 !== void 0 ? _props$defaultSetting7 : defaults.defaultSorting
9777
9777
  };
9778
- if (props.defaultRowGroupColumnId) {
9778
+ if ((_ref7 = (_persistedSettings$gr = (_persistedSettings$gr2 = persistedSettings.grouping) === null || _persistedSettings$gr2 === void 0 ? void 0 : _persistedSettings$gr2.length) !== null && _persistedSettings$gr !== void 0 ? _persistedSettings$gr : (_props$defaultSetting9 = props.defaultSettings) === null || _props$defaultSetting9 === void 0 ? void 0 : (_props$defaultSetting10 = _props$defaultSetting9.grouping) === null || _props$defaultSetting10 === void 0 ? void 0 : _props$defaultSetting10.length) !== null && _ref7 !== void 0 ? _ref7 : props.defaultRowGroupColumnId) {
9779
9779
  state.grouping = [props.defaultRowGroupColumnId];
9780
9780
  // row groups should (all) always be expanded by default
9781
9781
  state.expanded = true;
@@ -10704,7 +10704,6 @@ function getSettings(table) {
10704
10704
  const meta = table.options.meta;
10705
10705
  const state = table.getState();
10706
10706
  return {
10707
- // commented out properties are here to highlight things we explicitly don't want them saved
10708
10707
  //columnFilters: table.options.enableColumnFilters ? state.columnFilters : undefined,
10709
10708
  columnOrder: meta.columnOrdering.isEnabled ? state.columnOrder : undefined,
10710
10709
  columnPinning: state.columnPinning,
@@ -10712,7 +10711,7 @@ function getSettings(table) {
10712
10711
  columnVisibility: table.options.enableHiding ? state.columnVisibility : undefined,
10713
10712
  excludeUnmatchedRecordsInSearch: table.options.enableGlobalFilter,
10714
10713
  fontSize: meta.fontSize.isEnabled ? meta.fontSize.size : undefined,
10715
- //grouping: table.options.enableGrouping ? state.grouping : undefined,
10714
+ grouping: table.options.enableGrouping ? state.grouping : undefined,
10716
10715
  rowHeight: meta.rowHeight.isEnabled ? meta.rowHeight.height : undefined,
10717
10716
  //searchQuery: table.options.enableGlobalFilter ? state.globalFilter : undefined,
10718
10717
  sorting: state.sorting
@@ -10733,9 +10732,7 @@ function useTableSettingsListener(table, onChangeSettings) {
10733
10732
  return () => clearTimeout(handler);
10734
10733
  }, [
10735
10734
  //state.columnFilters,
10736
- state.columnOrder, state.columnPinning, state.columnSizing, state.columnVisibility, table.options.enableGlobalFilter, meta.fontSize.size,
10737
- //state.grouping,
10738
- meta.rowHeight.height,
10735
+ state.columnOrder, state.columnPinning, state.columnSizing, state.columnVisibility, table.options.enableGlobalFilter, meta.fontSize.size, state.grouping, meta.rowHeight.height,
10739
10736
  //state.globalFilter,
10740
10737
  state.sorting]);
10741
10738
  }
@@ -12463,22 +12460,16 @@ function HeaderMenu(props) {
12463
12460
  });
12464
12461
  }
12465
12462
 
12466
- function useSetInitialColumnSizing(id, defaultWidth, width, element, canMeasureSize, setColumnSizing) {
12467
- React__default.useLayoutEffect(() => {
12463
+ function useSetInitialColumnSizing(id, width, element, canMeasureSize, setColumnSizing) {
12464
+ React__default.useEffect(() => {
12468
12465
  // columns must set a pixel width...
12469
12466
  // otherwise when scrolling through the table, the column widths adjust based on the content
12470
12467
  // of the column, this is because to the virtualisation mounting new rows and unmounting old ones
12471
12468
  if (canMeasureSize && element && !Number.isInteger(width) && !isInternalColumn(id)) {
12472
- const setWidth = () => setColumnSizing(sizes => ({
12469
+ setColumnSizing(sizes => ({
12473
12470
  ...sizes,
12474
12471
  [id]: element.getBoundingClientRect().width
12475
12472
  }));
12476
- // grow columns need to wait for auto layout to run, otherwise they register the incorrect size
12477
- if (defaultWidth === 'grow') {
12478
- requestAnimationFrame(setWidth);
12479
- } else {
12480
- setWidth();
12481
- }
12482
12473
  }
12483
12474
  }, [element, canMeasureSize, width]);
12484
12475
  }
@@ -12529,7 +12520,6 @@ function Header$5(props) {
12529
12520
  children: reactTable.flexRender(header.column.columnDef.header, header.getContext()),
12530
12521
  colSpan: header.colSpan,
12531
12522
  customMenu: columnMeta.menu,
12532
- defaultWidth: columnMeta.defaultWidth,
12533
12523
  hasMenu,
12534
12524
  id: header.id,
12535
12525
  isFiltered: header.column.getIsFiltered(),
@@ -12611,7 +12601,6 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
12611
12601
  className,
12612
12602
  colSpan,
12613
12603
  customMenu,
12614
- defaultWidth,
12615
12604
  hasMenu,
12616
12605
  id,
12617
12606
  index,
@@ -12637,7 +12626,7 @@ const MemoedHeader = /*#__PURE__*/React__default.memo(function MemoedHeader(prop
12637
12626
  } = props;
12638
12627
  const [ref, setRef] = React__default.useState(null);
12639
12628
  // save column width if none is set
12640
- useSetInitialColumnSizing(id, defaultWidth, width, ref, canMeasureSize, setColumnSizing);
12629
+ useSetInitialColumnSizing(id, width, ref, canMeasureSize, setColumnSizing);
12641
12630
  // feature specific styles
12642
12631
  const style = {};
12643
12632
  // column groups often span multiple columns