@economic/taco 1.38.2 → 1.39.0

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 (35) hide show
  1. package/dist/components/Provider/Localization.d.ts +9 -1
  2. package/dist/components/Table2/Table2.d.ts +10 -1
  3. package/dist/components/Table2/components/filters/components/ColumnFilter.d.ts +1 -0
  4. package/dist/components/Table2/components/filters/components/EmptyFilter.d.ts +13 -0
  5. package/dist/components/Table2/hooks/useTableShortcuts.d.ts +2 -0
  6. package/dist/components/Table2/types.d.ts +8 -0
  7. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +3 -3
  8. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
  9. package/dist/esm/packages/taco/src/components/Provider/Localization.js +9 -1
  10. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  11. package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js +1 -1
  12. package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js.map +1 -1
  13. package/dist/esm/packages/taco/src/components/Table2/Table2.js +2 -1
  14. package/dist/esm/packages/taco/src/components/Table2/Table2.js.map +1 -1
  15. package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js +79 -24
  16. package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js.map +1 -1
  17. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js +14 -6
  18. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js.map +1 -1
  19. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/EmptyFilter.js +63 -0
  20. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/EmptyFilter.js.map +1 -0
  21. package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js +2 -1
  22. package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js.map +1 -1
  23. package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js +4 -1
  24. package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js.map +1 -1
  25. package/dist/esm/packages/taco/src/components/Table2/hooks/useTableShortcuts.js +46 -0
  26. package/dist/esm/packages/taco/src/components/Table2/hooks/useTableShortcuts.js.map +1 -0
  27. package/dist/esm/packages/taco/src/components/Table2/types.js.map +1 -1
  28. package/dist/esm/packages/taco/src/utils/keyboard.js +1 -1
  29. package/dist/esm/packages/taco/src/utils/keyboard.js.map +1 -1
  30. package/dist/taco.cjs.development.js +207 -38
  31. package/dist/taco.cjs.development.js.map +1 -1
  32. package/dist/taco.cjs.production.min.js +1 -1
  33. package/dist/taco.cjs.production.min.js.map +1 -1
  34. package/package.json +2 -3
  35. package/types.json +131 -3
@@ -185,7 +185,7 @@ export declare const defaultLocalisationTexts: {
185
185
  filters: {
186
186
  button: string;
187
187
  buttons: {
188
- addFilter: string;
188
+ addNewFilter: string;
189
189
  clearFilters: string;
190
190
  };
191
191
  comparators: {
@@ -202,6 +202,14 @@ export declare const defaultLocalisationTexts: {
202
202
  isEmpty: string;
203
203
  isNotEmpty: string;
204
204
  };
205
+ conditions: {
206
+ and: string;
207
+ where: string;
208
+ };
209
+ emptyFilter: {
210
+ condition: string;
211
+ value: string;
212
+ };
205
213
  tooltip: string;
206
214
  total: string;
207
215
  };
@@ -50,7 +50,7 @@ export declare type Table2Texts = {
50
50
  filters: {
51
51
  button: string;
52
52
  buttons: {
53
- addFilter: string;
53
+ addNewFilter: string;
54
54
  clearFilters: string;
55
55
  };
56
56
  comparators: {
@@ -67,6 +67,14 @@ export declare type Table2Texts = {
67
67
  isEmpty: string;
68
68
  isNotEmpty: string;
69
69
  };
70
+ conditions: {
71
+ and: string;
72
+ where: string;
73
+ };
74
+ emptyFilter: {
75
+ condition: string;
76
+ value: string;
77
+ };
70
78
  tooltip: string;
71
79
  total: string;
72
80
  };
@@ -102,6 +110,7 @@ export declare type Table2Ref = HTMLDivElement & {
102
110
  resetRowExpansion: () => void;
103
111
  resetRowSelection: () => void;
104
112
  resetSorting: () => void;
113
+ toggleEditing: () => void;
105
114
  };
106
115
  };
107
116
  export declare type ForwardedTable2WithStatics = React.ForwardRefExoticComponent<Table2Props<any>> & {
@@ -5,5 +5,6 @@ export declare type ColumnFilterProps = {
5
5
  column: RTColumn<any, any>;
6
6
  index: number;
7
7
  table: RTTable<any>;
8
+ onRemove?: () => void;
8
9
  };
9
10
  export declare const ColumnFilter: (props: ColumnFilterProps) => JSX.Element;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { Column as RTColumn, Table as RTTable } from '@tanstack/react-table';
3
+ import { Select2Value } from '../../../../Select2/Select2';
4
+ export declare type EmptyFilterProps = {
5
+ allColumns: RTColumn<any, any>[];
6
+ table: RTTable<any>;
7
+ onChange?: (value: Select2Value) => void;
8
+ onRemove?: () => void;
9
+ filteredColumns: RTColumn<any, any>[];
10
+ emptyFilterCount: Number;
11
+ index: Number;
12
+ };
13
+ export declare const EmptyFilter: (props: EmptyFilterProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { Table2Shortcuts } from '../types';
2
+ export declare function useTableShortcuts<TType = any>(shortcuts: Table2Shortcuts<TType> | undefined, activeRow: TType): void;
@@ -101,6 +101,13 @@ export declare type DataColumnIndexes = {
101
101
  dataColumnEndOffset: number;
102
102
  };
103
103
  export declare type Table2Children<TType = any> = (React.ReactElement<Table2ColumnProps<TType>> | boolean | null | undefined)[];
104
+ export declare type Table2ShortcutHandlerFn<TType = any> = (row: TType) => void;
105
+ export declare type Table2ShortcutHandlerObject<TType = any> = {
106
+ handler: Table2ShortcutHandlerFn<TType>;
107
+ meta?: boolean;
108
+ shift?: boolean;
109
+ };
110
+ export declare type Table2Shortcuts<TType = any> = Record<string, Table2ShortcutHandlerFn<TType> | Table2ShortcutHandlerObject<TType>>;
104
111
  export declare type Table2Props<TType = any> = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
105
112
  actionsForRow?: Table2RowActionRenderer<TType>[];
106
113
  actionsForRowLength?: number;
@@ -132,6 +139,7 @@ export declare type Table2Props<TType = any> = Omit<React.HTMLAttributes<HTMLDiv
132
139
  onRowDrop?: RowDropHandler<TType>;
133
140
  onRowSelect?: RowSelectionHandler<TType>;
134
141
  onSave?: SaveHandler<TType>;
142
+ shortcuts?: Table2Shortcuts<TType>;
135
143
  toolbarLeft?: JSX.Element;
136
144
  toolbarRight?: JSX.Element;
137
145
  settings?: Table2Settings;
@@ -243,15 +243,15 @@ const DrawerContent = /*#__PURE__*/React__default.forwardRef(function Content(pr
243
243
  ref: contentRef,
244
244
  "data-taco": "drawer",
245
245
  className: containerClassName
246
- }, /*#__PURE__*/React__default.createElement("div", Object.assign({
246
+ }, output, /*#__PURE__*/React__default.createElement("div", Object.assign({
247
247
  className: dragHandlerClassName
248
248
  }, dragHandleProps, {
249
249
  "data-testid": "resize-handler",
250
250
  ref: dragHandlerRef
251
- })), output, showCloseButton ? /*#__PURE__*/React__default.createElement(Close, null, /*#__PURE__*/React__default.createElement(IconButton, {
251
+ })), showCloseButton ? /*#__PURE__*/React__default.createElement(Close, null, /*#__PURE__*/React__default.createElement(IconButton, {
252
252
  appearance: "discrete",
253
253
  "aria-label": texts.drawer.close,
254
- className: "absolute top-0 right-0 mt-4 mr-2",
254
+ className: "absolute right-0 top-0 mr-2 mt-4",
255
255
  icon: "close"
256
256
  })) : null);
257
257
  const styleProp = {
@@ -1 +1 @@
1
- {"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/Drawer/components/Content.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Group, GroupProps } from '../../Group/Group';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { useLocalization } from '../../Provider/Localization';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { useCurrentMenu } from '../../Menu/Context';\nimport { useCurrentDrawer } from '../Context';\nimport {\n getBackdropClassNames,\n getDrawerContainerClassNames,\n getDrawerContentClassNames,\n getDrawerDragHandlerClassNames,\n} from '../util';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { FocusScope } from '@react-aria/focus';\nimport { ScrollArea } from '../../ScrollArea/ScrollArea';\nimport { useGlobalKeyDown } from '../../../hooks/useGlobalKeyDown';\n\nconst RESIZE_MIN = 360;\nconst RESIZE_MAX = 1000;\n\nexport type DrawerContentRenderProps = {\n close: () => void;\n};\n\nexport enum DrawerAnimationDefinition {\n Visible = 'visible',\n Hidden = 'hidden',\n}\n\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick, renderProps }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('close'));\n };\n\n return children({ close, ref, ...renderProps });\n});\n\nexport type DrawerTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DrawerTitle(props: DrawerTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const { className, children, ...otherProps } = props;\n /**\n * By design in default drawer version Title has grey separator, but we might have exceptions like Drawer + Tabs scenario,\n * where we might want to hide the grey separator. For this reason separator was rendedr with using of classNames,\n * so it can be easily overriden in exceptional scenarious.\n * */\n const cName = cn('grow-0 py-4 pl-4 justyfy-self-start mb-0 border-b-[1px] border-grey-300', className);\n return (\n <DialogPrimitive.Title className={cName} {...otherProps} ref={ref}>\n <span className=\"line-clamp-2 inline-block w-4/6 overflow-y-hidden\">{children}</span>\n </DialogPrimitive.Title>\n );\n});\n\nexport type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function DrawerFooter(props: DrawerFooterProps, ref: React.Ref<HTMLDivElement>) {\n const { className, ...otherProps } = props;\n /**\n * The same scenario as Title, grey separator rendered using classNames to have posibility to override it.\n */\n const cName = cn('mt-auto flex justify-end grow-0 p-4 border-t-[1px] border-grey-300', props.className);\n return <div {...otherProps} className={cName} ref={ref} />;\n});\n\nexport const Actions = React.forwardRef(function Actions(props: GroupProps, ref: React.Ref<HTMLDivElement>) {\n const { className, ...otherProps } = props;\n const cName = cn('absolute top-0 right-10 mr-[8px] mt-4', className);\n return <Group {...otherProps} className={cName} ref={ref} />;\n});\n\nexport type DrawerCloseProps = React.HTMLAttributes<HTMLButtonElement>;\nexport const Close = React.forwardRef(function DrawerClose(props: DrawerCloseProps, ref: React.Ref<HTMLButtonElement>) {\n const { onClose } = useCurrentDrawer();\n\n return <DialogPrimitive.Close {...props} onClick={onClose} ref={ref} asChild />;\n});\n\n/**\n * It is container component, needed to provide default scrolling behaviour and padding, to simplyfy usage, requested by feature devs.\n * It is optional to use InnerContent component, if consumer need to implement custom behaviour or paddings for inner content,\n * then it's simply enough to render children and wrap them in custom implementation.\n */\nexport type DrawerInnerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /**\n * Consumer might want to use innerContent component to apply default paddings, but want to implement custom scrolling behaviour,\n * default value - true\n */\n isScrollable?: boolean;\n};\nexport const InnerContent = React.forwardRef(function InnerContent(\n props: DrawerInnerContentProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const { className, isScrollable = true, children, ...otherProps } = props;\n const cName = cn(\n 'grow flex flex-col',\n {\n 'overflow-y-hidden': isScrollable,\n 'p-4': !isScrollable,\n },\n className\n );\n return (\n <div {...otherProps} className={cName} ref={ref}>\n {isScrollable ? <ScrollArea className=\"w-full gap-y-0.5 p-4\">{children}</ScrollArea> : children}\n </div>\n );\n});\n\nconst Portal = (props: DialogPrimitive.DialogPortalProps) => {\n const { children, ...otherProps } = props;\n const { open = false, variant, outlet } = useCurrentDrawer();\n\n const backdropClassNames = React.useMemo(() => {\n return getBackdropClassNames(open);\n }, [open]);\n\n if (!outlet) {\n return null;\n }\n\n return (\n <DialogPrimitive.Portal {...otherProps} container={outlet ?? undefined}>\n {variant === 'overlay' ? (\n <DialogPrimitive.Overlay forceMount>\n {/* Animate backdrop appearance for overlay version of Drawer */}\n <Backdrop className={backdropClassNames} />\n </DialogPrimitive.Overlay>\n ) : null}\n {children}\n </DialogPrimitive.Portal>\n );\n};\n\ntype UntrappedFocusDrawerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n onEscape: (event: KeyboardEvent) => void;\n};\nconst UntrappedFocusDrawerContent = React.forwardRef(function EmbeddedDrawerContent(\n props: UntrappedFocusDrawerContentProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const { onEscape, children, ...otherProps } = props;\n\n useGlobalKeyDown('Escape', onEscape);\n\n return (\n <div {...otherProps} ref={ref}>\n <FocusScope autoFocus={true} restoreFocus={true}>\n {children}\n </FocusScope>\n </div>\n );\n});\n\nexport type DrawerContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the side drawer is opened */\n 'aria-label': string;\n children: Omit<React.ReactNode, 'Function'> | ((props: DrawerContentRenderProps) => JSX.Element);\n};\nexport const DrawerContent = React.forwardRef(function Content(\n props: DrawerContentProps,\n externalRef: React.Ref<HTMLDivElement>\n) {\n const {\n size,\n onClose,\n onResize,\n open = false,\n closeOnEscape,\n variant,\n focusTrap,\n showCloseButton,\n setOpen,\n } = useCurrentDrawer();\n const { className, style, children, ...otherProps } = props;\n const { texts } = useLocalization();\n const ref = useMergedRef<HTMLDivElement>(externalRef);\n\n // if the drawer was opened by a menu, we need to close the menu when the drawer closes\n // the menu is still open (and mounted) because it is the trigger for the drawer\n const menu = useCurrentMenu();\n let handleCloseAutoFocus: DialogPrimitive.DialogContentProps['onCloseAutoFocus'];\n\n if (menu) {\n handleCloseAutoFocus = () => {\n menu.close();\n };\n }\n\n const containerClassName: string = React.useMemo(() => cn(getDrawerContainerClassNames(variant), className), [className]);\n\n const { contentClassName, dragHandlerClassName } = React.useMemo(() => {\n const contentClassName = getDrawerContentClassNames(size, variant, open);\n const dragHandlerClassName: string = getDrawerDragHandlerClassNames();\n return { contentClassName, dragHandlerClassName };\n }, [size, variant, open]);\n\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n const isTargetInsideDrawerContent = ref.current?.contains(event.target as HTMLElement);\n if (isTargetInsideDrawerContent) {\n if (!closeOnEscape) {\n event.preventDefault();\n } else {\n setOpen && setOpen(false);\n if (onClose) {\n onClose();\n }\n }\n }\n };\n\n const [containerWidth, setContainerWidth] = React.useState<number>();\n\n const dragHandlerRef = React.useRef<HTMLDivElement>(null);\n const {\n position,\n dragging,\n handleProps: dragHandleProps,\n resetPosition,\n } = useDraggable(useMergedRef<HTMLDivElement>(dragHandlerRef));\n\n const contentRef = React.useRef<HTMLDivElement>(null);\n\n React.useEffect(() => {\n if (onResize) {\n onResize(position.x);\n }\n }, [position]);\n\n React.useEffect(() => {\n setContainerWidth(contentRef.current?.offsetWidth);\n }, [contentRef, open]);\n\n const resizedWidth = React.useMemo((): number | undefined => {\n if (containerWidth) {\n return Math.min(RESIZE_MAX, Math.max(RESIZE_MIN, containerWidth - position.x || 0));\n }\n return;\n }, [containerWidth, position]);\n\n React.useEffect(() => {\n if (!dragging && resizedWidth) {\n setContainerWidth(resizedWidth);\n resetPosition();\n }\n }, [dragging]);\n\n let output;\n\n if (typeof children === 'function') {\n output = (\n <Close>\n <RenderPropWrapper>{children}</RenderPropWrapper>\n </Close>\n );\n } else {\n output = children;\n }\n\n const content = (\n <div ref={contentRef} data-taco=\"drawer\" className={containerClassName}>\n <div className={dragHandlerClassName} {...dragHandleProps} data-testid=\"resize-handler\" ref={dragHandlerRef} />\n {output}\n {showCloseButton ? (\n <Close>\n <IconButton\n appearance=\"discrete\"\n aria-label={texts.drawer.close}\n className=\"absolute top-0 right-0 mt-4 mr-2\"\n icon=\"close\"\n />\n </Close>\n ) : null}\n </div>\n );\n\n const styleProp = {\n ...style,\n ...{ width: resizedWidth },\n };\n\n return focusTrap ? (\n <DialogPrimitive.Content\n forceMount\n {...otherProps}\n className={contentClassName}\n onEscapeKeyDown={handleEscapeKeyDown}\n onInteractOutside={variant === 'overlay' ? undefined : event => event.preventDefault()}\n onCloseAutoFocus={handleCloseAutoFocus}\n ref={ref}\n style={styleProp}>\n {content}\n </DialogPrimitive.Content>\n ) : (\n <UntrappedFocusDrawerContent onEscape={handleEscapeKeyDown} className={contentClassName} style={styleProp} ref={ref}>\n {content}\n </UntrappedFocusDrawerContent>\n );\n});\n\nexport const Content = React.forwardRef(function Content(props: DrawerContentProps, externalRef: React.Ref<HTMLDivElement>) {\n const { children } = props;\n\n return (\n <Portal>\n <DrawerContent {...props} ref={externalRef}>\n {children}\n </DrawerContent>\n </Portal>\n );\n});\n"],"names":["RESIZE_MIN","RESIZE_MAX","DrawerAnimationDefinition","RenderPropWrapper","React","forwardRef","children","onClick","renderProps","ref","close","CustomEvent","Title","DrawerTitle","props","className","otherProps","cName","cn","DialogPrimitive","Footer","DrawerFooter","Actions","Group","Close","DrawerClose","onClose","useCurrentDrawer","asChild","InnerContent","isScrollable","ScrollArea","Portal","open","variant","outlet","backdropClassNames","useMemo","getBackdropClassNames","container","undefined","forceMount","Backdrop","UntrappedFocusDrawerContent","EmbeddedDrawerContent","onEscape","useGlobalKeyDown","FocusScope","autoFocus","restoreFocus","DrawerContent","Content","externalRef","size","onResize","closeOnEscape","focusTrap","showCloseButton","setOpen","style","texts","useLocalization","useMergedRef","menu","useCurrentMenu","handleCloseAutoFocus","containerClassName","getDrawerContainerClassNames","contentClassName","dragHandlerClassName","getDrawerContentClassNames","getDrawerDragHandlerClassNames","handleEscapeKeyDown","event","isTargetInsideDrawerContent","current","contains","target","preventDefault","containerWidth","setContainerWidth","useState","dragHandlerRef","useRef","position","dragging","handleProps","dragHandleProps","resetPosition","useDraggable","contentRef","useEffect","x","offsetWidth","resizedWidth","Math","min","max","output","content","IconButton","appearance","drawer","icon","styleProp","width","onEscapeKeyDown","onInteractOutside","onCloseAutoFocus"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAMA,UAAU,GAAG,GAAG;AACtB,MAAMC,UAAU,GAAG,IAAI;IAMXC;AAAZ,WAAYA,yBAAyB;EACjCA,gDAAmB;EACnBA,8CAAiB;AACrB,CAAC,EAHWA,yBAAyB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,UAAU,EAAC,UAAU;kBACTzC,KAAK,CAAC0C,MAAM,CAAC5F,KAAK;IAC9BK,SAAS,EAAC,kCAAkC;IAC5CwF,IAAI,EAAC;IACP,CACE,GACR,IAAI,CAEf;EAED,MAAMC,SAAS,GAAG;IACd,GAAG7C,KAAK;IACR,GAAG;MAAE8C,KAAK,EAAEX;;GACf;EAED,OAAOtC,SAAS,gBACZpD,6BAACe,SAAuB;IACpBsB,UAAU;KACNzB,UAAU;IACdD,SAAS,EAAEqD,gBAAgB;IAC3BsC,eAAe,EAAElC,mBAAmB;IACpCmC,iBAAiB,EAAEzE,OAAO,KAAK,SAAS,GAAGM,SAAS,GAAGiC,KAAK,IAAIA,KAAK,CAACK,cAAc,EAAE;IACtF8B,gBAAgB,EAAE3C,oBAAoB;IACtCxD,GAAG,EAAEA,GAAG;IACRkD,KAAK,EAAE6C;MACNL,OAAO,CACc,gBAE1B/F,6BAACuC,2BAA2B;IAACE,QAAQ,EAAE2B,mBAAmB;IAAEzD,SAAS,EAAEqD,gBAAgB;IAAET,KAAK,EAAE6C,SAAS;IAAE/F,GAAG,EAAEA;KAC3G0F,OAAO,CAEf;AACL,CAAC;MAEYhD,OAAO,gBAAG/C,cAAK,CAACC,UAAU,CAAC,SAAS8C,OAAO,CAACrC,KAAyB,EAAEsC,WAAsC;EACtH,MAAM;IAAE9C;GAAU,GAAGQ,KAAK;EAE1B,oBACIV,6BAAC4B,MAAM,qBACH5B,6BAAC8C,aAAa,oBAAKpC,KAAK;IAAEL,GAAG,EAAE2C;MAC1B9C,QAAQ,CACG,CACX;AAEjB,CAAC;;;;"}
1
+ {"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/Drawer/components/Content.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Group, GroupProps } from '../../Group/Group';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { useLocalization } from '../../Provider/Localization';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { useCurrentMenu } from '../../Menu/Context';\nimport { useCurrentDrawer } from '../Context';\nimport {\n getBackdropClassNames,\n getDrawerContainerClassNames,\n getDrawerContentClassNames,\n getDrawerDragHandlerClassNames,\n} from '../util';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { FocusScope } from '@react-aria/focus';\nimport { ScrollArea } from '../../ScrollArea/ScrollArea';\nimport { useGlobalKeyDown } from '../../../hooks/useGlobalKeyDown';\n\nconst RESIZE_MIN = 360;\nconst RESIZE_MAX = 1000;\n\nexport type DrawerContentRenderProps = {\n close: () => void;\n};\n\nexport enum DrawerAnimationDefinition {\n Visible = 'visible',\n Hidden = 'hidden',\n}\n\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick, renderProps }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('close'));\n };\n\n return children({ close, ref, ...renderProps });\n});\n\nexport type DrawerTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DrawerTitle(props: DrawerTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const { className, children, ...otherProps } = props;\n /**\n * By design in default drawer version Title has grey separator, but we might have exceptions like Drawer + Tabs scenario,\n * where we might want to hide the grey separator. For this reason separator was rendedr with using of classNames,\n * so it can be easily overriden in exceptional scenarious.\n * */\n const cName = cn('grow-0 py-4 pl-4 justyfy-self-start mb-0 border-b-[1px] border-grey-300', className);\n return (\n <DialogPrimitive.Title className={cName} {...otherProps} ref={ref}>\n <span className=\"line-clamp-2 inline-block w-4/6 overflow-y-hidden\">{children}</span>\n </DialogPrimitive.Title>\n );\n});\n\nexport type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function DrawerFooter(props: DrawerFooterProps, ref: React.Ref<HTMLDivElement>) {\n const { className, ...otherProps } = props;\n /**\n * The same scenario as Title, grey separator rendered using classNames to have posibility to override it.\n */\n const cName = cn('mt-auto flex justify-end grow-0 p-4 border-t-[1px] border-grey-300', props.className);\n return <div {...otherProps} className={cName} ref={ref} />;\n});\n\nexport const Actions = React.forwardRef(function Actions(props: GroupProps, ref: React.Ref<HTMLDivElement>) {\n const { className, ...otherProps } = props;\n const cName = cn('absolute top-0 right-10 mr-[8px] mt-4', className);\n return <Group {...otherProps} className={cName} ref={ref} />;\n});\n\nexport type DrawerCloseProps = React.HTMLAttributes<HTMLButtonElement>;\nexport const Close = React.forwardRef(function DrawerClose(props: DrawerCloseProps, ref: React.Ref<HTMLButtonElement>) {\n const { onClose } = useCurrentDrawer();\n\n return <DialogPrimitive.Close {...props} onClick={onClose} ref={ref} asChild />;\n});\n\n/**\n * It is container component, needed to provide default scrolling behaviour and padding, to simplyfy usage, requested by feature devs.\n * It is optional to use InnerContent component, if consumer need to implement custom behaviour or paddings for inner content,\n * then it's simply enough to render children and wrap them in custom implementation.\n */\nexport type DrawerInnerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /**\n * Consumer might want to use innerContent component to apply default paddings, but want to implement custom scrolling behaviour,\n * default value - true\n */\n isScrollable?: boolean;\n};\nexport const InnerContent = React.forwardRef(function InnerContent(\n props: DrawerInnerContentProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const { className, isScrollable = true, children, ...otherProps } = props;\n const cName = cn(\n 'grow flex flex-col',\n {\n 'overflow-y-hidden': isScrollable,\n 'p-4': !isScrollable,\n },\n className\n );\n return (\n <div {...otherProps} className={cName} ref={ref}>\n {isScrollable ? <ScrollArea className=\"w-full gap-y-0.5 p-4\">{children}</ScrollArea> : children}\n </div>\n );\n});\n\nconst Portal = (props: DialogPrimitive.DialogPortalProps) => {\n const { children, ...otherProps } = props;\n const { open = false, variant, outlet } = useCurrentDrawer();\n\n const backdropClassNames = React.useMemo(() => {\n return getBackdropClassNames(open);\n }, [open]);\n\n if (!outlet) {\n return null;\n }\n\n return (\n <DialogPrimitive.Portal {...otherProps} container={outlet ?? undefined}>\n {variant === 'overlay' ? (\n <DialogPrimitive.Overlay forceMount>\n {/* Animate backdrop appearance for overlay version of Drawer */}\n <Backdrop className={backdropClassNames} />\n </DialogPrimitive.Overlay>\n ) : null}\n {children}\n </DialogPrimitive.Portal>\n );\n};\n\ntype UntrappedFocusDrawerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n onEscape: (event: KeyboardEvent) => void;\n};\nconst UntrappedFocusDrawerContent = React.forwardRef(function EmbeddedDrawerContent(\n props: UntrappedFocusDrawerContentProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const { onEscape, children, ...otherProps } = props;\n\n useGlobalKeyDown('Escape', onEscape);\n\n return (\n <div {...otherProps} ref={ref}>\n <FocusScope autoFocus={true} restoreFocus={true}>\n {children}\n </FocusScope>\n </div>\n );\n});\n\nexport type DrawerContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the side drawer is opened */\n 'aria-label': string;\n children: Omit<React.ReactNode, 'Function'> | ((props: DrawerContentRenderProps) => JSX.Element);\n};\nexport const DrawerContent = React.forwardRef(function Content(\n props: DrawerContentProps,\n externalRef: React.Ref<HTMLDivElement>\n) {\n const {\n size,\n onClose,\n onResize,\n open = false,\n closeOnEscape,\n variant,\n focusTrap,\n showCloseButton,\n setOpen,\n } = useCurrentDrawer();\n const { className, style, children, ...otherProps } = props;\n const { texts } = useLocalization();\n const ref = useMergedRef<HTMLDivElement>(externalRef);\n\n // if the drawer was opened by a menu, we need to close the menu when the drawer closes\n // the menu is still open (and mounted) because it is the trigger for the drawer\n const menu = useCurrentMenu();\n let handleCloseAutoFocus: DialogPrimitive.DialogContentProps['onCloseAutoFocus'];\n\n if (menu) {\n handleCloseAutoFocus = () => {\n menu.close();\n };\n }\n\n const containerClassName: string = React.useMemo(() => cn(getDrawerContainerClassNames(variant), className), [className]);\n\n const { contentClassName, dragHandlerClassName } = React.useMemo(() => {\n const contentClassName = getDrawerContentClassNames(size, variant, open);\n const dragHandlerClassName: string = getDrawerDragHandlerClassNames();\n return { contentClassName, dragHandlerClassName };\n }, [size, variant, open]);\n\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n const isTargetInsideDrawerContent = ref.current?.contains(event.target as HTMLElement);\n if (isTargetInsideDrawerContent) {\n if (!closeOnEscape) {\n event.preventDefault();\n } else {\n setOpen && setOpen(false);\n if (onClose) {\n onClose();\n }\n }\n }\n };\n\n const [containerWidth, setContainerWidth] = React.useState<number>();\n\n const dragHandlerRef = React.useRef<HTMLDivElement>(null);\n const {\n position,\n dragging,\n handleProps: dragHandleProps,\n resetPosition,\n } = useDraggable(useMergedRef<HTMLDivElement>(dragHandlerRef));\n\n const contentRef = React.useRef<HTMLDivElement>(null);\n\n React.useEffect(() => {\n if (onResize) {\n onResize(position.x);\n }\n }, [position]);\n\n React.useEffect(() => {\n setContainerWidth(contentRef.current?.offsetWidth);\n }, [contentRef, open]);\n\n const resizedWidth = React.useMemo((): number | undefined => {\n if (containerWidth) {\n return Math.min(RESIZE_MAX, Math.max(RESIZE_MIN, containerWidth - position.x || 0));\n }\n return;\n }, [containerWidth, position]);\n\n React.useEffect(() => {\n if (!dragging && resizedWidth) {\n setContainerWidth(resizedWidth);\n resetPosition();\n }\n }, [dragging]);\n\n let output;\n\n if (typeof children === 'function') {\n output = (\n <Close>\n <RenderPropWrapper>{children}</RenderPropWrapper>\n </Close>\n );\n } else {\n output = children;\n }\n\n const content = (\n <div ref={contentRef} data-taco=\"drawer\" className={containerClassName}>\n {output}\n <div className={dragHandlerClassName} {...dragHandleProps} data-testid=\"resize-handler\" ref={dragHandlerRef} />\n {showCloseButton ? (\n <Close>\n <IconButton\n appearance=\"discrete\"\n aria-label={texts.drawer.close}\n className=\"absolute right-0 top-0 mr-2 mt-4\"\n icon=\"close\"\n />\n </Close>\n ) : null}\n </div>\n );\n\n const styleProp = {\n ...style,\n ...{ width: resizedWidth },\n };\n\n return focusTrap ? (\n <DialogPrimitive.Content\n forceMount\n {...otherProps}\n className={contentClassName}\n onEscapeKeyDown={handleEscapeKeyDown}\n onInteractOutside={variant === 'overlay' ? undefined : event => event.preventDefault()}\n onCloseAutoFocus={handleCloseAutoFocus}\n ref={ref}\n style={styleProp}>\n {content}\n </DialogPrimitive.Content>\n ) : (\n <UntrappedFocusDrawerContent onEscape={handleEscapeKeyDown} className={contentClassName} style={styleProp} ref={ref}>\n {content}\n </UntrappedFocusDrawerContent>\n );\n});\n\nexport const Content = React.forwardRef(function Content(props: DrawerContentProps, externalRef: React.Ref<HTMLDivElement>) {\n const { children } = props;\n\n return (\n <Portal>\n <DrawerContent {...props} ref={externalRef}>\n {children}\n </DrawerContent>\n </Portal>\n );\n});\n"],"names":["RESIZE_MIN","RESIZE_MAX","DrawerAnimationDefinition","RenderPropWrapper","React","forwardRef","children","onClick","renderProps","ref","close","CustomEvent","Title","DrawerTitle","props","className","otherProps","cName","cn","DialogPrimitive","Footer","DrawerFooter","Actions","Group","Close","DrawerClose","onClose","useCurrentDrawer","asChild","InnerContent","isScrollable","ScrollArea","Portal","open","variant","outlet","backdropClassNames","useMemo","getBackdropClassNames","container","undefined","forceMount","Backdrop","UntrappedFocusDrawerContent","EmbeddedDrawerContent","onEscape","useGlobalKeyDown","FocusScope","autoFocus","restoreFocus","DrawerContent","Content","externalRef","size","onResize","closeOnEscape","focusTrap","showCloseButton","setOpen","style","texts","useLocalization","useMergedRef","menu","useCurrentMenu","handleCloseAutoFocus","containerClassName","getDrawerContainerClassNames","contentClassName","dragHandlerClassName","getDrawerContentClassNames","getDrawerDragHandlerClassNames","handleEscapeKeyDown","event","isTargetInsideDrawerContent","current","contains","target","preventDefault","containerWidth","setContainerWidth","useState","dragHandlerRef","useRef","position","dragging","handleProps","dragHandleProps","resetPosition","useDraggable","contentRef","useEffect","x","offsetWidth","resizedWidth","Math","min","max","output","content","IconButton","appearance","drawer","icon","styleProp","width","onEscapeKeyDown","onInteractOutside","onCloseAutoFocus"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAMA,UAAU,GAA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KAA0BkB,eAAe;mBAAc,gBAAgB;IAAC9E,GAAG,EAAEyE;KAAkB,EAC9GzB,eAAe,gBACZrD,6BAACoB,KAAK,qBACFpB,6BAACgG,UAAU;IACPC,UAAU,EAAC,UAAU;kBACTzC,KAAK,CAAC0C,MAAM,CAAC5F,KAAK;IAC9BK,SAAS,EAAC,kCAAkC;IAC5CwF,IAAI,EAAC;IACP,CACE,GACR,IAAI,CAEf;EAED,MAAMC,SAAS,GAAG;IACd,GAAG7C,KAAK;IACR,GAAG;MAAE8C,KAAK,EAAEX;;GACf;EAED,OAAOtC,SAAS,gBACZpD,6BAACe,SAAuB;IACpBsB,UAAU;KACNzB,UAAU;IACdD,SAAS,EAAEqD,gBAAgB;IAC3BsC,eAAe,EAAElC,mBAAmB;IACpCmC,iBAAiB,EAAEzE,OAAO,KAAK,SAAS,GAAGM,SAAS,GAAGiC,KAAK,IAAIA,KAAK,CAACK,cAAc,EAAE;IACtF8B,gBAAgB,EAAE3C,oBAAoB;IACtCxD,GAAG,EAAEA,GAAG;IACRkD,KAAK,EAAE6C;MACNL,OAAO,CACc,gBAE1B/F,6BAACuC,2BAA2B;IAACE,QAAQ,EAAE2B,mBAAmB;IAAEzD,SAAS,EAAEqD,gBAAgB;IAAET,KAAK,EAAE6C,SAAS;IAAE/F,GAAG,EAAEA;KAC3G0F,OAAO,CAEf;AACL,CAAC;MAEYhD,OAAO,gBAAG/C,cAAK,CAACC,UAAU,CAAC,SAAS8C,OAAO,CAACrC,KAAyB,EAAEsC,WAAsC;EACtH,MAAM;IAAE9C;GAAU,GAAGQ,KAAK;EAE1B,oBACIV,6BAAC4B,MAAM,qBACH5B,6BAAC8C,aAAa,oBAAKpC,KAAK;IAAEL,GAAG,EAAE2C;MAC1B9C,QAAQ,CACG,CACX;AAEjB,CAAC;;;;"}
@@ -118,7 +118,7 @@ const defaultLocalisationTexts = {
118
118
  filters: {
119
119
  button: 'Filters',
120
120
  buttons: {
121
- addFilter: 'Add Filter',
121
+ addNewFilter: 'Add new filter',
122
122
  clearFilters: 'Clear all filters'
123
123
  },
124
124
  comparators: {
@@ -135,6 +135,14 @@ const defaultLocalisationTexts = {
135
135
  isEmpty: 'Is empty',
136
136
  isNotEmpty: 'Is not empty'
137
137
  },
138
+ conditions: {
139
+ and: 'And',
140
+ where: 'Where'
141
+ },
142
+ emptyFilter: {
143
+ condition: 'Condition',
144
+ value: 'Value'
145
+ },
138
146
  tooltip: 'Apply filters',
139
147
  total: 'Viewing [CURRENT] of [TOTAL]'
140
148
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Localization.js","sources":["../../../../../../../src/components/Provider/Localization.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Locale } from '../../types';\nimport { CalendarTexts } from '../Calendar/Calendar';\nimport { ComboboxTexts } from '../Combobox/Combobox';\nimport { DialogTexts } from '../Dialog/Dialog';\nimport { PaginationTexts } from '../Pagination/Pagination';\nimport { ListboxTexts } from '../Listbox/Listbox';\nimport { ToastsTexts } from '../Toast/Toast';\nimport { DatepickerTexts } from '../Datepicker/Datepicker';\nimport { HeaderTexts } from '../Header/Header';\nimport { HangerTexts } from '../Hanger/Hanger';\nimport { SelectTexts } from '../Select/Select';\nimport { TourTexts } from '../Tour/Tour';\nimport { TableTexts } from '../Table/Table';\nimport { Table2Texts } from '../Table2/Table2';\nimport { SearchInputTexts } from '../SearchInput/SearchInput';\nimport { Select2Texts } from '../Select2/Select2';\nimport { BannerTexts } from '../Banner/Banner';\nimport { DrawerTexts } from '../Drawer/Drawer';\n\nexport type LocalizationTexts = {\n /** Localized texts and aria-labels for [Banner](component:banner) component */\n banner: BannerTexts;\n /** Localized texts and aria-labels for [Calendar](component:calendar) component */\n calendar: CalendarTexts;\n /** Localized texts and aria-labels for [Combobox](component:combobox) component */\n combobox: ComboboxTexts;\n /** Localized texts and aria-labels for [DatePicker](component:datepicker) component */\n datepicker: DatepickerTexts;\n /** Localized texts and aria-labels for [Dialog](component:dialog) component */\n dialog: DialogTexts;\n /** Localized texts and aria-labels for [Hanger](component:hanger) component */\n hanger: HangerTexts;\n /** Localized texts and aria-labels for [Header](component:header) component */\n header: HeaderTexts;\n /** Localized texts and aria-labels for [Listbox](component:listbox) component */\n listbox: ListboxTexts;\n /** Localized texts and aria-labels for [Pagination](component:pagination) component */\n pagination: PaginationTexts;\n /** Localized texts and aria-labels for [Table](component:table) component */\n table: TableTexts;\n /** Localized texts and aria-labels for [Table2](component:table2) component */\n table2: Table2Texts;\n /** Localized texts and aria-labels for [SearchInput](component:searchinput) component */\n searchInput: SearchInputTexts;\n /** Localized texts and aria-labels for [Select](component:select) component */\n select: SelectTexts;\n /** Localized texts and aria-labels for [Select2](component:select2) component */\n select2: Select2Texts;\n /** Localized texts and aria-labels for [Toast](component:toast) component */\n toasts: ToastsTexts;\n /** Localized texts and aria-labels for [Tour](component:tour) component */\n tour: TourTexts;\n /** Localized texts and aria-labels for [Drawer](component:drawer) component */\n drawer: DrawerTexts;\n};\n\nexport type Localization = {\n /**\n * Provide the language code used in application.\n * Default value is `en-GB`\n */\n locale: Locale;\n /** Provide the texts and aria-labels for components used within the provider */\n texts: LocalizationTexts;\n /** Provide the formatting */\n formatting: {\n /** Default value is `dd.mm.yy` */\n date: string;\n };\n};\n\nexport const defaultLocalisationTexts = {\n banner: {\n close: 'Close',\n },\n calendar: {\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n actions: {\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n today: 'Today',\n },\n },\n combobox: {\n tooltip: 'Search in list',\n },\n datepicker: {\n calendar: 'Calendar',\n clear: 'Clear',\n expand: 'Show calendar',\n shortcuts: 'Shortcuts',\n },\n dialog: {\n close: 'Close',\n drag: 'Drag',\n },\n hanger: {\n close: 'Close',\n },\n header: {\n addAgreement: 'Add agreement',\n logout: 'Log off',\n more: 'More',\n new: 'New',\n search: 'Search for agreement...',\n },\n listbox: {\n loading: 'Loading results...',\n empty: 'No results found',\n allOption: 'All',\n },\n pagination: {\n label: 'Pagination',\n pageSize: 'Items per page',\n showingXofYofTotal: 'Showing [X] - [Y] of [total]',\n actions: {\n firstPage: 'Goto first page',\n firstPageWithShortcut: 'Goto first page (Home)',\n previousPage: 'Goto previous page',\n previousPageWithShortcut: 'Goto previous page (Page Up)',\n nextPage: 'Goto next page',\n nextPageWithShortcut: 'Goto next page (Page Down)',\n lastPage: 'Goto last page',\n lastPageWithShortcut: 'Goto last page (End)',\n pageX: 'Goto page [X]',\n },\n },\n table: {\n actions: 'Other actions',\n edit: 'Edit (e)',\n copy: 'Copy (c)',\n del: 'Delete (del)',\n newSubRow: 'New row (shift + n)',\n loading: 'Loading...',\n },\n table2: {\n columns: {\n resize: {\n tooltip: 'Resize column',\n },\n actions: {\n tooltip: 'Other actions',\n },\n drag: {\n tooltip: 'Drag row',\n },\n expansion: {\n collapse: 'Collapse row',\n collapseAll: 'Collapse all rows',\n expand: 'Expand row',\n expandAll: 'Expand all rows',\n },\n select: {\n deselect: 'Deselect row',\n deselectAll: 'Deselect all rows',\n select: 'Select row',\n selectAll: 'Select all rows',\n },\n menu: {\n hideColumn: 'Hide column',\n freezeColumns: (count = 1) => (count === 1 ? 'Freeze the first column' : `Freeze first ${count} columns`),\n unfreezeColumns: 'Unfreeze all columns',\n },\n },\n columnSettings: {\n search: 'Search column...',\n tooltip: 'Column settings',\n button: 'Columns',\n noResults: 'No results',\n },\n editing: {\n button: 'Edit',\n tooltip: 'Edit',\n tooltipDisabled: 'There are no visible columns that support editing',\n rowIndicator: {\n rowWillMove: 'Row will move due to sorting',\n rowWillBeHidden: 'Row will hide due to filtering',\n rowWillMoveReasonSearch:\n 'Due to a search filter applied to this table, this row will be hidden as soon as you select another row',\n rowWillMoveReasonFilter:\n \"Due to a filter applied to the column '[COLUMN]', this row will be hidden as soon as you select another row\",\n rowWillMoveReasonSorting:\n \"Due to sorting applied to the column '[COLUMN]', this row will move position as soon as you select another row\",\n },\n },\n filters: {\n button: 'Filters',\n buttons: {\n addFilter: 'Add Filter',\n clearFilters: 'Clear all filters',\n },\n comparators: {\n contains: 'Contains',\n doesNotContain: 'Does not contain',\n isEqualTo: 'Is',\n isNotEqualTo: 'Is not',\n isGreaterThan: 'Is greater than',\n isLessThan: 'Is less than',\n isBetween: 'Is between',\n isOneOf: 'Is one of',\n isNoneOf: 'Is none of',\n isAllOf: 'Is all of',\n isEmpty: 'Is empty',\n isNotEmpty: 'Is not empty',\n },\n tooltip: 'Apply filters',\n total: 'Viewing [CURRENT] of [TOTAL]',\n },\n rowDensity: {\n tooltip: 'Row density',\n compact: 'compact',\n normal: 'normal',\n comfortable: 'comfortable',\n spacious: 'spacious',\n },\n search: {\n placeholder: 'Search...',\n },\n shortcuts: {\n tooltip: 'View keyboard shortcuts',\n search: 'Search',\n filter: 'Filter',\n previousRow: 'Previous row',\n nextRow: 'Next row',\n editCell: 'Edit cell',\n previousColumn: 'Previous column',\n nextColumn: 'Next column',\n rowClick: 'Activate current row',\n selectRow: 'Select current row',\n selectAllRows: 'Select all rows',\n expandRow: 'Expand current row',\n collapseRow: 'Collapse current row',\n },\n },\n searchInput: {\n button: 'Search',\n placeholder: 'Search...',\n clear: 'Clear',\n },\n select: {\n allOptionsSelected: 'All',\n },\n select2: {\n allSelect: 'Select all',\n allDeselect: 'Deselect all',\n cancel: 'Cancel',\n chooseColor: 'Pick a color',\n create: 'Create',\n delete: 'Delete',\n save: 'Save',\n search: 'Search...',\n searchOrCreate: 'Search or create...',\n },\n toasts: {\n dismiss: 'Dismiss',\n },\n tour: {\n back: 'Back',\n close: 'Close',\n skip: 'Close and complete',\n last: 'Done',\n next: 'Next',\n open: 'Open',\n },\n drawer: {\n close: 'Close',\n },\n};\n\nexport const defaultLocalizationContext: Localization = {\n locale: 'en-GB',\n texts: defaultLocalisationTexts,\n formatting: {\n date: 'dd.mm.yy',\n },\n};\n\nexport const LocalizationContext = React.createContext<Localization>(defaultLocalizationContext);\nexport interface LocalizationProviderProps {\n children: React.ReactNode;\n localization?: Localization;\n}\nexport const LocalizationProvider: React.FC<LocalizationProviderProps> = ({ localization, children }) => {\n return (\n <LocalizationContext.Provider value={localization ?? defaultLocalizationContext}>{children}</LocalizationContext.Provider>\n );\n};\n\nexport const useLocalization = () => React.useContext(LocalizationContext);\n"],"names":["defaultLocalisationTexts","banner","close","calendar","months","weekdaysShort","weekdays","actions","previousMonth","nextMonth","previousYear","nextYear","today","combobox","tooltip","datepicker","clear","expand","shortcuts","dialog","drag","hanger","header","addAgreement","logout","more","new","search","listbox","loading","empty","allOption","pagination","label","pageSize","showingXofYofTotal","firstPage","firstPageWithShortcut","previousPage","previousPageWithShortcut","nextPage","nextPageWithShortcut","lastPage","lastPageWithShortcut","pageX","table","edit","copy","del","newSubRow","table2","columns","resize","expansion","collapse","collapseAll","expandAll","select","deselect","deselectAll","selectAll","menu","hideColumn","freezeColumns","count","unfreezeColumns","columnSettings","button","noResults","editing","tooltipDisabled","rowIndicator","rowWillMove","rowWillBeHidden","rowWillMoveReasonSearch","rowWillMoveReasonFilter","rowWillMoveReasonSorting","filters","buttons","addFilter","clearFilters","comparators","contains","doesNotContain","isEqualTo","isNotEqualTo","isGreaterThan","isLessThan","isBetween","isOneOf","isNoneOf","isAllOf","isEmpty","isNotEmpty","total","rowDensity","compact","normal","comfortable","spacious","placeholder","filter","previousRow","nextRow","editCell","previousColumn","nextColumn","rowClick","selectRow","selectAllRows","expandRow","collapseRow","searchInput","allOptionsSelected","select2","allSelect","allDeselect","cancel","chooseColor","create","delete","save","searchOrCreate","toasts","dismiss","tour","back","skip","last","next","open","drawer","defaultLocalizationContext","locale","texts","formatting","date","LocalizationContext","React","LocalizationProvider","localization","children","Provider","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;MAC/BC,WAAW,EAAE;;GAEpB;EACDC,WAAW,EAAE;IACT7C,MAAM,EAAE,QAAQ;IAChBiC,WAAW,EAAE,WAAW;IACxBpF,KAAK,EAAE;GACV;EACDyC,MAAM,EAAE;IACJwD,kBAAkB,EAAE;GACvB;EACDC,OAAO,EAAE;IACLC,SAAS,EAAE,YAAY;IACvBC,WAAW,EAAE,cAAc;IAC3BC,MAAM,EAAE,QAAQ;IAChBC,WAAW,EAAE,cAAc;IAC3BC,MAAM,EAAE,QAAQ;IAChBC,MAAM,EAAE,QAAQ;IAChBC,IAAI,EAAE,MAAM;IACZ9F,MAAM,EAAE,WAAW;IACnB+F,cAAc,EAAE;GACnB;EACDC,MAAM,EAAE;IACJC,OAAO,EAAE;GACZ;EACDC,IAAI,EAAE;IACFC,IAAI,EAAE,MAAM;IACZ5H,KAAK,EAAE,OAAO;IACd6H,IAAI,EAAE,oBAAoB;IAC1BC,IAAI,EAAE,MAAM;IACZC,IAAI,EAAE,MAAM;IACZC,IAAI,EAAE;GACT;EACDC,MAAM,EAAE;IACJjI,KAAK,EAAE;;;MAIFkI,0BAA0B,GAAiB;EACpDC,MAAM,EAAE,OAAO;EACfC,KAAK,EAAEtI,wBAAwB;EAC/BuI,UAAU,EAAE;IACRC,IAAI,EAAE;;;MAIDC,mBAAmB,gBAAGC,aAAmB,CAAeN,0BAA0B;MAKlFO,oBAAoB,GAAwC,CAAC;EAAEC,YAAY;EAAEC;CAAU;EAChG,oBACIH,cAACD,mBAAmB,CAACK,QAAQ;IAACC,KAAK,EAAEH,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAIR;KAA6BS,QAAQ,CAAgC;AAElI;MAEaG,eAAe,GAAG,MAAMN,UAAgB,CAACD,mBAAmB;;;;"}
1
+ {"version":3,"file":"Localization.js","sources":["../../../../../../../src/components/Provider/Localization.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Locale } from '../../types';\nimport { CalendarTexts } from '../Calendar/Calendar';\nimport { ComboboxTexts } from '../Combobox/Combobox';\nimport { DialogTexts } from '../Dialog/Dialog';\nimport { PaginationTexts } from '../Pagination/Pagination';\nimport { ListboxTexts } from '../Listbox/Listbox';\nimport { ToastsTexts } from '../Toast/Toast';\nimport { DatepickerTexts } from '../Datepicker/Datepicker';\nimport { HeaderTexts } from '../Header/Header';\nimport { HangerTexts } from '../Hanger/Hanger';\nimport { SelectTexts } from '../Select/Select';\nimport { TourTexts } from '../Tour/Tour';\nimport { TableTexts } from '../Table/Table';\nimport { Table2Texts } from '../Table2/Table2';\nimport { SearchInputTexts } from '../SearchInput/SearchInput';\nimport { Select2Texts } from '../Select2/Select2';\nimport { BannerTexts } from '../Banner/Banner';\nimport { DrawerTexts } from '../Drawer/Drawer';\n\nexport type LocalizationTexts = {\n /** Localized texts and aria-labels for [Banner](component:banner) component */\n banner: BannerTexts;\n /** Localized texts and aria-labels for [Calendar](component:calendar) component */\n calendar: CalendarTexts;\n /** Localized texts and aria-labels for [Combobox](component:combobox) component */\n combobox: ComboboxTexts;\n /** Localized texts and aria-labels for [DatePicker](component:datepicker) component */\n datepicker: DatepickerTexts;\n /** Localized texts and aria-labels for [Dialog](component:dialog) component */\n dialog: DialogTexts;\n /** Localized texts and aria-labels for [Hanger](component:hanger) component */\n hanger: HangerTexts;\n /** Localized texts and aria-labels for [Header](component:header) component */\n header: HeaderTexts;\n /** Localized texts and aria-labels for [Listbox](component:listbox) component */\n listbox: ListboxTexts;\n /** Localized texts and aria-labels for [Pagination](component:pagination) component */\n pagination: PaginationTexts;\n /** Localized texts and aria-labels for [Table](component:table) component */\n table: TableTexts;\n /** Localized texts and aria-labels for [Table2](component:table2) component */\n table2: Table2Texts;\n /** Localized texts and aria-labels for [SearchInput](component:searchinput) component */\n searchInput: SearchInputTexts;\n /** Localized texts and aria-labels for [Select](component:select) component */\n select: SelectTexts;\n /** Localized texts and aria-labels for [Select2](component:select2) component */\n select2: Select2Texts;\n /** Localized texts and aria-labels for [Toast](component:toast) component */\n toasts: ToastsTexts;\n /** Localized texts and aria-labels for [Tour](component:tour) component */\n tour: TourTexts;\n /** Localized texts and aria-labels for [Drawer](component:drawer) component */\n drawer: DrawerTexts;\n};\n\nexport type Localization = {\n /**\n * Provide the language code used in application.\n * Default value is `en-GB`\n */\n locale: Locale;\n /** Provide the texts and aria-labels for components used within the provider */\n texts: LocalizationTexts;\n /** Provide the formatting */\n formatting: {\n /** Default value is `dd.mm.yy` */\n date: string;\n };\n};\n\nexport const defaultLocalisationTexts = {\n banner: {\n close: 'Close',\n },\n calendar: {\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n actions: {\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n today: 'Today',\n },\n },\n combobox: {\n tooltip: 'Search in list',\n },\n datepicker: {\n calendar: 'Calendar',\n clear: 'Clear',\n expand: 'Show calendar',\n shortcuts: 'Shortcuts',\n },\n dialog: {\n close: 'Close',\n drag: 'Drag',\n },\n hanger: {\n close: 'Close',\n },\n header: {\n addAgreement: 'Add agreement',\n logout: 'Log off',\n more: 'More',\n new: 'New',\n search: 'Search for agreement...',\n },\n listbox: {\n loading: 'Loading results...',\n empty: 'No results found',\n allOption: 'All',\n },\n pagination: {\n label: 'Pagination',\n pageSize: 'Items per page',\n showingXofYofTotal: 'Showing [X] - [Y] of [total]',\n actions: {\n firstPage: 'Goto first page',\n firstPageWithShortcut: 'Goto first page (Home)',\n previousPage: 'Goto previous page',\n previousPageWithShortcut: 'Goto previous page (Page Up)',\n nextPage: 'Goto next page',\n nextPageWithShortcut: 'Goto next page (Page Down)',\n lastPage: 'Goto last page',\n lastPageWithShortcut: 'Goto last page (End)',\n pageX: 'Goto page [X]',\n },\n },\n table: {\n actions: 'Other actions',\n edit: 'Edit (e)',\n copy: 'Copy (c)',\n del: 'Delete (del)',\n newSubRow: 'New row (shift + n)',\n loading: 'Loading...',\n },\n table2: {\n columns: {\n resize: {\n tooltip: 'Resize column',\n },\n actions: {\n tooltip: 'Other actions',\n },\n drag: {\n tooltip: 'Drag row',\n },\n expansion: {\n collapse: 'Collapse row',\n collapseAll: 'Collapse all rows',\n expand: 'Expand row',\n expandAll: 'Expand all rows',\n },\n select: {\n deselect: 'Deselect row',\n deselectAll: 'Deselect all rows',\n select: 'Select row',\n selectAll: 'Select all rows',\n },\n menu: {\n hideColumn: 'Hide column',\n freezeColumns: (count = 1) => (count === 1 ? 'Freeze the first column' : `Freeze first ${count} columns`),\n unfreezeColumns: 'Unfreeze all columns',\n },\n },\n columnSettings: {\n search: 'Search column...',\n tooltip: 'Column settings',\n button: 'Columns',\n noResults: 'No results',\n },\n editing: {\n button: 'Edit',\n tooltip: 'Edit',\n tooltipDisabled: 'There are no visible columns that support editing',\n rowIndicator: {\n rowWillMove: 'Row will move due to sorting',\n rowWillBeHidden: 'Row will hide due to filtering',\n rowWillMoveReasonSearch:\n 'Due to a search filter applied to this table, this row will be hidden as soon as you select another row',\n rowWillMoveReasonFilter:\n \"Due to a filter applied to the column '[COLUMN]', this row will be hidden as soon as you select another row\",\n rowWillMoveReasonSorting:\n \"Due to sorting applied to the column '[COLUMN]', this row will move position as soon as you select another row\",\n },\n },\n filters: {\n button: 'Filters',\n buttons: {\n addNewFilter: 'Add new filter',\n clearFilters: 'Clear all filters',\n },\n comparators: {\n contains: 'Contains',\n doesNotContain: 'Does not contain',\n isEqualTo: 'Is',\n isNotEqualTo: 'Is not',\n isGreaterThan: 'Is greater than',\n isLessThan: 'Is less than',\n isBetween: 'Is between',\n isOneOf: 'Is one of',\n isNoneOf: 'Is none of',\n isAllOf: 'Is all of',\n isEmpty: 'Is empty',\n isNotEmpty: 'Is not empty',\n },\n conditions: {\n and: 'And',\n where: 'Where',\n },\n emptyFilter: {\n condition: 'Condition',\n value: 'Value',\n },\n tooltip: 'Apply filters',\n total: 'Viewing [CURRENT] of [TOTAL]',\n },\n rowDensity: {\n tooltip: 'Row density',\n compact: 'compact',\n normal: 'normal',\n comfortable: 'comfortable',\n spacious: 'spacious',\n },\n search: {\n placeholder: 'Search...',\n },\n shortcuts: {\n tooltip: 'View keyboard shortcuts',\n search: 'Search',\n filter: 'Filter',\n previousRow: 'Previous row',\n nextRow: 'Next row',\n editCell: 'Edit cell',\n previousColumn: 'Previous column',\n nextColumn: 'Next column',\n rowClick: 'Activate current row',\n selectRow: 'Select current row',\n selectAllRows: 'Select all rows',\n expandRow: 'Expand current row',\n collapseRow: 'Collapse current row',\n },\n },\n searchInput: {\n button: 'Search',\n placeholder: 'Search...',\n clear: 'Clear',\n },\n select: {\n allOptionsSelected: 'All',\n },\n select2: {\n allSelect: 'Select all',\n allDeselect: 'Deselect all',\n cancel: 'Cancel',\n chooseColor: 'Pick a color',\n create: 'Create',\n delete: 'Delete',\n save: 'Save',\n search: 'Search...',\n searchOrCreate: 'Search or create...',\n },\n toasts: {\n dismiss: 'Dismiss',\n },\n tour: {\n back: 'Back',\n close: 'Close',\n skip: 'Close and complete',\n last: 'Done',\n next: 'Next',\n open: 'Open',\n },\n drawer: {\n close: 'Close',\n },\n};\n\nexport const defaultLocalizationContext: Localization = {\n locale: 'en-GB',\n texts: defaultLocalisationTexts,\n formatting: {\n date: 'dd.mm.yy',\n },\n};\n\nexport const LocalizationContext = React.createContext<Localization>(defaultLocalizationContext);\nexport interface LocalizationProviderProps {\n children: React.ReactNode;\n localization?: Localization;\n}\nexport const LocalizationProvider: React.FC<LocalizationProviderProps> = ({ localization, children }) => {\n return (\n <LocalizationContext.Provider value={localization ?? defaultLocalizationContext}>{children}</LocalizationContext.Provider>\n );\n};\n\nexport const useLocalization = () => React.useContext(LocalizationContext);\n"],"names":["defaultLocalisationTexts","banner","close","calendar","months","weekdaysShort","weekdays","actions","previousMonth","nextMonth","previousYear","nextYear","today","combobox","tooltip","datepicker","clear","expand","shortcuts","dialog","drag","hanger","header","addAgreement","logout","more","new","search","listbox","loading","empty","allOption","pagination","label","pageSize","showingXofYofTotal","firstPage","firstPageWithShortcut","previousPage","previousPageWithShortcut","nextPage","nextPageWithShortcut","lastPage","lastPageWithShortcut","pageX","table","edit","copy","del","newSubRow","table2","columns","resize","expansion","collapse","collapseAll","expandAll","select","deselect","deselectAll","selectAll","menu","hideColumn","freezeColumns","count","unfreezeColumns","columnSettings","button","noResults","editing","tooltipDisabled","rowIndicator","rowWillMove","rowWillBeHidden","rowWillMoveReasonSearch","rowWillMoveReasonFilter","rowWillMoveReasonSorting","filters","buttons","addNewFilter","clearFilters","comparators","contains","doesNotContain","isEqualTo","isNotEqualTo","isGreaterThan","isLessThan","isBetween","isOneOf","isNoneOf","isAllOf","isEmpty","isNotEmpty","conditions","and","where","emptyFilter","condition","value","total","rowDensity","compact","normal","comfortable","spacious","placeholder","filter","previousRow","nextRow","editCell","previousColumn","nextColumn","rowClick","selectRow","selectAllRows","expandRow","collapseRow","searchInput","allOptionsSelected","select2","allSelect","allDeselect","cancel","chooseColor","create","delete","save","searchOrCreate","toasts","dismiss","tour","back","skip","last","next","open","drawer","defaultLocalizationContext","locale","texts","formatting","date","LocalizationContext","React","LocalizationProvider","localization","children","Provider","useLocalization"],"mappings":";;MAwEaA,wBAAwB,GAAG;EACpCC,MAAM,EAAE;IACJC,KAAK,EAAE;GACV;EACDC,QAAQ,EAAE;IACNC,MAAM,EAAE,CACJ,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,CACb;IACDC,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IAChEC,QAAQ,EAAE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MAAM,EAAE,QAAQ;IAChBC,WAAW,EAAE,cAAc;IAC3BC,MAAM,EAAE,QAAQ;IAChBC,MAAM,EAAE,QAAQ;IAChBC,IAAI,EAAE,MAAM;IACZpG,MAAM,EAAE,WAAW;IACnBqG,cAAc,EAAE;GACnB;EACDC,MAAM,EAAE;IACJC,OAAO,EAAE;GACZ;EACDC,IAAI,EAAE;IACFC,IAAI,EAAE,MAAM;IACZlI,KAAK,EAAE,OAAO;IACdmI,IAAI,EAAE,oBAAoB;IAC1BC,IAAI,EAAE,MAAM;IACZC,IAAI,EAAE,MAAM;IACZC,IAAI,EAAE;GACT;EACDC,MAAM,EAAE;IACJvI,KAAK,EAAE;;;MAIFwI,0BAA0B,GAAiB;EACpDC,MAAM,EAAE,OAAO;EACfC,KAAK,EAAE5I,wBAAwB;EAC/B6I,UAAU,EAAE;IACRC,IAAI,EAAE;;;MAIDC,mBAAmB,gBAAGC,aAAmB,CAAeN,0BAA0B;MAKlFO,oBAAoB,GAAwC,CAAC;EAAEC,YAAY;EAAEC;CAAU;EAChG,oBACIH,cAACD,mBAAmB,CAACK,QAAQ;IAACjD,KAAK,EAAE+C,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAIR;KAA6BS,QAAQ,CAAgC;AAElI;MAEaE,eAAe,GAAG,MAAML,UAAgB,CAACD,mBAAmB;;;;"}
@@ -10,7 +10,7 @@ const replaceWithShortform = key => {
10
10
  case ' ':
11
11
  return '␣';
12
12
  default:
13
- return key;
13
+ return String(key).toLocaleUpperCase();
14
14
  }
15
15
  };
16
16
  const getShortcutText = key => {
@@ -1 +1 @@
1
- {"version":3,"file":"Shortcut.js","sources":["../../../../../../../src/components/Shortcut/Shortcut.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { isMacOs, KeyDownHandlerOptions } from '../../utils/keyboard';\n\nconst replaceWithShortform = (key: string) => {\n switch (key) {\n case 'Delete':\n return 'Del';\n\n case 'Space':\n case ' ':\n return '␣';\n\n default:\n return key;\n }\n};\n\nconst getShortcutText = (key: string | KeyDownHandlerOptions) => {\n if (!key) {\n return [];\n }\n\n if (typeof key === 'string') {\n return [replaceWithShortform(key)];\n }\n\n const keys: string[] = [];\n\n if (key.shift) {\n keys.push(isMacOs() ? '⇧' : 'Shift');\n }\n\n if (key.meta) {\n keys.push(isMacOs() ? '⌘' : 'Ctrl');\n }\n\n keys.push(replaceWithShortform(key.key));\n\n return keys;\n};\n\nexport type ShortcutProps = Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> & {\n keys: string | KeyDownHandlerOptions;\n};\n\nexport const Shortcut = ({ keys, ...props }: ShortcutProps) => {\n const className = cn('inline-flex gap-0.5', props.className);\n const texts = getShortcutText(keys);\n\n return (\n <span {...props} className={className}>\n {texts.map(key => (\n <kbd key={key} className=\"font-display bg-grey-300/[0.25] rounded px-1 text-center\">\n {key}\n </kbd>\n ))}\n </span>\n );\n};\n"],"names":["replaceWithShortform","key","getShortcutText","keys","shift","push","isMacOs","meta","Shortcut","props","className","cn","texts","React","map"],"mappings":";;;;AAIA,MAAMA,oBAAoB,GAAIC,GAAW;EACrC,QAAQA,GAAG;IACP,KAAK,QAAQ;MACT,OAAO,KAAK;IAEhB,KAAK,OAAO;IACZ,KAAK,GAAG;MACJ,OAAO,GAAG;IAEd;MACI,OAAOA,GAAG;;AAEtB,CAAC;AAED,MAAMC,eAAe,GAAID,GAAmC;EACxD,IAAI,CAACA,GAAG,EAAE;IACN,OAAO,EAAE;;EAGb,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE;IACzB,OAAO,CAACD,oBAAoB,CAACC,GAAG,CAAC,CAAC;;EAGtC,MAAME,IAAI,GAAa,EAAE;EAEzB,IAAIF,GAAG,CAACG,KAAK,EAAE;IACXD,IAAI,CAACE,IAAI,CAACC,OAAO,EAAE,GAAG,GAAG,GAAG,OAAO,CAAC;;EAGxC,IAAIL,GAAG,CAACM,IAAI,EAAE;IACVJ,IAAI,CAACE,IAAI,CAACC,OAAO,EAAE,GAAG,GAAG,GAAG,MAAM,CAAC;;EAGvCH,IAAI,CAACE,IAAI,CAACL,oBAAoB,CAACC,GAAG,CAACA,GAAG,CAAC,CAAC;EAExC,OAAOE,IAAI;AACf,CAAC;MAMYK,QAAQ,GAAG,CAAC;EAAEL,IAAI;EAAE,GAAGM;CAAsB;EACtD,MAAMC,SAAS,GAAGC,EAAE,CAAC,qBAAqB,EAAEF,KAAK,CAACC,SAAS,CAAC;EAC5D,MAAME,KAAK,GAAGV,eAAe,CAACC,IAAI,CAAC;EAEnC,oBACIU,uDAAUJ,KAAK;IAAEC,SAAS,EAAEA;MACvBE,KAAK,CAACE,GAAG,CAACb,GAAG,iBACVY;IAAKZ,GAAG,EAAEA,GAAG;IAAES,SAAS,EAAC;KACpBT,GAAG,CAEX,CAAC,CACC;AAEf;;;;"}
1
+ {"version":3,"file":"Shortcut.js","sources":["../../../../../../../src/components/Shortcut/Shortcut.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { isMacOs, KeyDownHandlerOptions } from '../../utils/keyboard';\n\nconst replaceWithShortform = (key: string) => {\n switch (key) {\n case 'Delete':\n return 'Del';\n\n case 'Space':\n case ' ':\n return '␣';\n\n default:\n return String(key).toLocaleUpperCase();\n }\n};\n\nconst getShortcutText = (key: string | KeyDownHandlerOptions) => {\n if (!key) {\n return [];\n }\n\n if (typeof key === 'string') {\n return [replaceWithShortform(key)];\n }\n\n const keys: string[] = [];\n\n if (key.shift) {\n keys.push(isMacOs() ? '⇧' : 'Shift');\n }\n\n if (key.meta) {\n keys.push(isMacOs() ? '⌘' : 'Ctrl');\n }\n\n keys.push(replaceWithShortform(key.key));\n\n return keys;\n};\n\nexport type ShortcutProps = Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> & {\n keys: string | KeyDownHandlerOptions;\n};\n\nexport const Shortcut = ({ keys, ...props }: ShortcutProps) => {\n const className = cn('inline-flex gap-0.5', props.className);\n const texts = getShortcutText(keys);\n\n return (\n <span {...props} className={className}>\n {texts.map(key => (\n <kbd key={key} className=\"font-display bg-grey-300/[0.25] rounded px-1 text-center\">\n {key}\n </kbd>\n ))}\n </span>\n );\n};\n"],"names":["replaceWithShortform","key","String","toLocaleUpperCase","getShortcutText","keys","shift","push","isMacOs","meta","Shortcut","props","className","cn","texts","React","map"],"mappings":";;;;AAIA,MAAMA,oBAAoB,GAAIC,GAAW;EACrC,QAAQA,GAAG;IACP,KAAK,QAAQ;MACT,OAAO,KAAK;IAEhB,KAAK,OAAO;IACZ,KAAK,GAAG;MACJ,OAAO,GAAG;IAEd;MACI,OAAOC,MAAM,CAACD,GAAG,CAAC,CAACE,iBAAiB,EAAE;;AAElD,CAAC;AAED,MAAMC,eAAe,GAAIH,GAAmC;EACxD,IAAI,CAACA,GAAG,EAAE;IACN,OAAO,EAAE;;EAGb,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE;IACzB,OAAO,CAACD,oBAAoB,CAACC,GAAG,CAAC,CAAC;;EAGtC,MAAMI,IAAI,GAAa,EAAE;EAEzB,IAAIJ,GAAG,CAACK,KAAK,EAAE;IACXD,IAAI,CAACE,IAAI,CAACC,OAAO,EAAE,GAAG,GAAG,GAAG,OAAO,CAAC;;EAGxC,IAAIP,GAAG,CAACQ,IAAI,EAAE;IACVJ,IAAI,CAACE,IAAI,CAACC,OAAO,EAAE,GAAG,GAAG,GAAG,MAAM,CAAC;;EAGvCH,IAAI,CAACE,IAAI,CAACP,oBAAoB,CAACC,GAAG,CAACA,GAAG,CAAC,CAAC;EAExC,OAAOI,IAAI;AACf,CAAC;MAMYK,QAAQ,GAAG,CAAC;EAAEL,IAAI;EAAE,GAAGM;CAAsB;EACtD,MAAMC,SAAS,GAAGC,EAAE,CAAC,qBAAqB,EAAEF,KAAK,CAACC,SAAS,CAAC;EAC5D,MAAME,KAAK,GAAGV,eAAe,CAACC,IAAI,CAAC;EAEnC,oBACIU,uDAAUJ,KAAK;IAAEC,SAAS,EAAEA;MACvBE,KAAK,CAACE,GAAG,CAACf,GAAG,iBACVc;IAAKd,GAAG,EAAEA,GAAG;IAAEW,SAAS,EAAC;KACpBX,GAAG,CAEX,CAAC,CACC;AAEf;;;;"}
@@ -57,7 +57,8 @@ const BaseTable2 = /*#__PURE__*/React__default.forwardRef(function BaseTable2(pr
57
57
  resetFiltering: () => table.resetColumnFilters(),
58
58
  resetRowExpansion: () => table.resetExpanded(),
59
59
  resetRowSelection: () => table.resetRowSelection(),
60
- resetSorting: () => table.resetSorting()
60
+ resetSorting: () => table.resetSorting(),
61
+ toggleEditing: () => meta.editMode.toggleEditing()
61
62
  };
62
63
  }
63
64
  }, [table, tableRef.current]);
@@ -1 +1 @@
1
- {"version":3,"file":"Table2.js","sources":["../../../../../../../src/components/Table2/Table2.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Row as TRow, TableMeta } from '@tanstack/react-table';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { Cell } from './components/column/Cell';\nimport { Header } from './components/column/Header';\nimport { Footer } from './components/column/Footer';\nimport { Table2Props, Table2ColumnProps } from './types';\nimport { useTable } from './hooks/useTable';\nimport { useVirtualiser } from './hooks/useVirtualiser';\nimport { Group } from '../Group/Group';\nimport { useGridTemplate } from './hooks/useGridTemplate';\nimport { RowDensityButton } from './components/RowDensityButton';\nimport { ColumnSettingsButton } from './components/ColumnSettingsButton';\nimport { ExpandedRow } from './components/row/ExpandedRow';\nimport { BatchActionsMenu } from './components/BatchActionsMenu';\nimport { Row } from './components/row/Row';\nimport { FiltersButton } from './components/filters/FiltersButton';\nimport { Search } from './components/Search';\nimport { EditModeButton } from './components/EditModeButton';\n\nexport type Table2Texts = {\n columns: {\n resize: {\n tooltip: string;\n };\n actions: {\n tooltip: string;\n };\n drag: {\n tooltip: string;\n };\n expansion: {\n collapse: string;\n collapseAll: string;\n expand: string;\n expandAll: string;\n };\n select: {\n deselect: string;\n deselectAll: string;\n select: string;\n selectAll: string;\n };\n menu: {\n hideColumn: string;\n freezeColumns: (count: number) => string;\n unfreezeColumns: string;\n };\n };\n columnSettings: {\n search: string;\n tooltip: string;\n button: string;\n noResults: string;\n };\n editing: {\n button: string;\n tooltip: string;\n tooltipDisabled: string;\n rowIndicator: {\n rowWillMove: string;\n rowWillBeHidden: string;\n rowWillMoveReasonSearch: string;\n rowWillMoveReasonFilter: string;\n rowWillMoveReasonSorting: string;\n };\n };\n filters: {\n button: string;\n buttons: {\n addFilter: string;\n clearFilters: string;\n };\n comparators: {\n contains: string;\n doesNotContain: string;\n isEqualTo: string;\n isNotEqualTo: string;\n isGreaterThan: string;\n isLessThan: string;\n isBetween: string;\n isOneOf: string;\n isNoneOf: string;\n isAllOf: string;\n isEmpty: string;\n isNotEmpty: string;\n };\n tooltip: string;\n total: string;\n };\n rowDensity: {\n tooltip: string;\n compact: string;\n normal: string;\n comfortable: string;\n spacious: string;\n };\n search: {\n placeholder: string;\n };\n shortcuts: {\n tooltip: string;\n search: string;\n filter: string;\n previousRow: string;\n nextRow: string;\n editCell: string;\n previousColumn: string;\n nextColumn: string;\n rowClick: string;\n selectRow: string;\n selectAllRows: string;\n expandRow: string;\n collapseRow: string;\n };\n};\n\nfunction Column<TType = any>(_: Table2ColumnProps<TType>) {\n return null;\n}\nColumn.displayName = 'Table2Column';\n\nexport type Table2Ref = HTMLDivElement & {\n instance: {\n resetFiltering: () => void;\n resetRowExpansion: () => void;\n resetRowSelection: () => void;\n resetSorting: () => void;\n };\n};\n\nconst BaseTable2 = React.forwardRef(function BaseTable2<TType = any>(props: Table2Props<TType>, ref: React.Ref<Table2Ref>) {\n // dom\n const {\n emptyState: EmptyState,\n expandedRowRenderer,\n length = props.data.length,\n loadMore,\n onRowClick,\n onRowDrop,\n toolbarLeft,\n toolbarRight,\n _experimentalActionsForTable,\n _experimentalActionsForTableSummary,\n } = props;\n const tableRef = useMergedRef<Table2Ref>(ref);\n const timeoutIdRef = React.useRef<NodeJS.Timeout>();\n const prevScrollY = React.useRef<number>(0);\n\n // react-table\n const { rows, table, footers } = useTable(props.children, props, tableRef);\n const meta = table.options.meta as TableMeta<TType>;\n\n const { columnVisibility, columnOrder, globalFilter } = table.getState();\n\n React.useEffect(() => {\n if (tableRef.current) {\n tableRef.current.instance = {\n resetFiltering: () => table.resetColumnFilters(),\n resetRowExpansion: () => table.resetExpanded(),\n resetRowSelection: () => table.resetRowSelection(),\n resetSorting: () => table.resetSorting(),\n };\n }\n }, [table, tableRef.current]);\n\n // If column visibility or order changes then we turn off the edit mode so that control indexes gets computed\n // when user turns on the editing mode again. This is a temporary solution to make sure the keyboard navigation\n // still keeps working on changes in column visibility, order, or both\n React.useEffect(() => {\n meta.resetFocussableColumnIndexes();\n }, [columnVisibility, columnOrder]);\n\n React.useEffect(() => {\n // Whenever edit mode is turned off we reset the focussableColumnIndexes ref to an empty array so that\n // we don't have stale values, in case column visibility or ordering changes\n if (!meta.editMode.isEditing) {\n meta.resetFocussableColumnIndexes();\n }\n }, [meta.editMode.isEditing]);\n\n React.useEffect(() => {\n return () => clearTimeout(timeoutIdRef.current);\n }, []);\n\n // virtualiser\n const { virtualiser, virtualiserOffsets, setExpandedRowSizes } = useVirtualiser({ rows, table }, tableRef);\n\n // css grid\n const gridTemplateColumns = useGridTemplate(table);\n\n // handlers\n const editButtonRef = React.useRef(null);\n\n // support grid like keyboard navigation between cells\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (document.activeElement === tableRef.current) {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(0);\n virtualiser.scrollToOffset(0);\n } else {\n meta.moveToPreviousRow(rows, nextIndex => {\n meta.setShouldPauseHoverState(true);\n virtualiser.scrollToIndex(nextIndex - 1);\n });\n }\n\n return;\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(rows.length - 1);\n virtualiser.scrollToOffset(virtualiser.totalSize + 1);\n } else {\n meta.moveToNextRow(rows, nextIndex => {\n meta.setShouldPauseHoverState(true);\n\n // the virtualiser doesn't always scroll right to the bottom for the last row\n if (nextIndex === rows.length - 1) {\n tableRef.current?.scrollTo(0, tableRef.current.scrollHeight);\n } else {\n virtualiser.scrollToIndex(nextIndex + 2);\n }\n });\n }\n\n return;\n }\n\n const canToggleRowExpansion = table.options.enableExpanding;\n\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta.activeRowIndex]?.toggleExpanded(false);\n }\n }\n return;\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta?.activeRowIndex]?.toggleExpanded(true);\n }\n }\n\n return;\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (onRowClick) {\n onRowClick(rows[meta?.activeRowIndex].original);\n }\n\n return;\n }\n\n if (event.key === ' ') {\n event.preventDefault();\n\n if (table.options.enableRowSelection) {\n rows[meta.activeRowIndex]?.toggleSelected();\n }\n\n return;\n }\n\n if (event.ctrlKey || event.metaKey) {\n if (event.key === 'a' && table.options.enableRowSelection) {\n event.preventDefault();\n table.toggleAllRowsSelected();\n }\n\n return;\n }\n }\n };\n\n let handleBlur;\n\n if (meta.editMode.isEditing) {\n handleBlur = (event: React.FocusEvent) => {\n let elementGainingFocus = event.relatedTarget;\n\n if (elementGainingFocus === undefined) {\n return;\n }\n\n // we might be focusing on a select or a popover that was triggered from inside the table\n // so see if the element gaining focus is inside a portal and look up its controller\n const portalId = elementGainingFocus?.closest('[data-radix-popper-content-wrapper] > :first-child')?.id;\n\n if (portalId) {\n elementGainingFocus = event.currentTarget.querySelector(`[aria-controls=\"${portalId}\"]`) ?? event.relatedTarget;\n }\n\n if (!event.currentTarget?.contains(elementGainingFocus) && elementGainingFocus !== editButtonRef.current) {\n // When we call manually blur on control component while navigating to the next cell, then when this\n // handler is run, the related target is not the next control component and active element is null,\n // that's why we explictly need to check what's the next focussed element in order to figure out whether\n // we should disabled the sorting or not.\n timeoutIdRef.current = setTimeout(() => {\n const parentRow = event.target.closest('[role=\"row\"]');\n const isNewFocussedElementInSameRow = parentRow?.contains(document.activeElement);\n\n // When we manually call blur on control component and focus another component then\n // we have to make sure we\n if (meta.shouldPauseSortingAndFiltering && !isNewFocussedElementInSameRow) {\n // if client side - unpause sorting\n meta.setShouldPauseSortingAndFiltering(false);\n }\n });\n }\n };\n }\n\n // TODO: this can probably be extracted into a hook\n // we only show the pinned shadow on display columns when scrolling is active\n const [scrolled, setScrolled] = React.useState(false);\n\n // extract - infinite loading\n const loadingRef = React.useRef(false);\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !scrolled) {\n setScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && scrolled) {\n setScrolled(false);\n } else if (typeof loadMore === 'function') {\n const scrollY = event.currentTarget.scrollTop;\n const isScrollingDown = scrollY > prevScrollY.current;\n prevScrollY.current = scrollY;\n\n const scrolledPercentage = Math.round(\n (scrollY / (event.currentTarget.scrollHeight - event.currentTarget.clientHeight)) * 100\n );\n\n if (isScrollingDown && !loadingRef.current && scrolledPercentage >= 80) {\n try {\n const isAllRowsSelected = table.getIsAllRowsSelected();\n loadingRef.current = true;\n await loadMore();\n\n if (isAllRowsSelected) {\n table.toggleAllRowsSelected(true);\n }\n } catch (error) {\n console.error(error);\n } finally {\n loadingRef.current = false;\n }\n }\n }\n };\n\n let handleMouseLeave;\n\n if (meta.shouldPauseHoverState) {\n // sometimes the row's onMouseLeave doesn't trigger, this adds some extra redundancy\n handleMouseLeave = () => meta.setShouldPauseHoverState(false);\n }\n\n const className = cn(\n 'bg-white border border-grey-300 focus:yt-focus focus:border-blue-500 grid auto-rows-max overflow-auto relative rounded group',\n props.className\n );\n\n const enableSettingsButton = table.options.enableHiding || meta.enableColumnReordering;\n const hasInternalToolbar =\n enableSettingsButton ||\n meta.editMode.enableEditMode ||\n table.options.enableColumnFilters ||\n meta.enableRowDensity ||\n table.options.enableGlobalFilter;\n const hasToolbar = hasInternalToolbar || !!toolbarLeft || !toolbarRight;\n\n const hasFooters = React.useMemo(() => {\n const summaryIds = Object.keys(footers);\n const visibleIds = Object.keys(columnVisibility).filter(c => !columnVisibility[c]);\n return summaryIds.length && summaryIds.some(v => !visibleIds.includes(v));\n }, [footers, columnVisibility]);\n\n return (\n <div className=\"-m-0.5 flex h-full w-[calc(100%_+_0.25rem)] flex-col gap-4 overflow-hidden p-0.5\">\n {hasToolbar ? (\n <div className=\"flex flex-wrap gap-2\">\n {toolbarLeft}\n {hasInternalToolbar ? (\n <Group className=\"ml-auto flex-shrink-0 print:hidden\">\n {meta.editMode.enableEditMode ? (\n <EditModeButton\n ref={editButtonRef}\n table={table}\n tableRef={tableRef}\n scrollToIndex={virtualiser.scrollToIndex}\n />\n ) : null}\n {table.options.enableColumnFilters ? <FiltersButton length={length} table={table} /> : null}\n {toolbarRight}\n {meta.enableRowDensity ? <RowDensityButton table={table} /> : null}\n {enableSettingsButton ? <ColumnSettingsButton table={table} /> : null}\n {table.options.enableGlobalFilter ? (\n <Search\n disabled={meta.shouldDisableTableActions}\n onSearch={table.setGlobalFilter}\n value={globalFilter}\n />\n ) : null}\n </Group>\n ) : null}\n {/*<ShortcutsGuideButton table={table} />*/}\n </div>\n ) : null}\n <div\n className={className}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onMouseLeave={handleMouseLeave}\n onScroll={handleScroll}\n ref={tableRef}\n role=\"table\"\n style={{\n gridTemplateColumns,\n gridTemplateRows: rows.length ? undefined : '40px',\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 tabIndex={0}>\n <div className=\"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, columnIndex) => (\n <Header\n key={header.id}\n header={header}\n index={columnIndex}\n isLastColumn={columnIndex === headerGroup.headers.length - 1}\n scrolled={scrolled}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </div>\n ))}\n </div>\n {rows.length ? (\n <div className=\"contents\" data-taco=\"table2-body\" role=\"rowgroup\">\n {virtualiserOffsets.top ? (\n <div style={{ height: virtualiserOffsets.top }} className=\"col-span-full\" />\n ) : null}\n {virtualiser.virtualItems.map(virtualRow => {\n const row = rows[virtualRow.index];\n\n return (\n <React.Fragment key={row.id}>\n <Row\n className=\"group/row contents\"\n onRowDrop={onRowDrop}\n row={row}\n rowIndex={virtualRow.index}\n table={table}>\n {row.getVisibleCells().map((cell, columnIndex) => (\n <Cell\n cell={cell}\n key={`${cell.id}_${cell.getValue()}`}\n index={columnIndex}\n isLastRow={virtualRow.index === rows.length - 1}\n rows={rows}\n rowIndex={virtualRow.index}\n scrolled={scrolled}\n scrollToIndex={virtualiser.scrollToIndex}\n scrollToOffset={virtualiser.scrollToOffset}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </Row>\n {row.getIsExpanded() && expandedRowRenderer ? (\n <ExpandedRow index={virtualRow.index} setSize={setExpandedRowSizes}>\n {expandedRowRenderer(row.original)?.()}\n </ExpandedRow>\n ) : null}\n </React.Fragment>\n );\n })}\n {virtualiserOffsets.bottom ? (\n <div style={{ height: virtualiserOffsets.bottom }} className=\"col-span-full\" />\n ) : null}\n </div>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n {hasFooters ? (\n <div role=\"rowgroup\" className=\"contents\" data-taco=\"table2-footer\">\n {table.getFooterGroups().map(footerGroup => (\n <div key={footerGroup.id} role=\"row\" className=\"contents\">\n {footerGroup.headers.map((footer, cellIndex) => (\n <Footer key={footer.id} footer={footer} index={cellIndex} scrolled={scrolled} table={table}>\n {footers[footer.id]\n ? footers[footer.id](rows.map((row: TRow<TType>) => row.original[footer.id]))\n : null}\n </Footer>\n ))}\n </div>\n ))}\n </div>\n ) : null}\n </div>\n {!!_experimentalActionsForTable &&\n table.options.enableRowSelection &&\n (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) ? (\n <BatchActionsMenu<TType>\n className=\"fixed-center-x bottom-0 z-50 mb-4 print:hidden\"\n actionsForTable={_experimentalActionsForTable}\n summary={_experimentalActionsForTableSummary}\n table={table}\n />\n ) : null}\n </div>\n );\n}) as React.ForwardRefExoticComponent<Table2Props<any>> &\n (<TType>(props: Table2Props<TType> & { ref?: React.Ref<Table2Ref> }) => JSX.Element);\n\nexport type ForwardedTable2WithStatics = React.ForwardRefExoticComponent<Table2Props<any>> & {\n Column: <TType>(props: Table2ColumnProps<TType>) => JSX.Element | null;\n} & (<TType>(props: Table2Props<TType> & { ref?: React.Ref<Table2Ref> }) => JSX.Element);\n\nconst Table2 = React.forwardRef(function Table2<TType = any>(props: Table2Props<TType>, ref: React.Ref<Table2Ref>) {\n const key = React.useMemo(() => String('tableKey_' + String(props.children)), [props.children]);\n return <BaseTable2 {...props} key={key} ref={ref} />;\n}) as ForwardedTable2WithStatics;\n\nTable2.Column = Column;\n\nexport { Table2 };\nexport type { Table2Props };\nexport type { Table2ColumnProps, Table2ActionProps, Table2RowActionRenderer, Table2Settings } from './types';\n"],"names":["Column","_","displayName","BaseTable2","React","forwardRef","props","ref","emptyState","EmptyState","expandedRowRenderer","length","data","loadMore","onRowClick","onRowDrop","toolbarLeft","toolbarRight","_experimentalActionsForTable","_experimentalActionsForTableSummary","tableRef","useMergedRef","timeoutIdRef","useRef","prevScrollY","rows","table","footers","useTable","children","meta","options","columnVisibility","columnOrder","globalFilter","getState","useEffect","current","instance","resetFiltering","resetColumnFilters","resetRowExpansion","resetExpanded","resetRowSelection","resetSorting","resetFocussableColumnIndexes","editMode","isEditing","clearTimeout","virtualiser","virtualiserOffsets","setExpandedRowSizes","useVirtualiser","gridTemplateColumns","useGridTemplate","editButtonRef","handleKeyDown","event","document","activeElement","key","preventDefault","ctrlKey","metaKey","setActiveRowIndex","scrollToOffset","moveToPreviousRow","nextIndex","setShouldPauseHoverState","scrollToIndex","totalSize","moveToNextRow","scrollTo","scrollHeight","canToggleRowExpansion","enableExpanding","activeRowIndex","toggleExpanded","original","enableRowSelection","toggleSelected","toggleAllRowsSelected","handleBlur","elementGainingFocus","relatedTarget","undefined","portalId","closest","id","currentTarget","querySelector","contains","setTimeout","parentRow","target","isNewFocussedElementInSameRow","shouldPauseSortingAndFiltering","setShouldPauseSortingAndFiltering","scrolled","setScrolled","useState","loadingRef","handleScroll","scrollLeft","scrollY","scrollTop","isScrollingDown","scrolledPercentage","Math","round","clientHeight","isAllRowsSelected","getIsAllRowsSelected","error","console","handleMouseLeave","shouldPauseHoverState","className","cn","enableSettingsButton","enableHiding","enableColumnReordering","hasInternalToolbar","enableEditMode","enableColumnFilters","enableRowDensity","enableGlobalFilter","hasToolbar","hasFooters","useMemo","summaryIds","Object","keys","visibleIds","filter","c","some","v","includes","Group","EditModeButton","FiltersButton","RowDensityButton","ColumnSettingsButton","Search","disabled","shouldDisableTableActions","onSearch","setGlobalFilter","value","onBlur","onKeyDown","onMouseLeave","onScroll","role","style","gridTemplateRows","opacity","tabIndex","getHeaderGroups","map","headerGroup","headers","header","columnIndex","Header","index","isLastColumn","top","height","virtualItems","virtualRow","row","Fragment","Row","rowIndex","getVisibleCells","cell","Cell","getValue","isLastRow","getIsExpanded","ExpandedRow","setSize","bottom","getFooterGroups","footerGroup","footer","cellIndex","Footer","getIsSomeRowsSelected","BatchActionsMenu","actionsForTable","summary","Table2","String"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsHA,SAASA,MAAM,CAAcC,CAA2B;EACpD,OAAO,IAAI;AACf;AACAD,MAAM,CAACE,WAAW,GAAG,cAAc;AAWnC,MAAMC,UAAU,gBAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,UAAU,C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gBAAG9L,cAAK,CAACC,UAAU,CAAC,SAAS6L,MAAM,CAAc5L,KAAyB,EAAEC,GAAyB;EAC7G,MAAMqD,GAAG,GAAGxD,cAAK,CAAC6H,OAAO,CAAC,MAAMkE,MAAM,CAAC,WAAW,GAAGA,MAAM,CAAC7L,KAAK,CAACuB,QAAQ,CAAC,CAAC,EAAE,CAACvB,KAAK,CAACuB,QAAQ,CAAC,CAAC;EAC/F,oBAAOzB,6BAACD,UAAU,oBAAKG,KAAK;IAAEsD,GAAG,EAAEA,GAAG;IAAErD,GAAG,EAAEA;KAAO;AACxD,CAAC;AAED2L,MAAM,CAAClM,MAAM,GAAGA,MAAM;;;;"}
1
+ {"version":3,"file":"Table2.js","sources":["../../../../../../../src/components/Table2/Table2.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Row as TRow, TableMeta } from '@tanstack/react-table';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { Cell } from './components/column/Cell';\nimport { Header } from './components/column/Header';\nimport { Footer } from './components/column/Footer';\nimport { Table2Props, Table2ColumnProps } from './types';\nimport { useTable } from './hooks/useTable';\nimport { useVirtualiser } from './hooks/useVirtualiser';\nimport { Group } from '../Group/Group';\nimport { useGridTemplate } from './hooks/useGridTemplate';\nimport { RowDensityButton } from './components/RowDensityButton';\nimport { ColumnSettingsButton } from './components/ColumnSettingsButton';\nimport { ExpandedRow } from './components/row/ExpandedRow';\nimport { BatchActionsMenu } from './components/BatchActionsMenu';\nimport { Row } from './components/row/Row';\nimport { FiltersButton } from './components/filters/FiltersButton';\nimport { Search } from './components/Search';\nimport { EditModeButton } from './components/EditModeButton';\n\nexport type Table2Texts = {\n columns: {\n resize: {\n tooltip: string;\n };\n actions: {\n tooltip: string;\n };\n drag: {\n tooltip: string;\n };\n expansion: {\n collapse: string;\n collapseAll: string;\n expand: string;\n expandAll: string;\n };\n select: {\n deselect: string;\n deselectAll: string;\n select: string;\n selectAll: string;\n };\n menu: {\n hideColumn: string;\n freezeColumns: (count: number) => string;\n unfreezeColumns: string;\n };\n };\n columnSettings: {\n search: string;\n tooltip: string;\n button: string;\n noResults: string;\n };\n editing: {\n button: string;\n tooltip: string;\n tooltipDisabled: string;\n rowIndicator: {\n rowWillMove: string;\n rowWillBeHidden: string;\n rowWillMoveReasonSearch: string;\n rowWillMoveReasonFilter: string;\n rowWillMoveReasonSorting: string;\n };\n };\n filters: {\n button: string;\n buttons: {\n addNewFilter: string;\n clearFilters: string;\n };\n comparators: {\n contains: string;\n doesNotContain: string;\n isEqualTo: string;\n isNotEqualTo: string;\n isGreaterThan: string;\n isLessThan: string;\n isBetween: string;\n isOneOf: string;\n isNoneOf: string;\n isAllOf: string;\n isEmpty: string;\n isNotEmpty: string;\n };\n conditions: {\n and: string;\n where: string;\n };\n emptyFilter: {\n condition: string;\n value: string;\n };\n tooltip: string;\n total: string;\n };\n rowDensity: {\n tooltip: string;\n compact: string;\n normal: string;\n comfortable: string;\n spacious: string;\n };\n search: {\n placeholder: string;\n };\n shortcuts: {\n tooltip: string;\n search: string;\n filter: string;\n previousRow: string;\n nextRow: string;\n editCell: string;\n previousColumn: string;\n nextColumn: string;\n rowClick: string;\n selectRow: string;\n selectAllRows: string;\n expandRow: string;\n collapseRow: string;\n };\n};\n\nfunction Column<TType = any>(_: Table2ColumnProps<TType>) {\n return null;\n}\nColumn.displayName = 'Table2Column';\n\nexport type Table2Ref = HTMLDivElement & {\n instance: {\n resetFiltering: () => void;\n resetRowExpansion: () => void;\n resetRowSelection: () => void;\n resetSorting: () => void;\n toggleEditing: () => void;\n };\n};\n\nconst BaseTable2 = React.forwardRef(function BaseTable2<TType = any>(props: Table2Props<TType>, ref: React.Ref<Table2Ref>) {\n // dom\n const {\n emptyState: EmptyState,\n expandedRowRenderer,\n length = props.data.length,\n loadMore,\n onRowClick,\n onRowDrop,\n toolbarLeft,\n toolbarRight,\n _experimentalActionsForTable,\n _experimentalActionsForTableSummary,\n } = props;\n const tableRef = useMergedRef<Table2Ref>(ref);\n const timeoutIdRef = React.useRef<NodeJS.Timeout>();\n const prevScrollY = React.useRef<number>(0);\n\n // react-table\n const { rows, table, footers } = useTable(props.children, props, tableRef);\n const meta = table.options.meta as TableMeta<TType>;\n\n const { columnVisibility, columnOrder, globalFilter } = table.getState();\n\n React.useEffect(() => {\n if (tableRef.current) {\n tableRef.current.instance = {\n resetFiltering: () => table.resetColumnFilters(),\n resetRowExpansion: () => table.resetExpanded(),\n resetRowSelection: () => table.resetRowSelection(),\n resetSorting: () => table.resetSorting(),\n toggleEditing: () => meta.editMode.toggleEditing(),\n };\n }\n }, [table, tableRef.current]);\n\n // If column visibility or order changes then we turn off the edit mode so that control indexes gets computed\n // when user turns on the editing mode again. This is a temporary solution to make sure the keyboard navigation\n // still keeps working on changes in column visibility, order, or both\n React.useEffect(() => {\n meta.resetFocussableColumnIndexes();\n }, [columnVisibility, columnOrder]);\n\n React.useEffect(() => {\n // Whenever edit mode is turned off we reset the focussableColumnIndexes ref to an empty array so that\n // we don't have stale values, in case column visibility or ordering changes\n if (!meta.editMode.isEditing) {\n meta.resetFocussableColumnIndexes();\n }\n }, [meta.editMode.isEditing]);\n\n React.useEffect(() => {\n return () => clearTimeout(timeoutIdRef.current);\n }, []);\n\n // virtualiser\n const { virtualiser, virtualiserOffsets, setExpandedRowSizes } = useVirtualiser({ rows, table }, tableRef);\n\n // css grid\n const gridTemplateColumns = useGridTemplate(table);\n\n // handlers\n const editButtonRef = React.useRef(null);\n\n // support grid like keyboard navigation between cells\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (document.activeElement === tableRef.current) {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(0);\n virtualiser.scrollToOffset(0);\n } else {\n meta.moveToPreviousRow(rows, nextIndex => {\n meta.setShouldPauseHoverState(true);\n virtualiser.scrollToIndex(nextIndex - 1);\n });\n }\n\n return;\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n meta.setActiveRowIndex(rows.length - 1);\n virtualiser.scrollToOffset(virtualiser.totalSize + 1);\n } else {\n meta.moveToNextRow(rows, nextIndex => {\n meta.setShouldPauseHoverState(true);\n\n // the virtualiser doesn't always scroll right to the bottom for the last row\n if (nextIndex === rows.length - 1) {\n tableRef.current?.scrollTo(0, tableRef.current.scrollHeight);\n } else {\n virtualiser.scrollToIndex(nextIndex + 2);\n }\n });\n }\n\n return;\n }\n\n const canToggleRowExpansion = table.options.enableExpanding;\n\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta.activeRowIndex]?.toggleExpanded(false);\n }\n }\n return;\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n if (canToggleRowExpansion) {\n rows[meta?.activeRowIndex]?.toggleExpanded(true);\n }\n }\n\n return;\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (onRowClick) {\n onRowClick(rows[meta?.activeRowIndex].original);\n }\n\n return;\n }\n\n if (event.key === ' ') {\n event.preventDefault();\n\n if (table.options.enableRowSelection) {\n rows[meta.activeRowIndex]?.toggleSelected();\n }\n\n return;\n }\n\n if (event.ctrlKey || event.metaKey) {\n if (event.key === 'a' && table.options.enableRowSelection) {\n event.preventDefault();\n table.toggleAllRowsSelected();\n }\n\n return;\n }\n }\n };\n\n let handleBlur;\n\n if (meta.editMode.isEditing) {\n handleBlur = (event: React.FocusEvent) => {\n let elementGainingFocus = event.relatedTarget;\n\n if (elementGainingFocus === undefined) {\n return;\n }\n\n // we might be focusing on a select or a popover that was triggered from inside the table\n // so see if the element gaining focus is inside a portal and look up its controller\n const portalId = elementGainingFocus?.closest('[data-radix-popper-content-wrapper] > :first-child')?.id;\n\n if (portalId) {\n elementGainingFocus = event.currentTarget.querySelector(`[aria-controls=\"${portalId}\"]`) ?? event.relatedTarget;\n }\n\n if (!event.currentTarget?.contains(elementGainingFocus) && elementGainingFocus !== editButtonRef.current) {\n // When we call manually blur on control component while navigating to the next cell, then when this\n // handler is run, the related target is not the next control component and active element is null,\n // that's why we explictly need to check what's the next focussed element in order to figure out whether\n // we should disabled the sorting or not.\n timeoutIdRef.current = setTimeout(() => {\n const parentRow = event.target.closest('[role=\"row\"]');\n const isNewFocussedElementInSameRow = parentRow?.contains(document.activeElement);\n\n // When we manually call blur on control component and focus another component then\n // we have to make sure we\n if (meta.shouldPauseSortingAndFiltering && !isNewFocussedElementInSameRow) {\n // if client side - unpause sorting\n meta.setShouldPauseSortingAndFiltering(false);\n }\n });\n }\n };\n }\n\n // TODO: this can probably be extracted into a hook\n // we only show the pinned shadow on display columns when scrolling is active\n const [scrolled, setScrolled] = React.useState(false);\n\n // extract - infinite loading\n const loadingRef = React.useRef(false);\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !scrolled) {\n setScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && scrolled) {\n setScrolled(false);\n } else if (typeof loadMore === 'function') {\n const scrollY = event.currentTarget.scrollTop;\n const isScrollingDown = scrollY > prevScrollY.current;\n prevScrollY.current = scrollY;\n\n const scrolledPercentage = Math.round(\n (scrollY / (event.currentTarget.scrollHeight - event.currentTarget.clientHeight)) * 100\n );\n\n if (isScrollingDown && !loadingRef.current && scrolledPercentage >= 80) {\n try {\n const isAllRowsSelected = table.getIsAllRowsSelected();\n loadingRef.current = true;\n await loadMore();\n\n if (isAllRowsSelected) {\n table.toggleAllRowsSelected(true);\n }\n } catch (error) {\n console.error(error);\n } finally {\n loadingRef.current = false;\n }\n }\n }\n };\n\n let handleMouseLeave;\n\n if (meta.shouldPauseHoverState) {\n // sometimes the row's onMouseLeave doesn't trigger, this adds some extra redundancy\n handleMouseLeave = () => meta.setShouldPauseHoverState(false);\n }\n\n const className = cn(\n 'bg-white border border-grey-300 focus:yt-focus focus:border-blue-500 grid auto-rows-max overflow-auto relative rounded group',\n props.className\n );\n\n const enableSettingsButton = table.options.enableHiding || meta.enableColumnReordering;\n const hasInternalToolbar =\n enableSettingsButton ||\n meta.editMode.enableEditMode ||\n table.options.enableColumnFilters ||\n meta.enableRowDensity ||\n table.options.enableGlobalFilter;\n const hasToolbar = hasInternalToolbar || !!toolbarLeft || !toolbarRight;\n\n const hasFooters = React.useMemo(() => {\n const summaryIds = Object.keys(footers);\n const visibleIds = Object.keys(columnVisibility).filter(c => !columnVisibility[c]);\n return summaryIds.length && summaryIds.some(v => !visibleIds.includes(v));\n }, [footers, columnVisibility]);\n\n return (\n <div className=\"-m-0.5 flex h-full w-[calc(100%_+_0.25rem)] flex-col gap-4 overflow-hidden p-0.5\">\n {hasToolbar ? (\n <div className=\"flex flex-wrap gap-2\">\n {toolbarLeft}\n {hasInternalToolbar ? (\n <Group className=\"ml-auto flex-shrink-0 print:hidden\">\n {meta.editMode.enableEditMode ? (\n <EditModeButton\n ref={editButtonRef}\n table={table}\n tableRef={tableRef}\n scrollToIndex={virtualiser.scrollToIndex}\n />\n ) : null}\n {table.options.enableColumnFilters ? <FiltersButton length={length} table={table} /> : null}\n {toolbarRight}\n {meta.enableRowDensity ? <RowDensityButton table={table} /> : null}\n {enableSettingsButton ? <ColumnSettingsButton table={table} /> : null}\n {table.options.enableGlobalFilter ? (\n <Search\n disabled={meta.shouldDisableTableActions}\n onSearch={table.setGlobalFilter}\n value={globalFilter}\n />\n ) : null}\n </Group>\n ) : null}\n {/*<ShortcutsGuideButton table={table} />*/}\n </div>\n ) : null}\n <div\n className={className}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onMouseLeave={handleMouseLeave}\n onScroll={handleScroll}\n ref={tableRef}\n role=\"table\"\n style={{\n gridTemplateColumns,\n gridTemplateRows: rows.length ? undefined : '40px',\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 tabIndex={0}>\n <div className=\"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, columnIndex) => (\n <Header\n key={header.id}\n header={header}\n index={columnIndex}\n isLastColumn={columnIndex === headerGroup.headers.length - 1}\n scrolled={scrolled}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </div>\n ))}\n </div>\n {rows.length ? (\n <div className=\"contents\" data-taco=\"table2-body\" role=\"rowgroup\">\n {virtualiserOffsets.top ? (\n <div style={{ height: virtualiserOffsets.top }} className=\"col-span-full\" />\n ) : null}\n {virtualiser.virtualItems.map(virtualRow => {\n const row = rows[virtualRow.index];\n\n return (\n <React.Fragment key={row.id}>\n <Row\n className=\"group/row contents\"\n onRowDrop={onRowDrop}\n row={row}\n rowIndex={virtualRow.index}\n table={table}>\n {row.getVisibleCells().map((cell, columnIndex) => (\n <Cell\n cell={cell}\n key={`${cell.id}_${cell.getValue()}`}\n index={columnIndex}\n isLastRow={virtualRow.index === rows.length - 1}\n rows={rows}\n rowIndex={virtualRow.index}\n scrolled={scrolled}\n scrollToIndex={virtualiser.scrollToIndex}\n scrollToOffset={virtualiser.scrollToOffset}\n table={table}\n tableRef={tableRef}\n />\n ))}\n </Row>\n {row.getIsExpanded() && expandedRowRenderer ? (\n <ExpandedRow index={virtualRow.index} setSize={setExpandedRowSizes}>\n {expandedRowRenderer(row.original)?.()}\n </ExpandedRow>\n ) : null}\n </React.Fragment>\n );\n })}\n {virtualiserOffsets.bottom ? (\n <div style={{ height: virtualiserOffsets.bottom }} className=\"col-span-full\" />\n ) : null}\n </div>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n {hasFooters ? (\n <div role=\"rowgroup\" className=\"contents\" data-taco=\"table2-footer\">\n {table.getFooterGroups().map(footerGroup => (\n <div key={footerGroup.id} role=\"row\" className=\"contents\">\n {footerGroup.headers.map((footer, cellIndex) => (\n <Footer key={footer.id} footer={footer} index={cellIndex} scrolled={scrolled} table={table}>\n {footers[footer.id]\n ? footers[footer.id](rows.map((row: TRow<TType>) => row.original[footer.id]))\n : null}\n </Footer>\n ))}\n </div>\n ))}\n </div>\n ) : null}\n </div>\n {!!_experimentalActionsForTable &&\n table.options.enableRowSelection &&\n (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) ? (\n <BatchActionsMenu<TType>\n className=\"fixed-center-x bottom-0 z-50 mb-4 print:hidden\"\n actionsForTable={_experimentalActionsForTable}\n summary={_experimentalActionsForTableSummary}\n table={table}\n />\n ) : null}\n </div>\n );\n}) as React.ForwardRefExoticComponent<Table2Props<any>> &\n (<TType>(props: Table2Props<TType> & { ref?: React.Ref<Table2Ref> }) => JSX.Element);\n\nexport type ForwardedTable2WithStatics = React.ForwardRefExoticComponent<Table2Props<any>> & {\n Column: <TType>(props: Table2ColumnProps<TType>) => JSX.Element | null;\n} & (<TType>(props: Table2Props<TType> & { ref?: React.Ref<Table2Ref> }) => JSX.Element);\n\nconst Table2 = React.forwardRef(function Table2<TType = any>(props: Table2Props<TType>, ref: React.Ref<Table2Ref>) {\n const key = React.useMemo(() => String('tableKey_' + String(props.children)), [props.children]);\n return <BaseTable2 {...props} key={key} ref={ref} />;\n}) as ForwardedTable2WithStatics;\n\nTable2.Column = Column;\n\nexport { Table2 };\nexport type { Table2Props };\nexport type { Table2ColumnProps, Table2ActionProps, Table2RowActionRenderer, Table2Settings } from './types';\n"],"names":["Column","_","displayName","BaseTable2","React","forwardRef","props","ref","emptyState","EmptyState","expandedRowRenderer","length","data","loadMore","onRowClick","onRowDrop","toolbarLeft","toolbarRight","_experimentalActionsForTable","_experimentalActionsForTableSummary","tableRef","useMergedRef","timeoutIdRef","useRef","prevScrollY","rows","table","footers","useTable","children","meta","options","columnVisibility","columnOrder","globalFilter","getState","useEffect","current","instance","resetFiltering","resetColumnFilters","resetRowExpansion","resetExpanded","resetRowSelection","resetSorting","toggleEditing","editMode","resetFocussableColumnIndexes","isEditing","clearTimeout","virtualiser","virtualiserOffsets","setExpandedRowSizes","useVirtualiser","gridTemplateColumns","useGridTemplate","editButtonRef","handleKeyDown","event","document","activeElement","key","preventDefault","ctrlKey","metaKey","setActiveRowIndex","scrollToOffset","moveToPreviousRow","nextIndex","setShouldPauseHoverState","scrollToIndex","totalSize","moveToNextRow","scrollTo","scrollHeight","canToggleRowExpansion","enableExpanding","activeRowIndex","toggleExpanded","original","enableRowSelection","toggleSelected","toggleAllRowsSelected","handleBlur","elementGainingFocus","relatedTarget","undefined","portalId","closest","id","currentTarget","querySelector","contains","setTimeout","parentRow","target","isNewFocussedElementInSameRow","shouldPauseSortingAndFiltering","setShouldPauseSortingAndFiltering","scrolled","setScrolled","useState","loadingRef","handleScroll","scrollLeft","scrollY","scrollTop","isScrollingDown","scrolledPercentage","Math","round","clientHeight","isAllRowsSelected","getIsAllRowsSelected","error","console","handleMouseLeave","shouldPauseHoverState","className","cn","enableSettingsButton","enableHiding","enableColumnReordering","hasInternalToolbar","enableEditMode","enableColumnFilters","enableRowDensity","enableGlobalFilter","hasToolbar","hasFooters","useMemo","summaryIds","Object","keys","visibleIds","filter","c","some","v","includes","Group","EditModeButton","FiltersButton","RowDensityButton","ColumnSettingsButton","Search","disabled","shouldDisableTableActions","onSearch","setGlobalFilter","value","onBlur","onKeyDown","onMouseLeave","onScroll","role","style","gridTemplateRows","opacity","tabIndex","getHeaderGroups","map","headerGroup","headers","header","columnIndex","Header","index","isLastColumn","top","height","virtualItems","virtualRow","row","Fragment","Row","rowIndex","getVisibleCells","cell","Cell","getValue","isLastRow","getIsExpanded","ExpandedRow","setSize","bottom","getFooterGroups","footerGroup","footer","cellIndex","Footer","getIsSomeRowsSelected","BatchActionsMenu","actionsForTable","summary","Table2","String"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8HA,SAASA,MAAM,CAAcC,CAA2B;EACpD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