@onewelcome/react-lib-components 7.1.0 → 8.1.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.
- package/dist/cjs/DataGrid/DataGrid.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGrid.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridBody.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridBody.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell/DataGridCell.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell/DataGridCell.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridRow/DataGridRow.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/DataGridSearchbar.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridSearchbar.cjs.js.map +1 -0
- 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 +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbarWrapper.cjs.js.map +1 -0
- 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/Form/FileUpload/FileUpload.module.scss.cjs.js +1 -1
- package/dist/cjs/Form/Select/MultiSelect/MultiSelect.cjs.js +1 -1
- package/dist/cjs/Form/Select/MultiSelect/MultiSelect.cjs.js.map +1 -1
- package/dist/cjs/Form/Select/SingleSelect/Select.cjs.js +1 -1
- package/dist/cjs/Form/Select/SingleSelect/Select.cjs.js.map +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 +8 -5
- package/dist/cjs/src/components/DataGrid/DataGridBody/DataGridBody.d.ts +1 -0
- package/dist/cjs/src/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.d.ts +1 -0
- package/dist/cjs/src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.d.ts +1 -0
- 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/DataGridSearchbar.d.ts +10 -0
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridToolbar.d.ts +4 -4
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridToolbarWrapper.d.ts +10 -0
- 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 +2 -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 +8 -4
- package/dist/esm/DataGrid/DataGrid.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridBody.esm.js +2 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridBody.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridCell/DataGridCell.esm.js +22 -3
- package/dist/esm/DataGrid/DataGridBody/DataGridCell/DataGridCell.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridRow/DataGridRow.esm.js +2 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridRow/DataGridRow.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/DataGridSearchbar.esm.js +43 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridSearchbar.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.esm.js +18 -34
- 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 +27 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridToolbarWrapper.esm.js.map +1 -0
- 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/Form/FileUpload/FileUpload.module.scss.esm.js +1 -1
- package/dist/esm/Form/Select/MultiSelect/MultiSelect.esm.js +1 -1
- package/dist/esm/Form/Select/MultiSelect/MultiSelect.esm.js.map +1 -1
- package/dist/esm/Form/Select/SingleSelect/Select.esm.js +1 -1
- package/dist/esm/Form/Select/SingleSelect/Select.esm.js.map +1 -1
- package/dist/esm/Icon/Icon.esm.js +1 -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 +8 -5
- package/dist/esm/src/components/DataGrid/DataGridBody/DataGridBody.d.ts +1 -0
- package/dist/esm/src/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.d.ts +1 -0
- package/dist/esm/src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.d.ts +1 -0
- 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/DataGridSearchbar.d.ts +10 -0
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridToolbar.d.ts +4 -4
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridToolbarWrapper.d.ts +10 -0
- 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 +2 -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 +32 -8
- package/src/components/DataGrid/DataGridBody/DataGridBody.tsx +3 -0
- package/src/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.tsx +34 -2
- package/src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.tsx +3 -0
- 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/DataGridSearchbar.tsx +68 -0
- package/src/components/DataGrid/DataGridFilters/DataGridToolbar.module.scss +40 -18
- package/src/components/DataGrid/DataGridFilters/DataGridToolbar.tsx +34 -62
- package/src/components/DataGrid/DataGridFilters/DataGridToolbarWrapper.tsx +38 -0
- 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/Form/FileUpload/FileUpload.module.scss +1 -2
- package/src/components/Form/Select/MultiSelect/MultiSelect.tsx +1 -3
- package/src/components/Form/Select/SingleSelect/Select.tsx +1 -3
- package/src/components/Icon/Icon.module.scss +5 -0
- package/src/components/Icon/Icon.tsx +2 -1
- package/src/components/Notifications/BaseModal/BaseModal.tsx +1 -1
- package/src/font/icomoon.eot +0 -0
- package/src/font/icomoon.svg +1 -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"),a=require("./DataGrid.module.scss.cjs.js"),t=require("./DataGridHeader/DataGridHeader.cjs.js"),i=require("./DataGridActions/DataGridActions.cjs.js"),
|
|
1
|
+
"use strict";var e=require("react"),a=require("./DataGrid.module.scss.cjs.js"),t=require("./DataGridHeader/DataGridHeader.cjs.js"),i=require("./DataGridActions/DataGridActions.cjs.js"),r=require("./DataGridBody/DataGridBody.cjs.js"),d=require("../Pagination/Pagination.cjs.js"),n=require("../src/hooks/useSpacing.cjs.js"),l=require("./DataGridFilters/DataGridToolbar.cjs.js"),o=require("./DataGridFilters/DataGridToolbarWrapper.cjs.js"),s=require("./DataGridFilters/DataGridSearchbar.cjs.js");const c=e.forwardRef((({children:c,data:u,initialSort:p,onSort:g,headers:m,actions:h={},paginationProps:b,disableContextMenuColumn:f,enableExpandableRow:D,filters:G,search:j,toolbarButtons:v,isLoading:E,enableMultiSorting:S,emptyLabel:w,spacing:y,style:q,...L},B)=>{var R;if(!m)throw new Error("Headers definition has to be provided");if(!c)throw new Error("DataGridBody should be provided with a template how to render rows");const[T,C]=e.useState(m),x=n.useSpacing(y,q);e.useEffect((()=>C(m)),[m]);if(null==x?void 0:x.padding){const e=x.padding.toString().split(" ");let a=0;e.length>=2&&(a=1),4===e.length&&(a=3),Object.defineProperties(x,{paddingTop:{value:e[0]},paddingRight:{value:e[e.length-1>0?1:0]},paddingBottom:{value:e[e.length/3>=1?2:0]},paddingLeft:{value:e[a]}})}return e.createElement("div",{...L,className:a.default["grid-wrapper"],ref:B,style:{paddingTop:null==x?void 0:x.paddingTop,paddingBottom:null==x?void 0:x.paddingBottom}},G||j||v?e.createElement(o.DataGridToolbarWrapper,{filters:e.createElement(e.Fragment,null,j&&e.createElement(s.DataGridSearchbar,{...j}),G&&e.createElement(l.DataGridToolbar,{...G})),buttons:v}):e.createElement(i.DataGridActions,{...h,style:{paddingLeft:null==x?void 0:x.paddingLeft,paddingRight:null==x?void 0:x.paddingRight},headers:T,onColumnToggled:e=>{C(T.map((a=>a.name!==e?a:{...a,hidden:!a.hidden})))}}),e.createElement("div",{className:a.default["table-wrapper"]},e.createElement("table",{className:a.default.table},e.createElement(t.DataGridHeader,{headers:T,initialSort:p,onSort:g,disableContextMenuColumn:f,enableExpandableRow:D,enableMultiSorting:S,spacing:x}),e.createElement(r.DataGridBody,{data:u,headers:T,isLoading:E,disableContextMenuColumn:f,emptyLabel:w,spacing:x,searchValue:null==j?void 0:j.initialSearchValue},c))),b&&!E&&e.createElement(d.Pagination,{...b,style:{...b.style,paddingLeft:null==x?void 0:x.paddingLeft,paddingRight:null==x?void 0:x.paddingRight},className:`${a.default.pagination} ${null!==(R=b.className)&&void 0!==R?R:""}`}))}));exports.DataGrid=c;
|
|
2
2
|
//# sourceMappingURL=DataGrid.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.cjs.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, {
|
|
1
|
+
{"version":3,"file":"DataGrid.cjs.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":["DataGrid","React","forwardRef","children","data","initialSort","onSort","headers","actions","paginationProps","disableContextMenuColumn","enableExpandableRow","filters","search","toolbarButtons","isLoading","enableMultiSorting","emptyLabel","spacing","style","rest","ref","Error","internalHeaders","setInternalHeaders","useState","styleWithSpacing","useSpacing","useEffect","padding","splitPaddings","toString","split","paddingLeftIndex","length","Object","defineProperties","paddingTop","value","paddingRight","paddingBottom","paddingLeft","createElement","className","classes","DataGridToolbarWrapper","Fragment","DataGridSearchbar","DataGridToolbar","buttons","DataGridActions","onColumnToggled","colName","map","item","name","hidden","DataGridHeader","DataGridBody","searchValue","initialSearchValue","Pagination","default","_a"],"mappings":"6eAoEA,MA8IaA,EAAWC,EAAMC,YA9IR,EAElBC,WACAC,OACAC,cACAC,SACAC,UACAC,UAAU,GACVC,kBACAC,2BACAC,sBACAC,UACAC,SACAC,iBACAC,YACAC,qBACAC,aACAC,UACAC,WACGC,GAELC,WAEA,IAAKd,EACH,MAAM,IAAIe,MAAM,yCAElB,IAAKnB,EACH,MAAM,IAAImB,MAAM,sEAGlB,MAAOC,EAAiBC,GAAsBC,EAAQA,SAAClB,GACjDmB,EAAmBC,EAAAA,WAAWT,EAASC,GAE7CS,EAASA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B3C,EAAAyC,cAACe,iBAAc,CACblD,QAASgB,EACTlB,YAAaA,EACbC,OAAQA,EACRI,yBAA0BA,EAC1BC,oBAAqBA,EACrBK,mBAAoBA,EACpBE,QAASQ,IAEXzB,EAAAyC,cAACgB,EAAAA,aACC,CAAAtD,KAAMA,EACNG,QAASgB,EACTR,UAAWA,EACXL,yBAA0BA,EAC1BO,WAAYA,EACZC,QAASQ,EACTiC,YAAa9C,aAAM,EAANA,EAAQ+C,oBAEpBzD,KAINM,IAAoBM,GACnBd,EAACyC,cAAAmB,EAAAA,WACK,IAAApD,EACJU,MAAO,IACFV,EAAgBU,MACnBsB,YAAaf,aAAA,EAAAA,EAAkBe,YAC/BF,aAAcb,aAAA,EAAAA,EAAkBa,cAElCI,UAAW,GAAGC,EAAOkB,QAAa,sBAAKC,EAAAtD,EAAgBkC,yBAAa,OAI1E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),a=require("./DataGridCell/DataGridCell.cjs.js"),r=require("./DataGridRow/DataGridRow.cjs.js"),t=require("./DataGridBody.module.scss.cjs.js"),l=require("../../Typography/Typography.cjs.js");const n=e.forwardRef((({children:n,data:i,headers:d,isLoading:s,disableContextMenuColumn:o,emptyLabel:c,spacing:m,...y},
|
|
1
|
+
"use strict";var e=require("react"),a=require("./DataGridCell/DataGridCell.cjs.js"),r=require("./DataGridRow/DataGridRow.cjs.js"),t=require("./DataGridBody.module.scss.cjs.js"),l=require("../../Typography/Typography.cjs.js");const n=e.forwardRef((({children:n,data:i,headers:d,isLoading:s,disableContextMenuColumn:o,emptyLabel:c,spacing:m,searchValue:u,...y},p)=>e.createElement("tbody",{...y,ref:p},(()=>{const y=d.filter((e=>!e.hidden)).length;if(s)return Array.from(Array(9)).map(((t,l)=>e.createElement(r.DataGridRow,{key:l,isLoading:!0},Array.from(Array(y)).map(((r,t)=>e.createElement(a.DataGridCell,{key:t,isLoading:!0}))),!o&&e.createElement(a.DataGridCell,null))));return!i||0===i.length?e.createElement("tr",null,e.createElement("td",{className:t.default.empty,colSpan:y+(o?0:1)},e.createElement(l.Typography,{variant:"body",spacing:{margin:0}},c))):null==i?void 0:i.map(((a,r)=>e.cloneElement(n({item:a,index:r}),{searchValue:u,headers:d,spacing:m,disableContextMenuColumn:o})))})())));exports.DataGridBody=n;
|
|
2
2
|
//# sourceMappingURL=DataGridBody.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridBody.cjs.js","sources":["../../../../../../src/components/DataGrid/DataGridBody/DataGridBody.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 } from \"react\";\nimport { HeaderCell } from \"../datagrid.interfaces\";\nimport { DataGridCell } from \"./DataGridCell/DataGridCell\";\nimport { DataGridRow } from \"./DataGridRow/DataGridRow\";\nimport classes from \"./DataGridBody.module.scss\";\nimport { Typography } from \"../../Typography/Typography\";\n\nexport interface Props<T> extends Omit<ComponentPropsWithRef<\"tbody\">, \"children\"> {\n children: ({ item, index }: { item: T; index: number }) => ReactElement;\n data?: T[];\n headers: HeaderCell[];\n isLoading?: boolean;\n disableContextMenuColumn?: boolean;\n emptyLabel?: string;\n spacing?: React.CSSProperties;\n}\n\nconst skeletonLoadingRows = 9;\n\nconst DataGridBodyInner = <T extends {}>(\n {\n children,\n data,\n headers,\n isLoading,\n disableContextMenuColumn,\n emptyLabel,\n spacing,\n ...rest\n }: Props<T>,\n ref: Ref<HTMLTableSectionElement>\n) => {\n const renderContent = () => {\n const visibleColumns = headers.filter(header => !header.hidden).length;\n if (isLoading) {\n return Array.from(Array(skeletonLoadingRows)).map((_, rowIdx) => (\n <DataGridRow key={rowIdx} isLoading>\n {Array.from(Array(visibleColumns)).map((__, colIdx) => (\n <DataGridCell key={colIdx} isLoading></DataGridCell>\n ))}\n {!disableContextMenuColumn && <DataGridCell></DataGridCell>}\n </DataGridRow>\n ));\n }\n\n const emptyData = !data || data.length === 0;\n if (emptyData) {\n return (\n <tr>\n <td\n className={classes[\"empty\"]}\n colSpan={visibleColumns + (disableContextMenuColumn ? 0 : 1)}\n >\n <Typography variant=\"body\" spacing={{ margin: 0 }}>\n {emptyLabel}\n </Typography>\n </td>\n </tr>\n );\n }\n\n return data?.map((item, index) => {\n return React.cloneElement(children({ item, index }), {\n headers,\n spacing,\n disableContextMenuColumn\n });\n });\n };\n\n return (\n <tbody {...rest} ref={ref}>\n {renderContent()}\n </tbody>\n );\n};\n\nexport const DataGridBody = React.forwardRef(DataGridBodyInner) as <T extends {}>(\n p: Props<T> & { ref?: Ref<HTMLTableSectionElement> }\n) => ReactElement;\n"],"names":["DataGridBody","React","forwardRef","children","data","headers","isLoading","disableContextMenuColumn","emptyLabel","spacing","rest","ref","createElement","visibleColumns","filter","header","hidden","length","Array","from","map","_","rowIdx","DataGridRow","key","__","colIdx","DataGridCell","className","classes","colSpan","Typography","variant","margin","item","index","cloneElement","renderContent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataGridBody.cjs.js","sources":["../../../../../../src/components/DataGrid/DataGridBody/DataGridBody.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 } from \"react\";\nimport { HeaderCell } from \"../datagrid.interfaces\";\nimport { DataGridCell } from \"./DataGridCell/DataGridCell\";\nimport { DataGridRow } from \"./DataGridRow/DataGridRow\";\nimport classes from \"./DataGridBody.module.scss\";\nimport { Typography } from \"../../Typography/Typography\";\n\nexport interface Props<T> extends Omit<ComponentPropsWithRef<\"tbody\">, \"children\"> {\n children: ({ item, index }: { item: T; index: number }) => ReactElement;\n data?: T[];\n headers: HeaderCell[];\n isLoading?: boolean;\n disableContextMenuColumn?: boolean;\n searchValue?: string;\n emptyLabel?: string;\n spacing?: React.CSSProperties;\n}\n\nconst skeletonLoadingRows = 9;\n\nconst DataGridBodyInner = <T extends {}>(\n {\n children,\n data,\n headers,\n isLoading,\n disableContextMenuColumn,\n emptyLabel,\n spacing,\n searchValue,\n ...rest\n }: Props<T>,\n ref: Ref<HTMLTableSectionElement>\n) => {\n const renderContent = () => {\n const visibleColumns = headers.filter(header => !header.hidden).length;\n if (isLoading) {\n return Array.from(Array(skeletonLoadingRows)).map((_, rowIdx) => (\n <DataGridRow key={rowIdx} isLoading>\n {Array.from(Array(visibleColumns)).map((__, colIdx) => (\n <DataGridCell key={colIdx} isLoading></DataGridCell>\n ))}\n {!disableContextMenuColumn && <DataGridCell></DataGridCell>}\n </DataGridRow>\n ));\n }\n\n const emptyData = !data || data.length === 0;\n if (emptyData) {\n return (\n <tr>\n <td\n className={classes[\"empty\"]}\n colSpan={visibleColumns + (disableContextMenuColumn ? 0 : 1)}\n >\n <Typography variant=\"body\" spacing={{ margin: 0 }}>\n {emptyLabel}\n </Typography>\n </td>\n </tr>\n );\n }\n\n return data?.map((item, index) => {\n return React.cloneElement(children({ item, index }), {\n searchValue: searchValue,\n headers,\n spacing,\n disableContextMenuColumn\n });\n });\n };\n\n return (\n <tbody {...rest} ref={ref}>\n {renderContent()}\n </tbody>\n );\n};\n\nexport const DataGridBody = React.forwardRef(DataGridBodyInner) as <T extends {}>(\n p: Props<T> & { ref?: Ref<HTMLTableSectionElement> }\n) => ReactElement;\n"],"names":["DataGridBody","React","forwardRef","children","data","headers","isLoading","disableContextMenuColumn","emptyLabel","spacing","searchValue","rest","ref","createElement","visibleColumns","filter","header","hidden","length","Array","from","map","_","rowIdx","DataGridRow","key","__","colIdx","DataGridCell","className","classes","colSpan","Typography","variant","margin","item","index","cloneElement","renderContent"],"mappings":"iOAkCA,MA8DaA,EAAeC,EAAMC,YA5DR,EAEtBC,WACAC,OACAC,UACAC,YACAC,2BACAC,aACAC,UACAC,iBACGC,GAELC,IA0CEX,EAAAY,cAAA,QAAA,IAAWF,EAAMC,IAAKA,GAxCF,MACpB,MAAME,EAAiBT,EAAQU,QAAOC,IAAWA,EAAOC,SAAQC,OAChE,GAAIZ,EACF,OAAOa,MAAMC,KAAKD,MAnBI,IAmBwBE,KAAI,CAACC,EAAGC,IACpDtB,EAAAY,cAACW,cAAW,CAACC,IAAKF,EAAQjB,WAAS,GAChCa,MAAMC,KAAKD,MAAML,IAAiBO,KAAI,CAACK,EAAIC,IAC1C1B,EAAAY,cAACe,EAAYA,aAAA,CAACH,IAAKE,EAAQrB,WAAS,OAEpCC,GAA4BN,EAACY,cAAAe,EAAYA,sBAMjD,OADmBxB,GAAwB,IAAhBA,EAAKc,OAG5BjB,EAAAY,cAAA,KAAA,KACEZ,EACEY,cAAA,KAAA,CAAAgB,UAAWC,EAAAA,QAAe,MAC1BC,QAASjB,GAAkBP,EAA2B,EAAI,IAE1DN,EAAAY,cAACmB,EAAAA,WAAW,CAAAC,QAAQ,OAAOxB,QAAS,CAAEyB,OAAQ,IAC3C1B,KAOJJ,aAAI,EAAJA,EAAMiB,KAAI,CAACc,EAAMC,IACfnC,EAAMoC,aAAalC,EAAS,CAAEgC,OAAMC,UAAU,CACnD1B,YAAaA,EACbL,UACAI,UACAF,8BAEF,EAKC+B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),a=require("../../../Typography/Typography.cjs.js"),
|
|
1
|
+
"use strict";var e=require("react"),a=require("../../../Typography/Typography.cjs.js"),t=require("./DataGridCell.module.scss.cjs.js");const l=e.forwardRef((({children:l,className:r,isLoading:n,spacing:i,searchValue:s,cellIndex:d,columnLength:c,disableContextMenuColumn:o,...u},g)=>{let m={};0===d&&(m.paddingLeft=null==i?void 0:i.paddingLeft),(d===c&&!o||c&&d===c-1&&o)&&(m.paddingRight=null==i?void 0:i.paddingRight);return e.createElement("td",{...u,ref:g,style:{...u.style,...m},className:`${t.default.cell} ${null!=r?r:""}`},n&&e.createElement("div",{className:t.default.loading,"aria-busy":"true","aria-live":"polite"}),!n&&e.createElement(a.Typography,{className:t.default.text,variant:"body",tag:"span"},(()=>{var a;if("string"==typeof l&&s){if(!l.toLowerCase().includes(s.toLowerCase()))return l;const t=new RegExp(s,"i").exec(l),r=l.split(null!==(a=null==t?void 0:t[0])&&void 0!==a?a:"");return r.map(((a,l)=>l===r.length-1?e.createElement(e.Fragment,{key:`${a}-${l}`},a):e.createElement(e.Fragment,{key:`${a}-${l}`},a,e.createElement("mark",{"data-testid":`${t}-mark`},t))))}return l})()))}));exports.DataGridCell=l;
|
|
2
2
|
//# sourceMappingURL=DataGridCell.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridCell.cjs.js","sources":["../../../../../../../src/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.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, {
|
|
1
|
+
{"version":3,"file":"DataGridCell.cjs.js","sources":["../../../../../../../src/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.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 ReactElement,\n Fragment\n} from \"react\";\nimport { Typography } from \"../../../Typography/Typography\";\nimport classes from \"./DataGridCell.module.scss\";\n\nexport interface Props extends ComponentPropsWithRef<\"td\"> {\n children?: ReactElement | string | number;\n isLoading?: boolean;\n spacing?: React.CSSProperties;\n searchValue?: string;\n cellIndex?: number;\n columnLength?: number;\n disableContextMenuColumn?: boolean;\n}\n\nconst DataGridCellComponent: ForwardRefRenderFunction<HTMLTableCellElement, Props> = (\n {\n children,\n className,\n isLoading,\n spacing,\n searchValue,\n cellIndex,\n columnLength,\n disableContextMenuColumn,\n ...rest\n }: Props,\n ref\n) => {\n let cellStyle: React.CSSProperties = {};\n\n if (cellIndex === 0) {\n cellStyle.paddingLeft = spacing?.paddingLeft;\n }\n if (\n (cellIndex === columnLength && !disableContextMenuColumn) ||\n (columnLength && cellIndex === columnLength - 1 && disableContextMenuColumn)\n ) {\n cellStyle.paddingRight = spacing?.paddingRight;\n }\n\n //NOTE: we might want to migrate to Highlight API once it's supported by Firefox\n const renderContent = () => {\n if (typeof children === \"string\" && searchValue) {\n if (!children.toLowerCase().includes(searchValue.toLowerCase())) {\n return children;\n }\n\n const matchingSequence = new RegExp(searchValue, \"i\").exec(children);\n\n const parts = children.split(matchingSequence?.[0] ?? \"\");\n return parts.map((part, i) => {\n if (i === parts.length - 1) return <Fragment key={`${part}-${i}`}>{part}</Fragment>;\n\n return (\n <Fragment key={`${part}-${i}`}>\n {part}\n <mark data-testid={`${matchingSequence}-mark`}>{matchingSequence}</mark>\n </Fragment>\n );\n });\n }\n\n return children;\n };\n\n return (\n <td\n {...rest}\n ref={ref}\n style={{ ...rest.style, ...cellStyle }}\n className={`${classes[\"cell\"]} ${className ?? \"\"}`}\n >\n {isLoading && <div className={classes[\"loading\"]} aria-busy=\"true\" aria-live=\"polite\"></div>}\n {!isLoading && (\n <Typography className={classes[\"text\"]} variant=\"body\" tag=\"span\">\n {renderContent()}\n </Typography>\n )}\n </td>\n );\n};\n\nexport const DataGridCell = React.forwardRef(DataGridCellComponent);\n"],"names":["DataGridCell","React","forwardRef","children","className","isLoading","spacing","searchValue","cellIndex","columnLength","disableContextMenuColumn","rest","ref","cellStyle","paddingLeft","paddingRight","createElement","style","classes","default","Typography","variant","tag","toLowerCase","includes","matchingSequence","RegExp","exec","parts","split","_a","map","part","i","length","Fragment","key","renderContent"],"mappings":"sIAmCA,MAoEaA,EAAeC,EAAMC,YApEmD,EAEjFC,WACAC,YACAC,YACAC,UACAC,cACAC,YACAC,eACAC,8BACGC,GAELC,KAEA,IAAIC,EAAiC,CAAA,EAEnB,IAAdL,IACFK,EAAUC,YAAcR,aAAA,EAAAA,EAASQ,cAGhCN,IAAcC,IAAiBC,GAC/BD,GAAgBD,IAAcC,EAAe,GAAKC,KAEnDG,EAAUE,aAAeT,aAAA,EAAAA,EAASS,cA4BpC,OACEd,EAAAe,cAAA,KAAA,IACML,EACJC,IAAKA,EACLK,MAAO,IAAKN,EAAKM,SAAUJ,GAC3BT,UAAW,GAAGc,EAAOC,QAAO,QAAKf,QAAAA,EAAa,MAE7CC,GAAaJ,EAAAe,cAAA,MAAA,CAAKZ,UAAWc,EAAAA,QAAiB,QAAa,YAAA,OAAiB,YAAA,YAC3Eb,GACAJ,EAACe,cAAAI,EAAAA,WAAW,CAAAhB,UAAWc,UAAc,KAAGG,QAAQ,OAAOC,IAAI,QAjC3C,YACpB,GAAwB,iBAAbnB,GAAyBI,EAAa,CAC/C,IAAKJ,EAASoB,cAAcC,SAASjB,EAAYgB,eAC/C,OAAOpB,EAGT,MAAMsB,EAAmB,IAAIC,OAAOnB,EAAa,KAAKoB,KAAKxB,GAErDyB,EAAQzB,EAAS0B,MAA+B,UAAzBJ,aAAgB,EAAhBA,EAAmB,UAAM,IAAAK,EAAAA,EAAA,IACtD,OAAOF,EAAMG,KAAI,CAACC,EAAMC,IAClBA,IAAML,EAAMM,OAAS,EAAUjC,EAACe,cAAAmB,EAAQA,SAAC,CAAAC,IAAK,GAAGJ,KAAQC,KAAMD,GAGjE/B,EAACe,cAAAmB,EAAAA,SAAS,CAAAC,IAAK,GAAGJ,KAAQC,KACvBD,EACD/B,EAAmBe,cAAA,OAAA,CAAA,cAAA,GAAGS,UAA0BA,KAIvD,CAED,OAAOtB,CAAQ,EAaRkC,IAIP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),r=require("./DataGridRow.module.scss.cjs.js"),a=require("../../../Button/IconButton.cjs.js"),t=require("../../../Icon/Icon.cjs.js"),n=require("../DataGridCell/DataGridCell.cjs.js"),l=require("../DataGridDrawer/DataGridDrawer.cjs.js"),d=require("../../../src/util/helper.cjs.js");const o=e.forwardRef((({children:o,className:s,headers:c,
|
|
1
|
+
"use strict";var e=require("react"),r=require("./DataGridRow.module.scss.cjs.js"),a=require("../../../Button/IconButton.cjs.js"),t=require("../../../Icon/Icon.cjs.js"),n=require("../DataGridCell/DataGridCell.cjs.js"),l=require("../DataGridDrawer/DataGridDrawer.cjs.js"),d=require("../../../src/util/helper.cjs.js");const o=e.forwardRef((({children:o,className:s,headers:c,searchValue:i,isLoading:u,spacing:p,expandableRowProps:m,disableContextMenuColumn:h,...w},D)=>{const{enableExpandableRow:x=!1,expandButtonId:I=`ID-${d.generateID()}`,expandButtonTitle:j="Expand row",drawerId:b=`ID-${d.generateID()}`,expandableRowContent:g}=m||{},[C,E]=e.useState(!1),f=e.Children.map(o,((r,a)=>{if(r){const t=e.cloneElement(r,{searchValue:i,spacing:p,cellIndex:a,columnLength:null==c?void 0:c.length,disableContextMenuColumn:h});return(!(c&&c.length>a)||!c[a].hidden)&&t}return null})),G=[r.default.row];return s&&G.push(s),x?!C&&G.push(r.default["border-drawer"]):G.push(r.default.border),u&&G.push(r.default.loading),e.createElement(e.Fragment,null,e.createElement("tr",{...w,ref:D,className:G.join(" ")},x&&e.createElement(n.DataGridCell,{className:r.default["expand-button-cell"],onClick:()=>E(!C),style:{width:"1px"}},e.createElement(a.IconButton,{id:I,title:j,"aria-expanded":C,"aria-controls":b},e.createElement(t.Icon,{size:"0.75rem",icon:C?t.Icons.ChevronUp:t.Icons.ChevronDown}))),f),x&&e.createElement("tr",{className:`${r.default.row} ${C?r.default["border-drawer"]:""}`},e.createElement("td",{colSpan:f.length+1},e.createElement(l.DataGridDrawer,{id:b,role:"region","aria-labelledby":I,isExpanded:C},g))))}));exports.DataGridRow=o;
|
|
2
2
|
//# sourceMappingURL=DataGridRow.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridRow.cjs.js","sources":["../../../../../../../src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.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, useState, Fragment, ForwardRefRenderFunction } from \"react\";\nimport { HeaderCell } from \"../../datagrid.interfaces\";\nimport classes from \"./DataGridRow.module.scss\";\nimport { IconButton } from \"../../../Button/IconButton\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { DataGridCell } from \"../DataGridCell/DataGridCell\";\nimport { DataGridDrawer } from \"../DataGridDrawer/DataGridDrawer\";\nimport { generateID } from \"../../../../util/helper\";\n\nexport interface Props extends ComponentPropsWithRef<\"tr\"> {\n headers?: HeaderCell[];\n isLoading?: boolean;\n spacing?: React.CSSProperties;\n disableContextMenuColumn?: boolean;\n expandableRowProps?: {\n enableExpandableRow: boolean;\n expandableRowContent: React.ReactNode;\n expandButtonTitle?: string;\n expandButtonId?: string;\n drawerId?: string;\n };\n}\n\nconst DataGridRowComponent: ForwardRefRenderFunction<HTMLTableRowElement, Props> = (\n {\n children,\n className,\n headers,\n isLoading,\n spacing,\n expandableRowProps,\n disableContextMenuColumn,\n ...rest\n },\n ref\n) => {\n const {\n enableExpandableRow = false,\n expandButtonId = `ID-${generateID()}`,\n expandButtonTitle = \"Expand row\",\n drawerId = `ID-${generateID()}`,\n expandableRowContent\n } = expandableRowProps || {};\n const [isRowExpanded, setIsRowExpanded] = useState(false);\n const visibleCells = React.Children.map(children as React.ReactElement[], (child, index) => {\n if (child) {\n const cellWithSpacing = React.cloneElement(child, {\n spacing: spacing,\n cellIndex: index,\n columnLength: headers?.length,\n disableContextMenuColumn\n });\n\n const visible = headers && headers.length > index ? !headers[index].hidden : true;\n return visible && cellWithSpacing;\n }\n return null;\n });\n\n const classNames = [classes[\"row\"]];\n className && classNames.push(className);\n enableExpandableRow\n ? !isRowExpanded && classNames.push(classes[\"border-drawer\"])\n : classNames.push(classes[\"border\"]);\n isLoading && classNames.push(classes[\"loading\"]);\n\n return (\n <Fragment>\n <tr {...rest} ref={ref} className={classNames.join(\" \")}>\n {enableExpandableRow && (\n <DataGridCell\n className={classes[\"expand-button-cell\"]}\n onClick={() => setIsRowExpanded(!isRowExpanded)}\n style={{ width: \"1px\" }}\n >\n <IconButton\n id={expandButtonId}\n title={expandButtonTitle}\n aria-expanded={isRowExpanded}\n aria-controls={drawerId}\n >\n <Icon size=\"0.75rem\" icon={isRowExpanded ? Icons.ChevronUp : Icons.ChevronDown} />\n </IconButton>\n </DataGridCell>\n )}\n {visibleCells}\n </tr>\n {enableExpandableRow && (\n <tr className={`${classes[\"row\"]} ${isRowExpanded ? classes[\"border-drawer\"] : \"\"}`}>\n <td colSpan={visibleCells.length + 1}>\n <DataGridDrawer\n id={drawerId}\n role=\"region\"\n aria-labelledby={expandButtonId}\n isExpanded={isRowExpanded}\n >\n {expandableRowContent}\n </DataGridDrawer>\n </td>\n </tr>\n )}\n </Fragment>\n );\n};\n\nexport const DataGridRow = React.forwardRef(DataGridRowComponent);\n"],"names":["DataGridRow","React","forwardRef","children","className","headers","isLoading","spacing","expandableRowProps","disableContextMenuColumn","rest","ref","enableExpandableRow","expandButtonId","generateID","expandButtonTitle","drawerId","expandableRowContent","isRowExpanded","setIsRowExpanded","useState","visibleCells","Children","map","child","index","cellWithSpacing","cloneElement","cellIndex","columnLength","length","hidden","classNames","classes","push","default","Fragment","createElement","join","DataGridCell","onClick","style","width","IconButton","id","title","Icon","size","icon","Icons","ChevronUp","ChevronDown","colSpan","DataGridDrawer","role","isExpanded"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataGridRow.cjs.js","sources":["../../../../../../../src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.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, useState, Fragment, ForwardRefRenderFunction } from \"react\";\nimport { HeaderCell } from \"../../datagrid.interfaces\";\nimport classes from \"./DataGridRow.module.scss\";\nimport { IconButton } from \"../../../Button/IconButton\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { DataGridCell } from \"../DataGridCell/DataGridCell\";\nimport { DataGridDrawer } from \"../DataGridDrawer/DataGridDrawer\";\nimport { generateID } from \"../../../../util/helper\";\n\nexport interface Props extends ComponentPropsWithRef<\"tr\"> {\n headers?: HeaderCell[];\n isLoading?: boolean;\n spacing?: React.CSSProperties;\n searchValue?: string;\n disableContextMenuColumn?: boolean;\n expandableRowProps?: {\n enableExpandableRow: boolean;\n expandableRowContent: React.ReactNode;\n expandButtonTitle?: string;\n expandButtonId?: string;\n drawerId?: string;\n };\n}\n\nconst DataGridRowComponent: ForwardRefRenderFunction<HTMLTableRowElement, Props> = (\n {\n children,\n className,\n headers,\n searchValue,\n isLoading,\n spacing,\n expandableRowProps,\n disableContextMenuColumn,\n ...rest\n },\n ref\n) => {\n const {\n enableExpandableRow = false,\n expandButtonId = `ID-${generateID()}`,\n expandButtonTitle = \"Expand row\",\n drawerId = `ID-${generateID()}`,\n expandableRowContent\n } = expandableRowProps || {};\n const [isRowExpanded, setIsRowExpanded] = useState(false);\n const visibleCells = React.Children.map(children as React.ReactElement[], (child, index) => {\n if (child) {\n const cellWithSpacing = React.cloneElement(child, {\n searchValue,\n spacing: spacing,\n cellIndex: index,\n columnLength: headers?.length,\n disableContextMenuColumn\n });\n\n const visible = headers && headers.length > index ? !headers[index].hidden : true;\n return visible && cellWithSpacing;\n }\n return null;\n });\n\n const classNames = [classes[\"row\"]];\n className && classNames.push(className);\n enableExpandableRow\n ? !isRowExpanded && classNames.push(classes[\"border-drawer\"])\n : classNames.push(classes[\"border\"]);\n isLoading && classNames.push(classes[\"loading\"]);\n\n return (\n <Fragment>\n <tr {...rest} ref={ref} className={classNames.join(\" \")}>\n {enableExpandableRow && (\n <DataGridCell\n className={classes[\"expand-button-cell\"]}\n onClick={() => setIsRowExpanded(!isRowExpanded)}\n style={{ width: \"1px\" }}\n >\n <IconButton\n id={expandButtonId}\n title={expandButtonTitle}\n aria-expanded={isRowExpanded}\n aria-controls={drawerId}\n >\n <Icon size=\"0.75rem\" icon={isRowExpanded ? Icons.ChevronUp : Icons.ChevronDown} />\n </IconButton>\n </DataGridCell>\n )}\n {visibleCells}\n </tr>\n {enableExpandableRow && (\n <tr className={`${classes[\"row\"]} ${isRowExpanded ? classes[\"border-drawer\"] : \"\"}`}>\n <td colSpan={visibleCells.length + 1}>\n <DataGridDrawer\n id={drawerId}\n role=\"region\"\n aria-labelledby={expandButtonId}\n isExpanded={isRowExpanded}\n >\n {expandableRowContent}\n </DataGridDrawer>\n </td>\n </tr>\n )}\n </Fragment>\n );\n};\n\nexport const DataGridRow = React.forwardRef(DataGridRowComponent);\n"],"names":["DataGridRow","React","forwardRef","children","className","headers","searchValue","isLoading","spacing","expandableRowProps","disableContextMenuColumn","rest","ref","enableExpandableRow","expandButtonId","generateID","expandButtonTitle","drawerId","expandableRowContent","isRowExpanded","setIsRowExpanded","useState","visibleCells","Children","map","child","index","cellWithSpacing","cloneElement","cellIndex","columnLength","length","hidden","classNames","classes","push","default","Fragment","createElement","join","DataGridCell","onClick","style","width","IconButton","id","title","Icon","size","icon","Icons","ChevronUp","ChevronDown","colSpan","DataGridDrawer","role","isExpanded"],"mappings":"2TAwCA,MAoFaA,EAAcC,EAAMC,YApFkD,EAE/EC,WACAC,YACAC,UACAC,cACAC,YACAC,UACAC,qBACAC,8BACGC,GAELC,KAEA,MAAMC,oBACJA,GAAsB,EAAKC,eAC3BA,EAAiB,MAAMC,EAAUA,eAAIC,kBACrCA,EAAoB,aAAYC,SAChCA,EAAW,MAAMF,iBAAcG,qBAC/BA,GACET,GAAsB,IACnBU,EAAeC,GAAoBC,EAAQA,UAAC,GAC7CC,EAAerB,EAAMsB,SAASC,IAAIrB,GAAkC,CAACsB,EAAOC,KAChF,GAAID,EAAO,CACT,MAAME,EAAkB1B,EAAM2B,aAAaH,EAAO,CAChDnB,cACAE,QAASA,EACTqB,UAAWH,EACXI,aAAczB,aAAA,EAAAA,EAAS0B,OACvBrB,6BAIF,SADgBL,GAAWA,EAAQ0B,OAASL,KAASrB,EAAQqB,GAAOM,SAClDL,CACnB,CACD,OAAO,IAAI,IAGPM,EAAa,CAACC,UAAa,KAOjC,OANA9B,GAAa6B,EAAWE,KAAK/B,GAC7BS,GACKM,GAAiBc,EAAWE,KAAKD,EAAOE,QAAC,kBAC1CH,EAAWE,KAAKD,UAAgB,QACpC3B,GAAa0B,EAAWE,KAAKD,EAAAA,QAAiB,SAG5CjC,gBAACoC,EAAAA,SAAQ,KACPpC,EAAAqC,cAAA,KAAA,IAAQ3B,EAAMC,IAAKA,EAAKR,UAAW6B,EAAWM,KAAK,MAChD1B,GACCZ,EAACqC,cAAAE,EAAAA,aACC,CAAApC,UAAW8B,EAAOE,QAAC,sBACnBK,QAAS,IAAMrB,GAAkBD,GACjCuB,MAAO,CAAEC,MAAO,QAEhB1C,EAAAqC,cAACM,aAAU,CACTC,GAAI/B,EACJgC,MAAO9B,EAAiB,gBACTG,EAAa,gBACbF,GAEfhB,EAACqC,cAAAS,EAAAA,KAAK,CAAAC,KAAK,UAAUC,KAAM9B,EAAgB+B,EAAAA,MAAMC,UAAYD,EAAAA,MAAME,gBAIxE9B,GAEFT,GACCZ,EAAIqC,cAAA,KAAA,CAAAlC,UAAW,GAAG8B,EAAOE,QAAM,OAAKjB,EAAgBe,EAAAA,QAAQ,iBAAmB,MAC7EjC,EAAAqC,cAAA,KAAA,CAAIe,QAAS/B,EAAaS,OAAS,GACjC9B,EAACqC,cAAAgB,EAAcA,gBACbT,GAAI5B,EACJsC,KAAK,SACY,kBAAAzC,EACjB0C,WAAYrC,GAEXD,KAMX"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("react-dom"),r=require("../../src/hooks/useGetDomRoot.cjs.js"),
|
|
1
|
+
"use strict";var e=require("react"),t=require("react-dom"),r=require("../../src/hooks/useGetDomRoot.cjs.js"),o=require("../../src/util/helper.cjs.js"),s=require("./DataGridFilterTag.cjs.js"),a=require("./DataGridFilterPopover.cjs.js"),i=require("./DataGridFilterService.cjs.js");exports.DataGridFilter=({mode:l,filter:n,domRoot:u,columnsMetadata:c,onFilterAdd:d,onFilterEdit:p,onFilterDelete:m,tagTranslations:F,popoverTranslations:D,customEditTagContent:f})=>{const v=e.useRef(null),j=e.useRef(null),R=e.useRef(null),[g,G]=e.useState(!1),{root:q}=r.useGetDomRoot(u,v),{resetFields:E,operator:O,setOperator:T,operators:V,setOperators:k,column:P,setColumn:C,values:h,setValues:S,pickedValues:A,setPickedValues:I,initialiseFilterValues:M}=i.useDataGridFilter(l,c);return e.createElement(e.Fragment,null,e.createElement(s.DataGridFilterTag,{mode:l,onFilterOpen:()=>{G(!g),g||M(n)},onFilterRemove:()=>{if(!n)return;const{id:e}=n;m&&m(e),E(),G(!1)},triggerRef:j,ref:v,filter:n,translations:F,customEditTagContent:f}),t.createPortal(e.createElement(a.DataGridFilterPopover,{popoverRef:R,anchorRef:v,isOpen:g,translations:D,column:P,columnsMetadata:c,values:h,pickedValues:A,operator:O,operators:V,onFilterSubmit:()=>{if("ADD"===l){const e=o.generateID();d&&d({id:e,column:P,operator:O,value:A})}else if("EDIT"===l&&n){const{id:e}=n;p&&p({id:e,column:P,operator:O,value:A})}E(),G(!1)},resetFields:E,setFilterOpen:G,setColumn:C,setOperator:T,setOperators:k,setValues:S,setPickedValues:I}),q))};
|
|
2
2
|
//# sourceMappingURL=DataGridFilter.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridFilter.cjs.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.cjs.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":["mode","filter","domRoot","columnsMetadata","onFilterAdd","onFilterEdit","onFilterDelete","tagTranslations","popoverTranslations","customEditTagContent","wrappingDivRef","useRef","triggerRef","popoverRef","filterOpen","setFilterOpen","useState","root","useGetDomRoot","resetFields","operator","setOperator","operators","setOperators","column","setColumn","values","setValues","pickedValues","setPickedValues","initialiseFilterValues","useDataGridFilter","React","Fragment","createElement","DataGridFilterTag","onFilterOpen","onFilterRemove","id","ref","translations","createPortal","DataGridFilterPopover","anchorRef","isOpen","onFilterSubmit","generateID","value"],"mappings":"8SA4C8B,EAC5BA,OACAC,SACAC,UACAC,kBACAC,cACAC,eACAC,iBACAC,kBACAC,sBACAC,2BAEA,MAAMC,EAAiBC,SAAuB,MACxCC,EAAaD,SAA0B,MACvCE,EAAaF,SAAuB,OAEnCG,EAAYC,GAAiBC,EAAQA,UAAC,IACvCC,KAAEA,GAASC,EAAaA,cAAChB,EAASQ,IAClCS,YACJA,EAAWC,SACXA,EAAQC,YACRA,EAAWC,UACXA,EAASC,aACTA,EAAYC,OACZA,EAAMC,UACNA,EAASC,OACTA,EAAMC,UACNA,EAASC,aACTA,EAAYC,gBACZA,EAAeC,uBACfA,GACEC,oBAAkB/B,EAAMG,GAiC5B,OACE6B,gBAACC,EAAAA,SAAQ,KACPD,EAAAE,cAACC,EAAAA,kBAAiB,CAChBnC,KAAMA,EACNoC,aAXe,KACnBrB,GAAeD,GACVA,GACHgB,EAAuB7B,EACxB,EAQGoC,eAvBiB,KACrB,IAAKpC,EACH,OAGF,MAAMqC,GAAEA,GAAOrC,EACfK,GAAkBA,EAAegC,GAEjCnB,IACAJ,GAAc,EAAM,EAehBH,WAAYA,EACZ2B,IAAK7B,EACLT,OAAQA,EACRuC,aAAcjC,EACdE,qBAAsBA,IAEvBgC,eACCT,EAACE,cAAAQ,wBACC,CAAA7B,WAAYA,EACZ8B,UAAWjC,EACXkC,OAAQ9B,EACR0B,aAAchC,EACdgB,OAAQA,EACRrB,gBAAiBA,EACjBuB,OAAQA,EACRE,aAAcA,EACdR,SAAUA,EACVE,UAAWA,EACXuB,eAvDe,KACrB,GAAa,QAAT7C,EAAgB,CAClB,MAAMsC,EAAKQ,EAAAA,aACX1C,GAAeA,EAAY,CAAEkC,KAAId,SAAQJ,WAAU2B,MAAOnB,GAC3D,MAAM,GAAa,SAAT5B,GAAmBC,EAAQ,CACpC,MAAMqC,GAAEA,GAAOrC,EACfI,GAAgBA,EAAa,CAAEiC,KAAId,SAAQJ,WAAU2B,MAAOnB,GAC7D,CAEDT,IACAJ,GAAc,EAAM,EA8CdI,YAAaA,EACbJ,cAAeA,EACfU,UAAWA,EACXJ,YAAaA,EACbE,aAAcA,EACdI,UAAWA,EACXE,gBAAiBA,IAEnBZ,GAGJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});require("../../node_modules/style-inject/dist/style-inject.es.cjs.js").default('/*!\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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkRhdGFHcmlkRmlsdGVyLm1vZHVsZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWVBOzs7Ozs7Ozs7Ozs7OztFQWNFO0FBQ0Y7Ozs7Ozs7Ozs7Ozs7O0VBY0UsQ0FDRixzQ0FPRSxrQkFBc0IsQ0FDdEIsUUFBUyxDQUxULFVBQVcsQ0FFWCxXQUFZLENBQ1osZUFBZ0IsQ0FGaEIsU0FBVSxDQUhWLGlCQUFrQixDQUNsQixTQU9GLENBRUEscUNBQ0UsWUFDRixDQUVBLHVDQUNFLDREQUNGLENBQ0EsdUNBQ0UsdUNBQ0UsdUJBQ0YsQ0FDRixDQUVBLHdDQUNFLDZEQUNGLENBQ0EsdUNBQ0Usd0NBQ0UsdUJBQ0YsQ0FDRixDQUVBLGlEQUNFLEdBQ0UsMkJBQ0YsQ0FDQSxHQUNFLHVCQUNGLENBQ0YsQ0FDQSxrREFDRSxHQUNFLHVCQUNGLENBQ0EsR0FDRSwyQkFDRixDQUNGLENBQ0EsNkNBR0Usa0JBQW1CLENBSW5CLDBDQUEyQyxDQUQzQyxzQkFBdUIsQ0FMd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aXJzdC1jaGlsZCB7XG4gIGZsZXgtZ3JvdzogMS44O1xuICBmbGV4LXNocmluazogMDtcbiAgbWFyZ2luLXRvcDogMDtcbn1cbi5wb3BvdmVyIC5jb250cm9scyA+ICo6bnRoLWNoaWxkKDIpIHtcbiAgZmxleC1ncm93OiAxO1xuICBmbGV4LXNocmluazogMDtcbiAgbWFyZ2luLXRvcDogMDtcbn1cbi5wb3BvdmVyIC5hY3Rpb25zIHtcbiAgZGlzcGxheTogZmxleDtcbiAgZ2FwOiAxcmVtO1xufSJdfQ== */'),exports.default={"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"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});require("../../node_modules/style-inject/dist/style-inject.es.cjs.js").default('/*!\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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkRhdGFHcmlkRmlsdGVyLm1vZHVsZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWVBOzs7Ozs7Ozs7Ozs7OztFQWNFO0FBQ0Y7Ozs7Ozs7Ozs7Ozs7O0VBY0UsQ0FDRixzQ0FPRSxrQkFBc0IsQ0FDdEIsUUFBUyxDQUxULFVBQVcsQ0FFWCxXQUFZLENBQ1osZUFBZ0IsQ0FGaEIsU0FBVSxDQUhWLGlCQUFrQixDQUNsQixTQU9GLENBRUEscUN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cbn1cblxuLmNvbHVtbi1zZWxlY3Qtb3B0aW9uIHtcbiAgdGV4dC10cmFuc2Zvcm06IGNhcGl0YWxpemU7XG59XG5cbi5wb3BvdmVyIHtcbiAgZGlzcGxheTogZmxleDtcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgYWxpZ24taXRlbXM6IGZsZXgtc3RhcnQ7XG4gIGdhcDogMXJlbTtcbiAgcGFkZGluZzogMXJlbSAwLjc1cmVtO1xuICBtaW4td2lkdGg6IDQwcmVtO1xufVxuLnBvcG92ZXIgLmNvbnRyb2xzIHtcbiAgd2lkdGg6IDEwMCU7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGdhcDogMXJlbTtcbn1cbi5wb3BvdmVyIC5jb250cm9scyA+ICo6Zmlyc3QtY2hpbGQge1xuICBmbGV4LWdyb3c6IDEuODtcbiAgZmxleC1zaHJpbms6IDA7XG4gIG1hcmdpbi10b3A6IDA7XG59XG4ucG9wb3ZlciAuY29udHJvbHMgPiAqOm50aC1jaGlsZCgyKSB7XG4gIGZsZXgtZ3JvdzogMTtcbiAgZmxleC1zaHJpbms6IDA7XG4gIG1hcmdpbi10b3A6IDA7XG59XG4ucG9wb3ZlciAuY29udHJvbHMgPiAqOmxhc3QtY2hpbGQge1xuICBmbGV4LWJhc2lzOiAxNXJlbTtcbiAgZmxleC1ncm93OiAxLjg7XG4gIGZsZXgtc2hyaW5rOiAwO1xuICBtYXJnaW4tdG9wOiAwO1xufVxuLnBvcG92ZXIgLmFjdGlvbnMge1xuICBkaXNwbGF5OiBmbGV4O1xuICBnYXA6IDFyZW07XG59Il19 */'),exports.default={"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"};
|
|
2
2
|
//# sourceMappingURL=DataGridFilter.module.scss.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("./DataGridFilter.module.scss.cjs.js"),a=require("../../Button/Button.cjs.js"),
|
|
1
|
+
"use strict";var e=require("react"),t=require("./DataGridFilter.module.scss.cjs.js"),a=require("../../Button/Button.cjs.js"),r=require("../../Form/Select/SingleSelect/Option.cjs.js"),l=require("../../Form/Select/MultiSelect/MultiOption.cjs.js"),o=require("../../Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.cjs.js"),s=require("../../Form/Wrapper/SelectWrapper/SelectWrapper.cjs.js"),n=require("../../Popover/Popover.cjs.js"),c=require("./DataGridFilters.interfaces.cjs.js"),u=require("../../src/hooks/useRepeatFocus.cjs.js");exports.DataGridFilterPopover=({popoverRef:i,anchorRef:p,isOpen:m,column:d,columnsMetadata:v,values:f,pickedValues:j,operator:b,operators:S,onFilterSubmit:O,resetFields:E,setFilterOpen:h,setColumn:F,setOperator:q,setOperators:g,setValues:W,setPickedValues:k,translations:C})=>{const{columnSelectLabel:N="Filter by",operatorSelectLabel:V="Operator",valueSelectLabel:w="Value",addNewValueLabel:y="Create new",addNewValueButtonTitle:B="Add new select value",submitButtonTitle:M="Apply",cancelButtonTitle:P="Cancel"}=C||{};return u.useRepeatFocus(i),e.useEffect((()=>{var e;m&&(null===(e=i.current)||void 0===e||e.focus())}),[m]),e.createElement(n.Popover,{tabIndex:-1,anchorEl:p,ref:i,show:m,placement:{horizontal:"left",vertical:"bottom"},transformOrigin:{horizontal:"left",vertical:"top"}},e.createElement("div",{className:t.default.popover},e.createElement("div",{className:t.default.controls},e.createElement(s.SelectWrapper,{label:N,value:d,name:"column",onChange:e=>{F(e.target.value);const t=v.find((({name:t})=>t===e.target.value));(null==t?void 0:t.operators)?(q(t.operators[0]),g(t.operators)):(q(Object.values(c.DefaultOperators)[0]),g(Object.values(c.DefaultOperators))),(null==t?void 0:t.defaultValues)?(k([]),W(t.defaultValues)):(k([]),W([]))}},v.map((({name:a,headline:l})=>e.createElement(r.Option,{className:t.default["column-select-option"],key:a,value:a},l)))),e.createElement(s.SelectWrapper,{label:V,value:b,name:"operator",onChange:e=>q(e.target.value)},S.map((t=>e.createElement(r.Option,{key:t,value:t},t)))),e.createElement(o.MultiSelectWrapper,{label:w,name:"value",value:j,onChange:e=>k([...Array.from(e.target.options)].filter((e=>e.selected)).map((e=>e.value))),selectProps:{addNew:{label:y,onAddNew:e=>{e&&(W((t=>[...t,e])),k((t=>[...t,e])))},btnProps:{title:B,type:"button"}},search:{enabled:!0,renderThreshold:0}}},f.map((t=>e.createElement(l.MultiOption,{key:t,value:t},t))))),e.createElement("div",{className:t.default.actions},e.createElement(a.Button,{onClick:O},M),e.createElement(a.Button,{variant:"text",onClick:()=>{E(),h(!1)}},P))))};
|
|
2
2
|
//# sourceMappingURL=DataGridFilterPopover.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridFilterPopover.cjs.js","sources":["../../../../../../src/components/DataGrid/DataGridFilters/DataGridFilterPopover.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 from \"react\";\nimport classes from \"./DataGridFilter.module.scss\";\nimport { Button } from \"../../Button/Button\";\nimport { Option } from \"../../Form/Select/SingleSelect/Option\";\nimport { MultiOption } from \"../../Form/Select/MultiSelect/MultiOption\";\nimport { MultiSelectWrapper } from \"../../Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper\";\nimport { SelectWrapper } from \"../../Form/Wrapper/SelectWrapper/SelectWrapper\";\nimport { Popover } from \"../../Popover/Popover\";\nimport {\n DataGridColumnMetadata,\n DefaultOperators,\n PopoverTranslations\n} from \"./DataGridFilters.interfaces\";\n\nexport type Props = {\n anchorRef?: React.RefObject<
|
|
1
|
+
{"version":3,"file":"DataGridFilterPopover.cjs.js","sources":["../../../../../../src/components/DataGrid/DataGridFilters/DataGridFilterPopover.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, { useEffect } from \"react\";\nimport classes from \"./DataGridFilter.module.scss\";\nimport { Button } from \"../../Button/Button\";\nimport { Option } from \"../../Form/Select/SingleSelect/Option\";\nimport { MultiOption } from \"../../Form/Select/MultiSelect/MultiOption\";\nimport { MultiSelectWrapper } from \"../../Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper\";\nimport { SelectWrapper } from \"../../Form/Wrapper/SelectWrapper/SelectWrapper\";\nimport { Popover } from \"../../Popover/Popover\";\nimport {\n DataGridColumnMetadata,\n DefaultOperators,\n PopoverTranslations\n} from \"./DataGridFilters.interfaces\";\nimport { useRepeatFocus } from \"../../../hooks/useRepeatFocus\";\n\nexport type Props = {\n popoverRef: React.RefObject<HTMLDivElement>;\n anchorRef?: React.RefObject<HTMLDivElement>;\n isOpen: boolean;\n column: string;\n columnsMetadata: DataGridColumnMetadata[];\n values: string[];\n pickedValues: string[];\n operator: string;\n operators: string[];\n onFilterSubmit: () => void;\n resetFields: () => void;\n setFilterOpen: (value: React.SetStateAction<boolean>) => void;\n setColumn: (column: React.SetStateAction<string>) => void;\n setOperator: (operator: React.SetStateAction<string>) => void;\n setOperators: (operators: React.SetStateAction<string[]>) => void;\n setValues: (values: React.SetStateAction<string[]>) => void;\n setPickedValues: (pickedValues: React.SetStateAction<string[]>) => void;\n translations?: PopoverTranslations;\n};\n\nexport const DataGridFilterPopover = ({\n popoverRef,\n anchorRef,\n isOpen,\n column,\n columnsMetadata,\n values,\n pickedValues,\n operator,\n operators,\n onFilterSubmit,\n resetFields,\n setFilterOpen,\n setColumn,\n setOperator,\n setOperators,\n setValues,\n setPickedValues,\n translations\n}: Props) => {\n const {\n columnSelectLabel = \"Filter by\",\n operatorSelectLabel = \"Operator\",\n valueSelectLabel = \"Value\",\n addNewValueLabel = \"Create new\",\n addNewValueButtonTitle = \"Add new select value\",\n submitButtonTitle = \"Apply\",\n cancelButtonTitle = \"Cancel\"\n } = translations || {};\n useRepeatFocus(popoverRef);\n\n useEffect(() => {\n if (isOpen) {\n popoverRef.current?.focus();\n }\n }, [isOpen]);\n\n return (\n <Popover\n tabIndex={-1}\n anchorEl={anchorRef}\n ref={popoverRef}\n show={isOpen}\n placement={{ horizontal: \"left\", vertical: \"bottom\" }}\n transformOrigin={{ horizontal: \"left\", vertical: \"top\" }}\n >\n <div className={classes[\"popover\"]}>\n <div className={classes[\"controls\"]}>\n <SelectWrapper\n label={columnSelectLabel}\n value={column}\n name={\"column\"}\n onChange={e => {\n setColumn(e.target.value);\n const columnMetadata = columnsMetadata.find(({ name }) => name === e.target.value);\n\n if (columnMetadata?.operators) {\n setOperator(columnMetadata.operators[0]);\n setOperators(columnMetadata.operators);\n } else {\n setOperator(Object.values(DefaultOperators)[0]);\n setOperators(Object.values(DefaultOperators));\n }\n\n if (columnMetadata?.defaultValues) {\n setPickedValues([]);\n setValues(columnMetadata.defaultValues);\n } else {\n setPickedValues([]);\n setValues([]);\n }\n }}\n >\n {columnsMetadata.map(({ name, headline }) => (\n <Option className={classes[\"column-select-option\"]} key={name} value={name}>\n {headline}\n </Option>\n ))}\n </SelectWrapper>\n <SelectWrapper\n label={operatorSelectLabel}\n value={operator}\n name={\"operator\"}\n onChange={e => setOperator(e.target.value)}\n >\n {operators.map(operator => (\n <Option key={operator} value={operator}>\n {operator}\n </Option>\n ))}\n </SelectWrapper>\n <MultiSelectWrapper\n label={valueSelectLabel}\n name={\"value\"}\n value={pickedValues}\n onChange={e =>\n setPickedValues(\n [...Array.from(e.target.options)]\n .filter(option => option.selected)\n .map(option => option.value)\n )\n }\n selectProps={{\n addNew: {\n label: addNewValueLabel,\n onAddNew: value => {\n if (value) {\n setValues(prev => [...prev, value]);\n setPickedValues(prev => [...prev, value]);\n }\n },\n btnProps: { title: addNewValueButtonTitle, type: \"button\" }\n },\n search: {\n enabled: true,\n renderThreshold: 0\n }\n }}\n >\n {values.map(value => (\n <MultiOption key={value} value={value}>\n {value}\n </MultiOption>\n ))}\n </MultiSelectWrapper>\n </div>\n <div className={classes[\"actions\"]}>\n <Button onClick={onFilterSubmit}>{submitButtonTitle}</Button>\n <Button\n variant=\"text\"\n onClick={() => {\n resetFields();\n setFilterOpen(false);\n }}\n >\n {cancelButtonTitle}\n </Button>\n </div>\n </div>\n </Popover>\n );\n};\n"],"names":["popoverRef","anchorRef","isOpen","column","columnsMetadata","values","pickedValues","operator","operators","onFilterSubmit","resetFields","setFilterOpen","setColumn","setOperator","setOperators","setValues","setPickedValues","translations","columnSelectLabel","operatorSelectLabel","valueSelectLabel","addNewValueLabel","addNewValueButtonTitle","submitButtonTitle","cancelButtonTitle","useRepeatFocus","useEffect","_a","current","focus","React","createElement","Popover","tabIndex","anchorEl","ref","show","placement","horizontal","vertical","transformOrigin","className","classes","SelectWrapper","label","value","name","onChange","e","target","columnMetadata","find","Object","DefaultOperators","defaultValues","map","headline","Option","key","MultiSelectWrapper","Array","from","options","filter","option","selected","selectProps","addNew","onAddNew","prev","btnProps","title","type","search","enabled","renderThreshold","MultiOption","Button","onClick","variant"],"mappings":"ijBAoDqC,EACnCA,aACAC,YACAC,SACAC,SACAC,kBACAC,SACAC,eACAC,WACAC,YACAC,iBACAC,cACAC,gBACAC,YACAC,cACAC,eACAC,YACAC,kBACAC,mBAEA,MAAMC,kBACJA,EAAoB,YAAWC,oBAC/BA,EAAsB,WAAUC,iBAChCA,EAAmB,QAAOC,iBAC1BA,EAAmB,aAAYC,uBAC/BA,EAAyB,uBAAsBC,kBAC/CA,EAAoB,QAAOC,kBAC3BA,EAAoB,UAClBP,GAAgB,GASpB,OARAQ,EAAcA,eAACzB,GAEf0B,EAAAA,WAAU,WACJxB,IACkB,QAApByB,EAAA3B,EAAW4B,eAAS,IAAAD,GAAAA,EAAAE,QACrB,GACA,CAAC3B,IAGF4B,EAACC,cAAAC,EAAOA,SACNC,UAAW,EACXC,SAAUjC,EACVkC,IAAKnC,EACLoC,KAAMlC,EACNmC,UAAW,CAAEC,WAAY,OAAQC,SAAU,UAC3CC,gBAAiB,CAAEF,WAAY,OAAQC,SAAU,QAEjDT,EAAAC,cAAA,MAAA,CAAKU,UAAWC,EAAAA,QAAiB,SAC/BZ,EAAAC,cAAA,MAAA,CAAKU,UAAWC,EAAAA,QAAkB,UAChCZ,EAAAC,cAACY,gBACC,CAAAC,MAAO1B,EACP2B,MAAO1C,EACP2C,KAAM,SACNC,SAAUC,IACRpC,EAAUoC,EAAEC,OAAOJ,OACnB,MAAMK,EAAiB9C,EAAgB+C,MAAK,EAAGL,UAAWA,IAASE,EAAEC,OAAOJ,SAExEK,aAAc,EAAdA,EAAgB1C,YAClBK,EAAYqC,EAAe1C,UAAU,IACrCM,EAAaoC,EAAe1C,aAE5BK,EAAYuC,OAAO/C,OAAOgD,EAAgBA,kBAAE,IA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rBa,KAKT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("../../Icon/Icon.cjs.js"),r=require("../../Tag/RemoveButton.cjs.js"),a=require("../../Typography/Typography.cjs.js"),n=require("./DataGridFilter.module.scss.cjs.js");const l=({filter:t})=>{const{column:r,operator:a,value:n}=t;return e.createElement(e.Fragment,null,r," ",a," ",n.length>0&&e.createElement("b",null,n[0]),n.length>=2&&e.createElement(e.Fragment,null,"
|
|
1
|
+
"use strict";var e=require("react"),t=require("../../Icon/Icon.cjs.js"),r=require("../../Tag/RemoveButton.cjs.js"),a=require("../../Typography/Typography.cjs.js"),n=require("./DataGridFilter.module.scss.cjs.js");const l=({filter:t})=>{const{column:r,operator:a,value:n}=t;return e.createElement(e.Fragment,null,r," ",a," ",n.length>0&&e.createElement("b",null,n[0]),n.length>=2&&e.createElement(e.Fragment,null,"or ",e.createElement("b",null," ",n.length-1," other")))},o=({triggerRef:o,filter:c,mode:i,onFilterRemove:s,onFilterOpen:m,translations:u,customEditTagContent:d,...p},f)=>{const{addButtonCaption:g="Add filter"}=u||{},E="ADD"===i,y="EDIT"===i&&c;return e.createElement("div",{...p,ref:f,className:n.default["filter-wrapper"]},e.createElement("button",{ref:o,type:"button",className:n.default["filter-button"],onClick:m},E&&e.createElement(e.Fragment,null,e.createElement(t.Icon,{icon:t.Icons.AddCircle}),e.createElement(a.Typography,{variant:"body",className:n.default.caption},g)),y&&e.createElement(a.Typography,{variant:"body",className:n.default.caption},d?e.cloneElement(d,{filter:c}):e.createElement(l,{filter:c}))),y&&e.createElement(r.RemoveButton,{className:n.default["remove-button"],onRemove:s}))},c=e.forwardRef(o);exports.DataGridFilterTag=c,exports.DataGridFilterTagComponent=o;
|
|
2
2
|
//# sourceMappingURL=DataGridFilterTag.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridFilterTag.cjs.js","sources":["../../../../../../src/components/DataGrid/DataGridFilters/DataGridFilterTag.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, ForwardRefRenderFunction, Fragment } from \"react\";\nimport { Icon, Icons } from \"../../Icon/Icon\";\nimport { RemoveButton } from \"../../Tag/RemoveButton\";\nimport { Typography } from \"../../Typography/Typography\";\nimport classes from \"./DataGridFilter.module.scss\";\nimport { Filter, FilterEditorMode, TagTranslations } from \"./DataGridFilters.interfaces\";\n\nexport interface DataGridFilterTagProps extends ComponentPropsWithRef<\"div\"> {\n triggerRef: React.Ref<
|
|
1
|
+
{"version":3,"file":"DataGridFilterTag.cjs.js","sources":["../../../../../../src/components/DataGrid/DataGridFilters/DataGridFilterTag.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, ForwardRefRenderFunction, Fragment } from \"react\";\nimport { Icon, Icons } from \"../../Icon/Icon\";\nimport { RemoveButton } from \"../../Tag/RemoveButton\";\nimport { Typography } from \"../../Typography/Typography\";\nimport classes from \"./DataGridFilter.module.scss\";\nimport { Filter, FilterEditorMode, TagTranslations } from \"./DataGridFilters.interfaces\";\n\nexport interface DataGridFilterTagProps extends ComponentPropsWithRef<\"div\"> {\n customEditTagContent?: React.ReactElement;\n triggerRef: React.Ref<HTMLButtonElement>;\n filter?: Filter;\n mode: FilterEditorMode;\n onFilterRemove: () => void;\n onFilterOpen: () => void;\n translations?: TagTranslations;\n}\n\nconst EditTagContent = ({ filter }: { filter: Filter }) => {\n const { column, operator, value } = filter;\n\n return (\n <Fragment>\n {column} {operator} {value.length > 0 && <b>{value[0]}</b>}\n {value.length >= 2 && (\n <>\n or <b> {value.length - 1} other</b>\n </>\n )}\n </Fragment>\n );\n};\n\nexport const DataGridFilterTagComponent: ForwardRefRenderFunction<\n HTMLDivElement,\n DataGridFilterTagProps\n> = (\n {\n triggerRef,\n filter,\n mode,\n onFilterRemove,\n onFilterOpen,\n translations,\n customEditTagContent,\n ...rest\n }: DataGridFilterTagProps,\n ref\n) => {\n const { addButtonCaption = \"Add filter\" } = translations || {};\n const shouldRenderAddTag = mode === \"ADD\";\n const shouldRenderEditTag = mode === \"EDIT\" && filter;\n\n return (\n <div {...rest} ref={ref} className={classes[\"filter-wrapper\"]}>\n <button\n ref={triggerRef}\n type=\"button\"\n className={classes[\"filter-button\"]}\n onClick={onFilterOpen}\n >\n {shouldRenderAddTag && (\n <Fragment>\n <Icon icon={Icons.AddCircle} />\n <Typography variant=\"body\" className={classes[\"caption\"]}>\n {addButtonCaption}\n </Typography>\n </Fragment>\n )}\n {shouldRenderEditTag && (\n <Typography variant=\"body\" className={classes[\"caption\"]}>\n {customEditTagContent ? (\n React.cloneElement(customEditTagContent, { filter })\n ) : (\n <EditTagContent filter={filter} />\n )}\n </Typography>\n )}\n </button>\n {shouldRenderEditTag && (\n <RemoveButton className={classes[\"remove-button\"]} onRemove={onFilterRemove} />\n )}\n </div>\n );\n};\n\nexport const DataGridFilterTag = React.forwardRef(DataGridFilterTagComponent);\n"],"names":["EditTagContent","filter","column","operator","value","React","Fragment","length","createElement","DataGridFilterTagComponent","triggerRef","mode","onFilterRemove","onFilterOpen","translations","customEditTagContent","rest","ref","addButtonCaption","shouldRenderAddTag","shouldRenderEditTag","className","classes","default","type","onClick","Icon","icon","Icons","AddCircle","Typography","variant","cloneElement","RemoveButton","onRemove","DataGridFilterTag","forwardRef"],"mappings":"oNAiCA,MAAMA,EAAiB,EAAGC,aACxB,MAAMC,OAAEA,EAAMC,SAAEA,EAAQC,MAAEA,GAAUH,EAEpC,OACEI,gBAACC,EAAAA,SAAQ,KACNJ,MAASC,MAAWC,EAAMG,OAAS,GAAKF,yBAAID,EAAM,IAClDA,EAAMG,QAAU,GACfF,EAAAG,cAAAH,EAAAC,SAAA,WACKD,EAAAG,cAAA,IAAA,SAAKJ,EAAMG,OAAS,aAI7B,EAGSE,EAGT,EAEAC,aACAT,SACAU,OACAC,iBACAC,eACAC,eACAC,0BACGC,GAELC,KAEA,MAAMC,iBAAEA,EAAmB,cAAiBJ,GAAgB,CAAA,EACtDK,EAA8B,QAATR,EACrBS,EAA+B,SAATT,GAAmBV,EAE/C,OACEI,EAAAG,cAAA,MAAA,IAASQ,EAAMC,IAAKA,EAAKI,UAAWC,EAAOC,QAAC,mBAC1ClB,EAAAG,cAAA,SAAA,CACES,IAAKP,EACLc,KAAK,SACLH,UAAWC,EAAOC,QAAC,iBACnBE,QAASZ,GAERM,GACCd,EAAAG,cAACF,EAAAA,SAAQ,KACPD,EAAAG,cAACkB,EAAIA,KAAC,CAAAC,KAAMC,EAAAA,MAAMC,YAClBxB,EAAAG,cAACsB,aAAW,CAAAC,QAAQ,OAAOV,UAAWC,EAAAA,QAAiB,SACpDJ,IAINE,GACCf,EAACG,cAAAsB,EAAAA,YAAWC,QAAQ,OAAOV,UAAWC,EAAOC,QAAU,SACpDR,EACCV,EAAM2B,aAAajB,EAAsB,CAAEd,WAE3CI,EAACG,cAAAR,GAAeC,OAAQA,MAK/BmB,GACCf,EAAAG,cAACyB,EAAAA,aAAa,CAAAZ,UAAWC,UAAQ,iBAAkBY,SAAUtB,IAGjE,EAGSuB,EAAoB9B,EAAM+B,WAAW3B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react"),r=require("../../Form/Wrapper/InputWrapper/InputWrapper.cjs.js"),a=require("../../Icon/Icon.cjs.js"),l=require("./DataGridToolbar.module.scss.cjs.js"),u=require("../../src/hooks/useDebouncedCallback.cjs.js");exports.DataGridSearchbar=({onSearch:c,initialSearchValue:n,debounceTime:s,inputWrapperProps:o,placeholder:t})=>{var i,p,d;const[h,v]=e.useState(null!=n?n:""),b=u.useDebouncedCallback(c,null!=s?s:500),m=s?b:c;return e.useEffect((()=>{n&&v(n)}),[n]),e.createElement(r.InputWrapper,{...o,className:`${l.default.searchbar} ${null!==(i=null==o?void 0:o.className)&&void 0!==i?i:""}`,label:null!==(p=null==o?void 0:o.label)&&void 0!==p?p:"",onChange:e=>{m(e.target.value),v(e.target.value)},type:"search",name:null!==(d=null==o?void 0:o.name)&&void 0!==d?d:"searchbar",value:h,inputProps:{...null==o?void 0:o.inputProps,type:"search",prefix:e.createElement(a.Icon,{icon:a.Icons.Search}),placeholder:null!=t?t:"Search items"}})};
|
|
2
|
+
//# sourceMappingURL=DataGridSearchbar.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGridSearchbar.cjs.js","sources":["../../../../../../src/components/DataGrid/DataGridFilters/DataGridSearchbar.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, { useState, useEffect } from \"react\";\nimport { InputWrapper } from \"../../Form/Wrapper/InputWrapper/InputWrapper\";\nimport { Icon, Icons } from \"../../Icon/Icon\";\nimport classes from \"./DataGridToolbar.module.scss\";\nimport { InputWrapperProps, useDebouncedCallback } from \"../../..\";\n\nexport interface DataGridSearchbarProps {\n onSearch: (value: string) => void;\n initialSearchValue?: string;\n debounceTime?: number;\n placeholder?: string;\n inputWrapperProps?: InputWrapperProps;\n}\n\nexport const DataGridSearchbar = ({\n onSearch,\n initialSearchValue,\n debounceTime,\n inputWrapperProps,\n placeholder\n}: DataGridSearchbarProps) => {\n const [search, setSearch] = useState(initialSearchValue ?? \"\");\n const debouncedCallback = useDebouncedCallback(onSearch, debounceTime ?? 500);\n const onSearchCallback = debounceTime ? debouncedCallback : onSearch;\n\n const onChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n onSearchCallback(event.target.value);\n setSearch(event.target.value);\n };\n\n useEffect(() => {\n initialSearchValue && setSearch(initialSearchValue);\n }, [initialSearchValue]);\n\n return (\n <InputWrapper\n {...inputWrapperProps}\n className={`${classes[\"searchbar\"]} ${inputWrapperProps?.className ?? \"\"}`}\n label={inputWrapperProps?.label ?? \"\"}\n onChange={onChange}\n type=\"search\"\n name={inputWrapperProps?.name ?? \"searchbar\"}\n value={search}\n inputProps={{\n ...inputWrapperProps?.inputProps,\n type: \"search\",\n prefix: <Icon icon={Icons.Search} />,\n placeholder: placeholder ?? \"Search items\"\n }}\n ></InputWrapper>\n );\n};\n"],"names":["onSearch","initialSearchValue","debounceTime","inputWrapperProps","placeholder","search","setSearch","useState","debouncedCallback","useDebouncedCallback","onSearchCallback","useEffect","React","createElement","InputWrapper","className","classes","_a","label","_b","onChange","event","target","value","type","name","_c","inputProps","prefix","Icon","icon","Icons","Search"],"mappings":"8QA8BiC,EAC/BA,WACAC,qBACAC,eACAC,oBACAC,4BAEA,MAAOC,EAAQC,GAAaC,EAAQA,SAACN,QAAAA,EAAsB,IACrDO,EAAoBC,EAAAA,qBAAqBT,EAAUE,QAAAA,EAAgB,KACnEQ,EAAmBR,EAAeM,EAAoBR,EAW5D,OAJAW,EAAAA,WAAU,KACRV,GAAsBK,EAAUL,EAAmB,GAClD,CAACA,IAGFW,EAAAC,cAACC,EAAAA,aAAY,IACPX,EACJY,UAAW,GAAGC,EAAAA,QAAmB,aAAiC,QAA5BC,EAAAd,aAAiB,EAAjBA,EAAmBY,iBAAS,IAAAE,EAAAA,EAAI,KACtEC,MAAmC,QAA5BC,EAAAhB,aAAA,EAAAA,EAAmBe,aAAS,IAAAC,EAAAA,EAAA,GACnCC,SAdcC,IAChBX,EAAiBW,EAAMC,OAAOC,OAC9BjB,EAAUe,EAAMC,OAAOC,MAAM,EAa3BC,KAAK,SACLC,KAA6B,QAAvBC,EAAAvB,aAAA,EAAAA,EAAmBsB,YAAI,IAAAC,EAAAA,EAAI,YACjCH,MAAOlB,EACPsB,WAAY,IACPxB,aAAA,EAAAA,EAAmBwB,WACtBH,KAAM,SACNI,OAAQhB,gBAACiB,EAAAA,KAAI,CAACC,KAAMC,EAAAA,MAAMC,SAC1B5B,YAAaA,QAAAA,EAAe,iBAGhC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("./DataGridFilter.cjs.js"),a=require("./DataGridToolbar.module.scss.cjs.js"),r=require("../../Typography/Typography.cjs.js")
|
|
1
|
+
"use strict";var e=require("react"),t=require("./DataGridFilter.cjs.js"),a=require("./DataGridToolbar.module.scss.cjs.js"),r=require("../../Typography/Typography.cjs.js"),l=require("./useFiltersReducer.cjs.js");exports.DataGridToolbar=({columnsMetadata:o,filterValues:i,translations:n,onFilterAdd:s,onFilterEdit:d,onFilterDelete:u,onFiltersClear:c,customEditTagContent:p})=>{const{state:m,addFilter:F,editFilter:T,deleteFilter:g,clearFilters:v}=l.useFiltersReducer(i),{clearButtonCaption:E="Clear all filters"}=(null==n?void 0:n.toolbar)||{};return e.createElement(e.Fragment,null,m.filters.map((a=>e.createElement(t.DataGridFilter,{mode:"EDIT",key:a.id,filter:a,columnsMetadata:o,onFilterEdit:e=>{T(e),d&&d(e)},onFilterDelete:e=>{g(e),u&&u(e)},tagTranslations:null==n?void 0:n.tag,popoverTranslations:null==n?void 0:n.popover,customEditTagContent:p}))),e.createElement("div",{className:a.default["actions-wrapper"]},e.createElement(t.DataGridFilter,{mode:"ADD",customEditTagContent:p,columnsMetadata:o,onFilterAdd:e=>{F(e),s&&s(e)},tagTranslations:null==n?void 0:n.tag,popoverTranslations:null==n?void 0:n.popover}),m.filters.length>=1&&e.createElement("button",{type:"button",className:a.default["clear-button"],onClick:()=>{v(),c&&c()}},e.createElement(r.Typography,{variant:"body",className:a.default.caption},E))))};
|
|
2
2
|
//# sourceMappingURL=DataGridToolbar.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridToolbar.cjs.js","sources":["../../../../../../src/components/DataGrid/DataGridFilters/DataGridToolbar.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, {
|
|
1
|
+
{"version":3,"file":"DataGridToolbar.cjs.js","sources":["../../../../../../src/components/DataGrid/DataGridFilters/DataGridToolbar.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 } from \"react\";\nimport { DataGridFilter } from \"./DataGridFilter\";\nimport classes from \"./DataGridToolbar.module.scss\";\nimport { DataGridColumnMetadata, Filter, FiltersTranslations } from \"./DataGridFilters.interfaces\";\nimport { Typography } from \"../../Typography/Typography\";\nimport { useFiltersReducer } from \"./useFiltersReducer\";\n\nexport interface DataGridToolbarProps {\n columnsMetadata: DataGridColumnMetadata[];\n customEditTagContent?: React.ReactElement;\n filterValues?: Filter[];\n translations?: FiltersTranslations;\n onFilterAdd?: (filter: Filter) => void;\n onFilterEdit?: (filter: Filter) => void;\n onFilterDelete?: (id: string) => void;\n onFiltersClear?: () => void;\n}\n\nexport const DataGridToolbar = ({\n columnsMetadata,\n filterValues,\n translations,\n onFilterAdd,\n onFilterEdit,\n onFilterDelete,\n onFiltersClear,\n customEditTagContent\n}: DataGridToolbarProps) => {\n const { state, addFilter, editFilter, deleteFilter, clearFilters } =\n useFiltersReducer(filterValues);\n const { clearButtonCaption = \"Clear all filters\" } = translations?.toolbar || {};\n return (\n <Fragment>\n {state.filters.map(filter => (\n <DataGridFilter\n mode=\"EDIT\"\n key={filter.id}\n filter={filter}\n columnsMetadata={columnsMetadata}\n onFilterEdit={filter => {\n editFilter(filter);\n onFilterEdit && onFilterEdit(filter);\n }}\n onFilterDelete={id => {\n deleteFilter(id);\n onFilterDelete && onFilterDelete(id);\n }}\n tagTranslations={translations?.tag}\n popoverTranslations={translations?.popover}\n customEditTagContent={customEditTagContent}\n />\n ))}\n <div className={classes[\"actions-wrapper\"]}>\n <DataGridFilter\n mode=\"ADD\"\n customEditTagContent={customEditTagContent}\n columnsMetadata={columnsMetadata}\n onFilterAdd={filter => {\n addFilter(filter);\n onFilterAdd && onFilterAdd(filter);\n }}\n tagTranslations={translations?.tag}\n popoverTranslations={translations?.popover}\n />\n {state.filters.length >= 1 && (\n <button\n type=\"button\"\n className={classes[\"clear-button\"]}\n onClick={() => {\n clearFilters();\n onFiltersClear && onFiltersClear();\n }}\n >\n <Typography variant=\"body\" className={classes[\"caption\"]}>\n {clearButtonCaption}\n </Typography>\n </button>\n )}\n </div>\n </Fragment>\n );\n};\n"],"names":["columnsMetadata","filterValues","translations","onFilterAdd","onFilterEdit","onFilterDelete","onFiltersClear","customEditTagContent","state","addFilter","editFilter","deleteFilter","clearFilters","useFiltersReducer","clearButtonCaption","toolbar","React","Fragment","filters","map","filter","createElement","DataGridFilter","mode","key","id","tagTranslations","tag","popoverTranslations","popover","className","classes","length","type","onClick","Typography","variant","default"],"mappings":"2OAkC+B,EAC7BA,kBACAC,eACAC,eACAC,cACAC,eACAC,iBACAC,iBACAC,2BAEA,MAAMC,MAAEA,EAAKC,UAAEA,EAASC,WAAEA,EAAUC,aAAEA,EAAYC,aAAEA,GAClDC,oBAAkBZ,IACda,mBAAEA,EAAqB,sBAAwBZ,eAAAA,EAAca,UAAW,CAAA,EAC9E,OACEC,gBAACC,EAAAA,SAAQ,KACNT,EAAMU,QAAQC,KAAIC,GACjBJ,EAACK,cAAAC,EAAAA,eACC,CAAAC,KAAK,OACLC,IAAKJ,EAAOK,GACZL,OAAQA,EACRpB,gBAAiBA,EACjBI,aAAcgB,IACZV,EAAWU,GACXhB,GAAgBA,EAAagB,EAAO,EAEtCf,eAAgBoB,IACdd,EAAac,GACbpB,GAAkBA,EAAeoB,EAAG,EAEtCC,gBAAiBxB,aAAY,EAAZA,EAAcyB,IAC/BC,oBAAqB1B,aAAA,EAAAA,EAAc2B,QACnCtB,qBAAsBA,MAG1BS,EAAAK,cAAA,MAAA,CAAKS,UAAWC,EAAAA,QAAQ,oBACtBf,EAAAK,cAACC,iBACC,CAAAC,KAAK,MACLhB,qBAAsBA,EACtBP,gBAAiBA,EACjBG,YAAaiB,IACXX,EAAUW,GACVjB,GAAeA,EAAYiB,EAAO,EAEpCM,gBAAiBxB,aAAY,EAAZA,EAAcyB,IAC/BC,oBAAqB1B,eAAAA,EAAc2B,UAEpCrB,EAAMU,QAAQc,QAAU,GACvBhB,EAAAK,cAAA,SAAA,CACEY,KAAK,SACLH,UAAWC,EAAAA,QAAQ,gBACnBG,QAAS,KACPtB,IACAN,GAAkBA,GAAgB,GAGpCU,EAACK,cAAAc,EAAAA,YAAWC,QAAQ,OAAON,UAAWC,EAAOM,QAAU,SACpDvB,KAMX"}
|