@sveltia/ui 0.15.16 → 0.17.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/package/components/alert/alert.svelte +22 -7
- package/package/components/alert/alert.svelte.d.ts +47 -31
- package/package/components/button/button-group.svelte +16 -6
- package/package/components/button/button-group.svelte.d.ts +38 -28
- package/package/components/button/button.svelte +41 -136
- package/package/components/button/button.svelte.d.ts +20 -162
- package/package/components/button/select-button-group.svelte +31 -37
- package/package/components/button/select-button-group.svelte.d.ts +91 -39
- package/package/components/button/select-button.svelte +19 -62
- package/package/components/button/select-button.svelte.d.ts +31 -65
- package/package/components/button/split-button.svelte +37 -47
- package/package/components/button/split-button.svelte.d.ts +54 -60
- package/package/components/calendar/calendar.svelte +80 -55
- package/package/components/calendar/calendar.svelte.d.ts +30 -26
- package/package/components/checkbox/checkbox-group.svelte +23 -20
- package/package/components/checkbox/checkbox-group.svelte.d.ts +64 -32
- package/package/components/checkbox/checkbox.svelte +57 -67
- package/package/components/checkbox/checkbox.svelte.d.ts +81 -53
- package/package/components/dialog/alert-dialog.svelte +9 -36
- package/package/components/dialog/alert-dialog.svelte.d.ts +20 -49
- package/package/components/dialog/confirmation-dialog.svelte +9 -41
- package/package/components/dialog/confirmation-dialog.svelte.d.ts +20 -51
- package/package/components/dialog/dialog.svelte +60 -105
- package/package/components/dialog/dialog.svelte.d.ts +19 -86
- package/package/components/dialog/prompt-dialog.svelte +32 -61
- package/package/components/dialog/prompt-dialog.svelte.d.ts +53 -65
- package/package/components/disclosure/disclosure.svelte +39 -34
- package/package/components/disclosure/disclosure.svelte.d.ts +88 -57
- package/package/components/divider/divider.svelte +18 -14
- package/package/components/divider/divider.svelte.d.ts +48 -26
- package/package/components/divider/spacer.svelte +13 -8
- package/package/components/divider/spacer.svelte.d.ts +37 -25
- package/package/components/drawer/drawer.svelte +63 -76
- package/package/components/drawer/drawer.svelte.d.ts +116 -70
- package/package/components/grid/grid-body.svelte +15 -10
- package/package/components/grid/grid-body.svelte.d.ts +45 -29
- package/package/components/grid/grid-cell.svelte +16 -6
- package/package/components/grid/grid-cell.svelte.d.ts +38 -28
- package/package/components/grid/grid-col-header.svelte +16 -6
- package/package/components/grid/grid-col-header.svelte.d.ts +38 -28
- package/package/components/grid/grid-foot.svelte +16 -6
- package/package/components/grid/grid-foot.svelte.d.ts +38 -28
- package/package/components/grid/grid-head.svelte +16 -6
- package/package/components/grid/grid-head.svelte.d.ts +38 -28
- package/package/components/grid/grid-row-header.svelte +16 -6
- package/package/components/grid/grid-row-header.svelte.d.ts +38 -28
- package/package/components/grid/grid-row.svelte +19 -23
- package/package/components/grid/grid-row.svelte.d.ts +63 -43
- package/package/components/grid/grid.svelte +26 -25
- package/package/components/grid/grid.svelte.d.ts +71 -37
- package/package/components/icon/icon.svelte +14 -9
- package/package/components/icon/icon.svelte.d.ts +37 -25
- package/package/components/listbox/listbox.svelte +46 -52
- package/package/components/listbox/listbox.svelte.d.ts +117 -45
- package/package/components/listbox/option-group.svelte +23 -19
- package/package/components/listbox/option-group.svelte.d.ts +64 -32
- package/package/components/listbox/option.svelte +44 -57
- package/package/components/listbox/option.svelte.d.ts +68 -74
- package/package/components/menu/menu-button.svelte +42 -63
- package/package/components/menu/menu-button.svelte.d.ts +35 -62
- package/package/components/menu/menu-item-checkbox.svelte +29 -41
- package/package/components/menu/menu-item-checkbox.svelte.d.ts +20 -49
- package/package/components/menu/menu-item-group.svelte +22 -19
- package/package/components/menu/menu-item-group.svelte.d.ts +56 -32
- package/package/components/menu/menu-item-radio.svelte +29 -41
- package/package/components/menu/menu-item-radio.svelte.d.ts +20 -49
- package/package/components/menu/menu-item.svelte +66 -75
- package/package/components/menu/menu-item.svelte.d.ts +19 -68
- package/package/components/menu/menu.svelte +25 -22
- package/package/components/menu/menu.svelte.d.ts +65 -35
- package/package/components/radio/radio-group.svelte +36 -42
- package/package/components/radio/radio-group.svelte.d.ts +100 -40
- package/package/components/radio/radio.svelte +45 -48
- package/package/components/radio/radio.svelte.d.ts +111 -47
- package/package/components/select/combobox.svelte +76 -101
- package/package/components/select/combobox.svelte.d.ts +19 -54
- package/package/components/select/select-tags.svelte +48 -59
- package/package/components/select/select-tags.svelte.d.ts +127 -45
- package/package/components/select/select.svelte +18 -37
- package/package/components/select/select.svelte.d.ts +20 -45
- package/package/components/slider/slider.svelte +71 -68
- package/package/components/slider/slider.svelte.d.ts +159 -47
- package/package/components/switch/switch.svelte +36 -46
- package/package/components/switch/switch.svelte.d.ts +98 -42
- package/package/components/table/table-body.svelte +15 -11
- package/package/components/table/table-body.svelte.d.ts +45 -29
- package/package/components/table/table-cell.svelte +16 -6
- package/package/components/table/table-cell.svelte.d.ts +38 -28
- package/package/components/table/table-col-header.svelte +16 -6
- package/package/components/table/table-col-header.svelte.d.ts +38 -28
- package/package/components/table/table-foot.svelte +16 -6
- package/package/components/table/table-foot.svelte.d.ts +38 -28
- package/package/components/table/table-head.svelte +16 -6
- package/package/components/table/table-head.svelte.d.ts +38 -28
- package/package/components/table/table-row-header.svelte +16 -6
- package/package/components/table/table-row-header.svelte.d.ts +38 -28
- package/package/components/table/table-row.svelte +16 -6
- package/package/components/table/table-row.svelte.d.ts +38 -28
- package/package/components/table/table.svelte +16 -6
- package/package/components/table/table.svelte.d.ts +38 -28
- package/package/components/tabs/tab-box.svelte +16 -9
- package/package/components/tabs/tab-box.svelte.d.ts +47 -27
- package/package/components/tabs/tab-list.svelte +36 -35
- package/package/components/tabs/tab-list.svelte.d.ts +80 -38
- package/package/components/tabs/tab-panel.svelte +16 -6
- package/package/components/tabs/tab-panel.svelte.d.ts +38 -28
- package/package/components/tabs/tab-panels.svelte +16 -6
- package/package/components/tabs/tab-panels.svelte.d.ts +38 -26
- package/package/components/tabs/tab.svelte +28 -25
- package/package/components/tabs/tab.svelte.d.ts +31 -55
- package/package/components/text-editor/lexical-root.svelte +38 -32
- package/package/components/text-editor/lexical-root.svelte.d.ts +91 -29
- package/package/components/text-editor/text-editor.svelte +63 -79
- package/package/components/text-editor/text-editor.svelte.d.ts +114 -36
- package/package/components/text-editor/toolbar/editor-toolbar.svelte +41 -24
- package/package/components/text-editor/toolbar/editor-toolbar.svelte.d.ts +49 -23
- package/package/components/text-editor/toolbar/format-text-button.svelte +15 -5
- package/package/components/text-editor/toolbar/format-text-button.svelte.d.ts +30 -22
- package/package/components/text-editor/toolbar/insert-link-button.svelte +18 -16
- package/package/components/text-editor/toolbar/insert-link-button.svelte.d.ts +20 -23
- package/package/components/text-editor/toolbar/toggle-block-menu-item.svelte +19 -7
- package/package/components/text-editor/toolbar/toggle-block-menu-item.svelte.d.ts +30 -22
- package/package/components/text-field/number-input.svelte +63 -81
- package/package/components/text-field/number-input.svelte.d.ts +62 -68
- package/package/components/text-field/password-input.svelte +38 -57
- package/package/components/text-field/password-input.svelte.d.ts +30 -58
- package/package/components/text-field/search-bar.svelte +45 -62
- package/package/components/text-field/search-bar.svelte.d.ts +42 -87
- package/package/components/text-field/text-area.svelte +38 -54
- package/package/components/text-field/text-area.svelte.d.ts +116 -50
- package/package/components/text-field/text-input.svelte +30 -86
- package/package/components/text-field/text-input.svelte.d.ts +20 -105
- package/package/components/toast/toast.svelte +36 -30
- package/package/components/toast/toast.svelte.d.ts +65 -33
- package/package/components/toolbar/toolbar.svelte +25 -25
- package/package/components/toolbar/toolbar.svelte.d.ts +72 -34
- package/package/components/util/app-shell.svelte +22 -10
- package/package/components/util/app-shell.svelte.d.ts +40 -34
- package/package/components/util/group.svelte +20 -15
- package/package/components/util/group.svelte.d.ts +55 -31
- package/package/components/util/modal.svelte +89 -105
- package/package/components/util/modal.svelte.d.ts +24 -82
- package/package/components/util/placeholder.svelte +21 -0
- package/package/components/util/placeholder.svelte.d.ts +34 -0
- package/package/components/util/popup.svelte +65 -62
- package/package/components/util/popup.svelte.d.ts +104 -82
- package/package/services/{group.js → group.svelte.js} +11 -12
- package/package/services/{popup.js → popup.svelte.js} +6 -5
- package/package/typedefs.d.ts +545 -0
- package/package/typedefs.js +202 -0
- package/package.json +16 -23
- package/package/components/util/portal.svelte +0 -36
- package/package/components/util/portal.svelte.d.ts +0 -32
- /package/package/services/{events.d.ts → events.svelte.d.ts} +0 -0
- /package/package/services/{events.js → events.svelte.js} +0 -0
- /package/package/services/{group.d.ts → group.svelte.d.ts} +0 -0
- /package/package/services/{popup.d.ts → popup.svelte.d.ts} +0 -0
|
@@ -1,65 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default Checkbox;
|
|
2
|
+
type Checkbox = SvelteComponent<ButtonProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "checked" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* The equivalent of the HTML `<input type="checkbox">` element.
|
|
6
9
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox
|
|
7
10
|
* @see https://w3c.github.io/aria/#checkbox
|
|
8
11
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/
|
|
9
12
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
declare const Checkbox: $$__sveltets_2_IsomorphicComponent<import("../../typedefs").ButtonProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & {
|
|
14
|
+
/**
|
|
15
|
+
* - The `class` attribute on the wrapper element.
|
|
16
|
+
*/
|
|
12
17
|
class?: string | undefined;
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
/**
|
|
19
|
+
* - Whether to mark the widget required. An alias of the
|
|
20
|
+
* `aria-required` attribute.
|
|
21
|
+
*/
|
|
22
|
+
required?: boolean | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
25
|
+
* `aria-invalid` attribute.
|
|
26
|
+
*/
|
|
15
27
|
invalid?: boolean | undefined;
|
|
16
|
-
|
|
28
|
+
/**
|
|
29
|
+
* - Whether to check the widget. An alias of the
|
|
30
|
+
* `aria-checked` attribute.
|
|
31
|
+
*/
|
|
17
32
|
checked?: boolean | "mixed" | undefined;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
/**
|
|
34
|
+
* - Text label displayed next to the checkbox.
|
|
35
|
+
*/
|
|
36
|
+
label?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* - `aria-label` attribute.
|
|
39
|
+
*/
|
|
40
|
+
"aria-label"?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* - Check icon slot content.
|
|
43
|
+
*/
|
|
44
|
+
checkIcon?: import("svelte").Snippet<[]> | undefined;
|
|
45
|
+
} & Record<string, any>, {
|
|
25
46
|
[evt: string]: CustomEvent<any>;
|
|
26
|
-
}, {
|
|
27
|
-
|
|
28
|
-
|
|
47
|
+
}, {}, {}, "checked">;
|
|
48
|
+
type Props = {
|
|
49
|
+
/**
|
|
50
|
+
* - The `class` attribute on the wrapper element.
|
|
51
|
+
*/
|
|
52
|
+
class?: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* - Whether to mark the widget required. An alias of the
|
|
55
|
+
* `aria-required` attribute.
|
|
56
|
+
*/
|
|
57
|
+
required?: boolean | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
60
|
+
* `aria-invalid` attribute.
|
|
61
|
+
*/
|
|
62
|
+
invalid?: boolean | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* - Whether to check the widget. An alias of the
|
|
65
|
+
* `aria-checked` attribute.
|
|
66
|
+
*/
|
|
67
|
+
checked?: boolean | "mixed" | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* - Text label displayed next to the checkbox.
|
|
70
|
+
*/
|
|
71
|
+
label?: string | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* - `aria-label` attribute.
|
|
74
|
+
*/
|
|
75
|
+
"aria-label"?: string | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* - Check icon slot content.
|
|
78
|
+
*/
|
|
79
|
+
checkIcon?: import("svelte").Snippet<[]> | undefined;
|
|
80
|
+
};
|
|
81
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
82
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
83
|
+
$$bindings?: Bindings;
|
|
84
|
+
} & Exports;
|
|
85
|
+
(internal: unknown, props: Props & {
|
|
86
|
+
$$events?: Events;
|
|
87
|
+
$$slots?: Slots;
|
|
88
|
+
}): Exports & {
|
|
89
|
+
$set?: any;
|
|
90
|
+
$on?: any;
|
|
29
91
|
};
|
|
30
|
-
|
|
31
|
-
}> {
|
|
92
|
+
z_$$bindings?: Bindings;
|
|
32
93
|
}
|
|
33
|
-
export type CheckboxProps = typeof __propDef.props;
|
|
34
|
-
export type CheckboxEvents = typeof __propDef.events;
|
|
35
|
-
export type CheckboxSlots = typeof __propDef.slots;
|
|
36
|
-
import { SvelteComponent } from "svelte";
|
|
37
|
-
declare const __propDef: {
|
|
38
|
-
props: {
|
|
39
|
-
[x: string]: any;
|
|
40
|
-
class?: string | undefined;
|
|
41
|
-
name?: string | undefined;
|
|
42
|
-
disabled?: boolean | undefined;
|
|
43
|
-
invalid?: boolean | undefined;
|
|
44
|
-
label?: string | undefined;
|
|
45
|
-
checked?: boolean | "mixed" | undefined;
|
|
46
|
-
required?: boolean | undefined;
|
|
47
|
-
value?: string | undefined;
|
|
48
|
-
hidden?: boolean | undefined;
|
|
49
|
-
readonly?: boolean | undefined;
|
|
50
|
-
};
|
|
51
|
-
events: {
|
|
52
|
-
change: CustomEvent<any>;
|
|
53
|
-
} & {
|
|
54
|
-
[evt: string]: CustomEvent<any>;
|
|
55
|
-
};
|
|
56
|
-
slots: {
|
|
57
|
-
'check-icon': {
|
|
58
|
-
slot: string;
|
|
59
|
-
};
|
|
60
|
-
default: {};
|
|
61
|
-
};
|
|
62
|
-
exports?: undefined;
|
|
63
|
-
bindings?: undefined;
|
|
64
|
-
};
|
|
65
|
-
export {};
|
|
@@ -9,42 +9,15 @@
|
|
|
9
9
|
import Dialog from './dialog.svelte';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* @type {import('../../typedefs').ModalProps & import('../../typedefs').DialogProps &
|
|
13
|
+
* Record<string, any>}
|
|
14
14
|
*/
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export let open = false;
|
|
22
|
-
/**
|
|
23
|
-
* Text label displayed on the header. Required.
|
|
24
|
-
* @type {string}
|
|
25
|
-
*/
|
|
26
|
-
export let title;
|
|
27
|
-
/**
|
|
28
|
-
* Text label displayed on the OK button.
|
|
29
|
-
* @type {string}
|
|
30
|
-
*/
|
|
31
|
-
export let okLabel = '';
|
|
15
|
+
let {
|
|
16
|
+
/* eslint-disable prefer-const */
|
|
17
|
+
open = $bindable(false),
|
|
18
|
+
...restProps
|
|
19
|
+
/* eslint-enable prefer-const */
|
|
20
|
+
} = $props();
|
|
32
21
|
</script>
|
|
33
22
|
|
|
34
|
-
<Dialog
|
|
35
|
-
role="alertdialog"
|
|
36
|
-
class={className}
|
|
37
|
-
bind:open
|
|
38
|
-
{title}
|
|
39
|
-
{okLabel}
|
|
40
|
-
showCancel={false}
|
|
41
|
-
{...$$restProps}
|
|
42
|
-
on:opening
|
|
43
|
-
on:open
|
|
44
|
-
on:ok
|
|
45
|
-
on:cancel
|
|
46
|
-
on:closing
|
|
47
|
-
on:close
|
|
48
|
-
>
|
|
49
|
-
<slot />
|
|
50
|
-
</Dialog>
|
|
23
|
+
<Dialog {...restProps} bind:open role="alertdialog" showCancel={false}></Dialog>
|
|
@@ -1,57 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default AlertDialog;
|
|
2
|
+
type AlertDialog = SvelteComponent<ModalProps & DialogProps & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "open" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A modal alert dialog. It only shows the OK button, just like `window.alert()`.
|
|
6
9
|
* @see https://w3c.github.io/aria/#alertdialog
|
|
7
10
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/
|
|
8
11
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/alert
|
|
9
12
|
*/
|
|
10
|
-
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
title: string;
|
|
13
|
-
class?: string | undefined;
|
|
14
|
-
open?: boolean | undefined;
|
|
15
|
-
okLabel?: string | undefined;
|
|
16
|
-
}, {
|
|
17
|
-
opening: CustomEvent<any>;
|
|
18
|
-
open: CustomEvent<any>;
|
|
19
|
-
ok: CustomEvent<any>;
|
|
20
|
-
cancel: CustomEvent<any>;
|
|
21
|
-
closing: CustomEvent<any>;
|
|
22
|
-
close: CustomEvent<any>;
|
|
23
|
-
} & {
|
|
13
|
+
declare const AlertDialog: $$__sveltets_2_IsomorphicComponent<import("../../typedefs").ModalProps & import("../../typedefs").DialogProps & Record<string, any>, {
|
|
24
14
|
[evt: string]: CustomEvent<any>;
|
|
25
|
-
}, {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
title: string;
|
|
37
|
-
class?: string | undefined;
|
|
38
|
-
open?: boolean | undefined;
|
|
39
|
-
okLabel?: string | undefined;
|
|
40
|
-
};
|
|
41
|
-
events: {
|
|
42
|
-
opening: CustomEvent<any>;
|
|
43
|
-
open: CustomEvent<any>;
|
|
44
|
-
ok: CustomEvent<any>;
|
|
45
|
-
cancel: CustomEvent<any>;
|
|
46
|
-
closing: CustomEvent<any>;
|
|
47
|
-
close: CustomEvent<any>;
|
|
48
|
-
} & {
|
|
49
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
+
}, {}, {}, "open">;
|
|
16
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
17
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
18
|
+
$$bindings?: Bindings;
|
|
19
|
+
} & Exports;
|
|
20
|
+
(internal: unknown, props: Props & {
|
|
21
|
+
$$events?: Events;
|
|
22
|
+
$$slots?: Slots;
|
|
23
|
+
}): Exports & {
|
|
24
|
+
$set?: any;
|
|
25
|
+
$on?: any;
|
|
50
26
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
exports?: undefined;
|
|
55
|
-
bindings?: undefined;
|
|
56
|
-
};
|
|
57
|
-
export {};
|
|
27
|
+
z_$$bindings?: Bindings;
|
|
28
|
+
}
|
|
@@ -9,47 +9,15 @@
|
|
|
9
9
|
import Dialog from './dialog.svelte';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* @type {import('../../typedefs').ModalProps & import('../../typedefs').DialogProps &
|
|
13
|
+
* Record<string, any>}
|
|
14
14
|
*/
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export let open = false;
|
|
22
|
-
/**
|
|
23
|
-
* Text label displayed on the header. Required.
|
|
24
|
-
* @type {string}
|
|
25
|
-
*/
|
|
26
|
-
export let title;
|
|
27
|
-
/**
|
|
28
|
-
* Text label displayed on the OK button.
|
|
29
|
-
* @type {string}
|
|
30
|
-
*/
|
|
31
|
-
export let okLabel = '';
|
|
32
|
-
/**
|
|
33
|
-
* Text label displayed on the Cancel button.
|
|
34
|
-
* @type {string}
|
|
35
|
-
*/
|
|
36
|
-
export let cancelLabel = '';
|
|
15
|
+
let {
|
|
16
|
+
/* eslint-disable prefer-const */
|
|
17
|
+
open = $bindable(false),
|
|
18
|
+
...restProps
|
|
19
|
+
/* eslint-enable prefer-const */
|
|
20
|
+
} = $props();
|
|
37
21
|
</script>
|
|
38
22
|
|
|
39
|
-
<Dialog
|
|
40
|
-
role="alertdialog"
|
|
41
|
-
class={className}
|
|
42
|
-
bind:open
|
|
43
|
-
{title}
|
|
44
|
-
{okLabel}
|
|
45
|
-
{cancelLabel}
|
|
46
|
-
{...$$restProps}
|
|
47
|
-
on:opening
|
|
48
|
-
on:open
|
|
49
|
-
on:ok
|
|
50
|
-
on:cancel
|
|
51
|
-
on:closing
|
|
52
|
-
on:close
|
|
53
|
-
>
|
|
54
|
-
<slot />
|
|
55
|
-
</Dialog>
|
|
23
|
+
<Dialog {...restProps} bind:open role="alertdialog"></Dialog>
|
|
@@ -1,59 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default ConfirmationDialog;
|
|
2
|
+
type ConfirmationDialog = SvelteComponent<ModalProps & DialogProps & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "open" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A modal confirmation dialog. It shows the OK and Cancel buttons, just like `window.confirm()`.
|
|
6
9
|
* @see https://w3c.github.io/aria/#alertdialog
|
|
7
10
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/
|
|
8
11
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm
|
|
9
12
|
*/
|
|
10
|
-
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
title: string;
|
|
13
|
-
class?: string | undefined;
|
|
14
|
-
open?: boolean | undefined;
|
|
15
|
-
okLabel?: string | undefined;
|
|
16
|
-
cancelLabel?: string | undefined;
|
|
17
|
-
}, {
|
|
18
|
-
opening: CustomEvent<any>;
|
|
19
|
-
open: CustomEvent<any>;
|
|
20
|
-
ok: CustomEvent<any>;
|
|
21
|
-
cancel: CustomEvent<any>;
|
|
22
|
-
closing: CustomEvent<any>;
|
|
23
|
-
close: CustomEvent<any>;
|
|
24
|
-
} & {
|
|
13
|
+
declare const ConfirmationDialog: $$__sveltets_2_IsomorphicComponent<import("../../typedefs").ModalProps & import("../../typedefs").DialogProps & Record<string, any>, {
|
|
25
14
|
[evt: string]: CustomEvent<any>;
|
|
26
|
-
}, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
title: string;
|
|
38
|
-
class?: string | undefined;
|
|
39
|
-
open?: boolean | undefined;
|
|
40
|
-
okLabel?: string | undefined;
|
|
41
|
-
cancelLabel?: string | undefined;
|
|
42
|
-
};
|
|
43
|
-
events: {
|
|
44
|
-
opening: CustomEvent<any>;
|
|
45
|
-
open: CustomEvent<any>;
|
|
46
|
-
ok: CustomEvent<any>;
|
|
47
|
-
cancel: CustomEvent<any>;
|
|
48
|
-
closing: CustomEvent<any>;
|
|
49
|
-
close: CustomEvent<any>;
|
|
50
|
-
} & {
|
|
51
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
+
}, {}, {}, "open">;
|
|
16
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
17
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
18
|
+
$$bindings?: Bindings;
|
|
19
|
+
} & Exports;
|
|
20
|
+
(internal: unknown, props: Props & {
|
|
21
|
+
$$events?: Events;
|
|
22
|
+
$$slots?: Slots;
|
|
23
|
+
}): Exports & {
|
|
24
|
+
$set?: any;
|
|
25
|
+
$on?: any;
|
|
52
26
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
};
|
|
56
|
-
exports?: undefined;
|
|
57
|
-
bindings?: undefined;
|
|
58
|
-
};
|
|
59
|
-
export {};
|
|
27
|
+
z_$$bindings?: Bindings;
|
|
28
|
+
}
|
|
@@ -13,71 +13,34 @@
|
|
|
13
13
|
import Modal from '../util/modal.svelte';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*/
|
|
45
|
-
export let showClose = false;
|
|
46
|
-
/**
|
|
47
|
-
* Whether to show the OK button on the footer.
|
|
48
|
-
* @type {boolean}
|
|
49
|
-
*/
|
|
50
|
-
export let showOk = true;
|
|
51
|
-
/**
|
|
52
|
-
* Text label displayed on the OK button.
|
|
53
|
-
* @type {string}
|
|
54
|
-
*/
|
|
55
|
-
export let okLabel = '';
|
|
56
|
-
/**
|
|
57
|
-
* Whether to disable the OK button.
|
|
58
|
-
* @type {boolean}
|
|
59
|
-
*/
|
|
60
|
-
export let okDisabled = false;
|
|
61
|
-
/**
|
|
62
|
-
* Whether to show the Cancel button on the footer.
|
|
63
|
-
* @type {boolean}
|
|
64
|
-
*/
|
|
65
|
-
export let showCancel = true;
|
|
66
|
-
/**
|
|
67
|
-
* Text label displayed on the Cancel button.
|
|
68
|
-
* @type {string}
|
|
69
|
-
*/
|
|
70
|
-
export let cancelLabel = '';
|
|
71
|
-
/**
|
|
72
|
-
* Whether to disable the Cancel button.
|
|
73
|
-
* @type {boolean}
|
|
74
|
-
*/
|
|
75
|
-
export let cancelDisabled = false;
|
|
76
|
-
/**
|
|
77
|
-
* Whether to close the modal when the backdrop (outside of the modal) is clicked.
|
|
78
|
-
* @type {boolean}
|
|
79
|
-
*/
|
|
80
|
-
export let lightDismiss = false;
|
|
16
|
+
* @type {import('../../typedefs').ModalProps & import('../../typedefs').DialogProps &
|
|
17
|
+
* Record<string, any>}
|
|
18
|
+
*/
|
|
19
|
+
let {
|
|
20
|
+
/* eslint-disable prefer-const */
|
|
21
|
+
open = $bindable(false),
|
|
22
|
+
value = $bindable(''),
|
|
23
|
+
title,
|
|
24
|
+
role = 'dialog',
|
|
25
|
+
size = 'medium',
|
|
26
|
+
class: className,
|
|
27
|
+
showClose = false,
|
|
28
|
+
showOk = true,
|
|
29
|
+
showCancel = true,
|
|
30
|
+
okLabel = '',
|
|
31
|
+
okDisabled = false,
|
|
32
|
+
cancelLabel = '',
|
|
33
|
+
cancelDisabled = false,
|
|
34
|
+
children,
|
|
35
|
+
header,
|
|
36
|
+
headerExtra,
|
|
37
|
+
footer,
|
|
38
|
+
footerExtra,
|
|
39
|
+
closeIcon,
|
|
40
|
+
input: _input,
|
|
41
|
+
...restProps
|
|
42
|
+
/* eslint-enable prefer-const */
|
|
43
|
+
} = $props();
|
|
81
44
|
|
|
82
45
|
/**
|
|
83
46
|
* The ID of the drawer.
|
|
@@ -86,91 +49,83 @@
|
|
|
86
49
|
const id = generateElementId('dialog');
|
|
87
50
|
/**
|
|
88
51
|
* A reference to the modal component.
|
|
89
|
-
* @type {Modal}
|
|
52
|
+
* @type {Modal | undefined}
|
|
90
53
|
*/
|
|
91
|
-
let modal;
|
|
54
|
+
let modal = $state();
|
|
92
55
|
/**
|
|
93
56
|
* @type {HTMLElement | undefined}
|
|
94
57
|
*/
|
|
95
|
-
let content;
|
|
58
|
+
let content = $state();
|
|
96
59
|
|
|
97
|
-
|
|
60
|
+
$effect(() => {
|
|
98
61
|
if (open && content) {
|
|
99
62
|
/** @type {HTMLElement} */ (content.querySelector('input, button.primary'))?.focus();
|
|
100
63
|
}
|
|
101
|
-
}
|
|
64
|
+
});
|
|
102
65
|
</script>
|
|
103
66
|
|
|
104
67
|
<Modal
|
|
68
|
+
bind:this={modal}
|
|
69
|
+
{...restProps}
|
|
105
70
|
{role}
|
|
106
71
|
{id}
|
|
107
72
|
class="dialog"
|
|
108
|
-
aria-label={
|
|
109
|
-
aria-labelledby={
|
|
73
|
+
aria-label={header ? undefined : title}
|
|
74
|
+
aria-labelledby={header ? title : `${id}-title`}
|
|
110
75
|
aria-describedby="{id}-body"
|
|
111
76
|
bind:open
|
|
112
77
|
showBackdrop
|
|
113
|
-
{lightDismiss}
|
|
114
|
-
{...$$restProps}
|
|
115
|
-
bind:this={modal}
|
|
116
|
-
on:opening
|
|
117
|
-
on:open
|
|
118
|
-
on:ok
|
|
119
|
-
on:cancel
|
|
120
|
-
on:closing
|
|
121
|
-
on:close
|
|
122
78
|
>
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
{#if title || showClose || $$slots.header || $$slots['header-extra']}
|
|
79
|
+
<div bind:this={content} role="none" class="content {className} {size}">
|
|
80
|
+
{#if title || showClose || header || headerExtra}
|
|
126
81
|
<div role="none" class="header">
|
|
127
|
-
{#if
|
|
128
|
-
|
|
82
|
+
{#if header}
|
|
83
|
+
{@render header()}
|
|
129
84
|
{:else}
|
|
130
85
|
<div role="none" id="{id}-title" class="title">
|
|
131
86
|
{title}
|
|
132
87
|
</div>
|
|
133
88
|
<Spacer flex={true} />
|
|
134
|
-
{
|
|
135
|
-
<slot name="header-extra" />
|
|
136
|
-
{/if}
|
|
89
|
+
{@render headerExtra?.()}
|
|
137
90
|
{#if showClose}
|
|
138
91
|
<Button
|
|
139
92
|
variant="ghost"
|
|
140
93
|
iconic
|
|
141
94
|
aria-label={$_('_sui.close')}
|
|
142
95
|
aria-controls={id}
|
|
143
|
-
|
|
144
|
-
modal
|
|
96
|
+
onclick={() => {
|
|
97
|
+
modal?.close('close');
|
|
145
98
|
}}
|
|
146
99
|
>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
100
|
+
{#snippet startIcon()}
|
|
101
|
+
{#if closeIcon}
|
|
102
|
+
{@render closeIcon()}
|
|
103
|
+
{:else}
|
|
104
|
+
<Icon name="close" />
|
|
105
|
+
{/if}
|
|
106
|
+
{/snippet}
|
|
150
107
|
</Button>
|
|
151
108
|
{/if}
|
|
152
109
|
{/if}
|
|
153
110
|
</div>
|
|
154
111
|
{/if}
|
|
155
112
|
<div role="none" id="{id}-body" class="body">
|
|
156
|
-
|
|
113
|
+
{@render children?.()}
|
|
157
114
|
</div>
|
|
158
|
-
{#if showOk || showCancel ||
|
|
115
|
+
{#if showOk || showCancel || footer || footerExtra}
|
|
159
116
|
<div role="none" class="footer">
|
|
160
|
-
{#if
|
|
161
|
-
|
|
117
|
+
{#if footer}
|
|
118
|
+
{@render footer?.()}
|
|
162
119
|
{:else}
|
|
163
|
-
{
|
|
164
|
-
<slot name="footer-extra" />
|
|
165
|
-
{/if}
|
|
120
|
+
{@render footerExtra?.()}
|
|
166
121
|
<Spacer flex={true} />
|
|
167
122
|
{#if showOk}
|
|
168
123
|
<Button
|
|
169
124
|
variant="primary"
|
|
170
125
|
label={okLabel || $_('_sui.ok')}
|
|
171
126
|
disabled={okDisabled}
|
|
172
|
-
|
|
173
|
-
modal
|
|
127
|
+
onclick={() => {
|
|
128
|
+
modal?.close('ok');
|
|
174
129
|
}}
|
|
175
130
|
/>
|
|
176
131
|
{/if}
|
|
@@ -179,8 +134,8 @@
|
|
|
179
134
|
variant="secondary"
|
|
180
135
|
label={cancelLabel || $_('_sui.cancel')}
|
|
181
136
|
disabled={cancelDisabled}
|
|
182
|
-
|
|
183
|
-
modal
|
|
137
|
+
onclick={() => {
|
|
138
|
+
modal?.close('cancel');
|
|
184
139
|
}}
|
|
185
140
|
/>
|
|
186
141
|
{/if}
|