@salutejs/plasma-new-hope 0.330.0-canary.1655.16067895478.0 → 0.330.0-canary.2050.16051901455.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 (160) hide show
  1. package/cjs/components/Drawer/Drawer.css +5 -7
  2. package/cjs/components/Modal/Modal.css +6 -9
  3. package/cjs/components/Modal/Modal.js +4 -13
  4. package/cjs/components/Modal/Modal.js.map +1 -1
  5. package/cjs/components/Modal/Modal.styles.js +5 -16
  6. package/cjs/components/Modal/Modal.styles.js.map +1 -1
  7. package/cjs/components/Modal/{Modal.styles_1obtvtw.css → Modal.styles_1gt0sfn.css} +3 -4
  8. package/cjs/components/Notification/NotificationsProvider.css +3 -7
  9. package/cjs/components/NumberFormat/NumberFormat.js +49 -3
  10. package/cjs/components/NumberFormat/NumberFormat.js.map +1 -1
  11. package/cjs/components/Popup/Popup.js +4 -42
  12. package/cjs/components/Popup/Popup.js.map +1 -1
  13. package/cjs/components/Popup/Popup.styles.js +12 -24
  14. package/cjs/components/Popup/Popup.styles.js.map +1 -1
  15. package/cjs/components/Popup/Popup.styles_gq4luz.css +4 -0
  16. package/cjs/components/Popup/Popup.tokens.js +1 -6
  17. package/cjs/components/Popup/Popup.tokens.js.map +1 -1
  18. package/cjs/components/Popup/PopupContext.css +3 -7
  19. package/cjs/components/Popup/utils/index.js.map +1 -1
  20. package/cjs/components/TextField/TextField.js +32 -11
  21. package/cjs/components/TextField/TextField.js.map +1 -1
  22. package/cjs/index.css +6 -9
  23. package/emotion/cjs/components/Modal/Modal.js +5 -14
  24. package/emotion/cjs/components/Modal/Modal.styles.js +6 -14
  25. package/emotion/cjs/components/NumberFormat/NumberFormat.js +95 -4
  26. package/emotion/cjs/components/Popup/Popup.js +5 -43
  27. package/emotion/cjs/components/Popup/Popup.styles.js +8 -22
  28. package/emotion/cjs/components/Popup/Popup.tokens.js +1 -6
  29. package/emotion/cjs/components/Popup/utils/index.js +0 -16
  30. package/emotion/cjs/components/TextField/TextField.js +36 -14
  31. package/emotion/cjs/components/_Icon/index.js +0 -4
  32. package/emotion/es/components/Modal/Modal.js +6 -15
  33. package/emotion/es/components/Modal/Modal.styles.js +6 -11
  34. package/emotion/es/components/NumberFormat/NumberFormat.js +97 -6
  35. package/emotion/es/components/Popup/Popup.js +6 -45
  36. package/emotion/es/components/Popup/Popup.styles.js +8 -16
  37. package/emotion/es/components/Popup/Popup.tokens.js +1 -6
  38. package/emotion/es/components/Popup/utils/index.js +0 -3
  39. package/emotion/es/components/TextField/TextField.js +36 -14
  40. package/emotion/es/components/_Icon/index.js +0 -1
  41. package/es/components/Drawer/Drawer.css +5 -7
  42. package/es/components/Modal/Modal.css +6 -9
  43. package/es/components/Modal/Modal.js +7 -16
  44. package/es/components/Modal/Modal.js.map +1 -1
  45. package/es/components/Modal/Modal.styles.js +6 -16
  46. package/es/components/Modal/Modal.styles.js.map +1 -1
  47. package/es/components/Modal/{Modal.styles_1obtvtw.css → Modal.styles_1gt0sfn.css} +3 -4
  48. package/es/components/Notification/NotificationsProvider.css +3 -7
  49. package/es/components/NumberFormat/NumberFormat.js +52 -6
  50. package/es/components/NumberFormat/NumberFormat.js.map +1 -1
  51. package/es/components/Popup/Popup.js +5 -43
  52. package/es/components/Popup/Popup.js.map +1 -1
  53. package/es/components/Popup/Popup.styles.js +13 -23
  54. package/es/components/Popup/Popup.styles.js.map +1 -1
  55. package/es/components/Popup/Popup.styles_gq4luz.css +4 -0
  56. package/es/components/Popup/Popup.tokens.js +1 -6
  57. package/es/components/Popup/Popup.tokens.js.map +1 -1
  58. package/es/components/Popup/PopupContext.css +3 -7
  59. package/es/components/Popup/utils/index.js.map +1 -1
  60. package/es/components/TextField/TextField.js +32 -11
  61. package/es/components/TextField/TextField.js.map +1 -1
  62. package/es/index.css +6 -9
  63. package/package.json +2 -3
  64. package/styled-components/cjs/components/Modal/Modal.js +5 -14
  65. package/styled-components/cjs/components/Modal/Modal.styles.js +8 -50
  66. package/styled-components/cjs/components/NumberFormat/NumberFormat.js +95 -4
  67. package/styled-components/cjs/components/Popup/Popup.js +5 -43
  68. package/styled-components/cjs/components/Popup/Popup.styles.js +8 -65
  69. package/styled-components/cjs/components/Popup/Popup.tokens.js +1 -6
  70. package/styled-components/cjs/components/Popup/utils/index.js +0 -16
  71. package/styled-components/cjs/components/TextField/TextField.js +35 -13
  72. package/styled-components/cjs/components/_Icon/index.js +0 -4
  73. package/styled-components/es/components/Modal/Modal.js +6 -15
  74. package/styled-components/es/components/Modal/Modal.styles.js +4 -8
  75. package/styled-components/es/components/NumberFormat/NumberFormat.js +97 -6
  76. package/styled-components/es/components/Popup/Popup.js +6 -45
  77. package/styled-components/es/components/Popup/Popup.styles.js +4 -20
  78. package/styled-components/es/components/Popup/Popup.tokens.js +1 -6
  79. package/styled-components/es/components/Popup/utils/index.js +0 -3
  80. package/styled-components/es/components/TextField/TextField.js +35 -13
  81. package/styled-components/es/components/_Icon/index.js +0 -1
  82. package/types/components/Breadcrumbs/utils/index.d.ts +1 -1
  83. package/types/components/Combobox/ComboboxNew/utils/sizeToIconSize.d.ts +1 -1
  84. package/types/components/Drawer/Drawer.d.ts +2 -2
  85. package/types/components/Drawer/Drawer.d.ts.map +1 -1
  86. package/types/components/Drawer/Drawer.types.d.ts +1 -1
  87. package/types/components/Drawer/Drawer.types.d.ts.map +1 -1
  88. package/types/components/Modal/Modal.d.ts +1 -1
  89. package/types/components/Modal/Modal.d.ts.map +1 -1
  90. package/types/components/Modal/Modal.styles.d.ts +1 -4
  91. package/types/components/Modal/Modal.styles.d.ts.map +1 -1
  92. package/types/components/NumberFormat/NumberFormat.d.ts.map +1 -1
  93. package/types/components/Popup/Popup.d.ts +1 -1
  94. package/types/components/Popup/Popup.d.ts.map +1 -1
  95. package/types/components/Popup/Popup.styles.d.ts +0 -2
  96. package/types/components/Popup/Popup.styles.d.ts.map +1 -1
  97. package/types/components/Popup/Popup.tokens.d.ts +0 -5
  98. package/types/components/Popup/Popup.tokens.d.ts.map +1 -1
  99. package/types/components/Popup/Popup.types.d.ts +0 -58
  100. package/types/components/Popup/Popup.types.d.ts.map +1 -1
  101. package/types/components/Popup/utils/index.d.ts +0 -3
  102. package/types/components/Popup/utils/index.d.ts.map +1 -1
  103. package/types/components/Select/utils/sizeToIconSize.d.ts +1 -1
  104. package/types/components/Table/ui/HeadCell/HeadCell.d.ts +1 -1
  105. package/types/components/TextField/TextField.d.ts.map +1 -1
  106. package/types/components/Tree/utils/sizeToIconSize.d.ts +1 -1
  107. package/types/components/_Icon/index.d.ts +0 -1
  108. package/types/components/_Icon/index.d.ts.map +1 -1
  109. package/cjs/components/Popup/Popup.styles_sejy82.css +0 -6
  110. package/cjs/components/Popup/utils/getHandleStyles.js +0 -58
  111. package/cjs/components/Popup/utils/getHandleStyles.js.map +0 -1
  112. package/cjs/components/Popup/utils/getRatioBasedOnPlacement.js +0 -36
  113. package/cjs/components/Popup/utils/getRatioBasedOnPlacement.js.map +0 -1
  114. package/cjs/components/Popup/utils/getResizeDirections.js +0 -73
  115. package/cjs/components/Popup/utils/getResizeDirections.js.map +0 -1
  116. package/cjs/components/_Icon/Icon.assets/ResizeDiagonal.js +0 -30
  117. package/cjs/components/_Icon/Icon.assets/ResizeDiagonal.js.map +0 -1
  118. package/cjs/components/_Icon/Icons/IconResizeDiagonal.js +0 -30
  119. package/cjs/components/_Icon/Icons/IconResizeDiagonal.js.map +0 -1
  120. package/emotion/cjs/components/Popup/utils/getHandleStyles.js +0 -61
  121. package/emotion/cjs/components/Popup/utils/getRatioBasedOnPlacement.js +0 -54
  122. package/emotion/cjs/components/Popup/utils/getResizeDirections.js +0 -82
  123. package/emotion/cjs/components/_Icon/Icon.assets/ResizeDiagonal.js +0 -83
  124. package/emotion/cjs/components/_Icon/Icons/IconResizeDiagonal.js +0 -86
  125. package/emotion/es/components/Popup/utils/getHandleStyles.js +0 -51
  126. package/emotion/es/components/Popup/utils/getRatioBasedOnPlacement.js +0 -44
  127. package/emotion/es/components/Popup/utils/getResizeDirections.js +0 -72
  128. package/emotion/es/components/_Icon/Icon.assets/ResizeDiagonal.js +0 -68
  129. package/emotion/es/components/_Icon/Icons/IconResizeDiagonal.js +0 -71
  130. package/es/components/Popup/Popup.styles_sejy82.css +0 -6
  131. package/es/components/Popup/utils/getHandleStyles.js +0 -54
  132. package/es/components/Popup/utils/getHandleStyles.js.map +0 -1
  133. package/es/components/Popup/utils/getRatioBasedOnPlacement.js +0 -32
  134. package/es/components/Popup/utils/getRatioBasedOnPlacement.js.map +0 -1
  135. package/es/components/Popup/utils/getResizeDirections.js +0 -69
  136. package/es/components/Popup/utils/getResizeDirections.js.map +0 -1
  137. package/es/components/_Icon/Icon.assets/ResizeDiagonal.js +0 -22
  138. package/es/components/_Icon/Icon.assets/ResizeDiagonal.js.map +0 -1
  139. package/es/components/_Icon/Icons/IconResizeDiagonal.js +0 -22
  140. package/es/components/_Icon/Icons/IconResizeDiagonal.js.map +0 -1
  141. package/styled-components/cjs/components/Popup/utils/getHandleStyles.js +0 -61
  142. package/styled-components/cjs/components/Popup/utils/getRatioBasedOnPlacement.js +0 -54
  143. package/styled-components/cjs/components/Popup/utils/getResizeDirections.js +0 -82
  144. package/styled-components/cjs/components/_Icon/Icon.assets/ResizeDiagonal.js +0 -83
  145. package/styled-components/cjs/components/_Icon/Icons/IconResizeDiagonal.js +0 -86
  146. package/styled-components/es/components/Popup/utils/getHandleStyles.js +0 -51
  147. package/styled-components/es/components/Popup/utils/getRatioBasedOnPlacement.js +0 -44
  148. package/styled-components/es/components/Popup/utils/getResizeDirections.js +0 -72
  149. package/styled-components/es/components/_Icon/Icon.assets/ResizeDiagonal.js +0 -68
  150. package/styled-components/es/components/_Icon/Icons/IconResizeDiagonal.js +0 -71
  151. package/types/components/Popup/utils/getHandleStyles.d.ts +0 -29
  152. package/types/components/Popup/utils/getHandleStyles.d.ts.map +0 -1
  153. package/types/components/Popup/utils/getRatioBasedOnPlacement.d.ts +0 -3
  154. package/types/components/Popup/utils/getRatioBasedOnPlacement.d.ts.map +0 -1
  155. package/types/components/Popup/utils/getResizeDirections.d.ts +0 -14
  156. package/types/components/Popup/utils/getResizeDirections.d.ts.map +0 -1
  157. package/types/components/_Icon/Icon.assets/ResizeDiagonal.d.ts +0 -4
  158. package/types/components/_Icon/Icon.assets/ResizeDiagonal.d.ts.map +0 -1
  159. package/types/components/_Icon/Icons/IconResizeDiagonal.d.ts +0 -4
  160. package/types/components/_Icon/Icons/IconResizeDiagonal.d.ts.map +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,83 @@ 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, value = _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)(value ? (0, _reactnumberformat.numericFormatter)(String(value), {
170
+ thousandSeparator: thousandSeparator,
171
+ decimalScale: decimalScale,
172
+ decimalSeparator: decimalSeparator
173
+ }) : ''), 2), innerValue = _useState[0], setInnerValue = _useState[1];
117
174
  var handleChangeValue = function(values, sourceInfo) {
118
175
  if (onChange) {
119
176
  var changeEvent = sourceInfo.event;
177
+ setInnerValue(values.value);
120
178
  onChange(changeEvent, values);
121
179
  }
122
180
  };
181
+ var handlePaste = function(event) {
182
+ if (disabled) {
183
+ return;
184
+ }
185
+ if (decimalSeparator !== '.' && inputRef.current) {
186
+ if (!Number.isNaN(Number(event.clipboardData.getData('text/plain')))) {
187
+ event.preventDefault();
188
+ var pastedValue = event.clipboardData.getData('text/plain').replace('.', decimalSeparator);
189
+ var input = event.target;
190
+ var startPos = input.selectionStart || 0;
191
+ var newCursorPos = startPos + pastedValue.length;
192
+ setInnerValue(pastedValue);
193
+ setTimeout(function() {
194
+ var _inputRef_current;
195
+ (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.setSelectionRange(newCursorPos, newCursorPos);
196
+ }, 10);
197
+ }
198
+ }
199
+ if (onPaste) {
200
+ onPaste(event);
201
+ }
202
+ };
203
+ (0, _react.useEffect)(function() {
204
+ setInnerValue(value ? (0, _reactnumberformat.numericFormatter)(String(value), {
205
+ thousandSeparator: thousandSeparator,
206
+ decimalScale: decimalScale,
207
+ decimalSeparator: decimalSeparator
208
+ }) : '');
209
+ }, [
210
+ value
211
+ ]);
123
212
  return /*#__PURE__*/ _react.default.createElement(_reactnumberformat.NumericFormat, _object_spread({
213
+ value: innerValue,
124
214
  thousandSeparator: thousandSeparator,
125
215
  decimalScale: decimalScale,
126
216
  decimalSeparator: decimalSeparator,
127
217
  customInput: InputComponent,
128
- getInputRef: outerRef,
218
+ getInputRef: inputForkRef,
129
219
  _textEllipsisDisable: true,
130
- onValueChange: handleChangeValue
220
+ onValueChange: handleChangeValue,
221
+ onPaste: handlePaste
131
222
  }, rest));
132
223
  });
133
224
  };
@@ -21,10 +21,8 @@ _export(exports, {
21
21
  });
22
22
  var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
23
23
  var _plasmacore = require("@salutejs/plasma-core");
24
- var _reresizable = require("re-resizable");
25
24
  var _utils = require("../../utils");
26
25
  var _Portal = require("../Portal");
27
- var _utils1 = require("./utils");
28
26
  var _PopupRoot = require("./PopupRoot");
29
27
  var _hooks = require("./hooks");
30
28
  var _Popuptokens = require("./Popup.tokens");
@@ -232,7 +230,7 @@ var popupRoot = function(Root) {
232
230
  0,
233
231
  0
234
232
  ] : _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, _param_draggable = _param.draggable, draggable = _param_draggable === void 0 ? false : _param_draggable, handle = _param.handle, resizable = _param.resizable, rest = _object_without_properties(_param, [
233
+ role = _param.role, zIndex = _param.zIndex, popupInfo = _param.popupInfo, _param_withAnimation = _param.withAnimation, withAnimation = _param_withAnimation === void 0 ? false : _param_withAnimation, className = _param.className, rest = _object_without_properties(_param, [
236
234
  "id",
237
235
  "isOpen",
238
236
  "opened",
@@ -245,12 +243,8 @@ var popupRoot = function(Root) {
245
243
  "zIndex",
246
244
  "popupInfo",
247
245
  "withAnimation",
248
- "className",
249
- "draggable",
250
- "handle",
251
- "resizable"
246
+ "className"
252
247
  ]);
253
- var _resizable_hiddenIcons, _resizable_hiddenIcons1, _resizable_hiddenIcons2, _resizable_hiddenIcons3;
254
248
  var innerIsOpen = isOpen || opened;
255
249
  var uniqId = (0, _utils.safeUseId)();
256
250
  var innerId = id || uniqId;
@@ -263,10 +257,10 @@ var popupRoot = function(Root) {
263
257
  var portalRef = (0, _react.useRef)(null);
264
258
  var contentRef = (0, _react.useRef)(null);
265
259
  var innerRef = (0, _plasmacore.useForkRef)(contentRef, outerRootRef);
266
- var cls = (0, _utils.cx)(className, (animationInfo === null || animationInfo === void 0 ? void 0 : animationInfo.endAnimation) ? _Popuptokens.classes.endAnimation : '', (animationInfo === null || animationInfo === void 0 ? void 0 : animationInfo.endTransition) ? _Popuptokens.classes.endTransition : '');
267
260
  if (!isVisible && !innerIsOpen) {
268
261
  return null;
269
262
  }
263
+ var cls = (0, _utils.cx)(className, (animationInfo === null || animationInfo === void 0 ? void 0 : animationInfo.endAnimation) ? _Popuptokens.classes.endAnimation : '', (animationInfo === null || animationInfo === void 0 ? void 0 : animationInfo.endTransition) ? _Popuptokens.classes.endTransition : '');
270
264
  var rootNode = /*#__PURE__*/ _react.default.createElement(Root, {
271
265
  className: cls
272
266
  }, overlay, /*#__PURE__*/ _react.default.createElement(_PopupRoot.PopupRoot, _object_spread({
@@ -277,39 +271,7 @@ var popupRoot = function(Root) {
277
271
  frame: frame,
278
272
  animationInfo: animationInfo,
279
273
  setVisible: setVisible
280
- }, rest), /*#__PURE__*/ _react.default.createElement(_reresizable.Resizable, {
281
- enable: resizable && !resizable.disabled ? (0, _utils1.getResizeDirections)(resizable.directions) : false,
282
- resizeRatio: (0, _utils1.getRatioBasedOnPlacement)(placement),
283
- defaultSize: resizable === null || resizable === void 0 ? void 0 : resizable.defaultSize,
284
- minWidth: resizable === null || resizable === void 0 ? void 0 : resizable.minWidth,
285
- minHeight: resizable === null || resizable === void 0 ? void 0 : resizable.minHeight,
286
- maxWidth: resizable === null || resizable === void 0 ? void 0 : resizable.maxWidth,
287
- maxHeight: resizable === null || resizable === void 0 ? void 0 : resizable.maxHeight,
288
- handleComponent: {
289
- topRight: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons = resizable.hiddenIcons) === null || _resizable_hiddenIcons === void 0 ? void 0 : _resizable_hiddenIcons.includes('top-right')) ? undefined : /*#__PURE__*/ _react.default.createElement(_Popupstyles.IconResizeDiagonalStyled, {
290
- className: _Popuptokens.classes.resizableTopRightIcon,
291
- color: "inherit",
292
- size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
293
- }),
294
- bottomRight: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons1 = resizable.hiddenIcons) === null || _resizable_hiddenIcons1 === void 0 ? void 0 : _resizable_hiddenIcons1.includes('bottom-right')) ? undefined : /*#__PURE__*/ _react.default.createElement(_Popupstyles.IconResizeDiagonalStyled, {
295
- className: _Popuptokens.classes.resizableBottomRightIcon,
296
- color: "inherit",
297
- size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
298
- }),
299
- bottomLeft: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons2 = resizable.hiddenIcons) === null || _resizable_hiddenIcons2 === void 0 ? void 0 : _resizable_hiddenIcons2.includes('bottom-left')) ? undefined : /*#__PURE__*/ _react.default.createElement(_Popupstyles.IconResizeDiagonalStyled, {
300
- className: _Popuptokens.classes.resizableBottomLeftIcon,
301
- color: "inherit",
302
- size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
303
- }),
304
- topLeft: (resizable === null || resizable === void 0 ? void 0 : (_resizable_hiddenIcons3 = resizable.hiddenIcons) === null || _resizable_hiddenIcons3 === void 0 ? void 0 : _resizable_hiddenIcons3.includes('top-left')) ? undefined : /*#__PURE__*/ _react.default.createElement(_Popupstyles.IconResizeDiagonalStyled, {
305
- className: _Popuptokens.classes.resizableTopLeftIcon,
306
- color: "inherit",
307
- size: resizable === null || resizable === void 0 ? void 0 : resizable.iconSize
308
- })
309
- },
310
- className: _Popuptokens.classes.resizableContainer,
311
- handleStyles: (0, _utils1.getHandleStyles)(resizable === null || resizable === void 0 ? void 0 : resizable.iconSize)
312
- }, children)));
274
+ }, rest), children));
313
275
  if (typeof frame !== 'string' && frame && frame.current && _utils.canUseDOM) {
314
276
  return /*#__PURE__*/ _react.default.createElement(_Portal.Portal, {
315
277
  container: frame.current
@@ -336,7 +298,7 @@ var popupConfig = {
336
298
  name: 'Popup',
337
299
  tag: 'div',
338
300
  layout: popupRoot,
339
- base: _Popupstyles.base,
301
+ base: '',
340
302
  variations: {},
341
303
  defaults: {}
342
304
  };
@@ -9,9 +9,6 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- get IconResizeDiagonalStyled () {
13
- return IconResizeDiagonalStyled;
14
- },
15
12
  get PopupRootContainer () {
16
13
  return PopupRootContainer;
17
14
  },
@@ -23,80 +20,36 @@ _export(exports, {
23
20
  },
24
21
  get StyledPortalContainer () {
25
22
  return StyledPortalContainer;
26
- },
27
- get base () {
28
- return base;
29
23
  }
30
24
  });
31
- var _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
32
- var _Icon = require("../_Icon");
33
- var _Popuptokens = require("./Popup.tokens");
25
+ var _styledcomponents = /*#__PURE__*/ _interop_require_default(require("styled-components"));
34
26
  var _utils = require("./utils");
35
- function _getRequireWildcardCache(nodeInterop) {
36
- if (typeof WeakMap !== "function") return null;
37
- var cacheBabelInterop = new WeakMap();
38
- var cacheNodeInterop = new WeakMap();
39
- return (_getRequireWildcardCache = function(nodeInterop) {
40
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
41
- })(nodeInterop);
42
- }
43
- function _interop_require_wildcard(obj, nodeInterop) {
44
- if (!nodeInterop && obj && obj.__esModule) {
45
- return obj;
46
- }
47
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
48
- return {
49
- default: obj
50
- };
51
- }
52
- var cache = _getRequireWildcardCache(nodeInterop);
53
- if (cache && cache.has(obj)) {
54
- return cache.get(obj);
55
- }
56
- var newObj = {
57
- __proto__: null
27
+ function _interop_require_default(obj) {
28
+ return obj && obj.__esModule ? obj : {
29
+ default: obj
58
30
  };
59
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
60
- for(var key in obj){
61
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
62
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
63
- if (desc && (desc.get || desc.set)) {
64
- Object.defineProperty(newObj, key, desc);
65
- } else {
66
- newObj[key] = obj[key];
67
- }
68
- }
69
- }
70
- newObj.default = obj;
71
- if (cache) {
72
- cache.set(obj, newObj);
73
- }
74
- return newObj;
75
31
  }
76
- var base = (0, _styledcomponents.css)([
77
- ""
78
- ]);
79
32
  var StyledPortal = _styledcomponents.default.div.withConfig({
80
33
  displayName: "Popup.styles__StyledPortal",
81
- componentId: "sc-53e4f17f-0"
34
+ componentId: "sc-9d33eb36-0"
82
35
  })([
83
36
  ""
84
37
  ]);
85
38
  var StyledPortalContainer = _styledcomponents.default.div.withConfig({
86
39
  displayName: "Popup.styles__StyledPortalContainer",
87
- componentId: "sc-53e4f17f-1"
40
+ componentId: "sc-9d33eb36-1"
88
41
  })([
89
42
  "width:0;"
90
43
  ]);
91
44
  var PopupView = _styledcomponents.default.div.withConfig({
92
45
  displayName: "Popup.styles__PopupView",
93
- componentId: "sc-53e4f17f-2"
46
+ componentId: "sc-9d33eb36-2"
94
47
  })([
95
48
  "position:relative;max-width:100%;pointer-events:all;"
96
49
  ]);
97
50
  var PopupRootContainer = _styledcomponents.default.div.withConfig({
98
51
  displayName: "Popup.styles__PopupRootContainer",
99
- componentId: "sc-53e4f17f-3"
52
+ componentId: "sc-9d33eb36-3"
100
53
  })([
101
54
  "position:",
102
55
  ";z-index:",
@@ -128,13 +81,3 @@ var PopupRootContainer = _styledcomponents.default.div.withConfig({
128
81
  var position = param.position;
129
82
  return position.transform || '';
130
83
  });
131
- var IconResizeDiagonalStyled = (0, _styledcomponents.default)(_Icon.IconResizeDiagonal).withConfig({
132
- displayName: "Popup.styles__IconResizeDiagonalStyled",
133
- componentId: "sc-53e4f17f-4"
134
- })([
135
- "color:var(--text-secondary);&:hover{color:var(--text-secondary-hover);}&:active{color:var(--text-secondary-active);}&.",
136
- "{transform:rotate(-90deg);}&.",
137
- "{transform:rotate(0);}&.",
138
- "{transform:rotate(90deg);}&.",
139
- "{transform:rotate(180deg);}"
140
- ], _Popuptokens.classes.resizableTopRightIcon, _Popuptokens.classes.resizableBottomRightIcon, _Popuptokens.classes.resizableBottomLeftIcon, _Popuptokens.classes.resizableTopLeftIcon);
@@ -13,10 +13,5 @@ var classes = {
13
13
  * Класс корневого компонента PopupRoot: `popup-base-root`
14
14
  */ root: 'popup-base-root',
15
15
  endAnimation: 'popup-end-animation',
16
- endTransition: 'popup-end-transition',
17
- resizableContainer: 'resizable-container',
18
- resizableTopRightIcon: 'resizable-top-right-icon',
19
- resizableBottomRightIcon: 'resizable-bottom-right-icon',
20
- resizableBottomLeftIcon: 'resizable-bottom-left-icon',
21
- resizableTopLeftIcon: 'resizable-top-left-icon'
16
+ endTransition: 'popup-end-transition'
22
17
  };
@@ -8,20 +8,4 @@ Object.defineProperty(exports, "DEFAULT_Z_INDEX", {
8
8
  return DEFAULT_Z_INDEX;
9
9
  }
10
10
  });
11
- _export_star(require("./getRatioBasedOnPlacement"), exports);
12
- _export_star(require("./getResizeDirections"), exports);
13
- _export_star(require("./getHandleStyles"), exports);
14
- function _export_star(from, to) {
15
- Object.keys(from).forEach(function(k) {
16
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
17
- Object.defineProperty(to, k, {
18
- enumerable: true,
19
- get: function() {
20
- return from[k];
21
- }
22
- });
23
- }
24
- });
25
- return from;
26
- }
27
11
  var DEFAULT_Z_INDEX = '9000';
@@ -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
- onChange === null || onChange === void 0 ? void 0 : onChange(event);
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,
@@ -123,9 +123,6 @@ _export(exports, {
123
123
  get IconResetOutline () {
124
124
  return _IconResetOutline.IconResetOutline;
125
125
  },
126
- get IconResizeDiagonal () {
127
- return _IconResizeDiagonal.IconResizeDiagonal;
128
- },
129
126
  get IconSaluteOutline16 () {
130
127
  return _IconSaluteOutline.IconSaluteOutline16;
131
128
  },
@@ -213,4 +210,3 @@ var _IconEditOutline = require("./Icons/IconEditOutline");
213
210
  var _IconResetOutline = require("./Icons/IconResetOutline");
214
211
  var _IconDoneCircleOutline = require("./Icons/IconDoneCircleOutline");
215
212
  var _IconTrash = require("./Icons/IconTrash");
216
- var _IconResizeDiagonal = require("./Icons/IconResizeDiagonal");
@@ -66,7 +66,7 @@ import { classes, tokens } from "./Modal.tokens";
66
66
  import { useModal } from "./hooks";
67
67
  import { base as viewCSS } from "./variations/_view/base";
68
68
  import { getIdLastModal } from "./ModalContext";
69
- import { CloseButton, ModalBody, ModalContent, base } from "./Modal.styles";
69
+ import { CloseButton, ModalBody, ModalContent } from "./Modal.styles";
70
70
  // issue #823
71
71
  var Popup = component(popupConfig);
72
72
  /**
@@ -74,7 +74,7 @@ var Popup = component(popupConfig);
74
74
  * Управляет показом/скрытием, подложкой и анимацией визуальной части модального окна.
75
75
  */ export var modalRoot = function(Root) {
76
76
  return /*#__PURE__*/ forwardRef(function(_param, outerRootRef) {
77
- 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, draggable = _param.draggable, handle = _param.handle, resizable = _param.resizable, rest = _object_without_properties(_param, [
77
+ 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, rest = _object_without_properties(_param, [
78
78
  "id",
79
79
  "withAnimation",
80
80
  "onClose",
@@ -92,16 +92,12 @@ var Popup = component(popupConfig);
92
92
  "opened",
93
93
  "isOpen",
94
94
  "hasBody",
95
- "hasClose",
96
- "draggable",
97
- "handle",
98
- "resizable"
95
+ "hasClose"
99
96
  ]);
100
97
  var innerIsOpen = Boolean(isOpen || opened);
101
98
  var innerHasClose = hasClose === undefined && hasBody || hasClose;
102
99
  var trapRef = useFocusTrap(true, initialFocusRef, focusAfterRef, true);
103
100
  var popupController = usePopupContext();
104
- var isResizableEnabled = Boolean(resizable && !resizable.disabled);
105
101
  var innerRef = useForkRef(trapRef, outerRootRef);
106
102
  var uniqId = safeUseId();
107
103
  var innerId = id || uniqId;
@@ -151,15 +147,10 @@ var Popup = component(popupConfig);
151
147
  zIndex: zIndex,
152
148
  overlay: hasBody ? overlayNode : /*#__PURE__*/ React.createElement(Root, {
153
149
  view: view
154
- }, overlayNode),
155
- draggable: draggable,
156
- handle: handle,
157
- resizable: resizable
150
+ }, overlayNode)
158
151
  }, rest), hasBody ? /*#__PURE__*/ React.createElement(Root, {
159
152
  view: view
160
- }, /*#__PURE__*/ React.createElement(ModalBody, {
161
- isResizableEnabled: isResizableEnabled
162
- }, /*#__PURE__*/ React.createElement(ModalContent, null, innerHasClose && /*#__PURE__*/ React.createElement(CloseButton, {
153
+ }, /*#__PURE__*/ React.createElement(ModalBody, null, /*#__PURE__*/ React.createElement(ModalContent, null, innerHasClose && /*#__PURE__*/ React.createElement(CloseButton, {
163
154
  onClick: onClose,
164
155
  "data-test": "modal-close"
165
156
  }, /*#__PURE__*/ React.createElement(IconClose, {
@@ -172,7 +163,7 @@ export var modalConfig = {
172
163
  name: 'Modal',
173
164
  tag: 'div',
174
165
  layout: modalRoot,
175
- base: base,
166
+ base: '',
176
167
  variations: {
177
168
  view: {
178
169
  css: viewCSS
@@ -1,29 +1,25 @@
1
1
  import styled from "styled-components";
2
- import { css } from "styled-components";
3
2
  import { addFocus } from "../../mixins";
4
3
  import { tokens } from "./Modal.tokens";
5
- export var base = css([
6
- "height:100%;"
7
- ]);
8
4
  export var ModalBody = styled.div.withConfig({
9
5
  displayName: "Modal.styles__ModalBody",
10
- componentId: "sc-aa09e41b-0"
6
+ componentId: "sc-65f5e73a-0"
11
7
  })([
12
- "height:100%;box-sizing:border-box;border-radius:var(",
8
+ "border-radius:var(",
13
9
  ");padding:var(",
14
10
  ");background:var(",
15
11
  ");box-shadow:var(--shadow-down-soft-l);"
16
12
  ], tokens.modalBodyBorderRadius, tokens.modalBodyPadding, tokens.modalBodyBackground);
17
13
  export var ModalContent = styled.div.withConfig({
18
14
  displayName: "Modal.styles__ModalContent",
19
- componentId: "sc-aa09e41b-1"
15
+ componentId: "sc-65f5e73a-1"
20
16
  })([
21
17
  "position:relative;padding:var(",
22
18
  ");"
23
19
  ], tokens.modalContentPadding);
24
20
  export var CloseButton = styled.button.withConfig({
25
21
  displayName: "Modal.styles__CloseButton",
26
- componentId: "sc-aa09e41b-2"
22
+ componentId: "sc-65f5e73a-2"
27
23
  })([
28
24
  "top:0;right:0;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(",
29
25
  ");padding:0;margin:0;outline:none;cursor:pointer;background:transparent;",