@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,176 @@
|
|
|
1
|
+
import { ModuleBar } from '../components/module-bar/module-bar.js';
|
|
2
|
+
export type ModuleItem = import('../components/module-bar/module-bar.js').ModuleItem;
|
|
3
|
+
export type ModuleBarOptions = import('../components/module-bar/module-bar.js').ModuleBarOptions;
|
|
4
|
+
export type AppSidebarOptions = import('../components/app-sidebar/app-sidebar.js').AppSidebarOptions;
|
|
5
|
+
export type ZeyosMenuEntry = {
|
|
6
|
+
/**
|
|
7
|
+
* Entry identifier; a section needs none.
|
|
8
|
+
*/
|
|
9
|
+
id?: string | number;
|
|
10
|
+
/**
|
|
11
|
+
* Entry label.
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
14
|
+
/**
|
|
15
|
+
* Destination.
|
|
16
|
+
*/
|
|
17
|
+
href?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Link browsing context.
|
|
20
|
+
*/
|
|
21
|
+
target?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Application-owned action.
|
|
24
|
+
*/
|
|
25
|
+
invoke?: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Count.
|
|
28
|
+
*/
|
|
29
|
+
badge?: string | number;
|
|
30
|
+
/**
|
|
31
|
+
* Icon name or node.
|
|
32
|
+
*/
|
|
33
|
+
icon?: string | Node;
|
|
34
|
+
/**
|
|
35
|
+
* A heading over `children` rather than a destination.
|
|
36
|
+
*/
|
|
37
|
+
section?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Nested entries.
|
|
40
|
+
*/
|
|
41
|
+
children?: Array<ZeyosMenuEntry | Array<any>>;
|
|
42
|
+
};
|
|
43
|
+
export type ZeyosModuleBarState = {
|
|
44
|
+
/**
|
|
45
|
+
* Permitted module catalogue.
|
|
46
|
+
*/
|
|
47
|
+
modules?: Record<string, string> | Array<string | Record<string, any>>;
|
|
48
|
+
/**
|
|
49
|
+
* Forks, weblets, and authoritative menu entries.
|
|
50
|
+
*/
|
|
51
|
+
menuApps?: Array<Array<any> | Record<string, any>>;
|
|
52
|
+
/**
|
|
53
|
+
* Application identifiers on the bar, in order; the rest are under "All modules".
|
|
54
|
+
*/
|
|
55
|
+
pinned?: string[];
|
|
56
|
+
/**
|
|
57
|
+
* Current module, `fork#…`, or `weblet#…` identifier.
|
|
58
|
+
*/
|
|
59
|
+
activeIdentifier?: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* Current menu entry, when it is more precise than the module.
|
|
62
|
+
*/
|
|
63
|
+
active?: string | number | null;
|
|
64
|
+
/**
|
|
65
|
+
* Permission predicate.
|
|
66
|
+
*/
|
|
67
|
+
canUseModule?: (module: string) => boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Maps an application to href/invoke/value metadata.
|
|
70
|
+
*/
|
|
71
|
+
resolveApplication?: (app: unknown) => Record<string, any> | null;
|
|
72
|
+
/**
|
|
73
|
+
* Each application's menu, keyed by identifier.
|
|
74
|
+
*/
|
|
75
|
+
menus?: Record<string, Array<ZeyosMenuEntry | Array<any>>>;
|
|
76
|
+
/**
|
|
77
|
+
* Badges keyed by application identifier or menu entry id.
|
|
78
|
+
*/
|
|
79
|
+
badges?: Record<string, string | number>;
|
|
80
|
+
/**
|
|
81
|
+
* "All modules" group per application identifier.
|
|
82
|
+
*/
|
|
83
|
+
groups?: Record<string, string>;
|
|
84
|
+
/**
|
|
85
|
+
* Group labels for forks and weblets.
|
|
86
|
+
*/
|
|
87
|
+
labels?: {
|
|
88
|
+
forks?: string;
|
|
89
|
+
weblets?: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Host icon renderer.
|
|
93
|
+
*/
|
|
94
|
+
renderApplicationIcon?: (app: unknown, normalized: Record<string, any>) => Node | null;
|
|
95
|
+
};
|
|
96
|
+
export type ZeyosModuleBarOptions = {
|
|
97
|
+
/**
|
|
98
|
+
* Use stock Font Awesome glyphs instead of the ZeyOS kit.
|
|
99
|
+
*/
|
|
100
|
+
standardIcons?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Tile treatment; ZeyOS draws its modules solid.
|
|
103
|
+
*/
|
|
104
|
+
appearance?: 'solid' | 'tint' | 'plain';
|
|
105
|
+
};
|
|
106
|
+
/** @typedef {import('../components/module-bar/module-bar.js').ModuleItem} ModuleItem */
|
|
107
|
+
/** @typedef {import('../components/module-bar/module-bar.js').ModuleBarOptions} ModuleBarOptions */
|
|
108
|
+
/** @typedef {import('../components/app-sidebar/app-sidebar.js').AppSidebarOptions} AppSidebarOptions */
|
|
109
|
+
/**
|
|
110
|
+
* One entry of a module's menu, as the ZeyOS shell describes it: an object, or an
|
|
111
|
+
* `[id, label, href]` array.
|
|
112
|
+
* @typedef {Object} ZeyosMenuEntry
|
|
113
|
+
* @property {string|number} [id] Entry identifier; a section needs none.
|
|
114
|
+
* @property {string} label Entry label.
|
|
115
|
+
* @property {string} [href] Destination.
|
|
116
|
+
* @property {string} [target] Link browsing context.
|
|
117
|
+
* @property {() => void} [invoke] Application-owned action.
|
|
118
|
+
* @property {string|number} [badge] Count.
|
|
119
|
+
* @property {string|Node} [icon] Icon name or node.
|
|
120
|
+
* @property {boolean} [section] A heading over `children` rather than a destination.
|
|
121
|
+
* @property {Array<ZeyosMenuEntry|Array<any>>} [children] Nested entries.
|
|
122
|
+
*/
|
|
123
|
+
/**
|
|
124
|
+
* The ZeyOS shell state a module bar is built from. The application fields are the launcher's
|
|
125
|
+
* (`buildZeyosLauncherConfig()`), so one state object can feed both.
|
|
126
|
+
* @typedef {Object} ZeyosModuleBarState
|
|
127
|
+
* @property {Record<string, string>|Array<string|Record<string, any>>} [modules={}] Permitted module catalogue.
|
|
128
|
+
* @property {Array<Array<any>|Record<string, any>>} [menuApps=[]] Forks, weblets, and authoritative menu entries.
|
|
129
|
+
* @property {string[]} [pinned] Application identifiers on the bar, in order; the rest are under "All modules".
|
|
130
|
+
* @property {string|null} [activeIdentifier=null] Current module, `fork#…`, or `weblet#…` identifier.
|
|
131
|
+
* @property {string|number|null} [active=null] Current menu entry, when it is more precise than the module.
|
|
132
|
+
* @property {(module: string) => boolean} [canUseModule] Permission predicate.
|
|
133
|
+
* @property {(app: unknown) => Record<string, any>|null} [resolveApplication] Maps an application to href/invoke/value metadata.
|
|
134
|
+
* @property {Record<string, Array<ZeyosMenuEntry|Array<any>>>} [menus={}] Each application's menu, keyed by identifier.
|
|
135
|
+
* @property {Record<string, string|number>} [badges={}] Badges keyed by application identifier or menu entry id.
|
|
136
|
+
* @property {Record<string, string>} [groups={}] "All modules" group per application identifier.
|
|
137
|
+
* @property {{forks?: string, weblets?: string}} [labels] Group labels for forks and weblets.
|
|
138
|
+
* @property {(app: unknown, normalized: Record<string, any>) => Node|null} [renderApplicationIcon] Host icon renderer.
|
|
139
|
+
*/
|
|
140
|
+
/**
|
|
141
|
+
* @typedef {Object} ZeyosModuleBarOptions
|
|
142
|
+
* @property {boolean} [standardIcons=false] Use stock Font Awesome glyphs instead of the ZeyOS kit.
|
|
143
|
+
* @property {'solid'|'tint'|'plain'} [appearance='solid'] Tile treatment; ZeyOS draws its modules solid.
|
|
144
|
+
*/
|
|
145
|
+
/**
|
|
146
|
+
* Maps ZeyOS shell state to module bar items: every permitted module, fork, and weblet with its
|
|
147
|
+
* kit icon, its identity colour (the payload's, else the registry's), its menu, and its badge.
|
|
148
|
+
* A module with a menu is a panel module; one without is a destination.
|
|
149
|
+
* @param {ZeyosModuleBarState} [state={}] Application-owned shell state.
|
|
150
|
+
* @param {ZeyosModuleBarOptions} [options={}] Mapping options.
|
|
151
|
+
* @returns {ModuleItem[]}
|
|
152
|
+
*/
|
|
153
|
+
export declare function zeyosModuleItems(state?: ZeyosModuleBarState, options?: ZeyosModuleBarOptions): ModuleItem[];
|
|
154
|
+
/**
|
|
155
|
+
* Builds plain ModuleBar options from ZeyOS shell state.
|
|
156
|
+
* @param {ZeyosModuleBarState} [state={}] Application-owned shell state.
|
|
157
|
+
* @param {ZeyosModuleBarOptions & ModuleBarOptions} [options={}] Mapping and ModuleBar options.
|
|
158
|
+
* @returns {ModuleBarOptions}
|
|
159
|
+
*/
|
|
160
|
+
export declare function buildZeyosModuleBarConfig(state?: ZeyosModuleBarState, options?: ZeyosModuleBarOptions & ModuleBarOptions): ModuleBarOptions;
|
|
161
|
+
/**
|
|
162
|
+
* Builds AppSidebar options for the modules layout from ZeyOS shell state: the module strip beside
|
|
163
|
+
* a panel with the current module's menu.
|
|
164
|
+
* @param {ZeyosModuleBarState} [state={}] Application-owned shell state.
|
|
165
|
+
* @param {ZeyosModuleBarOptions & AppSidebarOptions} [options={}] Mapping and AppSidebar options.
|
|
166
|
+
* @returns {AppSidebarOptions}
|
|
167
|
+
*/
|
|
168
|
+
export declare function buildZeyosAppSidebarConfig(state?: ZeyosModuleBarState, options?: ZeyosModuleBarOptions & AppSidebarOptions): AppSidebarOptions;
|
|
169
|
+
/**
|
|
170
|
+
* Creates a ModuleBar from ZeyOS shell state.
|
|
171
|
+
* @param {Element|string|null} target Bar target, or null to create one.
|
|
172
|
+
* @param {ZeyosModuleBarState} [state={}] Application-owned shell state.
|
|
173
|
+
* @param {ZeyosModuleBarOptions & ModuleBarOptions} [options={}] Mapping and ModuleBar options.
|
|
174
|
+
* @returns {ModuleBar}
|
|
175
|
+
*/
|
|
176
|
+
export declare function zeyosModuleBar(target: Element | string | null, state?: ZeyosModuleBarState, options?: ZeyosModuleBarOptions & ModuleBarOptions): ModuleBar;
|
|
@@ -65,11 +65,13 @@ export type ServerFilterDefinition = {
|
|
|
65
65
|
*/
|
|
66
66
|
operator?: string;
|
|
67
67
|
/**
|
|
68
|
-
* Semantic value format; date/datetime values become Unix seconds.
|
|
68
|
+
* Semantic value format; date/datetime values become Unix seconds. With
|
|
69
|
+
* a `timeZone` conversion option, a `date` (date-only) value is a calendar day and becomes that
|
|
70
|
+
* day's midnight in the zone, like a ZeyOS form stores it; `datetime` values stay instants.
|
|
69
71
|
*/
|
|
70
72
|
format?: string;
|
|
71
73
|
/**
|
|
72
|
-
* Semantic value type
|
|
74
|
+
* Semantic value type, read like `format`.
|
|
73
75
|
*/
|
|
74
76
|
type?: string;
|
|
75
77
|
/**
|
|
@@ -108,8 +110,10 @@ export type ServerFilterDefinition = {
|
|
|
108
110
|
* @property {string} [rawField] Raw ZeyOS field when the UI id is an alias.
|
|
109
111
|
* @property {string[]} [fields] Raw fields combined as an OR group.
|
|
110
112
|
* @property {string} [operator] ZeyOS comparison operator such as `>=` or `IN`.
|
|
111
|
-
* @property {string} [format] Semantic value format; date/datetime values become Unix seconds.
|
|
112
|
-
*
|
|
113
|
+
* @property {string} [format] Semantic value format; date/datetime values become Unix seconds. With
|
|
114
|
+
* a `timeZone` conversion option, a `date` (date-only) value is a calendar day and becomes that
|
|
115
|
+
* day's midnight in the zone, like a ZeyOS form stores it; `datetime` values stay instants.
|
|
116
|
+
* @property {string} [type] Semantic value type, read like `format`.
|
|
113
117
|
* @property {boolean} [includeEmpty=false] Preserve an empty-string value instead of treating it as inactive UI state.
|
|
114
118
|
* @property {boolean} [includeNull=false] Preserve null instead of treating it as inactive UI state.
|
|
115
119
|
* @property {(value: unknown, state: Record<string, unknown>) => unknown} [transform] Value transform.
|
|
@@ -129,6 +133,85 @@ export declare function dateToUnixSeconds(date: Date | null | undefined): number
|
|
|
129
133
|
* @returns {Date|null} Date value, or null for a nullish input.
|
|
130
134
|
*/
|
|
131
135
|
export declare function unixSecondsToDate(seconds: number | string | null | undefined): Date | null;
|
|
136
|
+
export type CalendarDay = {
|
|
137
|
+
/**
|
|
138
|
+
* Full year.
|
|
139
|
+
*/
|
|
140
|
+
year: number;
|
|
141
|
+
/**
|
|
142
|
+
* Zero-based month, as `Date` counts them.
|
|
143
|
+
*/
|
|
144
|
+
month: number;
|
|
145
|
+
/**
|
|
146
|
+
* Day of the month.
|
|
147
|
+
*/
|
|
148
|
+
day: number;
|
|
149
|
+
};
|
|
150
|
+
export type CalendarZone = {
|
|
151
|
+
/**
|
|
152
|
+
* Canonical IANA zone, or undefined for the runtime's own zone.
|
|
153
|
+
*/
|
|
154
|
+
timeZone: string | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Calendar day an instant falls on in the zone.
|
|
157
|
+
*/
|
|
158
|
+
dayOf: (milliseconds: number) => CalendarDay;
|
|
159
|
+
/**
|
|
160
|
+
* Epoch milliseconds of
|
|
161
|
+
* the first moment of a calendar day in the zone (its midnight, or the first minute after a
|
|
162
|
+
* daylight-saving gap that swallows midnight).
|
|
163
|
+
*/
|
|
164
|
+
midnightOf: (year: number, month: number, day: number) => number;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* @typedef {Object} CalendarDay
|
|
168
|
+
* @property {number} year Full year.
|
|
169
|
+
* @property {number} month Zero-based month, as `Date` counts them.
|
|
170
|
+
* @property {number} day Day of the month.
|
|
171
|
+
*/
|
|
172
|
+
/**
|
|
173
|
+
* @typedef {Object} CalendarZone
|
|
174
|
+
* @property {string|undefined} timeZone Canonical IANA zone, or undefined for the runtime's own zone.
|
|
175
|
+
* @property {(milliseconds: number) => CalendarDay} dayOf Calendar day an instant falls on in the zone.
|
|
176
|
+
* @property {(year: number, month: number, day: number) => number} midnightOf Epoch milliseconds of
|
|
177
|
+
* the first moment of a calendar day in the zone (its midnight, or the first minute after a
|
|
178
|
+
* daylight-saving gap that swallows midnight).
|
|
179
|
+
*/
|
|
180
|
+
/**
|
|
181
|
+
* Reads a ZeyOS date-only value as the calendar day it names. Date-only fields — an invoice's
|
|
182
|
+
* `date` and `duedate`, a contact's `birthdate` — hold Unix seconds at midnight of a day in the
|
|
183
|
+
* instance's time zone: a calendar day, not an instant. The result is midnight of that same day in
|
|
184
|
+
* the runtime's own zone, which is what Datebox and DatePicker edit, so the day survives a viewer in
|
|
185
|
+
* another zone and a daylight-saving change.
|
|
186
|
+
* @param {number|string|null|undefined} seconds Unix seconds; numeric strings are accepted.
|
|
187
|
+
* @param {string} [timeZone] IANA zone of the instance, such as `Europe/Vienna`; the runtime's own
|
|
188
|
+
* zone when omitted.
|
|
189
|
+
* @returns {Date|null} Local midnight of the day, or null for a nullish or empty input.
|
|
190
|
+
*/
|
|
191
|
+
export declare function unixSecondsToCalendarDay(seconds: number | string | null | undefined, timeZone?: string): Date | null;
|
|
192
|
+
/**
|
|
193
|
+
* Converts the calendar day of a Date to the Unix seconds a ZeyOS date-only field stores: midnight
|
|
194
|
+
* of that day in the instance's time zone. Only the Date's local year, month, and day count — its
|
|
195
|
+
* time of day is ignored — so a Datebox value round-trips through {@link unixSecondsToCalendarDay}.
|
|
196
|
+
* @param {Date|null|undefined} date Day to store.
|
|
197
|
+
* @param {string} [timeZone] IANA zone of the instance; the runtime's own zone when omitted.
|
|
198
|
+
* @returns {number|null} Unix seconds, or null for a nullish input.
|
|
199
|
+
*/
|
|
200
|
+
export declare function calendarDayToUnixSeconds(date: Date | null | undefined, timeZone?: string): number | null;
|
|
201
|
+
/**
|
|
202
|
+
* Validates an IANA time-zone name.
|
|
203
|
+
* @param {unknown} timeZone Zone name; nullish or empty selects the runtime's own zone.
|
|
204
|
+
* @returns {string|undefined} The canonical zone name, or undefined for the runtime's own zone.
|
|
205
|
+
* @throws {RangeError} When the runtime does not know the zone.
|
|
206
|
+
*/
|
|
207
|
+
export declare function normalizeTimeZone(timeZone: unknown): string | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* Calendar arithmetic for one time zone. The `Intl` formatter is built once, so a table column can
|
|
210
|
+
* hold one zone for all of its cells.
|
|
211
|
+
* @param {string} [timeZone] IANA zone; the runtime's own zone when omitted.
|
|
212
|
+
* @returns {CalendarZone} Day lookup and midnight construction for the zone.
|
|
213
|
+
*/
|
|
214
|
+
export declare function calendarZone(timeZone?: string): CalendarZone;
|
|
132
215
|
/**
|
|
133
216
|
* Converts one or more Zx Table sort records to the signed field notation used by ZeyOS.
|
|
134
217
|
* A missing sort produces an empty array.
|
|
@@ -136,6 +219,26 @@ export declare function unixSecondsToDate(seconds: number | string | null | unde
|
|
|
136
219
|
* @returns {string[]} Signed raw fields such as `+name` or `-lastmodified`.
|
|
137
220
|
*/
|
|
138
221
|
export declare function tableSortToQuery(sort: ZxSort | ZxSort[] | null | undefined): string[];
|
|
222
|
+
export type FilterConversionOptions = {
|
|
223
|
+
/**
|
|
224
|
+
* IANA zone of the ZeyOS instance. When given, values of
|
|
225
|
+
* `date` (date-only) definitions are calendar days: a `Date` counts by its local year, month, and
|
|
226
|
+
* day, a `YYYY-MM-DD` string by its digits, and either becomes midnight of that day in the zone —
|
|
227
|
+
* exactly what `calendarDayToUnixSeconds()` and `zeyosForm()` store, so a viewer in another zone
|
|
228
|
+
* filters `duedate` by the day they picked. `null` names the runtime's own zone. Omitted, dates
|
|
229
|
+
* convert as exact instants, as they always have.
|
|
230
|
+
*/
|
|
231
|
+
timeZone?: string | null;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* @typedef {Object} FilterConversionOptions
|
|
235
|
+
* @property {string|null} [timeZone] IANA zone of the ZeyOS instance. When given, values of
|
|
236
|
+
* `date` (date-only) definitions are calendar days: a `Date` counts by its local year, month, and
|
|
237
|
+
* day, a `YYYY-MM-DD` string by its digits, and either becomes midnight of that day in the zone —
|
|
238
|
+
* exactly what `calendarDayToUnixSeconds()` and `zeyosForm()` store, so a viewer in another zone
|
|
239
|
+
* filters `duedate` by the day they picked. `null` names the runtime's own zone. Omitted, dates
|
|
240
|
+
* convert as exact instants, as they always have.
|
|
241
|
+
*/
|
|
139
242
|
/**
|
|
140
243
|
* Converts DataFilter state to ZeyOS field predicates. Definitions may rename UI ids,
|
|
141
244
|
* add comparison operators, combine several fields with OR, or transform values. Blank/null
|
|
@@ -143,9 +246,11 @@ export declare function tableSortToQuery(sort: ZxSort | ZxSort[] | null | undefi
|
|
|
143
246
|
* the distinct ZeyOS meanings. Zero and false are always retained.
|
|
144
247
|
* @param {Record<string, unknown>} state DataFilter state keyed by definition id.
|
|
145
248
|
* @param {ServerFilterDefinition[]|Record<string, string|ServerFilterDefinition>} [defs=[]] Server mappings.
|
|
249
|
+
* @param {FilterConversionOptions} [options={}] Conversion options, such as the instance zone.
|
|
146
250
|
* @returns {Record<string, unknown>} ZeyOS `filters` object (plural at the call site).
|
|
251
|
+
* @throws {RangeError} When `options.timeZone` names a zone the runtime does not know.
|
|
147
252
|
*/
|
|
148
|
-
export declare function dataFilterStateToFilters(state: Record<string, unknown>, defs?: ServerFilterDefinition[] | Record<string, string | ServerFilterDefinition
|
|
253
|
+
export declare function dataFilterStateToFilters(state: Record<string, unknown>, defs?: ServerFilterDefinition[] | Record<string, string | ServerFilterDefinition>, options?: FilterConversionOptions): Record<string, unknown>;
|
|
149
254
|
/**
|
|
150
255
|
* Builds the body passed to a generated `client.api.list<Resource>()` operation. Predicates are
|
|
151
256
|
* always emitted under `filters` (plural), which is required for indexed foreign-key matching.
|
|
@@ -22,6 +22,19 @@ export type ResolveFieldOptions = {
|
|
|
22
22
|
* Per-field label overrides.
|
|
23
23
|
*/
|
|
24
24
|
labels?: Record<string, string>;
|
|
25
|
+
/**
|
|
26
|
+
* Per-field semantic format overrides (`date`,
|
|
27
|
+
* `datetime`, `money`, or any registered key). The schema types a timestamp only by its storage,
|
|
28
|
+
* so this is how a Unix-second field the built-in rules misread is declared a calendar day
|
|
29
|
+
* (`date`) or an instant (`datetime`).
|
|
30
|
+
*/
|
|
31
|
+
formats?: Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* IANA time zone of the ZeyOS instance, such as `Europe/Vienna`.
|
|
34
|
+
* Date-only fields store midnight of a calendar day in this zone; it is copied onto every field's
|
|
35
|
+
* metadata as `timeZone`. Defaults to the runtime's own zone.
|
|
36
|
+
*/
|
|
37
|
+
timeZone?: string;
|
|
25
38
|
};
|
|
26
39
|
/** @typedef {Record<string, unknown>} FieldMeta */
|
|
27
40
|
/**
|
|
@@ -34,6 +47,13 @@ export type ResolveFieldOptions = {
|
|
|
34
47
|
* @property {string[]} [fields] Curated allow-list; its order becomes the output order.
|
|
35
48
|
* @property {string[]} [exclude] Field ids to omit.
|
|
36
49
|
* @property {Record<string, string>} [labels] Per-field label overrides.
|
|
50
|
+
* @property {Record<string, string>} [formats] Per-field semantic format overrides (`date`,
|
|
51
|
+
* `datetime`, `money`, or any registered key). The schema types a timestamp only by its storage,
|
|
52
|
+
* so this is how a Unix-second field the built-in rules misread is declared a calendar day
|
|
53
|
+
* (`date`) or an instant (`datetime`).
|
|
54
|
+
* @property {string} [timeZone] IANA time zone of the ZeyOS instance, such as `Europe/Vienna`.
|
|
55
|
+
* Date-only fields store midnight of a calendar day in this zone; it is copied onto every field's
|
|
56
|
+
* metadata as `timeZone`. Defaults to the runtime's own zone.
|
|
37
57
|
*/
|
|
38
58
|
/**
|
|
39
59
|
* Extensible ZeyOS semantic/DB type registry. Keys are normalized to lowercase. Built-in choices:
|
|
@@ -61,7 +81,8 @@ export declare function fieldToZxField(meta: FieldMeta): Record<string, unknown>
|
|
|
61
81
|
/**
|
|
62
82
|
* Converts normalized ZeyOS field metadata to a Zx Table column configuration. Renderers return
|
|
63
83
|
* strings only (never DOM): references/enums show labels, numeric columns are right-aligned,
|
|
64
|
-
* booleans show a check, and Unix seconds are formatted as dates
|
|
84
|
+
* booleans show a check, and Unix seconds are formatted as dates — a date-only field as the
|
|
85
|
+
* calendar day it names in `meta.timeZone`, with no time; a date-time field with its time.
|
|
65
86
|
* @param {FieldMeta} meta Normalized metadata containing at least `id` or `name`.
|
|
66
87
|
* @returns {Record<string, unknown>} Plain Zx Table column descriptor.
|
|
67
88
|
*/
|
|
@@ -71,6 +92,8 @@ export declare function fieldToZxColumn(meta: FieldMeta): Record<string, unknown
|
|
|
71
92
|
* client returns names from `schema.fields(resource)` and definitions from
|
|
72
93
|
* `schema.describe(resource).fields`; embedded `enum` data is authoritative. A compatible
|
|
73
94
|
* `schema.enums(resource, field)` is used when supplied by another client version/stub.
|
|
95
|
+
* `formats` overrides a field's semantic `format`, and `timeZone` is validated once and copied
|
|
96
|
+
* onto every field.
|
|
74
97
|
* @param {Record<string, any>} client Injected `@zeyos/client` instance.
|
|
75
98
|
* @param {string} resource Schema resource name such as `tickets`.
|
|
76
99
|
* @param {ResolveFieldOptions} [opts={}] Curation options.
|