@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
|
@@ -15,11 +15,9 @@
|
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<div role="alert" class="sui alert {status}" {...$$restProps}>
|
|
18
|
-
|
|
19
|
-
<slot name="icon" />
|
|
20
|
-
{:else}
|
|
18
|
+
<slot name="icon">
|
|
21
19
|
<Icon name={status === 'success' ? 'check_circle' : status} />
|
|
22
|
-
|
|
20
|
+
</slot>
|
|
23
21
|
<slot />
|
|
24
22
|
</div>
|
|
25
23
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class Alert extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
status?: "error" | "warning" | "info" | "success";
|
|
11
|
+
status?: "error" | "warning" | "info" | "success" | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
14
14
|
}, {
|
|
@@ -23,7 +23,7 @@ import { SvelteComponent } from "svelte";
|
|
|
23
23
|
declare const __propDef: {
|
|
24
24
|
props: {
|
|
25
25
|
[x: string]: any;
|
|
26
|
-
status?:
|
|
26
|
+
status?: "error" | "warning" | "info" | "success" | undefined;
|
|
27
27
|
};
|
|
28
28
|
events: {
|
|
29
29
|
[evt: string]: CustomEvent<any>;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
<svelte:options accessors={true} />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
10
|
+
import { createEventDispatcher } from 'svelte';
|
|
10
11
|
import { activateKeyShortcuts } from '../../services/events';
|
|
11
12
|
import Popup from '../util/popup.svelte';
|
|
12
13
|
|
|
@@ -91,12 +92,23 @@
|
|
|
91
92
|
* Whether to make the button rounded.
|
|
92
93
|
*/
|
|
93
94
|
export let pill = false;
|
|
95
|
+
/**
|
|
96
|
+
* Make the button width flexible.
|
|
97
|
+
* @type {boolean}
|
|
98
|
+
*/
|
|
99
|
+
export let flex = false;
|
|
94
100
|
/**
|
|
95
101
|
* Where to show the dropdown menu.
|
|
96
102
|
* @type {PopupPosition}
|
|
97
103
|
*/
|
|
98
104
|
export let popupPosition = 'bottom-left';
|
|
105
|
+
/**
|
|
106
|
+
* Whether to show the backdrop for the popup.
|
|
107
|
+
* @type {boolean}
|
|
108
|
+
*/
|
|
109
|
+
export let showPopupBackdrop = false;
|
|
99
110
|
|
|
111
|
+
const dispatch = createEventDispatcher();
|
|
100
112
|
/**
|
|
101
113
|
* Reference to the `Popup` component.
|
|
102
114
|
* @type {Popup | undefined}
|
|
@@ -108,6 +120,7 @@
|
|
|
108
120
|
class="sui button {variant ?? ''} {size} {className}"
|
|
109
121
|
class:iconic
|
|
110
122
|
class:pill
|
|
123
|
+
class:flex
|
|
111
124
|
{type}
|
|
112
125
|
{name}
|
|
113
126
|
{value}
|
|
@@ -131,8 +144,12 @@
|
|
|
131
144
|
on:keydown
|
|
132
145
|
on:keyup
|
|
133
146
|
on:keypress
|
|
134
|
-
on:select
|
|
135
|
-
|
|
147
|
+
on:select={(/** @type {CustomEvent} */ event) => {
|
|
148
|
+
dispatch('select', event.detail);
|
|
149
|
+
}}
|
|
150
|
+
on:change={(/** @type {CustomEvent} */ event) => {
|
|
151
|
+
dispatch('change', event.detail);
|
|
152
|
+
}}
|
|
136
153
|
>
|
|
137
154
|
<slot name="start-icon" />
|
|
138
155
|
{#if variant === 'link'}
|
|
@@ -157,7 +174,13 @@
|
|
|
157
174
|
</button>
|
|
158
175
|
|
|
159
176
|
{#if $$slots.popup}
|
|
160
|
-
<Popup
|
|
177
|
+
<Popup
|
|
178
|
+
anchor={element}
|
|
179
|
+
position={popupPosition}
|
|
180
|
+
showBackdrop={showPopupBackdrop}
|
|
181
|
+
touchOptimized={true}
|
|
182
|
+
bind:this={popupComponent}
|
|
183
|
+
>
|
|
161
184
|
<slot name="popup" />
|
|
162
185
|
</Popup>
|
|
163
186
|
{/if}
|
|
@@ -171,7 +194,7 @@
|
|
|
171
194
|
border-style: solid;
|
|
172
195
|
border-color: transparent;
|
|
173
196
|
padding: 0;
|
|
174
|
-
color: var(--sui-control-foreground-color);
|
|
197
|
+
color: var(--sui-control-foreground-color, inherit);
|
|
175
198
|
background-color: transparent;
|
|
176
199
|
box-shadow: none;
|
|
177
200
|
font-family: var(--sui-control-font-family);
|
|
@@ -200,52 +223,75 @@ button:global(.primary) :global(.label:only-child), button:global(.secondary) :g
|
|
|
200
223
|
padding: 0 4px;
|
|
201
224
|
}
|
|
202
225
|
button:global(.primary) {
|
|
203
|
-
border-
|
|
204
|
-
|
|
205
|
-
|
|
226
|
+
border-width: var(--sui-button-primary-border-width, 1px);
|
|
227
|
+
border-style: var(--sui-button-primary-border-style, solid);
|
|
228
|
+
border-color: var(--sui-button-primary-border-color, var(--sui-primary-accent-color));
|
|
229
|
+
color: var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted));
|
|
230
|
+
background-color: var(--sui-button-primary-background-color, var(--sui-primary-accent-color));
|
|
231
|
+
font-weight: var(--sui-button-primary-font-weight, normal);
|
|
206
232
|
}
|
|
207
233
|
button:global(.primary):hover, button:global(.primary):focus-visible, button:global(.primary)[aria-expanded=true] {
|
|
208
|
-
|
|
234
|
+
color: var(--sui-button-primary-foreground-color-focus, initial);
|
|
235
|
+
background-color: var(--sui-button-primary-background-color-focus, var(--sui-primary-accent-color-light, initial));
|
|
209
236
|
}
|
|
210
237
|
button:global(.primary):active {
|
|
211
|
-
|
|
238
|
+
color: var(--sui-button-primary-foreground-color-active, initial);
|
|
239
|
+
background-color: var(--sui-button-primary-background-color-active, var(--sui-primary-accent-color-dark, initial));
|
|
212
240
|
}
|
|
213
241
|
button:global(.secondary) {
|
|
214
|
-
border-
|
|
215
|
-
|
|
216
|
-
|
|
242
|
+
border-width: var(--sui-button-secondary-border-width, 1px);
|
|
243
|
+
border-style: var(--sui-button-secondary-border-style, solid);
|
|
244
|
+
border-color: var(--sui-button-secondary-border-color, var(--sui-primary-accent-color));
|
|
245
|
+
color: var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text));
|
|
246
|
+
background-color: var(--sui-button-secondary-background-color, var(--sui-button-background-color));
|
|
247
|
+
font-weight: var(--sui-button-secondary-font-weight, normal);
|
|
217
248
|
}
|
|
218
249
|
button:global(.secondary):hover, button:global(.secondary):focus-visible, button:global(.secondary)[aria-expanded=true] {
|
|
219
|
-
|
|
250
|
+
color: var(--sui-button-secondary-foreground-color-focus, initial);
|
|
251
|
+
background-color: var(--sui-button-secondary-background-color-focus, var(--sui-hover-background-color, initial));
|
|
220
252
|
}
|
|
221
253
|
button:global(.secondary):active {
|
|
222
|
-
|
|
254
|
+
color: var(--sui-button-secondary-foreground-color-active, initial);
|
|
255
|
+
background-color: var(--sui-button-secondary-background-color-active, var(--sui-active-background-color));
|
|
223
256
|
}
|
|
224
257
|
button:global(.secondary)[aria-pressed=true] {
|
|
225
|
-
|
|
258
|
+
color: var(--sui-button-secondary-foreground-color-pressed, initial);
|
|
259
|
+
background-color: var(--sui-button-secondary-background-color-pressed, var(--sui-primary-accent-color, initial));
|
|
226
260
|
}
|
|
227
261
|
button:global(.tertiary) {
|
|
228
|
-
border-
|
|
229
|
-
|
|
230
|
-
|
|
262
|
+
border-width: var(--sui-button-tertiary-border-width, 1px);
|
|
263
|
+
border-style: var(--sui-button-tertiary-border-style, solid);
|
|
264
|
+
border-color: var(--sui-button-tertiary-border-color, var(--sui-button-border-color));
|
|
265
|
+
color: var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color));
|
|
266
|
+
background-color: var(--sui-button-tertiary-background-color, var(--sui-button-background-color));
|
|
267
|
+
font-weight: var(--sui-button-tertiary-font-weight, normal);
|
|
231
268
|
}
|
|
232
269
|
button:global(.tertiary):hover, button:global(.tertiary):focus-visible, button:global(.tertiary)[aria-expanded=true] {
|
|
233
|
-
|
|
270
|
+
color: var(--sui-button-tertiary-foreground-color-focus, initial);
|
|
271
|
+
background-color: var(--sui-button-tertiary-background-color-focus, var(--sui-hover-background-color, initial));
|
|
234
272
|
}
|
|
235
273
|
button:global(.tertiary):active {
|
|
236
|
-
|
|
274
|
+
color: var(--sui-button-tertiary-foreground-color-active, initial);
|
|
275
|
+
background-color: var(--sui-button-tertiary-background-color-active, var(--sui-active-background-color, initial));
|
|
237
276
|
}
|
|
238
277
|
button:global(.tertiary)[aria-pressed=true] {
|
|
239
|
-
|
|
278
|
+
color: var(--sui-button-tertiary-foreground-color-pressed, initial);
|
|
279
|
+
background-color: var(--sui-button-tertiary-background-color-pressed, var(--sui-selected-background-color, initial));
|
|
280
|
+
}
|
|
281
|
+
button:global(.ghost) {
|
|
282
|
+
font-weight: var(--sui-button-ghost-font-weight, normal);
|
|
240
283
|
}
|
|
241
284
|
button:global(.ghost):hover, button:global(.ghost):focus-visible, button:global(.ghost)[aria-expanded=true] {
|
|
242
|
-
|
|
285
|
+
color: var(--sui-button-ghost-foreground-color-focus, initial);
|
|
286
|
+
background-color: var(--sui-button-ghost-background-color-focus, var(--sui-hover-background-color, initial));
|
|
243
287
|
}
|
|
244
288
|
button:global(.ghost):active {
|
|
245
|
-
|
|
289
|
+
color: var(--sui-button-ghost-foreground-color-active, initial);
|
|
290
|
+
background-color: var(--sui-button-ghost-background-color-active, var(--sui-active-background-color, initial));
|
|
246
291
|
}
|
|
247
292
|
button:global(.ghost)[aria-pressed=true] {
|
|
248
|
-
|
|
293
|
+
color: var(--sui-button-ghost-foreground-color-pressed, initial);
|
|
294
|
+
background-color: var(--sui-button-ghost-background-color-pressed, var(--sui-selected-background-color, initial));
|
|
249
295
|
}
|
|
250
296
|
button:global(.link) {
|
|
251
297
|
outline: 0;
|
|
@@ -267,7 +313,7 @@ button:global(.small) {
|
|
|
267
313
|
border-radius: var(--sui-button-small-border-radius);
|
|
268
314
|
padding: var(--sui-button-small-padding);
|
|
269
315
|
height: var(--sui-button-small-height);
|
|
270
|
-
font-size: var(--sui-font-size-small);
|
|
316
|
+
font-size: var(--sui-button-small-font-size, var(--sui-font-size-small));
|
|
271
317
|
}
|
|
272
318
|
button:global(.small) :global(.icon) {
|
|
273
319
|
font-size: var(--sui-font-size-large);
|
|
@@ -276,17 +322,23 @@ button:global(.medium) {
|
|
|
276
322
|
border-radius: var(--sui-button-medium-border-radius);
|
|
277
323
|
padding: var(--sui-button-medium-padding);
|
|
278
324
|
height: var(--sui-button-medium-height);
|
|
325
|
+
font-size: var(--sui-button-medium-font-size, var(--sui-font-size-default));
|
|
279
326
|
}
|
|
280
327
|
button:global(.large) {
|
|
281
328
|
border-radius: var(--sui-button-large-border-radius);
|
|
282
329
|
padding: var(--sui-button-large-padding);
|
|
283
330
|
height: var(--sui-button-large-height);
|
|
284
|
-
font-size: var(--sui-font-size-large);
|
|
331
|
+
font-size: var(--sui-button-large-font-size, var(--sui-font-size-large));
|
|
285
332
|
}
|
|
286
333
|
button:global(.pill) {
|
|
287
334
|
border-radius: 80px;
|
|
288
335
|
padding: var(--sui-button-medium-pill-padding, 0 12px);
|
|
289
336
|
}
|
|
337
|
+
button:global(.flex) {
|
|
338
|
+
width: -moz-available;
|
|
339
|
+
width: -webkit-fill-available;
|
|
340
|
+
width: stretch;
|
|
341
|
+
}
|
|
290
342
|
button:global(.iconic) {
|
|
291
343
|
justify-content: center;
|
|
292
344
|
padding: 0;
|
|
@@ -8,23 +8,25 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class Button extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
12
|
-
name?: string;
|
|
13
|
-
label?: string;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
size?: "small" | "medium" | "large";
|
|
16
|
-
type?: "reset" | "submit" | "button";
|
|
17
|
-
value?: string;
|
|
18
|
-
role?: string;
|
|
19
|
-
hidden?: boolean;
|
|
20
|
-
element?: HTMLButtonElement;
|
|
21
|
-
readonly?: boolean;
|
|
22
|
-
pressed?: boolean | "mixed";
|
|
23
|
-
keyShortcuts?: string;
|
|
24
|
-
variant?: "link" | "primary" | "secondary" | "tertiary" | "ghost";
|
|
25
|
-
iconic?: boolean;
|
|
26
|
-
pill?: boolean;
|
|
27
|
-
|
|
11
|
+
class?: string | undefined;
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
label?: string | undefined;
|
|
14
|
+
disabled?: boolean | undefined;
|
|
15
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
16
|
+
type?: "reset" | "submit" | "button" | undefined;
|
|
17
|
+
value?: string | undefined;
|
|
18
|
+
role?: string | undefined;
|
|
19
|
+
hidden?: boolean | undefined;
|
|
20
|
+
element?: HTMLButtonElement | undefined;
|
|
21
|
+
readonly?: boolean | undefined;
|
|
22
|
+
pressed?: boolean | "mixed" | undefined;
|
|
23
|
+
keyShortcuts?: string | undefined;
|
|
24
|
+
variant?: "link" | "primary" | "secondary" | "tertiary" | "ghost" | undefined;
|
|
25
|
+
iconic?: boolean | undefined;
|
|
26
|
+
pill?: boolean | undefined;
|
|
27
|
+
flex?: boolean | undefined;
|
|
28
|
+
popupPosition?: PopupPosition | undefined;
|
|
29
|
+
showPopupBackdrop?: boolean | undefined;
|
|
28
30
|
}, {
|
|
29
31
|
mouseenter: MouseEvent;
|
|
30
32
|
mouseleave: MouseEvent;
|
|
@@ -36,8 +38,8 @@ export default class Button extends SvelteComponent<{
|
|
|
36
38
|
keydown: KeyboardEvent;
|
|
37
39
|
keyup: KeyboardEvent;
|
|
38
40
|
keypress: KeyboardEvent;
|
|
39
|
-
select:
|
|
40
|
-
change:
|
|
41
|
+
select: CustomEvent<any>;
|
|
42
|
+
change: CustomEvent<any>;
|
|
41
43
|
} & {
|
|
42
44
|
[evt: string]: CustomEvent<any>;
|
|
43
45
|
}, {
|
|
@@ -47,56 +49,62 @@ export default class Button extends SvelteComponent<{
|
|
|
47
49
|
popup: {};
|
|
48
50
|
}> {
|
|
49
51
|
/**accessor*/
|
|
50
|
-
set element(arg: HTMLButtonElement);
|
|
51
|
-
get element(): HTMLButtonElement;
|
|
52
|
+
set element(arg: HTMLButtonElement | undefined);
|
|
53
|
+
get element(): HTMLButtonElement | undefined;
|
|
52
54
|
/**accessor*/
|
|
53
|
-
set class(arg: string);
|
|
54
|
-
get class(): string;
|
|
55
|
+
set class(arg: string | undefined);
|
|
56
|
+
get class(): string | undefined;
|
|
55
57
|
/**accessor*/
|
|
56
|
-
set type(arg: "reset" | "submit" | "button");
|
|
57
|
-
get type(): "reset" | "submit" | "button";
|
|
58
|
+
set type(arg: "reset" | "submit" | "button" | undefined);
|
|
59
|
+
get type(): "reset" | "submit" | "button" | undefined;
|
|
58
60
|
/**accessor*/
|
|
59
|
-
set role(arg: string);
|
|
60
|
-
get role(): string;
|
|
61
|
+
set role(arg: string | undefined);
|
|
62
|
+
get role(): string | undefined;
|
|
61
63
|
/**accessor*/
|
|
62
|
-
set name(arg: string);
|
|
63
|
-
get name(): string;
|
|
64
|
+
set name(arg: string | undefined);
|
|
65
|
+
get name(): string | undefined;
|
|
64
66
|
/**accessor*/
|
|
65
|
-
set value(arg: string);
|
|
66
|
-
get value(): string;
|
|
67
|
+
set value(arg: string | undefined);
|
|
68
|
+
get value(): string | undefined;
|
|
67
69
|
/**accessor*/
|
|
68
|
-
set hidden(arg: boolean);
|
|
69
|
-
get hidden(): boolean;
|
|
70
|
+
set hidden(arg: boolean | undefined);
|
|
71
|
+
get hidden(): boolean | undefined;
|
|
70
72
|
/**accessor*/
|
|
71
|
-
set disabled(arg: boolean);
|
|
72
|
-
get disabled(): boolean;
|
|
73
|
+
set disabled(arg: boolean | undefined);
|
|
74
|
+
get disabled(): boolean | undefined;
|
|
73
75
|
/**accessor*/
|
|
74
|
-
set readonly(arg: boolean);
|
|
75
|
-
get readonly(): boolean;
|
|
76
|
+
set readonly(arg: boolean | undefined);
|
|
77
|
+
get readonly(): boolean | undefined;
|
|
76
78
|
/**accessor*/
|
|
77
|
-
set pressed(arg: boolean | "mixed");
|
|
78
|
-
get pressed(): boolean | "mixed";
|
|
79
|
+
set pressed(arg: boolean | "mixed" | undefined);
|
|
80
|
+
get pressed(): boolean | "mixed" | undefined;
|
|
79
81
|
/**accessor*/
|
|
80
|
-
set keyShortcuts(arg: string);
|
|
81
|
-
get keyShortcuts(): string;
|
|
82
|
+
set keyShortcuts(arg: string | undefined);
|
|
83
|
+
get keyShortcuts(): string | undefined;
|
|
82
84
|
/**accessor*/
|
|
83
|
-
set label(arg: string);
|
|
84
|
-
get label(): string;
|
|
85
|
+
set label(arg: string | undefined);
|
|
86
|
+
get label(): string | undefined;
|
|
85
87
|
/**accessor*/
|
|
86
|
-
set variant(arg: "link" | "primary" | "secondary" | "tertiary" | "ghost");
|
|
87
|
-
get variant(): "link" | "primary" | "secondary" | "tertiary" | "ghost";
|
|
88
|
+
set variant(arg: "link" | "primary" | "secondary" | "tertiary" | "ghost" | undefined);
|
|
89
|
+
get variant(): "link" | "primary" | "secondary" | "tertiary" | "ghost" | undefined;
|
|
88
90
|
/**accessor*/
|
|
89
|
-
set size(arg: "small" | "medium" | "large");
|
|
90
|
-
get size(): "small" | "medium" | "large";
|
|
91
|
+
set size(arg: "small" | "medium" | "large" | undefined);
|
|
92
|
+
get size(): "small" | "medium" | "large" | undefined;
|
|
91
93
|
/**accessor*/
|
|
92
|
-
set iconic(arg: boolean);
|
|
93
|
-
get iconic(): boolean;
|
|
94
|
+
set iconic(arg: boolean | undefined);
|
|
95
|
+
get iconic(): boolean | undefined;
|
|
94
96
|
/**accessor*/
|
|
95
|
-
set pill(arg: boolean);
|
|
96
|
-
get pill(): boolean;
|
|
97
|
+
set pill(arg: boolean | undefined);
|
|
98
|
+
get pill(): boolean | undefined;
|
|
97
99
|
/**accessor*/
|
|
98
|
-
set
|
|
99
|
-
get
|
|
100
|
+
set flex(arg: boolean | undefined);
|
|
101
|
+
get flex(): boolean | undefined;
|
|
102
|
+
/**accessor*/
|
|
103
|
+
set popupPosition(arg: PopupPosition | undefined);
|
|
104
|
+
get popupPosition(): PopupPosition | undefined;
|
|
105
|
+
/**accessor*/
|
|
106
|
+
set showPopupBackdrop(arg: boolean | undefined);
|
|
107
|
+
get showPopupBackdrop(): boolean | undefined;
|
|
100
108
|
}
|
|
101
109
|
export type ButtonProps = typeof __propDef.props;
|
|
102
110
|
export type ButtonEvents = typeof __propDef.events;
|
|
@@ -105,23 +113,25 @@ import { SvelteComponent } from "svelte";
|
|
|
105
113
|
declare const __propDef: {
|
|
106
114
|
props: {
|
|
107
115
|
[x: string]: any;
|
|
108
|
-
class?: string;
|
|
116
|
+
class?: string | undefined;
|
|
109
117
|
name?: string | undefined;
|
|
110
|
-
label?: string;
|
|
111
|
-
disabled?: boolean;
|
|
118
|
+
label?: string | undefined;
|
|
119
|
+
disabled?: boolean | undefined;
|
|
112
120
|
size?: 'small' | 'medium' | 'large' | undefined;
|
|
113
|
-
type?:
|
|
121
|
+
type?: "reset" | "submit" | "button" | undefined;
|
|
114
122
|
value?: string | undefined;
|
|
115
|
-
role?: string;
|
|
123
|
+
role?: string | undefined;
|
|
116
124
|
hidden?: boolean | undefined;
|
|
117
125
|
element?: HTMLButtonElement | undefined;
|
|
118
126
|
readonly?: boolean | undefined;
|
|
119
127
|
pressed?: boolean | 'mixed' | undefined;
|
|
120
128
|
keyShortcuts?: string | undefined;
|
|
121
129
|
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'link' | undefined;
|
|
122
|
-
iconic?: boolean;
|
|
123
|
-
pill?: boolean;
|
|
124
|
-
|
|
130
|
+
iconic?: boolean | undefined;
|
|
131
|
+
pill?: boolean | undefined;
|
|
132
|
+
flex?: boolean | undefined;
|
|
133
|
+
popupPosition?: PopupPosition | undefined;
|
|
134
|
+
showPopupBackdrop?: boolean | undefined;
|
|
125
135
|
};
|
|
126
136
|
events: {
|
|
127
137
|
mouseenter: MouseEvent;
|
|
@@ -134,8 +144,8 @@ declare const __propDef: {
|
|
|
134
144
|
keydown: KeyboardEvent;
|
|
135
145
|
keyup: KeyboardEvent;
|
|
136
146
|
keypress: KeyboardEvent;
|
|
137
|
-
select:
|
|
138
|
-
change:
|
|
147
|
+
select: CustomEvent<any>;
|
|
148
|
+
change: CustomEvent<any>;
|
|
139
149
|
} & {
|
|
140
150
|
[evt: string]: CustomEvent<any>;
|
|
141
151
|
};
|
|
@@ -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
|
/**
|
|
@@ -38,6 +39,8 @@
|
|
|
38
39
|
* @type {boolean}
|
|
39
40
|
*/
|
|
40
41
|
export let invalid = false;
|
|
42
|
+
|
|
43
|
+
const dispatch = createEventDispatcher();
|
|
41
44
|
</script>
|
|
42
45
|
|
|
43
46
|
<div
|
|
@@ -52,7 +55,9 @@
|
|
|
52
55
|
aria-invalid={invalid}
|
|
53
56
|
{...$$restProps}
|
|
54
57
|
use:activateGroup
|
|
55
|
-
on:change
|
|
58
|
+
on:change={(/** @type {CustomEvent} */ event) => {
|
|
59
|
+
dispatch('change', event.detail);
|
|
60
|
+
}}
|
|
56
61
|
>
|
|
57
62
|
<div role="none" class="inner" inert={disabled}>
|
|
58
63
|
<slot />
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class SelectButtonGroup 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;
|
|
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
17
|
}, {
|
|
18
|
-
change:
|
|
18
|
+
change: CustomEvent<any>;
|
|
19
19
|
} & {
|
|
20
20
|
[evt: string]: CustomEvent<any>;
|
|
21
21
|
}, {
|
|
@@ -29,15 +29,15 @@ import { SvelteComponent } from "svelte";
|
|
|
29
29
|
declare const __propDef: {
|
|
30
30
|
props: {
|
|
31
31
|
[x: string]: any;
|
|
32
|
-
class?: string;
|
|
33
|
-
invalid?: boolean;
|
|
34
|
-
disabled?: boolean;
|
|
35
|
-
required?: boolean;
|
|
32
|
+
class?: string | undefined;
|
|
33
|
+
invalid?: boolean | undefined;
|
|
34
|
+
disabled?: boolean | undefined;
|
|
35
|
+
required?: boolean | undefined;
|
|
36
36
|
hidden?: boolean | undefined;
|
|
37
|
-
readonly?: boolean;
|
|
37
|
+
readonly?: boolean | undefined;
|
|
38
38
|
};
|
|
39
39
|
events: {
|
|
40
|
-
change:
|
|
40
|
+
change: CustomEvent<any>;
|
|
41
41
|
} & {
|
|
42
42
|
[evt: string]: CustomEvent<any>;
|
|
43
43
|
};
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
export let size = 'medium';
|
|
52
52
|
/**
|
|
53
53
|
* Whether to only show an icon on the button and trim the padding.
|
|
54
|
+
* @type {boolean}
|
|
54
55
|
*/
|
|
55
56
|
export let iconic = false;
|
|
56
57
|
</script>
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
on:select
|
|
72
73
|
on:change
|
|
73
74
|
on:change={(event) => {
|
|
74
|
-
selected =
|
|
75
|
+
selected = event.detail.selected;
|
|
75
76
|
}}
|
|
76
77
|
>
|
|
77
78
|
<slot name="start-icon" slot="start-icon" />
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class SelectButton extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
12
|
-
label?: string;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
size?: "small" | "medium" | "large";
|
|
15
|
-
value?: string;
|
|
16
|
-
hidden?: boolean;
|
|
17
|
-
variant?: "link" | "primary" | "secondary" | "tertiary" | "ghost";
|
|
18
|
-
iconic?: boolean;
|
|
19
|
-
selected?: boolean;
|
|
11
|
+
class?: string | undefined;
|
|
12
|
+
label?: string | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
15
|
+
value?: string | undefined;
|
|
16
|
+
hidden?: boolean | undefined;
|
|
17
|
+
variant?: "link" | "primary" | "secondary" | "tertiary" | "ghost" | undefined;
|
|
18
|
+
iconic?: boolean | undefined;
|
|
19
|
+
selected?: boolean | undefined;
|
|
20
20
|
}, {
|
|
21
21
|
click: MouseEvent;
|
|
22
|
-
select:
|
|
23
|
-
change:
|
|
22
|
+
select: CustomEvent<any>;
|
|
23
|
+
change: CustomEvent<any>;
|
|
24
24
|
} & {
|
|
25
25
|
[evt: string]: CustomEvent<any>;
|
|
26
26
|
}, {
|
|
@@ -40,20 +40,20 @@ import { SvelteComponent } from "svelte";
|
|
|
40
40
|
declare const __propDef: {
|
|
41
41
|
props: {
|
|
42
42
|
[x: string]: any;
|
|
43
|
-
class?: string;
|
|
44
|
-
label?: string;
|
|
45
|
-
disabled?: boolean;
|
|
46
|
-
size?:
|
|
43
|
+
class?: string | undefined;
|
|
44
|
+
label?: string | undefined;
|
|
45
|
+
disabled?: boolean | undefined;
|
|
46
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
47
47
|
value?: string | undefined;
|
|
48
48
|
hidden?: boolean | undefined;
|
|
49
49
|
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'link' | undefined;
|
|
50
|
-
iconic?: boolean;
|
|
51
|
-
selected?: boolean;
|
|
50
|
+
iconic?: boolean | undefined;
|
|
51
|
+
selected?: boolean | undefined;
|
|
52
52
|
};
|
|
53
53
|
events: {
|
|
54
54
|
click: MouseEvent;
|
|
55
|
-
select:
|
|
56
|
-
change:
|
|
55
|
+
select: CustomEvent<any>;
|
|
56
|
+
change: CustomEvent<any>;
|
|
57
57
|
} & {
|
|
58
58
|
[evt: string]: CustomEvent<any>;
|
|
59
59
|
};
|
|
@@ -47,9 +47,14 @@
|
|
|
47
47
|
* @type {PopupPosition}
|
|
48
48
|
*/
|
|
49
49
|
export let popupPosition = 'bottom-left';
|
|
50
|
+
/**
|
|
51
|
+
* Whether to show the backdrop for the popup.
|
|
52
|
+
* @type {boolean}
|
|
53
|
+
*/
|
|
54
|
+
export let showPopupBackdrop = false;
|
|
50
55
|
|
|
51
56
|
/**
|
|
52
|
-
* @type {HTMLElement}
|
|
57
|
+
* @type {HTMLElement | undefined}
|
|
53
58
|
*/
|
|
54
59
|
let wrapper;
|
|
55
60
|
</script>
|
|
@@ -75,8 +80,11 @@
|
|
|
75
80
|
aria-label={$_('_sui.split_button.more_options')}
|
|
76
81
|
{popupPosition}
|
|
77
82
|
popupPositionBaseElement={wrapper}
|
|
83
|
+
{showPopupBackdrop}
|
|
78
84
|
>
|
|
79
|
-
<
|
|
85
|
+
<slot name="chevron-icon" slot="end-icon">
|
|
86
|
+
<Icon name="arrow_drop_down" />
|
|
87
|
+
</slot>
|
|
80
88
|
<slot name="popup" slot="popup" />
|
|
81
89
|
</MenuButton>
|
|
82
90
|
</div>
|