intelicoreact 0.3.75 → 1.0.1
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.
- package/dist/Atomic/FormElements/InputMask/InputMask.js +47 -53
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +21 -19
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +42 -36
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +0 -4
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -7
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1 -1
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +1 -1
- package/dist/Atomic/UI/Accordion/AccordionItem.js +1 -1
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +1 -1
- package/dist/Atomic/UI/Modal/Modal.js +1 -2
- package/dist/Atomic/UI/NavLine/NavLine.js +12 -13
- package/dist/Atomic/UI/TagList/TagList.js +6 -6
- package/dist/Functions/useFormTools/index.js +60 -58
- package/package.json +2 -2
|
@@ -219,8 +219,7 @@ function InputMask() {
|
|
|
219
219
|
};
|
|
220
220
|
|
|
221
221
|
(0, _react.useEffect)(function () {
|
|
222
|
-
if (
|
|
223
|
-
serviceWatchersWorker();
|
|
222
|
+
if (serviceWatchers.length) serviceWatchersWorker();
|
|
224
223
|
}, [serviceWatchers]); // SERVICE WATCHERS MANAGEMENT FUNCTIONS | END //
|
|
225
224
|
// INNER VALUE MANAGEMENT FUNCTIONS | START //
|
|
226
225
|
|
|
@@ -1239,74 +1238,69 @@ function InputMask() {
|
|
|
1239
1238
|
if (value !== getClearInnerValueAsString()) setIsInitValue(false);
|
|
1240
1239
|
}, [value]);
|
|
1241
1240
|
(0, _react.useEffect)(function () {
|
|
1242
|
-
if (
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1241
|
+
if (isMaskRendered && !isInitValue && value !== getClearInnerValueAsString()) {
|
|
1242
|
+
if (value && value !== '') {
|
|
1243
|
+
var valueCharIndex = 0;
|
|
1244
|
+
innerValue.map(function (_ref25, i) {
|
|
1245
|
+
var _maskPattern;
|
|
1246
|
+
|
|
1247
|
+
var isSpecialSymbol = _ref25.isSpecialSymbol;
|
|
1248
|
+
if (isSpecialSymbol) return false;
|
|
1249
|
+
var char = value[valueCharIndex];
|
|
1250
|
+
var whileLimit = ((_maskPattern = maskPattern) === null || _maskPattern === void 0 ? void 0 : _maskPattern.length) || 0;
|
|
1251
|
+
|
|
1252
|
+
while (whileLimit && isSpecialSymbolChar({
|
|
1253
|
+
char: value[valueCharIndex]
|
|
1254
|
+
})) {
|
|
1255
|
+
whileLimit--;
|
|
1256
|
+
char = value[++valueCharIndex];
|
|
1257
|
+
} //If Valid
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
if (isValidChar({
|
|
1261
|
+
char: char,
|
|
1262
|
+
i: i,
|
|
1263
|
+
disableErrors: true
|
|
1264
|
+
})) {
|
|
1265
|
+
updateInnerValueChar({
|
|
1266
|
+
char: char
|
|
1267
|
+
}, i);
|
|
1268
|
+
}
|
|
1261
1269
|
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
disableErrors: true
|
|
1266
|
-
})) {
|
|
1267
|
-
updateInnerValueChar({
|
|
1268
|
-
char: char
|
|
1269
|
-
}, i);
|
|
1270
|
-
}
|
|
1270
|
+
++valueCharIndex;
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1271
1273
|
|
|
1272
|
-
|
|
1273
|
-
});
|
|
1274
|
+
setIsInitValue(true);
|
|
1274
1275
|
}
|
|
1275
|
-
|
|
1276
|
-
setIsInitValue(true);
|
|
1277
1276
|
}, [isMaskRendered, value, isInitValue]);
|
|
1278
1277
|
(0, _react.useEffect)(function () {
|
|
1279
|
-
if (
|
|
1280
|
-
setUndoValue(getClearInnerValueAsString());
|
|
1278
|
+
if (isInitValue) setUndoValue(getClearInnerValueAsString());
|
|
1281
1279
|
}, [isInitValue]); // Focus Observer
|
|
1282
1280
|
|
|
1283
1281
|
(0, _react.useEffect)(function () {
|
|
1284
|
-
if (!isFocused)
|
|
1285
|
-
setSelectedText('');
|
|
1286
|
-
}
|
|
1282
|
+
if (!isFocused) setSelectedText('');
|
|
1287
1283
|
}, [isFocused]); // Default Focused
|
|
1288
1284
|
|
|
1289
1285
|
(0, _react.useEffect)(function () {
|
|
1290
|
-
if (isFocusedDefault && isMaskRendered)
|
|
1291
|
-
setFocusOnChar(0, -1);
|
|
1292
|
-
}
|
|
1286
|
+
if (isFocusedDefault && isMaskRendered) setFocusOnChar(0, -1);
|
|
1293
1287
|
}, [isFocusedDefault, isMaskRendered]); // OnChange Observer
|
|
1294
1288
|
|
|
1295
1289
|
(0, _react.useEffect)(function () {
|
|
1296
|
-
if (
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1290
|
+
if (isMaskRendered && isFocused) {
|
|
1291
|
+
setError(false);
|
|
1292
|
+
clearErrorMessage();
|
|
1293
|
+
var values = [getClearInnerValueAsString(), getInnerValueAsString({
|
|
1294
|
+
replaceSpace: true
|
|
1295
|
+
})];
|
|
1296
|
+
if (returnMaskedValue) values.reverse();
|
|
1297
|
+
onChangeProp.apply(void 0, values);
|
|
1298
|
+
}
|
|
1304
1299
|
}, [innerValue, isMaskRendered]); // Blink Error
|
|
1305
1300
|
|
|
1306
1301
|
(0, _react.useEffect)(function () {
|
|
1307
|
-
if (
|
|
1308
|
-
|
|
1309
|
-
setBlinkError(false);
|
|
1302
|
+
if (blinkError) setTimeout(function () {
|
|
1303
|
+
return setBlinkError(false);
|
|
1310
1304
|
}, blinkDuration);
|
|
1311
1305
|
}, [blinkError]);
|
|
1312
1306
|
(0, _react.useEffect)(function () {
|
|
@@ -540,11 +540,12 @@ function InputMask2() {
|
|
|
540
540
|
|
|
541
541
|
|
|
542
542
|
(0, _react.useEffect)(function () {
|
|
543
|
-
if (cursor
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
543
|
+
if (cursor !== null) {
|
|
544
|
+
var input = inputRef.current;
|
|
545
|
+
if (input) input.setSelectionRange(cursor, cursor);
|
|
546
|
+
setPrevCursor(cursor);
|
|
547
|
+
setCursor(null);
|
|
548
|
+
}
|
|
548
549
|
}, [inputRef, cursor, inputValue]); //Render Mask
|
|
549
550
|
|
|
550
551
|
(0, _react.useEffect)(function () {
|
|
@@ -570,9 +571,10 @@ function InputMask2() {
|
|
|
570
571
|
if (value !== getInputValue()) setIsInitValue(false);
|
|
571
572
|
}, [value]);
|
|
572
573
|
(0, _react.useEffect)(function () {
|
|
573
|
-
if (
|
|
574
|
-
|
|
575
|
-
|
|
574
|
+
if (isMaskRendered && !isInitValue && !(value === getInputValue() && value !== "")) {
|
|
575
|
+
if (value && value !== '') setValue(value);
|
|
576
|
+
setIsInitValue(true);
|
|
577
|
+
}
|
|
576
578
|
}, [isMaskRendered, value, isInitValue]); // Default Focused
|
|
577
579
|
|
|
578
580
|
(0, _react.useEffect)(function () {
|
|
@@ -582,23 +584,23 @@ function InputMask2() {
|
|
|
582
584
|
}, [isFocusedDefault, isMaskRendered]); // OnChange Observer
|
|
583
585
|
|
|
584
586
|
(0, _react.useEffect)(function () {
|
|
585
|
-
|
|
587
|
+
if (isMaskRendered && isInitValue) {
|
|
588
|
+
var _prevValueRef$current, _prevValueRef$current2;
|
|
586
589
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
if (returnMaskedValue) values.reverse();
|
|
590
|
+
setError(false);
|
|
591
|
+
var values = [getClearInnerValueAsString(), getInputValue()];
|
|
592
|
+
if (returnMaskedValue) values.reverse();
|
|
591
593
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
594
|
+
if ((prevValueRef === null || prevValueRef === void 0 ? void 0 : (_prevValueRef$current = prevValueRef.current) === null || _prevValueRef$current === void 0 ? void 0 : _prevValueRef$current[0]) !== values[0] && (prevValueRef === null || prevValueRef === void 0 ? void 0 : (_prevValueRef$current2 = prevValueRef.current) === null || _prevValueRef$current2 === void 0 ? void 0 : _prevValueRef$current2[1]) !== values[1] && value !== values[0] && value !== values[1]) {
|
|
595
|
+
prevValueRef.current = values;
|
|
596
|
+
onChangeProp.apply(void 0, values);
|
|
597
|
+
}
|
|
595
598
|
}
|
|
596
599
|
}, [innerValue, isMaskRendered, isInitValue]); // Blink Error
|
|
597
600
|
|
|
598
601
|
(0, _react.useEffect)(function () {
|
|
599
|
-
if (
|
|
600
|
-
|
|
601
|
-
setBlinkError(false);
|
|
602
|
+
if (blinkError) setTimeout(function () {
|
|
603
|
+
return setBlinkError(false);
|
|
602
604
|
}, blinkDuration);
|
|
603
605
|
}, [blinkError]);
|
|
604
606
|
(0, _react.useEffect)(function () {
|
|
@@ -317,19 +317,21 @@ var MobileCalendar = function MobileCalendar(_ref) {
|
|
|
317
317
|
}, [date]); //monthList Events
|
|
318
318
|
|
|
319
319
|
(0, _react.useEffect)(function () {
|
|
320
|
-
|
|
320
|
+
if (monthsListRef !== null && monthsListRef !== void 0 && monthsListRef.current) {
|
|
321
|
+
var _monthsListRef$curren, _monthsListRef$curren2;
|
|
322
|
+
|
|
323
|
+
monthsListRef === null || monthsListRef === void 0 ? void 0 : (_monthsListRef$curren = monthsListRef.current) === null || _monthsListRef$curren === void 0 ? void 0 : _monthsListRef$curren.addEventListener("mousewheel", function (e) {
|
|
324
|
+
return onWheel(e, "months");
|
|
325
|
+
}, {
|
|
326
|
+
passive: false
|
|
327
|
+
});
|
|
328
|
+
monthsListRef === null || monthsListRef === void 0 ? void 0 : (_monthsListRef$curren2 = monthsListRef.current) === null || _monthsListRef$curren2 === void 0 ? void 0 : _monthsListRef$curren2.addEventListener("touchstart", function (e) {
|
|
329
|
+
return onTouchStart(e, "months");
|
|
330
|
+
}, {
|
|
331
|
+
passive: false
|
|
332
|
+
});
|
|
333
|
+
}
|
|
321
334
|
|
|
322
|
-
if (!(monthsListRef !== null && monthsListRef !== void 0 && monthsListRef.current)) return;
|
|
323
|
-
monthsListRef === null || monthsListRef === void 0 ? void 0 : (_monthsListRef$curren = monthsListRef.current) === null || _monthsListRef$curren === void 0 ? void 0 : _monthsListRef$curren.addEventListener("mousewheel", function (e) {
|
|
324
|
-
return onWheel(e, "months");
|
|
325
|
-
}, {
|
|
326
|
-
passive: false
|
|
327
|
-
});
|
|
328
|
-
monthsListRef === null || monthsListRef === void 0 ? void 0 : (_monthsListRef$curren2 = monthsListRef.current) === null || _monthsListRef$curren2 === void 0 ? void 0 : _monthsListRef$curren2.addEventListener("touchstart", function (e) {
|
|
329
|
-
return onTouchStart(e, "months");
|
|
330
|
-
}, {
|
|
331
|
-
passive: false
|
|
332
|
-
});
|
|
333
335
|
return function () {
|
|
334
336
|
var _monthsListRef$curren3, _monthsListRef$curren4;
|
|
335
337
|
|
|
@@ -339,19 +341,21 @@ var MobileCalendar = function MobileCalendar(_ref) {
|
|
|
339
341
|
}, [monthsListRef]); //daysList Events
|
|
340
342
|
|
|
341
343
|
(0, _react.useEffect)(function () {
|
|
342
|
-
|
|
344
|
+
if (daysListRef !== null && daysListRef !== void 0 && daysListRef.current) {
|
|
345
|
+
var _daysListRef$current, _daysListRef$current2;
|
|
346
|
+
|
|
347
|
+
daysListRef === null || daysListRef === void 0 ? void 0 : (_daysListRef$current = daysListRef.current) === null || _daysListRef$current === void 0 ? void 0 : _daysListRef$current.addEventListener("mousewheel", function (e) {
|
|
348
|
+
return onWheel(e, "days");
|
|
349
|
+
}, {
|
|
350
|
+
passive: false
|
|
351
|
+
});
|
|
352
|
+
daysListRef === null || daysListRef === void 0 ? void 0 : (_daysListRef$current2 = daysListRef.current) === null || _daysListRef$current2 === void 0 ? void 0 : _daysListRef$current2.addEventListener("touchstart", function (e) {
|
|
353
|
+
return onTouchStart(e, "days");
|
|
354
|
+
}, {
|
|
355
|
+
passive: false
|
|
356
|
+
});
|
|
357
|
+
}
|
|
343
358
|
|
|
344
|
-
if (!(daysListRef !== null && daysListRef !== void 0 && daysListRef.current)) return;
|
|
345
|
-
daysListRef === null || daysListRef === void 0 ? void 0 : (_daysListRef$current = daysListRef.current) === null || _daysListRef$current === void 0 ? void 0 : _daysListRef$current.addEventListener("mousewheel", function (e) {
|
|
346
|
-
return onWheel(e, "days");
|
|
347
|
-
}, {
|
|
348
|
-
passive: false
|
|
349
|
-
});
|
|
350
|
-
daysListRef === null || daysListRef === void 0 ? void 0 : (_daysListRef$current2 = daysListRef.current) === null || _daysListRef$current2 === void 0 ? void 0 : _daysListRef$current2.addEventListener("touchstart", function (e) {
|
|
351
|
-
return onTouchStart(e, "days");
|
|
352
|
-
}, {
|
|
353
|
-
passive: false
|
|
354
|
-
});
|
|
355
359
|
return function () {
|
|
356
360
|
var _daysListRef$current3, _daysListRef$current4;
|
|
357
361
|
|
|
@@ -361,19 +365,21 @@ var MobileCalendar = function MobileCalendar(_ref) {
|
|
|
361
365
|
}, [daysListRef]); //yearsList Events
|
|
362
366
|
|
|
363
367
|
(0, _react.useEffect)(function () {
|
|
364
|
-
|
|
368
|
+
if (yearsListRef !== null && yearsListRef !== void 0 && yearsListRef.current) {
|
|
369
|
+
var _yearsListRef$current, _yearsListRef$current2;
|
|
370
|
+
|
|
371
|
+
yearsListRef === null || yearsListRef === void 0 ? void 0 : (_yearsListRef$current = yearsListRef.current) === null || _yearsListRef$current === void 0 ? void 0 : _yearsListRef$current.addEventListener("mousewheel", function (e) {
|
|
372
|
+
return onWheel(e, "years");
|
|
373
|
+
}, {
|
|
374
|
+
passive: false
|
|
375
|
+
});
|
|
376
|
+
yearsListRef === null || yearsListRef === void 0 ? void 0 : (_yearsListRef$current2 = yearsListRef.current) === null || _yearsListRef$current2 === void 0 ? void 0 : _yearsListRef$current2.addEventListener("touchstart", function (e) {
|
|
377
|
+
return onTouchStart(e, "years");
|
|
378
|
+
}, {
|
|
379
|
+
passive: false
|
|
380
|
+
});
|
|
381
|
+
}
|
|
365
382
|
|
|
366
|
-
if (!(yearsListRef !== null && yearsListRef !== void 0 && yearsListRef.current)) return;
|
|
367
|
-
yearsListRef === null || yearsListRef === void 0 ? void 0 : (_yearsListRef$current = yearsListRef.current) === null || _yearsListRef$current === void 0 ? void 0 : _yearsListRef$current.addEventListener("mousewheel", function (e) {
|
|
368
|
-
return onWheel(e, "years");
|
|
369
|
-
}, {
|
|
370
|
-
passive: false
|
|
371
|
-
});
|
|
372
|
-
yearsListRef === null || yearsListRef === void 0 ? void 0 : (_yearsListRef$current2 = yearsListRef.current) === null || _yearsListRef$current2 === void 0 ? void 0 : _yearsListRef$current2.addEventListener("touchstart", function (e) {
|
|
373
|
-
return onTouchStart(e, "years");
|
|
374
|
-
}, {
|
|
375
|
-
passive: false
|
|
376
|
-
});
|
|
377
383
|
return function () {
|
|
378
384
|
var _yearsListRef$current3, _yearsListRef$current4;
|
|
379
385
|
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = void 0;
|
|
11
9
|
|
|
12
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
11
|
|
|
14
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
13
|
|
|
@@ -17,10 +15,6 @@ var _Switcher = _interopRequireDefault(require("../Switcher/Switcher"));
|
|
|
17
15
|
|
|
18
16
|
require("./SwitchableRow.scss");
|
|
19
17
|
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
24
18
|
var RC_default = 'switchable-row';
|
|
25
19
|
|
|
26
20
|
var SwitchableRow = function SwitchableRow(props) {
|
|
@@ -280,7 +280,7 @@ var TagsDropdown = function TagsDropdown(_ref) {
|
|
|
280
280
|
}, [getListContainer]);
|
|
281
281
|
(0, _react.useEffect)(function () {
|
|
282
282
|
setListContainerStyles();
|
|
283
|
-
}, [isOpen
|
|
283
|
+
}, [isOpen]);
|
|
284
284
|
(0, _react.useEffect)(function () {
|
|
285
285
|
document.addEventListener('click', handleClickOutside, true);
|
|
286
286
|
return function () {
|
|
@@ -167,7 +167,7 @@ var UserContacts = function UserContacts(props) {
|
|
|
167
167
|
(0, _react.useEffect)(function () {
|
|
168
168
|
setIsRunTask({});
|
|
169
169
|
return function () {
|
|
170
|
-
setIconMode(false);
|
|
170
|
+
return setIconMode(false);
|
|
171
171
|
};
|
|
172
172
|
}, [email, phone, JSON.stringify(mainContactsStructure), +maxWidth, mainRef === null || mainRef === void 0 ? void 0 : (_mainRef$current = mainRef.current) === null || _mainRef$current === void 0 ? void 0 : _mainRef$current.clientWidth]);
|
|
173
173
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -55,7 +55,7 @@ var AccordionItem = function AccordionItem(_ref) {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
(0, _react.useEffect)(function () {
|
|
58
|
-
setMaxHeight(isOpen ? getItemsHeight() : 0);
|
|
58
|
+
return setMaxHeight(isOpen ? getItemsHeight() : 0);
|
|
59
59
|
}, [isOpen]); // https://i.imgur.com/TaScp0h.png
|
|
60
60
|
|
|
61
61
|
var calculateStatusCount = function calculateStatusCount() {
|
|
@@ -149,7 +149,7 @@ var AccordionTable = function AccordionTable(_ref) {
|
|
|
149
149
|
};
|
|
150
150
|
|
|
151
151
|
(0, _react.useEffect)(function () {
|
|
152
|
-
setAccordions(items);
|
|
152
|
+
return setAccordions(items);
|
|
153
153
|
}, [items]);
|
|
154
154
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
155
155
|
className: (0, _classnames.default)('accordion-table', className)
|
|
@@ -83,8 +83,7 @@ var Modal = function Modal(_ref) {
|
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
(0, _react.useEffect)(function () {
|
|
86
|
-
if (
|
|
87
|
-
document.addEventListener('keydown', handle.pressKey);
|
|
86
|
+
if (submitOnEnter) document.addEventListener('keydown', handle.pressKey);
|
|
88
87
|
return function () {
|
|
89
88
|
return document.removeEventListener('keydown', handle.pressKey);
|
|
90
89
|
};
|
|
@@ -110,21 +110,21 @@ var NavLine = function NavLine(_ref) {
|
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
(0, _react.useEffect)(function () {
|
|
113
|
-
if (!scrollQueue.length) return false;
|
|
114
113
|
var task = popScrollTask();
|
|
115
|
-
if (!task) return false;
|
|
116
114
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
if (scrollQueue.length && task) {
|
|
116
|
+
switch (task) {
|
|
117
|
+
case 'next':
|
|
118
|
+
scrollToNextItem();
|
|
119
|
+
break;
|
|
121
120
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
case 'prev':
|
|
122
|
+
scrollToPrevItem();
|
|
123
|
+
break;
|
|
125
124
|
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
default:
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
128
|
}
|
|
129
129
|
}, [scrollQueue]);
|
|
130
130
|
|
|
@@ -231,8 +231,7 @@ var NavLine = function NavLine(_ref) {
|
|
|
231
231
|
(0, _react.useEffect)(function () {
|
|
232
232
|
var _wrapperRef$current;
|
|
233
233
|
|
|
234
|
-
if (
|
|
235
|
-
wrapperRef === null || wrapperRef === void 0 ? void 0 : (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.addEventListener("mousewheel", onWheel, {
|
|
234
|
+
if (wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current) wrapperRef === null || wrapperRef === void 0 ? void 0 : (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.addEventListener("mousewheel", onWheel, {
|
|
236
235
|
passive: false
|
|
237
236
|
});
|
|
238
237
|
}, [wrapperRef]); // Count Total NavLine Items Width
|
|
@@ -159,14 +159,14 @@ var TagList = function TagList(_ref) {
|
|
|
159
159
|
}, [items]); // Count Row Tags
|
|
160
160
|
|
|
161
161
|
(0, _react.useLayoutEffect)(function () {
|
|
162
|
-
if (
|
|
162
|
+
if (withToggle) {
|
|
163
|
+
if (!isTagsRefSet()) {
|
|
164
|
+
setLastCheckTime(Date.now());
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
163
167
|
|
|
164
|
-
|
|
165
|
-
setLastCheckTime(Date.now());
|
|
166
|
-
return;
|
|
168
|
+
setStaticTagsCount(getStaticTagsCount());
|
|
167
169
|
}
|
|
168
|
-
|
|
169
|
-
setStaticTagsCount(getStaticTagsCount());
|
|
170
170
|
}, [tagList, wrapperWidth, lastCheckTime]); //
|
|
171
171
|
|
|
172
172
|
(0, _react.useLayoutEffect)(function () {
|
|
@@ -339,58 +339,59 @@ function useFormTools() {
|
|
|
339
339
|
(0, _react.useEffect)(function () {
|
|
340
340
|
if (isFormFieldsAdded) resetIsFormRendered(false); //Add Form Fields
|
|
341
341
|
|
|
342
|
-
if (renderFormFields.length
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
var fieldData = getFieldData(key);
|
|
348
|
-
var field = !getFormField(key) ? fieldData : getFormField(key);
|
|
349
|
-
|
|
350
|
-
if (!(field !== null && field !== void 0 && field.className) || (field === null || field === void 0 ? void 0 : (_field$className = field.className) === null || _field$className === void 0 ? void 0 : _field$className.indexOf(getFieldClassName(key, FormType))) === -1) {
|
|
351
|
-
field.className = "".concat(field === null || field === void 0 ? void 0 : field.className, " ").concat(getFieldClassName(key, FormType));
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
if ((0, _typeof2.default)(fieldData === null || fieldData === void 0 ? void 0 : fieldData.label) === 'object') {
|
|
355
|
-
field.label = fieldData.label[FormType] || fieldData.label.default;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
field.ref = /*#__PURE__*/(0, _react.createRef)();
|
|
359
|
-
field.wrapperRef = /*#__PURE__*/(0, _react.createRef)();
|
|
360
|
-
field.isValueChangedByUser = false;
|
|
361
|
-
|
|
362
|
-
if (goToNextFieldOnEnterPressed) {
|
|
363
|
-
var onKeyDownProp = field.onKeyDown || function () {};
|
|
364
|
-
|
|
365
|
-
field.onKeyDown = function () {
|
|
366
|
-
onKeyDown.apply(void 0, arguments);
|
|
367
|
-
onKeyDownProp.apply(void 0, arguments);
|
|
368
|
-
};
|
|
369
|
-
} //Is Field Value Changed By USER
|
|
370
|
-
// eslint-disable-next-line no-use-before-define
|
|
371
|
-
|
|
342
|
+
if (renderFormFields.length !== 0) {
|
|
343
|
+
setFormFields(function (fields) {
|
|
344
|
+
return renderFormFields.reduce(function (result, key) {
|
|
345
|
+
var _field$className;
|
|
372
346
|
|
|
373
|
-
|
|
374
|
-
var
|
|
347
|
+
var fieldData = getFieldData(key);
|
|
348
|
+
var field = !getFormField(key) ? fieldData : getFormField(key);
|
|
375
349
|
|
|
376
|
-
|
|
350
|
+
if (!(field !== null && field !== void 0 && field.className) || (field === null || field === void 0 ? void 0 : (_field$className = field.className) === null || _field$className === void 0 ? void 0 : _field$className.indexOf(getFieldClassName(key, FormType))) === -1) {
|
|
351
|
+
field.className = "".concat(field === null || field === void 0 ? void 0 : field.className, " ").concat(getFieldClassName(key, FormType));
|
|
352
|
+
}
|
|
377
353
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}, key);
|
|
382
|
-
};
|
|
354
|
+
if ((0, _typeof2.default)(fieldData === null || fieldData === void 0 ? void 0 : fieldData.label) === 'object') {
|
|
355
|
+
field.label = fieldData.label[FormType] || fieldData.label.default;
|
|
356
|
+
}
|
|
383
357
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
358
|
+
field.ref = /*#__PURE__*/(0, _react.createRef)();
|
|
359
|
+
field.wrapperRef = /*#__PURE__*/(0, _react.createRef)();
|
|
360
|
+
field.isValueChangedByUser = false;
|
|
361
|
+
|
|
362
|
+
if (goToNextFieldOnEnterPressed) {
|
|
363
|
+
var onKeyDownProp = field.onKeyDown || function () {};
|
|
364
|
+
|
|
365
|
+
field.onKeyDown = function () {
|
|
366
|
+
onKeyDown.apply(void 0, arguments);
|
|
367
|
+
onKeyDownProp.apply(void 0, arguments);
|
|
368
|
+
};
|
|
369
|
+
} //Is Field Value Changed By USER
|
|
370
|
+
// eslint-disable-next-line no-use-before-define
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
addOnFieldRenderedObserver(key, function () {
|
|
374
|
+
var _getFormField2, _getFormField2$ref, _getFormField2$ref$cu;
|
|
375
|
+
|
|
376
|
+
var element = (_getFormField2 = getFormField(key)) === null || _getFormField2 === void 0 ? void 0 : (_getFormField2$ref = _getFormField2.ref) === null || _getFormField2$ref === void 0 ? void 0 : (_getFormField2$ref$cu = _getFormField2$ref.current) === null || _getFormField2$ref$cu === void 0 ? void 0 : _getFormField2$ref$cu.querySelector((field === null || field === void 0 ? void 0 : field.focusSelector) || 'input');
|
|
377
|
+
|
|
378
|
+
var handler = function handler() {
|
|
379
|
+
return _setFormField({
|
|
380
|
+
isValueChangedByUser: true
|
|
381
|
+
}, key);
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
element === null || element === void 0 ? void 0 : element.addEventListener('paste', handler, {
|
|
385
|
+
once: true
|
|
386
|
+
});
|
|
387
|
+
element === null || element === void 0 ? void 0 : element.addEventListener('keypress', handler, {
|
|
388
|
+
once: true
|
|
389
|
+
});
|
|
390
|
+
}, true);
|
|
391
|
+
return updateFormField(result, field, key);
|
|
392
|
+
}, fields);
|
|
393
|
+
});
|
|
394
|
+
}
|
|
394
395
|
}, [renderFormFields]);
|
|
395
396
|
|
|
396
397
|
var _useState11 = (0, _react.useState)([]),
|
|
@@ -450,16 +451,17 @@ function useFormTools() {
|
|
|
450
451
|
|
|
451
452
|
|
|
452
453
|
(0, _react.useEffect)(function () {
|
|
453
|
-
if (isFormRendered
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
454
|
+
if (!isFormRendered && onFormRenderObservers.length) {
|
|
455
|
+
var formFieldsKeys = getFormFieldsKeys(form);
|
|
456
|
+
var isAllFieldsRendered = renderFormFields.reduce(function (result, key) {
|
|
457
|
+
if (!formFieldsKeys.includes(key)) result = false;
|
|
458
|
+
return result;
|
|
459
|
+
}, true);
|
|
460
|
+
|
|
461
|
+
if (isAllFieldsRendered) {
|
|
462
|
+
submitIsFormRendered(true);
|
|
463
|
+
onFormRenderWorker();
|
|
464
|
+
}
|
|
463
465
|
}
|
|
464
466
|
}, [form, renderFormFields, onFormRenderObservers]); //--- Render Fields Controller ---//--- END ---//
|
|
465
467
|
///////////////////////////////////////////////////////////////
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intelicoreact",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"moment": "^2.29.1",
|
|
24
24
|
"moment-timezone": "^0.5.34",
|
|
25
25
|
"node-fetch": "^3.2.6",
|
|
26
|
-
"react": "^
|
|
26
|
+
"react": "^18.2.0",
|
|
27
27
|
"react-chartjs-2": "^4.1.0",
|
|
28
28
|
"react-feather": "^2.0.9",
|
|
29
29
|
"react-input-mask": "^2.0.4"
|