@klinking/colander 0.0.0 → 2.0.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/formats/date.cjs +51 -48
- package/dist/formats/date.d.cts +10 -37
- package/dist/formats/date.d.mts +10 -37
- package/dist/formats/date.mjs +6 -2
- package/dist/formats/object.cjs +51 -48
- package/dist/formats/object.d.cts +10 -37
- package/dist/formats/object.d.mts +10 -37
- package/dist/formats/object.mjs +6 -2
- package/dist/formats/plain-date-time.cjs +51 -48
- package/dist/formats/plain-date-time.d.cts +10 -37
- package/dist/formats/plain-date-time.d.mts +10 -37
- package/dist/formats/plain-date-time.mjs +6 -2
- package/dist/formats/plain-date.cjs +51 -48
- package/dist/formats/plain-date.d.cts +10 -37
- package/dist/formats/plain-date.d.mts +10 -37
- package/dist/formats/plain-date.mjs +6 -2
- package/dist/formats/plain-month-day.cjs +51 -48
- package/dist/formats/plain-month-day.d.cts +10 -37
- package/dist/formats/plain-month-day.d.mts +10 -37
- package/dist/formats/plain-month-day.mjs +6 -2
- package/dist/formats/plain-year-month.cjs +51 -48
- package/dist/formats/plain-year-month.d.cts +10 -37
- package/dist/formats/plain-year-month.d.mts +10 -37
- package/dist/formats/plain-year-month.mjs +6 -2
- package/dist/formats/zoned-date-time.cjs +51 -48
- package/dist/formats/zoned-date-time.d.cts +10 -37
- package/dist/formats/zoned-date-time.d.mts +10 -37
- package/dist/formats/zoned-date-time.mjs +6 -2
- package/dist/index.cjs +47 -48
- package/dist/index.d.cts +11 -2
- package/dist/index.d.mts +11 -2
- package/dist/index.mjs +2 -2
- package/dist/{temporal-polyfill-DTx0VIX5.mjs → weeks-navigation-B-Nch3LS.mjs} +357 -562
- package/dist/{temporal-polyfill-DU8VfleL.cjs → weeks-navigation-FxcECgCR.cjs} +357 -568
- package/dist/{weeks-view-context-BN6qR-83.d.mts → weeks-view-context-BZeWx9N8.d.cts} +275 -258
- package/dist/{weeks-view-context-aHGgYkpt.d.cts → weeks-view-context-MVe1b-BS.d.mts} +275 -258
- package/package.json +20 -20
- package/src/calendar-context.ts +12 -5
- package/src/calendar-provider.test.tsx +18 -4
- package/src/calendar-provider.tsx +130 -35
- package/src/calendar-types.ts +21 -4
- package/src/compute-weeks-in-window.test.ts +9 -7
- package/src/context.ts +1 -1
- package/src/day-cell.test.tsx +109 -0
- package/src/day-cell.tsx +132 -49
- package/src/drag-handle.tsx +23 -24
- package/src/formats/date.ts +120 -56
- package/src/formats/formats.test.ts +8 -4
- package/src/formats/object.ts +120 -56
- package/src/formats/plain-date-time.ts +120 -56
- package/src/formats/plain-date.ts +120 -56
- package/src/formats/plain-month-day.ts +120 -56
- package/src/formats/plain-year-month.ts +120 -56
- package/src/formats/zoned-date-time.ts +120 -56
- package/src/grid-header.tsx +24 -18
- package/src/grid.event-perf.test.tsx +30 -13
- package/src/grid.perf.test.tsx +97 -33
- package/src/grid.tsx +75 -43
- package/src/index.ts +16 -4
- package/src/keyboard.test.ts +110 -42
- package/src/keyboard.ts +18 -7
- package/src/month-separator.test.tsx +3 -1
- package/src/month-separator.tsx +30 -9
- package/src/month-view-context.ts +8 -3
- package/src/month-view-types.ts +14 -10
- package/src/month-view.test.tsx +687 -68
- package/src/month-view.tsx +176 -71
- package/src/navigation.tsx +77 -47
- package/src/overflow.test.ts +15 -13
- package/src/overflow.ts +10 -2
- package/src/range-preview.tsx +37 -12
- package/src/resolve-first-week.test.ts +14 -10
- package/src/resolve-first-week.ts +6 -2
- package/src/root-selection.ts +185 -101
- package/src/selected-range.tsx +47 -22
- package/src/test-temporal.ts +0 -2
- package/src/types.ts +126 -103
- package/src/utils.bench.ts +30 -6
- package/src/utils.test.ts +203 -55
- package/src/utils.ts +156 -54
- package/src/view-context.ts +4 -1
- package/src/week-number.tsx +5 -8
- package/src/weeks-grid.tsx +45 -19
- package/src/weeks-keyboard.test.ts +6 -7
- package/src/weeks-keyboard.ts +8 -3
- package/src/weeks-navigation.tsx +21 -9
- package/src/weeks-view-context.ts +8 -3
- package/src/weeks-view-state.ts +100 -33
- package/src/weeks-view-types.ts +14 -8
- package/src/weeks-view.test.tsx +127 -19
- package/src/weeks-view.tsx +30 -12
- package/src/temporal-polyfill.test.ts +0 -317
- package/src/temporal-polyfill.ts +0 -566
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
3
1
|
import * as _$react from "react";
|
|
4
2
|
import React$1 from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
5
|
|
|
6
6
|
//#region ../node_modules/.pnpm/@js-temporal+polyfill@0.5.1/node_modules/@js-temporal/polyfill/index.d.ts
|
|
7
|
-
declare namespace Temporal
|
|
7
|
+
declare namespace Temporal {
|
|
8
8
|
export type ComparisonResult = -1 | 0 | 1;
|
|
9
9
|
export type RoundingMode = 'ceil' | 'floor' | 'expand' | 'trunc' | 'halfCeil' | 'halfFloor' | 'halfExpand' | 'halfTrunc' | 'halfEven';
|
|
10
10
|
/**
|
|
@@ -380,7 +380,7 @@ declare namespace Temporal$1 {
|
|
|
380
380
|
* time zone transitions and all days will be assumed to be 24 hours
|
|
381
381
|
* long.
|
|
382
382
|
*/
|
|
383
|
-
relativeTo?: Temporal
|
|
383
|
+
relativeTo?: Temporal.PlainDateTime | Temporal.ZonedDateTime | PlainDateTimeLike | ZonedDateTimeLike | string;
|
|
384
384
|
});
|
|
385
385
|
/**
|
|
386
386
|
* Options to control behavior of `Duration.prototype.total()`
|
|
@@ -412,7 +412,7 @@ declare namespace Temporal$1 {
|
|
|
412
412
|
* this option is omitted), then the operation will ignore time zone
|
|
413
413
|
* transitions and all days will be assumed to be 24 hours long.
|
|
414
414
|
*/
|
|
415
|
-
relativeTo?: Temporal
|
|
415
|
+
relativeTo?: Temporal.ZonedDateTime | Temporal.PlainDateTime | ZonedDateTimeLike | PlainDateTimeLike | string;
|
|
416
416
|
};
|
|
417
417
|
/**
|
|
418
418
|
* Options to control behavior of `Duration.compare()`
|
|
@@ -438,7 +438,7 @@ declare namespace Temporal$1 {
|
|
|
438
438
|
* this option is omitted), then the operation will ignore time zone
|
|
439
439
|
* transitions and all days will be assumed to be 24 hours long.
|
|
440
440
|
*/
|
|
441
|
-
relativeTo?: Temporal
|
|
441
|
+
relativeTo?: Temporal.ZonedDateTime | Temporal.PlainDateTime | ZonedDateTimeLike | PlainDateTimeLike | string;
|
|
442
442
|
}
|
|
443
443
|
/**
|
|
444
444
|
* Options to control behaviour of `ZonedDateTime.prototype.getTimeZoneTransition()`
|
|
@@ -470,8 +470,8 @@ declare namespace Temporal$1 {
|
|
|
470
470
|
* See https://tc39.es/proposal-temporal/docs/duration.html for more details.
|
|
471
471
|
*/
|
|
472
472
|
export class Duration {
|
|
473
|
-
static from(item: Temporal
|
|
474
|
-
static compare(one: Temporal
|
|
473
|
+
static from(item: Temporal.Duration | DurationLike | string): Temporal.Duration;
|
|
474
|
+
static compare(one: Temporal.Duration | DurationLike | string, two: Temporal.Duration | DurationLike | string, options?: DurationArithmeticOptions): ComparisonResult;
|
|
475
475
|
constructor(years?: number, months?: number, weeks?: number, days?: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number, microseconds?: number, nanoseconds?: number);
|
|
476
476
|
readonly sign: -1 | 0 | 1;
|
|
477
477
|
readonly blank: boolean;
|
|
@@ -485,12 +485,12 @@ declare namespace Temporal$1 {
|
|
|
485
485
|
readonly milliseconds: number;
|
|
486
486
|
readonly microseconds: number;
|
|
487
487
|
readonly nanoseconds: number;
|
|
488
|
-
negated(): Temporal
|
|
489
|
-
abs(): Temporal
|
|
490
|
-
with(durationLike: DurationLike): Temporal
|
|
491
|
-
add(other: Temporal
|
|
492
|
-
subtract(other: Temporal
|
|
493
|
-
round(roundTo: DurationRoundTo): Temporal
|
|
488
|
+
negated(): Temporal.Duration;
|
|
489
|
+
abs(): Temporal.Duration;
|
|
490
|
+
with(durationLike: DurationLike): Temporal.Duration;
|
|
491
|
+
add(other: Temporal.Duration | DurationLike | string): Temporal.Duration;
|
|
492
|
+
subtract(other: Temporal.Duration | DurationLike | string): Temporal.Duration;
|
|
493
|
+
round(roundTo: DurationRoundTo): Temporal.Duration;
|
|
494
494
|
total(totalOf: DurationTotalOf): number;
|
|
495
495
|
toLocaleString(locales?: LocalesArgument, options?: DurationFormatOptions): string;
|
|
496
496
|
toJSON(): string;
|
|
@@ -513,20 +513,20 @@ declare namespace Temporal$1 {
|
|
|
513
513
|
* See https://tc39.es/proposal-temporal/docs/instant.html for more details.
|
|
514
514
|
*/
|
|
515
515
|
export class Instant {
|
|
516
|
-
static fromEpochMilliseconds(epochMilliseconds: number): Temporal
|
|
517
|
-
static fromEpochNanoseconds(epochNanoseconds: bigint): Temporal
|
|
518
|
-
static from(item: Temporal
|
|
519
|
-
static compare(one: Temporal
|
|
516
|
+
static fromEpochMilliseconds(epochMilliseconds: number): Temporal.Instant;
|
|
517
|
+
static fromEpochNanoseconds(epochNanoseconds: bigint): Temporal.Instant;
|
|
518
|
+
static from(item: Temporal.Instant | string): Temporal.Instant;
|
|
519
|
+
static compare(one: Temporal.Instant | string, two: Temporal.Instant | string): ComparisonResult;
|
|
520
520
|
constructor(epochNanoseconds: bigint);
|
|
521
521
|
readonly epochMilliseconds: number;
|
|
522
522
|
readonly epochNanoseconds: bigint;
|
|
523
|
-
equals(other: Temporal
|
|
524
|
-
add(durationLike: Omit<Temporal
|
|
525
|
-
subtract(durationLike: Omit<Temporal
|
|
526
|
-
until(other: Temporal
|
|
527
|
-
since(other: Temporal
|
|
528
|
-
round(roundTo: RoundTo<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal
|
|
529
|
-
toZonedDateTimeISO(tzLike: TimeZoneLike): Temporal
|
|
523
|
+
equals(other: Temporal.Instant | string): boolean;
|
|
524
|
+
add(durationLike: Omit<Temporal.Duration | DurationLike, 'years' | 'months' | 'weeks' | 'days'> | string): Temporal.Instant;
|
|
525
|
+
subtract(durationLike: Omit<Temporal.Duration | DurationLike, 'years' | 'months' | 'weeks' | 'days'> | string): Temporal.Instant;
|
|
526
|
+
until(other: Temporal.Instant | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
|
|
527
|
+
since(other: Temporal.Instant | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
|
|
528
|
+
round(roundTo: RoundTo<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Instant;
|
|
529
|
+
toZonedDateTimeISO(tzLike: TimeZoneLike): Temporal.ZonedDateTime;
|
|
530
530
|
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
531
531
|
toJSON(): string;
|
|
532
532
|
toString(options?: InstantToStringOptions): string;
|
|
@@ -556,8 +556,8 @@ declare namespace Temporal$1 {
|
|
|
556
556
|
* See https://tc39.es/proposal-temporal/docs/plaindate.html for more details.
|
|
557
557
|
*/
|
|
558
558
|
export class PlainDate {
|
|
559
|
-
static from(item: Temporal
|
|
560
|
-
static compare(one: Temporal
|
|
559
|
+
static from(item: Temporal.PlainDate | PlainDateLike | string, options?: AssignmentOptions): Temporal.PlainDate;
|
|
560
|
+
static compare(one: Temporal.PlainDate | PlainDateLike | string, two: Temporal.PlainDate | PlainDateLike | string): ComparisonResult;
|
|
561
561
|
constructor(isoYear: number, isoMonth: number, isoDay: number, calendar?: string);
|
|
562
562
|
readonly era: string | undefined;
|
|
563
563
|
readonly eraYear: number | undefined;
|
|
@@ -575,20 +575,20 @@ declare namespace Temporal$1 {
|
|
|
575
575
|
readonly daysInMonth: number;
|
|
576
576
|
readonly monthsInYear: number;
|
|
577
577
|
readonly inLeapYear: boolean;
|
|
578
|
-
equals(other: Temporal
|
|
579
|
-
with(dateLike: PlainDateLike, options?: AssignmentOptions): Temporal
|
|
580
|
-
withCalendar(calendar: CalendarLike): Temporal
|
|
581
|
-
add(durationLike: Temporal
|
|
582
|
-
subtract(durationLike: Temporal
|
|
583
|
-
until(other: Temporal
|
|
584
|
-
since(other: Temporal
|
|
585
|
-
toPlainDateTime(temporalTime?: Temporal
|
|
578
|
+
equals(other: Temporal.PlainDate | PlainDateLike | string): boolean;
|
|
579
|
+
with(dateLike: PlainDateLike, options?: AssignmentOptions): Temporal.PlainDate;
|
|
580
|
+
withCalendar(calendar: CalendarLike): Temporal.PlainDate;
|
|
581
|
+
add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDate;
|
|
582
|
+
subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDate;
|
|
583
|
+
until(other: Temporal.PlainDate | PlainDateLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day'>): Temporal.Duration;
|
|
584
|
+
since(other: Temporal.PlainDate | PlainDateLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day'>): Temporal.Duration;
|
|
585
|
+
toPlainDateTime(temporalTime?: Temporal.PlainTime | PlainTimeLike | string): Temporal.PlainDateTime;
|
|
586
586
|
toZonedDateTime(timeZoneAndTime: string | {
|
|
587
587
|
timeZone: TimeZoneLike;
|
|
588
|
-
plainTime?: Temporal
|
|
589
|
-
}): Temporal
|
|
590
|
-
toPlainYearMonth(): Temporal
|
|
591
|
-
toPlainMonthDay(): Temporal
|
|
588
|
+
plainTime?: Temporal.PlainTime | PlainTimeLike | string;
|
|
589
|
+
}): Temporal.ZonedDateTime;
|
|
590
|
+
toPlainYearMonth(): Temporal.PlainYearMonth;
|
|
591
|
+
toPlainMonthDay(): Temporal.PlainMonthDay;
|
|
592
592
|
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
593
593
|
toJSON(): string;
|
|
594
594
|
toString(options?: ShowCalendarOption): string;
|
|
@@ -621,8 +621,8 @@ declare namespace Temporal$1 {
|
|
|
621
621
|
* See https://tc39.es/proposal-temporal/docs/plaindatetime.html for more details.
|
|
622
622
|
*/
|
|
623
623
|
export class PlainDateTime {
|
|
624
|
-
static from(item: Temporal
|
|
625
|
-
static compare(one: Temporal
|
|
624
|
+
static from(item: Temporal.PlainDateTime | PlainDateTimeLike | string, options?: AssignmentOptions): Temporal.PlainDateTime;
|
|
625
|
+
static compare(one: Temporal.PlainDateTime | PlainDateTimeLike | string, two: Temporal.PlainDateTime | PlainDateTimeLike | string): ComparisonResult;
|
|
626
626
|
constructor(isoYear: number, isoMonth: number, isoDay: number, hour?: number, minute?: number, second?: number, millisecond?: number, microsecond?: number, nanosecond?: number, calendar?: string);
|
|
627
627
|
readonly era: string | undefined;
|
|
628
628
|
readonly eraYear: number | undefined;
|
|
@@ -646,18 +646,18 @@ declare namespace Temporal$1 {
|
|
|
646
646
|
readonly daysInMonth: number;
|
|
647
647
|
readonly monthsInYear: number;
|
|
648
648
|
readonly inLeapYear: boolean;
|
|
649
|
-
equals(other: Temporal
|
|
650
|
-
with(dateTimeLike: PlainDateTimeLike, options?: AssignmentOptions): Temporal
|
|
651
|
-
withPlainTime(timeLike?: Temporal
|
|
652
|
-
withCalendar(calendar: CalendarLike): Temporal
|
|
653
|
-
add(durationLike: Temporal
|
|
654
|
-
subtract(durationLike: Temporal
|
|
655
|
-
until(other: Temporal
|
|
656
|
-
since(other: Temporal
|
|
657
|
-
round(roundTo: RoundTo<'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal
|
|
658
|
-
toZonedDateTime(tzLike: TimeZoneLike, options?: ToInstantOptions): Temporal
|
|
659
|
-
toPlainDate(): Temporal
|
|
660
|
-
toPlainTime(): Temporal
|
|
649
|
+
equals(other: Temporal.PlainDateTime | PlainDateTimeLike | string): boolean;
|
|
650
|
+
with(dateTimeLike: PlainDateTimeLike, options?: AssignmentOptions): Temporal.PlainDateTime;
|
|
651
|
+
withPlainTime(timeLike?: Temporal.PlainTime | PlainTimeLike | string): Temporal.PlainDateTime;
|
|
652
|
+
withCalendar(calendar: CalendarLike): Temporal.PlainDateTime;
|
|
653
|
+
add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDateTime;
|
|
654
|
+
subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDateTime;
|
|
655
|
+
until(other: Temporal.PlainDateTime | PlainDateTimeLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
|
|
656
|
+
since(other: Temporal.PlainDateTime | PlainDateTimeLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
|
|
657
|
+
round(roundTo: RoundTo<'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.PlainDateTime;
|
|
658
|
+
toZonedDateTime(tzLike: TimeZoneLike, options?: ToInstantOptions): Temporal.ZonedDateTime;
|
|
659
|
+
toPlainDate(): Temporal.PlainDate;
|
|
660
|
+
toPlainTime(): Temporal.PlainTime;
|
|
661
661
|
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
662
662
|
toJSON(): string;
|
|
663
663
|
toString(options?: CalendarTypeToStringOptions): string;
|
|
@@ -681,16 +681,16 @@ declare namespace Temporal$1 {
|
|
|
681
681
|
* See https://tc39.es/proposal-temporal/docs/plainmonthday.html for more details.
|
|
682
682
|
*/
|
|
683
683
|
export class PlainMonthDay {
|
|
684
|
-
static from(item: Temporal
|
|
684
|
+
static from(item: Temporal.PlainMonthDay | PlainMonthDayLike | string, options?: AssignmentOptions): Temporal.PlainMonthDay;
|
|
685
685
|
constructor(isoMonth: number, isoDay: number, calendar?: string, referenceISOYear?: number);
|
|
686
686
|
readonly monthCode: string;
|
|
687
687
|
readonly day: number;
|
|
688
688
|
readonly calendarId: string;
|
|
689
|
-
equals(other: Temporal
|
|
690
|
-
with(monthDayLike: PlainMonthDayLike, options?: AssignmentOptions): Temporal
|
|
689
|
+
equals(other: Temporal.PlainMonthDay | PlainMonthDayLike | string): boolean;
|
|
690
|
+
with(monthDayLike: PlainMonthDayLike, options?: AssignmentOptions): Temporal.PlainMonthDay;
|
|
691
691
|
toPlainDate(year: {
|
|
692
692
|
year: number;
|
|
693
|
-
}): Temporal
|
|
693
|
+
}): Temporal.PlainDate;
|
|
694
694
|
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
695
695
|
toJSON(): string;
|
|
696
696
|
toString(options?: ShowCalendarOption): string;
|
|
@@ -721,8 +721,8 @@ declare namespace Temporal$1 {
|
|
|
721
721
|
* See https://tc39.es/proposal-temporal/docs/plaintime.html for more details.
|
|
722
722
|
*/
|
|
723
723
|
export class PlainTime {
|
|
724
|
-
static from(item: Temporal
|
|
725
|
-
static compare(one: Temporal
|
|
724
|
+
static from(item: Temporal.PlainTime | PlainTimeLike | string, options?: AssignmentOptions): Temporal.PlainTime;
|
|
725
|
+
static compare(one: Temporal.PlainTime | PlainTimeLike | string, two: Temporal.PlainTime | PlainTimeLike | string): ComparisonResult;
|
|
726
726
|
constructor(hour?: number, minute?: number, second?: number, millisecond?: number, microsecond?: number, nanosecond?: number);
|
|
727
727
|
readonly hour: number;
|
|
728
728
|
readonly minute: number;
|
|
@@ -730,13 +730,13 @@ declare namespace Temporal$1 {
|
|
|
730
730
|
readonly millisecond: number;
|
|
731
731
|
readonly microsecond: number;
|
|
732
732
|
readonly nanosecond: number;
|
|
733
|
-
equals(other: Temporal
|
|
734
|
-
with(timeLike: Temporal
|
|
735
|
-
add(durationLike: Temporal
|
|
736
|
-
subtract(durationLike: Temporal
|
|
737
|
-
until(other: Temporal
|
|
738
|
-
since(other: Temporal
|
|
739
|
-
round(roundTo: RoundTo<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal
|
|
733
|
+
equals(other: Temporal.PlainTime | PlainTimeLike | string): boolean;
|
|
734
|
+
with(timeLike: Temporal.PlainTime | PlainTimeLike, options?: AssignmentOptions): Temporal.PlainTime;
|
|
735
|
+
add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainTime;
|
|
736
|
+
subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainTime;
|
|
737
|
+
until(other: Temporal.PlainTime | PlainTimeLike | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
|
|
738
|
+
since(other: Temporal.PlainTime | PlainTimeLike | string, options?: DifferenceOptions<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
|
|
739
|
+
round(roundTo: RoundTo<'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.PlainTime;
|
|
740
740
|
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
741
741
|
toJSON(): string;
|
|
742
742
|
toString(options?: ToStringPrecisionOptions): string;
|
|
@@ -768,8 +768,8 @@ declare namespace Temporal$1 {
|
|
|
768
768
|
* See https://tc39.es/proposal-temporal/docs/plainyearmonth.html for more details.
|
|
769
769
|
*/
|
|
770
770
|
export class PlainYearMonth {
|
|
771
|
-
static from(item: Temporal
|
|
772
|
-
static compare(one: Temporal
|
|
771
|
+
static from(item: Temporal.PlainYearMonth | PlainYearMonthLike | string, options?: AssignmentOptions): Temporal.PlainYearMonth;
|
|
772
|
+
static compare(one: Temporal.PlainYearMonth | PlainYearMonthLike | string, two: Temporal.PlainYearMonth | PlainYearMonthLike | string): ComparisonResult;
|
|
773
773
|
constructor(isoYear: number, isoMonth: number, calendar?: string, referenceISODay?: number);
|
|
774
774
|
readonly era: string | undefined;
|
|
775
775
|
readonly eraYear: number | undefined;
|
|
@@ -781,15 +781,15 @@ declare namespace Temporal$1 {
|
|
|
781
781
|
readonly daysInYear: number;
|
|
782
782
|
readonly monthsInYear: number;
|
|
783
783
|
readonly inLeapYear: boolean;
|
|
784
|
-
equals(other: Temporal
|
|
785
|
-
with(yearMonthLike: PlainYearMonthLike, options?: AssignmentOptions): Temporal
|
|
786
|
-
add(durationLike: Temporal
|
|
787
|
-
subtract(durationLike: Temporal
|
|
788
|
-
until(other: Temporal
|
|
789
|
-
since(other: Temporal
|
|
784
|
+
equals(other: Temporal.PlainYearMonth | PlainYearMonthLike | string): boolean;
|
|
785
|
+
with(yearMonthLike: PlainYearMonthLike, options?: AssignmentOptions): Temporal.PlainYearMonth;
|
|
786
|
+
add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainYearMonth;
|
|
787
|
+
subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainYearMonth;
|
|
788
|
+
until(other: Temporal.PlainYearMonth | PlainYearMonthLike | string, options?: DifferenceOptions<'year' | 'month'>): Temporal.Duration;
|
|
789
|
+
since(other: Temporal.PlainYearMonth | PlainYearMonthLike | string, options?: DifferenceOptions<'year' | 'month'>): Temporal.Duration;
|
|
790
790
|
toPlainDate(day: {
|
|
791
791
|
day: number;
|
|
792
|
-
}): Temporal
|
|
792
|
+
}): Temporal.PlainDate;
|
|
793
793
|
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
794
794
|
toJSON(): string;
|
|
795
795
|
toString(options?: ShowCalendarOption): string;
|
|
@@ -814,8 +814,8 @@ declare namespace Temporal$1 {
|
|
|
814
814
|
calendar?: CalendarLike;
|
|
815
815
|
};
|
|
816
816
|
export class ZonedDateTime {
|
|
817
|
-
static from(item: Temporal
|
|
818
|
-
static compare(one: Temporal
|
|
817
|
+
static from(item: Temporal.ZonedDateTime | ZonedDateTimeLike | string, options?: ZonedDateTimeAssignmentOptions): ZonedDateTime;
|
|
818
|
+
static compare(one: Temporal.ZonedDateTime | ZonedDateTimeLike | string, two: Temporal.ZonedDateTime | ZonedDateTimeLike | string): ComparisonResult;
|
|
819
819
|
constructor(epochNanoseconds: bigint, timeZone: string, calendar?: string);
|
|
820
820
|
readonly era: string | undefined;
|
|
821
821
|
readonly eraYear: number | undefined;
|
|
@@ -845,22 +845,22 @@ declare namespace Temporal$1 {
|
|
|
845
845
|
readonly offset: string;
|
|
846
846
|
readonly epochMilliseconds: number;
|
|
847
847
|
readonly epochNanoseconds: bigint;
|
|
848
|
-
equals(other: Temporal
|
|
849
|
-
with(zonedDateTimeLike: ZonedDateTimeLike, options?: ZonedDateTimeAssignmentOptions): Temporal
|
|
850
|
-
withPlainTime(timeLike?: Temporal
|
|
851
|
-
withCalendar(calendar: CalendarLike): Temporal
|
|
852
|
-
withTimeZone(timeZone: TimeZoneLike): Temporal
|
|
853
|
-
add(durationLike: Temporal
|
|
854
|
-
subtract(durationLike: Temporal
|
|
855
|
-
until(other: Temporal
|
|
856
|
-
since(other: Temporal
|
|
857
|
-
round(roundTo: RoundTo<'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal
|
|
858
|
-
startOfDay(): Temporal
|
|
859
|
-
getTimeZoneTransition(direction: TransitionDirection): Temporal
|
|
860
|
-
toInstant(): Temporal
|
|
861
|
-
toPlainDateTime(): Temporal
|
|
862
|
-
toPlainDate(): Temporal
|
|
863
|
-
toPlainTime(): Temporal
|
|
848
|
+
equals(other: Temporal.ZonedDateTime | ZonedDateTimeLike | string): boolean;
|
|
849
|
+
with(zonedDateTimeLike: ZonedDateTimeLike, options?: ZonedDateTimeAssignmentOptions): Temporal.ZonedDateTime;
|
|
850
|
+
withPlainTime(timeLike?: Temporal.PlainTime | PlainTimeLike | string): Temporal.ZonedDateTime;
|
|
851
|
+
withCalendar(calendar: CalendarLike): Temporal.ZonedDateTime;
|
|
852
|
+
withTimeZone(timeZone: TimeZoneLike): Temporal.ZonedDateTime;
|
|
853
|
+
add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.ZonedDateTime;
|
|
854
|
+
subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.ZonedDateTime;
|
|
855
|
+
until(other: Temporal.ZonedDateTime | ZonedDateTimeLike | string, options?: Temporal.DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
|
|
856
|
+
since(other: Temporal.ZonedDateTime | ZonedDateTimeLike | string, options?: Temporal.DifferenceOptions<'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.Duration;
|
|
857
|
+
round(roundTo: RoundTo<'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond'>): Temporal.ZonedDateTime;
|
|
858
|
+
startOfDay(): Temporal.ZonedDateTime;
|
|
859
|
+
getTimeZoneTransition(direction: TransitionDirection): Temporal.ZonedDateTime | null;
|
|
860
|
+
toInstant(): Temporal.Instant;
|
|
861
|
+
toPlainDateTime(): Temporal.PlainDateTime;
|
|
862
|
+
toPlainDate(): Temporal.PlainDate;
|
|
863
|
+
toPlainTime(): Temporal.PlainTime;
|
|
864
864
|
toLocaleString(locales?: LocalesArgument, options?: globalThis.Intl.DateTimeFormatOptions): string;
|
|
865
865
|
toJSON(): string;
|
|
866
866
|
toString(options?: ZonedDateTimeToStringOptions): string;
|
|
@@ -886,7 +886,7 @@ declare namespace Temporal$1 {
|
|
|
886
886
|
* exact time in a specific time zone, use `Temporal.Now.zonedDateTimeISO`
|
|
887
887
|
* or `Temporal.Now.zonedDateTime`.
|
|
888
888
|
* */
|
|
889
|
-
instant: () => Temporal
|
|
889
|
+
instant: () => Temporal.Instant;
|
|
890
890
|
/**
|
|
891
891
|
* Get the current calendar date and clock time in a specific time zone,
|
|
892
892
|
* using the ISO 8601 calendar.
|
|
@@ -896,7 +896,7 @@ declare namespace Temporal$1 {
|
|
|
896
896
|
* string (e.g. `'Europe/London'`). If omitted, the environment's
|
|
897
897
|
* current time zone will be used.
|
|
898
898
|
*/
|
|
899
|
-
zonedDateTimeISO: (tzLike?: TimeZoneLike) => Temporal
|
|
899
|
+
zonedDateTimeISO: (tzLike?: TimeZoneLike) => Temporal.ZonedDateTime;
|
|
900
900
|
/**
|
|
901
901
|
* Get the current date and clock time in a specific time zone, using the
|
|
902
902
|
* ISO 8601 calendar.
|
|
@@ -911,7 +911,7 @@ declare namespace Temporal$1 {
|
|
|
911
911
|
* string (e.g. `'Europe/London'`). If omitted, the environment's
|
|
912
912
|
* current time zone will be used.
|
|
913
913
|
*/
|
|
914
|
-
plainDateTimeISO: (tzLike?: TimeZoneLike) => Temporal
|
|
914
|
+
plainDateTimeISO: (tzLike?: TimeZoneLike) => Temporal.PlainDateTime;
|
|
915
915
|
/**
|
|
916
916
|
* Get the current date in a specific time zone, using the ISO 8601
|
|
917
917
|
* calendar.
|
|
@@ -921,7 +921,7 @@ declare namespace Temporal$1 {
|
|
|
921
921
|
* string (e.g. `'Europe/London'`). If omitted, the environment's
|
|
922
922
|
* current time zone will be used.
|
|
923
923
|
*/
|
|
924
|
-
plainDateISO: (tzLike?: TimeZoneLike) => Temporal
|
|
924
|
+
plainDateISO: (tzLike?: TimeZoneLike) => Temporal.PlainDate;
|
|
925
925
|
/**
|
|
926
926
|
* Get the current clock time in a specific time zone, using the ISO 8601 calendar.
|
|
927
927
|
*
|
|
@@ -930,7 +930,7 @@ declare namespace Temporal$1 {
|
|
|
930
930
|
* string (e.g. `'Europe/London'`). If omitted, the environment's
|
|
931
931
|
* current time zone will be used.
|
|
932
932
|
*/
|
|
933
|
-
plainTimeISO: (tzLike?: TimeZoneLike) => Temporal
|
|
933
|
+
plainTimeISO: (tzLike?: TimeZoneLike) => Temporal.PlainTime;
|
|
934
934
|
/**
|
|
935
935
|
* Get the identifier of the environment's current time zone.
|
|
936
936
|
*
|
|
@@ -943,7 +943,7 @@ declare namespace Temporal$1 {
|
|
|
943
943
|
};
|
|
944
944
|
}
|
|
945
945
|
declare namespace Intl$1 {
|
|
946
|
-
type Formattable = Date | Temporal
|
|
946
|
+
type Formattable = Date | Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate | Temporal.PlainTime | Temporal.PlainDateTime | Temporal.PlainYearMonth | Temporal.PlainMonthDay;
|
|
947
947
|
export interface DateTimeFormat extends globalThis.Intl.DateTimeFormat {
|
|
948
948
|
/**
|
|
949
949
|
* Format a date into a string according to the locale and formatting
|
|
@@ -999,7 +999,7 @@ declare namespace Intl$1 {
|
|
|
999
999
|
//#region src/context.d.ts
|
|
1000
1000
|
/** @internal Provides the days and index of the current week row to child components. */
|
|
1001
1001
|
declare const WeekDataContext: _$react.Context<{
|
|
1002
|
-
days: Temporal
|
|
1002
|
+
days: Temporal.PlainDate[];
|
|
1003
1003
|
weekIndex: number; /** The year/month this week belongs to (for outsideMonth checks in multi-month). */
|
|
1004
1004
|
gridMonth?: {
|
|
1005
1005
|
year: number;
|
|
@@ -1015,8 +1015,8 @@ declare const GridContext: _$react.Context<{
|
|
|
1015
1015
|
}>;
|
|
1016
1016
|
/** @internal Provides the date and column index from a `DayCellTemplate` to its child `DayButton`. */
|
|
1017
1017
|
declare const DayCellDataContext: _$react.Context<{
|
|
1018
|
-
date: Temporal
|
|
1019
|
-
columnIndex?: number;
|
|
1018
|
+
date: Temporal.PlainDate;
|
|
1019
|
+
columnIndex?: number | undefined;
|
|
1020
1020
|
outsideDisabled?: boolean;
|
|
1021
1021
|
} | null>;
|
|
1022
1022
|
//#endregion
|
|
@@ -1045,25 +1045,25 @@ type RangeMode = "start-end" | "nearest-end" | "nearest-start" | "adjust-end" |
|
|
|
1045
1045
|
type TemporalNamespace = {
|
|
1046
1046
|
Now: {
|
|
1047
1047
|
timeZoneId(): string;
|
|
1048
|
-
zonedDateTimeISO(tz: string): Temporal
|
|
1049
|
-
plainDateISO(): Temporal
|
|
1048
|
+
zonedDateTimeISO(tz: string): Temporal.ZonedDateTime;
|
|
1049
|
+
plainDateISO(): Temporal.PlainDate;
|
|
1050
1050
|
};
|
|
1051
1051
|
PlainDate: {
|
|
1052
1052
|
from(item: any, options?: {
|
|
1053
1053
|
overflow?: string;
|
|
1054
|
-
}): Temporal
|
|
1055
|
-
compare(a: Temporal
|
|
1054
|
+
}): Temporal.PlainDate;
|
|
1055
|
+
compare(a: Temporal.PlainDate, b: Temporal.PlainDate): number;
|
|
1056
1056
|
};
|
|
1057
1057
|
PlainDateTime: {
|
|
1058
1058
|
from(item: any, options?: {
|
|
1059
1059
|
overflow?: string;
|
|
1060
|
-
}): Temporal
|
|
1060
|
+
}): Temporal.PlainDateTime;
|
|
1061
1061
|
};
|
|
1062
1062
|
PlainMonthDay: {
|
|
1063
|
-
from(item: any): Temporal
|
|
1063
|
+
from(item: any): Temporal.PlainMonthDay;
|
|
1064
1064
|
};
|
|
1065
1065
|
PlainYearMonth: {
|
|
1066
|
-
from(item: any): Temporal
|
|
1066
|
+
from(item: any): Temporal.PlainYearMonth;
|
|
1067
1067
|
};
|
|
1068
1068
|
};
|
|
1069
1069
|
/** Plain JS object representation of a date with optional time and time zone fields. */
|
|
@@ -1079,22 +1079,22 @@ interface PlainDateObject {
|
|
|
1079
1079
|
/** Tagged union of all supported date value formats and their runtime values. */
|
|
1080
1080
|
type DateValueObject = {
|
|
1081
1081
|
format: "PlainDate";
|
|
1082
|
-
value: Temporal
|
|
1082
|
+
value: Temporal.PlainDate;
|
|
1083
1083
|
} | {
|
|
1084
1084
|
format: "PlainDateTime";
|
|
1085
|
-
value: Temporal
|
|
1085
|
+
value: Temporal.PlainDateTime;
|
|
1086
1086
|
} | {
|
|
1087
1087
|
format: "PlainMonthDay";
|
|
1088
|
-
value: Temporal
|
|
1088
|
+
value: Temporal.PlainMonthDay;
|
|
1089
1089
|
} | {
|
|
1090
1090
|
format: "PlainTime";
|
|
1091
|
-
value: Temporal
|
|
1091
|
+
value: Temporal.PlainTime;
|
|
1092
1092
|
} | {
|
|
1093
1093
|
format: "PlainYearMonth";
|
|
1094
|
-
value: Temporal
|
|
1094
|
+
value: Temporal.PlainYearMonth;
|
|
1095
1095
|
} | {
|
|
1096
1096
|
format: "ZonedDateTime";
|
|
1097
|
-
value: Temporal
|
|
1097
|
+
value: Temporal.ZonedDateTime;
|
|
1098
1098
|
} | {
|
|
1099
1099
|
format: "object";
|
|
1100
1100
|
value: PlainDateObject;
|
|
@@ -1121,7 +1121,7 @@ type DateRange<F extends ValueFormat = ValueFormat> = {
|
|
|
1121
1121
|
*/
|
|
1122
1122
|
interface ValueChangeMeta<Previous> {
|
|
1123
1123
|
/** The specific date that was clicked, or `undefined` if the change was not triggered by a date selection (e.g. mode switch, out-of-bounds cleanup, drag). */
|
|
1124
|
-
date?: Temporal
|
|
1124
|
+
date?: Temporal.PlainDate;
|
|
1125
1125
|
/** The previous selection value before this change. */
|
|
1126
1126
|
previous: Previous;
|
|
1127
1127
|
}
|
|
@@ -1132,24 +1132,37 @@ interface MonthData {
|
|
|
1132
1132
|
/** Calendar month (1–12). */
|
|
1133
1133
|
month: number;
|
|
1134
1134
|
/** 2D array of weeks (each week is an array of `PlainDate`). */
|
|
1135
|
-
weeks: Temporal
|
|
1135
|
+
weeks: Temporal.PlainDate[][];
|
|
1136
1136
|
}
|
|
1137
|
-
/**
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1137
|
+
/**
|
|
1138
|
+
* State exposed by the `Root` component to its render function and descendants.
|
|
1139
|
+
*
|
|
1140
|
+
* All date values are `Temporal` objects (the internal representation), not the
|
|
1141
|
+
* configured value `format`. The format-typed values are delivered through the
|
|
1142
|
+
* `value`/`defaultValue`/`onValueChange` props; this state is for rendering, so
|
|
1143
|
+
* use e.g. `selected?.toLocaleString(locale)` to display.
|
|
1144
|
+
*/
|
|
1145
|
+
type RootState = {
|
|
1146
|
+
/** `true` when at least one date is selected. */hasSelection: boolean; /** The primary selected date (the first committed date), or `undefined`. */
|
|
1147
|
+
selected: Temporal.PlainDate | undefined; /** All currently selected dates (chronological in `multiple` mode). */
|
|
1148
|
+
selectedDates: Temporal.PlainDate[]; /** Range start, or `undefined`. */
|
|
1149
|
+
rangeStart: Temporal.PlainDate | undefined; /** Range end, or `undefined`. */
|
|
1150
|
+
rangeEnd: Temporal.PlainDate | undefined; /** The currently focused `PlainDate` in the grid. */
|
|
1151
|
+
focused: Temporal.PlainDate; /** The month/year currently being viewed. */
|
|
1152
|
+
viewing: Temporal.PlainYearMonth; /** Resolved IANA time zone. */
|
|
1146
1153
|
timeZone: string; /** Resolved BCP 47 locale. */
|
|
1147
1154
|
locale: string; /** Whether the calendar is read-only. */
|
|
1148
1155
|
readOnly: boolean;
|
|
1149
1156
|
};
|
|
1157
|
+
/**
|
|
1158
|
+
* The view-independent part of {@link RootState} (everything except `focused`
|
|
1159
|
+
* and `viewing`, which each view supplies). Built once by the provider and
|
|
1160
|
+
* shared so MonthView and WeeksView expose identical selection state.
|
|
1161
|
+
*/
|
|
1162
|
+
type BaseRootState = Omit<RootState, "focused" | "viewing">;
|
|
1150
1163
|
/** State exposed by the `DateString` component. */
|
|
1151
|
-
type DateStringState
|
|
1152
|
-
root: RootState
|
|
1164
|
+
type DateStringState = {
|
|
1165
|
+
root: RootState;
|
|
1153
1166
|
month: number;
|
|
1154
1167
|
year: number;
|
|
1155
1168
|
day: number;
|
|
@@ -1162,10 +1175,10 @@ interface DateStringOwnProps {
|
|
|
1162
1175
|
options?: Intl.DateTimeFormatOptions;
|
|
1163
1176
|
}
|
|
1164
1177
|
/** Full props for the `DateString` component. */
|
|
1165
|
-
type DateStringProps
|
|
1178
|
+
type DateStringProps = useRender.ComponentProps<"span", DateStringState> & DateStringOwnProps;
|
|
1166
1179
|
/** State exposed by the `TimeString` component. */
|
|
1167
|
-
type TimeStringState
|
|
1168
|
-
root: RootState
|
|
1180
|
+
type TimeStringState = {
|
|
1181
|
+
root: RootState;
|
|
1169
1182
|
hour: number;
|
|
1170
1183
|
minute: number;
|
|
1171
1184
|
second: number;
|
|
@@ -1178,10 +1191,10 @@ interface TimeStringOwnProps {
|
|
|
1178
1191
|
options?: Intl.DateTimeFormatOptions;
|
|
1179
1192
|
}
|
|
1180
1193
|
/** Full props for the `TimeString` component. */
|
|
1181
|
-
type TimeStringProps
|
|
1194
|
+
type TimeStringProps = useRender.ComponentProps<"span", TimeStringState> & TimeStringOwnProps;
|
|
1182
1195
|
/** State exposed by the `MonthYearString` component. */
|
|
1183
|
-
type MonthYearStringState
|
|
1184
|
-
root: RootState
|
|
1196
|
+
type MonthYearStringState = {
|
|
1197
|
+
root: RootState;
|
|
1185
1198
|
month: number;
|
|
1186
1199
|
year: number;
|
|
1187
1200
|
};
|
|
@@ -1195,21 +1208,21 @@ interface MonthYearStringOwnProps {
|
|
|
1195
1208
|
monthIndex?: number;
|
|
1196
1209
|
}
|
|
1197
1210
|
/** Full props for the `MonthYearString` component. */
|
|
1198
|
-
type MonthYearStringProps
|
|
1211
|
+
type MonthYearStringProps = useRender.ComponentProps<"span", MonthYearStringState> & MonthYearStringOwnProps;
|
|
1199
1212
|
/** State exposed by `PrevMonthButton` and `NextMonthButton`. */
|
|
1200
|
-
type NavButtonState
|
|
1201
|
-
root: RootState
|
|
1213
|
+
type NavButtonState = {
|
|
1214
|
+
root: RootState;
|
|
1202
1215
|
direction: "next" | "prev";
|
|
1203
1216
|
disabled: boolean;
|
|
1204
|
-
target: Temporal
|
|
1217
|
+
target: Temporal.PlainYearMonth;
|
|
1205
1218
|
};
|
|
1206
1219
|
/** Full props for the `PrevMonthButton` component. */
|
|
1207
|
-
type PrevMonthButtonProps
|
|
1220
|
+
type PrevMonthButtonProps = useRender.ComponentProps<"button", NavButtonState>;
|
|
1208
1221
|
/** Full props for the `NextMonthButton` component. */
|
|
1209
|
-
type NextMonthButtonProps
|
|
1222
|
+
type NextMonthButtonProps = useRender.ComponentProps<"button", NavButtonState>;
|
|
1210
1223
|
/** State exposed by the `GridHeaderCell` component. */
|
|
1211
|
-
type GridHeaderCellState
|
|
1212
|
-
root: RootState
|
|
1224
|
+
type GridHeaderCellState = {
|
|
1225
|
+
root: RootState;
|
|
1213
1226
|
dayOfWeek: number;
|
|
1214
1227
|
long: string;
|
|
1215
1228
|
short: string;
|
|
@@ -1221,22 +1234,22 @@ interface GridHeaderCellOwnProps {
|
|
|
1221
1234
|
index?: number;
|
|
1222
1235
|
}
|
|
1223
1236
|
/** Full props for the `GridHeaderCell` component. */
|
|
1224
|
-
type GridHeaderCellProps
|
|
1237
|
+
type GridHeaderCellProps = useRender.ComponentProps<"th", GridHeaderCellState> & GridHeaderCellOwnProps;
|
|
1225
1238
|
/** State exposed by the `GridHeader` component. */
|
|
1226
|
-
type GridHeaderState
|
|
1227
|
-
root: RootState
|
|
1239
|
+
type GridHeaderState = {
|
|
1240
|
+
root: RootState;
|
|
1228
1241
|
};
|
|
1229
1242
|
/** Full props for the `GridHeader` component. */
|
|
1230
|
-
type GridHeaderProps
|
|
1243
|
+
type GridHeaderProps = useRender.ComponentProps<"thead", GridHeaderState>;
|
|
1231
1244
|
/** State exposed by the `GridBody` component. */
|
|
1232
|
-
type GridBodyState
|
|
1233
|
-
root: RootState
|
|
1245
|
+
type GridBodyState = {
|
|
1246
|
+
root: RootState;
|
|
1234
1247
|
};
|
|
1235
1248
|
/** Full props for the `GridBody` component. */
|
|
1236
|
-
type GridBodyProps
|
|
1249
|
+
type GridBodyProps = useRender.ComponentProps<"tbody", GridBodyState>;
|
|
1237
1250
|
/** State exposed by the `Grid` component. */
|
|
1238
|
-
type GridState
|
|
1239
|
-
root: RootState
|
|
1251
|
+
type GridState = {
|
|
1252
|
+
root: RootState;
|
|
1240
1253
|
month: number;
|
|
1241
1254
|
year: number;
|
|
1242
1255
|
orientation: GridOrientation;
|
|
@@ -1253,19 +1266,19 @@ interface GridOwnProps {
|
|
|
1253
1266
|
monthIndex?: number;
|
|
1254
1267
|
}
|
|
1255
1268
|
/** Full props for the `Grid` component. */
|
|
1256
|
-
type GridProps
|
|
1269
|
+
type GridProps = useRender.ComponentProps<"table", GridState> & GridOwnProps;
|
|
1257
1270
|
/** State exposed by the `WeekTemplate` component. */
|
|
1258
|
-
type WeekTemplateState
|
|
1259
|
-
root: RootState
|
|
1271
|
+
type WeekTemplateState = {
|
|
1272
|
+
root: RootState;
|
|
1260
1273
|
weekIndex: number; /** 1-based CSS grid row index for this week row (WeeksView only, undefined in MonthView). */
|
|
1261
1274
|
gridRowIndex: number | undefined;
|
|
1262
1275
|
};
|
|
1263
1276
|
/** Full props for the `WeekTemplate` component. */
|
|
1264
|
-
type WeekTemplateProps
|
|
1277
|
+
type WeekTemplateProps = useRender.ComponentProps<"tr", WeekTemplateState>;
|
|
1265
1278
|
/** State exposed by the `DayCellTemplate` component. */
|
|
1266
|
-
type DayCellTemplateState
|
|
1267
|
-
root: RootState
|
|
1268
|
-
date: Temporal
|
|
1279
|
+
type DayCellTemplateState = {
|
|
1280
|
+
root: RootState;
|
|
1281
|
+
date: Temporal.PlainDate;
|
|
1269
1282
|
columnIndex: number;
|
|
1270
1283
|
orientation: GridOrientation;
|
|
1271
1284
|
selected: boolean;
|
|
@@ -1292,24 +1305,24 @@ type DayCellTemplateState<F extends ValueFormat = ValueFormat> = {
|
|
|
1292
1305
|
rangePreviewHasEnd: boolean;
|
|
1293
1306
|
};
|
|
1294
1307
|
/** State exposed by the `DayButton` component (same as `DayCellTemplateState`). */
|
|
1295
|
-
type DayButtonState
|
|
1308
|
+
type DayButtonState = DayCellTemplateState;
|
|
1296
1309
|
/** Own props for the `DayCellTemplate` component. */
|
|
1297
1310
|
interface DayCellTemplateOwnProps {
|
|
1298
1311
|
/** Explicit date to render. When omitted, iterates over the current week's days. */
|
|
1299
|
-
date?: Temporal
|
|
1312
|
+
date?: Temporal.PlainDate;
|
|
1300
1313
|
}
|
|
1301
1314
|
/** Full props for the `DayCellTemplate` component. */
|
|
1302
|
-
type DayCellTemplateProps
|
|
1315
|
+
type DayCellTemplateProps = useRender.ComponentProps<"td", DayCellTemplateState> & DayCellTemplateOwnProps;
|
|
1303
1316
|
/** Own props for the `DayButton` component. */
|
|
1304
1317
|
interface DayButtonOwnProps {
|
|
1305
1318
|
/** Explicit date for a standalone `DayButton`. Normally inherited from `DayCellTemplate`. */
|
|
1306
|
-
date?: Temporal
|
|
1319
|
+
date?: Temporal.PlainDate;
|
|
1307
1320
|
}
|
|
1308
1321
|
/** Full props for the `DayButton` component. */
|
|
1309
|
-
type DayButtonProps
|
|
1322
|
+
type DayButtonProps = useRender.ComponentProps<"button", DayButtonState> & DayButtonOwnProps;
|
|
1310
1323
|
/** State exposed by the `RangeSelected` component. */
|
|
1311
|
-
type RangeSelectedState
|
|
1312
|
-
root: RootState
|
|
1324
|
+
type RangeSelectedState = {
|
|
1325
|
+
root: RootState;
|
|
1313
1326
|
active: boolean;
|
|
1314
1327
|
weekIndex: number;
|
|
1315
1328
|
startIndex: number;
|
|
@@ -1323,16 +1336,16 @@ type RangeSelectedState<F extends ValueFormat = ValueFormat> = {
|
|
|
1323
1336
|
orientation: "horizontal" | "vertical";
|
|
1324
1337
|
};
|
|
1325
1338
|
/** Full props for the `RangeSelected` component. */
|
|
1326
|
-
type RangeSelectedProps
|
|
1339
|
+
type RangeSelectedProps = useRender.ComponentProps<"td", RangeSelectedState>;
|
|
1327
1340
|
/** State exposed by the `RangePreview` component (same shape as `RangeSelectedState`). */
|
|
1328
|
-
type RangePreviewState
|
|
1341
|
+
type RangePreviewState = RangeSelectedState;
|
|
1329
1342
|
/** Full props for the `RangePreview` component (same shape as `RangeSelectedProps`). */
|
|
1330
|
-
type RangePreviewProps
|
|
1343
|
+
type RangePreviewProps = RangeSelectedProps;
|
|
1331
1344
|
/** Which end of a range the drag handle controls. */
|
|
1332
1345
|
type DragHandleEdge = "start" | "end";
|
|
1333
1346
|
/** State exposed by the `RangeDragHandle` components. */
|
|
1334
|
-
type DragHandleState
|
|
1335
|
-
root: RootState
|
|
1347
|
+
type DragHandleState = {
|
|
1348
|
+
root: RootState;
|
|
1336
1349
|
active: boolean;
|
|
1337
1350
|
dragging: boolean;
|
|
1338
1351
|
edge: DragHandleEdge;
|
|
@@ -1346,24 +1359,24 @@ interface DragHandleOwnProps {
|
|
|
1346
1359
|
edge: DragHandleEdge;
|
|
1347
1360
|
}
|
|
1348
1361
|
/** Full props for the `RangeDragHandle` component. */
|
|
1349
|
-
type RangeDragHandleProps
|
|
1362
|
+
type RangeDragHandleProps = useRender.ComponentProps<"span", DragHandleState> & DragHandleOwnProps;
|
|
1350
1363
|
/** Props for `RangeStartDragHandle` (edge is fixed to `"start"`). */
|
|
1351
|
-
type RangeStartDragHandleProps
|
|
1364
|
+
type RangeStartDragHandleProps = Omit<RangeDragHandleProps, "edge">;
|
|
1352
1365
|
/** Props for `RangeEndDragHandle` (edge is fixed to `"end"`). */
|
|
1353
|
-
type RangeEndDragHandleProps
|
|
1366
|
+
type RangeEndDragHandleProps = Omit<RangeDragHandleProps, "edge">;
|
|
1354
1367
|
/** State exposed by the `WeekNumberCell` component. */
|
|
1355
|
-
type WeekNumberCellState
|
|
1356
|
-
root: RootState
|
|
1368
|
+
type WeekNumberCellState = {
|
|
1369
|
+
root: RootState;
|
|
1357
1370
|
weekNumber: number;
|
|
1358
1371
|
};
|
|
1359
1372
|
/** Full props for the `WeekNumberCell` component. */
|
|
1360
|
-
type WeekNumberCellProps
|
|
1373
|
+
type WeekNumberCellProps = useRender.ComponentProps<"td", WeekNumberCellState>;
|
|
1361
1374
|
/** State exposed by the `WeekNumberHeader` component. */
|
|
1362
|
-
type WeekNumberHeaderState
|
|
1363
|
-
root: RootState
|
|
1375
|
+
type WeekNumberHeaderState = {
|
|
1376
|
+
root: RootState;
|
|
1364
1377
|
};
|
|
1365
1378
|
/** Full props for the `WeekNumberHeader` component. */
|
|
1366
|
-
type WeekNumberHeaderProps
|
|
1379
|
+
type WeekNumberHeaderProps = useRender.ComponentProps<"th", WeekNumberHeaderState>;
|
|
1367
1380
|
//#endregion
|
|
1368
1381
|
//#region src/calendar-types.d.ts
|
|
1369
1382
|
interface CalendarProviderPropsBase<F extends ValueFormat = ValueFormat> {
|
|
@@ -1392,7 +1405,7 @@ interface CalendarProviderPropsBase<F extends ValueFormat = ValueFormat> {
|
|
|
1392
1405
|
* Callback to disable individual dates. Return `true` to disable a date.
|
|
1393
1406
|
* Called in addition to `min`/`max` bounds checking.
|
|
1394
1407
|
*/
|
|
1395
|
-
isDateDisabled?: (date: Temporal
|
|
1408
|
+
isDateDisabled?: (date: Temporal.PlainDate) => boolean;
|
|
1396
1409
|
/**
|
|
1397
1410
|
* IANA time zone identifier used for date/time conversions.
|
|
1398
1411
|
* @default The system's current time zone.
|
|
@@ -1405,7 +1418,9 @@ interface CalendarProviderPropsBase<F extends ValueFormat = ValueFormat> {
|
|
|
1405
1418
|
*/
|
|
1406
1419
|
locale?: string;
|
|
1407
1420
|
/**
|
|
1408
|
-
*
|
|
1421
|
+
* The `Temporal` implementation to use. Not bundled — provide a `Temporal`
|
|
1422
|
+
* namespace (e.g. from `temporal-polyfill` or `@js-temporal/polyfill`) unless
|
|
1423
|
+
* the host exposes native `Temporal`. See `RootOwnProps.temporal` for links.
|
|
1409
1424
|
*/
|
|
1410
1425
|
temporal?: TemporalNamespace;
|
|
1411
1426
|
/**
|
|
@@ -1442,7 +1457,7 @@ interface CalendarRangeControlledProps<F extends ValueFormat = ValueFormat> {
|
|
|
1442
1457
|
/** @default false */
|
|
1443
1458
|
preventRangeReversal?: boolean;
|
|
1444
1459
|
previewRange?: DateRange<F> | null;
|
|
1445
|
-
onHoveredDateChange?: (date: Temporal
|
|
1460
|
+
onHoveredDateChange?: (date: Temporal.PlainDate | undefined) => void;
|
|
1446
1461
|
}
|
|
1447
1462
|
interface CalendarRangeUncontrolledProps<F extends ValueFormat = ValueFormat> {
|
|
1448
1463
|
selectionMode: "range";
|
|
@@ -1454,7 +1469,7 @@ interface CalendarRangeUncontrolledProps<F extends ValueFormat = ValueFormat> {
|
|
|
1454
1469
|
/** @default false */
|
|
1455
1470
|
preventRangeReversal?: boolean;
|
|
1456
1471
|
previewRange?: DateRange<F> | null;
|
|
1457
|
-
onHoveredDateChange?: (date: Temporal
|
|
1472
|
+
onHoveredDateChange?: (date: Temporal.PlainDate | undefined) => void;
|
|
1458
1473
|
}
|
|
1459
1474
|
interface CalendarMultipleControlledProps<F extends ValueFormat = ValueFormat> {
|
|
1460
1475
|
selectionMode: "multiple";
|
|
@@ -1473,9 +1488,9 @@ type CalendarProviderProps<F extends ValueFormat = ValueFormat> = CalendarProvid
|
|
|
1473
1488
|
/** Stable values (callbacks, config) provided by CalendarProvider — shared across all views. */
|
|
1474
1489
|
interface CalendarStableContextValue {
|
|
1475
1490
|
/** Selects (or toggles) a date, respecting the current selection mode. */
|
|
1476
|
-
onSelect: (date: Temporal
|
|
1491
|
+
onSelect: (date: Temporal.PlainDate) => void;
|
|
1477
1492
|
/** Programmatically sets the range boundaries (normalized so start <= end). */
|
|
1478
|
-
setRange: (start: Temporal
|
|
1493
|
+
setRange: (start: Temporal.PlainDate, end: Temporal.PlainDate) => void;
|
|
1479
1494
|
/** The active selection mode. */
|
|
1480
1495
|
selectionMode: "single" | "range" | "multiple";
|
|
1481
1496
|
/** Whether the entire calendar is disabled. */
|
|
@@ -1483,11 +1498,11 @@ interface CalendarStableContextValue {
|
|
|
1483
1498
|
/** Whether the calendar is read-only. */
|
|
1484
1499
|
readOnly: boolean;
|
|
1485
1500
|
/** User-supplied predicate for individually disabled dates. */
|
|
1486
|
-
isDateDisabled?: (date: Temporal
|
|
1501
|
+
isDateDisabled?: (date: Temporal.PlainDate) => boolean;
|
|
1487
1502
|
/** Earliest selectable date (resolved from the `min` prop). */
|
|
1488
|
-
minValue?: Temporal
|
|
1503
|
+
minValue?: Temporal.PlainDate;
|
|
1489
1504
|
/** Latest selectable date (resolved from the `max` prop). */
|
|
1490
|
-
maxValue?: Temporal
|
|
1505
|
+
maxValue?: Temporal.PlainDate;
|
|
1491
1506
|
/** Resolved IANA time zone. */
|
|
1492
1507
|
timeZone: string;
|
|
1493
1508
|
/** Resolved BCP 47 locale. */
|
|
@@ -1503,33 +1518,32 @@ interface CalendarStableContextValue {
|
|
|
1503
1518
|
/** The value format discriminant. */
|
|
1504
1519
|
valueFormat: ValueFormat;
|
|
1505
1520
|
/** Sets the hovered date for range preview. */
|
|
1506
|
-
setHoveredDate: (date: Temporal
|
|
1521
|
+
setHoveredDate: (date: Temporal.PlainDate | undefined) => void;
|
|
1507
1522
|
}
|
|
1508
1523
|
/** Volatile state provided by CalendarProvider — shared across all views. */
|
|
1509
1524
|
interface CalendarStateContextValue {
|
|
1510
1525
|
/** The currently selected value as a tagged {@link DateValueObject}. */
|
|
1511
1526
|
selected: DateValueObject | undefined;
|
|
1512
1527
|
/** Flat array of all selected dates (plain dates, sorted). */
|
|
1513
|
-
selectedDates: Temporal
|
|
1528
|
+
selectedDates: Temporal.PlainDate[];
|
|
1514
1529
|
/** Start of the current range selection, or `undefined`. */
|
|
1515
|
-
rangeStart: Temporal
|
|
1530
|
+
rangeStart: Temporal.PlainDate | undefined;
|
|
1516
1531
|
/** End of the current range selection, or `undefined`. */
|
|
1517
|
-
rangeEnd: Temporal
|
|
1532
|
+
rangeEnd: Temporal.PlainDate | undefined;
|
|
1518
1533
|
/** The currently hovered date (for range preview). */
|
|
1519
|
-
hoveredDate: Temporal
|
|
1534
|
+
hoveredDate: Temporal.PlainDate | undefined;
|
|
1520
1535
|
/** Start of the computed preview range. */
|
|
1521
|
-
previewStart: Temporal
|
|
1536
|
+
previewStart: Temporal.PlainDate | undefined;
|
|
1522
1537
|
/** End of the computed preview range. */
|
|
1523
|
-
previewEnd: Temporal
|
|
1538
|
+
previewEnd: Temporal.PlainDate | undefined;
|
|
1539
|
+
/**
|
|
1540
|
+
* View-independent part of the render-prop `RootState` (selection + resolved
|
|
1541
|
+
* config), built once here so MonthView and WeeksView expose identical state.
|
|
1542
|
+
* Each view adds its own `focused`/`viewing`.
|
|
1543
|
+
*/
|
|
1544
|
+
baseRootState: BaseRootState;
|
|
1524
1545
|
}
|
|
1525
1546
|
//#endregion
|
|
1526
|
-
//#region src/calendar-provider.d.ts
|
|
1527
|
-
/**
|
|
1528
|
-
* Provides shared calendar state (selection, config, range preview) to all
|
|
1529
|
-
* descendant view components. Does NOT manage focus, navigation, or grid data.
|
|
1530
|
-
*/
|
|
1531
|
-
declare function CalendarProvider<F extends ValueFormat = "PlainDate">(props: CalendarProviderProps<F>): _$react_jsx_runtime0.JSX.Element;
|
|
1532
|
-
//#endregion
|
|
1533
1547
|
//#region src/overflow.d.ts
|
|
1534
1548
|
type OverflowBehavior = "unbounded" | "stop" | "stop-shrink" | "snap" | "snap-shrink";
|
|
1535
1549
|
type MonthOverflowBehavior = "unbounded" | "stop";
|
|
@@ -1541,40 +1555,44 @@ interface MonthViewRootProps {
|
|
|
1541
1555
|
* Number of months to display simultaneously (1–12).
|
|
1542
1556
|
* @default 1
|
|
1543
1557
|
*/
|
|
1544
|
-
numberOfMonths?: number;
|
|
1558
|
+
numberOfMonths?: number | undefined;
|
|
1545
1559
|
/**
|
|
1546
1560
|
* When `true`, always render 6 week rows per month grid.
|
|
1547
1561
|
* Prevents layout shifts when navigating between months.
|
|
1548
1562
|
* @default false
|
|
1549
1563
|
*/
|
|
1550
|
-
fixedWeeks?: boolean;
|
|
1564
|
+
fixedWeeks?: boolean | undefined;
|
|
1551
1565
|
/**
|
|
1552
1566
|
* Controls how days from adjacent months are displayed.
|
|
1553
1567
|
* @default "enabled"
|
|
1554
1568
|
*/
|
|
1555
|
-
outsideDays?: OutsideDays;
|
|
1569
|
+
outsideDays?: OutsideDays | undefined;
|
|
1556
1570
|
/**
|
|
1557
1571
|
* How month navigation behaves at `min`/`max` bounds.
|
|
1558
1572
|
* - `"unbounded"` — navigation is always allowed.
|
|
1559
1573
|
* - `"stop"` — navigation buttons disable at the boundary.
|
|
1560
1574
|
* @default "unbounded"
|
|
1561
1575
|
*/
|
|
1562
|
-
overflowBehavior?: MonthOverflowBehavior;
|
|
1576
|
+
overflowBehavior?: MonthOverflowBehavior | undefined;
|
|
1563
1577
|
/**
|
|
1564
1578
|
* The controlled visible month. When provided, the component is controlled.
|
|
1579
|
+
*
|
|
1580
|
+
* Interpreted in the ISO calendar (the year/month are read as ISO values).
|
|
1581
|
+
* The `locale` only affects how the month is displayed, so this value
|
|
1582
|
+
* round-trips directly with {@link onMonthChange}.
|
|
1565
1583
|
*/
|
|
1566
|
-
month?: Temporal
|
|
1584
|
+
month?: Temporal.PlainYearMonth | undefined;
|
|
1567
1585
|
/**
|
|
1568
|
-
* The initial visible month (uncontrolled).
|
|
1586
|
+
* The initial visible month (uncontrolled). Interpreted in the ISO calendar.
|
|
1569
1587
|
*/
|
|
1570
|
-
defaultMonth?: Temporal
|
|
1588
|
+
defaultMonth?: Temporal.PlainYearMonth | undefined;
|
|
1571
1589
|
/**
|
|
1572
1590
|
* Called when the visible month changes via navigation or focus movement.
|
|
1573
|
-
* Not called on initial mount.
|
|
1591
|
+
* Not called on initial mount. The argument is an ISO `PlainYearMonth`.
|
|
1574
1592
|
*/
|
|
1575
|
-
onMonthChange?: (month: Temporal
|
|
1593
|
+
onMonthChange?: ((month: Temporal.PlainYearMonth) => void) | undefined;
|
|
1576
1594
|
/** React children. */
|
|
1577
|
-
children?: React.ReactNode;
|
|
1595
|
+
children?: React.ReactNode | undefined;
|
|
1578
1596
|
}
|
|
1579
1597
|
/** Stable values (config + callbacks) provided by MonthView.Root. */
|
|
1580
1598
|
interface MonthViewStableContextValue {
|
|
@@ -1603,11 +1621,11 @@ interface MonthViewStateContextValue {
|
|
|
1603
1621
|
month: number;
|
|
1604
1622
|
};
|
|
1605
1623
|
/** 2D array of weeks for the first visible month grid. */
|
|
1606
|
-
weeks: Temporal
|
|
1624
|
+
weeks: Temporal.PlainDate[][];
|
|
1607
1625
|
/** Pre-computed data for all visible months (length = `numberOfMonths`). */
|
|
1608
1626
|
allMonths: MonthData[];
|
|
1609
1627
|
/** Date-time representing the viewed month with time from the selection (for "today" highlighting). */
|
|
1610
|
-
currentDateTime: Temporal
|
|
1628
|
+
currentDateTime: Temporal.PlainDateTime;
|
|
1611
1629
|
/** Map of month index to label element id (for per-grid `aria-labelledby`). */
|
|
1612
1630
|
gridLabelIds: Record<number, string>;
|
|
1613
1631
|
/** The root component's state object for render functions. */
|
|
@@ -1628,9 +1646,9 @@ declare namespace MonthView {
|
|
|
1628
1646
|
* renders all 7 days (Sunday–Saturday). Each cell includes `abbr` and
|
|
1629
1647
|
* `aria-label` with the full weekday name.
|
|
1630
1648
|
*/
|
|
1631
|
-
declare const GridHeaderCell:
|
|
1649
|
+
declare const GridHeaderCell: (props: GridHeaderCellProps & React.RefAttributes<HTMLTableCellElement>) => React.ReactElement | null;
|
|
1632
1650
|
/** Table header section (`<thead>`) wrapping a row of {@link GridHeaderCell}s. */
|
|
1633
|
-
declare const GridHeader:
|
|
1651
|
+
declare const GridHeader: (props: GridHeaderProps & React.RefAttributes<HTMLTableSectionElement>) => React.ReactElement | null;
|
|
1634
1652
|
//#endregion
|
|
1635
1653
|
//#region src/day-cell.d.ts
|
|
1636
1654
|
/**
|
|
@@ -1641,34 +1659,34 @@ declare const GridHeader: <F extends ValueFormat = ValueFormat>(props: GridHeade
|
|
|
1641
1659
|
* When used inside a {@link WeekTemplate}, iterates over that week's days.
|
|
1642
1660
|
* An explicit `date` prop renders a single cell.
|
|
1643
1661
|
*/
|
|
1644
|
-
declare function DayCellTemplate
|
|
1645
|
-
declare const DayButton:
|
|
1662
|
+
declare function DayCellTemplate(props: DayCellTemplateProps): _$react_jsx_runtime0.JSX.Element;
|
|
1663
|
+
declare const DayButton: (props: DayButtonProps & {
|
|
1646
1664
|
_derivedState?: DayCellTemplateState & {
|
|
1647
1665
|
isTabTarget: boolean;
|
|
1648
1666
|
};
|
|
1649
1667
|
} & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
|
|
1650
1668
|
//#endregion
|
|
1651
1669
|
//#region src/grid.d.ts
|
|
1652
|
-
declare const Grid:
|
|
1653
|
-
declare const GridBody:
|
|
1670
|
+
declare const Grid: (props: GridProps & React.RefAttributes<HTMLTableElement>) => React.ReactElement | null;
|
|
1671
|
+
declare const GridBody: (props: GridBodyProps & React.RefAttributes<HTMLTableSectionElement>) => React.ReactElement | null;
|
|
1654
1672
|
/**
|
|
1655
1673
|
* Iterates over the weeks in the current month and renders one `<tr>` per week.
|
|
1656
1674
|
* Each instance receives its week's days and index via {@link WeekDataContext}.
|
|
1657
1675
|
*/
|
|
1658
|
-
declare function WeekTemplate
|
|
1676
|
+
declare function WeekTemplate(props: WeekTemplateProps): _$react_jsx_runtime0.JSX.Element;
|
|
1659
1677
|
//#endregion
|
|
1660
1678
|
//#region src/navigation.d.ts
|
|
1661
1679
|
/**
|
|
1662
1680
|
* Displays the currently selected (or current) date as localized text.
|
|
1663
1681
|
* Renders a `<span>` with `aria-live="polite"`.
|
|
1664
1682
|
*/
|
|
1665
|
-
declare const DateString:
|
|
1683
|
+
declare const DateString: (props: DateStringProps & React.RefAttributes<HTMLSpanElement>) => React.ReactElement | null;
|
|
1666
1684
|
/**
|
|
1667
1685
|
* Displays the currently selected time as localized text.
|
|
1668
1686
|
* Falls back to the current time when nothing is selected.
|
|
1669
1687
|
* Renders a `<span>` with `aria-live="polite"`.
|
|
1670
1688
|
*/
|
|
1671
|
-
declare const TimeString:
|
|
1689
|
+
declare const TimeString: (props: TimeStringProps & React.RefAttributes<HTMLSpanElement>) => React.ReactElement | null;
|
|
1672
1690
|
/**
|
|
1673
1691
|
* Displays the currently viewed month and year as a live-region heading for the
|
|
1674
1692
|
* calendar grid. Defaults to `{ month: "long", year: "numeric" }` (e.g.
|
|
@@ -1681,17 +1699,17 @@ declare const TimeString: <F extends ValueFormat = ValueFormat>(props: TimeStrin
|
|
|
1681
1699
|
* referenced by the calendar grid's `aria-labelledby` and serves as its
|
|
1682
1700
|
* accessible name.
|
|
1683
1701
|
*/
|
|
1684
|
-
declare const MonthYearString:
|
|
1702
|
+
declare const MonthYearString: (props: MonthYearStringProps & React.RefAttributes<HTMLSpanElement>) => React.ReactElement | null;
|
|
1685
1703
|
/**
|
|
1686
1704
|
* Button that navigates to the previous month. Automatically disabled
|
|
1687
1705
|
* when the previous month falls before `min`. Exposes `data-direction="prev"`.
|
|
1688
1706
|
*/
|
|
1689
|
-
declare const PrevMonthButton:
|
|
1707
|
+
declare const PrevMonthButton: (props: PrevMonthButtonProps & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
|
|
1690
1708
|
/**
|
|
1691
1709
|
* Button that navigates to the next month. Automatically disabled
|
|
1692
1710
|
* when the next month falls after `max`. Exposes `data-direction="next"`.
|
|
1693
1711
|
*/
|
|
1694
|
-
declare const NextMonthButton:
|
|
1712
|
+
declare const NextMonthButton: (props: NextMonthButtonProps & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
|
|
1695
1713
|
//#endregion
|
|
1696
1714
|
//#region src/selected-range.d.ts
|
|
1697
1715
|
/**
|
|
@@ -1700,7 +1718,7 @@ declare const NextMonthButton: <F extends ValueFormat = ValueFormat>(props: Next
|
|
|
1700
1718
|
* `active`, `week-index`, `start-index`, `end-index`, `start-date`,
|
|
1701
1719
|
* `end-date`, `extends-before`, and `extends-after`.
|
|
1702
1720
|
*/
|
|
1703
|
-
declare const RangeSelected:
|
|
1721
|
+
declare const RangeSelected: (props: RangeSelectedProps & React.RefAttributes<HTMLTableCellElement>) => React.ReactElement | null;
|
|
1704
1722
|
//#endregion
|
|
1705
1723
|
//#region src/range-preview.d.ts
|
|
1706
1724
|
/**
|
|
@@ -1709,31 +1727,31 @@ declare const RangeSelected: <F extends ValueFormat = ValueFormat>(props: RangeS
|
|
|
1709
1727
|
* {@link RangeSelected} but reads `previewStart`/`previewEnd` instead of
|
|
1710
1728
|
* the committed range boundaries.
|
|
1711
1729
|
*/
|
|
1712
|
-
declare const RangePreview:
|
|
1730
|
+
declare const RangePreview: (props: RangePreviewProps & React.RefAttributes<HTMLTableCellElement>) => React.ReactElement | null;
|
|
1713
1731
|
//#endregion
|
|
1714
1732
|
//#region src/drag-handle.d.ts
|
|
1715
1733
|
/** Convenience wrapper for {@link RangeDragHandle} with `edge="start"`. */
|
|
1716
|
-
declare const RangeStartDragHandle:
|
|
1734
|
+
declare const RangeStartDragHandle: (props: RangeStartDragHandleProps & React.RefAttributes<HTMLSpanElement>) => React.ReactElement | null;
|
|
1717
1735
|
/** Convenience wrapper for {@link RangeDragHandle} with `edge="end"`. */
|
|
1718
|
-
declare const RangeEndDragHandle:
|
|
1736
|
+
declare const RangeEndDragHandle: (props: RangeEndDragHandleProps & React.RefAttributes<HTMLSpanElement>) => React.ReactElement | null;
|
|
1719
1737
|
//#endregion
|
|
1720
1738
|
//#region src/week-number.d.ts
|
|
1721
1739
|
/**
|
|
1722
1740
|
* Renders the ISO 8601 week number for a week row. Must be used inside
|
|
1723
1741
|
* a {@link WeekTemplate}. Renders a `<td>` with `role="rowheader"`.
|
|
1724
1742
|
*/
|
|
1725
|
-
declare const WeekNumberCell:
|
|
1743
|
+
declare const WeekNumberCell: (props: WeekNumberCellProps & React.RefAttributes<HTMLTableCellElement>) => React.ReactElement | null;
|
|
1726
1744
|
/**
|
|
1727
1745
|
* Column header for the week number column. Renders a `<th scope="col">`.
|
|
1728
1746
|
*/
|
|
1729
|
-
declare const WeekNumberHeader:
|
|
1747
|
+
declare const WeekNumberHeader: (props: WeekNumberHeaderProps & React.RefAttributes<HTMLTableCellElement>) => React.ReactElement | null;
|
|
1730
1748
|
//#endregion
|
|
1731
1749
|
//#region src/resolve-first-week.d.ts
|
|
1732
1750
|
/**
|
|
1733
1751
|
* A flexible specifier for a calendar week. Accepts a `Temporal.PlainDate`,
|
|
1734
1752
|
* a native `Date`, an ISO week number, a week-of-year, or a month/day pair.
|
|
1735
1753
|
*/
|
|
1736
|
-
type FirstWeekSpec = Temporal
|
|
1754
|
+
type FirstWeekSpec = Temporal.PlainDate | Date | {
|
|
1737
1755
|
isoWeek: number;
|
|
1738
1756
|
isoYear: number;
|
|
1739
1757
|
} | {
|
|
@@ -1755,7 +1773,7 @@ type ScrollToWeekSnap = "start" | "center" | "end" | "nearest";
|
|
|
1755
1773
|
* @param T - Temporal namespace.
|
|
1756
1774
|
* @param timeZone - IANA time zone for native `Date` conversion. Defaults to system time zone.
|
|
1757
1775
|
*/
|
|
1758
|
-
declare function resolveFirstWeekSpec(spec: FirstWeekSpec, weekStartDay: WeekStartDay, T: TemporalNamespace, timeZone?: string): Temporal
|
|
1776
|
+
declare function resolveFirstWeekSpec(spec: FirstWeekSpec, weekStartDay: WeekStartDay, T: TemporalNamespace, timeZone?: string): Temporal.PlainDate;
|
|
1759
1777
|
/**
|
|
1760
1778
|
* Computes a new `firstWeek` date given a scroll target and snap mode.
|
|
1761
1779
|
*
|
|
@@ -1766,14 +1784,14 @@ declare function resolveFirstWeekSpec(spec: FirstWeekSpec, weekStartDay: WeekSta
|
|
|
1766
1784
|
* @param target - The week-start date to scroll to.
|
|
1767
1785
|
* @param options - Optional snap mode (default `"start"`).
|
|
1768
1786
|
*/
|
|
1769
|
-
declare function resolveFirstWeek(currentFirstWeek: Temporal
|
|
1787
|
+
declare function resolveFirstWeek(currentFirstWeek: Temporal.PlainDate, weekCount: number, target: Temporal.PlainDate, options?: {
|
|
1770
1788
|
snap?: ScrollToWeekSnap;
|
|
1771
|
-
}): Temporal
|
|
1789
|
+
}): Temporal.PlainDate;
|
|
1772
1790
|
//#endregion
|
|
1773
1791
|
//#region src/compute-weeks-in-window.d.ts
|
|
1774
1792
|
interface WeekDescriptor {
|
|
1775
|
-
startDate: Temporal
|
|
1776
|
-
endDate: Temporal
|
|
1793
|
+
startDate: Temporal.PlainDate;
|
|
1794
|
+
endDate: Temporal.PlainDate;
|
|
1777
1795
|
weekIndex: number;
|
|
1778
1796
|
month: number;
|
|
1779
1797
|
year: number;
|
|
@@ -1782,7 +1800,7 @@ interface WeekDescriptor {
|
|
|
1782
1800
|
* Computes an array of week descriptors for a continuous window.
|
|
1783
1801
|
* `firstWeek` is snapped back to the nearest `weekStartDay`.
|
|
1784
1802
|
*/
|
|
1785
|
-
declare function computeWeeksInWindow(firstWeek: Temporal
|
|
1803
|
+
declare function computeWeeksInWindow(firstWeek: Temporal.PlainDate, weekCount: number, weekStartDay: WeekStartDay, _T: TemporalNamespace): WeekDescriptor[];
|
|
1786
1804
|
//#endregion
|
|
1787
1805
|
//#region src/weeks-view-types.d.ts
|
|
1788
1806
|
/** Props accepted by `WeeksView.Root`. */
|
|
@@ -1790,27 +1808,27 @@ interface WeeksViewRootProps {
|
|
|
1790
1808
|
/** Number of week rows to display simultaneously. */
|
|
1791
1809
|
weekCount: number;
|
|
1792
1810
|
/** The controlled first visible week. When provided, the component is controlled. */
|
|
1793
|
-
firstWeek?: FirstWeekSpec;
|
|
1811
|
+
firstWeek?: FirstWeekSpec | undefined;
|
|
1794
1812
|
/** The initial first visible week (uncontrolled). */
|
|
1795
|
-
defaultFirstWeek?: FirstWeekSpec;
|
|
1813
|
+
defaultFirstWeek?: FirstWeekSpec | undefined;
|
|
1796
1814
|
/** Called when the first visible week changes via navigation or focus movement. */
|
|
1797
|
-
onFirstWeekChange?: (date: Temporal
|
|
1815
|
+
onFirstWeekChange?: ((date: Temporal.PlainDate) => void) | undefined;
|
|
1798
1816
|
/**
|
|
1799
1817
|
* How much to scroll per navigation step.
|
|
1800
1818
|
* - `"row"` — scroll one week row at a time.
|
|
1801
1819
|
* - `"page"` — scroll a full page (all visible rows) at a time.
|
|
1802
1820
|
* @default "row"
|
|
1803
1821
|
*/
|
|
1804
|
-
scrollBy?: "row" | "page";
|
|
1822
|
+
scrollBy?: "row" | "page" | undefined;
|
|
1805
1823
|
/**
|
|
1806
1824
|
* How navigation behaves at `min`/`max` bounds.
|
|
1807
1825
|
* @default "unbounded"
|
|
1808
1826
|
*/
|
|
1809
|
-
overflowBehavior?: OverflowBehavior;
|
|
1827
|
+
overflowBehavior?: OverflowBehavior | undefined;
|
|
1810
1828
|
/** Called when the visible window changes. */
|
|
1811
|
-
onWindowChange?: (info: WindowInfo) => void;
|
|
1829
|
+
onWindowChange?: ((info: WindowInfo) => void) | undefined;
|
|
1812
1830
|
/** React children. */
|
|
1813
|
-
children?: React.ReactNode;
|
|
1831
|
+
children?: React.ReactNode | undefined;
|
|
1814
1832
|
}
|
|
1815
1833
|
/** A month/year pair visible in the weeks window. */
|
|
1816
1834
|
interface VisibleMonth {
|
|
@@ -1820,9 +1838,9 @@ interface VisibleMonth {
|
|
|
1820
1838
|
/** Describes the currently visible window of weeks. */
|
|
1821
1839
|
interface WindowInfo {
|
|
1822
1840
|
/** The first date of the visible window. */
|
|
1823
|
-
windowStart: Temporal
|
|
1841
|
+
windowStart: Temporal.PlainDate;
|
|
1824
1842
|
/** The last date of the visible window. */
|
|
1825
|
-
windowEnd: Temporal
|
|
1843
|
+
windowEnd: Temporal.PlainDate;
|
|
1826
1844
|
/** Number of week rows in the window (the prop value, not actual when shrunk). */
|
|
1827
1845
|
weekCount: number;
|
|
1828
1846
|
/** Total number of calendar days in the window. */
|
|
@@ -1858,7 +1876,7 @@ interface WeeksViewStableContextValue {
|
|
|
1858
1876
|
/** Volatile state provided by `WeeksView.Root`. */
|
|
1859
1877
|
interface WeeksViewStateContextValue {
|
|
1860
1878
|
/** The logically focused date in the grid. */
|
|
1861
|
-
focusedDate: Temporal
|
|
1879
|
+
focusedDate: Temporal.PlainDate;
|
|
1862
1880
|
/** Information about the currently visible window. */
|
|
1863
1881
|
windowInfo: WindowInfo;
|
|
1864
1882
|
/** Label element id for `aria-labelledby` on the grid. */
|
|
@@ -1866,7 +1884,9 @@ interface WeeksViewStateContextValue {
|
|
|
1866
1884
|
/** Computed week descriptors for all visible rows. */
|
|
1867
1885
|
weeks: WeekDescriptor[];
|
|
1868
1886
|
/** Date-time representing the current moment (for "today" highlighting). */
|
|
1869
|
-
currentDateTime: Temporal
|
|
1887
|
+
currentDateTime: Temporal.PlainDateTime;
|
|
1888
|
+
/** Render-prop `RootState` exposed to components inside WeeksView. */
|
|
1889
|
+
rootState: RootState;
|
|
1870
1890
|
}
|
|
1871
1891
|
//#endregion
|
|
1872
1892
|
//#region src/weeks-view.d.ts
|
|
@@ -1977,10 +1997,7 @@ declare const MonthSeparator: React$1.ForwardRefExoticComponent<Omit<MonthSepara
|
|
|
1977
1997
|
* same logic as the internal hook. Useful for deriving the preview in an
|
|
1978
1998
|
* `onHoveredDateChange` handler without needing a controlled `previewRange`.
|
|
1979
1999
|
*/
|
|
1980
|
-
declare function computePreviewRange(hoveredDate: Temporal
|
|
1981
|
-
//#endregion
|
|
1982
|
-
//#region src/temporal-polyfill.d.ts
|
|
1983
|
-
declare const Temporal: TemporalNamespace;
|
|
2000
|
+
declare function computePreviewRange(hoveredDate: Temporal.PlainDate, currentRange: DateRange | null, rangeMode: RangeMode, preventRangeReversal?: boolean, T?: TemporalNamespace): DateRange<"PlainDate"> | null;
|
|
1984
2001
|
//#endregion
|
|
1985
2002
|
//#region src/calendar-context.d.ts
|
|
1986
2003
|
/** Returns the stable (callbacks/config) part of CalendarProvider context. */
|
|
@@ -2000,11 +2017,11 @@ interface ViewContextValue {
|
|
|
2000
2017
|
/** Which view type is active. */
|
|
2001
2018
|
viewType: "month" | "weeks";
|
|
2002
2019
|
/** The logically focused date in the grid. */
|
|
2003
|
-
focusedDate: Temporal
|
|
2020
|
+
focusedDate: Temporal.PlainDate;
|
|
2004
2021
|
/** Moves the logically focused date. */
|
|
2005
|
-
setFocusedDate: (date: Temporal
|
|
2022
|
+
setFocusedDate: (date: Temporal.PlainDate) => void;
|
|
2006
2023
|
/** The date that should receive `tabIndex={0}` for roving tabindex. */
|
|
2007
|
-
tabTargetDate: Temporal
|
|
2024
|
+
tabTargetDate: Temporal.PlainDate;
|
|
2008
2025
|
/** Whether the grid currently holds DOM focus. */
|
|
2009
2026
|
gridHasFocus: boolean;
|
|
2010
2027
|
/** Tracks whether the grid currently holds DOM focus. */
|
|
@@ -2019,4 +2036,4 @@ declare function useWeeksViewStable(): WeeksViewStableContextValue;
|
|
|
2019
2036
|
/** Returns the WeeksView state context (volatile grid data). */
|
|
2020
2037
|
declare function useWeeksViewState(): WeeksViewStateContextValue;
|
|
2021
2038
|
//#endregion
|
|
2022
|
-
export {
|
|
2039
|
+
export { GridBody as $, TimeStringState as $t, VisibleMonth as A, GridHeaderProps as At, resolveFirstWeekSpec as B, PlainDateObject as Bt, WeekCountState as C, DayCellTemplateState as Ct, WeeksViewProps as D, GridBodyState as Dt, WeeksView as E, GridBodyProps as Et, WeekDescriptor as F, MonthYearStringProps as Ft, RangePreview as G, RangePreviewState as Gt, WeekNumberHeader as H, RangeEndDragHandleProps as Ht, computeWeeksInWindow as I, MonthYearStringState as It, MonthYearString as J, RangeStartDragHandleProps as Jt, RangeSelected as K, RangeSelectedProps as Kt, FirstWeekSpec as L, NavButtonState as Lt, WeeksViewStableContextValue as M, GridProps as Mt, WeeksViewStateContextValue as N, GridState as Nt, WeeksViewRoot as O, GridHeaderCellProps as Ot, WindowInfo as P, MonthData as Pt, Grid as Q, TimeStringProps as Qt, ScrollToWeekSnap as R, NextMonthButtonProps as Rt, WeekCountProps as S, DayCellTemplateProps as St, WeeksNavButtonState as T, DragHandleState as Tt, RangeEndDragHandle as U, RangeMode as Ut, WeekNumberCell as V, PrevMonthButtonProps as Vt, RangeStartDragHandle as W, RangePreviewProps as Wt, PrevMonthButton as X, RootState as Xt, NextMonthButton as Y, RawValueForFormat as Yt, TimeString as Z, TemporalNamespace as Zt, NextWeeksButton as _, DateStringProps as _t, useMonthViewStable as a, WeekNumberHeaderProps as an, MonthView as at, PrevWeeksButtonProps as b, DayButtonProps as bt, useCalendarState as c, WeekTemplateProps as cn, MonthViewRootProps as ct, MonthSeparatorCell as d, GridContext as dn, MonthOverflowBehavior as dt, ValueChangeMeta as en, WeekTemplate as et, MonthSeparatorMonth as f, WeekDataContext as fn, OverflowBehavior as ft, MonthSeparatorYear as g, DateRange as gt, MonthSeparatorWeekCount as h, CalendarStateContextValue as ht, useViewContext as i, WeekNumberCellState as in, GridHeaderCell as it, WeeksViewRootProps as j, GridHeaderState as jt, WeeksViewRootHandle as k, GridHeaderCellState as kt, computePreviewRange as l, WeekTemplateState as ln, MonthViewStableContextValue as lt, MonthSeparatorState as m, CalendarStableContextValue as mt, useWeeksViewState as n, ValueFormat as nn, DayCellTemplate as nt, useMonthViewState as o, WeekNumberHeaderState as on, MonthViewProps as ot, MonthSeparatorRow as p, CalendarProviderProps as pt, DateString as q, RangeSelectedState as qt, ViewContextValue as r, WeekNumberCellProps as rn, GridHeader as rt, useCalendarStable as s, WeekStartDay as sn, MonthViewRoot as st, useWeeksViewStable as t, ValueForFormat as tn, DayButton as tt, MonthSeparator as u, DayCellDataContext as un, MonthViewStateContextValue as ut, NextWeeksButtonProps as v, DateStringState as vt, WeeksNavButtonOwnProps as w, DragHandleOwnProps as wt, WeekCount as x, DayButtonState as xt, PrevWeeksButton as y, DateValueObject as yt, resolveFirstWeek as z, OutsideDays as zt };
|