@salutejs/plasma-new-hope 0.262.0-canary.1759.13235886296.0 → 0.262.0-canary.1761.13279424878.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 +9 -3
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.js +39 -0
- package/cjs/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.js.map +1 -0
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +8 -3
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.js +33 -0
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/index.js +11 -0
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +13 -14
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +1 -1
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +13 -14
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +1 -1
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +9 -4
- package/emotion/es/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.js +26 -0
- package/emotion/es/components/Combobox/ComboboxNew/ui/index.js +2 -1
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +13 -14
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +1 -1
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.config.js +13 -14
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +9 -3
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.js +30 -0
- package/es/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.js.map +1 -0
- package/package.json +3 -2
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +8 -3
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.js +33 -0
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/index.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +1 -2
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +1 -2
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +1 -1
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +9 -4
- package/styled-components/es/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.js +26 -0
- package/styled-components/es/components/Combobox/ComboboxNew/ui/index.js +2 -1
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +1 -2
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.config.js +1 -2
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +6 -0
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.d.ts +9 -0
- package/types/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.d.ts.map +1 -0
- package/types/components/Combobox/ComboboxNew/ui/index.d.ts +1 -0
- package/types/components/Combobox/ComboboxNew/ui/index.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +48 -0
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts +0 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts +0 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Combobox/Combobox.d.ts +48 -0
- package/types/examples/plasma_web/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts +0 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.d.ts +0 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.d.ts.map +1 -1
- /package/cjs/components/Combobox/ComboboxNew/ui/{Inner/ui/Item/Item.css → VirtualList/VirtualList.css} +0 -0
- /package/es/components/Combobox/ComboboxNew/ui/{Inner/ui/Item/Item.css → VirtualList/VirtualList.css} +0 -0
@@ -13,7 +13,7 @@ import { config } from './TextArea.config';
|
|
13
13
|
import { TextArea } from './TextArea';
|
14
14
|
|
15
15
|
const labelPlacements = ['inner', 'outer'];
|
16
|
-
const sizes = ['xs', 's', 'm', 'l'
|
16
|
+
const sizes = ['xs', 's', 'm', 'l'];
|
17
17
|
const hintViews = ['default'];
|
18
18
|
const hintSizes = ['m', 's'];
|
19
19
|
const hintTriggers = ['hover', 'click'];
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["name", "multiple", "value", "onChange", "defaultValue", "isTargetAmount", "targetAmount", "items", "placement", "label", "placeholder", "helperText", "contentLeft", "textBefore", "textAfter", "variant", "listOverflow", "listHeight", "listWidth", "portal", "renderItem", "view", "size", "labelPlacement", "keepPlaceholder", "readOnly", "disabled", "alwaysOpened", "filter", "closeAfterSelect", "renderValue", "zIndex", "beforeList", "afterList", "hintView", "hintSize"];
|
1
|
+
var _excluded = ["name", "multiple", "value", "onChange", "defaultValue", "isTargetAmount", "targetAmount", "items", "placement", "label", "placeholder", "helperText", "contentLeft", "textBefore", "textAfter", "variant", "listOverflow", "listHeight", "listWidth", "portal", "renderItem", "view", "size", "labelPlacement", "keepPlaceholder", "readOnly", "disabled", "alwaysOpened", "filter", "closeAfterSelect", "renderValue", "zIndex", "beforeList", "afterList", "virtual", "hintView", "hintSize"];
|
2
2
|
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); }
|
3
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
4
4
|
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."); }
|
@@ -22,7 +22,7 @@ import { classes } from './Combobox.tokens';
|
|
22
22
|
import { FloatingPopover } from './FloatingPopover';
|
23
23
|
import { useKeyNavigation, getItemByFocused } from './hooks/useKeyboardNavigation';
|
24
24
|
import { initialItemsTransform, updateAncestors, updateDescendants, updateSingleAncestors, filterItems, getItemId, getInitialValue } from './utils';
|
25
|
-
import { Inner, StyledTextField } from './ui';
|
25
|
+
import { Inner, StyledTextField, VirtualList } from './ui';
|
26
26
|
import { pathReducer, focusedPathReducer } from './reducers';
|
27
27
|
import { getPathMap, getTreeMaps } from './hooks/getPathMaps';
|
28
28
|
import { Ul, base, StyledArrow, IconArrowWrapper, StyledEmptyState } from './Combobox.styles';
|
@@ -77,6 +77,8 @@ export var comboboxRoot = function comboboxRoot(Root) {
|
|
77
77
|
zIndex = props.zIndex,
|
78
78
|
beforeList = props.beforeList,
|
79
79
|
afterList = props.afterList,
|
80
|
+
_props$virtual = props.virtual,
|
81
|
+
virtual = _props$virtual === void 0 ? false : _props$virtual,
|
80
82
|
hintView = props.hintView,
|
81
83
|
hintSize = props.hintSize,
|
82
84
|
rest = _objectWithoutProperties(props, _excluded);
|
@@ -483,7 +485,10 @@ export var comboboxRoot = function comboboxRoot(Root) {
|
|
483
485
|
listOverflow: listOverflow,
|
484
486
|
listWidth: listWidth,
|
485
487
|
ref: targetRef
|
486
|
-
},
|
488
|
+
}, virtual ? /*#__PURE__*/React.createElement(VirtualList, {
|
489
|
+
items: filteredItems,
|
490
|
+
listHeight: listHeight
|
491
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null, beforeList, isEmpty(filteredItems) ? /*#__PURE__*/React.createElement(StyledEmptyState, {
|
487
492
|
className: classes.emptyStateWrapper,
|
488
493
|
size: size,
|
489
494
|
description: "\u041D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E"
|
@@ -497,7 +502,7 @@ export var comboboxRoot = function comboboxRoot(Root) {
|
|
497
502
|
index: index,
|
498
503
|
listWidth: listWidth
|
499
504
|
});
|
500
|
-
}), afterList))))));
|
505
|
+
}), afterList)))))));
|
501
506
|
});
|
502
507
|
};
|
503
508
|
export var comboboxConfig = {
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import List from 'rc-virtual-list';
|
3
|
+
import { Item } from '../Inner/ui';
|
4
|
+
var getHeight = function getHeight(listHeight) {
|
5
|
+
if (!listHeight) return 300;
|
6
|
+
if (typeof listHeight === 'number') return listHeight;
|
7
|
+
return parseInt(listHeight, 10);
|
8
|
+
};
|
9
|
+
export var VirtualList = function VirtualList(_ref) {
|
10
|
+
var items = _ref.items,
|
11
|
+
listHeight = _ref.listHeight;
|
12
|
+
return /*#__PURE__*/React.createElement(List, {
|
13
|
+
data: items,
|
14
|
+
height: getHeight(listHeight),
|
15
|
+
itemHeight: 100,
|
16
|
+
itemKey: "id"
|
17
|
+
}, function (item, index, props) {
|
18
|
+
return /*#__PURE__*/React.createElement("div", props, /*#__PURE__*/React.createElement(Item, {
|
19
|
+
item: item,
|
20
|
+
path: ['root'],
|
21
|
+
currentLevel: 0,
|
22
|
+
index: index,
|
23
|
+
ariaLevel: 1
|
24
|
+
}));
|
25
|
+
});
|
26
|
+
};
|