@ceed/ads 0.0.52 → 0.0.53
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.
|
@@ -11,6 +11,10 @@ export declare const useCalendarProps: (inProps: CalendarProps) => readonly [{
|
|
|
11
11
|
views: View[];
|
|
12
12
|
slots?: Partial<Record<import("../types").CalendarSlot, React.ElementType<any, keyof React.JSX.IntrinsicElements>>> | undefined;
|
|
13
13
|
rangeSelection?: boolean | undefined;
|
|
14
|
+
minDate?: Date | undefined;
|
|
15
|
+
maxDate?: Date | undefined;
|
|
16
|
+
disableFuture?: boolean | undefined;
|
|
17
|
+
disablePast?: boolean | undefined;
|
|
14
18
|
}, {
|
|
15
19
|
viewMonth: Date;
|
|
16
20
|
direction: number;
|
|
@@ -24,4 +28,8 @@ export declare const useCalendarProps: (inProps: CalendarProps) => readonly [{
|
|
|
24
28
|
views: View[];
|
|
25
29
|
slots?: Partial<Record<import("../types").CalendarSlot, React.ElementType<any, keyof React.JSX.IntrinsicElements>>> | undefined;
|
|
26
30
|
rangeSelection?: boolean | undefined;
|
|
31
|
+
minDate?: Date | undefined;
|
|
32
|
+
maxDate?: Date | undefined;
|
|
33
|
+
disableFuture?: boolean | undefined;
|
|
34
|
+
disablePast?: boolean | undefined;
|
|
27
35
|
}];
|
|
@@ -12,6 +12,7 @@ export declare const useCalendar: (ownerState: CalendarOwnerState) => {
|
|
|
12
12
|
readonly isSelected: boolean | undefined;
|
|
13
13
|
readonly onClick: () => void;
|
|
14
14
|
readonly onMouseEnter: (() => void) | undefined;
|
|
15
|
+
readonly disabled: boolean | undefined;
|
|
15
16
|
readonly tabIndex: -1;
|
|
16
17
|
readonly "aria-label": string;
|
|
17
18
|
readonly "aria-selected": "true" | undefined;
|
|
@@ -19,6 +20,7 @@ export declare const useCalendar: (ownerState: CalendarOwnerState) => {
|
|
|
19
20
|
};
|
|
20
21
|
getPickerMonthProps: (monthIndex: number) => {
|
|
21
22
|
readonly isSelected: boolean | undefined;
|
|
23
|
+
readonly disabled: boolean | undefined;
|
|
22
24
|
readonly onClick: () => void;
|
|
23
25
|
readonly tabIndex: -1;
|
|
24
26
|
readonly "aria-label": string;
|
|
@@ -13,6 +13,10 @@ export interface CalendarProps {
|
|
|
13
13
|
onMonthChange?: (newMonth: DateValue) => void;
|
|
14
14
|
slots?: Partial<Record<CalendarSlot, React.ElementType>>;
|
|
15
15
|
rangeSelection?: boolean;
|
|
16
|
+
minDate?: DateValue;
|
|
17
|
+
maxDate?: DateValue;
|
|
18
|
+
disableFuture?: boolean;
|
|
19
|
+
disablePast?: boolean;
|
|
16
20
|
}
|
|
17
21
|
export interface CalendarOwnerState extends CalendarProps {
|
|
18
22
|
viewMonth: Date;
|
package/dist/index.js
CHANGED
|
@@ -440,6 +440,11 @@ var useCalendar = (ownerState) => {
|
|
|
440
440
|
isSelected,
|
|
441
441
|
onClick: handleDayClick,
|
|
442
442
|
onMouseEnter: ownerState.rangeSelection && ownerState.value?.[0] && !ownerState.value?.[1] ? () => setHoverDay(thisDay) : void 0,
|
|
443
|
+
disabled: ownerState.minDate && thisDay < ownerState.minDate || ownerState.maxDate && thisDay > ownerState.maxDate || ownerState.disableFuture && thisDay > /* @__PURE__ */ new Date() || ownerState.disablePast && thisDay < (() => {
|
|
444
|
+
const today = /* @__PURE__ */ new Date();
|
|
445
|
+
today.setHours(0, 0, 0, 0);
|
|
446
|
+
return today;
|
|
447
|
+
})(),
|
|
443
448
|
tabIndex: -1,
|
|
444
449
|
"aria-label": thisDay.toLocaleDateString(),
|
|
445
450
|
"aria-selected": isSelected ? "true" : void 0,
|
|
@@ -451,6 +456,10 @@ var useCalendar = (ownerState) => {
|
|
|
451
456
|
ownerState.value,
|
|
452
457
|
ownerState.viewMonth,
|
|
453
458
|
ownerState.rangeSelection,
|
|
459
|
+
ownerState.minDate,
|
|
460
|
+
ownerState.maxDate,
|
|
461
|
+
ownerState.disableFuture,
|
|
462
|
+
ownerState.disablePast,
|
|
454
463
|
hoverDay
|
|
455
464
|
]
|
|
456
465
|
),
|
|
@@ -467,6 +476,16 @@ var useCalendar = (ownerState) => {
|
|
|
467
476
|
};
|
|
468
477
|
return {
|
|
469
478
|
isSelected,
|
|
479
|
+
disabled: ownerState.minDate && (() => {
|
|
480
|
+
const lastDay = new Date(thisMonth);
|
|
481
|
+
lastDay.setMonth(lastDay.getMonth() + 1);
|
|
482
|
+
lastDay.setDate(0);
|
|
483
|
+
return lastDay < ownerState.minDate;
|
|
484
|
+
})() || ownerState.maxDate && (() => {
|
|
485
|
+
const lastDay = new Date(thisMonth);
|
|
486
|
+
lastDay.setDate(0);
|
|
487
|
+
return lastDay > ownerState.maxDate;
|
|
488
|
+
})() || ownerState.disableFuture && thisMonth > /* @__PURE__ */ new Date() || ownerState.disablePast && thisMonth < /* @__PURE__ */ new Date(),
|
|
470
489
|
onClick: handleMonthClick,
|
|
471
490
|
tabIndex: -1,
|
|
472
491
|
"aria-label": getMonthName(thisMonth, ownerState.locale || "default")
|
|
@@ -478,7 +497,11 @@ var useCalendar = (ownerState) => {
|
|
|
478
497
|
ownerState.onChange,
|
|
479
498
|
ownerState.viewMonth,
|
|
480
499
|
ownerState.locale,
|
|
481
|
-
ownerState.value
|
|
500
|
+
ownerState.value,
|
|
501
|
+
ownerState.minDate,
|
|
502
|
+
ownerState.maxDate,
|
|
503
|
+
ownerState.disableFuture,
|
|
504
|
+
ownerState.disablePast
|
|
482
505
|
]
|
|
483
506
|
)
|
|
484
507
|
};
|
|
@@ -1407,7 +1430,7 @@ var MotionInput = motion10(JoyInput);
|
|
|
1407
1430
|
var Input = (props) => {
|
|
1408
1431
|
const { label, helperText, error, style, ...innerProps } = props;
|
|
1409
1432
|
if (label) {
|
|
1410
|
-
return /* @__PURE__ */ React11.createElement(FormControl, { error }, /* @__PURE__ */ React11.createElement(FormLabel, null, label), /* @__PURE__ */ React11.createElement(MotionInput, { color: error ? "danger" : innerProps.color
|
|
1433
|
+
return /* @__PURE__ */ React11.createElement(FormControl, { error }, /* @__PURE__ */ React11.createElement(FormLabel, null, label), /* @__PURE__ */ React11.createElement(MotionInput, { ...innerProps, color: error ? "danger" : innerProps.color }), helperText && /* @__PURE__ */ React11.createElement(FormHelperText, null, helperText));
|
|
1411
1434
|
}
|
|
1412
1435
|
return /* @__PURE__ */ React11.createElement(MotionInput, { ...innerProps });
|
|
1413
1436
|
};
|
|
@@ -1717,7 +1740,7 @@ var DateRangePicker = forwardRef5(
|
|
|
1717
1740
|
setValue(event.target.value);
|
|
1718
1741
|
onChange?.(event);
|
|
1719
1742
|
},
|
|
1720
|
-
[]
|
|
1743
|
+
[onChange]
|
|
1721
1744
|
);
|
|
1722
1745
|
const handleCalendarToggle = useCallback5(
|
|
1723
1746
|
(event) => {
|
|
@@ -1974,7 +1997,7 @@ Option.displayName = "Option";
|
|
|
1974
1997
|
function Select(props) {
|
|
1975
1998
|
const { label, helperText, error, ...innerProps } = props;
|
|
1976
1999
|
if (label) {
|
|
1977
|
-
return /* @__PURE__ */ React20.createElement(FormControl, { error }, /* @__PURE__ */ React20.createElement(FormLabel, null, label), /* @__PURE__ */ React20.createElement(JoySelect, { color: error ? "danger" : innerProps.color
|
|
2000
|
+
return /* @__PURE__ */ React20.createElement(FormControl, { error }, /* @__PURE__ */ React20.createElement(FormLabel, null, label), /* @__PURE__ */ React20.createElement(JoySelect, { ...innerProps, color: error ? "danger" : innerProps.color }), helperText && /* @__PURE__ */ React20.createElement(FormHelperText, null, helperText));
|
|
1978
2001
|
}
|
|
1979
2002
|
return /* @__PURE__ */ React20.createElement(JoySelect, { ...innerProps });
|
|
1980
2003
|
}
|
package/framer/index.js
CHANGED
|
@@ -35856,6 +35856,11 @@ var useCalendar = (ownerState) => {
|
|
|
35856
35856
|
isSelected,
|
|
35857
35857
|
onClick: handleDayClick,
|
|
35858
35858
|
onMouseEnter: ownerState.rangeSelection && ((_a = ownerState.value) == null ? void 0 : _a[0]) && !((_b = ownerState.value) == null ? void 0 : _b[1]) ? () => setHoverDay(thisDay) : void 0,
|
|
35859
|
+
disabled: ownerState.minDate && thisDay < ownerState.minDate || ownerState.maxDate && thisDay > ownerState.maxDate || ownerState.disableFuture && thisDay > /* @__PURE__ */ new Date() || ownerState.disablePast && thisDay < (() => {
|
|
35860
|
+
const today = /* @__PURE__ */ new Date();
|
|
35861
|
+
today.setHours(0, 0, 0, 0);
|
|
35862
|
+
return today;
|
|
35863
|
+
})(),
|
|
35859
35864
|
tabIndex: -1,
|
|
35860
35865
|
"aria-label": thisDay.toLocaleDateString(),
|
|
35861
35866
|
"aria-selected": isSelected ? "true" : void 0,
|
|
@@ -35867,6 +35872,10 @@ var useCalendar = (ownerState) => {
|
|
|
35867
35872
|
ownerState.value,
|
|
35868
35873
|
ownerState.viewMonth,
|
|
35869
35874
|
ownerState.rangeSelection,
|
|
35875
|
+
ownerState.minDate,
|
|
35876
|
+
ownerState.maxDate,
|
|
35877
|
+
ownerState.disableFuture,
|
|
35878
|
+
ownerState.disablePast,
|
|
35870
35879
|
hoverDay
|
|
35871
35880
|
]
|
|
35872
35881
|
),
|
|
@@ -35884,6 +35893,16 @@ var useCalendar = (ownerState) => {
|
|
|
35884
35893
|
};
|
|
35885
35894
|
return {
|
|
35886
35895
|
isSelected,
|
|
35896
|
+
disabled: ownerState.minDate && (() => {
|
|
35897
|
+
const lastDay = new Date(thisMonth);
|
|
35898
|
+
lastDay.setMonth(lastDay.getMonth() + 1);
|
|
35899
|
+
lastDay.setDate(0);
|
|
35900
|
+
return lastDay < ownerState.minDate;
|
|
35901
|
+
})() || ownerState.maxDate && (() => {
|
|
35902
|
+
const lastDay = new Date(thisMonth);
|
|
35903
|
+
lastDay.setDate(0);
|
|
35904
|
+
return lastDay > ownerState.maxDate;
|
|
35905
|
+
})() || ownerState.disableFuture && thisMonth > /* @__PURE__ */ new Date() || ownerState.disablePast && thisMonth < /* @__PURE__ */ new Date(),
|
|
35887
35906
|
onClick: handleMonthClick,
|
|
35888
35907
|
tabIndex: -1,
|
|
35889
35908
|
"aria-label": getMonthName(thisMonth, ownerState.locale || "default")
|
|
@@ -35895,7 +35914,11 @@ var useCalendar = (ownerState) => {
|
|
|
35895
35914
|
ownerState.onChange,
|
|
35896
35915
|
ownerState.viewMonth,
|
|
35897
35916
|
ownerState.locale,
|
|
35898
|
-
ownerState.value
|
|
35917
|
+
ownerState.value,
|
|
35918
|
+
ownerState.minDate,
|
|
35919
|
+
ownerState.maxDate,
|
|
35920
|
+
ownerState.disableFuture,
|
|
35921
|
+
ownerState.disablePast
|
|
35899
35922
|
]
|
|
35900
35923
|
)
|
|
35901
35924
|
};
|
|
@@ -40512,7 +40535,7 @@ var Input3 = (props) => {
|
|
|
40512
40535
|
if (label) {
|
|
40513
40536
|
return /* @__PURE__ */ jsxs2(FormControl3, { error, children: [
|
|
40514
40537
|
/* @__PURE__ */ jsx2(FormLabel3, { children: label }),
|
|
40515
|
-
/* @__PURE__ */ jsx2(MotionInput, __spreadValues({ color: error ? "danger" : innerProps.color }
|
|
40538
|
+
/* @__PURE__ */ jsx2(MotionInput, __spreadProps(__spreadValues({}, innerProps), { color: error ? "danger" : innerProps.color })),
|
|
40516
40539
|
helperText && /* @__PURE__ */ jsx2(FormHelperText3, { children: helperText })
|
|
40517
40540
|
] });
|
|
40518
40541
|
}
|
|
@@ -40822,7 +40845,7 @@ var DateRangePicker = forwardRef85(
|
|
|
40822
40845
|
setValue(event.target.value);
|
|
40823
40846
|
onChange == null ? void 0 : onChange(event);
|
|
40824
40847
|
},
|
|
40825
|
-
[]
|
|
40848
|
+
[onChange]
|
|
40826
40849
|
);
|
|
40827
40850
|
const handleCalendarToggle = useCallback29(
|
|
40828
40851
|
(event) => {
|
|
@@ -41064,7 +41087,7 @@ function Select3(props) {
|
|
|
41064
41087
|
if (label) {
|
|
41065
41088
|
return /* @__PURE__ */ jsxs2(FormControl3, { error, children: [
|
|
41066
41089
|
/* @__PURE__ */ jsx2(FormLabel3, { children: label }),
|
|
41067
|
-
/* @__PURE__ */ jsx2(Select_default, __spreadValues({ color: error ? "danger" : innerProps.color }
|
|
41090
|
+
/* @__PURE__ */ jsx2(Select_default, __spreadProps(__spreadValues({}, innerProps), { color: error ? "danger" : innerProps.color })),
|
|
41068
41091
|
helperText && /* @__PURE__ */ jsx2(FormHelperText3, { children: helperText })
|
|
41069
41092
|
] });
|
|
41070
41093
|
}
|