@deepnoid/ui 0.1.156 → 0.1.158
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/.turbo/turbo-build.log +198 -188
- package/dist/{chunk-6YTT5ACI.mjs → chunk-3QE57PU3.mjs} +1 -1
- package/dist/{chunk-KKHOCWXJ.mjs → chunk-3X376ACN.mjs} +1 -1
- package/dist/{chunk-URJA4W4R.mjs → chunk-46EIW6MN.mjs} +2 -2
- package/dist/chunk-7YMXOYES.mjs +449 -0
- package/dist/{chunk-2DAIOZ7N.mjs → chunk-CSG6FDBX.mjs} +2 -2
- package/dist/{chunk-WHU5VP5G.mjs → chunk-DDFJMHBC.mjs} +57 -2
- package/dist/{chunk-ZY3HNPPG.mjs → chunk-HKHVSCER.mjs} +1 -1
- package/dist/{chunk-ZNQML73F.mjs → chunk-IRJP6BF3.mjs} +2 -2
- package/dist/{chunk-HP4ARKW3.mjs → chunk-ITFEV25U.mjs} +1 -1
- package/dist/{chunk-7RG7CQQM.mjs → chunk-JKYLYL3A.mjs} +1 -1
- package/dist/{chunk-KX6WG4VG.mjs → chunk-KLBA5J2H.mjs} +1 -1
- package/dist/chunk-L5FRTUM6.mjs +100 -0
- package/dist/chunk-OLQOLLKG.mjs +1 -0
- package/dist/{chunk-LFALITPU.mjs → chunk-PXAJEOZS.mjs} +1 -1
- package/dist/{chunk-5VVNAW4E.mjs → chunk-QHETCLHO.mjs} +2 -2
- package/dist/{chunk-Q2YLULZH.mjs → chunk-R7KUEH3N.mjs} +1 -1
- package/dist/{chunk-47MQPUEY.mjs → chunk-SFGFRMWL.mjs} +1 -1
- package/dist/{chunk-4YVZ3XKA.mjs → chunk-V64PCWVW.mjs} +3 -3
- package/dist/{chunk-R2USZD77.mjs → chunk-XHCPYYMC.mjs} +1 -1
- package/dist/{chunk-UIRHCS6B.mjs → chunk-YQYO5RLZ.mjs} +1 -1
- package/dist/{chunk-ZGUTKE5H.mjs → chunk-Z7CLJYRF.mjs} +1 -1
- package/dist/components/avatar/avatar.js +57 -2
- package/dist/components/avatar/avatar.mjs +2 -2
- package/dist/components/avatar/index.js +57 -2
- package/dist/components/avatar/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +57 -2
- package/dist/components/breadcrumb/breadcrumb.mjs +5 -5
- package/dist/components/breadcrumb/index.js +57 -2
- package/dist/components/breadcrumb/index.mjs +5 -5
- package/dist/components/button/button.js +57 -2
- package/dist/components/button/button.mjs +3 -3
- package/dist/components/button/icon-button.js +57 -2
- package/dist/components/button/icon-button.mjs +3 -3
- package/dist/components/button/index.js +57 -2
- package/dist/components/button/index.mjs +4 -4
- package/dist/components/chip/chip.js +57 -2
- package/dist/components/chip/chip.mjs +3 -3
- package/dist/components/chip/index.js +57 -2
- package/dist/components/chip/index.mjs +3 -3
- package/dist/components/fileUpload/fileUpload.js +57 -2
- package/dist/components/fileUpload/fileUpload.mjs +6 -6
- package/dist/components/fileUpload/index.js +57 -2
- package/dist/components/fileUpload/index.mjs +6 -6
- package/dist/components/icon/Icon.d.mts +8 -0
- package/dist/components/icon/Icon.d.ts +8 -0
- package/dist/components/icon/Icon.js +57 -2
- package/dist/components/icon/Icon.mjs +2 -2
- package/dist/components/icon/index.js +57 -2
- package/dist/components/icon/index.mjs +2 -2
- package/dist/components/icon/template.d.mts +2 -0
- package/dist/components/icon/template.d.ts +2 -0
- package/dist/components/icon/template.js +57 -2
- package/dist/components/icon/template.mjs +1 -1
- package/dist/components/input/index.js +57 -2
- package/dist/components/input/index.mjs +3 -3
- package/dist/components/input/input.js +57 -2
- package/dist/components/input/input.mjs +3 -3
- package/dist/components/list/index.js +57 -2
- package/dist/components/list/index.mjs +4 -4
- package/dist/components/list/listItem.js +57 -2
- package/dist/components/list/listItem.mjs +4 -4
- package/dist/components/modal/index.js +57 -2
- package/dist/components/modal/index.mjs +5 -5
- package/dist/components/modal/modal.js +57 -2
- package/dist/components/modal/modal.mjs +5 -5
- package/dist/components/pagination/index.js +57 -2
- package/dist/components/pagination/index.mjs +4 -4
- package/dist/components/pagination/pagination.js +57 -2
- package/dist/components/pagination/pagination.mjs +4 -4
- package/dist/components/picker/datePicker.d.mts +35 -4
- package/dist/components/picker/datePicker.d.ts +35 -4
- package/dist/components/picker/datePicker.js +238 -49
- package/dist/components/picker/datePicker.mjs +6 -6
- package/dist/components/picker/day.d.mts +2 -2
- package/dist/components/picker/day.d.ts +2 -2
- package/dist/components/picker/index.d.mts +1 -1
- package/dist/components/picker/index.d.ts +1 -1
- package/dist/components/picker/index.js +238 -49
- package/dist/components/picker/index.mjs +8 -8
- package/dist/components/picker/timePicker.js +57 -2
- package/dist/components/picker/timePicker.mjs +4 -4
- package/dist/components/radio/index.d.mts +1 -1
- package/dist/components/radio/index.d.ts +1 -1
- package/dist/components/select/index.js +57 -2
- package/dist/components/select/index.mjs +3 -3
- package/dist/components/select/select.js +57 -2
- package/dist/components/select/select.mjs +3 -3
- package/dist/components/starRating/index.d.mts +4 -0
- package/dist/components/starRating/index.d.ts +4 -0
- package/dist/components/starRating/index.js +5279 -0
- package/dist/components/starRating/index.mjs +14 -0
- package/dist/components/starRating/starRating.d.mts +60 -0
- package/dist/components/starRating/starRating.d.ts +60 -0
- package/dist/components/starRating/starRating.js +5278 -0
- package/dist/components/starRating/starRating.mjs +15 -0
- package/dist/components/table/index.js +57 -2
- package/dist/components/table/index.mjs +7 -7
- package/dist/components/table/table-body.js +57 -2
- package/dist/components/table/table-body.mjs +5 -5
- package/dist/components/table/table-head.js +57 -2
- package/dist/components/table/table-head.mjs +5 -5
- package/dist/components/table/table.js +57 -2
- package/dist/components/table/table.mjs +5 -5
- package/dist/components/timePicker/calendar.js +57 -2
- package/dist/components/timePicker/calendar.mjs +2 -2
- package/dist/components/toast/index.js +57 -2
- package/dist/components/toast/index.mjs +4 -4
- package/dist/components/toast/toast.js +57 -2
- package/dist/components/toast/toast.mjs +3 -3
- package/dist/components/toast/use-toast.js +57 -2
- package/dist/components/toast/use-toast.mjs +4 -4
- package/dist/components/tree/index.js +57 -2
- package/dist/components/tree/index.mjs +3 -3
- package/dist/components/tree/tree.js +57 -2
- package/dist/components/tree/tree.mjs +3 -3
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +325 -49
- package/dist/index.mjs +37 -32
- package/package.json +1 -1
- package/dist/chunk-TCURFCQ2.mjs +0 -315
|
@@ -459,8 +459,8 @@ var template = {
|
|
|
459
459
|
{
|
|
460
460
|
fillRule: "evenodd",
|
|
461
461
|
clipRule: "evenodd",
|
|
462
|
-
|
|
463
|
-
|
|
462
|
+
d: "M8.26603 3.51086C8.53733 2.82971 9.46267 2.82971 9.73397 3.51086L10.9948 6.67687L14.2674 6.95135C14.9723 7.01017 15.2582 7.92848 14.721 8.40913L12.2278 10.6398L12.989 13.9746C13.1531 14.6931 12.4052 15.2604 11.8021 14.8759L9 13.0886L6.19794 14.8759C5.59478 15.2604 4.84687 14.6925 5.01099 13.9746L5.77221 10.6398L3.27901 8.40913C2.74185 7.92848 3.02769 7.01017 3.73259 6.95135L7.00519 6.67687L8.26603 3.51086Z",
|
|
463
|
+
fill: "currentColor"
|
|
464
464
|
}
|
|
465
465
|
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
466
466
|
"path",
|
|
@@ -474,6 +474,41 @@ var template = {
|
|
|
474
474
|
}
|
|
475
475
|
);
|
|
476
476
|
},
|
|
477
|
+
halfStar: ({ className }) => {
|
|
478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
479
|
+
"svg",
|
|
480
|
+
{
|
|
481
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
482
|
+
width: "18",
|
|
483
|
+
height: "18",
|
|
484
|
+
viewBox: "0 0 18 18",
|
|
485
|
+
fill: "none",
|
|
486
|
+
className,
|
|
487
|
+
children: [
|
|
488
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("clipPath", { id: "half-clip", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "0", y: "0", width: "9", height: "18" }) }) }),
|
|
489
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
490
|
+
"path",
|
|
491
|
+
{
|
|
492
|
+
fillRule: "evenodd",
|
|
493
|
+
clipRule: "evenodd",
|
|
494
|
+
fill: "currentColor",
|
|
495
|
+
d: "M8.26603 3.51086C8.53733 2.82971 9.46267 2.82971 9.73397 3.51086L10.9948 6.67687L14.2674 6.95135C14.9723 7.01017 15.2582 7.92848 14.721 8.40913L12.2278 10.6398L12.989 13.9746C13.1531 14.6931 12.4052 15.2604 11.8021 14.8759L9 13.0886L6.19794 14.8759C5.59478 15.2604 4.84687 14.6925 5.01099 13.9746L5.77221 10.6398L3.27901 8.40913C2.74185 7.92848 3.02769 7.01017 3.73259 6.95135L7.00519 6.67687L8.26603 3.51086Z",
|
|
496
|
+
clipPath: "url(#half-clip)"
|
|
497
|
+
}
|
|
498
|
+
),
|
|
499
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
500
|
+
"path",
|
|
501
|
+
{
|
|
502
|
+
d: "M8.65925 3.23957C8.68697 3.16871 8.73417 3.1081 8.79484 3.06544C8.85552 3.02278 8.92693 3 9 3C9.07306 3 9.14448 3.02278 9.20515 3.06544C9.26583 3.1081 9.31303 3.16871 9.34074 3.23957L10.7332 6.74977C10.7593 6.81546 10.8021 6.87233 10.857 6.91413C10.912 6.95594 10.9768 6.98105 11.0445 6.98672L14.6603 7.29028C14.9873 7.31775 15.1196 7.74563 14.8706 7.96883L12.1158 10.4427C12.0644 10.4888 12.026 10.5489 12.005 10.6164C11.984 10.6839 11.981 10.7561 11.9966 10.8252L12.8386 14.5236C12.8555 14.5978 12.8511 14.6756 12.8259 14.7471C12.8006 14.8187 12.7557 14.8808 12.6968 14.9257C12.6379 14.9705 12.5677 14.996 12.495 14.999C12.4222 15.002 12.3503 14.9824 12.2882 14.9425L9.19199 12.9611C9.13418 12.9241 9.06775 12.9045 9 12.9045C8.93225 12.9045 8.86581 12.9241 8.808 12.9611L5.71181 14.9432C5.64973 14.9831 5.57778 15.0027 5.50504 14.9997C5.43231 14.9967 5.36206 14.9712 5.30316 14.9263C5.24426 14.8815 5.19936 14.8194 5.17412 14.7478C5.14889 14.6763 5.14445 14.5985 5.16138 14.5243L6.00341 10.8252C6.01903 10.7561 6.01616 10.6838 5.99511 10.6164C5.97407 10.5489 5.93568 10.4888 5.88415 10.4427L3.12936 7.96883C3.07389 7.91927 3.03369 7.85357 3.01387 7.78005C2.99405 7.70652 2.9955 7.62849 3.01802 7.55583C3.04055 7.48317 3.08314 7.41915 3.1404 7.37188C3.19767 7.3246 3.26703 7.29621 3.33971 7.29028L6.95553 6.98672C7.02319 6.98105 7.08804 6.95594 7.14296 6.91413C7.19787 6.87233 7.24072 6.81546 7.26679 6.74977L8.65925 3.23957Z",
|
|
503
|
+
stroke: "currentColor",
|
|
504
|
+
strokeLinecap: "round",
|
|
505
|
+
strokeLinejoin: "round"
|
|
506
|
+
}
|
|
507
|
+
)
|
|
508
|
+
]
|
|
509
|
+
}
|
|
510
|
+
);
|
|
511
|
+
},
|
|
477
512
|
avatar: ({ className }) => {
|
|
478
513
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
479
514
|
"svg",
|
|
@@ -1899,6 +1934,26 @@ var template = {
|
|
|
1899
1934
|
}
|
|
1900
1935
|
);
|
|
1901
1936
|
},
|
|
1937
|
+
question: ({ className = "text-white" }) => {
|
|
1938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1939
|
+
"svg",
|
|
1940
|
+
{
|
|
1941
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1942
|
+
width: "24",
|
|
1943
|
+
height: "24",
|
|
1944
|
+
viewBox: "0 0 24 24",
|
|
1945
|
+
fill: "none",
|
|
1946
|
+
className,
|
|
1947
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1948
|
+
"path",
|
|
1949
|
+
{
|
|
1950
|
+
d: "M17 2.42969H7C4 2.42969 2 4.42969 2 7.42969V13.4297C2 16.4297 4 18.4297 7 18.4297V20.5597C7 21.3597 7.89 21.8397 8.55 21.3897L13 18.4297H17C20 18.4297 22 16.4297 22 13.4297V7.42969C22 4.42969 20 2.42969 17 2.42969ZM12 14.5997C11.58 14.5997 11.25 14.2597 11.25 13.8497C11.25 13.4397 11.58 13.0997 12 13.0997C12.42 13.0997 12.75 13.4397 12.75 13.8497C12.75 14.2597 12.42 14.5997 12 14.5997ZM13.26 10.4497C12.87 10.7097 12.75 10.8797 12.75 11.1597V11.3697C12.75 11.7797 12.41 12.1197 12 12.1197C11.59 12.1197 11.25 11.7797 11.25 11.3697V11.1597C11.25 9.99969 12.1 9.42969 12.42 9.20969C12.79 8.95969 12.91 8.78969 12.91 8.52969C12.91 8.02969 12.5 7.61969 12 7.61969C11.5 7.61969 11.09 8.02969 11.09 8.52969C11.09 8.93969 10.75 9.27969 10.34 9.27969C9.93 9.27969 9.59 8.93969 9.59 8.52969C9.59 7.19969 10.67 6.11969 12 6.11969C13.33 6.11969 14.41 7.19969 14.41 8.52969C14.41 9.66969 13.57 10.2397 13.26 10.4497Z",
|
|
1951
|
+
fill: "currentColor"
|
|
1952
|
+
}
|
|
1953
|
+
)
|
|
1954
|
+
}
|
|
1955
|
+
);
|
|
1956
|
+
},
|
|
1902
1957
|
// ----------------------------------- old ---------------------------------
|
|
1903
1958
|
// ** Status **
|
|
1904
1959
|
"plus-circle": ({ className, fill }) => {
|
|
@@ -6653,12 +6708,25 @@ var DatePicker = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
6653
6708
|
todayTitle,
|
|
6654
6709
|
cancelTitle,
|
|
6655
6710
|
confirmTitle,
|
|
6711
|
+
range = false,
|
|
6712
|
+
dualCalendar = false,
|
|
6656
6713
|
...inputProps
|
|
6657
6714
|
} = { ...props, ...variantProps };
|
|
6658
|
-
const [selectedDate, setSelectedDate] = (0, import_react7.useState)(value || "");
|
|
6659
|
-
const [
|
|
6715
|
+
const [selectedDate, setSelectedDate] = (0, import_react7.useState)(range ? "" : typeof value === "string" ? value || "" : "");
|
|
6716
|
+
const [selectedRange, setSelectedRange] = (0, import_react7.useState)({
|
|
6717
|
+
startDate: range && typeof value === "object" ? (value == null ? void 0 : value.startDate) || "" : "",
|
|
6718
|
+
endDate: range && typeof value === "object" ? (value == null ? void 0 : value.endDate) || "" : ""
|
|
6719
|
+
});
|
|
6720
|
+
const [tempSelectedDate, setTempSelectedDate] = (0, import_react7.useState)(selectedDate);
|
|
6721
|
+
const [tempSelectedRange, setTempSelectedRange] = (0, import_react7.useState)(selectedRange);
|
|
6722
|
+
const [rangeSelection, setRangeSelection] = (0, import_react7.useState)("start");
|
|
6660
6723
|
const [isPanelOpen, setIsPanelOpen] = (0, import_react7.useState)(false);
|
|
6661
|
-
const [
|
|
6724
|
+
const [leftCurrentDate, setLeftCurrentDate] = (0, import_react7.useState)(
|
|
6725
|
+
range && tempSelectedRange.startDate ? new Date(tempSelectedRange.startDate) : tempSelectedDate ? new Date(tempSelectedDate) : /* @__PURE__ */ new Date()
|
|
6726
|
+
);
|
|
6727
|
+
const [rightCurrentDate, setRightCurrentDate] = (0, import_react7.useState)(
|
|
6728
|
+
dualCalendar ? new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() + 1) : /* @__PURE__ */ new Date()
|
|
6729
|
+
);
|
|
6662
6730
|
const inputWrapperRef = (0, import_react7.useRef)(null);
|
|
6663
6731
|
const calendarWrapperRef = (0, import_react7.useRef)(null);
|
|
6664
6732
|
const [panelPos, setPanelPos] = (0, import_react7.useState)({ top: -9999, left: -9999 });
|
|
@@ -6675,7 +6743,16 @@ var DatePicker = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
6675
6743
|
return dateString;
|
|
6676
6744
|
}
|
|
6677
6745
|
};
|
|
6678
|
-
const displayValue = (0, import_react7.useMemo)(() =>
|
|
6746
|
+
const displayValue = (0, import_react7.useMemo)(() => {
|
|
6747
|
+
if (range) {
|
|
6748
|
+
const start = formatDate(selectedRange.startDate);
|
|
6749
|
+
const end = formatDate(selectedRange.endDate);
|
|
6750
|
+
if (start && end) return `${start} ~ ${end}`;
|
|
6751
|
+
if (start) return start;
|
|
6752
|
+
return "";
|
|
6753
|
+
}
|
|
6754
|
+
return formatDate(selectedDate);
|
|
6755
|
+
}, [selectedDate, selectedRange, format, range]);
|
|
6679
6756
|
const calculatePosition = (0, import_react7.useCallback)(() => {
|
|
6680
6757
|
if (inputWrapperRef.current) {
|
|
6681
6758
|
const rect = inputWrapperRef.current.getBoundingClientRect();
|
|
@@ -6708,13 +6785,18 @@ var DatePicker = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
6708
6785
|
};
|
|
6709
6786
|
const handleClearDate = (e) => {
|
|
6710
6787
|
e.preventDefault();
|
|
6711
|
-
|
|
6788
|
+
if (range) {
|
|
6789
|
+
setTempSelectedRange({ startDate: "", endDate: "" });
|
|
6790
|
+
setRangeSelection("start");
|
|
6791
|
+
} else {
|
|
6792
|
+
setTempSelectedDate("");
|
|
6793
|
+
}
|
|
6712
6794
|
};
|
|
6713
6795
|
const handleCalendarMouseDown = (e) => {
|
|
6714
6796
|
e.preventDefault();
|
|
6715
6797
|
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
6716
6798
|
};
|
|
6717
|
-
const getCalendarDates = (0, import_react7.useCallback)(() => {
|
|
6799
|
+
const getCalendarDates = (0, import_react7.useCallback)((currentDate) => {
|
|
6718
6800
|
const year = currentDate.getFullYear();
|
|
6719
6801
|
const month = currentDate.getMonth();
|
|
6720
6802
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
@@ -6728,47 +6810,160 @@ var DatePicker = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
6728
6810
|
const weeks = [];
|
|
6729
6811
|
for (let i = 0; i < dates.length; i += 7) weeks.push(dates.slice(i, i + 7));
|
|
6730
6812
|
return weeks;
|
|
6731
|
-
}, [
|
|
6732
|
-
const
|
|
6733
|
-
|
|
6734
|
-
|
|
6813
|
+
}, []);
|
|
6814
|
+
const handleLeftPrevMonth = () => {
|
|
6815
|
+
const newLeftDate = new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() - 1);
|
|
6816
|
+
setLeftCurrentDate(newLeftDate);
|
|
6817
|
+
if (dualCalendar) {
|
|
6818
|
+
setRightCurrentDate(new Date(newLeftDate.getFullYear(), newLeftDate.getMonth() + 1));
|
|
6819
|
+
}
|
|
6820
|
+
};
|
|
6821
|
+
const handleLeftNextMonth = () => {
|
|
6822
|
+
const newLeftDate = new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() + 1);
|
|
6823
|
+
setLeftCurrentDate(newLeftDate);
|
|
6824
|
+
if (dualCalendar) {
|
|
6825
|
+
setRightCurrentDate(new Date(newLeftDate.getFullYear(), newLeftDate.getMonth() + 1));
|
|
6826
|
+
}
|
|
6827
|
+
};
|
|
6828
|
+
const handleRightNextMonth = () => {
|
|
6829
|
+
if (!dualCalendar) return;
|
|
6830
|
+
const newRightDate = new Date(rightCurrentDate.getFullYear(), rightCurrentDate.getMonth() + 1);
|
|
6831
|
+
setRightCurrentDate(newRightDate);
|
|
6832
|
+
setLeftCurrentDate(new Date(newRightDate.getFullYear(), newRightDate.getMonth() - 1));
|
|
6833
|
+
};
|
|
6834
|
+
const handleDateSelect = (date, isCurrentMonth, currentDate) => {
|
|
6735
6835
|
if (!isCurrentMonth) return;
|
|
6736
6836
|
const selected = new Date(currentDate.getFullYear(), currentDate.getMonth(), date);
|
|
6737
6837
|
const formatted = formatDateToString(selected);
|
|
6738
|
-
|
|
6838
|
+
if (range) {
|
|
6839
|
+
if (rangeSelection === "start") {
|
|
6840
|
+
setTempSelectedRange({ startDate: formatted, endDate: "" });
|
|
6841
|
+
setRangeSelection("end");
|
|
6842
|
+
} else {
|
|
6843
|
+
const startDate = new Date(tempSelectedRange.startDate);
|
|
6844
|
+
if (selected >= startDate) {
|
|
6845
|
+
setTempSelectedRange({ ...tempSelectedRange, endDate: formatted });
|
|
6846
|
+
} else {
|
|
6847
|
+
setTempSelectedRange({ startDate: formatted, endDate: tempSelectedRange.startDate });
|
|
6848
|
+
}
|
|
6849
|
+
}
|
|
6850
|
+
} else {
|
|
6851
|
+
setTempSelectedDate(formatted);
|
|
6852
|
+
}
|
|
6739
6853
|
};
|
|
6740
6854
|
const handleSetToday = () => {
|
|
6741
6855
|
const today = /* @__PURE__ */ new Date();
|
|
6742
6856
|
const formatted = formatDateToString(today);
|
|
6743
|
-
|
|
6744
|
-
|
|
6857
|
+
if (range) {
|
|
6858
|
+
if (rangeSelection === "start") {
|
|
6859
|
+
setTempSelectedRange({ startDate: formatted, endDate: "" });
|
|
6860
|
+
setRangeSelection("end");
|
|
6861
|
+
} else {
|
|
6862
|
+
const startDate = new Date(tempSelectedRange.startDate);
|
|
6863
|
+
if (today >= startDate) {
|
|
6864
|
+
setTempSelectedRange({ ...tempSelectedRange, endDate: formatted });
|
|
6865
|
+
} else {
|
|
6866
|
+
setTempSelectedRange({ startDate: formatted, endDate: tempSelectedRange.startDate });
|
|
6867
|
+
}
|
|
6868
|
+
}
|
|
6869
|
+
} else {
|
|
6870
|
+
setLeftCurrentDate(today);
|
|
6871
|
+
if (dualCalendar) setRightCurrentDate(new Date(today.getFullYear(), today.getMonth() + 1));
|
|
6872
|
+
setTempSelectedDate(formatted);
|
|
6873
|
+
}
|
|
6745
6874
|
};
|
|
6746
6875
|
const handleConfirmDate = () => {
|
|
6747
|
-
|
|
6748
|
-
|
|
6876
|
+
if (range) {
|
|
6877
|
+
setSelectedRange(tempSelectedRange);
|
|
6878
|
+
onChange == null ? void 0 : onChange(tempSelectedRange);
|
|
6879
|
+
} else {
|
|
6880
|
+
setSelectedDate(tempSelectedDate);
|
|
6881
|
+
onChange == null ? void 0 : onChange(tempSelectedDate);
|
|
6882
|
+
}
|
|
6749
6883
|
setIsPanelOpen(false);
|
|
6750
6884
|
};
|
|
6751
6885
|
const handleResetDate = () => {
|
|
6752
|
-
|
|
6886
|
+
if (range) {
|
|
6887
|
+
setTempSelectedRange(selectedRange);
|
|
6888
|
+
setRangeSelection("start");
|
|
6889
|
+
} else {
|
|
6890
|
+
setTempSelectedDate(selectedDate);
|
|
6891
|
+
}
|
|
6753
6892
|
setIsPanelOpen(false);
|
|
6754
6893
|
};
|
|
6755
6894
|
const getDayProps = (0, import_react7.useCallback)(
|
|
6756
|
-
(dateObj) => {
|
|
6895
|
+
(dateObj, currentDate) => {
|
|
6757
6896
|
const today = /* @__PURE__ */ new Date();
|
|
6758
6897
|
const isToday = today.getDate() === dateObj.date && today.getMonth() === currentDate.getMonth() && today.getFullYear() === currentDate.getFullYear();
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6898
|
+
if (range) {
|
|
6899
|
+
const startFormatted = tempSelectedRange.startDate ? formatStringToDate(tempSelectedRange.startDate) : null;
|
|
6900
|
+
const endFormatted = tempSelectedRange.endDate ? formatStringToDate(tempSelectedRange.endDate) : null;
|
|
6901
|
+
const currentFormatted = new Date(currentDate.getFullYear(), currentDate.getMonth(), dateObj.date);
|
|
6902
|
+
const isStartSelected = startFormatted && startFormatted.getDate() === dateObj.date && startFormatted.getMonth() === currentDate.getMonth() && startFormatted.getFullYear() === currentDate.getFullYear();
|
|
6903
|
+
const isEndSelected = endFormatted && endFormatted.getDate() === dateObj.date && endFormatted.getMonth() === currentDate.getMonth() && endFormatted.getFullYear() === currentDate.getFullYear();
|
|
6904
|
+
const isInRange = startFormatted && endFormatted && currentFormatted > startFormatted && currentFormatted < endFormatted;
|
|
6905
|
+
if (dateObj.currentMonth && (isStartSelected || isEndSelected)) return "selected";
|
|
6906
|
+
if (dateObj.currentMonth && isInRange) return "period";
|
|
6907
|
+
if (dateObj.currentMonth && isToday) return "today";
|
|
6908
|
+
if (!dateObj.currentMonth) return "disabled";
|
|
6909
|
+
return "default";
|
|
6910
|
+
} else {
|
|
6911
|
+
const formatted = tempSelectedDate ? formatStringToDate(tempSelectedDate) : null;
|
|
6912
|
+
const isSelected = (formatted == null ? void 0 : formatted.getDate()) === dateObj.date && formatted.getMonth() === currentDate.getMonth() && formatted.getFullYear() === currentDate.getFullYear();
|
|
6913
|
+
return dateObj.currentMonth && isSelected ? "selected" : dateObj.currentMonth && isToday ? "today" : !dateObj.currentMonth ? "disabled" : "default";
|
|
6914
|
+
}
|
|
6762
6915
|
},
|
|
6763
|
-
[tempSelectedDate,
|
|
6916
|
+
[tempSelectedDate, tempSelectedRange, range]
|
|
6764
6917
|
);
|
|
6918
|
+
const getPlaceholderText = () => {
|
|
6919
|
+
return placeholder;
|
|
6920
|
+
};
|
|
6921
|
+
(0, import_react7.useEffect)(() => {
|
|
6922
|
+
if (range && typeof value === "object") {
|
|
6923
|
+
setSelectedRange(value || { startDate: "", endDate: "" });
|
|
6924
|
+
setTempSelectedRange(value || { startDate: "", endDate: "" });
|
|
6925
|
+
if (value == null ? void 0 : value.startDate) setLeftCurrentDate(new Date(value.startDate));
|
|
6926
|
+
} else if (!range && typeof value === "string") {
|
|
6927
|
+
setSelectedDate(value || "");
|
|
6928
|
+
setTempSelectedDate(value || "");
|
|
6929
|
+
if (value) setLeftCurrentDate(new Date(value));
|
|
6930
|
+
}
|
|
6931
|
+
}, [value, range]);
|
|
6765
6932
|
(0, import_react7.useEffect)(() => {
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
}, [
|
|
6770
|
-
const slots = (0, import_react7.useMemo)(() => datePickerStyle({ ...variantProps }), [variantProps]);
|
|
6933
|
+
if (dualCalendar) {
|
|
6934
|
+
setRightCurrentDate(new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() + 1));
|
|
6935
|
+
}
|
|
6936
|
+
}, [leftCurrentDate, dualCalendar]);
|
|
6937
|
+
const slots = (0, import_react7.useMemo)(() => datePickerStyle({ ...variantProps, dualCalendar }), [variantProps, dualCalendar]);
|
|
6771
6938
|
const endContent = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon_default, { name: "calendar", size, className: "cursor-pointer", fill: true, onClick: handleCalendarIconClick });
|
|
6939
|
+
const renderCalendar = (currentDate, isLeft) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-[5px]", children: [
|
|
6940
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: slots.calendarHead({ class: classNames == null ? void 0 : classNames.calendarHead }), children: dualCalendar ? isLeft ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
6941
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(icon_button_default, { name: "left", variant: "soft", color: "neutral", onClick: handleLeftPrevMonth }),
|
|
6942
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xl font-extrabold", children: monthYearFormat(currentDate.getFullYear(), currentDate.getMonth()) }),
|
|
6943
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-8" })
|
|
6944
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
6945
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-8" }),
|
|
6946
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xl font-extrabold", children: monthYearFormat(currentDate.getFullYear(), currentDate.getMonth()) }),
|
|
6947
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(icon_button_default, { name: "right", variant: "soft", color: "neutral", onClick: handleRightNextMonth })
|
|
6948
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
6949
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(icon_button_default, { name: "left", variant: "soft", color: "neutral", onClick: handleLeftPrevMonth }),
|
|
6950
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xl font-extrabold", children: monthYearFormat(currentDate.getFullYear(), currentDate.getMonth()) }),
|
|
6951
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(icon_button_default, { name: "right", variant: "soft", color: "neutral", onClick: handleLeftNextMonth })
|
|
6952
|
+
] }) }),
|
|
6953
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid grid-cols-7", children: daysOfWeek.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(day_default, { variant: "text", children: day }, `${day}-${index}`)) }),
|
|
6954
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid grid-cols-7 gap-y-[5px] text-center", children: getCalendarDates(currentDate).map((week, weekIndex) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react7.Fragment, { children: week.map((dateObj, index) => {
|
|
6955
|
+
const dayVariant = getDayProps(dateObj, currentDate);
|
|
6956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
6957
|
+
day_default,
|
|
6958
|
+
{
|
|
6959
|
+
variant: dayVariant,
|
|
6960
|
+
onClick: () => handleDateSelect(dateObj.date, dateObj.currentMonth, currentDate),
|
|
6961
|
+
children: dateObj.date
|
|
6962
|
+
},
|
|
6963
|
+
index
|
|
6964
|
+
);
|
|
6965
|
+
}) }, weekIndex)) })
|
|
6966
|
+
] });
|
|
6772
6967
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
6773
6968
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: inputWrapperRef, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onClick: handleFocusInput, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
6774
6969
|
input_default,
|
|
@@ -6777,7 +6972,7 @@ var DatePicker = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
6777
6972
|
ref,
|
|
6778
6973
|
label,
|
|
6779
6974
|
value: displayValue,
|
|
6780
|
-
placeholder,
|
|
6975
|
+
placeholder: getPlaceholderText(),
|
|
6781
6976
|
errorMessage,
|
|
6782
6977
|
helperMessage,
|
|
6783
6978
|
size,
|
|
@@ -6810,22 +7005,12 @@ var DatePicker = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
6810
7005
|
style: { position: "absolute", top: panelPos.top, left: panelPos.left, zIndex: 1e3 },
|
|
6811
7006
|
onMouseDown: handleCalendarMouseDown,
|
|
6812
7007
|
children: [
|
|
6813
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className:
|
|
6814
|
-
|
|
6815
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("
|
|
6816
|
-
|
|
7008
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: dualCalendar ? "flex gap-[10px]" : "flex", children: [
|
|
7009
|
+
renderCalendar(leftCurrentDate, true),
|
|
7010
|
+
dualCalendar && range && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "bg-neutral-soft w-px self-stretch" }),
|
|
7011
|
+
dualCalendar && renderCalendar(rightCurrentDate, false)
|
|
6817
7012
|
] }),
|
|
6818
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.
|
|
6819
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid grid-cols-7 gap-[5px] text-center", children: getCalendarDates().map((week, weekIndex) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react7.Fragment, { children: week.map((dateObj, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
6820
|
-
day_default,
|
|
6821
|
-
{
|
|
6822
|
-
variant: getDayProps(dateObj),
|
|
6823
|
-
onClick: () => handleDateSelect(dateObj.date, dateObj.currentMonth),
|
|
6824
|
-
children: dateObj.date
|
|
6825
|
-
},
|
|
6826
|
-
index
|
|
6827
|
-
)) }, weekIndex)) }),
|
|
6828
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex justify-between px-[10px]", children: [
|
|
7013
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex h-[30px] justify-between px-[10px]", children: [
|
|
6829
7014
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
6830
7015
|
text_button_default,
|
|
6831
7016
|
{
|
|
@@ -6871,13 +7056,11 @@ var datePickerStyle = tv({
|
|
|
6871
7056
|
"rounded-xl",
|
|
6872
7057
|
"bg-body-background",
|
|
6873
7058
|
"shadow-drop-xl",
|
|
6874
|
-
"gap-[5px]",
|
|
6875
7059
|
"overflow-auto",
|
|
6876
|
-
"w-[300px]",
|
|
6877
7060
|
"select-none",
|
|
6878
7061
|
"p-[10px]"
|
|
6879
7062
|
],
|
|
6880
|
-
calendarHead: ["calendar-header", "flex", "items-center", "justify-between", "h-[40px]"],
|
|
7063
|
+
calendarHead: ["calendar-header", "flex", "items-center", "justify-between", "h-[40px]", "w-[280px]"],
|
|
6881
7064
|
inputBase: [],
|
|
6882
7065
|
inputWrapper: [],
|
|
6883
7066
|
input: [],
|
|
@@ -6889,13 +7072,19 @@ var datePickerStyle = tv({
|
|
|
6889
7072
|
color: { primary: {}, secondary: {} },
|
|
6890
7073
|
size: { sm: {}, md: {}, lg: {}, xl: {} },
|
|
6891
7074
|
full: { true: { base: ["w-full"] } },
|
|
6892
|
-
disabled: { true: { base: ["pointer-events-none"] } }
|
|
7075
|
+
disabled: { true: { base: ["pointer-events-none"] } },
|
|
7076
|
+
dualCalendar: {
|
|
7077
|
+
true: { calendarWrapper: ["w-fit", "gap-[10px]"] },
|
|
7078
|
+
false: { calendarWrapper: ["w-[300px]", "gap-[5px]"] }
|
|
7079
|
+
}
|
|
6893
7080
|
},
|
|
6894
7081
|
defaultVariants: {
|
|
6895
7082
|
color: "primary",
|
|
6896
7083
|
size: "md",
|
|
6897
7084
|
full: false,
|
|
6898
|
-
disabled: false
|
|
7085
|
+
disabled: false,
|
|
7086
|
+
range: false,
|
|
7087
|
+
dualCalendar: false
|
|
6899
7088
|
}
|
|
6900
7089
|
});
|
|
6901
7090
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
import {
|
|
3
3
|
datePickerStyle,
|
|
4
4
|
datePicker_default
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-7YMXOYES.mjs";
|
|
6
6
|
import "../../chunk-4DESGO3D.mjs";
|
|
7
7
|
import "../../chunk-FWFEKWWD.mjs";
|
|
8
8
|
import "../../chunk-2GCSFWHD.mjs";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-SFGFRMWL.mjs";
|
|
10
10
|
import "../../chunk-MY5U63QO.mjs";
|
|
11
11
|
import "../../chunk-Q364C3FI.mjs";
|
|
12
12
|
import "../../chunk-ITWKPTSD.mjs";
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-YQYO5RLZ.mjs";
|
|
14
|
+
import "../../chunk-JKYLYL3A.mjs";
|
|
15
15
|
import "../../chunk-6WSACUIB.mjs";
|
|
16
16
|
import "../../chunk-LXHUO6VM.mjs";
|
|
17
17
|
import "../../chunk-SZL743JC.mjs";
|
|
18
18
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
19
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-R7KUEH3N.mjs";
|
|
20
20
|
import "../../chunk-E3G5QXSH.mjs";
|
|
21
|
-
import "../../chunk-
|
|
21
|
+
import "../../chunk-DDFJMHBC.mjs";
|
|
22
22
|
import "../../chunk-CDXBML6O.mjs";
|
|
23
23
|
import "../../chunk-27Y6K5NK.mjs";
|
|
24
24
|
import "../../chunk-AC6TWLRT.mjs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
2
|
import { VariantProps } from 'tailwind-variants';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
4
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
5
5
|
import { SlotsToClasses } from '../../utils/types.mjs';
|
|
6
6
|
|
|
7
|
-
interface DayProps extends Omit<
|
|
7
|
+
interface DayProps extends Omit<HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof dayStyle> {
|
|
8
8
|
classNames?: SlotsToClasses<DaySlots>;
|
|
9
9
|
children: ReactNode | string;
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
2
|
import { VariantProps } from 'tailwind-variants';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
4
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
5
5
|
import { SlotsToClasses } from '../../utils/types.js';
|
|
6
6
|
|
|
7
|
-
interface DayProps extends Omit<
|
|
7
|
+
interface DayProps extends Omit<HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof dayStyle> {
|
|
8
8
|
classNames?: SlotsToClasses<DaySlots>;
|
|
9
9
|
children: ReactNode | string;
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Day } from './day.mjs';
|
|
2
|
-
export { default as DatePicker, DatePickerProps } from './datePicker.mjs';
|
|
2
|
+
export { default as DatePicker, DatePickerProps, DateRangeValue, DateValue } from './datePicker.mjs';
|
|
3
3
|
export { default as TimePicker, TimePickerProps } from './timePicker.mjs';
|
|
4
4
|
import 'tailwind-variants';
|
|
5
5
|
import 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Day } from './day.js';
|
|
2
|
-
export { default as DatePicker, DatePickerProps } from './datePicker.js';
|
|
2
|
+
export { default as DatePicker, DatePickerProps, DateRangeValue, DateValue } from './datePicker.js';
|
|
3
3
|
export { default as TimePicker, TimePickerProps } from './timePicker.js';
|
|
4
4
|
import 'tailwind-variants';
|
|
5
5
|
import 'react';
|