@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,94 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default Dialog;
|
|
2
|
+
type Dialog = SvelteComponent<ModalProps & DialogProps & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "value" | "open" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A feedback dialog widget based on the HTML `<dialog>` element.
|
|
6
9
|
* @see https://w3c.github.io/aria/#dialog
|
|
7
10
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
[x: string]: any;
|
|
11
|
-
title: string;
|
|
12
|
-
class?: string | undefined;
|
|
13
|
-
size?: "small" | "medium" | "large" | "x-large" | undefined;
|
|
14
|
-
role?: "dialog" | "alertdialog" | undefined;
|
|
15
|
-
open?: boolean | undefined;
|
|
16
|
-
lightDismiss?: boolean | undefined;
|
|
17
|
-
showClose?: boolean | undefined;
|
|
18
|
-
showOk?: boolean | undefined;
|
|
19
|
-
okLabel?: string | undefined;
|
|
20
|
-
okDisabled?: boolean | undefined;
|
|
21
|
-
showCancel?: boolean | undefined;
|
|
22
|
-
cancelLabel?: string | undefined;
|
|
23
|
-
cancelDisabled?: boolean | undefined;
|
|
24
|
-
}, {
|
|
25
|
-
opening: CustomEvent<any>;
|
|
26
|
-
open: CustomEvent<any>;
|
|
27
|
-
ok: CustomEvent<any>;
|
|
28
|
-
cancel: CustomEvent<any>;
|
|
29
|
-
closing: CustomEvent<any>;
|
|
30
|
-
close: CustomEvent<any>;
|
|
31
|
-
} & {
|
|
12
|
+
declare const Dialog: $$__sveltets_2_IsomorphicComponent<import("../../typedefs").ModalProps & import("../../typedefs").DialogProps & Record<string, any>, {
|
|
32
13
|
[evt: string]: CustomEvent<any>;
|
|
33
|
-
}, {
|
|
34
|
-
|
|
35
|
-
|
|
14
|
+
}, {}, {}, "value" | "open">;
|
|
15
|
+
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> {
|
|
16
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
+
$$bindings?: Bindings;
|
|
18
|
+
} & Exports;
|
|
19
|
+
(internal: unknown, props: Props & {
|
|
20
|
+
$$events?: Events;
|
|
21
|
+
$$slots?: Slots;
|
|
22
|
+
}): Exports & {
|
|
23
|
+
$set?: any;
|
|
24
|
+
$on?: any;
|
|
36
25
|
};
|
|
37
|
-
|
|
38
|
-
'header-extra': {};
|
|
39
|
-
'close-icon': {
|
|
40
|
-
slot: string;
|
|
41
|
-
};
|
|
42
|
-
default: {};
|
|
43
|
-
footer: {};
|
|
44
|
-
'footer-extra': {};
|
|
45
|
-
}> {
|
|
26
|
+
z_$$bindings?: Bindings;
|
|
46
27
|
}
|
|
47
|
-
export type DialogProps = typeof __propDef.props;
|
|
48
|
-
export type DialogEvents = typeof __propDef.events;
|
|
49
|
-
export type DialogSlots = typeof __propDef.slots;
|
|
50
|
-
import { SvelteComponent } from "svelte";
|
|
51
|
-
declare const __propDef: {
|
|
52
|
-
props: {
|
|
53
|
-
[x: string]: any;
|
|
54
|
-
title: string;
|
|
55
|
-
class?: string | undefined;
|
|
56
|
-
size?: "small" | "medium" | "large" | "x-large" | undefined;
|
|
57
|
-
role?: "dialog" | "alertdialog" | undefined;
|
|
58
|
-
open?: boolean | undefined;
|
|
59
|
-
lightDismiss?: boolean | undefined;
|
|
60
|
-
showClose?: boolean | undefined;
|
|
61
|
-
showOk?: boolean | undefined;
|
|
62
|
-
okLabel?: string | undefined;
|
|
63
|
-
okDisabled?: boolean | undefined;
|
|
64
|
-
showCancel?: boolean | undefined;
|
|
65
|
-
cancelLabel?: string | undefined;
|
|
66
|
-
cancelDisabled?: boolean | undefined;
|
|
67
|
-
};
|
|
68
|
-
events: {
|
|
69
|
-
opening: CustomEvent<any>;
|
|
70
|
-
open: CustomEvent<any>;
|
|
71
|
-
ok: CustomEvent<any>;
|
|
72
|
-
cancel: CustomEvent<any>;
|
|
73
|
-
closing: CustomEvent<any>;
|
|
74
|
-
close: CustomEvent<any>;
|
|
75
|
-
} & {
|
|
76
|
-
[evt: string]: CustomEvent<any>;
|
|
77
|
-
};
|
|
78
|
-
slots: {
|
|
79
|
-
'extra-content': {
|
|
80
|
-
slot: string;
|
|
81
|
-
};
|
|
82
|
-
header: {};
|
|
83
|
-
'header-extra': {};
|
|
84
|
-
'close-icon': {
|
|
85
|
-
slot: string;
|
|
86
|
-
};
|
|
87
|
-
default: {};
|
|
88
|
-
footer: {};
|
|
89
|
-
'footer-extra': {};
|
|
90
|
-
};
|
|
91
|
-
exports?: undefined;
|
|
92
|
-
bindings?: undefined;
|
|
93
|
-
};
|
|
94
|
-
export {};
|
|
@@ -7,82 +7,53 @@
|
|
|
7
7
|
@see https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt
|
|
8
8
|
-->
|
|
9
9
|
<script>
|
|
10
|
-
import Dialog from './dialog.svelte';
|
|
11
10
|
import TextInput from '../text-field/text-input.svelte';
|
|
11
|
+
import Dialog from './dialog.svelte';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
* @
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Whether to open the dialog.
|
|
21
|
-
* @type {boolean}
|
|
22
|
-
*/
|
|
23
|
-
export let open = false;
|
|
24
|
-
/**
|
|
25
|
-
* Text label displayed on the header. Required.
|
|
26
|
-
* @type {string}
|
|
27
|
-
*/
|
|
28
|
-
export let title;
|
|
29
|
-
/**
|
|
30
|
-
* Text label displayed on the OK button.
|
|
31
|
-
* @type {string}
|
|
14
|
+
* @typedef {object} Props
|
|
15
|
+
* @property {string} [value] - Value entered on the textbox.
|
|
16
|
+
* @property {object} [textboxAttrs] - Extra attributes for the `<TextInput>`.
|
|
17
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
18
|
+
* @property {import('svelte').Snippet} [input] - Input slot content.
|
|
32
19
|
*/
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Whether to disable the OK button.
|
|
36
|
-
* @type {boolean}
|
|
37
|
-
*/
|
|
38
|
-
export let okDisabled = false;
|
|
39
|
-
/**
|
|
40
|
-
* Text label displayed on the Cancel button.
|
|
41
|
-
* @type {string}
|
|
42
|
-
*/
|
|
43
|
-
export let cancelLabel = '';
|
|
44
|
-
/**
|
|
45
|
-
* Value entered on the textbox.
|
|
46
|
-
* @type {string}
|
|
47
|
-
*/
|
|
48
|
-
export let value = '';
|
|
20
|
+
|
|
49
21
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
22
|
+
* @type {import('../../typedefs').ModalProps & import('../../typedefs').DialogProps &
|
|
23
|
+
* import('../../typedefs').CommonEventHandlers & import('../../typedefs').InputEventHandlers &
|
|
24
|
+
* Props & Record<string, any>}
|
|
52
25
|
*/
|
|
53
|
-
|
|
26
|
+
let {
|
|
27
|
+
/* eslint-disable prefer-const */
|
|
28
|
+
open = $bindable(false),
|
|
29
|
+
value = $bindable(''),
|
|
30
|
+
textboxAttrs = {},
|
|
31
|
+
children,
|
|
32
|
+
input,
|
|
33
|
+
onkeydown,
|
|
34
|
+
onkeyup,
|
|
35
|
+
onkeypress,
|
|
36
|
+
oninput,
|
|
37
|
+
...restProps
|
|
38
|
+
/* eslint-enable prefer-const */
|
|
39
|
+
} = $props();
|
|
54
40
|
</script>
|
|
55
41
|
|
|
56
|
-
<Dialog
|
|
57
|
-
|
|
58
|
-
class={className}
|
|
59
|
-
bind:open
|
|
60
|
-
{title}
|
|
61
|
-
{okLabel}
|
|
62
|
-
{okDisabled}
|
|
63
|
-
{cancelLabel}
|
|
64
|
-
{...$$restProps}
|
|
65
|
-
on:opening
|
|
66
|
-
on:open
|
|
67
|
-
on:ok
|
|
68
|
-
on:cancel
|
|
69
|
-
on:closing
|
|
70
|
-
on:close
|
|
71
|
-
>
|
|
72
|
-
<slot />
|
|
42
|
+
<Dialog {...restProps} bind:open role="alertdialog">
|
|
43
|
+
{@render children?.()}
|
|
73
44
|
<div class="input-outer">
|
|
74
|
-
{#if
|
|
75
|
-
|
|
45
|
+
{#if input}
|
|
46
|
+
{@render input()}
|
|
76
47
|
{:else}
|
|
77
48
|
<TextInput
|
|
78
49
|
bind:value
|
|
79
50
|
flex
|
|
80
51
|
autofocus
|
|
81
52
|
{...textboxAttrs}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
53
|
+
{onkeydown}
|
|
54
|
+
{onkeyup}
|
|
55
|
+
{onkeypress}
|
|
56
|
+
{oninput}
|
|
86
57
|
/>
|
|
87
58
|
{/if}
|
|
88
59
|
</div>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default PromptDialog;
|
|
2
|
+
type PromptDialog = SvelteComponent<ModalProps & DialogProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & InputEventHandlers & Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "value" | "open" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A modal prompt dialog. It shows the OK and Cancel buttons as well as a textbox, just like
|
|
6
9
|
* `window.prompt()`.
|
|
@@ -8,69 +11,54 @@
|
|
|
8
11
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/
|
|
9
12
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt
|
|
10
13
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
declare const PromptDialog: $$__sveltets_2_IsomorphicComponent<import("../../typedefs").ModalProps & import("../../typedefs").DialogProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & import("../../typedefs").InputEventHandlers & {
|
|
15
|
+
/**
|
|
16
|
+
* - Value entered on the textbox.
|
|
17
|
+
*/
|
|
15
18
|
value?: string | undefined;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
cancelLabel?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* - Extra attributes for the `<TextInput>`.
|
|
21
|
+
*/
|
|
20
22
|
textboxAttrs?: object | undefined;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
input
|
|
29
|
-
|
|
30
|
-
keyup: KeyboardEvent;
|
|
31
|
-
keypress: KeyboardEvent;
|
|
32
|
-
} & {
|
|
23
|
+
/**
|
|
24
|
+
* - Primary slot content.
|
|
25
|
+
*/
|
|
26
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* - Input slot content.
|
|
29
|
+
*/
|
|
30
|
+
input?: import("svelte").Snippet<[]> | undefined;
|
|
31
|
+
} & Record<string, any>, {
|
|
33
32
|
[evt: string]: CustomEvent<any>;
|
|
34
|
-
}, {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
cancelLabel?: string | undefined;
|
|
53
|
-
textboxAttrs?: object | undefined;
|
|
54
|
-
};
|
|
55
|
-
events: {
|
|
56
|
-
opening: CustomEvent<any>;
|
|
57
|
-
open: CustomEvent<any>;
|
|
58
|
-
ok: CustomEvent<any>;
|
|
59
|
-
cancel: CustomEvent<any>;
|
|
60
|
-
closing: CustomEvent<any>;
|
|
61
|
-
close: CustomEvent<any>;
|
|
62
|
-
input: Event;
|
|
63
|
-
keydown: KeyboardEvent;
|
|
64
|
-
keyup: KeyboardEvent;
|
|
65
|
-
keypress: KeyboardEvent;
|
|
66
|
-
} & {
|
|
67
|
-
[evt: string]: CustomEvent<any>;
|
|
68
|
-
};
|
|
69
|
-
slots: {
|
|
70
|
-
default: {};
|
|
71
|
-
input: {};
|
|
72
|
-
};
|
|
73
|
-
exports?: undefined;
|
|
74
|
-
bindings?: undefined;
|
|
33
|
+
}, {}, {}, "value" | "open">;
|
|
34
|
+
type Props = {
|
|
35
|
+
/**
|
|
36
|
+
* - Value entered on the textbox.
|
|
37
|
+
*/
|
|
38
|
+
value?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* - Extra attributes for the `<TextInput>`.
|
|
41
|
+
*/
|
|
42
|
+
textboxAttrs?: object | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* - Primary slot content.
|
|
45
|
+
*/
|
|
46
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* - Input slot content.
|
|
49
|
+
*/
|
|
50
|
+
input?: import("svelte").Snippet<[]> | undefined;
|
|
75
51
|
};
|
|
76
|
-
|
|
52
|
+
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> {
|
|
53
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
54
|
+
$$bindings?: Bindings;
|
|
55
|
+
} & Exports;
|
|
56
|
+
(internal: unknown, props: Props & {
|
|
57
|
+
$$events?: Events;
|
|
58
|
+
$$slots?: Slots;
|
|
59
|
+
}): Exports & {
|
|
60
|
+
$set?: any;
|
|
61
|
+
$on?: any;
|
|
62
|
+
};
|
|
63
|
+
z_$$bindings?: Bindings;
|
|
64
|
+
}
|
|
@@ -4,55 +4,56 @@
|
|
|
4
4
|
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
|
|
5
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
|
|
6
6
|
-->
|
|
7
|
-
<svelte:options accessors={true} />
|
|
8
|
-
|
|
9
7
|
<script>
|
|
10
8
|
import { generateElementId } from '@sveltia/utils/element';
|
|
11
|
-
import { createEventDispatcher } from 'svelte';
|
|
12
9
|
import Button from '../button/button.svelte';
|
|
13
10
|
import Icon from '../icon/icon.svelte';
|
|
14
11
|
|
|
15
12
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* Whether to
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
* @type {boolean}
|
|
29
|
-
*/
|
|
30
|
-
export let disabled = false;
|
|
31
|
-
/**
|
|
32
|
-
* Whether to show the content. An alias of the `aria-expanded` attribute.
|
|
33
|
-
* @type {boolean}
|
|
13
|
+
* @typedef {object} Props
|
|
14
|
+
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
15
|
+
* @property {boolean} [hidden] - Whether to hide the widget. An alias of the `aria-hidden`
|
|
16
|
+
* attribute.
|
|
17
|
+
* @property {boolean} [disabled] - Whether to disable the widget. An alias of the `aria-disabled`
|
|
18
|
+
* attribute.
|
|
19
|
+
* @property {boolean} [expanded] - Whether to show the content. An alias of the `aria-expanded`
|
|
20
|
+
* attribute.
|
|
21
|
+
* @property {string} [label] - Text label displayed next to the expander.
|
|
22
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
23
|
+
* @property {import('svelte').Snippet} [chevronIcon] - Chevron slot content.
|
|
24
|
+
* @property {(event: CustomEvent) => void} [onChange] - Custom `Change` event handler.
|
|
34
25
|
*/
|
|
35
|
-
|
|
26
|
+
|
|
36
27
|
/**
|
|
37
|
-
*
|
|
38
|
-
* @type {string}
|
|
28
|
+
* @type {Props & Record<string, any>}
|
|
39
29
|
*/
|
|
40
|
-
|
|
30
|
+
let {
|
|
31
|
+
/* eslint-disable prefer-const */
|
|
32
|
+
expanded = $bindable(false),
|
|
33
|
+
class: className,
|
|
34
|
+
hidden = false,
|
|
35
|
+
disabled = false,
|
|
36
|
+
label = '',
|
|
37
|
+
children,
|
|
38
|
+
chevronIcon,
|
|
39
|
+
onChange,
|
|
40
|
+
...restProps
|
|
41
|
+
/* eslint-enable prefer-const */
|
|
42
|
+
} = $props();
|
|
41
43
|
|
|
42
|
-
const dispatch = createEventDispatcher();
|
|
43
44
|
const id = generateElementId('disclosure');
|
|
44
45
|
</script>
|
|
45
46
|
|
|
46
47
|
<div
|
|
48
|
+
{...restProps}
|
|
47
49
|
role="group"
|
|
48
50
|
{id}
|
|
49
51
|
class="sui disclosure {className}"
|
|
50
|
-
|
|
52
|
+
{hidden}
|
|
51
53
|
aria-hidden={hidden}
|
|
52
54
|
aria-disabled={disabled}
|
|
53
55
|
aria-labelledby="{id}-header"
|
|
54
56
|
aria-roledescription="disclosure"
|
|
55
|
-
{...$$restProps}
|
|
56
57
|
>
|
|
57
58
|
<div role="none" class="inner" inert={disabled}>
|
|
58
59
|
<Button
|
|
@@ -61,18 +62,22 @@
|
|
|
61
62
|
{disabled}
|
|
62
63
|
aria-controls="{id}-content"
|
|
63
64
|
aria-expanded={expanded}
|
|
64
|
-
|
|
65
|
+
onclick={() => {
|
|
65
66
|
expanded = !expanded;
|
|
66
|
-
|
|
67
|
+
onChange?.(new CustomEvent('change', { detail: { expanded } }));
|
|
67
68
|
}}
|
|
68
69
|
>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
{#snippet startIcon()}
|
|
71
|
+
{#if chevronIcon}
|
|
72
|
+
{@render chevronIcon()}
|
|
73
|
+
{:else}
|
|
74
|
+
<Icon name="expand_more" />
|
|
75
|
+
{/if}
|
|
76
|
+
{/snippet}
|
|
72
77
|
{label}
|
|
73
78
|
</Button>
|
|
74
79
|
<div class="content" id="{id}-content" hidden={!expanded}>
|
|
75
|
-
|
|
80
|
+
{@render children?.()}
|
|
76
81
|
</div>
|
|
77
82
|
</div>
|
|
78
83
|
</div>
|
|
@@ -1,69 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default Disclosure;
|
|
2
|
+
type Disclosure = SvelteComponent<Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "expanded" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A disclosure (expander) widget. The equivalent of the HTML `<details>` element.
|
|
6
9
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
|
|
7
10
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
declare const Disclosure: $$__sveltets_2_IsomorphicComponent<{
|
|
13
|
+
/**
|
|
14
|
+
* - The `class` attribute on the wrapper element.
|
|
15
|
+
*/
|
|
11
16
|
class?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* - Whether to hide the widget. An alias of the `aria-hidden`
|
|
19
|
+
* attribute.
|
|
20
|
+
*/
|
|
21
|
+
hidden?: boolean | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
24
|
+
* attribute.
|
|
25
|
+
*/
|
|
12
26
|
disabled?: boolean | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* - Whether to show the content. An alias of the `aria-expanded`
|
|
29
|
+
* attribute.
|
|
30
|
+
*/
|
|
31
|
+
expanded?: boolean | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* - Text label displayed next to the expander.
|
|
34
|
+
*/
|
|
13
35
|
label?: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* - Primary slot content.
|
|
38
|
+
*/
|
|
39
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* - Chevron slot content.
|
|
42
|
+
*/
|
|
43
|
+
chevronIcon?: import("svelte").Snippet<[]> | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* - Custom `Change` event handler.
|
|
46
|
+
*/
|
|
47
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
48
|
+
} & Record<string, any>, {
|
|
49
|
+
[evt: string]: CustomEvent<any>;
|
|
50
|
+
}, {}, {}, "expanded">;
|
|
51
|
+
type Props = {
|
|
52
|
+
/**
|
|
53
|
+
* - The `class` attribute on the wrapper element.
|
|
54
|
+
*/
|
|
55
|
+
class?: string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* - Whether to hide the widget. An alias of the `aria-hidden`
|
|
58
|
+
* attribute.
|
|
59
|
+
*/
|
|
14
60
|
hidden?: boolean | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
63
|
+
* attribute.
|
|
64
|
+
*/
|
|
65
|
+
disabled?: boolean | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* - Whether to show the content. An alias of the `aria-expanded`
|
|
68
|
+
* attribute.
|
|
69
|
+
*/
|
|
15
70
|
expanded?: boolean | undefined;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
71
|
+
/**
|
|
72
|
+
* - Text label displayed next to the expander.
|
|
73
|
+
*/
|
|
74
|
+
label?: string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* - Primary slot content.
|
|
77
|
+
*/
|
|
78
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* - Chevron slot content.
|
|
81
|
+
*/
|
|
82
|
+
chevronIcon?: import("svelte").Snippet<[]> | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* - Custom `Change` event handler.
|
|
85
|
+
*/
|
|
86
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
87
|
+
};
|
|
88
|
+
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> {
|
|
89
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
90
|
+
$$bindings?: Bindings;
|
|
91
|
+
} & Exports;
|
|
92
|
+
(internal: unknown, props: Props & {
|
|
93
|
+
$$events?: Events;
|
|
94
|
+
$$slots?: Slots;
|
|
95
|
+
}): Exports & {
|
|
96
|
+
$set?: any;
|
|
97
|
+
$on?: any;
|
|
23
98
|
};
|
|
24
|
-
|
|
25
|
-
}> {
|
|
26
|
-
/**accessor*/
|
|
27
|
-
set class(_: string | undefined);
|
|
28
|
-
get class(): string | undefined;
|
|
29
|
-
/**accessor*/
|
|
30
|
-
set hidden(_: boolean | undefined);
|
|
31
|
-
get hidden(): boolean | undefined;
|
|
32
|
-
/**accessor*/
|
|
33
|
-
set disabled(_: boolean | undefined);
|
|
34
|
-
get disabled(): boolean | undefined;
|
|
35
|
-
/**accessor*/
|
|
36
|
-
set expanded(_: boolean | undefined);
|
|
37
|
-
get expanded(): boolean | undefined;
|
|
38
|
-
/**accessor*/
|
|
39
|
-
set label(_: string | undefined);
|
|
40
|
-
get label(): string | undefined;
|
|
99
|
+
z_$$bindings?: Bindings;
|
|
41
100
|
}
|
|
42
|
-
export type DisclosureProps = typeof __propDef.props;
|
|
43
|
-
export type DisclosureEvents = typeof __propDef.events;
|
|
44
|
-
export type DisclosureSlots = typeof __propDef.slots;
|
|
45
|
-
import { SvelteComponent } from "svelte";
|
|
46
|
-
declare const __propDef: {
|
|
47
|
-
props: {
|
|
48
|
-
[x: string]: any;
|
|
49
|
-
class?: string | undefined;
|
|
50
|
-
disabled?: boolean | undefined;
|
|
51
|
-
label?: string | undefined;
|
|
52
|
-
hidden?: boolean | undefined;
|
|
53
|
-
expanded?: boolean | undefined;
|
|
54
|
-
};
|
|
55
|
-
events: {
|
|
56
|
-
change: CustomEvent<any>;
|
|
57
|
-
} & {
|
|
58
|
-
[evt: string]: CustomEvent<any>;
|
|
59
|
-
};
|
|
60
|
-
slots: {
|
|
61
|
-
'chevron-icon': {
|
|
62
|
-
slot: string;
|
|
63
|
-
};
|
|
64
|
-
default: {};
|
|
65
|
-
};
|
|
66
|
-
exports?: undefined;
|
|
67
|
-
bindings?: undefined;
|
|
68
|
-
};
|
|
69
|
-
export {};
|
|
@@ -5,30 +5,34 @@
|
|
|
5
5
|
-->
|
|
6
6
|
<script>
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
8
|
+
* @typedef {object} Props
|
|
9
|
+
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
10
|
+
* @property {boolean} [hidden] - Whether to hide the widget. An alias of the `aria-hidden`
|
|
11
|
+
* attribute.
|
|
12
|
+
* @property {'horizontal'|'vertical'} [orientation] - Orientation of the widget. An alias of the
|
|
13
|
+
* `aria-orientation` attribute.
|
|
10
14
|
*/
|
|
11
|
-
|
|
12
|
-
export { className as class };
|
|
13
|
-
/**
|
|
14
|
-
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
15
|
-
* @type {boolean | undefined}
|
|
16
|
-
*/
|
|
17
|
-
export let hidden = undefined;
|
|
15
|
+
|
|
18
16
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @type {'horizontal' | 'vertical'}
|
|
17
|
+
* @type {Props & Record<string, any>}
|
|
21
18
|
*/
|
|
22
|
-
|
|
19
|
+
let {
|
|
20
|
+
/* eslint-disable prefer-const */
|
|
21
|
+
class: className,
|
|
22
|
+
hidden = false,
|
|
23
|
+
orientation = 'horizontal',
|
|
24
|
+
...restProps
|
|
25
|
+
/* eslint-enable prefer-const */
|
|
26
|
+
} = $props();
|
|
23
27
|
</script>
|
|
24
28
|
|
|
25
29
|
<div
|
|
30
|
+
{...restProps}
|
|
26
31
|
role="separator"
|
|
27
32
|
class="sui divider {className}"
|
|
28
|
-
|
|
33
|
+
{hidden}
|
|
29
34
|
aria-hidden={hidden}
|
|
30
35
|
aria-orientation={orientation}
|
|
31
|
-
{...$$restProps}
|
|
32
36
|
></div>
|
|
33
37
|
|
|
34
38
|
<style>.divider {
|