foldkit 0.100.1 → 0.102.0
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 -2
- package/dist/canvas/view.d.ts +1 -1
- package/dist/canvas/view.d.ts.map +1 -1
- package/dist/canvas/view.js +5 -5
- package/dist/command/index.d.ts +71 -0
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +34 -1
- package/dist/command/public.d.ts +1 -1
- package/dist/command/public.d.ts.map +1 -1
- package/dist/command/public.js +1 -1
- package/dist/devTools/overlay.d.ts.map +1 -1
- package/dist/devTools/overlay.js +156 -149
- package/dist/dom/dom.d.ts +8 -11
- package/dist/dom/dom.d.ts.map +1 -1
- package/dist/dom/dom.js +8 -11
- package/dist/dom/elementMovement.d.ts +1 -3
- package/dist/dom/elementMovement.d.ts.map +1 -1
- package/dist/dom/elementMovement.js +1 -3
- package/dist/dom/inert.d.ts +2 -4
- package/dist/dom/inert.d.ts.map +1 -1
- package/dist/dom/inert.js +2 -4
- package/dist/dom/scrollLock.d.ts +2 -2
- package/dist/dom/scrollLock.js +2 -2
- package/dist/dom/waitForAnimation.d.ts +1 -1
- package/dist/dom/waitForAnimation.js +1 -1
- package/dist/html/boundary.d.ts +98 -0
- package/dist/html/boundary.d.ts.map +1 -0
- package/dist/html/boundary.js +176 -0
- package/dist/html/childAttribute.d.ts +44 -0
- package/dist/html/childAttribute.d.ts.map +1 -0
- package/dist/html/childAttribute.js +34 -0
- package/dist/html/index.d.ts +70 -23
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +639 -575
- package/dist/html/lazy.d.ts +12 -7
- package/dist/html/lazy.d.ts.map +1 -1
- package/dist/html/lazy.js +30 -11
- package/dist/html/public.d.ts +2 -2
- package/dist/html/public.d.ts.map +1 -1
- package/dist/html/public.js +1 -1
- package/dist/html/runtimeSingleton.d.ts +72 -0
- package/dist/html/runtimeSingleton.d.ts.map +1 -0
- package/dist/html/runtimeSingleton.js +112 -0
- package/dist/html/submodel.d.ts +98 -0
- package/dist/html/submodel.d.ts.map +1 -0
- package/dist/html/submodel.js +190 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/render/render.d.ts +1 -1
- package/dist/render/render.js +1 -1
- package/dist/runtime/messagePriority.d.ts +5 -1
- package/dist/runtime/messagePriority.d.ts.map +1 -1
- package/dist/runtime/messagePriority.js +25 -4
- package/dist/runtime/runtime.d.ts +11 -11
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +118 -63
- package/dist/runtime/subscription.d.ts +139 -19
- package/dist/runtime/subscription.d.ts.map +1 -1
- package/dist/runtime/subscription.js +90 -9
- package/dist/submodel/public.d.ts +4 -0
- package/dist/submodel/public.d.ts.map +1 -0
- package/dist/submodel/public.js +1 -0
- package/dist/submodel/submodel.d.ts +32 -0
- package/dist/submodel/submodel.d.ts.map +1 -0
- package/dist/submodel/submodel.js +1 -0
- package/dist/subscription/animationFrame.d.ts +23 -26
- package/dist/subscription/animationFrame.d.ts.map +1 -1
- package/dist/subscription/animationFrame.js +17 -18
- package/dist/subscription/public.d.ts +2 -2
- package/dist/subscription/public.d.ts.map +1 -1
- package/dist/subscription/public.js +1 -1
- package/dist/test/apps/disabledButton.d.ts +4 -5
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +16 -16
- package/dist/test/scene.d.ts +8 -8
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +25 -13
- package/dist/test/story.d.ts +15 -8
- package/dist/test/story.d.ts.map +1 -1
- package/dist/test/story.js +21 -9
- package/dist/ui/animation/index.d.ts +30 -14
- package/dist/ui/animation/index.d.ts.map +1 -1
- package/dist/ui/animation/index.js +9 -19
- package/dist/ui/animation/public.d.ts +2 -2
- package/dist/ui/animation/public.d.ts.map +1 -1
- package/dist/ui/animation/public.js +1 -1
- package/dist/ui/calendar/index.d.ts +199 -84
- package/dist/ui/calendar/index.d.ts.map +1 -1
- package/dist/ui/calendar/index.js +129 -140
- package/dist/ui/calendar/public.d.ts +2 -2
- package/dist/ui/calendar/public.d.ts.map +1 -1
- package/dist/ui/calendar/public.js +1 -1
- package/dist/ui/checkbox/index.d.ts +93 -21
- package/dist/ui/checkbox/index.d.ts.map +1 -1
- package/dist/ui/checkbox/index.js +62 -33
- package/dist/ui/checkbox/public.d.ts +2 -2
- package/dist/ui/checkbox/public.d.ts.map +1 -1
- package/dist/ui/checkbox/public.js +1 -1
- package/dist/ui/combobox/multi.d.ts +35 -91
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/multi.js +34 -17
- package/dist/ui/combobox/multiPublic.d.ts +2 -2
- package/dist/ui/combobox/multiPublic.d.ts.map +1 -1
- package/dist/ui/combobox/multiPublic.js +1 -1
- package/dist/ui/combobox/public.d.ts +3 -3
- package/dist/ui/combobox/public.d.ts.map +1 -1
- package/dist/ui/combobox/public.js +2 -2
- package/dist/ui/combobox/shared.d.ts +56 -31
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +333 -322
- package/dist/ui/combobox/single.d.ts +46 -93
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/combobox/single.js +44 -17
- package/dist/ui/datePicker/index.d.ts +256 -48
- package/dist/ui/datePicker/index.d.ts.map +1 -1
- package/dist/ui/datePicker/index.js +149 -104
- package/dist/ui/datePicker/public.d.ts +2 -2
- package/dist/ui/datePicker/public.d.ts.map +1 -1
- package/dist/ui/datePicker/public.js +1 -1
- package/dist/ui/dialog/index.d.ts +95 -39
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +71 -62
- package/dist/ui/dialog/public.d.ts +2 -2
- package/dist/ui/dialog/public.d.ts.map +1 -1
- package/dist/ui/dialog/public.js +1 -1
- package/dist/ui/disclosure/index.d.ts +71 -31
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +57 -62
- package/dist/ui/disclosure/public.d.ts +2 -2
- package/dist/ui/disclosure/public.d.ts.map +1 -1
- package/dist/ui/disclosure/public.js +1 -1
- package/dist/ui/dragAndDrop/index.d.ts +385 -103
- package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
- package/dist/ui/dragAndDrop/index.js +26 -31
- package/dist/ui/dragAndDrop/public.d.ts +1 -1
- package/dist/ui/dragAndDrop/public.d.ts.map +1 -1
- package/dist/ui/dragAndDrop/public.js +1 -1
- package/dist/ui/fileDrop/index.d.ts +42 -46
- package/dist/ui/fileDrop/index.d.ts.map +1 -1
- package/dist/ui/fileDrop/index.js +30 -46
- package/dist/ui/fileDrop/public.d.ts +2 -2
- package/dist/ui/fileDrop/public.d.ts.map +1 -1
- package/dist/ui/fileDrop/public.js +1 -1
- package/dist/ui/listbox/multi.d.ts +39 -84
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/multi.js +38 -20
- package/dist/ui/listbox/multiPublic.d.ts +2 -2
- package/dist/ui/listbox/multiPublic.d.ts.map +1 -1
- package/dist/ui/listbox/multiPublic.js +1 -1
- package/dist/ui/listbox/public.d.ts +3 -3
- package/dist/ui/listbox/public.d.ts.map +1 -1
- package/dist/ui/listbox/public.js +2 -2
- package/dist/ui/listbox/shared.d.ts +71 -30
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +319 -296
- package/dist/ui/listbox/single.d.ts +57 -85
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/listbox/single.js +48 -24
- package/dist/ui/menu/index.d.ts +80 -36
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +117 -86
- package/dist/ui/menu/public.d.ts +2 -2
- package/dist/ui/menu/public.d.ts.map +1 -1
- package/dist/ui/menu/public.js +1 -1
- package/dist/ui/popover/index.d.ts +117 -44
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +88 -101
- package/dist/ui/popover/public.d.ts +2 -2
- package/dist/ui/popover/public.d.ts.map +1 -1
- package/dist/ui/popover/public.js +1 -1
- package/dist/ui/radioGroup/index.d.ts +122 -45
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +111 -72
- package/dist/ui/radioGroup/public.d.ts +2 -2
- package/dist/ui/radioGroup/public.d.ts.map +1 -1
- package/dist/ui/radioGroup/public.js +1 -1
- package/dist/ui/slider/index.d.ts +247 -103
- package/dist/ui/slider/index.d.ts.map +1 -1
- package/dist/ui/slider/index.js +52 -68
- package/dist/ui/slider/public.d.ts +2 -2
- package/dist/ui/slider/public.d.ts.map +1 -1
- package/dist/ui/slider/public.js +1 -1
- package/dist/ui/switch/index.d.ts +74 -21
- package/dist/ui/switch/index.d.ts.map +1 -1
- package/dist/ui/switch/index.js +62 -33
- package/dist/ui/switch/public.d.ts +2 -2
- package/dist/ui/switch/public.d.ts.map +1 -1
- package/dist/ui/switch/public.js +1 -1
- package/dist/ui/tabs/index.d.ts +107 -45
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +99 -81
- package/dist/ui/tabs/public.d.ts +2 -2
- package/dist/ui/tabs/public.d.ts.map +1 -1
- package/dist/ui/tabs/public.js +1 -1
- package/dist/ui/toast/index.d.ts +93 -109
- package/dist/ui/toast/index.d.ts.map +1 -1
- package/dist/ui/toast/index.js +16 -29
- package/dist/ui/toast/schema.d.ts +15 -4
- package/dist/ui/toast/schema.d.ts.map +1 -1
- package/dist/ui/toast/schema.js +11 -4
- package/dist/ui/toast/update.d.ts +36 -18
- package/dist/ui/toast/update.d.ts.map +1 -1
- package/dist/ui/toast/update.js +33 -14
- package/dist/ui/tooltip/index.d.ts +94 -42
- package/dist/ui/tooltip/index.d.ts.map +1 -1
- package/dist/ui/tooltip/index.js +64 -73
- package/dist/ui/tooltip/public.d.ts +2 -2
- package/dist/ui/tooltip/public.d.ts.map +1 -1
- package/dist/ui/tooltip/public.js +1 -1
- package/dist/ui/virtualList/index.d.ts +63 -80
- package/dist/ui/virtualList/index.d.ts.map +1 -1
- package/dist/ui/virtualList/index.js +22 -49
- package/dist/ui/virtualList/public.d.ts +2 -2
- package/dist/ui/virtualList/public.d.ts.map +1 -1
- package/dist/ui/virtualList/public.js +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,8 @@ import { Option, Schema as S } from 'effect';
|
|
|
2
2
|
import * as Calendar from '../../calendar/index.js';
|
|
3
3
|
import type { CalendarDate } from '../../calendar/index.js';
|
|
4
4
|
import * as Command from '../../command/index.js';
|
|
5
|
-
import { type
|
|
5
|
+
import { type ChildAttribute, type Html } from '../../html/index.js';
|
|
6
|
+
import type { Reflect } from '../../submodel/submodel.js';
|
|
6
7
|
import type { AnchorConfig } from '../anchor.js';
|
|
7
8
|
import * as UiCalendar from '../calendar/index.js';
|
|
8
9
|
/** Schema for the date picker component's state. Holds the selected date,
|
|
@@ -102,16 +103,16 @@ export declare const GotCalendarMessage: import("../../schema/index.js").Callabl
|
|
|
102
103
|
}>;
|
|
103
104
|
/** Wraps a Popover submodel message for delegation. */
|
|
104
105
|
export declare const GotPopoverMessage: import("../../schema/index.js").CallableTaggedStruct<"GotPopoverMessage", {
|
|
105
|
-
message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"
|
|
106
|
+
message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"RequestedOpen", {}>, import("../../schema/index.js").CallableTaggedStruct<"RequestedClose", {}>, import("../../schema/index.js").CallableTaggedStruct<"BlurredPanel", {}>, import("../../schema/index.js").CallableTaggedStruct<"PressedPointerOnButton", {
|
|
106
107
|
pointerType: S.String;
|
|
107
108
|
button: S.Number;
|
|
108
|
-
}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusPanel", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedLockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedUnlockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"
|
|
109
|
+
}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusPanel", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedLockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedUnlockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedInertOthers", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedRestoreInert", {}>, import("../../schema/index.js").CallableTaggedStruct<"IgnoredMouseClick", {}>, import("../../schema/index.js").CallableTaggedStruct<"SuppressedSpaceScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedAnchorPopover", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedPortalPopoverBackdrop", {}>, import("../../schema/index.js").CallableTaggedStruct<"GotAnimationMessage", {
|
|
109
110
|
message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Showed", {}>, import("../../schema/index.js").CallableTaggedStruct<"Hid", {}>, import("../../schema/index.js").CallableTaggedStruct<"AdvancedAnimationFrame", {}>, import("../../schema/index.js").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
110
111
|
}>]>;
|
|
111
112
|
}>;
|
|
112
113
|
/** Sent when the user commits a date via click or keyboard. Updates the
|
|
113
114
|
* selected date, syncs the calendar, and closes the popover. */
|
|
114
|
-
export declare const
|
|
115
|
+
export declare const RequestedSelectDate: import("../../schema/index.js").CallableTaggedStruct<"RequestedSelectDate", {
|
|
115
116
|
date: S.Struct<{
|
|
116
117
|
readonly year: S.Int;
|
|
117
118
|
readonly month: S.Int;
|
|
@@ -130,7 +131,7 @@ export declare const Closed: import("../../schema/index.js").CallableTaggedStruc
|
|
|
130
131
|
export declare const Message: S.Union<[
|
|
131
132
|
typeof GotCalendarMessage,
|
|
132
133
|
typeof GotPopoverMessage,
|
|
133
|
-
typeof
|
|
134
|
+
typeof RequestedSelectDate,
|
|
134
135
|
typeof Cleared,
|
|
135
136
|
typeof Opened,
|
|
136
137
|
typeof Closed
|
|
@@ -142,14 +143,30 @@ export declare const ChangedViewMonth: import("../../schema/index.js").CallableT
|
|
|
142
143
|
year: S.Int;
|
|
143
144
|
month: S.Int;
|
|
144
145
|
}>;
|
|
145
|
-
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
export declare const
|
|
146
|
+
/** Emitted when the user commits a date selection (propagated from the
|
|
147
|
+
* embedded Calendar). The popover has already closed; the parent reads the
|
|
148
|
+
* committed date and lifts it into domain state. */
|
|
149
|
+
export declare const SelectedDate: import("../../schema/index.js").CallableTaggedStruct<"SelectedDate", {
|
|
150
|
+
date: S.Struct<{
|
|
151
|
+
readonly year: S.Int;
|
|
152
|
+
readonly month: S.Int;
|
|
153
|
+
readonly day: S.Int;
|
|
154
|
+
}>;
|
|
155
|
+
}>;
|
|
156
|
+
/** Union of out-messages the date picker can produce. */
|
|
157
|
+
export declare const OutMessage: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"ChangedViewMonth", {
|
|
149
158
|
year: S.Int;
|
|
150
159
|
month: S.Int;
|
|
151
|
-
}
|
|
160
|
+
}>, import("../../schema/index.js").CallableTaggedStruct<"SelectedDate", {
|
|
161
|
+
date: S.Struct<{
|
|
162
|
+
readonly year: S.Int;
|
|
163
|
+
readonly month: S.Int;
|
|
164
|
+
readonly day: S.Int;
|
|
165
|
+
}>;
|
|
166
|
+
}>]>;
|
|
152
167
|
export type OutMessage = typeof OutMessage.Type;
|
|
168
|
+
export type ChangedViewMonth = typeof ChangedViewMonth.Type;
|
|
169
|
+
export type SelectedDate = typeof SelectedDate.Type;
|
|
153
170
|
/** Configuration for creating a date picker model with `init`. */
|
|
154
171
|
export type InitConfig = Readonly<{
|
|
155
172
|
id: string;
|
|
@@ -177,73 +194,264 @@ type UpdateReturn = readonly [
|
|
|
177
194
|
export declare const update: (model: Model, message: Message) => UpdateReturn;
|
|
178
195
|
/** Programmatically opens the date picker, updating the model and returning
|
|
179
196
|
* focus and popover commands. Use this in domain-event handlers. */
|
|
180
|
-
export declare const open: (model: Model) =>
|
|
197
|
+
export declare const open: (model: Model) => UpdateReturn;
|
|
181
198
|
/** Programmatically closes the date picker. Use this in domain-event handlers. */
|
|
182
|
-
export declare const close: (model: Model) =>
|
|
183
|
-
/** Programmatically selects a date, committing it and closing the popover. */
|
|
184
|
-
export declare const selectDate: (model: Model, date: CalendarDate) =>
|
|
199
|
+
export declare const close: (model: Model) => UpdateReturn;
|
|
200
|
+
/** Programmatically selects a date, committing it and closing the popover. Emits a `SelectedDate` OutMessage just like a user-initiated selection. */
|
|
201
|
+
export declare const selectDate: (model: Model, date: CalendarDate) => UpdateReturn;
|
|
185
202
|
/** Programmatically clears the selected date. */
|
|
186
|
-
export declare const clear: (model: Model) =>
|
|
187
|
-
/**
|
|
203
|
+
export declare const clear: (model: Model) => UpdateReturn;
|
|
204
|
+
/** Reflects an externally-sourced selected date onto the date picker
|
|
205
|
+
* without emitting an OutMessage or touching the popover. Sets the
|
|
206
|
+
* picker's selection and reflects it onto the embedded calendar (moving
|
|
207
|
+
* the calendar's view to the date), mirroring `selectDate`'s state change
|
|
208
|
+
* minus the `SelectedDate` announcement and the popover close. Pass
|
|
209
|
+
* `Option.none()` to clear. Use this to mirror external truth (a URL
|
|
210
|
+
* parameter, a saved draft) onto the picker. Contrast with `selectDate`,
|
|
211
|
+
* a user or programmatic *choice* that emits `SelectedDate`. Returns the
|
|
212
|
+
* model directly because it produces no commands and no OutMessage. */
|
|
213
|
+
export declare const reflectSelectedDate: Reflect<Model, Option.Option<CalendarDate>>;
|
|
214
|
+
/** Reflects the minimum selectable date onto the embedded calendar. Pass
|
|
188
215
|
* `Option.none()` to remove the minimum. Use this when the minimum derives
|
|
189
216
|
* from other Model state (e.g. a start date field whose current selection
|
|
190
217
|
* constrains an end date picker).
|
|
191
218
|
*
|
|
192
|
-
* Does NOT reconcile the current selection
|
|
219
|
+
* Does NOT reconcile the current selection. If a previously-selected date
|
|
193
220
|
* is now below the new minimum, it remains selected. Callers should `clear`
|
|
194
221
|
* or reassign the selection explicitly if their domain requires it. */
|
|
195
|
-
export declare const
|
|
196
|
-
/**
|
|
222
|
+
export declare const reflectMinDate: Reflect<Model, Option.Option<CalendarDate>>;
|
|
223
|
+
/** Reflects the maximum selectable date onto the embedded calendar. Pass
|
|
197
224
|
* `Option.none()` to remove the maximum. Does NOT reconcile the current
|
|
198
225
|
* selection. */
|
|
199
|
-
export declare const
|
|
200
|
-
/**
|
|
201
|
-
* Pass an empty array to clear. Does NOT reconcile the current
|
|
202
|
-
|
|
203
|
-
|
|
226
|
+
export declare const reflectMaxDate: Reflect<Model, Option.Option<CalendarDate>>;
|
|
227
|
+
/** Reflects the list of individually-disabled dates onto the embedded
|
|
228
|
+
* calendar. Pass an empty array to clear. Does NOT reconcile the current
|
|
229
|
+
* selection. */
|
|
230
|
+
export declare const reflectDisabledDates: Reflect<Model, ReadonlyArray<CalendarDate>>;
|
|
231
|
+
/** Reflects the days of the week that are disabled onto the embedded calendar
|
|
204
232
|
* (e.g. weekends). Pass an empty array to clear. Does NOT reconcile the
|
|
205
233
|
* current selection. */
|
|
206
|
-
export declare const
|
|
207
|
-
/**
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
* mode, use `DatePicker.selectDate(model, date)` to write the selection
|
|
215
|
-
* back into the date picker's internal state. */
|
|
216
|
-
onSelectedDate?: (date: CalendarDate) => ParentMessage;
|
|
234
|
+
export declare const reflectDisabledDaysOfWeek: Reflect<Model, ReadonlyArray<Calendar.DayOfWeek>>;
|
|
235
|
+
/** Per-render view inputs passed to `view` via `h.submodel`'s `viewInputs` field.
|
|
236
|
+
*
|
|
237
|
+
* The DatePicker emits a `SelectedDate({ date })` OutMessage when the
|
|
238
|
+
* user commits a date. Consumers pattern-match this in their
|
|
239
|
+
* `GotDatePickerMessage` handler (third tuple element of
|
|
240
|
+
* `Ui.DatePicker.update`'s return) to lift the date into domain state. */
|
|
241
|
+
export type ViewInputs = Readonly<{
|
|
217
242
|
anchor: AnchorConfig;
|
|
218
243
|
/** Renders the trigger button's content (typically the formatted selected
|
|
219
244
|
* date or a placeholder). Receives the current selection. */
|
|
220
245
|
triggerContent: (maybeDate: Option.Option<CalendarDate>) => Html;
|
|
221
|
-
/** Renders the calendar grid layout inside the popover panel.
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
toCalendarView: (attributes: UiCalendar.CalendarAttributes
|
|
246
|
+
/** Renders the calendar grid layout inside the popover panel. The
|
|
247
|
+
* consumer lays out the attribute bundles exactly as they would for
|
|
248
|
+
* an inline calendar. */
|
|
249
|
+
toCalendarView: (attributes: UiCalendar.CalendarAttributes) => Html;
|
|
225
250
|
isDisabled?: boolean;
|
|
226
251
|
/** Name for the hidden form input. When provided, a hidden `<input>` is
|
|
227
252
|
* rendered alongside the trigger so native form submission captures the
|
|
228
253
|
* selected date as an ISO string (`YYYY-MM-DD`). */
|
|
229
254
|
name?: string;
|
|
230
255
|
className?: string;
|
|
231
|
-
attributes?: ReadonlyArray<
|
|
256
|
+
attributes?: ReadonlyArray<ChildAttribute>;
|
|
232
257
|
triggerClassName?: string;
|
|
233
|
-
triggerAttributes?: ReadonlyArray<
|
|
258
|
+
triggerAttributes?: ReadonlyArray<ChildAttribute>;
|
|
234
259
|
panelClassName?: string;
|
|
235
|
-
panelAttributes?: ReadonlyArray<
|
|
260
|
+
panelAttributes?: ReadonlyArray<ChildAttribute>;
|
|
236
261
|
backdropClassName?: string;
|
|
237
|
-
backdropAttributes?: ReadonlyArray<
|
|
262
|
+
backdropAttributes?: ReadonlyArray<ChildAttribute>;
|
|
238
263
|
}>;
|
|
239
264
|
/** Renders an accessible date picker: a trigger button that opens a popover
|
|
240
265
|
* containing an accessible calendar grid. The date picker assembles the
|
|
241
|
-
* embedded Calendar and Popover components into one flat API
|
|
266
|
+
* embedded Calendar and Popover components into one flat API. Consumers
|
|
242
267
|
* provide the trigger face and the calendar grid layout, DatePicker handles
|
|
243
268
|
* focus choreography, open/close state, and form submission. */
|
|
244
|
-
export declare const view:
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
269
|
+
export declare const view: import("../../html/submodel.js").SubmodelView<{
|
|
270
|
+
readonly id: string;
|
|
271
|
+
readonly maybeSelectedDate: Option.Option<{
|
|
272
|
+
readonly year: number;
|
|
273
|
+
readonly month: number;
|
|
274
|
+
readonly day: number;
|
|
275
|
+
}>;
|
|
276
|
+
readonly calendar: {
|
|
277
|
+
readonly id: string;
|
|
278
|
+
readonly today: {
|
|
279
|
+
readonly year: number;
|
|
280
|
+
readonly month: number;
|
|
281
|
+
readonly day: number;
|
|
282
|
+
};
|
|
283
|
+
readonly viewYear: number;
|
|
284
|
+
readonly viewMonth: number;
|
|
285
|
+
readonly viewMode: "Days" | "Months" | "Years";
|
|
286
|
+
readonly maybeFocusedDate: Option.Option<{
|
|
287
|
+
readonly year: number;
|
|
288
|
+
readonly month: number;
|
|
289
|
+
readonly day: number;
|
|
290
|
+
}>;
|
|
291
|
+
readonly maybeSelectedDate: Option.Option<{
|
|
292
|
+
readonly year: number;
|
|
293
|
+
readonly month: number;
|
|
294
|
+
readonly day: number;
|
|
295
|
+
}>;
|
|
296
|
+
readonly isGridFocused: boolean;
|
|
297
|
+
readonly locale: {
|
|
298
|
+
readonly firstDayOfWeek: "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday";
|
|
299
|
+
readonly monthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
300
|
+
readonly shortMonthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
301
|
+
readonly dayNames: readonly [string, string, string, string, string, string, string];
|
|
302
|
+
readonly shortDayNames: readonly [string, string, string, string, string, string, string];
|
|
303
|
+
};
|
|
304
|
+
readonly maybeMinDate: Option.Option<{
|
|
305
|
+
readonly year: number;
|
|
306
|
+
readonly month: number;
|
|
307
|
+
readonly day: number;
|
|
308
|
+
}>;
|
|
309
|
+
readonly maybeMaxDate: Option.Option<{
|
|
310
|
+
readonly year: number;
|
|
311
|
+
readonly month: number;
|
|
312
|
+
readonly day: number;
|
|
313
|
+
}>;
|
|
314
|
+
readonly disabledDaysOfWeek: readonly ("Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday")[];
|
|
315
|
+
readonly disabledDates: readonly {
|
|
316
|
+
readonly year: number;
|
|
317
|
+
readonly month: number;
|
|
318
|
+
readonly day: number;
|
|
319
|
+
}[];
|
|
320
|
+
};
|
|
321
|
+
readonly popover: {
|
|
322
|
+
readonly id: string;
|
|
323
|
+
readonly isOpen: boolean;
|
|
324
|
+
readonly isAnimated: boolean;
|
|
325
|
+
readonly isModal: boolean;
|
|
326
|
+
readonly contentFocus: boolean;
|
|
327
|
+
readonly animation: {
|
|
328
|
+
readonly id: string;
|
|
329
|
+
readonly isShowing: boolean;
|
|
330
|
+
readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating";
|
|
331
|
+
};
|
|
332
|
+
readonly maybeLastButtonPointerType: Option.Option<string>;
|
|
333
|
+
};
|
|
334
|
+
}, {
|
|
335
|
+
readonly _tag: "Closed";
|
|
336
|
+
} | {
|
|
337
|
+
readonly _tag: "Opened";
|
|
338
|
+
} | {
|
|
339
|
+
readonly _tag: "GotCalendarMessage";
|
|
340
|
+
readonly message: {
|
|
341
|
+
readonly _tag: "ClickedDay";
|
|
342
|
+
readonly date: {
|
|
343
|
+
readonly year: number;
|
|
344
|
+
readonly month: number;
|
|
345
|
+
readonly day: number;
|
|
346
|
+
};
|
|
347
|
+
} | {
|
|
348
|
+
readonly _tag: "PressedKeyOnGrid";
|
|
349
|
+
readonly key: string;
|
|
350
|
+
readonly isShift: boolean;
|
|
351
|
+
} | {
|
|
352
|
+
readonly _tag: "ClickedPreviousMonthButton";
|
|
353
|
+
} | {
|
|
354
|
+
readonly _tag: "ClickedNextMonthButton";
|
|
355
|
+
} | {
|
|
356
|
+
readonly _tag: "ClickedHeading";
|
|
357
|
+
} | {
|
|
358
|
+
readonly _tag: "SelectedMonth";
|
|
359
|
+
readonly month: number;
|
|
360
|
+
} | {
|
|
361
|
+
readonly _tag: "SelectedYear";
|
|
362
|
+
readonly year: number;
|
|
363
|
+
} | {
|
|
364
|
+
readonly _tag: "PagedYears";
|
|
365
|
+
readonly direction: 1 | -1;
|
|
366
|
+
} | {
|
|
367
|
+
readonly _tag: "FocusedGrid";
|
|
368
|
+
} | {
|
|
369
|
+
readonly _tag: "BlurredGrid";
|
|
370
|
+
} | {
|
|
371
|
+
readonly _tag: "RefreshedToday";
|
|
372
|
+
readonly today: {
|
|
373
|
+
readonly year: number;
|
|
374
|
+
readonly month: number;
|
|
375
|
+
readonly day: number;
|
|
376
|
+
};
|
|
377
|
+
} | {
|
|
378
|
+
readonly _tag: "CompletedFocusGrid";
|
|
379
|
+
};
|
|
380
|
+
} | {
|
|
381
|
+
readonly _tag: "GotPopoverMessage";
|
|
382
|
+
readonly message: {
|
|
383
|
+
readonly _tag: "CompletedLockScroll";
|
|
384
|
+
} | {
|
|
385
|
+
readonly _tag: "CompletedUnlockScroll";
|
|
386
|
+
} | {
|
|
387
|
+
readonly _tag: "CompletedInertOthers";
|
|
388
|
+
} | {
|
|
389
|
+
readonly _tag: "CompletedRestoreInert";
|
|
390
|
+
} | {
|
|
391
|
+
readonly _tag: "CompletedFocusButton";
|
|
392
|
+
} | {
|
|
393
|
+
readonly _tag: "IgnoredMouseClick";
|
|
394
|
+
} | {
|
|
395
|
+
readonly _tag: "SuppressedSpaceScroll";
|
|
396
|
+
} | {
|
|
397
|
+
readonly _tag: "RequestedOpen";
|
|
398
|
+
} | {
|
|
399
|
+
readonly _tag: "RequestedClose";
|
|
400
|
+
} | {
|
|
401
|
+
readonly _tag: "BlurredPanel";
|
|
402
|
+
} | {
|
|
403
|
+
readonly _tag: "PressedPointerOnButton";
|
|
404
|
+
readonly pointerType: string;
|
|
405
|
+
readonly button: number;
|
|
406
|
+
} | {
|
|
407
|
+
readonly _tag: "CompletedFocusPanel";
|
|
408
|
+
} | {
|
|
409
|
+
readonly _tag: "CompletedAnchorPopover";
|
|
410
|
+
} | {
|
|
411
|
+
readonly _tag: "CompletedPortalPopoverBackdrop";
|
|
412
|
+
} | {
|
|
413
|
+
readonly _tag: "GotAnimationMessage";
|
|
414
|
+
readonly message: {
|
|
415
|
+
readonly _tag: "Showed";
|
|
416
|
+
} | {
|
|
417
|
+
readonly _tag: "Hid";
|
|
418
|
+
} | {
|
|
419
|
+
readonly _tag: "AdvancedAnimationFrame";
|
|
420
|
+
} | {
|
|
421
|
+
readonly _tag: "EndedAnimation";
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
} | {
|
|
425
|
+
readonly _tag: "RequestedSelectDate";
|
|
426
|
+
readonly date: {
|
|
427
|
+
readonly year: number;
|
|
428
|
+
readonly month: number;
|
|
429
|
+
readonly day: number;
|
|
430
|
+
};
|
|
431
|
+
} | {
|
|
432
|
+
readonly _tag: "Cleared";
|
|
433
|
+
}, Readonly<{
|
|
434
|
+
anchor: AnchorConfig;
|
|
435
|
+
/** Renders the trigger button's content (typically the formatted selected
|
|
436
|
+
* date or a placeholder). Receives the current selection. */
|
|
437
|
+
triggerContent: (maybeDate: Option.Option<CalendarDate>) => Html;
|
|
438
|
+
/** Renders the calendar grid layout inside the popover panel. The
|
|
439
|
+
* consumer lays out the attribute bundles exactly as they would for
|
|
440
|
+
* an inline calendar. */
|
|
441
|
+
toCalendarView: (attributes: UiCalendar.CalendarAttributes) => Html;
|
|
442
|
+
isDisabled?: boolean;
|
|
443
|
+
/** Name for the hidden form input. When provided, a hidden `<input>` is
|
|
444
|
+
* rendered alongside the trigger so native form submission captures the
|
|
445
|
+
* selected date as an ISO string (`YYYY-MM-DD`). */
|
|
446
|
+
name?: string;
|
|
447
|
+
className?: string;
|
|
448
|
+
attributes?: ReadonlyArray<ChildAttribute>;
|
|
449
|
+
triggerClassName?: string;
|
|
450
|
+
triggerAttributes?: ReadonlyArray<ChildAttribute>;
|
|
451
|
+
panelClassName?: string;
|
|
452
|
+
panelAttributes?: ReadonlyArray<ChildAttribute>;
|
|
453
|
+
backdropClassName?: string;
|
|
454
|
+
backdropAttributes?: ReadonlyArray<ChildAttribute>;
|
|
455
|
+
}>>;
|
|
248
456
|
export {};
|
|
249
457
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/datePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/datePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAElE,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,IAAI,EAGV,MAAM,qBAAqB,CAAA;AAG5B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAA;AAKlD;;mDAEmD;AACnD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,wDAAwD;AACxD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;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