foldkit-primitives 0.3.0 → 0.5.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 +144 -723
- package/dist/device/index.d.mts.map +1 -1
- package/dist/device/index.mjs +95 -87
- package/dist/device/index.mjs.map +1 -1
- package/dist/dom/index.d.mts +71 -3
- package/dist/dom/index.d.mts.map +1 -1
- package/dist/dom/index.mjs +303 -6
- package/dist/dom/index.mjs.map +1 -1
- package/dist/editable-text-CKkS_mWt.d.mts +235 -0
- package/dist/editable-text-CKkS_mWt.d.mts.map +1 -0
- package/dist/events/index.d.mts +8 -1
- package/dist/events/index.d.mts.map +1 -1
- package/dist/events/index.mjs +32 -17
- package/dist/events/index.mjs.map +1 -1
- package/dist/follow-tab-stop-BSZsUrrk.mjs +805 -0
- package/dist/follow-tab-stop-BSZsUrrk.mjs.map +1 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +7 -7
- package/dist/interaction/index.d.mts +247 -92
- package/dist/interaction/index.d.mts.map +1 -1
- package/dist/interaction/index.mjs +507 -224
- package/dist/interaction/index.mjs.map +1 -1
- package/dist/internal-DP-xLKbT.mjs +37 -0
- package/dist/internal-DP-xLKbT.mjs.map +1 -0
- package/dist/media/index.d.mts.map +1 -1
- package/dist/media/index.mjs +3 -3
- package/dist/media/index.mjs.map +1 -1
- package/dist/motion/index.mjs +1 -1
- package/dist/{motion-LfJYAMnP.mjs → motion-DGGBZ0wt.mjs} +14 -13
- package/dist/motion-DGGBZ0wt.mjs.map +1 -0
- package/dist/net/index.d.mts +69 -5
- package/dist/net/index.d.mts.map +1 -1
- package/dist/net/index.mjs +139 -56
- package/dist/net/index.mjs.map +1 -1
- package/dist/observers/index.d.mts +1 -1
- package/dist/observers/index.mjs +3 -0
- package/dist/observers/index.mjs.map +1 -1
- package/dist/state/index.d.mts +54 -12
- package/dist/state/index.d.mts.map +1 -1
- package/dist/state/index.mjs +198 -90
- package/dist/state/index.mjs.map +1 -1
- package/dist/time/index.d.mts +21 -1
- package/dist/time/index.d.mts.map +1 -1
- package/dist/time/index.mjs +48 -19
- package/dist/time/index.mjs.map +1 -1
- package/package.json +20 -9
- package/dist/motion-LfJYAMnP.mjs.map +0 -1
- package/dist/move-CZwHyTGk.mjs +0 -215
- package/dist/move-CZwHyTGk.mjs.map +0 -1
- package/dist/move-DNiMPcuf.d.mts +0 -58
- package/dist/move-DNiMPcuf.d.mts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as ScrollLock, C as targetOf, D as MoveStarted, E as MoveEnded, M as tabbableWithin, O as Moved, S as Targets, T as Move, _ as boxOf, a as TextEdited, b as TargetHovered, c as DRAG_THRESHOLD, d as DragFact, f as DragPlace, g as PointerDrag, h as DraggedOver, i as TextCommitted, j as FocusScope, k as HideOutside, l as DragCancelled, m as DragZone, n as EditableText, o as TextFact, p as DragStarted, r as TextCancelled, s as textOf, t as EditAsked, u as DragDropped, v as zoneOf, w as Fact$1, x as TargetPressed, y as TargetFact } from "../editable-text-CKkS_mWt.mjs";
|
|
2
2
|
import { a as modalityOfKey, i as Modality, r as InputModalityModel, t as InputModality } from "../input-modality-DGOhAknO.mjs";
|
|
3
3
|
import { Schema } from "effect";
|
|
4
4
|
import * as Mount from "foldkit/mount";
|
|
@@ -6,7 +6,7 @@ import { Bundle, Declared } from "foldkit-bundle";
|
|
|
6
6
|
import { Behavior, Behaviors, SlotItem } from "foldkit-mixins";
|
|
7
7
|
import { Attribute, Html, HtmlBuilder, KeyboardModifiers } from "foldkit/html";
|
|
8
8
|
declare namespace dismiss_layer_d_exports {
|
|
9
|
-
export { BehaviorOptions$
|
|
9
|
+
export { BehaviorOptions$14 as BehaviorOptions, Dismiss, LAYER_ATTRIBUTE, Layer$1 as Layer, Message$9 as Message, Model$9 as Model, TRIGGER_ATTRIBUTE, behavior$14 as behavior, bundle$9 as bundle, layersOnPath, toDismiss };
|
|
10
10
|
}
|
|
11
11
|
declare const LAYER_ATTRIBUTE = "data-foldkit-plus-layer";
|
|
12
12
|
declare const TRIGGER_ATTRIBUTE = "data-foldkit-plus-layer-trigger";
|
|
@@ -19,7 +19,7 @@ declare const Layer$1: Schema.Struct<{
|
|
|
19
19
|
readonly escape: Schema.Boolean;
|
|
20
20
|
}>;
|
|
21
21
|
type Layer$1 = typeof Layer$1.Type;
|
|
22
|
-
declare const Model$
|
|
22
|
+
declare const Model$9: Schema.Struct<{
|
|
23
23
|
/** The open layers at the last event, bottom to top. */
|
|
24
24
|
readonly layers: Schema.$Array<Schema.Struct<{
|
|
25
25
|
readonly id: Schema.String;
|
|
@@ -29,8 +29,8 @@ declare const Model$8: Schema.Struct<{
|
|
|
29
29
|
readonly escape: Schema.Boolean;
|
|
30
30
|
}>>;
|
|
31
31
|
}>;
|
|
32
|
-
type Model$
|
|
33
|
-
declare const Message$
|
|
32
|
+
type Model$9 = typeof Model$9.Type;
|
|
33
|
+
declare const Message$9: import("foldkit/message").MessageUnion<{
|
|
34
34
|
/** A pointer went down; `inside` are the layers whose element or trigger was on the event's path. */
|
|
35
35
|
readonly PressedAt: {
|
|
36
36
|
readonly layers: Schema.$Array<Schema.Struct<{
|
|
@@ -52,14 +52,14 @@ declare const Message$8: import("foldkit/message").MessageUnion<{
|
|
|
52
52
|
}>>;
|
|
53
53
|
};
|
|
54
54
|
}>;
|
|
55
|
-
type Message$
|
|
55
|
+
type Message$9 = typeof Message$9.Type;
|
|
56
56
|
declare const Dismiss: Schema.TaggedStruct<"Dismiss", {
|
|
57
57
|
readonly ids: Schema.$Array<Schema.String>;
|
|
58
58
|
}>;
|
|
59
59
|
type Dismiss = typeof Dismiss.Type;
|
|
60
60
|
/** Which layers a press inside `inside` dismisses: every layer above the topmost one hit, or all when none was. */
|
|
61
61
|
declare const toDismiss: (layers: ReadonlyArray<Layer$1>, inside: ReadonlyArray<string>) => ReadonlyArray<string>;
|
|
62
|
-
declare const bundle$
|
|
62
|
+
declare const bundle$9: Bundle.Bundle<"DismissLayer", void, {
|
|
63
63
|
readonly layers: readonly {
|
|
64
64
|
readonly id: string;
|
|
65
65
|
readonly outside: boolean;
|
|
@@ -86,7 +86,7 @@ declare const bundle$8: Bundle.Bundle<"DismissLayer", void, {
|
|
|
86
86
|
}, never, never, void, {}, {}>;
|
|
87
87
|
/** The layer ids whose element or trigger is on the event's composed path. */
|
|
88
88
|
declare const layersOnPath: (path: ReadonlyArray<EventTarget>) => ReadonlyArray<string>;
|
|
89
|
-
interface BehaviorOptions$
|
|
89
|
+
interface BehaviorOptions$14<Input, Slots> {
|
|
90
90
|
/** The layer's root, rendered only while the layer is open. */
|
|
91
91
|
readonly layer: keyof Slots & string;
|
|
92
92
|
/** The element that opens the layer, so a press on it is inside. */
|
|
@@ -103,11 +103,23 @@ interface BehaviorOptions$10<Input, Slots> {
|
|
|
103
103
|
* parent Model is the whole lifecycle. Not for an element with `popover`,
|
|
104
104
|
* which the browser dismisses itself.
|
|
105
105
|
*/
|
|
106
|
-
declare const behavior$
|
|
106
|
+
declare const behavior$14: <Field extends string>(_declared: Declared<typeof bundle$9, Field>) => <Slots>(slots: Slots) => <Input, ParentMessage>(options: BehaviorOptions$14<Input, Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
107
|
+
declare namespace editable_text_d_exports {
|
|
108
|
+
export { BehaviorOptions$13 as BehaviorOptions, EditAsked, TextCancelled, TextCommitted, TextEdited, TextFact, behavior$13 as behavior, EditableText as mount, textOf };
|
|
109
|
+
}
|
|
110
|
+
interface BehaviorOptions$13<Slots, ParentMessage> {
|
|
111
|
+
/** The slot holding the fields. */
|
|
112
|
+
readonly container: keyof Slots & string;
|
|
113
|
+
/** The attribute that marks a field, holding its name. */
|
|
114
|
+
readonly attribute: string;
|
|
115
|
+
/** Turns each fact into the view's Message. */
|
|
116
|
+
readonly toMessage: (fact: TextFact) => ParentMessage;
|
|
117
|
+
}
|
|
118
|
+
declare const behavior$13: <Slots>(slots: Slots) => <Input, ParentMessage>(options: BehaviorOptions$13<Slots, ParentMessage>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
107
119
|
declare namespace focus_scope_d_exports {
|
|
108
|
-
export { BehaviorOptions$
|
|
120
|
+
export { BehaviorOptions$12 as BehaviorOptions, behavior$12 as behavior, FocusScope as mount, tabbableWithin };
|
|
109
121
|
}
|
|
110
|
-
interface BehaviorOptions$
|
|
122
|
+
interface BehaviorOptions$12<Slots> {
|
|
111
123
|
readonly container: keyof Slots & string;
|
|
112
124
|
/** Keep Tab, Shift+Tab, and a stray focus inside. Default `true`. */
|
|
113
125
|
readonly contain?: boolean;
|
|
@@ -123,32 +135,32 @@ interface BehaviorOptions$9<Slots> {
|
|
|
123
135
|
* `restore`, focus returns to the element that had it. A dialog that is not
|
|
124
136
|
* a native `<dialog>`, a menu, or a command palette takes this.
|
|
125
137
|
*/
|
|
126
|
-
declare const behavior$
|
|
138
|
+
declare const behavior$12: <Slots>(slots: Slots) => <Input, ParentMessage>(options: BehaviorOptions$12<Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
127
139
|
declare namespace focus_visible_d_exports {
|
|
128
|
-
export { BehaviorOptions$
|
|
140
|
+
export { BehaviorOptions$11 as BehaviorOptions, Modality, InputModalityModel as Model, behavior$11 as behavior, InputModality as bundle, modalityOfKey };
|
|
129
141
|
}
|
|
130
|
-
interface BehaviorOptions$
|
|
142
|
+
interface BehaviorOptions$11<Slots> {
|
|
131
143
|
readonly target: keyof Slots & string;
|
|
132
144
|
}
|
|
133
|
-
declare const behavior$
|
|
145
|
+
declare const behavior$11: <Field extends string>(declared: Declared<typeof InputModality, Field>) => <Slots>(slots: Slots) => <Input extends { readonly [K in Field]: InputModalityModel; }, ParentMessage>(options: BehaviorOptions$11<Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
134
146
|
declare namespace roving_tabindex_d_exports {
|
|
135
|
-
export { Args$
|
|
147
|
+
export { Args$8 as Args, BehaviorOptions$10 as BehaviorOptions, Direction, Message$8 as Message, Model$8 as Model, MoveOptions$1 as MoveOptions, Orientation, behavior$10 as behavior, bundle$8 as bundle, idSelector, itemAttributes, move$2 as move, tabStop$1 as tabStop };
|
|
136
148
|
}
|
|
137
149
|
declare const Orientation: Schema.Literals<readonly ["vertical", "horizontal", "both"]>;
|
|
138
150
|
type Orientation = typeof Orientation.Type;
|
|
139
|
-
declare const Model$
|
|
151
|
+
declare const Model$8: Schema.Struct<{
|
|
140
152
|
/** The current item's id, or `null` before any item has been focused. */
|
|
141
153
|
readonly current: Schema.NullOr<Schema.String>;
|
|
142
154
|
}>;
|
|
143
|
-
type Model$
|
|
144
|
-
declare const Message$
|
|
155
|
+
type Model$8 = typeof Model$8.Type;
|
|
156
|
+
declare const Message$8: import("foldkit/message").MessageUnion<{
|
|
145
157
|
/** An item became current: the user focused it, or a key moved there. */
|
|
146
158
|
readonly Focused: {
|
|
147
159
|
readonly id: Schema.String;
|
|
148
160
|
};
|
|
149
161
|
}>;
|
|
150
|
-
type Message$
|
|
151
|
-
declare const Args$
|
|
162
|
+
type Message$8 = typeof Message$8.Type;
|
|
163
|
+
declare const Args$8: Schema.Struct<{
|
|
152
164
|
readonly orientation: Schema.Literals<readonly ["vertical", "horizontal", "both"]>;
|
|
153
165
|
/** Wrap from the last enabled item to the first, and back. */
|
|
154
166
|
readonly loop: Schema.Boolean;
|
|
@@ -156,8 +168,8 @@ declare const Args$7: Schema.Struct<{
|
|
|
156
168
|
* `aria-activedescendant` instead of moving focus. */
|
|
157
169
|
readonly virtual: Schema.Boolean;
|
|
158
170
|
}>;
|
|
159
|
-
type Args$
|
|
160
|
-
declare const bundle$
|
|
171
|
+
type Args$8 = typeof Args$8.Type;
|
|
172
|
+
declare const bundle$8: Bundle.Bundle<"RovingTabindex", {
|
|
161
173
|
readonly orientation: "vertical" | "horizontal" | "both";
|
|
162
174
|
readonly loop: boolean;
|
|
163
175
|
readonly virtual: boolean;
|
|
@@ -182,10 +194,10 @@ interface MoveOptions$1 {
|
|
|
182
194
|
* item. Under `rtl`, left and right swap. PageUp and PageDown move by `page`
|
|
183
195
|
* and clamp at the ends, never wrapping.
|
|
184
196
|
*/
|
|
185
|
-
declare const move$
|
|
197
|
+
declare const move$2: (enabled: ReadonlyArray<number>, current: number, key: string, modifiers: KeyboardModifiers, options: MoveOptions$1) => number | undefined;
|
|
186
198
|
/** The item that holds the tab stop: the current one, else the first enabled. */
|
|
187
|
-
declare const tabStop: (items: Behaviors.Collection.Items<unknown>, current: string | null) => number;
|
|
188
|
-
interface BehaviorOptions$
|
|
199
|
+
declare const tabStop$1: (items: Behaviors.Collection.Items<unknown>, current: string | null) => number;
|
|
200
|
+
interface BehaviorOptions$10<Input, Slots> {
|
|
189
201
|
/** The slot that receives the arrow keys. */
|
|
190
202
|
readonly container: keyof Slots & string;
|
|
191
203
|
/** The slot rendered once per item; must carry the item's id (see `Behaviors.Collection`). */
|
|
@@ -213,23 +225,23 @@ declare const itemAttributes: <ParentMessage>(h: HtmlBuilder<ParentMessage>, ite
|
|
|
213
225
|
* attributes are data, so a view that no longer attaches this leaves no
|
|
214
226
|
* `tabindex` behind.
|
|
215
227
|
*/
|
|
216
|
-
declare const behavior$
|
|
228
|
+
declare const behavior$10: <Field extends string>(declared: Declared<typeof bundle$8, Field>, args: Args$8) => <Slots>(slots: Slots) => <Input extends { readonly [K in Field]: Model$8; }, ParentMessage>(options: BehaviorOptions$10<Input, Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
217
229
|
declare namespace grid_navigation_d_exports {
|
|
218
|
-
export { Args$
|
|
230
|
+
export { Args$7 as Args, BehaviorOptions$9 as BehaviorOptions, Message$7 as Message, Model$7 as Model, MoveOptions, behavior$9 as behavior, bundle$7 as bundle, move$1 as move };
|
|
219
231
|
}
|
|
220
|
-
declare const Model$
|
|
232
|
+
declare const Model$7: Schema.Struct<{
|
|
221
233
|
/** The current cell's id, or `null` before any cell has been focused. */
|
|
222
234
|
readonly current: Schema.NullOr<Schema.String>;
|
|
223
235
|
}>;
|
|
224
|
-
type Model$
|
|
225
|
-
declare const Message$
|
|
236
|
+
type Model$7 = typeof Model$7.Type;
|
|
237
|
+
declare const Message$7: import("foldkit/message").MessageUnion<{
|
|
226
238
|
/** A cell became current: the user focused it, or a key moved there. */
|
|
227
239
|
readonly Focused: {
|
|
228
240
|
readonly id: Schema.String;
|
|
229
241
|
};
|
|
230
242
|
}>;
|
|
231
|
-
type Message$
|
|
232
|
-
declare const Args$
|
|
243
|
+
type Message$7 = typeof Message$7.Type;
|
|
244
|
+
declare const Args$7: Schema.Struct<{
|
|
233
245
|
/** Cells per row; the last row may be short. */
|
|
234
246
|
readonly columns: Schema.Number;
|
|
235
247
|
/** Left and right continue into the previous and next row; up and down
|
|
@@ -239,8 +251,8 @@ declare const Args$6: Schema.Struct<{
|
|
|
239
251
|
* `aria-activedescendant` instead of moving focus. */
|
|
240
252
|
readonly virtual: Schema.Boolean;
|
|
241
253
|
}>;
|
|
242
|
-
type Args$
|
|
243
|
-
declare const bundle$
|
|
254
|
+
type Args$7 = typeof Args$7.Type;
|
|
255
|
+
declare const bundle$7: Bundle.Bundle<"GridNavigation", {
|
|
244
256
|
readonly columns: number;
|
|
245
257
|
readonly wrap: boolean;
|
|
246
258
|
readonly virtual: boolean;
|
|
@@ -266,8 +278,8 @@ interface MoveOptions {
|
|
|
266
278
|
* the first enabled cell and a backward key on the last. Under `rtl`, left
|
|
267
279
|
* and right swap.
|
|
268
280
|
*/
|
|
269
|
-
declare const move: (enabled: ReadonlyArray<number>, count: number, current: number, key: string, modifiers: KeyboardModifiers, options: MoveOptions) => number | undefined;
|
|
270
|
-
interface BehaviorOptions$
|
|
281
|
+
declare const move$1: (enabled: ReadonlyArray<number>, count: number, current: number, key: string, modifiers: KeyboardModifiers, options: MoveOptions) => number | undefined;
|
|
282
|
+
interface BehaviorOptions$9<Input, Slots> {
|
|
271
283
|
/** The slot that receives the arrow keys. */
|
|
272
284
|
readonly container: keyof Slots & string;
|
|
273
285
|
/** The slot rendered once per cell; must carry the cell's id (see `Behaviors.Collection`). */
|
|
@@ -283,7 +295,7 @@ interface BehaviorOptions$6<Input, Slots> {
|
|
|
283
295
|
* only dispatch and point with `aria-activedescendant`; each cell gets
|
|
284
296
|
* `tabindex` 0 or -1 and reports `Focused` when focused.
|
|
285
297
|
*/
|
|
286
|
-
declare const behavior$
|
|
298
|
+
declare const behavior$9: <Field extends string>(declared: Declared<typeof bundle$7, Field>, args: Args$7) => <Slots>(slots: Slots) => <Input extends { readonly [K in Field]: Model$7; }, ParentMessage>(options: BehaviorOptions$9<Input, Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
287
299
|
declare namespace layers_d_exports {
|
|
288
300
|
export { hideOutside, HideOutside as hideOutsideMount, scrollLock, ScrollLock as scrollLockMount };
|
|
289
301
|
}
|
|
@@ -296,11 +308,11 @@ declare const hideOutside: <Slots>(slots: Slots) => <Input, ParentMessage>(optio
|
|
|
296
308
|
readonly container: keyof Slots & string;
|
|
297
309
|
}) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
298
310
|
declare namespace live_announce_d_exports {
|
|
299
|
-
export { Args$
|
|
311
|
+
export { Args$6 as Args, Message$6 as Message, Model$6 as Model, Politeness, REGION_ATTRIBUTE, bundle$6 as bundle, reread, say, view };
|
|
300
312
|
}
|
|
301
313
|
declare const Politeness: Schema.Literals<readonly ["polite", "assertive"]>;
|
|
302
314
|
type Politeness = typeof Politeness.Type;
|
|
303
|
-
declare const Model$
|
|
315
|
+
declare const Model$6: Schema.Struct<{
|
|
304
316
|
readonly polite: Schema.String;
|
|
305
317
|
readonly assertive: Schema.String;
|
|
306
318
|
/** Waiting for the debounce to read. */
|
|
@@ -310,8 +322,8 @@ declare const Model$5: Schema.Struct<{
|
|
|
310
322
|
}>>;
|
|
311
323
|
readonly generation: Schema.Number;
|
|
312
324
|
}>;
|
|
313
|
-
type Model$
|
|
314
|
-
declare const Message$
|
|
325
|
+
type Model$6 = typeof Model$6.Type;
|
|
326
|
+
declare const Message$6: import("foldkit/message").MessageUnion<{
|
|
315
327
|
readonly Announced: {
|
|
316
328
|
readonly message: Schema.String;
|
|
317
329
|
readonly politeness: Schema.Literals<readonly ["polite", "assertive"]>;
|
|
@@ -323,17 +335,17 @@ declare const Message$5: import("foldkit/message").MessageUnion<{
|
|
|
323
335
|
readonly generation: Schema.Number;
|
|
324
336
|
};
|
|
325
337
|
}>;
|
|
326
|
-
type Message$
|
|
327
|
-
declare const Args$
|
|
338
|
+
type Message$6 = typeof Message$6.Type;
|
|
339
|
+
declare const Args$6: Schema.Struct<{
|
|
328
340
|
/** A burst of announcements inside this window reads once, the last one. */
|
|
329
341
|
readonly debounceMs: Schema.Number;
|
|
330
342
|
/** How long the text stays in the region. */
|
|
331
343
|
readonly clearAfterMs: Schema.Number;
|
|
332
344
|
}>;
|
|
333
|
-
type Args$
|
|
345
|
+
type Args$6 = typeof Args$6.Type;
|
|
334
346
|
/** The text to put in the region so that `next` is read even when it equals `current`. */
|
|
335
347
|
declare const reread: (current: string, next: string) => string;
|
|
336
|
-
declare const bundle$
|
|
348
|
+
declare const bundle$6: Bundle.Bundle<"LiveAnnounce", {
|
|
337
349
|
readonly debounceMs: number;
|
|
338
350
|
readonly clearAfterMs: number;
|
|
339
351
|
}, {
|
|
@@ -356,24 +368,24 @@ declare const bundle$5: Bundle.Bundle<"LiveAnnounce", {
|
|
|
356
368
|
readonly generation: number;
|
|
357
369
|
}, never, never, never, void, {}, {}>;
|
|
358
370
|
/** The parent Message that announces `text`, to return from `update` or `onOut`. */
|
|
359
|
-
declare const say: <Field extends string>(declared: Declared<typeof bundle$
|
|
371
|
+
declare const say: <Field extends string>(declared: Declared<typeof bundle$6, Field>) => <ParentMessage>(text: string, politeness?: Politeness) => ParentMessage;
|
|
360
372
|
declare const REGION_ATTRIBUTE = "data-foldkit-plus-live";
|
|
361
373
|
/**
|
|
362
374
|
* The two live regions. Render once, anywhere in the page, and hide them
|
|
363
375
|
* visually with a rule on `[data-foldkit-plus-live]`; they must stay in the
|
|
364
376
|
* accessibility tree, so no `display: none`.
|
|
365
377
|
*/
|
|
366
|
-
declare const view: <ParentMessage>(model: Model$
|
|
378
|
+
declare const view: <ParentMessage>(model: Model$6, h: HtmlBuilder<ParentMessage>) => Html;
|
|
367
379
|
declare namespace list_navigation_d_exports {
|
|
368
|
-
export { Args$
|
|
380
|
+
export { Args$5 as Args, BehaviorOptions$8 as BehaviorOptions, KeyOutcome, Message$5 as Message, Model$5 as Model, behavior$8 as behavior, bundle$5 as bundle, keyOutcome };
|
|
369
381
|
}
|
|
370
|
-
declare const Model$
|
|
382
|
+
declare const Model$5: Schema.Struct<{
|
|
371
383
|
readonly current: Schema.NullOr<Schema.String>;
|
|
372
384
|
readonly query: Schema.String;
|
|
373
385
|
readonly generation: Schema.Number;
|
|
374
386
|
}>;
|
|
375
|
-
type Model$
|
|
376
|
-
declare const Message$
|
|
387
|
+
type Model$5 = typeof Model$5.Type;
|
|
388
|
+
declare const Message$5: import("foldkit/message").MessageUnion<{
|
|
377
389
|
/** An item became current: focused, or reached by a key. */
|
|
378
390
|
readonly Focused: {
|
|
379
391
|
readonly id: Schema.String;
|
|
@@ -388,8 +400,8 @@ declare const Message$4: import("foldkit/message").MessageUnion<{
|
|
|
388
400
|
};
|
|
389
401
|
readonly Cleared: {};
|
|
390
402
|
}>;
|
|
391
|
-
type Message$
|
|
392
|
-
declare const Args$
|
|
403
|
+
type Message$5 = typeof Message$5.Type;
|
|
404
|
+
declare const Args$5: Schema.Struct<{
|
|
393
405
|
readonly orientation: Schema.Literals<readonly ["vertical", "horizontal", "both"]>;
|
|
394
406
|
readonly loop: Schema.Boolean;
|
|
395
407
|
readonly virtual: Schema.Boolean;
|
|
@@ -398,8 +410,8 @@ declare const Args$4: Schema.Struct<{
|
|
|
398
410
|
/** How many enabled items PageUp and PageDown move. */
|
|
399
411
|
readonly page: Schema.Number;
|
|
400
412
|
}>;
|
|
401
|
-
type Args$
|
|
402
|
-
declare const bundle$
|
|
413
|
+
type Args$5 = typeof Args$5.Type;
|
|
414
|
+
declare const bundle$5: Bundle.Bundle<"ListNavigation", {
|
|
403
415
|
readonly orientation: "vertical" | "horizontal" | "both";
|
|
404
416
|
readonly loop: boolean;
|
|
405
417
|
readonly virtual: boolean;
|
|
@@ -422,7 +434,7 @@ declare const bundle$4: Bundle.Bundle<"ListNavigation", {
|
|
|
422
434
|
readonly _tag: "Focused";
|
|
423
435
|
readonly id: string;
|
|
424
436
|
}, never, never, never, void, {}, {}>;
|
|
425
|
-
interface BehaviorOptions$
|
|
437
|
+
interface BehaviorOptions$8<Input, Slots> {
|
|
426
438
|
readonly container: keyof Slots & string;
|
|
427
439
|
/** The slot rendered once per item; must carry the item's id (see `Behaviors.Collection`). */
|
|
428
440
|
readonly item: keyof Slots & string;
|
|
@@ -454,19 +466,19 @@ declare const keyOutcome: (items: Behaviors.Collection.Items<unknown>, texts: Re
|
|
|
454
466
|
* `OnFocus` as under `RovingTabindex`. Under `virtual` nothing takes DOM focus
|
|
455
467
|
* and the container carries `aria-activedescendant`.
|
|
456
468
|
*/
|
|
457
|
-
declare const behavior$
|
|
469
|
+
declare const behavior$8: <Field extends string>(declared: Declared<typeof bundle$5, Field>, args: Args$5) => <Slots>(slots: Slots) => <Input extends { readonly [K in Field]: Model$5; }, ParentMessage>(options: BehaviorOptions$8<Input, Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
458
470
|
declare namespace long_press_d_exports {
|
|
459
|
-
export { Args$
|
|
471
|
+
export { Args$4 as Args, BehaviorOptions$7 as BehaviorOptions, LongPressed, Message$4 as Message, Model$4 as Model, behavior$7 as behavior, bundle$4 as bundle };
|
|
460
472
|
}
|
|
461
|
-
declare const Model$
|
|
473
|
+
declare const Model$4: Schema.Struct<{
|
|
462
474
|
/** Down, and the threshold has not passed. */
|
|
463
475
|
readonly holding: Schema.Boolean;
|
|
464
476
|
readonly pointerId: Schema.NullOr<Schema.Number>;
|
|
465
477
|
readonly key: Schema.NullOr<Schema.String>;
|
|
466
478
|
readonly generation: Schema.Number;
|
|
467
479
|
}>;
|
|
468
|
-
type Model$
|
|
469
|
-
declare const Message$
|
|
480
|
+
type Model$4 = typeof Model$4.Type;
|
|
481
|
+
declare const Message$4: import("foldkit/message").MessageUnion<{
|
|
470
482
|
readonly PointerDown: {
|
|
471
483
|
readonly pointerId: Schema.Number;
|
|
472
484
|
readonly button: Schema.Number;
|
|
@@ -497,16 +509,16 @@ declare const Message$3: import("foldkit/message").MessageUnion<{
|
|
|
497
509
|
readonly pointerType: Schema.Literals<readonly ["mouse", "touch", "pen", "keyboard", "virtual"]>;
|
|
498
510
|
};
|
|
499
511
|
}>;
|
|
500
|
-
type Message$
|
|
512
|
+
type Message$4 = typeof Message$4.Type;
|
|
501
513
|
declare const LongPressed: Schema.TaggedStruct<"LongPressed", {
|
|
502
514
|
readonly pointerType: Schema.Literals<readonly ["mouse", "touch", "pen", "keyboard", "virtual"]>;
|
|
503
515
|
}>;
|
|
504
516
|
type LongPressed = typeof LongPressed.Type;
|
|
505
|
-
declare const Args$
|
|
517
|
+
declare const Args$4: Schema.Struct<{
|
|
506
518
|
readonly thresholdMs: Schema.Number;
|
|
507
519
|
}>;
|
|
508
|
-
type Args$
|
|
509
|
-
declare const bundle$
|
|
520
|
+
type Args$4 = typeof Args$4.Type;
|
|
521
|
+
declare const bundle$4: Bundle.Bundle<"LongPress", {
|
|
510
522
|
readonly thresholdMs: number;
|
|
511
523
|
}, {
|
|
512
524
|
readonly holding: boolean;
|
|
@@ -546,7 +558,7 @@ declare const bundle$3: Bundle.Bundle<"LongPress", {
|
|
|
546
558
|
readonly _tag: "LongPressed";
|
|
547
559
|
readonly pointerType: "keyboard" | "virtual" | "mouse" | "touch" | "pen";
|
|
548
560
|
}, never, never, void, {}, {}>;
|
|
549
|
-
interface BehaviorOptions$
|
|
561
|
+
interface BehaviorOptions$7<Slots> {
|
|
550
562
|
readonly target: keyof Slots & string;
|
|
551
563
|
}
|
|
552
564
|
/**
|
|
@@ -555,22 +567,22 @@ interface BehaviorOptions$4<Slots> {
|
|
|
555
567
|
* `LongPress` on one slot are refused by the resolver (two Mounts of one
|
|
556
568
|
* name), so today a slot takes one of them.
|
|
557
569
|
*/
|
|
558
|
-
declare const behavior$
|
|
570
|
+
declare const behavior$7: <Field extends string>(declared: Declared<typeof bundle$4, Field>) => <Slots>(slots: Slots) => <Input extends { readonly [K in Field]: Model$4; }, ParentMessage>(options: BehaviorOptions$7<Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
559
571
|
declare namespace move_d_exports {
|
|
560
|
-
export { BehaviorOptions$
|
|
572
|
+
export { BehaviorOptions$6 as BehaviorOptions, Fact$1 as Fact, MoveEnded, MoveStarted, Moved, behavior$6 as behavior, Move as mount };
|
|
561
573
|
}
|
|
562
|
-
interface BehaviorOptions$
|
|
574
|
+
interface BehaviorOptions$6<Slots, ParentMessage> {
|
|
563
575
|
readonly handle: keyof Slots & string;
|
|
564
576
|
/** Turns each fact into the view's Message. */
|
|
565
577
|
readonly toMessage: (fact: Fact$1) => ParentMessage;
|
|
566
578
|
}
|
|
567
|
-
declare const behavior$
|
|
579
|
+
declare const behavior$6: <Slots>(slots: Slots) => <Input, ParentMessage>(options: BehaviorOptions$6<Slots, ParentMessage>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
568
580
|
declare namespace press_d_exports {
|
|
569
|
-
export { Args$
|
|
581
|
+
export { Args$3 as Args, BehaviorOptions$5 as BehaviorOptions, Fact, Message$3 as Message, Model$3 as Model, PointerType, Pressed, behavior$5 as behavior, bundle$3 as bundle, events };
|
|
570
582
|
}
|
|
571
583
|
declare const PointerType: Schema.Literals<readonly ["mouse", "touch", "pen", "keyboard", "virtual"]>;
|
|
572
584
|
type PointerType = typeof PointerType.Type;
|
|
573
|
-
declare const Model$
|
|
585
|
+
declare const Model$3: Schema.Struct<{
|
|
574
586
|
/** Down and not yet released or cancelled. For styling. */
|
|
575
587
|
readonly pressed: Schema.Boolean;
|
|
576
588
|
/** The pointer that pressed, so another pointer's up cannot release it. */
|
|
@@ -581,8 +593,8 @@ declare const Model$2: Schema.Struct<{
|
|
|
581
593
|
readonly suppressing: Schema.NullOr<Schema.Number>;
|
|
582
594
|
readonly generation: Schema.Number;
|
|
583
595
|
}>;
|
|
584
|
-
type Model$
|
|
585
|
-
declare const Message$
|
|
596
|
+
type Model$3 = typeof Model$3.Type;
|
|
597
|
+
declare const Message$3: import("foldkit/message").MessageUnion<{
|
|
586
598
|
readonly PointerDown: {
|
|
587
599
|
readonly pointerId: Schema.Number;
|
|
588
600
|
readonly button: Schema.Number;
|
|
@@ -613,19 +625,19 @@ declare const Message$2: import("foldkit/message").MessageUnion<{
|
|
|
613
625
|
readonly generation: Schema.Number;
|
|
614
626
|
};
|
|
615
627
|
}>;
|
|
616
|
-
type Message$
|
|
628
|
+
type Message$3 = typeof Message$3.Type;
|
|
617
629
|
declare const Pressed: Schema.TaggedStruct<"Pressed", {
|
|
618
630
|
readonly pointerType: Schema.Literals<readonly ["mouse", "touch", "pen", "keyboard", "virtual"]>;
|
|
619
631
|
/** Shift was held, for a range selection. */
|
|
620
632
|
readonly shiftKey: Schema.Boolean;
|
|
621
633
|
}>;
|
|
622
634
|
type Pressed = typeof Pressed.Type;
|
|
623
|
-
declare const Args$
|
|
635
|
+
declare const Args$3: Schema.Struct<{
|
|
624
636
|
/** How long after a pointer press a `click` is taken for its ghost. */
|
|
625
637
|
readonly clickSuppressionMs: Schema.Number;
|
|
626
638
|
}>;
|
|
627
|
-
type Args$
|
|
628
|
-
declare const bundle$
|
|
639
|
+
type Args$3 = typeof Args$3.Type;
|
|
640
|
+
declare const bundle$3: Bundle.Bundle<"Press", {
|
|
629
641
|
readonly clickSuppressionMs: number;
|
|
630
642
|
}, {
|
|
631
643
|
readonly pressed: boolean;
|
|
@@ -667,7 +679,7 @@ declare const bundle$2: Bundle.Bundle<"Press", {
|
|
|
667
679
|
readonly shiftKey: boolean;
|
|
668
680
|
}, never, never, void, {}, {}>;
|
|
669
681
|
/** What the element reports; `Unsuppressed` comes from the timer, not the DOM. */
|
|
670
|
-
type Fact = Exclude<Message$
|
|
682
|
+
type Fact = Exclude<Message$3, {
|
|
671
683
|
readonly _tag: 'Unsuppressed';
|
|
672
684
|
}>;
|
|
673
685
|
/**
|
|
@@ -703,7 +715,7 @@ declare const events: Mount.MountDefinitionNoArgs<"PressEvents", {
|
|
|
703
715
|
readonly detail: number;
|
|
704
716
|
readonly shiftKey: boolean;
|
|
705
717
|
}>;
|
|
706
|
-
interface BehaviorOptions$
|
|
718
|
+
interface BehaviorOptions$5<Input, Slots> {
|
|
707
719
|
readonly target: keyof Slots & string;
|
|
708
720
|
/** Marks the target `aria-disabled`, which also silences its events. */
|
|
709
721
|
readonly disabled?: (input: Input) => boolean;
|
|
@@ -714,20 +726,20 @@ interface BehaviorOptions$2<Input, Slots> {
|
|
|
714
726
|
* decides nothing; a click, a touch, Enter, Space, or an assistive
|
|
715
727
|
* technology's click all reach `update` and come out as one `Pressed`.
|
|
716
728
|
*/
|
|
717
|
-
declare const behavior$
|
|
729
|
+
declare const behavior$5: <Field extends string>(declared: Declared<typeof bundle$3, Field>) => <Slots>(slots: Slots) => <Input extends { readonly [K in Field]: Model$3; }, ParentMessage>(options: BehaviorOptions$5<Input, Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
718
730
|
declare namespace selection_d_exports {
|
|
719
|
-
export { Args$
|
|
731
|
+
export { Args$2 as Args, BehaviorOptions$4 as BehaviorOptions, Message$2 as Message, Mode, Model$2 as Model, behavior$4 as behavior, between, bundle$2 as bundle };
|
|
720
732
|
}
|
|
721
733
|
declare const Mode: Schema.Literals<readonly ["single", "multiple", "none"]>;
|
|
722
734
|
type Mode = typeof Mode.Type;
|
|
723
|
-
declare const Model$
|
|
735
|
+
declare const Model$2: Schema.Struct<{
|
|
724
736
|
/** In selection order. */
|
|
725
737
|
readonly selected: Schema.$Array<Schema.String>;
|
|
726
738
|
/** Where the last plain selection happened; a range extends from it. */
|
|
727
739
|
readonly anchor: Schema.NullOr<Schema.String>;
|
|
728
740
|
}>;
|
|
729
|
-
type Model$
|
|
730
|
-
declare const Message$
|
|
741
|
+
type Model$2 = typeof Model$2.Type;
|
|
742
|
+
declare const Message$2: import("foldkit/message").MessageUnion<{
|
|
731
743
|
/** A plain activation: replaces in single mode, toggles in multiple mode. */
|
|
732
744
|
readonly Activated: {
|
|
733
745
|
readonly id: Schema.String;
|
|
@@ -742,16 +754,16 @@ declare const Message$1: import("foldkit/message").MessageUnion<{
|
|
|
742
754
|
};
|
|
743
755
|
readonly Cleared: {};
|
|
744
756
|
}>;
|
|
745
|
-
type Message$
|
|
746
|
-
declare const Args$
|
|
757
|
+
type Message$2 = typeof Message$2.Type;
|
|
758
|
+
declare const Args$2: Schema.Struct<{
|
|
747
759
|
readonly mode: Schema.Literals<readonly ["single", "multiple", "none"]>;
|
|
748
760
|
/** In single mode, whether activating the selected item deselects it. */
|
|
749
761
|
readonly allowEmpty: Schema.Boolean;
|
|
750
762
|
}>;
|
|
751
|
-
type Args$
|
|
763
|
+
type Args$2 = typeof Args$2.Type;
|
|
752
764
|
/** The ids between `from` and `to` in `order`, inclusive, in `order`'s order. */
|
|
753
765
|
declare const between: (order: ReadonlyArray<string>, from: string | null, to: string) => ReadonlyArray<string>;
|
|
754
|
-
declare const bundle$
|
|
766
|
+
declare const bundle$2: Bundle.Bundle<"Selection", {
|
|
755
767
|
readonly mode: "single" | "multiple" | "none";
|
|
756
768
|
readonly allowEmpty: boolean;
|
|
757
769
|
}, {
|
|
@@ -770,7 +782,7 @@ declare const bundle$1: Bundle.Bundle<"Selection", {
|
|
|
770
782
|
readonly _tag: "Replaced";
|
|
771
783
|
readonly ids: readonly string[];
|
|
772
784
|
}, never, never, never, void, {}, {}>;
|
|
773
|
-
interface BehaviorOptions$
|
|
785
|
+
interface BehaviorOptions$4<Input, Slots> {
|
|
774
786
|
/** The slot holding the items, for `aria-multiselectable`. */
|
|
775
787
|
readonly container?: keyof Slots & string;
|
|
776
788
|
/** The slot rendered once per item; must carry the item's id. */
|
|
@@ -785,6 +797,149 @@ interface BehaviorOptions$1<Input, Slots> {
|
|
|
785
797
|
* `aria-multiselectable` on the container in multiple mode; wires `OnClick`
|
|
786
798
|
* to `Activated` unless told not to. A disabled item gets no click.
|
|
787
799
|
*/
|
|
800
|
+
declare const behavior$4: <Field extends string>(declared: Declared<typeof bundle$2, Field>, args: Args$2) => <Slots>(slots: Slots) => <Input extends { readonly [K in Field]: Model$2; }, ParentMessage>(options: BehaviorOptions$4<Input, Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
801
|
+
declare namespace targets_d_exports {
|
|
802
|
+
export { BehaviorOptions$3 as BehaviorOptions, TargetFact, TargetHovered, TargetPressed, behavior$3 as behavior, Targets as mount, targetOf };
|
|
803
|
+
}
|
|
804
|
+
interface BehaviorOptions$3<Slots, ParentMessage> {
|
|
805
|
+
/** The slot holding the marked descendants. */
|
|
806
|
+
readonly container: keyof Slots & string;
|
|
807
|
+
/** The attribute that marks a descendant, holding its id. */
|
|
808
|
+
readonly attribute: string;
|
|
809
|
+
/** Prevent a press's default, such as a link navigating. Default `false`. */
|
|
810
|
+
readonly preventDefault?: boolean;
|
|
811
|
+
/** Turns each fact into the view's Message. */
|
|
812
|
+
readonly toMessage: (fact: TargetFact) => ParentMessage;
|
|
813
|
+
}
|
|
814
|
+
declare const behavior$3: <Slots>(slots: Slots) => <Input, ParentMessage>(options: BehaviorOptions$3<Slots, ParentMessage>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
815
|
+
declare namespace pointer_drag_d_exports {
|
|
816
|
+
export { BehaviorOptions$2 as BehaviorOptions, DRAG_THRESHOLD, DragCancelled, DragDropped, DragFact, DragPlace, DragStarted, DragZone, DraggedOver, behavior$2 as behavior, boxOf, PointerDrag as mount, zoneOf };
|
|
817
|
+
}
|
|
818
|
+
interface BehaviorOptions$2<Slots, ParentMessage> {
|
|
819
|
+
/** The slot holding the marked descendants. */
|
|
820
|
+
readonly container: keyof Slots & string;
|
|
821
|
+
/** The attribute that marks a descendant, holding its id. */
|
|
822
|
+
readonly attribute: string;
|
|
823
|
+
/**
|
|
824
|
+
* Where a drag may land when not among the container's own: elements marked
|
|
825
|
+
* by `attribute` inside the one `within` selects, such as a page for a palette.
|
|
826
|
+
*/
|
|
827
|
+
readonly targets?: {
|
|
828
|
+
readonly attribute: string;
|
|
829
|
+
readonly within: string;
|
|
830
|
+
};
|
|
831
|
+
/** Turns each fact into the view's Message. */
|
|
832
|
+
readonly toMessage: (fact: DragFact) => ParentMessage;
|
|
833
|
+
}
|
|
834
|
+
declare const behavior$2: <Slots>(slots: Slots) => <Input, ParentMessage>(options: BehaviorOptions$2<Slots, ParentMessage>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
835
|
+
declare namespace tree_navigation_d_exports {
|
|
836
|
+
export { Action, Args$1 as Args, BehaviorOptions$1 as BehaviorOptions, Message$1 as Message, Model$1 as Model, Row, Shown, behavior$1 as behavior, bundle$1 as bundle, isOpen, move, shown, tabStop };
|
|
837
|
+
}
|
|
838
|
+
declare const Model$1: Schema.Struct<{
|
|
839
|
+
/** The current row's id, or `null` before any row has been focused. */
|
|
840
|
+
readonly current: Schema.NullOr<Schema.String>;
|
|
841
|
+
/** The rows whose open state differs from `openByDefault`. */
|
|
842
|
+
readonly toggled: Schema.$Array<Schema.String>;
|
|
843
|
+
}>;
|
|
844
|
+
type Model$1 = typeof Model$1.Type;
|
|
845
|
+
declare const Message$1: import("foldkit/message").MessageUnion<{
|
|
846
|
+
/** A row became current: the user focused it, or a key moved there. */
|
|
847
|
+
readonly Focused: {
|
|
848
|
+
readonly id: Schema.String;
|
|
849
|
+
};
|
|
850
|
+
readonly Opened: {
|
|
851
|
+
readonly id: Schema.String;
|
|
852
|
+
};
|
|
853
|
+
readonly Closed: {
|
|
854
|
+
readonly id: Schema.String;
|
|
855
|
+
};
|
|
856
|
+
}>;
|
|
857
|
+
type Message$1 = typeof Message$1.Type;
|
|
858
|
+
declare const Args$1: Schema.Struct<{
|
|
859
|
+
/** Whether a row with children starts open. */
|
|
860
|
+
readonly openByDefault: Schema.Boolean;
|
|
861
|
+
}>;
|
|
862
|
+
type Args$1 = typeof Args$1.Type;
|
|
863
|
+
/** Whether a row is open, given the default and what was toggled. */
|
|
864
|
+
declare const isOpen: (model: Model$1, args: Args$1, id: string) => boolean;
|
|
865
|
+
declare const bundle$1: Bundle.Bundle<"TreeNavigation", {
|
|
866
|
+
readonly openByDefault: boolean;
|
|
867
|
+
}, {
|
|
868
|
+
readonly current: string | null;
|
|
869
|
+
readonly toggled: readonly string[];
|
|
870
|
+
}, {
|
|
871
|
+
readonly _tag: "Focused";
|
|
872
|
+
readonly id: string;
|
|
873
|
+
} | {
|
|
874
|
+
readonly _tag: "Opened";
|
|
875
|
+
readonly id: string;
|
|
876
|
+
} | {
|
|
877
|
+
readonly _tag: "Closed";
|
|
878
|
+
readonly id: string;
|
|
879
|
+
}, never, never, never, void, {}, {}>;
|
|
880
|
+
/** One row of the tree, in tree order: a parent comes before its children. */
|
|
881
|
+
interface Row {
|
|
882
|
+
readonly id: string;
|
|
883
|
+
/** The parent's id, or `null` for a top-level row. */
|
|
884
|
+
readonly parent: string | null;
|
|
885
|
+
/** Whether it has children, so it can be opened and closed. */
|
|
886
|
+
readonly branch: boolean;
|
|
887
|
+
readonly disabled?: boolean;
|
|
888
|
+
}
|
|
889
|
+
/** A row as it is showing: where it sits, for its ARIA attributes. */
|
|
890
|
+
interface Shown extends Row {
|
|
891
|
+
/** 1 for a top-level row. */
|
|
892
|
+
readonly level: number;
|
|
893
|
+
/** Its place among its siblings, from 1, and how many there are. */
|
|
894
|
+
readonly position: number;
|
|
895
|
+
readonly siblings: number;
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* The rows that are showing: every row whose ancestors are all open, with its
|
|
899
|
+
* level and its place among its siblings. A row whose parent is not a row is
|
|
900
|
+
* treated as top-level.
|
|
901
|
+
*/
|
|
902
|
+
declare const shown: (rows: ReadonlyArray<Row>, model: Model$1, args: Args$1) => ReadonlyArray<Shown>;
|
|
903
|
+
/** What a key does: move to a row, or open or close one. */
|
|
904
|
+
type Action = {
|
|
905
|
+
readonly _tag: 'Focus';
|
|
906
|
+
readonly id: string;
|
|
907
|
+
} | {
|
|
908
|
+
readonly _tag: 'Open';
|
|
909
|
+
readonly id: string;
|
|
910
|
+
} | {
|
|
911
|
+
readonly _tag: 'Close';
|
|
912
|
+
readonly id: string;
|
|
913
|
+
};
|
|
914
|
+
/**
|
|
915
|
+
* What a key does from the current row, over the rows that are showing, or
|
|
916
|
+
* `undefined` when it is not a key the tree handles. Disabled rows are stepped
|
|
917
|
+
* over. With nothing current, Down and Home land on the first row, Up and End
|
|
918
|
+
* on the last. Right and Left swap under `rtl`.
|
|
919
|
+
*/
|
|
920
|
+
declare const move: (rows: ReadonlyArray<Shown>, current: string | null, key: string, modifiers: KeyboardModifiers, model: Model$1, args: Args$1, direction?: "ltr" | "rtl") => Action | undefined;
|
|
921
|
+
/** The row that holds the tab stop: the current one while it is showing, else the first. */
|
|
922
|
+
declare const tabStop: (rows: ReadonlyArray<Shown>, current: string | null) => string | undefined;
|
|
923
|
+
interface BehaviorOptions$1<Input, Slots> {
|
|
924
|
+
/** The slot that receives the keys: the element with `role="tree"`. */
|
|
925
|
+
readonly container: keyof Slots & string;
|
|
926
|
+
/** The slot rendered once per showing row, with `item.id` or `item.index` into `shown`. */
|
|
927
|
+
readonly item: keyof Slots & string;
|
|
928
|
+
/** Every row, open or not, in tree order. */
|
|
929
|
+
readonly rows: (input: Input) => ReadonlyArray<Row>;
|
|
930
|
+
/** The DOM id a row's element carries. Default: the row's own id. */
|
|
931
|
+
readonly domId?: (id: string) => string;
|
|
932
|
+
readonly direction?: (input: Input) => 'ltr' | 'rtl';
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Wires a placed `TreeNavigation` to the slots. The container's keys move focus
|
|
936
|
+
* to the row they pick, or open or close the current row with focus left where
|
|
937
|
+
* it is. Each showing row gets its id, `role="treeitem"`, `aria-level` (and
|
|
938
|
+
* the same level as `--fk-tree-level`, so one `calc` indents any depth),
|
|
939
|
+
* `aria-posinset`, `aria-setsize`, `aria-expanded` when it has children,
|
|
940
|
+
* `aria-disabled` when disabled, a roving `tabindex`, and `OnFocus` reporting
|
|
941
|
+
* it current. Every handled key is default-prevented.
|
|
942
|
+
*/
|
|
788
943
|
declare const behavior$1: <Field extends string>(declared: Declared<typeof bundle$1, Field>, args: Args$1) => <Slots>(slots: Slots) => <Input extends { readonly [K in Field]: Model$1; }, ParentMessage>(options: BehaviorOptions$1<Input, Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
789
944
|
declare namespace typeahead_d_exports {
|
|
790
945
|
export { Args, BehaviorOptions, Message, Model, behavior, bundle, isPrintable, match };
|
|
@@ -858,5 +1013,5 @@ interface BehaviorOptions<Input, Slots> {
|
|
|
858
1013
|
*/
|
|
859
1014
|
declare const behavior: <Field extends string>(declared: Declared<typeof bundle, Field>) => <Slots>(slots: Slots) => <Input extends { readonly [K in Field]: Model; }, ParentMessage>(options: BehaviorOptions<Input, Slots>) => Behavior.NamedBehavior<Slots, Input, ParentMessage>;
|
|
860
1015
|
//#endregion
|
|
861
|
-
export { dismiss_layer_d_exports as DismissLayer, focus_scope_d_exports as FocusScope, focus_visible_d_exports as FocusVisible, grid_navigation_d_exports as GridNavigation, layers_d_exports as Layers, list_navigation_d_exports as ListNavigation, live_announce_d_exports as LiveAnnounce, long_press_d_exports as LongPress, move_d_exports as Move, press_d_exports as Press, roving_tabindex_d_exports as RovingTabindex, selection_d_exports as Selection, typeahead_d_exports as Typeahead };
|
|
1016
|
+
export { dismiss_layer_d_exports as DismissLayer, editable_text_d_exports as EditableText, focus_scope_d_exports as FocusScope, focus_visible_d_exports as FocusVisible, grid_navigation_d_exports as GridNavigation, layers_d_exports as Layers, list_navigation_d_exports as ListNavigation, live_announce_d_exports as LiveAnnounce, long_press_d_exports as LongPress, move_d_exports as Move, pointer_drag_d_exports as PointerDrag, press_d_exports as Press, roving_tabindex_d_exports as RovingTabindex, selection_d_exports as Selection, targets_d_exports as Targets, tree_navigation_d_exports as TreeNavigation, typeahead_d_exports as Typeahead };
|
|
862
1017
|
//# sourceMappingURL=index.d.mts.map
|