@zeyos/zx 3.0.0 → 4.1.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 (106) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/DESIGN-SYSTEM.md +87 -71
  3. package/README.md +16 -37
  4. package/dist/types/components/app-icon/app-icon.d.ts +88 -0
  5. package/dist/types/components/app-sidebar/app-sidebar.d.ts +106 -32
  6. package/dist/types/components/card/card.d.ts +128 -0
  7. package/dist/types/components/chart/chart.d.ts +1 -0
  8. package/dist/types/components/filter/filter-model.d.ts +87 -0
  9. package/dist/types/components/filter/filter.d.ts +331 -0
  10. package/dist/types/components/launcher/launcher.d.ts +65 -6
  11. package/dist/types/components/select/select.d.ts +97 -4
  12. package/dist/types/components/table/table.d.ts +107 -3
  13. package/dist/types/components/tag-picker/tag-picker.d.ts +16 -0
  14. package/dist/types/core/dom.d.ts +9 -1
  15. package/dist/types/core/util.d.ts +9 -0
  16. package/dist/types/index.d.ts +6 -2
  17. package/dist/types/{components/app-rail → internal}/app-rail.d.ts +34 -19
  18. package/dist/types/zeyos/icons.d.ts +24 -2
  19. package/dist/types/zeyos/index.d.ts +3 -2
  20. package/dist/types/zeyos/launcher.d.ts +147 -0
  21. package/dist/types/zeyos/select.d.ts +41 -0
  22. package/dist/zx-zeyos.esm.js +2018 -113
  23. package/dist/zx-zeyos.esm.min.js +1 -1
  24. package/dist/zx.css +815 -16
  25. package/dist/zx.esm.js +2661 -338
  26. package/dist/zx.esm.min.js +3 -3
  27. package/dist/zx.global.js +2661 -338
  28. package/dist/zx.global.min.js +3 -3
  29. package/dist/zx.min.css +1 -1
  30. package/docs/api.json +602 -110
  31. package/docs/llms.md +181 -123
  32. package/docs/llms.txt +24 -21
  33. package/package.json +8 -17
  34. package/src/components/app-icon/app-icon.css +105 -0
  35. package/src/components/app-icon/app-icon.js +134 -0
  36. package/src/components/app-sidebar/app-sidebar.css +12 -0
  37. package/src/components/app-sidebar/app-sidebar.js +310 -110
  38. package/src/components/card/card.css +149 -0
  39. package/src/components/card/card.js +285 -0
  40. package/src/components/chart/chart.js +8 -3
  41. package/src/components/filter/filter-model.js +226 -0
  42. package/src/components/filter/filter.css +147 -0
  43. package/src/components/filter/filter.js +554 -0
  44. package/src/components/grid/grid.css +1 -1
  45. package/src/components/grid/grid.js +14 -4
  46. package/src/components/launcher/launcher.css +113 -3
  47. package/src/components/launcher/launcher.js +234 -26
  48. package/src/components/message/message.css +36 -3
  49. package/src/components/select/field-adapter.js +9 -4
  50. package/src/components/select/select.css +161 -10
  51. package/src/components/select/select.js +361 -48
  52. package/src/components/table/table.css +85 -0
  53. package/src/components/table/table.js +426 -31
  54. package/src/components/tag-picker/tag-picker.css +19 -0
  55. package/src/components/tag-picker/tag-picker.js +42 -5
  56. package/src/core/dom.js +21 -1
  57. package/src/core/util.js +20 -0
  58. package/src/index.js +9 -2
  59. package/src/{components/app-rail → internal}/app-rail.js +80 -30
  60. package/src/zeyos/icons.js +38 -20
  61. package/src/zeyos/index.js +8 -2
  62. package/src/zeyos/launcher.js +338 -0
  63. package/src/zeyos/modules.js +1 -0
  64. package/src/zeyos/select.js +116 -1
  65. package/styles/tokens/global.css +1 -1
  66. package/styles/tokens/modules.css +1 -0
  67. package/styles/tokens/semantic.css +9 -0
  68. package/styles/tokens/themes.css +2 -2
  69. package/styles/zx.css +3 -0
  70. package/MIGRATION.md +0 -749
  71. package/dist/types/compat/base.d.ts +0 -156
  72. package/dist/types/compat/globals.d.ts +0 -20
  73. package/dist/types/compat/index.d.ts +0 -128
  74. package/dist/types/compat/map/basic.d.ts +0 -175
  75. package/dist/types/compat/map/data.d.ts +0 -103
  76. package/dist/types/compat/map/date-time.d.ts +0 -80
  77. package/dist/types/compat/map/factory.d.ts +0 -9
  78. package/dist/types/compat/map/form.d.ts +0 -98
  79. package/dist/types/compat/map/helpers.d.ts +0 -12
  80. package/dist/types/compat/map/http.d.ts +0 -36
  81. package/dist/types/compat/map/layout.d.ts +0 -106
  82. package/dist/types/compat/map/options.d.ts +0 -80
  83. package/dist/types/compat/map/select.d.ts +0 -95
  84. package/dist/types/compat/map/stubs.d.ts +0 -32
  85. package/dist/types/compat/map/utilities.d.ts +0 -37
  86. package/dist/types/compat-entry.d.ts +0 -5
  87. package/dist/zx-compat.esm.js +0 -17848
  88. package/dist/zx-compat.esm.min.js +0 -1
  89. package/dist/zx-compat.global.js +0 -29008
  90. package/dist/zx-compat.global.min.js +0 -3
  91. package/src/compat/base.js +0 -291
  92. package/src/compat/globals.js +0 -167
  93. package/src/compat/index.js +0 -84
  94. package/src/compat/map/basic.js +0 -464
  95. package/src/compat/map/data.js +0 -254
  96. package/src/compat/map/date-time.js +0 -177
  97. package/src/compat/map/factory.js +0 -45
  98. package/src/compat/map/form.js +0 -330
  99. package/src/compat/map/helpers.js +0 -46
  100. package/src/compat/map/http.js +0 -117
  101. package/src/compat/map/layout.js +0 -256
  102. package/src/compat/map/options.js +0 -267
  103. package/src/compat/map/select.js +0 -198
  104. package/src/compat/map/stubs.js +0 -26
  105. package/src/compat/map/utilities.js +0 -113
  106. package/src/compat-entry.js +0 -11
@@ -1,291 +0,0 @@
1
- import { installElementStorage } from './globals.js';
2
-
3
- /** @typedef {(detail: Record<string, any>, event: Event) => unknown[]} LegacyArgumentMapper */
4
- /**
5
- * @typedef {Object} LegacyEventMapping
6
- * @property {string} type Zx event name.
7
- * @property {LegacyArgumentMapper} [args] Legacy positional argument adapter.
8
- * @property {(detail: Record<string, any>, event: Event) => boolean} [filter] Optional event filter.
9
- */
10
- /** @typedef {Record<string, string|LegacyEventMapping>} LegacyEventMap */
11
- /**
12
- * @typedef {Object} WrapperConfiguration
13
- * @property {LegacyEventMap} [events]
14
- * @property {Record<string, string|Element|(() => Element|null)>} [ui]
15
- * @property {Record<string, string|((value: unknown) => void)>} [setters]
16
- */
17
-
18
- /**
19
- * MooTools-flavoured façade shared by compatibility component wrappers.
20
- * @fires GxWrapper#legacy-event
21
- */
22
- export class GxWrapper {
23
- /** Fully qualified legacy class name shown in migration warnings. */
24
- static legacyName = 'gx.ui.Container';
25
-
26
- /**
27
- * Initializes legacy options and callback-style `onEvent` options.
28
- * Subclasses call `_attach()` after constructing their Zx implementation.
29
- * @param {Record<string, any>} [options={}] Legacy options.
30
- * @param {Record<string, any>} [defaults={}] Legacy defaults.
31
- */
32
- constructor(options = {}, defaults = {}) {
33
- warnClassOnce(this.constructor);
34
- this.gx = this.constructor.legacyName;
35
- this.options = { ...defaults, ...(options && typeof options === 'object' ? options : {}) };
36
- this._events = new Map();
37
- this._mappedListeners = [];
38
- this._domAbort = new AbortController();
39
- this._zx = null;
40
- this._ui = {};
41
- this._display = this._ui;
42
- this._uiMap = {};
43
- this._optionSetters = {};
44
- this._destroyed = false;
45
- for (const [key, value] of Object.entries(this.options)) {
46
- if (/^on[A-Z]/.test(key) && typeof value === 'function') this.addEvent(key, value);
47
- }
48
- }
49
-
50
- /**
51
- * Subscribes a legacy callback.
52
- * @param {string} type Legacy event name, with or without an `on` prefix.
53
- * @param {Function} fn Callback receiving legacy positional arguments.
54
- * @returns {this}
55
- */
56
- addEvent(type, fn) {
57
- if (typeof fn !== 'function') return this;
58
- const name = normalizeEventName(type);
59
- const handlers = this._events.get(name) ?? new Set();
60
- handlers.add(fn);
61
- this._events.set(name, handlers);
62
- return this;
63
- }
64
-
65
- /**
66
- * Removes one callback, or all callbacks of a type when omitted.
67
- * @param {string} type Legacy event name.
68
- * @param {Function} [fn] Callback to remove.
69
- * @returns {this}
70
- */
71
- removeEvent(type, fn) {
72
- const name = normalizeEventName(type);
73
- if (fn === undefined) this._events.delete(name);
74
- else {
75
- const handlers = this._events.get(name);
76
- handlers?.delete(fn);
77
- if (handlers?.size === 0) this._events.delete(name);
78
- }
79
- return this;
80
- }
81
-
82
- /**
83
- * Fires a legacy event synchronously.
84
- * @param {string} type Legacy event name.
85
- * @param {unknown|unknown[]} [args=[]] Positional argument array or one argument.
86
- * @returns {this}
87
- * @fires GxWrapper#legacy-event
88
- */
89
- fireEvent(type, args = []) {
90
- const values = Array.isArray(args) ? args : [args];
91
- const handlers = [...(this._events.get(normalizeEventName(type)) ?? [])];
92
- for (const handler of handlers) handler.apply(this, values);
93
- return this;
94
- }
95
-
96
- /**
97
- * Applies multiple post-construction legacy options.
98
- * @param {Record<string, unknown>} options Option values.
99
- * @returns {this}
100
- */
101
- setOptions(options) {
102
- if (!options || typeof options !== 'object') return this;
103
- for (const [name, value] of Object.entries(options)) this.setOption(name, value);
104
- return this;
105
- }
106
-
107
- /**
108
- * Applies one post-construction option through a declared setter.
109
- * Unsupported dynamic options are retained on `options` and warn once per class/key.
110
- * @param {string} option Legacy option name.
111
- * @param {unknown} value New value.
112
- * @returns {this}
113
- */
114
- setOption(option, value) {
115
- const name = String(option);
116
- this.options[name] = value;
117
- if (/^on[A-Z]/.test(name) && typeof value === 'function') {
118
- this.addEvent(name, value);
119
- return this;
120
- }
121
- const setter = this._optionSetters[name];
122
- if (typeof setter === 'function') setter.call(this, value);
123
- else if (typeof setter === 'string' && typeof this[setter] === 'function') this[setter](value);
124
- else warnOptionOnce(this.constructor, name);
125
- return this;
126
- }
127
-
128
- /**
129
- * Returns the wrapped component root.
130
- * @returns {Element|null}
131
- */
132
- toElement() {
133
- return this._zx?.toElement?.() ?? this._zx?.el ?? null;
134
- }
135
-
136
- /**
137
- * Resolves a legacy `_ui` key, falling back to the component root.
138
- * @param {string} [key='root'] Legacy display key.
139
- * @returns {Element|null}
140
- */
141
- display(key = 'root') {
142
- const name = key || 'root';
143
- if (name === 'root') return this.toElement();
144
- const mapped = this._uiMap[name];
145
- if (typeof mapped === 'function') return mapped.call(this) ?? this.toElement();
146
- if (typeof mapped === 'string') return this._zx?.refs?.[mapped] ?? this.toElement();
147
- if (mapped?.nodeType === 1) return mapped;
148
- return this._ui[name] ?? this.toElement();
149
- }
150
-
151
- /**
152
- * Returns the supported legacy coordinate subset.
153
- * @returns {{width: number, height: number, top: number, left: number}}
154
- */
155
- getCoordinates() {
156
- const rectangle = this.toElement()?.getBoundingClientRect?.();
157
- return rectangle ? {
158
- width: rectangle.width,
159
- height: rectangle.height,
160
- top: rectangle.top,
161
- left: rectangle.left
162
- } : { width: 0, height: 0, top: 0, left: 0 };
163
- }
164
-
165
- /**
166
- * Updates one root style property.
167
- * @param {string} property CSS property.
168
- * @param {unknown} value CSS value.
169
- * @returns {this}
170
- */
171
- setStyle(property, value) {
172
- const element = /** @type {HTMLElement|null} */ (this.toElement());
173
- if (!element) return this;
174
- if (String(property).startsWith('--') || String(property).includes('-')) {
175
- element.style.setProperty(String(property), String(value));
176
- } else {
177
- element.style[property] = value;
178
- }
179
- return this;
180
- }
181
-
182
- /**
183
- * Updates supported root coordinates.
184
- * @param {Record<string, unknown>} coordinates Coordinate styles.
185
- * @returns {this}
186
- */
187
- setCoordinates(coordinates = {}) {
188
- for (const key of ['width', 'height', 'top', 'right', 'bottom', 'left']) {
189
- if (coordinates[key] == null) continue;
190
- const value = typeof coordinates[key] === 'number' ? `${coordinates[key]}px` : coordinates[key];
191
- this.setStyle(key, value);
192
- }
193
- return this;
194
- }
195
-
196
- /**
197
- * Destroys the wrapped component and legacy event subscriptions.
198
- * @returns {void}
199
- */
200
- destroy() {
201
- if (this._destroyed) return;
202
- this._destroyed = true;
203
- this._domAbort.abort();
204
- const root = this.toElement();
205
- if (root?.retrieve?.('com') === this) root.eliminate('com');
206
- for (const [type, listener] of this._mappedListeners) this._zx?.off?.(type, listener);
207
- this._mappedListeners.length = 0;
208
- this._events.clear();
209
- this._zx?.destroy?.();
210
- }
211
-
212
- /**
213
- * Attaches a constructed Zx component and its translation metadata.
214
- * @param {any} component Wrapped Zx component.
215
- * @param {WrapperConfiguration} [configuration={}] Event, display, and setter maps.
216
- * @returns {this}
217
- */
218
- _attach(component, configuration = {}) {
219
- this._zx = component;
220
- this._uiMap = { ...(configuration.ui ?? {}) };
221
- this._optionSetters = { ...(configuration.setters ?? {}) };
222
- const root = this.toElement();
223
- if (root) {
224
- installElementStorage(globalThis);
225
- root.store?.('com', this);
226
- this._ui.root = root;
227
- for (const key of Object.keys(this._uiMap)) this._ui[key] = this.display(key);
228
- }
229
- for (const [legacyType, declaration] of Object.entries(configuration.events ?? {})) {
230
- const mapping = typeof declaration === 'string' ? { type: declaration } : declaration;
231
- const listener = (event) => {
232
- const detail = event.detail ?? {};
233
- if (mapping.filter && !mapping.filter.call(this, detail, event)) return;
234
- const args = mapping.args ? mapping.args.call(this, detail, event) : [];
235
- this.fireEvent(legacyType, args);
236
- };
237
- component.on?.(mapping.type, listener);
238
- this._mappedListeners.push([mapping.type, listener]);
239
- }
240
- return this;
241
- }
242
-
243
- /**
244
- * Adds a DOM listener owned by this wrapper.
245
- * @param {EventTarget} target Event target.
246
- * @param {string} type Event type.
247
- * @param {EventListenerOrEventListenerObject} listener Listener.
248
- * @param {AddEventListenerOptions} [options={}] Listener options.
249
- * @returns {this}
250
- */
251
- _listen(target, type, listener, options = {}) {
252
- target.addEventListener(type, listener, { ...options, signal: this._domAbort.signal });
253
- return this;
254
- }
255
-
256
- /** @param {Element|null} element @param {boolean} active @returns {void} */
257
- _mirrorAct(element, active) {
258
- element?.classList.toggle('act', Boolean(active));
259
- }
260
- }
261
-
262
- /** Generic legacy event dispatched by a mapped Zx event. @event GxWrapper#legacy-event */
263
-
264
- /** @param {typeof GxWrapper} constructor @returns {void} */
265
- function warnClassOnce(constructor) {
266
- if (Object.hasOwn(constructor, '_compatWarned') && constructor._compatWarned) return;
267
- Object.defineProperty(constructor, '_compatWarned', { configurable: true, value: true, writable: true });
268
- console.warn(`${constructor.legacyName} is running on the Zx compat layer — migrate to ${replacementName(constructor.legacyName)}`);
269
- }
270
-
271
- /** @param {typeof GxWrapper} constructor @param {string} option @returns {void} */
272
- function warnOptionOnce(constructor, option) {
273
- if (!Object.hasOwn(constructor, '_compatOptionWarnings')) {
274
- Object.defineProperty(constructor, '_compatOptionWarnings', { configurable: true, value: new Set() });
275
- }
276
- if (constructor._compatOptionWarnings.has(option)) return;
277
- constructor._compatOptionWarnings.add(option);
278
- console.warn(`${constructor.legacyName}.setOption("${option}") cannot update the wrapped Zx component dynamically`);
279
- }
280
-
281
- /** @param {string} name @returns {string} */
282
- function replacementName(name) {
283
- const className = name.split('.').at(-1);
284
- return `zx.${className}`;
285
- }
286
-
287
- /** @param {string} type @returns {string} */
288
- function normalizeEventName(type) {
289
- const value = String(type ?? '');
290
- return (/^on[A-Z]/.test(value) ? value.slice(2) : value).toLowerCase();
291
- }
@@ -1,167 +0,0 @@
1
- import { h, htmlEscape } from '../core/dom.js';
2
- import { translate } from '../core/i18n.js';
3
-
4
- /** @type {WeakMap<object, Map<unknown, unknown>>} */
5
- const elementStorage = new WeakMap();
6
-
7
- /**
8
- * Installs the small WeakMap-backed MooTools Element storage surface.
9
- * Existing implementations are never overwritten.
10
- * @param {typeof globalThis} [host=globalThis] Realm whose Element prototype is extended.
11
- * @returns {void}
12
- */
13
- export function installElementStorage(host = globalThis) {
14
- const prototype = host?.Element?.prototype;
15
- if (!prototype) return;
16
- if (typeof prototype.store !== 'function') {
17
- Object.defineProperty(prototype, 'store', {
18
- configurable: true,
19
- writable: true,
20
- value: function store(key, value) {
21
- let values = elementStorage.get(this);
22
- if (!values) {
23
- values = new Map();
24
- elementStorage.set(this, values);
25
- }
26
- values.set(key, value);
27
- return this;
28
- }
29
- });
30
- }
31
- if (typeof prototype.retrieve !== 'function') {
32
- Object.defineProperty(prototype, 'retrieve', {
33
- configurable: true,
34
- writable: true,
35
- value: function retrieve(key, fallback = null) {
36
- let values = elementStorage.get(this);
37
- if (values?.has(key)) return values.get(key);
38
- if (arguments.length > 1) {
39
- if (!values) {
40
- values = new Map();
41
- elementStorage.set(this, values);
42
- }
43
- values.set(key, fallback);
44
- }
45
- return fallback;
46
- }
47
- });
48
- }
49
- if (typeof prototype.eliminate !== 'function') {
50
- Object.defineProperty(prototype, 'eliminate', {
51
- configurable: true,
52
- writable: true,
53
- value: function eliminate(key) {
54
- elementStorage.get(this)?.delete(key);
55
- return this;
56
- }
57
- });
58
- }
59
- }
60
-
61
- /**
62
- * Parses the legacy gx object-literal DOM dialect.
63
- * `html` is intentionally treated as trusted legacy markup via `h.raw()`.
64
- * @param {unknown} source Legacy tree value.
65
- * @returns {Node|false} Parsed node, or false for unsupported input.
66
- */
67
- export function parse(source) {
68
- if (source && typeof source === 'object' && typeof source.toElement === 'function') {
69
- return source.toElement() ?? false;
70
- }
71
- if (source && typeof source === 'object' && typeof source.nodeType === 'number') return source;
72
- if (typeof source === 'string' || typeof source === 'number') return document.createTextNode(String(source));
73
- if (!source || typeof source !== 'object' || Array.isArray(source)) return false;
74
-
75
- const descriptor = source;
76
- const props = {};
77
- const events = [];
78
- const reserved = new Set(['tag', 'html', 'styles', 'classes', 'child', 'children', '_adopt', 'events']);
79
- for (const [key, value] of Object.entries(descriptor)) {
80
- if (reserved.has(key)) continue;
81
- if (/^on[A-Z]/.test(key) && typeof value === 'function') {
82
- events.push([key.slice(2).toLowerCase(), value]);
83
- } else if (key === 'class') {
84
- props.class = value;
85
- } else if (key === 'text') {
86
- props.textContent = value == null ? '' : String(value);
87
- } else {
88
- props[key] = value;
89
- }
90
- }
91
- if (descriptor.styles && typeof descriptor.styles === 'object') props.style = descriptor.styles;
92
- if (descriptor.classes != null) {
93
- const classes = Array.isArray(descriptor.classes) ? descriptor.classes : [descriptor.classes];
94
- props.class = [props.class, ...classes].flat().filter(Boolean);
95
- }
96
- const element = h(String(descriptor.tag ?? 'div'), props);
97
- for (const [type, listener] of events) element.addEventListener(type, listener);
98
- if (descriptor.events && typeof descriptor.events === 'object') {
99
- for (const [type, listener] of Object.entries(descriptor.events)) {
100
- if (typeof listener === 'function') element.addEventListener(type, listener);
101
- }
102
- }
103
- if (descriptor.html != null) element.append(h.raw(String(descriptor.html)));
104
- appendParsed(element, descriptor._adopt);
105
- appendParsed(element, descriptor.child);
106
- if (Array.isArray(descriptor.children)) {
107
- for (const child of descriptor.children) appendParsed(element, child);
108
- } else if (descriptor.children && typeof descriptor.children === 'object') {
109
- const names = [];
110
- for (const [name, childSource] of Object.entries(descriptor.children)) {
111
- const child = parse(childSource);
112
- if (!child) continue;
113
- element.append(child);
114
- element[`_${name}`] = child.retrieve?.('com') ?? child;
115
- names.push(name);
116
- }
117
- element.store?.('children', names);
118
- }
119
- return element;
120
- }
121
-
122
- /**
123
- * Explicitly installs legacy globals and prototype conveniences.
124
- * @param {typeof globalThis} [host=globalThis] Realm to modify.
125
- * @returns {typeof globalThis} The supplied realm.
126
- */
127
- export function installGlobals(host = globalThis) {
128
- installElementStorage(host);
129
- // `__` is also the current ZeyOS compact DOM builder. Never replace an existing meaning; the
130
- // gx parser is still installed for legacy-only hosts where the name is genuinely free.
131
- if (host.__ === undefined) host.__ = parse;
132
- const stringPrototype = host.String?.prototype;
133
- if (stringPrototype && typeof stringPrototype.htmlSpecialChars !== 'function') {
134
- Object.defineProperty(stringPrototype, 'htmlSpecialChars', {
135
- configurable: true,
136
- writable: true,
137
- value: function htmlSpecialChars() { return htmlEscape(String(this)); }
138
- });
139
- }
140
- const arrayPrototype = host.Array?.prototype;
141
- if (arrayPrototype && typeof arrayPrototype.findBy !== 'function') {
142
- Object.defineProperty(arrayPrototype, 'findBy', {
143
- configurable: true,
144
- writable: true,
145
- value: function findBy(matcher, value) {
146
- const predicate = typeof matcher === 'string' ? (item) => item?.[matcher] === value : matcher;
147
- if (typeof predicate !== 'function') return null;
148
- for (let index = this.length - 1; index >= 0; index -= 1) {
149
- if (predicate(this[index]) === true) return this[index];
150
- }
151
- return null;
152
- }
153
- });
154
- }
155
- if (host._ === undefined) host._ = (key, args) => translate(String(key), args);
156
- return host;
157
- }
158
-
159
- /** @param {Node} parent @param {unknown} source @returns {void} */
160
- function appendParsed(parent, source) {
161
- if (source == null) return;
162
- const list = Array.isArray(source) ? source : [source];
163
- for (const item of list) {
164
- const child = parse(item);
165
- if (child) parent.append(child);
166
- }
167
- }
@@ -1,84 +0,0 @@
1
- import { GxWrapper } from './base.js';
2
- import { installElementStorage, installGlobals, parse } from './globals.js';
3
- import {
4
- BootstrapMessage, BootstrapPopup, CheckButton, Dialog, Dropdown, MenuButton, Msgbox, Popup,
5
- PopupAlert, PopupConfirm, PopupConfirmCanceled, Toggle
6
- } from './map/basic.js';
7
- import {
8
- BootstrapChecklist, BootstrapTable, Checklist, DataFilter, Permission, SimpleTable, Table
9
- } from './map/data.js';
10
- import {
11
- BootstrapTimebox, CoreTimebox, Datebox, DatePicker, MonthPicker, Timebox, TimePicker
12
- } from './map/date-time.js';
13
- import { Factory } from './map/factory.js';
14
- import { Field, Fieldset, FieldUpload, Form, MultiValueEditor, ValueList } from './map/form.js';
15
- import { Client, Request } from './map/http.js';
16
- import {
17
- BootstrapTabbox, Groupbox, MasterPanel, NavigationBar, Panel, Search, Tabbox
18
- } from './map/layout.js';
19
- import {
20
- BootstrapSelect, BootstrapSelectDyn, BootstrapSelectFilter, BootstrapSelectPrio,
21
- Select, SelectDyn, SelectDynREST, SelectFilter, SelectPrio
22
- } from './map/select.js';
23
- import { Container, Settings, Blend, Collapse, HGroup, Hud, Templates, Toggling } from './map/stubs.js';
24
- import { util } from './map/utilities.js';
25
-
26
- /** Compatibility utilities and explicit global/prototype installers. */
27
- const compat = Object.freeze({ installGlobals, installElementStorage, parse, GxWrapper });
28
-
29
- /** Window-independent legacy gx namespace. */
30
- export const gx = {
31
- core: { Settings },
32
- ui: {
33
- Container, SimpleTable, Timebox: CoreTimebox,
34
- Collapse, Blend, Hud, Toggling, HGroup, Templates
35
- },
36
- util,
37
- zeyos: {
38
- Toggle, Msgbox, Popup, Dialog, Dropdown,
39
- Select, SelectFilter, SelectDyn, SelectPrio,
40
- Checklist, Permission, Table, Tabbox,
41
- Panel, MasterPanel, Groupbox, Search,
42
- Datebox, DatePicker, TimePicker, MonthPicker, Timebox,
43
- Client, Request, Factory
44
- },
45
- bootstrap: {
46
- Message: BootstrapMessage,
47
- Popup: BootstrapPopup,
48
- PopupAlert,
49
- PopupConfirm,
50
- PopupConfirmCanceled,
51
- MenuButton,
52
- CheckButton,
53
- Select: BootstrapSelect,
54
- SelectFilter: BootstrapSelectFilter,
55
- SelectDyn: BootstrapSelectDyn,
56
- SelectDynREST,
57
- SelectPrio: BootstrapSelectPrio,
58
- Checklist: BootstrapChecklist,
59
- Table: BootstrapTable,
60
- Tabbox: BootstrapTabbox,
61
- NavigationBar,
62
- Timebox: BootstrapTimebox,
63
- Form,
64
- Fieldset,
65
- Field,
66
- ValueList,
67
- MultiValueEditor,
68
- FieldUpload,
69
- DataFilter
70
- },
71
- compat
72
- };
73
-
74
- /** Assigns the compatibility namespace to a browser-like host without installing optional globals. @param {typeof globalThis} [host=globalThis] @returns {typeof gx} */
75
- export function install(host = globalThis) {
76
- installElementStorage(host);
77
- host.gx = gx;
78
- return gx;
79
- }
80
-
81
- gx.install = install;
82
-
83
- export { GxWrapper, installElementStorage, installGlobals, parse };
84
- export default gx;