@salutejs/plasma-new-hope 0.77.1-canary.1085.8844362605.0 → 0.77.1-canary.1185.8923379211.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/Combobox.css +17 -7
- package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +15 -6
- package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +15 -6
- package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +15 -6
- package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +15 -6
- package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.css +4 -23
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +81 -10
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +21 -9
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +4 -0
- package/cjs/components/Combobox/utils/index.js +23 -0
- package/cjs/components/Combobox/utils/index.js.map +1 -0
- package/cjs/components/Dropdown/Dropdown.css +25 -2
- package/cjs/components/Dropdown/Dropdown.js +138 -54
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles.js +40 -7
- package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles_1tihqkp.css +3 -0
- package/cjs/components/Dropdown/Dropdown.tokens.js +26 -23
- package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/cjs/components/Dropdown/hooks/useHashMaps.js +31 -0
- package/cjs/components/Dropdown/hooks/useHashMaps.js.map +1 -0
- package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +200 -0
- package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -0
- package/cjs/components/Dropdown/reducers/focusedPathReducer.js +37 -0
- package/cjs/components/Dropdown/reducers/focusedPathReducer.js.map +1 -0
- package/cjs/components/Dropdown/reducers/pathReducer.js +41 -0
- package/cjs/components/Dropdown/reducers/pathReducer.js.map +1 -0
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +119 -0
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -0
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +7 -4
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +79 -100
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +90 -5
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +5 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +30 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +4 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +112 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +1 -0
- package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +1 -0
- package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +1 -0
- package/cjs/components/Dropdown/utils/index.js +16 -0
- package/cjs/components/Dropdown/utils/index.js.map +1 -1
- package/cjs/components/Pagination/Pagination.css +14 -7
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +14 -7
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/cjs/components/Select/Select.css +14 -7
- package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +15 -6
- package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
- package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +15 -6
- package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
- package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +15 -6
- package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
- package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +15 -6
- package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
- package/cjs/components/Select/ui/SelectItem/SelectItem.css +16 -7
- package/cjs/components/Select/ui/SelectItem/SelectItem.js +3 -3
- package/cjs/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
- package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
- package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
- package/cjs/components/Select/ui/SelectItem/{SelectItem.styles_6h17aw.css → SelectItem.styles_vk39mp.css} +1 -1
- package/cjs/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
- package/cjs/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
- package/cjs/index.css +18 -8
- package/cjs/index.js +8 -2
- package/cjs/index.js.map +1 -1
- package/es/components/Combobox/Combobox.css +17 -7
- package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +15 -6
- package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
- package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +15 -6
- package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
- package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +15 -6
- package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
- package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +15 -6
- package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +4 -23
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +82 -11
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +19 -10
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +4 -0
- package/es/components/Combobox/utils/index.js +19 -0
- package/es/components/Combobox/utils/index.js.map +1 -0
- package/es/components/Dropdown/Dropdown.css +25 -2
- package/es/components/Dropdown/Dropdown.js +144 -60
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles.js +39 -7
- package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles_1tihqkp.css +3 -0
- package/es/components/Dropdown/Dropdown.tokens.js +26 -23
- package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/es/components/Dropdown/hooks/useHashMaps.js +27 -0
- package/es/components/Dropdown/hooks/useHashMaps.js.map +1 -0
- package/es/components/Dropdown/hooks/useKeyboardNavigation.js +196 -0
- package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -0
- package/es/components/Dropdown/reducers/focusedPathReducer.js +33 -0
- package/es/components/Dropdown/reducers/focusedPathReducer.js.map +1 -0
- package/es/components/Dropdown/reducers/pathReducer.js +37 -0
- package/es/components/Dropdown/reducers/pathReducer.js.map +1 -0
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +115 -0
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -0
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +7 -4
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +80 -100
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +89 -5
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +5 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +23 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +4 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +107 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +1 -0
- package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +1 -1
- package/es/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +1 -0
- package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +1 -1
- package/es/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +1 -0
- package/es/components/Dropdown/utils/index.js +16 -2
- package/es/components/Dropdown/utils/index.js.map +1 -1
- package/es/components/Pagination/Pagination.css +14 -7
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +14 -7
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/es/components/Select/Select.css +14 -7
- package/es/components/Select/ui/SelectDivider/SelectDivider.css +15 -6
- package/es/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
- package/es/components/Select/ui/SelectFooter/SelectFooter.css +15 -6
- package/es/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
- package/es/components/Select/ui/SelectGroup/SelectGroup.css +15 -6
- package/es/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
- package/es/components/Select/ui/SelectHeader/SelectHeader.css +15 -6
- package/es/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
- package/es/components/Select/ui/SelectItem/SelectItem.css +16 -7
- package/es/components/Select/ui/SelectItem/SelectItem.js +3 -3
- package/es/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
- package/es/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
- package/es/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
- package/es/components/Select/ui/SelectItem/{SelectItem.styles_6h17aw.css → SelectItem.styles_vk39mp.css} +1 -1
- package/es/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
- package/es/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
- package/es/index.css +18 -8
- package/es/index.js +4 -1
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +91 -2
- package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +27 -7
- package/styled-components/cjs/components/Combobox/utils/index.js +23 -0
- package/styled-components/cjs/components/Dropdown/Dropdown.js +140 -54
- package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +22 -7
- package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +26 -23
- package/styled-components/cjs/components/Dropdown/hooks/useHashMaps.js +29 -0
- package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +199 -0
- package/styled-components/cjs/components/Dropdown/index.js +9 -1
- package/styled-components/cjs/components/Dropdown/reducers/focusedPathReducer.js +40 -0
- package/styled-components/cjs/components/Dropdown/reducers/pathReducer.js +44 -0
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +114 -0
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +5 -0
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +77 -105
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +83 -18
- package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +33 -0
- package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +5 -0
- package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +119 -0
- package/styled-components/cjs/components/Dropdown/ui/index.js +19 -5
- package/styled-components/cjs/components/Dropdown/utils/index.js +15 -1
- package/styled-components/cjs/components/Dropdown/variations/_size/tokens.json +1 -9
- package/styled-components/cjs/components/Dropdown/variations/_view/tokens.json +1 -1
- package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.js +1 -1
- package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
- package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +25 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +292 -0
- package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +90 -3
- package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +23 -6
- package/styled-components/es/components/Combobox/utils/index.js +15 -0
- package/styled-components/es/components/Dropdown/Dropdown.js +142 -55
- package/styled-components/es/components/Dropdown/Dropdown.styles.js +18 -5
- package/styled-components/es/components/Dropdown/Dropdown.tokens.js +26 -23
- package/styled-components/es/components/Dropdown/hooks/useHashMaps.js +23 -0
- package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +193 -0
- package/styled-components/es/components/Dropdown/index.js +1 -0
- package/styled-components/es/components/Dropdown/reducers/focusedPathReducer.js +34 -0
- package/styled-components/es/components/Dropdown/reducers/pathReducer.js +38 -0
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +108 -0
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +1 -0
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +78 -107
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +80 -14
- package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +25 -0
- package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +1 -0
- package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +111 -0
- package/styled-components/es/components/Dropdown/ui/index.js +3 -1
- package/styled-components/es/components/Dropdown/utils/index.js +15 -1
- package/styled-components/es/components/Dropdown/variations/_size/tokens.json +1 -9
- package/styled-components/es/components/Dropdown/variations/_view/tokens.json +1 -1
- package/styled-components/es/components/Select/ui/SelectItem/SelectItem.js +2 -2
- package/styled-components/es/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
- package/styled-components/es/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +19 -0
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +292 -0
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts +15 -13
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts.map +1 -1
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts +5 -1
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts.map +1 -1
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts +59 -2
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts.map +1 -1
- package/types/components/Combobox/utils/index.d.ts +4 -0
- package/types/components/Combobox/utils/index.d.ts.map +1 -0
- package/types/components/Dropdown/Dropdown.d.ts +4 -4
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts +8 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.tokens.d.ts +24 -22
- package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.types.d.ts +64 -40
- package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/types/components/Dropdown/hooks/useHashMaps.d.ts +6 -0
- package/types/components/Dropdown/hooks/useHashMaps.d.ts.map +1 -0
- package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts +23 -0
- package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts.map +1 -0
- package/types/components/Dropdown/index.d.ts +3 -1
- package/types/components/Dropdown/index.d.ts.map +1 -1
- package/types/components/Dropdown/reducers/focusedPathReducer.d.ts +16 -0
- package/types/components/Dropdown/reducers/focusedPathReducer.d.ts.map +1 -0
- package/types/components/Dropdown/reducers/pathReducer.d.ts +20 -0
- package/types/components/Dropdown/reducers/pathReducer.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts +5 -0
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +26 -0
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts +2 -56
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +5 -2
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +44 -38
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts +7 -0
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts +60 -0
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts +58 -0
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownItemOld/variations/_size/base.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownItemOld/variations/_view/base.d.ts.map +1 -0
- package/types/components/Dropdown/ui/index.d.ts +3 -1
- package/types/components/Dropdown/ui/index.d.ts.map +1 -1
- package/types/components/Dropdown/utils/index.d.ts +5 -2
- package/types/components/Dropdown/utils/index.d.ts.map +1 -1
- package/types/components/Select/ui/SelectItem/SelectItem.d.ts +2 -2
- package/types/components/Select/ui/SelectItem/SelectItem.d.ts.map +1 -1
- package/types/components/Select/ui/SelectItem/SelectItem.type.d.ts +2 -2
- package/types/components/Select/utils/index.d.ts +1 -1
- package/types/components/_Icon/Icon.assets/DisclosureRight.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +13 -0
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +0 -1
- package/cjs/components/Dropdown/Dropdown.styles_1daxhqh.css +0 -2
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +0 -4
- package/cjs/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +0 -1
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +0 -1
- package/es/components/Dropdown/Dropdown.styles_1daxhqh.css +0 -2
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +0 -4
- package/es/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +0 -1
- package/styled-components/cjs/components/Dropdown/Dropdown.template-doc.mdx +0 -80
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +0 -19
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +0 -9
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +0 -27
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +0 -13
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +0 -194
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +0 -27
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +0 -13
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +0 -27
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +0 -13
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +0 -195
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +0 -27
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +0 -13
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
- package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.config.js +0 -22
- package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.js +0 -21
- package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +0 -277
- package/styled-components/es/components/Dropdown/Dropdown.template-doc.mdx +0 -80
- package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +0 -19
- package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +0 -9
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +0 -21
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +0 -7
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +0 -194
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +0 -21
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +0 -7
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +0 -21
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +0 -7
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +0 -195
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +0 -21
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +0 -7
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
- package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.config.js +0 -16
- package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.js +0 -15
- package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +0 -277
- package/types/components/Dropdown/ui/DropdownItem/variations/_size/base.d.ts.map +0 -1
- package/types/components/Dropdown/ui/DropdownItem/variations/_view/base.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts +0 -30
- package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts +0 -18
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts +0 -30
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts +0 -18
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts +0 -30
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts +0 -18
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts +0 -30
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts.map +0 -1
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts +0 -15
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts.map +0 -1
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts +0 -51
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts.map +0 -1
- /package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base_x642ct.css +0 -0
- /package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base_x642ct.css +0 -0
- /package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base_x642ct.css +0 -0
- /package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base_x642ct.css +0 -0
- /package/styled-components/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +0 -0
- /package/styled-components/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +0 -0
- /package/styled-components/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +0 -0
- /package/styled-components/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +0 -0
- /package/types/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.d.ts +0 -0
- /package/types/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.d.ts +0 -0
- /package/types/examples/plasma_b2c/components/Dropdown/{Normal/Dropdown.config.d.ts → Dropdown.config.d.ts} +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import './Dropdown.
|
1
|
+
import './Dropdown.styles_1tihqkp.css';
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
@@ -7,8 +7,9 @@ var react = require('@linaria/react');
|
|
7
7
|
require('@linaria/core');
|
8
8
|
var common = require('../../engines/common.js');
|
9
9
|
var Popover$1 = require('../Popover/Popover.js');
|
10
|
+
var index = require('./utils/index.js');
|
11
|
+
var Dropdown_tokens = require('./Dropdown.tokens.js');
|
10
12
|
|
11
|
-
// issue #823
|
12
13
|
var Popover = /*#__PURE__*/common.component(Popover$1.popoverConfig);
|
13
14
|
var _exp = function _exp() {
|
14
15
|
return Popover;
|
@@ -18,12 +19,44 @@ var StyledPopover = /*#__PURE__*/react.styled(_exp())({
|
|
18
19
|
"class": "sn7uamp",
|
19
20
|
propsAsIs: true
|
20
21
|
});
|
21
|
-
var
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
var _exp7 = function _exp7() {
|
23
|
+
return function (_ref) {
|
24
|
+
var listWidth = _ref.listWidth;
|
25
|
+
return listWidth || "var(".concat(Dropdown_tokens.tokens.width, ")");
|
26
|
+
};
|
27
|
+
};
|
28
|
+
var _exp8 = function _exp8() {
|
29
|
+
return function (_ref2) {
|
30
|
+
var listHeight = _ref2.listHeight;
|
31
|
+
return listHeight ? index.getCorrectHeight(listHeight) : 'auto';
|
32
|
+
};
|
33
|
+
};
|
34
|
+
var _exp9 = function _exp9() {
|
35
|
+
return function (_ref3) {
|
36
|
+
var listOverflow = _ref3.listOverflow;
|
37
|
+
return listOverflow || 'initial';
|
38
|
+
};
|
39
|
+
};
|
40
|
+
var _exp10 = function _exp10() {
|
41
|
+
return function (_ref4) {
|
42
|
+
var isInnerUl = _ref4.isInnerUl;
|
43
|
+
return isInnerUl ? "calc(var(".concat(Dropdown_tokens.tokens.padding, ") * -1) 0 0 var(").concat(Dropdown_tokens.tokens.padding, ")") : 0;
|
44
|
+
};
|
45
|
+
};
|
46
|
+
var Ul = /*#__PURE__*/react.styled('ul')({
|
47
|
+
name: "Ul",
|
48
|
+
"class": "ujr7fmv",
|
49
|
+
propsAsIs: false,
|
50
|
+
vars: {
|
51
|
+
"ujr7fmv-0": [/*#__PURE__*/_exp7()],
|
52
|
+
"ujr7fmv-1": [/*#__PURE__*/_exp8()],
|
53
|
+
"ujr7fmv-2": [/*#__PURE__*/_exp9()],
|
54
|
+
"ujr7fmv-3": [/*#__PURE__*/_exp10()]
|
55
|
+
}
|
25
56
|
});
|
57
|
+
var base = "byfocd2";
|
26
58
|
|
27
|
-
exports.StyledDropdown = StyledDropdown;
|
28
59
|
exports.StyledPopover = StyledPopover;
|
60
|
+
exports.Ul = Ul;
|
61
|
+
exports.base = base;
|
29
62
|
//# sourceMappingURL=Dropdown.styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.styles.js","sources":["../../../src/components/Dropdown/Dropdown.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { component } from '../../engines';\nimport { popoverConfig, popoverClasses } from '../Popover';\n\nimport { tokens } from './Dropdown.tokens';\n\
|
1
|
+
{"version":3,"file":"Dropdown.styles.js","sources":["../../../src/components/Dropdown/Dropdown.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\nimport { css } from '@linaria/core';\n\nimport { component } from '../../engines';\nimport { popoverConfig, popoverClasses } from '../Popover';\n\nimport { getCorrectHeight } from './utils';\nimport { DropdownProps } from './Dropdown.types';\nimport { tokens } from './Dropdown.tokens';\n\nconst Popover = component(popoverConfig);\n\nexport const StyledPopover = styled(Popover)`\n .${String(popoverClasses.wrapper)}, .${String(popoverClasses.target)} {\n display: block;\n }\n`;\n\nexport const Ul = styled.ul<{\n listHeight: DropdownProps['listHeight'];\n listOverflow: DropdownProps['listOverflow'];\n isInnerUl?: boolean;\n listWidth?: DropdownProps['listWidth'];\n}>`\n box-sizing: border-box;\n\n background: var(${tokens.background});\n box-shadow: var(${tokens.boxShadow});\n\n border-radius: var(${tokens.borderRadius});\n width: ${({ listWidth }) => listWidth || `var(${tokens.width})`};\n height: ${({ listHeight }) => (listHeight ? getCorrectHeight(listHeight) : 'auto')};\n overflow: ${({ listOverflow }) => listOverflow || 'initial'};\n\n margin: ${({ isInnerUl }) => (isInnerUl ? `calc(var(${tokens.padding}) * -1) 0 0 var(${tokens.padding})` : 0)};\n padding: var(${tokens.padding});\n`;\n\nexport const base = css`\n display: inline-block;\n`;\n"],"names":["Popover","component","popoverConfig","_exp","StyledPopover","styled","name","class","propsAsIs","_exp7","_ref","listWidth","concat","tokens","width","_exp8","_ref2","listHeight","getCorrectHeight","_exp9","_ref3","listOverflow","_exp10","_ref4","isInnerUl","padding","Ul","vars","base"],"mappings":";;;;;;;;;;;AAUA,IAAMA,OAAO,gBAAGC,gBAAS,CAACC,uBAAa,CAAC,CAAA;AAAC,IAAAC,IAAA,GATvBA,SASuBA,IAAAA,GAAA;AAAA,EAAA,OAELH,OAAO,CAAA;AAAA,CAAA,CAAA;AAApC,IAAMI,aAAa,gBAAGC,YAAM,CAAAF,IAAA,EAAA,CAAA,CAAA;AAAAG,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA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AAC,EAAAA,IAAA,EAAA,IAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAmB,EAAAA,IAAA,EAAA;AAAA,IAAA,WAAA,EAAA,cAYXlB,KAAsD,EAAA,CAAA;AAAA,IAAA,WAAA,EAAA,cACrDM,KAAwE,EAAA,CAAA;AAAA,IAAA,WAAA,EAAA,cACtEI,KAA+C,EAAA,CAAA;AAAA,IAAA,WAAA,EAAA,cAEjDG,MAAmG,EAAA,CAAA;AAAA,GAAA;AAAA,CAEhH,EAAA;AAEM,IAAMM,IAAI,GAEhB;;;;;;"}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
.sn7uamp .popover-wrapper,.sn7uamp .popover-target{display:block;}
|
2
|
+
.ujr7fmv{box-sizing:border-box;background:var(--plasma-dropdown-background);box-shadow:var(--plasma-dropdown-box-shadow);border-radius:var(--plasma-dropdown-border-radius);width:var(--ujr7fmv-0);height:var(--ujr7fmv-1);overflow:var(--ujr7fmv-2);margin:var(--ujr7fmv-3);padding:var(--plasma-dropdown-padding);}
|
3
|
+
.byfocd2{display:inline-block;}
|
@@ -3,47 +3,38 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
var classes = {
|
6
|
-
|
7
|
-
|
6
|
+
dropdownRoot: 'dropdown-root',
|
7
|
+
dropdownItemIsFocused: 'dropdown-item-is-focused',
|
8
|
+
dropdownItemIsDisabled: 'dropdown-item-is-disabled',
|
9
|
+
dropdownItemIsActive: 'dropdown-item-is-active',
|
10
|
+
dropdownItemIsSelected: 'dropdownItemIsSelected'
|
8
11
|
};
|
9
12
|
var tokens = {
|
10
13
|
background: '--plasma-dropdown-background',
|
11
14
|
boxShadow: '--plasma-dropdown-box-shadow',
|
12
15
|
width: '--plasma-dropdown-width',
|
13
|
-
height: '--plasma-dropdown-height',
|
14
16
|
borderRadius: '--plasma-dropdown-border-radius',
|
15
|
-
|
16
|
-
|
17
|
-
paddingBottom: '--plasma-dropdown-padding-bottom',
|
18
|
-
paddingLeft: '--plasma-dropdown-padding-left',
|
17
|
+
padding: '--plasma-dropdown-padding',
|
18
|
+
disclosureIconColor: '--plasma-dropdown-disclosure-icon-color',
|
19
19
|
itemBackground: '--plasma-dropdown-item-background',
|
20
20
|
itemColor: '--plasma-dropdown-item-color',
|
21
21
|
itemBackgroundHover: '--plasma-dropdown-item-background-hover',
|
22
|
-
itemBackgroundSelected: '--plasma-dropdown-item-background-selected',
|
23
|
-
itemColorSelected: '--plasma-dropdown-item-color-selected',
|
24
|
-
itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',
|
25
|
-
itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',
|
26
|
-
itemWidth: '--plasma-dropdown-item-width',
|
27
|
-
itemHeight: '--plasma-dropdown-item-height',
|
28
22
|
itemBorderRadius: '--plasma-dropdown-item-border-radius',
|
29
23
|
itemPaddingTop: '--plasma-dropdown-item-padding-top',
|
24
|
+
itemPaddingTopTight: '--plasma-dropdown-item-padding-top-tight',
|
30
25
|
itemPaddingRight: '--plasma-dropdown-item-padding-right',
|
31
26
|
itemPaddingBottom: '--plasma-dropdown-item-padding-bottom',
|
27
|
+
itemPaddingBottomTight: '--plasma-dropdown-item-padding-bottom-tight',
|
32
28
|
itemPaddingLeft: '--plasma-dropdown-item-padding-left',
|
33
|
-
itemMarginTop: '--plasma-dropdown-item-margin-top',
|
34
|
-
itemMarginRight: '--plasma-dropdown-item-margin-right',
|
35
|
-
itemMarginBottom: '--plasma-dropdown-item-margin-bottom',
|
36
|
-
itemMarginLeft: '--plasma-dropdown-item-margin-left',
|
37
29
|
itemFontFamily: '--plasma-dropdown-item-font-family',
|
38
30
|
itemFontSize: '--plasma-dropdown-item-font-size',
|
39
31
|
itemFontStyle: '--plasma-dropdown-item-font-style',
|
40
32
|
itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',
|
41
33
|
itemFontLetterSpacing: '--plasma-dropdown-item-line-height',
|
42
34
|
itemFontLineHeight: '--plasma-dropdown-item-font-weight',
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
itemContentRightWidth: '--plasma-dropdown-item-content-right-width',
|
35
|
+
disabledOpacity: '--plasma-dropdown-disabled-opacity',
|
36
|
+
focusColor: '--plasma-dropdown-focus-color',
|
37
|
+
// TODO: Remove below tokens as soon as they are no longer needed
|
47
38
|
footerBackground: '--plasma-dropdown-footer-background',
|
48
39
|
footerWidth: '--plasma-dropdown-footer-width',
|
49
40
|
footerHeight: '--plasma-dropdown-footer-height',
|
@@ -111,8 +102,20 @@ var tokens = {
|
|
111
102
|
groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',
|
112
103
|
groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',
|
113
104
|
groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left',
|
114
|
-
|
115
|
-
|
105
|
+
itemBackgroundSelected: '--plasma-dropdown-item-background-selected',
|
106
|
+
itemColorSelected: '--plasma-dropdown-item-color-selected',
|
107
|
+
itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',
|
108
|
+
itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',
|
109
|
+
itemContentLeftColor: '--plasma-dropdown-item-content-left-color',
|
110
|
+
itemContentRightColor: '--plasma-dropdown-item-content-right-color',
|
111
|
+
itemWidth: '--plasma-dropdown-item-width',
|
112
|
+
itemHeight: '--plasma-dropdown-item-height',
|
113
|
+
itemMarginTop: '--plasma-dropdown-item-margin-top',
|
114
|
+
itemMarginRight: '--plasma-dropdown-item-margin-right',
|
115
|
+
itemMarginBottom: '--plasma-dropdown-item-margin-bottom',
|
116
|
+
itemMarginLeft: '--plasma-dropdown-item-margin-left',
|
117
|
+
itemContentLeftWidth: '--plasma-dropdown-item-content-left-width',
|
118
|
+
itemContentRightWidth: '--plasma-dropdown-item-content-right-width'
|
116
119
|
};
|
117
120
|
|
118
121
|
exports.classes = classes;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.tokens.js","sources":["../../../src/components/Dropdown/Dropdown.tokens.ts"],"sourcesContent":["export const classes = {\n dropdownItemIsSelected: 'dropdown-item-is-selected',\n dropdownItemIsDisabled: 'dropdown-item-is-disabled',\n};\n\nexport const tokens = {\n background: '--plasma-dropdown-background',\n boxShadow: '--plasma-dropdown-box-shadow',\n width: '--plasma-dropdown-width',\n height: '--plasma-dropdown-height',\n borderRadius: '--plasma-dropdown-border-radius',\n paddingTop: '--plasma-dropdown-padding-top',\n paddingRight: '--plasma-dropdown-padding-right',\n paddingBottom: '--plasma-dropdown-padding-bottom',\n paddingLeft: '--plasma-dropdown-padding-left',\n\n itemBackground: '--plasma-dropdown-item-background',\n itemColor: '--plasma-dropdown-item-color',\n itemBackgroundHover: '--plasma-dropdown-item-background-hover',\n itemBackgroundSelected: '--plasma-dropdown-item-background-selected',\n itemColorSelected: '--plasma-dropdown-item-color-selected',\n itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',\n itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',\n itemWidth: '--plasma-dropdown-item-width',\n itemHeight: '--plasma-dropdown-item-height',\n itemBorderRadius: '--plasma-dropdown-item-border-radius',\n itemPaddingTop: '--plasma-dropdown-item-padding-top',\n itemPaddingRight: '--plasma-dropdown-item-padding-right',\n itemPaddingBottom: '--plasma-dropdown-item-padding-bottom',\n itemPaddingLeft: '--plasma-dropdown-item-padding-left',\n itemMarginTop: '--plasma-dropdown-item-margin-top',\n itemMarginRight: '--plasma-dropdown-item-margin-right',\n itemMarginBottom: '--plasma-dropdown-item-margin-bottom',\n itemMarginLeft: '--plasma-dropdown-item-margin-left',\n itemFontFamily: '--plasma-dropdown-item-font-family',\n itemFontSize: '--plasma-dropdown-item-font-size',\n itemFontStyle: '--plasma-dropdown-item-font-style',\n itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',\n itemFontLetterSpacing: '--plasma-dropdown-item-line-height',\n itemFontLineHeight: '--plasma-dropdown-item-font-weight',\n itemContentLeftColor: '--plasma-dropdown-item-content-left-color',\n itemContentRightColor: '--plasma-dropdown-item-content-right-color',\n itemContentLeftWidth: '--plasma-dropdown-item-content-left-width',\n itemContentRightWidth: '--plasma-dropdown-item-content-right-width',\n\n footerBackground: '--plasma-dropdown-footer-background',\n footerWidth: '--plasma-dropdown-footer-width',\n footerHeight: '--plasma-dropdown-footer-height',\n footerPaddingTop: '--plasma-dropdown-footer-padding-top',\n footerPaddingRight: '--plasma-dropdown-footer-padding-right',\n footerPaddingBottom: '--plasma-dropdown-footer-padding-bottom',\n footerPaddingLeft: '--plasma-dropdown-footer-padding-left',\n footerMarginTop: '--plasma-dropdown-footer-margin-top',\n footerMarginRight: '--plasma-dropdown-footer-margin-right',\n footerMarginBottom: '--plasma-dropdown-footer-margin-bottom',\n footerMarginLeft: '--plasma-dropdown-footer-margin-left',\n footerFontFamily: '--plasma-dropdown-footer-font-family',\n footerFontSize: '--plasma-dropdown-footer-font-size',\n footerFontStyle: '--plasma-dropdown-footer-font-style',\n footerFontWeightBold: '--plasma-dropdown-footer-letter-spacing',\n footerFontLetterSpacing: '--plasma-dropdown-footer-line-height',\n footerFontLineHeight: '--plasma-dropdown-footer-font-weight',\n\n headerBackground: '--plasma-dropdown-header-background',\n headerWidth: '--plasma-dropdown-header-width',\n headerHeight: '--plasma-dropdown-header-height',\n headerPaddingTop: '--plasma-dropdown-header-padding-top',\n headerPaddingRight: '--plasma-dropdown-header-padding-right',\n headerPaddingBottom: '--plasma-dropdown-header-padding-bottom',\n headerPaddingLeft: '--plasma-dropdown-header-padding-left',\n headerMarginTop: '--plasma-dropdown-header-margin-top',\n headerMarginRight: '--plasma-dropdown-header-margin-right',\n headerMarginBottom: '--plasma-dropdown-header-margin-bottom',\n headerMarginLeft: '--plasma-dropdown-header-margin-left',\n headerFontFamily: '--plasma-dropdown-header-font-family',\n headerFontSize: '--plasma-dropdown-header-font-size',\n headerFontStyle: '--plasma-dropdown-header-font-style',\n headerFontWeightBold: '--plasma-dropdown-header-letter-spacing',\n headerFontLetterSpacing: '--plasma-dropdown-header-line-height',\n headerFontLineHeight: '--plasma-dropdown-header-font-weight',\n\n dividerColor: '--plasma-dropdown-divider-color',\n dividerWidth: '--plasma-dropdown-divider-width',\n dividerHeight: '--plasma-dropdown-divider-height',\n dividerMarginTop: '--plasma-dropdown-divider-margin-top',\n dividerMarginRight: '--plasma-dropdown-divider-margin-right',\n dividerMarginBottom: '--plasma-dropdown-divider-margin-bottom',\n dividerMarginLeft: '--plasma-dropdown-divider-margin-left',\n\n groupBackground: '--plasma-dropdown-group-background',\n groupWidth: '--plasma-dropdown-group-width',\n groupHeight: '--plasma-dropdown-group-height',\n groupPaddingTop: '--plasma-dropdown-group-padding-top',\n groupPaddingRight: '--plasma-dropdown-group-padding-right',\n groupPaddingBottom: '--plasma-dropdown-group-padding-bottom',\n groupPaddingLeft: '--plasma-dropdown-group-padding-left',\n groupMarginTop: '--plasma-dropdown-group-margin-top',\n groupMarginRight: '--plasma-dropdown-group-margin-right',\n groupMarginBottom: '--plasma-dropdown-group-margin-bottom',\n groupMarginLeft: '--plasma-dropdown-group-margin-left',\n groupLabelColor: '--plasma-dropdown-group-label-color',\n groupLabelFontFamily: '--plasma-dropdown-group-label-font-family',\n groupLabelFontSize: '--plasma-dropdown-group-label-font-size',\n groupLabelFontStyle: '--plasma-dropdown-group-label-font-style',\n groupLabelFontWeight: '--plasma-dropdown-group-label-font-weight',\n groupLabelLetterSpacing: '--plasma-dropdown-group-label-letter-spacing',\n groupLabelLineHeight: '--plasma-dropdown-group-label-line-height',\n groupLabelPaddingTop: '--plasma-dropdown-group-label-padding-top',\n groupLabelPaddingRight: '--plasma-dropdown-group-label-padding-right',\n groupLabelPaddingBottom: '--plasma-dropdown-group-label-padding-bottom',\n groupLabelPaddingLeft: '--plasma-dropdown-group-label-padding-left',\n groupLabelMarginTop: '--plasma-dropdown-group-label-margin-top',\n groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',\n groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',\n groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left',\n\n disabledOpacity: '--plasma-dropdown-disabled-opacity',\n focusColor: '--plasma-dropdown-focus-color',\n};\n"],"names":["classes","dropdownItemIsSelected","dropdownItemIsDisabled","tokens","background","boxShadow","width","height","borderRadius","paddingTop","paddingRight","paddingBottom","paddingLeft","itemBackground","itemColor","itemBackgroundHover","itemBackgroundSelected","itemColorSelected","itemBackgroundSelectedHover","itemColorSelectedHover","itemWidth","itemHeight","itemBorderRadius","itemPaddingTop","itemPaddingRight","itemPaddingBottom","itemPaddingLeft","itemMarginTop","itemMarginRight","itemMarginBottom","itemMarginLeft","itemFontFamily","itemFontSize","itemFontStyle","itemFontWeightBold","itemFontLetterSpacing","itemFontLineHeight","itemContentLeftColor","itemContentRightColor","itemContentLeftWidth","itemContentRightWidth","footerBackground","footerWidth","footerHeight","footerPaddingTop","footerPaddingRight","footerPaddingBottom","footerPaddingLeft","footerMarginTop","footerMarginRight","footerMarginBottom","footerMarginLeft","footerFontFamily","footerFontSize","footerFontStyle","footerFontWeightBold","footerFontLetterSpacing","footerFontLineHeight","headerBackground","headerWidth","headerHeight","headerPaddingTop","headerPaddingRight","headerPaddingBottom","headerPaddingLeft","headerMarginTop","headerMarginRight","headerMarginBottom","headerMarginLeft","headerFontFamily","headerFontSize","headerFontStyle","headerFontWeightBold","headerFontLetterSpacing","headerFontLineHeight","dividerColor","dividerWidth","dividerHeight","dividerMarginTop","dividerMarginRight","dividerMarginBottom","dividerMarginLeft","groupBackground","groupWidth","groupHeight","groupPaddingTop","groupPaddingRight","groupPaddingBottom","groupPaddingLeft","groupMarginTop","groupMarginRight","groupMarginBottom","groupMarginLeft","groupLabelColor","groupLabelFontFamily","groupLabelFontSize","groupLabelFontStyle","groupLabelFontWeight","groupLabelLetterSpacing","groupLabelLineHeight","groupLabelPaddingTop","groupLabelPaddingRight","groupLabelPaddingBottom","groupLabelPaddingLeft","groupLabelMarginTop","groupLabelMarginRight","groupLabelMarginBottom","groupLabelMarginLeft","disabledOpacity","focusColor"],"mappings":";;;;AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,sBAAsB,EAAE,2BAA2B;AACnDC,EAAAA,sBAAsB,EAAE,2BAAA;AAC5B,EAAC;AAEM,IAAMC,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,SAAS,EAAE,8BAA8B;AACzCC,EAAAA,KAAK,EAAE,yBAAyB;AAChCC,EAAAA,MAAM,EAAE,0BAA0B;AAClCC,EAAAA,YAAY,EAAE,iCAAiC;AAC/CC,EAAAA,UAAU,EAAE,+BAA+B;AAC3CC,EAAAA,YAAY,EAAE,iCAAiC;AAC/CC,EAAAA,aAAa,EAAE,kCAAkC;AACjDC,EAAAA,WAAW,EAAE,gCAAgC;AAE7CC,EAAAA,cAAc,EAAE,mCAAmC;AACnDC,EAAAA,SAAS,EAAE,8BAA8B;AACzCC,EAAAA,mBAAmB,EAAE,yCAAyC;AAC9DC,EAAAA,sBAAsB,EAAE,4CAA4C;AACpEC,EAAAA,iBAAiB,EAAE,uCAAuC;AAC1DC,EAAAA,2BAA2B,EAAE,kDAAkD;AAC/EC,EAAAA,sBAAsB,EAAE,6CAA6C;AACrEC,EAAAA,SAAS,EAAE,8BAA8B;AACzCC,EAAAA,UAAU,EAAE,+BAA+B;AAC3CC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxDC,EAAAA,cAAc,EAAE,oCAAoC;AACpDC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxDC,EAAAA,iBAAiB,EAAE,uCAAuC;AAC1DC,EAAAA,eAAe,EAAE,qCAAqC;AACtDC,EAAAA,aAAa,EAAE,mCAAmC;AAClDC,EAAAA,eAAe,EAAE,qCAAqC;AACtDC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxDC,EAAAA,cAAc,EAAE,oCAAoC;AACpDC,EAAAA,cA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A2C;AACjEC,EAAAA,uBAAuB,EAAE,8CAA8C;AACvEC,EAAAA,oBAAoB,EAAE,2CAA2C;AACjEC,EAAAA,oBAAoB,EAAE,2CAA2C;AACjEC,EAAAA,sBAAsB,EAAE,6CAA6C;AACrEC,EAAAA,uBAAuB,EAAE,8CAA8C;AACvEC,EAAAA,qBAAqB,EAAE,4CAA4C;AACnEC,EAAAA,mBAAmB,EAAE,0CAA0C;AAC/DC,EAAAA,qBAAqB,EAAE,4CAA4C;AACnEC,EAAAA,sBAAsB,EAAE,6CAA6C;AACrEC,EAAAA,oBAAoB,EAAE,2CAA2C;AAEjEC,EAAAA,eAAe,EAAE,oCAAoC;AACrDC,EAAAA,UAAU,EAAE,+BAAA;AAChB;;;;;"}
|
1
|
+
{"version":3,"file":"Dropdown.tokens.js","sources":["../../../src/components/Dropdown/Dropdown.tokens.ts"],"sourcesContent":["export const classes = {\n dropdownRoot: 'dropdown-root',\n dropdownItemIsFocused: 'dropdown-item-is-focused',\n dropdownItemIsDisabled: 'dropdown-item-is-disabled',\n dropdownItemIsActive: 'dropdown-item-is-active',\n dropdownItemIsSelected: 'dropdownItemIsSelected',\n};\n\nexport const tokens = {\n background: '--plasma-dropdown-background',\n boxShadow: '--plasma-dropdown-box-shadow',\n width: '--plasma-dropdown-width',\n borderRadius: '--plasma-dropdown-border-radius',\n padding: '--plasma-dropdown-padding',\n disclosureIconColor: '--plasma-dropdown-disclosure-icon-color',\n\n itemBackground: '--plasma-dropdown-item-background',\n itemColor: '--plasma-dropdown-item-color',\n itemBackgroundHover: '--plasma-dropdown-item-background-hover',\n itemBorderRadius: '--plasma-dropdown-item-border-radius',\n itemPaddingTop: '--plasma-dropdown-item-padding-top',\n itemPaddingTopTight: '--plasma-dropdown-item-padding-top-tight',\n itemPaddingRight: '--plasma-dropdown-item-padding-right',\n itemPaddingBottom: '--plasma-dropdown-item-padding-bottom',\n itemPaddingBottomTight: '--plasma-dropdown-item-padding-bottom-tight',\n itemPaddingLeft: '--plasma-dropdown-item-padding-left',\n\n itemFontFamily: '--plasma-dropdown-item-font-family',\n itemFontSize: '--plasma-dropdown-item-font-size',\n itemFontStyle: '--plasma-dropdown-item-font-style',\n itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',\n itemFontLetterSpacing: '--plasma-dropdown-item-line-height',\n itemFontLineHeight: '--plasma-dropdown-item-font-weight',\n\n disabledOpacity: '--plasma-dropdown-disabled-opacity',\n focusColor: '--plasma-dropdown-focus-color',\n\n // TODO: Remove below tokens as soon as they are no longer needed\n footerBackground: '--plasma-dropdown-footer-background',\n footerWidth: '--plasma-dropdown-footer-width',\n footerHeight: '--plasma-dropdown-footer-height',\n footerPaddingTop: '--plasma-dropdown-footer-padding-top',\n footerPaddingRight: '--plasma-dropdown-footer-padding-right',\n footerPaddingBottom: '--plasma-dropdown-footer-padding-bottom',\n footerPaddingLeft: '--plasma-dropdown-footer-padding-left',\n footerMarginTop: '--plasma-dropdown-footer-margin-top',\n footerMarginRight: '--plasma-dropdown-footer-margin-right',\n footerMarginBottom: '--plasma-dropdown-footer-margin-bottom',\n footerMarginLeft: '--plasma-dropdown-footer-margin-left',\n footerFontFamily: '--plasma-dropdown-footer-font-family',\n footerFontSize: '--plasma-dropdown-footer-font-size',\n footerFontStyle: '--plasma-dropdown-footer-font-style',\n footerFontWeightBold: '--plasma-dropdown-footer-letter-spacing',\n footerFontLetterSpacing: '--plasma-dropdown-footer-line-height',\n footerFontLineHeight: '--plasma-dropdown-footer-font-weight',\n\n headerBackground: '--plasma-dropdown-header-background',\n headerWidth: '--plasma-dropdown-header-width',\n headerHeight: '--plasma-dropdown-header-height',\n headerPaddingTop: '--plasma-dropdown-header-padding-top',\n headerPaddingRight: '--plasma-dropdown-header-padding-right',\n headerPaddingBottom: '--plasma-dropdown-header-padding-bottom',\n headerPaddingLeft: '--plasma-dropdown-header-padding-left',\n headerMarginTop: '--plasma-dropdown-header-margin-top',\n headerMarginRight: '--plasma-dropdown-header-margin-right',\n headerMarginBottom: '--plasma-dropdown-header-margin-bottom',\n headerMarginLeft: '--plasma-dropdown-header-margin-left',\n headerFontFamily: '--plasma-dropdown-header-font-family',\n headerFontSize: '--plasma-dropdown-header-font-size',\n headerFontStyle: '--plasma-dropdown-header-font-style',\n headerFontWeightBold: '--plasma-dropdown-header-letter-spacing',\n headerFontLetterSpacing: '--plasma-dropdown-header-line-height',\n headerFontLineHeight: '--plasma-dropdown-header-font-weight',\n\n dividerColor: '--plasma-dropdown-divider-color',\n dividerWidth: '--plasma-dropdown-divider-width',\n dividerHeight: '--plasma-dropdown-divider-height',\n dividerMarginTop: '--plasma-dropdown-divider-margin-top',\n dividerMarginRight: '--plasma-dropdown-divider-margin-right',\n dividerMarginBottom: '--plasma-dropdown-divider-margin-bottom',\n dividerMarginLeft: '--plasma-dropdown-divider-margin-left',\n\n groupBackground: '--plasma-dropdown-group-background',\n groupWidth: '--plasma-dropdown-group-width',\n groupHeight: '--plasma-dropdown-group-height',\n groupPaddingTop: '--plasma-dropdown-group-padding-top',\n groupPaddingRight: '--plasma-dropdown-group-padding-right',\n groupPaddingBottom: '--plasma-dropdown-group-padding-bottom',\n groupPaddingLeft: '--plasma-dropdown-group-padding-left',\n groupMarginTop: '--plasma-dropdown-group-margin-top',\n groupMarginRight: '--plasma-dropdown-group-margin-right',\n groupMarginBottom: '--plasma-dropdown-group-margin-bottom',\n groupMarginLeft: '--plasma-dropdown-group-margin-left',\n groupLabelColor: '--plasma-dropdown-group-label-color',\n groupLabelFontFamily: '--plasma-dropdown-group-label-font-family',\n groupLabelFontSize: '--plasma-dropdown-group-label-font-size',\n groupLabelFontStyle: '--plasma-dropdown-group-label-font-style',\n groupLabelFontWeight: '--plasma-dropdown-group-label-font-weight',\n groupLabelLetterSpacing: '--plasma-dropdown-group-label-letter-spacing',\n groupLabelLineHeight: '--plasma-dropdown-group-label-line-height',\n groupLabelPaddingTop: '--plasma-dropdown-group-label-padding-top',\n groupLabelPaddingRight: '--plasma-dropdown-group-label-padding-right',\n groupLabelPaddingBottom: '--plasma-dropdown-group-label-padding-bottom',\n groupLabelPaddingLeft: '--plasma-dropdown-group-label-padding-left',\n groupLabelMarginTop: '--plasma-dropdown-group-label-margin-top',\n groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',\n groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',\n groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left',\n\n itemBackgroundSelected: '--plasma-dropdown-item-background-selected',\n itemColorSelected: '--plasma-dropdown-item-color-selected',\n itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',\n itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',\n itemContentLeftColor: '--plasma-dropdown-item-content-left-color',\n itemContentRightColor: '--plasma-dropdown-item-content-right-color',\n itemWidth: '--plasma-dropdown-item-width',\n itemHeight: '--plasma-dropdown-item-height',\n itemMarginTop: '--plasma-dropdown-item-margin-top',\n itemMarginRight: '--plasma-dropdown-item-margin-right',\n itemMarginBottom: '--plasma-dropdown-item-margin-bottom',\n itemMarginLeft: '--plasma-dropdown-item-margin-left',\n itemContentLeftWidth: '--plasma-dropdown-item-content-left-width',\n itemContentRightWidth: '--plasma-dropdown-item-content-right-width',\n};\n"],"names":["classes","dropdownRoot","dropdownItemIsFocused","dropdownItemIsDisabled","dropdownItemIsActive","dropdownItemIsSelected","tokens","background","boxShadow","width","borderRadius","padding","disclosureIconColor","itemBackground","itemColor","itemBackgroundHover","itemBorderRadius","itemPaddingTop","itemPaddingTopTight","itemPaddingRight","itemPaddingBottom","itemPaddingBottomTight","itemPaddingLeft","itemFontFamily","itemFontSize","itemFontStyle","itemFontWeightBold","itemFontLetterSpacing","itemFontLineHeight","disabledOpacity","focusColor","footerBackground","footerWidth","footerHeight","footerPaddingTop","footerPaddingRight","footerPaddingBottom","footerPaddingLeft","footerMarginTop","footerMarginRight","footerMarginBottom","footerMarginLeft","footerFontFamily","footerFontSize","footerFontStyle","footerFontWeightBold","footerFontLetterSpacing","footerFontLineHeight","headerBackground","headerWidth","headerHeight","headerPaddingTop","headerPaddingRight","headerPaddingBottom","headerPaddingLeft","headerMarginTop","headerMarginRight","headerMarginBottom","headerMarginLeft","headerFontFamily","headerFontSize","headerFontStyle","headerFontWeightBold","headerFontLetterSpacing","headerFontLineHeight","dividerColor","dividerWidth","dividerHeight","dividerMarginTop","dividerMarginRight","dividerMarginBottom","dividerMarginLeft","groupBackground","groupWidth","groupHeight","groupPaddingTop","groupPaddingRight","groupPaddingBottom","groupPaddingLeft","groupMarginTop","groupMarginRight","groupMarginBottom","groupMarginLeft","groupLabelColor","groupLabelFontFamily","groupLabelFontSize","groupLabelFontStyle","groupLabelFontWeight","groupLabelLetterSpacing","groupLabelLineHeight","groupLabelPaddingTop","groupLabelPaddingRight","groupLabelPaddingBottom","groupLabelPaddingLeft","groupLabelMarginTop","groupLabelMarginRight","groupLabelMarginBottom","groupLabelMarginLeft","itemBackgroundSelected","itemColorSelected","itemBackgroundSelectedHover","itemColorSelectedHover","itemContentLeftColor","itemContentRightColor","itemWidth","itemHeight","itemMarginTop","itemMarginRight","itemMarginBottom","itemMarginLeft","itemContentLeftWidth","itemContentRightWidth"],"mappings":";;;;AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,YAAY,EAAE,eAAe;AAC7BC,EAAAA,qBAAqB,EAAE,0BAA0B;AACjDC,EAAAA,sBAAsB,EAAE,2BAA2B;AACnDC,EAAAA,oBAAoB,EAAE,yBAAyB;AAC/CC,EAAAA,sBAAsB,EAAE,wBAAA;AAC5B,EAAC;AAEM,IAAMC,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,SAAS,EAAE,8BAA8B;AACzCC,EAAAA,KAAK,EAAE,yBAAyB;AAChCC,EAAAA,YAAY,EAAE,iCAAiC;AAC/CC,EAAAA,OAAO,EAAE,2BAA2B;AACpCC,EAAAA,mBAAmB,EAAE,yCAAyC;AAE9DC,EAAAA,cAAc,EAAE,mCAAmC;AACn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
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var React = require('react');
|
6
|
+
|
7
|
+
var useHashMaps = function useHashMaps(items) {
|
8
|
+
return React.useMemo(function () {
|
9
|
+
var pathMap = new Map();
|
10
|
+
var focusedToValueMap = new Map();
|
11
|
+
pathMap.set('root', items.length);
|
12
|
+
var rec = function rec(items) {
|
13
|
+
var prevIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
14
|
+
items.forEach(function (item, index) {
|
15
|
+
var value = item.value,
|
16
|
+
innerItems = item.items;
|
17
|
+
var currIndex = "".concat(prevIndex, "/").concat(index).replace(/^(\/)/, '');
|
18
|
+
focusedToValueMap.set(currIndex, item);
|
19
|
+
if (innerItems) {
|
20
|
+
pathMap.set(value, innerItems.length);
|
21
|
+
rec(innerItems, currIndex);
|
22
|
+
}
|
23
|
+
});
|
24
|
+
};
|
25
|
+
rec(items);
|
26
|
+
return [pathMap, focusedToValueMap];
|
27
|
+
}, [items]);
|
28
|
+
};
|
29
|
+
|
30
|
+
exports.useHashMaps = useHashMaps;
|
31
|
+
//# sourceMappingURL=useHashMaps.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useHashMaps.js","sources":["../../../../src/components/Dropdown/hooks/useHashMaps.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { DropdownProps } from '../Dropdown.types';\nimport { DropdownItemOption } from '../ui/DropdownItem/DropdownItem.type';\n\nexport type PathMapType = Map<string | number, number>;\nexport type FocusedToValueMapType = Map<string, DropdownItemOption>;\n\nexport const useHashMaps = (items: DropdownProps['items']) => {\n return useMemo(() => {\n const pathMap: PathMapType = new Map();\n const focusedToValueMap: FocusedToValueMapType = new Map();\n\n pathMap.set('root', items.length);\n\n const rec = (items: DropdownProps['items'], prevIndex = '') => {\n items.forEach((item: DropdownItemOption, index: number) => {\n const { value, items: innerItems } = item;\n\n const currIndex = `${prevIndex}/${index}`.replace(/^(\\/)/, '');\n focusedToValueMap.set(currIndex, item);\n\n if (innerItems) {\n pathMap.set(value, innerItems.length);\n rec(innerItems, currIndex);\n }\n });\n };\n rec(items);\n\n return [pathMap, focusedToValueMap] as [PathMapType, FocusedToValueMapType];\n }, [items]);\n};\n"],"names":["useHashMaps","items","useMemo","pathMap","Map","focusedToValueMap","set","length","rec","prevIndex","arguments","undefined","forEach","item","index","value","innerItems","currIndex","concat","replace"],"mappings":";;;;;;IAQaA,WAAW,GAAG,SAAdA,WAAWA,CAAIC,KAA6B,EAAK;EAC1D,OAAOC,aAAO,CAAC,YAAM;AACjB,IAAA,IAAMC,OAAoB,GAAG,IAAIC,GAAG,EAAE,CAAA;AACtC,IAAA,IAAMC,iBAAwC,GAAG,IAAID,GAAG,EAAE,CAAA;IAE1DD,OAAO,CAACG,GAAG,CAAC,MAAM,EAAEL,KAAK,CAACM,MAAM,CAAC,CAAA;AAEjC,IAAA,IAAMC,GAAG,GAAG,SAANA,GAAGA,CAAIP,KAA6B,EAAqB;AAAA,MAAA,IAAnBQ,SAAS,GAAAC,SAAA,CAAAH,MAAA,GAAA,CAAA,IAAAG,SAAA,CAAA,CAAA,CAAA,KAAAC,SAAA,GAAAD,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE,CAAA;AACtDT,MAAAA,KAAK,CAACW,OAAO,CAAC,UAACC,IAAwB,EAAEC,KAAa,EAAK;AACvD,QAAA,IAAQC,KAAK,GAAwBF,IAAI,CAAjCE,KAAK;UAASC,UAAU,GAAKH,IAAI,CAA1BZ,KAAK,CAAA;AAEpB,QAAA,IAAMgB,SAAS,GAAG,EAAA,CAAAC,MAAA,CAAGT,SAAS,EAAAS,GAAAA,CAAAA,CAAAA,MAAA,CAAIJ,KAAK,EAAGK,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;AAC9Dd,QAAAA,iBAAiB,CAACC,GAAG,CAACW,SAAS,EAAEJ,IAAI,CAAC,CAAA;AAEtC,QAAA,IAAIG,UAAU,EAAE;UACZb,OAAO,CAACG,GAAG,CAACS,KAAK,EAAEC,UAAU,CAACT,MAAM,CAAC,CAAA;AACrCC,UAAAA,GAAG,CAACQ,UAAU,EAAEC,SAAS,CAAC,CAAA;AAC9B,SAAA;AACJ,OAAC,CAAC,CAAA;KACL,CAAA;IACDT,GAAG,CAACP,KAAK,CAAC,CAAA;AAEV,IAAA,OAAO,CAACE,OAAO,EAAEE,iBAAiB,CAAC,CAAA;AACvC,GAAC,EAAE,CAACJ,KAAK,CAAC,CAAC,CAAA;AACf;;;;"}
|
@@ -0,0 +1,200 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var getFurtherPath = function getFurtherPath(focusedPath, focusedToValueMap) {
|
6
|
+
var focusedPathAsString = focusedPath.reduce(function (acc, n) {
|
7
|
+
return "".concat(acc, "/").concat(n);
|
8
|
+
}, '').replace(/^(\/)/, '');
|
9
|
+
return focusedToValueMap.get(focusedPathAsString);
|
10
|
+
};
|
11
|
+
var useKeyNavigation = function useKeyNavigation(_ref) {
|
12
|
+
var focusedPath = _ref.focusedPath,
|
13
|
+
dispatchFocusedPath = _ref.dispatchFocusedPath,
|
14
|
+
path = _ref.path,
|
15
|
+
dispatchPath = _ref.dispatchPath,
|
16
|
+
pathMap = _ref.pathMap,
|
17
|
+
focusedToValueMap = _ref.focusedToValueMap,
|
18
|
+
handleGlobalToggle = _ref.handleGlobalToggle,
|
19
|
+
closeOnSelect = _ref.closeOnSelect,
|
20
|
+
onItemSelect = _ref.onItemSelect,
|
21
|
+
onItemClick = _ref.onItemClick;
|
22
|
+
var currentLength = pathMap.get(path === null || path === void 0 ? void 0 : path[path.length - 1]) || 0;
|
23
|
+
var currentIndex = (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[focusedPath.length - 1]) || 0;
|
24
|
+
var onKeyDown = function onKeyDown(event) {
|
25
|
+
var code = event.code;
|
26
|
+
if (code === 'ArrowUp') {
|
27
|
+
if (focusedPath.length) {
|
28
|
+
var newIndex = currentIndex <= 0 ? currentLength - 1 : currentIndex - 1;
|
29
|
+
dispatchFocusedPath({
|
30
|
+
type: 'change_last_focus',
|
31
|
+
value: newIndex
|
32
|
+
});
|
33
|
+
} else {
|
34
|
+
dispatchPath({
|
35
|
+
type: 'opened_first_level'
|
36
|
+
});
|
37
|
+
dispatchFocusedPath({
|
38
|
+
type: 'set_initial_focus'
|
39
|
+
});
|
40
|
+
handleGlobalToggle(true, event);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
if (code === 'ArrowDown') {
|
44
|
+
if (focusedPath.length) {
|
45
|
+
var _newIndex = currentIndex + 1 >= currentLength ? 0 : currentIndex + 1;
|
46
|
+
dispatchFocusedPath({
|
47
|
+
type: 'change_last_focus',
|
48
|
+
value: _newIndex
|
49
|
+
});
|
50
|
+
} else {
|
51
|
+
dispatchPath({
|
52
|
+
type: 'opened_first_level'
|
53
|
+
});
|
54
|
+
dispatchFocusedPath({
|
55
|
+
type: 'set_initial_focus'
|
56
|
+
});
|
57
|
+
handleGlobalToggle(true, event);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
if (code === 'ArrowLeft') {
|
61
|
+
if (focusedPath.length) {
|
62
|
+
dispatchPath({
|
63
|
+
type: 'removed_last_level'
|
64
|
+
});
|
65
|
+
dispatchFocusedPath({
|
66
|
+
type: 'return_prev_focus'
|
67
|
+
});
|
68
|
+
}
|
69
|
+
if (focusedPath.length === 1) {
|
70
|
+
handleGlobalToggle(false, event);
|
71
|
+
}
|
72
|
+
}
|
73
|
+
if (code === 'ArrowRight') {
|
74
|
+
if (focusedPath.length) {
|
75
|
+
var currentItem = getFurtherPath(focusedPath, focusedToValueMap);
|
76
|
+
if (currentItem !== null && currentItem !== void 0 && currentItem.items) {
|
77
|
+
dispatchPath({
|
78
|
+
type: 'added_next_level',
|
79
|
+
value: currentItem.value.toString()
|
80
|
+
});
|
81
|
+
dispatchFocusedPath({
|
82
|
+
type: 'add_focus',
|
83
|
+
value: 0
|
84
|
+
});
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
if (code === 'Enter' || code === 'Space') {
|
89
|
+
event.preventDefault();
|
90
|
+
if (path[0]) {
|
91
|
+
var _currentItem = getFurtherPath(focusedPath, focusedToValueMap);
|
92
|
+
if (_currentItem !== null && _currentItem !== void 0 && _currentItem.disabled || _currentItem !== null && _currentItem !== void 0 && _currentItem.isDisabled) return;
|
93
|
+
if (_currentItem !== null && _currentItem !== void 0 && _currentItem.items) {
|
94
|
+
dispatchPath({
|
95
|
+
type: 'added_next_level',
|
96
|
+
value: _currentItem.value.toString()
|
97
|
+
});
|
98
|
+
dispatchFocusedPath({
|
99
|
+
type: 'add_focus',
|
100
|
+
value: 0
|
101
|
+
});
|
102
|
+
} else {
|
103
|
+
if (closeOnSelect) {
|
104
|
+
handleGlobalToggle(false, event);
|
105
|
+
}
|
106
|
+
if (onItemSelect && _currentItem) {
|
107
|
+
onItemSelect(_currentItem, event);
|
108
|
+
}
|
109
|
+
if (onItemClick && _currentItem) {
|
110
|
+
onItemClick(_currentItem, event);
|
111
|
+
}
|
112
|
+
}
|
113
|
+
} else {
|
114
|
+
dispatchPath({
|
115
|
+
type: 'opened_first_level'
|
116
|
+
});
|
117
|
+
dispatchFocusedPath({
|
118
|
+
type: 'set_initial_focus'
|
119
|
+
});
|
120
|
+
}
|
121
|
+
}
|
122
|
+
if (code === 'Tab' || code === 'Escape') {
|
123
|
+
dispatchFocusedPath({
|
124
|
+
type: 'reset'
|
125
|
+
});
|
126
|
+
dispatchPath({
|
127
|
+
type: 'reset'
|
128
|
+
});
|
129
|
+
handleGlobalToggle(false, event);
|
130
|
+
}
|
131
|
+
if (code === 'Home') {
|
132
|
+
if (path[0]) {
|
133
|
+
dispatchFocusedPath({
|
134
|
+
type: 'change_last_focus',
|
135
|
+
value: 0
|
136
|
+
});
|
137
|
+
} else {
|
138
|
+
dispatchPath({
|
139
|
+
type: 'opened_first_level'
|
140
|
+
});
|
141
|
+
dispatchFocusedPath({
|
142
|
+
type: 'set_initial_focus'
|
143
|
+
});
|
144
|
+
handleGlobalToggle(true, event);
|
145
|
+
}
|
146
|
+
}
|
147
|
+
if (code === 'End') {
|
148
|
+
if (path[0]) {
|
149
|
+
dispatchFocusedPath({
|
150
|
+
type: 'change_last_focus',
|
151
|
+
value: currentLength - 1
|
152
|
+
});
|
153
|
+
} else {
|
154
|
+
dispatchPath({
|
155
|
+
type: 'opened_first_level'
|
156
|
+
});
|
157
|
+
dispatchFocusedPath({
|
158
|
+
type: 'change_last_focus',
|
159
|
+
value: (pathMap.get('root') || 0) - 1
|
160
|
+
});
|
161
|
+
handleGlobalToggle(true, event);
|
162
|
+
}
|
163
|
+
}
|
164
|
+
if (code === 'PageUp') {
|
165
|
+
if (path[0]) {
|
166
|
+
if (currentIndex <= 10) {
|
167
|
+
dispatchFocusedPath({
|
168
|
+
type: 'set_initial_focus'
|
169
|
+
});
|
170
|
+
} else {
|
171
|
+
dispatchFocusedPath({
|
172
|
+
type: 'change_last_focus',
|
173
|
+
value: currentIndex - 10
|
174
|
+
});
|
175
|
+
}
|
176
|
+
}
|
177
|
+
}
|
178
|
+
if (code === 'PageDown') {
|
179
|
+
if (path[0]) {
|
180
|
+
if (currentLength - currentIndex <= 10) {
|
181
|
+
dispatchFocusedPath({
|
182
|
+
type: 'change_last_focus',
|
183
|
+
value: currentLength - 1
|
184
|
+
});
|
185
|
+
} else {
|
186
|
+
dispatchFocusedPath({
|
187
|
+
type: 'change_last_focus',
|
188
|
+
value: currentIndex + 10
|
189
|
+
});
|
190
|
+
}
|
191
|
+
}
|
192
|
+
}
|
193
|
+
};
|
194
|
+
return {
|
195
|
+
onKeyDown: onKeyDown
|
196
|
+
};
|
197
|
+
};
|
198
|
+
|
199
|
+
exports.useKeyNavigation = useKeyNavigation;
|
200
|
+
//# sourceMappingURL=useKeyboardNavigation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useKeyboardNavigation.js","sources":["../../../../src/components/Dropdown/hooks/useKeyboardNavigation.ts"],"sourcesContent":["import { KeyboardEvent } from 'react';\nimport type { Dispatch } from 'react';\n\nimport { PathAction, PathState } from '../reducers/pathReducer';\nimport { FocusedPathAction, FocusedPathState } from '../reducers/focusedPathReducer';\nimport { HandleGlobalToggleType, DropdownProps } from '../Dropdown.types';\n\nimport { PathMapType, FocusedToValueMapType } from './useHashMaps';\n\nconst getFurtherPath = (focusedPath: FocusedPathState, focusedToValueMap: FocusedToValueMapType) => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n\n return focusedToValueMap.get(focusedPathAsString);\n};\n\ninterface Props {\n focusedPath: FocusedPathState;\n dispatchFocusedPath: Dispatch<FocusedPathAction>;\n path: PathState;\n dispatchPath: Dispatch<PathAction>;\n pathMap: PathMapType;\n focusedToValueMap: FocusedToValueMapType;\n handleGlobalToggle: HandleGlobalToggleType;\n closeOnSelect: DropdownProps['closeOnSelect'];\n onItemSelect: DropdownProps['onItemSelect'];\n onItemClick: DropdownProps['onItemClick'];\n}\n\ninterface ReturnedProps {\n onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;\n}\n\nexport const useKeyNavigation = ({\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleGlobalToggle,\n closeOnSelect,\n onItemSelect,\n onItemClick,\n}: Props): ReturnedProps => {\n const currentLength: number = pathMap.get(path?.[path.length - 1]) || 0;\n const currentIndex: number = focusedPath?.[focusedPath.length - 1] || 0;\n\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n const { code } = event;\n\n if (code === 'ArrowUp') {\n if (focusedPath.length) {\n const newIndex = currentIndex <= 0 ? currentLength - 1 : currentIndex - 1;\n dispatchFocusedPath({ type: 'change_last_focus', value: newIndex });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'set_initial_focus' });\n handleGlobalToggle(true, event);\n }\n }\n\n if (code === 'ArrowDown') {\n if (focusedPath.length) {\n const newIndex = currentIndex + 1 >= currentLength ? 0 : currentIndex + 1;\n dispatchFocusedPath({ type: 'change_last_focus', value: newIndex });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'set_initial_focus' });\n handleGlobalToggle(true, event);\n }\n }\n\n if (code === 'ArrowLeft') {\n if (focusedPath.length) {\n dispatchPath({ type: 'removed_last_level' });\n dispatchFocusedPath({ type: 'return_prev_focus' });\n }\n\n if (focusedPath.length === 1) {\n handleGlobalToggle(false, event);\n }\n }\n\n if (code === 'ArrowRight') {\n if (focusedPath.length) {\n const currentItem = getFurtherPath(focusedPath, focusedToValueMap);\n\n if (currentItem?.items) {\n dispatchPath({ type: 'added_next_level', value: currentItem.value.toString() });\n dispatchFocusedPath({ type: 'add_focus', value: 0 });\n }\n }\n }\n\n if (code === 'Enter' || code === 'Space') {\n event.preventDefault();\n\n if (path[0]) {\n const currentItem = getFurtherPath(focusedPath, focusedToValueMap);\n\n if (currentItem?.disabled || currentItem?.isDisabled) return;\n\n if (currentItem?.items) {\n dispatchPath({ type: 'added_next_level', value: currentItem.value.toString() });\n dispatchFocusedPath({ type: 'add_focus', value: 0 });\n } else {\n if (closeOnSelect) {\n handleGlobalToggle(false, event);\n }\n\n if (onItemSelect && currentItem) {\n onItemSelect(currentItem, event);\n }\n\n if (onItemClick && currentItem) {\n onItemClick(currentItem, event);\n }\n }\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'set_initial_focus' });\n }\n }\n\n if (code === 'Tab' || code === 'Escape') {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n\n handleGlobalToggle(false, event);\n }\n\n if (code === 'Home') {\n if (path[0]) {\n dispatchFocusedPath({ type: 'change_last_focus', value: 0 });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'set_initial_focus' });\n\n handleGlobalToggle(true, event);\n }\n }\n\n if (code === 'End') {\n if (path[0]) {\n dispatchFocusedPath({ type: 'change_last_focus', value: currentLength - 1 });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'change_last_focus', value: (pathMap.get('root') || 0) - 1 });\n\n handleGlobalToggle(true, event);\n }\n }\n\n if (code === 'PageUp') {\n if (path[0]) {\n if (currentIndex <= 10) {\n dispatchFocusedPath({ type: 'set_initial_focus' });\n } else {\n dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex - 10 });\n }\n }\n }\n\n if (code === 'PageDown') {\n if (path[0]) {\n if (currentLength - currentIndex <= 10) {\n dispatchFocusedPath({ type: 'change_last_focus', value: currentLength - 1 });\n } else {\n dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex + 10 });\n }\n }\n }\n };\n\n return { onKeyDown };\n};\n"],"names":["getFurtherPath","focusedPath","focusedToValueMap","focusedPathAsString","reduce","acc","n","concat","replace","get","useKeyNavigation","_ref","dispatchFocusedPath","path","dispatchPath","pathMap","handleGlobalToggle","closeOnSelect","onItemSelect","onItemClick","currentLength","length","currentIndex","onKeyDown","event","code","newIndex","type","value","currentItem","items","toString","preventDefault","disabled","isDisabled"],"mappings":";;;;AASA,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,WAA6B,EAAEC,iBAAwC,EAAK;EAChG,IAAMC,mBAAmB,GAAGF,WAAW,CAACG,MAAM,CAAC,UAACC,GAAG,EAAEC,CAAC,EAAA;AAAA,IAAA,OAAA,EAAA,CAAAC,MAAA,CAAQF,GAAG,EAAAE,GAAAA,CAAAA,CAAAA,MAAA,CAAID,CAAC,CAAA,CAAA;GAAE,EAAE,EAAE,CAAC,CAACE,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;AAElG,EAAA,OAAON,iBAAiB,CAACO,GAAG,CAACN,mBAAmB,CAAC,CAAA;AACrD,CAAC,CAAA;IAmBYO,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,I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AChF,SAAA;AACJ,OAAA;AACJ,KAAA;IAEA,IAAIG,IAAI,KAAK,UAAU,EAAE;AACrB,MAAA,IAAIZ,IAAI,CAAC,CAAC,CAAC,EAAE;AACT,QAAA,IAAIO,aAAa,GAAGE,YAAY,IAAI,EAAE,EAAE;AACpCV,UAAAA,mBAAmB,CAAC;AAAEe,YAAAA,IAAI,EAAE,mBAAmB;YAAEC,KAAK,EAAER,aAAa,GAAG,CAAA;AAAE,WAAC,CAAC,CAAA;AAChF,SAAC,MAAM;AACHR,UAAAA,mBAAmB,CAAC;AAAEe,YAAAA,IAAI,EAAE,mBAAmB;YAAEC,KAAK,EAAEN,YAAY,GAAG,EAAA;AAAG,WAAC,CAAC,CAAA;AAChF,SAAA;AACJ,OAAA;AACJ,KAAA;GACH,CAAA;EAED,OAAO;AAAEC,IAAAA,SAAS,EAATA,SAAAA;GAAW,CAAA;AACxB;;;;"}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
6
|
+
|
7
|
+
function focusedPathReducer(state, action) {
|
8
|
+
switch (action.type) {
|
9
|
+
case 'reset':
|
10
|
+
{
|
11
|
+
return [];
|
12
|
+
}
|
13
|
+
case 'set_initial_focus':
|
14
|
+
{
|
15
|
+
return [0];
|
16
|
+
}
|
17
|
+
case 'change_last_focus':
|
18
|
+
{
|
19
|
+
return [].concat(_rollupPluginBabelHelpers.toConsumableArray(state.slice(0, -1)), [action.value]);
|
20
|
+
}
|
21
|
+
case 'add_focus':
|
22
|
+
{
|
23
|
+
return [].concat(_rollupPluginBabelHelpers.toConsumableArray(state), [action.value]);
|
24
|
+
}
|
25
|
+
case 'return_prev_focus':
|
26
|
+
{
|
27
|
+
return _rollupPluginBabelHelpers.toConsumableArray(state.slice(0, -1));
|
28
|
+
}
|
29
|
+
default:
|
30
|
+
{
|
31
|
+
return state;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
exports.focusedPathReducer = focusedPathReducer;
|
37
|
+
//# sourceMappingURL=focusedPathReducer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"focusedPathReducer.js","sources":["../../../../src/components/Dropdown/reducers/focusedPathReducer.ts"],"sourcesContent":["export type FocusedPathState = Array<number>;\n\nexport type FocusedPathAction =\n | { type: 'reset' }\n | { type: 'set_initial_focus' }\n | { type: 'change_last_focus'; value: number }\n | { type: 'add_focus'; value: number }\n | { type: 'return_prev_focus' };\n\nexport function focusedPathReducer(state: FocusedPathState, action: FocusedPathAction): FocusedPathState {\n switch (action.type) {\n case 'reset': {\n return [];\n }\n\n case 'set_initial_focus': {\n return [0];\n }\n\n case 'change_last_focus': {\n return [...state.slice(0, -1), action.value];\n }\n\n case 'add_focus': {\n return [...state, action.value];\n }\n\n case 'return_prev_focus': {\n return [...state.slice(0, -1)];\n }\n\n default: {\n return state;\n }\n }\n}\n"],"names":["focusedPathReducer","state","action","type","concat","_toConsumableArray","slice","value"],"mappings":";;;;;;AASO,SAASA,kBAAkBA,CAACC,KAAuB,EAAEC,MAAyB,EAAoB;EACrG,QAAQA,MAAM,CAACC,IAAI;AACf,IAAA,KAAK,OAAO;AAAE,MAAA;AACV,QAAA,OAAO,EAAE,CAAA;AACb,OAAA;AAEA,IAAA,KAAK,mBAAmB;AAAE,MAAA;QACtB,OAAO,CAAC,CAAC,CAAC,CAAA;AACd,OAAA;AAEA,IAAA,KAAK,mBAAmB;AAAE,MAAA;AACtB,QAAA,OAAA,EAAA,CAAAC,MAAA,CAAAC,2CAAA,CAAWJ,KAAK,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAEJ,EAAAA,CAAAA,MAAM,CAACK,KAAK,CAAA,CAAA,CAAA;AAC/C,OAAA;AAEA,IAAA,KAAK,WAAW;AAAE,MAAA;QACd,OAAAH,EAAAA,CAAAA,MAAA,CAAAC,2CAAA,CAAWJ,KAAK,CAAEC,EAAAA,CAAAA,MAAM,CAACK,KAAK,CAAA,CAAA,CAAA;AAClC,OAAA;AAEA,IAAA,KAAK,mBAAmB;AAAE,MAAA;QACtB,OAAAF,2CAAA,CAAWJ,KAAK,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA,CAAA;AACjC,OAAA;AAEA,IAAA;AAAS,MAAA;AACL,QAAA,OAAOL,KAAK,CAAA;AAChB,OAAA;AACJ,GAAA;AACJ;;;;"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
6
|
+
|
7
|
+
function pathReducer(state, action) {
|
8
|
+
switch (action.type) {
|
9
|
+
case 'reset':
|
10
|
+
{
|
11
|
+
return [];
|
12
|
+
}
|
13
|
+
case 'opened_first_level':
|
14
|
+
{
|
15
|
+
return ['root'];
|
16
|
+
}
|
17
|
+
case 'added_next_level':
|
18
|
+
{
|
19
|
+
return [].concat(_rollupPluginBabelHelpers.toConsumableArray(state), [action.value]);
|
20
|
+
}
|
21
|
+
case 'removed_last_level':
|
22
|
+
{
|
23
|
+
return _rollupPluginBabelHelpers.toConsumableArray(state.slice(0, -1));
|
24
|
+
}
|
25
|
+
case 'changed_on_level':
|
26
|
+
{
|
27
|
+
return [].concat(_rollupPluginBabelHelpers.toConsumableArray(state.slice(0, action.level)), [action.value]);
|
28
|
+
}
|
29
|
+
case 'cut_by_level':
|
30
|
+
{
|
31
|
+
return state.slice(0, action.level);
|
32
|
+
}
|
33
|
+
default:
|
34
|
+
{
|
35
|
+
return state;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
exports.pathReducer = pathReducer;
|
41
|
+
//# sourceMappingURL=pathReducer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pathReducer.js","sources":["../../../../src/components/Dropdown/reducers/pathReducer.ts"],"sourcesContent":["export type PathState = Array<string>;\n\nexport type PathAction =\n | { type: 'reset' }\n | { type: 'opened_first_level' }\n | { type: 'added_next_level'; value: string }\n | { type: 'removed_last_level' }\n | { type: 'changed_on_level'; value: string; level: number }\n | { type: 'cut_by_level'; level: number };\n\nexport function pathReducer(state: PathState, action: PathAction): PathState {\n switch (action.type) {\n case 'reset': {\n return [];\n }\n\n case 'opened_first_level': {\n return ['root'];\n }\n\n case 'added_next_level': {\n return [...state, action.value];\n }\n\n case 'removed_last_level': {\n return [...state.slice(0, -1)];\n }\n\n case 'changed_on_level': {\n return [...state.slice(0, action.level), action.value];\n }\n\n case 'cut_by_level': {\n return state.slice(0, action.level);\n }\n\n default: {\n return state;\n }\n }\n}\n"],"names":["pathReducer","state","action","type","concat","_toConsumableArray","value","slice","level"],"mappings":";;;;;;AAUO,SAASA,WAAWA,CAACC,KAAgB,EAAEC,MAAkB,EAAa;EACzE,QAAQA,MAAM,CAACC,IAAI;AACf,IAAA,KAAK,OAAO;AAAE,MAAA;AACV,QAAA,OAAO,EAAE,CAAA;AACb,OAAA;AAEA,IAAA,KAAK,oBAAoB;AAAE,MAAA;QACvB,OAAO,CAAC,MAAM,CAAC,CAAA;AACnB,OAAA;AAEA,IAAA,KAAK,kBAAkB;AAAE,MAAA;QACrB,OAAAC,EAAAA,CAAAA,MAAA,CAAAC,2CAAA,CAAWJ,KAAK,CAAEC,EAAAA,CAAAA,MAAM,CAACI,KAAK,CAAA,CAAA,CAAA;AAClC,OAAA;AAEA,IAAA,KAAK,oBAAoB;AAAE,MAAA;QACvB,OAAAD,2CAAA,CAAWJ,KAAK,CAACM,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA,CAAA;AACjC,OAAA;AAEA,IAAA,KAAK,kBAAkB;AAAE,MAAA;AACrB,QAAA,OAAA,EAAA,CAAAH,MAAA,CAAAC,2CAAA,CAAWJ,KAAK,CAACM,KAAK,CAAC,CAAC,EAAEL,MAAM,CAACM,KAAK,CAAC,CAAEN,EAAAA,CAAAA,MAAM,CAACI,KAAK,CAAA,CAAA,CAAA;AACzD,OAAA;AAEA,IAAA,KAAK,cAAc;AAAE,MAAA;QACjB,OAAOL,KAAK,CAACM,KAAK,CAAC,CAAC,EAAEL,MAAM,CAACM,KAAK,CAAC,CAAA;AACvC,OAAA;AAEA,IAAA;AAAS,MAAA;AACL,QAAA,OAAOP,KAAK,CAAA;AAChB,OAAA;AACJ,GAAA;AACJ;;;;"}
|