@salutejs/plasma-new-hope 0.336.0-canary.2163.17485485502.0 → 0.336.0-canary.2163.17602400013.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/Combobox/ComboboxNew/Combobox.css +6 -6
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +30 -24
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.styles.js +3 -4
- package/cjs/components/Combobox/ComboboxNew/Combobox.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/{Combobox.styles_isfa46.css → Combobox.styles_261unw.css} +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +3 -7
- package/cjs/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +6 -6
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.js +11 -5
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.css +2 -2
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +2 -2
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +2 -2
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +2 -2
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +2 -2
- package/cjs/components/Drawer/hooks/useDrawer.js +12 -0
- package/cjs/components/Drawer/hooks/useDrawer.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.css +2 -2
- package/cjs/components/Dropdown/Dropdown.js +6 -10
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles.js +2 -9
- package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
- package/cjs/components/Dropdown/{Dropdown.styles_zheit5.css → Dropdown.styles_kkvnr1.css} +1 -1
- package/cjs/components/Dropdown/FloatingPopover.js +22 -40
- package/cjs/components/Dropdown/FloatingPopover.js.map +1 -1
- package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +3 -7
- package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.css +2 -2
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +9 -9
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Pagination/Pagination.css +14 -14
- package/cjs/components/Pagination/Pagination.js +40 -13
- package/cjs/components/Pagination/Pagination.js.map +1 -1
- package/cjs/components/Pagination/Pagination.styles.js +1 -1
- package/cjs/components/Pagination/Pagination.styles.js.map +1 -1
- package/{es/components/Pagination/Pagination.styles_12nltx1.css → cjs/components/Pagination/Pagination.styles_qs9qeo.css} +5 -5
- package/cjs/components/Pagination/Pagination.tokens.js +1 -0
- package/cjs/components/Pagination/Pagination.tokens.js.map +1 -1
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +5 -5
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js.map +1 -1
- package/{es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles_1hn2h4g.css → cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles_10zfeps.css} +1 -1
- package/cjs/components/Select/Select.css +2 -2
- package/cjs/components/Select/Select.js +12 -4
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/Select.styles.js +3 -4
- package/cjs/components/Select/Select.styles.js.map +1 -1
- package/cjs/components/Select/{Select.styles_bjoo18.css → Select.styles_dta4dl.css} +1 -1
- package/cjs/components/Select/hooks/useKeyboardNavigation.js +3 -7
- package/cjs/components/Select/hooks/useKeyboardNavigation.js.map +1 -1
- package/cjs/components/Select/ui/Inner/Inner.css +2 -2
- package/cjs/components/Select/ui/Inner/Inner.js +11 -5
- package/cjs/components/Select/ui/Inner/Inner.js.map +1 -1
- package/cjs/components/Table/Table.css +2 -2
- package/cjs/components/Table/ui/Cell/Cell.css +2 -2
- package/cjs/components/Table/ui/EditableCell/EditableCell.css +2 -2
- package/cjs/components/Table/ui/HeadCell/HeadCell.css +2 -2
- package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.css +2 -2
- package/cjs/index.css +22 -22
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +26 -23
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.styles.js +16 -16
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +3 -7
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.js +50 -9
- package/emotion/cjs/components/Drawer/hooks/useDrawer.js +11 -0
- package/emotion/cjs/components/Dropdown/Dropdown.js +6 -10
- package/emotion/cjs/components/Dropdown/Dropdown.styles.js +5 -8
- package/emotion/cjs/components/Dropdown/FloatingPopover.js +23 -47
- package/emotion/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +3 -7
- package/emotion/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +48 -11
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/emotion/cjs/components/Pagination/Pagination.js +35 -12
- package/emotion/cjs/components/Pagination/Pagination.styles.js +18 -18
- package/emotion/cjs/components/Pagination/Pagination.tokens.js +1 -0
- package/emotion/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +6 -6
- package/emotion/cjs/components/Select/Select.js +10 -3
- package/emotion/cjs/components/Select/Select.styles.js +8 -8
- package/emotion/cjs/components/Select/hooks/useKeyboardNavigation.js +3 -7
- package/emotion/cjs/components/Select/ui/Inner/Inner.js +50 -9
- package/emotion/cjs/examples/components/Combobox/Combobox.js +15 -0
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +26 -23
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.styles.js +16 -16
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -1
- package/emotion/es/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +3 -7
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/Inner.js +11 -6
- package/emotion/es/components/Drawer/hooks/useDrawer.js +11 -0
- package/emotion/es/components/Dropdown/Dropdown.js +6 -10
- package/emotion/es/components/Dropdown/Dropdown.styles.js +5 -8
- package/emotion/es/components/Dropdown/FloatingPopover.js +24 -48
- package/emotion/es/components/Dropdown/hooks/useKeyboardNavigation.js +3 -7
- package/emotion/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +9 -8
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/emotion/es/components/Pagination/Pagination.js +35 -12
- package/emotion/es/components/Pagination/Pagination.styles.js +19 -19
- package/emotion/es/components/Pagination/Pagination.tokens.js +1 -0
- package/emotion/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +6 -6
- package/emotion/es/components/Select/Select.js +10 -3
- package/emotion/es/components/Select/Select.styles.js +8 -8
- package/emotion/es/components/Select/hooks/useKeyboardNavigation.js +3 -7
- package/emotion/es/components/Select/ui/Inner/Inner.js +11 -6
- package/es/components/Combobox/ComboboxNew/Combobox.css +6 -6
- package/es/components/Combobox/ComboboxNew/Combobox.js +30 -24
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.styles.js +3 -4
- package/es/components/Combobox/ComboboxNew/Combobox.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/{Combobox.styles_isfa46.css → Combobox.styles_261unw.css} +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.tokens.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +3 -7
- package/es/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +6 -6
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.js +12 -6
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.css +2 -2
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +2 -2
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +2 -2
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +2 -2
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +2 -2
- package/es/components/Drawer/hooks/useDrawer.js +12 -0
- package/es/components/Drawer/hooks/useDrawer.js.map +1 -1
- package/es/components/Dropdown/Dropdown.css +2 -2
- package/es/components/Dropdown/Dropdown.js +6 -10
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles.js +2 -9
- package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
- package/es/components/Dropdown/{Dropdown.styles_zheit5.css → Dropdown.styles_kkvnr1.css} +1 -1
- package/es/components/Dropdown/FloatingPopover.js +24 -42
- package/es/components/Dropdown/FloatingPopover.js.map +1 -1
- package/es/components/Dropdown/hooks/useKeyboardNavigation.js +3 -7
- package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.css +2 -2
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +10 -10
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Pagination/Pagination.css +14 -14
- package/es/components/Pagination/Pagination.js +40 -13
- package/es/components/Pagination/Pagination.js.map +1 -1
- package/es/components/Pagination/Pagination.styles.js +1 -1
- package/es/components/Pagination/Pagination.styles.js.map +1 -1
- package/{cjs/components/Pagination/Pagination.styles_12nltx1.css → es/components/Pagination/Pagination.styles_qs9qeo.css} +5 -5
- package/es/components/Pagination/Pagination.tokens.js +1 -0
- package/es/components/Pagination/Pagination.tokens.js.map +1 -1
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +5 -5
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js.map +1 -1
- package/{cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles_1hn2h4g.css → es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles_10zfeps.css} +1 -1
- package/es/components/Select/Select.css +2 -2
- package/es/components/Select/Select.js +12 -4
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/Select.styles.js +3 -4
- package/es/components/Select/Select.styles.js.map +1 -1
- package/es/components/Select/{Select.styles_bjoo18.css → Select.styles_dta4dl.css} +1 -1
- package/es/components/Select/hooks/useKeyboardNavigation.js +3 -7
- package/es/components/Select/hooks/useKeyboardNavigation.js.map +1 -1
- package/es/components/Select/ui/Inner/Inner.css +2 -2
- package/es/components/Select/ui/Inner/Inner.js +12 -6
- package/es/components/Select/ui/Inner/Inner.js.map +1 -1
- package/es/components/Table/Table.css +2 -2
- package/es/components/Table/ui/Cell/Cell.css +2 -2
- package/es/components/Table/ui/EditableCell/EditableCell.css +2 -2
- package/es/components/Table/ui/HeadCell/HeadCell.css +2 -2
- package/es/components/Table/ui/HeadCell/ui/Filter/Filter.css +2 -2
- package/es/index.css +22 -22
- package/package.json +5 -5
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +26 -23
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.styles.js +9 -9
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -1
- package/styled-components/cjs/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +3 -7
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.js +50 -9
- package/styled-components/cjs/components/Drawer/hooks/useDrawer.js +11 -0
- package/styled-components/cjs/components/Dropdown/Dropdown.js +6 -10
- package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +3 -7
- package/styled-components/cjs/components/Dropdown/FloatingPopover.js +23 -47
- package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +3 -7
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +48 -11
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/styled-components/cjs/components/Pagination/Pagination.js +35 -12
- package/styled-components/cjs/components/Pagination/Pagination.styles.js +24 -19
- package/styled-components/cjs/components/Pagination/Pagination.tokens.js +1 -0
- package/styled-components/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +4 -4
- package/styled-components/cjs/components/Select/Select.js +10 -3
- package/styled-components/cjs/components/Select/Select.styles.js +5 -5
- package/styled-components/cjs/components/Select/hooks/useKeyboardNavigation.js +3 -7
- package/styled-components/cjs/components/Select/ui/Inner/Inner.js +50 -9
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +26 -23
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.styles.js +9 -9
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -1
- package/styled-components/es/components/Combobox/ComboboxNew/hooks/useKeyboardNavigation.js +3 -7
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/Inner.js +11 -6
- package/styled-components/es/components/Drawer/hooks/useDrawer.js +11 -0
- package/styled-components/es/components/Dropdown/Dropdown.js +6 -10
- package/styled-components/es/components/Dropdown/Dropdown.styles.js +3 -7
- package/styled-components/es/components/Dropdown/FloatingPopover.js +24 -48
- package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +3 -7
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +9 -8
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/styled-components/es/components/Pagination/Pagination.js +35 -12
- package/styled-components/es/components/Pagination/Pagination.styles.js +25 -20
- package/styled-components/es/components/Pagination/Pagination.tokens.js +1 -0
- package/styled-components/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +4 -4
- package/styled-components/es/components/Select/Select.js +10 -3
- package/styled-components/es/components/Select/Select.styles.js +5 -5
- package/styled-components/es/components/Select/hooks/useKeyboardNavigation.js +3 -7
- package/styled-components/es/components/Select/ui/Inner/Inner.js +11 -6
- package/styled-components/es/examples/components/Combobox/Combobox.js +7 -0
- package/types/components/Autocomplete/Autocomplete.types.d.ts +6 -6
- package/types/components/Autocomplete/Autocomplete.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.styles.d.ts +0 -1
- package/types/components/Combobox/ComboboxNew/Combobox.styles.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.tokens.d.ts +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +13 -6
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/Inner.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/Inner.type.d.ts +2 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/Inner.type.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.types.d.ts +6 -2
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.types.d.ts.map +1 -1
- package/types/components/Drawer/hooks/useDrawer.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts +6 -6
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts +0 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.types.d.ts +9 -9
- package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/types/components/Dropdown/FloatingPopover.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +2 -3
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +7 -3
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
- package/types/components/Pagination/Pagination.d.ts.map +1 -1
- package/types/components/Pagination/Pagination.styles.d.ts.map +1 -1
- package/types/components/Pagination/Pagination.tokens.d.ts +1 -0
- package/types/components/Pagination/Pagination.tokens.d.ts.map +1 -1
- package/types/components/Pagination/Pagination.types.d.ts +80 -0
- package/types/components/Pagination/Pagination.types.d.ts.map +1 -1
- package/types/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.d.ts +12 -6
- package/types/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/Select/Select.styles.d.ts +0 -1
- package/types/components/Select/Select.styles.d.ts.map +1 -1
- package/types/components/Select/Select.types.d.ts +24 -10
- package/types/components/Select/Select.types.d.ts.map +1 -1
- package/types/components/Select/ui/Inner/Inner.d.ts.map +1 -1
- package/types/components/Select/ui/Inner/Inner.type.d.ts +2 -1
- package/types/components/Select/ui/Inner/Inner.type.d.ts.map +1 -1
- package/types/components/Select/ui/Inner/ui/Item/Item.types.d.ts +11 -3
- package/types/components/Select/ui/Inner/ui/Item/Item.types.d.ts.map +1 -1
- package/types/components/Table/ui/HeadCell/ui/Filter/Filter.styles.d.ts +12 -6
- package/types/components/Table/ui/HeadCell/ui/Filter/Filter.styles.d.ts.map +1 -1
- package/types/examples/components/Autocomplete/Autocomplete.d.ts +40 -40
- package/types/examples/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/examples/components/Combobox/Combobox.d.ts +48 -24
- package/types/examples/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/examples/components/Dropdown/Dropdown.d.ts +3 -3
- package/types/examples/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/examples/components/Select/Select.d.ts +12 -6
- package/types/examples/components/Select/Select.d.ts.map +1 -1
@@ -8,18 +8,54 @@ Object.defineProperty(exports, "Inner", {
|
|
8
8
|
return Inner;
|
9
9
|
}
|
10
10
|
});
|
11
|
-
var _react = /*#__PURE__*/
|
11
|
+
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
12
12
|
var _utils = require("../../../../utils");
|
13
13
|
var _Selectstyles = require("../../Select.styles");
|
14
14
|
var _FloatingPopover = require("../../FloatingPopover");
|
15
15
|
var _Item = require("./ui/Item/Item");
|
16
|
-
function
|
17
|
-
|
18
|
-
|
16
|
+
function _getRequireWildcardCache(nodeInterop) {
|
17
|
+
if (typeof WeakMap !== "function") return null;
|
18
|
+
var cacheBabelInterop = new WeakMap();
|
19
|
+
var cacheNodeInterop = new WeakMap();
|
20
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
21
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
22
|
+
})(nodeInterop);
|
23
|
+
}
|
24
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
25
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
26
|
+
return obj;
|
27
|
+
}
|
28
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
29
|
+
return {
|
30
|
+
default: obj
|
31
|
+
};
|
32
|
+
}
|
33
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
34
|
+
if (cache && cache.has(obj)) {
|
35
|
+
return cache.get(obj);
|
36
|
+
}
|
37
|
+
var newObj = {
|
38
|
+
__proto__: null
|
19
39
|
};
|
40
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
41
|
+
for(var key in obj){
|
42
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
43
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
44
|
+
if (desc && (desc.get || desc.set)) {
|
45
|
+
Object.defineProperty(newObj, key, desc);
|
46
|
+
} else {
|
47
|
+
newObj[key] = obj[key];
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
newObj.default = obj;
|
52
|
+
if (cache) {
|
53
|
+
cache.set(obj, newObj);
|
54
|
+
}
|
55
|
+
return newObj;
|
20
56
|
}
|
21
57
|
var Inner = function(param) {
|
22
|
-
var item = param.item, currentLevel = param.currentLevel, path = param.path, dispatchPath = param.dispatchPath, index = param.index, listWidth = param.listWidth;
|
58
|
+
var item = param.item, currentLevel = param.currentLevel, path = param.path, dispatchPath = param.dispatchPath, index = param.index, listWidth = param.listWidth, portal = param.portal;
|
23
59
|
var handleToggle = function(opened) {
|
24
60
|
if (opened) {
|
25
61
|
dispatchPath({
|
@@ -34,6 +70,7 @@ var Inner = function(param) {
|
|
34
70
|
});
|
35
71
|
}
|
36
72
|
};
|
73
|
+
var listWrapperRef = (0, _react.useRef)(null);
|
37
74
|
var isCurrentListOpen = path[currentLevel + 1] === item.value.toString();
|
38
75
|
var treeId = (0, _utils.safeUseId)();
|
39
76
|
var listId = "".concat(treeId, "_tree_level_").concat(currentLevel + 2);
|
@@ -54,13 +91,16 @@ var Inner = function(param) {
|
|
54
91
|
ariaLevel: nextLevel,
|
55
92
|
ariaLabel: item.label
|
56
93
|
}),
|
57
|
-
isInner: true
|
94
|
+
isInner: true,
|
95
|
+
portal: portal
|
58
96
|
}, /*#__PURE__*/ _react.default.createElement(_Selectstyles.ListWrapper, {
|
59
|
-
listWidth: listWidth
|
97
|
+
listWidth: listWidth,
|
98
|
+
ref: listWrapperRef
|
60
99
|
}, /*#__PURE__*/ _react.default.createElement(_Selectstyles.Ul, {
|
61
100
|
role: "group",
|
62
101
|
id: listId,
|
63
|
-
virtual: false
|
102
|
+
virtual: false,
|
103
|
+
listMaxHeight: item === null || item === void 0 ? void 0 : item.listMaxHeight
|
64
104
|
}, (_item_items = item.items) === null || _item_items === void 0 ? void 0 : _item_items.map(function(innerItem, innerIndex) {
|
65
105
|
return /*#__PURE__*/ _react.default.createElement(Inner, {
|
66
106
|
key: "".concat(innerIndex, "/").concat(currentLevel),
|
@@ -69,7 +109,8 @@ var Inner = function(param) {
|
|
69
109
|
path: path,
|
70
110
|
dispatchPath: dispatchPath,
|
71
111
|
index: innerIndex,
|
72
|
-
listWidth: listWidth
|
112
|
+
listWidth: listWidth,
|
113
|
+
portal: listWrapperRef
|
73
114
|
});
|
74
115
|
}))));
|
75
116
|
}
|
@@ -161,7 +161,7 @@ import { Context } from "./Combobox.context";
|
|
161
161
|
*/ export var comboboxRoot = function(Root) {
|
162
162
|
return /*#__PURE__*/ forwardRef(function(props, ref) {
|
163
163
|
var _getItemByFocused;
|
164
|
-
var name = props.name, multiple = props.multiple, outerValue = props.value, outerOnChange = props.onChange, defaultValue = props.defaultValue, isTargetAmount = props.isTargetAmount, targetAmount = props.targetAmount, items = props.items, _props_placement = props.placement, placement = _props_placement === void 0 ? 'bottom-start' : _props_placement, label = props.label, placeholder = props.placeholder, helperText = props.helperText, contentLeft = props.contentLeft, textBefore = props.textBefore, textAfter = props.textAfter, _props_variant = props.variant, variant = _props_variant === void 0 ? 'normal' : _props_variant, listOverflow = props.listOverflow, listHeight = props.listHeight, listMaxHeight = props.listMaxHeight, listWidth = props.listWidth, portal = props.portal, renderItem = props.renderItem, view = props.view, size = props.size, labelPlacement = props.labelPlacement, keepPlaceholder = props.keepPlaceholder, _props_readOnly = props.readOnly, readOnly = _props_readOnly === void 0 ? false : _props_readOnly, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, _props_alwaysOpened = props.alwaysOpened, alwaysOpened = _props_alwaysOpened === void 0 ? false : _props_alwaysOpened, filter = props.filter, outerCloseAfterSelect = props.closeAfterSelect, renderValue = props.renderValue, zIndex = props.zIndex, beforeList = props.beforeList, afterList = props.afterList, _props_virtual = props.virtual, virtual = _props_virtual === void 0 ? false : _props_virtual, hintView = props.hintView, hintSize = props.hintSize, emptyStateDescription = props.emptyStateDescription, onChangeValue = props.onChangeValue, onScroll = props.onScroll, onToggle = props.onToggle, // @ts-ignore
|
164
|
+
var name = props.name, multiple = props.multiple, outerValue = props.value, outerOnChange = props.onChange, defaultValue = props.defaultValue, isTargetAmount = props.isTargetAmount, targetAmount = props.targetAmount, items = props.items, _props_placement = props.placement, placement = _props_placement === void 0 ? 'bottom-start' : _props_placement, label = props.label, placeholder = props.placeholder, helperText = props.helperText, contentLeft = props.contentLeft, textBefore = props.textBefore, textAfter = props.textAfter, _props_variant = props.variant, variant = _props_variant === void 0 ? 'normal' : _props_variant, listOverflow = props.listOverflow, listHeight = props.listHeight, listMaxHeight = props.listMaxHeight, listWidth = props.listWidth, portal = props.portal, renderItem = props.renderItem, view = props.view, size = props.size, labelPlacement = props.labelPlacement, keepPlaceholder = props.keepPlaceholder, _props_readOnly = props.readOnly, readOnly = _props_readOnly === void 0 ? false : _props_readOnly, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, _props_alwaysOpened = props.alwaysOpened, alwaysOpened = _props_alwaysOpened === void 0 ? false : _props_alwaysOpened, filter = props.filter, outerCloseAfterSelect = props.closeAfterSelect, renderValue = props.renderValue, zIndex = props.zIndex, beforeList = props.beforeList, afterList = props.afterList, _props_virtual = props.virtual, virtual = _props_virtual === void 0 ? false : _props_virtual, hintView = props.hintView, hintSize = props.hintSize, emptyStateDescription = props.emptyStateDescription, onChangeValue = props.onChangeValue, onScroll = props.onScroll, onToggle = props.onToggle, _props_mode = props.mode, mode = _props_mode === void 0 ? 'default' : _props_mode, // @ts-ignore
|
165
165
|
_offset = props._offset, rest = _object_without_properties(props, [
|
166
166
|
"name",
|
167
167
|
"multiple",
|
@@ -205,6 +205,7 @@ import { Context } from "./Combobox.context";
|
|
205
205
|
"onChangeValue",
|
206
206
|
"onScroll",
|
207
207
|
"onToggle",
|
208
|
+
"mode",
|
208
209
|
"_offset"
|
209
210
|
]);
|
210
211
|
var transformedItems = useMemo(function() {
|
@@ -225,6 +226,7 @@ import { Context } from "./Combobox.context";
|
|
225
226
|
var floatingPopoverRef = useRef(null);
|
226
227
|
var inputForkRef = useForkRef(inputRef, ref);
|
227
228
|
var treeId = safeUseId();
|
229
|
+
var listWrapperRef = useRef(null);
|
228
230
|
var filteredItems = useMemo(function() {
|
229
231
|
return filterItems(transformedItems, textValue, getTextValue(multiple, value, valueToItemMap, renderValue), filter);
|
230
232
|
}, [
|
@@ -285,22 +287,10 @@ import { Context } from "./Combobox.context";
|
|
285
287
|
setInternalValue(newValue);
|
286
288
|
}
|
287
289
|
};
|
288
|
-
var handleClickArrow = function() {
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
if (isCurrentListOpen) {
|
293
|
-
dispatchPath({
|
294
|
-
type: 'reset'
|
295
|
-
});
|
296
|
-
} else {
|
297
|
-
dispatchPath({
|
298
|
-
type: 'opened_first_level'
|
299
|
-
});
|
300
|
-
}
|
301
|
-
dispatchFocusedPath({
|
302
|
-
type: 'reset'
|
303
|
-
});
|
290
|
+
var handleClickArrow = function(e) {
|
291
|
+
handleListToggle(!isCurrentListOpen);
|
292
|
+
// При клике на иконку закрытия фокус не должен становиться в инпут.
|
293
|
+
e.stopPropagation();
|
304
294
|
};
|
305
295
|
// Обработчик изменения значения в инпуте
|
306
296
|
var handleTextValueChange = function(e) {
|
@@ -433,10 +423,20 @@ import { Context } from "./Combobox.context";
|
|
433
423
|
type: 'reset'
|
434
424
|
});
|
435
425
|
}
|
426
|
+
// Закрываем список, если элемент уже выбран.
|
427
|
+
if (mode === 'radio' && isCurrentChecked) {
|
428
|
+
return;
|
429
|
+
}
|
436
430
|
if (onChange) {
|
437
431
|
onChange(isCurrentChecked ? '' : item.value, item);
|
438
432
|
}
|
439
433
|
};
|
434
|
+
// Обработчик клика на таргет
|
435
|
+
var handleTargetClick = function() {
|
436
|
+
if (!isCurrentListOpen) {
|
437
|
+
handleListToggle(true);
|
438
|
+
}
|
439
|
+
};
|
440
440
|
var getChips = function() {
|
441
441
|
if (multiple && Array.isArray(value)) {
|
442
442
|
if (value.length === 0) return [];
|
@@ -569,13 +569,14 @@ import { Context } from "./Combobox.context";
|
|
569
569
|
}, /*#__PURE__*/ React.createElement(FloatingPopover, {
|
570
570
|
ref: floatingPopoverRef,
|
571
571
|
opened: isCurrentListOpen,
|
572
|
-
onToggle: handleListToggle,
|
573
572
|
placement: placement,
|
574
573
|
portal: portal,
|
575
574
|
listWidth: listWidth,
|
576
575
|
offset: _offset,
|
577
576
|
target: function(referenceRef) {
|
578
|
-
return /*#__PURE__*/ React.createElement(
|
577
|
+
return /*#__PURE__*/ React.createElement("div", {
|
578
|
+
onClick: handleTargetClick
|
579
|
+
}, /*#__PURE__*/ React.createElement(StyledTextField, _object_spread_props(_object_spread({
|
579
580
|
ref: name ? inputRef : inputForkRef,
|
580
581
|
inputWrapperRef: referenceRef,
|
581
582
|
value: textValue,
|
@@ -589,7 +590,8 @@ import { Context } from "./Combobox.context";
|
|
589
590
|
contentLeft: contentLeft,
|
590
591
|
contentRight: /*#__PURE__*/ React.createElement(IconArrowWrapper, {
|
591
592
|
disabled: disabled,
|
592
|
-
onClick: handleClickArrow
|
593
|
+
onClick: handleClickArrow,
|
594
|
+
className: classes.comboboxTargetArrow
|
593
595
|
}, /*#__PURE__*/ React.createElement(StyledArrow, {
|
594
596
|
color: "inherit",
|
595
597
|
size: sizeToIconSize(size),
|
@@ -616,7 +618,7 @@ import { Context } from "./Combobox.context";
|
|
616
618
|
enumerationType: 'plain'
|
617
619
|
}, rest), {
|
618
620
|
_onEnterDisabled: true // Пропс для отключения обработчика Enter внутри Textfield
|
619
|
-
}));
|
621
|
+
})));
|
620
622
|
},
|
621
623
|
zIndex: zIndex,
|
622
624
|
isInner: false
|
@@ -628,6 +630,7 @@ import { Context } from "./Combobox.context";
|
|
628
630
|
readOnly: readOnly,
|
629
631
|
name: name
|
630
632
|
}, /*#__PURE__*/ React.createElement(ListWrapper, {
|
633
|
+
ref: listWrapperRef,
|
631
634
|
listWidth: listWidth
|
632
635
|
}, /*#__PURE__*/ React.createElement(Ul, {
|
633
636
|
role: "tree",
|
@@ -636,7 +639,6 @@ import { Context } from "./Combobox.context";
|
|
636
639
|
listMaxHeight: listMaxHeight || listHeight,
|
637
640
|
ref: targetRef,
|
638
641
|
virtual: virtual,
|
639
|
-
listOverflow: listOverflow,
|
640
642
|
onScroll: virtual ? undefined : onScroll
|
641
643
|
}, beforeList, isEmpty(filteredItems) ? /*#__PURE__*/ React.createElement(StyledEmptyState, {
|
642
644
|
className: classes.emptyStateWrapper,
|
@@ -658,7 +660,8 @@ import { Context } from "./Combobox.context";
|
|
658
660
|
path: path,
|
659
661
|
dispatchPath: dispatchPath,
|
660
662
|
index: index,
|
661
|
-
listWidth: listWidth
|
663
|
+
listWidth: listWidth,
|
664
|
+
portal: listWrapperRef
|
662
665
|
});
|
663
666
|
})), afterList)))))));
|
664
667
|
});
|
@@ -8,7 +8,7 @@ var mergedConfig = mergeConfig(emptyStateConfig);
|
|
8
8
|
var EmptyState = component(mergedConfig);
|
9
9
|
export var ListWrapper = styled.div.withConfig({
|
10
10
|
displayName: "Combobox.styles__ListWrapper",
|
11
|
-
componentId: "sc-
|
11
|
+
componentId: "sc-21c5f0bf-0"
|
12
12
|
})([
|
13
13
|
"width:",
|
14
14
|
";padding:calc(var(",
|
@@ -25,10 +25,10 @@ export var ListWrapper = styled.div.withConfig({
|
|
25
25
|
}, tokens.padding, tokens.dropdownBorderWidth, tokens.borderRadius, constants.background, constants.boxShadow, tokens.dropdownBorderWidth, tokens.dropdownBorderColor);
|
26
26
|
export var Ul = styled.ul.withConfig({
|
27
27
|
displayName: "Combobox.styles__Ul",
|
28
|
-
componentId: "sc-
|
28
|
+
componentId: "sc-21c5f0bf-1"
|
29
29
|
})([
|
30
30
|
"max-height:",
|
31
|
-
";overflow-y:",
|
31
|
+
";overflow-x:hidden;overflow-y:",
|
32
32
|
";border-radius:calc(var(",
|
33
33
|
") - 0.125rem - var(",
|
34
34
|
",0rem));margin:0;padding:0;.",
|
@@ -37,12 +37,12 @@ export var Ul = styled.ul.withConfig({
|
|
37
37
|
var virtual = param.virtual, listMaxHeight = param.listMaxHeight;
|
38
38
|
return virtual ? 'auto' : listMaxHeight || 'auto';
|
39
39
|
}, function(param) {
|
40
|
-
var virtual = param.virtual
|
41
|
-
return virtual ? 'visible' :
|
40
|
+
var virtual = param.virtual;
|
41
|
+
return virtual ? 'visible' : 'auto';
|
42
42
|
}, tokens.borderRadius, tokens.dropdownBorderWidth, classes.emptyStateWrapper);
|
43
43
|
export var IconArrowWrapper = styled.div.withConfig({
|
44
44
|
displayName: "Combobox.styles__IconArrowWrapper",
|
45
|
-
componentId: "sc-
|
45
|
+
componentId: "sc-21c5f0bf-2"
|
46
46
|
})([
|
47
47
|
"line-height:0;color:var(",
|
48
48
|
");cursor:",
|
@@ -63,7 +63,7 @@ export var sizeMap = {
|
|
63
63
|
};
|
64
64
|
export var StyledArrow = styled(IconDisclosureDownCentered).withConfig({
|
65
65
|
displayName: "Combobox.styles__StyledArrow",
|
66
|
-
componentId: "sc-
|
66
|
+
componentId: "sc-21c5f0bf-3"
|
67
67
|
})([
|
68
68
|
"width:",
|
69
69
|
";height:",
|
@@ -80,7 +80,7 @@ export var base = css([
|
|
80
80
|
]);
|
81
81
|
export var StyledEmptyState = styled(EmptyState).withConfig({
|
82
82
|
displayName: "Combobox.styles__StyledEmptyState",
|
83
|
-
componentId: "sc-
|
83
|
+
componentId: "sc-21c5f0bf-4"
|
84
84
|
})([
|
85
85
|
"",
|
86
86
|
":var(",
|
@@ -102,7 +102,7 @@ export var StyledEmptyState = styled(EmptyState).withConfig({
|
|
102
102
|
], emptyStateTokens.borderRadius, tokens.textFieldBorderRadius, emptyStateTokens.padding, tokens.emptyStatePadding, emptyStateTokens.fontFamily, tokens.textFieldFontFamily, emptyStateTokens.fontSize, tokens.textFieldFontSize, emptyStateTokens.fontStyle, tokens.textFieldFontStyle, emptyStateTokens.fontWeight, tokens.textFieldFontWeight, emptyStateTokens.fontLetterSpacing, tokens.textFieldLetterSpacing, emptyStateTokens.fontLineHeight, tokens.textFieldLineHeight);
|
103
103
|
export var StyledLeftHelper = styled.span.withConfig({
|
104
104
|
displayName: "Combobox.styles__StyledLeftHelper",
|
105
|
-
componentId: "sc-
|
105
|
+
componentId: "sc-21c5f0bf-5"
|
106
106
|
})([
|
107
107
|
"margin:0;padding:0;"
|
108
108
|
]);
|
@@ -2,7 +2,7 @@ export var classes = {
|
|
2
2
|
dropdownItemIsFocused: 'dropdown-item-is-focused',
|
3
3
|
dropdownItemIsDisabled: 'dropdown-item-is-disabled',
|
4
4
|
dropdownItemIsActive: 'dropdown-item-is-active',
|
5
|
-
|
5
|
+
comboboxTargetArrow: 'combobox-target-arrow',
|
6
6
|
arrowInverse: 'arrow-inverse',
|
7
7
|
textfieldTarget: 'combobox-textfield-target',
|
8
8
|
selectChipIsFocused: 'combobox-chip-is-focused',
|
@@ -159,13 +159,9 @@ export var useKeyNavigation = function(param) {
|
|
159
159
|
case keys.Tab:
|
160
160
|
case keys.Escape:
|
161
161
|
{
|
162
|
-
|
163
|
-
|
164
|
-
}
|
165
|
-
dispatchFocusedPath({
|
166
|
-
type: 'reset'
|
167
|
-
});
|
168
|
-
handleListToggle(false);
|
162
|
+
if (path[0]) {
|
163
|
+
handleListToggle(false);
|
164
|
+
}
|
169
165
|
if (multiple) {
|
170
166
|
setTextValue('');
|
171
167
|
} else if (textValue !== value) {
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import React from "react";
|
1
|
+
import React, { useRef } from "react";
|
2
2
|
import { safeUseId } from "../../../../../utils";
|
3
3
|
import { FloatingPopover } from "../../FloatingPopover";
|
4
4
|
import { isEmpty } from "../../../../../utils";
|
5
5
|
import { Ul, ListWrapper } from "../../Combobox.styles";
|
6
6
|
import { Item } from "./ui";
|
7
7
|
export var Inner = function(param) {
|
8
|
-
var item = param.item, currentLevel = param.currentLevel, path = param.path, dispatchPath = param.dispatchPath, index = param.index, listWidth = param.listWidth;
|
8
|
+
var item = param.item, currentLevel = param.currentLevel, path = param.path, dispatchPath = param.dispatchPath, index = param.index, listWidth = param.listWidth, portal = param.portal;
|
9
9
|
var handleToggle = function(opened) {
|
10
10
|
if (opened) {
|
11
11
|
dispatchPath({
|
@@ -20,6 +20,7 @@ export var Inner = function(param) {
|
|
20
20
|
});
|
21
21
|
}
|
22
22
|
};
|
23
|
+
var listWrapperRef = useRef(null);
|
23
24
|
var isCurrentListOpen = path[currentLevel + 1] === item.value.toString();
|
24
25
|
var treeId = safeUseId();
|
25
26
|
var listId = "".concat(treeId, "_tree_level_").concat(currentLevel + 2);
|
@@ -40,13 +41,16 @@ export var Inner = function(param) {
|
|
40
41
|
ariaLevel: nextLevel,
|
41
42
|
ariaLabel: item.label
|
42
43
|
}),
|
43
|
-
isInner: true
|
44
|
+
isInner: true,
|
45
|
+
portal: portal
|
44
46
|
}, /*#__PURE__*/ React.createElement(ListWrapper, {
|
45
|
-
listWidth: listWidth
|
47
|
+
listWidth: listWidth,
|
48
|
+
ref: listWrapperRef
|
46
49
|
}, /*#__PURE__*/ React.createElement(Ul, {
|
47
50
|
role: "group",
|
48
51
|
id: listId,
|
49
|
-
virtual: false
|
52
|
+
virtual: false,
|
53
|
+
listMaxHeight: item === null || item === void 0 ? void 0 : item.listMaxHeight
|
50
54
|
}, (_item_items = item.items) === null || _item_items === void 0 ? void 0 : _item_items.map(function(innerItem, innerIndex) {
|
51
55
|
return /*#__PURE__*/ React.createElement(Inner, {
|
52
56
|
key: "".concat(innerIndex, "/").concat(currentLevel),
|
@@ -55,7 +59,8 @@ export var Inner = function(param) {
|
|
55
59
|
path: path,
|
56
60
|
dispatchPath: dispatchPath,
|
57
61
|
index: innerIndex,
|
58
|
-
listWidth: listWidth
|
62
|
+
listWidth: listWidth,
|
63
|
+
portal: listWrapperRef
|
59
64
|
});
|
60
65
|
}))));
|
61
66
|
}
|
@@ -87,6 +87,17 @@ export var useDrawer = function(param) {
|
|
87
87
|
isOpen,
|
88
88
|
popupController.items
|
89
89
|
]);
|
90
|
+
// При анмаунте компонента нужно обновлять overflow у body.
|
91
|
+
useEffect(function() {
|
92
|
+
return function() {
|
93
|
+
if (!canUseDOM) {
|
94
|
+
return;
|
95
|
+
}
|
96
|
+
if (!hasDrawers(Array.from(popupController.items.values()))) {
|
97
|
+
document.body.style.overflow = overflow.current;
|
98
|
+
}
|
99
|
+
};
|
100
|
+
}, []);
|
90
101
|
var drawerInfo = _object_spread({
|
91
102
|
id: id,
|
92
103
|
info: {
|
@@ -119,7 +119,7 @@ import { Context } from "./Dropdown.context";
|
|
119
119
|
* Выпадающий список.
|
120
120
|
*/ export var dropdownRoot = function(Root) {
|
121
121
|
return /*#__PURE__*/ forwardRef(function(_param, ref) {
|
122
|
-
var items = _param.items, children = _param.children, placement = _param.placement, offset = _param.offset, _param_closeOnOverlayClick = _param.closeOnOverlayClick, closeOnOverlayClick = _param_closeOnOverlayClick === void 0 ? true : _param_closeOnOverlayClick, onToggle = _param.onToggle, size = _param.size, view = _param.view, _param_itemRole = _param.itemRole, itemRole = _param_itemRole === void 0 ? 'treeitem' : _param_itemRole, className = _param.className, listMaxHeight = _param.listMaxHeight, listWidth = _param.listWidth, listHeight = _param.listHeight,
|
122
|
+
var items = _param.items, children = _param.children, placement = _param.placement, offset = _param.offset, _param_closeOnOverlayClick = _param.closeOnOverlayClick, closeOnOverlayClick = _param_closeOnOverlayClick === void 0 ? true : _param_closeOnOverlayClick, onToggle = _param.onToggle, size = _param.size, view = _param.view, _param_itemRole = _param.itemRole, itemRole = _param_itemRole === void 0 ? 'treeitem' : _param_itemRole, className = _param.className, listMaxHeight = _param.listMaxHeight, listWidth = _param.listWidth, listHeight = _param.listHeight, _param_closeOnSelect = _param.closeOnSelect, closeOnSelect = _param_closeOnSelect === void 0 ? true : _param_closeOnSelect, onHover = _param.onHover, onItemSelect = _param.onItemSelect, onItemClick = _param.onItemClick, _param_trigger = _param.trigger, trigger = _param_trigger === void 0 ? 'click' : _param_trigger, _param_openByRightClick = _param.openByRightClick, openByRightClick = _param_openByRightClick === void 0 ? false : _param_openByRightClick, _param_variant = _param.variant, variant = _param_variant === void 0 ? 'normal' : _param_variant, _param_hasArrow = _param.hasArrow, hasArrow = _param_hasArrow === void 0 ? true : _param_hasArrow, _param_alwaysOpened = _param.alwaysOpened, alwaysOpened = _param_alwaysOpened === void 0 ? false : _param_alwaysOpened, portal = _param.portal, renderItem = _param.renderItem, zIndex = _param.zIndex, beforeList = _param.beforeList, afterList = _param.afterList, rest = _object_without_properties(_param, [
|
123
123
|
"items",
|
124
124
|
"children",
|
125
125
|
"placement",
|
@@ -133,7 +133,6 @@ import { Context } from "./Dropdown.context";
|
|
133
133
|
"listMaxHeight",
|
134
134
|
"listWidth",
|
135
135
|
"listHeight",
|
136
|
-
"listOverflow",
|
137
136
|
"closeOnSelect",
|
138
137
|
"onHover",
|
139
138
|
"onItemSelect",
|
@@ -159,6 +158,7 @@ import { Context } from "./Dropdown.context";
|
|
159
158
|
var _useHashMaps = _sliced_to_array(useHashMaps(items), 2), pathMap = _useHashMaps[0], focusedToValueMap = _useHashMaps[1];
|
160
159
|
var activeDescendantItemValue = ((_getItemByFocused = getItemByFocused(focusedPath, focusedToValueMap)) === null || _getItemByFocused === void 0 ? void 0 : _getItemByFocused.value) || '';
|
161
160
|
var floatingPopoverRef = useRef(null);
|
161
|
+
var listWrapperRef = useRef(null);
|
162
162
|
var treeId = safeUseId();
|
163
163
|
// Логика работы при клике за пределами выпадающего списка
|
164
164
|
var targetRef = useOutsideClick(function(event) {
|
@@ -252,17 +252,14 @@ import { Context } from "./Dropdown.context";
|
|
252
252
|
className: cx(className, classes.dropdownRoot),
|
253
253
|
ref: ref,
|
254
254
|
view: view,
|
255
|
-
size: size
|
256
|
-
style: {
|
257
|
-
display: 'inline-block'
|
258
|
-
}
|
255
|
+
size: size
|
259
256
|
}, rest), /*#__PURE__*/ React.createElement(ListWrapper, {
|
257
|
+
ref: listWrapperRef,
|
260
258
|
listWidth: listWidth
|
261
259
|
}, /*#__PURE__*/ React.createElement(Ul, {
|
262
260
|
ref: targetRef,
|
263
261
|
id: "".concat(treeId, "_tree_level_1"),
|
264
262
|
role: "tree",
|
265
|
-
listOverflow: listOverflow,
|
266
263
|
listMaxHeight: listMaxHeight || listHeight
|
267
264
|
}, beforeList, items.map(function(item, index) {
|
268
265
|
return /*#__PURE__*/ React.createElement(DropdownInner, {
|
@@ -273,9 +270,8 @@ import { Context } from "./Dropdown.context";
|
|
273
270
|
path: path,
|
274
271
|
dispatchPath: dispatchPath,
|
275
272
|
index: index,
|
276
|
-
|
277
|
-
|
278
|
-
listWidth: listWidth
|
273
|
+
listWidth: listWidth,
|
274
|
+
portal: listWrapperRef
|
279
275
|
});
|
280
276
|
}), afterList)))));
|
281
277
|
});
|
@@ -4,7 +4,7 @@ import { getCorrectHeight } from "./utils";
|
|
4
4
|
import { tokens, constants } from "./Dropdown.tokens";
|
5
5
|
export var ListWrapper = styled.div.withConfig({
|
6
6
|
displayName: "Dropdown.styles__ListWrapper",
|
7
|
-
componentId: "sc-
|
7
|
+
componentId: "sc-768e302d-0"
|
8
8
|
})([
|
9
9
|
"width:",
|
10
10
|
";padding:calc(var(",
|
@@ -21,19 +21,15 @@ export var ListWrapper = styled.div.withConfig({
|
|
21
21
|
}, tokens.padding, tokens.borderWidth, tokens.borderRadius, constants.background, constants.boxShadow, tokens.borderWidth, tokens.borderColor);
|
22
22
|
export var Ul = styled.ul.withConfig({
|
23
23
|
displayName: "Dropdown.styles__Ul",
|
24
|
-
componentId: "sc-
|
24
|
+
componentId: "sc-768e302d-1"
|
25
25
|
})([
|
26
26
|
"max-height:",
|
27
|
-
";overflow-y:",
|
28
|
-
";border-radius:calc(var(",
|
27
|
+
";overflow-x:hidden;overflow-y:auto;border-radius:calc(var(",
|
29
28
|
") - 0.125rem - var(",
|
30
29
|
",0rem));margin:0;padding:0;"
|
31
30
|
], function(param) {
|
32
31
|
var listMaxHeight = param.listMaxHeight;
|
33
32
|
return listMaxHeight ? getCorrectHeight(listMaxHeight) : 'auto';
|
34
|
-
}, function(param) {
|
35
|
-
var listOverflow = param.listOverflow;
|
36
|
-
return listOverflow || 'visible';
|
37
33
|
}, tokens.borderRadius, tokens.borderWidth);
|
38
34
|
export var base = css([
|
39
35
|
""
|
@@ -11,13 +11,6 @@ function _define_property(obj, key, value) {
|
|
11
11
|
}
|
12
12
|
return obj;
|
13
13
|
}
|
14
|
-
function _instanceof(left, right) {
|
15
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
16
|
-
return !!right[Symbol.hasInstance](left);
|
17
|
-
} else {
|
18
|
-
return left instanceof right;
|
19
|
-
}
|
20
|
-
}
|
21
14
|
function _object_spread(target) {
|
22
15
|
for(var i = 1; i < arguments.length; i++){
|
23
16
|
var source = arguments[i] != null ? arguments[i] : {};
|
@@ -57,7 +50,7 @@ function _object_spread_props(target, source) {
|
|
57
50
|
}
|
58
51
|
return target;
|
59
52
|
}
|
60
|
-
import { flip, shift, useFloating, FloatingPortal, offset as offsetMiddleware, autoPlacement, autoUpdate } from "@floating-ui/react";
|
53
|
+
import { flip, shift, useFloating, FloatingPortal, offset as offsetMiddleware, autoPlacement, autoUpdate, useHover, useInteractions, safePolygon, useClick } from "@floating-ui/react";
|
61
54
|
import React, { forwardRef } from "react";
|
62
55
|
import { safeUseId } from "../../utils";
|
63
56
|
// TODO: #2003
|
@@ -77,6 +70,7 @@ var FloatingPopover = /*#__PURE__*/ forwardRef(function(param, ref) {
|
|
77
70
|
},
|
78
71
|
placement: placement === 'auto' ? undefined : placement,
|
79
72
|
open: opened,
|
73
|
+
onOpenChange: onToggle,
|
80
74
|
middleware: [
|
81
75
|
placement === 'auto' && autoPlacement(),
|
82
76
|
offsetMiddleware({
|
@@ -88,40 +82,26 @@ var FloatingPopover = /*#__PURE__*/ forwardRef(function(param, ref) {
|
|
88
82
|
}),
|
89
83
|
shift()
|
90
84
|
]
|
91
|
-
}), refs = _useFloating.refs, floatingStyles = _useFloating.floatingStyles;
|
85
|
+
}), refs = _useFloating.refs, floatingStyles = _useFloating.floatingStyles, context = _useFloating.context;
|
92
86
|
var wrappedId = safeUseId();
|
93
|
-
var
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
};
|
107
|
-
var
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
return;
|
112
|
-
}
|
113
|
-
onToggle(false, event);
|
114
|
-
}
|
115
|
-
};
|
116
|
-
var handleFloatingMouseLeave = function(event) {
|
117
|
-
if (_instanceof(event.relatedTarget, HTMLElement) && _instanceof(refs.reference.current, HTMLElement)) {
|
118
|
-
var _refs_reference_current;
|
119
|
-
if (trigger === 'click' || !opened || event.relatedTarget && refs.reference && ((_refs_reference_current = refs.reference.current) === null || _refs_reference_current === void 0 ? void 0 : _refs_reference_current.contains(event.relatedTarget))) {
|
120
|
-
return;
|
121
|
-
}
|
122
|
-
onToggle(false, event);
|
123
|
-
}
|
124
|
-
};
|
87
|
+
var hover = useHover(context, {
|
88
|
+
enabled: trigger === 'hover',
|
89
|
+
delay: {
|
90
|
+
open: 0,
|
91
|
+
close: 50
|
92
|
+
},
|
93
|
+
handleClose: safePolygon({
|
94
|
+
requireIntent: false
|
95
|
+
})
|
96
|
+
});
|
97
|
+
var click = useClick(context, {
|
98
|
+
toggle: false,
|
99
|
+
ignoreMouse: trigger === 'hover'
|
100
|
+
});
|
101
|
+
var getReferenceProps = useInteractions([
|
102
|
+
hover,
|
103
|
+
click
|
104
|
+
]).getReferenceProps;
|
125
105
|
return /*#__PURE__*/ React.createElement("div", {
|
126
106
|
ref: ref,
|
127
107
|
id: wrappedId,
|
@@ -129,14 +109,10 @@ var FloatingPopover = /*#__PURE__*/ forwardRef(function(param, ref) {
|
|
129
109
|
position: 'relative',
|
130
110
|
display: isInner ? 'block' : 'inline-block'
|
131
111
|
}
|
132
|
-
}, /*#__PURE__*/ React.createElement("div", {
|
133
|
-
ref: refs.setReference
|
134
|
-
|
135
|
-
onMouseEnter: handleTargetMouseEnter,
|
136
|
-
onMouseLeave: handleTargetMouseLeave
|
137
|
-
}, target), opened && /*#__PURE__*/ React.createElement(FloatingPortal, getFloatingPortalProps(portal, wrappedId), /*#__PURE__*/ React.createElement("div", {
|
112
|
+
}, /*#__PURE__*/ React.createElement("div", _object_spread({
|
113
|
+
ref: refs.setReference
|
114
|
+
}, getReferenceProps()), target), opened && /*#__PURE__*/ React.createElement(FloatingPortal, getFloatingPortalProps(portal, wrappedId), /*#__PURE__*/ React.createElement("div", {
|
138
115
|
ref: refs.setFloating,
|
139
|
-
onMouseLeave: handleFloatingMouseLeave,
|
140
116
|
style: _object_spread_props(_object_spread({}, floatingStyles), {
|
141
117
|
zIndex: zIndex || 1000
|
142
118
|
})
|
@@ -162,13 +162,9 @@ export var useKeyNavigation = function(param) {
|
|
162
162
|
case keys.Tab:
|
163
163
|
case keys.Escape:
|
164
164
|
{
|
165
|
-
|
166
|
-
|
167
|
-
}
|
168
|
-
dispatchPath({
|
169
|
-
type: 'reset'
|
170
|
-
});
|
171
|
-
handleGlobalToggle(false, event);
|
165
|
+
if (path[0]) {
|
166
|
+
handleGlobalToggle(false, event);
|
167
|
+
}
|
172
168
|
break;
|
173
169
|
}
|
174
170
|
case keys.Home:
|