@salutejs/plasma-hope 1.387.0 → 1.387.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Button/views/b2c/ButtonB2C.d.ts +1 -1
- package/components/Button/views/web/ButtonWeb.d.ts +1 -1
- package/components/Card/CardBadge.d.ts +12 -1
- package/components/Card/CardBadge.d.ts.map +1 -1
- package/components/Card/CardBadge.js +19 -4
- package/components/PreviewGallery/PreviewGalleryItemBase.d.ts +1 -1
- package/components/PreviewGallery/PreviewGalleryItemBase.d.ts.map +1 -1
- package/components/PreviewGallery/PreviewGalleryItemBase.js +1 -2
- package/components/Upload/UploadMessage.d.ts.map +1 -1
- package/components/Upload/UploadMessage.js +2 -2
- package/es/components/Card/CardBadge.js +17 -3
- package/es/components/PreviewGallery/PreviewGalleryItemBase.js +1 -2
- package/es/components/Upload/UploadMessage.js +1 -1
- package/es/index.js +0 -10
- package/index.d.ts +0 -10
- package/index.js +0 -110
- package/package.json +11 -11
- package/components/Badge/Badge.d.ts +0 -21
- package/components/Badge/Badge.d.ts.map +0 -1
- package/components/Badge/Badge.js +0 -30
- package/components/Badge/index.d.ts +0 -5
- package/components/Badge/index.d.ts.map +0 -1
- package/components/Badge/index.js +0 -25
- package/components/Cell/Cell.d.ts +0 -18
- package/components/Cell/Cell.d.ts.map +0 -1
- package/components/Cell/Cell.js +0 -32
- package/components/Cell/index.d.ts +0 -3
- package/components/Cell/index.d.ts.map +0 -1
- package/components/Cell/index.js +0 -12
- package/components/Dropdown/Dropdown.component-test.js +0 -547
- package/components/Dropdown/Dropdown.d.ts +0 -20
- package/components/Dropdown/Dropdown.d.ts.map +0 -1
- package/components/Dropdown/Dropdown.js +0 -64
- package/components/Dropdown/Dropdown.types.d.ts +0 -16
- package/components/Dropdown/Dropdown.types.d.ts.map +0 -1
- package/components/Dropdown/Dropdown.types.js +0 -7
- package/components/Dropdown/DropdownItem.d.ts +0 -30
- package/components/Dropdown/DropdownItem.d.ts.map +0 -1
- package/components/Dropdown/DropdownItem.js +0 -122
- package/components/Dropdown/DropdownList.d.ts +0 -22
- package/components/Dropdown/DropdownList.d.ts.map +0 -1
- package/components/Dropdown/DropdownList.js +0 -23
- package/components/Dropdown/DropdownMenu.d.ts +0 -30
- package/components/Dropdown/DropdownMenu.d.ts.map +0 -1
- package/components/Dropdown/DropdownMenu.js +0 -60
- package/components/Dropdown/DropdownPopup.d.ts +0 -18
- package/components/Dropdown/DropdownPopup.d.ts.map +0 -1
- package/components/Dropdown/DropdownPopup.js +0 -47
- package/components/Dropdown/DropdownUncontrolled.d.ts +0 -12
- package/components/Dropdown/DropdownUncontrolled.d.ts.map +0 -1
- package/components/Dropdown/DropdownUncontrolled.js +0 -69
- package/components/Dropdown/index.d.ts +0 -13
- package/components/Dropdown/index.d.ts.map +0 -1
- package/components/Dropdown/index.js +0 -53
- package/components/Dropdown/keyboardNavigation/index.d.ts +0 -2
- package/components/Dropdown/keyboardNavigation/index.d.ts.map +0 -1
- package/components/Dropdown/keyboardNavigation/index.js +0 -18
- package/components/Dropdown/keyboardNavigation/useKeyboardNavigation.d.ts +0 -20
- package/components/Dropdown/keyboardNavigation/useKeyboardNavigation.d.ts.map +0 -1
- package/components/Dropdown/keyboardNavigation/useKeyboardNavigation.js +0 -58
- package/components/Dropdown/keyboardNavigation/useOnComboType.d.ts +0 -6
- package/components/Dropdown/keyboardNavigation/useOnComboType.d.ts.map +0 -1
- package/components/Dropdown/keyboardNavigation/useOnComboType.js +0 -30
- package/components/Dropdown/keyboardNavigation/useSearchString.d.ts +0 -5
- package/components/Dropdown/keyboardNavigation/useSearchString.d.ts.map +0 -1
- package/components/Dropdown/keyboardNavigation/useSearchString.js +0 -46
- package/components/Dropdown/keyboardNavigation/utils.d.ts +0 -39
- package/components/Dropdown/keyboardNavigation/utils.d.ts.map +0 -1
- package/components/Dropdown/keyboardNavigation/utils.js +0 -175
- package/components/Dropdown/withAssistiveDropdown.d.ts +0 -27
- package/components/Dropdown/withAssistiveDropdown.d.ts.map +0 -1
- package/components/Dropdown/withAssistiveDropdown.js +0 -134
- package/components/Editable/Editable.component-test.js +0 -114
- package/components/Editable/Editable.d.ts +0 -36
- package/components/Editable/Editable.d.ts.map +0 -1
- package/components/Editable/Editable.js +0 -154
- package/components/Editable/index.d.ts +0 -2
- package/components/Editable/index.d.ts.map +0 -1
- package/components/Editable/index.js +0 -16
- package/components/List/List.d.ts +0 -3
- package/components/List/List.d.ts.map +0 -1
- package/components/List/List.js +0 -14
- package/components/List/ListItem.d.ts +0 -3
- package/components/List/ListItem.d.ts.map +0 -1
- package/components/List/ListItem.js +0 -14
- package/components/List/index.d.ts +0 -3
- package/components/List/index.d.ts.map +0 -1
- package/components/List/index.js +0 -19
- package/components/Price/Price.d.ts +0 -8
- package/components/Price/Price.d.ts.map +0 -1
- package/components/Price/Price.js +0 -17
- package/components/Price/index.d.ts +0 -3
- package/components/Price/index.d.ts.map +0 -1
- package/components/Price/index.js +0 -12
- package/components/Select/Select.d.ts +0 -35
- package/components/Select/Select.d.ts.map +0 -1
- package/components/Select/Select.js +0 -38
- package/components/Select/Select.utils.d.ts +0 -18
- package/components/Select/Select.utils.d.ts.map +0 -1
- package/components/Select/Select.utils.js +0 -50
- package/components/Select/SelectButton.d.ts +0 -20
- package/components/Select/SelectButton.d.ts.map +0 -1
- package/components/Select/SelectButton.js +0 -75
- package/components/Select/SelectDropdown.d.ts +0 -6
- package/components/Select/SelectDropdown.d.ts.map +0 -1
- package/components/Select/SelectDropdown.js +0 -16
- package/components/Select/SelectGroup.d.ts +0 -2
- package/components/Select/SelectGroup.d.ts.map +0 -1
- package/components/Select/SelectGroup.js +0 -13
- package/components/Select/SelectView.d.ts +0 -18
- package/components/Select/SelectView.d.ts.map +0 -1
- package/components/Select/SelectView.js +0 -29
- package/components/Select/index.d.ts +0 -5
- package/components/Select/index.d.ts.map +0 -1
- package/components/Select/index.js +0 -19
- package/components/Select/types.d.ts +0 -4
- package/components/Select/types.d.ts.map +0 -1
- package/components/Select/types.js +0 -5
- package/components/Select/views/b2c/SelectButton.d.ts +0 -4
- package/components/Select/views/b2c/SelectButton.d.ts.map +0 -1
- package/components/Select/views/b2c/SelectButton.js +0 -18
- package/components/Select/views/b2c/SelectDropdown.d.ts +0 -2
- package/components/Select/views/b2c/SelectDropdown.d.ts.map +0 -1
- package/components/Select/views/b2c/SelectDropdown.js +0 -11
- package/components/Select/views/b2c/SelectView.d.ts +0 -7
- package/components/Select/views/b2c/SelectView.d.ts.map +0 -1
- package/components/Select/views/b2c/SelectView.js +0 -76
- package/components/Select/views/web/SelectView.d.ts +0 -7
- package/components/Select/views/web/SelectView.d.ts.map +0 -1
- package/components/Select/views/web/SelectView.js +0 -73
- package/components/Select/withMultiSelect.d.ts +0 -24
- package/components/Select/withMultiSelect.d.ts.map +0 -1
- package/components/Select/withMultiSelect.js +0 -54
- package/components/Select/withSingleSelect.d.ts +0 -20
- package/components/Select/withSingleSelect.d.ts.map +0 -1
- package/components/Select/withSingleSelect.js +0 -47
- package/components/Slider/Slider.d.ts +0 -4
- package/components/Slider/Slider.d.ts.map +0 -1
- package/components/Slider/Slider.js +0 -14
- package/components/Slider/index.d.ts +0 -2
- package/components/Slider/index.d.ts.map +0 -1
- package/components/Slider/index.js +0 -12
- package/components/Switch/Switch.d.ts +0 -6
- package/components/Switch/Switch.d.ts.map +0 -1
- package/components/Switch/Switch.js +0 -17
- package/components/Switch/index.d.ts +0 -3
- package/components/Switch/index.d.ts.map +0 -1
- package/components/Switch/index.js +0 -12
- package/components/Typography/Body/index.d.ts +0 -2
- package/components/Typography/Body/index.d.ts.map +0 -1
- package/components/Typography/Body/index.js +0 -18
- package/components/Typography/Button/index.d.ts +0 -2
- package/components/Typography/Button/index.d.ts.map +0 -1
- package/components/Typography/Button/index.js +0 -18
- package/components/Typography/Caption/index.d.ts +0 -2
- package/components/Typography/Caption/index.d.ts.map +0 -1
- package/components/Typography/Caption/index.js +0 -12
- package/components/Typography/Footnote/index.d.ts +0 -2
- package/components/Typography/Footnote/index.d.ts.map +0 -1
- package/components/Typography/Footnote/index.js +0 -18
- package/components/Typography/Headline/index.d.ts +0 -4
- package/components/Typography/Headline/index.d.ts.map +0 -1
- package/components/Typography/Headline/index.js +0 -52
- package/components/Typography/Paragraph/index.d.ts +0 -2
- package/components/Typography/Paragraph/index.d.ts.map +0 -1
- package/components/Typography/Paragraph/index.js +0 -36
- package/components/Typography/Subtitle/index.d.ts +0 -2
- package/components/Typography/Subtitle/index.d.ts.map +0 -1
- package/components/Typography/Subtitle/index.js +0 -21
- package/components/Typography/Underline/index.d.ts +0 -2
- package/components/Typography/Underline/index.d.ts.map +0 -1
- package/components/Typography/Underline/index.js +0 -12
- package/components/Typography/index.d.ts +0 -11
- package/components/Typography/index.d.ts.map +0 -1
- package/components/Typography/index.js +0 -223
- package/es/components/Badge/Badge.js +0 -22
- package/es/components/Badge/index.js +0 -2
- package/es/components/Cell/Cell.js +0 -25
- package/es/components/Cell/index.js +0 -1
- package/es/components/Dropdown/Dropdown.component-test.js +0 -544
- package/es/components/Dropdown/Dropdown.js +0 -55
- package/es/components/Dropdown/Dropdown.types.js +0 -3
- package/es/components/Dropdown/DropdownItem.js +0 -114
- package/es/components/Dropdown/DropdownList.js +0 -15
- package/es/components/Dropdown/DropdownMenu.js +0 -53
- package/es/components/Dropdown/DropdownPopup.js +0 -39
- package/es/components/Dropdown/DropdownUncontrolled.js +0 -61
- package/es/components/Dropdown/index.js +0 -6
- package/es/components/Dropdown/keyboardNavigation/index.js +0 -1
- package/es/components/Dropdown/keyboardNavigation/useKeyboardNavigation.js +0 -52
- package/es/components/Dropdown/keyboardNavigation/useOnComboType.js +0 -24
- package/es/components/Dropdown/keyboardNavigation/useSearchString.js +0 -40
- package/es/components/Dropdown/keyboardNavigation/utils.js +0 -170
- package/es/components/Dropdown/withAssistiveDropdown.js +0 -126
- package/es/components/Editable/Editable.component-test.js +0 -111
- package/es/components/Editable/Editable.js +0 -145
- package/es/components/Editable/index.js +0 -1
- package/es/components/List/List.js +0 -7
- package/es/components/List/ListItem.js +0 -7
- package/es/components/List/index.js +0 -2
- package/es/components/Price/Price.js +0 -10
- package/es/components/Price/index.js +0 -1
- package/es/components/Select/Select.js +0 -29
- package/es/components/Select/Select.utils.js +0 -44
- package/es/components/Select/SelectButton.js +0 -67
- package/es/components/Select/SelectDropdown.js +0 -9
- package/es/components/Select/SelectGroup.js +0 -6
- package/es/components/Select/SelectView.js +0 -21
- package/es/components/Select/index.js +0 -2
- package/es/components/Select/types.js +0 -1
- package/es/components/Select/views/b2c/SelectButton.js +0 -12
- package/es/components/Select/views/b2c/SelectDropdown.js +0 -5
- package/es/components/Select/views/b2c/SelectView.js +0 -67
- package/es/components/Select/views/web/SelectView.js +0 -64
- package/es/components/Select/withMultiSelect.js +0 -46
- package/es/components/Select/withSingleSelect.js +0 -39
- package/es/components/Slider/Slider.js +0 -7
- package/es/components/Slider/index.js +0 -1
- package/es/components/Switch/Switch.js +0 -10
- package/es/components/Switch/index.js +0 -1
- package/es/components/Typography/Body/index.js +0 -1
- package/es/components/Typography/Button/index.js +0 -1
- package/es/components/Typography/Caption/index.js +0 -1
- package/es/components/Typography/Footnote/index.js +0 -1
- package/es/components/Typography/Headline/index.js +0 -20
- package/es/components/Typography/Paragraph/index.js +0 -1
- package/es/components/Typography/Subtitle/index.js +0 -14
- package/es/components/Typography/Underline/index.js +0 -1
- package/es/components/Typography/index.js +0 -9
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React, { FormEventHandler, ClipboardEventHandler, FocusEventHandler } from 'react';
|
|
2
|
-
import * as typography from '../Typography';
|
|
3
|
-
type RefElement = HTMLDivElement | HTMLSpanElement;
|
|
4
|
-
export interface EditableProps {
|
|
5
|
-
value?: string;
|
|
6
|
-
onChange?: FormEventHandler<RefElement>;
|
|
7
|
-
onBlur?: FocusEventHandler<HTMLDivElement>;
|
|
8
|
-
onPaste?: ClipboardEventHandler<HTMLDivElement>;
|
|
9
|
-
spellCheck?: 'true' | 'false';
|
|
10
|
-
/**
|
|
11
|
-
* Максимальная длина текста в символах
|
|
12
|
-
*/
|
|
13
|
-
maxLength?: number;
|
|
14
|
-
/**
|
|
15
|
-
* Компонент, для которого будет добавлена возможность редактирования
|
|
16
|
-
*/
|
|
17
|
-
textComponent: typeof typography[keyof typeof typography];
|
|
18
|
-
/**
|
|
19
|
-
* Иконка справа от текста, для корректной работы hover на иконке нужно добавить свойство color="inherit"
|
|
20
|
-
*/
|
|
21
|
-
icon?: React.ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* Текст для placeholder и aria-label
|
|
24
|
-
*/
|
|
25
|
-
placeholder?: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Компонент, добавляющий возможность редактирования к текстовому компоненту
|
|
29
|
-
*
|
|
30
|
-
* Для указания альтернативного фона у иконки справа от текста
|
|
31
|
-
* можно указать css переменную --plasma-editable-icon-background в контейнере элемента
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
export declare const Editable: React.FC<EditableProps>;
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=Editable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Editable.d.ts","sourceRoot":"","sources":["../../src/components/Editable/Editable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAMV,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EAEpB,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AA0C5C,KAAK,UAAU,GAAG,cAAc,GAAG,eAAe,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC,MAAM,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,qBAAqB,CAAC,cAAc,CAAC,CAAC;IAChD,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,aAAa,EAAE,OAAO,UAAU,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;IAC1D;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkI5C,CAAC"}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.Editable = void 0;
|
|
8
|
-
var _react = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("react"));
|
|
9
|
-
var _styledComponents = /*#__PURE__*/_interopRequireDefault(/*#__PURE__*/require("styled-components"));
|
|
10
|
-
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
|
11
|
-
var _utils = /*#__PURE__*/require("../../utils");
|
|
12
|
-
var _collectPackageInfo = /*#__PURE__*/require("../../collectPackageInfo");
|
|
13
|
-
var _excluded = ["textComponent", "value", "icon", "maxLength", "spellCheck", "onChange", "onBlur", "onPaste", "placeholder"];
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
16
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
17
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
19
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
20
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
21
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
22
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
23
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
24
|
-
(0, _collectPackageInfo.collectPackageInfo)('Editable/Editable');
|
|
25
|
-
var KeyCodes = /*#__PURE__*/function (KeyCodes) {
|
|
26
|
-
KeyCodes[KeyCodes["ENTER"] = 13] = "ENTER";
|
|
27
|
-
KeyCodes[KeyCodes["ESCAPE"] = 27] = "ESCAPE";
|
|
28
|
-
return KeyCodes;
|
|
29
|
-
}(KeyCodes || {});
|
|
30
|
-
var EditButton = /*#__PURE__*/_styledComponents["default"].span.withConfig({
|
|
31
|
-
componentId: "plasma-web-core__sc-dgyiy9-0"
|
|
32
|
-
})(["position:relative;background:var( --plasma-editable-icon-background,linear-gradient(270deg,", " 70%,rgba(0,0,0,0) 120%) );padding-left:1rem;color:", ";align-self:stretch;", ""], _plasmaCore.background, _plasmaCore.tertiary, function (_ref) {
|
|
33
|
-
var $isHidden = _ref.$isHidden;
|
|
34
|
-
return $isHidden ? 'display: none;' : '';
|
|
35
|
-
});
|
|
36
|
-
var StyledContainer = /*#__PURE__*/_styledComponents["default"].span.withConfig({
|
|
37
|
-
componentId: "plasma-web-core__sc-dgyiy9-1"
|
|
38
|
-
})(["display:flex;align-items:center;max-width:100%;cursor:pointer;&:hover > ", "{color:", ";}"], EditButton, _plasmaCore.text);
|
|
39
|
-
var extraComponentStyles = {
|
|
40
|
-
whiteSpace: 'nowrap',
|
|
41
|
-
overflow: 'hidden',
|
|
42
|
-
marginRight: '-1rem',
|
|
43
|
-
paddingRight: '1rem',
|
|
44
|
-
outline: 'none',
|
|
45
|
-
caretColor: 'var(--plasma-colors-accent)'
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Компонент, добавляющий возможность редактирования к текстовому компоненту
|
|
49
|
-
*
|
|
50
|
-
* Для указания альтернативного фона у иконки справа от текста
|
|
51
|
-
* можно указать css переменную --plasma-editable-icon-background в контейнере элемента
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
var Editable = exports.Editable = function Editable(_ref2) {
|
|
55
|
-
var textComponent = _ref2.textComponent,
|
|
56
|
-
value = _ref2.value,
|
|
57
|
-
icon = _ref2.icon,
|
|
58
|
-
maxLength = _ref2.maxLength,
|
|
59
|
-
_ref2$spellCheck = _ref2.spellCheck,
|
|
60
|
-
spellCheck = _ref2$spellCheck === void 0 ? 'false' : _ref2$spellCheck,
|
|
61
|
-
onChange = _ref2.onChange,
|
|
62
|
-
onBlur = _ref2.onBlur,
|
|
63
|
-
onPaste = _ref2.onPaste,
|
|
64
|
-
placeholder = _ref2.placeholder,
|
|
65
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
66
|
-
var Component = textComponent;
|
|
67
|
-
var _useState = (0, _react.useState)(false),
|
|
68
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
69
|
-
isEditing = _useState2[0],
|
|
70
|
-
setIsEditing = _useState2[1];
|
|
71
|
-
var inputRef = (0, _react.useRef)(null);
|
|
72
|
-
var prevValueRef = (0, _react.useRef)(value || '');
|
|
73
|
-
var handlePaste = (0, _react.useCallback)(function (e) {
|
|
74
|
-
if (!inputRef.current) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
var text = e.clipboardData.getData('text/plain').replace(/[\n\r]/gi, '');
|
|
79
|
-
if (document.queryCommandSupported('insertText')) {
|
|
80
|
-
document.execCommand('insertText', false, text);
|
|
81
|
-
} else {
|
|
82
|
-
try {
|
|
83
|
-
navigator.clipboard.writeText(text);
|
|
84
|
-
} catch (_unused) {
|
|
85
|
-
inputRef.current.textContent = text;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (onPaste) {
|
|
89
|
-
onPaste(e);
|
|
90
|
-
}
|
|
91
|
-
}, [onPaste]);
|
|
92
|
-
var handleBlur = (0, _react.useCallback)(function (e) {
|
|
93
|
-
setIsEditing(false);
|
|
94
|
-
(0, _utils.clearSelection)();
|
|
95
|
-
if (onBlur) {
|
|
96
|
-
onBlur(e);
|
|
97
|
-
}
|
|
98
|
-
}, [onBlur]);
|
|
99
|
-
var handleFocus = (0, _react.useCallback)(function () {
|
|
100
|
-
setIsEditing(true);
|
|
101
|
-
inputRef.current && (0, _utils.selectText)(inputRef.current);
|
|
102
|
-
}, []);
|
|
103
|
-
var handleEditClick = (0, _react.useCallback)(function () {
|
|
104
|
-
var _inputRef$current;
|
|
105
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
106
|
-
}, []);
|
|
107
|
-
var handleKeyDown = (0, _react.useCallback)(function (e) {
|
|
108
|
-
if ([KeyCodes.ENTER, KeyCodes.ESCAPE].includes(e.keyCode)) {
|
|
109
|
-
var _inputRef$current2;
|
|
110
|
-
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.blur();
|
|
111
|
-
}
|
|
112
|
-
}, []);
|
|
113
|
-
var handleChange = (0, _react.useCallback)(function (e) {
|
|
114
|
-
var _inputRef$current$tex;
|
|
115
|
-
if (!inputRef.current) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
var contentLength = ((_inputRef$current$tex = inputRef.current.textContent) === null || _inputRef$current$tex === void 0 ? void 0 : _inputRef$current$tex.length) || 0;
|
|
119
|
-
if (!maxLength || contentLength <= maxLength) {
|
|
120
|
-
prevValueRef.current = inputRef.current.textContent || '';
|
|
121
|
-
onChange && onChange(e);
|
|
122
|
-
} else {
|
|
123
|
-
inputRef.current.textContent = prevValueRef.current;
|
|
124
|
-
}
|
|
125
|
-
}, [maxLength, onChange]);
|
|
126
|
-
(0, _react.useEffect)(function () {
|
|
127
|
-
if (!inputRef.current) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
if (typeof value === 'undefined') {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
if (value === inputRef.current.textContent) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
inputRef.current.textContent = value;
|
|
137
|
-
}, [value, textComponent]);
|
|
138
|
-
return /*#__PURE__*/_react["default"].createElement(StyledContainer, props, /*#__PURE__*/_react["default"].createElement(Component, {
|
|
139
|
-
ref: inputRef,
|
|
140
|
-
style: extraComponentStyles,
|
|
141
|
-
role: "textbox",
|
|
142
|
-
spellCheck: spellCheck,
|
|
143
|
-
contentEditable: true,
|
|
144
|
-
onPaste: handlePaste,
|
|
145
|
-
onInput: handleChange,
|
|
146
|
-
onBlur: handleBlur,
|
|
147
|
-
onFocus: handleFocus,
|
|
148
|
-
onKeyDown: handleKeyDown,
|
|
149
|
-
"aria-label": placeholder
|
|
150
|
-
}), /*#__PURE__*/_react["default"].createElement(EditButton, {
|
|
151
|
-
onClick: handleEditClick,
|
|
152
|
-
$isHidden: isEditing
|
|
153
|
-
}, icon));
|
|
154
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/Editable/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _Editable = /*#__PURE__*/require("./Editable");
|
|
7
|
-
Object.keys(_Editable).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _Editable[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _Editable[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/components/List/List.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEnE,eAAO,MAAM,IAAI,6EAKhB,CAAC"}
|
package/components/List/List.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.List = void 0;
|
|
7
|
-
var _styledComponents = /*#__PURE__*/_interopRequireDefault(/*#__PURE__*/require("styled-components"));
|
|
8
|
-
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
|
9
|
-
var _collectPackageInfo = /*#__PURE__*/require("../../collectPackageInfo");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
-
(0, _collectPackageInfo.collectPackageInfo)('List/List');
|
|
12
|
-
var List = exports.List = /*#__PURE__*/_styledComponents["default"].ul.withConfig({
|
|
13
|
-
componentId: "plasma-web-core__sc-zvesl8-0"
|
|
14
|
-
})(["margin:0;padding:0;", ""], _plasmaCore.applySpacing);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../src/components/List/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEnE,eAAO,MAAM,QAAQ,6EAIpB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ListItem = void 0;
|
|
7
|
-
var _styledComponents = /*#__PURE__*/_interopRequireDefault(/*#__PURE__*/require("styled-components"));
|
|
8
|
-
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
|
9
|
-
var _collectPackageInfo = /*#__PURE__*/require("../../collectPackageInfo");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
-
(0, _collectPackageInfo.collectPackageInfo)('List/ListItem');
|
|
12
|
-
var ListItem = exports.ListItem = /*#__PURE__*/_styledComponents["default"].li.withConfig({
|
|
13
|
-
componentId: "plasma-web-core__sc-hp7rr5-0"
|
|
14
|
-
})(["list-style:none;", ""], _plasmaCore.applySpacing);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/List/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/components/List/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "List", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _List.List;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "ListItem", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _ListItem.ListItem;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _List = /*#__PURE__*/require("./List");
|
|
19
|
-
var _ListItem = /*#__PURE__*/require("./ListItem");
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { PriceProps as BaseProps } from '@salutejs/plasma-core';
|
|
2
|
-
export interface PriceProps extends BaseProps {
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Компонент для отображения цены / стоимости / суммы.
|
|
6
|
-
*/
|
|
7
|
-
export declare const Price: import("styled-components").StyledComponent<import("react").FC<BaseProps>, any, {}, never>;
|
|
8
|
-
//# sourceMappingURL=Price.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Price.d.ts","sourceRoot":"","sources":["../../src/components/Price/Price.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,UAAW,SAAQ,SAAS;CAAG;AAEhD;;GAEG;AACH,eAAO,MAAM,KAAK,4FAAsB,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Price = void 0;
|
|
7
|
-
var _styledComponents = /*#__PURE__*/_interopRequireDefault(/*#__PURE__*/require("styled-components"));
|
|
8
|
-
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
|
9
|
-
var _collectPackageInfo = /*#__PURE__*/require("../../collectPackageInfo");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
-
(0, _collectPackageInfo.collectPackageInfo)('Price/Price');
|
|
12
|
-
/**
|
|
13
|
-
* Компонент для отображения цены / стоимости / суммы.
|
|
14
|
-
*/
|
|
15
|
-
var Price = exports.Price = /*#__PURE__*/(0, _styledComponents["default"])(_plasmaCore.Price).withConfig({
|
|
16
|
-
componentId: "plasma-web-core__sc-1uuh6mu-0"
|
|
17
|
-
})([""]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/Price/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ReactElement, RefAttributes } from 'react';
|
|
2
|
-
import type { DropdownListCssProperties } from '../Dropdown';
|
|
3
|
-
import type { SelectViewProps } from './SelectView';
|
|
4
|
-
import type { SelectRefElement } from './SelectButton';
|
|
5
|
-
import type { Design } from './types';
|
|
6
|
-
export type SelectProps<T = any> = ({
|
|
7
|
-
/**
|
|
8
|
-
* Выбор нескольких значений.
|
|
9
|
-
*/
|
|
10
|
-
multiselect?: false;
|
|
11
|
-
/**
|
|
12
|
-
* Разделитель выбранных значений.
|
|
13
|
-
*/
|
|
14
|
-
separator?: never;
|
|
15
|
-
} | {
|
|
16
|
-
/**
|
|
17
|
-
* Выбор нескольких значений.
|
|
18
|
-
*/
|
|
19
|
-
multiselect?: true;
|
|
20
|
-
/**
|
|
21
|
-
* Разделитель выбранных значений.
|
|
22
|
-
*/
|
|
23
|
-
separator?: string;
|
|
24
|
-
}) & {
|
|
25
|
-
/**
|
|
26
|
-
* Значение control.
|
|
27
|
-
*/
|
|
28
|
-
value: T;
|
|
29
|
-
/**
|
|
30
|
-
* Обработчик изменения значения.
|
|
31
|
-
*/
|
|
32
|
-
onChange?: (value: T) => void;
|
|
33
|
-
} & Omit<SelectViewProps, 'onItemClick' | 'value' | 'label' | 'multiselect'> & DropdownListCssProperties;
|
|
34
|
-
export declare const Select: ({ design }: Design) => <T>(props: SelectProps<T> & RefAttributes<SelectRefElement>) => ReactElement;
|
|
35
|
-
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAc,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAM7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,GAAG,IAAI,CAC7B;IACI;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;CACrB,GACD;IACI;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CACN,GAAG;IACA;;OAEG;IACH,KAAK,EAAE,CAAC,CAAC;IACT;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CACjC,GAAG,IAAI,CAAC,eAAe,EAAE,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC,GACxE,yBAAyB,CAAC;AAS9B,eAAO,MAAM,MAAM,eAAgB,MAAM,KAM/B,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,gBAAgB,CAAC,KAAK,YAAY,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.Select = void 0;
|
|
8
|
-
var _react = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("react"));
|
|
9
|
-
var _styledComponents = /*#__PURE__*/_interopRequireDefault(/*#__PURE__*/require("styled-components"));
|
|
10
|
-
var _Dropdown = /*#__PURE__*/require("../Dropdown");
|
|
11
|
-
var _SelectView = /*#__PURE__*/require("./SelectView");
|
|
12
|
-
var _withSingleSelect = /*#__PURE__*/require("./withSingleSelect");
|
|
13
|
-
var _withMultiSelect = /*#__PURE__*/require("./withMultiSelect");
|
|
14
|
-
var _collectPackageInfo = /*#__PURE__*/require("../../collectPackageInfo");
|
|
15
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
18
|
-
(0, _collectPackageInfo.collectPackageInfo)('Select/Select');
|
|
19
|
-
var StyledSelectView = /*#__PURE__*/(0, _styledComponents["default"])(_SelectView.SelectView).withConfig({
|
|
20
|
-
componentId: "plasma-web-core__sc-m9l8to-0"
|
|
21
|
-
})(["", ";"], _Dropdown.applyDropdownListCssProperties);
|
|
22
|
-
var SingleSelect = /*#__PURE__*/(0, _withSingleSelect.withSingleSelect)(StyledSelectView);
|
|
23
|
-
var MultiSelect = /*#__PURE__*/(0, _withMultiSelect.withMultiSelect)(StyledSelectView);
|
|
24
|
-
var Select = exports.Select = function Select(_ref) {
|
|
25
|
-
var design = _ref.design;
|
|
26
|
-
return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
27
|
-
if (props.multiselect) {
|
|
28
|
-
return /*#__PURE__*/_react["default"].createElement(MultiSelect, _extends({
|
|
29
|
-
design: design,
|
|
30
|
-
ref: ref
|
|
31
|
-
}, props));
|
|
32
|
-
}
|
|
33
|
-
return /*#__PURE__*/_react["default"].createElement(SingleSelect, _extends({
|
|
34
|
-
design: design,
|
|
35
|
-
ref: ref
|
|
36
|
-
}, props));
|
|
37
|
-
});
|
|
38
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DropdownNodeType } from '../Dropdown';
|
|
2
|
-
/**
|
|
3
|
-
* Пройдется по списку рекурсивно, вернув новый список с подсписками, поднятыми на верхний уровень.
|
|
4
|
-
*/
|
|
5
|
-
export declare const flattenItemsRecursive: (list: DropdownNodeType[]) => DropdownNodeType[];
|
|
6
|
-
/**
|
|
7
|
-
* Пройдется по списку рекурсивно, вернув новый список с новыми объектами с флагом `isActive`.
|
|
8
|
-
*/
|
|
9
|
-
export declare const setActiveRecursive: (list: DropdownNodeType[], isActive: (item: DropdownNodeType) => boolean) => {
|
|
10
|
-
isActive: boolean;
|
|
11
|
-
items?: Array<DropdownNodeType>;
|
|
12
|
-
isDisabled?: boolean;
|
|
13
|
-
value: string | number;
|
|
14
|
-
label: string;
|
|
15
|
-
color?: string;
|
|
16
|
-
contentLeft?: import("react").ReactNode;
|
|
17
|
-
}[];
|
|
18
|
-
//# sourceMappingURL=Select.utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.utils.d.ts","sourceRoot":"","sources":["../../src/components/Select/Select.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,qBAAqB,SAAU,gBAAgB,EAAE,uBASpD,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB,SAAU,gBAAgB,EAAE,YAAY,CAAC,IAAI,EAAE,gBAAgB,KAAK,OAAO;;;;;;;;GASpG,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.setActiveRecursive = exports.flattenItemsRecursive = void 0;
|
|
8
|
-
var _excluded = ["items"];
|
|
9
|
-
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; }
|
|
10
|
-
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; }
|
|
11
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
13
|
-
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); }
|
|
14
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
15
|
-
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."); }
|
|
16
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
17
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
18
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
19
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
20
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
21
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
22
|
-
/**
|
|
23
|
-
* Пройдется по списку рекурсивно, вернув новый список с подсписками, поднятыми на верхний уровень.
|
|
24
|
-
*/
|
|
25
|
-
var flattenItemsRecursive = exports.flattenItemsRecursive = function flattenItemsRecursive(list) {
|
|
26
|
-
return list.reduce(function (acc, _ref) {
|
|
27
|
-
var items = _ref.items,
|
|
28
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
-
acc.push(rest);
|
|
30
|
-
if (items) {
|
|
31
|
-
acc.push.apply(acc, _toConsumableArray(flattenItemsRecursive(items)));
|
|
32
|
-
}
|
|
33
|
-
return acc;
|
|
34
|
-
}, []);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Пройдется по списку рекурсивно, вернув новый список с новыми объектами с флагом `isActive`.
|
|
39
|
-
*/
|
|
40
|
-
var setActiveRecursive = exports.setActiveRecursive = function setActiveRecursive(list, isActive) {
|
|
41
|
-
return list.map(function (item) {
|
|
42
|
-
var newItem = _objectSpread(_objectSpread({}, item), {}, {
|
|
43
|
-
isActive: isActive(item)
|
|
44
|
-
});
|
|
45
|
-
if (item.items) {
|
|
46
|
-
newItem.items = setActiveRecursive(item.items, isActive);
|
|
47
|
-
}
|
|
48
|
-
return newItem;
|
|
49
|
-
});
|
|
50
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { ButtonHTMLAttributes, HTMLAttributes } from 'react';
|
|
2
|
-
import type { FieldProps as BaseProps, DisabledProps } from '@salutejs/plasma-core';
|
|
3
|
-
import { Design } from './types';
|
|
4
|
-
export interface FieldProps extends BaseProps, DisabledProps, HTMLAttributes<HTMLLabelElement> {
|
|
5
|
-
}
|
|
6
|
-
export type SelectRefElement = HTMLButtonElement;
|
|
7
|
-
export interface SelectButtonProps extends Pick<FieldProps, 'status' | 'placeholder' | 'disabled'>, Omit<ButtonHTMLAttributes<SelectRefElement>, 'value' | 'onResize' | 'onResizeCapture' | 'nonce'> {
|
|
8
|
-
/**
|
|
9
|
-
* Выводимое значение.
|
|
10
|
-
*/
|
|
11
|
-
value?: string | number | null;
|
|
12
|
-
hasItems?: boolean;
|
|
13
|
-
opened?: boolean;
|
|
14
|
-
children?: never;
|
|
15
|
-
}
|
|
16
|
-
export interface StyledButtonProps extends Pick<SelectButtonProps, 'status' | 'hasItems' | 'opened'> {
|
|
17
|
-
focused?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare const SelectButton: React.ForwardRefExoticComponent<SelectButtonProps & Design & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
-
//# sourceMappingURL=SelectButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectButton.d.ts","sourceRoot":"","sources":["../../src/components/Select/SelectButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,oBAAoB,EAAc,cAAc,EAAE,MAAM,OAAO,CAAC;AAahF,OAAO,KAAK,EAAE,UAAU,IAAI,SAAS,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAMpF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,MAAM,WAAW,UAAW,SAAQ,SAAS,EAAE,aAAa,EAAE,cAAc,CAAC,gBAAgB,CAAC;CAAG;AAEjG,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAEjD,MAAM,WAAW,iBACb,SAAQ,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,aAAa,GAAG,UAAU,CAAC,EAC3D,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,iBAAiB,GAAG,OAAO,CAAC;IACpG;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC;CACpB;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;IAChG,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAwGD,eAAO,MAAM,YAAY,sGAWvB,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.SelectButton = void 0;
|
|
8
|
-
var _react = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("react"));
|
|
9
|
-
var _styledComponents = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("styled-components"));
|
|
10
|
-
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
|
11
|
-
var _plasmaIcons = /*#__PURE__*/require("@salutejs/plasma-icons");
|
|
12
|
-
var _tokens = /*#__PURE__*/require("../../tokens");
|
|
13
|
-
var _SelectButton = /*#__PURE__*/require("./views/b2c/SelectButton");
|
|
14
|
-
var _collectPackageInfo = /*#__PURE__*/require("../../collectPackageInfo");
|
|
15
|
-
var _StyledArrow;
|
|
16
|
-
var _excluded = ["design"],
|
|
17
|
-
_excluded2 = ["value", "placeholder", "hasItems"];
|
|
18
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
20
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
21
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
22
|
-
(0, _collectPackageInfo.collectPackageInfo)('Select/SelectButton');
|
|
23
|
-
var statuses = {
|
|
24
|
-
success: _plasmaCore.success,
|
|
25
|
-
warning: _plasmaCore.warning,
|
|
26
|
-
error: _plasmaCore.critical
|
|
27
|
-
};
|
|
28
|
-
var StyledArrow = /*#__PURE__*/(0, _styledComponents["default"])(_plasmaIcons.IconChevronDown).withConfig({
|
|
29
|
-
componentId: "plasma-web-core__sc-wqinip-0"
|
|
30
|
-
})(["margin:var(--plasma-select-button-arrow-margin,0 0 0 0.75rem);transition:color 0.3s ease-in-out,transform 0.15s ease-in-out;pointer-events:none;user-select:none;"]);
|
|
31
|
-
var StyledText = /*#__PURE__*/_styledComponents["default"].span.withConfig({
|
|
32
|
-
componentId: "plasma-web-core__sc-wqinip-1"
|
|
33
|
-
})(["", ";color:", ";transition:color 0.3s ease-in-out;pointer-events:none;user-select:none;"], _plasmaCore.applyEllipsis, _plasmaCore.primary);
|
|
34
|
-
var StyledPlaceholder = /*#__PURE__*/_styledComponents["default"].span.withConfig({
|
|
35
|
-
componentId: "plasma-web-core__sc-wqinip-2"
|
|
36
|
-
})(["", ";color:", ";pointer-events:none;user-select:none;"], _plasmaCore.applyEllipsis, _plasmaCore.tertiary);
|
|
37
|
-
var StyledButton = /*#__PURE__*/_styledComponents["default"].button.withConfig({
|
|
38
|
-
componentId: "plasma-web-core__sc-wqinip-3"
|
|
39
|
-
})(["", ";display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;width:100%;height:3rem;padding:0.875rem 0.9375rem;border:1px solid ", ";border-radius:0.25rem;background-color:transparent;color:", ";transition:border-color 0.3s ease-in-out;", " &:disabled{cursor:inherit;}&:not(:disabled):focus{outline:0 none;border-color:", ";color:", ";}", " ", " ", " ", ""], _plasmaCore.body1, _tokens.inputBorder, _plasmaCore.secondary, function (_ref) {
|
|
40
|
-
var hasItems = _ref.hasItems;
|
|
41
|
-
return hasItems && (0, _styledComponents.css)(["&:not(:disabled):hover{cursor:pointer;border-color:", ";color:", ";}"], _tokens.inputBorderHover, _plasmaCore.secondary);
|
|
42
|
-
}, _plasmaCore.accent, _plasmaCore.accent, function (_ref2) {
|
|
43
|
-
var focused = _ref2.focused;
|
|
44
|
-
return focused && (0, _styledComponents.css)(["border-color:", ";color:", ";"], _plasmaCore.accent, _plasmaCore.accent);
|
|
45
|
-
}, function (_ref3) {
|
|
46
|
-
var status = _ref3.status;
|
|
47
|
-
return status && (0, _styledComponents.css)(["border-color:", ";color:", ";&:hover,&:focus{border-color:", ";}"], statuses[status], statuses[status], statuses[status]);
|
|
48
|
-
}, function (_ref4) {
|
|
49
|
-
var opened = _ref4.opened;
|
|
50
|
-
return opened && (0, _styledComponents.css)(["", "{transform:rotate(-180deg);}"], StyledArrow);
|
|
51
|
-
}, function (_ref5) {
|
|
52
|
-
var design = _ref5.design,
|
|
53
|
-
props = _objectWithoutProperties(_ref5, _excluded);
|
|
54
|
-
return design === 'b2c' && (0, _SelectButton.applyB2CSelectButton)(props);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// eslint-disable-next-line prefer-arrow-callback
|
|
58
|
-
var SelectButton = exports.SelectButton = /*#__PURE__*/(0, _react.forwardRef)(function SelectButton(_ref6, ref) {
|
|
59
|
-
var value = _ref6.value,
|
|
60
|
-
placeholder = _ref6.placeholder,
|
|
61
|
-
hasItems = _ref6.hasItems,
|
|
62
|
-
rest = _objectWithoutProperties(_ref6, _excluded2);
|
|
63
|
-
return /*#__PURE__*/_react["default"].createElement(StyledButton, _extends({
|
|
64
|
-
type: "button"
|
|
65
|
-
}, rest, {
|
|
66
|
-
ref: ref,
|
|
67
|
-
hasItems: hasItems,
|
|
68
|
-
"aria-label": placeholder
|
|
69
|
-
}), value && /*#__PURE__*/_react["default"].createElement(StyledText, null, value), placeholder && !value && /*#__PURE__*/_react["default"].createElement(StyledPlaceholder, {
|
|
70
|
-
"aria-hidden": "true"
|
|
71
|
-
}, placeholder), hasItems && (_StyledArrow || (_StyledArrow = /*#__PURE__*/_react["default"].createElement(StyledArrow, {
|
|
72
|
-
size: "xs",
|
|
73
|
-
color: "inherit"
|
|
74
|
-
}))));
|
|
75
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { DropdownUncontrolledProps } from '../Dropdown';
|
|
2
|
-
import { Design } from './types';
|
|
3
|
-
export interface SelectDropdownProps extends DropdownUncontrolledProps {
|
|
4
|
-
}
|
|
5
|
-
export declare const SelectDropdown: import("styled-components").StyledComponent<import("react").FC<DropdownUncontrolledProps>, any, Design, never>;
|
|
6
|
-
//# sourceMappingURL=SelectDropdown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDropdown.d.ts","sourceRoot":"","sources":["../../src/components/Select/SelectDropdown.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,MAAM,WAAW,mBAAoB,SAAQ,yBAAyB;CAAG;AAEzE,eAAO,MAAM,cAAc,gHAc1B,CAAC"}
|