@salutejs/plasma-new-hope 0.336.0-canary.2228.17672900057.0 → 0.336.0-canary.2228.17762482450.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/Attach/Attach.css +1 -1
- package/cjs/components/Attach/variations/_size/base.js +1 -1
- package/cjs/components/Attach/variations/_size/base.js.map +1 -1
- package/cjs/components/Attach/variations/_size/base_909kyb.css +1 -0
- 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/cjs/components/Pagination/{Pagination.styles_ska0td.css → 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 +36 -29
- package/emotion/cjs/components/Attach/variations/_size/base.js +1 -1
- 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/Combobox/Combobox.js +0 -15
- package/emotion/cjs/examples/components/Pagination/Pagination.config.js +12 -12
- package/emotion/cjs/examples/components/Range/Range.config.js +8 -7
- package/emotion/cjs/examples/components/Tree/Tree.config.js +5 -5
- package/emotion/es/components/Attach/variations/_size/base.js +2 -2
- 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/Range/Range.config.js +8 -7
- package/emotion/es/examples/components/Tree/Tree.config.js +5 -5
- package/es/components/Attach/Attach.css +1 -1
- package/es/components/Attach/variations/_size/base.js +1 -1
- package/es/components/Attach/variations/_size/base.js.map +1 -1
- package/es/components/Attach/variations/_size/base_909kyb.css +1 -0
- 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/es/components/Pagination/{Pagination.styles_ska0td.css → 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 +36 -29
- package/package.json +4 -4
- package/styled-components/cjs/components/Attach/variations/_size/base.js +8 -1
- 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 +0 -15
- package/styled-components/cjs/examples/components/Pagination/Pagination.config.js +18 -11
- package/styled-components/cjs/examples/components/Range/Range.config.js +46 -0
- package/styled-components/cjs/examples/components/Tree/Tree.config.js +6 -2
- package/styled-components/es/components/Attach/variations/_size/base.js +9 -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/Pagination/Pagination.config.js +18 -11
- package/styled-components/es/examples/components/Range/Range.config.js +46 -0
- package/styled-components/es/examples/components/Tree/Tree.config.js +6 -2
- package/types/components/Attach/variations/_size/base.d.ts.map +1 -1
- 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/Range/Range.config.d.ts +1 -0
- package/types/examples/components/Range/Range.config.d.ts.map +1 -1
- package/types/examples/components/Range/Range.d.ts +1 -0
- package/types/examples/components/Range/Range.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/Attach/variations/_size/base_1c6ezmq.css +0 -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/Attach/variations/_size/base_1c6ezmq.css +0 -1
- 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
|
@@ -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));
|
|
@@ -8,7 +8,7 @@ export var base = css([
|
|
|
8
8
|
], tokens.verticalGap);
|
|
9
9
|
export var StyledContent = styled.div.withConfig({
|
|
10
10
|
displayName: "Switch.styles__StyledContent",
|
|
11
|
-
componentId: "sc-
|
|
11
|
+
componentId: "sc-6da706dd-0"
|
|
12
12
|
})([
|
|
13
13
|
"width:100%;position:relative;display:flex;align-items:center;&.",
|
|
14
14
|
"{justify-content:space-between;",
|
|
@@ -20,7 +20,7 @@ export var StyledContent = styled.div.withConfig({
|
|
|
20
20
|
], classes.beforeSwitchLabelPosition, tokens.labelOffsetPrivate, tokens.labelOffset, classes.afterSwitchLabelPosition, tokens.labelOffsetPrivate, tokens.labelOffset);
|
|
21
21
|
export var StyledDescription = styled.div.withConfig({
|
|
22
22
|
displayName: "Switch.styles__StyledDescription",
|
|
23
|
-
componentId: "sc-
|
|
23
|
+
componentId: "sc-6da706dd-1"
|
|
24
24
|
})([
|
|
25
25
|
"position:relative;",
|
|
26
26
|
" display:-webkit-box;line-clamp:var(",
|
|
@@ -29,20 +29,21 @@ export var StyledDescription = styled.div.withConfig({
|
|
|
29
29
|
], applyEllipsis(), tokens.descriptionMaxLines, tokens.descriptionMaxLines);
|
|
30
30
|
export var StyledInput = styled.input.withConfig({
|
|
31
31
|
displayName: "Switch.styles__StyledInput",
|
|
32
|
-
componentId: "sc-
|
|
32
|
+
componentId: "sc-6da706dd-2"
|
|
33
33
|
})([
|
|
34
34
|
"position:absolute;right:0;margin:0;opacity:0;&:focus{outline:0 none;}"
|
|
35
35
|
]);
|
|
36
36
|
export var StyledLabel = styled.span.withConfig({
|
|
37
37
|
displayName: "Switch.styles__StyledLabel",
|
|
38
|
-
componentId: "sc-
|
|
38
|
+
componentId: "sc-6da706dd-3"
|
|
39
39
|
})([
|
|
40
|
-
"user-select:none
|
|
41
|
-
""
|
|
42
|
-
|
|
40
|
+
"user-select:none;&.",
|
|
41
|
+
"{",
|
|
42
|
+
"}"
|
|
43
|
+
], classes.singleLine, applyEllipsis());
|
|
43
44
|
export var StyledTrigger = styled.div.withConfig({
|
|
44
45
|
displayName: "Switch.styles__StyledTrigger",
|
|
45
|
-
componentId: "sc-
|
|
46
|
+
componentId: "sc-6da706dd-4"
|
|
46
47
|
})([
|
|
47
48
|
"position:relative;display:flex;align-items:center;transition:background-color 0.15s ease-in-out 0.1s;::after{content:'';position:absolute;right:auto;left:0;transition:width 0.15s ease-in-out 0s,left 0.3s ease-in-out 0s,right 0.3s ease-in-out 0s;}",
|
|
48
49
|
":checked ~ &::after{right:0;left:auto;}"
|
|
@@ -46,5 +46,6 @@ export var tokens = {
|
|
|
46
46
|
};
|
|
47
47
|
export var classes = {
|
|
48
48
|
beforeSwitchLabelPosition: 'switch-label-position-before',
|
|
49
|
-
afterSwitchLabelPosition: 'switch-label-position-after'
|
|
49
|
+
afterSwitchLabelPosition: 'switch-label-position-after',
|
|
50
|
+
singleLine: 'switch-single-line'
|
|
50
51
|
};
|
|
@@ -115,7 +115,7 @@ import { base as hintSizeCSS } from "./variations/_hint-size/base";
|
|
|
115
115
|
import { base as chipViewCSS } from "./variations/_chip-view/base";
|
|
116
116
|
import { Input, InputContainer, LeftHelper, Label, InputWrapper, InputLabelWrapper, StyledContentLeft, StyledContentRight, StyledChips, StyledTextBefore, StyledTextAfter, StyledIndicator, StyledOptionalText, InputPlaceholder, OuterLabelWrapper, TitleCaption, StyledHintWrapper, StyledIndicatorWrapper, StyledContentRightWrapper } from "./TextField.styles";
|
|
117
117
|
import { classes } from "./TextField.tokens";
|
|
118
|
-
import { TextFieldChip } from "./ui";
|
|
118
|
+
import { TextFieldChip, TextFieldChipNew } from "./ui";
|
|
119
119
|
import { useKeyNavigation } from "./hooks";
|
|
120
120
|
import { HintComponent } from "./ui/Hint/Hint";
|
|
121
121
|
import { getInputWidth } from "./getInputWidth";
|
|
@@ -133,7 +133,9 @@ export var textFieldRoot = function(Root) {
|
|
|
133
133
|
contentLeft = _param.contentLeft, contentRight = _param.contentRight, label = _param.label, labelPlacement = _param.labelPlacement, keepPlaceholder = _param.keepPlaceholder, textBefore = _param.textBefore, textAfter = _param.textAfter, placeholder = _param.placeholder, leftHelper = _param.leftHelper, _param_enumerationType = _param.enumerationType, enumerationType = _param_enumerationType === void 0 ? 'plain' : _param_enumerationType, _param_requiredPlacement = _param.requiredPlacement, requiredPlacement = _param_requiredPlacement === void 0 ? 'right' : _param_requiredPlacement, _param_hasRequiredIndicator = _param.hasRequiredIndicator, hasRequiredIndicator = _param_hasRequiredIndicator === void 0 ? true : _param_hasRequiredIndicator, titleCaption = _param.titleCaption, _param_chipView = _param.chipView, chipView = _param_chipView === void 0 ? 'default' : _param_chipView, chipValidator = _param.chipValidator, _param_hintTrigger = _param.// hint
|
|
134
134
|
hintTrigger, hintTrigger = _param_hintTrigger === void 0 ? 'hover' : _param_hintTrigger, hintText = _param.hintText, _param_hintView = _param.hintView, hintView = _param_hintView === void 0 ? 'default' : _param_hintView, _param_hintSize = _param.hintSize, hintSize = _param_hintSize === void 0 ? 'm' : _param_hintSize, hintTargetIcon = _param.hintTargetIcon, _param_hintTargetPlacement = _param.hintTargetPlacement, hintTargetPlacement = _param_hintTargetPlacement === void 0 ? 'outer' : _param_hintTargetPlacement, _param_hintPlacement = _param.hintPlacement, hintPlacement = _param_hintPlacement === void 0 ? 'auto' : _param_hintPlacement, hintHasArrow = _param.hintHasArrow, _param_hintOffset = _param.hintOffset, hintOffset = _param_hintOffset === void 0 ? HINT_DEFAULT_OFFSET : _param_hintOffset, hintWidth = _param.hintWidth, hintContentLeft = _param.hintContentLeft, // variations
|
|
135
135
|
view = _param.view, size = _param.size, _param_readOnly = _param.readOnly, readOnly = _param_readOnly === void 0 ? false : _param_readOnly, _param_disabled = _param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_required = _param.required, required = _param_required === void 0 ? false : _param_required, _param_clear = _param.clear, clear = _param_clear === void 0 ? false : _param_clear, optional = _param.optional, hasDivider = _param.hasDivider, // controlled
|
|
136
|
-
outerValue = _param.value, values = _param.chips, _param_chipType = _param.chipType, chipType = _param_chipType === void 0 ? 'default' : _param_chipType, //
|
|
136
|
+
outerValue = _param.value, values = _param.chips, _param_chipType = _param.chipType, chipType = _param_chipType === void 0 ? 'default' : _param_chipType, // @ts-ignore
|
|
137
|
+
_chips = _param._chips, // @ts-ignore
|
|
138
|
+
_onChipClick = _param._onChipClick, // events
|
|
137
139
|
onChange = _param.onChange, onChangeChips = _param.onChangeChips, onSearch = _param.onSearch, onKeyDown = _param.onKeyDown, onFocus = _param.onFocus, onBlur = _param.onBlur, onPaste = _param.onPaste, // Пропсы для внутреннего использования, не отдается наружу.
|
|
138
140
|
// @ts-ignore
|
|
139
141
|
_onEnterDisabled = _param._onEnterDisabled, // @ts-ignore
|
|
@@ -178,6 +180,8 @@ export var textFieldRoot = function(Root) {
|
|
|
178
180
|
"value",
|
|
179
181
|
"chips",
|
|
180
182
|
"chipType",
|
|
183
|
+
"_chips",
|
|
184
|
+
"_onChipClick",
|
|
181
185
|
"onChange",
|
|
182
186
|
"onChangeChips",
|
|
183
187
|
"onSearch",
|
|
@@ -209,7 +213,7 @@ export var textFieldRoot = function(Root) {
|
|
|
209
213
|
var helperTextId = safeUseId();
|
|
210
214
|
var isDefaultView = view === 'default' || readOnly || disabled;
|
|
211
215
|
var isChipEnumeration = enumerationType === 'chip';
|
|
212
|
-
var isChipsVisible = isChipEnumeration && Boolean(chips === null || chips === void 0 ? void 0 : chips.length);
|
|
216
|
+
var isChipsVisible = isChipEnumeration && Boolean((chips === null || chips === void 0 ? void 0 : chips.length) || (_chips === null || _chips === void 0 ? void 0 : _chips.length));
|
|
213
217
|
var withHasChips = isChipsVisible ? classes.hasChips : undefined;
|
|
214
218
|
var hasLabelValue = Boolean(label);
|
|
215
219
|
var hasInnerLabel = size !== 'xs' && labelPlacement === 'inner' && !isChipsVisible && hasLabelValue;
|
|
@@ -463,8 +467,20 @@ export var textFieldRoot = function(Root) {
|
|
|
463
467
|
tabIndex: -1,
|
|
464
468
|
ref: contentRef,
|
|
465
469
|
onKeyDown: handleContentKeyDown,
|
|
466
|
-
className: withHasChips
|
|
467
|
-
}, Boolean(textBefore && isChipEnumeration) && /*#__PURE__*/ React.createElement(StyledTextBefore, null, textBefore),
|
|
470
|
+
className: cx(withHasChips, classes.inputScrollableWrapper)
|
|
471
|
+
}, Boolean(textBefore && isChipEnumeration) && /*#__PURE__*/ React.createElement(StyledTextBefore, null, textBefore), Boolean(_chips === null || _chips === void 0 ? void 0 : _chips.length) && /*#__PURE__*/ React.createElement(TextFieldChipNew, {
|
|
472
|
+
chips: _chips,
|
|
473
|
+
onChipClick: _onChipClick,
|
|
474
|
+
getRef: getRef,
|
|
475
|
+
handleChipKeyDown: handleChipKeyDown,
|
|
476
|
+
onChipClear: onChipClear,
|
|
477
|
+
view: chipView || view,
|
|
478
|
+
readOnly: readOnly,
|
|
479
|
+
chipType: chipType,
|
|
480
|
+
// TODO: #1547
|
|
481
|
+
// @ts-ignore
|
|
482
|
+
_forceChipManipulationWithReadonly: _forceChipManipulationWithReadonly
|
|
483
|
+
}), isChipEnumeration && Boolean(chips === null || chips === void 0 ? void 0 : chips.length) && /*#__PURE__*/ React.createElement(StyledChips, {
|
|
468
484
|
className: classes.chipsWrapper
|
|
469
485
|
}, chips === null || chips === void 0 ? void 0 : chips.map(function(param, index) {
|
|
470
486
|
var chipId = param.id, text = param.text;
|
|
@@ -15,6 +15,7 @@ export var classes = {
|
|
|
15
15
|
textFieldGroupItem: 'text-field-group-item',
|
|
16
16
|
requiredAlignRight: 'required-align-right',
|
|
17
17
|
inputWrapper: 'input-wrapper',
|
|
18
|
+
inputScrollableWrapper: 'input-scrollable-wrapper',
|
|
18
19
|
inputTextEllipsis: 'textfield-input-text-ellipsis',
|
|
19
20
|
contentRightCompensationMargin: 'textfield-content-right-compensation-margin',
|
|
20
21
|
readOnlyInput: 'textfield-readonly-input'
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TextChip } from "../TextFieldChip/TextFieldChip.styles";
|
|
3
|
+
import { StyledChips } from "../../TextField.styles";
|
|
4
|
+
import { classes } from "../../TextField.tokens";
|
|
5
|
+
import { StyledChip } from "./TextFieldChipNew.styles";
|
|
6
|
+
export var TextFieldChipNew = function(param) {
|
|
7
|
+
var chips = param.chips, onChipClick = param.onChipClick, getRef = param.getRef, handleChipKeyDown = param.handleChipKeyDown, onChipClear = param.onChipClear, readOnly = param.readOnly, chipType = param.chipType, view = param.view, _forceChipManipulationWithReadonly = param._forceChipManipulationWithReadonly;
|
|
8
|
+
return /*#__PURE__*/ React.createElement(StyledChips, {
|
|
9
|
+
className: classes.chipsWrapper
|
|
10
|
+
}, chips.map(function(param, index) {
|
|
11
|
+
var value = param.value, label = param.label, disabled = param.disabled;
|
|
12
|
+
var chipId = "".concat(index, "_").concat(value);
|
|
13
|
+
var onKeyDownHandle = function(event) {
|
|
14
|
+
if (handleChipKeyDown) {
|
|
15
|
+
handleChipKeyDown(event, chipId, index);
|
|
16
|
+
}
|
|
17
|
+
if (event.key === 'Enter' || event.key === 'Backspace') {
|
|
18
|
+
if (onChipClick) {
|
|
19
|
+
onChipClick({
|
|
20
|
+
value: value,
|
|
21
|
+
label: label,
|
|
22
|
+
disabled: disabled
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var handleClick = function(event) {
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
if (onChipClick) {
|
|
30
|
+
onChipClick({
|
|
31
|
+
value: value,
|
|
32
|
+
label: label,
|
|
33
|
+
disabled: disabled
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (onChipClear) {
|
|
37
|
+
onChipClear(chipId, index);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
return chipType === 'default' ? /*#__PURE__*/ React.createElement(StyledChip, {
|
|
41
|
+
key: chipId,
|
|
42
|
+
ref: function(element) {
|
|
43
|
+
return getRef(element, index);
|
|
44
|
+
},
|
|
45
|
+
tabIndex: -1,
|
|
46
|
+
disabled: disabled,
|
|
47
|
+
hasClear: !disabled,
|
|
48
|
+
readOnly: readOnly,
|
|
49
|
+
onClick: handleClick,
|
|
50
|
+
onKeyDown: onKeyDownHandle,
|
|
51
|
+
text: label,
|
|
52
|
+
view: view,
|
|
53
|
+
// TODO: #1547
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
_forceChipManipulationWithReadonly: _forceChipManipulationWithReadonly
|
|
57
|
+
}) : /*#__PURE__*/ React.createElement(TextChip, {
|
|
58
|
+
tabIndex: -1,
|
|
59
|
+
onClick: handleClick,
|
|
60
|
+
onKeyDown: onKeyDownHandle
|
|
61
|
+
}, label);
|
|
62
|
+
}));
|
|
63
|
+
};
|