@economic/taco 2.17.2 → 2.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. package/dist/components/Select2/Select2.d.ts +2 -0
  2. package/dist/components/Select2/components/Context.d.ts +2 -0
  3. package/dist/components/Select2/components/Group.d.ts +2 -0
  4. package/dist/components/Select2/components/Option.d.ts +3 -0
  5. package/dist/components/Select2/components/Search.d.ts +5 -1
  6. package/dist/components/Table3/Table3.d.ts +1 -1
  7. package/dist/components/Table3/components/toolbar/Filter/filters/components/FilterValue.d.ts +1 -1
  8. package/dist/components/Table3/components/toolbar/FontSize.d.ts +0 -4
  9. package/dist/components/Table3/hooks/useCssGrid.d.ts +2 -2
  10. package/dist/components/Table3/hooks/useCssVars.d.ts +3 -2
  11. package/dist/components/Table3/types.d.ts +5 -5
  12. package/dist/esm/index.css +12 -12
  13. package/dist/esm/packages/taco/src/components/Select2/Select2.js +23 -7
  14. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  15. package/dist/esm/packages/taco/src/components/Select2/components/Context.js.map +1 -1
  16. package/dist/esm/packages/taco/src/components/Select2/components/Group.js +4 -1
  17. package/dist/esm/packages/taco/src/components/Select2/components/Group.js.map +1 -1
  18. package/dist/esm/packages/taco/src/components/Select2/components/Option.js +8 -2
  19. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  20. package/dist/esm/packages/taco/src/components/Select2/components/Search.js +2 -1
  21. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  22. package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js +1 -1
  23. package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
  24. package/dist/esm/packages/taco/src/components/Table3/Table3.js +4 -5
  25. package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
  26. package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js +1 -1
  27. package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js.map +1 -1
  28. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +1 -0
  29. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
  30. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +1 -1
  31. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +1 -1
  32. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +3 -3
  33. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
  34. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js +11 -1
  35. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js.map +1 -1
  36. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js +0 -2
  37. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js.map +1 -1
  38. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js +5 -9
  39. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js.map +1 -1
  40. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +1 -1
  41. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js +3 -3
  42. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js.map +1 -1
  43. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js +5 -2
  44. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js.map +1 -1
  45. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +1 -1
  46. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Toolbar.js +1 -1
  47. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Toolbar.js.map +1 -1
  48. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +1 -1
  49. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js +10 -10
  50. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js.map +1 -1
  51. package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
  52. package/dist/esm/packages/taco/src/index.js +1 -1
  53. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js +4 -0
  54. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js.map +1 -1
  55. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFontSize.js.map +1 -1
  56. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js +7 -7
  57. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js.map +1 -1
  58. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js +4 -4
  59. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js.map +1 -1
  60. package/dist/esm/packages/taco/src/types.js +7 -1
  61. package/dist/esm/packages/taco/src/types.js.map +1 -1
  62. package/dist/esm/packages/taco/src/utils/dom.js +13 -1
  63. package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
  64. package/dist/index.css +12 -12
  65. package/dist/primitives/Table/types.d.ts +0 -6
  66. package/dist/primitives/Table/useTable/features/useTableFontSize.d.ts +2 -2
  67. package/dist/primitives/Table/useTable/util/columns.d.ts +2 -2
  68. package/dist/taco.cjs.development.js +123 -79
  69. package/dist/taco.cjs.development.js.map +1 -1
  70. package/dist/taco.cjs.production.min.js +1 -1
  71. package/dist/taco.cjs.production.min.js.map +1 -1
  72. package/dist/types.d.ts +6 -0
  73. package/dist/utils/dom.d.ts +1 -0
  74. package/package.json +2 -2
  75. package/types.json +10644 -10278
  76. package/dist/esm/packages/taco/src/primitives/Table/types.js +0 -10
  77. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +0 -1
@@ -9594,6 +9594,10 @@ const Option = /*#__PURE__*/React__default.forwardRef(function Listbox2Option(pr
9594
9594
  if (disabled || listboxDisabled || listboxReadOnly) {
9595
9595
  event.stopPropagation();
9596
9596
  return;
9597
+ }
9598
+ // UX requirement: if tab key is pressed and the current option is selected then keydown event is ignored
9599
+ else if (event.key === 'Tab' && selected) {
9600
+ return;
9597
9601
  } else if (isAriaSelectionKey(event)) {
9598
9602
  setValue(value);
9599
9603
  }
@@ -9904,6 +9908,13 @@ const Colours = props => {
9904
9908
  const mobiles = /iPhone|iPad|iPod|Android/i;
9905
9909
  const isMobileDevice = navigator => !!(navigator !== null && navigator !== void 0 && navigator.userAgent) && mobiles.test(navigator.userAgent);
9906
9910
 
9911
+ (function (FontSizes) {
9912
+ FontSizes["small"] = "small";
9913
+ FontSizes["medium"] = "medium";
9914
+ FontSizes["large"] = "large";
9915
+ })(exports.FontSizes || (exports.FontSizes = {}));
9916
+ const fixedForwardRef = React__default.forwardRef;
9917
+
9907
9918
  const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(props, ref) {
9908
9919
  var _window;
9909
9920
  const {
@@ -9924,9 +9935,14 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
9924
9935
  setOpen,
9925
9936
  shouldPauseHoverState,
9926
9937
  tags,
9927
- value
9938
+ value,
9939
+ fontSize = exports.FontSizes.medium
9928
9940
  } = useSelect2Context();
9929
- const className = cn(createOptionClassName(shouldPauseHoverState), cName);
9941
+ const className = cn(createOptionClassName(shouldPauseHoverState), {
9942
+ 'text-xs': fontSize === exports.FontSizes.small,
9943
+ 'text-sm': fontSize === exports.FontSizes.medium,
9944
+ 'text-base': fontSize === exports.FontSizes.large
9945
+ }, cName);
9930
9946
  const hasValue = Array.isArray(value) ? !!value.length : value !== undefined;
9931
9947
  const isTag = tags && !!color;
9932
9948
  const handleClick = () => {
@@ -9998,9 +10014,12 @@ const Group$2 = /*#__PURE__*/React__default.forwardRef(function Select2Group(pro
9998
10014
  const {
9999
10015
  children,
10000
10016
  heading,
10017
+ hasSeparator,
10001
10018
  ...attributes
10002
10019
  } = props;
10003
- const className = cn(createCollectionClassName(), props.className);
10020
+ const className = cn(createCollectionClassName(), {
10021
+ "last:after:content-none after:content-[''] after:bg-grey-300 after:mx-2 after:my-1 after:h-px": hasSeparator && children.length
10022
+ }, props.className);
10004
10023
  return /*#__PURE__*/React__default.createElement(Group$1, Object.assign({}, attributes, {
10005
10024
  className: className,
10006
10025
  ref: ref
@@ -10032,6 +10051,18 @@ const getIndexOfFirstChildOverflowingParent = (element, overscan = 0) => {
10032
10051
  }
10033
10052
  return boundaryChildIndex;
10034
10053
  };
10054
+ const getNextFocussableElement = currentElement => {
10055
+ if (!currentElement) {
10056
+ return null;
10057
+ }
10058
+ const focussableElements = [...document.querySelectorAll('button:not([disabled]), [href]:not(link):not(script), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')];
10059
+ const currentElementIndex = focussableElements.indexOf(currentElement);
10060
+ // If the currentElement is not in the focussable elements list or it is the last element
10061
+ if (currentElementIndex !== -1 && currentElementIndex === focussableElements.length - 1) {
10062
+ return null;
10063
+ }
10064
+ return focussableElements[currentElementIndex + 1];
10065
+ };
10035
10066
 
10036
10067
  const Trigger$7 = /*#__PURE__*/React__default.forwardRef(function Select2Trigger(props, ref) {
10037
10068
  const {
@@ -10360,6 +10391,7 @@ const BubbleSelect = props => {
10360
10391
 
10361
10392
  const Search$1 = /*#__PURE__*/React__default.forwardRef(function ListboxSearch(props, ref) {
10362
10393
  const {
10394
+ onTabKeyPress,
10363
10395
  ...otherProps
10364
10396
  } = props;
10365
10397
  const {
@@ -10384,7 +10416,7 @@ const Search$1 = /*#__PURE__*/React__default.forwardRef(function ListboxSearch(p
10384
10416
  // Select2 should close dropdown and receive focus, when user press Tab while searching (UX requirement to support better keyboard navigation)
10385
10417
  if (event.key === 'Tab') {
10386
10418
  setOpen(false);
10387
- return;
10419
+ onTabKeyPress();
10388
10420
  }
10389
10421
  if (isAriaSelectionKey(event) || event.key === 'ArrowDown' || event.key === 'ArrowUp') {
10390
10422
  var _listboxRef$current;
@@ -10411,7 +10443,7 @@ const Search$1 = /*#__PURE__*/React__default.forwardRef(function ListboxSearch(p
10411
10443
  })));
10412
10444
  });
10413
10445
 
10414
- const isGroup = child => !!child.props.heading;
10446
+ const isGroup = child => !!child.props.heading || !!child.props.hasSeparator;
10415
10447
  const useChildren = ({
10416
10448
  children: initialChildren,
10417
10449
  emptyValue,
@@ -10594,6 +10626,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
10594
10626
  readOnly = false,
10595
10627
  tags = false,
10596
10628
  value: prop,
10629
+ fontSize,
10597
10630
  ...otherProps
10598
10631
  } = props;
10599
10632
  const emptyOption = React__default.useMemo(() => {
@@ -10624,6 +10657,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
10624
10657
  // align the listbox min width with the width of the input - it should never be smaller
10625
10658
  const dimensions = useBoundingClientRectListener(internalRef);
10626
10659
  // state
10660
+ const [tabTriggeredClose, setTabTriggeredClose] = React__default.useState(false);
10627
10661
  const [open, setOpen] = React__default.useState(false);
10628
10662
  const [value, _setValue] = reactUseControllableState.useControllableState({
10629
10663
  // uncontrolled
@@ -10670,6 +10704,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
10670
10704
  shouldPauseHoverState,
10671
10705
  setShouldPauseHoverState,
10672
10706
  tags,
10707
+ fontSize,
10673
10708
  validationError,
10674
10709
  value
10675
10710
  };
@@ -10706,6 +10741,22 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
10706
10741
  setShouldPauseHoverState(true);
10707
10742
  }
10708
10743
  };
10744
+ const handleCloseAutoFocus = event => {
10745
+ event.preventDefault();
10746
+ event.stopPropagation();
10747
+ if (tabTriggeredClose) {
10748
+ const nextFocussableElement = getNextFocussableElement(internalRef.current);
10749
+ if (nextFocussableElement) {
10750
+ // UX requirement: move focus to the next focussable element when tab key is pressed to select the value
10751
+ nextFocussableElement.focus();
10752
+ // Reset the tabTriggeredClose state
10753
+ setTabTriggeredClose(false);
10754
+ }
10755
+ } else {
10756
+ var _internalRef$current;
10757
+ (_internalRef$current = internalRef.current) === null || _internalRef$current === void 0 ? void 0 : _internalRef$current.focus();
10758
+ }
10759
+ };
10709
10760
  const className = cn('border-grey-300 rounded border bg-white py-1.5 shadow-md outline-none', createCollectionClassName());
10710
10761
  return /*#__PURE__*/React__default.createElement(Select2Context.Provider, {
10711
10762
  value: context
@@ -10734,15 +10785,10 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
10734
10785
  asChild: true,
10735
10786
  align: "start",
10736
10787
  onOpenAutoFocus: () => {
10737
- var _internalRef$current;
10738
- (_internalRef$current = internalRef.current) === null || _internalRef$current === void 0 ? void 0 : _internalRef$current.focus();
10739
- },
10740
- onCloseAutoFocus: event => {
10741
10788
  var _internalRef$current2;
10742
- event.preventDefault();
10743
- event.stopPropagation();
10744
10789
  (_internalRef$current2 = internalRef.current) === null || _internalRef$current2 === void 0 ? void 0 : _internalRef$current2.focus();
10745
10790
  },
10791
+ onCloseAutoFocus: handleCloseAutoFocus,
10746
10792
  sideOffset: 4,
10747
10793
  tabIndex: -1
10748
10794
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -10752,7 +10798,8 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
10752
10798
  }
10753
10799
  }, flattenedChildren.length > 0 || onCreate ? ( /*#__PURE__*/React__default.createElement(Search$1, {
10754
10800
  placeholder: onCreate ? texts.select2.searchOrCreate : texts.select2.search,
10755
- ref: searchRef
10801
+ ref: searchRef,
10802
+ onTabKeyPress: () => setTabTriggeredClose(true)
10756
10803
  })) : null, flattenedChildren.length <= 0 ? ( /*#__PURE__*/React__default.createElement("div", {
10757
10804
  className: "text-grey-700 -mt-0.5 flex h-8 items-center px-2",
10758
10805
  role: "presentation"
@@ -12986,30 +13033,6 @@ const MemoedFooter = /*#__PURE__*/React__default.memo(function MemoedFooter(prop
12986
13033
  }, meta.footer(table.getRowModel().rows.map(row => row.original[id])))) : null);
12987
13034
  });
12988
13035
 
12989
- const FONT_SIZE = {
12990
- small: 'small',
12991
- medium: 'medium',
12992
- large: 'large'
12993
- };
12994
- function FontSize$1(props) {
12995
- const {
12996
- texts
12997
- } = useLocalization();
12998
- const meta = props.table.options.meta;
12999
- const handleChange = value => meta.fontSize.setSize(value);
13000
- return /*#__PURE__*/React__default.createElement(Menu$1.SubMenu, null, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup, {
13001
- onChange: handleChange,
13002
- value: meta.fontSize.size
13003
- }, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
13004
- value: FONT_SIZE.small
13005
- }, texts.table3.fontSize.sizes.small), /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
13006
- value: FONT_SIZE.medium
13007
- }, texts.table3.fontSize.sizes.medium), /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
13008
- disabled: meta.rowHeight.height === 'short',
13009
- value: FONT_SIZE.large
13010
- }, texts.table3.fontSize.sizes.large)));
13011
- }
13012
-
13013
13036
  var IndicatorReason;
13014
13037
  (function (IndicatorReason) {
13015
13038
  IndicatorReason["SEARCH"] = "SEARCH";
@@ -13131,8 +13154,8 @@ const MemoedCell = /*#__PURE__*/React__default.memo(function MemoedCell(props) {
13131
13154
  const actionsInMenu = visibleActions.slice(visibleActions.length === actionsLength ? actionsLength : actionsLength - 1);
13132
13155
  const className = cn('-mb-2 flex justify-end pl-2 text-right', {
13133
13156
  // Adjust negative margin on row actions cell to ensure that the cell aligns vertically.
13134
- '-mt-2': fontSize === FONT_SIZE.small,
13135
- '-mt-1.5': fontSize !== FONT_SIZE.small
13157
+ '-mt-2': fontSize === exports.FontSizes.small,
13158
+ '-mt-1.5': fontSize !== exports.FontSizes.small
13136
13159
  }, props.className);
13137
13160
  content = /*#__PURE__*/React__default.createElement("span", {
13138
13161
  className: className,
@@ -13254,23 +13277,15 @@ function getCellValueAsString(value, dataType) {
13254
13277
  return String(value);
13255
13278
  }
13256
13279
 
13257
- // settings
13258
- var TableFontSizes;
13259
- (function (TableFontSizes) {
13260
- TableFontSizes["small"] = "small";
13261
- TableFontSizes["medium"] = "medium";
13262
- TableFontSizes["large"] = "large";
13263
- })(TableFontSizes || (TableFontSizes = {}));
13264
-
13265
13280
  // column widths
13266
13281
  const getCellMinWidth = (fontSize = 'medium') => {
13267
13282
  switch (fontSize) {
13268
- case TableFontSizes.small:
13283
+ case exports.FontSizes.small:
13269
13284
  return 57;
13270
- case TableFontSizes.large:
13285
+ case exports.FontSizes.large:
13271
13286
  return 83;
13272
13287
  default:
13273
- case TableFontSizes.medium:
13288
+ case exports.FontSizes.medium:
13274
13289
  return 72;
13275
13290
  }
13276
13291
  };
@@ -14943,7 +14958,7 @@ const TextareaControl = /*#__PURE__*/React__default.forwardRef(function Textarea
14943
14958
  handleTextareaKeyDown(e);
14944
14959
  },
14945
14960
  onBlur: handleBlur,
14946
- className: cn(getCellAlignmentClasses(align), `h-fit resize-none`, {
14961
+ className: cn(getCellAlignmentClasses(align), `h-fit resize-none overflow-y-hidden focus:overflow-y-auto`, {
14947
14962
  [`!min-h-[${minMaxHeight.min}px]`]: columnMeta === null || columnMeta === void 0 ? void 0 : columnMeta.enableTruncate,
14948
14963
  '!yt-focus-dark': isCellInDetailMode,
14949
14964
  [`h-[${minMaxHeight.min}px]`]: !isCellInDetailMode && (columnMeta === null || columnMeta === void 0 ? void 0 : columnMeta.enableTruncate),
@@ -15075,6 +15090,7 @@ const EditingControl = /*#__PURE__*/React__default.forwardRef(function Control(p
15075
15090
  handleChange(nextValue);
15076
15091
  }
15077
15092
  },
15093
+ fontSize: tableMeta.fontSize.size,
15078
15094
  value
15079
15095
  }, data);
15080
15096
  } else if (controlRenderer === 'datepicker') {
@@ -16265,15 +16281,15 @@ function useTableFontSizeListener(table) {
16265
16281
  }
16266
16282
  function getCellWidthDifference(fontSizeKey) {
16267
16283
  switch (fontSizeKey) {
16268
- case `${TableFontSizes.small}-${TableFontSizes.medium}`:
16269
- case `${TableFontSizes.medium}-${TableFontSizes.large}`:
16284
+ case `${exports.FontSizes.small}-${exports.FontSizes.medium}`:
16285
+ case `${exports.FontSizes.medium}-${exports.FontSizes.large}`:
16270
16286
  return 8;
16271
- case `${TableFontSizes.medium}-${TableFontSizes.small}`:
16272
- case `${TableFontSizes.large}-${TableFontSizes.medium}`:
16287
+ case `${exports.FontSizes.medium}-${exports.FontSizes.small}`:
16288
+ case `${exports.FontSizes.large}-${exports.FontSizes.medium}`:
16273
16289
  return -8;
16274
- case `${TableFontSizes.small}-${TableFontSizes.large}`:
16290
+ case `${exports.FontSizes.small}-${exports.FontSizes.large}`:
16275
16291
  return 16;
16276
- case `${TableFontSizes.large}-${TableFontSizes.small}`:
16292
+ case `${exports.FontSizes.large}-${exports.FontSizes.small}`:
16277
16293
  return -16;
16278
16294
  default:
16279
16295
  return 0;
@@ -16731,11 +16747,14 @@ function Search$2(props) {
16731
16747
  setQuery(String(query !== null && query !== void 0 ? query : ''));
16732
16748
  };
16733
16749
  const handleClear = () => {
16734
- const [rowIndex = null, cellIndex = null] = tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex || 0];
16750
+ var _tableMeta$search$cur, _tableMeta$search$hig;
16751
+ const highlightedColumnIndex = (_tableMeta$search$cur = tableMeta.search.currentHighlightColumnIndex) !== null && _tableMeta$search$cur !== void 0 ? _tableMeta$search$cur : 0;
16752
+ const highlightedCell = (_tableMeta$search$hig = tableMeta.search.highlightedColumnIndexes[highlightedColumnIndex]) !== null && _tableMeta$search$hig !== void 0 ? _tableMeta$search$hig : [];
16753
+ const [rowIndex = null, columnIndex = null] = highlightedCell;
16735
16754
  const rows = table.getRowModel().rows;
16736
16755
  tableMeta.search.setQuery('');
16737
16756
  // Need to save row id and cell index, to be able to find the row in the table with updated indexes, after global filter will be reset.
16738
- lastCellIndex.value = String(cellIndex);
16757
+ lastCellIndex.value = String(columnIndex);
16739
16758
  if (rowIndex !== null) {
16740
16759
  var _rows$rowIndex;
16741
16760
  const rowId = ((_rows$rowIndex = rows[rowIndex]) === null || _rows$rowIndex === void 0 ? void 0 : _rows$rowIndex.id) || null;
@@ -17092,7 +17111,6 @@ function FilterValue(props) {
17092
17111
  }));
17093
17112
  }
17094
17113
  return /*#__PURE__*/React__default.createElement(Control, {
17095
- comparator: comparator,
17096
17114
  column: column,
17097
17115
  onChange: handleChange,
17098
17116
  value: value
@@ -17102,7 +17120,6 @@ function Control(props) {
17102
17120
  var _column$columnDef$met2, _column$columnDef$met3;
17103
17121
  const {
17104
17122
  column,
17105
- comparator,
17106
17123
  onChange,
17107
17124
  value,
17108
17125
  ...attributes
@@ -17169,9 +17186,19 @@ function Filter$1(props) {
17169
17186
  }
17170
17187
  } = filter;
17171
17188
  const handleChangeColumn = columnId => {
17189
+ var _columnPrev$columnDef, _columnNext$columnDef;
17190
+ const columnPrev = allColumns.find(column => column.id === id);
17191
+ const columnNext = allColumns.find(column => column.id === columnId);
17192
+ // UX requirement: if old column data type is the same as next column data type,
17193
+ // then we applying the same filter value for the next column,
17194
+ // but when data types are different, we're reseting comparator ans value for the next column
17195
+ const value = (columnPrev === null || columnPrev === void 0 ? void 0 : (_columnPrev$columnDef = columnPrev.columnDef.meta) === null || _columnPrev$columnDef === void 0 ? void 0 : _columnPrev$columnDef.dataType) === (columnNext === null || columnNext === void 0 ? void 0 : (_columnNext$columnDef = columnNext.columnDef.meta) === null || _columnNext$columnDef === void 0 ? void 0 : _columnNext$columnDef.dataType) ? filter.value : {
17196
+ comparator: null,
17197
+ value: null
17198
+ };
17172
17199
  handleChange(id, {
17173
17200
  id: columnId,
17174
- value: filter.value
17201
+ value
17175
17202
  });
17176
17203
  };
17177
17204
  const handleChangeComparator = comparator => {
@@ -17909,8 +17936,8 @@ function RowHeight(props) {
17909
17936
  const handleChange = value => {
17910
17937
  const height = value;
17911
17938
  meta.rowHeight.setHeight(height);
17912
- if (height === 'short' && meta.fontSize.size === FONT_SIZE.large) {
17913
- meta.fontSize.setSize(FONT_SIZE.medium);
17939
+ if (height === 'short' && meta.fontSize.size === exports.FontSizes.large) {
17940
+ meta.fontSize.setSize(exports.FontSizes.medium);
17914
17941
  }
17915
17942
  };
17916
17943
  return /*#__PURE__*/React__default.createElement(Menu$1.SubMenu, null, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup, {
@@ -18139,6 +18166,25 @@ function ColumnSettingsPopover(props) {
18139
18166
  })) : texts.table3.columnSettings.noResults)))));
18140
18167
  }
18141
18168
 
18169
+ function FontSize$1(props) {
18170
+ const {
18171
+ texts
18172
+ } = useLocalization();
18173
+ const meta = props.table.options.meta;
18174
+ const handleChange = value => meta.fontSize.setSize(value);
18175
+ return /*#__PURE__*/React__default.createElement(Menu$1.SubMenu, null, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup, {
18176
+ onChange: handleChange,
18177
+ value: meta.fontSize.size
18178
+ }, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
18179
+ value: exports.FontSizes.small
18180
+ }, texts.table3.fontSize.sizes.small), /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
18181
+ value: exports.FontSizes.medium
18182
+ }, texts.table3.fontSize.sizes.medium), /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
18183
+ disabled: meta.rowHeight.height === 'short',
18184
+ value: exports.FontSizes.large
18185
+ }, texts.table3.fontSize.sizes.large)));
18186
+ }
18187
+
18142
18188
  function SettingsButton(props) {
18143
18189
  const {
18144
18190
  customSettings,
@@ -18209,7 +18255,7 @@ function Toolbar(props) {
18209
18255
  }
18210
18256
  const tableMeta = table.options.meta;
18211
18257
  return /*#__PURE__*/React__default.createElement("div", {
18212
- className: "mb-4 flex flex-shrink flex-grow-0 flex-wrap gap-2",
18258
+ className: "mb-4 flex flex-shrink flex-grow-0 flex-wrap gap-2 empty:hidden",
18213
18259
  "data-taco": "table3-toolbar"
18214
18260
  }, left, /*#__PURE__*/React__default.createElement(Group, {
18215
18261
  className: "ml-auto flex-shrink-0 print:hidden"
@@ -18305,7 +18351,7 @@ const getCellHeightPadding = (height, fontSize) => {
18305
18351
  case 'short':
18306
18352
  {
18307
18353
  switch (fontSize) {
18308
- case FONT_SIZE.small:
18354
+ case exports.FontSizes.small:
18309
18355
  return '8px';
18310
18356
  default:
18311
18357
  return '6px';
@@ -18315,9 +18361,9 @@ const getCellHeightPadding = (height, fontSize) => {
18315
18361
  case 'tall':
18316
18362
  {
18317
18363
  switch (fontSize) {
18318
- case FONT_SIZE.small:
18364
+ case exports.FontSizes.small:
18319
18365
  return '16px';
18320
- case FONT_SIZE.large:
18366
+ case exports.FontSizes.large:
18321
18367
  return '12px';
18322
18368
  default:
18323
18369
  return '14px';
@@ -18326,9 +18372,9 @@ const getCellHeightPadding = (height, fontSize) => {
18326
18372
  case 'extra-tall':
18327
18373
  {
18328
18374
  switch (fontSize) {
18329
- case FONT_SIZE.small:
18375
+ case exports.FontSizes.small:
18330
18376
  return '22px';
18331
- case FONT_SIZE.large:
18377
+ case exports.FontSizes.large:
18332
18378
  return '18px';
18333
18379
  default:
18334
18380
  return '20px';
@@ -18337,9 +18383,9 @@ const getCellHeightPadding = (height, fontSize) => {
18337
18383
  default:
18338
18384
  {
18339
18385
  switch (fontSize) {
18340
- case FONT_SIZE.small:
18386
+ case exports.FontSizes.small:
18341
18387
  return '12px';
18342
- case FONT_SIZE.large:
18388
+ case exports.FontSizes.large:
18343
18389
  return '8px';
18344
18390
  default:
18345
18391
  return '10px';
@@ -18349,9 +18395,9 @@ const getCellHeightPadding = (height, fontSize) => {
18349
18395
  };
18350
18396
  const getCellWidthPadding = fontSize => {
18351
18397
  switch (fontSize) {
18352
- case FONT_SIZE.small:
18398
+ case exports.FontSizes.small:
18353
18399
  return '8px';
18354
- case FONT_SIZE.medium:
18400
+ case exports.FontSizes.medium:
18355
18401
  return '12px';
18356
18402
  default:
18357
18403
  return '16px';
@@ -18473,7 +18519,7 @@ function ErrorAlert(props) {
18473
18519
  // Getting the row from core rows (ignoring search and filtering)
18474
18520
  const getCoreRow = React__default.useCallback(rowId => coreRows.find(coreRow => coreRow.id === rowId), [coreRows]);
18475
18521
  return /*#__PURE__*/React__default.createElement("div", {
18476
- className: "mb-4"
18522
+ className: "mb-4 empty:hidden"
18477
18523
  }, errorsRowIds.length ? ( /*#__PURE__*/React__default.createElement(Alert, {
18478
18524
  state: "error",
18479
18525
  className: "mb-1"
@@ -18531,8 +18577,6 @@ function FilterResetDialog(props) {
18531
18577
  }, texts.table3.validation.resetFiltersDialog.confirm)))));
18532
18578
  }
18533
18579
 
18534
- const fixedForwardRef = React__default.forwardRef;
18535
-
18536
18580
  function useTable3DataLoader(fetch, fetchAll, options = {
18537
18581
  pageSize: 100
18538
18582
  }) {
@@ -18755,9 +18799,9 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
18755
18799
  }
18756
18800
  };
18757
18801
  const className = cn('border-grey-300 relative grid h-full w-full flex-grow overflow-auto rounded border bg-white scroll-mt-[41px] focus-visible:outline-none', '[&[data-resizing="true"]]:select-none', {
18758
- 'text-xs': tableMeta.fontSize.size === FONT_SIZE.small,
18759
- 'text-sm': tableMeta.fontSize.size === FONT_SIZE.medium,
18760
- 'text-base': tableMeta.fontSize.size === FONT_SIZE.large
18802
+ 'text-xs': tableMeta.fontSize.size === exports.FontSizes.small,
18803
+ 'text-sm': tableMeta.fontSize.size === exports.FontSizes.medium,
18804
+ 'text-base': tableMeta.fontSize.size === exports.FontSizes.large
18761
18805
  });
18762
18806
  // Print tables have "_print" as the postfix for the table id, so we can use the it to determine
18763
18807
  // if the table is a print table or not.