@economic/taco 2.10.1 → 2.11.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Menu/Menu.d.ts +2 -1
- package/dist/components/Menu/components/Content.d.ts +1 -1
- package/dist/components/Menu/components/Separator.d.ts +4 -2
- package/dist/components/Menu/components/SubMenu.d.ts +1 -1
- package/dist/components/Table3/components/toolbar/Settings.d.ts +2 -0
- package/dist/components/Table3/components/toolbar/Toolbar.d.ts +2 -1
- package/dist/components/Table3/hooks/useTable.d.ts +2 -1
- package/dist/components/Table3/types.d.ts +3 -0
- package/dist/esm/packages/taco/src/components/Menu/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Separator.js +7 -6
- package/dist/esm/packages/taco/src/components/Menu/components/Separator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +2 -0
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +5 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Toolbar.js +3 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Toolbar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js +1 -12
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +15 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js +10 -12
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/taco.cjs.development.js +42 -31
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +14 -14
- package/types.json +5653 -5431
@@ -5,6 +5,7 @@ import { MenuLinkItemProps } from './components/Link';
|
|
5
5
|
import { MenuTriggerProps } from './components/Trigger';
|
6
6
|
import { MenuCheckboxItemProps } from './components/Checkbox';
|
7
7
|
import { ForwardedMenuRadioGroupWithStatics } from './components/RadioGroup';
|
8
|
+
import { MenuSeparatorProps } from './components/Separator';
|
8
9
|
import { MenuHeaderProps } from './components/Header';
|
9
10
|
import { MenuSubMenuProps } from './components/SubMenu';
|
10
11
|
export declare type MenuProps = {
|
@@ -24,7 +25,7 @@ export declare type ForwardedMenuWithStatics = React.ForwardRefExoticComponent<M
|
|
24
25
|
Item: React.ForwardRefExoticComponent<MenuItemProps>;
|
25
26
|
Link: React.ForwardRefExoticComponent<MenuLinkItemProps>;
|
26
27
|
Checkbox: React.ForwardRefExoticComponent<MenuCheckboxItemProps>;
|
27
|
-
Separator: React.
|
28
|
+
Separator: React.ForwardRefExoticComponent<MenuSeparatorProps>;
|
28
29
|
Header: React.ForwardRefExoticComponent<MenuHeaderProps>;
|
29
30
|
RadioGroup: ForwardedMenuRadioGroupWithStatics;
|
30
31
|
SubMenu: React.ForwardRefExoticComponent<MenuSubMenuProps>;
|
@@ -7,7 +7,7 @@ export declare type MenuContentProps = Omit<DropdownMenuPrimitive.DropdownMenuCo
|
|
7
7
|
/** Set the position of the Menu relative to its trigger. Default value is `bottom` */
|
8
8
|
placement?: Placement;
|
9
9
|
};
|
10
|
-
export declare const Content: React.ForwardRefExoticComponent<Pick<DropdownMenuPrimitive.DropdownMenuContentProps, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "onChange" | "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" | "asChild" | "sideOffset" | "align" | "alignOffset" | "arrowPadding" | "collisionBoundary" | "collisionPadding" | "sticky" | "hideWhenDetached" | "
|
10
|
+
export declare const Content: React.ForwardRefExoticComponent<Pick<DropdownMenuPrimitive.DropdownMenuContentProps, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "onChange" | "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" | "asChild" | "sideOffset" | "align" | "alignOffset" | "arrowPadding" | "avoidCollisions" | "collisionBoundary" | "collisionPadding" | "sticky" | "hideWhenDetached" | "updatePositionStrategy" | "onCloseAutoFocus" | "loop" | "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "forceMount"> & {
|
11
11
|
align?: "start" | "center" | "end" | undefined;
|
12
12
|
children: React.ReactNode;
|
13
13
|
/** Set the position of the Menu relative to its trigger. Default value is `bottom` */
|
@@ -1,2 +1,4 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import * as React from 'react';
|
2
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
3
|
+
export declare type MenuSeparatorProps = DropdownMenuPrimitive.DropdownMenuSeparatorProps;
|
4
|
+
export declare const Separator: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -3,6 +3,6 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
3
|
export declare type MenuSubMenuProps = Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps, 'children' | 'side'> & {
|
4
4
|
children: React.ReactNode;
|
5
5
|
};
|
6
|
-
export declare const SubMenu: React.ForwardRefExoticComponent<Pick<DropdownMenuPrimitive.DropdownMenuSubContentProps, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "onChange" | "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" | "asChild" | "sideOffset" | "alignOffset" | "arrowPadding" | "collisionBoundary" | "collisionPadding" | "sticky" | "hideWhenDetached" | "
|
6
|
+
export declare const SubMenu: React.ForwardRefExoticComponent<Pick<DropdownMenuPrimitive.DropdownMenuSubContentProps, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "onChange" | "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" | "asChild" | "sideOffset" | "alignOffset" | "arrowPadding" | "avoidCollisions" | "collisionBoundary" | "collisionPadding" | "sticky" | "hideWhenDetached" | "updatePositionStrategy" | "loop" | "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "forceMount"> & {
|
7
7
|
children: React.ReactNode;
|
8
8
|
} & React.RefAttributes<HTMLDivElement>>;
|
@@ -1,6 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { Table as RTable } from '@tanstack/react-table';
|
3
|
+
import { Table3CustomSettingRenderer } from '../../types';
|
3
4
|
export declare type SettingsButtonProps<TType = unknown> = {
|
5
|
+
customSettings?: Table3CustomSettingRenderer[];
|
4
6
|
table: RTable<TType>;
|
5
7
|
};
|
6
8
|
export declare function SettingsButton<TType = unknown>(props: SettingsButtonProps<TType>): JSX.Element;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { Table as RTable } from '@tanstack/react-table';
|
3
|
-
import { Table3Props } from '../../types';
|
3
|
+
import { Table3CustomSettingRenderer, Table3Props } from '../../types';
|
4
4
|
export declare type ToolbarProps<TType = unknown> = {
|
5
|
+
customSettings?: Table3CustomSettingRenderer[];
|
5
6
|
left?: JSX.Element;
|
6
7
|
right?: JSX.Element;
|
7
8
|
scrollToIndex: any;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { RowData } from '@tanstack/react-table';
|
3
|
-
import { Table3ColumnAlignment, Table3ColumnRenderer, Table3Props, Table3ColumnHeaderMenu, Table3ColumnControlRenderer, Table3ColumnDataType, Table3ColumnClassNameHandler, Table3ColumnFooterRenderer, TableStrategy, Table3FilterComparator } from '../types';
|
3
|
+
import { Table3ColumnAlignment, Table3ColumnRenderer, Table3Props, Table3ColumnHeaderMenu, Table3ColumnControlRenderer, Table3ColumnDataType, Table3ColumnClassNameHandler, Table3ColumnFooterRenderer, TableStrategy, Table3FilterComparator, Table3Settings } from '../types';
|
4
4
|
import { useCurrentRow } from './features/useCurrentRow';
|
5
5
|
import { usePauseHoverState } from './features/usePauseHoverState';
|
6
6
|
import { useRowHeight } from './features/useRowHeight';
|
@@ -24,6 +24,7 @@ declare module '@tanstack/table-core' {
|
|
24
24
|
editing: ReturnType<typeof useEditing>;
|
25
25
|
enableFooter: boolean;
|
26
26
|
fontSize: ReturnType<typeof useFontSize>;
|
27
|
+
getSettings: () => Table3Settings;
|
27
28
|
hoverState: ReturnType<typeof usePauseHoverState>;
|
28
29
|
isPrinting: boolean;
|
29
30
|
isUsingServer: boolean;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ColumnFilter as RTColumnFilter, ColumnOrderState, ColumnSizingState, ColumnSort as RTTableColumnSort, SortingState, VisibilityState, BuiltInSortingFn } from '@tanstack/react-table';
|
3
3
|
import { MenuProps } from '../Menu/Menu';
|
4
|
+
import { MenuItemProps } from '../Menu/components/Item';
|
4
5
|
export declare type Table3SortDirection = 'asc' | 'desc';
|
5
6
|
export declare type Table3SortFn<TType = unknown> = ((rowA: TType, rowB: TType, columnId: string) => -1 | 0 | 1) | BuiltInSortingFn | 'auto';
|
6
7
|
export declare type Table3ColumnRenderer<TValue = unknown, TType = unknown> = (value: TValue, row: TType) => JSX.Element | string | number | null;
|
@@ -139,11 +140,13 @@ export declare type Table3Options = {
|
|
139
140
|
enableSearch: boolean;
|
140
141
|
enableSorting: boolean;
|
141
142
|
};
|
143
|
+
export declare type Table3CustomSettingRenderer = (props: Table3Settings) => React.ReactElement<MenuItemProps> | null;
|
142
144
|
export declare type Table3CommonProps<TType = unknown> = Partial<Table3Options> & {
|
143
145
|
actionsForRow?: Table3RowActionRenderer<TType>[];
|
144
146
|
actionsForRowLength?: number;
|
145
147
|
autoFocus?: boolean;
|
146
148
|
children: (JSX.Element | boolean | null | undefined)[];
|
149
|
+
customSettings?: Table3CustomSettingRenderer[];
|
147
150
|
data: TType[];
|
148
151
|
defaultColumnFreezingIndex?: number;
|
149
152
|
defaultCurrentRowIndex?: number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Menu.js","sources":["../../../../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { MenuContext } from './Context';\nimport { Content, MenuContentProps } from './components/Content';\nimport { Item, MenuItemProps } from './components/Item';\nimport { Link, MenuLinkItemProps } from './components/Link';\nimport { Trigger, MenuTriggerProps } from './components/Trigger';\nimport { Checkbox, MenuCheckboxItemProps } from './components/Checkbox';\nimport { ForwardedMenuRadioGroupWithStatics, RadioGroup } from './components/RadioGroup';\nimport { Separator } from './components/Separator';\nimport { Header, MenuHeaderProps } from './components/Header';\nimport { SubMenu, MenuSubMenuProps } from './components/SubMenu';\n\nexport type MenuProps = {\n children: React.ReactNode;\n /** Set whether the menu is open by default or not */\n defaultOpen?: boolean;\n /** Called when the menu opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n /** Control the open state of the menu from outside the component */\n open?: boolean;\n /** A trigger to be used for the menu, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n};\nexport type ForwardedMenuWithStatics = React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<MenuTriggerProps>;\n Content: React.ForwardRefExoticComponent<MenuContentProps>;\n Item: React.ForwardRefExoticComponent<MenuItemProps>;\n Link: React.ForwardRefExoticComponent<MenuLinkItemProps>;\n Checkbox: React.ForwardRefExoticComponent<MenuCheckboxItemProps>;\n Separator: React.
|
1
|
+
{"version":3,"file":"Menu.js","sources":["../../../../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { MenuContext } from './Context';\nimport { Content, MenuContentProps } from './components/Content';\nimport { Item, MenuItemProps } from './components/Item';\nimport { Link, MenuLinkItemProps } from './components/Link';\nimport { Trigger, MenuTriggerProps } from './components/Trigger';\nimport { Checkbox, MenuCheckboxItemProps } from './components/Checkbox';\nimport { ForwardedMenuRadioGroupWithStatics, RadioGroup } from './components/RadioGroup';\nimport { MenuSeparatorProps, Separator } from './components/Separator';\nimport { Header, MenuHeaderProps } from './components/Header';\nimport { SubMenu, MenuSubMenuProps } from './components/SubMenu';\n\nexport type MenuProps = {\n children: React.ReactNode;\n /** Set whether the menu is open by default or not */\n defaultOpen?: boolean;\n /** Called when the menu opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n /** Control the open state of the menu from outside the component */\n open?: boolean;\n /** A trigger to be used for the menu, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n};\nexport type ForwardedMenuWithStatics = React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<MenuTriggerProps>;\n Content: React.ForwardRefExoticComponent<MenuContentProps>;\n Item: React.ForwardRefExoticComponent<MenuItemProps>;\n Link: React.ForwardRefExoticComponent<MenuLinkItemProps>;\n Checkbox: React.ForwardRefExoticComponent<MenuCheckboxItemProps>;\n Separator: React.ForwardRefExoticComponent<MenuSeparatorProps>;\n Header: React.ForwardRefExoticComponent<MenuHeaderProps>;\n RadioGroup: ForwardedMenuRadioGroupWithStatics;\n SubMenu: React.ForwardRefExoticComponent<MenuSubMenuProps>;\n};\n\nexport const Menu = React.forwardRef<HTMLButtonElement, MenuProps>(function Menu(externalProps, ref) {\n const { children, defaultOpen: defaultProp, onChange, open: prop, trigger, ...props } = externalProps;\n const [indented, setIndented] = React.useState(false);\n const [minWidth, setMinWidth] = React.useState<number | undefined>(undefined);\n\n const [open, setOpen] = useControllableState<boolean>({\n // uncontrolled\n defaultProp,\n // controlled\n onChange,\n prop,\n });\n\n const context = React.useMemo(\n () => ({\n indented,\n registerIndentation: () => setIndented(true),\n minWidth,\n setMinWidth: (width: number) => setMinWidth(width),\n open: () => setOpen(true),\n close: () => setOpen(false),\n }),\n [indented, minWidth]\n );\n\n return (\n <MenuContext.Provider value={context}>\n <DropdownMenuPrimitive.Root {...props} modal={false} open={open} onOpenChange={setOpen}>\n {trigger && <Trigger ref={ref}>{trigger}</Trigger>}\n {children}\n </DropdownMenuPrimitive.Root>\n </MenuContext.Provider>\n );\n}) as ForwardedMenuWithStatics;\nMenu.Trigger = Trigger;\nMenu.Content = Content;\nMenu.Item = Item;\nMenu.Link = Link;\nMenu.Checkbox = Checkbox;\nMenu.Separator = Separator;\nMenu.Header = Header;\nMenu.RadioGroup = RadioGroup;\nMenu.SubMenu = SubMenu;\n"],"names":["Menu","React","externalProps","ref","children","defaultOpen","defaultProp","onChange","open","prop","trigger","props","indented","setIndented","minWidth","setMinWidth","undefined","setOpen","useControllableState","context","registerIndentation","width","close","MenuContext","Provider","value","DropdownMenuPrimitive","modal","onOpenChange","Trigger","Content","Item","Link","Checkbox","Separator","Header","RadioGroup","SubMenu"],"mappings":";;;;;;;;;;;;;;MAqCaA,IAAI,gBAAGC,UAAgB,CAA+B,SAASD,IAAIA,CAACE,aAAa,EAAEC,GAAG;EAC/F,MAAM;IAAEC,QAAQ;IAAEC,WAAW,EAAEC,WAAW;IAAEC,QAAQ;IAAEC,IAAI,EAAEC,IAAI;IAAEC,OAAO;IAAE,GAAGC;GAAO,GAAGT,aAAa;EACrG,MAAM,CAACU,QAAQ,EAAEC,WAAW,CAAC,GAAGZ,QAAc,CAAC,KAAK,CAAC;EACrD,MAAM,CAACa,QAAQ,EAAEC,WAAW,CAAC,GAAGd,QAAc,CAAqBe,SAAS,CAAC;EAE7E,MAAM,CAACR,IAAI,EAAES,OAAO,CAAC,GAAGC,oBAAoB,CAAU;;IAElDZ,WAAW;;IAEXC,QAAQ;IACRE;GACH,CAAC;EAEF,MAAMU,OAAO,GAAGlB,OAAa,CACzB,OAAO;IACHW,QAAQ;IACRQ,mBAAmB,EAAEA,MAAMP,WAAW,CAAC,IAAI,CAAC;IAC5CC,QAAQ;IACRC,WAAW,EAAGM,KAAa,IAAKN,WAAW,CAACM,KAAK,CAAC;IAClDb,IAAI,EAAEA,MAAMS,OAAO,CAAC,IAAI,CAAC;IACzBK,KAAK,EAAEA,MAAML,OAAO,CAAC,KAAK;GAC7B,CAAC,EACF,CAACL,QAAQ,EAAEE,QAAQ,CAAC,CACvB;EAED,oBACIb,cAACsB,WAAW,CAACC,QAAQ;IAACC,KAAK,EAAEN;kBACzBlB,cAACyB,IAA0B,oBAAKf,KAAK;IAAEgB,KAAK,EAAE,KAAK;IAAEnB,IAAI,EAAEA,IAAI;IAAEoB,YAAY,EAAEX;MAC1EP,OAAO,iBAAIT,cAAC4B,OAAO;IAAC1B,GAAG,EAAEA;KAAMO,OAAO,CAAW,EACjDN,QAAQ,CACgB,CACV;AAE/B,CAAC;AACDJ,IAAI,CAAC6B,OAAO,GAAGA,OAAO;AACtB7B,IAAI,CAAC8B,OAAO,GAAGA,OAAO;AACtB9B,IAAI,CAAC+B,IAAI,GAAGA,IAAI;AAChB/B,IAAI,CAACgC,IAAI,GAAGA,IAAI;AAChBhC,IAAI,CAACiC,QAAQ,GAAGA,QAAQ;AACxBjC,IAAI,CAACkC,SAAS,GAAGA,SAAS;AAC1BlC,IAAI,CAACmC,MAAM,GAAGA,MAAM;AACpBnC,IAAI,CAACoC,UAAU,GAAGA,UAAU;AAC5BpC,IAAI,CAACqC,OAAO,GAAGA,OAAO;;;;"}
|
@@ -1,11 +1,12 @@
|
|
1
|
-
import { createElement } from 'react';
|
1
|
+
import { forwardRef, createElement } from 'react';
|
2
2
|
import { Separator as Separator$1 } from '@radix-ui/react-dropdown-menu';
|
3
3
|
|
4
|
-
const Separator = () => {
|
5
|
-
return /*#__PURE__*/createElement(Separator$1, {
|
6
|
-
className: "bg-grey-300 my-1 h-px"
|
7
|
-
|
8
|
-
};
|
4
|
+
const Separator = /*#__PURE__*/forwardRef((props, ref) => {
|
5
|
+
return /*#__PURE__*/createElement(Separator$1, Object.assign({}, props, {
|
6
|
+
className: "bg-grey-300 my-1 h-px",
|
7
|
+
ref: ref
|
8
|
+
}));
|
9
|
+
});
|
9
10
|
|
10
11
|
export { Separator };
|
11
12
|
//# sourceMappingURL=Separator.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Separator.js","sources":["../../../../../../../../src/components/Menu/components/Separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nexport const Separator = () => {\n return <DropdownMenuPrimitive.Separator className=\"bg-grey-300 my-1 h-px\" />;\n};\n"],"names":["Separator","React","DropdownMenuPrimitive","className"],"mappings":";;;
|
1
|
+
{"version":3,"file":"Separator.js","sources":["../../../../../../../../src/components/Menu/components/Separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nexport type MenuSeparatorProps = DropdownMenuPrimitive.DropdownMenuSeparatorProps;\n\nexport const Separator = React.forwardRef<HTMLDivElement, MenuSeparatorProps>((props, ref) => {\n return <DropdownMenuPrimitive.Separator {...props} className=\"bg-grey-300 my-1 h-px\" ref={ref} />;\n});\n"],"names":["Separator","React","props","ref","DropdownMenuPrimitive","className"],"mappings":";;;MAKaA,SAAS,gBAAGC,UAAgB,CAAqC,CAACC,KAAK,EAAEC,GAAG;EACrF,oBAAOF,cAACG,WAA+B,oBAAKF,KAAK;IAAEG,SAAS,EAAC,uBAAuB;IAACF,GAAG,EAAEA;KAAO;AACrG,CAAC;;;;"}
|
@@ -21,6 +21,7 @@ const fixedForwardRef = React__default.forwardRef;
|
|
21
21
|
const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
22
22
|
const {
|
23
23
|
emptyState: EmptyState,
|
24
|
+
customSettings,
|
24
25
|
toolbarLeft,
|
25
26
|
toolbarRight
|
26
27
|
} = props;
|
@@ -112,6 +113,7 @@ const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
112
113
|
total: length,
|
113
114
|
left: toolbarLeft,
|
114
115
|
right: toolbarRight,
|
116
|
+
customSettings: customSettings,
|
115
117
|
scrollToIndex: scrollToIndex
|
116
118
|
}), /*#__PURE__*/React__default.createElement("div", {
|
117
119
|
className: className,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Table3.js","sources":["../../../../../../../src/components/Table3/Table3.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { flexRender, TableMeta } from '@tanstack/react-table';\nimport { FocusScope } from '@react-aria/focus';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { useCssGrid } from './hooks/useCssGrid';\nimport { useTable } from './hooks/useTable';\nimport { useTableRenderStrategy } from './strategies';\nimport { Table3ColumnProps, Table3Props, Table3Ref } from './types';\nimport { Toolbar } from './components/toolbar/Toolbar';\nimport { useColumnFreezingStyle } from './hooks/features/useColumnFreezing';\nimport { useTableRefInstanceSetup } from './hooks/useTableRefInstanceSetup';\nimport { Summary } from './components/columns/footer/Summary';\nimport { useCssVars } from './hooks/useCssVars';\nimport './style.css';\n\nfunction Column<TType = unknown>(_: Table3ColumnProps<TType>) {\n return null;\n}\n\ntype FixedForwardRef = <T, P = {}>(\n render: (props: P, ref: React.Ref<T>) => JSX.Element\n) => (props: P & React.RefAttributes<T>) => JSX.Element;\n\n// Cast the old forwardRef to the new one\nexport const fixedForwardRef = React.forwardRef as FixedForwardRef;\n\nconst Table = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const { emptyState: EmptyState, toolbarLeft, toolbarRight } = props;\n const internalRef = useMergedRef<Table3Ref>(ref);\n\n const { table, length } = useTable<TType>(props);\n useTableRefInstanceSetup(table, internalRef);\n\n React.useEffect(() => {\n if (props.autoFocus) {\n internalRef.current?.focus();\n }\n }, []);\n\n const { renderBody, scrollToIndex } = useTableRenderStrategy<TType>(props, table, internalRef);\n const tableMeta = table.options.meta as TableMeta<TType>;\n const state = table.getState();\n\n const bodyRef = React.useRef<HTMLDivElement | null>(null);\n\n React.useEffect(\n () => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n const dialog = target.closest('[role=\"dialog\"]');\n const eventOriginatedFromCombobox = !!target.closest('[role=\"combobox\"]');\n\n // Don't trigger global shortcuts on the table if event originated from a combobox or if table is\n // outside the dialog\n if (eventOriginatedFromCombobox || (dialog && !dialog?.contains(internalRef.current))) {\n return;\n }\n\n tableMeta.hoverState.handleKeyDown(event);\n tableMeta.currentRow.handleKeyDown(\n event,\n table.getRowModel().rows.length,\n scrollToIndex,\n tableMeta.editing.isEditing,\n internalRef\n );\n tableMeta.rowClick.handleKeyDown(event, table);\n tableMeta.rowSelection.handleKeyDown(event, table);\n tableMeta.editing.handleKeyDown(event);\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n },\n // See https://github.com/e-conomic/taco/blob/dev/packages/taco/src/components/Table3/strategies/virtualised.tsx#L143\n // scrollToIndex function changes when row count changes, so it is important to update handlers with new\n // scrollToIndex function.\n [scrollToIndex, tableMeta.editing.isEditing, internalRef.current]\n );\n\n const handleBlur = (event: React.FocusEvent) => {\n tableMeta.editing.handleBlur(event);\n };\n\n const handleFocus = (event: React.FocusEvent) => {\n tableMeta.currentRow.handleFocus(event, table.getRowModel().rows.length, scrollToIndex);\n };\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n tableMeta.columnFreezing.handleScroll(event);\n };\n\n const className = cn(\n 'border-grey-300 relative grid h-full w-full flex-grow overflow-auto rounded border bg-white scroll-mt-[41px] focus-visible:outline-none',\n '[&[data-resizing=\"true\"]]:select-none',\n {\n 'text-xs': tableMeta.fontSize.size === 'small',\n 'text-sm': tableMeta.fontSize.size === 'medium',\n 'text-base': tableMeta.fontSize.size === 'large',\n }\n );\n\n // Print tables have \"_print\" as the postfix for the table id, so we can use the it to determine\n // if the table is a print table or not.\n const { style: cssGridStyle } = useCssGrid<TType>(table, tableMeta.isPrinting);\n const { style: cssVars } = useCssVars(tableMeta.rowHeight.height, tableMeta.fontSize.size);\n\n const style = {\n ...cssVars,\n ...cssGridStyle,\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n opacity: 0.999,\n };\n\n const columnFreezingStyle = useColumnFreezingStyle(props.id, table);\n const isServerLoadingAndNotReady = tableMeta.isUsingServer && props.length === undefined;\n\n return (\n <>\n {columnFreezingStyle ? <style data-taco=\"table3-column-freezing-styles\">{columnFreezingStyle}</style> : null}\n <Toolbar\n table={table}\n tableProps={props}\n total={length}\n left={toolbarLeft}\n right={toolbarRight}\n scrollToIndex={scrollToIndex}\n />\n <div\n className={className}\n id={props.id}\n data-font-size={tableMeta.fontSize.size}\n data-editing={tableMeta.editing.isEditing}\n data-horizontally-scrolled={tableMeta.columnFreezing.horizontallyScrolled}\n data-pause-hover={tableMeta?.hoverState.isPaused}\n data-resizing={!!state.columnSizingInfo.isResizingColumn}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onFocus={handleFocus}\n onScroll={handleScroll}\n ref={internalRef}\n role=\"table\"\n style={style}\n tabIndex={-1}>\n {isServerLoadingAndNotReady ? null : (\n <div className=\"group/header contents\" data-taco=\"table2-header\" role=\"rowgroup\">\n {table.getHeaderGroups().map(headerGroup => (\n <div className=\"contents\" key={headerGroup.id} role=\"row\">\n {headerGroup.headers.map(header => (\n <React.Fragment key={header.id}>\n {flexRender(header.column.columnDef.header, { ...header.getContext(), scrollToIndex })}\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n )}\n {table.getRowModel().rows.length ? (\n <>\n <FocusScope autoFocus={tableMeta.editing.isEditing}>\n <div className=\"group/body contents\" data-taco=\"table2-body\" role=\"rowgroup\" ref={bodyRef}>\n {renderBody()}\n </div>\n </FocusScope>\n {/* This div makes sure that there is always a free space between the rows and footer when\n table height exceeds the cumulative height of all rows. See useCSSGrid.ts */}\n {/* By vertically translating the div a pixel down, we hide the div border below footer so that\n the footer border doesn't appear an extra pixel thick */}\n <div className=\"border-grey-300 col-span-full translate-y-px border-t\" />\n {tableMeta.enableFooter ? (\n <div className=\"group/footer contents\" data-taco=\"table2-footer\" role=\"rowgroup\">\n {table.getFooterGroups().map(footerGroup => (\n <div className=\"contents\" key={footerGroup.id} role=\"row\">\n {footerGroup.headers.map(footer => (\n <React.Fragment key={footer.id}>\n {flexRender(footer.column.columnDef.footer, footer.getContext())}\n </React.Fragment>\n ))}\n </div>\n ))}\n {length ? (\n <Summary currentLength={table.getRowModel().rows.length} length={length} table={table} />\n ) : null}\n </div>\n ) : null}\n </>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n </div>\n </>\n );\n});\n\ntype Table3WithStatics = (<TType = unknown>(props: Table3Props<TType> & React.RefAttributes<Table3Ref>) => JSX.Element) & {\n Column: typeof Column;\n};\n\nexport const Table3 = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const stringifiedChildren = String(props.children);\n // we force a remount (using key) when the child columns change because there are too many places to add children as an effect\n // this is cheaper from a complexity perspective, and probably performance wise as well\n const key = React.useMemo(() => String('tableKey_' + stringifiedChildren), [stringifiedChildren]);\n return <Table<TType> {...props} key={key} ref={ref} />;\n}) as Table3WithStatics;\nTable3.Column = Column;\n\n// hooks\nexport { useTable3DataLoader } from './hooks/useTableDataLoader';\n\n// types\nexport type {\n useTable3DataFetcher,\n useTable3DataOptions,\n useTable3DataFetcherValues as useTableDataValues,\n} from './hooks/useTableDataLoader';\n\nexport type {\n Table3Ref,\n Table3Props,\n Table3Preset,\n Table3Settings,\n Table3SettingsHandler,\n Table3RowHeight,\n Table3FilterComparator,\n Table3FilterHandler,\n Table3LoadPageHandler,\n Table3LoadAllHandler,\n Table3RowGotoHandler,\n Table3SortHandler,\n Table3Shortcuts,\n Table3ShortcutHandlerFn,\n Table3ShortcutHandlerObject,\n Table3FontSize,\n Table3SortDirection,\n Table3SortFn,\n Table3RowActionRenderer,\n Table3RowSelectionHandler,\n Table3RowExpansionRenderer,\n Table3RowDropHandler,\n Table3RowDragHandler,\n Table3RowClickHandler,\n Table3ColumnProps,\n Table3ColumnAlignment,\n Table3ColumnDataType,\n Table3ColumnHeaderMenu,\n Table3ColumnClassNameHandler,\n Table3ColumnFooterRenderer,\n Table3ColumnRenderer,\n Table3ColumnControlRenderer,\n Table3ColumnControlProps,\n} from './types';\n"],"names":["Column","_","fixedForwardRef","React","forwardRef","Table","Table3","props","ref","emptyState","EmptyState","toolbarLeft","toolbarRight","internalRef","useMergedRef","table","length","useTable","useTableRefInstanceSetup","useEffect","autoFocus","_internalRef$current","current","focus","renderBody","scrollToIndex","useTableRenderStrategy","tableMeta","options","meta","state","getState","bodyRef","useRef","handleKeyDown","event","target","dialog","closest","eventOriginatedFromCombobox","contains","hoverState","currentRow","getRowModel","rows","editing","isEditing","rowClick","rowSelection","document","addEventListener","removeEventListener","handleBlur","handleFocus","handleScroll","columnFreezing","Promise","resolve","e","reject","className","cn","fontSize","size","style","cssGridStyle","useCssGrid","isPrinting","cssVars","useCssVars","rowHeight","height","opacity","columnFreezingStyle","useColumnFreezingStyle","id","isServerLoadingAndNotReady","isUsingServer","undefined","Toolbar","tableProps","total","left","right","horizontallyScrolled","isPaused","columnSizingInfo","isResizingColumn","onBlur","onFocus","onScroll","role","tabIndex","getHeaderGroups","map","headerGroup","key","headers","header","Fragment","flexRender","column","columnDef","getContext","FocusScope","enableFooter","getFooterGroups","footerGroup","footer","Summary","currentLength","stringifiedChildren","String","children","useMemo"],"mappings":";;;;;;;;;;;;;;;AAgBA,SAASA,MAAMA,CAAkBC,CAA2B;EACxD,OAAO,IAAI;AACf;AAMA;MACaC,eAAe,GAAGC,cAAK,CAACC;AAErC,MAAMC,KAAK,gBAAGH,e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AAE,CAACZ,GAAG,CAACa,WAAW,iBACpCxG;IAAKyD,SAAS,EAAC,UAAU;IAACoC,GAAG,EAAEW,WAAW,CAAChC,EAAE;IAAEgB,IAAI,EAAC;KAC/CgB,WAAW,CAACV,OAAO,CAACH,GAAG,CAACc,MAAM,iBAC3BzG,6BAACA,cAAK,CAACgG,QAAQ;IAACH,GAAG,EAAEY,MAAM,CAACjC;KACvByB,UAAU,CAACQ,MAAM,CAACP,MAAM,CAACC,SAAS,CAACM,MAAM,EAAEA,MAAM,CAACL,UAAU,EAAE,CAAC,CAEvE,CAAC,CAET,CAAC,EACDvF,MAAM,gBACHb,6BAAC0G,OAAO;IAACC,aAAa,EAAE/F,KAAK,CAAC4B,WAAW,EAAE,CAACC,IAAI,CAAC5B,MAAM;IAAEA,MAAM,EAAEA,MAAM;IAAED,KAAK,EAAEA;IAAS,GACzF,IAAI,CACN,GACN,IAAI,CACT,gBAEHZ;IAAKyD,SAAS,EAAC;KAA0ClD,UAAU,gBAAGP,6BAACO,UAAU,OAAG,GAAG,IAAI,CAC9F,CACC,CACP;AAEX,CAAC,CAAC;MAMWJ,MAAM,gBAAGJ,eAAe,CAAC,SAASI,MAAMA,CAAkBC,KAAyB,EAAEC,GAAyB;EACvH,MAAMuG,mBAAmB,GAAGC,MAAM,CAACzG,KAAK,CAAC0G,QAAQ,CAAC;;;EAGlD,MAAMjB,GAAG,GAAG7F,cAAK,CAAC+G,OAAO,CAAC,MAAMF,MAAM,CAAC,WAAW,GAAGD,mBAAmB,CAAC,EAAE,CAACA,mBAAmB,CAAC,CAAC;EACjG,oBAAO5G,6BAACE,KAAK,oBAAYE,KAAK;IAAEyF,GAAG,EAAEA,GAAG;IAAExF,GAAG,EAAEA;KAAO;AAC1D,CAAC;AACDF,MAAM,CAACN,MAAM,GAAGA,MAAM;;;;"}
|
1
|
+
{"version":3,"file":"Table3.js","sources":["../../../../../../../src/components/Table3/Table3.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { flexRender, TableMeta } from '@tanstack/react-table';\nimport { FocusScope } from '@react-aria/focus';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { useCssGrid } from './hooks/useCssGrid';\nimport { useTable } from './hooks/useTable';\nimport { useTableRenderStrategy } from './strategies';\nimport { Table3ColumnProps, Table3Props, Table3Ref } from './types';\nimport { Toolbar } from './components/toolbar/Toolbar';\nimport { useColumnFreezingStyle } from './hooks/features/useColumnFreezing';\nimport { useTableRefInstanceSetup } from './hooks/useTableRefInstanceSetup';\nimport { Summary } from './components/columns/footer/Summary';\nimport { useCssVars } from './hooks/useCssVars';\nimport './style.css';\n\nfunction Column<TType = unknown>(_: Table3ColumnProps<TType>) {\n return null;\n}\n\ntype FixedForwardRef = <T, P = {}>(\n render: (props: P, ref: React.Ref<T>) => JSX.Element\n) => (props: P & React.RefAttributes<T>) => JSX.Element;\n\n// Cast the old forwardRef to the new one\nexport const fixedForwardRef = React.forwardRef as FixedForwardRef;\n\nconst Table = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const { emptyState: EmptyState, customSettings, toolbarLeft, toolbarRight } = props;\n const internalRef = useMergedRef<Table3Ref>(ref);\n\n const { table, length } = useTable<TType>(props);\n useTableRefInstanceSetup(table, internalRef);\n\n React.useEffect(() => {\n if (props.autoFocus) {\n internalRef.current?.focus();\n }\n }, []);\n\n const { renderBody, scrollToIndex } = useTableRenderStrategy<TType>(props, table, internalRef);\n const tableMeta = table.options.meta as TableMeta<TType>;\n const state = table.getState();\n\n const bodyRef = React.useRef<HTMLDivElement | null>(null);\n\n React.useEffect(\n () => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n const dialog = target.closest('[role=\"dialog\"]');\n const eventOriginatedFromCombobox = !!target.closest('[role=\"combobox\"]');\n\n // Don't trigger global shortcuts on the table if event originated from a combobox or if table is\n // outside the dialog\n if (eventOriginatedFromCombobox || (dialog && !dialog?.contains(internalRef.current))) {\n return;\n }\n\n tableMeta.hoverState.handleKeyDown(event);\n tableMeta.currentRow.handleKeyDown(\n event,\n table.getRowModel().rows.length,\n scrollToIndex,\n tableMeta.editing.isEditing,\n internalRef\n );\n tableMeta.rowClick.handleKeyDown(event, table);\n tableMeta.rowSelection.handleKeyDown(event, table);\n tableMeta.editing.handleKeyDown(event);\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n },\n // See https://github.com/e-conomic/taco/blob/dev/packages/taco/src/components/Table3/strategies/virtualised.tsx#L143\n // scrollToIndex function changes when row count changes, so it is important to update handlers with new\n // scrollToIndex function.\n [scrollToIndex, tableMeta.editing.isEditing, internalRef.current]\n );\n\n const handleBlur = (event: React.FocusEvent) => {\n tableMeta.editing.handleBlur(event);\n };\n\n const handleFocus = (event: React.FocusEvent) => {\n tableMeta.currentRow.handleFocus(event, table.getRowModel().rows.length, scrollToIndex);\n };\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n tableMeta.columnFreezing.handleScroll(event);\n };\n\n const className = cn(\n 'border-grey-300 relative grid h-full w-full flex-grow overflow-auto rounded border bg-white scroll-mt-[41px] focus-visible:outline-none',\n '[&[data-resizing=\"true\"]]:select-none',\n {\n 'text-xs': tableMeta.fontSize.size === 'small',\n 'text-sm': tableMeta.fontSize.size === 'medium',\n 'text-base': tableMeta.fontSize.size === 'large',\n }\n );\n\n // Print tables have \"_print\" as the postfix for the table id, so we can use the it to determine\n // if the table is a print table or not.\n const { style: cssGridStyle } = useCssGrid<TType>(table, tableMeta.isPrinting);\n const { style: cssVars } = useCssVars(tableMeta.rowHeight.height, tableMeta.fontSize.size);\n\n const style = {\n ...cssVars,\n ...cssGridStyle,\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n opacity: 0.999,\n };\n\n const columnFreezingStyle = useColumnFreezingStyle(props.id, table);\n const isServerLoadingAndNotReady = tableMeta.isUsingServer && props.length === undefined;\n\n return (\n <>\n {columnFreezingStyle ? <style data-taco=\"table3-column-freezing-styles\">{columnFreezingStyle}</style> : null}\n <Toolbar\n table={table}\n tableProps={props}\n total={length}\n left={toolbarLeft}\n right={toolbarRight}\n customSettings={customSettings}\n scrollToIndex={scrollToIndex}\n />\n <div\n className={className}\n id={props.id}\n data-font-size={tableMeta.fontSize.size}\n data-editing={tableMeta.editing.isEditing}\n data-horizontally-scrolled={tableMeta.columnFreezing.horizontallyScrolled}\n data-pause-hover={tableMeta?.hoverState.isPaused}\n data-resizing={!!state.columnSizingInfo.isResizingColumn}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onFocus={handleFocus}\n onScroll={handleScroll}\n ref={internalRef}\n role=\"table\"\n style={style}\n tabIndex={-1}>\n {isServerLoadingAndNotReady ? null : (\n <div className=\"group/header contents\" data-taco=\"table2-header\" role=\"rowgroup\">\n {table.getHeaderGroups().map(headerGroup => (\n <div className=\"contents\" key={headerGroup.id} role=\"row\">\n {headerGroup.headers.map(header => (\n <React.Fragment key={header.id}>\n {flexRender(header.column.columnDef.header, { ...header.getContext(), scrollToIndex })}\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n )}\n {table.getRowModel().rows.length ? (\n <>\n <FocusScope autoFocus={tableMeta.editing.isEditing}>\n <div className=\"group/body contents\" data-taco=\"table2-body\" role=\"rowgroup\" ref={bodyRef}>\n {renderBody()}\n </div>\n </FocusScope>\n {/* This div makes sure that there is always a free space between the rows and footer when\n table height exceeds the cumulative height of all rows. See useCSSGrid.ts */}\n {/* By vertically translating the div a pixel down, we hide the div border below footer so that\n the footer border doesn't appear an extra pixel thick */}\n <div className=\"border-grey-300 col-span-full translate-y-px border-t\" />\n {tableMeta.enableFooter ? (\n <div className=\"group/footer contents\" data-taco=\"table2-footer\" role=\"rowgroup\">\n {table.getFooterGroups().map(footerGroup => (\n <div className=\"contents\" key={footerGroup.id} role=\"row\">\n {footerGroup.headers.map(footer => (\n <React.Fragment key={footer.id}>\n {flexRender(footer.column.columnDef.footer, footer.getContext())}\n </React.Fragment>\n ))}\n </div>\n ))}\n {length ? (\n <Summary currentLength={table.getRowModel().rows.length} length={length} table={table} />\n ) : null}\n </div>\n ) : null}\n </>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n </div>\n </>\n );\n});\n\ntype Table3WithStatics = (<TType = unknown>(props: Table3Props<TType> & React.RefAttributes<Table3Ref>) => JSX.Element) & {\n Column: typeof Column;\n};\n\nexport const Table3 = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const stringifiedChildren = String(props.children);\n // we force a remount (using key) when the child columns change because there are too many places to add children as an effect\n // this is cheaper from a complexity perspective, and probably performance wise as well\n const key = React.useMemo(() => String('tableKey_' + stringifiedChildren), [stringifiedChildren]);\n return <Table<TType> {...props} key={key} ref={ref} />;\n}) as Table3WithStatics;\nTable3.Column = Column;\n\n// hooks\nexport { useTable3DataLoader } from './hooks/useTableDataLoader';\n\n// types\nexport type {\n useTable3DataFetcher,\n useTable3DataOptions,\n useTable3DataFetcherValues as useTableDataValues,\n} from './hooks/useTableDataLoader';\n\nexport type {\n Table3Ref,\n Table3Props,\n Table3Preset,\n Table3Settings,\n Table3SettingsHandler,\n Table3RowHeight,\n Table3FilterComparator,\n Table3FilterHandler,\n Table3LoadPageHandler,\n Table3LoadAllHandler,\n Table3RowGotoHandler,\n Table3SortHandler,\n Table3Shortcuts,\n Table3ShortcutHandlerFn,\n Table3ShortcutHandlerObject,\n Table3FontSize,\n Table3SortDirection,\n Table3SortFn,\n Table3RowActionRenderer,\n Table3RowSelectionHandler,\n Table3RowExpansionRenderer,\n Table3RowDropHandler,\n Table3RowDragHandler,\n Table3RowClickHandler,\n Table3ColumnProps,\n Table3ColumnAlignment,\n Table3ColumnDataType,\n Table3ColumnHeaderMenu,\n Table3ColumnClassNameHandler,\n Table3ColumnFooterRenderer,\n Table3ColumnRenderer,\n Table3ColumnControlRenderer,\n Table3ColumnControlProps,\n} from './types';\n"],"names":["Column","_","fixedForwardRef","React","forwardRef","Table","Table3","props","ref","emptyState","EmptyState","customSettings","toolbarLeft","toolbarRight","internalRef","useMergedRef","table","length","useTable","useTableRefInstanceSetup","useEffect","autoFocus","_internalRef$current","current","focus","renderBody","scrollToIndex","useTableRenderStrategy","tableMeta","options","meta","state","getState","bodyRef","useRef","handleKeyDown","event","target","dialog","closest","eventOriginatedFromCombobox","contains","hoverState","currentRow","getRowModel","rows","editing","isEditing","rowClick","rowSelection","document","addEventListener","removeEventListener","handleBlur","handleFocus","handleScroll","columnFreezing","Promise","resolve","e","reject","className","cn","fontSize","size","style","cssGridStyle","useCssGrid","isPrinting","cssVars","useCssVars","rowHeight","height","opacity","columnFreezingStyle","useColumnFreezingStyle","id","isServerLoadingAndNotReady","isUsingServer","undefined","Toolbar","tableProps","total","left","right","horizontallyScrolled","isPaused","columnSizingInfo","isResizingColumn","onBlur","onFocus","onScroll","role","tabIndex","getHeaderGroups","map","headerGroup","key","headers","header","Fragment","flexRender","column","columnDef","getContext","FocusScope","enableFooter","getFooterGroups","footerGroup","footer","Summary","currentLength","stringifiedChildren","String","children","useMemo"],"mappings":";;;;;;;;;;;;;;;AAgBA,SAASA,MAAMA,CAAkBC,CAA2B;EACxD,OAAO,IAAI;AACf;AAMA;MACaC,eAAe,GAAGC,cAAK,CAACC;AAErC,MAAMC,KAAK,gBAAGH,eAAe,CAAC,SAASI,MAAMA,CAAkBC,KAAyB,EAAEC,GAAyB;EAC/G,MAAM;IAAEC,UAAU,EAAEC,UAAU;IAAEC,cAAc;IAAEC,WAAW;IAAEC;GAAc,GAAGN,KAAK;EACnF,MAAMO,WAAW,GAAGC,YAAY,CAAYP,GAAG,CAAC;EAEhD,MAAM;IAAEQ,KAAK;IAAEC;GAAQ,GAAGC,QAAQ,CAAQX,KAAK,CAAC;EAChDY,w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ACjC;KACvByB,UAAU,CAACQ,MAAM,CAACP,MAAM,CAACC,SAAS,CAACM,MAAM,EAAEA,MAAM,CAACL,UAAU,EAAE,CAAC,CAEvE,CAAC,CAET,CAAC,EACDvF,MAAM,gBACHd,6BAAC2G,OAAO;IAACC,aAAa,EAAE/F,KAAK,CAAC4B,WAAW,EAAE,CAACC,IAAI,CAAC5B,MAAM;IAAEA,MAAM,EAAEA,MAAM;IAAED,KAAK,EAAEA;IAAS,GACzF,IAAI,CACN,GACN,IAAI,CACT,gBAEHb;IAAK0D,SAAS,EAAC;KAA0CnD,UAAU,gBAAGP,6BAACO,UAAU,OAAG,GAAG,IAAI,CAC9F,CACC,CACP;AAEX,CAAC,CAAC;MAMWJ,MAAM,gBAAGJ,eAAe,CAAC,SAASI,MAAMA,CAAkBC,KAAyB,EAAEC,GAAyB;EACvH,MAAMwG,mBAAmB,GAAGC,MAAM,CAAC1G,KAAK,CAAC2G,QAAQ,CAAC;;;EAGlD,MAAMjB,GAAG,GAAG9F,cAAK,CAACgH,OAAO,CAAC,MAAMF,MAAM,CAAC,WAAW,GAAGD,mBAAmB,CAAC,EAAE,CAACA,mBAAmB,CAAC,CAAC;EACjG,oBAAO7G,6BAACE,KAAK,oBAAYE,KAAK;IAAE0F,GAAG,EAAEA,GAAG;IAAEzF,GAAG,EAAEA;KAAO;AAC1D,CAAC;AACDF,MAAM,CAACN,MAAM,GAAGA,MAAM;;;;"}
|
@@ -8,6 +8,7 @@ import { FontSize } from './FontSize.js';
|
|
8
8
|
|
9
9
|
function SettingsButton(props) {
|
10
10
|
const {
|
11
|
+
customSettings,
|
11
12
|
table
|
12
13
|
} = props;
|
13
14
|
const {
|
@@ -50,7 +51,10 @@ function SettingsButton(props) {
|
|
50
51
|
subMenu: () => /*#__PURE__*/React__default.createElement(FontSize, {
|
51
52
|
table: table
|
52
53
|
})
|
53
|
-
}, texts.table3.fontSize.tooltip) : null)
|
54
|
+
}, texts.table3.fontSize.tooltip) : null, customSettings ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Menu.Separator, null), customSettings.map(customSetting => {
|
55
|
+
const props = tableMeta.getSettings();
|
56
|
+
return customSetting(props);
|
57
|
+
})) : null)),
|
54
58
|
popover: popoverElement,
|
55
59
|
onClickCapture: event => event.preventDefault(),
|
56
60
|
tooltip: texts.table3.otherOptions.tooltip
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Settings.js","sources":["../../../../../../../../../src/components/Table3/components/toolbar/Settings.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\nimport { RowHeight } from './RowHeight';\nimport { ColumnSettingsPopover } from './ColumnSettings';\nimport { IconButton } from '../../../IconButton/IconButton';\nimport { Menu } from '../../../Menu/Menu';\nimport { useLocalization } from '../../../Provider/Localization';\nimport { IconName } from '../../../Icon/Icon';\nimport { FontSize } from './FontSize';\n\nexport type SettingsButtonProps<TType = unknown> = {\n table: RTable<TType>;\n};\nexport function SettingsButton<TType = unknown>(props: SettingsButtonProps<TType>) {\n const { table } = props;\n const { texts } = useLocalization();\n const [popover, setPopover] = React.useState<string | undefined>(undefined);\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n const hasColumnSettings = table.options.enableHiding || tableMeta.columnOrdering.isEnabled;\n\n let popoverElement;\n\n if (popover) {\n const handleClosePopover = () => setPopover(undefined);\n\n switch (popover) {\n case 'columnSettings': {\n if (hasColumnSettings) {\n popoverElement = props => (\n <ColumnSettingsPopover {...props} open onChange={handleClosePopover} table={table} />\n );\n }\n }\n }\n }\n\n return (\n <IconButton\n aria-label={texts.table3.otherOptions.tooltip}\n icon=\"sliders\"\n menu={\n popoverElement\n ? undefined\n : menuProps => (\n <Menu {...menuProps}>\n <Menu.Content align=\"end\">\n {table.options.enableHiding || tableMeta.columnOrdering.isEnabled ? (\n <>\n <Menu.Item icon=\"columns\" onClick={() => setPopover('columnSettings')}>\n {texts.table3.columnSettings.button}\n </Menu.Item>\n <Menu.Separator />\n </>\n ) : null}\n {tableMeta.rowHeight.isEnabled ? (\n <Menu.Item\n icon={`height-${tableMeta.rowHeight.height}` as IconName}\n subMenu={() => <RowHeight table={table} />}>\n {texts.table3.rowHeight.tooltip}\n </Menu.Item>\n ) : null}\n {tableMeta.fontSize.isEnabled ? (\n <Menu.Item icon=\"font-size\" subMenu={() => <FontSize table={table} />}>\n {texts.table3.fontSize.tooltip}\n </Menu.Item>\n ) : null}\n </Menu.Content>\n </Menu>\n )\n }\n popover={popoverElement}\n onClickCapture={event => event.preventDefault()}\n tooltip={texts.table3.otherOptions.tooltip}\n />\n );\n}\n"],"names":["SettingsButton","props","table","texts","useLocalization","popover","setPopover","React","useState","undefined","tableMeta","options","meta","hasColumnSettings","enableHiding","columnOrdering","isEnabled","popoverElement","handleClosePopover","ColumnSettingsPopover","open","onChange","IconButton","table3","otherOptions","tooltip","icon","menu","menuProps","Menu","Content","align","Item","onClick","columnSettings","button","Separator","rowHeight","height","subMenu","RowHeight","fontSize","FontSize","onClickCapture","event","preventDefault"],"mappings":";;;;;;;;
|
1
|
+
{"version":3,"file":"Settings.js","sources":["../../../../../../../../../src/components/Table3/components/toolbar/Settings.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\nimport { RowHeight } from './RowHeight';\nimport { ColumnSettingsPopover } from './ColumnSettings';\nimport { IconButton } from '../../../IconButton/IconButton';\nimport { Menu } from '../../../Menu/Menu';\nimport { useLocalization } from '../../../Provider/Localization';\nimport { IconName } from '../../../Icon/Icon';\nimport { FontSize } from './FontSize';\nimport { Table3CustomSettingRenderer } from '../../types';\n\nexport type SettingsButtonProps<TType = unknown> = {\n customSettings?: Table3CustomSettingRenderer[];\n table: RTable<TType>;\n};\nexport function SettingsButton<TType = unknown>(props: SettingsButtonProps<TType>) {\n const { customSettings, table } = props;\n const { texts } = useLocalization();\n const [popover, setPopover] = React.useState<string | undefined>(undefined);\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n const hasColumnSettings = table.options.enableHiding || tableMeta.columnOrdering.isEnabled;\n\n let popoverElement;\n\n if (popover) {\n const handleClosePopover = () => setPopover(undefined);\n\n switch (popover) {\n case 'columnSettings': {\n if (hasColumnSettings) {\n popoverElement = props => (\n <ColumnSettingsPopover {...props} open onChange={handleClosePopover} table={table} />\n );\n }\n }\n }\n }\n\n return (\n <IconButton\n aria-label={texts.table3.otherOptions.tooltip}\n icon=\"sliders\"\n menu={\n popoverElement\n ? undefined\n : menuProps => (\n <Menu {...menuProps}>\n <Menu.Content align=\"end\">\n {table.options.enableHiding || tableMeta.columnOrdering.isEnabled ? (\n <>\n <Menu.Item icon=\"columns\" onClick={() => setPopover('columnSettings')}>\n {texts.table3.columnSettings.button}\n </Menu.Item>\n <Menu.Separator />\n </>\n ) : null}\n {tableMeta.rowHeight.isEnabled ? (\n <Menu.Item\n icon={`height-${tableMeta.rowHeight.height}` as IconName}\n subMenu={() => <RowHeight table={table} />}>\n {texts.table3.rowHeight.tooltip}\n </Menu.Item>\n ) : null}\n {tableMeta.fontSize.isEnabled ? (\n <Menu.Item icon=\"font-size\" subMenu={() => <FontSize table={table} />}>\n {texts.table3.fontSize.tooltip}\n </Menu.Item>\n ) : null}\n {customSettings ? (\n <>\n <Menu.Separator />\n {customSettings.map(customSetting => {\n const props = tableMeta.getSettings();\n return customSetting(props);\n })}\n </>\n ) : null}\n </Menu.Content>\n </Menu>\n )\n }\n popover={popoverElement}\n onClickCapture={event => event.preventDefault()}\n tooltip={texts.table3.otherOptions.tooltip}\n />\n );\n}\n"],"names":["SettingsButton","props","customSettings","table","texts","useLocalization","popover","setPopover","React","useState","undefined","tableMeta","options","meta","hasColumnSettings","enableHiding","columnOrdering","isEnabled","popoverElement","handleClosePopover","ColumnSettingsPopover","open","onChange","IconButton","table3","otherOptions","tooltip","icon","menu","menuProps","Menu","Content","align","Item","onClick","columnSettings","button","Separator","rowHeight","height","subMenu","RowHeight","fontSize","FontSize","map","customSetting","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AC3B,eACZ5B,6BAACsB,IAAI,CAACO,SAAS,OAAG,CACnB,GACH,IAAI,EACP1B,SAAS,CAAC2B,SAAS,CAACrB,SAAS,gBAC1BT,6BAACsB,IAAI,CAACG,IAAI;MACNN,IAAI,YAAYhB,SAAS,CAAC2B,SAAS,CAACC,QAAoB;MACxDC,OAAO,EAAEA,mBAAMhC,6BAACiC,SAAS;QAACtC,KAAK,EAAEA;;OAChCC,KAAK,CAACoB,MAAM,CAACc,SAAS,CAACZ,OAAO,CACvB,GACZ,IAAI,EACPf,SAAS,CAAC+B,QAAQ,CAACzB,SAAS,gBACzBT,6BAACsB,IAAI,CAACG,IAAI;MAACN,IAAI,EAAC,WAAW;MAACa,OAAO,EAAEA,mBAAMhC,6BAACmC,QAAQ;QAACxC,KAAK,EAAEA;;OACvDC,KAAK,CAACoB,MAAM,CAACkB,QAAQ,CAAChB,OAAO,CACtB,GACZ,IAAI,EACPxB,cAAc,gBACXM,yEACIA,6BAACsB,IAAI,CAACO,SAAS,OAAG,EACjBnC,cAAc,CAAC0C,GAAG,CAACC,aAAa;MAC7B,MAAM5C,KAAK,GAAGU,SAAS,CAACmC,WAAW,EAAE;MACrC,OAAOD,aAAa,CAAC5C,KAAK,CAAC;KAC9B,CAAC,CACH,GACH,IAAI,CACG,CAEtB;IAEXK,OAAO,EAAEY,cAAc;IACvB6B,cAAc,EAAEC,KAAK,IAAIA,KAAK,CAACC,cAAc,EAAE;IAC/CvB,OAAO,EAAEtB,KAAK,CAACoB,MAAM,CAACC,YAAY,CAACC;IACrC;AAEV;;;;"}
|
@@ -8,6 +8,7 @@ import { SettingsButton } from './Settings.js';
|
|
8
8
|
|
9
9
|
function Toolbar(props) {
|
10
10
|
const {
|
11
|
+
customSettings,
|
11
12
|
left,
|
12
13
|
right,
|
13
14
|
scrollToIndex,
|
@@ -33,7 +34,8 @@ function Toolbar(props) {
|
|
33
34
|
table: table,
|
34
35
|
tableProps: tableProps
|
35
36
|
}) : null, isSettingsVisible(props) ? /*#__PURE__*/React__default.createElement(SettingsButton, {
|
36
|
-
table: table
|
37
|
+
table: table,
|
38
|
+
customSettings: customSettings
|
37
39
|
}) : null, tableMeta.search.isEnabled ? /*#__PURE__*/React__default.createElement(Search, {
|
38
40
|
scrollToIndex: scrollToIndex,
|
39
41
|
table: table
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sources":["../../../../../../../../../src/components/Table3/components/toolbar/Toolbar.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\nimport { Search } from './Search';\nimport { Group } from '../../../Group/Group';\nimport { FiltersButton } from './Filter/filters/Filters';\nimport { EditButton } from './EditButton';\nimport { PrintButton } from './PrintButton/PrintButton';\nimport { Table3Props } from '../../types';\nimport { SettingsButton } from './Settings';\n\nexport type ToolbarProps<TType = unknown> = {\n left?: JSX.Element;\n right?: JSX.Element;\n scrollToIndex: any;\n table: RTable<TType>;\n tableProps: Table3Props<TType>;\n total: number;\n};\nexport function Toolbar<TType = unknown>(props: ToolbarProps<TType>) {\n const { left, right, scrollToIndex, table, tableProps, total } = props;\n\n if (!isToolbarVisible(props)) {\n return null;\n }\n\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n return (\n <div className=\"mb-4 flex flex-shrink flex-grow-0 flex-wrap gap-2\" data-taco=\"table3-toolbar\">\n {left}\n <Group className=\"ml-auto flex-shrink-0 print:hidden\">\n {tableMeta.editing.isEnabled ? <EditButton table={table} /> : null}\n {table.options.enableColumnFilters ? <FiltersButton table={table} total={total} /> : null}\n {right}\n {tableMeta.printing.isEnabled ? <PrintButton table={table} tableProps={tableProps} /> : null}\n {isSettingsVisible(props) ? <SettingsButton table={table} /> : null}\n {tableMeta.search.isEnabled ? <Search scrollToIndex={scrollToIndex} table={table} /> : null}\n </Group>\n </div>\n );\n}\n\nfunction isSettingsVisible<TType = unknown>(props: ToolbarProps<TType>) {\n const { table } = props;\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n return tableMeta.fontSize.isEnabled || tableMeta.rowHeight.isEnabled;\n}\n\nfunction isToolbarVisible<TType = unknown>(props: ToolbarProps<TType>) {\n const { left, right, table } = props;\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n const enableSettingsButton = table.options.enableHiding || tableMeta.columnOrdering.isEnabled;\n const hasInternalToolbar =\n enableSettingsButton ||\n tableMeta.editing.isEnabled ||\n tableMeta.printing.isEnabled ||\n table.options.enableColumnFilters ||\n tableMeta.fontSize.isEnabled ||\n tableMeta.rowHeight.isEnabled ||\n tableMeta.search.isEnabled;\n\n return hasInternalToolbar || !!left || !!right;\n}\n"],"names":["Toolbar","props","left","right","scrollToIndex","table","tableProps","total","isToolbarVisible","tableMeta","options","meta","React","className","Group","editing","isEnabled","EditButton","enableColumnFilters","FiltersButton","printing","PrintButton","isSettingsVisible","SettingsButton","search","Search","fontSize","rowHeight","enableSettingsButton","enableHiding","columnOrdering","hasInternalToolbar"],"mappings":";;;;;;;;
|
1
|
+
{"version":3,"file":"Toolbar.js","sources":["../../../../../../../../../src/components/Table3/components/toolbar/Toolbar.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\nimport { Search } from './Search';\nimport { Group } from '../../../Group/Group';\nimport { FiltersButton } from './Filter/filters/Filters';\nimport { EditButton } from './EditButton';\nimport { PrintButton } from './PrintButton/PrintButton';\nimport { Table3CustomSettingRenderer, Table3Props } from '../../types';\nimport { SettingsButton } from './Settings';\n\nexport type ToolbarProps<TType = unknown> = {\n customSettings?: Table3CustomSettingRenderer[];\n left?: JSX.Element;\n right?: JSX.Element;\n scrollToIndex: any;\n table: RTable<TType>;\n tableProps: Table3Props<TType>;\n total: number;\n};\nexport function Toolbar<TType = unknown>(props: ToolbarProps<TType>) {\n const { customSettings, left, right, scrollToIndex, table, tableProps, total } = props;\n\n if (!isToolbarVisible(props)) {\n return null;\n }\n\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n return (\n <div className=\"mb-4 flex flex-shrink flex-grow-0 flex-wrap gap-2\" data-taco=\"table3-toolbar\">\n {left}\n <Group className=\"ml-auto flex-shrink-0 print:hidden\">\n {tableMeta.editing.isEnabled ? <EditButton table={table} /> : null}\n {table.options.enableColumnFilters ? <FiltersButton table={table} total={total} /> : null}\n {right}\n {tableMeta.printing.isEnabled ? <PrintButton table={table} tableProps={tableProps} /> : null}\n {isSettingsVisible(props) ? <SettingsButton table={table} customSettings={customSettings} /> : null}\n {tableMeta.search.isEnabled ? <Search scrollToIndex={scrollToIndex} table={table} /> : null}\n </Group>\n </div>\n );\n}\n\nfunction isSettingsVisible<TType = unknown>(props: ToolbarProps<TType>) {\n const { table } = props;\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n return tableMeta.fontSize.isEnabled || tableMeta.rowHeight.isEnabled;\n}\n\nfunction isToolbarVisible<TType = unknown>(props: ToolbarProps<TType>) {\n const { left, right, table } = props;\n const tableMeta = table.options.meta as TableMeta<TType>;\n\n const enableSettingsButton = table.options.enableHiding || tableMeta.columnOrdering.isEnabled;\n const hasInternalToolbar =\n enableSettingsButton ||\n tableMeta.editing.isEnabled ||\n tableMeta.printing.isEnabled ||\n table.options.enableColumnFilters ||\n tableMeta.fontSize.isEnabled ||\n tableMeta.rowHeight.isEnabled ||\n tableMeta.search.isEnabled;\n\n return hasInternalToolbar || !!left || !!right;\n}\n"],"names":["Toolbar","props","customSettings","left","right","scrollToIndex","table","tableProps","total","isToolbarVisible","tableMeta","options","meta","React","className","Group","editing","isEnabled","EditButton","enableColumnFilters","FiltersButton","printing","PrintButton","isSettingsVisible","SettingsButton","search","Search","fontSize","rowHeight","enableSettingsButton","enableHiding","columnOrdering","hasInternalToolbar"],"mappings":";;;;;;;;SAmBgBA,OAAOA,CAAkBC,KAA0B;EAC/D,MAAM;IAAEC,cAAc;IAAEC,IAAI;IAAEC,KAAK;IAAEC,aAAa;IAAEC,KAAK;IAAEC,UAAU;IAAEC;GAAO,GAAGP,KAAK;EAEtF,IAAI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ACC,IAAwB;EAExD,MAAMiB,oBAAoB,GAAGvB,KAAK,CAACK,OAAO,CAACmB,YAAY,IAAIpB,SAAS,CAACqB,cAAc,CAACd,SAAS;EAC7F,MAAMe,kBAAkB,GACpBH,oBAAoB,IACpBnB,SAAS,CAACM,OAAO,CAACC,SAAS,IAC3BP,SAAS,CAACW,QAAQ,CAACJ,SAAS,IAC5BX,KAAK,CAACK,OAAO,CAACQ,mBAAmB,IACjCT,SAAS,CAACiB,QAAQ,CAACV,SAAS,IAC5BP,SAAS,CAACkB,SAAS,CAACX,SAAS,IAC7BP,SAAS,CAACe,MAAM,CAACR,SAAS;EAE9B,OAAOe,kBAAkB,IAAI,CAAC,CAAC7B,IAAI,IAAI,CAAC,CAACC,KAAK;AAClD;;;;"}
|
package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js
CHANGED
@@ -7,18 +7,7 @@ function useSettingsStateListener(table, onChangeSettings) {
|
|
7
7
|
let handler;
|
8
8
|
if (typeof onChangeSettings === 'function') {
|
9
9
|
handler = setTimeout(() => {
|
10
|
-
onChangeSettings(
|
11
|
-
// adding a new setting? you need to add it to the print settings in PrintButton.tsx!
|
12
|
-
columnFreezingIndex: meta.columnFreezing.frozenColumnIndex,
|
13
|
-
columnOrder: meta.columnOrdering.isEnabled ? state.columnOrder : undefined,
|
14
|
-
columnSizing: table.options.enableColumnResizing ? state.columnSizing : undefined,
|
15
|
-
columnVisibility: table.options.enableHiding ? state.columnVisibility : undefined,
|
16
|
-
excludeUnmatchedRecordsInSearch: meta.search.excludeUnmatchedResults,
|
17
|
-
fontSize: meta.fontSize.isEnabled ? meta.fontSize.size : undefined,
|
18
|
-
rowHeight: meta.rowHeight.isEnabled ? meta.rowHeight.height : undefined,
|
19
|
-
showWarningWhenPrintingLargeDataset: meta.printing.printWarningDialogVisibility,
|
20
|
-
sorting: state.sorting
|
21
|
-
});
|
10
|
+
onChangeSettings(meta.getSettings());
|
22
11
|
}, 250);
|
23
12
|
}
|
24
13
|
return () => clearTimeout(handler);
|
package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSettingsStateListener.js","sources":["../../../../../../../../../src/components/Table3/hooks/listeners/useSettingsStateListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\nimport { Table3SettingsHandler } from '../../types';\n\nexport function useSettingsStateListener<TType = unknown>(\n table: RTable<TType>,\n onChangeSettings: Table3SettingsHandler | undefined\n) {\n const meta = table.options.meta as TableMeta<TType>;\n const state = table.getState();\n\n React.useEffect(() => {\n let handler;\n\n if (typeof onChangeSettings === 'function') {\n handler = setTimeout(() => {\n onChangeSettings(
|
1
|
+
{"version":3,"file":"useSettingsStateListener.js","sources":["../../../../../../../../../src/components/Table3/hooks/listeners/useSettingsStateListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as RTable, TableMeta } from '@tanstack/react-table';\nimport { Table3SettingsHandler } from '../../types';\n\nexport function useSettingsStateListener<TType = unknown>(\n table: RTable<TType>,\n onChangeSettings: Table3SettingsHandler | undefined\n) {\n const meta = table.options.meta as TableMeta<TType>;\n const state = table.getState();\n\n React.useEffect(() => {\n let handler;\n\n if (typeof onChangeSettings === 'function') {\n handler = setTimeout(() => {\n onChangeSettings(meta.getSettings());\n }, 250);\n }\n\n return () => clearTimeout(handler);\n }, [\n meta.columnFreezing.frozenColumnIndex,\n state.columnOrder,\n state.columnSizing,\n state.columnVisibility,\n meta.search.excludeUnmatchedResults,\n meta.fontSize.size,\n meta.rowHeight.height,\n meta.printing.printWarningDialogVisibility,\n state.sorting,\n ]);\n}\n"],"names":["useSettingsStateListener","table","onChangeSettings","meta","options","state","getState","React","useEffect","handler","setTimeout","getSettings","clearTimeout","columnFreezing","frozenColumnIndex","columnOrder","columnSizing","columnVisibility","search","excludeUnmatchedResults","fontSize","size","rowHeight","height","printing","printWarningDialogVisibility","sorting"],"mappings":";;SAIgBA,wBAAwBA,CACpCC,KAAoB,EACpBC,gBAAmD;EAEnD,MAAMC,IAAI,GAAGF,KAAK,CAACG,OAAO,CAACD,IAAwB;EACnD,MAAME,KAAK,GAAGJ,KAAK,CAACK,QAAQ,EAAE;EAE9BC,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIC,OAAO;IAEX,IAAI,OAAOP,gBAAgB,KAAK,UAAU,EAAE;MACxCO,OAAO,GAAGC,UAAU,CAAC;QACjBR,gBAAgB,CAACC,IAAI,CAACQ,WAAW,EAAE,CAAC;OACvC,EAAE,GAAG,CAAC;;IAGX,OAAO,MAAMC,YAAY,CAACH,OAAO,CAAC;GACrC,EAAE,CACCN,IAAI,CAACU,cAAc,CAACC,iBAAiB,EACrCT,KAAK,CAACU,WAAW,EACjBV,KAAK,CAACW,YAAY,EAClBX,KAAK,CAACY,gBAAgB,EACtBd,IAAI,CAACe,MAAM,CAACC,uBAAuB,EACnChB,IAAI,CAACiB,QAAQ,CAACC,IAAI,EAClBlB,IAAI,CAACmB,SAAS,CAACC,MAAM,EACrBpB,IAAI,CAACqB,QAAQ,CAACC,4BAA4B,EAC1CpB,KAAK,CAACqB,OAAO,CAChB,CAAC;AACN;;;;"}
|
@@ -140,6 +140,20 @@ function useTable(props) {
|
|
140
140
|
}
|
141
141
|
return state;
|
142
142
|
}, []);
|
143
|
+
const getSettings = () => {
|
144
|
+
const state = table.getState();
|
145
|
+
return {
|
146
|
+
columnFreezingIndex: columnFreezing.frozenColumnIndex,
|
147
|
+
columnOrder: columnOrdering.isEnabled ? state.columnOrder : undefined,
|
148
|
+
columnSizing: table.options.enableColumnResizing ? state.columnSizing : undefined,
|
149
|
+
columnVisibility: table.options.enableHiding ? state.columnVisibility : undefined,
|
150
|
+
excludeUnmatchedRecordsInSearch: search.excludeUnmatchedResults,
|
151
|
+
fontSize: fontSize.isEnabled ? fontSize.size : undefined,
|
152
|
+
rowHeight: rowHeight.isEnabled ? rowHeight.height : undefined,
|
153
|
+
showWarningWhenPrintingLargeDataset: printing.printWarningDialogVisibility,
|
154
|
+
sorting: state.sorting
|
155
|
+
};
|
156
|
+
};
|
143
157
|
const table = useReactTable({
|
144
158
|
data: props.data,
|
145
159
|
columns,
|
@@ -154,6 +168,7 @@ function useTable(props) {
|
|
154
168
|
editing,
|
155
169
|
enableFooter: options.enableFooter,
|
156
170
|
fontSize,
|
171
|
+
getSettings,
|
157
172
|
hoverState,
|
158
173
|
isPrinting: props.id.endsWith('_print'),
|
159
174
|
isUsingServer: !!props.loadPage,
|