@salutejs/plasma-new-hope 0.229.0-canary.1666.12456056975.0 → 0.230.0-canary.1670.12462995068.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/cjs/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/cjs/components/Breadcrumbs/utils/index.js +38 -0
- package/cjs/components/Breadcrumbs/utils/index.js.map +1 -1
- package/cjs/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +3 -2
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +75 -0
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +112 -0
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -2
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.js +3 -2
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +25 -0
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Select/Select.js +3 -2
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/ui/Inner/Inner.css +109 -0
- package/cjs/components/Select/ui/Inner/Inner.js +1 -1
- package/cjs/components/Select/ui/Inner/Inner.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.css +112 -0
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js +2 -2
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Slider/components/Double/Double.css +91 -0
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +7 -0
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
- package/cjs/components/TextArea/TextArea.js +6 -0
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextField/TextField.js +1 -0
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/engines/common.js +36 -0
- package/cjs/engines/common.js.map +1 -1
- package/cjs/engines/linaria.js +3 -3
- package/cjs/engines/linaria.js.map +1 -1
- package/emotion/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/emotion/cjs/components/Breadcrumbs/utils/index.js +37 -1
- package/emotion/cjs/components/Calendar/utils/getDateWithModification.js +3 -3
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +4 -3
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/cjs/components/Dropdown/Dropdown.js +4 -3
- package/emotion/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +3 -3
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/emotion/cjs/components/Select/Select.js +4 -3
- package/emotion/cjs/components/Select/ui/Inner/Inner.js +3 -3
- package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +3 -3
- package/emotion/cjs/components/TextArea/TextArea.js +7 -1
- package/emotion/cjs/components/TextField/TextField.js +2 -1
- package/emotion/cjs/engines/common.js +42 -2
- package/emotion/cjs/engines/emotion.js +4 -4
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/emotion/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/emotion/es/components/Breadcrumbs/utils/index.js +35 -0
- package/emotion/es/components/Calendar/utils/getDateWithModification.js +1 -1
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +2 -2
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/es/components/Dropdown/Dropdown.js +2 -2
- package/emotion/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/emotion/es/components/Select/Select.js +2 -2
- package/emotion/es/components/Select/ui/Inner/Inner.js +1 -1
- package/emotion/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/emotion/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +1 -1
- package/emotion/es/components/TextArea/TextArea.js +8 -2
- package/emotion/es/components/TextField/TextField.js +2 -1
- package/emotion/es/engines/common.js +40 -0
- package/emotion/es/engines/emotion.js +2 -2
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/es/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/es/components/Breadcrumbs/utils/index.js +37 -1
- package/es/components/Breadcrumbs/utils/index.js.map +1 -1
- package/es/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +3 -3
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +75 -0
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +112 -0
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Dropdown/Dropdown.js +3 -3
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +25 -0
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Select/Select.js +3 -3
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/ui/Inner/Inner.css +109 -0
- package/es/components/Select/ui/Inner/Inner.js +1 -1
- package/es/components/Select/ui/Inner/Inner.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.css +112 -0
- package/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Slider/components/Double/Double.css +91 -0
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +7 -0
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
- package/es/components/TextArea/TextArea.js +7 -1
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextField/TextField.js +1 -0
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/engines/common.js +36 -2
- package/es/engines/common.js.map +1 -1
- package/es/engines/linaria.js +1 -1
- package/es/engines/linaria.js.map +1 -1
- package/package.json +5 -17
- package/styled-components/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/styled-components/cjs/components/Breadcrumbs/utils/index.js +37 -1
- package/styled-components/cjs/components/Calendar/utils/getDateWithModification.js +3 -3
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +4 -3
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/cjs/components/Dropdown/Dropdown.js +4 -3
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +3 -3
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/styled-components/cjs/components/Select/Select.js +4 -3
- package/styled-components/cjs/components/Select/ui/Inner/Inner.js +3 -3
- package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +3 -3
- package/styled-components/cjs/components/TextArea/TextArea.js +6 -0
- package/styled-components/cjs/components/TextField/TextField.js +1 -0
- package/styled-components/cjs/engines/common.js +42 -2
- package/styled-components/cjs/engines/styled-components.js +3 -3
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/styled-components/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/styled-components/es/components/Breadcrumbs/utils/index.js +35 -0
- package/styled-components/es/components/Calendar/utils/getDateWithModification.js +1 -1
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +2 -2
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/es/components/Dropdown/Dropdown.js +2 -2
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
- package/styled-components/es/components/Select/Select.js +2 -2
- package/styled-components/es/components/Select/ui/Inner/Inner.js +1 -1
- package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
- package/styled-components/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +1 -1
- package/styled-components/es/components/TextArea/TextArea.js +7 -1
- package/styled-components/es/components/TextField/TextField.js +1 -0
- package/styled-components/es/engines/common.js +40 -0
- package/styled-components/es/engines/styled-components.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
- package/types/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/types/components/Breadcrumbs/utils/index.d.ts +5 -2
- package/types/components/Breadcrumbs/utils/index.d.ts.map +1 -1
- package/types/components/Calendar/utils/getDateWithModification.d.ts +1 -1
- package/types/components/Calendar/utils/getDateWithModification.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts +2 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts +2 -1
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts +2 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/engines/common.d.ts +3 -1
- package/types/engines/common.d.ts.map +1 -1
- package/cjs/components/Breadcrumbs/ui/BreadcrumbShorter/BreadcrumbShorter.css +0 -3
- package/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -44
- package/cjs/components/Breadcrumbs/utils/getShortItems.js.map +0 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -10
- package/cjs/components/Combobox/ComboboxNew/Combobox.context.js.map +0 -1
- package/cjs/components/Dropdown/Dropdown.context.js +0 -10
- package/cjs/components/Dropdown/Dropdown.context.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.css +0 -27
- package/cjs/components/Select/Select.context.js +0 -10
- package/cjs/components/Select/Select.context.js.map +0 -1
- package/cjs/engines/utils.js +0 -40
- package/cjs/engines/utils.js.map +0 -1
- package/emotion/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -42
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -8
- package/emotion/cjs/components/Dropdown/Dropdown.context.js +0 -8
- package/emotion/cjs/components/Select/Select.context.js +0 -8
- package/emotion/cjs/engines/utils.js +0 -42
- package/emotion/es/components/Breadcrumbs/utils/getShortItems.js +0 -35
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -2
- package/emotion/es/components/Dropdown/Dropdown.context.js +0 -2
- package/emotion/es/components/Select/Select.context.js +0 -2
- package/emotion/es/engines/utils.js +0 -36
- package/es/components/Breadcrumbs/ui/BreadcrumbShorter/BreadcrumbShorter.css +0 -3
- package/es/components/Breadcrumbs/utils/getShortItems.js +0 -39
- package/es/components/Breadcrumbs/utils/getShortItems.js.map +0 -1
- package/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -6
- package/es/components/Combobox/ComboboxNew/Combobox.context.js.map +0 -1
- package/es/components/Dropdown/Dropdown.context.js +0 -6
- package/es/components/Dropdown/Dropdown.context.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.css +0 -27
- package/es/components/Select/Select.context.js +0 -6
- package/es/components/Select/Select.context.js.map +0 -1
- package/es/engines/utils.js +0 -35
- package/es/engines/utils.js.map +0 -1
- package/styled-components/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -42
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -8
- package/styled-components/cjs/components/Dropdown/Dropdown.context.js +0 -8
- package/styled-components/cjs/components/Select/Select.context.js +0 -8
- package/styled-components/cjs/engines/utils.js +0 -42
- package/styled-components/es/components/Breadcrumbs/utils/getShortItems.js +0 -35
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -2
- package/styled-components/es/components/Dropdown/Dropdown.context.js +0 -2
- package/styled-components/es/components/Select/Select.context.js +0 -2
- package/styled-components/es/engines/utils.js +0 -36
- package/types/components/Breadcrumbs/utils/getShortItems.d.ts +0 -6
- package/types/components/Breadcrumbs/utils/getShortItems.d.ts.map +0 -1
- package/types/components/Combobox/ComboboxNew/Combobox.context.d.ts +0 -4
- package/types/components/Combobox/ComboboxNew/Combobox.context.d.ts.map +0 -1
- package/types/components/Dropdown/Dropdown.context.d.ts +0 -4
- package/types/components/Dropdown/Dropdown.context.d.ts.map +0 -1
- package/types/components/Select/Select.context.d.ts +0 -4
- package/types/components/Select/Select.context.d.ts.map +0 -1
- package/types/engines/utils.d.ts +0 -4
- package/types/engines/utils.d.ts.map +0 -1
- /package/cjs/components/Breadcrumbs/utils/{getShortItems.css → index.css} +0 -0
- /package/es/components/Breadcrumbs/utils/{getShortItems.css → index.css} +0 -0
package/package.json
CHANGED
@@ -1,22 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.230.0-canary.1670.12462995068.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
|
-
"main": "
|
6
|
-
"module": "
|
7
|
-
"types": "
|
8
|
-
"exports": {
|
9
|
-
".": {
|
10
|
-
"require": "./cjs/index.js",
|
11
|
-
"import": "./es/index.js",
|
12
|
-
"types": "./types/index.d.ts"
|
13
|
-
},
|
14
|
-
"./styled-components": {
|
15
|
-
"require": "./styled-components/cjs/index.js",
|
16
|
-
"import": "./styled-components/es/index.js",
|
17
|
-
"types": "./types/index.d.ts"
|
18
|
-
}
|
19
|
-
},
|
5
|
+
"main": "cjs/index.js",
|
6
|
+
"module": "es/index.js",
|
7
|
+
"types": "types/index.d.ts",
|
20
8
|
"files": [
|
21
9
|
"cjs",
|
22
10
|
"es",
|
@@ -140,5 +128,5 @@
|
|
140
128
|
"sideEffects": [
|
141
129
|
"*.css"
|
142
130
|
],
|
143
|
-
"gitHead": "
|
131
|
+
"gitHead": "63f7c34e142b4b79944a0dfc1e4aab4616ee3413"
|
144
132
|
}
|
@@ -11,7 +11,6 @@ var _base = /*#__PURE__*/require("./variations/_size/base");
|
|
11
11
|
var _base2 = /*#__PURE__*/require("./variations/_view/base");
|
12
12
|
var _Breadcrumbs = /*#__PURE__*/require("./Breadcrumbs.styles");
|
13
13
|
var _utils2 = /*#__PURE__*/require("./utils");
|
14
|
-
var _getShortItems = /*#__PURE__*/require("./utils/getShortItems");
|
15
14
|
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); }
|
16
15
|
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; }
|
17
16
|
var breadcrumbsRoot = exports.breadcrumbsRoot = function breadcrumbsRoot(Root) {
|
@@ -27,7 +26,7 @@ var breadcrumbsRoot = exports.breadcrumbsRoot = function breadcrumbsRoot(Root) {
|
|
27
26
|
color: "inherit",
|
28
27
|
size: (0, _utils2.convertIconSize)(size)
|
29
28
|
});
|
30
|
-
var renderItems = (0,
|
29
|
+
var renderItems = (0, _utils2.getRenderItems)(items, renderSeparator, showItems);
|
31
30
|
var itemsWithSeparator = (0, _utils2.addSeparator)(renderItems, renderSeparator);
|
32
31
|
return /*#__PURE__*/_react["default"].createElement(Root, {
|
33
32
|
ref: outerRootRef,
|
@@ -3,7 +3,24 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.convertIconSize = exports.addSeparator = void 0;
|
6
|
+
exports.shortItems = exports.getRenderItems = exports.convertIconSize = exports.addSeparator = void 0;
|
7
|
+
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
|
+
var _BreadcrumbShorter = /*#__PURE__*/require("../ui/BreadcrumbShorter/BreadcrumbShorter");
|
9
|
+
var _Breadcrumbs = /*#__PURE__*/require("../Breadcrumbs.styles");
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
|
+
var shortItems = exports.shortItems = function shortItems(items, renderSeparator, showItems) {
|
12
|
+
if (!showItems || showItems < 2 || items.length <= showItems) {
|
13
|
+
return items;
|
14
|
+
}
|
15
|
+
var leftSlice = Math.floor(showItems / 2);
|
16
|
+
var rightSlice = items.length - leftSlice - showItems % 2;
|
17
|
+
var renderItems = items.slice(leftSlice, rightSlice);
|
18
|
+
var shorter = /*#__PURE__*/_react["default"].createElement(_BreadcrumbShorter.BreadcrumbShorter, {
|
19
|
+
separator: renderSeparator
|
20
|
+
}, renderItems);
|
21
|
+
items.splice(leftSlice, rightSlice - leftSlice, shorter);
|
22
|
+
return items;
|
23
|
+
};
|
7
24
|
var convertIconSize = exports.convertIconSize = function convertIconSize(size) {
|
8
25
|
switch (size) {
|
9
26
|
case 's':
|
@@ -13,6 +30,25 @@ var convertIconSize = exports.convertIconSize = function convertIconSize(size) {
|
|
13
30
|
return 's';
|
14
31
|
}
|
15
32
|
};
|
33
|
+
var getRenderItems = exports.getRenderItems = function getRenderItems(items, renderSeparator, showItems) {
|
34
|
+
var renderItems = shortItems(items.map(function (item) {
|
35
|
+
if (item.renderItem) {
|
36
|
+
return item.renderItem();
|
37
|
+
}
|
38
|
+
var title = item.title,
|
39
|
+
disabled = item.disabled,
|
40
|
+
href = item.href,
|
41
|
+
onClick = item.onClick;
|
42
|
+
return /*#__PURE__*/_react["default"].createElement(_Breadcrumbs.StyledLink, {
|
43
|
+
tabIndex: 0,
|
44
|
+
href: href,
|
45
|
+
disabled: disabled,
|
46
|
+
onClick: onClick,
|
47
|
+
isHref: Boolean(href || onClick)
|
48
|
+
}, title);
|
49
|
+
}), renderSeparator, showItems);
|
50
|
+
return renderItems;
|
51
|
+
};
|
16
52
|
var addSeparator = exports.addSeparator = function addSeparator(items, renderSeparator) {
|
17
53
|
return items.flatMap(function (item, idx) {
|
18
54
|
return idx < items.length - 1 ? [item, renderSeparator] : [item];
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.getDatesWithModifications = void 0;
|
7
7
|
var _types = /*#__PURE__*/require("../store/types");
|
8
|
-
var
|
8
|
+
var _ = /*#__PURE__*/require(".");
|
9
9
|
var dateOperationHandler = {
|
10
10
|
Days: {
|
11
11
|
add: function add(date) {
|
@@ -144,8 +144,8 @@ var getDatesWithModifications = exports.getDatesWithModifications = function get
|
|
144
144
|
includeEdgeDates = _ref3.includeEdgeDates,
|
145
145
|
min = _ref3.min,
|
146
146
|
max = _ref3.max;
|
147
|
-
var eventsMap = (0,
|
148
|
-
var disabledDatesMap = (0,
|
147
|
+
var eventsMap = (0, _.getPropsMap)(eventList);
|
148
|
+
var disabledDatesMap = (0, _.getPropsMap)(disabledList);
|
149
149
|
var filteredDates = type === _types.CalendarState.Days ? dates.filter(function (_ref4) {
|
150
150
|
var isDayInCurrentMonth = _ref4.isDayInCurrentMonth;
|
151
151
|
return isDayInCurrentMonth;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.comboboxRoot = exports.comboboxConfig = void 0;
|
6
|
+
exports.comboboxRoot = exports.comboboxConfig = exports.Context = void 0;
|
7
7
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
8
8
|
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
9
9
|
var _utils = /*#__PURE__*/require("../../../utils");
|
@@ -20,7 +20,6 @@ var _Combobox2 = /*#__PURE__*/require("./Combobox.styles");
|
|
20
20
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
21
21
|
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
22
22
|
var _SelectNative = /*#__PURE__*/require("./ui/SelectNative/SelectNative");
|
23
|
-
var _Combobox3 = /*#__PURE__*/require("./Combobox.context");
|
24
23
|
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"];
|
25
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); }
|
26
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; }
|
@@ -38,6 +37,8 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
38
37
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
39
38
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
40
39
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
40
|
+
var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)({});
|
41
|
+
|
41
42
|
/**
|
42
43
|
* Поле ввода с выпадающим списком и возможностью фильтрации и выбора элементов.
|
43
44
|
*/
|
@@ -407,7 +408,7 @@ var comboboxRoot = exports.comboboxRoot = function comboboxRoot(Root) {
|
|
407
408
|
onChange: onChange,
|
408
409
|
onSetValue: setInternalValue,
|
409
410
|
ref: ref
|
410
|
-
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(
|
411
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(Context.Provider, {
|
411
412
|
value: {
|
412
413
|
focusedPath: focusedPath,
|
413
414
|
checked: checked,
|
@@ -10,7 +10,7 @@ var _utils = /*#__PURE__*/require("../../../../utils");
|
|
10
10
|
var _Combobox = /*#__PURE__*/require("../../../../Combobox.tokens");
|
11
11
|
var _utils2 = /*#__PURE__*/require("../../../../../../../utils");
|
12
12
|
var _Icon = /*#__PURE__*/require("../../../../../../_Icon");
|
13
|
-
var _Combobox2 = /*#__PURE__*/require("../../../../Combobox
|
13
|
+
var _Combobox2 = /*#__PURE__*/require("../../../../Combobox");
|
14
14
|
var _hooks = /*#__PURE__*/require("../../../../../../../hooks");
|
15
15
|
var _Item = /*#__PURE__*/require("./Item.styles");
|
16
16
|
var _StyledIndicator;
|
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
5
5
|
value: true
|
6
6
|
});
|
7
|
-
exports.dropdownRoot = exports.dropdownConfig = void 0;
|
7
|
+
exports.dropdownRoot = exports.dropdownConfig = exports.Context = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
9
|
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
10
10
|
var _utils = /*#__PURE__*/require("../../utils");
|
@@ -20,7 +20,6 @@ var _Dropdown2 = /*#__PURE__*/require("./Dropdown.tokens");
|
|
20
20
|
var _useKeyboardNavigation = /*#__PURE__*/require("./hooks/useKeyboardNavigation");
|
21
21
|
var _useHashMaps3 = /*#__PURE__*/require("./hooks/useHashMaps");
|
22
22
|
var _FloatingPopover = /*#__PURE__*/require("./FloatingPopover");
|
23
|
-
var _Dropdown3 = /*#__PURE__*/require("./Dropdown.context");
|
24
23
|
var _excluded = ["items", "children", "placement", "offset", "closeOnOverlayClick", "onToggle", "size", "view", "itemRole", "className", "listWidth", "listHeight", "listOverflow", "closeOnSelect", "onHover", "onItemSelect", "onItemClick", "trigger", "variant", "hasArrow", "alwaysOpened", "portal", "renderItem", "zIndex", "beforeList", "afterList"];
|
25
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); }
|
26
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; }
|
@@ -33,6 +32,8 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
33
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
34
33
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
35
34
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
35
|
+
var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)({});
|
36
|
+
|
36
37
|
/**
|
37
38
|
* Выпадающий список.
|
38
39
|
*/
|
@@ -135,7 +136,7 @@ var dropdownRoot = exports.dropdownRoot = function dropdownRoot(Root) {
|
|
135
136
|
}),
|
136
137
|
onKeyDown = _useKeyNavigation.onKeyDown;
|
137
138
|
var isCurrentListOpen = alwaysOpened || Boolean(path[0]);
|
138
|
-
return /*#__PURE__*/_react["default"].createElement(
|
139
|
+
return /*#__PURE__*/_react["default"].createElement(Context.Provider, {
|
139
140
|
value: {
|
140
141
|
focusedPath: focusedPath,
|
141
142
|
size: size,
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.DropdownInner = void 0;
|
7
7
|
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
8
|
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
9
|
-
var
|
9
|
+
var _ = /*#__PURE__*/require("..");
|
10
10
|
var _Dropdown = /*#__PURE__*/require("../../Dropdown.styles");
|
11
11
|
var _FloatingPopover = /*#__PURE__*/require("../../FloatingPopover");
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
@@ -44,7 +44,7 @@ var DropdownInner = exports.DropdownInner = function DropdownInner(_ref) {
|
|
44
44
|
opened: isCurrentListOpen,
|
45
45
|
onToggle: handleToggle,
|
46
46
|
trigger: trigger,
|
47
|
-
target: /*#__PURE__*/_react["default"].createElement(
|
47
|
+
target: /*#__PURE__*/_react["default"].createElement(_.DropdownItem, {
|
48
48
|
item: item,
|
49
49
|
index: index,
|
50
50
|
path: path,
|
@@ -77,7 +77,7 @@ var DropdownInner = exports.DropdownInner = function DropdownInner(_ref) {
|
|
77
77
|
});
|
78
78
|
})));
|
79
79
|
}
|
80
|
-
return /*#__PURE__*/_react["default"].createElement(
|
80
|
+
return /*#__PURE__*/_react["default"].createElement(_.DropdownItem, {
|
81
81
|
item: item,
|
82
82
|
path: path,
|
83
83
|
index: index,
|
@@ -9,7 +9,7 @@ var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react")
|
|
9
9
|
var _Dropdown = /*#__PURE__*/require("../../Dropdown.tokens");
|
10
10
|
var _utils = /*#__PURE__*/require("../../../../utils");
|
11
11
|
var _Icon = /*#__PURE__*/require("../../../_Icon");
|
12
|
-
var _Dropdown2 = /*#__PURE__*/require("../../Dropdown
|
12
|
+
var _Dropdown2 = /*#__PURE__*/require("../../Dropdown");
|
13
13
|
var _utils2 = /*#__PURE__*/require("../../utils");
|
14
14
|
var _DropdownItem = /*#__PURE__*/require("./DropdownItem.styles");
|
15
15
|
var _excluded = ["value", "label", "disabled", "isDisabled", "contentLeft", "contentRight", "dividerBefore", "dividerAfter", "className"];
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.selectRoot = exports.selectConfig = void 0;
|
6
|
+
exports.selectRoot = exports.selectConfig = exports.Context = void 0;
|
7
7
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
8
8
|
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
9
9
|
var _utils = /*#__PURE__*/require("../../utils");
|
@@ -16,7 +16,6 @@ var _usePathMaps3 = /*#__PURE__*/require("./hooks/usePathMaps");
|
|
16
16
|
var _Select = /*#__PURE__*/require("./Select.styles");
|
17
17
|
var _FloatingPopover = /*#__PURE__*/require("./FloatingPopover");
|
18
18
|
var _SelectNative = /*#__PURE__*/require("./ui/SelectNative/SelectNative");
|
19
|
-
var _Select2 = /*#__PURE__*/require("./Select.context");
|
20
19
|
var _excluded = ["value", "onChange", "target", "items", "placement", "label", "labelPlacement", "placeholder", "helperText", "disabled", "view", "size", "listOverflow", "listHeight", "listWidth", "contentLeft", "onScrollBottom", "chipView", "variant", "portal", "renderValue", "renderItem", "status", "onItemSelect", "separator", "closeAfterSelect", "isTargetAmount", "beforeList", "afterList", "zIndex", "name", "defaultValue"];
|
21
20
|
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); }
|
22
21
|
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; }
|
@@ -30,6 +29,8 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
30
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
31
30
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
32
31
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
32
|
+
var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)({});
|
33
|
+
|
33
34
|
/**
|
34
35
|
* Выпадающий список. Поддерживает выбор одного или нескольких значений.
|
35
36
|
*/
|
@@ -308,7 +309,7 @@ var selectRoot = exports.selectRoot = function selectRoot(Root) {
|
|
308
309
|
onChange: onChange,
|
309
310
|
onSetValue: setInternalValue,
|
310
311
|
ref: ref
|
311
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
312
|
+
}), /*#__PURE__*/_react["default"].createElement(Context.Provider, {
|
312
313
|
value: {
|
313
314
|
focusedPath: focusedPath,
|
314
315
|
checked: checked,
|
@@ -9,7 +9,7 @@ var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
|
9
9
|
var _utils = /*#__PURE__*/require("../../../../utils");
|
10
10
|
var _Select = /*#__PURE__*/require("../../Select.styles");
|
11
11
|
var _FloatingPopover = /*#__PURE__*/require("../../FloatingPopover");
|
12
|
-
var
|
12
|
+
var _ui = /*#__PURE__*/require("./ui");
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
14
14
|
var Inner = exports.Inner = function Inner(_ref) {
|
15
15
|
var item = _ref.item,
|
@@ -43,7 +43,7 @@ var Inner = exports.Inner = function Inner(_ref) {
|
|
43
43
|
opened: isCurrentListOpen,
|
44
44
|
onToggle: handleToggle,
|
45
45
|
offset: 2,
|
46
|
-
target: /*#__PURE__*/_react["default"].createElement(
|
46
|
+
target: /*#__PURE__*/_react["default"].createElement(_ui.Item, {
|
47
47
|
item: item,
|
48
48
|
path: path,
|
49
49
|
currentLevel: currentLevel,
|
@@ -70,7 +70,7 @@ var Inner = exports.Inner = function Inner(_ref) {
|
|
70
70
|
});
|
71
71
|
})));
|
72
72
|
}
|
73
|
-
return /*#__PURE__*/_react["default"].createElement(
|
73
|
+
return /*#__PURE__*/_react["default"].createElement(_ui.Item, {
|
74
74
|
item: item,
|
75
75
|
path: path,
|
76
76
|
index: index,
|
@@ -10,7 +10,7 @@ var _utils = /*#__PURE__*/require("../../../../utils");
|
|
10
10
|
var _Select = /*#__PURE__*/require("../../../../Select.tokens");
|
11
11
|
var _utils2 = /*#__PURE__*/require("../../../../../../utils");
|
12
12
|
var _Icon = /*#__PURE__*/require("../../../../../_Icon");
|
13
|
-
var _Select2 = /*#__PURE__*/require("../../../../Select
|
13
|
+
var _Select2 = /*#__PURE__*/require("../../../../Select");
|
14
14
|
var _hooks = /*#__PURE__*/require("../../../../../../hooks");
|
15
15
|
var _Item = /*#__PURE__*/require("./Item.styles");
|
16
16
|
var _StyledIndicator;
|
package/styled-components/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js
CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports.DoubleUncontrolled = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var
|
9
|
+
var _index = /*#__PURE__*/require("../index");
|
10
10
|
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); }
|
11
11
|
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; }
|
12
12
|
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); }
|
@@ -90,10 +90,10 @@ var DoubleUncontrolled = exports.DoubleUncontrolled = function DoubleUncontrolle
|
|
90
90
|
setSliderValue(sortValue);
|
91
91
|
}
|
92
92
|
}, [name, value, onChange, sortValues]);
|
93
|
-
return value ? /*#__PURE__*/_react["default"].createElement(
|
93
|
+
return value ? /*#__PURE__*/_react["default"].createElement(_index.DoubleSlider, _extends({}, props, {
|
94
94
|
value: value,
|
95
95
|
onChange: onChange
|
96
|
-
})) : /*#__PURE__*/_react["default"].createElement(
|
96
|
+
})) : /*#__PURE__*/_react["default"].createElement(_index.DoubleSlider, _extends({
|
97
97
|
value: sliderValue,
|
98
98
|
onKeyDownTextField: onKeyDownTextField,
|
99
99
|
onBlurTextField: onBlurTextField,
|
@@ -200,6 +200,11 @@ var textAreaRoot = exports.textAreaRoot = function textAreaRoot(Root) {
|
|
200
200
|
setIsHintVisible(true);
|
201
201
|
}
|
202
202
|
};
|
203
|
+
(0, _react.useLayoutEffect)(function () {
|
204
|
+
if (outerRef.current) {
|
205
|
+
setUncontrolledValue(outerRef.current.value);
|
206
|
+
}
|
207
|
+
}, [outerRef]);
|
203
208
|
(0, _plasmaCore.useResizeObserver)(outerRef, function (currentElement) {
|
204
209
|
var inlineWidth = currentElement.style.width;
|
205
210
|
if (inlineWidth || cols) {
|
@@ -305,6 +310,7 @@ var textAreaRoot = exports.textAreaRoot = function textAreaRoot(Root) {
|
|
305
310
|
applyCustomWidth: applyCustomWidth,
|
306
311
|
ref: (0, _utils.mergeRefs)(outerRef, innerRef),
|
307
312
|
disabled: disabled,
|
313
|
+
required: required,
|
308
314
|
height: applyAutoResize ? minAuto : height,
|
309
315
|
width: width,
|
310
316
|
placeholder: placeholderLabel,
|
@@ -398,6 +398,7 @@ var textFieldRoot = exports.textFieldRoot = function textFieldRoot(Root) {
|
|
398
398
|
ref: inputForkRef,
|
399
399
|
id: innerId,
|
400
400
|
value: outerValue,
|
401
|
+
required: required,
|
401
402
|
"aria-labelledby": labelId,
|
402
403
|
"aria-describedby": helperTextId,
|
403
404
|
placeholder: innerPlaceholderValue,
|
@@ -1,20 +1,60 @@
|
|
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); }
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
4
5
|
value: true
|
5
6
|
});
|
6
7
|
exports.component = component;
|
7
|
-
exports.mergeConfig = void 0;
|
8
|
+
exports.mergeConfig = exports.getStaticVariants = exports.getDynamicVariants = void 0;
|
8
9
|
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
9
10
|
var _styledComponents = /*#__PURE__*/require("./styled-components");
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
|
-
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); }
|
12
12
|
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); }
|
13
13
|
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; }
|
14
14
|
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; }
|
15
15
|
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; }
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
17
17
|
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); }
|
18
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
19
|
+
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."); }
|
20
|
+
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); }
|
21
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
22
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
23
|
+
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; }
|
24
|
+
//
|
25
|
+
// Тип HTMLAttributesOmitOnChange требуется чтобы использовать компонент с кастомным пропсом onChange
|
26
|
+
//
|
27
|
+
|
28
|
+
var getStaticVariants = exports.getStaticVariants = function getStaticVariants(config) {
|
29
|
+
if (!config.variations) {
|
30
|
+
return [];
|
31
|
+
}
|
32
|
+
var res = [];
|
33
|
+
var variations = config.variations;
|
34
|
+
|
35
|
+
// eslint-disable-next-line guard-for-in
|
36
|
+
for (var key in variations) {
|
37
|
+
var css = variations[key].css;
|
38
|
+
css && res.push(css);
|
39
|
+
}
|
40
|
+
return res;
|
41
|
+
};
|
42
|
+
var getDynamicVariants = exports.getDynamicVariants = function getDynamicVariants(config) {
|
43
|
+
return function (props) {
|
44
|
+
var res = [];
|
45
|
+
|
46
|
+
// eslint-disable-next-line guard-for-in
|
47
|
+
for (var key in config.variations) {
|
48
|
+
if (key in props) {
|
49
|
+
var variant = config.variations[key];
|
50
|
+
var css = variant[props[key]];
|
51
|
+
// no css for { modifier: true }
|
52
|
+
css && Array.isArray(css) ? res.push.apply(res, _toConsumableArray(css)) : res.push(css);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
return res;
|
56
|
+
};
|
57
|
+
};
|
18
58
|
var mergeConfig = exports.mergeConfig = function mergeConfig(baseConfig, userConfig) {
|
19
59
|
var res = _objectSpread(_objectSpread({}, baseConfig), userConfig);
|
20
60
|
if (res.variations) {
|
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "styled", {
|
|
19
19
|
});
|
20
20
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
21
21
|
var _styledComponents = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("styled-components"));
|
22
|
-
var
|
22
|
+
var _common = /*#__PURE__*/require("./common");
|
23
23
|
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); }
|
24
24
|
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; }
|
25
25
|
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); }
|
@@ -40,8 +40,8 @@ var Root = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
40
40
|
var _component = exports._component = function _component(componentConfig) {
|
41
41
|
var tag = componentConfig.tag,
|
42
42
|
base = componentConfig.base;
|
43
|
-
var staticVariants = (0,
|
44
|
-
var dynamicVariants = (0,
|
43
|
+
var staticVariants = (0, _common.getStaticVariants)(componentConfig);
|
44
|
+
var dynamicVariants = (0, _common.getDynamicVariants)(componentConfig);
|
45
45
|
return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
46
46
|
return /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
47
47
|
as: tag,
|
@@ -13,6 +13,8 @@ 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'];
|
17
|
+
const views = ['default', 'positive', 'warning', 'negative'];
|
16
18
|
const hintViews = ['default'];
|
17
19
|
const hintSizes = ['m', 's'];
|
18
20
|
const hintTriggers = ['hover', 'click'];
|
@@ -67,22 +69,23 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
67
69
|
},
|
68
70
|
if: { arg: 'required', truthy: false },
|
69
71
|
},
|
70
|
-
|
72
|
+
size: {
|
73
|
+
options: sizes,
|
74
|
+
defaultValue: 'm',
|
71
75
|
control: {
|
72
|
-
type: '
|
76
|
+
type: 'select',
|
73
77
|
},
|
74
|
-
if: { arg: 'clear', truthy: false },
|
75
78
|
},
|
76
|
-
|
79
|
+
view: {
|
80
|
+
options: views,
|
77
81
|
control: {
|
78
|
-
type: '
|
82
|
+
type: 'select',
|
79
83
|
},
|
80
|
-
if: { arg: 'clear', truthy: false },
|
81
84
|
},
|
82
85
|
labelPlacement: {
|
83
86
|
options: labelPlacements,
|
84
87
|
control: {
|
85
|
-
type: '
|
88
|
+
type: 'select',
|
86
89
|
},
|
87
90
|
},
|
88
91
|
hasDivider: {
|
@@ -91,6 +94,23 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
91
94
|
},
|
92
95
|
if: { arg: 'clear', truthy: true },
|
93
96
|
},
|
97
|
+
cols: {
|
98
|
+
control: {
|
99
|
+
type: 'number',
|
100
|
+
},
|
101
|
+
if: { arg: 'clear', truthy: false },
|
102
|
+
},
|
103
|
+
rows: {
|
104
|
+
control: {
|
105
|
+
type: 'number',
|
106
|
+
},
|
107
|
+
if: { arg: 'clear', truthy: false },
|
108
|
+
},
|
109
|
+
hasHint: {
|
110
|
+
control: {
|
111
|
+
type: 'boolean',
|
112
|
+
},
|
113
|
+
},
|
94
114
|
hintText: {
|
95
115
|
control: { type: 'text' },
|
96
116
|
if: { arg: 'hasHint', truthy: true },
|
@@ -132,7 +152,50 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
132
152
|
control: { type: 'text' },
|
133
153
|
if: { arg: 'hasHint', truthy: true },
|
134
154
|
},
|
135
|
-
|
155
|
+
helperText: {
|
156
|
+
control: { type: 'text' },
|
157
|
+
},
|
158
|
+
width: {
|
159
|
+
control: { type: 'text' },
|
160
|
+
},
|
161
|
+
height: {
|
162
|
+
control: { type: 'text' },
|
163
|
+
},
|
164
|
+
leftHelper: {
|
165
|
+
control: { type: 'text' },
|
166
|
+
},
|
167
|
+
titleCaption: {
|
168
|
+
control: { type: 'text' },
|
169
|
+
},
|
170
|
+
rightHelper: {
|
171
|
+
control: { type: 'text' },
|
172
|
+
},
|
173
|
+
...disableProps([
|
174
|
+
'helperBlock',
|
175
|
+
'$isFocused',
|
176
|
+
'contentRight',
|
177
|
+
'autoComplete',
|
178
|
+
'autoFocus',
|
179
|
+
'dirName',
|
180
|
+
'form',
|
181
|
+
'minLength',
|
182
|
+
'maxLength',
|
183
|
+
'name',
|
184
|
+
'value',
|
185
|
+
'wrap',
|
186
|
+
'theme',
|
187
|
+
'as',
|
188
|
+
'forwardedAs',
|
189
|
+
'onChange',
|
190
|
+
'onFocus',
|
191
|
+
'onBlur',
|
192
|
+
'leftHelperPlacement',
|
193
|
+
'status',
|
194
|
+
'hintTargetIcon',
|
195
|
+
'hintOffset',
|
196
|
+
'hintContentLeft',
|
197
|
+
'hintView',
|
198
|
+
]),
|
136
199
|
},
|
137
200
|
args: {
|
138
201
|
id: 'example-textarea',
|