@salutejs/plasma-new-hope 0.329.0-dev.0 → 0.329.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.
Files changed (169) hide show
  1. package/cjs/components/Combobox/ComboboxNew/Combobox.css +12 -12
  2. package/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
  3. package/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js.map +1 -1
  4. package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +12 -12
  5. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +1 -1
  6. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
  7. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_80gotw.css → Item.styles_1q0u1o1.css} +2 -2
  8. package/cjs/components/Combobox/ComboboxNew/ui/SelectAll/SelectAll.css +12 -12
  9. package/cjs/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.css +12 -12
  10. package/cjs/components/NumberFormat/NumberFormat.js +44 -4
  11. package/cjs/components/NumberFormat/NumberFormat.js.map +1 -1
  12. package/cjs/components/Pagination/Pagination.css +10 -10
  13. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +10 -10
  14. package/cjs/components/Select/Select.css +10 -10
  15. package/cjs/components/Select/Select.tokens.js +1 -0
  16. package/cjs/components/Select/Select.tokens.js.map +1 -1
  17. package/cjs/components/Select/ui/Inner/Inner.css +10 -10
  18. package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +1 -1
  19. package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
  20. package/cjs/components/Select/ui/Inner/ui/Item/{Item.styles_1qpfn0s.css → Item.styles_1dlmiti.css} +2 -2
  21. package/cjs/components/Select/ui/SelectAll/SelectAll.css +10 -10
  22. package/cjs/components/Select/ui/VirtualList/VirtualList.css +10 -10
  23. package/cjs/components/Table/Table.css +10 -10
  24. package/cjs/components/Table/ui/Cell/Cell.css +10 -10
  25. package/cjs/components/Table/ui/EditableCell/EditableCell.css +10 -10
  26. package/cjs/components/Table/ui/HeadCell/HeadCell.css +10 -10
  27. package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.css +10 -10
  28. package/cjs/components/TextArea/TextArea.js +22 -8
  29. package/cjs/components/TextArea/TextArea.js.map +1 -1
  30. package/cjs/components/TextArea/TextArea.styles.js +101 -64
  31. package/cjs/components/TextArea/TextArea.styles.js.map +1 -1
  32. package/cjs/components/TextArea/TextArea.styles_exqsyh.css +24 -0
  33. package/cjs/components/TextArea/TextArea.tokens.js +3 -1
  34. package/cjs/components/TextArea/TextArea.tokens.js.map +1 -1
  35. package/cjs/components/TextArea/TextArea_c31ipk.css +1 -0
  36. package/cjs/components/TextArea/ui/Hint/Hint.css +22 -18
  37. package/cjs/components/TextArea/variations/_clear/base.js +1 -1
  38. package/cjs/components/TextArea/variations/_clear/base_1vo4ba5.css +1 -0
  39. package/cjs/components/TextArea/variations/_disabled/base.js +1 -1
  40. package/cjs/components/TextArea/variations/_disabled/base_s6ttw.css +1 -0
  41. package/cjs/components/TextArea/variations/_read-only/base.js +1 -1
  42. package/cjs/components/TextArea/variations/_read-only/{base_1v0syh0.css → base_vk912g.css} +1 -1
  43. package/cjs/components/TextField/TextField.js +32 -11
  44. package/cjs/components/TextField/TextField.js.map +1 -1
  45. package/cjs/index.css +47 -43
  46. package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
  47. package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +26 -26
  48. package/emotion/cjs/components/NumberFormat/NumberFormat.js +88 -5
  49. package/emotion/cjs/components/Select/Select.tokens.js +1 -0
  50. package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +22 -22
  51. package/emotion/cjs/components/TextArea/TextArea.js +20 -8
  52. package/emotion/cjs/components/TextArea/TextArea.styles.js +78 -41
  53. package/emotion/cjs/components/TextArea/TextArea.tokens.js +3 -1
  54. package/emotion/cjs/components/TextArea/mixins/applyDynamicLabel.js +2 -2
  55. package/emotion/cjs/components/TextField/TextField.js +36 -14
  56. package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +15 -15
  57. package/emotion/cjs/examples/plasma_b2c/components/Select/Select.config.js +24 -24
  58. package/emotion/cjs/examples/plasma_web/components/Combobox/Combobox.config.js +15 -15
  59. package/emotion/cjs/examples/plasma_web/components/Select/Select.config.js +24 -24
  60. package/emotion/es/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
  61. package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +26 -26
  62. package/emotion/es/components/NumberFormat/NumberFormat.js +90 -7
  63. package/emotion/es/components/Select/Select.tokens.js +1 -0
  64. package/emotion/es/components/Select/ui/Inner/ui/Item/Item.styles.js +22 -22
  65. package/emotion/es/components/TextArea/TextArea.js +21 -9
  66. package/emotion/es/components/TextArea/TextArea.styles.js +66 -41
  67. package/emotion/es/components/TextArea/TextArea.tokens.js +3 -1
  68. package/emotion/es/components/TextArea/mixins/applyDynamicLabel.js +2 -2
  69. package/emotion/es/components/TextField/TextField.js +36 -14
  70. package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +15 -15
  71. package/emotion/es/examples/plasma_b2c/components/Select/Select.config.js +24 -24
  72. package/emotion/es/examples/plasma_web/components/Combobox/Combobox.config.js +15 -15
  73. package/emotion/es/examples/plasma_web/components/Select/Select.config.js +24 -24
  74. package/es/components/Combobox/ComboboxNew/Combobox.css +12 -12
  75. package/es/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
  76. package/es/components/Combobox/ComboboxNew/Combobox.tokens.js.map +1 -1
  77. package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +12 -12
  78. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +1 -1
  79. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
  80. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_80gotw.css → Item.styles_1q0u1o1.css} +2 -2
  81. package/es/components/Combobox/ComboboxNew/ui/SelectAll/SelectAll.css +12 -12
  82. package/es/components/Combobox/ComboboxNew/ui/VirtualList/VirtualList.css +12 -12
  83. package/es/components/NumberFormat/NumberFormat.js +47 -7
  84. package/es/components/NumberFormat/NumberFormat.js.map +1 -1
  85. package/es/components/Pagination/Pagination.css +10 -10
  86. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +10 -10
  87. package/es/components/Select/Select.css +10 -10
  88. package/es/components/Select/Select.tokens.js +1 -0
  89. package/es/components/Select/Select.tokens.js.map +1 -1
  90. package/es/components/Select/ui/Inner/Inner.css +10 -10
  91. package/es/components/Select/ui/Inner/ui/Item/Item.styles.js +1 -1
  92. package/es/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
  93. package/es/components/Select/ui/Inner/ui/Item/{Item.styles_1qpfn0s.css → Item.styles_1dlmiti.css} +2 -2
  94. package/es/components/Select/ui/SelectAll/SelectAll.css +10 -10
  95. package/es/components/Select/ui/VirtualList/VirtualList.css +10 -10
  96. package/es/components/Table/Table.css +10 -10
  97. package/es/components/Table/ui/Cell/Cell.css +10 -10
  98. package/es/components/Table/ui/EditableCell/EditableCell.css +10 -10
  99. package/es/components/Table/ui/HeadCell/HeadCell.css +10 -10
  100. package/es/components/Table/ui/HeadCell/ui/Filter/Filter.css +10 -10
  101. package/es/components/TextArea/TextArea.js +23 -9
  102. package/es/components/TextArea/TextArea.js.map +1 -1
  103. package/es/components/TextArea/TextArea.styles.js +100 -65
  104. package/es/components/TextArea/TextArea.styles.js.map +1 -1
  105. package/es/components/TextArea/TextArea.styles_exqsyh.css +24 -0
  106. package/es/components/TextArea/TextArea.tokens.js +3 -1
  107. package/es/components/TextArea/TextArea.tokens.js.map +1 -1
  108. package/es/components/TextArea/TextArea_c31ipk.css +1 -0
  109. package/es/components/TextArea/ui/Hint/Hint.css +22 -18
  110. package/es/components/TextArea/variations/_clear/base.js +1 -1
  111. package/es/components/TextArea/variations/_clear/base_1vo4ba5.css +1 -0
  112. package/es/components/TextArea/variations/_disabled/base.js +1 -1
  113. package/es/components/TextArea/variations/_disabled/base_s6ttw.css +1 -0
  114. package/es/components/TextArea/variations/_read-only/base.js +1 -1
  115. package/es/components/TextArea/variations/_read-only/{base_1v0syh0.css → base_vk912g.css} +1 -1
  116. package/es/components/TextField/TextField.js +32 -11
  117. package/es/components/TextField/TextField.js.map +1 -1
  118. package/es/index.css +47 -43
  119. package/package.json +4 -4
  120. package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
  121. package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +15 -15
  122. package/styled-components/cjs/components/NumberFormat/NumberFormat.js +88 -5
  123. package/styled-components/cjs/components/Select/Select.tokens.js +1 -0
  124. package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +13 -13
  125. package/styled-components/cjs/components/TextArea/TextArea.js +19 -7
  126. package/styled-components/cjs/components/TextArea/TextArea.styles.js +76 -28
  127. package/styled-components/cjs/components/TextArea/TextArea.tokens.js +3 -1
  128. package/styled-components/cjs/components/TextArea/mixins/applyDynamicLabel.js +2 -2
  129. package/styled-components/cjs/components/TextField/TextField.js +35 -13
  130. package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +32 -28
  131. package/styled-components/cjs/examples/plasma_b2c/components/Select/Select.config.js +74 -40
  132. package/styled-components/cjs/examples/plasma_web/components/Combobox/Combobox.config.js +32 -28
  133. package/styled-components/cjs/examples/plasma_web/components/Select/Select.config.js +74 -40
  134. package/styled-components/es/components/Combobox/ComboboxNew/Combobox.tokens.js +1 -0
  135. package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +15 -15
  136. package/styled-components/es/components/NumberFormat/NumberFormat.js +90 -7
  137. package/styled-components/es/components/Select/Select.tokens.js +1 -0
  138. package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.styles.js +13 -13
  139. package/styled-components/es/components/TextArea/TextArea.js +20 -8
  140. package/styled-components/es/components/TextArea/TextArea.styles.js +64 -28
  141. package/styled-components/es/components/TextArea/TextArea.tokens.js +3 -1
  142. package/styled-components/es/components/TextArea/mixins/applyDynamicLabel.js +2 -2
  143. package/styled-components/es/components/TextField/TextField.js +35 -13
  144. package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +32 -28
  145. package/styled-components/es/examples/plasma_b2c/components/Select/Select.config.js +74 -40
  146. package/styled-components/es/examples/plasma_web/components/Combobox/Combobox.config.js +32 -28
  147. package/styled-components/es/examples/plasma_web/components/Select/Select.config.js +74 -40
  148. package/types/components/Combobox/ComboboxNew/Combobox.tokens.d.ts +1 -0
  149. package/types/components/Combobox/ComboboxNew/Combobox.tokens.d.ts.map +1 -1
  150. package/types/components/NumberFormat/NumberFormat.d.ts.map +1 -1
  151. package/types/components/Select/Select.tokens.d.ts +1 -0
  152. package/types/components/Select/Select.tokens.d.ts.map +1 -1
  153. package/types/components/TextArea/TextArea.d.ts.map +1 -1
  154. package/types/components/TextArea/TextArea.styles.d.ts +10 -1
  155. package/types/components/TextArea/TextArea.styles.d.ts.map +1 -1
  156. package/types/components/TextArea/TextArea.tokens.d.ts +2 -0
  157. package/types/components/TextArea/TextArea.tokens.d.ts.map +1 -1
  158. package/types/components/TextArea/TextArea.types.d.ts +5 -0
  159. package/types/components/TextArea/TextArea.types.d.ts.map +1 -1
  160. package/types/components/TextArea/mixins/applyDynamicLabel.d.ts.map +1 -1
  161. package/types/components/TextField/TextField.d.ts.map +1 -1
  162. package/cjs/components/TextArea/TextArea.styles_1r7xix5.css +0 -20
  163. package/cjs/components/TextArea/TextArea_e0xkpd.css +0 -1
  164. package/cjs/components/TextArea/variations/_clear/base_16hm89e.css +0 -1
  165. package/cjs/components/TextArea/variations/_disabled/base_1bn0zc9.css +0 -1
  166. package/es/components/TextArea/TextArea.styles_1r7xix5.css +0 -20
  167. package/es/components/TextArea/TextArea_e0xkpd.css +0 -1
  168. package/es/components/TextArea/variations/_clear/base_16hm89e.css +0 -1
  169. package/es/components/TextArea/variations/_disabled/base_1bn0zc9.css +0 -1
@@ -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
- "onChange"
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: outerRef,
210
+ getInputRef: inputForkRef,
129
211
  _textEllipsisDisable: true,
130
- onValueChange: handleChangeValue
212
+ onValueChange: handleChangeValue,
213
+ onPaste: handlePaste
131
214
  }, rest));
132
215
  });
133
216
  };
@@ -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',