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
|
@@ -13,122 +13,122 @@ export type PopoverOptions = {
|
|
|
13
13
|
/**
|
|
14
14
|
* - Text (default), a Node, or a function returning either; see `html`
|
|
15
15
|
*/
|
|
16
|
-
content?: PopoverContent;
|
|
16
|
+
content?: PopoverContent | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* - Heading; empty for none
|
|
19
19
|
*/
|
|
20
|
-
title?: PopoverContent;
|
|
20
|
+
title?: PopoverContent | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* - Treat string content/title as HTML, passed through Domma's sanitiser (default: false)
|
|
23
23
|
*/
|
|
24
|
-
html?: boolean;
|
|
24
|
+
html?: boolean | undefined;
|
|
25
25
|
/**
|
|
26
26
|
* - 'click' (default), 'hover', 'focus', 'manual', or several separated by spaces
|
|
27
27
|
*/
|
|
28
|
-
trigger?: PopoverTrigger;
|
|
28
|
+
trigger?: PopoverTrigger | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* - Preferred side and alignment (default: 'bottom')
|
|
31
31
|
*/
|
|
32
|
-
placement?: PopoverPlacement;
|
|
32
|
+
placement?: PopoverPlacement | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* - Try the other sides when the preferred one has no room (default: true)
|
|
35
35
|
*/
|
|
36
|
-
flip?: boolean;
|
|
36
|
+
flip?: boolean | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* - Gap in px, or [crossAxis, mainAxis] (default: 10)
|
|
39
39
|
*/
|
|
40
|
-
offset?: number | [number, number];
|
|
40
|
+
offset?: number | [number, number] | undefined;
|
|
41
41
|
/**
|
|
42
42
|
* - Show the arrow (default: true)
|
|
43
43
|
*/
|
|
44
|
-
arrow?: boolean;
|
|
44
|
+
arrow?: boolean | undefined;
|
|
45
45
|
/**
|
|
46
46
|
* - Show a close (x) button (default: false)
|
|
47
47
|
*/
|
|
48
|
-
dismissible?: boolean;
|
|
48
|
+
dismissible?: boolean | undefined;
|
|
49
49
|
/**
|
|
50
50
|
* - Close on a pointer press or focus outside (default: true)
|
|
51
51
|
*/
|
|
52
|
-
closeOnOutside?: boolean;
|
|
52
|
+
closeOnOutside?: boolean | undefined;
|
|
53
53
|
/**
|
|
54
54
|
* - Close on Escape (default: true)
|
|
55
55
|
*/
|
|
56
|
-
closeOnEscape?: boolean;
|
|
56
|
+
closeOnEscape?: boolean | undefined;
|
|
57
57
|
/**
|
|
58
58
|
* - One open at a time per group; null = independent (default: 'default')
|
|
59
59
|
*/
|
|
60
|
-
group?: string | null;
|
|
60
|
+
group?: string | null | undefined;
|
|
61
61
|
/**
|
|
62
62
|
* - Any CSS width; numbers are px
|
|
63
63
|
*/
|
|
64
|
-
width?: string | number | null;
|
|
64
|
+
width?: string | number | null | undefined;
|
|
65
65
|
/**
|
|
66
66
|
* - Any CSS width; the stylesheet default is 20rem
|
|
67
67
|
*/
|
|
68
|
-
maxWidth?: string | number | null;
|
|
68
|
+
maxWidth?: string | number | null | undefined;
|
|
69
69
|
/**
|
|
70
70
|
* - Extra classes on the panel
|
|
71
71
|
*/
|
|
72
|
-
className?: string;
|
|
72
|
+
className?: string | undefined;
|
|
73
73
|
/**
|
|
74
74
|
* - Panel id (generated when omitted)
|
|
75
75
|
*/
|
|
76
|
-
id?: string | null;
|
|
76
|
+
id?: string | null | undefined;
|
|
77
77
|
/**
|
|
78
78
|
* - 'dialog', or 'tooltip' for hover/focus-only triggers (default: auto)
|
|
79
79
|
*/
|
|
80
|
-
role?: "dialog" | "tooltip" |
|
|
80
|
+
role?: (string & {}) | "dialog" | "tooltip" | null | undefined;
|
|
81
81
|
/**
|
|
82
82
|
* - Accessible name when there is no title
|
|
83
83
|
*/
|
|
84
|
-
ariaLabel?: string | null;
|
|
84
|
+
ariaLabel?: string | null | undefined;
|
|
85
85
|
/**
|
|
86
86
|
* - Move focus into the panel on open; null = for click popovers
|
|
87
87
|
*/
|
|
88
|
-
autoFocus?: boolean | null;
|
|
88
|
+
autoFocus?: boolean | null | undefined;
|
|
89
89
|
/**
|
|
90
90
|
* - Tab cycles inside the panel instead of leaving it, with a focus trap while focus is in it (default: false)
|
|
91
91
|
*/
|
|
92
|
-
trapFocus?: boolean;
|
|
92
|
+
trapFocus?: boolean | undefined;
|
|
93
93
|
/**
|
|
94
94
|
* - Hover delays in ms (default: {show: 80, hide: 120})
|
|
95
95
|
*/
|
|
96
96
|
delay?: number | {
|
|
97
97
|
show?: number;
|
|
98
98
|
hide?: number;
|
|
99
|
-
};
|
|
99
|
+
} | undefined;
|
|
100
100
|
/**
|
|
101
101
|
* - Fade and scale (default: true; skipped under reduced motion)
|
|
102
102
|
*/
|
|
103
|
-
animation?: boolean;
|
|
103
|
+
animation?: boolean | undefined;
|
|
104
104
|
/**
|
|
105
105
|
* - ms (default: 150)
|
|
106
106
|
*/
|
|
107
|
-
animationDuration?: number;
|
|
107
|
+
animationDuration?: number | undefined;
|
|
108
108
|
/**
|
|
109
109
|
* - Where the panel is placed (default: document.body)
|
|
110
110
|
*/
|
|
111
|
-
container?: string | HTMLElement | null;
|
|
111
|
+
container?: string | HTMLElement | null | undefined;
|
|
112
112
|
/**
|
|
113
113
|
* - Override the stylesheet's z-index (10045)
|
|
114
114
|
*/
|
|
115
|
-
zIndex?: number | null;
|
|
115
|
+
zIndex?: number | null | undefined;
|
|
116
116
|
/**
|
|
117
117
|
* - Before opening; return false to cancel
|
|
118
118
|
*/
|
|
119
|
-
onShow?: ((popover: Popover) => boolean | void) | null;
|
|
119
|
+
onShow?: ((popover: Popover) => boolean | void) | null | undefined;
|
|
120
120
|
/**
|
|
121
121
|
* - After the open transition
|
|
122
122
|
*/
|
|
123
|
-
onShown?: ((popover: Popover) => void) | null;
|
|
123
|
+
onShown?: ((popover: Popover) => void) | null | undefined;
|
|
124
124
|
/**
|
|
125
125
|
* - Before closing; return false to cancel
|
|
126
126
|
*/
|
|
127
|
-
onHide?: ((popover: Popover) => boolean | void) | null;
|
|
127
|
+
onHide?: ((popover: Popover) => boolean | void) | null | undefined;
|
|
128
128
|
/**
|
|
129
129
|
* - After the panel has been removed
|
|
130
130
|
*/
|
|
131
|
-
onHidden?: ((popover: Popover) => void) | null;
|
|
131
|
+
onHidden?: ((popover: Popover) => void) | null | undefined;
|
|
132
132
|
};
|
|
133
133
|
/**
|
|
134
134
|
* event.detail of dm:popover:show / shown / hide / hidden (bubbling, fired on the trigger).
|
|
@@ -257,19 +257,19 @@ declare class Popover extends Component {
|
|
|
257
257
|
*/
|
|
258
258
|
constructor(trigger: string | HTMLElement | ArrayLike<HTMLElement> | null, options?: PopoverOptions);
|
|
259
259
|
_open: boolean;
|
|
260
|
-
_panel: HTMLDivElement;
|
|
260
|
+
_panel: HTMLDivElement | null;
|
|
261
261
|
_parent: any;
|
|
262
262
|
_timers: {
|
|
263
|
-
show:
|
|
264
|
-
hide:
|
|
265
|
-
remove:
|
|
266
|
-
shown:
|
|
263
|
+
show: null;
|
|
264
|
+
hide: null;
|
|
265
|
+
remove: null;
|
|
266
|
+
shown: null;
|
|
267
267
|
};
|
|
268
268
|
_triggerHandlers: any[];
|
|
269
269
|
_openHandlers: any[];
|
|
270
|
-
_savedAttrs: {};
|
|
270
|
+
_savedAttrs: {} | null;
|
|
271
271
|
_frame: any;
|
|
272
|
-
_resizeObserver: ResizeObserver;
|
|
272
|
+
_resizeObserver: ResizeObserver | null;
|
|
273
273
|
_destroyed: boolean;
|
|
274
274
|
/** Panel id. @type {string} */
|
|
275
275
|
id: string;
|
|
@@ -277,12 +277,12 @@ declare class Popover extends Component {
|
|
|
277
277
|
* The panel element (created on first show).
|
|
278
278
|
* @returns {HTMLElement|null}
|
|
279
279
|
*/
|
|
280
|
-
get panel(): HTMLElement;
|
|
280
|
+
get panel(): HTMLElement | null;
|
|
281
281
|
/**
|
|
282
282
|
* The trigger element.
|
|
283
283
|
* @returns {HTMLElement|null}
|
|
284
284
|
*/
|
|
285
|
-
get trigger(): HTMLElement;
|
|
285
|
+
get trigger(): HTMLElement | null;
|
|
286
286
|
/** @returns {boolean} */
|
|
287
287
|
isOpen(): boolean;
|
|
288
288
|
/**
|
|
@@ -302,7 +302,7 @@ declare class Popover extends Component {
|
|
|
302
302
|
hide(opts?: {
|
|
303
303
|
returnFocus?: boolean;
|
|
304
304
|
}): this;
|
|
305
|
-
_returningFocus: boolean;
|
|
305
|
+
_returningFocus: boolean | undefined;
|
|
306
306
|
/**
|
|
307
307
|
* @param {{focus?: boolean, returnFocus?: boolean}} [opts]
|
|
308
308
|
* @returns {this}
|
|
@@ -349,13 +349,13 @@ declare class Popover extends Component {
|
|
|
349
349
|
* @returns {this}
|
|
350
350
|
*/
|
|
351
351
|
update(): this;
|
|
352
|
-
_trap: FocusTrap;
|
|
352
|
+
_trap: FocusTrap | null | undefined;
|
|
353
353
|
/**
|
|
354
354
|
* @param {PopoverOptions} [newOptions]
|
|
355
355
|
* @returns {this}
|
|
356
356
|
*/
|
|
357
357
|
setOptions(newOptions?: PopoverOptions): this;
|
|
358
|
-
_changedKeys: string[];
|
|
358
|
+
_changedKeys: string[] | null | undefined;
|
|
359
359
|
_applyOptions(): void;
|
|
360
360
|
_triggers(): string[];
|
|
361
361
|
_role(): any;
|
|
@@ -365,7 +365,7 @@ declare class Popover extends Component {
|
|
|
365
365
|
_unbindTrigger(): void;
|
|
366
366
|
_scheduleShow(ms: any): void;
|
|
367
367
|
/** `reason` is what asked: a popover a click opened (or claimed) ignores hover and focus leaving. */
|
|
368
|
-
_scheduleHide(ms: any, reason?:
|
|
368
|
+
_scheduleHide(ms: any, reason?: null): void;
|
|
369
369
|
_saveAttrs(): void;
|
|
370
370
|
_restoreAttrs(): void;
|
|
371
371
|
_applyTriggerAria(): void;
|
|
@@ -377,7 +377,7 @@ declare class Popover extends Component {
|
|
|
377
377
|
title: HTMLDivElement;
|
|
378
378
|
body: HTMLDivElement;
|
|
379
379
|
close: HTMLButtonElement;
|
|
380
|
-
};
|
|
380
|
+
} | undefined;
|
|
381
381
|
_styleNode(): void;
|
|
382
382
|
_render(): void;
|
|
383
383
|
_renderTitle(): void;
|
|
@@ -396,9 +396,9 @@ declare class Popover extends Component {
|
|
|
396
396
|
/** First tabbable in the content; the panel itself when there is none. */
|
|
397
397
|
_focusInside(): void;
|
|
398
398
|
_onPanelKeyDown(e: any): void;
|
|
399
|
-
_nextTabbableAfterTrigger(): HTMLElement;
|
|
399
|
+
_nextTabbableAfterTrigger(): HTMLElement | null;
|
|
400
400
|
_bindOpen(): void;
|
|
401
|
-
_frameIsTimeout: boolean;
|
|
401
|
+
_frameIsTimeout: boolean | undefined;
|
|
402
402
|
_unbindOpen(): void;
|
|
403
403
|
_contains(node: any): boolean;
|
|
404
404
|
_isAncestorOf(other: any): boolean;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export namespace router {
|
|
2
|
-
let _routes:
|
|
2
|
+
let _routes: never[];
|
|
3
3
|
let _views: {};
|
|
4
|
-
let _currentRoute:
|
|
5
|
-
let _container:
|
|
4
|
+
let _currentRoute: null;
|
|
5
|
+
let _container: null;
|
|
6
6
|
let _defaultRoute: string;
|
|
7
|
-
let _notFoundView:
|
|
8
|
-
let _middleware:
|
|
7
|
+
let _notFoundView: null;
|
|
8
|
+
let _middleware: never[];
|
|
9
9
|
let _transitioning: boolean;
|
|
10
10
|
let _routing: boolean;
|
|
11
11
|
let _missedChange: boolean;
|
|
12
|
-
let _shownPath:
|
|
12
|
+
let _shownPath: null;
|
|
13
13
|
let _transitions: {};
|
|
14
14
|
let _initialised: boolean;
|
|
15
15
|
let _templateCache: {};
|
|
@@ -142,12 +142,12 @@ export namespace router {
|
|
|
142
142
|
};
|
|
143
143
|
function _decode(segment: any): any;
|
|
144
144
|
function _matchRoute(path: any): {
|
|
145
|
-
route:
|
|
145
|
+
route: null;
|
|
146
146
|
params: {};
|
|
147
147
|
};
|
|
148
|
-
function _extractParams(pattern: any, path: any): {};
|
|
148
|
+
function _extractParams(pattern: any, path: any): {} | null;
|
|
149
149
|
function _runMiddleware(to: any, from: any): Promise<boolean | {
|
|
150
|
-
redirect:
|
|
150
|
+
redirect: never;
|
|
151
151
|
}>;
|
|
152
152
|
function _renderView(viewName: any, params: any): Promise<void>;
|
|
153
153
|
function _showContainer(): void;
|
|
@@ -180,19 +180,19 @@ export type RouteDefinition = {
|
|
|
180
180
|
/**
|
|
181
181
|
* - Sets `document.title` when the route is entered
|
|
182
182
|
*/
|
|
183
|
-
title?: string;
|
|
183
|
+
title?: string | undefined;
|
|
184
184
|
/**
|
|
185
185
|
* - Runs before the view renders (may be async). Returning (or resolving to) `false` cancels the change and puts the address back
|
|
186
186
|
*/
|
|
187
|
-
onEnter?: (params: RouteParams, to: Route) => unknown;
|
|
187
|
+
onEnter?: ((params: RouteParams, to: Route) => unknown) | undefined;
|
|
188
188
|
/**
|
|
189
189
|
* - Runs when leaving this route (may be async). Returning (or resolving to) `false` cancels the change
|
|
190
190
|
*/
|
|
191
|
-
onLeave?: () => unknown;
|
|
191
|
+
onLeave?: (() => unknown) | undefined;
|
|
192
192
|
/**
|
|
193
193
|
* - Custom metadata, e.g. `{requiresAuth: true}` for a middleware to read
|
|
194
194
|
*/
|
|
195
|
-
meta?: Record<string, any
|
|
195
|
+
meta?: Record<string, any> | undefined;
|
|
196
196
|
};
|
|
197
197
|
/**
|
|
198
198
|
* The route being entered or currently shown (`R.current()`, a middleware's `to`/`from`):
|
|
@@ -215,19 +215,19 @@ export type ViewDefinition = {
|
|
|
215
215
|
/**
|
|
216
216
|
* - Inline template, or a function returning the HTML
|
|
217
217
|
*/
|
|
218
|
-
template?: string | ViewRenderFunction;
|
|
218
|
+
template?: string | ViewRenderFunction | undefined;
|
|
219
219
|
/**
|
|
220
220
|
* - URL of a template file, fetched once and cached (used when `template` is not set)
|
|
221
221
|
*/
|
|
222
|
-
templateUrl?: string;
|
|
222
|
+
templateUrl?: string | undefined;
|
|
223
223
|
/**
|
|
224
224
|
* - Partial name -> template URL, each fetched and cached
|
|
225
225
|
*/
|
|
226
|
-
partials?: Record<string, string
|
|
226
|
+
partials?: Record<string, string> | undefined;
|
|
227
227
|
/**
|
|
228
228
|
* - Called after the view's HTML is in the container
|
|
229
229
|
*/
|
|
230
|
-
onMount?: ($container: import("./dom.js").DommaCollection) => void;
|
|
230
|
+
onMount?: (($container: import("./dom.js").DommaCollection) => void) | undefined;
|
|
231
231
|
};
|
|
232
232
|
/**
|
|
233
233
|
* A view that renders a standalone component (`Domma.component()`): the container is emptied and
|
|
@@ -242,11 +242,11 @@ export type ComponentViewDefinition = {
|
|
|
242
242
|
/**
|
|
243
243
|
* - Props, or a function of the route params returning them
|
|
244
244
|
*/
|
|
245
|
-
props?: Record<string, any> | ((params: RouteParams) => Record<string, any>);
|
|
245
|
+
props?: Record<string, any> | ((params: RouteParams) => Record<string, any>) | undefined;
|
|
246
246
|
/**
|
|
247
247
|
* - Called after the element is appended
|
|
248
248
|
*/
|
|
249
|
-
onMount?: ($container: import("./dom.js").DommaCollection) => void;
|
|
249
|
+
onMount?: (($container: import("./dom.js").DommaCollection) => void) | undefined;
|
|
250
250
|
};
|
|
251
251
|
/**
|
|
252
252
|
* Anything `R.view()` / `R.init({views})` accepts: a template string, a render function, a view
|
|
@@ -260,15 +260,15 @@ export type RouterTransitions = {
|
|
|
260
260
|
/**
|
|
261
261
|
* - Enter animation
|
|
262
262
|
*/
|
|
263
|
-
enter?: string;
|
|
263
|
+
enter?: string | undefined;
|
|
264
264
|
/**
|
|
265
265
|
* - Leave animation
|
|
266
266
|
*/
|
|
267
|
-
leave?: string;
|
|
267
|
+
leave?: string | undefined;
|
|
268
268
|
/**
|
|
269
269
|
* - Animation duration in ms
|
|
270
270
|
*/
|
|
271
|
-
duration?: number;
|
|
271
|
+
duration?: number | undefined;
|
|
272
272
|
};
|
|
273
273
|
/**
|
|
274
274
|
* Options for `R.init()`.
|
|
@@ -281,23 +281,23 @@ export type RouterOptions = {
|
|
|
281
281
|
/**
|
|
282
282
|
* - Route definitions
|
|
283
283
|
*/
|
|
284
|
-
routes?: RouteDefinition[];
|
|
284
|
+
routes?: RouteDefinition[] | undefined;
|
|
285
285
|
/**
|
|
286
286
|
* - View registry `{name: view}`
|
|
287
287
|
*/
|
|
288
|
-
views?: Record<string, RouterView
|
|
288
|
+
views?: Record<string, RouterView> | undefined;
|
|
289
289
|
/**
|
|
290
290
|
* - Route used when the address has no hash
|
|
291
291
|
*/
|
|
292
|
-
default?: string;
|
|
292
|
+
default?: string | undefined;
|
|
293
293
|
/**
|
|
294
294
|
* - Name of the view rendered for an address no route matches
|
|
295
295
|
*/
|
|
296
|
-
notFound?: string;
|
|
296
|
+
notFound?: string | undefined;
|
|
297
297
|
/**
|
|
298
298
|
* - Transition animation options (replaces the defaults as a whole)
|
|
299
299
|
*/
|
|
300
|
-
transitions?: RouterTransitions;
|
|
300
|
+
transitions?: RouterTransitions | undefined;
|
|
301
301
|
};
|
|
302
302
|
/**
|
|
303
303
|
* Options for `R.navigate()`.
|
|
@@ -306,13 +306,13 @@ export type NavigateOptions = {
|
|
|
306
306
|
/**
|
|
307
307
|
* - Replace the current history entry instead of adding one
|
|
308
308
|
*/
|
|
309
|
-
replace?: boolean;
|
|
309
|
+
replace?: boolean | undefined;
|
|
310
310
|
};
|
|
311
311
|
/**
|
|
312
312
|
* A middleware's `next`: call it to let the change go ahead, or with a path to go there instead
|
|
313
313
|
* (replacing the refused entry). Not calling it refuses the change.
|
|
314
314
|
*/
|
|
315
|
-
export type RouterNext = (redirect?: string) => void;
|
|
315
|
+
export type RouterNext = (redirect?: string | undefined) => void;
|
|
316
316
|
/**
|
|
317
317
|
* A middleware, run in order before every route change (may be async).
|
|
318
318
|
*/
|
|
@@ -336,7 +336,7 @@ export type RouterErrorEvent = {
|
|
|
336
336
|
/**
|
|
337
337
|
* - The view being rendered, when the failure was in a render
|
|
338
338
|
*/
|
|
339
|
-
view?: string;
|
|
339
|
+
view?: string | undefined;
|
|
340
340
|
};
|
|
341
341
|
/**
|
|
342
342
|
* The router (`R`, `Domma.router`).
|
|
@@ -35,7 +35,15 @@ export function escape(text: string): string;
|
|
|
35
35
|
* @returns {boolean}
|
|
36
36
|
*/
|
|
37
37
|
export function hasDOMPurify(): boolean;
|
|
38
|
-
declare const _default:
|
|
38
|
+
declare const _default: {
|
|
39
|
+
sanitise: typeof sanitise;
|
|
40
|
+
sanitiseBasic: typeof sanitiseBasic;
|
|
41
|
+
sanitiseUserContent: typeof sanitiseUserContent;
|
|
42
|
+
escape: typeof escape;
|
|
43
|
+
hasDOMPurify: typeof hasDOMPurify;
|
|
44
|
+
isSafeUrl: typeof isSafeUrl;
|
|
45
|
+
safeUrl: typeof safeUrl;
|
|
46
|
+
};
|
|
39
47
|
export default _default;
|
|
40
48
|
/**
|
|
41
49
|
* Options for `sanitise()`. Used only when DOMPurify is loaded; without it the input is
|
|
@@ -45,19 +53,19 @@ export type SanitiseOptions = {
|
|
|
45
53
|
/**
|
|
46
54
|
* - Allowlist preset ('default', 'strict', 'basic')
|
|
47
55
|
*/
|
|
48
|
-
preset?: "default" | "strict" | "basic";
|
|
56
|
+
preset?: "default" | "strict" | "basic" | undefined;
|
|
49
57
|
/**
|
|
50
58
|
* - Custom allowed tags (overrides preset)
|
|
51
59
|
*/
|
|
52
|
-
allowedTags?: string[];
|
|
60
|
+
allowedTags?: string[] | undefined;
|
|
53
61
|
/**
|
|
54
62
|
* - Custom allowed attributes (overrides preset)
|
|
55
63
|
*/
|
|
56
|
-
allowedAttrs?: string[];
|
|
64
|
+
allowedAttrs?: string[] | undefined;
|
|
57
65
|
/**
|
|
58
66
|
* - Allow data-* attributes
|
|
59
67
|
*/
|
|
60
|
-
allowDataAttrs?: boolean;
|
|
68
|
+
allowDataAttrs?: boolean | undefined;
|
|
61
69
|
};
|
|
62
70
|
/**
|
|
63
71
|
* The sanitise module (`Domma.sanitize`).
|
|
@@ -77,19 +77,19 @@ export type InputExtrasLabels = {
|
|
|
77
77
|
/**
|
|
78
78
|
* - Default 'Show password'
|
|
79
79
|
*/
|
|
80
|
-
reveal?: string;
|
|
80
|
+
reveal?: string | undefined;
|
|
81
81
|
/**
|
|
82
82
|
* - Default 'Clear'
|
|
83
83
|
*/
|
|
84
|
-
clear?: string;
|
|
84
|
+
clear?: string | undefined;
|
|
85
85
|
/**
|
|
86
86
|
* - Default 'Decrease'
|
|
87
87
|
*/
|
|
88
|
-
decrease?: string;
|
|
88
|
+
decrease?: string | undefined;
|
|
89
89
|
/**
|
|
90
90
|
* - Default 'Increase'
|
|
91
91
|
*/
|
|
92
|
-
increase?: string;
|
|
92
|
+
increase?: string | undefined;
|
|
93
93
|
};
|
|
94
94
|
/**
|
|
95
95
|
* How a field is presented (`field.formConfig`). The preview hands the blueprint to `F.create`, so every
|
|
@@ -110,11 +110,11 @@ export type FieldDefinition = {
|
|
|
110
110
|
/**
|
|
111
111
|
* - Field name (getFields() / templates; not present in blueprints)
|
|
112
112
|
*/
|
|
113
|
-
name?: string;
|
|
113
|
+
name?: string | undefined;
|
|
114
114
|
/**
|
|
115
115
|
* - Is field required?
|
|
116
116
|
*/
|
|
117
|
-
required?: boolean;
|
|
117
|
+
required?: boolean | undefined;
|
|
118
118
|
/**
|
|
119
119
|
* - Default value
|
|
120
120
|
*/
|
|
@@ -122,63 +122,63 @@ export type FieldDefinition = {
|
|
|
122
122
|
/**
|
|
123
123
|
* - Minimum string length
|
|
124
124
|
*/
|
|
125
|
-
minLength?: number | null;
|
|
125
|
+
minLength?: number | null | undefined;
|
|
126
126
|
/**
|
|
127
127
|
* - Maximum string length
|
|
128
128
|
*/
|
|
129
|
-
maxLength?: number | null;
|
|
129
|
+
maxLength?: number | null | undefined;
|
|
130
130
|
/**
|
|
131
131
|
* - Regex pattern for validation
|
|
132
132
|
*/
|
|
133
|
-
pattern?: RegExp |
|
|
133
|
+
pattern?: string | RegExp | undefined;
|
|
134
134
|
/**
|
|
135
135
|
* - Minimum numeric value
|
|
136
136
|
*/
|
|
137
|
-
min?: number | null;
|
|
137
|
+
min?: number | null | undefined;
|
|
138
138
|
/**
|
|
139
139
|
* - Maximum numeric value
|
|
140
140
|
*/
|
|
141
|
-
max?: number | null;
|
|
141
|
+
max?: number | null | undefined;
|
|
142
142
|
/**
|
|
143
143
|
* - Step increment for number / range inputs
|
|
144
144
|
*/
|
|
145
|
-
step?: number;
|
|
145
|
+
step?: number | undefined;
|
|
146
146
|
/**
|
|
147
147
|
* - Options for select, multiselect, radio, checkbox-group
|
|
148
148
|
*/
|
|
149
|
-
options?:
|
|
149
|
+
options?: string[] | FieldOption[] | undefined;
|
|
150
150
|
/**
|
|
151
151
|
* - Custom validation: true passes, a string is the error
|
|
152
152
|
*/
|
|
153
|
-
validate?: (value: any) => boolean | string;
|
|
153
|
+
validate?: ((value: any) => boolean | string) | undefined;
|
|
154
154
|
/**
|
|
155
155
|
* - file: accepted types
|
|
156
156
|
*/
|
|
157
|
-
accept?: string;
|
|
157
|
+
accept?: string | undefined;
|
|
158
158
|
/**
|
|
159
159
|
* - file: allow several files
|
|
160
160
|
*/
|
|
161
|
-
multiple?: boolean;
|
|
161
|
+
multiple?: boolean | undefined;
|
|
162
162
|
/**
|
|
163
163
|
* - Display label
|
|
164
164
|
*/
|
|
165
|
-
label?: string;
|
|
165
|
+
label?: string | undefined;
|
|
166
166
|
/**
|
|
167
167
|
* - Input placeholder
|
|
168
168
|
*/
|
|
169
|
-
placeholder?: string;
|
|
169
|
+
placeholder?: string | undefined;
|
|
170
170
|
/**
|
|
171
171
|
* - Help text displayed below the field
|
|
172
172
|
*/
|
|
173
|
-
help?: string;
|
|
173
|
+
help?: string | undefined;
|
|
174
174
|
/**
|
|
175
175
|
* - Disable the field
|
|
176
176
|
*/
|
|
177
|
-
disabled?: boolean;
|
|
177
|
+
disabled?: boolean | undefined;
|
|
178
178
|
/**
|
|
179
179
|
* - Form configuration
|
|
180
180
|
*/
|
|
181
|
-
formConfig?: FormConfig;
|
|
181
|
+
formConfig?: FormConfig | undefined;
|
|
182
182
|
};
|
|
183
183
|
/**
|
|
184
184
|
* A blueprint: field name -> definition.
|
|
@@ -229,38 +229,38 @@ export type SchemaBuilderOptions = {
|
|
|
229
229
|
/**
|
|
230
230
|
* - Theme variant (default 'light')
|
|
231
231
|
*/
|
|
232
|
-
theme?: "light" | "dark";
|
|
232
|
+
theme?: "light" | "dark" | undefined;
|
|
233
233
|
/**
|
|
234
234
|
* - Auto-save the active schema to localStorage (default true)
|
|
235
235
|
*/
|
|
236
|
-
autoSave?: boolean;
|
|
236
|
+
autoSave?: boolean | undefined;
|
|
237
237
|
/**
|
|
238
238
|
* - Auto-save interval in milliseconds (default 30000)
|
|
239
239
|
*/
|
|
240
|
-
autoSaveInterval?: number;
|
|
240
|
+
autoSaveInterval?: number | undefined;
|
|
241
241
|
/**
|
|
242
242
|
* - Show the live preview panel on start (default true)
|
|
243
243
|
*/
|
|
244
|
-
showPreview?: boolean;
|
|
244
|
+
showPreview?: boolean | undefined;
|
|
245
245
|
/**
|
|
246
246
|
* - Preview form layout (default 'stacked')
|
|
247
247
|
*/
|
|
248
|
-
previewLayout?: PreviewLayout;
|
|
248
|
+
previewLayout?: PreviewLayout | undefined;
|
|
249
249
|
/**
|
|
250
250
|
* - Called when the schema changes
|
|
251
251
|
*/
|
|
252
|
-
onChange?: ((fields: FieldDefinition[]) => void) | null;
|
|
252
|
+
onChange?: ((fields: FieldDefinition[]) => void) | null | undefined;
|
|
253
253
|
/**
|
|
254
254
|
* - Called when a template is saved
|
|
255
255
|
*/
|
|
256
256
|
onSave?: ((name: string, schema: {
|
|
257
257
|
name: string;
|
|
258
258
|
fields: FieldDefinition[];
|
|
259
|
-
}) => void) | null;
|
|
259
|
+
}) => void) | null | undefined;
|
|
260
260
|
/**
|
|
261
261
|
* - Called on every export
|
|
262
262
|
*/
|
|
263
|
-
onExport?: ((format: ExportFormat, data: string) => void) | null;
|
|
263
|
+
onExport?: ((format: ExportFormat, data: string) => void) | null | undefined;
|
|
264
264
|
};
|
|
265
265
|
/**
|
|
266
266
|
* Options for `exportJS()`. None are read at present.
|
|
@@ -277,12 +277,12 @@ export type ExportTypeScriptOptions = {
|
|
|
277
277
|
/**
|
|
278
278
|
* - TypeScript interface name (default 'FormData')
|
|
279
279
|
*/
|
|
280
|
-
interfaceName?: string;
|
|
280
|
+
interfaceName?: string | undefined;
|
|
281
281
|
};
|
|
282
282
|
/**
|
|
283
283
|
* Create a Schema Builder instance (`E.schemaBuilder`).
|
|
284
284
|
*/
|
|
285
|
-
export type SchemaBuilderFactory = (selector: string | HTMLElement, options?: SchemaBuilderOptions) => SchemaBuilderInstance;
|
|
285
|
+
export type SchemaBuilderFactory = (selector: string | HTMLElement, options?: SchemaBuilderOptions | undefined) => SchemaBuilderInstance;
|
|
286
286
|
export type SchemaBuilderInstance = SchemaBuilder;
|
|
287
287
|
/**
|
|
288
288
|
* Visual drag-and-drop blueprint designer.
|
|
@@ -300,8 +300,8 @@ export class SchemaBuilder extends Component {
|
|
|
300
300
|
_selectedIndex: number;
|
|
301
301
|
_schemaName: string;
|
|
302
302
|
_isDirty: boolean;
|
|
303
|
-
_dragSource: string;
|
|
304
|
-
_autoSaveTimer: number;
|
|
303
|
+
_dragSource: string | null;
|
|
304
|
+
_autoSaveTimer: number | null;
|
|
305
305
|
_previewForm: any;
|
|
306
306
|
_refs: {};
|
|
307
307
|
_init(): void;
|
|
@@ -405,7 +405,7 @@ export class SchemaBuilder extends Component {
|
|
|
405
405
|
* @returns {this}
|
|
406
406
|
*/
|
|
407
407
|
setPreviewLayout(layout: PreviewLayout): this;
|
|
408
|
-
_togglePreview(): this;
|
|
408
|
+
_togglePreview(): this | undefined;
|
|
409
409
|
_toBlueprint(): {};
|
|
410
410
|
_mapToTSType(type: any): any;
|
|
411
411
|
_showSaveModal(): void;
|