@salutejs/plasma-new-hope 0.336.0-canary.2227.17672582071.0 → 0.336.0-canary.2231.17732581275.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Autocomplete/Autocomplete.css +3 -0
- package/cjs/components/CodeField/CodeField.css +7 -6
- package/cjs/components/CodeField/CodeField.js +63 -27
- package/cjs/components/CodeField/CodeField.js.map +1 -1
- package/cjs/components/CodeField/CodeField.styles.js +7 -1
- package/cjs/components/CodeField/CodeField.styles.js.map +1 -1
- package/cjs/components/CodeField/{CodeField.styles_ebdpd0.css → CodeField.styles_14p25hi.css} +1 -0
- package/cjs/components/CodeField/hooks/useWebOTP.js +95 -0
- package/cjs/components/CodeField/hooks/useWebOTP.js.map +1 -0
- package/cjs/components/CodeField/utils/handleCodeError.js +2 -2
- package/cjs/components/CodeField/utils/handleCodeError.js.map +1 -1
- package/cjs/components/CodeField/utils/handleItemError.js +14 -4
- package/cjs/components/CodeField/utils/handleItemError.js.map +1 -1
- package/cjs/components/CodeField/utils/isWebOTPSupported.js +10 -0
- package/cjs/components/CodeField/utils/isWebOTPSupported.js.map +1 -0
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +3 -0
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +65 -66
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +1 -4
- package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +3 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.js +30 -22
- package/cjs/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +3 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +3 -0
- package/cjs/components/Pagination/Pagination.css +15 -10
- package/cjs/components/Pagination/Pagination.js +57 -5
- package/cjs/components/Pagination/Pagination.js.map +1 -1
- package/cjs/components/Pagination/Pagination.styles.js +19 -7
- package/cjs/components/Pagination/Pagination.styles.js.map +1 -1
- package/{es/components/Pagination/Pagination.styles_ska0td.css → cjs/components/Pagination/Pagination.styles_qhyqps.css} +5 -3
- package/cjs/components/Pagination/Pagination.tokens.js +3 -0
- package/cjs/components/Pagination/Pagination.tokens.js.map +1 -1
- package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.css +3 -3
- package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.styles.js +1 -1
- package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.styles.js.map +1 -1
- package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/{PaginationQuickJumpToPage.styles_89ax1q.css → PaginationQuickJumpToPage.styles_1sw6ww1.css} +2 -2
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +3 -0
- package/cjs/components/Popover/Popover.js +4 -1
- package/cjs/components/Popover/Popover.js.map +1 -1
- package/cjs/components/Range/Range.css +3 -0
- package/cjs/components/Select/Select.css +3 -0
- package/cjs/components/Select/Select.js +35 -21
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/hooks/usePathMaps.js +1 -4
- package/cjs/components/Select/hooks/usePathMaps.js.map +1 -1
- package/cjs/components/Select/ui/Target/Target.css +3 -0
- package/cjs/components/Select/ui/Target/Target.js +0 -2
- package/cjs/components/Select/ui/Target/Target.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +3 -0
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +32 -49
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/cjs/components/Slider/Slider.css +3 -0
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +3 -0
- package/cjs/components/Switch/Switch.css +6 -6
- package/cjs/components/Switch/Switch.js +5 -2
- package/cjs/components/Switch/Switch.js.map +1 -1
- package/cjs/components/Switch/Switch.styles.js +1 -1
- package/cjs/components/Switch/Switch.styles.js.map +1 -1
- package/cjs/components/Switch/{Switch.styles_qjefea.css → Switch.styles_158fwwl.css} +1 -1
- package/cjs/components/Switch/Switch.tokens.js +2 -1
- package/cjs/components/Switch/Switch.tokens.js.map +1 -1
- package/cjs/components/Table/Table.css +3 -0
- package/cjs/components/Table/ui/Cell/Cell.css +3 -0
- package/cjs/components/Table/ui/EditableCell/EditableCell.css +3 -0
- package/cjs/components/Table/ui/HeadCell/HeadCell.css +3 -0
- package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.css +3 -0
- package/cjs/components/TextField/TextField.js +20 -4
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/TextField/TextField.tokens.js +1 -0
- package/cjs/components/TextField/TextField.tokens.js.map +1 -1
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.css +58 -0
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +86 -0
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js.map +1 -0
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +25 -0
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js.map +1 -0
- package/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles_y9tozi.css +2 -0
- package/cjs/components/Tree/Tree.css +7 -6
- package/cjs/components/Tree/Tree.js +42 -1
- package/cjs/components/Tree/Tree.js.map +1 -1
- package/cjs/components/Tree/Tree.styles.js +17 -2
- package/cjs/components/Tree/Tree.styles.js.map +1 -1
- package/cjs/components/Tree/Tree.styles_1bw3k0r.css +8 -0
- package/cjs/components/Tree/Tree.tokens.js +5 -2
- package/cjs/components/Tree/Tree.tokens.js.map +1 -1
- package/cjs/components/Tree/utils/traverseTree.js +3 -3
- package/cjs/components/Tree/utils/traverseTree.js.map +1 -1
- package/cjs/engines/common.js.map +1 -1
- package/cjs/engines/index.js.map +1 -1
- package/cjs/index.css +35 -28
- package/emotion/cjs/components/CodeField/CodeField.js +61 -23
- package/emotion/cjs/components/CodeField/CodeField.styles.js +18 -11
- package/emotion/cjs/components/CodeField/hooks/useWebOTP.js +246 -0
- package/emotion/cjs/components/CodeField/utils/handleCodeError.js +2 -2
- package/emotion/cjs/components/CodeField/utils/handleItemError.js +12 -3
- package/emotion/cjs/components/CodeField/utils/index.js +4 -0
- package/emotion/cjs/components/CodeField/utils/isWebOTPSupported.js +13 -0
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +67 -74
- package/emotion/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +2 -5
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/index.js +0 -4
- package/emotion/cjs/components/DatePicker/RangeDate/RangeDate.js +24 -22
- package/emotion/cjs/components/Pagination/Pagination.js +53 -5
- package/emotion/cjs/components/Pagination/Pagination.styles.js +28 -14
- package/emotion/cjs/components/Pagination/Pagination.tokens.js +3 -0
- package/emotion/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.styles.js +6 -6
- package/emotion/cjs/components/Popover/Popover.js +3 -1
- package/emotion/cjs/components/Select/Select.js +36 -19
- package/emotion/cjs/components/Select/hooks/usePathMaps.js +2 -5
- package/emotion/cjs/components/Select/ui/Target/Target.js +1 -2
- package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +32 -71
- package/emotion/cjs/components/Select/utils/index.js +0 -4
- package/emotion/cjs/components/Switch/Switch.js +4 -2
- package/emotion/cjs/components/Switch/Switch.styles.js +11 -11
- package/emotion/cjs/components/Switch/Switch.tokens.js +2 -1
- package/emotion/cjs/components/TextField/TextField.js +21 -5
- package/emotion/cjs/components/TextField/TextField.tokens.js +1 -0
- package/emotion/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +78 -0
- package/emotion/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +49 -0
- package/emotion/cjs/components/TextField/ui/index.js +12 -3
- package/emotion/cjs/components/Tree/Tree.js +31 -1
- package/emotion/cjs/components/Tree/Tree.styles.js +23 -13
- package/emotion/cjs/components/Tree/Tree.tokens.js +5 -2
- package/emotion/cjs/components/Tree/utils/traverseTree.js +3 -3
- package/emotion/cjs/examples/components/Pagination/Pagination.config.js +12 -12
- package/emotion/cjs/examples/components/Tree/Tree.config.js +5 -5
- package/emotion/es/components/CodeField/CodeField.js +64 -26
- package/emotion/es/components/CodeField/CodeField.styles.js +15 -11
- package/emotion/es/components/CodeField/hooks/useWebOTP.js +236 -0
- package/emotion/es/components/CodeField/utils/handleCodeError.js +2 -2
- package/emotion/es/components/CodeField/utils/handleItemError.js +12 -3
- package/emotion/es/components/CodeField/utils/index.js +1 -0
- package/emotion/es/components/CodeField/utils/isWebOTPSupported.js +3 -0
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +68 -75
- package/emotion/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +2 -5
- package/emotion/es/components/Combobox/ComboboxNew/utils/index.js +0 -1
- package/emotion/es/components/DatePicker/RangeDate/RangeDate.js +24 -22
- package/emotion/es/components/Pagination/Pagination.js +55 -7
- package/emotion/es/components/Pagination/Pagination.styles.js +23 -15
- package/emotion/es/components/Pagination/Pagination.tokens.js +3 -0
- package/emotion/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.styles.js +6 -6
- package/emotion/es/components/Popover/Popover.js +4 -2
- package/emotion/es/components/Select/Select.js +36 -19
- package/emotion/es/components/Select/hooks/usePathMaps.js +2 -5
- package/emotion/es/components/Select/ui/Target/Target.js +1 -2
- package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.js +33 -72
- package/emotion/es/components/Select/utils/index.js +0 -1
- package/emotion/es/components/Switch/Switch.js +4 -2
- package/emotion/es/components/Switch/Switch.styles.js +11 -11
- package/emotion/es/components/Switch/Switch.tokens.js +2 -1
- package/emotion/es/components/TextField/TextField.js +22 -6
- package/emotion/es/components/TextField/TextField.tokens.js +1 -0
- package/emotion/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +63 -0
- package/emotion/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +27 -0
- package/emotion/es/components/TextField/ui/index.js +1 -0
- package/emotion/es/components/Tree/Tree.js +32 -2
- package/emotion/es/components/Tree/Tree.styles.js +20 -13
- package/emotion/es/components/Tree/Tree.tokens.js +5 -2
- package/emotion/es/components/Tree/utils/traverseTree.js +3 -3
- package/emotion/es/examples/components/Pagination/Pagination.config.js +12 -12
- package/emotion/es/examples/components/Tree/Tree.config.js +5 -5
- package/es/components/Autocomplete/Autocomplete.css +3 -0
- package/es/components/CodeField/CodeField.css +7 -6
- package/es/components/CodeField/CodeField.js +66 -30
- package/es/components/CodeField/CodeField.js.map +1 -1
- package/es/components/CodeField/CodeField.styles.js +7 -2
- package/es/components/CodeField/CodeField.styles.js.map +1 -1
- package/es/components/CodeField/{CodeField.styles_ebdpd0.css → CodeField.styles_14p25hi.css} +1 -0
- package/es/components/CodeField/hooks/useWebOTP.js +91 -0
- package/es/components/CodeField/hooks/useWebOTP.js.map +1 -0
- package/es/components/CodeField/utils/handleCodeError.js +2 -2
- package/es/components/CodeField/utils/handleCodeError.js.map +1 -1
- package/es/components/CodeField/utils/handleItemError.js +14 -4
- package/es/components/CodeField/utils/handleItemError.js.map +1 -1
- package/es/components/CodeField/utils/isWebOTPSupported.js +6 -0
- package/es/components/CodeField/utils/isWebOTPSupported.js.map +1 -0
- package/es/components/Combobox/ComboboxNew/Combobox.css +3 -0
- package/es/components/Combobox/ComboboxNew/Combobox.js +66 -67
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +1 -4
- package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js.map +1 -1
- package/es/components/DatePicker/RangeDate/RangeDate.css +3 -0
- package/es/components/DatePicker/RangeDate/RangeDate.js +30 -22
- package/es/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +3 -0
- package/es/components/DatePicker/SingleDate/SingleDate.css +3 -0
- package/es/components/Pagination/Pagination.css +15 -10
- package/es/components/Pagination/Pagination.js +59 -7
- package/es/components/Pagination/Pagination.js.map +1 -1
- package/es/components/Pagination/Pagination.styles.js +18 -8
- package/es/components/Pagination/Pagination.styles.js.map +1 -1
- package/{cjs/components/Pagination/Pagination.styles_ska0td.css → es/components/Pagination/Pagination.styles_qhyqps.css} +5 -3
- package/es/components/Pagination/Pagination.tokens.js +3 -0
- package/es/components/Pagination/Pagination.tokens.js.map +1 -1
- package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.css +3 -3
- package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.styles.js +1 -1
- package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.styles.js.map +1 -1
- package/es/components/Pagination/ui/PaginationQuickJumpToPage/{PaginationQuickJumpToPage.styles_89ax1q.css → PaginationQuickJumpToPage.styles_1sw6ww1.css} +2 -2
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +3 -0
- package/es/components/Popover/Popover.js +4 -1
- package/es/components/Popover/Popover.js.map +1 -1
- package/es/components/Range/Range.css +3 -0
- package/es/components/Select/Select.css +3 -0
- package/es/components/Select/Select.js +35 -21
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/hooks/usePathMaps.js +1 -4
- package/es/components/Select/hooks/usePathMaps.js.map +1 -1
- package/es/components/Select/ui/Target/Target.css +3 -0
- package/es/components/Select/ui/Target/Target.js +0 -2
- package/es/components/Select/ui/Target/Target.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +3 -0
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +33 -50
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/es/components/Slider/Slider.css +3 -0
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +3 -0
- package/es/components/Switch/Switch.css +6 -6
- package/es/components/Switch/Switch.js +5 -2
- package/es/components/Switch/Switch.js.map +1 -1
- package/es/components/Switch/Switch.styles.js +1 -1
- package/es/components/Switch/Switch.styles.js.map +1 -1
- package/es/components/Switch/{Switch.styles_qjefea.css → Switch.styles_158fwwl.css} +1 -1
- package/es/components/Switch/Switch.tokens.js +2 -1
- package/es/components/Switch/Switch.tokens.js.map +1 -1
- package/es/components/Table/Table.css +3 -0
- package/es/components/Table/ui/Cell/Cell.css +3 -0
- package/es/components/Table/ui/EditableCell/EditableCell.css +3 -0
- package/es/components/Table/ui/HeadCell/HeadCell.css +3 -0
- package/es/components/Table/ui/HeadCell/ui/Filter/Filter.css +3 -0
- package/es/components/TextField/TextField.js +20 -4
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/components/TextField/TextField.tokens.js +1 -0
- package/es/components/TextField/TextField.tokens.js.map +1 -1
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.css +58 -0
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +78 -0
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js.map +1 -0
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +21 -0
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js.map +1 -0
- package/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles_y9tozi.css +2 -0
- package/es/components/Tree/Tree.css +7 -6
- package/es/components/Tree/Tree.js +43 -2
- package/es/components/Tree/Tree.js.map +1 -1
- package/es/components/Tree/Tree.styles.js +17 -3
- package/es/components/Tree/Tree.styles.js.map +1 -1
- package/es/components/Tree/Tree.styles_1bw3k0r.css +8 -0
- package/es/components/Tree/Tree.tokens.js +5 -2
- package/es/components/Tree/Tree.tokens.js.map +1 -1
- package/es/components/Tree/utils/traverseTree.js +3 -3
- package/es/components/Tree/utils/traverseTree.js.map +1 -1
- package/es/engines/common.js.map +1 -1
- package/es/engines/index.js.map +1 -1
- package/es/index.css +35 -28
- package/package.json +2 -2
- package/styled-components/cjs/components/CodeField/CodeField.js +61 -23
- package/styled-components/cjs/components/CodeField/CodeField.styles.js +14 -5
- package/styled-components/cjs/components/CodeField/hooks/useWebOTP.js +246 -0
- package/styled-components/cjs/components/CodeField/utils/handleCodeError.js +2 -2
- package/styled-components/cjs/components/CodeField/utils/handleItemError.js +12 -3
- package/styled-components/cjs/components/CodeField/utils/index.js +4 -0
- package/styled-components/cjs/components/CodeField/utils/isWebOTPSupported.js +13 -0
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +67 -74
- package/styled-components/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +2 -5
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/index.js +0 -4
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.js +24 -22
- package/styled-components/cjs/components/Pagination/Pagination.js +53 -5
- package/styled-components/cjs/components/Pagination/Pagination.styles.js +39 -12
- package/styled-components/cjs/components/Pagination/Pagination.tokens.js +3 -0
- package/styled-components/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.styles.js +5 -5
- package/styled-components/cjs/components/Popover/Popover.js +3 -1
- package/styled-components/cjs/components/Select/Select.js +36 -19
- package/styled-components/cjs/components/Select/hooks/usePathMaps.js +2 -5
- package/styled-components/cjs/components/Select/ui/Target/Target.js +1 -2
- package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +32 -71
- package/styled-components/cjs/components/Select/utils/index.js +0 -4
- package/styled-components/cjs/components/Switch/Switch.js +4 -2
- package/styled-components/cjs/components/Switch/Switch.styles.js +9 -8
- package/styled-components/cjs/components/Switch/Switch.tokens.js +2 -1
- package/styled-components/cjs/components/TextField/TextField.js +20 -4
- package/styled-components/cjs/components/TextField/TextField.tokens.js +1 -0
- package/styled-components/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +78 -0
- package/styled-components/cjs/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +114 -0
- package/styled-components/cjs/components/TextField/ui/index.js +12 -3
- package/styled-components/cjs/components/Tree/Tree.js +31 -1
- package/styled-components/cjs/components/Tree/Tree.styles.js +24 -8
- package/styled-components/cjs/components/Tree/Tree.tokens.js +5 -2
- package/styled-components/cjs/components/Tree/utils/traverseTree.js +3 -3
- package/styled-components/cjs/examples/components/Combobox/Combobox.js +15 -0
- package/styled-components/cjs/examples/components/Pagination/Pagination.config.js +18 -11
- package/styled-components/cjs/examples/components/Tree/Tree.config.js +6 -2
- package/styled-components/es/components/CodeField/CodeField.js +64 -26
- package/styled-components/es/components/CodeField/CodeField.styles.js +11 -5
- package/styled-components/es/components/CodeField/hooks/useWebOTP.js +236 -0
- package/styled-components/es/components/CodeField/utils/handleCodeError.js +2 -2
- package/styled-components/es/components/CodeField/utils/handleItemError.js +12 -3
- package/styled-components/es/components/CodeField/utils/index.js +1 -0
- package/styled-components/es/components/CodeField/utils/isWebOTPSupported.js +3 -0
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +68 -75
- package/styled-components/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +2 -5
- package/styled-components/es/components/Combobox/ComboboxNew/utils/index.js +0 -1
- package/styled-components/es/components/DatePicker/RangeDate/RangeDate.js +24 -22
- package/styled-components/es/components/Pagination/Pagination.js +55 -7
- package/styled-components/es/components/Pagination/Pagination.styles.js +34 -13
- package/styled-components/es/components/Pagination/Pagination.tokens.js +3 -0
- package/styled-components/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.styles.js +5 -5
- package/styled-components/es/components/Popover/Popover.js +4 -2
- package/styled-components/es/components/Select/Select.js +36 -19
- package/styled-components/es/components/Select/hooks/usePathMaps.js +2 -5
- package/styled-components/es/components/Select/ui/Target/Target.js +1 -2
- package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.js +33 -72
- package/styled-components/es/components/Select/utils/index.js +0 -1
- package/styled-components/es/components/Switch/Switch.js +4 -2
- package/styled-components/es/components/Switch/Switch.styles.js +9 -8
- package/styled-components/es/components/Switch/Switch.tokens.js +2 -1
- package/styled-components/es/components/TextField/TextField.js +21 -5
- package/styled-components/es/components/TextField/TextField.tokens.js +1 -0
- package/styled-components/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.js +63 -0
- package/styled-components/es/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.js +92 -0
- package/styled-components/es/components/TextField/ui/index.js +1 -0
- package/styled-components/es/components/Tree/Tree.js +32 -2
- package/styled-components/es/components/Tree/Tree.styles.js +21 -8
- package/styled-components/es/components/Tree/Tree.tokens.js +5 -2
- package/styled-components/es/components/Tree/utils/traverseTree.js +3 -3
- package/styled-components/es/examples/components/Combobox/Combobox.js +0 -7
- package/styled-components/es/examples/components/Pagination/Pagination.config.js +18 -11
- package/styled-components/es/examples/components/Tree/Tree.config.js +6 -2
- package/types/components/CodeField/CodeField.d.ts.map +1 -1
- package/types/components/CodeField/CodeField.styles.d.ts +1 -0
- package/types/components/CodeField/CodeField.styles.d.ts.map +1 -1
- package/types/components/CodeField/hooks/useWebOTP.d.ts +20 -0
- package/types/components/CodeField/hooks/useWebOTP.d.ts.map +1 -0
- package/types/components/CodeField/utils/handleCodeError.d.ts +2 -2
- package/types/components/CodeField/utils/handleCodeError.d.ts.map +1 -1
- package/types/components/CodeField/utils/handleItemError.d.ts +3 -2
- package/types/components/CodeField/utils/handleItemError.d.ts.map +1 -1
- package/types/components/CodeField/utils/index.d.ts +1 -0
- package/types/components/CodeField/utils/index.d.ts.map +1 -1
- package/types/components/CodeField/utils/isWebOTPSupported.d.ts +2 -0
- package/types/components/CodeField/utils/isWebOTPSupported.d.ts.map +1 -0
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/hooks/getPathMaps.d.ts +1 -2
- package/types/components/Combobox/ComboboxNew/hooks/getPathMaps.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/utils/index.d.ts +0 -1
- package/types/components/Combobox/ComboboxNew/utils/index.d.ts.map +1 -1
- package/types/components/DatePicker/RangeDate/RangeDate.d.ts.map +1 -1
- package/types/components/Pagination/Pagination.d.ts.map +1 -1
- package/types/components/Pagination/Pagination.styles.d.ts +2 -0
- package/types/components/Pagination/Pagination.styles.d.ts.map +1 -1
- package/types/components/Pagination/Pagination.tokens.d.ts +3 -0
- package/types/components/Pagination/Pagination.tokens.d.ts.map +1 -1
- package/types/components/Pagination/Pagination.types.d.ts +6 -0
- package/types/components/Pagination/Pagination.types.d.ts.map +1 -1
- package/types/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.styles.d.ts.map +1 -1
- package/types/components/Popover/Popover.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/Select/hooks/usePathMaps.d.ts +1 -2
- package/types/components/Select/hooks/usePathMaps.d.ts.map +1 -1
- package/types/components/Select/ui/Target/Target.d.ts +0 -1
- package/types/components/Select/ui/Target/Target.d.ts.map +1 -1
- package/types/components/Select/ui/Target/Target.types.d.ts +1 -2
- package/types/components/Select/ui/Target/Target.types.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.types.d.ts +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.types.d.ts.map +1 -1
- package/types/components/Select/utils/index.d.ts +0 -1
- package/types/components/Select/utils/index.d.ts.map +1 -1
- package/types/components/Switch/Switch.d.ts.map +1 -1
- package/types/components/Switch/Switch.styles.d.ts.map +1 -1
- package/types/components/Switch/Switch.tokens.d.ts +1 -0
- package/types/components/Switch/Switch.tokens.d.ts.map +1 -1
- package/types/components/Switch/Switch.types.d.ts +5 -0
- package/types/components/Switch/Switch.types.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/components/TextField/TextField.tokens.d.ts +1 -0
- package/types/components/TextField/TextField.tokens.d.ts.map +1 -1
- package/types/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.d.ts +21 -0
- package/types/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.d.ts.map +1 -0
- package/types/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.d.ts +3 -0
- package/types/components/TextField/ui/TextFieldChipNew/TextFieldChipNew.styles.d.ts.map +1 -0
- package/types/components/TextField/ui/index.d.ts +1 -0
- package/types/components/TextField/ui/index.d.ts.map +1 -1
- package/types/components/Tree/Tree.d.ts +3 -3
- package/types/components/Tree/Tree.d.ts.map +1 -1
- package/types/components/Tree/Tree.styles.d.ts +3 -0
- package/types/components/Tree/Tree.styles.d.ts.map +1 -1
- package/types/components/Tree/Tree.tokens.d.ts +3 -0
- package/types/components/Tree/Tree.tokens.d.ts.map +1 -1
- package/types/components/Tree/Tree.types.d.ts +50 -1
- package/types/components/Tree/Tree.types.d.ts.map +1 -1
- package/types/components/Tree/utils/traverseTree.d.ts.map +1 -1
- package/types/engines/common.d.ts +3 -3
- package/types/engines/common.d.ts.map +1 -1
- package/types/engines/index.d.ts +1 -1
- package/types/engines/index.d.ts.map +1 -1
- package/types/engines/types.d.ts +4 -0
- package/types/engines/types.d.ts.map +1 -1
- package/types/examples/components/Pagination/Pagination.config.d.ts.map +1 -1
- package/types/examples/components/Tree/Tree.config.d.ts.map +1 -1
- package/types/examples/components/Tree/Tree.d.ts.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/utils/getRemovedElement.js +0 -17
- package/cjs/components/Combobox/ComboboxNew/utils/getRemovedElement.js.map +0 -1
- package/cjs/components/Select/utils/getRemovedElement.js +0 -17
- package/cjs/components/Select/utils/getRemovedElement.js.map +0 -1
- package/cjs/components/Tree/Tree.styles_6sla5y.css +0 -7
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/getRemovedElement.js +0 -20
- package/emotion/cjs/components/Select/utils/getRemovedElement.js +0 -20
- package/emotion/es/components/Combobox/ComboboxNew/utils/getRemovedElement.js +0 -10
- package/emotion/es/components/Select/utils/getRemovedElement.js +0 -10
- package/es/components/Combobox/ComboboxNew/utils/getRemovedElement.js +0 -13
- package/es/components/Combobox/ComboboxNew/utils/getRemovedElement.js.map +0 -1
- package/es/components/Select/utils/getRemovedElement.js +0 -13
- package/es/components/Select/utils/getRemovedElement.js.map +0 -1
- package/es/components/Tree/Tree.styles_6sla5y.css +0 -7
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/getRemovedElement.js +0 -20
- package/styled-components/cjs/components/Select/utils/getRemovedElement.js +0 -20
- package/styled-components/es/components/Combobox/ComboboxNew/utils/getRemovedElement.js +0 -10
- package/styled-components/es/components/Select/utils/getRemovedElement.js +0 -10
- package/types/components/Combobox/ComboboxNew/utils/getRemovedElement.d.ts +0 -2
- package/types/components/Combobox/ComboboxNew/utils/getRemovedElement.d.ts.map +0 -1
- package/types/components/Select/utils/getRemovedElement.d.ts +0 -2
- package/types/components/Select/utils/getRemovedElement.d.ts.map +0 -1
|
@@ -99,9 +99,10 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
99
99
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
100
100
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
101
101
|
}
|
|
102
|
-
import React, { useState, forwardRef, Fragment } from "react";
|
|
102
|
+
import React, { useState, forwardRef, Fragment, useRef, useEffect } from "react";
|
|
103
|
+
import { useForkRef } from "@salutejs/plasma-core";
|
|
103
104
|
import { cx, isNumber } from "../../utils";
|
|
104
|
-
import { PaginationPages, PaginationActions, PaginationButton, PaginationSection, PaginationButtonGroup, PaginationRoot, PaginationShorter } from "./Pagination.styles";
|
|
105
|
+
import { PaginationPages, PaginationActions, PaginationButton, PaginationSection, PaginationButtonGroup, PaginationRoot, PaginationShorter, PaginationActionsLeft, PaginationHelperText } from "./Pagination.styles";
|
|
105
106
|
import { getSections, defaultValues } from "./utils";
|
|
106
107
|
import { base as viewCSS } from "./variations/_view/base";
|
|
107
108
|
import { base as typeCSS } from "./variations/_type/base";
|
|
@@ -111,9 +112,11 @@ import { PaginationQuickJumpToPage } from "./ui/PaginationQuickJumpToPage/Pagina
|
|
|
111
112
|
import { PaginationSelectPerPage } from "./ui/PaginationSelectPerPage/PaginationSelectPerPage";
|
|
112
113
|
export var paginationRoot = function(Root) {
|
|
113
114
|
return /*#__PURE__*/ forwardRef(function(_param, ref) {
|
|
114
|
-
var outerValue = _param.value, defaultValue = _param.defaultValue, outerPerPage = _param.perPage, defaultPerPage = _param.defaultPerPage, _param_slots = _param.slots, slots = _param_slots === void 0 ? defaultValues.slots : _param_slots, view = _param.view, viewCurrentPage = _param.viewCurrentPage, _param_type = _param.type, type = _param_type === void 0 ? defaultValues.type : _param_type, size = _param.size, _param_pilled = _param.pilled, pilled = _param_pilled === void 0 ? defaultValues.pilled : _param_pilled, _param_square = _param.square, square = _param_square === void 0 ? defaultValues.square : _param_square, _param_disabledPages = _param.disabledPages, disabledPages = _param_disabledPages === void 0 ? defaultValues.disabledPages : _param_disabledPages, _param_count = _param.count, count = _param_count === void 0 ? defaultValues.value : _param_count, _param_hasQuickJump = _param.hasQuickJump, hasQuickJump = _param_hasQuickJump === void 0 ? defaultValues.hasQuickJump : _param_hasQuickJump, _param_hasPerPage = _param.hasPerPage, hasPerPage = _param_hasPerPage === void 0 ? defaultValues.hasPerPage : _param_hasPerPage, _param_perPageList = _param.perPageList, perPageList = _param_perPageList === void 0 ? defaultValues.perPageList : _param_perPageList, _param_isCommonButtonStyles = _param.isCommonButtonStyles, isCommonButtonStyles = _param_isCommonButtonStyles === void 0 ? defaultValues.isCommonButtonStyles : _param_isCommonButtonStyles, _param_placeholderQuickJump = _param.placeholderQuickJump, placeholderQuickJump = _param_placeholderQuickJump === void 0 ? defaultValues.placeholderQuickJump : _param_placeholderQuickJump, _param_textQuickJump = _param.textQuickJump, textQuickJump = _param_textQuickJump === void 0 ? defaultValues.textQuickJump : _param_textQuickJump, _param_textPerPage = _param.textPerPage, textPerPage = _param_textPerPage === void 0 ? defaultValues.textPerPage : _param_textPerPage, leftContent = _param.leftContent, rightContent = _param.rightContent, _param_listWidth = _param.listWidth, listWidth = _param_listWidth === void 0 ? 'fit-content' : _param_listWidth, onChangePageValue = _param.onChangePageValue, onChangePerPageValue = _param.onChangePerPageValue, onChange = _param.onChange, rest = _object_without_properties(_param, [
|
|
115
|
+
var outerValue = _param.value, defaultValue = _param.defaultValue, helperText = _param.helperText, singleLine = _param.singleLine, outerPerPage = _param.perPage, defaultPerPage = _param.defaultPerPage, _param_slots = _param.slots, slots = _param_slots === void 0 ? defaultValues.slots : _param_slots, view = _param.view, viewCurrentPage = _param.viewCurrentPage, _param_type = _param.type, type = _param_type === void 0 ? defaultValues.type : _param_type, size = _param.size, _param_pilled = _param.pilled, pilled = _param_pilled === void 0 ? defaultValues.pilled : _param_pilled, _param_square = _param.square, square = _param_square === void 0 ? defaultValues.square : _param_square, _param_disabledPages = _param.disabledPages, disabledPages = _param_disabledPages === void 0 ? defaultValues.disabledPages : _param_disabledPages, _param_count = _param.count, count = _param_count === void 0 ? defaultValues.value : _param_count, _param_hasQuickJump = _param.hasQuickJump, hasQuickJump = _param_hasQuickJump === void 0 ? defaultValues.hasQuickJump : _param_hasQuickJump, _param_hasPerPage = _param.hasPerPage, hasPerPage = _param_hasPerPage === void 0 ? defaultValues.hasPerPage : _param_hasPerPage, _param_perPageList = _param.perPageList, perPageList = _param_perPageList === void 0 ? defaultValues.perPageList : _param_perPageList, _param_isCommonButtonStyles = _param.isCommonButtonStyles, isCommonButtonStyles = _param_isCommonButtonStyles === void 0 ? defaultValues.isCommonButtonStyles : _param_isCommonButtonStyles, _param_placeholderQuickJump = _param.placeholderQuickJump, placeholderQuickJump = _param_placeholderQuickJump === void 0 ? defaultValues.placeholderQuickJump : _param_placeholderQuickJump, _param_textQuickJump = _param.textQuickJump, textQuickJump = _param_textQuickJump === void 0 ? defaultValues.textQuickJump : _param_textQuickJump, _param_textPerPage = _param.textPerPage, textPerPage = _param_textPerPage === void 0 ? defaultValues.textPerPage : _param_textPerPage, leftContent = _param.leftContent, rightContent = _param.rightContent, _param_listWidth = _param.listWidth, listWidth = _param_listWidth === void 0 ? 'fit-content' : _param_listWidth, onChangePageValue = _param.onChangePageValue, onChangePerPageValue = _param.onChangePerPageValue, onChange = _param.onChange, rest = _object_without_properties(_param, [
|
|
115
116
|
"value",
|
|
116
117
|
"defaultValue",
|
|
118
|
+
"helperText",
|
|
119
|
+
"singleLine",
|
|
117
120
|
"perPage",
|
|
118
121
|
"defaultPerPage",
|
|
119
122
|
"slots",
|
|
@@ -143,11 +146,16 @@ export var paginationRoot = function(Root) {
|
|
|
143
146
|
var pageValue = outerValue !== null && outerValue !== void 0 ? outerValue : pageInner;
|
|
144
147
|
var _useState1 = _sliced_to_array(useState(hasPerPage ? defaultPerPage || defaultValues.perPage : undefined), 2), perPageInner = _useState1[0], setPerPageInner = _useState1[1];
|
|
145
148
|
var perPageValue = outerPerPage !== null && outerPerPage !== void 0 ? outerPerPage : perPageInner;
|
|
149
|
+
var pagesRef = useRef(null);
|
|
150
|
+
var _useState2 = _sliced_to_array(useState(0), 2), pagesWidth = _useState2[0], setPagesWidth = _useState2[1];
|
|
151
|
+
var _useState3 = _sliced_to_array(useState(0), 2), rootWidth = _useState3[0], setRootWidth = _useState3[1];
|
|
152
|
+
var rootRef = useRef(null);
|
|
153
|
+
var forkRef = useForkRef(rootRef, ref);
|
|
146
154
|
var pages = Math.ceil(count / (perPageValue || 1));
|
|
147
155
|
var sections = getSections(pageValue, pages, slots);
|
|
148
156
|
var typeClass = classes["".concat(type, "Type")];
|
|
149
157
|
var roundedClass = pilled ? 'circle-circle' : 'square-square';
|
|
150
|
-
var withHasPerPageSelect = hasPerPage ? classes.withHasPerPageSelect : undefined;
|
|
158
|
+
var withHasPerPageSelect = hasPerPage && !helperText ? classes.withHasPerPageSelect : undefined;
|
|
151
159
|
var withHasQuickJump = hasQuickJump ? classes.withHasQuickJump : undefined;
|
|
152
160
|
var disabled = disabledPages.map(function(el) {
|
|
153
161
|
return isNumber(el) ? Number(el) : null;
|
|
@@ -185,15 +193,43 @@ export var paginationRoot = function(Root) {
|
|
|
185
193
|
var isActiveButton = function(checkPage) {
|
|
186
194
|
return pageValue === checkPage ? classes.paginationPageButtonActive : '';
|
|
187
195
|
};
|
|
196
|
+
useEffect(function() {
|
|
197
|
+
var observers = [];
|
|
198
|
+
if (pagesRef.current) {
|
|
199
|
+
var pagesObserver = new ResizeObserver(function(entries) {
|
|
200
|
+
var newWidth = entries[0].contentRect.width;
|
|
201
|
+
setPagesWidth(newWidth);
|
|
202
|
+
});
|
|
203
|
+
pagesObserver.observe(pagesRef.current);
|
|
204
|
+
observers.push(pagesObserver);
|
|
205
|
+
}
|
|
206
|
+
if (rootRef.current) {
|
|
207
|
+
var rootObserver = new ResizeObserver(function(entries) {
|
|
208
|
+
var newWidth = entries[0].contentRect.width;
|
|
209
|
+
setRootWidth(newWidth);
|
|
210
|
+
});
|
|
211
|
+
rootObserver.observe(rootRef.current);
|
|
212
|
+
observers.push(rootObserver);
|
|
213
|
+
}
|
|
214
|
+
return function() {
|
|
215
|
+
observers.forEach(function(observer) {
|
|
216
|
+
return observer.disconnect();
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
}, [
|
|
220
|
+
type
|
|
221
|
+
]);
|
|
188
222
|
return /*#__PURE__*/ React.createElement(Root, _object_spread({
|
|
189
223
|
size: size,
|
|
190
224
|
view: view,
|
|
191
225
|
viewCurrentPage: viewCurrentPage,
|
|
192
226
|
className: cx(classes.wrapper, typeClass),
|
|
193
|
-
ref:
|
|
227
|
+
ref: forkRef
|
|
194
228
|
}, rest), /*#__PURE__*/ React.createElement(PaginationRoot, {
|
|
195
229
|
className: typeClass
|
|
196
|
-
}, /*#__PURE__*/ React.createElement(PaginationPages,
|
|
230
|
+
}, /*#__PURE__*/ React.createElement(PaginationPages, {
|
|
231
|
+
ref: pagesRef
|
|
232
|
+
}, leftContent && /*#__PURE__*/ React.createElement(PaginationButtonGroup, {
|
|
197
233
|
isCommonButtonStyles: isCommonButtonStyles
|
|
198
234
|
}, leftContent), sections && sections.map(function(section, indexSection) {
|
|
199
235
|
return /*#__PURE__*/ React.createElement(Fragment, {
|
|
@@ -217,12 +253,24 @@ export var paginationRoot = function(Root) {
|
|
|
217
253
|
}), rightContent && /*#__PURE__*/ React.createElement(PaginationButtonGroup, {
|
|
218
254
|
isCommonButtonStyles: isCommonButtonStyles
|
|
219
255
|
}, rightContent)), /*#__PURE__*/ React.createElement(PaginationActions, {
|
|
256
|
+
style: type === 'compact' ? {
|
|
257
|
+
minWidth: '0px'
|
|
258
|
+
} : {
|
|
259
|
+
width: "calc(100% - ".concat(pagesWidth, "px)")
|
|
260
|
+
},
|
|
220
261
|
className: cx(classes.actions, typeClass, withHasPerPageSelect, withHasQuickJump)
|
|
262
|
+
}, /*#__PURE__*/ React.createElement(PaginationActionsLeft, {
|
|
263
|
+
className: typeClass
|
|
221
264
|
}, hasQuickJump && /*#__PURE__*/ React.createElement(PaginationQuickJumpToPage, {
|
|
222
265
|
placeholderQuickJump: placeholderQuickJump,
|
|
223
266
|
textQuickJump: textQuickJump,
|
|
224
267
|
onChangeValue: handleSetPage
|
|
225
|
-
}),
|
|
268
|
+
}), helperText && /*#__PURE__*/ React.createElement(PaginationHelperText, {
|
|
269
|
+
className: cx(typeClass, singleLine ? classes.ellipsisText : ''),
|
|
270
|
+
style: {
|
|
271
|
+
maxWidth: rootWidth
|
|
272
|
+
}
|
|
273
|
+
}, helperText)), hasPerPage && /*#__PURE__*/ React.createElement(PaginationSelectPerPage, {
|
|
226
274
|
textPerPage: textPerPage,
|
|
227
275
|
perPageValue: perPageValue,
|
|
228
276
|
perPageList: perPageList,
|
|
@@ -2,7 +2,7 @@ import styled from "styled-components";
|
|
|
2
2
|
import { buttonConfig, buttonTokens } from "../Button";
|
|
3
3
|
import { buttonGroupConfig, buttonGroupTokens } from "../ButtonGroup";
|
|
4
4
|
import { component, mergeConfig } from "../../engines";
|
|
5
|
-
import { addFocus } from "../../mixins";
|
|
5
|
+
import { addFocus, applyEllipsis } from "../../mixins";
|
|
6
6
|
import { classes, tokens } from "./Pagination.tokens";
|
|
7
7
|
var mergedButtonConfig = mergeConfig(buttonConfig);
|
|
8
8
|
var Button = component(mergedButtonConfig);
|
|
@@ -10,37 +10,39 @@ var mergedButtonGroupConfig = mergeConfig(buttonGroupConfig);
|
|
|
10
10
|
var ButtonGroup = component(mergedButtonGroupConfig);
|
|
11
11
|
export var PaginationRoot = styled.div.withConfig({
|
|
12
12
|
displayName: "Pagination.styles__PaginationRoot",
|
|
13
|
-
componentId: "sc-
|
|
13
|
+
componentId: "sc-ec0762a3-0"
|
|
14
14
|
})([
|
|
15
15
|
"display:flex;color:var(",
|
|
16
16
|
");&.",
|
|
17
|
-
"{
|
|
18
|
-
"{
|
|
17
|
+
"{flex-direction:column;gap:0.5rem;justify-content:flex-start;}&.",
|
|
18
|
+
"{width:100%;justify-content:space-between;flex:0 0 100%;gap:1rem;flex-wrap:nowrap;}"
|
|
19
19
|
], tokens.paginationColor, classes.compactType, classes.defaultType);
|
|
20
20
|
export var PaginationPages = styled.div.withConfig({
|
|
21
21
|
displayName: "Pagination.styles__PaginationPages",
|
|
22
|
-
componentId: "sc-
|
|
22
|
+
componentId: "sc-ec0762a3-1"
|
|
23
23
|
})([
|
|
24
|
-
"display:flex;align-items:center;gap:0.25rem;
|
|
24
|
+
"display:flex;align-items:center;gap:0.25rem;flex-shrink:0;"
|
|
25
25
|
]);
|
|
26
26
|
export var PaginationActions = styled.div.withConfig({
|
|
27
27
|
displayName: "Pagination.styles__PaginationActions",
|
|
28
|
-
componentId: "sc-
|
|
28
|
+
componentId: "sc-ec0762a3-2"
|
|
29
29
|
})([
|
|
30
|
-
"display:flex;justify-content:space-between;flex-grow:1;gap:
|
|
30
|
+
"display:flex;justify-content:space-between;flex-grow:1;align-items:center;gap:var(",
|
|
31
|
+
");flex-shrink:1;&.",
|
|
32
|
+
"{flex-direction:row;width:100%;flex-wrap:wrap;}&.",
|
|
31
33
|
"{flex-direction:row;}&.",
|
|
32
34
|
"{flex-direction:row-reverse;}&.",
|
|
33
35
|
"{flex-direction:row;}"
|
|
34
|
-
], classes.compactType, classes.withHasPerPageSelect, classes.withHasQuickJump);
|
|
36
|
+
], tokens.paginationHelperTextGap, classes.compactType, classes.defaultType, classes.withHasPerPageSelect, classes.withHasQuickJump);
|
|
35
37
|
export var PaginationSection = styled.div.withConfig({
|
|
36
38
|
displayName: "Pagination.styles__PaginationSection",
|
|
37
|
-
componentId: "sc-
|
|
39
|
+
componentId: "sc-ec0762a3-3"
|
|
38
40
|
})([
|
|
39
41
|
"display:flex;gap:0.125rem;"
|
|
40
42
|
]);
|
|
41
43
|
export var PaginationButtonGroup = styled(ButtonGroup).withConfig({
|
|
42
44
|
displayName: "Pagination.styles__PaginationButtonGroup",
|
|
43
|
-
componentId: "sc-
|
|
45
|
+
componentId: "sc-ec0762a3-4"
|
|
44
46
|
})([
|
|
45
47
|
"",
|
|
46
48
|
":var(",
|
|
@@ -82,7 +84,7 @@ export var PaginationButtonGroup = styled(ButtonGroup).withConfig({
|
|
|
82
84
|
], buttonGroupTokens.buttonColor, tokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, tokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, tokens.buttonHoverColor, buttonGroupTokens.buttonBackgroundColorHover, tokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, tokens.buttonActiveColor, buttonGroupTokens.buttonBackgroundColorActive, tokens.buttonBackgroundColorActive, buttonGroupTokens.buttonFontFamily, tokens.paginationFontFamily, buttonGroupTokens.buttonFontSize, tokens.paginationFontSize, buttonGroupTokens.buttonFontStyle, tokens.paginationFontStyle, buttonGroupTokens.buttonFontWeight, tokens.paginationFontWeight, buttonGroupTokens.buttonLetterSpacing, tokens.paginationLetterSpacing, buttonGroupTokens.buttonLineHeight, tokens.paginationLineHeight, buttonGroupTokens.buttonWidth, tokens.buttonWidth, buttonGroupTokens.buttonHeight, tokens.buttonHeight, buttonGroupTokens.buttonDefaultRadius, tokens.buttonRadius, buttonGroupTokens.buttonSideRadius, tokens.buttonRadius, buttonGroupTokens.buttonSegmentedRadius, tokens.buttonRadius, buttonGroupTokens.buttonRadiusCircle, tokens.buttonRadius);
|
|
83
85
|
export var PaginationButton = styled(Button).withConfig({
|
|
84
86
|
displayName: "Pagination.styles__PaginationButton",
|
|
85
|
-
componentId: "sc-
|
|
87
|
+
componentId: "sc-ec0762a3-5"
|
|
86
88
|
})([
|
|
87
89
|
"",
|
|
88
90
|
":var(",
|
|
@@ -148,10 +150,29 @@ export var PaginationButton = styled(Button).withConfig({
|
|
|
148
150
|
}));
|
|
149
151
|
export var PaginationShorter = styled(PaginationButton).withConfig({
|
|
150
152
|
displayName: "Pagination.styles__PaginationShorter",
|
|
151
|
-
componentId: "sc-
|
|
153
|
+
componentId: "sc-ec0762a3-6"
|
|
152
154
|
})([
|
|
153
155
|
"",
|
|
154
156
|
":var(",
|
|
155
157
|
");",
|
|
156
158
|
":0;"
|
|
157
159
|
], buttonTokens.buttonWidth, tokens.buttonWidthShorter, buttonTokens.buttonPadding);
|
|
160
|
+
export var PaginationActionsLeft = styled.div.withConfig({
|
|
161
|
+
displayName: "Pagination.styles__PaginationActionsLeft",
|
|
162
|
+
componentId: "sc-ec0762a3-7"
|
|
163
|
+
})([
|
|
164
|
+
"display:flex;align-items:center;flex-wrap:wrap;gap:var(",
|
|
165
|
+
");.",
|
|
166
|
+
" &{min-width:0;flex-wrap:nowrap;flex-shrink:1;}"
|
|
167
|
+
], tokens.paginationHelperTextGap, classes.defaultType);
|
|
168
|
+
export var PaginationHelperText = styled.div.withConfig({
|
|
169
|
+
displayName: "Pagination.styles__PaginationHelperText",
|
|
170
|
+
componentId: "sc-ec0762a3-8"
|
|
171
|
+
})([
|
|
172
|
+
"color:var(",
|
|
173
|
+
");&.",
|
|
174
|
+
"{min-width:0;",
|
|
175
|
+
" flex-shrink:1;}&.",
|
|
176
|
+
"{",
|
|
177
|
+
"}"
|
|
178
|
+
], tokens.paginationHelperTextColor, classes.defaultType, applyEllipsis(), classes.ellipsisText, applyEllipsis());
|
|
@@ -4,6 +4,7 @@ export var classes = {
|
|
|
4
4
|
actions: 'pagination-actions',
|
|
5
5
|
perPage: 'pagination-perpage-select',
|
|
6
6
|
quickJump: 'pagination-quick-jump-page',
|
|
7
|
+
ellipsisText: 'pagination-ellipsis-text',
|
|
7
8
|
selectWrapper: 'pagination-select-wrapper',
|
|
8
9
|
defaultType: 'pagination-type-default',
|
|
9
10
|
compactType: 'pagination-type-compact',
|
|
@@ -17,6 +18,8 @@ export var classes = {
|
|
|
17
18
|
export var tokens = {
|
|
18
19
|
paginationWidth: '--plasma-pagination-width',
|
|
19
20
|
paginationColor: '--plasma-pagination-color',
|
|
21
|
+
paginationHelperTextColor: '--plasma-pagination-helper-text-color',
|
|
22
|
+
paginationHelperTextGap: '--plasma-pagination-helper-text-gap',
|
|
20
23
|
buttonBackgroundColor: '--plasma-pagination-button-bg-color',
|
|
21
24
|
buttonBackgroundColorHover: '--plasma-pagination-button-bg-color-hover',
|
|
22
25
|
buttonBackgroundColorActive: '--plasma-pagination-button-bg-color-active',
|
|
@@ -2,9 +2,9 @@ import styled from "styled-components";
|
|
|
2
2
|
import { tokens } from "../../Pagination.tokens";
|
|
3
3
|
export var QuickJumpToPageRoot = styled.div.withConfig({
|
|
4
4
|
displayName: "PaginationQuickJumpToPage.styles__QuickJumpToPageRoot",
|
|
5
|
-
componentId: "sc-
|
|
5
|
+
componentId: "sc-d437c7e1-0"
|
|
6
6
|
})([
|
|
7
|
-
"display:flex;align-items:center;gap:0.5rem;font-family:var(",
|
|
7
|
+
"display:flex;align-items:center;gap:0.5rem;flex-shrink:0;font-family:var(",
|
|
8
8
|
");font-size:var(",
|
|
9
9
|
");font-style:var(",
|
|
10
10
|
");font-weight:var(",
|
|
@@ -14,13 +14,13 @@ export var QuickJumpToPageRoot = styled.div.withConfig({
|
|
|
14
14
|
], tokens.paginationFontFamily, tokens.paginationFontSize, tokens.paginationFontStyle, tokens.paginationFontWeight, tokens.paginationLetterSpacing, tokens.paginationLineHeight);
|
|
15
15
|
export var QuickJumpToPageTypography = styled.div.withConfig({
|
|
16
16
|
displayName: "PaginationQuickJumpToPage.styles__QuickJumpToPageTypography",
|
|
17
|
-
componentId: "sc-
|
|
17
|
+
componentId: "sc-d437c7e1-1"
|
|
18
18
|
})([
|
|
19
|
-
""
|
|
19
|
+
"white-space:nowrap;"
|
|
20
20
|
]);
|
|
21
21
|
export var QuickJumpToPageInput = styled.input.withConfig({
|
|
22
22
|
displayName: "PaginationQuickJumpToPage.styles__QuickJumpToPageInput",
|
|
23
|
-
componentId: "sc-
|
|
23
|
+
componentId: "sc-d437c7e1-2"
|
|
24
24
|
})([
|
|
25
25
|
"background:var(",
|
|
26
26
|
");color:var(",
|
|
@@ -131,7 +131,7 @@ import React, { useRef, useCallback, useEffect, useState, forwardRef, isValidEle
|
|
|
131
131
|
import { usePopper } from "react-popper";
|
|
132
132
|
import { useForkRef } from "@salutejs/plasma-core";
|
|
133
133
|
import { useFocusTrap } from "../../hooks";
|
|
134
|
-
import { cx } from "../../utils";
|
|
134
|
+
import { cx, safeUseId } from "../../utils";
|
|
135
135
|
import { Portal } from "../Portal";
|
|
136
136
|
import { base as viewCSS } from "./variations/_view/base";
|
|
137
137
|
import { StyledArrow, StyledPopover, StyledRoot, StyledWrapper } from "./Popover.styles";
|
|
@@ -176,6 +176,7 @@ export var POPOVER_PORTAL_ID = 'plasma-popover-root';
|
|
|
176
176
|
var portalRef = useRef(null);
|
|
177
177
|
var targetRef = useRef(null);
|
|
178
178
|
var trapRef = useFocusTrap(innerIsOpen && isFocusTrapped);
|
|
179
|
+
var uuid = safeUseId();
|
|
179
180
|
var popoverForkRef = useForkRef(popoverRef, trapRef);
|
|
180
181
|
var _useState = _sliced_to_array(useState(null), 2), arrowElement = _useState[0], setArrowElement = _useState[1];
|
|
181
182
|
var _useState1 = _sliced_to_array(useState(false), 2), forceRender = _useState1[1];
|
|
@@ -326,8 +327,9 @@ export var POPOVER_PORTAL_ID = 'plasma-popover-root';
|
|
|
326
327
|
portal = rootRef.current;
|
|
327
328
|
}
|
|
328
329
|
if (!portal) {
|
|
330
|
+
var portalId = "".concat(POPOVER_PORTAL_ID, "-").concat(uuid);
|
|
329
331
|
portal = document.createElement('div');
|
|
330
|
-
portal.setAttribute('id',
|
|
332
|
+
portal.setAttribute('id', portalId);
|
|
331
333
|
if (typeof frame === 'string' && frame !== 'document') {
|
|
332
334
|
var _document_getElementById;
|
|
333
335
|
(_document_getElementById = document.getElementById(frame)) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.appendChild(portal);
|
|
@@ -199,7 +199,7 @@ import { Context } from "./Select.context";
|
|
|
199
199
|
items
|
|
200
200
|
]);
|
|
201
201
|
// Создаем структуры для быстрой работы с деревом
|
|
202
|
-
var _usePathMaps = _sliced_to_array(usePathMaps(transformedItems),
|
|
202
|
+
var _usePathMaps = _sliced_to_array(usePathMaps(transformedItems), 4), pathMap = _usePathMaps[0], focusedToValueMap = _usePathMaps[1], valueToCheckedMap = _usePathMaps[2], valueToItemMap = _usePathMaps[3];
|
|
203
203
|
var _useState = _sliced_to_array(useState(props.multiselect ? [] : ''), 2), internalValue = _useState[0], setInternalValue = _useState[1];
|
|
204
204
|
var value = outerValue !== null && outerValue !== undefined ? outerValue : internalValue;
|
|
205
205
|
var floatingPopoverRef = useRef(null);
|
|
@@ -213,6 +213,7 @@ import { Context } from "./Select.context";
|
|
|
213
213
|
var treeId = safeUseId();
|
|
214
214
|
var listWrapperRef = useRef(null);
|
|
215
215
|
var view = target === 'textfield-like' && (disabled || readOnly) ? 'default' : getView(status, outerView);
|
|
216
|
+
var rootRef = useRef(null);
|
|
216
217
|
// Собираем объект с пропсами для required и прокидываем их напрямую в компонент Textfield.
|
|
217
218
|
var requiredProps = props.target === 'button-like' ? undefined : {
|
|
218
219
|
required: required,
|
|
@@ -235,15 +236,7 @@ import { Context } from "./Select.context";
|
|
|
235
236
|
if (!isCurrentListOpen) {
|
|
236
237
|
return;
|
|
237
238
|
}
|
|
238
|
-
|
|
239
|
-
type: 'reset'
|
|
240
|
-
});
|
|
241
|
-
dispatchFocusedPath({
|
|
242
|
-
type: 'reset'
|
|
243
|
-
});
|
|
244
|
-
if (onToggle) {
|
|
245
|
-
onToggle(false);
|
|
246
|
-
}
|
|
239
|
+
handleListToggle(false);
|
|
247
240
|
}, floatingPopoverRef);
|
|
248
241
|
var onChange = function(newValue, item) {
|
|
249
242
|
if (props.onChange) {
|
|
@@ -271,12 +264,18 @@ import { Context } from "./Select.context";
|
|
|
271
264
|
type: 'opened_first_level'
|
|
272
265
|
});
|
|
273
266
|
} else {
|
|
267
|
+
var _rootRef_current;
|
|
274
268
|
dispatchFocusedPath({
|
|
275
269
|
type: 'reset'
|
|
276
270
|
});
|
|
277
271
|
dispatchPath({
|
|
278
272
|
type: 'reset'
|
|
279
273
|
});
|
|
274
|
+
// Скроллим чипы к левому краю при закрытии компонента
|
|
275
|
+
var el = rootRef === null || rootRef === void 0 ? void 0 : (_rootRef_current = rootRef.current) === null || _rootRef_current === void 0 ? void 0 : _rootRef_current.querySelector('.input-scrollable-wrapper');
|
|
276
|
+
if (multiselect && value.length > 0 && el) {
|
|
277
|
+
el.scrollLeft = 0;
|
|
278
|
+
}
|
|
280
279
|
}
|
|
281
280
|
if (onToggle) {
|
|
282
281
|
onToggle(opened);
|
|
@@ -287,14 +286,32 @@ import { Context } from "./Select.context";
|
|
|
287
286
|
return;
|
|
288
287
|
}
|
|
289
288
|
var checkedCopy = new Map(checked);
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
289
|
+
switch(checkedCopy.get(item.value)){
|
|
290
|
+
// Если чекбокс в состоянии indeterminate
|
|
291
|
+
case 'indeterminate':
|
|
292
|
+
{
|
|
293
|
+
updateDescendants(item, checkedCopy, true, valueToItemMap);
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
// Если чекбокс в состоянии checked
|
|
297
|
+
case true:
|
|
298
|
+
{
|
|
299
|
+
updateDescendants(item, checkedCopy, false, valueToItemMap);
|
|
300
|
+
checkedCopy.set(item.value, false);
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
// Если чекбокс в состоянии unchecked
|
|
304
|
+
case false:
|
|
305
|
+
{
|
|
306
|
+
updateDescendants(item, checkedCopy, true, valueToItemMap);
|
|
307
|
+
checkedCopy.set(item.value, true);
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
default:
|
|
311
|
+
{
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
296
314
|
}
|
|
297
|
-
updateAncestors(item, checkedCopy);
|
|
298
315
|
var newValues = [];
|
|
299
316
|
valueToItemMap.forEach(function(item, key) {
|
|
300
317
|
if (checkedCopy.get(key)) {
|
|
@@ -428,7 +445,8 @@ import { Context } from "./Select.context";
|
|
|
428
445
|
chipView: chipView,
|
|
429
446
|
disabled: disabled,
|
|
430
447
|
readOnly: readOnly,
|
|
431
|
-
id: id
|
|
448
|
+
id: id,
|
|
449
|
+
ref: rootRef
|
|
432
450
|
}, rest), name && /*#__PURE__*/ React.createElement(SelectNative, {
|
|
433
451
|
items: valueToItemMap,
|
|
434
452
|
name: name,
|
|
@@ -485,7 +503,6 @@ import { Context } from "./Select.context";
|
|
|
485
503
|
activeDescendantItemValue: activeDescendantItemValue,
|
|
486
504
|
isTargetAmount: isTargetAmount,
|
|
487
505
|
onChange: onChange,
|
|
488
|
-
labelToItemMap: labelToItemMap,
|
|
489
506
|
chipView: chipView,
|
|
490
507
|
separator: separator,
|
|
491
508
|
requiredProps: requiredProps,
|
|
@@ -5,18 +5,16 @@ export var usePathMaps = function(items) {
|
|
|
5
5
|
var focusedToValueMap = new Map();
|
|
6
6
|
var valueToCheckedMap = new Map();
|
|
7
7
|
var valueToItemMap = new Map();
|
|
8
|
-
var labelToItemMap = new Map();
|
|
9
8
|
pathMap.set('root', (items === null || items === void 0 ? void 0 : items.length) || 0);
|
|
10
9
|
var rec = function(items) {
|
|
11
10
|
var prevIndex = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
|
|
12
11
|
items === null || items === void 0 ? void 0 : items.forEach(function(item, index) {
|
|
13
|
-
var value = item.value,
|
|
12
|
+
var value = item.value, innerItems = item.items;
|
|
14
13
|
var currIndex = "".concat(prevIndex, "/").concat(index).replace(/^(\/)/, '');
|
|
15
14
|
focusedToValueMap.set(currIndex, item);
|
|
16
15
|
valueToCheckedMap.set(value, false);
|
|
17
16
|
if (isEmpty(innerItems) || !innerItems) {
|
|
18
17
|
valueToItemMap.set(value, item);
|
|
19
|
-
labelToItemMap.set(label, item);
|
|
20
18
|
} else {
|
|
21
19
|
pathMap.set(value, innerItems.length);
|
|
22
20
|
rec(innerItems, currIndex);
|
|
@@ -28,7 +26,6 @@ export var usePathMaps = function(items) {
|
|
|
28
26
|
pathMap,
|
|
29
27
|
focusedToValueMap,
|
|
30
28
|
valueToCheckedMap,
|
|
31
|
-
valueToItemMap
|
|
32
|
-
labelToItemMap
|
|
29
|
+
valueToItemMap
|
|
33
30
|
];
|
|
34
31
|
};
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef } from "react";
|
|
|
2
2
|
import { useForkRef } from "@salutejs/plasma-core";
|
|
3
3
|
import { Button, Textfield } from "./ui";
|
|
4
4
|
export var Target = /*#__PURE__*/ forwardRef(function(param, ref) {
|
|
5
|
-
var value = param.value, opened = param.opened, valueToItemMap = param.valueToItemMap, label = param.label, placeholder = param.placeholder, onKeyDown = param.onKeyDown, labelPlacement = param.labelPlacement, size = param.size, contentLeft = param.contentLeft, disabled = param.disabled, readOnly = param.readOnly, renderValue = param.renderValue, selectProps = param.selectProps, inputWrapperRef = param.inputWrapperRef, multiselect = param.multiselect, view = param.view, helperText = param.helperText, treeId = param.treeId, activeDescendantItemValue = param.activeDescendantItemValue, isTargetAmount = param.isTargetAmount, onChange = param.onChange,
|
|
5
|
+
var value = param.value, opened = param.opened, valueToItemMap = param.valueToItemMap, label = param.label, placeholder = param.placeholder, onKeyDown = param.onKeyDown, labelPlacement = param.labelPlacement, size = param.size, contentLeft = param.contentLeft, disabled = param.disabled, readOnly = param.readOnly, renderValue = param.renderValue, selectProps = param.selectProps, inputWrapperRef = param.inputWrapperRef, multiselect = param.multiselect, view = param.view, helperText = param.helperText, treeId = param.treeId, activeDescendantItemValue = param.activeDescendantItemValue, isTargetAmount = param.isTargetAmount, onChange = param.onChange, chipView = param.chipView, separator = param.separator, requiredProps = param.requiredProps, hintProps = param.hintProps;
|
|
6
6
|
var buttonRef = useForkRef(ref, inputWrapperRef);
|
|
7
7
|
if (selectProps.renderTarget) {
|
|
8
8
|
return /*#__PURE__*/ React.createElement("div", {
|
|
@@ -47,7 +47,6 @@ export var Target = /*#__PURE__*/ forwardRef(function(param, ref) {
|
|
|
47
47
|
valueToItemMap: valueToItemMap,
|
|
48
48
|
renderValue: renderValue,
|
|
49
49
|
onChange: onChange,
|
|
50
|
-
labelToItemMap: labelToItemMap,
|
|
51
50
|
chipView: chipView,
|
|
52
51
|
requiredProps: requiredProps,
|
|
53
52
|
hintProps: hintProps,
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
function _array_like_to_array(arr, len) {
|
|
2
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
-
return arr2;
|
|
5
|
-
}
|
|
6
|
-
function _array_without_holes(arr) {
|
|
7
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
|
-
}
|
|
9
1
|
function _define_property(obj, key, value) {
|
|
10
2
|
if (key in obj) {
|
|
11
3
|
Object.defineProperty(obj, key, {
|
|
@@ -26,12 +18,6 @@ function _instanceof(left, right) {
|
|
|
26
18
|
return left instanceof right;
|
|
27
19
|
}
|
|
28
20
|
}
|
|
29
|
-
function _iterable_to_array(iter) {
|
|
30
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
31
|
-
}
|
|
32
|
-
function _non_iterable_spread() {
|
|
33
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
34
|
-
}
|
|
35
21
|
function _object_spread(target) {
|
|
36
22
|
for(var i = 1; i < arguments.length; i++){
|
|
37
23
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -71,23 +57,12 @@ function _object_spread_props(target, source) {
|
|
|
71
57
|
}
|
|
72
58
|
return target;
|
|
73
59
|
}
|
|
74
|
-
function _to_consumable_array(arr) {
|
|
75
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
76
|
-
}
|
|
77
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
78
|
-
if (!o) return;
|
|
79
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
80
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
81
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
82
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
83
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
84
|
-
}
|
|
85
60
|
import React, { forwardRef } from "react";
|
|
86
|
-
import { sizeToIconSize, getItemId
|
|
61
|
+
import { sizeToIconSize, getItemId } from "../../../../utils";
|
|
87
62
|
import { classes } from "../../../../Select.tokens";
|
|
88
63
|
import { IconArrowWrapper, StyledArrow, StyledTextField, StyledLeftHelper } from "./Textfield.styles";
|
|
89
64
|
export var Textfield = /*#__PURE__*/ forwardRef(function(param, ref) {
|
|
90
|
-
var inputWrapperRef = param.inputWrapperRef, opened = param.opened, multiselect = param.multiselect, value = param.value, label = param.label, labelPlacement = param.labelPlacement, keepPlaceholder = param.keepPlaceholder, placeholder = param.placeholder, onKeyDown = param.onKeyDown, size = param.size, view = param.view, contentLeft = param.contentLeft, helperText = param.helperText, treeId = param.treeId, activeDescendantItemValue = param.activeDescendantItemValue, disabled = param.disabled, readOnly = param.readOnly, isTargetAmount = param.isTargetAmount, valueToItemMap = param.valueToItemMap, renderValue = param.renderValue, onChange = param.onChange,
|
|
65
|
+
var inputWrapperRef = param.inputWrapperRef, opened = param.opened, multiselect = param.multiselect, value = param.value, label = param.label, labelPlacement = param.labelPlacement, keepPlaceholder = param.keepPlaceholder, placeholder = param.placeholder, onKeyDown = param.onKeyDown, size = param.size, view = param.view, contentLeft = param.contentLeft, helperText = param.helperText, treeId = param.treeId, activeDescendantItemValue = param.activeDescendantItemValue, disabled = param.disabled, readOnly = param.readOnly, isTargetAmount = param.isTargetAmount, valueToItemMap = param.valueToItemMap, renderValue = param.renderValue, onChange = param.onChange, chipView = param.chipView, requiredProps = param.requiredProps, chipType = param.chipType, hintProps = param.hintProps;
|
|
91
66
|
var withArrowInverse = opened ? classes.arrowInverse : undefined;
|
|
92
67
|
var getValue = function() {
|
|
93
68
|
var _valueToItemMap_get;
|
|
@@ -107,58 +82,44 @@ export var Textfield = /*#__PURE__*/ forwardRef(function(param, ref) {
|
|
|
107
82
|
if (value.length === 0) return [];
|
|
108
83
|
if (isTargetAmount) {
|
|
109
84
|
return [
|
|
110
|
-
|
|
85
|
+
{
|
|
86
|
+
value: '_removeAll',
|
|
87
|
+
label: "Выбрано ".concat(value.length),
|
|
88
|
+
disabled: value.every(function(val) {
|
|
89
|
+
var _valueToItemMap_get;
|
|
90
|
+
return valueToItemMap === null || valueToItemMap === void 0 ? void 0 : (_valueToItemMap_get = valueToItemMap.get(val)) === null || _valueToItemMap_get === void 0 ? void 0 : _valueToItemMap_get.disabled;
|
|
91
|
+
})
|
|
92
|
+
}
|
|
111
93
|
];
|
|
112
94
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
95
|
+
return value.map(function(value) {
|
|
96
|
+
var _valueToItemMap_get, _valueToItemMap_get1;
|
|
97
|
+
var currentLabel = renderValue ? renderValue(valueToItemMap.get(value) || {
|
|
98
|
+
value: value,
|
|
99
|
+
label: value.toString()
|
|
100
|
+
}) : ((_valueToItemMap_get = valueToItemMap.get(value)) === null || _valueToItemMap_get === void 0 ? void 0 : _valueToItemMap_get.label) || value.toString();
|
|
101
|
+
return {
|
|
102
|
+
value: value,
|
|
103
|
+
label: currentLabel,
|
|
104
|
+
disabled: ((_valueToItemMap_get1 = valueToItemMap.get(value)) === null || _valueToItemMap_get1 === void 0 ? void 0 : _valueToItemMap_get1.disabled) || false
|
|
105
|
+
};
|
|
106
|
+
});
|
|
124
107
|
}
|
|
125
108
|
return [];
|
|
126
109
|
};
|
|
127
110
|
// Обработчик чипов
|
|
128
|
-
var
|
|
111
|
+
var handleChipClick = function(chip) {
|
|
129
112
|
if (!Array.isArray(value)) return;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var resultValues = _to_consumable_array(value);
|
|
134
|
-
value.forEach(function(_, index) {
|
|
113
|
+
if (isTargetAmount) {
|
|
114
|
+
// При закрытии чипа в режиме isTargetAmount в value оставляем только disabled-элементы
|
|
115
|
+
onChange(value.filter(function(val) {
|
|
135
116
|
var _valueToItemMap_get;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
var labelAfterRenderValue = renderValue(label ? labelToItemMap.get(label) : {
|
|
139
|
-
value: stringValue,
|
|
140
|
-
label: stringValue.toString()
|
|
141
|
-
});
|
|
142
|
-
if (!chipLabels.includes(labelAfterRenderValue)) {
|
|
143
|
-
resultValues.splice(index, 1);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
var removedItemValue = getRemovedElement(value, resultValues, isTargetAmount);
|
|
147
|
-
onChange(resultValues, removedItemValue ? valueToItemMap.get(removedItemValue) || {
|
|
148
|
-
value: removedItemValue,
|
|
149
|
-
label: removedItemValue.toString()
|
|
150
|
-
} : null);
|
|
117
|
+
return valueToItemMap === null || valueToItemMap === void 0 ? void 0 : (_valueToItemMap_get = valueToItemMap.get(val)) === null || _valueToItemMap_get === void 0 ? void 0 : _valueToItemMap_get.disabled;
|
|
118
|
+
}));
|
|
151
119
|
} else {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
});
|
|
156
|
-
var removedItemValue1 = getRemovedElement(value, newValues, isTargetAmount);
|
|
157
|
-
var item = removedItemValue1 ? valueToItemMap.get(removedItemValue1) || {
|
|
158
|
-
value: removedItemValue1,
|
|
159
|
-
label: removedItemValue1.toString()
|
|
160
|
-
} : null;
|
|
161
|
-
onChange(newValues, item);
|
|
120
|
+
onChange(value.filter(function(val) {
|
|
121
|
+
return val !== chip.value;
|
|
122
|
+
}), valueToItemMap.get(chip.value) || null);
|
|
162
123
|
}
|
|
163
124
|
};
|
|
164
125
|
var helperTextStopPropagation = function(event) {
|
|
@@ -197,8 +158,8 @@ export var Textfield = /*#__PURE__*/ forwardRef(function(param, ref) {
|
|
|
197
158
|
"aria-activedescendant": activeDescendantItemValue ? getItemId(treeId, activeDescendantItemValue) : ''
|
|
198
159
|
}, multiselect ? {
|
|
199
160
|
enumerationType: 'chip',
|
|
200
|
-
|
|
201
|
-
|
|
161
|
+
_chips: getChips(),
|
|
162
|
+
_onChipClick: handleChipClick,
|
|
202
163
|
chipType: chipType,
|
|
203
164
|
chipView: chipView
|
|
204
165
|
} : {
|
|
@@ -88,7 +88,7 @@ import { StyledContent, StyledDescription, StyledInput, StyledLabel, StyledTrigg
|
|
|
88
88
|
import { classes } from "./Switch.tokens";
|
|
89
89
|
export var switchRoot = function(Root) {
|
|
90
90
|
return /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
91
|
-
var size = props.size, toggleSize = props.toggleSize, view = props.view, focused = props.focused, outlined = props.outlined, disabled = props.disabled, labelPosition = props.labelPosition, label = props.label, description = props.description, id = props.id, style = props.style, className = props.className, // singleLine,
|
|
91
|
+
var size = props.size, toggleSize = props.toggleSize, view = props.view, focused = props.focused, outlined = props.outlined, disabled = props.disabled, labelPosition = props.labelPosition, label = props.label, description = props.description, _props_singleLine = props.singleLine, singleLine = _props_singleLine === void 0 ? true : _props_singleLine, id = props.id, style = props.style, className = props.className, // singleLine,
|
|
92
92
|
checked = props.checked, pressed = props.pressed, defaultChecked = props.defaultChecked, rest = _object_without_properties(props, [
|
|
93
93
|
"size",
|
|
94
94
|
"toggleSize",
|
|
@@ -99,6 +99,7 @@ export var switchRoot = function(Root) {
|
|
|
99
99
|
"labelPosition",
|
|
100
100
|
"label",
|
|
101
101
|
"description",
|
|
102
|
+
"singleLine",
|
|
102
103
|
"id",
|
|
103
104
|
"style",
|
|
104
105
|
"className",
|
|
@@ -128,7 +129,8 @@ export var switchRoot = function(Root) {
|
|
|
128
129
|
defaultChecked: defaultChecked,
|
|
129
130
|
disabled: disabled
|
|
130
131
|
})), /*#__PURE__*/ React.createElement(StyledLabel, {
|
|
131
|
-
tabIndex: -1
|
|
132
|
+
tabIndex: -1,
|
|
133
|
+
className: singleLine ? classes.singleLine : ''
|
|
132
134
|
}, label), /*#__PURE__*/ React.createElement(StyledTrigger, {
|
|
133
135
|
"aria-hidden": true
|
|
134
136
|
})), description && /*#__PURE__*/ React.createElement(StyledDescription, null, description));
|