@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
@@ -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
- import React, { forwardRef } from "react";
57
- import { NumericFormat } from "react-number-format";
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
- "onChange"
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: outerRef,
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',