@economic/taco 2.26.20 → 2.27.1

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 (37) hide show
  1. package/dist/components/Report/Report.d.ts +1 -1
  2. package/dist/components/Report/types.d.ts +1 -1
  3. package/dist/components/Report/useReport.d.ts +2 -2
  4. package/dist/components/Select2/Select2.d.ts +6 -4
  5. package/dist/components/Select2/components/Trigger.d.ts +0 -1
  6. package/dist/components/Select2/utilities.d.ts +1 -0
  7. package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js +1 -1
  8. package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js.map +1 -1
  9. package/dist/esm/packages/taco/src/components/Report/useReport.js.map +1 -1
  10. package/dist/esm/packages/taco/src/components/Select2/Select2.js +18 -7
  11. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  12. package/dist/esm/packages/taco/src/components/Select2/components/Option.js +6 -11
  13. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  14. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +19 -22
  15. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
  16. package/dist/esm/packages/taco/src/components/Select2/utilities.js +13 -1
  17. package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
  18. package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js +2 -2
  19. package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -1
  20. package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js +4 -2
  21. package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -1
  22. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js +15 -6
  23. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
  24. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js +15 -6
  25. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js.map +1 -1
  26. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js +6 -1
  27. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js.map +1 -1
  28. package/dist/esm/packages/taco/src/utils/date.js +2 -2
  29. package/dist/esm/packages/taco/src/utils/date.js.map +1 -1
  30. package/dist/primitives/Table/Core/components/Footer/Footer.d.ts +11 -2
  31. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.d.ts +1 -1
  32. package/dist/taco.cjs.development.js +92 -54
  33. package/dist/taco.cjs.development.js.map +1 -1
  34. package/dist/taco.cjs.production.min.js +1 -1
  35. package/dist/taco.cjs.production.min.js.map +1 -1
  36. package/dist/utils/date.d.ts +1 -1
  37. package/package.json +2 -2
@@ -1,6 +1,15 @@
1
1
  /// <reference types="react" />
2
- import { Header as ReactTableHeader } from '@tanstack/react-table';
3
- export declare function Footer<TType = unknown>(header: ReactTableHeader<TType, unknown>): JSX.Element;
2
+ import { Header as ReactTableHeader, Table as ReactTable } from '@tanstack/react-table';
3
+ export declare type FootProps<TType = unknown> = {
4
+ table: ReactTable<TType>;
5
+ };
6
+ export declare function Foot<TType = unknown>(props: FootProps<TType>): JSX.Element;
7
+ export declare type FooterProps<TType = unknown> = {
8
+ header: ReactTableHeader<TType, unknown>;
9
+ index: number;
10
+ };
11
+ export declare function Footer<TType = unknown>(props: FooterProps<TType>): JSX.Element;
4
12
  export declare type MemoedFooterProps<TType = unknown> = {
5
13
  footer: ReactTableHeader<TType, unknown>;
14
+ index: number;
6
15
  };
@@ -6,7 +6,7 @@ export declare type FilterColumnProps<TType = unknown> = Omit<Select2Props, 'chi
6
6
  allColumns: ReactTableColumn<TType, unknown>[];
7
7
  filters: TableFilter[];
8
8
  };
9
- export declare const FilterColumn: React.ForwardRefExoticComponent<Pick<Select2Props, "defaultValue" | "onChange" | "value" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "emptyValue" | "disabled" | "highlighted" | "invalid" | "multiple" | "name" | "onCreate" | "onDelete" | "onEdit" | "readOnly" | "required" | "tags" | "fontSize"> & {
9
+ export declare const FilterColumn: React.ForwardRefExoticComponent<Pick<Select2Props, "defaultValue" | "onChange" | "value" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "emptyValue" | "disabled" | "fontSize" | "highlighted" | "invalid" | "loading" | "multiple" | "name" | "onCreate" | "onDelete" | "onEdit" | "readOnly" | "required" | "tags"> & {
10
10
  allColumns: ReactTableColumn<unknown, unknown>[];
11
11
  filters: TableFilter[];
12
12
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -5977,7 +5977,7 @@ const format = (date, mask = 'dd.mm.yy') => {
5977
5977
  const pad = v => String(v).length === 1 ? `0${v}` : v.toString();
5978
5978
  return mask.replace('dd', pad(value.getDate())).replace('mm', pad(value.getMonth() + 1)).replace('yy', String(value.getFullYear()).slice(2));
5979
5979
  };
5980
- const parseFromCustomString = (date = '', mask = 'dd.mm.yy') => {
5980
+ const parseFromCustomString = (date = '', mask = 'dd.mm.yy', defaultYear = undefined) => {
5981
5981
  if (!date || !date.length) {
5982
5982
  return undefined;
5983
5983
  }
@@ -6011,7 +6011,7 @@ const parseFromCustomString = (date = '', mask = 'dd.mm.yy') => {
6011
6011
  month = Number.parseInt(month, 10);
6012
6012
  year = Number.parseInt(year, 10);
6013
6013
  const currentDate = new Date();
6014
- return new Date( /* year */Object.is(year, NaN) ? currentDate.getFullYear() : year, /* month */Object.is(month, NaN) ? currentDate.getMonth() : month - 1,
6014
+ return new Date( /* year */Object.is(year, NaN) ? defaultYear !== null && defaultYear !== void 0 ? defaultYear : currentDate.getFullYear() : year, /* month */Object.is(month, NaN) ? currentDate.getMonth() : month - 1,
6015
6015
  // months are zero based in javascript, so subtract a day
6016
6016
  /* day */
6017
6017
  Object.is(day, NaN) ? currentDate.getDate() : day, /* hours */12, /* minutes */0 // set to midday to avoid UTC offset causing dates to be mismatched server side
@@ -6049,7 +6049,7 @@ const useDatepicker = ({
6049
6049
  // event handlers
6050
6050
  const handleInputBlur = event => {
6051
6051
  event.persist();
6052
- const valueAsDate = parseFromCustomString(event.target.value);
6052
+ const valueAsDate = parseFromCustomString(event.target.value, 'dd.mm.yy', value === null || value === void 0 ? void 0 : value.getFullYear());
6053
6053
  const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';
6054
6054
  event.target.value = formattedValue;
6055
6055
  if (onChange) {
@@ -9345,13 +9345,18 @@ function ensureOrdering(columns, settingsOrder, internalColumnsPinnedToTheRight
9345
9345
  });
9346
9346
  });
9347
9347
  if (settingsOrder && settingsOrder.length > 0) {
9348
+ const columnsAbsentInSettingsOrder = [];
9348
9349
  orderingEnabled = orderingEnabled.reduce((acc, column) => {
9349
9350
  const index = settingsOrder.indexOf(column);
9350
9351
  if (index > -1) {
9351
9352
  acc[index] = column;
9353
+ } else {
9354
+ columnsAbsentInSettingsOrder.push(column);
9352
9355
  }
9353
9356
  return acc;
9354
- }, []).filter(column => !!column);
9357
+ }, []).filter(column => !!column)
9358
+ // Append absent columns at the end
9359
+ .concat(columnsAbsentInSettingsOrder);
9355
9360
  }
9356
9361
  const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];
9357
9362
  // actions should always be last, enforce that
@@ -12817,16 +12822,25 @@ function Summary(props) {
12817
12822
  }, label, "\u00A0", count);
12818
12823
  }
12819
12824
 
12820
- function Footer$3(header) {
12821
- return /*#__PURE__*/React__default.createElement(MemoedFooter, {
12825
+ function Foot(props) {
12826
+ const nonGroupedHeaders = props.table.getFooterGroups()[0].headers.filter(header => !header.column.getIsGrouped());
12827
+ return /*#__PURE__*/React__default.createElement("tfoot", null, /*#__PURE__*/React__default.createElement("tr", null, nonGroupedHeaders.map((header, index) => ( /*#__PURE__*/React__default.createElement(Footer$3, {
12822
12828
  key: header.id,
12823
- footer: header
12829
+ header: header,
12830
+ index: index
12831
+ })))));
12832
+ }
12833
+ function Footer$3(props) {
12834
+ return /*#__PURE__*/React__default.createElement(MemoedFooter, {
12835
+ footer: props.header,
12836
+ index: props.index
12824
12837
  });
12825
12838
  }
12826
12839
  const MemoedFooter = /*#__PURE__*/React__default.memo(function MemoedFooter(props) {
12827
12840
  var _footer$subHeaders, _footer$subHeaders$fi;
12828
12841
  const {
12829
- footer
12842
+ footer,
12843
+ index
12830
12844
  } = props;
12831
12845
  const columnMeta = footer.column.columnDef.meta;
12832
12846
  // getIsPinned returns true for split header groups, even if the split group has no pinned sub headers
@@ -12839,7 +12853,7 @@ const MemoedFooter = /*#__PURE__*/React__default.memo(function MemoedFooter(prop
12839
12853
  }
12840
12854
  let content;
12841
12855
  let align;
12842
- if (footer.index === 0) {
12856
+ if (index === 0) {
12843
12857
  align = 'left';
12844
12858
  content = /*#__PURE__*/React__default.createElement(Summary, {
12845
12859
  table: footer.getContext().table
@@ -13879,6 +13893,17 @@ const createOptionClassName = (shouldPauseHoverState = false) => cn('group mb-px
13879
13893
  'hover:wcag-grey-200': !shouldPauseHoverState
13880
13894
  });
13881
13895
  const createCollectionClassName = () => 'flex flex-col gap-px';
13896
+ const getFontSize = fontSize => {
13897
+ switch (fontSize) {
13898
+ case exports.FontSizes.small:
13899
+ return 'text-xs';
13900
+ case exports.FontSizes.large:
13901
+ return 'text-base';
13902
+ case exports.FontSizes.medium:
13903
+ default:
13904
+ return 'text-sm';
13905
+ }
13906
+ };
13882
13907
 
13883
13908
  const Select2Context = /*#__PURE__*/React__default.createContext({});
13884
13909
  const useSelect2Context = () => React__default.useContext(Select2Context);
@@ -14079,22 +14104,18 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
14079
14104
  ...otherProps
14080
14105
  } = props;
14081
14106
  const {
14082
- onDelete,
14083
- onEdit,
14107
+ fontSize,
14084
14108
  listboxRef,
14085
14109
  multiple,
14110
+ onDelete,
14111
+ onEdit,
14086
14112
  ref: selectRef,
14087
14113
  setOpen,
14088
14114
  shouldPauseHoverState,
14089
14115
  tags,
14090
- value,
14091
- fontSize = exports.FontSizes.medium
14116
+ value
14092
14117
  } = useSelect2Context();
14093
- const className = cn(createOptionClassName(shouldPauseHoverState), {
14094
- 'text-xs': fontSize === exports.FontSizes.small,
14095
- 'text-sm': fontSize === exports.FontSizes.medium,
14096
- 'text-base': fontSize === exports.FontSizes.large
14097
- }, cName);
14118
+ const className = cn(createOptionClassName(shouldPauseHoverState), getFontSize(fontSize), cName);
14098
14119
  const hasValue = Array.isArray(value) ? !!value.length : value !== undefined;
14099
14120
  const isTag = tags && !!color;
14100
14121
  const handleClick = () => {
@@ -14188,6 +14209,15 @@ const Title$5 = /*#__PURE__*/React__default.forwardRef(function Select2Title(pro
14188
14209
  }));
14189
14210
  });
14190
14211
 
14212
+ const Placeholder = ({
14213
+ disabled,
14214
+ ...props
14215
+ }) => ( /*#__PURE__*/React__default.createElement("div", Object.assign({}, props, {
14216
+ className: cn({
14217
+ 'text-grey-700': disabled,
14218
+ 'text-grey-500': !disabled
14219
+ })
14220
+ })));
14191
14221
  const Trigger$7 = /*#__PURE__*/React__default.forwardRef(function Select2Trigger(props, ref) {
14192
14222
  const {
14193
14223
  multiple,
@@ -14211,11 +14241,11 @@ const Button$2 = /*#__PURE__*/React__default.forwardRef(function Select2TriggerB
14211
14241
  children,
14212
14242
  onClick,
14213
14243
  tabIndex = 0,
14214
- fontSize,
14215
14244
  ...otherProps
14216
14245
  } = props;
14217
14246
  const {
14218
14247
  disabled,
14248
+ fontSize,
14219
14249
  highlighted,
14220
14250
  invalid,
14221
14251
  open,
@@ -14227,11 +14257,8 @@ const Button$2 = /*#__PURE__*/React__default.forwardRef(function Select2TriggerB
14227
14257
  highlighted,
14228
14258
  invalid,
14229
14259
  readOnly
14230
- }).replace('w-full', '').replace('px-2', ''), {
14231
- 'w-full': !((_props$className = props.className) !== null && _props$className !== void 0 && _props$className.includes('w-')),
14232
- 'text-xs': fontSize === exports.FontSizes.small,
14233
- 'text-sm': fontSize === exports.FontSizes.medium,
14234
- 'text-base': fontSize === exports.FontSizes.large
14260
+ }).replace('w-full', '').replace('px-2', ''), getFontSize(fontSize), {
14261
+ 'w-full': !((_props$className = props.className) !== null && _props$className !== void 0 && _props$className.includes('w-'))
14235
14262
  }, props.className);
14236
14263
  const handleClick = event => {
14237
14264
  if (disabled || readOnly) {
@@ -14274,11 +14301,8 @@ const Single = /*#__PURE__*/React__default.forwardRef(function Select2TriggerSin
14274
14301
  const currentValue = children.find(matchesValue(value));
14275
14302
  let output;
14276
14303
  if (placeholder && currentValue === undefined) {
14277
- output = /*#__PURE__*/React__default.createElement("div", {
14278
- className: cn({
14279
- 'text-grey-700': disabled,
14280
- 'text-grey-500': !disabled
14281
- })
14304
+ output = /*#__PURE__*/React__default.createElement(Placeholder, {
14305
+ disabled: disabled
14282
14306
  }, placeholder);
14283
14307
  } else if (currentValue) {
14284
14308
  if (tags && emptyValue !== value) {
@@ -14330,11 +14354,8 @@ const Multiple = /*#__PURE__*/React__default.forwardRef(function Select2TriggerM
14330
14354
  className: "my-1 flex max-h-[5.5rem] flex-col"
14331
14355
  }, /*#__PURE__*/React__default.createElement("div", {
14332
14356
  className: "flex flex-wrap gap-1"
14333
- }, valuesAsChildren.length === 0 ? ( /*#__PURE__*/React__default.createElement("div", {
14334
- className: cn({
14335
- 'text-grey-700': disabled,
14336
- 'text-grey-500': !disabled
14337
- })
14357
+ }, valuesAsChildren.length === 0 ? ( /*#__PURE__*/React__default.createElement(Placeholder, {
14358
+ disabled: disabled
14338
14359
  }, placeholder)) : valuesAsChildren.map(child => ( /*#__PURE__*/React__default.createElement(Tag$1, {
14339
14360
  key: String(child.props.value),
14340
14361
  className: "truncate",
@@ -14393,11 +14414,8 @@ const MultipleValue = ({
14393
14414
  }, /*#__PURE__*/React__default.createElement("div", {
14394
14415
  className: "flex gap-1 truncate",
14395
14416
  ref: el => setContentRef(el)
14396
- }, valuesAsChildren.length === 0 ? ( /*#__PURE__*/React__default.createElement("div", {
14397
- className: cn({
14398
- 'text-grey-700': disabled,
14399
- 'text-grey-500': !disabled
14400
- })
14417
+ }, valuesAsChildren.length === 0 ? ( /*#__PURE__*/React__default.createElement(Placeholder, {
14418
+ disabled: disabled
14401
14419
  }, placeholder)) : valuesAsChildren.map((child, index) => {
14402
14420
  const tag = /*#__PURE__*/React__default.createElement(Tag$1, {
14403
14421
  key: String(child.props.value),
@@ -14726,19 +14744,20 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
14726
14744
  defaultValue: defaultProp,
14727
14745
  disabled = false,
14728
14746
  emptyValue = undefined,
14729
- placeholder,
14747
+ fontSize,
14730
14748
  highlighted = false,
14731
14749
  invalid = false,
14750
+ loading,
14732
14751
  multiple = false,
14733
14752
  name,
14734
14753
  onChange,
14735
14754
  onCreate,
14736
14755
  onDelete,
14737
14756
  onEdit,
14757
+ placeholder,
14738
14758
  readOnly = false,
14739
14759
  tags = false,
14740
14760
  value: prop,
14741
- fontSize,
14742
14761
  ...otherProps
14743
14762
  } = props;
14744
14763
  const emptyOption = React__default.useMemo(() => {
@@ -14923,9 +14942,8 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
14923
14942
  emptyValue: emptyValue,
14924
14943
  onBlur: handleBlur,
14925
14944
  onKeyDown: handleKeyDown,
14926
- ref: internalRef,
14927
- fontSize: fontSize,
14928
- placeholder: placeholder
14945
+ placeholder: placeholder,
14946
+ ref: internalRef
14929
14947
  }), flattenedChildren)), /*#__PURE__*/React__default.createElement(PopoverPrimitive.Portal, null, /*#__PURE__*/React__default.createElement(PopoverPrimitive.Content, {
14930
14948
  asChild: true,
14931
14949
  align: "start",
@@ -14951,7 +14969,16 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
14951
14969
  onClick: areAllSelected ? deselectAll : selectAll
14952
14970
  }, selectAllText), /*#__PURE__*/React__default.createElement("div", {
14953
14971
  className: "border-grey-300 mx-3 rounded border-t"
14954
- }))))) : null, flattenedChildren.length <= 0 ? ( /*#__PURE__*/React__default.createElement("div", {
14972
+ }))))) : null, loading ? ( /*#__PURE__*/React__default.createElement("span", {
14973
+ className: cn('text-grey-700 flex items-center italic', fontSize && getFontSize(fontSize))
14974
+ }, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(Spinner, {
14975
+ delay: 0,
14976
+ className: cn('ml-3 mr-2 mt-1.5 h-5 w-5', {
14977
+ '!mt-1 !h-3.5 !w-3.5': fontSize === exports.FontSizes.small,
14978
+ '!h-4 !w-4': fontSize === exports.FontSizes.medium,
14979
+ '!h-5 !w-5': fontSize === exports.FontSizes.large
14980
+ })
14981
+ })), /*#__PURE__*/React__default.createElement("span", null, texts.listbox.loading))) : flattenedChildren.length <= 0 ? ( /*#__PURE__*/React__default.createElement("div", {
14955
14982
  className: "text-grey-700 -mt-0.5 flex h-8 items-center px-2",
14956
14983
  role: "presentation"
14957
14984
  }, "No results found...")) : ( /*#__PURE__*/React__default.createElement(Root$1, {
@@ -15134,12 +15161,21 @@ function Print$1(props) {
15134
15161
  // do this here because Safari doesn't support the beforeprint event
15135
15162
  togglePrinting(true);
15136
15163
  requestAnimationFrame(() => {
15137
- try {
15138
- // window.print doesn't always work in Safari :man_shrugging:
15139
- document.execCommand('print', false, undefined);
15140
- } catch {
15141
- window.print();
15142
- }
15164
+ requestAnimationFrame(() => {
15165
+ const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
15166
+ if (isSafari) {
15167
+ try {
15168
+ // Try using document.execCommand for printing in Safari
15169
+ document.execCommand('print', false, undefined);
15170
+ } catch (error) {
15171
+ // If document.execCommand fails or throws an error, fallback to window.print()
15172
+ window.print();
15173
+ }
15174
+ } else {
15175
+ // Execute window.print() for all other browsers
15176
+ window.print();
15177
+ }
15178
+ });
15143
15179
  });
15144
15180
  }, 150);
15145
15181
  }
@@ -15830,7 +15866,9 @@ function TableGrid(props) {
15830
15866
  enableHorizontalArrowKeyNavigation: enableHorizontalArrowKeyNavigation,
15831
15867
  table: table.instance,
15832
15868
  style: table.renderer.style
15833
- }, table.renderer.rows), table.meta.footer.isEnabled ? ( /*#__PURE__*/React__default.createElement("tfoot", null, /*#__PURE__*/React__default.createElement("tr", null, table.instance.getFooterGroups()[0].headers.map(Footer$3)))) : null)) : ( /*#__PURE__*/React__default.createElement(EmptyStateBody, {
15869
+ }, table.renderer.rows), table.meta.footer.isEnabled ? /*#__PURE__*/React__default.createElement(Foot, {
15870
+ table: table.instance
15871
+ }) : null)) : ( /*#__PURE__*/React__default.createElement(EmptyStateBody, {
15834
15872
  emptyState: table.props.emptyState
15835
15873
  })))));
15836
15874
  }
@@ -18445,8 +18483,8 @@ function Alert$1(props) {
18445
18483
  if (pendingChangesWithErrors.length > 1 && index === pendingChangesWithErrors.length - 1) {
18446
18484
  links.push(validationTexts.alert.messageAnd);
18447
18485
  }
18486
+ const rowIndex = table.getRowModel().rows.findIndex(row => row.id === error.rowId);
18448
18487
  const handleClick = () => {
18449
- const rowIndex = table.getRowModel().rows.findIndex(row => row.id === error.rowId);
18450
18488
  if (rowIndex > -1) {
18451
18489
  scrollToRow(rowIndex);
18452
18490
  } else {
@@ -18469,7 +18507,7 @@ function Alert$1(props) {
18469
18507
  className: "text-blue",
18470
18508
  onClick: handleClick,
18471
18509
  role: "button"
18472
- }, rowIdentityColumn ? error.pendingChange._meta.original[rowIdentityColumn.id] : error.rowId)));
18510
+ }, rowIdentityColumn ? error.pendingChange._meta.original[rowIdentityColumn.id] : rowIndex + 1)));
18473
18511
  // if appropriate, concatenate the item with the text ","
18474
18512
  if (pendingChangesWithErrors.length > 2 && index < pendingChangesWithErrors.length - 2) {
18475
18513
  links.push(', ');