@zeyos/zx 2.3.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/CHANGELOG.md +138 -0
  2. package/DESIGN-SYSTEM.md +96 -0
  3. package/README.md +29 -39
  4. package/dist/types/components/account-menu/account-menu.d.ts +144 -0
  5. package/dist/types/components/app-sidebar/app-sidebar.d.ts +243 -0
  6. package/dist/types/components/avatar/avatar.d.ts +100 -0
  7. package/dist/types/components/card/card.d.ts +128 -0
  8. package/dist/types/components/chart/chart.d.ts +322 -0
  9. package/dist/types/components/date-picker/month-picker.d.ts +6 -0
  10. package/dist/types/components/dialog/dialog.d.ts +9 -0
  11. package/dist/types/components/dock/dock.d.ts +495 -0
  12. package/dist/types/components/dropdown/dropdown.d.ts +2 -2
  13. package/dist/types/components/field/field.d.ts +14 -0
  14. package/dist/types/components/field-upload/field-upload.d.ts +37 -4
  15. package/dist/types/components/form/form.d.ts +25 -3
  16. package/dist/types/components/grid/grid.d.ts +172 -0
  17. package/dist/types/components/launcher/launcher.d.ts +359 -0
  18. package/dist/types/components/layout/layout.d.ts +4 -4
  19. package/dist/types/components/menu-button/menu-button.d.ts +10 -2
  20. package/dist/types/components/modal/modal.d.ts +25 -0
  21. package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +7 -1
  22. package/dist/types/components/questionnaire/items.d.ts +327 -0
  23. package/dist/types/components/questionnaire/questionnaire.d.ts +449 -0
  24. package/dist/types/components/select/select.d.ts +51 -0
  25. package/dist/types/components/sheet/sheet-stack.d.ts +167 -0
  26. package/dist/types/components/sheet/sheet.d.ts +294 -0
  27. package/dist/types/components/split-view/split-view.d.ts +2 -21
  28. package/dist/types/components/table/table.d.ts +223 -15
  29. package/dist/types/components/tooltip/tooltip.d.ts +2 -2
  30. package/dist/types/components/value-list/value-list.d.ts +24 -3
  31. package/dist/types/core/dom.d.ts +122 -0
  32. package/dist/types/core/drag-axis.d.ts +111 -0
  33. package/dist/types/core/position.d.ts +4 -2
  34. package/dist/types/index.d.ts +13 -2
  35. package/dist/types/internal/app-rail.d.ts +265 -0
  36. package/dist/types/zeyos/icons.d.ts +5 -0
  37. package/dist/types/zeyos/index.d.ts +2 -1
  38. package/dist/types/zeyos/launcher.d.ts +147 -0
  39. package/dist/types/zeyos/select.d.ts +39 -0
  40. package/dist/zx-zeyos.esm.js +1870 -133
  41. package/dist/zx-zeyos.esm.min.js +1 -1
  42. package/dist/zx.css +2006 -267
  43. package/dist/zx.esm.js +8987 -2757
  44. package/dist/zx.esm.min.js +3 -3
  45. package/dist/zx.global.js +8987 -2757
  46. package/dist/zx.global.min.js +3 -3
  47. package/dist/zx.min.css +1 -1
  48. package/docs/api.json +4396 -2344
  49. package/docs/llms.md +463 -86
  50. package/docs/llms.txt +32 -19
  51. package/package.json +10 -17
  52. package/src/components/account-menu/account-menu.css +70 -0
  53. package/src/components/account-menu/account-menu.js +208 -0
  54. package/src/components/app-rail/app-rail.css +107 -0
  55. package/src/components/app-sidebar/app-sidebar.css +80 -0
  56. package/src/components/app-sidebar/app-sidebar.js +588 -0
  57. package/src/components/avatar/avatar.css +61 -0
  58. package/src/components/avatar/avatar.js +222 -0
  59. package/src/components/button/button.css +0 -1
  60. package/src/components/card/card.css +149 -0
  61. package/src/components/card/card.js +285 -0
  62. package/src/components/chart/chart.css +61 -0
  63. package/src/components/chart/chart.js +523 -0
  64. package/src/components/date-picker/month-picker.js +9 -0
  65. package/src/components/dialog/dialog.js +11 -4
  66. package/src/components/dock/dock.css +228 -0
  67. package/src/components/dock/dock.js +977 -0
  68. package/src/components/dropdown/dropdown.js +1 -1
  69. package/src/components/field/field.js +2 -0
  70. package/src/components/field-upload/field-upload.js +9 -4
  71. package/src/components/form/form.js +6 -3
  72. package/src/components/grid/grid.css +6 -0
  73. package/src/components/grid/grid.js +220 -0
  74. package/src/components/launcher/launcher.css +210 -0
  75. package/src/components/launcher/launcher.js +765 -0
  76. package/src/components/layout/layout.js +2 -2
  77. package/src/components/menu-button/menu-button.js +27 -2
  78. package/src/components/modal/modal.css +5 -1
  79. package/src/components/modal/modal.js +37 -2
  80. package/src/components/multi-value-editor/multi-value-editor.js +2 -1
  81. package/src/components/questionnaire/items.js +370 -0
  82. package/src/components/questionnaire/questionnaire.css +387 -0
  83. package/src/components/questionnaire/questionnaire.js +1033 -0
  84. package/src/components/select/field-adapter.js +9 -4
  85. package/src/components/select/select.css +144 -11
  86. package/src/components/select/select.js +259 -27
  87. package/src/components/sheet/sheet-stack.js +304 -0
  88. package/src/components/sheet/sheet.css +351 -0
  89. package/src/components/sheet/sheet.js +551 -0
  90. package/src/components/split-view/split-view.js +76 -161
  91. package/src/components/table/table.css +43 -0
  92. package/src/components/table/table.js +531 -52
  93. package/src/components/tooltip/tooltip.js +5 -2
  94. package/src/components/value-list/value-list.js +6 -3
  95. package/src/core/dom.js +322 -0
  96. package/src/core/drag-axis.js +203 -0
  97. package/src/core/position.js +68 -22
  98. package/src/index.js +20 -2
  99. package/src/internal/app-rail.js +718 -0
  100. package/src/zeyos/icons.js +8 -3
  101. package/src/zeyos/index.js +7 -1
  102. package/src/zeyos/launcher.js +338 -0
  103. package/src/zeyos/modules.js +1 -0
  104. package/src/zeyos/select.js +115 -1
  105. package/styles/tokens/dark.css +2 -3
  106. package/styles/tokens/global.css +6 -6
  107. package/styles/tokens/modules.css +1 -0
  108. package/styles/tokens/semantic.css +5 -3
  109. package/styles/tokens/themes.css +1 -1
  110. package/styles/zx.css +11 -1
  111. package/MIGRATION.md +0 -598
  112. package/dist/types/compat/base.d.ts +0 -156
  113. package/dist/types/compat/globals.d.ts +0 -20
  114. package/dist/types/compat/index.d.ts +0 -128
  115. package/dist/types/compat/map/basic.d.ts +0 -175
  116. package/dist/types/compat/map/data.d.ts +0 -102
  117. package/dist/types/compat/map/date-time.d.ts +0 -80
  118. package/dist/types/compat/map/factory.d.ts +0 -9
  119. package/dist/types/compat/map/form.d.ts +0 -98
  120. package/dist/types/compat/map/helpers.d.ts +0 -12
  121. package/dist/types/compat/map/http.d.ts +0 -36
  122. package/dist/types/compat/map/layout.d.ts +0 -106
  123. package/dist/types/compat/map/options.d.ts +0 -80
  124. package/dist/types/compat/map/select.d.ts +0 -95
  125. package/dist/types/compat/map/stubs.d.ts +0 -32
  126. package/dist/types/compat/map/utilities.d.ts +0 -37
  127. package/dist/types/compat-entry.d.ts +0 -5
  128. package/dist/types/components/permission/permission.d.ts +0 -96
  129. package/dist/zx-compat.esm.js +0 -17484
  130. package/dist/zx-compat.esm.min.js +0 -1
  131. package/dist/zx-compat.global.js +0 -23635
  132. package/dist/zx-compat.global.min.js +0 -3
  133. package/src/compat/base.js +0 -291
  134. package/src/compat/globals.js +0 -165
  135. package/src/compat/index.js +0 -84
  136. package/src/compat/map/basic.js +0 -464
  137. package/src/compat/map/data.js +0 -232
  138. package/src/compat/map/date-time.js +0 -177
  139. package/src/compat/map/factory.js +0 -45
  140. package/src/compat/map/form.js +0 -330
  141. package/src/compat/map/helpers.js +0 -46
  142. package/src/compat/map/http.js +0 -117
  143. package/src/compat/map/layout.js +0 -256
  144. package/src/compat/map/options.js +0 -267
  145. package/src/compat/map/select.js +0 -198
  146. package/src/compat/map/stubs.js +0 -26
  147. package/src/compat/map/utilities.js +0 -113
  148. package/src/compat-entry.js +0 -11
  149. package/src/components/permission/permission.css +0 -47
  150. package/src/components/permission/permission.js +0 -201
package/MIGRATION.md DELETED
@@ -1,598 +0,0 @@
1
- # Migrating from `gx` to Zx
2
-
3
- Zx replaces the MooTools-era `gx` UI libraries with dependency-free ES2022 modules. The
4
- compatibility bundle lets mapped legacy code keep running while classes are migrated one at a
5
- time. Compatibility constructors warn once per legacy class so remaining call sites are visible.
6
-
7
- ## Deployment script swap
8
-
9
- For deployments that serve the old libraries directly from
10
- `net.zeyon.lib.gx-3000/assets/`, copy `dist/zx.global.js`, `dist/zx-compat.global.js`, and
11
- `dist/zx.css` into that asset directory. Replace:
12
-
13
- ```html
14
- <link rel="stylesheet" href="/net.zeyon.lib.gx-3000/assets/gx.css">
15
- <script src="/net.zeyon.lib.gx-3000/assets/gx-core.js"></script>
16
- <script src="/net.zeyon.lib.gx-3000/assets/gx-zeyos.js"></script>
17
- ```
18
-
19
- with this order:
20
-
21
- ```html
22
- <link rel="stylesheet" href="/net.zeyon.lib.gx-3000/assets/zx.css">
23
- <script src="/net.zeyon.lib.gx-3000/assets/zx.global.js"></script>
24
- <script src="/net.zeyon.lib.gx-3000/assets/zx-compat.global.js"></script>
25
- ```
26
-
27
- The compatibility entry exposes both `window.zx` and `window.gx`. Element
28
- `store`/`retrieve`/`eliminate` is installed automatically. If the application uses `__()`, `_()`,
29
- `String.prototype.htmlSpecialChars`, or `Array.prototype.findBy`, opt in after both scripts load:
30
-
31
- ```js
32
- gx.compat.installGlobals();
33
- ```
34
-
35
- Do not call this for newly migrated code; import `h`, `htmlEscape`, and the i18n helpers directly.
36
-
37
- ## Class-by-class replacements
38
-
39
- The snippets show the normal direct-Zx replacement. All strings supplied as component content are
40
- inserted as text; pass a DOM node when structured content is needed.
41
-
42
- ### `gx.zeyos.Toggle` → `zx.Toggle`
43
-
44
- ```js
45
- // gx
46
- const control = new gx.zeyos.Toggle(host, { on: true, value: 'enabled' });
47
- control.addEvent('uncheck', () => save(false));
48
-
49
- // Zx
50
- const control = new zx.Toggle(host, { checked: true, value: 'enabled' });
51
- control.on('change', (event) => save(event.detail.checked));
52
- ```
53
-
54
- Use `get()`, `getValue()`, `set(boolean)`, and `toggle()` in place of
55
- `getState()`, `setChecked()`, and `setUnchecked()`.
56
-
57
- ### `gx.zeyos.Msgbox` → `zx.Message`
58
-
59
- ```js
60
- // gx
61
- const messages = new gx.zeyos.Msgbox();
62
- messages.show('Saved', 's_msg_32_success');
63
-
64
- // Zx
65
- const messages = new zx.Message(null, { timeout: 0 });
66
- document.body.append(messages.el);
67
- const handle = messages.show('Saved', { kind: 'success' });
68
- ```
69
-
70
- Call `handle.close()` instead of `hide()`.
71
-
72
- ### `gx.bootstrap.Message` → `zx.Message`
73
-
74
- ```js
75
- // gx
76
- const messages = new gx.bootstrap.Message(host);
77
- messages.addMessage('Saved', 'success', true);
78
- messages.showStatus(40, 'Uploading');
79
-
80
- // Zx
81
- const messages = new zx.Message(host);
82
- messages.show('Saved', { kind: 'success', closable: true });
83
- const progress = zx.Message.progress('Uploading');
84
- progress.update(40);
85
- ```
86
-
87
- Use `progress.done()` or `progress.fail(message)` instead of `hideStatus()`.
88
-
89
- ### `gx.zeyos.Popup` and `gx.bootstrap.Popup` → `zx.Dialog`
90
-
91
- ```js
92
- // gx (either Popup class)
93
- const popup = new gx.zeyos.Popup({ width: 480, content: 'Details', overlayDismiss: true });
94
- popup.show();
95
-
96
- // Zx
97
- const popup = new zx.Dialog(null, { size: 480, content: 'Details', lightDismiss: true });
98
- popup.open();
99
- ```
100
-
101
- Replace `show`/`hide` events and methods with `open`/`close`. Use CSS for custom positioning;
102
- legacy `setPosition()` is only a warning-producing compatibility no-op.
103
-
104
- ### `gx.bootstrap.PopupAlert` → `zx.Dialog.alert`
105
-
106
- ```js
107
- // gx
108
- await gx.bootstrap.PopupAlert('Saved', 'The record was saved.');
109
-
110
- // Zx
111
- await zx.Dialog.alert({ title: 'Saved', message: 'The record was saved.' });
112
- ```
113
-
114
- ### `gx.bootstrap.PopupConfirm` and `PopupConfirmCanceled` → `zx.Dialog.confirm`
115
-
116
- ```js
117
- // gx
118
- const result = await gx.bootstrap.PopupConfirm('Delete', 'Delete this record?');
119
- if (result !== gx.bootstrap.PopupConfirmCanceled) removeRecord();
120
-
121
- // Zx
122
- if (await zx.Dialog.confirm({ title: 'Delete', message: 'Delete this record?', danger: true })) {
123
- removeRecord();
124
- }
125
- ```
126
-
127
- ### `gx.zeyos.Dialog` → `zx.Dialog` views
128
-
129
- ```js
130
- // gx
131
- const dialog = new gx.zeyos.Dialog(null, { title: 'Wizard' });
132
- dialog.addFrame('review', { title: 'Review', content: reviewNode }, true);
133
- dialog.openFrame('review');
134
-
135
- // Zx
136
- const dialog = new zx.Dialog(null, { title: 'Wizard' });
137
- dialog.addView('review', { title: 'Review', content: reviewNode });
138
- dialog.showView('review');
139
- dialog.open();
140
- ```
141
-
142
- Replace `addSubmitFrame`, `addFormFrame`, and `addSuccessFrame` with explicit views, `Form`
143
- instances, and dialog button actions. Read form data with `form.getValues()`.
144
-
145
- ### `gx.zeyos.Dropdown` → `zx.MenuButton`
146
-
147
- ```js
148
- // gx
149
- const menu = new gx.zeyos.Dropdown(host, { items: { edit: 'Edit', remove: 'Remove' } });
150
- menu.addEvent('change', (value) => run(value));
151
-
152
- // Zx
153
- const menu = new zx.MenuButton(null, {
154
- label: 'Actions',
155
- items: [{ value: 'edit', label: 'Edit' }, { value: 'remove', label: 'Remove' }],
156
- onselect: (event) => run(event.detail.value)
157
- });
158
- host.append(menu.el);
159
- ```
160
-
161
- ### `gx.bootstrap.MenuButton` → `zx.MenuButton`
162
-
163
- ```js
164
- // gx
165
- const menu = new gx.bootstrap.MenuButton(host, { label: 'Actions' });
166
- menu.add('Edit').divider().add('Remove');
167
-
168
- // Zx
169
- const menu = new zx.MenuButton(host, {
170
- label: 'Actions', items: [{ label: 'Edit', value: 'edit' }, '-', { label: 'Remove', value: 'remove' }]
171
- });
172
- ```
173
-
174
- ### `gx.zeyos.Select` and `gx.bootstrap.Select` → `zx.Select`
175
-
176
- ```js
177
- // gx (either namespace)
178
- const select = new gx.zeyos.Select(host, {
179
- data: rows, elementIndex: 'ID', elementLabel: 'name', allowEmpty: true
180
- });
181
- select.addEvent('select', (item) => save(item.ID));
182
-
183
- // Zx
184
- const select = new zx.Select(host, {
185
- items: rows, valueKey: 'ID', labelKey: 'name', clearable: true,
186
- onchange: (event) => save(event.detail.value)
187
- });
188
- ```
189
-
190
- Use `value`/`selected`, `set()`, `setItems()`, and `reset()`. A cleared selection is the same
191
- `change` event with `{value: null, item: null}` rather than a separate `noselect` event.
192
-
193
- ### `gx.zeyos.SelectFilter` and `gx.bootstrap.SelectFilter` → local `zx.Select`
194
-
195
- ```js
196
- // gx
197
- const select = new gx.zeyos.SelectFilter(host, { data: rows, searchfields: ['name', 'code'] });
198
-
199
- // Zx
200
- const select = new zx.Select(host, { items: rows, filter: 'local', searchKeys: ['name', 'code'] });
201
- ```
202
-
203
- ### `gx.zeyos.SelectDyn` and `gx.bootstrap.SelectDyn` → async `zx.Select`
204
-
205
- ```js
206
- // gx
207
- const select = new gx.zeyos.SelectDyn(host, { url: '/people', queryParam: 'query' });
208
-
209
- // Zx
210
- const http = new zx.Http();
211
- const select = new zx.Select(host, {
212
- filter: (query) => http.get('/people', { query }),
213
- onloaded: (event) => console.log(event.detail.items)
214
- });
215
- ```
216
-
217
- ### `gx.bootstrap.SelectDynREST` → `zx.Select` + `zx.zeyosService`
218
-
219
- ```js
220
- // gx
221
- const select = new gx.bootstrap.SelectDynREST(host, { entity: 'contacts', limit: 20 });
222
-
223
- // Zx
224
- const contacts = zx.zeyosService('contacts');
225
- const select = new zx.Select(host, {
226
- filter: (query) => contacts.get('', { search: query, limit: 20 })
227
- });
228
- ```
229
-
230
- ### `gx.zeyos.SelectPrio` and `gx.bootstrap.SelectPrio` → `zx.Select.priority`
231
-
232
- ```js
233
- // gx
234
- const priority = new gx.zeyos.SelectPrio(host, { value: 2 });
235
-
236
- // Zx
237
- const priority = zx.Select.priority(host, { value: 2 });
238
- ```
239
-
240
- ### `gx.zeyos.Checklist` and `gx.bootstrap.Checklist` → `zx.Checklist`
241
-
242
- ```js
243
- // gx (either namespace)
244
- const list = new gx.zeyos.Checklist(host, { data: rows, listValue: 'ID', listFormat: 'name' });
245
- list.setValues([1, 2]);
246
-
247
- // Zx
248
- const list = new zx.Checklist(host, { items: rows, valueKey: 'ID', labelKey: 'name' });
249
- list.setValues([1, 2]);
250
- ```
251
-
252
- For remote data pass `load: () => Promise<items>` and listen for `loaded`.
253
-
254
- ### `gx.zeyos.Permission` → `zx.Permission`
255
-
256
- ```js
257
- // gx
258
- const permission = new gx.zeyos.Permission(host, { value: true, groups });
259
-
260
- // Zx
261
- const permission = new zx.Permission(host, { value: 'public', groups });
262
- permission.on('change', (event) => save(event.detail.value));
263
- ```
264
-
265
- ### `gx.zeyos.Table` and `gx.bootstrap.Table` → `zx.Table`
266
-
267
- ```js
268
- // gx (either namespace)
269
- const table = new gx.zeyos.Table(host, {
270
- cols: [{ id: 'name', label: 'Name', filterable: true }],
271
- structure: (row) => [row.name], data: rows
272
- });
273
-
274
- // Zx
275
- const table = new zx.Table(host, {
276
- columns: [{ id: 'name', label: 'Name', sortable: true }],
277
- data: rows, rowId: 'ID'
278
- });
279
- ```
280
-
281
- Move `structure()` work into per-column `render(row, index)`. Replace `filter` events with `sort`
282
- and `click`/`dblclick` with `rowclick`/`rowdblclick`; all payloads are in `event.detail`.
283
-
284
- ### `gx.ui.SimpleTable` → `zx.Table`
285
-
286
- ```js
287
- // gx
288
- const table = new gx.ui.SimpleTable({ cols: ['Name'] });
289
- table.addRow({ ID: 1, name: 'Ada' });
290
-
291
- // Zx
292
- const table = new zx.Table(null, { columns: [{ id: 'name', label: 'Name' }], rowId: 'ID' });
293
- table.addData([{ ID: 1, name: 'Ada' }]);
294
- ```
295
-
296
- Use `setData`, `addData`, `updateRow`, `removeRow`, and `getData` for row operations.
297
-
298
- ### `gx.zeyos.Tabbox` and `gx.bootstrap.Tabbox` → `zx.Tabbox`
299
-
300
- ```js
301
- // gx (either namespace; show is one-based)
302
- const tabs = new gx.zeyos.Tabbox(host, { frames, show: 2 });
303
- tabs.openTab('history');
304
-
305
- // Zx
306
- const tabs = new zx.Tabbox(host, { tabs, active: 'history' });
307
- tabs.openTab('history');
308
- ```
309
-
310
- Rename `frames` to `tabs`; each entry keeps `name`, `title`, and `content`. Use `setBadge()` in
311
- place of `setHighlight()`.
312
-
313
- ### `gx.bootstrap.NavigationBar` → `zx.NavigationBar`
314
-
315
- ```js
316
- // gx
317
- const navigation = new gx.bootstrap.NavigationBar(host, { title: 'ZeyOS', frames, buttons });
318
-
319
- // Zx
320
- const navigation = new zx.NavigationBar(host, { title: 'ZeyOS', items: frames, actions: buttons });
321
- ```
322
-
323
- ### `gx.zeyos.Panel` → `zx.Panel`
324
-
325
- ```js
326
- // gx
327
- const panel = new gx.zeyos.Panel(host, 'Details', contentNode, true);
328
-
329
- // Zx
330
- const panel = new zx.Panel(host, { title: 'Details', content: contentNode, open: true });
331
- ```
332
-
333
- ### `gx.zeyos.MasterPanel` → `zx.MasterPanel`
334
-
335
- ```js
336
- // gx
337
- const panel = new gx.zeyos.MasterPanel(host, 'Contacts', contentNode, buttons);
338
-
339
- // Zx
340
- const panel = new zx.MasterPanel(host, { title: 'Contacts', content: contentNode, buttons });
341
- ```
342
-
343
- ### `gx.zeyos.Groupbox` → `zx.Groupbox`
344
-
345
- ```js
346
- // gx
347
- const group = new gx.zeyos.Groupbox(host, { title: 'Advanced', open: false });
348
-
349
- // Zx
350
- const group = new zx.Groupbox(host, { title: 'Advanced', open: false });
351
- group.open();
352
- ```
353
-
354
- ### `gx.zeyos.Search` → `zx.Search`
355
-
356
- ```js
357
- // gx
358
- const search = new gx.zeyos.Search();
359
- search.addEvent('keypress', () => load(search.get()));
360
-
361
- // Zx
362
- const search = new zx.Search(null, { onsubmit: (event) => load(event.detail.value) });
363
- host.append(search.el);
364
- ```
365
-
366
- ### `gx.zeyos.Datebox` → `zx.Datebox` or `zx.DateTimeBox`
367
-
368
- ```js
369
- // gx
370
- const date = new gx.zeyos.Datebox(host, { timestamp, unit: 'seconds', format: ['d', '.', 'M', '.', 'y'] });
371
-
372
- // Zx
373
- const date = new zx.Datebox(host, { value: timestamp, format: '%d.%m.%Y' });
374
- const timestampSeconds = date.get('seconds');
375
- ```
376
-
377
- Use `zx.DateTimeBox(host, options)` when the legacy format included hours/minutes.
378
-
379
- ### `gx.zeyos.DatePicker` → `zx.DatePicker`
380
-
381
- ```js
382
- // gx
383
- const picker = new gx.zeyos.DatePicker(host, { date: initial, weeknumbers: true });
384
-
385
- // Zx
386
- const picker = new zx.DatePicker(host, { value: initial, showWeekNumbers: true });
387
- ```
388
-
389
- ### `gx.zeyos.MonthPicker` → `zx.MonthPicker`
390
-
391
- ```js
392
- // gx
393
- const picker = new gx.zeyos.MonthPicker(host, { date: initial });
394
-
395
- // Zx
396
- const picker = new zx.MonthPicker(host, { value: initial });
397
- ```
398
-
399
- ### `gx.zeyos.TimePicker` → `zx.TimePicker`
400
-
401
- ```js
402
- // gx
403
- const picker = new gx.zeyos.TimePicker(host, { date: initial, format: '%H:%M:%S' });
404
-
405
- // Zx
406
- const picker = new zx.TimePicker(host, { value: initial, seconds: true });
407
- ```
408
-
409
- Direct picker `change` events carry `{date}` or `{time}`. Use `Date#getTime()` or the exported
410
- date formatting helpers when a timestamp or formatted string is required.
411
-
412
- ### `gx.ui.Timebox`, `gx.zeyos.Timebox`, and `gx.bootstrap.Timebox` → `zx.Timebox`
413
-
414
- ```js
415
- // gx (any namespace)
416
- const duration = new gx.zeyos.Timebox(host, { time: -90, unit: 'minutes', prefix: true });
417
-
418
- // Zx
419
- const duration = new zx.Timebox(host, { value: -90, unit: 'minutes', signed: true });
420
- ```
421
-
422
- Use `get(unit)`, `set(value, unit)`, `enable()`, and `disable()`.
423
-
424
- ### `gx.bootstrap.CheckButton` → `zx.CheckButton`
425
-
426
- ```js
427
- // gx
428
- const check = new gx.bootstrap.CheckButton(host, { label: ['On', 'Off'], value: true });
429
-
430
- // Zx
431
- const check = new zx.CheckButton(host, { label: ['On', 'Off'], checked: true });
432
- check.on('change', (event) => save(event.detail.checked));
433
- ```
434
-
435
- ### `gx.bootstrap.Form` → `zx.Form`
436
-
437
- ```js
438
- // gx
439
- const form = new gx.bootstrap.Form(host, { horizontal: true, fields: legacyFields });
440
-
441
- // Zx
442
- const form = new zx.Form(host, {
443
- fieldsets: [{ fields: modernFields }],
444
- actions: [{ id: 'save', label: 'Save', type: 'submit', kind: 'primary' }]
445
- });
446
- ```
447
-
448
- Use `getValues`, `setValues`, `getField`, `setHighlights`, `reset`, and the preventable `submit`
449
- event.
450
-
451
- ### `gx.bootstrap.Fieldset` → `zx.Fieldset`
452
-
453
- ```js
454
- // gx
455
- const fields = new gx.bootstrap.Fieldset(host, { title: 'Contact', fields: legacyFields });
456
-
457
- // Zx
458
- const fields = new zx.Fieldset(host, { title: 'Contact', columns: 2, fields: modernFields });
459
- ```
460
-
461
- ### `gx.bootstrap.Field` → `zx.Field`
462
-
463
- ```js
464
- // gx
465
- const field = new gx.bootstrap.Field({ type: 'text', label: 'Name', value: 'Ada' });
466
- host.append(field.toElement());
467
-
468
- // Zx
469
- const field = new zx.Field(host, { id: 'name', type: 'text', label: 'Name', value: 'Ada' });
470
- ```
471
-
472
- Legacy `gxselect`, date/month/time widgets, option lists, and custom HTML fields map to registered
473
- Zx field adapters. Highlights use `danger`, `warning`, or `success`.
474
-
475
- ### `gx.bootstrap.ValueList` → `zx.ValueList`
476
-
477
- ```js
478
- // gx
479
- const values = new gx.bootstrap.ValueList(host, { deletable: true });
480
- values.addValue('one');
481
-
482
- // Zx
483
- const values = new zx.ValueList(host, { deletable: true, sortable: true });
484
- values.addValue('one');
485
- ```
486
-
487
- ### `gx.bootstrap.MultiValueEditor` → `zx.MultiValueEditor`
488
-
489
- ```js
490
- // gx (JSON string)
491
- const editor = new gx.bootstrap.MultiValueEditor(host);
492
- editor.setValue('["one","two"]');
493
-
494
- // Zx (array)
495
- const editor = new zx.MultiValueEditor(host);
496
- editor.setValues(['one', 'two']);
497
- ```
498
-
499
- The compatibility wrapper deliberately preserves JSON-string `getValue()`/`setValue()` only for
500
- unmigrated callers.
501
-
502
- ### `gx.bootstrap.FieldUpload` → `zx.FieldUpload`
503
-
504
- ```js
505
- // gx
506
- const upload = new gx.bootstrap.FieldUpload({ uploadurl: '/upload', inputname: 'document' });
507
- host.append(upload.toElement());
508
-
509
- // Zx
510
- const upload = new zx.FieldUpload(host, { url: '/upload', paramName: 'document' });
511
- ```
512
-
513
- Use `params`, `accept`, `maxSize`, `multiple`, and the `select`, `progress`, `success`, `error`, and
514
- `abort` events.
515
-
516
- ### `gx.bootstrap.DataFilter` → `zx.DataFilter`
517
-
518
- ```js
519
- // gx
520
- const filter = new gx.bootstrap.DataFilter(host);
521
- filter.addFulltextFilter('query', ['name', 'city']).initData(rows).doFilter();
522
-
523
- // Zx
524
- const filter = new zx.DataFilter(host, {
525
- data: rows,
526
- filters: [{ type: 'text', id: 'query', label: 'Search', fields: ['name', 'city'] }]
527
- });
528
- const visibleRows = filter.apply();
529
- ```
530
-
531
- Use `setData`, `setState`, `getState`, `apply`, `clear`, and `addFilter`.
532
-
533
- ### `gx.zeyos.Client` → `zx.Http`
534
-
535
- ```js
536
- // gx
537
- const client = new gx.zeyos.Client({ url: '/api/' });
538
- client.get('contacts', { active: true });
539
-
540
- // Zx
541
- const client = new zx.Http({ base: '/api/' });
542
- await client.get('contacts', { active: true });
543
- ```
544
-
545
- ### `gx.zeyos.Request` → `zx.zeyosService`
546
-
547
- ```js
548
- // gx
549
- const request = new gx.zeyos.Request({ service: 'contacts', accesskey: token });
550
- request.post('create', data);
551
-
552
- // Zx
553
- const request = zx.zeyosService('contacts', token);
554
- await request.post('create', data);
555
- ```
556
-
557
- `Http` uses promises and exposes `request`, `get`, `post`, `put`, and `delete`. Uploads use
558
- `request(path, {method, files, data})`. Request failures reject; use `try`/`catch` or `onError`.
559
-
560
- ### `gx.zeyos.Factory` → `zx.button`, `zx.buttonGroup`, and `zx.icon`
561
-
562
- ```js
563
- // gx
564
- const save = gx.zeyos.Factory.Button('Save', 'primary', 'check');
565
- const glyph = gx.zeyos.Factory.Icon('trash');
566
-
567
- // Zx
568
- const save = zx.button({ label: 'Save', kind: 'primary', icon: 'check' });
569
- const glyph = zx.icon('trash');
570
- ```
571
-
572
- ## Intentionally not reproduced
573
-
574
- - `gx.core.Settings` and `gx.ui.Container`: direct construction now throws. Use plain option
575
- objects and extend `zx.Component`; emulating the MooTools inheritance model would retain the
576
- coupling Zx removes.
577
- - `gx.ui.Collapse` and `gx.ui.Blend`: compatibility names are migration-error stubs. Use CSS
578
- transitions guarded by `prefers-reduced-motion`; Zx does not reproduce `Fx.*` timing or the
579
- MooTools `Class`/`Fx` APIs.
580
- - `gx.ui.Hud`: use `zx.Dialog` or `zx.Modal` so focus, Escape, and the top layer remain native.
581
- - `gx.ui.Toggling`: use `zx.Toggle`, `zx.CheckButton`, `zx.Panel`, or direct ARIA/data state.
582
- - `gx.ui.HGroup`: use application CSS grid/flex layout.
583
- - `gx.ui.Templates`: use native `<template>`, `zx.h()`, or explicit renderer functions.
584
- - Legacy bugs are fixed, not emulated: `MenuButton.setStyle`'s typo, the dead
585
- `MultiValueEditor` delete path, duplicate CheckButton `check`, the Request.File comma bug,
586
- Tabbox's wrong root, and `Request.delete()` sending PUT. Update tests that depended on those
587
- defects; `Http.delete()` sends DELETE.
588
- - `_theme` class-map overrides, including `gx.ui.Table._theme`, are not supported. Override Zx
589
- semantic tokens or documented component selectors instead.
590
- - Legacy atomic utility CSS and pixel-identical legacy styling are not shipped. Keep temporary
591
- app-owned utilities during migration, then replace them with layout CSS and semantic tokens.
592
- - Fontello numeric glyph codes are not supported. Use the named icons accepted by `zx.icon()`.
593
- - Full MooTools `getCoordinates()` objects are not emulated. Wrappers expose only
594
- `width`/`height`/`top`/`left`; migrated code should use `getBoundingClientRect()`.
595
- - `dispatchEvents` is not reproduced. Use native `dispatchEvent()` or a component's `emit()` and
596
- listen for bubbling `zx-*` DOM events.
597
- - `gx.Browser` is not reproduced. Prefer feature detection (`CSS.supports`, element/method
598
- presence, media queries) over browser-name branching.