intelicoreact 1.0.0 → 1.0.2

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.
@@ -311,7 +311,9 @@ var Dropdown = function Dropdown(_ref) {
311
311
  };
312
312
 
313
313
  var closeList = handleClickOutside;
314
- (0, _react.useEffect)(initListContainer, []);
314
+ (0, _react.useEffect)(function () {
315
+ initListContainer();
316
+ }, []);
315
317
  (0, _react.useLayoutEffect)(function () {
316
318
  window.addEventListener('resize', setListContainerStyles);
317
319
  window.addEventListener('mousewheel', closeList);
@@ -219,8 +219,7 @@ function InputMask() {
219
219
  };
220
220
 
221
221
  (0, _react.useEffect)(function () {
222
- if (!serviceWatchers.length) return false;
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 (!isMaskRendered || isInitValue || value === getClearInnerValueAsString()) return false;
1243
-
1244
- if (value && value !== '') {
1245
- var valueCharIndex = 0;
1246
- innerValue.map(function (_ref25, i) {
1247
- var _maskPattern;
1248
-
1249
- var isSpecialSymbol = _ref25.isSpecialSymbol;
1250
- if (isSpecialSymbol) return false;
1251
- var char = value[valueCharIndex];
1252
- var whileLimit = ((_maskPattern = maskPattern) === null || _maskPattern === void 0 ? void 0 : _maskPattern.length) || 0;
1253
-
1254
- while (whileLimit && isSpecialSymbolChar({
1255
- char: value[valueCharIndex]
1256
- })) {
1257
- whileLimit--;
1258
- char = value[++valueCharIndex];
1259
- } //If Valid
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
- if (isValidChar({
1263
- char: char,
1264
- i: i,
1265
- disableErrors: true
1266
- })) {
1267
- updateInnerValueChar({
1268
- char: char
1269
- }, i);
1270
- }
1270
+ ++valueCharIndex;
1271
+ });
1272
+ }
1271
1273
 
1272
- ++valueCharIndex;
1273
- });
1274
+ setIsInitValue(true);
1274
1275
  }
1275
-
1276
- setIsInitValue(true);
1277
1276
  }, [isMaskRendered, value, isInitValue]);
1278
1277
  (0, _react.useEffect)(function () {
1279
- if (!isInitValue) return false;
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 (!isMaskRendered || !isFocused) return false;
1297
- setError(false);
1298
- clearErrorMessage();
1299
- var values = [getClearInnerValueAsString(), getInnerValueAsString({
1300
- replaceSpace: true
1301
- })];
1302
- if (returnMaskedValue) values.reverse();
1303
- onChangeProp.apply(void 0, values);
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 (!blinkError) return false;
1308
- setTimeout(function () {
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 === null) return false;
544
- var input = inputRef.current;
545
- if (input) input.setSelectionRange(cursor, cursor);
546
- setPrevCursor(cursor);
547
- setCursor(null);
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 (!isMaskRendered || isInitValue || value === getInputValue() && value !== "") return false;
574
- if (value && value !== '') setValue(value);
575
- setIsInitValue(true);
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
- var _prevValueRef$current, _prevValueRef$current2;
587
+ if (isMaskRendered && isInitValue) {
588
+ var _prevValueRef$current, _prevValueRef$current2;
586
589
 
587
- if (!isMaskRendered || !isInitValue) return false;
588
- setError(false);
589
- var values = [getClearInnerValueAsString(), getInputValue()];
590
- if (returnMaskedValue) values.reverse();
590
+ setError(false);
591
+ var values = [getClearInnerValueAsString(), getInputValue()];
592
+ if (returnMaskedValue) values.reverse();
591
593
 
592
- 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]) {
593
- prevValueRef.current = values;
594
- onChangeProp.apply(void 0, values);
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 (!blinkError) return false;
600
- setTimeout(function () {
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
- var _monthsListRef$curren, _monthsListRef$curren2;
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
- var _daysListRef$current, _daysListRef$current2;
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
- var _yearsListRef$current, _yearsListRef$current2;
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 = _interopRequireWildcard(require("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) {
@@ -259,7 +259,9 @@ var TagsDropdown = function TagsDropdown(_ref) {
259
259
  }, footerContent) : null);
260
260
  };
261
261
 
262
- (0, _react.useEffect)(initListContainer, []);
262
+ (0, _react.useEffect)(function () {
263
+ initListContainer();
264
+ }, []);
263
265
 
264
266
  var closeList = function closeList(e) {
265
267
  var _inputRef$current;
@@ -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", {
@@ -105,10 +105,10 @@ var Chart = function Chart(_ref) {
105
105
  }
106
106
  }, [notLibraryOptionsOptions]);
107
107
  (0, _react.useEffect)(function () {
108
- return setModel((0, _utils.correctModelKey)(initialModel));
108
+ setModel((0, _utils.correctModelKey)(initialModel));
109
109
  }, [initialModel]);
110
110
  (0, _react.useEffect)(function () {
111
- return setLocalData((0, _utils.prepareData)(model, (0, _utils2.clone)(data), chartRef.current, addToDatasets));
111
+ setLocalData((0, _utils.prepareData)(model, (0, _utils2.clone)(data), chartRef.current, addToDatasets));
112
112
  }, [model, data]);
113
113
  return /*#__PURE__*/_react.default.createElement("div", {
114
114
  className: (0, _classnames.default)(RC, (0, _defineProperty2.default)({}, "".concat(RC, "_icon-mode"), _Chart.ICON_MODELS.includes(model)), className)
@@ -109,7 +109,9 @@ var Hint = function Hint(_ref) {
109
109
  return /*#__PURE__*/(0, _reactDom.createPortal)(getHintMarkUp(), hc);
110
110
  };
111
111
 
112
- (0, _react.useEffect)(initHintContainer, []);
112
+ (0, _react.useEffect)(function () {
113
+ initHintContainer();
114
+ }, []);
113
115
  (0, _react.useEffect)(function () {
114
116
  setHintContainerStyles();
115
117
  }, [isOpen]);
@@ -83,8 +83,7 @@ var Modal = function Modal(_ref) {
83
83
  }
84
84
  };
85
85
  (0, _react.useEffect)(function () {
86
- if (!submitOnEnter) return false;
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
- switch (task) {
118
- case 'next':
119
- scrollToNextItem();
120
- break;
115
+ if (scrollQueue.length && task) {
116
+ switch (task) {
117
+ case 'next':
118
+ scrollToNextItem();
119
+ break;
121
120
 
122
- case 'prev':
123
- scrollToPrevItem();
124
- break;
121
+ case 'prev':
122
+ scrollToPrevItem();
123
+ break;
125
124
 
126
- default:
127
- break;
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 (!(wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current)) return false;
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 (!withToggle) return false;
162
+ if (withToggle) {
163
+ if (!isTagsRefSet()) {
164
+ setLastCheckTime(Date.now());
165
+ return;
166
+ }
163
167
 
164
- if (!isTagsRefSet()) {
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 === 0) return null;
343
- setFormFields(function (fields) {
344
- return renderFormFields.reduce(function (result, key) {
345
- var _field$className;
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
- addOnFieldRenderedObserver(key, function () {
374
- var _getFormField2, _getFormField2$ref, _getFormField2$ref$cu;
347
+ var fieldData = getFieldData(key);
348
+ var field = !getFormField(key) ? fieldData : getFormField(key);
375
349
 
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');
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
- var handler = function handler() {
379
- return _setFormField({
380
- isValueChangedByUser: true
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
- 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
- });
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 || !onFormRenderObservers.length) return null;
454
- var formFieldsKeys = getFormFieldsKeys(form);
455
- var isAllFieldsRendered = renderFormFields.reduce(function (result, key) {
456
- if (!formFieldsKeys.includes(key)) result = false;
457
- return result;
458
- }, true);
459
-
460
- if (isAllFieldsRendered) {
461
- submitIsFormRendered(true);
462
- onFormRenderWorker();
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,7 +1,7 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.0.0",
4
- "description": "Up to 18 React",
3
+ "version": "1.0.2",
4
+ "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist/*",