@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.
Files changed (252) hide show
  1. package/CHANGELOG.md +447 -0
  2. package/README.md +44 -11
  3. package/dist/types/components/account-menu/account-menu.d.ts +8 -0
  4. package/dist/types/components/activity-list/activity-list.d.ts +31 -1
  5. package/dist/types/components/app-icon/app-icon.d.ts +14 -2
  6. package/dist/types/components/app-sidebar/app-sidebar.d.ts +293 -17
  7. package/dist/types/components/avatar/avatar.d.ts +46 -7
  8. package/dist/types/components/badge/badge.d.ts +21 -1
  9. package/dist/types/components/button/button.d.ts +15 -0
  10. package/dist/types/components/calendar/calendar.d.ts +67 -5
  11. package/dist/types/components/card-view/card-view.d.ts +7 -4
  12. package/dist/types/components/card-view/record-card.d.ts +11 -0
  13. package/dist/types/components/chart/chart.d.ts +10 -0
  14. package/dist/types/components/checklist/checklist.d.ts +9 -0
  15. package/dist/types/components/code-editor/code-editor.d.ts +6 -17
  16. package/dist/types/components/context-menu/context-menu.d.ts +6 -2
  17. package/dist/types/components/data-filter/data-filter.d.ts +4 -4
  18. package/dist/types/components/datebox/date-range-box.d.ts +5 -1
  19. package/dist/types/components/datebox/datebox.d.ts +7 -2
  20. package/dist/types/components/dialog/dialog.d.ts +46 -6
  21. package/dist/types/components/dropdown/dropdown.d.ts +24 -9
  22. package/dist/types/components/entity-ref/entity-ref.d.ts +2 -2
  23. package/dist/types/components/field/field.d.ts +54 -2
  24. package/dist/types/components/fieldset/external-adapter.d.ts +83 -0
  25. package/dist/types/components/fieldset/fieldset.d.ts +26 -1
  26. package/dist/types/components/file-item/file-item.d.ts +34 -6
  27. package/dist/types/components/file-list/file-list.d.ts +35 -3
  28. package/dist/types/components/filter/filter.d.ts +127 -3
  29. package/dist/types/components/filter-panel/filter-panel.d.ts +36 -7
  30. package/dist/types/components/form/form.d.ts +12 -1
  31. package/dist/types/components/kanban-view/kanban-card.d.ts +8 -0
  32. package/dist/types/components/launcher/launcher.d.ts +268 -15
  33. package/dist/types/components/list-toolbar/list-toolbar.d.ts +16 -7
  34. package/dist/types/components/menu-button/menu-button.d.ts +39 -5
  35. package/dist/types/components/message/message.d.ts +132 -17
  36. package/dist/types/components/modal/modal.d.ts +43 -2
  37. package/dist/types/components/module-bar/module-bar.d.ts +395 -0
  38. package/dist/types/components/pagination/pagination.d.ts +17 -3
  39. package/dist/types/components/select/color.d.ts +12 -0
  40. package/dist/types/components/select/glyphs.d.ts +124 -0
  41. package/dist/types/components/select/select.d.ts +17 -3
  42. package/dist/types/components/sheet/sheet.d.ts +15 -0
  43. package/dist/types/components/stat-tile/stat-tile.d.ts +16 -5
  44. package/dist/types/components/tabbox/tabbox.d.ts +9 -0
  45. package/dist/types/components/table/table.d.ts +311 -18
  46. package/dist/types/components/tag-picker/tag-picker.d.ts +21 -4
  47. package/dist/types/components/tree/tree.d.ts +13 -0
  48. package/dist/types/components/view/record-view.d.ts +59 -2
  49. package/dist/types/components/view-settings/view-settings.d.ts +879 -0
  50. package/dist/types/components/workspace-switcher/workspace-switcher.d.ts +327 -0
  51. package/dist/types/core/breakpoint.d.ts +1 -1
  52. package/dist/types/core/component.d.ts +12 -2
  53. package/dist/types/core/i18n.d.ts +27 -3
  54. package/dist/types/core/icons.d.ts +23 -25
  55. package/dist/types/core/keyboard.d.ts +98 -1
  56. package/dist/types/core/messages.d.ts +382 -0
  57. package/dist/types/core/motion.d.ts +59 -0
  58. package/dist/types/core/overlay-host.d.ts +42 -1
  59. package/dist/types/core/overlay-stack.d.ts +260 -0
  60. package/dist/types/index.d.ts +10 -5
  61. package/dist/types/internal/app-rail.d.ts +38 -0
  62. package/dist/types/internal/menu-items.d.ts +71 -3
  63. package/dist/types/zeyos/connect.d.ts +6 -0
  64. package/dist/types/zeyos/form.d.ts +50 -9
  65. package/dist/types/zeyos/index.d.ts +2 -1
  66. package/dist/types/zeyos/launcher.d.ts +9 -0
  67. package/dist/types/zeyos/module-bar.d.ts +176 -0
  68. package/dist/types/zeyos/query.d.ts +110 -5
  69. package/dist/types/zeyos/schema.d.ts +24 -1
  70. package/dist/types/zeyos/table.d.ts +345 -22
  71. package/dist/types/zeyos/view.d.ts +26 -2
  72. package/dist/zx-zeyos.esm.js +6178 -1008
  73. package/dist/zx-zeyos.esm.min.js +53 -5
  74. package/dist/zx.css +2861 -827
  75. package/dist/zx.esm.js +8909 -1480
  76. package/dist/zx.esm.min.js +55 -7
  77. package/dist/zx.global.js +8911 -1482
  78. package/dist/zx.global.min.js +55 -7
  79. package/dist/zx.min.css +1 -1
  80. package/docs/api.json +1079 -117
  81. package/docs/llms.md +956 -154
  82. package/docs/llms.txt +9 -5
  83. package/package.json +1 -1
  84. package/src/components/account-menu/account-menu.css +35 -10
  85. package/src/components/account-menu/account-menu.js +12 -0
  86. package/src/components/activity-item/activity-item.css +1 -1
  87. package/src/components/activity-item/activity-item.js +3 -0
  88. package/src/components/activity-list/activity-list.css +38 -3
  89. package/src/components/activity-list/activity-list.js +61 -1
  90. package/src/components/app-icon/app-icon.css +14 -3
  91. package/src/components/app-icon/app-icon.js +11 -1
  92. package/src/components/app-rail/app-rail.css +59 -79
  93. package/src/components/app-sidebar/app-sidebar.css +304 -168
  94. package/src/components/app-sidebar/app-sidebar.js +667 -46
  95. package/src/components/aurora/aurora.css +5 -3
  96. package/src/components/avatar/avatar.css +32 -7
  97. package/src/components/avatar/avatar.js +72 -8
  98. package/src/components/badge/badge.css +54 -2
  99. package/src/components/badge/badge.js +29 -2
  100. package/src/components/breadcrumb/breadcrumb.css +1 -1
  101. package/src/components/button/button.css +67 -9
  102. package/src/components/button/button.js +38 -0
  103. package/src/components/calendar/calendar.css +47 -47
  104. package/src/components/calendar/calendar.js +26 -52
  105. package/src/components/card/card.css +4 -4
  106. package/src/components/card-view/card-view.css +14 -12
  107. package/src/components/card-view/card-view.js +13 -9
  108. package/src/components/card-view/record-card.js +14 -3
  109. package/src/components/chart/chart.css +4 -1
  110. package/src/components/chart/chart.js +12 -0
  111. package/src/components/check-button/check-button.css +10 -2
  112. package/src/components/checklist/checklist.css +9 -2
  113. package/src/components/checklist/checklist.js +11 -5
  114. package/src/components/checklist/field-adapter.js +3 -1
  115. package/src/components/code-editor/code-editor.css +7 -6
  116. package/src/components/code-editor/code-editor.js +19 -1
  117. package/src/components/code-editor/field-adapter.js +9 -2
  118. package/src/components/context-menu/context-menu.css +9 -4
  119. package/src/components/context-menu/context-menu.js +8 -2
  120. package/src/components/copy/copy-button.css +6 -0
  121. package/src/components/copy/copy-input.css +9 -4
  122. package/src/components/data-filter/data-filter.css +5 -4
  123. package/src/components/data-filter/data-filter.js +2 -2
  124. package/src/components/date-picker/date-picker.css +6 -6
  125. package/src/components/date-picker/date-range-picker.css +3 -3
  126. package/src/components/date-picker/time-picker.css +3 -3
  127. package/src/components/datebox/date-range-box.css +79 -2
  128. package/src/components/datebox/date-range-box.js +13 -2
  129. package/src/components/datebox/datebox.css +79 -2
  130. package/src/components/datebox/datebox.js +13 -2
  131. package/src/components/dialog/dialog.css +26 -0
  132. package/src/components/dialog/dialog.js +99 -17
  133. package/src/components/dock/dock.css +5 -4
  134. package/src/components/dropdown/dropdown.css +1 -1
  135. package/src/components/dropdown/dropdown.js +159 -72
  136. package/src/components/empty-state/empty-state.css +2 -2
  137. package/src/components/entity-ref/entity-ref.css +1 -1
  138. package/src/components/entity-ref/entity-ref.js +1 -1
  139. package/src/components/field/field.css +28 -9
  140. package/src/components/field/field.js +101 -29
  141. package/src/components/field-upload/field-upload.css +1 -1
  142. package/src/components/fieldset/external-adapter.js +363 -0
  143. package/src/components/fieldset/fieldset.css +5 -3
  144. package/src/components/fieldset/fieldset.js +38 -64
  145. package/src/components/file-item/file-item.js +144 -10
  146. package/src/components/file-list/file-list.js +144 -21
  147. package/src/components/filter/filter.css +86 -2
  148. package/src/components/filter/filter.js +307 -11
  149. package/src/components/filter-panel/filter-panel.css +1 -1
  150. package/src/components/filter-panel/filter-panel.js +149 -32
  151. package/src/components/finder/finder.css +16 -14
  152. package/src/components/form/form.css +5 -4
  153. package/src/components/form/form.js +11 -2
  154. package/src/components/grid/grid.css +1 -1
  155. package/src/components/groupbox/groupbox.css +1 -1
  156. package/src/components/kanban-view/kanban-card.js +11 -3
  157. package/src/components/kanban-view/kanban-view.css +42 -18
  158. package/src/components/kanban-view/kanban-view.js +9 -6
  159. package/src/components/launcher/launcher.css +108 -26
  160. package/src/components/launcher/launcher.js +530 -42
  161. package/src/components/list-toolbar/list-toolbar.css +13 -8
  162. package/src/components/list-toolbar/list-toolbar.js +40 -14
  163. package/src/components/master-panel/master-panel.css +2 -0
  164. package/src/components/master-panel/master-panel.js +0 -1
  165. package/src/components/menu-button/menu-button.css +72 -4
  166. package/src/components/menu-button/menu-button.js +160 -18
  167. package/src/components/message/message.css +33 -3
  168. package/src/components/message/message.js +264 -22
  169. package/src/components/modal/modal.css +1 -1
  170. package/src/components/modal/modal.js +83 -15
  171. package/src/components/module-bar/module-bar.css +486 -0
  172. package/src/components/module-bar/module-bar.js +1074 -0
  173. package/src/components/multi-value-editor/multi-value-editor.css +1 -1
  174. package/src/components/navigation-bar/navigation-bar.css +18 -9
  175. package/src/components/number-field/field-adapter.js +3 -1
  176. package/src/components/number-field/number-field.css +70 -0
  177. package/src/components/number-field/number-field.js +2 -0
  178. package/src/components/pagination/pagination.css +13 -11
  179. package/src/components/pagination/pagination.js +20 -4
  180. package/src/components/panel/panel.css +4 -3
  181. package/src/components/questionnaire/questionnaire.css +4 -4
  182. package/src/components/rating/field-adapter.js +2 -1
  183. package/src/components/rating/rating.css +8 -1
  184. package/src/components/search/search.css +4 -1
  185. package/src/components/select/color.js +22 -0
  186. package/src/components/select/field-adapter.js +2 -0
  187. package/src/components/select/glyphs.js +165 -0
  188. package/src/components/select/select.css +138 -45
  189. package/src/components/select/select.js +92 -47
  190. package/src/components/sheet/sheet.css +12 -9
  191. package/src/components/sheet/sheet.js +74 -32
  192. package/src/components/slider/field-adapter.js +6 -1
  193. package/src/components/slider/slider.css +18 -4
  194. package/src/components/slider/slider.js +1 -1
  195. package/src/components/sort-control/sort-control.css +4 -1
  196. package/src/components/split-view/split-view.css +1 -1
  197. package/src/components/stat-tile/stat-tile.css +42 -47
  198. package/src/components/stat-tile/stat-tile.js +17 -6
  199. package/src/components/stepper/stepper.css +1 -1
  200. package/src/components/tabbox/tabbox.css +41 -32
  201. package/src/components/tabbox/tabbox.js +5 -1
  202. package/src/components/table/table.css +187 -37
  203. package/src/components/table/table.js +718 -73
  204. package/src/components/tag-picker/field-adapter.js +2 -1
  205. package/src/components/tag-picker/tag-picker.css +83 -5
  206. package/src/components/tag-picker/tag-picker.js +25 -8
  207. package/src/components/timebox/timebox.css +22 -2
  208. package/src/components/toggle/toggle.css +12 -1
  209. package/src/components/toolbar/toolbar.js +2 -2
  210. package/src/components/tooltip/tooltip.css +4 -0
  211. package/src/components/tooltip/tooltip.js +44 -19
  212. package/src/components/tree/tree.css +26 -17
  213. package/src/components/tree/tree.js +31 -0
  214. package/src/components/value-list/value-list.css +3 -3
  215. package/src/components/view/record-view.css +1 -1
  216. package/src/components/view/record-view.js +178 -18
  217. package/src/components/view-settings/view-settings.css +285 -0
  218. package/src/components/view-settings/view-settings.js +1830 -0
  219. package/src/components/workspace-switcher/workspace-switcher.css +188 -0
  220. package/src/components/workspace-switcher/workspace-switcher.js +463 -0
  221. package/src/core/breakpoint.js +1 -1
  222. package/src/core/component.js +88 -17
  223. package/src/core/fontawesome.js +5 -1
  224. package/src/core/i18n.js +47 -4
  225. package/src/core/icons.js +204 -61
  226. package/src/core/keyboard.js +206 -11
  227. package/src/core/messages.js +427 -0
  228. package/src/core/motion.js +147 -0
  229. package/src/core/overlay-host.js +77 -3
  230. package/src/core/overlay-stack.js +487 -0
  231. package/src/core/position.js +22 -3
  232. package/src/index.js +10 -5
  233. package/src/internal/app-rail.js +135 -55
  234. package/src/internal/menu-items.js +61 -3
  235. package/src/zeyos/connect.js +6 -2
  236. package/src/zeyos/form.js +69 -27
  237. package/src/zeyos/index.js +4 -1
  238. package/src/zeyos/launcher.js +8 -3
  239. package/src/zeyos/module-bar.js +181 -0
  240. package/src/zeyos/query.js +197 -13
  241. package/src/zeyos/schema.js +144 -27
  242. package/src/zeyos/table.js +287 -84
  243. package/src/zeyos/view.js +49 -93
  244. package/styles/base.css +72 -1
  245. package/styles/icons.css +11 -1
  246. package/styles/print.css +1 -1
  247. package/styles/tokens/dark.css +117 -37
  248. package/styles/tokens/global.css +121 -27
  249. package/styles/tokens/semantic.css +140 -43
  250. package/styles/tokens/themes.css +7 -6
  251. package/styles/zx.css +3 -1
  252. package/styles/tokens/density.css +0 -9
@@ -1,4 +1,5 @@
1
1
  import { Table } from '../index.js';
2
+ export type TableOptions = import('../components/table/table.js').TableOptions;
2
3
  export type ZeyosTableOptions = {
3
4
  /**
4
5
  * Curated ordered field allow-list.
@@ -8,12 +9,23 @@ export type ZeyosTableOptions = {
8
9
  * Per-field label overrides.
9
10
  */
10
11
  labels?: Record<string, string>;
12
+ /**
13
+ * Per-field semantic format overrides, such as
14
+ * `{ duedate: 'date' }` for a Unix-second field that holds a calendar day.
15
+ */
16
+ formats?: Record<string, string>;
17
+ /**
18
+ * IANA time zone of the ZeyOS instance. Date-only columns show the
19
+ * calendar day their stored midnight names in this zone; defaults to the runtime's own zone.
20
+ */
21
+ timeZone?: string;
11
22
  /**
12
23
  * Row id accessor.
13
24
  */
14
25
  rowId?: string | ((row: Record<string, unknown>) => unknown);
15
26
  /**
16
- * Server page size.
27
+ * Server page size, a positive integer. `load({pageSize})` changes
28
+ * it later — what a `Pagination` page-size select does.
17
29
  */
18
30
  pageSize?: number;
19
31
  /**
@@ -43,6 +55,91 @@ export type ZeyosTableOptions = {
43
55
  * Row activation callback.
44
56
  */
45
57
  onRowClick?: (row: Record<string, unknown>, event: CustomEvent<Record<string, unknown>>) => void;
58
+ /**
59
+ * Table frame treatment; `'plain'` for a
60
+ * table inside a pane or card that already draws the box.
61
+ */
62
+ variant?: TableOptions['variant'];
63
+ /**
64
+ * Whether alternate rows use the zebra background.
65
+ */
66
+ zebra?: boolean;
67
+ /**
68
+ * Whether column headers stick while scrolling.
69
+ */
70
+ stickyHeader?: boolean;
71
+ /**
72
+ * Width below which rows stack.
73
+ */
74
+ responsive?: TableOptions['responsive'];
75
+ /**
76
+ * Rows rendered at first from a loaded page.
77
+ */
78
+ growing?: TableOptions['growing'];
79
+ /**
80
+ * What the table shows with no rows.
81
+ */
82
+ emptyText?: TableOptions['emptyText'];
83
+ /**
84
+ * Additional row class callback.
85
+ */
86
+ rowClass?: TableOptions['rowClass'];
87
+ /**
88
+ * Row property or callback naming each row's kind.
89
+ */
90
+ rowKind?: TableOptions['rowKind'];
91
+ /**
92
+ * Presentation per row kind.
93
+ */
94
+ rowKinds?: TableOptions['rowKinds'];
95
+ /**
96
+ * Whether a column visibility chooser is rendered.
97
+ */
98
+ columnVisibility?: boolean;
99
+ /**
100
+ * Whether the column chooser exposes reorder controls.
101
+ */
102
+ columnReorder?: boolean;
103
+ /**
104
+ * Initially hidden column ids.
105
+ */
106
+ hiddenColumns?: string[];
107
+ /**
108
+ * Table `rowclick` listener, beside `onRowClick`.
109
+ */
110
+ onrowclick?: TableOptions['onrowclick'];
111
+ /**
112
+ * Table `rowdblclick` listener.
113
+ */
114
+ onrowdblclick?: TableOptions['onrowdblclick'];
115
+ /**
116
+ * Table `sort` listener; the binding reloads either way.
117
+ */
118
+ onsort?: TableOptions['onsort'];
119
+ /**
120
+ * Table `selectionchange` listener.
121
+ */
122
+ onselectionchange?: TableOptions['onselectionchange'];
123
+ /**
124
+ * Table `datachange` listener.
125
+ */
126
+ ondatachange?: TableOptions['ondatachange'];
127
+ /**
128
+ * Table `stackedchange` listener.
129
+ */
130
+ onstackedchange?: TableOptions['onstackedchange'];
131
+ /**
132
+ * Table `grow` listener.
133
+ */
134
+ ongrow?: TableOptions['ongrow'];
135
+ /**
136
+ * Table `columnvisibilitychange` listener.
137
+ */
138
+ oncolumnvisibilitychange?: TableOptions['oncolumnvisibilitychange'];
139
+ /**
140
+ * Table `columnorderchange` listener.
141
+ */
142
+ oncolumnorderchange?: TableOptions['oncolumnorderchange'];
46
143
  };
47
144
  export type ZeyosTableConfig = {
48
145
  /**
@@ -72,9 +169,20 @@ export type ZeyosTableLoadOptions = {
72
169
  */
73
170
  filters?: Record<string, unknown>;
74
171
  /**
75
- * Zero-based page; pages above zero append rows.
172
+ * Zero-based page, a non-negative integer. Pages above zero append
173
+ * rows unless `replace` is set.
76
174
  */
77
175
  page?: number;
176
+ /**
177
+ * Replace the rows with this page instead of appending it — what a
178
+ * numbered pager needs. Page zero always replaces.
179
+ */
180
+ replace?: boolean;
181
+ /**
182
+ * New page size for this and every later load; the request offset is
183
+ * `page * pageSize`.
184
+ */
185
+ pageSize?: number;
78
186
  };
79
187
  export type ZeyosTableLoadResult = {
80
188
  /**
@@ -127,28 +235,164 @@ export type ZeyosTableBinding = {
127
235
  * Current zero-based page.
128
236
  */
129
237
  page: number;
238
+ /**
239
+ * Current server page size.
240
+ */
241
+ pageSize: number;
130
242
  /**
131
243
  * Whether another page is available.
132
244
  */
133
245
  hasMore: boolean;
134
246
  /**
135
- * Destroys the generated table.
247
+ * Destroys the generated table. A request still in flight is
248
+ * ignored when it resolves, and later loads reject.
136
249
  */
137
250
  destroy: () => void;
138
251
  };
139
- /**
140
- * @typedef {Object} ZeyosTableOptions
141
- * @property {string[]} [fields] Curated ordered field allow-list.
142
- * @property {Record<string, string>} [labels] Per-field label overrides.
143
- * @property {string|((row: Record<string, unknown>) => unknown)} [rowId='ID'] Row id accessor.
144
- * @property {number} [pageSize=50] Server page size.
145
- * @property {{id: string, dir: 'asc'|'desc'}|null} [sort=null] Initial server sort.
146
- * @property {Record<string, unknown>} [filters] Initial ZeyOS predicates.
147
- * @property {string} [search=''] Initial full-text query.
148
- * @property {false|'single'|'multi'} [selectable=false] Row selection mode.
149
- * @property {number|string|null} [height=null] Table scroll-region height.
150
- * @property {(row: Record<string, unknown>, event: CustomEvent<Record<string, unknown>>) => void} [onRowClick] Row activation callback.
151
- */
252
+ export type ServerPagerTarget = {
253
+ /**
254
+ * Replaces the rows.
255
+ */
256
+ setData: (rows: Record<string, unknown>[]) => unknown;
257
+ /**
258
+ * Appends rows.
259
+ */
260
+ addData: (rows: Record<string, unknown>[]) => unknown;
261
+ /**
262
+ * Shows or hides the loading state.
263
+ */
264
+ setLoading: (loading: boolean) => unknown;
265
+ };
266
+ export type ServerPagerOptions = {
267
+ /**
268
+ * Injected ZeyOS client (for result normalization).
269
+ */
270
+ client: Record<string, any>;
271
+ /**
272
+ * Connection facade from `connect(client)`.
273
+ */
274
+ facade: {
275
+ list: (resource: string, query: Record<string, unknown>) => Promise<unknown>;
276
+ };
277
+ /**
278
+ * Resource name.
279
+ */
280
+ resource: string;
281
+ /**
282
+ * API projection.
283
+ */
284
+ projection: Record<string, string>;
285
+ /**
286
+ * Component the rows go to.
287
+ */
288
+ target: ServerPagerTarget;
289
+ /**
290
+ * Initial page size; must be a positive integer.
291
+ */
292
+ pageSize?: unknown;
293
+ /**
294
+ * Initial sort.
295
+ */
296
+ sort?: {
297
+ id: string;
298
+ dir: 'asc' | 'desc';
299
+ } | null;
300
+ /**
301
+ * Initial predicates; must be a plain object.
302
+ */
303
+ filters?: unknown;
304
+ /**
305
+ * Initial full-text query.
306
+ */
307
+ search?: unknown;
308
+ /**
309
+ * UI search-field metadata passed to `buildListQuery`.
310
+ */
311
+ searchFields?: string[];
312
+ /**
313
+ * Name used in error messages.
314
+ */
315
+ label?: string;
316
+ };
317
+ export type ServerPager = {
318
+ /**
319
+ * Loads a page.
320
+ */
321
+ load: (options?: ZeyosTableLoadOptions) => Promise<ZeyosTableLoadResult>;
322
+ /**
323
+ * Validates load options without applying them; throws what `load()` would reject with.
324
+ */
325
+ check: (options?: ZeyosTableLoadOptions) => {
326
+ page: number;
327
+ pageSize: number;
328
+ filters: Record<string, unknown>;
329
+ search: string;
330
+ };
331
+ /**
332
+ * Appends the next page when available,
333
+ * else resolves without a request.
334
+ */
335
+ loadMore: () => Promise<ZeyosTableLoadResult>;
336
+ /**
337
+ * Replaces the sort used
338
+ * by the next load.
339
+ */
340
+ setSort: (sort: {
341
+ id: string;
342
+ dir: 'asc' | 'desc';
343
+ } | null) => void;
344
+ /**
345
+ * Replaces filters and
346
+ * search without loading.
347
+ */
348
+ setQuery: (state: {
349
+ filters?: unknown;
350
+ search?: unknown;
351
+ }) => void;
352
+ /**
353
+ * Forgets the loaded page, count, and `hasMore`.
354
+ */
355
+ reset: () => void;
356
+ /**
357
+ * Stops rendering: in-flight responses are ignored, later loads reject.
358
+ */
359
+ destroy: () => void;
360
+ /**
361
+ * Whether `destroy()` ran.
362
+ */
363
+ destroyed: boolean;
364
+ /**
365
+ * Current server count.
366
+ */
367
+ count: number | null;
368
+ /**
369
+ * Current zero-based page.
370
+ */
371
+ page: number;
372
+ /**
373
+ * Current page size.
374
+ */
375
+ pageSize: number;
376
+ /**
377
+ * Whether another page is available.
378
+ */
379
+ hasMore: boolean;
380
+ /**
381
+ * Current sort.
382
+ */
383
+ sort: {
384
+ id: string;
385
+ dir: 'asc' | 'desc';
386
+ } | null;
387
+ /**
388
+ * Copy of the current predicates.
389
+ */
390
+ filters: Record<string, unknown>;
391
+ /**
392
+ * Current full-text query.
393
+ */
394
+ search: string;
395
+ };
152
396
  /**
153
397
  * @typedef {Object} ZeyosTableConfig
154
398
  * @property {Record<string, any>[]} fieldMeta Ordered normalized schema metadata.
@@ -160,7 +404,12 @@ export type ZeyosTableBinding = {
160
404
  * @typedef {Object} ZeyosTableLoadOptions
161
405
  * @property {string} [search] Replacement full-text query.
162
406
  * @property {Record<string, unknown>} [filters] Replacement ZeyOS predicates.
163
- * @property {number} [page=0] Zero-based page; pages above zero append rows.
407
+ * @property {number} [page=0] Zero-based page, a non-negative integer. Pages above zero append
408
+ * rows unless `replace` is set.
409
+ * @property {boolean} [replace] Replace the rows with this page instead of appending it — what a
410
+ * numbered pager needs. Page zero always replaces.
411
+ * @property {number} [pageSize] New page size for this and every later load; the request offset is
412
+ * `page * pageSize`.
164
413
  */
165
414
  /**
166
415
  * @typedef {Object} ZeyosTableLoadResult
@@ -179,14 +428,61 @@ export type ZeyosTableBinding = {
179
428
  * @property {() => Promise<ZeyosTableLoadResult>} loadMore Appends the next page when available.
180
429
  * @property {number|null} count Current server count.
181
430
  * @property {number} page Current zero-based page.
431
+ * @property {number} pageSize Current server page size.
432
+ * @property {boolean} hasMore Whether another page is available.
433
+ * @property {() => void} destroy Destroys the generated table. A request still in flight is
434
+ * ignored when it resolves, and later loads reject.
435
+ */
436
+ /**
437
+ * The surface a server pager renders into: a Zx `Table`, or any RecordView.
438
+ * @typedef {Object} ServerPagerTarget
439
+ * @property {(rows: Record<string, unknown>[]) => unknown} setData Replaces the rows.
440
+ * @property {(rows: Record<string, unknown>[]) => unknown} addData Appends rows.
441
+ * @property {(loading: boolean) => unknown} setLoading Shows or hides the loading state.
442
+ */
443
+ /**
444
+ * @typedef {Object} ServerPagerOptions
445
+ * @property {Record<string, any>} client Injected ZeyOS client (for result normalization).
446
+ * @property {{list: (resource: string, query: Record<string, unknown>) => Promise<unknown>}} facade
447
+ * Connection facade from `connect(client)`.
448
+ * @property {string} resource Resource name.
449
+ * @property {Record<string, string>} projection API projection.
450
+ * @property {ServerPagerTarget} target Component the rows go to.
451
+ * @property {unknown} [pageSize=50] Initial page size; must be a positive integer.
452
+ * @property {{id: string, dir: 'asc'|'desc'}|null} [sort=null] Initial sort.
453
+ * @property {unknown} [filters={}] Initial predicates; must be a plain object.
454
+ * @property {unknown} [search=''] Initial full-text query.
455
+ * @property {string[]} [searchFields] UI search-field metadata passed to `buildListQuery`.
456
+ * @property {string} [label='ZeyOS binding'] Name used in error messages.
457
+ */
458
+ /**
459
+ * @typedef {Object} ServerPager
460
+ * @property {(options?: ZeyosTableLoadOptions) => Promise<ZeyosTableLoadResult>} load Loads a page.
461
+ * @property {(options?: ZeyosTableLoadOptions) => {page: number, pageSize: number, filters: Record<string, unknown>, search: string}} check
462
+ * Validates load options without applying them; throws what `load()` would reject with.
463
+ * @property {() => Promise<ZeyosTableLoadResult>} loadMore Appends the next page when available,
464
+ * else resolves without a request.
465
+ * @property {(sort: {id: string, dir: 'asc'|'desc'}|null) => void} setSort Replaces the sort used
466
+ * by the next load.
467
+ * @property {(state: {filters?: unknown, search?: unknown}) => void} setQuery Replaces filters and
468
+ * search without loading.
469
+ * @property {() => void} reset Forgets the loaded page, count, and `hasMore`.
470
+ * @property {() => void} destroy Stops rendering: in-flight responses are ignored, later loads reject.
471
+ * @property {boolean} destroyed Whether `destroy()` ran.
472
+ * @property {number|null} count Current server count.
473
+ * @property {number} page Current zero-based page.
474
+ * @property {number} pageSize Current page size.
182
475
  * @property {boolean} hasMore Whether another page is available.
183
- * @property {() => void} destroy Destroys the generated table.
476
+ * @property {{id: string, dir: 'asc'|'desc'}|null} sort Current sort.
477
+ * @property {Record<string, unknown>} filters Copy of the current predicates.
478
+ * @property {string} search Current full-text query.
184
479
  */
185
480
  /**
186
481
  * Builds the DOM-free schema-derived columns and Table options used by {@link zeyosTable}. Entity
187
482
  * projections include an `<field>_label` alias from a real label field on the referenced resource.
188
483
  * Amount fields use each row's real `currency` value for display while retaining the WP14 typed
189
- * column strategy and right alignment.
484
+ * column strategy and right alignment. Enum columns show labels, date-only columns calendar days in
485
+ * `timeZone`, and Table presentation options and listeners pass through to `tableOptions`.
190
486
  * @param {Record<string, any>} client Injected ZeyOS client instance.
191
487
  * @param {string} resource Resource name such as `transactions`.
192
488
  * @param {ZeyosTableOptions} [opts={}] Schema, table, and initial query options.
@@ -194,12 +490,39 @@ export type ZeyosTableBinding = {
194
490
  */
195
491
  export declare function buildZeyosTableConfig(client: Record<string, any>, resource: string, opts?: ZeyosTableOptions): ZeyosTableConfig;
196
492
  /**
197
- * Generates a server-backed Zx Table. Sorting automatically reloads page zero. `load({page: 0})`
198
- * replaces data, higher pages append it, and `loadMore()` uses `limit`/`offset` plus the returned
199
- * count. DataFilter callers can map state with `dataFilterStateToFilters` before `setFilters()`.
493
+ * Generates a server-backed Zx Table. Sorting automatically reloads page zero. Paging is
494
+ * zero-based: `load({page: 0})` replaces data, higher pages append it — load-more paging, which
495
+ * `loadMore()` drives from `limit`/`offset` plus the returned count — and `replace: true` replaces
496
+ * at any page, which is what a numbered `Pagination` needs. `Pagination` is one-based, so its
497
+ * `change` maps as `load({page: detail.page - 1, pageSize: detail.pageSize, replace: true})`, the
498
+ * request offset being `(page - 1) * pageSize`; feed `result.count` back with `setTotal()`.
499
+ * DataFilter callers can map state with `dataFilterStateToFilters` before `setFilters()`.
500
+ * Paging is shared with `zeyosView()` through {@link createServerPager}: the same validation, and
501
+ * a response that resolves after `destroy()` never touches the destroyed table.
502
+ * Table presentation options (`variant`, `zebra`, `stickyHeader`, `responsive`, `emptyText`, …) and
503
+ * listeners are passed through to the generated Table.
200
504
  * @param {Record<string, any>} client Injected ZeyOS client instance.
201
505
  * @param {string} resource Resource name such as `transactions`.
202
506
  * @param {ZeyosTableOptions} [opts={}] Schema, table, and initial query options.
203
507
  * @returns {ZeyosTableBinding} Generated table and server-state methods/getters.
204
508
  */
205
509
  export declare function zeyosTable(client: Record<string, any>, resource: string, opts?: ZeyosTableOptions): ZeyosTableBinding;
510
+ /**
511
+ * The one server-paging loader behind {@link zeyosTable} and `zeyosView`, so the two bindings
512
+ * cannot drift apart. It builds the list request (`limit = pageSize`, `offset = page * pageSize`,
513
+ * always with `count`), renders the response into its target — page zero or `replace` replaces
514
+ * the rows, a higher page appends them — and keeps `count`, `page`, and `hasMore`.
515
+ *
516
+ * Only the newest request may render: an older one that resolves late is returned to its caller
517
+ * but never touches the target. After `destroy()` nothing renders at all — a response that arrives
518
+ * afterwards is ignored, the loading state is left alone — and further loads reject.
519
+ *
520
+ * Validation is strict and the same for both bindings: a page must be a non-negative integer and a
521
+ * page size a positive integer (`RangeError`), filters a plain object (`TypeError`). Every argument
522
+ * of a call is checked before any of it is applied, so a rejected call changes nothing.
523
+ * @param {ServerPagerOptions} options Pager configuration.
524
+ * @returns {ServerPager}
525
+ */
526
+ export declare function createServerPager(options: ServerPagerOptions): ServerPager;
527
+ /** Default server page size shared by `zeyosTable()` and `zeyosView()`. */
528
+ export declare const DEFAULT_SERVER_PAGE_SIZE = 50;
@@ -46,6 +46,16 @@ export type ZeyosViewOptions = {
46
46
  * Per-field label overrides.
47
47
  */
48
48
  labels?: Record<string, string>;
49
+ /**
50
+ * Per-field semantic format overrides, such as
51
+ * `{ duedate: 'date' }` for a Unix-second field that holds a calendar day.
52
+ */
53
+ formats?: Record<string, string>;
54
+ /**
55
+ * IANA time zone of the ZeyOS instance; date-only fields show the
56
+ * calendar day their stored midnight names in it. Defaults to the runtime's own zone.
57
+ */
58
+ timeZone?: string;
49
59
  /**
50
60
  * View descriptor overrides.
51
61
  */
@@ -55,7 +65,8 @@ export type ZeyosViewOptions = {
55
65
  */
56
66
  recordId?: string | ((record: Record<string, unknown>) => unknown);
57
67
  /**
58
- * Server page size.
68
+ * Server page size, a positive integer — the same default and
69
+ * validation as `zeyosTable()`, because both bindings page through one shared loader.
59
70
  */
60
71
  pageSize?: number;
61
72
  /**
@@ -141,9 +152,18 @@ export type ZeyosViewLoadOptions = {
141
152
  */
142
153
  filters?: Record<string, unknown>;
143
154
  /**
144
- * Zero-based page; pages above zero append.
155
+ * Zero-based page, a non-negative integer; pages above zero append
156
+ * unless `replace` is set.
145
157
  */
146
158
  page?: number;
159
+ /**
160
+ * Replace the records with this page instead of appending it.
161
+ */
162
+ replace?: boolean;
163
+ /**
164
+ * New page size for this and every later load.
165
+ */
166
+ pageSize?: number;
147
167
  };
148
168
  export type ZeyosViewLoadResult = {
149
169
  /**
@@ -246,6 +266,10 @@ export type ZeyosViewBinding = {
246
266
  * Current zero-based page.
247
267
  */
248
268
  page: number;
269
+ /**
270
+ * Current server page size.
271
+ */
272
+ pageSize: number;
249
273
  /**
250
274
  * Whether another page is available.
251
275
  */