@deepnoid/ui 0.1.156 → 0.1.157
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 +161 -161
- package/dist/{chunk-KKHOCWXJ.mjs → chunk-5KOTQEFC.mjs} +1 -1
- package/dist/{chunk-UIRHCS6B.mjs → chunk-73NBUI4Y.mjs} +1 -1
- package/dist/{chunk-2DAIOZ7N.mjs → chunk-ACFDUCPL.mjs} +2 -2
- package/dist/{chunk-47MQPUEY.mjs → chunk-BFC4VP3B.mjs} +1 -1
- package/dist/{chunk-6YTT5ACI.mjs → chunk-DQ3ZRNX4.mjs} +1 -1
- package/dist/{chunk-7RG7CQQM.mjs → chunk-DSEF7GGB.mjs} +1 -1
- package/dist/{chunk-R2USZD77.mjs → chunk-HLWNJLRZ.mjs} +1 -1
- package/dist/{chunk-URJA4W4R.mjs → chunk-IN6M25YL.mjs} +2 -2
- package/dist/{chunk-ZY3HNPPG.mjs → chunk-JJAPJQUD.mjs} +1 -1
- package/dist/{chunk-Q2YLULZH.mjs → chunk-LBJN5TAP.mjs} +1 -1
- package/dist/{chunk-ZNQML73F.mjs → chunk-MGGBCCZL.mjs} +2 -2
- package/dist/{chunk-HP4ARKW3.mjs → chunk-NB45YSED.mjs} +1 -1
- package/dist/{chunk-LFALITPU.mjs → chunk-PO4H65C3.mjs} +1 -1
- package/dist/{chunk-KX6WG4VG.mjs → chunk-QJUPHJN6.mjs} +1 -1
- package/dist/{chunk-ZGUTKE5H.mjs → chunk-SHI7P4DQ.mjs} +1 -1
- package/dist/{chunk-5VVNAW4E.mjs → chunk-T6V6BJOT.mjs} +2 -2
- package/dist/chunk-T7IJB3N4.mjs +449 -0
- package/dist/{chunk-WHU5VP5G.mjs → chunk-VUMESK5D.mjs} +20 -0
- package/dist/{chunk-4YVZ3XKA.mjs → chunk-ZUAOUHWS.mjs} +3 -3
- package/dist/components/avatar/avatar.js +20 -0
- package/dist/components/avatar/avatar.mjs +2 -2
- package/dist/components/avatar/index.js +20 -0
- package/dist/components/avatar/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +20 -0
- package/dist/components/breadcrumb/breadcrumb.mjs +5 -5
- package/dist/components/breadcrumb/index.js +20 -0
- package/dist/components/breadcrumb/index.mjs +5 -5
- package/dist/components/button/button.js +20 -0
- package/dist/components/button/button.mjs +3 -3
- package/dist/components/button/icon-button.js +20 -0
- package/dist/components/button/icon-button.mjs +3 -3
- package/dist/components/button/index.js +20 -0
- package/dist/components/button/index.mjs +4 -4
- package/dist/components/chip/chip.js +20 -0
- package/dist/components/chip/chip.mjs +3 -3
- package/dist/components/chip/index.js +20 -0
- package/dist/components/chip/index.mjs +3 -3
- package/dist/components/fileUpload/fileUpload.js +20 -0
- package/dist/components/fileUpload/fileUpload.mjs +6 -6
- package/dist/components/fileUpload/index.js +20 -0
- package/dist/components/fileUpload/index.mjs +6 -6
- package/dist/components/icon/Icon.d.mts +4 -0
- package/dist/components/icon/Icon.d.ts +4 -0
- package/dist/components/icon/Icon.js +20 -0
- package/dist/components/icon/Icon.mjs +2 -2
- package/dist/components/icon/index.js +20 -0
- package/dist/components/icon/index.mjs +2 -2
- package/dist/components/icon/template.d.mts +1 -0
- package/dist/components/icon/template.d.ts +1 -0
- package/dist/components/icon/template.js +20 -0
- package/dist/components/icon/template.mjs +1 -1
- package/dist/components/input/index.js +20 -0
- package/dist/components/input/index.mjs +3 -3
- package/dist/components/input/input.js +20 -0
- package/dist/components/input/input.mjs +3 -3
- package/dist/components/list/index.js +20 -0
- package/dist/components/list/index.mjs +4 -4
- package/dist/components/list/listItem.js +20 -0
- package/dist/components/list/listItem.mjs +4 -4
- package/dist/components/modal/index.js +20 -0
- package/dist/components/modal/index.mjs +5 -5
- package/dist/components/modal/modal.js +20 -0
- package/dist/components/modal/modal.mjs +5 -5
- package/dist/components/pagination/index.js +20 -0
- package/dist/components/pagination/index.mjs +4 -4
- package/dist/components/pagination/pagination.js +20 -0
- 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 +201 -47
- package/dist/components/picker/datePicker.mjs +6 -6
- package/dist/components/picker/index.d.mts +1 -1
- package/dist/components/picker/index.d.ts +1 -1
- package/dist/components/picker/index.js +201 -47
- package/dist/components/picker/index.mjs +8 -8
- package/dist/components/picker/timePicker.js +20 -0
- 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 +20 -0
- package/dist/components/select/index.mjs +3 -3
- package/dist/components/select/select.js +20 -0
- package/dist/components/select/select.mjs +3 -3
- package/dist/components/table/index.js +20 -0
- package/dist/components/table/index.mjs +5 -5
- package/dist/components/table/table-body.js +20 -0
- package/dist/components/table/table-body.mjs +5 -5
- package/dist/components/table/table-head.js +20 -0
- package/dist/components/table/table-head.mjs +5 -5
- package/dist/components/table/table.js +20 -0
- package/dist/components/table/table.mjs +5 -5
- package/dist/components/timePicker/calendar.js +20 -0
- package/dist/components/timePicker/calendar.mjs +2 -2
- package/dist/components/toast/index.js +20 -0
- package/dist/components/toast/index.mjs +4 -4
- package/dist/components/toast/toast.js +20 -0
- package/dist/components/toast/toast.mjs +3 -3
- package/dist/components/toast/use-toast.js +20 -0
- package/dist/components/toast/use-toast.mjs +4 -4
- package/dist/components/tree/index.js +20 -0
- package/dist/components/tree/index.mjs +3 -3
- package/dist/components/tree/tree.js +20 -0
- package/dist/components/tree/tree.mjs +3 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +201 -47
- package/dist/index.mjs +19 -19
- package/package.json +1 -1
- package/dist/chunk-TCURFCQ2.mjs +0 -315
package/dist/index.js
CHANGED
|
@@ -2575,6 +2575,26 @@ var template = {
|
|
|
2575
2575
|
}
|
|
2576
2576
|
);
|
|
2577
2577
|
},
|
|
2578
|
+
question: ({ className = "text-white" }) => {
|
|
2579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2580
|
+
"svg",
|
|
2581
|
+
{
|
|
2582
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2583
|
+
width: "24",
|
|
2584
|
+
height: "24",
|
|
2585
|
+
viewBox: "0 0 24 24",
|
|
2586
|
+
fill: "none",
|
|
2587
|
+
className,
|
|
2588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2589
|
+
"path",
|
|
2590
|
+
{
|
|
2591
|
+
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",
|
|
2592
|
+
fill: "currentColor"
|
|
2593
|
+
}
|
|
2594
|
+
)
|
|
2595
|
+
}
|
|
2596
|
+
);
|
|
2597
|
+
},
|
|
2578
2598
|
// ----------------------------------- old ---------------------------------
|
|
2579
2599
|
// ** Status **
|
|
2580
2600
|
"plus-circle": ({ className, fill }) => {
|
|
@@ -11236,12 +11256,25 @@ var DatePicker = (0, import_react32.forwardRef)((originalProps, ref) => {
|
|
|
11236
11256
|
todayTitle,
|
|
11237
11257
|
cancelTitle,
|
|
11238
11258
|
confirmTitle,
|
|
11259
|
+
range = false,
|
|
11260
|
+
dualCalendar = false,
|
|
11239
11261
|
...inputProps
|
|
11240
11262
|
} = { ...props, ...variantProps };
|
|
11241
|
-
const [selectedDate, setSelectedDate] = (0, import_react32.useState)(value || "");
|
|
11242
|
-
const [
|
|
11263
|
+
const [selectedDate, setSelectedDate] = (0, import_react32.useState)(range ? "" : typeof value === "string" ? value || "" : "");
|
|
11264
|
+
const [selectedRange, setSelectedRange] = (0, import_react32.useState)({
|
|
11265
|
+
startDate: range && typeof value === "object" ? (value == null ? void 0 : value.startDate) || "" : "",
|
|
11266
|
+
endDate: range && typeof value === "object" ? (value == null ? void 0 : value.endDate) || "" : ""
|
|
11267
|
+
});
|
|
11268
|
+
const [tempSelectedDate, setTempSelectedDate] = (0, import_react32.useState)(selectedDate);
|
|
11269
|
+
const [tempSelectedRange, setTempSelectedRange] = (0, import_react32.useState)(selectedRange);
|
|
11270
|
+
const [rangeSelection, setRangeSelection] = (0, import_react32.useState)("start");
|
|
11243
11271
|
const [isPanelOpen, setIsPanelOpen] = (0, import_react32.useState)(false);
|
|
11244
|
-
const [
|
|
11272
|
+
const [leftCurrentDate, setLeftCurrentDate] = (0, import_react32.useState)(
|
|
11273
|
+
range && tempSelectedRange.startDate ? new Date(tempSelectedRange.startDate) : tempSelectedDate ? new Date(tempSelectedDate) : /* @__PURE__ */ new Date()
|
|
11274
|
+
);
|
|
11275
|
+
const [rightCurrentDate, setRightCurrentDate] = (0, import_react32.useState)(
|
|
11276
|
+
dualCalendar ? new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() + 1) : /* @__PURE__ */ new Date()
|
|
11277
|
+
);
|
|
11245
11278
|
const inputWrapperRef = (0, import_react32.useRef)(null);
|
|
11246
11279
|
const calendarWrapperRef = (0, import_react32.useRef)(null);
|
|
11247
11280
|
const [panelPos, setPanelPos] = (0, import_react32.useState)({ top: -9999, left: -9999 });
|
|
@@ -11258,7 +11291,16 @@ var DatePicker = (0, import_react32.forwardRef)((originalProps, ref) => {
|
|
|
11258
11291
|
return dateString;
|
|
11259
11292
|
}
|
|
11260
11293
|
};
|
|
11261
|
-
const displayValue = (0, import_react32.useMemo)(() =>
|
|
11294
|
+
const displayValue = (0, import_react32.useMemo)(() => {
|
|
11295
|
+
if (range) {
|
|
11296
|
+
const start = formatDate(selectedRange.startDate);
|
|
11297
|
+
const end = formatDate(selectedRange.endDate);
|
|
11298
|
+
if (start && end) return `${start} ~ ${end}`;
|
|
11299
|
+
if (start) return start;
|
|
11300
|
+
return "";
|
|
11301
|
+
}
|
|
11302
|
+
return formatDate(selectedDate);
|
|
11303
|
+
}, [selectedDate, selectedRange, format, range]);
|
|
11262
11304
|
const calculatePosition = (0, import_react32.useCallback)(() => {
|
|
11263
11305
|
if (inputWrapperRef.current) {
|
|
11264
11306
|
const rect = inputWrapperRef.current.getBoundingClientRect();
|
|
@@ -11291,13 +11333,18 @@ var DatePicker = (0, import_react32.forwardRef)((originalProps, ref) => {
|
|
|
11291
11333
|
};
|
|
11292
11334
|
const handleClearDate = (e) => {
|
|
11293
11335
|
e.preventDefault();
|
|
11294
|
-
|
|
11336
|
+
if (range) {
|
|
11337
|
+
setTempSelectedRange({ startDate: "", endDate: "" });
|
|
11338
|
+
setRangeSelection("start");
|
|
11339
|
+
} else {
|
|
11340
|
+
setTempSelectedDate("");
|
|
11341
|
+
}
|
|
11295
11342
|
};
|
|
11296
11343
|
const handleCalendarMouseDown = (e) => {
|
|
11297
11344
|
e.preventDefault();
|
|
11298
11345
|
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
11299
11346
|
};
|
|
11300
|
-
const getCalendarDates = (0, import_react32.useCallback)(() => {
|
|
11347
|
+
const getCalendarDates = (0, import_react32.useCallback)((currentDate) => {
|
|
11301
11348
|
const year = currentDate.getFullYear();
|
|
11302
11349
|
const month = currentDate.getMonth();
|
|
11303
11350
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
@@ -11311,47 +11358,160 @@ var DatePicker = (0, import_react32.forwardRef)((originalProps, ref) => {
|
|
|
11311
11358
|
const weeks = [];
|
|
11312
11359
|
for (let i = 0; i < dates.length; i += 7) weeks.push(dates.slice(i, i + 7));
|
|
11313
11360
|
return weeks;
|
|
11314
|
-
}, [
|
|
11315
|
-
const
|
|
11316
|
-
|
|
11317
|
-
|
|
11361
|
+
}, []);
|
|
11362
|
+
const handleLeftPrevMonth = () => {
|
|
11363
|
+
const newLeftDate = new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() - 1);
|
|
11364
|
+
setLeftCurrentDate(newLeftDate);
|
|
11365
|
+
if (dualCalendar) {
|
|
11366
|
+
setRightCurrentDate(new Date(newLeftDate.getFullYear(), newLeftDate.getMonth() + 1));
|
|
11367
|
+
}
|
|
11368
|
+
};
|
|
11369
|
+
const handleLeftNextMonth = () => {
|
|
11370
|
+
const newLeftDate = new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() + 1);
|
|
11371
|
+
setLeftCurrentDate(newLeftDate);
|
|
11372
|
+
if (dualCalendar) {
|
|
11373
|
+
setRightCurrentDate(new Date(newLeftDate.getFullYear(), newLeftDate.getMonth() + 1));
|
|
11374
|
+
}
|
|
11375
|
+
};
|
|
11376
|
+
const handleRightNextMonth = () => {
|
|
11377
|
+
if (!dualCalendar) return;
|
|
11378
|
+
const newRightDate = new Date(rightCurrentDate.getFullYear(), rightCurrentDate.getMonth() + 1);
|
|
11379
|
+
setRightCurrentDate(newRightDate);
|
|
11380
|
+
setLeftCurrentDate(new Date(newRightDate.getFullYear(), newRightDate.getMonth() - 1));
|
|
11381
|
+
};
|
|
11382
|
+
const handleDateSelect = (date, isCurrentMonth, currentDate) => {
|
|
11318
11383
|
if (!isCurrentMonth) return;
|
|
11319
11384
|
const selected = new Date(currentDate.getFullYear(), currentDate.getMonth(), date);
|
|
11320
11385
|
const formatted = formatDateToString(selected);
|
|
11321
|
-
|
|
11386
|
+
if (range) {
|
|
11387
|
+
if (rangeSelection === "start") {
|
|
11388
|
+
setTempSelectedRange({ startDate: formatted, endDate: "" });
|
|
11389
|
+
setRangeSelection("end");
|
|
11390
|
+
} else {
|
|
11391
|
+
const startDate = new Date(tempSelectedRange.startDate);
|
|
11392
|
+
if (selected >= startDate) {
|
|
11393
|
+
setTempSelectedRange({ ...tempSelectedRange, endDate: formatted });
|
|
11394
|
+
} else {
|
|
11395
|
+
setTempSelectedRange({ startDate: formatted, endDate: tempSelectedRange.startDate });
|
|
11396
|
+
}
|
|
11397
|
+
}
|
|
11398
|
+
} else {
|
|
11399
|
+
setTempSelectedDate(formatted);
|
|
11400
|
+
}
|
|
11322
11401
|
};
|
|
11323
11402
|
const handleSetToday = () => {
|
|
11324
11403
|
const today = /* @__PURE__ */ new Date();
|
|
11325
11404
|
const formatted = formatDateToString(today);
|
|
11326
|
-
|
|
11327
|
-
|
|
11405
|
+
if (range) {
|
|
11406
|
+
if (rangeSelection === "start") {
|
|
11407
|
+
setTempSelectedRange({ startDate: formatted, endDate: "" });
|
|
11408
|
+
setRangeSelection("end");
|
|
11409
|
+
} else {
|
|
11410
|
+
const startDate = new Date(tempSelectedRange.startDate);
|
|
11411
|
+
if (today >= startDate) {
|
|
11412
|
+
setTempSelectedRange({ ...tempSelectedRange, endDate: formatted });
|
|
11413
|
+
} else {
|
|
11414
|
+
setTempSelectedRange({ startDate: formatted, endDate: tempSelectedRange.startDate });
|
|
11415
|
+
}
|
|
11416
|
+
}
|
|
11417
|
+
} else {
|
|
11418
|
+
setLeftCurrentDate(today);
|
|
11419
|
+
if (dualCalendar) setRightCurrentDate(new Date(today.getFullYear(), today.getMonth() + 1));
|
|
11420
|
+
setTempSelectedDate(formatted);
|
|
11421
|
+
}
|
|
11328
11422
|
};
|
|
11329
11423
|
const handleConfirmDate = () => {
|
|
11330
|
-
|
|
11331
|
-
|
|
11424
|
+
if (range) {
|
|
11425
|
+
setSelectedRange(tempSelectedRange);
|
|
11426
|
+
onChange == null ? void 0 : onChange(tempSelectedRange);
|
|
11427
|
+
} else {
|
|
11428
|
+
setSelectedDate(tempSelectedDate);
|
|
11429
|
+
onChange == null ? void 0 : onChange(tempSelectedDate);
|
|
11430
|
+
}
|
|
11332
11431
|
setIsPanelOpen(false);
|
|
11333
11432
|
};
|
|
11334
11433
|
const handleResetDate = () => {
|
|
11335
|
-
|
|
11434
|
+
if (range) {
|
|
11435
|
+
setTempSelectedRange(selectedRange);
|
|
11436
|
+
setRangeSelection("start");
|
|
11437
|
+
} else {
|
|
11438
|
+
setTempSelectedDate(selectedDate);
|
|
11439
|
+
}
|
|
11336
11440
|
setIsPanelOpen(false);
|
|
11337
11441
|
};
|
|
11338
11442
|
const getDayProps = (0, import_react32.useCallback)(
|
|
11339
|
-
(dateObj) => {
|
|
11443
|
+
(dateObj, currentDate) => {
|
|
11340
11444
|
const today = /* @__PURE__ */ new Date();
|
|
11341
11445
|
const isToday = today.getDate() === dateObj.date && today.getMonth() === currentDate.getMonth() && today.getFullYear() === currentDate.getFullYear();
|
|
11342
|
-
|
|
11343
|
-
|
|
11344
|
-
|
|
11446
|
+
if (range) {
|
|
11447
|
+
const startFormatted = tempSelectedRange.startDate ? formatStringToDate(tempSelectedRange.startDate) : null;
|
|
11448
|
+
const endFormatted = tempSelectedRange.endDate ? formatStringToDate(tempSelectedRange.endDate) : null;
|
|
11449
|
+
const currentFormatted = new Date(currentDate.getFullYear(), currentDate.getMonth(), dateObj.date);
|
|
11450
|
+
const isStartSelected = startFormatted && startFormatted.getDate() === dateObj.date && startFormatted.getMonth() === currentDate.getMonth() && startFormatted.getFullYear() === currentDate.getFullYear();
|
|
11451
|
+
const isEndSelected = endFormatted && endFormatted.getDate() === dateObj.date && endFormatted.getMonth() === currentDate.getMonth() && endFormatted.getFullYear() === currentDate.getFullYear();
|
|
11452
|
+
const isInRange = startFormatted && endFormatted && currentFormatted > startFormatted && currentFormatted < endFormatted;
|
|
11453
|
+
if (dateObj.currentMonth && (isStartSelected || isEndSelected)) return "selected";
|
|
11454
|
+
if (dateObj.currentMonth && isInRange) return "period";
|
|
11455
|
+
if (dateObj.currentMonth && isToday) return "today";
|
|
11456
|
+
if (!dateObj.currentMonth) return "disabled";
|
|
11457
|
+
return "default";
|
|
11458
|
+
} else {
|
|
11459
|
+
const formatted = tempSelectedDate ? formatStringToDate(tempSelectedDate) : null;
|
|
11460
|
+
const isSelected = (formatted == null ? void 0 : formatted.getDate()) === dateObj.date && formatted.getMonth() === currentDate.getMonth() && formatted.getFullYear() === currentDate.getFullYear();
|
|
11461
|
+
return dateObj.currentMonth && isSelected ? "selected" : dateObj.currentMonth && isToday ? "today" : !dateObj.currentMonth ? "disabled" : "default";
|
|
11462
|
+
}
|
|
11345
11463
|
},
|
|
11346
|
-
[tempSelectedDate,
|
|
11464
|
+
[tempSelectedDate, tempSelectedRange, range]
|
|
11347
11465
|
);
|
|
11466
|
+
const getPlaceholderText = () => {
|
|
11467
|
+
return placeholder;
|
|
11468
|
+
};
|
|
11348
11469
|
(0, import_react32.useEffect)(() => {
|
|
11349
|
-
|
|
11350
|
-
|
|
11351
|
-
|
|
11352
|
-
|
|
11353
|
-
|
|
11470
|
+
if (range && typeof value === "object") {
|
|
11471
|
+
setSelectedRange(value || { startDate: "", endDate: "" });
|
|
11472
|
+
setTempSelectedRange(value || { startDate: "", endDate: "" });
|
|
11473
|
+
if (value == null ? void 0 : value.startDate) setLeftCurrentDate(new Date(value.startDate));
|
|
11474
|
+
} else if (!range && typeof value === "string") {
|
|
11475
|
+
setSelectedDate(value || "");
|
|
11476
|
+
setTempSelectedDate(value || "");
|
|
11477
|
+
if (value) setLeftCurrentDate(new Date(value));
|
|
11478
|
+
}
|
|
11479
|
+
}, [value, range]);
|
|
11480
|
+
(0, import_react32.useEffect)(() => {
|
|
11481
|
+
if (dualCalendar) {
|
|
11482
|
+
setRightCurrentDate(new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() + 1));
|
|
11483
|
+
}
|
|
11484
|
+
}, [leftCurrentDate, dualCalendar]);
|
|
11485
|
+
const slots = (0, import_react32.useMemo)(() => datePickerStyle({ ...variantProps, dualCalendar }), [variantProps, dualCalendar]);
|
|
11354
11486
|
const endContent = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Icon_default, { name: "calendar", size, className: "cursor-pointer", fill: true, onClick: handleCalendarIconClick });
|
|
11487
|
+
const renderCalendar = (currentDate, isLeft) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col gap-[5px]", children: [
|
|
11488
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: slots.calendarHead({ class: classNames == null ? void 0 : classNames.calendarHead }), children: dualCalendar ? isLeft ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
11489
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(icon_button_default, { name: "left", variant: "soft", color: "neutral", onClick: handleLeftPrevMonth }),
|
|
11490
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xl font-extrabold", children: monthYearFormat(currentDate.getFullYear(), currentDate.getMonth()) }),
|
|
11491
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-8" })
|
|
11492
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
11493
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-8" }),
|
|
11494
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xl font-extrabold", children: monthYearFormat(currentDate.getFullYear(), currentDate.getMonth()) }),
|
|
11495
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(icon_button_default, { name: "right", variant: "soft", color: "neutral", onClick: handleRightNextMonth })
|
|
11496
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
11497
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(icon_button_default, { name: "left", variant: "soft", color: "neutral", onClick: handleLeftPrevMonth }),
|
|
11498
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xl font-extrabold", children: monthYearFormat(currentDate.getFullYear(), currentDate.getMonth()) }),
|
|
11499
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(icon_button_default, { name: "right", variant: "soft", color: "neutral", onClick: handleLeftNextMonth })
|
|
11500
|
+
] }) }),
|
|
11501
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "grid grid-cols-7", children: daysOfWeek.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(day_default, { variant: "text", children: day }, `${day}-${index}`)) }),
|
|
11502
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "grid grid-cols-7 gap-y-[5px] text-center", children: getCalendarDates(currentDate).map((week, weekIndex) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react32.Fragment, { children: week.map((dateObj, index) => {
|
|
11503
|
+
const dayVariant = getDayProps(dateObj, currentDate);
|
|
11504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11505
|
+
day_default,
|
|
11506
|
+
{
|
|
11507
|
+
variant: dayVariant,
|
|
11508
|
+
onClick: () => handleDateSelect(dateObj.date, dateObj.currentMonth, currentDate),
|
|
11509
|
+
children: dateObj.date
|
|
11510
|
+
},
|
|
11511
|
+
index
|
|
11512
|
+
);
|
|
11513
|
+
}) }, weekIndex)) })
|
|
11514
|
+
] });
|
|
11355
11515
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
11356
11516
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref: inputWrapperRef, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onClick: handleFocusInput, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11357
11517
|
input_default,
|
|
@@ -11360,7 +11520,7 @@ var DatePicker = (0, import_react32.forwardRef)((originalProps, ref) => {
|
|
|
11360
11520
|
ref,
|
|
11361
11521
|
label,
|
|
11362
11522
|
value: displayValue,
|
|
11363
|
-
placeholder,
|
|
11523
|
+
placeholder: getPlaceholderText(),
|
|
11364
11524
|
errorMessage,
|
|
11365
11525
|
helperMessage,
|
|
11366
11526
|
size,
|
|
@@ -11393,22 +11553,12 @@ var DatePicker = (0, import_react32.forwardRef)((originalProps, ref) => {
|
|
|
11393
11553
|
style: { position: "absolute", top: panelPos.top, left: panelPos.left, zIndex: 1e3 },
|
|
11394
11554
|
onMouseDown: handleCalendarMouseDown,
|
|
11395
11555
|
children: [
|
|
11396
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className:
|
|
11397
|
-
|
|
11398
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("
|
|
11399
|
-
|
|
11556
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: dualCalendar ? "flex gap-[10px]" : "flex", children: [
|
|
11557
|
+
renderCalendar(leftCurrentDate, true),
|
|
11558
|
+
dualCalendar && range && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "bg-neutral-soft w-px self-stretch" }),
|
|
11559
|
+
dualCalendar && renderCalendar(rightCurrentDate, false)
|
|
11400
11560
|
] }),
|
|
11401
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.
|
|
11402
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "grid grid-cols-7 gap-[5px] text-center", children: getCalendarDates().map((week, weekIndex) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react32.Fragment, { children: week.map((dateObj, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11403
|
-
day_default,
|
|
11404
|
-
{
|
|
11405
|
-
variant: getDayProps(dateObj),
|
|
11406
|
-
onClick: () => handleDateSelect(dateObj.date, dateObj.currentMonth),
|
|
11407
|
-
children: dateObj.date
|
|
11408
|
-
},
|
|
11409
|
-
index
|
|
11410
|
-
)) }, weekIndex)) }),
|
|
11411
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex justify-between px-[10px]", children: [
|
|
11561
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex h-[30px] justify-between px-[10px]", children: [
|
|
11412
11562
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11413
11563
|
text_button_default,
|
|
11414
11564
|
{
|
|
@@ -11454,13 +11604,11 @@ var datePickerStyle = tv({
|
|
|
11454
11604
|
"rounded-xl",
|
|
11455
11605
|
"bg-body-background",
|
|
11456
11606
|
"shadow-drop-xl",
|
|
11457
|
-
"gap-[5px]",
|
|
11458
11607
|
"overflow-auto",
|
|
11459
|
-
"w-[300px]",
|
|
11460
11608
|
"select-none",
|
|
11461
11609
|
"p-[10px]"
|
|
11462
11610
|
],
|
|
11463
|
-
calendarHead: ["calendar-header", "flex", "items-center", "justify-between", "h-[40px]"],
|
|
11611
|
+
calendarHead: ["calendar-header", "flex", "items-center", "justify-between", "h-[40px]", "w-[280px]"],
|
|
11464
11612
|
inputBase: [],
|
|
11465
11613
|
inputWrapper: [],
|
|
11466
11614
|
input: [],
|
|
@@ -11472,13 +11620,19 @@ var datePickerStyle = tv({
|
|
|
11472
11620
|
color: { primary: {}, secondary: {} },
|
|
11473
11621
|
size: { sm: {}, md: {}, lg: {}, xl: {} },
|
|
11474
11622
|
full: { true: { base: ["w-full"] } },
|
|
11475
|
-
disabled: { true: { base: ["pointer-events-none"] } }
|
|
11623
|
+
disabled: { true: { base: ["pointer-events-none"] } },
|
|
11624
|
+
dualCalendar: {
|
|
11625
|
+
true: { calendarWrapper: ["w-fit", "gap-[10px]"] },
|
|
11626
|
+
false: { calendarWrapper: ["w-[300px]", "gap-[5px]"] }
|
|
11627
|
+
}
|
|
11476
11628
|
},
|
|
11477
11629
|
defaultVariants: {
|
|
11478
11630
|
color: "primary",
|
|
11479
11631
|
size: "md",
|
|
11480
11632
|
full: false,
|
|
11481
|
-
disabled: false
|
|
11633
|
+
disabled: false,
|
|
11634
|
+
range: false,
|
|
11635
|
+
dualCalendar: false
|
|
11482
11636
|
}
|
|
11483
11637
|
});
|
|
11484
11638
|
|
package/dist/index.mjs
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import "./chunk-MBLZYQCN.mjs";
|
|
3
3
|
import {
|
|
4
4
|
tree_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HLWNJLRZ.mjs";
|
|
6
6
|
import "./chunk-LUWGOKLG.mjs";
|
|
7
7
|
import {
|
|
8
8
|
ToastProvider,
|
|
9
9
|
useToast
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QJUPHJN6.mjs";
|
|
11
11
|
import "./chunk-ZOTHPHXA.mjs";
|
|
12
12
|
import {
|
|
13
13
|
toast_default
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DQ3ZRNX4.mjs";
|
|
15
15
|
import "./chunk-HIE2YRGA.mjs";
|
|
16
16
|
import {
|
|
17
17
|
tooltip_default
|
|
@@ -21,7 +21,7 @@ import "./chunk-WSIADHVC.mjs";
|
|
|
21
21
|
import "./chunk-DX3KXNP6.mjs";
|
|
22
22
|
import {
|
|
23
23
|
table_default
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-JJAPJQUD.mjs";
|
|
25
25
|
import "./chunk-3MY6LO7N.mjs";
|
|
26
26
|
import {
|
|
27
27
|
tabs_default
|
|
@@ -48,22 +48,22 @@ import {
|
|
|
48
48
|
import "./chunk-7B7LRG5J.mjs";
|
|
49
49
|
import {
|
|
50
50
|
pagination_default
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-MGGBCCZL.mjs";
|
|
52
52
|
import "./chunk-F3HENRVM.mjs";
|
|
53
53
|
import "./chunk-4VWG4726.mjs";
|
|
54
54
|
import {
|
|
55
55
|
datePicker_default
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-T7IJB3N4.mjs";
|
|
57
57
|
import {
|
|
58
58
|
day_default
|
|
59
59
|
} from "./chunk-4DESGO3D.mjs";
|
|
60
60
|
import {
|
|
61
61
|
timePicker_default
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-T6V6BJOT.mjs";
|
|
63
63
|
import "./chunk-QCEKPS7U.mjs";
|
|
64
64
|
import {
|
|
65
65
|
select_default
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-SHI7P4DQ.mjs";
|
|
67
67
|
import "./chunk-FWFEKWWD.mjs";
|
|
68
68
|
import "./chunk-7MVEAQ7Z.mjs";
|
|
69
69
|
import {
|
|
@@ -71,15 +71,15 @@ import {
|
|
|
71
71
|
} from "./chunk-3IILPVRA.mjs";
|
|
72
72
|
import {
|
|
73
73
|
listItem_default
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-ACFDUCPL.mjs";
|
|
75
75
|
import "./chunk-DJOG6Z35.mjs";
|
|
76
76
|
import {
|
|
77
77
|
modal_default
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-IN6M25YL.mjs";
|
|
79
79
|
import "./chunk-MGEWSREV.mjs";
|
|
80
80
|
import {
|
|
81
81
|
chip_default
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-5KOTQEFC.mjs";
|
|
83
83
|
import "./chunk-32GA3YW4.mjs";
|
|
84
84
|
import {
|
|
85
85
|
drawer_default
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
import "./chunk-RLXOHILK.mjs";
|
|
88
88
|
import {
|
|
89
89
|
fileUpload_default
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-ZUAOUHWS.mjs";
|
|
91
91
|
import "./chunk-7VOQKIIK.mjs";
|
|
92
92
|
import {
|
|
93
93
|
progress_default
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
import "./chunk-2GCSFWHD.mjs";
|
|
96
96
|
import {
|
|
97
97
|
input_default
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-BFC4VP3B.mjs";
|
|
99
99
|
import "./chunk-VYNBJBXD.mjs";
|
|
100
100
|
import {
|
|
101
101
|
areaChart_default
|
|
@@ -124,7 +124,7 @@ import {
|
|
|
124
124
|
import "./chunk-KYIODWXL.mjs";
|
|
125
125
|
import {
|
|
126
126
|
breadcrumb_default
|
|
127
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-PO4H65C3.mjs";
|
|
128
128
|
import "./chunk-MY5U63QO.mjs";
|
|
129
129
|
import {
|
|
130
130
|
text_button_default
|
|
@@ -134,10 +134,10 @@ import {
|
|
|
134
134
|
} from "./chunk-ITWKPTSD.mjs";
|
|
135
135
|
import {
|
|
136
136
|
button_default
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-73NBUI4Y.mjs";
|
|
138
138
|
import {
|
|
139
139
|
icon_button_default
|
|
140
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-DSEF7GGB.mjs";
|
|
141
141
|
import "./chunk-6WSACUIB.mjs";
|
|
142
142
|
import "./chunk-LXHUO6VM.mjs";
|
|
143
143
|
import "./chunk-SZL743JC.mjs";
|
|
@@ -145,7 +145,7 @@ import "./chunk-ZYIIXWVY.mjs";
|
|
|
145
145
|
import {
|
|
146
146
|
Icon_default,
|
|
147
147
|
iconTemplate
|
|
148
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-LBJN5TAP.mjs";
|
|
149
149
|
import "./chunk-NMSDSEBD.mjs";
|
|
150
150
|
import {
|
|
151
151
|
accordion_default
|
|
@@ -157,8 +157,8 @@ import "./chunk-E3G5QXSH.mjs";
|
|
|
157
157
|
import "./chunk-7DLOYKVC.mjs";
|
|
158
158
|
import {
|
|
159
159
|
avatar_default
|
|
160
|
-
} from "./chunk-
|
|
161
|
-
import "./chunk-
|
|
160
|
+
} from "./chunk-NB45YSED.mjs";
|
|
161
|
+
import "./chunk-VUMESK5D.mjs";
|
|
162
162
|
import {
|
|
163
163
|
deepnoidUi,
|
|
164
164
|
tv
|