intelicoreact 1.0.20 → 1.0.22
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.
|
@@ -271,7 +271,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
271
271
|
};
|
|
272
272
|
|
|
273
273
|
var setListContainerStyles = function setListContainerStyles() {
|
|
274
|
-
var _sw$getBoundingClient;
|
|
274
|
+
var _getComputedStyle$mar, _getComputedStyle, _getComputedStyle$mar2, _sw$getBoundingClient;
|
|
275
275
|
|
|
276
276
|
var lc = getListContainer();
|
|
277
277
|
if (!lc || !isOpen) return false;
|
|
@@ -284,10 +284,11 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
284
284
|
bottom = _dropdownRef$current$.bottom;
|
|
285
285
|
|
|
286
286
|
var sw = lc.getElementsByClassName('dropdown__list')[0];
|
|
287
|
+
var margin = parseInt((_getComputedStyle$mar = (_getComputedStyle = getComputedStyle(sw)) === null || _getComputedStyle === void 0 ? void 0 : (_getComputedStyle$mar2 = _getComputedStyle.marginTop) === null || _getComputedStyle$mar2 === void 0 ? void 0 : _getComputedStyle$mar2.replace('px', '')) !== null && _getComputedStyle$mar !== void 0 ? _getComputedStyle$mar : 0);
|
|
287
288
|
var swHeight = sw === null || sw === void 0 ? void 0 : (_sw$getBoundingClient = sw.getBoundingClientRect()) === null || _sw$getBoundingClient === void 0 ? void 0 : _sw$getBoundingClient.height;
|
|
288
289
|
lc.style.minWidth = "".concat(width, "px");
|
|
289
290
|
lc.style.left = "".concat(left, "px");
|
|
290
|
-
lc.style.top = "".concat(windowHeight - top - height >= swHeight ? top + height : top - swHeight, "px");
|
|
291
|
+
lc.style.top = "".concat(windowHeight - top - height >= swHeight ? top + height : top - swHeight - margin * 2, "px");
|
|
291
292
|
lc.style.maxHeight = "".concat(swHeight, "px");
|
|
292
293
|
};
|
|
293
294
|
|
|
@@ -23,14 +23,13 @@
|
|
|
23
23
|
height: 28px;
|
|
24
24
|
align-items: center;
|
|
25
25
|
cursor: pointer;
|
|
26
|
-
padding-left: 9px;
|
|
27
|
-
padding-right: 16px;
|
|
28
26
|
font-weight: 400;
|
|
29
27
|
display: block;
|
|
30
28
|
position: relative;
|
|
31
29
|
text-align: left;
|
|
32
30
|
|
|
33
31
|
.text {
|
|
32
|
+
padding: 0 16px 0 8px;
|
|
34
33
|
white-space: nowrap;
|
|
35
34
|
overflow: hidden;
|
|
36
35
|
text-overflow: ellipsis;
|
|
@@ -49,7 +48,6 @@
|
|
|
49
48
|
width: 100%;
|
|
50
49
|
background: none;
|
|
51
50
|
border: none;
|
|
52
|
-
padding: 0 15px 0 0;
|
|
53
51
|
height: 16px;
|
|
54
52
|
text-overflow: ellipsis;
|
|
55
53
|
font-weight: 400;
|
|
@@ -103,7 +101,7 @@
|
|
|
103
101
|
width: 100%;
|
|
104
102
|
height: 24px;
|
|
105
103
|
white-space: nowrap;
|
|
106
|
-
overflow
|
|
104
|
+
overflow: hidden;
|
|
107
105
|
|
|
108
106
|
&--modal {
|
|
109
107
|
color: #1f7499;
|
|
@@ -117,15 +117,10 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
117
117
|
onInputHover = _useState10[0],
|
|
118
118
|
setOnInputHover = _useState10[1];
|
|
119
119
|
|
|
120
|
-
var _useState11 = (0, _react.useState)(
|
|
120
|
+
var _useState11 = (0, _react.useState)(value),
|
|
121
121
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
var _useState13 = (0, _react.useState)(value),
|
|
126
|
-
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
127
|
-
prevValue = _useState14[0],
|
|
128
|
-
setPreviousValue = _useState14[1];
|
|
122
|
+
prevValue = _useState12[0],
|
|
123
|
+
setPreviousValue = _useState12[1];
|
|
129
124
|
|
|
130
125
|
var isUseBitDepthPoints = !!onlyNumbers && isPriceInput;
|
|
131
126
|
var isUseErrorsBlink = !isNotBlinkErrors && !mask; // HANDLES
|
|
@@ -261,12 +256,6 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
261
256
|
onKeyUp(e.keyCode, e);
|
|
262
257
|
}
|
|
263
258
|
};
|
|
264
|
-
(0, _react.useLayoutEffect)(function () {
|
|
265
|
-
var inputValue = (0, _fieldValueFormatters.getSafelyValue)(value);
|
|
266
|
-
if (onlyNumbers !== null && onlyNumbers !== void 0 && onlyNumbers.isNoEmptyValues) inputValue = handle.correctMinMax(inputValue, 'min');
|
|
267
|
-
if (isUseBitDepthPoints) inputValue = (0, _fieldValueFormatters.formatToAddBitDepthPoints)(inputValue, onlyNumbers);
|
|
268
|
-
setFormatedValue(inputValue);
|
|
269
|
-
}, [value]);
|
|
270
259
|
(0, _react.useEffect)(function () {
|
|
271
260
|
var _inputRef$current, _inputRef$current$foc;
|
|
272
261
|
|
|
@@ -288,43 +277,28 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
288
277
|
if (inputRef !== null && inputRef !== void 0 && inputRef.current && typeof isFocusDefault === 'boolean') setIsFocused(isFocusDefault);
|
|
289
278
|
setEditing(isFocusDefault);
|
|
290
279
|
}, [inputRef, isFocusDefault]);
|
|
280
|
+
var formatedValue = (0, _fieldValueFormatters.getSafelyValue)(value);
|
|
281
|
+
if (onlyNumbers !== null && onlyNumbers !== void 0 && onlyNumbers.isNoEmptyValues) formatedValue = handle.correctMinMax(formatedValue, 'min');
|
|
282
|
+
if (isUseBitDepthPoints) formatedValue = (0, _fieldValueFormatters.formatToAddBitDepthPoints)(formatedValue, onlyNumbers);
|
|
291
283
|
|
|
292
|
-
var
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
} : {});
|
|
311
|
-
|
|
312
|
-
if (mask) return /*#__PURE__*/_react.default.createElement(_reactInputMask.default, (0, _extends2.default)({}, uniProps, {
|
|
313
|
-
inputRef: inputRef,
|
|
314
|
-
mask: mask
|
|
315
|
-
}));
|
|
316
|
-
return /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
|
|
317
|
-
"data-testid": "input--key-".concat(testId, "--type-").concat(type)
|
|
318
|
-
}, uniProps, {
|
|
319
|
-
ref: inputRef,
|
|
320
|
-
type: isPriceInput ? 'text' : type,
|
|
321
|
-
autoComplete: autocomplete,
|
|
322
|
-
onFocus: function onFocus() {
|
|
323
|
-
if (isUseAutoSelect) inputRef.current.select();
|
|
324
|
-
if (uniProps.onFocus) uniProps.onFocus.apply(uniProps, arguments);
|
|
325
|
-
}
|
|
326
|
-
}));
|
|
327
|
-
};
|
|
284
|
+
var uniProps = _objectSpread(_objectSpread({
|
|
285
|
+
className: (0, _classnames.default)('input', className, {
|
|
286
|
+
'input--with-icon': icon
|
|
287
|
+
}),
|
|
288
|
+
placeholder: placeholder,
|
|
289
|
+
value: formatedValue,
|
|
290
|
+
inputMode: isNumericMobileKeyboard ? 'numeric' : 'text',
|
|
291
|
+
disabled: disabled,
|
|
292
|
+
onChange: handle.change,
|
|
293
|
+
onFocus: handle.focus,
|
|
294
|
+
onBlur: handle.blur,
|
|
295
|
+
onKeyUp: handle.keyUp,
|
|
296
|
+
onKeyDown: handle.keyDown
|
|
297
|
+
}, maskChar ? {
|
|
298
|
+
maskChar: maskChar
|
|
299
|
+
} : {}), formatChars ? {
|
|
300
|
+
formatChars: formatChars
|
|
301
|
+
} : {});
|
|
328
302
|
|
|
329
303
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
330
304
|
className: (0, _classnames.default)("input__wrap", (0, _defineProperty2.default)({}, "input__wrap_focus", isFocused), (0, _defineProperty2.default)({}, "input__wrap_error", error || isToHighlightError), (0, _defineProperty2.default)({}, "input__wrap--disabled", disabled)),
|
|
@@ -334,7 +308,17 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
334
308
|
onMouseLeave: function onMouseLeave() {
|
|
335
309
|
return setOnInputHover(false);
|
|
336
310
|
}
|
|
337
|
-
},
|
|
311
|
+
}, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
|
|
312
|
+
"data-testid": "input--key-".concat(testId, "--type-").concat(type)
|
|
313
|
+
}, uniProps, {
|
|
314
|
+
ref: inputRef,
|
|
315
|
+
type: isPriceInput ? 'text' : type,
|
|
316
|
+
autoComplete: autocomplete,
|
|
317
|
+
onFocus: function onFocus() {
|
|
318
|
+
if (isUseAutoSelect) inputRef.current.select();
|
|
319
|
+
if (uniProps.onFocus) uniProps.onFocus.apply(uniProps, arguments);
|
|
320
|
+
}
|
|
321
|
+
})), icon, action, withDelete && onInputHover && /*#__PURE__*/_react.default.createElement("span", {
|
|
338
322
|
"data-testid": "icon-close",
|
|
339
323
|
className: (0, _classnames.default)("input__close", {
|
|
340
324
|
hidden: !(0, _fieldValueFormatters.getSafelyValue)(value)
|