intelicoreact 1.4.3 → 1.4.5
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.
|
@@ -107,7 +107,6 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
107
107
|
name,
|
|
108
108
|
fieldKey,
|
|
109
109
|
id,
|
|
110
|
-
key,
|
|
111
110
|
attributesOfNativeInput = {}
|
|
112
111
|
} = _ref;
|
|
113
112
|
const {
|
|
@@ -136,7 +135,7 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
136
135
|
});
|
|
137
136
|
const isUseBitDepthPoints = Boolean(onlyNumbers) && isPriceInput;
|
|
138
137
|
const isUseErrorsBlink = !isNotBlinkErrors && !mask;
|
|
139
|
-
const inputName = name || fieldKey || id
|
|
138
|
+
const inputName = name || fieldKey || id;
|
|
140
139
|
const isPseudoPasswordMode = type === "pseudoPassword"; // HANDLES
|
|
141
140
|
|
|
142
141
|
const handle = {
|
|
@@ -29,6 +29,25 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
29
|
|
|
30
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
31
|
|
|
32
|
+
let timer;
|
|
33
|
+
const DEBOUNCE_TIME = 300;
|
|
34
|
+
|
|
35
|
+
function debounce(func) {
|
|
36
|
+
var _this = this;
|
|
37
|
+
|
|
38
|
+
let timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEBOUNCE_TIME;
|
|
39
|
+
return function () {
|
|
40
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41
|
+
args[_key] = arguments[_key];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
clearTimeout(timer);
|
|
45
|
+
timer = setTimeout(() => {
|
|
46
|
+
func.apply(_this, args);
|
|
47
|
+
}, timeout);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
32
51
|
function RangeSlider(_ref) {
|
|
33
52
|
var _value$from, _value$to;
|
|
34
53
|
|
|
@@ -140,6 +159,18 @@ function RangeSlider(_ref) {
|
|
|
140
159
|
}
|
|
141
160
|
|
|
142
161
|
validate ? setFrom(value) : setFromValue(value);
|
|
162
|
+
|
|
163
|
+
if (!isTriggerMoved) {
|
|
164
|
+
debounce(() => {
|
|
165
|
+
const values = {
|
|
166
|
+
from: prepareValue(value),
|
|
167
|
+
to
|
|
168
|
+
};
|
|
169
|
+
onChange(values);
|
|
170
|
+
setFrezeedValues(values);
|
|
171
|
+
}, DEBOUNCE_TIME)();
|
|
172
|
+
}
|
|
173
|
+
|
|
143
174
|
break;
|
|
144
175
|
|
|
145
176
|
case "to":
|
|
@@ -154,6 +185,18 @@ function RangeSlider(_ref) {
|
|
|
154
185
|
}
|
|
155
186
|
|
|
156
187
|
validate ? setTo(value) : setToValue(value);
|
|
188
|
+
|
|
189
|
+
if (!isTriggerMoved) {
|
|
190
|
+
debounce(() => {
|
|
191
|
+
const values = {
|
|
192
|
+
from,
|
|
193
|
+
to: prepareValue(value)
|
|
194
|
+
};
|
|
195
|
+
onChange(values);
|
|
196
|
+
setFrezeedValues(values);
|
|
197
|
+
}, DEBOUNCE_TIME)();
|
|
198
|
+
}
|
|
199
|
+
|
|
157
200
|
break;
|
|
158
201
|
}
|
|
159
202
|
}; // MouseDown Event Controller
|
|
@@ -200,7 +243,6 @@ function RangeSlider(_ref) {
|
|
|
200
243
|
|
|
201
244
|
const onRangeInputBlur = (e, type) => {
|
|
202
245
|
setIsInputFocused(type, false);
|
|
203
|
-
onRangeChange(type, type === "from" ? from : to);
|
|
204
246
|
};
|
|
205
247
|
|
|
206
248
|
(0, _react.useEffect)(() => {
|
|
@@ -241,15 +283,18 @@ function RangeSlider(_ref) {
|
|
|
241
283
|
setFrezeedValues(null);
|
|
242
284
|
}, [isTriggerMoved]);
|
|
243
285
|
(0, _react.useEffect)(() => {
|
|
244
|
-
if (Object.values(isInputsFocused).every(v => !v) && !isTriggerMoved)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
286
|
+
if (Object.values(isInputsFocused).every(v => !v) && !isTriggerMoved) {
|
|
287
|
+
onChange({
|
|
288
|
+
from,
|
|
289
|
+
to
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
248
293
|
if (isTriggerMoved) setFrezeedValues({
|
|
249
294
|
from,
|
|
250
295
|
to
|
|
251
296
|
});
|
|
252
|
-
}, [from, to,
|
|
297
|
+
}, [from, to, isTriggerMoved]);
|
|
253
298
|
(0, _react.useLayoutEffect)(() => {
|
|
254
299
|
setFrom(value.from);
|
|
255
300
|
setTo(value.to);
|
|
@@ -39,7 +39,10 @@ const Textarea = _ref => {
|
|
|
39
39
|
change: val => {
|
|
40
40
|
let inputValue = val;
|
|
41
41
|
if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
|
|
42
|
-
|
|
42
|
+
|
|
43
|
+
if (inputValue !== val) {
|
|
44
|
+
onChange(inputValue);
|
|
45
|
+
}
|
|
43
46
|
}
|
|
44
47
|
};
|
|
45
48
|
|
|
@@ -28,7 +28,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
28
28
|
const time = (Date.now() * Math.random() / 1000).toString().replace(/\./g, "_");
|
|
29
29
|
|
|
30
30
|
const Hint = _ref => {
|
|
31
|
-
var _ref2;
|
|
31
|
+
var _ref2, _label$replace;
|
|
32
32
|
|
|
33
33
|
let {
|
|
34
34
|
hint,
|
|
@@ -121,7 +121,7 @@ const Hint = _ref => {
|
|
|
121
121
|
ref: hintRef
|
|
122
122
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
123
123
|
tabIndex: isAccessability ? 0 : -1,
|
|
124
|
-
"data-testid": typeof label === "string" && label.length ? label.replace(/\s/g, "-") : testId,
|
|
124
|
+
"data-testid": typeof label === "string" && label.length ? (_label$replace = label.replace) === null || _label$replace === void 0 ? void 0 : _label$replace.call(label, /\s/g, "-") : testId,
|
|
125
125
|
"aria-label": isAccessability && label || "",
|
|
126
126
|
onClick: () => handleOpenType === "click" && (isCallbackExist ? onClickCallback() : setIsOpen(!isOpen)),
|
|
127
127
|
onMouseEnter: () => handleOpenType === "hover" && setIsOpen(!isOpen),
|