@foldkit/ui 0.159.0 → 0.160.0-canary.10b9fda28a24
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/calendar/index.d.ts +407 -19
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +21 -24
- package/dist/calendar/public.d.ts +1 -1
- package/dist/calendar/public.d.ts.map +1 -1
- package/dist/datePicker/index.d.ts +386 -31
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/datePicker/index.js +37 -1
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.js +14 -21
- package/package.json +8 -8
package/dist/calendar/index.d.ts
CHANGED
|
@@ -36,6 +36,77 @@ export declare const Model: Schema.Struct<{
|
|
|
36
36
|
readonly shortMonthNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
|
|
37
37
|
readonly dayNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
|
|
38
38
|
readonly shortDayNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
|
|
39
|
+
readonly longFormat: Schema.NonEmptyArray<import("foldkit/schema").TaggedUnion<{
|
|
40
|
+
readonly MonthName: {};
|
|
41
|
+
readonly ShortMonthName: {};
|
|
42
|
+
readonly MonthNumber: {};
|
|
43
|
+
readonly PaddedMonthNumber: {};
|
|
44
|
+
readonly DayNumber: {};
|
|
45
|
+
readonly PaddedDayNumber: {};
|
|
46
|
+
readonly DayName: {};
|
|
47
|
+
readonly ShortDayName: {};
|
|
48
|
+
readonly YearNumber: {};
|
|
49
|
+
readonly LiteralText: {
|
|
50
|
+
text: Schema.String;
|
|
51
|
+
};
|
|
52
|
+
}>>;
|
|
53
|
+
readonly shortFormat: Schema.NonEmptyArray<import("foldkit/schema").TaggedUnion<{
|
|
54
|
+
readonly MonthName: {};
|
|
55
|
+
readonly ShortMonthName: {};
|
|
56
|
+
readonly MonthNumber: {};
|
|
57
|
+
readonly PaddedMonthNumber: {};
|
|
58
|
+
readonly DayNumber: {};
|
|
59
|
+
readonly PaddedDayNumber: {};
|
|
60
|
+
readonly DayName: {};
|
|
61
|
+
readonly ShortDayName: {};
|
|
62
|
+
readonly YearNumber: {};
|
|
63
|
+
readonly LiteralText: {
|
|
64
|
+
text: Schema.String;
|
|
65
|
+
};
|
|
66
|
+
}>>;
|
|
67
|
+
readonly ariaLabelFormat: Schema.NonEmptyArray<import("foldkit/schema").TaggedUnion<{
|
|
68
|
+
readonly MonthName: {};
|
|
69
|
+
readonly ShortMonthName: {};
|
|
70
|
+
readonly MonthNumber: {};
|
|
71
|
+
readonly PaddedMonthNumber: {};
|
|
72
|
+
readonly DayNumber: {};
|
|
73
|
+
readonly PaddedDayNumber: {};
|
|
74
|
+
readonly DayName: {};
|
|
75
|
+
readonly ShortDayName: {};
|
|
76
|
+
readonly YearNumber: {};
|
|
77
|
+
readonly LiteralText: {
|
|
78
|
+
text: Schema.String;
|
|
79
|
+
};
|
|
80
|
+
}>>;
|
|
81
|
+
readonly monthYearFormat: Schema.NonEmptyArray<Schema.Union<readonly [Schema.TaggedStruct<"MonthName", {}> & ((value?: void | {
|
|
82
|
+
readonly _tag?: "MonthName";
|
|
83
|
+
} | undefined) => {
|
|
84
|
+
readonly _tag: "MonthName";
|
|
85
|
+
}), Schema.TaggedStruct<"ShortMonthName", {}> & ((value?: void | {
|
|
86
|
+
readonly _tag?: "ShortMonthName";
|
|
87
|
+
} | undefined) => {
|
|
88
|
+
readonly _tag: "ShortMonthName";
|
|
89
|
+
}), Schema.TaggedStruct<"MonthNumber", {}> & ((value?: void | {
|
|
90
|
+
readonly _tag?: "MonthNumber";
|
|
91
|
+
} | undefined) => {
|
|
92
|
+
readonly _tag: "MonthNumber";
|
|
93
|
+
}), Schema.TaggedStruct<"PaddedMonthNumber", {}> & ((value?: void | {
|
|
94
|
+
readonly _tag?: "PaddedMonthNumber";
|
|
95
|
+
} | undefined) => {
|
|
96
|
+
readonly _tag: "PaddedMonthNumber";
|
|
97
|
+
}), Schema.TaggedStruct<"YearNumber", {}> & ((value?: void | {
|
|
98
|
+
readonly _tag?: "YearNumber";
|
|
99
|
+
} | undefined) => {
|
|
100
|
+
readonly _tag: "YearNumber";
|
|
101
|
+
}), Schema.TaggedStruct<"LiteralText", {
|
|
102
|
+
readonly text: Schema.String;
|
|
103
|
+
}> & ((value: {
|
|
104
|
+
readonly _tag?: "LiteralText";
|
|
105
|
+
readonly text: string;
|
|
106
|
+
}) => {
|
|
107
|
+
readonly _tag: "LiteralText";
|
|
108
|
+
readonly text: string;
|
|
109
|
+
})]>>;
|
|
39
110
|
}>;
|
|
40
111
|
readonly maybeMinDate: Schema.Option<Schema.Struct<{
|
|
41
112
|
readonly year: Schema.Int;
|
|
@@ -205,6 +276,162 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
205
276
|
readonly shortMonthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
206
277
|
readonly dayNames: readonly [string, string, string, string, string, string, string];
|
|
207
278
|
readonly shortDayNames: readonly [string, string, string, string, string, string, string];
|
|
279
|
+
readonly longFormat: readonly [{
|
|
280
|
+
readonly _tag: "DayName";
|
|
281
|
+
} | {
|
|
282
|
+
readonly _tag: "DayNumber";
|
|
283
|
+
} | {
|
|
284
|
+
readonly _tag: "LiteralText";
|
|
285
|
+
readonly text: string;
|
|
286
|
+
} | {
|
|
287
|
+
readonly _tag: "MonthName";
|
|
288
|
+
} | {
|
|
289
|
+
readonly _tag: "MonthNumber";
|
|
290
|
+
} | {
|
|
291
|
+
readonly _tag: "PaddedDayNumber";
|
|
292
|
+
} | {
|
|
293
|
+
readonly _tag: "PaddedMonthNumber";
|
|
294
|
+
} | {
|
|
295
|
+
readonly _tag: "ShortDayName";
|
|
296
|
+
} | {
|
|
297
|
+
readonly _tag: "ShortMonthName";
|
|
298
|
+
} | {
|
|
299
|
+
readonly _tag: "YearNumber";
|
|
300
|
+
}, ...({
|
|
301
|
+
readonly _tag: "DayName";
|
|
302
|
+
} | {
|
|
303
|
+
readonly _tag: "DayNumber";
|
|
304
|
+
} | {
|
|
305
|
+
readonly _tag: "LiteralText";
|
|
306
|
+
readonly text: string;
|
|
307
|
+
} | {
|
|
308
|
+
readonly _tag: "MonthName";
|
|
309
|
+
} | {
|
|
310
|
+
readonly _tag: "MonthNumber";
|
|
311
|
+
} | {
|
|
312
|
+
readonly _tag: "PaddedDayNumber";
|
|
313
|
+
} | {
|
|
314
|
+
readonly _tag: "PaddedMonthNumber";
|
|
315
|
+
} | {
|
|
316
|
+
readonly _tag: "ShortDayName";
|
|
317
|
+
} | {
|
|
318
|
+
readonly _tag: "ShortMonthName";
|
|
319
|
+
} | {
|
|
320
|
+
readonly _tag: "YearNumber";
|
|
321
|
+
})[]];
|
|
322
|
+
readonly shortFormat: readonly [{
|
|
323
|
+
readonly _tag: "DayName";
|
|
324
|
+
} | {
|
|
325
|
+
readonly _tag: "DayNumber";
|
|
326
|
+
} | {
|
|
327
|
+
readonly _tag: "MonthName";
|
|
328
|
+
} | {
|
|
329
|
+
readonly _tag: "MonthNumber";
|
|
330
|
+
} | {
|
|
331
|
+
readonly _tag: "PaddedDayNumber";
|
|
332
|
+
} | {
|
|
333
|
+
readonly _tag: "PaddedMonthNumber";
|
|
334
|
+
} | {
|
|
335
|
+
readonly _tag: "ShortDayName";
|
|
336
|
+
} | {
|
|
337
|
+
readonly _tag: "ShortMonthName";
|
|
338
|
+
} | {
|
|
339
|
+
readonly _tag: "YearNumber";
|
|
340
|
+
} | {
|
|
341
|
+
readonly _tag: "LiteralText";
|
|
342
|
+
readonly text: string;
|
|
343
|
+
}, ...({
|
|
344
|
+
readonly _tag: "DayName";
|
|
345
|
+
} | {
|
|
346
|
+
readonly _tag: "DayNumber";
|
|
347
|
+
} | {
|
|
348
|
+
readonly _tag: "MonthName";
|
|
349
|
+
} | {
|
|
350
|
+
readonly _tag: "MonthNumber";
|
|
351
|
+
} | {
|
|
352
|
+
readonly _tag: "PaddedDayNumber";
|
|
353
|
+
} | {
|
|
354
|
+
readonly _tag: "PaddedMonthNumber";
|
|
355
|
+
} | {
|
|
356
|
+
readonly _tag: "ShortDayName";
|
|
357
|
+
} | {
|
|
358
|
+
readonly _tag: "ShortMonthName";
|
|
359
|
+
} | {
|
|
360
|
+
readonly _tag: "YearNumber";
|
|
361
|
+
} | {
|
|
362
|
+
readonly _tag: "LiteralText";
|
|
363
|
+
readonly text: string;
|
|
364
|
+
})[]];
|
|
365
|
+
readonly ariaLabelFormat: readonly [{
|
|
366
|
+
readonly _tag: "DayName";
|
|
367
|
+
} | {
|
|
368
|
+
readonly _tag: "DayNumber";
|
|
369
|
+
} | {
|
|
370
|
+
readonly _tag: "MonthName";
|
|
371
|
+
} | {
|
|
372
|
+
readonly _tag: "MonthNumber";
|
|
373
|
+
} | {
|
|
374
|
+
readonly _tag: "PaddedDayNumber";
|
|
375
|
+
} | {
|
|
376
|
+
readonly _tag: "PaddedMonthNumber";
|
|
377
|
+
} | {
|
|
378
|
+
readonly _tag: "ShortDayName";
|
|
379
|
+
} | {
|
|
380
|
+
readonly _tag: "ShortMonthName";
|
|
381
|
+
} | {
|
|
382
|
+
readonly _tag: "YearNumber";
|
|
383
|
+
} | {
|
|
384
|
+
readonly _tag: "LiteralText";
|
|
385
|
+
readonly text: string;
|
|
386
|
+
}, ...({
|
|
387
|
+
readonly _tag: "DayName";
|
|
388
|
+
} | {
|
|
389
|
+
readonly _tag: "DayNumber";
|
|
390
|
+
} | {
|
|
391
|
+
readonly _tag: "MonthName";
|
|
392
|
+
} | {
|
|
393
|
+
readonly _tag: "MonthNumber";
|
|
394
|
+
} | {
|
|
395
|
+
readonly _tag: "PaddedDayNumber";
|
|
396
|
+
} | {
|
|
397
|
+
readonly _tag: "PaddedMonthNumber";
|
|
398
|
+
} | {
|
|
399
|
+
readonly _tag: "ShortDayName";
|
|
400
|
+
} | {
|
|
401
|
+
readonly _tag: "ShortMonthName";
|
|
402
|
+
} | {
|
|
403
|
+
readonly _tag: "YearNumber";
|
|
404
|
+
} | {
|
|
405
|
+
readonly _tag: "LiteralText";
|
|
406
|
+
readonly text: string;
|
|
407
|
+
})[]];
|
|
408
|
+
readonly monthYearFormat: readonly [{
|
|
409
|
+
readonly _tag: "MonthName";
|
|
410
|
+
} | {
|
|
411
|
+
readonly _tag: "MonthNumber";
|
|
412
|
+
} | {
|
|
413
|
+
readonly _tag: "PaddedMonthNumber";
|
|
414
|
+
} | {
|
|
415
|
+
readonly _tag: "ShortMonthName";
|
|
416
|
+
} | {
|
|
417
|
+
readonly _tag: "YearNumber";
|
|
418
|
+
} | {
|
|
419
|
+
readonly _tag: "LiteralText";
|
|
420
|
+
readonly text: string;
|
|
421
|
+
}, ...({
|
|
422
|
+
readonly _tag: "MonthName";
|
|
423
|
+
} | {
|
|
424
|
+
readonly _tag: "MonthNumber";
|
|
425
|
+
} | {
|
|
426
|
+
readonly _tag: "PaddedMonthNumber";
|
|
427
|
+
} | {
|
|
428
|
+
readonly _tag: "ShortMonthName";
|
|
429
|
+
} | {
|
|
430
|
+
readonly _tag: "YearNumber";
|
|
431
|
+
} | {
|
|
432
|
+
readonly _tag: "LiteralText";
|
|
433
|
+
readonly text: string;
|
|
434
|
+
})[]];
|
|
208
435
|
};
|
|
209
436
|
readonly maybeMinDate: Option.Option<{
|
|
210
437
|
readonly year: number;
|
|
@@ -375,6 +602,28 @@ export type YearsModeAttributes = Readonly<{
|
|
|
375
602
|
* matches `model.viewMode`. Pattern-match on `_tag` with `Match.tagsExhaustive`
|
|
376
603
|
* to render each mode. */
|
|
377
604
|
export type CalendarAttributes = DaysModeAttributes | MonthsModeAttributes | YearsModeAttributes;
|
|
605
|
+
/** Accessible labels and label builders accepted by Calendar views. DatePicker
|
|
606
|
+
* accepts the same fields and forwards them to its embedded Calendar. */
|
|
607
|
+
export type ViewLabels = Readonly<{
|
|
608
|
+
previousMonthLabel?: string;
|
|
609
|
+
nextMonthLabel?: string;
|
|
610
|
+
previousYearsPageLabel?: string;
|
|
611
|
+
nextYearsPageLabel?: string;
|
|
612
|
+
daysHeadingButtonLabel?: string;
|
|
613
|
+
monthsHeadingButtonLabel?: string;
|
|
614
|
+
/** Builds the day grid's `aria-label` from the heading text the locale's
|
|
615
|
+
* `monthYearFormat` produced. Defaults to English. */
|
|
616
|
+
toDaysGridLabel?: (monthYear: string) => string;
|
|
617
|
+
/** Builds a week row's `aria-label` from the date that starts the week.
|
|
618
|
+
* Defaults to English. */
|
|
619
|
+
toWeekLabel?: (weekStart: CalendarDate) => string;
|
|
620
|
+
/** Builds the month grid's `aria-label` from the displayed year. Defaults
|
|
621
|
+
* to English. */
|
|
622
|
+
toMonthsGridLabel?: (year: number) => string;
|
|
623
|
+
/** Builds the year grid's `aria-label` from the displayed year range.
|
|
624
|
+
* Defaults to English. */
|
|
625
|
+
toYearsGridLabel?: (startYear: number, endYear: number) => string;
|
|
626
|
+
}>;
|
|
378
627
|
/** Per-render view inputs passed to `view` via `h.submodel`'s `viewInputs` field.
|
|
379
628
|
*
|
|
380
629
|
* The Calendar dispatches its own `ClickedDay` message on date commit
|
|
@@ -385,13 +634,7 @@ export type ViewInputs = Readonly<{
|
|
|
385
634
|
* marker derives from it. */
|
|
386
635
|
maybeSelectedDate: Option.Option<CalendarDate>;
|
|
387
636
|
toView: (attributes: CalendarAttributes) => Html;
|
|
388
|
-
|
|
389
|
-
nextMonthLabel?: string;
|
|
390
|
-
previousYearsPageLabel?: string;
|
|
391
|
-
nextYearsPageLabel?: string;
|
|
392
|
-
daysHeadingButtonLabel?: string;
|
|
393
|
-
monthsHeadingButtonLabel?: string;
|
|
394
|
-
}>;
|
|
637
|
+
}> & ViewLabels;
|
|
395
638
|
/** Renders an accessible calendar. Publishes mode-specific ARIA attribute
|
|
396
639
|
* bundles + derived cell data, then delegates layout to the consumer's
|
|
397
640
|
* `toView` callback. The variant of `CalendarAttributes` passed to
|
|
@@ -418,6 +661,162 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
418
661
|
readonly shortMonthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
419
662
|
readonly dayNames: readonly [string, string, string, string, string, string, string];
|
|
420
663
|
readonly shortDayNames: readonly [string, string, string, string, string, string, string];
|
|
664
|
+
readonly longFormat: readonly [{
|
|
665
|
+
readonly _tag: "DayName";
|
|
666
|
+
} | {
|
|
667
|
+
readonly _tag: "DayNumber";
|
|
668
|
+
} | {
|
|
669
|
+
readonly _tag: "LiteralText";
|
|
670
|
+
readonly text: string;
|
|
671
|
+
} | {
|
|
672
|
+
readonly _tag: "MonthName";
|
|
673
|
+
} | {
|
|
674
|
+
readonly _tag: "MonthNumber";
|
|
675
|
+
} | {
|
|
676
|
+
readonly _tag: "PaddedDayNumber";
|
|
677
|
+
} | {
|
|
678
|
+
readonly _tag: "PaddedMonthNumber";
|
|
679
|
+
} | {
|
|
680
|
+
readonly _tag: "ShortDayName";
|
|
681
|
+
} | {
|
|
682
|
+
readonly _tag: "ShortMonthName";
|
|
683
|
+
} | {
|
|
684
|
+
readonly _tag: "YearNumber";
|
|
685
|
+
}, ...({
|
|
686
|
+
readonly _tag: "DayName";
|
|
687
|
+
} | {
|
|
688
|
+
readonly _tag: "DayNumber";
|
|
689
|
+
} | {
|
|
690
|
+
readonly _tag: "LiteralText";
|
|
691
|
+
readonly text: string;
|
|
692
|
+
} | {
|
|
693
|
+
readonly _tag: "MonthName";
|
|
694
|
+
} | {
|
|
695
|
+
readonly _tag: "MonthNumber";
|
|
696
|
+
} | {
|
|
697
|
+
readonly _tag: "PaddedDayNumber";
|
|
698
|
+
} | {
|
|
699
|
+
readonly _tag: "PaddedMonthNumber";
|
|
700
|
+
} | {
|
|
701
|
+
readonly _tag: "ShortDayName";
|
|
702
|
+
} | {
|
|
703
|
+
readonly _tag: "ShortMonthName";
|
|
704
|
+
} | {
|
|
705
|
+
readonly _tag: "YearNumber";
|
|
706
|
+
})[]];
|
|
707
|
+
readonly shortFormat: readonly [{
|
|
708
|
+
readonly _tag: "DayName";
|
|
709
|
+
} | {
|
|
710
|
+
readonly _tag: "DayNumber";
|
|
711
|
+
} | {
|
|
712
|
+
readonly _tag: "MonthName";
|
|
713
|
+
} | {
|
|
714
|
+
readonly _tag: "MonthNumber";
|
|
715
|
+
} | {
|
|
716
|
+
readonly _tag: "PaddedDayNumber";
|
|
717
|
+
} | {
|
|
718
|
+
readonly _tag: "PaddedMonthNumber";
|
|
719
|
+
} | {
|
|
720
|
+
readonly _tag: "ShortDayName";
|
|
721
|
+
} | {
|
|
722
|
+
readonly _tag: "ShortMonthName";
|
|
723
|
+
} | {
|
|
724
|
+
readonly _tag: "YearNumber";
|
|
725
|
+
} | {
|
|
726
|
+
readonly _tag: "LiteralText";
|
|
727
|
+
readonly text: string;
|
|
728
|
+
}, ...({
|
|
729
|
+
readonly _tag: "DayName";
|
|
730
|
+
} | {
|
|
731
|
+
readonly _tag: "DayNumber";
|
|
732
|
+
} | {
|
|
733
|
+
readonly _tag: "MonthName";
|
|
734
|
+
} | {
|
|
735
|
+
readonly _tag: "MonthNumber";
|
|
736
|
+
} | {
|
|
737
|
+
readonly _tag: "PaddedDayNumber";
|
|
738
|
+
} | {
|
|
739
|
+
readonly _tag: "PaddedMonthNumber";
|
|
740
|
+
} | {
|
|
741
|
+
readonly _tag: "ShortDayName";
|
|
742
|
+
} | {
|
|
743
|
+
readonly _tag: "ShortMonthName";
|
|
744
|
+
} | {
|
|
745
|
+
readonly _tag: "YearNumber";
|
|
746
|
+
} | {
|
|
747
|
+
readonly _tag: "LiteralText";
|
|
748
|
+
readonly text: string;
|
|
749
|
+
})[]];
|
|
750
|
+
readonly ariaLabelFormat: readonly [{
|
|
751
|
+
readonly _tag: "DayName";
|
|
752
|
+
} | {
|
|
753
|
+
readonly _tag: "DayNumber";
|
|
754
|
+
} | {
|
|
755
|
+
readonly _tag: "MonthName";
|
|
756
|
+
} | {
|
|
757
|
+
readonly _tag: "MonthNumber";
|
|
758
|
+
} | {
|
|
759
|
+
readonly _tag: "PaddedDayNumber";
|
|
760
|
+
} | {
|
|
761
|
+
readonly _tag: "PaddedMonthNumber";
|
|
762
|
+
} | {
|
|
763
|
+
readonly _tag: "ShortDayName";
|
|
764
|
+
} | {
|
|
765
|
+
readonly _tag: "ShortMonthName";
|
|
766
|
+
} | {
|
|
767
|
+
readonly _tag: "YearNumber";
|
|
768
|
+
} | {
|
|
769
|
+
readonly _tag: "LiteralText";
|
|
770
|
+
readonly text: string;
|
|
771
|
+
}, ...({
|
|
772
|
+
readonly _tag: "DayName";
|
|
773
|
+
} | {
|
|
774
|
+
readonly _tag: "DayNumber";
|
|
775
|
+
} | {
|
|
776
|
+
readonly _tag: "MonthName";
|
|
777
|
+
} | {
|
|
778
|
+
readonly _tag: "MonthNumber";
|
|
779
|
+
} | {
|
|
780
|
+
readonly _tag: "PaddedDayNumber";
|
|
781
|
+
} | {
|
|
782
|
+
readonly _tag: "PaddedMonthNumber";
|
|
783
|
+
} | {
|
|
784
|
+
readonly _tag: "ShortDayName";
|
|
785
|
+
} | {
|
|
786
|
+
readonly _tag: "ShortMonthName";
|
|
787
|
+
} | {
|
|
788
|
+
readonly _tag: "YearNumber";
|
|
789
|
+
} | {
|
|
790
|
+
readonly _tag: "LiteralText";
|
|
791
|
+
readonly text: string;
|
|
792
|
+
})[]];
|
|
793
|
+
readonly monthYearFormat: readonly [{
|
|
794
|
+
readonly _tag: "MonthName";
|
|
795
|
+
} | {
|
|
796
|
+
readonly _tag: "MonthNumber";
|
|
797
|
+
} | {
|
|
798
|
+
readonly _tag: "PaddedMonthNumber";
|
|
799
|
+
} | {
|
|
800
|
+
readonly _tag: "ShortMonthName";
|
|
801
|
+
} | {
|
|
802
|
+
readonly _tag: "YearNumber";
|
|
803
|
+
} | {
|
|
804
|
+
readonly _tag: "LiteralText";
|
|
805
|
+
readonly text: string;
|
|
806
|
+
}, ...({
|
|
807
|
+
readonly _tag: "MonthName";
|
|
808
|
+
} | {
|
|
809
|
+
readonly _tag: "MonthNumber";
|
|
810
|
+
} | {
|
|
811
|
+
readonly _tag: "PaddedMonthNumber";
|
|
812
|
+
} | {
|
|
813
|
+
readonly _tag: "ShortMonthName";
|
|
814
|
+
} | {
|
|
815
|
+
readonly _tag: "YearNumber";
|
|
816
|
+
} | {
|
|
817
|
+
readonly _tag: "LiteralText";
|
|
818
|
+
readonly text: string;
|
|
819
|
+
})[]];
|
|
421
820
|
};
|
|
422
821
|
readonly maybeMinDate: Option.Option<{
|
|
423
822
|
readonly year: number;
|
|
@@ -474,17 +873,6 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
474
873
|
} | {
|
|
475
874
|
readonly _tag: "SelectedYear";
|
|
476
875
|
readonly year: number;
|
|
477
|
-
},
|
|
478
|
-
/** The selected date, read straight from the parent Model. The selected-day
|
|
479
|
-
* marker derives from it. */
|
|
480
|
-
maybeSelectedDate: Option.Option<CalendarDate>;
|
|
481
|
-
toView: (attributes: CalendarAttributes) => Html;
|
|
482
|
-
previousMonthLabel?: string;
|
|
483
|
-
nextMonthLabel?: string;
|
|
484
|
-
previousYearsPageLabel?: string;
|
|
485
|
-
nextYearsPageLabel?: string;
|
|
486
|
-
daysHeadingButtonLabel?: string;
|
|
487
|
-
monthsHeadingButtonLabel?: string;
|
|
488
|
-
}>>;
|
|
876
|
+
}, ViewInputs>;
|
|
489
877
|
export {};
|
|
490
878
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAIN,MAAM,EACN,MAAM,EAEP,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MA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IAC5C;+BAC2B;IAC3B,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;CAClE,CAAC,CAAA;AAEF;;;;oEAIoE;AACpE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC;kCAC8B;IAC9B,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IAC9C,MAAM,EAAE,CAAC,UAAU,EAAE,kBAAkB,KAAK,IAAI,CAAA;CACjD,CAAC,GACA,UAAU,CAAA;AAmfZ;;;yCAGyC;AACzC,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAWhB,CAAA"}
|
package/dist/calendar/index.js
CHANGED
|
@@ -405,15 +405,6 @@ const headingId = (modelId) => __foldkitBrandViewResult((`${modelId}-heading`),
|
|
|
405
405
|
const dayCellId = (modelId, date) => __foldkitBrandViewResult((`${modelId}-cell-${date.year}-${date.month}-${date.day}`), "@foldkit/ui/calendar/index.js#dayCellId");
|
|
406
406
|
const monthCellId = (modelId, month) => __foldkitBrandViewResult((`${modelId}-cell-month-${month}`), "@foldkit/ui/calendar/index.js#monthCellId");
|
|
407
407
|
const yearCellId = (modelId, year) => __foldkitBrandViewResult((`${modelId}-cell-year-${year}`), "@foldkit/ui/calendar/index.js#yearCellId");
|
|
408
|
-
const DAY_NAMES_SUNDAY_FIRST = [
|
|
409
|
-
'Sunday',
|
|
410
|
-
'Monday',
|
|
411
|
-
'Tuesday',
|
|
412
|
-
'Wednesday',
|
|
413
|
-
'Thursday',
|
|
414
|
-
'Friday',
|
|
415
|
-
'Saturday',
|
|
416
|
-
];
|
|
417
408
|
const DAY_OF_WEEK_INDEX = {
|
|
418
409
|
Sunday: 0,
|
|
419
410
|
Monday: 1,
|
|
@@ -476,8 +467,11 @@ const buildDaysAttributes = (model, viewInputs, h) => {
|
|
|
476
467
|
const previousMonthLabel = viewInputs.previousMonthLabel ?? 'Previous month';
|
|
477
468
|
const nextMonthLabel = viewInputs.nextMonthLabel ?? 'Next month';
|
|
478
469
|
const headingButtonLabel = viewInputs.daysHeadingButtonLabel ?? 'Switch to month picker';
|
|
479
|
-
const
|
|
480
|
-
const
|
|
470
|
+
const toDaysGridLabel = viewInputs.toDaysGridLabel ?? (monthYear => __foldkitBrandViewResult((`Calendar, ${monthYear}`), "@foldkit/ui/calendar/index.js#anonymous~44"));
|
|
471
|
+
const toWeekLabel = viewInputs.toWeekLabel ??
|
|
472
|
+
(weekStart => __foldkitBrandViewResult((`Week of ${Calendar.formatLong(weekStart, locale)}`), "@foldkit/ui/calendar/index.js#anonymous~45"));
|
|
473
|
+
const headingText = Calendar.formatMonthYear(Calendar.make(viewYear, viewMonth, 1), locale);
|
|
474
|
+
const rotatedDayNames = rotateDayNames(locale.dayNames, locale.firstDayOfWeek);
|
|
481
475
|
const rotatedShortDayNames = rotateDayNames(locale.shortDayNames, locale.firstDayOfWeek);
|
|
482
476
|
const { gridStart, weeks: weeksDates } = buildGrid(viewYear, viewMonth, locale.firstDayOfWeek);
|
|
483
477
|
const rootAttributes = [h.Id(id)];
|
|
@@ -501,18 +495,18 @@ const buildDaysAttributes = (model, viewInputs, h) => {
|
|
|
501
495
|
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/calendar/index.js#handleKeyDown");
|
|
502
496
|
}
|
|
503
497
|
if (isCommitKey(key)) {
|
|
504
|
-
const maybeCommit = pipe(maybeFocusedDate, Option.filter(date => __foldkitBrandViewResult((!isDateDisabled(model, date)), "@foldkit/ui/calendar/index.js#anonymous~
|
|
498
|
+
const maybeCommit = pipe(maybeFocusedDate, Option.filter(date => __foldkitBrandViewResult((!isDateDisabled(model, date)), "@foldkit/ui/calendar/index.js#anonymous~46")), Option.map(date => __foldkitBrandViewResult((Message.ClickedDay({ date })), "@foldkit/ui/calendar/index.js#anonymous~47")));
|
|
505
499
|
if (Option.isSome(maybeCommit)) {
|
|
506
500
|
return __foldkitBrandViewResult((maybeCommit), "@foldkit/ui/calendar/index.js#handleKeyDown");
|
|
507
501
|
}
|
|
508
502
|
}
|
|
509
503
|
return __foldkitBrandViewResult((Option.some(Message.PressedKeyOnGrid({ key, isShift: modifiers.shiftKey }))), "@foldkit/ui/calendar/index.js#handleKeyDown");
|
|
510
504
|
};
|
|
511
|
-
const activeDescendantAttributes = pipe(maybeFocusedDate, Option.map(date => __foldkitBrandViewResult((h.AriaActiveDescendant(dayCellId(id, date))), "@foldkit/ui/calendar/index.js#anonymous~
|
|
505
|
+
const activeDescendantAttributes = pipe(maybeFocusedDate, Option.map(date => __foldkitBrandViewResult((h.AriaActiveDescendant(dayCellId(id, date))), "@foldkit/ui/calendar/index.js#anonymous~48")), Option.toArray);
|
|
512
506
|
const gridAttributes = [
|
|
513
507
|
h.Id(gridId(id)),
|
|
514
508
|
h.Role('grid'),
|
|
515
|
-
h.AriaLabel(
|
|
509
|
+
h.AriaLabel(toDaysGridLabel(headingText)),
|
|
516
510
|
h.AriaRowcount(Number.increment(WEEKS_IN_GRID)),
|
|
517
511
|
h.AriaColcount(DAYS_IN_WEEK),
|
|
518
512
|
h.Tabindex(0),
|
|
@@ -567,19 +561,19 @@ const buildDaysAttributes = (model, viewInputs, h) => {
|
|
|
567
561
|
attributes: childAttributes([
|
|
568
562
|
h.Role('row'),
|
|
569
563
|
h.AriaRowindex(weekIndex + 2),
|
|
570
|
-
h.AriaLabel(
|
|
564
|
+
h.AriaLabel(toWeekLabel(weekStart)),
|
|
571
565
|
]),
|
|
572
566
|
cells: weekDates.map(buildDayCell),
|
|
573
|
-
}), "@foldkit/ui/calendar/index.js#anonymous~
|
|
567
|
+
}), "@foldkit/ui/calendar/index.js#anonymous~49");
|
|
574
568
|
});
|
|
575
|
-
const wrappedColumnHeaders = Array.zipWith(rotatedShortDayNames, rotatedDayNames, (name, fullName) => (__foldkitBrandViewResult(({ name, fullName }), "@foldkit/ui/calendar/index.js#anonymous~
|
|
569
|
+
const wrappedColumnHeaders = Array.zipWith(rotatedShortDayNames, rotatedDayNames, (name, fullName) => (__foldkitBrandViewResult(({ name, fullName }), "@foldkit/ui/calendar/index.js#anonymous~50"))).map(({ name, fullName }, columnIndex) => (__foldkitBrandViewResult(({
|
|
576
570
|
name,
|
|
577
571
|
attributes: childAttributes([
|
|
578
572
|
h.Role('columnheader'),
|
|
579
573
|
h.AriaLabel(fullName),
|
|
580
574
|
h.AriaColindex(Number.increment(columnIndex)),
|
|
581
575
|
]),
|
|
582
|
-
}), "@foldkit/ui/calendar/index.js#anonymous~
|
|
576
|
+
}), "@foldkit/ui/calendar/index.js#anonymous~51")));
|
|
583
577
|
return __foldkitBrandViewResult(({
|
|
584
578
|
_tag: 'Days',
|
|
585
579
|
root: childAttributes(rootAttributes),
|
|
@@ -596,6 +590,7 @@ const buildDaysAttributes = (model, viewInputs, h) => {
|
|
|
596
590
|
const buildMonthsAttributes = (model, viewInputs, h) => {
|
|
597
591
|
const { id, viewYear, viewMonth, maybeFocusedDate, today, locale, isGridFocused, } = model;
|
|
598
592
|
const headingButtonLabel = viewInputs.monthsHeadingButtonLabel ?? 'Switch to year picker';
|
|
593
|
+
const toMonthsGridLabel = viewInputs.toMonthsGridLabel ?? (year => __foldkitBrandViewResult((`Month picker, ${year}`), "@foldkit/ui/calendar/index.js#anonymous~52"));
|
|
599
594
|
const headingText = `${viewYear}`;
|
|
600
595
|
const rootAttributes = [h.Id(id)];
|
|
601
596
|
const headingButton = [
|
|
@@ -624,7 +619,7 @@ const buildMonthsAttributes = (model, viewInputs, h) => {
|
|
|
624
619
|
const gridAttributes = [
|
|
625
620
|
h.Id(gridId(id)),
|
|
626
621
|
h.Role('grid'),
|
|
627
|
-
h.AriaLabel(
|
|
622
|
+
h.AriaLabel(toMonthsGridLabel(viewYear)),
|
|
628
623
|
h.Tabindex(0),
|
|
629
624
|
h.OnFocus(Message.FocusedGrid()),
|
|
630
625
|
h.OnBlur(Message.BlurredGrid()),
|
|
@@ -653,7 +648,7 @@ const buildMonthsAttributes = (model, viewInputs, h) => {
|
|
|
653
648
|
const buttonAttributes = [
|
|
654
649
|
h.Type('button'),
|
|
655
650
|
h.Tabindex(-1),
|
|
656
|
-
h.AriaLabel(
|
|
651
|
+
h.AriaLabel(Calendar.formatMonthYear(Calendar.make(viewYear, month, 1), locale)),
|
|
657
652
|
h.AriaDisabled(isDisabled),
|
|
658
653
|
...(isDisabled ? [] : [h.OnClick(Message.SelectedMonth({ month }))]),
|
|
659
654
|
];
|
|
@@ -669,7 +664,7 @@ const buildMonthsAttributes = (model, viewInputs, h) => {
|
|
|
669
664
|
isDisabled,
|
|
670
665
|
}), "@foldkit/ui/calendar/index.js#buildMonthCell");
|
|
671
666
|
};
|
|
672
|
-
const cells = Array.makeBy(MONTHS_IN_YEAR, monthIndex => __foldkitBrandViewResult((buildMonthCell(Number.increment(monthIndex))), "@foldkit/ui/calendar/index.js#anonymous~
|
|
667
|
+
const cells = Array.makeBy(MONTHS_IN_YEAR, monthIndex => __foldkitBrandViewResult((buildMonthCell(Number.increment(monthIndex))), "@foldkit/ui/calendar/index.js#anonymous~53"));
|
|
673
668
|
return __foldkitBrandViewResult(({
|
|
674
669
|
_tag: 'Months',
|
|
675
670
|
root: childAttributes(rootAttributes),
|
|
@@ -683,6 +678,8 @@ const buildYearsAttributes = (model, viewInputs, h) => {
|
|
|
683
678
|
const { id, viewYear, maybeFocusedDate, today, isGridFocused } = model;
|
|
684
679
|
const previousYearsPageLabel = viewInputs.previousYearsPageLabel ?? 'Previous 12 years';
|
|
685
680
|
const nextYearsPageLabel = viewInputs.nextYearsPageLabel ?? 'Next 12 years';
|
|
681
|
+
const toYearsGridLabel = viewInputs.toYearsGridLabel ??
|
|
682
|
+
((startYear, endYear) => __foldkitBrandViewResult((`Year picker, ${startYear}–${endYear}`), "@foldkit/ui/calendar/index.js#anonymous~54"));
|
|
686
683
|
const cursorYear = Option.match(maybeFocusedDate, {
|
|
687
684
|
onNone: () => __foldkitBrandViewResult((viewYear), "@foldkit/ui/calendar/index.js#onNone~9"),
|
|
688
685
|
onSome: date => __foldkitBrandViewResult((date.year), "@foldkit/ui/calendar/index.js#onSome~9"),
|
|
@@ -719,7 +716,7 @@ const buildYearsAttributes = (model, viewInputs, h) => {
|
|
|
719
716
|
const gridAttributes = [
|
|
720
717
|
h.Id(gridId(id)),
|
|
721
718
|
h.Role('grid'),
|
|
722
|
-
h.AriaLabel(
|
|
719
|
+
h.AriaLabel(toYearsGridLabel(pageStart, pageEnd)),
|
|
723
720
|
h.Tabindex(0),
|
|
724
721
|
h.OnFocus(Message.FocusedGrid()),
|
|
725
722
|
h.OnBlur(Message.BlurredGrid()),
|
|
@@ -762,7 +759,7 @@ const buildYearsAttributes = (model, viewInputs, h) => {
|
|
|
762
759
|
isDisabled,
|
|
763
760
|
}), "@foldkit/ui/calendar/index.js#buildYearCell");
|
|
764
761
|
};
|
|
765
|
-
const cells = Array.makeBy(YEARS_PAGE_SIZE, offset => __foldkitBrandViewResult((buildYearCell(pageStart + offset)), "@foldkit/ui/calendar/index.js#anonymous~
|
|
762
|
+
const cells = Array.makeBy(YEARS_PAGE_SIZE, offset => __foldkitBrandViewResult((buildYearCell(pageStart + offset)), "@foldkit/ui/calendar/index.js#anonymous~55"));
|
|
766
763
|
return __foldkitBrandViewResult(({
|
|
767
764
|
_tag: 'Years',
|
|
768
765
|
root: childAttributes(rootAttributes),
|
|
@@ -777,4 +774,4 @@ const buildYearsAttributes = (model, viewInputs, h) => {
|
|
|
777
774
|
* bundles + derived cell data, then delegates layout to the consumer's
|
|
778
775
|
* `toView` callback. The variant of `CalendarAttributes` passed to
|
|
779
776
|
* `toView` matches `model.viewMode`. */
|
|
780
|
-
export const view = defineView((model, viewInputs, h) => __foldkitBrandViewResult((viewInputs.toView(Match.value(model.viewMode).pipe(Match.withReturnType(), Match.when('Days', () => __foldkitBrandViewResult((buildDaysAttributes(model, viewInputs, h)), "@foldkit/ui/calendar/index.js#anonymous~
|
|
777
|
+
export const view = defineView((model, viewInputs, h) => __foldkitBrandViewResult((viewInputs.toView(Match.value(model.viewMode).pipe(Match.withReturnType(), Match.when('Days', () => __foldkitBrandViewResult((buildDaysAttributes(model, viewInputs, h)), "@foldkit/ui/calendar/index.js#anonymous~57")), Match.when('Months', () => __foldkitBrandViewResult((buildMonthsAttributes(model, viewInputs, h)), "@foldkit/ui/calendar/index.js#anonymous~58")), Match.when('Years', () => __foldkitBrandViewResult((buildYearsAttributes(model, viewInputs, h)), "@foldkit/ui/calendar/index.js#anonymous~59")), Match.exhaustive))), "@foldkit/ui/calendar/index.js#anonymous~56"));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { init, update, view, selectDate, focusDate, reflectMinDate, reflectMaxDate, reflectDisabledDates, reflectDisabledDaysOfWeek, dropToDays, Model, ViewMode, Message, OutMessage, type ChangedViewMonth, type SelectedDate, type ClickedDay, type PressedKeyOnGrid, type SelectedMonth, type SelectedYear, FocusGrid, } from './index.js';
|
|
2
|
-
export type { InitConfig, ViewInputs, CalendarAttributes, DaysModeAttributes, MonthsModeAttributes, YearsModeAttributes, DayCell, ColumnHeader, Week, MonthCell, YearCell, } from './index.js';
|
|
2
|
+
export type { InitConfig, ViewInputs, ViewLabels, CalendarAttributes, DaysModeAttributes, MonthsModeAttributes, YearsModeAttributes, DayCell, ColumnHeader, Week, MonthCell, YearCell, } from './index.js';
|
|
3
3
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/calendar/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAS,EACT,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,SAAS,GACV,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,QAAQ,GACT,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/calendar/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAS,EACT,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,SAAS,GACV,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,QAAQ,GACT,MAAM,YAAY,CAAA"}
|
|
@@ -35,6 +35,77 @@ export declare const Model: Schema.Struct<{
|
|
|
35
35
|
readonly shortMonthNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
|
|
36
36
|
readonly dayNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
|
|
37
37
|
readonly shortDayNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
|
|
38
|
+
readonly longFormat: Schema.NonEmptyArray<import("foldkit/schema").TaggedUnion<{
|
|
39
|
+
readonly MonthName: {};
|
|
40
|
+
readonly ShortMonthName: {};
|
|
41
|
+
readonly MonthNumber: {};
|
|
42
|
+
readonly PaddedMonthNumber: {};
|
|
43
|
+
readonly DayNumber: {};
|
|
44
|
+
readonly PaddedDayNumber: {};
|
|
45
|
+
readonly DayName: {};
|
|
46
|
+
readonly ShortDayName: {};
|
|
47
|
+
readonly YearNumber: {};
|
|
48
|
+
readonly LiteralText: {
|
|
49
|
+
text: Schema.String;
|
|
50
|
+
};
|
|
51
|
+
}>>;
|
|
52
|
+
readonly shortFormat: Schema.NonEmptyArray<import("foldkit/schema").TaggedUnion<{
|
|
53
|
+
readonly MonthName: {};
|
|
54
|
+
readonly ShortMonthName: {};
|
|
55
|
+
readonly MonthNumber: {};
|
|
56
|
+
readonly PaddedMonthNumber: {};
|
|
57
|
+
readonly DayNumber: {};
|
|
58
|
+
readonly PaddedDayNumber: {};
|
|
59
|
+
readonly DayName: {};
|
|
60
|
+
readonly ShortDayName: {};
|
|
61
|
+
readonly YearNumber: {};
|
|
62
|
+
readonly LiteralText: {
|
|
63
|
+
text: Schema.String;
|
|
64
|
+
};
|
|
65
|
+
}>>;
|
|
66
|
+
readonly ariaLabelFormat: Schema.NonEmptyArray<import("foldkit/schema").TaggedUnion<{
|
|
67
|
+
readonly MonthName: {};
|
|
68
|
+
readonly ShortMonthName: {};
|
|
69
|
+
readonly MonthNumber: {};
|
|
70
|
+
readonly PaddedMonthNumber: {};
|
|
71
|
+
readonly DayNumber: {};
|
|
72
|
+
readonly PaddedDayNumber: {};
|
|
73
|
+
readonly DayName: {};
|
|
74
|
+
readonly ShortDayName: {};
|
|
75
|
+
readonly YearNumber: {};
|
|
76
|
+
readonly LiteralText: {
|
|
77
|
+
text: Schema.String;
|
|
78
|
+
};
|
|
79
|
+
}>>;
|
|
80
|
+
readonly monthYearFormat: Schema.NonEmptyArray<Schema.Union<readonly [Schema.TaggedStruct<"MonthName", {}> & ((value?: void | {
|
|
81
|
+
readonly _tag?: "MonthName";
|
|
82
|
+
} | undefined) => {
|
|
83
|
+
readonly _tag: "MonthName";
|
|
84
|
+
}), Schema.TaggedStruct<"ShortMonthName", {}> & ((value?: void | {
|
|
85
|
+
readonly _tag?: "ShortMonthName";
|
|
86
|
+
} | undefined) => {
|
|
87
|
+
readonly _tag: "ShortMonthName";
|
|
88
|
+
}), Schema.TaggedStruct<"MonthNumber", {}> & ((value?: void | {
|
|
89
|
+
readonly _tag?: "MonthNumber";
|
|
90
|
+
} | undefined) => {
|
|
91
|
+
readonly _tag: "MonthNumber";
|
|
92
|
+
}), Schema.TaggedStruct<"PaddedMonthNumber", {}> & ((value?: void | {
|
|
93
|
+
readonly _tag?: "PaddedMonthNumber";
|
|
94
|
+
} | undefined) => {
|
|
95
|
+
readonly _tag: "PaddedMonthNumber";
|
|
96
|
+
}), Schema.TaggedStruct<"YearNumber", {}> & ((value?: void | {
|
|
97
|
+
readonly _tag?: "YearNumber";
|
|
98
|
+
} | undefined) => {
|
|
99
|
+
readonly _tag: "YearNumber";
|
|
100
|
+
}), Schema.TaggedStruct<"LiteralText", {
|
|
101
|
+
readonly text: Schema.String;
|
|
102
|
+
}> & ((value: {
|
|
103
|
+
readonly _tag?: "LiteralText";
|
|
104
|
+
readonly text: string;
|
|
105
|
+
}) => {
|
|
106
|
+
readonly _tag: "LiteralText";
|
|
107
|
+
readonly text: string;
|
|
108
|
+
})]>>;
|
|
38
109
|
}>;
|
|
39
110
|
readonly maybeMinDate: Schema.Option<Schema.Struct<{
|
|
40
111
|
readonly year: Schema.Int;
|
|
@@ -214,6 +285,162 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
214
285
|
readonly shortMonthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
215
286
|
readonly dayNames: readonly [string, string, string, string, string, string, string];
|
|
216
287
|
readonly shortDayNames: readonly [string, string, string, string, string, string, string];
|
|
288
|
+
readonly longFormat: readonly [{
|
|
289
|
+
readonly _tag: "DayName";
|
|
290
|
+
} | {
|
|
291
|
+
readonly _tag: "DayNumber";
|
|
292
|
+
} | {
|
|
293
|
+
readonly _tag: "LiteralText";
|
|
294
|
+
readonly text: string;
|
|
295
|
+
} | {
|
|
296
|
+
readonly _tag: "MonthName";
|
|
297
|
+
} | {
|
|
298
|
+
readonly _tag: "MonthNumber";
|
|
299
|
+
} | {
|
|
300
|
+
readonly _tag: "PaddedDayNumber";
|
|
301
|
+
} | {
|
|
302
|
+
readonly _tag: "PaddedMonthNumber";
|
|
303
|
+
} | {
|
|
304
|
+
readonly _tag: "ShortDayName";
|
|
305
|
+
} | {
|
|
306
|
+
readonly _tag: "ShortMonthName";
|
|
307
|
+
} | {
|
|
308
|
+
readonly _tag: "YearNumber";
|
|
309
|
+
}, ...({
|
|
310
|
+
readonly _tag: "DayName";
|
|
311
|
+
} | {
|
|
312
|
+
readonly _tag: "DayNumber";
|
|
313
|
+
} | {
|
|
314
|
+
readonly _tag: "LiteralText";
|
|
315
|
+
readonly text: string;
|
|
316
|
+
} | {
|
|
317
|
+
readonly _tag: "MonthName";
|
|
318
|
+
} | {
|
|
319
|
+
readonly _tag: "MonthNumber";
|
|
320
|
+
} | {
|
|
321
|
+
readonly _tag: "PaddedDayNumber";
|
|
322
|
+
} | {
|
|
323
|
+
readonly _tag: "PaddedMonthNumber";
|
|
324
|
+
} | {
|
|
325
|
+
readonly _tag: "ShortDayName";
|
|
326
|
+
} | {
|
|
327
|
+
readonly _tag: "ShortMonthName";
|
|
328
|
+
} | {
|
|
329
|
+
readonly _tag: "YearNumber";
|
|
330
|
+
})[]];
|
|
331
|
+
readonly shortFormat: readonly [{
|
|
332
|
+
readonly _tag: "DayName";
|
|
333
|
+
} | {
|
|
334
|
+
readonly _tag: "DayNumber";
|
|
335
|
+
} | {
|
|
336
|
+
readonly _tag: "MonthName";
|
|
337
|
+
} | {
|
|
338
|
+
readonly _tag: "MonthNumber";
|
|
339
|
+
} | {
|
|
340
|
+
readonly _tag: "PaddedDayNumber";
|
|
341
|
+
} | {
|
|
342
|
+
readonly _tag: "PaddedMonthNumber";
|
|
343
|
+
} | {
|
|
344
|
+
readonly _tag: "ShortDayName";
|
|
345
|
+
} | {
|
|
346
|
+
readonly _tag: "ShortMonthName";
|
|
347
|
+
} | {
|
|
348
|
+
readonly _tag: "YearNumber";
|
|
349
|
+
} | {
|
|
350
|
+
readonly _tag: "LiteralText";
|
|
351
|
+
readonly text: string;
|
|
352
|
+
}, ...({
|
|
353
|
+
readonly _tag: "DayName";
|
|
354
|
+
} | {
|
|
355
|
+
readonly _tag: "DayNumber";
|
|
356
|
+
} | {
|
|
357
|
+
readonly _tag: "MonthName";
|
|
358
|
+
} | {
|
|
359
|
+
readonly _tag: "MonthNumber";
|
|
360
|
+
} | {
|
|
361
|
+
readonly _tag: "PaddedDayNumber";
|
|
362
|
+
} | {
|
|
363
|
+
readonly _tag: "PaddedMonthNumber";
|
|
364
|
+
} | {
|
|
365
|
+
readonly _tag: "ShortDayName";
|
|
366
|
+
} | {
|
|
367
|
+
readonly _tag: "ShortMonthName";
|
|
368
|
+
} | {
|
|
369
|
+
readonly _tag: "YearNumber";
|
|
370
|
+
} | {
|
|
371
|
+
readonly _tag: "LiteralText";
|
|
372
|
+
readonly text: string;
|
|
373
|
+
})[]];
|
|
374
|
+
readonly ariaLabelFormat: readonly [{
|
|
375
|
+
readonly _tag: "DayName";
|
|
376
|
+
} | {
|
|
377
|
+
readonly _tag: "DayNumber";
|
|
378
|
+
} | {
|
|
379
|
+
readonly _tag: "MonthName";
|
|
380
|
+
} | {
|
|
381
|
+
readonly _tag: "MonthNumber";
|
|
382
|
+
} | {
|
|
383
|
+
readonly _tag: "PaddedDayNumber";
|
|
384
|
+
} | {
|
|
385
|
+
readonly _tag: "PaddedMonthNumber";
|
|
386
|
+
} | {
|
|
387
|
+
readonly _tag: "ShortDayName";
|
|
388
|
+
} | {
|
|
389
|
+
readonly _tag: "ShortMonthName";
|
|
390
|
+
} | {
|
|
391
|
+
readonly _tag: "YearNumber";
|
|
392
|
+
} | {
|
|
393
|
+
readonly _tag: "LiteralText";
|
|
394
|
+
readonly text: string;
|
|
395
|
+
}, ...({
|
|
396
|
+
readonly _tag: "DayName";
|
|
397
|
+
} | {
|
|
398
|
+
readonly _tag: "DayNumber";
|
|
399
|
+
} | {
|
|
400
|
+
readonly _tag: "MonthName";
|
|
401
|
+
} | {
|
|
402
|
+
readonly _tag: "MonthNumber";
|
|
403
|
+
} | {
|
|
404
|
+
readonly _tag: "PaddedDayNumber";
|
|
405
|
+
} | {
|
|
406
|
+
readonly _tag: "PaddedMonthNumber";
|
|
407
|
+
} | {
|
|
408
|
+
readonly _tag: "ShortDayName";
|
|
409
|
+
} | {
|
|
410
|
+
readonly _tag: "ShortMonthName";
|
|
411
|
+
} | {
|
|
412
|
+
readonly _tag: "YearNumber";
|
|
413
|
+
} | {
|
|
414
|
+
readonly _tag: "LiteralText";
|
|
415
|
+
readonly text: string;
|
|
416
|
+
})[]];
|
|
417
|
+
readonly monthYearFormat: readonly [{
|
|
418
|
+
readonly _tag: "MonthName";
|
|
419
|
+
} | {
|
|
420
|
+
readonly _tag: "MonthNumber";
|
|
421
|
+
} | {
|
|
422
|
+
readonly _tag: "PaddedMonthNumber";
|
|
423
|
+
} | {
|
|
424
|
+
readonly _tag: "ShortMonthName";
|
|
425
|
+
} | {
|
|
426
|
+
readonly _tag: "YearNumber";
|
|
427
|
+
} | {
|
|
428
|
+
readonly _tag: "LiteralText";
|
|
429
|
+
readonly text: string;
|
|
430
|
+
}, ...({
|
|
431
|
+
readonly _tag: "MonthName";
|
|
432
|
+
} | {
|
|
433
|
+
readonly _tag: "MonthNumber";
|
|
434
|
+
} | {
|
|
435
|
+
readonly _tag: "PaddedMonthNumber";
|
|
436
|
+
} | {
|
|
437
|
+
readonly _tag: "ShortMonthName";
|
|
438
|
+
} | {
|
|
439
|
+
readonly _tag: "YearNumber";
|
|
440
|
+
} | {
|
|
441
|
+
readonly _tag: "LiteralText";
|
|
442
|
+
readonly text: string;
|
|
443
|
+
})[]];
|
|
217
444
|
};
|
|
218
445
|
readonly maybeMinDate: Option.Option<{
|
|
219
446
|
readonly year: number;
|
|
@@ -408,7 +635,7 @@ export declare const triggerId: (id: string) => string;
|
|
|
408
635
|
* The DatePicker emits a `SelectedDate({ date })` OutMessage when the
|
|
409
636
|
* user commits a date. Handle it in the `foldOutMessage` of the
|
|
410
637
|
* DatePicker's `Update.foldChild` config to lift the date into domain
|
|
411
|
-
* state. */
|
|
638
|
+
* state. Calendar label fields are forwarded to the embedded Calendar. */
|
|
412
639
|
export type ViewInputs = Readonly<{
|
|
413
640
|
anchor: AnchorConfig;
|
|
414
641
|
/** The selected date, read straight from the parent Model. The trigger
|
|
@@ -437,7 +664,7 @@ export type ViewInputs = Readonly<{
|
|
|
437
664
|
panelAttributes?: ReadonlyArray<ChildAttribute>;
|
|
438
665
|
backdropClassName?: string;
|
|
439
666
|
backdropAttributes?: ReadonlyArray<ChildAttribute>;
|
|
440
|
-
}
|
|
667
|
+
}> & UiCalendar.ViewLabels;
|
|
441
668
|
/** Renders an accessible date picker: a trigger button that opens a popover
|
|
442
669
|
* containing an accessible calendar grid. The date picker assembles the
|
|
443
670
|
* embedded Calendar and Popover components into one flat API. Consumers
|
|
@@ -467,6 +694,162 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
467
694
|
readonly shortMonthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
468
695
|
readonly dayNames: readonly [string, string, string, string, string, string, string];
|
|
469
696
|
readonly shortDayNames: readonly [string, string, string, string, string, string, string];
|
|
697
|
+
readonly longFormat: readonly [{
|
|
698
|
+
readonly _tag: "DayName";
|
|
699
|
+
} | {
|
|
700
|
+
readonly _tag: "DayNumber";
|
|
701
|
+
} | {
|
|
702
|
+
readonly _tag: "LiteralText";
|
|
703
|
+
readonly text: string;
|
|
704
|
+
} | {
|
|
705
|
+
readonly _tag: "MonthName";
|
|
706
|
+
} | {
|
|
707
|
+
readonly _tag: "MonthNumber";
|
|
708
|
+
} | {
|
|
709
|
+
readonly _tag: "PaddedDayNumber";
|
|
710
|
+
} | {
|
|
711
|
+
readonly _tag: "PaddedMonthNumber";
|
|
712
|
+
} | {
|
|
713
|
+
readonly _tag: "ShortDayName";
|
|
714
|
+
} | {
|
|
715
|
+
readonly _tag: "ShortMonthName";
|
|
716
|
+
} | {
|
|
717
|
+
readonly _tag: "YearNumber";
|
|
718
|
+
}, ...({
|
|
719
|
+
readonly _tag: "DayName";
|
|
720
|
+
} | {
|
|
721
|
+
readonly _tag: "DayNumber";
|
|
722
|
+
} | {
|
|
723
|
+
readonly _tag: "LiteralText";
|
|
724
|
+
readonly text: string;
|
|
725
|
+
} | {
|
|
726
|
+
readonly _tag: "MonthName";
|
|
727
|
+
} | {
|
|
728
|
+
readonly _tag: "MonthNumber";
|
|
729
|
+
} | {
|
|
730
|
+
readonly _tag: "PaddedDayNumber";
|
|
731
|
+
} | {
|
|
732
|
+
readonly _tag: "PaddedMonthNumber";
|
|
733
|
+
} | {
|
|
734
|
+
readonly _tag: "ShortDayName";
|
|
735
|
+
} | {
|
|
736
|
+
readonly _tag: "ShortMonthName";
|
|
737
|
+
} | {
|
|
738
|
+
readonly _tag: "YearNumber";
|
|
739
|
+
})[]];
|
|
740
|
+
readonly shortFormat: readonly [{
|
|
741
|
+
readonly _tag: "DayName";
|
|
742
|
+
} | {
|
|
743
|
+
readonly _tag: "DayNumber";
|
|
744
|
+
} | {
|
|
745
|
+
readonly _tag: "MonthName";
|
|
746
|
+
} | {
|
|
747
|
+
readonly _tag: "MonthNumber";
|
|
748
|
+
} | {
|
|
749
|
+
readonly _tag: "PaddedDayNumber";
|
|
750
|
+
} | {
|
|
751
|
+
readonly _tag: "PaddedMonthNumber";
|
|
752
|
+
} | {
|
|
753
|
+
readonly _tag: "ShortDayName";
|
|
754
|
+
} | {
|
|
755
|
+
readonly _tag: "ShortMonthName";
|
|
756
|
+
} | {
|
|
757
|
+
readonly _tag: "YearNumber";
|
|
758
|
+
} | {
|
|
759
|
+
readonly _tag: "LiteralText";
|
|
760
|
+
readonly text: string;
|
|
761
|
+
}, ...({
|
|
762
|
+
readonly _tag: "DayName";
|
|
763
|
+
} | {
|
|
764
|
+
readonly _tag: "DayNumber";
|
|
765
|
+
} | {
|
|
766
|
+
readonly _tag: "MonthName";
|
|
767
|
+
} | {
|
|
768
|
+
readonly _tag: "MonthNumber";
|
|
769
|
+
} | {
|
|
770
|
+
readonly _tag: "PaddedDayNumber";
|
|
771
|
+
} | {
|
|
772
|
+
readonly _tag: "PaddedMonthNumber";
|
|
773
|
+
} | {
|
|
774
|
+
readonly _tag: "ShortDayName";
|
|
775
|
+
} | {
|
|
776
|
+
readonly _tag: "ShortMonthName";
|
|
777
|
+
} | {
|
|
778
|
+
readonly _tag: "YearNumber";
|
|
779
|
+
} | {
|
|
780
|
+
readonly _tag: "LiteralText";
|
|
781
|
+
readonly text: string;
|
|
782
|
+
})[]];
|
|
783
|
+
readonly ariaLabelFormat: readonly [{
|
|
784
|
+
readonly _tag: "DayName";
|
|
785
|
+
} | {
|
|
786
|
+
readonly _tag: "DayNumber";
|
|
787
|
+
} | {
|
|
788
|
+
readonly _tag: "MonthName";
|
|
789
|
+
} | {
|
|
790
|
+
readonly _tag: "MonthNumber";
|
|
791
|
+
} | {
|
|
792
|
+
readonly _tag: "PaddedDayNumber";
|
|
793
|
+
} | {
|
|
794
|
+
readonly _tag: "PaddedMonthNumber";
|
|
795
|
+
} | {
|
|
796
|
+
readonly _tag: "ShortDayName";
|
|
797
|
+
} | {
|
|
798
|
+
readonly _tag: "ShortMonthName";
|
|
799
|
+
} | {
|
|
800
|
+
readonly _tag: "YearNumber";
|
|
801
|
+
} | {
|
|
802
|
+
readonly _tag: "LiteralText";
|
|
803
|
+
readonly text: string;
|
|
804
|
+
}, ...({
|
|
805
|
+
readonly _tag: "DayName";
|
|
806
|
+
} | {
|
|
807
|
+
readonly _tag: "DayNumber";
|
|
808
|
+
} | {
|
|
809
|
+
readonly _tag: "MonthName";
|
|
810
|
+
} | {
|
|
811
|
+
readonly _tag: "MonthNumber";
|
|
812
|
+
} | {
|
|
813
|
+
readonly _tag: "PaddedDayNumber";
|
|
814
|
+
} | {
|
|
815
|
+
readonly _tag: "PaddedMonthNumber";
|
|
816
|
+
} | {
|
|
817
|
+
readonly _tag: "ShortDayName";
|
|
818
|
+
} | {
|
|
819
|
+
readonly _tag: "ShortMonthName";
|
|
820
|
+
} | {
|
|
821
|
+
readonly _tag: "YearNumber";
|
|
822
|
+
} | {
|
|
823
|
+
readonly _tag: "LiteralText";
|
|
824
|
+
readonly text: string;
|
|
825
|
+
})[]];
|
|
826
|
+
readonly monthYearFormat: readonly [{
|
|
827
|
+
readonly _tag: "MonthName";
|
|
828
|
+
} | {
|
|
829
|
+
readonly _tag: "MonthNumber";
|
|
830
|
+
} | {
|
|
831
|
+
readonly _tag: "PaddedMonthNumber";
|
|
832
|
+
} | {
|
|
833
|
+
readonly _tag: "ShortMonthName";
|
|
834
|
+
} | {
|
|
835
|
+
readonly _tag: "YearNumber";
|
|
836
|
+
} | {
|
|
837
|
+
readonly _tag: "LiteralText";
|
|
838
|
+
readonly text: string;
|
|
839
|
+
}, ...({
|
|
840
|
+
readonly _tag: "MonthName";
|
|
841
|
+
} | {
|
|
842
|
+
readonly _tag: "MonthNumber";
|
|
843
|
+
} | {
|
|
844
|
+
readonly _tag: "PaddedMonthNumber";
|
|
845
|
+
} | {
|
|
846
|
+
readonly _tag: "ShortMonthName";
|
|
847
|
+
} | {
|
|
848
|
+
readonly _tag: "YearNumber";
|
|
849
|
+
} | {
|
|
850
|
+
readonly _tag: "LiteralText";
|
|
851
|
+
readonly text: string;
|
|
852
|
+
})[]];
|
|
470
853
|
};
|
|
471
854
|
readonly maybeMinDate: Option.Option<{
|
|
472
855
|
readonly year: number;
|
|
@@ -597,34 +980,6 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
597
980
|
readonly month: number;
|
|
598
981
|
readonly day: number;
|
|
599
982
|
};
|
|
600
|
-
},
|
|
601
|
-
anchor: AnchorConfig;
|
|
602
|
-
/** The selected date, read straight from the parent Model. The trigger
|
|
603
|
-
* content, the calendar's selected-day marker, and the hidden form input all
|
|
604
|
-
* derive from it. */
|
|
605
|
-
maybeSelectedDate: Option.Option<CalendarDate>;
|
|
606
|
-
/** Renders the trigger button's content (typically the formatted selected
|
|
607
|
-
* date or a placeholder). Receives the current selection. */
|
|
608
|
-
triggerContent: (maybeDate: Option.Option<CalendarDate>) => Html;
|
|
609
|
-
/** Renders the calendar grid layout inside the popover panel. The
|
|
610
|
-
* consumer lays out the attribute bundles exactly as they would for
|
|
611
|
-
* an inline calendar. */
|
|
612
|
-
toCalendarView: (attributes: UiCalendar.CalendarAttributes) => Html;
|
|
613
|
-
isDisabled?: boolean;
|
|
614
|
-
/** Name for the hidden form input. When provided, a hidden `<input>` is
|
|
615
|
-
* rendered alongside the trigger so native form submission captures the
|
|
616
|
-
* selected date as an ISO string (`YYYY-MM-DD`). */
|
|
617
|
-
name?: string;
|
|
618
|
-
className?: string;
|
|
619
|
-
attributes?: ReadonlyArray<ChildAttribute>;
|
|
620
|
-
triggerClassName?: string;
|
|
621
|
-
triggerAttributes?: ReadonlyArray<ChildAttribute>;
|
|
622
|
-
ariaLabel?: string;
|
|
623
|
-
ariaLabelledBy?: string;
|
|
624
|
-
panelClassName?: string;
|
|
625
|
-
panelAttributes?: ReadonlyArray<ChildAttribute>;
|
|
626
|
-
backdropClassName?: string;
|
|
627
|
-
backdropAttributes?: ReadonlyArray<ChildAttribute>;
|
|
628
|
-
}>>;
|
|
983
|
+
}, ViewInputs>;
|
|
629
984
|
export {};
|
|
630
985
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/datePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAa,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC5D,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGxD,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAA;AAMlD;;;;wBAIwB;AACxB,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/datePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAa,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC5D,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGxD,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAA;AAMlD;;;;wBAIwB;AACxB,eAAO,MAAM,KAAK;;;;;;;;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AC1B,kBAAkB,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;CACnD,CAAC,GACA,UAAU,CAAC,UAAU,CAAA;AAEvB;;;;gEAIgE;AAChE,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiJhB,CAAA"}
|
package/dist/datePicker/index.js
CHANGED
|
@@ -208,11 +208,47 @@ export const view = defineView((model, viewInputs, h) => {
|
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
210
|
const triggerLabelAttributes = resolveTriggerLabel();
|
|
211
|
+
const calendarViewLabels = {
|
|
212
|
+
...(viewInputs.previousMonthLabel !== undefined && {
|
|
213
|
+
previousMonthLabel: viewInputs.previousMonthLabel,
|
|
214
|
+
}),
|
|
215
|
+
...(viewInputs.nextMonthLabel !== undefined && {
|
|
216
|
+
nextMonthLabel: viewInputs.nextMonthLabel,
|
|
217
|
+
}),
|
|
218
|
+
...(viewInputs.previousYearsPageLabel !== undefined && {
|
|
219
|
+
previousYearsPageLabel: viewInputs.previousYearsPageLabel,
|
|
220
|
+
}),
|
|
221
|
+
...(viewInputs.nextYearsPageLabel !== undefined && {
|
|
222
|
+
nextYearsPageLabel: viewInputs.nextYearsPageLabel,
|
|
223
|
+
}),
|
|
224
|
+
...(viewInputs.daysHeadingButtonLabel !== undefined && {
|
|
225
|
+
daysHeadingButtonLabel: viewInputs.daysHeadingButtonLabel,
|
|
226
|
+
}),
|
|
227
|
+
...(viewInputs.monthsHeadingButtonLabel !== undefined && {
|
|
228
|
+
monthsHeadingButtonLabel: viewInputs.monthsHeadingButtonLabel,
|
|
229
|
+
}),
|
|
230
|
+
...(viewInputs.toDaysGridLabel !== undefined && {
|
|
231
|
+
toDaysGridLabel: viewInputs.toDaysGridLabel,
|
|
232
|
+
}),
|
|
233
|
+
...(viewInputs.toWeekLabel !== undefined && {
|
|
234
|
+
toWeekLabel: viewInputs.toWeekLabel,
|
|
235
|
+
}),
|
|
236
|
+
...(viewInputs.toMonthsGridLabel !== undefined && {
|
|
237
|
+
toMonthsGridLabel: viewInputs.toMonthsGridLabel,
|
|
238
|
+
}),
|
|
239
|
+
...(viewInputs.toYearsGridLabel !== undefined && {
|
|
240
|
+
toYearsGridLabel: viewInputs.toYearsGridLabel,
|
|
241
|
+
}),
|
|
242
|
+
};
|
|
211
243
|
const calendarVNode = h.submodel({
|
|
212
244
|
slotId: model.calendar.id,
|
|
213
245
|
model: model.calendar,
|
|
214
246
|
view: UiCalendar.view,
|
|
215
|
-
viewInputs: {
|
|
247
|
+
viewInputs: {
|
|
248
|
+
maybeSelectedDate,
|
|
249
|
+
toView: toCalendarView,
|
|
250
|
+
...calendarViewLabels,
|
|
251
|
+
},
|
|
216
252
|
toParentMessage: message => __foldkitBrandViewResult((Message.GotCalendarMessage({ message })), "@foldkit/ui/datePicker/index.js#toParentMessage~3"),
|
|
217
253
|
});
|
|
218
254
|
const popoverVNode = h.submodel({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dragAndDrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,WAAW,EAEX,MAAM,EAEN,MAAM,EACN,MAAM,EAEP,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAmB,MAAM,cAAc,CAAA;AAIh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AAK,CAAC,CAIhC,CAAA;AAED;;;aAGa;AACb,eAAO,MAAM,QAAQ,WAAY,MAAM,KAAG,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAEvE,CAAA;AAKD,kGAAkG;AAClG,eAAO,MAAM,UAAU,UACd,KAAK,KACX,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcpC,CAAA;AAEH,kFAAkF;AAClF,eAAO,MAAM,UAAU,4BAA6B,KAAK,KAAG,OACR,CAAA;AAEpD,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,UAAW,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAMnE,CAAA;AAEH,oJAAoJ;AACpJ,eAAO,MAAM,eAAe,UACnB,KAAK,KACX,MAAM,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,IAAI,CAUpC,CAAA"}
|
|
@@ -389,30 +389,23 @@ export const subscriptions = Subscription.make()(entry => (__foldkitBrandViewRes
|
|
|
389
389
|
modelToDependencies: model => (__foldkitBrandViewResult(({
|
|
390
390
|
dragActivity: keyboardDragActivityFromModel(model),
|
|
391
391
|
}), "@foldkit/ui/dragAndDrop/index.js#modelToDependencies~3")),
|
|
392
|
-
dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
392
|
+
dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(Subscription.fromEventFilterMapPreventDefault({
|
|
393
|
+
target: document,
|
|
394
|
+
type: 'keydown',
|
|
395
|
+
toMessage: event => {
|
|
396
|
+
// NOTE: the draggable's OnKeyDownPreventDefault calls preventDefault on
|
|
397
|
+
// the Space that activates keyboard drag. Skip it here so the same
|
|
398
|
+
// keypress doesn't also confirm the drop in the same tick.
|
|
399
|
+
if (event.defaultPrevented) {
|
|
400
|
+
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/dragAndDrop/index.js#toMessage");
|
|
401
|
+
}
|
|
402
|
+
return __foldkitBrandViewResult((Match.value(event.key).pipe(Match.withReturnType(), Match.when('Tab', () => __foldkitBrandViewResult((Option.some(Message.PressedArrowKey({
|
|
402
403
|
direction: event.shiftKey
|
|
403
404
|
? 'PreviousContainer'
|
|
404
405
|
: 'NextContainer',
|
|
405
|
-
}))), "@foldkit/ui/dragAndDrop/index.js#anonymous~51");
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
event.preventDefault();
|
|
409
|
-
return __foldkitBrandViewResult((Option.some(Message.ConfirmedKeyboardDrop())), "@foldkit/ui/dragAndDrop/index.js#anonymous~51");
|
|
410
|
-
}
|
|
411
|
-
return __foldkitBrandViewResult((Option.map(arrowKeyToDirection(event.key), direction => {
|
|
412
|
-
event.preventDefault();
|
|
413
|
-
return __foldkitBrandViewResult((Message.PressedArrowKey({ direction })), "@foldkit/ui/dragAndDrop/index.js#anonymous~52");
|
|
414
|
-
})), "@foldkit/ui/dragAndDrop/index.js#anonymous~51");
|
|
415
|
-
})), "@foldkit/ui/dragAndDrop/index.js#anonymous~50")), Stream.filter(Option.isSome), Stream.map(option => __foldkitBrandViewResult((option.value), "@foldkit/ui/dragAndDrop/index.js#anonymous~53"))), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/dragAndDrop/index.js#anonymous~54")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream~3"),
|
|
406
|
+
}))), "@foldkit/ui/dragAndDrop/index.js#anonymous~50")), Match.whenOr(' ', 'Enter', () => __foldkitBrandViewResult((Option.some(Message.ConfirmedKeyboardDrop())), "@foldkit/ui/dragAndDrop/index.js#anonymous~51")), Match.orElse(key => __foldkitBrandViewResult((Option.map(arrowKeyToDirection(key), direction => __foldkitBrandViewResult((Message.PressedArrowKey({ direction })), "@foldkit/ui/dragAndDrop/index.js#anonymous~53"))), "@foldkit/ui/dragAndDrop/index.js#anonymous~52")))), "@foldkit/ui/dragAndDrop/index.js#toMessage");
|
|
407
|
+
},
|
|
408
|
+
}), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/dragAndDrop/index.js#anonymous~54")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream~3"),
|
|
416
409
|
}),
|
|
417
410
|
autoScroll: entry({
|
|
418
411
|
isDragging: Schema.Boolean,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foldkit/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.160.0-canary.10b9fda28a24",
|
|
4
4
|
"description": "Headless, accessible UI components for Foldkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -121,21 +121,21 @@
|
|
|
121
121
|
"dist"
|
|
122
122
|
],
|
|
123
123
|
"peerDependencies": {
|
|
124
|
-
"effect": "4.0.0-rc.
|
|
125
|
-
"foldkit": "
|
|
124
|
+
"effect": "4.0.0-rc.115",
|
|
125
|
+
"foldkit": "0.160.0-canary.10b9fda28a24"
|
|
126
126
|
},
|
|
127
127
|
"dependencies": {
|
|
128
128
|
"@floating-ui/dom": "^1.8.0"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
|
-
"@effect/vitest": "4.0.0-rc.
|
|
132
|
-
"effect": "4.0.0-rc.
|
|
131
|
+
"@effect/vitest": "4.0.0-rc.115",
|
|
132
|
+
"effect": "4.0.0-rc.115",
|
|
133
133
|
"happy-dom": "^20.11.13",
|
|
134
134
|
"rimraf": "^6.1.3",
|
|
135
135
|
"typescript": "^7.0.2",
|
|
136
|
-
"vitest": "^
|
|
137
|
-
"@foldkit/vite-plugin": "0.
|
|
138
|
-
"foldkit": "0.
|
|
136
|
+
"vitest": "^5.0.0",
|
|
137
|
+
"@foldkit/vite-plugin": "0.22.0-canary.10b9fda28a24",
|
|
138
|
+
"foldkit": "0.160.0-canary.10b9fda28a24"
|
|
139
139
|
},
|
|
140
140
|
"keywords": [
|
|
141
141
|
"foldkit",
|