domma-js 0.56.0 → 0.58.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 (121) hide show
  1. package/README.md +2 -2
  2. package/assets/types/generated/public/assets/flags/africa.d.ts +6 -0
  3. package/assets/types/generated/public/assets/flags/americas.d.ts +6 -0
  4. package/assets/types/generated/public/assets/flags/asia.d.ts +6 -0
  5. package/assets/types/generated/public/assets/flags/europe.d.ts +9 -0
  6. package/assets/types/generated/public/assets/flags/index.d.ts +11 -0
  7. package/assets/types/generated/public/assets/flags/oceania.d.ts +2 -0
  8. package/assets/types/generated/public/assets/icons/buildings.d.ts +6 -0
  9. package/assets/types/generated/public/assets/icons/code.d.ts +2 -0
  10. package/assets/types/generated/public/assets/icons/commerce.d.ts +7 -0
  11. package/assets/types/generated/public/assets/icons/communication.d.ts +7 -0
  12. package/assets/types/generated/public/assets/icons/devices.d.ts +6 -0
  13. package/assets/types/generated/public/assets/icons/emojis.d.ts +6 -0
  14. package/assets/types/generated/public/assets/icons/files.d.ts +7 -0
  15. package/assets/types/generated/public/assets/icons/finance.d.ts +6 -0
  16. package/assets/types/generated/public/assets/icons/forms.d.ts +5 -0
  17. package/assets/types/generated/public/assets/icons/health.d.ts +6 -0
  18. package/assets/types/generated/public/assets/icons/index.d.ts +24 -0
  19. package/assets/types/generated/public/assets/icons/media.d.ts +7 -0
  20. package/assets/types/generated/public/assets/icons/navigation.d.ts +7 -0
  21. package/assets/types/generated/public/assets/icons/seasonal.d.ts +6 -0
  22. package/assets/types/generated/public/assets/icons/social.d.ts +7 -0
  23. package/assets/types/generated/public/assets/icons/sport.d.ts +6 -0
  24. package/assets/types/generated/public/assets/icons/status.d.ts +7 -0
  25. package/assets/types/generated/public/assets/icons/transport.d.ts +7 -0
  26. package/assets/types/generated/public/assets/icons/ui.d.ts +7 -0
  27. package/assets/types/generated/public/assets/icons/weather.d.ts +6 -0
  28. package/assets/types/generated/src/auth.d.ts +424 -0
  29. package/assets/types/generated/src/avatar.d.ts +270 -0
  30. package/assets/types/generated/src/binding-source.d.ts +58 -0
  31. package/assets/types/generated/src/butterfly-drawing.d.ts +2 -0
  32. package/assets/types/generated/src/component-factory.d.ts +150 -0
  33. package/assets/types/generated/src/component.d.ts +162 -0
  34. package/assets/types/generated/src/components/back-to-top.d.ts +150 -0
  35. package/assets/types/generated/src/components/badge.d.ts +208 -0
  36. package/assets/types/generated/src/components/card.d.ts +189 -0
  37. package/assets/types/generated/src/components/command-palette.d.ts +352 -0
  38. package/assets/types/generated/src/components/dropzone.d.ts +342 -0
  39. package/assets/types/generated/src/components/focus-trap.d.ts +238 -0
  40. package/assets/types/generated/src/components/loader.d.ts +133 -0
  41. package/assets/types/generated/src/components/modal.d.ts +339 -0
  42. package/assets/types/generated/src/components/range-slider.d.ts +267 -0
  43. package/assets/types/generated/src/components/shared.d.ts +91 -0
  44. package/assets/types/generated/src/components/split-pane.d.ts +239 -0
  45. package/assets/types/generated/src/components/toast.d.ts +284 -0
  46. package/assets/types/generated/src/components/tooltip.d.ts +200 -0
  47. package/assets/types/generated/src/components/virtual-list.d.ts +340 -0
  48. package/assets/types/generated/src/config.d.ts +193 -0
  49. package/assets/types/generated/src/context-cursor.d.ts +69 -0
  50. package/assets/types/generated/src/context-menu.d.ts +596 -0
  51. package/assets/types/generated/src/dates.d.ts +367 -0
  52. package/assets/types/generated/src/dom.d.ts +1221 -0
  53. package/assets/types/generated/src/effects.d.ts +1281 -0
  54. package/assets/types/generated/src/elements.d.ts +4994 -0
  55. package/assets/types/generated/src/escape.d.ts +5 -0
  56. package/assets/types/generated/src/flags-bundle.d.ts +4 -0
  57. package/assets/types/generated/src/flags.d.ts +338 -0
  58. package/assets/types/generated/src/forms.d.ts +1060 -0
  59. package/assets/types/generated/src/globals.d.ts +45 -0
  60. package/assets/types/generated/src/http.d.ts +131 -0
  61. package/assets/types/generated/src/i18n.d.ts +261 -0
  62. package/assets/types/generated/src/icons.d.ts +213 -0
  63. package/assets/types/generated/src/index.d.ts +249 -0
  64. package/assets/types/generated/src/input-group.d.ts +135 -0
  65. package/assets/types/generated/src/models.d.ts +968 -0
  66. package/assets/types/generated/src/popover.d.ts +413 -0
  67. package/assets/types/generated/src/router.d.ts +344 -0
  68. package/assets/types/generated/src/safe-url.d.ts +10 -0
  69. package/assets/types/generated/src/sanitize.d.ts +97 -0
  70. package/assets/types/generated/src/schema-builder.d.ts +420 -0
  71. package/assets/types/generated/src/skeleton.d.ts +135 -0
  72. package/assets/types/generated/src/smooth-caret.d.ts +61 -0
  73. package/assets/types/generated/src/sortable.d.ts +368 -0
  74. package/assets/types/generated/src/storage.d.ts +93 -0
  75. package/assets/types/generated/src/tables.d.ts +901 -0
  76. package/assets/types/generated/src/theme.d.ts +262 -0
  77. package/assets/types/generated/src/ticker-tape-drawing.d.ts +2 -0
  78. package/assets/types/generated/src/treeview.d.ts +504 -0
  79. package/assets/types/generated/src/utils.d.ts +1667 -0
  80. package/assets/types/generated/src/web-components/base/domma-element.d.ts +134 -0
  81. package/assets/types/generated/src/web-components/index.d.ts +14 -0
  82. package/assets/types/generated/vendor/domma-reactive.d.ts +587 -0
  83. package/assets/types/index.d.ts +104 -226
  84. package/package.json +5 -2
  85. package/public/dist/bundles/domma-complete.css +20 -14
  86. package/public/dist/bundles/domma-data-focused.css +20 -14
  87. package/public/dist/bundles/domma-essentials.css +20 -14
  88. package/public/dist/bundles/domma-full.css +20 -14
  89. package/public/dist/bundles/domma-minimal.css +8 -8
  90. package/public/dist/domma-flags.esm.js +3 -3
  91. package/public/dist/domma-flags.esm.js.map +1 -1
  92. package/public/dist/domma-flags.min.js +3 -3
  93. package/public/dist/domma-flags.min.js.map +1 -1
  94. package/public/dist/domma-syntax.min.js +3 -3
  95. package/public/dist/domma.css +3 -3
  96. package/public/dist/domma.esm.js +5 -5
  97. package/public/dist/domma.esm.js.map +1 -1
  98. package/public/dist/domma.min.js +5 -5
  99. package/public/dist/domma.min.js.map +1 -1
  100. package/public/dist/elements.css +9 -3
  101. package/public/dist/grid.css +3 -3
  102. package/public/dist/syntax.css +3 -3
  103. package/public/dist/themes/domma-themes.css +3 -3
  104. package/templates/kickstart/.claude/snippets.md +1 -1
  105. package/templates/kickstart/CLAUDE.md +1 -1
  106. package/templates/kickstart/frontend/types/domma.d.ts +7 -4
  107. package/templates/kickstart-spa/.claude/snippets.md +1 -1
  108. package/assets/types/config.d.ts +0 -136
  109. package/assets/types/dates.d.ts +0 -209
  110. package/assets/types/dom.d.ts +0 -448
  111. package/assets/types/elements.d.ts +0 -1168
  112. package/assets/types/flags.d.ts +0 -130
  113. package/assets/types/http.d.ts +0 -97
  114. package/assets/types/i18n.d.ts +0 -99
  115. package/assets/types/icons.d.ts +0 -147
  116. package/assets/types/models.d.ts +0 -260
  117. package/assets/types/smooth-caret.d.ts +0 -12
  118. package/assets/types/storage.d.ts +0 -93
  119. package/assets/types/tables.d.ts +0 -327
  120. package/assets/types/theme.d.ts +0 -137
  121. package/assets/types/utils.d.ts +0 -675
@@ -0,0 +1,249 @@
1
+ export default Domma;
2
+ /**
3
+ * `$.setup()` input: page-wide switches, then selectors, each with a {@link SelectorConfig}.
4
+ */
5
+ export type DommaSetupConfig = DommaSetupOptions & {
6
+ [selector: string]: import("./config.js").SelectorConfig | string | boolean | (() => void) | undefined;
7
+ };
8
+ /**
9
+ * The page-wide switches `$.setup()` reads before the selectors.
10
+ */
11
+ export type DommaSetupOptions = {
12
+ /**
13
+ * false: reveal the page now and stop cloaking it
14
+ */
15
+ cloak?: boolean;
16
+ /**
17
+ * true: switch Domma's theming off (bring your own styles)
18
+ */
19
+ noStyles?: boolean;
20
+ /**
21
+ * Theme to start, e.g. 'ocean-dark'
22
+ */
23
+ theme?: string;
24
+ /**
25
+ * Follow the system light/dark preference
26
+ */
27
+ autoDetectTheme?: boolean;
28
+ /**
29
+ * false: do not remember the theme (default true)
30
+ */
31
+ persistTheme?: boolean;
32
+ /**
33
+ * true: run `I.scan()` over the page
34
+ */
35
+ scanIcons?: boolean;
36
+ /**
37
+ * Runs once, before the selectors
38
+ */
39
+ $init?: () => void;
40
+ };
41
+ /**
42
+ * The Domma function and everything on it. `$` is the same function.
43
+ */
44
+ export type DommaStatic = typeof Domma & DommaExtras;
45
+ /**
46
+ * Statics attached outside this file: `noConflict` by installGlobals() (globals.js), `flags` / `FL` by the
47
+ * opt-in domma-flags bundle.
48
+ */
49
+ export type DommaExtras = {
50
+ /**
51
+ * Give `$` and `_` back to whatever owned them before
52
+ * Domma loaded (jQuery, Lodash). With `deep`, give back every short alias (`window.Domma` stays). Returns
53
+ * Domma, so `const dm = Domma.noConflict()` keeps a handle.
54
+ */
55
+ noConflict: (deep?: boolean) => DommaStatic;
56
+ /**
57
+ * Nation flags - present when domma-flags is loaded
58
+ */
59
+ flags?: import("./flags.js").Flags;
60
+ /**
61
+ * Alias for `flags` (opt-in module)
62
+ */
63
+ FL?: import("./flags.js").Flags;
64
+ };
65
+ /**
66
+ * Wrap elements in a {@link DommaCollection}: a CSS selector, an HTML string (`'<li>One</li>'`), an element,
67
+ * a NodeList, an array of elements or another collection.
68
+ * @overload
69
+ * @param {import('./dom.js').DommaSelector} selector - CSS selector, HTML string, element(s) or a collection
70
+ * @param {Document | Element | DocumentFragment} [context] - Where to look for a CSS selector (default: document)
71
+ * @returns {import('./dom.js').DommaCollection}
72
+ */
73
+ export function Domma(selector: import("./dom.js").DommaSelector, context?: Document | Element | DocumentFragment): import("./dom.js").DommaCollection;
74
+ /**
75
+ * Run a function when the DOM is ready (straight away if it already is).
76
+ * @overload
77
+ * @param {() => void} callback
78
+ * @returns {import('./dom.js').DommaCollection} An empty collection
79
+ */
80
+ export function Domma(callback: () => void): import("./dom.js").DommaCollection;
81
+ export namespace Domma {
82
+ export let version: string;
83
+ export namespace buildInfo {
84
+ let version_1: string;
85
+ export { version_1 as version };
86
+ export let built: string;
87
+ export let commit: string;
88
+ }
89
+ export { http };
90
+ export { utils };
91
+ /**
92
+ * Set up components, initial state and events declaratively, keyed by selector.
93
+ * @param {DommaSetupConfig} config
94
+ * @returns {void}
95
+ */
96
+ export function setup(config: DommaSetupConfig): void;
97
+ /**
98
+ * Update the configuration for a selector (deep merged) and apply the changes.
99
+ * @param {string} selector
100
+ * @param {Partial<import('./config.js').SelectorConfig>} changes
101
+ * @returns {import('./config.js').SelectorConfig} The merged configuration
102
+ */
103
+ export function update(selector: string, changes: Partial<import("./config.js").SelectorConfig>): import("./config.js").SelectorConfig;
104
+ /**
105
+ * Retrieve the configuration of every selector
106
+ * @overload
107
+ * @returns {Record<string, SelectorConfig>}
108
+ */
109
+ export function config(): Record<string, import("./config.js").SelectorConfig>;
110
+ /**
111
+ * Retrieve configuration for a selector
112
+ * @overload
113
+ * @param {string} selector - Selector to get config for
114
+ * @returns {SelectorConfig | null} Configuration object or null if not found
115
+ */
116
+ export function config(selector: string): import("./config.js").SelectorConfig | null;
117
+ /**
118
+ * Retrieve the live component instance created for a selector.
119
+ *
120
+ * $.setup() keeps instances internally, so page code has no other way to
121
+ * reach them - calling a component's methods (modal.open(), tabs.show(),
122
+ * timer.start()) requires this accessor.
123
+ *
124
+ * @overload
125
+ * @returns {Map<string, any>} Every instance, by selector
126
+ */
127
+ export function getComponent(): Map<string, any>;
128
+ /**
129
+ * @overload
130
+ * @param {string} selector - Selector the component was configured under
131
+ * @returns {any} The instance, or null
132
+ */
133
+ export function getComponent(selector: string): any;
134
+ export function reset(selector?: string): void;
135
+ export function ready(callback: () => void): void;
136
+ export { models };
137
+ export { elements };
138
+ export { effects };
139
+ export { dates };
140
+ export { tables };
141
+ export { forms };
142
+ export { smoothCaret };
143
+ export { theme };
144
+ export { icons };
145
+ export { storage };
146
+ export { auth };
147
+ export { router };
148
+ export { sanitizeModule as sanitize };
149
+ export { components };
150
+ export { i18n };
151
+ /**
152
+ * Translate a key - shortcut for `Domma.i18n.t()`.
153
+ * @param {string} key
154
+ * @param {Record<string, any> | null} [params] - Values for `{name}` placeholders, `count` for plurals
155
+ * @param {import('./i18n.js').I18nTranslateOptions} [options]
156
+ * @returns {string}
157
+ */
158
+ export function t(key: string, params?: Record<string, any> | null, options?: import("./i18n.js").I18nTranslateOptions): string;
159
+ /**
160
+ * Shorthand for Domma.components.define() - register a standalone component.
161
+ * Usage: Domma.component('tag-name', definition)
162
+ *
163
+ * @param {string} tagName
164
+ * @param {import('./component-factory.js').ComponentDefinition} definition
165
+ * @returns {ReturnType<typeof createComponent>}
166
+ */
167
+ export function component(tagName: string, definition: import("./component-factory.js").ComponentDefinition): ReturnType<typeof createComponent>;
168
+ export { DesktopNotification };
169
+ export { M };
170
+ export { D };
171
+ export { S };
172
+ export { A };
173
+ export { F };
174
+ export { H };
175
+ export { E };
176
+ export { I };
177
+ export { T };
178
+ export { R };
179
+ export { B };
180
+ export { isDomma };
181
+ }
182
+ /**
183
+ * The Domma function and everything on it. `$` is the same function.
184
+ * @typedef {typeof Domma & DommaExtras} DommaStatic
185
+ */
186
+ /**
187
+ * Statics attached outside this file: `noConflict` by installGlobals() (globals.js), `flags` / `FL` by the
188
+ * opt-in domma-flags bundle.
189
+ * @typedef {object} DommaExtras
190
+ * @property {(deep?: boolean) => DommaStatic} noConflict Give `$` and `_` back to whatever owned them before
191
+ * Domma loaded (jQuery, Lodash). With `deep`, give back every short alias (`window.Domma` stays). Returns
192
+ * Domma, so `const dm = Domma.noConflict()` keeps a handle.
193
+ * @property {import('./flags.js').Flags} [flags] Nation flags - present when domma-flags is loaded
194
+ * @property {import('./flags.js').Flags} [FL] Alias for `flags` (opt-in module)
195
+ */
196
+ /** @type {DommaStatic} */
197
+ export const $: DommaStatic;
198
+ /** @type {typeof utils} */
199
+ export const _: typeof utils;
200
+ /** @type {typeof models} */
201
+ export const M: typeof models;
202
+ /** @type {typeof dates} */
203
+ export const D: typeof dates;
204
+ /** @type {typeof storage} */
205
+ export const S: typeof storage;
206
+ /** @type {typeof auth} */
207
+ export const A: typeof auth;
208
+ /** @type {typeof forms} */
209
+ export const F: typeof forms;
210
+ /** @type {typeof http} */
211
+ export const H: typeof http;
212
+ /** @type {typeof elements} */
213
+ export const E: typeof elements;
214
+ /** @type {typeof icons} */
215
+ export const I: typeof icons;
216
+ /** @type {typeof tables} */
217
+ export const T: typeof tables;
218
+ /** @type {typeof router} */
219
+ export const R: typeof router;
220
+ /**
221
+ * Blueprint composition: `B.extend`, `B.pick`, `B.omit` (the same functions as `M.extend` / `M.pick` / `M.omit`).
222
+ * @type {{extend: typeof models.extend, pick: typeof models.pick, omit: typeof models.omit}}
223
+ */
224
+ export const B: {
225
+ extend: typeof models.extend;
226
+ pick: typeof models.pick;
227
+ omit: typeof models.omit;
228
+ };
229
+ import { components } from './component-factory.js';
230
+ import { smoothCaret } from './smooth-caret.js';
231
+ import { i18n } from './i18n.js';
232
+ import { http } from './http.js';
233
+ import { utils } from './utils.js';
234
+ import { models } from './models.js';
235
+ import { elements } from './elements.js';
236
+ import effects from './effects.js';
237
+ import { dates } from './dates.js';
238
+ import { tables } from './tables.js';
239
+ import { forms } from './forms.js';
240
+ import { theme } from './theme.js';
241
+ import { icons } from './icons.js';
242
+ import { storage } from './storage.js';
243
+ import { auth } from './auth.js';
244
+ import { router } from './router.js';
245
+ import sanitizeModule from './sanitize.js';
246
+ import { createComponent } from './component-factory.js';
247
+ import { DesktopNotification } from './elements.js';
248
+ import { isDomma } from './dom.js';
249
+ export { components, smoothCaret, i18n };
@@ -0,0 +1,135 @@
1
+ export default InputGroup;
2
+ /**
3
+ * One addon slot: an icon (a plain icon name), text (set as text, never
4
+ * parsed as HTML), or a string, which is shorthand for `{text}`.
5
+ * `null`, `false` or `''` means no addon.
6
+ */
7
+ export type InputGroupSlot = {
8
+ icon: string;
9
+ } | {
10
+ text: string | number;
11
+ } | string | number | null | false;
12
+ export type InputGroupOptions = {
13
+ /**
14
+ * - Addon joined to the start of the input
15
+ */
16
+ prefix?: InputGroupSlot;
17
+ /**
18
+ * - Addon joined to the end of the input
19
+ */
20
+ suffix?: InputGroupSlot;
21
+ /**
22
+ * - Password inputs: show / hide toggle button (aria-pressed, eye / eye-off)
23
+ */
24
+ reveal?: boolean;
25
+ /**
26
+ * - Text-like inputs and textareas: clear button shown while there is a
27
+ * value; clearing fires input + change and refocuses the input
28
+ */
29
+ clear?: boolean;
30
+ /**
31
+ * - Number inputs: - and + buttons honouring min / max / step, disabled at
32
+ * the limits, input + change per step, hold to repeat
33
+ */
34
+ stepper?: boolean;
35
+ /**
36
+ * - Text-like inputs and textareas: live "12 / 200" counter after the group
37
+ * (aria-live polite, added to aria-describedby). `true` reads maxLength;
38
+ * a number is the limit. `.is-warning` from 90%, `.is-over` past it
39
+ */
40
+ counter?: boolean | number;
41
+ /**
42
+ * - Accessible names for the buttons
43
+ */
44
+ labels?: {
45
+ reveal?: string;
46
+ clear?: string;
47
+ decrease?: string;
48
+ increase?: string;
49
+ };
50
+ };
51
+ /**
52
+ * The extras' elements, present only for the extras in use.
53
+ */
54
+ export type InputGroupExtras = {
55
+ reveal?: HTMLButtonElement;
56
+ clear?: HTMLButtonElement;
57
+ decrease?: HTMLButtonElement;
58
+ increase?: HTMLButtonElement;
59
+ counter?: HTMLElement;
60
+ };
61
+ export type InputGroupInstance = InputGroup;
62
+ declare class InputGroup extends Component {
63
+ static defaults: {
64
+ prefix: any;
65
+ suffix: any;
66
+ reveal: boolean;
67
+ clear: boolean;
68
+ stepper: boolean;
69
+ counter: boolean;
70
+ labels: {
71
+ reveal: string;
72
+ clear: string;
73
+ decrease: string;
74
+ increase: string;
75
+ };
76
+ };
77
+ /**
78
+ * @param {string|HTMLElement} selector - The input (or textarea / select), or a selector for it
79
+ * @param {InputGroupOptions} [options]
80
+ */
81
+ constructor(selector: string | HTMLElement, options?: InputGroupOptions);
82
+ /** The bound input (or textarea / select). @type {HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement|null} */
83
+ input: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null;
84
+ _extraHandlers: any[];
85
+ _timers: {};
86
+ /** The extras' elements (reveal, clear, decrease, increase, counter). @type {InputGroupExtras} */
87
+ extras: InputGroupExtras;
88
+ _ownsWrapper: boolean;
89
+ /** The `.input-group-icon` wrapper; null after destroy(). @type {HTMLElement|null} */
90
+ wrapper: HTMLElement | null;
91
+ _manageAddons: boolean;
92
+ /**
93
+ * Change the addons or the extras; `null` removes an addon, `false` an
94
+ * extra; a key left out is kept. Returns the instance.
95
+ * @param {InputGroupOptions} [opts]
96
+ * @returns {this}
97
+ */
98
+ update(opts?: InputGroupOptions): this;
99
+ /**
100
+ * Re-read the input: clear-button visibility, stepper limits, counter.
101
+ * Call it after setting `input.value` from code without an input event.
102
+ * @returns {this}
103
+ */
104
+ refresh(): this;
105
+ _applyOptions(): void;
106
+ _render(): void;
107
+ /**
108
+ * The input loses its rounded corner on a side where anything visible
109
+ * joins it; a hidden clear button leaves that corner round.
110
+ */
111
+ _syncEdges(): void;
112
+ _listen(el: any, event: any, handler: any, opts: any): void;
113
+ _limits(): {
114
+ min: number;
115
+ max: number;
116
+ step: number;
117
+ };
118
+ _counterLimit(): any;
119
+ _buildExtras(): void;
120
+ _describedBy: string;
121
+ _setRevealed(on: any): void;
122
+ /** Dispatch input and change so Forma's model and any listener see it. */
123
+ _fireInput(): void;
124
+ /**
125
+ * One step in `dir` (-1 / 1), honouring min, max and step (fires input + change).
126
+ * @param {1|-1|number} dir - 1 up, -1 down
127
+ * @returns {this}
128
+ */
129
+ step(dir: 1 | -1 | number): this;
130
+ _bindStep(btn: any, dir: any): void;
131
+ _pointerStepped: boolean;
132
+ _stopRepeat(): void;
133
+ _teardownExtras(): void;
134
+ }
135
+ import Component from './component.js';