@zeyos/zx 2.1.0 → 2.2.1
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 +51 -0
- package/README.md +15 -0
- package/dist/types/compat/base.d.ts +156 -0
- package/dist/types/compat/globals.d.ts +20 -0
- package/dist/types/compat/index.d.ts +128 -0
- package/dist/types/compat/map/basic.d.ts +175 -0
- package/dist/types/compat/map/data.d.ts +102 -0
- package/dist/types/compat/map/date-time.d.ts +80 -0
- package/dist/types/compat/map/factory.d.ts +9 -0
- package/dist/types/compat/map/form.d.ts +98 -0
- package/dist/types/compat/map/helpers.d.ts +12 -0
- package/dist/types/compat/map/http.d.ts +36 -0
- package/dist/types/compat/map/layout.d.ts +106 -0
- package/dist/types/compat/map/options.d.ts +80 -0
- package/dist/types/compat/map/select.d.ts +95 -0
- package/dist/types/compat/map/stubs.d.ts +32 -0
- package/dist/types/compat/map/utilities.d.ts +37 -0
- package/dist/types/compat-entry.d.ts +5 -0
- package/dist/types/components/badge/badge.d.ts +46 -0
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +200 -0
- package/dist/types/components/button/button.d.ts +42 -0
- package/dist/types/components/check-button/check-button.d.ts +98 -0
- package/dist/types/components/checklist/checklist.d.ts +143 -0
- package/dist/types/components/checklist/field-adapter.d.ts +5 -0
- package/dist/types/components/context-menu/context-menu.d.ts +130 -0
- package/dist/types/components/copy/copy-button.d.ts +48 -0
- package/dist/types/components/copy/copy-input.d.ts +91 -0
- package/dist/types/components/data-filter/data-filter.d.ts +250 -0
- package/dist/types/components/data-filter/filter-core.d.ts +52 -0
- package/dist/types/components/date-picker/date-picker.d.ts +137 -0
- package/dist/types/components/date-picker/date-range-picker.d.ts +350 -0
- package/dist/types/components/date-picker/field-adapter.d.ts +6 -0
- package/dist/types/components/date-picker/month-picker.d.ts +75 -0
- package/dist/types/components/date-picker/range-field-adapter.d.ts +7 -0
- package/dist/types/components/date-picker/time-picker.d.ts +127 -0
- package/dist/types/components/datebox/date-range-box.d.ts +218 -0
- package/dist/types/components/datebox/datebox.d.ts +160 -0
- package/dist/types/components/datebox/field-adapter.d.ts +5 -0
- package/dist/types/components/dialog/dialog.d.ts +284 -0
- package/dist/types/components/dropdown/dropdown.d.ts +118 -0
- package/dist/types/components/empty-state/empty-state.d.ts +38 -0
- package/dist/types/components/field/field.d.ts +231 -0
- package/dist/types/components/field-upload/field-adapter.d.ts +5 -0
- package/dist/types/components/field-upload/field-upload.d.ts +213 -0
- package/dist/types/components/fieldset/fieldset.d.ts +125 -0
- package/dist/types/components/finder/finder.d.ts +252 -0
- package/dist/types/components/form/form.d.ts +194 -0
- package/dist/types/components/groupbox/groupbox.d.ts +89 -0
- package/dist/types/components/layout/layout.d.ts +132 -0
- package/dist/types/components/loading/inline-loading.d.ts +86 -0
- package/dist/types/components/loading/progress-bar.d.ts +168 -0
- package/dist/types/components/loading/spinner.d.ts +34 -0
- package/dist/types/components/master-panel/master-panel.d.ts +112 -0
- package/dist/types/components/menu-button/menu-button.d.ts +142 -0
- package/dist/types/components/message/message.d.ts +212 -0
- package/dist/types/components/modal/modal.d.ts +105 -0
- package/dist/types/components/multi-value-editor/field-adapter.d.ts +5 -0
- package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +66 -0
- package/dist/types/components/navigation-bar/navigation-bar.d.ts +229 -0
- package/dist/types/components/number-field/field-adapter.d.ts +5 -0
- package/dist/types/components/number-field/number-field.d.ts +292 -0
- package/dist/types/components/pagination/pagination.d.ts +267 -0
- package/dist/types/components/panel/panel.d.ts +194 -0
- package/dist/types/components/permission/permission.d.ts +93 -0
- package/dist/types/components/rating/field-adapter.d.ts +5 -0
- package/dist/types/components/rating/rating.d.ts +213 -0
- package/dist/types/components/search/search.d.ts +98 -0
- package/dist/types/components/select/field-adapter.d.ts +5 -0
- package/dist/types/components/select/filter.d.ts +11 -0
- package/dist/types/components/select/select.d.ts +235 -0
- package/dist/types/components/skeleton/skeleton.d.ts +97 -0
- package/dist/types/components/slider/field-adapter.d.ts +5 -0
- package/dist/types/components/slider/slider.d.ts +216 -0
- package/dist/types/components/split-view/split-view.d.ts +335 -0
- package/dist/types/components/stepper/stepper.d.ts +314 -0
- package/dist/types/components/stepper/steps.d.ts +131 -0
- package/dist/types/components/tabbox/tabbox.d.ts +230 -0
- package/dist/types/components/table/sort.d.ts +49 -0
- package/dist/types/components/table/table.d.ts +872 -0
- package/dist/types/components/tag-picker/field-adapter.d.ts +5 -0
- package/dist/types/components/tag-picker/tag-picker.d.ts +375 -0
- package/dist/types/components/timebox/field-adapter.d.ts +5 -0
- package/dist/types/components/timebox/timebox.d.ts +121 -0
- package/dist/types/components/toggle/field-adapter.d.ts +5 -0
- package/dist/types/components/toggle/toggle.d.ts +94 -0
- package/dist/types/components/toolbar/toolbar.d.ts +230 -0
- package/dist/types/components/tooltip/tooltip.d.ts +183 -0
- package/dist/types/components/tree/hierarchy.d.ts +113 -0
- package/dist/types/components/tree/tree.d.ts +383 -0
- package/dist/types/components/truncate/truncate.d.ts +61 -0
- package/dist/types/components/value-list/field-adapter.d.ts +5 -0
- package/dist/types/components/value-list/value-list.d.ts +143 -0
- package/dist/types/core/breakpoint.d.ts +68 -0
- package/dist/types/core/component.d.ts +115 -0
- package/dist/types/core/date.d.ts +50 -0
- package/dist/types/core/dom.d.ts +86 -0
- package/dist/types/core/export.d.ts +70 -0
- package/dist/types/core/fontawesome.d.ts +107 -0
- package/dist/types/core/format.d.ts +107 -0
- package/dist/types/core/http.d.ts +122 -0
- package/dist/types/core/i18n.d.ts +35 -0
- package/dist/types/core/icons.d.ts +137 -0
- package/dist/types/core/keyboard.d.ts +72 -0
- package/dist/types/core/position.d.ts +45 -0
- package/dist/types/core/storage.d.ts +46 -0
- package/dist/types/core/util.d.ts +117 -0
- package/dist/types/elements/define.d.ts +73 -0
- package/dist/types/elements/reflect.d.ts +27 -0
- package/dist/types/index.d.ts +79 -0
- package/dist/types/zeyos/connect.d.ts +65 -0
- package/dist/types/zeyos/form.d.ts +140 -0
- package/dist/types/zeyos/icons.d.ts +104 -0
- package/dist/types/zeyos/index.d.ts +12 -0
- package/dist/types/zeyos/modules.d.ts +110 -0
- package/dist/types/zeyos/query.d.ts +157 -0
- package/dist/types/zeyos/schema.d.ts +79 -0
- package/dist/types/zeyos/select.d.ts +167 -0
- package/dist/types/zeyos/table.d.ts +205 -0
- package/dist/zx-compat.esm.js +375 -39
- package/dist/zx-compat.esm.min.js +1 -1
- package/dist/zx-compat.global.js +372 -73
- package/dist/zx-compat.global.min.js +3 -3
- package/dist/zx-zeyos.esm.js +355 -49
- package/dist/zx-zeyos.esm.min.js +1 -1
- package/dist/zx.css +68 -6
- package/dist/zx.esm.js +359 -73
- package/dist/zx.esm.min.js +3 -3
- package/dist/zx.global.js +359 -73
- package/dist/zx.global.min.js +3 -3
- package/dist/zx.min.css +1 -1
- package/docs/api.json +48 -2
- package/docs/llms.md +31 -0
- package/package.json +37 -9
- package/src/compat/base.js +291 -0
- package/src/compat/globals.js +165 -0
- package/src/compat/index.js +84 -0
- package/src/compat/map/basic.js +464 -0
- package/src/compat/map/data.js +232 -0
- package/src/compat/map/date-time.js +177 -0
- package/src/compat/map/factory.js +45 -0
- package/src/compat/map/form.js +330 -0
- package/src/compat/map/helpers.js +46 -0
- package/src/compat/map/http.js +117 -0
- package/src/compat/map/layout.js +256 -0
- package/src/compat/map/options.js +267 -0
- package/src/compat/map/select.js +198 -0
- package/src/compat/map/stubs.js +26 -0
- package/src/compat/map/utilities.js +113 -0
- package/src/compat-entry.js +11 -0
- package/src/components/badge/badge.css +147 -0
- package/src/components/badge/badge.js +92 -0
- package/src/components/breadcrumb/breadcrumb.css +105 -0
- package/src/components/breadcrumb/breadcrumb.js +331 -0
- package/src/components/button/button.css +104 -0
- package/src/components/button/button.js +76 -0
- package/src/components/check-button/check-button.css +66 -0
- package/src/components/check-button/check-button.js +167 -0
- package/src/components/checklist/checklist.css +65 -0
- package/src/components/checklist/checklist.js +282 -0
- package/src/components/checklist/field-adapter.js +46 -0
- package/src/components/context-menu/context-menu.css +54 -0
- package/src/components/context-menu/context-menu.js +334 -0
- package/src/components/copy/copy-button.css +27 -0
- package/src/components/copy/copy-button.js +78 -0
- package/src/components/copy/copy-input.css +59 -0
- package/src/components/copy/copy-input.js +123 -0
- package/src/components/data-filter/data-filter.css +53 -0
- package/src/components/data-filter/data-filter.js +400 -0
- package/src/components/data-filter/filter-core.js +128 -0
- package/src/components/date-picker/date-picker.css +181 -0
- package/src/components/date-picker/date-picker.js +500 -0
- package/src/components/date-picker/date-range-picker.css +264 -0
- package/src/components/date-picker/date-range-picker.js +990 -0
- package/src/components/date-picker/field-adapter.js +36 -0
- package/src/components/date-picker/month-picker.js +223 -0
- package/src/components/date-picker/range-field-adapter.js +31 -0
- package/src/components/date-picker/time-picker.css +191 -0
- package/src/components/date-picker/time-picker.js +406 -0
- package/src/components/datebox/date-range-box.css +128 -0
- package/src/components/datebox/date-range-box.js +492 -0
- package/src/components/datebox/datebox.css +108 -0
- package/src/components/datebox/datebox.js +358 -0
- package/src/components/datebox/field-adapter.js +34 -0
- package/src/components/dialog/dialog.css +74 -0
- package/src/components/dialog/dialog.js +450 -0
- package/src/components/dropdown/dropdown.css +24 -0
- package/src/components/dropdown/dropdown.js +288 -0
- package/src/components/empty-state/empty-state.css +80 -0
- package/src/components/empty-state/empty-state.js +92 -0
- package/src/components/field/field.css +127 -0
- package/src/components/field/field.js +605 -0
- package/src/components/field-upload/field-adapter.js +21 -0
- package/src/components/field-upload/field-upload.css +108 -0
- package/src/components/field-upload/field-upload.js +475 -0
- package/src/components/fieldset/fieldset.css +37 -0
- package/src/components/fieldset/fieldset.js +307 -0
- package/src/components/finder/finder.css +98 -0
- package/src/components/finder/finder.js +509 -0
- package/src/components/form/form.css +32 -0
- package/src/components/form/form.js +302 -0
- package/src/components/groupbox/groupbox.css +51 -0
- package/src/components/groupbox/groupbox.js +199 -0
- package/src/components/layout/layout.css +117 -0
- package/src/components/layout/layout.js +136 -0
- package/src/components/loading/inline-loading.css +34 -0
- package/src/components/loading/inline-loading.js +140 -0
- package/src/components/loading/progress-bar.css +115 -0
- package/src/components/loading/progress-bar.js +259 -0
- package/src/components/loading/spinner.css +58 -0
- package/src/components/loading/spinner.js +57 -0
- package/src/components/master-panel/master-panel.css +51 -0
- package/src/components/master-panel/master-panel.js +203 -0
- package/src/components/menu-button/menu-button.css +49 -0
- package/src/components/menu-button/menu-button.js +294 -0
- package/src/components/message/message.css +122 -0
- package/src/components/message/message.js +499 -0
- package/src/components/modal/modal.css +47 -0
- package/src/components/modal/modal.js +203 -0
- package/src/components/multi-value-editor/field-adapter.js +44 -0
- package/src/components/multi-value-editor/multi-value-editor.css +56 -0
- package/src/components/multi-value-editor/multi-value-editor.js +170 -0
- package/src/components/navigation-bar/navigation-bar.css +130 -0
- package/src/components/navigation-bar/navigation-bar.js +450 -0
- package/src/components/number-field/field-adapter.js +40 -0
- package/src/components/number-field/number-field.css +77 -0
- package/src/components/number-field/number-field.js +545 -0
- package/src/components/pagination/pagination.css +95 -0
- package/src/components/pagination/pagination.js +481 -0
- package/src/components/panel/panel.css +123 -0
- package/src/components/panel/panel.js +336 -0
- package/src/components/permission/permission.css +47 -0
- package/src/components/permission/permission.js +198 -0
- package/src/components/rating/field-adapter.js +34 -0
- package/src/components/rating/rating.css +97 -0
- package/src/components/rating/rating.js +395 -0
- package/src/components/search/search.css +70 -0
- package/src/components/search/search.js +193 -0
- package/src/components/select/field-adapter.js +24 -0
- package/src/components/select/filter.js +39 -0
- package/src/components/select/select.css +180 -0
- package/src/components/select/select.js +663 -0
- package/src/components/skeleton/skeleton.css +76 -0
- package/src/components/skeleton/skeleton.js +139 -0
- package/src/components/slider/field-adapter.js +36 -0
- package/src/components/slider/slider.css +181 -0
- package/src/components/slider/slider.js +399 -0
- package/src/components/split-view/split-view.css +139 -0
- package/src/components/split-view/split-view.js +806 -0
- package/src/components/stepper/stepper.css +234 -0
- package/src/components/stepper/stepper.js +459 -0
- package/src/components/stepper/steps.js +131 -0
- package/src/components/tabbox/tabbox.css +281 -0
- package/src/components/tabbox/tabbox.js +484 -0
- package/src/components/table/sort.js +85 -0
- package/src/components/table/table.css +364 -0
- package/src/components/table/table.js +1711 -0
- package/src/components/tag-picker/field-adapter.js +35 -0
- package/src/components/tag-picker/tag-picker.css +169 -0
- package/src/components/tag-picker/tag-picker.js +837 -0
- package/src/components/timebox/field-adapter.js +24 -0
- package/src/components/timebox/timebox.css +51 -0
- package/src/components/timebox/timebox.js +276 -0
- package/src/components/toggle/field-adapter.js +24 -0
- package/src/components/toggle/toggle.css +66 -0
- package/src/components/toggle/toggle.js +150 -0
- package/src/components/toolbar/toolbar.css +81 -0
- package/src/components/toolbar/toolbar.js +511 -0
- package/src/components/tooltip/tooltip.css +36 -0
- package/src/components/tooltip/tooltip.js +420 -0
- package/src/components/tree/hierarchy.js +151 -0
- package/src/components/tree/tree.css +99 -0
- package/src/components/tree/tree.js +784 -0
- package/src/components/truncate/truncate.css +20 -0
- package/src/components/truncate/truncate.js +92 -0
- package/src/components/value-list/field-adapter.js +24 -0
- package/src/components/value-list/value-list.css +108 -0
- package/src/components/value-list/value-list.js +336 -0
- package/src/core/breakpoint.js +150 -0
- package/src/core/component.js +292 -0
- package/src/core/date.js +216 -0
- package/src/core/dom.js +260 -0
- package/src/core/export.js +204 -0
- package/src/core/fontawesome.js +177 -0
- package/src/core/format.js +283 -0
- package/src/core/http.js +246 -0
- package/src/core/i18n.js +83 -0
- package/src/core/icons.js +283 -0
- package/src/core/keyboard.js +240 -0
- package/src/core/position.js +177 -0
- package/src/core/storage.js +175 -0
- package/src/core/util.js +336 -0
- package/src/elements/define.js +715 -0
- package/src/elements/reflect.js +79 -0
- package/src/index.js +131 -0
- package/src/zeyos/connect.js +142 -0
- package/src/zeyos/form.js +254 -0
- package/src/zeyos/icons.js +92 -0
- package/src/zeyos/index.js +21 -0
- package/src/zeyos/modules.js +269 -0
- package/src/zeyos/query.js +199 -0
- package/src/zeyos/schema.js +474 -0
- package/src/zeyos/select.js +175 -0
- package/src/zeyos/table.js +272 -0
- package/styles/base.css +124 -0
- package/styles/icons.css +34 -0
- package/styles/tokens/dark.css +84 -0
- package/styles/tokens/density.css +9 -0
- package/styles/tokens/global.css +80 -0
- package/styles/tokens/modules.css +109 -0
- package/styles/tokens/semantic.css +49 -0
- package/styles/zx.css +61 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** @typedef {(key: string) => string|null|undefined} Translator */
|
|
2
|
+
export type Translator = (key: string) => string | null | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* Installs the host application's translation function, or clears it with null.
|
|
5
|
+
* @param {Translator|null} fn Translator function.
|
|
6
|
+
* @returns {void}
|
|
7
|
+
*/
|
|
8
|
+
export declare function setTranslator(fn: Translator | null): void;
|
|
9
|
+
/**
|
|
10
|
+
* Sets the active language identifier.
|
|
11
|
+
* @param {string} lang Language identifier such as "en" or "de-AT".
|
|
12
|
+
* @returns {void}
|
|
13
|
+
*/
|
|
14
|
+
export declare function setLanguage(lang: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the active language identifier.
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
export declare function getLanguage(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Translates a key through the injected host translator and interpolates arguments.
|
|
22
|
+
* @param {string} key Translation key.
|
|
23
|
+
* @param {unknown[]|Record<string, unknown>|string|number} [args] Interpolation arguments.
|
|
24
|
+
* @returns {string}
|
|
25
|
+
*/
|
|
26
|
+
export declare function translate(key: string, args?: unknown[] | Record<string, unknown> | string | number): string;
|
|
27
|
+
/**
|
|
28
|
+
* Replaces one-based numeric placeholders and legacy percent-delimited placeholders.
|
|
29
|
+
* Arrays replace `%1`, `%2`, and legacy placeholders in encounter order; objects replace
|
|
30
|
+
* named placeholders such as `%name%`.
|
|
31
|
+
* @param {string} str Template string.
|
|
32
|
+
* @param {unknown[]|Record<string, unknown>|string|number} [args] Replacement values.
|
|
33
|
+
* @returns {string}
|
|
34
|
+
*/
|
|
35
|
+
export declare function printf(str: string, args?: unknown[] | Record<string, unknown> | string | number): string;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The icon layer. Two renderers sit behind one `icon()` call:
|
|
3
|
+
*
|
|
4
|
+
* - **built-in** (default) — the inline SVG glyphs below, no network, no stylesheet, no font.
|
|
5
|
+
* - **Font Awesome** — `<i>` elements carrying Font Awesome classes, after an application opts in
|
|
6
|
+
* with `useFontAwesome()` or `loadFontAwesome(kit)`. Zx never loads a kit by itself.
|
|
7
|
+
*
|
|
8
|
+
* Both renderers put `zx-icon` on the element, so component CSS can style either.
|
|
9
|
+
* @module zx/core/icons
|
|
10
|
+
*/
|
|
11
|
+
export type IconOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* Rendered width and height.
|
|
14
|
+
*/
|
|
15
|
+
size?: number | string;
|
|
16
|
+
/**
|
|
17
|
+
* Accessible label; null marks the icon decorative.
|
|
18
|
+
*/
|
|
19
|
+
label?: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Extra class names added to the element.
|
|
22
|
+
*/
|
|
23
|
+
class?: string | string[];
|
|
24
|
+
/**
|
|
25
|
+
* Font Awesome style for this icon only (`'solid'`, `'duotone'`, …).
|
|
26
|
+
*/
|
|
27
|
+
style?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Font Awesome family for this icon only (`'classic'`, `'sharp'`, …).
|
|
30
|
+
*/
|
|
31
|
+
family?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Adds Font Awesome's `fa-fw` for column-aligned glyphs.
|
|
34
|
+
*/
|
|
35
|
+
fixedWidth?: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @typedef {Object} IconOptions
|
|
39
|
+
* @property {number|string} [size=16] Rendered width and height.
|
|
40
|
+
* @property {string|null} [label=null] Accessible label; null marks the icon decorative.
|
|
41
|
+
* @property {string|string[]} [class] Extra class names added to the element.
|
|
42
|
+
* @property {string} [style] Font Awesome style for this icon only (`'solid'`, `'duotone'`, …).
|
|
43
|
+
* @property {string} [family] Font Awesome family for this icon only (`'classic'`, `'sharp'`, …).
|
|
44
|
+
* @property {boolean} [fixedWidth] Adds Font Awesome's `fa-fw` for column-aligned glyphs.
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Icon glyphs from Font Awesome Free 6 (solid, plus `square` from regular), fontawesome.com,
|
|
48
|
+
* licensed CC BY 4.0 (https://fontawesome.com/license/free). Path data is embedded unmodified so
|
|
49
|
+
* the library carries no webfont, stylesheet, or package dependency. Each entry is
|
|
50
|
+
* `[viewBox, path]`; Font Awesome glyphs are filled (not stroked) and use per-glyph 512-unit view
|
|
51
|
+
* boxes — outlines such as `square` are a filled path with a counter-wound hole.
|
|
52
|
+
* Extend the set with `registerIcons()`; read every available name with `iconNames()`.
|
|
53
|
+
* @type {Readonly<Record<string, [string, string]>>}
|
|
54
|
+
*/
|
|
55
|
+
export declare const icons: Readonly<Record<string, [string, string]>>;
|
|
56
|
+
export type IconConfig = {
|
|
57
|
+
/**
|
|
58
|
+
* Renderer used for bare icon names.
|
|
59
|
+
*/
|
|
60
|
+
provider: 'builtin' | 'fontawesome';
|
|
61
|
+
/**
|
|
62
|
+
* Default Font Awesome style (`'solid'`, `'regular'`, `'duotone'`, …).
|
|
63
|
+
*/
|
|
64
|
+
style: string;
|
|
65
|
+
/**
|
|
66
|
+
* Default Font Awesome family (`'classic'`, `'sharp'`, …).
|
|
67
|
+
*/
|
|
68
|
+
family: string;
|
|
69
|
+
/**
|
|
70
|
+
* Whether Font Awesome icons get `fa-fw` by default.
|
|
71
|
+
*/
|
|
72
|
+
fixedWidth: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Kit token or URL passed to the last `loadFontAwesome()` call.
|
|
75
|
+
*/
|
|
76
|
+
kit: string | null;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Reads the active icon configuration.
|
|
80
|
+
* @returns {IconConfig} A copy — mutating it does not change the configuration.
|
|
81
|
+
*/
|
|
82
|
+
export declare function getIconConfig(): IconConfig;
|
|
83
|
+
/**
|
|
84
|
+
* Sets how bare icon names are rendered. Explicitly prefixed names (`'fa:user'`,
|
|
85
|
+
* `'builtin:check'`) and literal class lists (`'fa-solid fa-user'`) always ignore this.
|
|
86
|
+
* @param {Partial<IconConfig>} options Values to change.
|
|
87
|
+
* @returns {IconConfig} The configuration after the change.
|
|
88
|
+
*/
|
|
89
|
+
export declare function configureIcons(options?: Partial<IconConfig>): IconConfig;
|
|
90
|
+
/**
|
|
91
|
+
* Switches bare icon names to Font Awesome. Use this when the kit, or a self-hosted Font Awesome
|
|
92
|
+
* stylesheet, is already on the page; use `loadFontAwesome()` to inject a kit as well.
|
|
93
|
+
* @param {Partial<Omit<IconConfig, 'provider'>>} [options={}] Default style, family, modifiers.
|
|
94
|
+
* @returns {IconConfig} The configuration after the change.
|
|
95
|
+
*/
|
|
96
|
+
export declare function useFontAwesome(options?: Partial<Omit<IconConfig, 'provider'>>): IconConfig;
|
|
97
|
+
/**
|
|
98
|
+
* Switches bare icon names back to the inline SVG glyphs bundled with Zx.
|
|
99
|
+
* @returns {IconConfig} The configuration after the change.
|
|
100
|
+
*/
|
|
101
|
+
export declare function useBuiltinIcons(): IconConfig;
|
|
102
|
+
/**
|
|
103
|
+
* Loads a Font Awesome kit and renders bare icon names with it. The script is injected once per
|
|
104
|
+
* URL; a kit the page already embeds is adopted instead of loaded again.
|
|
105
|
+
* @param {string|(Partial<Omit<IconConfig, 'provider'>> & {kit: string, activate?: boolean})} options
|
|
106
|
+
* Kit token/URL, or an options object naming one.
|
|
107
|
+
* @returns {Promise<IconConfig>} Resolves with the configuration once the kit has loaded.
|
|
108
|
+
*/
|
|
109
|
+
export declare function loadFontAwesome(options: string | (Partial<Omit<IconConfig, 'provider'>> & {
|
|
110
|
+
kit: string;
|
|
111
|
+
activate?: boolean;
|
|
112
|
+
})): Promise<IconConfig>;
|
|
113
|
+
/**
|
|
114
|
+
* Adds inline SVG glyphs to the built-in set, or replaces existing ones. Entries use the same
|
|
115
|
+
* `[viewBox, path]` shape as `icons`.
|
|
116
|
+
* @param {Record<string, [string, string]>} glyphs Glyphs keyed by icon name.
|
|
117
|
+
* @returns {void}
|
|
118
|
+
*/
|
|
119
|
+
export declare function registerIcons(glyphs: Record<string, [string, string]>): void;
|
|
120
|
+
/**
|
|
121
|
+
* Lists every inline SVG glyph name available, built-in and registered.
|
|
122
|
+
* @returns {string[]} Sorted icon names.
|
|
123
|
+
*/
|
|
124
|
+
export declare function iconNames(): string[];
|
|
125
|
+
/**
|
|
126
|
+
* Creates an icon element.
|
|
127
|
+
*
|
|
128
|
+
* Bare names (`'check'`) render through the active provider: the bundled inline SVG set by
|
|
129
|
+
* default, or Font Awesome after `useFontAwesome()` / `loadFontAwesome()`. A name can also select
|
|
130
|
+
* its renderer itself — `'fa:user'`, `'duotone:user'`, `'kit:zeyos-notes'`, `'builtin:check'`, or
|
|
131
|
+
* a literal Font Awesome class list such as `'fa-solid fa-user'`.
|
|
132
|
+
*
|
|
133
|
+
* @param {string} name Icon name or spec.
|
|
134
|
+
* @param {IconOptions} [options={}] Display and accessibility options.
|
|
135
|
+
* @returns {SVGSVGElement|HTMLElement} An `<svg>` for inline glyphs, an `<i>` for Font Awesome.
|
|
136
|
+
*/
|
|
137
|
+
export declare function icon(name: string, options?: IconOptions): SVGSVGElement | HTMLElement;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export type RovingOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* Arrow-key axis.
|
|
4
|
+
*/
|
|
5
|
+
orientation?: 'vertical' | 'horizontal';
|
|
6
|
+
/**
|
|
7
|
+
* Whether navigation wraps at either end.
|
|
8
|
+
*/
|
|
9
|
+
wrap?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type FocusTrapController = {
|
|
12
|
+
/**
|
|
13
|
+
* Activate the focus trap.
|
|
14
|
+
*/
|
|
15
|
+
activate: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Deactivate the focus trap and restore focus.
|
|
18
|
+
*/
|
|
19
|
+
deactivate: () => void;
|
|
20
|
+
};
|
|
21
|
+
export type RovingController = {
|
|
22
|
+
/**
|
|
23
|
+
* Focus the first item.
|
|
24
|
+
*/
|
|
25
|
+
focusFirst: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Focus the last item.
|
|
28
|
+
*/
|
|
29
|
+
focusLast: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Remove behavior and restore tabindex values.
|
|
32
|
+
*/
|
|
33
|
+
destroy: () => void;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* @typedef {Object} RovingOptions
|
|
37
|
+
* @property {'vertical'|'horizontal'} [orientation='vertical'] Arrow-key axis.
|
|
38
|
+
* @property {boolean} [wrap=true] Whether navigation wraps at either end.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* @typedef {Object} FocusTrapController
|
|
42
|
+
* @property {() => void} activate Activate the focus trap.
|
|
43
|
+
* @property {() => void} deactivate Deactivate the focus trap and restore focus.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* @typedef {Object} RovingController
|
|
47
|
+
* @property {() => void} focusFirst Focus the first item.
|
|
48
|
+
* @property {() => void} focusLast Focus the last item.
|
|
49
|
+
* @property {() => void} destroy Remove behavior and restore tabindex values.
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* Creates a focus trap that cycles Tab focus within a container while active.
|
|
53
|
+
* @param {Element} container Focus boundary.
|
|
54
|
+
* @returns {FocusTrapController}
|
|
55
|
+
*/
|
|
56
|
+
export declare function focusTrap(container: Element): FocusTrapController;
|
|
57
|
+
/**
|
|
58
|
+
* Applies the ARIA roving-tabindex keyboard pattern to matching descendants.
|
|
59
|
+
* @param {Element} container Event and query container.
|
|
60
|
+
* @param {string} itemSelector Selector for roving items.
|
|
61
|
+
* @param {RovingOptions} [options={}] Behavior options.
|
|
62
|
+
* @returns {RovingController}
|
|
63
|
+
*/
|
|
64
|
+
export declare function rovingTabindex(container: Element, itemSelector: string, { orientation, wrap }?: RovingOptions): RovingController;
|
|
65
|
+
/**
|
|
66
|
+
* Creates a 500 ms buffered, case-insensitive first-letter typeahead handler.
|
|
67
|
+
* @template T
|
|
68
|
+
* @param {() => T[]} getItems Returns current candidate items.
|
|
69
|
+
* @param {(item: T, index: number) => void} onMatch Called for the first prefix match.
|
|
70
|
+
* @returns {(event: KeyboardEvent|string) => void}
|
|
71
|
+
*/
|
|
72
|
+
export declare function typeahead<T>(getItems: () => T[], onMatch: (item: T, index: number) => void): (event: KeyboardEvent | string) => void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type PositionOptions = {
|
|
2
|
+
placement?: 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end' | 'bottom' | 'top';
|
|
3
|
+
/**
|
|
4
|
+
* Gap between anchor and floating element.
|
|
5
|
+
*/
|
|
6
|
+
offset?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Flip vertically when the preferred side overflows.
|
|
9
|
+
*/
|
|
10
|
+
flip?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Set the floating element's minimum width to the anchor width.
|
|
13
|
+
*/
|
|
14
|
+
matchWidth?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type PositionController = {
|
|
17
|
+
/**
|
|
18
|
+
* Recompute coordinates and matched width.
|
|
19
|
+
*/
|
|
20
|
+
update: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Hide and clean up positioning resources.
|
|
23
|
+
*/
|
|
24
|
+
destroy: () => void;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {Object} PositionOptions
|
|
28
|
+
* @property {'bottom-start'|'bottom-end'|'top-start'|'top-end'|'bottom'|'top'} [placement='bottom-start']
|
|
29
|
+
* @property {number} [offset=4] Gap between anchor and floating element.
|
|
30
|
+
* @property {boolean} [flip=true] Flip vertically when the preferred side overflows.
|
|
31
|
+
* @property {boolean} [matchWidth=false] Set the floating element's minimum width to the anchor width.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* @typedef {Object} PositionController
|
|
35
|
+
* @property {() => void} update Recompute coordinates and matched width.
|
|
36
|
+
* @property {() => void} destroy Hide and clean up positioning resources.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Anchors and opens a manual popover, using CSS anchor positioning when available.
|
|
40
|
+
* @param {Element} anchor Anchor element.
|
|
41
|
+
* @param {HTMLElement} floating Floating popover element.
|
|
42
|
+
* @param {PositionOptions} [options={}] Positioning behavior.
|
|
43
|
+
* @returns {PositionController}
|
|
44
|
+
*/
|
|
45
|
+
export declare function position(anchor: Element, floating: HTMLElement, options?: PositionOptions): PositionController;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} StorageOptions
|
|
3
|
+
* @property {'local'|'session'} [area='local'] Backing Web Storage area.
|
|
4
|
+
*/
|
|
5
|
+
export type StorageOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* Backing Web Storage area.
|
|
8
|
+
*/
|
|
9
|
+
area?: 'local' | 'session';
|
|
10
|
+
};
|
|
11
|
+
export type NamespacedStorage = {
|
|
12
|
+
/**
|
|
13
|
+
* Reads and decodes a value.
|
|
14
|
+
*/
|
|
15
|
+
get: (key: string, fallback?: any) => any;
|
|
16
|
+
/**
|
|
17
|
+
* Encodes and writes a value.
|
|
18
|
+
*/
|
|
19
|
+
set: (key: string, value: unknown) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Deletes a single key.
|
|
22
|
+
*/
|
|
23
|
+
remove: (key: string) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Lists the namespace's keys without their prefix.
|
|
26
|
+
*/
|
|
27
|
+
keys: () => string[];
|
|
28
|
+
/**
|
|
29
|
+
* Deletes every key in the namespace, leaving other namespaces alone.
|
|
30
|
+
*/
|
|
31
|
+
clear: () => void;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Creates a namespaced, JSON-encoded view of `localStorage` or `sessionStorage`.
|
|
35
|
+
*
|
|
36
|
+
* Every key is stored as `zx:<namespace>:<key>`, so several features can share one origin without
|
|
37
|
+
* colliding, and `clear()` only touches the namespace it belongs to. When the storage area is
|
|
38
|
+
* unavailable or refuses a write — private browsing, a full quota, cookies disabled — the view
|
|
39
|
+
* transparently falls back to an in-memory map that lives as long as the page, so callers never
|
|
40
|
+
* need a try/catch and never see an exception.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} namespace Namespace segment, typically an application or feature name.
|
|
43
|
+
* @param {StorageOptions} [options={}] Area selection.
|
|
44
|
+
* @returns {NamespacedStorage}
|
|
45
|
+
*/
|
|
46
|
+
export declare function storage(namespace: string, options?: StorageOptions): NamespacedStorage;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a debounced wrapper that runs after calls have stopped for the delay.
|
|
3
|
+
* @template {(...args: any[]) => any} T
|
|
4
|
+
* @param {T} fn Function to debounce.
|
|
5
|
+
* @param {number} ms Delay in milliseconds.
|
|
6
|
+
* @returns {(...args: Parameters<T>) => void}
|
|
7
|
+
*/
|
|
8
|
+
export declare function debounce<T extends (...args: any[]) => any>(fn: T, ms: number): (...args: Parameters<T>) => void;
|
|
9
|
+
export type ThrottleOptions = {
|
|
10
|
+
/**
|
|
11
|
+
* Whether the first call in a window runs immediately.
|
|
12
|
+
*/
|
|
13
|
+
leading?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether a call made during a window runs when it closes.
|
|
16
|
+
*/
|
|
17
|
+
trailing?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {Object} ThrottleOptions
|
|
21
|
+
* @property {boolean} [leading=true] Whether the first call in a window runs immediately.
|
|
22
|
+
* @property {boolean} [trailing=true] Whether a call made during a window runs when it closes.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Returns a throttled wrapper that runs at most once per interval, on the leading edge, the
|
|
26
|
+
* trailing edge, or both. The trailing call replays the most recent arguments and context.
|
|
27
|
+
* @template {(...args: any[]) => any} T
|
|
28
|
+
* @param {T} fn Function to throttle.
|
|
29
|
+
* @param {number} ms Interval in milliseconds.
|
|
30
|
+
* @param {ThrottleOptions} [options={}] Edge behaviour.
|
|
31
|
+
* @returns {(...args: Parameters<T>) => void}
|
|
32
|
+
*/
|
|
33
|
+
export declare function throttle<T extends (...args: any[]) => any>(fn: T, ms: number, { leading, trailing }?: ThrottleOptions): (...args: Parameters<T>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a process-unique identifier suitable for DOM IDs and CSS names.
|
|
36
|
+
* @param {string} [prefix='zx'] Identifier prefix.
|
|
37
|
+
* @returns {string}
|
|
38
|
+
*/
|
|
39
|
+
export declare function uid(prefix?: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Recursively merges plain objects without mutating either input.
|
|
42
|
+
* Arrays and other values are replaced rather than merged.
|
|
43
|
+
* @template T
|
|
44
|
+
* @template U
|
|
45
|
+
* @param {T} a Base value.
|
|
46
|
+
* @param {U} b Overriding value.
|
|
47
|
+
* @returns {T & U}
|
|
48
|
+
*/
|
|
49
|
+
export declare function deepMerge<T, U>(a: T, b: U): T & U;
|
|
50
|
+
/**
|
|
51
|
+
* Reports whether a value is a DOM Element, including elements from another realm.
|
|
52
|
+
* @param {unknown} value Value to inspect.
|
|
53
|
+
* @returns {value is Element}
|
|
54
|
+
*/
|
|
55
|
+
export declare function isElement(value: unknown): value is Element;
|
|
56
|
+
/**
|
|
57
|
+
* Restricts a number to an inclusive range.
|
|
58
|
+
* @param {number} n Value to restrict.
|
|
59
|
+
* @param {number} min Minimum value.
|
|
60
|
+
* @param {number} max Maximum value.
|
|
61
|
+
* @returns {number}
|
|
62
|
+
*/
|
|
63
|
+
export declare function clamp(n: number, min: number, max: number): number;
|
|
64
|
+
/**
|
|
65
|
+
* Normalizes a nullable, scalar, iterable, or array value to a new array.
|
|
66
|
+
* @template T
|
|
67
|
+
* @param {T|Iterable<T>|ArrayLike<T>|null|undefined} value Value to normalize.
|
|
68
|
+
* @returns {T[]}
|
|
69
|
+
*/
|
|
70
|
+
export declare function toArray<T>(value: T | Iterable<T> | ArrayLike<T> | null | undefined): T[];
|
|
71
|
+
export type KeySelector<T> = string | ((item: T) => unknown);
|
|
72
|
+
export type SortKey<T> = KeySelector<T> | {
|
|
73
|
+
key: KeySelector<T>;
|
|
74
|
+
dir?: 'asc' | 'desc';
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* @template T
|
|
78
|
+
* @typedef {string|((item: T) => unknown)} KeySelector A property name or an accessor function.
|
|
79
|
+
*/
|
|
80
|
+
/**
|
|
81
|
+
* @template T
|
|
82
|
+
* @typedef {KeySelector<T>|{key: KeySelector<T>, dir?: 'asc'|'desc'}} SortKey
|
|
83
|
+
* A property name (prefix with `-` to sort descending), an accessor, or an explicit direction.
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* Groups items into a plain object of arrays, keyed by a property or accessor and ordered by first
|
|
87
|
+
* appearance.
|
|
88
|
+
* @template T
|
|
89
|
+
* @param {Iterable<T>|ArrayLike<T>|null|undefined} items Items to group.
|
|
90
|
+
* @param {KeySelector<T>} key Property name or accessor returning the group key.
|
|
91
|
+
* @returns {Record<string, T[]>}
|
|
92
|
+
*/
|
|
93
|
+
export declare function groupBy<T>(items: Iterable<T> | ArrayLike<T> | null | undefined, key: KeySelector<T>): Record<string, T[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Sorts items by one or more keys into a NEW array, leaving the input untouched. Strings compare
|
|
96
|
+
* with `localeCompare` (digit runs compare numerically), numbers, booleans, and dates compare by
|
|
97
|
+
* value, and null, undefined, and NaN always sort last regardless of direction.
|
|
98
|
+
* @template T
|
|
99
|
+
* @param {Iterable<T>|ArrayLike<T>|null|undefined} items Items to sort.
|
|
100
|
+
* @param {...SortKey<T>} keys Sort keys applied in order.
|
|
101
|
+
* @returns {T[]}
|
|
102
|
+
*/
|
|
103
|
+
export declare function sortBy<T>(items: Iterable<T> | ArrayLike<T> | null | undefined, ...keys: SortKey<T>[]): T[];
|
|
104
|
+
/**
|
|
105
|
+
* Removes duplicates, keeping the first occurrence, and returns a new array.
|
|
106
|
+
* @template T
|
|
107
|
+
* @param {Iterable<T>|ArrayLike<T>|null|undefined} items Items to filter.
|
|
108
|
+
* @param {KeySelector<T>} [key] Property name or accessor; the item itself when omitted.
|
|
109
|
+
* @returns {T[]}
|
|
110
|
+
*/
|
|
111
|
+
export declare function uniqueBy<T>(items: Iterable<T> | ArrayLike<T> | null | undefined, key?: KeySelector<T>): T[];
|
|
112
|
+
/**
|
|
113
|
+
* Escapes regular-expression metacharacters so a value can be used as a literal pattern.
|
|
114
|
+
* @param {unknown} value Value to escape.
|
|
115
|
+
* @returns {string}
|
|
116
|
+
*/
|
|
117
|
+
export declare function escapeRegExp(value: unknown): string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { INVALID_ATTRIBUTE } from './reflect.js';
|
|
2
|
+
export type AttributeType = 'string' | 'number' | 'boolean' | 'json';
|
|
3
|
+
export type ElementAttribute = {
|
|
4
|
+
/**
|
|
5
|
+
* Attribute representation.
|
|
6
|
+
*/
|
|
7
|
+
type?: AttributeType;
|
|
8
|
+
/**
|
|
9
|
+
* Component option name; null keeps the value on the host only.
|
|
10
|
+
*/
|
|
11
|
+
option?: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Host property name; defaults to camel-cased attribute name.
|
|
14
|
+
*/
|
|
15
|
+
property?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Property value used while the attribute is absent.
|
|
18
|
+
*/
|
|
19
|
+
default?: unknown;
|
|
20
|
+
/**
|
|
21
|
+
* Pass the default to the component during initial creation.
|
|
22
|
+
*/
|
|
23
|
+
always?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Recreate the component when this value changes.
|
|
26
|
+
*/
|
|
27
|
+
rebuild?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Value adapter.
|
|
30
|
+
*/
|
|
31
|
+
normalize?: (value: unknown, host: HTMLElement) => unknown;
|
|
32
|
+
/**
|
|
33
|
+
* Property serializer override.
|
|
34
|
+
*/
|
|
35
|
+
serialize?: (value: unknown, host: HTMLElement) => string | null | typeof INVALID_ATTRIBUTE;
|
|
36
|
+
/**
|
|
37
|
+
* Live component setter.
|
|
38
|
+
*/
|
|
39
|
+
set?: (component: InstanceType<typeof import('../core/component.js').Component>, value: any, host: HTMLElement) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Live component getter.
|
|
42
|
+
*/
|
|
43
|
+
get?: (component: InstanceType<typeof import('../core/component.js').Component>, host: HTMLElement) => unknown;
|
|
44
|
+
};
|
|
45
|
+
export type ElementAttributeMap = Record<string, AttributeType | ElementAttribute>;
|
|
46
|
+
export type ElementWrapperOptions = {
|
|
47
|
+
/**
|
|
48
|
+
* Whether the element participates in native forms.
|
|
49
|
+
*/
|
|
50
|
+
formAssociated?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Reflected attribute definitions.
|
|
53
|
+
*/
|
|
54
|
+
attrs?: ElementAttributeMap;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Creates a light-DOM custom-element class backed by a Zx component.
|
|
58
|
+
* Groupbox and Dialog wrappers adopt their host's initial children as component content;
|
|
59
|
+
* other wrappers leave unrelated host children untouched and append their component root.
|
|
60
|
+
*
|
|
61
|
+
* @param {typeof import('../core/component.js').Component} ComponentClass Component constructor.
|
|
62
|
+
* @param {ElementWrapperOptions} [wrapperOptions={}] Wrapper behavior.
|
|
63
|
+
* @returns {typeof HTMLElement} Custom-element constructor.
|
|
64
|
+
*/
|
|
65
|
+
export declare function elementFor(ComponentClass: typeof import('../core/component.js').Component, { formAssociated, attrs }?: ElementWrapperOptions): typeof HTMLElement;
|
|
66
|
+
/**
|
|
67
|
+
* Registers the supported Zx custom elements. Repeated calls and pre-registered names are safe.
|
|
68
|
+
* This function is deliberately not called by the module.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} [prefix='zx'] Custom-element name prefix.
|
|
71
|
+
* @returns {void}
|
|
72
|
+
*/
|
|
73
|
+
export declare function defineElements(prefix?: string): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attribute value types supported by the custom-element wrappers.
|
|
3
|
+
* @typedef {'string'|'number'|'boolean'|'json'} AttributeType
|
|
4
|
+
*/
|
|
5
|
+
export type AttributeType = 'string' | 'number' | 'boolean' | 'json';
|
|
6
|
+
/** Sentinel returned when an attribute value cannot be safely applied. */
|
|
7
|
+
export declare const INVALID_ATTRIBUTE: unique symbol;
|
|
8
|
+
/**
|
|
9
|
+
* Coerces a serialized attribute into a component option value.
|
|
10
|
+
* Missing boolean attributes are false; other missing attributes are undefined.
|
|
11
|
+
*
|
|
12
|
+
* @param {string|null} value Attribute text, or null when the attribute is absent.
|
|
13
|
+
* @param {AttributeType} [type='string'] Requested option type.
|
|
14
|
+
* @param {(message: string) => void} [warn=console.warn] Invalid-value reporter.
|
|
15
|
+
* @returns {string|number|boolean|unknown|undefined|typeof INVALID_ATTRIBUTE}
|
|
16
|
+
*/
|
|
17
|
+
export declare function coerceAttribute(value: string | null, type?: AttributeType, warn?: (message: string) => void): string | number | boolean | unknown | undefined | typeof INVALID_ATTRIBUTE;
|
|
18
|
+
/**
|
|
19
|
+
* Serializes a property value for attribute reflection.
|
|
20
|
+
* A null return value means the corresponding attribute should be removed.
|
|
21
|
+
*
|
|
22
|
+
* @param {unknown} value Property value.
|
|
23
|
+
* @param {AttributeType} [type='string'] Attribute representation.
|
|
24
|
+
* @param {(message: string) => void} [warn=console.warn] Invalid-value reporter.
|
|
25
|
+
* @returns {string|null|typeof INVALID_ATTRIBUTE}
|
|
26
|
+
*/
|
|
27
|
+
export declare function serializeAttribute(value: unknown, type?: AttributeType, warn?: (message: string) => void): string | null | typeof INVALID_ATTRIBUTE;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zx public API.
|
|
3
|
+
* @module zx
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Registers every component-backed Field adapter. Calling this function repeatedly is safe.
|
|
7
|
+
* @returns {void}
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerFieldAdapters(): void;
|
|
10
|
+
export { Component } from './core/component.js';
|
|
11
|
+
export { h, htmlEscape, resolveElement, highlightMatch } from './core/dom.js';
|
|
12
|
+
export { position } from './core/position.js';
|
|
13
|
+
export { breakpoints, breakpointOf, matchBreakpoint, onBreakpoint } from './core/breakpoint.js';
|
|
14
|
+
export { Http, zeyosService, parseResult } from './core/http.js';
|
|
15
|
+
export { setTranslator, setLanguage, getLanguage, translate, printf } from './core/i18n.js';
|
|
16
|
+
export { focusTrap, rovingTabindex, typeahead } from './core/keyboard.js';
|
|
17
|
+
export { formatDate, parseDate, clampDate, isSameDay, addDays, addMonths, getWeekStart } from './core/date.js';
|
|
18
|
+
export { icon, icons, iconNames, registerIcons, configureIcons, getIconConfig, useFontAwesome, useBuiltinIcons, loadFontAwesome } from './core/icons.js';
|
|
19
|
+
export { faStyles, faFamilies, faNames, faIconClasses, parseIconSpec, kitUrl, loadFontAwesomeKit } from './core/fontawesome.js';
|
|
20
|
+
export { debounce, throttle, uid, deepMerge, isElement, clamp, toArray, groupBy, sortBy, uniqueBy, escapeRegExp } from './core/util.js';
|
|
21
|
+
export { formatNumber, formatCurrency, formatPercent, formatFileSize, formatRelativeTime } from './core/format.js';
|
|
22
|
+
export { storage } from './core/storage.js';
|
|
23
|
+
export { toCsv, downloadBlob, copyToClipboard } from './core/export.js';
|
|
24
|
+
export { defineElements } from './elements/define.js';
|
|
25
|
+
export { button, buttonGroup } from './components/button/button.js';
|
|
26
|
+
export { badge, badgeGroup } from './components/badge/badge.js';
|
|
27
|
+
export { CheckButton } from './components/check-button/check-button.js';
|
|
28
|
+
export { emptyState } from './components/empty-state/empty-state.js';
|
|
29
|
+
export { spinner } from './components/loading/spinner.js';
|
|
30
|
+
export { ProgressBar } from './components/loading/progress-bar.js';
|
|
31
|
+
export { InlineLoading } from './components/loading/inline-loading.js';
|
|
32
|
+
export { skeleton, skeletonText, skeletonTable } from './components/skeleton/skeleton.js';
|
|
33
|
+
export { stack, grid, aspect } from './components/layout/layout.js';
|
|
34
|
+
export { truncate, isTruncated } from './components/truncate/truncate.js';
|
|
35
|
+
export { copyButton } from './components/copy/copy-button.js';
|
|
36
|
+
export { CopyInput } from './components/copy/copy-input.js';
|
|
37
|
+
export { Toolbar } from './components/toolbar/toolbar.js';
|
|
38
|
+
export { Toggle } from './components/toggle/toggle.js';
|
|
39
|
+
export { Groupbox } from './components/groupbox/groupbox.js';
|
|
40
|
+
export { Panel } from './components/panel/panel.js';
|
|
41
|
+
export { MasterPanel } from './components/master-panel/master-panel.js';
|
|
42
|
+
export { SplitView, clampSize, resolveSize, snapSize } from './components/split-view/split-view.js';
|
|
43
|
+
export { Tabbox } from './components/tabbox/tabbox.js';
|
|
44
|
+
export { NavigationBar } from './components/navigation-bar/navigation-bar.js';
|
|
45
|
+
export { Stepper } from './components/stepper/stepper.js';
|
|
46
|
+
export { Breadcrumb } from './components/breadcrumb/breadcrumb.js';
|
|
47
|
+
export { Pagination, paginationRange } from './components/pagination/pagination.js';
|
|
48
|
+
export { Search } from './components/search/search.js';
|
|
49
|
+
export { Message } from './components/message/message.js';
|
|
50
|
+
export { Modal } from './components/modal/modal.js';
|
|
51
|
+
export { Dialog } from './components/dialog/dialog.js';
|
|
52
|
+
export { Dropdown } from './components/dropdown/dropdown.js';
|
|
53
|
+
export { Tooltip, tooltip, describe } from './components/tooltip/tooltip.js';
|
|
54
|
+
export { MenuButton } from './components/menu-button/menu-button.js';
|
|
55
|
+
export { ContextMenu } from './components/context-menu/context-menu.js';
|
|
56
|
+
export { Select } from './components/select/select.js';
|
|
57
|
+
export { Checklist } from './components/checklist/checklist.js';
|
|
58
|
+
export { TagPicker } from './components/tag-picker/tag-picker.js';
|
|
59
|
+
export { NumberField, parseNumber, snapNumber } from './components/number-field/number-field.js';
|
|
60
|
+
export { Rating } from './components/rating/rating.js';
|
|
61
|
+
export { Slider, stepPrecision } from './components/slider/slider.js';
|
|
62
|
+
export { Permission } from './components/permission/permission.js';
|
|
63
|
+
export { DatePicker } from './components/date-picker/date-picker.js';
|
|
64
|
+
export { MonthPicker } from './components/date-picker/month-picker.js';
|
|
65
|
+
export { TimePicker } from './components/date-picker/time-picker.js';
|
|
66
|
+
export { Datebox, DateTimeBox } from './components/datebox/datebox.js';
|
|
67
|
+
export { DateRangePicker, clampRange, defaultDateRangePresets, normalizeRange, rangeNights, rangeStateOf } from './components/date-picker/date-range-picker.js';
|
|
68
|
+
export { DateRangeBox, formatRangeText, parseRangeText } from './components/datebox/date-range-box.js';
|
|
69
|
+
export { Timebox, splitTime, joinTime } from './components/timebox/timebox.js';
|
|
70
|
+
export { Table } from './components/table/table.js';
|
|
71
|
+
export { TreeView } from './components/tree/tree.js';
|
|
72
|
+
export { Finder } from './components/finder/finder.js';
|
|
73
|
+
export { DataFilter } from './components/data-filter/data-filter.js';
|
|
74
|
+
export { Field } from './components/field/field.js';
|
|
75
|
+
export { Fieldset } from './components/fieldset/fieldset.js';
|
|
76
|
+
export { Form } from './components/form/form.js';
|
|
77
|
+
export { ValueList } from './components/value-list/value-list.js';
|
|
78
|
+
export { MultiValueEditor } from './components/multi-value-editor/multi-value-editor.js';
|
|
79
|
+
export { FieldUpload } from './components/field-upload/field-upload.js';
|