@codapet/design-system 0.5.8 → 0.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +30 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2174,7 +2174,7 @@ function DateInput({
|
|
|
2174
2174
|
setDate,
|
|
2175
2175
|
maxDate,
|
|
2176
2176
|
minDate,
|
|
2177
|
-
disableFuture =
|
|
2177
|
+
disableFuture = false,
|
|
2178
2178
|
className,
|
|
2179
2179
|
inputClassName,
|
|
2180
2180
|
calendarClassName,
|
|
@@ -2247,6 +2247,18 @@ function DateInput({
|
|
|
2247
2247
|
}
|
|
2248
2248
|
return null;
|
|
2249
2249
|
}, [minDate]);
|
|
2250
|
+
const dropdownStartMonth = React20.useMemo(() => {
|
|
2251
|
+
if (effectiveMinDate) return effectiveMinDate;
|
|
2252
|
+
const d = new Date(today);
|
|
2253
|
+
d.setFullYear(d.getFullYear() - 100);
|
|
2254
|
+
return d;
|
|
2255
|
+
}, [effectiveMinDate, today]);
|
|
2256
|
+
const dropdownEndMonth = React20.useMemo(() => {
|
|
2257
|
+
if (effectiveMaxDate) return effectiveMaxDate;
|
|
2258
|
+
const d = new Date(today);
|
|
2259
|
+
d.setFullYear(d.getFullYear() + 100);
|
|
2260
|
+
return d;
|
|
2261
|
+
}, [effectiveMaxDate, today]);
|
|
2250
2262
|
React20.useEffect(() => {
|
|
2251
2263
|
if (date) {
|
|
2252
2264
|
setValue(formatDate(date, dateFormat));
|
|
@@ -2284,8 +2296,8 @@ function DateInput({
|
|
|
2284
2296
|
month: effectiveMonth,
|
|
2285
2297
|
onMonthChange: onMonthChange ?? setMonthState,
|
|
2286
2298
|
showOutsideDays,
|
|
2287
|
-
|
|
2288
|
-
|
|
2299
|
+
startMonth: dropdownStartMonth,
|
|
2300
|
+
endMonth: dropdownEndMonth,
|
|
2289
2301
|
className: cn(
|
|
2290
2302
|
"w-auto mx-auto overflow-y-auto h-auto m-2",
|
|
2291
2303
|
calendarClassName
|
|
@@ -2441,7 +2453,7 @@ function DateRangeInput({
|
|
|
2441
2453
|
setDateRange,
|
|
2442
2454
|
maxDate,
|
|
2443
2455
|
minDate,
|
|
2444
|
-
disableFuture =
|
|
2456
|
+
disableFuture = false,
|
|
2445
2457
|
className,
|
|
2446
2458
|
inputClassName,
|
|
2447
2459
|
calendarClassName,
|
|
@@ -2504,6 +2516,18 @@ function DateRangeInput({
|
|
|
2504
2516
|
}
|
|
2505
2517
|
return null;
|
|
2506
2518
|
}, [minDate]);
|
|
2519
|
+
const dropdownStartMonth = React21.useMemo(() => {
|
|
2520
|
+
if (effectiveMinDate) return effectiveMinDate;
|
|
2521
|
+
const d = new Date(today);
|
|
2522
|
+
d.setFullYear(d.getFullYear() - 100);
|
|
2523
|
+
return d;
|
|
2524
|
+
}, [effectiveMinDate, today]);
|
|
2525
|
+
const dropdownEndMonth = React21.useMemo(() => {
|
|
2526
|
+
if (effectiveMaxDate) return effectiveMaxDate;
|
|
2527
|
+
const d = new Date(today);
|
|
2528
|
+
d.setFullYear(d.getFullYear() + 100);
|
|
2529
|
+
return d;
|
|
2530
|
+
}, [effectiveMaxDate, today]);
|
|
2507
2531
|
const effectiveMonth = month ?? monthState ?? void 0;
|
|
2508
2532
|
const effectiveSelected = selected ?? dateRange;
|
|
2509
2533
|
const isInputDisabled = inputDisabled ?? (typeof calendarDisabled === "boolean" ? calendarDisabled : false);
|
|
@@ -2538,8 +2562,8 @@ function DateRangeInput({
|
|
|
2538
2562
|
month: effectiveMonth,
|
|
2539
2563
|
onMonthChange: onMonthChange ?? setMonthState,
|
|
2540
2564
|
showOutsideDays,
|
|
2541
|
-
|
|
2542
|
-
|
|
2565
|
+
startMonth: dropdownStartMonth,
|
|
2566
|
+
endMonth: dropdownEndMonth,
|
|
2543
2567
|
className: cn("w-auto shrink-0 h-auto mt-2", calendarClassName),
|
|
2544
2568
|
classNames,
|
|
2545
2569
|
components,
|