@foldkit/ui 0.160.0 → 0.161.0-canary.71e9b47d6cab
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/combobox/multi.d.ts +2 -0
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/public.d.ts +1 -1
- package/dist/combobox/public.d.ts.map +1 -1
- package/dist/combobox/shared.d.ts +4 -0
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +52 -36
- package/dist/combobox/single.d.ts +2 -0
- package/dist/combobox/single.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/dialog/index.d.ts +57 -22
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +130 -42
- package/dist/dialog/public.d.ts +1 -1
- package/dist/dialog/public.d.ts.map +1 -1
- package/dist/dialog/public.js +1 -1
- package/dist/disclosure/index.d.ts +15 -2
- package/dist/disclosure/index.d.ts.map +1 -1
- package/dist/disclosure/index.js +20 -14
- package/dist/disclosure/public.d.ts +1 -1
- package/dist/disclosure/public.d.ts.map +1 -1
- package/dist/dragAndDrop/index.d.ts +39 -0
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.js +2 -1
- package/dist/dragAndDrop/public.d.ts +1 -1
- package/dist/dragAndDrop/public.d.ts.map +1 -1
- package/dist/dragAndDrop/public.js +1 -1
- package/dist/listbox/shared.js +1 -1
- package/dist/menu/index.js +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/tabs/index.d.ts +10 -1
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +8 -2
- package/dist/tabs/public.d.ts +1 -1
- package/dist/tabs/public.d.ts.map +1 -1
- package/dist/tabs/public.js +1 -1
- package/dist/test/apps/disabledButton.d.ts +6 -0
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +1 -1
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +4 -6
- package/package.json +4 -4
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,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,IAAI,EAGV,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,kBAAkB,CAAA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ChC;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"}
|
package/dist/combobox/multi.d.ts
CHANGED
|
@@ -147,6 +147,8 @@ export declare const update: (model: {
|
|
|
147
147
|
readonly item: string;
|
|
148
148
|
readonly displayText: string;
|
|
149
149
|
readonly wasSelected: boolean;
|
|
150
|
+
} | {
|
|
151
|
+
readonly _tag: "SuppressedEmptyItemNavigation";
|
|
150
152
|
} | {
|
|
151
153
|
readonly _tag: "SuppressedItemCommit";
|
|
152
154
|
} | {
|