@typed/ui 1.0.0-beta.1 → 1.0.0-beta.11
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/LICENSE +21 -0
- package/README.md +54 -10
- package/dist/Alert.d.ts +72 -0
- package/dist/Alert.d.ts.map +1 -0
- package/dist/Alert.js +40 -0
- package/dist/Button.d.ts +100 -0
- package/dist/Button.d.ts.map +1 -0
- package/dist/Button.js +42 -0
- package/dist/Carousel.d.ts +346 -0
- package/dist/Carousel.d.ts.map +1 -0
- package/dist/Carousel.js +264 -0
- package/dist/Checkbox.d.ts +168 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/Checkbox.js +146 -0
- package/dist/Collection.d.ts +254 -0
- package/dist/Collection.d.ts.map +1 -0
- package/dist/Collection.js +218 -0
- package/dist/Combobox.d.ts +367 -0
- package/dist/Combobox.d.ts.map +1 -0
- package/dist/Combobox.js +300 -0
- package/dist/Composite.d.ts +823 -0
- package/dist/Composite.d.ts.map +1 -0
- package/dist/Composite.js +615 -0
- package/dist/Dialog.d.ts +544 -0
- package/dist/Dialog.d.ts.map +1 -0
- package/dist/Dialog.js +357 -0
- package/dist/Disclosure.d.ts +219 -0
- package/dist/Disclosure.d.ts.map +1 -0
- package/dist/Disclosure.js +128 -0
- package/dist/Dom/Events.d.ts +122 -0
- package/dist/Dom/Events.d.ts.map +1 -0
- package/dist/Dom/Events.js +192 -0
- package/dist/Dom/Props.d.ts +161 -0
- package/dist/Dom/Props.d.ts.map +1 -0
- package/dist/Dom/Props.js +110 -0
- package/dist/Dom/Refs.d.ts +58 -0
- package/dist/Dom/Refs.d.ts.map +1 -0
- package/dist/Dom/Refs.js +61 -0
- package/dist/Dom/Render.d.ts +59 -0
- package/dist/Dom/Render.d.ts.map +1 -0
- package/dist/Dom/Render.js +71 -0
- package/dist/Dom/Types.d.ts +570 -0
- package/dist/Dom/Types.d.ts.map +1 -0
- package/dist/Dom/Types.js +1 -0
- package/dist/Dom/index.d.ts +20 -0
- package/dist/Dom/index.d.ts.map +1 -0
- package/dist/Dom/index.js +8 -0
- package/dist/Dom.d.ts +14 -0
- package/dist/Dom.d.ts.map +1 -0
- package/dist/Dom.js +13 -0
- package/dist/Focusable.d.ts +85 -0
- package/dist/Focusable.d.ts.map +1 -0
- package/dist/Focusable.js +35 -0
- package/dist/Form.d.ts +1727 -0
- package/dist/Form.d.ts.map +1 -0
- package/dist/Form.js +1142 -0
- package/dist/Grid.d.ts +388 -0
- package/dist/Grid.d.ts.map +1 -0
- package/dist/Grid.js +284 -0
- package/dist/Group.d.ts +128 -0
- package/dist/Group.d.ts.map +1 -0
- package/dist/Group.js +71 -0
- package/dist/Heading.d.ts +87 -0
- package/dist/Heading.d.ts.map +1 -0
- package/dist/Heading.js +58 -0
- package/dist/Hovercard.d.ts +297 -0
- package/dist/Hovercard.d.ts.map +1 -0
- package/dist/Hovercard.js +188 -0
- package/dist/HttpRouter.d.ts +129 -6
- package/dist/HttpRouter.d.ts.map +1 -1
- package/dist/HttpRouter.js +198 -55
- package/dist/Link.d.ts +63 -28
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +84 -37
- package/dist/Listbox.d.ts +305 -0
- package/dist/Listbox.d.ts.map +1 -0
- package/dist/Listbox.js +245 -0
- package/dist/Menu.d.ts +663 -0
- package/dist/Menu.d.ts.map +1 -0
- package/dist/Menu.js +569 -0
- package/dist/Menubar.d.ts +249 -0
- package/dist/Menubar.d.ts.map +1 -0
- package/dist/Menubar.js +207 -0
- package/dist/Meter.d.ts +157 -0
- package/dist/Meter.d.ts.map +1 -0
- package/dist/Meter.js +87 -0
- package/dist/NativeDetails.d.ts +41 -0
- package/dist/NativeDetails.d.ts.map +1 -0
- package/dist/NativeDetails.js +40 -0
- package/dist/NativeDialog.d.ts +66 -0
- package/dist/NativeDialog.d.ts.map +1 -0
- package/dist/NativeDialog.js +88 -0
- package/dist/NativePopover.d.ts +43 -0
- package/dist/NativePopover.d.ts.map +1 -0
- package/dist/NativePopover.js +84 -0
- package/dist/Popover.d.ts +240 -0
- package/dist/Popover.d.ts.map +1 -0
- package/dist/Popover.js +140 -0
- package/dist/RadioGroup.d.ts +330 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RadioGroup.js +241 -0
- package/dist/Role.d.ts +64 -0
- package/dist/Role.d.ts.map +1 -0
- package/dist/Role.js +27 -0
- package/dist/Select.d.ts +418 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/Select.js +357 -0
- package/dist/Separator.d.ts +58 -0
- package/dist/Separator.d.ts.map +1 -0
- package/dist/Separator.js +32 -0
- package/dist/Slider.d.ts +141 -0
- package/dist/Slider.d.ts.map +1 -0
- package/dist/Slider.js +101 -0
- package/dist/SpinButton.d.ts +141 -0
- package/dist/SpinButton.d.ts.map +1 -0
- package/dist/SpinButton.js +101 -0
- package/dist/Storybook.d.ts +76 -0
- package/dist/Storybook.d.ts.map +1 -0
- package/dist/Storybook.js +102 -0
- package/dist/Switch.d.ts +148 -0
- package/dist/Switch.d.ts.map +1 -0
- package/dist/Switch.js +110 -0
- package/dist/Tab.d.ts +26 -0
- package/dist/Tab.d.ts.map +1 -0
- package/dist/Tab.js +25 -0
- package/dist/Tabs.d.ts +411 -0
- package/dist/Tabs.d.ts.map +1 -0
- package/dist/Tabs.js +262 -0
- package/dist/Toolbar.d.ts +248 -0
- package/dist/Toolbar.d.ts.map +1 -0
- package/dist/Toolbar.js +187 -0
- package/dist/Tooltip.d.ts +296 -0
- package/dist/Tooltip.d.ts.map +1 -0
- package/dist/Tooltip.js +172 -0
- package/dist/Tree.d.ts +405 -0
- package/dist/Tree.d.ts.map +1 -0
- package/dist/Tree.js +333 -0
- package/dist/TreeGrid.d.ts +426 -0
- package/dist/TreeGrid.d.ts.map +1 -0
- package/dist/TreeGrid.js +308 -0
- package/dist/VisuallyHidden.d.ts +68 -0
- package/dist/VisuallyHidden.d.ts.map +1 -0
- package/dist/VisuallyHidden.js +44 -0
- package/dist/WindowSplitter.d.ts +336 -0
- package/dist/WindowSplitter.d.ts.map +1 -0
- package/dist/WindowSplitter.js +305 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -0
- package/package.json +48 -20
- package/src/HttpRouter.test.ts +0 -294
- package/src/HttpRouter.ts +0 -168
- package/src/Link.test.ts +0 -84
- package/src/Link.ts +0 -107
- package/src/index.ts +0 -2
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TreeGrid combines tree expansion with virtual-focus grid movement. Rows carry hierarchy and
|
|
3
|
+
* expansion, cells carry column positions, and the root retains focus while aria-activedescendant
|
|
4
|
+
* identifies the active cell.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The module keeps policy, state transitions, and DOM rendering separable so applications can use
|
|
8
|
+
* the state and pure operations without mounting UI, or supply custom hosts without replacing native
|
|
9
|
+
* events and browser-owned focus.
|
|
10
|
+
*
|
|
11
|
+
* Learn the interaction in the [TreeGrid guide](/explore/ui-tree-grid).
|
|
12
|
+
*
|
|
13
|
+
* @since 1.0.0
|
|
14
|
+
* @category modules
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
import * as Effect from "effect/Effect";
|
|
18
|
+
import type * as Scope from "effect/Scope";
|
|
19
|
+
import * as Schema from "effect/Schema";
|
|
20
|
+
import type { Fx } from "@typed/fx/Fx";
|
|
21
|
+
import { RefSubject } from "@typed/fx";
|
|
22
|
+
import { EventHandler, type Renderable, type RenderEvent, type RenderTemplate } from "@typed/template";
|
|
23
|
+
import * as Collection from "./Collection.js";
|
|
24
|
+
import * as Dom from "./Dom.js";
|
|
25
|
+
import * as Grid from "./Grid.js";
|
|
26
|
+
import type { HostResult } from "./Dom/Types.js";
|
|
27
|
+
import * as Tree from "./Tree.js";
|
|
28
|
+
/**
|
|
29
|
+
* Tree expansion state reused for a grid whose active ID names a cell.
|
|
30
|
+
* `expandedIds` names parent rows, while `activeId` names the active cell within a row.
|
|
31
|
+
*
|
|
32
|
+
* @since 1.0.0
|
|
33
|
+
* @category Hierarchy and cell focus
|
|
34
|
+
*/
|
|
35
|
+
export type State = Tree.State;
|
|
36
|
+
/**
|
|
37
|
+
* Initial TreeGrid values. Uses Tree state and defaults.
|
|
38
|
+
*
|
|
39
|
+
* @since 1.0.0
|
|
40
|
+
* @category Hierarchy and cell focus
|
|
41
|
+
*/
|
|
42
|
+
export type InitialState = Tree.InitialState;
|
|
43
|
+
/**
|
|
44
|
+
* Effect Schema used by makeState to encode, decode, and hydrate TreeGrid state.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* import * as Schema from "effect/Schema";
|
|
50
|
+
* import * as TreeGrid from "@typed/ui/TreeGrid";
|
|
51
|
+
*
|
|
52
|
+
* const decodeState = Schema.decodeUnknownEffect(TreeGrid.StateSchema);
|
|
53
|
+
* ```
|
|
54
|
+
* @since 1.0.0
|
|
55
|
+
* @category Hierarchy and cell focus
|
|
56
|
+
*/
|
|
57
|
+
export declare const StateSchema: Schema.Struct<{
|
|
58
|
+
readonly activeId: Schema.NullOr<Schema.String>;
|
|
59
|
+
readonly expandedIds: Schema.$Array<Schema.String>;
|
|
60
|
+
readonly loop: Schema.Boolean;
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Creates hydrated TreeGrid state. Uses Tree state and defaults.
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
66
|
+
* The returned Effect creates the RefSubject when run. That state is renderer-independent;
|
|
67
|
+
* collection registrations belong to the separate Scope that runs register or ref, not to state
|
|
68
|
+
* creation.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* import * as Effect from "effect/Effect";
|
|
73
|
+
* import * as TreeGrid from "@typed/ui/TreeGrid";
|
|
74
|
+
*
|
|
75
|
+
* const program = Effect.scoped(
|
|
76
|
+
* Effect.gen(function* () {
|
|
77
|
+
* const state = yield* TreeGrid.makeState({});
|
|
78
|
+
* const collection = yield* TreeGrid.makeCollection();
|
|
79
|
+
* return { state: yield* state, collection: yield* collection };
|
|
80
|
+
* }),
|
|
81
|
+
* );
|
|
82
|
+
* ```
|
|
83
|
+
* @since 1.0.0
|
|
84
|
+
* @category Hierarchy and cell focus
|
|
85
|
+
*/
|
|
86
|
+
export declare const makeState: typeof Tree.makeState;
|
|
87
|
+
/**
|
|
88
|
+
* Tests membership in expandedIds without touching the DOM; this is the Tree helper exposed from
|
|
89
|
+
* the TreeGrid entrypoint.
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* Separating this deterministic policy from event wiring lets applications test it directly and
|
|
93
|
+
* reuse it in custom composites.
|
|
94
|
+
*
|
|
95
|
+
* This is a synchronous calculation. It acquires no resources and does not mutate the input array,
|
|
96
|
+
* state, event, or DOM.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* import * as TreeGrid from "@typed/ui/TreeGrid";
|
|
101
|
+
*
|
|
102
|
+
* const expanded = TreeGrid.isExpanded({ activeId: null, expandedIds: ["parent"], loop: true }, "parent");
|
|
103
|
+
* ```
|
|
104
|
+
* @since 1.0.0
|
|
105
|
+
* @category Row expansion
|
|
106
|
+
*/
|
|
107
|
+
export declare const isExpanded: typeof Tree.isExpanded;
|
|
108
|
+
/**
|
|
109
|
+
* Adds a row id once to expandedIds using the Tree state transition.
|
|
110
|
+
*
|
|
111
|
+
* @remarks
|
|
112
|
+
* The operation exposes TreeGrid's transition directly so callers can compose it in Effect
|
|
113
|
+
* programs and native event handlers.
|
|
114
|
+
*
|
|
115
|
+
* @since 1.0.0
|
|
116
|
+
* @category Row expansion
|
|
117
|
+
*/
|
|
118
|
+
export declare const expand: typeof Tree.expand;
|
|
119
|
+
/**
|
|
120
|
+
* Removes a row id from expandedIds using the Tree state transition.
|
|
121
|
+
*
|
|
122
|
+
* @remarks
|
|
123
|
+
* The operation exposes TreeGrid's transition directly so callers can compose it in Effect
|
|
124
|
+
* programs and native event handlers.
|
|
125
|
+
*
|
|
126
|
+
* @since 1.0.0
|
|
127
|
+
* @category Row expansion
|
|
128
|
+
*/
|
|
129
|
+
export declare const collapse: typeof Tree.collapse;
|
|
130
|
+
/**
|
|
131
|
+
* Sets the active TreeGrid row or cell id without changing expansion.
|
|
132
|
+
*
|
|
133
|
+
* @remarks
|
|
134
|
+
* The operation exposes TreeGrid's transition directly so callers can compose it in Effect
|
|
135
|
+
* programs and native event handlers.
|
|
136
|
+
*
|
|
137
|
+
* @since 1.0.0
|
|
138
|
+
* @category Hierarchy and cell focus
|
|
139
|
+
*/
|
|
140
|
+
export declare const activate: typeof Tree.activate;
|
|
141
|
+
/**
|
|
142
|
+
* Logical coordinates stored with each registered TreeGrid cell.
|
|
143
|
+
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* The public model lets custom composites reuse TreeGrid's deterministic policy without copying an
|
|
146
|
+
* internal shape.
|
|
147
|
+
*
|
|
148
|
+
* @since 1.0.0
|
|
149
|
+
* @category Cell registration
|
|
150
|
+
*/
|
|
151
|
+
export interface CellPosition extends Grid.CellPosition {
|
|
152
|
+
/**
|
|
153
|
+
* Id whose expansion controls this descendant group.
|
|
154
|
+
* @since 1.0.0
|
|
155
|
+
* @category Hierarchy
|
|
156
|
+
*/
|
|
157
|
+
readonly parentId?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Whether aria-expanded is emitted and hierarchical keys may open descendants.
|
|
160
|
+
* @since 1.0.0
|
|
161
|
+
* @category Hierarchy
|
|
162
|
+
*/
|
|
163
|
+
readonly hasChildren: boolean;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Creates a scoped Collection for TreeGrid items.
|
|
167
|
+
*
|
|
168
|
+
* @remarks
|
|
169
|
+
* The returned Effect allocates the RefSubject in the caller's Scope. Each later registration is
|
|
170
|
+
* owned by the Scope that runs register, independently of this construction Effect.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* import * as Effect from "effect/Effect";
|
|
175
|
+
* import * as TreeGrid from "@typed/ui/TreeGrid";
|
|
176
|
+
*
|
|
177
|
+
* const program = Effect.scoped(
|
|
178
|
+
* Effect.gen(function* () {
|
|
179
|
+
* const collection = yield* TreeGrid.makeCollection();
|
|
180
|
+
* return yield* collection;
|
|
181
|
+
* }),
|
|
182
|
+
* );
|
|
183
|
+
* ```
|
|
184
|
+
* @since 1.0.0
|
|
185
|
+
* @category Cell registration
|
|
186
|
+
*/
|
|
187
|
+
export declare const makeCollection: (initial?: Collection.State<CellPosition, Element>) => Effect.Effect<RefSubject.RefSubject<Collection.State<CellPosition, Element>, never, never>, never, Scope.Scope>;
|
|
188
|
+
/**
|
|
189
|
+
* Inputs accepted by TreeGrid.Root in addition to the shared DOM host options.
|
|
190
|
+
*
|
|
191
|
+
* @since 1.0.0
|
|
192
|
+
* @category Treegrid surface
|
|
193
|
+
*/
|
|
194
|
+
export interface RootOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
195
|
+
/**
|
|
196
|
+
* Renderer-independent RefSubject state consumed by this component or operation.
|
|
197
|
+
* @since 1.0.0
|
|
198
|
+
* @category State connection
|
|
199
|
+
*/
|
|
200
|
+
readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
|
|
201
|
+
/**
|
|
202
|
+
* Item registry used for collection-driven keyboard behavior and mounted ordering.
|
|
203
|
+
* @since 1.0.0
|
|
204
|
+
* @category Item registration
|
|
205
|
+
*/
|
|
206
|
+
readonly collection?: RefSubject.RefSubject<Collection.State<CellPosition>>;
|
|
207
|
+
/**
|
|
208
|
+
* Accessible label rendered through aria-label.
|
|
209
|
+
* @since 1.0.0
|
|
210
|
+
* @category Accessible naming
|
|
211
|
+
*/
|
|
212
|
+
readonly label: Renderable.Any<string | null | undefined>;
|
|
213
|
+
/**
|
|
214
|
+
* Renderable child content for the component host.
|
|
215
|
+
* @since 1.0.0
|
|
216
|
+
* @category Rendered content
|
|
217
|
+
*/
|
|
218
|
+
readonly content: Renderable.Any;
|
|
219
|
+
}
|
|
220
|
+
declare function rootInternalProps<const Options extends RootOptions>(options: Options): ({ property }: Dom.InternalPropsHelpers<Options>) => {
|
|
221
|
+
readonly role: "treegrid";
|
|
222
|
+
readonly tabindex: 0;
|
|
223
|
+
readonly "aria-label": Exclude<Dom.Property<Options, "label">, Dom.Nullish> | undefined;
|
|
224
|
+
readonly "aria-activedescendant": RefSubject.Computed<string | undefined, Schema.SchemaError, never>;
|
|
225
|
+
readonly onfocus: Effect.Effect<void, Schema.SchemaError, never> | undefined;
|
|
226
|
+
readonly onkeydown: EventHandler.EventHandler<KeyboardEvent, Schema.SchemaError, never> | undefined;
|
|
227
|
+
readonly ref: RefSubject.HydratedRefSubject<Tree.State, Schema.SchemaError, never, never>;
|
|
228
|
+
};
|
|
229
|
+
type RootInternalProps<Options extends RootOptions> = ReturnType<ReturnType<typeof rootInternalProps<Options>>>;
|
|
230
|
+
/**
|
|
231
|
+
* Renders the focus-owning treegrid root and applies combined grid and expansion keys.
|
|
232
|
+
*
|
|
233
|
+
* @remarks
|
|
234
|
+
* The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
|
|
235
|
+
* collection registrations only when rendered. The rendering Scope removes those resources;
|
|
236
|
+
* unrelated nodes and attributes remain caller-owned.
|
|
237
|
+
*
|
|
238
|
+
* @since 1.0.0
|
|
239
|
+
* @category Treegrid surface
|
|
240
|
+
*/
|
|
241
|
+
export declare function Root<const Options extends RootOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, RootInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
|
|
242
|
+
/**
|
|
243
|
+
* Inputs accepted by TreeGrid.Row in addition to the shared DOM host options.
|
|
244
|
+
*
|
|
245
|
+
* @since 1.0.0
|
|
246
|
+
* @category Hierarchical rows
|
|
247
|
+
*/
|
|
248
|
+
export interface RowOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
249
|
+
/**
|
|
250
|
+
* Renderer-independent RefSubject state consumed by this component or operation.
|
|
251
|
+
* @since 1.0.0
|
|
252
|
+
* @category State connection
|
|
253
|
+
*/
|
|
254
|
+
readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
|
|
255
|
+
/**
|
|
256
|
+
* Stable logical row identity used by vertical grid movement.
|
|
257
|
+
* @since 1.0.0
|
|
258
|
+
* @category Row identity
|
|
259
|
+
*/
|
|
260
|
+
readonly rowId: string;
|
|
261
|
+
/**
|
|
262
|
+
* Id whose expansion controls this descendant group.
|
|
263
|
+
* @since 1.0.0
|
|
264
|
+
* @category Hierarchy
|
|
265
|
+
*/
|
|
266
|
+
readonly parentId?: string;
|
|
267
|
+
/**
|
|
268
|
+
* One-based hierarchy level exposed through aria-level.
|
|
269
|
+
* @since 1.0.0
|
|
270
|
+
* @category Hierarchy
|
|
271
|
+
*/
|
|
272
|
+
readonly level?: number;
|
|
273
|
+
/**
|
|
274
|
+
* Whether aria-expanded is emitted and hierarchical keys may open descendants.
|
|
275
|
+
* @since 1.0.0
|
|
276
|
+
* @category Hierarchy
|
|
277
|
+
*/
|
|
278
|
+
readonly hasChildren?: boolean;
|
|
279
|
+
/**
|
|
280
|
+
* Renderable child content for the component host.
|
|
281
|
+
* @since 1.0.0
|
|
282
|
+
* @category Rendered content
|
|
283
|
+
*/
|
|
284
|
+
readonly content: Renderable.Any;
|
|
285
|
+
}
|
|
286
|
+
declare function rowInternalProps<const Options extends RowOptions>(options: Options): ({ property }: Dom.InternalPropsHelpers<Options>) => {
|
|
287
|
+
readonly id: string;
|
|
288
|
+
readonly role: "row";
|
|
289
|
+
readonly "aria-level": 1 | Exclude<Dom.Property<Options, "level">, Dom.Nullish>;
|
|
290
|
+
readonly "aria-expanded": RefSubject.Computed<boolean, Schema.SchemaError, never> | undefined;
|
|
291
|
+
};
|
|
292
|
+
type RowInternalProps<Options extends RowOptions> = ReturnType<ReturnType<typeof rowInternalProps<Options>>>;
|
|
293
|
+
/**
|
|
294
|
+
* Renders a hierarchical row with level and optional expanded state.
|
|
295
|
+
*
|
|
296
|
+
* @remarks
|
|
297
|
+
* The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
|
|
298
|
+
* collection registrations only when rendered. The rendering Scope removes those resources;
|
|
299
|
+
* unrelated nodes and attributes remain caller-owned.
|
|
300
|
+
*
|
|
301
|
+
* @since 1.0.0
|
|
302
|
+
* @category Hierarchical rows
|
|
303
|
+
*/
|
|
304
|
+
export declare function Row<const Options extends RowOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, RowInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
|
|
305
|
+
/**
|
|
306
|
+
* Inputs accepted by TreeGrid.Cell in addition to the shared DOM host options.
|
|
307
|
+
*
|
|
308
|
+
* @since 1.0.0
|
|
309
|
+
* @category Navigable cells
|
|
310
|
+
*/
|
|
311
|
+
export interface CellOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
312
|
+
/**
|
|
313
|
+
* Renderer-independent RefSubject state consumed by this component or operation.
|
|
314
|
+
* @since 1.0.0
|
|
315
|
+
* @category State connection
|
|
316
|
+
*/
|
|
317
|
+
readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
|
|
318
|
+
/**
|
|
319
|
+
* Item registry used for collection-driven keyboard behavior and mounted ordering.
|
|
320
|
+
* @since 1.0.0
|
|
321
|
+
* @category Item registration
|
|
322
|
+
*/
|
|
323
|
+
readonly collection?: RefSubject.RefSubject<Collection.State<CellPosition>>;
|
|
324
|
+
/**
|
|
325
|
+
* Stable id used for collection identity and ARIA relationships.
|
|
326
|
+
* @since 1.0.0
|
|
327
|
+
* @category Identity and relationships
|
|
328
|
+
*/
|
|
329
|
+
readonly id: string;
|
|
330
|
+
/**
|
|
331
|
+
* Stable logical row identity used by vertical grid movement.
|
|
332
|
+
* @since 1.0.0
|
|
333
|
+
* @category Row identity
|
|
334
|
+
*/
|
|
335
|
+
readonly rowId: string;
|
|
336
|
+
/**
|
|
337
|
+
* Caller-supplied column index used for movement and emitted unchanged as aria-colindex; ARIA
|
|
338
|
+
* indexes are one-based.
|
|
339
|
+
* @since 1.0.0
|
|
340
|
+
* @category Cell position
|
|
341
|
+
*/
|
|
342
|
+
readonly columnIndex: number;
|
|
343
|
+
/**
|
|
344
|
+
* Id whose expansion controls this descendant group.
|
|
345
|
+
* @since 1.0.0
|
|
346
|
+
* @category Hierarchy
|
|
347
|
+
*/
|
|
348
|
+
readonly parentId?: string;
|
|
349
|
+
/**
|
|
350
|
+
* Whether aria-expanded is emitted and hierarchical keys may open descendants.
|
|
351
|
+
* @since 1.0.0
|
|
352
|
+
* @category Hierarchy
|
|
353
|
+
*/
|
|
354
|
+
readonly hasChildren?: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Renderable child content for the component host.
|
|
357
|
+
* @since 1.0.0
|
|
358
|
+
* @category Rendered content
|
|
359
|
+
*/
|
|
360
|
+
readonly content: Renderable.Any;
|
|
361
|
+
}
|
|
362
|
+
declare function cellInternalProps<const Options extends CellOptions>(options: Options): () => {
|
|
363
|
+
readonly id: string;
|
|
364
|
+
readonly role: "gridcell";
|
|
365
|
+
readonly "aria-colindex": number;
|
|
366
|
+
readonly "?data-active": RefSubject.Computed<boolean, Schema.SchemaError, never>;
|
|
367
|
+
readonly ref: ((element: Element) => Effect.Effect<void, never, Scope.Scope>) | undefined;
|
|
368
|
+
};
|
|
369
|
+
type CellInternalProps<Options extends CellOptions> = ReturnType<ReturnType<typeof cellInternalProps<Options>>>;
|
|
370
|
+
/**
|
|
371
|
+
* Renders and optionally registers one gridcell with row and column coordinates.
|
|
372
|
+
*
|
|
373
|
+
* @remarks
|
|
374
|
+
* The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
|
|
375
|
+
* collection registrations only when rendered. The rendering Scope removes those resources;
|
|
376
|
+
* unrelated nodes and attributes remain caller-owned.
|
|
377
|
+
*
|
|
378
|
+
* @since 1.0.0
|
|
379
|
+
* @category Navigable cells
|
|
380
|
+
*/
|
|
381
|
+
export declare function Cell<const Options extends CellOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, CellInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
|
|
382
|
+
/**
|
|
383
|
+
* Inputs accepted by TreeGrid.Group in addition to the shared DOM host options.
|
|
384
|
+
*
|
|
385
|
+
* @since 1.0.0
|
|
386
|
+
* @category Child row visibility
|
|
387
|
+
*/
|
|
388
|
+
export interface GroupOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
389
|
+
/**
|
|
390
|
+
* Renderer-independent RefSubject state consumed by this component or operation.
|
|
391
|
+
* @since 1.0.0
|
|
392
|
+
* @category State connection
|
|
393
|
+
*/
|
|
394
|
+
readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
|
|
395
|
+
/**
|
|
396
|
+
* Id whose expansion controls this descendant group.
|
|
397
|
+
* @since 1.0.0
|
|
398
|
+
* @category Hierarchy
|
|
399
|
+
*/
|
|
400
|
+
readonly parentId: string;
|
|
401
|
+
/**
|
|
402
|
+
* Renderable child content for the component host.
|
|
403
|
+
* @since 1.0.0
|
|
404
|
+
* @category Rendered content
|
|
405
|
+
*/
|
|
406
|
+
readonly content: Renderable.Any;
|
|
407
|
+
}
|
|
408
|
+
declare function groupInternalProps<const Options extends GroupOptions>(options: Options): () => {
|
|
409
|
+
readonly role: "rowgroup";
|
|
410
|
+
readonly "?hidden": RefSubject.Computed<boolean, Schema.SchemaError, never>;
|
|
411
|
+
};
|
|
412
|
+
type GroupInternalProps<Options extends GroupOptions> = ReturnType<ReturnType<typeof groupInternalProps<Options>>>;
|
|
413
|
+
/**
|
|
414
|
+
* Renders a rowgroup and hides it while its parent row is collapsed.
|
|
415
|
+
*
|
|
416
|
+
* @remarks
|
|
417
|
+
* The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
|
|
418
|
+
* collection registrations only when rendered. The rendering Scope removes those resources;
|
|
419
|
+
* unrelated nodes and attributes remain caller-owned.
|
|
420
|
+
*
|
|
421
|
+
* @since 1.0.0
|
|
422
|
+
* @category Child row visibility
|
|
423
|
+
*/
|
|
424
|
+
export declare function Group<const Options extends GroupOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, GroupInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
|
|
425
|
+
export {};
|
|
426
|
+
//# sourceMappingURL=TreeGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeGrid.d.ts","sourceRoot":"","sources":["../src/TreeGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,YAAY,EAEZ,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,K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