@zeyos/zx 4.4.0 → 5.2.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 +447 -0
- package/README.md +44 -11
- package/dist/types/components/account-menu/account-menu.d.ts +8 -0
- package/dist/types/components/activity-list/activity-list.d.ts +31 -1
- package/dist/types/components/app-icon/app-icon.d.ts +14 -2
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +293 -17
- 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 +15 -0
- package/dist/types/components/calendar/calendar.d.ts +67 -5
- package/dist/types/components/card-view/card-view.d.ts +7 -4
- package/dist/types/components/card-view/record-card.d.ts +11 -0
- 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 +6 -17
- package/dist/types/components/context-menu/context-menu.d.ts +6 -2
- package/dist/types/components/data-filter/data-filter.d.ts +4 -4
- package/dist/types/components/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 +46 -6
- package/dist/types/components/dropdown/dropdown.d.ts +24 -9
- package/dist/types/components/entity-ref/entity-ref.d.ts +2 -2
- package/dist/types/components/field/field.d.ts +54 -2
- package/dist/types/components/fieldset/external-adapter.d.ts +83 -0
- package/dist/types/components/fieldset/fieldset.d.ts +26 -1
- package/dist/types/components/file-item/file-item.d.ts +34 -6
- package/dist/types/components/file-list/file-list.d.ts +35 -3
- package/dist/types/components/filter/filter.d.ts +127 -3
- package/dist/types/components/filter-panel/filter-panel.d.ts +36 -7
- package/dist/types/components/form/form.d.ts +12 -1
- package/dist/types/components/kanban-view/kanban-card.d.ts +8 -0
- package/dist/types/components/launcher/launcher.d.ts +268 -15
- package/dist/types/components/list-toolbar/list-toolbar.d.ts +16 -7
- package/dist/types/components/menu-button/menu-button.d.ts +39 -5
- package/dist/types/components/message/message.d.ts +132 -17
- package/dist/types/components/modal/modal.d.ts +43 -2
- package/dist/types/components/module-bar/module-bar.d.ts +395 -0
- package/dist/types/components/pagination/pagination.d.ts +17 -3
- package/dist/types/components/select/color.d.ts +12 -0
- package/dist/types/components/select/glyphs.d.ts +124 -0
- package/dist/types/components/select/select.d.ts +17 -3
- package/dist/types/components/sheet/sheet.d.ts +15 -0
- package/dist/types/components/stat-tile/stat-tile.d.ts +16 -5
- package/dist/types/components/tabbox/tabbox.d.ts +9 -0
- package/dist/types/components/table/table.d.ts +311 -18
- package/dist/types/components/tag-picker/tag-picker.d.ts +21 -4
- package/dist/types/components/tree/tree.d.ts +13 -0
- package/dist/types/components/view/record-view.d.ts +59 -2
- package/dist/types/components/view-settings/view-settings.d.ts +879 -0
- package/dist/types/components/workspace-switcher/workspace-switcher.d.ts +327 -0
- package/dist/types/core/breakpoint.d.ts +1 -1
- package/dist/types/core/component.d.ts +12 -2
- package/dist/types/core/i18n.d.ts +27 -3
- package/dist/types/core/icons.d.ts +23 -25
- package/dist/types/core/keyboard.d.ts +98 -1
- package/dist/types/core/messages.d.ts +382 -0
- package/dist/types/core/motion.d.ts +59 -0
- package/dist/types/core/overlay-host.d.ts +42 -1
- package/dist/types/core/overlay-stack.d.ts +260 -0
- package/dist/types/index.d.ts +10 -5
- package/dist/types/internal/app-rail.d.ts +38 -0
- package/dist/types/internal/menu-items.d.ts +71 -3
- 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 +2 -1
- package/dist/types/zeyos/launcher.d.ts +9 -0
- package/dist/types/zeyos/module-bar.d.ts +176 -0
- package/dist/types/zeyos/query.d.ts +110 -5
- package/dist/types/zeyos/schema.d.ts +24 -1
- package/dist/types/zeyos/table.d.ts +345 -22
- package/dist/types/zeyos/view.d.ts +26 -2
- package/dist/zx-zeyos.esm.js +6178 -1008
- package/dist/zx-zeyos.esm.min.js +53 -5
- package/dist/zx.css +2861 -827
- package/dist/zx.esm.js +8909 -1480
- package/dist/zx.esm.min.js +55 -7
- package/dist/zx.global.js +8911 -1482
- package/dist/zx.global.min.js +55 -7
- package/dist/zx.min.css +1 -1
- package/docs/api.json +1079 -117
- package/docs/llms.md +956 -154
- package/docs/llms.txt +9 -5
- package/package.json +1 -1
- package/src/components/account-menu/account-menu.css +35 -10
- package/src/components/account-menu/account-menu.js +12 -0
- package/src/components/activity-item/activity-item.css +1 -1
- package/src/components/activity-item/activity-item.js +3 -0
- package/src/components/activity-list/activity-list.css +38 -3
- package/src/components/activity-list/activity-list.js +61 -1
- package/src/components/app-icon/app-icon.css +14 -3
- package/src/components/app-icon/app-icon.js +11 -1
- package/src/components/app-rail/app-rail.css +59 -79
- package/src/components/app-sidebar/app-sidebar.css +304 -168
- package/src/components/app-sidebar/app-sidebar.js +667 -46
- 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/breadcrumb/breadcrumb.css +1 -1
- package/src/components/button/button.css +67 -9
- package/src/components/button/button.js +38 -0
- package/src/components/calendar/calendar.css +47 -47
- package/src/components/calendar/calendar.js +26 -52
- package/src/components/card/card.css +4 -4
- package/src/components/card-view/card-view.css +14 -12
- package/src/components/card-view/card-view.js +13 -9
- package/src/components/card-view/record-card.js +14 -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 +7 -6
- package/src/components/code-editor/code-editor.js +19 -1
- package/src/components/code-editor/field-adapter.js +9 -2
- package/src/components/context-menu/context-menu.css +9 -4
- package/src/components/context-menu/context-menu.js +8 -2
- package/src/components/copy/copy-button.css +6 -0
- package/src/components/copy/copy-input.css +9 -4
- package/src/components/data-filter/data-filter.css +5 -4
- package/src/components/data-filter/data-filter.js +2 -2
- package/src/components/date-picker/date-picker.css +6 -6
- package/src/components/date-picker/date-range-picker.css +3 -3
- package/src/components/date-picker/time-picker.css +3 -3
- 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 +99 -17
- package/src/components/dock/dock.css +5 -4
- package/src/components/dropdown/dropdown.css +1 -1
- package/src/components/dropdown/dropdown.js +159 -72
- package/src/components/empty-state/empty-state.css +2 -2
- package/src/components/entity-ref/entity-ref.css +1 -1
- package/src/components/entity-ref/entity-ref.js +1 -1
- package/src/components/field/field.css +28 -9
- package/src/components/field/field.js +101 -29
- package/src/components/field-upload/field-upload.css +1 -1
- package/src/components/fieldset/external-adapter.js +363 -0
- package/src/components/fieldset/fieldset.css +5 -3
- package/src/components/fieldset/fieldset.js +38 -64
- package/src/components/file-item/file-item.js +144 -10
- package/src/components/file-list/file-list.js +144 -21
- package/src/components/filter/filter.css +86 -2
- package/src/components/filter/filter.js +307 -11
- package/src/components/filter-panel/filter-panel.css +1 -1
- package/src/components/filter-panel/filter-panel.js +149 -32
- package/src/components/finder/finder.css +16 -14
- 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 +11 -3
- package/src/components/kanban-view/kanban-view.css +42 -18
- package/src/components/kanban-view/kanban-view.js +9 -6
- package/src/components/launcher/launcher.css +108 -26
- package/src/components/launcher/launcher.js +530 -42
- package/src/components/list-toolbar/list-toolbar.css +13 -8
- package/src/components/list-toolbar/list-toolbar.js +40 -14
- package/src/components/master-panel/master-panel.css +2 -0
- package/src/components/master-panel/master-panel.js +0 -1
- package/src/components/menu-button/menu-button.css +72 -4
- package/src/components/menu-button/menu-button.js +160 -18
- package/src/components/message/message.css +33 -3
- package/src/components/message/message.js +264 -22
- package/src/components/modal/modal.css +1 -1
- package/src/components/modal/modal.js +83 -15
- package/src/components/module-bar/module-bar.css +486 -0
- package/src/components/module-bar/module-bar.js +1074 -0
- package/src/components/multi-value-editor/multi-value-editor.css +1 -1
- package/src/components/navigation-bar/navigation-bar.css +18 -9
- package/src/components/number-field/field-adapter.js +3 -1
- 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 +13 -11
- package/src/components/pagination/pagination.js +20 -4
- package/src/components/panel/panel.css +4 -3
- package/src/components/questionnaire/questionnaire.css +4 -4
- package/src/components/rating/field-adapter.js +2 -1
- package/src/components/rating/rating.css +8 -1
- package/src/components/search/search.css +4 -1
- package/src/components/select/color.js +22 -0
- package/src/components/select/field-adapter.js +2 -0
- package/src/components/select/glyphs.js +165 -0
- package/src/components/select/select.css +138 -45
- package/src/components/select/select.js +92 -47
- package/src/components/sheet/sheet.css +12 -9
- package/src/components/sheet/sheet.js +74 -32
- package/src/components/slider/field-adapter.js +6 -1
- package/src/components/slider/slider.css +18 -4
- package/src/components/slider/slider.js +1 -1
- package/src/components/sort-control/sort-control.css +4 -1
- package/src/components/split-view/split-view.css +1 -1
- package/src/components/stat-tile/stat-tile.css +42 -47
- package/src/components/stat-tile/stat-tile.js +17 -6
- package/src/components/stepper/stepper.css +1 -1
- package/src/components/tabbox/tabbox.css +41 -32
- package/src/components/tabbox/tabbox.js +5 -1
- package/src/components/table/table.css +187 -37
- package/src/components/table/table.js +718 -73
- package/src/components/tag-picker/field-adapter.js +2 -1
- package/src/components/tag-picker/tag-picker.css +83 -5
- package/src/components/tag-picker/tag-picker.js +25 -8
- package/src/components/timebox/timebox.css +22 -2
- 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 +44 -19
- package/src/components/tree/tree.css +26 -17
- package/src/components/tree/tree.js +31 -0
- package/src/components/value-list/value-list.css +3 -3
- package/src/components/view/record-view.css +1 -1
- package/src/components/view/record-view.js +178 -18
- package/src/components/view-settings/view-settings.css +285 -0
- package/src/components/view-settings/view-settings.js +1830 -0
- package/src/components/workspace-switcher/workspace-switcher.css +188 -0
- package/src/components/workspace-switcher/workspace-switcher.js +463 -0
- package/src/core/breakpoint.js +1 -1
- package/src/core/component.js +88 -17
- package/src/core/fontawesome.js +5 -1
- package/src/core/i18n.js +47 -4
- package/src/core/icons.js +204 -61
- package/src/core/keyboard.js +206 -11
- package/src/core/messages.js +427 -0
- package/src/core/motion.js +147 -0
- package/src/core/overlay-host.js +77 -3
- package/src/core/overlay-stack.js +487 -0
- package/src/core/position.js +22 -3
- package/src/index.js +10 -5
- package/src/internal/app-rail.js +135 -55
- package/src/internal/menu-items.js +61 -3
- package/src/zeyos/connect.js +6 -2
- package/src/zeyos/form.js +69 -27
- package/src/zeyos/index.js +4 -1
- package/src/zeyos/launcher.js +8 -3
- package/src/zeyos/module-bar.js +181 -0
- package/src/zeyos/query.js +197 -13
- package/src/zeyos/schema.js +144 -27
- package/src/zeyos/table.js +287 -84
- package/src/zeyos/view.js +49 -93
- package/styles/base.css +72 -1
- package/styles/icons.css +11 -1
- package/styles/print.css +1 -1
- package/styles/tokens/dark.css +117 -37
- package/styles/tokens/global.css +121 -27
- package/styles/tokens/semantic.css +140 -43
- package/styles/tokens/themes.css +7 -6
- package/styles/zx.css +3 -1
- package/styles/tokens/density.css +0 -9
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { Component } from '../../core/component.js';
|
|
2
2
|
export type FieldOptions = {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* DOM id of the control. Generated when omitted; a Fieldset
|
|
5
|
+
* derives it from its `idPrefix` and the field key, so a key never becomes a DOM id by itself.
|
|
5
6
|
*/
|
|
6
7
|
id?: string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Field name: the `name` of a native control and the key the
|
|
10
|
+
* field is filed under. A Fieldset sets it to the field key; a standalone field falls back to `id`.
|
|
11
|
+
*/
|
|
12
|
+
name?: string | null;
|
|
7
13
|
/**
|
|
8
14
|
* Registered field type.
|
|
9
15
|
*/
|
|
@@ -32,6 +38,12 @@ export type FieldOptions = {
|
|
|
32
38
|
* Whether the control is disabled.
|
|
33
39
|
*/
|
|
34
40
|
disabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the value is read-only: shown and focusable, not
|
|
43
|
+
* editable. Types whose control has no read-only state (`checkbox`, `select`, `optionlist`,
|
|
44
|
+
* `zxselect`, `date`, `time`, …) ignore it.
|
|
45
|
+
*/
|
|
46
|
+
readonly?: boolean;
|
|
35
47
|
/**
|
|
36
48
|
* Select or option-list values.
|
|
37
49
|
*/
|
|
@@ -84,10 +96,21 @@ export type FieldAdapter = {
|
|
|
84
96
|
* Set disabled state.
|
|
85
97
|
*/
|
|
86
98
|
setDisabled: (disabled: boolean) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Set read-only state; left out when the
|
|
101
|
+
* control has none.
|
|
102
|
+
*/
|
|
103
|
+
setReadonly?: (readonly: boolean) => void;
|
|
87
104
|
/**
|
|
88
105
|
* Release adapter-owned resources.
|
|
89
106
|
*/
|
|
90
107
|
destroy?: () => void;
|
|
108
|
+
/**
|
|
109
|
+
* The element the field's label, description, and validity
|
|
110
|
+
* belong to when it is not `el` — the text input inside a composite control. Left out, a
|
|
111
|
+
* wrapper that cannot be labelled hands them to the first unnamed form control inside it.
|
|
112
|
+
*/
|
|
113
|
+
labelTarget?: Element;
|
|
91
114
|
};
|
|
92
115
|
export type FieldAdapterFactory = (field: Field, options: Readonly<FieldOptions>) => FieldAdapter;
|
|
93
116
|
export type NumericCoercion = {
|
|
@@ -96,7 +119,10 @@ export type NumericCoercion = {
|
|
|
96
119
|
};
|
|
97
120
|
/**
|
|
98
121
|
* @typedef {Object} FieldOptions
|
|
99
|
-
* @property {string|null} [id=null]
|
|
122
|
+
* @property {string|null} [id=null] DOM id of the control. Generated when omitted; a Fieldset
|
|
123
|
+
* derives it from its `idPrefix` and the field key, so a key never becomes a DOM id by itself.
|
|
124
|
+
* @property {string|null} [name=null] Field name: the `name` of a native control and the key the
|
|
125
|
+
* field is filed under. A Fieldset sets it to the field key; a standalone field falls back to `id`.
|
|
100
126
|
* @property {string} [type='text'] Registered field type.
|
|
101
127
|
* @property {string} [label=''] Visible label.
|
|
102
128
|
* @property {string} [description=''] Supporting description.
|
|
@@ -104,6 +130,9 @@ export type NumericCoercion = {
|
|
|
104
130
|
* @property {string} [placeholder=''] Control placeholder.
|
|
105
131
|
* @property {boolean} [required=false] Whether a value is required.
|
|
106
132
|
* @property {boolean} [disabled=false] Whether the control is disabled.
|
|
133
|
+
* @property {boolean} [readonly=false] Whether the value is read-only: shown and focusable, not
|
|
134
|
+
* editable. Types whose control has no read-only state (`checkbox`, `select`, `optionlist`,
|
|
135
|
+
* `zxselect`, `date`, `time`, …) ignore it.
|
|
107
136
|
* @property {string[]|Record<string, string>|null} [options=null] Select or option-list values.
|
|
108
137
|
* @property {'stack'|'inline'} [layout='stack'] Label/control layout.
|
|
109
138
|
* @property {Record<string, unknown>} [props={}] Adapter-specific control properties.
|
|
@@ -118,13 +147,19 @@ export type NumericCoercion = {
|
|
|
118
147
|
* @property {(value: unknown, options?: {silent?: boolean}) => void} set Set the current value.
|
|
119
148
|
* @property {() => void} focus Focus the control.
|
|
120
149
|
* @property {(disabled: boolean) => void} setDisabled Set disabled state.
|
|
150
|
+
* @property {(readonly: boolean) => void} [setReadonly] Set read-only state; left out when the
|
|
151
|
+
* control has none.
|
|
121
152
|
* @property {() => void} [destroy] Release adapter-owned resources.
|
|
153
|
+
* @property {Element} [labelTarget] The element the field's label, description, and validity
|
|
154
|
+
* belong to when it is not `el` — the text input inside a composite control. Left out, a
|
|
155
|
+
* wrapper that cannot be labelled hands them to the first unnamed form control inside it.
|
|
122
156
|
*/
|
|
123
157
|
/** @typedef {(field: Field, options: Readonly<FieldOptions>) => FieldAdapter} FieldAdapterFactory */
|
|
124
158
|
/** @typedef {{valid: boolean, value: number|string}} NumericCoercion */
|
|
125
159
|
/**
|
|
126
160
|
* One labelled form control backed by a registered adapter.
|
|
127
161
|
* @fires Field#change
|
|
162
|
+
* @fires Field#input
|
|
128
163
|
* @fires Field#invalid
|
|
129
164
|
* @extends {Component<FieldOptions>}
|
|
130
165
|
*/
|
|
@@ -133,8 +168,12 @@ export declare class Field extends Component<FieldOptions> {
|
|
|
133
168
|
_ownedComponents: Set<any>;
|
|
134
169
|
_ownedNodes: any[];
|
|
135
170
|
_rootAttributes: Map<string, string>;
|
|
171
|
+
/** @type {string} The control's DOM id: `options.id`, or a generated one. */
|
|
136
172
|
controlId: string;
|
|
173
|
+
/** @type {string} The field name (`options.name`, else `options.id`), '' when there is none. */
|
|
174
|
+
name: string;
|
|
137
175
|
adapter: FieldAdapter;
|
|
176
|
+
_labelled: Element;
|
|
138
177
|
_baseDescribedBy: string;
|
|
139
178
|
_descriptionId: string;
|
|
140
179
|
_highlightId: string;
|
|
@@ -191,6 +230,13 @@ export declare class Field extends Component<FieldOptions> {
|
|
|
191
230
|
* @returns {this}
|
|
192
231
|
*/
|
|
193
232
|
setDisabled(disabled: boolean): this;
|
|
233
|
+
/**
|
|
234
|
+
* Makes the value read-only or editable again, where the control has a read-only state (see
|
|
235
|
+
* the `readonly` option); reflected as `data-readonly` on the root either way.
|
|
236
|
+
* @param {boolean} readonly Read-only state.
|
|
237
|
+
* @returns {this}
|
|
238
|
+
*/
|
|
239
|
+
setReadonly(readonly: boolean): this;
|
|
194
240
|
/**
|
|
195
241
|
* Displays a validation or status message.
|
|
196
242
|
* @param {string} message Message text.
|
|
@@ -238,6 +284,12 @@ export declare function coerceFloat(input: unknown): NumericCoercion;
|
|
|
238
284
|
* @event Field#change
|
|
239
285
|
* @type {CustomEvent<{value: unknown}>}
|
|
240
286
|
*/
|
|
287
|
+
/**
|
|
288
|
+
* Live edit before it is committed, from the types whose widget tells the two apart (`code`,
|
|
289
|
+
* `slider`): every keystroke or drag step, where `change` follows only on commit.
|
|
290
|
+
* @event Field#input
|
|
291
|
+
* @type {CustomEvent<{value: unknown}>}
|
|
292
|
+
*/
|
|
241
293
|
/**
|
|
242
294
|
* Field validation failure event.
|
|
243
295
|
* @event Field#invalid
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export type Field = import('../field/field.js').Field;
|
|
2
|
+
export type FieldAdapter = import('../field/field.js').FieldAdapter;
|
|
3
|
+
export type ExternalSource = Element | {
|
|
4
|
+
el?: Element;
|
|
5
|
+
toElement?: () => Element;
|
|
6
|
+
};
|
|
7
|
+
/** @typedef {import('../field/field.js').Field} Field */
|
|
8
|
+
/** @typedef {import('../field/field.js').FieldAdapter} FieldAdapter */
|
|
9
|
+
/**
|
|
10
|
+
* An element or component a Fieldset adopts with `addField(id, source)`: anything that renders
|
|
11
|
+
* into an element. Components are read through the methods they have, elements through their
|
|
12
|
+
* native properties.
|
|
13
|
+
* @typedef {Element|{el?: Element, toElement?: () => Element}} ExternalSource
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* The value accessor pairs the library's components use, in the order they are tried. A reader
|
|
17
|
+
* counts only when it takes no required argument (`Fieldset.getValue(id)` is not a reader), a
|
|
18
|
+
* writer of another pair only when the value is its sole required argument.
|
|
19
|
+
* - `getValue/setValue`: Field, CodeEditor, Filter, SortControl, Toggle (`getValue()` is the
|
|
20
|
+
* configured on-value or `false`, the same as the `toggle` field type reads).
|
|
21
|
+
* - `get/set`: NumberField, Select, Slider, Rating, CheckButton, Datebox, Timebox, Search,
|
|
22
|
+
* CopyInput, DatePicker and the other pickers.
|
|
23
|
+
* - `getValues/setValues`: Checklist, TagPicker, ValueList, MultiValueEditor, Fieldset, Form.
|
|
24
|
+
* - `isChecked/setChecked`: boolean controls that name their state that way.
|
|
25
|
+
* @type {ReadonlyArray<readonly [string, string]>}
|
|
26
|
+
*/
|
|
27
|
+
export declare const VALUE_METHODS: ReadonlyArray<readonly [string, string]>;
|
|
28
|
+
/**
|
|
29
|
+
* The element a source renders into.
|
|
30
|
+
* @param {ExternalSource} source Element or component.
|
|
31
|
+
* @returns {Element}
|
|
32
|
+
*/
|
|
33
|
+
export declare function externalElement(source: ExternalSource): Element;
|
|
34
|
+
/**
|
|
35
|
+
* Reads the current value of an element or component through the first value dialect it
|
|
36
|
+
* supports (see {@link VALUE_METHODS}), then a `value`, `values`, or `checked` property, then the
|
|
37
|
+
* element itself: `checked` for a checkbox or radio, `value` for any other control. Null when
|
|
38
|
+
* the source has no value at all.
|
|
39
|
+
* @param {ExternalSource} source Element or component.
|
|
40
|
+
* @returns {unknown}
|
|
41
|
+
*/
|
|
42
|
+
export declare function readExternalValue(source: ExternalSource): unknown;
|
|
43
|
+
/**
|
|
44
|
+
* Reports whether an element or component is disabled: its `isDisabled()`, a `disabled`
|
|
45
|
+
* property, the element's own `disabled`, an `aria-disabled="true"` or `data-disabled` root, or
|
|
46
|
+
* a wrapper whose every form control is disabled.
|
|
47
|
+
* @param {ExternalSource} source Element or component.
|
|
48
|
+
* @returns {boolean}
|
|
49
|
+
*/
|
|
50
|
+
export declare function readExternalDisabled(source: ExternalSource): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Reports whether an element or component is read-only: a `readonly`/`readOnly` property, the
|
|
53
|
+
* element's own `readOnly`, or an `aria-readonly="true"` or `data-readonly` root.
|
|
54
|
+
* @param {ExternalSource} source Element or component.
|
|
55
|
+
* @returns {boolean}
|
|
56
|
+
*/
|
|
57
|
+
export declare function readExternalReadonly(source: ExternalSource): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Builds the Field adapter for an element or component that is not a registered field type.
|
|
60
|
+
*
|
|
61
|
+
* Values go through the source's own accessors ({@link readExternalValue}); disabling through
|
|
62
|
+
* `setDisabled(bool)`, then `enable()`/`disable()`, then a `disabled` property, and only then the
|
|
63
|
+
* DOM — the element's `disabled`, or for a plain wrapper `aria-disabled` plus `disabled` on every
|
|
64
|
+
* form control inside it. Read-only goes through `setReadonly(bool)`/`setReadOnly(bool)`, a
|
|
65
|
+
* `readonly`/`readOnly` property, or the element's own `readOnly`.
|
|
66
|
+
*
|
|
67
|
+
* Writes pass the caller's options to the component: `Field.setValue(v)` or
|
|
68
|
+
* `Fieldset.setValues(values)` without `silent` lets the component emit its own `change` to its
|
|
69
|
+
* own listeners, while the field emits one `change` for the write; with `silent` neither does.
|
|
70
|
+
*
|
|
71
|
+
* Given the field, a component's own `change` event becomes the field's `change`, and the native
|
|
72
|
+
* `change` its inner controls bubble is dropped unless it carries a value the component did not
|
|
73
|
+
* already report — so one edit is one field `change`, whether the component reports it, its
|
|
74
|
+
* input does, or (Search, CopyInput) only its input does.
|
|
75
|
+
*
|
|
76
|
+
* `destroy()` puts the element back where it was found and undoes what the adapter changed:
|
|
77
|
+
* attributes, the native value, disabled and read-only state.
|
|
78
|
+
* @param {ExternalSource} source Element or component to adopt.
|
|
79
|
+
* @param {Field|null} [field=null] The field the adapter serves; needed to forward events. Its
|
|
80
|
+
* `listen()` owns every listener the adapter adds, so destroying the field removes them.
|
|
81
|
+
* @returns {FieldAdapter}
|
|
82
|
+
*/
|
|
83
|
+
export declare function externalAdapter(source: ExternalSource, field?: Field | null): FieldAdapter;
|
|
@@ -13,6 +13,12 @@ export type FieldsetOptions = {
|
|
|
13
13
|
* Initial fields.
|
|
14
14
|
*/
|
|
15
15
|
fields?: Record<string, FieldOptions | Field | Element | Component>;
|
|
16
|
+
/**
|
|
17
|
+
* Prefix of the DOM ids generated for the fields, as
|
|
18
|
+
* `<idPrefix>-<key>`. Null generates one per instance, so the same fieldset mounted twice
|
|
19
|
+
* never repeats an id and a field key never collides with an element id elsewhere on the page.
|
|
20
|
+
*/
|
|
21
|
+
idPrefix?: string | null;
|
|
16
22
|
};
|
|
17
23
|
export type FieldOptions = import('../field/field.js').FieldOptions;
|
|
18
24
|
/**
|
|
@@ -20,6 +26,9 @@ export type FieldOptions = import('../field/field.js').FieldOptions;
|
|
|
20
26
|
* @property {string} [title=''] Legend text.
|
|
21
27
|
* @property {1|2|3} [columns=1] Grid column count.
|
|
22
28
|
* @property {Record<string, FieldOptions|Field|Element|Component>} [fields={}] Initial fields.
|
|
29
|
+
* @property {string|null} [idPrefix=null] Prefix of the DOM ids generated for the fields, as
|
|
30
|
+
* `<idPrefix>-<key>`. Null generates one per instance, so the same fieldset mounted twice
|
|
31
|
+
* never repeats an id and a field key never collides with an element id elsewhere on the page.
|
|
23
32
|
*/
|
|
24
33
|
/** @typedef {import('../field/field.js').FieldOptions} FieldOptions */
|
|
25
34
|
/**
|
|
@@ -32,6 +41,7 @@ export declare class Fieldset extends Component<FieldsetOptions> {
|
|
|
32
41
|
_origins: Map<any, any>;
|
|
33
42
|
_fieldIdAttributes: Map<any, any>;
|
|
34
43
|
_ownedNodes: any[];
|
|
44
|
+
_idPrefix: string;
|
|
35
45
|
_columnAttribute: string;
|
|
36
46
|
_grid: HTMLElement;
|
|
37
47
|
static cssName: string;
|
|
@@ -40,7 +50,16 @@ export declare class Fieldset extends Component<FieldsetOptions> {
|
|
|
40
50
|
/** @returns {HTMLElement} */
|
|
41
51
|
render(): HTMLElement;
|
|
42
52
|
/**
|
|
43
|
-
* Adds a field from options, an existing field, an element, or a component.
|
|
53
|
+
* Adds a field from options, an existing field, an element, or a component. The key becomes the
|
|
54
|
+
* field's `name` and its `data-field-id`; the control's DOM id is `<idPrefix>-<key>`, unless the
|
|
55
|
+
* field options give an `id` of their own that differs from the key.
|
|
56
|
+
*
|
|
57
|
+
* An element or a component that is not a registered field type is wrapped in a `custom` field
|
|
58
|
+
* that reads and writes it through its own API — `getValue`/`setValue`, `get`/`set`,
|
|
59
|
+
* `getValues`/`setValues`, `isChecked`/`setChecked`, or a `value` property — disables it
|
|
60
|
+
* through `setDisabled(bool)` or `enable()`/`disable()`, and makes it read-only through
|
|
61
|
+
* `setReadonly(bool)`, falling back to the element's native properties only when the component
|
|
62
|
+
* has none of these. The component's own `change` becomes the field's `change`, once per edit.
|
|
44
63
|
* @param {string} id Logical field identifier.
|
|
45
64
|
* @param {FieldOptions|Field|Element|Component} field Field source.
|
|
46
65
|
* @returns {Field}
|
|
@@ -118,6 +137,12 @@ export declare class Fieldset extends Component<FieldsetOptions> {
|
|
|
118
137
|
* @returns {this}
|
|
119
138
|
*/
|
|
120
139
|
clearHighlights(): this;
|
|
140
|
+
/**
|
|
141
|
+
* The DOM id generated for a field key: unique per instance unless `idPrefix` was given.
|
|
142
|
+
* @param {string} key Field key.
|
|
143
|
+
* @returns {string}
|
|
144
|
+
*/
|
|
145
|
+
_controlId(key: string): string;
|
|
121
146
|
/** @param {Field} field @returns {void} */
|
|
122
147
|
_releaseField(field: Field): void;
|
|
123
148
|
/** @returns {void} */
|
|
@@ -20,15 +20,22 @@ export type FileItemOptions = {
|
|
|
20
20
|
*/
|
|
21
21
|
size?: number | string | null;
|
|
22
22
|
/**
|
|
23
|
-
* MIME type.
|
|
23
|
+
* MIME type. Shown as a readable type ("PDF", "Image"), never as
|
|
24
|
+
* the raw string, and used to pick the icon.
|
|
24
25
|
*/
|
|
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;
|
|
26
32
|
/**
|
|
27
33
|
* Optional supporting text before generated metadata.
|
|
28
34
|
*/
|
|
29
35
|
subtitle?: EntityRefContent;
|
|
30
36
|
/**
|
|
31
|
-
* File icon name, node, component, or lazy renderer.
|
|
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.
|
|
32
39
|
*/
|
|
33
40
|
icon?: EntityRefIcon;
|
|
34
41
|
/**
|
|
@@ -60,9 +67,9 @@ export type FileItemOptions = {
|
|
|
60
67
|
*/
|
|
61
68
|
indeterminate?: boolean;
|
|
62
69
|
/**
|
|
63
|
-
*
|
|
70
|
+
* Size of the file's icon and name.
|
|
64
71
|
*/
|
|
65
|
-
|
|
72
|
+
identitySize?: 'sm' | 'md' | 'lg';
|
|
66
73
|
/**
|
|
67
74
|
* Whether long identity text may wrap.
|
|
68
75
|
*/
|
|
@@ -112,6 +119,10 @@ export type FileItemState = {
|
|
|
112
119
|
* MIME type.
|
|
113
120
|
*/
|
|
114
121
|
mime: string;
|
|
122
|
+
/**
|
|
123
|
+
* Explicit type label, or null for the one derived from `mime`.
|
|
124
|
+
*/
|
|
125
|
+
typeLabel: string | null;
|
|
115
126
|
/**
|
|
116
127
|
* Supporting content.
|
|
117
128
|
*/
|
|
@@ -149,9 +160,9 @@ export type FileItemState = {
|
|
|
149
160
|
*/
|
|
150
161
|
indeterminate: boolean;
|
|
151
162
|
/**
|
|
152
|
-
*
|
|
163
|
+
* Size of the file's icon and name.
|
|
153
164
|
*/
|
|
154
|
-
|
|
165
|
+
identitySize: 'sm' | 'md' | 'lg';
|
|
155
166
|
/**
|
|
156
167
|
* Wrapping state.
|
|
157
168
|
*/
|
|
@@ -230,5 +241,22 @@ export declare class FileItem extends Component<FileItemOptions> {
|
|
|
230
241
|
* @returns {FileItemState}
|
|
231
242
|
*/
|
|
232
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;
|
|
233
261
|
/** Fired before a native file link continues. @event FileItem#activate @type {CustomEvent<{id: unknown, file: Readonly<FileItemState>, href: string, event: MouseEvent}>} */
|
|
234
262
|
/** Fired before a descriptor action callback runs. @event FileItem#action @type {CustomEvent<{id: string, fileId: unknown, action: object, file: Readonly<FileItemState>, event: MouseEvent}>} */
|
|
@@ -75,6 +75,12 @@ export type FileListOptions = {
|
|
|
75
75
|
/**
|
|
76
76
|
* Accessible collection for durable and transient files. Ordering and mutation are local
|
|
77
77
|
* presentation concerns only; transport, authorization, and persistence remain host-owned.
|
|
78
|
+
*
|
|
79
|
+
* Mutations are reconciled by file `id`: a file whose descriptor did not change keeps its row
|
|
80
|
+
* untouched, a changed one is updated in place through `FileItem.set()`, and only added or removed
|
|
81
|
+
* files create or drop rows. Upload progress can therefore tick through `updateItem()` while the
|
|
82
|
+
* reader's focus — on that file's Cancel button, say — and the list's scroll position stay put.
|
|
83
|
+
* Files without an `id` cannot be matched and are rebuilt on every mutation.
|
|
78
84
|
* @fires FileList#activate
|
|
79
85
|
* @fires FileList#action
|
|
80
86
|
* @fires FileList#datachange
|
|
@@ -86,7 +92,16 @@ export declare class FileList extends Component<FileListOptions> {
|
|
|
86
92
|
_destroyed: boolean;
|
|
87
93
|
_items: import("../file-item/file-item.js").FileItemState[];
|
|
88
94
|
_loading: any;
|
|
89
|
-
_itemComponents: any[];
|
|
95
|
+
_itemComponents: any[] | FileItem[];
|
|
96
|
+
/** @type {Map<FileItem, {row: HTMLElement, state: FileItemState}>} */
|
|
97
|
+
_itemRecords: Map<FileItem, {
|
|
98
|
+
row: HTMLElement;
|
|
99
|
+
state: FileItemState;
|
|
100
|
+
}>;
|
|
101
|
+
_itemList: HTMLElement;
|
|
102
|
+
_emptyRegion: HTMLElement;
|
|
103
|
+
_loadingRegion: HTMLElement;
|
|
104
|
+
_loadingPlaceholders: boolean;
|
|
90
105
|
static cssName: string;
|
|
91
106
|
/** @type {Readonly<FileListOptions>} */
|
|
92
107
|
static defaults: Readonly<FileListOptions>;
|
|
@@ -144,10 +159,27 @@ export declare class FileList extends Component<FileListOptions> {
|
|
|
144
159
|
setLoading(loading: boolean): this;
|
|
145
160
|
/** Restores an enhanced target exactly, or removes an owned collection. @returns {void} */
|
|
146
161
|
destroy(): void;
|
|
147
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* Brings the rendered rows in line with `_items`, keyed by file id, and keeps focus on the
|
|
164
|
+
* control that held it when that control's row was updated or removed.
|
|
165
|
+
* @returns {void}
|
|
166
|
+
*/
|
|
148
167
|
_renderList(): void;
|
|
149
|
-
/**
|
|
168
|
+
/**
|
|
169
|
+
* Keyed reconciliation of `FileItem` children. Rows are only moved when out of place, because
|
|
170
|
+
* detaching a row — even to re-insert it a moment later — takes focus out of it.
|
|
171
|
+
* @returns {void}
|
|
172
|
+
*/
|
|
173
|
+
_reconcileItems(): void;
|
|
174
|
+
/**
|
|
175
|
+
* The loading region, kept across renders while its shape stays the same so that its live
|
|
176
|
+
* status is not re-announced by every mutation that happens during a load.
|
|
177
|
+
* @param {boolean} placeholders Whether skeleton rows stand in for an empty list.
|
|
178
|
+
* @returns {HTMLElement}
|
|
179
|
+
*/
|
|
150
180
|
_createLoading(placeholders: boolean): HTMLElement;
|
|
181
|
+
/** @param {boolean} placeholders @returns {HTMLElement} */
|
|
182
|
+
_buildLoading(placeholders: boolean): HTMLElement;
|
|
151
183
|
/** @returns {void} */
|
|
152
184
|
_destroyItems(): void;
|
|
153
185
|
/** @param {CustomEvent} event @returns {void} */
|
|
@@ -22,7 +22,13 @@ export type FilterField = {
|
|
|
22
22
|
*/
|
|
23
23
|
defaultOperator?: string;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Glyph beside the field's name in a `searchable` field picker, an
|
|
26
|
+
* icon name or a node; a native `<select>` cannot show one.
|
|
27
|
+
*/
|
|
28
|
+
icon?: string | Node;
|
|
29
|
+
/**
|
|
30
|
+
* Static choices; a
|
|
31
|
+
* choice's `icon` shows beside it in a `searchable` value picker.
|
|
26
32
|
*/
|
|
27
33
|
choices?: Array<{
|
|
28
34
|
value: string | number | boolean;
|
|
@@ -96,11 +102,13 @@ export type FilterOptions = {
|
|
|
96
102
|
*/
|
|
97
103
|
maxConditions?: number;
|
|
98
104
|
/**
|
|
99
|
-
* Searchable field, operator and single-choice controls
|
|
105
|
+
* Searchable field, operator and single-choice controls; a many-valued
|
|
106
|
+
* operator on a field with static choices gets a `TagPicker`.
|
|
100
107
|
*/
|
|
101
108
|
searchable?: boolean;
|
|
102
109
|
/**
|
|
103
|
-
* Condition layout; compact rows adapt to container width
|
|
110
|
+
* Condition layout; compact rows adapt to container width and
|
|
111
|
+
* show the group's "and"/"or" between them, a click on it switching the group's logic.
|
|
104
112
|
*/
|
|
105
113
|
layout?: 'standard' | 'compact';
|
|
106
114
|
/**
|
|
@@ -186,6 +194,8 @@ export type FilterValueMessages = {
|
|
|
186
194
|
*/
|
|
187
195
|
valueAt: (label: string, position: number) => string;
|
|
188
196
|
};
|
|
197
|
+
/** Units a relative date span may be counted in, in the order the editor offers them. */
|
|
198
|
+
export declare const RELATIVE_DATE_UNITS: readonly string[];
|
|
189
199
|
/**
|
|
190
200
|
* Backend-neutral dynamic filter expression editor.
|
|
191
201
|
* @fires Filter#change
|
|
@@ -205,6 +215,7 @@ export declare class Filter extends Component<FilterOptions> {
|
|
|
205
215
|
type: 'text' | 'number' | 'money' | 'date' | 'datetime' | 'boolean' | 'enum' | 'status' | 'priority' | 'country' | 'currency' | 'unit' | 'entity' | 'tags' | 'custom';
|
|
206
216
|
operators?: string[];
|
|
207
217
|
defaultOperator?: string;
|
|
218
|
+
icon?: string | Node;
|
|
208
219
|
choices?: Array<{
|
|
209
220
|
value: string | number | boolean;
|
|
210
221
|
label: string;
|
|
@@ -289,10 +300,36 @@ export declare class Filter extends Component<FilterOptions> {
|
|
|
289
300
|
_render(): void;
|
|
290
301
|
/** @param {any} group @param {number} depth @param {boolean} root @returns {HTMLElement} */
|
|
291
302
|
_renderGroup(group: any, depth: number, root: boolean): HTMLElement;
|
|
303
|
+
/**
|
|
304
|
+
* The word between two rows of a compact group — "and" or "or" — so the logic reads down the
|
|
305
|
+
* list rather than only from the group's legend. A click switches the group's logic. It is a
|
|
306
|
+
* pointer shortcut kept out of the Tab order: the legend's select is the same control, reached
|
|
307
|
+
* once per group rather than once per row. A restricted root shows the word without the switch.
|
|
308
|
+
* @param {any} group Group the rows belong to.
|
|
309
|
+
* @param {boolean} root Whether it is the root group.
|
|
310
|
+
* @returns {HTMLElement}
|
|
311
|
+
*/
|
|
312
|
+
_connector(group: any, root: boolean): HTMLElement;
|
|
313
|
+
/**
|
|
314
|
+
* Rewrites a group's connectors after its logic changed through the legend's select, which is
|
|
315
|
+
* not redrawn — the reader's focus is on it.
|
|
316
|
+
* @param {any} group
|
|
317
|
+
* @returns {void}
|
|
318
|
+
*/
|
|
319
|
+
_syncConnectors(group: any): void;
|
|
292
320
|
/** @param {any} node @returns {HTMLElement} */
|
|
293
321
|
_renderCondition(node: any): HTMLElement;
|
|
294
322
|
/** @param {any} node @param {FilterField|null} field @param {any} operator @returns {HTMLElement} */
|
|
295
323
|
_renderValue(node: any, field: FilterField | null, operator: any): HTMLElement;
|
|
324
|
+
/**
|
|
325
|
+
* The editor for a relative date span (`withinLast`, `withinNext`): a whole-number amount and a
|
|
326
|
+
* unit select. Both controls write the pair `[amount, unit]`; a value that is not such a pair —
|
|
327
|
+
* two dates saved by an older editor, say — shows as an empty amount in days.
|
|
328
|
+
* @param {any} node Condition.
|
|
329
|
+
* @param {FilterField} field Date field.
|
|
330
|
+
* @returns {HTMLElement}
|
|
331
|
+
*/
|
|
332
|
+
_relativeDateEditor(node: any, field: FilterField): HTMLElement;
|
|
296
333
|
/**
|
|
297
334
|
* Owns a themed picker and defers mutation until Select finishes its selection event.
|
|
298
335
|
* @param {Array<{value:unknown,label:string}>} items Choices.
|
|
@@ -307,6 +344,16 @@ export declare class Filter extends Component<FilterOptions> {
|
|
|
307
344
|
value: unknown;
|
|
308
345
|
label: string;
|
|
309
346
|
}>, value: unknown, label: string, nodeId: string, part: string, changed: (value: unknown) => void): HTMLElement;
|
|
347
|
+
/**
|
|
348
|
+
* Owns a themed multi-value picker for a many-valued operator on a field with static choices:
|
|
349
|
+
* the chosen values as removable tags, the rest in a searchable list. It writes the value without
|
|
350
|
+
* redrawing the editor, so the list stays open while the reader picks several.
|
|
351
|
+
* @param {FilterField} field Field with `choices`.
|
|
352
|
+
* @param {any} node Condition.
|
|
353
|
+
* @param {FilterValueMessages} messages Resolved value-builder text.
|
|
354
|
+
* @returns {HTMLElement} Picker root.
|
|
355
|
+
*/
|
|
356
|
+
_tagPicker(field: FilterField, node: any, messages: FilterValueMessages): HTMLElement;
|
|
310
357
|
/** @param {Event} event @returns {void} */
|
|
311
358
|
_handleChange(event: Event): void;
|
|
312
359
|
/** @param {Event} event @returns {void} */
|
|
@@ -371,6 +418,83 @@ export declare class Filter extends Component<FilterOptions> {
|
|
|
371
418
|
*/
|
|
372
419
|
_message(key: string, fallback: string, ...args: unknown[]): string;
|
|
373
420
|
}
|
|
421
|
+
/**
|
|
422
|
+
* The word a compact row's connector shows for a group's logic, and the name it is read by. The
|
|
423
|
+
* name starts with the visible word (WCAG 2.5.3, label in name) and says what a click does.
|
|
424
|
+
* @param {'and'|'or'} logic Group logic.
|
|
425
|
+
* @param {(key: string, fallback: string, ...args: unknown[]) => string} [message] Message
|
|
426
|
+
* resolver; omitted uses the built-in English text.
|
|
427
|
+
* @returns {{word: string, name: string}}
|
|
428
|
+
*/
|
|
429
|
+
export declare function filterConnectorText(logic: 'and' | 'or', message?: (key: string, fallback: string, ...args: unknown[]) => string): {
|
|
430
|
+
word: string;
|
|
431
|
+
name: string;
|
|
432
|
+
};
|
|
433
|
+
/**
|
|
434
|
+
* The logic a group's connector switches it to: the other one, or null when there is no such
|
|
435
|
+
* group or it is the root and `rootLogic` restricts it. The group's select offers the same two
|
|
436
|
+
* values, so the connector and the select always name one state.
|
|
437
|
+
* @param {FilterAst} value Expression.
|
|
438
|
+
* @param {string} groupId Group to switch.
|
|
439
|
+
* @param {'and'|'or'|null} [rootLogic=null] Root restriction, as the `rootLogic` option.
|
|
440
|
+
* @returns {'and'|'or'|null}
|
|
441
|
+
*/
|
|
442
|
+
export declare function nextFilterGroupLogic(value: FilterAst, groupId: string, rootLogic?: 'and' | 'or' | null): 'and' | 'or' | null;
|
|
443
|
+
/**
|
|
444
|
+
* Builds the value of a relative date condition from what its two controls hold: the pair
|
|
445
|
+
* `[amount, unit]`. An empty or non-numeric amount is kept as null — the condition is then
|
|
446
|
+
* incomplete rather than silently zero — and an unknown unit falls back to days.
|
|
447
|
+
* @param {unknown} amount Amount control value.
|
|
448
|
+
* @param {unknown} unit Unit control value.
|
|
449
|
+
* @returns {[number|null, 'days'|'weeks'|'months']}
|
|
450
|
+
*/
|
|
451
|
+
export declare function relativeDateValue(amount: unknown, unit: unknown): [number | null, 'days' | 'weeks' | 'months'];
|
|
452
|
+
/**
|
|
453
|
+
* Reads a stored relative date value for display. Anything that is not `[amount, unit]` — null,
|
|
454
|
+
* or two dates written by the date-pair editor these operators used to get — reads as an empty
|
|
455
|
+
* amount in days.
|
|
456
|
+
* @param {unknown} value Stored condition value.
|
|
457
|
+
* @returns {{amount: number|null, unit: 'days'|'weeks'|'months'}}
|
|
458
|
+
*/
|
|
459
|
+
export declare function readRelativeDateValue(value: unknown): {
|
|
460
|
+
amount: number | null;
|
|
461
|
+
unit: 'days' | 'weeks' | 'months';
|
|
462
|
+
};
|
|
463
|
+
/**
|
|
464
|
+
* Why a relative date value is unusable, or null when it is a positive whole number of a known
|
|
465
|
+
* unit: `[7, 'days']`, `[2, 'weeks']`, `[3, 'months']`.
|
|
466
|
+
* @param {unknown} value Condition value.
|
|
467
|
+
* @returns {'shape'|'amount'|'unit'|null}
|
|
468
|
+
*/
|
|
469
|
+
export declare function relativeDateValueError(value: unknown): 'shape' | 'amount' | 'unit' | null;
|
|
470
|
+
/**
|
|
471
|
+
* Static choices as `TagPicker` items: the raw value — a number stays a number — the label, and
|
|
472
|
+
* the icon as given, a name or a node (the picker copies a node).
|
|
473
|
+
* @param {FilterField['choices']} choices
|
|
474
|
+
* @returns {Array<{value: string|number|boolean, label: string, icon?: Node|string, color?: string}>}
|
|
475
|
+
*/
|
|
476
|
+
export declare function filterTagItems(choices: FilterField['choices']): Array<{
|
|
477
|
+
value: string | number | boolean;
|
|
478
|
+
label: string;
|
|
479
|
+
icon?: Node | string;
|
|
480
|
+
color?: string;
|
|
481
|
+
}>;
|
|
482
|
+
/**
|
|
483
|
+
* The value a `TagPicker` change writes into a many-valued condition: a JSON-safe copy of the
|
|
484
|
+
* chosen raw values, in the order chosen.
|
|
485
|
+
* @param {unknown} values Picker values.
|
|
486
|
+
* @returns {import('./filter-model.js').FilterJson}
|
|
487
|
+
*/
|
|
488
|
+
export declare function filterTagValue(values: unknown): import('./filter-model.js').FilterJson;
|
|
489
|
+
/**
|
|
490
|
+
* A host's `msg` option with one more message: added as a plain key and to every locale table,
|
|
491
|
+
* since a locale entry is looked up first and would otherwise win.
|
|
492
|
+
* @param {Record<string, any>|null|undefined} msg Host messages, flat or by locale.
|
|
493
|
+
* @param {string} key Message key.
|
|
494
|
+
* @param {string} value Message text.
|
|
495
|
+
* @returns {Record<string, any>}
|
|
496
|
+
*/
|
|
497
|
+
export declare function withFilterMessage(msg: Record<string, any> | null | undefined, key: string, value: string): Record<string, any>;
|
|
374
498
|
/** @event Filter#change @type {CustomEvent<Record<string,unknown>>} */
|
|
375
499
|
/** @event Filter#apply @type {CustomEvent<{value:FilterAst}>} */
|
|
376
500
|
/** @event Filter#invalid @type {CustomEvent<Record<string,unknown>>} */
|