@onewelcome/react-lib-components 8.0.0 → 8.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DataGrid/DataGrid.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGrid.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.module.scss.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterPopover.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterPopover.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.module.scss.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbarWrapper.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbarWrapper.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridFilters/useFiltersReducer.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/useFiltersReducer.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridHeader/DataGridHeaderCell.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridHeader/DataGridHeaderCell.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.cjs.js +1 -1
- package/dist/cjs/Icon/Icon.cjs.js +1 -1
- package/dist/cjs/Icon/Icon.cjs.js.map +1 -1
- package/dist/cjs/Icon/Icon.module.scss.cjs.js +1 -1
- package/dist/cjs/Notifications/BaseModal/BaseModal.cjs.js +1 -1
- package/dist/cjs/Notifications/BaseModal/BaseModal.cjs.js.map +1 -1
- package/dist/cjs/src/components/DataGrid/DataGrid.d.ts +5 -1
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilter.d.ts +3 -3
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.d.ts +3 -2
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilterTag.d.ts +2 -1
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridToolbar.d.ts +2 -1
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridToolbarWrapper.d.ts +8 -5
- package/dist/cjs/src/components/DataGrid/DataGridFilters/useFiltersReducer.d.ts +8 -0
- package/dist/cjs/src/components/DataGrid/DataGridFilters/useFiltersReducer.test.d.ts +1 -0
- package/dist/cjs/src/components/DataGrid/testUtils.d.ts +1 -0
- package/dist/cjs/src/components/Icon/Icon.d.ts +3 -1
- package/dist/cjs/src/hooks/useRepeatFocus.cjs.js +2 -0
- package/dist/cjs/src/hooks/useRepeatFocus.cjs.js.map +1 -0
- package/dist/cjs/src/index.cjs.js +1 -1
- package/dist/cjs/src/index.d.ts +1 -0
- package/dist/esm/DataGrid/DataGrid.esm.js +5 -5
- package/dist/esm/DataGrid/DataGrid.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.esm.js +7 -14
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.module.scss.esm.js +2 -2
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilterPopover.esm.js +11 -3
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilterPopover.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilterTag.esm.js +5 -7
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilterTag.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.esm.js +16 -31
- package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.module.scss.esm.js +2 -2
- package/dist/esm/DataGrid/DataGridFilters/DataGridToolbarWrapper.esm.js +4 -2
- package/dist/esm/DataGrid/DataGridFilters/DataGridToolbarWrapper.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridFilters/useFiltersReducer.esm.js +59 -0
- package/dist/esm/DataGrid/DataGridFilters/useFiltersReducer.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridHeader/DataGridHeaderCell.esm.js +3 -5
- package/dist/esm/DataGrid/DataGridHeader/DataGridHeaderCell.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.esm.js +2 -2
- package/dist/esm/Icon/Icon.esm.js +2 -0
- package/dist/esm/Icon/Icon.esm.js.map +1 -1
- package/dist/esm/Icon/Icon.module.scss.esm.js +2 -2
- package/dist/esm/Notifications/BaseModal/BaseModal.esm.js +1 -1
- package/dist/esm/Notifications/BaseModal/BaseModal.esm.js.map +1 -1
- package/dist/esm/src/components/DataGrid/DataGrid.d.ts +5 -1
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilter.d.ts +3 -3
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.d.ts +3 -2
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilterTag.d.ts +2 -1
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridToolbar.d.ts +2 -1
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridToolbarWrapper.d.ts +8 -5
- package/dist/esm/src/components/DataGrid/DataGridFilters/useFiltersReducer.d.ts +8 -0
- package/dist/esm/src/components/DataGrid/DataGridFilters/useFiltersReducer.test.d.ts +1 -0
- package/dist/esm/src/components/DataGrid/testUtils.d.ts +1 -0
- package/dist/esm/src/components/Icon/Icon.d.ts +3 -1
- package/dist/esm/{Notifications/BaseModal → src/hooks}/useRepeatFocus.esm.js +12 -1
- package/dist/esm/src/hooks/useRepeatFocus.esm.js.map +1 -0
- package/dist/esm/src/index.d.ts +1 -0
- package/dist/esm/src/index.esm.js +1 -0
- package/dist/esm/src/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/DataGrid/DataGrid.tsx +26 -7
- package/src/components/DataGrid/DataGridFilters/DataGridFilter.module.scss +21 -11
- package/src/components/DataGrid/DataGridFilters/DataGridFilter.tsx +15 -19
- package/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.tsx +15 -2
- package/src/components/DataGrid/DataGridFilters/DataGridFilterTag.tsx +18 -7
- package/src/components/DataGrid/DataGridFilters/DataGridToolbar.module.scss +39 -22
- package/src/components/DataGrid/DataGridFilters/DataGridToolbar.tsx +23 -42
- package/src/components/DataGrid/DataGridFilters/DataGridToolbarWrapper.tsx +10 -5
- package/src/components/DataGrid/DataGridFilters/useFiltersReducer.tsx +66 -0
- package/src/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss +8 -1
- package/src/components/DataGrid/DataGridHeader/DataGridHeaderCell.tsx +3 -8
- package/src/components/DataGrid/testUtils.ts +14 -16
- package/src/components/Icon/Icon.module.scss +8 -0
- package/src/components/Icon/Icon.tsx +3 -1
- package/src/components/Notifications/BaseModal/BaseModal.tsx +1 -1
- package/src/font/icomoon.eot +0 -0
- package/src/font/icomoon.svg +2 -0
- package/src/font/icomoon.ttf +0 -0
- package/src/font/icomoon.woff +0 -0
- package/src/font/selection.json +1 -1
- package/src/{components/Notifications/BaseModal → hooks}/useRepeatFocus.tsx +12 -2
- package/src/index.ts +1 -0
- package/dist/cjs/Notifications/BaseModal/useRepeatFocus.cjs.js +0 -2
- package/dist/cjs/Notifications/BaseModal/useRepeatFocus.cjs.js.map +0 -1
- package/dist/esm/Notifications/BaseModal/useRepeatFocus.esm.js.map +0 -1
- /package/dist/cjs/src/{components/Notifications/BaseModal → hooks}/useRepeatFocus.d.ts +0 -0
- /package/dist/esm/src/{components/Notifications/BaseModal → hooks}/useRepeatFocus.d.ts +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),l=require("react-dom"),a=require("../../src/hooks/useGetDomRoot.cjs.js"),o=require("./BaseModal.module.scss.cjs.js"),d=require("./BaseModalContext.cjs.js"),r=require("
|
|
1
|
+
"use strict";var e=require("react"),l=require("react-dom"),a=require("../../src/hooks/useGetDomRoot.cjs.js"),o=require("./BaseModal.module.scss.cjs.js"),d=require("./BaseModalContext.cjs.js"),r=require("../../src/hooks/useRepeatFocus.cjs.js");const s="overflow",t=l=>{e.useEffect((()=>{l?document.body.style[s]="hidden":0===document.querySelectorAll("[role=dialog][data-hidden=false]").length&&document.body.style.removeProperty(s)}),[l])},n=e.forwardRef((({id:s,children:n,open:i,onClose:c,className:u="",containerProps:m,backdropProps:p,labelledby:v,describedby:f,disableEscapeKeyDown:b=!1,disableBackdrop:y=!1,forceContainerOpen:h=!1,zIndex:E,domRoot:$,...j},x)=>{var N,R,k;t(i);const q=e.useRef(null),C=x||e.createRef(),{root:I}=a.useGetDomRoot($,q);r.useRepeatFocus(C),e.useEffect((()=>{var e;i&&(null===(e=C.current)||void 0===e||e.focus())}),[i]);const g=()=>e.Children.map(n,(l=>{var a;return e.isValidElement(l)?e.cloneElement(l,{onClose:null!==(a=l.props.onClose)&&void 0!==a?a:c}):l}));return e.createElement("div",{ref:q},l.createPortal(e.createElement("div",{...j,ref:C,id:s,className:`${o.default.modal} ${i?o.default.visible:""} ${u}`,role:"dialog","aria-modal":"true","aria-labelledby":null!=v?v:d.labelId(s),"aria-describedby":null!=f?f:d.descriptionId(s),"aria-hidden":!i,tabIndex:-1,"data-hidden":!i,onKeyDown:e=>{b||"Escape"!==e.key||(e.stopPropagation(),null==c||c())},style:{zIndex:E}},e.createElement("div",{...p,"aria-hidden":!0,className:`${o.default.backdrop} ${null!==(N=null==p?void 0:p.className)&&void 0!==N?N:""}`,onClick:()=>!y&&c&&c()}),h?e.createElement("div",{...m,"aria-hidden":!i,"data-element":"dialog",hidden:!i,style:{zIndex:E&&E+1},className:`${o.default.container} ${null!==(R=null==m?void 0:m.className)&&void 0!==R?R:""}`},g()):i&&e.createElement("div",{...m,"data-element":"dialog",style:{zIndex:E&&E+1},className:`${o.default.container} ${null!==(k=null==m?void 0:m.className)&&void 0!==k?k:""}`},g())),I))}));exports.BaseModal=n,exports.useSetBodyScroll=t;
|
|
2
2
|
//# sourceMappingURL=BaseModal.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseModal.cjs.js","sources":["../../../../../../src/components/Notifications/BaseModal/BaseModal.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ForwardRefRenderFunction,\n ComponentPropsWithRef,\n useEffect,\n useRef,\n ReactElement,\n RefObject,\n createRef\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useGetDomRoot } from \"../../../hooks/useGetDomRoot\";\nimport classes from \"./BaseModal.module.scss\";\nimport { labelId, descriptionId } from \"./BaseModalContext\";\nimport { useRepeatFocus } from \"
|
|
1
|
+
{"version":3,"file":"BaseModal.cjs.js","sources":["../../../../../../src/components/Notifications/BaseModal/BaseModal.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ForwardRefRenderFunction,\n ComponentPropsWithRef,\n useEffect,\n useRef,\n ReactElement,\n RefObject,\n createRef\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useGetDomRoot } from \"../../../hooks/useGetDomRoot\";\nimport classes from \"./BaseModal.module.scss\";\nimport { labelId, descriptionId } from \"./BaseModalContext\";\nimport { useRepeatFocus } from \"../../../hooks/useRepeatFocus\";\n\nconst SCROLL_PROPERTY_NAME = \"overflow\";\nconst SCROLL_PROPERTY_VALUE = \"hidden\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n id: string;\n children: React.ReactNode;\n open: boolean;\n onClose?: (event?: React.MouseEvent<HTMLElement>) => unknown;\n className?: string;\n containerProps?: ComponentPropsWithRef<\"div\">;\n backdropProps?: ComponentPropsWithRef<\"div\">;\n labelledby?: string;\n describedby?: string;\n disableEscapeKeyDown?: boolean;\n disableBackdrop?: boolean;\n forceContainerOpen?: boolean;\n zIndex?: number;\n domRoot?: HTMLElement;\n}\n\nexport const useSetBodyScroll = (open: boolean) => {\n const hideBodyScroll = () => {\n document.body.style[SCROLL_PROPERTY_NAME] = SCROLL_PROPERTY_VALUE;\n };\n\n const showBodyScroll = () => {\n const allModalsClosed =\n document.querySelectorAll(\"[role=dialog][data-hidden=false]\").length === 0;\n if (allModalsClosed) {\n document.body.style.removeProperty(SCROLL_PROPERTY_NAME);\n }\n };\n\n useEffect(() => {\n if (open) {\n hideBodyScroll();\n } else {\n showBodyScroll();\n }\n }, [open]);\n};\n\nconst BaseModalComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n {\n id,\n children,\n open,\n onClose,\n className = \"\",\n containerProps,\n backdropProps,\n labelledby,\n describedby,\n disableEscapeKeyDown = false,\n disableBackdrop = false,\n forceContainerOpen = false,\n zIndex,\n domRoot,\n ...rest\n }: Props,\n ref\n) => {\n useSetBodyScroll(open);\n const wrappingDivRef = useRef<HTMLDivElement>(null);\n const modalRef = (ref as RefObject<HTMLDivElement>) || createRef<HTMLDivElement>();\n const { root } = useGetDomRoot(domRoot, wrappingDivRef);\n\n const handleEscKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (!disableEscapeKeyDown && event.key === \"Escape\") {\n event.stopPropagation();\n onClose?.();\n }\n };\n\n useRepeatFocus(modalRef);\n\n useEffect(() => {\n if (open) {\n modalRef.current?.focus();\n }\n }, [open]);\n\n const handleBackdropClick = () => !disableBackdrop && onClose && onClose();\n\n const renderChildren = () =>\n React.Children.map(children, child => {\n if (React.isValidElement(child)) {\n return React.cloneElement(child as ReactElement, {\n onClose: child.props.onClose ?? onClose\n });\n }\n return child;\n });\n\n return (\n <div ref={wrappingDivRef}>\n {createPortal(\n <div\n {...rest}\n ref={modalRef}\n id={id}\n className={`${classes[\"modal\"]} ${open ? classes[\"visible\"] : \"\"} ${className}`}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={labelledby ?? labelId(id)}\n aria-describedby={describedby ?? descriptionId(id)}\n aria-hidden={!open}\n tabIndex={-1}\n data-hidden={!open}\n onKeyDown={handleEscKeyPress}\n style={{ zIndex }}\n >\n <div\n {...backdropProps}\n aria-hidden={true}\n className={`${classes[\"backdrop\"]} ${backdropProps?.className ?? \"\"}`}\n onClick={handleBackdropClick}\n ></div>\n {forceContainerOpen ? (\n <div\n {...containerProps}\n aria-hidden={!open}\n data-element=\"dialog\"\n hidden={!open}\n style={{ zIndex: zIndex && zIndex + 1 }}\n className={`${classes[\"container\"]} ${containerProps?.className ?? \"\"}`}\n >\n {renderChildren()}\n </div>\n ) : (\n open && (\n <div\n {...containerProps}\n data-element=\"dialog\"\n style={{ zIndex: zIndex && zIndex + 1 }}\n className={`${classes[\"container\"]} ${containerProps?.className ?? \"\"}`}\n >\n {renderChildren()}\n </div>\n )\n )}\n </div>,\n root\n )}\n </div>\n );\n};\n\nexport const BaseModal = React.forwardRef(BaseModalComponent);\n"],"names":["SCROLL_PROPERTY_NAME","useSetBodyScroll","open","useEffect","document","body","style","querySelectorAll","length","removeProperty","BaseModal","React","forwardRef","id","children","onClose","className","containerProps","backdropProps","labelledby","describedby","disableEscapeKeyDown","disableBackdrop","forceContainerOpen","zIndex","domRoot","rest","ref","wrappingDivRef","useRef","modalRef","createRef","root","useGetDomRoot","useRepeatFocus","_a","current","focus","renderChildren","Children","map","child","isValidElement","cloneElement","props","createElement","createPortal","classes","default","role","labelId","descriptionId","tabIndex","onKeyDown","event","key","stopPropagation","onClick","hidden","_b","_c"],"mappings":"mPA+BA,MAAMA,EAAuB,WAoBhBC,EAAoBC,IAa/BC,EAAAA,WAAU,KACJD,EAZJE,SAASC,KAAKC,MAAMN,GArBM,SA0BiD,IAAzEI,SAASG,iBAAiB,oCAAoCC,QAE9DJ,SAASC,KAAKC,MAAMG,eAAeT,EASpC,GACA,CAACE,GAAM,EA6GCQ,EAAYC,EAAMC,YA1G6C,EAExEC,KACAC,WACAZ,OACAa,UACAC,YAAY,GACZC,iBACAC,gBACAC,aACAC,cACAC,wBAAuB,EACvBC,mBAAkB,EAClBC,sBAAqB,EACrBC,SACAC,aACGC,GAELC,eAEA1B,EAAiBC,GACjB,MAAM0B,EAAiBC,SAAuB,MACxCC,EAAYH,GAAqCI,EAAAA,aACjDC,KAAEA,GAASC,EAAaA,cAACR,EAASG,GASxCM,EAAcA,eAACJ,GAEf3B,EAAAA,WAAU,WACJD,IACgB,QAAlBiC,EAAAL,EAASM,eAAS,IAAAD,GAAAA,EAAAE,QACnB,GACA,CAACnC,IAEJ,MAEMoC,EAAiB,IACrB3B,EAAM4B,SAASC,IAAI1B,GAAU2B,UAC3B,OAAI9B,EAAM+B,eAAeD,GAChB9B,EAAMgC,aAAaF,EAAuB,CAC/C1B,kBAAS0B,E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import { Props as ButtonProps } from "../Button/Button";
|
|
2
|
+
import { Button, Props as ButtonProps } from "../Button/Button";
|
|
3
3
|
import { HeaderCell, OnSortFunction, Sort } from "./datagrid.interfaces";
|
|
4
4
|
import { Props as PaginationProps } from "../Pagination/Pagination";
|
|
5
5
|
import { Spacing } from "../../hooks/useSpacing";
|
|
@@ -14,6 +14,9 @@ export interface Props<T> extends Omit<ComponentPropsWithRef<"div">, "children">
|
|
|
14
14
|
initialSort?: Sort;
|
|
15
15
|
onSort?: OnSortFunction;
|
|
16
16
|
headers: HeaderCell[];
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated use the `toolbarButtons` prop instead
|
|
19
|
+
*/
|
|
17
20
|
actions?: {
|
|
18
21
|
enableAddBtn?: boolean;
|
|
19
22
|
enableColumnsBtn?: boolean;
|
|
@@ -29,6 +32,7 @@ export interface Props<T> extends Omit<ComponentPropsWithRef<"div">, "children">
|
|
|
29
32
|
enableExpandableRow?: boolean;
|
|
30
33
|
filters?: DataGridToolbarProps;
|
|
31
34
|
search?: DataGridSearchbarProps;
|
|
35
|
+
toolbarButtons?: ReactElement<ButtonProps, typeof Button> | ReactElement<ButtonProps, typeof Button>[];
|
|
32
36
|
isLoading?: boolean;
|
|
33
37
|
enableMultiSorting?: boolean;
|
|
34
38
|
spacing?: Spacing;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { DataGridColumnMetadata, Filter, FilterEditorMode,
|
|
2
|
+
import { DataGridColumnMetadata, Filter, FilterEditorMode, PopoverTranslations, TagTranslations } from "./DataGridFilters.interfaces";
|
|
3
3
|
export type Props = {
|
|
4
4
|
mode: FilterEditorMode;
|
|
5
5
|
domRoot?: HTMLElement;
|
|
6
6
|
filter?: Filter;
|
|
7
7
|
columnsMetadata: DataGridColumnMetadata[];
|
|
8
|
-
dispatch: React.Dispatch<FiltersAction>;
|
|
9
8
|
onFilterAdd?: (filter: Filter) => void;
|
|
10
9
|
onFilterEdit?: (filter: Filter) => void;
|
|
11
10
|
onFilterDelete?: (id: string) => void;
|
|
12
11
|
tagTranslations?: TagTranslations;
|
|
13
12
|
popoverTranslations?: PopoverTranslations;
|
|
13
|
+
customEditTagContent?: React.ReactElement;
|
|
14
14
|
};
|
|
15
|
-
export declare const DataGridFilter: ({ mode, filter, domRoot, columnsMetadata,
|
|
15
|
+
export declare const DataGridFilter: ({ mode, filter, domRoot, columnsMetadata, onFilterAdd, onFilterEdit, onFilterDelete, tagTranslations, popoverTranslations, customEditTagContent }: Props) => React.JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DataGridColumnMetadata, PopoverTranslations } from "./DataGridFilters.interfaces";
|
|
3
3
|
export type Props = {
|
|
4
|
-
|
|
4
|
+
popoverRef: React.RefObject<HTMLDivElement>;
|
|
5
|
+
anchorRef?: React.RefObject<HTMLDivElement>;
|
|
5
6
|
isOpen: boolean;
|
|
6
7
|
column: string;
|
|
7
8
|
columnsMetadata: DataGridColumnMetadata[];
|
|
@@ -19,4 +20,4 @@ export type Props = {
|
|
|
19
20
|
setPickedValues: (pickedValues: React.SetStateAction<string[]>) => void;
|
|
20
21
|
translations?: PopoverTranslations;
|
|
21
22
|
};
|
|
22
|
-
export declare const DataGridFilterPopover: ({ anchorRef, isOpen, column, columnsMetadata, values, pickedValues, operator, operators, onFilterSubmit, resetFields, setFilterOpen, setColumn, setOperator, setOperators, setValues, setPickedValues, translations }: Props) => React.JSX.Element;
|
|
23
|
+
export declare const DataGridFilterPopover: ({ popoverRef, anchorRef, isOpen, column, columnsMetadata, values, pickedValues, operator, operators, onFilterSubmit, resetFields, setFilterOpen, setColumn, setOperator, setOperators, setValues, setPickedValues, translations }: Props) => React.JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { ComponentPropsWithRef, ForwardRefRenderFunction } from "react";
|
|
2
2
|
import { Filter, FilterEditorMode, TagTranslations } from "./DataGridFilters.interfaces";
|
|
3
3
|
export interface DataGridFilterTagProps extends ComponentPropsWithRef<"div"> {
|
|
4
|
-
|
|
4
|
+
customEditTagContent?: React.ReactElement;
|
|
5
|
+
triggerRef: React.Ref<HTMLButtonElement>;
|
|
5
6
|
filter?: Filter;
|
|
6
7
|
mode: FilterEditorMode;
|
|
7
8
|
onFilterRemove: () => void;
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { DataGridColumnMetadata, Filter, FiltersTranslations } from "./DataGridFilters.interfaces";
|
|
3
3
|
export interface DataGridToolbarProps {
|
|
4
4
|
columnsMetadata: DataGridColumnMetadata[];
|
|
5
|
+
customEditTagContent?: React.ReactElement;
|
|
5
6
|
filterValues?: Filter[];
|
|
6
7
|
translations?: FiltersTranslations;
|
|
7
8
|
onFilterAdd?: (filter: Filter) => void;
|
|
@@ -9,4 +10,4 @@ export interface DataGridToolbarProps {
|
|
|
9
10
|
onFilterDelete?: (id: string) => void;
|
|
10
11
|
onFiltersClear?: () => void;
|
|
11
12
|
}
|
|
12
|
-
export declare const DataGridToolbar: ({ columnsMetadata, filterValues, translations, onFilterAdd, onFilterEdit, onFilterDelete, onFiltersClear }: DataGridToolbarProps) => React.JSX.Element;
|
|
13
|
+
export declare const DataGridToolbar: ({ columnsMetadata, filterValues, translations, onFilterAdd, onFilterEdit, onFilterDelete, onFiltersClear, customEditTagContent }: DataGridToolbarProps) => React.JSX.Element;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import React, { ComponentPropsWithRef, ForwardRefRenderFunction } from "react";
|
|
2
|
-
|
|
1
|
+
import React, { ComponentPropsWithRef, ForwardRefRenderFunction, ReactElement } from "react";
|
|
2
|
+
import { Button } from "../../Button/Button";
|
|
3
|
+
import { ButtonProps } from "../../..";
|
|
4
|
+
interface Props extends ComponentPropsWithRef<"div"> {
|
|
5
|
+
filters?: React.JSX.Element;
|
|
6
|
+
buttons?: ReactElement<ButtonProps, typeof Button> | ReactElement<ButtonProps, typeof Button>[];
|
|
7
|
+
}
|
|
3
8
|
export declare const DataGridToolbarWrapperComponent: ForwardRefRenderFunction<HTMLDivElement, Props>;
|
|
4
|
-
export declare const DataGridToolbarWrapper: React.ForwardRefExoticComponent<Omit<
|
|
5
|
-
ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
6
|
-
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const DataGridToolbarWrapper: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
10
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Filter, FiltersState } from "./DataGridFilters.interfaces";
|
|
2
|
+
export declare const useFiltersReducer: (filterValues: Filter[] | undefined) => {
|
|
3
|
+
state: FiltersState;
|
|
4
|
+
addFilter: (filter: Filter) => void;
|
|
5
|
+
deleteFilter: (id: string) => void;
|
|
6
|
+
editFilter: (filter: Filter) => void;
|
|
7
|
+
clearFilters: () => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,5 +9,6 @@ export declare const useMockFilteringLogic: <T>(data: T[], filterValues: Filter[
|
|
|
9
9
|
onFilterDelete: (id: string) => void;
|
|
10
10
|
onFiltersClear: () => void;
|
|
11
11
|
gridData: T[];
|
|
12
|
+
setGridData: import("react").Dispatch<import("react").SetStateAction<T[]>>;
|
|
12
13
|
filters: Filter[];
|
|
13
14
|
};
|
|
@@ -80,7 +80,9 @@ export declare enum Icons {
|
|
|
80
80
|
FileAltIcon = "file-alt",
|
|
81
81
|
AddCircle = "add-circle",
|
|
82
82
|
ZoomIn = "zoom-in",
|
|
83
|
-
ZoomOut = "zoom-out"
|
|
83
|
+
ZoomOut = "zoom-out",
|
|
84
|
+
ArrowUp = "arrow-up",
|
|
85
|
+
ExternalLink = "external-link"
|
|
84
86
|
}
|
|
85
87
|
type Tag = "span" | "div" | "i";
|
|
86
88
|
export interface Props extends ComponentPropsWithRef<"div"> {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react");exports.useRepeatFocus=t=>{const n=(e,t)=>{const n=["button","[href]","input","select","textarea","[tabindex]","[contenteditable]"].map((e=>`${e}:not([tabindex="-1"])`)).join(", "),r=e.querySelectorAll(n);return"first"===t?r[0]||null:"last"===t&&r[r.length-1]||null};e.useEffect((()=>{if(!t.current||!open)return;const e=n(t.current,"last"),r=n(t.current,"first");if(!e||!r)return;const u=t=>{"Tab"===t.key&&(t.shiftKey?document.activeElement===r&&(t.preventDefault(),null==e||e.focus()):document.activeElement===e&&(t.preventDefault(),null==r||r.focus()))};return e.addEventListener("keydown",u),r.addEventListener("keydown",u),()=>{e.removeEventListener("keydown",u),r.removeEventListener("keydown",u)}}),[t,open])};
|
|
2
|
+
//# sourceMappingURL=useRepeatFocus.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRepeatFocus.cjs.js","sources":["../../../../../../src/hooks/useRepeatFocus.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { RefObject, useEffect } from \"react\";\n\n/**\n * @description This is a hook that will make sure that when a modal is open and the user tabs through the it,\n * the focus will be repeated and the user will not lose their entire focusable element to an element in the background\n * that is being blocked by the modal.\n */\n\nexport const useRepeatFocus = (ref: RefObject<HTMLDivElement>) => {\n const getFocusableElement = (\n element: HTMLElement,\n position: \"first\" | \"last\"\n ): HTMLElement | null => {\n const baseSelectors = [\n \"button\",\n \"[href]\",\n \"input\",\n \"select\",\n \"textarea\",\n \"[tabindex]\",\n \"[contenteditable]\"\n ];\n const focusableSelectors = baseSelectors\n .map(selector => `${selector}:not([tabindex=\"-1\"])`)\n .join(\", \");\n const focusableElements = element.querySelectorAll<HTMLElement>(focusableSelectors);\n\n if (position === \"first\") {\n return focusableElements[0] || null;\n } else if (position === \"last\") {\n return focusableElements[focusableElements.length - 1] || null;\n }\n\n return null;\n };\n\n useEffect(() => {\n if (!ref.current || !open) return;\n\n const lastFocusableElement = getFocusableElement(ref.current, \"last\");\n const firstFocusableElement = getFocusableElement(ref.current, \"first\");\n\n if (!lastFocusableElement || !firstFocusableElement) return;\n\n const handleTabKeyPress = (event: KeyboardEvent) => {\n if (event.key !== \"Tab\") return;\n\n if (event.shiftKey) {\n if (document.activeElement === firstFocusableElement) {\n event.preventDefault();\n lastFocusableElement?.focus();\n }\n } else if (document.activeElement === lastFocusableElement) {\n event.preventDefault();\n firstFocusableElement?.focus();\n }\n };\n\n lastFocusableElement.addEventListener(\"keydown\", handleTabKeyPress);\n firstFocusableElement.addEventListener(\"keydown\", handleTabKeyPress);\n\n return () => {\n lastFocusableElement.removeEventListener(\"keydown\", handleTabKeyPress);\n firstFocusableElement.removeEventListener(\"keydown\", handleTabKeyPress);\n };\n }, [ref, open]);\n};\n"],"names":["ref","getFocusableElement","element","position","focusableSelectors","map","selector","join","focusableElements","querySelectorAll","length","useEffect","current","open","lastFocusableElement","firstFocusableElement","handleTabKeyPress","event","key","shiftKey","document","activeElement","preventDefault","focus","addEventListener","removeEventListener"],"mappings":"2DAwB+BA,IAC7B,MAAMC,EAAsB,CAC1BC,EACAC,KAEA,MASMC,EATgB,CACpB,SACA,SACA,QACA,SACA,WACA,aACA,qBAGCC,KAAIC,GAAY,GAAGA,2BACnBC,KAAK,MACFC,EAAoBN,EAAQO,iBAA8BL,GAEhE,MAAiB,UAAbD,EACKK,EAAkB,IAAM,KACT,SAAbL,GACFK,EAAkBA,EAAkBE,OAAS,IAG/C,IAAI,EAGbC,EAAAA,WAAU,KACR,IAAKX,EAAIY,UAAYC,KAAM,OAE3B,MAAMC,EAAuBb,EAAoBD,EAAIY,QAAS,QACxDG,EAAwBd,EAAoBD,EAAIY,QAAS,SAE/D,IAAKE,IAAyBC,EAAuB,OAErD,MAAMC,EAAqBC,IACP,QAAdA,EAAMC,MAEND,EAAME,SACJC,SAASC,gBAAkBN,IAC7BE,EAAMK,iBACNR,SAAAA,EAAsBS,SAEfH,SAASC,gBAAkBP,IACpCG,EAAMK,iBACNP,SAAAA,EAAuBQ,SACxB,EAMH,OAHAT,EAAqBU,iBAAiB,UAAWR,GACjDD,EAAsBS,iBAAiB,UAAWR,GAE3C,KACLF,EAAqBW,oBAAoB,UAAWT,GACpDD,EAAsBU,oBAAoB,UAAWT,EAAkB,CACxE,GACA,CAAChB,EAAKa,MAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../_BaseStyling_/BaseStyling.cjs.js"),r=require("../Button/Button.cjs.js"),t=require("../Breadcrumbs/Breadcrumbs.cjs.js"),o=require("../ContextMenu/ContextMenu.cjs.js"),s=require("../ContextMenu/ContextMenuItem.cjs.js"),i=require("../Link/Link.cjs.js"),a=require("../Icon/Icon.cjs.js"),p=require("../Button/IconButton.cjs.js"),l=require("../Tabs/Tab.cjs.js"),n=require("../Tabs/Tabs.cjs.js"),c=require("../Tag/Tag.cjs.js"),u=require("../TextEllipsis/TextEllipsis.cjs.js"),j=require("../Tiles/Tile.cjs.js"),
|
|
1
|
+
"use strict";var e=require("../_BaseStyling_/BaseStyling.cjs.js"),r=require("../Button/Button.cjs.js"),t=require("../Breadcrumbs/Breadcrumbs.cjs.js"),o=require("../ContextMenu/ContextMenu.cjs.js"),s=require("../ContextMenu/ContextMenuItem.cjs.js"),i=require("../Link/Link.cjs.js"),a=require("../Icon/Icon.cjs.js"),p=require("../Button/IconButton.cjs.js"),l=require("../Tabs/Tab.cjs.js"),n=require("../Tabs/Tabs.cjs.js"),c=require("../Tag/Tag.cjs.js"),u=require("../TextEllipsis/TextEllipsis.cjs.js"),j=require("../Tiles/Tile.cjs.js"),d=require("../Tiles/Tiles.cjs.js"),x=require("../Tooltip/Tooltip.cjs.js"),m=require("../Typography/Typography.cjs.js"),q=require("../ProgressBar/ProgressBar.cjs.js"),F=require("../Skeleton/Skeleton.cjs.js"),S=require("../Stepper/Stepper.cjs.js"),M=require("../Pagination/Pagination.cjs.js"),C=require("./hooks/useRepeater.cjs.js"),T=require("./hooks/useFullHeightCollapse.cjs.js"),g=require("./hooks/usePosition.cjs.js"),B=require("./hooks/useDebouncedCallback.cjs.js"),D=require("./util/helper.cjs.js"),W=require("../Notifications/BaseModal/BaseModal.cjs.js"),b=require("../Notifications/Alert/useAlert.cjs.js"),I=require("../Notifications/Alert/AlertProvider/AlertProvider.cjs.js"),h=require("../Notifications/Alert/AlertItem/AlertItem.cjs.js"),G=require("../Notifications/Dialog/Dialog.cjs.js"),f=require("../Notifications/DiscardChangesModal/DiscardChangesModal.cjs.js"),k=require("../Notifications/BaseModal/BaseModalActions/BaseModalActions.cjs.js"),P=require("../Notifications/BaseModal/BaseModalContent/BaseModalContent.cjs.js"),y=require("../Notifications/BaseModal/BaseModalHeader/BaseModalHeader.cjs.js"),A=require("../Notifications/NotificationProvider/NotificationContext.cjs.js"),N=require("../Notifications/SlideInModal/SlideInModal.cjs.js"),R=require("../Form/Checkbox/Checkbox.cjs.js"),H=require("../Form/Fieldset/Fieldset.cjs.js"),L=require("../Form/Form.cjs.js"),v=require("../Form/FormControl/FormControl.cjs.js"),w=require("../Form/FormGroup/FormGroup.cjs.js"),O=require("../Form/FormHelperText/FormHelperText.cjs.js"),E=require("../Form/Input/Input.cjs.js"),U=require("../Form/Wrapper/InputWrapper/InputWrapper.cjs.js"),_=require("../Form/Label/Label.cjs.js"),z=require("../Form/Radio/Radio.cjs.js"),J=require("../Form/Wrapper/RadioWrapper/RadioWrapper.cjs.js"),K=require("../Form/Select/SingleSelect/Select.cjs.js"),Q=require("../Form/Select/MultiSelect/MultiSelect.cjs.js"),V=require("../Form/Select/SingleSelect/Option.cjs.js"),X=require("../Form/Select/MultiSelect/MultiOption.cjs.js"),Y=require("../Form/Textarea/Textarea.cjs.js"),Z=require("../Form/Toggle/Toggle.cjs.js"),$=require("../Form/Wrapper/CheckboxWrapper/CheckboxWrapper.cjs.js"),ee=require("../Form/Wrapper/TextareaWrapper/TextareaWrapper.cjs.js"),re=require("../Form/Wrapper/SelectWrapper/SelectWrapper.cjs.js"),te=require("../Form/FileUpload/FileUpload.cjs.js"),oe=require("../Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.cjs.js"),se=require("../Layout/ContentHeader/ContentHeader.cjs.js"),ie=require("../Layout/FormPage/FormWithStepper/FormStepper/FormStepper.cjs.js"),ae=require("../Layout/FormPage/FormWithStepper/FormSection/FormSection.cjs.js"),pe=require("../Layout/FormPage/FormWithStepper/FormWithStepper.cjs.js"),le=require("../DataGrid/DataGrid.cjs.js"),ne=require("../DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js"),ce=require("../DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.cjs.js"),ue=require("../DataGrid/DataGridBody/DataGridCell/DataGridCell.cjs.js"),je=require("../DataGrid/DataGridFilters/useFiltersReducer.cjs.js"),de=require("../Notifications/Banner/Banner.cjs.js"),xe=require("../admin/layout/MicrofrontendContainer/MicrofrontendContainer.cjs.js");exports.BaseStyling=e.BaseStyling,exports.Button=r.Button,exports.Breadcrumbs=t.Breadcrumbs,exports.ContextMenu=o.ContextMenu,exports.ContextMenuItem=s.ContextMenuItem,exports.Link=i.Link,exports.Icon=a.Icon,Object.defineProperty(exports,"Icons",{enumerable:!0,get:function(){return a.Icons}}),exports.IconButton=p.IconButton,exports.Tab=l.Tab,exports.Tabs=n.Tabs,exports.Tag=c.Tag,exports.TextEllipsis=u.TextEllipsis,exports.Tile=j.Tile,exports.Tiles=d.Tiles,exports.Tooltip=x.Tooltip,exports.Typography=m.Typography,exports.ProgressBar=q.ProgressBar,exports.Skeleton=F.Skeleton,exports.Stepper=S.Stepper,exports.Pagination=M.Pagination,exports.useRepeater=C.useRepeater,exports.useFullHeightCollapse=T.useFullHeightCollapse,exports.usePosition=g.usePosition,exports.useDebouncedCallback=B.useDebouncedCallback,exports.debounce=D.debounce,exports.generateID=D.generateID,exports.throttle=D.throttle,exports.Modal=W.BaseModal,exports.useAlert=b.useAlert,exports.AlertProvider=I.AlertProvider,exports.AlertItem=h.AlertItem,exports.Dialog=G.Dialog,exports.DiscardChangesModal=f.DiscardChangesModal,exports.ModalActions=k.BaseModalActions,exports.ModalContent=P.BaseModalContent,exports.ModalHeader=y.BaseModalHeader,exports.NotificationProvider=A.NotificationProvider,exports.useNotificationContext=A.useNotificationContext,exports.SlideInModal=N.SlideInModal,exports.Checkbox=R.Checkbox,exports.Fieldset=H.Fieldset,exports.Form=L.Form,exports.FormControl=v.FormControl,exports.FormGroup=w.FormGroup,exports.FormHelperText=O.FormHelperText,exports.Input=E.Input,exports.InputWrapper=U.InputWrapper,exports.Label=_.Label,exports.Radio=z.Radio,exports.RadioWrapper=J.RadioWrapper,exports.Select=K.Select,exports.MultiSelect=Q.MultiSelect,exports.Option=V.Option,exports.MultiOption=X.MultiOption,exports.Textarea=Y.Textarea,exports.Toggle=Z.Toggle,exports.CheckboxWrapper=$.CheckboxWrapper,exports.TextareaWrapper=ee.TextareaWrapper,exports.SelectWrapper=re.SelectWrapper,exports.FileUpload=te.FileUpload,exports.MultiSelectWrapper=oe.MultiSelectWrapper,exports.ContentHeader=se.ContentHeader,exports.FormStepper=ie.FormStepper,exports.FormSection=ae.FormSection,exports.FormWithStepper=pe.FormWithStepper,exports.DataGrid=le.DataGrid,exports.DataGridRow=ne.DataGridRow,exports.DataGridDrawerItem=ce.DataGridDrawerItem,exports.DataGridCell=ue.DataGridCell,exports.useFiltersReducer=je.useFiltersReducer,exports.Banner=de.Banner,exports.MicrofrontendContainer=xe.MicrofrontendContainer;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/cjs/src/index.d.ts
CHANGED
|
@@ -126,6 +126,7 @@ export { DataGridDrawerItem } from "./components/DataGrid/DataGridBody/DataGridD
|
|
|
126
126
|
export type { Props as DataGridDrawerItemProps } from "./components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem";
|
|
127
127
|
export { DataGridCell } from "./components/DataGrid/DataGridBody/DataGridCell/DataGridCell";
|
|
128
128
|
export type { Props as DataGridCellProps } from "./components/DataGrid/DataGridBody/DataGridCell/DataGridCell";
|
|
129
|
+
export { useFiltersReducer } from "./components/DataGrid/DataGridFilters/useFiltersReducer";
|
|
129
130
|
export { Banner } from "./components/Notifications/Banner/Banner";
|
|
130
131
|
export type { Props as BannerProps } from "./components/Notifications/Banner/Banner";
|
|
131
132
|
/** Admin */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, Fragment } from 'react';
|
|
2
2
|
import classes from './DataGrid.module.scss.esm.js';
|
|
3
3
|
import { DataGridHeader } from './DataGridHeader/DataGridHeader.esm.js';
|
|
4
4
|
import { DataGridActions } from './DataGridActions/DataGridActions.esm.js';
|
|
@@ -24,7 +24,7 @@ import { DataGridSearchbar } from './DataGridFilters/DataGridSearchbar.esm.js';
|
|
|
24
24
|
* See the License for the specific language governing permissions and
|
|
25
25
|
* limitations under the License.
|
|
26
26
|
*/
|
|
27
|
-
const DataGridInner = ({ children, data, initialSort, onSort, headers, actions = {}, paginationProps, disableContextMenuColumn, enableExpandableRow, filters, search, isLoading, enableMultiSorting, emptyLabel, spacing, style, ...rest }, ref) => {
|
|
27
|
+
const DataGridInner = ({ children, data, initialSort, onSort, headers, actions = {}, paginationProps, disableContextMenuColumn, enableExpandableRow, filters, search, toolbarButtons, isLoading, enableMultiSorting, emptyLabel, spacing, style, ...rest }, ref) => {
|
|
28
28
|
var _a;
|
|
29
29
|
if (!headers) {
|
|
30
30
|
throw new Error("Headers definition has to be provided");
|
|
@@ -66,9 +66,9 @@ const DataGridInner = ({ children, data, initialSort, onSort, headers, actions =
|
|
|
66
66
|
paddingTop: styleWithSpacing === null || styleWithSpacing === void 0 ? void 0 : styleWithSpacing.paddingTop,
|
|
67
67
|
paddingBottom: styleWithSpacing === null || styleWithSpacing === void 0 ? void 0 : styleWithSpacing.paddingBottom
|
|
68
68
|
} },
|
|
69
|
-
filters || search ? (React.createElement(DataGridToolbarWrapper, null,
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
filters || search || toolbarButtons ? (React.createElement(DataGridToolbarWrapper, { filters: React.createElement(Fragment, null,
|
|
70
|
+
search && React.createElement(DataGridSearchbar, { ...search }),
|
|
71
|
+
filters && React.createElement(DataGridToolbar, { ...filters })), buttons: toolbarButtons })) : (React.createElement(DataGridActions, { ...actions, style: {
|
|
72
72
|
paddingLeft: styleWithSpacing === null || styleWithSpacing === void 0 ? void 0 : styleWithSpacing.paddingLeft,
|
|
73
73
|
paddingRight: styleWithSpacing === null || styleWithSpacing === void 0 ? void 0 : styleWithSpacing.paddingRight
|
|
74
74
|
}, headers: internalHeaders, onColumnToggled: onColumnToggled })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.esm.js","sources":["../../../../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ComponentPropsWithRef, ReactElement, Ref, useEffect, useState } from \"react\";\nimport { Props as ButtonProps } from \"../Button/Button\";\nimport classes from \"./DataGrid.module.scss\";\nimport { DataGridHeader } from \"./DataGridHeader/DataGridHeader\";\nimport { DataGridActions } from \"./DataGridActions/DataGridActions\";\nimport { DataGridBody } from \"./DataGridBody/DataGridBody\";\nimport { HeaderCell, OnSortFunction, Sort } from \"./datagrid.interfaces\";\nimport { Pagination, Props as PaginationProps } from \"../Pagination/Pagination\";\nimport { Spacing, useSpacing } from \"../../hooks/useSpacing\";\nimport { DataGridToolbar, DataGridToolbarProps } from \"./DataGridFilters/DataGridToolbar\";\nimport { DataGridToolbarWrapper } from \"./DataGridFilters/DataGridToolbarWrapper\";\nimport { DataGridSearchbar, DataGridSearchbarProps } from \"./DataGridFilters/DataGridSearchbar\";\n\nexport interface Props<T> extends Omit<ComponentPropsWithRef<\"div\">, \"children\"> {\n children: ({ item, index }: { item: T; index: number }) => ReactElement;\n data?: T[];\n initialSort?: Sort;\n onSort?: OnSortFunction;\n headers: HeaderCell[];\n actions?: {\n enableAddBtn?: boolean;\n enableColumnsBtn?: boolean;\n enableSearchBtn?: boolean;\n addBtnProps?: ButtonProps;\n columnsBtnProps?: ButtonProps;\n searchBtnProps?: ButtonProps;\n searchIconBtnProps?: ButtonProps;\n };\n emptyLabel?: string;\n paginationProps?: PaginationProps;\n disableContextMenuColumn?: boolean;\n enableExpandableRow?: boolean;\n filters?: DataGridToolbarProps;\n search?: DataGridSearchbarProps;\n isLoading?: boolean;\n enableMultiSorting?: boolean;\n spacing?: Spacing;\n}\n\nconst DataGridInner = <T extends {}>(\n {\n children,\n data,\n initialSort,\n onSort,\n headers,\n actions = {},\n paginationProps,\n disableContextMenuColumn,\n enableExpandableRow,\n filters,\n search,\n isLoading,\n enableMultiSorting,\n emptyLabel,\n spacing,\n style,\n ...rest\n }: Props<T>,\n ref: Ref<HTMLDivElement>\n) => {\n if (!headers) {\n throw new Error(\"Headers definition has to be provided\");\n }\n if (!children) {\n throw new Error(\"DataGridBody should be provided with a template how to render rows\");\n }\n\n const [internalHeaders, setInternalHeaders] = useState(headers);\n const styleWithSpacing = useSpacing(spacing, style);\n\n useEffect(() => setInternalHeaders(headers), [headers]);\n\n const onColumnToggled = (colName: string) => {\n setInternalHeaders(\n internalHeaders.map(item =>\n item.name !== colName ? item : { ...item, hidden: !item.hidden }\n )\n );\n };\n\n if (styleWithSpacing?.padding) {\n const splitPaddings = styleWithSpacing.padding.toString().split(\" \");\n\n let paddingLeftIndex: number = 0;\n\n if (splitPaddings.length >= 2) {\n paddingLeftIndex = 1;\n }\n if (splitPaddings.length === 4) {\n paddingLeftIndex = 3;\n }\n\n Object.defineProperties(styleWithSpacing, {\n paddingTop: {\n value: splitPaddings[0]\n },\n paddingRight: {\n value: splitPaddings[splitPaddings.length - 1 > 0 ? 1 : 0]\n },\n paddingBottom: {\n value: splitPaddings[splitPaddings.length / 3 >= 1 ? 2 : 0]\n },\n paddingLeft: {\n value: splitPaddings[paddingLeftIndex]\n }\n });\n }\n\n return (\n <div\n {...rest}\n className={classes[\"grid-wrapper\"]}\n ref={ref}\n style={{\n paddingTop: styleWithSpacing?.paddingTop,\n paddingBottom: styleWithSpacing?.paddingBottom\n }}\n >\n {filters || search ? (\n <DataGridToolbarWrapper>\n {search && <DataGridSearchbar {...search} />}\n {filters && <DataGridToolbar {...filters} />}\n </DataGridToolbarWrapper>\n ) : (\n <DataGridActions\n {...actions}\n style={{\n paddingLeft: styleWithSpacing?.paddingLeft,\n paddingRight: styleWithSpacing?.paddingRight\n }}\n headers={internalHeaders}\n onColumnToggled={onColumnToggled}\n />\n )}\n\n <div className={classes[\"table-wrapper\"]}>\n <table className={classes[\"table\"]}>\n <DataGridHeader\n headers={internalHeaders}\n initialSort={initialSort}\n onSort={onSort}\n disableContextMenuColumn={disableContextMenuColumn}\n enableExpandableRow={enableExpandableRow}\n enableMultiSorting={enableMultiSorting}\n spacing={styleWithSpacing}\n />\n <DataGridBody\n data={data}\n headers={internalHeaders}\n isLoading={isLoading}\n disableContextMenuColumn={disableContextMenuColumn}\n emptyLabel={emptyLabel}\n spacing={styleWithSpacing}\n searchValue={search?.initialSearchValue}\n >\n {children}\n </DataGridBody>\n </table>\n </div>\n {paginationProps && !isLoading && (\n <Pagination\n {...paginationProps}\n style={{\n ...paginationProps.style,\n paddingLeft: styleWithSpacing?.paddingLeft,\n paddingRight: styleWithSpacing?.paddingRight\n }}\n className={`${classes[\"pagination\"]} ${paginationProps.className ?? \"\"}`}\n />\n )}\n </div>\n );\n};\n\nexport const DataGrid = React.forwardRef(DataGridInner) as <T extends {}>(\n p: Props<T> & { ref?: Ref<HTMLDivElement> }\n) => ReactElement;\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AAyCH,MAAM,aAAa,GAAG,CACpB,EACE,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,MAAM,EACN,OAAO,EACP,OAAO,GAAG,EAAE,EACZ,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,OAAO,EACP,KAAK,EACL,GAAG,IAAI,EACE,EACX,GAAwB,KACtB;;IACF,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;KAC1D;IACD,IAAI,CAAC,QAAQ,EAAE;AACb,QAAA,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;KACvF;IAED,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAChE,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAEpD,IAAA,SAAS,CAAC,MAAM,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAExD,IAAA,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file":"DataGrid.esm.js","sources":["../../../../../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ComponentPropsWithRef,\n Fragment,\n ReactElement,\n Ref,\n useEffect,\n useState\n} from \"react\";\nimport { Button, Props as ButtonProps } from \"../Button/Button\";\nimport classes from \"./DataGrid.module.scss\";\nimport { DataGridHeader } from \"./DataGridHeader/DataGridHeader\";\nimport { DataGridActions } from \"./DataGridActions/DataGridActions\";\nimport { DataGridBody } from \"./DataGridBody/DataGridBody\";\nimport { HeaderCell, OnSortFunction, Sort } from \"./datagrid.interfaces\";\nimport { Pagination, Props as PaginationProps } from \"../Pagination/Pagination\";\nimport { Spacing, useSpacing } from \"../../hooks/useSpacing\";\nimport { DataGridToolbar, DataGridToolbarProps } from \"./DataGridFilters/DataGridToolbar\";\nimport { DataGridToolbarWrapper } from \"./DataGridFilters/DataGridToolbarWrapper\";\nimport { DataGridSearchbar, DataGridSearchbarProps } from \"./DataGridFilters/DataGridSearchbar\";\n\nexport interface Props<T> extends Omit<ComponentPropsWithRef<\"div\">, \"children\"> {\n children: ({ item, index }: { item: T; index: number }) => ReactElement;\n data?: T[];\n initialSort?: Sort;\n onSort?: OnSortFunction;\n headers: HeaderCell[];\n /**\n * @deprecated use the `toolbarButtons` prop instead\n */\n actions?: {\n enableAddBtn?: boolean;\n enableColumnsBtn?: boolean;\n enableSearchBtn?: boolean;\n addBtnProps?: ButtonProps;\n columnsBtnProps?: ButtonProps;\n searchBtnProps?: ButtonProps;\n searchIconBtnProps?: ButtonProps;\n };\n emptyLabel?: string;\n paginationProps?: PaginationProps;\n disableContextMenuColumn?: boolean;\n enableExpandableRow?: boolean;\n filters?: DataGridToolbarProps;\n search?: DataGridSearchbarProps;\n toolbarButtons?:\n | ReactElement<ButtonProps, typeof Button>\n | ReactElement<ButtonProps, typeof Button>[];\n isLoading?: boolean;\n enableMultiSorting?: boolean;\n spacing?: Spacing;\n}\n\nconst DataGridInner = <T extends {}>(\n {\n children,\n data,\n initialSort,\n onSort,\n headers,\n actions = {},\n paginationProps,\n disableContextMenuColumn,\n enableExpandableRow,\n filters,\n search,\n toolbarButtons,\n isLoading,\n enableMultiSorting,\n emptyLabel,\n spacing,\n style,\n ...rest\n }: Props<T>,\n ref: Ref<HTMLDivElement>\n) => {\n if (!headers) {\n throw new Error(\"Headers definition has to be provided\");\n }\n if (!children) {\n throw new Error(\"DataGridBody should be provided with a template how to render rows\");\n }\n\n const [internalHeaders, setInternalHeaders] = useState(headers);\n const styleWithSpacing = useSpacing(spacing, style);\n\n useEffect(() => setInternalHeaders(headers), [headers]);\n\n const onColumnToggled = (colName: string) => {\n setInternalHeaders(\n internalHeaders.map(item =>\n item.name !== colName ? item : { ...item, hidden: !item.hidden }\n )\n );\n };\n\n if (styleWithSpacing?.padding) {\n const splitPaddings = styleWithSpacing.padding.toString().split(\" \");\n\n let paddingLeftIndex: number = 0;\n\n if (splitPaddings.length >= 2) {\n paddingLeftIndex = 1;\n }\n if (splitPaddings.length === 4) {\n paddingLeftIndex = 3;\n }\n\n Object.defineProperties(styleWithSpacing, {\n paddingTop: {\n value: splitPaddings[0]\n },\n paddingRight: {\n value: splitPaddings[splitPaddings.length - 1 > 0 ? 1 : 0]\n },\n paddingBottom: {\n value: splitPaddings[splitPaddings.length / 3 >= 1 ? 2 : 0]\n },\n paddingLeft: {\n value: splitPaddings[paddingLeftIndex]\n }\n });\n }\n\n return (\n <div\n {...rest}\n className={classes[\"grid-wrapper\"]}\n ref={ref}\n style={{\n paddingTop: styleWithSpacing?.paddingTop,\n paddingBottom: styleWithSpacing?.paddingBottom\n }}\n >\n {filters || search || toolbarButtons ? (\n <DataGridToolbarWrapper\n filters={\n <Fragment>\n {search && <DataGridSearchbar {...search} />}\n {filters && <DataGridToolbar {...filters} />}\n </Fragment>\n }\n buttons={toolbarButtons}\n />\n ) : (\n <DataGridActions\n {...actions}\n style={{\n paddingLeft: styleWithSpacing?.paddingLeft,\n paddingRight: styleWithSpacing?.paddingRight\n }}\n headers={internalHeaders}\n onColumnToggled={onColumnToggled}\n />\n )}\n\n <div className={classes[\"table-wrapper\"]}>\n <table className={classes[\"table\"]}>\n <DataGridHeader\n headers={internalHeaders}\n initialSort={initialSort}\n onSort={onSort}\n disableContextMenuColumn={disableContextMenuColumn}\n enableExpandableRow={enableExpandableRow}\n enableMultiSorting={enableMultiSorting}\n spacing={styleWithSpacing}\n />\n <DataGridBody\n data={data}\n headers={internalHeaders}\n isLoading={isLoading}\n disableContextMenuColumn={disableContextMenuColumn}\n emptyLabel={emptyLabel}\n spacing={styleWithSpacing}\n searchValue={search?.initialSearchValue}\n >\n {children}\n </DataGridBody>\n </table>\n </div>\n {paginationProps && !isLoading && (\n <Pagination\n {...paginationProps}\n style={{\n ...paginationProps.style,\n paddingLeft: styleWithSpacing?.paddingLeft,\n paddingRight: styleWithSpacing?.paddingRight\n }}\n className={`${classes[\"pagination\"]} ${paginationProps.className ?? \"\"}`}\n />\n )}\n </div>\n );\n};\n\nexport const DataGrid = React.forwardRef(DataGridInner) as <T extends {}>(\n p: Props<T> & { ref?: Ref<HTMLDivElement> }\n) => ReactElement;\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AAsDH,MAAM,aAAa,GAAG,CACpB,EACE,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,MAAM,EACN,OAAO,EACP,OAAO,GAAG,EAAE,EACZ,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,cAAc,EACd,SAAS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AC5B,KAAC,CAAA,aAAA,CAAA,UAAU,EACL,EAAA,GAAA,eAAe,EACnB,KAAK,EAAE;gBACL,GAAG,eAAe,CAAC,KAAK;AACxB,gBAAA,WAAW,EAAE,gBAAgB,KAAA,IAAA,IAAhB,gBAAgB,KAAhB,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,gBAAgB,CAAE,WAAW;AAC1C,gBAAA,YAAY,EAAE,gBAAgB,KAAA,IAAA,IAAhB,gBAAgB,KAAhB,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,gBAAgB,CAAE,YAAY;AAC7C,aAAA,EACD,SAAS,EAAE,CAAA,EAAG,OAAO,CAAC,YAAY,CAAC,CAAI,CAAA,EAAA,CAAA,EAAA,GAAA,eAAe,CAAC,SAAS,mCAAI,EAAE,CAAA,CAAE,GACxE,CACH,CACG,EACN;AACJ,CAAC,CAAC;AAEW,MAAA,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useRef, useState, Fragment } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { useGetDomRoot } from '../../src/hooks/useGetDomRoot.esm.js';
|
|
4
4
|
import { generateID } from '../../src/util/helper.esm.js';
|
|
@@ -21,26 +21,20 @@ import { useDataGridFilter } from './DataGridFilterService.esm.js';
|
|
|
21
21
|
* See the License for the specific language governing permissions and
|
|
22
22
|
* limitations under the License.
|
|
23
23
|
*/
|
|
24
|
-
const DataGridFilter = ({ mode, filter, domRoot, columnsMetadata,
|
|
25
|
-
const wrappingDivRef =
|
|
24
|
+
const DataGridFilter = ({ mode, filter, domRoot, columnsMetadata, onFilterAdd, onFilterEdit, onFilterDelete, tagTranslations, popoverTranslations, customEditTagContent }) => {
|
|
25
|
+
const wrappingDivRef = useRef(null);
|
|
26
|
+
const triggerRef = useRef(null);
|
|
27
|
+
const popoverRef = useRef(null);
|
|
26
28
|
const [filterOpen, setFilterOpen] = useState(false);
|
|
27
29
|
const { root } = useGetDomRoot(domRoot, wrappingDivRef);
|
|
28
30
|
const { resetFields, operator, setOperator, operators, setOperators, column, setColumn, values, setValues, pickedValues, setPickedValues, initialiseFilterValues } = useDataGridFilter(mode, columnsMetadata);
|
|
29
31
|
const onFilterSubmit = () => {
|
|
30
32
|
if (mode === "ADD") {
|
|
31
33
|
const id = generateID();
|
|
32
|
-
dispatch({
|
|
33
|
-
type: "add",
|
|
34
|
-
payload: { id, column, operator, value: pickedValues }
|
|
35
|
-
});
|
|
36
34
|
onFilterAdd && onFilterAdd({ id, column, operator, value: pickedValues });
|
|
37
35
|
}
|
|
38
36
|
else if (mode === "EDIT" && filter) {
|
|
39
37
|
const { id } = filter;
|
|
40
|
-
dispatch({
|
|
41
|
-
type: "edit",
|
|
42
|
-
payload: { id, column, operator, value: pickedValues }
|
|
43
|
-
});
|
|
44
38
|
onFilterEdit && onFilterEdit({ id, column, operator, value: pickedValues });
|
|
45
39
|
}
|
|
46
40
|
resetFields();
|
|
@@ -51,7 +45,6 @@ const DataGridFilter = ({ mode, filter, domRoot, columnsMetadata, dispatch, onFi
|
|
|
51
45
|
return;
|
|
52
46
|
}
|
|
53
47
|
const { id } = filter;
|
|
54
|
-
dispatch({ type: "remove", payload: { id } });
|
|
55
48
|
onFilterDelete && onFilterDelete(id);
|
|
56
49
|
resetFields();
|
|
57
50
|
setFilterOpen(false);
|
|
@@ -63,8 +56,8 @@ const DataGridFilter = ({ mode, filter, domRoot, columnsMetadata, dispatch, onFi
|
|
|
63
56
|
}
|
|
64
57
|
};
|
|
65
58
|
return (React.createElement(Fragment, null,
|
|
66
|
-
React.createElement(DataGridFilterTag, { mode: mode, onFilterOpen: onFilterOpen, onFilterRemove: onFilterRemove, triggerRef: wrappingDivRef, filter: filter }),
|
|
67
|
-
createPortal(React.createElement(DataGridFilterPopover, { anchorRef: wrappingDivRef, isOpen: filterOpen, column: column, columnsMetadata: columnsMetadata, values: values, pickedValues: pickedValues, operator: operator, operators: operators, onFilterSubmit: onFilterSubmit, resetFields: resetFields, setFilterOpen: setFilterOpen, setColumn: setColumn, setOperator: setOperator, setOperators: setOperators, setValues: setValues, setPickedValues: setPickedValues }), root)));
|
|
59
|
+
React.createElement(DataGridFilterTag, { mode: mode, onFilterOpen: onFilterOpen, onFilterRemove: onFilterRemove, triggerRef: triggerRef, ref: wrappingDivRef, filter: filter, translations: tagTranslations, customEditTagContent: customEditTagContent }),
|
|
60
|
+
createPortal(React.createElement(DataGridFilterPopover, { popoverRef: popoverRef, anchorRef: wrappingDivRef, isOpen: filterOpen, translations: popoverTranslations, column: column, columnsMetadata: columnsMetadata, values: values, pickedValues: pickedValues, operator: operator, operators: operators, onFilterSubmit: onFilterSubmit, resetFields: resetFields, setFilterOpen: setFilterOpen, setColumn: setColumn, setOperator: setOperator, setOperators: setOperators, setValues: setValues, setPickedValues: setPickedValues }), root)));
|
|
68
61
|
};
|
|
69
62
|
|
|
70
63
|
export { DataGridFilter };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridFilter.esm.js","sources":["../../../../../../src/components/DataGrid/DataGridFilters/DataGridFilter.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { Fragment,
|
|
1
|
+
{"version":3,"file":"DataGridFilter.esm.js","sources":["../../../../../../src/components/DataGrid/DataGridFilters/DataGridFilter.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { Fragment, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useGetDomRoot } from \"../../../hooks/useGetDomRoot\";\nimport {\n DataGridColumnMetadata,\n Filter,\n FilterEditorMode,\n PopoverTranslations,\n TagTranslations\n} from \"./DataGridFilters.interfaces\";\nimport { generateID } from \"../../../util/helper\";\nimport { DataGridFilterTag } from \"./DataGridFilterTag\";\nimport { DataGridFilterPopover } from \"./DataGridFilterPopover\";\nimport { useDataGridFilter } from \"./DataGridFilterService\";\n\nexport type Props = {\n mode: FilterEditorMode;\n domRoot?: HTMLElement;\n filter?: Filter;\n columnsMetadata: DataGridColumnMetadata[];\n onFilterAdd?: (filter: Filter) => void;\n onFilterEdit?: (filter: Filter) => void;\n onFilterDelete?: (id: string) => void;\n tagTranslations?: TagTranslations;\n popoverTranslations?: PopoverTranslations;\n customEditTagContent?: React.ReactElement;\n};\n\nexport const DataGridFilter = ({\n mode,\n filter,\n domRoot,\n columnsMetadata,\n onFilterAdd,\n onFilterEdit,\n onFilterDelete,\n tagTranslations,\n popoverTranslations,\n customEditTagContent\n}: Props) => {\n const wrappingDivRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n\n const [filterOpen, setFilterOpen] = useState(false);\n const { root } = useGetDomRoot(domRoot, wrappingDivRef);\n const {\n resetFields,\n operator,\n setOperator,\n operators,\n setOperators,\n column,\n setColumn,\n values,\n setValues,\n pickedValues,\n setPickedValues,\n initialiseFilterValues\n } = useDataGridFilter(mode, columnsMetadata);\n\n const onFilterSubmit = () => {\n if (mode === \"ADD\") {\n const id = generateID();\n onFilterAdd && onFilterAdd({ id, column, operator, value: pickedValues });\n } else if (mode === \"EDIT\" && filter) {\n const { id } = filter;\n onFilterEdit && onFilterEdit({ id, column, operator, value: pickedValues });\n }\n\n resetFields();\n setFilterOpen(false);\n };\n\n const onFilterRemove = () => {\n if (!filter) {\n return;\n }\n\n const { id } = filter;\n onFilterDelete && onFilterDelete(id);\n\n resetFields();\n setFilterOpen(false);\n };\n const onFilterOpen = () => {\n setFilterOpen(!filterOpen);\n if (!filterOpen) {\n initialiseFilterValues(filter);\n }\n };\n\n return (\n <Fragment>\n <DataGridFilterTag\n mode={mode}\n onFilterOpen={onFilterOpen}\n onFilterRemove={onFilterRemove}\n triggerRef={triggerRef}\n ref={wrappingDivRef}\n filter={filter}\n translations={tagTranslations}\n customEditTagContent={customEditTagContent}\n />\n {createPortal(\n <DataGridFilterPopover\n popoverRef={popoverRef}\n anchorRef={wrappingDivRef}\n isOpen={filterOpen}\n translations={popoverTranslations}\n column={column}\n columnsMetadata={columnsMetadata}\n values={values}\n pickedValues={pickedValues}\n operator={operator}\n operators={operators}\n onFilterSubmit={onFilterSubmit}\n resetFields={resetFields}\n setFilterOpen={setFilterOpen}\n setColumn={setColumn}\n setOperator={setOperator}\n setOperators={setOperators}\n setValues={setValues}\n setPickedValues={setPickedValues}\n />,\n root\n )}\n </Fragment>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;AA8BU,MAAA,cAAc,GAAG,CAAC,EAC7B,IAAI,EACJ,MAAM,EACN,OAAO,EACP,eAAe,EACf,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACd,KAAI;AACV,IAAA,MAAM,cAAc,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;AACpD,IAAA,MAAM,UAAU,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;AACnD,IAAA,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAA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;AACxB,QAAA,aAAa,CAAC,CAAC,UAAU,CAAC,CAAC;QAC3B,IAAI,CAAC,UAAU,EAAE;YACf,sBAAsB,CAAC,MAAM,CAAC,CAAC;SAChC;AACH,KAAC,CAAC;IAEF,QACE,oBAAC,QAAQ,EAAA,IAAA;AACP,QAAA,KAAA,CAAA,aAAA,CAAC,iBAAiB,EAAA,EAChB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,eAAe,EAC7B,oBAAoB,EAAE,oBAAoB,EAC1C,CAAA;AACD,QAAA,YAAY,CACX,KAAC,CAAA,aAAA,CAAA,qBAAqB,EACpB,EAAA,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,mBAAmB,EACjC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,CAAA,EACF,IAAI,CACL,CACQ,EACX;AACJ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../node_modules/style-inject/dist/style-inject.es.esm.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.DataGridFilter-module_sr-only__42Whj{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.DataGridFilter-module_hidden__-lmLz{display:none}.DataGridFilter-module_slide-in__Ab0c2{animation:DataGridFilter-module_slide-in__Ab0c2 .5s forwards}@media (prefers-reduced-motion:reduce){.DataGridFilter-module_slide-in__Ab0c2{animation-duration:.1ms}}.DataGridFilter-module_slide-out__znEjC{animation:DataGridFilter-module_slide-out__znEjC .5s forwards}@media (prefers-reduced-motion:reduce){.DataGridFilter-module_slide-out__znEjC{animation-duration:.1ms}}@keyframes DataGridFilter-module_slide-in__Ab0c2{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes DataGridFilter-module_slide-out__znEjC{0%{transform:translateY(0)}to{transform:translateY(100vh)}}.DataGridFilter-module_filter-wrapper__qd5Al{align-items:center;background-color:var(--color-blue-grey100);border-radius:3.125rem;display:flex;gap:.375rem;justify-content:center;padding:.25rem .75rem .25rem .5rem}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_filter-button__tBzMf{align-items:center;background:none;border:none;cursor:pointer;display:flex;gap:.375rem;justify-content:flex-start;padding:0 .25rem}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_filter-button__tBzMf:only-child{margin-right:-.25rem}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_filter-button__tBzMf:hover{background-color:var(--color-black10);border-radius:.125rem}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_filter-button__tBzMf:active{background-color:var(--color-blue-grey400)}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_filter-button__tBzMf:focus-visible{border-radius:var(--focus-border-radius);outline:.125rem solid var(--color-focus);outline-offset:0}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_caption__vSlvk{font-size:var(--font-size-data-grid);font-weight:400;line-height:var(--data-grid-line-height);margin:0}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_caption__vSlvk.DataGridFilter-module_bold__oaBQm{font-weight:600}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_remove-icon__T5Kuo{font-size:.6rem}.DataGridFilter-module_column-select-option__epEFk{text-transform:capitalize}.DataGridFilter-module_popover__LXEBl{align-items:flex-start;display:flex;flex-direction:column;gap:1rem;min-width:40rem;padding:1rem .75rem}.DataGridFilter-module_popover__LXEBl .DataGridFilter-module_controls__TrlV2{display:flex;gap:1rem;width:100%}.DataGridFilter-module_popover__LXEBl .DataGridFilter-module_controls__TrlV2 :first-child,.DataGridFilter-module_popover__LXEBl .DataGridFilter-module_controls__TrlV2>:last-child{flex-grow:1.8;flex-shrink:0;margin-top:0}.DataGridFilter-module_popover__LXEBl .DataGridFilter-module_controls__TrlV2>:nth-child(2){flex-grow:1;flex-shrink:0;margin-top:0}.DataGridFilter-module_popover__LXEBl .DataGridFilter-module_actions__Mr5CH{display:flex;gap:1rem}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkRhdGFHcmlkRmlsdGVyLm1vZHVsZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWVBOzs7Ozs7Ozs7Ozs7OztFQWNFO0F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lbW92ZS1pY29uIHtcbiAgZm9udC1zaXplOiAwLjZyZW07XG59XG5cbi5jb2x1bW4tc2VsZWN0LW9wdGlvbiB7XG4gIHRleHQtdHJhbnNmb3JtOiBjYXBpdGFsaXplO1xufVxuXG4ucG9wb3ZlciB7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIGFsaWduLWl0ZW1zOiBmbGV4LXN0YXJ0O1xuICBnYXA6IDFyZW07XG4gIHBhZGRpbmc6IDFyZW0gMC43NXJlbTtcbiAgbWluLXdpZHRoOiA0MHJlbTtcbn1cbi5wb3BvdmVyIC5jb250cm9scyB7XG4gIHdpZHRoOiAxMDAlO1xuICBkaXNwbGF5OiBmbGV4O1xuICBnYXA6IDFyZW07XG59XG4ucG9wb3ZlciAuY29udHJvbHMgPiAqOmxhc3QtY2hpbGQsXG4ucG9wb3ZlciAuY29udHJvbHMgKjpmaXJzdC1jaGlsZCB7XG4gIGZsZXgtZ3JvdzogMS44O1xuICBmbGV4LXNocmluazogMDtcbiAgbWFyZ2luLXRvcDogMDtcbn1cbi5wb3BvdmVyIC5jb250cm9scyA+ICo6bnRoLWNoaWxkKDIpIHtcbiAgZmxleC1ncm93OiAxO1xuICBmbGV4LXNocmluazogMDtcbiAgbWFyZ2luLXRvcDogMDtcbn1cbi5wb3BvdmVyIC5hY3Rpb25zIHtcbiAgZGlzcGxheTogZmxleDtcbiAgZ2FwOiAxcmVtO1xufSJdfQ== */";
|
|
4
|
-
var classes = {"sr-only":"DataGridFilter-module_sr-only__42Whj","hidden":"DataGridFilter-module_hidden__-lmLz","slide-in":"DataGridFilter-module_slide-in__Ab0c2","slide-out":"DataGridFilter-module_slide-out__znEjC","filter-wrapper":"DataGridFilter-module_filter-wrapper__qd5Al","filter-button":"DataGridFilter-module_filter-button__tBzMf","caption":"DataGridFilter-module_caption__vSlvk","bold":"DataGridFilter-module_bold__oaBQm","remove-icon":"DataGridFilter-module_remove-icon__T5Kuo","column-select-option":"DataGridFilter-module_column-select-option__epEFk","popover":"DataGridFilter-module_popover__LXEBl","controls":"DataGridFilter-module_controls__TrlV2","actions":"DataGridFilter-module_actions__Mr5CH"};
|
|
3
|
+
var css_248z = "/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.DataGridFilter-module_sr-only__42Whj{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.DataGridFilter-module_hidden__-lmLz{display:none}.DataGridFilter-module_slide-in__Ab0c2{animation:DataGridFilter-module_slide-in__Ab0c2 .5s forwards}@media (prefers-reduced-motion:reduce){.DataGridFilter-module_slide-in__Ab0c2{animation-duration:.1ms}}.DataGridFilter-module_slide-out__znEjC{animation:DataGridFilter-module_slide-out__znEjC .5s forwards}@media (prefers-reduced-motion:reduce){.DataGridFilter-module_slide-out__znEjC{animation-duration:.1ms}}@keyframes DataGridFilter-module_slide-in__Ab0c2{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes DataGridFilter-module_slide-out__znEjC{0%{transform:translateY(0)}to{transform:translateY(100vh)}}.DataGridFilter-module_filter-wrapper__qd5Al{align-items:center;background-color:var(--color-blue-grey100);border-radius:3.125rem;display:flex;gap:.375rem;justify-content:center;min-height:1.5rem;padding:.25rem .75rem .25rem .5rem}.DataGridFilter-module_filter-wrapper__qd5Al:hover{background-color:var(--color-blue-grey200)}.DataGridFilter-module_filter-wrapper__qd5Al:active{background-color:var(--color-primary100)}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_filter-button__tBzMf{align-items:center;background:none;border:none;cursor:pointer;display:flex;gap:.375rem;justify-content:flex-start;padding:0 .25rem}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_filter-button__tBzMf:only-child{margin-right:-.25rem}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_filter-button__tBzMf:focus-visible{border-radius:var(--focus-border-radius);outline:.125rem solid var(--color-focus);outline-offset:0}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_remove-button__dh0WC{border-radius:1.25rem}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_caption__vSlvk{font-size:var(--font-size-data-grid);font-weight:400;line-height:var(--data-grid-line-height);margin:0}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_caption__vSlvk.DataGridFilter-module_bold__oaBQm{font-weight:600}.DataGridFilter-module_filter-wrapper__qd5Al .DataGridFilter-module_remove-icon__T5Kuo{font-size:.6rem}.DataGridFilter-module_column-select-option__epEFk{text-transform:capitalize}.DataGridFilter-module_popover__LXEBl{align-items:flex-start;display:flex;flex-direction:column;gap:1rem;min-width:40rem;padding:1rem .75rem}.DataGridFilter-module_popover__LXEBl .DataGridFilter-module_controls__TrlV2{display:flex;gap:1rem;width:100%}.DataGridFilter-module_popover__LXEBl .DataGridFilter-module_controls__TrlV2>:first-child{flex-grow:1.8;flex-shrink:0;margin-top:0}.DataGridFilter-module_popover__LXEBl .DataGridFilter-module_controls__TrlV2>:nth-child(2){flex-grow:1;flex-shrink:0;margin-top:0}.DataGridFilter-module_popover__LXEBl .DataGridFilter-module_controls__TrlV2>:last-child{flex-basis:15rem;flex-grow:1.8;flex-shrink:0;margin-top:0}.DataGridFilter-module_popover__LXEBl .DataGridFilter-module_actions__Mr5CH{display:flex;gap:1rem}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkRhdGFHcmlkRmlsdGVyLm1vZHVsZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWVBOzs7Ozs7Ozs7Ozs7OztFQWNFO0FBQ0Y7Ozs7Ozs7Ozs7Ozs7O0VBY0UsQ0FDRixzQ0FPRSxrQkFBc0IsQ0FDdEIsUUFBUyxDQUxULFVBQVcsQ0FFWCxXQUFZLENBQ1osZUFBZ0IsQ0FGaEIsU0FBVSxDQUhWLGlCQUFrQixDQUNsQixTQU9GLENBRUEscUNBQ0UsWUFDRixDQUVBLHVDQUNFLDREQUNGLENBQ0EsdUNBQ0UsdUNBQ0UsdUJBQ0YsQ0FDRixDQUVBLHdDQUNFLDZEQUNGLENBQ0EsdUNBQ0Usd0NBQ0UsdUJBQ0YsQ0FDRixDQUVBLGlEQUNFLEdBQ0UsMkJBQ0YsQ0FDQSxHQUNFLHVCQUNGLENBQ0YsQ0FDQSxrREFDRSxHQUNFLHVCQUNGLENBQ0EsR0FDRSwyQkFDRixDQUNGLENBQ0EsNkNBR0Usa0JBQW1CLENBS25CLDBDQUEyQyxDQUQzQyxzQkFBdUIsQ0FOdkIsWUFBYSxDQUdiLFdBQWEsQ0FGYixzQkFBdUIsQ0FHdkIsaUJBQWtCLENBQ2xCLGtDQUdGLENBQ0EsbURBQ0UsMENBQ0YsQ0FDQSxvREFDRSx3Q0FDRixDQUNBLHlGQUdFLGtCQUFtQixDQUVuQixlQUFnQixDQUNoQixXQUFZLENBRVosY0FBZSxDQVBmLFlBQWEsQ0FHYixXQUFhLENBRmIsMEJBQTJCLENBSzNCLGdCQUVGLENBQ0Esb0dBQ0Usb0JBQ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HJpbms6IDA7XG4gIG1hcmdpbi10b3A6IDA7XG59XG4ucG9wb3ZlciAuY29udHJvbHMgPiAqOmxhc3QtY2hpbGQge1xuICBmbGV4LWJhc2lzOiAxNXJlbTtcbiAgZmxleC1ncm93OiAxLjg7XG4gIGZsZXgtc2hyaW5rOiAwO1xuICBtYXJnaW4tdG9wOiAwO1xufVxuLnBvcG92ZXIgLmFjdGlvbnMge1xuICBkaXNwbGF5OiBmbGV4O1xuICBnYXA6IDFyZW07XG59Il19 */";
|
|
4
|
+
var classes = {"sr-only":"DataGridFilter-module_sr-only__42Whj","hidden":"DataGridFilter-module_hidden__-lmLz","slide-in":"DataGridFilter-module_slide-in__Ab0c2","slide-out":"DataGridFilter-module_slide-out__znEjC","filter-wrapper":"DataGridFilter-module_filter-wrapper__qd5Al","filter-button":"DataGridFilter-module_filter-button__tBzMf","remove-button":"DataGridFilter-module_remove-button__dh0WC","caption":"DataGridFilter-module_caption__vSlvk","bold":"DataGridFilter-module_bold__oaBQm","remove-icon":"DataGridFilter-module_remove-icon__T5Kuo","column-select-option":"DataGridFilter-module_column-select-option__epEFk","popover":"DataGridFilter-module_popover__LXEBl","controls":"DataGridFilter-module_controls__TrlV2","actions":"DataGridFilter-module_actions__Mr5CH"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { classes as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import classes from './DataGridFilter.module.scss.esm.js';
|
|
3
3
|
import { Button } from '../../Button/Button.esm.js';
|
|
4
4
|
import { Option } from '../../Form/Select/SingleSelect/Option.esm.js';
|
|
@@ -7,6 +7,7 @@ import { MultiSelectWrapper } from '../../Form/Wrapper/MultiSelectWrapper/MultiS
|
|
|
7
7
|
import { SelectWrapper } from '../../Form/Wrapper/SelectWrapper/SelectWrapper.esm.js';
|
|
8
8
|
import { Popover } from '../../Popover/Popover.esm.js';
|
|
9
9
|
import { DefaultOperators } from './DataGridFilters.interfaces.esm.js';
|
|
10
|
+
import { useRepeatFocus } from '../../src/hooks/useRepeatFocus.esm.js';
|
|
10
11
|
|
|
11
12
|
/*
|
|
12
13
|
* Copyright 2022 OneWelcome B.V.
|
|
@@ -23,9 +24,16 @@ import { DefaultOperators } from './DataGridFilters.interfaces.esm.js';
|
|
|
23
24
|
* See the License for the specific language governing permissions and
|
|
24
25
|
* limitations under the License.
|
|
25
26
|
*/
|
|
26
|
-
const DataGridFilterPopover = ({ anchorRef, isOpen, column, columnsMetadata, values, pickedValues, operator, operators, onFilterSubmit, resetFields, setFilterOpen, setColumn, setOperator, setOperators, setValues, setPickedValues, translations }) => {
|
|
27
|
+
const DataGridFilterPopover = ({ popoverRef, anchorRef, isOpen, column, columnsMetadata, values, pickedValues, operator, operators, onFilterSubmit, resetFields, setFilterOpen, setColumn, setOperator, setOperators, setValues, setPickedValues, translations }) => {
|
|
27
28
|
const { columnSelectLabel = "Filter by", operatorSelectLabel = "Operator", valueSelectLabel = "Value", addNewValueLabel = "Create new", addNewValueButtonTitle = "Add new select value", submitButtonTitle = "Apply", cancelButtonTitle = "Cancel" } = translations || {};
|
|
28
|
-
|
|
29
|
+
useRepeatFocus(popoverRef);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
var _a;
|
|
32
|
+
if (isOpen) {
|
|
33
|
+
(_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
34
|
+
}
|
|
35
|
+
}, [isOpen]);
|
|
36
|
+
return (React.createElement(Popover, { tabIndex: -1, anchorEl: anchorRef, ref: popoverRef, show: isOpen, placement: { horizontal: "left", vertical: "bottom" }, transformOrigin: { horizontal: "left", vertical: "top" } },
|
|
29
37
|
React.createElement("div", { className: classes["popover"] },
|
|
30
38
|
React.createElement("div", { className: classes["controls"] },
|
|
31
39
|
React.createElement(SelectWrapper, { label: columnSelectLabel, value: column, name: "column", onChange: e => {
|