@salutejs/plasma-new-hope 0.330.0-canary.2009.16048670450.0 → 0.330.0-canary.2009.16162480074.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/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/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/cjs/components/Select/ui/Inner/ui/Item/{Item.styles_1qpfn0s.css → 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 +20 -20
- 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/NumberFormat/NumberFormat.js +88 -5
- 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/NumberFormat/NumberFormat.js +90 -7
- 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/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/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/es/components/Select/ui/Inner/ui/Item/{Item.styles_1qpfn0s.css → 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 +20 -20
- 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/NumberFormat/NumberFormat.js +88 -5
- 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/NumberFormat/NumberFormat.js +90 -7
- 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/Combobox/ComboboxNew/Combobox.tokens.d.ts +1 -0
- package/types/components/Combobox/ComboboxNew/Combobox.tokens.d.ts.map +1 -1
- package/types/components/NumberFormat/NumberFormat.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
@@ -1,3 +1,11 @@
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
4
|
+
return arr2;
|
5
|
+
}
|
6
|
+
function _array_with_holes(arr) {
|
7
|
+
if (Array.isArray(arr)) return arr;
|
8
|
+
}
|
1
9
|
function _define_property(obj, key, value) {
|
2
10
|
if (key in obj) {
|
3
11
|
Object.defineProperty(obj, key, {
|
@@ -11,6 +19,33 @@ function _define_property(obj, key, value) {
|
|
11
19
|
}
|
12
20
|
return obj;
|
13
21
|
}
|
22
|
+
function _iterable_to_array_limit(arr, i) {
|
23
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
24
|
+
if (_i == null) return;
|
25
|
+
var _arr = [];
|
26
|
+
var _n = true;
|
27
|
+
var _d = false;
|
28
|
+
var _s, _e;
|
29
|
+
try {
|
30
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
31
|
+
_arr.push(_s.value);
|
32
|
+
if (i && _arr.length === i) break;
|
33
|
+
}
|
34
|
+
} catch (err) {
|
35
|
+
_d = true;
|
36
|
+
_e = err;
|
37
|
+
} finally{
|
38
|
+
try {
|
39
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
40
|
+
} finally{
|
41
|
+
if (_d) throw _e;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
return _arr;
|
45
|
+
}
|
46
|
+
function _non_iterable_rest() {
|
47
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
48
|
+
}
|
14
49
|
function _object_spread(target) {
|
15
50
|
for(var i = 1; i < arguments.length; i++){
|
16
51
|
var source = arguments[i] != null ? arguments[i] : {};
|
@@ -53,30 +88,78 @@ function _object_without_properties_loose(source, excluded) {
|
|
53
88
|
}
|
54
89
|
return target;
|
55
90
|
}
|
56
|
-
|
57
|
-
|
91
|
+
function _sliced_to_array(arr, i) {
|
92
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
93
|
+
}
|
94
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
95
|
+
if (!o) return;
|
96
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
97
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
98
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
99
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
100
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
101
|
+
}
|
102
|
+
import React, { forwardRef, useRef, useState } from "react";
|
103
|
+
import { NumericFormat, numericFormatter } from "react-number-format";
|
104
|
+
import { useForkRef } from "@salutejs/plasma-core";
|
58
105
|
export var composeNumberFormat = function(InputComponent) {
|
59
106
|
return /*#__PURE__*/ forwardRef(function(_param, outerRef) {
|
60
|
-
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, [
|
107
|
+
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, [
|
61
108
|
"thousandSeparator",
|
62
109
|
"decimalScale",
|
63
110
|
"decimalSeparator",
|
64
|
-
"
|
111
|
+
"disabled",
|
112
|
+
"value",
|
113
|
+
"onChange",
|
114
|
+
"onPaste"
|
65
115
|
]);
|
116
|
+
var inputRef = useRef(null);
|
117
|
+
var inputForkRef = useForkRef(inputRef, outerRef);
|
118
|
+
var _useState = _sliced_to_array(useState(''), 2), innerValue = _useState[0], setInnerValue = _useState[1];
|
119
|
+
var value = numericFormatter(String(outerValue !== null && outerValue !== void 0 ? outerValue : innerValue), {
|
120
|
+
thousandSeparator: thousandSeparator,
|
121
|
+
decimalScale: decimalScale,
|
122
|
+
decimalSeparator: decimalSeparator
|
123
|
+
});
|
66
124
|
var handleChangeValue = function(values, sourceInfo) {
|
125
|
+
var changeEvent = sourceInfo.event;
|
126
|
+
setInnerValue(values.value);
|
67
127
|
if (onChange) {
|
68
|
-
var changeEvent = sourceInfo.event;
|
69
128
|
onChange(changeEvent, values);
|
70
129
|
}
|
71
130
|
};
|
131
|
+
var handlePaste = function(event) {
|
132
|
+
if (disabled) {
|
133
|
+
return;
|
134
|
+
}
|
135
|
+
if (decimalSeparator !== '.' && inputRef.current) {
|
136
|
+
if (!Number.isNaN(Number(event.clipboardData.getData('text/plain')))) {
|
137
|
+
event.preventDefault();
|
138
|
+
var pastedValue = event.clipboardData.getData('text/plain').replace('.', decimalSeparator);
|
139
|
+
var input = event.target;
|
140
|
+
var startPos = input.selectionStart || 0;
|
141
|
+
var newCursorPos = startPos + pastedValue.length;
|
142
|
+
setInnerValue(pastedValue);
|
143
|
+
setTimeout(function() {
|
144
|
+
var _inputRef_current;
|
145
|
+
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.setSelectionRange(newCursorPos, newCursorPos);
|
146
|
+
}, 10);
|
147
|
+
}
|
148
|
+
}
|
149
|
+
if (onPaste) {
|
150
|
+
onPaste(event);
|
151
|
+
}
|
152
|
+
};
|
72
153
|
return /*#__PURE__*/ React.createElement(NumericFormat, _object_spread({
|
154
|
+
value: value,
|
73
155
|
thousandSeparator: thousandSeparator,
|
74
156
|
decimalScale: decimalScale,
|
75
157
|
decimalSeparator: decimalSeparator,
|
76
158
|
customInput: InputComponent,
|
77
|
-
getInputRef:
|
159
|
+
getInputRef: inputForkRef,
|
78
160
|
_textEllipsisDisable: true,
|
79
|
-
onValueChange: handleChangeValue
|
161
|
+
onValueChange: handleChangeValue,
|
162
|
+
onPaste: handlePaste
|
80
163
|
}, rest));
|
81
164
|
});
|
82
165
|
};
|
@@ -32,6 +32,7 @@ export var tokens = {
|
|
32
32
|
itemBackgroundHover: '--plasma-select-item-background-hover',
|
33
33
|
itemDisabledOpacity: '--plasma-select-item-disabled-opacity',
|
34
34
|
itemDisabledColor: '--plasma-select-item-disabled-color',
|
35
|
+
itemIconColor: '--plasma-select-item-icon-color',
|
35
36
|
cellPadding: '--plasma-select-cell-padding',
|
36
37
|
cellPaddingLeftContent: '--plasma-select-cell-padding-left-content',
|
37
38
|
cellPaddingContent: '--plasma-select-cell-padding-content',
|