@salutejs/plasma-new-hope 0.330.0-canary.1655.16067292539.0 → 0.330.0-canary.1655.16168034594.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +12 -12
- package/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
- package/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +12 -12
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_80gotw.css → Item.styles_1q0u1o1.css} +2 -2
- package/cjs/components/Combobox/ComboboxNew/ui/SelectAll/SelectAll.css +12 -12
- package/cjs/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.css +12 -12
- package/cjs/components/Drawer/Drawer.css +5 -5
- package/cjs/components/Modal/Modal.css +5 -5
- package/cjs/components/Modal/Modal.js +3 -8
- package/cjs/components/Modal/Modal.js.map +1 -1
- package/cjs/components/Modal/Modal.styles.js +1 -10
- package/cjs/components/Modal/Modal.styles.js.map +1 -1
- package/cjs/components/Notification/NotificationsProvider.css +5 -5
- package/cjs/components/NumberFormat/NumberFormat.js +44 -4
- package/cjs/components/NumberFormat/NumberFormat.js.map +1 -1
- package/cjs/components/Pagination/Pagination.css +10 -10
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +10 -10
- package/cjs/components/Popup/Popup.js +17 -5
- package/cjs/components/Popup/Popup.js.map +1 -1
- package/cjs/components/Popup/Popup.styles.js +17 -17
- package/cjs/components/Popup/Popup.styles.js.map +1 -1
- package/{es/components/Popup/Popup.styles_sejy82.css → cjs/components/Popup/Popup.styles_1dvwxdu.css} +1 -1
- package/cjs/components/Popup/Popup.tokens.js +4 -1
- package/cjs/components/Popup/Popup.tokens.js.map +1 -1
- package/cjs/components/Popup/PopupContext.css +5 -5
- package/cjs/components/Select/Select.css +10 -10
- package/cjs/components/Select/Select.tokens.js +1 -0
- package/cjs/components/Select/Select.tokens.js.map +1 -1
- package/cjs/components/Select/ui/Inner/Inner.css +10 -10
- package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/{es/components/Select/ui/Inner/ui/Item/Item.styles_1qpfn0s.css → cjs/components/Select/ui/Inner/ui/Item/Item.styles_1dlmiti.css} +2 -2
- package/cjs/components/Select/ui/SelectAll/SelectAll.css +10 -10
- package/cjs/components/Select/ui/VirtualList/VirtualList.css +10 -10
- package/cjs/components/Table/Table.css +10 -10
- package/cjs/components/Table/ui/Cell/Cell.css +10 -10
- package/cjs/components/Table/ui/EditableCell/EditableCell.css +10 -10
- package/cjs/components/Table/ui/HeadCell/HeadCell.css +10 -10
- package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.css +10 -10
- package/cjs/components/TextField/TextField.js +32 -11
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/index.css +25 -25
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +26 -26
- package/emotion/cjs/components/Modal/Modal.js +4 -9
- package/emotion/cjs/components/Modal/Modal.styles.js +7 -10
- package/emotion/cjs/components/NumberFormat/NumberFormat.js +88 -5
- package/emotion/cjs/components/Popup/Popup.js +19 -5
- package/emotion/cjs/components/Popup/Popup.styles.js +11 -11
- package/emotion/cjs/components/Popup/Popup.tokens.js +4 -1
- package/emotion/cjs/components/Select/Select.tokens.js +1 -0
- package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +22 -22
- package/emotion/cjs/components/TextField/TextField.js +36 -14
- package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +15 -15
- package/emotion/cjs/examples/plasma_b2c/components/Select/Select.config.js +24 -24
- package/emotion/cjs/examples/plasma_web/components/Combobox/Combobox.config.js +15 -15
- package/emotion/cjs/examples/plasma_web/components/Select/Select.config.js +24 -24
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +26 -26
- package/emotion/es/components/Modal/Modal.js +4 -9
- package/emotion/es/components/Modal/Modal.styles.js +7 -10
- package/emotion/es/components/NumberFormat/NumberFormat.js +90 -7
- package/emotion/es/components/Popup/Popup.js +14 -6
- package/emotion/es/components/Popup/Popup.styles.js +11 -11
- package/emotion/es/components/Popup/Popup.tokens.js +4 -1
- package/emotion/es/components/Select/Select.tokens.js +1 -0
- package/emotion/es/components/Select/ui/Inner/ui/Item/Item.styles.js +22 -22
- package/emotion/es/components/TextField/TextField.js +36 -14
- package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +15 -15
- package/emotion/es/examples/plasma_b2c/components/Select/Select.config.js +24 -24
- package/emotion/es/examples/plasma_web/components/Combobox/Combobox.config.js +15 -15
- package/emotion/es/examples/plasma_web/components/Select/Select.config.js +24 -24
- package/es/components/Combobox/ComboboxNew/Combobox.css +12 -12
- package/es/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
- package/es/components/Combobox/ComboboxNew/Combobox.tokens.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +12 -12
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_80gotw.css → Item.styles_1q0u1o1.css} +2 -2
- package/es/components/Combobox/ComboboxNew/ui/SelectAll/SelectAll.css +12 -12
- package/es/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.css +12 -12
- package/es/components/Drawer/Drawer.css +5 -5
- package/es/components/Modal/Modal.css +5 -5
- package/es/components/Modal/Modal.js +3 -8
- package/es/components/Modal/Modal.js.map +1 -1
- package/es/components/Modal/Modal.styles.js +1 -10
- package/es/components/Modal/Modal.styles.js.map +1 -1
- package/es/components/Notification/NotificationsProvider.css +5 -5
- package/es/components/NumberFormat/NumberFormat.js +47 -7
- package/es/components/NumberFormat/NumberFormat.js.map +1 -1
- package/es/components/Pagination/Pagination.css +10 -10
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +10 -10
- package/es/components/Popup/Popup.js +16 -5
- package/es/components/Popup/Popup.js.map +1 -1
- package/es/components/Popup/Popup.styles.js +17 -17
- package/es/components/Popup/Popup.styles.js.map +1 -1
- package/{cjs/components/Popup/Popup.styles_sejy82.css → es/components/Popup/Popup.styles_1dvwxdu.css} +1 -1
- package/es/components/Popup/Popup.tokens.js +4 -1
- package/es/components/Popup/Popup.tokens.js.map +1 -1
- package/es/components/Popup/PopupContext.css +5 -5
- package/es/components/Select/Select.css +10 -10
- package/es/components/Select/Select.tokens.js +1 -0
- package/es/components/Select/Select.tokens.js.map +1 -1
- package/es/components/Select/ui/Inner/Inner.css +10 -10
- package/es/components/Select/ui/Inner/ui/Item/Item.styles.js +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/{cjs/components/Select/ui/Inner/ui/Item/Item.styles_1qpfn0s.css → es/components/Select/ui/Inner/ui/Item/Item.styles_1dlmiti.css} +2 -2
- package/es/components/Select/ui/SelectAll/SelectAll.css +10 -10
- package/es/components/Select/ui/VirtualList/VirtualList.css +10 -10
- package/es/components/Table/Table.css +10 -10
- package/es/components/Table/ui/Cell/Cell.css +10 -10
- package/es/components/Table/ui/EditableCell/EditableCell.css +10 -10
- package/es/components/Table/ui/HeadCell/HeadCell.css +10 -10
- package/es/components/Table/ui/HeadCell/ui/Filter/Filter.css +10 -10
- package/es/components/TextField/TextField.js +32 -11
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/index.css +25 -25
- package/package.json +2 -2
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +15 -15
- package/styled-components/cjs/components/Modal/Modal.js +4 -9
- package/styled-components/cjs/components/Modal/Modal.styles.js +3 -3
- package/styled-components/cjs/components/NumberFormat/NumberFormat.js +88 -5
- package/styled-components/cjs/components/Popup/Popup.js +19 -5
- package/styled-components/cjs/components/Popup/Popup.styles.js +9 -7
- package/styled-components/cjs/components/Popup/Popup.tokens.js +4 -1
- package/styled-components/cjs/components/Select/Select.tokens.js +1 -0
- package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +13 -13
- package/styled-components/cjs/components/TextField/TextField.js +35 -13
- package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +32 -28
- package/styled-components/cjs/examples/plasma_b2c/components/Select/Select.config.js +74 -40
- package/styled-components/cjs/examples/plasma_web/components/Combobox/Combobox.config.js +32 -28
- package/styled-components/cjs/examples/plasma_web/components/Select/Select.config.js +74 -40
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +15 -15
- package/styled-components/es/components/Modal/Modal.js +4 -9
- package/styled-components/es/components/Modal/Modal.styles.js +3 -3
- package/styled-components/es/components/NumberFormat/NumberFormat.js +90 -7
- package/styled-components/es/components/Popup/Popup.js +14 -6
- package/styled-components/es/components/Popup/Popup.styles.js +9 -7
- package/styled-components/es/components/Popup/Popup.tokens.js +4 -1
- package/styled-components/es/components/Select/Select.tokens.js +1 -0
- package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.styles.js +13 -13
- package/styled-components/es/components/TextField/TextField.js +35 -13
- package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +32 -28
- package/styled-components/es/examples/plasma_b2c/components/Select/Select.config.js +74 -40
- package/styled-components/es/examples/plasma_web/components/Combobox/Combobox.config.js +32 -28
- package/styled-components/es/examples/plasma_web/components/Select/Select.config.js +74 -40
- package/types/components/Carousel/CarouselOld/Carousel.d.ts +2 -2
- package/types/components/Combobox/ComboboxNew/Combobox.tokens.d.ts +1 -0
- package/types/components/Combobox/ComboboxNew/Combobox.tokens.d.ts.map +1 -1
- package/types/components/Drawer/Drawer.d.ts +2 -2
- package/types/components/Modal/Modal.d.ts.map +1 -1
- package/types/components/Modal/Modal.styles.d.ts +1 -3
- package/types/components/Modal/Modal.styles.d.ts.map +1 -1
- package/types/components/NumberFormat/NumberFormat.d.ts.map +1 -1
- package/types/components/Popup/Popup.d.ts.map +1 -1
- package/types/components/Popup/Popup.styles.d.ts.map +1 -1
- package/types/components/Popup/Popup.tokens.d.ts +3 -0
- package/types/components/Popup/Popup.tokens.d.ts.map +1 -1
- package/types/components/Popup/Popup.types.d.ts +2 -8
- package/types/components/Popup/Popup.types.d.ts.map +1 -1
- package/types/components/Select/Select.tokens.d.ts +1 -0
- package/types/components/Select/Select.tokens.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts.map +1 -1
@@ -130,7 +130,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
130
130
|
var Popup = (0, _engines.component)(_Popup.popupConfig);
|
131
131
|
var modalRoot = function(Root) {
|
132
132
|
return /*#__PURE__*/ (0, _react.forwardRef)(function(_param, outerRootRef) {
|
133
|
-
var id = _param.id, withAnimation = _param.withAnimation, onClose = _param.onClose, onOverlayClick = _param.onOverlayClick, onEscKeyDown = _param.onEscKeyDown, _param_closeOnEsc = _param.closeOnEsc, closeOnEsc = _param_closeOnEsc === void 0 ? true : _param_closeOnEsc, _param_closeOnOverlayClick = _param.closeOnOverlayClick, closeOnOverlayClick = _param_closeOnOverlayClick === void 0 ? true : _param_closeOnOverlayClick, withBlur = _param.withBlur, initialFocusRef = _param.initialFocusRef, focusAfterRef = _param.focusAfterRef, zIndex = _param.zIndex, popupInfo = _param.popupInfo, children = _param.children, view = _param.view, opened = _param.opened, isOpen = _param.isOpen, hasBody = _param.hasBody, hasClose = _param.hasClose,
|
133
|
+
var id = _param.id, withAnimation = _param.withAnimation, onClose = _param.onClose, onOverlayClick = _param.onOverlayClick, onEscKeyDown = _param.onEscKeyDown, _param_closeOnEsc = _param.closeOnEsc, closeOnEsc = _param_closeOnEsc === void 0 ? true : _param_closeOnEsc, _param_closeOnOverlayClick = _param.closeOnOverlayClick, closeOnOverlayClick = _param_closeOnOverlayClick === void 0 ? true : _param_closeOnOverlayClick, withBlur = _param.withBlur, initialFocusRef = _param.initialFocusRef, focusAfterRef = _param.focusAfterRef, zIndex = _param.zIndex, popupInfo = _param.popupInfo, children = _param.children, view = _param.view, opened = _param.opened, isOpen = _param.isOpen, hasBody = _param.hasBody, hasClose = _param.hasClose, resizable = _param.resizable, draggable = _param.draggable, rest = _object_without_properties(_param, [
|
134
134
|
"id",
|
135
135
|
"withAnimation",
|
136
136
|
"onClose",
|
@@ -149,15 +149,13 @@ var modalRoot = function(Root) {
|
|
149
149
|
"isOpen",
|
150
150
|
"hasBody",
|
151
151
|
"hasClose",
|
152
|
-
"
|
153
|
-
"
|
154
|
-
"resizable"
|
152
|
+
"resizable",
|
153
|
+
"draggable"
|
155
154
|
]);
|
156
155
|
var innerIsOpen = Boolean(isOpen || opened);
|
157
156
|
var innerHasClose = hasClose === undefined && hasBody || hasClose;
|
158
157
|
var trapRef = (0, _hooks.useFocusTrap)(true, initialFocusRef, focusAfterRef, true);
|
159
158
|
var popupController = (0, _Popup.usePopupContext)();
|
160
|
-
var isResizableEnabled = Boolean(resizable && !resizable.disabled);
|
161
159
|
var innerRef = (0, _plasmacore.useForkRef)(trapRef, outerRootRef);
|
162
160
|
var uniqId = (0, _utils.safeUseId)();
|
163
161
|
var innerId = id || uniqId;
|
@@ -209,13 +207,10 @@ var modalRoot = function(Root) {
|
|
209
207
|
view: view
|
210
208
|
}, overlayNode),
|
211
209
|
draggable: draggable,
|
212
|
-
handle: handle,
|
213
210
|
resizable: resizable
|
214
211
|
}, rest), hasBody ? /*#__PURE__*/ _react.default.createElement(Root, {
|
215
212
|
view: view
|
216
|
-
}, /*#__PURE__*/ _react.default.createElement(_Modalstyles.ModalBody, {
|
217
|
-
isResizableEnabled: isResizableEnabled
|
218
|
-
}, /*#__PURE__*/ _react.default.createElement(_Modalstyles.ModalContent, null, innerHasClose && /*#__PURE__*/ _react.default.createElement(_Modalstyles.CloseButton, {
|
213
|
+
}, /*#__PURE__*/ _react.default.createElement(_Modalstyles.ModalBody, null, /*#__PURE__*/ _react.default.createElement(_Modalstyles.ModalContent, null, innerHasClose && /*#__PURE__*/ _react.default.createElement(_Modalstyles.CloseButton, {
|
219
214
|
onClick: onClose,
|
220
215
|
"data-test": "modal-close"
|
221
216
|
}, /*#__PURE__*/ _react.default.createElement(_IconClose.IconClose, {
|
@@ -71,7 +71,7 @@ var base = (0, _styledcomponents.css)([
|
|
71
71
|
]);
|
72
72
|
var ModalBody = _styledcomponents.default.div.withConfig({
|
73
73
|
displayName: "Modal.styles__ModalBody",
|
74
|
-
componentId: "sc-
|
74
|
+
componentId: "sc-96885df7-0"
|
75
75
|
})([
|
76
76
|
"height:100%;box-sizing:border-box;border-radius:var(",
|
77
77
|
");padding:var(",
|
@@ -80,14 +80,14 @@ var ModalBody = _styledcomponents.default.div.withConfig({
|
|
80
80
|
], _Modaltokens.tokens.modalBodyBorderRadius, _Modaltokens.tokens.modalBodyPadding, _Modaltokens.tokens.modalBodyBackground);
|
81
81
|
var ModalContent = _styledcomponents.default.div.withConfig({
|
82
82
|
displayName: "Modal.styles__ModalContent",
|
83
|
-
componentId: "sc-
|
83
|
+
componentId: "sc-96885df7-1"
|
84
84
|
})([
|
85
85
|
"position:relative;padding:var(",
|
86
86
|
");"
|
87
87
|
], _Modaltokens.tokens.modalContentPadding);
|
88
88
|
var CloseButton = _styledcomponents.default.button.withConfig({
|
89
89
|
displayName: "Modal.styles__CloseButton",
|
90
|
-
componentId: "sc-
|
90
|
+
componentId: "sc-96885df7-2"
|
91
91
|
})([
|
92
92
|
"top:0;right:0;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(",
|
93
93
|
");padding:0;margin:0;outline:none;cursor:pointer;background:transparent;",
|
@@ -10,6 +10,15 @@ Object.defineProperty(exports, "composeNumberFormat", {
|
|
10
10
|
});
|
11
11
|
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
12
12
|
var _reactnumberformat = require("react-number-format");
|
13
|
+
var _plasmacore = require("@salutejs/plasma-core");
|
14
|
+
function _array_like_to_array(arr, len) {
|
15
|
+
if (len == null || len > arr.length) len = arr.length;
|
16
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
17
|
+
return arr2;
|
18
|
+
}
|
19
|
+
function _array_with_holes(arr) {
|
20
|
+
if (Array.isArray(arr)) return arr;
|
21
|
+
}
|
13
22
|
function _define_property(obj, key, value) {
|
14
23
|
if (key in obj) {
|
15
24
|
Object.defineProperty(obj, key, {
|
@@ -64,6 +73,33 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
64
73
|
}
|
65
74
|
return newObj;
|
66
75
|
}
|
76
|
+
function _iterable_to_array_limit(arr, i) {
|
77
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
78
|
+
if (_i == null) return;
|
79
|
+
var _arr = [];
|
80
|
+
var _n = true;
|
81
|
+
var _d = false;
|
82
|
+
var _s, _e;
|
83
|
+
try {
|
84
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
85
|
+
_arr.push(_s.value);
|
86
|
+
if (i && _arr.length === i) break;
|
87
|
+
}
|
88
|
+
} catch (err) {
|
89
|
+
_d = true;
|
90
|
+
_e = err;
|
91
|
+
} finally{
|
92
|
+
try {
|
93
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
94
|
+
} finally{
|
95
|
+
if (_d) throw _e;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
return _arr;
|
99
|
+
}
|
100
|
+
function _non_iterable_rest() {
|
101
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
102
|
+
}
|
67
103
|
function _object_spread(target) {
|
68
104
|
for(var i = 1; i < arguments.length; i++){
|
69
105
|
var source = arguments[i] != null ? arguments[i] : {};
|
@@ -106,28 +142,75 @@ function _object_without_properties_loose(source, excluded) {
|
|
106
142
|
}
|
107
143
|
return target;
|
108
144
|
}
|
145
|
+
function _sliced_to_array(arr, i) {
|
146
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
147
|
+
}
|
148
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
149
|
+
if (!o) return;
|
150
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
151
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
152
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
153
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
154
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
155
|
+
}
|
109
156
|
var composeNumberFormat = function(InputComponent) {
|
110
157
|
return /*#__PURE__*/ (0, _react.forwardRef)(function(_param, outerRef) {
|
111
|
-
var _param_thousandSeparator = _param.thousandSeparator, thousandSeparator = _param_thousandSeparator === void 0 ? ' ' : _param_thousandSeparator, _param_decimalScale = _param.decimalScale, decimalScale = _param_decimalScale === void 0 ? 3 : _param_decimalScale, _param_decimalSeparator = _param.decimalSeparator, decimalSeparator = _param_decimalSeparator === void 0 ? '.' : _param_decimalSeparator, onChange = _param.onChange, rest = _object_without_properties(_param, [
|
158
|
+
var _param_thousandSeparator = _param.thousandSeparator, thousandSeparator = _param_thousandSeparator === void 0 ? ' ' : _param_thousandSeparator, _param_decimalScale = _param.decimalScale, decimalScale = _param_decimalScale === void 0 ? 3 : _param_decimalScale, _param_decimalSeparator = _param.decimalSeparator, decimalSeparator = _param_decimalSeparator === void 0 ? '.' : _param_decimalSeparator, disabled = _param.disabled, outerValue = _param.value, onChange = _param.onChange, onPaste = _param.onPaste, rest = _object_without_properties(_param, [
|
112
159
|
"thousandSeparator",
|
113
160
|
"decimalScale",
|
114
161
|
"decimalSeparator",
|
115
|
-
"
|
162
|
+
"disabled",
|
163
|
+
"value",
|
164
|
+
"onChange",
|
165
|
+
"onPaste"
|
116
166
|
]);
|
167
|
+
var inputRef = (0, _react.useRef)(null);
|
168
|
+
var inputForkRef = (0, _plasmacore.useForkRef)(inputRef, outerRef);
|
169
|
+
var _useState = _sliced_to_array((0, _react.useState)(''), 2), innerValue = _useState[0], setInnerValue = _useState[1];
|
170
|
+
var value = (0, _reactnumberformat.numericFormatter)(String(outerValue !== null && outerValue !== void 0 ? outerValue : innerValue), {
|
171
|
+
thousandSeparator: thousandSeparator,
|
172
|
+
decimalScale: decimalScale,
|
173
|
+
decimalSeparator: decimalSeparator
|
174
|
+
});
|
117
175
|
var handleChangeValue = function(values, sourceInfo) {
|
176
|
+
var changeEvent = sourceInfo.event;
|
177
|
+
setInnerValue(values.value);
|
118
178
|
if (onChange) {
|
119
|
-
var changeEvent = sourceInfo.event;
|
120
179
|
onChange(changeEvent, values);
|
121
180
|
}
|
122
181
|
};
|
182
|
+
var handlePaste = function(event) {
|
183
|
+
if (disabled) {
|
184
|
+
return;
|
185
|
+
}
|
186
|
+
if (decimalSeparator !== '.' && inputRef.current) {
|
187
|
+
if (!Number.isNaN(Number(event.clipboardData.getData('text/plain')))) {
|
188
|
+
event.preventDefault();
|
189
|
+
var pastedValue = event.clipboardData.getData('text/plain').replace('.', decimalSeparator);
|
190
|
+
var input = event.target;
|
191
|
+
var startPos = input.selectionStart || 0;
|
192
|
+
var newCursorPos = startPos + pastedValue.length;
|
193
|
+
setInnerValue(pastedValue);
|
194
|
+
setTimeout(function() {
|
195
|
+
var _inputRef_current;
|
196
|
+
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.setSelectionRange(newCursorPos, newCursorPos);
|
197
|
+
}, 10);
|
198
|
+
}
|
199
|
+
}
|
200
|
+
if (onPaste) {
|
201
|
+
onPaste(event);
|
202
|
+
}
|
203
|
+
};
|
123
204
|
return /*#__PURE__*/ _react.default.createElement(_reactnumberformat.NumericFormat, _object_spread({
|
205
|
+
value: value,
|
124
206
|
thousandSeparator: thousandSeparator,
|
125
207
|
decimalScale: decimalScale,
|
126
208
|
decimalSeparator: decimalSeparator,
|
127
209
|
customInput: InputComponent,
|
128
|
-
getInputRef:
|
210
|
+
getInputRef: inputForkRef,
|
129
211
|
_textEllipsisDisable: true,
|
130
|
-
onValueChange: handleChangeValue
|
212
|
+
onValueChange: handleChangeValue,
|
213
|
+
onPaste: handlePaste
|
131
214
|
}, rest));
|
132
215
|
});
|
133
216
|
};
|
@@ -21,6 +21,7 @@ _export(exports, {
|
|
21
21
|
});
|
22
22
|
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
23
23
|
var _plasmacore = require("@salutejs/plasma-core");
|
24
|
+
var _reactdraggable = /*#__PURE__*/ _interop_require_default(require("react-draggable"));
|
24
25
|
var _reresizable = require("re-resizable");
|
25
26
|
var _utils = require("../../utils");
|
26
27
|
var _Portal = require("../Portal");
|
@@ -50,6 +51,11 @@ function _define_property(obj, key, value) {
|
|
50
51
|
}
|
51
52
|
return obj;
|
52
53
|
}
|
54
|
+
function _interop_require_default(obj) {
|
55
|
+
return obj && obj.__esModule ? obj : {
|
56
|
+
default: obj
|
57
|
+
};
|
58
|
+
}
|
53
59
|
function _getRequireWildcardCache(nodeInterop) {
|
54
60
|
if (typeof WeakMap !== "function") return null;
|
55
61
|
var cacheBabelInterop = new WeakMap();
|
@@ -232,7 +238,7 @@ var popupRoot = function(Root) {
|
|
232
238
|
0,
|
233
239
|
0
|
234
240
|
] : _param_offset, _param_frame = _param.frame, frame = _param_frame === void 0 ? 'document' : _param_frame, children = _param.children, overlay = _param.overlay, // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
235
|
-
role = _param.role, zIndex = _param.zIndex, popupInfo = _param.popupInfo, _param_withAnimation = _param.withAnimation, withAnimation = _param_withAnimation === void 0 ? false : _param_withAnimation, className = _param.className,
|
241
|
+
role = _param.role, zIndex = _param.zIndex, popupInfo = _param.popupInfo, _param_withAnimation = _param.withAnimation, withAnimation = _param_withAnimation === void 0 ? false : _param_withAnimation, className = _param.className, draggable = _param.draggable, outerResizable = _param.resizable, rest = _object_without_properties(_param, [
|
236
242
|
"id",
|
237
243
|
"isOpen",
|
238
244
|
"opened",
|
@@ -247,11 +253,13 @@ var popupRoot = function(Root) {
|
|
247
253
|
"withAnimation",
|
248
254
|
"className",
|
249
255
|
"draggable",
|
250
|
-
"handle",
|
251
256
|
"resizable"
|
252
257
|
]);
|
253
258
|
var _resizable_hiddenIcons, _resizable_hiddenIcons1, _resizable_hiddenIcons2, _resizable_hiddenIcons3;
|
254
259
|
var innerIsOpen = isOpen || opened;
|
260
|
+
var resizable = typeof outerResizable === 'boolean' ? {
|
261
|
+
disabled: !outerResizable
|
262
|
+
} : outerResizable;
|
255
263
|
var uniqId = (0, _utils.safeUseId)();
|
256
264
|
var innerId = id || uniqId;
|
257
265
|
var _usePopup = (0, _hooks.usePopup)({
|
@@ -277,7 +285,12 @@ var popupRoot = function(Root) {
|
|
277
285
|
frame: frame,
|
278
286
|
animationInfo: animationInfo,
|
279
287
|
setVisible: setVisible
|
280
|
-
}, rest), /*#__PURE__*/ _react.default.createElement(
|
288
|
+
}, rest), /*#__PURE__*/ _react.default.createElement(_reactdraggable.default, {
|
289
|
+
defaultClassName: draggable ? _Popuptokens.classes.draggablePopupWrapper : undefined,
|
290
|
+
defaultClassNameDragging: draggable ? _Popuptokens.classes.draggingPopupWrapper : undefined,
|
291
|
+
disabled: !draggable,
|
292
|
+
cancel: ".".concat(_Popuptokens.classes.resizableHandleWrapper)
|
293
|
+
}, /*#__PURE__*/ _react.default.createElement(_reresizable.Resizable, {
|
281
294
|
enable: resizable && !resizable.disabled ? (0, _utils1.getResizeDirections)(resizable.directions) : false,
|
282
295
|
resizeRatio: (0, _utils1.getRatioBasedOnPlacement)(placement),
|
283
296
|
defaultSize: resizable === null || resizable === void 0 ? void 0 : resizable.defaultSize,
|
@@ -308,8 +321,9 @@ var popupRoot = function(Root) {
|
|
308
321
|
})
|
309
322
|
},
|
310
323
|
className: _Popuptokens.classes.resizableContainer,
|
311
|
-
handleStyles: (0, _utils1.getHandleStyles)(resizable === null || resizable === void 0 ? void 0 : resizable.iconSize)
|
312
|
-
|
324
|
+
handleStyles: (0, _utils1.getHandleStyles)(resizable === null || resizable === void 0 ? void 0 : resizable.iconSize),
|
325
|
+
handleWrapperClass: _Popuptokens.classes.resizableHandleWrapper
|
326
|
+
}, children))));
|
313
327
|
if (typeof frame !== 'string' && frame && frame.current && _utils.canUseDOM) {
|
314
328
|
return /*#__PURE__*/ _react.default.createElement(_Portal.Portal, {
|
315
329
|
container: frame.current
|
@@ -74,29 +74,31 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
74
74
|
return newObj;
|
75
75
|
}
|
76
76
|
var base = (0, _styledcomponents.css)([
|
77
|
-
""
|
78
|
-
|
77
|
+
".",
|
78
|
+
"{cursor:grab;}.",
|
79
|
+
"{cursor:grabbing;}"
|
80
|
+
], _Popuptokens.classes.draggablePopupWrapper, _Popuptokens.classes.draggingPopupWrapper);
|
79
81
|
var StyledPortal = _styledcomponents.default.div.withConfig({
|
80
82
|
displayName: "Popup.styles__StyledPortal",
|
81
|
-
componentId: "sc-
|
83
|
+
componentId: "sc-17a0b623-0"
|
82
84
|
})([
|
83
85
|
""
|
84
86
|
]);
|
85
87
|
var StyledPortalContainer = _styledcomponents.default.div.withConfig({
|
86
88
|
displayName: "Popup.styles__StyledPortalContainer",
|
87
|
-
componentId: "sc-
|
89
|
+
componentId: "sc-17a0b623-1"
|
88
90
|
})([
|
89
91
|
"width:0;"
|
90
92
|
]);
|
91
93
|
var PopupView = _styledcomponents.default.div.withConfig({
|
92
94
|
displayName: "Popup.styles__PopupView",
|
93
|
-
componentId: "sc-
|
95
|
+
componentId: "sc-17a0b623-2"
|
94
96
|
})([
|
95
97
|
"position:relative;max-width:100%;pointer-events:all;"
|
96
98
|
]);
|
97
99
|
var PopupRootContainer = _styledcomponents.default.div.withConfig({
|
98
100
|
displayName: "Popup.styles__PopupRootContainer",
|
99
|
-
componentId: "sc-
|
101
|
+
componentId: "sc-17a0b623-3"
|
100
102
|
})([
|
101
103
|
"position:",
|
102
104
|
";z-index:",
|
@@ -130,7 +132,7 @@ var PopupRootContainer = _styledcomponents.default.div.withConfig({
|
|
130
132
|
});
|
131
133
|
var IconResizeDiagonalStyled = (0, _styledcomponents.default)(_Icon.IconResizeDiagonal).withConfig({
|
132
134
|
displayName: "Popup.styles__IconResizeDiagonalStyled",
|
133
|
-
componentId: "sc-
|
135
|
+
componentId: "sc-17a0b623-4"
|
134
136
|
})([
|
135
137
|
"color:var(--text-secondary);&:hover{color:var(--text-secondary-hover);}&:active{color:var(--text-secondary-active);}&.",
|
136
138
|
"{transform:rotate(-90deg);}&.",
|
@@ -18,5 +18,8 @@ var classes = {
|
|
18
18
|
resizableTopRightIcon: 'resizable-top-right-icon',
|
19
19
|
resizableBottomRightIcon: 'resizable-bottom-right-icon',
|
20
20
|
resizableBottomLeftIcon: 'resizable-bottom-left-icon',
|
21
|
-
resizableTopLeftIcon: 'resizable-top-left-icon'
|
21
|
+
resizableTopLeftIcon: 'resizable-top-left-icon',
|
22
|
+
resizableHandleWrapper: 'resizable-handle-wrapper',
|
23
|
+
draggablePopupWrapper: 'draggable-popup-wrapper',
|
24
|
+
draggingPopupWrapper: 'dragging-popup-wrapper'
|
22
25
|
};
|
@@ -53,6 +53,7 @@ var tokens = {
|
|
53
53
|
itemBackgroundHover: '--plasma-select-item-background-hover',
|
54
54
|
itemDisabledOpacity: '--plasma-select-item-disabled-opacity',
|
55
55
|
itemDisabledColor: '--plasma-select-item-disabled-color',
|
56
|
+
itemIconColor: '--plasma-select-item-icon-color',
|
56
57
|
cellPadding: '--plasma-select-cell-padding',
|
57
58
|
cellPaddingLeftContent: '--plasma-select-cell-padding-left-content',
|
58
59
|
cellPaddingContent: '--plasma-select-cell-padding-content',
|
@@ -67,7 +67,7 @@ var mergedIndicatorConfig = (0, _engines.mergeConfig)(_Indicator.indicatorConfig
|
|
67
67
|
var Indicator = (0, _engines.component)(mergedIndicatorConfig);
|
68
68
|
var StyledWrapper = _styledcomponents.default.div.withConfig({
|
69
69
|
displayName: "Item.styles__StyledWrapper",
|
70
|
-
componentId: "sc-
|
70
|
+
componentId: "sc-fcc0b37e-0"
|
71
71
|
})([
|
72
72
|
"",
|
73
73
|
":",
|
@@ -104,13 +104,13 @@ var StyledWrapper = _styledcomponents.default.div.withConfig({
|
|
104
104
|
}, _Cell.cellTokens.cellBackgroundColor, _Selecttokens.constants.cellBackgroundColor, _Cell.cellTokens.cellPadding, _Selecttokens.tokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Selecttokens.tokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Selecttokens.tokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Selecttokens.tokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Selecttokens.tokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Selecttokens.tokens.cellGap, _Cell.cellTokens.cellTitleFontFamily, _Selecttokens.tokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Selecttokens.tokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Selecttokens.tokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Selecttokens.tokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Selecttokens.tokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Selecttokens.tokens.cellTitleLineHeight);
|
105
105
|
var StyledCell = (0, _styledcomponents.default)(Cell).withConfig({
|
106
106
|
displayName: "Item.styles__StyledCell",
|
107
|
-
componentId: "sc-
|
107
|
+
componentId: "sc-fcc0b37e-1"
|
108
108
|
})([
|
109
109
|
""
|
110
110
|
]);
|
111
111
|
var StyledCheckbox = (0, _styledcomponents.default)(Checkbox).withConfig({
|
112
112
|
displayName: "Item.styles__StyledCheckbox",
|
113
|
-
componentId: "sc-
|
113
|
+
componentId: "sc-fcc0b37e-2"
|
114
114
|
})([
|
115
115
|
"",
|
116
116
|
":var(",
|
@@ -130,21 +130,21 @@ var StyledCheckbox = (0, _styledcomponents.default)(Checkbox).withConfig({
|
|
130
130
|
], _Checkbox.checkboxTokens.triggerSize, _Selecttokens.tokens.checkboxTriggerSize, _Checkbox.checkboxTokens.triggerBorderRadius, _Selecttokens.tokens.checkboxTriggerBorderRadius, _Checkbox.checkboxTokens.fillColor, _Selecttokens.tokens.checkboxFillColor, _Checkbox.checkboxTokens.iconColor, _Selecttokens.tokens.checkboxIconColor, _Checkbox.checkboxTokens.triggerBorderWidth, _Selecttokens.tokens.checkboxTriggerBorderWidth, _Checkbox.checkboxTokens.triggerBorderColor, _Selecttokens.tokens.checkboxTriggerBorderColor, _Checkbox.checkboxTokens.triggerBorderCheckedColor, _Selecttokens.tokens.checkboxTriggerBorderCheckedColor);
|
131
131
|
var StyledIndicator = (0, _styledcomponents.default)(Indicator).withConfig({
|
132
132
|
displayName: "Item.styles__StyledIndicator",
|
133
|
-
componentId: "sc-
|
133
|
+
componentId: "sc-fcc0b37e-3"
|
134
134
|
})([
|
135
135
|
"",
|
136
136
|
":var(",
|
137
137
|
");",
|
138
138
|
":var(",
|
139
139
|
");"
|
140
|
-
], _Indicator.indicatorTokens.size, _Selecttokens.tokens.indicatorSize, _Indicator.indicatorTokens.color, _Selecttokens.tokens.
|
140
|
+
], _Indicator.indicatorTokens.size, _Selecttokens.tokens.indicatorSize, _Indicator.indicatorTokens.color, _Selecttokens.tokens.itemIconColor);
|
141
141
|
var sizeMap = {
|
142
142
|
xs: '1rem',
|
143
143
|
s: '1.5rem'
|
144
144
|
};
|
145
145
|
var StyledArrow = (0, _styledcomponents.default)(_Icon.IconDisclosureRightCentered).withConfig({
|
146
146
|
displayName: "Item.styles__StyledArrow",
|
147
|
-
componentId: "sc-
|
147
|
+
componentId: "sc-fcc0b37e-4"
|
148
148
|
})([
|
149
149
|
"width:",
|
150
150
|
";height:",
|
@@ -158,7 +158,7 @@ var StyledArrow = (0, _styledcomponents.default)(_Icon.IconDisclosureRightCenter
|
|
158
158
|
});
|
159
159
|
var StyledIconDone = (0, _styledcomponents.default)(_Icon.IconDone).withConfig({
|
160
160
|
displayName: "Item.styles__StyledIconDone",
|
161
|
-
componentId: "sc-
|
161
|
+
componentId: "sc-fcc0b37e-5"
|
162
162
|
})([
|
163
163
|
"width:",
|
164
164
|
";height:",
|
@@ -172,7 +172,7 @@ var StyledIconDone = (0, _styledcomponents.default)(_Icon.IconDone).withConfig({
|
|
172
172
|
});
|
173
173
|
var DisclosureIconWrapper = _styledcomponents.default.div.withConfig({
|
174
174
|
displayName: "Item.styles__DisclosureIconWrapper",
|
175
|
-
componentId: "sc-
|
175
|
+
componentId: "sc-fcc0b37e-6"
|
176
176
|
})([
|
177
177
|
"margin:var(",
|
178
178
|
");line-height:0;color:var(",
|
@@ -181,7 +181,7 @@ var DisclosureIconWrapper = _styledcomponents.default.div.withConfig({
|
|
181
181
|
], _Selecttokens.tokens.disclosureIconMargin, _Selecttokens.tokens.disclosureIconColor, _Selecttokens.tokens.disclosureIconColorHover);
|
182
182
|
var IconWrapper = _styledcomponents.default.div.withConfig({
|
183
183
|
displayName: "Item.styles__IconWrapper",
|
184
|
-
componentId: "sc-
|
184
|
+
componentId: "sc-fcc0b37e-7"
|
185
185
|
})([
|
186
186
|
"display:flex;align-items:center;justify-content:center;flex:none;width:",
|
187
187
|
";height:",
|
@@ -194,17 +194,17 @@ var IconWrapper = _styledcomponents.default.div.withConfig({
|
|
194
194
|
}, function(param) {
|
195
195
|
var variant = param.variant;
|
196
196
|
return "var(".concat(variant === 'tight' ? _Selecttokens.tokens.itemIconSizeTight : _Selecttokens.tokens.itemIconSize, ")");
|
197
|
-
}, _Selecttokens.tokens.itemIconMargin, _Selecttokens.tokens.
|
197
|
+
}, _Selecttokens.tokens.itemIconMargin, _Selecttokens.tokens.itemIconColor);
|
198
198
|
var StyledText = _styledcomponents.default.div.withConfig({
|
199
199
|
displayName: "Item.styles__StyledText",
|
200
|
-
componentId: "sc-
|
200
|
+
componentId: "sc-fcc0b37e-8"
|
201
201
|
})([
|
202
202
|
"",
|
203
203
|
";flex:1;"
|
204
204
|
], (0, _mixins.applyEllipsis)());
|
205
205
|
var Wrapper = _styledcomponents.default.li.withConfig({
|
206
206
|
displayName: "Item.styles__Wrapper",
|
207
|
-
componentId: "sc-
|
207
|
+
componentId: "sc-fcc0b37e-9"
|
208
208
|
})([
|
209
209
|
"display:flex;align-items:center;min-height:var(",
|
210
210
|
");margin:0;box-sizing:content-box;padding:",
|
@@ -239,7 +239,7 @@ var Wrapper = _styledcomponents.default.li.withConfig({
|
|
239
239
|
}));
|
240
240
|
var StyledCheckboxWrapper = _styledcomponents.default.span.withConfig({
|
241
241
|
displayName: "Item.styles__StyledCheckboxWrapper",
|
242
|
-
componentId: "sc-
|
242
|
+
componentId: "sc-fcc0b37e-10"
|
243
243
|
})([
|
244
244
|
""
|
245
245
|
]);
|
@@ -196,7 +196,7 @@ var textFieldRoot = function(Root) {
|
|
196
196
|
hintTrigger, hintTrigger = _param_hintTrigger === void 0 ? 'hover' : _param_hintTrigger, hintText = _param.hintText, _param_hintView = _param.hintView, hintView = _param_hintView === void 0 ? 'default' : _param_hintView, _param_hintSize = _param.hintSize, hintSize = _param_hintSize === void 0 ? 'm' : _param_hintSize, hintTargetIcon = _param.hintTargetIcon, _param_hintTargetPlacement = _param.hintTargetPlacement, hintTargetPlacement = _param_hintTargetPlacement === void 0 ? 'outer' : _param_hintTargetPlacement, _param_hintPlacement = _param.hintPlacement, hintPlacement = _param_hintPlacement === void 0 ? 'auto' : _param_hintPlacement, hintHasArrow = _param.hintHasArrow, _param_hintOffset = _param.hintOffset, hintOffset = _param_hintOffset === void 0 ? HINT_DEFAULT_OFFSET : _param_hintOffset, hintWidth = _param.hintWidth, hintContentLeft = _param.hintContentLeft, // variations
|
197
197
|
view = _param.view, size = _param.size, _param_readOnly = _param.readOnly, readOnly = _param_readOnly === void 0 ? false : _param_readOnly, _param_disabled = _param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_required = _param.required, required = _param_required === void 0 ? false : _param_required, _param_clear = _param.clear, clear = _param_clear === void 0 ? false : _param_clear, optional = _param.optional, hasDivider = _param.hasDivider, // controlled
|
198
198
|
outerValue = _param.value, values = _param.chips, _param_chipType = _param.chipType, chipType = _param_chipType === void 0 ? 'default' : _param_chipType, // events
|
199
|
-
onChange = _param.onChange, onChangeChips = _param.onChangeChips, onSearch = _param.onSearch, onKeyDown = _param.onKeyDown, onFocus = _param.onFocus, onBlur = _param.onBlur, // Пропсы для внутреннего использования, не отдается наружу.
|
199
|
+
onChange = _param.onChange, onChangeChips = _param.onChangeChips, onSearch = _param.onSearch, onKeyDown = _param.onKeyDown, onFocus = _param.onFocus, onBlur = _param.onBlur, onPaste = _param.onPaste, // Пропсы для внутреннего использования, не отдается наружу.
|
200
200
|
// @ts-ignore
|
201
201
|
_onEnterDisabled = _param._onEnterDisabled, // @ts-ignore
|
202
202
|
_forceChipManipulationWithReadonly = _param._forceChipManipulationWithReadonly, rest = _object_without_properties(_param, [
|
@@ -246,6 +246,7 @@ var textFieldRoot = function(Root) {
|
|
246
246
|
"onKeyDown",
|
247
247
|
"onFocus",
|
248
248
|
"onBlur",
|
249
|
+
"onPaste",
|
249
250
|
"_onEnterDisabled",
|
250
251
|
"_forceChipManipulationWithReadonly"
|
251
252
|
]);
|
@@ -310,17 +311,6 @@ var textFieldRoot = function(Root) {
|
|
310
311
|
var value = event.target.value;
|
311
312
|
setHasValue(Boolean(value));
|
312
313
|
};
|
313
|
-
(0, _react.useEffect)(function() {
|
314
|
-
if (hasTextAfter && inputRef.current) {
|
315
|
-
var textWidth = (0, _getInputWidth.getInputWidth)(inputRef.current, inputContainerRef.current);
|
316
|
-
inputRef.current.style.width = "".concat(textWidth, "px");
|
317
|
-
} else {
|
318
|
-
var _inputRef_current;
|
319
|
-
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.style.removeProperty('width');
|
320
|
-
}
|
321
|
-
}, [
|
322
|
-
hasTextAfter
|
323
|
-
]);
|
324
314
|
var handleFocus = function(event) {
|
325
315
|
setHasFocus(true);
|
326
316
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
@@ -355,12 +345,31 @@ var textFieldRoot = function(Root) {
|
|
355
345
|
if (maxLength !== -1 && value.length > maxLength) {
|
356
346
|
return;
|
357
347
|
}
|
358
|
-
|
348
|
+
if (onChange) {
|
349
|
+
onChange(event);
|
350
|
+
}
|
359
351
|
if (hasTextAfter) {
|
360
352
|
var textWidth = (0, _getInputWidth.getInputWidth)(event.currentTarget, inputContainerRef.current);
|
361
353
|
event.currentTarget.style.width = "".concat(textWidth, "px");
|
362
354
|
}
|
363
355
|
};
|
356
|
+
var handlePaste = function(event) {
|
357
|
+
if (disabled || readOnly) {
|
358
|
+
return;
|
359
|
+
}
|
360
|
+
if (onPaste) {
|
361
|
+
onPaste(event);
|
362
|
+
}
|
363
|
+
if (hasTextAfter) {
|
364
|
+
setTimeout(function() {
|
365
|
+
if (!inputRef.current) {
|
366
|
+
return;
|
367
|
+
}
|
368
|
+
var textWidth = (0, _getInputWidth.getInputWidth)(inputRef.current, inputContainerRef.current);
|
369
|
+
inputRef.current.style.width = "".concat(textWidth, "px");
|
370
|
+
});
|
371
|
+
}
|
372
|
+
};
|
364
373
|
var updateChips = function(newChips, newValues) {
|
365
374
|
setChips(newChips);
|
366
375
|
onChangeChips === null || onChangeChips === void 0 ? void 0 : onChangeChips(newValues);
|
@@ -401,6 +410,18 @@ var textFieldRoot = function(Root) {
|
|
401
410
|
onKeyDown(event);
|
402
411
|
}
|
403
412
|
};
|
413
|
+
(0, _react.useEffect)(function() {
|
414
|
+
if (hasTextAfter && inputRef.current) {
|
415
|
+
var textWidth = (0, _getInputWidth.getInputWidth)(inputRef.current, inputContainerRef.current);
|
416
|
+
inputRef.current.style.width = "".concat(textWidth, "px");
|
417
|
+
} else {
|
418
|
+
var _inputRef_current;
|
419
|
+
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.style.removeProperty('width');
|
420
|
+
}
|
421
|
+
}, [
|
422
|
+
hasTextAfter,
|
423
|
+
outerValue
|
424
|
+
]);
|
404
425
|
(0, _react.useEffect)(function() {
|
405
426
|
if (!isChipEnumeration && !(values === null || values === void 0 ? void 0 : values.length)) {
|
406
427
|
return;
|
@@ -554,6 +575,7 @@ var textFieldRoot = function(Root) {
|
|
554
575
|
onKeyDown: handleOnKeyDown,
|
555
576
|
onFocus: handleFocus,
|
556
577
|
onBlur: handleBlur,
|
578
|
+
onPaste: handlePaste,
|
557
579
|
"data-tour": true
|
558
580
|
}, rest)), hasInnerLabel && /*#__PURE__*/ _react.default.createElement(_TextFieldstyles.Label, {
|
559
581
|
"data-root": true,
|