@onewelcome/react-lib-components 13.3.0-alpha.2 → 13.4.0-experminent.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.cjs.js +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.es.js +5 -5
- package/dist/components/Button/BaseButton.module.scss.cjs.js +2 -2
- package/dist/components/Button/BaseButton.module.scss.es.js +4 -4
- package/dist/components/Button/Button.module.scss.cjs.js +2 -2
- package/dist/components/Button/Button.module.scss.es.js +17 -17
- package/dist/components/Button/IconButton.module.scss.cjs.js +2 -2
- package/dist/components/Button/IconButton.module.scss.es.js +18 -18
- package/dist/components/ContextMenu/ContextMenu.module.scss.cjs.js +2 -2
- package/dist/components/ContextMenu/ContextMenu.module.scss.es.js +6 -6
- package/dist/components/ContextMenu/ContextMenuDivider.module.scss.cjs.js +2 -2
- package/dist/components/ContextMenu/ContextMenuDivider.module.scss.es.js +2 -2
- package/dist/components/ContextMenu/ContextMenuItem.module.scss.cjs.js +2 -2
- package/dist/components/ContextMenu/ContextMenuItem.module.scss.es.js +3 -3
- package/dist/components/DataGrid/DataGrid.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGrid.module.scss.es.js +8 -8
- package/dist/components/DataGrid/DataGridActions/DataGridActions.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridActions/DataGridActions.module.scss.es.js +6 -6
- package/dist/components/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss.es.js +7 -7
- package/dist/components/DataGrid/DataGridBody/DataGridBody.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridBody.module.scss.es.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.scss.es.js +5 -5
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss.es.js +4 -4
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss.es.js +5 -5
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.scss.es.js +24 -24
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.module.scss.es.js +9 -9
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.es.js +4 -27
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.es.js +2 -4
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.module.scss.es.js +10 -10
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.module.scss.es.js +17 -17
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.es.js +4 -4
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.es.js +11 -11
- package/dist/components/DatePicker/DatePicker.module.scss.cjs.js +2 -2
- package/dist/components/DatePicker/DatePicker.module.scss.es.js +31 -31
- package/dist/components/Form/Checkbox/Checkbox.module.scss.cjs.js +2 -2
- package/dist/components/Form/Checkbox/Checkbox.module.scss.es.js +13 -13
- package/dist/components/Form/Fieldset/Fieldset.module.scss.cjs.js +2 -2
- package/dist/components/Form/Fieldset/Fieldset.module.scss.es.js +6 -6
- package/dist/components/Form/FileUpload/FileItem/FileItem.module.scss.cjs.js +2 -2
- package/dist/components/Form/FileUpload/FileItem/FileItem.module.scss.es.js +18 -18
- package/dist/components/Form/FileUpload/FileUpload.module.scss.cjs.js +2 -2
- package/dist/components/Form/FileUpload/FileUpload.module.scss.es.js +16 -16
- package/dist/components/Form/Form.module.scss.cjs.js +2 -2
- package/dist/components/Form/Form.module.scss.es.js +2 -2
- package/dist/components/Form/FormControl/FormControl.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormControl/FormControl.module.scss.es.js +13 -13
- package/dist/components/Form/FormErrorText/FormErrorText.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormErrorText/FormErrorText.module.scss.es.js +6 -6
- package/dist/components/Form/FormGroup/FormGroup.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormGroup/FormGroup.module.scss.es.js +3 -3
- package/dist/components/Form/FormHelperText/FormHelperText.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormHelperText/FormHelperText.module.scss.es.js +4 -4
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss.es.js +6 -6
- package/dist/components/Form/Input/Input.cjs.js +1 -1
- package/dist/components/Form/Input/Input.cjs.js.map +1 -1
- package/dist/components/Form/Input/Input.es.js +46 -4
- package/dist/components/Form/Input/Input.es.js.map +1 -1
- package/dist/components/Form/Input/Input.module.scss.cjs.js +2 -2
- package/dist/components/Form/Input/Input.module.scss.es.js +8 -8
- package/dist/components/Form/Label/Label.module.scss.cjs.js +2 -2
- package/dist/components/Form/Label/Label.module.scss.es.js +2 -2
- package/dist/components/Form/Radio/Radio.module.scss.cjs.js +2 -2
- package/dist/components/Form/Radio/Radio.module.scss.es.js +11 -11
- package/dist/components/Form/Select/MultiSelect/MultiOption.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiOption.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiOption.es.js +5 -4
- package/dist/components/Form/Select/MultiSelect/MultiOption.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.es.js +93 -74
- package/dist/components/Form/Select/MultiSelect/MultiSelect.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.es.js +20 -18
- package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/SelectButton.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/MultiSelect/SelectButton.module.scss.es.js +2 -2
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.module.scss.es.js +4 -4
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.es.js +57 -3
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/useSearch.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/useSearch.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/useSearch.es.js +66 -82
- package/dist/components/Form/Select/MultiSelect/useSearch.es.js.map +1 -1
- package/dist/components/Form/Select/Select.interfaces.cjs.js.map +1 -1
- package/dist/components/Form/Select/Select.interfaces.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Option.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/Option.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Option.es.js +6 -6
- package/dist/components/Form/Select/SingleSelect/Option.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.es.js +73 -67
- package/dist/components/Form/Select/SingleSelect/Select.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/SingleSelect/Select.module.scss.es.js +21 -20
- package/dist/components/Form/Select/SingleSelect/Select.module.scss.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.es.js +62 -3
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useSearch.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/useSearch.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useSearch.es.js +43 -61
- package/dist/components/Form/Select/SingleSelect/useSearch.es.js.map +1 -1
- package/dist/components/Form/Select/useAddNewBtn.cjs.js +1 -1
- package/dist/components/Form/Select/useAddNewBtn.cjs.js.map +1 -1
- package/dist/components/Form/Select/useAddNewBtn.es.js +6 -5
- package/dist/components/Form/Select/useAddNewBtn.es.js.map +1 -1
- package/dist/components/Form/Select/useAddNewBtn.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/useAddNewBtn.module.scss.es.js +4 -4
- package/dist/components/Form/Select/useBaseSearch.cjs.js +2 -0
- package/dist/components/Form/Select/useBaseSearch.cjs.js.map +1 -0
- package/dist/components/Form/Select/useBaseSearch.es.js +85 -0
- package/dist/components/Form/Select/useBaseSearch.es.js.map +1 -0
- package/dist/components/Form/Textarea/Textarea.module.scss.cjs.js +2 -2
- package/dist/components/Form/Textarea/Textarea.module.scss.es.js +6 -6
- package/dist/components/Form/Toggle/Toggle.module.scss.cjs.js +2 -2
- package/dist/components/Form/Toggle/Toggle.module.scss.es.js +18 -18
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.es.js +5 -5
- package/dist/components/Form/Wrapper/InputWrapper/InputWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/InputWrapper/InputWrapper.module.scss.es.js +5 -5
- package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.module.scss.es.js +3 -3
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.es.js +5 -5
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.module.scss.es.js +3 -3
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss.es.js +8 -8
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.module.scss.es.js +6 -6
- package/dist/components/Icon/Icon.module.scss.cjs.js +2 -2
- package/dist/components/Icon/Icon.module.scss.es.js +108 -108
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.cjs.js +2 -2
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.es.js +10 -10
- package/dist/components/Layout/Card/Card.module.scss.cjs.js +2 -2
- package/dist/components/Layout/Card/Card.module.scss.es.js +12 -12
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.cjs.js +2 -2
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.es.js +19 -19
- package/dist/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.scss.cjs.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.scss.es.js +4 -4
- package/dist/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.scss.cjs.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.scss.es.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss.cjs.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss.es.js +3 -3
- package/dist/components/Link/Link.module.scss.cjs.js +2 -2
- package/dist/components/Link/Link.module.scss.es.js +17 -17
- package/dist/components/Notifications/Alert/AlertContainer/AlertContainer.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Alert/AlertContainer/AlertContainer.module.scss.es.js +11 -11
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.module.scss.es.js +22 -22
- package/dist/components/Notifications/Banner/Banner.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Banner/Banner.module.scss.es.js +9 -9
- package/dist/components/Notifications/BaseModal/BaseModal.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModal.module.scss.es.js +5 -5
- package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss.es.js +4 -4
- package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.scss.es.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.scss.es.js +6 -6
- package/dist/components/Notifications/Dialog/Dialog.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Dialog/Dialog.module.scss.es.js +4 -4
- package/dist/components/Notifications/Dialog/DialogActions/DialogActions.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Dialog/DialogActions/DialogActions.module.scss.es.js +3 -3
- package/dist/components/Notifications/Dialog/DialogTitle/DialogTitle.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Dialog/DialogTitle/DialogTitle.module.scss.es.js +10 -10
- package/dist/components/Notifications/SideSheet/SideSheet.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheet.module.scss.es.js +13 -13
- package/dist/components/Notifications/SideSheet/SideSheetContent/SideSheetContent.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheetContent/SideSheetContent.module.scss.es.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.module.scss.es.js +2 -2
- package/dist/components/Notifications/SlideInModal/SlideInModal.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SlideInModal/SlideInModal.module.scss.es.js +10 -10
- package/dist/components/Pagination/Pagination.module.scss.cjs.js +2 -2
- package/dist/components/Pagination/Pagination.module.scss.es.js +15 -15
- package/dist/components/Popover/Popover.module.scss.cjs.js +2 -2
- package/dist/components/Popover/Popover.module.scss.es.js +3 -3
- package/dist/components/ProgressBar/ProgressBar.module.scss.cjs.js +2 -2
- package/dist/components/ProgressBar/ProgressBar.module.scss.es.js +9 -9
- package/dist/components/Skeleton/Skeleton.module.scss.cjs.js +2 -2
- package/dist/components/Skeleton/Skeleton.module.scss.es.js +5 -5
- package/dist/components/Spinner/Spinner.module.scss.cjs.js +2 -2
- package/dist/components/Spinner/Spinner.module.scss.es.js +3 -3
- package/dist/components/Stepper/Step.module.scss.cjs.js +2 -2
- package/dist/components/Stepper/Step.module.scss.es.js +22 -22
- package/dist/components/Stepper/Stepper.module.scss.cjs.js +2 -2
- package/dist/components/Stepper/Stepper.module.scss.es.js +4 -4
- package/dist/components/Tabs/Tab.module.scss.cjs.js +2 -2
- package/dist/components/Tabs/Tab.module.scss.es.js +3 -3
- package/dist/components/Tabs/TabButton.module.scss.cjs.js +2 -2
- package/dist/components/Tabs/TabButton.module.scss.es.js +12 -12
- package/dist/components/Tabs/Tabs.module.scss.cjs.js +2 -2
- package/dist/components/Tabs/Tabs.module.scss.es.js +10 -10
- package/dist/components/Tag/RemoveButton.module.scss.cjs.js +2 -2
- package/dist/components/Tag/RemoveButton.module.scss.es.js +3 -3
- package/dist/components/Tag/Tag.cjs.js +1 -1
- package/dist/components/Tag/Tag.cjs.js.map +1 -1
- package/dist/components/Tag/Tag.es.js +7 -1
- package/dist/components/Tag/Tag.es.js.map +1 -1
- package/dist/components/Tag/Tag.module.scss.cjs.js +2 -2
- package/dist/components/Tag/Tag.module.scss.es.js +6 -6
- package/dist/components/TextEllipsis/TextEllipsis.module.scss.cjs.js +2 -2
- package/dist/components/TextEllipsis/TextEllipsis.module.scss.es.js +3 -3
- package/dist/components/Tiles/Tile.module.scss.cjs.js +2 -2
- package/dist/components/Tiles/Tile.module.scss.es.js +8 -8
- package/dist/components/Tiles/Tiles.module.scss.cjs.js +2 -2
- package/dist/components/Tiles/Tiles.module.scss.es.js +2 -2
- package/dist/components/Tooltip/Tooltip.module.scss.cjs.js +2 -2
- package/dist/components/Tooltip/Tooltip.module.scss.es.js +28 -28
- package/dist/components/Typography/Typography.module.scss.cjs.js +2 -2
- package/dist/components/Typography/Typography.module.scss.es.js +13 -13
- package/dist/components/admin/layout/LeftNav/LeftNav.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/LeftNav/LeftNav.module.scss.es.js +5 -5
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.module.scss.es.js +14 -14
- package/dist/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss.es.js +3 -3
- package/dist/components/admin/layout/ProfileMenu/ProfileMenu.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/ProfileMenu/ProfileMenu.module.scss.es.js +7 -7
- package/dist/components/admin/layout/TopNavBar/TopNavBar.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/TopNavBar/TopNavBar.module.scss.es.js +13 -13
- package/dist/components/miscellaneous/IdentityProviderButton.module.scss.cjs.js +2 -2
- package/dist/components/miscellaneous/IdentityProviderButton.module.scss.es.js +3 -3
- package/dist/hooks/useClickOutside.cjs.js +1 -1
- package/dist/hooks/useClickOutside.cjs.js.map +1 -1
- package/dist/hooks/useClickOutside.es.js +1 -1
- package/dist/hooks/useClickOutside.es.js.map +1 -1
- package/dist/hooks/useDebouncedCallback.cjs.js +1 -1
- package/dist/hooks/useDebouncedCallback.cjs.js.map +1 -1
- package/dist/hooks/useDebouncedCallback.es.js +8 -1
- package/dist/hooks/useDebouncedCallback.es.js.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/readyclasses.module.scss.cjs.js +2 -2
- package/dist/readyclasses.module.scss.es.js +5 -5
- package/dist/util/helper.cjs.js +1 -1
- package/dist/util/helper.cjs.js.map +1 -1
- package/dist/util/helper.es.js +19 -0
- package/dist/util/helper.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('/*!\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 */.
|
|
2
|
-
const row = "
|
|
3
|
-
const loading = "
|
|
4
|
-
const border = "
|
|
5
|
-
const connector = "
|
|
6
|
-
const vertical = "
|
|
7
|
-
const line = "
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('/*!\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 */.DataGridRow_row_MD9ir{position:relative;background-color:var(--data-grid-row-background-color)}.DataGridRow_row_MD9ir:not(.DataGridRow_loading_MD9ir):hover{background-color:var(--data-grid-row-hover-background-color)}.DataGridRow_row_MD9ir.DataGridRow_border-0_MD9ir:after{content:"";position:absolute;width:calc(100% - 3.0625rem);left:3.0625rem;bottom:0;border-bottom:2px solid var(--light-grey-border)}.DataGridRow_row_MD9ir.DataGridRow_border-1_MD9ir:after{content:"";position:absolute;width:calc(100% - 7.1875rem);left:7.1875rem;bottom:0;border-bottom:2px solid var(--light-grey-border)}.DataGridRow_row_MD9ir.DataGridRow_border-2_MD9ir:after{content:"";position:absolute;width:calc(100% - 11.3125rem);left:11.3125rem;bottom:0;border-bottom:2px solid var(--light-grey-border)}.DataGridRow_row_MD9ir.DataGridRow_border-3_MD9ir:after{content:"";position:absolute;width:calc(100% - 15.4375rem);left:15.4375rem;bottom:0;border-bottom:2px solid var(--light-grey-border)}.DataGridRow_row_MD9ir.DataGridRow_border-4_MD9ir:after{content:"";position:absolute;width:calc(100% - 19.5625rem);left:19.5625rem;bottom:0;border-bottom:2px solid var(--light-grey-border)}.DataGridRow_row_MD9ir.DataGridRow_border-5_MD9ir:after{content:"";position:absolute;width:calc(100% - 23.6875rem);left:23.6875rem;bottom:0;border-bottom:2px solid var(--light-grey-border)}.DataGridRow_row_MD9ir.DataGridRow_border-6_MD9ir:after{content:"";position:absolute;width:calc(100% - 27.8125rem);left:27.8125rem;bottom:0;border-bottom:2px solid var(--light-grey-border)}.DataGridRow_row_MD9ir.DataGridRow_border_MD9ir:after{content:"";position:absolute;width:100%;left:0;bottom:0;border-bottom:2px solid var(--light-grey-border)}.DataGridRow_row_MD9ir.DataGridRow_border-drawer_MD9ir:after{content:"";position:absolute;width:100%;left:0;bottom:0;border-bottom:2px solid var(--light-grey-border)}.DataGridRow_expand-button-cell_MD9ir{padding:0}.DataGridRow_connector_MD9ir{position:absolute;top:0;left:0;width:2.875rem;height:calc(3.25 * var(--font-size))}.DataGridRow_connector_MD9ir.DataGridRow_offset-left-0_MD9ir{left:0rem}.DataGridRow_connector_MD9ir.DataGridRow_offset-left-1_MD9ir{left:4.125rem}.DataGridRow_connector_MD9ir.DataGridRow_offset-left-2_MD9ir{left:8.25rem}.DataGridRow_connector_MD9ir.DataGridRow_offset-left-3_MD9ir{left:12.375rem}.DataGridRow_connector_MD9ir.DataGridRow_offset-left-4_MD9ir{left:16.5rem}.DataGridRow_connector_MD9ir.DataGridRow_offset-left-5_MD9ir{left:20.625rem}.DataGridRow_connector_MD9ir.DataGridRow_offset-left-6_MD9ir{left:24.75rem}.DataGridRow_connector_MD9ir.DataGridRow_vertical_MD9ir:before{position:absolute;content:"";left:50%;height:100%;width:.0625rem;background-color:var(--color-blue-grey200)}.DataGridRow_connector_MD9ir.DataGridRow_t-shape_MD9ir:before{position:absolute;content:"";left:50%;height:calc(3.25 * var(--font-size));width:.0625rem;background-color:var(--color-blue-grey200)}.DataGridRow_connector_MD9ir.DataGridRow_t-shape_MD9ir:after{position:absolute;content:"";top:50%;left:50%;height:.0625rem;width:100%;background-color:var(--color-blue-grey200)}.DataGridRow_connector_MD9ir.DataGridRow_line_MD9ir:before{position:absolute;content:"";left:50%;height:50%;width:1px;background-color:var(--color-blue-grey200)}.DataGridRow_connector_MD9ir.DataGridRow_line_MD9ir:after{position:absolute;content:"";top:50%;left:50%;height:1px;width:100%;background-color:var(--color-blue-grey200)}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
|
|
2
|
+
const row = "DataGridRow_row_MD9ir";
|
|
3
|
+
const loading = "DataGridRow_loading_MD9ir";
|
|
4
|
+
const border = "DataGridRow_border_MD9ir";
|
|
5
|
+
const connector = "DataGridRow_connector_MD9ir";
|
|
6
|
+
const vertical = "DataGridRow_vertical_MD9ir";
|
|
7
|
+
const line = "DataGridRow_line_MD9ir";
|
|
8
8
|
const classes = {
|
|
9
9
|
row,
|
|
10
10
|
loading,
|
|
11
|
-
"border-0": "DataGridRow_border-
|
|
12
|
-
"border-1": "DataGridRow_border-
|
|
13
|
-
"border-2": "DataGridRow_border-
|
|
14
|
-
"border-3": "DataGridRow_border-
|
|
15
|
-
"border-4": "DataGridRow_border-
|
|
16
|
-
"border-5": "DataGridRow_border-
|
|
17
|
-
"border-6": "DataGridRow_border-
|
|
11
|
+
"border-0": "DataGridRow_border-0_MD9ir",
|
|
12
|
+
"border-1": "DataGridRow_border-1_MD9ir",
|
|
13
|
+
"border-2": "DataGridRow_border-2_MD9ir",
|
|
14
|
+
"border-3": "DataGridRow_border-3_MD9ir",
|
|
15
|
+
"border-4": "DataGridRow_border-4_MD9ir",
|
|
16
|
+
"border-5": "DataGridRow_border-5_MD9ir",
|
|
17
|
+
"border-6": "DataGridRow_border-6_MD9ir",
|
|
18
18
|
border,
|
|
19
|
-
"border-drawer": "DataGridRow_border-
|
|
20
|
-
"expand-button-cell": "DataGridRow_expand-button-
|
|
19
|
+
"border-drawer": "DataGridRow_border-drawer_MD9ir",
|
|
20
|
+
"expand-button-cell": "DataGridRow_expand-button-cell_MD9ir",
|
|
21
21
|
connector,
|
|
22
|
-
"offset-left-0": "DataGridRow_offset-left-
|
|
23
|
-
"offset-left-1": "DataGridRow_offset-left-
|
|
24
|
-
"offset-left-2": "DataGridRow_offset-left-
|
|
25
|
-
"offset-left-3": "DataGridRow_offset-left-
|
|
26
|
-
"offset-left-4": "DataGridRow_offset-left-
|
|
27
|
-
"offset-left-5": "DataGridRow_offset-left-
|
|
28
|
-
"offset-left-6": "DataGridRow_offset-left-
|
|
22
|
+
"offset-left-0": "DataGridRow_offset-left-0_MD9ir",
|
|
23
|
+
"offset-left-1": "DataGridRow_offset-left-1_MD9ir",
|
|
24
|
+
"offset-left-2": "DataGridRow_offset-left-2_MD9ir",
|
|
25
|
+
"offset-left-3": "DataGridRow_offset-left-3_MD9ir",
|
|
26
|
+
"offset-left-4": "DataGridRow_offset-left-4_MD9ir",
|
|
27
|
+
"offset-left-5": "DataGridRow_offset-left-5_MD9ir",
|
|
28
|
+
"offset-left-6": "DataGridRow_offset-left-6_MD9ir",
|
|
29
29
|
vertical,
|
|
30
|
-
"t-shape": "DataGridRow_t-
|
|
30
|
+
"t-shape": "DataGridRow_t-shape_MD9ir",
|
|
31
31
|
line
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t="
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var r=document.createElement("style");r.appendChild(document.createTextNode('.DataGridFilter_sr-only_MD9ir{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.DataGridFilter_hidden_MD9ir{display:none}.DataGridFilter_slide-in_MD9ir{animation:DataGridFilter_slide-in_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.DataGridFilter_slide-in_MD9ir{animation-duration:.1ms}}.DataGridFilter_slide-out_MD9ir{animation:DataGridFilter_slide-out_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.DataGridFilter_slide-out_MD9ir{animation-duration:.1ms}}@keyframes DataGridFilter_slide-in_MD9ir{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes DataGridFilter_slide-out_MD9ir{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\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_filter-wrapper_MD9ir{display:flex;justify-content:center;align-items:center;gap:.375rem;min-height:1.5rem;padding:.25rem .75rem .25rem .5rem;border-radius:3.125rem;background-color:var(--color-blue-grey100)}.DataGridFilter_filter-wrapper_MD9ir:hover{background-color:var(--color-blue-grey200)}.DataGridFilter_filter-wrapper_MD9ir:active{background-color:var(--color-primary100)}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_filter-button_MD9ir{display:flex;justify-content:flex-start;align-items:center;gap:.375rem;background:none;border:none;padding:0 .25rem;cursor:pointer}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_filter-button_MD9ir:only-child{margin-right:-.25rem}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_filter-button_MD9ir:focus-visible{outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:0;border-radius:var(--focus-border-radius)}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_remove-button_MD9ir{border-radius:1.25rem}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_caption_MD9ir{font-size:var(--font-size-data-grid);line-height:var(--data-grid-line-height);margin:0;font-weight:400}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_caption_MD9ir.DataGridFilter_bold_MD9ir{font-weight:600}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_remove-icon_MD9ir{font-size:calc(.6 * var(--font-size))}.DataGridFilter_column-select-option_MD9ir{text-transform:capitalize}.DataGridFilter_popover_MD9ir{display:flex;flex-direction:column;align-items:flex-start;gap:1rem;padding:1rem .75rem;min-width:40rem}.DataGridFilter_popover_MD9ir .DataGridFilter_controls_MD9ir{width:100%;display:flex;gap:1rem}.DataGridFilter_popover_MD9ir .DataGridFilter_controls_MD9ir>*:first-child{flex-grow:1.8;flex-shrink:0;margin-top:0}.DataGridFilter_popover_MD9ir .DataGridFilter_controls_MD9ir>*:nth-child(2){flex-grow:1;flex-shrink:0;margin-top:0}.DataGridFilter_popover_MD9ir .DataGridFilter_controls_MD9ir>*:last-child{flex-basis:15rem;flex-grow:1.8;flex-shrink:0;margin-top:0}.DataGridFilter_popover_MD9ir .DataGridFilter_actions_MD9ir{display:flex;gap:1rem}')),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t="DataGridFilter_caption_MD9ir",r="DataGridFilter_popover_MD9ir",e="DataGridFilter_controls_MD9ir",o="DataGridFilter_actions_MD9ir",i={"filter-wrapper":"DataGridFilter_filter-wrapper_MD9ir","filter-button":"DataGridFilter_filter-button_MD9ir","remove-button":"DataGridFilter_remove-button_MD9ir",caption:t,"column-select-option":"DataGridFilter_column-select-option_MD9ir",popover:r,controls:e,actions:o};exports.actions=o,exports.caption=t,exports.controls=e,exports.default=i,exports.popover=r;
|
|
3
3
|
//# sourceMappingURL=DataGridFilter.module.scss.cjs.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var
|
|
2
|
-
const caption = "
|
|
3
|
-
const popover = "
|
|
4
|
-
const controls = "
|
|
5
|
-
const actions = "
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var r=document.createElement("style");r.appendChild(document.createTextNode('.DataGridFilter_sr-only_MD9ir{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.DataGridFilter_hidden_MD9ir{display:none}.DataGridFilter_slide-in_MD9ir{animation:DataGridFilter_slide-in_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.DataGridFilter_slide-in_MD9ir{animation-duration:.1ms}}.DataGridFilter_slide-out_MD9ir{animation:DataGridFilter_slide-out_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.DataGridFilter_slide-out_MD9ir{animation-duration:.1ms}}@keyframes DataGridFilter_slide-in_MD9ir{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes DataGridFilter_slide-out_MD9ir{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\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_filter-wrapper_MD9ir{display:flex;justify-content:center;align-items:center;gap:.375rem;min-height:1.5rem;padding:.25rem .75rem .25rem .5rem;border-radius:3.125rem;background-color:var(--color-blue-grey100)}.DataGridFilter_filter-wrapper_MD9ir:hover{background-color:var(--color-blue-grey200)}.DataGridFilter_filter-wrapper_MD9ir:active{background-color:var(--color-primary100)}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_filter-button_MD9ir{display:flex;justify-content:flex-start;align-items:center;gap:.375rem;background:none;border:none;padding:0 .25rem;cursor:pointer}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_filter-button_MD9ir:only-child{margin-right:-.25rem}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_filter-button_MD9ir:focus-visible{outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:0;border-radius:var(--focus-border-radius)}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_remove-button_MD9ir{border-radius:1.25rem}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_caption_MD9ir{font-size:var(--font-size-data-grid);line-height:var(--data-grid-line-height);margin:0;font-weight:400}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_caption_MD9ir.DataGridFilter_bold_MD9ir{font-weight:600}.DataGridFilter_filter-wrapper_MD9ir .DataGridFilter_remove-icon_MD9ir{font-size:calc(.6 * var(--font-size))}.DataGridFilter_column-select-option_MD9ir{text-transform:capitalize}.DataGridFilter_popover_MD9ir{display:flex;flex-direction:column;align-items:flex-start;gap:1rem;padding:1rem .75rem;min-width:40rem}.DataGridFilter_popover_MD9ir .DataGridFilter_controls_MD9ir{width:100%;display:flex;gap:1rem}.DataGridFilter_popover_MD9ir .DataGridFilter_controls_MD9ir>*:first-child{flex-grow:1.8;flex-shrink:0;margin-top:0}.DataGridFilter_popover_MD9ir .DataGridFilter_controls_MD9ir>*:nth-child(2){flex-grow:1;flex-shrink:0;margin-top:0}.DataGridFilter_popover_MD9ir .DataGridFilter_controls_MD9ir>*:last-child{flex-basis:15rem;flex-grow:1.8;flex-shrink:0;margin-top:0}.DataGridFilter_popover_MD9ir .DataGridFilter_actions_MD9ir{display:flex;gap:1rem}')),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
|
|
2
|
+
const caption = "DataGridFilter_caption_MD9ir";
|
|
3
|
+
const popover = "DataGridFilter_popover_MD9ir";
|
|
4
|
+
const controls = "DataGridFilter_controls_MD9ir";
|
|
5
|
+
const actions = "DataGridFilter_actions_MD9ir";
|
|
6
6
|
const classes = {
|
|
7
|
-
"filter-wrapper": "DataGridFilter_filter-
|
|
8
|
-
"filter-button": "DataGridFilter_filter-
|
|
9
|
-
"remove-button": "DataGridFilter_remove-
|
|
7
|
+
"filter-wrapper": "DataGridFilter_filter-wrapper_MD9ir",
|
|
8
|
+
"filter-button": "DataGridFilter_filter-button_MD9ir",
|
|
9
|
+
"remove-button": "DataGridFilter_remove-button_MD9ir",
|
|
10
10
|
caption,
|
|
11
|
-
"column-select-option": "DataGridFilter_column-select-
|
|
11
|
+
"column-select-option": "DataGridFilter_column-select-option_MD9ir",
|
|
12
12
|
popover,
|
|
13
13
|
controls,
|
|
14
14
|
actions
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./DataGridFilters.interfaces.cjs.js");exports.useDataGridFilter=(a,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./DataGridFilters.interfaces.cjs.js");exports.useDataGridFilter=(r,a,s,l)=>{const[o,u]=e.useState(""),[n,i]=e.useState(null),[c,m]=e.useState(Object.values(t.DefaultOperators)),[p,f]=e.useState([]),[d,D]=e.useState([]),S=e.useMemo(()=>((e,t,r,a)=>e.filter(e=>!e.allowSingleFilterOnly||!t.filters.some(t=>"ADD"===r?t.column==e.name:t.column==e.name&&t.column!=(null==a?void 0:a.column))))(a,s,r,l),[a,s,r,l]),v=()=>{u(""),i(null),f([]),D([])};return{resetFields:v,initialiseFilterValues:e=>{if("ADD"===r){const e=S[0];if(!e)return void v();u(e.name),i(e.operators?e.operators[0]:Object.values(t.DefaultOperators)[0]),e.operators&&m(e.operators),e.defaultValues&&f(e.defaultValues)}if("EDIT"===r&&e){const{column:t,operator:r,value:o}=e,n=a.find(({name:e})=>e===t);if(!n)return;const{defaultValues:c,operators:p}=n;u(t),i(r),p&&m(p),D(o),f((s=c||[],l=o,Array.from(new Set([...s,...l]))))}var s,l},operator:n,setOperator:i,operators:c,setOperators:m,column:o,setColumn:u,values:p,setValues:f,pickedValues:d,setPickedValues:D,allowedColumnsMetaData:S}};
|
|
2
2
|
//# sourceMappingURL=DataGridFilterService.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridFilterService.cjs.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilterService.ts"],"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 { useMemo, useState } from \"react\";\nimport {\n DataGridColumnMetadata,\n DefaultOperators,\n Filter,\n FilterEditorMode,\n FilterOperator,\n FiltersState\n} from \"./DataGridFilters.interfaces\";\n\nconst getAllowedColumnsMetadata = (\n columnsMetadata: DataGridColumnMetadata[],\n filterState: FiltersState,\n mode: FilterEditorMode,\n filter?: Filter\n) =>\n columnsMetadata.filter(value => {\n if (!value.allowSingleFilterOnly) {\n return true;\n }\n\n return !filterState.filters.some(v =>\n mode === \"ADD\" ? v.column == value.name : v.column == value.name && v.column != filter?.column\n );\n });\n\nexport const useDataGridFilter = (\n mode: FilterEditorMode,\n columnsMetadata: DataGridColumnMetadata[],\n filterState: FiltersState,\n filter?: Filter\n) => {\n const [column, setColumn] = useState(\"\");\n const [operator, setOperator] = useState<FilterOperator | null>(null);\n const [operators, setOperators] = useState<FilterOperator[]>(Object.values(DefaultOperators));\n const [values, setValues] = useState<string[]>([]);\n const [pickedValues, setPickedValues] = useState<string[]>([]);\n
|
|
1
|
+
{"version":3,"file":"DataGridFilterService.cjs.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilterService.ts"],"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 { useMemo, useState } from \"react\";\nimport {\n DataGridColumnMetadata,\n DefaultOperators,\n Filter,\n FilterEditorMode,\n FilterOperator,\n FiltersState\n} from \"./DataGridFilters.interfaces\";\n\nconst getAllowedColumnsMetadata = (\n columnsMetadata: DataGridColumnMetadata[],\n filterState: FiltersState,\n mode: FilterEditorMode,\n filter?: Filter\n) =>\n columnsMetadata.filter(value => {\n if (!value.allowSingleFilterOnly) {\n return true;\n }\n\n return !filterState.filters.some(v =>\n mode === \"ADD\" ? v.column == value.name : v.column == value.name && v.column != filter?.column\n );\n });\n\nexport const useDataGridFilter = (\n mode: FilterEditorMode,\n columnsMetadata: DataGridColumnMetadata[],\n filterState: FiltersState,\n filter?: Filter\n) => {\n const [column, setColumn] = useState(\"\");\n const [operator, setOperator] = useState<FilterOperator | null>(null);\n const [operators, setOperators] = useState<FilterOperator[]>(Object.values(DefaultOperators));\n const [values, setValues] = useState<string[]>([]);\n const [pickedValues, setPickedValues] = useState<string[]>([]);\n const allowedColumnsMetaData = useMemo(\n () => getAllowedColumnsMetadata(columnsMetadata, filterState, mode, filter),\n [columnsMetadata, filterState, mode, filter]\n );\n\n // User-created values are merged into the predefined list.\n const mergeCustomValuesWithPredefined = (values: string[], pickedValues: string[]) => {\n return Array.from(new Set([...values, ...pickedValues]));\n };\n\n const resetFields = () => {\n setColumn(\"\");\n setOperator(null);\n setValues([]);\n setPickedValues([]);\n };\n\n const initialiseFilterValues = (filter?: Filter) => {\n if (mode === \"ADD\") {\n const firstColumnMetadata = allowedColumnsMetaData[0];\n\n if (!firstColumnMetadata) {\n resetFields();\n return;\n }\n\n setColumn(firstColumnMetadata.name);\n setOperator(\n firstColumnMetadata.operators\n ? firstColumnMetadata.operators[0]\n : Object.values(DefaultOperators)[0]\n );\n firstColumnMetadata.operators && setOperators(firstColumnMetadata.operators);\n firstColumnMetadata.defaultValues && setValues(firstColumnMetadata.defaultValues);\n }\n\n if (mode === \"EDIT\" && filter) {\n const { column, operator, value } = filter;\n const columnMetadata = columnsMetadata.find(({ name }) => name === column);\n\n if (!columnMetadata) {\n return;\n }\n\n const { defaultValues, operators } = columnMetadata;\n\n setColumn(column);\n setOperator(operator);\n operators && setOperators(operators);\n setPickedValues(value);\n setValues(mergeCustomValuesWithPredefined(defaultValues || [], value));\n }\n };\n\n return {\n resetFields,\n initialiseFilterValues,\n operator,\n setOperator,\n operators,\n setOperators,\n column,\n setColumn,\n values,\n setValues,\n pickedValues,\n setPickedValues,\n allowedColumnsMetaData\n };\n};\n"],"names":["mode","columnsMetadata","filterState","filter","column","setColumn","useState","operator","setOperator","operators","setOperators","Object","values","DefaultOperators","setValues","pickedValues","setPickedValues","allowedColumnsMetaData","useMemo","value","allowSingleFilterOnly","filters","some","v","name","getAllowedColumnsMetadata","resetFields","initialiseFilterValues","firstColumnMetadata","defaultValues","columnMetadata","find","Array","from","Set"],"mappings":"oLA0CiC,CAC/BA,EACAC,EACAC,EACAC,KAEA,MAAOC,EAAQC,GAAaC,EAAAA,SAAS,KAC9BC,EAAUC,GAAeF,EAAAA,SAAgC,OACzDG,EAAWC,GAAgBJ,EAAAA,SAA2BK,OAAOC,OAAOC,EAAAA,oBACpED,EAAQE,GAAaR,EAAAA,SAAmB,KACxCS,EAAcC,GAAmBV,EAAAA,SAAmB,IACrDW,EAAyBC,EAAAA,QAC7B,IA5B8B,EAChCjB,EACAC,EACAF,EACAG,IAEAF,EAAgBE,OAAOgB,IAChBA,EAAMC,wBAIHlB,EAAYmB,QAAQC,KAAKC,GACtB,QAATvB,EAAiBuB,EAAEnB,QAAUe,EAAMK,KAAOD,EAAEnB,QAAUe,EAAMK,MAAQD,EAAEnB,SAAU,MAAAD,OAAA,EAAAA,EAAQC,UAgBpFqB,CAA0BxB,EAAiBC,EAAaF,EAAMG,GACpE,CAACF,EAAiBC,EAAaF,EAAMG,IAQjCuB,EAAc,KAClBrB,EAAU,IACVG,EAAY,MACZM,EAAU,IACVE,EAAgB,KAwClB,MAAO,CACLU,cACAC,uBAvC8BxB,IAC9B,GAAa,QAATH,EAAgB,CAClB,MAAM4B,EAAsBX,EAAuB,GAEnD,IAAKW,EAEH,YADAF,IAIFrB,EAAUuB,EAAoBJ,MAC9BhB,EACEoB,EAAoBnB,UAChBmB,EAAoBnB,UAAU,GAC9BE,OAAOC,OAAOC,EAAAA,kBAAkB,IAEtCe,EAAoBnB,WAAaC,EAAakB,EAAoBnB,WAClEmB,EAAoBC,eAAiBf,EAAUc,EAAoBC,cACrE,CAEA,GAAa,SAAT7B,GAAmBG,EAAQ,CAC7B,MAAQC,OAAAA,EAAQG,SAAAA,EAAAA,MAAUY,GAAUhB,EAC9B2B,EAAiB7B,EAAgB8B,KAAK,EAAGP,UAAWA,IAASpB,GAEnE,IAAK0B,EACH,OAGF,MAAMD,cAAEA,EAAepB,UAAAA,GAAcqB,EAErCzB,EAAUD,GACVI,EAAYD,GACZE,GAAaC,EAAaD,GAC1BO,EAAgBG,GAChBL,GA5CqCF,EA4CKiB,GAAiB,GA5CJd,EA4CQI,EA3C1Da,MAAMC,KAAK,IAAIC,IAAI,IAAItB,KAAWG,MA4CzC,CA7CsC,IAACH,EAAkBG,GAmDzDR,WACAC,cACAC,YACAC,eACAN,SACAC,YACAO,SACAE,YACAC,eACAC,kBACAC"}
|
|
@@ -14,29 +14,11 @@ const useDataGridFilter = (mode, columnsMetadata, filterState, filter) => {
|
|
|
14
14
|
const [operators, setOperators] = useState(Object.values(DefaultOperators));
|
|
15
15
|
const [values, setValues] = useState([]);
|
|
16
16
|
const [pickedValues, setPickedValues] = useState([]);
|
|
17
|
-
const [valueLabels, setValueLabels] = useState({});
|
|
18
17
|
const allowedColumnsMetaData = useMemo(
|
|
19
18
|
() => getAllowedColumnsMetadata(columnsMetadata, filterState, mode, filter),
|
|
20
19
|
[columnsMetadata, filterState, mode, filter]
|
|
21
20
|
);
|
|
22
|
-
const
|
|
23
|
-
const columnMetadata = columnsMetadata.find(({ name }) => name === column);
|
|
24
|
-
return Boolean(columnMetadata == null ? void 0 : columnMetadata.onValueSearch);
|
|
25
|
-
}, [column, columnsMetadata]);
|
|
26
|
-
const mergeCustomValuesWithPredefined = (values2, pickedValues2, resolveValueLabels) => {
|
|
27
|
-
if (resolveValueLabels) {
|
|
28
|
-
const unresolvedValues = pickedValues2.filter((value) => !values2.includes(value));
|
|
29
|
-
if (unresolvedValues.length > 0) {
|
|
30
|
-
const resolved = resolveValueLabels(unresolvedValues);
|
|
31
|
-
setValueLabels((previous) => {
|
|
32
|
-
const next = { ...previous };
|
|
33
|
-
resolved.forEach(({ value, label }) => {
|
|
34
|
-
next[value] = label;
|
|
35
|
-
});
|
|
36
|
-
return next;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
21
|
+
const mergeCustomValuesWithPredefined = (values2, pickedValues2) => {
|
|
40
22
|
return Array.from(/* @__PURE__ */ new Set([...values2, ...pickedValues2]));
|
|
41
23
|
};
|
|
42
24
|
const resetFields = () => {
|
|
@@ -44,7 +26,6 @@ const useDataGridFilter = (mode, columnsMetadata, filterState, filter) => {
|
|
|
44
26
|
setOperator(null);
|
|
45
27
|
setValues([]);
|
|
46
28
|
setPickedValues([]);
|
|
47
|
-
setValueLabels({});
|
|
48
29
|
};
|
|
49
30
|
const initialiseFilterValues = (filter2) => {
|
|
50
31
|
if (mode === "ADD") {
|
|
@@ -58,7 +39,6 @@ const useDataGridFilter = (mode, columnsMetadata, filterState, filter) => {
|
|
|
58
39
|
firstColumnMetadata.operators ? firstColumnMetadata.operators[0] : Object.values(DefaultOperators)[0]
|
|
59
40
|
);
|
|
60
41
|
firstColumnMetadata.operators && setOperators(firstColumnMetadata.operators);
|
|
61
|
-
setValueLabels({});
|
|
62
42
|
firstColumnMetadata.defaultValues && setValues(firstColumnMetadata.defaultValues);
|
|
63
43
|
}
|
|
64
44
|
if (mode === "EDIT" && filter2) {
|
|
@@ -67,13 +47,12 @@ const useDataGridFilter = (mode, columnsMetadata, filterState, filter) => {
|
|
|
67
47
|
if (!columnMetadata) {
|
|
68
48
|
return;
|
|
69
49
|
}
|
|
70
|
-
const { defaultValues, operators: operators2
|
|
50
|
+
const { defaultValues, operators: operators2 } = columnMetadata;
|
|
71
51
|
setColumn(column2);
|
|
72
52
|
setOperator(operator2);
|
|
73
53
|
operators2 && setOperators(operators2);
|
|
74
54
|
setPickedValues(value);
|
|
75
|
-
|
|
76
|
-
setValues(mergeCustomValuesWithPredefined(defaultValues || [], value, resolveValueLabels));
|
|
55
|
+
setValues(mergeCustomValuesWithPredefined(defaultValues || [], value));
|
|
77
56
|
}
|
|
78
57
|
};
|
|
79
58
|
return {
|
|
@@ -89,9 +68,7 @@ const useDataGridFilter = (mode, columnsMetadata, filterState, filter) => {
|
|
|
89
68
|
setValues,
|
|
90
69
|
pickedValues,
|
|
91
70
|
setPickedValues,
|
|
92
|
-
allowedColumnsMetaData
|
|
93
|
-
isValuesAsync,
|
|
94
|
-
valueLabels
|
|
71
|
+
allowedColumnsMetaData
|
|
95
72
|
};
|
|
96
73
|
};
|
|
97
74
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridFilterService.es.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilterService.ts"],"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 { useMemo, useState } from \"react\";\nimport {\n DataGridColumnMetadata,\n DefaultOperators,\n Filter,\n FilterEditorMode,\n FilterOperator,\n FiltersState\n} from \"./DataGridFilters.interfaces\";\n\nconst getAllowedColumnsMetadata = (\n columnsMetadata: DataGridColumnMetadata[],\n filterState: FiltersState,\n mode: FilterEditorMode,\n filter?: Filter\n) =>\n columnsMetadata.filter(value => {\n if (!value.allowSingleFilterOnly) {\n return true;\n }\n\n return !filterState.filters.some(v =>\n mode === \"ADD\" ? v.column == value.name : v.column == value.name && v.column != filter?.column\n );\n });\n\nexport const useDataGridFilter = (\n mode: FilterEditorMode,\n columnsMetadata: DataGridColumnMetadata[],\n filterState: FiltersState,\n filter?: Filter\n) => {\n const [column, setColumn] = useState(\"\");\n const [operator, setOperator] = useState<FilterOperator | null>(null);\n const [operators, setOperators] = useState<FilterOperator[]>(Object.values(DefaultOperators));\n const [values, setValues] = useState<string[]>([]);\n const [pickedValues, setPickedValues] = useState<string[]>([]);\n
|
|
1
|
+
{"version":3,"file":"DataGridFilterService.es.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilterService.ts"],"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 { useMemo, useState } from \"react\";\nimport {\n DataGridColumnMetadata,\n DefaultOperators,\n Filter,\n FilterEditorMode,\n FilterOperator,\n FiltersState\n} from \"./DataGridFilters.interfaces\";\n\nconst getAllowedColumnsMetadata = (\n columnsMetadata: DataGridColumnMetadata[],\n filterState: FiltersState,\n mode: FilterEditorMode,\n filter?: Filter\n) =>\n columnsMetadata.filter(value => {\n if (!value.allowSingleFilterOnly) {\n return true;\n }\n\n return !filterState.filters.some(v =>\n mode === \"ADD\" ? v.column == value.name : v.column == value.name && v.column != filter?.column\n );\n });\n\nexport const useDataGridFilter = (\n mode: FilterEditorMode,\n columnsMetadata: DataGridColumnMetadata[],\n filterState: FiltersState,\n filter?: Filter\n) => {\n const [column, setColumn] = useState(\"\");\n const [operator, setOperator] = useState<FilterOperator | null>(null);\n const [operators, setOperators] = useState<FilterOperator[]>(Object.values(DefaultOperators));\n const [values, setValues] = useState<string[]>([]);\n const [pickedValues, setPickedValues] = useState<string[]>([]);\n const allowedColumnsMetaData = useMemo(\n () => getAllowedColumnsMetadata(columnsMetadata, filterState, mode, filter),\n [columnsMetadata, filterState, mode, filter]\n );\n\n // User-created values are merged into the predefined list.\n const mergeCustomValuesWithPredefined = (values: string[], pickedValues: string[]) => {\n return Array.from(new Set([...values, ...pickedValues]));\n };\n\n const resetFields = () => {\n setColumn(\"\");\n setOperator(null);\n setValues([]);\n setPickedValues([]);\n };\n\n const initialiseFilterValues = (filter?: Filter) => {\n if (mode === \"ADD\") {\n const firstColumnMetadata = allowedColumnsMetaData[0];\n\n if (!firstColumnMetadata) {\n resetFields();\n return;\n }\n\n setColumn(firstColumnMetadata.name);\n setOperator(\n firstColumnMetadata.operators\n ? firstColumnMetadata.operators[0]\n : Object.values(DefaultOperators)[0]\n );\n firstColumnMetadata.operators && setOperators(firstColumnMetadata.operators);\n firstColumnMetadata.defaultValues && setValues(firstColumnMetadata.defaultValues);\n }\n\n if (mode === \"EDIT\" && filter) {\n const { column, operator, value } = filter;\n const columnMetadata = columnsMetadata.find(({ name }) => name === column);\n\n if (!columnMetadata) {\n return;\n }\n\n const { defaultValues, operators } = columnMetadata;\n\n setColumn(column);\n setOperator(operator);\n operators && setOperators(operators);\n setPickedValues(value);\n setValues(mergeCustomValuesWithPredefined(defaultValues || [], value));\n }\n };\n\n return {\n resetFields,\n initialiseFilterValues,\n operator,\n setOperator,\n operators,\n setOperators,\n column,\n setColumn,\n values,\n setValues,\n pickedValues,\n setPickedValues,\n allowedColumnsMetaData\n };\n};\n"],"names":["values","pickedValues","filter","column","operator","operators"],"mappings":";;AA0BA,MAAM,4BAA4B,CAChC,iBACA,aACA,MACA,WAEA,gBAAgB,OAAO,CAAA,UAAS;AAC9B,MAAI,CAAC,MAAM,uBAAuB;AAChC,WAAO;AAAA,EACT;AAEA,SAAO,CAAC,YAAY,QAAQ;AAAA,IAAK,CAAA,MAC/B,SAAS,QAAQ,EAAE,UAAU,MAAM,OAAO,EAAE,UAAU,MAAM,QAAQ,EAAE,WAAU,iCAAQ;AAAA,EAAA;AAE5F,CAAC;AAEI,MAAM,oBAAoB,CAC/B,MACA,iBACA,aACA,WACG;AACH,QAAM,CAAC,QAAQ,SAAS,IAAI,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M,EAAE,eAAe,WAAAE,WAAAA,IAAc;AAErC,gBAAUF,OAAM;AAChB,kBAAYC,SAAQ;AACpBC,oBAAa,aAAaA,UAAS;AACnC,sBAAgB,KAAK;AACrB,gBAAU,gCAAgC,iBAAiB,CAAA,GAAI,KAAK,CAAC;AAAA,IACvE;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
|
@@ -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, useMemo } 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 {\n Filter,\n FilterEditorMode,\n TagTranslations,\n DataGridColumnMetadata\n} 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 dateTagCaption?: string;\n columnsMetadata?: DataGridColumnMetadata[];\n}\n\nconst EditTagContent = ({\n filter,\n or,\n other,\n columnsMetadata\n}: {\n filter: Filter;\n or: string;\n other: string;\n columnsMetadata?: DataGridColumnMetadata[];\n}) => {\n const { column, operator, value } = filter;\n const columnMetadata = columnsMetadata?.find(meta => meta.name === column);\n const columnHeadlineWithFallback = columnMetadata?.headline || column;\n const primaryValue = value[0];\n\n // Resolve a
|
|
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, useMemo } 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 {\n Filter,\n FilterEditorMode,\n TagTranslations,\n DataGridColumnMetadata\n} 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 dateTagCaption?: string;\n columnsMetadata?: DataGridColumnMetadata[];\n}\n\nconst EditTagContent = ({\n filter,\n or,\n other,\n columnsMetadata\n}: {\n filter: Filter;\n or: string;\n other: string;\n columnsMetadata?: DataGridColumnMetadata[];\n}) => {\n const { column, operator, value } = filter;\n const columnMetadata = columnsMetadata?.find(meta => meta.name === column);\n const columnHeadlineWithFallback = columnMetadata?.headline || column;\n const primaryValue = value[0];\n\n // Resolve a label for values not in `defaultValues` (e.g. from async search) — mirrors\n // DataGridFilterValueSelect's label resolution.\n const resolvedPrimaryLabel = useMemo(() => {\n if (!primaryValue || !columnMetadata?.resolveValueLabels) {\n return undefined;\n }\n if (columnMetadata.defaultValues?.includes(primaryValue)) {\n return undefined;\n }\n return columnMetadata.resolveValueLabels([primaryValue])[0]?.label;\n }, [primaryValue, columnMetadata]);\n\n return (\n <Fragment>\n {columnHeadlineWithFallback} {operator?.name}{\" \"}\n {value.length > 0 && <b>{resolvedPrimaryLabel ?? primaryValue}</b>}\n {value.length >= 2 && (\n <>\n {\" \"}\n {or}{\" \"}\n <b>\n {value.length - 1} {other}\n </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 dateTagCaption,\n customEditTagContent,\n columnsMetadata,\n ...rest\n }: DataGridFilterTagProps,\n ref\n) => {\n const {\n addButtonCaption = \"Add filter\",\n or = \"or\",\n other = \"other\",\n dateIs = \"Date is\"\n } = translations || {};\n const shouldRenderAddTag = mode === \"ADD\";\n const shouldRenderEditTag = mode === \"EDIT\" && filter;\n const shouldRenderAddDateTag = mode === \"ADD_DATE\";\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={e => {\n e.preventDefault();\n onFilterOpen();\n }}\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\n filter={filter}\n or={or}\n other={other}\n columnsMetadata={columnsMetadata}\n />\n )}\n </Typography>\n )}\n {shouldRenderAddDateTag && (\n <Fragment>\n <Icon icon={Icons.Calendar} />\n <Typography variant=\"body\" className={classes[\"caption\"]}>\n {dateIs} <b>{dateTagCaption}</b>\n </Typography>\n </Fragment>\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","or","other","columnsMetadata","column","operator","value","columnMetadata","find","meta","name","columnHeadlineWithFallback","headline","primaryValue","resolvedPrimaryLabel","useMemo","resolveValueLabels","_a","defaultValues","includes","_b","label","createElement","Fragment","length","React","DataGridFilterTagComponent","triggerRef","mode","onFilterRemove","onFilterOpen","translations","dateTagCaption","customEditTagContent","rest","ref","addButtonCaption","dateIs","shouldRenderAddTag","shouldRenderEditTag","shouldRenderAddDateTag","className","classes","type","onClick","e","preventDefault","Icon","icon","Icons","AddCircle","Typography","variant","cloneElement","Calendar","RemoveButton","onRemove","DataGridFilterTag","forwardRef"],"mappings":"yRAwCMA,EAAiB,EACrBC,SACAC,KACAC,QACAC,sBAOA,MAAMC,OAAEA,EAAAC,SAAQA,EAAAC,MAAUA,GAAUN,EAC9BO,EAAiB,MAAAJ,OAAA,EAAAA,EAAiBK,KAAKC,GAAQA,EAAKC,OAASN,GAC7DO,SAA6BJ,WAAgBK,WAAYR,EACzDS,EAAeP,EAAM,GAIrBQ,EAAuBC,EAAAA,QAAQ,aACnC,GAAKF,IAAiB,MAAAN,OAAA,EAAAA,EAAgBS,uBAGlC,OAAAC,EAAAV,EAAeW,oBAAf,EAAAD,EAA8BE,SAASN,IAG3C,OAA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EAAAA,MAAMK,WAClB7B,EAAAH,cAAC6B,aAAA,CAAWC,QAAQ,OAAOX,UAAWC,EAAAA,QAAiB,SACpDL,EAAO,IAACZ,EAAAH,cAAC,IAAA,KAAGU,MAKpBO,GACCd,EAAAH,cAACiC,EAAAA,aAAA,CAAad,UAAWC,EAAAA,QAAQ,iBAAkBc,SAAU3B,MAMxD4B,EAAoBhC,EAAMiC,WAAWhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridFilterTag.es.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, useMemo } 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 {\n Filter,\n FilterEditorMode,\n TagTranslations,\n DataGridColumnMetadata\n} 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 dateTagCaption?: string;\n columnsMetadata?: DataGridColumnMetadata[];\n}\n\nconst EditTagContent = ({\n filter,\n or,\n other,\n columnsMetadata\n}: {\n filter: Filter;\n or: string;\n other: string;\n columnsMetadata?: DataGridColumnMetadata[];\n}) => {\n const { column, operator, value } = filter;\n const columnMetadata = columnsMetadata?.find(meta => meta.name === column);\n const columnHeadlineWithFallback = columnMetadata?.headline || column;\n const primaryValue = value[0];\n\n // Resolve a
|
|
1
|
+
{"version":3,"file":"DataGridFilterTag.es.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, useMemo } 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 {\n Filter,\n FilterEditorMode,\n TagTranslations,\n DataGridColumnMetadata\n} 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 dateTagCaption?: string;\n columnsMetadata?: DataGridColumnMetadata[];\n}\n\nconst EditTagContent = ({\n filter,\n or,\n other,\n columnsMetadata\n}: {\n filter: Filter;\n or: string;\n other: string;\n columnsMetadata?: DataGridColumnMetadata[];\n}) => {\n const { column, operator, value } = filter;\n const columnMetadata = columnsMetadata?.find(meta => meta.name === column);\n const columnHeadlineWithFallback = columnMetadata?.headline || column;\n const primaryValue = value[0];\n\n // Resolve a label for values not in `defaultValues` (e.g. from async search) — mirrors\n // DataGridFilterValueSelect's label resolution.\n const resolvedPrimaryLabel = useMemo(() => {\n if (!primaryValue || !columnMetadata?.resolveValueLabels) {\n return undefined;\n }\n if (columnMetadata.defaultValues?.includes(primaryValue)) {\n return undefined;\n }\n return columnMetadata.resolveValueLabels([primaryValue])[0]?.label;\n }, [primaryValue, columnMetadata]);\n\n return (\n <Fragment>\n {columnHeadlineWithFallback} {operator?.name}{\" \"}\n {value.length > 0 && <b>{resolvedPrimaryLabel ?? primaryValue}</b>}\n {value.length >= 2 && (\n <>\n {\" \"}\n {or}{\" \"}\n <b>\n {value.length - 1} {other}\n </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 dateTagCaption,\n customEditTagContent,\n columnsMetadata,\n ...rest\n }: DataGridFilterTagProps,\n ref\n) => {\n const {\n addButtonCaption = \"Add filter\",\n or = \"or\",\n other = \"other\",\n dateIs = \"Date is\"\n } = translations || {};\n const shouldRenderAddTag = mode === \"ADD\";\n const shouldRenderEditTag = mode === \"EDIT\" && filter;\n const shouldRenderAddDateTag = mode === \"ADD_DATE\";\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={e => {\n e.preventDefault();\n onFilterOpen();\n }}\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\n filter={filter}\n or={or}\n other={other}\n columnsMetadata={columnsMetadata}\n />\n )}\n </Typography>\n )}\n {shouldRenderAddDateTag && (\n <Fragment>\n <Icon icon={Icons.Calendar} />\n <Typography variant=\"body\" className={classes[\"caption\"]}>\n {dateIs} <b>{dateTagCaption}</b>\n </Typography>\n </Fragment>\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":[],"mappings":";;;;;AAwCA,MAAM,iBAAiB,CAAC;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAKM;AACJ,QAAM,EAAE,QAAQ,UAAU,MAAA,IAAU;AACpC,QAAM,iBAAiB,mDAAiB,KAAK,CAAA,SAAQ,KAAK,SAAS;AACnE,QAAM,8BAA6B,iDAAgB,aAAY;AAC/D,QAAM,eAAe,MAAM,CAAC;AAI5B,QAAM,uBAAuB,QAAQ,MAAM;;AACzC,QAAI,CAAC,gBAAgB,EAAC,iDAAgB,qBAAoB;AACxD,aAAO;AAAA,IACT;AACA,SAAI,oBAAe,kBAAf,mBAA8B,SAAS,eAAe;AACxD,aAAO;AAAA,IACT;AACA,YAAO,oBAAe,mBAAmB,CAAC,YAAY,CAAC,EAAE,CAAC,MAAnD,mBAAsD;AAAA,EAC/D,GAAG,CAAC,cAAc,cAAc,CAAC;AAEjC,SACE,sBAAA,cAAC,UAAA,MACE,4BAA2B,KAAE,qCAAU,MAAM,KAC7C,MAAM,SAAS,KAAK,sBAAA,cAAC,KAAA,MAAG,wBAAwB,YAAa,GAC7D,MAAM,UAAU,KACf,sBAAA,cAAA,MAAA,UAAA,MACG,KACA,IAAI,KACL,sBAAA,cAAC,KAAA,MACE,MAAM,SAAS,GAAE,KAAE,KACtB,CACF,CAEJ;AAEJ;AAEO,MAAM,6BAGT,CACF;AAAA,EACE;AAAA,EACA;AAAA,EACA;A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Q,eAAe,GAAG,UAAU,eAAA,CAAgB,CAEjF;AAEJ;AAEO,MAAM,oBAAoB,MAAM,WAAW,0BAA0B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridFilterValueSelect.cjs.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.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, { useCallback, useMemo, useState } from \"react\";\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 {\n DataGridColumnMetadata,\n PopoverTranslations,\n ValueSelectType\n} from \"./DataGridFilters.interfaces\";\n\nexport type Props = {\n column: string;\n columnsMetadata: DataGridColumnMetadata[];\n values: string[];\n pickedValues: string[];\n setValues: (values: React.SetStateAction<string[]>) => void;\n setPickedValues: (pickedValues: React.SetStateAction<string[]>) => void;\n translations?: PopoverTranslations;\n operator?: { allowEmptyValues: boolean } | null;\n};\n\nexport const DataGridFilterValueSelect = ({\n column,\n columnsMetadata,\n values,\n pickedValues,\n setValues,\n setPickedValues,\n translations,\n operator\n}: Props) => {\n const [touched, setTouched] = useState(false);\n // Raw text currently typed into the value search input. Only needed for the addNew dedupe rule\n // below — it mirrors `search.searchInputProps.onChange`, which the underlying Select fires\n // synchronously on every keystroke, ahead of the debounced backend `onValueSearch` call.\n const [searchQuery, setSearchQuery] = useState(\"\");\n\n const {\n valueSelectLabel = \"Value\",\n addNewValueLabel = \"Create new\",\n addNewValueButtonTitle = \"Add new select value\"\n } = translations || {};\n\n const columnMetadata = columnsMetadata.find(({ name }) => name === column);\n const disableAddNew = columnMetadata?.disableAddNew;\n const valueSelectType = columnMetadata?.valueSelectType;\n const {\n onValueSearch,\n onValueLoadMore,\n hasMoreValues,\n valuesLoading,\n minValueSearchLength,\n resolveValueLabels\n } = columnMetadata || {};\n const isAsync = Boolean(onValueSearch);\n\n // Async columns own the currently loaded page via `defaultValues`, kept fresh by the consumer\n // as the user types/scrolls — `values` (the filter's own snapshot, seeded once when the column\n // was selected) remains the source of truth only for static columns, exactly as before.\n const loadedValues = isAsync ? (columnMetadata?.defaultValues ?? []) : values;\n\n // Resolve display labels both for the currently loaded page (so the dropdown shows meaningful\n // labels, not raw values) and for picked values that aren't part of it (e.g. a value saved from\n // a previous, since-scrolled-away-from, search) — mirrors `mergeCustomValuesWithPredefined` in\n // `DataGridFilterService.ts` for the latter.\n const resolvedLabels = useMemo(() => {\n if (!isAsync || !resolveValueLabels) {\n return {};\n }\n const unresolvedPicked = pickedValues.filter(value => !loadedValues.includes(value));\n const toResolve = [...loadedValues, ...unresolvedPicked];\n if (toResolve.length === 0) {\n return {};\n }\n return Object.fromEntries(\n resolveValueLabels(toResolve).map(({ value, label }) => [value, label])\n );\n }, [isAsync, resolveValueLabels, pickedValues, loadedValues]);\n\n const getLabel = useCallback((value: string) => resolvedLabels[value] ?? value, [resolvedLabels]);\n\n const isValueRequired = operator && !operator.allowEmptyValues;\n const hasValidationError = Boolean(isValueRequired && pickedValues.length === 0 && touched);\n\n const addNewBtnProps: React.ButtonHTMLAttributes<HTMLButtonElement> = {\n title: addNewValueButtonTitle,\n type: \"button\"\n };\n\n const onChangeHandler = useCallback(\n (e: React.ChangeEvent<HTMLSelectElement>) => {\n const { selectedOptions, value } = e.target;\n\n let newValues: string[];\n\n if (valueSelectType === ValueSelectType.single) {\n newValues = value ? [value] : [];\n } else {\n newValues = Array.from(selectedOptions, option => option.value);\n }\n setPickedValues(newValues);\n setTouched(true);\n },\n [valueSelectType]\n );\n\n // Suppress \"Create new\" while a request is in flight (the typed value might already be on its\n // way back from the backend) or once an exact match for the typed query is already loaded —\n // both would otherwise let the user create a duplicate value.\n const isDuplicateAddNew =\n isAsync && (Boolean(valuesLoading) || loadedValues.includes(searchQuery.trim()));\n\n const selectProps = {\n addNew:\n disableAddNew || isDuplicateAddNew\n ? undefined\n : {\n label: addNewValueLabel,\n onAddNew: (value: string) => {\n if (value) {\n if (!isAsync) {\n setValues(prev => [...prev, value]);\n }\n setPickedValues(prev => [...prev, value]);\n }\n },\n btnProps: addNewBtnProps\n },\n search: {\n enabled: true,\n renderThreshold: 0,\n ...(onValueSearch && {\n searchInputProps: {\n onChange: (event: React.ChangeEvent<HTMLInputElement>) =>\n setSearchQuery(event.currentTarget.value)\n },\n async: {\n onSearch: onValueSearch,\n onLoadMore: onValueLoadMore,\n hasMore: hasMoreValues,\n loading: valuesLoading,\n minSearchLength: minValueSearchLength\n }\n })\n },\n // Only the field the underlying Select variant actually reads is passed — SingleSelect\n // destructures `selectedOption`, MultiSelect destructures `selectedOptions`; the other one\n // isn't recognized by either and would otherwise fall through onto the native `<select>` via\n // its own rest-prop spread, producing a \"React does not recognize the `x` prop\" DOM warning.\n ...(isAsync &&\n valueSelectType === ValueSelectType.single && {\n selectedOption: pickedValues[0]\n ? { value: pickedValues[0], label: getLabel(pickedValues[0]) }\n : undefined\n }),\n ...(isAsync &&\n valueSelectType !== ValueSelectType.single && {\n selectedOptions: pickedValues.map(value => ({ value, label: getLabel(value) }))\n })\n };\n\n return ValueSelectType.single === valueSelectType ? (\n <SelectWrapper\n label={valueSelectLabel}\n name={\"value\"}\n value={pickedValues[0]}\n onChange={onChangeHandler}\n selectProps={selectProps}\n error={hasValidationError}\n >\n {loadedValues.map(value => (\n <Option key={value} value={value}>\n {getLabel(value)}\n </Option>\n ))}\n </SelectWrapper>\n ) : (\n <MultiSelectWrapper\n label={valueSelectLabel}\n name={\"value\"}\n value={pickedValues}\n onChange={onChangeHandler}\n selectProps={selectProps}\n error={hasValidationError}\n >\n {loadedValues.map(value => (\n <MultiOption key={value} value={value}>\n {getLabel(value)}\n </MultiOption>\n ))}\n </MultiSelectWrapper>\n );\n};\n"],"names":["column","columnsMetadata","values","pickedValues","setValues","setPickedValues","translations","operator","touched","setTouched","useState","searchQuery","setSearchQuery","valueSelectLabel","addNewValueLabel","addNewValueButtonTitle","columnMetadata","find","name","disableAddNew","valueSelectType","onValueSearch","onValueLoadMore","hasMoreValues","valuesLoading","minValueSearchLength","resolveValueLabels","isAsync","Boolean","loadedValues","defaultValues","resolvedLabels","useMemo","unresolvedPicked","filter","value","includes","toResolve","length","Object","fromEntries","map","label","getLabel","useCallback","isValueRequired","allowEmptyValues","hasValidationError","addNewBtnProps","title","type","onChangeHandler","e","selectedOptions","target","newValues","ValueSelectType","single","Array","from","option","isDuplicateAddNew","trim","selectProps","addNew","onAddNew","prev","btnProps","search","enabled","renderThreshold","searchInputProps","onChange","event","currentTarget","async","onSearch","onLoadMore","hasMore","loading","minSearchLength","selectedOption","React","createElement","SelectWrapper","error","Option","key","MultiSelectWrapper","MultiOption"],"mappings":"ocAsCyC,EACvCA,SACAC,kBACAC,SACAC,eACAC,YACAC,kBACAC,eACAC,eAEA,MAAOC,EAASC,GAAcC,EAAAA,UAAS,IAIhCC,EAAaC,GAAkBF,EAAAA,SAAS,KAEzCG,iBACJA,EAAmB,QAAAC,iBACnBA,EAAmB,aAAAC,uBACnBA,EAAyB,wBACvBT,GAAgB,CAAA,EAEdU,EAAiBf,EAAgBgB,KAAK,EAAGC,UAAWA,IAASlB,GAC7DmB,EAAgB,MAAAH,OAAA,EAAAA,EAAgBG,cAChCC,EAAkB,MAAAJ,OAAA,EAAAA,EAAgBI,iBAClCC,cACJA,EAAAC,gBACAA,EAAAC,cACAA,EAAAC,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BAAkB,CAChBC,SAAWC,GACT7D,EAAe6D,EAAMC,cAAcvC,QAEvCwC,MAAO,CACLC,SAAUvD,EACVwD,WAAYvD,EACZwD,QAASvD,EACTwD,QAASvD,EACTwD,gBAAiBvD,QAQnBE,GACFP,IAAoBoC,EAAAA,gBAAgBC,QAAU,CAC5CwB,eAAgB9E,EAAa,GACzB,CAAEgC,MAAOhC,EAAa,GAAIuC,MAAOC,EAASxC,EAAa,UACvD,MAEJwB,GACFP,IAAoBoC,EAAAA,gBAAgBC,QAAU,CAC5CJ,gBAAiBlD,EAAasC,IAAIN,IAAA,CAAYA,QAAOO,MAAOC,EAASR,QAI3E,OAAOqB,kBAAgBC,SAAWrC,EAChC8D,EAAAC,cAACC,EAAAA,cAAA,CACC1C,MAAO7B,EACPK,KAAM,QACNiB,MAAOhC,EAAa,GACpBqE,SAAUrB,EACVY,cACAsB,MAAOtC,GAENlB,EAAaY,IAAIN,GAChB+C,EAAAC,cAACG,EAAAA,OAAA,CAAOC,IAAKpD,EAAOA,SACjBQ,EAASR,MAKhB+C,EAAAC,cAACK,EAAAA,mBAAA,CACC9C,MAAO7B,EACPK,KAAM,QACNiB,MAAOhC,EACPqE,SAAUrB,EACVY,cACAsB,MAAOtC,GAENlB,EAAaY,IAAIN,GAChB+C,EAAAC,cAACM,EAAAA,YAAA,CAAYF,IAAKpD,EAAOA,SACtBQ,EAASR"}
|
|
1
|
+
{"version":3,"file":"DataGridFilterValueSelect.cjs.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.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, { useCallback, useMemo, useState } from \"react\";\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 {\n DataGridColumnMetadata,\n PopoverTranslations,\n ValueSelectType\n} from \"./DataGridFilters.interfaces\";\n\nexport type Props = {\n column: string;\n columnsMetadata: DataGridColumnMetadata[];\n values: string[];\n pickedValues: string[];\n setValues: (values: React.SetStateAction<string[]>) => void;\n setPickedValues: (pickedValues: React.SetStateAction<string[]>) => void;\n translations?: PopoverTranslations;\n operator?: { allowEmptyValues: boolean } | null;\n};\n\nexport const DataGridFilterValueSelect = ({\n column,\n columnsMetadata,\n values,\n pickedValues,\n setValues,\n setPickedValues,\n translations,\n operator\n}: Props) => {\n const [touched, setTouched] = useState(false);\n // Typed value search query, tracked for the addNew dedupe check below.\n const [searchQuery, setSearchQuery] = useState(\"\");\n\n const {\n valueSelectLabel = \"Value\",\n addNewValueLabel = \"Create new\",\n addNewValueButtonTitle = \"Add new select value\"\n } = translations || {};\n\n const columnMetadata = columnsMetadata.find(({ name }) => name === column);\n const disableAddNew = columnMetadata?.disableAddNew;\n const valueSelectType = columnMetadata?.valueSelectType;\n const {\n onValueSearch,\n onValueLoadMore,\n hasMoreValues,\n valuesLoading,\n minValueSearchLength,\n resolveValueLabels\n } = columnMetadata || {};\n const isAsync = Boolean(onValueSearch);\n\n // Async columns render the live `defaultValues` page instead of the filter's own `values` snapshot.\n const loadedValues = isAsync ? (columnMetadata?.defaultValues ?? []) : values;\n\n // Resolves labels for the loaded page plus any picked values outside it (e.g. from a prior search).\n const resolvedLabels = useMemo(() => {\n if (!isAsync || !resolveValueLabels) {\n return {};\n }\n const unresolvedPicked = pickedValues.filter(value => !loadedValues.includes(value));\n const toResolve = [...loadedValues, ...unresolvedPicked];\n if (toResolve.length === 0) {\n return {};\n }\n return Object.fromEntries(\n resolveValueLabels(toResolve).map(({ value, label }) => [value, label])\n );\n }, [isAsync, resolveValueLabels, pickedValues, loadedValues]);\n\n const getLabel = useCallback((value: string) => resolvedLabels[value] ?? value, [resolvedLabels]);\n\n const isValueRequired = operator && !operator.allowEmptyValues;\n const hasValidationError = Boolean(isValueRequired && pickedValues.length === 0 && touched);\n\n const addNewBtnProps: React.ButtonHTMLAttributes<HTMLButtonElement> = {\n title: addNewValueButtonTitle,\n type: \"button\"\n };\n\n const onChangeHandler = useCallback(\n (e: React.ChangeEvent<HTMLSelectElement>) => {\n const { selectedOptions, value } = e.target;\n\n let newValues: string[];\n\n if (valueSelectType === ValueSelectType.single) {\n newValues = value ? [value] : [];\n } else {\n newValues = Array.from(selectedOptions, option => option.value);\n }\n setPickedValues(newValues);\n setTouched(true);\n },\n [valueSelectType]\n );\n\n // Suppress \"Create new\" while a request is in flight or once the typed value is already loaded.\n const isDuplicateAddNew =\n isAsync && (Boolean(valuesLoading) || loadedValues.includes(searchQuery.trim()));\n\n const selectProps = {\n addNew:\n disableAddNew || isDuplicateAddNew\n ? undefined\n : {\n label: addNewValueLabel,\n onAddNew: (value: string) => {\n if (value) {\n if (!isAsync) {\n setValues(prev => [...prev, value]);\n }\n setPickedValues(prev => [...prev, value]);\n }\n },\n btnProps: addNewBtnProps\n },\n search: {\n enabled: true,\n renderThreshold: 0,\n ...(onValueSearch && {\n searchInputProps: {\n onChange: (event: React.ChangeEvent<HTMLInputElement>) =>\n setSearchQuery(event.currentTarget.value)\n },\n async: {\n onSearch: onValueSearch,\n onLoadMore: onValueLoadMore,\n hasMore: hasMoreValues,\n loading: valuesLoading,\n minSearchLength: minValueSearchLength\n }\n })\n },\n // Only pass the prop the underlying variant reads — the other would fall through to the\n // native `<select>` via rest-prop spread and trigger a \"React does not recognize\" DOM warning.\n ...(isAsync &&\n valueSelectType === ValueSelectType.single && {\n selectedOption: pickedValues[0]\n ? { value: pickedValues[0], label: getLabel(pickedValues[0]) }\n : undefined\n }),\n ...(isAsync &&\n valueSelectType !== ValueSelectType.single && {\n selectedOptions: pickedValues.map(value => ({ value, label: getLabel(value) }))\n })\n };\n\n return ValueSelectType.single === valueSelectType ? (\n <SelectWrapper\n label={valueSelectLabel}\n name={\"value\"}\n value={pickedValues[0]}\n onChange={onChangeHandler}\n selectProps={selectProps}\n error={hasValidationError}\n >\n {loadedValues.map(value => (\n <Option key={value} value={value}>\n {getLabel(value)}\n </Option>\n ))}\n </SelectWrapper>\n ) : (\n <MultiSelectWrapper\n label={valueSelectLabel}\n name={\"value\"}\n value={pickedValues}\n onChange={onChangeHandler}\n selectProps={selectProps}\n error={hasValidationError}\n >\n {loadedValues.map(value => (\n <MultiOption key={value} value={value}>\n {getLabel(value)}\n </MultiOption>\n ))}\n </MultiSelectWrapper>\n );\n};\n"],"names":["column","columnsMetadata","values","pickedValues","setValues","setPickedValues","translations","operator","touched","setTouched","useState","searchQuery","setSearchQuery","valueSelectLabel","addNewValueLabel","addNewValueButtonTitle","columnMetadata","find","name","disableAddNew","valueSelectType","onValueSearch","onValueLoadMore","hasMoreValues","valuesLoading","minValueSearchLength","resolveValueLabels","isAsync","Boolean","loadedValues","defaultValues","resolvedLabels","useMemo","unresolvedPicked","filter","value","includes","toResolve","length","Object","fromEntries","map","label","getLabel","useCallback","isValueRequired","allowEmptyValues","hasValidationError","addNewBtnProps","title","type","onChangeHandler","e","selectedOptions","target","newValues","ValueSelectType","single","Array","from","option","isDuplicateAddNew","trim","selectProps","addNew","onAddNew","prev","btnProps","search","enabled","renderThreshold","searchInputProps","onChange","event","currentTarget","async","onSearch","onLoadMore","hasMore","loading","minSearchLength","selectedOption","React","createElement","SelectWrapper","error","Option","key","MultiSelectWrapper","MultiOption"],"mappings":"ocAsCyC,EACvCA,SACAC,kBACAC,SACAC,eACAC,YACAC,kBACAC,eACAC,eAEA,MAAOC,EAASC,GAAc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ueSelect = ({
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
|
-
// Only the
|
|
102
|
-
//
|
|
103
|
-
// isn't recognized by either and would otherwise fall through onto the native `<select>` via
|
|
104
|
-
// its own rest-prop spread, producing a "React does not recognize the `x` prop" DOM warning.
|
|
101
|
+
// Only pass the prop the underlying variant reads — the other would fall through to the
|
|
102
|
+
// native `<select>` via rest-prop spread and trigger a "React does not recognize" DOM warning.
|
|
105
103
|
...isAsync && valueSelectType === ValueSelectType.single && {
|
|
106
104
|
selectedOption: pickedValues[0] ? { value: pickedValues[0], label: getLabel(pickedValues[0]) } : void 0
|
|
107
105
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridFilterValueSelect.es.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.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, { useCallback, useMemo, useState } from \"react\";\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 {\n DataGridColumnMetadata,\n PopoverTranslations,\n ValueSelectType\n} from \"./DataGridFilters.interfaces\";\n\nexport type Props = {\n column: string;\n columnsMetadata: DataGridColumnMetadata[];\n values: string[];\n pickedValues: string[];\n setValues: (values: React.SetStateAction<string[]>) => void;\n setPickedValues: (pickedValues: React.SetStateAction<string[]>) => void;\n translations?: PopoverTranslations;\n operator?: { allowEmptyValues: boolean } | null;\n};\n\nexport const DataGridFilterValueSelect = ({\n column,\n columnsMetadata,\n values,\n pickedValues,\n setValues,\n setPickedValues,\n translations,\n operator\n}: Props) => {\n const [touched, setTouched] = useState(false);\n // Raw text currently typed into the value search input. Only needed for the addNew dedupe rule\n // below — it mirrors `search.searchInputProps.onChange`, which the underlying Select fires\n // synchronously on every keystroke, ahead of the debounced backend `onValueSearch` call.\n const [searchQuery, setSearchQuery] = useState(\"\");\n\n const {\n valueSelectLabel = \"Value\",\n addNewValueLabel = \"Create new\",\n addNewValueButtonTitle = \"Add new select value\"\n } = translations || {};\n\n const columnMetadata = columnsMetadata.find(({ name }) => name === column);\n const disableAddNew = columnMetadata?.disableAddNew;\n const valueSelectType = columnMetadata?.valueSelectType;\n const {\n onValueSearch,\n onValueLoadMore,\n hasMoreValues,\n valuesLoading,\n minValueSearchLength,\n resolveValueLabels\n } = columnMetadata || {};\n const isAsync = Boolean(onValueSearch);\n\n // Async columns own the currently loaded page via `defaultValues`, kept fresh by the consumer\n // as the user types/scrolls — `values` (the filter's own snapshot, seeded once when the column\n // was selected) remains the source of truth only for static columns, exactly as before.\n const loadedValues = isAsync ? (columnMetadata?.defaultValues ?? []) : values;\n\n // Resolve display labels both for the currently loaded page (so the dropdown shows meaningful\n // labels, not raw values) and for picked values that aren't part of it (e.g. a value saved from\n // a previous, since-scrolled-away-from, search) — mirrors `mergeCustomValuesWithPredefined` in\n // `DataGridFilterService.ts` for the latter.\n const resolvedLabels = useMemo(() => {\n if (!isAsync || !resolveValueLabels) {\n return {};\n }\n const unresolvedPicked = pickedValues.filter(value => !loadedValues.includes(value));\n const toResolve = [...loadedValues, ...unresolvedPicked];\n if (toResolve.length === 0) {\n return {};\n }\n return Object.fromEntries(\n resolveValueLabels(toResolve).map(({ value, label }) => [value, label])\n );\n }, [isAsync, resolveValueLabels, pickedValues, loadedValues]);\n\n const getLabel = useCallback((value: string) => resolvedLabels[value] ?? value, [resolvedLabels]);\n\n const isValueRequired = operator && !operator.allowEmptyValues;\n const hasValidationError = Boolean(isValueRequired && pickedValues.length === 0 && touched);\n\n const addNewBtnProps: React.ButtonHTMLAttributes<HTMLButtonElement> = {\n title: addNewValueButtonTitle,\n type: \"button\"\n };\n\n const onChangeHandler = useCallback(\n (e: React.ChangeEvent<HTMLSelectElement>) => {\n const { selectedOptions, value } = e.target;\n\n let newValues: string[];\n\n if (valueSelectType === ValueSelectType.single) {\n newValues = value ? [value] : [];\n } else {\n newValues = Array.from(selectedOptions, option => option.value);\n }\n setPickedValues(newValues);\n setTouched(true);\n },\n [valueSelectType]\n );\n\n // Suppress \"Create new\" while a request is in flight (the typed value might already be on its\n // way back from the backend) or once an exact match for the typed query is already loaded —\n // both would otherwise let the user create a duplicate value.\n const isDuplicateAddNew =\n isAsync && (Boolean(valuesLoading) || loadedValues.includes(searchQuery.trim()));\n\n const selectProps = {\n addNew:\n disableAddNew || isDuplicateAddNew\n ? undefined\n : {\n label: addNewValueLabel,\n onAddNew: (value: string) => {\n if (value) {\n if (!isAsync) {\n setValues(prev => [...prev, value]);\n }\n setPickedValues(prev => [...prev, value]);\n }\n },\n btnProps: addNewBtnProps\n },\n search: {\n enabled: true,\n renderThreshold: 0,\n ...(onValueSearch && {\n searchInputProps: {\n onChange: (event: React.ChangeEvent<HTMLInputElement>) =>\n setSearchQuery(event.currentTarget.value)\n },\n async: {\n onSearch: onValueSearch,\n onLoadMore: onValueLoadMore,\n hasMore: hasMoreValues,\n loading: valuesLoading,\n minSearchLength: minValueSearchLength\n }\n })\n },\n // Only the field the underlying Select variant actually reads is passed — SingleSelect\n // destructures `selectedOption`, MultiSelect destructures `selectedOptions`; the other one\n // isn't recognized by either and would otherwise fall through onto the native `<select>` via\n // its own rest-prop spread, producing a \"React does not recognize the `x` prop\" DOM warning.\n ...(isAsync &&\n valueSelectType === ValueSelectType.single && {\n selectedOption: pickedValues[0]\n ? { value: pickedValues[0], label: getLabel(pickedValues[0]) }\n : undefined\n }),\n ...(isAsync &&\n valueSelectType !== ValueSelectType.single && {\n selectedOptions: pickedValues.map(value => ({ value, label: getLabel(value) }))\n })\n };\n\n return ValueSelectType.single === valueSelectType ? (\n <SelectWrapper\n label={valueSelectLabel}\n name={\"value\"}\n value={pickedValues[0]}\n onChange={onChangeHandler}\n selectProps={selectProps}\n error={hasValidationError}\n >\n {loadedValues.map(value => (\n <Option key={value} value={value}>\n {getLabel(value)}\n </Option>\n ))}\n </SelectWrapper>\n ) : (\n <MultiSelectWrapper\n label={valueSelectLabel}\n name={\"value\"}\n value={pickedValues}\n onChange={onChangeHandler}\n selectProps={selectProps}\n error={hasValidationError}\n >\n {loadedValues.map(value => (\n <MultiOption key={value} value={value}>\n {getLabel(value)}\n </MultiOption>\n ))}\n </MultiSelectWrapper>\n );\n};\n"],"names":[],"mappings":";;;;;;AAsCO,MAAM,4BAA4B,CAAC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAa;AACX,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAI5C,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,EAAE;AAEjD,QAAM;AAAA,IACJ,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,IACnB,yBAAyB;AAAA,EAAA,IACvB,gBAAgB,CAAA;AAEpB,QAAM,iBAAiB,gBAAgB,KAAK,CAAC,EAAE,KAAA,MAAW,SAAS,MAAM;AACzE,QAAM,gBAAgB,iDAAgB;AACtC,QAAM,kBAAkB,iDAAgB;AACxC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,kBAAkB,CAAA;AACtB,QAAM,UAAU,QAAQ,aAAa;AAKrC,QAAM,eAAe,WAAW,iDAAgB,kBAAiB,CAAA,IAAM;A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AAAA,MACC,OAAO;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,MACP,UAAU;AAAA,MACV;AAAA,MACA,OAAO;AAAA,IAAA;AAAA,IAEN,aAAa,IAAI,CAAA,UAChB,sBAAA,cAAC,aAAA,EAAY,KAAK,OAAO,MAAA,GACtB,SAAS,KAAK,CACjB,CACD;AAAA,EAAA;AAGP;"}
|
|
1
|
+
{"version":3,"file":"DataGridFilterValueSelect.es.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.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, { useCallback, useMemo, useState } from \"react\";\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 {\n DataGridColumnMetadata,\n PopoverTranslations,\n ValueSelectType\n} from \"./DataGridFilters.interfaces\";\n\nexport type Props = {\n column: string;\n columnsMetadata: DataGridColumnMetadata[];\n values: string[];\n pickedValues: string[];\n setValues: (values: React.SetStateAction<string[]>) => void;\n setPickedValues: (pickedValues: React.SetStateAction<string[]>) => void;\n translations?: PopoverTranslations;\n operator?: { allowEmptyValues: boolean } | null;\n};\n\nexport const DataGridFilterValueSelect = ({\n column,\n columnsMetadata,\n values,\n pickedValues,\n setValues,\n setPickedValues,\n translations,\n operator\n}: Props) => {\n const [touched, setTouched] = useState(false);\n // Typed value search query, tracked for the addNew dedupe check below.\n const [searchQuery, setSearchQuery] = useState(\"\");\n\n const {\n valueSelectLabel = \"Value\",\n addNewValueLabel = \"Create new\",\n addNewValueButtonTitle = \"Add new select value\"\n } = translations || {};\n\n const columnMetadata = columnsMetadata.find(({ name }) => name === column);\n const disableAddNew = columnMetadata?.disableAddNew;\n const valueSelectType = columnMetadata?.valueSelectType;\n const {\n onValueSearch,\n onValueLoadMore,\n hasMoreValues,\n valuesLoading,\n minValueSearchLength,\n resolveValueLabels\n } = columnMetadata || {};\n const isAsync = Boolean(onValueSearch);\n\n // Async columns render the live `defaultValues` page instead of the filter's own `values` snapshot.\n const loadedValues = isAsync ? (columnMetadata?.defaultValues ?? []) : values;\n\n // Resolves labels for the loaded page plus any picked values outside it (e.g. from a prior search).\n const resolvedLabels = useMemo(() => {\n if (!isAsync || !resolveValueLabels) {\n return {};\n }\n const unresolvedPicked = pickedValues.filter(value => !loadedValues.includes(value));\n const toResolve = [...loadedValues, ...unresolvedPicked];\n if (toResolve.length === 0) {\n return {};\n }\n return Object.fromEntries(\n resolveValueLabels(toResolve).map(({ value, label }) => [value, label])\n );\n }, [isAsync, resolveValueLabels, pickedValues, loadedValues]);\n\n const getLabel = useCallback((value: string) => resolvedLabels[value] ?? value, [resolvedLabels]);\n\n const isValueRequired = operator && !operator.allowEmptyValues;\n const hasValidationError = Boolean(isValueRequired && pickedValues.length === 0 && touched);\n\n const addNewBtnProps: React.ButtonHTMLAttributes<HTMLButtonElement> = {\n title: addNewValueButtonTitle,\n type: \"button\"\n };\n\n const onChangeHandler = useCallback(\n (e: React.ChangeEvent<HTMLSelectElement>) => {\n const { selectedOptions, value } = e.target;\n\n let newValues: string[];\n\n if (valueSelectType === ValueSelectType.single) {\n newValues = value ? [value] : [];\n } else {\n newValues = Array.from(selectedOptions, option => option.value);\n }\n setPickedValues(newValues);\n setTouched(true);\n },\n [valueSelectType]\n );\n\n // Suppress \"Create new\" while a request is in flight or once the typed value is already loaded.\n const isDuplicateAddNew =\n isAsync && (Boolean(valuesLoading) || loadedValues.includes(searchQuery.trim()));\n\n const selectProps = {\n addNew:\n disableAddNew || isDuplicateAddNew\n ? undefined\n : {\n label: addNewValueLabel,\n onAddNew: (value: string) => {\n if (value) {\n if (!isAsync) {\n setValues(prev => [...prev, value]);\n }\n setPickedValues(prev => [...prev, value]);\n }\n },\n btnProps: addNewBtnProps\n },\n search: {\n enabled: true,\n renderThreshold: 0,\n ...(onValueSearch && {\n searchInputProps: {\n onChange: (event: React.ChangeEvent<HTMLInputElement>) =>\n setSearchQuery(event.currentTarget.value)\n },\n async: {\n onSearch: onValueSearch,\n onLoadMore: onValueLoadMore,\n hasMore: hasMoreValues,\n loading: valuesLoading,\n minSearchLength: minValueSearchLength\n }\n })\n },\n // Only pass the prop the underlying variant reads — the other would fall through to the\n // native `<select>` via rest-prop spread and trigger a \"React does not recognize\" DOM warning.\n ...(isAsync &&\n valueSelectType === ValueSelectType.single && {\n selectedOption: pickedValues[0]\n ? { value: pickedValues[0], label: getLabel(pickedValues[0]) }\n : undefined\n }),\n ...(isAsync &&\n valueSelectType !== ValueSelectType.single && {\n selectedOptions: pickedValues.map(value => ({ value, label: getLabel(value) }))\n })\n };\n\n return ValueSelectType.single === valueSelectType ? (\n <SelectWrapper\n label={valueSelectLabel}\n name={\"value\"}\n value={pickedValues[0]}\n onChange={onChangeHandler}\n selectProps={selectProps}\n error={hasValidationError}\n >\n {loadedValues.map(value => (\n <Option key={value} value={value}>\n {getLabel(value)}\n </Option>\n ))}\n </SelectWrapper>\n ) : (\n <MultiSelectWrapper\n label={valueSelectLabel}\n name={\"value\"}\n value={pickedValues}\n onChange={onChangeHandler}\n selectProps={selectProps}\n error={hasValidationError}\n >\n {loadedValues.map(value => (\n <MultiOption key={value} value={value}>\n {getLabel(value)}\n </MultiOption>\n ))}\n </MultiSelectWrapper>\n );\n};\n"],"names":[],"mappings":";;;;;;AAsCO,MAAM,4BAA4B,CAAC;AAAA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AA,MAC5C,gBAAgB,aAAa,CAAC,IAC1B,EAAE,OAAO,aAAa,CAAC,GAAG,OAAO,SAAS,aAAa,CAAC,CAAC,MACzD;AAAA,IAAA;AAAA,IAER,GAAI,WACF,oBAAoB,gBAAgB,UAAU;AAAA,MAC5C,iBAAiB,aAAa,IAAI,CAAA,WAAU,EAAE,OAAO,OAAO,SAAS,KAAK,IAAI;AAAA,IAAA;AAAA,EAChF;AAGJ,SAAO,gBAAgB,WAAW,kBAChC,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,MAAM;AAAA,MACN,OAAO,aAAa,CAAC;AAAA,MACrB,UAAU;AAAA,MACV;AAAA,MACA,OAAO;AAAA,IAAA;AAAA,IAEN,aAAa,IAAI,CAAA,UAChB,sBAAA,cAAC,QAAA,EAAO,KAAK,OAAO,MAAA,GACjB,SAAS,KAAK,CACjB,CACD;AAAA,EAAA,IAGH,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,MACP,UAAU;AAAA,MACV;AAAA,MACA,OAAO;AAAA,IAAA;AAAA,IAEN,aAAa,IAAI,CAAA,UAChB,sBAAA,cAAC,aAAA,EAAY,KAAK,OAAO,MAAA,GACtB,SAAS,KAAK,CACjB,CACD;AAAA,EAAA;AAGP;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridFilters.interfaces.cjs.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.ts"],"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\nexport interface FilterOperator {\n name: string;\n allowEmptyValues: boolean;\n}\n\nexport interface Filter {\n id: string;\n column: string;\n operator: FilterOperator | null;\n value: string[];\n}\n\nexport type FiltersAction =\n | {\n type: \"add\";\n payload: Filter;\n }\n | {\n type: \"edit\";\n payload: Filter;\n }\n | {\n type: \"remove\";\n payload: { id: string };\n }\n | {\n type: \"reset\";\n payload: Filter[];\n }\n | {\n type: \"clear\";\n };\n\nexport type FiltersState = {\n filters: Filter[];\n};\n\nexport type FilterEditorMode = \"ADD\" | \"EDIT\" | \"ADD_DATE\";\n\nexport const DefaultOperators: Record<string, FilterOperator> = {\n is: { name: \"is\", allowEmptyValues: false },\n isNot: { name: \"is not\", allowEmptyValues: false },\n contains: { name: \"contains\", allowEmptyValues: false },\n doesNotContain: { name: \"does not contain\", allowEmptyValues: false },\n isEmpty: { name: \"is empty\", allowEmptyValues: true }\n};\n\nexport interface DataGridColumnMetadata {\n name: string;\n headline: string;\n operators?: FilterOperator[];\n defaultValues?: string[];\n disableAddNew?: boolean;\n allowSingleFilterOnly?: boolean;\n valueSelectType?: ValueSelectType;\n /**\n * Enables backend value search for this column. When provided, `defaultValues` is treated as\n * the initial page only
|
|
1
|
+
{"version":3,"file":"DataGridFilters.interfaces.cjs.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.ts"],"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\nexport interface FilterOperator {\n name: string;\n allowEmptyValues: boolean;\n}\n\nexport interface Filter {\n id: string;\n column: string;\n operator: FilterOperator | null;\n value: string[];\n}\n\nexport type FiltersAction =\n | {\n type: \"add\";\n payload: Filter;\n }\n | {\n type: \"edit\";\n payload: Filter;\n }\n | {\n type: \"remove\";\n payload: { id: string };\n }\n | {\n type: \"reset\";\n payload: Filter[];\n }\n | {\n type: \"clear\";\n };\n\nexport type FiltersState = {\n filters: Filter[];\n};\n\nexport type FilterEditorMode = \"ADD\" | \"EDIT\" | \"ADD_DATE\";\n\nexport const DefaultOperators: Record<string, FilterOperator> = {\n is: { name: \"is\", allowEmptyValues: false },\n isNot: { name: \"is not\", allowEmptyValues: false },\n contains: { name: \"contains\", allowEmptyValues: false },\n doesNotContain: { name: \"does not contain\", allowEmptyValues: false },\n isEmpty: { name: \"is empty\", allowEmptyValues: true }\n};\n\nexport interface DataGridColumnMetadata {\n name: string;\n headline: string;\n operators?: FilterOperator[];\n defaultValues?: string[];\n disableAddNew?: boolean;\n allowSingleFilterOnly?: boolean;\n valueSelectType?: ValueSelectType;\n /**\n * Enables backend value search for this column. When provided, `defaultValues` is treated as\n * the initial page only, and the value select fetches further pages as the user types/scrolls.\n */\n onValueSearch?: (query: string) => void;\n /** Called to fetch the next page of values once the user reaches the end of the loaded list. */\n onValueLoadMore?: () => void;\n /** Whether another page of values is available after the currently loaded ones. */\n hasMoreValues?: boolean;\n /** Whether a value search/page fetch is currently in flight. */\n valuesLoading?: boolean;\n /** Minimum query length required before `onValueSearch` is invoked. */\n minValueSearchLength?: number;\n /**\n * Resolves display labels for saved values not present in the currently loaded page (e.g. from\n * a previously saved filter), used in EDIT mode to show a label instead of the raw value.\n */\n resolveValueLabels?: (values: string[]) => { value: string; label: string }[];\n}\n\nexport interface PopoverTranslations {\n columnSelectLabel?: string;\n operatorSelectLabel?: string;\n valueSelectLabel?: string;\n addNewValueLabel?: string;\n addNewValueButtonTitle?: string;\n submitButtonTitle?: string;\n cancelButtonTitle?: string;\n}\n\nexport interface TagTranslations {\n addButtonCaption?: string;\n or?: string;\n other?: string;\n dateIs?: string;\n}\n\nexport interface ToolbarTranslations {\n clearButtonCaption?: string;\n}\n\nexport interface FiltersTranslations {\n toolbar?: ToolbarTranslations;\n tag?: TagTranslations;\n popover?: PopoverTranslations;\n}\n\nexport interface KeyValuePair<TKey = string, TValue = string> {\n key: TKey;\n value: TValue;\n}\n\nexport type DateTimeFilterType =\n | \"THIRTY_SECONDS\"\n | \"ONE_MINUTE\"\n | \"FIVE_MINUTES\"\n | \"ONE_HOUR\"\n | \"TWENTY_FOUR_HOURS\"\n | \"CUSTOM\";\n\nexport interface DateTimeFilter {\n fromDate: string;\n toDate: string;\n type: DateTimeFilterType;\n}\n\nexport enum ValueSelectType {\n single = \"single\",\n multi = \"multi\"\n}\n"],"names":["ValueSelectType","is","name","allowEmptyValues","isNot","contains","doesNotContain","isEmpty"],"mappings":"gFAyIO,IAAKA,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,MAAQ,QAFEA,IAAAA,GAAA,CAAA,4BAlFoD,CAC9DC,GAAI,CAAEC,KAAM,KAAMC,kBAAkB,GACpCC,MAAO,CAAEF,KAAM,SAAUC,kBAAkB,GAC3CE,SAAU,CAAEH,KAAM,WAAYC,kBAAkB,GAChDG,eAAgB,CAAEJ,KAAM,mBAAoBC,kBAAkB,GAC9DI,QAAS,CAAEL,KAAM,WAAYC,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGridFilters.interfaces.es.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.ts"],"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\nexport interface FilterOperator {\n name: string;\n allowEmptyValues: boolean;\n}\n\nexport interface Filter {\n id: string;\n column: string;\n operator: FilterOperator | null;\n value: string[];\n}\n\nexport type FiltersAction =\n | {\n type: \"add\";\n payload: Filter;\n }\n | {\n type: \"edit\";\n payload: Filter;\n }\n | {\n type: \"remove\";\n payload: { id: string };\n }\n | {\n type: \"reset\";\n payload: Filter[];\n }\n | {\n type: \"clear\";\n };\n\nexport type FiltersState = {\n filters: Filter[];\n};\n\nexport type FilterEditorMode = \"ADD\" | \"EDIT\" | \"ADD_DATE\";\n\nexport const DefaultOperators: Record<string, FilterOperator> = {\n is: { name: \"is\", allowEmptyValues: false },\n isNot: { name: \"is not\", allowEmptyValues: false },\n contains: { name: \"contains\", allowEmptyValues: false },\n doesNotContain: { name: \"does not contain\", allowEmptyValues: false },\n isEmpty: { name: \"is empty\", allowEmptyValues: true }\n};\n\nexport interface DataGridColumnMetadata {\n name: string;\n headline: string;\n operators?: FilterOperator[];\n defaultValues?: string[];\n disableAddNew?: boolean;\n allowSingleFilterOnly?: boolean;\n valueSelectType?: ValueSelectType;\n /**\n * Enables backend value search for this column. When provided, `defaultValues` is treated as\n * the initial page only
|
|
1
|
+
{"version":3,"file":"DataGridFilters.interfaces.es.js","sources":["../../../../src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.ts"],"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\nexport interface FilterOperator {\n name: string;\n allowEmptyValues: boolean;\n}\n\nexport interface Filter {\n id: string;\n column: string;\n operator: FilterOperator | null;\n value: string[];\n}\n\nexport type FiltersAction =\n | {\n type: \"add\";\n payload: Filter;\n }\n | {\n type: \"edit\";\n payload: Filter;\n }\n | {\n type: \"remove\";\n payload: { id: string };\n }\n | {\n type: \"reset\";\n payload: Filter[];\n }\n | {\n type: \"clear\";\n };\n\nexport type FiltersState = {\n filters: Filter[];\n};\n\nexport type FilterEditorMode = \"ADD\" | \"EDIT\" | \"ADD_DATE\";\n\nexport const DefaultOperators: Record<string, FilterOperator> = {\n is: { name: \"is\", allowEmptyValues: false },\n isNot: { name: \"is not\", allowEmptyValues: false },\n contains: { name: \"contains\", allowEmptyValues: false },\n doesNotContain: { name: \"does not contain\", allowEmptyValues: false },\n isEmpty: { name: \"is empty\", allowEmptyValues: true }\n};\n\nexport interface DataGridColumnMetadata {\n name: string;\n headline: string;\n operators?: FilterOperator[];\n defaultValues?: string[];\n disableAddNew?: boolean;\n allowSingleFilterOnly?: boolean;\n valueSelectType?: ValueSelectType;\n /**\n * Enables backend value search for this column. When provided, `defaultValues` is treated as\n * the initial page only, and the value select fetches further pages as the user types/scrolls.\n */\n onValueSearch?: (query: string) => void;\n /** Called to fetch the next page of values once the user reaches the end of the loaded list. */\n onValueLoadMore?: () => void;\n /** Whether another page of values is available after the currently loaded ones. */\n hasMoreValues?: boolean;\n /** Whether a value search/page fetch is currently in flight. */\n valuesLoading?: boolean;\n /** Minimum query length required before `onValueSearch` is invoked. */\n minValueSearchLength?: number;\n /**\n * Resolves display labels for saved values not present in the currently loaded page (e.g. from\n * a previously saved filter), used in EDIT mode to show a label instead of the raw value.\n */\n resolveValueLabels?: (values: string[]) => { value: string; label: string }[];\n}\n\nexport interface PopoverTranslations {\n columnSelectLabel?: string;\n operatorSelectLabel?: string;\n valueSelectLabel?: string;\n addNewValueLabel?: string;\n addNewValueButtonTitle?: string;\n submitButtonTitle?: string;\n cancelButtonTitle?: string;\n}\n\nexport interface TagTranslations {\n addButtonCaption?: string;\n or?: string;\n other?: string;\n dateIs?: string;\n}\n\nexport interface ToolbarTranslations {\n clearButtonCaption?: string;\n}\n\nexport interface FiltersTranslations {\n toolbar?: ToolbarTranslations;\n tag?: TagTranslations;\n popover?: PopoverTranslations;\n}\n\nexport interface KeyValuePair<TKey = string, TValue = string> {\n key: TKey;\n value: TValue;\n}\n\nexport type DateTimeFilterType =\n | \"THIRTY_SECONDS\"\n | \"ONE_MINUTE\"\n | \"FIVE_MINUTES\"\n | \"ONE_HOUR\"\n | \"TWENTY_FOUR_HOURS\"\n | \"CUSTOM\";\n\nexport interface DateTimeFilter {\n fromDate: string;\n toDate: string;\n type: DateTimeFilterType;\n}\n\nexport enum ValueSelectType {\n single = \"single\",\n multi = \"multi\"\n}\n"],"names":["ValueSelectType"],"mappings":"AAuDO,MAAM,mBAAmD;AAAA,EAC9D,IAAI,EAAE,MAAM,MAAM,kBAAkB,MAAA;AAAA,EACpC,OAAO,EAAE,MAAM,UAAU,kBAAkB,MAAA;AAAA,EAC3C,UAAU,EAAE,MAAM,YAAY,kBAAkB,MAAA;AAAA,EAChD,gBAAgB,EAAE,MAAM,oBAAoB,kBAAkB,MAAA;AAAA,EAC9D,SAAS,EAAE,MAAM,YAAY,kBAAkB,KAAA;AACjD;AA4EO,IAAK,oCAAAA,qBAAL;AACLA,mBAAA,QAAA,IAAS;AACTA,mBAAA,OAAA,IAAQ;AAFE,SAAAA;AAAA,GAAA,mBAAA,CAAA,CAAA;"}
|