@laerdal/life-react-components 1.7.0 → 1.8.0-dev.10
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/Accordion/ContentAccordion.cjs +1 -1
- package/dist/Accordion/ContentAccordion.cjs.map +1 -1
- package/dist/Accordion/ContentAccordion.js +2 -2
- package/dist/Accordion/ContentAccordion.js.map +1 -1
- package/dist/Accordion/styles.cjs +1 -1
- package/dist/Accordion/styles.cjs.map +1 -1
- package/dist/Accordion/styles.js +2 -2
- package/dist/Accordion/styles.js.map +1 -1
- package/dist/Banners/Banner.cjs +3 -3
- package/dist/Banners/Banner.cjs.map +1 -1
- package/dist/Banners/Banner.js +3 -3
- package/dist/Banners/Banner.js.map +1 -1
- package/dist/Banners/styles.cjs +1 -1
- package/dist/Banners/styles.cjs.map +1 -1
- package/dist/Banners/styles.js +1 -1
- package/dist/Banners/styles.js.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.cjs +1 -0
- package/dist/Breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.js +1 -0
- package/dist/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/Button/BackButton.cjs +5 -2
- package/dist/Button/BackButton.cjs.map +1 -1
- package/dist/Button/BackButton.js +5 -3
- package/dist/Button/BackButton.js.map +1 -1
- package/dist/Button/Button.cjs +14 -28
- package/dist/Button/Button.cjs.map +1 -1
- package/dist/Button/Button.d.ts +3 -2
- package/dist/Button/Button.js +15 -29
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/DualFunctionButton.cjs +30 -8
- package/dist/Button/DualFunctionButton.cjs.map +1 -1
- package/dist/Button/DualFunctionButton.js +28 -7
- package/dist/Button/DualFunctionButton.js.map +1 -1
- package/dist/Button/Iconbutton.cjs +23 -32
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.d.ts +3 -0
- package/dist/Button/Iconbutton.js +20 -32
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/Card/Card.cjs +28 -44
- package/dist/Card/Card.cjs.map +1 -1
- package/dist/Card/Card.d.ts +3 -11
- package/dist/Card/Card.js +26 -44
- package/dist/Card/Card.js.map +1 -1
- package/dist/Card/CardBottomSection.cjs +33 -24
- package/dist/Card/CardBottomSection.cjs.map +1 -1
- package/dist/Card/CardBottomSection.d.ts +11 -2
- package/dist/Card/CardBottomSection.js +17 -24
- package/dist/Card/CardBottomSection.js.map +1 -1
- package/dist/Card/CardMiddleSection.cjs +38 -17
- package/dist/Card/CardMiddleSection.cjs.map +1 -1
- package/dist/Card/CardMiddleSection.d.ts +16 -3
- package/dist/Card/CardMiddleSection.js +30 -17
- package/dist/Card/CardMiddleSection.js.map +1 -1
- package/dist/Card/CardTopSection.cjs +27 -20
- package/dist/Card/CardTopSection.cjs.map +1 -1
- package/dist/Card/CardTopSection.d.ts +12 -4
- package/dist/Card/CardTopSection.js +17 -20
- package/dist/Card/CardTopSection.js.map +1 -1
- package/dist/Card/index.cjs +45 -9
- package/dist/Card/index.cjs.map +1 -1
- package/dist/Card/index.d.ts +3 -1
- package/dist/Card/index.js +3 -1
- package/dist/Card/index.js.map +1 -1
- package/dist/Chips/ActionChip.cjs +4 -4
- package/dist/Chips/ActionChip.cjs.map +1 -1
- package/dist/Chips/ActionChip.js +4 -4
- package/dist/Chips/ActionChip.js.map +1 -1
- package/dist/Chips/ChipStyles.cjs +5 -17
- package/dist/Chips/ChipStyles.cjs.map +1 -1
- package/dist/Chips/ChipStyles.d.ts +0 -3
- package/dist/Chips/ChipStyles.js +5 -8
- package/dist/Chips/ChipStyles.js.map +1 -1
- package/dist/Chips/ChipTypes.d.ts +8 -20
- package/dist/Chips/ChoiceChips.cjs +2 -2
- package/dist/Chips/ChoiceChips.cjs.map +1 -1
- package/dist/Chips/ChoiceChips.js +2 -2
- package/dist/Chips/ChoiceChips.js.map +1 -1
- package/dist/Chips/FilterChip.cjs +3 -3
- package/dist/Chips/FilterChip.cjs.map +1 -1
- package/dist/Chips/FilterChip.js +3 -3
- package/dist/Chips/FilterChip.js.map +1 -1
- package/dist/Chips/InputChip.cjs +21 -12
- package/dist/Chips/InputChip.cjs.map +1 -1
- package/dist/Chips/InputChip.js +21 -13
- package/dist/Chips/InputChip.js.map +1 -1
- package/dist/Chips/index.cjs +1 -1
- package/dist/Chips/index.cjs.map +1 -1
- package/dist/Chips/index.d.ts +1 -1
- package/dist/Chips/index.js +1 -1
- package/dist/Chips/index.js.map +1 -1
- package/dist/ChipsInput/ChipDropdownInput.cjs +400 -0
- package/dist/ChipsInput/ChipDropdownInput.cjs.map +1 -0
- package/dist/ChipsInput/ChipDropdownInput.d.ts +21 -0
- package/dist/ChipsInput/ChipDropdownInput.js +382 -0
- package/dist/ChipsInput/ChipDropdownInput.js.map +1 -0
- package/dist/ChipsInput/ChipInput.cjs +139 -0
- package/dist/ChipsInput/ChipInput.cjs.map +1 -0
- package/dist/{Chips → ChipsInput}/ChipInput.d.ts +1 -4
- package/dist/ChipsInput/ChipInput.js +120 -0
- package/dist/ChipsInput/ChipInput.js.map +1 -0
- package/dist/ChipsInput/ChipInputField.cjs +232 -0
- package/dist/ChipsInput/ChipInputField.cjs.map +1 -0
- package/dist/ChipsInput/ChipInputField.d.ts +25 -0
- package/dist/ChipsInput/ChipInputField.js +192 -0
- package/dist/ChipsInput/ChipInputField.js.map +1 -0
- package/dist/ChipsInput/ChipInputTypes.cjs +6 -0
- package/dist/ChipsInput/ChipInputTypes.cjs.map +1 -0
- package/dist/ChipsInput/ChipInputTypes.d.ts +22 -0
- package/dist/ChipsInput/ChipInputTypes.js +2 -0
- package/dist/ChipsInput/ChipInputTypes.js.map +1 -0
- package/dist/ChipsInput/index.cjs +19 -0
- package/dist/ChipsInput/index.cjs.map +1 -0
- package/dist/ChipsInput/index.d.ts +1 -0
- package/dist/ChipsInput/index.js +2 -0
- package/dist/ChipsInput/index.js.map +1 -0
- package/dist/Dropdown/BasicDropdown.cjs +40 -20
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.d.ts +2 -2
- package/dist/Dropdown/BasicDropdown.js +43 -22
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/CommonStyling.cjs +32 -18
- package/dist/Dropdown/CommonStyling.cjs.map +1 -1
- package/dist/Dropdown/CommonStyling.d.ts +7 -6
- package/dist/Dropdown/CommonStyling.js +18 -17
- package/dist/Dropdown/CommonStyling.js.map +1 -1
- package/dist/Dropdown/DropdownButton.cjs +94 -29
- package/dist/Dropdown/DropdownButton.cjs.map +1 -1
- package/dist/Dropdown/DropdownButton.d.ts +1 -1
- package/dist/Dropdown/DropdownButton.js +89 -29
- package/dist/Dropdown/DropdownButton.js.map +1 -1
- package/dist/Dropdown/DropdownButtonTypes.d.ts +16 -5
- package/dist/Dropdown/DropdownContent.cjs +167 -132
- package/dist/Dropdown/DropdownContent.cjs.map +1 -1
- package/dist/Dropdown/DropdownContent.d.ts +2 -2
- package/dist/Dropdown/DropdownContent.js +164 -133
- package/dist/Dropdown/DropdownContent.js.map +1 -1
- package/dist/Dropdown/DropdownFilter.cjs +135 -153
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.d.ts +9 -15
- package/dist/Dropdown/DropdownFilter.js +133 -153
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/Dropdown/index.cjs +0 -8
- package/dist/Dropdown/index.cjs.map +1 -1
- package/dist/Dropdown/index.d.ts +1 -2
- package/dist/Dropdown/index.js +1 -2
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/Footer/Components/FooterDropdownLinks.cjs +6 -3
- package/dist/Footer/Components/FooterDropdownLinks.cjs.map +1 -1
- package/dist/Footer/Components/FooterDropdownLinks.js +6 -4
- package/dist/Footer/Components/FooterDropdownLinks.js.map +1 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs +5 -3
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs.map +1 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js +5 -4
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/Footer/Components/FooterTop.cjs +2 -1
- package/dist/Footer/Components/FooterTop.cjs.map +1 -1
- package/dist/Footer/Components/FooterTop.js +3 -2
- package/dist/Footer/Components/FooterTop.js.map +1 -1
- package/dist/GlobalNavigationBar/Avatar.cjs +5 -7
- package/dist/GlobalNavigationBar/Avatar.cjs.map +1 -1
- package/dist/GlobalNavigationBar/Avatar.js +5 -8
- package/dist/GlobalNavigationBar/Avatar.js.map +1 -1
- package/dist/GlobalNavigationBar/Logo.cjs +9 -6
- package/dist/GlobalNavigationBar/Logo.cjs.map +1 -1
- package/dist/GlobalNavigationBar/Logo.d.ts +2 -1
- package/dist/GlobalNavigationBar/Logo.js +9 -7
- package/dist/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/GlobalNavigationBar/MainMenu.cjs +10 -13
- package/dist/GlobalNavigationBar/MainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/MainMenu.js +9 -13
- package/dist/GlobalNavigationBar/MainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/RightSideNav.cjs +3 -5
- package/dist/GlobalNavigationBar/RightSideNav.cjs.map +1 -1
- package/dist/GlobalNavigationBar/RightSideNav.js +2 -5
- package/dist/GlobalNavigationBar/RightSideNav.js.map +1 -1
- package/dist/GlobalNavigationBar/UserMenu/MenuLink.cjs +4 -0
- package/dist/GlobalNavigationBar/UserMenu/MenuLink.cjs.map +1 -1
- package/dist/GlobalNavigationBar/UserMenu/MenuLink.js +3 -0
- package/dist/GlobalNavigationBar/UserMenu/MenuLink.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs +1 -1
- package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/CommonStyles.js +2 -2
- package/dist/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.js +2 -2
- package/dist/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
- package/dist/HyperLink/styling.cjs +1 -1
- package/dist/HyperLink/styling.cjs.map +1 -1
- package/dist/HyperLink/styling.js +1 -1
- package/dist/HyperLink/styling.js.map +1 -1
- package/dist/Image/ImageWithFallbacks.cjs +3 -1
- package/dist/Image/ImageWithFallbacks.cjs.map +1 -1
- package/dist/Image/ImageWithFallbacks.js +3 -1
- package/dist/Image/ImageWithFallbacks.js.map +1 -1
- package/dist/InputFields/Checkbox.cjs +20 -17
- package/dist/InputFields/Checkbox.cjs.map +1 -1
- package/dist/InputFields/Checkbox.d.ts +4 -3
- package/dist/InputFields/Checkbox.js +21 -18
- package/dist/InputFields/Checkbox.js.map +1 -1
- package/dist/InputFields/DatepickerField.cjs +15 -17
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.d.ts +3 -3
- package/dist/InputFields/DatepickerField.js +16 -22
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/NumberField.cjs +276 -0
- package/dist/InputFields/NumberField.cjs.map +1 -0
- package/dist/InputFields/NumberField.d.ts +21 -0
- package/dist/InputFields/NumberField.js +240 -0
- package/dist/InputFields/NumberField.js.map +1 -0
- package/dist/InputFields/PasswordField.cjs +21 -17
- package/dist/InputFields/PasswordField.cjs.map +1 -1
- package/dist/InputFields/PasswordField.d.ts +2 -3
- package/dist/InputFields/PasswordField.js +19 -15
- package/dist/InputFields/PasswordField.js.map +1 -1
- package/dist/InputFields/QuickSearch.cjs +119 -96
- package/dist/InputFields/QuickSearch.cjs.map +1 -1
- package/dist/InputFields/QuickSearch.js +119 -96
- package/dist/InputFields/QuickSearch.js.map +1 -1
- package/dist/InputFields/RadioButton.cjs +14 -13
- package/dist/InputFields/RadioButton.cjs.map +1 -1
- package/dist/InputFields/RadioButton.d.ts +2 -1
- package/dist/InputFields/RadioButton.js +16 -13
- package/dist/InputFields/RadioButton.js.map +1 -1
- package/dist/InputFields/SearchBar.cjs +5 -5
- package/dist/InputFields/SearchBar.cjs.map +1 -1
- package/dist/InputFields/SearchBar.js +6 -6
- package/dist/InputFields/SearchBar.js.map +1 -1
- package/dist/InputFields/TextField.cjs +12 -27
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.d.ts +4 -6
- package/dist/InputFields/TextField.js +12 -27
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/Textarea.cjs +3 -14
- package/dist/InputFields/Textarea.cjs.map +1 -1
- package/dist/InputFields/Textarea.d.ts +0 -1
- package/dist/InputFields/Textarea.js +5 -14
- package/dist/InputFields/Textarea.js.map +1 -1
- package/dist/InputFields/components/SearchBarInput.cjs +6 -8
- package/dist/InputFields/components/SearchBarInput.cjs.map +1 -1
- package/dist/InputFields/components/SearchBarInput.d.ts +0 -3
- package/dist/InputFields/components/SearchBarInput.js +4 -5
- package/dist/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/InputFields/components/SearchField.cjs +29 -21
- package/dist/InputFields/components/SearchField.cjs.map +1 -1
- package/dist/InputFields/components/SearchField.d.ts +8 -8
- package/dist/InputFields/components/SearchField.js +25 -19
- package/dist/InputFields/components/SearchField.js.map +1 -1
- package/dist/InputFields/index.cjs +8 -0
- package/dist/InputFields/index.cjs.map +1 -1
- package/dist/InputFields/index.d.ts +2 -1
- package/dist/InputFields/index.js +2 -1
- package/dist/InputFields/index.js.map +1 -1
- package/dist/InputFields/styling.cjs +16 -26
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.d.ts +3 -6
- package/dist/InputFields/styling.js +15 -23
- package/dist/InputFields/styling.js.map +1 -1
- package/dist/List/ListRow.cjs +6 -5
- package/dist/List/ListRow.cjs.map +1 -1
- package/dist/List/ListRow.js +9 -5
- package/dist/List/ListRow.js.map +1 -1
- package/dist/LoadingIndicator/LoadingIndicator.cjs +6 -1
- package/dist/LoadingIndicator/LoadingIndicator.cjs.map +1 -1
- package/dist/LoadingIndicator/LoadingIndicator.d.ts +2 -1
- package/dist/LoadingIndicator/LoadingIndicator.js +6 -1
- package/dist/LoadingIndicator/LoadingIndicator.js.map +1 -1
- package/dist/MenuItem/MenuItem.cjs +6 -2
- package/dist/MenuItem/MenuItem.cjs.map +1 -1
- package/dist/MenuItem/MenuItem.d.ts +1 -0
- package/dist/MenuItem/MenuItem.js +7 -3
- package/dist/MenuItem/MenuItem.js.map +1 -1
- package/dist/Modals/ModalContainer.cjs +78 -38
- package/dist/Modals/ModalContainer.cjs.map +1 -1
- package/dist/Modals/ModalContainer.d.ts +15 -8
- package/dist/Modals/ModalContainer.js +78 -36
- package/dist/Modals/ModalContainer.js.map +1 -1
- package/dist/Modals/ModalContent.cjs +0 -1
- package/dist/Modals/ModalContent.cjs.map +1 -1
- package/dist/Modals/ModalContent.d.ts +0 -1
- package/dist/Modals/ModalContent.js +0 -1
- package/dist/Modals/ModalContent.js.map +1 -1
- package/dist/Modals/ModalDialog.cjs +18 -26
- package/dist/Modals/ModalDialog.cjs.map +1 -1
- package/dist/Modals/ModalDialog.d.ts +1 -1
- package/dist/Modals/ModalDialog.js +19 -26
- package/dist/Modals/ModalDialog.js.map +1 -1
- package/dist/Modals/ModalStyles.cjs +33 -25
- package/dist/Modals/ModalStyles.cjs.map +1 -1
- package/dist/Modals/ModalStyles.d.ts +7 -1
- package/dist/Modals/ModalStyles.js +26 -24
- package/dist/Modals/ModalStyles.js.map +1 -1
- package/dist/NavItem/NavItem.cjs +1 -1
- package/dist/NavItem/NavItem.cjs.map +1 -1
- package/dist/NavItem/NavItem.js +2 -2
- package/dist/NavItem/NavItem.js.map +1 -1
- package/dist/Paginator/Paginator.cjs +1 -1
- package/dist/Paginator/Paginator.cjs.map +1 -1
- package/dist/Paginator/Paginator.js +2 -2
- package/dist/Paginator/Paginator.js.map +1 -1
- package/dist/QuizButton/QuizButton.cjs +4 -8
- package/dist/QuizButton/QuizButton.cjs.map +1 -1
- package/dist/QuizButton/QuizButton.js +5 -9
- package/dist/QuizButton/QuizButton.js.map +1 -1
- package/dist/SegmentControl/SegmentControl.cjs +1 -1
- package/dist/SegmentControl/SegmentControl.cjs.map +1 -1
- package/dist/SegmentControl/SegmentControl.js +2 -2
- package/dist/SegmentControl/SegmentControl.js.map +1 -1
- package/dist/Switcher/SwitcherMenuItem.cjs +1 -1
- package/dist/Switcher/SwitcherMenuItem.cjs.map +1 -1
- package/dist/Switcher/SwitcherMenuItem.js +2 -2
- package/dist/Switcher/SwitcherMenuItem.js.map +1 -1
- package/dist/Table/TableBody.cjs +1 -1
- package/dist/Table/TableBody.cjs.map +1 -1
- package/dist/Table/TableBody.js +1 -1
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableFooter.cjs +12 -14
- package/dist/Table/TableFooter.cjs.map +1 -1
- package/dist/Table/TableFooter.js +13 -15
- package/dist/Table/TableFooter.js.map +1 -1
- package/dist/Table/TableHeaders.cjs +1 -0
- package/dist/Table/TableHeaders.cjs.map +1 -1
- package/dist/Table/TableHeaders.js +1 -0
- package/dist/Table/TableHeaders.js.map +1 -1
- package/dist/Table/TableStyles.cjs +4 -4
- package/dist/Table/TableStyles.cjs.map +1 -1
- package/dist/Table/TableStyles.js +5 -5
- package/dist/Table/TableStyles.js.map +1 -1
- package/dist/Tabs/HorizontalTabs.cjs +5 -1
- package/dist/Tabs/HorizontalTabs.cjs.map +1 -1
- package/dist/Tabs/HorizontalTabs.js +6 -3
- package/dist/Tabs/HorizontalTabs.js.map +1 -1
- package/dist/Tabs/TabLink.cjs +48 -45
- package/dist/Tabs/TabLink.cjs.map +1 -1
- package/dist/Tabs/TabLink.js +47 -46
- package/dist/Tabs/TabLink.js.map +1 -1
- package/dist/Tabs/VerticalTabs.cjs.map +1 -1
- package/dist/Tabs/VerticalTabs.js.map +1 -1
- package/dist/Tile/Tile.cjs +61 -0
- package/dist/Tile/Tile.cjs.map +1 -0
- package/dist/Tile/Tile.d.ts +4 -0
- package/dist/Tile/Tile.js +43 -0
- package/dist/Tile/Tile.js.map +1 -0
- package/dist/Tile/TileBody.cjs +37 -0
- package/dist/Tile/TileBody.cjs.map +1 -0
- package/dist/Tile/TileBody.d.ts +6 -0
- package/dist/Tile/TileBody.js +22 -0
- package/dist/Tile/TileBody.js.map +1 -0
- package/dist/Tile/TileCommonItems.cjs +165 -0
- package/dist/Tile/TileCommonItems.cjs.map +1 -0
- package/dist/Tile/TileCommonItems.d.ts +9 -0
- package/dist/Tile/TileCommonItems.js +126 -0
- package/dist/Tile/TileCommonItems.js.map +1 -0
- package/dist/Tile/TileFooter.cjs +48 -0
- package/dist/Tile/TileFooter.cjs.map +1 -0
- package/dist/Tile/TileFooter.d.ts +7 -0
- package/dist/Tile/TileFooter.js +32 -0
- package/dist/Tile/TileFooter.js.map +1 -0
- package/dist/Tile/TileHeader.cjs +90 -0
- package/dist/Tile/TileHeader.cjs.map +1 -0
- package/dist/Tile/TileHeader.d.ts +7 -0
- package/dist/Tile/TileHeader.js +68 -0
- package/dist/Tile/TileHeader.js.map +1 -0
- package/dist/Tile/TileTypes.cjs +6 -0
- package/dist/Tile/TileTypes.cjs.map +1 -0
- package/dist/Tile/TileTypes.d.ts +57 -0
- package/dist/Tile/TileTypes.js +2 -0
- package/dist/Tile/TileTypes.js.map +1 -0
- package/dist/Tile/index.cjs +33 -0
- package/dist/Tile/index.cjs.map +1 -0
- package/dist/Tile/index.d.ts +3 -0
- package/dist/Tile/index.js +4 -0
- package/dist/Tile/index.js.map +1 -0
- package/dist/Toasters/Toast.cjs +2 -0
- package/dist/Toasters/Toast.cjs.map +1 -1
- package/dist/Toasters/Toast.js +2 -0
- package/dist/Toasters/Toast.js.map +1 -1
- package/dist/Toggles/ToggleButton.cjs +81 -0
- package/dist/Toggles/ToggleButton.cjs.map +1 -0
- package/dist/Toggles/ToggleButton.d.ts +14 -0
- package/dist/Toggles/ToggleButton.js +59 -0
- package/dist/Toggles/ToggleButton.js.map +1 -0
- package/dist/Toggles/ToggleSwitch.cjs +12 -6
- package/dist/Toggles/ToggleSwitch.cjs.map +1 -1
- package/dist/Toggles/ToggleSwitch.js +11 -6
- package/dist/Toggles/ToggleSwitch.js.map +1 -1
- package/dist/Toggles/TogglerStyles.cjs +2 -2
- package/dist/Toggles/TogglerStyles.cjs.map +1 -1
- package/dist/Toggles/TogglerStyles.js +3 -3
- package/dist/Toggles/TogglerStyles.js.map +1 -1
- package/dist/Toggles/index.cjs +8 -0
- package/dist/Toggles/index.cjs.map +1 -1
- package/dist/Toggles/index.d.ts +2 -1
- package/dist/Toggles/index.js +2 -1
- package/dist/Toggles/index.js.map +1 -1
- package/dist/Tooltips/TooltipStyles.cjs +2 -2
- package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
- package/dist/Tooltips/TooltipStyles.js +3 -3
- package/dist/Tooltips/TooltipStyles.js.map +1 -1
- package/dist/Tooltips/TooltipTypes.cjs.map +1 -1
- package/dist/Tooltips/TooltipTypes.d.ts +1 -0
- package/dist/Tooltips/TooltipTypes.js.map +1 -1
- package/dist/Tooltips/TooltipWrapper.cjs +2 -0
- package/dist/Tooltips/TooltipWrapper.cjs.map +1 -1
- package/dist/Tooltips/TooltipWrapper.d.ts +1 -1
- package/dist/Tooltips/TooltipWrapper.js +2 -0
- package/dist/Tooltips/TooltipWrapper.js.map +1 -1
- package/dist/common/{HoverWithin.cjs → ActionWithin.cjs} +9 -5
- package/dist/common/ActionWithin.cjs.map +1 -0
- package/dist/common/{HoverWithin.d.ts → ActionWithin.d.ts} +0 -0
- package/dist/common/{HoverWithin.js → ActionWithin.js} +9 -5
- package/dist/common/ActionWithin.js.map +1 -0
- package/dist/common/ClickOutside.cjs +39 -0
- package/dist/common/ClickOutside.cjs.map +1 -0
- package/dist/common/ClickOutside.d.ts +1 -0
- package/dist/common/ClickOutside.js +25 -0
- package/dist/common/ClickOutside.js.map +1 -0
- package/dist/common/FocusOutside.cjs +39 -0
- package/dist/common/FocusOutside.cjs.map +1 -0
- package/dist/common/FocusOutside.d.ts +1 -0
- package/dist/common/FocusOutside.js +25 -0
- package/dist/common/FocusOutside.js.map +1 -0
- package/dist/common/FocusVisible.cjs +67 -19
- package/dist/common/FocusVisible.cjs.map +1 -1
- package/dist/common/FocusVisible.js +66 -19
- package/dist/common/FocusVisible.js.map +1 -1
- package/dist/common/InputStyling.cjs +1 -1
- package/dist/common/InputStyling.cjs.map +1 -1
- package/dist/common/InputStyling.js +2 -2
- package/dist/common/InputStyling.js.map +1 -1
- package/dist/common/index.cjs +18 -2
- package/dist/common/index.cjs.map +1 -1
- package/dist/common/index.d.ts +3 -1
- package/dist/common/index.js +3 -1
- package/dist/common/index.js.map +1 -1
- package/dist/icons/index.cjs +1 -1
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.cjs +28 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/focus-styles.cjs +22 -0
- package/dist/styles/focus-styles.cjs.map +1 -0
- package/dist/styles/focus-styles.d.ts +2 -0
- package/dist/styles/focus-styles.js +9 -0
- package/dist/styles/focus-styles.js.map +1 -0
- package/dist/styles/index.cjs +60 -0
- package/dist/styles/index.cjs.map +1 -1
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.js +1 -0
- package/dist/styles/index.js.map +1 -1
- package/dist/types.cjs +10 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/Chips/ChipInput.cjs +0 -199
- package/dist/Chips/ChipInput.cjs.map +0 -1
- package/dist/Chips/ChipInput.js +0 -182
- package/dist/Chips/ChipInput.js.map +0 -1
- package/dist/Dropdown/ChipDropdownInput.cjs +0 -431
- package/dist/Dropdown/ChipDropdownInput.cjs.map +0 -1
- package/dist/Dropdown/ChipDropdownInput.d.ts +0 -24
- package/dist/Dropdown/ChipDropdownInput.js +0 -418
- package/dist/Dropdown/ChipDropdownInput.js.map +0 -1
- package/dist/common/HoverWithin.cjs.map +0 -1
- package/dist/common/HoverWithin.js.map +0 -1
|
@@ -5,6 +5,12 @@ import _pt from "prop-types";
|
|
|
5
5
|
|
|
6
6
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
7
7
|
|
|
8
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
9
|
+
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
13
|
+
|
|
8
14
|
import React from 'react';
|
|
9
15
|
import styled from 'styled-components';
|
|
10
16
|
import Button from '../Button/Button';
|
|
@@ -18,11 +24,14 @@ import MenuItem from '../MenuItem/MenuItem';
|
|
|
18
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
25
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
26
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
|
|
27
|
+
var MAX_MENU_HEIGHT = 240;
|
|
28
|
+
var AVG_OPTION_HEIGHT = 48;
|
|
29
|
+
var OFFSET_BEFORE_SHOW = 1000000;
|
|
30
|
+
export var DDContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: none;\n position: absolute;\n background-color: ", ";\n\n width: ", ";\n z-index: ", ";\n margin: ", ";\n\n &.show {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n &.up {\n top: auto;\n bottom: 100%;\n }\n\n transform: translate(-", "px, -", "px);\n\n &.up,\n &.down {\n transform: translate(0, 0);\n }\n\n &.outline:focus:after {\n content: '';\n pointer-events: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n outline: 4px solid black;\n outline-offset: 2px;\n border-radius: 2px;\n }\n\n &:focus {\n outline: none;\n }\n\n ", "\n\n ", ";\n\n border: 1px solid ", ";\n box-sizing: border-box;\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);\n padding: 4px 0px;\n\n min-width: ", ";\n border-radius: ", ";\n\n max-height: ", ";\n\n"])), COLORS.white, function (props) {
|
|
22
31
|
return props.width ? props.width : '100%';
|
|
23
32
|
}, Z_INDEXES.dropdown, function (props) {
|
|
24
33
|
return props.isButton ? '-4px' : '4px 0px';
|
|
25
|
-
}, function (props) {
|
|
34
|
+
}, OFFSET_BEFORE_SHOW, OFFSET_BEFORE_SHOW, function (props) {
|
|
26
35
|
return props.alignLeft ? 'left: 0px;' : '';
|
|
27
36
|
}, function (props) {
|
|
28
37
|
return props.isButton ? ButtonDropdownContentStyling : '';
|
|
@@ -34,7 +43,7 @@ export var DDContainer = styled.div(_templateObject || (_templateObject = _tagge
|
|
|
34
43
|
return !props.scrollable ? 'auto' : props.maxHeight ? props.maxHeight : props.size == Size.Large ? '320px' : props.size == Size.Medium ? '280px' : '240px';
|
|
35
44
|
});
|
|
36
45
|
var ItemsContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n > *:hover {\n z-index: ", ";\n }\n\n > *:active,\n > *.active {\n z-index: ", ";\n }\n\n > *:focus {\n z-index: ", ";\n }\n"])), Z_INDEXES.hover, Z_INDEXES.active, Z_INDEXES.focus);
|
|
37
|
-
var ListContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n ", "\n div.divider {\n display: block;\n width: calc(100% - 40px);\n margin-left: 16px;\n border-top: 1px solid #e5e5e5;\n position: absolute;\n top: 0px;\n }\n\n ", " {\n padding-top: ", ";\n padding-bottom: ", ";\n\n word-break: break-word;\n }\n\n ", "\n"])), function (props) {
|
|
46
|
+
var ListContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n ", "\n div.divider {\n display: block;\n width: calc(100% - 40px);\n margin-left: 16px;\n border-top: 1px solid #e5e5e5;\n position: absolute;\n top: 0px;\n }\n\n ", " {\n padding-top: ", ";\n padding-bottom: ", ";\n\n word-break: break-word;\n }\n\n *:focus {\n outline: none !important;\n }\n\n ", "\n"])), function (props) {
|
|
38
47
|
return props.scrollable ? 'overflow-y: scroll;' : '';
|
|
39
48
|
}, function (props) {
|
|
40
49
|
return props.scrollable ? 'margin-right: 6px;' : '';
|
|
@@ -75,11 +84,8 @@ var ActionButtonContainer = styled.div(_templateObject7 || (_templateObject7 = _
|
|
|
75
84
|
}, function (props) {
|
|
76
85
|
return props.size === Size.Small || !props.size ? '4px 16px 0px' : props.size === Size.Medium ? '12px 16px 8px' : '16px 16px 12px';
|
|
77
86
|
});
|
|
78
|
-
var
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
var DropdownContent = function DropdownContent(_ref) {
|
|
82
|
-
var _customizationProps$a;
|
|
87
|
+
var DropdownContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
88
|
+
var _ref2, _customizationProps$a;
|
|
83
89
|
|
|
84
90
|
var id = _ref.id,
|
|
85
91
|
customizationProps = _ref.customizationProps,
|
|
@@ -87,7 +93,6 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
87
93
|
isButton = _ref.isButton,
|
|
88
94
|
size = _ref.size,
|
|
89
95
|
isOpen = _ref.isOpen,
|
|
90
|
-
hideOnClickOutside = _ref.hideOnClickOutside,
|
|
91
96
|
width = _ref.width,
|
|
92
97
|
setIsOpen = _ref.setIsOpen,
|
|
93
98
|
filter = _ref.filter,
|
|
@@ -95,17 +100,24 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
95
100
|
setFocused = _ref.setFocused,
|
|
96
101
|
selectedValues = _ref.selectedValues,
|
|
97
102
|
setSelectedValues = _ref.setSelectedValues,
|
|
98
|
-
messageOnNoResults = _ref.messageOnNoResults
|
|
103
|
+
messageOnNoResults = _ref.messageOnNoResults,
|
|
104
|
+
outline = _ref.outline;
|
|
99
105
|
|
|
100
106
|
var _React$useState = React.useState(false),
|
|
101
107
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
102
108
|
isUp = _React$useState2[0],
|
|
103
109
|
setIsUp = _React$useState2[1];
|
|
104
110
|
|
|
105
|
-
var
|
|
111
|
+
var _React$useState3 = React.useState(false),
|
|
112
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
113
|
+
locationDefined = _React$useState4[0],
|
|
114
|
+
setLocationDefined = _React$useState4[1];
|
|
115
|
+
|
|
116
|
+
var dropdownContentRef = (_ref2 = ref) !== null && _ref2 !== void 0 ? _ref2 : React.useRef(null);
|
|
106
117
|
if (!customizationProps.itemsType) customizationProps.itemsType = 'normal';
|
|
107
118
|
if (!size) size = Size.Small;
|
|
108
119
|
var itemsListRef = React.useRef(null);
|
|
120
|
+
var actionButtonRef = React.useRef(null);
|
|
109
121
|
|
|
110
122
|
var determineDropUp = function determineDropUp() {
|
|
111
123
|
var options = customizationProps.items;
|
|
@@ -113,18 +125,28 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
113
125
|
if (!node) return;
|
|
114
126
|
var windowHeight = window.innerHeight;
|
|
115
127
|
var menuHeight = Math.min(MAX_MENU_HEIGHT, options.length * AVG_OPTION_HEIGHT);
|
|
116
|
-
var instOffsetWithMenu = node.getBoundingClientRect().top + menuHeight;
|
|
128
|
+
var instOffsetWithMenu = node.getBoundingClientRect().top + menuHeight + OFFSET_BEFORE_SHOW;
|
|
117
129
|
setIsUp(instOffsetWithMenu >= windowHeight);
|
|
130
|
+
setLocationDefined(true);
|
|
118
131
|
};
|
|
119
132
|
|
|
120
133
|
var setNewFocusedElement = function setNewFocusedElement(index) {
|
|
134
|
+
var _dropdownContentRef$c;
|
|
135
|
+
|
|
136
|
+
if (outline) (_dropdownContentRef$c = dropdownContentRef.current) === null || _dropdownContentRef$c === void 0 ? void 0 : _dropdownContentRef$c.focus();
|
|
121
137
|
var newFocusedElement = elRefs[index];
|
|
138
|
+
var oldFocusedElement = focused || focused === 0 ? elRefs[focused] : null;
|
|
122
139
|
|
|
123
|
-
if (newFocusedElement) {
|
|
124
|
-
var _newFocusedElement$cu;
|
|
140
|
+
if (newFocusedElement && newFocusedElement !== oldFocusedElement) {
|
|
141
|
+
var _oldFocusedElement$cu, _newFocusedElement$cu, _newFocusedElement$cu2;
|
|
125
142
|
|
|
126
143
|
setFocused(index);
|
|
127
|
-
|
|
144
|
+
oldFocusedElement === null || oldFocusedElement === void 0 ? void 0 : (_oldFocusedElement$cu = oldFocusedElement.current) === null || _oldFocusedElement$cu === void 0 ? void 0 : _oldFocusedElement$cu.classList.remove('dropdown-hover');
|
|
145
|
+
(_newFocusedElement$cu = newFocusedElement.current) === null || _newFocusedElement$cu === void 0 ? void 0 : _newFocusedElement$cu.classList.add('dropdown-hover');
|
|
146
|
+
(_newFocusedElement$cu2 = newFocusedElement.current) === null || _newFocusedElement$cu2 === void 0 ? void 0 : _newFocusedElement$cu2.scrollIntoView({
|
|
147
|
+
block: 'nearest',
|
|
148
|
+
inline: 'nearest'
|
|
149
|
+
});
|
|
128
150
|
}
|
|
129
151
|
};
|
|
130
152
|
|
|
@@ -137,95 +159,53 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
137
159
|
});
|
|
138
160
|
};
|
|
139
161
|
|
|
162
|
+
var findNextActiveIndex = function findNextActiveIndex(index, direction, items) {
|
|
163
|
+
for (var i = index + direction; i > 0 && i <= items.length; i += direction) {
|
|
164
|
+
var _items;
|
|
165
|
+
|
|
166
|
+
if (!((_items = items[i - 1]) !== null && _items !== void 0 && _items.disabled)) {
|
|
167
|
+
return i;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return index;
|
|
172
|
+
};
|
|
173
|
+
|
|
140
174
|
var handleKeyDown = function handleKeyDown(e) {
|
|
141
175
|
if (isOpen) {
|
|
142
176
|
if (e.key === 'ArrowUp' || e.key === 'Up') {
|
|
143
177
|
e.preventDefault();
|
|
144
|
-
var focusedNow = focused;
|
|
145
|
-
|
|
146
|
-
if (focusedNow
|
|
147
|
-
|
|
148
|
-
if (focusedNow == 1 && haveTopItem()) focusedNow = 0;else {
|
|
149
|
-
for (var i = focusedNow - 1; i > 0; i--) {
|
|
150
|
-
var _filtered;
|
|
151
|
-
|
|
152
|
-
if (!((_filtered = filtered[i - 1]) !== null && _filtered !== void 0 && _filtered.disabled)) {
|
|
153
|
-
focusedNow = i;
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
178
|
+
var focusedNow = focused || focused === 0 ? focused : arrLength + 1;
|
|
179
|
+
|
|
180
|
+
if (!!focusedNow) {
|
|
181
|
+
focusedNow = focusedNow === 1 && haveTopItem() ? 0 : findNextActiveIndex(focusedNow, -1, getFilteredItems());
|
|
158
182
|
setNewFocusedElement(focusedNow);
|
|
159
183
|
}
|
|
160
184
|
} else if (e.key === 'ArrowDown' || e.key === 'Down') {
|
|
161
185
|
e.preventDefault();
|
|
162
|
-
var
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
var _filtered2 = getFilteredItems();
|
|
166
|
-
|
|
167
|
-
for (var _i = focusedNow + 1; _i <= _filtered2.length; _i++) {
|
|
168
|
-
var _filtered3;
|
|
169
|
-
|
|
170
|
-
if (!((_filtered3 = _filtered2[_i - 1]) !== null && _filtered3 !== void 0 && _filtered3.disabled)) {
|
|
171
|
-
focusedNow = _i;
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
} else {
|
|
176
|
-
focusedNow = haveTopItem() ? 0 : 1;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
setNewFocusedElement(focusedNow);
|
|
180
|
-
} else if (e.key === 'Tab') {
|
|
181
|
-
e.preventDefault();
|
|
182
|
-
var focusedNow = focused;
|
|
183
|
-
|
|
184
|
-
if (focusedNow !== undefined && focusedNow !== null) {
|
|
185
|
-
e.shiftKey ? focusedNow-- : focusedNow++;
|
|
186
|
-
var newFocusedElement = document.getElementById("".concat(id, "_").concat(focusedNow));
|
|
187
|
-
|
|
188
|
-
if (!newFocusedElement) {
|
|
189
|
-
setNewFocusedElement(0);
|
|
190
|
-
} else {
|
|
191
|
-
setNewFocusedElement(focusedNow);
|
|
192
|
-
}
|
|
193
|
-
} else {
|
|
194
|
-
setFocused(null);
|
|
195
|
-
}
|
|
186
|
+
var _focusedNow = focused;
|
|
187
|
+
_focusedNow = !!_focusedNow || _focusedNow === 0 ? findNextActiveIndex(_focusedNow, 1, getFilteredItems()) : haveTopItem() ? 0 : 1;
|
|
188
|
+
setNewFocusedElement(_focusedNow);
|
|
196
189
|
} else if (e.key === 'Escape' || e.key === 'Esc') {
|
|
197
190
|
setIsOpen(false);
|
|
198
|
-
setFocused(null);
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
setInput('');
|
|
203
|
-
setPlaceholderSearch(placeholder || '');
|
|
204
|
-
}
|
|
205
|
-
styledFieldRef.current?.focus(); */
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
};
|
|
191
|
+
setFocused(null);
|
|
192
|
+
} else if ((e.key === 'Enter' || e.key === ' ') && focused !== null && e.target !== (actionButtonRef === null || actionButtonRef === void 0 ? void 0 : actionButtonRef.current)) {
|
|
193
|
+
e.preventDefault();
|
|
194
|
+
var focusedElement = elRefs[focused];
|
|
209
195
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
var _x$current;
|
|
196
|
+
if (focusedElement) {
|
|
197
|
+
var _focusedElement$curre;
|
|
213
198
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
if (isOpen) {
|
|
217
|
-
setIsOpen(false);
|
|
218
|
-
setFocused(null);
|
|
199
|
+
(_focusedElement$curre = focusedElement.current) === null || _focusedElement$curre === void 0 ? void 0 : _focusedElement$curre.click();
|
|
200
|
+
}
|
|
219
201
|
}
|
|
220
202
|
}
|
|
221
203
|
};
|
|
222
204
|
|
|
223
205
|
React.useEffect(function () {
|
|
224
206
|
document.addEventListener('keydown', handleKeyDown);
|
|
225
|
-
document.addEventListener('click', handleClickOutside);
|
|
226
207
|
return function () {
|
|
227
208
|
document.removeEventListener('keydown', handleKeyDown);
|
|
228
|
-
document.removeEventListener('click', handleClickOutside);
|
|
229
209
|
};
|
|
230
210
|
});
|
|
231
211
|
var scrollPosition = React.useRef(0);
|
|
@@ -254,25 +234,30 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
254
234
|
|
|
255
235
|
var arrLength = getFilteredItems().length;
|
|
256
236
|
|
|
257
|
-
var _React$
|
|
258
|
-
_React$
|
|
259
|
-
elRefs = _React$
|
|
260
|
-
setElRefs = _React$
|
|
237
|
+
var _React$useState5 = React.useState([]),
|
|
238
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
239
|
+
elRefs = _React$useState6[0],
|
|
240
|
+
setElRefs = _React$useState6[1];
|
|
261
241
|
|
|
262
242
|
React.useEffect(function () {
|
|
243
|
+
if ((elRefs === null || elRefs === void 0 ? void 0 : elRefs.length) !== arrLength) {
|
|
244
|
+
setFocused(null);
|
|
245
|
+
}
|
|
246
|
+
|
|
263
247
|
setElRefs(function (elRefs) {
|
|
264
248
|
return Array(arrLength + 1).fill(null).map(function (_, i) {
|
|
265
249
|
return getCorrectRef(elRefs[i]);
|
|
266
250
|
});
|
|
267
251
|
});
|
|
268
|
-
}, [isOpen, arrLength
|
|
269
|
-
React.
|
|
270
|
-
determineDropUp();
|
|
271
|
-
}, [isOpen]);
|
|
252
|
+
}, [isOpen, arrLength]);
|
|
253
|
+
React.useLayoutEffect(function () {
|
|
254
|
+
isOpen && !locationDefined && determineDropUp();
|
|
255
|
+
}, [isOpen, locationDefined]);
|
|
272
256
|
|
|
273
257
|
var haveTopItem = function haveTopItem() {
|
|
274
258
|
var _getSuggestions;
|
|
275
259
|
|
|
260
|
+
if (!customizationProps.pinTopItem) return false;
|
|
276
261
|
if (customizationProps.itemsType === 'radio' && selectedValues && (selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length) > 0) return true;else if (customizationProps.itemsType === 'checkbox' && (customizationProps.multiSelect || (selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length) > 0)) return true;else if (customizationProps.itemsType === 'normal' && ((_getSuggestions = getSuggestions()) === null || _getSuggestions === void 0 ? void 0 : _getSuggestions.length) > 0) return true;
|
|
277
262
|
return false;
|
|
278
263
|
};
|
|
@@ -282,18 +267,63 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
282
267
|
return x.suggestion;
|
|
283
268
|
});
|
|
284
269
|
};
|
|
270
|
+
/**
|
|
271
|
+
* when dropdown opens set correct position of focused item
|
|
272
|
+
* */
|
|
273
|
+
|
|
285
274
|
|
|
286
275
|
React.useLayoutEffect(function () {
|
|
287
276
|
if (isOpen && (focused || focused === 0)) {
|
|
288
|
-
|
|
277
|
+
setNewFocusedElement(focused === 0 && !haveTopItem() ? 1 : focused);
|
|
278
|
+
}
|
|
279
|
+
}, [isOpen, focused]);
|
|
280
|
+
/**
|
|
281
|
+
* Reset dropdown content state on close
|
|
282
|
+
* */
|
|
283
|
+
|
|
284
|
+
React.useEffect(function () {
|
|
285
|
+
if (!isOpen) {
|
|
286
|
+
var _dropdownContentRef$c2, _dropdownContentRef$c3;
|
|
289
287
|
|
|
290
|
-
|
|
291
|
-
if (focusThis !== focused) setFocused(focusThis);
|
|
292
|
-
var newFocusedElement = elRefs[focusThis];
|
|
293
|
-
newFocusedElement === null || newFocusedElement === void 0 ? void 0 : (_newFocusedElement$cu2 = newFocusedElement.current) === null || _newFocusedElement$cu2 === void 0 ? void 0 : _newFocusedElement$cu2.focus();
|
|
294
|
-
} else setFocused(null); //if the dropdown is closed, we don't to keep saved the focused item
|
|
288
|
+
setLocationDefined(false);
|
|
295
289
|
|
|
296
|
-
|
|
290
|
+
var _iterator = _createForOfIteratorHelper(elRefs),
|
|
291
|
+
_step;
|
|
292
|
+
|
|
293
|
+
try {
|
|
294
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
295
|
+
var _elRef$current;
|
|
296
|
+
|
|
297
|
+
var elRef = _step.value;
|
|
298
|
+
(_elRef$current = elRef.current) === null || _elRef$current === void 0 ? void 0 : _elRef$current.classList.remove('dropdown-hover');
|
|
299
|
+
}
|
|
300
|
+
} catch (err) {
|
|
301
|
+
_iterator.e(err);
|
|
302
|
+
} finally {
|
|
303
|
+
_iterator.f();
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
setFocused(null);
|
|
307
|
+
(_dropdownContentRef$c2 = dropdownContentRef.current) === null || _dropdownContentRef$c2 === void 0 ? void 0 : _dropdownContentRef$c2.classList.remove('outline');
|
|
308
|
+
(_dropdownContentRef$c3 = dropdownContentRef.current) === null || _dropdownContentRef$c3 === void 0 ? void 0 : _dropdownContentRef$c3.blur();
|
|
309
|
+
} else {
|
|
310
|
+
if (outline) {
|
|
311
|
+
var _dropdownContentRef$c4, _dropdownContentRef$c5;
|
|
312
|
+
|
|
313
|
+
(_dropdownContentRef$c4 = dropdownContentRef.current) === null || _dropdownContentRef$c4 === void 0 ? void 0 : _dropdownContentRef$c4.classList.add('outline');
|
|
314
|
+
(_dropdownContentRef$c5 = dropdownContentRef.current) === null || _dropdownContentRef$c5 === void 0 ? void 0 : _dropdownContentRef$c5.focus();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}, [isOpen, dropdownContentRef, focused, outline]);
|
|
318
|
+
/**
|
|
319
|
+
* Scroll item container to top when dropdown opens
|
|
320
|
+
* */
|
|
321
|
+
|
|
322
|
+
React.useEffect(function () {
|
|
323
|
+
if (isOpen && itemsListRef.current) {
|
|
324
|
+
itemsListRef.current.scrollTop = 0;
|
|
325
|
+
}
|
|
326
|
+
}, [isOpen]);
|
|
297
327
|
|
|
298
328
|
var handleItemClick = function handleItemClick(selected, item) {
|
|
299
329
|
var newValue = [];
|
|
@@ -333,16 +363,20 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
333
363
|
}) : null;
|
|
334
364
|
return /*#__PURE__*/_jsxs(TopItemContainer, {
|
|
335
365
|
size: size,
|
|
336
|
-
children: [customizationProps.itemsType
|
|
366
|
+
children: [customizationProps.itemsType === 'radio' && /*#__PURE__*/_jsx(RadioButton, {
|
|
337
367
|
ref: elRefs[0],
|
|
338
368
|
iconPointerEventsTransparent: true,
|
|
369
|
+
tabIndexVal: -1,
|
|
370
|
+
className: "".concat(focused === 0 ? 'dropdown-hover' : ''),
|
|
339
371
|
select: function select() {},
|
|
340
372
|
label: (_selectedFirst$displa = selectedFirst === null || selectedFirst === void 0 ? void 0 : selectedFirst.displayLabel) !== null && _selectedFirst$displa !== void 0 ? _selectedFirst$displa : selectedFirst === null || selectedFirst === void 0 ? void 0 : selectedFirst.value,
|
|
341
373
|
size: size,
|
|
342
374
|
id: "".concat(id, "_topitem"),
|
|
343
375
|
selected: true
|
|
344
|
-
}), customizationProps.itemsType
|
|
376
|
+
}), customizationProps.itemsType === 'checkbox' && /*#__PURE__*/_jsx(Checkbox, {
|
|
345
377
|
ref: elRefs[0],
|
|
378
|
+
tabIndexVal: -1,
|
|
379
|
+
className: "".concat(focused === 0 ? 'dropdown-hover' : ''),
|
|
346
380
|
select: function select(selected) {
|
|
347
381
|
if (!customizationProps.multiSelect) return;
|
|
348
382
|
var newValues = selected ? visibleItems.map(function (x) {
|
|
@@ -357,12 +391,14 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
357
391
|
id: "".concat(id, "_checkbox_selectall"),
|
|
358
392
|
label: customizationProps.multiSelect ? 'Select all' : (_selectedFirst$displa2 = selectedFirst === null || selectedFirst === void 0 ? void 0 : selectedFirst.displayLabel) !== null && _selectedFirst$displa2 !== void 0 ? _selectedFirst$displa2 : selectedFirst === null || selectedFirst === void 0 ? void 0 : selectedFirst.value,
|
|
359
393
|
selected: !customizationProps.multiSelect || allSelected
|
|
360
|
-
}), customizationProps.itemsType
|
|
394
|
+
}), customizationProps.itemsType === 'normal' && /*#__PURE__*/_jsx(_Fragment, {
|
|
361
395
|
children: suggestions.map(function (x) {
|
|
362
396
|
return /*#__PURE__*/_jsx(MenuItem, {
|
|
363
397
|
item: x,
|
|
364
398
|
size: size,
|
|
365
399
|
active: false,
|
|
400
|
+
tabIndex: -1,
|
|
401
|
+
className: "".concat(focused === 0 ? 'dropdown-hover' : ''),
|
|
366
402
|
ref: elRefs[0],
|
|
367
403
|
id: "".concat(id, "_topitem"),
|
|
368
404
|
onClickHandler: function onClickHandler(e) {
|
|
@@ -385,6 +421,7 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
385
421
|
children: /*#__PURE__*/_jsx("button", {
|
|
386
422
|
className: "dropdownButton",
|
|
387
423
|
disabled: true,
|
|
424
|
+
tabIndex: -1,
|
|
388
425
|
children: /*#__PURE__*/_jsx("span", {
|
|
389
426
|
children: messageOnNoResults
|
|
390
427
|
})
|
|
@@ -392,12 +429,11 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
392
429
|
});
|
|
393
430
|
}
|
|
394
431
|
|
|
395
|
-
var number = 0;
|
|
396
432
|
return /*#__PURE__*/_jsx(ItemsContainer, {
|
|
397
433
|
size: size,
|
|
398
434
|
children: getFilteredItems().filter(function (x) {
|
|
399
435
|
return x && (customizationProps.itemsType != 'normal' || !x.suggestion);
|
|
400
|
-
}).map(function (item) {
|
|
436
|
+
}).map(function (item, index) {
|
|
401
437
|
var _item$displayLabel, _item$displayLabel2;
|
|
402
438
|
|
|
403
439
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
@@ -405,30 +441,36 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
405
441
|
select: function select(selected) {
|
|
406
442
|
return handleItemClick(selected, item);
|
|
407
443
|
},
|
|
408
|
-
ref: elRefs[
|
|
444
|
+
ref: elRefs[index + 1],
|
|
409
445
|
size: size,
|
|
446
|
+
tabIndexVal: -1,
|
|
447
|
+
className: "".concat(index + 1 === focused ? 'dropdown-hover' : ''),
|
|
410
448
|
iconPointerEventsTransparent: true,
|
|
411
449
|
disabled: item === null || item === void 0 ? void 0 : item.disabled,
|
|
412
|
-
id: "".concat(id, "_").concat(
|
|
450
|
+
id: "".concat(id, "_").concat(index + 1),
|
|
413
451
|
label: (_item$displayLabel = item.displayLabel) !== null && _item$displayLabel !== void 0 ? _item$displayLabel : item.value,
|
|
414
452
|
selected: selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.includes(item.value)
|
|
415
|
-
}, "key_".concat(id, "_").concat(
|
|
453
|
+
}, "key_".concat(id, "_").concat(index + 1)), !item.customContent && customizationProps.itemsType == 'checkbox' && /*#__PURE__*/_jsx(Checkbox, {
|
|
416
454
|
select: function select(selected) {
|
|
417
455
|
return handleItemClick(selected, item);
|
|
418
456
|
},
|
|
419
457
|
iconPointerEventsTransparent: true,
|
|
420
458
|
disabled: item === null || item === void 0 ? void 0 : item.disabled,
|
|
421
|
-
|
|
459
|
+
className: "".concat(index + 1 === focused ? 'dropdown-hover' : ''),
|
|
460
|
+
ref: elRefs[index + 1],
|
|
422
461
|
size: size,
|
|
423
|
-
|
|
462
|
+
tabIndexVal: -1,
|
|
463
|
+
id: "".concat(id, "_").concat(index + 1),
|
|
424
464
|
label: (_item$displayLabel2 = item.displayLabel) !== null && _item$displayLabel2 !== void 0 ? _item$displayLabel2 : item.value,
|
|
425
465
|
selected: selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.includes(item.value)
|
|
426
|
-
}, "key_".concat(id, "_").concat(
|
|
427
|
-
id: "".concat(id, "_").concat(
|
|
466
|
+
}, "key_".concat(id, "_").concat(index + 1)), !item.customContent && (customizationProps.itemsType == 'normal' || !customizationProps.itemsType) && /*#__PURE__*/_jsx(MenuItem, {
|
|
467
|
+
id: "".concat(id, "_").concat(index + 1),
|
|
428
468
|
item: item,
|
|
469
|
+
tabIndex: -1,
|
|
470
|
+
className: "".concat(index + 1 === focused ? 'dropdown-hover' : ''),
|
|
429
471
|
size: size,
|
|
430
472
|
active: selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.includes(item.value),
|
|
431
|
-
ref: elRefs[
|
|
473
|
+
ref: elRefs[index + 1],
|
|
432
474
|
onClickHandler: function onClickHandler(e) {
|
|
433
475
|
e.stopPropagation();
|
|
434
476
|
customizationProps.onValueUpdate([item.value]);
|
|
@@ -436,28 +478,29 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
436
478
|
setIsOpen(false);
|
|
437
479
|
setFocused(null);
|
|
438
480
|
}
|
|
439
|
-
}, "key_".concat(id, "_").concat(
|
|
481
|
+
}, "key_".concat(id, "_").concat(index + 1))]
|
|
440
482
|
}, "key_".concat(id, "_").concat(item.value));
|
|
441
483
|
})
|
|
442
484
|
});
|
|
443
485
|
};
|
|
444
486
|
|
|
487
|
+
var cls = "".concat(isOpen ? 'show' : '', " ").concat(isOpen && outline ? 'outline' : '', " ").concat(locationDefined ? isUp ? 'up' : 'down' : '');
|
|
445
488
|
return /*#__PURE__*/_jsxs(DDContainer, {
|
|
446
489
|
ref: dropdownContentRef,
|
|
447
490
|
size: size,
|
|
448
491
|
width: width,
|
|
492
|
+
tabIndex: -1,
|
|
449
493
|
isButton: isButton,
|
|
450
494
|
alignLeft: alignLeft,
|
|
451
495
|
scrollable: customizationProps.scrollable,
|
|
452
496
|
maxHeight: customizationProps.maxHeight,
|
|
453
|
-
className:
|
|
454
|
-
return !!e;
|
|
455
|
-
}).join(' '),
|
|
497
|
+
className: cls,
|
|
456
498
|
children: [/*#__PURE__*/_jsxs(ListContainer, {
|
|
457
499
|
size: size,
|
|
458
500
|
itemsType: customizationProps.itemsType,
|
|
459
501
|
onScroll: handleScroll,
|
|
460
502
|
ref: itemsListRef,
|
|
503
|
+
outline: outline,
|
|
461
504
|
scrollable: customizationProps.scrollable,
|
|
462
505
|
children: [customizationProps.menuContent && /*#__PURE__*/_jsxs(MenuContentContainer, {
|
|
463
506
|
size: size,
|
|
@@ -474,31 +517,19 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
474
517
|
children: /*#__PURE__*/_jsx(Button, {
|
|
475
518
|
width: "100%",
|
|
476
519
|
icon: customizationProps.actionIcon,
|
|
520
|
+
ref: actionButtonRef,
|
|
477
521
|
loading: customizationProps.actionLoading,
|
|
478
522
|
disabled: customizationProps.actionDisabled,
|
|
479
523
|
variant: (_customizationProps$a = customizationProps.actionVariant) !== null && _customizationProps$a !== void 0 ? _customizationProps$a : 'primary',
|
|
480
524
|
size: size,
|
|
481
525
|
onClick: function onClick() {
|
|
482
|
-
|
|
483
|
-
setIsOpen(false);
|
|
526
|
+
return customizationProps.action() && setIsOpen(false);
|
|
484
527
|
},
|
|
485
528
|
children: customizationProps.actionLabel
|
|
486
529
|
})
|
|
487
530
|
})]
|
|
488
531
|
});
|
|
489
|
-
|
|
490
|
-
{
|
|
491
|
-
handleClickOutside: () => () => {
|
|
492
|
-
if (isOpen) {
|
|
493
|
-
setIsOpen(false);
|
|
494
|
-
setFocused(null);
|
|
495
|
-
}
|
|
496
|
-
},
|
|
497
|
-
},
|
|
498
|
-
);
|
|
499
|
-
return <Wrapped />; */
|
|
500
|
-
};
|
|
501
|
-
|
|
532
|
+
});
|
|
502
533
|
DropdownContent.propTypes = {
|
|
503
534
|
isButton: _pt.bool.isRequired,
|
|
504
535
|
customizationProps: _pt.shape({
|
|
@@ -532,12 +563,12 @@ DropdownContent.propTypes = {
|
|
|
532
563
|
id: _pt.string.isRequired,
|
|
533
564
|
filter: _pt.string.isRequired,
|
|
534
565
|
width: _pt.string,
|
|
535
|
-
hideOnClickOutside: _pt.bool.isRequired,
|
|
536
566
|
selectedValues: _pt.arrayOf(_pt.string).isRequired,
|
|
537
567
|
setSelectedValues: _pt.func.isRequired,
|
|
538
568
|
messageOnNoResults: _pt.string.isRequired,
|
|
539
569
|
focused: _pt.oneOfType([_pt.number, _pt.oneOf([null])]),
|
|
540
|
-
setFocused: _pt.func.isRequired
|
|
570
|
+
setFocused: _pt.func.isRequired,
|
|
571
|
+
outline: _pt.bool
|
|
541
572
|
};
|
|
542
573
|
export default DropdownContent;
|
|
543
574
|
//# sourceMappingURL=DropdownContent.js.map
|