@onewelcome/react-lib-components 14.0.0-alpha.1 → 14.0.0-alpha.2
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.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.es.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.es.js.map +1 -1
- 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 +17 -21
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.es.js +15 -4
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.es.js +54 -6
- 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.cjs.js +1 -1
- package/dist/components/Form/Fieldset/Fieldset.cjs.js.map +1 -1
- package/dist/components/Form/Fieldset/Fieldset.es.js +3 -4
- package/dist/components/Form/Fieldset/Fieldset.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/FormControl/FormControl.cjs.js.map +1 -1
- package/dist/components/Form/FormControl/FormControl.es.js +4 -5
- package/dist/components/Form/FormControl/FormControl.es.js.map +1 -1
- 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.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 +8 -6
- 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 +180 -36
- 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 -15
- 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 +69 -52
- 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 +9 -8
- 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 +160 -33
- 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 -17
- 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 +46 -34
- 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.cjs.js +1 -1
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.es.js +7 -5
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/miscellaneous/IdentityProviderButton.es.js.map +1 -1
- 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 +64 -9
- 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,17 +1,17 @@
|
|
|
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 */.Radio_radio-
|
|
2
|
-
const error = "
|
|
3
|
-
const disabled = "
|
|
4
|
-
const radio = "
|
|
5
|
-
const input = "
|
|
6
|
-
const circle = "
|
|
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 */.Radio_radio-wrapper_lUyNk{position:relative}.Radio_radio-wrapper_lUyNk+.Radio_radio-wrapper_lUyNk{margin-top:.75rem}.Radio_error_lUyNk{color:var(--error)}.Radio_error-message_lUyNk{margin-top:.25rem;margin-left:calc(1.75 * var(--font-size));font-size:var(--font-size-sub)}.Radio_error-message_lUyNk [data-icon]{font-size:1rem}.Radio_helper-text_lUyNk{margin-top:.25rem;margin-left:1.75rem}.Radio_error-icon_lUyNk{margin-right:.5rem;font-size:var(--font-size-big)}.Radio_radio-container_lUyNk{display:flex}.Radio_radio-container_lUyNk label{display:inline-block;margin-left:calc(.5 * var(--font-size));font-size:var(--font-size-form-label);font-family:var(--font-family);margin-top:.15rem}.Radio_radio-container_lUyNk label.Radio_no-margin-top_lUyNk{margin-top:0}.Radio_disabled_lUyNk .Radio_radio-container_lUyNk label{cursor:not-allowed}.Radio_native-input_lUyNk{position:absolute;top:0;left:0;opacity:0;margin:0;width:var(--font-size-big);height:var(--font-size-big);z-index:2}.Radio_native-input_lUyNk+span[data-icon=true]:before{display:block;width:var(--font-size-big);height:var(--font-size-big)}.Radio_native-input_lUyNk:checked+*{color:var(--radio-checked-color)}.Radio_native-input_lUyNk:checked+*.Radio_disabled_lUyNk{color:var(--disabled);cursor:not-allowed;pointer-events:none}.Radio_native-input_lUyNk:focus-visible+*{border-radius:100%;outline:2px solid var(--color-focus);outline-offset:2px}.Radio_native-input_lUyNk.Radio_error_lUyNk+*{border-radius:100%}.Radio_native-input_lUyNk.Radio_error_lUyNk:hover+.Radio_radio_lUyNk:before{outline-color:var(--radio-hover-background-color)}.Radio_native-input_lUyNk.Radio_error_lUyNk:active+.Radio_radio_lUyNk:before{outline-color:var(--radio-pressed-background-color)}.Radio_native-input_lUyNk:hover+.Radio_input_lUyNk.Radio_circle_lUyNk:not(.Radio_disabled_lUyNk){background-color:var(--radio-hover-background-color)}.Radio_native-input_lUyNk:active+.Radio_input_lUyNk.Radio_circle_lUyNk:not(.Radio_disabled_lUyNk){background-color:var(--radio-pressed-background-color)}.Radio_native-input_lUyNk:hover+.Radio_input_lUyNk.Radio_radio_lUyNk:not(.Radio_disabled_lUyNk){background-color:var(--radio-hover-background-color);color:var(--radio-hover-color)}.Radio_native-input_lUyNk:active+.Radio_input_lUyNk.Radio_radio_lUyNk:not(.Radio_disabled_lUyNk){color:var(--radio-pressed-color);background-color:var(--radio-pressed-background-color)}.Radio_input_lUyNk{font-size:var(--font-size-big);width:var(--font-size-big);height:var(--font-size-big);z-index:1;border-radius:100%;color:var(--color-blue-grey500)}.Radio_input_lUyNk:active{border-radius:100%}.Radio_disabled_lUyNk .Radio_input_lUyNk{color:var(--disabled)}.Radio_disabled_lUyNk{color:var(--disabled);pointer-events:none}[data-readonlyview=true] .Radio_radio-wrapper_lUyNk{color:var(--read-only-text-color)}[data-readonlyview=true] .Radio_radio-wrapper_lUyNk span.Radio_input_lUyNk{color:var(--read-only-text-color);cursor:not-allowed}[data-readonlyview=true] .Radio_radio-wrapper_lUyNk span.Radio_input_lUyNk:before{outline:1px solid var(--read-only-border-color);outline-offset:-1px;border-radius:50%}[data-readonlyview=true] .Radio_radio-wrapper_lUyNk label{-webkit-user-select:text;user-select:text}.Radio_radio-container_lUyNk input[type=radio][data-readonlyview=true]~span.Radio_input_lUyNk{color:var(--read-only-text-color);cursor:not-allowed}.Radio_radio-container_lUyNk input[type=radio][data-readonlyview=true]~span.Radio_input_lUyNk:before{outline:1px solid var(--read-only-border-color);outline-offset:-1px;border-radius:50%}.Radio_radio-container_lUyNk input[type=radio][data-readonlyview=true]~label{-webkit-user-select:text;user-select:text;pointer-events:none}.Radio_radio-container_lUyNk input[type=radio][data-readonlyview=true] :focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();
|
|
2
|
+
const error = "Radio_error_lUyNk";
|
|
3
|
+
const disabled = "Radio_disabled_lUyNk";
|
|
4
|
+
const radio = "Radio_radio_lUyNk";
|
|
5
|
+
const input = "Radio_input_lUyNk";
|
|
6
|
+
const circle = "Radio_circle_lUyNk";
|
|
7
7
|
const classes = {
|
|
8
|
-
"radio-wrapper": "Radio_radio-
|
|
8
|
+
"radio-wrapper": "Radio_radio-wrapper_lUyNk",
|
|
9
9
|
error,
|
|
10
|
-
"error-message": "Radio_error-
|
|
11
|
-
"radio-container": "Radio_radio-
|
|
12
|
-
"no-margin-top": "Radio_no-margin-
|
|
10
|
+
"error-message": "Radio_error-message_lUyNk",
|
|
11
|
+
"radio-container": "Radio_radio-container_lUyNk",
|
|
12
|
+
"no-margin-top": "Radio_no-margin-top_lUyNk",
|
|
13
13
|
disabled,
|
|
14
|
-
"native-input": "Radio_native-
|
|
14
|
+
"native-input": "Radio_native-input_lUyNk",
|
|
15
15
|
radio,
|
|
16
16
|
input,
|
|
17
17
|
circle
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),l=require("../SingleSelect/Option.cjs.js"),t=require("./MultiSelect.module.scss.cjs.js"),o=e.forwardRef(({fixed:o,hasFocus:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),l=require("../SingleSelect/Option.cjs.js"),t=require("./MultiSelect.module.scss.cjs.js"),s=require("../../../../util/helper.cjs.js"),o=e.forwardRef(({fixed:o,hasFocus:r,className:u,...n},c)=>{const i=e.useRef(null),a=c||i,f=s.classNames(u,{[t.default.focus]:r});return e.useEffect(()=>{a.current&&r&&(e=>{var l,t,s;const o=e.parentElement,r=null==(l=e.parentElement)?void 0:l.parentElement;!!(null==r?void 0:r.style.maxHeight)&&(null==(t=null==r?void 0:r.scrollTo)||t.call(r,0,e.offsetTop-((null==r?void 0:r.offsetHeight)??1)/2)),null==(s=null==o?void 0:o.scrollTo)||s.call(o,0,e.offsetTop-((null==o?void 0:o.offsetHeight)??1)/2)})(a.current)},[r,a]),e.createElement(l.Option,{ref:a,isSelected:r,disableDefaultSelectedStyle:!0,className:f,...n})});exports.MultiOption=o;
|
|
2
2
|
//# sourceMappingURL=MultiOption.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiOption.cjs.js","sources":["../../../../../src/components/Form/Select/MultiSelect/MultiOption.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, { ForwardRefRenderFunction, RefObject,
|
|
1
|
+
{"version":3,"file":"MultiOption.cjs.js","sources":["../../../../../src/components/Form/Select/MultiSelect/MultiOption.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, { ForwardRefRenderFunction, RefObject, useEffect, useRef } from \"react\";\nimport { Props as SelectOptionProps, Option as SelectOption } from \"../SingleSelect/Option\";\n\nimport classes from \"./MultiSelect.module.scss\";\nimport { classNames } from \"../../../../util/helper\";\n\nexport interface Props extends SelectOptionProps {\n fixed?: boolean;\n}\n\nconst MultiOptionComponent: ForwardRefRenderFunction<HTMLLIElement, Props> = (\n { fixed: _fixed, hasFocus, className, ...rest }: Props,\n ref\n) => {\n /** Must be `useRef`, not `createRef` — a fresh ref every render made the scroll-into-view\n * effect below re-fire on unrelated re-renders, resetting scroll even when focus hadn't changed. */\n const fallbackRef = useRef<HTMLLIElement>(null);\n const innerOptionRef = (ref as RefObject<HTMLLIElement | null>) || fallbackRef;\n\n const additionalClasses = classNames(className, {\n [classes[\"focus\"]]: hasFocus\n });\n\n const scrollToSelectedElement = (element: HTMLLIElement) => {\n const listbox = element.parentElement;\n const listboxWrapper = element.parentElement?.parentElement;\n const isListboxWrapperScrollable = !!listboxWrapper?.style.maxHeight;\n\n if (isListboxWrapperScrollable) {\n listboxWrapper?.scrollTo?.(0, element.offsetTop - (listboxWrapper?.offsetHeight ?? 1) / 2);\n }\n listbox?.scrollTo?.(0, element.offsetTop - (listbox?.offsetHeight ?? 1) / 2);\n };\n\n useEffect(() => {\n if (innerOptionRef.current && hasFocus) {\n scrollToSelectedElement(innerOptionRef.current);\n }\n }, [hasFocus, innerOptionRef]);\n\n return (\n <SelectOption\n ref={innerOptionRef}\n isSelected={hasFocus}\n disableDefaultSelectedStyle\n className={additionalClasses}\n {...rest}\n />\n );\n};\n\nexport const MultiOption = React.forwardRef(MultiOptionComponent);\n"],"names":["MultiOption","React","forwardRef","fixed","_fixed","hasFocus","className","rest","ref","fallbackRef","useRef","innerOptionRef","additionalClasses","classNames","classes","useEffect","current","element","listbox","parentElement","listboxWrapper","_a","style","maxHeight","_b","scrollTo","call","offsetTop","offsetHeight","_c","scrollToSelectedElement","createElement","SelectOption","isSelected","disableDefaultSelectedStyle"],"mappings":"8OAmEaA,EAAcC,EAAMC,WAzC4C,EACzEC,MAAOC,EAAQC,WAAUC,eAAcC,GACzCC,KAIA,MAAMC,EAAcC,EAAAA,OAAsB,MACpCC,EAAkBH,GAA2CC,EAE7DG,EAAoBC,EAAAA,WAAWP,EAAW,CAC9C,CAACQ,EAAAA,QAAe,OAAIT,IAoBtB,OANAU,EAAAA,UAAU,KACJJ,EAAeK,SAAWX,GAZA,CAACY,cAC/B,MAAMC,EAAUD,EAAQE,cAClBC,EAAiB,OAAAC,EAAAJ,EAAQE,oBAAR,EAAAE,EAAuBF,iBACT,MAAAC,OAAA,EAAAA,EAAgBE,MAAMC,aAGzD,OAAAC,EAAA,MAAAJ,OAAA,EAAAA,EAAgBK,WAAhBD,EAAAE,KAAAN,EAA2B,EAAGH,EAAQU,YAAa,MAAAP,OAAA,EAAAA,EAAgBQ,eAAgB,GAAK,IAE1F,OAAAC,EAAA,MAAAX,OAAA,EAAAA,EAASO,WAATI,EAAAH,KAAAR,EAAoB,EAAGD,EAAQU,YAAa,MAAAT,OAAA,EAAAA,EAASU,eAAgB,GAAK,IAKxEE,CAAwBnB,EAAeK,UAExC,CAACX,EAAUM,IAGZV,EAAA8B,cAACC,EAAAA,OAAA,CACCxB,IAAKG,EACLsB,WAAY5B,EACZ6B,6BAA2B,EAC3B5B,UAAWM,KACPL"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useRef, useEffect } from "react";
|
|
2
2
|
import { Option } from "../SingleSelect/Option.es.js";
|
|
3
3
|
import classes from "./MultiSelect.module.scss.es.js";
|
|
4
|
+
import { classNames } from "../../../../util/helper.es.js";
|
|
4
5
|
const MultiOptionComponent = ({ fixed: _fixed, hasFocus, className, ...rest }, ref) => {
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const fallbackRef = useRef(null);
|
|
7
|
+
const innerOptionRef = ref || fallbackRef;
|
|
8
|
+
const additionalClasses = classNames(className, {
|
|
9
|
+
[classes["focus"]]: hasFocus
|
|
10
|
+
});
|
|
9
11
|
const scrollToSelectedElement = (element) => {
|
|
10
12
|
var _a, _b, _c;
|
|
11
13
|
const listbox = element.parentElement;
|
|
@@ -27,7 +29,7 @@ const MultiOptionComponent = ({ fixed: _fixed, hasFocus, className, ...rest }, r
|
|
|
27
29
|
ref: innerOptionRef,
|
|
28
30
|
isSelected: hasFocus,
|
|
29
31
|
disableDefaultSelectedStyle: true,
|
|
30
|
-
className: additionalClasses
|
|
32
|
+
className: additionalClasses,
|
|
31
33
|
...rest
|
|
32
34
|
}
|
|
33
35
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiOption.es.js","sources":["../../../../../src/components/Form/Select/MultiSelect/MultiOption.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, { ForwardRefRenderFunction, RefObject,
|
|
1
|
+
{"version":3,"file":"MultiOption.es.js","sources":["../../../../../src/components/Form/Select/MultiSelect/MultiOption.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, { ForwardRefRenderFunction, RefObject, useEffect, useRef } from \"react\";\nimport { Props as SelectOptionProps, Option as SelectOption } from \"../SingleSelect/Option\";\n\nimport classes from \"./MultiSelect.module.scss\";\nimport { classNames } from \"../../../../util/helper\";\n\nexport interface Props extends SelectOptionProps {\n fixed?: boolean;\n}\n\nconst MultiOptionComponent: ForwardRefRenderFunction<HTMLLIElement, Props> = (\n { fixed: _fixed, hasFocus, className, ...rest }: Props,\n ref\n) => {\n /** Must be `useRef`, not `createRef` — a fresh ref every render made the scroll-into-view\n * effect below re-fire on unrelated re-renders, resetting scroll even when focus hadn't changed. */\n const fallbackRef = useRef<HTMLLIElement>(null);\n const innerOptionRef = (ref as RefObject<HTMLLIElement | null>) || fallbackRef;\n\n const additionalClasses = classNames(className, {\n [classes[\"focus\"]]: hasFocus\n });\n\n const scrollToSelectedElement = (element: HTMLLIElement) => {\n const listbox = element.parentElement;\n const listboxWrapper = element.parentElement?.parentElement;\n const isListboxWrapperScrollable = !!listboxWrapper?.style.maxHeight;\n\n if (isListboxWrapperScrollable) {\n listboxWrapper?.scrollTo?.(0, element.offsetTop - (listboxWrapper?.offsetHeight ?? 1) / 2);\n }\n listbox?.scrollTo?.(0, element.offsetTop - (listbox?.offsetHeight ?? 1) / 2);\n };\n\n useEffect(() => {\n if (innerOptionRef.current && hasFocus) {\n scrollToSelectedElement(innerOptionRef.current);\n }\n }, [hasFocus, innerOptionRef]);\n\n return (\n <SelectOption\n ref={innerOptionRef}\n isSelected={hasFocus}\n disableDefaultSelectedStyle\n className={additionalClasses}\n {...rest}\n />\n );\n};\n\nexport const MultiOption = React.forwardRef(MultiOptionComponent);\n"],"names":["SelectOption"],"mappings":";;;;AA0BA,MAAM,uBAAuE,CAC3E,EAAE,OAAO,QAAQ,UAAU,WAAW,GAAG,KAAA,GACzC,QACG;AAGH,QAAM,cAAc,OAAsB,IAAI;AAC9C,QAAM,iBAAkB,OAA2C;AAEnE,QAAM,oBAAoB,WAAW,WAAW;AAAA,IAC9C,CAAC,QAAQ,OAAO,CAAC,GAAG;AAAA,EAAA,CACrB;AAED,QAAM,0BAA0B,CAAC,YAA2B;;AAC1D,UAAM,UAAU,QAAQ;AACxB,UAAM,kBAAiB,aAAQ,kBAAR,mBAAuB;AAC9C,UAAM,6BAA6B,CAAC,EAAC,iDAAgB,MAAM;AAE3D,QAAI,4BAA4B;AAC9B,6DAAgB,aAAhB,wCAA2B,GAAG,QAAQ,cAAa,iDAAgB,iBAAgB,KAAK;AAAA,IAC1F;AACA,6CAAS,aAAT,iCAAoB,GAAG,QAAQ,cAAa,mCAAS,iBAAgB,KAAK;AAAA,EAC5E;AAEA,YAAU,MAAM;AACd,QAAI,eAAe,WAAW,UAAU;AACtC,8BAAwB,eAAe,OAAO;AAAA,IAChD;AAAA,EACF,GAAG,CAAC,UAAU,cAAc,CAAC;AAE7B,SACE,sBAAA;AAAA,IAACA;AAAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,YAAY;AAAA,MACZ,6BAA2B;AAAA,MAC3B,WAAW;AAAA,MACV,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AAEO,MAAM,cAAc,MAAM,WAAW,oBAAoB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MultiSelect.module.scss.cjs.js"),t=require("react"),s=require("react-dom"),r=require("../../../../hooks/useClickOutside.cjs.js"),n=require("../../../../hooks/useDetermineStatusIcon.cjs.js"),l=require("../../../../hooks/useGetDomRoot.cjs.js"),a=require("../../../../readyclasses.module.scss.cjs.js"),o=require("../../../../util/helper.cjs.js"),c=require("../../../Icon/Icon.cjs.js"),i=require("../Select.interfaces.cjs.js"),u=require("../useAddNewBtn.cjs.js"),d=require("../useSelectPositionList.cjs.js"),p=require("./SelectButton.cjs.js"),m=require("./SelectedOptions.cjs.js"),f=require("./useArrowNavigation.cjs.js"),h=require("./useSearch.cjs.js"),v=require("../../../withReadOnly.cjs.js"),b=(e,t)=>`${e}_option${t}`,w=e=>`${e}_listbox`,y=e=>t.Children.toArray(e).reduce((e,s)=>"string"==typeof s||"number"==typeof s?e+s:t.isValidElement(s)&&s.props.children?e+y(s.props.children):e,""),S=(e,t)=>e.filter(e=>"object"==typeof e&&"props"in e&&!t.some(t=>t.value===e.props.value)),C=(e,s)=>t.Children.map(e,(e,r)=>t.cloneElement(e,{onFocusChange:s.onFocusChange,onOptionSelect:s.onOptionSelect,isSearching:!1,selectOpened:s.selectOpened,childIndex:r,hasFocus:s.focusedSelectItem===r,shouldClick:s.shouldClick,id:b(s.multiSelectId,r)})),E=v.withReadOnly(t.forwardRef(({id:v,children:E,name:j,disabled:g=!1,labeledBy:x,placeholder:I,describedBy:R,selectButtonProps:N={},className:O,error:q=!1,success:B=!1,value:k,clearLabel:L="Clear selection",noResultsLabel:P="No results found",onChange:$,addNew:A,search:F={enabled:!0,renderThreshold:0,searchPlaceholder:"Search item"},isReadOnlyView:D,domRoot:z,...M},T)=>{const V=t.useRef(v??o.generateID(20)),[H,G]=t.useState(!1),[_,K]=t.useState([]),U=t.useRef(null),J=t.useRef(null),Q=t.useRef(null),W=t.useRef(null),{root:X}=l.useGetDomRoot(z,U),[Y,Z]=t.useState(0),[ee,te]=t.useState(!1),[se,re]=t.useState(!1),[ne,le]=t.useState(t.Children.count(E)-_.length),{filter:ae,renderSearch:oe,searchInputRef:ce,resetSearchState:ie,searchVisible:ue}=h.useSearch({selectId:V.current,expanded:H,search:F,searchInputClassName:e.default["select-search"],optionsCount:ne,focusedSelectItem:Y,setFocusedSelectItem:Z,describedBy:R,error:q,getOptionId:b,getListboxId:w}),{addBtnRef:de,addNewBtnOptionsContainerClassName:pe,renderAddNew:me}=u.useAddNewBtn({id:b(V.current,ne),addNew:A,filter:ae,focusedSelectItem:Y,optionsCount:ne,searchInputRef:ce,shouldClick:ee,onClickCallback:()=>{te(!1),ie()}}),fe=T||t.createRef(),he=e=>{Z(e)},ve=e=>{(e=>{if("true"!==(null==e?void 0:e.getAttribute("aria-disabled"))){if(fe.current&&e){const t=e.dataset.value,s=[...fe.current.options],r=s.filter(e=>e.selected).map(e=>e.value);s.forEach(e=>{(e.value===t||r.includes(e.value))&&(e.selected=!0)}),fe.current.dispatchEvent(new Event("change",{bubbles:!0}))}G(!1),ie()}})(e.current),G(!1),te(!1)},be=t.useRef(null),we=!!M["data-readonlyview"]||D,{onArrowNavigation:ye}=f.useArrowNavigation({expanded:H,setExpanded:G,setFocusedSelectItem:Z,childrenCount:ne,setShouldClick:te,addBtnRef:de,searchInputRef:ce,customSelectButtonRef:be,focusedOptionId:b(V.current,Y),onClose:ie,isReadOnlyView:we}),{listPosition:Se,opacity:Ce,optionsListMaxHeight:Ee,setListPosition:je,setOpacity:ge}=d.useSelectPositionList({expanded:H,optionListReference:Q,containerReference:J,addBtnRef:de}),xe=n.useDetermineStatusIcon({success:B,error:q});t.useEffect(()=>{H&&ce.current&&(re(!0),ce.current.focus()),!H&&be.current&&se&&(re(!1),be.current.focus())},[H,be.current,se,ce.current]),t.useEffect(()=>{var e;(e=>{const s=t.Children.map(E,e=>e),r=e.map(e=>{const t=s.find(t=>t.props.value===e);return{value:e,label:y(null==t?void 0:t.props.children),fixed:null==t?void 0:t.props.fixed}});K(r)})(k),e=k,fe.current&&[...fe.current.options].forEach(t=>{e.includes(t.value)?t.selected=!0:t.selected=!1})},[k]),r.useClickOutside(U,e=>{var t;H&&((null==(t=W.current)?void 0:t.contains(e.target))||(G(!1),je(i.Position.Below),ge(0)))},[H]);const Ie=[];H&&Ie.push(e.default.expanded),q&&Ie.push(e.default.error),g&&Ie.push(e.default.disabled),O&&Ie.push(O),B&&Ie.push(e.default.success);const Re=()=>{M["data-readonlyview"]||D||(G(e=>!e),te(!1))};t.useEffect(()=>{if(!H)return;const e=J.current,t=W.current;if(!e||!t)return;let s=null;const r=()=>{if(!e||!t)return;const s=e.getBoundingClientRect(),r=s.left,n=Se===i.Position.Below?s.bottom:s.top;t.style.position="fixed",t.style.zIndex="1000",t.style.left="0",t.style.top="0",t.style.width=`${s.width}px`,t.style.transform=`translate3d(${r}px, ${n}px, 0)`},n=()=>{null==s&&(s=globalThis.requestAnimationFrame(()=>{s=null,r()}))};r();const l=()=>n(),a=()=>n();window.addEventListener("scroll",l,{passive:!0,capture:!0}),window.addEventListener("resize",a);const o=new ResizeObserver(()=>{n()});return o.observe(e),()=>{window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",a),o.disconnect(),null!=s&&globalThis.cancelAnimationFrame(s)}},[H,Se]);const Ne=t.createElement("div",{className:`list-wrapper-container ${e.default["list-wrapper-container"]}`},t.createElement("div",{ref:Q,className:`list-wrapper ${e.default["list-wrapper"]}`,style:{display:H?"block":"none",opacity:Ce,maxHeight:Ee.wrapper,pointerEvents:H?"auto":"none",top:Se===i.Position.Below?"4px":void 0,bottom:Se===i.Position.Above?"4px":void 0}},t.createElement("ul",{id:w(V.current),className:pe,role:"listbox","aria-multiselectable":"true",style:{maxHeight:Ee.list}},(()=>{const s={onFocusChange:he,onOptionSelect:ve,selectOpened:H,focusedSelectItem:Y,shouldClick:ee,multiSelectId:V.current};let r;if(""!==ae){const e=t.Children.toArray(E).filter(e=>y(e.props.children).toLowerCase().includes(ae.toLowerCase()));r=C(S(e,_),s)}else r=C(S(t.Children.toArray(E),_),s);return ne!==r.length&&le(r.length),0===r.length?t.createElement("li",{className:e.default["no-results"]},P):r})()),me()));return t.createElement(t.Fragment,null,t.createElement("div",{ref:U},t.createElement("select",{...o.omitProps(M,/^data-/),tabIndex:-1,multiple:!0,"aria-hidden":"true",ref:fe,name:j,onChange:e=>{null==$||$(e)},className:a.default["sr-only"]},t.createElement("option",{value:""}),t.Children.map(E,e=>t.createElement("option",{value:e.props.value}))),t.createElement("div",{...o.pickProps(M,/^data-/),id:V.current,ref:J,onKeyDown:ye,className:`custom-select ${e.default.select} ${Ie.join(" ")}`},t.createElement("div",{className:`${e.default["custom-select"]} ${Ie.join(" ")} `,style:{display:"flex"}},t.createElement("div",{className:e.default["display-container"],"data-display":!0},t.createElement(p.SelectButton,{...N,onClick:Re,name:j,ref:be,disabled:g,"aria-disabled":g,role:"combobox","aria-invalid":q,"aria-expanded":H,"aria-controls":w(V.current),"aria-haspopup":"listbox","aria-labelledby":x,"aria-describedby":R}),0===(null==k?void 0:k.length)&&I&&t.createElement("span",{className:e.default.placeholder},I),(null==k?void 0:k.length)>0&&t.createElement(m.SelectedOptions,{disabled:g,display:_,onClick:Re,onRemove:e=>{fe.current&&([...fe.current.options].find(t=>t.value===e).selected=!1,fe.current.dispatchEvent(new Event("change",{bubbles:!0})))}}),ue&&oe()),t.createElement("div",{className:e.default.status},xe||(H?t.createElement(c.Icon,{className:e.default["chevron-icon"],icon:c.Icons.ChevronUp}):t.createElement(c.Icon,{className:e.default["chevron-icon"],icon:c.Icons.ChevronDown})))))),s.createPortal(t.createElement("div",{ref:W,className:`${e.default.select} ${Ie.join(" ")}`},Ne),X))}));exports.MultiSelect=E;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MultiSelect.module.scss.cjs.js"),t=require("react"),r=require("react-dom"),n=require("../../../../hooks/useClickOutside.cjs.js"),l=require("../../../../hooks/useDetermineStatusIcon.cjs.js"),s=require("../../../../hooks/useGetDomRoot.cjs.js"),a=require("../../../../readyclasses.module.scss.cjs.js"),o=require("../../../../util/helper.cjs.js"),c=require("../../../Icon/Icon.cjs.js"),i=require("../../../Spinner/Spinner.cjs.js"),u=require("../Select.interfaces.cjs.js"),d=require("../useAddNewBtn.cjs.js"),p=require("../useSelectPositionList.cjs.js"),m=require("./SelectButton.cjs.js"),f=require("./SelectedOptions.cjs.js"),h=require("./useArrowNavigation.cjs.js"),v=require("./useSearch.cjs.js"),y=require("../../../withReadOnly.cjs.js"),b=(e,t)=>`${e}_option${t}`,E=e=>`${e}_listbox`,g=e=>t.Children.toArray(e).reduce((e,r)=>"string"==typeof r||"number"==typeof r?e+r:t.isValidElement(r)&&r.props.children?e+g(r.props.children):e,""),S=(e,t)=>e.filter(e=>"object"==typeof e&&"props"in e&&!t.some(t=>t.value===e.props.value)),w=(e,r)=>t.Children.map(e,(e,n)=>t.cloneElement(e,{onFocusChange:r.onFocusChange,onOptionSelect:r.onOptionSelect,isSearching:!1,selectOpened:r.selectOpened,childIndex:n,hasFocus:r.focusedSelectItem===n,shouldClick:r.shouldClick,id:b(r.multiSelectId,n)})),C=y.withReadOnly(t.forwardRef(({id:y,children:C,name:R,disabled:N=!1,labeledBy:j,placeholder:I,describedBy:x,selectButtonProps:L={},className:O,error:k=!1,success:q=!1,value:A,clearLabel:B="Clear selection",noResultsLabel:P="No results found",onChange:$,addNew:F,search:D={enabled:!0,renderThreshold:0},isReadOnlyView:M,domRoot:z,selectedOptions:T,..._},V)=>{var H,G,K,U;const J=t.useRef(y??o.generateID(20)),[Q,W]=t.useState(!1),[X,Y]=t.useState([]),Z=t.useRef(null),ee=t.useRef(null),te=t.useRef(null),re=t.useRef(null),ne=t.useRef(null),le=t.useRef(null),se=t.useRef(!1),ae=t.useRef(!1),{root:oe}=s.useGetDomRoot(z,Z),[ce,ie]=t.useState(0),[ue,de]=t.useState(!1),[pe,me]=t.useState(!1),[fe,he]=t.useState(t.Children.count(C)-X.length),{filter:ve,renderSearch:ye,searchInputRef:be,resetSearchState:Ee,searchVisible:ge,isAsync:Se,isAsyncPending:we,asyncMinSearchLength:Ce}=v.useSearch({selectId:J.current,expanded:Q,search:D,searchInputClassName:e.default["select-search"],optionsCount:fe,focusedSelectItem:ce,setFocusedSelectItem:ie,describedBy:x,error:k,getOptionId:b,getListboxId:E,placeholder:I}),{addBtnRef:Re,addNewBtnOptionsContainerClassName:Ne,renderAddNew:je}=d.useAddNewBtn({id:b(J.current,fe),addNew:F,filter:ve,focusedSelectItem:ce,optionsCount:fe,searchInputRef:be,shouldClick:ue,onClickCallback:()=>{de(!1),Ee()}}),Ie=V||t.createRef(),xe=e=>{ie(e)},Le=e=>{(e=>{var t;if("true"!==(null==e?void 0:e.getAttribute("aria-disabled"))){if(Ie.current&&e){const t=e.dataset.value,r=[...Ie.current.options],n=r.filter(e=>e.selected).map(e=>e.value);r.forEach(e=>{(e.value===t||n.includes(e.value))&&(e.selected=!0)}),Ie.current.dispatchEvent(new Event("change",{bubbles:!0}))}if(Se)return Ee(),void(null==(t=be.current)||t.focus());W(!1),Ee()}})(e.current),de(!1),Se||W(!1)},Oe=t.useRef(null),ke=!!_["data-readonlyview"]||M,{onArrowNavigation:qe}=h.useArrowNavigation({expanded:Q,setExpanded:W,setFocusedSelectItem:ie,childrenCount:fe,setShouldClick:de,addBtnRef:Re,searchInputRef:be,customSelectButtonRef:Oe,focusedOptionId:b(J.current,ce),onClose:Ee,isReadOnlyView:ke,listRef:ne,isAsync:Se}),{listPosition:Ae,opacity:Be,optionsListMaxHeight:Pe,setListPosition:$e,setOpacity:Fe}=p.useSelectPositionList({expanded:Q,optionListReference:te,containerReference:ee,addBtnRef:Re}),De=!!(null==(H=null==D?void 0:D.async)?void 0:H.loading)||we;ae.current=De;const Me=null==(G=null==D?void 0:D.async)?void 0:G.onLoadMore,ze=Se&&!!Me,Te=Se&&Ce>0&&0===ve.length,_e=S(t.Children.toArray(C),X).length,Ve=ze&&!!(null==(K=null==D?void 0:D.async)?void 0:K.hasMore)&&!(null==(U=null==D?void 0:D.async)?void 0:U.errorLabel)&&ve.length>=Ce&&_e>0,He=e=>{fe!==e&&he(e)},Ge=l.useDetermineStatusIcon({success:q,error:k});t.useEffect(()=>{Q&&be.current&&(me(!0),be.current.focus()),!Q&&Oe.current&&pe&&(me(!1),Oe.current.focus())},[Q,Oe.current,pe,be.current]),t.useEffect(()=>{(e=>{const r=t.Children.map(C,e=>e),n=e.map(e=>{const t=r.find(t=>t.props.value===e);if(t)return{value:e,label:t.props.children,fixed:t.props.fixed};const n=null==T?void 0:T.find(t=>t.value===e);return{value:e,label:(null==n?void 0:n.label)??"",fixed:void 0}});Y(n)})(A)},[A,C,T]),t.useEffect(()=>{var e;e=A,Ie.current&&[...Ie.current.options].forEach(t=>{e.includes(t.value)?t.selected=!0:t.selected=!1})},[A,C]),t.useEffect(()=>{if(!Ve||!Q)return void(se.current=!1);const e=le.current;if(!e||"undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver(([e])=>{e.isIntersecting?se.current||ae.current||(se.current=!0,null==Me||Me()):se.current=!1},{root:ne.current,threshold:0});return t.observe(e),()=>t.disconnect()},[Ve,Q,Me]),n.useClickOutside(Z,e=>{Q&&(re.current&&e.composedPath().includes(re.current)||(W(!1),$e(u.Position.Below),Fe(0)))},[Q]);const Ke=o.classNames(O,{[e.default.expanded]:Q,[e.default.error]:k,[e.default.disabled]:N,[e.default.success]:q}),Ue=()=>{_["data-readonlyview"]||M||(W(e=>!e),de(!1))};t.useEffect(()=>{if(!Q)return;const e=ee.current,t=re.current;if(!e||!t)return;let r=null;const n=()=>{if(!e||!t)return;const r=e.getBoundingClientRect(),n=r.left,l=Ae===u.Position.Below?r.bottom:r.top;t.style.position="fixed",t.style.zIndex="1000",t.style.left="0",t.style.top="0",t.style.width=`${r.width}px`,t.style.transform=`translate3d(${n}px, ${l}px, 0)`},l=()=>{null==r&&(r=globalThis.requestAnimationFrame(()=>{r=null,n()}))};n();const s=()=>l(),a=()=>l();window.addEventListener("scroll",s,{passive:!0,capture:!0}),window.addEventListener("resize",a);const o=new ResizeObserver(()=>{l()});return o.observe(e),()=>{window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",a),o.disconnect(),null!=r&&globalThis.cancelAnimationFrame(r)}},[Q,Ae]);const Je=t.createElement("div",{className:`list-wrapper-container ${e.default["list-wrapper-container"]}`},t.createElement("div",{ref:te,className:`list-wrapper ${e.default["list-wrapper"]}`,style:{display:Q&&!Te?"block":"none",opacity:Be,maxHeight:Pe.wrapper,pointerEvents:Q?"auto":"none",top:Ae===u.Position.Below?"4px":void 0,bottom:Ae===u.Position.Above?"4px":void 0}},t.createElement("ul",{ref:ne,id:E(J.current),className:Ne,role:"listbox","aria-multiselectable":"true",style:{maxHeight:Pe.list},"aria-busy":Se?De:void 0},(()=>{const r={onFocusChange:xe,onOptionSelect:Le,selectOpened:Q,focusedSelectItem:ce,shouldClick:ue,multiSelectId:J.current};return Se?(r=>{const n=null==D?void 0:D.async;if(ve.length<Ce)return He(0),t.createElement("li",{className:e.default["async-status"]},(null==n?void 0:n.idleLabel)??"Type to search");if(null==n?void 0:n.errorLabel)return He(0),t.createElement("li",{className:e.default["async-status"]},n.errorLabel,n.onRetry&&t.createElement("button",{type:"button",className:e.default["retry-button"],onClick:n.onRetry},"Retry"));const l=S(t.Children.toArray(C),X);return De?ze&&l.length>0?(He(l.length),[...w(l,r),t.createElement("li",{key:"__multiselect-load-more-status__","data-testid":"multiselect-load-more-status",className:e.default["async-status"]},t.createElement(i.Spinner,{size:16}))]):(He(0),t.createElement("li",{className:e.default["async-status"]},t.createElement(i.Spinner,{size:20}))):(He(l.length),0===l.length?t.createElement("li",{className:e.default["no-results"]},P):w(l,r))})(r):(r=>{let n;if(""!==ve){const e=t.Children.toArray(C).filter(e=>g(e.props.children).toLowerCase().includes(ve.toLowerCase()));n=w(S(e,X),r)}else n=w(S(t.Children.toArray(C),X),r);return He(n.length),0===n.length?t.createElement("li",{className:e.default["no-results"]},P):n})(r)})(),Ve&&t.createElement("li",{ref:le,"aria-hidden":"true","data-testid":"multiselect-load-more-sentinel",className:e.default["load-more-sentinel"]})),Se&&t.createElement("output",{"aria-live":"polite",className:a.default["sr-only"]},(()=>{const e=null==D?void 0:D.async;return e?ve.length<Ce?e.idleLabel??"Type to search":e.errorLabel?e.errorLabel:De?"Loading":0===_e?P:`${_e} results`:""})()),je()));return t.createElement(t.Fragment,null,t.createElement("div",{ref:Z},t.createElement("select",{...o.omitProps(_,/^data-/),tabIndex:-1,multiple:!0,"aria-hidden":"true",ref:Ie,name:R,onChange:e=>{null==$||$(e)},className:a.default["sr-only"]},t.createElement("option",{value:""}),null==A?void 0:A.filter(e=>!t.Children.toArray(C).some(t=>t.props.value===e)).map(e=>t.createElement("option",{key:e,value:e})),t.Children.map(C,e=>t.createElement("option",{value:e.props.value}))),t.createElement("div",{...o.pickProps(_,/^data-/),id:J.current,ref:ee,onKeyDown:qe,className:`custom-select ${e.default.select} ${Ke}`},t.createElement("div",{className:`${e.default["custom-select"]} ${Ke} `,style:{display:"flex"}},t.createElement("div",{className:e.default["display-container"],"data-display":!0},t.createElement(m.SelectButton,{...L,onClick:Ue,name:R,ref:Oe,disabled:N,"aria-disabled":N,role:"combobox","aria-invalid":k,"aria-expanded":Q,"aria-controls":E(J.current),"aria-haspopup":"listbox","aria-labelledby":j,"aria-describedby":x}),0===(null==A?void 0:A.length)&&I&&t.createElement("span",{className:e.default.placeholder},I),(null==A?void 0:A.length)>0&&t.createElement(f.SelectedOptions,{disabled:N,display:X,onClick:Ue,onRemove:e=>{Ie.current&&([...Ie.current.options].find(t=>t.value===e).selected=!1,Ie.current.dispatchEvent(new Event("change",{bubbles:!0})))}}),ge&&ye()),t.createElement("div",{className:e.default.status},Ge||(Q?t.createElement(c.Icon,{className:e.default["chevron-icon"],icon:c.Icons.ChevronUp}):t.createElement(c.Icon,{className:e.default["chevron-icon"],icon:c.Icons.ChevronDown})))))),r.createPortal(t.createElement("div",{ref:re,className:`${e.default.select} ${Ke}`},Je),oe))}));exports.MultiSelect=C;
|
|
2
2
|
//# sourceMappingURL=MultiSelect.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.cjs.js","sources":["../../../../../src/components/Form/Select/MultiSelect/MultiSelect.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 classes from \"./MultiSelect.module.scss\";\n\nimport React, {\n ForwardRefRenderFunction,\n ReactElement,\n createRef,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useClickOutside } from \"../../../../hooks/useClickOutside\";\nimport { useDetermineStatusIcon } from \"../../../../hooks/useDetermineStatusIcon\";\nimport { useGetDomRoot } from \"../../../../hooks/useGetDomRoot\";\nimport readyclasses from \"../../../../readyclasses.module.scss\";\nimport { generateID, omitProps, pickProps } from \"../../../../util/helper\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { MultiSelectProps, OptionElementProps, Position } from \"../Select.interfaces\";\nimport { useAddNewBtn } from \"../useAddNewBtn\";\nimport { useSelectPositionList } from \"../useSelectPositionList\";\nimport { SelectButton } from \"./SelectButton\";\nimport { Display, SelectedOptions } from \"./SelectedOptions\";\nimport { useArrowNavigation } from \"./useArrowNavigation\";\nimport { useSearch } from \"./useSearch\";\nimport { withReadOnly } from \"../../../withReadOnly\";\n\nconst getOptionId = (multiSelectId: string, optionIndex: number) =>\n `${multiSelectId}_option${optionIndex}`;\n\nconst getListboxId = (multiSelectId: string) => `${multiSelectId}_listbox`;\n\nconst extractTextFromChildren = (children: React.ReactNode): string => {\n return React.Children.toArray(children).reduce((text: string, child) => {\n if (typeof child === \"string\" || typeof child === \"number\") {\n return text + child;\n }\n if (React.isValidElement<{ children?: React.ReactNode }>(child) && child.props.children) {\n return text + extractTextFromChildren(child.props.children);\n }\n return text;\n }, \"\");\n};\n\ntype ReactChildrenType = ReturnType<typeof React.Children.toArray>;\n\ninterface OptionRenderProps {\n onFocusChange: (childIndex: number) => void;\n onOptionSelect: (optionRef: React.RefObject<HTMLLIElement | null>) => void;\n selectOpened: boolean;\n focusedSelectItem: number;\n shouldClick: boolean;\n multiSelectId: string;\n}\n\nconst filterOutSelectedChildren = (internalChildren: ReactChildrenType, display: Display[]) => {\n return internalChildren.filter(\n child =>\n typeof child === \"object\" &&\n \"props\" in child &&\n !display.some(\n option => option.value === (child as ReactElement<OptionElementProps>).props.value\n )\n );\n};\n\nconst renderChildOptions = (\n internalChildren: ReactChildrenType,\n optionProps: OptionRenderProps\n) => {\n return React.Children.map(internalChildren, (child, index) => {\n return React.cloneElement(child as ReactElement<OptionElementProps>, {\n onFocusChange: optionProps.onFocusChange,\n onOptionSelect: optionProps.onOptionSelect,\n isSearching: false,\n selectOpened: optionProps.selectOpened,\n childIndex: index,\n hasFocus: optionProps.focusedSelectItem === index,\n shouldClick: optionProps.shouldClick,\n id: getOptionId(optionProps.multiSelectId, index)\n });\n });\n};\n\nconst MultiSelectComponent: ForwardRefRenderFunction<HTMLSelectElement, MultiSelectProps> = (\n {\n id,\n children,\n name,\n disabled = false,\n labeledBy,\n placeholder,\n describedBy,\n selectButtonProps = {},\n className,\n error = false,\n success = false,\n value,\n clearLabel = \"Clear selection\",\n noResultsLabel = \"No results found\",\n onChange,\n addNew,\n search = { enabled: true, renderThreshold: 0, searchPlaceholder: \"Search item\" },\n isReadOnlyView,\n domRoot,\n ...rest\n }: MultiSelectProps,\n ref\n) => {\n const multiSelectId = useRef(id ?? generateID(20));\n const [expanded, setExpanded] = useState(false);\n const [display, setDisplay] = useState<Display[]>([]);\n const myElementRef = useRef<HTMLDivElement>(null);\n const containerReference = useRef<HTMLDivElement>(null);\n const optionListReference = useRef<HTMLDivElement>(null);\n const portalRef = useRef<HTMLDivElement>(null);\n const { root } = useGetDomRoot(domRoot, myElementRef);\n const [focusedSelectItem, setFocusedSelectItem] = useState(0);\n const [shouldClick, setShouldClick] =\n useState(\n false\n ); /** We need this, because whenever we use the arrow keys to select the select item, and we focus the currently selected item it fires the \"click\" listener in Option component. Instead, we only want this to fire if we press \"enter\" or \"spacebar\" so we set this to true whenever that is the case, and back to false when it has been executed. */\n const [shouldFocusButtonAfterClose, setShouldFocusButtonAfterClose] = useState(false);\n const [optionsVisibleCount, setOptionsVisibleCount] = useState(\n React.Children.count(children) - display.length\n );\n const { filter, renderSearch, searchInputRef, resetSearchState, searchVisible } = useSearch({\n selectId: multiSelectId.current,\n expanded,\n search,\n searchInputClassName: classes[\"select-search\"],\n optionsCount: optionsVisibleCount,\n focusedSelectItem,\n setFocusedSelectItem,\n describedBy,\n error,\n getOptionId,\n getListboxId\n });\n const { addBtnRef, addNewBtnOptionsContainerClassName, renderAddNew } = useAddNewBtn({\n id: getOptionId(multiSelectId.current, optionsVisibleCount),\n addNew,\n filter,\n focusedSelectItem,\n optionsCount: optionsVisibleCount,\n searchInputRef,\n shouldClick,\n onClickCallback: () => {\n setShouldClick(false);\n resetSearchState();\n }\n });\n\n const nativeSelect = (ref as React.RefObject<HTMLSelectElement | null>) || createRef();\n\n const onOptionChangeHandler = (optionElement: HTMLElement | null) => {\n if (optionElement?.getAttribute(\"aria-disabled\") === \"true\") {\n return;\n }\n\n if (nativeSelect.current && optionElement) {\n const value = optionElement.dataset.value!;\n const options = [...nativeSelect.current.options];\n const lastSelectedOptionValues = options\n .filter(option => option.selected)\n .map(option => option.value);\n options.forEach(option => {\n if (option.value === value || lastSelectedOptionValues.includes(option.value)) {\n option.selected = true;\n }\n });\n nativeSelect.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n setExpanded(false);\n resetSearchState();\n };\n\n const handleOptionFocusChange = (childIndex: number) => {\n setFocusedSelectItem(childIndex);\n };\n\n const handleOptionSelect = (optionRef: React.RefObject<HTMLLIElement | null>) => {\n onOptionChangeHandler(optionRef.current);\n setExpanded(false);\n setShouldClick(false);\n };\n\n const onSelectedOptionRemoveHandler = (value: string) => {\n if (nativeSelect.current) {\n const options = [...nativeSelect.current.options];\n options.find(option => option.value === value)!.selected = false;\n nativeSelect.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n };\n\n const customSelectButtonRef = useRef<HTMLButtonElement>(null);\n const readOnlyView = !!rest[\"data-readonlyview\"] || isReadOnlyView;\n const { onArrowNavigation } = useArrowNavigation({\n expanded,\n setExpanded,\n setFocusedSelectItem,\n childrenCount: optionsVisibleCount,\n setShouldClick,\n addBtnRef,\n searchInputRef,\n customSelectButtonRef,\n focusedOptionId: getOptionId(multiSelectId.current, focusedSelectItem),\n onClose: resetSearchState,\n isReadOnlyView: readOnlyView\n });\n\n const { listPosition, opacity, optionsListMaxHeight, setListPosition, setOpacity } =\n useSelectPositionList({ expanded, optionListReference, containerReference, addBtnRef });\n\n const syncDisplayValue = (values: string[]) => {\n const options = React.Children.map(children, child => child);\n const displayArray: Display[] = values.map(value => {\n const option = options.find(option => option.props.value === value);\n // Tag (used to render a selected option) types its children as `string` because it reuses\n // them as the remove button's accessible label, so flatten the Option's children to text.\n return {\n value,\n label: extractTextFromChildren(option?.props.children),\n fixed: option?.props.fixed\n };\n });\n setDisplay(displayArray);\n };\n\n const syncSelectedOption = (vals: string[]) => {\n if (nativeSelect.current) {\n const options = [...nativeSelect.current.options];\n options.forEach(option => {\n if (vals.includes(option.value)) {\n option.selected = true;\n } else {\n option.selected = false;\n }\n });\n }\n };\n\n /**\n * @description We have to modify the children (Option component) to have a additional props that allows us to keep track of which one is selected and focused at all times and if a filter is active.\n * The `children` prop can be either a single object (1 child) or an array of multiple children.\n */\n const renderOptions = () => {\n const optionProps: OptionRenderProps = {\n onFocusChange: handleOptionFocusChange,\n onOptionSelect: handleOptionSelect,\n selectOpened: expanded,\n focusedSelectItem,\n shouldClick,\n multiSelectId: multiSelectId.current\n };\n\n let results;\n if (filter !== \"\") {\n const filteredChildren = React.Children.toArray(children).filter(child => {\n const childElement = child as ReactElement<OptionElementProps>;\n const childText = extractTextFromChildren(childElement.props.children);\n return childText.toLowerCase().includes(filter.toLowerCase());\n });\n\n results = renderChildOptions(\n filterOutSelectedChildren(filteredChildren, display),\n optionProps\n );\n } else {\n results = renderChildOptions(\n filterOutSelectedChildren(React.Children.toArray(children), display),\n optionProps\n );\n }\n\n optionsVisibleCount !== results.length && setOptionsVisibleCount(results.length);\n\n if (results.length === 0) {\n return <li className={classes[\"no-results\"]}>{noResultsLabel}</li>;\n }\n\n return results;\n };\n\n const renderChevronIcon = () => {\n return expanded ? (\n <Icon className={classes[\"chevron-icon\"]} icon={Icons.ChevronUp} />\n ) : (\n <Icon className={classes[\"chevron-icon\"]} icon={Icons.ChevronDown} />\n );\n };\n\n const icon = useDetermineStatusIcon({ success, error });\n\n const nativeOnChangeHandler = (event: React.ChangeEvent<HTMLSelectElement>) => {\n onChange?.(event);\n };\n\n useEffect(() => {\n if (expanded && searchInputRef.current) {\n setShouldFocusButtonAfterClose(true);\n searchInputRef.current.focus();\n }\n\n if (!expanded && customSelectButtonRef.current && shouldFocusButtonAfterClose) {\n setShouldFocusButtonAfterClose(false);\n customSelectButtonRef.current.focus();\n }\n }, [\n expanded,\n customSelectButtonRef.current,\n shouldFocusButtonAfterClose,\n searchInputRef.current\n ]);\n\n useEffect(() => {\n syncDisplayValue(value);\n syncSelectedOption(value);\n }, [value]);\n\n useClickOutside(\n myElementRef,\n event => {\n if (!expanded) {\n return;\n }\n if (portalRef.current?.contains(event.target as Node)) {\n return;\n }\n setExpanded(false);\n setListPosition(Position.Below);\n setOpacity(0);\n },\n [expanded]\n );\n\n const additionalClasses = [];\n expanded && additionalClasses.push(classes.expanded);\n error && additionalClasses.push(classes.error);\n disabled && additionalClasses.push(classes.disabled);\n className && additionalClasses.push(className);\n success && additionalClasses.push(classes.success);\n\n const onSelectButtonClick = () => {\n if (rest[\"data-readonlyview\"] || isReadOnlyView) {\n return;\n }\n setExpanded(expanded => !expanded);\n setShouldClick(false);\n };\n\n useEffect(() => {\n if (!expanded) {\n return;\n }\n\n const anchor = containerReference.current;\n const portal = portalRef.current;\n\n if (!anchor || !portal) {\n return;\n }\n\n let frameId: number | null = null;\n\n const updatePosition = () => {\n if (!anchor || !portal) {\n return;\n }\n\n const rect = anchor.getBoundingClientRect();\n const x = rect.left;\n const y = listPosition === Position.Below ? rect.bottom : rect.top;\n\n portal.style.position = \"fixed\";\n portal.style.zIndex = \"1000\";\n portal.style.left = \"0\";\n portal.style.top = \"0\";\n portal.style.width = `${rect.width}px`;\n portal.style.transform = `translate3d(${x}px, ${y}px, 0)`;\n };\n\n const scheduleUpdate = () => {\n if (frameId != null) {\n return;\n }\n frameId = globalThis.requestAnimationFrame(() => {\n frameId = null;\n updatePosition();\n });\n };\n\n updatePosition();\n\n const handleScroll = () => scheduleUpdate();\n const handleResize = () => scheduleUpdate();\n\n window.addEventListener(\"scroll\", handleScroll, { passive: true, capture: true });\n window.addEventListener(\"resize\", handleResize);\n\n const resizeObserver = new ResizeObserver(() => {\n scheduleUpdate();\n });\n resizeObserver.observe(anchor);\n\n return () => {\n window.removeEventListener(\"scroll\", handleScroll, true);\n window.removeEventListener(\"resize\", handleResize);\n resizeObserver.disconnect();\n if (frameId != null) {\n globalThis.cancelAnimationFrame(frameId);\n }\n };\n }, [expanded, listPosition]);\n\n const optionsElement = (\n <div className={`list-wrapper-container ${classes[\"list-wrapper-container\"]}`}>\n <div\n ref={optionListReference}\n className={`list-wrapper ${classes[\"list-wrapper\"]}`}\n style={{\n display: expanded ? \"block\" : \"none\",\n opacity: opacity,\n maxHeight: optionsListMaxHeight.wrapper,\n pointerEvents: expanded ? \"auto\" : \"none\",\n top: listPosition === Position.Below ? \"4px\" : undefined,\n bottom: listPosition === Position.Above ? \"4px\" : undefined\n }}\n >\n <ul // NOSONAR(S6819) native <select multiple> can't host search, add-new or custom option markup\n id={getListboxId(multiSelectId.current)}\n className={addNewBtnOptionsContainerClassName}\n role=\"listbox\" // NOSONAR(S6842) required by ARIA listbox pattern; hosts aria-multiselectable\n aria-multiselectable=\"true\"\n style={{ maxHeight: optionsListMaxHeight.list }}\n >\n {renderOptions()}\n </ul>\n {renderAddNew()}\n </div>\n </div>\n );\n\n /** The native select is purely for external form libraries. We use it to emit an onChange with native select event object so they know exactly what's happening. */\n return (\n <>\n <div ref={myElementRef}>\n <select\n {...omitProps(rest, /^data-/)}\n tabIndex={-1}\n multiple={true}\n aria-hidden=\"true\"\n ref={nativeSelect}\n name={name}\n onChange={nativeOnChangeHandler}\n className={readyclasses[\"sr-only\"]}\n >\n <option value=\"\"></option>\n {React.Children.map(children, child => (\n <option value={child.props.value}></option>\n ))}\n </select>\n <div // NOSONAR(S6848) event-delegation wrapper; keys bubble from focusable SelectButton/options, adding role/tabIndex would create a spurious tab stop\n {...pickProps(rest, /^data-/)}\n id={multiSelectId.current}\n ref={containerReference}\n onKeyDown={onArrowNavigation}\n className={`custom-select ${classes.select} ${additionalClasses.join(\" \")}`}\n >\n <div\n className={`${classes[\"custom-select\"]} ${additionalClasses.join(\" \")} `}\n style={{ display: \"flex\" }}\n >\n <div className={classes[\"display-container\"]} data-display>\n <SelectButton // NOSONAR(S6819) no semantic equivalent: <select multiple> can't host the search input, add-new button, selected-option tags or status icon. role=\"combobox\" follows the ARIA APG select-only combobox pattern and is what allows aria-invalid here.\n {...selectButtonProps}\n onClick={onSelectButtonClick}\n name={name}\n ref={customSelectButtonRef}\n disabled={disabled}\n aria-disabled={disabled}\n role=\"combobox\"\n aria-invalid={error}\n aria-expanded={expanded}\n aria-controls={getListboxId(multiSelectId.current)}\n aria-haspopup=\"listbox\"\n aria-labelledby={labeledBy}\n aria-describedby={describedBy}\n />\n {value?.length === 0 && placeholder && (\n <span className={classes[\"placeholder\"]}>{placeholder}</span>\n )}\n {value?.length > 0 && (\n <SelectedOptions\n disabled={disabled}\n display={display}\n onClick={onSelectButtonClick}\n onRemove={onSelectedOptionRemoveHandler}\n />\n )}\n {searchVisible && renderSearch()}\n </div>\n <div className={classes[\"status\"]}>{icon || renderChevronIcon()}</div>\n </div>\n </div>\n </div>\n {createPortal(\n <div ref={portalRef} className={`${classes.select} ${additionalClasses.join(\" \")}`}>\n {optionsElement}\n </div>,\n root\n )}\n </>\n );\n};\n\nexport const MultiSelect = withReadOnly(React.forwardRef(MultiSelectComponent));\n"],"names":["getOptionId","multiSelectId","optionIndex","getListboxId","extractTextFromChildren","children","React","Children","toArray","reduce","text","child","isValidElement","props","filterOutSelectedChildren","internalChildren","display","filter","some","option","value","renderChildOptions","optionProps","map","index","cloneElement","onFocusChange","onOptionSelect","isSearching","selectOpened","childIndex","hasFocus","focusedSelectItem","shouldClick","id","MultiSelect","withReadOnly","forwardRef","name","disabled","labeledBy","placeholder","describedBy","selectButtonProps","className","error","success","clearLabel","noResultsLabel","onChange","addNew","search","enabled","renderThreshold","searchPlaceholder","isReadOnlyView","domRoot","rest","ref","useRef","generateID","expanded","setExpanded","useState","setDisplay","myElementRef","containerReference","optionListReference","portalRef","root","useGetDomRoot","setFocusedSelectItem","setShouldClick","shouldFocusButtonAfterClose","setShouldFocusButtonAfterClose","optionsVisibleCount","setOptionsVisibleCount","count","length","renderSearch","searchInputRef","resetSearchState","searchVisible","useSearch","selectId","current","searchInputClassName","classes","optionsCount","addBtnRef","addNewBtnOptionsContainerClassName","renderAddNew","useAddNewBtn","onClickCallback","nativeSelect","createRef","handleOptionFocusChange","handleOptionSelect","optionRef","optionElement","getAttribute","dataset","options","lastSelectedOptionValues","selected","forEach","includes","dispatchEvent","Event","bubbles","onOptionChangeHandler","customSelectButtonRef","readOnlyView","onArrowNavigation","useArrowNavigation","childrenCount","focusedOptionId","onClose","listPosition","opacity","optionsListMaxHeight","setListPosition","setOpacity","useSelectPositionList","icon","useDetermineStatusIcon","useEffect","focus","vals","values","displayArray","find","label","fixed","syncDisplayValue","useClickOutside","event","_a","contains","target","Position","Below","additionalClasses","push","onSelectButtonClick","anchor","portal","frameId","updatePosition","rect","getBoundingClientRect","x","left","y","bottom","top","style","position","zIndex","width","transform","scheduleUpdate","globalThis","requestAnimationFrame","handleScroll","handleResize","window","addEventListener","passive","capture","resizeObserver","ResizeObserver","observe","removeEventListener","disconnect","cancelAnimationFrame","optionsElement","createElement","maxHeight","wrapper","pointerEvents","Above","role","list","results","filteredChildren","toLowerCase","renderOptions","Fragment","omitProps","tabIndex","multiple","readyclasses","pickProps","onKeyDown","select","join","SelectButton","onClick","SelectedOptions","onRemove","Icon","Icons","ChevronUp","ChevronDown","createPortal"],"mappings":"uxBA0CMA,EAAc,CAACC,EAAuBC,IAC1C,GAAGD,WAAuBC,IAEtBC,EAAgBF,GAA0B,GAAGA,YAE7CG,EAA2BC,GACxBC,EAAMC,SAASC,QAAQH,GAAUI,OAAO,CAACC,EAAcC,IACvC,iBAAVA,GAAuC,iBAAVA,EAC/BD,EAAOC,EAEZL,EAAMM,eAA+CD,IAAUA,EAAME,MAAMR,SACtEK,EAAON,EAAwBO,EAAME,MAAMR,UAE7CK,EACN,IAcCI,EAA4B,CAACC,EAAqCC,IAC/DD,EAAiBE,UAEH,iBAAVN,GACP,UAAWA,IACVK,EAAQE,KACPC,GAAUA,EAAOC,QAAWT,EAA2CE,MAAMO,QAK/EC,EAAqB,CACzBN,EACAO,IAEOhB,EAAMC,SAASgB,IAAIR,EAAkB,CAACJ,EAAOa,IAC3ClB,EAAMmB,aAAad,EAA2C,CACnEe,cAAeJ,EAAYI,cAC3BC,eAAgBL,EAAYK,eAC5BC,aAAa,EACbC,aAAcP,EAAYO,aAC1BC,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/components/Form/Select/MultiSelect/MultiSelect.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 classes from \"./MultiSelect.module.scss\";\n\nimport React, {\n ForwardRefRenderFunction,\n ReactElement,\n createRef,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useClickOutside } from \"../../../../hooks/useClickOutside\";\nimport { useDetermineStatusIcon } from \"../../../../hooks/useDetermineStatusIcon\";\nimport { useGetDomRoot } from \"../../../../hooks/useGetDomRoot\";\nimport readyclasses from \"../../../../readyclasses.module.scss\";\nimport { classNames, generateID, omitProps, pickProps } from \"../../../../util/helper\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { Spinner } from \"../../../Spinner/Spinner\";\nimport { MultiSelectProps, OptionElementProps, Position } from \"../Select.interfaces\";\nimport { useAddNewBtn } from \"../useAddNewBtn\";\nimport { useSelectPositionList } from \"../useSelectPositionList\";\nimport { SelectButton } from \"./SelectButton\";\nimport { Display, SelectedOptions } from \"./SelectedOptions\";\nimport { useArrowNavigation } from \"./useArrowNavigation\";\nimport { useSearch } from \"./useSearch\";\nimport { withReadOnly } from \"../../../withReadOnly\";\n\nconst getOptionId = (multiSelectId: string, optionIndex: number) =>\n `${multiSelectId}_option${optionIndex}`;\n\nconst getListboxId = (multiSelectId: string) => `${multiSelectId}_listbox`;\n\nconst extractTextFromChildren = (children: React.ReactNode): string => {\n return React.Children.toArray(children).reduce((text: string, child) => {\n if (typeof child === \"string\" || typeof child === \"number\") {\n return text + child;\n }\n if (React.isValidElement<{ children?: React.ReactNode }>(child) && child.props.children) {\n return text + extractTextFromChildren(child.props.children);\n }\n return text;\n }, \"\");\n};\n\ntype ReactChildrenType = ReturnType<typeof React.Children.toArray>;\n\ninterface OptionRenderProps {\n onFocusChange: (childIndex: number) => void;\n onOptionSelect: (optionRef: React.RefObject<HTMLLIElement | null>) => void;\n selectOpened: boolean;\n focusedSelectItem: number;\n shouldClick: boolean;\n multiSelectId: string;\n}\n\nconst filterOutSelectedChildren = (internalChildren: ReactChildrenType, display: Display[]) => {\n return internalChildren.filter(\n child =>\n typeof child === \"object\" &&\n \"props\" in child &&\n !display.some(\n option => option.value === (child as ReactElement<OptionElementProps>).props.value\n )\n );\n};\n\nconst renderChildOptions = (\n internalChildren: ReactChildrenType,\n optionProps: OptionRenderProps\n) => {\n return React.Children.map(internalChildren, (child, index) => {\n return React.cloneElement(child as ReactElement<OptionElementProps>, {\n onFocusChange: optionProps.onFocusChange,\n onOptionSelect: optionProps.onOptionSelect,\n isSearching: false,\n selectOpened: optionProps.selectOpened,\n childIndex: index,\n hasFocus: optionProps.focusedSelectItem === index,\n shouldClick: optionProps.shouldClick,\n id: getOptionId(optionProps.multiSelectId, index)\n });\n });\n};\n\nconst MultiSelectComponent: ForwardRefRenderFunction<HTMLSelectElement, MultiSelectProps> = (\n {\n id,\n children,\n name,\n disabled = false,\n labeledBy,\n placeholder,\n describedBy,\n selectButtonProps = {},\n className,\n error = false,\n success = false,\n value,\n clearLabel = \"Clear selection\",\n noResultsLabel = \"No results found\",\n onChange,\n addNew,\n search = { enabled: true, renderThreshold: 0 },\n isReadOnlyView,\n domRoot,\n selectedOptions,\n ...rest\n }: MultiSelectProps,\n ref\n) => {\n const multiSelectId = useRef(id ?? generateID(20));\n const [expanded, setExpanded] = useState(false);\n const [display, setDisplay] = useState<Display[]>([]);\n const myElementRef = useRef<HTMLDivElement>(null);\n const containerReference = useRef<HTMLDivElement>(null);\n const optionListReference = useRef<HTMLDivElement>(null);\n const portalRef = useRef<HTMLDivElement>(null);\n const listRef = useRef<HTMLUListElement>(null);\n const loadMoreSentinelRef = useRef<HTMLLIElement>(null);\n const loadMoreFiredRef = useRef(false);\n const asyncBusyRef = useRef(false);\n const { root } = useGetDomRoot(domRoot, myElementRef);\n const [focusedSelectItem, setFocusedSelectItem] = useState(0);\n const [shouldClick, setShouldClick] =\n useState(\n false\n ); /** We need this, because whenever we use the arrow keys to select the select item, and we focus the currently selected item it fires the \"click\" listener in Option component. Instead, we only want this to fire if we press \"enter\" or \"spacebar\" so we set this to true whenever that is the case, and back to false when it has been executed. */\n const [shouldFocusButtonAfterClose, setShouldFocusButtonAfterClose] = useState(false);\n const [optionsVisibleCount, setOptionsVisibleCount] = useState(\n React.Children.count(children) - display.length\n );\n const {\n filter,\n renderSearch,\n searchInputRef,\n resetSearchState,\n searchVisible,\n isAsync,\n isAsyncPending,\n asyncMinSearchLength\n } = useSearch({\n selectId: multiSelectId.current,\n expanded,\n search,\n searchInputClassName: classes[\"select-search\"],\n optionsCount: optionsVisibleCount,\n focusedSelectItem,\n setFocusedSelectItem,\n describedBy,\n error,\n getOptionId,\n getListboxId,\n placeholder\n });\n const { addBtnRef, addNewBtnOptionsContainerClassName, renderAddNew } = useAddNewBtn({\n id: getOptionId(multiSelectId.current, optionsVisibleCount),\n addNew,\n filter,\n focusedSelectItem,\n optionsCount: optionsVisibleCount,\n searchInputRef,\n shouldClick,\n onClickCallback: () => {\n setShouldClick(false);\n resetSearchState();\n }\n });\n\n const nativeSelect = (ref as React.RefObject<HTMLSelectElement | null>) || createRef();\n\n const onOptionChangeHandler = (optionElement: HTMLElement | null) => {\n if (optionElement?.getAttribute(\"aria-disabled\") === \"true\") {\n return;\n }\n\n if (nativeSelect.current && optionElement) {\n const value = optionElement.dataset.value!;\n const options = [...nativeSelect.current.options];\n const lastSelectedOptionValues = options\n .filter(option => option.selected)\n .map(option => option.value);\n options.forEach(option => {\n if (option.value === value || lastSelectedOptionValues.includes(option.value)) {\n option.selected = true;\n }\n });\n nativeSelect.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n\n if (isAsync) {\n resetSearchState();\n searchInputRef.current?.focus();\n return;\n }\n\n setExpanded(false);\n resetSearchState();\n };\n\n const handleOptionFocusChange = (childIndex: number) => {\n setFocusedSelectItem(childIndex);\n };\n\n const handleOptionSelect = (optionRef: React.RefObject<HTMLLIElement | null>) => {\n onOptionChangeHandler(optionRef.current);\n setShouldClick(false);\n if (!isAsync) {\n setExpanded(false);\n }\n };\n\n const onSelectedOptionRemoveHandler = (value: string) => {\n if (nativeSelect.current) {\n const options = [...nativeSelect.current.options];\n options.find(option => option.value === value)!.selected = false;\n nativeSelect.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n };\n\n const customSelectButtonRef = useRef<HTMLButtonElement>(null);\n const readOnlyView = !!rest[\"data-readonlyview\"] || isReadOnlyView;\n const { onArrowNavigation } = useArrowNavigation({\n expanded,\n setExpanded,\n setFocusedSelectItem,\n childrenCount: optionsVisibleCount,\n setShouldClick,\n addBtnRef,\n searchInputRef,\n customSelectButtonRef,\n focusedOptionId: getOptionId(multiSelectId.current, focusedSelectItem),\n onClose: resetSearchState,\n isReadOnlyView: readOnlyView,\n listRef,\n isAsync\n });\n\n const { listPosition, opacity, optionsListMaxHeight, setListPosition, setOpacity } =\n useSelectPositionList({ expanded, optionListReference, containerReference, addBtnRef });\n\n /** Label resolution: current `children` first, then `selectedOptions` (async fallback for\n * values whose page scrolled past or wasn't loaded). Chips always render regardless. */\n const syncDisplayValue = (values: string[]) => {\n const options = React.Children.map(children, child => child);\n const displayArray: Display[] = values.map(value => {\n const option = options.find(option => option.props.value === value);\n if (option) {\n return { value, label: option.props.children, fixed: option.props.fixed };\n }\n\n const fallback = selectedOptions?.find(selectedOption => selectedOption.value === value);\n return { value, label: fallback?.label ?? \"\", fixed: undefined };\n });\n setDisplay(displayArray);\n };\n\n const syncSelectedOption = (vals: string[]) => {\n if (nativeSelect.current) {\n const options = [...nativeSelect.current.options];\n options.forEach(option => {\n if (vals.includes(option.value)) {\n option.selected = true;\n } else {\n option.selected = false;\n }\n });\n }\n };\n\n const asyncBusy = !!search?.async?.loading || isAsyncPending;\n asyncBusyRef.current = asyncBusy;\n\n const asyncOnLoadMore = search?.async?.onLoadMore;\n const canPaginate = isAsync && !!asyncOnLoadMore;\n /** Below the minimum search length, the dropdown only makes sense once the user has actually\n * started typing - at 0 characters there is nothing to prompt them about yet, so it stays\n * fully hidden instead of showing an idle message. */\n const asyncIdleHidden = isAsync && asyncMinSearchLength > 0 && filter.length === 0;\n const visibleAsyncChildrenCount = filterOutSelectedChildren(\n React.Children.toArray(children),\n display\n ).length;\n const showLoadMoreSentinel =\n canPaginate &&\n !!search?.async?.hasMore &&\n !search?.async?.errorLabel &&\n filter.length >= asyncMinSearchLength &&\n visibleAsyncChildrenCount > 0;\n\n const updateVisibleCount = (count: number) => {\n if (optionsVisibleCount !== count) {\n setOptionsVisibleCount(count);\n }\n };\n\n const renderAsyncOptions = (optionProps: OptionRenderProps) => {\n const asyncSearch = search?.async;\n\n if (filter.length < asyncMinSearchLength) {\n updateVisibleCount(0);\n return (\n <li className={classes[\"async-status\"]}>{asyncSearch?.idleLabel ?? \"Type to search\"}</li>\n );\n }\n\n if (asyncSearch?.errorLabel) {\n updateVisibleCount(0);\n return (\n <li className={classes[\"async-status\"]}>\n {asyncSearch.errorLabel}\n {asyncSearch.onRetry && (\n <button type=\"button\" className={classes[\"retry-button\"]} onClick={asyncSearch.onRetry}>\n Retry\n </button>\n )}\n </li>\n );\n }\n\n const visibleChildren = filterOutSelectedChildren(React.Children.toArray(children), display);\n\n if (asyncBusy) {\n if (canPaginate && visibleChildren.length > 0) {\n updateVisibleCount(visibleChildren.length);\n return [\n ...renderChildOptions(visibleChildren, optionProps),\n <li\n key=\"__multiselect-load-more-status__\"\n data-testid=\"multiselect-load-more-status\"\n className={classes[\"async-status\"]}\n >\n <Spinner size={16} />\n </li>\n ];\n }\n\n updateVisibleCount(0);\n return (\n <li className={classes[\"async-status\"]}>\n <Spinner size={20} />\n </li>\n );\n }\n\n updateVisibleCount(visibleChildren.length);\n\n if (visibleChildren.length === 0) {\n return <li className={classes[\"no-results\"]}>{noResultsLabel}</li>;\n }\n\n return renderChildOptions(visibleChildren, optionProps);\n };\n\n const renderSyncOptions = (optionProps: OptionRenderProps) => {\n let results;\n if (filter !== \"\") {\n const filteredChildren = React.Children.toArray(children).filter(child => {\n const childElement = child as ReactElement<OptionElementProps>;\n const childText = extractTextFromChildren(childElement.props.children);\n return childText.toLowerCase().includes(filter.toLowerCase());\n });\n\n results = renderChildOptions(\n filterOutSelectedChildren(filteredChildren, display),\n optionProps\n );\n } else {\n results = renderChildOptions(\n filterOutSelectedChildren(React.Children.toArray(children), display),\n optionProps\n );\n }\n\n updateVisibleCount(results.length);\n\n if (results.length === 0) {\n return <li className={classes[\"no-results\"]}>{noResultsLabel}</li>;\n }\n\n return results;\n };\n\n /**\n * @description We have to modify the children (Option component) to have a additional props that allows us to keep track of which one is selected and focused at all times and if a filter is active.\n * The `children` prop can be either a single object (1 child) or an array of multiple children.\n */\n const renderOptions = () => {\n const optionProps: OptionRenderProps = {\n onFocusChange: handleOptionFocusChange,\n onOptionSelect: handleOptionSelect,\n selectOpened: expanded,\n focusedSelectItem,\n shouldClick,\n multiSelectId: multiSelectId.current\n };\n\n if (isAsync) {\n return renderAsyncOptions(optionProps);\n }\n\n return renderSyncOptions(optionProps);\n };\n\n const getAsyncStatusMessage = () => {\n const asyncSearch = search?.async;\n if (!asyncSearch) {\n return \"\";\n }\n\n if (filter.length < asyncMinSearchLength) {\n return asyncSearch.idleLabel ?? \"Type to search\";\n }\n\n if (asyncSearch.errorLabel) {\n return asyncSearch.errorLabel;\n }\n\n if (asyncBusy) {\n return \"Loading\";\n }\n\n return visibleAsyncChildrenCount === 0\n ? noResultsLabel\n : `${visibleAsyncChildrenCount} results`;\n };\n\n const renderChevronIcon = () => {\n return expanded ? (\n <Icon className={classes[\"chevron-icon\"]} icon={Icons.ChevronUp} />\n ) : (\n <Icon className={classes[\"chevron-icon\"]} icon={Icons.ChevronDown} />\n );\n };\n\n const icon = useDetermineStatusIcon({ success, error });\n\n const nativeOnChangeHandler = (event: React.ChangeEvent<HTMLSelectElement>) => {\n onChange?.(event);\n };\n\n useEffect(() => {\n if (expanded && searchInputRef.current) {\n setShouldFocusButtonAfterClose(true);\n searchInputRef.current.focus();\n }\n\n if (!expanded && customSelectButtonRef.current && shouldFocusButtonAfterClose) {\n setShouldFocusButtonAfterClose(false);\n customSelectButtonRef.current.focus();\n }\n }, [\n expanded,\n customSelectButtonRef.current,\n shouldFocusButtonAfterClose,\n searchInputRef.current\n ]);\n\n useEffect(() => {\n syncDisplayValue(value);\n }, [value, children, selectedOptions]);\n\n useEffect(() => {\n syncSelectedOption(value);\n }, [value, children]);\n\n useEffect(() => {\n if (!showLoadMoreSentinel || !expanded) {\n loadMoreFiredRef.current = false;\n return;\n }\n\n const sentinel = loadMoreSentinelRef.current;\n if (!sentinel || typeof IntersectionObserver === \"undefined\") {\n return;\n }\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (!entry.isIntersecting) {\n loadMoreFiredRef.current = false;\n return;\n }\n\n if (loadMoreFiredRef.current || asyncBusyRef.current) {\n return;\n }\n\n loadMoreFiredRef.current = true;\n asyncOnLoadMore?.();\n },\n { root: listRef.current, threshold: 0 }\n );\n\n observer.observe(sentinel);\n\n return () => observer.disconnect();\n }, [showLoadMoreSentinel, expanded, asyncOnLoadMore]);\n\n useClickOutside(\n myElementRef,\n event => {\n if (!expanded) {\n return;\n }\n if (portalRef.current && event.composedPath().includes(portalRef.current)) {\n return;\n }\n setExpanded(false);\n setListPosition(Position.Below);\n setOpacity(0);\n },\n [expanded]\n );\n\n const additionalClasses = classNames(className, {\n [classes.expanded]: expanded,\n [classes.error]: error,\n [classes.disabled]: disabled,\n [classes.success]: success\n });\n\n const onSelectButtonClick = () => {\n if (rest[\"data-readonlyview\"] || isReadOnlyView) {\n return;\n }\n setExpanded(expanded => !expanded);\n setShouldClick(false);\n };\n\n useEffect(() => {\n if (!expanded) {\n return;\n }\n\n const anchor = containerReference.current;\n const portal = portalRef.current;\n\n if (!anchor || !portal) {\n return;\n }\n\n let frameId: number | null = null;\n\n const updatePosition = () => {\n if (!anchor || !portal) {\n return;\n }\n\n const rect = anchor.getBoundingClientRect();\n const x = rect.left;\n const y = listPosition === Position.Below ? rect.bottom : rect.top;\n\n portal.style.position = \"fixed\";\n portal.style.zIndex = \"1000\";\n portal.style.left = \"0\";\n portal.style.top = \"0\";\n portal.style.width = `${rect.width}px`;\n portal.style.transform = `translate3d(${x}px, ${y}px, 0)`;\n };\n\n const scheduleUpdate = () => {\n if (frameId != null) {\n return;\n }\n frameId = globalThis.requestAnimationFrame(() => {\n frameId = null;\n updatePosition();\n });\n };\n\n updatePosition();\n\n const handleScroll = () => scheduleUpdate();\n const handleResize = () => scheduleUpdate();\n\n window.addEventListener(\"scroll\", handleScroll, { passive: true, capture: true });\n window.addEventListener(\"resize\", handleResize);\n\n const resizeObserver = new ResizeObserver(() => {\n scheduleUpdate();\n });\n resizeObserver.observe(anchor);\n\n return () => {\n window.removeEventListener(\"scroll\", handleScroll, true);\n window.removeEventListener(\"resize\", handleResize);\n resizeObserver.disconnect();\n if (frameId != null) {\n globalThis.cancelAnimationFrame(frameId);\n }\n };\n }, [expanded, listPosition]);\n\n const optionsElement = (\n <div className={`list-wrapper-container ${classes[\"list-wrapper-container\"]}`}>\n <div\n ref={optionListReference}\n className={`list-wrapper ${classes[\"list-wrapper\"]}`}\n style={{\n display: expanded && !asyncIdleHidden ? \"block\" : \"none\",\n opacity: opacity,\n maxHeight: optionsListMaxHeight.wrapper,\n pointerEvents: expanded ? \"auto\" : \"none\",\n top: listPosition === Position.Below ? \"4px\" : undefined,\n bottom: listPosition === Position.Above ? \"4px\" : undefined\n }}\n >\n <ul // NOSONAR(S6819) native <select multiple> can't host search, add-new or custom option markup\n ref={listRef}\n id={getListboxId(multiSelectId.current)}\n className={addNewBtnOptionsContainerClassName}\n role=\"listbox\" // NOSONAR(S6842) required by ARIA listbox pattern; hosts aria-multiselectable\n aria-multiselectable=\"true\"\n style={{ maxHeight: optionsListMaxHeight.list }}\n aria-busy={isAsync ? asyncBusy : undefined}\n >\n {renderOptions()}\n {showLoadMoreSentinel && (\n <li\n ref={loadMoreSentinelRef}\n aria-hidden=\"true\"\n data-testid=\"multiselect-load-more-sentinel\"\n className={classes[\"load-more-sentinel\"]}\n />\n )}\n </ul>\n {isAsync && (\n <output aria-live=\"polite\" className={readyclasses[\"sr-only\"]}>\n {getAsyncStatusMessage()}\n </output>\n )}\n {renderAddNew()}\n </div>\n </div>\n );\n\n /** The native select is purely for external form libraries. We use it to emit an onChange with native select event object so they know exactly what's happening. */\n return (\n <>\n <div ref={myElementRef}>\n <select\n {...omitProps(rest, /^data-/)}\n tabIndex={-1}\n multiple={true}\n aria-hidden=\"true\"\n ref={nativeSelect}\n name={name}\n onChange={nativeOnChangeHandler}\n className={readyclasses[\"sr-only\"]}\n >\n <option value=\"\"></option>\n {/* Hidden <option> for values picked from an earlier async page/query, so they aren't\n * dropped from `value` on the next (de)selection. Rendered before `children` to keep\n * selection order stable. */}\n {value\n ?.filter(\n pickedValue =>\n !React.Children.toArray(children).some(\n child => (child as ReactElement<OptionElementProps>).props.value === pickedValue\n )\n )\n .map(pickedValue => (\n <option key={pickedValue} value={pickedValue}></option>\n ))}\n {React.Children.map(children, child => (\n <option value={child.props.value}></option>\n ))}\n </select>\n <div // NOSONAR(S6848) event-delegation wrapper; keys bubble from focusable SelectButton/options, adding role/tabIndex would create a spurious tab stop\n {...pickProps(rest, /^data-/)}\n id={multiSelectId.current}\n ref={containerReference}\n onKeyDown={onArrowNavigation}\n className={`custom-select ${classes.select} ${additionalClasses}`}\n >\n <div\n className={`${classes[\"custom-select\"]} ${additionalClasses} `}\n style={{ display: \"flex\" }}\n >\n <div className={classes[\"display-container\"]} data-display>\n <SelectButton // NOSONAR(S6819) no semantic equivalent: <select multiple> can't host the search input, add-new button, selected-option tags or status icon. role=\"combobox\" follows the ARIA APG select-only combobox pattern and is what allows aria-invalid here.\n {...selectButtonProps}\n onClick={onSelectButtonClick}\n name={name}\n ref={customSelectButtonRef}\n disabled={disabled}\n aria-disabled={disabled}\n role=\"combobox\"\n aria-invalid={error}\n aria-expanded={expanded}\n aria-controls={getListboxId(multiSelectId.current)}\n aria-haspopup=\"listbox\"\n aria-labelledby={labeledBy}\n aria-describedby={describedBy}\n />\n {value?.length === 0 && placeholder && (\n <span className={classes[\"placeholder\"]}>{placeholder}</span>\n )}\n {value?.length > 0 && (\n <SelectedOptions\n disabled={disabled}\n display={display}\n onClick={onSelectButtonClick}\n onRemove={onSelectedOptionRemoveHandler}\n />\n )}\n {searchVisible && renderSearch()}\n </div>\n <div className={classes[\"status\"]}>{icon || renderChevronIcon()}</div>\n </div>\n </div>\n </div>\n {createPortal(\n <div ref={portalRef} className={`${classes.select} ${additionalClasses}`}>\n {optionsElement}\n </div>,\n root\n )}\n </>\n );\n};\n\nexport const MultiSelect = withReadOnly(React.forwardRef(MultiSelectComponent));\n"],"names":["getOptionId","multiSelectId","optionIndex","getListboxId","extractTextFromChildren","children","React","Children","toArray","reduce","text","child","isValidElement","props","filterOutSelectedChildren","internalChildren","display","filter","some","option","value","renderChildOptions","optionProps","map","index","cloneElement","onFocusChange","onOptionSelect","isSearching","selectOpened","childIndex","hasFocus","focusedSelectItem","shouldClick","id","MultiSelect","withReadOnly","forwardRef","name","disabled","labeledBy","placeholder","describedBy","selectButtonProps","className","error","success","clearLabel","noResultsLabel","onChange","addNew","search","enabled","renderThreshold","isReadOnlyView","domRoot","selectedOptions","rest","ref","useRef","generateID","expanded","setExpanded","useState","setDisplay","myElementRef","containerReference","optionListReference","portalRef","listRef","loadMoreSentinelRef","loadMoreFiredRef","asyncBusyRef","root","useGetDomRoot","setFocusedSelectItem","setShouldClick","shouldFocusButtonAfterClose","setShouldFocusButtonAfterClose","optionsVisibleCount","setOptionsVisibleCount","count","length","renderSearch","searchInputRef","resetSearchState","searchVisible","isAsync","isAsyncPending","asyncMinSearchLength","useSearch","selectId","current","searchInputClassName","classes","optionsCount","addBtnRef","addNewBtnOptionsContainerClassName","renderAddNew","useAddNewBtn","onClickCallback","nativeSelect","createRef","handleOptionFocusChange","handleOptionSelect","optionRef","optionElement","getAttribute","dataset","options","lastSelectedOptionValues","selected","forEach","includes","dispatchEvent","Event","bubbles","_a","focus","onOptionChangeHandler","customSelectButtonRef","readOnlyView","onArrowNavigation","useArrowNavigation","childrenCount","focusedOptionId","onClose","listPosition","opacity","optionsListMaxHeight","setListPosition","setOpacity","useSelectPositionList","asyncBusy","async","loading","asyncOnLoadMore","_b","onLoadMore","canPaginate","asyncIdleHidden","visibleAsyncChildrenCount","showLoadMoreSentinel","_c","hasMore","_d","errorLabel","updateVisibleCount","icon","useDetermineStatusIcon","useEffect","values","displayArray","find","label","fixed","fallback","selectedOption","syncDisplayValue","vals","sentinel","IntersectionObserver","observer","entry","isIntersecting","threshold","observe","disconnect","useClickOutside","event","composedPath","Position","Below","additionalClasses","classNames","onSelectButtonClick","anchor","portal","frameId","updatePosition","rect","getBoundingClientRect","x","left","y","bottom","top","style","position","zIndex","width","transform","scheduleUpdate","globalThis","requestAnimationFrame","handleScroll","handleResize","window","addEventListener","passive","capture","resizeObserver","ResizeObserver","removeEventListener","cancelAnimationFrame","optionsElement","createElement","maxHeight","wrapper","pointerEvents","Above","role","list","asyncSearch","idleLabel","onRetry","type","onClick","visibleChildren","key","Spinner","size","renderAsyncOptions","results","filteredChildren","toLowerCase","renderSyncOptions","renderOptions","readyclasses","getAsyncStatusMessage","Fragment","omitProps","tabIndex","multiple","pickedValue","pickProps","onKeyDown","select","SelectButton","SelectedOptions","onRemove","Icon","Icons","ChevronUp","ChevronDown","createPortal"],"mappings":"o0BA2CMA,EAAc,CAACC,EAAuBC,IAC1C,GAAGD,WAAuBC,IAEtBC,EAAgBF,GAA0B,GAAGA,YAE7CG,EA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