@salutejs/plasma-new-hope 0.174.0-canary.1497.11501781410.0 → 0.174.0-canary.1503.11500823810.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +10 -10
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +10 -10
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +10 -10
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -6
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_y71664.css → Item.styles_1us8jz1.css} +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.css +14 -28
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +18 -32
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +18 -32
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +18 -32
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +18 -32
- package/cjs/components/Dropdown/Dropdown.css +16 -30
- package/cjs/components/Dropdown/Dropdown.js +37 -60
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles.js +26 -14
- 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 +1 -24
- package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +51 -17
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +6 -46
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +18 -29
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +31 -25
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_blclup.css +6 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/{DropdownItem.styles_1lyg81y.css → DropdownItem.styles_12e50g5.css} +1 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -4
- package/cjs/components/Dropdown/utils/index.js.map +1 -1
- package/cjs/components/Notification/Notification.css +11 -11
- package/cjs/components/Notification/Notification.js +2 -2
- package/cjs/components/Notification/Notification.js.map +1 -1
- package/cjs/components/Notification/Notification.styles.js +1 -1
- package/cjs/components/Notification/Notification.styles.js.map +1 -1
- package/cjs/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_1cf2gwd.css} +1 -1
- package/cjs/components/Notification/Notification.tokens.js +2 -1
- package/cjs/components/Notification/Notification.tokens.js.map +1 -1
- package/cjs/components/Notification/Notification.types.js.map +1 -1
- package/cjs/components/Notification/NotificationsPortal.js +5 -3
- package/cjs/components/Notification/NotificationsPortal.js.map +1 -1
- package/cjs/components/Notification/NotificationsProvider.css +11 -11
- package/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/cjs/components/Notification/NotificationsProvider.js.map +1 -1
- package/cjs/components/Select/Select.js +1 -1
- package/cjs/components/Select/utils/getCorrectHeight.js.map +1 -1
- package/cjs/hooks/useOutsideClick.js +1 -1
- package/cjs/hooks/useOutsideClick.js.map +1 -1
- package/cjs/index.css +33 -31
- package/cjs/index.js +1 -1
- package/cjs/utils/index.js.map +1 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -14
- package/emotion/cjs/components/Dropdown/Dropdown.js +37 -58
- package/emotion/cjs/components/Dropdown/Dropdown.styles.js +25 -9
- package/emotion/cjs/components/Dropdown/Dropdown.tokens.js +2 -36
- package/emotion/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +51 -17
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +18 -29
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +41 -21
- package/emotion/cjs/components/Dropdown/utils/index.js +1 -23
- package/emotion/cjs/components/Notification/Notification.js +2 -2
- package/emotion/cjs/components/Notification/Notification.styles.js +11 -11
- package/emotion/cjs/components/Notification/Notification.template-doc.mdx +15 -7
- package/emotion/cjs/components/Notification/Notification.tokens.js +2 -1
- package/emotion/cjs/components/Notification/NotificationsPortal.js +6 -4
- package/emotion/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/emotion/cjs/components/Notification/index.js +4 -4
- package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +12 -12
- package/emotion/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
- package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
- package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/cjs/examples/plasma_web/components/Combobox/Combobox.config.js +12 -12
- package/emotion/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/cjs/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
- package/emotion/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
- package/emotion/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/cjs/hooks/useOutsideClick.js +1 -1
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -14
- package/emotion/es/components/Dropdown/Dropdown.js +40 -60
- package/emotion/es/components/Dropdown/Dropdown.styles.js +25 -9
- package/emotion/es/components/Dropdown/Dropdown.tokens.js +1 -35
- package/emotion/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +52 -18
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +20 -31
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +42 -22
- package/emotion/es/components/Dropdown/utils/index.js +1 -4
- package/emotion/es/components/Notification/Notification.js +1 -1
- package/emotion/es/components/Notification/Notification.styles.js +11 -11
- package/emotion/es/components/Notification/Notification.template-doc.mdx +15 -7
- package/emotion/es/components/Notification/Notification.tokens.js +2 -1
- package/emotion/es/components/Notification/NotificationsPortal.js +6 -4
- package/emotion/es/components/Notification/NotificationsProvider.js +3 -1
- package/emotion/es/components/Notification/index.js +1 -1
- package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +12 -12
- package/emotion/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +6 -6
- package/emotion/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
- package/emotion/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
- package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/es/examples/plasma_web/components/Combobox/Combobox.config.js +12 -12
- package/emotion/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +6 -6
- package/emotion/es/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
- package/emotion/es/examples/plasma_web/components/Notification/Notification.js +6 -4
- package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/es/hooks/useOutsideClick.js +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.css +10 -10
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +10 -10
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +10 -10
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -6
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_y71664.css → Item.styles_1us8jz1.css} +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.css +14 -28
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +18 -32
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +18 -32
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +18 -32
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +18 -32
- package/es/components/Dropdown/Dropdown.css +16 -30
- package/es/components/Dropdown/Dropdown.js +40 -62
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles.js +26 -15
- 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 +1 -24
- package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +52 -18
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +6 -46
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +20 -31
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +29 -24
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_blclup.css +6 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +1 -1
- package/es/components/Dropdown/ui/DropdownItemOld/{DropdownItem.styles_1lyg81y.css → DropdownItem.styles_12e50g5.css} +1 -1
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -4
- package/es/components/Dropdown/utils/index.js.map +1 -1
- package/es/components/Notification/Notification.css +11 -11
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/Notification/Notification.js.map +1 -1
- package/es/components/Notification/Notification.styles.js +1 -1
- package/es/components/Notification/Notification.styles.js.map +1 -1
- package/es/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_1cf2gwd.css} +1 -1
- package/es/components/Notification/Notification.tokens.js +2 -1
- package/es/components/Notification/Notification.tokens.js.map +1 -1
- package/es/components/Notification/Notification.types.js.map +1 -1
- package/es/components/Notification/NotificationsPortal.js +5 -3
- package/es/components/Notification/NotificationsPortal.js.map +1 -1
- package/es/components/Notification/NotificationsProvider.css +11 -11
- package/es/components/Notification/NotificationsProvider.js +3 -1
- package/es/components/Notification/NotificationsProvider.js.map +1 -1
- package/es/components/Select/Select.js +1 -1
- package/es/components/Select/utils/getCorrectHeight.js.map +1 -1
- package/es/hooks/useOutsideClick.js +1 -1
- package/es/hooks/useOutsideClick.js.map +1 -1
- package/es/index.css +33 -31
- package/es/index.js +1 -1
- package/es/utils/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +10 -4
- package/styled-components/cjs/components/Dropdown/Dropdown.js +37 -58
- package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +15 -9
- package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +2 -36
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +51 -17
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +18 -29
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +19 -17
- package/styled-components/cjs/components/Dropdown/utils/index.js +1 -23
- package/styled-components/cjs/components/Notification/Notification.js +2 -2
- package/styled-components/cjs/components/Notification/Notification.styles.js +1 -1
- package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +15 -7
- package/styled-components/cjs/components/Notification/Notification.tokens.js +2 -1
- package/styled-components/cjs/components/Notification/NotificationsPortal.js +5 -3
- package/styled-components/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/styled-components/cjs/components/Notification/index.js +4 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
- package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/cjs/examples/plasma_web/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
- package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
- package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/cjs/hooks/useOutsideClick.js +1 -1
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +10 -4
- package/styled-components/es/components/Dropdown/Dropdown.js +40 -60
- package/styled-components/es/components/Dropdown/Dropdown.styles.js +15 -9
- package/styled-components/es/components/Dropdown/Dropdown.tokens.js +1 -35
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +52 -18
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +20 -31
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +20 -18
- package/styled-components/es/components/Dropdown/utils/index.js +1 -4
- package/styled-components/es/components/Notification/Notification.js +1 -1
- package/styled-components/es/components/Notification/Notification.styles.js +1 -1
- package/styled-components/es/components/Notification/Notification.template-doc.mdx +15 -7
- package/styled-components/es/components/Notification/Notification.tokens.js +2 -1
- package/styled-components/es/components/Notification/NotificationsPortal.js +5 -3
- package/styled-components/es/components/Notification/NotificationsProvider.js +3 -1
- package/styled-components/es/components/Notification/index.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +6 -6
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
- package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
- package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/es/examples/plasma_web/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +6 -6
- package/styled-components/es/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
- package/styled-components/es/examples/plasma_web/components/Notification/Notification.js +6 -4
- package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/es/hooks/useOutsideClick.js +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxOld/Combobox.types.d.ts +1 -2
- package/types/components/Combobox/ComboboxOld/Combobox.types.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts +1 -2
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts +6 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.tokens.d.ts +0 -25
- package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.types.d.ts +4 -30
- package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/types/components/Dropdown/index.d.ts +1 -1
- package/types/components/Dropdown/index.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +12 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +3 -32
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +14 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
- package/types/components/Dropdown/utils/index.d.ts +0 -3
- package/types/components/Dropdown/utils/index.d.ts.map +1 -1
- package/types/components/Notification/Notification.d.ts +3 -3
- package/types/components/Notification/Notification.d.ts.map +1 -1
- package/types/components/Notification/Notification.styles.d.ts.map +1 -1
- package/types/components/Notification/Notification.tokens.d.ts +1 -0
- package/types/components/Notification/Notification.tokens.d.ts.map +1 -1
- package/types/components/Notification/Notification.types.d.ts +11 -5
- package/types/components/Notification/Notification.types.d.ts.map +1 -1
- package/types/components/Notification/NotificationsPortal.d.ts.map +1 -1
- package/types/components/Notification/NotificationsProvider.d.ts +4 -3
- package/types/components/Notification/NotificationsProvider.d.ts.map +1 -1
- package/types/components/Notification/index.d.ts +2 -2
- package/types/components/Notification/index.d.ts.map +1 -1
- package/types/components/Select/utils/getCorrectHeight.d.ts +2 -2
- package/types/components/Select/utils/getCorrectHeight.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts +3 -3
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +4 -4
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Notification/Notification.d.ts +4 -2
- package/types/examples/plasma_b2c/components/Notification/Notification.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Dropdown/Dropdown.config.d.ts +3 -3
- package/types/examples/plasma_web/components/Dropdown/Dropdown.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts +4 -4
- package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Notification/Notification.d.ts +4 -13
- package/types/examples/plasma_web/components/Notification/Notification.d.ts.map +1 -1
- package/types/hooks/useOutsideClick.d.ts +1 -1
- package/types/hooks/useOutsideClick.d.ts.map +1 -1
- package/types/utils/index.d.ts +1 -1
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles_1ix6io8.css +0 -2
- package/cjs/components/Dropdown/FloatingPopover.js +0 -104
- package/cjs/components/Dropdown/FloatingPopover.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_17va0nk.css +0 -5
- package/cjs/components/Dropdown/utils/getItemByFocused.js +0 -13
- package/cjs/components/Dropdown/utils/getItemByFocused.js.map +0 -1
- package/cjs/components/Dropdown/utils/getItemId.js +0 -10
- package/cjs/components/Dropdown/utils/getItemId.js.map +0 -1
- package/cjs/components/Dropdown/utils/getPlacement.js +0 -16
- package/cjs/components/Dropdown/utils/getPlacement.js.map +0 -1
- package/emotion/cjs/components/Dropdown/FloatingPopover.js +0 -109
- package/emotion/cjs/components/Dropdown/utils/getItemByFocused.js +0 -12
- package/emotion/cjs/components/Dropdown/utils/getItemId.js +0 -9
- package/emotion/cjs/components/Dropdown/utils/getPlacement.js +0 -15
- package/emotion/es/components/Dropdown/FloatingPopover.js +0 -102
- package/emotion/es/components/Dropdown/utils/getItemByFocused.js +0 -6
- package/emotion/es/components/Dropdown/utils/getItemId.js +0 -3
- package/emotion/es/components/Dropdown/utils/getPlacement.js +0 -9
- package/es/components/Dropdown/Dropdown.styles_1ix6io8.css +0 -2
- package/es/components/Dropdown/FloatingPopover.js +0 -100
- package/es/components/Dropdown/FloatingPopover.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_17va0nk.css +0 -5
- package/es/components/Dropdown/utils/getItemByFocused.js +0 -9
- package/es/components/Dropdown/utils/getItemByFocused.js.map +0 -1
- package/es/components/Dropdown/utils/getItemId.js +0 -6
- package/es/components/Dropdown/utils/getItemId.js.map +0 -1
- package/es/components/Dropdown/utils/getPlacement.js +0 -12
- package/es/components/Dropdown/utils/getPlacement.js.map +0 -1
- package/styled-components/cjs/components/Dropdown/FloatingPopover.js +0 -109
- package/styled-components/cjs/components/Dropdown/utils/getItemByFocused.js +0 -12
- package/styled-components/cjs/components/Dropdown/utils/getItemId.js +0 -9
- package/styled-components/cjs/components/Dropdown/utils/getPlacement.js +0 -15
- package/styled-components/es/components/Dropdown/FloatingPopover.js +0 -102
- package/styled-components/es/components/Dropdown/utils/getItemByFocused.js +0 -6
- package/styled-components/es/components/Dropdown/utils/getItemId.js +0 -3
- package/styled-components/es/components/Dropdown/utils/getPlacement.js +0 -9
- package/types/components/Dropdown/FloatingPopover.d.ts +0 -5
- package/types/components/Dropdown/FloatingPopover.d.ts.map +0 -1
- package/types/components/Dropdown/utils/getItemByFocused.d.ts +0 -4
- package/types/components/Dropdown/utils/getItemByFocused.d.ts.map +0 -1
- package/types/components/Dropdown/utils/getItemId.d.ts +0 -2
- package/types/components/Dropdown/utils/getItemId.d.ts.map +0 -1
- package/types/components/Dropdown/utils/getPlacement.d.ts +0 -3
- package/types/components/Dropdown/utils/getPlacement.d.ts.map +0 -1
@@ -4,11 +4,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
5
5
|
value: true
|
6
6
|
});
|
7
|
-
exports.dropdownRoot = exports.dropdownConfig =
|
7
|
+
exports.dropdownRoot = exports.dropdownConfig = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
10
9
|
var _utils = /*#__PURE__*/require("../../utils");
|
11
|
-
var _hooks = /*#__PURE__*/require("../../hooks");
|
12
10
|
var _pathReducer = /*#__PURE__*/require("./reducers/pathReducer");
|
13
11
|
var _focusedPathReducer = /*#__PURE__*/require("./reducers/focusedPathReducer");
|
14
12
|
var _ui = /*#__PURE__*/require("./ui");
|
@@ -19,7 +17,6 @@ var _utils2 = /*#__PURE__*/require("./utils");
|
|
19
17
|
var _Dropdown2 = /*#__PURE__*/require("./Dropdown.tokens");
|
20
18
|
var _useKeyboardNavigation = /*#__PURE__*/require("./hooks/useKeyboardNavigation");
|
21
19
|
var _useHashMaps3 = /*#__PURE__*/require("./hooks/useHashMaps");
|
22
|
-
var _FloatingPopover = /*#__PURE__*/require("./FloatingPopover");
|
23
20
|
var _excluded = ["items", "children", "placement", "offset", "closeOnOverlayClick", "onToggle", "size", "view", "itemRole", "className", "listWidth", "listHeight", "listOverflow", "closeOnSelect", "onHover", "onItemSelect", "onItemClick", "trigger", "variant", "hasArrow", "portal"];
|
24
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
25
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
@@ -32,18 +29,17 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
32
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
33
30
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
34
31
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
35
|
-
var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)({});
|
36
|
-
|
37
32
|
/**
|
38
33
|
* Выпадающий список.
|
39
34
|
*/
|
40
35
|
var dropdownRoot = exports.dropdownRoot = function dropdownRoot(Root) {
|
41
36
|
return /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
42
|
-
var _getItemByFocused;
|
43
37
|
var items = _ref.items,
|
44
38
|
children = _ref.children,
|
45
|
-
placement = _ref.placement,
|
46
|
-
|
39
|
+
_ref$placement = _ref.placement,
|
40
|
+
placement = _ref$placement === void 0 ? 'bottom' : _ref$placement,
|
41
|
+
_ref$offset = _ref.offset,
|
42
|
+
offset = _ref$offset === void 0 ? [0, 0] : _ref$offset,
|
47
43
|
_ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
|
48
44
|
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
|
49
45
|
onToggle = _ref.onToggle,
|
@@ -80,25 +76,6 @@ var dropdownRoot = exports.dropdownRoot = function dropdownRoot(Root) {
|
|
80
76
|
_useHashMaps2 = _slicedToArray(_useHashMaps, 2),
|
81
77
|
pathMap = _useHashMaps2[0],
|
82
78
|
focusedToValueMap = _useHashMaps2[1];
|
83
|
-
var activeDescendantItemValue = ((_getItemByFocused = (0, _utils2.getItemByFocused)(focusedPath, focusedToValueMap)) === null || _getItemByFocused === void 0 ? void 0 : _getItemByFocused.value) || '';
|
84
|
-
var floatingPopoverRef = (0, _react.useRef)(null);
|
85
|
-
var treeId = (0, _plasmaCore.safeUseId)();
|
86
|
-
|
87
|
-
// Логика работы при клике за пределами выпадающего списка
|
88
|
-
var targetRef = (0, _hooks.useOutsideClick)(function (event) {
|
89
|
-
if (!isCurrentListOpen || !closeOnOverlayClick) {
|
90
|
-
return;
|
91
|
-
}
|
92
|
-
dispatchPath({
|
93
|
-
type: 'reset'
|
94
|
-
});
|
95
|
-
dispatchFocusedPath({
|
96
|
-
type: 'reset'
|
97
|
-
});
|
98
|
-
if (onToggle) {
|
99
|
-
onToggle(false, event);
|
100
|
-
}
|
101
|
-
}, floatingPopoverRef);
|
102
79
|
var handleGlobalToggle = function handleGlobalToggle(opened, event) {
|
103
80
|
if (opened) {
|
104
81
|
dispatchPath({
|
@@ -130,64 +107,66 @@ var dropdownRoot = exports.dropdownRoot = function dropdownRoot(Root) {
|
|
130
107
|
}),
|
131
108
|
onKeyDown = _useKeyNavigation.onKeyDown;
|
132
109
|
var isCurrentListOpen = Boolean(path[0]);
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
onHover: onHover,
|
142
|
-
onItemClick: onItemClick,
|
143
|
-
onItemSelect: onItemSelect,
|
144
|
-
hasArrow: hasArrow,
|
145
|
-
treeId: treeId
|
146
|
-
}
|
147
|
-
}, /*#__PURE__*/_react["default"].createElement(_FloatingPopover.FloatingPopover, {
|
148
|
-
ref: floatingPopoverRef,
|
110
|
+
var getActiveDescendant = function getActiveDescendant() {
|
111
|
+
var _focusedToValueMap$ge;
|
112
|
+
var focusedPathAsString = focusedPath.reduce(function (acc, n) {
|
113
|
+
return "".concat(acc, "/").concat(n);
|
114
|
+
}, '').replace(/^(\/)/, '');
|
115
|
+
return focusedToValueMap === null || focusedToValueMap === void 0 || (_focusedToValueMap$ge = focusedToValueMap.get(focusedPathAsString)) === null || _focusedToValueMap$ge === void 0 ? void 0 : _focusedToValueMap$ge.value.toString();
|
116
|
+
};
|
117
|
+
return /*#__PURE__*/_react["default"].createElement(_Dropdown.StyledPopover, {
|
149
118
|
opened: isCurrentListOpen,
|
150
119
|
onToggle: handleGlobalToggle,
|
151
|
-
placement: (0, _utils2.getPlacement)(placement),
|
152
120
|
offset: offset,
|
153
|
-
|
121
|
+
placement: (0, _utils.getPlacements)(placement),
|
154
122
|
trigger: trigger,
|
123
|
+
closeOnOverlayClick: closeOnOverlayClick,
|
124
|
+
isFocusTrapped: false,
|
155
125
|
target: (0, _utils2.childrenWithProps)(children, {
|
156
126
|
role: 'combobox',
|
157
|
-
'aria-controls':
|
127
|
+
'aria-controls': 'tree_level_1',
|
158
128
|
'aria-expanded': isCurrentListOpen,
|
159
|
-
'aria-activedescendant':
|
129
|
+
'aria-activedescendant': getActiveDescendant(),
|
160
130
|
onKeyDown: onKeyDown
|
161
|
-
})
|
131
|
+
}),
|
132
|
+
preventOverflow: false,
|
133
|
+
usePortal: Boolean(portal),
|
134
|
+
frame: portal
|
162
135
|
}, /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
163
136
|
className: (0, _utils.cx)(className, _Dropdown2.classes.dropdownRoot),
|
164
137
|
ref: ref,
|
165
138
|
view: view,
|
166
|
-
size: size
|
167
|
-
style: {
|
168
|
-
display: 'inline-block'
|
169
|
-
}
|
139
|
+
size: size
|
170
140
|
}, rest), /*#__PURE__*/_react["default"].createElement(_Dropdown.Ul, {
|
171
|
-
ref: targetRef,
|
172
|
-
id: "".concat(treeId, "_tree_level_1"),
|
173
|
-
role: "tree",
|
174
141
|
listHeight: listHeight,
|
175
142
|
listOverflow: listOverflow,
|
143
|
+
role: "tree",
|
144
|
+
id: "tree_level_1",
|
176
145
|
listWidth: listWidth
|
177
146
|
}, items.map(function (item, index) {
|
178
147
|
return /*#__PURE__*/_react["default"].createElement(_ui.DropdownInner, {
|
179
148
|
key: "".concat(index, "/0"),
|
180
149
|
item: item,
|
181
150
|
currentLevel: 0,
|
151
|
+
focusedPath: focusedPath,
|
182
152
|
trigger: trigger,
|
183
153
|
path: path,
|
184
154
|
dispatchPath: dispatchPath,
|
185
155
|
index: index,
|
156
|
+
itemRole: itemRole,
|
186
157
|
listHeight: listHeight,
|
187
158
|
listOverflow: listOverflow,
|
188
|
-
|
159
|
+
handleGlobalToggle: handleGlobalToggle,
|
160
|
+
closeOnSelect: closeOnSelect,
|
161
|
+
onHover: onHover,
|
162
|
+
onItemSelect: onItemSelect,
|
163
|
+
onItemClick: onItemClick,
|
164
|
+
listWidth: listWidth,
|
165
|
+
variant: variant,
|
166
|
+
hasArrow: hasArrow,
|
167
|
+
size: size
|
189
168
|
});
|
190
|
-
}))))
|
169
|
+
}))));
|
191
170
|
});
|
192
171
|
};
|
193
172
|
var dropdownConfig = exports.dropdownConfig = {
|
@@ -3,26 +3,42 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.base = exports.Ul = void 0;
|
6
|
+
exports.base = exports.Ul = exports.StyledPopover = void 0;
|
7
7
|
var _base = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("@emotion/styled/base"));
|
8
8
|
var _react = /*#__PURE__*/require("@emotion/react");
|
9
|
+
var _engines = /*#__PURE__*/require("../../engines");
|
10
|
+
var _Popover = /*#__PURE__*/require("../Popover");
|
9
11
|
var _utils = /*#__PURE__*/require("./utils");
|
10
12
|
var _Dropdown = /*#__PURE__*/require("./Dropdown.tokens");
|
11
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
14
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
15
|
+
var Popover = /*#__PURE__*/(0, _engines.component)(_Popover.popoverConfig);
|
16
|
+
var StyledPopover = exports.StyledPopover = /*#__PURE__*/(0, _base["default"])(Popover, {
|
17
|
+
target: "euqmbvx1",
|
18
|
+
label: "plasma-new-hope__StyledPopover"
|
19
|
+
})(".", /*#__PURE__*/String(_Popover.popoverClasses.wrapper), ",.", /*#__PURE__*/String(_Popover.popoverClasses.target), "{display:block;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJvcGRvd24uc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVk0QyIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL0Ryb3Bkb3duL0Ryb3Bkb3duLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgY29tcG9uZW50IH0gZnJvbSAnLi4vLi4vZW5naW5lcyc7XG5pbXBvcnQgeyBwb3BvdmVyQ29uZmlnLCBwb3BvdmVyQ2xhc3NlcyB9IGZyb20gJy4uL1BvcG92ZXInO1xuXG5pbXBvcnQgeyBnZXRDb3JyZWN0SGVpZ2h0IH0gZnJvbSAnLi91dGlscyc7XG5pbXBvcnQgeyBEcm9wZG93blByb3BzIH0gZnJvbSAnLi9Ecm9wZG93bi50eXBlcyc7XG5pbXBvcnQgeyB0b2tlbnMgfSBmcm9tICcuL0Ryb3Bkb3duLnRva2Vucyc7XG5cbmNvbnN0IFBvcG92ZXIgPSBjb21wb25lbnQocG9wb3ZlckNvbmZpZyk7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRQb3BvdmVyID0gc3R5bGVkKFBvcG92ZXIpYFxuICAgIC4ke1N0cmluZyhwb3BvdmVyQ2xhc3Nlcy53cmFwcGVyKX0sIC4ke1N0cmluZyhwb3BvdmVyQ2xhc3Nlcy50YXJnZXQpfSB7XG4gICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgIH1cbmA7XG5cbmV4cG9ydCBjb25zdCBVbCA9IHN0eWxlZC51bDx7XG4gICAgbGlzdEhlaWdodDogRHJvcGRvd25Qcm9wc1snbGlzdEhlaWdodCddO1xuICAgIGxpc3RPdmVyZmxvdzogRHJvcGRvd25Qcm9wc1snbGlzdE92ZXJmbG93J107XG4gICAgaXNJbm5lclVsPzogYm9vbGVhbjtcbiAgICBsaXN0V2lkdGg/OiBEcm9wZG93blByb3BzWydsaXN0V2lkdGgnXTtcbn0+YFxuICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cbiAgICBiYWNrZ3JvdW5kOiB2YXIoJHt0b2tlbnMuYmFja2dyb3VuZH0pO1xuICAgIGJveC1zaGFkb3c6IHZhcigke3Rva2Vucy5ib3hTaGFkb3d9KTtcblxuICAgIGJvcmRlci1yYWRpdXM6IHZhcigke3Rva2Vucy5ib3JkZXJSYWRpdXN9KTtcbiAgICB3aWR0aDogJHsoeyBsaXN0V2lkdGggfSkgPT4gbGlzdFdpZHRoIHx8IGB2YXIoJHt0b2tlbnMud2lkdGh9KWB9O1xuICAgIGhlaWdodDogJHsoeyBsaXN0SGVpZ2h0IH0pID0+IChsaXN0SGVpZ2h0ID8gZ2V0Q29ycmVjdEhlaWdodChsaXN0SGVpZ2h0KSA6ICdhdXRvJyl9O1xuICAgIG92ZXJmbG93OiAkeyh7IGxpc3RPdmVyZmxvdyB9KSA9PiBsaXN0T3ZlcmZsb3cgfHwgJ2luaXRpYWwnfTtcblxuICAgIG1hcmdpbjogJHsoeyBpc0lubmVyVWwgfSkgPT4gKGlzSW5uZXJVbCA/IGBjYWxjKHZhcigke3Rva2Vucy5wYWRkaW5nfSkgKiAtMSkgMCAwIHZhcigke3Rva2Vucy5wYWRkaW5nfSlgIDogMCl9O1xuICAgIHBhZGRpbmc6IHZhcigke3Rva2Vucy5wYWRkaW5nfSk7XG5gO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG5gO1xuIl19 */"));
|
12
20
|
var Ul = exports.Ul = /*#__PURE__*/(0, _base["default"])("ul", {
|
13
21
|
target: "euqmbvx0",
|
14
22
|
label: "plasma-new-hope__Ul"
|
15
|
-
})("box-sizing:border-box;width:", function (_ref) {
|
23
|
+
})("box-sizing:border-box;background:var(", _Dropdown.tokens.background, ");box-shadow:var(", _Dropdown.tokens.boxShadow, ");border-radius:var(", _Dropdown.tokens.borderRadius, ");width:", function (_ref) {
|
16
24
|
var listWidth = _ref.listWidth;
|
17
25
|
return listWidth || "var(".concat(_Dropdown.tokens.width, ")");
|
18
26
|
}, ";height:", function (_ref2) {
|
19
27
|
var listHeight = _ref2.listHeight;
|
20
28
|
return listHeight ? (0, _utils.getCorrectHeight)(listHeight) : 'auto';
|
21
|
-
}, ";
|
22
|
-
var
|
23
|
-
return isInnerUl ? "calc(var(".concat(_Dropdown.tokens.padding, ") * -1) 0.125rem 0") : 0;
|
24
|
-
}, ";padding:var(", _Dropdown.tokens.padding, ") 0;overflow:", function (_ref4) {
|
25
|
-
var listOverflow = _ref4.listOverflow;
|
29
|
+
}, ";overflow:", function (_ref3) {
|
30
|
+
var listOverflow = _ref3.listOverflow;
|
26
31
|
return listOverflow || 'initial';
|
27
|
-
}, ";
|
28
|
-
var
|
32
|
+
}, ";margin:", function (_ref4) {
|
33
|
+
var isInnerUl = _ref4.isInnerUl;
|
34
|
+
return isInnerUl ? "calc(var(".concat(_Dropdown.tokens.padding, ") * -1) 0 0 var(").concat(_Dropdown.tokens.padding, ")") : 0;
|
35
|
+
}, ";padding:var(", _Dropdown.tokens.padding, ");" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJvcGRvd24uc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCRSIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL0Ryb3Bkb3duL0Ryb3Bkb3duLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgY29tcG9uZW50IH0gZnJvbSAnLi4vLi4vZW5naW5lcyc7XG5pbXBvcnQgeyBwb3BvdmVyQ29uZmlnLCBwb3BvdmVyQ2xhc3NlcyB9IGZyb20gJy4uL1BvcG92ZXInO1xuXG5pbXBvcnQgeyBnZXRDb3JyZWN0SGVpZ2h0IH0gZnJvbSAnLi91dGlscyc7XG5pbXBvcnQgeyBEcm9wZG93blByb3BzIH0gZnJvbSAnLi9Ecm9wZG93bi50eXBlcyc7XG5pbXBvcnQgeyB0b2tlbnMgfSBmcm9tICcuL0Ryb3Bkb3duLnRva2Vucyc7XG5cbmNvbnN0IFBvcG92ZXIgPSBjb21wb25lbnQocG9wb3ZlckNvbmZpZyk7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRQb3BvdmVyID0gc3R5bGVkKFBvcG92ZXIpYFxuICAgIC4ke1N0cmluZyhwb3BvdmVyQ2xhc3Nlcy53cmFwcGVyKX0sIC4ke1N0cmluZyhwb3BvdmVyQ2xhc3Nlcy50YXJnZXQpfSB7XG4gICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgIH1cbmA7XG5cbmV4cG9ydCBjb25zdCBVbCA9IHN0eWxlZC51bDx7XG4gICAgbGlzdEhlaWdodDogRHJvcGRvd25Qcm9wc1snbGlzdEhlaWdodCddO1xuICAgIGxpc3RPdmVyZmxvdzogRHJvcGRvd25Qcm9wc1snbGlzdE92ZXJmbG93J107XG4gICAgaXNJbm5lclVsPzogYm9vbGVhbjtcbiAgICBsaXN0V2lkdGg/OiBEcm9wZG93blByb3BzWydsaXN0V2lkdGgnXTtcbn0+YFxuICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cbiAgICBiYWNrZ3JvdW5kOiB2YXIoJHt0b2tlbnMuYmFja2dyb3VuZH0pO1xuICAgIGJveC1zaGFkb3c6IHZhcigke3Rva2Vucy5ib3hTaGFkb3d9KTtcblxuICAgIGJvcmRlci1yYWRpdXM6IHZhcigke3Rva2Vucy5ib3JkZXJSYWRpdXN9KTtcbiAgICB3aWR0aDogJHsoeyBsaXN0V2lkdGggfSkgPT4gbGlzdFdpZHRoIHx8IGB2YXIoJHt0b2tlbnMud2lkdGh9KWB9O1xuICAgIGhlaWdodDogJHsoeyBsaXN0SGVpZ2h0IH0pID0+IChsaXN0SGVpZ2h0ID8gZ2V0Q29ycmVjdEhlaWdodChsaXN0SGVpZ2h0KSA6ICdhdXRvJyl9O1xuICAgIG92ZXJmbG93OiAkeyh7IGxpc3RPdmVyZmxvdyB9KSA9PiBsaXN0T3ZlcmZsb3cgfHwgJ2luaXRpYWwnfTtcblxuICAgIG1hcmdpbjogJHsoeyBpc0lubmVyVWwgfSkgPT4gKGlzSW5uZXJVbCA/IGBjYWxjKHZhcigke3Rva2Vucy5wYWRkaW5nfSkgKiAtMSkgMCAwIHZhcigke3Rva2Vucy5wYWRkaW5nfSlgIDogMCl9O1xuICAgIHBhZGRpbmc6IHZhcigke3Rva2Vucy5wYWRkaW5nfSk7XG5gO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG5gO1xuIl19 */"));
|
36
|
+
var base = exports.base = process.env.NODE_ENV === "production" ? {
|
37
|
+
name: "1mufh2u-plasma-new-hope__base",
|
38
|
+
styles: "display:inline-block;label:plasma-new-hope__base;"
|
39
|
+
} : {
|
40
|
+
name: "1mufh2u-plasma-new-hope__base",
|
41
|
+
styles: "display:inline-block;label:plasma-new-hope__base;",
|
42
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJvcGRvd24uc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNDdUIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ecm9wZG93bi9Ecm9wZG93bi5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7IGNvbXBvbmVudCB9IGZyb20gJy4uLy4uL2VuZ2luZXMnO1xuaW1wb3J0IHsgcG9wb3ZlckNvbmZpZywgcG9wb3ZlckNsYXNzZXMgfSBmcm9tICcuLi9Qb3BvdmVyJztcblxuaW1wb3J0IHsgZ2V0Q29ycmVjdEhlaWdodCB9IGZyb20gJy4vdXRpbHMnO1xuaW1wb3J0IHsgRHJvcGRvd25Qcm9wcyB9IGZyb20gJy4vRHJvcGRvd24udHlwZXMnO1xuaW1wb3J0IHsgdG9rZW5zIH0gZnJvbSAnLi9Ecm9wZG93bi50b2tlbnMnO1xuXG5jb25zdCBQb3BvdmVyID0gY29tcG9uZW50KHBvcG92ZXJDb25maWcpO1xuXG5leHBvcnQgY29uc3QgU3R5bGVkUG9wb3ZlciA9IHN0eWxlZChQb3BvdmVyKWBcbiAgICAuJHtTdHJpbmcocG9wb3ZlckNsYXNzZXMud3JhcHBlcil9LCAuJHtTdHJpbmcocG9wb3ZlckNsYXNzZXMudGFyZ2V0KX0ge1xuICAgICAgICBkaXNwbGF5OiBibG9jaztcbiAgICB9XG5gO1xuXG5leHBvcnQgY29uc3QgVWwgPSBzdHlsZWQudWw8e1xuICAgIGxpc3RIZWlnaHQ6IERyb3Bkb3duUHJvcHNbJ2xpc3RIZWlnaHQnXTtcbiAgICBsaXN0T3ZlcmZsb3c6IERyb3Bkb3duUHJvcHNbJ2xpc3RPdmVyZmxvdyddO1xuICAgIGlzSW5uZXJVbD86IGJvb2xlYW47XG4gICAgbGlzdFdpZHRoPzogRHJvcGRvd25Qcm9wc1snbGlzdFdpZHRoJ107XG59PmBcbiAgICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xuXG4gICAgYmFja2dyb3VuZDogdmFyKCR7dG9rZW5zLmJhY2tncm91bmR9KTtcbiAgICBib3gtc2hhZG93OiB2YXIoJHt0b2tlbnMuYm94U2hhZG93fSk7XG5cbiAgICBib3JkZXItcmFkaXVzOiB2YXIoJHt0b2tlbnMuYm9yZGVyUmFkaXVzfSk7XG4gICAgd2lkdGg6ICR7KHsgbGlzdFdpZHRoIH0pID0+IGxpc3RXaWR0aCB8fCBgdmFyKCR7dG9rZW5zLndpZHRofSlgfTtcbiAgICBoZWlnaHQ6ICR7KHsgbGlzdEhlaWdodCB9KSA9PiAobGlzdEhlaWdodCA/IGdldENvcnJlY3RIZWlnaHQobGlzdEhlaWdodCkgOiAnYXV0bycpfTtcbiAgICBvdmVyZmxvdzogJHsoeyBsaXN0T3ZlcmZsb3cgfSkgPT4gbGlzdE92ZXJmbG93IHx8ICdpbml0aWFsJ307XG5cbiAgICBtYXJnaW46ICR7KHsgaXNJbm5lclVsIH0pID0+IChpc0lubmVyVWwgPyBgY2FsYyh2YXIoJHt0b2tlbnMucGFkZGluZ30pICogLTEpIDAgMCB2YXIoJHt0b2tlbnMucGFkZGluZ30pYCA6IDApfTtcbiAgICBwYWRkaW5nOiB2YXIoJHt0b2tlbnMucGFkZGluZ30pO1xuYDtcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgXG4gICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuYDtcbiJdfQ== */",
|
43
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
44
|
+
};
|
@@ -3,13 +3,13 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.tokens = exports.
|
6
|
+
exports.tokens = exports.classes = void 0;
|
7
7
|
var classes = exports.classes = {
|
8
8
|
dropdownRoot: 'dropdown-root',
|
9
9
|
dropdownItemIsFocused: 'dropdown-item-is-focused',
|
10
10
|
dropdownItemIsDisabled: 'dropdown-item-is-disabled',
|
11
11
|
dropdownItemIsActive: 'dropdown-item-is-active',
|
12
|
-
dropdownItemIsSelected: '
|
12
|
+
dropdownItemIsSelected: 'dropdownItemIsSelected'
|
13
13
|
};
|
14
14
|
var tokens = exports.tokens = {
|
15
15
|
background: '--plasma-dropdown-background',
|
@@ -20,8 +20,6 @@ var tokens = exports.tokens = {
|
|
20
20
|
disclosureIconColor: '--plasma-dropdown-disclosure-icon-color',
|
21
21
|
disabledOpacity: '--plasma-dropdown-disabled-opacity',
|
22
22
|
focusColor: '--plasma-dropdown-focus-color',
|
23
|
-
// Old
|
24
|
-
|
25
23
|
dividerColor: '--plasma-dropdown-divider-color',
|
26
24
|
dividerMarginTop: '--plasma-dropdown-divider-margin-top',
|
27
25
|
dividerMarginTopTight: '--plasma-dropdown-divider-margin-top-tight',
|
@@ -36,7 +34,6 @@ var tokens = exports.tokens = {
|
|
36
34
|
itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',
|
37
35
|
// Old
|
38
36
|
itemColor: '--plasma-dropdown-item-color',
|
39
|
-
// Old
|
40
37
|
itemColorSelected: '--plasma-dropdown-item-color-selected',
|
41
38
|
// Old
|
42
39
|
itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',
|
@@ -55,17 +52,11 @@ var tokens = exports.tokens = {
|
|
55
52
|
itemMarginLeft: '--plasma-dropdown-item-margin-left',
|
56
53
|
// Old
|
57
54
|
itemPaddingTop: '--plasma-dropdown-item-padding-top',
|
58
|
-
// Old
|
59
55
|
itemPaddingTopTight: '--plasma-dropdown-item-padding-top-tight',
|
60
|
-
// Old
|
61
56
|
itemPaddingRight: '--plasma-dropdown-item-padding-right',
|
62
|
-
// Old
|
63
57
|
itemPaddingBottom: '--plasma-dropdown-item-padding-bottom',
|
64
|
-
// Old
|
65
58
|
itemPaddingBottomTight: '--plasma-dropdown-item-padding-bottom-tight',
|
66
|
-
// Old
|
67
59
|
itemPaddingLeft: '--plasma-dropdown-item-padding-left',
|
68
|
-
// Old
|
69
60
|
itemContentLeftWidth: '--plasma-dropdown-item-content-left-width',
|
70
61
|
// Old
|
71
62
|
itemContentLeftColor: '--plasma-dropdown-item-content-left-color',
|
@@ -80,20 +71,6 @@ var tokens = exports.tokens = {
|
|
80
71
|
itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',
|
81
72
|
itemFontLetterSpacing: '--plasma-dropdown-item-line-height',
|
82
73
|
itemFontLineHeight: '--plasma-dropdown-item-font-weight',
|
83
|
-
itemPadding: '--plasma-dropdown-item-padding',
|
84
|
-
itemPaddingTight: '--plasma-dropdown-item-padding-tight',
|
85
|
-
cellPadding: '--plasma-dropdown-cell-padding',
|
86
|
-
cellPaddingLeftContent: '--plasma-dropdown-cell-padding-left-content',
|
87
|
-
cellPaddingContent: '--plasma-dropdown-cell-padding-content',
|
88
|
-
cellPaddingRightContent: '--plasma-dropdown-cell-padding-right-content',
|
89
|
-
cellTextboxGap: '--plasma-dropdown-cell-textbox-gap',
|
90
|
-
cellGap: '--plasma-dropdown-cell-gap',
|
91
|
-
cellTitleFontFamily: '--plasma-dropdown-cell-title-font-family',
|
92
|
-
cellTitleFontSize: '--plasma-dropdown-cell-title-font-size',
|
93
|
-
cellTitleFontStyle: '--plasma-dropdown-cell-title-font-style',
|
94
|
-
cellTitleFontWeight: '--plasma-dropdown-cell-title-font-weight',
|
95
|
-
cellTitleLetterSpacing: '--plasma-dropdown-cell-title-letter-spacing',
|
96
|
-
cellTitleLineHeight: '--plasma-dropdown-cell-title-line-height',
|
97
74
|
// TODO: Remove below tokens as soon as they are no longer needed
|
98
75
|
footerBackground: '--plasma-dropdown-footer-background',
|
99
76
|
footerWidth: '--plasma-dropdown-footer-width',
|
@@ -157,15 +134,4 @@ var tokens = exports.tokens = {
|
|
157
134
|
groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',
|
158
135
|
groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',
|
159
136
|
groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left'
|
160
|
-
};
|
161
|
-
var constants = exports.constants = {
|
162
|
-
focusColor: '--surface-accent',
|
163
|
-
background: '--surface-solid-card-brightness',
|
164
|
-
boxShadow: '0px 4px 14px -4px rgba(8, 8, 8, 0.08), 0px 1px 4px -1px rgba(0, 0, 0, 0.04)',
|
165
|
-
disclosureIconColor: '--text-secondary',
|
166
|
-
itemBackground: '--plasma-colors-transparent',
|
167
|
-
itemBackgroundHover: '--surface-transparent-secondary',
|
168
|
-
opacity: '0.4',
|
169
|
-
cellTitleColor: '--text-primary',
|
170
|
-
cellBackgroundColor: '--plasma-colors-transparent'
|
171
137
|
};
|
@@ -5,21 +5,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.DropdownInner = void 0;
|
7
7
|
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
|
-
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
9
8
|
var _ = /*#__PURE__*/require("..");
|
10
9
|
var _Dropdown = /*#__PURE__*/require("../../Dropdown.styles");
|
11
|
-
var _FloatingPopover = /*#__PURE__*/require("../../FloatingPopover");
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
11
|
var DropdownInner = exports.DropdownInner = function DropdownInner(_ref) {
|
14
12
|
var item = _ref.item,
|
15
13
|
currentLevel = _ref.currentLevel,
|
14
|
+
focusedPath = _ref.focusedPath,
|
16
15
|
path = _ref.path,
|
17
16
|
dispatchPath = _ref.dispatchPath,
|
18
17
|
index = _ref.index,
|
19
18
|
trigger = _ref.trigger,
|
19
|
+
itemRole = _ref.itemRole,
|
20
20
|
listHeight = _ref.listHeight,
|
21
21
|
listOverflow = _ref.listOverflow,
|
22
|
-
|
22
|
+
handleGlobalToggle = _ref.handleGlobalToggle,
|
23
|
+
closeOnSelect = _ref.closeOnSelect,
|
24
|
+
onHover = _ref.onHover,
|
25
|
+
onItemSelect = _ref.onItemSelect,
|
26
|
+
onItemClick = _ref.onItemClick,
|
27
|
+
listWidth = _ref.listWidth,
|
28
|
+
variant = _ref.variant,
|
29
|
+
hasArrow = _ref.hasArrow,
|
30
|
+
size = _ref.size;
|
23
31
|
var handleToggle = function handleToggle(opened) {
|
24
32
|
if (opened) {
|
25
33
|
dispatchPath({
|
@@ -35,53 +43,79 @@ var DropdownInner = exports.DropdownInner = function DropdownInner(_ref) {
|
|
35
43
|
}
|
36
44
|
};
|
37
45
|
var isCurrentListOpen = path[currentLevel + 1] === item.value.toString();
|
38
|
-
var
|
39
|
-
var listId = "".concat(treeId, "_tree_level_").concat(currentLevel + 2);
|
46
|
+
var listId = "tree_level_".concat(currentLevel + 2);
|
40
47
|
var nextLevel = currentLevel + 1;
|
41
48
|
if (item !== null && item !== void 0 && item.items) {
|
42
|
-
return /*#__PURE__*/_react["default"].createElement(
|
43
|
-
placement: "right-start",
|
49
|
+
return /*#__PURE__*/_react["default"].createElement(_Dropdown.StyledPopover, {
|
44
50
|
opened: isCurrentListOpen,
|
45
|
-
|
51
|
+
usePortal: false,
|
52
|
+
placement: "right-start",
|
46
53
|
trigger: trigger,
|
47
54
|
target: /*#__PURE__*/_react["default"].createElement(_.DropdownItem, {
|
48
55
|
item: item,
|
49
56
|
index: index,
|
50
57
|
path: path,
|
58
|
+
focusedPath: focusedPath,
|
51
59
|
currentLevel: currentLevel,
|
60
|
+
itemRole: itemRole,
|
61
|
+
onHover: onHover,
|
62
|
+
onItemSelect: onItemSelect,
|
63
|
+
onItemClick: onItemClick,
|
64
|
+
variant: variant,
|
65
|
+
hasArrow: hasArrow,
|
52
66
|
ariaControls: listId,
|
53
67
|
ariaExpanded: isCurrentListOpen,
|
54
68
|
ariaLevel: nextLevel,
|
55
|
-
ariaLabel: item.label
|
69
|
+
ariaLabel: item.label,
|
70
|
+
size: size
|
56
71
|
}),
|
57
|
-
|
72
|
+
onToggle: handleToggle,
|
73
|
+
isFocusTrapped: false,
|
74
|
+
preventOverflow: false
|
58
75
|
}, /*#__PURE__*/_react["default"].createElement(_Dropdown.Ul, {
|
59
|
-
id: listId,
|
60
|
-
role: "group",
|
61
|
-
isInnerUl: true,
|
62
76
|
listHeight: listHeight,
|
63
77
|
listOverflow: listOverflow,
|
64
|
-
|
78
|
+
role: "group",
|
79
|
+
id: listId,
|
80
|
+
listWidth: listWidth,
|
81
|
+
isInnerUl: true
|
65
82
|
}, item.items.map(function (innerItem, innerIndex) {
|
66
83
|
return /*#__PURE__*/_react["default"].createElement(DropdownInner, {
|
67
84
|
key: "".concat(innerIndex, "/").concat(currentLevel),
|
68
85
|
item: innerItem,
|
69
86
|
currentLevel: nextLevel,
|
87
|
+
focusedPath: focusedPath,
|
70
88
|
path: path,
|
71
89
|
dispatchPath: dispatchPath,
|
72
90
|
index: innerIndex,
|
73
91
|
trigger: trigger,
|
92
|
+
itemRole: itemRole,
|
74
93
|
listHeight: listHeight,
|
75
94
|
listOverflow: listOverflow,
|
76
|
-
|
95
|
+
handleGlobalToggle: handleGlobalToggle,
|
96
|
+
closeOnSelect: closeOnSelect,
|
97
|
+
onHover: onHover,
|
98
|
+
onItemSelect: onItemSelect,
|
99
|
+
onItemClick: onItemClick,
|
100
|
+
listWidth: listWidth,
|
101
|
+
variant: variant,
|
102
|
+
hasArrow: hasArrow,
|
103
|
+
size: size
|
77
104
|
});
|
78
105
|
})));
|
79
106
|
}
|
80
107
|
return /*#__PURE__*/_react["default"].createElement(_.DropdownItem, {
|
81
108
|
item: item,
|
82
|
-
path: path,
|
83
109
|
index: index,
|
110
|
+
focusedPath: focusedPath,
|
84
111
|
currentLevel: currentLevel,
|
85
|
-
|
112
|
+
itemRole: itemRole,
|
113
|
+
handleGlobalToggle: handleGlobalToggle,
|
114
|
+
closeOnSelect: closeOnSelect,
|
115
|
+
onHover: onHover,
|
116
|
+
onItemSelect: onItemSelect,
|
117
|
+
onItemClick: onItemClick,
|
118
|
+
variant: variant,
|
119
|
+
size: size
|
86
120
|
});
|
87
121
|
};
|
@@ -9,20 +9,29 @@ var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react")
|
|
9
9
|
var _Dropdown = /*#__PURE__*/require("../../Dropdown.tokens");
|
10
10
|
var _utils = /*#__PURE__*/require("../../../../utils");
|
11
11
|
var _Icon = /*#__PURE__*/require("../../../_Icon");
|
12
|
-
var _Dropdown2 = /*#__PURE__*/require("../../Dropdown");
|
13
|
-
var _utils2 = /*#__PURE__*/require("../../utils");
|
14
12
|
var _DropdownItem = /*#__PURE__*/require("./DropdownItem.styles");
|
15
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
16
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
17
15
|
var DropdownItem = exports.DropdownItem = function DropdownItem(_ref) {
|
18
16
|
var item = _ref.item,
|
19
17
|
path = _ref.path,
|
18
|
+
focusedPath = _ref.focusedPath,
|
20
19
|
currentLevel = _ref.currentLevel,
|
21
20
|
index = _ref.index,
|
21
|
+
itemRole = _ref.itemRole,
|
22
|
+
closeOnSelect = _ref.closeOnSelect,
|
23
|
+
handleGlobalToggle = _ref.handleGlobalToggle,
|
24
|
+
onHover = _ref.onHover,
|
25
|
+
onItemSelect = _ref.onItemSelect,
|
26
|
+
onItemClick = _ref.onItemClick,
|
22
27
|
ariaControls = _ref.ariaControls,
|
23
28
|
ariaExpanded = _ref.ariaExpanded,
|
29
|
+
ariaHasPopup = _ref.ariaHasPopup,
|
24
30
|
ariaLevel = _ref.ariaLevel,
|
25
|
-
ariaLabel = _ref.ariaLabel
|
31
|
+
ariaLabel = _ref.ariaLabel,
|
32
|
+
variant = _ref.variant,
|
33
|
+
hasArrow = _ref.hasArrow,
|
34
|
+
size = _ref.size;
|
26
35
|
var value = item.value,
|
27
36
|
label = item.label,
|
28
37
|
disabled = item.disabled,
|
@@ -32,19 +41,6 @@ var DropdownItem = exports.DropdownItem = function DropdownItem(_ref) {
|
|
32
41
|
dividerBefore = item.dividerBefore,
|
33
42
|
dividerAfter = item.dividerAfter;
|
34
43
|
var ref = (0, _react.useRef)(null);
|
35
|
-
var _useContext = (0, _react.useContext)(_Dropdown2.Context),
|
36
|
-
focusedPath = _useContext.focusedPath,
|
37
|
-
size = _useContext.size,
|
38
|
-
variant = _useContext.variant,
|
39
|
-
itemRole = _useContext.itemRole,
|
40
|
-
handleGlobalToggle = _useContext.handleGlobalToggle,
|
41
|
-
closeOnSelect = _useContext.closeOnSelect,
|
42
|
-
onHover = _useContext.onHover,
|
43
|
-
onItemSelect = _useContext.onItemSelect,
|
44
|
-
onItemClick = _useContext.onItemClick,
|
45
|
-
hasArrow = _useContext.hasArrow,
|
46
|
-
treeId = _useContext.treeId;
|
47
|
-
var hasDescendants = Boolean(item.items);
|
48
44
|
var disclosureIconSize = size === 'xs' ? 'xs' : 's';
|
49
45
|
var isDisabledClassName = disabled || isDisabled ? _Dropdown.classes.dropdownItemIsDisabled : undefined;
|
50
46
|
var focusedClass = currentLevel === focusedPath.length - 1 && index === (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[currentLevel]) ? _Dropdown.classes.dropdownItemIsFocused : undefined;
|
@@ -68,9 +64,7 @@ var DropdownItem = exports.DropdownItem = function DropdownItem(_ref) {
|
|
68
64
|
if (onItemClick) {
|
69
65
|
onItemClick(item, event);
|
70
66
|
}
|
71
|
-
|
72
|
-
// Закрываем весь дропдаун целиком при клике на айтем без потомков. Только при closeOnSelect === true.
|
73
|
-
if (closeOnSelect && !hasDescendants) {
|
67
|
+
if (handleGlobalToggle && closeOnSelect) {
|
74
68
|
handleGlobalToggle(false, event);
|
75
69
|
}
|
76
70
|
};
|
@@ -82,25 +76,20 @@ var DropdownItem = exports.DropdownItem = function DropdownItem(_ref) {
|
|
82
76
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, dividerBefore && /*#__PURE__*/_react["default"].createElement(_DropdownItem.Divider, {
|
83
77
|
variant: variant
|
84
78
|
}), /*#__PURE__*/_react["default"].createElement(_DropdownItem.Wrapper, {
|
85
|
-
ref: ref,
|
86
79
|
className: (0, _utils.cx)(isDisabledClassName, focusedClass, activeClass),
|
87
|
-
id:
|
80
|
+
id: value.toString(),
|
88
81
|
role: itemRole,
|
82
|
+
ref: ref,
|
83
|
+
"aria-disabled": disabled || isDisabled,
|
89
84
|
onClick: handleClick,
|
90
85
|
onMouseEnter: handleHover,
|
91
86
|
variant: variant,
|
92
|
-
"aria-disabled": disabled || isDisabled,
|
93
87
|
"aria-controls": ariaControls,
|
94
88
|
"aria-expanded": ariaExpanded,
|
89
|
+
"aria-haspopup": ariaHasPopup,
|
95
90
|
"aria-level": ariaLevel,
|
96
91
|
"aria-label": ariaLabel
|
97
|
-
}, /*#__PURE__*/_react["default"].createElement(_DropdownItem.
|
98
|
-
contentLeft: contentLeft,
|
99
|
-
contentRight: contentRight,
|
100
|
-
alignContentLeft: "center",
|
101
|
-
alignContentRight: "center",
|
102
|
-
title: label
|
103
|
-
})), item.items && hasArrow && /*#__PURE__*/_react["default"].createElement(_DropdownItem.DisclosureIconWrapper, null, /*#__PURE__*/_react["default"].createElement(_Icon.IconDisclosureRight, {
|
92
|
+
}, contentLeft && /*#__PURE__*/_react["default"].createElement(_DropdownItem.StyledContentLeft, null, contentLeft), /*#__PURE__*/_react["default"].createElement(_DropdownItem.StyledText, null, label), contentRight && /*#__PURE__*/_react["default"].createElement(_DropdownItem.StyledContentRight, null, contentRight), item.items && hasArrow && /*#__PURE__*/_react["default"].createElement(_DropdownItem.DisclosureIconWrapper, null, /*#__PURE__*/_react["default"].createElement(_Icon.IconDisclosureRight, {
|
104
93
|
size: disclosureIconSize,
|
105
94
|
color: "inherit"
|
106
95
|
}))), dividerAfter && /*#__PURE__*/_react["default"].createElement(_DropdownItem.Divider, {
|