@zeyos/zx 5.0.0 → 5.3.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/CHANGELOG.md +198 -0
- package/README.md +2 -1
- package/dist/types/components/account-menu/account-menu.d.ts +8 -0
- package/dist/types/components/activity-list/activity-list.d.ts +9 -1
- package/dist/types/components/app-icon/app-icon.d.ts +14 -2
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +288 -14
- package/dist/types/components/calendar/calendar.d.ts +67 -5
- package/dist/types/components/card-view/card-view.d.ts +243 -4
- package/dist/types/components/card-view/record-card.d.ts +11 -0
- package/dist/types/components/context-menu/context-menu.d.ts +6 -2
- package/dist/types/components/data-filter/data-filter.d.ts +4 -4
- package/dist/types/components/dropdown/dropdown.d.ts +22 -7
- package/dist/types/components/field/field.d.ts +30 -0
- package/dist/types/components/fieldset/external-adapter.d.ts +83 -0
- package/dist/types/components/fieldset/fieldset.d.ts +7 -0
- package/dist/types/components/file-list/file-list.d.ts +35 -3
- package/dist/types/components/filter/filter.d.ts +127 -3
- package/dist/types/components/filter-panel/filter-panel.d.ts +36 -7
- package/dist/types/components/launcher/launcher.d.ts +8 -0
- package/dist/types/components/list-toolbar/list-toolbar.d.ts +15 -6
- package/dist/types/components/menu-button/menu-button.d.ts +6 -0
- package/dist/types/components/message/message.d.ts +14 -1
- package/dist/types/components/modal/modal.d.ts +30 -0
- package/dist/types/components/module-bar/module-bar.d.ts +395 -0
- package/dist/types/components/pagination/pagination.d.ts +17 -3
- package/dist/types/components/select/select.d.ts +6 -0
- package/dist/types/components/sheet/sheet.d.ts +15 -0
- package/dist/types/components/table/table.d.ts +265 -17
- package/dist/types/components/view/record-view.d.ts +59 -2
- package/dist/types/components/view-settings/view-settings.d.ts +879 -0
- package/dist/types/components/workspace-switcher/workspace-switcher.d.ts +327 -0
- package/dist/types/core/component.d.ts +12 -2
- package/dist/types/core/i18n.d.ts +27 -3
- package/dist/types/core/keyboard.d.ts +98 -1
- package/dist/types/core/messages.d.ts +382 -0
- package/dist/types/core/overlay-host.d.ts +28 -1
- package/dist/types/core/overlay-stack.d.ts +260 -0
- package/dist/types/index.d.ts +5 -2
- package/dist/types/internal/app-rail.d.ts +38 -0
- package/dist/types/internal/menu-items.d.ts +71 -3
- package/dist/types/zeyos/index.d.ts +1 -0
- package/dist/types/zeyos/launcher.d.ts +9 -0
- package/dist/types/zeyos/module-bar.d.ts +176 -0
- package/dist/types/zeyos/query.d.ts +31 -5
- package/dist/types/zeyos/table.d.ts +245 -8
- package/dist/types/zeyos/view.d.ts +16 -2
- package/dist/zx-zeyos.esm.js +4422 -430
- package/dist/zx-zeyos.esm.min.js +5 -5
- package/dist/zx.css +1472 -133
- package/dist/zx.esm.js +7433 -854
- package/dist/zx.esm.min.js +8 -8
- package/dist/zx.global.js +7433 -854
- package/dist/zx.global.min.js +8 -8
- package/dist/zx.min.css +1 -1
- package/docs/api.json +937 -119
- package/docs/llms.md +531 -63
- package/docs/llms.txt +6 -2
- package/package.json +1 -1
- package/src/components/account-menu/account-menu.js +12 -0
- package/src/components/activity-list/activity-list.js +27 -1
- package/src/components/app-icon/app-icon.css +13 -2
- package/src/components/app-icon/app-icon.js +11 -1
- package/src/components/app-rail/app-rail.css +19 -0
- package/src/components/app-sidebar/app-sidebar.css +204 -3
- package/src/components/app-sidebar/app-sidebar.js +646 -40
- package/src/components/breadcrumb/breadcrumb.css +1 -1
- package/src/components/calendar/calendar.css +1 -1
- package/src/components/calendar/calendar.js +26 -52
- package/src/components/card/card.css +2 -2
- package/src/components/card-view/card-view.css +76 -5
- package/src/components/card-view/card-view.js +514 -20
- package/src/components/card-view/record-card.js +14 -3
- package/src/components/code-editor/code-editor.css +1 -1
- package/src/components/code-editor/field-adapter.js +9 -2
- package/src/components/context-menu/context-menu.js +8 -2
- package/src/components/copy/copy-input.css +1 -1
- package/src/components/data-filter/data-filter.js +2 -2
- package/src/components/date-picker/time-picker.css +2 -2
- package/src/components/dock/dock.css +5 -4
- package/src/components/dropdown/dropdown.js +157 -72
- package/src/components/field/field.js +33 -3
- package/src/components/fieldset/external-adapter.js +363 -0
- package/src/components/fieldset/fieldset.js +10 -59
- package/src/components/file-list/file-list.js +144 -21
- package/src/components/filter/filter.css +86 -2
- package/src/components/filter/filter.js +300 -8
- package/src/components/filter-panel/filter-panel.js +149 -32
- package/src/components/finder/finder.css +1 -1
- package/src/components/kanban-view/kanban-view.css +3 -3
- package/src/components/kanban-view/kanban-view.js +5 -2
- package/src/components/launcher/launcher.css +1 -1
- package/src/components/launcher/launcher.js +29 -3
- package/src/components/list-toolbar/list-toolbar.js +39 -13
- package/src/components/master-panel/master-panel.js +0 -1
- package/src/components/menu-button/menu-button.css +63 -0
- package/src/components/menu-button/menu-button.js +97 -11
- package/src/components/message/message.js +60 -20
- package/src/components/modal/modal.css +1 -1
- package/src/components/modal/modal.js +66 -13
- package/src/components/module-bar/module-bar.css +486 -0
- package/src/components/module-bar/module-bar.js +1074 -0
- package/src/components/multi-value-editor/multi-value-editor.css +1 -1
- package/src/components/number-field/field-adapter.js +2 -1
- package/src/components/pagination/pagination.css +5 -5
- package/src/components/pagination/pagination.js +20 -4
- package/src/components/panel/panel.css +3 -2
- package/src/components/questionnaire/questionnaire.css +4 -4
- package/src/components/rating/field-adapter.js +2 -1
- package/src/components/rating/rating.css +1 -1
- package/src/components/search/search.css +6 -1
- package/src/components/select/select.js +9 -0
- package/src/components/sheet/sheet.css +1 -1
- package/src/components/sheet/sheet.js +74 -32
- package/src/components/slider/field-adapter.js +6 -1
- package/src/components/slider/slider.css +2 -2
- package/src/components/split-view/split-view.css +1 -1
- package/src/components/stat-tile/stat-tile.css +1 -1
- package/src/components/stepper/stepper.css +1 -1
- package/src/components/tabbox/tabbox.css +9 -5
- package/src/components/table/table.css +86 -11
- package/src/components/table/table.js +628 -57
- package/src/components/tag-picker/field-adapter.js +2 -1
- package/src/components/tooltip/tooltip.js +35 -17
- package/src/components/tree/tree.css +1 -1
- package/src/components/view/record-view.css +1 -1
- package/src/components/view/record-view.js +178 -18
- package/src/components/view-settings/view-settings.css +285 -0
- package/src/components/view-settings/view-settings.js +1830 -0
- package/src/components/workspace-switcher/workspace-switcher.css +188 -0
- package/src/components/workspace-switcher/workspace-switcher.js +463 -0
- package/src/core/component.js +88 -17
- package/src/core/fontawesome.js +5 -1
- package/src/core/i18n.js +47 -4
- package/src/core/icons.js +12 -2
- package/src/core/keyboard.js +206 -11
- package/src/core/messages.js +427 -0
- package/src/core/overlay-host.js +64 -9
- package/src/core/overlay-stack.js +487 -0
- package/src/core/position.js +22 -3
- package/src/index.js +5 -2
- package/src/internal/app-rail.js +134 -53
- package/src/internal/menu-items.js +61 -3
- package/src/zeyos/form.js +5 -3
- package/src/zeyos/index.js +3 -0
- package/src/zeyos/launcher.js +8 -3
- package/src/zeyos/module-bar.js +181 -0
- package/src/zeyos/query.js +44 -13
- package/src/zeyos/table.js +220 -80
- package/src/zeyos/view.js +43 -93
- package/styles/base.css +16 -1
- package/styles/print.css +1 -1
- package/styles/tokens/dark.css +4 -0
- package/styles/tokens/semantic.css +56 -28
- package/styles/zx.css +3 -0
|
@@ -109,10 +109,64 @@ export type CardViewOptions = {
|
|
|
109
109
|
*/
|
|
110
110
|
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
111
111
|
/**
|
|
112
|
-
* Accessible collection label
|
|
112
|
+
* Accessible collection label; null resolves message
|
|
113
|
+
* `cardView.label`, "Card view".
|
|
113
114
|
*/
|
|
114
|
-
label?: string;
|
|
115
|
+
label?: string | null;
|
|
116
|
+
/**
|
|
117
|
+
* Keyboard model. `'tabs'` makes every card, title
|
|
118
|
+
* link, checkbox, and action its own Tab stop. `'roving'` — recommended for lists — follows the
|
|
119
|
+
* APG Grid pattern with row focus: the collection is one Tab stop, the arrow keys, Home/End, and
|
|
120
|
+
* PageUp/PageDown move between cards, Enter activates, Space selects, and the controls inside a
|
|
121
|
+
* card stay pointer targets with `tabindex="-1"`.
|
|
122
|
+
*/
|
|
123
|
+
keyboard?: 'tabs' | 'roving';
|
|
124
|
+
/**
|
|
125
|
+
* Whether group headings carry a toggle that hides
|
|
126
|
+
* and shows the group's cards.
|
|
127
|
+
*/
|
|
128
|
+
collapsibleGroups?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Group ids that start collapsed.
|
|
131
|
+
*/
|
|
132
|
+
collapsedGroups?: unknown[];
|
|
133
|
+
/**
|
|
134
|
+
* Content of a group heading in place of its label. With `collapsibleGroups` it is placed inside
|
|
135
|
+
* the toggle button, so it must not contain interactive elements.
|
|
136
|
+
*/
|
|
137
|
+
renderGroupHeading?: ((context: CardGroupHeadingContext) => Node | string | null | undefined) | null;
|
|
115
138
|
onrecordaction?: (event: CustomEvent<Record<string, unknown>>) => void;
|
|
139
|
+
ongroupcollapse?: (event: CustomEvent<{
|
|
140
|
+
id: string;
|
|
141
|
+
collapsed: boolean;
|
|
142
|
+
collapsedGroups: string[];
|
|
143
|
+
}>) => void;
|
|
144
|
+
};
|
|
145
|
+
export type CardGroupHeadingContext = {
|
|
146
|
+
/**
|
|
147
|
+
* Normalized group id (`''` for records without a value).
|
|
148
|
+
*/
|
|
149
|
+
id: string;
|
|
150
|
+
/**
|
|
151
|
+
* Default label.
|
|
152
|
+
*/
|
|
153
|
+
label: string;
|
|
154
|
+
/**
|
|
155
|
+
* Records in the group.
|
|
156
|
+
*/
|
|
157
|
+
count: number;
|
|
158
|
+
/**
|
|
159
|
+
* The group's records in display order.
|
|
160
|
+
*/
|
|
161
|
+
records: ViewRecord[];
|
|
162
|
+
/**
|
|
163
|
+
* Whether the group is collapsed.
|
|
164
|
+
*/
|
|
165
|
+
collapsed: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Collapses or expands the group.
|
|
168
|
+
*/
|
|
169
|
+
toggle: () => void;
|
|
116
170
|
};
|
|
117
171
|
export type CardViewState = {
|
|
118
172
|
/**
|
|
@@ -147,6 +201,10 @@ export type CardViewState = {
|
|
|
147
201
|
* Surface treatment.
|
|
148
202
|
*/
|
|
149
203
|
variant: 'outlined' | 'raised' | 'filled';
|
|
204
|
+
/**
|
|
205
|
+
* Collapsed group ids.
|
|
206
|
+
*/
|
|
207
|
+
collapsedGroups: string[];
|
|
150
208
|
};
|
|
151
209
|
export type CardRecordGroup = {
|
|
152
210
|
/**
|
|
@@ -203,8 +261,31 @@ export type CardRecordGroup = {
|
|
|
203
261
|
* @property {'outlined'|'raised'|'filled'} [variant='outlined'] Card surface treatment.
|
|
204
262
|
* @property {number} [loadingCount=6] Skeleton cards shown while loading.
|
|
205
263
|
* @property {1|2|3|4|5|6} [headingLevel=3] Per-card title heading level.
|
|
206
|
-
* @property {string} [label=
|
|
264
|
+
* @property {string|null} [label=null] Accessible collection label; null resolves message
|
|
265
|
+
* `cardView.label`, "Card view".
|
|
266
|
+
* @property {'tabs'|'roving'} [keyboard='tabs'] Keyboard model. `'tabs'` makes every card, title
|
|
267
|
+
* link, checkbox, and action its own Tab stop. `'roving'` — recommended for lists — follows the
|
|
268
|
+
* APG Grid pattern with row focus: the collection is one Tab stop, the arrow keys, Home/End, and
|
|
269
|
+
* PageUp/PageDown move between cards, Enter activates, Space selects, and the controls inside a
|
|
270
|
+
* card stay pointer targets with `tabindex="-1"`.
|
|
271
|
+
* @property {boolean} [collapsibleGroups=false] Whether group headings carry a toggle that hides
|
|
272
|
+
* and shows the group's cards.
|
|
273
|
+
* @property {unknown[]} [collapsedGroups=[]] Group ids that start collapsed.
|
|
274
|
+
* @property {((context:CardGroupHeadingContext)=>Node|string|null|undefined)|null} [renderGroupHeading=null]
|
|
275
|
+
* Content of a group heading in place of its label. With `collapsibleGroups` it is placed inside
|
|
276
|
+
* the toggle button, so it must not contain interactive elements.
|
|
207
277
|
* @property {(event:CustomEvent<Record<string,unknown>>)=>void} [onrecordaction]
|
|
278
|
+
* @property {(event:CustomEvent<{id:string,collapsed:boolean,collapsedGroups:string[]}>)=>void} [ongroupcollapse]
|
|
279
|
+
*/
|
|
280
|
+
/**
|
|
281
|
+
* What `renderGroupHeading` is given for one group.
|
|
282
|
+
* @typedef {Object} CardGroupHeadingContext
|
|
283
|
+
* @property {string} id Normalized group id (`''` for records without a value).
|
|
284
|
+
* @property {string} label Default label.
|
|
285
|
+
* @property {number} count Records in the group.
|
|
286
|
+
* @property {ViewRecord[]} records The group's records in display order.
|
|
287
|
+
* @property {boolean} collapsed Whether the group is collapsed.
|
|
288
|
+
* @property {() => void} toggle Collapses or expands the group.
|
|
208
289
|
*/
|
|
209
290
|
/**
|
|
210
291
|
* @typedef {Object} CardViewState
|
|
@@ -216,6 +297,7 @@ export type CardRecordGroup = {
|
|
|
216
297
|
* @property {string} minCardWidth Responsive minimum card width.
|
|
217
298
|
* @property {number|null} maxColumns Maximum cards per row.
|
|
218
299
|
* @property {'outlined'|'raised'|'filled'} variant Surface treatment.
|
|
300
|
+
* @property {string[]} collapsedGroups Collapsed group ids.
|
|
219
301
|
*/
|
|
220
302
|
/**
|
|
221
303
|
* @typedef {Object} CardRecordGroup
|
|
@@ -226,7 +308,20 @@ export type CardRecordGroup = {
|
|
|
226
308
|
/**
|
|
227
309
|
* Responsive, schema-friendly record cards with shared fields, sorting, selection, state, groups,
|
|
228
310
|
* safe preview media, native title links, and delegated actions.
|
|
311
|
+
*
|
|
312
|
+
* With `keyboard: 'roving'` the collection follows the WAI-ARIA APG Grid pattern with row focus,
|
|
313
|
+
* the model `Table` uses: the content is a `grid`, each card a focusable `row` (`aria-selected`
|
|
314
|
+
* when selectable, `aria-multiselectable` on the grid for `multi`), and the collection is a single
|
|
315
|
+
* Tab stop. ArrowUp/ArrowDown move to the card above or below — columns are measured from where the
|
|
316
|
+
* cards actually are, so a multi-column layout moves by visual row — ArrowLeft/ArrowRight within a
|
|
317
|
+
* row, Home/End to the first or last card, PageUp/PageDown by a visible page. Enter activates
|
|
318
|
+
* (`recordclick`), Space toggles selection in `selectable` modes (and activates otherwise),
|
|
319
|
+
* Shift+movement extends a `multi` selection, and Ctrl/Cmd+A selects every rendered card. A
|
|
320
|
+
* collapsible group heading is part of the same order: Enter or Space toggles it, ArrowLeft
|
|
321
|
+
* collapses, ArrowRight expands. The current card is kept by record id across `setData`, sorting,
|
|
322
|
+
* grouping, and collapsing, and focus is restored without scrolling.
|
|
229
323
|
* @fires CardView#recordaction
|
|
324
|
+
* @fires CardView#groupcollapse
|
|
230
325
|
* @extends {RecordView}
|
|
231
326
|
*/
|
|
232
327
|
export declare class CardView extends RecordView {
|
|
@@ -240,6 +335,28 @@ export declare class CardView extends RecordView {
|
|
|
240
335
|
_cardVariant: "filled" | "outlined" | "raised";
|
|
241
336
|
_cardLoadingCount: number;
|
|
242
337
|
_cardHeadingLevel: 1 | 2 | 3 | 4 | 5 | 6;
|
|
338
|
+
_cardRoving: boolean;
|
|
339
|
+
_cardIdPrefix: string;
|
|
340
|
+
_cardCollapsed: Set<string>;
|
|
341
|
+
/** @type {{kind:'card'|'group', id:unknown}|null} */
|
|
342
|
+
_cardCurrent: {
|
|
343
|
+
kind: 'card' | 'group';
|
|
344
|
+
id: unknown;
|
|
345
|
+
} | null;
|
|
346
|
+
_cardCurrentIndex: number;
|
|
347
|
+
/** @type {HTMLElement|null} */
|
|
348
|
+
_cardTabStop: HTMLElement | null;
|
|
349
|
+
/** @type {number|null} */
|
|
350
|
+
_cardStickyX: number | null;
|
|
351
|
+
_cardMoving: boolean;
|
|
352
|
+
/** @type {Map<string, HTMLElement>} */
|
|
353
|
+
_cardHeadersById: Map<string, HTMLElement>;
|
|
354
|
+
/** @type {Map<unknown, string>} */
|
|
355
|
+
_cardGroupOfId: Map<unknown, string>;
|
|
356
|
+
/** @type {Map<Element, string>} */
|
|
357
|
+
_cardSectionIds: Map<Element, string>;
|
|
358
|
+
/** @type {WeakMap<Element, unknown>} */
|
|
359
|
+
_cardIdOfNode: WeakMap<Element, unknown>;
|
|
243
360
|
static cssName: string;
|
|
244
361
|
/** @type {Readonly<CardViewOptions & RecordViewOptions>} */
|
|
245
362
|
static defaults: Readonly<CardViewOptions & RecordViewOptions>;
|
|
@@ -262,6 +379,19 @@ export declare class CardView extends RecordView {
|
|
|
262
379
|
setViewState(state: Partial<CardViewState> | null, options?: {
|
|
263
380
|
silent?: boolean;
|
|
264
381
|
}): this;
|
|
382
|
+
/**
|
|
383
|
+
* Collapses or expands one group. A collapsed group keeps its heading and hides its cards.
|
|
384
|
+
* @param {unknown} id Group id, as `groupBy` produces it.
|
|
385
|
+
* @param {boolean} [collapsed=true] Next state.
|
|
386
|
+
* @param {{silent?:boolean}} [options={}] Set `silent` to suppress `groupcollapse` and `statechange`.
|
|
387
|
+
* @returns {this}
|
|
388
|
+
* @fires CardView#groupcollapse
|
|
389
|
+
*/
|
|
390
|
+
setGroupCollapsed(id: unknown, collapsed?: boolean, options?: {
|
|
391
|
+
silent?: boolean;
|
|
392
|
+
}): this;
|
|
393
|
+
/** Returns the collapsed group ids. @returns {string[]} */
|
|
394
|
+
getCollapsedGroups(): string[];
|
|
265
395
|
/** Restores an enhanced target exactly, or removes an owned root. @returns {void} */
|
|
266
396
|
destroy(): void;
|
|
267
397
|
/** @protected @param {string} reason Refresh reason. @returns {void} */
|
|
@@ -276,6 +406,67 @@ export declare class CardView extends RecordView {
|
|
|
276
406
|
private _renderCards;
|
|
277
407
|
/** @private @param {CardRecordGroup} group @param {ViewField[]} fields @param {ViewField[]} visibleFields @param {number} groupIndex @returns {HTMLElement} */
|
|
278
408
|
private _createCardGroup;
|
|
409
|
+
/**
|
|
410
|
+
* Builds a group heading: the label (or `renderGroupHeading` content), inside an APG
|
|
411
|
+
* disclosure button when the group can collapse.
|
|
412
|
+
* @private
|
|
413
|
+
* @param {CardRecordGroup} group Group.
|
|
414
|
+
* @param {string} headingId Heading id.
|
|
415
|
+
* @param {boolean} collapsible Whether the group can collapse.
|
|
416
|
+
* @param {boolean} collapsed Whether it is collapsed.
|
|
417
|
+
* @returns {HTMLElement}
|
|
418
|
+
*/
|
|
419
|
+
private _createGroupHeader;
|
|
420
|
+
/**
|
|
421
|
+
* Turns a rendered card into a grid row for the roving model: row focus, `aria-selected` when
|
|
422
|
+
* selectable, and the controls inside it out of the Tab order.
|
|
423
|
+
* @private
|
|
424
|
+
* @param {HTMLElement} card Card element.
|
|
425
|
+
* @param {unknown} id Record id.
|
|
426
|
+
* @returns {void}
|
|
427
|
+
*/
|
|
428
|
+
private _makeCardRow;
|
|
429
|
+
/**
|
|
430
|
+
* Moves the single Tab stop to the current item after a render — the same record or group by
|
|
431
|
+
* id; else the heading of the collapsed group that now hides the card; else the item now at its
|
|
432
|
+
* old position — and focuses it again, without scrolling, when the collection had focus.
|
|
433
|
+
* @private
|
|
434
|
+
* @param {boolean} hadFocus Whether focus was inside the collection before the render.
|
|
435
|
+
* @returns {void}
|
|
436
|
+
*/
|
|
437
|
+
private _syncCardRoving;
|
|
438
|
+
/**
|
|
439
|
+
* @private
|
|
440
|
+
* @param {HTMLElement} item New Tab stop.
|
|
441
|
+
* @param {HTMLElement[]} [items] Every item, when already collected.
|
|
442
|
+
* @returns {void}
|
|
443
|
+
*/
|
|
444
|
+
private _setCardTabStop;
|
|
445
|
+
/**
|
|
446
|
+
* While loading or empty there is no card to hold focus: the content takes it rather than
|
|
447
|
+
* letting it fall to the document, and gives the Tab order its old shape back afterwards.
|
|
448
|
+
* @private
|
|
449
|
+
* @param {boolean} hold Whether focus was inside and there is nothing to put it on.
|
|
450
|
+
* @returns {void}
|
|
451
|
+
*/
|
|
452
|
+
private _syncCardEmptyFocus;
|
|
453
|
+
/** @private @returns {HTMLElement[]} Roving items in display order. */
|
|
454
|
+
private _cardItems;
|
|
455
|
+
/** @private @param {HTMLElement} item @returns {{kind:'card'|'group', id:unknown}|null} */
|
|
456
|
+
private _cardItemKey;
|
|
457
|
+
/** @private @param {{kind:'card'|'group', id:unknown}|null} key @returns {HTMLElement|null} */
|
|
458
|
+
private _cardItemFor;
|
|
459
|
+
/** @private @param {FocusEvent} event @returns {void} */
|
|
460
|
+
private _cardFocusIn;
|
|
461
|
+
/**
|
|
462
|
+
* The roving keyboard model; see the class description.
|
|
463
|
+
* @private
|
|
464
|
+
* @param {KeyboardEvent} event Key event.
|
|
465
|
+
* @returns {void}
|
|
466
|
+
*/
|
|
467
|
+
private _cardRovingKeydown;
|
|
468
|
+
/** @private @param {HTMLElement[]} items @returns {unknown[]} Record ids of the card items. */
|
|
469
|
+
private _cardIdsOf;
|
|
279
470
|
/** @private @returns {HTMLElement} */
|
|
280
471
|
private _createCardSkeletons;
|
|
281
472
|
/** @private @returns {HTMLElement} */
|
|
@@ -297,6 +488,53 @@ export declare class CardView extends RecordView {
|
|
|
297
488
|
/** @private @returns {Readonly<CardViewOptions & RecordViewOptions>} */
|
|
298
489
|
private _cardOptions;
|
|
299
490
|
}
|
|
491
|
+
/**
|
|
492
|
+
* Sorts item rectangles into visual rows: items whose tops are within `tolerance` pixels share a
|
|
493
|
+
* row, rows run top to bottom, and items within a row left to right.
|
|
494
|
+
* @param {Array<{top:number,left:number}>} rects Item rectangles in display order.
|
|
495
|
+
* @param {number} [tolerance=4] Pixels two tops may differ by and still share a row.
|
|
496
|
+
* @returns {number[][]} Item indexes per row.
|
|
497
|
+
*/
|
|
498
|
+
export declare function cardGridRows(rects: Array<{
|
|
499
|
+
top: number;
|
|
500
|
+
left: number;
|
|
501
|
+
}>, tolerance?: number): number[][];
|
|
502
|
+
/**
|
|
503
|
+
* How many columns the cards are laid out in: the length of the longest visual row.
|
|
504
|
+
* @param {Array<{top:number,left:number}>} rects Item rectangles.
|
|
505
|
+
* @returns {number} At least 1 for a non-empty list, 0 for an empty one.
|
|
506
|
+
*/
|
|
507
|
+
export declare function cardColumnCount(rects: Array<{
|
|
508
|
+
top: number;
|
|
509
|
+
left: number;
|
|
510
|
+
}>): number;
|
|
511
|
+
/**
|
|
512
|
+
* Where a navigation key moves in a laid-out card grid. ArrowUp/ArrowDown go to the previous or
|
|
513
|
+
* next visual row and PageUp/PageDown `page` rows, landing on the item nearest to `x` (the column
|
|
514
|
+
* the reader is travelling in); ArrowLeft/ArrowRight move within the row and stop at its ends;
|
|
515
|
+
* Home/End go to the first or last item.
|
|
516
|
+
* @param {Array<{top:number,left:number}>} rects Item rectangles in display order.
|
|
517
|
+
* @param {number} index Current item.
|
|
518
|
+
* @param {string} key `KeyboardEvent.key`.
|
|
519
|
+
* @param {{page?:number, x?:number}} [options={}] Rows per page (default 10) and preferred x.
|
|
520
|
+
* @returns {number|null} Next item index, or null when the key is not a move.
|
|
521
|
+
*/
|
|
522
|
+
export declare function cardGridTarget(rects: Array<{
|
|
523
|
+
top: number;
|
|
524
|
+
left: number;
|
|
525
|
+
}>, index: number, key: string, options?: {
|
|
526
|
+
page?: number;
|
|
527
|
+
x?: number;
|
|
528
|
+
}): number | null;
|
|
529
|
+
/**
|
|
530
|
+
* How many rows a PageUp or PageDown moves: the rows that fit in the visible height, less one so
|
|
531
|
+
* the row focus leaves stays in view. Falls back when either height is unknown.
|
|
532
|
+
* @param {number} viewport Visible height of the scroll region.
|
|
533
|
+
* @param {number} rowHeight Height of one row of cards.
|
|
534
|
+
* @param {number} [fallback=10] Rows to move when the heights are unusable.
|
|
535
|
+
* @returns {number} At least 1.
|
|
536
|
+
*/
|
|
537
|
+
export declare function cardPageSize(viewport: number, rowHeight: number, fallback?: number): number;
|
|
300
538
|
/**
|
|
301
539
|
* Groups a cloned record list without mutating records or caller arrays. Explicit order entries
|
|
302
540
|
* are always materialized, including empty groups; remaining values keep first-seen order.
|
|
@@ -304,8 +542,9 @@ export declare class CardView extends RecordView {
|
|
|
304
542
|
* @param {CardViewOptions['groupBy']} groupBy Group field or resolver.
|
|
305
543
|
* @param {unknown[]} [groupOrder=[]] Preferred group ids.
|
|
306
544
|
* @param {ViewField[]} [fields=[]] Complete fields for accessor-aware grouping.
|
|
545
|
+
* @param {string} [ungroupedLabel='Ungrouped'] Label of the group collecting records without a value.
|
|
307
546
|
* @returns {CardRecordGroup[]} Deterministic groups.
|
|
308
547
|
*/
|
|
309
|
-
export declare function groupCardRecords(records: ViewRecord[], groupBy: CardViewOptions['groupBy'], groupOrder?: unknown[], fields?: ViewField[]): CardRecordGroup[];
|
|
548
|
+
export declare function groupCardRecords(records: ViewRecord[], groupBy: CardViewOptions['groupBy'], groupOrder?: unknown[], fields?: ViewField[], ungroupedLabel?: string): CardRecordGroup[];
|
|
310
549
|
/** @param {unknown} value @returns {string} */
|
|
311
550
|
export declare function normalizeCardWidth(value: unknown): string;
|
|
@@ -139,6 +139,13 @@ export type RecordCardOptions = {
|
|
|
139
139
|
* Listener-free, owner-created controls such as a move handle.
|
|
140
140
|
*/
|
|
141
141
|
controls?: Node[];
|
|
142
|
+
/**
|
|
143
|
+
* Resolves the card's built-in strings
|
|
144
|
+
* (`recordCard.select`, `recordCard.actions`, `recordCard.untitled`, `recordCard.selected`,
|
|
145
|
+
* `recordCard.notSelected`). An owning component passes its own `msg()`; omitted, the host
|
|
146
|
+
* translator and then the default English catalogue answer.
|
|
147
|
+
*/
|
|
148
|
+
message?: (key: string, ...args: unknown[]) => string;
|
|
142
149
|
};
|
|
143
150
|
export type ResolvedRecordPreview = {
|
|
144
151
|
/**
|
|
@@ -218,6 +225,10 @@ export type ResolvedRecordPreview = {
|
|
|
218
225
|
* @property {'outlined'|'raised'|'filled'} [variant='outlined'] Surface treatment.
|
|
219
226
|
* @property {1|2|3|4|5|6} [headingLevel=3] Card title heading level.
|
|
220
227
|
* @property {Node[]} [controls=[]] Listener-free, owner-created controls such as a move handle.
|
|
228
|
+
* @property {(key: string, ...args: unknown[]) => string} [message] Resolves the card's built-in strings
|
|
229
|
+
* (`recordCard.select`, `recordCard.actions`, `recordCard.untitled`, `recordCard.selected`,
|
|
230
|
+
* `recordCard.notSelected`). An owning component passes its own `msg()`; omitted, the host
|
|
231
|
+
* translator and then the default English catalogue answer.
|
|
221
232
|
*/
|
|
222
233
|
/**
|
|
223
234
|
* @typedef {Object} ResolvedRecordPreview
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from '../../core/component.js';
|
|
2
2
|
export type MenuItem = import('../../internal/menu-items.js').MenuItem;
|
|
3
|
-
export type ContextMenuEntry = import('../../internal/menu-items.js').
|
|
3
|
+
export type ContextMenuEntry = import('../../internal/menu-items.js').MenuItem | import('../../internal/menu-items.js').MenuHeading | import('../../internal/menu-items.js').MenuSeparator | '-';
|
|
4
4
|
export type ContextMenuOptions = {
|
|
5
5
|
/**
|
|
6
6
|
* Menu
|
|
@@ -35,7 +35,11 @@ export type ContextMenuOptions = {
|
|
|
35
35
|
onclose?: (event: CustomEvent<Record<string, never>>) => void;
|
|
36
36
|
};
|
|
37
37
|
/** @typedef {import('../../internal/menu-items.js').MenuItem} MenuItem */
|
|
38
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* A context menu's entries: the shared menu model without `choice` rows, which a menu that closes
|
|
40
|
+
* on every activation cannot hold.
|
|
41
|
+
* @typedef {import('../../internal/menu-items.js').MenuItem|import('../../internal/menu-items.js').MenuHeading|import('../../internal/menu-items.js').MenuSeparator|'-'} ContextMenuEntry
|
|
42
|
+
*/
|
|
39
43
|
/**
|
|
40
44
|
* @typedef {Object} ContextMenuOptions
|
|
41
45
|
* @property {ContextMenuEntry[]|((context: Element|null) => ContextMenuEntry[])} [items=[]] Menu
|
|
@@ -37,7 +37,7 @@ export type SelectFilterDefinition = {
|
|
|
37
37
|
*/
|
|
38
38
|
options?: Array<unknown | DataFilterOption>;
|
|
39
39
|
/**
|
|
40
|
-
* Empty option label.
|
|
40
|
+
* Empty option label; omitted resolves message `dataFilter.all`, "All".
|
|
41
41
|
*/
|
|
42
42
|
emptyLabel?: string;
|
|
43
43
|
};
|
|
@@ -94,7 +94,7 @@ export type DataFilterOptions = {
|
|
|
94
94
|
*/
|
|
95
95
|
autoApply?: boolean;
|
|
96
96
|
/**
|
|
97
|
-
* Clear button label; null resolves `dataFilter.clear
|
|
97
|
+
* Clear button label; null resolves message `dataFilter.clear`, "Clear".
|
|
98
98
|
*/
|
|
99
99
|
clearLabel?: string | null;
|
|
100
100
|
onfilter?: (event: CustomEvent<DataFilterEventDetail>) => void;
|
|
@@ -118,7 +118,7 @@ export type DataFilterEventDetail = {
|
|
|
118
118
|
* @property {Array<string|((row: DataFilterRow) => unknown)>} [fields] Row fields combined with OR.
|
|
119
119
|
* @property {(row: DataFilterRow) => unknown} [get] Custom value accessor.
|
|
120
120
|
* @property {Array<unknown|DataFilterOption>} [options] Explicit options; omitted derives distinct values.
|
|
121
|
-
* @property {string} [emptyLabel] Empty option label.
|
|
121
|
+
* @property {string} [emptyLabel] Empty option label; omitted resolves message `dataFilter.all`, "All".
|
|
122
122
|
*/
|
|
123
123
|
/**
|
|
124
124
|
* @typedef {Object} TextFilterDefinition
|
|
@@ -142,7 +142,7 @@ export type DataFilterEventDetail = {
|
|
|
142
142
|
* @property {FilterDefinition[]} [filters=[]] Declarative filters.
|
|
143
143
|
* @property {DataFilterRow[]} [data=[]] Rows to filter.
|
|
144
144
|
* @property {boolean} [autoApply=true] Apply and emit whenever a control changes.
|
|
145
|
-
* @property {string|null} [clearLabel=null] Clear button label; null resolves `dataFilter.clear
|
|
145
|
+
* @property {string|null} [clearLabel=null] Clear button label; null resolves message `dataFilter.clear`, "Clear".
|
|
146
146
|
* @property {(event: CustomEvent<DataFilterEventDetail>) => void} [onfilter]
|
|
147
147
|
*/
|
|
148
148
|
/** @typedef {{rows: DataFilterRow[], state: Record<string, unknown>}} DataFilterEventDetail */
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Component } from '../../core/component.js';
|
|
2
|
-
declare const HANDLE_POINTER_DISMISS: unique symbol;
|
|
3
|
-
declare const HANDLE_ESCAPE_DISMISS: unique symbol;
|
|
4
2
|
export type DropdownOptions = {
|
|
5
3
|
/**
|
|
6
4
|
* Panel content.
|
|
@@ -55,6 +53,16 @@ export type DropdownOptions = {
|
|
|
55
53
|
*/
|
|
56
54
|
/**
|
|
57
55
|
* Generic anchored floating panel using the browser popover top layer.
|
|
56
|
+
*
|
|
57
|
+
* Open, the panel is one entry on the overlay stack (`core/overlay-stack.js`): Escape closes it
|
|
58
|
+
* only while it is the topmost layer that takes Escape, a press outside it and every overlay opened
|
|
59
|
+
* from it closes it, and it closes with the overlay its anchor sits in. Inside an open dialog the
|
|
60
|
+
* panel is hosted by that dialog, so `showModal()` does not make it inert.
|
|
61
|
+
*
|
|
62
|
+
* The panel follows its trigger in the Tab order: Tab on the anchor of an open panel moves into
|
|
63
|
+
* the panel's first focusable control (or onto the panel itself when it carries a `tabindex`),
|
|
64
|
+
* Tab past the panel's last control continues after the anchor, and Shift+Tab from the first goes
|
|
65
|
+
* back to the anchor. Closing while focus is inside returns it to the anchor.
|
|
58
66
|
* @fires Dropdown#open
|
|
59
67
|
* @fires Dropdown#close
|
|
60
68
|
* @extends {Component<DropdownOptions>}
|
|
@@ -115,9 +123,16 @@ export declare class Dropdown extends Component<DropdownOptions> {
|
|
|
115
123
|
* @returns {void}
|
|
116
124
|
*/
|
|
117
125
|
destroy(): void;
|
|
118
|
-
/**
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Internal seam for components built on a Dropdown (MenuButton, ContextMenu, the app rail):
|
|
128
|
+
* replaces what Escape does when the overlay stack routes it to this panel, and takes the panel
|
|
129
|
+
* out of the anchor's Tab order — a menu is reached with the arrow keys, not Tab.
|
|
130
|
+
* @param {{onEscape?: ((event: KeyboardEvent) => void)|null, tabReach?: boolean}} settings
|
|
131
|
+
* @returns {this}
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
_configure(settings: {
|
|
135
|
+
onEscape?: ((event: KeyboardEvent) => void) | null;
|
|
136
|
+
tabReach?: boolean;
|
|
137
|
+
}): this;
|
|
122
138
|
}
|
|
123
|
-
export {};
|
|
@@ -38,6 +38,12 @@ export type FieldOptions = {
|
|
|
38
38
|
* Whether the control is disabled.
|
|
39
39
|
*/
|
|
40
40
|
disabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the value is read-only: shown and focusable, not
|
|
43
|
+
* editable. Types whose control has no read-only state (`checkbox`, `select`, `optionlist`,
|
|
44
|
+
* `zxselect`, `date`, `time`, …) ignore it.
|
|
45
|
+
*/
|
|
46
|
+
readonly?: boolean;
|
|
41
47
|
/**
|
|
42
48
|
* Select or option-list values.
|
|
43
49
|
*/
|
|
@@ -90,6 +96,11 @@ export type FieldAdapter = {
|
|
|
90
96
|
* Set disabled state.
|
|
91
97
|
*/
|
|
92
98
|
setDisabled: (disabled: boolean) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Set read-only state; left out when the
|
|
101
|
+
* control has none.
|
|
102
|
+
*/
|
|
103
|
+
setReadonly?: (readonly: boolean) => void;
|
|
93
104
|
/**
|
|
94
105
|
* Release adapter-owned resources.
|
|
95
106
|
*/
|
|
@@ -119,6 +130,9 @@ export type NumericCoercion = {
|
|
|
119
130
|
* @property {string} [placeholder=''] Control placeholder.
|
|
120
131
|
* @property {boolean} [required=false] Whether a value is required.
|
|
121
132
|
* @property {boolean} [disabled=false] Whether the control is disabled.
|
|
133
|
+
* @property {boolean} [readonly=false] Whether the value is read-only: shown and focusable, not
|
|
134
|
+
* editable. Types whose control has no read-only state (`checkbox`, `select`, `optionlist`,
|
|
135
|
+
* `zxselect`, `date`, `time`, …) ignore it.
|
|
122
136
|
* @property {string[]|Record<string, string>|null} [options=null] Select or option-list values.
|
|
123
137
|
* @property {'stack'|'inline'} [layout='stack'] Label/control layout.
|
|
124
138
|
* @property {Record<string, unknown>} [props={}] Adapter-specific control properties.
|
|
@@ -133,6 +147,8 @@ export type NumericCoercion = {
|
|
|
133
147
|
* @property {(value: unknown, options?: {silent?: boolean}) => void} set Set the current value.
|
|
134
148
|
* @property {() => void} focus Focus the control.
|
|
135
149
|
* @property {(disabled: boolean) => void} setDisabled Set disabled state.
|
|
150
|
+
* @property {(readonly: boolean) => void} [setReadonly] Set read-only state; left out when the
|
|
151
|
+
* control has none.
|
|
136
152
|
* @property {() => void} [destroy] Release adapter-owned resources.
|
|
137
153
|
* @property {Element} [labelTarget] The element the field's label, description, and validity
|
|
138
154
|
* belong to when it is not `el` — the text input inside a composite control. Left out, a
|
|
@@ -143,6 +159,7 @@ export type NumericCoercion = {
|
|
|
143
159
|
/**
|
|
144
160
|
* One labelled form control backed by a registered adapter.
|
|
145
161
|
* @fires Field#change
|
|
162
|
+
* @fires Field#input
|
|
146
163
|
* @fires Field#invalid
|
|
147
164
|
* @extends {Component<FieldOptions>}
|
|
148
165
|
*/
|
|
@@ -213,6 +230,13 @@ export declare class Field extends Component<FieldOptions> {
|
|
|
213
230
|
* @returns {this}
|
|
214
231
|
*/
|
|
215
232
|
setDisabled(disabled: boolean): this;
|
|
233
|
+
/**
|
|
234
|
+
* Makes the value read-only or editable again, where the control has a read-only state (see
|
|
235
|
+
* the `readonly` option); reflected as `data-readonly` on the root either way.
|
|
236
|
+
* @param {boolean} readonly Read-only state.
|
|
237
|
+
* @returns {this}
|
|
238
|
+
*/
|
|
239
|
+
setReadonly(readonly: boolean): this;
|
|
216
240
|
/**
|
|
217
241
|
* Displays a validation or status message.
|
|
218
242
|
* @param {string} message Message text.
|
|
@@ -260,6 +284,12 @@ export declare function coerceFloat(input: unknown): NumericCoercion;
|
|
|
260
284
|
* @event Field#change
|
|
261
285
|
* @type {CustomEvent<{value: unknown}>}
|
|
262
286
|
*/
|
|
287
|
+
/**
|
|
288
|
+
* Live edit before it is committed, from the types whose widget tells the two apart (`code`,
|
|
289
|
+
* `slider`): every keystroke or drag step, where `change` follows only on commit.
|
|
290
|
+
* @event Field#input
|
|
291
|
+
* @type {CustomEvent<{value: unknown}>}
|
|
292
|
+
*/
|
|
263
293
|
/**
|
|
264
294
|
* Field validation failure event.
|
|
265
295
|
* @event Field#invalid
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export type Field = import('../field/field.js').Field;
|
|
2
|
+
export type FieldAdapter = import('../field/field.js').FieldAdapter;
|
|
3
|
+
export type ExternalSource = Element | {
|
|
4
|
+
el?: Element;
|
|
5
|
+
toElement?: () => Element;
|
|
6
|
+
};
|
|
7
|
+
/** @typedef {import('../field/field.js').Field} Field */
|
|
8
|
+
/** @typedef {import('../field/field.js').FieldAdapter} FieldAdapter */
|
|
9
|
+
/**
|
|
10
|
+
* An element or component a Fieldset adopts with `addField(id, source)`: anything that renders
|
|
11
|
+
* into an element. Components are read through the methods they have, elements through their
|
|
12
|
+
* native properties.
|
|
13
|
+
* @typedef {Element|{el?: Element, toElement?: () => Element}} ExternalSource
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* The value accessor pairs the library's components use, in the order they are tried. A reader
|
|
17
|
+
* counts only when it takes no required argument (`Fieldset.getValue(id)` is not a reader), a
|
|
18
|
+
* writer of another pair only when the value is its sole required argument.
|
|
19
|
+
* - `getValue/setValue`: Field, CodeEditor, Filter, SortControl, Toggle (`getValue()` is the
|
|
20
|
+
* configured on-value or `false`, the same as the `toggle` field type reads).
|
|
21
|
+
* - `get/set`: NumberField, Select, Slider, Rating, CheckButton, Datebox, Timebox, Search,
|
|
22
|
+
* CopyInput, DatePicker and the other pickers.
|
|
23
|
+
* - `getValues/setValues`: Checklist, TagPicker, ValueList, MultiValueEditor, Fieldset, Form.
|
|
24
|
+
* - `isChecked/setChecked`: boolean controls that name their state that way.
|
|
25
|
+
* @type {ReadonlyArray<readonly [string, string]>}
|
|
26
|
+
*/
|
|
27
|
+
export declare const VALUE_METHODS: ReadonlyArray<readonly [string, string]>;
|
|
28
|
+
/**
|
|
29
|
+
* The element a source renders into.
|
|
30
|
+
* @param {ExternalSource} source Element or component.
|
|
31
|
+
* @returns {Element}
|
|
32
|
+
*/
|
|
33
|
+
export declare function externalElement(source: ExternalSource): Element;
|
|
34
|
+
/**
|
|
35
|
+
* Reads the current value of an element or component through the first value dialect it
|
|
36
|
+
* supports (see {@link VALUE_METHODS}), then a `value`, `values`, or `checked` property, then the
|
|
37
|
+
* element itself: `checked` for a checkbox or radio, `value` for any other control. Null when
|
|
38
|
+
* the source has no value at all.
|
|
39
|
+
* @param {ExternalSource} source Element or component.
|
|
40
|
+
* @returns {unknown}
|
|
41
|
+
*/
|
|
42
|
+
export declare function readExternalValue(source: ExternalSource): unknown;
|
|
43
|
+
/**
|
|
44
|
+
* Reports whether an element or component is disabled: its `isDisabled()`, a `disabled`
|
|
45
|
+
* property, the element's own `disabled`, an `aria-disabled="true"` or `data-disabled` root, or
|
|
46
|
+
* a wrapper whose every form control is disabled.
|
|
47
|
+
* @param {ExternalSource} source Element or component.
|
|
48
|
+
* @returns {boolean}
|
|
49
|
+
*/
|
|
50
|
+
export declare function readExternalDisabled(source: ExternalSource): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Reports whether an element or component is read-only: a `readonly`/`readOnly` property, the
|
|
53
|
+
* element's own `readOnly`, or an `aria-readonly="true"` or `data-readonly` root.
|
|
54
|
+
* @param {ExternalSource} source Element or component.
|
|
55
|
+
* @returns {boolean}
|
|
56
|
+
*/
|
|
57
|
+
export declare function readExternalReadonly(source: ExternalSource): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Builds the Field adapter for an element or component that is not a registered field type.
|
|
60
|
+
*
|
|
61
|
+
* Values go through the source's own accessors ({@link readExternalValue}); disabling through
|
|
62
|
+
* `setDisabled(bool)`, then `enable()`/`disable()`, then a `disabled` property, and only then the
|
|
63
|
+
* DOM — the element's `disabled`, or for a plain wrapper `aria-disabled` plus `disabled` on every
|
|
64
|
+
* form control inside it. Read-only goes through `setReadonly(bool)`/`setReadOnly(bool)`, a
|
|
65
|
+
* `readonly`/`readOnly` property, or the element's own `readOnly`.
|
|
66
|
+
*
|
|
67
|
+
* Writes pass the caller's options to the component: `Field.setValue(v)` or
|
|
68
|
+
* `Fieldset.setValues(values)` without `silent` lets the component emit its own `change` to its
|
|
69
|
+
* own listeners, while the field emits one `change` for the write; with `silent` neither does.
|
|
70
|
+
*
|
|
71
|
+
* Given the field, a component's own `change` event becomes the field's `change`, and the native
|
|
72
|
+
* `change` its inner controls bubble is dropped unless it carries a value the component did not
|
|
73
|
+
* already report — so one edit is one field `change`, whether the component reports it, its
|
|
74
|
+
* input does, or (Search, CopyInput) only its input does.
|
|
75
|
+
*
|
|
76
|
+
* `destroy()` puts the element back where it was found and undoes what the adapter changed:
|
|
77
|
+
* attributes, the native value, disabled and read-only state.
|
|
78
|
+
* @param {ExternalSource} source Element or component to adopt.
|
|
79
|
+
* @param {Field|null} [field=null] The field the adapter serves; needed to forward events. Its
|
|
80
|
+
* `listen()` owns every listener the adapter adds, so destroying the field removes them.
|
|
81
|
+
* @returns {FieldAdapter}
|
|
82
|
+
*/
|
|
83
|
+
export declare function externalAdapter(source: ExternalSource, field?: Field | null): FieldAdapter;
|
|
@@ -53,6 +53,13 @@ export declare class Fieldset extends Component<FieldsetOptions> {
|
|
|
53
53
|
* Adds a field from options, an existing field, an element, or a component. The key becomes the
|
|
54
54
|
* field's `name` and its `data-field-id`; the control's DOM id is `<idPrefix>-<key>`, unless the
|
|
55
55
|
* field options give an `id` of their own that differs from the key.
|
|
56
|
+
*
|
|
57
|
+
* An element or a component that is not a registered field type is wrapped in a `custom` field
|
|
58
|
+
* that reads and writes it through its own API — `getValue`/`setValue`, `get`/`set`,
|
|
59
|
+
* `getValues`/`setValues`, `isChecked`/`setChecked`, or a `value` property — disables it
|
|
60
|
+
* through `setDisabled(bool)` or `enable()`/`disable()`, and makes it read-only through
|
|
61
|
+
* `setReadonly(bool)`, falling back to the element's native properties only when the component
|
|
62
|
+
* has none of these. The component's own `change` becomes the field's `change`, once per edit.
|
|
56
63
|
* @param {string} id Logical field identifier.
|
|
57
64
|
* @param {FieldOptions|Field|Element|Component} field Field source.
|
|
58
65
|
* @returns {Field}
|