intelicoreact 2.0.7 → 2.0.8
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/charts/package.json +5 -0
- package/dist/Atomic/FormElements/Input/Input.d.ts +1 -1
- package/dist/Atomic/FormElements/Input/types.d.ts +0 -5
- package/dist/Atomic/FormElements/InputMask3/InputMask3.interface.d.ts +0 -3
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.interface.d.ts +1 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.d.ts +4 -4
- package/dist/Atomic/UI/Alert/Alert.interface.d.ts +0 -2
- package/dist/Functions/sdk/runtime-sdk/transport.d.ts +2 -2
- package/dist/charts.cjs +927 -0
- package/dist/charts.cjs.map +7 -0
- package/dist/charts.d.ts +7 -0
- package/dist/charts.js +911 -0
- package/dist/charts.js.map +7 -0
- package/dist/form.cjs +1498 -1933
- package/dist/form.cjs.map +4 -4
- package/dist/form.js +1114 -1549
- package/dist/form.js.map +4 -4
- package/dist/hooks.cjs +8 -324
- package/dist/hooks.cjs.map +4 -4
- package/dist/hooks.js +8 -324
- package/dist/hooks.js.map +4 -4
- package/dist/index.cjs +2507 -9293
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +2059 -8861
- package/dist/index.js.map +4 -4
- package/dist/layout.cjs +207 -6308
- package/dist/layout.cjs.map +4 -4
- package/dist/layout.js +202 -6303
- package/dist/layout.js.map +4 -4
- package/dist/presets.cjs +0 -643
- package/dist/presets.cjs.map +4 -4
- package/dist/presets.js +0 -633
- package/dist/presets.js.map +4 -4
- package/dist/ui.cjs +711 -7854
- package/dist/ui.cjs.map +4 -4
- package/dist/ui.d.ts +0 -5
- package/dist/ui.js +722 -7881
- package/dist/ui.js.map +4 -4
- package/dist/utils.cjs +4 -51
- package/dist/utils.cjs.map +3 -3
- package/dist/utils.js +4 -51
- package/dist/utils.js.map +3 -3
- package/package.json +16 -2
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.d.ts +0 -4
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.d.ts +0 -11
- package/dist/Atomic/FormElements/NumericInput/NumericInput.d.ts +0 -36
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.d.ts +0 -2
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.d.ts +0 -19
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.d.ts +0 -5
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.d.ts +0 -17
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.d.ts +0 -12
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.d.ts +0 -2
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.d.ts +0 -23
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.d.ts +0 -2
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.d.ts +0 -38
- package/dist/Atomic/UI/AccordionTable/AccordionTable.d.ts +0 -10
- package/dist/Atomic/UI/AccordionText/AccordionText.d.ts +0 -8
- package/dist/Atomic/UI/Chart/partial/Chart.constants.d.ts +0 -78
- package/dist/Atomic/UI/Chart/partial/datasetSetters.d.ts +0 -13
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.d.ts +0 -145
- package/dist/Atomic/UI/Chart/partial/optionsSetters.d.ts +0 -4
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.d.ts +0 -14
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.d.ts +0 -4
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.interface.d.ts +0 -6
- package/dist/Atomic/UI/DynamicIcon/index.d.ts +0 -3
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.d.ts +0 -2
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.d.ts +0 -4
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.d.ts +0 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.d.ts +0 -12
- package/dist/Atomic/UI/PieChart/PieChart.d.ts +0 -8
- package/dist/Atomic/UI/Table/Partials/TdCell.d.ts +0 -13
- package/dist/Atomic/UI/Table/Partials/TdHeader.d.ts +0 -5
- package/dist/Atomic/UI/Table/Partials/TdRow.d.ts +0 -17
- package/dist/Atomic/UI/Table/Partials/TdTitle.d.ts +0 -5
- package/dist/Atomic/UI/Table/Table.d.ts +0 -9
- package/dist/Atomic/UI/Table/TdTypes/TdActions.d.ts +0 -6
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.d.ts +0 -6
- package/dist/Atomic/UI/Table/TdTypes/TdRange.d.ts +0 -4
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.d.ts +0 -7
- package/dist/Atomic/UI/WizardStepper/constructor.d.ts +0 -51
- package/dist/Classes/AbortableFetch.d.ts +0 -43
- package/dist/Classes/AnimatedHandler.d.ts +0 -4
- package/dist/Classes/RESTAPI/index.d.ts +0 -9
- package/dist/Classes/RESTAPI/partials/AbortableFetch.d.ts +0 -43
- package/dist/Classes/RESTAPI/partials/ApiBase.d.ts +0 -10
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.d.ts +0 -9
- package/dist/Classes/RESTAPI/partials/ApiUtils.d.ts +0 -12
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.d.ts +0 -24
- package/dist/Classes/RESTAPI/partials/Utils.d.ts +0 -4
- package/dist/Classes/RESTAPI/partials/_utils.d.ts +0 -9
- package/dist/Constants/index.constants.d.ts +0 -20
- package/dist/Functions/Portal.d.ts +0 -6
- package/dist/Functions/customEventListener.d.ts +0 -27
- package/dist/Functions/dateTime.d.ts +0 -95
- package/dist/Functions/fieldValueFormatters.d.ts +0 -19
- package/dist/Functions/hooks/useFormFieldsChangesManager.d.ts +0 -15
- package/dist/Functions/locale/createTranslator.d.ts +0 -3
- package/dist/Functions/operations.d.ts +0 -1
- package/dist/Functions/presets/inputMaskPresets.d.ts +0 -136
- package/dist/Functions/presets/inputPresets.d.ts +0 -16
- package/dist/Functions/presets/mobileKeyboardTypesPresets.d.ts +0 -17
- package/dist/Functions/schemas.d.ts +0 -3
- package/dist/Functions/useBodyScrollLock.d.ts +0 -2
- package/dist/Functions/useClickOutside.d.ts +0 -1
- package/dist/Functions/useDebounce.d.ts +0 -4
- package/dist/Functions/useFieldFocus.d.ts +0 -7
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.d.ts +0 -15
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.d.ts +0 -12
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.d.ts +0 -15
- package/dist/Functions/useFormTools/functions/General.d.ts +0 -15
- package/dist/Functions/useFormTools/functions/RenderFields.d.ts +0 -7
- package/dist/Functions/useFormTools/functions/usePrevious.d.ts +0 -2
- package/dist/Functions/useFormTools/index.d.ts +0 -86
- package/dist/Functions/useInputHighlightError.d.ts +0 -12
- package/dist/Functions/useLocalStorage.d.ts +0 -2
- package/dist/Functions/useLocationParams.d.ts +0 -1
- package/dist/Functions/useMediaQuery.d.ts +0 -2
- package/dist/Functions/useMetaInfo.d.ts +0 -8
- package/dist/Functions/useMouseUpOutside.d.ts +0 -1
- package/dist/Functions/useOnlineStatus.d.ts +0 -2
- package/dist/Functions/usePasswordChecker.d.ts +0 -7
- package/dist/Functions/usePrevious.d.ts +0 -2
- package/dist/Functions/useResize.d.ts +0 -3
- package/dist/Functions/useScrollTo.d.ts +0 -2
- package/dist/Functions/useToggle.d.ts +0 -7
- package/dist/Functions/utils.d.ts +0 -40
- package/dist/Langs.d.ts +0 -179
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.d.ts +0 -3
- package/dist/Molecular/FormWithDependOn/partials/_utils.d.ts +0 -8
package/dist/hooks.cjs
CHANGED
|
@@ -304,6 +304,10 @@ function parseAndFormatDate(value, outputFormat = DATETIME_FORMATS.INPUT_DATE_FO
|
|
|
304
304
|
return value;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
+
// src/Functions/utils.js
|
|
308
|
+
var import_react = require("react");
|
|
309
|
+
var import_moment_timezone = __toESM(require("moment-timezone"), 1);
|
|
310
|
+
|
|
307
311
|
// src/Constants/index.constants.js
|
|
308
312
|
var KEYBOARD_SERVICE_KEYS = [
|
|
309
313
|
"Escape",
|
|
@@ -345,44 +349,8 @@ var KEYBOARD_SERVICE_KEYS = [
|
|
|
345
349
|
"ScrollLock",
|
|
346
350
|
"Pause"
|
|
347
351
|
];
|
|
348
|
-
var MAX_PHONE_LENGTH = 10;
|
|
349
|
-
var MAX_NAME_LENGTH = 128;
|
|
350
|
-
var DEFAULT_DATE_MASK_NO_VALUE_SYMBOL = "_";
|
|
351
|
-
var DEFAULT_COLORS = [
|
|
352
|
-
"#D9C1FF",
|
|
353
|
-
"#FFBAF0",
|
|
354
|
-
"#FFB8CE",
|
|
355
|
-
"#FFC3A2",
|
|
356
|
-
"#FFDB7C",
|
|
357
|
-
"#F9F871",
|
|
358
|
-
"#C3FCF1",
|
|
359
|
-
"#F6F2CB",
|
|
360
|
-
"#E0F8D1",
|
|
361
|
-
"#B1DFFB",
|
|
362
|
-
"#8DECFE",
|
|
363
|
-
"#76F7ED",
|
|
364
|
-
"#8AFEC8"
|
|
365
|
-
];
|
|
366
|
-
var KEYBOARD_KEY_CODES = {
|
|
367
|
-
Backspace: 8,
|
|
368
|
-
Delete: 46,
|
|
369
|
-
ARROW_LEFT: 37,
|
|
370
|
-
ARROW_RIGHT: 39
|
|
371
|
-
};
|
|
372
|
-
var OS = {
|
|
373
|
-
iOS: "iOS",
|
|
374
|
-
Android: "Android",
|
|
375
|
-
WP: "Windows Phone",
|
|
376
|
-
Linux: "Linux",
|
|
377
|
-
Windows: "Windows",
|
|
378
|
-
MacOS: "MacOS",
|
|
379
|
-
Unknown: "unknown"
|
|
380
|
-
};
|
|
381
352
|
|
|
382
353
|
// src/Functions/utils.js
|
|
383
|
-
var import_react = require("react");
|
|
384
|
-
var import_moment_timezone = __toESM(require("moment-timezone"), 1);
|
|
385
|
-
var uuid = () => Date.now().toString(36) + Math.random().toString(36).substring(2);
|
|
386
354
|
var getIsOnlyAnObject = (input) => {
|
|
387
355
|
return typeof input === "object" && // "отбивает" примитивы и функции
|
|
388
356
|
input instanceof Object && // "отбивает" null
|
|
@@ -390,304 +358,18 @@ var getIsOnlyAnObject = (input) => {
|
|
|
390
358
|
!(input instanceof Set) && // "отбивает" сеты
|
|
391
359
|
!(input instanceof Map);
|
|
392
360
|
};
|
|
393
|
-
var handleObjectChange = (updateObject, updateFunction) => (data, prop = "", isNumber) => {
|
|
394
|
-
let value;
|
|
395
|
-
if (data?.target) {
|
|
396
|
-
value = data.target.type === "checkbox" ? data.target.checked : data.target.value;
|
|
397
|
-
} else value = data;
|
|
398
|
-
value = isNumber ? Number(value) : value;
|
|
399
|
-
const props = prop.split(".");
|
|
400
|
-
const currentObject = props.reduce((res, chapter, index) => {
|
|
401
|
-
if (props.length !== index + 1) res = res[chapter];
|
|
402
|
-
return res;
|
|
403
|
-
}, updateObject);
|
|
404
|
-
currentObject[props.pop()] = value;
|
|
405
|
-
updateFunction();
|
|
406
|
-
};
|
|
407
|
-
var useOutsideToggle = (ref, setOut, open) => {
|
|
408
|
-
function handleClickOutside(event) {
|
|
409
|
-
if (ref.current && !ref.current.contains(event.target)) {
|
|
410
|
-
setOut(open);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
(0, import_react.useEffect)(() => {
|
|
414
|
-
document.addEventListener("mouseup", handleClickOutside);
|
|
415
|
-
return () => {
|
|
416
|
-
document.removeEventListener("mouseup", handleClickOutside);
|
|
417
|
-
};
|
|
418
|
-
}, [ref]);
|
|
419
|
-
};
|
|
420
361
|
var clone = (input) => {
|
|
421
362
|
if (input === null || typeof input !== "object") return input;
|
|
422
363
|
const data = input instanceof Array ? [] : {};
|
|
423
364
|
for (const i in input) data[i] = clone(input[i]);
|
|
424
365
|
return data;
|
|
425
366
|
};
|
|
426
|
-
var getResponseClone = async (res) => await (typeof res?.clone === "function" ? res.clone() : clone(res));
|
|
427
|
-
function transformUTCTimeToLocal(date, format = "YYYY-MM-DD HH:mm:ss") {
|
|
428
|
-
if (!date) return;
|
|
429
|
-
const utcDate = import_moment_timezone.default.utc(date).toDate();
|
|
430
|
-
return (0, import_moment_timezone.default)(utcDate, format).local().format(format);
|
|
431
|
-
}
|
|
432
|
-
function transformLocalTimeToUTC(date, format = "YYYY-MM-DD HH:mm:ss") {
|
|
433
|
-
if (!date) return;
|
|
434
|
-
return (0, import_moment_timezone.default)(date, format).utc().format(format);
|
|
435
|
-
}
|
|
436
|
-
function transformUTCHoursToLocal(time, format = "HH:mm:ss") {
|
|
437
|
-
if (!time) return;
|
|
438
|
-
const splitedTime = time.split(":");
|
|
439
|
-
const offset = (0, import_moment_timezone.default)().utcOffset();
|
|
440
|
-
let HH = Number(splitedTime[0]);
|
|
441
|
-
let mm = Number(splitedTime[1]);
|
|
442
|
-
const ss = splitedTime[2];
|
|
443
|
-
mm = mm + offset;
|
|
444
|
-
while (mm > 59) {
|
|
445
|
-
mm -= 60;
|
|
446
|
-
HH += 1;
|
|
447
|
-
}
|
|
448
|
-
if (HH > 23) HH -= 24;
|
|
449
|
-
while (mm < 0) {
|
|
450
|
-
mm += 60;
|
|
451
|
-
HH -= 1;
|
|
452
|
-
}
|
|
453
|
-
if (HH < 0) HH += 24;
|
|
454
|
-
return `${HH}:${mm}:${ss}`;
|
|
455
|
-
}
|
|
456
|
-
function transformDateOrTimeOrTogetherToFormat(data, outputFormat = "HH:mm", additional) {
|
|
457
|
-
const ERROR_VALUE = "Invalid date";
|
|
458
|
-
const ERROR_MESSGE = `Invalid input data for ${outputFormat} format`;
|
|
459
|
-
const { parseFormat, isReturnAsMomentInstance } = getIsOnlyAnObject(
|
|
460
|
-
additional
|
|
461
|
-
) ? additional : {};
|
|
462
|
-
if (typeof data !== "string" && typeof data !== "number") {
|
|
463
|
-
return isReturnAsMomentInstance ? (0, import_moment_timezone.default)("error") : ERROR_MESSGE;
|
|
464
|
-
}
|
|
465
|
-
const momentArgs = [
|
|
466
|
-
data,
|
|
467
|
-
...!Number.isNaN(Number(data)) || typeof parseFormat === "string" ? [] : [parseFormat]
|
|
468
|
-
];
|
|
469
|
-
const momentInstance = (() => {
|
|
470
|
-
let instance = (0, import_moment_timezone.default)(...momentArgs);
|
|
471
|
-
if (instance.format(outputFormat) !== ERROR_VALUE) return instance;
|
|
472
|
-
else if (/^\d\d.\d\d/.test(data)) {
|
|
473
|
-
instance = (0, import_moment_timezone.default)();
|
|
474
|
-
const symbols = data.split("");
|
|
475
|
-
const timeArr = symbols.reduce(
|
|
476
|
-
(acc, symbol, idx) => {
|
|
477
|
-
if (Number.isNaN(Number(symbol))) {
|
|
478
|
-
if (acc.group) acc.result.push(acc.group);
|
|
479
|
-
acc.group = "";
|
|
480
|
-
} else acc.group = `${acc.group}${symbol}`;
|
|
481
|
-
if (idx === symbols.length - 1 && acc.group)
|
|
482
|
-
acc.result.push(acc.group);
|
|
483
|
-
return acc;
|
|
484
|
-
},
|
|
485
|
-
{ result: [], group: "" }
|
|
486
|
-
).result.reverse();
|
|
487
|
-
instance.hours(Number(timeArr.pop()));
|
|
488
|
-
instance.minutes(Number(timeArr.pop()));
|
|
489
|
-
instance.seconds(timeArr.length ? Number(timeArr.pop()) : 0);
|
|
490
|
-
instance.milliseconds(timeArr.length ? Number(timeArr.pop()) : 0);
|
|
491
|
-
} else instance = (0, import_moment_timezone.default)("error");
|
|
492
|
-
return instance;
|
|
493
|
-
})();
|
|
494
|
-
if (isReturnAsMomentInstance) return momentInstance;
|
|
495
|
-
const output = momentInstance.format(outputFormat);
|
|
496
|
-
return output === ERROR_VALUE ? ERROR_MESSGE : output;
|
|
497
|
-
}
|
|
498
|
-
function transformDateOrTimeOrTogetherToFormattedLocal(data, outputFormat = "HH:mm", additional) {
|
|
499
|
-
const ERROR_VALUE = "Invalid date";
|
|
500
|
-
const ERROR_MESSGE = `Invalid input data for ${outputFormat} format`;
|
|
501
|
-
if (additional && !getIsOnlyAnObject(additional)) {
|
|
502
|
-
throw new Error(
|
|
503
|
-
"Bad additional [transformDateOrTimeOrTogetherToFormattedLocal]"
|
|
504
|
-
);
|
|
505
|
-
}
|
|
506
|
-
const compositeAdditional = {
|
|
507
|
-
...additional || {},
|
|
508
|
-
isReturnAsMomentInstance: true
|
|
509
|
-
};
|
|
510
|
-
const date = transformDateOrTimeOrTogetherToFormat(
|
|
511
|
-
data,
|
|
512
|
-
outputFormat,
|
|
513
|
-
compositeAdditional
|
|
514
|
-
);
|
|
515
|
-
const dateWithLocale = date.add((0, import_moment_timezone.default)().utcOffset(), "minutes");
|
|
516
|
-
const output = dateWithLocale.format(outputFormat);
|
|
517
|
-
return output === ERROR_VALUE ? ERROR_MESSGE : output;
|
|
518
|
-
}
|
|
519
|
-
var omitKeys = (obj = {}, keys = []) => keys.reduce((acc, key) => {
|
|
520
|
-
const { [key]: omit, ...rest } = acc;
|
|
521
|
-
return rest;
|
|
522
|
-
}, obj);
|
|
523
|
-
var logout = () => {
|
|
524
|
-
window.localStorage.removeItem("accessToken");
|
|
525
|
-
window.localStorage.removeItem("tokenExpires");
|
|
526
|
-
window.location.reload();
|
|
527
|
-
};
|
|
528
|
-
var getStyles = (el, prop) => {
|
|
529
|
-
if (!el) return null;
|
|
530
|
-
if (!prop) return window.getComputedStyle(el);
|
|
531
|
-
return window.getComputedStyle(el).getPropertyValue(prop);
|
|
532
|
-
};
|
|
533
|
-
var getColorById = (id, colors) => {
|
|
534
|
-
if (!id) return "#FF7D00";
|
|
535
|
-
const idToArr = Array.from(id);
|
|
536
|
-
const colorsArr = colors && colors.length > 0 ? colors : DEFAULT_COLORS;
|
|
537
|
-
let number = idToArr.reduce((acc, item) => {
|
|
538
|
-
if (Number(item)) {
|
|
539
|
-
return acc + Number(item);
|
|
540
|
-
}
|
|
541
|
-
return acc;
|
|
542
|
-
}, 0);
|
|
543
|
-
while (number >= colorsArr.length) {
|
|
544
|
-
number -= colorsArr.length;
|
|
545
|
-
}
|
|
546
|
-
return colorsArr[number];
|
|
547
|
-
};
|
|
548
|
-
var debounce = (fn, ms) => {
|
|
549
|
-
let id = null;
|
|
550
|
-
return (...args) => {
|
|
551
|
-
clearTimeout(id);
|
|
552
|
-
id = setTimeout(() => {
|
|
553
|
-
clearTimeout(id);
|
|
554
|
-
fn(...args);
|
|
555
|
-
}, ms);
|
|
556
|
-
};
|
|
557
|
-
};
|
|
558
|
-
var throttle = (fn, ms) => {
|
|
559
|
-
let id = null;
|
|
560
|
-
return (...args) => {
|
|
561
|
-
if (id) return;
|
|
562
|
-
fn(...args);
|
|
563
|
-
id = setTimeout(() => {
|
|
564
|
-
clearTimeout(id);
|
|
565
|
-
id = null;
|
|
566
|
-
}, ms);
|
|
567
|
-
};
|
|
568
|
-
};
|
|
569
|
-
var addBitDepthPoints = (value, step = 3) => {
|
|
570
|
-
const isFraction = value?.includes(".");
|
|
571
|
-
const valueBeforeDot = isFraction ? value?.slice(0, value?.indexOf(".")) : value;
|
|
572
|
-
const intPart = valueBeforeDot.split("").reverse().reduce(
|
|
573
|
-
(acc, item, idx) => idx % step === 0 && idx !== 0 ? [...acc, ",", item] : [...acc, item],
|
|
574
|
-
[]
|
|
575
|
-
).reverse().join("");
|
|
576
|
-
return isFraction ? intPart + value?.slice(value?.indexOf(".")) : intPart;
|
|
577
|
-
};
|
|
578
|
-
var changeMeta = (key, items = []) => {
|
|
579
|
-
const defaultMeta = items.find((i) => i.key === "default");
|
|
580
|
-
if (key) {
|
|
581
|
-
const item = items.find((i) => i.key === key);
|
|
582
|
-
document.title = item?.title ?? defaultMeta?.title;
|
|
583
|
-
document.querySelector('meta[name="description"]').setAttribute("content", item?.description ?? defaultMeta?.description);
|
|
584
|
-
}
|
|
585
|
-
};
|
|
586
|
-
var firstLetterCapital = (str) => typeof str === "string" ? `${str.charAt(0).toUpperCase()}${str.slice(1)}` : str;
|
|
587
|
-
var capitalized = firstLetterCapital;
|
|
588
|
-
var checkedRef = (ref) => ref ? typeof ref === "function" ? (node) => ref(node) : ref : null;
|
|
589
|
-
function downloadEmulation(data, filename, type = "image/*") {
|
|
590
|
-
const file = new Blob([data], { type });
|
|
591
|
-
if (window.navigator.msSaveOrOpenBlob)
|
|
592
|
-
window.navigator.msSaveOrOpenBlob(file, filename);
|
|
593
|
-
else {
|
|
594
|
-
const a = document.createElement("a"), url = URL.createObjectURL(file);
|
|
595
|
-
a.href = url;
|
|
596
|
-
a.download = filename;
|
|
597
|
-
document.body.appendChild(a);
|
|
598
|
-
a.click();
|
|
599
|
-
setTimeout(() => {
|
|
600
|
-
document.body.removeChild(a);
|
|
601
|
-
window.URL.revokeObjectURL(url);
|
|
602
|
-
}, 0);
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
var downloadFile = async ({ url, name, type = null }) => {
|
|
606
|
-
const response = await fetch(url).then(async (res) => ({
|
|
607
|
-
data: await res.blob(),
|
|
608
|
-
type: type ?? res.headers.get("content-type")
|
|
609
|
-
}));
|
|
610
|
-
downloadEmulation(response.data, name, response.type);
|
|
611
|
-
};
|
|
612
|
-
var compare = (first, second, keys = []) => {
|
|
613
|
-
if (typeof first !== typeof second) return false;
|
|
614
|
-
if (Array.isArray(first) !== Array.isArray(second)) return false;
|
|
615
|
-
if (!(first instanceof Object)) return first === second;
|
|
616
|
-
const getComparationStructure = (data) => {
|
|
617
|
-
if (typeof data === "function") return data.toString();
|
|
618
|
-
if (!(data instanceof Object)) return data;
|
|
619
|
-
return Object.entries(data).sort((a, b) => a[0].localeCompare(b[0])).map(([key, value]) => [key, getComparationStructure(data[key])]);
|
|
620
|
-
};
|
|
621
|
-
const structureForComparingOfFirst = getComparationStructure(first);
|
|
622
|
-
const structureForComparingOfSecond = getComparationStructure(second);
|
|
623
|
-
return JSON.stringify(structureForComparingOfFirst) === JSON.stringify(structureForComparingOfSecond);
|
|
624
|
-
};
|
|
625
|
-
var setCarretToEnd = (input) => {
|
|
626
|
-
setTimeout(() => {
|
|
627
|
-
const tmp = input.value;
|
|
628
|
-
input.value = "";
|
|
629
|
-
input.value = tmp;
|
|
630
|
-
}, 10);
|
|
631
|
-
};
|
|
632
|
-
var compareAlphabetical = (a, b, key = "label") => {
|
|
633
|
-
let item1 = a?.[key];
|
|
634
|
-
let item2 = b?.[key];
|
|
635
|
-
if (typeof item1 !== "string" || typeof item2 !== "string") return 0;
|
|
636
|
-
item1 = item1?.toLowerCase();
|
|
637
|
-
item2 = item2?.toLowerCase();
|
|
638
|
-
if (item1 < item2) {
|
|
639
|
-
return -1;
|
|
640
|
-
}
|
|
641
|
-
if (item1 > item2) {
|
|
642
|
-
return 1;
|
|
643
|
-
}
|
|
644
|
-
return 0;
|
|
645
|
-
};
|
|
646
|
-
var getBase64 = (file) => {
|
|
647
|
-
if (file) {
|
|
648
|
-
return new Promise(function(resolve, reject) {
|
|
649
|
-
const reader = new FileReader();
|
|
650
|
-
reader.readAsDataURL(file);
|
|
651
|
-
reader.onload = () => resolve(reader.result);
|
|
652
|
-
reader.onerror = (error) => reject("Error: ", error);
|
|
653
|
-
});
|
|
654
|
-
}
|
|
655
|
-
};
|
|
656
|
-
var renderFileSize = (bytes, decimals = 2) => {
|
|
657
|
-
if (!Number(bytes)) return "0 Bytes";
|
|
658
|
-
const k = 1024;
|
|
659
|
-
const dm = decimals < 0 ? 0 : decimals;
|
|
660
|
-
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
661
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
662
|
-
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
|
|
663
|
-
};
|
|
664
|
-
var getUniqueFileExtensions = (extListString) => {
|
|
665
|
-
const extArray = extListString?.split(",").map((ext) => ext.trim().toUpperCase());
|
|
666
|
-
const uniqueExts = [...new Set(extArray)];
|
|
667
|
-
return uniqueExts.join(", ");
|
|
668
|
-
};
|
|
669
|
-
var getOS = () => {
|
|
670
|
-
let userAgent = window.navigator.userAgent, platform = window.navigator?.userAgentData?.platform || window.navigator.platform, macosPlatforms = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"], windowsPlatforms = ["Win32", "Win64", "Windows", "WinCE"], iosPlatforms = ["iPhone", "iPad", "iPod"], os = OS.Unknown;
|
|
671
|
-
if (macosPlatforms.indexOf(platform) !== -1) {
|
|
672
|
-
os = OS.MacOS;
|
|
673
|
-
} else if (iosPlatforms.indexOf(platform) !== -1) {
|
|
674
|
-
os = OS.iOS;
|
|
675
|
-
} else if (windowsPlatforms.indexOf(platform) !== -1) {
|
|
676
|
-
os = OS.Windows;
|
|
677
|
-
} else if (/Android/.test(userAgent)) {
|
|
678
|
-
os = OS.Android;
|
|
679
|
-
} else if (/Linux/.test(platform)) {
|
|
680
|
-
os = OS.Linux;
|
|
681
|
-
}
|
|
682
|
-
return os;
|
|
683
|
-
};
|
|
684
367
|
String.prototype.longerThan = function(compareWith) {
|
|
685
368
|
return this?.length > compareWith?.length;
|
|
686
369
|
};
|
|
687
370
|
String.prototype.lastIndexEqualsTo = function(index) {
|
|
688
371
|
return this?.length - 1 === index;
|
|
689
372
|
};
|
|
690
|
-
var getCorrectTestId = ({ testId = "", withTier = true }) => testId && testId !== void 0 ? `${withTier ? "-" : ""}${testId}` : "";
|
|
691
373
|
|
|
692
374
|
// src/Functions/fieldValueFormatters.js
|
|
693
375
|
var getSafelyValue = (value) => value !== void 0 && value !== null ? value?.toString?.() || "" : "";
|
|
@@ -1285,6 +967,9 @@ function useFieldsFocus({ form, setForm }) {
|
|
|
1285
967
|
};
|
|
1286
968
|
}
|
|
1287
969
|
|
|
970
|
+
// src/Functions/useFormTools/index.js
|
|
971
|
+
var import_react8 = require("react");
|
|
972
|
+
|
|
1288
973
|
// src/Functions/useFormTools/functions/General.js
|
|
1289
974
|
function General({ form, FormFields = [] } = {}) {
|
|
1290
975
|
const joinData = (...args) => {
|
|
@@ -1686,7 +1371,6 @@ function RenderFields({
|
|
|
1686
1371
|
}
|
|
1687
1372
|
|
|
1688
1373
|
// src/Functions/useFormTools/index.js
|
|
1689
|
-
var import_react8 = require("react");
|
|
1690
1374
|
var DefaultFocusControllerProps = {
|
|
1691
1375
|
setAutoFocus: true,
|
|
1692
1376
|
onlyEmptyFieldAutoFocus: false
|
|
@@ -2465,9 +2149,9 @@ var useOnlineStatus = () => {
|
|
|
2465
2149
|
var useOnlineStatus_default = useOnlineStatus;
|
|
2466
2150
|
|
|
2467
2151
|
// src/Functions/usePasswordChecker.js
|
|
2468
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
2469
2152
|
var import_react18 = __toESM(require("react"), 1);
|
|
2470
2153
|
var import_classnames = __toESM(require("classnames"), 1);
|
|
2154
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
2471
2155
|
function usePasswordChecker({ label = "Password must:" } = {}) {
|
|
2472
2156
|
const [checkRules, setCheckRules] = (0, import_react18.useState)([]);
|
|
2473
2157
|
const addCheckRule = (data) => setCheckRules((state) => [...state, data]);
|