@economic/taco 1.21.1 → 1.21.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/components/Provider/Localization.d.ts +70 -7
  2. package/dist/components/Table2/Table2.d.ts +74 -9
  3. package/dist/components/Table2/Table2.stories.d.ts +0 -1
  4. package/dist/components/Table2/components/EditModeButton.d.ts +1 -0
  5. package/dist/components/Table2/components/filters/components/InferredControl.d.ts +1 -1
  6. package/dist/components/Table2/types.d.ts +7 -4
  7. package/dist/components/Table2/utilities/columns.d.ts +5 -4
  8. package/dist/esm/packages/taco/src/components/Provider/Localization.js +70 -7
  9. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  10. package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js +1 -0
  11. package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js.map +1 -1
  12. package/dist/esm/packages/taco/src/components/Select2/Select2.js +1 -1
  13. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  14. package/dist/esm/packages/taco/src/components/Table2/Table2.js +17 -6
  15. package/dist/esm/packages/taco/src/components/Table2/Table2.js.map +1 -1
  16. package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js +24 -22
  17. package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js.map +1 -1
  18. package/dist/esm/packages/taco/src/components/Table2/components/EditModeButton.js +23 -4
  19. package/dist/esm/packages/taco/src/components/Table2/components/EditModeButton.js.map +1 -1
  20. package/dist/esm/packages/taco/src/components/Table2/components/RowDensityButton.js +6 -2
  21. package/dist/esm/packages/taco/src/components/Table2/components/RowDensityButton.js.map +1 -1
  22. package/dist/esm/packages/taco/src/components/Table2/components/Search.js +5 -0
  23. package/dist/esm/packages/taco/src/components/Table2/components/Search.js.map +1 -1
  24. package/dist/esm/packages/taco/src/components/Table2/components/ShortcutsGuideButton.js +14 -16
  25. package/dist/esm/packages/taco/src/components/Table2/components/ShortcutsGuideButton.js.map +1 -1
  26. package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js +14 -6
  27. package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js.map +1 -1
  28. package/dist/esm/packages/taco/src/components/Table2/components/column/Footer.js +6 -2
  29. package/dist/esm/packages/taco/src/components/Table2/components/column/Footer.js.map +1 -1
  30. package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js +10 -12
  31. package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js.map +1 -1
  32. package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js +10 -5
  33. package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js.map +1 -1
  34. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js +5 -5
  35. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js.map +1 -1
  36. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Comparator.js +20 -12
  37. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Comparator.js.map +1 -1
  38. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/InferredControl.js +3 -0
  39. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/InferredControl.js.map +1 -1
  40. package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js +4 -3
  41. package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js.map +1 -1
  42. package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js +8 -4
  43. package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js.map +1 -1
  44. package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js +1 -5
  45. package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js.map +1 -1
  46. package/dist/esm/packages/taco/src/components/Table2/types.js +2 -0
  47. package/dist/esm/packages/taco/src/components/Table2/types.js.map +1 -1
  48. package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js +1 -1
  49. package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js.map +1 -1
  50. package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js +31 -37
  51. package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js.map +1 -1
  52. package/dist/esm/packages/taco/src/components/Table2/utilities/filterFn.js +4 -0
  53. package/dist/esm/packages/taco/src/components/Table2/utilities/filterFn.js.map +1 -1
  54. package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js +2 -1
  55. package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js.map +1 -1
  56. package/dist/taco.cjs.development.js +274 -151
  57. package/dist/taco.cjs.development.js.map +1 -1
  58. package/dist/taco.cjs.production.min.js +1 -1
  59. package/dist/taco.cjs.production.min.js.map +1 -1
  60. package/package.json +2 -2
  61. package/types.json +316 -9
@@ -3635,7 +3635,77 @@ const defaultLocalisationTexts = {
3635
3635
  loading: 'Loading...'
3636
3636
  },
3637
3637
  table2: {
3638
+ columns: {
3639
+ actions: {
3640
+ tooltip: 'Other actions'
3641
+ },
3642
+ drag: {
3643
+ tooltip: 'Drag row'
3644
+ },
3645
+ expansion: {
3646
+ collapse: 'Collapse row',
3647
+ collapseAll: 'Collapse all rows',
3648
+ expand: 'Expand row',
3649
+ expandAll: 'Expand all rows'
3650
+ },
3651
+ select: {
3652
+ deselect: 'Deselect row',
3653
+ deselectAll: 'Deselect all rows',
3654
+ select: 'Select row',
3655
+ selectAll: 'Select all rows'
3656
+ }
3657
+ },
3658
+ columnSettings: {
3659
+ columnsOther: 'Pinned columns',
3660
+ columnsOtherDrop: 'Drop column here to unpin',
3661
+ columnsPinned: 'Other columns',
3662
+ columnsPinnedDrop: 'Drop column here to pin',
3663
+ search: 'Search column...',
3664
+ tooltip: 'Column settings'
3665
+ },
3666
+ editing: {
3667
+ button: 'Edit',
3668
+ tooltip: 'Edit',
3669
+ tooltipDisabled: 'There are no visible columns that support editing',
3670
+ rowIndicator: {
3671
+ rowWillMove: 'Row will move due to sorting',
3672
+ rowWillBeHidden: 'Row will hide due to filtering',
3673
+ rowWillMoveReasonSearch: 'Due to a search filter applied to this table, this row will be hidden as soon as you select another row',
3674
+ rowWillMoveReasonFilter: "Due to a filter applied to the column '[COLUMN]', this row will be hidden as soon as you select another row",
3675
+ rowWillMoveReasonSorting: "Due to sorting applied to the column '[COLUMN]', this row will move position as soon as you select another row"
3676
+ }
3677
+ },
3678
+ filters: {
3679
+ button: 'Filters',
3680
+ buttons: {
3681
+ addFilter: 'Add Filter',
3682
+ clearFilters: 'Clear all filters'
3683
+ },
3684
+ comparators: {
3685
+ contains: 'Contains',
3686
+ doesNotContain: 'Does not contain',
3687
+ isEqualTo: 'Is',
3688
+ isNotEqualTo: 'Is not',
3689
+ isGreaterThan: 'Is greater than',
3690
+ isLessThan: 'Is less than',
3691
+ isBetween: 'Is between',
3692
+ isOneOf: 'Is one of',
3693
+ isNoneOf: 'Is none of',
3694
+ isAllOf: 'Is all of',
3695
+ isEmpty: 'Is empty',
3696
+ isNotEmpty: 'Is not empty'
3697
+ },
3698
+ tooltip: 'Apply filters',
3699
+ total: 'Viewing [CURRENT] of [TOTAL]'
3700
+ },
3701
+ rowDensity: {
3702
+ tooltip: 'Row density'
3703
+ },
3704
+ search: {
3705
+ placeholder: 'Search...'
3706
+ },
3638
3707
  shortcuts: {
3708
+ tooltip: 'View keyboard shortcuts',
3639
3709
  search: 'Search',
3640
3710
  filter: 'Filter',
3641
3711
  previousRow: 'Previous row',
@@ -3648,13 +3718,6 @@ const defaultLocalisationTexts = {
3648
3718
  selectAllRows: 'Select all rows',
3649
3719
  expandRow: 'Expand current row',
3650
3720
  collapseRow: 'Collapse current row'
3651
- },
3652
- rowIndicator: {
3653
- rowWillMove: 'Row will move due to sorting',
3654
- rowWillBeFiltered: 'Row will hide due to filtering',
3655
- searchFilterMovementReason: 'Due to a search filter applied to this table, this row will be hidden as soon as you select another row',
3656
- tableFilterMovementReason: "Due to a filter applied to the column '[COLUMN]', this row will be hidden as soon as you select another row",
3657
- sortingMovementReason: "Due to sorting applied to the column '[COLUMN]', this row will move position as soon as you select another row"
3658
3721
  }
3659
3722
  },
3660
3723
  select: {
@@ -5782,6 +5845,7 @@ const SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput({
5782
5845
  className: "group-peer-focus:!border-transparent group-peer-focus:group-peer-active:!border-transparent -mr-2 !border-transparent !bg-transparent focus:!border-transparent",
5783
5846
  disabled: props.disabled || props.readOnly,
5784
5847
  onClick: handleClick,
5848
+ tabIndex: -1,
5785
5849
  tooltip: texts.searchInput.button
5786
5850
  })),
5787
5851
  ref: internalRef,
@@ -7594,9 +7658,10 @@ const Root = /*#__PURE__*/React__default.forwardRef(function CollectionRoot(prop
7594
7658
  const options = getOptionsFromCollection(event.currentTarget, querySelector);
7595
7659
  if (options) {
7596
7660
  if (isAriaDirectionKey(event)) {
7661
+ event.preventDefault();
7662
+ event.stopPropagation();
7597
7663
  const nextActiveIndex = getNextEnabledItem$1(event, options, activeIndex);
7598
7664
  if (nextActiveIndex !== undefined && nextActiveIndex !== activeIndex) {
7599
- event.preventDefault();
7600
7665
  setActiveOption(nextActiveIndex, event.currentTarget, options.item(nextActiveIndex));
7601
7666
  }
7602
7667
  } else if (activeIndex !== undefined) {
@@ -8754,7 +8819,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
8754
8819
  var _listboxRef$current;
8755
8820
  if (open) {
8756
8821
  event.preventDefault();
8757
- } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
8822
+ } else if (event.key === 'ArrowDown') {
8758
8823
  setOpen(true);
8759
8824
  }
8760
8825
  // the focus should always remain on the input, so we forward events on to the listbox
@@ -10377,7 +10442,7 @@ const toggleBetween$1 = (fromRowIndex, toRowIndex) => {
10377
10442
  const toIndex = toRowIndex > fromRowIndex ? toRowIndex : fromRowIndex;
10378
10443
  return [fromIndex, toIndex];
10379
10444
  };
10380
- function createRowDraggableColumn(onRowDrag) {
10445
+ function createRowDraggableColumn(onRowDrag, texts) {
10381
10446
  return {
10382
10447
  id: COLUMN_ID_FOR_DRAGGABLE,
10383
10448
  cell: ({
@@ -10416,7 +10481,7 @@ function createRowDraggableColumn(onRowDrag) {
10416
10481
  onDragStart: onDragStart,
10417
10482
  onDragEnd: onDragEnd
10418
10483
  }, /*#__PURE__*/React__default.createElement(Icon, {
10419
- "aria-label": "Drag row",
10484
+ "aria-label": texts.table2.columns.drag.tooltip,
10420
10485
  name: "drag",
10421
10486
  className: "text-grey-darkest invisible w-[20px] cursor-grab active:cursor-grabbing group-hover/row:visible group-[[aria-grabbed]]/row:text-white"
10422
10487
  }));
@@ -10432,19 +10497,19 @@ function createRowDraggableColumn(onRowDrag) {
10432
10497
  size: 10
10433
10498
  };
10434
10499
  }
10435
- function createRowSelectionColumn(enableMultipleRowSelection, lastSelectedRowIndex, onRowDrag, tableRef) {
10500
+ function createRowSelectionColumn(enableMultipleRowSelection, lastSelectedRowIndex, onRowDrag, tableRef, texts) {
10436
10501
  let header;
10437
10502
  let cell;
10438
10503
  if (enableMultipleRowSelection) {
10439
10504
  header = ({
10440
10505
  table
10441
10506
  }) => /*#__PURE__*/React__default.createElement(Tooltip, {
10442
- title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, table.getIsAllPageRowsSelected() ? 'Deselect all' : 'Select all', /*#__PURE__*/React__default.createElement(Shortcut$1, {
10507
+ title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, table.getIsAllPageRowsSelected() ? texts.table2.columns.select.deselectAll : texts.table2.columns.select.selectAll, /*#__PURE__*/React__default.createElement(Shortcut$1, {
10443
10508
  className: "ml-2",
10444
10509
  keys: ['Ctrl', 'A']
10445
10510
  }))
10446
10511
  }, /*#__PURE__*/React__default.createElement(Checkbox, {
10447
- "aria-label": table.getIsAllPageRowsSelected() ? 'Deselect all rows' : 'Select all rows',
10512
+ "aria-label": table.getIsAllPageRowsSelected() ? texts.table2.columns.select.deselectAll : texts.table2.columns.select.selectAll,
10448
10513
  className: "hover:border-blue !mt-0",
10449
10514
  checked: table.getIsAllPageRowsSelected(),
10450
10515
  indeterminate: table.getIsSomePageRowsSelected(),
@@ -10474,12 +10539,12 @@ function createRowSelectionColumn(enableMultipleRowSelection, lastSelectedRowInd
10474
10539
  (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.focus();
10475
10540
  };
10476
10541
  return /*#__PURE__*/React__default.createElement(Tooltip, {
10477
- title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, table.getIsAllPageRowsSelected() ? 'Deselect' : 'Select', /*#__PURE__*/React__default.createElement(Shortcut$1, {
10542
+ title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, row.getIsSelected() ? texts.table2.columns.select.select : texts.table2.columns.select.deselect, /*#__PURE__*/React__default.createElement(Shortcut$1, {
10478
10543
  className: "ml-2",
10479
10544
  keys: ['Space']
10480
10545
  }))
10481
10546
  }, /*#__PURE__*/React__default.createElement(Checkbox, {
10482
- "aria-label": row.getIsSelected() ? 'Deselect row' : 'Select row',
10547
+ "aria-label": row.getIsSelected() ? texts.table2.columns.select.select : texts.table2.columns.select.deselect,
10483
10548
  className: "hover:border-blue !mt-[0.45rem]",
10484
10549
  checked: row.getIsSelected(),
10485
10550
  onClick: handleClick,
@@ -10529,15 +10594,15 @@ function createRowSelectionColumn(enableMultipleRowSelection, lastSelectedRowInd
10529
10594
  size: 46
10530
10595
  };
10531
10596
  }
10532
- function createRowExpansionColumn() {
10597
+ function createRowExpansionColumn(texts) {
10533
10598
  return {
10534
10599
  id: COLUMN_ID_FOR_EXPANSION,
10535
10600
  header: ({
10536
10601
  table
10537
10602
  }) => /*#__PURE__*/React__default.createElement(Tooltip, {
10538
- title: table.getIsSomeRowsExpanded() ? 'Collapse all' : 'Expand all'
10603
+ title: table.getIsSomeRowsExpanded() ? texts.table2.columns.expansion.collapseAll : texts.table2.columns.expansion.expandAll
10539
10604
  }, /*#__PURE__*/React__default.createElement(IconButton, {
10540
- title: table.getIsSomeRowsExpanded() ? 'Collapse all rows' : 'Expand all rows',
10605
+ title: table.getIsSomeRowsExpanded() ? texts.table2.columns.expansion.collapseAll : texts.table2.columns.expansion.expandAll,
10541
10606
  appearance: "discrete",
10542
10607
  className: "-mb-2 -mt-1.5",
10543
10608
  icon: table.getIsSomeRowsExpanded() ? 'chevron-down-double' : 'chevron-right-double',
@@ -10550,12 +10615,12 @@ function createRowExpansionColumn() {
10550
10615
  cell: ({
10551
10616
  row
10552
10617
  }) => /*#__PURE__*/React__default.createElement(Tooltip, {
10553
- title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, row.getIsExpanded() ? 'Collapse' : 'Expand', /*#__PURE__*/React__default.createElement(Shortcut$1, {
10618
+ title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, row.getIsExpanded() ? texts.table2.columns.expansion.collapse : texts.table2.columns.expansion.expand, /*#__PURE__*/React__default.createElement(Shortcut$1, {
10554
10619
  className: "ml-2",
10555
10620
  keys: ['Ctrl', row.getIsExpanded() ? '←' : '→']
10556
10621
  }))
10557
10622
  }, /*#__PURE__*/React__default.createElement(IconButton, {
10558
- title: row.getIsExpanded() ? 'Collapse row' : 'Expand row',
10623
+ title: row.getIsExpanded() ? texts.table2.columns.expansion.collapse : texts.table2.columns.expansion.expand,
10559
10624
  appearance: "discrete",
10560
10625
  icon: row.getIsExpanded() ? 'chevron-down' : 'chevron-right',
10561
10626
  onClick: event => {
@@ -10579,30 +10644,19 @@ const getActionPropertyValue = (property, row) => typeof property === 'function'
10579
10644
  function RowActionCell({
10580
10645
  row,
10581
10646
  actions,
10582
- moreActions
10647
+ moreActions,
10648
+ table,
10649
+ texts
10583
10650
  }) {
10584
10651
  const isVisible = action => typeof action.visible !== 'undefined' ? typeof action.visible === 'function' ? action.visible(row.original) : action.visible : true;
10585
10652
  const visibleActions = actions.filter(isVisible);
10586
10653
  const visibleMoreActions = moreActions.filter(isVisible);
10587
- const rowActionCellWidth = React__default.useMemo(() => {
10588
- const totalButtons = visibleActions.length + (visibleMoreActions.length ? 1 : 0);
10589
- // this is necessary because row actions is has this mount hover delay, which makes the
10590
- // size calculation in the header get set before rendering - meaning the size doesn't include the buttons
10591
- // when we cache icons this can go
10592
- const paddingSize = 8;
10593
- const buttonSize = 32;
10594
- return paddingSize + totalButtons * buttonSize;
10595
- }, [visibleActions.length, visibleMoreActions.length]);
10596
- // Instead of relying on row.index to figure out whether the row is being hovered or is active. We should rely on a
10597
- // CSS fix. The reason behind this is that row data or index is the initial data or index that is passed to the
10598
- // table on the first render, the indexes of row changes when sorting or filtering is applied.
10599
10654
  // If the row is not the active row or the hovered row then actions are hidden.
10600
10655
  const actionClassName = 'group-hover/row:flex group-[[aria-current]]/row:flex hidden';
10656
+ // only actions in the active row should be tabbable
10657
+ const tabIndex = table.options.meta.activeRowIndex === row.index ? 0 : -1;
10601
10658
  return /*#__PURE__*/React__default.createElement("span", {
10602
- className: "-mb-2 -mt-1.5 flex justify-end text-right",
10603
- style: {
10604
- width: rowActionCellWidth
10605
- }
10659
+ className: "-mb-2 -mt-1.5 flex justify-end text-right"
10606
10660
  }, visibleActions.map((action, i) => /*#__PURE__*/React__default.createElement(IconButton, {
10607
10661
  key: i,
10608
10662
  className: actionClassName,
@@ -10617,15 +10671,17 @@ function RowActionCell({
10617
10671
  action.onClick(row.original);
10618
10672
  }
10619
10673
  },
10674
+ tabIndex: tabIndex,
10620
10675
  tooltip: getActionPropertyValue(action.text, row.original)
10621
10676
  })), visibleMoreActions.length ? /*#__PURE__*/React__default.createElement(IconButton, {
10622
10677
  className: actionClassName,
10623
- "aria-label": "View other actions",
10678
+ "aria-label": texts.table2.columns.actions.tooltip,
10624
10679
  appearance: "discrete",
10625
10680
  icon: "more",
10626
10681
  onClick: event => {
10627
10682
  event.preventDefault();
10628
10683
  },
10684
+ tabIndex: tabIndex,
10629
10685
  menu: menuProps => /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, visibleMoreActions.map((action, i) => /*#__PURE__*/React__default.createElement(Menu$1.Item, {
10630
10686
  key: i,
10631
10687
  dialog: action.dialog ? action.dialog(row.original) : undefined,
@@ -10637,25 +10693,28 @@ function RowActionCell({
10637
10693
  }
10638
10694
  }
10639
10695
  }, getActionPropertyValue(action.text, row.original))))),
10640
- tooltip: "Other actions..."
10696
+ tooltip: texts.table2.columns.actions.tooltip
10641
10697
  }) : null);
10642
10698
  }
10643
- function createRowActionsColumn(rowActions) {
10644
- const actions = rowActions.slice(0, 3);
10645
- const moreActions = rowActions.slice(3);
10699
+ function createRowActionsColumn(rowActions, texts) {
10700
+ const actions = rowActions.length === 4 ? rowActions : rowActions.slice(0, 3);
10701
+ const moreActions = rowActions.slice(rowActions.length === 4 ? 4 : 3);
10646
10702
  return {
10647
10703
  id: COLUMN_ID_FOR_ACTIONS,
10648
10704
  cell: ({
10649
- row
10705
+ row,
10706
+ table
10650
10707
  }) => /*#__PURE__*/React__default.createElement(RowActionCell, {
10651
10708
  row: row,
10652
10709
  actions: actions,
10653
- moreActions: moreActions
10710
+ moreActions: moreActions,
10711
+ texts: texts,
10712
+ table: table
10654
10713
  }),
10655
10714
  meta: {
10656
10715
  align: 'right',
10657
10716
  className: row => cn('items-center print:opacity-0 group-[[aria-current]]/row:sticky group-hover/row:sticky right-0 bg-transparent !px-1', {
10658
- 'group-hover/row:!shadow-[-6px_0px_6px_theme(colors.grey.100)] group-[[aria-current]]/row:!shadow-[-6px_0px_6px_theme(colors.grey.100)]': !row.getIsSelected(),
10717
+ 'group-[[aria-current]]/row:!shadow-[-6px_0px_6px_theme(colors.grey.200)]': !row.getIsSelected(),
10659
10718
  'shadow-[-6px_0px_6px_theme(colors.blue.100)]': row.getIsSelected()
10660
10719
  }),
10661
10720
  disableTruncation: true,
@@ -10679,7 +10738,7 @@ const getDensityPadding = (density, editing = false) => {
10679
10738
  }
10680
10739
  };
10681
10740
  const getCellSizingClasses = (density = 'normal', editing = false) => {
10682
- return cn('flex items-center', getDensityPadding(density, editing), editing ? 'px-[7px]' : 'px-4');
10741
+ return cn('min-h-0 flex items-start', getDensityPadding(density, editing), editing ? 'px-[7px]' : 'px-4');
10683
10742
  };
10684
10743
  const getCellAlignmentClasses = (alignment = 'left') => ({
10685
10744
  'justify-start text-left': alignment === 'left',
@@ -10781,6 +10840,8 @@ var Table2FilterComparator;
10781
10840
  Table2FilterComparator[Table2FilterComparator["IsOneOf"] = 7] = "IsOneOf";
10782
10841
  Table2FilterComparator[Table2FilterComparator["IsNoneOf"] = 8] = "IsNoneOf";
10783
10842
  Table2FilterComparator[Table2FilterComparator["IsAllOf"] = 9] = "IsAllOf";
10843
+ Table2FilterComparator[Table2FilterComparator["IsEmpty"] = 10] = "IsEmpty";
10844
+ Table2FilterComparator[Table2FilterComparator["IsNotEmpty"] = 11] = "IsNotEmpty";
10784
10845
  })(Table2FilterComparator || (Table2FilterComparator = {}));
10785
10846
 
10786
10847
  const toLowerCase = value => String(value !== null && value !== void 0 ? value : '').toLocaleLowerCase();
@@ -10792,6 +10853,10 @@ const globalFilterFn = (value, query) => isWeakContains(value, query);
10792
10853
  // before we filter - that's why this custom filter function exists
10793
10854
  const columnFilterFn = (value, filter) => {
10794
10855
  try {
10856
+ if (filter.comparator === Table2FilterComparator.IsEmpty || filter.comparator === Table2FilterComparator.IsNotEmpty) {
10857
+ const isEmpty = value === undefined || value === null || value === '';
10858
+ return filter.comparator === Table2FilterComparator.IsEmpty ? isEmpty : !isEmpty;
10859
+ }
10795
10860
  if (filter.value === undefined || filter.value === null || filter.value === '') {
10796
10861
  return true;
10797
10862
  }
@@ -11013,22 +11078,20 @@ const useIndicatorText = reason => {
11013
11078
  let title = '';
11014
11079
  let description = '';
11015
11080
  const {
11016
- texts: {
11017
- table2: tableTexts
11018
- }
11081
+ texts
11019
11082
  } = useLocalization();
11020
11083
  switch (reason) {
11084
+ case IndicatorReason.FILTER:
11085
+ title = texts.table2.editing.rowIndicator.rowWillBeHidden;
11086
+ description = texts.table2.editing.rowIndicator.rowWillMoveReasonFilter;
11087
+ break;
11021
11088
  case IndicatorReason.SEARCH:
11022
- title = tableTexts.rowIndicator.rowWillBeFiltered;
11023
- description = tableTexts.rowIndicator.searchFilterMovementReason;
11089
+ title = texts.table2.editing.rowIndicator.rowWillBeHidden;
11090
+ description = texts.table2.editing.rowIndicator.rowWillMoveReasonSearch;
11024
11091
  break;
11025
11092
  case IndicatorReason.SORTING:
11026
- title = tableTexts.rowIndicator.rowWillMove;
11027
- description = tableTexts.rowIndicator.sortingMovementReason;
11028
- break;
11029
- case IndicatorReason.FILTER:
11030
- title = tableTexts.rowIndicator.rowWillBeFiltered;
11031
- description = tableTexts.rowIndicator.tableFilterMovementReason;
11093
+ title = texts.table2.editing.rowIndicator.rowWillMove;
11094
+ description = texts.table2.editing.rowIndicator.rowWillMoveReasonSorting;
11032
11095
  break;
11033
11096
  }
11034
11097
  return {
@@ -11043,7 +11106,7 @@ const Indicator = ({
11043
11106
  }) => {
11044
11107
  const container = React__default.useMemo(() => {
11045
11108
  const element = document.createElement('div');
11046
- element.className += '-translate-y-1/2 z-[3] rounded-full items-center wcag-blue-500 absolute left-0 top-full ml-1 whitespace-nowrap px-1 py-0.5 text-xs font-bold shadow-sm';
11109
+ element.className += 'z-[3] rounded-b-md items-center wcag-blue-500 absolute left-0 top-full ml-1 whitespace-nowrap px-1 py-0.5 text-xs font-bold shadow-sm';
11047
11110
  return element;
11048
11111
  }, []);
11049
11112
  const indicatorText = useIndicatorText(reason);
@@ -11198,8 +11261,7 @@ const Cell = function Cell(props) {
11198
11261
  return (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.classList.remove('pb-4');
11199
11262
  };
11200
11263
  }, [isIndicatorVisible, isLastRow]);
11201
- const className = cn({
11202
- 'border-b': !isLastRow,
11264
+ const className = cn('border-b', {
11203
11265
  'sticky z-[1]': isPinned,
11204
11266
  // use isHoveredRow rather than css group-hover/row because we want to hide hover state when keyboard navigating
11205
11267
  'bg-white': !isActiveRow && !isSelected && !isHoveredRow,
@@ -11420,8 +11482,11 @@ const Cell = function Cell(props) {
11420
11482
  }));
11421
11483
  } else {
11422
11484
  if (meta.onRowClick) {
11423
- attributes.onClick = () => {
11485
+ attributes.onClick = event => {
11424
11486
  var _meta$onRowClick;
11487
+ if (event.target !== internalRef.current) {
11488
+ return;
11489
+ }
11425
11490
  (_meta$onRowClick = meta.onRowClick) === null || _meta$onRowClick === void 0 ? void 0 : _meta$onRowClick.call(meta, cell.row.original);
11426
11491
  };
11427
11492
  }
@@ -11460,7 +11525,7 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
11460
11525
  } = table.getState();
11461
11526
  const [state, setState] = React__default.useState(value);
11462
11527
  const isHoveringAnotherRowWhileEditing = meta.editMode.isEditing && meta.activeRowIndex !== rowIndex && meta.hoveredRowIndex === rowIndex;
11463
- const showValidationError = !isHoveringAnotherRowWhileEditing && !!cellValidationError;
11528
+ const hasValidationError = !isHoveringAnotherRowWhileEditing && !!cellValidationError;
11464
11529
  // On each save, the initialValue will be set to the new value of the cell
11465
11530
  const initialValue = React__default.useRef(value);
11466
11531
  // It is important that we let consumers pass a newValue as an argument because when setState is called before
@@ -11494,7 +11559,10 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
11494
11559
  setValidationErrors(null);
11495
11560
  });
11496
11561
  }, function (error) {
11497
- setValidationErrors(error);
11562
+ setValidationErrors({
11563
+ ...validationErrors,
11564
+ ...error
11565
+ });
11498
11566
  });
11499
11567
  if (_temp && _temp.then) return _temp.then(function () {});
11500
11568
  }
@@ -11585,6 +11653,7 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
11585
11653
  if (cellControl) {
11586
11654
  if (typeof cellControl === 'function') {
11587
11655
  controlComponent = cellControl({
11656
+ invalid: hasValidationError,
11588
11657
  onBlur: saveIfChanged,
11589
11658
  onFocus: handleFocus,
11590
11659
  ref: controlRef,
@@ -11598,6 +11667,7 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
11598
11667
  case 'datepicker':
11599
11668
  controlComponent = /*#__PURE__*/React__default.createElement(Datepicker, Object.assign({}, attributes, {
11600
11669
  className: detailModeClassName,
11670
+ invalid: hasValidationError,
11601
11671
  onBlur: event => {
11602
11672
  const newDate = event.detail;
11603
11673
  saveIfChanged(newDate);
@@ -11620,6 +11690,7 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
11620
11690
  default:
11621
11691
  controlComponent = /*#__PURE__*/React__default.createElement(Input, Object.assign({}, attributes, {
11622
11692
  className: cn(className, detailModeClassName),
11693
+ invalid: hasValidationError,
11623
11694
  onChange: event => {
11624
11695
  setState(event.target.value);
11625
11696
  },
@@ -11637,7 +11708,7 @@ const EditingCell = /*#__PURE__*/React__default.memo( /*#__PURE__*/React__defaul
11637
11708
  mountNode: indicatorMountNode
11638
11709
  }), /*#__PURE__*/React__default.createElement("span", {
11639
11710
  className: "relative flex-grow"
11640
- }, controlComponent, showValidationError && /*#__PURE__*/React__default.createElement(ValidationError, null, String(cellValidationError))));
11711
+ }, controlComponent, hasValidationError && /*#__PURE__*/React__default.createElement(ValidationError, null, String(cellValidationError))));
11641
11712
  }));
11642
11713
 
11643
11714
  const Header$1 = function Header(props) {
@@ -11788,13 +11859,14 @@ const HeaderMenu = ({
11788
11859
 
11789
11860
  const Footer$2 = function Footer(props) {
11790
11861
  const {
11862
+ children,
11791
11863
  footer,
11792
11864
  index,
11793
11865
  table,
11794
11866
  ...columnProps
11795
11867
  } = props;
11796
11868
  const isPinned = !!footer.column.getIsPinned();
11797
- const className = cn('group/header sticky bottom-0 bg-white border-t-2 relative ', {
11869
+ const className = cn('group/header sticky bottom-0 bg-white border-t-2 relative', getCellSizingClasses('normal'), {
11798
11870
  'z-[1]': isPinned
11799
11871
  }, props.className);
11800
11872
  return /*#__PURE__*/React__default.createElement(ColumnBase, Object.assign({}, columnProps, {
@@ -11804,10 +11876,15 @@ const Footer$2 = function Footer(props) {
11804
11876
  className: className,
11805
11877
  role: "cell",
11806
11878
  "data-column-index": index
11807
- }));
11879
+ }), /*#__PURE__*/React__default.createElement("span", {
11880
+ className: "truncate"
11881
+ }, children));
11808
11882
  };
11809
11883
 
11810
11884
  function useColumnDefinitions(children, options, tableRef) {
11885
+ const {
11886
+ texts
11887
+ } = useLocalization();
11811
11888
  const lastSelectedRowIndex = React__default.useRef();
11812
11889
  const columnHelper = reactTable$1.createColumnHelper();
11813
11890
  return React__default.useMemo(() => {
@@ -11879,19 +11956,19 @@ function useColumnDefinitions(children, options, tableRef) {
11879
11956
  }
11880
11957
  });
11881
11958
  if (options.enableRowExpansion) {
11882
- columns.unshift(columnHelper.display(createRowExpansionColumn()));
11959
+ columns.unshift(columnHelper.display(createRowExpansionColumn(texts)));
11883
11960
  defaultColumnPinning.unshift(COLUMN_ID_FOR_EXPANSION);
11884
11961
  }
11885
11962
  if (options.enableRowSelection) {
11886
- columns.unshift(columnHelper.display(createRowSelectionColumn(options.enableMultipleRowSelection, lastSelectedRowIndex, options.onRowDrag, tableRef)));
11963
+ columns.unshift(columnHelper.display(createRowSelectionColumn(options.enableMultipleRowSelection, lastSelectedRowIndex, options.onRowDrag, tableRef, texts)));
11887
11964
  defaultColumnPinning.unshift(COLUMN_ID_FOR_SELECTION);
11888
11965
  }
11889
11966
  if (options.onRowDrag) {
11890
- columns.unshift(columnHelper.display(createRowDraggableColumn(options.onRowDrag)));
11967
+ columns.unshift(columnHelper.display(createRowDraggableColumn(options.onRowDrag, texts)));
11891
11968
  defaultColumnPinning.unshift(COLUMN_ID_FOR_DRAGGABLE);
11892
11969
  }
11893
11970
  if ((_options$actionsForRo = options.actionsForRow) !== null && _options$actionsForRo !== void 0 && _options$actionsForRo.length) {
11894
- columns.push(columnHelper.display(createRowActionsColumn(options.actionsForRow)));
11971
+ columns.push(columnHelper.display(createRowActionsColumn(options.actionsForRow, texts)));
11895
11972
  }
11896
11973
  return {
11897
11974
  columns,
@@ -12262,10 +12339,7 @@ const useVirtualiser = ({
12262
12339
  };
12263
12340
 
12264
12341
  const useGridTemplate = table => {
12265
- var _table$options$meta$t, _table$options$meta, _table$options$meta$t2, _table$options$meta$t3, _table$options$meta2, _table$options$meta2$;
12266
12342
  const allVisibleColumns = table.getVisibleLeafColumns();
12267
- let scrollbarWidth = ((_table$options$meta$t = (_table$options$meta = table.options.meta) === null || _table$options$meta === void 0 ? void 0 : (_table$options$meta$t2 = _table$options$meta.tableRef.current) === null || _table$options$meta$t2 === void 0 ? void 0 : _table$options$meta$t2.offsetWidth) !== null && _table$options$meta$t !== void 0 ? _table$options$meta$t : 0) - ((_table$options$meta$t3 = (_table$options$meta2 = table.options.meta) === null || _table$options$meta2 === void 0 ? void 0 : (_table$options$meta2$ = _table$options$meta2.tableRef.current) === null || _table$options$meta2$ === void 0 ? void 0 : _table$options$meta2$.clientWidth) !== null && _table$options$meta$t3 !== void 0 ? _table$options$meta$t3 : 0);
12268
- scrollbarWidth = scrollbarWidth < 0 ? 0 : scrollbarWidth;
12269
12343
  return allVisibleColumns.reduce((accum, column, index) => {
12270
12344
  let size;
12271
12345
  const isLastColumn = index === allVisibleColumns.length - 1;
@@ -12276,8 +12350,7 @@ const useGridTemplate = table => {
12276
12350
  size = `${column.getSize()}px`;
12277
12351
  } else if (width) {
12278
12352
  if (isLastColumn) {
12279
- // Remove the scrollbar width from the last column
12280
- size = `minmax(${width - scrollbarWidth}px, auto)`;
12353
+ size = `minmax(${width}px, auto)`;
12281
12354
  } else if (column.columnDef.minSize && width < column.columnDef.minSize) {
12282
12355
  // react-table is supposed to handle minSize itself but it is really buggy
12283
12356
  size = `${column.columnDef.minSize}px`;
@@ -12296,9 +12369,12 @@ const useGridTemplate = table => {
12296
12369
  const RowDensityButton = ({
12297
12370
  table
12298
12371
  }) => {
12372
+ const {
12373
+ texts
12374
+ } = useLocalization();
12299
12375
  const meta = table.options.meta;
12300
12376
  return /*#__PURE__*/React__default.createElement(IconButton, {
12301
- "aria-label": "Change row density",
12377
+ "aria-label": texts.table2.rowDensity.tooltip,
12302
12378
  icon: `density-${meta.rowDensity}`,
12303
12379
  menu: menuProps => /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, {
12304
12380
  align: "end"
@@ -12314,7 +12390,7 @@ const RowDensityButton = ({
12314
12390
  }, "Comfortable"), /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
12315
12391
  value: "spacious"
12316
12392
  }, "Spacious")))),
12317
- tooltip: "Row density"
12393
+ tooltip: texts.table2.rowDensity.tooltip
12318
12394
  });
12319
12395
  };
12320
12396
 
@@ -12479,6 +12555,9 @@ const SortableColumnContainer = ({
12479
12555
  table
12480
12556
  }) => {
12481
12557
  var _ref;
12558
+ const {
12559
+ texts
12560
+ } = useLocalization();
12482
12561
  const meta = table.options.meta;
12483
12562
  const reorder = (activeId, overId, listId) => {
12484
12563
  const draggedColumn = state[listId].find(c => c.id === activeId);
@@ -12493,6 +12572,10 @@ const SortableColumnContainer = ({
12493
12572
  moveColumn(column);
12494
12573
  }
12495
12574
  };
12575
+ const handleDoubleClick = (id, status) => table.options.enablePinning ? event => {
12576
+ event.stopPropagation();
12577
+ move(id, status);
12578
+ } : undefined;
12496
12579
  const isReorderingAllowed = (_ref = meta.enableColumnReordering || table.options.enablePinning) !== null && _ref !== void 0 ? _ref : false;
12497
12580
  if (!table.options.enablePinning) {
12498
12581
  return /*#__PURE__*/React__default.createElement(Container, {
@@ -12500,7 +12583,7 @@ const SortableColumnContainer = ({
12500
12583
  move: move
12501
12584
  }, /*#__PURE__*/React__default.createElement(List$1, {
12502
12585
  id: "other",
12503
- className: "flex min-h-[theme(spacing.8)] flex-col gap-y-px px-2"
12586
+ className: "flex min-h-[theme(spacing.8)] flex-col gap-y-px overflow-x-hidden px-2"
12504
12587
  }, state.other.map(column => {
12505
12588
  var _column$columnDef$met2;
12506
12589
  const canBeReordered = isOrderingAllowed(table, column);
@@ -12513,10 +12596,7 @@ const SortableColumnContainer = ({
12513
12596
  canBeReordered: canBeReordered,
12514
12597
  column: column,
12515
12598
  isReorderingAllowed: isReorderingAllowed,
12516
- onDoubleClick: event => {
12517
- event.stopPropagation();
12518
- move(column.id, 'other');
12519
- }
12599
+ onDoubleClick: handleDoubleClick(column.id, 'other')
12520
12600
  }));
12521
12601
  })));
12522
12602
  }
@@ -12525,9 +12605,9 @@ const SortableColumnContainer = ({
12525
12605
  move: move
12526
12606
  }, /*#__PURE__*/React__default.createElement("h5", {
12527
12607
  className: "mx-4"
12528
- }, "Pinned columns"), /*#__PURE__*/React__default.createElement(List$1, {
12608
+ }, texts.table2.columnSettings.columnsPinned), /*#__PURE__*/React__default.createElement(List$1, {
12529
12609
  id: "pinned",
12530
- className: "flex min-h-[theme(spacing.8)] flex-col gap-y-px px-2"
12610
+ className: "flex min-h-[theme(spacing.8)] flex-col gap-y-px overflow-x-hidden px-2"
12531
12611
  }, state.pinned.length ? state.pinned.map(column => {
12532
12612
  var _column$columnDef$met3;
12533
12613
  const canBeReordered = isOrderingAllowed(table, column);
@@ -12540,18 +12620,15 @@ const SortableColumnContainer = ({
12540
12620
  canBeReordered: canBeReordered,
12541
12621
  column: column,
12542
12622
  isReorderingAllowed: isReorderingAllowed,
12543
- onDoubleClick: event => {
12544
- event.stopPropagation();
12545
- move(column.id, 'pinned');
12546
- }
12623
+ onDoubleClick: handleDoubleClick(column.id, 'pinned')
12547
12624
  }));
12548
12625
  }) : /*#__PURE__*/React__default.createElement("p", {
12549
12626
  className: "text-grey-500 mb-0 flex h-8 items-center px-2"
12550
- }, "Drop column here to pin")), /*#__PURE__*/React__default.createElement("h5", {
12627
+ }, texts.table2.columnSettings.columnsPinnedDrop)), /*#__PURE__*/React__default.createElement("h5", {
12551
12628
  className: "mx-4"
12552
- }, "Other columns"), /*#__PURE__*/React__default.createElement(List$1, {
12629
+ }, texts.table2.columnSettings.columnsOther), /*#__PURE__*/React__default.createElement(List$1, {
12553
12630
  id: "other",
12554
- className: "flex min-h-[theme(spacing.8)] flex-col gap-y-px px-2"
12631
+ className: "flex min-h-[theme(spacing.8)] flex-col gap-y-px overflow-x-hidden px-2"
12555
12632
  }, state.other.length ? state.other.map(column => {
12556
12633
  var _column$columnDef$met4;
12557
12634
  const canBeReordered = isOrderingAllowed(table, column);
@@ -12564,14 +12641,11 @@ const SortableColumnContainer = ({
12564
12641
  canBeReordered: canBeReordered,
12565
12642
  column: column,
12566
12643
  isReorderingAllowed: isReorderingAllowed,
12567
- onDoubleClick: event => {
12568
- event.stopPropagation();
12569
- move(column.id, 'other');
12570
- }
12644
+ onDoubleClick: handleDoubleClick(column.id, 'other')
12571
12645
  }));
12572
12646
  }) : /*#__PURE__*/React__default.createElement("p", {
12573
12647
  className: "text-grey-500 mb-0 flex h-8 items-center px-2"
12574
- }, "Drop column here to unpin")));
12648
+ }, texts.table2.columnSettings.columnsOtherDrop)));
12575
12649
  };
12576
12650
  const reorder = (draggedColumnId, targetColumnId, list = []) => {
12577
12651
  const nextColumnOrder = [...list];
@@ -12581,6 +12655,9 @@ const reorder = (draggedColumnId, targetColumnId, list = []) => {
12581
12655
  const ColumnSettingsButton = ({
12582
12656
  table
12583
12657
  }) => {
12658
+ const {
12659
+ texts
12660
+ } = useLocalization();
12584
12661
  const [query, setQuery] = React__default.useState('');
12585
12662
  const columns = table.getAllLeafColumns().filter(column => !isInternalColumn(column.id));
12586
12663
  const [state, setState] = React__default.useState({
@@ -12629,7 +12706,7 @@ const ColumnSettingsButton = ({
12629
12706
  table.setColumnOrder(internals.concat([...state.pinned, ...state.other].map(c => c.id)));
12630
12707
  }, [state]);
12631
12708
  return /*#__PURE__*/React__default.createElement(IconButton, {
12632
- "aria-label": "Change column settings",
12709
+ "aria-label": texts.table2.columnSettings.tooltip,
12633
12710
  icon: "columns",
12634
12711
  popover: popoverProps => /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps), /*#__PURE__*/React__default.createElement(Popover.Content, {
12635
12712
  align: "end"
@@ -12637,7 +12714,7 @@ const ColumnSettingsButton = ({
12637
12714
  className: "flex w-60 flex-col gap-2"
12638
12715
  }, /*#__PURE__*/React__default.createElement(Input, {
12639
12716
  onChange: event => setQuery(event.target.value),
12640
- placeholder: "Search column...",
12717
+ placeholder: texts.table2.columnSettings.search,
12641
12718
  value: query
12642
12719
  }), /*#__PURE__*/React__default.createElement("div", {
12643
12720
  className: "-ml-4 -mb-2 max-h-64 w-[calc(100%_+_theme(spacing.8))] overflow-auto"
@@ -12655,7 +12732,7 @@ const ColumnSettingsButton = ({
12655
12732
  reorderColumn: reorderColumn,
12656
12733
  table: table
12657
12734
  }))))),
12658
- tooltip: "Column settings"
12735
+ tooltip: texts.table2.columnSettings.tooltip
12659
12736
  });
12660
12737
  };
12661
12738
 
@@ -12833,12 +12910,13 @@ const Row$1 = ({
12833
12910
  rowMoveReason: rowMoveReason,
12834
12911
  setRowMoveReason: setRowMoveReason
12835
12912
  }, /*#__PURE__*/React__default.createElement("div", Object.assign({}, props, {
12836
- role: "row",
12837
- draggable: true,
12838
12913
  "aria-current": isActiveRow ? 'true' : undefined,
12839
12914
  "aria-grabbed": isDragging ? 'true' : undefined,
12915
+ "data-row-index": rowIndex,
12916
+ draggable: true,
12840
12917
  onMouseEnter: handleEnter,
12841
- onMouseLeave: handleLeave
12918
+ onMouseLeave: handleLeave,
12919
+ role: "row"
12842
12920
  })));
12843
12921
  };
12844
12922
 
@@ -12874,6 +12952,9 @@ const Comparator = ({
12874
12952
  validComparators,
12875
12953
  ...props
12876
12954
  }) => {
12955
+ const {
12956
+ texts
12957
+ } = useLocalization();
12877
12958
  const handleChange = comparator => {
12878
12959
  column.setFilterValue(currentFilterValue => ({
12879
12960
  comparator,
@@ -12895,30 +12976,34 @@ const Comparator = ({
12895
12976
  }), validComparators.map(comp => /*#__PURE__*/React__default.createElement(Select2.Option, {
12896
12977
  key: comp,
12897
12978
  value: comp
12898
- }, getComparatorText(comp))));
12979
+ }, getComparatorText(comp, texts))));
12899
12980
  };
12900
- const getComparatorText = comparator => {
12981
+ const getComparatorText = (comparator, texts) => {
12901
12982
  switch (comparator) {
12902
12983
  case Table2FilterComparator.Contains:
12903
- return 'Contains';
12984
+ return texts.table2.filters.comparators.contains;
12904
12985
  case Table2FilterComparator.DoesNotContain:
12905
- return 'Does not contain';
12986
+ return texts.table2.filters.comparators.doesNotContain;
12906
12987
  case Table2FilterComparator.IsEqualTo:
12907
- return 'Is';
12988
+ return texts.table2.filters.comparators.isEqualTo;
12908
12989
  case Table2FilterComparator.IsNotEqualTo:
12909
- return 'Is not';
12990
+ return texts.table2.filters.comparators.isNotEqualTo;
12910
12991
  case Table2FilterComparator.IsGreaterThan:
12911
- return 'Is greater than';
12992
+ return texts.table2.filters.comparators.isGreaterThan;
12912
12993
  case Table2FilterComparator.IsLessThan:
12913
- return 'Is less than';
12994
+ return texts.table2.filters.comparators.isLessThan;
12914
12995
  case Table2FilterComparator.IsBetween:
12915
- return 'Is between';
12996
+ return texts.table2.filters.comparators.isBetween;
12916
12997
  case Table2FilterComparator.IsOneOf:
12917
- return 'Is one of';
12998
+ return texts.table2.filters.comparators.isOneOf;
12918
12999
  case Table2FilterComparator.IsNoneOf:
12919
- return 'Is none of';
13000
+ return texts.table2.filters.comparators.isNoneOf;
12920
13001
  case Table2FilterComparator.IsAllOf:
12921
- return 'Is all of';
13002
+ return texts.table2.filters.comparators.isAllOf;
13003
+ case Table2FilterComparator.IsEmpty:
13004
+ return texts.table2.filters.comparators.isEmpty;
13005
+ case Table2FilterComparator.IsNotEmpty:
13006
+ return texts.table2.filters.comparators.isNotEmpty;
12922
13007
  }
12923
13008
  };
12924
13009
 
@@ -12929,6 +13014,9 @@ const InferredControl = ({
12929
13014
  }) => {
12930
13015
  var _column$columnDef$met2, _column$columnDef$met3;
12931
13016
  const ariaLabel = column.columnDef.header;
13017
+ if (comparator === Table2FilterComparator.IsEmpty || comparator === Table2FilterComparator.IsNotEmpty) {
13018
+ return null;
13019
+ }
12932
13020
  if (comparator === Table2FilterComparator.IsBetween) {
12933
13021
  var _column$columnDef$met;
12934
13022
  const fromValue = Array.isArray(value) ? value[0] : undefined;
@@ -13011,7 +13099,7 @@ const InferredControl = ({
13011
13099
  };
13012
13100
 
13013
13101
  const ColumnFilter = props => {
13014
- var _column$columnDef$hea, _column$columnDef$met, _column$columnDef$met2, _control;
13102
+ var _column$columnDef$hea, _column$columnDef$met, _control;
13015
13103
  const {
13016
13104
  allColumns,
13017
13105
  column,
@@ -13025,7 +13113,7 @@ const ColumnFilter = props => {
13025
13113
  const ariaLabel = String((_column$columnDef$hea = column.columnDef.header) !== null && _column$columnDef$hea !== void 0 ? _column$columnDef$hea : '');
13026
13114
  const ref = React__default.useRef(null);
13027
13115
  let control;
13028
- const controlType = (_column$columnDef$met = (_column$columnDef$met2 = column.columnDef.meta) === null || _column$columnDef$met2 === void 0 ? void 0 : _column$columnDef$met2.control) !== null && _column$columnDef$met !== void 0 ? _column$columnDef$met : 'input';
13116
+ const controlType = (_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.control;
13029
13117
  if (typeof controlType === 'function') {
13030
13118
  control = controlType({
13031
13119
  onBlur: () => Promise.resolve(),
@@ -13068,7 +13156,7 @@ const ColumnFilter = props => {
13068
13156
  });
13069
13157
  }
13070
13158
  const handleRemove = () => column.setFilterValue(undefined);
13071
- const comparators = guessComparatorsBasedOnControl(controlType, control);
13159
+ const comparators = guessComparatorsBasedOnControl(control, controlType);
13072
13160
  return /*#__PURE__*/React__default.createElement("div", {
13073
13161
  className: "mb-2 flex gap-2"
13074
13162
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -13096,7 +13184,7 @@ const ColumnFilter = props => {
13096
13184
  onClick: handleRemove
13097
13185
  }));
13098
13186
  };
13099
- const guessComparatorsBasedOnControl = (control, instance) => {
13187
+ const guessComparatorsBasedOnControl = (instance, control) => {
13100
13188
  if ( /*#__PURE__*/React__default.isValidElement(instance)) {
13101
13189
  const {
13102
13190
  props,
@@ -13115,7 +13203,7 @@ const guessComparatorsBasedOnControl = (control, instance) => {
13115
13203
  case 'switch':
13116
13204
  return [Table2FilterComparator.IsEqualTo];
13117
13205
  default:
13118
- return [Table2FilterComparator.Contains, Table2FilterComparator.DoesNotContain, Table2FilterComparator.IsEqualTo, Table2FilterComparator.IsNotEqualTo, Table2FilterComparator.IsGreaterThan, Table2FilterComparator.IsLessThan, Table2FilterComparator.IsBetween];
13206
+ return [Table2FilterComparator.Contains, Table2FilterComparator.DoesNotContain, Table2FilterComparator.IsEqualTo, Table2FilterComparator.IsNotEqualTo, Table2FilterComparator.IsEmpty, Table2FilterComparator.IsNotEmpty, Table2FilterComparator.IsGreaterThan, Table2FilterComparator.IsLessThan, Table2FilterComparator.IsBetween];
13119
13207
  }
13120
13208
  };
13121
13209
 
@@ -13132,6 +13220,9 @@ const FiltersButton = ({
13132
13220
  length,
13133
13221
  table
13134
13222
  }) => {
13223
+ const {
13224
+ texts
13225
+ } = useLocalization();
13135
13226
  const ref = React__default.useRef(null);
13136
13227
  const allColumns = table.getAllLeafColumns().filter(column => !isInternalColumn(column.id));
13137
13228
  const {
@@ -13165,6 +13256,7 @@ const FiltersButton = ({
13165
13256
  }
13166
13257
  });
13167
13258
  return /*#__PURE__*/React__default.createElement(Button$1, {
13259
+ "aria-label": texts.table2.filters.tooltip,
13168
13260
  appearance: columnFilters.length ? 'primary' : 'default',
13169
13261
  className: cn({
13170
13262
  '!wcag-blue-100': columnFilters.length
@@ -13178,7 +13270,7 @@ const FiltersButton = ({
13178
13270
  className: "mb-0 inline-flex"
13179
13271
  }, "Filter"), /*#__PURE__*/React__default.createElement("p", {
13180
13272
  className: "text-grey-700 mb-0 mr-auto mt-px inline-flex"
13181
- }, "Viewing ", table.getFilteredRowModel().rows.length, " of ", length)), /*#__PURE__*/React__default.createElement("div", {
13273
+ }, texts.table2.filters.total.replace('[CURRENT]', String(table.getFilteredRowModel().rows.length)).replace('[TOTAL]', String(length)))), /*#__PURE__*/React__default.createElement("div", {
13182
13274
  className: "flex flex-col gap-2"
13183
13275
  }, filteredColumns.map((column, index) => /*#__PURE__*/React__default.createElement(ColumnFilter, {
13184
13276
  key: `${column.id}_${index}`,
@@ -13191,17 +13283,17 @@ const FiltersButton = ({
13191
13283
  }, /*#__PURE__*/React__default.createElement(Button$1, {
13192
13284
  appearance: "discrete",
13193
13285
  onClick: handleAdd
13194
- }, "+ Add filter"), columnFilters.length ? /*#__PURE__*/React__default.createElement(Button$1, {
13286
+ }, "+ ", texts.table2.filters.buttons.addFilter), columnFilters.length ? /*#__PURE__*/React__default.createElement(Button$1, {
13195
13287
  onClick: handleReset
13196
- }, "Clear all filters") : null)))),
13288
+ }, texts.table2.filters.buttons.clearFilters) : null)))),
13197
13289
  ref: ref,
13198
- tooltip: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, columnFilters.length ? 'Change filters' : 'Apply filters', /*#__PURE__*/React__default.createElement(Shortcut$1, {
13290
+ tooltip: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.table2.filters.tooltip, /*#__PURE__*/React__default.createElement(Shortcut$1, {
13199
13291
  className: "ml-2",
13200
13292
  keys: ['Ctrl', 'Shift', 'F']
13201
13293
  }))
13202
13294
  }, /*#__PURE__*/React__default.createElement(Icon, {
13203
13295
  name: columnFilters.length ? 'filter-solid' : 'filter'
13204
- }), columnFilters.length ? `Filters (${columnFilters.length})` : 'Filters');
13296
+ }), texts.table2.filters.button, " ", columnFilters.length ? `(${columnFilters.length})` : '');
13205
13297
  };
13206
13298
 
13207
13299
  const Search$2 = props => {
@@ -13209,6 +13301,9 @@ const Search$2 = props => {
13209
13301
  value,
13210
13302
  ...attributes
13211
13303
  } = props;
13304
+ const {
13305
+ texts
13306
+ } = useLocalization();
13212
13307
  const ref = React__default.useRef(null);
13213
13308
  const handleKeyDown = event => {
13214
13309
  if (event.key === 'Escape') {
@@ -13248,6 +13343,7 @@ const Search$2 = props => {
13248
13343
  onBlur: handleBlur,
13249
13344
  onInput: handleInput,
13250
13345
  onKeyDown: handleKeyDown,
13346
+ placeholder: texts.table2.search.placeholder,
13251
13347
  ref: ref
13252
13348
  }));
13253
13349
  };
@@ -13257,72 +13353,70 @@ const ShortcutsGuideButton = ({
13257
13353
  }) => {
13258
13354
  const meta = table.options.meta;
13259
13355
  const {
13260
- texts: {
13261
- table2: tableTexts
13262
- }
13356
+ texts
13263
13357
  } = useLocalization();
13264
13358
  const shortcuts = [];
13265
13359
  if (table.options.enableGlobalFilter) {
13266
13360
  shortcuts.push({
13267
- feature: tableTexts.shortcuts.search,
13361
+ feature: texts.table2.shortcuts.search,
13268
13362
  keys: ['Ctrl', 'F']
13269
13363
  });
13270
13364
  }
13271
13365
  if (table.options.enableColumnFilters) {
13272
13366
  shortcuts.push({
13273
- feature: tableTexts.shortcuts.filter,
13367
+ feature: texts.table2.shortcuts.filter,
13274
13368
  keys: ['Ctrl', 'Shift', 'F']
13275
13369
  });
13276
13370
  }
13277
13371
  shortcuts.push({
13278
- feature: tableTexts.shortcuts.previousRow,
13372
+ feature: texts.table2.shortcuts.previousRow,
13279
13373
  keys: ['Up']
13280
13374
  });
13281
13375
  shortcuts.push({
13282
- feature: tableTexts.shortcuts.nextRow,
13376
+ feature: texts.table2.shortcuts.nextRow,
13283
13377
  keys: ['Down']
13284
13378
  });
13285
13379
  if (meta.editMode.enableEditMode) {
13286
13380
  shortcuts.push({
13287
- feature: tableTexts.shortcuts.editCell,
13381
+ feature: texts.table2.shortcuts.editCell,
13288
13382
  keys: ['Enter']
13289
13383
  });
13290
13384
  shortcuts.push({
13291
- feature: tableTexts.shortcuts.previousColumn,
13385
+ feature: texts.table2.shortcuts.previousColumn,
13292
13386
  keys: ['Arrow-Left']
13293
13387
  });
13294
13388
  shortcuts.push({
13295
- feature: tableTexts.shortcuts.nextColumn,
13389
+ feature: texts.table2.shortcuts.nextColumn,
13296
13390
  keys: ['Arrow-Right']
13297
13391
  });
13298
13392
  } else if (meta.onRowClick) {
13299
13393
  shortcuts.push({
13300
- feature: tableTexts.shortcuts.rowClick,
13394
+ feature: texts.table2.shortcuts.rowClick,
13301
13395
  keys: ['Enter']
13302
13396
  });
13303
13397
  }
13304
13398
  if (table.options.enableRowSelection) {
13305
13399
  shortcuts.push({
13306
- feature: tableTexts.shortcuts.selectRow,
13400
+ feature: texts.table2.shortcuts.selectRow,
13307
13401
  keys: ['Space']
13308
13402
  });
13309
13403
  shortcuts.push({
13310
- feature: tableTexts.shortcuts.selectAllRows,
13404
+ feature: texts.table2.shortcuts.selectAllRows,
13311
13405
  keys: ['Ctrl', 'A']
13312
13406
  });
13313
13407
  }
13314
13408
  if (table.options.enableExpanding) {
13315
13409
  shortcuts.push({
13316
- feature: tableTexts.shortcuts.expandRow,
13410
+ feature: texts.table2.shortcuts.expandRow,
13317
13411
  keys: ['Ctrl', 'Right']
13318
13412
  });
13319
13413
  shortcuts.push({
13320
- feature: tableTexts.shortcuts.collapseRow,
13414
+ feature: texts.table2.shortcuts.collapseRow,
13321
13415
  keys: ['Ctrl', 'Left']
13322
13416
  });
13323
13417
  }
13324
13418
  return /*#__PURE__*/React__default.createElement(IconButton, {
13325
- "aria-label": "View keyboard shortcuts",
13419
+ "aria-label": texts.table2.shortcuts.tooltip,
13326
13420
  icon: "shortcuts",
13327
13421
  popover: popoverProps => /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps), /*#__PURE__*/React__default.createElement(Popover.Content, {
13328
13422
  align: "end"
@@ -13340,9 +13434,13 @@ const ShortcutsGuideButton = ({
13340
13434
 
13341
13435
  const EditModeButton = /*#__PURE__*/React__default.forwardRef(function EditModeButton(props, ref) {
13342
13436
  const {
13437
+ scrollToIndex,
13343
13438
  table,
13344
13439
  tableRef
13345
13440
  } = props;
13441
+ const {
13442
+ texts
13443
+ } = useLocalization();
13346
13444
  const internalRef = useMergedRef(ref);
13347
13445
  const meta = table.options.meta;
13348
13446
  const {
@@ -13364,26 +13462,40 @@ const EditModeButton = /*#__PURE__*/React__default.forwardRef(function EditModeB
13364
13462
  });
13365
13463
  React__default.useEffect(() => {
13366
13464
  window.addEventListener('beforeunload', showWarning);
13367
- return () => window.removeEventListener('beforeunload', showWarning);
13465
+ return () => {
13466
+ window.removeEventListener('beforeunload', showWarning);
13467
+ };
13368
13468
  }, [showWarning]);
13369
13469
  const handleClick = () => {
13370
13470
  var _tableRef$current;
13371
13471
  meta.editMode.toggleEditing();
13372
13472
  (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.focus();
13473
+ scrollToIndex(meta.activeRowIndex + 1);
13373
13474
  };
13475
+ const hasVisibleEditableColumns = React__default.useMemo(() => {
13476
+ const hasColumns = table.getVisibleFlatColumns().some(column => {
13477
+ var _column$columnDef$met;
13478
+ return ((_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.control) !== undefined;
13479
+ });
13480
+ if (!hasColumns && isEditing) {
13481
+ handleClick();
13482
+ }
13483
+ return hasColumns;
13484
+ }, [table.getState().columnVisibility]);
13374
13485
  return /*#__PURE__*/React__default.createElement(Button$1, {
13375
13486
  onClick: handleClick,
13376
13487
  className: cn({
13377
13488
  '!wcag-blue-100': meta.editMode.isEditing
13378
13489
  }),
13490
+ disabled: !hasVisibleEditableColumns,
13379
13491
  ref: internalRef,
13380
- tooltip: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Edit", /*#__PURE__*/React__default.createElement(Shortcut$1, {
13492
+ tooltip: hasVisibleEditableColumns ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, texts.table2.editing.tooltip, /*#__PURE__*/React__default.createElement(Shortcut$1, {
13381
13493
  className: "ml-2",
13382
13494
  keys: ['Ctrl', 'E']
13383
- }))
13495
+ })) : texts.table2.editing.tooltipDisabled
13384
13496
  }, /*#__PURE__*/React__default.createElement(Icon, {
13385
13497
  name: "edit"
13386
- }), "Edit");
13498
+ }), texts.table2.editing.button);
13387
13499
  });
13388
13500
 
13389
13501
  function Column$2(_) {
@@ -13470,7 +13582,15 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
13470
13582
  meta.setActiveRowIndex(rows.length - 1);
13471
13583
  virtualiser.scrollToOffset(virtualiser.totalSize + 1);
13472
13584
  } else {
13473
- meta.moveToNextRow(rows, nextIndex => virtualiser.scrollToIndex(nextIndex + 2));
13585
+ meta.moveToNextRow(rows, nextIndex => {
13586
+ // the virtualiser doesn't always scroll right to the bottom for the last row
13587
+ if (nextIndex === rows.length - 1) {
13588
+ var _tableRef$current;
13589
+ (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.scrollTo(0, tableRef.current.scrollHeight);
13590
+ } else {
13591
+ virtualiser.scrollToIndex(nextIndex + 2);
13592
+ }
13593
+ });
13474
13594
  }
13475
13595
  return;
13476
13596
  }
@@ -13554,7 +13674,6 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
13554
13674
  }
13555
13675
  };
13556
13676
  }
13557
- // extract - infinite loading
13558
13677
  // TODO: this can probably be extracted into a hook
13559
13678
  // we only show the pinned shadow on display columns when scrolling is active
13560
13679
  const [scrolled, setScrolled] = React__default.useState(false);
@@ -13609,7 +13728,7 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
13609
13728
  // sometimes the row's onMouseLeave doesn't trigger, this adds some extra redundancy
13610
13729
  handleMouseLeave = () => meta.setHoveredRowIndex(undefined);
13611
13730
  }
13612
- const className = cn('bg-white border border-grey-300 focus:yt-focus focus:border-blue-500 grid overflow-auto relative rounded group', props.className);
13731
+ const className = cn('bg-white border border-grey-300 focus:yt-focus focus:border-blue-500 grid auto-rows-max overflow-auto relative rounded group', props.className);
13613
13732
  const enableSettingsButton = table.options.enablePinning || table.options.enableHiding || meta.enableColumnReordering;
13614
13733
  const hasInternalToolbar = enableSettingsButton || meta.editMode.enableEditMode || table.options.enableColumnFilters || meta.enableRowDensity || table.options.enableGlobalFilter;
13615
13734
  const hasToolbar = !!toolbar || hasInternalToolbar;
@@ -13627,7 +13746,8 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
13627
13746
  }, meta.editMode.enableEditMode ? /*#__PURE__*/React__default.createElement(EditModeButton, {
13628
13747
  ref: editButtonRef,
13629
13748
  table: table,
13630
- tableRef: tableRef
13749
+ tableRef: tableRef,
13750
+ scrollToIndex: virtualiser.scrollToIndex
13631
13751
  }) : null, table.options.enableColumnFilters ? /*#__PURE__*/React__default.createElement(FiltersButton, {
13632
13752
  length: length,
13633
13753
  table: table
@@ -13638,12 +13758,12 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
13638
13758
  }) : null, table.options.enableGlobalFilter ? /*#__PURE__*/React__default.createElement(Search$2, {
13639
13759
  disabled: meta.shouldDisableTableActions,
13640
13760
  onSearch: table.setGlobalFilter,
13641
- placeholder: "Search...",
13642
13761
  value: globalFilter
13643
13762
  }) : null) : null, /*#__PURE__*/React__default.createElement(ShortcutsGuideButton, {
13644
13763
  table: table
13645
13764
  })) : null, /*#__PURE__*/React__default.createElement("div", {
13646
13765
  className: className,
13766
+ "data-taco": "table2",
13647
13767
  onBlur: handleBlur,
13648
13768
  onKeyDown: handleKeyDown,
13649
13769
  onMouseLeave: handleMouseLeave,
@@ -13660,6 +13780,7 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
13660
13780
  tabIndex: 0
13661
13781
  }, /*#__PURE__*/React__default.createElement("div", {
13662
13782
  className: "contents",
13783
+ "data-taco": "table2-header",
13663
13784
  role: "rowgroup"
13664
13785
  }, table.getHeaderGroups().map(headerGroup => /*#__PURE__*/React__default.createElement("div", {
13665
13786
  className: "contents",
@@ -13675,6 +13796,7 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
13675
13796
  tableRef: tableRef
13676
13797
  }))))), rows.length ? /*#__PURE__*/React__default.createElement("div", {
13677
13798
  className: "contents",
13799
+ "data-taco": "table2-body",
13678
13800
  role: "rowgroup"
13679
13801
  }, virtualiserOffsets.top ? /*#__PURE__*/React__default.createElement("div", {
13680
13802
  style: {
@@ -13715,7 +13837,8 @@ const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref
13715
13837
  className: "col-span-full min-h-[theme(spacing.8)]"
13716
13838
  }, EmptyState ? /*#__PURE__*/React__default.createElement(EmptyState, null) : null), hasFooters ? /*#__PURE__*/React__default.createElement("div", {
13717
13839
  role: "rowgroup",
13718
- className: "contents"
13840
+ className: "contents",
13841
+ "data-taco": "table2-footer"
13719
13842
  }, table.getFooterGroups().map(footerGroup => /*#__PURE__*/React__default.createElement("div", {
13720
13843
  key: footerGroup.id,
13721
13844
  role: "row",