@elliemae/ds-form 2.0.0-next.9 → 2.0.0-rc.12
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/cjs/Checkbox/DSCheckbox.js +7 -2
- package/cjs/CheckboxGroup/DSCheckboxGroup.js +18 -10
- package/cjs/ComboBox/index.js +3 -0
- package/cjs/ComboBox/v1/DSComboBox.js +31 -26
- package/cjs/ComboBox/v1/components/AllOption.js +5 -0
- package/cjs/ComboBox/v1/components/ClearIndicator.js +2 -3
- package/cjs/ComboBox/v1/components/Control.js +14 -6
- package/cjs/ComboBox/v1/components/CustomOption.js +12 -6
- package/cjs/ComboBox/v1/components/CustomOptionMulti.js +12 -6
- package/cjs/ComboBox/v1/components/DropdownIndicator.js +7 -3
- package/cjs/ComboBox/v1/components/MenuList.js +5 -0
- package/cjs/ComboBox/v1/components/MultiSelectHeader.js +3 -0
- package/cjs/ComboBox/v1/components/MultiValueLabel.js +4 -3
- package/cjs/ComboBox/v1/components/MultiValueRemove.js +5 -0
- package/cjs/ComboBox/v1/components/SelectMenu.js +26 -18
- package/cjs/ComboBox/v1/components/SingleValueLabel.js +4 -3
- package/cjs/ComboBox/v1/components/ValueContainer.js +5 -0
- package/cjs/ComboBox/v1/components/calculateWidth.js +4 -0
- package/cjs/ComboBox/v1/components/getoptions.js +9 -6
- package/cjs/ComboBox/v1/withSelectStringValueConverter.js +27 -16
- package/cjs/ComboBox/v2/Combobox.js +13 -8
- package/cjs/ComboBox/v2/components/AllOption.js +5 -0
- package/cjs/ComboBox/v2/components/ClearIndicator.js +7 -3
- package/cjs/ComboBox/v2/components/Content.js +5 -0
- package/cjs/ComboBox/v2/components/Control.js +14 -6
- package/cjs/ComboBox/v2/components/CustomOption.js +12 -6
- package/cjs/ComboBox/v2/components/CustomOptionMulti.js +14 -6
- package/cjs/ComboBox/v2/components/DropdownIndicator.js +7 -3
- package/cjs/ComboBox/v2/components/GroupHeading.js +5 -0
- package/cjs/ComboBox/v2/components/IndicatorSeparator.js +11 -3
- package/cjs/ComboBox/v2/components/MenuList.js +5 -0
- package/cjs/ComboBox/v2/components/MultiSelectHeader.js +3 -0
- package/cjs/ComboBox/v2/components/MultiValueLabel.js +4 -3
- package/cjs/ComboBox/v2/components/MultiValueRemove.js +5 -0
- package/cjs/ComboBox/v2/components/SelectMenu.js +5 -0
- package/cjs/ComboBox/v2/components/SingleValueLabel.js +4 -3
- package/cjs/ComboBox/v2/components/ValueContainer.js +7 -2
- package/cjs/ComboBox/v2/components/calculateWidth.js +4 -0
- package/cjs/ComboBox/v2/components/getoptions.js +9 -6
- package/cjs/ComboBox/v2/components/useMenuListHeight.js +3 -0
- package/cjs/ComboBox/v3/ComboBox.js +33 -0
- package/cjs/ComboBox/v3/ComboBoxCTX.js +55 -0
- package/cjs/ComboBox/v3/ComboboxDataTestids.js +17 -0
- package/cjs/ComboBox/v3/config/constants.js +14 -0
- package/cjs/ComboBox/v3/config/useComboBox.js +122 -0
- package/cjs/ComboBox/v3/config/useGetPropsWithDefault.js +11 -0
- package/cjs/ComboBox/v3/index.d.js +2 -0
- package/cjs/ComboBox/v3/index.js +10 -0
- package/cjs/ComboBox/v3/parts/a11y-messages/MultiAllyMessages.js +33 -0
- package/cjs/ComboBox/v3/parts/a11y-messages/SingleAllyMessages.js +28 -0
- package/cjs/ComboBox/v3/parts/a11y-messages/index.js +11 -0
- package/cjs/ComboBox/v3/parts/a11y-messages/styled.js +15 -0
- package/cjs/ComboBox/v3/parts/container/Container.js +67 -0
- package/cjs/ComboBox/v3/parts/container/index.js +9 -0
- package/cjs/ComboBox/v3/parts/container/styled.js +23 -0
- package/cjs/ComboBox/v3/parts/controls/Controls.js +71 -0
- package/cjs/ComboBox/v3/parts/controls/index.js +9 -0
- package/cjs/ComboBox/v3/parts/controls/styled.js +65 -0
- package/cjs/ComboBox/v3/parts/controls-input/ControlsInput.js +67 -0
- package/cjs/ComboBox/v3/parts/controls-input/styled.js +27 -0
- package/cjs/ComboBox/v3/parts/controls-input/useControlsInput.js +77 -0
- package/cjs/ComboBox/v3/parts/dropdown-indicator/DropdownIndicator.js +33 -0
- package/cjs/ComboBox/v3/parts/dropdown-indicator/index.js +2 -0
- package/cjs/ComboBox/v3/parts/dropdown-indicator/styled.js +17 -0
- package/cjs/ComboBox/v3/parts/empty-state/index.js +27 -0
- package/cjs/ComboBox/v3/parts/empty-state/styled.js +19 -0
- package/cjs/ComboBox/v3/parts/header-list/HeaderList.js +113 -0
- package/cjs/ComboBox/v3/parts/header-list/index.js +9 -0
- package/cjs/ComboBox/v3/parts/header-list/styled.js +58 -0
- package/cjs/ComboBox/v3/parts/header-list/useHeaderListHandlers.js +73 -0
- package/cjs/ComboBox/v3/parts/menu-list/MenuList.js +81 -0
- package/cjs/ComboBox/v3/parts/menu-list/index.js +9 -0
- package/cjs/ComboBox/v3/parts/menu-list/styled.js +34 -0
- package/cjs/ComboBox/v3/parts/menu-list/useItemRenderer.js +105 -0
- package/cjs/ComboBox/v3/parts/menu-list/useMenuList.js +61 -0
- package/cjs/ComboBox/v3/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +63 -0
- package/cjs/ComboBox/v3/parts/multi-selected-values-container/index.js +9 -0
- package/cjs/ComboBox/v3/parts/multi-selected-values-container/styled.js +23 -0
- package/cjs/ComboBox/v3/parts/multi-selected-values-container/useGroupPills.js +71 -0
- package/cjs/ComboBox/v3/parts/single-selected-value-container/SingleSelectedValueContainer.js +28 -0
- package/cjs/ComboBox/v3/parts/single-selected-value-container/index.js +9 -0
- package/cjs/ComboBox/v3/parts/single-selected-value-container/styled.js +15 -0
- package/cjs/ComboBox/v3/propTypes.js +25 -0
- package/cjs/ComboBox/v3/utils/hooks/useKeyboardNavigation.js +152 -0
- package/cjs/ComboBox/v3/utils/hooks/useOnElementResize.js +37 -0
- package/cjs/ComboBox/v3/utils/listHelper.js +39 -0
- package/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js +23 -16
- package/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js +22 -16
- package/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js +7 -3
- package/cjs/ComboBoxFreeSolo/components/SingleValue.js +5 -0
- package/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js +7 -3
- package/cjs/DateInput/DSDateInput.js +32 -26
- package/cjs/DateInput/components/DateInputImpl.js +23 -17
- package/cjs/DateInput/components/DateInputs.js +56 -44
- package/cjs/DateInput/components/utils.js +29 -16
- package/cjs/DateInputV2/components/DSDateInput.js +39 -33
- package/cjs/DateInputV2/components/DateInputs.js +18 -10
- package/cjs/DateInputV2/components/styled.js +22 -13
- package/cjs/DateInputV2/components/utils.js +34 -21
- package/cjs/ExpandableInput/DSExpandableInput.js +27 -24
- package/cjs/ExpandableInput/ExpandableInputImpl.js +21 -10
- package/cjs/FloatingLabelInput/DSFloatingLabelInput.js +121 -118
- package/cjs/FloatingLabelInput/FloatingLabelInputImpl.js +25 -20
- package/cjs/FloatingLabelInput/getSvgPath.js +9 -8
- package/cjs/FormItem/DSFormItemLayout.js +24 -17
- package/cjs/FormItem/Error/DSError.js +5 -4
- package/cjs/FormItem/Feedback.js +5 -4
- package/cjs/FormItem/Label/DSLabel.js +10 -9
- package/cjs/FormItem/ValidationFieldWrapper.js +9 -3
- package/cjs/Input/DSInput.js +5 -0
- package/cjs/Input/InputAddonWrapper.js +26 -15
- package/cjs/Input/InputImpl.js +43 -35
- package/cjs/InputGroup/AddonWrapper.js +11 -8
- package/cjs/InputGroup/DSInputGroup.js +20 -17
- package/cjs/InputMask/DSInputMask.js +5 -0
- package/cjs/InputMask/DSInputMaskDeprecated.js +36 -24
- package/cjs/InputMask/MaskTypes.js +5 -0
- package/cjs/InputMask/addons/AutoCorrectedDatePipe.js +11 -4
- package/cjs/InputMask/mask_types/DateInputMask.js +22 -12
- package/cjs/InputMask/mask_types/DateTimeInputMask.js +22 -12
- package/cjs/InputMask/mask_types/DictionaryInputMask.js +12 -6
- package/cjs/InputMask/mask_types/NumberInputMask.js +31 -24
- package/cjs/InputMask/mask_types/PhoneInputMask.js +22 -12
- package/cjs/InputMask/mask_types/PhoneInternationalInputMask.js +22 -12
- package/cjs/InputMask/mask_types/SsnInputMask.js +22 -12
- package/cjs/InputMask/mask_types/UsZipCodeInputMask.js +12 -6
- package/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js +22 -12
- package/cjs/InputMask/mask_types/index.js +5 -0
- package/cjs/InputProtected/DSInputProtected.js +14 -17
- package/cjs/InputProtected/index.js +3 -2
- package/cjs/LargeInputText/DSLargeInputText.js +45 -36
- package/cjs/MenuItem/components/MenuItem/index.js +55 -0
- package/cjs/MenuItem/components/MenuItem/styled.js +15 -0
- package/cjs/MenuItem/components/MultiMenuItem/MultiMenuItem.js +71 -0
- package/cjs/MenuItem/components/MultiMenuItem/styled.js +15 -0
- package/cjs/MenuItem/components/Section/index.js +38 -0
- package/cjs/MenuItem/components/Section/props.js +16 -0
- package/cjs/MenuItem/components/Section/styled.js +20 -0
- package/cjs/MenuItem/components/Separator/index.js +29 -0
- package/cjs/MenuItem/components/Separator/styled.js +20 -0
- package/cjs/MenuItem/components/SingleMenuItem/SingleMenuItem.js +70 -0
- package/cjs/MenuItem/components/SubmenuItem/index.js +142 -0
- package/cjs/MenuItem/components/SubmenuItem/styled.js +20 -0
- package/cjs/MenuItem/components/index.js +22 -0
- package/cjs/MenuItem/components/styled.js +45 -0
- package/cjs/MenuItem/index.js +22 -0
- package/cjs/MenuItem/props.js +28 -0
- package/cjs/Radio/Circle.js +5 -4
- package/cjs/Radio/DSRadio.js +6 -1
- package/cjs/RadioGroup/DSRadioGroup.js +18 -10
- package/cjs/RequiredMark/RequiredMark.js +5 -4
- package/cjs/SearchBox/DSSearchBox.js +25 -27
- package/cjs/SearchBox/NavSearchBox.js +11 -15
- package/cjs/SearchBox/SButton.js +14 -11
- package/cjs/SearchBox/SearchBoxToggle.js +8 -4
- package/cjs/SearchBox/useSearch.js +12 -7
- package/cjs/SearchBox/withSearchable.js +18 -12
- package/cjs/TextBox/DSTextBox.js +5 -0
- package/cjs/TimeInput/DSTimeInput.js +45 -37
- package/cjs/TimeInput/TimeInputImpl.js +18 -12
- package/cjs/TimeInput/TimeInputs.js +46 -29
- package/cjs/TimeInput/utils.js +13 -11
- package/cjs/Toggle/DSToggle.js +5 -0
- package/cjs/Toggle/DSToggleImpl.js +33 -28
- package/cjs/Toggle/DSToggleRender.js +38 -33
- package/cjs/Toggle/toggleHelper.js +21 -18
- package/cjs/index.js +61 -15
- package/esm/Checkbox/DSCheckbox.js +6 -1
- package/esm/CheckboxGroup/DSCheckboxGroup.js +18 -10
- package/esm/ComboBox/index.js +1 -0
- package/esm/ComboBox/v1/DSComboBox.js +29 -24
- package/esm/ComboBox/v1/components/AllOption.js +5 -0
- package/esm/ComboBox/v1/components/ClearIndicator.js +1 -1
- package/esm/ComboBox/v1/components/Control.js +14 -6
- package/esm/ComboBox/v1/components/CustomOption.js +12 -6
- package/esm/ComboBox/v1/components/CustomOptionMulti.js +12 -6
- package/esm/ComboBox/v1/components/DropdownIndicator.js +6 -1
- package/esm/ComboBox/v1/components/MenuList.js +5 -0
- package/esm/ComboBox/v1/components/MultiSelectHeader.js +3 -0
- package/esm/ComboBox/v1/components/MultiValueLabel.js +4 -3
- package/esm/ComboBox/v1/components/MultiValueRemove.js +5 -0
- package/esm/ComboBox/v1/components/SelectMenu.js +26 -18
- package/esm/ComboBox/v1/components/SingleValueLabel.js +4 -3
- package/esm/ComboBox/v1/components/ValueContainer.js +5 -0
- package/esm/ComboBox/v1/components/calculateWidth.js +4 -0
- package/esm/ComboBox/v1/components/getoptions.js +9 -6
- package/esm/ComboBox/v1/withSelectStringValueConverter.js +27 -16
- package/esm/ComboBox/v2/Combobox.js +10 -3
- package/esm/ComboBox/v2/components/AllOption.js +5 -0
- package/esm/ComboBox/v2/components/ClearIndicator.js +6 -1
- package/esm/ComboBox/v2/components/Content.js +5 -0
- package/esm/ComboBox/v2/components/Control.js +14 -6
- package/esm/ComboBox/v2/components/CustomOption.js +12 -6
- package/esm/ComboBox/v2/components/CustomOptionMulti.js +14 -6
- package/esm/ComboBox/v2/components/DropdownIndicator.js +6 -1
- package/esm/ComboBox/v2/components/GroupHeading.js +5 -0
- package/esm/ComboBox/v2/components/IndicatorSeparator.js +11 -3
- package/esm/ComboBox/v2/components/MenuList.js +5 -0
- package/esm/ComboBox/v2/components/MultiSelectHeader.js +3 -0
- package/esm/ComboBox/v2/components/MultiValueLabel.js +4 -3
- package/esm/ComboBox/v2/components/MultiValueRemove.js +5 -0
- package/esm/ComboBox/v2/components/SelectMenu.js +5 -0
- package/esm/ComboBox/v2/components/SingleValueLabel.js +4 -3
- package/esm/ComboBox/v2/components/ValueContainer.js +6 -1
- package/esm/ComboBox/v2/components/calculateWidth.js +4 -0
- package/esm/ComboBox/v2/components/getoptions.js +9 -6
- package/esm/ComboBox/v2/components/useMenuListHeight.js +3 -0
- package/esm/ComboBox/v3/ComboBox.js +24 -0
- package/esm/ComboBox/v3/ComboBoxCTX.js +49 -0
- package/esm/ComboBox/v3/ComboboxDataTestids.js +13 -0
- package/esm/ComboBox/v3/config/constants.js +10 -0
- package/esm/ComboBox/v3/config/useComboBox.js +114 -0
- package/esm/ComboBox/v3/config/useGetPropsWithDefault.js +7 -0
- package/esm/ComboBox/v3/index.d.js +1 -0
- package/esm/ComboBox/v3/index.js +1 -0
- package/esm/ComboBox/v3/parts/a11y-messages/MultiAllyMessages.js +25 -0
- package/esm/ComboBox/v3/parts/a11y-messages/SingleAllyMessages.js +20 -0
- package/esm/ComboBox/v3/parts/a11y-messages/index.js +2 -0
- package/esm/ComboBox/v3/parts/a11y-messages/styled.js +7 -0
- package/esm/ComboBox/v3/parts/container/Container.js +59 -0
- package/esm/ComboBox/v3/parts/container/index.js +1 -0
- package/esm/ComboBox/v3/parts/container/styled.js +13 -0
- package/esm/ComboBox/v3/parts/controls/Controls.js +63 -0
- package/esm/ComboBox/v3/parts/controls/index.js +1 -0
- package/esm/ComboBox/v3/parts/controls/styled.js +52 -0
- package/esm/ComboBox/v3/parts/controls-input/ControlsInput.js +59 -0
- package/esm/ComboBox/v3/parts/controls-input/styled.js +16 -0
- package/esm/ComboBox/v3/parts/controls-input/useControlsInput.js +73 -0
- package/esm/ComboBox/v3/parts/dropdown-indicator/DropdownIndicator.js +26 -0
- package/esm/ComboBox/v3/parts/dropdown-indicator/index.js +1 -0
- package/esm/ComboBox/v3/parts/dropdown-indicator/styled.js +8 -0
- package/esm/ComboBox/v3/parts/empty-state/index.js +19 -0
- package/esm/ComboBox/v3/parts/empty-state/styled.js +10 -0
- package/esm/ComboBox/v3/parts/header-list/HeaderList.js +105 -0
- package/esm/ComboBox/v3/parts/header-list/index.js +1 -0
- package/esm/ComboBox/v3/parts/header-list/styled.js +41 -0
- package/esm/ComboBox/v3/parts/header-list/useHeaderListHandlers.js +69 -0
- package/esm/ComboBox/v3/parts/menu-list/MenuList.js +73 -0
- package/esm/ComboBox/v3/parts/menu-list/index.js +1 -0
- package/esm/ComboBox/v3/parts/menu-list/styled.js +24 -0
- package/esm/ComboBox/v3/parts/menu-list/useItemRenderer.js +97 -0
- package/esm/ComboBox/v3/parts/menu-list/useMenuList.js +57 -0
- package/esm/ComboBox/v3/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +54 -0
- package/esm/ComboBox/v3/parts/multi-selected-values-container/index.js +1 -0
- package/esm/ComboBox/v3/parts/multi-selected-values-container/styled.js +13 -0
- package/esm/ComboBox/v3/parts/multi-selected-values-container/useGroupPills.js +67 -0
- package/esm/ComboBox/v3/parts/single-selected-value-container/SingleSelectedValueContainer.js +20 -0
- package/esm/ComboBox/v3/parts/single-selected-value-container/index.js +1 -0
- package/esm/ComboBox/v3/parts/single-selected-value-container/styled.js +7 -0
- package/esm/ComboBox/v3/propTypes.js +21 -0
- package/esm/ComboBox/v3/utils/hooks/useKeyboardNavigation.js +148 -0
- package/esm/ComboBox/v3/utils/hooks/useOnElementResize.js +33 -0
- package/esm/ComboBox/v3/utils/listHelper.js +30 -0
- package/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js +23 -16
- package/esm/ComboBoxFreeSolo/components/MultiValueLabel.js +21 -15
- package/esm/ComboBoxFreeSolo/components/MultiValueRemove.js +6 -1
- package/esm/ComboBoxFreeSolo/components/SingleValue.js +5 -0
- package/esm/ComboBoxFreeSolo/components/SingleValueRemove.js +6 -1
- package/esm/DateInput/DSDateInput.js +31 -25
- package/esm/DateInput/components/DateInputImpl.js +23 -17
- package/esm/DateInput/components/DateInputs.js +55 -42
- package/esm/DateInput/components/utils.js +23 -10
- package/esm/DateInputV2/components/DSDateInput.js +39 -33
- package/esm/DateInputV2/components/DateInputs.js +18 -10
- package/esm/DateInputV2/components/styled.js +19 -10
- package/esm/DateInputV2/components/utils.js +23 -10
- package/esm/ExpandableInput/DSExpandableInput.js +27 -24
- package/esm/ExpandableInput/ExpandableInputImpl.js +21 -10
- package/esm/FloatingLabelInput/DSFloatingLabelInput.js +121 -118
- package/esm/FloatingLabelInput/FloatingLabelInputImpl.js +24 -18
- package/esm/FloatingLabelInput/getSvgPath.js +9 -8
- package/esm/FormItem/DSFormItemLayout.js +23 -15
- package/esm/FormItem/Error/DSError.js +5 -4
- package/esm/FormItem/Feedback.js +5 -4
- package/esm/FormItem/Label/DSLabel.js +10 -9
- package/esm/FormItem/ValidationFieldWrapper.js +9 -3
- package/esm/Input/DSInput.js +5 -0
- package/esm/Input/InputAddonWrapper.js +26 -15
- package/esm/Input/InputImpl.js +41 -32
- package/esm/InputGroup/AddonWrapper.js +10 -7
- package/esm/InputGroup/DSInputGroup.js +20 -17
- package/esm/InputMask/DSInputMask.js +5 -0
- package/esm/InputMask/DSInputMaskDeprecated.js +36 -24
- package/esm/InputMask/MaskTypes.js +5 -0
- package/esm/InputMask/addons/AutoCorrectedDatePipe.js +11 -4
- package/esm/InputMask/mask_types/DateInputMask.js +22 -12
- package/esm/InputMask/mask_types/DateTimeInputMask.js +22 -12
- package/esm/InputMask/mask_types/DictionaryInputMask.js +12 -6
- package/esm/InputMask/mask_types/NumberInputMask.js +31 -24
- package/esm/InputMask/mask_types/PhoneInputMask.js +22 -12
- package/esm/InputMask/mask_types/PhoneInternationalInputMask.js +22 -12
- package/esm/InputMask/mask_types/SsnInputMask.js +22 -12
- package/esm/InputMask/mask_types/UsZipCodeInputMask.js +12 -6
- package/esm/InputMask/mask_types/ZipCodeSearchInputMask.js +22 -12
- package/esm/InputMask/mask_types/index.js +5 -0
- package/esm/InputProtected/DSInputProtected.js +9 -8
- package/esm/InputProtected/index.js +1 -1
- package/esm/LargeInputText/DSLargeInputText.js +45 -36
- package/esm/MenuItem/components/MenuItem/index.js +45 -0
- package/esm/MenuItem/components/MenuItem/styled.js +7 -0
- package/esm/MenuItem/components/MultiMenuItem/MultiMenuItem.js +62 -0
- package/esm/MenuItem/components/MultiMenuItem/styled.js +7 -0
- package/esm/MenuItem/components/Section/index.js +29 -0
- package/esm/MenuItem/components/Section/props.js +11 -0
- package/esm/MenuItem/components/Section/styled.js +11 -0
- package/esm/MenuItem/components/Separator/index.js +21 -0
- package/esm/MenuItem/components/Separator/styled.js +11 -0
- package/esm/MenuItem/components/SingleMenuItem/SingleMenuItem.js +61 -0
- package/esm/MenuItem/components/SubmenuItem/index.js +129 -0
- package/esm/MenuItem/components/SubmenuItem/styled.js +11 -0
- package/esm/MenuItem/components/index.js +6 -0
- package/esm/MenuItem/components/styled.js +34 -0
- package/esm/MenuItem/index.js +6 -0
- package/esm/MenuItem/props.js +23 -0
- package/esm/Radio/Circle.js +5 -4
- package/esm/Radio/DSRadio.js +6 -1
- package/esm/RadioGroup/DSRadioGroup.js +18 -10
- package/esm/RequiredMark/RequiredMark.js +5 -4
- package/esm/SearchBox/DSSearchBox.js +24 -24
- package/esm/SearchBox/NavSearchBox.js +8 -8
- package/esm/SearchBox/SButton.js +14 -11
- package/esm/SearchBox/SearchBoxToggle.js +8 -3
- package/esm/SearchBox/useSearch.js +11 -6
- package/esm/SearchBox/withSearchable.js +17 -11
- package/esm/TextBox/DSTextBox.js +5 -0
- package/esm/TimeInput/DSTimeInput.js +45 -37
- package/esm/TimeInput/TimeInputImpl.js +17 -11
- package/esm/TimeInput/TimeInputs.js +46 -29
- package/esm/TimeInput/utils.js +9 -7
- package/esm/Toggle/DSToggle.js +5 -0
- package/esm/Toggle/DSToggleImpl.js +34 -29
- package/esm/Toggle/DSToggleRender.js +37 -31
- package/esm/Toggle/toggleHelper.js +21 -18
- package/esm/index.js +26 -13
- package/package.json +282 -22
- package/types/Checkbox/DSCheckbox.d.ts +78 -13
- package/types/Checkbox/elements/CheckMark.d.ts +1 -1
- package/types/Checkbox/props.d.ts +58 -12
- package/types/CheckboxGroup/DSCheckboxGroup.d.ts +51 -7
- package/types/CheckboxGroup/props.d.ts +37 -6
- package/types/ComboBox/index.d.ts +1 -0
- package/types/ComboBox/v2/Combobox.d.ts +56 -1
- package/types/ComboBox/v3/ComboBox.d.ts +62 -0
- package/types/ComboBox/v3/ComboBoxCTX.d.ts +6 -0
- package/types/ComboBox/v3/ComboboxDataTestids.d.ts +11 -0
- package/types/ComboBox/v3/config/constants.d.ts +8 -0
- package/types/ComboBox/v3/config/useComboBox.d.ts +2 -0
- package/types/ComboBox/v3/config/useGetPropsWithDefault.d.ts +2 -0
- package/types/ComboBox/v3/index.d.ts +1 -0
- package/types/ComboBox/v3/parts/a11y-messages/MultiAllyMessages.d.ts +3 -0
- package/types/ComboBox/v3/parts/a11y-messages/SingleAllyMessages.d.ts +3 -0
- package/types/ComboBox/v3/parts/a11y-messages/index.d.ts +2 -0
- package/types/ComboBox/v3/parts/a11y-messages/styled.d.ts +1 -0
- package/types/ComboBox/v3/parts/container/Container.d.ts +3 -0
- package/types/ComboBox/v3/parts/container/index.d.ts +1 -0
- package/types/ComboBox/v3/parts/container/styled.d.ts +3 -0
- package/types/ComboBox/v3/parts/controls/Controls.d.ts +3 -0
- package/types/ComboBox/v3/parts/controls/index.d.ts +1 -0
- package/types/ComboBox/v3/parts/controls/styled.d.ts +7 -0
- package/types/ComboBox/v3/parts/controls-input/ControlsInput.d.ts +3 -0
- package/types/ComboBox/v3/parts/controls-input/styled.d.ts +4 -0
- package/types/ComboBox/v3/parts/controls-input/useControlsInput.d.ts +12 -0
- package/types/ComboBox/v3/parts/dropdown-indicator/DropdownIndicator.d.ts +3 -0
- package/types/ComboBox/v3/parts/dropdown-indicator/index.d.ts +0 -0
- package/types/ComboBox/v3/parts/dropdown-indicator/styled.d.ts +1 -0
- package/types/ComboBox/v3/parts/empty-state/index.d.ts +3 -0
- package/types/ComboBox/v3/parts/empty-state/styled.d.ts +2 -0
- package/types/ComboBox/v3/parts/header-list/HeaderList.d.ts +3 -0
- package/types/ComboBox/v3/parts/header-list/index.d.ts +1 -0
- package/types/ComboBox/v3/parts/header-list/styled.d.ts +7 -0
- package/types/ComboBox/v3/parts/header-list/useHeaderListHandlers.d.ts +12 -0
- package/types/ComboBox/v3/parts/menu-list/MenuList.d.ts +3 -0
- package/types/ComboBox/v3/parts/menu-list/index.d.ts +1 -0
- package/types/ComboBox/v3/parts/menu-list/styled.d.ts +10 -0
- package/types/ComboBox/v3/parts/menu-list/useItemRenderer.d.ts +2 -0
- package/types/ComboBox/v3/parts/menu-list/useMenuList.d.ts +2 -0
- package/types/ComboBox/v3/parts/multi-selected-values-container/MultiSelectedValuesContainer.d.ts +3 -0
- package/types/ComboBox/v3/parts/multi-selected-values-container/index.d.ts +1 -0
- package/types/ComboBox/v3/parts/multi-selected-values-container/styled.d.ts +3 -0
- package/types/ComboBox/v3/parts/multi-selected-values-container/useGroupPills.d.ts +2 -0
- package/types/ComboBox/v3/parts/single-selected-value-container/SingleSelectedValueContainer.d.ts +3 -0
- package/types/ComboBox/v3/parts/single-selected-value-container/index.d.ts +1 -0
- package/types/ComboBox/v3/parts/single-selected-value-container/styled.d.ts +1 -0
- package/types/ComboBox/v3/propTypes.d.ts +51 -0
- package/types/ComboBox/v3/tests/combobox-general.test.d.ts +1 -0
- package/types/ComboBox/v3/tests/combobox-multi-select.test.d.ts +1 -0
- package/types/ComboBox/v3/tests/combobox-single-select.test.d.ts +1 -0
- package/types/ComboBox/v3/tests/combobox-special-keys.test.d.ts +1 -0
- package/types/ComboBox/v3/tests/utils.d.ts +22 -0
- package/types/ComboBox/v3/utils/hooks/useKeyboardNavigation.d.ts +4 -0
- package/types/ComboBox/v3/utils/hooks/useOnElementResize.d.ts +3 -0
- package/types/ComboBox/v3/utils/listHelper.d.ts +7 -0
- package/types/DateInput/DSDateInput.d.ts +97 -16
- package/types/DateInput/components/utils.d.ts +8 -8
- package/types/DateInput/props.d.ts +97 -16
- package/types/DateInputV2/components/DSDateInput.d.ts +72 -5
- package/types/DateInputV2/components/DateInputs.d.ts +1 -1
- package/types/DateInputV2/components/props.d.ts +61 -10
- package/types/DateInputV2/components/styled.d.ts +4 -4
- package/types/DateInputV2/components/utils.d.ts +8 -8
- package/types/FloatingLabelInput/DSFloatingLabelInput.d.ts +118 -20
- package/types/FormItem/DSFormItemLayout.d.ts +390 -60
- package/types/FormItem/Error/DSError.d.ts +21 -3
- package/types/FormItem/Suffix/Suffix.d.ts +3 -3
- package/types/FormItem/defaultProps.d.ts +118 -20
- package/types/FormItem/index.d.ts +1 -1
- package/types/FormItem/props.d.ts +229 -39
- package/types/InputGroup/DSInputGroup.d.ts +56 -8
- package/types/InputGroup/props.d.ts +43 -7
- package/types/InputMask/DSInputMask.d.ts +172 -30
- package/types/InputMask/mask_types/DateInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/DateTimeInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/DictionaryInputMask.d.ts +37 -36
- package/types/InputMask/mask_types/NumberInputMask.d.ts +46 -45
- package/types/InputMask/mask_types/PhoneInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/PhoneInternationalInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/SsnInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/UsZipCodeInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/ZipCodeSearchInputMask.d.ts +34 -33
- package/types/InputMask/props.d.ts +172 -30
- package/types/InputProtected/DSInputProtected.d.ts +57 -10
- package/types/InputProtected/index.d.ts +1 -0
- package/types/InputProtected/props.d.ts +43 -8
- package/types/LargeInputText/DSLargeInputText.d.ts +163 -27
- package/types/LargeInputText/props.d.ts +163 -27
- package/types/MenuItem/components/MenuItem/index.d.ts +20 -0
- package/types/MenuItem/components/MenuItem/styled.d.ts +1 -0
- package/types/MenuItem/components/MultiMenuItem/MultiMenuItem.d.ts +21 -0
- package/types/MenuItem/components/MultiMenuItem/styled.d.ts +1 -0
- package/types/MenuItem/components/Section/index.d.ts +12 -0
- package/types/MenuItem/components/Section/props.d.ts +14 -0
- package/types/MenuItem/components/Section/styled.d.ts +2 -0
- package/types/MenuItem/components/Separator/index.d.ts +8 -0
- package/types/MenuItem/components/Separator/styled.d.ts +2 -0
- package/types/MenuItem/components/SingleMenuItem/SingleMenuItem.d.ts +16 -0
- package/types/MenuItem/components/SubmenuItem/index.d.ts +20 -0
- package/types/MenuItem/components/SubmenuItem/styled.d.ts +2 -0
- package/types/MenuItem/components/index.d.ts +6 -0
- package/types/MenuItem/components/styled.d.ts +3 -0
- package/types/MenuItem/index.d.ts +1 -0
- package/types/MenuItem/props.d.ts +37 -0
- package/types/Radio/Circle.d.ts +1 -1
- package/types/Radio/DSRadio.d.ts +79 -13
- package/types/RadioGroup/DSRadioGroup.d.ts +51 -7
- package/types/RadioGroup/props.d.ts +37 -6
- package/types/SearchBox/DSSearchBox.d.ts +146 -21
- package/types/SearchBox/NavSearchBox.d.ts +18 -3
- package/types/SearchBox/SButton.d.ts +13 -2
- package/types/SearchBox/props.d.ts +133 -22
- package/types/SearchBox/styled.d.ts +1 -49
- package/types/TextBox/DSTextBox.d.ts +146 -21
- package/types/TimeInput/DSTimeInput.d.ts +83 -12
- package/types/TimeInput/utils.d.ts +8 -8
- package/types/Toggle/DSToggle.d.ts +84 -12
- package/types/index.d.ts +29 -10
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var ChevronSmallDown = require('@elliemae/ds-icons/ChevronSmallDown');
|
|
6
|
+
var ComboBoxCTX = require('../../ComboBoxCTX.js');
|
|
7
|
+
var styled = require('./styled.js');
|
|
8
|
+
var ComboboxDataTestids = require('../../ComboboxDataTestids.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
13
|
+
var ChevronSmallDown__default = /*#__PURE__*/_interopDefaultLegacy(ChevronSmallDown);
|
|
14
|
+
|
|
15
|
+
var _ChevronSmallDown;
|
|
16
|
+
|
|
17
|
+
const DropdownIndicator = () => {
|
|
18
|
+
const {
|
|
19
|
+
showPopover
|
|
20
|
+
} = React.useContext(ComboBoxCTX.ComboBoxContext);
|
|
21
|
+
return /*#__PURE__*/_jsx__default["default"](styled.StyledDropDownButton, {
|
|
22
|
+
"data-testid": ComboboxDataTestids.ComboboxDataTestid.DROPDOWN,
|
|
23
|
+
"aria-controls": "combo-listbox",
|
|
24
|
+
"aria-labelledby": "combo-label",
|
|
25
|
+
"aria-expanded": showPopover,
|
|
26
|
+
"aria-haspopup": "listbox",
|
|
27
|
+
buttonType: "text",
|
|
28
|
+
icon: _ChevronSmallDown || (_ChevronSmallDown = /*#__PURE__*/_jsx__default["default"](ChevronSmallDown__default["default"], {})),
|
|
29
|
+
tabIndex: -1
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
module.exports = DropdownIndicator;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var styled = require('styled-components');
|
|
6
|
+
var DSButton = require('@elliemae/ds-button');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
|
+
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
12
|
+
|
|
13
|
+
const StyledDropDownButton = /*#__PURE__*/styled__default["default"](DSButton__default["default"]).withConfig({
|
|
14
|
+
componentId: "sc-1ijoe1w-0"
|
|
15
|
+
})(["box-sizing:border-box;width:100;& svg{fill:", ";}"], props => props.theme.colors.brand['700']);
|
|
16
|
+
|
|
17
|
+
exports.StyledDropDownButton = StyledDropDownButton;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var ComboBoxCTX = require('../../ComboBoxCTX.js');
|
|
8
|
+
var styled = require('./styled.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
13
|
+
|
|
14
|
+
var _StyledNoResults, _StyledNoResults2;
|
|
15
|
+
|
|
16
|
+
const EmptyState = () => {
|
|
17
|
+
const {
|
|
18
|
+
props: {
|
|
19
|
+
onCreate
|
|
20
|
+
}
|
|
21
|
+
} = React.useContext(ComboBoxCTX.ComboBoxContext);
|
|
22
|
+
return /*#__PURE__*/_jsx__default["default"](styled.StyledNoResultsWrapper, {
|
|
23
|
+
id: "id-no-results"
|
|
24
|
+
}, void 0, onCreate ? _StyledNoResults || (_StyledNoResults = /*#__PURE__*/_jsx__default["default"](styled.StyledNoResults, {}, void 0, "No items match your search, click RETURN at any point to add your unique entry to the field")) : _StyledNoResults2 || (_StyledNoResults2 = /*#__PURE__*/_jsx__default["default"](styled.StyledNoResults, {}, void 0, "No matches found.")));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.EmptyState = EmptyState;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var styled = require('styled-components');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
10
|
+
|
|
11
|
+
const StyledNoResultsWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
12
|
+
componentId: "sc-o4fon6-0"
|
|
13
|
+
})(["padding:16px;"]);
|
|
14
|
+
const StyledNoResults = /*#__PURE__*/styled__default["default"].span.withConfig({
|
|
15
|
+
componentId: "sc-o4fon6-1"
|
|
16
|
+
})([""]);
|
|
17
|
+
|
|
18
|
+
exports.StyledNoResults = StyledNoResults;
|
|
19
|
+
exports.StyledNoResultsWrapper = StyledNoResultsWrapper;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var lodash = require('lodash');
|
|
8
|
+
var ComboBoxCTX = require('../../ComboBoxCTX.js');
|
|
9
|
+
var styled = require('./styled.js');
|
|
10
|
+
var listHelper = require('../../utils/listHelper.js');
|
|
11
|
+
var ComboboxDataTestids = require('../../ComboboxDataTestids.js');
|
|
12
|
+
var useHeaderListHandlers = require('./useHeaderListHandlers.js');
|
|
13
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
14
|
+
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
18
|
+
|
|
19
|
+
var _StyledSeparator, _StyledNoOptionsSelec, _StyledSeparator2;
|
|
20
|
+
|
|
21
|
+
const HeaderList = () => {
|
|
22
|
+
var _inputRef$current;
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
props: {
|
|
26
|
+
onSelectAll,
|
|
27
|
+
onClearAll,
|
|
28
|
+
withToggle,
|
|
29
|
+
selectedValues,
|
|
30
|
+
options
|
|
31
|
+
},
|
|
32
|
+
showSelectedOptions,
|
|
33
|
+
inputRef
|
|
34
|
+
} = React.useContext(ComboBoxCTX.ComboBoxContext);
|
|
35
|
+
const isSelectAllSupplied = onSelectAll !== lodash.noop;
|
|
36
|
+
const isClearAllSupplied = onClearAll !== lodash.noop;
|
|
37
|
+
const multiSelectedValues = selectedValues;
|
|
38
|
+
const selectableOptions = listHelper.getSelectableOptions(options);
|
|
39
|
+
const {
|
|
40
|
+
handleKeyDown,
|
|
41
|
+
handleClickOnClearAll,
|
|
42
|
+
handleClickOnSelectAll,
|
|
43
|
+
handleOnBlurClearAll,
|
|
44
|
+
handleOnBlurSelectAll,
|
|
45
|
+
handleOnMouseDown,
|
|
46
|
+
handleToggle
|
|
47
|
+
} = useHeaderListHandlers.useHeaderListHandlers();
|
|
48
|
+
return /*#__PURE__*/_jsx__default["default"](styled.StyledHeaderListWrapper, {
|
|
49
|
+
onKeyDown: handleKeyDown,
|
|
50
|
+
onMouseDown: handleOnMouseDown
|
|
51
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](styled.StyledSelectedItems, {}, void 0, isSelectAllSupplied && /*#__PURE__*/_jsx__default["default"](styled.StyledButton, {
|
|
52
|
+
disabled: (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value) !== '' || selectableOptions.length === multiSelectedValues.length,
|
|
53
|
+
"data-testid": ComboboxDataTestids.ComboboxDataTestid.SELECT_ALL_BUTTON,
|
|
54
|
+
buttonType: "text",
|
|
55
|
+
labelText: "All",
|
|
56
|
+
size: "s",
|
|
57
|
+
onMouseDown: handleOnMouseDown,
|
|
58
|
+
onBlur: handleOnBlurSelectAll,
|
|
59
|
+
onClick: handleClickOnSelectAll
|
|
60
|
+
}), isSelectAllSupplied && isClearAllSupplied && (_StyledSeparator || (_StyledSeparator = /*#__PURE__*/_jsx__default["default"](styled.StyledSeparator, {
|
|
61
|
+
orientation: "vertical",
|
|
62
|
+
position: "center",
|
|
63
|
+
type: "group-level",
|
|
64
|
+
margin: "none"
|
|
65
|
+
}))), isClearAllSupplied && /*#__PURE__*/_jsx__default["default"](styled.StyledButton, {
|
|
66
|
+
disabled: multiSelectedValues.length === 0,
|
|
67
|
+
tabIndex: 0,
|
|
68
|
+
"data-testid": ComboboxDataTestids.ComboboxDataTestid.CLEAR_ALL_BUTTON,
|
|
69
|
+
buttonType: "text",
|
|
70
|
+
size: "s",
|
|
71
|
+
labelText: "Clear",
|
|
72
|
+
onMouseDown: handleOnMouseDown,
|
|
73
|
+
onBlur: handleOnBlurClearAll,
|
|
74
|
+
onClick: handleClickOnClearAll
|
|
75
|
+
})), /*#__PURE__*/_jsx__default["default"](styled.StyledSelectedItems, {}, void 0, withToggle ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
76
|
+
children: multiSelectedValues.length > 0 ? /*#__PURE__*/_jsx__default["default"](styled.StyledButtonSelection, {
|
|
77
|
+
buttonType: "text",
|
|
78
|
+
disabled: !showSelectedOptions && selectableOptions.length === multiSelectedValues.length,
|
|
79
|
+
onClick: handleToggle,
|
|
80
|
+
labelText: !showSelectedOptions ? "".concat(multiSelectedValues.length, " SELECTED") : 'SHOW ALL',
|
|
81
|
+
size: "s"
|
|
82
|
+
}) : _StyledNoOptionsSelec || (_StyledNoOptionsSelec = /*#__PURE__*/_jsx__default["default"](styled.StyledNoOptionsSelected, {}, void 0, "0 SELECTED"))
|
|
83
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
84
|
+
children: [/*#__PURE__*/_jsx__default["default"](styled.StyledShowAllButton, {
|
|
85
|
+
buttonType: "text",
|
|
86
|
+
"data-testid": ComboboxDataTestids.ComboboxDataTestid.SHOW_ALL_BUTTON,
|
|
87
|
+
tabIndex: !showSelectedOptions ? -1 : 0,
|
|
88
|
+
onClick: showSelectedOptions ? handleToggle : lodash.noop,
|
|
89
|
+
labelText: "SHOW ALL",
|
|
90
|
+
isSelected: !showSelectedOptions,
|
|
91
|
+
size: "s",
|
|
92
|
+
style: {
|
|
93
|
+
fontWeight: showSelectedOptions ? '300' : '600'
|
|
94
|
+
}
|
|
95
|
+
}), _StyledSeparator2 || (_StyledSeparator2 = /*#__PURE__*/_jsx__default["default"](styled.StyledSeparator, {
|
|
96
|
+
orientation: "vertical",
|
|
97
|
+
position: "center",
|
|
98
|
+
type: "group-level",
|
|
99
|
+
margin: "none"
|
|
100
|
+
})), /*#__PURE__*/_jsx__default["default"](styled.StyledButtonSelection, {
|
|
101
|
+
tabIndex: showSelectedOptions ? -1 : 0,
|
|
102
|
+
"data-testid": ComboboxDataTestids.ComboboxDataTestid.SHOW_SELECTED_OPTIONS_BUTTON,
|
|
103
|
+
disabled: multiSelectedValues.length === 0 || !showSelectedOptions && selectableOptions.length === multiSelectedValues.length,
|
|
104
|
+
buttonType: "text",
|
|
105
|
+
isSelected: showSelectedOptions,
|
|
106
|
+
onClick: !showSelectedOptions ? handleToggle : lodash.noop,
|
|
107
|
+
labelText: "".concat(multiSelectedValues.length, " SELECTED"),
|
|
108
|
+
size: "s"
|
|
109
|
+
})]
|
|
110
|
+
})));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
exports.HeaderList = HeaderList;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
6
|
+
var styled = require('styled-components');
|
|
7
|
+
var dsSystem = require('@elliemae/ds-system');
|
|
8
|
+
var DSButton = require('@elliemae/ds-button');
|
|
9
|
+
var DSSeparator = require('@elliemae/ds-separator');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
|
|
14
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
15
|
+
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
16
|
+
var DSSeparator__default = /*#__PURE__*/_interopDefaultLegacy(DSSeparator);
|
|
17
|
+
|
|
18
|
+
var _templateObject;
|
|
19
|
+
|
|
20
|
+
const selectedStyle = isSelected => dsSystem.css(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n & span {\n border-bottom: 2px solid ", ";\n }\n cursor: ", ";\n"])), props => isSelected ? props.theme.colors.brand[700] : '#FFF', isSelected && 'default');
|
|
21
|
+
|
|
22
|
+
const StyledHeaderListWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
23
|
+
componentId: "sc-dazbzt-0"
|
|
24
|
+
})(["display:flex;position:fixed;top:0;z-index:10;justify-content:space-between;padding:0px 12px 0px 12px;width:100%;height:28px;background-color:#fff;box-shadow:0 4px 2px -4px ", ";overflow-x:hidden;& button{font-size:13px;}"], props => props.theme.colors.neutral[700]);
|
|
25
|
+
const StyledSeparator = /*#__PURE__*/styled__default["default"](DSSeparator__default["default"]).withConfig({
|
|
26
|
+
componentId: "sc-dazbzt-1"
|
|
27
|
+
})(["height:50%;width:auto;"]);
|
|
28
|
+
const StyledButton = /*#__PURE__*/styled__default["default"](DSButton__default["default"]).withConfig({
|
|
29
|
+
componentId: "sc-dazbzt-2"
|
|
30
|
+
})(["padding:0 ", ";align-items:center;"], props => props.theme.space.xxs);
|
|
31
|
+
const StyledGeneralSelectionButton = /*#__PURE__*/styled__default["default"](DSButton__default["default"]).withConfig({
|
|
32
|
+
componentId: "sc-dazbzt-3"
|
|
33
|
+
})(["border-radius:0px;padding:0 ", ";margin:0;align-items:center;", " transition:unset;"], props => props.theme.space.xxs, _ref => {
|
|
34
|
+
let {
|
|
35
|
+
isSelected
|
|
36
|
+
} = _ref;
|
|
37
|
+
return selectedStyle(isSelected);
|
|
38
|
+
});
|
|
39
|
+
const StyledButtonSelection = /*#__PURE__*/styled__default["default"](StyledGeneralSelectionButton).withConfig({
|
|
40
|
+
componentId: "sc-dazbzt-4"
|
|
41
|
+
})(["&:hover:not([disabled]){background-color:transparent;color:", ";}"], props => props.theme.colors.brand['700']);
|
|
42
|
+
const StyledShowAllButton = /*#__PURE__*/styled__default["default"](StyledGeneralSelectionButton).withConfig({
|
|
43
|
+
componentId: "sc-dazbzt-5"
|
|
44
|
+
})(["color:", ";&:hover:not([disabled]){background-color:transparent;color:", ";}"], props => props.theme.colors.neutral['700'], props => props.theme.colors.neutral['700']);
|
|
45
|
+
const StyledSelectedItems = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
46
|
+
componentId: "sc-dazbzt-6"
|
|
47
|
+
})(["display:flex;align-items:center;"]);
|
|
48
|
+
const StyledNoOptionsSelected = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
49
|
+
componentId: "sc-dazbzt-7"
|
|
50
|
+
})(["padding:0 ", ";"], props => props.theme.space.xxs);
|
|
51
|
+
|
|
52
|
+
exports.StyledButton = StyledButton;
|
|
53
|
+
exports.StyledButtonSelection = StyledButtonSelection;
|
|
54
|
+
exports.StyledHeaderListWrapper = StyledHeaderListWrapper;
|
|
55
|
+
exports.StyledNoOptionsSelected = StyledNoOptionsSelected;
|
|
56
|
+
exports.StyledSelectedItems = StyledSelectedItems;
|
|
57
|
+
exports.StyledSeparator = StyledSeparator;
|
|
58
|
+
exports.StyledShowAllButton = StyledShowAllButton;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var ComboBoxCTX = require('../../ComboBoxCTX.js');
|
|
7
|
+
|
|
8
|
+
const useHeaderListHandlers = () => {
|
|
9
|
+
const {
|
|
10
|
+
props: {
|
|
11
|
+
onSelectAll,
|
|
12
|
+
onFilter,
|
|
13
|
+
onClearAll,
|
|
14
|
+
selectedValues
|
|
15
|
+
},
|
|
16
|
+
inputRef,
|
|
17
|
+
showSelectedOptions,
|
|
18
|
+
setShowSelectedOptions,
|
|
19
|
+
setShowPopover
|
|
20
|
+
} = React.useContext(ComboBoxCTX.ComboBoxContext);
|
|
21
|
+
const multiSelectedValues = selectedValues;
|
|
22
|
+
const handleOnBlurSelectAll = React.useCallback(e => {
|
|
23
|
+
if (!onClearAll || multiSelectedValues.length === 0) {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
inputRef.current.focus();
|
|
26
|
+
}
|
|
27
|
+
}, [inputRef, onClearAll, multiSelectedValues]);
|
|
28
|
+
const handleOnBlurClearAll = React.useCallback(e => {// since ux change order from the action buttons this is unneccesary. will comment until review finish
|
|
29
|
+
// e.preventDefault();
|
|
30
|
+
// inputRef.current.focus();
|
|
31
|
+
}, [inputRef]);
|
|
32
|
+
const handleClickOnSelectAll = React.useCallback(() => {
|
|
33
|
+
onSelectAll();
|
|
34
|
+
inputRef.current.focus();
|
|
35
|
+
}, [onSelectAll, inputRef, setShowPopover]);
|
|
36
|
+
const handleClickOnClearAll = React.useCallback(e => {
|
|
37
|
+
setShowSelectedOptions(false);
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
e.stopPropagation();
|
|
40
|
+
onClearAll();
|
|
41
|
+
inputRef.current.focus();
|
|
42
|
+
}, [inputRef, setShowSelectedOptions, onClearAll]);
|
|
43
|
+
const handleOnMouseDown = React.useCallback(e => {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
}, []);
|
|
46
|
+
const handleToggle = React.useCallback(() => {
|
|
47
|
+
inputRef.current.value = '';
|
|
48
|
+
onFilter('');
|
|
49
|
+
setShowSelectedOptions(!showSelectedOptions);
|
|
50
|
+
inputRef.current.focus();
|
|
51
|
+
}, [setShowSelectedOptions, inputRef, onFilter, showSelectedOptions]);
|
|
52
|
+
const handleKeyDown = React.useCallback(e => {
|
|
53
|
+
if (e.key === 'Escape') {
|
|
54
|
+
setShowPopover(false);
|
|
55
|
+
}
|
|
56
|
+
}, [setShowPopover]);
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
if (multiSelectedValues.length === 0) {
|
|
59
|
+
setShowSelectedOptions(false);
|
|
60
|
+
}
|
|
61
|
+
}, [multiSelectedValues, setShowSelectedOptions]);
|
|
62
|
+
return React.useMemo(() => ({
|
|
63
|
+
handleKeyDown,
|
|
64
|
+
handleToggle,
|
|
65
|
+
handleOnMouseDown,
|
|
66
|
+
handleClickOnClearAll,
|
|
67
|
+
handleClickOnSelectAll,
|
|
68
|
+
handleOnBlurClearAll,
|
|
69
|
+
handleOnBlurSelectAll
|
|
70
|
+
}), [handleKeyDown, handleToggle, handleOnMouseDown, handleClickOnClearAll, handleClickOnSelectAll, handleOnBlurClearAll, handleOnBlurSelectAll]);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
exports.useHeaderListHandlers = useHeaderListHandlers;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var styled = require('./styled.js');
|
|
8
|
+
var ComboboxDataTestids = require('../../ComboboxDataTestids.js');
|
|
9
|
+
var ComboBoxCTX = require('../../ComboBoxCTX.js');
|
|
10
|
+
var HeaderList = require('../header-list/HeaderList.js');
|
|
11
|
+
var useOnElementResize = require('../../utils/hooks/useOnElementResize.js');
|
|
12
|
+
var index = require('../empty-state/index.js');
|
|
13
|
+
var useItemRenderer = require('./useItemRenderer.js');
|
|
14
|
+
var useMenuList = require('./useMenuList.js');
|
|
15
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
+
|
|
19
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
20
|
+
|
|
21
|
+
var _HeaderList, _EmptyState;
|
|
22
|
+
|
|
23
|
+
const MenuList = () => {
|
|
24
|
+
const {
|
|
25
|
+
props: {
|
|
26
|
+
menuMinWidth,
|
|
27
|
+
menuMaxHeight,
|
|
28
|
+
inline,
|
|
29
|
+
options,
|
|
30
|
+
selectedValues
|
|
31
|
+
},
|
|
32
|
+
referenceElement,
|
|
33
|
+
inputRef,
|
|
34
|
+
listRef,
|
|
35
|
+
showPopover,
|
|
36
|
+
wrapperListRef,
|
|
37
|
+
controlsWrapperRef,
|
|
38
|
+
virtualListHelpers: {
|
|
39
|
+
totalSize
|
|
40
|
+
}
|
|
41
|
+
} = React.useContext(ComboBoxCTX.ComboBoxContext);
|
|
42
|
+
const multiple = Array.isArray(selectedValues);
|
|
43
|
+
const withHeader = !inline && multiple && options.length > 0;
|
|
44
|
+
const ItemRenderer = useItemRenderer.useItemRenderer();
|
|
45
|
+
useMenuList.useMenuList();
|
|
46
|
+
useOnElementResize.useOnElementResize(controlsWrapperRef);
|
|
47
|
+
const listWidth = React.useMemo(() => menuMinWidth || "".concat(referenceElement === null || referenceElement === void 0 ? void 0 : referenceElement.offsetWidth), [menuMinWidth, referenceElement]);
|
|
48
|
+
const handleOnFocus = React.useCallback(() => {
|
|
49
|
+
var _inputRef$current;
|
|
50
|
+
|
|
51
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
52
|
+
}, [inputRef]);
|
|
53
|
+
return /*#__PURE__*/jsxRuntime.jsxs(styled.StyledListWrapper, {
|
|
54
|
+
tabIndex: -1,
|
|
55
|
+
ref: wrapperListRef,
|
|
56
|
+
inline: inline,
|
|
57
|
+
onMouseDown: e => e.preventDefault(),
|
|
58
|
+
minWidth: listWidth,
|
|
59
|
+
id: "combo-listbox",
|
|
60
|
+
role: "listbox",
|
|
61
|
+
children: [withHeader && (_HeaderList || (_HeaderList = /*#__PURE__*/_jsx__default["default"](HeaderList.HeaderList, {}))), options.length > 0 ? /*#__PURE__*/jsxRuntime.jsx(styled.StyledVirtualListWrapper, {
|
|
62
|
+
tabIndex: -1,
|
|
63
|
+
inline: inline,
|
|
64
|
+
maxHeight: menuMaxHeight,
|
|
65
|
+
ref: listRef,
|
|
66
|
+
withHeader: withHeader,
|
|
67
|
+
children: /*#__PURE__*/_jsx__default["default"](styled.StyledList, {
|
|
68
|
+
tabIndex: -1,
|
|
69
|
+
"aria-expanded": showPopover,
|
|
70
|
+
onFocus: handleOnFocus,
|
|
71
|
+
"data-testid": ComboboxDataTestids.ComboboxDataTestid.LIST,
|
|
72
|
+
style: {
|
|
73
|
+
height: totalSize,
|
|
74
|
+
margin: inline ? '0px' : '8px 0px'
|
|
75
|
+
}
|
|
76
|
+
}, void 0, ItemRenderer)
|
|
77
|
+
}) : _EmptyState || (_EmptyState = /*#__PURE__*/_jsx__default["default"](index.EmptyState, {}))]
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
exports.MenuList = MenuList;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var styled = require('styled-components');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
10
|
+
|
|
11
|
+
const StyledListWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
12
|
+
componentId: "sc-1uedyf-0"
|
|
13
|
+
})(["min-width:", ";"], props => props.inline ? '100%' : "".concat(props.minWidth, "px"));
|
|
14
|
+
const StyledList = /*#__PURE__*/styled__default["default"].ul.withConfig({
|
|
15
|
+
componentId: "sc-1uedyf-1"
|
|
16
|
+
})(["position:relative;padding:0;"]);
|
|
17
|
+
const StyledVirtualListWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
18
|
+
componentId: "sc-1uedyf-2"
|
|
19
|
+
})(["overflow-y:auto;margin-top:", ";max-height:", ";"], _ref => {
|
|
20
|
+
let {
|
|
21
|
+
withHeader
|
|
22
|
+
} = _ref;
|
|
23
|
+
return withHeader ? '28px' : '';
|
|
24
|
+
}, _ref2 => {
|
|
25
|
+
let {
|
|
26
|
+
maxHeight,
|
|
27
|
+
inline
|
|
28
|
+
} = _ref2;
|
|
29
|
+
return inline ? '' : "".concat(!maxHeight ? '400' : maxHeight, "px");
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
exports.StyledList = StyledList;
|
|
33
|
+
exports.StyledListWrapper = StyledListWrapper;
|
|
34
|
+
exports.StyledVirtualListWrapper = StyledVirtualListWrapper;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
13
|
+
var React = require('react');
|
|
14
|
+
var dsForm = require('@elliemae/ds-form');
|
|
15
|
+
var ComboBoxCTX = require('../../ComboBoxCTX.js');
|
|
16
|
+
var listHelper = require('../../utils/listHelper.js');
|
|
17
|
+
var ComboboxDataTestids = require('../../ComboboxDataTestids.js');
|
|
18
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
+
|
|
22
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
23
|
+
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
27
|
+
|
|
28
|
+
const useItemRenderer = () => {
|
|
29
|
+
const {
|
|
30
|
+
props: {
|
|
31
|
+
options,
|
|
32
|
+
onChange,
|
|
33
|
+
selectedValues,
|
|
34
|
+
onFilter
|
|
35
|
+
},
|
|
36
|
+
inputRef,
|
|
37
|
+
setShowPopover,
|
|
38
|
+
focusOptionIdx,
|
|
39
|
+
virtualListHelpers
|
|
40
|
+
} = React.useContext(ComboBoxCTX.ComboBoxContext);
|
|
41
|
+
const {
|
|
42
|
+
virtualItems
|
|
43
|
+
} = virtualListHelpers;
|
|
44
|
+
const multiple = Array.isArray(selectedValues);
|
|
45
|
+
const CBItem = multiple ? dsForm.MultiMenuItem : dsForm.SingleMenuItem;
|
|
46
|
+
const handleClick = React.useCallback((option, e) => {
|
|
47
|
+
var _inputRef$current;
|
|
48
|
+
|
|
49
|
+
if (!multiple) {
|
|
50
|
+
setShowPopover(false);
|
|
51
|
+
if (inputRef.current) inputRef.current.value = '';
|
|
52
|
+
} else if (inputRef.current) {
|
|
53
|
+
onFilter(inputRef.current.value);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
onChange(option);
|
|
57
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
58
|
+
e.stopPropagation();
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
}, [onFilter, onChange, setShowPopover, multiple, inputRef]);
|
|
61
|
+
const handleOnMouseDown = React.useCallback(e => {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
}, []);
|
|
64
|
+
const ItemRenderer = React.useMemo(() => virtualItems.map(vItem => {
|
|
65
|
+
const option = options[vItem.index];
|
|
66
|
+
const generalProps = {
|
|
67
|
+
wrapperStyles: {
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
top: vItem.start,
|
|
70
|
+
left: 0,
|
|
71
|
+
width: '100%'
|
|
72
|
+
},
|
|
73
|
+
key: "".concat(option.dsId),
|
|
74
|
+
innerRef: vItem.measureRef
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
if (option.type === 'section') {
|
|
78
|
+
return /*#__PURE__*/jsxRuntime.jsx(dsForm.Section, _objectSpread({
|
|
79
|
+
label: option.label
|
|
80
|
+
}, generalProps));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (option.type === 'separator') {
|
|
84
|
+
return /*#__PURE__*/jsxRuntime.jsx(dsForm.Separator, _objectSpread({}, generalProps));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (option.type === 'option') {
|
|
88
|
+
return /*#__PURE__*/jsxRuntime.jsx(CBItem, _objectSpread(_objectSpread({}, generalProps), {}, {
|
|
89
|
+
value: option.value,
|
|
90
|
+
label: option.label,
|
|
91
|
+
dataTestid: ComboboxDataTestids.ComboboxDataTestid.OPTION,
|
|
92
|
+
disabled: option.disabled,
|
|
93
|
+
onClick: e => handleClick(option, e),
|
|
94
|
+
onMouseDown: handleOnMouseDown,
|
|
95
|
+
isActive: option.dsId === focusOptionIdx,
|
|
96
|
+
isSelected: listHelper.isSelected(selectedValues, option)
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
101
|
+
}), [options, focusOptionIdx, selectedValues, inputRef, virtualItems]);
|
|
102
|
+
return ItemRenderer;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
exports.useItemRenderer = useItemRenderer;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var ComboBoxCTX = require('../../ComboBoxCTX.js');
|
|
7
|
+
|
|
8
|
+
const useMenuList = () => {
|
|
9
|
+
var _inputRef$current;
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
props: {
|
|
13
|
+
inline,
|
|
14
|
+
selectedValues,
|
|
15
|
+
onMenuOpen,
|
|
16
|
+
options
|
|
17
|
+
},
|
|
18
|
+
inputRef,
|
|
19
|
+
setCurrentOption,
|
|
20
|
+
scrollOptionIntoView,
|
|
21
|
+
hasFocus,
|
|
22
|
+
showPopover
|
|
23
|
+
} = React.useContext(ComboBoxCTX.ComboBoxContext);
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
const getFirstOption = () => {
|
|
26
|
+
for (let i = 0; i < options.length; i += 1) if (!['section', 'separator'].includes(options[i].type)) {
|
|
27
|
+
setCurrentOption(options[i].dsId);
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
if (showPopover || inline) {
|
|
33
|
+
onMenuOpen();
|
|
34
|
+
|
|
35
|
+
if (inputRef.current.value !== '') {
|
|
36
|
+
getFirstOption();
|
|
37
|
+
} else if (Array.isArray(selectedValues)) {
|
|
38
|
+
const multiSelectedValues = selectedValues;
|
|
39
|
+
|
|
40
|
+
if (multiSelectedValues.length > 0) {
|
|
41
|
+
setCurrentOption(multiSelectedValues[multiSelectedValues.length - 1].dsId);
|
|
42
|
+
scrollOptionIntoView(multiSelectedValues[multiSelectedValues.length - 1].dsId);
|
|
43
|
+
} else {
|
|
44
|
+
getFirstOption();
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
const singleSelectedValue = selectedValues;
|
|
48
|
+
|
|
49
|
+
if (singleSelectedValue) {
|
|
50
|
+
setCurrentOption(selectedValues.dsId);
|
|
51
|
+
scrollOptionIntoView(selectedValues.dsId);
|
|
52
|
+
} else {
|
|
53
|
+
getFirstOption();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
+
|
|
58
|
+
}, [showPopover, inline, hasFocus, (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value]);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
exports.useMenuList = useMenuList;
|