@salutejs/plasma-new-hope 0.174.0-canary.1505.11518120718.0 → 0.174.0-dev.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -27
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -9
- package/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js.map +1 -1
- package/cjs/components/Drawer/Drawer.js +2 -1
- package/cjs/components/Drawer/Drawer.js.map +1 -1
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
- package/cjs/components/Select/Select.js +25 -13
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/hooks/useKeyboardNavigation.js +1 -1
- package/cjs/components/Select/hooks/useKeyboardNavigation.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
- package/cjs/components/Select/utils/getButtonLabel.js +1 -1
- package/cjs/components/Select/utils/getButtonLabel.js.map +1 -1
- package/cjs/components/Select/utils/initialItemsTransform.js +6 -9
- package/cjs/components/Select/utils/initialItemsTransform.js.map +1 -1
- package/cjs/components/ViewContainer/ViewContainer.js +38 -0
- package/cjs/components/ViewContainer/ViewContainer.js.map +1 -0
- package/cjs/components/ViewContainer/ViewContainer_yiqfcb.css +1 -0
- package/cjs/components/ViewContainer/_view/base.js +9 -0
- package/cjs/components/ViewContainer/_view/base.js.map +1 -0
- package/cjs/components/ViewContainer/_view/base_x642ct.css +1 -0
- package/cjs/index.css +2 -0
- package/cjs/index.js +3 -0
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -26
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/index.js +1 -8
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
- package/emotion/cjs/components/Drawer/Drawer.js +4 -3
- package/emotion/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
- package/emotion/cjs/components/Select/Select.js +25 -12
- package/emotion/cjs/components/Select/hooks/useKeyboardNavigation.js +1 -1
- package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
- package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +13 -13
- package/emotion/cjs/components/Select/utils/getButtonLabel.js +1 -1
- package/emotion/cjs/components/Select/utils/index.js +1 -8
- package/emotion/cjs/components/Select/utils/initialItemsTransform.js +6 -19
- package/emotion/cjs/components/ViewContainer/ViewContainer.js +49 -0
- package/emotion/cjs/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
- package/emotion/cjs/components/ViewContainer/_view/base.js +8 -0
- package/emotion/cjs/components/ViewContainer/_view/tokens.json +1 -0
- package/emotion/cjs/components/ViewContainer/index.js +18 -0
- package/emotion/cjs/examples/_helpers.js +3 -14
- package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
- package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +16 -0
- package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +11 -0
- package/emotion/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/emotion/cjs/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
- package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +16 -0
- package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.js +11 -0
- package/emotion/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/emotion/cjs/index.js +11 -0
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +23 -27
- package/emotion/es/components/Combobox/ComboboxNew/utils/index.js +1 -2
- package/emotion/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
- package/emotion/es/components/Drawer/Drawer.js +2 -1
- package/emotion/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
- package/emotion/es/components/Select/Select.js +26 -13
- package/emotion/es/components/Select/hooks/useKeyboardNavigation.js +1 -1
- package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
- package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +13 -13
- package/emotion/es/components/Select/utils/getButtonLabel.js +1 -1
- package/emotion/es/components/Select/utils/index.js +1 -2
- package/emotion/es/components/Select/utils/initialItemsTransform.js +6 -19
- package/emotion/es/components/ViewContainer/ViewContainer.js +40 -0
- package/emotion/es/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
- package/emotion/es/components/ViewContainer/_view/base.js +2 -0
- package/emotion/es/components/ViewContainer/_view/tokens.json +1 -0
- package/emotion/es/components/ViewContainer/index.js +1 -0
- package/emotion/es/examples/_helpers.js +3 -14
- package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
- package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +10 -0
- package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +5 -0
- package/emotion/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/emotion/es/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
- package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +10 -0
- package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.js +5 -0
- package/emotion/es/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/emotion/es/index.js +2 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +22 -27
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -9
- package/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js.map +1 -1
- package/es/components/Drawer/Drawer.js +2 -1
- package/es/components/Drawer/Drawer.js.map +1 -1
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
- package/es/components/Select/Select.js +26 -14
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/hooks/useKeyboardNavigation.js +1 -1
- package/es/components/Select/hooks/useKeyboardNavigation.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
- package/es/components/Select/utils/getButtonLabel.js +1 -1
- package/es/components/Select/utils/getButtonLabel.js.map +1 -1
- package/es/components/Select/utils/initialItemsTransform.js +6 -9
- package/es/components/Select/utils/initialItemsTransform.js.map +1 -1
- package/es/components/ViewContainer/ViewContainer.js +33 -0
- package/es/components/ViewContainer/ViewContainer.js.map +1 -0
- package/es/components/ViewContainer/ViewContainer_yiqfcb.css +1 -0
- package/es/components/ViewContainer/_view/base.js +5 -0
- package/es/components/ViewContainer/_view/base.js.map +1 -0
- package/es/components/ViewContainer/_view/base_x642ct.css +1 -0
- package/es/index.css +2 -0
- package/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/package.json +3 -2
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -26
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/index.js +1 -8
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
- package/styled-components/cjs/components/Drawer/Drawer.js +4 -3
- package/styled-components/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
- package/styled-components/cjs/components/Select/Select.js +25 -12
- package/styled-components/cjs/components/Select/hooks/useKeyboardNavigation.js +1 -1
- package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
- package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
- package/styled-components/cjs/components/Select/utils/getButtonLabel.js +1 -1
- package/styled-components/cjs/components/Select/utils/index.js +1 -8
- package/styled-components/cjs/components/Select/utils/initialItemsTransform.js +6 -19
- package/styled-components/cjs/components/ViewContainer/ViewContainer.js +40 -0
- package/styled-components/cjs/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
- package/styled-components/cjs/components/ViewContainer/_view/base.js +8 -0
- package/styled-components/cjs/components/ViewContainer/_view/tokens.json +1 -0
- package/styled-components/cjs/components/ViewContainer/index.js +18 -0
- package/styled-components/cjs/examples/_helpers.js +3 -14
- package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
- package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +16 -0
- package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/styled-components/cjs/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
- package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +16 -0
- package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.js +11 -0
- package/styled-components/cjs/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +23 -27
- package/styled-components/es/components/Combobox/ComboboxNew/utils/index.js +1 -2
- package/styled-components/es/components/Combobox/ComboboxNew/utils/initialItemsTransform.js +5 -19
- package/styled-components/es/components/Drawer/Drawer.js +2 -1
- package/styled-components/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
- package/styled-components/es/components/Select/Select.js +26 -13
- package/styled-components/es/components/Select/hooks/useKeyboardNavigation.js +1 -1
- package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.js +1 -1
- package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
- package/styled-components/es/components/Select/utils/getButtonLabel.js +1 -1
- package/styled-components/es/components/Select/utils/index.js +1 -2
- package/styled-components/es/components/Select/utils/initialItemsTransform.js +6 -19
- package/styled-components/es/components/ViewContainer/ViewContainer.js +31 -0
- package/styled-components/es/components/ViewContainer/ViewContainer.template-doc.mdx +82 -0
- package/styled-components/es/components/ViewContainer/_view/base.js +2 -0
- package/styled-components/es/components/ViewContainer/_view/tokens.json +1 -0
- package/styled-components/es/components/ViewContainer/index.js +1 -0
- package/styled-components/es/examples/_helpers.js +3 -14
- package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +0 -6
- package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.js +10 -0
- package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/styled-components/es/examples/plasma_web/components/Combobox/Combobox.stories.tsx +0 -6
- package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.config.js +10 -0
- package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.js +5 -0
- package/styled-components/es/examples/plasma_web/components/ViewContainer/ViewContainer.stories.tsx +65 -0
- package/styled-components/es/index.js +2 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +3 -14
- package/types/components/Combobox/ComboboxNew/Combobox.types.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/Combobox/ComboboxNew/utils/initialItemsTransform.d.ts.map +1 -1
- package/types/components/Drawer/Drawer.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/Select/Select.types.d.ts +0 -1
- package/types/components/Select/Select.types.d.ts.map +1 -1
- package/types/components/Select/hooks/useKeyboardNavigation.d.ts +2 -2
- package/types/components/Select/hooks/useKeyboardNavigation.d.ts.map +1 -1
- package/types/components/Select/ui/Target/Target.types.d.ts +2 -2
- package/types/components/Select/ui/Target/Target.types.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts +4 -4
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.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/Select/utils/initialItemsTransform.d.ts.map +1 -1
- package/types/components/ViewContainer/ViewContainer.d.ts +26 -0
- package/types/components/ViewContainer/ViewContainer.d.ts.map +1 -0
- package/types/components/ViewContainer/_view/base.d.ts +2 -0
- package/types/components/ViewContainer/_view/base.d.ts.map +1 -0
- package/types/components/ViewContainer/index.d.ts +2 -0
- package/types/components/ViewContainer/index.d.ts.map +1 -0
- package/types/examples/_helpers.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +6 -30
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.d.ts +9 -0
- package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.d.ts +8 -0
- package/types/examples/plasma_b2c/components/ViewContainer/ViewContainer.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Combobox/Combobox.d.ts +6 -30
- package/types/examples/plasma_web/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/examples/plasma_web/components/ViewContainer/ViewContainer.config.d.ts +9 -0
- package/types/examples/plasma_web/components/ViewContainer/ViewContainer.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/ViewContainer/ViewContainer.d.ts +8 -0
- package/types/examples/plasma_web/components/ViewContainer/ViewContainer.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -21
- package/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js.map +0 -1
- package/cjs/components/Select/utils/getInitialValue.js +0 -21
- package/cjs/components/Select/utils/getInitialValue.js.map +0 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -20
- package/emotion/cjs/components/Select/utils/getInitialValue.js +0 -20
- package/emotion/cjs/examples/themes/declaration.d.ts +0 -4
- package/emotion/cjs/examples/themes/index.js +0 -15
- package/emotion/cjs/examples/themes/plasma_b2c.module.css +0 -984
- package/emotion/cjs/examples/themes/plasma_web.module.css +0 -984
- package/emotion/es/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -14
- package/emotion/es/components/Select/utils/getInitialValue.js +0 -14
- package/emotion/es/examples/themes/declaration.d.ts +0 -4
- package/emotion/es/examples/themes/index.js +0 -7
- package/emotion/es/examples/themes/plasma_b2c.module.css +0 -984
- package/emotion/es/examples/themes/plasma_web.module.css +0 -984
- package/es/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -17
- package/es/components/Combobox/ComboboxNew/utils/getInitialValue.js.map +0 -1
- package/es/components/Select/utils/getInitialValue.js +0 -17
- package/es/components/Select/utils/getInitialValue.js.map +0 -1
- package/styled-components/cjs/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -20
- package/styled-components/cjs/components/Select/utils/getInitialValue.js +0 -20
- package/styled-components/cjs/examples/themes/declaration.d.ts +0 -4
- package/styled-components/cjs/examples/themes/index.js +0 -15
- package/styled-components/cjs/examples/themes/plasma_b2c.module.css +0 -984
- package/styled-components/cjs/examples/themes/plasma_web.module.css +0 -984
- package/styled-components/es/components/Combobox/ComboboxNew/utils/getInitialValue.js +0 -14
- package/styled-components/es/components/Select/utils/getInitialValue.js +0 -14
- package/styled-components/es/examples/themes/declaration.d.ts +0 -4
- package/styled-components/es/examples/themes/index.js +0 -7
- package/styled-components/es/examples/themes/plasma_b2c.module.css +0 -984
- package/styled-components/es/examples/themes/plasma_web.module.css +0 -984
- package/types/components/Combobox/ComboboxNew/utils/getInitialValue.d.ts +0 -4
- package/types/components/Combobox/ComboboxNew/utils/getInitialValue.d.ts.map +0 -1
- package/types/components/Select/utils/getInitialValue.d.ts +0 -4
- package/types/components/Select/utils/getInitialValue.d.ts.map +0 -1
- package/types/examples/themes/index.d.ts +0 -6
- package/types/examples/themes/index.d.ts.map +0 -1
@@ -20,7 +20,7 @@ var _getPathMaps = /*#__PURE__*/require("./hooks/getPathMaps");
|
|
20
20
|
var _Combobox2 = /*#__PURE__*/require("./Combobox.styles");
|
21
21
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
22
22
|
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
23
|
-
var _excluded = ["multiple", "value", "onChange", "isTargetAmount", "
|
23
|
+
var _excluded = ["multiple", "value", "onChange", "isTargetAmount", "items", "placement", "label", "placeholder", "helperText", "contentLeft", "textBefore", "textAfter", "variant", "listOverflow", "listHeight", "listWidth", "portal", "renderItem", "view", "size", "labelPlacement", "readOnly", "disabled", "alwaysOpened", "filter", "closeAfterSelect"];
|
24
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
25
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
26
26
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
@@ -44,7 +44,6 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
|
|
44
44
|
outerValue = props.value,
|
45
45
|
outerOnChange = props.onChange,
|
46
46
|
isTargetAmount = props.isTargetAmount,
|
47
|
-
targetAmount = props.targetAmount,
|
48
47
|
items = props.items,
|
49
48
|
_props$placement = props.placement,
|
50
49
|
placement = _props$placement === void 0 ? 'bottom-start' : _props$placement,
|
@@ -72,15 +71,10 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
|
|
72
71
|
alwaysOpened = _props$alwaysOpened === void 0 ? false : _props$alwaysOpened,
|
73
72
|
filter = props.filter,
|
74
73
|
outerCloseAfterSelect = props.closeAfterSelect,
|
75
|
-
renderValue = props.renderValue,
|
76
74
|
rest = _objectWithoutProperties(props, _excluded);
|
77
|
-
var transformedItems = (0, _react.useMemo)(function () {
|
78
|
-
return (0, _utils3.initialItemsTransform)(items || []);
|
79
|
-
}, [items]);
|
80
|
-
|
81
75
|
// Создаем структуры для быстрой работы с деревом
|
82
76
|
var _useMemo = (0, _react.useMemo)(function () {
|
83
|
-
return (0, _getPathMaps.getTreeMaps)(
|
77
|
+
return (0, _getPathMaps.getTreeMaps)(items);
|
84
78
|
}, [items]),
|
85
79
|
_useMemo2 = _slicedToArray(_useMemo, 3),
|
86
80
|
valueToCheckedMap = _useMemo2[0],
|
@@ -94,11 +88,14 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
|
|
94
88
|
_useState4 = _slicedToArray(_useState3, 2),
|
95
89
|
internalValue = _useState4[0],
|
96
90
|
setInternalValue = _useState4[1];
|
97
|
-
var value = outerValue
|
91
|
+
var value = outerValue || internalValue;
|
98
92
|
var inputRef = (0, _react.useRef)(null);
|
99
93
|
var floatingPopoverRef = (0, _react.useRef)(null);
|
100
94
|
var inputForkRef = (0, _plasmaCore.useForkRef)(inputRef, ref);
|
101
95
|
var treeId = (0, _plasmaCore.safeUseId)();
|
96
|
+
var transformedItems = (0, _react.useMemo)(function () {
|
97
|
+
return (0, _utils3.initialItemsTransform)(items || []);
|
98
|
+
}, [items]);
|
102
99
|
var filteredItems = (0, _utils3.filterItems)(transformedItems, textValue, (_valueToItemMap$get2 = valueToItemMap.get(value)) === null || _valueToItemMap$get2 === void 0 ? void 0 : _valueToItemMap$get2.label, filter);
|
103
100
|
var _useMemo3 = (0, _react.useMemo)(function () {
|
104
101
|
return (0, _getPathMaps.getPathMap)(filteredItems);
|
@@ -265,7 +262,16 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
|
|
265
262
|
if (e) {
|
266
263
|
e.stopPropagation();
|
267
264
|
}
|
268
|
-
var
|
265
|
+
var checkedCopy = new Map(checked);
|
266
|
+
var isCurrentChecked = checkedCopy.get(item.value);
|
267
|
+
checkedCopy.forEach(function (_, key) {
|
268
|
+
checkedCopy.set(key, false);
|
269
|
+
});
|
270
|
+
if (!isCurrentChecked) {
|
271
|
+
checkedCopy.set(item.value, 'done');
|
272
|
+
(0, _utils3.updateSingleAncestors)(item, checkedCopy, 'dot');
|
273
|
+
}
|
274
|
+
setTextValue(isCurrentChecked ? '' : item.label);
|
269
275
|
if (!alwaysOpened && closeAfterSelect) {
|
270
276
|
dispatchPath({
|
271
277
|
type: 'reset'
|
@@ -279,18 +285,14 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
|
|
279
285
|
}
|
280
286
|
};
|
281
287
|
var getChips = function getChips() {
|
282
|
-
if (multiple
|
288
|
+
if (multiple) {
|
283
289
|
if (value.length === 0) return [];
|
284
290
|
if (isTargetAmount) {
|
285
|
-
return ["\u0412\u044B\u0431\u0440\u0430\u043D\u043E ".concat(
|
291
|
+
return ["\u0412\u044B\u0431\u0440\u0430\u043D\u043E ".concat(value.length)];
|
286
292
|
}
|
287
|
-
|
288
|
-
return
|
289
|
-
};
|
290
|
-
var valueToItemMapper = function valueToItemMapper(stringValue) {
|
291
|
-
return valueToItemMap.get(stringValue).label;
|
292
|
-
};
|
293
|
-
return value.map(renderValueMapper || valueToItemMapper);
|
293
|
+
return value.map(function (value) {
|
294
|
+
return valueToItemMap.get(value).label;
|
295
|
+
});
|
294
296
|
}
|
295
297
|
return [];
|
296
298
|
};
|
@@ -318,7 +320,6 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
|
|
318
320
|
// В данном эффекте мы следим за изменениями value снаружи и вносим коррективы в дерево чекбоксов.
|
319
321
|
// Пример: когда юзер очистил value извне, тогда нужно пройтись по элементам и выключить все чекбоксы.
|
320
322
|
(0, _react.useLayoutEffect)(function () {
|
321
|
-
var _valueToItemMap$get4;
|
322
323
|
var checkedCopy = new Map(checked);
|
323
324
|
checkedCopy.forEach(function (_, key) {
|
324
325
|
checkedCopy.set(key, false);
|
@@ -336,12 +337,7 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
|
|
336
337
|
}
|
337
338
|
}
|
338
339
|
setChecked(checkedCopy);
|
339
|
-
|
340
|
-
|
341
|
-
// В deps мы кладем именно outerValue и internalValue, а не просто value.
|
342
|
-
// Т.к. вначале нужно отфильтровать и провалидировать outerValue и результат положить в переменную.
|
343
|
-
// А переменную, содержащую сложные типы данных, нельзя помещать в deps.
|
344
|
-
}, [outerValue, internalValue, items]);
|
340
|
+
}, [value]);
|
345
341
|
return /*#__PURE__*/_react["default"].createElement(Root, {
|
346
342
|
size: size,
|
347
343
|
view: view,
|
@@ -9,12 +9,6 @@ Object.defineProperty(exports, "filterItems", {
|
|
9
9
|
return _filterItems.filterItems;
|
10
10
|
}
|
11
11
|
});
|
12
|
-
Object.defineProperty(exports, "getInitialValue", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function get() {
|
15
|
-
return _getInitialValue.getInitialValue;
|
16
|
-
}
|
17
|
-
});
|
18
12
|
Object.defineProperty(exports, "getItemId", {
|
19
13
|
enumerable: true,
|
20
14
|
get: function get() {
|
@@ -57,5 +51,4 @@ var _updateAncestors = /*#__PURE__*/require("./updateAncestors");
|
|
57
51
|
var _updateSingleAncestors = /*#__PURE__*/require("./updateSingleAncestors");
|
58
52
|
var _sizeToIconSize = /*#__PURE__*/require("./sizeToIconSize");
|
59
53
|
var _filterItems = /*#__PURE__*/require("./filterItems");
|
60
|
-
var _getItemId = /*#__PURE__*/require("./getItemId");
|
61
|
-
var _getInitialValue = /*#__PURE__*/require("./getInitialValue");
|
54
|
+
var _getItemId = /*#__PURE__*/require("./getItemId");
|
@@ -1,31 +1,17 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.initialItemsTransform = void 0;
|
8
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
9
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
10
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
12
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
13
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
14
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
16
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
17
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
18
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
19
7
|
// Проходимся по массиву items и добавляем в каждый item ключ parent, который ссылается на item родителя.
|
20
8
|
// Дает возможность прохода к корневому элементу (снизу вверх).
|
21
|
-
// На выходе получаем глубокую копию исходного массива items.
|
22
9
|
var initialItemsTransform = exports.initialItemsTransform = function initialItemsTransform(items, parent) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
itemCopy.items = initialItemsTransform(itemCopy.items, itemCopy);
|
10
|
+
items.forEach(function (item) {
|
11
|
+
item.parent = parent;
|
12
|
+
if (item.items) {
|
13
|
+
item.items = initialItemsTransform(item.items, item);
|
28
14
|
}
|
29
|
-
return itemCopy;
|
30
15
|
});
|
16
|
+
return items;
|
31
17
|
};
|
@@ -13,13 +13,14 @@ var _Overlay = /*#__PURE__*/require("../Overlay");
|
|
13
13
|
var _utils = /*#__PURE__*/require("../Popup/utils");
|
14
14
|
var _Panel = /*#__PURE__*/require("../Panel");
|
15
15
|
var _utils2 = /*#__PURE__*/require("../../utils");
|
16
|
+
var _hooks = /*#__PURE__*/require("../../hooks");
|
16
17
|
var _Drawer = /*#__PURE__*/require("./Drawer.tokens");
|
17
18
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
18
19
|
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
19
20
|
var _base3 = /*#__PURE__*/require("./variations/_borderRadius/base");
|
20
21
|
var _Drawer2 = /*#__PURE__*/require("./Drawer.styles");
|
21
22
|
var _DrawerContext = /*#__PURE__*/require("./DrawerContext");
|
22
|
-
var
|
23
|
+
var _hooks2 = /*#__PURE__*/require("./hooks");
|
23
24
|
var _excluded = ["id", "zIndex", "popupInfo", "withBlur", "children", "view", "size", "width", "height", "isOpen", "opened", "initialFocusRef", "focusAfterRef", "className", "onClose", "onOverlayClick", "onEscKeyDown", "offset", "frame", "borderRadius", "placement", "closeOnEsc", "closeOnOverlayClick", "asModal"];
|
24
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
25
26
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
@@ -62,7 +63,7 @@ var drawerRoot = exports.drawerRoot = function drawerRoot(Root) {
|
|
62
63
|
asModal = _ref$asModal === void 0 ? true : _ref$asModal,
|
63
64
|
rest = _objectWithoutProperties(_ref, _excluded);
|
64
65
|
var innerIsOpen = Boolean(isOpen || opened);
|
65
|
-
var trapRef = (0,
|
66
|
+
var trapRef = (0, _hooks.useFocusTrap)(true, initialFocusRef, focusAfterRef);
|
66
67
|
var popupController = (0, _Popup.usePopupContext)();
|
67
68
|
var innerRef = (0, _plasmaCore.useForkRef)(trapRef, outerRef);
|
68
69
|
var uniqId = (0, _plasmaCore.safeUseId)();
|
@@ -71,7 +72,7 @@ var drawerRoot = exports.drawerRoot = function drawerRoot(Root) {
|
|
71
72
|
var innerWidth = width ? (0, _utils2.getSizeValueFromProp)(width) : '100%';
|
72
73
|
var innerHeight = height ? (0, _utils2.getSizeValueFromProp)(height) : '100%';
|
73
74
|
var placementClass = placement ? _Drawer.classes["".concat(placement, "Placement")] : undefined;
|
74
|
-
var _useDrawer = (0,
|
75
|
+
var _useDrawer = (0, _hooks2.useDrawer)({
|
75
76
|
id: innerId,
|
76
77
|
isOpen: innerIsOpen,
|
77
78
|
closeOnEsc: closeOnEsc,
|
package/emotion/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js
CHANGED
@@ -24,8 +24,8 @@ var PaginationSelectPerPage = exports.PaginationSelectPerPage = function Paginat
|
|
24
24
|
listWidth = _ref.listWidth,
|
25
25
|
rest = _objectWithoutProperties(_ref, _excluded);
|
26
26
|
var handleSelectChange = function handleSelectChange(newValue) {
|
27
|
-
if (newValue
|
28
|
-
onChangeValue(Number(newValue));
|
27
|
+
if (newValue) {
|
28
|
+
onChangeValue === null || onChangeValue === void 0 || onChangeValue(Number(newValue));
|
29
29
|
}
|
30
30
|
};
|
31
31
|
var transformedList = perPageList.map(function (num) {
|
@@ -67,6 +67,17 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
|
|
67
67
|
separator = props.separator,
|
68
68
|
outerCloseAfterSelect = props.closeAfterSelect,
|
69
69
|
rest = _objectWithoutProperties(props, _excluded);
|
70
|
+
var _useState = (0, _react.useState)(outerValue || props.multiselect ? [] : ''),
|
71
|
+
_useState2 = _slicedToArray(_useState, 2),
|
72
|
+
internalValue = _useState2[0],
|
73
|
+
setInternalValue = _useState2[1];
|
74
|
+
var value = outerValue || internalValue;
|
75
|
+
var onChange = function onChange(e) {
|
76
|
+
if (outerOnChange) {
|
77
|
+
outerOnChange(e);
|
78
|
+
}
|
79
|
+
setInternalValue(e);
|
80
|
+
};
|
70
81
|
var transformedItems = (0, _react.useMemo)(function () {
|
71
82
|
return (0, _utils2.initialItemsTransform)(items || []);
|
72
83
|
}, [items]);
|
@@ -76,12 +87,6 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
|
|
76
87
|
focusedToValueMap = _usePathMaps2[1],
|
77
88
|
valueToCheckedMap = _usePathMaps2[2],
|
78
89
|
valueToItemMap = _usePathMaps2[3];
|
79
|
-
var value = (0, _utils2.getInitialValue)(outerValue, valueToItemMap);
|
80
|
-
var onChange = function onChange(e) {
|
81
|
-
if (outerOnChange) {
|
82
|
-
outerOnChange(e);
|
83
|
-
}
|
84
|
-
};
|
85
90
|
var _useReducer = (0, _react.useReducer)(_reducers.pathReducer, []),
|
86
91
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
87
92
|
path = _useReducer2[0],
|
@@ -94,10 +99,10 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
|
|
94
99
|
_useReducer6 = _slicedToArray(_useReducer5, 2),
|
95
100
|
focusedChipIndex = _useReducer6[0],
|
96
101
|
dispatchFocusedChipIndex = _useReducer6[1];
|
97
|
-
var
|
98
|
-
|
99
|
-
checked =
|
100
|
-
setChecked =
|
102
|
+
var _useState3 = (0, _react.useState)(valueToCheckedMap),
|
103
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
104
|
+
checked = _useState4[0],
|
105
|
+
setChecked = _useState4[1];
|
101
106
|
var closeAfterSelect = outerCloseAfterSelect !== null && outerCloseAfterSelect !== void 0 ? outerCloseAfterSelect : !props.multiselect;
|
102
107
|
var targetRef = (0, _hooks.useOutsideClick)(function () {
|
103
108
|
if (focusedChipIndex != null) {
|
@@ -163,7 +168,15 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
|
|
163
168
|
if (e) {
|
164
169
|
e.stopPropagation();
|
165
170
|
}
|
166
|
-
var
|
171
|
+
var checkedCopy = new Map(checked);
|
172
|
+
var isCurrentChecked = checkedCopy.get(item.value);
|
173
|
+
checkedCopy.forEach(function (_, key) {
|
174
|
+
checkedCopy.set(key, false);
|
175
|
+
});
|
176
|
+
if (!isCurrentChecked) {
|
177
|
+
checkedCopy.set(item.value, 'done');
|
178
|
+
(0, _utils2.updateSingleAncestors)(item, checkedCopy, 'dot');
|
179
|
+
}
|
167
180
|
if (closeAfterSelect) {
|
168
181
|
dispatchPath({
|
169
182
|
type: 'reset'
|
@@ -235,7 +248,7 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
|
|
235
248
|
}
|
236
249
|
}
|
237
250
|
setChecked(checkedCopy);
|
238
|
-
}, [
|
251
|
+
}, [value]);
|
239
252
|
return /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
240
253
|
ref: ref,
|
241
254
|
size: size,
|
@@ -159,7 +159,7 @@ var useKeyNavigation = exports.useKeyNavigation = function useKeyNavigation(_ref
|
|
159
159
|
}
|
160
160
|
case keys.Backspace:
|
161
161
|
{
|
162
|
-
if (!multiselect
|
162
|
+
if (!multiselect) break;
|
163
163
|
if (focusedChipIndex !== null) {
|
164
164
|
var _currentItem = valueToItemMap.get(value[focusedChipIndex]);
|
165
165
|
handlePressDown(_currentItem);
|
@@ -41,7 +41,7 @@ var getLabel = function getLabel(_ref) {
|
|
41
41
|
text: renderValue ? renderValue(valueToItemMap.get(currentValue)) : itemLabel,
|
42
42
|
onClick: function onClick(e) {
|
43
43
|
e.stopPropagation();
|
44
|
-
onChipClick(currentValue
|
44
|
+
onChipClick(currentValue);
|
45
45
|
},
|
46
46
|
focused: focusedChipIndex === index
|
47
47
|
});
|