@mngh/jalali-datepicker 1.0.6 → 1.1.0
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/README.md +122 -162
- package/dist/components/DayCell.d.ts +3 -7
- package/dist/components/DayCell.d.ts.map +1 -1
- package/dist/components/Header.d.ts +5 -0
- package/dist/components/Header.d.ts.map +1 -1
- package/dist/components/JalaliDatePicker.d.ts +14 -2
- package/dist/components/JalaliDatePicker.d.ts.map +1 -1
- package/dist/components/MonthYearPicker.d.ts +6 -1
- package/dist/components/MonthYearPicker.d.ts.map +1 -1
- package/dist/components/Weekdays.d.ts +2 -2
- package/dist/components/Weekdays.d.ts.map +1 -1
- package/dist/components/dual-calendar/DualMonthCalendar.d.ts.map +1 -1
- package/dist/components/dual-calendar/types.d.ts +7 -0
- package/dist/components/dual-calendar/types.d.ts.map +1 -1
- package/dist/components/footer/CalendarFooter.d.ts +1 -13
- package/dist/components/footer/CalendarFooter.d.ts.map +1 -1
- package/dist/components/footer/types.d.ts +7 -0
- package/dist/components/footer/types.d.ts.map +1 -1
- package/dist/components/masked-input/MaskedDateInput.d.ts.map +1 -1
- package/dist/components/masked-input/types.d.ts +6 -0
- package/dist/components/masked-input/types.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +887 -551
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/time-picker/TimePicker.d.ts +1 -4
- package/dist/plugins/time-picker/TimePicker.d.ts.map +1 -1
- package/dist/plugins/time-picker/types.d.ts +10 -0
- package/dist/plugins/time-picker/types.d.ts.map +1 -1
- package/dist/theme/style-slots.d.ts +54 -0
- package/dist/theme/style-slots.d.ts.map +1 -1
- package/dist/theme/style-utils.d.ts +2 -0
- package/dist/theme/style-utils.d.ts.map +1 -0
- package/dist/theme/tokens.d.ts.map +1 -1
- package/package.json +7 -3
package/dist/index.mjs
CHANGED
|
@@ -378,13 +378,13 @@ function M(e) {
|
|
|
378
378
|
}
|
|
379
379
|
//#endregion
|
|
380
380
|
//#region src/a11y/aria-helpers.ts
|
|
381
|
-
function
|
|
381
|
+
function N(e) {
|
|
382
382
|
let t = p[(_(e.year, e.month, e.day).getDay() + 1) % 7], n = u[e.month];
|
|
383
383
|
return `${t}، ${e.day} ${n} ${e.year}`;
|
|
384
384
|
}
|
|
385
385
|
//#endregion
|
|
386
386
|
//#region src/a11y/useCalendarKeyboard.ts
|
|
387
|
-
function
|
|
387
|
+
function P(e) {
|
|
388
388
|
let { viewYear: n, viewMonth: r, selectedDate: i, onSelectDate: a, onViewChange: s, isRtl: c = !0 } = e, [l, u] = o(() => i ?? {
|
|
389
389
|
year: n,
|
|
390
390
|
month: r,
|
|
@@ -415,7 +415,7 @@ function te(e) {
|
|
|
415
415
|
}
|
|
416
416
|
//#endregion
|
|
417
417
|
//#region src/formatters/persian-digits.ts
|
|
418
|
-
var
|
|
418
|
+
var F = [
|
|
419
419
|
"۰",
|
|
420
420
|
"۱",
|
|
421
421
|
"۲",
|
|
@@ -426,7 +426,7 @@ var N = [
|
|
|
426
426
|
"۷",
|
|
427
427
|
"۸",
|
|
428
428
|
"۹"
|
|
429
|
-
],
|
|
429
|
+
], ee = {
|
|
430
430
|
"۰": "0",
|
|
431
431
|
"۱": "1",
|
|
432
432
|
"۲": "2",
|
|
@@ -448,30 +448,30 @@ var N = [
|
|
|
448
448
|
"٨": "8",
|
|
449
449
|
"٩": "9"
|
|
450
450
|
};
|
|
451
|
-
function F(e) {
|
|
452
|
-
return String(e).replace(/[0-9]/g, (e) => N[+e]);
|
|
453
|
-
}
|
|
454
451
|
function I(e) {
|
|
455
|
-
return e.replace(/[
|
|
452
|
+
return String(e).replace(/[0-9]/g, (e) => F[+e]);
|
|
453
|
+
}
|
|
454
|
+
function L(e) {
|
|
455
|
+
return e.replace(/[۰-۹٠-٩]/g, (e) => ee[e] ?? e);
|
|
456
456
|
}
|
|
457
457
|
//#endregion
|
|
458
458
|
//#region src/formatters/jalali-formatter.ts
|
|
459
|
-
function
|
|
459
|
+
function R(e, t = "YYYY/MM/DD", n = {}) {
|
|
460
460
|
if (!e) return "";
|
|
461
461
|
let { digitType: r = "persian" } = n, i = (_(e.year, e.month, e.day).getDay() + 1) % 7, a = String(e.year), o = a.slice(-2), s = e.month + 1, c = s < 10 ? `0${s}` : String(s), l = u[e.month], d = e.day < 10 ? `0${e.day}` : String(e.day), f = p[i], m = t.replace(/\bYYYY\b/g, a).replace(/\bYY\b/g, o).replace(/\bMMMM\b/g, l).replace(/\bMM\b/g, c).replace(/\bM\b/g, String(s)).replace(/\bdddd\b/g, f).replace(/\bDD\b/g, d).replace(/\bD\b/g, String(e.day));
|
|
462
|
-
return r === "persian" && (m = m.replace(/\d+/g, (e) =>
|
|
462
|
+
return r === "persian" && (m = m.replace(/\d+/g, (e) => I(e))), m;
|
|
463
463
|
}
|
|
464
464
|
//#endregion
|
|
465
465
|
//#region src/theme/tokens.ts
|
|
466
|
-
var
|
|
466
|
+
var z = {
|
|
467
467
|
mode: "light",
|
|
468
468
|
colors: {
|
|
469
469
|
primary: "#4f46e5",
|
|
470
470
|
primaryHover: "#4338ca",
|
|
471
471
|
primaryText: "#ffffff",
|
|
472
472
|
background: "#ffffff",
|
|
473
|
-
backgroundHover: "#
|
|
474
|
-
surface: "#
|
|
473
|
+
backgroundHover: "#f1f5f9",
|
|
474
|
+
surface: "#f8fafc",
|
|
475
475
|
border: "#e2e8f0",
|
|
476
476
|
textPrimary: "#0f172a",
|
|
477
477
|
textSecondary: "#64748b",
|
|
@@ -483,16 +483,16 @@ var R = {
|
|
|
483
483
|
},
|
|
484
484
|
radii: {
|
|
485
485
|
sm: "6px",
|
|
486
|
-
md: "
|
|
487
|
-
lg: "
|
|
486
|
+
md: "8px",
|
|
487
|
+
lg: "12px",
|
|
488
488
|
full: "9999px"
|
|
489
489
|
},
|
|
490
490
|
shadows: {
|
|
491
491
|
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
492
492
|
md: "0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04)",
|
|
493
|
-
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.
|
|
493
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05)"
|
|
494
494
|
}
|
|
495
|
-
},
|
|
495
|
+
}, te = {
|
|
496
496
|
mode: "dark",
|
|
497
497
|
colors: {
|
|
498
498
|
primary: "#6366f1",
|
|
@@ -512,8 +512,8 @@ var R = {
|
|
|
512
512
|
},
|
|
513
513
|
radii: {
|
|
514
514
|
sm: "6px",
|
|
515
|
-
md: "
|
|
516
|
-
lg: "
|
|
515
|
+
md: "8px",
|
|
516
|
+
lg: "12px",
|
|
517
517
|
full: "9999px"
|
|
518
518
|
},
|
|
519
519
|
shadows: {
|
|
@@ -521,14 +521,14 @@ var R = {
|
|
|
521
521
|
md: "0 4px 6px -1px rgba(0, 0, 0, 0.4)",
|
|
522
522
|
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.5)"
|
|
523
523
|
}
|
|
524
|
-
},
|
|
525
|
-
theme:
|
|
524
|
+
}, B = e({
|
|
525
|
+
theme: z,
|
|
526
526
|
mode: "light"
|
|
527
|
-
}),
|
|
528
|
-
theme:
|
|
527
|
+
}), V = () => n(B) || {
|
|
528
|
+
theme: z,
|
|
529
529
|
mode: "light"
|
|
530
|
-
},
|
|
531
|
-
let r = t === "dark" ?
|
|
530
|
+
}, ne = ({ children: e, mode: t = "light", customTheme: n }) => {
|
|
531
|
+
let r = t === "dark" ? te : z, a = i(() => n ? {
|
|
532
532
|
mode: t,
|
|
533
533
|
theme: {
|
|
534
534
|
...r,
|
|
@@ -555,97 +555,105 @@ var R = {
|
|
|
555
555
|
n,
|
|
556
556
|
t
|
|
557
557
|
]);
|
|
558
|
-
return /* @__PURE__ */ c(
|
|
558
|
+
return /* @__PURE__ */ c(B.Provider, {
|
|
559
559
|
value: a,
|
|
560
560
|
children: e
|
|
561
561
|
});
|
|
562
|
-
}, re = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick: i, isPickerOpen: a }) => {
|
|
563
|
-
let { theme:
|
|
564
|
-
|
|
562
|
+
}, re = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick: i, isPickerOpen: a = !1, digitType: s = "persian", direction: u = "rtl", classNames: d, styles: f }) => {
|
|
563
|
+
let { theme: p } = V(), [m, h] = o(null), g = s === "persian" ? I(e) : String(e), _ = (e) => ({
|
|
564
|
+
width: "32px",
|
|
565
|
+
height: "32px",
|
|
566
|
+
padding: 0,
|
|
567
|
+
borderRadius: p.radii.md,
|
|
565
568
|
border: "none",
|
|
569
|
+
backgroundColor: m === e ? p.colors.backgroundHover : "transparent",
|
|
570
|
+
color: p.colors.textPrimary,
|
|
566
571
|
cursor: "pointer",
|
|
567
|
-
|
|
568
|
-
borderRadius: o.radii.md,
|
|
569
|
-
display: "flex",
|
|
572
|
+
display: "inline-flex",
|
|
570
573
|
alignItems: "center",
|
|
571
574
|
justifyContent: "center",
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
};
|
|
575
|
+
transition: "background-color 0.15s ease, color 0.15s ease",
|
|
576
|
+
...f?.navButton
|
|
577
|
+
});
|
|
575
578
|
return /* @__PURE__ */ l("div", {
|
|
579
|
+
dir: u,
|
|
580
|
+
className: d?.header,
|
|
576
581
|
style: {
|
|
577
582
|
display: "flex",
|
|
583
|
+
minHeight: "40px",
|
|
578
584
|
alignItems: "center",
|
|
579
585
|
justifyContent: "space-between",
|
|
580
|
-
|
|
581
|
-
|
|
586
|
+
gap: "8px",
|
|
587
|
+
padding: "4px 0 10px",
|
|
588
|
+
borderBottom: `1px solid ${p.colors.border}`,
|
|
582
589
|
userSelect: "none",
|
|
583
|
-
|
|
584
|
-
boxSizing: "border-box"
|
|
590
|
+
...f?.header
|
|
585
591
|
},
|
|
586
592
|
children: [
|
|
587
593
|
/* @__PURE__ */ c("button", {
|
|
588
594
|
type: "button",
|
|
589
595
|
onClick: n,
|
|
590
596
|
"aria-label": "ماه قبل",
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
onMouseLeave: (e) => {
|
|
596
|
-
e.currentTarget.style.backgroundColor = "transparent", e.currentTarget.style.transform = "scale(1)";
|
|
597
|
-
},
|
|
597
|
+
className: d?.navButton,
|
|
598
|
+
style: _("prev"),
|
|
599
|
+
onMouseEnter: () => h("prev"),
|
|
600
|
+
onMouseLeave: () => h(null),
|
|
598
601
|
children: /* @__PURE__ */ c("svg", {
|
|
599
602
|
width: "18",
|
|
600
603
|
height: "18",
|
|
601
604
|
viewBox: "0 0 24 24",
|
|
602
605
|
fill: "none",
|
|
603
606
|
stroke: "currentColor",
|
|
604
|
-
strokeWidth: "2.
|
|
607
|
+
strokeWidth: "2.5",
|
|
605
608
|
strokeLinecap: "round",
|
|
606
609
|
strokeLinejoin: "round",
|
|
610
|
+
"aria-hidden": "true",
|
|
611
|
+
style: { transform: u === "ltr" ? "scaleX(-1)" : void 0 },
|
|
607
612
|
children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
|
|
608
613
|
})
|
|
609
614
|
}),
|
|
610
615
|
/* @__PURE__ */ l("button", {
|
|
611
616
|
type: "button",
|
|
612
617
|
onClick: i,
|
|
618
|
+
"aria-expanded": a,
|
|
619
|
+
className: d?.headerTitle,
|
|
613
620
|
style: {
|
|
614
|
-
|
|
621
|
+
minHeight: "32px",
|
|
622
|
+
padding: "6px 12px",
|
|
623
|
+
borderRadius: p.radii.md,
|
|
615
624
|
border: "none",
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
fontWeight: 700,
|
|
621
|
-
color: o.colors.textPrimary,
|
|
622
|
-
display: "flex",
|
|
625
|
+
backgroundColor: a || m === "title" ? p.colors.backgroundHover : "transparent",
|
|
626
|
+
color: p.colors.textPrimary,
|
|
627
|
+
cursor: i ? "pointer" : "default",
|
|
628
|
+
display: "inline-flex",
|
|
623
629
|
alignItems: "center",
|
|
630
|
+
justifyContent: "center",
|
|
624
631
|
gap: "6px",
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
onMouseLeave: (e) => {
|
|
631
|
-
a || (e.currentTarget.style.backgroundColor = "transparent");
|
|
632
|
+
fontSize: "0.95rem",
|
|
633
|
+
fontWeight: 700,
|
|
634
|
+
whiteSpace: "nowrap",
|
|
635
|
+
transition: "background-color 0.15s ease",
|
|
636
|
+
...f?.headerTitle
|
|
632
637
|
},
|
|
638
|
+
onMouseEnter: () => h("title"),
|
|
639
|
+
onMouseLeave: () => h(null),
|
|
633
640
|
children: [/* @__PURE__ */ l("span", { children: [
|
|
634
641
|
t,
|
|
635
642
|
" ",
|
|
636
|
-
|
|
643
|
+
g
|
|
637
644
|
] }), /* @__PURE__ */ c("svg", {
|
|
638
645
|
width: "14",
|
|
639
646
|
height: "14",
|
|
640
647
|
viewBox: "0 0 24 24",
|
|
641
648
|
fill: "none",
|
|
642
649
|
stroke: "currentColor",
|
|
643
|
-
strokeWidth: "2.
|
|
650
|
+
strokeWidth: "2.5",
|
|
644
651
|
strokeLinecap: "round",
|
|
645
652
|
strokeLinejoin: "round",
|
|
653
|
+
"aria-hidden": "true",
|
|
646
654
|
style: {
|
|
647
655
|
transform: a ? "rotate(180deg)" : "rotate(0deg)",
|
|
648
|
-
transition: "transform 0.2s
|
|
656
|
+
transition: "transform 0.2s ease"
|
|
649
657
|
},
|
|
650
658
|
children: /* @__PURE__ */ c("polyline", { points: "6 9 12 15 18 9" })
|
|
651
659
|
})]
|
|
@@ -654,322 +662,517 @@ var R = {
|
|
|
654
662
|
type: "button",
|
|
655
663
|
onClick: r,
|
|
656
664
|
"aria-label": "ماه بعد",
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
onMouseLeave: (e) => {
|
|
662
|
-
e.currentTarget.style.backgroundColor = "transparent", e.currentTarget.style.transform = "scale(1)";
|
|
663
|
-
},
|
|
665
|
+
className: d?.navButton,
|
|
666
|
+
style: _("next"),
|
|
667
|
+
onMouseEnter: () => h("next"),
|
|
668
|
+
onMouseLeave: () => h(null),
|
|
664
669
|
children: /* @__PURE__ */ c("svg", {
|
|
665
670
|
width: "18",
|
|
666
671
|
height: "18",
|
|
667
672
|
viewBox: "0 0 24 24",
|
|
668
673
|
fill: "none",
|
|
669
674
|
stroke: "currentColor",
|
|
670
|
-
strokeWidth: "2.
|
|
675
|
+
strokeWidth: "2.5",
|
|
671
676
|
strokeLinecap: "round",
|
|
672
677
|
strokeLinejoin: "round",
|
|
678
|
+
"aria-hidden": "true",
|
|
679
|
+
style: { transform: u === "ltr" ? "scaleX(-1)" : void 0 },
|
|
673
680
|
children: /* @__PURE__ */ c("polyline", { points: "15 18 9 12 15 6" })
|
|
674
681
|
})
|
|
675
682
|
})
|
|
676
683
|
]
|
|
677
684
|
});
|
|
678
|
-
}, ie = ({ firstDayOfWeek: e = 0,
|
|
679
|
-
let
|
|
685
|
+
}, ie = ({ firstDayOfWeek: e = 0, direction: t = "rtl", classNames: n, styles: r }) => {
|
|
686
|
+
let { theme: i } = V(), a = (Math.trunc(e) % 7 + 7) % 7, o = Array.from({ length: 7 }, (e, t) => {
|
|
687
|
+
let n = (a + t) % 7;
|
|
688
|
+
return {
|
|
689
|
+
dayIndex: n,
|
|
690
|
+
label: f[n]
|
|
691
|
+
};
|
|
692
|
+
});
|
|
680
693
|
return /* @__PURE__ */ c("div", {
|
|
681
694
|
role: "row",
|
|
682
|
-
|
|
683
|
-
className:
|
|
695
|
+
dir: t,
|
|
696
|
+
className: n?.weekdays,
|
|
684
697
|
style: {
|
|
685
698
|
display: "grid",
|
|
699
|
+
width: "var(--pdp-calendar-pane-width, 276px)",
|
|
686
700
|
gridTemplateColumns: "repeat(7, var(--pdp-cell-size, 36px))",
|
|
687
|
-
gap: "4px",
|
|
688
|
-
|
|
701
|
+
gap: "var(--pdp-cell-gap, 4px)",
|
|
702
|
+
padding: "6px 0 4px",
|
|
689
703
|
textAlign: "center",
|
|
690
|
-
|
|
704
|
+
userSelect: "none",
|
|
705
|
+
...r?.weekdays
|
|
691
706
|
},
|
|
692
|
-
children:
|
|
707
|
+
children: o.map(({ dayIndex: e, label: t }) => /* @__PURE__ */ c("span", {
|
|
693
708
|
role: "columnheader",
|
|
694
|
-
className:
|
|
709
|
+
className: n?.weekdayCell,
|
|
695
710
|
style: {
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
711
|
+
display: "inline-flex",
|
|
712
|
+
width: "var(--pdp-cell-size, 36px)",
|
|
713
|
+
height: "28px",
|
|
714
|
+
alignItems: "center",
|
|
715
|
+
justifyContent: "center",
|
|
716
|
+
fontSize: "0.78rem",
|
|
717
|
+
fontWeight: 700,
|
|
718
|
+
color: e === 6 ? i.colors.holiday : i.colors.textSecondary,
|
|
719
|
+
...r?.weekdayCell
|
|
701
720
|
},
|
|
702
|
-
children:
|
|
703
|
-
},
|
|
721
|
+
children: t
|
|
722
|
+
}, e))
|
|
704
723
|
});
|
|
705
|
-
}
|
|
706
|
-
|
|
724
|
+
};
|
|
725
|
+
//#endregion
|
|
726
|
+
//#region src/theme/style-utils.ts
|
|
727
|
+
function ae(...e) {
|
|
728
|
+
return e.filter(Boolean).join(" ") || void 0;
|
|
729
|
+
}
|
|
730
|
+
//#endregion
|
|
731
|
+
//#region src/components/DayCell.tsx
|
|
732
|
+
var oe = (e) => {
|
|
733
|
+
let { theme: t } = V(), [n, r] = o(!1), i = e.cell, a = i?.jalali ?? {
|
|
707
734
|
year: 1403,
|
|
708
|
-
month:
|
|
709
|
-
day: e.day ??
|
|
710
|
-
},
|
|
711
|
-
|
|
712
|
-
let
|
|
713
|
-
|
|
735
|
+
month: 0,
|
|
736
|
+
day: e.day ?? 1
|
|
737
|
+
}, s = i?.isCurrentMonth ?? e.isCurrentMonth ?? !0, d = i?.isSelected ?? e.isSelected ?? !1, f = i?.isToday ?? e.isToday ?? !1, p = e.isHoliday ?? !1, m = i?.isInRange ?? e.isInRange ?? !1, h = i?.isRangeStart ?? e.isRangeStart ?? !1, g = i?.isRangeEnd ?? e.isRangeEnd ?? !1, _ = i?.isDisabled ?? e.disabled ?? !1, v = _ || !s, y = d || h || g, b = e.digitType === "latin" ? String(a.day) : I(a.day), x = e.digitType === "latin" ? String(a.year) : I(a.year), S = "transparent", C = s ? t.colors.textPrimary : t.colors.textDisabled;
|
|
738
|
+
m && s && (S = t.colors.rangeBackground, C = t.colors.textPrimary), p && s && (C = t.colors.holiday), n && !y && !v && (S = p ? t.colors.holidayBackground : t.colors.backgroundHover), y && (S = t.colors.primary, C = t.colors.primaryText);
|
|
739
|
+
let w = [
|
|
740
|
+
`${b} ${u[a.month]} ${x}`,
|
|
741
|
+
e.holidayTitle,
|
|
742
|
+
...e.events?.map((e) => e.title) ?? []
|
|
743
|
+
].filter(Boolean);
|
|
744
|
+
return /* @__PURE__ */ l("button", {
|
|
714
745
|
type: "button",
|
|
746
|
+
role: "gridcell",
|
|
747
|
+
"aria-label": w.join("، "),
|
|
748
|
+
"aria-selected": y,
|
|
715
749
|
tabIndex: e.tabIndex ?? 0,
|
|
716
|
-
disabled:
|
|
750
|
+
disabled: v,
|
|
751
|
+
title: w.slice(1).join(" — ") || void 0,
|
|
717
752
|
onClick: () => {
|
|
718
|
-
|
|
753
|
+
v || (e.onClick?.(), e.onSelect?.(a));
|
|
719
754
|
},
|
|
720
|
-
onFocus: () => e.onFocus?.(
|
|
755
|
+
onFocus: () => e.onFocus?.(a),
|
|
756
|
+
className: ae(e.classNames?.dayCell, !s && e.classNames?.outsideMonthCell, f && e.classNames?.todayCell, d && e.classNames?.selectedCell, m && e.classNames?.rangeBetweenCell, h && e.classNames?.rangeStartCell, g && e.classNames?.rangeEndCell, _ && e.classNames?.disabledCell, p && e.classNames?.holidayCell),
|
|
721
757
|
style: {
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
758
|
+
position: "relative",
|
|
759
|
+
width: "var(--pdp-cell-size, 36px)",
|
|
760
|
+
height: "var(--pdp-cell-size, 36px)",
|
|
761
|
+
padding: 0,
|
|
762
|
+
border: f && !y ? `1.5px solid ${t.colors.todayBorder}` : "1px solid transparent",
|
|
763
|
+
borderRadius: t.radii.md,
|
|
764
|
+
backgroundColor: S,
|
|
765
|
+
color: C,
|
|
766
|
+
cursor: v ? "default" : "pointer",
|
|
767
|
+
display: "inline-flex",
|
|
725
768
|
alignItems: "center",
|
|
726
769
|
justifyContent: "center",
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
...e.styles?.
|
|
770
|
+
fontSize: "0.85rem",
|
|
771
|
+
fontWeight: y || f ? 700 : 500,
|
|
772
|
+
lineHeight: 1,
|
|
773
|
+
opacity: s ? _ ? .5 : 1 : .42,
|
|
774
|
+
transform: n && !y && !v ? "scale(1.04)" : "scale(1)",
|
|
775
|
+
transition: "background-color 0.15s ease, color 0.15s ease, transform 0.15s ease",
|
|
776
|
+
...e.styles?.dayCell,
|
|
777
|
+
...s ? void 0 : e.styles?.outsideMonthCell,
|
|
778
|
+
...f ? e.styles?.todayCell : void 0,
|
|
779
|
+
...m ? e.styles?.rangeBetweenCell : void 0,
|
|
780
|
+
...d ? e.styles?.selectedCell : void 0,
|
|
781
|
+
...h ? e.styles?.rangeStartCell : void 0,
|
|
782
|
+
...g ? e.styles?.rangeEndCell : void 0,
|
|
783
|
+
..._ ? e.styles?.disabledCell : void 0,
|
|
784
|
+
...p ? e.styles?.holidayCell : void 0
|
|
738
785
|
},
|
|
739
|
-
onMouseEnter: (
|
|
740
|
-
e.onHover?.(
|
|
786
|
+
onMouseEnter: () => {
|
|
787
|
+
r(!0), e.onHover?.(a);
|
|
741
788
|
},
|
|
742
|
-
onMouseLeave: (
|
|
743
|
-
!
|
|
789
|
+
onMouseLeave: () => {
|
|
790
|
+
r(!1), e.onHover?.(null);
|
|
744
791
|
},
|
|
745
|
-
children:
|
|
792
|
+
children: [/* @__PURE__ */ c("span", {
|
|
793
|
+
"aria-hidden": "true",
|
|
794
|
+
children: b
|
|
795
|
+
}), !!e.events?.length && /* @__PURE__ */ c("span", {
|
|
796
|
+
"aria-hidden": "true",
|
|
797
|
+
className: e.classNames?.eventBadges,
|
|
798
|
+
style: {
|
|
799
|
+
position: "absolute",
|
|
800
|
+
insetInline: "3px",
|
|
801
|
+
bottom: "2px",
|
|
802
|
+
display: "flex",
|
|
803
|
+
justifyContent: "center",
|
|
804
|
+
gap: "2px",
|
|
805
|
+
...e.styles?.eventBadges
|
|
806
|
+
},
|
|
807
|
+
children: e.events?.slice(0, 3).map((n) => /* @__PURE__ */ c("span", {
|
|
808
|
+
className: e.classNames?.eventBadge,
|
|
809
|
+
style: {
|
|
810
|
+
width: "4px",
|
|
811
|
+
height: "4px",
|
|
812
|
+
borderRadius: "50%",
|
|
813
|
+
backgroundColor: n.color ?? t.colors.primary,
|
|
814
|
+
...e.styles?.eventBadge
|
|
815
|
+
}
|
|
816
|
+
}, n.id))
|
|
817
|
+
})]
|
|
746
818
|
});
|
|
747
|
-
},
|
|
748
|
-
let
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
}, [e]), /* @__PURE__ */ l("div", {
|
|
819
|
+
}, se = ({ currentYear: e, currentMonth: t, yearRangeCount: n = 100, onSelectMonth: r, onSelectYear: i, classNames: a, styles: s }) => {
|
|
820
|
+
let [d, f] = o("months"), [p, m] = o(() => Math.floor(e / 12) * 12), h = e - Math.floor(n / 2), g = e + Math.floor(n / 2), _ = (e) => {
|
|
821
|
+
e.stopPropagation(), m((e) => Math.max(h, e - 12));
|
|
822
|
+
}, v = (e) => {
|
|
823
|
+
e.stopPropagation(), m((e) => Math.min(g - 12, e + 12));
|
|
824
|
+
}, y = Array.from({ length: 12 }, (e, t) => p + t);
|
|
825
|
+
return /* @__PURE__ */ l("div", {
|
|
826
|
+
className: a?.calendar,
|
|
756
827
|
style: {
|
|
757
828
|
display: "flex",
|
|
758
829
|
flexDirection: "column",
|
|
759
|
-
gap: "
|
|
760
|
-
padding: "
|
|
830
|
+
gap: "6px",
|
|
831
|
+
padding: "8px",
|
|
761
832
|
width: "100%",
|
|
762
|
-
height: "
|
|
833
|
+
height: "245px",
|
|
763
834
|
boxSizing: "border-box",
|
|
764
|
-
justifyContent: "space-between"
|
|
835
|
+
justifyContent: "space-between",
|
|
836
|
+
...s?.calendar
|
|
765
837
|
},
|
|
766
|
-
children: [/* @__PURE__ */
|
|
838
|
+
children: [/* @__PURE__ */ l("div", {
|
|
767
839
|
style: {
|
|
768
840
|
display: "flex",
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
841
|
+
alignItems: "center",
|
|
842
|
+
justifyContent: "space-between",
|
|
843
|
+
padding: "2px 4px",
|
|
844
|
+
borderBottom: "1px solid var(--pdp-surface-border, #e2e8f0)",
|
|
845
|
+
minHeight: "32px"
|
|
773
846
|
},
|
|
774
|
-
children:
|
|
775
|
-
|
|
776
|
-
return /* @__PURE__ */ c("button", {
|
|
777
|
-
ref: n ? s : void 0,
|
|
847
|
+
children: [
|
|
848
|
+
/* @__PURE__ */ c("button", {
|
|
778
849
|
type: "button",
|
|
779
|
-
onClick:
|
|
850
|
+
onClick: _,
|
|
780
851
|
style: {
|
|
781
|
-
|
|
782
|
-
borderRadius: o.radii.md,
|
|
852
|
+
background: "transparent",
|
|
783
853
|
border: "none",
|
|
784
|
-
background: n ? o.colors.primary : "transparent",
|
|
785
|
-
color: n ? o.colors.primaryText : o.colors.textPrimary,
|
|
786
854
|
cursor: "pointer",
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
855
|
+
padding: "4px 8px",
|
|
856
|
+
borderRadius: "6px",
|
|
857
|
+
color: "var(--pdp-text-primary, #0f172a)",
|
|
858
|
+
fontSize: "14px",
|
|
859
|
+
fontWeight: 700
|
|
792
860
|
},
|
|
793
|
-
|
|
794
|
-
|
|
861
|
+
"aria-label": "Previous Years",
|
|
862
|
+
children: "❯"
|
|
863
|
+
}),
|
|
864
|
+
/* @__PURE__ */ l("button", {
|
|
865
|
+
type: "button",
|
|
866
|
+
onClick: () => f((e) => e === "months" ? "years" : "months"),
|
|
867
|
+
style: {
|
|
868
|
+
background: "var(--pdp-surface-subtle, #f1f5f9)",
|
|
869
|
+
border: "1px solid var(--pdp-surface-border, #e2e8f0)",
|
|
870
|
+
borderRadius: "6px",
|
|
871
|
+
padding: "4px 10px",
|
|
872
|
+
cursor: "pointer",
|
|
873
|
+
fontSize: "0.8rem",
|
|
874
|
+
fontWeight: 700,
|
|
875
|
+
color: "var(--pdp-text-primary, #0f172a)",
|
|
876
|
+
display: "flex",
|
|
877
|
+
alignItems: "center",
|
|
878
|
+
gap: "4px"
|
|
795
879
|
},
|
|
796
|
-
|
|
797
|
-
|
|
880
|
+
children: [/* @__PURE__ */ c("span", { children: d === "months" ? I(e) : `${I(p)} - ${I(p + 12 - 1)}` }), /* @__PURE__ */ c("span", {
|
|
881
|
+
style: {
|
|
882
|
+
fontSize: "10px",
|
|
883
|
+
opacity: .6
|
|
884
|
+
},
|
|
885
|
+
children: d === "months" ? "▼" : "▲"
|
|
886
|
+
})]
|
|
887
|
+
}),
|
|
888
|
+
/* @__PURE__ */ c("button", {
|
|
889
|
+
type: "button",
|
|
890
|
+
onClick: v,
|
|
891
|
+
style: {
|
|
892
|
+
background: "transparent",
|
|
893
|
+
border: "none",
|
|
894
|
+
cursor: "pointer",
|
|
895
|
+
padding: "4px 8px",
|
|
896
|
+
borderRadius: "6px",
|
|
897
|
+
color: "var(--pdp-text-primary, #0f172a)",
|
|
898
|
+
fontSize: "14px",
|
|
899
|
+
fontWeight: 700
|
|
798
900
|
},
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
901
|
+
"aria-label": "Next Years",
|
|
902
|
+
children: "❮"
|
|
903
|
+
})
|
|
904
|
+
]
|
|
802
905
|
}), /* @__PURE__ */ c("div", {
|
|
803
906
|
style: {
|
|
804
907
|
display: "grid",
|
|
805
908
|
gridTemplateColumns: "repeat(3, 1fr)",
|
|
806
909
|
gridTemplateRows: "repeat(4, 1fr)",
|
|
807
|
-
gap: "
|
|
910
|
+
gap: "6px",
|
|
808
911
|
flex: 1
|
|
809
912
|
},
|
|
810
|
-
children: u.map((e,
|
|
811
|
-
let i =
|
|
913
|
+
children: d === "months" ? u.map((e, n) => {
|
|
914
|
+
let i = n === t;
|
|
812
915
|
return /* @__PURE__ */ c("button", {
|
|
813
916
|
type: "button",
|
|
814
|
-
onClick: () => n
|
|
917
|
+
onClick: () => r(n),
|
|
815
918
|
style: {
|
|
816
|
-
borderRadius:
|
|
919
|
+
borderRadius: "8px",
|
|
817
920
|
border: "none",
|
|
818
|
-
background: i ?
|
|
819
|
-
color: i ?
|
|
921
|
+
background: i ? "var(--pdp-primary, #4f46e5)" : "var(--pdp-surface-subtle, #f1f5f9)",
|
|
922
|
+
color: i ? "#ffffff" : "var(--pdp-text-primary, #0f172a)",
|
|
820
923
|
cursor: "pointer",
|
|
821
924
|
fontWeight: i ? 700 : 500,
|
|
822
|
-
fontSize: "
|
|
925
|
+
fontSize: "12px",
|
|
823
926
|
display: "flex",
|
|
824
927
|
alignItems: "center",
|
|
825
928
|
justifyContent: "center",
|
|
826
929
|
transition: "all 0.15s ease"
|
|
827
930
|
},
|
|
828
|
-
onMouseEnter: (e) => {
|
|
829
|
-
i || (e.currentTarget.style.backgroundColor = o.colors.backgroundHover, e.currentTarget.style.transform = "translateY(-1px)");
|
|
830
|
-
},
|
|
831
|
-
onMouseLeave: (e) => {
|
|
832
|
-
i || (e.currentTarget.style.backgroundColor = o.colors.surface, e.currentTarget.style.transform = "translateY(0)");
|
|
833
|
-
},
|
|
834
931
|
children: e
|
|
835
932
|
}, e);
|
|
933
|
+
}) : y.map((t) => {
|
|
934
|
+
let n = t === e;
|
|
935
|
+
return /* @__PURE__ */ c("button", {
|
|
936
|
+
type: "button",
|
|
937
|
+
onClick: () => {
|
|
938
|
+
i(t), f("months");
|
|
939
|
+
},
|
|
940
|
+
style: {
|
|
941
|
+
borderRadius: "8px",
|
|
942
|
+
border: "none",
|
|
943
|
+
background: n ? "var(--pdp-primary, #4f46e5)" : "var(--pdp-surface-subtle, #f1f5f9)",
|
|
944
|
+
color: n ? "#ffffff" : "var(--pdp-text-primary, #0f172a)",
|
|
945
|
+
cursor: "pointer",
|
|
946
|
+
fontWeight: n ? 700 : 500,
|
|
947
|
+
fontSize: "12px",
|
|
948
|
+
display: "flex",
|
|
949
|
+
alignItems: "center",
|
|
950
|
+
justifyContent: "center",
|
|
951
|
+
transition: "all 0.15s ease"
|
|
952
|
+
},
|
|
953
|
+
children: I(t)
|
|
954
|
+
}, t);
|
|
836
955
|
})
|
|
837
956
|
})]
|
|
838
957
|
});
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
958
|
+
};
|
|
959
|
+
//#endregion
|
|
960
|
+
//#region src/plugins/time-picker/time-utils.ts
|
|
961
|
+
function H(e, t = "persian") {
|
|
962
|
+
let n = e < 10 ? `0${e}` : `${e}`;
|
|
963
|
+
return t === "persian" ? I(n) : n;
|
|
964
|
+
}
|
|
965
|
+
function ce() {
|
|
966
|
+
let e = /* @__PURE__ */ new Date();
|
|
967
|
+
return {
|
|
968
|
+
hour: e.getHours(),
|
|
969
|
+
minute: e.getMinutes(),
|
|
970
|
+
second: e.getSeconds()
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
function le(e) {
|
|
974
|
+
return {
|
|
975
|
+
hour: Math.max(0, Math.min(23, e.hour)),
|
|
976
|
+
minute: Math.max(0, Math.min(59, e.minute)),
|
|
977
|
+
second: e.second === void 0 ? void 0 : Math.max(0, Math.min(59, e.second))
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
function ue(e, t = !1, n = "persian") {
|
|
981
|
+
if (!e) return "";
|
|
982
|
+
let r = H(e.hour, n), i = H(e.minute, n);
|
|
983
|
+
return t && e.second !== void 0 ? `${r}:${i}:${H(e.second, n)}` : `${r}:${i}`;
|
|
984
|
+
}
|
|
985
|
+
//#endregion
|
|
986
|
+
//#region src/components/footer/CalendarFooter.tsx
|
|
987
|
+
var de = ({ selectedDate: e, selectedRange: t, selectedDates: n, selectedTime: r, showSeconds: i = !1, mode: a = "single", digitType: o = "persian", showStatusText: s = !0, showActions: u = !0, onToday: d, onClear: f, onConfirm: p, direction: m = "rtl", classNames: h, styles: g }) => {
|
|
988
|
+
let { theme: _ } = V(), v = (() => {
|
|
989
|
+
if (a === "single") {
|
|
990
|
+
if (!e) return "تاریخی انتخاب نشده";
|
|
991
|
+
let t = R(e, "YYYY/MM/DD", { digitType: o }), n = r ? ue(r, i, o) : "";
|
|
992
|
+
return n ? `${t}، ${n}` : t;
|
|
993
|
+
}
|
|
994
|
+
if (a === "range") {
|
|
995
|
+
let [e, n] = t ?? [null, null];
|
|
996
|
+
if (!e) return "بازهای انتخاب نشده";
|
|
997
|
+
let r = R(e, "YYYY/MM/DD", { digitType: o });
|
|
998
|
+
return n ? `${r} تا ${R(n, "YYYY/MM/DD", { digitType: o })}` : `${r} تا …`;
|
|
999
|
+
}
|
|
1000
|
+
let s = n?.length ?? 0, c = o === "persian" ? I(s) : String(s);
|
|
1001
|
+
return s ? `${c} تاریخ انتخاب شده` : "تاریخی انتخاب نشده";
|
|
1002
|
+
})(), y = {
|
|
1003
|
+
minHeight: "34px",
|
|
1004
|
+
padding: "5px 12px",
|
|
1005
|
+
borderRadius: _.radii.sm,
|
|
1006
|
+
border: `1px solid ${_.colors.border}`,
|
|
1007
|
+
backgroundColor: _.colors.background,
|
|
1008
|
+
color: _.colors.textSecondary,
|
|
848
1009
|
cursor: "pointer",
|
|
849
|
-
|
|
1010
|
+
fontFamily: "inherit",
|
|
1011
|
+
fontSize: "0.78rem",
|
|
1012
|
+
fontWeight: 600
|
|
850
1013
|
};
|
|
851
1014
|
return /* @__PURE__ */ l("div", {
|
|
1015
|
+
dir: m,
|
|
1016
|
+
className: h?.footer,
|
|
852
1017
|
style: {
|
|
853
1018
|
display: "flex",
|
|
854
1019
|
alignItems: "center",
|
|
855
|
-
justifyContent: "space-between",
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
1020
|
+
justifyContent: s ? "space-between" : "flex-end",
|
|
1021
|
+
flexWrap: "wrap",
|
|
1022
|
+
gap: "8px",
|
|
1023
|
+
padding: "10px 0 0",
|
|
1024
|
+
borderTop: `1px solid ${_.colors.border}`,
|
|
1025
|
+
color: _.colors.textPrimary,
|
|
1026
|
+
...g?.footer
|
|
859
1027
|
},
|
|
860
|
-
children: [
|
|
861
|
-
|
|
862
|
-
onClick: e,
|
|
1028
|
+
children: [s && /* @__PURE__ */ c("span", {
|
|
1029
|
+
className: h?.footerStatus,
|
|
863
1030
|
style: {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
onMouseEnter: (e) => {
|
|
869
|
-
e.currentTarget.style.backgroundColor = r.colors.backgroundHover;
|
|
870
|
-
},
|
|
871
|
-
onMouseLeave: (e) => {
|
|
872
|
-
e.currentTarget.style.backgroundColor = "transparent";
|
|
873
|
-
},
|
|
874
|
-
children: "برو به امروز"
|
|
875
|
-
}), n && t && /* @__PURE__ */ c("button", {
|
|
876
|
-
type: "button",
|
|
877
|
-
onClick: t,
|
|
878
|
-
style: i,
|
|
879
|
-
onMouseEnter: (e) => {
|
|
880
|
-
e.currentTarget.style.backgroundColor = r.colors.backgroundHover, e.currentTarget.style.color = r.colors.holiday;
|
|
1031
|
+
color: _.colors.textSecondary,
|
|
1032
|
+
fontSize: "0.78rem",
|
|
1033
|
+
lineHeight: 1.5,
|
|
1034
|
+
...g?.footerStatus
|
|
881
1035
|
},
|
|
882
|
-
|
|
883
|
-
|
|
1036
|
+
children: v
|
|
1037
|
+
}), u && /* @__PURE__ */ l("div", {
|
|
1038
|
+
className: h?.footerActions,
|
|
1039
|
+
style: {
|
|
1040
|
+
display: "inline-flex",
|
|
1041
|
+
alignItems: "center",
|
|
1042
|
+
flexWrap: "wrap",
|
|
1043
|
+
gap: "6px",
|
|
1044
|
+
...g?.footerActions
|
|
884
1045
|
},
|
|
885
|
-
children:
|
|
1046
|
+
children: [
|
|
1047
|
+
d && /* @__PURE__ */ c("button", {
|
|
1048
|
+
type: "button",
|
|
1049
|
+
onClick: d,
|
|
1050
|
+
className: h?.todayButton,
|
|
1051
|
+
style: {
|
|
1052
|
+
...y,
|
|
1053
|
+
color: _.colors.primary,
|
|
1054
|
+
...g?.todayButton
|
|
1055
|
+
},
|
|
1056
|
+
children: "امروز"
|
|
1057
|
+
}),
|
|
1058
|
+
f && /* @__PURE__ */ c("button", {
|
|
1059
|
+
type: "button",
|
|
1060
|
+
onClick: f,
|
|
1061
|
+
className: h?.clearButton,
|
|
1062
|
+
style: {
|
|
1063
|
+
...y,
|
|
1064
|
+
...g?.clearButton
|
|
1065
|
+
},
|
|
1066
|
+
children: "پاک کردن"
|
|
1067
|
+
}),
|
|
1068
|
+
p && /* @__PURE__ */ c("button", {
|
|
1069
|
+
type: "button",
|
|
1070
|
+
onClick: p,
|
|
1071
|
+
className: h?.confirmButton,
|
|
1072
|
+
style: {
|
|
1073
|
+
...y,
|
|
1074
|
+
borderColor: _.colors.primary,
|
|
1075
|
+
backgroundColor: _.colors.primary,
|
|
1076
|
+
color: _.colors.primaryText,
|
|
1077
|
+
...g?.confirmButton
|
|
1078
|
+
},
|
|
1079
|
+
children: "تأیید"
|
|
1080
|
+
})
|
|
1081
|
+
]
|
|
886
1082
|
})]
|
|
887
1083
|
});
|
|
888
|
-
},
|
|
889
|
-
let
|
|
890
|
-
|
|
1084
|
+
}, fe = ({ value: e, hours: t, minutes: n, seconds: r, minuteStep: i = 1, hourStep: a = 1, showSeconds: o = !1, classNames: u, styles: d, onChange: f }) => {
|
|
1085
|
+
let p = e?.hour ?? t ?? 0, m = e?.minute ?? n ?? 0, h = e?.second ?? r ?? 0, g = (e) => {
|
|
1086
|
+
f({
|
|
891
1087
|
hour: parseInt(e.target.value, 10),
|
|
892
|
-
minute:
|
|
893
|
-
second:
|
|
1088
|
+
minute: m,
|
|
1089
|
+
second: h
|
|
894
1090
|
});
|
|
895
|
-
},
|
|
896
|
-
|
|
897
|
-
hour:
|
|
1091
|
+
}, _ = (e) => {
|
|
1092
|
+
f({
|
|
1093
|
+
hour: p,
|
|
898
1094
|
minute: parseInt(e.target.value, 10),
|
|
899
|
-
second:
|
|
1095
|
+
second: h
|
|
900
1096
|
});
|
|
901
|
-
},
|
|
902
|
-
|
|
903
|
-
hour:
|
|
904
|
-
minute:
|
|
1097
|
+
}, v = (e) => {
|
|
1098
|
+
f({
|
|
1099
|
+
hour: p,
|
|
1100
|
+
minute: m,
|
|
905
1101
|
second: parseInt(e.target.value, 10)
|
|
906
1102
|
});
|
|
907
|
-
},
|
|
908
|
-
background:
|
|
909
|
-
color:
|
|
910
|
-
border:
|
|
911
|
-
borderRadius:
|
|
1103
|
+
}, y = {
|
|
1104
|
+
background: "var(--pdp-surface-subtle, #f8fafc)",
|
|
1105
|
+
color: "var(--pdp-text-primary, #0f172a)",
|
|
1106
|
+
border: "1px solid var(--pdp-surface-border, #e2e8f0)",
|
|
1107
|
+
borderRadius: "6px",
|
|
912
1108
|
padding: "4px 6px",
|
|
913
|
-
fontSize: "
|
|
1109
|
+
fontSize: "12px",
|
|
914
1110
|
fontWeight: 600,
|
|
915
1111
|
outline: "none",
|
|
916
1112
|
cursor: "pointer",
|
|
917
1113
|
direction: "ltr"
|
|
918
1114
|
};
|
|
919
1115
|
return /* @__PURE__ */ l("div", {
|
|
1116
|
+
className: u?.timePicker,
|
|
920
1117
|
style: {
|
|
921
1118
|
display: "flex",
|
|
922
1119
|
alignItems: "center",
|
|
923
1120
|
justifyContent: "center",
|
|
924
1121
|
gap: "6px",
|
|
925
1122
|
padding: "8px 12px",
|
|
926
|
-
borderTop:
|
|
927
|
-
direction: "ltr"
|
|
1123
|
+
borderTop: "1px solid var(--pdp-surface-border, #e2e8f0)",
|
|
1124
|
+
direction: "ltr",
|
|
1125
|
+
color: "var(--pdp-text-primary, #0f172a)",
|
|
1126
|
+
...d?.timePicker
|
|
928
1127
|
},
|
|
929
1128
|
children: [
|
|
930
1129
|
/* @__PURE__ */ c("span", {
|
|
931
1130
|
style: {
|
|
932
|
-
fontSize: "
|
|
933
|
-
color:
|
|
934
|
-
marginRight: "4px"
|
|
1131
|
+
fontSize: "12px",
|
|
1132
|
+
color: "var(--pdp-text-muted, #64748b)",
|
|
1133
|
+
marginRight: "4px",
|
|
1134
|
+
fontWeight: 500
|
|
935
1135
|
},
|
|
936
|
-
children: "
|
|
1136
|
+
children: "Time:"
|
|
937
1137
|
}),
|
|
938
1138
|
/* @__PURE__ */ c("select", {
|
|
939
|
-
value:
|
|
940
|
-
onChange:
|
|
941
|
-
style:
|
|
942
|
-
|
|
1139
|
+
value: p,
|
|
1140
|
+
onChange: g,
|
|
1141
|
+
style: y,
|
|
1142
|
+
"aria-label": "Select Hour",
|
|
1143
|
+
children: Array.from({ length: Math.ceil(24 / a) }, (e, t) => t * a).map((e) => /* @__PURE__ */ c("option", {
|
|
943
1144
|
value: e,
|
|
944
1145
|
children: String(e).padStart(2, "0")
|
|
945
1146
|
}, e))
|
|
946
1147
|
}),
|
|
947
1148
|
/* @__PURE__ */ c("span", {
|
|
948
1149
|
style: {
|
|
949
|
-
color:
|
|
1150
|
+
color: "var(--pdp-text-muted, #64748b)",
|
|
950
1151
|
fontWeight: 700
|
|
951
1152
|
},
|
|
952
1153
|
children: ":"
|
|
953
1154
|
}),
|
|
954
1155
|
/* @__PURE__ */ c("select", {
|
|
955
|
-
value:
|
|
956
|
-
onChange:
|
|
957
|
-
style:
|
|
958
|
-
|
|
1156
|
+
value: m,
|
|
1157
|
+
onChange: _,
|
|
1158
|
+
style: y,
|
|
1159
|
+
"aria-label": "Select Minute",
|
|
1160
|
+
children: Array.from({ length: Math.ceil(60 / i) }, (e, t) => t * i).map((e) => /* @__PURE__ */ c("option", {
|
|
959
1161
|
value: e,
|
|
960
1162
|
children: String(e).padStart(2, "0")
|
|
961
1163
|
}, e))
|
|
962
1164
|
}),
|
|
963
|
-
|
|
1165
|
+
o && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
|
|
964
1166
|
style: {
|
|
965
|
-
color:
|
|
1167
|
+
color: "var(--pdp-text-muted, #64748b)",
|
|
966
1168
|
fontWeight: 700
|
|
967
1169
|
},
|
|
968
1170
|
children: ":"
|
|
969
1171
|
}), /* @__PURE__ */ c("select", {
|
|
970
|
-
value:
|
|
971
|
-
onChange:
|
|
972
|
-
style:
|
|
1172
|
+
value: h,
|
|
1173
|
+
onChange: v,
|
|
1174
|
+
style: y,
|
|
1175
|
+
"aria-label": "Select Second",
|
|
973
1176
|
children: Array.from({ length: 60 }, (e, t) => /* @__PURE__ */ c("option", {
|
|
974
1177
|
value: t,
|
|
975
1178
|
children: String(t).padStart(2, "0")
|
|
@@ -979,39 +1182,13 @@ var R = {
|
|
|
979
1182
|
});
|
|
980
1183
|
};
|
|
981
1184
|
//#endregion
|
|
982
|
-
//#region src/plugins/time-picker/time-utils.ts
|
|
983
|
-
function H(e, t = "persian") {
|
|
984
|
-
let n = e < 10 ? `0${e}` : `${e}`;
|
|
985
|
-
return t === "persian" ? F(n) : n;
|
|
986
|
-
}
|
|
987
|
-
function U() {
|
|
988
|
-
let e = /* @__PURE__ */ new Date();
|
|
989
|
-
return {
|
|
990
|
-
hour: e.getHours(),
|
|
991
|
-
minute: e.getMinutes(),
|
|
992
|
-
second: e.getSeconds()
|
|
993
|
-
};
|
|
994
|
-
}
|
|
995
|
-
function le(e) {
|
|
996
|
-
return {
|
|
997
|
-
hour: Math.max(0, Math.min(23, e.hour)),
|
|
998
|
-
minute: Math.max(0, Math.min(59, e.minute)),
|
|
999
|
-
second: e.second === void 0 ? void 0 : Math.max(0, Math.min(59, e.second))
|
|
1000
|
-
};
|
|
1001
|
-
}
|
|
1002
|
-
function ue(e, t = !1, n = "persian") {
|
|
1003
|
-
if (!e) return "";
|
|
1004
|
-
let r = H(e.hour, n), i = H(e.minute, n);
|
|
1005
|
-
return t && e.second !== void 0 ? `${r}:${i}:${H(e.second, n)}` : `${r}:${i}`;
|
|
1006
|
-
}
|
|
1007
|
-
//#endregion
|
|
1008
1185
|
//#region src/components/masked-input/mask-utils.ts
|
|
1009
|
-
function
|
|
1010
|
-
let n =
|
|
1011
|
-
return n.length > 0 && (r = n.slice(0, 4)), n.length >= 5 && (r += `/${n.slice(4, 6)}`), n.length >= 7 && (r += `/${n.slice(6, 8)}`), t === "persian" ?
|
|
1186
|
+
function U(e, t = "persian") {
|
|
1187
|
+
let n = L(e).replace(/\D/g, "").slice(0, 8), r = "";
|
|
1188
|
+
return n.length > 0 && (r = n.slice(0, 4)), n.length >= 5 && (r += `/${n.slice(4, 6)}`), n.length >= 7 && (r += `/${n.slice(6, 8)}`), t === "persian" ? I(r) : r;
|
|
1012
1189
|
}
|
|
1013
|
-
function
|
|
1014
|
-
let i =
|
|
1190
|
+
function W(e, t, n, r) {
|
|
1191
|
+
let i = L(e).trim();
|
|
1015
1192
|
if (!i) return {
|
|
1016
1193
|
isValid: !0,
|
|
1017
1194
|
date: null
|
|
@@ -1058,73 +1235,77 @@ function de(e, t, n, r) {
|
|
|
1058
1235
|
}
|
|
1059
1236
|
//#endregion
|
|
1060
1237
|
//#region src/components/masked-input/MaskedDateInput.tsx
|
|
1061
|
-
var
|
|
1062
|
-
let [
|
|
1238
|
+
var pe = ({ value: e, defaultValue: n = null, onChange: i, onValidationError: s, digitType: u = "persian", minDate: d, maxDate: f, isDateDisabled: p, clearable: m = !0, placeholder: h = "۱۴۰۵/۰۱/۱۵", disabled: g = !1, direction: _ = "rtl", wrapperClassName: v, wrapperStyle: y, clearButtonClassName: b, clearButtonStyle: x, style: S, ...C }) => {
|
|
1239
|
+
let { theme: w } = V(), [T, E] = o(n), D = e === void 0 ? T : e, [O, k] = o(() => D ? R(D, "YYYY/MM/DD", { digitType: u }) : ""), [A, j] = o(!1), M = a(null);
|
|
1063
1240
|
r(() => {
|
|
1064
|
-
e !== void 0 && (
|
|
1241
|
+
e !== void 0 && (k(e ? R(e, "YYYY/MM/DD", { digitType: u }) : ""), j(!1));
|
|
1065
1242
|
}, [e, u]);
|
|
1066
|
-
let
|
|
1067
|
-
let n = t.target.value, r =
|
|
1068
|
-
if (
|
|
1069
|
-
let t =
|
|
1070
|
-
t.isValid ? (
|
|
1071
|
-
} else
|
|
1072
|
-
},
|
|
1073
|
-
|
|
1243
|
+
let N = (t) => {
|
|
1244
|
+
let n = t.target.value, r = U(n, u);
|
|
1245
|
+
if (k(r), r.length === 10 || r.length === 0) {
|
|
1246
|
+
let t = W(r, d, f, p);
|
|
1247
|
+
t.isValid ? (j(!1), s?.(null), e === void 0 && E(t.date), i?.(t.date)) : (j(!0), s?.(t.error));
|
|
1248
|
+
} else j(!1), s?.(null);
|
|
1249
|
+
}, P = t(() => {
|
|
1250
|
+
k(""), j(!1), s?.(null), e === void 0 && E(null), i?.(null), M.current?.focus();
|
|
1074
1251
|
}, [
|
|
1075
1252
|
e,
|
|
1076
1253
|
i,
|
|
1077
1254
|
s
|
|
1078
1255
|
]);
|
|
1079
1256
|
return /* @__PURE__ */ l("div", {
|
|
1257
|
+
dir: _,
|
|
1258
|
+
className: v,
|
|
1080
1259
|
style: {
|
|
1081
1260
|
position: "relative",
|
|
1082
1261
|
display: "inline-flex",
|
|
1083
1262
|
alignItems: "center",
|
|
1084
|
-
|
|
1263
|
+
...y
|
|
1085
1264
|
},
|
|
1086
1265
|
children: [/* @__PURE__ */ c("input", {
|
|
1087
|
-
ref:
|
|
1266
|
+
ref: M,
|
|
1088
1267
|
type: "text",
|
|
1089
1268
|
inputMode: "numeric",
|
|
1090
1269
|
disabled: g,
|
|
1091
1270
|
placeholder: u === "persian" ? h : "1405/01/15",
|
|
1092
|
-
value:
|
|
1093
|
-
onChange:
|
|
1271
|
+
value: O,
|
|
1272
|
+
onChange: N,
|
|
1094
1273
|
style: {
|
|
1095
1274
|
width: "180px",
|
|
1096
1275
|
padding: "8px 12px",
|
|
1097
|
-
|
|
1098
|
-
borderRadius:
|
|
1099
|
-
border: `1px solid ${
|
|
1100
|
-
backgroundColor:
|
|
1101
|
-
color:
|
|
1276
|
+
paddingInlineEnd: m && O ? "32px" : "12px",
|
|
1277
|
+
borderRadius: w.radii.sm,
|
|
1278
|
+
border: `1px solid ${A ? w.colors.holiday : w.colors.border}`,
|
|
1279
|
+
backgroundColor: w.colors.background,
|
|
1280
|
+
color: w.colors.textPrimary,
|
|
1102
1281
|
fontSize: "14px",
|
|
1103
1282
|
fontFamily: "inherit",
|
|
1104
|
-
|
|
1283
|
+
outlineColor: w.colors.primary,
|
|
1105
1284
|
textAlign: "center",
|
|
1106
1285
|
letterSpacing: "1px",
|
|
1107
1286
|
transition: "border-color 0.15s ease",
|
|
1108
|
-
...
|
|
1287
|
+
...S
|
|
1109
1288
|
},
|
|
1110
|
-
...
|
|
1111
|
-
}), m &&
|
|
1289
|
+
...C
|
|
1290
|
+
}), m && O && !g && /* @__PURE__ */ c("button", {
|
|
1112
1291
|
type: "button",
|
|
1113
1292
|
"aria-label": "پاک کردن",
|
|
1114
|
-
onClick:
|
|
1293
|
+
onClick: P,
|
|
1294
|
+
className: b,
|
|
1115
1295
|
style: {
|
|
1116
1296
|
position: "absolute",
|
|
1117
|
-
|
|
1297
|
+
insetInlineEnd: "8px",
|
|
1118
1298
|
background: "none",
|
|
1119
1299
|
border: "none",
|
|
1120
1300
|
cursor: "pointer",
|
|
1121
|
-
color:
|
|
1301
|
+
color: w.colors.textSecondary,
|
|
1122
1302
|
fontSize: "14px",
|
|
1123
1303
|
lineHeight: 1,
|
|
1124
1304
|
display: "flex",
|
|
1125
1305
|
alignItems: "center",
|
|
1126
1306
|
justifyContent: "center",
|
|
1127
|
-
padding: "2px"
|
|
1307
|
+
padding: "2px",
|
|
1308
|
+
...x
|
|
1128
1309
|
},
|
|
1129
1310
|
children: "✕"
|
|
1130
1311
|
})]
|
|
@@ -1132,12 +1313,12 @@ var fe = ({ value: e, defaultValue: n = null, onChange: i, onValidationError: s,
|
|
|
1132
1313
|
};
|
|
1133
1314
|
//#endregion
|
|
1134
1315
|
//#region src/events/event-utils.ts
|
|
1135
|
-
function
|
|
1316
|
+
function me(e, t) {
|
|
1136
1317
|
return !t || t.length === 0 ? [] : t.filter((t) => y(t.date, e));
|
|
1137
1318
|
}
|
|
1138
1319
|
//#endregion
|
|
1139
1320
|
//#region src/holidays/iran-holidays.ts
|
|
1140
|
-
var
|
|
1321
|
+
var he = {
|
|
1141
1322
|
"0-1": "جشن نوروز / سال نو",
|
|
1142
1323
|
"0-2": "عید نوروز",
|
|
1143
1324
|
"0-3": "عید نوروز",
|
|
@@ -1149,10 +1330,10 @@ var G = {
|
|
|
1149
1330
|
"10-22": "پیروزی انقلاب اسلامی",
|
|
1150
1331
|
"11-29": "روز ملی شدن صنعت نفت"
|
|
1151
1332
|
};
|
|
1152
|
-
function
|
|
1333
|
+
function ge(e) {
|
|
1153
1334
|
return _(e.year, e.month, e.day).getDay() === 5;
|
|
1154
1335
|
}
|
|
1155
|
-
function
|
|
1336
|
+
function _e(e, t) {
|
|
1156
1337
|
if (t && t.length > 0) {
|
|
1157
1338
|
let n = t.find((t) => t.date.year === e.year && t.date.month === e.month && t.date.day === e.day);
|
|
1158
1339
|
if (n) return {
|
|
@@ -1162,11 +1343,11 @@ function me(e, t) {
|
|
|
1162
1343
|
};
|
|
1163
1344
|
}
|
|
1164
1345
|
let n = `${e.month}-${e.day}`;
|
|
1165
|
-
return
|
|
1166
|
-
title:
|
|
1346
|
+
return he[n] ? {
|
|
1347
|
+
title: he[n],
|
|
1167
1348
|
type: "solar",
|
|
1168
1349
|
isOff: !0
|
|
1169
|
-
} :
|
|
1350
|
+
} : ge(e) ? {
|
|
1170
1351
|
title: "جمعه (تعطیل پایان هفته)",
|
|
1171
1352
|
type: "solar",
|
|
1172
1353
|
isOff: !0
|
|
@@ -1174,8 +1355,27 @@ function me(e, t) {
|
|
|
1174
1355
|
}
|
|
1175
1356
|
//#endregion
|
|
1176
1357
|
//#region src/components/JalaliDatePicker.tsx
|
|
1177
|
-
function
|
|
1178
|
-
|
|
1358
|
+
function ve(e) {
|
|
1359
|
+
if (e instanceof Date && !Number.isNaN(e.getTime())) return e;
|
|
1360
|
+
if (Array.isArray(e)) {
|
|
1361
|
+
for (let t of e) if (t instanceof Date && !Number.isNaN(t.getTime())) return t;
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
function ye(e) {
|
|
1365
|
+
if (!(!e || Number.isNaN(e.getTime()))) return {
|
|
1366
|
+
hour: e.getHours(),
|
|
1367
|
+
minute: e.getMinutes(),
|
|
1368
|
+
second: e.getSeconds()
|
|
1369
|
+
};
|
|
1370
|
+
}
|
|
1371
|
+
function be({ mode: e = "single", value: n, defaultValue: d, onChange: f, minDate: p, maxDate: m, isDateDisabled: h, firstDayOfWeek: g = 0, initialViewDate: _, direction: v = "rtl", variant: b = "inline", placeholder: w = "انتخاب تاریخ...", digitType: T = "persian", className: E, style: D, classNames: k, styles: A, showFooter: M = !1, showStatusText: N = !0, showActions: F = !0, onConfirm: ee, enableTime: L = !1, timeValue: z, defaultTimeValue: te, onTimeChange: B, minuteStep: ne = 1, hourStep: H = 1, secondStep: le = 1, showSeconds: U = !1, numberOfMonths: W = 1, useMaskedInput: he = !1, events: ge, showHolidays: be = !1, customHolidays: xe, closeOnOutsideClick: Se = !0, closeOnEscape: Ce = !0, onOpenChange: we }) {
|
|
1372
|
+
let { theme: G } = V(), [K, Te] = o(b === "inline"), Ee = a(b === "inline"), [De, Oe] = o(!1), ke = a(null), Ae = a(we), q = b === "modal";
|
|
1373
|
+
r(() => {
|
|
1374
|
+
Ae.current = we;
|
|
1375
|
+
}, [we]);
|
|
1376
|
+
let J = t((e) => {
|
|
1377
|
+
Ee.current !== e && (Ee.current = e, Te(e), Ae.current?.(e));
|
|
1378
|
+
}, []), je = i(() => {
|
|
1179
1379
|
if (n !== void 0) {
|
|
1180
1380
|
if (!n) return null;
|
|
1181
1381
|
if (n instanceof Date) return S(n);
|
|
@@ -1188,7 +1388,7 @@ function he({ mode: e = "single", value: n, defaultValue: d, onChange: f, minDat
|
|
|
1188
1388
|
}
|
|
1189
1389
|
return null;
|
|
1190
1390
|
}
|
|
1191
|
-
}, [n, e]),
|
|
1391
|
+
}, [n, e]), Me = i(() => {
|
|
1192
1392
|
if (d !== void 0) {
|
|
1193
1393
|
if (!d) return null;
|
|
1194
1394
|
if (d instanceof Date) return S(d);
|
|
@@ -1201,71 +1401,108 @@ function he({ mode: e = "single", value: n, defaultValue: d, onChange: f, minDat
|
|
|
1201
1401
|
}
|
|
1202
1402
|
return null;
|
|
1203
1403
|
}
|
|
1204
|
-
}, [d, e]),
|
|
1205
|
-
|
|
1206
|
-
|
|
1404
|
+
}, [d, e]), Ne = i(() => p ? S(p) : void 0, [p]), Pe = i(() => m ? S(m) : void 0, [m]), Fe = i(() => {
|
|
1405
|
+
if (_) return _ instanceof Date ? S(_) : _;
|
|
1406
|
+
let e = ve(n) ?? ve(d);
|
|
1407
|
+
return e ? S(e) : void 0;
|
|
1408
|
+
}, [
|
|
1409
|
+
d,
|
|
1410
|
+
_,
|
|
1411
|
+
n
|
|
1412
|
+
]), Ie = i(() => ye(ve(n)), [n]), [Le, Re] = o(() => te ?? ye(ve(d)) ?? ce()), Y = z === null ? {
|
|
1413
|
+
hour: 0,
|
|
1414
|
+
minute: 0,
|
|
1415
|
+
second: 0
|
|
1416
|
+
} : z ?? Ie ?? Le, ze = t((e) => h ? h(C(e)) : !1, [h]), Be = t((t, n = Y) => {
|
|
1207
1417
|
if (!t) return null;
|
|
1208
|
-
let
|
|
1209
|
-
if (e === "single" && !Array.isArray(t)) return C(t,
|
|
1418
|
+
let r = L ? n.hour : 0, i = L ? n.minute : 0, a = L && U ? n.second ?? 0 : 0;
|
|
1419
|
+
if (e === "single" && !Array.isArray(t)) return C(t, r, i, a);
|
|
1210
1420
|
if (e === "range" && Array.isArray(t)) {
|
|
1211
1421
|
let [e, n] = t;
|
|
1212
|
-
return [e ? C(e,
|
|
1422
|
+
return [e ? C(e, r, i, a) : null, n ? C(n, L ? r : 23, L ? i : 59, L ? a : 59) : null];
|
|
1213
1423
|
}
|
|
1214
|
-
return e === "multiple" && Array.isArray(t) ? t.map((e) => C(e,
|
|
1424
|
+
return e === "multiple" && Array.isArray(t) ? t.map((e) => C(e, r, i, a)) : null;
|
|
1215
1425
|
}, [
|
|
1216
1426
|
e,
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
]), { selected:
|
|
1427
|
+
L,
|
|
1428
|
+
Y,
|
|
1429
|
+
U
|
|
1430
|
+
]), { selected: X, viewYear: Z, viewMonth: Q, grid: Ve, goToPrevMonth: He, goToNextMonth: Ue, setView: We, goToToday: Ge, selectDate: Ke, setHoverDate: qe, hoverDate: Je, clear: Ye } = j({
|
|
1221
1431
|
mode: e,
|
|
1222
|
-
value:
|
|
1223
|
-
defaultValue:
|
|
1224
|
-
|
|
1225
|
-
|
|
1432
|
+
value: je,
|
|
1433
|
+
defaultValue: Me,
|
|
1434
|
+
initialViewDate: Fe,
|
|
1435
|
+
minDate: Ne,
|
|
1436
|
+
maxDate: Pe,
|
|
1226
1437
|
firstDayOfWeek: g,
|
|
1227
|
-
isDateDisabled: h ?
|
|
1438
|
+
isDateDisabled: h ? ze : void 0,
|
|
1228
1439
|
onChange: (e) => {
|
|
1229
|
-
f?.(
|
|
1440
|
+
f?.(Be(e));
|
|
1230
1441
|
}
|
|
1231
|
-
}),
|
|
1232
|
-
|
|
1233
|
-
},
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1442
|
+
}), Xe = t((e) => {
|
|
1443
|
+
z === void 0 && Re(e), B?.(e), (Array.isArray(X) ? X.some(Boolean) : X) && f?.(Be(X, e));
|
|
1444
|
+
}, [
|
|
1445
|
+
z,
|
|
1446
|
+
B,
|
|
1447
|
+
X,
|
|
1448
|
+
f,
|
|
1449
|
+
Be
|
|
1450
|
+
]), Ze = e === "single" ? X : null, Qe = (t) => {
|
|
1451
|
+
Ke(t), b === "popover" && e === "single" && !L && J(!1);
|
|
1452
|
+
}, { handleKeyDown: $e, getCellTabIndex: et, setFocusedDate: tt } = P({
|
|
1453
|
+
viewYear: Z,
|
|
1454
|
+
viewMonth: Q,
|
|
1455
|
+
selectedDate: Ze,
|
|
1456
|
+
onSelectDate: Qe,
|
|
1457
|
+
onViewChange: We,
|
|
1458
|
+
isRtl: v === "rtl"
|
|
1240
1459
|
});
|
|
1241
1460
|
r(() => {
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
let
|
|
1246
|
-
|
|
1461
|
+
J(b === "inline");
|
|
1462
|
+
}, [b, J]), r(() => {
|
|
1463
|
+
if (!K || b === "inline") return;
|
|
1464
|
+
let e = (e) => {
|
|
1465
|
+
if (!Se || q) return;
|
|
1466
|
+
let t = e.target;
|
|
1467
|
+
t instanceof Node && !ke.current?.contains(t) && J(!1);
|
|
1468
|
+
}, t = (e) => {
|
|
1469
|
+
!Ce || e.key !== "Escape" || (J(!1), ke.current?.querySelector("input")?.focus());
|
|
1470
|
+
};
|
|
1471
|
+
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
1472
|
+
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
1247
1473
|
};
|
|
1248
|
-
|
|
1249
|
-
|
|
1474
|
+
}, [
|
|
1475
|
+
Ce,
|
|
1476
|
+
Se,
|
|
1477
|
+
q,
|
|
1478
|
+
K,
|
|
1479
|
+
J,
|
|
1480
|
+
b
|
|
1481
|
+
]), r(() => {
|
|
1482
|
+
if (!q || !K) return;
|
|
1483
|
+
let e = document.body.style.overflow;
|
|
1484
|
+
return document.body.style.overflow = "hidden", () => {
|
|
1485
|
+
document.body.style.overflow = e;
|
|
1250
1486
|
};
|
|
1251
|
-
}, [q,
|
|
1252
|
-
let $ = i(() =>
|
|
1253
|
-
year:
|
|
1487
|
+
}, [q, K]);
|
|
1488
|
+
let $ = i(() => Q === 11 ? {
|
|
1489
|
+
year: Z + 1,
|
|
1254
1490
|
month: 0
|
|
1255
1491
|
} : {
|
|
1256
|
-
year:
|
|
1257
|
-
month:
|
|
1258
|
-
}, [
|
|
1259
|
-
if (
|
|
1492
|
+
year: Z,
|
|
1493
|
+
month: Q + 1
|
|
1494
|
+
}, [Z, Q]), nt = i(() => {
|
|
1495
|
+
if (W !== 2) return [];
|
|
1260
1496
|
let t = x({
|
|
1261
1497
|
year: $.year,
|
|
1262
1498
|
month: $.month,
|
|
1263
1499
|
firstDayOfWeek: g,
|
|
1264
|
-
minDate:
|
|
1265
|
-
maxDate:
|
|
1500
|
+
minDate: Ne,
|
|
1501
|
+
maxDate: Pe,
|
|
1502
|
+
isDateDisabled: h ? ze : void 0
|
|
1266
1503
|
});
|
|
1267
1504
|
if (e !== "range") return t;
|
|
1268
|
-
let [n, r] =
|
|
1505
|
+
let [n, r] = X || [null, null], i = r ?? (n && Je ? Je : null);
|
|
1269
1506
|
return t.map((e) => {
|
|
1270
1507
|
let t = n ? y(e.jalali, n) : !1, r = i ? y(e.jalali, i) : !1, a = !1;
|
|
1271
1508
|
return n && i && (a = O(e.jalali, n, i)), {
|
|
@@ -1277,276 +1514,343 @@ function he({ mode: e = "single", value: n, defaultValue: d, onChange: f, minDat
|
|
|
1277
1514
|
};
|
|
1278
1515
|
});
|
|
1279
1516
|
}, [
|
|
1280
|
-
|
|
1517
|
+
W,
|
|
1281
1518
|
$,
|
|
1282
1519
|
g,
|
|
1283
|
-
|
|
1284
|
-
|
|
1520
|
+
Ne,
|
|
1521
|
+
Pe,
|
|
1522
|
+
ze,
|
|
1523
|
+
h,
|
|
1285
1524
|
e,
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
]),
|
|
1289
|
-
if (!
|
|
1525
|
+
X,
|
|
1526
|
+
Je
|
|
1527
|
+
]), rt = i(() => {
|
|
1528
|
+
if (!X) return "";
|
|
1290
1529
|
if (e === "single") {
|
|
1291
|
-
let e =
|
|
1292
|
-
return
|
|
1530
|
+
let e = R(X, "YYYY/MM/DD", { digitType: T });
|
|
1531
|
+
return L && Y ? `${e} ${ue(Y, U, T)}` : e;
|
|
1293
1532
|
}
|
|
1294
1533
|
if (e === "range") {
|
|
1295
|
-
let [e, t] =
|
|
1296
|
-
if (e && t) return `${
|
|
1297
|
-
if (e) return
|
|
1534
|
+
let [e, t] = X || [null, null], n = L ? ` ${ue(Y, U, T)}` : "";
|
|
1535
|
+
if (e && t) return `${R(e, "YYYY/MM/DD", { digitType: T })}${n} - ${R(t, "YYYY/MM/DD", { digitType: T })}${n}`;
|
|
1536
|
+
if (e) return `${R(e, "YYYY/MM/DD", { digitType: T })}${n}`;
|
|
1537
|
+
}
|
|
1538
|
+
if (e === "multiple") {
|
|
1539
|
+
let e = X.length;
|
|
1540
|
+
if (e > 0) return `${T === "persian" ? I(e) : String(e)} تاریخ انتخاب شده`;
|
|
1298
1541
|
}
|
|
1299
1542
|
return "";
|
|
1300
1543
|
}, [
|
|
1301
|
-
|
|
1544
|
+
X,
|
|
1302
1545
|
e,
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
]),
|
|
1308
|
-
|
|
1546
|
+
T,
|
|
1547
|
+
L,
|
|
1548
|
+
Y,
|
|
1549
|
+
U
|
|
1550
|
+
]), it = (e, t, n, r = !0, i = !0) => /* @__PURE__ */ l("div", {
|
|
1551
|
+
dir: v,
|
|
1552
|
+
className: k?.calendarPane,
|
|
1553
|
+
style: {
|
|
1554
|
+
width: "var(--pdp-calendar-pane-width, 276px)",
|
|
1555
|
+
minWidth: "var(--pdp-calendar-pane-width, 276px)",
|
|
1556
|
+
...A?.calendarPane
|
|
1557
|
+
},
|
|
1309
1558
|
children: [
|
|
1310
1559
|
/* @__PURE__ */ c(re, {
|
|
1311
1560
|
year: e,
|
|
1312
1561
|
monthName: u[t],
|
|
1313
|
-
onPrevMonth: r ?
|
|
1314
|
-
onNextMonth: i ?
|
|
1315
|
-
onTitleClick: () =>
|
|
1316
|
-
isPickerOpen:
|
|
1562
|
+
onPrevMonth: r ? He : () => {},
|
|
1563
|
+
onNextMonth: i ? Ue : () => {},
|
|
1564
|
+
onTitleClick: () => Oe((e) => !e),
|
|
1565
|
+
isPickerOpen: De,
|
|
1566
|
+
digitType: T,
|
|
1567
|
+
direction: v,
|
|
1568
|
+
classNames: k,
|
|
1569
|
+
styles: A
|
|
1317
1570
|
}),
|
|
1318
1571
|
/* @__PURE__ */ c(ie, {
|
|
1319
1572
|
firstDayOfWeek: g,
|
|
1320
|
-
|
|
1321
|
-
|
|
1573
|
+
direction: v,
|
|
1574
|
+
classNames: k,
|
|
1575
|
+
styles: A
|
|
1322
1576
|
}),
|
|
1323
1577
|
/* @__PURE__ */ c("div", {
|
|
1324
1578
|
role: "grid",
|
|
1325
|
-
"aria-label": `${u[t]} ${
|
|
1326
|
-
|
|
1579
|
+
"aria-label": `${u[t]} ${T === "persian" ? I(e) : e}`,
|
|
1580
|
+
dir: v,
|
|
1581
|
+
className: k?.grid,
|
|
1327
1582
|
style: {
|
|
1328
1583
|
display: "grid",
|
|
1584
|
+
width: "var(--pdp-calendar-pane-width, 276px)",
|
|
1329
1585
|
gridTemplateColumns: "repeat(7, var(--pdp-cell-size, 36px))",
|
|
1330
|
-
gap: "4px",
|
|
1331
|
-
...
|
|
1586
|
+
gap: "var(--pdp-cell-gap, 4px)",
|
|
1587
|
+
...A?.grid
|
|
1332
1588
|
},
|
|
1333
|
-
children: n.map((e
|
|
1334
|
-
let
|
|
1335
|
-
return /* @__PURE__ */ c(
|
|
1589
|
+
children: n.map((e) => {
|
|
1590
|
+
let t = be ? _e(e.jalali, xe) : null, n = me(e.jalali, ge);
|
|
1591
|
+
return /* @__PURE__ */ c(oe, {
|
|
1336
1592
|
cell: e,
|
|
1337
|
-
digitType:
|
|
1338
|
-
isHoliday: !!
|
|
1339
|
-
holidayTitle:
|
|
1340
|
-
events:
|
|
1341
|
-
classNames:
|
|
1342
|
-
styles:
|
|
1343
|
-
tabIndex:
|
|
1344
|
-
onSelect:
|
|
1345
|
-
onHover:
|
|
1346
|
-
onFocus:
|
|
1347
|
-
},
|
|
1593
|
+
digitType: T,
|
|
1594
|
+
isHoliday: !!t,
|
|
1595
|
+
holidayTitle: t?.title,
|
|
1596
|
+
events: n,
|
|
1597
|
+
classNames: k,
|
|
1598
|
+
styles: A,
|
|
1599
|
+
tabIndex: et(e.jalali),
|
|
1600
|
+
onSelect: Qe,
|
|
1601
|
+
onHover: qe,
|
|
1602
|
+
onFocus: tt
|
|
1603
|
+
}, `${e.jalali.year}-${e.jalali.month}-${e.jalali.day}`);
|
|
1348
1604
|
})
|
|
1349
1605
|
})
|
|
1350
1606
|
]
|
|
1351
|
-
}),
|
|
1352
|
-
role:
|
|
1607
|
+
}), at = /* @__PURE__ */ l("div", {
|
|
1608
|
+
role: b === "inline" ? "region" : "dialog",
|
|
1353
1609
|
"aria-modal": q ? !0 : void 0,
|
|
1354
1610
|
"aria-label": "تقویم شمسی",
|
|
1355
|
-
|
|
1611
|
+
dir: v,
|
|
1612
|
+
onKeyDown: $e,
|
|
1356
1613
|
onClick: (e) => q && e.stopPropagation(),
|
|
1357
|
-
className:
|
|
1614
|
+
className: k?.calendar,
|
|
1358
1615
|
style: {
|
|
1359
|
-
position:
|
|
1360
|
-
top:
|
|
1361
|
-
right:
|
|
1616
|
+
position: b === "popover" ? "absolute" : q ? "relative" : "static",
|
|
1617
|
+
top: b === "popover" ? "calc(100% + 4px)" : void 0,
|
|
1618
|
+
right: b === "popover" && v === "rtl" ? 0 : void 0,
|
|
1619
|
+
left: b === "popover" && v === "ltr" ? 0 : void 0,
|
|
1362
1620
|
zIndex: q ? 1001 : 50,
|
|
1363
1621
|
padding: "16px",
|
|
1364
|
-
backgroundColor:
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1622
|
+
backgroundColor: G.colors.background,
|
|
1623
|
+
color: G.colors.textPrimary,
|
|
1624
|
+
borderRadius: G.radii.lg,
|
|
1625
|
+
border: `1px solid ${G.colors.border}`,
|
|
1626
|
+
boxShadow: q ? "0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3)" : G.shadows.lg,
|
|
1368
1627
|
width: "fit-content",
|
|
1628
|
+
maxWidth: "calc(100vw - 16px)",
|
|
1629
|
+
boxSizing: "border-box",
|
|
1630
|
+
overflowX: "auto",
|
|
1369
1631
|
userSelect: "none",
|
|
1370
1632
|
display: "flex",
|
|
1371
1633
|
flexDirection: "column",
|
|
1372
1634
|
gap: "12px",
|
|
1373
|
-
...
|
|
1635
|
+
...A?.calendar
|
|
1374
1636
|
},
|
|
1375
1637
|
children: [q && /* @__PURE__ */ c("button", {
|
|
1376
1638
|
type: "button",
|
|
1377
1639
|
"aria-label": "بستن",
|
|
1378
|
-
onClick: () =>
|
|
1640
|
+
onClick: () => J(!1),
|
|
1641
|
+
className: k?.closeButton,
|
|
1379
1642
|
style: {
|
|
1380
1643
|
position: "absolute",
|
|
1381
1644
|
top: "10px",
|
|
1382
|
-
|
|
1645
|
+
insetInlineEnd: "10px",
|
|
1383
1646
|
background: "none",
|
|
1384
1647
|
border: "none",
|
|
1385
1648
|
cursor: "pointer",
|
|
1386
1649
|
fontSize: "16px",
|
|
1387
|
-
color:
|
|
1650
|
+
color: G.colors.textSecondary,
|
|
1388
1651
|
lineHeight: 1,
|
|
1389
|
-
zIndex: 10
|
|
1652
|
+
zIndex: 10,
|
|
1653
|
+
...A?.closeButton
|
|
1390
1654
|
},
|
|
1391
1655
|
children: "✕"
|
|
1392
1656
|
}), /* @__PURE__ */ c("div", {
|
|
1657
|
+
className: k?.calendarBody,
|
|
1393
1658
|
style: {
|
|
1394
1659
|
display: "flex",
|
|
1395
1660
|
flexDirection: "column",
|
|
1396
|
-
gap: "
|
|
1661
|
+
gap: "10px",
|
|
1662
|
+
...A?.calendarBody
|
|
1397
1663
|
},
|
|
1398
|
-
children:
|
|
1399
|
-
currentYear:
|
|
1400
|
-
currentMonth:
|
|
1664
|
+
children: De ? /* @__PURE__ */ c(se, {
|
|
1665
|
+
currentYear: Z,
|
|
1666
|
+
currentMonth: Q,
|
|
1401
1667
|
onSelectMonth: (e) => {
|
|
1402
|
-
|
|
1668
|
+
We(Z, e), Oe(!1);
|
|
1403
1669
|
},
|
|
1404
|
-
onSelectYear: (e) =>
|
|
1670
|
+
onSelectYear: (e) => We(e, Q),
|
|
1671
|
+
digitType: T,
|
|
1672
|
+
direction: v,
|
|
1673
|
+
classNames: k,
|
|
1674
|
+
styles: A
|
|
1405
1675
|
}) : /* @__PURE__ */ l(s, { children: [
|
|
1406
1676
|
/* @__PURE__ */ l("div", {
|
|
1677
|
+
dir: v,
|
|
1678
|
+
className: k?.calendarPanes,
|
|
1407
1679
|
style: {
|
|
1408
1680
|
display: "flex",
|
|
1409
1681
|
gap: "16px",
|
|
1410
|
-
alignItems: "flex-start"
|
|
1682
|
+
alignItems: "flex-start",
|
|
1683
|
+
flexWrap: "wrap",
|
|
1684
|
+
...A?.calendarPanes
|
|
1411
1685
|
},
|
|
1412
|
-
children: [
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1686
|
+
children: [it(Z, Q, Ve, !0, W === 1), W === 2 && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", {
|
|
1687
|
+
className: k?.paneDivider,
|
|
1688
|
+
style: {
|
|
1689
|
+
width: "1px",
|
|
1690
|
+
backgroundColor: G.colors.border,
|
|
1691
|
+
alignSelf: "stretch",
|
|
1692
|
+
...A?.paneDivider
|
|
1693
|
+
}
|
|
1694
|
+
}), it($.year, $.month, nt, !1, !0)] })]
|
|
1417
1695
|
}),
|
|
1418
|
-
|
|
1419
|
-
value:
|
|
1420
|
-
onChange:
|
|
1421
|
-
minuteStep:
|
|
1422
|
-
hourStep:
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1696
|
+
L && /* @__PURE__ */ c(fe, {
|
|
1697
|
+
value: Y,
|
|
1698
|
+
onChange: Xe,
|
|
1699
|
+
minuteStep: ne,
|
|
1700
|
+
hourStep: H,
|
|
1701
|
+
secondStep: le,
|
|
1702
|
+
showSeconds: U,
|
|
1703
|
+
digitType: T,
|
|
1704
|
+
direction: v,
|
|
1705
|
+
classNames: k,
|
|
1706
|
+
styles: A
|
|
1427
1707
|
}),
|
|
1428
|
-
|
|
1708
|
+
M && /* @__PURE__ */ c(de, {
|
|
1429
1709
|
mode: e,
|
|
1430
|
-
digitType:
|
|
1431
|
-
showStatusText:
|
|
1432
|
-
showActions:
|
|
1433
|
-
selectedDate: e === "single" ?
|
|
1434
|
-
selectedRange: e === "range" ?
|
|
1435
|
-
selectedDates: e === "multiple" ?
|
|
1436
|
-
selectedTime:
|
|
1437
|
-
|
|
1438
|
-
|
|
1710
|
+
digitType: T,
|
|
1711
|
+
showStatusText: N,
|
|
1712
|
+
showActions: F,
|
|
1713
|
+
selectedDate: e === "single" ? X : null,
|
|
1714
|
+
selectedRange: e === "range" ? X : void 0,
|
|
1715
|
+
selectedDates: e === "multiple" ? X : void 0,
|
|
1716
|
+
selectedTime: L ? Y : void 0,
|
|
1717
|
+
showSeconds: U,
|
|
1718
|
+
onToday: Ge,
|
|
1719
|
+
onClear: Ye,
|
|
1439
1720
|
onConfirm: () => {
|
|
1440
|
-
|
|
1721
|
+
b !== "inline" && J(!1), ee?.(Be(X));
|
|
1441
1722
|
},
|
|
1442
|
-
|
|
1443
|
-
|
|
1723
|
+
direction: v,
|
|
1724
|
+
classNames: k,
|
|
1725
|
+
styles: A
|
|
1444
1726
|
})
|
|
1445
1727
|
] })
|
|
1446
1728
|
})]
|
|
1447
1729
|
});
|
|
1448
1730
|
return /* @__PURE__ */ l("div", {
|
|
1449
|
-
ref:
|
|
1450
|
-
|
|
1731
|
+
ref: ke,
|
|
1732
|
+
dir: v,
|
|
1733
|
+
className: ae(E, k?.root),
|
|
1451
1734
|
style: {
|
|
1735
|
+
"--pdp-cell-size": "36px",
|
|
1736
|
+
"--pdp-cell-gap": "4px",
|
|
1737
|
+
"--pdp-calendar-pane-width": "276px",
|
|
1452
1738
|
position: "relative",
|
|
1453
1739
|
display: "inline-block",
|
|
1454
|
-
|
|
1455
|
-
|
|
1740
|
+
color: G.colors.textPrimary,
|
|
1741
|
+
fontFamily: "inherit",
|
|
1742
|
+
...D,
|
|
1743
|
+
...A?.root
|
|
1456
1744
|
},
|
|
1457
|
-
children: [
|
|
1458
|
-
value:
|
|
1459
|
-
digitType:
|
|
1460
|
-
placeholder:
|
|
1745
|
+
children: [b !== "inline" && (he && e === "single" && b === "popover" ? /* @__PURE__ */ c(pe, {
|
|
1746
|
+
value: Ze,
|
|
1747
|
+
digitType: T,
|
|
1748
|
+
placeholder: w,
|
|
1461
1749
|
onChange: (e) => {
|
|
1462
|
-
e ? (
|
|
1750
|
+
e ? (Ke(e), We(e.year, e.month)) : Ye();
|
|
1463
1751
|
},
|
|
1464
|
-
onClick: () =>
|
|
1465
|
-
|
|
1466
|
-
|
|
1752
|
+
onClick: () => J(!0),
|
|
1753
|
+
direction: v,
|
|
1754
|
+
minDate: Ne,
|
|
1755
|
+
maxDate: Pe,
|
|
1756
|
+
isDateDisabled: h ? ze : void 0,
|
|
1757
|
+
wrapperClassName: k?.inputWrapper,
|
|
1758
|
+
wrapperStyle: A?.inputWrapper,
|
|
1759
|
+
clearButtonClassName: k?.inputClearButton,
|
|
1760
|
+
clearButtonStyle: A?.inputClearButton,
|
|
1761
|
+
className: k?.input,
|
|
1762
|
+
style: A?.input
|
|
1467
1763
|
}) : /* @__PURE__ */ c("input", {
|
|
1468
1764
|
type: "text",
|
|
1469
1765
|
readOnly: !0,
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1766
|
+
"aria-haspopup": "dialog",
|
|
1767
|
+
"aria-expanded": K,
|
|
1768
|
+
placeholder: w,
|
|
1769
|
+
value: rt,
|
|
1770
|
+
onClick: () => J(!0),
|
|
1771
|
+
className: k?.input,
|
|
1474
1772
|
style: {
|
|
1773
|
+
width: L ? "230px" : W === 2 ? "260px" : "190px",
|
|
1774
|
+
minHeight: "40px",
|
|
1775
|
+
boxSizing: "border-box",
|
|
1475
1776
|
padding: "8px 12px",
|
|
1476
|
-
borderRadius:
|
|
1477
|
-
border:
|
|
1478
|
-
|
|
1479
|
-
|
|
1777
|
+
borderRadius: G.radii.sm,
|
|
1778
|
+
border: `1px solid ${G.colors.border}`,
|
|
1779
|
+
outlineColor: G.colors.primary,
|
|
1780
|
+
backgroundColor: G.colors.background,
|
|
1781
|
+
color: G.colors.textPrimary,
|
|
1480
1782
|
cursor: "pointer",
|
|
1481
|
-
textAlign: "right",
|
|
1482
|
-
direction:
|
|
1783
|
+
textAlign: v === "rtl" ? "right" : "left",
|
|
1784
|
+
direction: v,
|
|
1785
|
+
fontFamily: "inherit",
|
|
1483
1786
|
fontSize: "14px",
|
|
1484
|
-
|
|
1485
|
-
...D?.input
|
|
1787
|
+
...A?.input
|
|
1486
1788
|
}
|
|
1487
|
-
})),
|
|
1789
|
+
})), K && (q ? /* @__PURE__ */ c("div", {
|
|
1488
1790
|
role: "presentation",
|
|
1489
|
-
onClick: () =>
|
|
1490
|
-
|
|
1791
|
+
onClick: () => {
|
|
1792
|
+
Se && J(!1);
|
|
1793
|
+
},
|
|
1794
|
+
className: k?.modalBackdrop,
|
|
1491
1795
|
style: {
|
|
1492
1796
|
position: "fixed",
|
|
1493
1797
|
top: 0,
|
|
1494
1798
|
left: 0,
|
|
1495
1799
|
right: 0,
|
|
1496
1800
|
bottom: 0,
|
|
1497
|
-
backgroundColor: "rgba(15, 23, 42, 0.
|
|
1801
|
+
backgroundColor: "rgba(15, 23, 42, 0.64)",
|
|
1498
1802
|
backdropFilter: "blur(4px)",
|
|
1499
1803
|
zIndex: 1e3,
|
|
1500
1804
|
display: "flex",
|
|
1501
1805
|
alignItems: "center",
|
|
1502
1806
|
justifyContent: "center",
|
|
1503
1807
|
padding: "16px",
|
|
1504
|
-
direction:
|
|
1505
|
-
...
|
|
1808
|
+
direction: v,
|
|
1809
|
+
...A?.modalBackdrop
|
|
1506
1810
|
},
|
|
1507
|
-
children:
|
|
1508
|
-
}) :
|
|
1811
|
+
children: at
|
|
1812
|
+
}) : at)]
|
|
1509
1813
|
});
|
|
1510
1814
|
}
|
|
1511
1815
|
//#endregion
|
|
1512
1816
|
//#region src/components/dual-calendar/DualMonthCalendar.tsx
|
|
1513
|
-
var
|
|
1514
|
-
let [
|
|
1515
|
-
year:
|
|
1516
|
-
month:
|
|
1817
|
+
var xe = ({ value: e, defaultValue: n = [null, null], onChange: r, initialViewDate: a, firstDayOfWeek: s = 0, digitType: d = "persian", minDate: f, maxDate: p, isDateDisabled: m, direction: h = "rtl", className: g, style: _, classNames: b, styles: S }) => {
|
|
1818
|
+
let { theme: C } = V(), [w, T] = o(n), E = e === void 0 ? w : e, [k, A] = o(null), j = (e) => d === "persian" ? I(e) : String(e), M = i(() => v(), []), [N, P] = o(() => a || (E[0] ? {
|
|
1819
|
+
year: E[0].year,
|
|
1820
|
+
month: E[0].month
|
|
1517
1821
|
} : {
|
|
1518
|
-
year:
|
|
1519
|
-
month:
|
|
1520
|
-
})),
|
|
1521
|
-
year:
|
|
1822
|
+
year: M.year,
|
|
1823
|
+
month: M.month
|
|
1824
|
+
})), F = i(() => N.month === 11 ? {
|
|
1825
|
+
year: N.year + 1,
|
|
1522
1826
|
month: 0
|
|
1523
1827
|
} : {
|
|
1524
|
-
year:
|
|
1525
|
-
month:
|
|
1526
|
-
}, [
|
|
1527
|
-
|
|
1828
|
+
year: N.year,
|
|
1829
|
+
month: N.month + 1
|
|
1830
|
+
}, [N]), ee = () => {
|
|
1831
|
+
P((e) => e.month === 0 ? {
|
|
1528
1832
|
year: e.year - 1,
|
|
1529
1833
|
month: 11
|
|
1530
1834
|
} : {
|
|
1531
1835
|
year: e.year,
|
|
1532
1836
|
month: e.month - 1
|
|
1533
1837
|
});
|
|
1534
|
-
},
|
|
1535
|
-
|
|
1838
|
+
}, L = () => {
|
|
1839
|
+
P((e) => e.month === 11 ? {
|
|
1536
1840
|
year: e.year + 1,
|
|
1537
1841
|
month: 0
|
|
1538
1842
|
} : {
|
|
1539
1843
|
year: e.year,
|
|
1540
1844
|
month: e.month + 1
|
|
1541
1845
|
});
|
|
1542
|
-
},
|
|
1543
|
-
let [n, i] =
|
|
1544
|
-
!n || n && i ? a = [t, null] : (a = D(t, n) < 0 ? [t, n] : [n, t],
|
|
1846
|
+
}, R = t((t) => {
|
|
1847
|
+
let [n, i] = E, a;
|
|
1848
|
+
!n || n && i ? a = [t, null] : (a = D(t, n) < 0 ? [t, n] : [n, t], A(null)), e === void 0 && T(a), r?.(a);
|
|
1545
1849
|
}, [
|
|
1546
|
-
|
|
1850
|
+
E,
|
|
1547
1851
|
e,
|
|
1548
1852
|
r
|
|
1549
|
-
]),
|
|
1853
|
+
]), z = t((e, t) => {
|
|
1550
1854
|
let n = x({
|
|
1551
1855
|
year: e,
|
|
1552
1856
|
month: t,
|
|
@@ -1554,7 +1858,7 @@ var ge = ({ value: e, defaultValue: n = [null, null], onChange: r, initialViewDa
|
|
|
1554
1858
|
minDate: f,
|
|
1555
1859
|
maxDate: p,
|
|
1556
1860
|
isDateDisabled: m
|
|
1557
|
-
}), [r, i] =
|
|
1861
|
+
}), [r, i] = E, a = i ?? (r && k ? k : null);
|
|
1558
1862
|
return n.map((e) => {
|
|
1559
1863
|
let t = r ? y(e.jalali, r) : !1, n = a ? y(e.jalali, a) : !1, i = !1;
|
|
1560
1864
|
return r && a && (i = O(e.jalali, r, a)), {
|
|
@@ -1570,122 +1874,154 @@ var ge = ({ value: e, defaultValue: n = [null, null], onChange: r, initialViewDa
|
|
|
1570
1874
|
f,
|
|
1571
1875
|
p,
|
|
1572
1876
|
m,
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
]),
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
]),
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
]),
|
|
1877
|
+
E,
|
|
1878
|
+
k
|
|
1879
|
+
]), te = i(() => z(N.year, N.month), [
|
|
1880
|
+
z,
|
|
1881
|
+
N.year,
|
|
1882
|
+
N.month
|
|
1883
|
+
]), B = i(() => z(F.year, F.month), [
|
|
1884
|
+
z,
|
|
1885
|
+
F.year,
|
|
1886
|
+
F.month
|
|
1887
|
+
]), ne = (e, t, n, r) => /* @__PURE__ */ l("div", {
|
|
1888
|
+
dir: h,
|
|
1889
|
+
className: b?.calendarPane,
|
|
1584
1890
|
style: {
|
|
1585
1891
|
display: "flex",
|
|
1586
1892
|
flexDirection: "column",
|
|
1587
1893
|
gap: "8px",
|
|
1588
|
-
|
|
1894
|
+
width: "var(--pdp-calendar-pane-width, 276px)",
|
|
1895
|
+
minWidth: "var(--pdp-calendar-pane-width, 276px)",
|
|
1896
|
+
...S?.calendarPane
|
|
1589
1897
|
},
|
|
1590
1898
|
children: [
|
|
1591
1899
|
/* @__PURE__ */ l("div", {
|
|
1900
|
+
className: b?.header,
|
|
1592
1901
|
style: {
|
|
1593
1902
|
display: "flex",
|
|
1594
1903
|
alignItems: "center",
|
|
1595
1904
|
justifyContent: "space-between",
|
|
1596
1905
|
padding: "0 4px",
|
|
1597
|
-
height: "32px"
|
|
1906
|
+
height: "32px",
|
|
1907
|
+
...S?.header
|
|
1598
1908
|
},
|
|
1599
1909
|
children: [
|
|
1600
1910
|
r ? /* @__PURE__ */ c("button", {
|
|
1601
1911
|
type: "button",
|
|
1602
1912
|
"aria-label": "ماه قبل",
|
|
1603
|
-
onClick:
|
|
1913
|
+
onClick: ee,
|
|
1914
|
+
className: b?.navButton,
|
|
1604
1915
|
style: {
|
|
1605
1916
|
width: "28px",
|
|
1606
1917
|
height: "28px",
|
|
1607
1918
|
borderRadius: "6px",
|
|
1608
|
-
border:
|
|
1609
|
-
backgroundColor:
|
|
1610
|
-
color:
|
|
1611
|
-
cursor: "pointer"
|
|
1919
|
+
border: `1px solid ${C.colors.border}`,
|
|
1920
|
+
backgroundColor: C.colors.background,
|
|
1921
|
+
color: C.colors.textPrimary,
|
|
1922
|
+
cursor: "pointer",
|
|
1923
|
+
...S?.navButton
|
|
1612
1924
|
},
|
|
1613
|
-
children: "›"
|
|
1925
|
+
children: h === "rtl" ? "›" : "‹"
|
|
1614
1926
|
}) : /* @__PURE__ */ c("div", { style: { width: "28px" } }),
|
|
1615
1927
|
/* @__PURE__ */ l("div", {
|
|
1616
1928
|
style: {
|
|
1617
1929
|
fontWeight: 600,
|
|
1618
1930
|
fontSize: "14px",
|
|
1619
|
-
color:
|
|
1931
|
+
color: C.colors.textPrimary
|
|
1620
1932
|
},
|
|
1621
1933
|
children: [
|
|
1622
1934
|
u[t],
|
|
1623
1935
|
" ",
|
|
1624
|
-
|
|
1936
|
+
j(e)
|
|
1625
1937
|
]
|
|
1626
1938
|
}),
|
|
1627
1939
|
r ? /* @__PURE__ */ c("div", { style: { width: "28px" } }) : /* @__PURE__ */ c("button", {
|
|
1628
1940
|
type: "button",
|
|
1629
1941
|
"aria-label": "ماه بعد",
|
|
1630
|
-
onClick:
|
|
1942
|
+
onClick: L,
|
|
1943
|
+
className: b?.navButton,
|
|
1631
1944
|
style: {
|
|
1632
1945
|
width: "28px",
|
|
1633
1946
|
height: "28px",
|
|
1634
1947
|
borderRadius: "6px",
|
|
1635
|
-
border:
|
|
1636
|
-
backgroundColor:
|
|
1637
|
-
color:
|
|
1638
|
-
cursor: "pointer"
|
|
1948
|
+
border: `1px solid ${C.colors.border}`,
|
|
1949
|
+
backgroundColor: C.colors.background,
|
|
1950
|
+
color: C.colors.textPrimary,
|
|
1951
|
+
cursor: "pointer",
|
|
1952
|
+
...S?.navButton
|
|
1639
1953
|
},
|
|
1640
|
-
children: "‹"
|
|
1954
|
+
children: h === "rtl" ? "‹" : "›"
|
|
1641
1955
|
})
|
|
1642
1956
|
]
|
|
1643
1957
|
}),
|
|
1644
|
-
/* @__PURE__ */ c(ie, {
|
|
1958
|
+
/* @__PURE__ */ c(ie, {
|
|
1959
|
+
firstDayOfWeek: s,
|
|
1960
|
+
direction: h,
|
|
1961
|
+
classNames: b,
|
|
1962
|
+
styles: S
|
|
1963
|
+
}),
|
|
1645
1964
|
/* @__PURE__ */ c("div", {
|
|
1646
1965
|
role: "grid",
|
|
1647
|
-
"aria-label": `${u[t]} ${
|
|
1966
|
+
"aria-label": `${u[t]} ${j(e)}`,
|
|
1967
|
+
dir: h,
|
|
1968
|
+
className: b?.grid,
|
|
1648
1969
|
style: {
|
|
1649
1970
|
display: "grid",
|
|
1971
|
+
width: "var(--pdp-calendar-pane-width, 276px)",
|
|
1650
1972
|
gridTemplateColumns: "repeat(7, var(--pdp-cell-size, 36px))",
|
|
1651
|
-
gap: "4px"
|
|
1973
|
+
gap: "var(--pdp-cell-gap, 4px)",
|
|
1974
|
+
...S?.grid
|
|
1652
1975
|
},
|
|
1653
|
-
children: n.map((e
|
|
1976
|
+
children: n.map((e) => /* @__PURE__ */ c(oe, {
|
|
1654
1977
|
cell: e,
|
|
1655
1978
|
digitType: d,
|
|
1979
|
+
classNames: b,
|
|
1980
|
+
styles: S,
|
|
1656
1981
|
tabIndex: 0,
|
|
1657
|
-
onSelect:
|
|
1658
|
-
onHover:
|
|
1659
|
-
},
|
|
1982
|
+
onSelect: R,
|
|
1983
|
+
onHover: A
|
|
1984
|
+
}, `${e.jalali.year}-${e.jalali.month}-${e.jalali.day}`))
|
|
1660
1985
|
})
|
|
1661
1986
|
]
|
|
1662
1987
|
});
|
|
1663
1988
|
return /* @__PURE__ */ l("div", {
|
|
1664
1989
|
role: "region",
|
|
1665
1990
|
"aria-label": "تقویم دوقلو شمسی",
|
|
1991
|
+
dir: h,
|
|
1992
|
+
className: ae(g, b?.calendar),
|
|
1666
1993
|
style: {
|
|
1994
|
+
"--pdp-cell-size": "36px",
|
|
1995
|
+
"--pdp-cell-gap": "4px",
|
|
1996
|
+
"--pdp-calendar-pane-width": "276px",
|
|
1667
1997
|
display: "flex",
|
|
1668
1998
|
flexWrap: "wrap",
|
|
1669
1999
|
gap: "24px",
|
|
1670
2000
|
padding: "16px",
|
|
1671
|
-
backgroundColor:
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
2001
|
+
backgroundColor: C.colors.background,
|
|
2002
|
+
color: C.colors.textPrimary,
|
|
2003
|
+
borderRadius: C.radii.lg,
|
|
2004
|
+
border: `1px solid ${C.colors.border}`,
|
|
2005
|
+
boxShadow: C.shadows.lg,
|
|
1675
2006
|
width: "fit-content",
|
|
1676
|
-
|
|
2007
|
+
..._,
|
|
2008
|
+
...S?.calendar
|
|
1677
2009
|
},
|
|
1678
2010
|
children: [
|
|
1679
|
-
N
|
|
1680
|
-
/* @__PURE__ */ c("div", {
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
2011
|
+
ne(N.year, N.month, te, !0),
|
|
2012
|
+
/* @__PURE__ */ c("div", {
|
|
2013
|
+
className: b?.paneDivider,
|
|
2014
|
+
style: {
|
|
2015
|
+
width: "1px",
|
|
2016
|
+
backgroundColor: C.colors.border,
|
|
2017
|
+
...S?.paneDivider
|
|
2018
|
+
}
|
|
2019
|
+
}),
|
|
2020
|
+
ne(F.year, F.month, B, !1)
|
|
1685
2021
|
]
|
|
1686
2022
|
});
|
|
1687
2023
|
};
|
|
1688
2024
|
//#endregion
|
|
1689
|
-
export {
|
|
2025
|
+
export { ne as DatePickerThemeProvider, oe as DayCell, xe as DualMonthCalendar, re as Header, d as JALALI_MONTH_NAMES_EN, be as JalaliDatePicker, pe as MaskedDateInput, se as MonthYearPicker, u as PERSIAN_MONTH_NAMES, p as PERSIAN_WEEK_DAYS_LONG, f as PERSIAN_WEEK_DAYS_SHORT, fe as TimePicker, ie as Weekdays, T as addDaysToJalali, E as addJalaliDays, U as applyDateMask, M as calculateNextFocusedDate, le as clampTime, D as compareJalaliDates, te as darkTheme, R as formatJalaliDate, H as formatTimeSegment, ue as formatTimeString, x as generateJalaliCalendarGrid, N as getAriaDayLabel, ce as getCurrentTime, h as getDaysInJalaliMonth, me as getEventsForDate, w as getJalaliDayOfWeek, A as getJalaliMonthRange, k as getJalaliWeekRange, v as getTodayJalali, g as gregorianToJalali, O as isJalaliDateBetween, m as isJalaliLeapYear, y as isSameJalaliDay, _ as jalaliToGregorian, C as jalaliToJsDate, S as jsDateToJalali, z as lightTheme, W as parseAndValidateJalaliString, b as toJalaliDate, L as toLatinDigits, I as toPersianDigits, P as useCalendarKeyboard, j as useJalaliDatePicker, V as useTheme };
|
|
1690
2026
|
|
|
1691
2027
|
//# sourceMappingURL=index.mjs.map
|