@zeyos/zx 4.3.0 → 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 (136) hide show
  1. package/CHANGELOG.md +266 -1
  2. package/README.md +7 -3
  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-model.d.ts +22 -0
  8. package/dist/types/components/calendar/calendar.d.ts +19 -0
  9. package/dist/types/components/card/card.d.ts +7 -0
  10. package/dist/types/components/card-view/card-view.d.ts +12 -4
  11. package/dist/types/components/card-view/record-card.d.ts +53 -5
  12. package/dist/types/components/code-editor/code-editor.d.ts +160 -0
  13. package/dist/types/components/code-editor/field-adapter.d.ts +5 -0
  14. package/dist/types/components/context-menu/context-menu.d.ts +18 -2
  15. package/dist/types/components/date-picker/date-picker.d.ts +8 -0
  16. package/dist/types/components/date-picker/time-picker.d.ts +7 -0
  17. package/dist/types/components/dialog/dialog.d.ts +29 -0
  18. package/dist/types/components/entity-ref/entity-ref.d.ts +331 -0
  19. package/dist/types/components/file-item/file-item.d.ts +234 -0
  20. package/dist/types/components/file-list/file-list.d.ts +171 -0
  21. package/dist/types/components/filter/filter.d.ts +91 -36
  22. package/dist/types/components/filter-panel/filter-panel.d.ts +449 -0
  23. package/dist/types/components/kanban-view/kanban-card.d.ts +138 -0
  24. package/dist/types/components/kanban-view/kanban-policy.d.ts +268 -0
  25. package/dist/types/components/kanban-view/kanban-view.d.ts +837 -26
  26. package/dist/types/components/launcher/launcher.d.ts +19 -12
  27. package/dist/types/components/list-toolbar/list-toolbar.d.ts +599 -0
  28. package/dist/types/components/menu-button/menu-button.d.ts +4 -37
  29. package/dist/types/components/message/message.d.ts +7 -0
  30. package/dist/types/components/modal/modal.d.ts +48 -0
  31. package/dist/types/components/navigation-bar/navigation-bar.d.ts +105 -21
  32. package/dist/types/components/panel/panel.d.ts +7 -0
  33. package/dist/types/components/search/search.d.ts +7 -0
  34. package/dist/types/components/select/select.d.ts +4 -0
  35. package/dist/types/components/sort-control/sort-control.d.ts +105 -0
  36. package/dist/types/components/stat-tile/stat-tile.d.ts +277 -0
  37. package/dist/types/components/tabbox/tabbox.d.ts +7 -0
  38. package/dist/types/components/table/table.d.ts +144 -0
  39. package/dist/types/components/table-view/table-view.d.ts +11 -5
  40. package/dist/types/components/timebox/timebox.d.ts +7 -0
  41. package/dist/types/components/value-list/value-list.d.ts +8 -0
  42. package/dist/types/components/view/record-view.d.ts +96 -5
  43. package/dist/types/core/component.d.ts +6 -1
  44. package/dist/types/core/icons.d.ts +17 -0
  45. package/dist/types/index.d.ts +13 -1
  46. package/dist/types/internal/app-rail.d.ts +10 -0
  47. package/dist/types/internal/menu-items.d.ts +134 -0
  48. package/dist/zx-zeyos.esm.js +651 -88
  49. package/dist/zx-zeyos.esm.min.js +8 -1
  50. package/dist/zx.css +6266 -3900
  51. package/dist/zx.esm.js +8487 -1805
  52. package/dist/zx.esm.min.js +10 -3
  53. package/dist/zx.global.js +8487 -1805
  54. package/dist/zx.global.min.js +10 -3
  55. package/dist/zx.min.css +1 -1
  56. package/docs/api.json +1811 -247
  57. package/docs/llms.md +345 -40
  58. package/docs/llms.txt +11 -7
  59. package/package.json +1 -2
  60. package/src/components/activity-item/activity-item.css +137 -0
  61. package/src/components/activity-item/activity-item.js +599 -0
  62. package/src/components/activity-list/activity-list.css +64 -0
  63. package/src/components/activity-list/activity-list.js +375 -0
  64. package/src/components/app-rail/app-rail.css +227 -19
  65. package/src/components/app-sidebar/app-sidebar.css +414 -24
  66. package/src/components/app-sidebar/app-sidebar.js +65 -5
  67. package/src/components/button/button.css +8 -0
  68. package/src/components/button/button.js +6 -1
  69. package/src/components/calendar/calendar-model.js +45 -0
  70. package/src/components/calendar/calendar.css +30 -10
  71. package/src/components/calendar/calendar.js +41 -13
  72. package/src/components/card/card.js +12 -1
  73. package/src/components/card-view/card-view.css +212 -9
  74. package/src/components/card-view/card-view.js +32 -16
  75. package/src/components/card-view/record-card.js +98 -21
  76. package/src/components/code-editor/code-editor.css +67 -0
  77. package/src/components/code-editor/code-editor.js +288 -0
  78. package/src/components/code-editor/field-adapter.js +34 -0
  79. package/src/components/context-menu/context-menu.css +80 -3
  80. package/src/components/context-menu/context-menu.js +22 -30
  81. package/src/components/date-picker/date-picker.js +22 -8
  82. package/src/components/date-picker/month-picker.js +3 -3
  83. package/src/components/date-picker/time-picker.js +20 -8
  84. package/src/components/dialog/dialog.js +88 -66
  85. package/src/components/dropdown/dropdown.js +2 -2
  86. package/src/components/entity-ref/entity-ref.css +182 -0
  87. package/src/components/entity-ref/entity-ref.js +496 -0
  88. package/src/components/file-item/file-item.css +88 -0
  89. package/src/components/file-item/file-item.js +371 -0
  90. package/src/components/file-list/file-list.css +51 -0
  91. package/src/components/file-list/file-list.js +320 -0
  92. package/src/components/filter/filter.css +27 -1
  93. package/src/components/filter/filter.js +199 -45
  94. package/src/components/filter-panel/filter-panel.css +104 -0
  95. package/src/components/filter-panel/filter-panel.js +964 -0
  96. package/src/components/kanban-view/kanban-card.js +239 -0
  97. package/src/components/kanban-view/kanban-policy.js +412 -0
  98. package/src/components/kanban-view/kanban-view.css +674 -36
  99. package/src/components/kanban-view/kanban-view.js +1762 -240
  100. package/src/components/launcher/launcher.js +59 -27
  101. package/src/components/list-toolbar/list-toolbar.css +189 -0
  102. package/src/components/list-toolbar/list-toolbar.js +851 -0
  103. package/src/components/menu-button/menu-button.css +80 -3
  104. package/src/components/menu-button/menu-button.js +21 -37
  105. package/src/components/message/message.css +14 -12
  106. package/src/components/message/message.js +13 -2
  107. package/src/components/modal/modal.css +15 -0
  108. package/src/components/modal/modal.js +141 -0
  109. package/src/components/navigation-bar/navigation-bar.css +77 -2
  110. package/src/components/navigation-bar/navigation-bar.js +171 -4
  111. package/src/components/panel/panel.js +13 -2
  112. package/src/components/search/search.js +17 -5
  113. package/src/components/select/field-adapter.js +4 -1
  114. package/src/components/select/select.js +3 -0
  115. package/src/components/sort-control/sort-control.css +17 -0
  116. package/src/components/sort-control/sort-control.js +140 -0
  117. package/src/components/stat-tile/stat-tile.css +213 -0
  118. package/src/components/stat-tile/stat-tile.js +590 -0
  119. package/src/components/tabbox/tabbox.js +12 -1
  120. package/src/components/table/table.css +51 -2
  121. package/src/components/table/table.js +298 -19
  122. package/src/components/table-view/table-view.css +8 -2
  123. package/src/components/table-view/table-view.js +21 -6
  124. package/src/components/tag-picker/tag-picker.css +3 -1
  125. package/src/components/timebox/timebox.js +18 -5
  126. package/src/components/value-list/value-list.js +22 -6
  127. package/src/components/view/record-view.css +5 -0
  128. package/src/components/view/record-view.js +100 -7
  129. package/src/core/component.js +8 -3
  130. package/src/core/icons.js +74 -5
  131. package/src/index.js +33 -3
  132. package/src/internal/app-rail.js +19 -1
  133. package/src/internal/menu-items.js +142 -0
  134. package/styles/print.css +192 -0
  135. package/styles/zx.css +11 -0
  136. package/DESIGN-SYSTEM.md +0 -182
@@ -0,0 +1,331 @@
1
+ import { Component } from '../../core/component.js';
2
+ export type EntityRefContent = string | number | Node | Component | null;
3
+ export type EntityRefIcon = string | Node | Component | (() => string | Node | Component | null) | null;
4
+ export type EntityRefLink = {
5
+ /**
6
+ * Native primary-link destination.
7
+ */
8
+ href: string;
9
+ /**
10
+ * Native browsing context.
11
+ */
12
+ target?: string;
13
+ /**
14
+ * Native link relationship.
15
+ */
16
+ rel?: string;
17
+ /**
18
+ * Native download hint; a string supplies the filename.
19
+ */
20
+ download?: boolean | string;
21
+ /**
22
+ * Optional callback after an uncanceled activation; navigation remains native.
23
+ */
24
+ onclick?: (event: MouseEvent, entity: Readonly<EntityRefState>, component: EntityRef) => void;
25
+ };
26
+ export type EntityRefMetadata = {
27
+ /**
28
+ * Metadata label.
29
+ */
30
+ label: string;
31
+ /**
32
+ * Metadata value.
33
+ */
34
+ value: EntityRefContent;
35
+ /**
36
+ * Optional Zx icon before the value.
37
+ */
38
+ icon?: string | null;
39
+ /**
40
+ * Whether the label is visible instead of visually hidden.
41
+ */
42
+ showLabel?: boolean;
43
+ };
44
+ export type EntityRefAction = {
45
+ /**
46
+ * Stable action identifier.
47
+ */
48
+ id: string;
49
+ /**
50
+ * Visible label.
51
+ */
52
+ label?: string;
53
+ /**
54
+ * Optional Zx icon.
55
+ */
56
+ icon?: string | null;
57
+ /**
58
+ * Accessible/native title, required when the label is empty.
59
+ */
60
+ title?: string;
61
+ /**
62
+ * Optional safe native link destination; otherwise a button is rendered.
63
+ */
64
+ href?: string;
65
+ /**
66
+ * Native link browsing context.
67
+ */
68
+ target?: string;
69
+ /**
70
+ * Native link relationship.
71
+ */
72
+ rel?: string;
73
+ /**
74
+ * Visual intent.
75
+ */
76
+ kind?: 'default' | 'primary' | 'danger' | 'ghost';
77
+ /**
78
+ * Whether activation is unavailable.
79
+ */
80
+ disabled?: boolean;
81
+ /**
82
+ * Callback after an uncanceled activation.
83
+ */
84
+ onselect?: (id: string, action: Readonly<EntityRefAction>, entity: Readonly<EntityRefState>, component: EntityRef) => void;
85
+ };
86
+ export type EntityRefActionEntry = Element | EntityRefAction;
87
+ export type EntityRefLinkValue = string | EntityRefLink | null;
88
+ export type EntityRefOptions = {
89
+ /**
90
+ * Application-owned entity identifier included in events.
91
+ */
92
+ id?: unknown;
93
+ /**
94
+ * Primary identity text.
95
+ */
96
+ title?: string;
97
+ /**
98
+ * Secondary identity text or safe caller-supplied content.
99
+ */
100
+ subtitle?: EntityRefContent;
101
+ /**
102
+ * Icon name, node, component, or lazy renderer.
103
+ */
104
+ icon?: EntityRefIcon;
105
+ /**
106
+ * Labelled dense metadata.
107
+ */
108
+ metadata?: EntityRefMetadata[];
109
+ /**
110
+ * Optional native primary link.
111
+ */
112
+ link?: EntityRefLinkValue;
113
+ /**
114
+ * Secondary controls; element actions keep their own behavior.
115
+ */
116
+ actions?: EntityRefActionEntry[];
117
+ /**
118
+ * Density-independent identity size.
119
+ */
120
+ size?: 'sm' | 'md' | 'lg';
121
+ /**
122
+ * Whether long identity text may wrap instead of truncating.
123
+ */
124
+ wrap?: boolean;
125
+ /**
126
+ * Accessible name for secondary actions.
127
+ */
128
+ actionsLabel?: string;
129
+ /**
130
+ * Preventable primary-link listener.
131
+ */
132
+ onactivate?: (event: CustomEvent<{
133
+ id: unknown;
134
+ entity: Readonly<EntityRefState>;
135
+ href: string;
136
+ event: MouseEvent;
137
+ }>) => void;
138
+ /**
139
+ * Preventable delegated-action listener.
140
+ */
141
+ onaction?: (event: CustomEvent<{
142
+ id: string;
143
+ action: Readonly<EntityRefAction>;
144
+ entity: Readonly<EntityRefState>;
145
+ event: MouseEvent;
146
+ }>) => void;
147
+ };
148
+ export type EntityRefState = {
149
+ /**
150
+ * Entity identifier.
151
+ */
152
+ id: unknown;
153
+ /**
154
+ * Primary identity.
155
+ */
156
+ title: string;
157
+ /**
158
+ * Secondary identity.
159
+ */
160
+ subtitle: EntityRefContent;
161
+ /**
162
+ * Identity icon.
163
+ */
164
+ icon: EntityRefIcon;
165
+ /**
166
+ * Normalized metadata copies.
167
+ */
168
+ metadata: EntityRefMetadata[];
169
+ /**
170
+ * Safe native link.
171
+ */
172
+ link: EntityRefLink | null;
173
+ /**
174
+ * Normalized action copies or elements.
175
+ */
176
+ actions: EntityRefActionEntry[];
177
+ /**
178
+ * Presentation size.
179
+ */
180
+ size: 'sm' | 'md' | 'lg';
181
+ /**
182
+ * Wrapping state.
183
+ */
184
+ wrap: boolean;
185
+ /**
186
+ * Action-group label.
187
+ */
188
+ actionsLabel: string;
189
+ };
190
+ /** @typedef {string|number|Node|Component|null} EntityRefContent */
191
+ /** @typedef {string|Node|Component|(()=>string|Node|Component|null)|null} EntityRefIcon */
192
+ /**
193
+ * @typedef {Object} EntityRefLink
194
+ * @property {string} href Native primary-link destination.
195
+ * @property {string} [target] Native browsing context.
196
+ * @property {string} [rel] Native link relationship.
197
+ * @property {boolean|string} [download] Native download hint; a string supplies the filename.
198
+ * @property {(event: MouseEvent, entity: Readonly<EntityRefState>, component: EntityRef) => void} [onclick]
199
+ * Optional callback after an uncanceled activation; navigation remains native.
200
+ */
201
+ /**
202
+ * @typedef {Object} EntityRefMetadata
203
+ * @property {string} label Metadata label.
204
+ * @property {EntityRefContent} value Metadata value.
205
+ * @property {string|null} [icon=null] Optional Zx icon before the value.
206
+ * @property {boolean} [showLabel=true] Whether the label is visible instead of visually hidden.
207
+ */
208
+ /**
209
+ * @typedef {Object} EntityRefAction
210
+ * @property {string} id Stable action identifier.
211
+ * @property {string} [label=''] Visible label.
212
+ * @property {string|null} [icon=null] Optional Zx icon.
213
+ * @property {string} [title] Accessible/native title, required when the label is empty.
214
+ * @property {string} [href] Optional safe native link destination; otherwise a button is rendered.
215
+ * @property {string} [target] Native link browsing context.
216
+ * @property {string} [rel] Native link relationship.
217
+ * @property {'default'|'primary'|'danger'|'ghost'} [kind='ghost'] Visual intent.
218
+ * @property {boolean} [disabled=false] Whether activation is unavailable.
219
+ * @property {(id: string, action: Readonly<EntityRefAction>, entity: Readonly<EntityRefState>, component: EntityRef) => void} [onselect]
220
+ * Callback after an uncanceled activation.
221
+ */
222
+ /** @typedef {Element|EntityRefAction} EntityRefActionEntry */
223
+ /** @typedef {string|EntityRefLink|null} EntityRefLinkValue */
224
+ /**
225
+ * @typedef {Object} EntityRefOptions
226
+ * @property {unknown} [id=null] Application-owned entity identifier included in events.
227
+ * @property {string} [title=''] Primary identity text.
228
+ * @property {EntityRefContent} [subtitle=null] Secondary identity text or safe caller-supplied content.
229
+ * @property {EntityRefIcon} [icon=null] Icon name, node, component, or lazy renderer.
230
+ * @property {EntityRefMetadata[]} [metadata=[]] Labelled dense metadata.
231
+ * @property {EntityRefLinkValue} [link=null] Optional native primary link.
232
+ * @property {EntityRefActionEntry[]} [actions=[]] Secondary controls; element actions keep their own behavior.
233
+ * @property {'sm'|'md'|'lg'} [size='md'] Density-independent identity size.
234
+ * @property {boolean} [wrap=false] Whether long identity text may wrap instead of truncating.
235
+ * @property {string} [actionsLabel='Entity actions'] Accessible name for secondary actions.
236
+ * @property {(event: CustomEvent<{id: unknown, entity: Readonly<EntityRefState>, href: string, event: MouseEvent}>) => void} [onactivate]
237
+ * Preventable primary-link listener.
238
+ * @property {(event: CustomEvent<{id: string, action: Readonly<EntityRefAction>, entity: Readonly<EntityRefState>, event: MouseEvent}>) => void} [onaction]
239
+ * Preventable delegated-action listener.
240
+ */
241
+ /**
242
+ * @typedef {Object} EntityRefState
243
+ * @property {unknown} id Entity identifier.
244
+ * @property {string} title Primary identity.
245
+ * @property {EntityRefContent} subtitle Secondary identity.
246
+ * @property {EntityRefIcon} icon Identity icon.
247
+ * @property {EntityRefMetadata[]} metadata Normalized metadata copies.
248
+ * @property {EntityRefLink|null} link Safe native link.
249
+ * @property {EntityRefActionEntry[]} actions Normalized action copies or elements.
250
+ * @property {'sm'|'md'|'lg'} size Presentation size.
251
+ * @property {boolean} wrap Wrapping state.
252
+ * @property {string} actionsLabel Action-group label.
253
+ */
254
+ /**
255
+ * Dense entity identity for tables, feeds, selectors, and detail metadata. It owns presentation and
256
+ * safe native-link/action semantics; routing, permissions, context menus, and persistence remain
257
+ * application-owned.
258
+ * @fires EntityRef#activate
259
+ * @fires EntityRef#action
260
+ * @extends {Component<EntityRefOptions>}
261
+ */
262
+ export declare class EntityRef extends Component<EntityRefOptions> {
263
+ _createdRoot: boolean;
264
+ _snapshot: import("../../core/dom.js").TargetSnapshot;
265
+ _destroyed: boolean;
266
+ _state: EntityRefState;
267
+ _renderedActions: any[] | EntityRefActionEntry[];
268
+ static cssName: string;
269
+ /** @type {Readonly<EntityRefOptions>} */
270
+ static defaults: Readonly<EntityRefOptions>;
271
+ /**
272
+ * Creates or enhances a dense entity reference.
273
+ * @param {Element|string|null} [target=null] Existing host, selector, or null.
274
+ * @param {EntityRefOptions} [options={}] Entity presentation.
275
+ */
276
+ constructor(target?: Element | string | null, options?: EntityRefOptions);
277
+ /** @returns {HTMLElement} */
278
+ render(): HTMLElement;
279
+ /**
280
+ * Updates any subset of the identity without replacing the root.
281
+ * @param {Partial<EntityRefOptions>} values Next values.
282
+ * @returns {this}
283
+ */
284
+ set(values?: Partial<EntityRefOptions>): this;
285
+ /** Replaces the metadata collection. @param {EntityRefMetadata[]} metadata Metadata. @returns {this} */
286
+ setMetadata(metadata: EntityRefMetadata[]): this;
287
+ /** Replaces the secondary action controls. @param {EntityRefActionEntry[]} actions Actions. @returns {this} */
288
+ setActions(actions: EntityRefActionEntry[]): this;
289
+ /** Sets or clears the primary link. @param {EntityRefLinkValue} link Link. @returns {this} */
290
+ setLink(link: EntityRefLinkValue): this;
291
+ /**
292
+ * Returns a defensive presentation snapshot. Caller-supplied Nodes and Components retain their
293
+ * identity; arrays and descriptors are copied.
294
+ * @returns {Readonly<EntityRefState>}
295
+ */
296
+ getEntity(): Readonly<EntityRefState>;
297
+ /** Focuses the primary link or the first enabled action. @returns {this} */
298
+ focus(): this;
299
+ /** Restores an enhanced target exactly, or removes an owned reference. @returns {void} */
300
+ destroy(): void;
301
+ /** @returns {void} */
302
+ _sync(): void;
303
+ /** @param {MouseEvent} event @returns {void} */
304
+ _handleClick(event: MouseEvent): void;
305
+ }
306
+ /**
307
+ * Normalizes an entity-reference contract without touching the DOM.
308
+ * @param {Partial<EntityRefOptions>|null|undefined} values Candidate values.
309
+ * @returns {EntityRefState}
310
+ */
311
+ export declare function normalizeEntityRef(values?: Partial<EntityRefOptions> | null | undefined): EntityRefState;
312
+ /**
313
+ * Normalizes and secures a primary native link.
314
+ * @param {EntityRefLinkValue|unknown} value Candidate link.
315
+ * @returns {EntityRefLink|null}
316
+ */
317
+ export declare function normalizeEntityRefLink(value: EntityRefLinkValue | unknown): EntityRefLink | null;
318
+ /**
319
+ * Normalizes labelled metadata, omitting entries without a label or displayable value.
320
+ * @param {unknown} values Candidate metadata.
321
+ * @returns {EntityRefMetadata[]}
322
+ */
323
+ export declare function normalizeEntityRefMetadata(values: unknown): EntityRefMetadata[];
324
+ /**
325
+ * Normalizes delegated actions while preserving caller-supplied Elements.
326
+ * @param {unknown} values Candidate actions.
327
+ * @returns {EntityRefActionEntry[]}
328
+ */
329
+ export declare function normalizeEntityRefActions(values: unknown): EntityRefActionEntry[];
330
+ /** Fired when the native primary link is activated. @event EntityRef#activate @type {CustomEvent<{id: unknown, entity: Readonly<EntityRefState>, href: string, event: MouseEvent}>} */
331
+ /** Fired when a delegated secondary action is activated. @event EntityRef#action @type {CustomEvent<{id: string, action: Readonly<EntityRefAction>, entity: Readonly<EntityRefState>, event: MouseEvent}>} */
@@ -0,0 +1,234 @@
1
+ import { Component } from '../../core/component.js';
2
+ import { EntityRef } from '../entity-ref/entity-ref.js';
3
+ export type EntityRefContent = import('../entity-ref/entity-ref.js').EntityRefContent;
4
+ export type EntityRefIcon = import('../entity-ref/entity-ref.js').EntityRefIcon;
5
+ export type EntityRefMetadata = import('../entity-ref/entity-ref.js').EntityRefMetadata;
6
+ export type EntityRefLinkValue = import('../entity-ref/entity-ref.js').EntityRefLinkValue;
7
+ export type EntityRefActionEntry = import('../entity-ref/entity-ref.js').EntityRefActionEntry;
8
+ export type FileStatus = 'ready' | 'temporary' | 'waiting' | 'uploading' | 'processing' | 'success' | 'error';
9
+ export type FileItemOptions = {
10
+ /**
11
+ * Application-owned file identifier included in events.
12
+ */
13
+ id?: unknown;
14
+ /**
15
+ * File name.
16
+ */
17
+ name?: string;
18
+ /**
19
+ * Byte count; invalid and negative values are omitted.
20
+ */
21
+ size?: number | string | null;
22
+ /**
23
+ * MIME type.
24
+ */
25
+ mime?: string;
26
+ /**
27
+ * Optional supporting text before generated metadata.
28
+ */
29
+ subtitle?: EntityRefContent;
30
+ /**
31
+ * File icon name, node, component, or lazy renderer.
32
+ */
33
+ icon?: EntityRefIcon;
34
+ /**
35
+ * Additional labelled metadata.
36
+ */
37
+ metadata?: EntityRefMetadata[];
38
+ /**
39
+ * Optional safe native file/download link.
40
+ */
41
+ link?: EntityRefLinkValue;
42
+ /**
43
+ * File actions; application policy stays external.
44
+ */
45
+ actions?: EntityRefActionEntry[];
46
+ /**
47
+ * Durable or transient presentation state.
48
+ */
49
+ status?: FileStatus;
50
+ /**
51
+ * Overrides the generated state label; an empty string hides it.
52
+ */
53
+ statusLabel?: string | null;
54
+ /**
55
+ * Completed percentage, clamped to 0–100.
56
+ */
57
+ progress?: number | null;
58
+ /**
59
+ * Whether active progress has no known amount.
60
+ */
61
+ indeterminate?: boolean;
62
+ /**
63
+ * File-identity presentation size.
64
+ */
65
+ density?: 'sm' | 'md' | 'lg';
66
+ /**
67
+ * Whether long identity text may wrap.
68
+ */
69
+ wrap?: boolean;
70
+ /**
71
+ * Accessible name for secondary actions.
72
+ */
73
+ actionsLabel?: string;
74
+ /**
75
+ * Locale passed to `formatFileSize`.
76
+ */
77
+ locale?: string;
78
+ /**
79
+ * Preventable native-link listener.
80
+ */
81
+ onactivate?: (event: CustomEvent<{
82
+ id: unknown;
83
+ file: Readonly<FileItemState>;
84
+ href: string;
85
+ event: MouseEvent;
86
+ }>) => void;
87
+ /**
88
+ * Preventable file-action listener.
89
+ */
90
+ onaction?: (event: CustomEvent<{
91
+ id: string;
92
+ fileId: unknown;
93
+ action: object;
94
+ file: Readonly<FileItemState>;
95
+ event: MouseEvent;
96
+ }>) => void;
97
+ };
98
+ export type FileItemState = {
99
+ /**
100
+ * File identifier.
101
+ */
102
+ id: unknown;
103
+ /**
104
+ * File name.
105
+ */
106
+ name: string;
107
+ /**
108
+ * Byte count.
109
+ */
110
+ size: number | null;
111
+ /**
112
+ * MIME type.
113
+ */
114
+ mime: string;
115
+ /**
116
+ * Supporting content.
117
+ */
118
+ subtitle: EntityRefContent;
119
+ /**
120
+ * File visual.
121
+ */
122
+ icon: EntityRefIcon;
123
+ /**
124
+ * Additional metadata.
125
+ */
126
+ metadata: EntityRefMetadata[];
127
+ /**
128
+ * Safe native link.
129
+ */
130
+ link: import('../entity-ref/entity-ref.js').EntityRefLink | null;
131
+ /**
132
+ * Normalized actions.
133
+ */
134
+ actions: EntityRefActionEntry[];
135
+ /**
136
+ * Presentation state.
137
+ */
138
+ status: FileStatus;
139
+ /**
140
+ * Explicit state label, or null for the generated label.
141
+ */
142
+ statusLabel: string | null;
143
+ /**
144
+ * Completed percentage.
145
+ */
146
+ progress: number | null;
147
+ /**
148
+ * Unknown-progress state.
149
+ */
150
+ indeterminate: boolean;
151
+ /**
152
+ * Identity size.
153
+ */
154
+ density: 'sm' | 'md' | 'lg';
155
+ /**
156
+ * Wrapping state.
157
+ */
158
+ wrap: boolean;
159
+ /**
160
+ * Action-group label.
161
+ */
162
+ actionsLabel: string;
163
+ /**
164
+ * File-size locale.
165
+ */
166
+ locale: string | undefined;
167
+ };
168
+ /**
169
+ * Durable or transient file presentation. The host owns upload/download transport, authorization,
170
+ * preview behavior, retry policy, and persistence.
171
+ * @fires FileItem#activate
172
+ * @fires FileItem#action
173
+ * @extends {Component<FileItemOptions>}
174
+ */
175
+ export declare class FileItem extends Component<FileItemOptions> {
176
+ _createdRoot: boolean;
177
+ _snapshot: import("../../core/dom.js").TargetSnapshot;
178
+ _destroyed: boolean;
179
+ _state: FileItemState;
180
+ _entity: EntityRef;
181
+ static cssName: string;
182
+ /** @type {Readonly<FileItemOptions>} */
183
+ static defaults: Readonly<FileItemOptions>;
184
+ /**
185
+ * Creates or enhances a file row.
186
+ * @param {Element|string|null} [target=null] Existing host, selector, or null.
187
+ * @param {FileItemOptions} [options={}] File presentation.
188
+ */
189
+ constructor(target?: Element | string | null, options?: FileItemOptions);
190
+ /** @returns {HTMLElement} */
191
+ render(): HTMLElement;
192
+ /**
193
+ * Updates any subset of the file without replacing the row root.
194
+ * @param {Partial<FileItemOptions>} values Next values.
195
+ * @returns {this}
196
+ */
197
+ set(values?: Partial<FileItemOptions>): this;
198
+ /**
199
+ * Updates the file lifecycle state and, optionally, its visible label.
200
+ * @param {FileStatus} status State.
201
+ * @param {string|null} [statusLabel] Explicit label.
202
+ * @returns {this}
203
+ */
204
+ setStatus(status: FileStatus, statusLabel?: string | null): this;
205
+ /**
206
+ * Updates the progress meter.
207
+ * @param {number|null} progress Completed percentage, or null.
208
+ * @param {{indeterminate?: boolean}} [options={}] Unknown-progress override.
209
+ * @returns {this}
210
+ */
211
+ setProgress(progress: number | null, { indeterminate }?: {
212
+ indeterminate?: boolean;
213
+ }): this;
214
+ /** Returns a defensive file snapshot. @returns {Readonly<FileItemState>} */
215
+ getFile(): Readonly<FileItemState>;
216
+ /** Focuses the native destination or first enabled action. @returns {this} */
217
+ focus(): this;
218
+ /** Restores an enhanced target exactly, or removes an owned row. @returns {void} */
219
+ destroy(): void;
220
+ /** @returns {void} */
221
+ _sync(): void;
222
+ /** @param {CustomEvent} event @returns {void} */
223
+ _forwardActivate(event: CustomEvent): void;
224
+ /** @param {CustomEvent} event @returns {void} */
225
+ _forwardAction(event: CustomEvent): void;
226
+ }
227
+ /**
228
+ * Normalizes a file presentation without touching the DOM.
229
+ * @param {Partial<FileItemOptions>|null|undefined} values Candidate values.
230
+ * @returns {FileItemState}
231
+ */
232
+ export declare function normalizeFileItem(values?: Partial<FileItemOptions> | null | undefined): FileItemState;
233
+ /** Fired before a native file link continues. @event FileItem#activate @type {CustomEvent<{id: unknown, file: Readonly<FileItemState>, href: string, event: MouseEvent}>} */
234
+ /** Fired before a descriptor action callback runs. @event FileItem#action @type {CustomEvent<{id: string, fileId: unknown, action: object, file: Readonly<FileItemState>, event: MouseEvent}>} */