@economic/taco 2.40.2 → 2.41.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/dist/components/OverflowGroup/OverflowGroup.d.ts +1 -0
  2. package/dist/components/Tabs/Tabs.d.ts +5 -0
  3. package/dist/esm/index.css +2 -2
  4. package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js +1 -1
  5. package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js.map +1 -1
  6. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +3 -1
  7. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
  8. package/dist/esm/packages/taco/src/components/Select2/components/Search.js +0 -1
  9. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  10. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js +1 -1
  11. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js.map +1 -1
  12. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js +1 -1
  13. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js.map +1 -1
  14. package/dist/esm/packages/taco/src/components/Tabs/Tabs.js +17 -3
  15. package/dist/esm/packages/taco/src/components/Tabs/Tabs.js.map +1 -1
  16. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js +5 -44
  17. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js.map +1 -1
  18. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js +8 -5
  19. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js.map +1 -1
  20. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js +2 -1
  21. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js.map +1 -1
  22. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js +3 -1
  23. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
  24. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js +1 -1
  25. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js.map +1 -1
  26. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js +33 -1
  27. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -1
  28. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js +2 -1
  29. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -1
  30. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
  31. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js +4 -3
  32. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js.map +1 -1
  33. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js +13 -10
  34. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js.map +1 -1
  35. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js +1 -1
  36. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -1
  37. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +8 -6
  38. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
  39. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +2 -2
  40. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
  41. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +7 -2
  42. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
  43. package/dist/index.css +2 -2
  44. package/dist/primitives/Table/types.d.ts +7 -4
  45. package/dist/primitives/Table/useTableManager/useTableManager.d.ts +1 -0
  46. package/dist/taco.cjs.development.js +107 -85
  47. package/dist/taco.cjs.development.js.map +1 -1
  48. package/dist/taco.cjs.production.min.js +1 -1
  49. package/dist/taco.cjs.production.min.js.map +1 -1
  50. package/package.json +2 -2
@@ -3765,7 +3765,7 @@ const BadgeIcon = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
3765
3765
  small,
3766
3766
  ...otherProps
3767
3767
  } = props;
3768
- const className = cn(`rounded-full border overflow-hidden whitespace-nowrap inline-flex items-center justify-center border-transparent [&>*]:max-h-full`, {
3768
+ const className = cn(`rounded-full border overflow-hidden whitespace-nowrap inline-flex items-center justify-center border-transparent [&>*]:max-h-full shrink-0`, {
3769
3769
  'w-5 h-5': !small
3770
3770
  }, {
3771
3771
  'w-4 h-4 text-xs': small
@@ -8974,7 +8974,9 @@ const OverflowGroup = /*#__PURE__*/React__default.forwardRef(function OverflowGr
8974
8974
  })), hiddenChildren.length ? /*#__PURE__*/React__default.cloneElement(MoreButton, {
8975
8975
  className: cn('sticky right-0 order-[99]', MoreButton.props.className),
8976
8976
  'data-observer-ignore': true,
8977
- menu: menuProps => (/*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, hiddenChildren.map(sanitizeButtonPropsForMenuItem)))),
8977
+ menu: menuProps => (/*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, hiddenChildren.map((child, index) => props.wrapChild ? (/*#__PURE__*/React__default.createElement(Menu$1.Item, {
8978
+ key: index
8979
+ }, child)) : sanitizeButtonPropsForMenuItem(child, index))))),
8978
8980
  ref: buttonRefCallback
8979
8981
  }) : null);
8980
8982
  });
@@ -10079,6 +10081,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
10079
10081
  aggregationFn,
10080
10082
  defaultHidden,
10081
10083
  defaultWidth,
10084
+ enableEditing = !!child.props.control,
10082
10085
  enableFiltering: enableColumnFilter = true,
10083
10086
  enableGrouping = false,
10084
10087
  enableHiding = true,
@@ -10130,6 +10133,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
10130
10133
  enableOrdering: isGrouped ? false : enableOrdering,
10131
10134
  enablePrinting,
10132
10135
  enableTruncate,
10136
+ enableEditing,
10133
10137
  header,
10134
10138
  renderer
10135
10139
  }
@@ -10228,6 +10232,9 @@ function mapTableChildrenToColumns(props, settings, options, internalColumns) {
10228
10232
  function configureReactTableOptions(options, props) {
10229
10233
  var _options$enableFilter, _options$enableColumn, _options$enableRowExp, _options$enableColumn2, _options$enableColumn3, _options$enableSortin;
10230
10234
  const enableRowSelection = options.enableRowSelection || options.enableRowSelectionSingle;
10235
+ // We don't want to expose internal Tanstack Table row, so we need to wrap enableRowSelection callback into additional function,
10236
+ // which receives the React Table Row object and passes row.original to a callback.
10237
+ const reactTableEnableRowSelection = typeof enableRowSelection === 'function' ? row => enableRowSelection(row.original) : enableRowSelection;
10231
10238
  const tableOptions = {
10232
10239
  defaultColumn: {
10233
10240
  enableColumnFilter: options.enableFiltering || true,
@@ -10246,8 +10253,8 @@ function configureReactTableOptions(options, props) {
10246
10253
  enableGrouping: true,
10247
10254
  enableHiding: (_options$enableColumn2 = options.enableColumnHiding) !== null && _options$enableColumn2 !== void 0 ? _options$enableColumn2 : false,
10248
10255
  enablePinning: (_options$enableColumn3 = options.enableColumnFreezing) !== null && _options$enableColumn3 !== void 0 ? _options$enableColumn3 : false,
10249
- enableRowSelection: enableRowSelection !== null && enableRowSelection !== void 0 ? enableRowSelection : false,
10250
- enableMultiRowSelection: options.enableRowSelectionSingle === true ? false : enableRowSelection,
10256
+ enableRowSelection: reactTableEnableRowSelection !== null && reactTableEnableRowSelection !== void 0 ? reactTableEnableRowSelection : false,
10257
+ enableMultiRowSelection: !options.enableRowSelectionSingle && reactTableEnableRowSelection,
10251
10258
  enableSorting: (_options$enableSortin = options.enableSorting) !== null && _options$enableSortin !== void 0 ? _options$enableSortin : false,
10252
10259
  // models for default features
10253
10260
  getExpandedRowModel: reactTable.getExpandedRowModel(),
@@ -10447,8 +10454,8 @@ function getTableFeaturePreset(props) {
10447
10454
  enableColumnHiding: (_props$enableColumnHi = props.enableColumnHiding) !== null && _props$enableColumnHi !== void 0 ? _props$enableColumnHi : presetOptions.enableColumnHiding,
10448
10455
  enableColumnResizing: (_props$enableColumnRe = props.enableColumnResizing) !== null && _props$enableColumnRe !== void 0 ? _props$enableColumnRe : presetOptions.enableColumnResizing,
10449
10456
  enableRowExpansion: enableRowExpansion && !!props.rowExpansionRenderer,
10450
- enableRowSelection: enableRowSelection && !!props.onRowSelect,
10451
- enableRowSelectionSingle: enableRowSelectionSingle && !!props.onRowSelect,
10457
+ enableRowSelection: !!props.onRowSelect && enableRowSelection,
10458
+ enableRowSelectionSingle: !!props.onRowSelect && enableRowSelectionSingle,
10452
10459
  // custom -- common between all table types
10453
10460
  enableColumnOrdering: (_props$enableColumnOr = props.enableColumnOrdering) !== null && _props$enableColumnOr !== void 0 ? _props$enableColumnOr : presetOptions.enableColumnOrdering,
10454
10461
  enableFontSize: (_props$enableFontSize = props.enableFontSize) !== null && _props$enableFontSize !== void 0 ? _props$enableFontSize : presetOptions.enableFontSize,
@@ -10745,11 +10752,12 @@ function useTableRowSelection(isEnabled = false) {
10745
10752
  const rows = table.getRowModel().rows;
10746
10753
  const tableMeta = table.options.meta;
10747
10754
  if (event.key === ' ') {
10755
+ var _rows$rowActiveIndex;
10748
10756
  event.preventDefault();
10749
10757
  const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;
10750
- if (rowActiveIndex !== undefined) {
10751
- var _rows$rowActiveIndex;
10752
- (_rows$rowActiveIndex = rows[rowActiveIndex]) === null || _rows$rowActiveIndex === void 0 ? void 0 : _rows$rowActiveIndex.toggleSelected();
10758
+ if (rowActiveIndex !== undefined && (_rows$rowActiveIndex = rows[rowActiveIndex]) !== null && _rows$rowActiveIndex !== void 0 && _rows$rowActiveIndex.getCanSelect()) {
10759
+ var _rows$rowActiveIndex2;
10760
+ (_rows$rowActiveIndex2 = rows[rowActiveIndex]) === null || _rows$rowActiveIndex2 === void 0 ? void 0 : _rows$rowActiveIndex2.toggleSelected();
10753
10761
  }
10754
10762
  return;
10755
10763
  } else if ((event.ctrlKey || event.metaKey) && event.key === 'a') {
@@ -11365,22 +11373,24 @@ function useTableRowHeightListener(table) {
11365
11373
  }
11366
11374
 
11367
11375
  function useTableRowSelectionListener(table, onRowSelect) {
11368
- const rowSelection = table.getState().rowSelection;
11376
+ const rows = table.getSelectedRowModel().flatRows;
11377
+ const rowSelection = React__default.useMemo(() => rows.map(row => row.original), [rows]);
11369
11378
  useLazyEffect(() => {
11370
- const selectedRows = table.getSelectedRowModel().rows;
11371
11379
  if (table.options.enableRowSelection && typeof onRowSelect === 'function') {
11372
11380
  if (table.options.enableMultiRowSelection) {
11373
- onRowSelect(selectedRows.map(row => row.original));
11381
+ onRowSelect(rowSelection);
11374
11382
  } else {
11375
- var _ref, _selectedRows$;
11376
- onRowSelect((_ref = [(_selectedRows$ = selectedRows[0]) === null || _selectedRows$ === void 0 ? void 0 : _selectedRows$.original]) !== null && _ref !== void 0 ? _ref : []);
11383
+ var _ref;
11384
+ onRowSelect((_ref = [rowSelection[0]]) !== null && _ref !== void 0 ? _ref : []);
11377
11385
  }
11378
11386
  }
11379
- // It is important to stringify either rowSelection state or selectedRows, because we don't
11380
- // know if the array or object that is returned by react-table has the same reference or not.
11381
- // rowSelection state is used here because it will be more expensive to strigify selectedRows
11382
- // than rowSelection state.
11383
- }, [table.options.enableRowSelection, table.options.enableMultiRowSelection, JSON.stringify(rowSelection)]);
11387
+ /**
11388
+ * Casting to a boolean, since enableRowSelection and enableMultiRowSelection can be a functions,
11389
+ * and setting a function as depoendency will lead to infinity loop. And in case of row selection useEffect,
11390
+ * we only need to know if selection was enabled or disabled, because enableRowSelection/enableMultiRowSelection functions
11391
+ * will be applied directly to particular rows.
11392
+ */
11393
+ }, [!!table.options.enableRowSelection, !!table.options.enableMultiRowSelection, rowSelection]);
11384
11394
  }
11385
11395
 
11386
11396
  function resetHighlightedColumnIndexes(value, table) {
@@ -11445,7 +11455,7 @@ function useTableSearchListener(table, onChangeSearch) {
11445
11455
  onChangeSearch(query);
11446
11456
  }
11447
11457
  }
11448
- }, [meta.server.loadAllStatus, meta.search.isEnabled, meta.search.enableGlobalFilter, table.getRowModel().rows.length, table.getState().globalFilter, JSON.stringify(table.getState().sorting), JSON.stringify(table.getState().columnVisibility), onChangeSearch]);
11458
+ }, [meta.server.loadAllStatus, meta.search.isEnabled, meta.search.enableGlobalFilter, table.getRowModel().rows, table.getState().globalFilter, JSON.stringify(table.getState().sorting), JSON.stringify(table.getState().columnVisibility), onChangeSearch]);
11449
11459
  }
11450
11460
 
11451
11461
  function useTableSettingsListener(table, onChangeSettings) {
@@ -11556,14 +11566,19 @@ function useTableRowDrop(isEnabled = false, onRowDrop) {
11556
11566
  };
11557
11567
  }
11558
11568
 
11569
+ // Placed this array outside the hook to avoid creating a new array reference on each hook re-render
11570
+ const DEFAULT_EMPTY_ARRAY = [];
11559
11571
  function useTableManager(props, meta, internalColumns) {
11560
- var _props$data, _props$length, _instance$options$met;
11572
+ var _props$data, _props$length, _meta$editing, _instance$options$met;
11561
11573
  // CSS.escape would be best here, but it doesn't seem to work very well
11562
11574
  const safeId = props.id.replace('.', '_');
11563
11575
  // configure table options, merging props with presets
11564
11576
  const options = getTableFeaturePreset(props);
11565
11577
  // load any persisted table settings and merge them with any defaults
11566
11578
  const [settings, setSettings] = useTableSettings(options.enableSaveSettings, safeId, props.defaultSettings, props.onChangeSettings);
11579
+ // ensure data is always valid
11580
+ const data = (_props$data = props.data) !== null && _props$data !== void 0 ? _props$data : DEFAULT_EMPTY_ARRAY;
11581
+ const length = (_props$length = props.length) !== null && _props$length !== void 0 ? _props$length : data.length;
11567
11582
  // configure common custom features
11568
11583
  const columnFreezing = useTableColumnFreezing(options.enableColumnFreezing);
11569
11584
  const columnOrdering = useTableColumnOrdering(options.enableColumnOrdering);
@@ -11573,13 +11588,13 @@ function useTableManager(props, meta, internalColumns) {
11573
11588
  const rowActive = useTableRowActive(options.enableRowActive, props.defaultRowActiveIndex);
11574
11589
  const rowActions = useTableRowActions(options.enableRowActions, props.rowActions, props.rowActionsLength);
11575
11590
  const rowClick = useTableRowClick(options.enableRowClick, props.onRowClick);
11576
- const rowDrag = useTableRowDrag(options.enableRowDrag, props.onRowDrag);
11591
+ const rowDrag = useTableRowDrag(options.enableRowDrag && !(meta !== null && meta !== void 0 && (_meta$editing = meta.editing) !== null && _meta$editing !== void 0 && _meta$editing.isEditing), props.onRowDrag);
11577
11592
  const rowDrop = useTableRowDrop(options.enableRowDrop, props.onRowDrop);
11578
11593
  const rowExpansion = useTableRowExpansion(options.enableRowExpansion, props.rowExpansionRenderer);
11579
11594
  const rowGoto = useTableRowGoto(options.enableRowGoto, props.onRowGoto);
11580
11595
  const rowGroups = useTableRowGroups(props.rowActionsForGroup);
11581
11596
  const rowHeight = useTableRowHeight(options.enableRowHeight, settings.rowHeight);
11582
- const rowSelection = useTableRowSelection(options.enableRowSelection);
11597
+ const rowSelection = useTableRowSelection(!!options.enableRowSelection);
11583
11598
  const search = useTableSearch(options.enableSearch, settings.excludeUnmatchedRecordsInSearch);
11584
11599
  const server = useTableServerLoading(props.loadPage, props.loadAll, props.pageSize);
11585
11600
  // TODO: memoise
@@ -11590,9 +11605,6 @@ function useTableManager(props, meta, internalColumns) {
11590
11605
  } = mapTableChildrenToColumns(props, settings, options, internalColumns);
11591
11606
  // configure initial table state
11592
11607
  const initialState = useReactTableInitialState(props, columns, settings, defaultState);
11593
- // ensure data is always valid
11594
- const data = (_props$data = props.data) !== null && _props$data !== void 0 ? _props$data : [];
11595
- const length = (_props$length = props.length) !== null && _props$length !== void 0 ? _props$length : data.length;
11596
11608
  // create a react-table instance
11597
11609
  const instance = reactTable.useReactTable({
11598
11610
  data,
@@ -11705,8 +11717,9 @@ function useTableStyleGrid(tableId, table, fontSize) {
11705
11717
  // printing grid
11706
11718
  // we have to be specific so that nested tables don't inherit the same css
11707
11719
  const hiddenColumns = printHiddenColumns.map(id => `table[data-taco^='table']#${tableId} > thead > tr > th[data-cell-id='${id}']\n,table[data-taco^='table']#${tableId} > tbody > tr > td[data-cell-id='${id}']\n`).join(',');
11720
+ // Ensure that tfoot cells are not hidden so that the summary and footer cells appear in the printed document
11708
11721
  const stylesheet = `@media print { table[data-taco^='table']#${tableId} { grid-template-columns: repeat(${printGridTemplateColumns}, auto) !important; }
11709
- table[data-taco^='table']#${tableId} [data-cell-id^='__']${hiddenColumns ? `, ${hiddenColumns}` : ''} { display: none; }}`;
11722
+ table[data-taco^='table']#${tableId} &:not(tfoot) [data-cell-id^='__']${hiddenColumns ? `, ${hiddenColumns}` : ''} { display: none; } table[data-taco^='table']#${tableId} tr { page-break-inside: avoid; break-inside: avoid;}}`;
11710
11723
  return {
11711
11724
  style,
11712
11725
  stylesheet
@@ -12251,58 +12264,18 @@ const renderer = {
12251
12264
  }
12252
12265
  };
12253
12266
 
12254
- const GHOST_ELEMENT_ID = 'taco_table_dragging';
12255
12267
  function Header$2() {
12256
12268
  return null;
12257
12269
  }
12258
- function Cell$1(context) {
12259
- const {
12260
- row,
12261
- table
12262
- } = context;
12270
+ function Cell$1() {
12263
12271
  const {
12264
12272
  texts
12265
12273
  } = useLocalization();
12266
- const tableMeta = context.table.options.meta;
12267
- const onDragStart = event => {
12268
- var _tableMeta$rowDrag$se, _tableMeta$rowDrag, _tableMeta$rowDrag$ha, _tableMeta$rowDrag2;
12269
- let rows = [row];
12270
- if (table.options.enableRowSelection) {
12271
- rows = row.getIsSelected() ? table.getSelectedRowModel().rows : [row, ...table.getSelectedRowModel().rows];
12272
- }
12273
- const data = rows.map(row => row.original);
12274
- (_tableMeta$rowDrag$se = (_tableMeta$rowDrag = tableMeta.rowDrag).setDragging) === null || _tableMeta$rowDrag$se === void 0 ? void 0 : _tableMeta$rowDrag$se.call(_tableMeta$rowDrag, rows.reduce((dragging, rowBeingDragged) => ({
12275
- ...dragging,
12276
- [rowBeingDragged.id]: true
12277
- }), {}));
12278
- // set a default data value so that the consumer doesn't have to
12279
- event.dataTransfer.setData('text', JSON.stringify(data));
12280
- const showPlaceholder = text => {
12281
- const ghost = document.createElement('div');
12282
- ghost.id = GHOST_ELEMENT_ID;
12283
- ghost.className = 'wcag-blue rounded flex w-48 p-4 absolute -ml-[100vw]';
12284
- ghost.innerText = text;
12285
- document.body.appendChild(ghost);
12286
- event.dataTransfer.setDragImage(ghost, 0, 0);
12287
- };
12288
- const setDataTransfer = text => event.dataTransfer.setData('text', text);
12289
- (_tableMeta$rowDrag$ha = (_tableMeta$rowDrag2 = tableMeta.rowDrag).handleRowDrag) === null || _tableMeta$rowDrag$ha === void 0 ? void 0 : _tableMeta$rowDrag$ha.call(_tableMeta$rowDrag2, data, showPlaceholder, setDataTransfer);
12290
- };
12291
- const handleDragEnd = () => {
12292
- var _document$getElementB, _tableMeta$rowDrag$se2, _tableMeta$rowDrag3;
12293
- (_document$getElementB = document.getElementById(GHOST_ELEMENT_ID)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove();
12294
- (_tableMeta$rowDrag$se2 = (_tableMeta$rowDrag3 = tableMeta.rowDrag).setDragging) === null || _tableMeta$rowDrag$se2 === void 0 ? void 0 : _tableMeta$rowDrag$se2.call(_tableMeta$rowDrag3, {});
12295
- };
12296
- return /*#__PURE__*/React__default.createElement("div", {
12297
- draggable: true,
12298
- onDragStart: onDragStart,
12299
- onDragOver: event => event.preventDefault(),
12300
- onDragEnd: handleDragEnd
12301
- }, /*#__PURE__*/React__default.createElement(Icon, {
12274
+ return /*#__PURE__*/React__default.createElement(Icon, {
12302
12275
  "aria-label": texts.table.columns.drag.tooltip,
12303
12276
  name: "drag",
12304
- className: "text-grey-darkest invisible -mt-1 ml-[2px] cursor-grab active:cursor-grabbing group-hover/row:visible group-[[aria-grabbed='true']]/row:text-white"
12305
- }));
12277
+ className: cn("text-grey-darkest invisible -mt-1 ml-[2px] cursor-grab active:cursor-grabbing group-hover/row:visible group-[[aria-grabbed='true']]/row:text-white", '[[data-table-editing-mode]_&]:!invisible')
12278
+ });
12306
12279
  }
12307
12280
  const renderer$1 = {
12308
12281
  header: Header$2,
@@ -12416,9 +12389,8 @@ function Header$4(context) {
12416
12389
  }, /*#__PURE__*/React__default.createElement(Checkbox, {
12417
12390
  "aria-label": title,
12418
12391
  className: "hover:border-blue !-mt-px",
12419
- key: String(`${isAllRowsSelected}_${isSomeRowsSelected}`),
12420
12392
  checked: isAllRowsSelected,
12421
- indeterminate: isSomeRowsSelected,
12393
+ indeterminate: isSomeRowsSelected && !isAllRowsSelected,
12422
12394
  loading: tableMeta.server.loadAllStatus === exports.TableServerLoadAllState.Loading,
12423
12395
  onChange: handleChange
12424
12396
  }));
@@ -12447,6 +12419,7 @@ function Cell$3(context) {
12447
12419
  return null;
12448
12420
  }
12449
12421
  const isSelected = row.getIsGrouped() ? row.getIsAllSubRowsSelected() : row.getIsSelected();
12422
+ const canSelect = row.getCanSelect();
12450
12423
  const title = isSelected ? texts.table.columns.select.deselect : texts.table.columns.select.select;
12451
12424
  if (table.options.enableMultiRowSelection) {
12452
12425
  const handleClick = function (event) {
@@ -12465,7 +12438,7 @@ function Cell$3(context) {
12465
12438
  function _temp4() {
12466
12439
  table.setRowSelection(currentRowSelection => ({
12467
12440
  ...currentRowSelection,
12468
- ...selectedRows.reduce((state, row) => ({
12441
+ ...selectedRows.filter(row => row.getCanSelect()).reduce((state, row) => ({
12469
12442
  ...state,
12470
12443
  [row.id]: true
12471
12444
  }), {})
@@ -12493,6 +12466,7 @@ function Cell$3(context) {
12493
12466
  }
12494
12467
  };
12495
12468
  return /*#__PURE__*/React__default.createElement(Tooltip, {
12469
+ hidden: !canSelect,
12496
12470
  title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, title, /*#__PURE__*/React__default.createElement(Shortcut, {
12497
12471
  className: "ml-2",
12498
12472
  keys: "Space"
@@ -12502,11 +12476,12 @@ function Cell$3(context) {
12502
12476
  className: "!mt-0",
12503
12477
  checked: isSelected,
12504
12478
  onClick: handleClick,
12479
+ disabled: !canSelect,
12505
12480
  // this is necessary to remove console spam from eslint
12506
12481
  onChange: () => false
12507
12482
  }));
12508
12483
  } else {
12509
- const className = cn('!mt-0', getRadioClassnames());
12484
+ const className = cn('!mt-0', getRadioClassnames(!canSelect));
12510
12485
  const handleClick = event => {
12511
12486
  event.stopPropagation();
12512
12487
  row.toggleSelected();
@@ -12514,7 +12489,8 @@ function Cell$3(context) {
12514
12489
  };
12515
12490
  return /*#__PURE__*/React__default.createElement("button", {
12516
12491
  className: className,
12517
- "aria-checked": isSelected,
12492
+ "aria-checked": canSelect && isSelected,
12493
+ disabled: !canSelect,
12518
12494
  onClick: handleClick,
12519
12495
  role: "radio",
12520
12496
  type: "button"
@@ -12767,6 +12743,37 @@ const DisplayRow = /*#__PURE__*/React__default.memo(function DisplayRow(props) {
12767
12743
  // row drag
12768
12744
  if (tableMeta.rowDrag.isEnabled) {
12769
12745
  attributes['aria-grabbed'] = !!tableMeta.rowDrag.dragging[row.id];
12746
+ attributes.draggable = true;
12747
+ const GHOST_ELEMENT_ID = 'taco_table_dragging';
12748
+ attributes.onDragStart = event => {
12749
+ var _tableMeta$rowDrag$se, _tableMeta$rowDrag, _tableMeta$rowDrag$ha, _tableMeta$rowDrag2;
12750
+ let rows = [row];
12751
+ if (row.getCanSelect()) {
12752
+ rows = row.getIsSelected() ? table.getSelectedRowModel().rows : [row, ...table.getSelectedRowModel().rows];
12753
+ }
12754
+ const data = rows.map(row => row.original);
12755
+ (_tableMeta$rowDrag$se = (_tableMeta$rowDrag = tableMeta.rowDrag).setDragging) === null || _tableMeta$rowDrag$se === void 0 ? void 0 : _tableMeta$rowDrag$se.call(_tableMeta$rowDrag, rows.reduce((dragging, rowBeingDragged) => ({
12756
+ ...dragging,
12757
+ [rowBeingDragged.id]: true
12758
+ }), {}));
12759
+ // set a default data value so that the consumer doesn't have to
12760
+ event.dataTransfer.setData('text', JSON.stringify(data));
12761
+ const showPlaceholder = text => {
12762
+ const ghost = document.createElement('div');
12763
+ ghost.id = GHOST_ELEMENT_ID;
12764
+ ghost.className = 'wcag-blue rounded flex w-48 p-4 absolute -ml-[100vw]';
12765
+ ghost.innerText = text;
12766
+ document.body.appendChild(ghost);
12767
+ event.dataTransfer.setDragImage(ghost, 0, 0);
12768
+ };
12769
+ const setDataTransfer = text => event.dataTransfer.setData('text', text);
12770
+ (_tableMeta$rowDrag$ha = (_tableMeta$rowDrag2 = tableMeta.rowDrag).handleRowDrag) === null || _tableMeta$rowDrag$ha === void 0 ? void 0 : _tableMeta$rowDrag$ha.call(_tableMeta$rowDrag2, data, showPlaceholder, setDataTransfer);
12771
+ };
12772
+ attributes.onDragEnd = () => {
12773
+ var _document$getElementB, _tableMeta$rowDrag$se2, _tableMeta$rowDrag3;
12774
+ (_document$getElementB = document.getElementById(GHOST_ELEMENT_ID)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.remove();
12775
+ (_tableMeta$rowDrag$se2 = (_tableMeta$rowDrag3 = tableMeta.rowDrag).setDragging) === null || _tableMeta$rowDrag$se2 === void 0 ? void 0 : _tableMeta$rowDrag$se2.call(_tableMeta$rowDrag3, {});
12776
+ };
12770
12777
  }
12771
12778
  // row drop
12772
12779
  const [isDraggedOver, dropTargetProps] = useDropTarget(event => {
@@ -12785,7 +12792,7 @@ const DisplayRow = /*#__PURE__*/React__default.memo(function DisplayRow(props) {
12785
12792
  attributes['data-row-group'] = row.getIsGrouped() ? true : undefined;
12786
12793
  }
12787
12794
  // row selection
12788
- if (table.options.enableRowSelection) {
12795
+ if (row.getCanSelect()) {
12789
12796
  attributes['data-row-selected'] = row.getIsSelected() || row.getIsAllSubRowsSelected() ? true : undefined;
12790
12797
  }
12791
12798
  // row expansion
@@ -12806,6 +12813,7 @@ const DisplayRow = /*#__PURE__*/React__default.memo(function DisplayRow(props) {
12806
12813
  const isExpanded = !!attributes['data-row-expanded'];
12807
12814
  useSetVirtualisedRowHeight(measureRow, ref.current, expansionRef.current, isExpanded);
12808
12815
  const className = cn('group/row', {
12816
+ 'hover:cursor-grab': tableMeta.rowDrag.isEnabled && typeof attributes.onClick !== 'function',
12809
12817
  'hover:cursor-pointer': typeof attributes.onClick === 'function'
12810
12818
  });
12811
12819
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("tr", Object.assign({}, attributes, {
@@ -12956,7 +12964,7 @@ function Resizer(props) {
12956
12964
  }
12957
12965
  };
12958
12966
  const handle = /*#__PURE__*/React__default.createElement("div", {
12959
- className: cn('invisible absolute right-0 top-0 z-10 -mr-2 flex h-full w-4 cursor-col-resize touch-none select-none justify-center rounded py-0.5', 'group-hover/header:visible', '[th:last-child>&]:!mr-0 [th:last-child>&]:w-2', {
12967
+ className: cn('invisible absolute right-0 top-0 z-10 -mr-2 flex h-full w-4 cursor-col-resize touch-none select-none justify-center rounded py-0.5', 'group-hover/header:visible print:hidden', '[th:last-child>&]:!mr-0 [th:last-child>&]:w-2', {
12960
12968
  '!visible': isResizing
12961
12969
  }),
12962
12970
  onClick: handleClick,
@@ -13191,7 +13199,9 @@ function HeaderMenu(props) {
13191
13199
  // visible - expanded
13192
13200
  'aria-expanded:!w-6 aria-expanded:!min-w-[theme(spacing.6)]',
13193
13201
  // visible - focus
13194
- 'focus:!w-6 focus:!min-w-[theme(spacing.6)]', {
13202
+ 'focus:!w-6 focus:!min-w-[theme(spacing.6)]',
13203
+ // print styles
13204
+ 'print:!hidden', {
13195
13205
  '!w-6 !min-w-[theme(spacing.6)]': !!popoverElement
13196
13206
  }, props.className);
13197
13207
  return /*#__PURE__*/React__default.createElement(IconButton, {
@@ -13591,7 +13601,8 @@ function Summary(props) {
13591
13601
  count = /*#__PURE__*/React__default.createElement("strong", null, new Intl.NumberFormat(locale).format(length));
13592
13602
  }
13593
13603
  return /*#__PURE__*/React__default.createElement("div", {
13594
- className: "sticky left-0 z-20 flex h-full w-fit items-center whitespace-nowrap bg-white pr-1 shadow-[12px_0px_6px_white]",
13604
+ // translate-y-1 is used to prevent the summary cell's box shadow from clipping the border
13605
+ className: "sticky left-0 z-20 flex h-full w-fit items-center whitespace-nowrap bg-white pr-1 shadow-[12px_0px_6px_white] print:!translate-y-1",
13595
13606
  "data-taco": "table-footer-summary"
13596
13607
  }, label, "\u00A0", count);
13597
13608
  }
@@ -15331,7 +15342,6 @@ const Search$2 = /*#__PURE__*/React__default.forwardRef(function ListboxSearch(p
15331
15342
  invalid: !!validationError,
15332
15343
  message: validationError === null || validationError === void 0 ? void 0 : validationError.message
15333
15344
  }, /*#__PURE__*/React__default.createElement(Input, Object.assign({}, otherProps, {
15334
- "aria-hidden": true,
15335
15345
  autoFocus: true,
15336
15346
  invalid: !!validationError,
15337
15347
  onChange: handleChange,
@@ -19208,7 +19218,7 @@ function Cell$5(props) {
19208
19218
  const tableMeta = cell.getContext().table.options.meta;
19209
19219
  const columnMeta = cell.column.columnDef.meta;
19210
19220
  if (tableMeta.editing.isEditing) {
19211
- if (columnMeta.control) {
19221
+ if (columnMeta.control && columnMeta.enableEditing) {
19212
19222
  const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;
19213
19223
  const cellError = tableMeta.editing.getCellError(cell);
19214
19224
  const hasErrorAndIsEditing = cellError ? tableMeta.editing.isEditing : true;
@@ -19602,7 +19612,7 @@ function CreateNewRowButton(props) {
19602
19612
  }, [rowCreated]);
19603
19613
  return /*#__PURE__*/React__default.createElement("tr", {
19604
19614
  onClick: handleCreate,
19605
- className: "border-grey-300 hover:bg-grey-100 group !sticky bottom-10 left-0 z-[21] !block cursor-pointer border-t"
19615
+ className: "border-grey-300 hover:bg-grey-100 group !sticky bottom-10 left-0 z-[21] !block cursor-pointer border-t print:!hidden"
19606
19616
  }, /*#__PURE__*/React__default.createElement("td", {
19607
19617
  className: "!border-t-0 !bg-transparent"
19608
19618
  }, /*#__PURE__*/React__default.createElement(Button$1, {
@@ -19726,11 +19736,23 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
19726
19736
  }), children);
19727
19737
  });
19728
19738
  const TabList = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
19739
+ const {
19740
+ children
19741
+ } = props;
19729
19742
  const className = cn('border-grey-300 flex flex-row m-0 mb-4 print:hidden', 'aria-orientation-horizontal:border-b', 'aria-orientation-vertical:border-r aria-orientation-vertical:m-0 aria-orientation-vertical:mr-4 aria-orientation-vertical:flex-col', props.className);
19730
19743
  return /*#__PURE__*/React.createElement(TabsPrimitive.List, Object.assign({}, props, {
19731
19744
  className: className,
19732
19745
  ref: ref
19733
- }));
19746
+ }), /*#__PURE__*/React.createElement(OverflowGroup, {
19747
+ wrapChild: true,
19748
+ className: 'w-full [[aria-orientation="vertical"]_&]:flex-col',
19749
+ moreButton: text => /*#__PURE__*/React.createElement(Button$1, null, text)
19750
+ }, React.Children.toArray(children).filter(child => {
19751
+ if (/*#__PURE__*/React.isValidElement(child)) {
19752
+ return !child.props.hidden;
19753
+ }
19754
+ return true;
19755
+ })));
19734
19756
  });
19735
19757
  const TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
19736
19758
  const {
@@ -19740,7 +19762,7 @@ const TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
19740
19762
  tooltip,
19741
19763
  ...otherProps
19742
19764
  } = props;
19743
- const triggerClassName = cn('group relative p-0.5 outline-none disabled:cursor-not-allowed disabled:text-black/50',
19765
+ const triggerClassName = cn(props.className, 'group relative p-0.5 outline-none disabled:cursor-not-allowed disabled:text-black/50',
19744
19766
  // horizontal
19745
19767
  '[[aria-orientation="horizontal"]_&]:pb-1',
19746
19768
  // horizontal