domma-js 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/assets/types/catalogue.json +29 -29
- package/assets/types/generated/public/assets/icons/code.d.ts +236 -1
- package/assets/types/generated/src/auth.d.ts +38 -38
- package/assets/types/generated/src/avatar.d.ts +31 -31
- package/assets/types/generated/src/binding-source.d.ts +3 -3
- package/assets/types/generated/src/component-factory.d.ts +15 -15
- package/assets/types/generated/src/component.d.ts +4 -4
- package/assets/types/generated/src/components/back-to-top.d.ts +18 -18
- package/assets/types/generated/src/components/badge.d.ts +26 -26
- package/assets/types/generated/src/components/card.d.ts +30 -30
- package/assets/types/generated/src/components/command-palette.d.ts +69 -69
- package/assets/types/generated/src/components/dropzone.d.ts +54 -54
- package/assets/types/generated/src/components/focus-trap.d.ts +22 -22
- package/assets/types/generated/src/components/loader.d.ts +15 -15
- package/assets/types/generated/src/components/modal.d.ts +59 -59
- package/assets/types/generated/src/components/range-slider.d.ts +54 -54
- package/assets/types/generated/src/components/shared.d.ts +1 -1
- package/assets/types/generated/src/components/split-pane.d.ts +45 -45
- package/assets/types/generated/src/components/toast.d.ts +38 -38
- package/assets/types/generated/src/components/tooltip.d.ts +24 -24
- package/assets/types/generated/src/components/virtual-list.d.ts +61 -61
- package/assets/types/generated/src/config.d.ts +21 -21
- package/assets/types/generated/src/context-cursor.d.ts +6 -6
- package/assets/types/generated/src/context-menu.d.ts +72 -72
- package/assets/types/generated/src/dom.d.ts +12 -12
- package/assets/types/generated/src/effects.d.ts +154 -141
- package/assets/types/generated/src/elements.d.ts +644 -644
- package/assets/types/generated/src/flags.d.ts +38 -38
- package/assets/types/generated/src/forms.d.ts +100 -100
- package/assets/types/generated/src/globals.d.ts +6 -6
- package/assets/types/generated/src/http.d.ts +12 -12
- package/assets/types/generated/src/i18n.d.ts +8 -8
- package/assets/types/generated/src/icons.d.ts +13 -13
- package/assets/types/generated/src/index.d.ts +10 -10
- package/assets/types/generated/src/input-group.d.ts +21 -21
- package/assets/types/generated/src/models.d.ts +21 -21
- package/assets/types/generated/src/popover.d.ts +45 -45
- package/assets/types/generated/src/router.d.ts +30 -30
- package/assets/types/generated/src/sanitize.d.ts +13 -5
- package/assets/types/generated/src/schema-builder.d.ts +34 -34
- package/assets/types/generated/src/skeleton.d.ts +11 -11
- package/assets/types/generated/src/sortable.d.ts +46 -46
- package/assets/types/generated/src/tables.d.ts +75 -75
- package/assets/types/generated/src/theme.d.ts +8 -8
- package/assets/types/generated/src/treeview.d.ts +48 -48
- package/assets/types/generated/src/utils.d.ts +13 -13
- package/assets/types/generated/vendor/domma-reactive.d.ts +2 -2
- package/package.json +22 -16
- package/public/dist/bundles/domma-complete.css +53 -14
- package/public/dist/bundles/domma-data-focused.css +53 -14
- package/public/dist/bundles/domma-essentials.css +53 -14
- package/public/dist/bundles/domma-full.css +53 -14
- package/public/dist/bundles/domma-minimal.css +47 -8
- package/public/dist/domma-flags.esm.js +3 -3
- package/public/dist/domma-flags.min.js +3 -3
- package/public/dist/domma-syntax.min.js +3 -3
- package/public/dist/domma.css +42 -3
- package/public/dist/domma.esm.js +4 -4
- package/public/dist/domma.esm.js.map +1 -1
- package/public/dist/domma.min.js +4 -4
- package/public/dist/domma.min.js.map +1 -1
- package/public/dist/elements.css +3 -3
- package/public/dist/grid.css +3 -3
- package/public/dist/syntax.css +3 -3
- package/public/dist/themes/domma-themes.css +3 -3
|
@@ -32,7 +32,7 @@ export function avatarTone(key: string): number;
|
|
|
32
32
|
* @param {AvatarOptions} [options]
|
|
33
33
|
* @returns {AvatarHandle|null}
|
|
34
34
|
*/
|
|
35
|
-
export function avatar(target: string | Element | ArrayLike<Element> | null, options?: AvatarOptions): AvatarHandle | null;
|
|
35
|
+
export function avatar(target: string | Element | ArrayLike<Element> | null, options?: AvatarOptions | undefined): AvatarHandle | null;
|
|
36
36
|
/**
|
|
37
37
|
* Render one avatar into a detached <span> for you to insert.
|
|
38
38
|
* @overload
|
|
@@ -90,51 +90,51 @@ export type AvatarOptions = {
|
|
|
90
90
|
/**
|
|
91
91
|
* - The person: initials, tone and accessible name come from it
|
|
92
92
|
*/
|
|
93
|
-
name?: string | null;
|
|
93
|
+
name?: string | null | undefined;
|
|
94
94
|
/**
|
|
95
95
|
* - Picture URL; falls back to the initials (or icon) if it fails to load
|
|
96
96
|
*/
|
|
97
|
-
src?: string | null;
|
|
97
|
+
src?: string | null | undefined;
|
|
98
98
|
/**
|
|
99
99
|
* - Accessible name when it should differ from name
|
|
100
100
|
*/
|
|
101
|
-
alt?: string | null;
|
|
101
|
+
alt?: string | null | undefined;
|
|
102
102
|
/**
|
|
103
103
|
* - Size (default 'md')
|
|
104
104
|
*/
|
|
105
|
-
size?: AvatarSize;
|
|
105
|
+
size?: AvatarSize | undefined;
|
|
106
106
|
/**
|
|
107
107
|
* - Shape (default 'circle')
|
|
108
108
|
*/
|
|
109
|
-
shape?: AvatarShape;
|
|
109
|
+
shape?: AvatarShape | undefined;
|
|
110
110
|
/**
|
|
111
111
|
* - Status dot; the word goes into the accessible name
|
|
112
112
|
*/
|
|
113
|
-
status?: AvatarStatus | null;
|
|
113
|
+
status?: AvatarStatus | null | undefined;
|
|
114
114
|
/**
|
|
115
115
|
* - Words for the statuses in the accessible name, e.g. {busy: 'in a meeting'}
|
|
116
116
|
*/
|
|
117
|
-
statusLabels?: Partial<Record<AvatarStatus, string>> | null;
|
|
117
|
+
statusLabels?: Partial<Record<AvatarStatus, string>> | null | undefined;
|
|
118
118
|
/**
|
|
119
119
|
* - Icon name shown instead of initials ('user' when there is no name)
|
|
120
120
|
*/
|
|
121
|
-
icon?: string | null;
|
|
121
|
+
icon?: string | null | undefined;
|
|
122
122
|
/**
|
|
123
123
|
* - Hover text; true = the accessible name
|
|
124
124
|
*/
|
|
125
|
-
title?: string | true | null;
|
|
125
|
+
title?: string | true | null | undefined;
|
|
126
126
|
/**
|
|
127
127
|
* - A primary-coloured ring (default false)
|
|
128
128
|
*/
|
|
129
|
-
ring?: boolean;
|
|
129
|
+
ring?: boolean | undefined;
|
|
130
130
|
/**
|
|
131
131
|
* - 0-7 to choose the tint; default is a hash of the name
|
|
132
132
|
*/
|
|
133
|
-
tone?: number | null;
|
|
133
|
+
tone?: number | null | undefined;
|
|
134
134
|
/**
|
|
135
135
|
* - aria-hidden: the name is written next to it (default false)
|
|
136
136
|
*/
|
|
137
|
-
decorative?: boolean;
|
|
137
|
+
decorative?: boolean | undefined;
|
|
138
138
|
};
|
|
139
139
|
/**
|
|
140
140
|
* The handle E.avatar() returns. `options`, `initials`, `tone` and `label` are read only.
|
|
@@ -177,59 +177,59 @@ export type AvatarStatic = typeof avatar;
|
|
|
177
177
|
* One person in an avatar group.
|
|
178
178
|
*/
|
|
179
179
|
export type AvatarPerson = {
|
|
180
|
-
name?: string;
|
|
181
|
-
src?: string;
|
|
182
|
-
status?: AvatarStatus;
|
|
180
|
+
name?: string | undefined;
|
|
181
|
+
src?: string | undefined;
|
|
182
|
+
status?: AvatarStatus | undefined;
|
|
183
183
|
/**
|
|
184
184
|
* - Makes the avatar a link
|
|
185
185
|
*/
|
|
186
|
-
href?: string;
|
|
187
|
-
alt?: string;
|
|
188
|
-
icon?: string;
|
|
189
|
-
tone?: number;
|
|
186
|
+
href?: string | undefined;
|
|
187
|
+
alt?: string | undefined;
|
|
188
|
+
icon?: string | undefined;
|
|
189
|
+
tone?: number | undefined;
|
|
190
190
|
/**
|
|
191
191
|
* - Hover text (default: the accessible name)
|
|
192
192
|
*/
|
|
193
|
-
title?: string | true;
|
|
193
|
+
title?: string | true | undefined;
|
|
194
194
|
};
|
|
195
195
|
export type AvatarGroupOptions = {
|
|
196
196
|
/**
|
|
197
197
|
* - People, or plain names
|
|
198
198
|
*/
|
|
199
|
-
people?:
|
|
199
|
+
people?: (string | AvatarPerson)[] | undefined;
|
|
200
200
|
/**
|
|
201
201
|
* - Show this many, then "+N"; null = everyone
|
|
202
202
|
*/
|
|
203
|
-
max?: number | null;
|
|
203
|
+
max?: number | null | undefined;
|
|
204
204
|
/**
|
|
205
205
|
* - Size (default 'md')
|
|
206
206
|
*/
|
|
207
|
-
size?: AvatarSize;
|
|
207
|
+
size?: AvatarSize | undefined;
|
|
208
208
|
/**
|
|
209
209
|
* - Shape (default 'circle')
|
|
210
210
|
*/
|
|
211
|
-
shape?: AvatarShape;
|
|
211
|
+
shape?: AvatarShape | undefined;
|
|
212
212
|
/**
|
|
213
213
|
* - 'none' | 'sm' | 'md' | 'lg', pixels, or any CSS length; null = the stylesheet's 25%
|
|
214
214
|
*/
|
|
215
|
-
overlap?:
|
|
215
|
+
overlap?: string | number | null | undefined;
|
|
216
216
|
/**
|
|
217
217
|
* - Accessible name for the list
|
|
218
218
|
*/
|
|
219
|
-
label?: string | null;
|
|
220
|
-
statusLabels?: Partial<Record<AvatarStatus, string>> | null;
|
|
219
|
+
label?: string | null | undefined;
|
|
220
|
+
statusLabels?: Partial<Record<AvatarStatus, string>> | null | undefined;
|
|
221
221
|
/**
|
|
222
222
|
* - Called when "+N" is pressed, instead of the popover
|
|
223
223
|
*/
|
|
224
|
-
onMore?: ((hidden: AvatarPerson[], event: MouseEvent) => void) | null;
|
|
224
|
+
onMore?: ((hidden: AvatarPerson[], event: MouseEvent) => void) | null | undefined;
|
|
225
225
|
/**
|
|
226
226
|
* - false: no popover, the hidden names go in the button's title (default true)
|
|
227
227
|
*/
|
|
228
|
-
popover?: boolean;
|
|
228
|
+
popover?: boolean | undefined;
|
|
229
229
|
/**
|
|
230
230
|
* - The "+N" button's accessible name (default '3 more: A, B and C')
|
|
231
231
|
*/
|
|
232
|
-
moreLabel?: ((count: number, names: string[]) => string) | null;
|
|
232
|
+
moreLabel?: ((count: number, names: string[]) => string) | null | undefined;
|
|
233
233
|
};
|
|
234
234
|
/**
|
|
235
235
|
* The handle E.avatarGroup() returns. Everything but the methods is read only.
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
* @returns {T} `primary` itself when there is nothing to layer, otherwise a
|
|
53
53
|
* Proxy over it.
|
|
54
54
|
*/
|
|
55
|
-
export function createBindingSource<T extends
|
|
56
|
-
fallback?: Record<string, any
|
|
57
|
-
onWrite?: (key: string, value: any) => void;
|
|
55
|
+
export function createBindingSource<T extends object>(primary: T, { fallback, onWrite }?: {
|
|
56
|
+
fallback?: Record<string, any> | undefined;
|
|
57
|
+
onWrite?: ((key: string, value: any) => void) | undefined;
|
|
58
58
|
}): T;
|
|
@@ -45,11 +45,11 @@ export type PropDefinition = {
|
|
|
45
45
|
/**
|
|
46
46
|
* - Expected type - a token or an `M.types.*` constant
|
|
47
47
|
*/
|
|
48
|
-
type?: PropType | ((value: any) => boolean);
|
|
48
|
+
type?: PropType | ((value: any) => boolean) | undefined;
|
|
49
49
|
/**
|
|
50
50
|
* - Marks the prop as required (documentation only - not enforced)
|
|
51
51
|
*/
|
|
52
|
-
required?: boolean;
|
|
52
|
+
required?: boolean | undefined;
|
|
53
53
|
/**
|
|
54
54
|
* - Value used when the attribute is absent; a function is called for it
|
|
55
55
|
*/
|
|
@@ -88,55 +88,55 @@ export type ComponentDefinition<TData extends Record<string, any> = Record<strin
|
|
|
88
88
|
/**
|
|
89
89
|
* - Inline Mustache template string. Use `templateUrl` for non-trivial templates
|
|
90
90
|
*/
|
|
91
|
-
template?: string;
|
|
91
|
+
template?: string | undefined;
|
|
92
92
|
/**
|
|
93
93
|
* - URL to an external HTML template file, fetched once and cached across all instances
|
|
94
94
|
*/
|
|
95
|
-
templateUrl?: string;
|
|
95
|
+
templateUrl?: string | undefined;
|
|
96
96
|
/**
|
|
97
97
|
* - Declared HTML attributes (camelCase name, kebab-case attribute) with type coercion and defaults
|
|
98
98
|
*/
|
|
99
|
-
props?: Record<string, PropDefinition
|
|
99
|
+
props?: Record<string, PropDefinition> | undefined;
|
|
100
100
|
/**
|
|
101
101
|
* - Factory returning the component's initial reactive state; called once per instance. Declare every field here
|
|
102
102
|
*/
|
|
103
|
-
data?: () => TData;
|
|
103
|
+
data?: (() => TData) | undefined;
|
|
104
104
|
/**
|
|
105
105
|
* - Derived values, memoised and recalculated when a field they read changes; available in templates and as `this.name`
|
|
106
106
|
*/
|
|
107
|
-
computed?: Record<string, (this: ComponentContext<TData, TProps>) => any
|
|
107
|
+
computed?: Record<string, (this: ComponentContext<TData, TProps>) => any> | undefined;
|
|
108
108
|
/**
|
|
109
109
|
* - Functions bound to the component context; callable as `this.name()` and from `data-on-*` bindings
|
|
110
110
|
*/
|
|
111
|
-
methods?: Record<string, (this: ComponentContext<TData, TProps>, ...args: any[]) => any
|
|
111
|
+
methods?: Record<string, (this: ComponentContext<TData, TProps>, ...args: any[]) => any> | undefined;
|
|
112
112
|
/**
|
|
113
113
|
* - Scoped CSS injected into the component's Shadow DOM `<style>` block
|
|
114
114
|
*/
|
|
115
|
-
style?: string;
|
|
115
|
+
style?: string | undefined;
|
|
116
116
|
/**
|
|
117
117
|
* - Called before the template is rendered. Data and props are available
|
|
118
118
|
*/
|
|
119
|
-
onBeforeMount?: (this: ComponentContext<TData, TProps>) => void;
|
|
119
|
+
onBeforeMount?: ((this: ComponentContext<TData, TProps>) => void) | undefined;
|
|
120
120
|
/**
|
|
121
121
|
* - Called after the template is rendered and bindings are established (again when the element is re-connected)
|
|
122
122
|
*/
|
|
123
|
-
onMount?: (this: ComponentContext<TData, TProps>) => void;
|
|
123
|
+
onMount?: ((this: ComponentContext<TData, TProps>) => void) | undefined;
|
|
124
124
|
/**
|
|
125
125
|
* - Called once per flush after any data change, and after a prop change re-renders
|
|
126
126
|
*/
|
|
127
|
-
onUpdated?: (this: ComponentContext<TData, TProps>) => void;
|
|
127
|
+
onUpdated?: ((this: ComponentContext<TData, TProps>) => void) | undefined;
|
|
128
128
|
/**
|
|
129
129
|
* - Called when the element is removed from the DOM, before clean-up
|
|
130
130
|
*/
|
|
131
|
-
onBeforeUnmount?: (this: ComponentContext<TData, TProps>) => void;
|
|
131
|
+
onBeforeUnmount?: ((this: ComponentContext<TData, TProps>) => void) | undefined;
|
|
132
132
|
/**
|
|
133
133
|
* - Called after the element is removed and cleaned up
|
|
134
134
|
*/
|
|
135
|
-
onUnmount?: (this: ComponentContext<TData, TProps>) => void;
|
|
135
|
+
onUnmount?: ((this: ComponentContext<TData, TProps>) => void) | undefined;
|
|
136
136
|
/**
|
|
137
137
|
* - Called when an observed attribute (prop) changes, with the camelCase prop name and the raw attribute values
|
|
138
138
|
*/
|
|
139
|
-
onPropsChanged?: (this: ComponentContext<TData, TProps>, name: string, oldValue: string | null, newValue: string | null) => void;
|
|
139
|
+
onPropsChanged?: ((this: ComponentContext<TData, TProps>, name: string, oldValue: string | null, newValue: string | null) => void) | undefined;
|
|
140
140
|
};
|
|
141
141
|
/**
|
|
142
142
|
* Binding controller returned by `TemplateCompiler.compile()` (domma-reactive): surgical updates
|
|
@@ -10,7 +10,7 @@ export function instancesOf(element: Element): Component[];
|
|
|
10
10
|
* @param {Object} instance
|
|
11
11
|
* @returns {string|undefined}
|
|
12
12
|
*/
|
|
13
|
-
export function componentNameOf(instance:
|
|
13
|
+
export function componentNameOf(instance: Object): string | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* The newest instance on an element, optionally of one component kind.
|
|
16
16
|
* @param {Element} element
|
|
@@ -24,12 +24,12 @@ export function instanceOf(element: Element, name?: string): Component | null;
|
|
|
24
24
|
* @param {Element} element
|
|
25
25
|
* @param {Object} instance
|
|
26
26
|
*/
|
|
27
|
-
export function register(element: Element, instance:
|
|
27
|
+
export function register(element: Element, instance: Object): void;
|
|
28
28
|
/**
|
|
29
29
|
* @param {Element} element
|
|
30
30
|
* @param {Object} instance
|
|
31
31
|
*/
|
|
32
|
-
export function unregister(element: Element, instance:
|
|
32
|
+
export function unregister(element: Element, instance: Object): void;
|
|
33
33
|
export default Component;
|
|
34
34
|
/**
|
|
35
35
|
* A component event handler: gets the same arguments as the matching `onX` option.
|
|
@@ -131,7 +131,7 @@ declare class Component {
|
|
|
131
131
|
* @protected
|
|
132
132
|
*/
|
|
133
133
|
protected _forcedClose(...args: any[]): any;
|
|
134
|
-
_forceClose: boolean;
|
|
134
|
+
_forceClose: boolean | undefined;
|
|
135
135
|
/**
|
|
136
136
|
* The cancelable `beforeclose` an overlay's close() asks first. Skipped (true) while
|
|
137
137
|
* `_forcedClose()` runs.
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
/** @typedef {BackToTop} BackToTopInstance */
|
|
15
15
|
export class BackToTop extends Component {
|
|
16
16
|
static defaults: {
|
|
17
|
-
showAfter:
|
|
17
|
+
showAfter: null;
|
|
18
18
|
duration: number;
|
|
19
19
|
position: string;
|
|
20
|
-
offset:
|
|
21
|
-
target:
|
|
22
|
-
zIndex:
|
|
20
|
+
offset: null;
|
|
21
|
+
target: null;
|
|
22
|
+
zIndex: null;
|
|
23
23
|
label: string;
|
|
24
|
-
onShow:
|
|
25
|
-
onHide:
|
|
26
|
-
onScroll:
|
|
24
|
+
onShow: null;
|
|
25
|
+
onHide: null;
|
|
26
|
+
onScroll: null;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* @param {import('./shared.js').ComponentTarget} selector - A button / link / `.dm-back-to-top` to use; anything else adds a button to the body
|
|
@@ -40,7 +40,7 @@ export class BackToTop extends Component {
|
|
|
40
40
|
_watch(): void;
|
|
41
41
|
_box: any;
|
|
42
42
|
_scrollTarget: any;
|
|
43
|
-
_onScroll: () => void;
|
|
43
|
+
_onScroll: (() => void) | undefined;
|
|
44
44
|
_check(): void;
|
|
45
45
|
/**
|
|
46
46
|
* Scroll to the top; `duration` overrides the option for this call.
|
|
@@ -104,15 +104,15 @@ export type BackToTopOptions = {
|
|
|
104
104
|
/**
|
|
105
105
|
* - Px scrolled before it shows (null: one viewport / container height)
|
|
106
106
|
*/
|
|
107
|
-
showAfter?: number | null;
|
|
107
|
+
showAfter?: number | null | undefined;
|
|
108
108
|
/**
|
|
109
109
|
* - Scroll animation duration in ms (0 under reduced motion)
|
|
110
110
|
*/
|
|
111
|
-
duration?: number;
|
|
111
|
+
duration?: number | undefined;
|
|
112
112
|
/**
|
|
113
113
|
* - Button position
|
|
114
114
|
*/
|
|
115
|
-
position?: import("../elements.js").BackToTopPosition;
|
|
115
|
+
position?: import("../elements.js").BackToTopPosition | undefined;
|
|
116
116
|
/**
|
|
117
117
|
* - Px from the edges (null: the stylesheet's)
|
|
118
118
|
*/
|
|
@@ -120,31 +120,31 @@ export type BackToTopOptions = {
|
|
|
120
120
|
bottom?: number;
|
|
121
121
|
right?: number;
|
|
122
122
|
left?: number;
|
|
123
|
-
} | null;
|
|
123
|
+
} | null | undefined;
|
|
124
124
|
/**
|
|
125
125
|
* - Scroll container to watch (null: the window)
|
|
126
126
|
*/
|
|
127
|
-
target?: string | HTMLElement | null;
|
|
127
|
+
target?: string | HTMLElement | null | undefined;
|
|
128
128
|
/**
|
|
129
129
|
* - z-index for the button
|
|
130
130
|
*/
|
|
131
|
-
zIndex?: number | null;
|
|
131
|
+
zIndex?: number | null | undefined;
|
|
132
132
|
/**
|
|
133
133
|
* - aria-label when the button has none
|
|
134
134
|
*/
|
|
135
|
-
label?: string;
|
|
135
|
+
label?: string | undefined;
|
|
136
136
|
/**
|
|
137
137
|
* - When the button shows
|
|
138
138
|
*/
|
|
139
|
-
onShow?: ((backToTop: BackToTopInstance) => void) | null;
|
|
139
|
+
onShow?: ((backToTop: BackToTopInstance) => void) | null | undefined;
|
|
140
140
|
/**
|
|
141
141
|
* - When the button hides
|
|
142
142
|
*/
|
|
143
|
-
onHide?: ((backToTop: BackToTopInstance) => void) | null;
|
|
143
|
+
onHide?: ((backToTop: BackToTopInstance) => void) | null | undefined;
|
|
144
144
|
/**
|
|
145
145
|
* - When a scroll to the top starts
|
|
146
146
|
*/
|
|
147
|
-
onScroll?: ((backToTop: BackToTopInstance) => void) | null;
|
|
147
|
+
onScroll?: ((backToTop: BackToTopInstance) => void) | null | undefined;
|
|
148
148
|
};
|
|
149
149
|
export type BackToTopInstance = BackToTop;
|
|
150
150
|
import Component from '../component.js';
|
|
@@ -18,17 +18,17 @@ export class Badge extends Component {
|
|
|
18
18
|
outline: boolean;
|
|
19
19
|
removable: boolean;
|
|
20
20
|
pulse: boolean;
|
|
21
|
-
onClick:
|
|
22
|
-
onRemove:
|
|
21
|
+
onClick: null;
|
|
22
|
+
onRemove: null;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* @param {import('./shared.js').ComponentTarget} selector
|
|
26
26
|
* @param {BadgeOptions} [options]
|
|
27
27
|
*/
|
|
28
28
|
constructor(selector: import("./shared.js").ComponentTarget, options?: BadgeOptions);
|
|
29
|
-
_had: Set<string
|
|
29
|
+
_had: Set<string> | undefined;
|
|
30
30
|
_apply(): void;
|
|
31
|
-
_removeBtn: HTMLButtonElement;
|
|
31
|
+
_removeBtn: HTMLButtonElement | null | undefined;
|
|
32
32
|
_applyOptions(): void;
|
|
33
33
|
/**
|
|
34
34
|
* Set the badge variant.
|
|
@@ -70,21 +70,21 @@ export class Badge extends Component {
|
|
|
70
70
|
export class NumberBadge extends Component {
|
|
71
71
|
static defaults: {
|
|
72
72
|
count: number;
|
|
73
|
-
max:
|
|
73
|
+
max: null;
|
|
74
74
|
variant: string;
|
|
75
75
|
dot: boolean;
|
|
76
76
|
pulse: boolean;
|
|
77
|
-
borderColor:
|
|
78
|
-
label:
|
|
79
|
-
onChange:
|
|
77
|
+
borderColor: null;
|
|
78
|
+
label: null;
|
|
79
|
+
onChange: null;
|
|
80
80
|
};
|
|
81
81
|
/**
|
|
82
82
|
* @param {import('./shared.js').ComponentTarget} selector - The element the counter sits on
|
|
83
83
|
* @param {NumberBadgeOptions} [options]
|
|
84
84
|
*/
|
|
85
85
|
constructor(selector: import("./shared.js").ComponentTarget, options?: NumberBadgeOptions);
|
|
86
|
-
_holder: HTMLElement;
|
|
87
|
-
_hostClassAdded: boolean;
|
|
86
|
+
_holder: HTMLElement | undefined;
|
|
87
|
+
_hostClassAdded: boolean | undefined;
|
|
88
88
|
/** The `.badge-counter` span. @type {HTMLSpanElement} */
|
|
89
89
|
counter: HTMLSpanElement;
|
|
90
90
|
_paint(): void;
|
|
@@ -138,35 +138,35 @@ export type BadgeOptions = {
|
|
|
138
138
|
/**
|
|
139
139
|
* - Badge variant/colour
|
|
140
140
|
*/
|
|
141
|
-
variant?: import("../elements.js").BadgeVariant;
|
|
141
|
+
variant?: import("../elements.js").BadgeVariant | undefined;
|
|
142
142
|
/**
|
|
143
143
|
* - Badge size
|
|
144
144
|
*/
|
|
145
|
-
size?: import("../elements.js").BadgeSize |
|
|
145
|
+
size?: "sm" | "lg" | import("../elements.js").BadgeSize | undefined;
|
|
146
146
|
/**
|
|
147
147
|
* - Use pill/rounded style
|
|
148
148
|
*/
|
|
149
|
-
pill?: boolean;
|
|
149
|
+
pill?: boolean | undefined;
|
|
150
150
|
/**
|
|
151
151
|
* - Use outline style
|
|
152
152
|
*/
|
|
153
|
-
outline?: boolean;
|
|
153
|
+
outline?: boolean | undefined;
|
|
154
154
|
/**
|
|
155
155
|
* - Show remove button
|
|
156
156
|
*/
|
|
157
|
-
removable?: boolean;
|
|
157
|
+
removable?: boolean | undefined;
|
|
158
158
|
/**
|
|
159
159
|
* - Pulse animation
|
|
160
160
|
*/
|
|
161
|
-
pulse?: boolean;
|
|
161
|
+
pulse?: boolean | undefined;
|
|
162
162
|
/**
|
|
163
163
|
* - Callback on click (not the remove button)
|
|
164
164
|
*/
|
|
165
|
-
onClick?: ((event: MouseEvent, badge: BadgeInstance) => void) | null;
|
|
165
|
+
onClick?: ((event: MouseEvent, badge: BadgeInstance) => void) | null | undefined;
|
|
166
166
|
/**
|
|
167
167
|
* - Callback on remove; return false to keep the badge
|
|
168
168
|
*/
|
|
169
|
-
onRemove?: ((badge: BadgeInstance, event: MouseEvent) => boolean | void) | null;
|
|
169
|
+
onRemove?: ((badge: BadgeInstance, event: MouseEvent) => boolean | void) | null | undefined;
|
|
170
170
|
};
|
|
171
171
|
export type BadgeInstance = Badge;
|
|
172
172
|
export type NumberBadgeVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
|
|
@@ -174,35 +174,35 @@ export type NumberBadgeOptions = {
|
|
|
174
174
|
/**
|
|
175
175
|
* - Initial count to display (0 hides the counter unless `dot`)
|
|
176
176
|
*/
|
|
177
|
-
count?: number;
|
|
177
|
+
count?: number | undefined;
|
|
178
178
|
/**
|
|
179
179
|
* - Cap, e.g. 99 shows "99+"
|
|
180
180
|
*/
|
|
181
|
-
max?: number | null;
|
|
181
|
+
max?: number | null | undefined;
|
|
182
182
|
/**
|
|
183
183
|
* - Colour variant
|
|
184
184
|
*/
|
|
185
|
-
variant?: NumberBadgeVariant;
|
|
185
|
+
variant?: NumberBadgeVariant | undefined;
|
|
186
186
|
/**
|
|
187
187
|
* - Show as dot indicator instead of number
|
|
188
188
|
*/
|
|
189
|
-
dot?: boolean;
|
|
189
|
+
dot?: boolean | undefined;
|
|
190
190
|
/**
|
|
191
191
|
* - Enable pulse animation
|
|
192
192
|
*/
|
|
193
|
-
pulse?: boolean;
|
|
193
|
+
pulse?: boolean | undefined;
|
|
194
194
|
/**
|
|
195
195
|
* - Custom border ring colour
|
|
196
196
|
*/
|
|
197
|
-
borderColor?: string | null;
|
|
197
|
+
borderColor?: string | null | undefined;
|
|
198
198
|
/**
|
|
199
199
|
* - Accessible name (default: the count, or "New" for a dot)
|
|
200
200
|
*/
|
|
201
|
-
label?: string | null;
|
|
201
|
+
label?: string | null | undefined;
|
|
202
202
|
/**
|
|
203
203
|
* - The count changed
|
|
204
204
|
*/
|
|
205
|
-
onChange?: ((count: number, previous: number, badge: NumberBadgeInstance) => void) | null;
|
|
205
|
+
onChange?: ((count: number, previous: number, badge: NumberBadgeInstance) => void) | null | undefined;
|
|
206
206
|
};
|
|
207
207
|
export type NumberBadgeInstance = NumberBadge;
|
|
208
208
|
import Component from '../component.js';
|
|
@@ -29,36 +29,36 @@ export class Card extends Component {
|
|
|
29
29
|
animationDuration: number;
|
|
30
30
|
collapsible: boolean;
|
|
31
31
|
collapsed: boolean;
|
|
32
|
-
persistKey:
|
|
32
|
+
persistKey: null;
|
|
33
33
|
title: string;
|
|
34
34
|
icon: string;
|
|
35
35
|
content: string;
|
|
36
36
|
safe: boolean;
|
|
37
37
|
clickable: boolean;
|
|
38
|
-
color:
|
|
39
|
-
onCollapse:
|
|
40
|
-
onExpand:
|
|
41
|
-
onClick:
|
|
38
|
+
color: null;
|
|
39
|
+
onCollapse: null;
|
|
40
|
+
onExpand: null;
|
|
41
|
+
onClick: null;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
44
|
* @param {import('./shared.js').ComponentTarget} selector
|
|
45
45
|
* @param {CardOptions} [options]
|
|
46
46
|
*/
|
|
47
47
|
constructor(selector: import("./shared.js").ComponentTarget, options?: CardOptions);
|
|
48
|
-
_added: any[];
|
|
49
|
-
_made: any[];
|
|
48
|
+
_added: any[] | undefined;
|
|
49
|
+
_made: any[] | undefined;
|
|
50
50
|
_addClass(...names: any[]): void;
|
|
51
51
|
_apply(): void;
|
|
52
|
-
_colorClass: string;
|
|
53
|
-
_headerTabindex: boolean;
|
|
54
|
-
_header(): Element;
|
|
55
|
-
_body(): Element;
|
|
52
|
+
_colorClass: string | null | undefined;
|
|
53
|
+
_headerTabindex: boolean | undefined;
|
|
54
|
+
_header(): Element | null;
|
|
55
|
+
_body(): Element | null;
|
|
56
56
|
_bind(): void;
|
|
57
57
|
_storageKey(): any;
|
|
58
58
|
_restoreState(): void;
|
|
59
59
|
_saveState(): void;
|
|
60
60
|
_setCollapsed(collapsed: any, save?: boolean, animate?: boolean): void;
|
|
61
|
-
_heightTimer: number;
|
|
61
|
+
_heightTimer: number | undefined;
|
|
62
62
|
/**
|
|
63
63
|
* Collapse the body.
|
|
64
64
|
* @returns {this}
|
|
@@ -115,75 +115,75 @@ export type CardOptions = {
|
|
|
115
115
|
/**
|
|
116
116
|
* - Enable hover effects (`hover` is accepted as an alias)
|
|
117
117
|
*/
|
|
118
|
-
hoverable?: boolean;
|
|
118
|
+
hoverable?: boolean | undefined;
|
|
119
119
|
/**
|
|
120
120
|
* - Alias of `hoverable`
|
|
121
121
|
*/
|
|
122
|
-
hover?: boolean;
|
|
122
|
+
hover?: boolean | undefined;
|
|
123
123
|
/**
|
|
124
124
|
* - Shadow size
|
|
125
125
|
*/
|
|
126
|
-
shadow?: import("../elements.js").ShadowSize |
|
|
126
|
+
shadow?: "sm" | "lg" | import("../elements.js").ShadowSize | undefined;
|
|
127
127
|
/**
|
|
128
128
|
* - Apply border radius (false gives square corners)
|
|
129
129
|
*/
|
|
130
|
-
rounded?: boolean;
|
|
130
|
+
rounded?: boolean | undefined;
|
|
131
131
|
/**
|
|
132
132
|
* - Enable animations
|
|
133
133
|
*/
|
|
134
|
-
animation?: boolean;
|
|
134
|
+
animation?: boolean | undefined;
|
|
135
135
|
/**
|
|
136
136
|
* - Animation duration in ms
|
|
137
137
|
*/
|
|
138
|
-
animationDuration?: number;
|
|
138
|
+
animationDuration?: number | undefined;
|
|
139
139
|
/**
|
|
140
140
|
* - Clicking the header collapses/expands the body
|
|
141
141
|
*/
|
|
142
|
-
collapsible?: boolean;
|
|
142
|
+
collapsible?: boolean | undefined;
|
|
143
143
|
/**
|
|
144
144
|
* - Start collapsed (a saved state wins)
|
|
145
145
|
*/
|
|
146
|
-
collapsed?: boolean;
|
|
146
|
+
collapsed?: boolean | undefined;
|
|
147
147
|
/**
|
|
148
148
|
* - Storage key for the collapsed state (default `domma-card-<id>` when the card has an id)
|
|
149
149
|
*/
|
|
150
|
-
persistKey?: string | null;
|
|
150
|
+
persistKey?: string | null | undefined;
|
|
151
151
|
/**
|
|
152
152
|
* - Adds a `.card-header` with this title when the card has none
|
|
153
153
|
*/
|
|
154
|
-
title?: string;
|
|
154
|
+
title?: string | undefined;
|
|
155
155
|
/**
|
|
156
156
|
* - Icon name shown before the title
|
|
157
157
|
*/
|
|
158
|
-
icon?: string;
|
|
158
|
+
icon?: string | undefined;
|
|
159
159
|
/**
|
|
160
160
|
* - Body content: HTML (sanitised unless `safe: false`) or a Node
|
|
161
161
|
*/
|
|
162
|
-
content?: string | Node;
|
|
162
|
+
content?: string | Node | undefined;
|
|
163
163
|
/**
|
|
164
164
|
* - Sanitise string content
|
|
165
165
|
*/
|
|
166
|
-
safe?: boolean;
|
|
166
|
+
safe?: boolean | undefined;
|
|
167
167
|
/**
|
|
168
168
|
* - Clickable style (also on when `onClick` is given)
|
|
169
169
|
*/
|
|
170
|
-
clickable?: boolean;
|
|
170
|
+
clickable?: boolean | undefined;
|
|
171
171
|
/**
|
|
172
172
|
* - Colour variant, e.g. 'primary' adds `.card-primary`
|
|
173
173
|
*/
|
|
174
|
-
color?: string | null;
|
|
174
|
+
color?: string | null | undefined;
|
|
175
175
|
/**
|
|
176
176
|
* - After the body collapses
|
|
177
177
|
*/
|
|
178
|
-
onCollapse?: ((card: CardInstance) => void) | null;
|
|
178
|
+
onCollapse?: ((card: CardInstance) => void) | null | undefined;
|
|
179
179
|
/**
|
|
180
180
|
* - After the body expands
|
|
181
181
|
*/
|
|
182
|
-
onExpand?: ((card: CardInstance) => void) | null;
|
|
182
|
+
onExpand?: ((card: CardInstance) => void) | null | undefined;
|
|
183
183
|
/**
|
|
184
184
|
* - Click on the card (not a collapsing header click)
|
|
185
185
|
*/
|
|
186
|
-
onClick?: ((card: CardInstance, event: MouseEvent) => void) | null;
|
|
186
|
+
onClick?: ((card: CardInstance, event: MouseEvent) => void) | null | undefined;
|
|
187
187
|
};
|
|
188
188
|
export type CardInstance = Card;
|
|
189
189
|
import Component from '../component.js';
|