@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,59 +1,131 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default Listbox;
|
|
2
|
+
type Listbox = SvelteComponent<KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A list widget with selectable options. The equivalent of the HTML `<select multiple>` element.
|
|
6
9
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
|
|
7
10
|
* @see https://w3c.github.io/aria/#listbox
|
|
8
11
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
|
|
9
12
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
declare const Listbox: $$__sveltets_2_IsomorphicComponent<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;
|
|
18
|
+
/**
|
|
19
|
+
* - Whether to hide the widget. An alias of the `aria-hidden`
|
|
20
|
+
* attribute.
|
|
21
|
+
*/
|
|
22
|
+
hidden?: boolean | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
25
|
+
* attribute.
|
|
26
|
+
*/
|
|
13
27
|
disabled?: boolean | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* - Whether to make the widget read-only. An alias of the
|
|
30
|
+
* `aria-readonly` attribute.
|
|
31
|
+
*/
|
|
32
|
+
readonly?: boolean | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* - Whether to mark the widget required. An alias of the
|
|
35
|
+
* `aria-required` attribute.
|
|
36
|
+
*/
|
|
37
|
+
required?: boolean | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
40
|
+
* `aria-invalid` attribute.
|
|
41
|
+
*/
|
|
14
42
|
invalid?: boolean | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* - Whether to allow selecting more than one `<Option>`. An alias
|
|
45
|
+
* of the `aria-multiselectable` attribute.
|
|
46
|
+
*/
|
|
15
47
|
multiple?: boolean | undefined;
|
|
16
|
-
|
|
48
|
+
/**
|
|
49
|
+
* - Search terms to be used to filter the items.
|
|
50
|
+
*/
|
|
51
|
+
searchTerms?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* - Primary slot content.
|
|
54
|
+
*/
|
|
55
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* - Custom `Change` event handler.
|
|
58
|
+
*/
|
|
59
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* - Custom `Filter` event handler.
|
|
62
|
+
*/
|
|
63
|
+
onFilter?: ((event: CustomEvent) => void) | undefined;
|
|
64
|
+
} & Record<string, any>, {
|
|
65
|
+
[evt: string]: CustomEvent<any>;
|
|
66
|
+
}, {}, {}, "">;
|
|
67
|
+
type Props = {
|
|
68
|
+
/**
|
|
69
|
+
* - The `class` attribute on the wrapper element.
|
|
70
|
+
*/
|
|
71
|
+
class?: string | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* - Whether to hide the widget. An alias of the `aria-hidden`
|
|
74
|
+
* attribute.
|
|
75
|
+
*/
|
|
17
76
|
hidden?: boolean | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
79
|
+
* attribute.
|
|
80
|
+
*/
|
|
81
|
+
disabled?: boolean | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* - Whether to make the widget read-only. An alias of the
|
|
84
|
+
* `aria-readonly` attribute.
|
|
85
|
+
*/
|
|
18
86
|
readonly?: boolean | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* - Whether to mark the widget required. An alias of the
|
|
89
|
+
* `aria-required` attribute.
|
|
90
|
+
*/
|
|
91
|
+
required?: boolean | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
94
|
+
* `aria-invalid` attribute.
|
|
95
|
+
*/
|
|
96
|
+
invalid?: boolean | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* - Whether to allow selecting more than one `<Option>`. An alias
|
|
99
|
+
* of the `aria-multiselectable` attribute.
|
|
100
|
+
*/
|
|
101
|
+
multiple?: boolean | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* - Search terms to be used to filter the items.
|
|
104
|
+
*/
|
|
19
105
|
searchTerms?: string | undefined;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export type ListboxSlots = typeof __propDef.slots;
|
|
33
|
-
import { SvelteComponent } from "svelte";
|
|
34
|
-
declare const __propDef: {
|
|
35
|
-
props: {
|
|
36
|
-
[x: string]: any;
|
|
37
|
-
class?: string | undefined;
|
|
38
|
-
disabled?: boolean | undefined;
|
|
39
|
-
invalid?: boolean | undefined;
|
|
40
|
-
multiple?: boolean | undefined;
|
|
41
|
-
required?: boolean | undefined;
|
|
42
|
-
hidden?: boolean | undefined;
|
|
43
|
-
readonly?: boolean | undefined;
|
|
44
|
-
searchTerms?: string | undefined;
|
|
45
|
-
};
|
|
46
|
-
events: {
|
|
47
|
-
click: MouseEvent;
|
|
48
|
-
filter: Event | KeyboardEvent | UIEvent | ErrorEvent | AnimationEvent | MouseEvent | InputEvent | FocusEvent | CompositionEvent | ClipboardEvent | DragEvent | FormDataEvent | PointerEvent | ProgressEvent<EventTarget> | SecurityPolicyViolationEvent | SubmitEvent | TouchEvent | TransitionEvent | WheelEvent;
|
|
49
|
-
change: CustomEvent<any>;
|
|
50
|
-
} & {
|
|
51
|
-
[evt: string]: CustomEvent<any>;
|
|
52
|
-
};
|
|
53
|
-
slots: {
|
|
54
|
-
default: {};
|
|
55
|
-
};
|
|
56
|
-
exports?: undefined;
|
|
57
|
-
bindings?: undefined;
|
|
106
|
+
/**
|
|
107
|
+
* - Primary slot content.
|
|
108
|
+
*/
|
|
109
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* - Custom `Change` event handler.
|
|
112
|
+
*/
|
|
113
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* - Custom `Filter` event handler.
|
|
116
|
+
*/
|
|
117
|
+
onFilter?: ((event: CustomEvent) => void) | undefined;
|
|
58
118
|
};
|
|
59
|
-
|
|
119
|
+
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> {
|
|
120
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
121
|
+
$$bindings?: Bindings;
|
|
122
|
+
} & Exports;
|
|
123
|
+
(internal: unknown, props: Props & {
|
|
124
|
+
$$events?: Events;
|
|
125
|
+
$$slots?: Slots;
|
|
126
|
+
}): Exports & {
|
|
127
|
+
$set?: any;
|
|
128
|
+
$on?: any;
|
|
129
|
+
};
|
|
130
|
+
z_$$bindings?: Bindings;
|
|
131
|
+
}
|
|
@@ -10,43 +10,47 @@
|
|
|
10
10
|
import { generateElementId } from '@sveltia/utils/element';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @
|
|
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 {string} [label] - The group’s label to be displayed above the child `<Option>`s.
|
|
20
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
15
21
|
*/
|
|
16
|
-
|
|
17
|
-
export { className as class };
|
|
18
|
-
/**
|
|
19
|
-
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
20
|
-
* @type {boolean | undefined}
|
|
21
|
-
*/
|
|
22
|
-
export let hidden = undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Whether to disable the widget. An alias of the `aria-disabled` attribute.
|
|
25
|
-
* @type {boolean}
|
|
26
|
-
*/
|
|
27
|
-
export let disabled = false;
|
|
22
|
+
|
|
28
23
|
/**
|
|
29
|
-
*
|
|
24
|
+
* @type {Props & Record<string, any>}
|
|
30
25
|
*/
|
|
31
|
-
|
|
26
|
+
let {
|
|
27
|
+
/* eslint-disable prefer-const */
|
|
28
|
+
class: className,
|
|
29
|
+
hidden = false,
|
|
30
|
+
disabled = false,
|
|
31
|
+
label = '',
|
|
32
|
+
children,
|
|
33
|
+
...restProps
|
|
34
|
+
/* eslint-enable prefer-const */
|
|
35
|
+
} = $props();
|
|
32
36
|
|
|
33
37
|
const id = generateElementId('optgroup');
|
|
34
38
|
</script>
|
|
35
39
|
|
|
36
40
|
<div
|
|
41
|
+
{...restProps}
|
|
37
42
|
role="group"
|
|
38
43
|
{id}
|
|
39
44
|
class="sui option-group {className}"
|
|
40
|
-
|
|
45
|
+
{hidden}
|
|
41
46
|
aria-hidden={hidden}
|
|
42
47
|
aria-disabled={disabled}
|
|
43
48
|
aria-labelledby="{id}-label"
|
|
44
49
|
aria-roledescription="option group"
|
|
45
|
-
{...$$restProps}
|
|
46
50
|
>
|
|
47
51
|
<div role="none" id="{id}-label" class="label">{label}</div>
|
|
48
52
|
<div role="none" class="inner" inert={disabled}>
|
|
49
|
-
|
|
53
|
+
{@render children?.()}
|
|
50
54
|
</div>
|
|
51
55
|
</div>
|
|
52
56
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default OptionGroup;
|
|
2
|
+
type OptionGroup = SvelteComponent<Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A group within a `<Listbox>`. The equivalent of the HTML `<optgroup>` element. It can contain one
|
|
6
9
|
* or more `<Option>`s.
|
|
@@ -8,37 +11,66 @@
|
|
|
8
11
|
* @see https://w3c.github.io/aria/#listbox
|
|
9
12
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/listbox/examples/listbox-grouped/
|
|
10
13
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
declare const OptionGroup: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
/**
|
|
16
|
+
* - The `class` attribute on the wrapper element.
|
|
17
|
+
*/
|
|
13
18
|
class?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* - Whether to hide the widget. An alias of the `aria-hidden`
|
|
21
|
+
* attribute.
|
|
22
|
+
*/
|
|
23
|
+
hidden?: boolean | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
26
|
+
* attribute.
|
|
27
|
+
*/
|
|
14
28
|
disabled?: boolean | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* - The group’s label to be displayed above the child `<Option>`s.
|
|
31
|
+
*/
|
|
15
32
|
label?: string | undefined;
|
|
16
|
-
|
|
17
|
-
|
|
33
|
+
/**
|
|
34
|
+
* - Primary slot content.
|
|
35
|
+
*/
|
|
36
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
37
|
+
} & Record<string, any>, {
|
|
18
38
|
[evt: string]: CustomEvent<any>;
|
|
19
|
-
}, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
}, {}, {}, "">;
|
|
40
|
+
type Props = {
|
|
41
|
+
/**
|
|
42
|
+
* - The `class` attribute on the wrapper element.
|
|
43
|
+
*/
|
|
44
|
+
class?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* - Whether to hide the widget. An alias of the `aria-hidden`
|
|
47
|
+
* attribute.
|
|
48
|
+
*/
|
|
49
|
+
hidden?: boolean | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
52
|
+
* attribute.
|
|
53
|
+
*/
|
|
54
|
+
disabled?: boolean | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* - The group’s label to be displayed above the child `<Option>`s.
|
|
57
|
+
*/
|
|
58
|
+
label?: string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* - Primary slot content.
|
|
61
|
+
*/
|
|
62
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
43
63
|
};
|
|
44
|
-
|
|
64
|
+
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> {
|
|
65
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
66
|
+
$$bindings?: Bindings;
|
|
67
|
+
} & Exports;
|
|
68
|
+
(internal: unknown, props: Props & {
|
|
69
|
+
$$events?: Events;
|
|
70
|
+
$$slots?: Slots;
|
|
71
|
+
}): Exports & {
|
|
72
|
+
$set?: any;
|
|
73
|
+
$on?: any;
|
|
74
|
+
};
|
|
75
|
+
z_$$bindings?: Bindings;
|
|
76
|
+
}
|
|
@@ -9,50 +9,43 @@
|
|
|
9
9
|
import Icon from '../icon/icon.svelte';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @
|
|
12
|
+
* @typedef {object} Props
|
|
13
|
+
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
14
|
+
* @property {boolean} [selected] - Whether to select the widget. An alias of the `aria-selected`
|
|
15
|
+
* attribute.
|
|
16
|
+
* @property {string} label - Text label displayed on the item.
|
|
17
|
+
* @property {string} [searchValue] - The value to be searched.
|
|
18
|
+
* @property {boolean} [wrap] - Whether to wrap a long label.
|
|
19
|
+
* @property {import('svelte').Snippet} [checkIcon] - Check icon slot content.
|
|
14
20
|
*/
|
|
15
|
-
|
|
16
|
-
export { className as class };
|
|
17
|
-
/**
|
|
18
|
-
* Whether to select the widget. An alias of the `aria-selected` attribute.
|
|
19
|
-
* @type {boolean}
|
|
20
|
-
*/
|
|
21
|
-
export let selected = false;
|
|
22
|
-
/**
|
|
23
|
-
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
24
|
-
* @type {boolean | undefined}
|
|
25
|
-
*/
|
|
26
|
-
export let hidden = undefined;
|
|
27
|
-
/**
|
|
28
|
-
* Whether to disable the widget. An alias of the `aria-disabled` attribute.
|
|
29
|
-
* @type {boolean}
|
|
30
|
-
*/
|
|
31
|
-
export let disabled = false;
|
|
32
|
-
/**
|
|
33
|
-
* Text label displayed on the item.
|
|
34
|
-
* @type {string}
|
|
35
|
-
*/
|
|
36
|
-
export let label;
|
|
37
|
-
/**
|
|
38
|
-
* The `value` attribute on the `<button>` element.
|
|
39
|
-
* @type {string}
|
|
40
|
-
*/
|
|
41
|
-
export let value = label;
|
|
42
|
-
/**
|
|
43
|
-
* The value to be searched.
|
|
44
|
-
* @type {string}
|
|
45
|
-
*/
|
|
46
|
-
export let searchValue = label;
|
|
21
|
+
|
|
47
22
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
23
|
+
* @type {import('../../typedefs').ButtonProps & import('../../typedefs').CommonEventHandlers &
|
|
24
|
+
* Props & Record<string, any>}
|
|
50
25
|
*/
|
|
51
|
-
|
|
26
|
+
let {
|
|
27
|
+
/* eslint-disable prefer-const */
|
|
28
|
+
selected = $bindable(false),
|
|
29
|
+
hidden = $bindable(false),
|
|
30
|
+
class: className,
|
|
31
|
+
disabled = false,
|
|
32
|
+
label,
|
|
33
|
+
value = label,
|
|
34
|
+
searchValue = label,
|
|
35
|
+
wrap = false,
|
|
36
|
+
children,
|
|
37
|
+
checkIcon,
|
|
38
|
+
startIcon: _startIcon,
|
|
39
|
+
onChange,
|
|
40
|
+
onToggle,
|
|
41
|
+
...restProps
|
|
42
|
+
/* eslint-enable prefer-const */
|
|
43
|
+
} = $props();
|
|
52
44
|
</script>
|
|
53
45
|
|
|
54
|
-
<div role="none" class="sui option {className}" class:wrap
|
|
46
|
+
<div role="none" class="sui option {className}" class:wrap {hidden}>
|
|
55
47
|
<Button
|
|
48
|
+
{...restProps}
|
|
56
49
|
role="option"
|
|
57
50
|
tabindex="-1"
|
|
58
51
|
aria-selected={selected}
|
|
@@ -63,33 +56,27 @@
|
|
|
63
56
|
data-type={typeof value}
|
|
64
57
|
data-label={label}
|
|
65
58
|
data-search-value={searchValue}
|
|
66
|
-
{
|
|
67
|
-
on:click
|
|
68
|
-
on:dblclick
|
|
69
|
-
on:focus
|
|
70
|
-
on:blur
|
|
71
|
-
on:dragover
|
|
72
|
-
on:dragleave
|
|
73
|
-
on:dragend
|
|
74
|
-
on:drop
|
|
75
|
-
on:select
|
|
76
|
-
on:change
|
|
77
|
-
on:change={(event) => {
|
|
59
|
+
onChange={(event) => {
|
|
78
60
|
selected = event.detail.selected;
|
|
61
|
+
onChange?.(event);
|
|
79
62
|
}}
|
|
80
|
-
|
|
81
|
-
hidden =
|
|
63
|
+
onToggle={(event) => {
|
|
64
|
+
hidden = event.detail.hidden;
|
|
82
65
|
selected = false;
|
|
66
|
+
onToggle?.(event);
|
|
83
67
|
}}
|
|
84
68
|
>
|
|
85
69
|
{#if selected}
|
|
86
|
-
|
|
70
|
+
{#if checkIcon}
|
|
71
|
+
{@render checkIcon()}
|
|
72
|
+
{:else}
|
|
87
73
|
<Icon class="check" name="check" />
|
|
88
|
-
|
|
74
|
+
{/if}
|
|
89
75
|
{/if}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
76
|
+
{#snippet startIcon()}
|
|
77
|
+
{@render _startIcon?.()}
|
|
78
|
+
{/snippet}
|
|
79
|
+
{@render children?.()}
|
|
93
80
|
</Button>
|
|
94
81
|
</div>
|
|
95
82
|
|
|
@@ -1,86 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default Option;
|
|
2
|
+
type Option = SvelteComponent<ButtonProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "hidden" | "selected" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* An option within the `<Listbox>` widget. The equivalent of the HTML `<option>` element.
|
|
6
9
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option
|
|
7
10
|
* @see https://w3c.github.io/aria/#option
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
declare const Option: $$__sveltets_2_IsomorphicComponent<import("../../typedefs").ButtonProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & {
|
|
13
|
+
/**
|
|
14
|
+
* - The `class` attribute on the wrapper element.
|
|
15
|
+
*/
|
|
12
16
|
class?: string | undefined;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
/**
|
|
18
|
+
* - Whether to select the widget. An alias of the `aria-selected`
|
|
19
|
+
* attribute.
|
|
20
|
+
*/
|
|
16
21
|
selected?: boolean | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* - Text label displayed on the item.
|
|
24
|
+
*/
|
|
25
|
+
label: string;
|
|
26
|
+
/**
|
|
27
|
+
* - The value to be searched.
|
|
28
|
+
*/
|
|
17
29
|
searchValue?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* - Whether to wrap a long label.
|
|
32
|
+
*/
|
|
18
33
|
wrap?: boolean | undefined;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
dragover: DragEvent;
|
|
25
|
-
dragleave: DragEvent;
|
|
26
|
-
dragend: DragEvent;
|
|
27
|
-
drop: DragEvent;
|
|
28
|
-
select: CustomEvent<any>;
|
|
29
|
-
change: CustomEvent<any>;
|
|
30
|
-
} & {
|
|
34
|
+
/**
|
|
35
|
+
* - Check icon slot content.
|
|
36
|
+
*/
|
|
37
|
+
checkIcon?: import("svelte").Snippet<[]> | undefined;
|
|
38
|
+
} & Record<string, any>, {
|
|
31
39
|
[evt: string]: CustomEvent<any>;
|
|
32
|
-
}, {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
}, {}, {}, "hidden" | "selected">;
|
|
41
|
+
type Props = {
|
|
42
|
+
/**
|
|
43
|
+
* - The `class` attribute on the wrapper element.
|
|
44
|
+
*/
|
|
45
|
+
class?: string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* - Whether to select the widget. An alias of the `aria-selected`
|
|
48
|
+
* attribute.
|
|
49
|
+
*/
|
|
50
|
+
selected?: boolean | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* - Text label displayed on the item.
|
|
53
|
+
*/
|
|
54
|
+
label: string;
|
|
55
|
+
/**
|
|
56
|
+
* - The value to be searched.
|
|
57
|
+
*/
|
|
58
|
+
searchValue?: string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* - Whether to wrap a long label.
|
|
61
|
+
*/
|
|
62
|
+
wrap?: boolean | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* - Check icon slot content.
|
|
65
|
+
*/
|
|
66
|
+
checkIcon?: import("svelte").Snippet<[]> | undefined;
|
|
67
|
+
};
|
|
68
|
+
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> {
|
|
69
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
70
|
+
$$bindings?: Bindings;
|
|
71
|
+
} & Exports;
|
|
72
|
+
(internal: unknown, props: Props & {
|
|
73
|
+
$$events?: Events;
|
|
74
|
+
$$slots?: Slots;
|
|
75
|
+
}): Exports & {
|
|
76
|
+
$set?: any;
|
|
77
|
+
$on?: any;
|
|
40
78
|
};
|
|
41
|
-
|
|
79
|
+
z_$$bindings?: Bindings;
|
|
42
80
|
}
|
|
43
|
-
export type OptionProps = typeof __propDef.props;
|
|
44
|
-
export type OptionEvents = typeof __propDef.events;
|
|
45
|
-
export type OptionSlots = typeof __propDef.slots;
|
|
46
|
-
import { SvelteComponent } from "svelte";
|
|
47
|
-
declare const __propDef: {
|
|
48
|
-
props: {
|
|
49
|
-
[x: string]: any;
|
|
50
|
-
label: string;
|
|
51
|
-
class?: string | undefined;
|
|
52
|
-
disabled?: boolean | undefined;
|
|
53
|
-
value?: string | undefined;
|
|
54
|
-
hidden?: boolean | undefined;
|
|
55
|
-
selected?: boolean | undefined;
|
|
56
|
-
searchValue?: string | undefined;
|
|
57
|
-
wrap?: boolean | undefined;
|
|
58
|
-
};
|
|
59
|
-
events: {
|
|
60
|
-
click: MouseEvent;
|
|
61
|
-
dblclick: MouseEvent;
|
|
62
|
-
focus: FocusEvent;
|
|
63
|
-
blur: FocusEvent;
|
|
64
|
-
dragover: DragEvent;
|
|
65
|
-
dragleave: DragEvent;
|
|
66
|
-
dragend: DragEvent;
|
|
67
|
-
drop: DragEvent;
|
|
68
|
-
select: CustomEvent<any>;
|
|
69
|
-
change: CustomEvent<any>;
|
|
70
|
-
} & {
|
|
71
|
-
[evt: string]: CustomEvent<any>;
|
|
72
|
-
};
|
|
73
|
-
slots: {
|
|
74
|
-
'check-icon': {};
|
|
75
|
-
'start-icon': {
|
|
76
|
-
slot: string;
|
|
77
|
-
};
|
|
78
|
-
default: {};
|
|
79
|
-
'end-icon': {
|
|
80
|
-
slot: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
exports?: undefined;
|
|
84
|
-
bindings?: undefined;
|
|
85
|
-
};
|
|
86
|
-
export {};
|