@zeyos/zx 4.3.4 → 4.4.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.
Files changed (128) hide show
  1. package/CHANGELOG.md +155 -0
  2. package/README.md +7 -0
  3. package/dist/types/components/activity-item/activity-item.d.ts +351 -0
  4. package/dist/types/components/activity-list/activity-list.d.ts +195 -0
  5. package/dist/types/components/app-sidebar/app-sidebar.d.ts +28 -0
  6. package/dist/types/components/button/button.d.ts +8 -0
  7. package/dist/types/components/calendar/calendar.d.ts +19 -0
  8. package/dist/types/components/card/card.d.ts +7 -0
  9. package/dist/types/components/card-view/card-view.d.ts +11 -3
  10. package/dist/types/components/card-view/record-card.d.ts +7 -1
  11. package/dist/types/components/code-editor/code-editor.d.ts +160 -0
  12. package/dist/types/components/code-editor/field-adapter.d.ts +5 -0
  13. package/dist/types/components/context-menu/context-menu.d.ts +18 -2
  14. package/dist/types/components/date-picker/date-picker.d.ts +8 -0
  15. package/dist/types/components/date-picker/time-picker.d.ts +7 -0
  16. package/dist/types/components/dialog/dialog.d.ts +29 -0
  17. package/dist/types/components/entity-ref/entity-ref.d.ts +331 -0
  18. package/dist/types/components/file-item/file-item.d.ts +234 -0
  19. package/dist/types/components/file-list/file-list.d.ts +171 -0
  20. package/dist/types/components/filter/filter.d.ts +91 -36
  21. package/dist/types/components/filter-panel/filter-panel.d.ts +449 -0
  22. package/dist/types/components/kanban-view/kanban-card.d.ts +138 -0
  23. package/dist/types/components/kanban-view/kanban-view.d.ts +170 -4
  24. package/dist/types/components/launcher/launcher.d.ts +19 -12
  25. package/dist/types/components/list-toolbar/list-toolbar.d.ts +599 -0
  26. package/dist/types/components/menu-button/menu-button.d.ts +4 -37
  27. package/dist/types/components/message/message.d.ts +7 -0
  28. package/dist/types/components/modal/modal.d.ts +48 -0
  29. package/dist/types/components/navigation-bar/navigation-bar.d.ts +105 -21
  30. package/dist/types/components/panel/panel.d.ts +7 -0
  31. package/dist/types/components/search/search.d.ts +7 -0
  32. package/dist/types/components/select/select.d.ts +4 -0
  33. package/dist/types/components/sort-control/sort-control.d.ts +105 -0
  34. package/dist/types/components/stat-tile/stat-tile.d.ts +277 -0
  35. package/dist/types/components/tabbox/tabbox.d.ts +7 -0
  36. package/dist/types/components/table/table.d.ts +144 -0
  37. package/dist/types/components/table-view/table-view.d.ts +11 -5
  38. package/dist/types/components/timebox/timebox.d.ts +7 -0
  39. package/dist/types/components/value-list/value-list.d.ts +8 -0
  40. package/dist/types/components/view/record-view.d.ts +96 -5
  41. package/dist/types/core/icons.d.ts +17 -0
  42. package/dist/types/index.d.ts +11 -0
  43. package/dist/types/internal/app-rail.d.ts +10 -0
  44. package/dist/types/internal/menu-items.d.ts +134 -0
  45. package/dist/zx-zeyos.esm.js +616 -77
  46. package/dist/zx-zeyos.esm.min.js +8 -1
  47. package/dist/zx.css +2085 -238
  48. package/dist/zx.esm.js +6704 -1542
  49. package/dist/zx.esm.min.js +10 -3
  50. package/dist/zx.global.js +6704 -1542
  51. package/dist/zx.global.min.js +10 -3
  52. package/dist/zx.min.css +1 -1
  53. package/docs/api.json +1479 -127
  54. package/docs/llms.md +315 -10
  55. package/docs/llms.txt +11 -5
  56. package/package.json +1 -1
  57. package/src/components/activity-item/activity-item.css +137 -0
  58. package/src/components/activity-item/activity-item.js +599 -0
  59. package/src/components/activity-list/activity-list.css +64 -0
  60. package/src/components/activity-list/activity-list.js +375 -0
  61. package/src/components/app-rail/app-rail.css +227 -19
  62. package/src/components/app-sidebar/app-sidebar.css +414 -24
  63. package/src/components/app-sidebar/app-sidebar.js +65 -5
  64. package/src/components/button/button.css +8 -0
  65. package/src/components/button/button.js +6 -1
  66. package/src/components/calendar/calendar.js +33 -3
  67. package/src/components/card/card.js +12 -1
  68. package/src/components/card-view/card-view.css +1 -0
  69. package/src/components/card-view/card-view.js +25 -9
  70. package/src/components/card-view/record-card.js +7 -3
  71. package/src/components/code-editor/code-editor.css +67 -0
  72. package/src/components/code-editor/code-editor.js +288 -0
  73. package/src/components/code-editor/field-adapter.js +34 -0
  74. package/src/components/context-menu/context-menu.css +80 -3
  75. package/src/components/context-menu/context-menu.js +22 -30
  76. package/src/components/date-picker/date-picker.js +22 -8
  77. package/src/components/date-picker/month-picker.js +3 -3
  78. package/src/components/date-picker/time-picker.js +20 -8
  79. package/src/components/dialog/dialog.js +88 -66
  80. package/src/components/dropdown/dropdown.js +2 -2
  81. package/src/components/entity-ref/entity-ref.css +182 -0
  82. package/src/components/entity-ref/entity-ref.js +496 -0
  83. package/src/components/file-item/file-item.css +88 -0
  84. package/src/components/file-item/file-item.js +371 -0
  85. package/src/components/file-list/file-list.css +51 -0
  86. package/src/components/file-list/file-list.js +320 -0
  87. package/src/components/filter/filter.css +27 -1
  88. package/src/components/filter/filter.js +199 -45
  89. package/src/components/filter-panel/filter-panel.css +104 -0
  90. package/src/components/filter-panel/filter-panel.js +964 -0
  91. package/src/components/kanban-view/kanban-card.js +239 -0
  92. package/src/components/kanban-view/kanban-view.css +194 -0
  93. package/src/components/kanban-view/kanban-view.js +251 -8
  94. package/src/components/launcher/launcher.js +59 -27
  95. package/src/components/list-toolbar/list-toolbar.css +189 -0
  96. package/src/components/list-toolbar/list-toolbar.js +851 -0
  97. package/src/components/menu-button/menu-button.css +80 -3
  98. package/src/components/menu-button/menu-button.js +21 -37
  99. package/src/components/message/message.css +5 -2
  100. package/src/components/message/message.js +13 -2
  101. package/src/components/modal/modal.css +15 -0
  102. package/src/components/modal/modal.js +141 -0
  103. package/src/components/navigation-bar/navigation-bar.css +77 -2
  104. package/src/components/navigation-bar/navigation-bar.js +171 -4
  105. package/src/components/panel/panel.js +13 -2
  106. package/src/components/search/search.js +17 -5
  107. package/src/components/select/field-adapter.js +4 -1
  108. package/src/components/select/select.js +3 -0
  109. package/src/components/sort-control/sort-control.css +17 -0
  110. package/src/components/sort-control/sort-control.js +140 -0
  111. package/src/components/stat-tile/stat-tile.css +213 -0
  112. package/src/components/stat-tile/stat-tile.js +590 -0
  113. package/src/components/tabbox/tabbox.js +12 -1
  114. package/src/components/table/table.css +51 -2
  115. package/src/components/table/table.js +298 -19
  116. package/src/components/table-view/table-view.css +8 -2
  117. package/src/components/table-view/table-view.js +21 -6
  118. package/src/components/tag-picker/tag-picker.css +3 -1
  119. package/src/components/timebox/timebox.js +18 -5
  120. package/src/components/value-list/value-list.js +22 -6
  121. package/src/components/view/record-view.css +5 -0
  122. package/src/components/view/record-view.js +100 -7
  123. package/src/core/icons.js +74 -5
  124. package/src/index.js +25 -0
  125. package/src/internal/app-rail.js +19 -1
  126. package/src/internal/menu-items.js +142 -0
  127. package/styles/print.css +192 -0
  128. package/styles/zx.css +11 -0
@@ -0,0 +1,195 @@
1
+ import { Component } from '../../core/component.js';
2
+ export type ActivityItemOptions = import('../activity-item/activity-item.js').ActivityItemOptions;
3
+ export type ActivityListContent = string | number | Node | Component | null;
4
+ export type ActivityGroupReader = string | ((item: ActivityItemOptions, index: number) => unknown) | null;
5
+ export type ActivityGroupLabel = (group: unknown, items: ActivityItemOptions[]) => ActivityListContent;
6
+ export type ActivityGroup = {
7
+ /**
8
+ * Group identity returned by the configured reader.
9
+ */
10
+ id: unknown;
11
+ /**
12
+ * Activities in stable source order.
13
+ */
14
+ items: ActivityItemOptions[];
15
+ };
16
+ export type ActivityListOptions = {
17
+ /**
18
+ * Initial activities in host-supplied chronological order.
19
+ */
20
+ items?: ActivityItemOptions[];
21
+ /**
22
+ * Property or resolver used for stable grouping.
23
+ */
24
+ groupBy?: ActivityGroupReader;
25
+ /**
26
+ * Group-heading renderer.
27
+ */
28
+ groupLabel?: ActivityGroupLabel | null;
29
+ /**
30
+ * Accessible collection name.
31
+ */
32
+ label?: string;
33
+ /**
34
+ * Whether initial or incremental activity is loading.
35
+ */
36
+ loading?: boolean;
37
+ /**
38
+ * Placeholder rows shown for an empty loading list.
39
+ */
40
+ loadingCount?: number;
41
+ /**
42
+ * Loading status text.
43
+ */
44
+ loadingText?: string;
45
+ /**
46
+ * Empty-state content.
47
+ */
48
+ emptyText?: ActivityListContent;
49
+ /**
50
+ * Semantic group-heading level.
51
+ */
52
+ groupHeadingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
53
+ /**
54
+ * Default item-heading level.
55
+ */
56
+ itemHeadingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
57
+ ondatachange?: (event: CustomEvent<{
58
+ items: ActivityItemOptions[];
59
+ }>) => void;
60
+ };
61
+ /** @typedef {import('../activity-item/activity-item.js').ActivityItemOptions} ActivityItemOptions */
62
+ /** @typedef {string|number|Node|Component|null} ActivityListContent */
63
+ /** @typedef {string|((item:ActivityItemOptions,index:number)=>unknown)|null} ActivityGroupReader */
64
+ /** @typedef {(group:unknown,items:ActivityItemOptions[])=>ActivityListContent} ActivityGroupLabel */
65
+ /**
66
+ * @typedef {Object} ActivityGroup
67
+ * @property {unknown} id Group identity returned by the configured reader.
68
+ * @property {ActivityItemOptions[]} items Activities in stable source order.
69
+ */
70
+ /**
71
+ * @typedef {Object} ActivityListOptions
72
+ * @property {ActivityItemOptions[]} [items=[]] Initial activities in host-supplied chronological order.
73
+ * @property {ActivityGroupReader} [groupBy=null] Property or resolver used for stable grouping.
74
+ * @property {ActivityGroupLabel|null} [groupLabel=null] Group-heading renderer.
75
+ * @property {string} [label='Activity'] Accessible collection name.
76
+ * @property {boolean} [loading=false] Whether initial or incremental activity is loading.
77
+ * @property {number} [loadingCount=3] Placeholder rows shown for an empty loading list.
78
+ * @property {string} [loadingText='Loading activity'] Loading status text.
79
+ * @property {ActivityListContent} [emptyText='No activity yet'] Empty-state content.
80
+ * @property {1|2|3|4|5|6} [groupHeadingLevel=2] Semantic group-heading level.
81
+ * @property {1|2|3|4|5|6} [itemHeadingLevel=3] Default item-heading level.
82
+ * @property {(event:CustomEvent<{items:ActivityItemOptions[]}>)=>void} [ondatachange]
83
+ */
84
+ /**
85
+ * Accessible chronological activity collection with stable grouping, loading/empty states, and
86
+ * incremental update methods. Ordering stays host-controlled so paginated and live server results
87
+ * are never silently re-sorted. Item `zx-action` events bubble through the list naturally.
88
+ *
89
+ * @fires ActivityList#datachange
90
+ * @extends {Component<ActivityListOptions>}
91
+ */
92
+ export declare class ActivityList extends Component<ActivityListOptions> {
93
+ _createdRoot: boolean;
94
+ _original: import("../../core/dom.js").TargetSnapshot;
95
+ _cleaned: boolean;
96
+ _items: any;
97
+ _loading: any;
98
+ _itemComponents: any[];
99
+ _groupSequence: number;
100
+ static cssName: string;
101
+ /** @type {Readonly<ActivityListOptions>} */
102
+ static defaults: Readonly<ActivityListOptions>;
103
+ /**
104
+ * Creates or enhances an activity collection.
105
+ * @param {Element|string|null} [target=null] Existing container, selector, or null.
106
+ * @param {ActivityListOptions} [options={}] Collection options.
107
+ */
108
+ constructor(target?: Element | string | null, options?: ActivityListOptions);
109
+ /** @returns {HTMLElement} */
110
+ render(): HTMLElement;
111
+ /**
112
+ * Replaces all activities.
113
+ * @param {ActivityItemOptions[]} items Activities in desired chronological order.
114
+ * @param {{silent?:boolean}} [options={}] Event behavior.
115
+ * @returns {this}
116
+ */
117
+ setItems(items: ActivityItemOptions[], options?: {
118
+ silent?: boolean;
119
+ }): this;
120
+ /** Returns shallow descriptor copies in current display order. @returns {ActivityItemOptions[]} */
121
+ getItems(): ActivityItemOptions[];
122
+ /** Returns a shallow descriptor copy by stable host ID. @param {unknown} id @returns {ActivityItemOptions|null} */
123
+ getItem(id: unknown): ActivityItemOptions | null;
124
+ /**
125
+ * Adds activities after the current source order for older-page or forward-stream updates.
126
+ * @param {ActivityItemOptions|ActivityItemOptions[]} items New activities.
127
+ * @param {{silent?:boolean}} [options={}] Event behavior.
128
+ * @returns {this}
129
+ */
130
+ appendItems(items: ActivityItemOptions | ActivityItemOptions[], options?: {
131
+ silent?: boolean;
132
+ }): this;
133
+ /**
134
+ * Adds activities before the current source order for newest-first live updates.
135
+ * @param {ActivityItemOptions|ActivityItemOptions[]} items New activities.
136
+ * @param {{silent?:boolean}} [options={}] Event behavior.
137
+ * @returns {this}
138
+ */
139
+ prependItems(items: ActivityItemOptions | ActivityItemOptions[], options?: {
140
+ silent?: boolean;
141
+ }): this;
142
+ /**
143
+ * Patches the first activity whose ID is `Object.is`-equal to the requested ID.
144
+ * @param {unknown} id Stable host identifier.
145
+ * @param {Partial<ActivityItemOptions>} values Replacement fields.
146
+ * @param {{silent?:boolean}} [options={}] Event behavior.
147
+ * @returns {this}
148
+ */
149
+ updateItem(id: unknown, values: Partial<ActivityItemOptions>, options?: {
150
+ silent?: boolean;
151
+ }): this;
152
+ /**
153
+ * Removes the first activity whose ID is `Object.is`-equal to the requested ID.
154
+ * @param {unknown} id Stable host identifier.
155
+ * @param {{silent?:boolean}} [options={}] Event behavior.
156
+ * @returns {this}
157
+ */
158
+ removeItem(id: unknown, options?: {
159
+ silent?: boolean;
160
+ }): this;
161
+ /** Sets initial/incremental loading presentation. @param {boolean} loading @returns {this} */
162
+ setLoading(loading: boolean): this;
163
+ /** Restores an enhanced target exactly, or removes an owned list. @returns {void} */
164
+ destroy(): void;
165
+ /** @private @returns {void} */
166
+ private _renderList;
167
+ /** @private @param {ActivityGroup} group @param {boolean} grouped @returns {HTMLElement} */
168
+ private _createGroup;
169
+ /** @private @param {boolean} placeholders @returns {HTMLElement} */
170
+ private _createLoading;
171
+ /** @private @returns {void} */
172
+ private _destroyItems;
173
+ /** @private @returns {void} */
174
+ private _emitDataChange;
175
+ }
176
+ /**
177
+ * Groups descriptors in first-seen group order while preserving source order within every group.
178
+ * A null reader returns one ungrouped collection. Neither descriptors nor the input array mutate.
179
+ * @param {ActivityItemOptions[]} items Activity descriptors.
180
+ * @param {ActivityGroupReader} groupBy Group reader.
181
+ * @returns {ActivityGroup[]}
182
+ */
183
+ export declare function groupActivityItems(items: ActivityItemOptions[], groupBy?: ActivityGroupReader): ActivityGroup[];
184
+ /**
185
+ * Validates and shallow-clones activity descriptors, including each slot array. Explicit
186
+ * duplicate IDs are rejected while id-less entries remain valid.
187
+ * @param {unknown} value Candidate descriptor array.
188
+ * @returns {ActivityItemOptions[]}
189
+ */
190
+ export declare function normalizeActivityItems(value: unknown): ActivityItemOptions[];
191
+ /**
192
+ * Activity descriptors changed through a list mutation method.
193
+ * @event ActivityList#datachange
194
+ * @type {CustomEvent<{items:ActivityItemOptions[]}>}
195
+ */
@@ -220,6 +220,16 @@ export declare class AppSidebar extends Component<AppSidebarOptions> {
220
220
  _renderExpanded(): void;
221
221
  /** @returns {void} */
222
222
  _renderRail(): void;
223
+ /**
224
+ * Keeps a minimized rail's counts readable and audible.
225
+ *
226
+ * A rail destination is icon-only, so its accessible name is the label alone and the badge the
227
+ * expanded tree showed as text is announced by nothing. Here the figure is folded back into the
228
+ * name, and `data-zx-badge` tells the stylesheet whether the count still fits the target or has
229
+ * to be drawn as a dot. Presentation only: no item, option, event, or listener is touched.
230
+ * @returns {void}
231
+ */
232
+ _decorateRail(): void;
223
233
  /** @param {EventTarget} target @param {string} type @param {EventListener} listener @returns {void} */
224
234
  _listenMode(target: EventTarget, type: string, listener: EventListener): void;
225
235
  /** @returns {void} */
@@ -234,6 +244,24 @@ export declare class AppSidebar extends Component<AppSidebarOptions> {
234
244
  _select(item: AppNavItem, event: Event): void;
235
245
  /** @returns {void} */
236
246
  _syncActive(): void;
247
+ /**
248
+ * Flags the sublist a branch toggle just opened so the stylesheet can animate that one branch.
249
+ *
250
+ * `_renderTree()` rebuilds every row on every toggle, so a transition declared on the sublist
251
+ * alone would replay on branches that never moved. The attribute is written after the rebuild
252
+ * and disappears with the element on the next one, which is why it needs no teardown.
253
+ * @param {string} key Branch id as a string.
254
+ * @returns {void}
255
+ */
256
+ _markBranchMotion(key: string): void;
257
+ /**
258
+ * Resolves a message through the host translator, falling back to the built-in English text.
259
+ * @param {string} key Message key.
260
+ * @param {string} fallback Built-in text, with `%1`-style placeholders.
261
+ * @param {...unknown} args Interpolation values.
262
+ * @returns {string}
263
+ */
264
+ _message(key: string, fallback: string, ...args: unknown[]): string;
237
265
  /** @returns {void} */
238
266
  _reconcileExpanded(): void;
239
267
  }
@@ -1,3 +1,7 @@
1
+ export type ButtonShortcut = {
2
+ label: string;
3
+ keys: string;
4
+ };
1
5
  export type ButtonOptions = {
2
6
  /**
3
7
  * Visible button label.
@@ -23,6 +27,10 @@ export type ButtonOptions = {
23
27
  * Native title text.
24
28
  */
25
29
  title?: string;
30
+ /**
31
+ * Keyboard hint; does not register a keyboard handler.
32
+ */
33
+ shortcut?: ButtonShortcut;
26
34
  /**
27
35
  * Click callback.
28
36
  */
@@ -504,6 +504,25 @@ export declare class Calendar extends Component<CalendarOptions> {
504
504
  _refreshNowIndicator(): void;
505
505
  /** @param {string} message @returns {void} */
506
506
  _announce(message: string): void;
507
+ /**
508
+ * Names a month or year cell by its date and how many events it holds. Singular and plural are
509
+ * separate keys because a language that inflects the noun cannot reach it from one template.
510
+ * @param {Date} day Day the cell stands for.
511
+ * @param {number} count Events on that day.
512
+ * @returns {string}
513
+ */
514
+ _dayCountLabel(day: Date, count: number): string;
515
+ /**
516
+ * Resolves a message through the host translator, falling back to the built-in English text.
517
+ *
518
+ * Distinct from `msg()`: the built-in `msg` option answers the calendar's own vocabulary, so a
519
+ * dotted key falls past it to the host translator, which is what these strings never had.
520
+ * @param {string} key Message key.
521
+ * @param {string} fallback Built-in text, with `%1`-style placeholders.
522
+ * @param {...unknown} args Interpolation values.
523
+ * @returns {string}
524
+ */
525
+ _message(key: string, fallback: string, ...args: unknown[]): string;
507
526
  }
508
527
  /** @event Calendar#viewchange @type {CustomEvent<{view: CalendarView, oldView: CalendarView}>} */
509
528
  /** @event Calendar#dateschange @type {CustomEvent<{view: CalendarView, start: Date, end: Date}>} */
@@ -125,4 +125,11 @@ export declare class Card extends Component<CardOptions> {
125
125
  _renderHeading(): void;
126
126
  /** @returns {void} */
127
127
  _syncHeader(): void;
128
+ /**
129
+ * Resolves a message through the host translator, falling back to the built-in English text.
130
+ * @param {string} key Message key.
131
+ * @param {string} fallback English default.
132
+ * @returns {string}
133
+ */
134
+ _message(key: string, fallback: string): string;
128
135
  }
@@ -31,6 +31,10 @@ export type CardViewOptions = {
31
31
  * Record selection behavior.
32
32
  */
33
33
  selectable?: false | 'single' | 'multi';
34
+ /**
35
+ * Select through a checkbox or the non-interactive card surface.
36
+ */
37
+ selectionTrigger?: 'checkbox' | 'card';
34
38
  /**
35
39
  * Initially selected record ids.
36
40
  */
@@ -44,9 +48,10 @@ export type CardViewOptions = {
44
48
  */
45
49
  hiddenFields?: string[];
46
50
  /**
47
- * Whether to expose shared field controls.
51
+ * Whether to expose shared field controls. `true` renders the chooser in the card toolbar and
52
+ * `false` omits it; an object customises its `label` and mounts it into `target`.
48
53
  */
49
- fieldControls?: boolean;
54
+ fieldControls?: boolean | import('../view/record-view.js').ViewFieldControlsConfig;
50
55
  /**
51
56
  * Empty-result content.
52
57
  */
@@ -172,10 +177,13 @@ export type CardRecordGroup = {
172
177
  * @property {import('../view/record-view.js').ViewSort|null} [sort=null] Initial shared sort.
173
178
  * @property {'local'|'server'} [sortMode='local'] Local sorting or event-only server sorting.
174
179
  * @property {false|'single'|'multi'} [selectable=false] Record selection behavior.
180
+ * @property {'checkbox'|'card'} [selectionTrigger='checkbox'] Select through a checkbox or the non-interactive card surface.
175
181
  * @property {unknown[]} [selection=[]] Initially selected record ids.
176
182
  * @property {string[]} [fieldOrder=[]] Preferred shared field order.
177
183
  * @property {string[]} [hiddenFields=[]] Initially hidden metadata fields.
178
- * @property {boolean} [fieldControls=true] Whether to expose shared field controls.
184
+ * @property {boolean|import('../view/record-view.js').ViewFieldControlsConfig} [fieldControls=true]
185
+ * Whether to expose shared field controls. `true` renders the chooser in the card toolbar and
186
+ * `false` omits it; an object customises its `label` and mounts it into `target`.
179
187
  * @property {string|Node|(()=>string|Node)|null} [emptyText=null] Empty-result content.
180
188
  * @property {RecordCardValueSource} [titleField=null] Title field id or explicit resolver.
181
189
  * @property {RecordCardValueSource} [subtitleField=null] Subtitle field id or explicit resolver.
@@ -119,6 +119,10 @@ export type RecordCardOptions = {
119
119
  * Selection presentation.
120
120
  */
121
121
  selectable?: false | 'single' | 'multi';
122
+ /**
123
+ * Selection affordance for owning views.
124
+ */
125
+ selectionTrigger?: 'checkbox' | 'card';
122
126
  /**
123
127
  * Current selection state.
124
128
  */
@@ -209,6 +213,7 @@ export type ResolvedRecordPreview = {
209
213
  * @property {RecordCardLink|((record:ViewRecord,index:number)=>RecordCardLink)} [link]
210
214
  * @property {RecordCardAction[]|((record:ViewRecord,index:number)=>RecordCardAction[])} [actions=[]]
211
215
  * @property {false|'single'|'multi'} [selectable=false] Selection presentation.
216
+ * @property {'checkbox'|'card'} [selectionTrigger='checkbox'] Selection affordance for owning views.
212
217
  * @property {boolean} [selected=false] Current selection state.
213
218
  * @property {'outlined'|'raised'|'filled'} [variant='outlined'] Surface treatment.
214
219
  * @property {1|2|3|4|5|6} [headingLevel=3] Card title heading level.
@@ -229,7 +234,8 @@ export type ResolvedRecordPreview = {
229
234
  *
230
235
  * The returned `<li>` belongs in a semantic `<ul>`/`<ol>`. When selectable its global
231
236
  * `aria-description` announces selection without applying the unsupported `aria-selected` state
232
- * to a listitem; multi-selection also adds a native checkbox. It deliberately remains a listitem
237
+ * to a listitem; multi-selection adds a native checkbox unless the owner opts into card-surface
238
+ * selection. It deliberately remains a listitem
233
239
  * rather than becoming an ARIA option because cards may contain native links and buttons, which
234
240
  * the listbox pattern does not permit inside an option. Preview images are paired with a stable
235
241
  * fallback. The owning component listens for image `error` and marks the fallback.
@@ -0,0 +1,160 @@
1
+ import { Component } from '../../core/component.js';
2
+ export type CodeEditorOptions = {
3
+ /**
4
+ * Initial text.
5
+ */
6
+ value?: unknown;
7
+ /**
8
+ * Form field name.
9
+ */
10
+ name?: string;
11
+ /**
12
+ * Language identifier shown to the user and exposed as data.
13
+ */
14
+ language?: string;
15
+ /**
16
+ * Accessible editor label.
17
+ */
18
+ label?: string;
19
+ /**
20
+ * Placeholder text.
21
+ */
22
+ placeholder?: string;
23
+ /**
24
+ * Visible textarea rows.
25
+ */
26
+ rows?: number;
27
+ /**
28
+ * Text inserted by Tab and removed by Shift+Tab.
29
+ */
30
+ indent?: string;
31
+ /**
32
+ * Textarea wrapping behavior.
33
+ */
34
+ wrap?: 'off' | 'soft' | 'hard';
35
+ /**
36
+ * Whether browser spellcheck is enabled.
37
+ */
38
+ spellcheck?: boolean;
39
+ /**
40
+ * Whether content can be selected but not changed.
41
+ */
42
+ readOnly?: boolean;
43
+ /**
44
+ * Whether the editor is disabled.
45
+ */
46
+ disabled?: boolean;
47
+ /**
48
+ * Whether the line/column status is visible.
49
+ */
50
+ status?: boolean;
51
+ /**
52
+ * Input listener.
53
+ */
54
+ oninput?: (event: CustomEvent<{
55
+ value: string;
56
+ }>) => void;
57
+ /**
58
+ * Change listener.
59
+ */
60
+ onchange?: (event: CustomEvent<{
61
+ value: string;
62
+ }>) => void;
63
+ };
64
+ /**
65
+ * @typedef {Object} CodeEditorOptions
66
+ * @property {unknown} [value=''] Initial text.
67
+ * @property {string} [name=''] Form field name.
68
+ * @property {string} [language='text'] Language identifier shown to the user and exposed as data.
69
+ * @property {string} [label='Code editor'] Accessible editor label.
70
+ * @property {string} [placeholder=''] Placeholder text.
71
+ * @property {number} [rows=12] Visible textarea rows.
72
+ * @property {string} [indent='\t'] Text inserted by Tab and removed by Shift+Tab.
73
+ * @property {'off'|'soft'|'hard'} [wrap='off'] Textarea wrapping behavior.
74
+ * @property {boolean} [spellcheck=false] Whether browser spellcheck is enabled.
75
+ * @property {boolean} [readOnly=false] Whether content can be selected but not changed.
76
+ * @property {boolean} [disabled=false] Whether the editor is disabled.
77
+ * @property {boolean} [status=true] Whether the line/column status is visible.
78
+ * @property {(event: CustomEvent<{value:string}>) => void} [oninput] Input listener.
79
+ * @property {(event: CustomEvent<{value:string}>) => void} [onchange] Change listener.
80
+ */
81
+ /**
82
+ * Dependency-free source editor for structured text, Markdown, JSON and code. It deliberately uses
83
+ * a native textarea: values remain text-safe, browser undo and IME behavior stay intact, and Tab /
84
+ * Shift+Tab provide predictable indentation without a third-party editor runtime.
85
+ * @fires CodeEditor#input
86
+ * @fires CodeEditor#change
87
+ * @extends {Component<CodeEditorOptions>}
88
+ */
89
+ export declare class CodeEditor extends Component<CodeEditorOptions> {
90
+ _createdRoot: boolean;
91
+ _initialChildren: ChildNode[];
92
+ _initialAttributes: Map<string, string>;
93
+ _language: string;
94
+ _languageLabel: HTMLElement;
95
+ _position: HTMLElement;
96
+ _header: HTMLElement;
97
+ _input: HTMLTextAreaElement;
98
+ static cssName: string;
99
+ /** @type {CodeEditorOptions} */
100
+ static defaults: CodeEditorOptions;
101
+ /** @returns {HTMLElement} */
102
+ render(): HTMLElement;
103
+ /** @returns {string} */
104
+ getValue(): string;
105
+ /**
106
+ * Replaces the editor text.
107
+ * @param {unknown} value New value.
108
+ * @param {{silent?:boolean}} [options={}] Suppress the `change` event.
109
+ * @returns {this}
110
+ */
111
+ setValue(value: unknown, { silent }?: {
112
+ silent?: boolean;
113
+ }): this;
114
+ /** @param {unknown} language New language identifier. @returns {this} */
115
+ setLanguage(language: unknown): this;
116
+ /** @returns {this} */
117
+ focus(): this;
118
+ /** @returns {this} */
119
+ enable(): this;
120
+ /** @returns {this} */
121
+ disable(): this;
122
+ /** @param {boolean} value Read-only state. @returns {this} */
123
+ setReadOnly(value: boolean): this;
124
+ /** @param {KeyboardEvent} event @returns {void} */
125
+ _handleKeydown(event: KeyboardEvent): void;
126
+ /** @returns {void} */
127
+ _updatePosition(): void;
128
+ /** @returns {void} */
129
+ destroy(): void;
130
+ }
131
+ /**
132
+ * Applies Tab or Shift+Tab to a textarea selection.
133
+ * @param {string} value Complete source value.
134
+ * @param {number} start Selection start.
135
+ * @param {number} end Selection end.
136
+ * @param {string} indent Indentation text.
137
+ * @param {boolean} outdent Whether to remove indentation.
138
+ * @returns {{value:string,start:number,end:number}}
139
+ */
140
+ export declare function indentSelection(value: string, start: number, end: number, indent?: string, outdent?: boolean): {
141
+ value: string;
142
+ start: number;
143
+ end: number;
144
+ };
145
+ /** @param {string} value @param {number} start @param {number} end @returns {{line:number,column:number,lines:number}} */
146
+ export declare function editorPosition(value: string, start: number, end?: number): {
147
+ line: number;
148
+ column: number;
149
+ lines: number;
150
+ };
151
+ /**
152
+ * Code editor input event.
153
+ * @event CodeEditor#input
154
+ * @type {CustomEvent<{value:string}>}
155
+ */
156
+ /**
157
+ * Code editor committed change event.
158
+ * @event CodeEditor#change
159
+ * @type {CustomEvent<{value:string}>}
160
+ */
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Registers the CodeEditor-backed `code` field type.
3
+ * @returns {void}
4
+ */
5
+ export declare function registerCodeEditorFieldAdapter(): void;
@@ -1,6 +1,6 @@
1
1
  import { Component } from '../../core/component.js';
2
- export type MenuItem = import('../menu-button/menu-button.js').MenuItem;
3
- export type ContextMenuEntry = MenuItem | '-';
2
+ export type MenuItem = import('../../internal/menu-items.js').MenuItem;
3
+ export type ContextMenuEntry = import('../../internal/menu-items.js').MenuEntry;
4
4
  export type ContextMenuOptions = {
5
5
  /**
6
6
  * Menu
@@ -34,6 +34,22 @@ export type ContextMenuOptions = {
34
34
  */
35
35
  onclose?: (event: CustomEvent<Record<string, never>>) => void;
36
36
  };
37
+ /** @typedef {import('../../internal/menu-items.js').MenuItem} MenuItem */
38
+ /** @typedef {import('../../internal/menu-items.js').MenuEntry} ContextMenuEntry */
39
+ /**
40
+ * @typedef {Object} ContextMenuOptions
41
+ * @property {ContextMenuEntry[]|((context: Element|null) => ContextMenuEntry[])} [items=[]] Menu
42
+ * items and `'-'` separators, or a function returning them for the element the menu is opening
43
+ * on — which is how a row menu disables the actions that row does not allow. Returning an empty
44
+ * array cancels the opening.
45
+ * @property {string|null} [selector=null] Restricts the menu to descendants matching this
46
+ * selector, and reports the matched element as the context of the selection. A table passes
47
+ * `'tbody tr'` here to get a per-row menu from one listener.
48
+ * @property {(event: CustomEvent<{value: unknown, item: MenuItem, context: Element|null}>) => void} [onselect]
49
+ * Selection listener.
50
+ * @property {(event: CustomEvent<{context: Element|null}>) => void} [onopen] Open listener.
51
+ * @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close listener.
52
+ */
37
53
  /**
38
54
  * Right-click menu for a region, implementing the APG menu pattern.
39
55
  *
@@ -134,4 +134,12 @@ export declare class DatePicker extends Component<DatePickerOptions> {
134
134
  _inRange(date: Date): boolean;
135
135
  /** @param {Date} date @returns {HTMLButtonElement|null} */
136
136
  _buttonForDate(date: Date): HTMLButtonElement | null;
137
+ /**
138
+ * Resolves a message through the host translator, falling back to the built-in English text.
139
+ * @param {string} key Message key.
140
+ * @param {string} fallback Built-in text, with `%1`-style placeholders.
141
+ * @param {...unknown} args Interpolation values.
142
+ * @returns {string}
143
+ */
144
+ _message(key: string, fallback: string, ...args: unknown[]): string;
137
145
  }
@@ -124,4 +124,11 @@ export declare class TimePicker extends Component<TimePickerOptions> {
124
124
  _buildMark(mark: ClockMark, selected: number): HTMLElement;
125
125
  /** @param {HTMLElement} element @param {ClockMark} mark @param {number} selected @returns {void} */
126
126
  _syncMark(element: HTMLElement, mark: ClockMark, selected: number): void;
127
+ /**
128
+ * Resolves a message through the host translator, falling back to the built-in English text.
129
+ * @param {string} key Message key.
130
+ * @param {string} fallback English default.
131
+ * @returns {string}
132
+ */
133
+ _message(key: string, fallback: string): string;
127
134
  }
@@ -17,6 +17,14 @@ export type DialogButton = {
17
17
  * Whether this button receives initial focus.
18
18
  */
19
19
  autofocus?: boolean;
20
+ /**
21
+ * Whether the footer button is disabled.
22
+ */
23
+ disabled?: boolean;
24
+ /**
25
+ * Visible shortcut hint; the host binds the action.
26
+ */
27
+ shortcut?: import('../button/button.js').ButtonShortcut;
20
28
  };
21
29
  export type DialogOptions = {
22
30
  /**
@@ -155,6 +163,8 @@ export type PromptOptions = {
155
163
  * @property {DialogButtonKind} [kind='default'] Visual button kind.
156
164
  * @property {'close'|'cancel'|((dialog: Dialog) => void)} [action='close'] Button action.
157
165
  * @property {boolean} [autofocus=false] Whether this button receives initial focus.
166
+ * @property {boolean} [disabled=false] Whether the footer button is disabled.
167
+ * @property {import('../button/button.js').ButtonShortcut} [shortcut] Visible shortcut hint; the host binds the action.
158
168
  */
159
169
  /**
160
170
  * @typedef {Object} DialogOptions
@@ -295,4 +305,23 @@ export declare class Dialog extends Modal {
295
305
  * @returns {void}
296
306
  */
297
307
  _applySize(size: 'sm' | 'md' | 'lg' | number): void;
308
+ /**
309
+ * Resolves a component message, falling back to the built-in English text.
310
+ * @param {string} key Message key.
311
+ * @param {string} fallback English default.
312
+ * @returns {string}
313
+ */
314
+ _message(key: string, fallback: string): string;
298
315
  }
316
+ /**
317
+ * Copies footer-button descriptors without mutating the caller's array or objects, and settles
318
+ * the two booleans the footer renders from.
319
+ *
320
+ * `autofocus` and `disabled` are resolved together because they contradict each other: a control
321
+ * that refuses activation must not be the one initial focus lands on, and a host that writes both
322
+ * has said what it wants twice. Deciding it here rather than at render time keeps `Sheet` — which
323
+ * takes the same descriptors through the same footer — on one answer.
324
+ * @param {DialogButton[]|null|undefined} list Button descriptors.
325
+ * @returns {DialogButton[]} Normalized copies.
326
+ */
327
+ export declare function normalizeDialogButtons(list: DialogButton[] | null | undefined): DialogButton[];