@onewelcome/react-lib-components 13.2.0 → 13.3.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.cjs.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.es.js.map +1 -1
- 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/ContextMenu/ContextMenuService.cjs.js +1 -1
- package/dist/components/ContextMenu/ContextMenuService.cjs.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenuService.es.js +20 -17
- package/dist/components/ContextMenu/ContextMenuService.es.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.cjs.js +1 -1
- package/dist/components/DataGrid/DataGrid.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.es.js +76 -51
- package/dist/components/DataGrid/DataGrid.es.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGrid.module.scss.es.js +8 -7
- package/dist/components/DataGrid/DataGrid.module.scss.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridBody.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridBody.es.js +4 -2
- package/dist/components/DataGrid/DataGridBody/DataGridBody.es.js.map +1 -1
- 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/DataGridBody/DataGridRow/useNestedRow.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.es.js +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.es.js.map +1 -1
- 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 +4 -4
- 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 +44 -25
- 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 +56 -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.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.es.js +4 -4
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.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.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.es.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.es.js.map +1 -1
- 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/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.es.js +45 -24
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.es.js +7 -9
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.es.js +5 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.es.js +7 -4
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.es.js +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.es.js.map +1 -1
- 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 +2 -1
- 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 +8 -5
- package/dist/components/Form/Fieldset/Fieldset.module.scss.es.js.map +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.cjs.js +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.cjs.js.map +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.es.js +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/FileUpload/FileUpload.cjs.js.map +1 -1
- package/dist/components/Form/FileUpload/FileUpload.es.js +6 -6
- package/dist/components/Form/FileUpload/FileUpload.es.js.map +1 -1
- package/dist/components/Form/FileUpload/FileUpload.module.scss.cjs.js +2 -2
- package/dist/components/Form/FileUpload/FileUpload.module.scss.es.js +16 -16
- package/dist/components/Form/Form.module.scss.cjs.js +2 -2
- package/dist/components/Form/Form.module.scss.es.js +2 -2
- package/dist/components/Form/FormControl/FormControl.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormControl/FormControl.module.scss.es.js +13 -13
- package/dist/components/Form/FormErrorText/FormErrorText.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormErrorText/FormErrorText.module.scss.es.js +9 -6
- package/dist/components/Form/FormErrorText/FormErrorText.module.scss.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.cjs.js.map +1 -1
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.es.js +4 -1
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.es.js.map +1 -1
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss.es.js +6 -6
- package/dist/components/Form/Input/Input.cjs.js +1 -1
- package/dist/components/Form/Input/Input.cjs.js.map +1 -1
- package/dist/components/Form/Input/Input.es.js +2 -1
- package/dist/components/Form/Input/Input.es.js.map +1 -1
- package/dist/components/Form/Input/Input.module.scss.cjs.js +2 -2
- package/dist/components/Form/Input/Input.module.scss.es.js +8 -8
- package/dist/components/Form/Label/Label.module.scss.cjs.js +2 -2
- package/dist/components/Form/Label/Label.module.scss.es.js +2 -2
- package/dist/components/Form/Radio/Radio.cjs.js.map +1 -1
- package/dist/components/Form/Radio/Radio.es.js +1 -1
- package/dist/components/Form/Radio/Radio.es.js.map +1 -1
- 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 +6 -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 +198 -40
- 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 +18 -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 +81 -33
- 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 +40 -6
- 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 +10 -3
- 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 +169 -31
- 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 +20 -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 +119 -91
- 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 +34 -4
- package/dist/components/Form/Select/SingleSelect/useSearch.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/Textarea/Textarea.cjs.js +1 -1
- package/dist/components/Form/Textarea/Textarea.cjs.js.map +1 -1
- package/dist/components/Form/Textarea/Textarea.es.js +4 -0
- package/dist/components/Form/Textarea/Textarea.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/Toggle/Toggle.cjs.js.map +1 -1
- package/dist/components/Form/Toggle/Toggle.es.js +5 -3
- package/dist/components/Form/Toggle/Toggle.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.es.js +25 -17
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.es.js.map +1 -1
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.es.js +8 -4
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.es.js.map +1 -1
- 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 +37 -21
- 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 +8 -4
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.es.js +2 -0
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.es.js +1 -1
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Icon/Icon.cjs.js.map +1 -1
- package/dist/components/Icon/Icon.es.js +1 -1
- package/dist/components/Icon/Icon.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Layout/ContentHeader/ContentHeader.cjs.js.map +1 -1
- package/dist/components/Layout/ContentHeader/ContentHeader.es.js +66 -41
- package/dist/components/Layout/ContentHeader/ContentHeader.es.js.map +1 -1
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.cjs.js +2 -2
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.es.js +28 -13
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Link/Link.es.js +1 -1
- package/dist/components/Link/Link.es.js.map +1 -1
- 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/AlertContainer/useAlertContainerHeightAnimation.cjs.js +1 -1
- package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.cjs.js.map +1 -1
- package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.es.js +7 -1
- package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Notifications/BaseModal/BaseModal.cjs.js.map +1 -1
- package/dist/components/Notifications/BaseModal/BaseModal.es.js +1 -1
- package/dist/components/Notifications/BaseModal/BaseModal.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Notifications/SideSheet/SideSheet.es.js +1 -1
- package/dist/components/Notifications/SideSheet/SideSheet.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Notifications/SlideInModal/SlideInModal.es.js +1 -1
- package/dist/components/Notifications/SlideInModal/SlideInModal.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Pagination/Pagination.cjs.js.map +1 -1
- package/dist/components/Pagination/Pagination.es.js +118 -90
- package/dist/components/Pagination/Pagination.es.js.map +1 -1
- package/dist/components/Pagination/Pagination.module.scss.cjs.js +2 -2
- package/dist/components/Pagination/Pagination.module.scss.es.js +15 -14
- package/dist/components/Pagination/Pagination.module.scss.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.es.js.map +1 -1
- 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 +1 -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.cjs.js.map +1 -1
- package/dist/components/TextEllipsis/TextEllipsis.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Tiles/Tile.es.js.map +1 -1
- 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 +1 -1
- package/dist/components/Tooltip/Tooltip.cjs.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.es.js +9 -16
- 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 -27
- package/dist/components/Tooltip/Tooltip.module.scss.es.js.map +1 -1
- 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/_BaseStyling_/BaseStyling.cjs.js +2 -2
- package/dist/components/_BaseStyling_/BaseStyling.cjs.js.map +1 -1
- package/dist/components/_BaseStyling_/BaseStyling.es.js +2 -4
- package/dist/components/_BaseStyling_/BaseStyling.es.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNav.cjs.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNav.es.js +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNav.es.js.map +1 -1
- 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/LeftNav/useRefItems.cjs.js +1 -1
- package/dist/components/admin/layout/LeftNav/useRefItems.cjs.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/useRefItems.es.js +7 -6
- package/dist/components/admin/layout/LeftNav/useRefItems.es.js.map +1 -1
- package/dist/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss.es.js +3 -3
- package/dist/components/admin/layout/ProfileMenu/ProfileMenu.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/ProfileMenu/ProfileMenu.module.scss.es.js +7 -7
- package/dist/components/admin/layout/TopNavBar/TopNavBar.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/TopNavBar/TopNavBar.module.scss.es.js +13 -13
- package/dist/components/miscellaneous/IdentityProviderButton.module.scss.cjs.js +2 -2
- package/dist/components/miscellaneous/IdentityProviderButton.module.scss.es.js +3 -3
- package/dist/components/withReadOnly.cjs.js +1 -1
- package/dist/components/withReadOnly.cjs.js.map +1 -1
- package/dist/components/withReadOnly.es.js +2 -4
- package/dist/components/withReadOnly.es.js.map +1 -1
- package/dist/hooks/useScreenSize.cjs.js +1 -1
- package/dist/hooks/useScreenSize.cjs.js.map +1 -1
- package/dist/hooks/useScreenSize.es.js +1 -1
- package/dist/hooks/useScreenSize.es.js.map +1 -1
- package/dist/hooks/useStickyStacking.cjs.js +2 -0
- package/dist/hooks/useStickyStacking.cjs.js.map +1 -0
- package/dist/hooks/useStickyStacking.es.js +208 -0
- package/dist/hooks/useStickyStacking.es.js.map +1 -0
- package/dist/hooks/useUploadFile.cjs.js +1 -1
- package/dist/hooks/useUploadFile.cjs.js.map +1 -1
- package/dist/hooks/useUploadFile.es.js +1 -1
- package/dist/hooks/useUploadFile.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +95 -7
- package/dist/index.es.js +2 -0
- package/dist/index.es.js.map +1 -1
- 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 +14 -16
- package/dist/util/helper.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.cjs.js","sources":["../../../../../src/components/Form/Select/SingleSelect/Select.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 \"./Select.module.scss\";\n\nimport React, {\n createRef,\n ForwardRefRenderFunction,\n ReactElement,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { useClickOutside } from \"../../../../hooks/useClickOutside\";\nimport readyclasses from \"../../../../readyclasses.module.scss\";\nimport { filterProps } from \"../../../../util/helper\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { Position, SingleSelectProps } from \"../Select.interfaces\";\nimport { useSelectPositionList } from \"../useSelectPositionList\";\nimport { useAddNewBtn } from \"../useAddNewBtn\";\nimport { useSearch } from \"./useSearch\";\nimport { useArrowNavigation } from \"./useArrowNavigation\";\nimport { withReadOnly } from \"../../../withReadOnly\";\nimport { RequiredSign } from \"../../../RequiredSign/RequiredSign\";\nimport { FormStatusIndicator } from \"../../FormStatusIndicator/FormStatusIndicator\";\nimport { useInlineEditing } from \"../../../InlineEditing/InlineEditingContext\";\n\nconst SelectComponent: ForwardRefRenderFunction<HTMLSelectElement, SingleSelectProps> = (\n {\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,\n isReadOnlyView,\n ...rest\n }: SingleSelectProps,\n ref\n) => {\n const [expanded, setExpanded] = useState(false);\n const [display, setDisplay] = useState(\"\");\n const containerReference = useRef<HTMLDivElement>(null);\n const optionListReference = useRef<HTMLDivElement>(null);\n const [focusedSelectItem, setFocusedSelectItem] = useState(-1);\n const [shouldClick, setShouldClick] = useState(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 optionsCount = React.Children.count(children);\n const {\n filter,\n isSearching,\n renderSearch,\n searchInputRef,\n setIsSearching,\n searchThreshold,\n searchVisible\n } = useSearch({\n expanded,\n search,\n searchInputClassName: classes[\"select-search\"],\n optionsCount,\n setFocusedSelectItem\n });\n const { addBtnRef, addNewBtnOptionsContainerClassName, renderAddNew } = useAddNewBtn({\n addNew,\n filter,\n focusedSelectItem,\n optionsCount,\n searchInputRef\n });\n\n const { inlineClassNames } = useInlineEditing();\n const rootClassNames = inlineClassNames ? ` ${inlineClassNames}` : \"\";\n\n const nativeSelect = (ref as React.RefObject<HTMLSelectElement>) || createRef();\n\n const onOptionChangeHandler = (optionElement: HTMLElement | null) => {\n if (nativeSelect.current && optionElement) {\n nativeSelect.current.value = optionElement.getAttribute(\"data-value\")!;\n nativeSelect.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n\n setExpanded(false);\n };\n\n const customSelectButtonRef = useRef<HTMLButtonElement>(null);\n const { onArrowNavigation } = useArrowNavigation({\n expanded,\n setExpanded,\n isSearching,\n setIsSearching,\n setFocusedSelectItem,\n onOptionChangeHandler,\n childrenCount: optionsCount,\n setShouldClick,\n searchInputRef,\n addBtnRef,\n renderThreshold: searchThreshold,\n isReadOnlyView: isReadOnlyView || !!rest[\"data-readonlyview\"]\n });\n\n const { listPosition, opacity, optionsListMaxHeight, setListPosition, setOpacity } =\n useSelectPositionList({ expanded, optionListReference, containerReference, addBtnRef });\n\n const syncDisplayValue = (val: string) => {\n React.Children.forEach(children, child => {\n if (child.props.value === val) {\n setDisplay(child.props.children);\n }\n });\n };\n\n /**\n * @description We have to modify the children (Option component) to have an 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 if (isSearching || filter !== \"\") {\n const filteredChildren = React.Children.toArray(children).filter(child => {\n const childElement = child as React.ReactElement;\n const innerChildren = childElement.props.children;\n\n const childText = Array.isArray(innerChildren)\n ? innerChildren.map(String).join(\"\")\n : String(innerChildren);\n return childText.toLowerCase().includes(filter.toLowerCase());\n });\n\n const internalChildren = _internalRenderChildren(filteredChildren as ReactElement[]);\n\n if (internalChildren.length === 0) {\n return <li className={classes[\"no-results\"]}>{noResultsLabel}</li>;\n }\n\n return _internalRenderChildren(filteredChildren as ReactElement[]);\n }\n\n return _internalRenderChildren(children);\n\n function _internalRenderChildren(internalChildren: ReactElement[]) {\n return React.Children.map(internalChildren, (child, index) => {\n return React.cloneElement(child, {\n onFocusChange: (childIndex: number) => {\n setFocusedSelectItem(childIndex);\n },\n onOptionSelect: (optionRef: React.RefObject<HTMLLIElement>) => {\n onOptionChangeHandler(optionRef.current);\n setShouldClick(false);\n },\n isSelected: child.props.value === value,\n isSearching: isSearching,\n selectOpened: expanded,\n childIndex: index,\n hasFocus: focusedSelectItem === index,\n shouldClick: shouldClick,\n isAddBtnFocused: addBtnRef.current === document.activeElement\n });\n });\n }\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 nativeOnChangeHandler = (event: React.ChangeEvent<HTMLSelectElement>) => {\n onChange?.(event);\n };\n\n useEffect(() => {\n if (expanded) {\n setFocusedSelectItem(0);\n setShouldFocusButtonAfterClose(true);\n }\n\n if (!expanded && customSelectButtonRef.current && shouldFocusButtonAfterClose) {\n customSelectButtonRef.current.focus();\n setShouldFocusButtonAfterClose(false);\n }\n }, [expanded, customSelectButtonRef.current, shouldFocusButtonAfterClose]);\n\n useEffect(() => {\n syncDisplayValue(value);\n }, [value, children]);\n\n const myElementRef = useRef<HTMLDivElement>(null);\n\n useClickOutside(myElementRef, () => {\n if (!expanded) {\n return;\n }\n setExpanded(false);\n setListPosition(Position.Below);\n setOpacity(0);\n }, [expanded]);\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 /** 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 <div ref={myElementRef} className={`${classes[\"root\"]}${rootClassNames}`}>\n <select\n {...filterProps(rest, /^data-/, false)}\n tabIndex={-1}\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\n {...filterProps(rest, /^data-/)}\n ref={containerReference}\n onKeyDown={onArrowNavigation}\n className={`custom-select ${classes.select} ${additionalClasses.join(\" \")}`}\n >\n {searchVisible && renderSearch()}\n <button\n {...selectButtonProps}\n onClick={() => {\n setExpanded(isReadOnlyView || rest[\"data-readonlyview\"] ? false : !expanded);\n }}\n ref={customSelectButtonRef}\n type=\"button\"\n name={name}\n className={`${classes[\"custom-select\"]} ${additionalClasses.join(\" \")} `}\n style={{ display: expanded && searchVisible ? \"none\" : \"block\" }}\n disabled={disabled}\n aria-disabled={disabled}\n aria-invalid={error}\n aria-expanded={expanded}\n aria-haspopup=\"listbox\"\n aria-labelledby={labeledBy}\n aria-describedby={describedBy}\n >\n <div data-display className={classes[\"selected\"]}>\n {!value && placeholder && <span className={classes[\"placeholder\"]}>{placeholder}</span>}\n {value?.length > 0 && <span data-display-inner>{display}</span>}\n <RequiredSign className={classes[\"required\"]} />\n </div>\n <div className={classes[\"status\"]}>\n <FormStatusIndicator isReadOnlyView={isReadOnlyView} success={success} error={error}>\n {renderChevronIcon()}\n </FormStatusIndicator>\n </div>\n </button>\n <div className=\"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 bottom: listPosition === Position.Above ? \"2.85rem\" : \"initial\",\n marginTop: \"4px\"\n }}\n >\n <ul\n className={addNewBtnOptionsContainerClassName}\n role=\"listbox\"\n style={{ maxHeight: optionsListMaxHeight.list }}\n >\n {renderOptions()}\n </ul>\n {renderAddNew()}\n </div>\n </div>\n </div>\n </div>\n );\n};\nexport const Select = withReadOnly(React.forwardRef(SelectComponent));\n"],"names":["Select","withReadOnly","React","forwardRef","children","name","disabled","labeledBy","placeholder","describedBy","selectButtonProps","className","error","success","value","clearLabel","noResultsLabel","onChange","addNew","search","isReadOnlyView","rest","ref","expanded","setExpanded","useState","display","setDisplay","containerReference","useRef","optionListReference","focusedSelectItem","setFocusedSelectItem","shouldClick","setShouldClick","shouldFocusButtonAfterClose","setShouldFocusButtonAfterClose","optionsCount","Children","count","filter","isSearching","renderSearch","searchInputRef","setIsSearching","searchThreshold","searchVisible","useSearch","searchInputClassName","classes","addBtnRef","addNewBtnOptionsContainerClassName","renderAddNew","useAddNewBtn","inlineClassNames","useInlineEditing","rootClassNames","nativeSelect","createRef","onOptionChangeHandler","optionElement","current","getAttribute","dispatchEvent","Event","bubbles","customSelectButtonRef","onArrowNavigation","useArrowNavigation","childrenCount","renderThreshold","listPosition","opacity","optionsListMaxHeight","setListPosition","setOpacity","useSelectPositionList","useEffect","focus","val","forEach","child","props","myElementRef","useClickOutside","Position","Below","additionalClasses","push","createElement","filterProps","tabIndex","event","readyclasses","map","onKeyDown","select","join","onClick","type","style","length","RequiredSign","FormStatusIndicator","Icon","icon","Icons","ChevronUp","ChevronDown","maxHeight","wrapper","pointerEvents","bottom","Above","marginTop","role","list","filteredChildren","toArray","innerChildren","Array","isArray","String","toLowerCase","includes","_internalRenderChildren","internalChildren","index","cloneElement","onFocusChange","childIndex","onOptionSelect","optionRef","isSelected","selectOpened","hasFocus","isAddBtnFocused","document","activeElement","renderOptions"],"mappings":"0vBAuTaA,EAASC,EAAAA,aAAaC,EAAMC,WA/Q+C,EAEpFC,WACAC,OACAC,YAAW,EACXC,YACAC,cACAC,cACAC,oBACAC,YACAC,SAAQ,EACRC,WAAU,EACVC,QACAC,aAAa,kBACbC,iBAAiB,mBACjBC,WACAC,SACAC,SACAC,oBACGC,GAELC,KAEA,MAAOC,EAAUC,GAAeC,EAAAA,UAAS,IAClCC,EAASC,GAAcF,EAAAA,SAAS,IACjCG,EAAqBC,EAAAA,OAAuB,MAC5CC,EAAsBD,EAAAA,OAAuB,OAC5CE,EAAmBC,GAAwBP,EAAAA,UAAS,IACpDQ,EAAaC,GAAkBT,EAAAA,UAAS,IAExCU,EAA6BC,GAAkCX,EAAAA,UAAS,GACzEY,EAAenC,EAAMoC,SAASC,MAAMnC,IACpCoC,OACJA,EAAAC,YACAA,EAAAC,aACAA,EAAAC,eACAA,EAAAC,eACAA,EAAAC,gBACAA,EAAAC,cACAA,GACEC,YAAU,CACZxB,WACAJ,SACA6B,qBAAsBC,EAAAA,QAAQ,iBAC9BZ,eACAL,0BAEIkB,UAAEA,EAAAC,mCAAWA,GAAAC,aAAoCA,IAAiBC,EAAAA,aAAa,CACnFnC,SACAsB,SACAT,oBACAM,eACAM,oBAGIW,iBAAEA,IAAqBC,qBACvBC,GAAiBF,GAAmB,IAAIA,KAAqB,GAE7DG,GAAgBnC,GAA8CoC,cAE9DC,GAAyBC,IACzBH,GAAaI,SAAWD,IAC1BH,GAAaI,QAAQ/C,MAAQ8C,EAAcE,aAAa,cACxDL,GAAaI,QAAQE,cAAc,IAAIC,MAAM,SAAU,CAAEC,SAAS,MAGpEzC,GAAY,IAGR0C,GAAwBrC,EAAAA,OAA0B,OAClDsC,kBAAEA,IAAsBC,qBAAmB,CAC/C7C,WACAC,cACAiB,cACAG,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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 \"./Select.module.scss\";\n\nimport React, {\n createRef,\n ForwardRefRenderFunction,\n ReactElement,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { useClickOutside } from \"../../../../hooks/useClickOutside\";\nimport readyclasses from \"../../../../readyclasses.module.scss\";\nimport { generateID, omitProps, pickProps } from \"../../../../util/helper\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { Spinner } from \"../../../Spinner/Spinner\";\nimport { Position, SingleSelectProps } from \"../Select.interfaces\";\nimport { useSelectPositionList } from \"../useSelectPositionList\";\nimport { useAddNewBtn } from \"../useAddNewBtn\";\nimport { useSearch } from \"./useSearch\";\nimport { useArrowNavigation } from \"./useArrowNavigation\";\nimport { withReadOnly } from \"../../../withReadOnly\";\nimport { RequiredSign } from \"../../../RequiredSign/RequiredSign\";\nimport { FormStatusIndicator } from \"../../FormStatusIndicator/FormStatusIndicator\";\nimport { useInlineEditing } from \"../../../InlineEditing/InlineEditingContext\";\n\ninterface OptionRenderProps {\n onFocusChange: (childIndex: number) => void;\n onOptionSelect: (optionRef: React.RefObject<HTMLLIElement>) => void;\n value: string;\n isSearching: boolean;\n selectOpened: boolean;\n focusedSelectItem: number;\n shouldClick: boolean;\n addBtnRef: React.RefObject<HTMLButtonElement>;\n}\n\nconst renderChildOptions = (internalChildren: ReactElement[], optionProps: OptionRenderProps) => {\n return React.Children.map(internalChildren, (child, index) => {\n return React.cloneElement(child, {\n onFocusChange: optionProps.onFocusChange,\n onOptionSelect: optionProps.onOptionSelect,\n isSelected: child.props.value === optionProps.value,\n isSearching: optionProps.isSearching,\n selectOpened: optionProps.selectOpened,\n childIndex: index,\n hasFocus: optionProps.focusedSelectItem === index,\n shouldClick: optionProps.shouldClick,\n isAddBtnFocused: optionProps.addBtnRef.current === document.activeElement\n });\n });\n};\n\nconst SelectComponent: ForwardRefRenderFunction<HTMLSelectElement, SingleSelectProps> = (\n {\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,\n isReadOnlyView,\n selectedOption,\n ...rest\n }: SingleSelectProps,\n ref\n) => {\n const selectId = useRef(generateID(20));\n const listboxId = `${selectId.current}_listbox`;\n const [expanded, setExpanded] = useState(false);\n const [display, setDisplay] = useState<React.ReactNode>(\"\");\n const containerReference = useRef<HTMLDivElement>(null);\n const optionListReference = useRef<HTMLDivElement>(null);\n const [focusedSelectItem, setFocusedSelectItem] = useState(-1);\n const [shouldClick, setShouldClick] = useState(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 optionsCount = React.Children.count(children);\n const listRef = useRef<HTMLUListElement>(null);\n const loadMoreSentinelRef = useRef<HTMLLIElement>(null);\n const loadMoreFiredRef = useRef(false);\n const asyncBusyRef = useRef(false);\n const {\n filter,\n isSearching,\n renderSearch,\n searchInputRef,\n setIsSearching,\n searchThreshold,\n searchVisible,\n isAsync,\n isAsyncPending,\n asyncMinSearchLength\n } = useSearch({\n expanded,\n search,\n searchInputClassName: classes[\"select-search\"],\n optionsCount,\n setFocusedSelectItem\n });\n const { addBtnRef, addNewBtnOptionsContainerClassName, renderAddNew } = useAddNewBtn({\n addNew,\n filter,\n focusedSelectItem,\n optionsCount,\n searchInputRef\n });\n\n const { inlineClassNames } = useInlineEditing();\n const rootClassNames = inlineClassNames ? ` ${inlineClassNames}` : \"\";\n\n const nativeSelect = (ref as React.RefObject<HTMLSelectElement>) || 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 nativeSelect.current.value = optionElement.dataset.value!;\n nativeSelect.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n\n setExpanded(false);\n };\n\n const handleOptionFocusChange = (childIndex: number) => {\n setFocusedSelectItem(childIndex);\n };\n\n const handleOptionSelect = (optionRef: React.RefObject<HTMLLIElement>) => {\n onOptionChangeHandler(optionRef.current);\n setShouldClick(false);\n };\n\n const customSelectButtonRef = useRef<HTMLButtonElement>(null);\n const { onArrowNavigation } = useArrowNavigation({\n expanded,\n setExpanded,\n isSearching,\n setIsSearching,\n setFocusedSelectItem,\n onOptionChangeHandler,\n childrenCount: optionsCount,\n setShouldClick,\n searchInputRef,\n addBtnRef,\n renderThreshold: searchThreshold,\n isReadOnlyView: isReadOnlyView || !!rest[\"data-readonlyview\"]\n });\n\n const { listPosition, opacity, optionsListMaxHeight, setListPosition, setOpacity } =\n useSelectPositionList({ expanded, optionListReference, containerReference, addBtnRef });\n\n /** Display resolution order: matching child in `children` → `selectedOption` (async mode\n * fallback for a value that isn't in the currently loaded page) → blank (placeholder shows\n * instead, driven by `value` being falsy). */\n const syncDisplayValue = (val: string) => {\n let hasMatchingChild = false;\n React.Children.forEach(children, child => {\n if (child.props.value === val) {\n setDisplay(child.props.children);\n hasMatchingChild = true;\n }\n });\n\n if (hasMatchingChild) {\n return;\n }\n\n if (selectedOption && selectedOption.value === val) {\n setDisplay(selectedOption.label);\n return;\n }\n\n setDisplay(\"\");\n };\n\n /** True while a request is in flight (consumer-reported) or a debounced search is about to fire — keeps the list from flashing stale results for a query that's already been superseded. */\n const asyncBusy = !!search?.async?.loading || isAsyncPending;\n asyncBusyRef.current = asyncBusy;\n\n /** Paging (T4): only enabled once the consumer opts in via `onLoadMore`. `hasMore` additionally\n * gates the sentinel that triggers it — once the consumer reports no more pages, it disappears. */\n const asyncOnLoadMore = search?.async?.onLoadMore;\n const canPaginate = isAsync && !!asyncOnLoadMore;\n /** Only relevant while an actual page of options is being shown — not during the error/idle\n * states, and not when the current page is empty (nothing to scroll to). */\n const showLoadMoreSentinel =\n canPaginate &&\n !!search?.async?.hasMore &&\n !search?.async?.errorLabel &&\n filter.length >= asyncMinSearchLength &&\n React.Children.count(children) > 0;\n\n /**\n * @description We have to modify the children (Option component) to have an 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 value,\n isSearching,\n selectOpened: expanded,\n focusedSelectItem,\n shouldClick,\n addBtnRef\n };\n\n if (isAsync) {\n const asyncSearch = search?.async;\n\n if (asyncSearch?.errorLabel) {\n return (\n <li className={classes[\"async-status\"]}>\n {asyncSearch.errorLabel}\n {asyncSearch.onRetry && (\n <button\n type=\"button\"\n className={classes[\"retry-button\"]}\n onClick={asyncSearch.onRetry}\n >\n Retry\n </button>\n )}\n </li>\n );\n }\n\n if (filter.length < asyncMinSearchLength) {\n return (\n <li className={classes[\"async-status\"]}>{asyncSearch?.idleLabel ?? \"Type to search\"}</li>\n );\n }\n\n if (asyncBusy) {\n /* Paging (T4): once a page has already been rendered, a subsequent `loading` (fetching\n * the next page) must append a \"loading more\" row rather than replace the list — that\n * full-list-replace behavior is reserved for the initial/new-query loading state above. */\n if (canPaginate && React.Children.count(children) > 0) {\n return [\n ...renderChildOptions(children, optionProps),\n <li\n key=\"__select-load-more-status__\"\n data-testid=\"select-load-more-status\"\n className={classes[\"async-status\"]}\n >\n <Spinner size={16} />\n </li>\n ];\n }\n\n return (\n <li className={classes[\"async-status\"]}>\n <Spinner size={20} />\n </li>\n );\n }\n\n if (React.Children.count(children) === 0) {\n return <li className={classes[\"no-results\"]}>{noResultsLabel}</li>;\n }\n\n return renderChildOptions(children, optionProps);\n }\n\n if (isSearching || filter !== \"\") {\n const filteredChildren = React.Children.toArray(children).filter(child => {\n const childElement = child as React.ReactElement;\n const innerChildren = childElement.props.children;\n\n const childText = Array.isArray(innerChildren)\n ? innerChildren.map(String).join(\"\")\n : String(innerChildren);\n return childText.toLowerCase().includes(filter.toLowerCase());\n });\n\n const internalChildren = renderChildOptions(filteredChildren as ReactElement[], optionProps);\n\n if (internalChildren.length === 0) {\n return <li className={classes[\"no-results\"]}>{noResultsLabel}</li>;\n }\n\n return renderChildOptions(filteredChildren as ReactElement[], optionProps);\n }\n\n return renderChildOptions(children, optionProps);\n };\n\n const getAsyncStatusMessage = () => {\n const asyncSearch = search?.async;\n if (!asyncSearch) {\n return \"\";\n }\n\n if (asyncSearch.errorLabel) {\n return asyncSearch.errorLabel;\n }\n\n if (filter.length < asyncMinSearchLength) {\n return asyncSearch.idleLabel ?? \"Type to search\";\n }\n\n if (asyncBusy) {\n return \"Loading\";\n }\n\n const resultsCount = React.Children.count(children);\n return resultsCount === 0 ? noResultsLabel : `${resultsCount} 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 nativeOnChangeHandler = (event: React.ChangeEvent<HTMLSelectElement>) => {\n onChange?.(event);\n };\n\n useEffect(() => {\n if (expanded) {\n setFocusedSelectItem(0);\n setShouldFocusButtonAfterClose(true);\n }\n\n if (!expanded && customSelectButtonRef.current && shouldFocusButtonAfterClose) {\n customSelectButtonRef.current.focus();\n setShouldFocusButtonAfterClose(false);\n }\n }, [expanded, customSelectButtonRef.current, shouldFocusButtonAfterClose]);\n\n useEffect(() => {\n syncDisplayValue(value);\n }, [value, children, selectedOption]);\n\n /** Paging (T4): observes a sentinel rendered after the last option and calls `onLoadMore` once\n * per bottom-reach while `hasMore` is true. Guarded (via `loadMoreFiredRef`) against firing\n * again for the same reach-end, and (via `asyncBusyRef`) against firing while a page is already\n * loading. No-op — no observer, no calls — whenever `onLoadMore` is omitted or `hasMore` is\n * false, which also covers the sentinel not being rendered/collapsed. */\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 const myElementRef = useRef<HTMLDivElement>(null);\n\n useClickOutside(myElementRef, () => {\n if (!expanded) {\n return;\n }\n setExpanded(false);\n setListPosition(Position.Below);\n setOpacity(0);\n }, [expanded]);\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 /** 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 <div ref={myElementRef} className={`${classes[\"root\"]}${rootClassNames}`}>\n <select\n {...omitProps(rest, /^data-/)}\n tabIndex={-1}\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 button/options, adding role/tabIndex would create a spurious tab stop\n {...pickProps(rest, /^data-/)}\n ref={containerReference}\n onKeyDown={onArrowNavigation}\n className={`custom-select ${classes.select} ${additionalClasses.join(\" \")}`}\n >\n {searchVisible && renderSearch()}\n <button // NOSONAR(S6819) no semantic equivalent: <input list>/<select multiple> can't host the search input, add-new button, status icon or custom option markup, and <input> can't contain the trigger's child elements. role=\"combobox\" follows the ARIA APG select-only combobox pattern and is what allows aria-invalid here.\n {...selectButtonProps}\n onClick={() => {\n setExpanded(isReadOnlyView || rest[\"data-readonlyview\"] ? false : !expanded);\n }}\n ref={customSelectButtonRef}\n type=\"button\"\n name={name}\n className={`${classes[\"custom-select\"]} ${additionalClasses.join(\" \")} `}\n style={{ display: expanded && searchVisible ? \"none\" : \"block\" }}\n disabled={disabled}\n /* ARIA 1.2 combobox pattern: the trigger owns the popup state, the invalid state and controls the listbox. */\n role=\"combobox\"\n aria-disabled={disabled}\n aria-invalid={error}\n aria-expanded={expanded}\n aria-controls={listboxId}\n aria-haspopup=\"listbox\"\n aria-labelledby={labeledBy}\n aria-describedby={describedBy}\n >\n <div data-display className={classes[\"selected\"]}>\n {!value && placeholder && <span className={classes[\"placeholder\"]}>{placeholder}</span>}\n {value?.length > 0 && <span data-display-inner>{display}</span>}\n <RequiredSign className={classes[\"required\"]} />\n </div>\n <div className={classes[\"status\"]}>\n <FormStatusIndicator isReadOnlyView={isReadOnlyView} success={success} error={error}>\n {renderChevronIcon()}\n </FormStatusIndicator>\n </div>\n </button>\n <div className=\"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 bottom: listPosition === Position.Above ? \"2.85rem\" : \"initial\",\n marginTop: \"4px\"\n }}\n >\n <ul // NOSONAR(S6819) native <select> can't host search, add-new or custom option markup\n ref={listRef}\n id={listboxId}\n className={addNewBtnOptionsContainerClassName}\n role=\"listbox\" // NOSONAR(S6842) required by the ARIA listbox pattern\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=\"select-load-more-sentinel\"\n className={classes[\"load-more-sentinel\"]}\n />\n )}\n </ul>\n {isAsync && (\n <span role=\"status\" aria-live=\"polite\" className={readyclasses[\"sr-only\"]}>\n {getAsyncStatusMessage()}\n </span>\n )}\n {renderAddNew()}\n </div>\n </div>\n </div>\n </div>\n );\n};\nexport const Select = withReadOnly(React.forwardRef(SelectComponent));\n"],"names":["renderChildOptions","internalChildren","optionProps","React","Children","map","child","index","cloneElement","onFocusChange","onOptionSelect","isSelected","props","value","isSearching","selectOpened","childIndex","hasFocus","focusedSelectItem","shouldClick","isAddBtnFocused","addBtnRef","current","document","activeElement","Select","withReadOnly","forwardRef","children","name","disabled","labeledBy","placeholder","describedBy","selectButtonProps","className","error","success","clearLabel","noResultsLabel","onChange","addNew","search","isReadOnlyView","selectedOption","rest","ref","listboxId","useRef","generateID","expanded","setExpanded","useState","display","setDisplay","containerReference","optionListReference","setFocusedSelectItem","setShouldClick","shouldFocusButtonAfterClose","setShouldFocusButtonAfterClose","optionsCount","count","listRef","loadMoreSentinelRef","loadMoreFiredRef","asyncBusyRef","filter","renderSearch","searchInputRef","setIsSearching","searchThreshold","searchVisible","isAsync","isAsyncPending","asyncMinSearchLength","useSearch","searchInputClassName","classes","addNewBtnOptionsContainerClassName","renderAddNew","useAddNewBtn","inlineClassNames","useInlineEditing","rootClassNames","nativeSelect","createRef","onOptionChangeHandler","optionElement","getAttribute","dataset","dispatchEvent","Event","bubbles","handleOptionFocusChange","handleOptionSelect","optionRef","customSelectButtonRef","onArrowNavigation","useArrowNavigation","childrenCount","renderThreshold","listPosition","opacity","optionsListMaxHeight","setListPosition","setOpacity","useSelectPositionList","asyncBusy","_a","async","loading","asyncOnLoadMore","_b","onLoadMore","canPaginate","showLoadMoreSentinel","_c","hasMore","_d","errorLabel","length","useEffect","focus","val","hasMatchingChild","forEach","label","syncDisplayValue","sentinel","IntersectionObserver","observer","entry","isIntersecting","root","threshold","observe","disconnect","myElementRef","useClickOutside","Position","Below","additionalClasses","push","createElement","omitProps","tabIndex","event","readyclasses","pickProps","onKeyDown","select","join","onClick","type","style","role","RequiredSign","FormStatusIndicator","Icon","icon","Icons","ChevronUp","ChevronDown","maxHeight","wrapper","pointerEvents","bottom","Above","marginTop","id","list","asyncSearch","onRetry","idleLabel","key","Spinner","size","filteredChildren","toArray","innerChildren","Array","isArray","String","toLowerCase","includes","renderOptions","resultsCount","getAsyncStatusMessage"],"mappings":"uyBAoDMA,EAAqB,CAACC,EAAkCC,IACrDC,EAAMC,SAASC,IAAIJ,EAAkB,CAACK,EAAOC,IAC3CJ,EAAMK,aAAaF,EAAO,CAC/BG,cAAeP,EAAYO,cAC3BC,eAAgBR,EAAYQ,eAC5BC,WAAYL,EAAMM,MAAMC,QAAUX,EAAYW,MAC9CC,YAAaZ,EAAYY,YACzBC,aAAcb,EAAYa,aAC1BC,WAAYT,EACZU,SAAUf,EAAYgB,oBAAsBX,EAC5CY,YAAajB,EAAYiB,YACzBC,gBAAiBlB,EAAYmB,UAAUC,UAAYC,SAASC,iBA0crDC,EAASC,EAAAA,aAAavB,EAAMwB,WArc+C,EAEpFC,WACAC,OACAC,YAAW,EACXC,YACAC,cACAC,cACAC,oBACAC,YACAC,SAAQ,EACRC,WAAU,EACVxB,QACAyB,aAAa,kBACbC,iBAAiB,mBACjBC,WACAC,SACAC,SACAC,iBACAC,oBACGC,GAELC,iBAEA,MACMC,EAAY,GADDC,EAAAA,OAAOC,EAAAA,WAAW,KACL3B,mBACvB4B,EAAUC,GAAeC,EAAAA,UAAS,IAClC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,MAAMgB,SAKzC,OAHkByJ,MAAMC,QAAQF,GAC5BA,EAAc/K,IAAIkL,QAAQ/B,KAAK,IAC/B+B,OAAOH,IACMI,cAAcC,SAAStH,GAAOqH,iBAKjD,OAAgC,IAFPxL,EAAmBkL,EAAoChL,GAE3DuH,uBACX,KAAA,CAAGtF,UAAW2C,UAAQ,eAAgBvC,GAGzCvC,EAAmBkL,EAAoChL,EAChE,CAEA,OAAOF,EAAmB4B,EAAU1B,IA0LzBwL,GACAtE,IACCjH,EAAA6I,cAAC,KAAA,CACClG,IAAKkB,GACL,cAAY,OACZ,cAAY,4BACZ7B,UAAW2C,EAAAA,QAAQ,yBAIxBL,IACCtE,EAAA6I,cAAC,OAAA,CAAKY,KAAK,SAAS,YAAU,SAASzH,UAAWiH,EAAAA,QAAa,YAlM7C,MAC5B,MAAMwB,EAAc,MAAAlI,OAAA,EAAAA,EAAQoE,MAC5B,IAAK8D,EACH,MAAO,GAGT,GAAIA,EAAYpD,WACd,OAAOoD,EAAYpD,WAGrB,GAAIrD,GAAOsD,OAAS9C,GAClB,OAAOiG,EAAYE,WAAa,iBAGlC,GAAIlE,GACF,MAAO,UAGT,MAAM+E,EAAexL,EAAMC,SAAS0D,MAAMlC,GAC1C,OAAwB,IAAjB+J,EAAqBpJ,EAAiB,GAAGoJ,aAgLnCC,IAGJ5G"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import selectClasses from "./Select.module.scss.es.js";
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useRef, useState, createRef, useEffect } from "react";
|
|
3
3
|
import { useClickOutside } from "../../../../hooks/useClickOutside.es.js";
|
|
4
4
|
import readyclasses from "../../../../readyclasses.module.scss.es.js";
|
|
5
|
-
import {
|
|
5
|
+
import { generateID, omitProps, pickProps } from "../../../../util/helper.es.js";
|
|
6
6
|
import { Icon, Icons } from "../../../Icon/Icon.es.js";
|
|
7
|
+
import { Spinner } from "../../../Spinner/Spinner.es.js";
|
|
7
8
|
import { Position } from "../Select.interfaces.es.js";
|
|
8
9
|
import { useSelectPositionList } from "../useSelectPositionList.es.js";
|
|
9
10
|
import { useAddNewBtn } from "../useAddNewBtn.es.js";
|
|
@@ -13,6 +14,21 @@ import { withReadOnly } from "../../../withReadOnly.es.js";
|
|
|
13
14
|
import { RequiredSign } from "../../../RequiredSign/RequiredSign.es.js";
|
|
14
15
|
import { FormStatusIndicator } from "../../FormStatusIndicator/FormStatusIndicator.es.js";
|
|
15
16
|
import { useInlineEditing } from "../../../InlineEditing/InlineEditingContext.es.js";
|
|
17
|
+
const renderChildOptions = (internalChildren, optionProps) => {
|
|
18
|
+
return React.Children.map(internalChildren, (child, index) => {
|
|
19
|
+
return React.cloneElement(child, {
|
|
20
|
+
onFocusChange: optionProps.onFocusChange,
|
|
21
|
+
onOptionSelect: optionProps.onOptionSelect,
|
|
22
|
+
isSelected: child.props.value === optionProps.value,
|
|
23
|
+
isSearching: optionProps.isSearching,
|
|
24
|
+
selectOpened: optionProps.selectOpened,
|
|
25
|
+
childIndex: index,
|
|
26
|
+
hasFocus: optionProps.focusedSelectItem === index,
|
|
27
|
+
shouldClick: optionProps.shouldClick,
|
|
28
|
+
isAddBtnFocused: optionProps.addBtnRef.current === document.activeElement
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
};
|
|
16
32
|
const SelectComponent = ({
|
|
17
33
|
children,
|
|
18
34
|
name,
|
|
@@ -31,8 +47,12 @@ const SelectComponent = ({
|
|
|
31
47
|
addNew,
|
|
32
48
|
search,
|
|
33
49
|
isReadOnlyView,
|
|
50
|
+
selectedOption,
|
|
34
51
|
...rest
|
|
35
52
|
}, ref) => {
|
|
53
|
+
var _a, _b, _c, _d;
|
|
54
|
+
const selectId = useRef(generateID(20));
|
|
55
|
+
const listboxId = `${selectId.current}_listbox`;
|
|
36
56
|
const [expanded, setExpanded] = useState(false);
|
|
37
57
|
const [display, setDisplay] = useState("");
|
|
38
58
|
const containerReference = useRef(null);
|
|
@@ -41,6 +61,10 @@ const SelectComponent = ({
|
|
|
41
61
|
const [shouldClick, setShouldClick] = useState(false);
|
|
42
62
|
const [shouldFocusButtonAfterClose, setShouldFocusButtonAfterClose] = useState(false);
|
|
43
63
|
const optionsCount = React.Children.count(children);
|
|
64
|
+
const listRef = useRef(null);
|
|
65
|
+
const loadMoreSentinelRef = useRef(null);
|
|
66
|
+
const loadMoreFiredRef = useRef(false);
|
|
67
|
+
const asyncBusyRef = useRef(false);
|
|
44
68
|
const {
|
|
45
69
|
filter,
|
|
46
70
|
isSearching,
|
|
@@ -48,7 +72,10 @@ const SelectComponent = ({
|
|
|
48
72
|
searchInputRef,
|
|
49
73
|
setIsSearching,
|
|
50
74
|
searchThreshold,
|
|
51
|
-
searchVisible
|
|
75
|
+
searchVisible,
|
|
76
|
+
isAsync,
|
|
77
|
+
isAsyncPending,
|
|
78
|
+
asyncMinSearchLength
|
|
52
79
|
} = useSearch({
|
|
53
80
|
expanded,
|
|
54
81
|
search,
|
|
@@ -67,12 +94,22 @@ const SelectComponent = ({
|
|
|
67
94
|
const rootClassNames = inlineClassNames ? ` ${inlineClassNames}` : "";
|
|
68
95
|
const nativeSelect = ref || createRef();
|
|
69
96
|
const onOptionChangeHandler = (optionElement) => {
|
|
97
|
+
if ((optionElement == null ? void 0 : optionElement.getAttribute("aria-disabled")) === "true") {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
70
100
|
if (nativeSelect.current && optionElement) {
|
|
71
|
-
nativeSelect.current.value = optionElement.
|
|
101
|
+
nativeSelect.current.value = optionElement.dataset.value;
|
|
72
102
|
nativeSelect.current.dispatchEvent(new Event("change", { bubbles: true }));
|
|
73
103
|
}
|
|
74
104
|
setExpanded(false);
|
|
75
105
|
};
|
|
106
|
+
const handleOptionFocusChange = (childIndex) => {
|
|
107
|
+
setFocusedSelectItem(childIndex);
|
|
108
|
+
};
|
|
109
|
+
const handleOptionSelect = (optionRef) => {
|
|
110
|
+
onOptionChangeHandler(optionRef.current);
|
|
111
|
+
setShouldClick(false);
|
|
112
|
+
};
|
|
76
113
|
const customSelectButtonRef = useRef(null);
|
|
77
114
|
const { onArrowNavigation } = useArrowNavigation({
|
|
78
115
|
expanded,
|
|
@@ -90,13 +127,76 @@ const SelectComponent = ({
|
|
|
90
127
|
});
|
|
91
128
|
const { listPosition, opacity, optionsListMaxHeight, setListPosition, setOpacity } = useSelectPositionList({ expanded, optionListReference, containerReference, addBtnRef });
|
|
92
129
|
const syncDisplayValue = (val) => {
|
|
130
|
+
let hasMatchingChild = false;
|
|
93
131
|
React.Children.forEach(children, (child) => {
|
|
94
132
|
if (child.props.value === val) {
|
|
95
133
|
setDisplay(child.props.children);
|
|
134
|
+
hasMatchingChild = true;
|
|
96
135
|
}
|
|
97
136
|
});
|
|
137
|
+
if (hasMatchingChild) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (selectedOption && selectedOption.value === val) {
|
|
141
|
+
setDisplay(selectedOption.label);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
setDisplay("");
|
|
98
145
|
};
|
|
146
|
+
const asyncBusy = !!((_a = search == null ? void 0 : search.async) == null ? void 0 : _a.loading) || isAsyncPending;
|
|
147
|
+
asyncBusyRef.current = asyncBusy;
|
|
148
|
+
const asyncOnLoadMore = (_b = search == null ? void 0 : search.async) == null ? void 0 : _b.onLoadMore;
|
|
149
|
+
const canPaginate = isAsync && !!asyncOnLoadMore;
|
|
150
|
+
const showLoadMoreSentinel = canPaginate && !!((_c = search == null ? void 0 : search.async) == null ? void 0 : _c.hasMore) && !((_d = search == null ? void 0 : search.async) == null ? void 0 : _d.errorLabel) && filter.length >= asyncMinSearchLength && React.Children.count(children) > 0;
|
|
99
151
|
const renderOptions = () => {
|
|
152
|
+
const optionProps = {
|
|
153
|
+
onFocusChange: handleOptionFocusChange,
|
|
154
|
+
onOptionSelect: handleOptionSelect,
|
|
155
|
+
value,
|
|
156
|
+
isSearching,
|
|
157
|
+
selectOpened: expanded,
|
|
158
|
+
focusedSelectItem,
|
|
159
|
+
shouldClick,
|
|
160
|
+
addBtnRef
|
|
161
|
+
};
|
|
162
|
+
if (isAsync) {
|
|
163
|
+
const asyncSearch = search == null ? void 0 : search.async;
|
|
164
|
+
if (asyncSearch == null ? void 0 : asyncSearch.errorLabel) {
|
|
165
|
+
return /* @__PURE__ */ React.createElement("li", { className: selectClasses["async-status"] }, asyncSearch.errorLabel, asyncSearch.onRetry && /* @__PURE__ */ React.createElement(
|
|
166
|
+
"button",
|
|
167
|
+
{
|
|
168
|
+
type: "button",
|
|
169
|
+
className: selectClasses["retry-button"],
|
|
170
|
+
onClick: asyncSearch.onRetry
|
|
171
|
+
},
|
|
172
|
+
"Retry"
|
|
173
|
+
));
|
|
174
|
+
}
|
|
175
|
+
if (filter.length < asyncMinSearchLength) {
|
|
176
|
+
return /* @__PURE__ */ React.createElement("li", { className: selectClasses["async-status"] }, (asyncSearch == null ? void 0 : asyncSearch.idleLabel) ?? "Type to search");
|
|
177
|
+
}
|
|
178
|
+
if (asyncBusy) {
|
|
179
|
+
if (canPaginate && React.Children.count(children) > 0) {
|
|
180
|
+
return [
|
|
181
|
+
...renderChildOptions(children, optionProps),
|
|
182
|
+
/* @__PURE__ */ React.createElement(
|
|
183
|
+
"li",
|
|
184
|
+
{
|
|
185
|
+
key: "__select-load-more-status__",
|
|
186
|
+
"data-testid": "select-load-more-status",
|
|
187
|
+
className: selectClasses["async-status"]
|
|
188
|
+
},
|
|
189
|
+
/* @__PURE__ */ React.createElement(Spinner, { size: 16 })
|
|
190
|
+
)
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
return /* @__PURE__ */ React.createElement("li", { className: selectClasses["async-status"] }, /* @__PURE__ */ React.createElement(Spinner, { size: 20 }));
|
|
194
|
+
}
|
|
195
|
+
if (React.Children.count(children) === 0) {
|
|
196
|
+
return /* @__PURE__ */ React.createElement("li", { className: selectClasses["no-results"] }, noResultsLabel);
|
|
197
|
+
}
|
|
198
|
+
return renderChildOptions(children, optionProps);
|
|
199
|
+
}
|
|
100
200
|
if (isSearching || filter !== "") {
|
|
101
201
|
const filteredChildren = React.Children.toArray(children).filter((child) => {
|
|
102
202
|
const childElement = child;
|
|
@@ -104,33 +204,30 @@ const SelectComponent = ({
|
|
|
104
204
|
const childText = Array.isArray(innerChildren) ? innerChildren.map(String).join("") : String(innerChildren);
|
|
105
205
|
return childText.toLowerCase().includes(filter.toLowerCase());
|
|
106
206
|
});
|
|
107
|
-
const internalChildren =
|
|
207
|
+
const internalChildren = renderChildOptions(filteredChildren, optionProps);
|
|
108
208
|
if (internalChildren.length === 0) {
|
|
109
209
|
return /* @__PURE__ */ React.createElement("li", { className: selectClasses["no-results"] }, noResultsLabel);
|
|
110
210
|
}
|
|
111
|
-
return
|
|
211
|
+
return renderChildOptions(filteredChildren, optionProps);
|
|
112
212
|
}
|
|
113
|
-
return
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
hasFocus: focusedSelectItem === index,
|
|
129
|
-
shouldClick,
|
|
130
|
-
isAddBtnFocused: addBtnRef.current === document.activeElement
|
|
131
|
-
});
|
|
132
|
-
});
|
|
213
|
+
return renderChildOptions(children, optionProps);
|
|
214
|
+
};
|
|
215
|
+
const getAsyncStatusMessage = () => {
|
|
216
|
+
const asyncSearch = search == null ? void 0 : search.async;
|
|
217
|
+
if (!asyncSearch) {
|
|
218
|
+
return "";
|
|
219
|
+
}
|
|
220
|
+
if (asyncSearch.errorLabel) {
|
|
221
|
+
return asyncSearch.errorLabel;
|
|
222
|
+
}
|
|
223
|
+
if (filter.length < asyncMinSearchLength) {
|
|
224
|
+
return asyncSearch.idleLabel ?? "Type to search";
|
|
225
|
+
}
|
|
226
|
+
if (asyncBusy) {
|
|
227
|
+
return "Loading";
|
|
133
228
|
}
|
|
229
|
+
const resultsCount = React.Children.count(children);
|
|
230
|
+
return resultsCount === 0 ? noResultsLabel : `${resultsCount} results`;
|
|
134
231
|
};
|
|
135
232
|
const renderChevronIcon = () => {
|
|
136
233
|
return expanded ? /* @__PURE__ */ React.createElement(Icon, { className: selectClasses["chevron-icon"], icon: Icons.ChevronUp }) : /* @__PURE__ */ React.createElement(Icon, { className: selectClasses["chevron-icon"], icon: Icons.ChevronDown });
|
|
@@ -150,7 +247,33 @@ const SelectComponent = ({
|
|
|
150
247
|
}, [expanded, customSelectButtonRef.current, shouldFocusButtonAfterClose]);
|
|
151
248
|
useEffect(() => {
|
|
152
249
|
syncDisplayValue(value);
|
|
153
|
-
}, [value, children]);
|
|
250
|
+
}, [value, children, selectedOption]);
|
|
251
|
+
useEffect(() => {
|
|
252
|
+
if (!showLoadMoreSentinel || !expanded) {
|
|
253
|
+
loadMoreFiredRef.current = false;
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const sentinel = loadMoreSentinelRef.current;
|
|
257
|
+
if (!sentinel || typeof IntersectionObserver === "undefined") {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const observer = new IntersectionObserver(
|
|
261
|
+
([entry]) => {
|
|
262
|
+
if (!entry.isIntersecting) {
|
|
263
|
+
loadMoreFiredRef.current = false;
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (loadMoreFiredRef.current || asyncBusyRef.current) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
loadMoreFiredRef.current = true;
|
|
270
|
+
asyncOnLoadMore == null ? void 0 : asyncOnLoadMore();
|
|
271
|
+
},
|
|
272
|
+
{ root: listRef.current, threshold: 0 }
|
|
273
|
+
);
|
|
274
|
+
observer.observe(sentinel);
|
|
275
|
+
return () => observer.disconnect();
|
|
276
|
+
}, [showLoadMoreSentinel, expanded, asyncOnLoadMore]);
|
|
154
277
|
const myElementRef = useRef(null);
|
|
155
278
|
useClickOutside(myElementRef, () => {
|
|
156
279
|
if (!expanded) {
|
|
@@ -169,7 +292,7 @@ const SelectComponent = ({
|
|
|
169
292
|
return /* @__PURE__ */ React.createElement("div", { ref: myElementRef, className: `${selectClasses["root"]}${rootClassNames}` }, /* @__PURE__ */ React.createElement(
|
|
170
293
|
"select",
|
|
171
294
|
{
|
|
172
|
-
...
|
|
295
|
+
...omitProps(rest, /^data-/),
|
|
173
296
|
tabIndex: -1,
|
|
174
297
|
"aria-hidden": "true",
|
|
175
298
|
ref: nativeSelect,
|
|
@@ -182,7 +305,7 @@ const SelectComponent = ({
|
|
|
182
305
|
), /* @__PURE__ */ React.createElement(
|
|
183
306
|
"div",
|
|
184
307
|
{
|
|
185
|
-
...
|
|
308
|
+
...pickProps(rest, /^data-/),
|
|
186
309
|
ref: containerReference,
|
|
187
310
|
onKeyDown: onArrowNavigation,
|
|
188
311
|
className: `custom-select ${selectClasses.select} ${additionalClasses.join(" ")}`
|
|
@@ -201,9 +324,11 @@ const SelectComponent = ({
|
|
|
201
324
|
className: `${selectClasses["custom-select"]} ${additionalClasses.join(" ")} `,
|
|
202
325
|
style: { display: expanded && searchVisible ? "none" : "block" },
|
|
203
326
|
disabled,
|
|
327
|
+
role: "combobox",
|
|
204
328
|
"aria-disabled": disabled,
|
|
205
329
|
"aria-invalid": error,
|
|
206
330
|
"aria-expanded": expanded,
|
|
331
|
+
"aria-controls": listboxId,
|
|
207
332
|
"aria-haspopup": "listbox",
|
|
208
333
|
"aria-labelledby": labeledBy,
|
|
209
334
|
"aria-describedby": describedBy
|
|
@@ -228,12 +353,25 @@ const SelectComponent = ({
|
|
|
228
353
|
/* @__PURE__ */ React.createElement(
|
|
229
354
|
"ul",
|
|
230
355
|
{
|
|
356
|
+
ref: listRef,
|
|
357
|
+
id: listboxId,
|
|
231
358
|
className: addNewBtnOptionsContainerClassName,
|
|
232
359
|
role: "listbox",
|
|
233
|
-
style: { maxHeight: optionsListMaxHeight.list }
|
|
360
|
+
style: { maxHeight: optionsListMaxHeight.list },
|
|
361
|
+
"aria-busy": isAsync ? asyncBusy : void 0
|
|
234
362
|
},
|
|
235
|
-
renderOptions()
|
|
363
|
+
renderOptions(),
|
|
364
|
+
showLoadMoreSentinel && /* @__PURE__ */ React.createElement(
|
|
365
|
+
"li",
|
|
366
|
+
{
|
|
367
|
+
ref: loadMoreSentinelRef,
|
|
368
|
+
"aria-hidden": "true",
|
|
369
|
+
"data-testid": "select-load-more-sentinel",
|
|
370
|
+
className: selectClasses["load-more-sentinel"]
|
|
371
|
+
}
|
|
372
|
+
)
|
|
236
373
|
),
|
|
374
|
+
isAsync && /* @__PURE__ */ React.createElement("span", { role: "status", "aria-live": "polite", className: readyclasses["sr-only"] }, getAsyncStatusMessage()),
|
|
237
375
|
renderAddNew()
|
|
238
376
|
))
|
|
239
377
|
));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.es.js","sources":["../../../../../src/components/Form/Select/SingleSelect/Select.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 \"./Select.module.scss\";\n\nimport React, {\n createRef,\n ForwardRefRenderFunction,\n ReactElement,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { useClickOutside } from \"../../../../hooks/useClickOutside\";\nimport readyclasses from \"../../../../readyclasses.module.scss\";\nimport { filterProps } from \"../../../../util/helper\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { Position, SingleSelectProps } from \"../Select.interfaces\";\nimport { useSelectPositionList } from \"../useSelectPositionList\";\nimport { useAddNewBtn } from \"../useAddNewBtn\";\nimport { useSearch } from \"./useSearch\";\nimport { useArrowNavigation } from \"./useArrowNavigation\";\nimport { withReadOnly } from \"../../../withReadOnly\";\nimport { RequiredSign } from \"../../../RequiredSign/RequiredSign\";\nimport { FormStatusIndicator } from \"../../FormStatusIndicator/FormStatusIndicator\";\nimport { useInlineEditing } from \"../../../InlineEditing/InlineEditingContext\";\n\nconst SelectComponent: ForwardRefRenderFunction<HTMLSelectElement, SingleSelectProps> = (\n {\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,\n isReadOnlyView,\n ...rest\n }: SingleSelectProps,\n ref\n) => {\n const [expanded, setExpanded] = useState(false);\n const [display, setDisplay] = useState(\"\");\n const containerReference = useRef<HTMLDivElement>(null);\n const optionListReference = useRef<HTMLDivElement>(null);\n const [focusedSelectItem, setFocusedSelectItem] = useState(-1);\n const [shouldClick, setShouldClick] = useState(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 optionsCount = React.Children.count(children);\n const {\n filter,\n isSearching,\n renderSearch,\n searchInputRef,\n setIsSearching,\n searchThreshold,\n searchVisible\n } = useSearch({\n expanded,\n search,\n searchInputClassName: classes[\"select-search\"],\n optionsCount,\n setFocusedSelectItem\n });\n const { addBtnRef, addNewBtnOptionsContainerClassName, renderAddNew } = useAddNewBtn({\n addNew,\n filter,\n focusedSelectItem,\n optionsCount,\n searchInputRef\n });\n\n const { inlineClassNames } = useInlineEditing();\n const rootClassNames = inlineClassNames ? ` ${inlineClassNames}` : \"\";\n\n const nativeSelect = (ref as React.RefObject<HTMLSelectElement>) || createRef();\n\n const onOptionChangeHandler = (optionElement: HTMLElement | null) => {\n if (nativeSelect.current && optionElement) {\n nativeSelect.current.value = optionElement.getAttribute(\"data-value\")!;\n nativeSelect.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n\n setExpanded(false);\n };\n\n const customSelectButtonRef = useRef<HTMLButtonElement>(null);\n const { onArrowNavigation } = useArrowNavigation({\n expanded,\n setExpanded,\n isSearching,\n setIsSearching,\n setFocusedSelectItem,\n onOptionChangeHandler,\n childrenCount: optionsCount,\n setShouldClick,\n searchInputRef,\n addBtnRef,\n renderThreshold: searchThreshold,\n isReadOnlyView: isReadOnlyView || !!rest[\"data-readonlyview\"]\n });\n\n const { listPosition, opacity, optionsListMaxHeight, setListPosition, setOpacity } =\n useSelectPositionList({ expanded, optionListReference, containerReference, addBtnRef });\n\n const syncDisplayValue = (val: string) => {\n React.Children.forEach(children, child => {\n if (child.props.value === val) {\n setDisplay(child.props.children);\n }\n });\n };\n\n /**\n * @description We have to modify the children (Option component) to have an 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 if (isSearching || filter !== \"\") {\n const filteredChildren = React.Children.toArray(children).filter(child => {\n const childElement = child as React.ReactElement;\n const innerChildren = childElement.props.children;\n\n const childText = Array.isArray(innerChildren)\n ? innerChildren.map(String).join(\"\")\n : String(innerChildren);\n return childText.toLowerCase().includes(filter.toLowerCase());\n });\n\n const internalChildren = _internalRenderChildren(filteredChildren as ReactElement[]);\n\n if (internalChildren.length === 0) {\n return <li className={classes[\"no-results\"]}>{noResultsLabel}</li>;\n }\n\n return _internalRenderChildren(filteredChildren as ReactElement[]);\n }\n\n return _internalRenderChildren(children);\n\n function _internalRenderChildren(internalChildren: ReactElement[]) {\n return React.Children.map(internalChildren, (child, index) => {\n return React.cloneElement(child, {\n onFocusChange: (childIndex: number) => {\n setFocusedSelectItem(childIndex);\n },\n onOptionSelect: (optionRef: React.RefObject<HTMLLIElement>) => {\n onOptionChangeHandler(optionRef.current);\n setShouldClick(false);\n },\n isSelected: child.props.value === value,\n isSearching: isSearching,\n selectOpened: expanded,\n childIndex: index,\n hasFocus: focusedSelectItem === index,\n shouldClick: shouldClick,\n isAddBtnFocused: addBtnRef.current === document.activeElement\n });\n });\n }\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 nativeOnChangeHandler = (event: React.ChangeEvent<HTMLSelectElement>) => {\n onChange?.(event);\n };\n\n useEffect(() => {\n if (expanded) {\n setFocusedSelectItem(0);\n setShouldFocusButtonAfterClose(true);\n }\n\n if (!expanded && customSelectButtonRef.current && shouldFocusButtonAfterClose) {\n customSelectButtonRef.current.focus();\n setShouldFocusButtonAfterClose(false);\n }\n }, [expanded, customSelectButtonRef.current, shouldFocusButtonAfterClose]);\n\n useEffect(() => {\n syncDisplayValue(value);\n }, [value, children]);\n\n const myElementRef = useRef<HTMLDivElement>(null);\n\n useClickOutside(myElementRef, () => {\n if (!expanded) {\n return;\n }\n setExpanded(false);\n setListPosition(Position.Below);\n setOpacity(0);\n }, [expanded]);\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 /** 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 <div ref={myElementRef} className={`${classes[\"root\"]}${rootClassNames}`}>\n <select\n {...filterProps(rest, /^data-/, false)}\n tabIndex={-1}\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\n {...filterProps(rest, /^data-/)}\n ref={containerReference}\n onKeyDown={onArrowNavigation}\n className={`custom-select ${classes.select} ${additionalClasses.join(\" \")}`}\n >\n {searchVisible && renderSearch()}\n <button\n {...selectButtonProps}\n onClick={() => {\n setExpanded(isReadOnlyView || rest[\"data-readonlyview\"] ? false : !expanded);\n }}\n ref={customSelectButtonRef}\n type=\"button\"\n name={name}\n className={`${classes[\"custom-select\"]} ${additionalClasses.join(\" \")} `}\n style={{ display: expanded && searchVisible ? \"none\" : \"block\" }}\n disabled={disabled}\n aria-disabled={disabled}\n aria-invalid={error}\n aria-expanded={expanded}\n aria-haspopup=\"listbox\"\n aria-labelledby={labeledBy}\n aria-describedby={describedBy}\n >\n <div data-display className={classes[\"selected\"]}>\n {!value && placeholder && <span className={classes[\"placeholder\"]}>{placeholder}</span>}\n {value?.length > 0 && <span data-display-inner>{display}</span>}\n <RequiredSign className={classes[\"required\"]} />\n </div>\n <div className={classes[\"status\"]}>\n <FormStatusIndicator isReadOnlyView={isReadOnlyView} success={success} error={error}>\n {renderChevronIcon()}\n </FormStatusIndicator>\n </div>\n </button>\n <div className=\"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 bottom: listPosition === Position.Above ? \"2.85rem\" : \"initial\",\n marginTop: \"4px\"\n }}\n >\n <ul\n className={addNewBtnOptionsContainerClassName}\n role=\"listbox\"\n style={{ maxHeight: optionsListMaxHeight.list }}\n >\n {renderOptions()}\n </ul>\n {renderAddNew()}\n </div>\n </div>\n </div>\n </div>\n );\n};\nexport const Select = withReadOnly(React.forwardRef(SelectComponent));\n"],"names":["classes"],"mappings":";;;;;;;;;;;;;;;AAwCA,MAAM,kBAAkF,CACtF;AAAA,EACE;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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/Select.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 \"./Select.module.scss\";\n\nimport React, {\n createRef,\n ForwardRefRenderFunction,\n ReactElement,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { useClickOutside } from \"../../../../hooks/useClickOutside\";\nimport readyclasses from \"../../../../readyclasses.module.scss\";\nimport { generateID, omitProps, pickProps } from \"../../../../util/helper\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { Spinner } from \"../../../Spinner/Spinner\";\nimport { Position, SingleSelectProps } from \"../Select.interfaces\";\nimport { useSelectPositionList } from \"../useSelectPositionList\";\nimport { useAddNewBtn } from \"../useAddNewBtn\";\nimport { useSearch } from \"./useSearch\";\nimport { useArrowNavigation } from \"./useArrowNavigation\";\nimport { withReadOnly } from \"../../../withReadOnly\";\nimport { RequiredSign } from \"../../../RequiredSign/RequiredSign\";\nimport { FormStatusIndicator } from \"../../FormStatusIndicator/FormStatusIndicator\";\nimport { useInlineEditing } from \"../../../InlineEditing/InlineEditingContext\";\n\ninterface OptionRenderProps {\n onFocusChange: (childIndex: number) => void;\n onOptionSelect: (optionRef: React.RefObject<HTMLLIElement>) => void;\n value: string;\n isSearching: boolean;\n selectOpened: boolean;\n focusedSelectItem: number;\n shouldClick: boolean;\n addBtnRef: React.RefObject<HTMLButtonElement>;\n}\n\nconst renderChildOptions = (internalChildren: ReactElement[], optionProps: OptionRenderProps) => {\n return React.Children.map(internalChildren, (child, index) => {\n return React.cloneElement(child, {\n onFocusChange: optionProps.onFocusChange,\n onOptionSelect: optionProps.onOptionSelect,\n isSelected: child.props.value === optionProps.value,\n isSearching: optionProps.isSearching,\n selectOpened: optionProps.selectOpened,\n childIndex: index,\n hasFocus: optionProps.focusedSelectItem === index,\n shouldClick: optionProps.shouldClick,\n isAddBtnFocused: optionProps.addBtnRef.current === document.activeElement\n });\n });\n};\n\nconst SelectComponent: ForwardRefRenderFunction<HTMLSelectElement, SingleSelectProps> = (\n {\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,\n isReadOnlyView,\n selectedOption,\n ...rest\n }: SingleSelectProps,\n ref\n) => {\n const selectId = useRef(generateID(20));\n const listboxId = `${selectId.current}_listbox`;\n const [expanded, setExpanded] = useState(false);\n const [display, setDisplay] = useState<React.ReactNode>(\"\");\n const containerReference = useRef<HTMLDivElement>(null);\n const optionListReference = useRef<HTMLDivElement>(null);\n const [focusedSelectItem, setFocusedSelectItem] = useState(-1);\n const [shouldClick, setShouldClick] = useState(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 optionsCount = React.Children.count(children);\n const listRef = useRef<HTMLUListElement>(null);\n const loadMoreSentinelRef = useRef<HTMLLIElement>(null);\n const loadMoreFiredRef = useRef(false);\n const asyncBusyRef = useRef(false);\n const {\n filter,\n isSearching,\n renderSearch,\n searchInputRef,\n setIsSearching,\n searchThreshold,\n searchVisible,\n isAsync,\n isAsyncPending,\n asyncMinSearchLength\n } = useSearch({\n expanded,\n search,\n searchInputClassName: classes[\"select-search\"],\n optionsCount,\n setFocusedSelectItem\n });\n const { addBtnRef, addNewBtnOptionsContainerClassName, renderAddNew } = useAddNewBtn({\n addNew,\n filter,\n focusedSelectItem,\n optionsCount,\n searchInputRef\n });\n\n const { inlineClassNames } = useInlineEditing();\n const rootClassNames = inlineClassNames ? ` ${inlineClassNames}` : \"\";\n\n const nativeSelect = (ref as React.RefObject<HTMLSelectElement>) || 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 nativeSelect.current.value = optionElement.dataset.value!;\n nativeSelect.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n\n setExpanded(false);\n };\n\n const handleOptionFocusChange = (childIndex: number) => {\n setFocusedSelectItem(childIndex);\n };\n\n const handleOptionSelect = (optionRef: React.RefObject<HTMLLIElement>) => {\n onOptionChangeHandler(optionRef.current);\n setShouldClick(false);\n };\n\n const customSelectButtonRef = useRef<HTMLButtonElement>(null);\n const { onArrowNavigation } = useArrowNavigation({\n expanded,\n setExpanded,\n isSearching,\n setIsSearching,\n setFocusedSelectItem,\n onOptionChangeHandler,\n childrenCount: optionsCount,\n setShouldClick,\n searchInputRef,\n addBtnRef,\n renderThreshold: searchThreshold,\n isReadOnlyView: isReadOnlyView || !!rest[\"data-readonlyview\"]\n });\n\n const { listPosition, opacity, optionsListMaxHeight, setListPosition, setOpacity } =\n useSelectPositionList({ expanded, optionListReference, containerReference, addBtnRef });\n\n /** Display resolution order: matching child in `children` → `selectedOption` (async mode\n * fallback for a value that isn't in the currently loaded page) → blank (placeholder shows\n * instead, driven by `value` being falsy). */\n const syncDisplayValue = (val: string) => {\n let hasMatchingChild = false;\n React.Children.forEach(children, child => {\n if (child.props.value === val) {\n setDisplay(child.props.children);\n hasMatchingChild = true;\n }\n });\n\n if (hasMatchingChild) {\n return;\n }\n\n if (selectedOption && selectedOption.value === val) {\n setDisplay(selectedOption.label);\n return;\n }\n\n setDisplay(\"\");\n };\n\n /** True while a request is in flight (consumer-reported) or a debounced search is about to fire — keeps the list from flashing stale results for a query that's already been superseded. */\n const asyncBusy = !!search?.async?.loading || isAsyncPending;\n asyncBusyRef.current = asyncBusy;\n\n /** Paging (T4): only enabled once the consumer opts in via `onLoadMore`. `hasMore` additionally\n * gates the sentinel that triggers it — once the consumer reports no more pages, it disappears. */\n const asyncOnLoadMore = search?.async?.onLoadMore;\n const canPaginate = isAsync && !!asyncOnLoadMore;\n /** Only relevant while an actual page of options is being shown — not during the error/idle\n * states, and not when the current page is empty (nothing to scroll to). */\n const showLoadMoreSentinel =\n canPaginate &&\n !!search?.async?.hasMore &&\n !search?.async?.errorLabel &&\n filter.length >= asyncMinSearchLength &&\n React.Children.count(children) > 0;\n\n /**\n * @description We have to modify the children (Option component) to have an 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 value,\n isSearching,\n selectOpened: expanded,\n focusedSelectItem,\n shouldClick,\n addBtnRef\n };\n\n if (isAsync) {\n const asyncSearch = search?.async;\n\n if (asyncSearch?.errorLabel) {\n return (\n <li className={classes[\"async-status\"]}>\n {asyncSearch.errorLabel}\n {asyncSearch.onRetry && (\n <button\n type=\"button\"\n className={classes[\"retry-button\"]}\n onClick={asyncSearch.onRetry}\n >\n Retry\n </button>\n )}\n </li>\n );\n }\n\n if (filter.length < asyncMinSearchLength) {\n return (\n <li className={classes[\"async-status\"]}>{asyncSearch?.idleLabel ?? \"Type to search\"}</li>\n );\n }\n\n if (asyncBusy) {\n /* Paging (T4): once a page has already been rendered, a subsequent `loading` (fetching\n * the next page) must append a \"loading more\" row rather than replace the list — that\n * full-list-replace behavior is reserved for the initial/new-query loading state above. */\n if (canPaginate && React.Children.count(children) > 0) {\n return [\n ...renderChildOptions(children, optionProps),\n <li\n key=\"__select-load-more-status__\"\n data-testid=\"select-load-more-status\"\n className={classes[\"async-status\"]}\n >\n <Spinner size={16} />\n </li>\n ];\n }\n\n return (\n <li className={classes[\"async-status\"]}>\n <Spinner size={20} />\n </li>\n );\n }\n\n if (React.Children.count(children) === 0) {\n return <li className={classes[\"no-results\"]}>{noResultsLabel}</li>;\n }\n\n return renderChildOptions(children, optionProps);\n }\n\n if (isSearching || filter !== \"\") {\n const filteredChildren = React.Children.toArray(children).filter(child => {\n const childElement = child as React.ReactElement;\n const innerChildren = childElement.props.children;\n\n const childText = Array.isArray(innerChildren)\n ? innerChildren.map(String).join(\"\")\n : String(innerChildren);\n return childText.toLowerCase().includes(filter.toLowerCase());\n });\n\n const internalChildren = renderChildOptions(filteredChildren as ReactElement[], optionProps);\n\n if (internalChildren.length === 0) {\n return <li className={classes[\"no-results\"]}>{noResultsLabel}</li>;\n }\n\n return renderChildOptions(filteredChildren as ReactElement[], optionProps);\n }\n\n return renderChildOptions(children, optionProps);\n };\n\n const getAsyncStatusMessage = () => {\n const asyncSearch = search?.async;\n if (!asyncSearch) {\n return \"\";\n }\n\n if (asyncSearch.errorLabel) {\n return asyncSearch.errorLabel;\n }\n\n if (filter.length < asyncMinSearchLength) {\n return asyncSearch.idleLabel ?? \"Type to search\";\n }\n\n if (asyncBusy) {\n return \"Loading\";\n }\n\n const resultsCount = React.Children.count(children);\n return resultsCount === 0 ? noResultsLabel : `${resultsCount} 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 nativeOnChangeHandler = (event: React.ChangeEvent<HTMLSelectElement>) => {\n onChange?.(event);\n };\n\n useEffect(() => {\n if (expanded) {\n setFocusedSelectItem(0);\n setShouldFocusButtonAfterClose(true);\n }\n\n if (!expanded && customSelectButtonRef.current && shouldFocusButtonAfterClose) {\n customSelectButtonRef.current.focus();\n setShouldFocusButtonAfterClose(false);\n }\n }, [expanded, customSelectButtonRef.current, shouldFocusButtonAfterClose]);\n\n useEffect(() => {\n syncDisplayValue(value);\n }, [value, children, selectedOption]);\n\n /** Paging (T4): observes a sentinel rendered after the last option and calls `onLoadMore` once\n * per bottom-reach while `hasMore` is true. Guarded (via `loadMoreFiredRef`) against firing\n * again for the same reach-end, and (via `asyncBusyRef`) against firing while a page is already\n * loading. No-op — no observer, no calls — whenever `onLoadMore` is omitted or `hasMore` is\n * false, which also covers the sentinel not being rendered/collapsed. */\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 const myElementRef = useRef<HTMLDivElement>(null);\n\n useClickOutside(myElementRef, () => {\n if (!expanded) {\n return;\n }\n setExpanded(false);\n setListPosition(Position.Below);\n setOpacity(0);\n }, [expanded]);\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 /** 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 <div ref={myElementRef} className={`${classes[\"root\"]}${rootClassNames}`}>\n <select\n {...omitProps(rest, /^data-/)}\n tabIndex={-1}\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 button/options, adding role/tabIndex would create a spurious tab stop\n {...pickProps(rest, /^data-/)}\n ref={containerReference}\n onKeyDown={onArrowNavigation}\n className={`custom-select ${classes.select} ${additionalClasses.join(\" \")}`}\n >\n {searchVisible && renderSearch()}\n <button // NOSONAR(S6819) no semantic equivalent: <input list>/<select multiple> can't host the search input, add-new button, status icon or custom option markup, and <input> can't contain the trigger's child elements. role=\"combobox\" follows the ARIA APG select-only combobox pattern and is what allows aria-invalid here.\n {...selectButtonProps}\n onClick={() => {\n setExpanded(isReadOnlyView || rest[\"data-readonlyview\"] ? false : !expanded);\n }}\n ref={customSelectButtonRef}\n type=\"button\"\n name={name}\n className={`${classes[\"custom-select\"]} ${additionalClasses.join(\" \")} `}\n style={{ display: expanded && searchVisible ? \"none\" : \"block\" }}\n disabled={disabled}\n /* ARIA 1.2 combobox pattern: the trigger owns the popup state, the invalid state and controls the listbox. */\n role=\"combobox\"\n aria-disabled={disabled}\n aria-invalid={error}\n aria-expanded={expanded}\n aria-controls={listboxId}\n aria-haspopup=\"listbox\"\n aria-labelledby={labeledBy}\n aria-describedby={describedBy}\n >\n <div data-display className={classes[\"selected\"]}>\n {!value && placeholder && <span className={classes[\"placeholder\"]}>{placeholder}</span>}\n {value?.length > 0 && <span data-display-inner>{display}</span>}\n <RequiredSign className={classes[\"required\"]} />\n </div>\n <div className={classes[\"status\"]}>\n <FormStatusIndicator isReadOnlyView={isReadOnlyView} success={success} error={error}>\n {renderChevronIcon()}\n </FormStatusIndicator>\n </div>\n </button>\n <div className=\"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 bottom: listPosition === Position.Above ? \"2.85rem\" : \"initial\",\n marginTop: \"4px\"\n }}\n >\n <ul // NOSONAR(S6819) native <select> can't host search, add-new or custom option markup\n ref={listRef}\n id={listboxId}\n className={addNewBtnOptionsContainerClassName}\n role=\"listbox\" // NOSONAR(S6842) required by the ARIA listbox pattern\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=\"select-load-more-sentinel\"\n className={classes[\"load-more-sentinel\"]}\n />\n )}\n </ul>\n {isAsync && (\n <span role=\"status\" aria-live=\"polite\" className={readyclasses[\"sr-only\"]}>\n {getAsyncStatusMessage()}\n </span>\n )}\n {renderAddNew()}\n </div>\n </div>\n </div>\n </div>\n );\n};\nexport const Select = withReadOnly(React.forwardRef(SelectComponent));\n"],"names":["classes"],"mappings":";;;;;;;;;;;;;;;;AAoDA,MAAM,qBAAqB,CAAC,kBAAkC,gBAAmC;AAC/F,SAAO,MAAM,SAAS,IAAI,kBAAkB,CAAC,OAAO,UAAU;AAC5D,WAAO,MAAM,aAAa,OAAO;AAAA,MAC/B,eAAe,YAAY;AAAA,MAC3B,gBAAgB,YAAY;AAAA,MAC5B,YAAY,MAAM,MAAM,UAAU,YAAY;AAAA,MAC9C,aAAa,YAAY;AAAA,MACzB,cAAc,YAAY;AAAA,MAC1B,YAAY;AAAA,MACZ,UAAU,YAAY,sBAAsB;AAAA,MAC5C,aAAa,YAAY;AAAA,MACzB,iBAAiB,YAAY,UAAU,YAAY,SAAS;AAAA,IAAA,CAC7D;AAAA,EACH,CAAC;AACH;AAEA,MAAM,kBAAkF,CACtF;AAAA,EACE;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,UAAU;AAAA,EACV;AAAA,EACA,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA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wBACC,sBAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAK;AAAA,YACL,eAAY;AAAA,YACZ,eAAY;AAAA,YACZ,WAAWA,cAAQ,oBAAoB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,MAGH,WACC,sBAAA,cAAC,QAAA,EAAK,MAAK,UAAS,aAAU,UAAS,WAAW,aAAa,SAAS,EAAA,GACrE,sBAAA,CACH;AAAA,MAED,aAAA;AAAA,IAAa,CAElB;AAAA,EAAA,CAEJ;AAEJ;AACO,MAAM,SAAS,aAAa,MAAM,WAAW,eAAe,CAAC;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.Select_sr-only_EVNeA{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.Select_hidden_EVNeA{display:none}.Select_slide-in_EVNeA{animation:Select_slide-in_EVNeA .5s forwards}@media(prefers-reduced-motion:reduce){.Select_slide-in_EVNeA{animation-duration:.1ms}}.Select_slide-out_EVNeA{animation:Select_slide-out_EVNeA .5s forwards}@media(prefers-reduced-motion:reduce){.Select_slide-out_EVNeA{animation-duration:.1ms}}@keyframes Select_slide-in_EVNeA{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes Select_slide-out_EVNeA{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.Select_select_EVNeA{position:relative;box-sizing:border-box;border:0;border-radius:var(--input-border-radius);background-color:var(--input-background-color);font-size:var(--form-control-font-size);transition-property:background-color;transition-duration:.2s;transition-timing-function:ease-in-out}@media(prefers-reduced-motion:reduce){.Select_select_EVNeA{transition-duration:.1ms}}.Select_select_EVNeA [data-display]{color:var(--color-default);font-family:var(--font-family)}.Select_select_EVNeA.Select_expanded_EVNeA .Select_list-wrapper_EVNeA{background:var(--light)}.Select_select_EVNeA:not(.Select_expanded_EVNeA):has(button:focus){position:relative;z-index:2;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));border-radius:var(--focus-border-radius)}.Select_select_EVNeA:not(.Select_expanded_EVNeA) button:focus:not(.Select_error_EVNeA){border-color:var(--input-border-color);border-width:var(--input-border-width);padding:0 calc(.5 * var(--font-size) - var(--input-border-width))}.Select_select_EVNeA:hover:not(.Select_disabled_EVNeA):not(.Select_expanded_EVNeA):not(.Select_error_EVNeA) button:not(:focus){border-color:var(--input-border-color);border-width:var(--input-border-width);background-color:var(--color-blue-grey25)}.Select_select_EVNeA .Select_custom-select_EVNeA{position:relative;width:100%;min-height:calc(2.875 * var(--font-size) - 2 * var(--input-border-width));padding:0 calc(.5 * var(--font-size) - var(--input-border-width));background-color:transparent;border-color:var(--input-border-color);border-style:var(--input-border-style);border-width:var(--input-border-width);border-radius:var(--input-border-radius);font-size:var(--form-control-font-size);cursor:pointer;transition-property:background-color,border-color;transition-duration:.2s;transition-timing-function:ease-in-out}@media(prefers-reduced-motion:reduce){.Select_select_EVNeA .Select_custom-select_EVNeA{transition-duration:.1ms}}.Select_select_EVNeA .Select_custom-select_EVNeA:focus{outline:0}.Select_select_EVNeA .Select_custom-select_EVNeA.Select_error_EVNeA{border-color:var(--error);color:var(--error)}.Select_select_EVNeA .Select_custom-select_EVNeA.Select_error_EVNeA:focus{border-width:var(--input-border-width)}.Select_select_EVNeA .Select_custom-select_EVNeA.Select_disabled_EVNeA{border-color:var(--color-disabled)}.Select_select_EVNeA .Select_list-wrapper-container_EVNeA{position:relative}.Select_select_EVNeA .Select_list-wrapper_EVNeA{border-color:var(--light-grey-border);border-style:var(--input-border-style);border-width:var(--input-border-width);border-radius:var(--input-border-radius);box-shadow:0 8px 10px #01053224;position:absolute;z-index:11;left:0;width:100%;overflow:auto}.Select_select_EVNeA ul{box-sizing:border-box;padding:.25rem 0;width:100%;margin:0;list-style:none;background-color:var(--light);border-radius:var(--input-border-radius);color:var(--default);text-align:left;overflow:auto;max-height:25rem}.Select_select_EVNeA ul li{padding:.62rem .75rem;font-size:var(--form-control-font-size);font-family:var(--font-family);margin:0;position:relative;line-height:1.43;box-sizing:border-box;min-height:2.5rem;cursor:pointer}.Select_select_EVNeA ul li:focus{outline:none}.Select_select_EVNeA ul li:focus:before{content:"";position:absolute;top:0;left:.125rem;height:100%;width:calc(100% - .25rem);opacity:1;z-index:101;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:0;border-radius:var(--focus-border-radius)}.Select_select_EVNeA ul li:hover{background-color:var(--color-blue-grey50)}.Select_select_EVNeA ul li:active{background-color:var(--color-blue-grey100)}.Select_select_EVNeA ul li.Select_disabled_EVNeA{color:var(--greyed-out);background-color:var(--disabled);pointer-events:none}.Select_select_EVNeA ul li.Select_selected-option_EVNeA{padding-left:.5rem}.Select_select_EVNeA[data-readonlyview=true]{-webkit-user-select:text;user-select:text;pointer-events:none}.Select_select_EVNeA[data-readonlyview=true] button[type=button]{background-color:var(--color-white);color:var(--read-only-text-color);border-color:var(--read-only-border-color)}.Select_select_EVNeA[data-readonlyview=true] button[type=button] .Select_selected_EVNeA{color:var(--read-only-text-color)}.Select_select_EVNeA[data-readonlyview=true] button[type=button].Select_error_EVNeA,.Select_select_EVNeA[data-readonlyview=true] button[type=button].Select_success_EVNeA{border-color:var(--read-only-border-color);color:var(--read-only-text-color)}.Select_select_EVNeA[data-readonlyview=true] button[type=button].Select_error_EVNeA .Select_status_EVNeA,.Select_select_EVNeA[data-readonlyview=true] button[type=button].Select_success_EVNeA .Select_status_EVNeA{visibility:visible}.Select_select_EVNeA[data-readonlyview=true] button[type=button] .Select_status_EVNeA .Select_chevron-icon_EVNeA,.Select_select_EVNeA[data-readonlyview=true] .Select_list-wrapper_EVNeA{visibility:hidden}.Select_select_EVNeA[data-readonlyview=true] .Select_list-wrapper_EVNeA ul{display:none}.Select_selected-option_EVNeA{content:"";position:absolute;top:0;left:0;height:100%;border-top-right-radius:.125rem;border-bottom-right-radius:.125rem;border-left:.25rem solid var(--color-primary);color:var(--color-primary)}.Select_selected_EVNeA{position:absolute;top:50%;transform:translateY(-50%);pointer-events:none;left:calc(.5 * var(--font-size) - var(--input-border-width));right:2.25rem;text-align:left;white-space:normal}.Select_selected_EVNeA .Select_required_EVNeA{color:var(--error)}.Select_status_EVNeA{position:absolute;top:50%;right:.8125rem;transform:translateY(-50%);display:flex;align-items:center;flex-shrink:0}.Select_status_EVNeA [data-icon-status=success]{color:var(--success);font-size:var(--font-size-big)}.Select_status_EVNeA [data-icon-status=error]{color:var(--error);font-size:var(--font-size-big)}.Select_status_EVNeA [data-icon-status=info]{color:var(--default);font-size:var(--font-size-big)}.Select_status_EVNeA .Select_chevron-icon_EVNeA{color:var(--default);font-size:var(--font-size-small)}.Select_status_EVNeA *+*{margin-left:1.25rem}.Select_placeholder_EVNeA{color:var(--greyed-out)}.Select_select-search_EVNeA{position:relative;width:100%;box-sizing:border-box;border-bottom-left-radius:0;border-bottom-right-radius:0}.Select_disabled_EVNeA{cursor:not-allowed;color:var(--greyed-out);background-color:var(--color-blue-grey25)}.Select_disabled_EVNeA>*{pointer-events:none}@media only screen and (min-width:30em){.Select_select_EVNeA .Select_custom-select_EVNeA{padding:0 calc(.5 * var(--font-size) - var(--input-border-width))}.Select_select_EVNeA:not(.Select_expanded_EVNeA) button:focus:not(.Select_error_EVNeA){padding:0 calc(.5 * var(--font-size) - var(--input-border-width))}}[data-readonlyview=true] .Select_root_EVNeA [data-readonlyview] button{border-color:var(--read-only-border-color)}[data-readonlyview=true] .Select_root_EVNeA [data-readonlyview] button .Select_status_EVNeA .Select_chevron-icon_EVNeA{visibility:hidden}[data-readonlyview=true] .Select_root_EVNeA [data-readonlyview] button.Select_error_EVNeA{border-color:var(--read-only-border-color);color:var(--read-only-text-color)}.Select_inlineEditing_EVNeA .Select_select_EVNeA{background-color:transparent;transition:none}.Select_inlineEditing_EVNeA .Select_select_EVNeA:not(.Select_expanded_EVNeA) button:focus:not(.Select_error_EVNeA){border-width:0;border-radius:.3125rem}.Select_inlineEditing_EVNeA .Select_select_EVNeA:not(.Select_expanded_EVNeA):has(button:focus){outline:none}.Select_inlineEditing_EVNeA .Select_select_EVNeA:focus button:focus{border:.125rem solid var(--color-focus)}.Select_inlineEditing_EVNeA .Select_select_EVNeA:hover button .Select_status_EVNeA span.Select_chevron-icon_EVNeA{visibility:visible}.Select_inlineEditing_EVNeA .Select_select_EVNeA:hover:not(.Select_disabled_EVNeA):not(.Select_expanded_EVNeA):not(.Select_error_EVNeA) button:not(:focus){border:0;background-color:transparent}.Select_inlineEditing_EVNeA .Select_select_EVNeA button{border:0}.Select_inlineEditing_EVNeA .Select_select_EVNeA button.Select_expanded_EVNeA div.Select_status_EVNeA span.Select_chevron-icon_EVNeA{visibility:visible}.Select_inlineEditing_EVNeA .Select_select_EVNeA button:focus-visible{outline:.125rem solid var(--color-focus);border-radius:.3125rem;outline-offset:-1px}.Select_inlineEditing_EVNeA .Select_select_EVNeA button.Select_error_EVNeA{color:var(--color-default)}.Select_inlineEditing_EVNeA .Select_select_EVNeA button .Select_status_EVNeA span.Select_chevron-icon_EVNeA{visibility:hidden}.Select_inlineEditing_EVNeA .Select_select_EVNeA[data-readonlyview=true] button{background-color:transparent}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.Select_sr-only_PX3IM{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.Select_hidden_PX3IM{display:none}.Select_slide-in_PX3IM{animation:Select_slide-in_PX3IM .5s forwards}@media(prefers-reduced-motion:reduce){.Select_slide-in_PX3IM{animation-duration:.1ms}}.Select_slide-out_PX3IM{animation:Select_slide-out_PX3IM .5s forwards}@media(prefers-reduced-motion:reduce){.Select_slide-out_PX3IM{animation-duration:.1ms}}@keyframes Select_slide-in_PX3IM{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes Select_slide-out_PX3IM{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.Select_select_PX3IM{position:relative;box-sizing:border-box;border:0;border-radius:var(--input-border-radius);background-color:var(--input-background-color);font-size:var(--form-control-font-size);transition-property:background-color;transition-duration:.2s;transition-timing-function:ease-in-out}@media(prefers-reduced-motion:reduce){.Select_select_PX3IM{transition-duration:.1ms}}.Select_select_PX3IM [data-display]{color:var(--color-default);font-family:var(--font-family)}.Select_select_PX3IM.Select_expanded_PX3IM .Select_list-wrapper_PX3IM{background:var(--light)}.Select_select_PX3IM:not(.Select_expanded_PX3IM):has(button:focus){position:relative;z-index:2;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));border-radius:var(--focus-border-radius)}.Select_select_PX3IM:not(.Select_expanded_PX3IM) button:focus:not(.Select_error_PX3IM){border-color:var(--input-border-color);border-width:var(--input-border-width);padding:0 calc(.5 * var(--font-size) - var(--input-border-width))}.Select_select_PX3IM:hover:not(.Select_disabled_PX3IM):not(.Select_expanded_PX3IM):not(.Select_error_PX3IM) button:not(:focus){border-color:var(--input-border-color);border-width:var(--input-border-width);background-color:var(--color-blue-grey25)}.Select_select_PX3IM .Select_custom-select_PX3IM{position:relative;width:100%;min-height:calc(2.875 * var(--font-size) - 2 * var(--input-border-width));padding:0 calc(.5 * var(--font-size) - var(--input-border-width));background-color:transparent;border-color:var(--input-border-color);border-style:var(--input-border-style);border-width:var(--input-border-width);border-radius:var(--input-border-radius);font-size:var(--form-control-font-size);cursor:pointer;transition-property:background-color,border-color;transition-duration:.2s;transition-timing-function:ease-in-out}@media(prefers-reduced-motion:reduce){.Select_select_PX3IM .Select_custom-select_PX3IM{transition-duration:.1ms}}.Select_select_PX3IM .Select_custom-select_PX3IM:focus{outline:0}.Select_select_PX3IM .Select_custom-select_PX3IM.Select_error_PX3IM{border-color:var(--error);color:var(--error)}.Select_select_PX3IM .Select_custom-select_PX3IM.Select_error_PX3IM:focus{border-width:var(--input-border-width)}.Select_select_PX3IM .Select_custom-select_PX3IM.Select_disabled_PX3IM{border-color:var(--color-disabled)}.Select_select_PX3IM .Select_list-wrapper-container_PX3IM{position:relative}.Select_select_PX3IM .Select_list-wrapper_PX3IM{border-color:var(--light-grey-border);border-style:var(--input-border-style);border-width:var(--input-border-width);border-radius:var(--input-border-radius);box-shadow:0 8px 10px #01053224;position:absolute;z-index:11;left:0;width:100%;overflow:auto}.Select_select_PX3IM ul{box-sizing:border-box;padding:.25rem 0;width:100%;margin:0;list-style:none;background-color:var(--light);border-radius:var(--input-border-radius);color:var(--default);text-align:left;overflow:auto;max-height:25rem}.Select_select_PX3IM ul li{padding:.62rem .75rem;font-size:var(--form-control-font-size);font-family:var(--font-family);margin:0;position:relative;line-height:1.43;box-sizing:border-box;min-height:2.5rem;cursor:pointer}.Select_select_PX3IM ul li:focus{outline:none}.Select_select_PX3IM ul li:focus:before{content:"";position:absolute;top:0;left:.125rem;height:100%;width:calc(100% - .25rem);opacity:1;z-index:101;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:0;border-radius:var(--focus-border-radius)}.Select_select_PX3IM ul li:hover{background-color:var(--color-blue-grey50)}.Select_select_PX3IM ul li:active{background-color:var(--color-blue-grey100)}.Select_select_PX3IM ul li.Select_disabled_PX3IM{color:var(--greyed-out);background-color:var(--disabled);pointer-events:none}.Select_select_PX3IM ul li.Select_selected-option_PX3IM{padding-left:.5rem}.Select_select_PX3IM ul li.Select_async-status_PX3IM{display:flex;align-items:center;gap:.5rem;cursor:default;color:var(--greyed-out)}.Select_select_PX3IM ul li.Select_async-status_PX3IM:hover,.Select_select_PX3IM ul li.Select_async-status_PX3IM:active{background-color:transparent}.Select_select_PX3IM ul li.Select_load-more-sentinel_PX3IM{min-height:0;height:1px;padding:0;margin:0;cursor:default;pointer-events:none}.Select_select_PX3IM .Select_retry-button_PX3IM{border:none;background:none;padding:0;color:var(--color-primary);font-family:var(--font-family);font-size:var(--form-control-font-size);text-decoration:underline;cursor:pointer}.Select_select_PX3IM[data-readonlyview=true]{-webkit-user-select:text;user-select:text;pointer-events:none}.Select_select_PX3IM[data-readonlyview=true] button[type=button]{background-color:var(--color-white);color:var(--read-only-text-color);border-color:var(--read-only-border-color)}.Select_select_PX3IM[data-readonlyview=true] button[type=button] .Select_selected_PX3IM{color:var(--read-only-text-color)}.Select_select_PX3IM[data-readonlyview=true] button[type=button].Select_error_PX3IM,.Select_select_PX3IM[data-readonlyview=true] button[type=button].Select_success_PX3IM{border-color:var(--read-only-border-color);color:var(--read-only-text-color)}.Select_select_PX3IM[data-readonlyview=true] button[type=button].Select_error_PX3IM .Select_status_PX3IM,.Select_select_PX3IM[data-readonlyview=true] button[type=button].Select_success_PX3IM .Select_status_PX3IM{visibility:visible}.Select_select_PX3IM[data-readonlyview=true] button[type=button] .Select_status_PX3IM .Select_chevron-icon_PX3IM,.Select_select_PX3IM[data-readonlyview=true] .Select_list-wrapper_PX3IM{visibility:hidden}.Select_select_PX3IM[data-readonlyview=true] .Select_list-wrapper_PX3IM ul{display:none}.Select_selected-option_PX3IM{content:"";position:absolute;top:0;left:0;height:100%;border-top-right-radius:.125rem;border-bottom-right-radius:.125rem;border-left:.25rem solid var(--color-primary);color:var(--color-primary)}.Select_selected_PX3IM{position:absolute;top:50%;transform:translateY(-50%);pointer-events:none;left:calc(.5 * var(--font-size) - var(--input-border-width));right:2.25rem;text-align:left;white-space:normal}.Select_selected_PX3IM .Select_required_PX3IM{color:var(--error)}.Select_status_PX3IM{position:absolute;top:50%;right:.8125rem;transform:translateY(-50%);display:flex;align-items:center;flex-shrink:0}.Select_status_PX3IM [data-icon-status=success]{color:var(--success);font-size:var(--font-size-big)}.Select_status_PX3IM [data-icon-status=error]{color:var(--error);font-size:var(--font-size-big)}.Select_status_PX3IM [data-icon-status=info]{color:var(--default);font-size:var(--font-size-big)}.Select_status_PX3IM .Select_chevron-icon_PX3IM{color:var(--default);font-size:var(--font-size-small)}.Select_status_PX3IM *+*{margin-left:1.25rem}.Select_placeholder_PX3IM{color:var(--greyed-out)}.Select_select-search_PX3IM{position:relative;width:100%;box-sizing:border-box;border-bottom-left-radius:0;border-bottom-right-radius:0}.Select_disabled_PX3IM{cursor:not-allowed;color:var(--greyed-out);background-color:var(--color-blue-grey25)}.Select_disabled_PX3IM>*{pointer-events:none}@media only screen and (min-width:30em){.Select_select_PX3IM .Select_custom-select_PX3IM{padding:0 calc(.5 * var(--font-size) - var(--input-border-width))}.Select_select_PX3IM:not(.Select_expanded_PX3IM) button:focus:not(.Select_error_PX3IM){padding:0 calc(.5 * var(--font-size) - var(--input-border-width))}}[data-readonlyview=true] .Select_root_PX3IM [data-readonlyview] button{border-color:var(--read-only-border-color)}[data-readonlyview=true] .Select_root_PX3IM [data-readonlyview] button .Select_status_PX3IM .Select_chevron-icon_PX3IM{visibility:hidden}[data-readonlyview=true] .Select_root_PX3IM [data-readonlyview] button.Select_error_PX3IM{border-color:var(--read-only-border-color);color:var(--read-only-text-color)}.Select_inlineEditing_PX3IM .Select_select_PX3IM{background-color:transparent;transition:none}.Select_inlineEditing_PX3IM .Select_select_PX3IM:not(.Select_expanded_PX3IM) button:focus:not(.Select_error_PX3IM){border-width:0;border-radius:.3125rem}.Select_inlineEditing_PX3IM .Select_select_PX3IM:not(.Select_expanded_PX3IM):has(button:focus){outline:none}.Select_inlineEditing_PX3IM .Select_select_PX3IM:focus button:focus{border:.125rem solid var(--color-focus)}.Select_inlineEditing_PX3IM .Select_select_PX3IM:hover button .Select_status_PX3IM span.Select_chevron-icon_PX3IM{visibility:visible}.Select_inlineEditing_PX3IM .Select_select_PX3IM:hover:not(.Select_disabled_PX3IM):not(.Select_expanded_PX3IM):not(.Select_error_PX3IM) button:not(:focus){border:0;background-color:transparent}.Select_inlineEditing_PX3IM .Select_select_PX3IM button{border:0}.Select_inlineEditing_PX3IM .Select_select_PX3IM button.Select_expanded_PX3IM div.Select_status_PX3IM span.Select_chevron-icon_PX3IM{visibility:visible}.Select_inlineEditing_PX3IM .Select_select_PX3IM button:focus-visible{outline:.125rem solid var(--color-focus);border-radius:.3125rem;outline-offset:-1px}.Select_inlineEditing_PX3IM .Select_select_PX3IM button.Select_error_PX3IM{color:var(--color-default)}.Select_inlineEditing_PX3IM .Select_select_PX3IM button .Select_status_PX3IM span.Select_chevron-icon_PX3IM{visibility:hidden}.Select_inlineEditing_PX3IM .Select_select_PX3IM[data-readonlyview=true] button{background-color:transparent}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="Select_select_PX3IM",t="Select_expanded_PX3IM",s="Select_error_PX3IM",l="Select_disabled_PX3IM",c="Select_selected_PX3IM",r="Select_success_PX3IM",o="Select_status_PX3IM",_="Select_required_PX3IM",d="Select_placeholder_PX3IM",i="Select_root_PX3IM",n="Select_inlineEditing_PX3IM",a={select:e,expanded:t,"list-wrapper":"Select_list-wrapper_PX3IM",error:s,disabled:l,"custom-select":"Select_custom-select_PX3IM","selected-option":"Select_selected-option_PX3IM","async-status":"Select_async-status_PX3IM","load-more-sentinel":"Select_load-more-sentinel_PX3IM","retry-button":"Select_retry-button_PX3IM",selected:c,success:r,status:o,"chevron-icon":"Select_chevron-icon_PX3IM",required:_,placeholder:d,"select-search":"Select_select-search_PX3IM",root:i,inlineEditing:n};exports.default=a,exports.disabled=l,exports.error=s,exports.expanded=t,exports.inlineEditing=n,exports.placeholder=d,exports.required=_,exports.root=i,exports.select=e,exports.selected=c,exports.status=o,exports.success=r;
|
|
3
3
|
//# sourceMappingURL=Select.module.scss.cjs.js.map
|