@ceed/ads 1.31.1 → 1.32.1-next.1
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/components/Calendar/hooks/use-calendar-props.d.ts +2 -0
- package/dist/components/Calendar/types.d.ts +10 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +4 -0
- package/dist/components/inputs/DateRangePicker.md +49 -0
- package/dist/index.browser.js +2 -2
- package/dist/index.browser.js.map +3 -3
- package/dist/index.cjs +262 -29
- package/dist/index.js +262 -29
- package/framer/index.js +1 -1
- package/package.json +3 -2
|
@@ -16,6 +16,7 @@ export declare const useCalendarProps: (inProps: CalendarProps) => readonly [{
|
|
|
16
16
|
disableFuture?: boolean | undefined;
|
|
17
17
|
disablePast?: boolean | undefined;
|
|
18
18
|
shouldDisableDate?: ((date: Date) => boolean) | undefined;
|
|
19
|
+
numberOfMonths?: number | undefined;
|
|
19
20
|
}, {
|
|
20
21
|
viewMonth: Date;
|
|
21
22
|
direction: number;
|
|
@@ -34,4 +35,5 @@ export declare const useCalendarProps: (inProps: CalendarProps) => readonly [{
|
|
|
34
35
|
disableFuture?: boolean | undefined;
|
|
35
36
|
disablePast?: boolean | undefined;
|
|
36
37
|
shouldDisableDate?: ((date: Date) => boolean) | undefined;
|
|
38
|
+
numberOfMonths?: number | undefined;
|
|
37
39
|
}];
|
|
@@ -24,8 +24,18 @@ export interface CalendarProps {
|
|
|
24
24
|
* @returns If `true` the date will be disabled
|
|
25
25
|
*/
|
|
26
26
|
shouldDisableDate?: (date: DateValue) => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Number of months to display side by side. Defaults to 1.
|
|
29
|
+
*/
|
|
30
|
+
numberOfMonths?: number;
|
|
27
31
|
}
|
|
28
32
|
export interface CalendarOwnerState extends CalendarProps {
|
|
29
33
|
viewMonth: Date;
|
|
30
34
|
direction: number;
|
|
35
|
+
/** Shared hover day state for multi-month coordination */
|
|
36
|
+
hoverDay?: Date | null;
|
|
37
|
+
onHoverDayChange?: (day: Date | null) => void;
|
|
38
|
+
/** Shared hover month state for multi-month coordination */
|
|
39
|
+
hoverMonth?: Date | null;
|
|
40
|
+
onHoverMonthChange?: (month: Date | null) => void;
|
|
31
41
|
}
|
|
@@ -46,6 +46,10 @@ interface BaseDateRangePickerProps {
|
|
|
46
46
|
* 달력 옆에 표시할 프리셋 목록. 각 항목의 value는 format prop의 형식을 따라야 한다.
|
|
47
47
|
*/
|
|
48
48
|
presets?: DateRangePickerPreset[];
|
|
49
|
+
/**
|
|
50
|
+
* 팝오버에 표시할 달력의 수. 기본값은 1.
|
|
51
|
+
*/
|
|
52
|
+
numberOfMonths?: number;
|
|
49
53
|
}
|
|
50
54
|
export type DateRangePickerProps = BaseDateRangePickerProps & Omit<React.ComponentProps<typeof Input>, 'onChange' | 'value' | 'defaultValue'>;
|
|
51
55
|
declare const DateRangePicker: React.ForwardRefExoticComponent<Omit<DateRangePickerProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -29,6 +29,7 @@ DateRangePicker is ideal for booking systems, reporting filters, scheduling, and
|
|
|
29
29
|
| inputReadOnly | — | — |
|
|
30
30
|
| hideClearButton | — | — |
|
|
31
31
|
| size | — | — |
|
|
32
|
+
| numberOfMonths | — | — |
|
|
32
33
|
|
|
33
34
|
> **Use built-in form props**
|
|
34
35
|
>
|
|
@@ -337,6 +338,53 @@ Fully read-only state where neither typing nor calendar selection is available.
|
|
|
337
338
|
/>
|
|
338
339
|
```
|
|
339
340
|
|
|
341
|
+
## Dual Calendar
|
|
342
|
+
|
|
343
|
+
Use the `numberOfMonths` prop to display two calendar months side by side in the popup. This gives users a wider view of the date range without navigating back and forth, and is especially useful for selecting ranges that span across months.
|
|
344
|
+
|
|
345
|
+
```tsx
|
|
346
|
+
<DateRangePicker
|
|
347
|
+
onChange={onChange}
|
|
348
|
+
numberOfMonths={2}
|
|
349
|
+
label="Date Range"
|
|
350
|
+
/>
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
When combined with `presets`, the dual calendar provides a fast, at-a-glance interface for report and analytics date filters.
|
|
354
|
+
|
|
355
|
+
```tsx
|
|
356
|
+
<DateRangePicker {...args} value={value} onChange={e => {
|
|
357
|
+
setValue(e.target.value);
|
|
358
|
+
args.onChange?.(e);
|
|
359
|
+
}} disableFuture presets={[{
|
|
360
|
+
label: 'Today',
|
|
361
|
+
value: `${fmt(today)} - ${fmt(today)}`
|
|
362
|
+
}, {
|
|
363
|
+
label: 'Last 7 days',
|
|
364
|
+
value: range(7)
|
|
365
|
+
}, {
|
|
366
|
+
label: 'Last 1 month',
|
|
367
|
+
value: range(1, 'months')
|
|
368
|
+
}, {
|
|
369
|
+
label: 'Last 3 months',
|
|
370
|
+
value: range(3, 'months')
|
|
371
|
+
}, {
|
|
372
|
+
label: 'Last 6 months',
|
|
373
|
+
value: range(6, 'months')
|
|
374
|
+
}]} />
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
```tsx
|
|
378
|
+
<DateRangePicker numberOfMonths={2} label="Date Range" />
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
**Navigation behavior with two calendars:**
|
|
382
|
+
|
|
383
|
+
- The left calendar shows only the **previous** (◀) button.
|
|
384
|
+
- The right calendar shows only the **next** (▶) button.
|
|
385
|
+
- Each click advances the view by **1 month**, keeping the two calendars consecutive.
|
|
386
|
+
- Range selection and hover preview work across both calendars seamlessly.
|
|
387
|
+
|
|
340
388
|
## Additional Options
|
|
341
389
|
|
|
342
390
|
### Presets
|
|
@@ -584,6 +632,7 @@ const getDuration = (value) => {
|
|
|
584
632
|
| `disablePast` | `boolean` | `false` | Disables all past dates |
|
|
585
633
|
| `inputReadOnly` | `boolean` | `false` | Prevents keyboard typing (calendar-only input) |
|
|
586
634
|
| `hideClearButton` | `boolean` | `false` | Hides the clear button in the calendar popup |
|
|
635
|
+
| `numberOfMonths` | `number` | `1` | Number of calendar months to show side by side in the popup |
|
|
587
636
|
|
|
588
637
|
### Alphabetic Month Tokens (MMM / MMMM)
|
|
589
638
|
|