@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
@@ -1,102 +0,0 @@
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
7
|
-
import { flip, shift, useFloating, FloatingPortal, offset as offsetMiddleware, autoPlacement } from '@floating-ui/react';
|
8
|
-
import React, { forwardRef } from 'react';
|
9
|
-
import { safeUseId } from '@salutejs/plasma-core';
|
10
|
-
var FloatingPopover = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
11
|
-
var target = _ref.target,
|
12
|
-
children = _ref.children,
|
13
|
-
opened = _ref.opened,
|
14
|
-
onToggle = _ref.onToggle,
|
15
|
-
placement = _ref.placement,
|
16
|
-
portal = _ref.portal,
|
17
|
-
_ref$offset = _ref.offset,
|
18
|
-
offset = _ref$offset === void 0 ? [0, 0] : _ref$offset,
|
19
|
-
isInner = _ref.isInner,
|
20
|
-
trigger = _ref.trigger;
|
21
|
-
var _useFloating = useFloating({
|
22
|
-
placement: placement === 'auto' ? undefined : placement,
|
23
|
-
open: opened,
|
24
|
-
middleware: [placement === 'auto' && autoPlacement(), offsetMiddleware({
|
25
|
-
mainAxis: offset[1],
|
26
|
-
crossAxis: offset[0]
|
27
|
-
}), flip({
|
28
|
-
fallbackAxisSideDirection: 'end'
|
29
|
-
}), shift()]
|
30
|
-
}),
|
31
|
-
refs = _useFloating.refs,
|
32
|
-
floatingStyles = _useFloating.floatingStyles;
|
33
|
-
var wrappedId = safeUseId();
|
34
|
-
var handleTargetClick = function handleTargetClick(event) {
|
35
|
-
if (trigger === 'hover') {
|
36
|
-
return;
|
37
|
-
}
|
38
|
-
if (onToggle) {
|
39
|
-
onToggle(!opened, event);
|
40
|
-
}
|
41
|
-
};
|
42
|
-
var handleTargetMouseEnter = function handleTargetMouseEnter(event) {
|
43
|
-
if (trigger === 'click' || opened) {
|
44
|
-
return;
|
45
|
-
}
|
46
|
-
onToggle(true, event);
|
47
|
-
};
|
48
|
-
var handleTargetMouseLeave = function handleTargetMouseLeave(event) {
|
49
|
-
if (event.relatedTarget instanceof HTMLElement && refs.floating.current instanceof HTMLElement) {
|
50
|
-
var _refs$floating$curren;
|
51
|
-
if (trigger === 'click' || !opened || event.relatedTarget && refs.floating && (_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 && _refs$floating$curren.contains(event.relatedTarget)) {
|
52
|
-
return;
|
53
|
-
}
|
54
|
-
onToggle(false, event);
|
55
|
-
}
|
56
|
-
};
|
57
|
-
var handleFloatingMouseLeave = function handleFloatingMouseLeave(event) {
|
58
|
-
if (event.relatedTarget instanceof HTMLElement && refs.reference.current instanceof HTMLElement) {
|
59
|
-
var _refs$reference$curre;
|
60
|
-
if (trigger === 'click' || !opened || event.relatedTarget && refs.reference && (_refs$reference$curre = refs.reference.current) !== null && _refs$reference$curre !== void 0 && _refs$reference$curre.contains(event.relatedTarget)) {
|
61
|
-
return;
|
62
|
-
}
|
63
|
-
onToggle(false, event);
|
64
|
-
}
|
65
|
-
};
|
66
|
-
return /*#__PURE__*/React.createElement("div", {
|
67
|
-
id: wrappedId,
|
68
|
-
style: {
|
69
|
-
display: isInner ? 'block' : 'inline-block'
|
70
|
-
},
|
71
|
-
ref: ref
|
72
|
-
}, /*#__PURE__*/React.createElement("div", {
|
73
|
-
ref: refs.setReference,
|
74
|
-
onClick: handleTargetClick,
|
75
|
-
onMouseEnter: handleTargetMouseEnter,
|
76
|
-
onMouseLeave: handleTargetMouseLeave
|
77
|
-
}, target), opened && /*#__PURE__*/React.createElement(FloatingPortal, getFloatingPortalProps(portal, wrappedId), /*#__PURE__*/React.createElement("div", {
|
78
|
-
ref: refs.setFloating,
|
79
|
-
onMouseLeave: handleFloatingMouseLeave,
|
80
|
-
style: _objectSpread(_objectSpread({}, floatingStyles), {}, {
|
81
|
-
zIndex: 1
|
82
|
-
})
|
83
|
-
}, children)));
|
84
|
-
});
|
85
|
-
// root - принимает ref контейнера портала.
|
86
|
-
// id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.
|
87
|
-
var getFloatingPortalProps = function getFloatingPortalProps(portal, wrappedId) {
|
88
|
-
if (!portal) {
|
89
|
-
return {
|
90
|
-
id: wrappedId
|
91
|
-
};
|
92
|
-
}
|
93
|
-
if (typeof portal === 'string') {
|
94
|
-
return {
|
95
|
-
id: portal
|
96
|
-
};
|
97
|
-
}
|
98
|
-
return {
|
99
|
-
root: portal
|
100
|
-
};
|
101
|
-
};
|
102
|
-
export { FloatingPopover };
|
@@ -1,6 +0,0 @@
|
|
1
|
-
export var getItemByFocused = function getItemByFocused(focusedPath, focusedToValueMap) {
|
2
|
-
var focusedPathAsString = focusedPath.reduce(function (acc, n) {
|
3
|
-
return "".concat(acc, "/").concat(n);
|
4
|
-
}, '').replace(/^(\/)/, '');
|
5
|
-
return focusedToValueMap.get(focusedPathAsString);
|
6
|
-
};
|
@@ -1,2 +0,0 @@
|
|
1
|
-
.un7uamp{box-sizing:border-box;width:var(--un7uamp-0);height:var(--un7uamp-1);margin:var(--un7uamp-2);padding:var(--plasma-dropdown-padding) 0;overflow:var(--un7uamp-3);background:var(--surface-solid-card-brightness);box-shadow:0px 4px 14px -4px rgba(8,8,8,0.08),0px 1px 4px -1px rgba(0,0,0,0.04);border-radius:var(--plasma-dropdown-border-radius);}
|
2
|
-
|
@@ -1,100 +0,0 @@
|
|
1
|
-
import { objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
-
import { useFloating, autoPlacement, offset, flip, shift, FloatingPortal } from '@floating-ui/react';
|
3
|
-
import React, { forwardRef } from 'react';
|
4
|
-
import { safeUseId } from '@salutejs/plasma-core';
|
5
|
-
|
6
|
-
var FloatingPopover = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
7
|
-
var target = _ref.target,
|
8
|
-
children = _ref.children,
|
9
|
-
opened = _ref.opened,
|
10
|
-
onToggle = _ref.onToggle,
|
11
|
-
placement = _ref.placement,
|
12
|
-
portal = _ref.portal,
|
13
|
-
_ref$offset = _ref.offset,
|
14
|
-
offset$1 = _ref$offset === void 0 ? [0, 0] : _ref$offset,
|
15
|
-
isInner = _ref.isInner,
|
16
|
-
trigger = _ref.trigger;
|
17
|
-
var _useFloating = useFloating({
|
18
|
-
placement: placement === 'auto' ? undefined : placement,
|
19
|
-
open: opened,
|
20
|
-
middleware: [placement === 'auto' && autoPlacement(), offset({
|
21
|
-
mainAxis: offset$1[1],
|
22
|
-
crossAxis: offset$1[0]
|
23
|
-
}), flip({
|
24
|
-
fallbackAxisSideDirection: 'end'
|
25
|
-
}), shift()]
|
26
|
-
}),
|
27
|
-
refs = _useFloating.refs,
|
28
|
-
floatingStyles = _useFloating.floatingStyles;
|
29
|
-
var wrappedId = safeUseId();
|
30
|
-
var handleTargetClick = function handleTargetClick(event) {
|
31
|
-
if (trigger === 'hover') {
|
32
|
-
return;
|
33
|
-
}
|
34
|
-
if (onToggle) {
|
35
|
-
onToggle(!opened, event);
|
36
|
-
}
|
37
|
-
};
|
38
|
-
var handleTargetMouseEnter = function handleTargetMouseEnter(event) {
|
39
|
-
if (trigger === 'click' || opened) {
|
40
|
-
return;
|
41
|
-
}
|
42
|
-
onToggle(true, event);
|
43
|
-
};
|
44
|
-
var handleTargetMouseLeave = function handleTargetMouseLeave(event) {
|
45
|
-
if (event.relatedTarget instanceof HTMLElement && refs.floating.current instanceof HTMLElement) {
|
46
|
-
var _refs$floating$curren;
|
47
|
-
if (trigger === 'click' || !opened || event.relatedTarget && refs.floating && (_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 && _refs$floating$curren.contains(event.relatedTarget)) {
|
48
|
-
return;
|
49
|
-
}
|
50
|
-
onToggle(false, event);
|
51
|
-
}
|
52
|
-
};
|
53
|
-
var handleFloatingMouseLeave = function handleFloatingMouseLeave(event) {
|
54
|
-
if (event.relatedTarget instanceof HTMLElement && refs.reference.current instanceof HTMLElement) {
|
55
|
-
var _refs$reference$curre;
|
56
|
-
if (trigger === 'click' || !opened || event.relatedTarget && refs.reference && (_refs$reference$curre = refs.reference.current) !== null && _refs$reference$curre !== void 0 && _refs$reference$curre.contains(event.relatedTarget)) {
|
57
|
-
return;
|
58
|
-
}
|
59
|
-
onToggle(false, event);
|
60
|
-
}
|
61
|
-
};
|
62
|
-
return /*#__PURE__*/React.createElement("div", {
|
63
|
-
id: wrappedId,
|
64
|
-
style: {
|
65
|
-
display: isInner ? 'block' : 'inline-block'
|
66
|
-
},
|
67
|
-
ref: ref
|
68
|
-
}, /*#__PURE__*/React.createElement("div", {
|
69
|
-
ref: refs.setReference,
|
70
|
-
onClick: handleTargetClick,
|
71
|
-
onMouseEnter: handleTargetMouseEnter,
|
72
|
-
onMouseLeave: handleTargetMouseLeave
|
73
|
-
}, target), opened && /*#__PURE__*/React.createElement(FloatingPortal, getFloatingPortalProps(portal, wrappedId), /*#__PURE__*/React.createElement("div", {
|
74
|
-
ref: refs.setFloating,
|
75
|
-
onMouseLeave: handleFloatingMouseLeave,
|
76
|
-
style: _objectSpread2(_objectSpread2({}, floatingStyles), {}, {
|
77
|
-
zIndex: 1
|
78
|
-
})
|
79
|
-
}, children)));
|
80
|
-
});
|
81
|
-
// root - принимает ref контейнера портала.
|
82
|
-
// id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.
|
83
|
-
var getFloatingPortalProps = function getFloatingPortalProps(portal, wrappedId) {
|
84
|
-
if (!portal) {
|
85
|
-
return {
|
86
|
-
id: wrappedId
|
87
|
-
};
|
88
|
-
}
|
89
|
-
if (typeof portal === 'string') {
|
90
|
-
return {
|
91
|
-
id: portal
|
92
|
-
};
|
93
|
-
}
|
94
|
-
return {
|
95
|
-
root: portal
|
96
|
-
};
|
97
|
-
};
|
98
|
-
|
99
|
-
export { FloatingPopover };
|
100
|
-
//# sourceMappingURL=FloatingPopover.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"FloatingPopover.js","sources":["../../../src/components/Dropdown/FloatingPopover.tsx"],"sourcesContent":["import {\n flip,\n shift,\n useFloating,\n FloatingPortal,\n offset as offsetMiddleware,\n autoPlacement,\n} from '@floating-ui/react';\nimport React, { forwardRef, MouseEvent } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport { FloatingPopoverProps } from './Dropdown.types';\n\nconst FloatingPopover = forwardRef<HTMLDivElement, FloatingPopoverProps>(\n ({ target, children, opened, onToggle, placement, portal, offset = [0, 0], isInner, trigger }, ref) => {\n const { refs, floatingStyles } = useFloating({\n placement: placement === 'auto' ? undefined : placement,\n open: opened,\n middleware: [\n placement === 'auto' && autoPlacement(),\n offsetMiddleware({ mainAxis: offset[1], crossAxis: offset[0] }),\n flip({ fallbackAxisSideDirection: 'end' }),\n shift(),\n ],\n });\n const wrappedId = safeUseId();\n\n const handleTargetClick = (event: MouseEvent<HTMLDivElement>) => {\n if (trigger === 'hover') {\n return;\n }\n\n if (onToggle) {\n onToggle(!opened, event);\n }\n };\n\n const handleTargetMouseEnter = (event: MouseEvent<HTMLDivElement>) => {\n if (trigger === 'click' || opened) {\n return;\n }\n\n onToggle(true, event);\n };\n\n const handleTargetMouseLeave = (event: MouseEvent<HTMLDivElement>) => {\n if (event.relatedTarget instanceof HTMLElement && refs.floating.current instanceof HTMLElement) {\n if (\n trigger === 'click' ||\n !opened ||\n (event.relatedTarget && refs.floating && refs.floating.current?.contains(event.relatedTarget))\n ) {\n return;\n }\n\n onToggle(false, event);\n }\n };\n\n const handleFloatingMouseLeave = (event: MouseEvent) => {\n if (event.relatedTarget instanceof HTMLElement && refs.reference.current instanceof HTMLElement) {\n if (\n trigger === 'click' ||\n !opened ||\n (event.relatedTarget && refs.reference && refs.reference.current?.contains(event.relatedTarget))\n ) {\n return;\n }\n\n onToggle(false, event);\n }\n };\n\n return (\n <div\n id={wrappedId}\n style={{\n display: isInner ? 'block' : 'inline-block',\n }}\n ref={ref}\n >\n <div\n ref={refs.setReference}\n onClick={handleTargetClick}\n onMouseEnter={handleTargetMouseEnter}\n onMouseLeave={handleTargetMouseLeave}\n >\n {target}\n </div>\n\n {opened && (\n <FloatingPortal {...getFloatingPortalProps(portal, wrappedId)}>\n <div\n ref={refs.setFloating}\n onMouseLeave={handleFloatingMouseLeave}\n style={{\n ...floatingStyles,\n zIndex: 1,\n }}\n >\n {children}\n </div>\n </FloatingPortal>\n )}\n </div>\n );\n },\n);\n\ntype FloatingPortalReturnedProps = {\n root?: HTMLElement | null | React.MutableRefObject<HTMLElement | null>;\n id?: string;\n};\n\n// root - принимает ref контейнера портала.\n// id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.\nconst getFloatingPortalProps = (\n portal: FloatingPopoverProps['portal'],\n wrappedId: string,\n): FloatingPortalReturnedProps => {\n if (!portal) {\n return { id: wrappedId };\n }\n\n if (typeof portal === 'string') {\n return { id: portal };\n }\n\n return { root: portal };\n};\n\nexport { FloatingPopover };\n"],"names":["FloatingPopover","forwardRef","_ref","ref","target","children","opened","onToggle","placement","portal","_ref$offset","offset","isInner","trigger","_useFloating","useFloating","undefined","open","middleware","autoPlacement","offsetMiddleware","mainAxis","crossAxis","flip","fallbackAxisSideDirection","shift","refs","floatingStyles","wrappedId","safeUseId","handleTargetClick","event","handleTargetMouseEnter","handleTargetMouseLeave","relatedTarget","HTMLElement","floating","current","_refs$floating$curren","contains","handleFloatingMouseLeave","reference","_refs$reference$curre","React","createElement","id","style","display","setReference","onClick","onMouseEnter","onMouseLeave","FloatingPortal","getFloatingPortalProps","setFloating","_objectSpread","zIndex","root"],"mappings":"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"}
|
@@ -1,5 +0,0 @@
|
|
1
|
-
.c1gkzlls{--plasma-cell-title-color:var(--text-primary);--plasma-cell-background-color:var(--plasma-colors-transparent);--plasma-cell-padding:var(--plasma-dropdown-cell-padding);--plasma-cell-padding-left-content:var(--plasma-dropdown-cell-padding-left-content);--plasma-cell-padding-content:var(--plasma-dropdown-cell-padding-content);--plasma-cell-padding-right-content:var(--plasma-dropdown-cell-padding-right-content);--plasma-cell-textbox-gap:var(--plasma-dropdown-cell-textbox-gap);--plasma-cell-gap:var(--plasma-dropdown-cell-gap);--plasma-cell-title-font-family:var(--plasma-dropdown-cell-title-font-family);--plasma-cell-title-font-size:var(--plasma-dropdown-cell-title-font-size);--plasma-cell-title-font-style:var(--plasma-dropdown-cell-title-font-style);--plasma-cell-title-font-weight:var(--plasma-dropdown-cell-title-font-weight);--plasma-cell-title-letter-spacing:var(--plasma-dropdown-cell-title-letter-spacing);--plasma-cell-title-line-height:var(--plasma-dropdown-cell-title-line-height);width:100%;}
|
2
|
-
|
3
|
-
.d1m97l2m{line-height:0;color:var(--text-secondary);}
|
4
|
-
.doib72h{height:1px;margin-top:var(--doib72h-0);margin-right:var(--plasma-dropdown-divider-margin-right);margin-bottom:var(--doib72h-1);margin-left:var(--plasma-dropdown-divider-margin-left);background:var(--plasma-dropdown-divider-color);}
|
5
|
-
.w6l2f0g{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:var(--plasma-dropdown-item-height);margin:0;box-sizing:content-box;padding:var(--w6l2f0g-0);font-family:var(--plasma-dropdown-item-font-family);font-size:var(--plasma-dropdown-item-font-size);font-style:var(--plasma-dropdown-item-font-style);font-weight:var(--plasma-dropdown-item-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-item-line-height);-moz-letter-spacing:var(--plasma-dropdown-item-line-height);-ms-letter-spacing:var(--plasma-dropdown-item-line-height);letter-spacing:var(--plasma-dropdown-item-line-height);line-height:var(--plasma-dropdown-item-font-weight);background-color:var(--plasma-colors-transparent);border-radius:var(--plasma-dropdown-border-radius);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-right:0.125rem solid transparent;border-left:0.125rem solid transparent;background-clip:padding-box;position:relative;}.w6l2f0g:hover:not(.dropdown-item-is-disabled){cursor:pointer;background-color:var(--surface-transparent-secondary);}.w6l2f0g.dropdown-item-is-active{background-color:var(--surface-transparent-secondary);}.w6l2f0g.dropdown-item-is-disabled{opacity:0.4;cursor:not-allowed;}.w6l2f0g:focus{outline:none;}.w6l2f0g::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:var(--plasma-dropdown-item-border-radius);-webkit-transition:none;transition:none;pointer-events:none;}.w6l2f0g.dropdown-item-is-focused:before{outline:none;box-shadow:0 0 0 0.0625rem var(--surface-accent);}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
var getItemByFocused = function getItemByFocused(focusedPath, focusedToValueMap) {
|
2
|
-
var focusedPathAsString = focusedPath.reduce(function (acc, n) {
|
3
|
-
return "".concat(acc, "/").concat(n);
|
4
|
-
}, '').replace(/^(\/)/, '');
|
5
|
-
return focusedToValueMap.get(focusedPathAsString);
|
6
|
-
};
|
7
|
-
|
8
|
-
export { getItemByFocused };
|
9
|
-
//# sourceMappingURL=getItemByFocused.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getItemByFocused.js","sources":["../../../../src/components/Dropdown/utils/getItemByFocused.ts"],"sourcesContent":["import { FocusedPathState } from '../reducers/focusedPathReducer';\nimport { FocusedToValueMapType } from '../hooks/useHashMaps';\n\nexport const getItemByFocused = (focusedPath: FocusedPathState, focusedToValueMap: FocusedToValueMapType) => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n\n return focusedToValueMap.get(focusedPathAsString);\n};\n"],"names":["getItemByFocused","focusedPath","focusedToValueMap","focusedPathAsString","reduce","acc","n","concat","replace","get"],"mappings":"AAGO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,WAA6B,EAAEC,iBAAwC,EAAK;EACzG,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;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getItemId.js","sources":["../../../../src/components/Dropdown/utils/getItemId.ts"],"sourcesContent":["export const getItemId = (treeId: string, value: string): string => {\n return `${treeId}-${value}`;\n};\n"],"names":["getItemId","treeId","value","concat"],"mappings":"AAAO,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAIC,MAAc,EAAEC,KAAa,EAAa;AAChE,EAAA,OAAA,EAAA,CAAAC,MAAA,CAAUF,MAAM,EAAAE,GAAAA,CAAAA,CAAAA,MAAA,CAAID,KAAK,CAAA,CAAA;AAC7B;;;;"}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
var getPlacement = function getPlacement(placement) {
|
2
|
-
if (!placement) {
|
3
|
-
return 'bottom-start';
|
4
|
-
}
|
5
|
-
if (placement === 'auto') {
|
6
|
-
return placement;
|
7
|
-
}
|
8
|
-
return "".concat(placement, "-start");
|
9
|
-
};
|
10
|
-
|
11
|
-
export { getPlacement };
|
12
|
-
//# sourceMappingURL=getPlacement.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getPlacement.js","sources":["../../../../src/components/Dropdown/utils/getPlacement.ts"],"sourcesContent":["import type { DropdownProps, PlacementType } from '../Dropdown.types';\n\nexport const getPlacement = (placement: DropdownProps['placement']): PlacementType => {\n if (!placement) {\n return 'bottom-start';\n }\n\n if (placement === 'auto') {\n return placement;\n }\n\n return `${placement}-start` as PlacementType;\n};\n"],"names":["getPlacement","placement","concat"],"mappings":"IAEaA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,SAAqC,EAAoB;EAClF,IAAI,CAACA,SAAS,EAAE;AACZ,IAAA,OAAO,cAAc,CAAA;AACzB,GAAA;EAEA,IAAIA,SAAS,KAAK,MAAM,EAAE;AACtB,IAAA,OAAOA,SAAS,CAAA;AACpB,GAAA;EAEA,OAAAC,EAAAA,CAAAA,MAAA,CAAUD,SAAS,EAAA,QAAA,CAAA,CAAA;AACvB;;;;"}
|
@@ -1,109 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.FloatingPopover = void 0;
|
7
|
-
var _react = /*#__PURE__*/require("@floating-ui/react");
|
8
|
-
var _react2 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
10
|
-
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); }
|
11
|
-
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; }
|
12
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
13
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
14
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
15
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
17
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
18
|
-
var FloatingPopover = exports.FloatingPopover = /*#__PURE__*/(0, _react2.forwardRef)(function (_ref, ref) {
|
19
|
-
var target = _ref.target,
|
20
|
-
children = _ref.children,
|
21
|
-
opened = _ref.opened,
|
22
|
-
onToggle = _ref.onToggle,
|
23
|
-
placement = _ref.placement,
|
24
|
-
portal = _ref.portal,
|
25
|
-
_ref$offset = _ref.offset,
|
26
|
-
offset = _ref$offset === void 0 ? [0, 0] : _ref$offset,
|
27
|
-
isInner = _ref.isInner,
|
28
|
-
trigger = _ref.trigger;
|
29
|
-
var _useFloating = (0, _react.useFloating)({
|
30
|
-
placement: placement === 'auto' ? undefined : placement,
|
31
|
-
open: opened,
|
32
|
-
middleware: [placement === 'auto' && (0, _react.autoPlacement)(), (0, _react.offset)({
|
33
|
-
mainAxis: offset[1],
|
34
|
-
crossAxis: offset[0]
|
35
|
-
}), (0, _react.flip)({
|
36
|
-
fallbackAxisSideDirection: 'end'
|
37
|
-
}), (0, _react.shift)()]
|
38
|
-
}),
|
39
|
-
refs = _useFloating.refs,
|
40
|
-
floatingStyles = _useFloating.floatingStyles;
|
41
|
-
var wrappedId = (0, _plasmaCore.safeUseId)();
|
42
|
-
var handleTargetClick = function handleTargetClick(event) {
|
43
|
-
if (trigger === 'hover') {
|
44
|
-
return;
|
45
|
-
}
|
46
|
-
if (onToggle) {
|
47
|
-
onToggle(!opened, event);
|
48
|
-
}
|
49
|
-
};
|
50
|
-
var handleTargetMouseEnter = function handleTargetMouseEnter(event) {
|
51
|
-
if (trigger === 'click' || opened) {
|
52
|
-
return;
|
53
|
-
}
|
54
|
-
onToggle(true, event);
|
55
|
-
};
|
56
|
-
var handleTargetMouseLeave = function handleTargetMouseLeave(event) {
|
57
|
-
if (event.relatedTarget instanceof HTMLElement && refs.floating.current instanceof HTMLElement) {
|
58
|
-
var _refs$floating$curren;
|
59
|
-
if (trigger === 'click' || !opened || event.relatedTarget && refs.floating && (_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 && _refs$floating$curren.contains(event.relatedTarget)) {
|
60
|
-
return;
|
61
|
-
}
|
62
|
-
onToggle(false, event);
|
63
|
-
}
|
64
|
-
};
|
65
|
-
var handleFloatingMouseLeave = function handleFloatingMouseLeave(event) {
|
66
|
-
if (event.relatedTarget instanceof HTMLElement && refs.reference.current instanceof HTMLElement) {
|
67
|
-
var _refs$reference$curre;
|
68
|
-
if (trigger === 'click' || !opened || event.relatedTarget && refs.reference && (_refs$reference$curre = refs.reference.current) !== null && _refs$reference$curre !== void 0 && _refs$reference$curre.contains(event.relatedTarget)) {
|
69
|
-
return;
|
70
|
-
}
|
71
|
-
onToggle(false, event);
|
72
|
-
}
|
73
|
-
};
|
74
|
-
return /*#__PURE__*/_react2["default"].createElement("div", {
|
75
|
-
id: wrappedId,
|
76
|
-
style: {
|
77
|
-
display: isInner ? 'block' : 'inline-block'
|
78
|
-
},
|
79
|
-
ref: ref
|
80
|
-
}, /*#__PURE__*/_react2["default"].createElement("div", {
|
81
|
-
ref: refs.setReference,
|
82
|
-
onClick: handleTargetClick,
|
83
|
-
onMouseEnter: handleTargetMouseEnter,
|
84
|
-
onMouseLeave: handleTargetMouseLeave
|
85
|
-
}, target), opened && /*#__PURE__*/_react2["default"].createElement(_react.FloatingPortal, getFloatingPortalProps(portal, wrappedId), /*#__PURE__*/_react2["default"].createElement("div", {
|
86
|
-
ref: refs.setFloating,
|
87
|
-
onMouseLeave: handleFloatingMouseLeave,
|
88
|
-
style: _objectSpread(_objectSpread({}, floatingStyles), {}, {
|
89
|
-
zIndex: 1
|
90
|
-
})
|
91
|
-
}, children)));
|
92
|
-
});
|
93
|
-
// root - принимает ref контейнера портала.
|
94
|
-
// id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.
|
95
|
-
var getFloatingPortalProps = function getFloatingPortalProps(portal, wrappedId) {
|
96
|
-
if (!portal) {
|
97
|
-
return {
|
98
|
-
id: wrappedId
|
99
|
-
};
|
100
|
-
}
|
101
|
-
if (typeof portal === 'string') {
|
102
|
-
return {
|
103
|
-
id: portal
|
104
|
-
};
|
105
|
-
}
|
106
|
-
return {
|
107
|
-
root: portal
|
108
|
-
};
|
109
|
-
};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.getItemByFocused = void 0;
|
7
|
-
var getItemByFocused = exports.getItemByFocused = function getItemByFocused(focusedPath, focusedToValueMap) {
|
8
|
-
var focusedPathAsString = focusedPath.reduce(function (acc, n) {
|
9
|
-
return "".concat(acc, "/").concat(n);
|
10
|
-
}, '').replace(/^(\/)/, '');
|
11
|
-
return focusedToValueMap.get(focusedPathAsString);
|
12
|
-
};
|
@@ -1,15 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.getPlacement = void 0;
|
7
|
-
var getPlacement = exports.getPlacement = function getPlacement(placement) {
|
8
|
-
if (!placement) {
|
9
|
-
return 'bottom-start';
|
10
|
-
}
|
11
|
-
if (placement === 'auto') {
|
12
|
-
return placement;
|
13
|
-
}
|
14
|
-
return "".concat(placement, "-start");
|
15
|
-
};
|
@@ -1,102 +0,0 @@
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
7
|
-
import { flip, shift, useFloating, FloatingPortal, offset as offsetMiddleware, autoPlacement } from '@floating-ui/react';
|
8
|
-
import React, { forwardRef } from 'react';
|
9
|
-
import { safeUseId } from '@salutejs/plasma-core';
|
10
|
-
var FloatingPopover = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
11
|
-
var target = _ref.target,
|
12
|
-
children = _ref.children,
|
13
|
-
opened = _ref.opened,
|
14
|
-
onToggle = _ref.onToggle,
|
15
|
-
placement = _ref.placement,
|
16
|
-
portal = _ref.portal,
|
17
|
-
_ref$offset = _ref.offset,
|
18
|
-
offset = _ref$offset === void 0 ? [0, 0] : _ref$offset,
|
19
|
-
isInner = _ref.isInner,
|
20
|
-
trigger = _ref.trigger;
|
21
|
-
var _useFloating = useFloating({
|
22
|
-
placement: placement === 'auto' ? undefined : placement,
|
23
|
-
open: opened,
|
24
|
-
middleware: [placement === 'auto' && autoPlacement(), offsetMiddleware({
|
25
|
-
mainAxis: offset[1],
|
26
|
-
crossAxis: offset[0]
|
27
|
-
}), flip({
|
28
|
-
fallbackAxisSideDirection: 'end'
|
29
|
-
}), shift()]
|
30
|
-
}),
|
31
|
-
refs = _useFloating.refs,
|
32
|
-
floatingStyles = _useFloating.floatingStyles;
|
33
|
-
var wrappedId = safeUseId();
|
34
|
-
var handleTargetClick = function handleTargetClick(event) {
|
35
|
-
if (trigger === 'hover') {
|
36
|
-
return;
|
37
|
-
}
|
38
|
-
if (onToggle) {
|
39
|
-
onToggle(!opened, event);
|
40
|
-
}
|
41
|
-
};
|
42
|
-
var handleTargetMouseEnter = function handleTargetMouseEnter(event) {
|
43
|
-
if (trigger === 'click' || opened) {
|
44
|
-
return;
|
45
|
-
}
|
46
|
-
onToggle(true, event);
|
47
|
-
};
|
48
|
-
var handleTargetMouseLeave = function handleTargetMouseLeave(event) {
|
49
|
-
if (event.relatedTarget instanceof HTMLElement && refs.floating.current instanceof HTMLElement) {
|
50
|
-
var _refs$floating$curren;
|
51
|
-
if (trigger === 'click' || !opened || event.relatedTarget && refs.floating && (_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 && _refs$floating$curren.contains(event.relatedTarget)) {
|
52
|
-
return;
|
53
|
-
}
|
54
|
-
onToggle(false, event);
|
55
|
-
}
|
56
|
-
};
|
57
|
-
var handleFloatingMouseLeave = function handleFloatingMouseLeave(event) {
|
58
|
-
if (event.relatedTarget instanceof HTMLElement && refs.reference.current instanceof HTMLElement) {
|
59
|
-
var _refs$reference$curre;
|
60
|
-
if (trigger === 'click' || !opened || event.relatedTarget && refs.reference && (_refs$reference$curre = refs.reference.current) !== null && _refs$reference$curre !== void 0 && _refs$reference$curre.contains(event.relatedTarget)) {
|
61
|
-
return;
|
62
|
-
}
|
63
|
-
onToggle(false, event);
|
64
|
-
}
|
65
|
-
};
|
66
|
-
return /*#__PURE__*/React.createElement("div", {
|
67
|
-
id: wrappedId,
|
68
|
-
style: {
|
69
|
-
display: isInner ? 'block' : 'inline-block'
|
70
|
-
},
|
71
|
-
ref: ref
|
72
|
-
}, /*#__PURE__*/React.createElement("div", {
|
73
|
-
ref: refs.setReference,
|
74
|
-
onClick: handleTargetClick,
|
75
|
-
onMouseEnter: handleTargetMouseEnter,
|
76
|
-
onMouseLeave: handleTargetMouseLeave
|
77
|
-
}, target), opened && /*#__PURE__*/React.createElement(FloatingPortal, getFloatingPortalProps(portal, wrappedId), /*#__PURE__*/React.createElement("div", {
|
78
|
-
ref: refs.setFloating,
|
79
|
-
onMouseLeave: handleFloatingMouseLeave,
|
80
|
-
style: _objectSpread(_objectSpread({}, floatingStyles), {}, {
|
81
|
-
zIndex: 1
|
82
|
-
})
|
83
|
-
}, children)));
|
84
|
-
});
|
85
|
-
// root - принимает ref контейнера портала.
|
86
|
-
// id - если есть портал - не используется, если портала нет - подставляется 'wrappedId'.
|
87
|
-
var getFloatingPortalProps = function getFloatingPortalProps(portal, wrappedId) {
|
88
|
-
if (!portal) {
|
89
|
-
return {
|
90
|
-
id: wrappedId
|
91
|
-
};
|
92
|
-
}
|
93
|
-
if (typeof portal === 'string') {
|
94
|
-
return {
|
95
|
-
id: portal
|
96
|
-
};
|
97
|
-
}
|
98
|
-
return {
|
99
|
-
root: portal
|
100
|
-
};
|
101
|
-
};
|
102
|
-
export { FloatingPopover };
|
@@ -1,6 +0,0 @@
|
|
1
|
-
export var getItemByFocused = function getItemByFocused(focusedPath, focusedToValueMap) {
|
2
|
-
var focusedPathAsString = focusedPath.reduce(function (acc, n) {
|
3
|
-
return "".concat(acc, "/").concat(n);
|
4
|
-
}, '').replace(/^(\/)/, '');
|
5
|
-
return focusedToValueMap.get(focusedPathAsString);
|
6
|
-
};
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { FloatingPopoverProps } from './Dropdown.types';
|
3
|
-
declare const FloatingPopover: React.ForwardRefExoticComponent<FloatingPopoverProps & React.RefAttributes<HTMLDivElement>>;
|
4
|
-
export { FloatingPopover };
|
5
|
-
//# sourceMappingURL=FloatingPopover.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"FloatingPopover.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/FloatingPopover.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,QAAA,MAAM,eAAe,6FA8FpB,CAAC;AAwBF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import { FocusedPathState } from '../reducers/focusedPathReducer';
|
2
|
-
import { FocusedToValueMapType } from '../hooks/useHashMaps';
|
3
|
-
export declare const getItemByFocused: (focusedPath: FocusedPathState, focusedToValueMap: FocusedToValueMapType) => import("..").DropdownItemOption | undefined;
|
4
|
-
//# sourceMappingURL=getItemByFocused.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getItemByFocused.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/utils/getItemByFocused.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MAAM,gBAAgB,0HAI5B,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getItemId.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/utils/getItemId.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,WAAY,MAAM,SAAS,MAAM,KAAG,MAEzD,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getPlacement.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/utils/getPlacement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEtE,eAAO,MAAM,YAAY,cAAe,aAAa,CAAC,WAAW,CAAC,KAAG,aAUpE,CAAC"}
|