foldkit 0.81.1 → 0.82.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/calendar/calendarDate.d.ts +11 -11
- package/dist/calendar/calendarDate.d.ts.map +1 -1
- package/dist/calendar/calendarDate.js +14 -13
- package/dist/calendar/comparison.d.ts +3 -3
- package/dist/calendar/comparison.d.ts.map +1 -1
- package/dist/calendar/comparison.js +5 -5
- package/dist/calendar/info.d.ts +1 -1
- package/dist/calendar/info.d.ts.map +1 -1
- package/dist/calendar/info.js +9 -1
- package/dist/calendar/locale.d.ts +5 -5
- package/dist/calendar/locale.js +23 -2
- package/dist/command/index.d.ts +2 -2
- package/dist/command/index.d.ts.map +1 -1
- package/dist/devTools/overlay.d.ts.map +1 -1
- package/dist/devTools/overlay.js +49 -27
- package/dist/devTools/protocol.d.ts +192 -192
- package/dist/devTools/protocol.d.ts.map +1 -1
- package/dist/devTools/protocol.js +36 -12
- package/dist/devTools/serialize.d.ts.map +1 -1
- package/dist/devTools/serialize.js +4 -4
- package/dist/devTools/store.d.ts.map +1 -1
- package/dist/devTools/store.js +1 -2
- package/dist/devTools/submodelPath.d.ts +1 -1
- package/dist/devTools/summarize.d.ts +6 -6
- package/dist/devTools/summarize.d.ts.map +1 -1
- package/dist/devTools/summarize.js +6 -6
- package/dist/devTools/webSocketBridge.d.ts +1 -1
- package/dist/devTools/webSocketBridge.d.ts.map +1 -1
- package/dist/devTools/webSocketBridge.js +19 -18
- package/dist/fieldValidation/index.d.ts +11 -11
- package/dist/fieldValidation/index.d.ts.map +1 -1
- package/dist/fieldValidation/index.js +8 -7
- package/dist/file/error.d.ts +1 -1
- package/dist/file/file.d.ts +1 -1
- package/dist/file/file.js +1 -1
- package/dist/file/reader.d.ts +4 -4
- package/dist/file/reader.js +5 -5
- package/dist/file/select.js +1 -1
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +4 -3
- package/dist/html/lazy.d.ts.map +1 -1
- package/dist/html/lazy.js +6 -7
- package/dist/managedResource/index.d.ts +2 -2
- package/dist/managedResource/index.d.ts.map +1 -1
- package/dist/managedResource/index.js +2 -2
- package/dist/mount/index.d.ts +1 -1
- package/dist/mount/index.d.ts.map +1 -1
- package/dist/route/parser.d.ts +2 -2
- package/dist/route/parser.d.ts.map +1 -1
- package/dist/route/parser.js +5 -5
- package/dist/runtime/browserListeners.d.ts.map +1 -1
- package/dist/runtime/browserListeners.js +6 -7
- package/dist/runtime/deepFreeze.d.ts +1 -1
- package/dist/runtime/deepFreeze.js +2 -2
- package/dist/runtime/hmrProtocol.d.ts +22 -0
- package/dist/runtime/hmrProtocol.d.ts.map +1 -0
- package/dist/runtime/hmrProtocol.js +15 -0
- package/dist/runtime/hmrProtocolPublic.d.ts +2 -0
- package/dist/runtime/hmrProtocolPublic.d.ts.map +1 -0
- package/dist/runtime/hmrProtocolPublic.js +1 -0
- package/dist/runtime/runtime.d.ts +10 -7
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +116 -114
- package/dist/runtime/subscription.d.ts +5 -5
- package/dist/runtime/subscription.d.ts.map +1 -1
- package/dist/runtime/urlRequest.d.ts +15 -15
- package/dist/runtime/urlRequest.d.ts.map +1 -1
- package/dist/runtime/urlRequest.js +1 -1
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +10 -4
- package/dist/task/dom.js +1 -1
- package/dist/task/elementMovement.js +1 -1
- package/dist/task/error.d.ts +2 -2
- package/dist/task/inert.d.ts.map +1 -1
- package/dist/task/inert.js +4 -7
- package/dist/task/time.d.ts +1 -1
- package/dist/task/time.js +1 -1
- package/dist/task/timing.d.ts +1 -1
- package/dist/task/timing.d.ts.map +1 -1
- package/dist/task/timing.js +2 -2
- package/dist/test/apps/bubbling.d.ts +3 -3
- package/dist/test/apps/bubbling.d.ts.map +1 -1
- package/dist/test/apps/bubbling.js +1 -1
- package/dist/test/apps/counter.d.ts +6 -6
- package/dist/test/apps/counter.d.ts.map +1 -1
- package/dist/test/apps/counter.js +7 -1
- package/dist/test/apps/disabledButton.d.ts +11 -11
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +1 -1
- package/dist/test/apps/fileUpload.d.ts +4 -4
- package/dist/test/apps/fileUpload.d.ts.map +1 -1
- package/dist/test/apps/fileUpload.js +1 -1
- package/dist/test/apps/formChild.d.ts +16 -16
- package/dist/test/apps/formChild.d.ts.map +1 -1
- package/dist/test/apps/formChild.js +9 -4
- package/dist/test/apps/interactions.d.ts +8 -8
- package/dist/test/apps/interactions.d.ts.map +1 -1
- package/dist/test/apps/interactions.js +8 -1
- package/dist/test/apps/keypress.d.ts +7 -7
- package/dist/test/apps/keypress.d.ts.map +1 -1
- package/dist/test/apps/keypress.js +1 -1
- package/dist/test/apps/login.d.ts +14 -14
- package/dist/test/apps/login.d.ts.map +1 -1
- package/dist/test/apps/login.js +9 -2
- package/dist/test/apps/logoutButton.d.ts +3 -3
- package/dist/test/apps/logoutButton.d.ts.map +1 -1
- package/dist/test/apps/logoutButton.js +2 -2
- package/dist/test/apps/multiRole.d.ts +2 -2
- package/dist/test/apps/multiRole.d.ts.map +1 -1
- package/dist/test/apps/multiRole.js +1 -1
- package/dist/test/apps/pointer.d.ts +6 -6
- package/dist/test/apps/pointer.d.ts.map +1 -1
- package/dist/test/apps/pointer.js +1 -1
- package/dist/test/apps/resumeUpload.d.ts +8 -8
- package/dist/test/apps/resumeUpload.d.ts.map +1 -1
- package/dist/test/apps/resumeUpload.js +12 -5
- package/dist/test/internal.js +10 -10
- package/dist/test/matchers.js +1 -1
- package/dist/test/query.d.ts.map +1 -1
- package/dist/test/query.js +13 -13
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +3 -3
- package/dist/test/story.js +1 -1
- package/dist/ui/animation/schema.d.ts +5 -5
- package/dist/ui/animation/schema.d.ts.map +1 -1
- package/dist/ui/animation/schema.js +9 -3
- package/dist/ui/calendar/index.d.ts +77 -77
- package/dist/ui/calendar/index.d.ts.map +1 -1
- package/dist/ui/calendar/index.js +26 -11
- package/dist/ui/checkbox/index.d.ts +2 -2
- package/dist/ui/combobox/multi.d.ts +38 -42
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/multi.js +4 -1
- package/dist/ui/combobox/shared.d.ts +31 -31
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +34 -12
- package/dist/ui/combobox/single.d.ts +39 -43
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/combobox/single.js +7 -6
- package/dist/ui/datePicker/index.d.ts +86 -86
- package/dist/ui/datePicker/index.d.ts.map +1 -1
- package/dist/ui/datePicker/index.js +10 -3
- package/dist/ui/dialog/index.d.ts +8 -8
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +9 -3
- package/dist/ui/disclosure/index.d.ts +2 -2
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +1 -1
- package/dist/ui/dragAndDrop/index.d.ts +76 -76
- package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
- package/dist/ui/dragAndDrop/index.js +47 -29
- package/dist/ui/fileDrop/index.d.ts +8 -8
- package/dist/ui/fileDrop/index.d.ts.map +1 -1
- package/dist/ui/fileDrop/index.js +7 -2
- package/dist/ui/listbox/multi.d.ts +36 -40
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/multi.js +4 -1
- package/dist/ui/listbox/shared.d.ts +32 -32
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +36 -11
- package/dist/ui/listbox/single.d.ts +36 -40
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/listbox/single.js +5 -2
- package/dist/ui/menu/index.d.ts +40 -40
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +38 -11
- package/dist/ui/popover/index.d.ts +12 -12
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +17 -2
- package/dist/ui/radioGroup/index.d.ts +6 -6
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +5 -5
- package/dist/ui/slider/index.d.ts +26 -26
- package/dist/ui/slider/index.d.ts.map +1 -1
- package/dist/ui/slider/index.js +30 -16
- package/dist/ui/switch/index.d.ts +2 -2
- package/dist/ui/tabs/index.d.ts +8 -8
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +3 -3
- package/dist/ui/toast/index.d.ts +75 -75
- package/dist/ui/toast/index.d.ts.map +1 -1
- package/dist/ui/toast/index.js +1 -1
- package/dist/ui/toast/schema.d.ts +63 -63
- package/dist/ui/toast/schema.d.ts.map +1 -1
- package/dist/ui/toast/schema.js +19 -4
- package/dist/ui/toast/update.d.ts +67 -67
- package/dist/ui/toast/update.d.ts.map +1 -1
- package/dist/ui/toast/update.js +2 -2
- package/dist/ui/tooltip/index.d.ts +15 -15
- package/dist/ui/tooltip/index.d.ts.map +1 -1
- package/dist/ui/tooltip/index.js +14 -4
- package/dist/ui/virtualList/index.d.ts +16 -16
- package/dist/ui/virtualList/index.d.ts.map +1 -1
- package/dist/ui/virtualList/index.js +46 -42
- package/dist/url/index.d.ts +8 -8
- package/dist/url/index.d.ts.map +1 -1
- package/dist/url/index.js +14 -14
- package/package.json +12 -8
|
@@ -2,7 +2,13 @@ import { Schema as S } from 'effect';
|
|
|
2
2
|
import { m } from '../../message/index.js';
|
|
3
3
|
// TRANSITION STATE
|
|
4
4
|
/** Schema for the animation lifecycle state, tracking enter/leave phases. */
|
|
5
|
-
export const TransitionState = S.
|
|
5
|
+
export const TransitionState = S.Literals([
|
|
6
|
+
'Idle',
|
|
7
|
+
'EnterStart',
|
|
8
|
+
'EnterAnimating',
|
|
9
|
+
'LeaveStart',
|
|
10
|
+
'LeaveAnimating',
|
|
11
|
+
]);
|
|
6
12
|
// MODEL
|
|
7
13
|
/** Schema for the animation component's state, tracking its unique ID, visibility intent, and lifecycle phase. */
|
|
8
14
|
export const Model = S.Struct({
|
|
@@ -20,13 +26,13 @@ export const AdvancedAnimationFrame = m('AdvancedAnimationFrame');
|
|
|
20
26
|
/** Sent internally when all CSS animations on the element have settled. Covers both CSS transitions and CSS keyframe animations. */
|
|
21
27
|
export const EndedAnimation = m('EndedAnimation');
|
|
22
28
|
/** Union of all messages the animation component can produce. */
|
|
23
|
-
export const Message = S.Union(Showed, Hid, AdvancedAnimationFrame, EndedAnimation);
|
|
29
|
+
export const Message = S.Union([Showed, Hid, AdvancedAnimationFrame, EndedAnimation]);
|
|
24
30
|
// OUT MESSAGE
|
|
25
31
|
/** Sent to the parent when the leave sequence advances to LeaveAnimating. The parent is responsible for providing the command that detects when the leave animation completes (e.g. WaitForAnimationSettled or a racing command). Use `defaultLeaveCommand` for the standard behavior. */
|
|
26
32
|
export const StartedLeaveAnimating = m('StartedLeaveAnimating');
|
|
27
33
|
/** Sent to the parent when the leave animation completes. The parent can use this to unmount content or update its own state. */
|
|
28
34
|
export const TransitionedOut = m('TransitionedOut');
|
|
29
|
-
export const OutMessage = S.Union(StartedLeaveAnimating, TransitionedOut);
|
|
35
|
+
export const OutMessage = S.Union([StartedLeaveAnimating, TransitionedOut]);
|
|
30
36
|
/** Creates an initial animation model from a config. Defaults to hidden. */
|
|
31
37
|
export const init = (config) => ({
|
|
32
38
|
id: config.id,
|
|
@@ -6,71 +6,71 @@ import { type Attribute, type Html } from '../../html/index.js';
|
|
|
6
6
|
/** Which grid the calendar is currently displaying. `Days` is the standard
|
|
7
7
|
* 6×7 day grid; `Months` is a 3×4 month-name grid for fast month jumps;
|
|
8
8
|
* `Years` is a 3×4 year grid paged in 12-year windows for fast year jumps. */
|
|
9
|
-
export declare const ViewMode: S.
|
|
9
|
+
export declare const ViewMode: S.Literals<readonly ["Days", "Months", "Years"]>;
|
|
10
10
|
export type ViewMode = typeof ViewMode.Type;
|
|
11
11
|
/** Schema for the calendar component's state. Tracks the visible month/year,
|
|
12
12
|
* the keyboard-focused and user-selected dates, the active view mode, and
|
|
13
13
|
* the configuration that governs navigation (locale, min/max, disabled
|
|
14
14
|
* days). */
|
|
15
15
|
export declare const Model: S.Struct<{
|
|
16
|
-
id:
|
|
17
|
-
today: S.
|
|
18
|
-
year:
|
|
19
|
-
month: S.
|
|
20
|
-
day: S.
|
|
16
|
+
readonly id: S.String;
|
|
17
|
+
readonly today: S.Struct<{
|
|
18
|
+
readonly year: S.Int;
|
|
19
|
+
readonly month: S.Int;
|
|
20
|
+
readonly day: S.Int;
|
|
21
|
+
}>;
|
|
22
|
+
readonly viewYear: S.Int;
|
|
23
|
+
readonly viewMonth: S.Int;
|
|
24
|
+
readonly viewMode: S.Literals<readonly ["Days", "Months", "Years"]>;
|
|
25
|
+
readonly maybeFocusedDate: S.Option<S.Struct<{
|
|
26
|
+
readonly year: S.Int;
|
|
27
|
+
readonly month: S.Int;
|
|
28
|
+
readonly day: S.Int;
|
|
29
|
+
}>>;
|
|
30
|
+
readonly maybeSelectedDate: S.Option<S.Struct<{
|
|
31
|
+
readonly year: S.Int;
|
|
32
|
+
readonly month: S.Int;
|
|
33
|
+
readonly day: S.Int;
|
|
21
34
|
}>>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}>>>;
|
|
30
|
-
maybeSelectedDate: S.OptionFromSelf<S.filter<S.Struct<{
|
|
31
|
-
year: typeof S.Int;
|
|
32
|
-
month: S.filter<typeof S.Int>;
|
|
33
|
-
day: S.filter<typeof S.Int>;
|
|
34
|
-
}>>>;
|
|
35
|
-
isGridFocused: typeof S.Boolean;
|
|
36
|
-
locale: S.Struct<{
|
|
37
|
-
firstDayOfWeek: S.Literal<["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]>;
|
|
38
|
-
monthNames: S.Tuple<[typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String]>;
|
|
39
|
-
shortMonthNames: S.Tuple<[typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String]>;
|
|
40
|
-
dayNames: S.Tuple<[typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String]>;
|
|
41
|
-
shortDayNames: S.Tuple<[typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String, typeof S.String]>;
|
|
35
|
+
readonly isGridFocused: S.Boolean;
|
|
36
|
+
readonly locale: S.Struct<{
|
|
37
|
+
readonly firstDayOfWeek: S.Literals<readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]>;
|
|
38
|
+
readonly monthNames: S.Tuple<readonly [S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String]>;
|
|
39
|
+
readonly shortMonthNames: S.Tuple<readonly [S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String, S.String]>;
|
|
40
|
+
readonly dayNames: S.Tuple<readonly [S.String, S.String, S.String, S.String, S.String, S.String, S.String]>;
|
|
41
|
+
readonly shortDayNames: S.Tuple<readonly [S.String, S.String, S.String, S.String, S.String, S.String, S.String]>;
|
|
42
42
|
}>;
|
|
43
|
-
maybeMinDate: S.
|
|
44
|
-
year:
|
|
45
|
-
month: S.
|
|
46
|
-
day: S.
|
|
47
|
-
}
|
|
48
|
-
maybeMaxDate: S.
|
|
49
|
-
year:
|
|
50
|
-
month: S.
|
|
51
|
-
day: S.
|
|
52
|
-
}
|
|
53
|
-
disabledDaysOfWeek: S
|
|
54
|
-
disabledDates: S
|
|
55
|
-
year:
|
|
56
|
-
month: S.
|
|
57
|
-
day: S.
|
|
58
|
-
}
|
|
43
|
+
readonly maybeMinDate: S.Option<S.Struct<{
|
|
44
|
+
readonly year: S.Int;
|
|
45
|
+
readonly month: S.Int;
|
|
46
|
+
readonly day: S.Int;
|
|
47
|
+
}>>;
|
|
48
|
+
readonly maybeMaxDate: S.Option<S.Struct<{
|
|
49
|
+
readonly year: S.Int;
|
|
50
|
+
readonly month: S.Int;
|
|
51
|
+
readonly day: S.Int;
|
|
52
|
+
}>>;
|
|
53
|
+
readonly disabledDaysOfWeek: S.$Array<S.Literals<readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]>>;
|
|
54
|
+
readonly disabledDates: S.$Array<S.Struct<{
|
|
55
|
+
readonly year: S.Int;
|
|
56
|
+
readonly month: S.Int;
|
|
57
|
+
readonly day: S.Int;
|
|
58
|
+
}>>;
|
|
59
59
|
}>;
|
|
60
60
|
export type Model = typeof Model.Type;
|
|
61
61
|
/** Sent when the user clicks a day cell in the grid. */
|
|
62
62
|
export declare const ClickedDay: import("../../schema/index.js").CallableTaggedStruct<"ClickedDay", {
|
|
63
|
-
date: S.
|
|
64
|
-
year:
|
|
65
|
-
month: S.
|
|
66
|
-
day: S.
|
|
67
|
-
}
|
|
63
|
+
date: S.Struct<{
|
|
64
|
+
readonly year: S.Int;
|
|
65
|
+
readonly month: S.Int;
|
|
66
|
+
readonly day: S.Int;
|
|
67
|
+
}>;
|
|
68
68
|
}>;
|
|
69
69
|
/** Sent when the user presses a key on the grid container. The update maps
|
|
70
70
|
* the key to a navigation or selection action. */
|
|
71
71
|
export declare const PressedKeyOnGrid: import("../../schema/index.js").CallableTaggedStruct<"PressedKeyOnGrid", {
|
|
72
|
-
key:
|
|
73
|
-
isShift:
|
|
72
|
+
key: S.String;
|
|
73
|
+
isShift: S.Boolean;
|
|
74
74
|
}>;
|
|
75
75
|
/** Sent when the user clicks the previous-month navigation button in Days
|
|
76
76
|
* mode. (The Years mode prev/next-page buttons dispatch `PagedYears`.) */
|
|
@@ -84,17 +84,17 @@ export declare const ClickedHeading: import("../../schema/index.js").CallableTag
|
|
|
84
84
|
/** Sent when the user picks a month from the months grid. Jumps the view
|
|
85
85
|
* to that month and returns the calendar to Days mode. */
|
|
86
86
|
export declare const SelectedMonth: import("../../schema/index.js").CallableTaggedStruct<"SelectedMonth", {
|
|
87
|
-
month:
|
|
87
|
+
month: S.Int;
|
|
88
88
|
}>;
|
|
89
89
|
/** Sent when the user picks a year from the years grid. Jumps the view to
|
|
90
90
|
* that year and transitions the calendar to Months mode for further drilling. */
|
|
91
91
|
export declare const SelectedYear: import("../../schema/index.js").CallableTaggedStruct<"SelectedYear", {
|
|
92
|
-
year:
|
|
92
|
+
year: S.Int;
|
|
93
93
|
}>;
|
|
94
94
|
/** Sent when the user pages the years grid forward or backward by one
|
|
95
95
|
* window. Direction is `1` for next, `-1` for previous. */
|
|
96
96
|
export declare const PagedYears: import("../../schema/index.js").CallableTaggedStruct<"PagedYears", {
|
|
97
|
-
direction: S.
|
|
97
|
+
direction: S.Literals<readonly [1, -1]>;
|
|
98
98
|
}>;
|
|
99
99
|
/** Sent when the grid container receives DOM focus. */
|
|
100
100
|
export declare const FocusedGrid: import("../../schema/index.js").CallableTaggedStruct<"FocusedGrid", {}>;
|
|
@@ -102,36 +102,36 @@ export declare const FocusedGrid: import("../../schema/index.js").CallableTagged
|
|
|
102
102
|
export declare const BlurredGrid: import("../../schema/index.js").CallableTaggedStruct<"BlurredGrid", {}>;
|
|
103
103
|
/** Sent when a long-lived session's "today" reference should be refreshed. */
|
|
104
104
|
export declare const RefreshedToday: import("../../schema/index.js").CallableTaggedStruct<"RefreshedToday", {
|
|
105
|
-
today: S.
|
|
106
|
-
year:
|
|
107
|
-
month: S.
|
|
108
|
-
day: S.
|
|
109
|
-
}
|
|
105
|
+
today: S.Struct<{
|
|
106
|
+
readonly year: S.Int;
|
|
107
|
+
readonly month: S.Int;
|
|
108
|
+
readonly day: S.Int;
|
|
109
|
+
}>;
|
|
110
110
|
}>;
|
|
111
111
|
/** Sent when a FocusGrid command completes. */
|
|
112
112
|
export declare const CompletedFocusGrid: import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusGrid", {}>;
|
|
113
113
|
/** Union of all messages the calendar component can produce. */
|
|
114
|
-
export declare const Message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"ClickedDay", {
|
|
115
|
-
date: S.
|
|
116
|
-
year:
|
|
117
|
-
month: S.
|
|
118
|
-
day: S.
|
|
119
|
-
}
|
|
114
|
+
export declare const Message: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"ClickedDay", {
|
|
115
|
+
date: S.Struct<{
|
|
116
|
+
readonly year: S.Int;
|
|
117
|
+
readonly month: S.Int;
|
|
118
|
+
readonly day: S.Int;
|
|
119
|
+
}>;
|
|
120
120
|
}>, import("../../schema/index.js").CallableTaggedStruct<"PressedKeyOnGrid", {
|
|
121
|
-
key:
|
|
122
|
-
isShift:
|
|
121
|
+
key: S.String;
|
|
122
|
+
isShift: S.Boolean;
|
|
123
123
|
}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedPreviousMonthButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedNextMonthButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedHeading", {}>, import("../../schema/index.js").CallableTaggedStruct<"SelectedMonth", {
|
|
124
|
-
month:
|
|
124
|
+
month: S.Int;
|
|
125
125
|
}>, import("../../schema/index.js").CallableTaggedStruct<"SelectedYear", {
|
|
126
|
-
year:
|
|
126
|
+
year: S.Int;
|
|
127
127
|
}>, import("../../schema/index.js").CallableTaggedStruct<"PagedYears", {
|
|
128
|
-
direction: S.
|
|
128
|
+
direction: S.Literals<readonly [1, -1]>;
|
|
129
129
|
}>, import("../../schema/index.js").CallableTaggedStruct<"FocusedGrid", {}>, import("../../schema/index.js").CallableTaggedStruct<"BlurredGrid", {}>, import("../../schema/index.js").CallableTaggedStruct<"RefreshedToday", {
|
|
130
|
-
today: S.
|
|
131
|
-
year:
|
|
132
|
-
month: S.
|
|
133
|
-
day: S.
|
|
134
|
-
}
|
|
130
|
+
today: S.Struct<{
|
|
131
|
+
readonly year: S.Int;
|
|
132
|
+
readonly month: S.Int;
|
|
133
|
+
readonly day: S.Int;
|
|
134
|
+
}>;
|
|
135
135
|
}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusGrid", {}>]>;
|
|
136
136
|
export type Message = typeof Message.Type;
|
|
137
137
|
/** Emitted when the visible month changes due to navigation. Consumers of an
|
|
@@ -142,15 +142,15 @@ export type Message = typeof Message.Type;
|
|
|
142
142
|
* controlled-component pattern. Use `Calendar.selectDate(model, date)` to
|
|
143
143
|
* write back when handling the callback. */
|
|
144
144
|
export declare const ChangedViewMonth: import("../../schema/index.js").CallableTaggedStruct<"ChangedViewMonth", {
|
|
145
|
-
year:
|
|
146
|
-
month:
|
|
145
|
+
year: S.Int;
|
|
146
|
+
month: S.Int;
|
|
147
147
|
}>;
|
|
148
148
|
/** The calendar's OutMessage. Only one variant — `ChangedViewMonth` — which
|
|
149
149
|
* fires when navigation shifts the visible month. Date selection goes through
|
|
150
150
|
* the `onSelectedDate` ViewConfig callback, not OutMessage. */
|
|
151
151
|
export declare const OutMessage: import("../../schema/index.js").CallableTaggedStruct<"ChangedViewMonth", {
|
|
152
|
-
year:
|
|
153
|
-
month:
|
|
152
|
+
year: S.Int;
|
|
153
|
+
month: S.Int;
|
|
154
154
|
}>;
|
|
155
155
|
export type OutMessage = typeof OutMessage.Type;
|
|
156
156
|
/** Configuration for creating a calendar model with `init`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,MAAM,EAAE,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAE7E,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,E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c,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,aAAa,CAAA;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAC,CAAA;AAmjBF;;;+BAG+B;AAC/B,eAAO,MAAM,IAAI,GAAI,aAAa,EAAE,QAAQ,UAAU,CAAC,aAAa,CAAC,KAAG,IASrE,CAAA;AAEH;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,cAAc,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC,KACzE,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,KAC1D,IAAI,CAgBR,CAAA"}
|
|
@@ -10,7 +10,7 @@ import * as Task from '../../task/index.js';
|
|
|
10
10
|
/** Which grid the calendar is currently displaying. `Days` is the standard
|
|
11
11
|
* 6×7 day grid; `Months` is a 3×4 month-name grid for fast month jumps;
|
|
12
12
|
* `Years` is a 3×4 year grid paged in 12-year windows for fast year jumps. */
|
|
13
|
-
export const ViewMode = S.
|
|
13
|
+
export const ViewMode = S.Literals(['Days', 'Months', 'Years']);
|
|
14
14
|
/** Schema for the calendar component's state. Tracks the visible month/year,
|
|
15
15
|
* the keyboard-focused and user-selected dates, the active view mode, and
|
|
16
16
|
* the configuration that governs navigation (locale, min/max, disabled
|
|
@@ -19,14 +19,14 @@ export const Model = S.Struct({
|
|
|
19
19
|
id: S.String,
|
|
20
20
|
today: Calendar.CalendarDate,
|
|
21
21
|
viewYear: S.Int,
|
|
22
|
-
viewMonth: S.Int.
|
|
22
|
+
viewMonth: S.Int.check(S.isBetween({ minimum: 1, maximum: 12 })),
|
|
23
23
|
viewMode: ViewMode,
|
|
24
|
-
maybeFocusedDate: S.
|
|
25
|
-
maybeSelectedDate: S.
|
|
24
|
+
maybeFocusedDate: S.Option(Calendar.CalendarDate),
|
|
25
|
+
maybeSelectedDate: S.Option(Calendar.CalendarDate),
|
|
26
26
|
isGridFocused: S.Boolean,
|
|
27
27
|
locale: Calendar.LocaleConfig,
|
|
28
|
-
maybeMinDate: S.
|
|
29
|
-
maybeMaxDate: S.
|
|
28
|
+
maybeMinDate: S.Option(Calendar.CalendarDate),
|
|
29
|
+
maybeMaxDate: S.Option(Calendar.CalendarDate),
|
|
30
30
|
disabledDaysOfWeek: S.Array(Calendar.DayOfWeek),
|
|
31
31
|
disabledDates: S.Array(Calendar.CalendarDate),
|
|
32
32
|
});
|
|
@@ -56,7 +56,9 @@ export const SelectedMonth = m('SelectedMonth', { month: S.Int });
|
|
|
56
56
|
export const SelectedYear = m('SelectedYear', { year: S.Int });
|
|
57
57
|
/** Sent when the user pages the years grid forward or backward by one
|
|
58
58
|
* window. Direction is `1` for next, `-1` for previous. */
|
|
59
|
-
export const PagedYears = m('PagedYears', {
|
|
59
|
+
export const PagedYears = m('PagedYears', {
|
|
60
|
+
direction: S.Literals([1, -1]),
|
|
61
|
+
});
|
|
60
62
|
/** Sent when the grid container receives DOM focus. */
|
|
61
63
|
export const FocusedGrid = m('FocusedGrid');
|
|
62
64
|
/** Sent when the grid container loses DOM focus. */
|
|
@@ -68,7 +70,20 @@ export const RefreshedToday = m('RefreshedToday', {
|
|
|
68
70
|
/** Sent when a FocusGrid command completes. */
|
|
69
71
|
export const CompletedFocusGrid = m('CompletedFocusGrid');
|
|
70
72
|
/** Union of all messages the calendar component can produce. */
|
|
71
|
-
export const Message = S.Union(
|
|
73
|
+
export const Message = S.Union([
|
|
74
|
+
ClickedDay,
|
|
75
|
+
PressedKeyOnGrid,
|
|
76
|
+
ClickedPreviousMonthButton,
|
|
77
|
+
ClickedNextMonthButton,
|
|
78
|
+
ClickedHeading,
|
|
79
|
+
SelectedMonth,
|
|
80
|
+
SelectedYear,
|
|
81
|
+
PagedYears,
|
|
82
|
+
FocusedGrid,
|
|
83
|
+
BlurredGrid,
|
|
84
|
+
RefreshedToday,
|
|
85
|
+
CompletedFocusGrid,
|
|
86
|
+
]);
|
|
72
87
|
// OUT MESSAGE
|
|
73
88
|
/** Emitted when the visible month changes due to navigation. Consumers of an
|
|
74
89
|
* inline calendar may use this to load month-scoped data (holidays, events).
|
|
@@ -88,7 +103,7 @@ export const OutMessage = ChangedViewMonth;
|
|
|
88
103
|
/** Creates an initial calendar model. The view month defaults to the month
|
|
89
104
|
* of the initial selected date, or today if no date is pre-selected. */
|
|
90
105
|
export const init = (config) => {
|
|
91
|
-
const maybeInitialSelectedDate = Option.
|
|
106
|
+
const maybeInitialSelectedDate = Option.fromNullishOr(config.initialSelectedDate);
|
|
92
107
|
const initialFocus = Option.getOrElse(maybeInitialSelectedDate, () => config.today);
|
|
93
108
|
return {
|
|
94
109
|
id: config.id,
|
|
@@ -100,8 +115,8 @@ export const init = (config) => {
|
|
|
100
115
|
maybeSelectedDate: maybeInitialSelectedDate,
|
|
101
116
|
isGridFocused: false,
|
|
102
117
|
locale: config.locale ?? Calendar.defaultEnglishLocale,
|
|
103
|
-
maybeMinDate: Option.
|
|
104
|
-
maybeMaxDate: Option.
|
|
118
|
+
maybeMinDate: Option.fromNullishOr(config.minDate),
|
|
119
|
+
maybeMaxDate: Option.fromNullishOr(config.maxDate),
|
|
105
120
|
disabledDaysOfWeek: config.disabledDaysOfWeek ?? [],
|
|
106
121
|
disabledDates: config.disabledDates ?? [],
|
|
107
122
|
};
|
|
@@ -3,8 +3,8 @@ import type { Command } from '../../command/index.js';
|
|
|
3
3
|
import { type Attribute, type Html } from '../../html/index.js';
|
|
4
4
|
/** Schema for the checkbox component's state, tracking the checked status. */
|
|
5
5
|
export declare const Model: S.Struct<{
|
|
6
|
-
id:
|
|
7
|
-
isChecked:
|
|
6
|
+
readonly id: S.String;
|
|
7
|
+
readonly isChecked: S.Boolean;
|
|
8
8
|
}>;
|
|
9
9
|
export type Model = typeof Model.Type;
|
|
10
10
|
/** Sent when the user toggles the checkbox via click or Space key. */
|
|
@@ -3,29 +3,28 @@ import type * as Command from '../../command/index.js';
|
|
|
3
3
|
import { type Html } from '../../html/index.js';
|
|
4
4
|
import { type BaseInitConfig, type BaseViewConfig, Closed, type Message, Opened, SelectedItem } from './shared.js';
|
|
5
5
|
/** Schema for the multi-select combobox component's state, tracking open/closed status, active item, input value, and selected items. */
|
|
6
|
-
export declare const Model: S.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
export declare const Model: S.Struct<{
|
|
7
|
+
readonly selectedItems: S.$Array<S.String>;
|
|
8
|
+
readonly id: S.String;
|
|
9
|
+
readonly isOpen: S.Boolean;
|
|
10
|
+
readonly isAnimated: S.Boolean;
|
|
11
|
+
readonly isModal: S.Boolean;
|
|
12
|
+
readonly nullable: S.Boolean;
|
|
13
|
+
readonly immediate: S.Boolean;
|
|
14
|
+
readonly selectInputOnFocus: S.Boolean;
|
|
15
|
+
readonly animation: S.Struct<{
|
|
16
|
+
readonly id: S.String;
|
|
17
|
+
readonly isShowing: S.Boolean;
|
|
18
|
+
readonly transitionState: S.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
18
19
|
}>;
|
|
19
|
-
maybeActiveItemIndex: S.
|
|
20
|
-
activationTrigger: S.
|
|
21
|
-
inputValue:
|
|
22
|
-
maybeLastPointerPosition: S.
|
|
23
|
-
screenX:
|
|
24
|
-
screenY:
|
|
20
|
+
readonly maybeActiveItemIndex: S.Option<S.Number>;
|
|
21
|
+
readonly activationTrigger: S.Literals<readonly ["Pointer", "Keyboard"]>;
|
|
22
|
+
readonly inputValue: S.String;
|
|
23
|
+
readonly maybeLastPointerPosition: S.Option<S.Struct<{
|
|
24
|
+
readonly screenX: S.Number;
|
|
25
|
+
readonly screenY: S.Number;
|
|
25
26
|
}>>;
|
|
26
|
-
}
|
|
27
|
-
selectedItems: S.Array$<typeof S.String>;
|
|
28
|
-
}>>;
|
|
27
|
+
}>;
|
|
29
28
|
export type Model = typeof Model.Type;
|
|
30
29
|
/** Configuration for creating a multi-select combobox model with `init`. `isAnimated` enables CSS transition coordination (default `false`). `isModal` locks page scroll and inerts other elements when open (default `false`). `selectedItems` sets the initial selection (default `[]`). */
|
|
31
30
|
export type InitConfig = BaseInitConfig & Readonly<{
|
|
@@ -36,6 +35,11 @@ export declare const init: (config: InitConfig) => Model;
|
|
|
36
35
|
/** Processes a combobox message and returns the next model and commands. Stays open on selection and toggles item membership (multi-select behavior). */
|
|
37
36
|
export declare const update: (model: {
|
|
38
37
|
readonly id: string;
|
|
38
|
+
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
39
|
+
readonly maybeLastPointerPosition: Option.Option<{
|
|
40
|
+
readonly screenX: number;
|
|
41
|
+
readonly screenY: number;
|
|
42
|
+
}>;
|
|
39
43
|
readonly isOpen: boolean;
|
|
40
44
|
readonly isAnimated: boolean;
|
|
41
45
|
readonly isModal: boolean;
|
|
@@ -44,20 +48,19 @@ export declare const update: (model: {
|
|
|
44
48
|
readonly isShowing: boolean;
|
|
45
49
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
46
50
|
};
|
|
47
|
-
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
48
51
|
readonly activationTrigger: "Pointer" | "Keyboard";
|
|
49
|
-
readonly
|
|
50
|
-
readonly screenX: number;
|
|
51
|
-
readonly screenY: number;
|
|
52
|
-
}>;
|
|
52
|
+
readonly selectedItems: readonly string[];
|
|
53
53
|
readonly nullable: boolean;
|
|
54
54
|
readonly immediate: boolean;
|
|
55
55
|
readonly selectInputOnFocus: boolean;
|
|
56
56
|
readonly inputValue: string;
|
|
57
|
-
} & {
|
|
58
|
-
readonly selectedItems: readonly string[];
|
|
59
57
|
}, message: Message) => readonly [{
|
|
60
58
|
readonly id: string;
|
|
59
|
+
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
60
|
+
readonly maybeLastPointerPosition: Option.Option<{
|
|
61
|
+
readonly screenX: number;
|
|
62
|
+
readonly screenY: number;
|
|
63
|
+
}>;
|
|
61
64
|
readonly isOpen: boolean;
|
|
62
65
|
readonly isAnimated: boolean;
|
|
63
66
|
readonly isModal: boolean;
|
|
@@ -66,18 +69,12 @@ export declare const update: (model: {
|
|
|
66
69
|
readonly isShowing: boolean;
|
|
67
70
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
68
71
|
};
|
|
69
|
-
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
70
72
|
readonly activationTrigger: "Pointer" | "Keyboard";
|
|
71
|
-
readonly
|
|
72
|
-
readonly screenX: number;
|
|
73
|
-
readonly screenY: number;
|
|
74
|
-
}>;
|
|
73
|
+
readonly selectedItems: readonly string[];
|
|
75
74
|
readonly nullable: boolean;
|
|
76
75
|
readonly immediate: boolean;
|
|
77
76
|
readonly selectInputOnFocus: boolean;
|
|
78
77
|
readonly inputValue: string;
|
|
79
|
-
} & {
|
|
80
|
-
readonly selectedItems: readonly string[];
|
|
81
78
|
}, readonly Readonly<{
|
|
82
79
|
name: string;
|
|
83
80
|
effect: import("effect/Effect").Effect<{
|
|
@@ -161,6 +158,11 @@ export type ViewConfig<Message, Item extends string> = BaseViewConfig<Message, I
|
|
|
161
158
|
export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
162
159
|
model: {
|
|
163
160
|
readonly id: string;
|
|
161
|
+
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
162
|
+
readonly maybeLastPointerPosition: Option.Option<{
|
|
163
|
+
readonly screenX: number;
|
|
164
|
+
readonly screenY: number;
|
|
165
|
+
}>;
|
|
164
166
|
readonly isOpen: boolean;
|
|
165
167
|
readonly isAnimated: boolean;
|
|
166
168
|
readonly isModal: boolean;
|
|
@@ -169,18 +171,12 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
|
169
171
|
readonly isShowing: boolean;
|
|
170
172
|
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
171
173
|
};
|
|
172
|
-
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
173
174
|
readonly activationTrigger: "Pointer" | "Keyboard";
|
|
174
|
-
readonly
|
|
175
|
-
readonly screenX: number;
|
|
176
|
-
readonly screenY: number;
|
|
177
|
-
}>;
|
|
175
|
+
readonly selectedItems: readonly string[];
|
|
178
176
|
readonly nullable: boolean;
|
|
179
177
|
readonly immediate: boolean;
|
|
180
178
|
readonly selectInputOnFocus: boolean;
|
|
181
179
|
readonly inputValue: string;
|
|
182
|
-
} & {
|
|
183
|
-
readonly selectedItems: readonly string[];
|
|
184
180
|
};
|
|
185
181
|
toParentMessage: (message: Opened | Closed | import("./shared.js").BlurredInput | import("./shared.js").ActivatedItem | import("./shared.js").DeactivatedItem | SelectedItem | import("./shared.js").MovedPointerOverItem | import("./shared.js").RequestedItemClick | import("./shared.js").UpdatedInputValue | import("./shared.js").PressedToggleButton | {
|
|
186
182
|
readonly _tag: "CompletedAnchorMount";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/multi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEnD,OAAO,KAAK,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,qBAAqB,CAAA;AAE3D,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cA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MAAM,KAAK,GAChB,OAAO,KAAK,KACX,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAClC,CAAA;AAEzB,gJAAgJ;AAChJ,eAAO,MAAM,UAAU,GACrB,OAAO,KAAK,EACZ,MAAM,MAAM,KACX,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CACD,CAAA;AAI1D,uEAAuE;AACvE,MAAM,MAAM,UAAU,CAAC,OAAO,EAAE,IAAI,SAAS,MAAM,IAAI,cAAc,CACnE,OAAO,EACP,IAAI,EACJ,KAAK,CACN,CAAA;AAED,yIAAyI;AACzI,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAIf,CAAA;AAEF;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,IAAI,SAAS,MAAM,EAC/C,cAAc,IAAI,CAChB,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EACzB,OAAO,GAAG,iBAAiB,GAAG,gBAAgB,CAC/C,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,iBAAiB,CAAC,KACrE,IAAI,CAoBR,CAAA"}
|
|
@@ -4,7 +4,10 @@ import { evo } from '../../struct/index.js';
|
|
|
4
4
|
import { BaseModel, Closed, Opened, SelectedItem, baseInit, closedBaseModel, makeUpdate, makeView, } from './shared.js';
|
|
5
5
|
// MODEL
|
|
6
6
|
/** Schema for the multi-select combobox component's state, tracking open/closed status, active item, input value, and selected items. */
|
|
7
|
-
export const Model =
|
|
7
|
+
export const Model = S.Struct({
|
|
8
|
+
...BaseModel.fields,
|
|
9
|
+
selectedItems: S.Array(S.String),
|
|
10
|
+
});
|
|
8
11
|
/** Creates an initial multi-select combobox model from a config. Defaults to closed with no active item, empty input, and no selection. */
|
|
9
12
|
export const init = (config) => ({
|
|
10
13
|
...baseInit(config),
|