@sveltia/ui 0.9.0 → 0.10.1
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 +2 -4
- package/package/components/alert/alert.svelte.d.ts +2 -2
- package/package/components/button/button.svelte +78 -26
- package/package/components/button/button.svelte.d.ts +73 -63
- package/package/components/button/select-button-group.svelte +6 -1
- package/package/components/button/select-button-group.svelte.d.ts +13 -13
- package/package/components/button/select-button.svelte +2 -1
- package/package/components/button/select-button.svelte.d.ts +19 -19
- package/package/components/button/split-button.svelte +10 -2
- package/package/components/button/split-button.svelte.d.ts +19 -11
- package/package/components/calendar/calendar.svelte +2 -2
- package/package/components/calendar/calendar.svelte.d.ts +2 -2
- package/package/components/checkbox/checkbox-group.svelte.d.ts +7 -7
- package/package/components/checkbox/checkbox.svelte +8 -6
- package/package/components/checkbox/checkbox.svelte.d.ts +22 -16
- package/package/components/dialog/alert-dialog.svelte.d.ts +6 -6
- package/package/components/dialog/confirmation-dialog.svelte.d.ts +8 -8
- package/package/components/dialog/dialog.svelte +17 -15
- package/package/components/dialog/dialog.svelte.d.ts +30 -24
- package/package/components/dialog/prompt-dialog.svelte +1 -1
- package/package/components/dialog/prompt-dialog.svelte.d.ts +12 -12
- package/package/components/disclosure/disclosure.svelte +6 -1
- package/package/components/disclosure/disclosure.svelte.d.ts +29 -19
- package/package/components/divider/divider.svelte.d.ts +5 -5
- package/package/components/divider/spacer.svelte.d.ts +4 -4
- package/package/components/drawer/drawer.svelte +34 -16
- package/package/components/drawer/drawer.svelte.d.ts +22 -16
- package/package/components/grid/grid-body.svelte.d.ts +4 -4
- package/package/components/grid/grid-cell.svelte.d.ts +2 -2
- package/package/components/grid/grid-col-header.svelte.d.ts +2 -2
- package/package/components/grid/grid-foot.svelte.d.ts +2 -2
- package/package/components/grid/grid-head.svelte.d.ts +2 -2
- package/package/components/grid/grid-row-header.svelte.d.ts +2 -2
- package/package/components/grid/grid-row.svelte +10 -2
- package/package/components/grid/grid-row.svelte.d.ts +8 -8
- package/package/components/grid/grid.svelte +7 -2
- package/package/components/grid/grid.svelte.d.ts +8 -8
- package/package/components/icon/icon.svelte.d.ts +4 -4
- package/package/components/listbox/listbox.svelte +11 -5
- package/package/components/listbox/listbox.svelte.d.ts +15 -15
- package/package/components/listbox/option-group.svelte.d.ts +7 -7
- package/package/components/listbox/option.svelte +4 -2
- package/package/components/listbox/option.svelte.d.ts +15 -13
- package/package/components/menu/menu-button.svelte +8 -2
- package/package/components/menu/menu-button.svelte.d.ts +20 -18
- package/package/components/menu/menu-item-checkbox.svelte +1 -1
- package/package/components/menu/menu-item-checkbox.svelte.d.ts +16 -16
- package/package/components/menu/menu-item-group.svelte +1 -1
- package/package/components/menu/menu-item-group.svelte.d.ts +7 -7
- package/package/components/menu/menu-item-radio.svelte +1 -1
- package/package/components/menu/menu-item-radio.svelte.d.ts +16 -16
- package/package/components/menu/menu-item.svelte +32 -19
- package/package/components/menu/menu-item.svelte.d.ts +32 -18
- package/package/components/menu/menu.svelte +13 -7
- package/package/components/menu/menu.svelte.d.ts +7 -7
- package/package/components/radio/radio-group.svelte +6 -1
- package/package/components/radio/radio-group.svelte.d.ts +15 -15
- package/package/components/radio/radio.svelte +1 -1
- package/package/components/radio/radio.svelte.d.ts +14 -14
- package/package/components/select/combobox.svelte +10 -8
- package/package/components/select/combobox.svelte.d.ts +22 -16
- package/package/components/select/select.svelte.d.ts +12 -12
- package/package/components/slider/slider.svelte +26 -22
- package/package/components/slider/slider.svelte.d.ts +23 -23
- package/package/components/switch/switch.svelte +5 -0
- package/package/components/switch/switch.svelte.d.ts +18 -14
- package/package/components/table/table-body.svelte.d.ts +4 -4
- package/package/components/table/table-cell.svelte.d.ts +2 -2
- package/package/components/table/table-col-header.svelte.d.ts +2 -2
- package/package/components/table/table-foot.svelte.d.ts +2 -2
- package/package/components/table/table-head.svelte.d.ts +2 -2
- package/package/components/table/table-row-header.svelte.d.ts +2 -2
- package/package/components/table/table-row.svelte.d.ts +2 -2
- package/package/components/table/table.svelte.d.ts +2 -2
- package/package/components/tabs/tab-box.svelte +30 -0
- package/package/components/tabs/tab-box.svelte.d.ts +33 -0
- package/package/components/tabs/tab-list.svelte +105 -22
- package/package/components/tabs/tab-list.svelte.d.ts +10 -10
- package/package/components/tabs/tab-panel.svelte +6 -2
- package/package/components/tabs/tab-panel.svelte.d.ts +2 -2
- package/package/components/tabs/tab-panels.svelte +32 -0
- package/package/components/tabs/tab-panels.svelte.d.ts +31 -0
- package/package/components/tabs/tab.svelte.d.ts +11 -11
- package/package/components/text-field/markdown-editor.svelte.d.ts +12 -12
- package/package/components/text-field/number-input.svelte +11 -4
- package/package/components/text-field/number-input.svelte.d.ts +40 -20
- package/package/components/text-field/password-input.svelte +7 -3
- package/package/components/text-field/password-input.svelte.d.ts +30 -18
- package/package/components/text-field/search-bar.svelte +7 -3
- package/package/components/text-field/search-bar.svelte.d.ts +46 -36
- package/package/components/text-field/text-area.svelte +4 -2
- package/package/components/text-field/text-area.svelte.d.ts +25 -21
- package/package/components/text-field/text-input.svelte +17 -2
- package/package/components/text-field/text-input.svelte.d.ts +53 -53
- package/package/components/toast/toast.svelte +16 -12
- package/package/components/toast/toast.svelte.d.ts +8 -8
- package/package/components/toolbar/toolbar.svelte.d.ts +8 -8
- package/package/components/util/app-shell.svelte +22 -6
- package/package/components/util/app-shell.svelte.d.ts +2 -0
- package/package/components/util/group.svelte.d.ts +5 -5
- package/package/components/util/modal.svelte +26 -9
- package/package/components/util/modal.svelte.d.ts +34 -34
- package/package/components/util/popup.svelte +35 -13
- package/package/components/util/popup.svelte.d.ts +33 -28
- package/package/components/util/portal.svelte +5 -3
- package/package/components/util/portal.svelte.d.ts +2 -2
- package/package/index.d.ts +5 -3
- package/package/index.js +6 -4
- package/package/services/events.d.ts +1 -1
- package/package/services/events.js +11 -8
- package/package/services/group.js +100 -30
- package/package/services/popup.d.ts +27 -13
- package/package/services/popup.js +23 -9
- package/package/services/util.d.ts +2 -2
- package/package/services/util.js +5 -5
- package/package/styles/core.scss +1 -0
- package/package/styles/variables.scss +1 -0
- package/package.json +39 -23
|
@@ -30,9 +30,14 @@
|
|
|
30
30
|
export let popupPosition = 'bottom-left';
|
|
31
31
|
/**
|
|
32
32
|
* The base element of {@link popupPosition}. If omitted, this will be {@link buttonComponent}.
|
|
33
|
-
* @type {HTMLElement}
|
|
33
|
+
* @type {HTMLElement | undefined}
|
|
34
34
|
*/
|
|
35
35
|
export let popupPositionBaseElement = undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Whether to show the backdrop for the popup.
|
|
38
|
+
* @type {boolean}
|
|
39
|
+
*/
|
|
40
|
+
export let showPopupBackdrop = false;
|
|
36
41
|
/**
|
|
37
42
|
* Text label displayed on the button.
|
|
38
43
|
* @type {string}
|
|
@@ -68,7 +73,7 @@
|
|
|
68
73
|
* Move focus to the `<button>` element.
|
|
69
74
|
*/
|
|
70
75
|
export const focus = () => {
|
|
71
|
-
buttonComponent?.element
|
|
76
|
+
buttonComponent?.element?.focus();
|
|
72
77
|
};
|
|
73
78
|
</script>
|
|
74
79
|
|
|
@@ -95,6 +100,7 @@
|
|
|
95
100
|
anchor={buttonComponent?.element}
|
|
96
101
|
position={popupPosition}
|
|
97
102
|
positionBaseElement={popupPositionBaseElement}
|
|
103
|
+
showBackdrop={showPopupBackdrop}
|
|
98
104
|
bind:this={popupComponent}
|
|
99
105
|
>
|
|
100
106
|
<slot name="popup" />
|
|
@@ -7,16 +7,17 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export default class MenuButton extends SvelteComponent<{
|
|
9
9
|
[x: string]: any;
|
|
10
|
-
class?: string;
|
|
11
|
-
focus?: () => void;
|
|
12
|
-
label?: string;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
size?: "small" | "medium" | "large";
|
|
15
|
-
hidden?: boolean;
|
|
16
|
-
variant?: "link" | "primary" | "secondary" | "tertiary" | "ghost";
|
|
17
|
-
iconic?: boolean;
|
|
18
|
-
popupPosition?: PopupPosition;
|
|
19
|
-
|
|
10
|
+
class?: string | undefined;
|
|
11
|
+
focus?: (() => void) | undefined;
|
|
12
|
+
label?: string | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
15
|
+
hidden?: boolean | undefined;
|
|
16
|
+
variant?: "link" | "primary" | "secondary" | "tertiary" | "ghost" | undefined;
|
|
17
|
+
iconic?: boolean | undefined;
|
|
18
|
+
popupPosition?: PopupPosition | undefined;
|
|
19
|
+
showPopupBackdrop?: boolean | undefined;
|
|
20
|
+
popupPositionBaseElement?: HTMLElement | undefined;
|
|
20
21
|
}, {
|
|
21
22
|
[evt: string]: CustomEvent<any>;
|
|
22
23
|
}, {
|
|
@@ -38,16 +39,17 @@ import { SvelteComponent } from "svelte";
|
|
|
38
39
|
declare const __propDef: {
|
|
39
40
|
props: {
|
|
40
41
|
[x: string]: any;
|
|
41
|
-
class?: string;
|
|
42
|
-
focus?: () => void;
|
|
43
|
-
label?: string;
|
|
44
|
-
disabled?: boolean;
|
|
45
|
-
size?:
|
|
42
|
+
class?: string | undefined;
|
|
43
|
+
focus?: (() => void) | undefined;
|
|
44
|
+
label?: string | undefined;
|
|
45
|
+
disabled?: boolean | undefined;
|
|
46
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
46
47
|
hidden?: boolean | undefined;
|
|
47
48
|
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'link' | undefined;
|
|
48
|
-
iconic?: boolean;
|
|
49
|
-
popupPosition?: PopupPosition;
|
|
50
|
-
|
|
49
|
+
iconic?: boolean | undefined;
|
|
50
|
+
popupPosition?: PopupPosition | undefined;
|
|
51
|
+
showPopupBackdrop?: boolean | undefined;
|
|
52
|
+
popupPositionBaseElement?: HTMLElement | undefined;
|
|
51
53
|
};
|
|
52
54
|
events: {
|
|
53
55
|
[evt: string]: CustomEvent<any>;
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export default class MenuItemCheckbox extends SvelteComponent<{
|
|
9
9
|
[x: string]: any;
|
|
10
|
-
class?: string;
|
|
11
|
-
label?: string;
|
|
12
|
-
checked?: boolean;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
hidden?: boolean;
|
|
15
|
-
iconName?: string;
|
|
16
|
-
iconLabel?: string;
|
|
10
|
+
class?: string | undefined;
|
|
11
|
+
label?: string | undefined;
|
|
12
|
+
checked?: boolean | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
hidden?: boolean | undefined;
|
|
15
|
+
iconName?: string | undefined;
|
|
16
|
+
iconLabel?: string | undefined;
|
|
17
17
|
}, {
|
|
18
18
|
click: MouseEvent;
|
|
19
|
-
select:
|
|
20
|
-
change:
|
|
19
|
+
select: CustomEvent<any>;
|
|
20
|
+
change: CustomEvent<any>;
|
|
21
21
|
} & {
|
|
22
22
|
[evt: string]: CustomEvent<any>;
|
|
23
23
|
}, {
|
|
@@ -31,18 +31,18 @@ import { SvelteComponent } from "svelte";
|
|
|
31
31
|
declare const __propDef: {
|
|
32
32
|
props: {
|
|
33
33
|
[x: string]: any;
|
|
34
|
-
class?: string;
|
|
34
|
+
class?: string | undefined;
|
|
35
35
|
label?: string | undefined;
|
|
36
|
-
checked?: boolean;
|
|
37
|
-
disabled?: boolean;
|
|
36
|
+
checked?: boolean | undefined;
|
|
37
|
+
disabled?: boolean | undefined;
|
|
38
38
|
hidden?: boolean | undefined;
|
|
39
|
-
iconName?: string;
|
|
40
|
-
iconLabel?: string;
|
|
39
|
+
iconName?: string | undefined;
|
|
40
|
+
iconLabel?: string | undefined;
|
|
41
41
|
};
|
|
42
42
|
events: {
|
|
43
43
|
click: MouseEvent;
|
|
44
|
-
select:
|
|
45
|
-
change:
|
|
44
|
+
select: CustomEvent<any>;
|
|
45
|
+
change: CustomEvent<any>;
|
|
46
46
|
} & {
|
|
47
47
|
[evt: string]: CustomEvent<any>;
|
|
48
48
|
};
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
/** A menu item group. */
|
|
5
5
|
export default class MenuItemGroup extends SvelteComponent<{
|
|
6
6
|
[x: string]: any;
|
|
7
|
-
class?: string;
|
|
8
|
-
title?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
hidden?: boolean;
|
|
7
|
+
class?: string | undefined;
|
|
8
|
+
title?: string | undefined;
|
|
9
|
+
disabled?: boolean | undefined;
|
|
10
|
+
hidden?: boolean | undefined;
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {
|
|
@@ -21,9 +21,9 @@ import { SvelteComponent } from "svelte";
|
|
|
21
21
|
declare const __propDef: {
|
|
22
22
|
props: {
|
|
23
23
|
[x: string]: any;
|
|
24
|
-
class?: string;
|
|
25
|
-
title?: string;
|
|
26
|
-
disabled?: boolean;
|
|
24
|
+
class?: string | undefined;
|
|
25
|
+
title?: string | undefined;
|
|
26
|
+
disabled?: boolean | undefined;
|
|
27
27
|
hidden?: boolean | undefined;
|
|
28
28
|
};
|
|
29
29
|
events: {
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class MenuItemRadio extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
12
|
-
label?: string;
|
|
13
|
-
checked?: boolean;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
hidden?: boolean;
|
|
16
|
-
iconName?: string;
|
|
17
|
-
iconLabel?: string;
|
|
11
|
+
class?: string | undefined;
|
|
12
|
+
label?: string | undefined;
|
|
13
|
+
checked?: boolean | undefined;
|
|
14
|
+
disabled?: boolean | undefined;
|
|
15
|
+
hidden?: boolean | undefined;
|
|
16
|
+
iconName?: string | undefined;
|
|
17
|
+
iconLabel?: string | undefined;
|
|
18
18
|
}, {
|
|
19
19
|
click: MouseEvent;
|
|
20
|
-
select:
|
|
21
|
-
change:
|
|
20
|
+
select: CustomEvent<any>;
|
|
21
|
+
change: CustomEvent<any>;
|
|
22
22
|
} & {
|
|
23
23
|
[evt: string]: CustomEvent<any>;
|
|
24
24
|
}, {
|
|
@@ -32,18 +32,18 @@ import { SvelteComponent } from "svelte";
|
|
|
32
32
|
declare const __propDef: {
|
|
33
33
|
props: {
|
|
34
34
|
[x: string]: any;
|
|
35
|
-
class?: string;
|
|
35
|
+
class?: string | undefined;
|
|
36
36
|
label?: string | undefined;
|
|
37
|
-
checked?: boolean;
|
|
38
|
-
disabled?: boolean;
|
|
37
|
+
checked?: boolean | undefined;
|
|
38
|
+
disabled?: boolean | undefined;
|
|
39
39
|
hidden?: boolean | undefined;
|
|
40
|
-
iconName?: string;
|
|
41
|
-
iconLabel?: string;
|
|
40
|
+
iconName?: string | undefined;
|
|
41
|
+
iconLabel?: string | undefined;
|
|
42
42
|
};
|
|
43
43
|
events: {
|
|
44
44
|
click: MouseEvent;
|
|
45
|
-
select:
|
|
46
|
-
change:
|
|
45
|
+
select: CustomEvent<any>;
|
|
46
|
+
change: CustomEvent<any>;
|
|
47
47
|
} & {
|
|
48
48
|
[evt: string]: CustomEvent<any>;
|
|
49
49
|
};
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
let buttonComponent;
|
|
50
50
|
let isPopupOpen = writable(false);
|
|
51
51
|
|
|
52
|
-
$: hasChildren = role === 'menuitem' && $$slots.
|
|
52
|
+
$: hasChildren = role === 'menuitem' && $$slots.children;
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
55
|
<div role="none" class="sui menuitem {className}" hidden={hidden || undefined}>
|
|
@@ -75,27 +75,31 @@
|
|
|
75
75
|
on:select
|
|
76
76
|
on:change
|
|
77
77
|
>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
<slot name="start-icon" slot="start-icon">
|
|
79
|
+
{#if iconName}
|
|
80
|
+
<Icon name={iconName} aria-label={iconLabel} />
|
|
81
|
+
{/if}
|
|
82
|
+
</slot>
|
|
83
|
+
<div role="none" class="content" class:label={!!label}>
|
|
84
|
+
{#if label}
|
|
85
|
+
{label}
|
|
86
|
+
{:else}
|
|
87
|
+
<slot />
|
|
88
|
+
{/if}
|
|
89
|
+
</div>
|
|
90
|
+
<slot name="end-icon" slot="end-icon" />
|
|
89
91
|
{#if hasChildren}
|
|
90
92
|
<span role="none" class="icon-outer">
|
|
91
|
-
<
|
|
93
|
+
<slot name="chevron-icon">
|
|
94
|
+
<Icon name="chevron_right" />
|
|
95
|
+
</slot>
|
|
92
96
|
</span>
|
|
93
97
|
{/if}
|
|
94
98
|
</Button>
|
|
95
99
|
{#if hasChildren}
|
|
96
100
|
<Popup anchor={buttonComponent?.element} position="right-top" bind:open={isPopupOpen}>
|
|
97
101
|
<Menu>
|
|
98
|
-
<slot />
|
|
102
|
+
<slot name="children" />
|
|
99
103
|
</Menu>
|
|
100
104
|
</Popup>
|
|
101
105
|
{/if}
|
|
@@ -106,13 +110,18 @@
|
|
|
106
110
|
}
|
|
107
111
|
.menuitem :global(button) {
|
|
108
112
|
display: flex;
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
gap: var(--sui-menuitem-gap, 4px);
|
|
114
|
+
align-items: var(--sui-menuitem-align-items, center);
|
|
115
|
+
border-radius: var(--sui-menuitem-border-radius, var(--sui-option-border-radius, 4px));
|
|
111
116
|
margin: 0 !important;
|
|
112
|
-
padding: 0 16px;
|
|
117
|
+
padding: var(--sui-menuitem-padding, 0 16px);
|
|
113
118
|
width: 100%;
|
|
114
|
-
min-width: 160px;
|
|
115
|
-
height: var(--sui-option-height);
|
|
119
|
+
min-width: var(--sui-menuitem-min-width, 160px);
|
|
120
|
+
height: var(--sui-menuitem-height, var(--sui-option-height));
|
|
121
|
+
color: var(--sui-menuitem-foreground-color, var(--sui-control-foreground-color, inherit));
|
|
122
|
+
background-color: var(--sui-menuitem-background-color, transparent);
|
|
123
|
+
font-size: var(--sui-menuitem-font-size, var(--sui-option-font-size));
|
|
124
|
+
font-weight: var(--sui-menuitem-font-weight, var(--sui-option-font-weight));
|
|
116
125
|
}
|
|
117
126
|
.menuitem :global(button[aria-checked="true"]) :global(.icon) {
|
|
118
127
|
color: var(--sui-primary-accent-color-text);
|
|
@@ -135,6 +144,10 @@
|
|
|
135
144
|
opacity: 1;
|
|
136
145
|
}
|
|
137
146
|
|
|
147
|
+
.content {
|
|
148
|
+
flex: auto;
|
|
149
|
+
}
|
|
150
|
+
|
|
138
151
|
.icon-outer {
|
|
139
152
|
flex: none;
|
|
140
153
|
width: 24px;
|
|
@@ -7,22 +7,29 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export default class MenuItem extends SvelteComponent<{
|
|
9
9
|
[x: string]: any;
|
|
10
|
-
class?: string;
|
|
11
|
-
label?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
role?: "menuitem" | "menuitemcheckbox" | "menuitemradio";
|
|
14
|
-
hidden?: boolean;
|
|
15
|
-
iconName?: string;
|
|
16
|
-
iconLabel?: string;
|
|
10
|
+
class?: string | undefined;
|
|
11
|
+
label?: string | undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
role?: "menuitem" | "menuitemcheckbox" | "menuitemradio" | undefined;
|
|
14
|
+
hidden?: boolean | undefined;
|
|
15
|
+
iconName?: string | undefined;
|
|
16
|
+
iconLabel?: string | undefined;
|
|
17
17
|
}, {
|
|
18
18
|
click: MouseEvent;
|
|
19
|
-
select:
|
|
20
|
-
change:
|
|
19
|
+
select: CustomEvent<any>;
|
|
20
|
+
change: CustomEvent<any>;
|
|
21
21
|
} & {
|
|
22
22
|
[evt: string]: CustomEvent<any>;
|
|
23
23
|
}, {
|
|
24
|
-
'
|
|
24
|
+
'start-icon': {
|
|
25
|
+
slot: string;
|
|
26
|
+
};
|
|
25
27
|
default: {};
|
|
28
|
+
'end-icon': {
|
|
29
|
+
slot: string;
|
|
30
|
+
};
|
|
31
|
+
'chevron-icon': {};
|
|
32
|
+
children: {};
|
|
26
33
|
}> {
|
|
27
34
|
}
|
|
28
35
|
export type MenuItemProps = typeof __propDef.props;
|
|
@@ -32,24 +39,31 @@ import { SvelteComponent } from "svelte";
|
|
|
32
39
|
declare const __propDef: {
|
|
33
40
|
props: {
|
|
34
41
|
[x: string]: any;
|
|
35
|
-
class?: string;
|
|
42
|
+
class?: string | undefined;
|
|
36
43
|
label?: string | undefined;
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
role?:
|
|
44
|
+
disabled?: boolean | undefined;
|
|
45
|
+
role?: "menuitem" | "menuitemcheckbox" | "menuitemradio" | undefined;
|
|
39
46
|
hidden?: boolean | undefined;
|
|
40
|
-
iconName?: string;
|
|
41
|
-
iconLabel?: string;
|
|
47
|
+
iconName?: string | undefined;
|
|
48
|
+
iconLabel?: string | undefined;
|
|
42
49
|
};
|
|
43
50
|
events: {
|
|
44
51
|
click: MouseEvent;
|
|
45
|
-
select:
|
|
46
|
-
change:
|
|
52
|
+
select: CustomEvent<any>;
|
|
53
|
+
change: CustomEvent<any>;
|
|
47
54
|
} & {
|
|
48
55
|
[evt: string]: CustomEvent<any>;
|
|
49
56
|
};
|
|
50
57
|
slots: {
|
|
51
|
-
'
|
|
58
|
+
'start-icon': {
|
|
59
|
+
slot: string;
|
|
60
|
+
};
|
|
52
61
|
default: {};
|
|
62
|
+
'end-icon': {
|
|
63
|
+
slot: string;
|
|
64
|
+
};
|
|
65
|
+
'chevron-icon': {};
|
|
66
|
+
children: {};
|
|
53
67
|
};
|
|
54
68
|
};
|
|
55
69
|
export {};
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/menubar/
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
|
+
import { createEventDispatcher } from 'svelte';
|
|
8
9
|
import { activateGroup } from '../../services/group';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -23,6 +24,8 @@
|
|
|
23
24
|
* @type {boolean}
|
|
24
25
|
*/
|
|
25
26
|
export let disabled = false;
|
|
27
|
+
|
|
28
|
+
const dispatch = createEventDispatcher();
|
|
26
29
|
</script>
|
|
27
30
|
|
|
28
31
|
<div
|
|
@@ -33,7 +36,9 @@
|
|
|
33
36
|
aria-disabled={disabled}
|
|
34
37
|
{...$$restProps}
|
|
35
38
|
use:activateGroup
|
|
36
|
-
on:change
|
|
39
|
+
on:change={(/** @type {CustomEvent} */ event) => {
|
|
40
|
+
dispatch('change', event.detail);
|
|
41
|
+
}}
|
|
37
42
|
>
|
|
38
43
|
<slot />
|
|
39
44
|
</div>
|
|
@@ -42,12 +47,13 @@
|
|
|
42
47
|
display: flex;
|
|
43
48
|
flex-direction: column;
|
|
44
49
|
margin: 0;
|
|
45
|
-
border-width: 1px;
|
|
46
|
-
border-
|
|
47
|
-
border-
|
|
48
|
-
|
|
50
|
+
border-width: var(--sui-menu-border-width, 1px);
|
|
51
|
+
border-style: var(--sui-menu-border-style, solid);
|
|
52
|
+
border-color: var(--sui-menu-border-width, var(--sui-secondary-border-color));
|
|
53
|
+
border-radius: var(--sui-menu-border-radius, 4px);
|
|
54
|
+
padding: var(--sui-menu-padding, 4px);
|
|
49
55
|
}
|
|
50
56
|
.menu :global([role="separator"]) {
|
|
51
|
-
margin: 4px;
|
|
52
|
-
background-color: var(--sui-control-border-color);
|
|
57
|
+
margin: var(--sui-menu-divider-margin, 4px);
|
|
58
|
+
background-color: var(--sui-menu-divider-color, var(--sui-control-border-color));
|
|
53
59
|
}</style>
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class Menu extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
hidden?: boolean;
|
|
11
|
+
class?: string | undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
hidden?: boolean | undefined;
|
|
14
14
|
}, {
|
|
15
|
-
change:
|
|
15
|
+
change: CustomEvent<any>;
|
|
16
16
|
} & {
|
|
17
17
|
[evt: string]: CustomEvent<any>;
|
|
18
18
|
}, {
|
|
@@ -26,12 +26,12 @@ import { SvelteComponent } from "svelte";
|
|
|
26
26
|
declare const __propDef: {
|
|
27
27
|
props: {
|
|
28
28
|
[x: string]: any;
|
|
29
|
-
class?: string;
|
|
30
|
-
disabled?: boolean;
|
|
29
|
+
class?: string | undefined;
|
|
30
|
+
disabled?: boolean | undefined;
|
|
31
31
|
hidden?: boolean | undefined;
|
|
32
32
|
};
|
|
33
33
|
events: {
|
|
34
|
-
change:
|
|
34
|
+
change: CustomEvent<any>;
|
|
35
35
|
} & {
|
|
36
36
|
[evt: string]: CustomEvent<any>;
|
|
37
37
|
};
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
|
+
import { createEventDispatcher } from 'svelte';
|
|
8
9
|
import { activateGroup } from '../../services/group';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -43,6 +44,8 @@
|
|
|
43
44
|
* @type {'horizontal' | 'vertical'}
|
|
44
45
|
*/
|
|
45
46
|
export let orientation = 'horizontal';
|
|
47
|
+
|
|
48
|
+
const dispatch = createEventDispatcher();
|
|
46
49
|
</script>
|
|
47
50
|
|
|
48
51
|
<div
|
|
@@ -58,7 +61,9 @@
|
|
|
58
61
|
aria-orientation={orientation}
|
|
59
62
|
{...$$restProps}
|
|
60
63
|
use:activateGroup
|
|
61
|
-
on:change
|
|
64
|
+
on:change={(/** @type {CustomEvent} */ event) => {
|
|
65
|
+
dispatch('change', event.detail);
|
|
66
|
+
}}
|
|
62
67
|
>
|
|
63
68
|
<div role="none" class="inner" inert={disabled}>
|
|
64
69
|
<slot />
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class RadioGroup extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
12
|
-
invalid?: boolean;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
required?: boolean;
|
|
15
|
-
hidden?: boolean;
|
|
16
|
-
readonly?: boolean;
|
|
17
|
-
orientation?: "vertical" | "horizontal";
|
|
11
|
+
class?: string | undefined;
|
|
12
|
+
invalid?: boolean | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
required?: boolean | undefined;
|
|
15
|
+
hidden?: boolean | undefined;
|
|
16
|
+
readonly?: boolean | undefined;
|
|
17
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
18
18
|
}, {
|
|
19
|
-
change:
|
|
19
|
+
change: CustomEvent<any>;
|
|
20
20
|
} & {
|
|
21
21
|
[evt: string]: CustomEvent<any>;
|
|
22
22
|
}, {
|
|
@@ -30,16 +30,16 @@ import { SvelteComponent } from "svelte";
|
|
|
30
30
|
declare const __propDef: {
|
|
31
31
|
props: {
|
|
32
32
|
[x: string]: any;
|
|
33
|
-
class?: string;
|
|
34
|
-
invalid?: boolean;
|
|
35
|
-
disabled?: boolean;
|
|
36
|
-
required?: boolean;
|
|
33
|
+
class?: string | undefined;
|
|
34
|
+
invalid?: boolean | undefined;
|
|
35
|
+
disabled?: boolean | undefined;
|
|
36
|
+
required?: boolean | undefined;
|
|
37
37
|
hidden?: boolean | undefined;
|
|
38
|
-
readonly?: boolean;
|
|
39
|
-
orientation?:
|
|
38
|
+
readonly?: boolean | undefined;
|
|
39
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
40
40
|
};
|
|
41
41
|
events: {
|
|
42
|
-
change:
|
|
42
|
+
change: CustomEvent<any>;
|
|
43
43
|
} & {
|
|
44
44
|
[evt: string]: CustomEvent<any>;
|
|
45
45
|
};
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export default class Radio extends SvelteComponent<{
|
|
11
11
|
[x: string]: any;
|
|
12
|
-
class?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
label?: string;
|
|
15
|
-
checked?: boolean;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
value?: string;
|
|
18
|
-
hidden?: boolean;
|
|
12
|
+
class?: string | undefined;
|
|
13
|
+
name?: string | undefined;
|
|
14
|
+
label?: string | undefined;
|
|
15
|
+
checked?: boolean | undefined;
|
|
16
|
+
disabled?: boolean | undefined;
|
|
17
|
+
value?: string | undefined;
|
|
18
|
+
hidden?: boolean | undefined;
|
|
19
19
|
}, {
|
|
20
|
-
select:
|
|
21
|
-
change:
|
|
20
|
+
select: CustomEvent<any>;
|
|
21
|
+
change: CustomEvent<any>;
|
|
22
22
|
} & {
|
|
23
23
|
[evt: string]: CustomEvent<any>;
|
|
24
24
|
}, {
|
|
@@ -32,17 +32,17 @@ import { SvelteComponent } from "svelte";
|
|
|
32
32
|
declare const __propDef: {
|
|
33
33
|
props: {
|
|
34
34
|
[x: string]: any;
|
|
35
|
-
class?: string;
|
|
35
|
+
class?: string | undefined;
|
|
36
36
|
name?: string | undefined;
|
|
37
37
|
label?: string | undefined;
|
|
38
|
-
checked?: boolean;
|
|
39
|
-
disabled?: boolean;
|
|
38
|
+
checked?: boolean | undefined;
|
|
39
|
+
disabled?: boolean | undefined;
|
|
40
40
|
value?: string | undefined;
|
|
41
41
|
hidden?: boolean | undefined;
|
|
42
42
|
};
|
|
43
43
|
events: {
|
|
44
|
-
select:
|
|
45
|
-
change:
|
|
44
|
+
select: CustomEvent<any>;
|
|
45
|
+
change: CustomEvent<any>;
|
|
46
46
|
} & {
|
|
47
47
|
[evt: string]: CustomEvent<any>;
|
|
48
48
|
};
|