@zeyos/zx 4.3.4 → 5.0.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 +438 -0
- package/README.md +49 -10
- package/dist/types/components/activity-item/activity-item.d.ts +351 -0
- package/dist/types/components/activity-list/activity-list.d.ts +217 -0
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +33 -3
- package/dist/types/components/avatar/avatar.d.ts +46 -7
- package/dist/types/components/badge/badge.d.ts +21 -1
- package/dist/types/components/button/button.d.ts +23 -0
- package/dist/types/components/calendar/calendar.d.ts +19 -0
- package/dist/types/components/card/card.d.ts +7 -0
- package/dist/types/components/card-view/card-view.d.ts +11 -3
- package/dist/types/components/card-view/record-card.d.ts +7 -1
- package/dist/types/components/chart/chart.d.ts +10 -0
- package/dist/types/components/checklist/checklist.d.ts +9 -0
- package/dist/types/components/code-editor/code-editor.d.ts +149 -0
- package/dist/types/components/code-editor/field-adapter.d.ts +5 -0
- package/dist/types/components/context-menu/context-menu.d.ts +18 -2
- package/dist/types/components/date-picker/date-picker.d.ts +8 -0
- package/dist/types/components/date-picker/time-picker.d.ts +7 -0
- package/dist/types/components/datebox/date-range-box.d.ts +5 -1
- package/dist/types/components/datebox/datebox.d.ts +7 -2
- package/dist/types/components/dialog/dialog.d.ts +75 -6
- package/dist/types/components/dropdown/dropdown.d.ts +2 -2
- package/dist/types/components/entity-ref/entity-ref.d.ts +331 -0
- package/dist/types/components/field/field.d.ts +24 -2
- package/dist/types/components/fieldset/fieldset.d.ts +19 -1
- package/dist/types/components/file-item/file-item.d.ts +262 -0
- package/dist/types/components/file-list/file-list.d.ts +171 -0
- package/dist/types/components/filter/filter.d.ts +91 -36
- package/dist/types/components/filter-panel/filter-panel.d.ts +449 -0
- package/dist/types/components/form/form.d.ts +12 -1
- package/dist/types/components/kanban-view/kanban-card.d.ts +146 -0
- package/dist/types/components/kanban-view/kanban-view.d.ts +170 -4
- package/dist/types/components/launcher/launcher.d.ts +278 -26
- package/dist/types/components/list-toolbar/list-toolbar.d.ts +599 -0
- package/dist/types/components/menu-button/menu-button.d.ts +37 -42
- package/dist/types/components/message/message.d.ts +126 -17
- package/dist/types/components/modal/modal.d.ts +61 -2
- package/dist/types/components/navigation-bar/navigation-bar.d.ts +105 -21
- package/dist/types/components/panel/panel.d.ts +7 -0
- package/dist/types/components/search/search.d.ts +7 -0
- package/dist/types/components/select/color.d.ts +12 -0
- package/dist/types/components/select/glyphs.d.ts +124 -0
- package/dist/types/components/select/select.d.ts +15 -3
- package/dist/types/components/sort-control/sort-control.d.ts +105 -0
- package/dist/types/components/stat-tile/stat-tile.d.ts +288 -0
- package/dist/types/components/tabbox/tabbox.d.ts +16 -0
- package/dist/types/components/table/table.d.ts +190 -1
- package/dist/types/components/table-view/table-view.d.ts +11 -5
- package/dist/types/components/tag-picker/tag-picker.d.ts +21 -4
- package/dist/types/components/timebox/timebox.d.ts +7 -0
- package/dist/types/components/tree/tree.d.ts +13 -0
- package/dist/types/components/value-list/value-list.d.ts +8 -0
- package/dist/types/components/view/record-view.d.ts +96 -5
- package/dist/types/core/breakpoint.d.ts +1 -1
- package/dist/types/core/icons.d.ts +37 -22
- package/dist/types/core/motion.d.ts +59 -0
- package/dist/types/core/overlay-host.d.ts +15 -1
- package/dist/types/index.d.ts +16 -3
- package/dist/types/internal/app-rail.d.ts +10 -0
- package/dist/types/internal/menu-items.d.ts +134 -0
- package/dist/types/zeyos/connect.d.ts +6 -0
- package/dist/types/zeyos/form.d.ts +50 -9
- package/dist/types/zeyos/index.d.ts +1 -1
- package/dist/types/zeyos/query.d.ts +79 -0
- package/dist/types/zeyos/schema.d.ts +24 -1
- package/dist/types/zeyos/table.d.ts +100 -14
- package/dist/types/zeyos/view.d.ts +10 -0
- package/dist/zx-zeyos.esm.js +2206 -489
- package/dist/zx-zeyos.esm.min.js +56 -1
- package/dist/zx.css +3322 -724
- package/dist/zx.esm.js +12244 -5809
- package/dist/zx.esm.min.js +58 -3
- package/dist/zx.global.js +12246 -5811
- package/dist/zx.global.min.js +58 -3
- package/dist/zx.min.css +1 -1
- package/docs/api.json +1683 -146
- package/docs/llms.md +777 -110
- package/docs/llms.txt +14 -8
- package/package.json +1 -1
- package/src/components/account-menu/account-menu.css +35 -10
- package/src/components/activity-item/activity-item.css +137 -0
- package/src/components/activity-item/activity-item.js +602 -0
- package/src/components/activity-list/activity-list.css +99 -0
- package/src/components/activity-list/activity-list.js +409 -0
- package/src/components/app-icon/app-icon.css +1 -1
- package/src/components/app-rail/app-rail.css +191 -22
- package/src/components/app-sidebar/app-sidebar.css +349 -24
- package/src/components/app-sidebar/app-sidebar.js +86 -11
- package/src/components/aurora/aurora.css +5 -3
- package/src/components/avatar/avatar.css +32 -7
- package/src/components/avatar/avatar.js +72 -8
- package/src/components/badge/badge.css +54 -2
- package/src/components/badge/badge.js +29 -2
- package/src/components/button/button.css +74 -8
- package/src/components/button/button.js +44 -1
- package/src/components/calendar/calendar.css +46 -46
- package/src/components/calendar/calendar.js +33 -3
- package/src/components/card/card.css +2 -2
- package/src/components/card/card.js +12 -1
- package/src/components/card-view/card-view.css +10 -7
- package/src/components/card-view/card-view.js +25 -9
- package/src/components/card-view/record-card.js +7 -3
- package/src/components/chart/chart.css +4 -1
- package/src/components/chart/chart.js +12 -0
- package/src/components/check-button/check-button.css +10 -2
- package/src/components/checklist/checklist.css +9 -2
- package/src/components/checklist/checklist.js +11 -5
- package/src/components/checklist/field-adapter.js +3 -1
- package/src/components/code-editor/code-editor.css +68 -0
- package/src/components/code-editor/code-editor.js +306 -0
- package/src/components/code-editor/field-adapter.js +34 -0
- package/src/components/context-menu/context-menu.css +87 -5
- package/src/components/context-menu/context-menu.js +22 -30
- package/src/components/copy/copy-button.css +6 -0
- package/src/components/copy/copy-input.css +8 -3
- package/src/components/data-filter/data-filter.css +5 -4
- package/src/components/date-picker/date-picker.css +6 -6
- package/src/components/date-picker/date-picker.js +22 -8
- package/src/components/date-picker/date-range-picker.css +3 -3
- package/src/components/date-picker/month-picker.js +3 -3
- package/src/components/date-picker/time-picker.css +1 -1
- package/src/components/date-picker/time-picker.js +20 -8
- package/src/components/datebox/date-range-box.css +79 -2
- package/src/components/datebox/date-range-box.js +13 -2
- package/src/components/datebox/datebox.css +79 -2
- package/src/components/datebox/datebox.js +13 -2
- package/src/components/dialog/dialog.css +26 -0
- package/src/components/dialog/dialog.js +174 -70
- package/src/components/dropdown/dropdown.css +1 -1
- package/src/components/dropdown/dropdown.js +7 -5
- package/src/components/empty-state/empty-state.css +2 -2
- package/src/components/entity-ref/entity-ref.css +182 -0
- package/src/components/entity-ref/entity-ref.js +496 -0
- package/src/components/field/field.css +28 -9
- package/src/components/field/field.js +68 -26
- package/src/components/field-upload/field-upload.css +1 -1
- package/src/components/fieldset/fieldset.css +5 -3
- package/src/components/fieldset/fieldset.js +28 -5
- package/src/components/file-item/file-item.css +88 -0
- package/src/components/file-item/file-item.js +505 -0
- package/src/components/file-list/file-list.css +51 -0
- package/src/components/file-list/file-list.js +320 -0
- package/src/components/filter/filter.css +27 -1
- package/src/components/filter/filter.js +205 -47
- package/src/components/filter-panel/filter-panel.css +104 -0
- package/src/components/filter-panel/filter-panel.js +964 -0
- package/src/components/finder/finder.css +15 -13
- package/src/components/form/form.css +5 -4
- package/src/components/form/form.js +11 -2
- package/src/components/grid/grid.css +1 -1
- package/src/components/groupbox/groupbox.css +1 -1
- package/src/components/kanban-view/kanban-card.js +247 -0
- package/src/components/kanban-view/kanban-view.css +226 -8
- package/src/components/kanban-view/kanban-view.js +255 -12
- package/src/components/launcher/launcher.css +107 -25
- package/src/components/launcher/launcher.js +557 -63
- package/src/components/list-toolbar/list-toolbar.css +194 -0
- package/src/components/list-toolbar/list-toolbar.js +851 -0
- package/src/components/master-panel/master-panel.css +2 -0
- package/src/components/menu-button/menu-button.css +87 -5
- package/src/components/menu-button/menu-button.js +86 -46
- package/src/components/message/message.css +38 -5
- package/src/components/message/message.js +230 -17
- package/src/components/modal/modal.css +15 -0
- package/src/components/modal/modal.js +159 -3
- package/src/components/navigation-bar/navigation-bar.css +95 -11
- package/src/components/navigation-bar/navigation-bar.js +171 -4
- package/src/components/number-field/field-adapter.js +1 -0
- package/src/components/number-field/number-field.css +70 -0
- package/src/components/number-field/number-field.js +2 -0
- package/src/components/pagination/pagination.css +8 -6
- package/src/components/panel/panel.css +1 -1
- package/src/components/panel/panel.js +13 -2
- package/src/components/rating/rating.css +7 -0
- package/src/components/search/search.js +17 -5
- package/src/components/select/color.js +22 -0
- package/src/components/select/field-adapter.js +6 -1
- package/src/components/select/glyphs.js +165 -0
- package/src/components/select/select.css +138 -45
- package/src/components/select/select.js +86 -47
- package/src/components/sheet/sheet.css +11 -8
- package/src/components/slider/slider.css +16 -2
- package/src/components/slider/slider.js +1 -1
- package/src/components/sort-control/sort-control.css +20 -0
- package/src/components/sort-control/sort-control.js +140 -0
- package/src/components/stat-tile/stat-tile.css +208 -0
- package/src/components/stat-tile/stat-tile.js +601 -0
- package/src/components/tabbox/tabbox.css +32 -27
- package/src/components/tabbox/tabbox.js +17 -2
- package/src/components/table/table.css +155 -31
- package/src/components/table/table.js +386 -33
- package/src/components/table-view/table-view.css +8 -2
- package/src/components/table-view/table-view.js +21 -6
- package/src/components/tag-picker/tag-picker.css +86 -6
- package/src/components/tag-picker/tag-picker.js +25 -8
- package/src/components/timebox/timebox.css +22 -2
- package/src/components/timebox/timebox.js +18 -5
- package/src/components/toggle/toggle.css +12 -1
- package/src/components/toolbar/toolbar.js +2 -2
- package/src/components/tooltip/tooltip.css +4 -0
- package/src/components/tooltip/tooltip.js +10 -3
- package/src/components/tree/tree.css +25 -16
- package/src/components/tree/tree.js +31 -0
- package/src/components/value-list/value-list.css +3 -3
- package/src/components/value-list/value-list.js +22 -6
- package/src/components/view/record-view.css +5 -0
- package/src/components/view/record-view.js +100 -7
- package/src/core/breakpoint.js +1 -1
- package/src/core/icons.js +259 -57
- package/src/core/motion.js +147 -0
- package/src/core/overlay-host.js +21 -2
- package/src/index.js +30 -3
- package/src/internal/app-rail.js +18 -1
- package/src/internal/menu-items.js +142 -0
- package/src/zeyos/connect.js +6 -2
- package/src/zeyos/form.js +67 -27
- package/src/zeyos/index.js +1 -1
- package/src/zeyos/query.js +153 -0
- package/src/zeyos/schema.js +144 -27
- package/src/zeyos/table.js +68 -5
- package/src/zeyos/view.js +6 -0
- package/styles/base.css +56 -0
- package/styles/icons.css +11 -1
- package/styles/print.css +192 -0
- package/styles/tokens/dark.css +113 -37
- package/styles/tokens/global.css +121 -27
- package/styles/tokens/semantic.css +100 -31
- package/styles/tokens/themes.css +7 -6
- package/styles/zx.css +11 -1
- package/styles/tokens/density.css +0 -9
|
@@ -0,0 +1,262 @@
|
|
|
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. Shown as a readable type ("PDF", "Image"), never as
|
|
24
|
+
* the raw string, and used to pick the icon.
|
|
25
|
+
*/
|
|
26
|
+
mime?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Type shown beside the size; null derives it from the
|
|
29
|
+
* MIME type (or the name's extension when the MIME type is unfamiliar), an empty string hides it.
|
|
30
|
+
*/
|
|
31
|
+
typeLabel?: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Optional supporting text before generated metadata.
|
|
34
|
+
*/
|
|
35
|
+
subtitle?: EntityRefContent;
|
|
36
|
+
/**
|
|
37
|
+
* File icon name, node, component, or lazy renderer. The
|
|
38
|
+
* generic `'file'` glyph gives way to one for the MIME type when the active icon set has it.
|
|
39
|
+
*/
|
|
40
|
+
icon?: EntityRefIcon;
|
|
41
|
+
/**
|
|
42
|
+
* Additional labelled metadata.
|
|
43
|
+
*/
|
|
44
|
+
metadata?: EntityRefMetadata[];
|
|
45
|
+
/**
|
|
46
|
+
* Optional safe native file/download link.
|
|
47
|
+
*/
|
|
48
|
+
link?: EntityRefLinkValue;
|
|
49
|
+
/**
|
|
50
|
+
* File actions; application policy stays external.
|
|
51
|
+
*/
|
|
52
|
+
actions?: EntityRefActionEntry[];
|
|
53
|
+
/**
|
|
54
|
+
* Durable or transient presentation state.
|
|
55
|
+
*/
|
|
56
|
+
status?: FileStatus;
|
|
57
|
+
/**
|
|
58
|
+
* Overrides the generated state label; an empty string hides it.
|
|
59
|
+
*/
|
|
60
|
+
statusLabel?: string | null;
|
|
61
|
+
/**
|
|
62
|
+
* Completed percentage, clamped to 0–100.
|
|
63
|
+
*/
|
|
64
|
+
progress?: number | null;
|
|
65
|
+
/**
|
|
66
|
+
* Whether active progress has no known amount.
|
|
67
|
+
*/
|
|
68
|
+
indeterminate?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Size of the file's icon and name.
|
|
71
|
+
*/
|
|
72
|
+
identitySize?: 'sm' | 'md' | 'lg';
|
|
73
|
+
/**
|
|
74
|
+
* Whether long identity text may wrap.
|
|
75
|
+
*/
|
|
76
|
+
wrap?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Accessible name for secondary actions.
|
|
79
|
+
*/
|
|
80
|
+
actionsLabel?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Locale passed to `formatFileSize`.
|
|
83
|
+
*/
|
|
84
|
+
locale?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Preventable native-link listener.
|
|
87
|
+
*/
|
|
88
|
+
onactivate?: (event: CustomEvent<{
|
|
89
|
+
id: unknown;
|
|
90
|
+
file: Readonly<FileItemState>;
|
|
91
|
+
href: string;
|
|
92
|
+
event: MouseEvent;
|
|
93
|
+
}>) => void;
|
|
94
|
+
/**
|
|
95
|
+
* Preventable file-action listener.
|
|
96
|
+
*/
|
|
97
|
+
onaction?: (event: CustomEvent<{
|
|
98
|
+
id: string;
|
|
99
|
+
fileId: unknown;
|
|
100
|
+
action: object;
|
|
101
|
+
file: Readonly<FileItemState>;
|
|
102
|
+
event: MouseEvent;
|
|
103
|
+
}>) => void;
|
|
104
|
+
};
|
|
105
|
+
export type FileItemState = {
|
|
106
|
+
/**
|
|
107
|
+
* File identifier.
|
|
108
|
+
*/
|
|
109
|
+
id: unknown;
|
|
110
|
+
/**
|
|
111
|
+
* File name.
|
|
112
|
+
*/
|
|
113
|
+
name: string;
|
|
114
|
+
/**
|
|
115
|
+
* Byte count.
|
|
116
|
+
*/
|
|
117
|
+
size: number | null;
|
|
118
|
+
/**
|
|
119
|
+
* MIME type.
|
|
120
|
+
*/
|
|
121
|
+
mime: string;
|
|
122
|
+
/**
|
|
123
|
+
* Explicit type label, or null for the one derived from `mime`.
|
|
124
|
+
*/
|
|
125
|
+
typeLabel: string | null;
|
|
126
|
+
/**
|
|
127
|
+
* Supporting content.
|
|
128
|
+
*/
|
|
129
|
+
subtitle: EntityRefContent;
|
|
130
|
+
/**
|
|
131
|
+
* File visual.
|
|
132
|
+
*/
|
|
133
|
+
icon: EntityRefIcon;
|
|
134
|
+
/**
|
|
135
|
+
* Additional metadata.
|
|
136
|
+
*/
|
|
137
|
+
metadata: EntityRefMetadata[];
|
|
138
|
+
/**
|
|
139
|
+
* Safe native link.
|
|
140
|
+
*/
|
|
141
|
+
link: import('../entity-ref/entity-ref.js').EntityRefLink | null;
|
|
142
|
+
/**
|
|
143
|
+
* Normalized actions.
|
|
144
|
+
*/
|
|
145
|
+
actions: EntityRefActionEntry[];
|
|
146
|
+
/**
|
|
147
|
+
* Presentation state.
|
|
148
|
+
*/
|
|
149
|
+
status: FileStatus;
|
|
150
|
+
/**
|
|
151
|
+
* Explicit state label, or null for the generated label.
|
|
152
|
+
*/
|
|
153
|
+
statusLabel: string | null;
|
|
154
|
+
/**
|
|
155
|
+
* Completed percentage.
|
|
156
|
+
*/
|
|
157
|
+
progress: number | null;
|
|
158
|
+
/**
|
|
159
|
+
* Unknown-progress state.
|
|
160
|
+
*/
|
|
161
|
+
indeterminate: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Size of the file's icon and name.
|
|
164
|
+
*/
|
|
165
|
+
identitySize: 'sm' | 'md' | 'lg';
|
|
166
|
+
/**
|
|
167
|
+
* Wrapping state.
|
|
168
|
+
*/
|
|
169
|
+
wrap: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Action-group label.
|
|
172
|
+
*/
|
|
173
|
+
actionsLabel: string;
|
|
174
|
+
/**
|
|
175
|
+
* File-size locale.
|
|
176
|
+
*/
|
|
177
|
+
locale: string | undefined;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Durable or transient file presentation. The host owns upload/download transport, authorization,
|
|
181
|
+
* preview behavior, retry policy, and persistence.
|
|
182
|
+
* @fires FileItem#activate
|
|
183
|
+
* @fires FileItem#action
|
|
184
|
+
* @extends {Component<FileItemOptions>}
|
|
185
|
+
*/
|
|
186
|
+
export declare class FileItem extends Component<FileItemOptions> {
|
|
187
|
+
_createdRoot: boolean;
|
|
188
|
+
_snapshot: import("../../core/dom.js").TargetSnapshot;
|
|
189
|
+
_destroyed: boolean;
|
|
190
|
+
_state: FileItemState;
|
|
191
|
+
_entity: EntityRef;
|
|
192
|
+
static cssName: string;
|
|
193
|
+
/** @type {Readonly<FileItemOptions>} */
|
|
194
|
+
static defaults: Readonly<FileItemOptions>;
|
|
195
|
+
/**
|
|
196
|
+
* Creates or enhances a file row.
|
|
197
|
+
* @param {Element|string|null} [target=null] Existing host, selector, or null.
|
|
198
|
+
* @param {FileItemOptions} [options={}] File presentation.
|
|
199
|
+
*/
|
|
200
|
+
constructor(target?: Element | string | null, options?: FileItemOptions);
|
|
201
|
+
/** @returns {HTMLElement} */
|
|
202
|
+
render(): HTMLElement;
|
|
203
|
+
/**
|
|
204
|
+
* Updates any subset of the file without replacing the row root.
|
|
205
|
+
* @param {Partial<FileItemOptions>} values Next values.
|
|
206
|
+
* @returns {this}
|
|
207
|
+
*/
|
|
208
|
+
set(values?: Partial<FileItemOptions>): this;
|
|
209
|
+
/**
|
|
210
|
+
* Updates the file lifecycle state and, optionally, its visible label.
|
|
211
|
+
* @param {FileStatus} status State.
|
|
212
|
+
* @param {string|null} [statusLabel] Explicit label.
|
|
213
|
+
* @returns {this}
|
|
214
|
+
*/
|
|
215
|
+
setStatus(status: FileStatus, statusLabel?: string | null): this;
|
|
216
|
+
/**
|
|
217
|
+
* Updates the progress meter.
|
|
218
|
+
* @param {number|null} progress Completed percentage, or null.
|
|
219
|
+
* @param {{indeterminate?: boolean}} [options={}] Unknown-progress override.
|
|
220
|
+
* @returns {this}
|
|
221
|
+
*/
|
|
222
|
+
setProgress(progress: number | null, { indeterminate }?: {
|
|
223
|
+
indeterminate?: boolean;
|
|
224
|
+
}): this;
|
|
225
|
+
/** Returns a defensive file snapshot. @returns {Readonly<FileItemState>} */
|
|
226
|
+
getFile(): Readonly<FileItemState>;
|
|
227
|
+
/** Focuses the native destination or first enabled action. @returns {this} */
|
|
228
|
+
focus(): this;
|
|
229
|
+
/** Restores an enhanced target exactly, or removes an owned row. @returns {void} */
|
|
230
|
+
destroy(): void;
|
|
231
|
+
/** @returns {void} */
|
|
232
|
+
_sync(): void;
|
|
233
|
+
/** @param {CustomEvent} event @returns {void} */
|
|
234
|
+
_forwardActivate(event: CustomEvent): void;
|
|
235
|
+
/** @param {CustomEvent} event @returns {void} */
|
|
236
|
+
_forwardAction(event: CustomEvent): void;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Normalizes a file presentation without touching the DOM.
|
|
240
|
+
* @param {Partial<FileItemOptions>|null|undefined} values Candidate values.
|
|
241
|
+
* @returns {FileItemState}
|
|
242
|
+
*/
|
|
243
|
+
export declare function normalizeFileItem(values?: Partial<FileItemOptions> | null | undefined): FileItemState;
|
|
244
|
+
/**
|
|
245
|
+
* A readable name for a file's type: "PDF", "CSV", "Image", "Spreadsheet". An unfamiliar MIME type
|
|
246
|
+
* falls back to the name's extension in capitals ("EXE"); without a MIME type, or with neither,
|
|
247
|
+
* the result is empty — a raw MIME string is never shown.
|
|
248
|
+
* @param {string} mime MIME type, possibly with parameters (`text/csv; charset=utf-8`).
|
|
249
|
+
* @param {string} [name=''] File name, consulted only when the MIME type is unfamiliar.
|
|
250
|
+
* @returns {string}
|
|
251
|
+
*/
|
|
252
|
+
export declare function fileTypeLabel(mime: string, name?: string): string;
|
|
253
|
+
/**
|
|
254
|
+
* The icon name for a MIME type: a type-specific glyph when the active icon set can draw one,
|
|
255
|
+
* `'file'` otherwise. Font Awesome resolves every name it is given; the bundled inline set only
|
|
256
|
+
* those it carries or that `registerIcons()` added, so a missing glyph never shows a placeholder.
|
|
257
|
+
* @param {string} mime MIME type, possibly with parameters.
|
|
258
|
+
* @returns {string}
|
|
259
|
+
*/
|
|
260
|
+
export declare function fileTypeIcon(mime: string): string;
|
|
261
|
+
/** Fired before a native file link continues. @event FileItem#activate @type {CustomEvent<{id: unknown, file: Readonly<FileItemState>, href: string, event: MouseEvent}>} */
|
|
262
|
+
/** Fired before a descriptor action callback runs. @event FileItem#action @type {CustomEvent<{id: string, fileId: unknown, action: object, file: Readonly<FileItemState>, event: MouseEvent}>} */
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Component } from '../../core/component.js';
|
|
2
|
+
import { FileItem } from '../file-item/file-item.js';
|
|
3
|
+
export type FileItemOptions = import('../file-item/file-item.js').FileItemOptions;
|
|
4
|
+
export type FileItemState = import('../file-item/file-item.js').FileItemState;
|
|
5
|
+
export type FileListOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* Initial files in host-supplied order.
|
|
8
|
+
*/
|
|
9
|
+
items?: FileItemOptions[];
|
|
10
|
+
/**
|
|
11
|
+
* Accessible collection name.
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether initial or incremental files are loading.
|
|
16
|
+
*/
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Placeholder rows shown for an empty loading list.
|
|
20
|
+
*/
|
|
21
|
+
loadingCount?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Loading status text.
|
|
24
|
+
*/
|
|
25
|
+
loadingText?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Empty-state content.
|
|
28
|
+
*/
|
|
29
|
+
emptyText?: string | number | Node | Component | null;
|
|
30
|
+
/**
|
|
31
|
+
* Preventable native-file-link listener.
|
|
32
|
+
*/
|
|
33
|
+
onactivate?: (event: CustomEvent<{
|
|
34
|
+
id: unknown;
|
|
35
|
+
index: number;
|
|
36
|
+
file: Readonly<FileItemState>;
|
|
37
|
+
href: string;
|
|
38
|
+
event: MouseEvent;
|
|
39
|
+
}>) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Preventable file-action listener.
|
|
42
|
+
*/
|
|
43
|
+
onaction?: (event: CustomEvent<{
|
|
44
|
+
id: string;
|
|
45
|
+
fileId: unknown;
|
|
46
|
+
index: number;
|
|
47
|
+
action: object;
|
|
48
|
+
file: Readonly<FileItemState>;
|
|
49
|
+
event: MouseEvent;
|
|
50
|
+
}>) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Collection mutation listener.
|
|
53
|
+
*/
|
|
54
|
+
ondatachange?: (event: CustomEvent<{
|
|
55
|
+
items: Readonly<FileItemState>[];
|
|
56
|
+
}>) => void;
|
|
57
|
+
};
|
|
58
|
+
/** @typedef {import('../file-item/file-item.js').FileItemOptions} FileItemOptions */
|
|
59
|
+
/** @typedef {import('../file-item/file-item.js').FileItemState} FileItemState */
|
|
60
|
+
/**
|
|
61
|
+
* @typedef {Object} FileListOptions
|
|
62
|
+
* @property {FileItemOptions[]} [items=[]] Initial files in host-supplied order.
|
|
63
|
+
* @property {string} [label='Files'] Accessible collection name.
|
|
64
|
+
* @property {boolean} [loading=false] Whether initial or incremental files are loading.
|
|
65
|
+
* @property {number} [loadingCount=3] Placeholder rows shown for an empty loading list.
|
|
66
|
+
* @property {string} [loadingText='Loading files'] Loading status text.
|
|
67
|
+
* @property {string|number|Node|Component|null} [emptyText='No files'] Empty-state content.
|
|
68
|
+
* @property {(event: CustomEvent<{id: unknown, index: number, file: Readonly<FileItemState>, href: string, event: MouseEvent}>) => void} [onactivate]
|
|
69
|
+
* Preventable native-file-link listener.
|
|
70
|
+
* @property {(event: CustomEvent<{id: string, fileId: unknown, index: number, action: object, file: Readonly<FileItemState>, event: MouseEvent}>) => void} [onaction]
|
|
71
|
+
* Preventable file-action listener.
|
|
72
|
+
* @property {(event: CustomEvent<{items: Readonly<FileItemState>[]}>) => void} [ondatachange]
|
|
73
|
+
* Collection mutation listener.
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* Accessible collection for durable and transient files. Ordering and mutation are local
|
|
77
|
+
* presentation concerns only; transport, authorization, and persistence remain host-owned.
|
|
78
|
+
* @fires FileList#activate
|
|
79
|
+
* @fires FileList#action
|
|
80
|
+
* @fires FileList#datachange
|
|
81
|
+
* @extends {Component<FileListOptions>}
|
|
82
|
+
*/
|
|
83
|
+
export declare class FileList extends Component<FileListOptions> {
|
|
84
|
+
_createdRoot: boolean;
|
|
85
|
+
_snapshot: import("../../core/dom.js").TargetSnapshot;
|
|
86
|
+
_destroyed: boolean;
|
|
87
|
+
_items: import("../file-item/file-item.js").FileItemState[];
|
|
88
|
+
_loading: any;
|
|
89
|
+
_itemComponents: any[];
|
|
90
|
+
static cssName: string;
|
|
91
|
+
/** @type {Readonly<FileListOptions>} */
|
|
92
|
+
static defaults: Readonly<FileListOptions>;
|
|
93
|
+
/**
|
|
94
|
+
* Creates or enhances a file collection.
|
|
95
|
+
* @param {Element|string|null} [target=null] Existing host, selector, or null.
|
|
96
|
+
* @param {FileListOptions} [options={}] Collection presentation.
|
|
97
|
+
*/
|
|
98
|
+
constructor(target?: Element | string | null, options?: FileListOptions);
|
|
99
|
+
/** @returns {HTMLElement} */
|
|
100
|
+
render(): HTMLElement;
|
|
101
|
+
/**
|
|
102
|
+
* Replaces every file.
|
|
103
|
+
* @param {FileItemOptions[]} items Ordered file descriptors.
|
|
104
|
+
* @param {{silent?:boolean}} [options={}] Event behavior.
|
|
105
|
+
* @returns {this}
|
|
106
|
+
*/
|
|
107
|
+
setItems(items: FileItemOptions[], options?: {
|
|
108
|
+
silent?: boolean;
|
|
109
|
+
}): this;
|
|
110
|
+
/** Returns defensive snapshots in display order. @returns {Readonly<FileItemState>[]} */
|
|
111
|
+
getItems(): Readonly<FileItemState>[];
|
|
112
|
+
/** Returns a defensive snapshot by stable ID. @param {unknown} id File id. @returns {Readonly<FileItemState>|null} */
|
|
113
|
+
getItem(id: unknown): Readonly<FileItemState> | null;
|
|
114
|
+
/**
|
|
115
|
+
* Adds one file at a bounded index.
|
|
116
|
+
* @param {FileItemOptions} item File descriptor.
|
|
117
|
+
* @param {number} [index] Insertion position; omitted means append.
|
|
118
|
+
* @param {{silent?:boolean}} [options={}] Event behavior.
|
|
119
|
+
* @returns {this}
|
|
120
|
+
*/
|
|
121
|
+
addItem(item: FileItemOptions, index?: number, options?: {
|
|
122
|
+
silent?: boolean;
|
|
123
|
+
}): this;
|
|
124
|
+
/**
|
|
125
|
+
* Patches the first file whose ID is `Object.is`-equal to `id`.
|
|
126
|
+
* @param {unknown} id File id.
|
|
127
|
+
* @param {Partial<FileItemOptions>} values Replacement fields.
|
|
128
|
+
* @param {{silent?:boolean}} [options={}] Event behavior.
|
|
129
|
+
* @returns {this}
|
|
130
|
+
*/
|
|
131
|
+
updateItem(id: unknown, values: Partial<FileItemOptions>, options?: {
|
|
132
|
+
silent?: boolean;
|
|
133
|
+
}): this;
|
|
134
|
+
/**
|
|
135
|
+
* Removes the first file whose ID is `Object.is`-equal to `id`.
|
|
136
|
+
* @param {unknown} id File id.
|
|
137
|
+
* @param {{silent?:boolean}} [options={}] Event behavior.
|
|
138
|
+
* @returns {this}
|
|
139
|
+
*/
|
|
140
|
+
removeItem(id: unknown, options?: {
|
|
141
|
+
silent?: boolean;
|
|
142
|
+
}): this;
|
|
143
|
+
/** Sets initial/incremental loading presentation. @param {boolean} loading Loading state. @returns {this} */
|
|
144
|
+
setLoading(loading: boolean): this;
|
|
145
|
+
/** Restores an enhanced target exactly, or removes an owned collection. @returns {void} */
|
|
146
|
+
destroy(): void;
|
|
147
|
+
/** @returns {void} */
|
|
148
|
+
_renderList(): void;
|
|
149
|
+
/** @param {boolean} placeholders @returns {HTMLElement} */
|
|
150
|
+
_createLoading(placeholders: boolean): HTMLElement;
|
|
151
|
+
/** @returns {void} */
|
|
152
|
+
_destroyItems(): void;
|
|
153
|
+
/** @param {CustomEvent} event @returns {void} */
|
|
154
|
+
_forwardActivate(event: CustomEvent): void;
|
|
155
|
+
/** @param {CustomEvent} event @returns {void} */
|
|
156
|
+
_forwardAction(event: CustomEvent): void;
|
|
157
|
+
/** @param {CustomEvent} event @returns {FileItem|null} */
|
|
158
|
+
_componentForEvent(event: CustomEvent): FileItem | null;
|
|
159
|
+
/** @returns {void} */
|
|
160
|
+
_emitDataChange(): void;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Validates, normalizes, and clones file descriptors without mutating the input.
|
|
164
|
+
* Explicit duplicate IDs are rejected; id-less rows remain valid.
|
|
165
|
+
* @param {unknown} value Candidate descriptors.
|
|
166
|
+
* @returns {FileItemState[]}
|
|
167
|
+
*/
|
|
168
|
+
export declare function normalizeFileListItems(value: unknown): FileItemState[];
|
|
169
|
+
/** File descriptors changed through a list mutation method. @event FileList#datachange @type {CustomEvent<{items:Readonly<FileItemState>[]}>} */
|
|
170
|
+
/** A file link activated through the list. @event FileList#activate @type {CustomEvent<{id:unknown,index:number,file:Readonly<FileItemState>,href:string,event:MouseEvent}>} */
|
|
171
|
+
/** A file action activated through the list. @event FileList#action @type {CustomEvent<{id:string,fileId:unknown,index:number,action:object,file:Readonly<FileItemState>,event:MouseEvent}>} */
|
|
@@ -95,6 +95,26 @@ export type FilterOptions = {
|
|
|
95
95
|
* Maximum condition count.
|
|
96
96
|
*/
|
|
97
97
|
maxConditions?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Searchable field, operator and single-choice controls.
|
|
100
|
+
*/
|
|
101
|
+
searchable?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Condition layout; compact rows adapt to container width.
|
|
104
|
+
*/
|
|
105
|
+
layout?: 'standard' | 'compact';
|
|
106
|
+
/**
|
|
107
|
+
* Restrict root logic without rewriting incompatible saved expressions.
|
|
108
|
+
*/
|
|
109
|
+
rootLogic?: 'and' | 'or' | null;
|
|
110
|
+
/**
|
|
111
|
+
* Show the internal Apply button.
|
|
112
|
+
*/
|
|
113
|
+
showApply?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Show Add controls inside the root group as well as the footer.
|
|
116
|
+
*/
|
|
117
|
+
showRootActions?: boolean;
|
|
98
118
|
/**
|
|
99
119
|
* Emit apply after every valid mutation.
|
|
100
120
|
*/
|
|
@@ -108,11 +128,11 @@ export type FilterOptions = {
|
|
|
108
128
|
*/
|
|
109
129
|
disabled?: boolean;
|
|
110
130
|
/**
|
|
111
|
-
* Apply button label.
|
|
131
|
+
* Apply button label. Omitted resolves `filter.apply`, English `Apply filters`.
|
|
112
132
|
*/
|
|
113
133
|
applyLabel?: string;
|
|
114
134
|
/**
|
|
115
|
-
* Clear button label.
|
|
135
|
+
* Clear button label. Omitted resolves `filter.clear`, English `Clear`.
|
|
116
136
|
*/
|
|
117
137
|
clearLabel?: string;
|
|
118
138
|
/**
|
|
@@ -140,40 +160,32 @@ export type FilterOptions = {
|
|
|
140
160
|
*/
|
|
141
161
|
onerror?: (event: CustomEvent<Record<string, unknown>>) => void;
|
|
142
162
|
};
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
* @property {string} [clearLabel='Clear'] Clear button label.
|
|
170
|
-
* @property {(event:CustomEvent<Record<string,unknown>>)=>void} [onchange] Draft-change listener.
|
|
171
|
-
* @property {(event:CustomEvent<Record<string,unknown>>)=>void} [onapply] Valid-apply listener.
|
|
172
|
-
* @property {(event:CustomEvent<Record<string,unknown>>)=>void} [oninvalid] Invalid-apply listener.
|
|
173
|
-
* @property {(event:CustomEvent<Record<string,unknown>>)=>void} [onquery] Async query listener.
|
|
174
|
-
* @property {(event:CustomEvent<Record<string,unknown>>)=>void} [onloaded] Async loaded listener.
|
|
175
|
-
* @property {(event:CustomEvent<Record<string,unknown>>)=>void} [onerror] Async failure listener.
|
|
176
|
-
*/
|
|
163
|
+
export type FilterValueMessages = {
|
|
164
|
+
/**
|
|
165
|
+
* Empty-choice option label.
|
|
166
|
+
*/
|
|
167
|
+
choose: string;
|
|
168
|
+
/**
|
|
169
|
+
* Boolean true label.
|
|
170
|
+
*/
|
|
171
|
+
yes: string;
|
|
172
|
+
/**
|
|
173
|
+
* Boolean false label.
|
|
174
|
+
*/
|
|
175
|
+
no: string;
|
|
176
|
+
/**
|
|
177
|
+
* Placeholder for a many-valued text input.
|
|
178
|
+
*/
|
|
179
|
+
commaSeparated: string;
|
|
180
|
+
/**
|
|
181
|
+
* Accessible name for a single value control.
|
|
182
|
+
*/
|
|
183
|
+
value: (label: string) => string;
|
|
184
|
+
/**
|
|
185
|
+
* Accessible name for one end of a pair.
|
|
186
|
+
*/
|
|
187
|
+
valueAt: (label: string, position: number) => string;
|
|
188
|
+
};
|
|
177
189
|
/**
|
|
178
190
|
* Backend-neutral dynamic filter expression editor.
|
|
179
191
|
* @fires Filter#change
|
|
@@ -227,6 +239,8 @@ export declare class Filter extends Component<FilterOptions> {
|
|
|
227
239
|
_disabled: boolean;
|
|
228
240
|
_async: Map<any, any>;
|
|
229
241
|
_customEditors: any[];
|
|
242
|
+
_selectEditors: any[];
|
|
243
|
+
_disposed: boolean;
|
|
230
244
|
_value: import("./filter-model.js").FilterAst;
|
|
231
245
|
_renderVersion: any;
|
|
232
246
|
static cssName: string;
|
|
@@ -279,6 +293,20 @@ export declare class Filter extends Component<FilterOptions> {
|
|
|
279
293
|
_renderCondition(node: any): HTMLElement;
|
|
280
294
|
/** @param {any} node @param {FilterField|null} field @param {any} operator @returns {HTMLElement} */
|
|
281
295
|
_renderValue(node: any, field: FilterField | null, operator: any): HTMLElement;
|
|
296
|
+
/**
|
|
297
|
+
* Owns a themed picker and defers mutation until Select finishes its selection event.
|
|
298
|
+
* @param {Array<{value:unknown,label:string}>} items Choices.
|
|
299
|
+
* @param {unknown} value Selected value.
|
|
300
|
+
* @param {string} label Accessible name.
|
|
301
|
+
* @param {string} nodeId Condition ID.
|
|
302
|
+
* @param {string} part Focus target name.
|
|
303
|
+
* @param {(value:unknown)=>void} changed Selection handler.
|
|
304
|
+
* @returns {HTMLElement} Picker root.
|
|
305
|
+
*/
|
|
306
|
+
_searchSelect(items: Array<{
|
|
307
|
+
value: unknown;
|
|
308
|
+
label: string;
|
|
309
|
+
}>, value: unknown, label: string, nodeId: string, part: string, changed: (value: unknown) => void): HTMLElement;
|
|
282
310
|
/** @param {Event} event @returns {void} */
|
|
283
311
|
_handleChange(event: Event): void;
|
|
284
312
|
/** @param {Event} event @returns {void} */
|
|
@@ -322,6 +350,26 @@ export declare class Filter extends Component<FilterOptions> {
|
|
|
322
350
|
_defaultOperator(field: FilterField | null): string | null;
|
|
323
351
|
/** @param {string} text @returns {void} */
|
|
324
352
|
_announce(text: string): void;
|
|
353
|
+
/** Names a field or operator a saved expression refers to that this instance does not offer.
|
|
354
|
+
* @param {string} id Unknown field or operator ID. @returns {string} */
|
|
355
|
+
_unavailable(id: string): string;
|
|
356
|
+
/** @param {any} node Condition. @param {FilterField|null} field Resolved field. @returns {HTMLElement} */
|
|
357
|
+
_removeConditionButton(node: any, field: FilterField | null): HTMLElement;
|
|
358
|
+
/**
|
|
359
|
+
* Resolves the strings the two value builders need. They are module functions so that the
|
|
360
|
+
* markup they produce stays testable without a component, which means the words have to be
|
|
361
|
+
* handed to them rather than looked up inside.
|
|
362
|
+
* @returns {FilterValueMessages}
|
|
363
|
+
*/
|
|
364
|
+
_valueMessages(): FilterValueMessages;
|
|
365
|
+
/**
|
|
366
|
+
* Resolves a message through the host translator, falling back to the built-in English text.
|
|
367
|
+
* @param {string} key Message key.
|
|
368
|
+
* @param {string} fallback Built-in text, with `%1`-style placeholders.
|
|
369
|
+
* @param {...unknown} args Interpolation values.
|
|
370
|
+
* @returns {string}
|
|
371
|
+
*/
|
|
372
|
+
_message(key: string, fallback: string, ...args: unknown[]): string;
|
|
325
373
|
}
|
|
326
374
|
/** @event Filter#change @type {CustomEvent<Record<string,unknown>>} */
|
|
327
375
|
/** @event Filter#apply @type {CustomEvent<{value:FilterAst}>} */
|
|
@@ -329,3 +377,10 @@ export declare class Filter extends Component<FilterOptions> {
|
|
|
329
377
|
/** @event Filter#query @type {CustomEvent<Record<string,unknown>>} */
|
|
330
378
|
/** @event Filter#loaded @type {CustomEvent<Record<string,unknown>>} */
|
|
331
379
|
/** @event Filter#error @type {CustomEvent<Record<string,unknown>>} */
|
|
380
|
+
/**
|
|
381
|
+
* Reports a restricted root mismatch without mutating the supplied expression.
|
|
382
|
+
* @param {FilterAst} value Expression to validate.
|
|
383
|
+
* @param {'and'|'or'|null} logic Required root logic.
|
|
384
|
+
* @returns {Record<string,string>|null} Actionable validation error, or null.
|
|
385
|
+
*/
|
|
386
|
+
export declare function rootLogicError(value: FilterAst, logic: 'and' | 'or' | null): Record<string, string> | null;
|