@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
|
@@ -0,0 +1,879 @@
|
|
|
1
|
+
import { Component } from '../../core/component.js';
|
|
2
|
+
import { Search } from '../search/search.js';
|
|
3
|
+
import { Select } from '../select/select.js';
|
|
4
|
+
import { Toggle } from '../toggle/toggle.js';
|
|
5
|
+
export type ViewSettingsField = import('../view/record-view.js').ViewField & ViewSettingsFieldExtras;
|
|
6
|
+
export type ViewSettingsFieldExtras = {
|
|
7
|
+
/**
|
|
8
|
+
* Field type; decides the glyph, the type name, and whether the
|
|
9
|
+
* field is offered for grouping. See the built-in type map in the documentation.
|
|
10
|
+
*/
|
|
11
|
+
type?: string;
|
|
12
|
+
/**
|
|
13
|
+
* `false` keeps the field out of the grouping and board choices;
|
|
14
|
+
* `true` offers it whatever its type. Omitted offers it when its type is discrete.
|
|
15
|
+
*/
|
|
16
|
+
groupable?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The panel offers no handle and no hide button for it, such as
|
|
19
|
+
* the record title; it keeps its place while the other fields arrange around it. This governs
|
|
20
|
+
* only what the panel offers: a bound view has no such notion, and when the view hides a locked
|
|
21
|
+
* field itself, the panel shows it under Hidden with Add like any other.
|
|
22
|
+
*/
|
|
23
|
+
locked?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type ViewSettingsBoard = {
|
|
26
|
+
/**
|
|
27
|
+
* Field whose values are the board's columns.
|
|
28
|
+
*/
|
|
29
|
+
columnBy: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Field whose values are the swim lanes, or null for none.
|
|
32
|
+
*/
|
|
33
|
+
swimlaneBy: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Whether columns without cards stay visible.
|
|
36
|
+
*/
|
|
37
|
+
showEmptyColumns?: boolean;
|
|
38
|
+
};
|
|
39
|
+
export type ViewSettingsBoardOptions = {
|
|
40
|
+
/**
|
|
41
|
+
* Initial column field.
|
|
42
|
+
*/
|
|
43
|
+
columnBy?: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Initial swim-lane field, or null for none.
|
|
46
|
+
*/
|
|
47
|
+
swimlaneBy?: string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Whether columns without cards stay visible.
|
|
50
|
+
*/
|
|
51
|
+
showEmptyColumns?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The field ids offered for columns and swim lanes, in this order.
|
|
54
|
+
* Omitted offers the same fields as the Group section.
|
|
55
|
+
*/
|
|
56
|
+
fields?: string[];
|
|
57
|
+
};
|
|
58
|
+
export type ViewSettingsState = {
|
|
59
|
+
/**
|
|
60
|
+
* Every field id, in order, hidden ones included.
|
|
61
|
+
*/
|
|
62
|
+
fieldOrder: string[];
|
|
63
|
+
/**
|
|
64
|
+
* Hidden field ids, in field order.
|
|
65
|
+
*/
|
|
66
|
+
hiddenFields: string[];
|
|
67
|
+
/**
|
|
68
|
+
* Grouping field, or null for none.
|
|
69
|
+
*/
|
|
70
|
+
groupBy: string | null;
|
|
71
|
+
/**
|
|
72
|
+
* Board settings, or null when the section is omitted.
|
|
73
|
+
*/
|
|
74
|
+
board: ViewSettingsBoard | null;
|
|
75
|
+
};
|
|
76
|
+
export type ViewSettingsGrouping = {
|
|
77
|
+
/**
|
|
78
|
+
* The field ids offered for grouping, in this order. Omitted offers
|
|
79
|
+
* every field with `groupable !== false` and a discrete type.
|
|
80
|
+
*/
|
|
81
|
+
fields?: string[];
|
|
82
|
+
};
|
|
83
|
+
export type ViewSettingsSection = 'fields' | 'grouping' | 'board';
|
|
84
|
+
export type ViewSettingsChangeReason = 'order' | 'visibility' | 'group' | 'board';
|
|
85
|
+
export type ViewSettingsOptions = {
|
|
86
|
+
/**
|
|
87
|
+
* Field descriptors, in their default order. Bound to a
|
|
88
|
+
* view, a non-empty list is also the allow-list: the view's other fields are neither listed nor
|
|
89
|
+
* touched. An empty list takes every field the view has.
|
|
90
|
+
*/
|
|
91
|
+
fields?: ViewSettingsField[];
|
|
92
|
+
/**
|
|
93
|
+
* Preferred field order; missing fields append.
|
|
94
|
+
*/
|
|
95
|
+
fieldOrder?: string[];
|
|
96
|
+
/**
|
|
97
|
+
* Hidden field ids. A field with `visible: false` starts
|
|
98
|
+
* hidden too; a locked field never does.
|
|
99
|
+
*/
|
|
100
|
+
hiddenFields?: string[];
|
|
101
|
+
/**
|
|
102
|
+
* Initial grouping field.
|
|
103
|
+
*/
|
|
104
|
+
groupBy?: string | null;
|
|
105
|
+
/**
|
|
106
|
+
* The Group section. `false` omits it;
|
|
107
|
+
* an object restricts the fields it offers.
|
|
108
|
+
*/
|
|
109
|
+
grouping?: boolean | ViewSettingsGrouping;
|
|
110
|
+
/**
|
|
111
|
+
* The Board section (column field,
|
|
112
|
+
* swim-lane field, show empty columns) with its initial values and, in `fields`, the fields it
|
|
113
|
+
* offers; `false` omits it.
|
|
114
|
+
*/
|
|
115
|
+
board?: ViewSettingsBoardOptions | false;
|
|
116
|
+
/**
|
|
117
|
+
* Order and presence of the sections. Defaults to
|
|
118
|
+
* `['fields', 'grouping', 'board']`; a section whose option is `false` is always left out.
|
|
119
|
+
*/
|
|
120
|
+
sections?: ViewSettingsSection[];
|
|
121
|
+
/**
|
|
122
|
+
* Extends or overrides the
|
|
123
|
+
* built-in type map, keyed by type name.
|
|
124
|
+
*/
|
|
125
|
+
types?: Record<string, {
|
|
126
|
+
icon?: string;
|
|
127
|
+
label?: string;
|
|
128
|
+
}>;
|
|
129
|
+
/**
|
|
130
|
+
* Field count above which the field search is shown.
|
|
131
|
+
*/
|
|
132
|
+
searchThreshold?: number;
|
|
133
|
+
/**
|
|
134
|
+
* Heading level of the section headings.
|
|
135
|
+
*/
|
|
136
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
137
|
+
/**
|
|
138
|
+
* Accessible name of the region; omitted uses the
|
|
139
|
+
* `viewSettings.label` message ("View settings").
|
|
140
|
+
*/
|
|
141
|
+
label?: string | null;
|
|
142
|
+
/**
|
|
143
|
+
* Localized messages.
|
|
144
|
+
*/
|
|
145
|
+
msg?: Record<string, string> | Record<string, Record<string, string>>;
|
|
146
|
+
/**
|
|
147
|
+
* Any change the reader made.
|
|
148
|
+
*/
|
|
149
|
+
onchange?: (event: CustomEvent<{
|
|
150
|
+
state: ViewSettingsState;
|
|
151
|
+
reason: ViewSettingsChangeReason;
|
|
152
|
+
}>) => void;
|
|
153
|
+
/**
|
|
154
|
+
* Field order changed.
|
|
155
|
+
*/
|
|
156
|
+
onfieldorderchange?: (event: CustomEvent<{
|
|
157
|
+
order: string[];
|
|
158
|
+
}>) => void;
|
|
159
|
+
/**
|
|
160
|
+
* A field was added or hidden.
|
|
161
|
+
*/
|
|
162
|
+
onfieldvisibilitychange?: (event: CustomEvent<{
|
|
163
|
+
visible: string[];
|
|
164
|
+
hidden: string[];
|
|
165
|
+
}>) => void;
|
|
166
|
+
/**
|
|
167
|
+
* Grouping field changed.
|
|
168
|
+
*/
|
|
169
|
+
ongroupchange?: (event: CustomEvent<{
|
|
170
|
+
field: string | null;
|
|
171
|
+
}>) => void;
|
|
172
|
+
/**
|
|
173
|
+
* Board settings changed.
|
|
174
|
+
*/
|
|
175
|
+
onboardchange?: (event: CustomEvent<{
|
|
176
|
+
board: ViewSettingsBoard;
|
|
177
|
+
}>) => void;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* One field as the settings know it: a record-view field descriptor plus what only the settings
|
|
181
|
+
* need. Any other `ViewField` property (`get`, `render`, `width`, …) is carried along untouched.
|
|
182
|
+
* @typedef {import('../view/record-view.js').ViewField & ViewSettingsFieldExtras} ViewSettingsField
|
|
183
|
+
*/
|
|
184
|
+
/**
|
|
185
|
+
* @typedef {Object} ViewSettingsFieldExtras
|
|
186
|
+
* @property {string} [type='text'] Field type; decides the glyph, the type name, and whether the
|
|
187
|
+
* field is offered for grouping. See the built-in type map in the documentation.
|
|
188
|
+
* @property {boolean} [groupable] `false` keeps the field out of the grouping and board choices;
|
|
189
|
+
* `true` offers it whatever its type. Omitted offers it when its type is discrete.
|
|
190
|
+
* @property {boolean} [locked=false] The panel offers no handle and no hide button for it, such as
|
|
191
|
+
* the record title; it keeps its place while the other fields arrange around it. This governs
|
|
192
|
+
* only what the panel offers: a bound view has no such notion, and when the view hides a locked
|
|
193
|
+
* field itself, the panel shows it under Hidden with Add like any other.
|
|
194
|
+
*/
|
|
195
|
+
/**
|
|
196
|
+
* @typedef {Object} ViewSettingsBoard
|
|
197
|
+
* @property {string|null} columnBy Field whose values are the board's columns.
|
|
198
|
+
* @property {string|null} swimlaneBy Field whose values are the swim lanes, or null for none.
|
|
199
|
+
* @property {boolean} [showEmptyColumns=true] Whether columns without cards stay visible.
|
|
200
|
+
*/
|
|
201
|
+
/**
|
|
202
|
+
* The `board` option: the initial board settings plus the fields the board may use.
|
|
203
|
+
* @typedef {Object} ViewSettingsBoardOptions
|
|
204
|
+
* @property {string|null} [columnBy=null] Initial column field.
|
|
205
|
+
* @property {string|null} [swimlaneBy=null] Initial swim-lane field, or null for none.
|
|
206
|
+
* @property {boolean} [showEmptyColumns=true] Whether columns without cards stay visible.
|
|
207
|
+
* @property {string[]} [fields] The field ids offered for columns and swim lanes, in this order.
|
|
208
|
+
* Omitted offers the same fields as the Group section.
|
|
209
|
+
*/
|
|
210
|
+
/**
|
|
211
|
+
* @typedef {Object} ViewSettingsState
|
|
212
|
+
* @property {string[]} fieldOrder Every field id, in order, hidden ones included.
|
|
213
|
+
* @property {string[]} hiddenFields Hidden field ids, in field order.
|
|
214
|
+
* @property {string|null} groupBy Grouping field, or null for none.
|
|
215
|
+
* @property {ViewSettingsBoard|null} board Board settings, or null when the section is omitted.
|
|
216
|
+
*/
|
|
217
|
+
/**
|
|
218
|
+
* @typedef {Object} ViewSettingsGrouping
|
|
219
|
+
* @property {string[]} [fields] The field ids offered for grouping, in this order. Omitted offers
|
|
220
|
+
* every field with `groupable !== false` and a discrete type.
|
|
221
|
+
*/
|
|
222
|
+
/** @typedef {'fields'|'grouping'|'board'} ViewSettingsSection */
|
|
223
|
+
/** @typedef {'order'|'visibility'|'group'|'board'} ViewSettingsChangeReason */
|
|
224
|
+
/**
|
|
225
|
+
* @typedef {Object} ViewSettingsOptions
|
|
226
|
+
* @property {ViewSettingsField[]} [fields=[]] Field descriptors, in their default order. Bound to a
|
|
227
|
+
* view, a non-empty list is also the allow-list: the view's other fields are neither listed nor
|
|
228
|
+
* touched. An empty list takes every field the view has.
|
|
229
|
+
* @property {string[]} [fieldOrder=[]] Preferred field order; missing fields append.
|
|
230
|
+
* @property {string[]} [hiddenFields=[]] Hidden field ids. A field with `visible: false` starts
|
|
231
|
+
* hidden too; a locked field never does.
|
|
232
|
+
* @property {string|null} [groupBy=null] Initial grouping field.
|
|
233
|
+
* @property {boolean|ViewSettingsGrouping} [grouping=true] The Group section. `false` omits it;
|
|
234
|
+
* an object restricts the fields it offers.
|
|
235
|
+
* @property {ViewSettingsBoardOptions|false} [board=false] The Board section (column field,
|
|
236
|
+
* swim-lane field, show empty columns) with its initial values and, in `fields`, the fields it
|
|
237
|
+
* offers; `false` omits it.
|
|
238
|
+
* @property {ViewSettingsSection[]} [sections] Order and presence of the sections. Defaults to
|
|
239
|
+
* `['fields', 'grouping', 'board']`; a section whose option is `false` is always left out.
|
|
240
|
+
* @property {Record<string, {icon?: string, label?: string}>} [types={}] Extends or overrides the
|
|
241
|
+
* built-in type map, keyed by type name.
|
|
242
|
+
* @property {number} [searchThreshold=8] Field count above which the field search is shown.
|
|
243
|
+
* @property {2|3|4|5|6} [headingLevel=3] Heading level of the section headings.
|
|
244
|
+
* @property {string|null} [label=null] Accessible name of the region; omitted uses the
|
|
245
|
+
* `viewSettings.label` message ("View settings").
|
|
246
|
+
* @property {Record<string, string>|Record<string, Record<string, string>>} [msg] Localized messages.
|
|
247
|
+
* @property {(event: CustomEvent<{state: ViewSettingsState, reason: ViewSettingsChangeReason}>) => void} [onchange]
|
|
248
|
+
* Any change the reader made.
|
|
249
|
+
* @property {(event: CustomEvent<{order: string[]}>) => void} [onfieldorderchange] Field order changed.
|
|
250
|
+
* @property {(event: CustomEvent<{visible: string[], hidden: string[]}>) => void} [onfieldvisibilitychange]
|
|
251
|
+
* A field was added or hidden.
|
|
252
|
+
* @property {(event: CustomEvent<{field: string|null}>) => void} [ongroupchange] Grouping field changed.
|
|
253
|
+
* @property {(event: CustomEvent<{board: ViewSettingsBoard}>) => void} [onboardchange] Board settings changed.
|
|
254
|
+
*/
|
|
255
|
+
/**
|
|
256
|
+
* The content of a "View settings" panel for a record collection: which fields are shown and in
|
|
257
|
+
* what order, which hidden field to bring back, what the records are grouped by, and which fields
|
|
258
|
+
* a board uses for its columns and swim lanes. It is content, not a container — the host puts it
|
|
259
|
+
* in a `Sheet`, a `Dropdown`, or a settings page.
|
|
260
|
+
*
|
|
261
|
+
* - **Fields** — the shown fields, in order, each with its type glyph. Rows are rearranged by
|
|
262
|
+
* dragging the handle (pointer, touch, or pen) or from the keyboard, and hidden with one button.
|
|
263
|
+
* The hidden fields are listed below with an explicit Add button; with more than
|
|
264
|
+
* `searchThreshold` fields a search narrows them, and Enter adds the first match.
|
|
265
|
+
* - **Group by** — a `Select` of the groupable fields, with None.
|
|
266
|
+
* - **Board** — column field, swim-lane field, and whether empty columns stay.
|
|
267
|
+
*
|
|
268
|
+
* Every move is announced through a polite live region ("Owner moved to position 3 of 6").
|
|
269
|
+
*
|
|
270
|
+
* `bind(view)` connects a `TableView`, `CardView`, or `KanbanView`: order and visibility are
|
|
271
|
+
* pushed into the view and the view's own changes come back. Grouping and board settings are only
|
|
272
|
+
* reported — the host decides how its views apply them.
|
|
273
|
+
* @fires ViewSettings#change
|
|
274
|
+
* @fires ViewSettings#fieldorderchange
|
|
275
|
+
* @fires ViewSettings#fieldvisibilitychange
|
|
276
|
+
* @fires ViewSettings#groupchange
|
|
277
|
+
* @fires ViewSettings#boardchange
|
|
278
|
+
* @extends {Component<ViewSettingsOptions>}
|
|
279
|
+
*/
|
|
280
|
+
export declare class ViewSettings extends Component<ViewSettingsOptions> {
|
|
281
|
+
_createdRoot: boolean;
|
|
282
|
+
_snapshot: import("../../core/dom.js").TargetSnapshot;
|
|
283
|
+
_destroyed: boolean;
|
|
284
|
+
/** @type {ViewSettingsField[]} */
|
|
285
|
+
_fields: ViewSettingsField[];
|
|
286
|
+
_ownIds: Set<string>;
|
|
287
|
+
_order: any;
|
|
288
|
+
_hidden: Set<string>;
|
|
289
|
+
_groupBy: any;
|
|
290
|
+
_board: ViewSettingsBoard;
|
|
291
|
+
/** @type {string[]|null} */
|
|
292
|
+
_boardFields: string[] | null;
|
|
293
|
+
_sections: ViewSettingsSection[];
|
|
294
|
+
_query: any;
|
|
295
|
+
/** @type {Search|null} */
|
|
296
|
+
_search: Search | null;
|
|
297
|
+
/** @type {Select|null} */
|
|
298
|
+
_groupSelect: Select | null;
|
|
299
|
+
/** @type {Select|null} */
|
|
300
|
+
_columnSelect: Select | null;
|
|
301
|
+
/** @type {Select|null} */
|
|
302
|
+
_laneSelect: Select | null;
|
|
303
|
+
/** @type {Toggle|null} */
|
|
304
|
+
_emptyToggle: Toggle | null;
|
|
305
|
+
/** @type {{view: Record<string, any>, controller: AbortController}|null} */
|
|
306
|
+
_bound: {
|
|
307
|
+
view: Record<string, any>;
|
|
308
|
+
controller: AbortController;
|
|
309
|
+
} | null;
|
|
310
|
+
_syncing: boolean;
|
|
311
|
+
_rendering: boolean;
|
|
312
|
+
/** @type {{id: string, original: string[]}|null} */
|
|
313
|
+
_grab: {
|
|
314
|
+
id: string;
|
|
315
|
+
original: string[];
|
|
316
|
+
} | null;
|
|
317
|
+
/** @type {DragState|null} */
|
|
318
|
+
_drag: DragState | null;
|
|
319
|
+
_announceToken: number;
|
|
320
|
+
_level: 2 | 3 | 4 | 5 | 6;
|
|
321
|
+
_instructionsId: string;
|
|
322
|
+
static cssName: string;
|
|
323
|
+
/** @type {Readonly<ViewSettingsOptions>} */
|
|
324
|
+
static defaults: Readonly<ViewSettingsOptions>;
|
|
325
|
+
/**
|
|
326
|
+
* Builds the panel. Runs inside the base constructor, so every piece of instance state is
|
|
327
|
+
* initialized here rather than in a class field.
|
|
328
|
+
* @returns {HTMLElement}
|
|
329
|
+
*/
|
|
330
|
+
render(): HTMLElement;
|
|
331
|
+
/**
|
|
332
|
+
* Returns the current settings as a JSON-safe snapshot.
|
|
333
|
+
* @returns {ViewSettingsState}
|
|
334
|
+
*/
|
|
335
|
+
getState(): ViewSettingsState;
|
|
336
|
+
/**
|
|
337
|
+
* Applies part of a state. Unknown field ids are ignored, missing ones append, and a locked
|
|
338
|
+
* field stays shown. Each part that actually changes emits its own event unless `silent`.
|
|
339
|
+
* A keyboard pick-up or pointer drag in progress is canceled first.
|
|
340
|
+
* @param {Partial<ViewSettingsState>} partial State to apply.
|
|
341
|
+
* @param {{silent?: boolean}} [options={}] Set `silent` to suppress events.
|
|
342
|
+
* @returns {this}
|
|
343
|
+
* @fires ViewSettings#fieldorderchange
|
|
344
|
+
* @fires ViewSettings#fieldvisibilitychange
|
|
345
|
+
* @fires ViewSettings#groupchange
|
|
346
|
+
* @fires ViewSettings#boardchange
|
|
347
|
+
*/
|
|
348
|
+
setState(partial: Partial<ViewSettingsState>, { silent }?: {
|
|
349
|
+
silent?: boolean;
|
|
350
|
+
}): this;
|
|
351
|
+
/**
|
|
352
|
+
* Replaces the field descriptors, keeping order, visibility, grouping, and board settings for
|
|
353
|
+
* every id that still exists.
|
|
354
|
+
*
|
|
355
|
+
* While a view is bound, the view owns the field list: change it with the view's own
|
|
356
|
+
* `setFields()` and the panel follows through `statechange`. A `setFields()` here is not pushed
|
|
357
|
+
* to the view and lasts only until the view's next change.
|
|
358
|
+
* @param {ViewSettingsField[]} fields Next fields.
|
|
359
|
+
* @returns {this}
|
|
360
|
+
*/
|
|
361
|
+
setFields(fields: ViewSettingsField[]): this;
|
|
362
|
+
/**
|
|
363
|
+
* Returns the field descriptors in their current order.
|
|
364
|
+
* @returns {ViewSettingsField[]}
|
|
365
|
+
*/
|
|
366
|
+
getFields(): ViewSettingsField[];
|
|
367
|
+
/**
|
|
368
|
+
* Shows a hidden field at the end of the shown list.
|
|
369
|
+
* @param {string} id Field id.
|
|
370
|
+
* @returns {this}
|
|
371
|
+
* @fires ViewSettings#fieldvisibilitychange
|
|
372
|
+
*/
|
|
373
|
+
showField(id: string): this;
|
|
374
|
+
/**
|
|
375
|
+
* Hides a shown field. A locked field and the last shown field cannot be hidden.
|
|
376
|
+
* @param {string} id Field id.
|
|
377
|
+
* @returns {this}
|
|
378
|
+
* @fires ViewSettings#fieldvisibilitychange
|
|
379
|
+
*/
|
|
380
|
+
hideField(id: string): this;
|
|
381
|
+
/**
|
|
382
|
+
* Moves a shown field to a position among the movable shown fields (locked ones keep theirs).
|
|
383
|
+
* @param {string} id Field id.
|
|
384
|
+
* @param {number} index Zero-based target position among the movable shown fields.
|
|
385
|
+
* @returns {this}
|
|
386
|
+
* @fires ViewSettings#fieldorderchange
|
|
387
|
+
*/
|
|
388
|
+
moveField(id: string, index: number): this;
|
|
389
|
+
/**
|
|
390
|
+
* Connects a record view (`TableView`, `CardView`, `KanbanView`, or anything exposing the
|
|
391
|
+
* `RecordView` state surface). The view's fields and state are read now; order and visibility
|
|
392
|
+
* changes made here are pushed through `setFieldOrder()` and `setFieldVisible()`; and the view's
|
|
393
|
+
* own `statechange` is followed, so a column hidden from a table header disappears here too.
|
|
394
|
+
* The view's labels and types win over the panel's own descriptors, which supply only what the
|
|
395
|
+
* view lacks (`locked`, `groupable`, a type the view leaves at its `'text'` default). While
|
|
396
|
+
* bound, the view owns the field list; see `setFields()`.
|
|
397
|
+
*
|
|
398
|
+
* Grouping and board settings are never applied to the view — they are emitted, and the host
|
|
399
|
+
* decides (a `CardView` is re-created or given a new `groupBy`, a `KanbanView` its axes). A
|
|
400
|
+
* view's own `groupBy`, `columnBy`, and `swimlaneBy` options are adopted when they name fields.
|
|
401
|
+
* @param {object} view Record view.
|
|
402
|
+
* @param {{board?: ViewSettingsBoard|false}} [options={}] `board` replaces the board settings
|
|
403
|
+
* read from the view.
|
|
404
|
+
* @returns {this}
|
|
405
|
+
*/
|
|
406
|
+
bind(view: object, options?: {
|
|
407
|
+
board?: ViewSettingsBoard | false;
|
|
408
|
+
}): this;
|
|
409
|
+
/**
|
|
410
|
+
* Releases a bound view. The settings keep their current state.
|
|
411
|
+
* @returns {this}
|
|
412
|
+
*/
|
|
413
|
+
unbind(): this;
|
|
414
|
+
/**
|
|
415
|
+
* Focuses the field search, or the first control of the shown list when there is no search.
|
|
416
|
+
* @returns {this}
|
|
417
|
+
*/
|
|
418
|
+
focus(): this;
|
|
419
|
+
/**
|
|
420
|
+
* Destroys the nested controls, releases a bound view, and restores an enhanced target.
|
|
421
|
+
* @returns {void}
|
|
422
|
+
*/
|
|
423
|
+
destroy(): void;
|
|
424
|
+
/**
|
|
425
|
+
* @param {string} text Heading text.
|
|
426
|
+
* @param {number} [offset=0] Levels below the section heading.
|
|
427
|
+
* @param {string} [className='zx-view-settings__heading'] Heading class.
|
|
428
|
+
* @returns {{element: HTMLElement, id: string}}
|
|
429
|
+
*/
|
|
430
|
+
_heading(text: string, offset?: number, className?: string): {
|
|
431
|
+
element: HTMLElement;
|
|
432
|
+
id: string;
|
|
433
|
+
};
|
|
434
|
+
/** @returns {HTMLElement} The Fields section. */
|
|
435
|
+
_buildFieldsSection(): HTMLElement;
|
|
436
|
+
/** @returns {HTMLElement} The Group section. */
|
|
437
|
+
_buildGroupSection(): HTMLElement;
|
|
438
|
+
/** @returns {HTMLElement} The Board section. */
|
|
439
|
+
_buildBoardSection(): HTMLElement;
|
|
440
|
+
/**
|
|
441
|
+
* Creates or removes the field search to match the field count.
|
|
442
|
+
* @returns {void}
|
|
443
|
+
*/
|
|
444
|
+
_syncSearch(): void;
|
|
445
|
+
/**
|
|
446
|
+
* Rebuilds both field lists, then puts focus back: on the control asked for, or else on the same
|
|
447
|
+
* control of the same field when focus was inside the lists. A pointer drag in progress ends —
|
|
448
|
+
* the rows it measured are about to be replaced — and so does a keyboard pick-up, unless the
|
|
449
|
+
* redraw is that pick-up's own step.
|
|
450
|
+
* @param {{id: string, part: 'handle'|'hide'|'add'}|null} [focus=null] Control to focus afterwards.
|
|
451
|
+
* @param {{keepGrab?: boolean}} [options={}] `keepGrab` marks a redraw made by the pick-up itself.
|
|
452
|
+
* @returns {void}
|
|
453
|
+
*/
|
|
454
|
+
_renderFields(focus?: {
|
|
455
|
+
id: string;
|
|
456
|
+
part: 'handle' | 'hide' | 'add';
|
|
457
|
+
} | null, { keepGrab }?: {
|
|
458
|
+
keepGrab?: boolean;
|
|
459
|
+
}): void;
|
|
460
|
+
/**
|
|
461
|
+
* @param {ViewSettingsField} field Field.
|
|
462
|
+
* @param {boolean} canHideAny Whether more than one field is shown.
|
|
463
|
+
* @returns {HTMLElement}
|
|
464
|
+
*/
|
|
465
|
+
_shownRow(field: ViewSettingsField, canHideAny: boolean): HTMLElement;
|
|
466
|
+
/**
|
|
467
|
+
* @param {ViewSettingsField} field Field.
|
|
468
|
+
* @returns {HTMLElement}
|
|
469
|
+
*/
|
|
470
|
+
_hiddenRow(field: ViewSettingsField): HTMLElement;
|
|
471
|
+
/**
|
|
472
|
+
* The type glyph a row shows before its label. The glyph is decorative; the type name is the
|
|
473
|
+
* element's `title` for the pointer and visually hidden text for everyone else. It follows the
|
|
474
|
+
* label in the source, so a row reads "Owner, Text" — the glyph is placed first by CSS.
|
|
475
|
+
* @param {string|undefined} type Field type.
|
|
476
|
+
* @returns {HTMLElement}
|
|
477
|
+
*/
|
|
478
|
+
_typeBadge(type: string | undefined): HTMLElement;
|
|
479
|
+
/** @param {string|undefined} type @returns {Element} The type's decorative glyph. */
|
|
480
|
+
_typeGlyph(type: string | undefined): Element;
|
|
481
|
+
/** @param {string|undefined} type @returns {string} The translated type name. */
|
|
482
|
+
_typeLabel(type: string | undefined): string;
|
|
483
|
+
/** @param {SelectFieldItem} item @returns {HTMLElement} Option content with the type glyph. */
|
|
484
|
+
_optionContent(item: SelectFieldItem): HTMLElement;
|
|
485
|
+
/** Refreshes the grouping and board controls from state. @returns {void} */
|
|
486
|
+
_syncGroupControls(): void;
|
|
487
|
+
/** @param {string} query @returns {void} */
|
|
488
|
+
_setQuery(query: string): void;
|
|
489
|
+
/** Adds the first hidden field matching the query; Enter in the search. @returns {void} */
|
|
490
|
+
_addFirstMatch(): void;
|
|
491
|
+
/**
|
|
492
|
+
* Shows a field from the hidden list and moves focus somewhere sensible.
|
|
493
|
+
* @param {string} id Field id.
|
|
494
|
+
* @param {boolean} fromButton Whether the Add button was used (focus moves to the next one).
|
|
495
|
+
* @returns {void}
|
|
496
|
+
*/
|
|
497
|
+
_addFromPanel(id: string, fromButton: boolean): void;
|
|
498
|
+
/** @param {MouseEvent} event @returns {void} */
|
|
499
|
+
_onHiddenClick(event: MouseEvent): void;
|
|
500
|
+
/** @param {MouseEvent} event @returns {void} */
|
|
501
|
+
_onShownClick(event: MouseEvent): void;
|
|
502
|
+
/** @param {KeyboardEvent} event @returns {void} */
|
|
503
|
+
_onHandleKeydown(event: KeyboardEvent): void;
|
|
504
|
+
/** A picked-up field is dropped where it is when focus leaves it. @param {FocusEvent} event @returns {void} */
|
|
505
|
+
_onHandleFocusout(event: FocusEvent): void;
|
|
506
|
+
/**
|
|
507
|
+
* @param {string} id Field id.
|
|
508
|
+
* @param {number} target Target index among movable fields.
|
|
509
|
+
* @param {boolean} commit Whether the move is final (emitted) or part of a pick-up.
|
|
510
|
+
* @returns {void}
|
|
511
|
+
*/
|
|
512
|
+
_moveFromKeyboard(id: string, target: number, commit: boolean): void;
|
|
513
|
+
/** @param {string} id @returns {void} */
|
|
514
|
+
_pickUp(id: string): void;
|
|
515
|
+
/**
|
|
516
|
+
* @param {{id: string, part: 'handle'|'hide'|'add'}|null} [focus] Control to focus afterwards;
|
|
517
|
+
* omitted keeps focus on the dropped row's handle when it had it.
|
|
518
|
+
* @returns {void}
|
|
519
|
+
*/
|
|
520
|
+
_drop(focus?: {
|
|
521
|
+
id: string;
|
|
522
|
+
part: 'handle' | 'hide' | 'add';
|
|
523
|
+
} | null): void;
|
|
524
|
+
/** @returns {void} */
|
|
525
|
+
_cancelGrab(): void;
|
|
526
|
+
/**
|
|
527
|
+
* Ends whatever reordering is in progress before state changes from outside: a keyboard
|
|
528
|
+
* pick-up returns the row to where it was, and a pointer drag is dropped nowhere.
|
|
529
|
+
* @returns {void}
|
|
530
|
+
*/
|
|
531
|
+
_settle(): void;
|
|
532
|
+
/** @param {string} id Field whose move was canceled. @returns {void} */
|
|
533
|
+
_announceCanceled(id: string): void;
|
|
534
|
+
/** @param {PointerEvent} event @returns {void} */
|
|
535
|
+
_onPointerDown(event: PointerEvent): void;
|
|
536
|
+
/** @param {PointerEvent} event @returns {void} */
|
|
537
|
+
_onPointerMove(event: PointerEvent): void;
|
|
538
|
+
/** @param {PointerEvent} event @returns {void} */
|
|
539
|
+
_onPointerUp(event: PointerEvent): void;
|
|
540
|
+
/**
|
|
541
|
+
* Starts a pointer drag: the dragged row follows the pointer, and a frame loop scrolls the
|
|
542
|
+
* nearest scroll container while the pointer rests near its top or bottom edge.
|
|
543
|
+
* @param {DragState} drag Press being promoted.
|
|
544
|
+
* @returns {void}
|
|
545
|
+
*/
|
|
546
|
+
_beginDrag(drag: DragState): void;
|
|
547
|
+
/** @param {DragState} drag Active drag. @returns {void} */
|
|
548
|
+
_scheduleAutoScroll(drag: DragState): void;
|
|
549
|
+
/**
|
|
550
|
+
* Moves the dragged row under the pointer — compensating for any scroll since the drag began —
|
|
551
|
+
* and updates the insertion line.
|
|
552
|
+
* @param {DragState} drag Active drag.
|
|
553
|
+
* @returns {void}
|
|
554
|
+
*/
|
|
555
|
+
_positionDrag(drag: DragState): void;
|
|
556
|
+
/**
|
|
557
|
+
* Resolves and marks the insertion point. The other rows are measured on every call rather than
|
|
558
|
+
* once at the start, so a list scrolled mid-drag still drops where the line says.
|
|
559
|
+
* @param {DragState} drag Active drag.
|
|
560
|
+
* @param {number} y Pointer client y.
|
|
561
|
+
* @returns {void}
|
|
562
|
+
*/
|
|
563
|
+
_updateDropTarget(drag: DragState, y: number): void;
|
|
564
|
+
/** @param {DragState} drag @returns {void} */
|
|
565
|
+
_endDrag(drag: DragState): void;
|
|
566
|
+
/** @param {boolean} [announce=false] Whether to say so. @returns {void} */
|
|
567
|
+
_cancelDrag(announce?: boolean): void;
|
|
568
|
+
/** @param {string|null} field @returns {void} */
|
|
569
|
+
_setGroup(field: string | null): void;
|
|
570
|
+
/** @param {Partial<ViewSettingsBoard>} patch @returns {void} */
|
|
571
|
+
_setBoard(patch: Partial<ViewSettingsBoard>): void;
|
|
572
|
+
/** @param {boolean} [withChange=true] Whether `change` follows. @returns {void} */
|
|
573
|
+
_emitOrder(withChange?: boolean): void;
|
|
574
|
+
/** @returns {void} */
|
|
575
|
+
_emitVisibility(): void;
|
|
576
|
+
/** @returns {void} */
|
|
577
|
+
_emitGroup(): void;
|
|
578
|
+
/** @returns {void} */
|
|
579
|
+
_emitBoard(): void;
|
|
580
|
+
/** @param {ViewSettingsChangeReason} reason @returns {void} */
|
|
581
|
+
_emitChange(reason: ViewSettingsChangeReason): void;
|
|
582
|
+
/** Pushes order and visibility into the bound view. @returns {void} */
|
|
583
|
+
_pushToView(): void;
|
|
584
|
+
/**
|
|
585
|
+
* Reads fields, order, and visibility from the bound view. Silent: the view reported its own
|
|
586
|
+
* change already, and echoing it from here would hand the host the same change twice.
|
|
587
|
+
* @param {boolean} withFields Whether the field descriptors are re-read too.
|
|
588
|
+
* @returns {void}
|
|
589
|
+
*/
|
|
590
|
+
_pullFromView(withFields: boolean): void;
|
|
591
|
+
/** @returns {string[]} Locked field ids. */
|
|
592
|
+
_lockedIds(): string[];
|
|
593
|
+
/** @returns {string[]} Shown, movable field ids in order. */
|
|
594
|
+
_movableIds(): string[];
|
|
595
|
+
/** @param {string} id @returns {ViewSettingsField|undefined} */
|
|
596
|
+
_field(id: string): ViewSettingsField | undefined;
|
|
597
|
+
/** @param {string} id @returns {boolean} Whether the field may be hidden now. */
|
|
598
|
+
_canHide(id: string): boolean;
|
|
599
|
+
/**
|
|
600
|
+
* Whether `candidate` keeps a hide button once `removed` is hidden.
|
|
601
|
+
* @param {string} candidate Field id.
|
|
602
|
+
* @param {string} removed Field being hidden.
|
|
603
|
+
* @returns {boolean}
|
|
604
|
+
*/
|
|
605
|
+
_canHideAfter(candidate: string, removed: string): boolean;
|
|
606
|
+
/** @param {string} id @returns {HTMLElement|null} The shown row for a field. */
|
|
607
|
+
_row(id: string): HTMLElement | null;
|
|
608
|
+
/** @param {string} id @returns {{position: number, total: number}} 1-based place in the shown list. */
|
|
609
|
+
_position(id: string): {
|
|
610
|
+
position: number;
|
|
611
|
+
total: number;
|
|
612
|
+
};
|
|
613
|
+
/** @param {string} id @returns {void} */
|
|
614
|
+
_announceMove(id: string): void;
|
|
615
|
+
/** @returns {{id: string, part: 'handle'|'hide'|'add'}|null} The focused row control, if any. */
|
|
616
|
+
_activePart(): {
|
|
617
|
+
id: string;
|
|
618
|
+
part: 'handle' | 'hide' | 'add';
|
|
619
|
+
} | null;
|
|
620
|
+
/**
|
|
621
|
+
* @param {Element|null} element A focus target.
|
|
622
|
+
* @returns {{id: string, part: 'handle'|'hide'|'add'}|null} The row control it is, if any.
|
|
623
|
+
*/
|
|
624
|
+
_partOf(element: Element | null): {
|
|
625
|
+
id: string;
|
|
626
|
+
part: 'handle' | 'hide' | 'add';
|
|
627
|
+
} | null;
|
|
628
|
+
/** @param {{id: string, part: 'handle'|'hide'|'add'}} focus @returns {void} */
|
|
629
|
+
_focusPart(focus: {
|
|
630
|
+
id: string;
|
|
631
|
+
part: 'handle' | 'hide' | 'add';
|
|
632
|
+
}): void;
|
|
633
|
+
/** @param {string} message @returns {void} */
|
|
634
|
+
_announce(message: string): void;
|
|
635
|
+
/**
|
|
636
|
+
* Resolves a message through the host translator, falling back to the built-in English text.
|
|
637
|
+
* @param {string} key Message key.
|
|
638
|
+
* @param {string} fallback Built-in text, with `%1`-style placeholders.
|
|
639
|
+
* @param {...unknown} args Interpolation values.
|
|
640
|
+
* @returns {string}
|
|
641
|
+
*/
|
|
642
|
+
_message(key: string, fallback: string, ...args: unknown[]): string;
|
|
643
|
+
}
|
|
644
|
+
export type DragState = {
|
|
645
|
+
/**
|
|
646
|
+
* Field being dragged.
|
|
647
|
+
*/
|
|
648
|
+
id: string;
|
|
649
|
+
/**
|
|
650
|
+
* Pointer that pressed the handle.
|
|
651
|
+
*/
|
|
652
|
+
pointerId: number;
|
|
653
|
+
/**
|
|
654
|
+
* Pointer-down client x.
|
|
655
|
+
*/
|
|
656
|
+
startX: number;
|
|
657
|
+
/**
|
|
658
|
+
* Pointer-down client y.
|
|
659
|
+
*/
|
|
660
|
+
startY: number;
|
|
661
|
+
/**
|
|
662
|
+
* Whether the press has travelled far enough to be a drag.
|
|
663
|
+
*/
|
|
664
|
+
active: boolean;
|
|
665
|
+
/**
|
|
666
|
+
* Whether the drag is being torn down.
|
|
667
|
+
*/
|
|
668
|
+
ending: boolean;
|
|
669
|
+
/**
|
|
670
|
+
* Captured handle.
|
|
671
|
+
*/
|
|
672
|
+
handle: HTMLElement;
|
|
673
|
+
/**
|
|
674
|
+
* Latest pointer client y.
|
|
675
|
+
*/
|
|
676
|
+
y: number;
|
|
677
|
+
/**
|
|
678
|
+
* Dragged row.
|
|
679
|
+
*/
|
|
680
|
+
row: HTMLElement;
|
|
681
|
+
/**
|
|
682
|
+
* Target index among the movable fields.
|
|
683
|
+
*/
|
|
684
|
+
target: number | null;
|
|
685
|
+
/**
|
|
686
|
+
* Nearest scroll container of the list.
|
|
687
|
+
*/
|
|
688
|
+
scroller: Element | null;
|
|
689
|
+
/**
|
|
690
|
+
* Its scroll position when the drag began.
|
|
691
|
+
*/
|
|
692
|
+
startScroll: number;
|
|
693
|
+
/**
|
|
694
|
+
* Its scroll position when the row was last placed.
|
|
695
|
+
*/
|
|
696
|
+
lastScroll: number;
|
|
697
|
+
/**
|
|
698
|
+
* Pending auto-scroll frame, or 0.
|
|
699
|
+
*/
|
|
700
|
+
frame: number;
|
|
701
|
+
};
|
|
702
|
+
export type SelectFieldItem = {
|
|
703
|
+
ID: string;
|
|
704
|
+
name: string;
|
|
705
|
+
type: string;
|
|
706
|
+
};
|
|
707
|
+
/**
|
|
708
|
+
* Any change the reader made, after the specific event.
|
|
709
|
+
* @event ViewSettings#change
|
|
710
|
+
* @type {CustomEvent<{state: ViewSettingsState, reason: ViewSettingsChangeReason}>}
|
|
711
|
+
*/
|
|
712
|
+
/**
|
|
713
|
+
* The field order changed.
|
|
714
|
+
* @event ViewSettings#fieldorderchange
|
|
715
|
+
* @type {CustomEvent<{order: string[]}>}
|
|
716
|
+
*/
|
|
717
|
+
/**
|
|
718
|
+
* A field was added or hidden.
|
|
719
|
+
* @event ViewSettings#fieldvisibilitychange
|
|
720
|
+
* @type {CustomEvent<{visible: string[], hidden: string[]}>}
|
|
721
|
+
*/
|
|
722
|
+
/**
|
|
723
|
+
* The grouping field changed; null is no grouping.
|
|
724
|
+
* @event ViewSettings#groupchange
|
|
725
|
+
* @type {CustomEvent<{field: string|null}>}
|
|
726
|
+
*/
|
|
727
|
+
/**
|
|
728
|
+
* A board setting changed.
|
|
729
|
+
* @event ViewSettings#boardchange
|
|
730
|
+
* @type {CustomEvent<{board: ViewSettingsBoard}>}
|
|
731
|
+
*/
|
|
732
|
+
/**
|
|
733
|
+
* @typedef {Object} DragState
|
|
734
|
+
* @property {string} id Field being dragged.
|
|
735
|
+
* @property {number} pointerId Pointer that pressed the handle.
|
|
736
|
+
* @property {number} startX Pointer-down client x.
|
|
737
|
+
* @property {number} startY Pointer-down client y.
|
|
738
|
+
* @property {boolean} active Whether the press has travelled far enough to be a drag.
|
|
739
|
+
* @property {boolean} ending Whether the drag is being torn down.
|
|
740
|
+
* @property {HTMLElement} handle Captured handle.
|
|
741
|
+
* @property {number} y Latest pointer client y.
|
|
742
|
+
* @property {HTMLElement} row Dragged row.
|
|
743
|
+
* @property {number|null} target Target index among the movable fields.
|
|
744
|
+
* @property {Element|null} scroller Nearest scroll container of the list.
|
|
745
|
+
* @property {number} startScroll Its scroll position when the drag began.
|
|
746
|
+
* @property {number} lastScroll Its scroll position when the row was last placed.
|
|
747
|
+
* @property {number} frame Pending auto-scroll frame, or 0.
|
|
748
|
+
*/
|
|
749
|
+
/** @typedef {{ID: string, name: string, type: string}} SelectFieldItem */
|
|
750
|
+
/**
|
|
751
|
+
* Validates and clones field descriptors: ids become trimmed strings, a missing label is derived
|
|
752
|
+
* from the id, `type` defaults to `'text'`, and `locked` and `groupable` are read as booleans.
|
|
753
|
+
* @param {ViewSettingsField[]} fields Raw descriptors.
|
|
754
|
+
* @returns {ViewSettingsField[]}
|
|
755
|
+
*/
|
|
756
|
+
export declare function normalizeViewSettingsFields(fields: ViewSettingsField[]): ViewSettingsField[];
|
|
757
|
+
/**
|
|
758
|
+
* Resolves a field type to its glyph and English name, through the host's `types` overrides, the
|
|
759
|
+
* alias table (`int` → number, `enum` → select, …), and the built-in map. An unknown type keeps
|
|
760
|
+
* its own name and the text glyph, so a server's new type still shows something sensible.
|
|
761
|
+
* @param {string|null|undefined} type Field type.
|
|
762
|
+
* @param {Record<string, {icon?: string, label?: string}>|null} [overrides=null] Host overrides.
|
|
763
|
+
* @returns {{type: string, icon: string, label: string, key: string|null}} `key` is the message
|
|
764
|
+
* key of a built-in label, null for a host-supplied or derived one.
|
|
765
|
+
*/
|
|
766
|
+
export declare function resolveFieldType(type: string | null | undefined, overrides?: Record<string, {
|
|
767
|
+
icon?: string;
|
|
768
|
+
label?: string;
|
|
769
|
+
}> | null): {
|
|
770
|
+
type: string;
|
|
771
|
+
icon: string;
|
|
772
|
+
label: string;
|
|
773
|
+
key: string | null;
|
|
774
|
+
};
|
|
775
|
+
/**
|
|
776
|
+
* Whether a type sorts records into a few named buckets — what grouping, board columns, and swim
|
|
777
|
+
* lanes need: text, select (and enum), status, priority, boolean, and entity.
|
|
778
|
+
* @param {string|null|undefined} type Field type.
|
|
779
|
+
* @returns {boolean}
|
|
780
|
+
*/
|
|
781
|
+
export declare function isDiscreteFieldType(type: string | null | undefined): boolean;
|
|
782
|
+
/**
|
|
783
|
+
* The field ids offered for grouping. `grouping.fields` restricts and orders them; otherwise every
|
|
784
|
+
* field is offered whose `groupable` is `true`, or is not `false` and whose type is discrete.
|
|
785
|
+
* @param {ViewSettingsField[]} fields Normalized fields.
|
|
786
|
+
* @param {boolean|ViewSettingsGrouping|null|undefined} grouping The `grouping` option.
|
|
787
|
+
* @returns {string[]}
|
|
788
|
+
*/
|
|
789
|
+
export declare function groupingFieldIds(fields: ViewSettingsField[], grouping: boolean | ViewSettingsGrouping | null | undefined): string[];
|
|
790
|
+
/**
|
|
791
|
+
* Whether a field matches a search query. Case and accents are ignored, every word must appear,
|
|
792
|
+
* and the label, the id, and the type name are all searched — "date" finds every date field.
|
|
793
|
+
* @param {{id: string, label?: string}} field Field.
|
|
794
|
+
* @param {string} query Search text.
|
|
795
|
+
* @param {string} [typeLabel=''] The field's type name.
|
|
796
|
+
* @returns {boolean}
|
|
797
|
+
*/
|
|
798
|
+
export declare function matchesFieldQuery(field: {
|
|
799
|
+
id: string;
|
|
800
|
+
label?: string;
|
|
801
|
+
}, query: string, typeLabel?: string): boolean;
|
|
802
|
+
/**
|
|
803
|
+
* Moves one shown field to a position among the movable shown fields. Locked fields keep their
|
|
804
|
+
* slots and hidden fields keep their place in the full order; the result is a new full order.
|
|
805
|
+
* An unknown, hidden, or locked id returns an unchanged copy.
|
|
806
|
+
* @param {string[]} order Full field order.
|
|
807
|
+
* @param {Iterable<string>} hidden Hidden field ids.
|
|
808
|
+
* @param {Iterable<string>} locked Locked field ids.
|
|
809
|
+
* @param {string} id Field to move.
|
|
810
|
+
* @param {number} index Target position among the movable shown fields; clamped.
|
|
811
|
+
* @returns {string[]}
|
|
812
|
+
*/
|
|
813
|
+
export declare function moveVisibleField(order: string[], hidden: Iterable<string>, locked: Iterable<string>, id: string, index: number): string[];
|
|
814
|
+
/**
|
|
815
|
+
* Shows a hidden field at the end of the shown fields: it leaves the hidden set and moves to just
|
|
816
|
+
* after the last shown field, so "Add" puts it where the reader is looking.
|
|
817
|
+
* @param {string[]} order Full field order.
|
|
818
|
+
* @param {Iterable<string>} hidden Hidden field ids.
|
|
819
|
+
* @param {string} id Field to show.
|
|
820
|
+
* @returns {{order: string[], hidden: string[]}}
|
|
821
|
+
*/
|
|
822
|
+
export declare function showFieldInOrder(order: string[], hidden: Iterable<string>, id: string): {
|
|
823
|
+
order: string[];
|
|
824
|
+
hidden: string[];
|
|
825
|
+
};
|
|
826
|
+
/**
|
|
827
|
+
* The gap a pointer is over, given the vertical midpoints of the rows: 0 is above the first row,
|
|
828
|
+
* `middles.length` below the last.
|
|
829
|
+
* @param {number[]} middles Row midpoints, top to bottom.
|
|
830
|
+
* @param {number} y Pointer position.
|
|
831
|
+
* @returns {number}
|
|
832
|
+
*/
|
|
833
|
+
export declare function dropGapIndex(middles: number[], y: number): number;
|
|
834
|
+
/**
|
|
835
|
+
* Merges a bound view's field with the panel's own descriptor for it. The view's label and type
|
|
836
|
+
* win; the panel's descriptor supplies only what the view lacks — `locked`, `groupable`, and a
|
|
837
|
+
* type where the view reports just the `'text'` default a record view fills in for none.
|
|
838
|
+
* @param {ViewSettingsField|null} own The panel's descriptor, if it has one.
|
|
839
|
+
* @param {ViewSettingsField} field The view's descriptor.
|
|
840
|
+
* @returns {ViewSettingsField}
|
|
841
|
+
*/
|
|
842
|
+
export declare function mergeViewField(own: ViewSettingsField | null, field: ViewSettingsField): ViewSettingsField;
|
|
843
|
+
/**
|
|
844
|
+
* How far a drag should scroll its container this frame: up when the pointer is within `edge`
|
|
845
|
+
* pixels of the top and the list continues above, down likewise at the bottom, otherwise 0.
|
|
846
|
+
* @param {number} y Pointer client y.
|
|
847
|
+
* @param {{top: number, bottom: number}} edges The container's visible top and bottom.
|
|
848
|
+
* @param {{top: number, bottom: number}} list The list's client rectangle.
|
|
849
|
+
* @param {number} [edge=32] Width of the edge band in pixels.
|
|
850
|
+
* @param {number} [step=12] Pixels per frame.
|
|
851
|
+
* @returns {number}
|
|
852
|
+
*/
|
|
853
|
+
export declare function autoScrollDelta(y: number, edges: {
|
|
854
|
+
top: number;
|
|
855
|
+
bottom: number;
|
|
856
|
+
}, list: {
|
|
857
|
+
top: number;
|
|
858
|
+
bottom: number;
|
|
859
|
+
}, edge?: number, step?: number): number;
|
|
860
|
+
/**
|
|
861
|
+
* Resolves the sections to render, in order: the `sections` option (or the default order) with
|
|
862
|
+
* unknown and duplicate names dropped, and the grouping or board section removed when its option
|
|
863
|
+
* is `false`.
|
|
864
|
+
* @param {unknown} sections The `sections` option.
|
|
865
|
+
* @param {{grouping?: unknown, board?: unknown}} options The `grouping` and `board` options.
|
|
866
|
+
* @returns {ViewSettingsSection[]}
|
|
867
|
+
*/
|
|
868
|
+
export declare function normalizeSections(sections: unknown, options?: {
|
|
869
|
+
grouping?: unknown;
|
|
870
|
+
board?: unknown;
|
|
871
|
+
}): ViewSettingsSection[];
|
|
872
|
+
/**
|
|
873
|
+
* Normalizes board settings. `false` and null mean no board. With `ids`, a field that does not
|
|
874
|
+
* exist becomes null, and a swim-lane field equal to the column field is dropped.
|
|
875
|
+
* @param {unknown} board Raw board settings.
|
|
876
|
+
* @param {string[]|null} [ids=null] Known field ids, or null to skip the check.
|
|
877
|
+
* @returns {ViewSettingsBoard|null}
|
|
878
|
+
*/
|
|
879
|
+
export declare function normalizeBoard(board: unknown, ids?: string[] | null): ViewSettingsBoard | null;
|