intelicoreact 2.0.4 → 2.0.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.
- package/dist/Atomic/UI/Modal/index.d.ts +3 -0
- package/dist/form.cjs +1853 -1779
- package/dist/form.cjs.map +4 -4
- package/dist/form.d.ts +42 -17
- package/dist/form.js +1848 -1774
- package/dist/form.js.map +4 -4
- package/dist/index.cjs +2219 -2131
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +2036 -1948
- package/dist/index.js.map +4 -4
- package/dist/ui.cjs +398 -366
- package/dist/ui.cjs.map +4 -4
- package/dist/ui.d.ts +11 -7
- package/dist/ui.js +270 -238
- package/dist/ui.js.map +4 -4
- package/package.json +1 -1
package/dist/form.js
CHANGED
|
@@ -491,6 +491,95 @@ var CheckboxesLine_default2 = CheckboxesLine_default;
|
|
|
491
491
|
// src/Atomic/FormElements/CheckboxInput/index.ts
|
|
492
492
|
var CheckboxInput_default2 = CheckboxInput_default;
|
|
493
493
|
|
|
494
|
+
// src/Atomic/FormElements/Datepicker/components/DatepickerCalendar.tsx
|
|
495
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
496
|
+
import cn9 from "classnames";
|
|
497
|
+
import moment2 from "moment";
|
|
498
|
+
import { useEffect as useEffect2, useMemo as useMemo2, useState as useState2 } from "react";
|
|
499
|
+
import * as Icon from "react-feather";
|
|
500
|
+
var DatepickerCalendar = ({
|
|
501
|
+
date,
|
|
502
|
+
setDate,
|
|
503
|
+
startDate,
|
|
504
|
+
endDate,
|
|
505
|
+
allowPrev = true,
|
|
506
|
+
allowNext = true,
|
|
507
|
+
onClick,
|
|
508
|
+
onHover,
|
|
509
|
+
startPrevDate,
|
|
510
|
+
endPrevDate,
|
|
511
|
+
limitRange
|
|
512
|
+
}) => {
|
|
513
|
+
const [days, setDays] = useState2({});
|
|
514
|
+
const title = useMemo2(() => `${moment2(date).format("MMM")} ${moment2(date).format("YYYY")}`, [date]);
|
|
515
|
+
useEffect2(() => {
|
|
516
|
+
const result = {};
|
|
517
|
+
const day = moment2(date).startOf("month");
|
|
518
|
+
const daysInMonth = day.daysInMonth();
|
|
519
|
+
for (let d = 0; d < daysInMonth; d++) {
|
|
520
|
+
let week = day.week();
|
|
521
|
+
if (day.month() === 11 && week === 1) week = 53;
|
|
522
|
+
if (day.month() === 0 && week === 53) week = 0;
|
|
523
|
+
if (!result[week]) result[week] = {};
|
|
524
|
+
result[week][day.weekday()] = { date: day.toDate() };
|
|
525
|
+
day.add(1, "d");
|
|
526
|
+
}
|
|
527
|
+
setDays(result);
|
|
528
|
+
}, [date]);
|
|
529
|
+
const renderDay = (week, dayOfWeek) => {
|
|
530
|
+
const day = days[+week]?.[dayOfWeek];
|
|
531
|
+
const isFutureDay = day && moment2(day.date).isAfter(moment2(), "day");
|
|
532
|
+
const isPastDay = limitRange ? day && moment2(day.date).isBefore(moment2().subtract(limitRange, "days"), "day") : null;
|
|
533
|
+
const isRangeEnd = day && (moment2(day.date).isSame(startDate, "day") || moment2(day.date).isSame(moment2(endDate).subtract(1, "hour"), "day"));
|
|
534
|
+
const isRangeInside = day && startDate && endDate && moment2(day.date).isAfter(startDate, "day") && moment2(day.date).isBefore(moment2(endDate).subtract(1, "hour"), "day");
|
|
535
|
+
const isPrevRangeEnd = day && (moment2(day.date).isSame(startPrevDate, "day") || moment2(day.date).isSame(moment2(endPrevDate).subtract(1, "day"), "day"));
|
|
536
|
+
const isPrevRangeInside = day && startPrevDate && endPrevDate && moment2(day.date).isAfter(startPrevDate, "day") && moment2(day.date).isBefore(moment2(endPrevDate).subtract(1, "day"), "day");
|
|
537
|
+
const classNames2 = cn9(
|
|
538
|
+
"calendar__day",
|
|
539
|
+
{ "calendar__day--clickable": day },
|
|
540
|
+
{ "calendar__day--disabled": isFutureDay || isPastDay },
|
|
541
|
+
{ "calendar__day--range-end": isRangeEnd },
|
|
542
|
+
{ "calendar__day--range-inside": isRangeInside },
|
|
543
|
+
{ "calendar__day--prev-range-end": isPrevRangeEnd },
|
|
544
|
+
{ "calendar__day--prev-range-inside": isPrevRangeInside }
|
|
545
|
+
);
|
|
546
|
+
return /* @__PURE__ */ jsx9(
|
|
547
|
+
"div",
|
|
548
|
+
{
|
|
549
|
+
className: classNames2,
|
|
550
|
+
onClick: day && !isFutureDay ? () => onClick(day.date) : void 0,
|
|
551
|
+
onMouseOver: day && !isFutureDay ? () => onHover(day.date) : void 0,
|
|
552
|
+
onMouseLeave: () => onHover(null),
|
|
553
|
+
children: day && day.date.getDate()
|
|
554
|
+
},
|
|
555
|
+
`${week}_${dayOfWeek}`
|
|
556
|
+
);
|
|
557
|
+
};
|
|
558
|
+
const handlePrev = () => {
|
|
559
|
+
setDate(moment2(date).subtract(1, "month").toDate());
|
|
560
|
+
};
|
|
561
|
+
const handleNext = () => {
|
|
562
|
+
setDate(moment2(date).add(1, "month").toDate());
|
|
563
|
+
};
|
|
564
|
+
return /* @__PURE__ */ jsxs8("div", { className: "calendar", children: [
|
|
565
|
+
/* @__PURE__ */ jsxs8("div", { className: "calendar-header", children: [
|
|
566
|
+
/* @__PURE__ */ jsx9("div", { className: "calendar-header__prev", children: allowPrev && /* @__PURE__ */ jsx9("button", { type: "button", "data-testid": "datepicker-calendar-prev", onClick: handlePrev, "aria-label": "Previous month", children: /* @__PURE__ */ jsx9(Icon.ChevronLeft, { size: 16 }) }) }),
|
|
567
|
+
/* @__PURE__ */ jsx9("div", { className: "calendar-header__title", children: title }),
|
|
568
|
+
/* @__PURE__ */ jsx9("div", { className: "calendar-header__next", children: allowNext && /* @__PURE__ */ jsx9("button", { type: "button", "data-testid": "datepicker-calendar-next", onClick: handleNext, "aria-label": "Next month", children: /* @__PURE__ */ jsx9(Icon.ChevronRight, { size: 16 }) }) })
|
|
569
|
+
] }),
|
|
570
|
+
/* @__PURE__ */ jsx9("div", { className: "calendar__week", children: Array.from({ length: 7 }, (_, dayOfWeek) => /* @__PURE__ */ jsx9(
|
|
571
|
+
"div",
|
|
572
|
+
{
|
|
573
|
+
className: "calendar__day calendar__day--title",
|
|
574
|
+
children: moment2().weekday(dayOfWeek).format("dd").charAt(0)
|
|
575
|
+
},
|
|
576
|
+
`day-of-week_${dayOfWeek}`
|
|
577
|
+
)) }),
|
|
578
|
+
Object.keys(days).map((week, index) => /* @__PURE__ */ jsx9("div", { className: "calendar__week", children: Array.from({ length: 7 }, (_, dayOfWeek) => renderDay(week, dayOfWeek)) }, `week_${index}`))
|
|
579
|
+
] });
|
|
580
|
+
};
|
|
581
|
+
var DatepickerCalendar_default = DatepickerCalendar;
|
|
582
|
+
|
|
494
583
|
// src/Atomic/FormElements/Datepicker/Datepicker.tsx
|
|
495
584
|
import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
496
585
|
|
|
@@ -663,7 +752,7 @@ var Langs = {
|
|
|
663
752
|
var Langs_default = Langs;
|
|
664
753
|
|
|
665
754
|
// src/Atomic/FormElements/Dropdown/Dropdown.tsx
|
|
666
|
-
import { Fragment, jsx as
|
|
755
|
+
import { Fragment, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
667
756
|
|
|
668
757
|
// src/Constants/index.constants.js
|
|
669
758
|
var KEYBOARD_SERVICE_KEYS = [
|
|
@@ -741,8 +830,8 @@ var OS = {
|
|
|
741
830
|
};
|
|
742
831
|
|
|
743
832
|
// src/Functions/utils.js
|
|
744
|
-
import { useEffect as
|
|
745
|
-
import
|
|
833
|
+
import { useEffect as useEffect3 } from "react";
|
|
834
|
+
import moment3 from "moment-timezone";
|
|
746
835
|
var uuid = () => Date.now().toString(36) + Math.random().toString(36).substring(2);
|
|
747
836
|
var getIsOnlyAnObject = (input) => {
|
|
748
837
|
return typeof input === "object" && // "отбивает" примитивы и функции
|
|
@@ -771,7 +860,7 @@ var useOutsideToggle = (ref, setOut, open) => {
|
|
|
771
860
|
setOut(open);
|
|
772
861
|
}
|
|
773
862
|
}
|
|
774
|
-
|
|
863
|
+
useEffect3(() => {
|
|
775
864
|
document.addEventListener("mouseup", handleClickOutside);
|
|
776
865
|
return () => {
|
|
777
866
|
document.removeEventListener("mouseup", handleClickOutside);
|
|
@@ -787,17 +876,17 @@ var clone = (input) => {
|
|
|
787
876
|
var getResponseClone = async (res) => await (typeof res?.clone === "function" ? res.clone() : clone(res));
|
|
788
877
|
function transformUTCTimeToLocal(date, format = "YYYY-MM-DD HH:mm:ss") {
|
|
789
878
|
if (!date) return;
|
|
790
|
-
const utcDate =
|
|
791
|
-
return
|
|
879
|
+
const utcDate = moment3.utc(date).toDate();
|
|
880
|
+
return moment3(utcDate, format).local().format(format);
|
|
792
881
|
}
|
|
793
882
|
function transformLocalTimeToUTC(date, format = "YYYY-MM-DD HH:mm:ss") {
|
|
794
883
|
if (!date) return;
|
|
795
|
-
return
|
|
884
|
+
return moment3(date, format).utc().format(format);
|
|
796
885
|
}
|
|
797
886
|
function transformUTCHoursToLocal(time, format = "HH:mm:ss") {
|
|
798
887
|
if (!time) return;
|
|
799
888
|
const splitedTime = time.split(":");
|
|
800
|
-
const offset =
|
|
889
|
+
const offset = moment3().utcOffset();
|
|
801
890
|
let HH = Number(splitedTime[0]);
|
|
802
891
|
let mm = Number(splitedTime[1]);
|
|
803
892
|
const ss = splitedTime[2];
|
|
@@ -821,17 +910,17 @@ function transformDateOrTimeOrTogetherToFormat(data, outputFormat = "HH:mm", add
|
|
|
821
910
|
additional
|
|
822
911
|
) ? additional : {};
|
|
823
912
|
if (typeof data !== "string" && typeof data !== "number") {
|
|
824
|
-
return isReturnAsMomentInstance ?
|
|
913
|
+
return isReturnAsMomentInstance ? moment3("error") : ERROR_MESSGE;
|
|
825
914
|
}
|
|
826
915
|
const momentArgs = [
|
|
827
916
|
data,
|
|
828
917
|
...!Number.isNaN(Number(data)) || typeof parseFormat === "string" ? [] : [parseFormat]
|
|
829
918
|
];
|
|
830
919
|
const momentInstance = (() => {
|
|
831
|
-
let instance =
|
|
920
|
+
let instance = moment3(...momentArgs);
|
|
832
921
|
if (instance.format(outputFormat) !== ERROR_VALUE) return instance;
|
|
833
922
|
else if (/^\d\d.\d\d/.test(data)) {
|
|
834
|
-
instance =
|
|
923
|
+
instance = moment3();
|
|
835
924
|
const symbols = data.split("");
|
|
836
925
|
const timeArr = symbols.reduce(
|
|
837
926
|
(acc, symbol, idx) => {
|
|
@@ -849,7 +938,7 @@ function transformDateOrTimeOrTogetherToFormat(data, outputFormat = "HH:mm", add
|
|
|
849
938
|
instance.minutes(Number(timeArr.pop()));
|
|
850
939
|
instance.seconds(timeArr.length ? Number(timeArr.pop()) : 0);
|
|
851
940
|
instance.milliseconds(timeArr.length ? Number(timeArr.pop()) : 0);
|
|
852
|
-
} else instance =
|
|
941
|
+
} else instance = moment3("error");
|
|
853
942
|
return instance;
|
|
854
943
|
})();
|
|
855
944
|
if (isReturnAsMomentInstance) return momentInstance;
|
|
@@ -873,7 +962,7 @@ function transformDateOrTimeOrTogetherToFormattedLocal(data, outputFormat = "HH:
|
|
|
873
962
|
outputFormat,
|
|
874
963
|
compositeAdditional
|
|
875
964
|
);
|
|
876
|
-
const dateWithLocale = date.add(
|
|
965
|
+
const dateWithLocale = date.add(moment3().utcOffset(), "minutes");
|
|
877
966
|
const output = dateWithLocale.format(outputFormat);
|
|
878
967
|
return output === ERROR_VALUE ? ERROR_MESSGE : output;
|
|
879
968
|
}
|
|
@@ -1302,21 +1391,21 @@ var formatToHideValuePartially = (value, settings) => {
|
|
|
1302
1391
|
};
|
|
1303
1392
|
|
|
1304
1393
|
// src/Atomic/FormElements/Input/Input.tsx
|
|
1305
|
-
import { jsx as
|
|
1394
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1306
1395
|
|
|
1307
1396
|
// src/Atomic/Layout/Spinner/Spinner.tsx
|
|
1308
|
-
import { jsx as
|
|
1309
|
-
import
|
|
1397
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1398
|
+
import cn10 from "classnames";
|
|
1310
1399
|
var CN2 = "loader-box";
|
|
1311
1400
|
var Spinner = ({ size = null, className, testId = CN2 }) => {
|
|
1312
|
-
return /* @__PURE__ */
|
|
1401
|
+
return /* @__PURE__ */ jsx10(
|
|
1313
1402
|
"div",
|
|
1314
1403
|
{
|
|
1315
1404
|
role: "status",
|
|
1316
1405
|
"aria-live": "polite",
|
|
1317
1406
|
"aria-busy": "true",
|
|
1318
1407
|
"data-testid": testId,
|
|
1319
|
-
className:
|
|
1408
|
+
className: cn10(
|
|
1320
1409
|
CN2,
|
|
1321
1410
|
{
|
|
1322
1411
|
j5: size !== "small",
|
|
@@ -1324,11 +1413,11 @@ var Spinner = ({ size = null, className, testId = CN2 }) => {
|
|
|
1324
1413
|
},
|
|
1325
1414
|
className
|
|
1326
1415
|
),
|
|
1327
|
-
children: /* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
/* @__PURE__ */
|
|
1416
|
+
children: /* @__PURE__ */ jsxs9("div", { className: cn10("lds-ring", { [`lds-ring_${size}`]: size }), children: [
|
|
1417
|
+
/* @__PURE__ */ jsx10("div", {}),
|
|
1418
|
+
/* @__PURE__ */ jsx10("div", {}),
|
|
1419
|
+
/* @__PURE__ */ jsx10("div", {}),
|
|
1420
|
+
/* @__PURE__ */ jsx10("div", {})
|
|
1332
1421
|
] })
|
|
1333
1422
|
}
|
|
1334
1423
|
);
|
|
@@ -1336,11 +1425,11 @@ var Spinner = ({ size = null, className, testId = CN2 }) => {
|
|
|
1336
1425
|
var Spinner_default = Spinner;
|
|
1337
1426
|
|
|
1338
1427
|
// src/Atomic/UI/DynamicIcon/DynamicIcon.tsx
|
|
1339
|
-
import { jsx as
|
|
1340
|
-
import { useEffect as
|
|
1428
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1429
|
+
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
1341
1430
|
var DynamicIcon = ({ iconKey, ...props }) => {
|
|
1342
|
-
const [Icon2, setIcon] =
|
|
1343
|
-
|
|
1431
|
+
const [Icon2, setIcon] = useState3(null);
|
|
1432
|
+
useEffect4(() => {
|
|
1344
1433
|
const fetchData = async () => {
|
|
1345
1434
|
const FeatherIcons = await import("react-feather");
|
|
1346
1435
|
const iconComponent = FeatherIcons[iconKey];
|
|
@@ -1348,21 +1437,21 @@ var DynamicIcon = ({ iconKey, ...props }) => {
|
|
|
1348
1437
|
};
|
|
1349
1438
|
fetchData();
|
|
1350
1439
|
}, [iconKey]);
|
|
1351
|
-
return Icon2 ? /* @__PURE__ */
|
|
1440
|
+
return Icon2 ? /* @__PURE__ */ jsx11(Icon2, { ...props }) : null;
|
|
1352
1441
|
};
|
|
1353
1442
|
var DynamicIcon_default = DynamicIcon;
|
|
1354
1443
|
|
|
1355
1444
|
// src/Atomic/FormElements/Input/hooks/useErrorBlink.ts
|
|
1356
|
-
import { useEffect as
|
|
1445
|
+
import { useEffect as useEffect5, useState as useState4 } from "react";
|
|
1357
1446
|
var DEFAULT_BLINK_TIME = 100;
|
|
1358
1447
|
function useErrorBlink({
|
|
1359
1448
|
isUseErrorsBlink,
|
|
1360
1449
|
blinkTime = DEFAULT_BLINK_TIME
|
|
1361
1450
|
}) {
|
|
1362
|
-
const [isAttemptToChange, setIsAttemptToChange] =
|
|
1363
|
-
const [isToHighlightError, setIsToHighlightError] =
|
|
1364
|
-
const [prevValue, setPreviousValue] =
|
|
1365
|
-
|
|
1451
|
+
const [isAttemptToChange, setIsAttemptToChange] = useState4(false);
|
|
1452
|
+
const [isToHighlightError, setIsToHighlightError] = useState4(false);
|
|
1453
|
+
const [prevValue, setPreviousValue] = useState4("");
|
|
1454
|
+
useEffect5(() => {
|
|
1366
1455
|
if (!isAttemptToChange) return;
|
|
1367
1456
|
let timerId = null;
|
|
1368
1457
|
setIsToHighlightError(true);
|
|
@@ -1411,19 +1500,19 @@ function useErrorBlink({
|
|
|
1411
1500
|
}
|
|
1412
1501
|
|
|
1413
1502
|
// src/Atomic/FormElements/Input/hooks/useInputFocus.ts
|
|
1414
|
-
import { useEffect as
|
|
1503
|
+
import { useEffect as useEffect6, useState as useState5 } from "react";
|
|
1415
1504
|
function useInputFocus({
|
|
1416
1505
|
isSelect,
|
|
1417
1506
|
isFocusDefault = false,
|
|
1418
1507
|
onFocus = () => {
|
|
1419
1508
|
}
|
|
1420
1509
|
}) {
|
|
1421
|
-
const [isFocused, setIsFocused] =
|
|
1422
|
-
const [isEditing, setEditing] =
|
|
1423
|
-
|
|
1510
|
+
const [isFocused, setIsFocused] = useState5(false);
|
|
1511
|
+
const [isEditing, setEditing] = useState5(false);
|
|
1512
|
+
useEffect6(() => {
|
|
1424
1513
|
setEditing(isSelect ?? false);
|
|
1425
1514
|
}, [isSelect]);
|
|
1426
|
-
|
|
1515
|
+
useEffect6(() => {
|
|
1427
1516
|
if (typeof isFocusDefault === "boolean") {
|
|
1428
1517
|
setIsFocused(isFocusDefault);
|
|
1429
1518
|
setEditing(isFocusDefault);
|
|
@@ -1447,9 +1536,9 @@ function useInputFocus({
|
|
|
1447
1536
|
}
|
|
1448
1537
|
|
|
1449
1538
|
// src/Atomic/FormElements/Input/hooks/useInputHover.ts
|
|
1450
|
-
import { useState as
|
|
1539
|
+
import { useState as useState6 } from "react";
|
|
1451
1540
|
function useInputHover() {
|
|
1452
|
-
const [onInputHover, setOnInputHover] =
|
|
1541
|
+
const [onInputHover, setOnInputHover] = useState6(false);
|
|
1453
1542
|
const handleMouseEnter = () => setOnInputHover(true);
|
|
1454
1543
|
const handleMouseLeave = () => setOnInputHover(false);
|
|
1455
1544
|
return {
|
|
@@ -1613,7 +1702,7 @@ function useInputValueProcessing({
|
|
|
1613
1702
|
}
|
|
1614
1703
|
|
|
1615
1704
|
// src/Atomic/FormElements/Input/hooks/useKeyboardHandling.ts
|
|
1616
|
-
import { useState as
|
|
1705
|
+
import { useState as useState7 } from "react";
|
|
1617
1706
|
function useKeyboardHandling({
|
|
1618
1707
|
onKeyDown,
|
|
1619
1708
|
onKeyUp,
|
|
@@ -1621,7 +1710,7 @@ function useKeyboardHandling({
|
|
|
1621
1710
|
setPreviousValue,
|
|
1622
1711
|
value
|
|
1623
1712
|
}) {
|
|
1624
|
-
const [keyDownData, setKeyDownData] =
|
|
1713
|
+
const [keyDownData, setKeyDownData] = useState7({
|
|
1625
1714
|
start: null,
|
|
1626
1715
|
end: null,
|
|
1627
1716
|
keyCode: null
|
|
@@ -1648,14 +1737,14 @@ function useKeyboardHandling({
|
|
|
1648
1737
|
}
|
|
1649
1738
|
|
|
1650
1739
|
// src/Atomic/FormElements/Input/Input.tsx
|
|
1651
|
-
import
|
|
1652
|
-
import { useEffect as
|
|
1740
|
+
import cn11 from "classnames";
|
|
1741
|
+
import { useEffect as useEffect7, useMemo as useMemo3, useRef as useRef2 } from "react";
|
|
1653
1742
|
function defaultCallback() {
|
|
1654
1743
|
}
|
|
1655
1744
|
function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defaultCallback, onBlur = defaultCallback, onFocus = defaultCallback, onKeyUp = defaultCallback, onKeyDown = defaultCallback, isNotBlinkErrors, isPriceInput, onlyNumbers, disabled, withDelete, value, placeholder, className, type = "text", mask, maskChar, formatChars, error, icon, iconDynamicKey, iconDynamicProps = {}, symbolsLimit, blinkTime, isFocusDefault = false, isNotValidateASCII = false, isNumericMobileKeyboard = false, isCropFirstNool = false, testId = "input", action, isUseAutoSelect = true, isReadOnly = false, isLoading = false, name, fieldKey, id, attributesOfNativeInput = {} }) {
|
|
1656
|
-
const DynamicIconComponent = iconDynamicKey && !icon ? /* @__PURE__ */
|
|
1745
|
+
const DynamicIconComponent = iconDynamicKey && !icon ? /* @__PURE__ */ jsx12(DynamicIcon_default, { iconKey: iconDynamicKey, ...iconDynamicProps }) : null;
|
|
1657
1746
|
const inputInnerRef = useRef2(null);
|
|
1658
|
-
const inputRef =
|
|
1747
|
+
const inputRef = useMemo3(() => ref || inputInnerRef, [ref]);
|
|
1659
1748
|
const isUseErrorsBlink = !isNotBlinkErrors && !mask;
|
|
1660
1749
|
const inputName = name || fieldKey || id;
|
|
1661
1750
|
const {
|
|
@@ -1720,7 +1809,7 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
|
|
|
1720
1809
|
setIsFocused(false);
|
|
1721
1810
|
setEditing(false);
|
|
1722
1811
|
};
|
|
1723
|
-
|
|
1812
|
+
useEffect7(() => {
|
|
1724
1813
|
if (isEditing) inputRef?.current?.focus?.();
|
|
1725
1814
|
}, [isEditing, isFocused]);
|
|
1726
1815
|
const getInputType = () => {
|
|
@@ -1729,7 +1818,7 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
|
|
|
1729
1818
|
};
|
|
1730
1819
|
const uniProps = {
|
|
1731
1820
|
name: inputName,
|
|
1732
|
-
className:
|
|
1821
|
+
className: cn11("input", className, {
|
|
1733
1822
|
"input--with-icon": icon,
|
|
1734
1823
|
"input--with-delete": withDelete
|
|
1735
1824
|
}),
|
|
@@ -1745,11 +1834,11 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
|
|
|
1745
1834
|
...maskChar ? { maskChar } : {},
|
|
1746
1835
|
...formatChars ? { formatChars } : {}
|
|
1747
1836
|
};
|
|
1748
|
-
return /* @__PURE__ */
|
|
1837
|
+
return /* @__PURE__ */ jsxs10(
|
|
1749
1838
|
"div",
|
|
1750
1839
|
{
|
|
1751
1840
|
"data-testid": testId,
|
|
1752
|
-
className:
|
|
1841
|
+
className: cn11(
|
|
1753
1842
|
`input__wrap`,
|
|
1754
1843
|
{ [`input__wrap_focus`]: isFocused },
|
|
1755
1844
|
{ [`input__wrap_error`]: error || isToHighlightError },
|
|
@@ -1758,7 +1847,7 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
|
|
|
1758
1847
|
onMouseEnter: handleMouseEnter,
|
|
1759
1848
|
onMouseLeave: handleMouseLeave,
|
|
1760
1849
|
children: [
|
|
1761
|
-
/* @__PURE__ */
|
|
1850
|
+
/* @__PURE__ */ jsx12(
|
|
1762
1851
|
"input",
|
|
1763
1852
|
{
|
|
1764
1853
|
readOnly: isReadOnly,
|
|
@@ -1780,14 +1869,14 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
|
|
|
1780
1869
|
),
|
|
1781
1870
|
DynamicIconComponent ?? icon,
|
|
1782
1871
|
action,
|
|
1783
|
-
withDelete && onInputHover && /* @__PURE__ */
|
|
1872
|
+
withDelete && onInputHover && /* @__PURE__ */ jsx12(
|
|
1784
1873
|
"span",
|
|
1785
1874
|
{
|
|
1786
|
-
className:
|
|
1875
|
+
className: cn11(`input__close`, { hidden: !getSafelyValue(value) }),
|
|
1787
1876
|
onClick: handleToggleWithClear
|
|
1788
1877
|
}
|
|
1789
1878
|
),
|
|
1790
|
-
isLoading && /* @__PURE__ */
|
|
1879
|
+
isLoading && /* @__PURE__ */ jsx12(Spinner_default, { size: "small" })
|
|
1791
1880
|
]
|
|
1792
1881
|
}
|
|
1793
1882
|
);
|
|
@@ -1795,8 +1884,8 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
|
|
|
1795
1884
|
var Input_default = Input;
|
|
1796
1885
|
|
|
1797
1886
|
// src/Atomic/FormElements/RadioInput/RadioInput.tsx
|
|
1798
|
-
import { jsx as
|
|
1799
|
-
import
|
|
1887
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1888
|
+
import cn12 from "classnames";
|
|
1800
1889
|
var RC6 = "radio-input";
|
|
1801
1890
|
var RadioInput = ({
|
|
1802
1891
|
label,
|
|
@@ -1810,21 +1899,21 @@ var RadioInput = ({
|
|
|
1810
1899
|
onChange,
|
|
1811
1900
|
attributesOfNativeInput
|
|
1812
1901
|
}) => {
|
|
1813
|
-
return /* @__PURE__ */
|
|
1902
|
+
return /* @__PURE__ */ jsxs11(
|
|
1814
1903
|
"label",
|
|
1815
1904
|
{
|
|
1816
1905
|
"data-testid": testId,
|
|
1817
|
-
className:
|
|
1906
|
+
className: cn12(RC6, className, { [`${RC6}_disabled`]: disabled }),
|
|
1818
1907
|
htmlFor: id,
|
|
1819
1908
|
children: [
|
|
1820
|
-
/* @__PURE__ */
|
|
1909
|
+
/* @__PURE__ */ jsxs11(
|
|
1821
1910
|
"div",
|
|
1822
1911
|
{
|
|
1823
|
-
className:
|
|
1912
|
+
className: cn12(`${RC6}__input`, {
|
|
1824
1913
|
[`${RC6}__input--checked`]: checked === value
|
|
1825
1914
|
}),
|
|
1826
1915
|
children: [
|
|
1827
|
-
/* @__PURE__ */
|
|
1916
|
+
/* @__PURE__ */ jsx13(
|
|
1828
1917
|
"input",
|
|
1829
1918
|
{
|
|
1830
1919
|
id,
|
|
@@ -1838,11 +1927,11 @@ var RadioInput = ({
|
|
|
1838
1927
|
...attributesOfNativeInput
|
|
1839
1928
|
}
|
|
1840
1929
|
),
|
|
1841
|
-
/* @__PURE__ */
|
|
1930
|
+
/* @__PURE__ */ jsx13("div", { className: `${RC6}__mark` })
|
|
1842
1931
|
]
|
|
1843
1932
|
}
|
|
1844
1933
|
),
|
|
1845
|
-
label && /* @__PURE__ */
|
|
1934
|
+
label && /* @__PURE__ */ jsx13("div", { className: `${RC6}__label`, children: label })
|
|
1846
1935
|
]
|
|
1847
1936
|
}
|
|
1848
1937
|
);
|
|
@@ -1850,18 +1939,18 @@ var RadioInput = ({
|
|
|
1850
1939
|
var RadioInput_default = RadioInput;
|
|
1851
1940
|
|
|
1852
1941
|
// src/Atomic/FormElements/Dropdown/components/DropdownLoader.js
|
|
1853
|
-
import { jsx as
|
|
1854
|
-
import
|
|
1942
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1943
|
+
import React13 from "react";
|
|
1855
1944
|
var DropdownLoader = function({ variant = "" }) {
|
|
1856
|
-
return /* @__PURE__ */
|
|
1945
|
+
return /* @__PURE__ */ jsx14("div", { className: "dropdown-loader-box j5", children: /* @__PURE__ */ jsxs12(
|
|
1857
1946
|
"div",
|
|
1858
1947
|
{
|
|
1859
1948
|
className: `lds-ring${variant === "little" ? " lds-ring_little" : ""}`,
|
|
1860
1949
|
children: [
|
|
1861
|
-
/* @__PURE__ */
|
|
1862
|
-
/* @__PURE__ */
|
|
1863
|
-
/* @__PURE__ */
|
|
1864
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ jsx14("div", {}),
|
|
1951
|
+
/* @__PURE__ */ jsx14("div", {}),
|
|
1952
|
+
/* @__PURE__ */ jsx14("div", {}),
|
|
1953
|
+
/* @__PURE__ */ jsx14("div", {})
|
|
1865
1954
|
]
|
|
1866
1955
|
}
|
|
1867
1956
|
) });
|
|
@@ -1869,7 +1958,7 @@ var DropdownLoader = function({ variant = "" }) {
|
|
|
1869
1958
|
var DropdownLoader_default = DropdownLoader;
|
|
1870
1959
|
|
|
1871
1960
|
// src/Functions/useIsMobile/useIsMobile.ts
|
|
1872
|
-
import { useEffect as
|
|
1961
|
+
import { useEffect as useEffect8, useState as useState8 } from "react";
|
|
1873
1962
|
function useIsMobile({ isWithoutWidthCheck = false } = {}) {
|
|
1874
1963
|
const isIPad = () => {
|
|
1875
1964
|
const ua = navigator.userAgent || navigator.vendor || window.opera;
|
|
@@ -1880,8 +1969,8 @@ function useIsMobile({ isWithoutWidthCheck = false } = {}) {
|
|
|
1880
1969
|
const getIsMobile = () => {
|
|
1881
1970
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || isIPad();
|
|
1882
1971
|
};
|
|
1883
|
-
const [isMobile, setIsMobile] =
|
|
1884
|
-
|
|
1972
|
+
const [isMobile, setIsMobile] = useState8(getIsMobile());
|
|
1973
|
+
useEffect8(() => {
|
|
1885
1974
|
if (getIsMobile()) {
|
|
1886
1975
|
setIsMobile(true);
|
|
1887
1976
|
}
|
|
@@ -1969,59 +2058,59 @@ function getSortedOptions(data, sortAlphabetical = false) {
|
|
|
1969
2058
|
}
|
|
1970
2059
|
|
|
1971
2060
|
// src/Atomic/FormElements/Dropdown/useDropdown.tsx
|
|
1972
|
-
import { useMemo as
|
|
2061
|
+
import { useMemo as useMemo4, useRef as useRef3, useState as useState9 } from "react";
|
|
1973
2062
|
function useDropdown({ id, fieldKey, value, sortAlphabetical, withMobileLogic, options, minItemsForShowMobileSearch, isSearchable: isSearchableProp, isDoNotPullOutListOfMainContainer } = {}) {
|
|
1974
2063
|
const { isMobile: isMobileProp } = useIsMobile_default2();
|
|
1975
2064
|
const isMobile = isMobileProp && withMobileLogic;
|
|
1976
|
-
const [dropdownId] =
|
|
2065
|
+
const [dropdownId] = useState9(
|
|
1977
2066
|
(id || fieldKey || Math.random().toString(16).slice(2)).toString()
|
|
1978
2067
|
);
|
|
1979
|
-
const [isOpen, setIsOpen] =
|
|
1980
|
-
const [valueToApply, setValueToApplyState] =
|
|
2068
|
+
const [isOpen, setIsOpen] = useState9(false);
|
|
2069
|
+
const [valueToApply, setValueToApplyState] = useState9(null);
|
|
1981
2070
|
const valueToApplyRef = useRef3(null);
|
|
1982
2071
|
const setValueToApply = (value2) => {
|
|
1983
2072
|
valueToApplyRef.current = value2;
|
|
1984
2073
|
setValueToApplyState(value2);
|
|
1985
2074
|
};
|
|
1986
|
-
const [searchValue, setSearchValue] =
|
|
2075
|
+
const [searchValue, setSearchValue] = useState9();
|
|
1987
2076
|
const dropdownRef = useRef3(null);
|
|
1988
2077
|
const dropdownListRef = useRef3(null);
|
|
1989
2078
|
const dropdownFooterRef = useRef3(null);
|
|
1990
2079
|
const dropdownListWrapperRef = useRef3(null);
|
|
1991
2080
|
const searchInputRef = useRef3(null);
|
|
1992
2081
|
const wrapperRef = useRef3(null);
|
|
1993
|
-
const [initListHeight, setInitListHeight] =
|
|
1994
|
-
const [isSearchChanged, setIsSearchChanged] =
|
|
1995
|
-
const [isSearchInputFocused, setIsSearchInputFocused] =
|
|
1996
|
-
const [isScrollableList, setIsScrollableList] =
|
|
1997
|
-
const [isFixedMaxHeight, setIsFixedMaxHeight] =
|
|
1998
|
-
const [scrollTop, setScrollTop] =
|
|
1999
|
-
const [scrollHeight, setScrollHeight] =
|
|
2000
|
-
const [maxListContainerHeight, setMaxListContainerHeight] =
|
|
2001
|
-
const totalOptionsLength =
|
|
2002
|
-
const isSearchable =
|
|
2082
|
+
const [initListHeight, setInitListHeight] = useState9(null);
|
|
2083
|
+
const [isSearchChanged, setIsSearchChanged] = useState9(false);
|
|
2084
|
+
const [isSearchInputFocused, setIsSearchInputFocused] = useState9(false);
|
|
2085
|
+
const [isScrollableList, setIsScrollableList] = useState9(false);
|
|
2086
|
+
const [isFixedMaxHeight, setIsFixedMaxHeight] = useState9(false);
|
|
2087
|
+
const [scrollTop, setScrollTop] = useState9(0);
|
|
2088
|
+
const [scrollHeight, setScrollHeight] = useState9(1);
|
|
2089
|
+
const [maxListContainerHeight, setMaxListContainerHeight] = useState9(0);
|
|
2090
|
+
const totalOptionsLength = useMemo4(() => options ? getTotalOptions(options) : 0, [options]);
|
|
2091
|
+
const isSearchable = useMemo4(() => {
|
|
2003
2092
|
return isMobile ? totalOptionsLength > (minItemsForShowMobileSearch || MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH) : isSearchableProp;
|
|
2004
2093
|
}, [isMobile, isSearchableProp, totalOptionsLength, minItemsForShowMobileSearch, MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH]);
|
|
2005
|
-
const optionsWithOtherAtTheEnd =
|
|
2006
|
-
const filteredGroups =
|
|
2094
|
+
const optionsWithOtherAtTheEnd = useMemo4(() => moveOtherToEnd(options ?? []), [options]);
|
|
2095
|
+
const filteredGroups = useMemo4(() => optionsWithOtherAtTheEnd.map((item) => ({
|
|
2007
2096
|
...item,
|
|
2008
2097
|
items: !isSearchable || !isSearchChanged ? item?.items : item.items?.slice().filter(
|
|
2009
2098
|
(el) => el?.label?.toLowerCase().includes(searchValue?.toString()?.toLowerCase() || "") || !el?.value || el?.value === ""
|
|
2010
2099
|
)
|
|
2011
2100
|
})).filter((item) => (item.items?.length ?? 0) > 0), [optionsWithOtherAtTheEnd, searchValue, isSearchable, isSearchChanged]);
|
|
2012
|
-
const filteredItems =
|
|
2101
|
+
const filteredItems = useMemo4(() => optionsWithOtherAtTheEnd.filter((item) => !item.items?.length).filter((item) => {
|
|
2013
2102
|
if (!isSearchable || !isSearchChanged) return true;
|
|
2014
2103
|
return item?.label?.toLowerCase().includes(searchValue?.toString()?.toLowerCase() || "") || !item?.value || item?.value === "";
|
|
2015
2104
|
}), [optionsWithOtherAtTheEnd, searchValue, isSearchable, isSearchChanged]);
|
|
2016
|
-
const filteredOptions =
|
|
2017
|
-
const selectedLabel =
|
|
2105
|
+
const filteredOptions = useMemo4(() => [...filteredItems, ...filteredGroups], [filteredItems, filteredGroups]);
|
|
2106
|
+
const selectedLabel = useMemo4(() => options?.find((el) => el.value === value)?.label ?? options?.reduce(
|
|
2018
2107
|
(acc, item) => {
|
|
2019
2108
|
if (!acc?.length) return item.items?.find((el) => el.value === value)?.label ?? "";
|
|
2020
2109
|
return acc;
|
|
2021
2110
|
},
|
|
2022
2111
|
""
|
|
2023
2112
|
), [options, value]);
|
|
2024
|
-
const postfixText =
|
|
2113
|
+
const postfixText = useMemo4(() => selectedLabel && filteredOptions.find((option) => option.value === value)?.postfix || null, [selectedLabel, filteredOptions, value]);
|
|
2025
2114
|
return {
|
|
2026
2115
|
isMobile,
|
|
2027
2116
|
dropdownId,
|
|
@@ -2071,12 +2160,12 @@ function useDropdown({ id, fieldKey, value, sortAlphabetical, withMobileLogic, o
|
|
|
2071
2160
|
var useDropdown_default = useDropdown;
|
|
2072
2161
|
|
|
2073
2162
|
// src/Atomic/FormElements/Dropdown/Dropdown.tsx
|
|
2074
|
-
import
|
|
2163
|
+
import cn13 from "classnames";
|
|
2075
2164
|
import {
|
|
2076
2165
|
useCallback,
|
|
2077
|
-
useEffect as
|
|
2166
|
+
useEffect as useEffect9,
|
|
2078
2167
|
useLayoutEffect,
|
|
2079
|
-
useMemo as
|
|
2168
|
+
useMemo as useMemo5
|
|
2080
2169
|
} from "react";
|
|
2081
2170
|
import { createPortal } from "react-dom";
|
|
2082
2171
|
import { Check, ChevronDown, ChevronUp, Code, X } from "react-feather";
|
|
@@ -2328,16 +2417,16 @@ function Dropdown({
|
|
|
2328
2417
|
options: getDependsTrigger ? newOptions : options
|
|
2329
2418
|
};
|
|
2330
2419
|
};
|
|
2331
|
-
const modalBtnTrigger =
|
|
2332
|
-
const depend =
|
|
2420
|
+
const modalBtnTrigger = useMemo5(() => entity && entity !== "" && typeof entity === "string", [entity]);
|
|
2421
|
+
const depend = useMemo5(() => getDepends(modalBtnTrigger), [modalBtnTrigger, filteredOptions]);
|
|
2333
2422
|
const getMarkupForElement = (item, _index, optTestId) => {
|
|
2334
|
-
return /* @__PURE__ */
|
|
2423
|
+
return /* @__PURE__ */ jsxs13(
|
|
2335
2424
|
"button",
|
|
2336
2425
|
{
|
|
2337
2426
|
type: "button",
|
|
2338
2427
|
"data-testid": `${testId}-${optTestId}-option`,
|
|
2339
2428
|
onMouseDown: () => depend.onChange(item),
|
|
2340
|
-
className:
|
|
2429
|
+
className: cn13(
|
|
2341
2430
|
`${RC7}__list-item`,
|
|
2342
2431
|
{
|
|
2343
2432
|
[`${RC7}__list-item_active`]: item.value === (valueToApply ?? value),
|
|
@@ -2347,19 +2436,19 @@ function Dropdown({
|
|
|
2347
2436
|
),
|
|
2348
2437
|
value: item?.value,
|
|
2349
2438
|
children: [
|
|
2350
|
-
!isMobile && /* @__PURE__ */
|
|
2439
|
+
!isMobile && /* @__PURE__ */ jsx15(
|
|
2351
2440
|
"span",
|
|
2352
2441
|
{
|
|
2353
|
-
className:
|
|
2442
|
+
className: cn13(`${RC7}__active-icon`, {
|
|
2354
2443
|
[`${RC7}__active-icon_active`]: item.value === value
|
|
2355
2444
|
}),
|
|
2356
|
-
children: /* @__PURE__ */
|
|
2445
|
+
children: /* @__PURE__ */ jsx15(Check, {})
|
|
2357
2446
|
}
|
|
2358
2447
|
),
|
|
2359
|
-
/* @__PURE__ */
|
|
2448
|
+
/* @__PURE__ */ jsx15(
|
|
2360
2449
|
"div",
|
|
2361
2450
|
{
|
|
2362
|
-
className:
|
|
2451
|
+
className: cn13(`${RC7}__list-item-label`, item.labelClassName || ""),
|
|
2363
2452
|
dangerouslySetInnerHTML: {
|
|
2364
2453
|
__html: getPreparedOptionLabel2(
|
|
2365
2454
|
item.label,
|
|
@@ -2370,19 +2459,19 @@ function Dropdown({
|
|
|
2370
2459
|
}
|
|
2371
2460
|
),
|
|
2372
2461
|
item?.icon || "",
|
|
2373
|
-
isMobile ? item?.customMobileIcon ?? /* @__PURE__ */
|
|
2462
|
+
isMobile ? item?.customMobileIcon ?? /* @__PURE__ */ jsx15(RadioInput_default, { value: item.value, checked: valueToApply ?? value }) : ""
|
|
2374
2463
|
]
|
|
2375
2464
|
},
|
|
2376
2465
|
item.value?.toString()?.replace(/ /g, "_")
|
|
2377
2466
|
);
|
|
2378
2467
|
};
|
|
2379
2468
|
const filteredOptionList = (filteredOption) => {
|
|
2380
|
-
return (filteredOption.items?.length ?? 0) > 0 ? /* @__PURE__ */
|
|
2469
|
+
return (filteredOption.items?.length ?? 0) > 0 ? /* @__PURE__ */ jsxs13(
|
|
2381
2470
|
"div",
|
|
2382
2471
|
{
|
|
2383
|
-
className:
|
|
2472
|
+
className: cn13(`${RC7}-group`, filteredOption.className),
|
|
2384
2473
|
children: [
|
|
2385
|
-
/* @__PURE__ */
|
|
2474
|
+
/* @__PURE__ */ jsx15("div", { className: `${RC7}-group__name`, children: filteredOption.label }),
|
|
2386
2475
|
filteredOption.items?.map(
|
|
2387
2476
|
(el, index) => getMarkupForElement(el, index, (el?.testId || index)?.toString())
|
|
2388
2477
|
)
|
|
@@ -2392,44 +2481,44 @@ function Dropdown({
|
|
|
2392
2481
|
) : null;
|
|
2393
2482
|
};
|
|
2394
2483
|
const getListMarkUp = () => {
|
|
2395
|
-
return /* @__PURE__ */
|
|
2484
|
+
return /* @__PURE__ */ jsx15(
|
|
2396
2485
|
"div",
|
|
2397
2486
|
{
|
|
2398
2487
|
"data-testid": `${testId}-container-wrapper`,
|
|
2399
|
-
className:
|
|
2488
|
+
className: cn13(`${RC7}__container-wrapper`),
|
|
2400
2489
|
ref: wrapperRef,
|
|
2401
2490
|
onClick: isMobile ? onWrapperClick : () => {
|
|
2402
2491
|
},
|
|
2403
|
-
children: /* @__PURE__ */
|
|
2492
|
+
children: /* @__PURE__ */ jsxs13(
|
|
2404
2493
|
"div",
|
|
2405
2494
|
{
|
|
2406
|
-
className:
|
|
2495
|
+
className: cn13(`${RC7}__list-wrapper`, {
|
|
2407
2496
|
[`${RC7}__list-wrapper--fixed-height`]: isFixedMaxHeight,
|
|
2408
2497
|
[`${RC7}__list-wrapper--with-bottom-shadow`]: isScrollableList && isMobile && !footerContent,
|
|
2409
2498
|
[`${RC7}__list-wrapper--with-bottom-shadow-hidden`]: scrollTop === scrollHeight && !footerContent
|
|
2410
2499
|
}),
|
|
2411
2500
|
ref: dropdownListWrapperRef,
|
|
2412
2501
|
children: [
|
|
2413
|
-
isMobile && /* @__PURE__ */
|
|
2502
|
+
isMobile && /* @__PURE__ */ jsxs13(
|
|
2414
2503
|
"div",
|
|
2415
2504
|
{
|
|
2416
|
-
className:
|
|
2505
|
+
className: cn13(`${RC7}__list-header`, {
|
|
2417
2506
|
[`${RC7}__list-header-with-shadow`]: isScrollableList && isMobile,
|
|
2418
2507
|
[`${RC7}__list-header-with-shadow-hidden`]: scrollTop === 0
|
|
2419
2508
|
}),
|
|
2420
2509
|
children: [
|
|
2421
|
-
/* @__PURE__ */
|
|
2422
|
-
/* @__PURE__ */
|
|
2423
|
-
/* @__PURE__ */
|
|
2510
|
+
/* @__PURE__ */ jsxs13("div", { className: cn13(`${RC7}__list-header-row`), children: [
|
|
2511
|
+
/* @__PURE__ */ jsx15("div", { className: cn13(`${RC7}__list-label`), children: label }),
|
|
2512
|
+
/* @__PURE__ */ jsx15(
|
|
2424
2513
|
"div",
|
|
2425
2514
|
{
|
|
2426
|
-
className:
|
|
2515
|
+
className: cn13(`${RC7}__list-close-icon`),
|
|
2427
2516
|
onClick: onCancelClick,
|
|
2428
|
-
children: /* @__PURE__ */
|
|
2517
|
+
children: /* @__PURE__ */ jsx15(X, { onClick: onCancelClick })
|
|
2429
2518
|
}
|
|
2430
2519
|
)
|
|
2431
2520
|
] }),
|
|
2432
|
-
isSearchable && /* @__PURE__ */
|
|
2521
|
+
isSearchable && /* @__PURE__ */ jsx15("div", { className: cn13(`${RC7}__list-header-row`), children: /* @__PURE__ */ jsx15(
|
|
2433
2522
|
Input_default,
|
|
2434
2523
|
{
|
|
2435
2524
|
ref: searchInputRef,
|
|
@@ -2445,10 +2534,10 @@ function Dropdown({
|
|
|
2445
2534
|
]
|
|
2446
2535
|
}
|
|
2447
2536
|
),
|
|
2448
|
-
/* @__PURE__ */
|
|
2537
|
+
/* @__PURE__ */ jsxs13(
|
|
2449
2538
|
"div",
|
|
2450
2539
|
{
|
|
2451
|
-
className:
|
|
2540
|
+
className: cn13(`${RC7}__list`, {
|
|
2452
2541
|
[`${RC7}__list-top`]: isListTop,
|
|
2453
2542
|
[`${RC7}__list--with-footer`]: footerContent
|
|
2454
2543
|
}),
|
|
@@ -2471,16 +2560,16 @@ function Dropdown({
|
|
|
2471
2560
|
}
|
|
2472
2561
|
return null;
|
|
2473
2562
|
}),
|
|
2474
|
-
!filteredItems?.length && !filteredGroups?.length && /* @__PURE__ */
|
|
2475
|
-
disabled && isOpen && /* @__PURE__ */
|
|
2563
|
+
!filteredItems?.length && !filteredGroups?.length && /* @__PURE__ */ jsx15("div", { className: `${RC7}__list-item ${RC7}__list-item--no-options`, children: noOptionsText }),
|
|
2564
|
+
disabled && isOpen && /* @__PURE__ */ jsx15(DropdownLoader_default, {})
|
|
2476
2565
|
]
|
|
2477
2566
|
}
|
|
2478
2567
|
),
|
|
2479
|
-
footerContent && /* @__PURE__ */
|
|
2568
|
+
footerContent && /* @__PURE__ */ jsx15(
|
|
2480
2569
|
"div",
|
|
2481
2570
|
{
|
|
2482
2571
|
ref: dropdownFooterRef,
|
|
2483
|
-
className:
|
|
2572
|
+
className: cn13(`${RC7}__footer`, {
|
|
2484
2573
|
[`${RC7}__footer-with-shadow`]: isMobile && isScrollableList,
|
|
2485
2574
|
[`${RC7}__footer-with-shadow-hidden`]: scrollTop === scrollHeight
|
|
2486
2575
|
}),
|
|
@@ -2498,7 +2587,7 @@ function Dropdown({
|
|
|
2498
2587
|
if (!lc) return null;
|
|
2499
2588
|
return createPortal(getListMarkUp(), lc);
|
|
2500
2589
|
};
|
|
2501
|
-
|
|
2590
|
+
useEffect9(() => {
|
|
2502
2591
|
document.addEventListener("click", handleClickOutside, true);
|
|
2503
2592
|
return () => {
|
|
2504
2593
|
getListContainer2()?.remove();
|
|
@@ -2506,7 +2595,7 @@ function Dropdown({
|
|
|
2506
2595
|
document.removeEventListener("click", handleClickOutside, true);
|
|
2507
2596
|
};
|
|
2508
2597
|
}, []);
|
|
2509
|
-
|
|
2598
|
+
useEffect9(() => {
|
|
2510
2599
|
if (!isDoNotPullOutListOfMainContainer || dropdownRef.current) {
|
|
2511
2600
|
initListContainer();
|
|
2512
2601
|
if (isDefaultOpened && !isMobile || isDefaultOpenedMobile) setIsOpen(true);
|
|
@@ -2543,7 +2632,7 @@ function Dropdown({
|
|
|
2543
2632
|
isFixedMaxHeight,
|
|
2544
2633
|
options
|
|
2545
2634
|
]);
|
|
2546
|
-
|
|
2635
|
+
useEffect9(() => {
|
|
2547
2636
|
const fn = isOpen ? "addEventListener" : "removeEventListener";
|
|
2548
2637
|
cancelButtonRef?.current?.[fn]("click", onCancelClick, true);
|
|
2549
2638
|
applyButtonRef?.current?.[fn]("click", onApplyClick, true);
|
|
@@ -2559,7 +2648,7 @@ function Dropdown({
|
|
|
2559
2648
|
removeEventListener("scroll", doScrollCallback);
|
|
2560
2649
|
};
|
|
2561
2650
|
}, [isOpen, dropdownListRef]);
|
|
2562
|
-
|
|
2651
|
+
useEffect9(() => {
|
|
2563
2652
|
let timeout;
|
|
2564
2653
|
if (!searchValue && isSearchInputFocused && !isMobile) {
|
|
2565
2654
|
setSearchValue(selectedLabel);
|
|
@@ -2572,7 +2661,7 @@ function Dropdown({
|
|
|
2572
2661
|
clearTimeout(timeout);
|
|
2573
2662
|
};
|
|
2574
2663
|
}, [isSearchInputFocused]);
|
|
2575
|
-
|
|
2664
|
+
useEffect9(() => {
|
|
2576
2665
|
if (isOpen && !isSearchInputFocused && searchInputRef?.current && !isMobile)
|
|
2577
2666
|
searchInputRef.current?.focus();
|
|
2578
2667
|
if (isOpen) {
|
|
@@ -2589,7 +2678,7 @@ function Dropdown({
|
|
|
2589
2678
|
setSearchValue(null);
|
|
2590
2679
|
}
|
|
2591
2680
|
}, [isOpen]);
|
|
2592
|
-
|
|
2681
|
+
useEffect9(() => {
|
|
2593
2682
|
const dropdownListEl = getListContainer2()?.getElementsByClassName("dropdown__list")[0];
|
|
2594
2683
|
if (!isMobile && dropdownListEl) {
|
|
2595
2684
|
const handleWheel = (e) => {
|
|
@@ -2614,7 +2703,7 @@ function Dropdown({
|
|
|
2614
2703
|
return () => {
|
|
2615
2704
|
};
|
|
2616
2705
|
}, [isOpen, isMobile, getListContainer2()]);
|
|
2617
|
-
|
|
2706
|
+
useEffect9(() => {
|
|
2618
2707
|
if (isOpen && isMobile && dropdownListRef?.current && !searchValue) {
|
|
2619
2708
|
setIsScrollableList(
|
|
2620
2709
|
dropdownListRef?.current?.scrollHeight > dropdownListRef?.current?.clientHeight
|
|
@@ -2631,7 +2720,7 @@ function Dropdown({
|
|
|
2631
2720
|
dropdownListRef?.current?.scrollHeight,
|
|
2632
2721
|
dropdownListRef?.current?.clientHeight
|
|
2633
2722
|
]);
|
|
2634
|
-
|
|
2723
|
+
useEffect9(() => {
|
|
2635
2724
|
const setScrollTopValue = (e) => {
|
|
2636
2725
|
setScrollTop(Number.parseInt(e?.target?.scrollTop?.toString(), 10));
|
|
2637
2726
|
};
|
|
@@ -2647,7 +2736,7 @@ function Dropdown({
|
|
|
2647
2736
|
}
|
|
2648
2737
|
};
|
|
2649
2738
|
}, [isOpen, isMobile, dropdownListRef?.current]);
|
|
2650
|
-
|
|
2739
|
+
useEffect9(() => {
|
|
2651
2740
|
if (dropdownListRef?.current) {
|
|
2652
2741
|
setScrollHeight(
|
|
2653
2742
|
Number.parseInt(
|
|
@@ -2658,10 +2747,10 @@ function Dropdown({
|
|
|
2658
2747
|
}
|
|
2659
2748
|
}, [scrollTop, dropdownListRef?.current]);
|
|
2660
2749
|
if (!options) return null;
|
|
2661
|
-
return /* @__PURE__ */
|
|
2750
|
+
return /* @__PURE__ */ jsxs13(
|
|
2662
2751
|
"div",
|
|
2663
2752
|
{
|
|
2664
|
-
className:
|
|
2753
|
+
className: cn13(RC7, className, {
|
|
2665
2754
|
disabled,
|
|
2666
2755
|
[`${RC7}-mobile`]: isMobile,
|
|
2667
2756
|
[`${RC7}--focused`]: isOpen && !isMobile,
|
|
@@ -2671,12 +2760,12 @@ function Dropdown({
|
|
|
2671
2760
|
onKeyDown,
|
|
2672
2761
|
onKeyUp,
|
|
2673
2762
|
children: [
|
|
2674
|
-
/* @__PURE__ */
|
|
2763
|
+
/* @__PURE__ */ jsx15(
|
|
2675
2764
|
"button",
|
|
2676
2765
|
{
|
|
2677
2766
|
type: "button",
|
|
2678
2767
|
"data-testid": testId,
|
|
2679
|
-
className:
|
|
2768
|
+
className: cn13(`${RC7}__trigger`, "input__wrap", {
|
|
2680
2769
|
[`${RC7}__trigger--with-actions`]: withActions,
|
|
2681
2770
|
placeholder: value === null || value === void 0 || value === "",
|
|
2682
2771
|
error
|
|
@@ -2685,8 +2774,8 @@ function Dropdown({
|
|
|
2685
2774
|
onKeyDown,
|
|
2686
2775
|
onKeyUp,
|
|
2687
2776
|
tabIndex,
|
|
2688
|
-
children: customTrigger || /* @__PURE__ */
|
|
2689
|
-
isSearchable && !isMobile ? /* @__PURE__ */
|
|
2777
|
+
children: customTrigger || /* @__PURE__ */ jsxs13(Fragment, { children: [
|
|
2778
|
+
isSearchable && !isMobile ? /* @__PURE__ */ jsx15(
|
|
2690
2779
|
"input",
|
|
2691
2780
|
{
|
|
2692
2781
|
ref: searchInputRef,
|
|
@@ -2697,38 +2786,38 @@ function Dropdown({
|
|
|
2697
2786
|
onFocus: () => setIsSearchInputFocused(true),
|
|
2698
2787
|
onBlur: () => setIsSearchInputFocused(false)
|
|
2699
2788
|
}
|
|
2700
|
-
) : /* @__PURE__ */
|
|
2701
|
-
/* @__PURE__ */
|
|
2702
|
-
postfixText && /* @__PURE__ */
|
|
2789
|
+
) : /* @__PURE__ */ jsxs13(Fragment, { children: [
|
|
2790
|
+
/* @__PURE__ */ jsx15("span", { className: "text", children: selectedLabel || placeholder || "" }),
|
|
2791
|
+
postfixText && /* @__PURE__ */ jsx15("span", { className: "dropdown__list-item-postfix", children: postfixText })
|
|
2703
2792
|
] }),
|
|
2704
|
-
/* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ jsx15(
|
|
2705
2794
|
"span",
|
|
2706
2795
|
{
|
|
2707
|
-
className:
|
|
2796
|
+
className: cn13(`${RC7}__arrow`, {
|
|
2708
2797
|
[`${RC7}__arrow_active`]: isOpen
|
|
2709
2798
|
}),
|
|
2710
2799
|
onClick: toggleList,
|
|
2711
|
-
children: isMobile ? /* @__PURE__ */
|
|
2800
|
+
children: isMobile ? /* @__PURE__ */ jsx15(Code, { className: "mobile-icon" }) : isOpen ? /* @__PURE__ */ jsx15(ChevronUp, {}) : /* @__PURE__ */ jsx15(ChevronDown, {})
|
|
2712
2801
|
}
|
|
2713
2802
|
)
|
|
2714
2803
|
] })
|
|
2715
2804
|
}
|
|
2716
2805
|
),
|
|
2717
|
-
withActions && /* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
2806
|
+
withActions && /* @__PURE__ */ jsxs13("div", { className: cn13(`${RC7}__actions`), children: [
|
|
2807
|
+
/* @__PURE__ */ jsx15(
|
|
2719
2808
|
"div",
|
|
2720
2809
|
{
|
|
2721
|
-
className:
|
|
2810
|
+
className: cn13(`${RC7}__actions-item`),
|
|
2722
2811
|
onClick: onActionConfirmClick,
|
|
2723
|
-
children: /* @__PURE__ */
|
|
2812
|
+
children: /* @__PURE__ */ jsx15(Check, {})
|
|
2724
2813
|
}
|
|
2725
2814
|
),
|
|
2726
|
-
/* @__PURE__ */
|
|
2815
|
+
/* @__PURE__ */ jsx15(
|
|
2727
2816
|
"div",
|
|
2728
2817
|
{
|
|
2729
|
-
className:
|
|
2818
|
+
className: cn13(`${RC7}__actions-item`),
|
|
2730
2819
|
onClick: onActionCancelClick,
|
|
2731
|
-
children: /* @__PURE__ */
|
|
2820
|
+
children: /* @__PURE__ */ jsx15(X, {})
|
|
2732
2821
|
}
|
|
2733
2822
|
)
|
|
2734
2823
|
] }),
|
|
@@ -2740,15 +2829,15 @@ function Dropdown({
|
|
|
2740
2829
|
var Dropdown_default = Dropdown;
|
|
2741
2830
|
|
|
2742
2831
|
// src/Atomic/FormElements/Switcher/Switcher.tsx
|
|
2743
|
-
import { jsx as
|
|
2832
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2744
2833
|
|
|
2745
2834
|
// src/Atomic/UI/Hint/Hint.tsx
|
|
2746
|
-
import { Fragment as Fragment2, jsx as
|
|
2835
|
+
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2747
2836
|
|
|
2748
2837
|
// src/Molecular/CustomIcons/components/Check2.tsx
|
|
2749
|
-
import { jsx as
|
|
2838
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2750
2839
|
function Check2(props) {
|
|
2751
|
-
return /* @__PURE__ */
|
|
2840
|
+
return /* @__PURE__ */ jsx16(
|
|
2752
2841
|
"svg",
|
|
2753
2842
|
{
|
|
2754
2843
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2756,15 +2845,15 @@ function Check2(props) {
|
|
|
2756
2845
|
height: 16,
|
|
2757
2846
|
fill: "none",
|
|
2758
2847
|
...props,
|
|
2759
|
-
children: /* @__PURE__ */
|
|
2848
|
+
children: /* @__PURE__ */ jsx16("path", { stroke: "#000", d: "M13.333 4 6 11.333 2.667 8" })
|
|
2760
2849
|
}
|
|
2761
2850
|
);
|
|
2762
2851
|
}
|
|
2763
2852
|
|
|
2764
2853
|
// src/Molecular/CustomIcons/components/Email.tsx
|
|
2765
|
-
import { jsx as
|
|
2854
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2766
2855
|
function Email(props) {
|
|
2767
|
-
return /* @__PURE__ */
|
|
2856
|
+
return /* @__PURE__ */ jsxs14(
|
|
2768
2857
|
"svg",
|
|
2769
2858
|
{
|
|
2770
2859
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2773,7 +2862,7 @@ function Email(props) {
|
|
|
2773
2862
|
fill: "none",
|
|
2774
2863
|
...props,
|
|
2775
2864
|
children: [
|
|
2776
|
-
/* @__PURE__ */
|
|
2865
|
+
/* @__PURE__ */ jsxs14(
|
|
2777
2866
|
"mask",
|
|
2778
2867
|
{
|
|
2779
2868
|
id: "a",
|
|
@@ -2783,27 +2872,27 @@ function Email(props) {
|
|
|
2783
2872
|
y: 0,
|
|
2784
2873
|
maskUnits: "userSpaceOnUse",
|
|
2785
2874
|
children: [
|
|
2786
|
-
/* @__PURE__ */
|
|
2875
|
+
/* @__PURE__ */ jsx17(
|
|
2787
2876
|
"path",
|
|
2788
2877
|
{
|
|
2789
2878
|
stroke: "#000",
|
|
2790
2879
|
d: "M2.667 2.667h10.666c.734 0 1.334.6 1.334 1.333v8c0 .733-.6 1.333-1.334 1.333H2.667c-.734 0-1.334-.6-1.334-1.333V4c0-.733.6-1.333 1.334-1.333Z"
|
|
2791
2880
|
}
|
|
2792
2881
|
),
|
|
2793
|
-
/* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ jsx17("path", { stroke: "#000", d: "M14.667 4 8 8.667 1.333 4" })
|
|
2794
2883
|
]
|
|
2795
2884
|
}
|
|
2796
2885
|
),
|
|
2797
|
-
/* @__PURE__ */
|
|
2886
|
+
/* @__PURE__ */ jsx17("g", { mask: "url(#a)", children: /* @__PURE__ */ jsx17("path", { fill: "#1F7499", d: "M0 0h16v16H0z" }) })
|
|
2798
2887
|
]
|
|
2799
2888
|
}
|
|
2800
2889
|
);
|
|
2801
2890
|
}
|
|
2802
2891
|
|
|
2803
2892
|
// src/Molecular/CustomIcons/components/HelpCircleFilled.tsx
|
|
2804
|
-
import { jsx as
|
|
2893
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2805
2894
|
function HelpCircleFilled(props) {
|
|
2806
|
-
return /* @__PURE__ */
|
|
2895
|
+
return /* @__PURE__ */ jsxs15(
|
|
2807
2896
|
"svg",
|
|
2808
2897
|
{
|
|
2809
2898
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2812,14 +2901,14 @@ function HelpCircleFilled(props) {
|
|
|
2812
2901
|
fill: "none",
|
|
2813
2902
|
...props,
|
|
2814
2903
|
children: [
|
|
2815
|
-
/* @__PURE__ */
|
|
2904
|
+
/* @__PURE__ */ jsx18(
|
|
2816
2905
|
"path",
|
|
2817
2906
|
{
|
|
2818
2907
|
fill: "#9AA0B9",
|
|
2819
2908
|
d: "M8 14.667A6.667 6.667 0 1 0 8 1.333a6.667 6.667 0 0 0 0 13.334Z"
|
|
2820
2909
|
}
|
|
2821
2910
|
),
|
|
2822
|
-
/* @__PURE__ */
|
|
2911
|
+
/* @__PURE__ */ jsx18(
|
|
2823
2912
|
"path",
|
|
2824
2913
|
{
|
|
2825
2914
|
stroke: "#fff",
|
|
@@ -2832,9 +2921,9 @@ function HelpCircleFilled(props) {
|
|
|
2832
2921
|
}
|
|
2833
2922
|
|
|
2834
2923
|
// src/Molecular/CustomIcons/components/Phone.tsx
|
|
2835
|
-
import { jsx as
|
|
2924
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2836
2925
|
function Phone(props) {
|
|
2837
|
-
return /* @__PURE__ */
|
|
2926
|
+
return /* @__PURE__ */ jsxs16(
|
|
2838
2927
|
"svg",
|
|
2839
2928
|
{
|
|
2840
2929
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2843,7 +2932,7 @@ function Phone(props) {
|
|
|
2843
2932
|
fill: "none",
|
|
2844
2933
|
...props,
|
|
2845
2934
|
children: [
|
|
2846
|
-
/* @__PURE__ */
|
|
2935
|
+
/* @__PURE__ */ jsx19(
|
|
2847
2936
|
"mask",
|
|
2848
2937
|
{
|
|
2849
2938
|
id: "a",
|
|
@@ -2852,7 +2941,7 @@ function Phone(props) {
|
|
|
2852
2941
|
x: 0,
|
|
2853
2942
|
y: 0,
|
|
2854
2943
|
maskUnits: "userSpaceOnUse",
|
|
2855
|
-
children: /* @__PURE__ */
|
|
2944
|
+
children: /* @__PURE__ */ jsx19(
|
|
2856
2945
|
"path",
|
|
2857
2946
|
{
|
|
2858
2947
|
stroke: "#000",
|
|
@@ -2861,7 +2950,7 @@ function Phone(props) {
|
|
|
2861
2950
|
)
|
|
2862
2951
|
}
|
|
2863
2952
|
),
|
|
2864
|
-
/* @__PURE__ */
|
|
2953
|
+
/* @__PURE__ */ jsx19("g", { mask: "url(#a)", children: /* @__PURE__ */ jsx19("path", { fill: "#1F7499", d: "M0 0h16v16H0z" }) })
|
|
2865
2954
|
]
|
|
2866
2955
|
}
|
|
2867
2956
|
);
|
|
@@ -2910,8 +2999,8 @@ function HandleClickOutsideObj(id, setIsOpen) {
|
|
|
2910
2999
|
}
|
|
2911
3000
|
|
|
2912
3001
|
// src/Atomic/UI/Hint/Hint.tsx
|
|
2913
|
-
import
|
|
2914
|
-
import { useEffect as
|
|
3002
|
+
import cn14 from "classnames";
|
|
3003
|
+
import { useEffect as useEffect10, useRef as useRef4, useState as useState10 } from "react";
|
|
2915
3004
|
import { createPortal as createPortal2 } from "react-dom";
|
|
2916
3005
|
import { AlertTriangle, HelpCircle } from "react-feather";
|
|
2917
3006
|
var hintTimeoutMap = /* @__PURE__ */ new Map();
|
|
@@ -2940,12 +3029,12 @@ var Hint = ({
|
|
|
2940
3029
|
isCloseOnChildrenClick = false
|
|
2941
3030
|
}) => {
|
|
2942
3031
|
const hintRef = useRef4(null);
|
|
2943
|
-
const [hintId] =
|
|
2944
|
-
const [iAmOpenedOptions] =
|
|
2945
|
-
const [isOpen, setIsOpen] =
|
|
2946
|
-
const [isStyleComputed, setIsStyleComputed] =
|
|
2947
|
-
const [handleScroll] =
|
|
2948
|
-
const [handleClickOutside] =
|
|
3032
|
+
const [hintId] = useState10(id ?? key ?? Math.random().toString(16).slice(2));
|
|
3033
|
+
const [iAmOpenedOptions] = useState10({ ...I_AM_OPENED_EVENT_OPTIONS, detail: { hintId } });
|
|
3034
|
+
const [isOpen, setIsOpen] = useState10(false);
|
|
3035
|
+
const [isStyleComputed, setIsStyleComputed] = useState10(false);
|
|
3036
|
+
const [handleScroll] = useState10(new HandleScrollObj(setIsOpen));
|
|
3037
|
+
const [handleClickOutside] = useState10(new HandleClickOutsideObj(hintId, setIsOpen));
|
|
2949
3038
|
const isCallbackExist = typeof onClickCallback === "function";
|
|
2950
3039
|
const handle = {
|
|
2951
3040
|
onMouseEnter: () => {
|
|
@@ -2995,11 +3084,11 @@ var Hint = ({
|
|
|
2995
3084
|
}
|
|
2996
3085
|
};
|
|
2997
3086
|
const getHintMarkUp = (className2) => {
|
|
2998
|
-
return /* @__PURE__ */
|
|
3087
|
+
return /* @__PURE__ */ jsxs17(
|
|
2999
3088
|
"div",
|
|
3000
3089
|
{
|
|
3001
3090
|
"data-testid": "test-hint-text",
|
|
3002
|
-
className:
|
|
3091
|
+
className: cn14("hint__text", `hint__text_${side}`, `hint--${className2}__text`),
|
|
3003
3092
|
onMouseEnter: () => {
|
|
3004
3093
|
if (isHoverableContent) isContentHoveredOuter = true;
|
|
3005
3094
|
},
|
|
@@ -3007,7 +3096,7 @@ var Hint = ({
|
|
|
3007
3096
|
onClick: handle.onClick,
|
|
3008
3097
|
style: { visibility: isStyleComputed ? "visible" : "hidden" },
|
|
3009
3098
|
children: [
|
|
3010
|
-
isLoading && /* @__PURE__ */
|
|
3099
|
+
isLoading && /* @__PURE__ */ jsx20(Spinner_default, { size: "small" }),
|
|
3011
3100
|
hint,
|
|
3012
3101
|
children
|
|
3013
3102
|
]
|
|
@@ -3064,7 +3153,7 @@ var Hint = ({
|
|
|
3064
3153
|
if (!hc) return null;
|
|
3065
3154
|
return createPortal2(getHintMarkUp(className2), hc);
|
|
3066
3155
|
};
|
|
3067
|
-
|
|
3156
|
+
useEffect10(() => {
|
|
3068
3157
|
initHintContainer(hintId, hintContainer);
|
|
3069
3158
|
const iAmOpenedCallback = (ev) => {
|
|
3070
3159
|
const event = ev;
|
|
@@ -3090,7 +3179,7 @@ var Hint = ({
|
|
|
3090
3179
|
}
|
|
3091
3180
|
};
|
|
3092
3181
|
}, []);
|
|
3093
|
-
|
|
3182
|
+
useEffect10(() => {
|
|
3094
3183
|
setIsStyleComputed(false);
|
|
3095
3184
|
setHintContainerStyles();
|
|
3096
3185
|
onOpenChange?.(isOpen);
|
|
@@ -3109,8 +3198,8 @@ var Hint = ({
|
|
|
3109
3198
|
}
|
|
3110
3199
|
};
|
|
3111
3200
|
}, [isOpen]);
|
|
3112
|
-
return /* @__PURE__ */
|
|
3113
|
-
/* @__PURE__ */
|
|
3201
|
+
return /* @__PURE__ */ jsxs17("div", { "data-testid": testId, className: cn14("hint", className), ref: hintRef, children: [
|
|
3202
|
+
/* @__PURE__ */ jsxs17(
|
|
3114
3203
|
"button",
|
|
3115
3204
|
{
|
|
3116
3205
|
tabIndex: isAccessability ? 0 : -1,
|
|
@@ -3119,14 +3208,14 @@ var Hint = ({
|
|
|
3119
3208
|
onClick: () => handleOpenType === "click" && (isCallbackExist ? onClickCallback?.() : setIsOpen(!isOpen)),
|
|
3120
3209
|
onMouseEnter: handle.onMouseEnter,
|
|
3121
3210
|
onMouseLeave: handle.onMouseLeave,
|
|
3122
|
-
className:
|
|
3211
|
+
className: cn14("hint__button", { hint__button_active: isOpen }),
|
|
3123
3212
|
children: [
|
|
3124
|
-
icon || icon === null || /* @__PURE__ */
|
|
3125
|
-
variant === "outlined" && /* @__PURE__ */
|
|
3126
|
-
variant === "filled" && /* @__PURE__ */
|
|
3127
|
-
variant === "warning" && /* @__PURE__ */
|
|
3213
|
+
icon || icon === null || /* @__PURE__ */ jsxs17(Fragment2, { children: [
|
|
3214
|
+
variant === "outlined" && /* @__PURE__ */ jsx20(HelpCircle, { width: 16, height: 16, className: "hint__icon outlined" }),
|
|
3215
|
+
variant === "filled" && /* @__PURE__ */ jsx20(HelpCircleFilled, { className: "hint__icon filled" }),
|
|
3216
|
+
variant === "warning" && /* @__PURE__ */ jsx20(AlertTriangle, { className: "hint__icon", color: "#F06D8D", width: 16, height: 16 })
|
|
3128
3217
|
] }),
|
|
3129
|
-
label && /* @__PURE__ */
|
|
3218
|
+
label && /* @__PURE__ */ jsx20("span", { className: cn14("hint__label", { "color--primary": isOpen }), children: typeof label === "string" ? capitalized(label) : label })
|
|
3130
3219
|
]
|
|
3131
3220
|
}
|
|
3132
3221
|
),
|
|
@@ -3136,7 +3225,7 @@ var Hint = ({
|
|
|
3136
3225
|
var Hint_default = Hint;
|
|
3137
3226
|
|
|
3138
3227
|
// src/Atomic/FormElements/Switcher/Switcher.tsx
|
|
3139
|
-
import
|
|
3228
|
+
import cn15 from "classnames";
|
|
3140
3229
|
var RC8 = "switcher";
|
|
3141
3230
|
var Switcher = ({
|
|
3142
3231
|
label,
|
|
@@ -3149,34 +3238,34 @@ var Switcher = ({
|
|
|
3149
3238
|
hintSide,
|
|
3150
3239
|
testId = "switcher"
|
|
3151
3240
|
}) => {
|
|
3152
|
-
return /* @__PURE__ */
|
|
3241
|
+
return /* @__PURE__ */ jsxs18(
|
|
3153
3242
|
"div",
|
|
3154
3243
|
{
|
|
3155
3244
|
"data-testid": testId,
|
|
3156
|
-
className:
|
|
3245
|
+
className: cn15(RC8, className, { [`${RC8}_disabled`]: disabled }),
|
|
3157
3246
|
children: [
|
|
3158
|
-
/* @__PURE__ */
|
|
3247
|
+
/* @__PURE__ */ jsxs18(
|
|
3159
3248
|
"button",
|
|
3160
3249
|
{
|
|
3161
3250
|
type: "button",
|
|
3162
3251
|
"data-testid": `${testId}-button`,
|
|
3163
|
-
className:
|
|
3252
|
+
className: cn15(`${RC8}__button`),
|
|
3164
3253
|
disabled,
|
|
3165
3254
|
onClick: (e) => onChange(!isActive, e),
|
|
3166
3255
|
children: [
|
|
3167
|
-
/* @__PURE__ */
|
|
3256
|
+
/* @__PURE__ */ jsx21(
|
|
3168
3257
|
"div",
|
|
3169
3258
|
{
|
|
3170
|
-
className:
|
|
3259
|
+
className: cn15(`${RC8}__button-content`, {
|
|
3171
3260
|
[`${RC8}__button-content_active`]: isActive
|
|
3172
3261
|
}),
|
|
3173
|
-
children: /* @__PURE__ */
|
|
3262
|
+
children: /* @__PURE__ */ jsx21("div", { className: `${RC8}__ball` })
|
|
3174
3263
|
}
|
|
3175
3264
|
),
|
|
3176
|
-
label && /* @__PURE__ */
|
|
3265
|
+
label && /* @__PURE__ */ jsx21(
|
|
3177
3266
|
"span",
|
|
3178
3267
|
{
|
|
3179
|
-
className:
|
|
3268
|
+
className: cn15(`${RC8}__label`, {
|
|
3180
3269
|
[`${RC8}__label_bold`]: isLabelBold
|
|
3181
3270
|
}),
|
|
3182
3271
|
children: label
|
|
@@ -3185,102 +3274,13 @@ var Switcher = ({
|
|
|
3185
3274
|
]
|
|
3186
3275
|
}
|
|
3187
3276
|
),
|
|
3188
|
-
hint && /* @__PURE__ */
|
|
3277
|
+
hint && /* @__PURE__ */ jsx21(Hint_default, { className: `${RC8}__hint`, hint, side: hintSide })
|
|
3189
3278
|
]
|
|
3190
3279
|
}
|
|
3191
3280
|
);
|
|
3192
3281
|
};
|
|
3193
3282
|
var Switcher_default = Switcher;
|
|
3194
3283
|
|
|
3195
|
-
// src/Atomic/FormElements/Datepicker/components/DatepickerCalendar.tsx
|
|
3196
|
-
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3197
|
-
import cn15 from "classnames";
|
|
3198
|
-
import moment3 from "moment";
|
|
3199
|
-
import { useEffect as useEffect10, useMemo as useMemo5, useState as useState10 } from "react";
|
|
3200
|
-
import * as Icon from "react-feather";
|
|
3201
|
-
var DatepickerCalendar = ({
|
|
3202
|
-
date,
|
|
3203
|
-
setDate,
|
|
3204
|
-
startDate,
|
|
3205
|
-
endDate,
|
|
3206
|
-
allowPrev = true,
|
|
3207
|
-
allowNext = true,
|
|
3208
|
-
onClick,
|
|
3209
|
-
onHover,
|
|
3210
|
-
startPrevDate,
|
|
3211
|
-
endPrevDate,
|
|
3212
|
-
limitRange
|
|
3213
|
-
}) => {
|
|
3214
|
-
const [days, setDays] = useState10({});
|
|
3215
|
-
const title = useMemo5(() => `${moment3(date).format("MMM")} ${moment3(date).format("YYYY")}`, [date]);
|
|
3216
|
-
useEffect10(() => {
|
|
3217
|
-
const result = {};
|
|
3218
|
-
const day = moment3(date).startOf("month");
|
|
3219
|
-
const daysInMonth = day.daysInMonth();
|
|
3220
|
-
for (let d = 0; d < daysInMonth; d++) {
|
|
3221
|
-
let week = day.week();
|
|
3222
|
-
if (day.month() === 11 && week === 1) week = 53;
|
|
3223
|
-
if (day.month() === 0 && week === 53) week = 0;
|
|
3224
|
-
if (!result[week]) result[week] = {};
|
|
3225
|
-
result[week][day.weekday()] = { date: day.toDate() };
|
|
3226
|
-
day.add(1, "d");
|
|
3227
|
-
}
|
|
3228
|
-
setDays(result);
|
|
3229
|
-
}, [date]);
|
|
3230
|
-
const renderDay = (week, dayOfWeek) => {
|
|
3231
|
-
const day = days[+week]?.[dayOfWeek];
|
|
3232
|
-
const isFutureDay = day && moment3(day.date).isAfter(moment3(), "day");
|
|
3233
|
-
const isPastDay = limitRange ? day && moment3(day.date).isBefore(moment3().subtract(limitRange, "days"), "day") : null;
|
|
3234
|
-
const isRangeEnd = day && (moment3(day.date).isSame(startDate, "day") || moment3(day.date).isSame(moment3(endDate).subtract(1, "hour"), "day"));
|
|
3235
|
-
const isRangeInside = day && startDate && endDate && moment3(day.date).isAfter(startDate, "day") && moment3(day.date).isBefore(moment3(endDate).subtract(1, "hour"), "day");
|
|
3236
|
-
const isPrevRangeEnd = day && (moment3(day.date).isSame(startPrevDate, "day") || moment3(day.date).isSame(moment3(endPrevDate).subtract(1, "day"), "day"));
|
|
3237
|
-
const isPrevRangeInside = day && startPrevDate && endPrevDate && moment3(day.date).isAfter(startPrevDate, "day") && moment3(day.date).isBefore(moment3(endPrevDate).subtract(1, "day"), "day");
|
|
3238
|
-
const classNames2 = cn15(
|
|
3239
|
-
"calendar__day",
|
|
3240
|
-
{ "calendar__day--clickable": day },
|
|
3241
|
-
{ "calendar__day--disabled": isFutureDay || isPastDay },
|
|
3242
|
-
{ "calendar__day--range-end": isRangeEnd },
|
|
3243
|
-
{ "calendar__day--range-inside": isRangeInside },
|
|
3244
|
-
{ "calendar__day--prev-range-end": isPrevRangeEnd },
|
|
3245
|
-
{ "calendar__day--prev-range-inside": isPrevRangeInside }
|
|
3246
|
-
);
|
|
3247
|
-
return /* @__PURE__ */ jsx21(
|
|
3248
|
-
"div",
|
|
3249
|
-
{
|
|
3250
|
-
className: classNames2,
|
|
3251
|
-
onClick: day && !isFutureDay ? () => onClick(day.date) : void 0,
|
|
3252
|
-
onMouseOver: day && !isFutureDay ? () => onHover(day.date) : void 0,
|
|
3253
|
-
onMouseLeave: () => onHover(null),
|
|
3254
|
-
children: day && day.date.getDate()
|
|
3255
|
-
},
|
|
3256
|
-
`${week}_${dayOfWeek}`
|
|
3257
|
-
);
|
|
3258
|
-
};
|
|
3259
|
-
const handlePrev = () => {
|
|
3260
|
-
setDate(moment3(date).subtract(1, "month").toDate());
|
|
3261
|
-
};
|
|
3262
|
-
const handleNext = () => {
|
|
3263
|
-
setDate(moment3(date).add(1, "month").toDate());
|
|
3264
|
-
};
|
|
3265
|
-
return /* @__PURE__ */ jsxs18("div", { className: "calendar", children: [
|
|
3266
|
-
/* @__PURE__ */ jsxs18("div", { className: "calendar-header", children: [
|
|
3267
|
-
/* @__PURE__ */ jsx21("div", { className: "calendar-header__prev", children: allowPrev && /* @__PURE__ */ jsx21("button", { type: "button", "data-testid": "datepicker-calendar-prev", onClick: handlePrev, "aria-label": "Previous month", children: /* @__PURE__ */ jsx21(Icon.ChevronLeft, { size: 16 }) }) }),
|
|
3268
|
-
/* @__PURE__ */ jsx21("div", { className: "calendar-header__title", children: title }),
|
|
3269
|
-
/* @__PURE__ */ jsx21("div", { className: "calendar-header__next", children: allowNext && /* @__PURE__ */ jsx21("button", { type: "button", "data-testid": "datepicker-calendar-next", onClick: handleNext, "aria-label": "Next month", children: /* @__PURE__ */ jsx21(Icon.ChevronRight, { size: 16 }) }) })
|
|
3270
|
-
] }),
|
|
3271
|
-
/* @__PURE__ */ jsx21("div", { className: "calendar__week", children: Array.from({ length: 7 }, (_, dayOfWeek) => /* @__PURE__ */ jsx21(
|
|
3272
|
-
"div",
|
|
3273
|
-
{
|
|
3274
|
-
className: "calendar__day calendar__day--title",
|
|
3275
|
-
children: moment3().weekday(dayOfWeek).format("dd").charAt(0)
|
|
3276
|
-
},
|
|
3277
|
-
`day-of-week_${dayOfWeek}`
|
|
3278
|
-
)) }),
|
|
3279
|
-
Object.keys(days).map((week, index) => /* @__PURE__ */ jsx21("div", { className: "calendar__week", children: Array.from({ length: 7 }, (_, dayOfWeek) => renderDay(week, dayOfWeek)) }, `week_${index}`))
|
|
3280
|
-
] });
|
|
3281
|
-
};
|
|
3282
|
-
var DatepickerCalendar_default = DatepickerCalendar;
|
|
3283
|
-
|
|
3284
3284
|
// src/Atomic/FormElements/Datepicker/Datepicker.tsx
|
|
3285
3285
|
import cn16 from "classnames";
|
|
3286
3286
|
import moment4 from "moment";
|
|
@@ -3608,6 +3608,9 @@ var Datepicker = ({
|
|
|
3608
3608
|
};
|
|
3609
3609
|
var Datepicker_default = Datepicker;
|
|
3610
3610
|
|
|
3611
|
+
// src/Atomic/FormElements/Dropdown/index.ts
|
|
3612
|
+
var Dropdown_default2 = Dropdown_default;
|
|
3613
|
+
|
|
3611
3614
|
// src/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.tsx
|
|
3612
3615
|
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3613
3616
|
|
|
@@ -5740,6 +5743,12 @@ var FormattedRawSSN = ({
|
|
|
5740
5743
|
};
|
|
5741
5744
|
var FormattedRawSSN_default = FormattedRawSSN;
|
|
5742
5745
|
|
|
5746
|
+
// src/Atomic/FormElements/FormattedRawSSN/index.ts
|
|
5747
|
+
var FormattedRawSSN_default2 = FormattedRawSSN_default;
|
|
5748
|
+
|
|
5749
|
+
// src/Atomic/FormElements/Input/index.ts
|
|
5750
|
+
var Input_default2 = Input_default;
|
|
5751
|
+
|
|
5743
5752
|
// src/Atomic/FormElements/InputCalendar/InputCalendar.tsx
|
|
5744
5753
|
import { jsx as jsx34, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5745
5754
|
|
|
@@ -5941,6 +5950,9 @@ var InputColor = ({
|
|
|
5941
5950
|
};
|
|
5942
5951
|
var InputColor_default = InputColor;
|
|
5943
5952
|
|
|
5953
|
+
// src/Atomic/FormElements/InputColor/index.ts
|
|
5954
|
+
var InputColor_default2 = InputColor_default;
|
|
5955
|
+
|
|
5944
5956
|
// src/Atomic/FormElements/InputCurrency/InputCurrency.tsx
|
|
5945
5957
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
5946
5958
|
import cn29 from "classnames";
|
|
@@ -6094,196 +6106,92 @@ var InputCurrency = ({
|
|
|
6094
6106
|
InputCurrency.displayName = "InputCurrency";
|
|
6095
6107
|
var InputCurrency_default = InputCurrency;
|
|
6096
6108
|
|
|
6097
|
-
// src/Atomic/FormElements/InputDateRange/
|
|
6109
|
+
// src/Atomic/FormElements/InputDateRange/components/DateInput.tsx
|
|
6110
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
6111
|
+
|
|
6112
|
+
// src/Functions/presets/mobileKeyboardTypesPresets.js
|
|
6113
|
+
var ALL_KEYBOARD_TYPES = {
|
|
6114
|
+
numeric: { inputMode: "decimal" },
|
|
6115
|
+
email: { inputMode: "email" }
|
|
6116
|
+
};
|
|
6117
|
+
var NUMERIC_KEYBOARD = {
|
|
6118
|
+
attributesOfNativeInput: ALL_KEYBOARD_TYPES.numeric
|
|
6119
|
+
};
|
|
6120
|
+
var EMAIL_KEYBOARD = {
|
|
6121
|
+
attributesOfNativeInput: ALL_KEYBOARD_TYPES.email
|
|
6122
|
+
};
|
|
6123
|
+
|
|
6124
|
+
// src/Atomic/FormElements/InputDateRange/components/DateInput.tsx
|
|
6125
|
+
import cn30 from "classnames";
|
|
6098
6126
|
import moment6 from "moment-timezone";
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
const
|
|
6103
|
-
const
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
} else {
|
|
6107
|
-
return !ref.current?.contains(target);
|
|
6108
|
-
}
|
|
6109
|
-
};
|
|
6110
|
-
const handleClickOutside = useCallback4(
|
|
6111
|
-
(e) => {
|
|
6112
|
-
const target = e.target;
|
|
6113
|
-
if (checkCondition(target)) hideComponent();
|
|
6114
|
-
},
|
|
6115
|
-
[hideComponent]
|
|
6116
|
-
);
|
|
6117
|
-
useEffect22(() => {
|
|
6118
|
-
if (!onlyGetRef) {
|
|
6119
|
-
document.addEventListener("mousedown", handleClickOutside, true);
|
|
6120
|
-
return () => {
|
|
6121
|
-
document.removeEventListener("mousedown", handleClickOutside, true);
|
|
6122
|
-
};
|
|
6123
|
-
}
|
|
6124
|
-
return () => {
|
|
6125
|
-
};
|
|
6126
|
-
}, []);
|
|
6127
|
-
return ref;
|
|
6128
|
-
}
|
|
6129
|
-
function useToggle(initialState) {
|
|
6130
|
-
const [isToggled, setToggle] = useState23(Boolean(initialState));
|
|
6131
|
-
const toggle = useCallback4(() => setToggle((isOn) => !isOn), []);
|
|
6132
|
-
const toggleOn = useCallback4(() => setToggle(true), []);
|
|
6133
|
-
const toggleOff = useCallback4(() => setToggle(false), []);
|
|
6134
|
-
return {
|
|
6135
|
-
isToggled,
|
|
6136
|
-
toggle,
|
|
6137
|
-
toggleOn,
|
|
6138
|
-
toggleOff
|
|
6139
|
-
};
|
|
6127
|
+
function handleDateInputOnChange(value) {
|
|
6128
|
+
const replace = (val) => val?.replace(/[^0-9/]/g, "");
|
|
6129
|
+
const input = replace(value);
|
|
6130
|
+
const lastSymbol = input ? input.slice(-1) : "";
|
|
6131
|
+
const previousValue = input ? input.slice(0, input.length - 1) : "";
|
|
6132
|
+
if (value.length > 10 || lastSymbol === "/") return previousValue;
|
|
6133
|
+
return previousValue.length === 2 || previousValue.length === 5 ? `${previousValue}/${lastSymbol}` : input;
|
|
6140
6134
|
}
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
label: "Last 30 Days",
|
|
6174
|
-
start: () => moment6().subtract(29, "day").startOf("day"),
|
|
6175
|
-
end: () => moment6().add(1, "day").startOf("day")
|
|
6176
|
-
},
|
|
6177
|
-
thisMonth: {
|
|
6178
|
-
label: "This Month",
|
|
6179
|
-
start: () => moment6().startOf("month"),
|
|
6180
|
-
end: () => moment6().add(1, "day").startOf("day")
|
|
6181
|
-
},
|
|
6182
|
-
lastMonth: {
|
|
6183
|
-
label: "Last Month",
|
|
6184
|
-
start: () => moment6().subtract(1, "month").startOf("month"),
|
|
6185
|
-
end: () => moment6().startOf("month")
|
|
6186
|
-
},
|
|
6187
|
-
last3Months: {
|
|
6188
|
-
label: "Last 3 Months",
|
|
6189
|
-
start: () => moment6().subtract(3, "month").startOf("month"),
|
|
6190
|
-
end: () => moment6().startOf("month")
|
|
6191
|
-
},
|
|
6192
|
-
last6Months: {
|
|
6193
|
-
label: "Last 6 Months",
|
|
6194
|
-
start: () => moment6().subtract(6, "month").startOf("month"),
|
|
6195
|
-
end: () => moment6().startOf("month")
|
|
6196
|
-
},
|
|
6197
|
-
sixMonths: {
|
|
6198
|
-
label: "6 Months",
|
|
6199
|
-
isHidden: true,
|
|
6200
|
-
start: () => moment6().subtract(6, "month"),
|
|
6201
|
-
end: () => moment6().add(1, "day").startOf("day")
|
|
6202
|
-
},
|
|
6203
|
-
thisYear: {
|
|
6204
|
-
label: "This Year",
|
|
6205
|
-
start: () => moment6().startOf("year"),
|
|
6206
|
-
end: () => moment6().add(1, "day").startOf("day")
|
|
6207
|
-
},
|
|
6208
|
-
year: {
|
|
6209
|
-
label: "Year",
|
|
6210
|
-
isHidden: true,
|
|
6211
|
-
start: () => moment6().subtract(1, "year"),
|
|
6212
|
-
end: () => moment6().add(1, "day").startOf("day")
|
|
6213
|
-
},
|
|
6214
|
-
lastYear: {
|
|
6215
|
-
label: "Last Year",
|
|
6216
|
-
start: () => moment6().subtract(1, "year").startOf("year"),
|
|
6217
|
-
end: () => moment6().startOf("year")
|
|
6218
|
-
},
|
|
6219
|
-
allTime: {
|
|
6220
|
-
label: "All Time",
|
|
6221
|
-
start: () => moment6("2022-01-01T00:00:00"),
|
|
6222
|
-
end: () => moment6()
|
|
6223
|
-
// start: () => null,
|
|
6224
|
-
// end: () => null,
|
|
6225
|
-
}
|
|
6226
|
-
};
|
|
6227
|
-
var ALL_TIME_KEY = "allTime";
|
|
6228
|
-
var CUSTOM_INTERVAL_KEY = "customDate";
|
|
6229
|
-
var CUSTOM_INTERVAL_KEY_TEXT = "Custom Date";
|
|
6230
|
-
var MAIN_FORMAT = "YYYY-MM-DDTHH:mm";
|
|
6231
|
-
var MAIN_DATE_FORMAT = "YYYY-MM-DD";
|
|
6232
|
-
var MAIN_TIME_FORMAT = "HH:mm";
|
|
6233
|
-
function getActualDateRange(inputDateRange) {
|
|
6234
|
-
const getActualIntervalKey = () => {
|
|
6235
|
-
if (inputDateRange?.intervalKey && Object.keys(INTERVALS).includes(inputDateRange.intervalKey)) {
|
|
6236
|
-
return inputDateRange.intervalKey;
|
|
6237
|
-
} else if (inputDateRange?.start && inputDateRange?.end) {
|
|
6238
|
-
for (const [key, interval2] of Object.entries(INTERVALS)) {
|
|
6239
|
-
if (moment6(inputDateRange.start).isSame(interval2.start()) && moment6(inputDateRange.end).isSame(interval2.end())) {
|
|
6240
|
-
return key;
|
|
6241
|
-
}
|
|
6242
|
-
}
|
|
6243
|
-
return CUSTOM_INTERVAL_KEY;
|
|
6244
|
-
}
|
|
6245
|
-
return ALL_TIME_KEY;
|
|
6246
|
-
};
|
|
6247
|
-
const getIntervalDate = (intervalKey) => {
|
|
6248
|
-
if (intervalKey === ALL_TIME_KEY || intervalKey === CUSTOM_INTERVAL_KEY) {
|
|
6249
|
-
return {
|
|
6250
|
-
start: null,
|
|
6251
|
-
end: null,
|
|
6252
|
-
compare: inputDateRange?.compare,
|
|
6253
|
-
startPrevDate: null,
|
|
6254
|
-
endPrevDate: null
|
|
6255
|
-
};
|
|
6135
|
+
function DateInput({ ref, ...props }) {
|
|
6136
|
+
const {
|
|
6137
|
+
RC: RC36,
|
|
6138
|
+
className,
|
|
6139
|
+
testId,
|
|
6140
|
+
isFocused,
|
|
6141
|
+
disabled,
|
|
6142
|
+
value,
|
|
6143
|
+
date,
|
|
6144
|
+
prepareDate,
|
|
6145
|
+
onChange,
|
|
6146
|
+
onFocus,
|
|
6147
|
+
onBlur,
|
|
6148
|
+
onKeyUp
|
|
6149
|
+
} = props;
|
|
6150
|
+
const preparedDate = (() => {
|
|
6151
|
+
const prepareDateDefault = (date2) => moment6(date2).format("MM/DD/YYYY");
|
|
6152
|
+
const output = prepareDate?.(date) ?? prepareDateDefault(date);
|
|
6153
|
+
return (output?.toString?.().toLowerCase() || "") !== "invalid date" ? output : "";
|
|
6154
|
+
})();
|
|
6155
|
+
return isFocused ? /* @__PURE__ */ jsx37(
|
|
6156
|
+
Input_default,
|
|
6157
|
+
{
|
|
6158
|
+
ref,
|
|
6159
|
+
testId,
|
|
6160
|
+
className: cn30(className, `${RC36}-interactive`),
|
|
6161
|
+
value,
|
|
6162
|
+
disabled,
|
|
6163
|
+
onChange: (value2) => onChange(handleDateInputOnChange(value2)),
|
|
6164
|
+
onBlur,
|
|
6165
|
+
onKeyUp,
|
|
6166
|
+
...NUMERIC_KEYBOARD
|
|
6256
6167
|
}
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
"hours"
|
|
6266
|
-
);
|
|
6267
|
-
actualValues.startPrevDate = moment6(actualValues.start).subtract(intervalHoursCount, "hours").toDate();
|
|
6268
|
-
actualValues.endPrevDate = actualValues.start;
|
|
6168
|
+
) : /* @__PURE__ */ jsx37(
|
|
6169
|
+
"div",
|
|
6170
|
+
{
|
|
6171
|
+
className: cn30(className, `${RC36}-emulation`, {
|
|
6172
|
+
[`${RC36}-emulation_disabled`]: disabled
|
|
6173
|
+
}),
|
|
6174
|
+
onClick: disabled ? void 0 : onFocus,
|
|
6175
|
+
children: /* @__PURE__ */ jsx37("span", { className: cn30(""), children: preparedDate })
|
|
6269
6176
|
}
|
|
6270
|
-
|
|
6271
|
-
};
|
|
6272
|
-
const interval = getActualIntervalKey();
|
|
6273
|
-
return interval !== CUSTOM_INTERVAL_KEY && interval !== ALL_TIME_KEY ? { intervalKey: interval, ...getIntervalDate(interval) } : { ...inputDateRange, intervalKey: interval };
|
|
6177
|
+
);
|
|
6274
6178
|
}
|
|
6179
|
+
var DateInput_default = DateInput;
|
|
6275
6180
|
|
|
6276
|
-
// src/Atomic/FormElements/InputDateRange/
|
|
6277
|
-
import { Fragment as
|
|
6181
|
+
// src/Atomic/FormElements/InputDateRange/components/Datepicker.tsx
|
|
6182
|
+
import { Fragment as Fragment8, jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
6183
|
+
|
|
6184
|
+
// src/Atomic/FormElements/RangeCalendar/RangeCalendar.js
|
|
6185
|
+
import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6278
6186
|
|
|
6279
6187
|
// src/Atomic/UI/Arrow/Arrow.tsx
|
|
6280
|
-
import { jsx as
|
|
6281
|
-
import
|
|
6282
|
-
import { useEffect as
|
|
6188
|
+
import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6189
|
+
import cn31 from "classnames";
|
|
6190
|
+
import { useEffect as useEffect22, useRef as useRef12, useState as useState23 } from "react";
|
|
6283
6191
|
function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
6284
|
-
const ref =
|
|
6285
|
-
const [color, setColor] =
|
|
6286
|
-
|
|
6192
|
+
const ref = useRef12(null);
|
|
6193
|
+
const [color, setColor] = useState23("currentColor");
|
|
6194
|
+
useEffect22(() => {
|
|
6287
6195
|
if (ref.current) {
|
|
6288
6196
|
setColor(getStyles(ref.current, "color"));
|
|
6289
6197
|
}
|
|
@@ -6303,7 +6211,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
|
6303
6211
|
height: "16",
|
|
6304
6212
|
viewBox: "0 0 16 16",
|
|
6305
6213
|
children: [
|
|
6306
|
-
/* @__PURE__ */
|
|
6214
|
+
/* @__PURE__ */ jsx38(
|
|
6307
6215
|
"path",
|
|
6308
6216
|
{
|
|
6309
6217
|
d: "M12.7,8H3.3",
|
|
@@ -6314,7 +6222,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
|
6314
6222
|
strokeLinejoin: "round"
|
|
6315
6223
|
}
|
|
6316
6224
|
),
|
|
6317
|
-
/* @__PURE__ */
|
|
6225
|
+
/* @__PURE__ */ jsx38(
|
|
6318
6226
|
"path",
|
|
6319
6227
|
{
|
|
6320
6228
|
d: "M8,3.3L3.3,8L8,12.7",
|
|
@@ -6329,7 +6237,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
|
6329
6237
|
}
|
|
6330
6238
|
);
|
|
6331
6239
|
}
|
|
6332
|
-
return /* @__PURE__ */
|
|
6240
|
+
return /* @__PURE__ */ jsx38(
|
|
6333
6241
|
"svg",
|
|
6334
6242
|
{
|
|
6335
6243
|
"data-testid": testId,
|
|
@@ -6338,7 +6246,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
|
6338
6246
|
viewBox: "0 0 24 24",
|
|
6339
6247
|
fill: "none",
|
|
6340
6248
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6341
|
-
children: /* @__PURE__ */
|
|
6249
|
+
children: /* @__PURE__ */ jsx38(
|
|
6342
6250
|
"path",
|
|
6343
6251
|
{
|
|
6344
6252
|
d: "M15 18L9 12L15 6",
|
|
@@ -6362,7 +6270,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
|
6362
6270
|
height: "16",
|
|
6363
6271
|
viewBox: "0 0 16 16",
|
|
6364
6272
|
children: [
|
|
6365
|
-
/* @__PURE__ */
|
|
6273
|
+
/* @__PURE__ */ jsx38(
|
|
6366
6274
|
"path",
|
|
6367
6275
|
{
|
|
6368
6276
|
d: "M3.3,8h9.3",
|
|
@@ -6373,7 +6281,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
|
6373
6281
|
strokeLinejoin: "round"
|
|
6374
6282
|
}
|
|
6375
6283
|
),
|
|
6376
|
-
/* @__PURE__ */
|
|
6284
|
+
/* @__PURE__ */ jsx38(
|
|
6377
6285
|
"path",
|
|
6378
6286
|
{
|
|
6379
6287
|
d: "M8,3.3L12.7,8L8,12.7",
|
|
@@ -6388,7 +6296,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
|
6388
6296
|
}
|
|
6389
6297
|
);
|
|
6390
6298
|
}
|
|
6391
|
-
return /* @__PURE__ */
|
|
6299
|
+
return /* @__PURE__ */ jsx38(
|
|
6392
6300
|
"svg",
|
|
6393
6301
|
{
|
|
6394
6302
|
"data-testid": testId,
|
|
@@ -6397,7 +6305,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
|
6397
6305
|
viewBox: "0 0 24 24",
|
|
6398
6306
|
fill: "none",
|
|
6399
6307
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6400
|
-
children: /* @__PURE__ */
|
|
6308
|
+
children: /* @__PURE__ */ jsx38(
|
|
6401
6309
|
"path",
|
|
6402
6310
|
{
|
|
6403
6311
|
d: "M9 18L15 12L9 6",
|
|
@@ -6410,12 +6318,12 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
|
6410
6318
|
}
|
|
6411
6319
|
);
|
|
6412
6320
|
}
|
|
6413
|
-
return /* @__PURE__ */
|
|
6321
|
+
return /* @__PURE__ */ jsx38(
|
|
6414
6322
|
"div",
|
|
6415
6323
|
{
|
|
6416
6324
|
"data-testid": `arrow--key-${testId}--type-${type}`,
|
|
6417
6325
|
ref,
|
|
6418
|
-
className:
|
|
6326
|
+
className: cn31("arrow", `arrow_${type}`, className, {
|
|
6419
6327
|
arrow_disabled: disabled
|
|
6420
6328
|
}),
|
|
6421
6329
|
onClick,
|
|
@@ -6425,1353 +6333,1456 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
|
|
|
6425
6333
|
}
|
|
6426
6334
|
var Arrow_default = Arrow;
|
|
6427
6335
|
|
|
6428
|
-
// src/Atomic/FormElements/
|
|
6429
|
-
import {
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
window.addEventListener("resize", () => onResize(elemRightPosition));
|
|
6443
|
-
return () => {
|
|
6444
|
-
window.removeEventListener("resize", () => setElemPosition(""));
|
|
6445
|
-
};
|
|
6446
|
-
}, []);
|
|
6447
|
-
useLayoutEffect3(() => {
|
|
6448
|
-
const elemRightPosition = element?.current?.getBoundingClientRect().right + 20;
|
|
6449
|
-
if (elemRightPosition > document.documentElement.clientWidth) {
|
|
6450
|
-
return setElemPosition("left");
|
|
6451
|
-
}
|
|
6452
|
-
}, []);
|
|
6453
|
-
return { elemPosition };
|
|
6454
|
-
};
|
|
6455
|
-
|
|
6456
|
-
// src/Atomic/UI/Modal/Modal.tsx
|
|
6457
|
-
import { Fragment as Fragment8, jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
6458
|
-
|
|
6459
|
-
// src/Functions/useKeyPress/useKeyPress.ts
|
|
6460
|
-
import { useCallback as useCallback5, useEffect as useEffect25, useState as useState26 } from "react";
|
|
6461
|
-
function isISuspendProcessing(x) {
|
|
6462
|
-
return getIsOnlyAnObject(x) && Object.values(x).every((v) => typeof v === "function");
|
|
6463
|
-
}
|
|
6464
|
-
function useKeyPress(targetKey, clamping = true, isForbidden, suspendProcessing) {
|
|
6465
|
-
const [keyPressed, setKeyPressed] = useState26(false);
|
|
6466
|
-
const safelySuspendProcessing = isISuspendProcessing(suspendProcessing) ? suspendProcessing : {};
|
|
6467
|
-
const downHandler = useCallback5(
|
|
6468
|
-
(event) => {
|
|
6469
|
-
const { key, repeat, altKey, ctrlKey, shiftKey, metaKey } = event;
|
|
6470
|
-
const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
|
|
6471
|
-
if (key === targetKey && isPressingWithoutAuxiliaryKeys && !safelySuspendProcessing[key]?.(event)) {
|
|
6472
|
-
if (!clamping && repeat) return;
|
|
6473
|
-
setKeyPressed(true);
|
|
6474
|
-
}
|
|
6336
|
+
// src/Atomic/FormElements/RangeCalendar/RangeCalendar.js
|
|
6337
|
+
import React34, { useEffect as useEffect23, useMemo as useMemo12, useState as useState24 } from "react";
|
|
6338
|
+
import cn32 from "classnames";
|
|
6339
|
+
import moment7 from "moment-timezone";
|
|
6340
|
+
var RangeCalendar = (props) => {
|
|
6341
|
+
const {
|
|
6342
|
+
className,
|
|
6343
|
+
date,
|
|
6344
|
+
setDate,
|
|
6345
|
+
startDate,
|
|
6346
|
+
endDate,
|
|
6347
|
+
allowPrev = true,
|
|
6348
|
+
allowNext = true,
|
|
6349
|
+
onClick = () => {
|
|
6475
6350
|
},
|
|
6476
|
-
|
|
6477
|
-
// ? хоть в коде используем "безопасный"
|
|
6478
|
-
[clamping, targetKey, suspendProcessing]
|
|
6479
|
-
);
|
|
6480
|
-
const upHandler = useCallback5(
|
|
6481
|
-
(event) => {
|
|
6482
|
-
const { key, repeat, altKey, ctrlKey, shiftKey, metaKey } = event;
|
|
6483
|
-
const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
|
|
6484
|
-
if (key === targetKey && isPressingWithoutAuxiliaryKeys && !safelySuspendProcessing[key]?.(event)) {
|
|
6485
|
-
if (!clamping && repeat) return;
|
|
6486
|
-
setKeyPressed(false);
|
|
6487
|
-
}
|
|
6351
|
+
onHover = () => {
|
|
6488
6352
|
},
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6353
|
+
startPrevDate,
|
|
6354
|
+
endPrevDate,
|
|
6355
|
+
limitRange,
|
|
6356
|
+
isShortWeekNames,
|
|
6357
|
+
minDate,
|
|
6358
|
+
maxDate,
|
|
6359
|
+
momentMinDate,
|
|
6360
|
+
momentMaxDate,
|
|
6361
|
+
isDontLimitFuture,
|
|
6362
|
+
testId = "range-calendar"
|
|
6363
|
+
} = props;
|
|
6364
|
+
const [days, setDays] = useState24({});
|
|
6365
|
+
const title = useMemo12(
|
|
6366
|
+
() => `${moment7(date).format("MMM")} ${moment7(date).format("YYYY")}`,
|
|
6367
|
+
[date]
|
|
6492
6368
|
);
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6369
|
+
useEffect23(() => {
|
|
6370
|
+
const result = {};
|
|
6371
|
+
const day = moment7(date).startOf("month");
|
|
6372
|
+
const daysInMonth = day.daysInMonth();
|
|
6373
|
+
for (let d = 0; d < daysInMonth; d += 1) {
|
|
6374
|
+
let week = day.week();
|
|
6375
|
+
if (day.month() === 11 && week === 1) week = 53;
|
|
6376
|
+
if (day.month() === 0 && week === 53) week = 0;
|
|
6377
|
+
if (!Object.prototype.hasOwnProperty.call(result, week)) {
|
|
6378
|
+
result[week] = {};
|
|
6500
6379
|
}
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
window.removeEventListener("keyup", handleUp);
|
|
6504
|
-
};
|
|
6505
|
-
},
|
|
6506
|
-
// ? Намерянно в зависимостях используем именно входной suspendProcessing,
|
|
6507
|
-
// ? хоть в коде используем "безопасный"
|
|
6508
|
-
[downHandler, upHandler, isForbidden, suspendProcessing]
|
|
6509
|
-
);
|
|
6510
|
-
return keyPressed;
|
|
6511
|
-
}
|
|
6512
|
-
var useKeyPress_default = useKeyPress;
|
|
6513
|
-
|
|
6514
|
-
// src/Functions/useKeyPress/useHandleKeyPress.ts
|
|
6515
|
-
import { useEffect as useEffect26 } from "react";
|
|
6516
|
-
function useHandleKeyPress({
|
|
6517
|
-
escCallback,
|
|
6518
|
-
enterCallback,
|
|
6519
|
-
withClamping = true,
|
|
6520
|
-
withEventManagementStructure,
|
|
6521
|
-
suspendProcessing = null
|
|
6522
|
-
}) {
|
|
6523
|
-
const { isWithSubmitAndCloseManagement } = withEventManagementStructure || {};
|
|
6524
|
-
const isPressEnter = useKeyPress_default("Enter", withClamping, isWithSubmitAndCloseManagement, suspendProcessing);
|
|
6525
|
-
const isPressEscape = useKeyPress_default("Escape", withClamping, isWithSubmitAndCloseManagement, suspendProcessing);
|
|
6526
|
-
useEffect26(() => {
|
|
6527
|
-
if (!isWithSubmitAndCloseManagement && isPressEscape && typeof escCallback === "function") {
|
|
6528
|
-
escCallback();
|
|
6529
|
-
}
|
|
6530
|
-
}, [isPressEscape, escCallback]);
|
|
6531
|
-
useEffect26(() => {
|
|
6532
|
-
if (!isWithSubmitAndCloseManagement && isPressEnter && typeof enterCallback === "function") {
|
|
6533
|
-
enterCallback();
|
|
6380
|
+
result[week][day.weekday()] = { date: day.toDate() };
|
|
6381
|
+
day.add(1, "d");
|
|
6534
6382
|
}
|
|
6535
|
-
|
|
6536
|
-
}
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
})
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
const output = {
|
|
6570
|
-
isWithSubmitAndCloseManagement: false
|
|
6383
|
+
setDays(result);
|
|
6384
|
+
}, [date]);
|
|
6385
|
+
const renderDay = (week, dayOfWeek) => {
|
|
6386
|
+
const day = days[week][dayOfWeek];
|
|
6387
|
+
const isFutureDay = day && moment7(day.date).isAfter(moment7(), "day");
|
|
6388
|
+
const isPastDay = limitRange ? day && moment7(day.date).isBefore(moment7().subtract(limitRange, "days"), "day") : null;
|
|
6389
|
+
const isRangeStart = day && moment7(day.date).isSame(startDate, "day");
|
|
6390
|
+
const isRangeEnd = day && moment7(day.date).isSame(moment7(endDate).subtract(1, "hour"), "day");
|
|
6391
|
+
const isRangeInside = day && startDate && endDate && moment7(day.date).isAfter(startDate, "day") && moment7(day.date).isBefore(moment7(endDate).subtract(1, "hour"), "day");
|
|
6392
|
+
const isPrevRangeEnd = day && (moment7(day.date).isSame(startPrevDate, "day") || moment7(day.date).isSame(moment7(endPrevDate).subtract(1, "day"), "day"));
|
|
6393
|
+
const isPrevRangeInside = day && startPrevDate && endPrevDate && moment7(day.date).isAfter(startPrevDate, "day") && moment7(day.date).isBefore(moment7(endPrevDate).subtract(1, "day"), "day");
|
|
6394
|
+
const classNames2 = cn32(
|
|
6395
|
+
"range-calendar__day",
|
|
6396
|
+
{ "range-calendar__day--clickable": day },
|
|
6397
|
+
{
|
|
6398
|
+
"range-calendar__day--disabled": isPastDay || minDate && moment7(day?.date).isBefore(momentMinDate, "day") || !isDontLimitFuture && (maxDate ? moment7(day?.date).isAfter(momentMaxDate) : isFutureDay)
|
|
6399
|
+
},
|
|
6400
|
+
{ "range-calendar__day--range-start": isRangeStart },
|
|
6401
|
+
{ "range-calendar__day--range-end": isRangeEnd },
|
|
6402
|
+
{ "range-calendar__day--range-inside": isRangeInside },
|
|
6403
|
+
{ "range-calendar__day--prev-range-end": isPrevRangeEnd },
|
|
6404
|
+
{ "range-calendar__day--prev-range-inside": isPrevRangeInside }
|
|
6405
|
+
);
|
|
6406
|
+
return /* @__PURE__ */ jsx39(
|
|
6407
|
+
"div",
|
|
6408
|
+
{
|
|
6409
|
+
className: classNames2,
|
|
6410
|
+
onClick: day ? (e) => onClick(day.date, e) : null,
|
|
6411
|
+
onMouseOver: day ? () => onHover(day.date) : null,
|
|
6412
|
+
onMouseLeave: () => onHover(null),
|
|
6413
|
+
children: /* @__PURE__ */ jsx39("span", { className: "calendar__day-num", children: day && day.date.getDate() })
|
|
6414
|
+
},
|
|
6415
|
+
`${week}_${dayOfWeek}`
|
|
6416
|
+
);
|
|
6571
6417
|
};
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
return
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
return function onKeyPress(ev) {
|
|
6589
|
-
const customEvent = ev;
|
|
6590
|
-
const { id: eventId, realEvent } = customEvent.detail || {};
|
|
6591
|
-
const constantInfoAboutCustomEvent = Object.values(EVENTS).find((ev2) => ev2.name === customEvent.type || ev2.shortName === customEvent.type) || {};
|
|
6592
|
-
const middlewareKey = constantInfoAboutCustomEvent.middlewareKey || "incorrectKey";
|
|
6593
|
-
const safelySuspendProcessing = isISuspendProcessing(suspendProcessing) ? suspendProcessing : {};
|
|
6594
|
-
if (modalId && eventId && eventId === modalId && !safelySuspendProcessing[middlewareKey]?.(realEvent)) {
|
|
6595
|
-
switch (customEvent.type) {
|
|
6596
|
-
case EVENTS.iGotAnEnterKeyPress.name: {
|
|
6597
|
-
onSubmit?.();
|
|
6598
|
-
break;
|
|
6599
|
-
}
|
|
6600
|
-
case EVENTS.iGotAnEscKeyPress.name: {
|
|
6601
|
-
onClose?.();
|
|
6602
|
-
break;
|
|
6418
|
+
const handlePrev = () => {
|
|
6419
|
+
setDate(moment7(date).subtract(1, "month").toDate());
|
|
6420
|
+
};
|
|
6421
|
+
const handleNext = () => {
|
|
6422
|
+
setDate(moment7(date).add(1, "month").toDate());
|
|
6423
|
+
};
|
|
6424
|
+
const getFormatedWeekName = (input) => isShortWeekNames ? input.charAt(0) : input;
|
|
6425
|
+
return /* @__PURE__ */ jsxs34("div", { className: cn32("range-calendar", className), "data-testid": testId, children: [
|
|
6426
|
+
/* @__PURE__ */ jsxs34("div", { className: "range-calendar-header", children: [
|
|
6427
|
+
/* @__PURE__ */ jsx39(
|
|
6428
|
+
Arrow_default,
|
|
6429
|
+
{
|
|
6430
|
+
type: "left",
|
|
6431
|
+
disabled: !allowPrev || minDate && moment7(date).startOf("month").isSameOrBefore(momentMinDate, "months"),
|
|
6432
|
+
onClick: handlePrev,
|
|
6433
|
+
className: "range-calendar-header__prev"
|
|
6603
6434
|
}
|
|
6604
|
-
|
|
6605
|
-
|
|
6435
|
+
),
|
|
6436
|
+
/* @__PURE__ */ jsx39("div", { className: "range-calendar-header__title", children: title }),
|
|
6437
|
+
/* @__PURE__ */ jsx39(
|
|
6438
|
+
Arrow_default,
|
|
6439
|
+
{
|
|
6440
|
+
type: "right",
|
|
6441
|
+
disabled: !allowNext || !isDontLimitFuture && moment7(date).startOf("month").isSameOrAfter(
|
|
6442
|
+
maxDate ? momentMaxDate : moment7().add(1, "day").startOf("day"),
|
|
6443
|
+
"months"
|
|
6444
|
+
),
|
|
6445
|
+
onClick: handleNext,
|
|
6446
|
+
className: "range-calendar-header__next"
|
|
6606
6447
|
}
|
|
6607
|
-
|
|
6448
|
+
)
|
|
6449
|
+
] }),
|
|
6450
|
+
/* @__PURE__ */ jsx39("div", { className: "range-calendar__week range-calendar__week-title", children: [...Array(7).keys()].map((dayOfWeek) => {
|
|
6451
|
+
return /* @__PURE__ */ jsx39(
|
|
6452
|
+
"div",
|
|
6453
|
+
{
|
|
6454
|
+
className: "range-calendar__day range-calendar__day--title",
|
|
6455
|
+
children: getFormatedWeekName(moment7().weekday(dayOfWeek).format("dd"))
|
|
6456
|
+
},
|
|
6457
|
+
`day-of-week_${dayOfWeek}`
|
|
6458
|
+
);
|
|
6459
|
+
}) }),
|
|
6460
|
+
Object.keys(days).map((week, index) => /* @__PURE__ */ jsx39("div", { className: "range-calendar__week", children: [...Array(7).keys()].map((dayOfWeek) => renderDay(week, dayOfWeek)) }, `week_${index}`))
|
|
6461
|
+
] });
|
|
6462
|
+
};
|
|
6463
|
+
var RangeCalendar_default = RangeCalendar;
|
|
6464
|
+
|
|
6465
|
+
// src/Atomic/FormElements/InputDateRange/dependencies.ts
|
|
6466
|
+
import moment8 from "moment-timezone";
|
|
6467
|
+
import { useCallback as useCallback4, useEffect as useEffect24, useRef as useRef13, useState as useState25 } from "react";
|
|
6468
|
+
var getIsDateValid = (date) => moment8(date).isValid();
|
|
6469
|
+
function useClickOutside2(hideComponent, additionalComponent, onlyGetRef) {
|
|
6470
|
+
const ref = useRef13(null);
|
|
6471
|
+
const checkCondition = (target) => {
|
|
6472
|
+
if (additionalComponent && additionalComponent?.length) {
|
|
6473
|
+
return !ref.current?.contains(target) && !Array.from(additionalComponent)?.some((item) => item?.contains(target));
|
|
6474
|
+
} else {
|
|
6475
|
+
return !ref.current?.contains(target);
|
|
6608
6476
|
}
|
|
6609
6477
|
};
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6478
|
+
const handleClickOutside = useCallback4(
|
|
6479
|
+
(e) => {
|
|
6480
|
+
const target = e.target;
|
|
6481
|
+
if (checkCondition(target)) hideComponent();
|
|
6482
|
+
},
|
|
6483
|
+
[hideComponent]
|
|
6484
|
+
);
|
|
6485
|
+
useEffect24(() => {
|
|
6486
|
+
if (!onlyGetRef) {
|
|
6487
|
+
document.addEventListener("mousedown", handleClickOutside, true);
|
|
6488
|
+
return () => {
|
|
6489
|
+
document.removeEventListener("mousedown", handleClickOutside, true);
|
|
6490
|
+
};
|
|
6618
6491
|
}
|
|
6619
|
-
|
|
6492
|
+
return () => {
|
|
6493
|
+
};
|
|
6494
|
+
}, []);
|
|
6495
|
+
return ref;
|
|
6620
6496
|
}
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
)
|
|
6497
|
+
function useToggle(initialState) {
|
|
6498
|
+
const [isToggled, setToggle] = useState25(Boolean(initialState));
|
|
6499
|
+
const toggle = useCallback4(() => setToggle((isOn) => !isOn), []);
|
|
6500
|
+
const toggleOn = useCallback4(() => setToggle(true), []);
|
|
6501
|
+
const toggleOff = useCallback4(() => setToggle(false), []);
|
|
6502
|
+
return {
|
|
6503
|
+
isToggled,
|
|
6504
|
+
toggle,
|
|
6505
|
+
toggleOn,
|
|
6506
|
+
toggleOff
|
|
6507
|
+
};
|
|
6508
|
+
}
|
|
6509
|
+
var INTERVALS = {
|
|
6510
|
+
today: {
|
|
6511
|
+
label: "today",
|
|
6512
|
+
start: () => moment8().startOf("day"),
|
|
6513
|
+
end: () => moment8().add(1, "day").startOf("day")
|
|
6514
|
+
},
|
|
6515
|
+
yesterday: {
|
|
6516
|
+
label: "yesterday",
|
|
6517
|
+
start: () => moment8().subtract(1, "day").startOf("day"),
|
|
6518
|
+
end: () => moment8().startOf("day")
|
|
6519
|
+
},
|
|
6520
|
+
thisWeek: {
|
|
6521
|
+
label: "This Week",
|
|
6522
|
+
start: () => moment8().startOf("week"),
|
|
6523
|
+
end: () => moment8().add(1, "day").startOf("day")
|
|
6524
|
+
},
|
|
6525
|
+
lastWeek: {
|
|
6526
|
+
label: "Last Week",
|
|
6527
|
+
start: () => moment8().subtract(1, "week").startOf("week"),
|
|
6528
|
+
end: () => moment8().startOf("week")
|
|
6529
|
+
},
|
|
6530
|
+
last7Days: {
|
|
6531
|
+
label: "Last 7 Days",
|
|
6532
|
+
start: () => moment8().subtract(6, "day").startOf("day"),
|
|
6533
|
+
end: () => moment8().add(1, "day").startOf("day")
|
|
6534
|
+
},
|
|
6535
|
+
last14Days: {
|
|
6536
|
+
label: "Last 14 Days",
|
|
6537
|
+
start: () => moment8().subtract(13, "day").startOf("day"),
|
|
6538
|
+
end: () => moment8().add(1, "day").startOf("day")
|
|
6539
|
+
},
|
|
6540
|
+
last30Days: {
|
|
6541
|
+
label: "Last 30 Days",
|
|
6542
|
+
start: () => moment8().subtract(29, "day").startOf("day"),
|
|
6543
|
+
end: () => moment8().add(1, "day").startOf("day")
|
|
6544
|
+
},
|
|
6545
|
+
thisMonth: {
|
|
6546
|
+
label: "This Month",
|
|
6547
|
+
start: () => moment8().startOf("month"),
|
|
6548
|
+
end: () => moment8().add(1, "day").startOf("day")
|
|
6549
|
+
},
|
|
6550
|
+
lastMonth: {
|
|
6551
|
+
label: "Last Month",
|
|
6552
|
+
start: () => moment8().subtract(1, "month").startOf("month"),
|
|
6553
|
+
end: () => moment8().startOf("month")
|
|
6554
|
+
},
|
|
6555
|
+
last3Months: {
|
|
6556
|
+
label: "Last 3 Months",
|
|
6557
|
+
start: () => moment8().subtract(3, "month").startOf("month"),
|
|
6558
|
+
end: () => moment8().startOf("month")
|
|
6559
|
+
},
|
|
6560
|
+
last6Months: {
|
|
6561
|
+
label: "Last 6 Months",
|
|
6562
|
+
start: () => moment8().subtract(6, "month").startOf("month"),
|
|
6563
|
+
end: () => moment8().startOf("month")
|
|
6564
|
+
},
|
|
6565
|
+
sixMonths: {
|
|
6566
|
+
label: "6 Months",
|
|
6567
|
+
isHidden: true,
|
|
6568
|
+
start: () => moment8().subtract(6, "month"),
|
|
6569
|
+
end: () => moment8().add(1, "day").startOf("day")
|
|
6570
|
+
},
|
|
6571
|
+
thisYear: {
|
|
6572
|
+
label: "This Year",
|
|
6573
|
+
start: () => moment8().startOf("year"),
|
|
6574
|
+
end: () => moment8().add(1, "day").startOf("day")
|
|
6575
|
+
},
|
|
6576
|
+
year: {
|
|
6577
|
+
label: "Year",
|
|
6578
|
+
isHidden: true,
|
|
6579
|
+
start: () => moment8().subtract(1, "year"),
|
|
6580
|
+
end: () => moment8().add(1, "day").startOf("day")
|
|
6581
|
+
},
|
|
6582
|
+
lastYear: {
|
|
6583
|
+
label: "Last Year",
|
|
6584
|
+
start: () => moment8().subtract(1, "year").startOf("year"),
|
|
6585
|
+
end: () => moment8().startOf("year")
|
|
6586
|
+
},
|
|
6587
|
+
allTime: {
|
|
6588
|
+
label: "All Time",
|
|
6589
|
+
start: () => moment8("2022-01-01T00:00:00"),
|
|
6590
|
+
end: () => moment8()
|
|
6591
|
+
// start: () => null,
|
|
6592
|
+
// end: () => null,
|
|
6704
6593
|
}
|
|
6705
|
-
);
|
|
6706
|
-
ModalTitle.displayName = "ModalTitle";
|
|
6707
|
-
var ModalTitle_default = ModalTitle;
|
|
6708
|
-
|
|
6709
|
-
// src/Atomic/UI/Modal/partials/useMobileModal.tsx
|
|
6710
|
-
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
6711
|
-
import { useCallback as useCallback6, useEffect as useEffect27, useLayoutEffect as useLayoutEffect5, useRef as useRef15, useState as useState27 } from "react";
|
|
6712
|
-
var SCROLL_DIRECTION = {
|
|
6713
|
-
UP: "up",
|
|
6714
|
-
DOWN: "down"
|
|
6715
6594
|
};
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
const
|
|
6724
|
-
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
IS_HEADER_STICKY: false,
|
|
6731
|
-
IS_FOOTER_HIDDEN: false,
|
|
6732
|
-
IS_FOOTER_STICKY: withFixedFooter
|
|
6733
|
-
});
|
|
6734
|
-
const [modalsLogicProps, setModalsLogicProps] = useState27({
|
|
6735
|
-
headerHeight: 0,
|
|
6736
|
-
footerHeight: 0
|
|
6737
|
-
});
|
|
6738
|
-
const [scrollDirection, setScrollDirection] = useState27(SCROLL_DIRECTION.UP);
|
|
6739
|
-
const [scrollTopPrev, setScrollTopPrev] = useState27(0);
|
|
6740
|
-
const [scrollTop, setScrollTop] = useState27(0);
|
|
6741
|
-
const [scrollHeight, setScrollHeight] = useState27(1);
|
|
6742
|
-
const [, setContainerScrollHeight] = useState27(1);
|
|
6743
|
-
useLayoutEffect5(() => {
|
|
6744
|
-
const el = modalMobileContainerRef?.current;
|
|
6745
|
-
if (el) {
|
|
6746
|
-
el.addEventListener("scroll", () => {
|
|
6747
|
-
setScrollTop((scrollTop2) => {
|
|
6748
|
-
if (scrollTop2 !== el.scrollTop) setScrollTopPrev(scrollTop2);
|
|
6749
|
-
return el.scrollTop;
|
|
6750
|
-
});
|
|
6751
|
-
});
|
|
6752
|
-
}
|
|
6753
|
-
}, [modalMobileContainerRef?.current]);
|
|
6754
|
-
useEffect27(() => {
|
|
6755
|
-
setScrollDirection(
|
|
6756
|
-
(prevScrollDirection) => scrollTop < scrollTopPrev ? SCROLL_DIRECTION.UP : scrollTop > scrollTopPrev ? SCROLL_DIRECTION.DOWN : prevScrollDirection
|
|
6757
|
-
);
|
|
6758
|
-
}, [scrollTop, scrollTopPrev]);
|
|
6759
|
-
useLayoutEffect5(() => {
|
|
6760
|
-
if (isOpen) {
|
|
6761
|
-
const modalStyle = modalRef?.current ? modalRef?.current.style || window.getComputedStyle(modalRef?.current) : {};
|
|
6762
|
-
const computedModalHeight = modalRef?.current ? modalHeight + Number.parseFloat(modalStyle?.marginTop || "0") : 0;
|
|
6763
|
-
const windowHeight = document.documentElement.clientHeight || window.screen.availHeight || window.screen.height;
|
|
6764
|
-
if (modalMobileContainerRef?.current) {
|
|
6765
|
-
if (computedModalHeight <= windowHeight) {
|
|
6766
|
-
modalMobileContainerRef.current.style.display = "flex";
|
|
6767
|
-
modalMobileContainerRef.current.style.alignItems = "flex-end";
|
|
6768
|
-
} else {
|
|
6769
|
-
modalMobileContainerRef.current?.style?.removeProperty("display");
|
|
6770
|
-
modalMobileContainerRef.current?.style?.removeProperty("align-items");
|
|
6595
|
+
var ALL_TIME_KEY = "allTime";
|
|
6596
|
+
var CUSTOM_INTERVAL_KEY = "customDate";
|
|
6597
|
+
var CUSTOM_INTERVAL_KEY_TEXT = "Custom Date";
|
|
6598
|
+
var MAIN_FORMAT = "YYYY-MM-DDTHH:mm";
|
|
6599
|
+
var MAIN_DATE_FORMAT = "YYYY-MM-DD";
|
|
6600
|
+
var MAIN_TIME_FORMAT = "HH:mm";
|
|
6601
|
+
function getActualDateRange(inputDateRange) {
|
|
6602
|
+
const getActualIntervalKey = () => {
|
|
6603
|
+
if (inputDateRange?.intervalKey && Object.keys(INTERVALS).includes(inputDateRange.intervalKey)) {
|
|
6604
|
+
return inputDateRange.intervalKey;
|
|
6605
|
+
} else if (inputDateRange?.start && inputDateRange?.end) {
|
|
6606
|
+
for (const [key, interval2] of Object.entries(INTERVALS)) {
|
|
6607
|
+
if (moment8(inputDateRange.start).isSame(interval2.start()) && moment8(inputDateRange.end).isSame(interval2.end())) {
|
|
6608
|
+
return key;
|
|
6771
6609
|
}
|
|
6772
6610
|
}
|
|
6611
|
+
return CUSTOM_INTERVAL_KEY;
|
|
6773
6612
|
}
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
const { footerHeight, headerHeight } = modalsLogicProps;
|
|
6786
|
-
setModalsLogic((prevStickyLogic) => ({
|
|
6787
|
-
IS_HEADER_HIDDEN: scrollDirection === SCROLL_DIRECTION.DOWN || scrollTop === 0,
|
|
6788
|
-
IS_HEADER_STICKY: scrollDirection === SCROLL_DIRECTION.UP && scrollTop !== 0 && (scrollTop >= headerHeight || prevStickyLogic.IS_HEADER_STICKY),
|
|
6789
|
-
IS_FOOTER_HIDDEN: !withFixedFooter && (scrollDirection === SCROLL_DIRECTION.UP || scrollHeight === Math.round(scrollTop)),
|
|
6790
|
-
IS_FOOTER_STICKY: withFixedFooter && scrollHeight > 1 || scrollDirection === SCROLL_DIRECTION.DOWN && (scrollHeight - Math.round(scrollTop) >= footerHeight || prevStickyLogic.IS_FOOTER_STICKY)
|
|
6791
|
-
}));
|
|
6792
|
-
}
|
|
6793
|
-
}, [
|
|
6794
|
-
scrollTop,
|
|
6795
|
-
scrollHeight,
|
|
6796
|
-
isMobile,
|
|
6797
|
-
withMobileLogic,
|
|
6798
|
-
scrollDirection,
|
|
6799
|
-
modalsLogicProps,
|
|
6800
|
-
modalHeight,
|
|
6801
|
-
window.innerHeight
|
|
6802
|
-
]);
|
|
6803
|
-
useLayoutEffect5(() => {
|
|
6804
|
-
if (modalMobileHeaderRef?.current?.getBoundingClientRect()?.height !== void 0) {
|
|
6805
|
-
setModalsLogicProps((state) => ({
|
|
6806
|
-
...state,
|
|
6807
|
-
headerHeight: modalMobileHeaderRef?.current?.getBoundingClientRect()?.height ?? 0
|
|
6808
|
-
}));
|
|
6809
|
-
}
|
|
6810
|
-
}, [modalMobileHeaderRef?.current?.getBoundingClientRect()?.height]);
|
|
6811
|
-
useLayoutEffect5(() => {
|
|
6812
|
-
if (modalMobileFooterRef?.current?.getBoundingClientRect()?.height !== void 0) {
|
|
6813
|
-
setModalsLogicProps((state) => ({
|
|
6814
|
-
...state,
|
|
6815
|
-
footerHeight: modalMobileFooterRef?.current?.getBoundingClientRect()?.height ?? 0
|
|
6816
|
-
}));
|
|
6613
|
+
return ALL_TIME_KEY;
|
|
6614
|
+
};
|
|
6615
|
+
const getIntervalDate = (intervalKey) => {
|
|
6616
|
+
if (intervalKey === ALL_TIME_KEY || intervalKey === CUSTOM_INTERVAL_KEY) {
|
|
6617
|
+
return {
|
|
6618
|
+
start: null,
|
|
6619
|
+
end: null,
|
|
6620
|
+
compare: inputDateRange?.compare,
|
|
6621
|
+
startPrevDate: null,
|
|
6622
|
+
endPrevDate: null
|
|
6623
|
+
};
|
|
6817
6624
|
}
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6625
|
+
const actualValues = {
|
|
6626
|
+
start: INTERVALS[intervalKey]?.start()?.format(MAIN_FORMAT),
|
|
6627
|
+
end: INTERVALS[intervalKey]?.end()?.format(MAIN_FORMAT),
|
|
6628
|
+
compare: inputDateRange?.compare
|
|
6629
|
+
};
|
|
6630
|
+
if (actualValues.compare) {
|
|
6631
|
+
const intervalHoursCount = moment8(actualValues.end).diff(
|
|
6632
|
+
actualValues.start,
|
|
6633
|
+
"hours"
|
|
6824
6634
|
);
|
|
6635
|
+
actualValues.startPrevDate = moment8(actualValues.start).subtract(intervalHoursCount, "hours").toDate();
|
|
6636
|
+
actualValues.endPrevDate = actualValues.start;
|
|
6825
6637
|
}
|
|
6826
|
-
|
|
6827
|
-
useEffect27(() => {
|
|
6828
|
-
window.addEventListener("resize", () => {
|
|
6829
|
-
setContainerScrollHeight((containerScrollHeight) => {
|
|
6830
|
-
setScrollHeight(containerScrollHeight - window.innerHeight);
|
|
6831
|
-
return containerScrollHeight;
|
|
6832
|
-
});
|
|
6833
|
-
});
|
|
6834
|
-
}, []);
|
|
6835
|
-
const renderModal = useCallback6(
|
|
6836
|
-
(modal) => {
|
|
6837
|
-
if (!isMobile || !withMobileLogic) return modal;
|
|
6838
|
-
return /* @__PURE__ */ jsx40("div", { className: "modal-mobile-container", ref: modalMobileContainerRef, children: modal });
|
|
6839
|
-
},
|
|
6840
|
-
[isMobile, withMobileLogic]
|
|
6841
|
-
);
|
|
6842
|
-
return {
|
|
6843
|
-
modalMobileContainerRef,
|
|
6844
|
-
modalMobileHeaderRef,
|
|
6845
|
-
modalMobileBodyRef,
|
|
6846
|
-
modalMobileFooterRef,
|
|
6847
|
-
MODALS_LOGIC: modalsLogic,
|
|
6848
|
-
SCROLL_DIRECTION,
|
|
6849
|
-
scrollTop,
|
|
6850
|
-
scrollHeight,
|
|
6851
|
-
renderModal,
|
|
6852
|
-
isMobile
|
|
6638
|
+
return actualValues;
|
|
6853
6639
|
};
|
|
6640
|
+
const interval = getActualIntervalKey();
|
|
6641
|
+
return interval !== CUSTOM_INTERVAL_KEY && interval !== ALL_TIME_KEY ? { intervalKey: interval, ...getIntervalDate(interval) } : { ...inputDateRange, intervalKey: interval };
|
|
6854
6642
|
}
|
|
6855
6643
|
|
|
6856
|
-
// src/Atomic/
|
|
6644
|
+
// src/Atomic/FormElements/InputDateRange/components/Datepicker.tsx
|
|
6857
6645
|
import cn33 from "classnames";
|
|
6858
|
-
import
|
|
6859
|
-
|
|
6860
|
-
var
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
});
|
|
6864
|
-
function renderModalTitle({
|
|
6865
|
-
mode,
|
|
6866
|
-
title,
|
|
6867
|
-
onlyTitle
|
|
6868
|
-
}) {
|
|
6869
|
-
if (mode && mode !== "default" && !onlyTitle) {
|
|
6870
|
-
return `${mode[0].toUpperCase()}${mode.slice(1)} ${title}`;
|
|
6871
|
-
}
|
|
6872
|
-
return title;
|
|
6873
|
-
}
|
|
6874
|
-
function Modal({
|
|
6875
|
-
ref,
|
|
6876
|
-
id,
|
|
6877
|
-
testId = "modal",
|
|
6878
|
-
zIndex = 100,
|
|
6879
|
-
isOpen,
|
|
6880
|
-
onConfirm,
|
|
6881
|
-
onDecline,
|
|
6882
|
-
closeModal,
|
|
6883
|
-
className,
|
|
6884
|
-
variant = "primary",
|
|
6885
|
-
size,
|
|
6886
|
-
mode,
|
|
6887
|
-
title,
|
|
6888
|
-
onlyTitle,
|
|
6889
|
-
atributesForModalBody = attrsForModalBodyDefault,
|
|
6890
|
-
confirmBtnClassName,
|
|
6891
|
-
confirmBtnLabel,
|
|
6892
|
-
confirmBtnVariant = "primary",
|
|
6893
|
-
confirmBtnDisable,
|
|
6894
|
-
confirmBtnIcon,
|
|
6895
|
-
isConfirmBtnIconPositionRight,
|
|
6896
|
-
noConfirmBtn,
|
|
6897
|
-
forced,
|
|
6898
|
-
closeBtnClassName,
|
|
6899
|
-
closeBtnText,
|
|
6900
|
-
closeBtnVariant,
|
|
6901
|
-
closeBtnDisable,
|
|
6902
|
-
closeBtnIcon,
|
|
6903
|
-
btnClassNames,
|
|
6904
|
-
isCloseBtnIconPositionRight,
|
|
6905
|
-
noCloseBtn,
|
|
6906
|
-
noHeader,
|
|
6907
|
-
noHeaderCloseBtn,
|
|
6908
|
-
customHeader,
|
|
6909
|
-
declineBtnDisable,
|
|
6910
|
-
noFooter,
|
|
6911
|
-
customFooter,
|
|
6912
|
-
withFixedFooter,
|
|
6913
|
-
leftContentOfFooter,
|
|
6914
|
-
isSubmittingByEnter: isSubmittingByEnterOuter = true,
|
|
6915
|
-
isClosingByEsc: isClosingByEscOuter = true,
|
|
6916
|
-
withEventManagement = false,
|
|
6917
|
-
submitOnEnter,
|
|
6918
|
-
closeOnEsc,
|
|
6919
|
-
withMobileLogic,
|
|
6920
|
-
children
|
|
6921
|
-
}) {
|
|
6922
|
-
const internalRef = useRef16(null);
|
|
6923
|
-
const modalRef = ref || internalRef;
|
|
6924
|
-
const onConfirmRef = useRef16(onConfirm);
|
|
6925
|
-
const closeModalRef = useRef16(closeModal);
|
|
6926
|
-
const onDeclineRef = useRef16(onDecline);
|
|
6927
|
-
const isSubmittingByEnter = submitOnEnter === false ? false : isSubmittingByEnterOuter;
|
|
6928
|
-
const isClosingByEsc = closeOnEsc === false ? false : isClosingByEscOuter;
|
|
6929
|
-
const withEventManagementStructure = getWithEventManagementStructure(id, withEventManagement);
|
|
6930
|
-
const isUseAutoBlockingForHandlers = withEventManagementStructure.isWithSubmitAndCloseManagement;
|
|
6931
|
-
const isOnConfirmBlocked = typeof onConfirm === "function" && isUseAutoBlockingForHandlers && confirmBtnDisable;
|
|
6932
|
-
const isCloseModalBlocked = typeof closeModal === "function" && isUseAutoBlockingForHandlers && closeBtnDisable;
|
|
6933
|
-
const isOnDeclineBlocked = typeof onDecline === "function" && isUseAutoBlockingForHandlers && declineBtnDisable;
|
|
6934
|
-
const {
|
|
6935
|
-
modalMobileHeaderRef,
|
|
6936
|
-
modalMobileBodyRef,
|
|
6937
|
-
modalMobileFooterRef,
|
|
6938
|
-
MODALS_LOGIC,
|
|
6939
|
-
renderModal,
|
|
6940
|
-
isMobile,
|
|
6941
|
-
scrollTop,
|
|
6942
|
-
scrollHeight
|
|
6943
|
-
} = useMobileModal({
|
|
6944
|
-
withMobileLogic,
|
|
6945
|
-
withFixedFooter,
|
|
6946
|
-
isOpen
|
|
6947
|
-
});
|
|
6948
|
-
const handle = useMemo13(() => ({
|
|
6949
|
-
confirm: () => onConfirmRef.current?.(),
|
|
6950
|
-
close: () => closeModalRef.current?.(),
|
|
6951
|
-
decline: () => {
|
|
6952
|
-
if (typeof onDeclineRef.current === "function") onDeclineRef.current();
|
|
6953
|
-
else closeModalRef.current?.();
|
|
6954
|
-
}
|
|
6955
|
-
}), []);
|
|
6956
|
-
const suspendProcessing = {
|
|
6957
|
-
// FIN-12482
|
|
6958
|
-
// ? Чтобы НЕ замыкать рефку на модалку в логике, чтобы потом поискать в контенте все текстэриа,
|
|
6959
|
-
// ? чтобы оценить есть ли среди них сфокусированная - делаем элеГАнтно:
|
|
6960
|
-
// ? оцениваем ev.target, и если target это текстэриа, то вот сейчас то она и сфокусирована,
|
|
6961
|
-
// ? т.е нужно приостановить процессы связанные с нажатием enter.
|
|
6962
|
-
Enter: (ev) => ev?.target?.nodeName === "TEXTAREA"
|
|
6963
|
-
// ? Колбеки опциональны, можно передавать только нужные
|
|
6964
|
-
// Escape: (ev: globalThis.KeyboardEvent) => false,
|
|
6965
|
-
};
|
|
6966
|
-
useHandleKeyPress_default({
|
|
6967
|
-
enterCallback: isSubmittingByEnter && typeof onConfirm === "function" && !confirmBtnDisable ? handle.confirm : void 0,
|
|
6968
|
-
escCallback: isClosingByEsc && typeof closeModal === "function" ? handle.close : void 0,
|
|
6969
|
-
withClamping: false,
|
|
6970
|
-
withEventManagementStructure: {
|
|
6971
|
-
isWithSubmitAndCloseManagement: confirmBtnDisable || withEventManagementStructure.isWithSubmitAndCloseManagement
|
|
6972
|
-
},
|
|
6973
|
-
suspendProcessing
|
|
6974
|
-
});
|
|
6975
|
-
useLayoutEffect6(() => {
|
|
6976
|
-
onConfirmRef.current = isOnConfirmBlocked ? void 0 : onConfirm;
|
|
6977
|
-
}, [onConfirm, isOnConfirmBlocked]);
|
|
6978
|
-
useLayoutEffect6(() => {
|
|
6979
|
-
closeModalRef.current = isCloseModalBlocked ? void 0 : closeModal;
|
|
6980
|
-
}, [closeModal, isCloseModalBlocked]);
|
|
6981
|
-
useLayoutEffect6(() => {
|
|
6982
|
-
onDeclineRef.current = isOnDeclineBlocked ? () => {
|
|
6983
|
-
} : onDecline;
|
|
6984
|
-
}, [onDecline, isOnDeclineBlocked]);
|
|
6985
|
-
useEffect28(() => {
|
|
6986
|
-
const outerTarget = getIsOnlyAnObject(withEventManagement) ? withEventManagement.listenersTarget : void 0;
|
|
6987
|
-
const target = outerTarget ?? document;
|
|
6988
|
-
const onKeyPress = getOnKeyPress({ id, onSubmit: handle.confirm, onClose: handle.close, suspendProcessing });
|
|
6989
|
-
if (withEventManagementStructure.isWithSubmitAndCloseManagement && !!onKeyPress) {
|
|
6990
|
-
if (isSubmittingByEnter) target.addEventListener(EVENTS.iGotAnEnterKeyPress.name, onKeyPress);
|
|
6991
|
-
if (isClosingByEsc) target.addEventListener(EVENTS.iGotAnEscKeyPress.name, onKeyPress);
|
|
6992
|
-
}
|
|
6993
|
-
return () => {
|
|
6994
|
-
if (withEventManagementStructure.isWithSubmitAndCloseManagement && !!onKeyPress) {
|
|
6995
|
-
if (isSubmittingByEnter) target.removeEventListener(EVENTS.iGotAnEnterKeyPress.name, onKeyPress);
|
|
6996
|
-
if (isClosingByEsc) target.removeEventListener(EVENTS.iGotAnEscKeyPress.name, onKeyPress);
|
|
6997
|
-
}
|
|
6998
|
-
};
|
|
6999
|
-
}, []);
|
|
7000
|
-
if (!isOpen) return null;
|
|
7001
|
-
return /* @__PURE__ */ jsx41(
|
|
7002
|
-
"div",
|
|
7003
|
-
{
|
|
7004
|
-
id: `${id}`,
|
|
7005
|
-
style: { zIndex },
|
|
7006
|
-
"data-testid": testId,
|
|
7007
|
-
className: "modal-box j5",
|
|
7008
|
-
role: "dialog",
|
|
7009
|
-
"aria-modal": "true",
|
|
7010
|
-
"aria-labelledby": `${testId}-title`,
|
|
7011
|
-
children: renderModal(
|
|
7012
|
-
/* @__PURE__ */ jsxs35(Fragment8, { children: [
|
|
7013
|
-
/* @__PURE__ */ jsx41(
|
|
7014
|
-
"div",
|
|
7015
|
-
{
|
|
7016
|
-
"data-testid": `${testId}-overlay`,
|
|
7017
|
-
className: isOpen ? "modal-overlay" : "hidden",
|
|
7018
|
-
onClick: handle.close,
|
|
7019
|
-
role: "presentation"
|
|
7020
|
-
}
|
|
7021
|
-
),
|
|
7022
|
-
/* @__PURE__ */ jsxs35(
|
|
7023
|
-
"div",
|
|
7024
|
-
{
|
|
7025
|
-
ref: modalRef,
|
|
7026
|
-
style: { width: typeof size === "number" ? `${size}px` : `${size?.replace("px", "")}px` },
|
|
7027
|
-
className: cn33(className, {
|
|
7028
|
-
"modal": isOpen,
|
|
7029
|
-
"modal--no-header": isOpen && noHeader && !customHeader,
|
|
7030
|
-
"modal-mobile": isOpen && isMobile,
|
|
7031
|
-
"hidden": !isOpen
|
|
7032
|
-
}),
|
|
7033
|
-
children: [
|
|
7034
|
-
customHeader || !noHeader && /* @__PURE__ */ jsx41(
|
|
7035
|
-
ModalTitle_default,
|
|
7036
|
-
{
|
|
7037
|
-
wrapperRef: modalMobileHeaderRef,
|
|
7038
|
-
className: cn33({
|
|
7039
|
-
"modal__header--hidden": MODALS_LOGIC.IS_HEADER_HIDDEN,
|
|
7040
|
-
"modal__header--sticky": !MODALS_LOGIC.IS_HEADER_HIDDEN && MODALS_LOGIC.IS_HEADER_STICKY
|
|
7041
|
-
}),
|
|
7042
|
-
variant,
|
|
7043
|
-
isForced: forced,
|
|
7044
|
-
onClose: handle.close,
|
|
7045
|
-
noHeaderCloseBtn,
|
|
7046
|
-
children: /* @__PURE__ */ jsx41("span", { id: `${testId}-title`, children: renderModalTitle({ mode, title, onlyTitle }) })
|
|
7047
|
-
}
|
|
7048
|
-
),
|
|
7049
|
-
/* @__PURE__ */ jsx41(
|
|
7050
|
-
"div",
|
|
7051
|
-
{
|
|
7052
|
-
...atributesForModalBody,
|
|
7053
|
-
ref: modalMobileBodyRef,
|
|
7054
|
-
className: cn33("modal__body", {
|
|
7055
|
-
"modal__body--no-footer": noFooter
|
|
7056
|
-
}),
|
|
7057
|
-
role: "document",
|
|
7058
|
-
children
|
|
7059
|
-
}
|
|
7060
|
-
),
|
|
7061
|
-
(!noFooter || customFooter) && /* @__PURE__ */ jsx41(
|
|
7062
|
-
ModalFooter_default,
|
|
7063
|
-
{
|
|
7064
|
-
wrapperRef: modalMobileFooterRef,
|
|
7065
|
-
className: cn33({
|
|
7066
|
-
"modal__footer--hidden": MODALS_LOGIC.IS_FOOTER_HIDDEN,
|
|
7067
|
-
"modal__footer--sticky": !MODALS_LOGIC.IS_FOOTER_HIDDEN && MODALS_LOGIC.IS_FOOTER_STICKY && scrollTop !== scrollHeight,
|
|
7068
|
-
"modal__footer_with-left-content": leftContentOfFooter
|
|
7069
|
-
}),
|
|
7070
|
-
children: customFooter || /* @__PURE__ */ jsxs35(Fragment8, { children: [
|
|
7071
|
-
leftContentOfFooter,
|
|
7072
|
-
(!noCloseBtn || !noConfirmBtn) && /* @__PURE__ */ jsxs35("div", { className: "modal__buttons-block", children: [
|
|
7073
|
-
!noCloseBtn && /* @__PURE__ */ jsx41(
|
|
7074
|
-
Button_default,
|
|
7075
|
-
{
|
|
7076
|
-
testId: "modal",
|
|
7077
|
-
className: cn33(closeBtnClassName, btnClassNames),
|
|
7078
|
-
variant: closeBtnVariant || "dark-outline",
|
|
7079
|
-
onClick: handle.decline,
|
|
7080
|
-
label: closeBtnText || "Cancel",
|
|
7081
|
-
disabled: typeof onDecline === "function" ? declineBtnDisable : closeBtnDisable,
|
|
7082
|
-
icon: closeBtnIcon,
|
|
7083
|
-
isIconRight: isCloseBtnIconPositionRight,
|
|
7084
|
-
tabIndex: 1,
|
|
7085
|
-
"aria-label": "Close modal"
|
|
7086
|
-
}
|
|
7087
|
-
),
|
|
7088
|
-
!noConfirmBtn && /* @__PURE__ */ jsx41(
|
|
7089
|
-
Button_default,
|
|
7090
|
-
{
|
|
7091
|
-
testId: "modal",
|
|
7092
|
-
onClick: handle.confirm,
|
|
7093
|
-
label: confirmBtnLabel || mode && mode?.[0].toUpperCase() + mode?.slice(1) || "Apply",
|
|
7094
|
-
className: cn33("ml5", confirmBtnClassName, btnClassNames),
|
|
7095
|
-
variant: confirmBtnVariant,
|
|
7096
|
-
disabled: confirmBtnDisable,
|
|
7097
|
-
icon: confirmBtnIcon,
|
|
7098
|
-
isIconRight: isConfirmBtnIconPositionRight,
|
|
7099
|
-
"aria-label": "Confirm modal"
|
|
7100
|
-
}
|
|
7101
|
-
)
|
|
7102
|
-
] })
|
|
7103
|
-
] })
|
|
7104
|
-
}
|
|
7105
|
-
)
|
|
7106
|
-
]
|
|
7107
|
-
}
|
|
7108
|
-
)
|
|
7109
|
-
] })
|
|
7110
|
-
)
|
|
7111
|
-
}
|
|
7112
|
-
);
|
|
6646
|
+
import moment9 from "moment-timezone";
|
|
6647
|
+
import { useEffect as useEffect25, useMemo as useMemo13, useRef as useRef14, useState as useState26 } from "react";
|
|
6648
|
+
var DATE_INPUT_FORMAT = "MM/DD/YYYY";
|
|
6649
|
+
function padTime2(time) {
|
|
6650
|
+
return `${time.toString().padStart(2, "0")}:00`;
|
|
7113
6651
|
}
|
|
7114
|
-
|
|
7115
|
-
var Modal_default = Modal;
|
|
7116
|
-
|
|
7117
|
-
// src/Atomic/FormElements/InputDateRange/components/Datepicker.tsx
|
|
7118
|
-
import { Fragment as Fragment9, jsx as jsx44, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
7119
|
-
|
|
7120
|
-
// src/Atomic/FormElements/RangeCalendar/RangeCalendar.js
|
|
7121
|
-
import { jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7122
|
-
import React35, { useEffect as useEffect29, useMemo as useMemo14, useState as useState28 } from "react";
|
|
7123
|
-
import cn34 from "classnames";
|
|
7124
|
-
import moment7 from "moment-timezone";
|
|
7125
|
-
var RangeCalendar = (props) => {
|
|
6652
|
+
var Datepicker2 = (props) => {
|
|
7126
6653
|
const {
|
|
6654
|
+
txt,
|
|
7127
6655
|
className,
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
},
|
|
7138
|
-
startPrevDate,
|
|
7139
|
-
endPrevDate,
|
|
6656
|
+
buttonsTypes = {},
|
|
6657
|
+
values = {},
|
|
6658
|
+
onChange,
|
|
6659
|
+
onChangeMobile,
|
|
6660
|
+
onChangeCompare,
|
|
6661
|
+
onCancel,
|
|
6662
|
+
getSelectedMode,
|
|
6663
|
+
onChangeInterval,
|
|
6664
|
+
isCompareHidden,
|
|
7140
6665
|
limitRange,
|
|
6666
|
+
setActiveInterval,
|
|
7141
6667
|
isShortWeekNames,
|
|
7142
6668
|
minDate,
|
|
7143
6669
|
maxDate,
|
|
7144
6670
|
momentMinDate,
|
|
7145
6671
|
momentMaxDate,
|
|
7146
6672
|
isDontLimitFuture,
|
|
7147
|
-
testId
|
|
6673
|
+
testId,
|
|
6674
|
+
mainId,
|
|
6675
|
+
withMobileLogic,
|
|
6676
|
+
isDoNotPullOutListOfMainContainer
|
|
7148
6677
|
} = props;
|
|
7149
|
-
const
|
|
7150
|
-
const
|
|
7151
|
-
|
|
7152
|
-
|
|
6678
|
+
const { start = null, end = null, compare: compare2 = false } = values;
|
|
6679
|
+
const startDateInputRef = useRef14(null);
|
|
6680
|
+
const endDateInputRef = useRef14(null);
|
|
6681
|
+
const [startDate, setStartDate] = useState26(
|
|
6682
|
+
getIsDateValid(start) ? moment9(start) : ""
|
|
7153
6683
|
);
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
6684
|
+
const [endDate, setEndDate] = useState26(
|
|
6685
|
+
getIsDateValid(end) ? moment9(end) : ""
|
|
6686
|
+
);
|
|
6687
|
+
const dateInterval = getSelectedMode({ start: startDate, end: endDate });
|
|
6688
|
+
const [startDateInput, setStartDateInput] = useState26(null);
|
|
6689
|
+
const [endDateInput, setEndDateInput] = useState26(null);
|
|
6690
|
+
const [isStartFocused, setIsStartFocused] = useState26(false);
|
|
6691
|
+
const [isEndFocused, setIsEndFocused] = useState26(false);
|
|
6692
|
+
const [startHour, setStartHour] = useState26(start ? moment9(start).hour() : 0);
|
|
6693
|
+
const [endHour, setEndHour] = useState26(end ? moment9(end).hour() : 0);
|
|
6694
|
+
const [isCompare, setIsCompare] = useState26(compare2);
|
|
6695
|
+
const [date1, setDate1] = useState26(
|
|
6696
|
+
start ? moment9(start) : moment9().subtract(1, "month")
|
|
6697
|
+
);
|
|
6698
|
+
const [date2, setDate2] = useState26(end ? moment9(end) : moment9());
|
|
6699
|
+
const isNearby = useMemo13(
|
|
6700
|
+
() => moment9(date2).subtract(1, "month").isSame(moment9(date1), "month"),
|
|
6701
|
+
[date1, date2]
|
|
6702
|
+
);
|
|
6703
|
+
const isPreviousPeriodShowed = useMemo13(
|
|
6704
|
+
() => isCompare && !isCompareHidden && startDate && endDate,
|
|
6705
|
+
[startDate, endDate, isCompare]
|
|
6706
|
+
);
|
|
6707
|
+
const prevEndHour = useRef14(endHour);
|
|
6708
|
+
const startPrevDate = useMemo13(() => {
|
|
6709
|
+
if (isPreviousPeriodShowed) {
|
|
6710
|
+
const intervalHoursCount = moment9(endDate).diff(startDate, "hours");
|
|
6711
|
+
return moment9(startDate).subtract(intervalHoursCount, "hours").toDate();
|
|
6712
|
+
} else {
|
|
6713
|
+
return null;
|
|
6714
|
+
}
|
|
6715
|
+
}, [startDate, endDate, isCompare]);
|
|
6716
|
+
const endPrevDate = useMemo13(() => {
|
|
6717
|
+
if (isPreviousPeriodShowed) {
|
|
6718
|
+
return startDate;
|
|
6719
|
+
} else {
|
|
6720
|
+
return null;
|
|
6721
|
+
}
|
|
6722
|
+
}, [startDate, endDate, isCompare]);
|
|
6723
|
+
const title = useMemo13(() => {
|
|
6724
|
+
if (isCompare && !isCompareHidden && startDate && endDate) {
|
|
6725
|
+
return `${moment9(startPrevDate).format("ll")} (${moment9(startPrevDate).format(MAIN_TIME_FORMAT)}) - ${moment9(
|
|
6726
|
+
endPrevDate
|
|
6727
|
+
).format("ll")} (${moment9(endPrevDate).format(MAIN_TIME_FORMAT)})`;
|
|
6728
|
+
} else {
|
|
6729
|
+
return "";
|
|
6730
|
+
}
|
|
6731
|
+
}, [startDate, endDate, isCompare]);
|
|
6732
|
+
const subtractDay = (date) => endHour === 0 ? moment9(date).subtract(1, "days") : moment9(date);
|
|
6733
|
+
const addDay = (date) => endHour === 0 ? moment9(date).add(1, "days") : moment9(date);
|
|
6734
|
+
const getCorrectedDateForDateInput = (key, date) => {
|
|
6735
|
+
if (key === "startDateInput") return moment9(date);
|
|
6736
|
+
return subtractDay(moment9(date));
|
|
6737
|
+
};
|
|
6738
|
+
const setInterval2 = () => {
|
|
6739
|
+
setActiveInterval?.(
|
|
6740
|
+
getActualDateRange({ start: startDate, end: endDate }).intervalKey
|
|
6741
|
+
);
|
|
6742
|
+
};
|
|
6743
|
+
const handleClick = (date) => {
|
|
6744
|
+
prevEndHour.current = 0;
|
|
6745
|
+
if (!startDate || startDate && endDate && !(moment9(startDate).add(1, "d").isSame(endDate, "day") && endHour === 0)) {
|
|
6746
|
+
setStartDate(moment9(date).startOf("day"));
|
|
6747
|
+
setEndDate(moment9(date).add(1, "d").startOf("day"));
|
|
6748
|
+
setStartHour(0);
|
|
6749
|
+
setEndHour(0);
|
|
6750
|
+
} else if (moment9(date).isBefore(moment9(startDate), "day")) {
|
|
6751
|
+
setEndDate(moment9(startDate).add(1, "d").startOf("day"));
|
|
6752
|
+
setStartDate(moment9(date).set("hour", Number.parseInt(startHour.toString(), 10)));
|
|
6753
|
+
} else if (moment9(date).isAfter(moment9(startDate), "day")) {
|
|
6754
|
+
setEndDate(moment9(date).add(1, "d").startOf("day"));
|
|
6755
|
+
}
|
|
6756
|
+
};
|
|
6757
|
+
const handleChangeStartHour = (val) => {
|
|
6758
|
+
setStartHour(Number(val));
|
|
6759
|
+
setStartDate(moment9(startDate || moment9()).set("hour", Number(val)));
|
|
6760
|
+
};
|
|
6761
|
+
const handleChangeEndHour = (val) => {
|
|
6762
|
+
const newHour = Number(val);
|
|
6763
|
+
setEndHour(newHour);
|
|
6764
|
+
let newEndDate = moment9();
|
|
6765
|
+
if (endDate) {
|
|
6766
|
+
if (prevEndHour.current === 0 && newHour !== 0) {
|
|
6767
|
+
newEndDate = moment9(endDate).subtract(1, "days");
|
|
6768
|
+
} else if (prevEndHour.current !== 0 && newHour === 0) {
|
|
6769
|
+
newEndDate = moment9(endDate).add(1, "days");
|
|
7164
6770
|
}
|
|
7165
|
-
result[week][day.weekday()] = { date: day.toDate() };
|
|
7166
|
-
day.add(1, "d");
|
|
7167
6771
|
}
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
const
|
|
7173
|
-
const
|
|
7174
|
-
const
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
6772
|
+
prevEndHour.current = newHour;
|
|
6773
|
+
setEndDate(moment9(newEndDate).set("hour", newHour));
|
|
6774
|
+
};
|
|
6775
|
+
const handleDateInputFocus = (key, e) => {
|
|
6776
|
+
const changeFlag = key === "startDateInput" ? setIsStartFocused : setIsEndFocused;
|
|
6777
|
+
const set = key === "startDateInput" ? setStartDateInput : setEndDateInput;
|
|
6778
|
+
const date = key === "startDateInput" ? startDate : endDate;
|
|
6779
|
+
changeFlag(true);
|
|
6780
|
+
set(date ? getCorrectedDateForDateInput(key, date).format("L") : "");
|
|
6781
|
+
setTimeout(() => {
|
|
6782
|
+
const defaultTarget = key === "startDateInput" ? startDateInputRef.current : endDateInputRef.current;
|
|
6783
|
+
const target = e?.target ?? defaultTarget;
|
|
6784
|
+
target.select?.();
|
|
6785
|
+
}, 0);
|
|
6786
|
+
};
|
|
6787
|
+
const doBlur = (type, e) => {
|
|
6788
|
+
const executor = type === "startDateInput" ? setIsStartFocused : setIsEndFocused;
|
|
6789
|
+
e.target.blur();
|
|
6790
|
+
executor(false);
|
|
6791
|
+
};
|
|
6792
|
+
const processOverflow = (newDateAsString, valueForRollback, key) => {
|
|
6793
|
+
const newDateAsMomentObj = moment9(newDateAsString, DATE_INPUT_FORMAT);
|
|
6794
|
+
if (!newDateAsMomentObj.isValid()) {
|
|
6795
|
+
return valueForRollback;
|
|
6796
|
+
} else {
|
|
6797
|
+
const beforeOfFuture = moment9().endOf("day");
|
|
6798
|
+
const hour = key === "startDateInput" ? startHour : endHour;
|
|
6799
|
+
let output;
|
|
6800
|
+
if (minDate && newDateAsMomentObj.isBefore(momentMinDate)) {
|
|
6801
|
+
output = momentMinDate;
|
|
6802
|
+
} else if (maxDate && newDateAsMomentObj.isAfter(momentMaxDate)) {
|
|
6803
|
+
output = momentMaxDate;
|
|
6804
|
+
} else if (!isDontLimitFuture && newDateAsMomentObj.isAfter(beforeOfFuture)) {
|
|
6805
|
+
output = beforeOfFuture.startOf("day");
|
|
6806
|
+
} else {
|
|
6807
|
+
output = newDateAsMomentObj;
|
|
6808
|
+
}
|
|
6809
|
+
if (key === "endDateInput") {
|
|
6810
|
+
output = addDay(output);
|
|
6811
|
+
}
|
|
6812
|
+
return output.set("hour", Number.parseInt(hour.toString(), 10));
|
|
6813
|
+
}
|
|
6814
|
+
};
|
|
6815
|
+
const handleDateInputBlur = (key, e) => {
|
|
6816
|
+
const reserveValue = key === "startDateInput" ? startDateInput : endDateInput;
|
|
6817
|
+
const valueForRollback = key === "startDateInput" ? startDate : endDate;
|
|
6818
|
+
const execute = key === "startDateInput" ? setStartDate : setEndDate;
|
|
6819
|
+
const executeForCalendar = key === "startDateInput" ? setDate1 : setDate2;
|
|
6820
|
+
const prepareValueForCalendar = (newDate) => {
|
|
6821
|
+
if (key === "endDateInput") return newDate;
|
|
6822
|
+
return moment9(newDate).isSameOrAfter(moment9(date2), "month") ? moment9(date2).subtract(1, "month") : moment9(newDate);
|
|
6823
|
+
};
|
|
6824
|
+
const newDateValue = e?.target?.value ?? reserveValue;
|
|
6825
|
+
const processedNewDate = processOverflow(
|
|
6826
|
+
newDateValue,
|
|
6827
|
+
valueForRollback,
|
|
6828
|
+
key
|
|
7190
6829
|
);
|
|
7191
|
-
|
|
7192
|
-
|
|
6830
|
+
execute(processedNewDate);
|
|
6831
|
+
executeForCalendar(prepareValueForCalendar(processedNewDate));
|
|
6832
|
+
doBlur(key, e);
|
|
6833
|
+
};
|
|
6834
|
+
const handleKeyPressed = (code, e, type) => {
|
|
6835
|
+
if (code === 13) {
|
|
6836
|
+
const syntheticEvent = {
|
|
6837
|
+
target: e.target,
|
|
6838
|
+
relatedTarget: null
|
|
6839
|
+
};
|
|
6840
|
+
handleDateInputBlur(type, syntheticEvent);
|
|
6841
|
+
}
|
|
6842
|
+
if (code === 27) doBlur(type, e);
|
|
6843
|
+
};
|
|
6844
|
+
const getStartHourItems = () => [...Array.from({ length: 24 }).keys()].map((hour) => ({
|
|
6845
|
+
label: padTime2(hour),
|
|
6846
|
+
value: hour,
|
|
6847
|
+
disabled: moment9(startDate).isSame(endDate, "day") && endHour <= hour
|
|
6848
|
+
}));
|
|
6849
|
+
const getEndHourItems = () => [...Array.from({ length: 24 }).keys()].map((hour) => ({
|
|
6850
|
+
label: padTime2(hour + 1),
|
|
6851
|
+
value: hour === 23 ? 0 : hour + 1,
|
|
6852
|
+
disabled: (moment9(startDate).isSame(endDate, "day") || moment9(startDate).isSame(
|
|
6853
|
+
moment9(endDate).subtract(1, "days"),
|
|
6854
|
+
"day"
|
|
6855
|
+
) && endHour === 0) && hour < startHour
|
|
6856
|
+
}));
|
|
6857
|
+
const renderButtons = () => /* @__PURE__ */ jsxs35(Fragment8, { children: [
|
|
6858
|
+
/* @__PURE__ */ jsx40(
|
|
6859
|
+
Button_default,
|
|
7193
6860
|
{
|
|
7194
|
-
className:
|
|
7195
|
-
onClick:
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
6861
|
+
className: "date-picker__button",
|
|
6862
|
+
onClick: () => onCancel?.(),
|
|
6863
|
+
variant: buttonsTypes?.cancel,
|
|
6864
|
+
children: txt?.buttons?.cancel || "Cancel"
|
|
6865
|
+
}
|
|
6866
|
+
),
|
|
6867
|
+
/* @__PURE__ */ jsx40(
|
|
6868
|
+
Button_default,
|
|
6869
|
+
{
|
|
6870
|
+
className: "date-picker__button",
|
|
6871
|
+
variant: buttonsTypes?.apply,
|
|
6872
|
+
disabled: !startDate || !endDate,
|
|
6873
|
+
onClick: () => onChange?.({
|
|
6874
|
+
start: moment9(startDate).format(MAIN_FORMAT),
|
|
6875
|
+
end: moment9(endDate).format(MAIN_FORMAT),
|
|
6876
|
+
startPrevDate: moment9(startPrevDate).format(MAIN_FORMAT),
|
|
6877
|
+
endPrevDate: moment9(endPrevDate).format(MAIN_FORMAT),
|
|
6878
|
+
compare: isCompare
|
|
6879
|
+
}),
|
|
6880
|
+
children: txt?.buttons?.apply || "apply"
|
|
6881
|
+
}
|
|
6882
|
+
)
|
|
6883
|
+
] });
|
|
6884
|
+
const renderPreviousPeriod = () => /* @__PURE__ */ jsxs35(Fragment8, { children: [
|
|
6885
|
+
txt?.labels?.previousPeriod || "",
|
|
6886
|
+
":",
|
|
6887
|
+
" ",
|
|
6888
|
+
/* @__PURE__ */ jsx40("span", { className: "date-picker__previous-period-interval", children: title })
|
|
6889
|
+
] });
|
|
6890
|
+
useEffect25(() => {
|
|
6891
|
+
if (moment9(startDate).isSameOrAfter(endDate)) {
|
|
6892
|
+
setStartDate(moment9(endDate).subtract(1, "d"));
|
|
6893
|
+
setDate1(moment9(endDate).subtract(1, "d"));
|
|
6894
|
+
}
|
|
6895
|
+
}, [startDate]);
|
|
6896
|
+
useEffect25(() => {
|
|
6897
|
+
if (moment9(endDate).isSameOrBefore(startDate)) {
|
|
6898
|
+
setEndDate(moment9(startDate).add(1, "d"));
|
|
6899
|
+
setDate2(moment9(startDate).add(1, "d"));
|
|
6900
|
+
}
|
|
6901
|
+
}, [endDate]);
|
|
6902
|
+
useEffect25(() => {
|
|
6903
|
+
if (moment9(startDate).isBefore(moment9(endDate), "month")) {
|
|
6904
|
+
setDate1(moment9(startDate));
|
|
6905
|
+
setDate2(moment9(endDate));
|
|
6906
|
+
}
|
|
6907
|
+
setInterval2();
|
|
6908
|
+
}, [startDate, endDate]);
|
|
6909
|
+
useEffect25(() => {
|
|
6910
|
+
if (moment9(date1).isSameOrAfter(moment9(date2), "month") && !withMobileLogic) {
|
|
6911
|
+
setDate1(moment9(date2).subtract(1, "month"));
|
|
6912
|
+
}
|
|
6913
|
+
}, [date1, date2]);
|
|
6914
|
+
useEffect25(() => {
|
|
6915
|
+
onChangeInterval(dateInterval);
|
|
6916
|
+
}, [dateInterval]);
|
|
6917
|
+
useEffect25(() => {
|
|
6918
|
+
if (typeof onChangeMobile === "function") {
|
|
6919
|
+
onChangeMobile({
|
|
6920
|
+
start: moment9(startDate).format(MAIN_FORMAT),
|
|
6921
|
+
end: moment9(endDate).format(MAIN_FORMAT),
|
|
6922
|
+
startPrevDate: moment9(startPrevDate).format(MAIN_FORMAT),
|
|
6923
|
+
endPrevDate: moment9(endPrevDate).format(MAIN_FORMAT),
|
|
6924
|
+
compare: isCompare
|
|
6925
|
+
});
|
|
6926
|
+
}
|
|
6927
|
+
}, [startDate, endDate, startPrevDate, endPrevDate, isCompare]);
|
|
6928
|
+
const renderRowStart = () => {
|
|
6929
|
+
return /* @__PURE__ */ jsxs35("div", { className: "date-picker__date-row", children: [
|
|
6930
|
+
/* @__PURE__ */ jsx40(
|
|
6931
|
+
DateInput_default,
|
|
6932
|
+
{
|
|
6933
|
+
ref: startDateInputRef,
|
|
6934
|
+
testId: `datepicker-${testId}_start-date-input`,
|
|
6935
|
+
RC: "date-picker__date-input",
|
|
6936
|
+
className: cn33("date-picker__date-input"),
|
|
6937
|
+
isFocused: isStartFocused,
|
|
6938
|
+
value: startDateInput,
|
|
6939
|
+
date: getCorrectedDateForDateInput("startDateInput", startDate),
|
|
6940
|
+
disabled: !startDate,
|
|
6941
|
+
onChange: setStartDateInput,
|
|
6942
|
+
onFocus: (e) => handleDateInputFocus("startDateInput", e),
|
|
6943
|
+
onBlur: (e) => handleDateInputBlur("startDateInput", e),
|
|
6944
|
+
onKeyUp: (code, e) => handleKeyPressed(+code, e, "startDateInput")
|
|
6945
|
+
}
|
|
6946
|
+
),
|
|
6947
|
+
/* @__PURE__ */ jsx40(
|
|
6948
|
+
Dropdown_default,
|
|
6949
|
+
{
|
|
6950
|
+
testId,
|
|
6951
|
+
id: `datepicker-id-${mainId}_start-hour-select-input`,
|
|
6952
|
+
className: cn33("date-picker__hour-select-input"),
|
|
6953
|
+
onChange: (value) => handleChangeStartHour(value),
|
|
6954
|
+
value: startHour,
|
|
6955
|
+
options: getStartHourItems(),
|
|
6956
|
+
disabled: !startDate,
|
|
6957
|
+
isDoNotPullOutListOfMainContainer,
|
|
6958
|
+
withMobileLogic
|
|
6959
|
+
}
|
|
6960
|
+
)
|
|
6961
|
+
] });
|
|
7208
6962
|
};
|
|
7209
|
-
const
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
Arrow_default,
|
|
6963
|
+
const renderRowEnd = () => {
|
|
6964
|
+
return /* @__PURE__ */ jsxs35("div", { className: "date-picker__date-row", children: [
|
|
6965
|
+
/* @__PURE__ */ jsx40(
|
|
6966
|
+
DateInput_default,
|
|
7214
6967
|
{
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
className: "
|
|
6968
|
+
ref: endDateInputRef,
|
|
6969
|
+
testId: `datepicker-${testId}_start-date-input`,
|
|
6970
|
+
RC: "date-picker__date-input",
|
|
6971
|
+
className: cn33("date-picker__date-input"),
|
|
6972
|
+
isFocused: isEndFocused,
|
|
6973
|
+
value: endDateInput,
|
|
6974
|
+
date: getCorrectedDateForDateInput("endDateInput", endDate),
|
|
6975
|
+
disabled: !endDate,
|
|
6976
|
+
onChange: setEndDateInput,
|
|
6977
|
+
onFocus: (e) => handleDateInputFocus("endDateInput", e),
|
|
6978
|
+
onBlur: (e) => handleDateInputBlur("endDateInput", e),
|
|
6979
|
+
onKeyUp: (code, e) => handleKeyPressed(+code, e, "endDateInput")
|
|
7219
6980
|
}
|
|
7220
6981
|
),
|
|
7221
|
-
/* @__PURE__ */
|
|
7222
|
-
|
|
7223
|
-
Arrow_default,
|
|
6982
|
+
/* @__PURE__ */ jsx40(
|
|
6983
|
+
Dropdown_default,
|
|
7224
6984
|
{
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
6985
|
+
testId,
|
|
6986
|
+
id: `datepicker-id-${mainId}_end-hour-select-input`,
|
|
6987
|
+
className: cn33("date-picker__hour-select-input"),
|
|
6988
|
+
onChange: (value) => handleChangeEndHour(value),
|
|
6989
|
+
value: endHour,
|
|
6990
|
+
options: getEndHourItems(),
|
|
6991
|
+
disabled: !endDate,
|
|
6992
|
+
isDoNotPullOutListOfMainContainer,
|
|
6993
|
+
withMobileLogic
|
|
7232
6994
|
}
|
|
7233
6995
|
)
|
|
7234
|
-
] })
|
|
7235
|
-
|
|
7236
|
-
|
|
6996
|
+
] });
|
|
6997
|
+
};
|
|
6998
|
+
const renderCalendarStart = () => {
|
|
6999
|
+
return /* @__PURE__ */ jsx40(
|
|
7000
|
+
RangeCalendar_default,
|
|
7001
|
+
{
|
|
7002
|
+
testId,
|
|
7003
|
+
className: "date-picker__calendar",
|
|
7004
|
+
date: date1,
|
|
7005
|
+
setDate: setDate1,
|
|
7006
|
+
allowNext: withMobileLogic ? !moment9(date1).startOf("month").isSameOrAfter(moment9().startOf("day"), "months") : !isNearby,
|
|
7007
|
+
startDate,
|
|
7008
|
+
endDate,
|
|
7009
|
+
startPrevDate,
|
|
7010
|
+
endPrevDate,
|
|
7011
|
+
onClick: handleClick,
|
|
7012
|
+
limitRange,
|
|
7013
|
+
isShortWeekNames,
|
|
7014
|
+
minDate,
|
|
7015
|
+
maxDate,
|
|
7016
|
+
momentMinDate,
|
|
7017
|
+
momentMaxDate
|
|
7018
|
+
}
|
|
7019
|
+
);
|
|
7020
|
+
};
|
|
7021
|
+
const renderCalendarEnd = () => {
|
|
7022
|
+
return /* @__PURE__ */ jsx40(
|
|
7023
|
+
RangeCalendar_default,
|
|
7024
|
+
{
|
|
7025
|
+
className: "date-picker__calendar",
|
|
7026
|
+
date: date2,
|
|
7027
|
+
setDate: setDate2,
|
|
7028
|
+
allowPrev: !isNearby,
|
|
7029
|
+
startDate,
|
|
7030
|
+
endDate,
|
|
7031
|
+
startPrevDate,
|
|
7032
|
+
endPrevDate,
|
|
7033
|
+
onClick: handleClick,
|
|
7034
|
+
isShortWeekNames,
|
|
7035
|
+
minDate,
|
|
7036
|
+
maxDate,
|
|
7037
|
+
momentMinDate,
|
|
7038
|
+
momentMaxDate,
|
|
7039
|
+
isDontLimitFuture
|
|
7040
|
+
}
|
|
7041
|
+
);
|
|
7042
|
+
};
|
|
7043
|
+
const render = () => {
|
|
7044
|
+
return /* @__PURE__ */ jsxs35("div", { className: cn33("date-picker", className), children: [
|
|
7045
|
+
/* @__PURE__ */ jsxs35("div", { className: "date-picker__header", children: [
|
|
7046
|
+
/* @__PURE__ */ jsxs35("div", { className: "date-picker__inputs-block", children: [
|
|
7047
|
+
renderRowStart(),
|
|
7048
|
+
/* @__PURE__ */ jsx40("div", { className: "date-picker__inputs-separator date-picker__header--gray", children: "\u2014" }),
|
|
7049
|
+
renderRowEnd()
|
|
7050
|
+
] }),
|
|
7051
|
+
isCompare && !isCompareHidden && startDate && endDate && /* @__PURE__ */ jsx40("div", { className: "date-picker__previous-period", children: renderPreviousPeriod() })
|
|
7052
|
+
] }),
|
|
7053
|
+
/* @__PURE__ */ jsx40("div", { className: "date-picker__calendars", children: /* @__PURE__ */ jsxs35("div", { className: "date-picker__calendars-wrapper", children: [
|
|
7054
|
+
renderCalendarStart(),
|
|
7055
|
+
renderCalendarEnd()
|
|
7056
|
+
] }) }),
|
|
7057
|
+
/* @__PURE__ */ jsxs35(
|
|
7237
7058
|
"div",
|
|
7238
7059
|
{
|
|
7239
|
-
className: "
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7060
|
+
className: cn33("date-picker__footer", {
|
|
7061
|
+
"date-picker__footer_once-element": isCompareHidden
|
|
7062
|
+
}),
|
|
7063
|
+
children: [
|
|
7064
|
+
!isCompareHidden ? /* @__PURE__ */ jsx40("div", { className: "date-picker__compare-block", children: /* @__PURE__ */ jsx40("div", { className: "mr5", children: /* @__PURE__ */ jsx40(
|
|
7065
|
+
Switcher_default,
|
|
7066
|
+
{
|
|
7067
|
+
label: txt?.labels?.compare || "Compare",
|
|
7068
|
+
isActive: isCompare,
|
|
7069
|
+
onChange: () => {
|
|
7070
|
+
onChangeCompare?.(!isCompare);
|
|
7071
|
+
setIsCompare((state) => !state);
|
|
7072
|
+
}
|
|
7073
|
+
}
|
|
7074
|
+
) }) }) : /* @__PURE__ */ jsx40("div", {}),
|
|
7075
|
+
/* @__PURE__ */ jsx40("div", { className: "date-picker__buttons-block", children: renderButtons() })
|
|
7076
|
+
]
|
|
7077
|
+
}
|
|
7078
|
+
)
|
|
7079
|
+
] });
|
|
7080
|
+
};
|
|
7081
|
+
const renderMobile = () => {
|
|
7082
|
+
return /* @__PURE__ */ jsxs35("div", { className: cn33("date-picker", className), children: [
|
|
7083
|
+
/* @__PURE__ */ jsxs35("div", { className: "date-picker__header", children: [
|
|
7084
|
+
/* @__PURE__ */ jsxs35("div", { className: "date-picker__inputs-block", children: [
|
|
7085
|
+
renderRowStart(),
|
|
7086
|
+
/* @__PURE__ */ jsx40("div", { className: "date-picker__inputs-separator date-picker__header--gray", children: "\u2014" }),
|
|
7087
|
+
renderRowEnd()
|
|
7088
|
+
] }),
|
|
7089
|
+
isCompare && !isCompareHidden && startDate && endDate && /* @__PURE__ */ jsx40("div", { className: "date-picker__previous-period", children: renderPreviousPeriod() })
|
|
7090
|
+
] }),
|
|
7091
|
+
/* @__PURE__ */ jsx40("div", { className: "date-picker__calendars", children: /* @__PURE__ */ jsx40("div", { className: "date-picker__calendars-wrapper", children: renderCalendarStart() }) })
|
|
7092
|
+
] });
|
|
7093
|
+
};
|
|
7094
|
+
return withMobileLogic ? renderMobile() : render();
|
|
7247
7095
|
};
|
|
7248
|
-
var
|
|
7096
|
+
var Datepicker_default2 = Datepicker2;
|
|
7249
7097
|
|
|
7250
|
-
// src/Atomic/FormElements/InputDateRange/components/
|
|
7251
|
-
import { jsx as
|
|
7098
|
+
// src/Atomic/FormElements/InputDateRange/components/OpenedPart.tsx
|
|
7099
|
+
import { Fragment as Fragment10, jsx as jsx46, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
7252
7100
|
|
|
7253
|
-
// src/Functions/
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
};
|
|
7261
|
-
|
|
7262
|
-
|
|
7101
|
+
// src/Functions/useResize.js
|
|
7102
|
+
import { useEffect as useEffect26, useLayoutEffect as useLayoutEffect3, useState as useState27 } from "react";
|
|
7103
|
+
var useResize = (element) => {
|
|
7104
|
+
const [elemPosition, setElemPosition] = useState27("");
|
|
7105
|
+
const onResize = (elemRightPosition) => {
|
|
7106
|
+
if (elemRightPosition > document.documentElement.clientWidth) {
|
|
7107
|
+
return setElemPosition("left");
|
|
7108
|
+
} else setElemPosition("");
|
|
7109
|
+
};
|
|
7110
|
+
useEffect26(() => {
|
|
7111
|
+
const elemRightPosition = element?.current?.getBoundingClientRect().right + 20;
|
|
7112
|
+
window.addEventListener("resize", () => onResize(elemRightPosition));
|
|
7113
|
+
return () => {
|
|
7114
|
+
window.removeEventListener("resize", () => setElemPosition(""));
|
|
7115
|
+
};
|
|
7116
|
+
}, []);
|
|
7117
|
+
useLayoutEffect3(() => {
|
|
7118
|
+
const elemRightPosition = element?.current?.getBoundingClientRect().right + 20;
|
|
7119
|
+
if (elemRightPosition > document.documentElement.clientWidth) {
|
|
7120
|
+
return setElemPosition("left");
|
|
7121
|
+
}
|
|
7122
|
+
}, []);
|
|
7123
|
+
return { elemPosition };
|
|
7263
7124
|
};
|
|
7264
7125
|
|
|
7265
|
-
// src/Atomic/
|
|
7266
|
-
import
|
|
7267
|
-
import moment8 from "moment-timezone";
|
|
7268
|
-
function handleDateInputOnChange(value) {
|
|
7269
|
-
const replace = (val) => val?.replace(/[^0-9/]/g, "");
|
|
7270
|
-
const input = replace(value);
|
|
7271
|
-
const lastSymbol = input ? input.slice(-1) : "";
|
|
7272
|
-
const previousValue = input ? input.slice(0, input.length - 1) : "";
|
|
7273
|
-
if (value.length > 10 || lastSymbol === "/") return previousValue;
|
|
7274
|
-
return previousValue.length === 2 || previousValue.length === 5 ? `${previousValue}/${lastSymbol}` : input;
|
|
7275
|
-
}
|
|
7276
|
-
function DateInput({ ref, ...props }) {
|
|
7277
|
-
const {
|
|
7278
|
-
RC: RC36,
|
|
7279
|
-
className,
|
|
7280
|
-
testId,
|
|
7281
|
-
isFocused,
|
|
7282
|
-
disabled,
|
|
7283
|
-
value,
|
|
7284
|
-
date,
|
|
7285
|
-
prepareDate,
|
|
7286
|
-
onChange,
|
|
7287
|
-
onFocus,
|
|
7288
|
-
onBlur,
|
|
7289
|
-
onKeyUp
|
|
7290
|
-
} = props;
|
|
7291
|
-
const preparedDate = (() => {
|
|
7292
|
-
const prepareDateDefault = (date2) => moment8(date2).format("MM/DD/YYYY");
|
|
7293
|
-
const output = prepareDate?.(date) ?? prepareDateDefault(date);
|
|
7294
|
-
return (output?.toString?.().toLowerCase() || "") !== "invalid date" ? output : "";
|
|
7295
|
-
})();
|
|
7296
|
-
return isFocused ? /* @__PURE__ */ jsx43(
|
|
7297
|
-
Input_default,
|
|
7298
|
-
{
|
|
7299
|
-
ref,
|
|
7300
|
-
testId,
|
|
7301
|
-
className: cn35(className, `${RC36}-interactive`),
|
|
7302
|
-
value,
|
|
7303
|
-
disabled,
|
|
7304
|
-
onChange: (value2) => onChange(handleDateInputOnChange(value2)),
|
|
7305
|
-
onBlur,
|
|
7306
|
-
onKeyUp,
|
|
7307
|
-
...NUMERIC_KEYBOARD
|
|
7308
|
-
}
|
|
7309
|
-
) : /* @__PURE__ */ jsx43(
|
|
7310
|
-
"div",
|
|
7311
|
-
{
|
|
7312
|
-
className: cn35(className, `${RC36}-emulation`, {
|
|
7313
|
-
[`${RC36}-emulation_disabled`]: disabled
|
|
7314
|
-
}),
|
|
7315
|
-
onClick: disabled ? void 0 : onFocus,
|
|
7316
|
-
children: /* @__PURE__ */ jsx43("span", { className: cn35(""), children: preparedDate })
|
|
7317
|
-
}
|
|
7318
|
-
);
|
|
7319
|
-
}
|
|
7320
|
-
var DateInput_default = DateInput;
|
|
7126
|
+
// src/Atomic/UI/Modal/Modal.tsx
|
|
7127
|
+
import { Fragment as Fragment9, jsx as jsx44, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
7321
7128
|
|
|
7322
|
-
// src/
|
|
7323
|
-
import
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
var DATE_INPUT_FORMAT = "MM/DD/YYYY";
|
|
7327
|
-
function padTime2(time) {
|
|
7328
|
-
return `${time.toString().padStart(2, "0")}:00`;
|
|
7129
|
+
// src/Functions/useKeyPress/useKeyPress.ts
|
|
7130
|
+
import { useCallback as useCallback5, useEffect as useEffect27, useState as useState28 } from "react";
|
|
7131
|
+
function isISuspendProcessing(x) {
|
|
7132
|
+
return getIsOnlyAnObject(x) && Object.values(x).every((v) => typeof v === "function");
|
|
7329
7133
|
}
|
|
7330
|
-
|
|
7331
|
-
const
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
isShortWeekNames,
|
|
7346
|
-
minDate,
|
|
7347
|
-
maxDate,
|
|
7348
|
-
momentMinDate,
|
|
7349
|
-
momentMaxDate,
|
|
7350
|
-
isDontLimitFuture,
|
|
7351
|
-
testId,
|
|
7352
|
-
mainId,
|
|
7353
|
-
withMobileLogic,
|
|
7354
|
-
isDoNotPullOutListOfMainContainer
|
|
7355
|
-
} = props;
|
|
7356
|
-
const { start = null, end = null, compare: compare2 = false } = values;
|
|
7357
|
-
const startDateInputRef = useRef17(null);
|
|
7358
|
-
const endDateInputRef = useRef17(null);
|
|
7359
|
-
const [startDate, setStartDate] = useState29(
|
|
7360
|
-
getIsDateValid(start) ? moment9(start) : ""
|
|
7361
|
-
);
|
|
7362
|
-
const [endDate, setEndDate] = useState29(
|
|
7363
|
-
getIsDateValid(end) ? moment9(end) : ""
|
|
7364
|
-
);
|
|
7365
|
-
const dateInterval = getSelectedMode({ start: startDate, end: endDate });
|
|
7366
|
-
const [startDateInput, setStartDateInput] = useState29(null);
|
|
7367
|
-
const [endDateInput, setEndDateInput] = useState29(null);
|
|
7368
|
-
const [isStartFocused, setIsStartFocused] = useState29(false);
|
|
7369
|
-
const [isEndFocused, setIsEndFocused] = useState29(false);
|
|
7370
|
-
const [startHour, setStartHour] = useState29(start ? moment9(start).hour() : 0);
|
|
7371
|
-
const [endHour, setEndHour] = useState29(end ? moment9(end).hour() : 0);
|
|
7372
|
-
const [isCompare, setIsCompare] = useState29(compare2);
|
|
7373
|
-
const [date1, setDate1] = useState29(
|
|
7374
|
-
start ? moment9(start) : moment9().subtract(1, "month")
|
|
7134
|
+
function useKeyPress(targetKey, clamping = true, isForbidden, suspendProcessing) {
|
|
7135
|
+
const [keyPressed, setKeyPressed] = useState28(false);
|
|
7136
|
+
const safelySuspendProcessing = isISuspendProcessing(suspendProcessing) ? suspendProcessing : {};
|
|
7137
|
+
const downHandler = useCallback5(
|
|
7138
|
+
(event) => {
|
|
7139
|
+
const { key, repeat, altKey, ctrlKey, shiftKey, metaKey } = event;
|
|
7140
|
+
const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
|
|
7141
|
+
if (key === targetKey && isPressingWithoutAuxiliaryKeys && !safelySuspendProcessing[key]?.(event)) {
|
|
7142
|
+
if (!clamping && repeat) return;
|
|
7143
|
+
setKeyPressed(true);
|
|
7144
|
+
}
|
|
7145
|
+
},
|
|
7146
|
+
// ? Намерянно в зависимостях используем именно входной suspendProcessing,
|
|
7147
|
+
// ? хоть в коде используем "безопасный"
|
|
7148
|
+
[clamping, targetKey, suspendProcessing]
|
|
7375
7149
|
);
|
|
7376
|
-
const
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7150
|
+
const upHandler = useCallback5(
|
|
7151
|
+
(event) => {
|
|
7152
|
+
const { key, repeat, altKey, ctrlKey, shiftKey, metaKey } = event;
|
|
7153
|
+
const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
|
|
7154
|
+
if (key === targetKey && isPressingWithoutAuxiliaryKeys && !safelySuspendProcessing[key]?.(event)) {
|
|
7155
|
+
if (!clamping && repeat) return;
|
|
7156
|
+
setKeyPressed(false);
|
|
7157
|
+
}
|
|
7158
|
+
},
|
|
7159
|
+
// ? Намерянно в зависимостях используем именно входной suspendProcessing,
|
|
7160
|
+
// ? хоть в коде используем "безопасный"
|
|
7161
|
+
[clamping, targetKey, suspendProcessing]
|
|
7380
7162
|
);
|
|
7381
|
-
|
|
7382
|
-
() =>
|
|
7383
|
-
|
|
7163
|
+
useEffect27(
|
|
7164
|
+
() => {
|
|
7165
|
+
const handleDown = (event) => downHandler(event);
|
|
7166
|
+
const handleUp = (event) => upHandler(event);
|
|
7167
|
+
if (!isForbidden) {
|
|
7168
|
+
window.addEventListener("keydown", handleDown);
|
|
7169
|
+
window.addEventListener("keyup", handleUp);
|
|
7170
|
+
}
|
|
7171
|
+
return () => {
|
|
7172
|
+
window.removeEventListener("keydown", handleDown);
|
|
7173
|
+
window.removeEventListener("keyup", handleUp);
|
|
7174
|
+
};
|
|
7175
|
+
},
|
|
7176
|
+
// ? Намерянно в зависимостях используем именно входной suspendProcessing,
|
|
7177
|
+
// ? хоть в коде используем "безопасный"
|
|
7178
|
+
[downHandler, upHandler, isForbidden, suspendProcessing]
|
|
7384
7179
|
);
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
if (
|
|
7403
|
-
|
|
7404
|
-
endPrevDate
|
|
7405
|
-
).format("ll")} (${moment9(endPrevDate).format(MAIN_TIME_FORMAT)})`;
|
|
7406
|
-
} else {
|
|
7407
|
-
return "";
|
|
7408
|
-
}
|
|
7409
|
-
}, [startDate, endDate, isCompare]);
|
|
7410
|
-
const subtractDay = (date) => endHour === 0 ? moment9(date).subtract(1, "days") : moment9(date);
|
|
7411
|
-
const addDay = (date) => endHour === 0 ? moment9(date).add(1, "days") : moment9(date);
|
|
7412
|
-
const getCorrectedDateForDateInput = (key, date) => {
|
|
7413
|
-
if (key === "startDateInput") return moment9(date);
|
|
7414
|
-
return subtractDay(moment9(date));
|
|
7415
|
-
};
|
|
7416
|
-
const setInterval2 = () => {
|
|
7417
|
-
setActiveInterval?.(
|
|
7418
|
-
getActualDateRange({ start: startDate, end: endDate }).intervalKey
|
|
7419
|
-
);
|
|
7420
|
-
};
|
|
7421
|
-
const handleClick = (date) => {
|
|
7422
|
-
prevEndHour.current = 0;
|
|
7423
|
-
if (!startDate || startDate && endDate && !(moment9(startDate).add(1, "d").isSame(endDate, "day") && endHour === 0)) {
|
|
7424
|
-
setStartDate(moment9(date).startOf("day"));
|
|
7425
|
-
setEndDate(moment9(date).add(1, "d").startOf("day"));
|
|
7426
|
-
setStartHour(0);
|
|
7427
|
-
setEndHour(0);
|
|
7428
|
-
} else if (moment9(date).isBefore(moment9(startDate), "day")) {
|
|
7429
|
-
setEndDate(moment9(startDate).add(1, "d").startOf("day"));
|
|
7430
|
-
setStartDate(moment9(date).set("hour", Number.parseInt(startHour.toString(), 10)));
|
|
7431
|
-
} else if (moment9(date).isAfter(moment9(startDate), "day")) {
|
|
7432
|
-
setEndDate(moment9(date).add(1, "d").startOf("day"));
|
|
7180
|
+
return keyPressed;
|
|
7181
|
+
}
|
|
7182
|
+
var useKeyPress_default = useKeyPress;
|
|
7183
|
+
|
|
7184
|
+
// src/Functions/useKeyPress/useHandleKeyPress.ts
|
|
7185
|
+
import { useEffect as useEffect28 } from "react";
|
|
7186
|
+
function useHandleKeyPress({
|
|
7187
|
+
escCallback,
|
|
7188
|
+
enterCallback,
|
|
7189
|
+
withClamping = true,
|
|
7190
|
+
withEventManagementStructure,
|
|
7191
|
+
suspendProcessing = null
|
|
7192
|
+
}) {
|
|
7193
|
+
const { isWithSubmitAndCloseManagement } = withEventManagementStructure || {};
|
|
7194
|
+
const isPressEnter = useKeyPress_default("Enter", withClamping, isWithSubmitAndCloseManagement, suspendProcessing);
|
|
7195
|
+
const isPressEscape = useKeyPress_default("Escape", withClamping, isWithSubmitAndCloseManagement, suspendProcessing);
|
|
7196
|
+
useEffect28(() => {
|
|
7197
|
+
if (!isWithSubmitAndCloseManagement && isPressEscape && typeof escCallback === "function") {
|
|
7198
|
+
escCallback();
|
|
7433
7199
|
}
|
|
7434
|
-
};
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
};
|
|
7439
|
-
const handleChangeEndHour = (val) => {
|
|
7440
|
-
const newHour = Number(val);
|
|
7441
|
-
setEndHour(newHour);
|
|
7442
|
-
let newEndDate = moment9();
|
|
7443
|
-
if (endDate) {
|
|
7444
|
-
if (prevEndHour.current === 0 && newHour !== 0) {
|
|
7445
|
-
newEndDate = moment9(endDate).subtract(1, "days");
|
|
7446
|
-
} else if (prevEndHour.current !== 0 && newHour === 0) {
|
|
7447
|
-
newEndDate = moment9(endDate).add(1, "days");
|
|
7448
|
-
}
|
|
7200
|
+
}, [isPressEscape, escCallback]);
|
|
7201
|
+
useEffect28(() => {
|
|
7202
|
+
if (!isWithSubmitAndCloseManagement && isPressEnter && typeof enterCallback === "function") {
|
|
7203
|
+
enterCallback();
|
|
7449
7204
|
}
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7205
|
+
}, [isPressEnter, enterCallback]);
|
|
7206
|
+
}
|
|
7207
|
+
var useHandleKeyPress_default = useHandleKeyPress;
|
|
7208
|
+
|
|
7209
|
+
// src/Atomic/UI/Modal/partials/_constants.ts
|
|
7210
|
+
var DEFAULT_EVENT_OPTIONS = Object.freeze({
|
|
7211
|
+
bubbles: true,
|
|
7212
|
+
cancelable: true,
|
|
7213
|
+
composed: false
|
|
7214
|
+
});
|
|
7215
|
+
var ModalEventsInnerKeys = /* @__PURE__ */ ((ModalEventsInnerKeys2) => {
|
|
7216
|
+
ModalEventsInnerKeys2["iGotAnEnterKeyPress"] = "iGotAnEnterKeyPress";
|
|
7217
|
+
ModalEventsInnerKeys2["iGotAnEscKeyPress"] = "iGotAnEscKeyPress";
|
|
7218
|
+
return ModalEventsInnerKeys2;
|
|
7219
|
+
})(ModalEventsInnerKeys || {});
|
|
7220
|
+
var EVENTS = Object.freeze({
|
|
7221
|
+
["iGotAnEnterKeyPress" /* iGotAnEnterKeyPress */]: {
|
|
7222
|
+
innerKey: "iGotAnEnterKeyPress" /* iGotAnEnterKeyPress */,
|
|
7223
|
+
name: "modal:i-got-an-enter-key-press",
|
|
7224
|
+
shortName: "enterIsPressed",
|
|
7225
|
+
middlewareKey: "Enter",
|
|
7226
|
+
options: DEFAULT_EVENT_OPTIONS
|
|
7227
|
+
},
|
|
7228
|
+
["iGotAnEscKeyPress" /* iGotAnEscKeyPress */]: {
|
|
7229
|
+
innerKey: "iGotAnEscKeyPress" /* iGotAnEscKeyPress */,
|
|
7230
|
+
name: "modal:i-got-an-esc-key-press",
|
|
7231
|
+
shortName: "escIsPressed",
|
|
7232
|
+
middlewareKey: "Escape",
|
|
7233
|
+
options: DEFAULT_EVENT_OPTIONS
|
|
7234
|
+
}
|
|
7235
|
+
});
|
|
7236
|
+
|
|
7237
|
+
// src/Atomic/UI/Modal/partials/_utils.ts
|
|
7238
|
+
function getWithEventManagementStructure(modalId, withEventManagement) {
|
|
7239
|
+
const output = {
|
|
7240
|
+
isWithSubmitAndCloseManagement: false
|
|
7469
7241
|
};
|
|
7470
|
-
const
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
return valueForRollback;
|
|
7242
|
+
for (const key in output) {
|
|
7243
|
+
if (!modalId) {
|
|
7244
|
+
output[key] = false;
|
|
7474
7245
|
} else {
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7246
|
+
output[key] = getIsOnlyAnObject(withEventManagement) ? withEventManagement[key] ?? false : !!withEventManagement;
|
|
7247
|
+
}
|
|
7248
|
+
}
|
|
7249
|
+
return output;
|
|
7250
|
+
}
|
|
7251
|
+
function getOnKeyPress({
|
|
7252
|
+
id: modalId,
|
|
7253
|
+
onSubmit,
|
|
7254
|
+
onClose,
|
|
7255
|
+
suspendProcessing
|
|
7256
|
+
}) {
|
|
7257
|
+
if (!modalId) return null;
|
|
7258
|
+
return function onKeyPress(ev) {
|
|
7259
|
+
const customEvent = ev;
|
|
7260
|
+
const { id: eventId, realEvent } = customEvent.detail || {};
|
|
7261
|
+
const constantInfoAboutCustomEvent = Object.values(EVENTS).find((ev2) => ev2.name === customEvent.type || ev2.shortName === customEvent.type) || {};
|
|
7262
|
+
const middlewareKey = constantInfoAboutCustomEvent.middlewareKey || "incorrectKey";
|
|
7263
|
+
const safelySuspendProcessing = isISuspendProcessing(suspendProcessing) ? suspendProcessing : {};
|
|
7264
|
+
if (modalId && eventId && eventId === modalId && !safelySuspendProcessing[middlewareKey]?.(realEvent)) {
|
|
7265
|
+
switch (customEvent.type) {
|
|
7266
|
+
case EVENTS.iGotAnEnterKeyPress.name: {
|
|
7267
|
+
onSubmit?.();
|
|
7268
|
+
break;
|
|
7269
|
+
}
|
|
7270
|
+
case EVENTS.iGotAnEscKeyPress.name: {
|
|
7271
|
+
onClose?.();
|
|
7272
|
+
break;
|
|
7273
|
+
}
|
|
7274
|
+
default: {
|
|
7275
|
+
break;
|
|
7276
|
+
}
|
|
7489
7277
|
}
|
|
7490
|
-
return output.set("hour", Number.parseInt(hour.toString(), 10));
|
|
7491
7278
|
}
|
|
7492
7279
|
};
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
const
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
};
|
|
7502
|
-
const newDateValue = e?.target?.value ?? reserveValue;
|
|
7503
|
-
const processedNewDate = processOverflow(
|
|
7504
|
-
newDateValue,
|
|
7505
|
-
valueForRollback,
|
|
7506
|
-
key
|
|
7507
|
-
);
|
|
7508
|
-
execute(processedNewDate);
|
|
7509
|
-
executeForCalendar(prepareValueForCalendar(processedNewDate));
|
|
7510
|
-
doBlur(key, e);
|
|
7511
|
-
};
|
|
7512
|
-
const handleKeyPressed = (code, e, type) => {
|
|
7513
|
-
if (code === 13) {
|
|
7514
|
-
const syntheticEvent = {
|
|
7515
|
-
target: e.target,
|
|
7516
|
-
relatedTarget: null
|
|
7517
|
-
};
|
|
7518
|
-
handleDateInputBlur(type, syntheticEvent);
|
|
7280
|
+
}
|
|
7281
|
+
function dispatchEventForModalManagement(realEvent, nameOfCustomEvent, uniqueIdOfRecipient, target) {
|
|
7282
|
+
const { repeat, altKey, ctrlKey, shiftKey, metaKey } = realEvent;
|
|
7283
|
+
const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
|
|
7284
|
+
if (!repeat && isPressingWithoutAuxiliaryKeys) {
|
|
7285
|
+
const event = Object.values(EVENTS).find((ev) => ev.name === nameOfCustomEvent || ev.shortName === nameOfCustomEvent);
|
|
7286
|
+
if (event && uniqueIdOfRecipient) {
|
|
7287
|
+
(target ?? document).dispatchEvent(new CustomEvent(event.name, { ...event.options, detail: { id: uniqueIdOfRecipient, realEvent } }));
|
|
7519
7288
|
}
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
moment9(endDate).subtract(1, "days"),
|
|
7532
|
-
"day"
|
|
7533
|
-
) && endHour === 0) && hour < startHour
|
|
7534
|
-
}));
|
|
7535
|
-
const renderButtons = () => /* @__PURE__ */ jsxs37(Fragment9, { children: [
|
|
7536
|
-
/* @__PURE__ */ jsx44(
|
|
7537
|
-
Button_default,
|
|
7289
|
+
}
|
|
7290
|
+
}
|
|
7291
|
+
|
|
7292
|
+
// src/Atomic/UI/Modal/partials/ModalFooter.tsx
|
|
7293
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
7294
|
+
import cn34 from "classnames";
|
|
7295
|
+
import { memo } from "react";
|
|
7296
|
+
var ModalFooter = memo(
|
|
7297
|
+
({ className = "", children, wrapperRef, testId = "modal-footer" }) => {
|
|
7298
|
+
return /* @__PURE__ */ jsx41(
|
|
7299
|
+
"footer",
|
|
7538
7300
|
{
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7301
|
+
"data-testid": testId,
|
|
7302
|
+
ref: wrapperRef,
|
|
7303
|
+
className: cn34("modal__footer", className),
|
|
7304
|
+
role: "contentinfo",
|
|
7305
|
+
"aria-label": "Modal footer",
|
|
7306
|
+
children
|
|
7307
|
+
}
|
|
7308
|
+
);
|
|
7309
|
+
}
|
|
7310
|
+
);
|
|
7311
|
+
ModalFooter.displayName = "ModalFooter";
|
|
7312
|
+
var ModalFooter_default = ModalFooter;
|
|
7313
|
+
|
|
7314
|
+
// src/Atomic/UI/Modal/partials/ModalTitle.tsx
|
|
7315
|
+
import { jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7316
|
+
import cn35 from "classnames";
|
|
7317
|
+
import { memo as memo2, useLayoutEffect as useLayoutEffect4, useMemo as useMemo14, useRef as useRef15 } from "react";
|
|
7318
|
+
import { X as X5 } from "react-feather";
|
|
7319
|
+
var ModalTitle = memo2(
|
|
7320
|
+
({
|
|
7321
|
+
variant = "primary",
|
|
7322
|
+
children,
|
|
7323
|
+
isForced = false,
|
|
7324
|
+
onClose,
|
|
7325
|
+
closeBtnDisable,
|
|
7326
|
+
noHeaderCloseBtn = false,
|
|
7327
|
+
className,
|
|
7328
|
+
wrapperRef,
|
|
7329
|
+
testId = "modal-title"
|
|
7330
|
+
}) => {
|
|
7331
|
+
const closeModalRef = useRef15(onClose);
|
|
7332
|
+
const handleClick = useMemo14(() => () => closeModalRef.current?.(), []);
|
|
7333
|
+
useLayoutEffect4(() => {
|
|
7334
|
+
closeModalRef.current = closeBtnDisable ? void 0 : onClose;
|
|
7335
|
+
}, [onClose, closeBtnDisable]);
|
|
7336
|
+
return /* @__PURE__ */ jsxs36(
|
|
7337
|
+
"header",
|
|
7338
|
+
{
|
|
7339
|
+
"data-testid": testId,
|
|
7340
|
+
ref: wrapperRef,
|
|
7341
|
+
className: cn35("modal__header", className, {
|
|
7342
|
+
[`modal__header-${variant}`]: variant
|
|
7343
|
+
}),
|
|
7344
|
+
role: "banner",
|
|
7345
|
+
"aria-label": "Modal header",
|
|
7346
|
+
children: [
|
|
7347
|
+
/* @__PURE__ */ jsx42(
|
|
7348
|
+
"span",
|
|
7349
|
+
{
|
|
7350
|
+
className: cn35("modal__header-title", {
|
|
7351
|
+
[`modal__header-${variant}-title`]: variant
|
|
7352
|
+
}),
|
|
7353
|
+
id: `${testId}-heading`,
|
|
7354
|
+
children
|
|
7355
|
+
}
|
|
7356
|
+
),
|
|
7357
|
+
!isForced && /* @__PURE__ */ jsx42(
|
|
7358
|
+
"button",
|
|
7359
|
+
{
|
|
7360
|
+
type: "button",
|
|
7361
|
+
onClick: handleClick,
|
|
7362
|
+
className: cn35("modal-close-icon-box", {
|
|
7363
|
+
"modal-close-icon-box-primary": variant === "primary",
|
|
7364
|
+
"modal-close-icon-box--hidden": noHeaderCloseBtn
|
|
7365
|
+
}),
|
|
7366
|
+
"aria-label": "Close modal",
|
|
7367
|
+
title: "Close modal",
|
|
7368
|
+
children: !noHeaderCloseBtn && /* @__PURE__ */ jsx42(X5, { className: "modal-close-icon", role: "img", "aria-hidden": "true" })
|
|
7369
|
+
}
|
|
7370
|
+
)
|
|
7371
|
+
]
|
|
7372
|
+
}
|
|
7373
|
+
);
|
|
7374
|
+
}
|
|
7375
|
+
);
|
|
7376
|
+
ModalTitle.displayName = "ModalTitle";
|
|
7377
|
+
var ModalTitle_default = ModalTitle;
|
|
7378
|
+
|
|
7379
|
+
// src/Atomic/UI/Modal/partials/useMobileModal.tsx
|
|
7380
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
7381
|
+
import { useCallback as useCallback6, useEffect as useEffect29, useLayoutEffect as useLayoutEffect5, useRef as useRef16, useState as useState29 } from "react";
|
|
7382
|
+
var SCROLL_DIRECTION = {
|
|
7383
|
+
UP: "up",
|
|
7384
|
+
DOWN: "down"
|
|
7385
|
+
};
|
|
7386
|
+
function useMobileModal({
|
|
7387
|
+
modalRef,
|
|
7388
|
+
withMobileLogic = false,
|
|
7389
|
+
withFixedFooter = false,
|
|
7390
|
+
isOpen = false
|
|
7391
|
+
}) {
|
|
7392
|
+
const modalMobileContainerRef = useRef16(null);
|
|
7393
|
+
const modalMobileHeaderRef = useRef16(null);
|
|
7394
|
+
const modalMobileFooterRef = useRef16(null);
|
|
7395
|
+
const modalMobileBodyRef = useRef16(null);
|
|
7396
|
+
const { isMobile } = useIsMobile_default();
|
|
7397
|
+
const [modalHeight, setModalHeight] = useState29(0);
|
|
7398
|
+
const [modalsLogic, setModalsLogic] = useState29({
|
|
7399
|
+
IS_HEADER_HIDDEN: false,
|
|
7400
|
+
IS_HEADER_STICKY: false,
|
|
7401
|
+
IS_FOOTER_HIDDEN: false,
|
|
7402
|
+
IS_FOOTER_STICKY: withFixedFooter
|
|
7403
|
+
});
|
|
7404
|
+
const [modalsLogicProps, setModalsLogicProps] = useState29({
|
|
7405
|
+
headerHeight: 0,
|
|
7406
|
+
footerHeight: 0
|
|
7407
|
+
});
|
|
7408
|
+
const [scrollDirection, setScrollDirection] = useState29(SCROLL_DIRECTION.UP);
|
|
7409
|
+
const [scrollTopPrev, setScrollTopPrev] = useState29(0);
|
|
7410
|
+
const [scrollTop, setScrollTop] = useState29(0);
|
|
7411
|
+
const [scrollHeight, setScrollHeight] = useState29(1);
|
|
7412
|
+
const [, setContainerScrollHeight] = useState29(1);
|
|
7413
|
+
useLayoutEffect5(() => {
|
|
7414
|
+
const el = modalMobileContainerRef?.current;
|
|
7415
|
+
if (el) {
|
|
7416
|
+
el.addEventListener("scroll", () => {
|
|
7417
|
+
setScrollTop((scrollTop2) => {
|
|
7418
|
+
if (scrollTop2 !== el.scrollTop) setScrollTopPrev(scrollTop2);
|
|
7419
|
+
return el.scrollTop;
|
|
7420
|
+
});
|
|
7421
|
+
});
|
|
7422
|
+
}
|
|
7423
|
+
}, [modalMobileContainerRef?.current]);
|
|
7424
|
+
useEffect29(() => {
|
|
7425
|
+
setScrollDirection(
|
|
7426
|
+
(prevScrollDirection) => scrollTop < scrollTopPrev ? SCROLL_DIRECTION.UP : scrollTop > scrollTopPrev ? SCROLL_DIRECTION.DOWN : prevScrollDirection
|
|
7427
|
+
);
|
|
7428
|
+
}, [scrollTop, scrollTopPrev]);
|
|
7429
|
+
useLayoutEffect5(() => {
|
|
7430
|
+
if (isOpen) {
|
|
7431
|
+
const modalStyle = modalRef?.current ? modalRef?.current.style || window.getComputedStyle(modalRef?.current) : {};
|
|
7432
|
+
const computedModalHeight = modalRef?.current ? modalHeight + Number.parseFloat(modalStyle?.marginTop || "0") : 0;
|
|
7433
|
+
const windowHeight = document.documentElement.clientHeight || window.screen.availHeight || window.screen.height;
|
|
7434
|
+
if (modalMobileContainerRef?.current) {
|
|
7435
|
+
if (computedModalHeight <= windowHeight) {
|
|
7436
|
+
modalMobileContainerRef.current.style.display = "flex";
|
|
7437
|
+
modalMobileContainerRef.current.style.alignItems = "flex-end";
|
|
7438
|
+
} else {
|
|
7439
|
+
modalMobileContainerRef.current?.style?.removeProperty("display");
|
|
7440
|
+
modalMobileContainerRef.current?.style?.removeProperty("align-items");
|
|
7441
|
+
}
|
|
7543
7442
|
}
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
onClick: () => onChange?.({
|
|
7552
|
-
start: moment9(startDate).format(MAIN_FORMAT),
|
|
7553
|
-
end: moment9(endDate).format(MAIN_FORMAT),
|
|
7554
|
-
startPrevDate: moment9(startPrevDate).format(MAIN_FORMAT),
|
|
7555
|
-
endPrevDate: moment9(endPrevDate).format(MAIN_FORMAT),
|
|
7556
|
-
compare: isCompare
|
|
7557
|
-
}),
|
|
7558
|
-
children: txt?.buttons?.apply || "apply"
|
|
7443
|
+
}
|
|
7444
|
+
}, [modalsLogicProps, isOpen, isMobile, modalHeight]);
|
|
7445
|
+
useLayoutEffect5(() => {
|
|
7446
|
+
if (isMobile && isOpen) {
|
|
7447
|
+
const newModalHeight = modalRef?.current?.getBoundingClientRect()?.height;
|
|
7448
|
+
if (newModalHeight && modalHeight !== newModalHeight) {
|
|
7449
|
+
setModalHeight(newModalHeight);
|
|
7559
7450
|
}
|
|
7560
|
-
)
|
|
7561
|
-
] });
|
|
7562
|
-
const renderPreviousPeriod = () => /* @__PURE__ */ jsxs37(Fragment9, { children: [
|
|
7563
|
-
txt?.labels?.previousPeriod || "",
|
|
7564
|
-
":",
|
|
7565
|
-
" ",
|
|
7566
|
-
/* @__PURE__ */ jsx44("span", { className: "date-picker__previous-period-interval", children: title })
|
|
7567
|
-
] });
|
|
7568
|
-
useEffect30(() => {
|
|
7569
|
-
if (moment9(startDate).isSameOrAfter(endDate)) {
|
|
7570
|
-
setStartDate(moment9(endDate).subtract(1, "d"));
|
|
7571
|
-
setDate1(moment9(endDate).subtract(1, "d"));
|
|
7572
7451
|
}
|
|
7573
|
-
}
|
|
7574
|
-
|
|
7575
|
-
if (
|
|
7576
|
-
|
|
7577
|
-
|
|
7452
|
+
});
|
|
7453
|
+
useEffect29(() => {
|
|
7454
|
+
if (isMobile && withMobileLogic) {
|
|
7455
|
+
const { footerHeight, headerHeight } = modalsLogicProps;
|
|
7456
|
+
setModalsLogic((prevStickyLogic) => ({
|
|
7457
|
+
IS_HEADER_HIDDEN: scrollDirection === SCROLL_DIRECTION.DOWN || scrollTop === 0,
|
|
7458
|
+
IS_HEADER_STICKY: scrollDirection === SCROLL_DIRECTION.UP && scrollTop !== 0 && (scrollTop >= headerHeight || prevStickyLogic.IS_HEADER_STICKY),
|
|
7459
|
+
IS_FOOTER_HIDDEN: !withFixedFooter && (scrollDirection === SCROLL_DIRECTION.UP || scrollHeight === Math.round(scrollTop)),
|
|
7460
|
+
IS_FOOTER_STICKY: withFixedFooter && scrollHeight > 1 || scrollDirection === SCROLL_DIRECTION.DOWN && (scrollHeight - Math.round(scrollTop) >= footerHeight || prevStickyLogic.IS_FOOTER_STICKY)
|
|
7461
|
+
}));
|
|
7578
7462
|
}
|
|
7579
|
-
}, [
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7463
|
+
}, [
|
|
7464
|
+
scrollTop,
|
|
7465
|
+
scrollHeight,
|
|
7466
|
+
isMobile,
|
|
7467
|
+
withMobileLogic,
|
|
7468
|
+
scrollDirection,
|
|
7469
|
+
modalsLogicProps,
|
|
7470
|
+
modalHeight,
|
|
7471
|
+
window.innerHeight
|
|
7472
|
+
]);
|
|
7473
|
+
useLayoutEffect5(() => {
|
|
7474
|
+
if (modalMobileHeaderRef?.current?.getBoundingClientRect()?.height !== void 0) {
|
|
7475
|
+
setModalsLogicProps((state) => ({
|
|
7476
|
+
...state,
|
|
7477
|
+
headerHeight: modalMobileHeaderRef?.current?.getBoundingClientRect()?.height ?? 0
|
|
7478
|
+
}));
|
|
7584
7479
|
}
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7480
|
+
}, [modalMobileHeaderRef?.current?.getBoundingClientRect()?.height]);
|
|
7481
|
+
useLayoutEffect5(() => {
|
|
7482
|
+
if (modalMobileFooterRef?.current?.getBoundingClientRect()?.height !== void 0) {
|
|
7483
|
+
setModalsLogicProps((state) => ({
|
|
7484
|
+
...state,
|
|
7485
|
+
footerHeight: modalMobileFooterRef?.current?.getBoundingClientRect()?.height ?? 0
|
|
7486
|
+
}));
|
|
7590
7487
|
}
|
|
7591
|
-
}, [
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
start: moment9(startDate).format(MAIN_FORMAT),
|
|
7599
|
-
end: moment9(endDate).format(MAIN_FORMAT),
|
|
7600
|
-
startPrevDate: moment9(startPrevDate).format(MAIN_FORMAT),
|
|
7601
|
-
endPrevDate: moment9(endPrevDate).format(MAIN_FORMAT),
|
|
7602
|
-
compare: isCompare
|
|
7603
|
-
});
|
|
7488
|
+
}, [modalMobileFooterRef?.current?.getBoundingClientRect()?.height]);
|
|
7489
|
+
useEffect29(() => {
|
|
7490
|
+
if (modalMobileContainerRef?.current) {
|
|
7491
|
+
setContainerScrollHeight(modalMobileContainerRef?.current?.scrollHeight);
|
|
7492
|
+
setScrollHeight(
|
|
7493
|
+
modalMobileContainerRef?.current?.scrollHeight - window.innerHeight
|
|
7494
|
+
);
|
|
7604
7495
|
}
|
|
7605
|
-
}, [
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
value: startHour,
|
|
7633
|
-
options: getStartHourItems(),
|
|
7634
|
-
disabled: !startDate,
|
|
7635
|
-
isDoNotPullOutListOfMainContainer,
|
|
7636
|
-
withMobileLogic
|
|
7637
|
-
}
|
|
7638
|
-
)
|
|
7639
|
-
] });
|
|
7640
|
-
};
|
|
7641
|
-
const renderRowEnd = () => {
|
|
7642
|
-
return /* @__PURE__ */ jsxs37("div", { className: "date-picker__date-row", children: [
|
|
7643
|
-
/* @__PURE__ */ jsx44(
|
|
7644
|
-
DateInput_default,
|
|
7645
|
-
{
|
|
7646
|
-
ref: endDateInputRef,
|
|
7647
|
-
testId: `datepicker-${testId}_start-date-input`,
|
|
7648
|
-
RC: "date-picker__date-input",
|
|
7649
|
-
className: cn36("date-picker__date-input"),
|
|
7650
|
-
isFocused: isEndFocused,
|
|
7651
|
-
value: endDateInput,
|
|
7652
|
-
date: getCorrectedDateForDateInput("endDateInput", endDate),
|
|
7653
|
-
disabled: !endDate,
|
|
7654
|
-
onChange: setEndDateInput,
|
|
7655
|
-
onFocus: (e) => handleDateInputFocus("endDateInput", e),
|
|
7656
|
-
onBlur: (e) => handleDateInputBlur("endDateInput", e),
|
|
7657
|
-
onKeyUp: (code, e) => handleKeyPressed(+code, e, "endDateInput")
|
|
7658
|
-
}
|
|
7659
|
-
),
|
|
7660
|
-
/* @__PURE__ */ jsx44(
|
|
7661
|
-
Dropdown_default,
|
|
7662
|
-
{
|
|
7663
|
-
testId,
|
|
7664
|
-
id: `datepicker-id-${mainId}_end-hour-select-input`,
|
|
7665
|
-
className: cn36("date-picker__hour-select-input"),
|
|
7666
|
-
onChange: (value) => handleChangeEndHour(value),
|
|
7667
|
-
value: endHour,
|
|
7668
|
-
options: getEndHourItems(),
|
|
7669
|
-
disabled: !endDate,
|
|
7670
|
-
isDoNotPullOutListOfMainContainer,
|
|
7671
|
-
withMobileLogic
|
|
7672
|
-
}
|
|
7673
|
-
)
|
|
7674
|
-
] });
|
|
7496
|
+
}, [scrollTop, modalMobileContainerRef?.current, window.innerHeight]);
|
|
7497
|
+
useEffect29(() => {
|
|
7498
|
+
window.addEventListener("resize", () => {
|
|
7499
|
+
setContainerScrollHeight((containerScrollHeight) => {
|
|
7500
|
+
setScrollHeight(containerScrollHeight - window.innerHeight);
|
|
7501
|
+
return containerScrollHeight;
|
|
7502
|
+
});
|
|
7503
|
+
});
|
|
7504
|
+
}, []);
|
|
7505
|
+
const renderModal = useCallback6(
|
|
7506
|
+
(modal) => {
|
|
7507
|
+
if (!isMobile || !withMobileLogic) return modal;
|
|
7508
|
+
return /* @__PURE__ */ jsx43("div", { className: "modal-mobile-container", ref: modalMobileContainerRef, children: modal });
|
|
7509
|
+
},
|
|
7510
|
+
[isMobile, withMobileLogic]
|
|
7511
|
+
);
|
|
7512
|
+
return {
|
|
7513
|
+
modalMobileContainerRef,
|
|
7514
|
+
modalMobileHeaderRef,
|
|
7515
|
+
modalMobileBodyRef,
|
|
7516
|
+
modalMobileFooterRef,
|
|
7517
|
+
MODALS_LOGIC: modalsLogic,
|
|
7518
|
+
SCROLL_DIRECTION,
|
|
7519
|
+
scrollTop,
|
|
7520
|
+
scrollHeight,
|
|
7521
|
+
renderModal,
|
|
7522
|
+
isMobile
|
|
7675
7523
|
};
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7524
|
+
}
|
|
7525
|
+
|
|
7526
|
+
// src/Atomic/UI/Modal/Modal.tsx
|
|
7527
|
+
import cn36 from "classnames";
|
|
7528
|
+
import { useEffect as useEffect30, useLayoutEffect as useLayoutEffect6, useMemo as useMemo15, useRef as useRef17 } from "react";
|
|
7529
|
+
var attrsForModalBodyDefault = {};
|
|
7530
|
+
var KEY_CODE = Object.freeze({
|
|
7531
|
+
ENTER: 13,
|
|
7532
|
+
ESC: 27
|
|
7533
|
+
});
|
|
7534
|
+
function renderModalTitle({
|
|
7535
|
+
mode,
|
|
7536
|
+
title,
|
|
7537
|
+
onlyTitle
|
|
7538
|
+
}) {
|
|
7539
|
+
if (mode && mode !== "default" && !onlyTitle) {
|
|
7540
|
+
return `${mode[0].toUpperCase()}${mode.slice(1)} ${title}`;
|
|
7541
|
+
}
|
|
7542
|
+
return title;
|
|
7543
|
+
}
|
|
7544
|
+
function Modal({
|
|
7545
|
+
ref,
|
|
7546
|
+
id,
|
|
7547
|
+
testId = "modal",
|
|
7548
|
+
zIndex = 100,
|
|
7549
|
+
isOpen,
|
|
7550
|
+
onConfirm,
|
|
7551
|
+
onDecline,
|
|
7552
|
+
closeModal,
|
|
7553
|
+
className,
|
|
7554
|
+
variant = "primary",
|
|
7555
|
+
size,
|
|
7556
|
+
mode,
|
|
7557
|
+
title,
|
|
7558
|
+
onlyTitle,
|
|
7559
|
+
atributesForModalBody = attrsForModalBodyDefault,
|
|
7560
|
+
confirmBtnClassName,
|
|
7561
|
+
confirmBtnLabel,
|
|
7562
|
+
confirmBtnVariant = "primary",
|
|
7563
|
+
confirmBtnDisable,
|
|
7564
|
+
confirmBtnIcon,
|
|
7565
|
+
isConfirmBtnIconPositionRight,
|
|
7566
|
+
noConfirmBtn,
|
|
7567
|
+
forced,
|
|
7568
|
+
closeBtnClassName,
|
|
7569
|
+
closeBtnText,
|
|
7570
|
+
closeBtnVariant,
|
|
7571
|
+
closeBtnDisable,
|
|
7572
|
+
closeBtnIcon,
|
|
7573
|
+
btnClassNames,
|
|
7574
|
+
isCloseBtnIconPositionRight,
|
|
7575
|
+
noCloseBtn,
|
|
7576
|
+
noHeader,
|
|
7577
|
+
noHeaderCloseBtn,
|
|
7578
|
+
customHeader,
|
|
7579
|
+
declineBtnDisable,
|
|
7580
|
+
noFooter,
|
|
7581
|
+
customFooter,
|
|
7582
|
+
withFixedFooter,
|
|
7583
|
+
leftContentOfFooter,
|
|
7584
|
+
isSubmittingByEnter: isSubmittingByEnterOuter = true,
|
|
7585
|
+
isClosingByEsc: isClosingByEscOuter = true,
|
|
7586
|
+
withEventManagement = false,
|
|
7587
|
+
submitOnEnter,
|
|
7588
|
+
closeOnEsc,
|
|
7589
|
+
withMobileLogic,
|
|
7590
|
+
children
|
|
7591
|
+
}) {
|
|
7592
|
+
const internalRef = useRef17(null);
|
|
7593
|
+
const modalRef = ref || internalRef;
|
|
7594
|
+
const onConfirmRef = useRef17(onConfirm);
|
|
7595
|
+
const closeModalRef = useRef17(closeModal);
|
|
7596
|
+
const onDeclineRef = useRef17(onDecline);
|
|
7597
|
+
const isSubmittingByEnter = submitOnEnter === false ? false : isSubmittingByEnterOuter;
|
|
7598
|
+
const isClosingByEsc = closeOnEsc === false ? false : isClosingByEscOuter;
|
|
7599
|
+
const withEventManagementStructure = getWithEventManagementStructure(id, withEventManagement);
|
|
7600
|
+
const isUseAutoBlockingForHandlers = withEventManagementStructure.isWithSubmitAndCloseManagement;
|
|
7601
|
+
const isOnConfirmBlocked = typeof onConfirm === "function" && isUseAutoBlockingForHandlers && confirmBtnDisable;
|
|
7602
|
+
const isCloseModalBlocked = typeof closeModal === "function" && isUseAutoBlockingForHandlers && closeBtnDisable;
|
|
7603
|
+
const isOnDeclineBlocked = typeof onDecline === "function" && isUseAutoBlockingForHandlers && declineBtnDisable;
|
|
7604
|
+
const {
|
|
7605
|
+
modalMobileHeaderRef,
|
|
7606
|
+
modalMobileBodyRef,
|
|
7607
|
+
modalMobileFooterRef,
|
|
7608
|
+
MODALS_LOGIC,
|
|
7609
|
+
renderModal,
|
|
7610
|
+
isMobile,
|
|
7611
|
+
scrollTop,
|
|
7612
|
+
scrollHeight
|
|
7613
|
+
} = useMobileModal({
|
|
7614
|
+
withMobileLogic,
|
|
7615
|
+
withFixedFooter,
|
|
7616
|
+
isOpen
|
|
7617
|
+
});
|
|
7618
|
+
const handle = useMemo15(() => ({
|
|
7619
|
+
confirm: () => onConfirmRef.current?.(),
|
|
7620
|
+
close: () => closeModalRef.current?.(),
|
|
7621
|
+
decline: () => {
|
|
7622
|
+
if (typeof onDeclineRef.current === "function") onDeclineRef.current();
|
|
7623
|
+
else closeModalRef.current?.();
|
|
7624
|
+
}
|
|
7625
|
+
}), []);
|
|
7626
|
+
const suspendProcessing = {
|
|
7627
|
+
// FIN-12482
|
|
7628
|
+
// ? Чтобы НЕ замыкать рефку на модалку в логике, чтобы потом поискать в контенте все текстэриа,
|
|
7629
|
+
// ? чтобы оценить есть ли среди них сфокусированная - делаем элеГАнтно:
|
|
7630
|
+
// ? оцениваем ev.target, и если target это текстэриа, то вот сейчас то она и сфокусирована,
|
|
7631
|
+
// ? т.е нужно приостановить процессы связанные с нажатием enter.
|
|
7632
|
+
Enter: (ev) => ev?.target?.nodeName === "TEXTAREA"
|
|
7633
|
+
// ? Колбеки опциональны, можно передавать только нужные
|
|
7634
|
+
// Escape: (ev: globalThis.KeyboardEvent) => false,
|
|
7698
7635
|
};
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7636
|
+
useHandleKeyPress_default({
|
|
7637
|
+
enterCallback: isSubmittingByEnter && typeof onConfirm === "function" && !confirmBtnDisable ? handle.confirm : void 0,
|
|
7638
|
+
escCallback: isClosingByEsc && typeof closeModal === "function" ? handle.close : void 0,
|
|
7639
|
+
withClamping: false,
|
|
7640
|
+
withEventManagementStructure: {
|
|
7641
|
+
isWithSubmitAndCloseManagement: confirmBtnDisable || withEventManagementStructure.isWithSubmitAndCloseManagement
|
|
7642
|
+
},
|
|
7643
|
+
suspendProcessing
|
|
7644
|
+
});
|
|
7645
|
+
useLayoutEffect6(() => {
|
|
7646
|
+
onConfirmRef.current = isOnConfirmBlocked ? void 0 : onConfirm;
|
|
7647
|
+
}, [onConfirm, isOnConfirmBlocked]);
|
|
7648
|
+
useLayoutEffect6(() => {
|
|
7649
|
+
closeModalRef.current = isCloseModalBlocked ? void 0 : closeModal;
|
|
7650
|
+
}, [closeModal, isCloseModalBlocked]);
|
|
7651
|
+
useLayoutEffect6(() => {
|
|
7652
|
+
onDeclineRef.current = isOnDeclineBlocked ? () => {
|
|
7653
|
+
} : onDecline;
|
|
7654
|
+
}, [onDecline, isOnDeclineBlocked]);
|
|
7655
|
+
useEffect30(() => {
|
|
7656
|
+
const outerTarget = getIsOnlyAnObject(withEventManagement) ? withEventManagement.listenersTarget : void 0;
|
|
7657
|
+
const target = outerTarget ?? document;
|
|
7658
|
+
const onKeyPress = getOnKeyPress({ id, onSubmit: handle.confirm, onClose: handle.close, suspendProcessing });
|
|
7659
|
+
if (withEventManagementStructure.isWithSubmitAndCloseManagement && !!onKeyPress) {
|
|
7660
|
+
if (isSubmittingByEnter) target.addEventListener(EVENTS.iGotAnEnterKeyPress.name, onKeyPress);
|
|
7661
|
+
if (isClosingByEsc) target.addEventListener(EVENTS.iGotAnEscKeyPress.name, onKeyPress);
|
|
7662
|
+
}
|
|
7663
|
+
return () => {
|
|
7664
|
+
if (withEventManagementStructure.isWithSubmitAndCloseManagement && !!onKeyPress) {
|
|
7665
|
+
if (isSubmittingByEnter) target.removeEventListener(EVENTS.iGotAnEnterKeyPress.name, onKeyPress);
|
|
7666
|
+
if (isClosingByEsc) target.removeEventListener(EVENTS.iGotAnEscKeyPress.name, onKeyPress);
|
|
7718
7667
|
}
|
|
7719
|
-
|
|
7720
|
-
};
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7668
|
+
};
|
|
7669
|
+
}, []);
|
|
7670
|
+
if (!isOpen) return null;
|
|
7671
|
+
return /* @__PURE__ */ jsx44(
|
|
7672
|
+
"div",
|
|
7673
|
+
{
|
|
7674
|
+
id: `${id}`,
|
|
7675
|
+
style: { zIndex },
|
|
7676
|
+
"data-testid": testId,
|
|
7677
|
+
className: "modal-box j5",
|
|
7678
|
+
role: "dialog",
|
|
7679
|
+
"aria-modal": "true",
|
|
7680
|
+
"aria-labelledby": `${testId}-title`,
|
|
7681
|
+
children: renderModal(
|
|
7682
|
+
/* @__PURE__ */ jsxs37(Fragment9, { children: [
|
|
7683
|
+
/* @__PURE__ */ jsx44(
|
|
7684
|
+
"div",
|
|
7685
|
+
{
|
|
7686
|
+
"data-testid": `${testId}-overlay`,
|
|
7687
|
+
className: isOpen ? "modal-overlay" : "hidden",
|
|
7688
|
+
onClick: handle.close,
|
|
7689
|
+
role: "presentation"
|
|
7690
|
+
}
|
|
7691
|
+
),
|
|
7692
|
+
/* @__PURE__ */ jsxs37(
|
|
7693
|
+
"div",
|
|
7694
|
+
{
|
|
7695
|
+
ref: modalRef,
|
|
7696
|
+
style: { width: typeof size === "number" ? `${size}px` : `${size?.replace("px", "")}px` },
|
|
7697
|
+
className: cn36(className, {
|
|
7698
|
+
"modal": isOpen,
|
|
7699
|
+
"modal--no-header": isOpen && noHeader && !customHeader,
|
|
7700
|
+
"modal-mobile": isOpen && isMobile,
|
|
7701
|
+
"hidden": !isOpen
|
|
7702
|
+
}),
|
|
7703
|
+
children: [
|
|
7704
|
+
customHeader || !noHeader && /* @__PURE__ */ jsx44(
|
|
7705
|
+
ModalTitle_default,
|
|
7706
|
+
{
|
|
7707
|
+
wrapperRef: modalMobileHeaderRef,
|
|
7708
|
+
className: cn36({
|
|
7709
|
+
"modal__header--hidden": MODALS_LOGIC.IS_HEADER_HIDDEN,
|
|
7710
|
+
"modal__header--sticky": !MODALS_LOGIC.IS_HEADER_HIDDEN && MODALS_LOGIC.IS_HEADER_STICKY
|
|
7711
|
+
}),
|
|
7712
|
+
variant,
|
|
7713
|
+
isForced: forced,
|
|
7714
|
+
onClose: handle.close,
|
|
7715
|
+
noHeaderCloseBtn,
|
|
7716
|
+
children: /* @__PURE__ */ jsx44("span", { id: `${testId}-title`, children: renderModalTitle({ mode, title, onlyTitle }) })
|
|
7717
|
+
}
|
|
7718
|
+
),
|
|
7719
|
+
/* @__PURE__ */ jsx44(
|
|
7720
|
+
"div",
|
|
7721
|
+
{
|
|
7722
|
+
...atributesForModalBody,
|
|
7723
|
+
ref: modalMobileBodyRef,
|
|
7724
|
+
className: cn36("modal__body", {
|
|
7725
|
+
"modal__body--no-footer": noFooter
|
|
7726
|
+
}),
|
|
7727
|
+
role: "document",
|
|
7728
|
+
children
|
|
7729
|
+
}
|
|
7730
|
+
),
|
|
7731
|
+
(!noFooter || customFooter) && /* @__PURE__ */ jsx44(
|
|
7732
|
+
ModalFooter_default,
|
|
7733
|
+
{
|
|
7734
|
+
wrapperRef: modalMobileFooterRef,
|
|
7735
|
+
className: cn36({
|
|
7736
|
+
"modal__footer--hidden": MODALS_LOGIC.IS_FOOTER_HIDDEN,
|
|
7737
|
+
"modal__footer--sticky": !MODALS_LOGIC.IS_FOOTER_HIDDEN && MODALS_LOGIC.IS_FOOTER_STICKY && scrollTop !== scrollHeight,
|
|
7738
|
+
"modal__footer_with-left-content": leftContentOfFooter
|
|
7739
|
+
}),
|
|
7740
|
+
children: customFooter || /* @__PURE__ */ jsxs37(Fragment9, { children: [
|
|
7741
|
+
leftContentOfFooter,
|
|
7742
|
+
(!noCloseBtn || !noConfirmBtn) && /* @__PURE__ */ jsxs37("div", { className: "modal__buttons-block", children: [
|
|
7743
|
+
!noCloseBtn && /* @__PURE__ */ jsx44(
|
|
7744
|
+
Button_default,
|
|
7745
|
+
{
|
|
7746
|
+
testId: "modal",
|
|
7747
|
+
className: cn36(closeBtnClassName, btnClassNames),
|
|
7748
|
+
variant: closeBtnVariant || "dark-outline",
|
|
7749
|
+
onClick: handle.decline,
|
|
7750
|
+
label: closeBtnText || "Cancel",
|
|
7751
|
+
disabled: typeof onDecline === "function" ? declineBtnDisable : closeBtnDisable,
|
|
7752
|
+
icon: closeBtnIcon,
|
|
7753
|
+
isIconRight: isCloseBtnIconPositionRight,
|
|
7754
|
+
tabIndex: 1,
|
|
7755
|
+
"aria-label": "Close modal"
|
|
7756
|
+
}
|
|
7757
|
+
),
|
|
7758
|
+
!noConfirmBtn && /* @__PURE__ */ jsx44(
|
|
7759
|
+
Button_default,
|
|
7760
|
+
{
|
|
7761
|
+
testId: "modal",
|
|
7762
|
+
onClick: handle.confirm,
|
|
7763
|
+
label: confirmBtnLabel || mode && mode?.[0].toUpperCase() + mode?.slice(1) || "Apply",
|
|
7764
|
+
className: cn36("ml5", confirmBtnClassName, btnClassNames),
|
|
7765
|
+
variant: confirmBtnVariant,
|
|
7766
|
+
disabled: confirmBtnDisable,
|
|
7767
|
+
icon: confirmBtnIcon,
|
|
7768
|
+
isIconRight: isConfirmBtnIconPositionRight,
|
|
7769
|
+
"aria-label": "Confirm modal"
|
|
7770
|
+
}
|
|
7771
|
+
)
|
|
7772
|
+
] })
|
|
7773
|
+
] })
|
|
7774
|
+
}
|
|
7775
|
+
)
|
|
7776
|
+
]
|
|
7777
|
+
}
|
|
7778
|
+
)
|
|
7779
|
+
] })
|
|
7756
7780
|
)
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
/* @__PURE__ */ jsxs37("div", { className: "date-picker__inputs-block", children: [
|
|
7763
|
-
renderRowStart(),
|
|
7764
|
-
/* @__PURE__ */ jsx44("div", { className: "date-picker__inputs-separator date-picker__header--gray", children: "\u2014" }),
|
|
7765
|
-
renderRowEnd()
|
|
7766
|
-
] }),
|
|
7767
|
-
isCompare && !isCompareHidden && startDate && endDate && /* @__PURE__ */ jsx44("div", { className: "date-picker__previous-period", children: renderPreviousPeriod() })
|
|
7768
|
-
] }),
|
|
7769
|
-
/* @__PURE__ */ jsx44("div", { className: "date-picker__calendars", children: /* @__PURE__ */ jsx44("div", { className: "date-picker__calendars-wrapper", children: renderCalendarStart() }) })
|
|
7770
|
-
] });
|
|
7771
|
-
};
|
|
7772
|
-
return withMobileLogic ? renderMobile() : render();
|
|
7773
|
-
};
|
|
7774
|
-
var Datepicker_default2 = Datepicker2;
|
|
7781
|
+
}
|
|
7782
|
+
);
|
|
7783
|
+
}
|
|
7784
|
+
Modal.displayName = "Modal";
|
|
7785
|
+
var Modal_default = Modal;
|
|
7775
7786
|
|
|
7776
7787
|
// src/Atomic/FormElements/InputDateRange/components/SelectItem.tsx
|
|
7777
7788
|
import { jsx as jsx45, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
@@ -8007,6 +8018,7 @@ var OpenedPart = (props) => {
|
|
|
8007
8018
|
var OpenedPart_default = OpenedPart;
|
|
8008
8019
|
|
|
8009
8020
|
// src/Atomic/FormElements/InputDateRange/InputDateRange.tsx
|
|
8021
|
+
import { Fragment as Fragment11, jsx as jsx47, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
8010
8022
|
import cn39 from "classnames";
|
|
8011
8023
|
import moment11 from "moment-timezone";
|
|
8012
8024
|
import React40, { useLayoutEffect as useLayoutEffect7, useRef as useRef19, useState as useState31 } from "react";
|
|
@@ -8365,6 +8377,9 @@ var InputLink = ({
|
|
|
8365
8377
|
};
|
|
8366
8378
|
var InputLink_default = InputLink;
|
|
8367
8379
|
|
|
8380
|
+
// src/Atomic/FormElements/InputLink/index.ts
|
|
8381
|
+
var InputLink_default2 = InputLink_default;
|
|
8382
|
+
|
|
8368
8383
|
// src/Atomic/FormElements/InputMask/InputMask.tsx
|
|
8369
8384
|
var InputMask_default = InputMask3_default;
|
|
8370
8385
|
|
|
@@ -8539,6 +8554,9 @@ var InputsRow = ({
|
|
|
8539
8554
|
};
|
|
8540
8555
|
var InputsRow_default = InputsRow;
|
|
8541
8556
|
|
|
8557
|
+
// src/Atomic/FormElements/InputsRow/index.ts
|
|
8558
|
+
var InputsRow_default2 = InputsRow_default;
|
|
8559
|
+
|
|
8542
8560
|
// src/Atomic/FormElements/InputWithAction/InputWithAction.tsx
|
|
8543
8561
|
import { jsx as jsx50, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
8544
8562
|
import cn41 from "classnames";
|
|
@@ -8641,6 +8659,9 @@ var InputWithAction = (props, ref) => {
|
|
|
8641
8659
|
};
|
|
8642
8660
|
var InputWithAction_default = React43.forwardRef(InputWithAction);
|
|
8643
8661
|
|
|
8662
|
+
// src/Atomic/FormElements/InputWithAction/index.ts
|
|
8663
|
+
var InputWithAction_default2 = InputWithAction_default;
|
|
8664
|
+
|
|
8644
8665
|
// src/Atomic/FormElements/Label/Label.tsx
|
|
8645
8666
|
import { Fragment as Fragment12, jsx as jsx51, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
8646
8667
|
import cn42 from "classnames";
|
|
@@ -9648,6 +9669,9 @@ function RadioGroupWithInput({
|
|
|
9648
9669
|
}
|
|
9649
9670
|
var RadioGroupWithInput_default = RadioGroupWithInput;
|
|
9650
9671
|
|
|
9672
|
+
// src/Atomic/FormElements/RadioInput/index.ts
|
|
9673
|
+
var RadioInput_default2 = RadioInput_default;
|
|
9674
|
+
|
|
9651
9675
|
// src/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.tsx
|
|
9652
9676
|
import { jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
9653
9677
|
import classNames from "classnames";
|
|
@@ -9825,6 +9849,9 @@ var RangeInputs = ({
|
|
|
9825
9849
|
};
|
|
9826
9850
|
var RangeInputs_default = RangeInputs;
|
|
9827
9851
|
|
|
9852
|
+
// src/Atomic/FormElements/RangeInputs/index.ts
|
|
9853
|
+
var RangeInputs_default2 = RangeInputs_default;
|
|
9854
|
+
|
|
9828
9855
|
// src/Atomic/FormElements/RangeList/RangeList.tsx
|
|
9829
9856
|
import { jsx as jsx61, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
9830
9857
|
|
|
@@ -10113,6 +10140,9 @@ var RangeList = (props) => {
|
|
|
10113
10140
|
};
|
|
10114
10141
|
var RangeList_default = RangeList;
|
|
10115
10142
|
|
|
10143
|
+
// src/Atomic/FormElements/RangeList/index.ts
|
|
10144
|
+
var RangeList_default2 = RangeList_default;
|
|
10145
|
+
|
|
10116
10146
|
// src/Atomic/FormElements/RangeSlider2/RangeSlider2.tsx
|
|
10117
10147
|
import { jsx as jsx62, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
10118
10148
|
import cn50 from "classnames";
|
|
@@ -11237,6 +11267,9 @@ var SwitchableRow = (props) => {
|
|
|
11237
11267
|
};
|
|
11238
11268
|
var SwitchableRow_default = SwitchableRow;
|
|
11239
11269
|
|
|
11270
|
+
// src/Atomic/FormElements/Switcher/index.ts
|
|
11271
|
+
var Switcher_default2 = Switcher_default;
|
|
11272
|
+
|
|
11240
11273
|
// src/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.tsx
|
|
11241
11274
|
import { jsx as jsx65, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
11242
11275
|
import cn53 from "classnames";
|
|
@@ -11332,6 +11365,9 @@ var SwitcherHide = ({
|
|
|
11332
11365
|
};
|
|
11333
11366
|
var SwitcherHide_default = SwitcherHide;
|
|
11334
11367
|
|
|
11368
|
+
// src/Atomic/FormElements/SwitcherHide/index.ts
|
|
11369
|
+
var SwitcherHide_default2 = SwitcherHide_default;
|
|
11370
|
+
|
|
11335
11371
|
// src/Atomic/FormElements/SwitcherRadio/SwitcherRadio.tsx
|
|
11336
11372
|
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
11337
11373
|
import { createElement as createElement2 } from "react";
|
|
@@ -11403,6 +11439,9 @@ var SwitcherRadio = ({
|
|
|
11403
11439
|
};
|
|
11404
11440
|
var SwitcherRadio_default = SwitcherRadio;
|
|
11405
11441
|
|
|
11442
|
+
// src/Atomic/FormElements/SwitcherRadio/index.ts
|
|
11443
|
+
var SwitcherRadio_default2 = SwitcherRadio_default;
|
|
11444
|
+
|
|
11406
11445
|
// src/Atomic/FormElements/SwitcherRange/SwitcherRange.tsx
|
|
11407
11446
|
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
11408
11447
|
var RC20 = "switcher-range";
|
|
@@ -11452,6 +11491,9 @@ var SwitcherRange = ({
|
|
|
11452
11491
|
};
|
|
11453
11492
|
var SwitcherRange_default = SwitcherRange;
|
|
11454
11493
|
|
|
11494
|
+
// src/Atomic/FormElements/SwitcherRange/index.ts
|
|
11495
|
+
var SwitcherRange_default2 = SwitcherRange_default;
|
|
11496
|
+
|
|
11455
11497
|
// src/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.tsx
|
|
11456
11498
|
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
11457
11499
|
import cn56 from "classnames";
|
|
@@ -13406,6 +13448,9 @@ var Text = ({
|
|
|
13406
13448
|
};
|
|
13407
13449
|
var Text_default = Text;
|
|
13408
13450
|
|
|
13451
|
+
// src/Atomic/FormElements/Text/index.ts
|
|
13452
|
+
var Text_default2 = Text_default;
|
|
13453
|
+
|
|
13409
13454
|
// src/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.tsx
|
|
13410
13455
|
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
13411
13456
|
import { createElement as createElement3 } from "react";
|
|
@@ -13681,6 +13726,9 @@ var TieredCheckboxes = ({
|
|
|
13681
13726
|
};
|
|
13682
13727
|
var TieredCheckboxes_default = TieredCheckboxes;
|
|
13683
13728
|
|
|
13729
|
+
// src/Atomic/FormElements/TieredCheckboxes/index.ts
|
|
13730
|
+
var TieredCheckboxes_default2 = TieredCheckboxes_default;
|
|
13731
|
+
|
|
13684
13732
|
// src/Atomic/FormElements/TimeRange/TimeRange.tsx
|
|
13685
13733
|
import { jsx as jsx81, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
13686
13734
|
|
|
@@ -15460,6 +15508,8 @@ function InputPassword({ field = { value: "" }, onChange = () => {
|
|
|
15460
15508
|
var InputPassword_default = InputPassword;
|
|
15461
15509
|
export {
|
|
15462
15510
|
ALL_TIME_KEY,
|
|
15511
|
+
ANDROID_CHROME_TEXT_CODE,
|
|
15512
|
+
AccordionWithCheckbox_default as AccordionWithCheckbox,
|
|
15463
15513
|
ActionAlert_default2 as ActionAlert,
|
|
15464
15514
|
AdvancedStatus_default2 as AdvancedStatus,
|
|
15465
15515
|
CUSTOM_INTERVAL_KEY,
|
|
@@ -15467,69 +15517,93 @@ export {
|
|
|
15467
15517
|
Calendar_default as Calendar,
|
|
15468
15518
|
CheckboxInput_default2 as CheckboxInput,
|
|
15469
15519
|
CheckboxesLine_default2 as CheckboxesLine,
|
|
15520
|
+
DEFAULT_ERRORS,
|
|
15521
|
+
DIGIT_MASK_CHAR,
|
|
15522
|
+
DateInput_default as DateInput,
|
|
15470
15523
|
Datepicker_default as Datepicker,
|
|
15471
|
-
|
|
15524
|
+
DatepickerCalendar_default as DatepickerCalendar,
|
|
15525
|
+
Dropdown_default2 as Dropdown,
|
|
15472
15526
|
DropdownLiveSearch_default as DropdownLiveSearch,
|
|
15527
|
+
EXCLUDED_KEYS,
|
|
15473
15528
|
FileLoader_default as FileLoader,
|
|
15474
15529
|
FileLoaderDescription_default as FileLoaderDescription,
|
|
15475
15530
|
FileLoaderLocal_default as FileLoaderLocal,
|
|
15476
15531
|
FileLoaderLocalGroup_default as FileLoaderLocalGroup,
|
|
15477
15532
|
FormElement_default as FormElement,
|
|
15478
15533
|
FormWithDependOn_default as FormWithDependOn,
|
|
15479
|
-
|
|
15534
|
+
FormattedRawSSN_default2 as FormattedRawSSN,
|
|
15480
15535
|
INTERVALS,
|
|
15481
|
-
|
|
15536
|
+
Input_default2 as Input,
|
|
15482
15537
|
InputAddress_default as InputAddress,
|
|
15483
15538
|
InputCalendar_default as InputCalendar,
|
|
15484
|
-
|
|
15539
|
+
InputColor_default2 as InputColor,
|
|
15485
15540
|
InputCurrency_default as InputCurrency,
|
|
15486
15541
|
InputCustomFetch_default as InputCustomFetch,
|
|
15487
15542
|
InputDateRange_default as InputDateRange,
|
|
15488
|
-
|
|
15543
|
+
Datepicker_default2 as InputDateRangeDatepicker,
|
|
15544
|
+
InputLink_default2 as InputLink,
|
|
15489
15545
|
InputMask_default as InputMask,
|
|
15490
15546
|
InputMask3_default as InputMask3,
|
|
15491
15547
|
InputPassword_default as InputPassword,
|
|
15492
|
-
|
|
15493
|
-
|
|
15548
|
+
InputWithAction_default2 as InputWithAction,
|
|
15549
|
+
InputsRow_default2 as InputsRow,
|
|
15550
|
+
LOWERCASE_LETTER_MASK_CHAR,
|
|
15494
15551
|
Label_default2 as Label,
|
|
15552
|
+
LoadZone_default as LoadZone,
|
|
15553
|
+
LoadedContent_default as LoadedContent,
|
|
15495
15554
|
MAIN_DATE_FORMAT,
|
|
15496
15555
|
MAIN_FORMAT,
|
|
15497
15556
|
MAIN_TIME_FORMAT,
|
|
15498
|
-
MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH,
|
|
15499
15557
|
MobileCalendar_default as MobileCalendar,
|
|
15500
15558
|
MultiSelect_default as MultiSelect,
|
|
15501
15559
|
NumericInput_default as NumericInput,
|
|
15560
|
+
OpenedPart_default as OpenedPart,
|
|
15502
15561
|
RadioGroup_default as RadioGroup,
|
|
15503
15562
|
RadioGroupWithInput_default as RadioGroupWithInput,
|
|
15504
|
-
|
|
15563
|
+
RadioInput_default2 as RadioInput,
|
|
15505
15564
|
RadioRowSwitcher_default as RadioRowSwitcher,
|
|
15506
15565
|
RangeCalendar_default as RangeCalendar,
|
|
15507
|
-
|
|
15508
|
-
|
|
15566
|
+
RangeInputs_default2 as RangeInputs,
|
|
15567
|
+
RangeList_default2 as RangeList,
|
|
15568
|
+
RangeListRow_default as RangeListRow,
|
|
15509
15569
|
RangeSlider,
|
|
15510
15570
|
RangeSlider2_default as RangeSlider2,
|
|
15571
|
+
SPACE_CHAR,
|
|
15572
|
+
SelectItem_default as SelectItem,
|
|
15511
15573
|
SwitchableRow_default as SwitchableRow,
|
|
15512
|
-
|
|
15574
|
+
Switcher_default2 as Switcher,
|
|
15513
15575
|
SwitcherCheckbox_default as SwitcherCheckbox,
|
|
15514
|
-
|
|
15515
|
-
|
|
15516
|
-
|
|
15576
|
+
SwitcherHide_default2 as SwitcherHide,
|
|
15577
|
+
SwitcherRadio_default2 as SwitcherRadio,
|
|
15578
|
+
SwitcherRange_default2 as SwitcherRange,
|
|
15517
15579
|
SwitcherRangeList_default as SwitcherRangeList,
|
|
15518
15580
|
SwitcherTagsDropdown_default as SwitcherTagsDropdown,
|
|
15519
15581
|
SwitcherTextarea_default as SwitcherTextarea,
|
|
15520
15582
|
TagListToDropdown_default as TagListToDropdown,
|
|
15521
15583
|
TagsDropdown_default as TagsDropdown,
|
|
15522
|
-
|
|
15584
|
+
Text_default2 as Text,
|
|
15523
15585
|
TextSwitcher_default as TextSwitcher,
|
|
15524
15586
|
Textarea_default as Textarea,
|
|
15525
|
-
|
|
15587
|
+
TieredCheckboxes_default2 as TieredCheckboxes,
|
|
15526
15588
|
TimeRange_default2 as TimeRange,
|
|
15589
|
+
UPPERCASE_LETTER_MASK_CHAR,
|
|
15527
15590
|
UserContacts_default2 as UserContacts,
|
|
15528
15591
|
VariantsListRadio_default as VariantsListRadio,
|
|
15529
15592
|
WidgetPseudoTable_default as WidgetPseudoTable,
|
|
15530
15593
|
WidgetWithSwitchableRows_default as WidgetWithSwitchableRows,
|
|
15594
|
+
copyToClipboard,
|
|
15531
15595
|
getActualDateRange,
|
|
15532
|
-
getIsDateValid
|
|
15596
|
+
getIsDateValid,
|
|
15597
|
+
getSelectionText,
|
|
15598
|
+
isDigit,
|
|
15599
|
+
isDigitMaskChar,
|
|
15600
|
+
isLetter,
|
|
15601
|
+
isLetterMaskChar,
|
|
15602
|
+
isLowerCaseLetter,
|
|
15603
|
+
isUpperCaseLetter,
|
|
15604
|
+
resetSelectionText,
|
|
15605
|
+
selectElementContents,
|
|
15606
|
+
voidFn
|
|
15533
15607
|
};
|
|
15534
15608
|
//! Важно! Если придет велью с количеством дробных разрядов БОЛЬШИМ
|
|
15535
15609
|
//! чем указано в quantity - округлит по правилам округления
|