@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
|
@@ -5,41 +5,37 @@
|
|
|
5
5
|
@see https://w3c.github.io/aria/#row
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
|
-
import { createEventDispatcher } from 'svelte';
|
|
9
|
-
|
|
10
8
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
9
|
+
* @typedef {object} Props
|
|
10
|
+
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
11
|
+
* @property {boolean} [selected] - Whether to select the widget. An alias of the `aria-selected`
|
|
12
|
+
* attribute.
|
|
13
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
14
|
+
* @property {(event: CustomEvent) => void} [onChange] - Custom `Change` event handler.
|
|
15
|
+
* @property {(event: CustomEvent) => void} [onSelect] - Custom `Select` event handler.
|
|
13
16
|
*/
|
|
14
|
-
|
|
15
|
-
export { className as class };
|
|
17
|
+
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @type {boolean}
|
|
19
|
+
* @type {Props & Record<string, any>}
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
let {
|
|
22
|
+
/* eslint-disable prefer-const */
|
|
23
|
+
class: className,
|
|
24
|
+
selected = false,
|
|
25
|
+
children,
|
|
26
|
+
...restProps
|
|
27
|
+
/* eslint-enable prefer-const */
|
|
28
|
+
} = $props();
|
|
23
29
|
</script>
|
|
24
30
|
|
|
25
31
|
<div
|
|
32
|
+
{...restProps}
|
|
26
33
|
role="row"
|
|
27
34
|
class="sui grid-row {className}"
|
|
28
35
|
tabindex="0"
|
|
29
36
|
aria-selected={selected}
|
|
30
|
-
{...$$restProps}
|
|
31
|
-
on:click
|
|
32
|
-
on:dblclick
|
|
33
|
-
on:focus
|
|
34
|
-
on:blur
|
|
35
|
-
on:select={(/** @type {any} */ event) => {
|
|
36
|
-
dispatch('select', /** @type {CustomEvent} */ (event).detail);
|
|
37
|
-
}}
|
|
38
|
-
on:change={(/** @type {any} */ event) => {
|
|
39
|
-
dispatch('change', /** @type {CustomEvent} */ (event).detail);
|
|
40
|
-
}}
|
|
41
37
|
>
|
|
42
|
-
|
|
38
|
+
{@render children?.()}
|
|
43
39
|
</div>
|
|
44
40
|
|
|
45
41
|
<style>.grid-row {
|
|
@@ -1,52 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default GridRow;
|
|
2
|
+
type GridRow = SvelteComponent<Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* The interactive version of `<TableRow>`.
|
|
6
9
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr
|
|
7
10
|
* @see https://w3c.github.io/aria/#row
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
declare const GridRow: $$__sveltets_2_IsomorphicComponent<{
|
|
13
|
+
/**
|
|
14
|
+
* - The `class` attribute on the wrapper element.
|
|
15
|
+
*/
|
|
11
16
|
class?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* - Whether to select the widget. An alias of the `aria-selected`
|
|
19
|
+
* attribute.
|
|
20
|
+
*/
|
|
12
21
|
selected?: boolean | undefined;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
/**
|
|
23
|
+
* - Primary slot content.
|
|
24
|
+
*/
|
|
25
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* - Custom `Change` event handler.
|
|
28
|
+
*/
|
|
29
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* - Custom `Select` event handler.
|
|
32
|
+
*/
|
|
33
|
+
onSelect?: ((event: CustomEvent) => void) | undefined;
|
|
34
|
+
} & Record<string, any>, {
|
|
21
35
|
[evt: string]: CustomEvent<any>;
|
|
22
|
-
}, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
slots: {
|
|
47
|
-
default: {};
|
|
48
|
-
};
|
|
49
|
-
exports?: undefined;
|
|
50
|
-
bindings?: undefined;
|
|
36
|
+
}, {}, {}, "">;
|
|
37
|
+
type Props = {
|
|
38
|
+
/**
|
|
39
|
+
* - The `class` attribute on the wrapper element.
|
|
40
|
+
*/
|
|
41
|
+
class?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* - Whether to select the widget. An alias of the `aria-selected`
|
|
44
|
+
* attribute.
|
|
45
|
+
*/
|
|
46
|
+
selected?: boolean | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* - Primary slot content.
|
|
49
|
+
*/
|
|
50
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* - Custom `Change` event handler.
|
|
53
|
+
*/
|
|
54
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* - Custom `Select` event handler.
|
|
57
|
+
*/
|
|
58
|
+
onSelect?: ((event: CustomEvent) => void) | undefined;
|
|
51
59
|
};
|
|
52
|
-
|
|
60
|
+
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> {
|
|
61
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
62
|
+
$$bindings?: Bindings;
|
|
63
|
+
} & Exports;
|
|
64
|
+
(internal: unknown, props: Props & {
|
|
65
|
+
$$events?: Events;
|
|
66
|
+
$$slots?: Slots;
|
|
67
|
+
}): Exports & {
|
|
68
|
+
$set?: any;
|
|
69
|
+
$on?: any;
|
|
70
|
+
};
|
|
71
|
+
z_$$bindings?: Bindings;
|
|
72
|
+
}
|
|
@@ -5,44 +5,45 @@
|
|
|
5
5
|
@see https://w3c.github.io/aria/#grid
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
|
-
import {
|
|
9
|
-
import { activateGroup } from '../../services/group';
|
|
8
|
+
import { activateGroup } from '../../services/group.svelte';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @
|
|
11
|
+
* @typedef {object} Props
|
|
12
|
+
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
13
|
+
* @property {boolean} [selected] - Whether to allow selecting more than one `<GridRow>` and/or
|
|
14
|
+
* `<GridCell>`. An alias of the `aria-multiselectable` attribute.
|
|
15
|
+
* @property {boolean} [clickToSelect] - Whether to select a row by clicking on it.
|
|
16
|
+
* @property {HTMLElement | undefined} [element] - A reference to the wrapper element.
|
|
17
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
18
|
+
* @property {(event: CustomEvent) => void} [onChange] - Custom `Change` event handler.
|
|
14
19
|
*/
|
|
15
|
-
|
|
16
|
-
export { className as class };
|
|
17
|
-
/**
|
|
18
|
-
* Whether to allow selecting more than one `<GridRow>` and/or `<GridCell>`. An alias of the
|
|
19
|
-
* `aria-multiselectable` attribute.
|
|
20
|
-
* @type {boolean}
|
|
21
|
-
*/
|
|
22
|
-
export let multiple = false;
|
|
20
|
+
|
|
23
21
|
/**
|
|
24
|
-
*
|
|
22
|
+
* @type {Props & Record<string, any>}
|
|
25
23
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
let {
|
|
25
|
+
/* eslint-disable prefer-const */
|
|
26
|
+
element = $bindable(),
|
|
27
|
+
class: className,
|
|
28
|
+
multiple = false,
|
|
29
|
+
clickToSelect = true,
|
|
30
|
+
children,
|
|
31
|
+
onChange,
|
|
32
|
+
...restProps
|
|
33
|
+
/* eslint-enable prefer-const */
|
|
34
|
+
} = $props();
|
|
32
35
|
</script>
|
|
33
36
|
|
|
34
37
|
<div
|
|
38
|
+
bind:this={element}
|
|
39
|
+
{...restProps}
|
|
35
40
|
role="grid"
|
|
36
41
|
class="sui grid {className}"
|
|
37
42
|
aria-multiselectable={multiple}
|
|
38
|
-
{
|
|
39
|
-
bind:this={element}
|
|
43
|
+
{onChange}
|
|
40
44
|
use:activateGroup={{ clickToSelect }}
|
|
41
|
-
on:change={(/** @type {CustomEvent} */ event) => {
|
|
42
|
-
dispatch('change', event.detail);
|
|
43
|
-
}}
|
|
44
45
|
>
|
|
45
|
-
|
|
46
|
+
{@render children?.()}
|
|
46
47
|
</div>
|
|
47
48
|
|
|
48
49
|
<style>.grid {
|
|
@@ -1,46 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default Grid;
|
|
2
|
+
type Grid = SvelteComponent<Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "element" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* The interactive version of `<Table>`.
|
|
6
9
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table
|
|
7
10
|
* @see https://w3c.github.io/aria/#grid
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
declare const Grid: $$__sveltets_2_IsomorphicComponent<{
|
|
13
|
+
/**
|
|
14
|
+
* - The `class` attribute on the wrapper element.
|
|
15
|
+
*/
|
|
11
16
|
class?: string | undefined;
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
/**
|
|
18
|
+
* - Whether to allow selecting more than one `<GridRow>` and/or
|
|
19
|
+
* `<GridCell>`. An alias of the `aria-multiselectable` attribute.
|
|
20
|
+
*/
|
|
21
|
+
selected?: boolean | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* - Whether to select a row by clicking on it.
|
|
24
|
+
*/
|
|
14
25
|
clickToSelect?: boolean | undefined;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
/**
|
|
27
|
+
* - A reference to the wrapper element.
|
|
28
|
+
*/
|
|
29
|
+
element?: HTMLElement | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* - Primary slot content.
|
|
32
|
+
*/
|
|
33
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* - Custom `Change` event handler.
|
|
36
|
+
*/
|
|
37
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
38
|
+
} & Record<string, any>, {
|
|
18
39
|
[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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
}, {}, {}, "element">;
|
|
41
|
+
type Props = {
|
|
42
|
+
/**
|
|
43
|
+
* - The `class` attribute on the wrapper element.
|
|
44
|
+
*/
|
|
45
|
+
class?: string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* - Whether to allow selecting more than one `<GridRow>` and/or
|
|
48
|
+
* `<GridCell>`. An alias of the `aria-multiselectable` attribute.
|
|
49
|
+
*/
|
|
50
|
+
selected?: boolean | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* - Whether to select a row by clicking on it.
|
|
53
|
+
*/
|
|
54
|
+
clickToSelect?: boolean | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* - A reference to the wrapper element.
|
|
57
|
+
*/
|
|
58
|
+
element?: HTMLElement | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* - Primary slot content.
|
|
61
|
+
*/
|
|
62
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* - Custom `Change` event handler.
|
|
65
|
+
*/
|
|
66
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
45
67
|
};
|
|
46
|
-
|
|
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;
|
|
78
|
+
};
|
|
79
|
+
z_$$bindings?: Bindings;
|
|
80
|
+
}
|
|
@@ -5,22 +5,27 @@
|
|
|
5
5
|
-->
|
|
6
6
|
<script>
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
8
|
+
* @typedef {object} Props
|
|
9
|
+
* @property {string} [class] - The `class` attribute on the `span` element.
|
|
10
|
+
* @property {string} [name] - Icon name, e.g. `search`, `expand_more`, `close`, etc.
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
-
export { className as class };
|
|
12
|
+
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
* @type {string}
|
|
14
|
+
* @type {Props & Record<string, any>}
|
|
16
15
|
*/
|
|
17
|
-
|
|
16
|
+
let {
|
|
17
|
+
/* eslint-disable prefer-const */
|
|
18
|
+
class: className,
|
|
19
|
+
name,
|
|
20
|
+
...restProps
|
|
21
|
+
/* eslint-enable prefer-const */
|
|
22
|
+
} = $props();
|
|
18
23
|
</script>
|
|
19
24
|
|
|
20
25
|
<span
|
|
26
|
+
{...restProps}
|
|
21
27
|
class="sui icon material-symbols-outlined {className}"
|
|
22
|
-
aria-hidden={!('aria-label' in
|
|
23
|
-
{...$$restProps}
|
|
28
|
+
aria-hidden={!('aria-label' in restProps)}
|
|
24
29
|
>
|
|
25
30
|
{name}
|
|
26
31
|
</span>
|
|
@@ -1,33 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default Icon;
|
|
2
|
+
type Icon = SvelteComponent<Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A Material Symbols icon.
|
|
6
9
|
* @see https://developers.google.com/fonts/docs/material_symbols
|
|
7
10
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
declare const Icon: $$__sveltets_2_IsomorphicComponent<{
|
|
12
|
+
/**
|
|
13
|
+
* - The `class` attribute on the `span` element.
|
|
14
|
+
*/
|
|
10
15
|
class?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* - Icon name, e.g. `search`, `expand_more`, `close`, etc.
|
|
18
|
+
*/
|
|
11
19
|
name?: string | undefined;
|
|
12
|
-
}, {
|
|
20
|
+
} & Record<string, any>, {
|
|
13
21
|
[evt: string]: CustomEvent<any>;
|
|
14
|
-
}, {}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
name?: string | undefined;
|
|
25
|
-
};
|
|
26
|
-
events: {
|
|
27
|
-
[evt: string]: CustomEvent<any>;
|
|
28
|
-
};
|
|
29
|
-
slots: {};
|
|
30
|
-
exports?: undefined;
|
|
31
|
-
bindings?: undefined;
|
|
22
|
+
}, {}, {}, "">;
|
|
23
|
+
type Props = {
|
|
24
|
+
/**
|
|
25
|
+
* - The `class` attribute on the `span` element.
|
|
26
|
+
*/
|
|
27
|
+
class?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* - Icon name, e.g. `search`, `expand_more`, `close`, etc.
|
|
30
|
+
*/
|
|
31
|
+
name?: string | undefined;
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
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> {
|
|
34
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
35
|
+
$$bindings?: Bindings;
|
|
36
|
+
} & Exports;
|
|
37
|
+
(internal: unknown, props: Props & {
|
|
38
|
+
$$events?: Events;
|
|
39
|
+
$$slots?: Slots;
|
|
40
|
+
}): Exports & {
|
|
41
|
+
$set?: any;
|
|
42
|
+
$on?: any;
|
|
43
|
+
};
|
|
44
|
+
z_$$bindings?: Bindings;
|
|
45
|
+
}
|
|
@@ -6,85 +6,79 @@
|
|
|
6
6
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import {
|
|
10
|
-
import { activateGroup } from '../../services/group';
|
|
9
|
+
import { activateGroup } from '../../services/group.svelte';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @
|
|
15
|
-
|
|
16
|
-
let className = '';
|
|
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;
|
|
28
|
-
/**
|
|
29
|
-
* Whether to make the widget read-only. An alias of the `aria-readonly` attribute.
|
|
30
|
-
* @type {boolean}
|
|
31
|
-
*/
|
|
32
|
-
export let readonly = false;
|
|
33
|
-
/**
|
|
34
|
-
* Whether to mark the widget required. An alias of the `aria-required` attribute.
|
|
35
|
-
* @type {boolean}
|
|
36
|
-
*/
|
|
37
|
-
export let required = false;
|
|
38
|
-
/**
|
|
39
|
-
* Whether to mark the widget invalid. An alias of the `aria-invalid` attribute.
|
|
40
|
-
* @type {boolean}
|
|
41
|
-
*/
|
|
42
|
-
export let invalid = false;
|
|
43
|
-
/**
|
|
44
|
-
* Whether to allow selecting more than one `<Option>`. An alias of the `aria-multiselectable`
|
|
12
|
+
* @typedef {object} Props
|
|
13
|
+
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
14
|
+
* @property {boolean} [hidden] - Whether to hide the widget. An alias of the `aria-hidden`
|
|
45
15
|
* attribute.
|
|
46
|
-
* @
|
|
16
|
+
* @property {boolean} [disabled] - Whether to disable the widget. An alias of the `aria-disabled`
|
|
17
|
+
* attribute.
|
|
18
|
+
* @property {boolean} [readonly] - Whether to make the widget read-only. An alias of the
|
|
19
|
+
* `aria-readonly` attribute.
|
|
20
|
+
* @property {boolean} [required] - Whether to mark the widget required. An alias of the
|
|
21
|
+
* `aria-required` attribute.
|
|
22
|
+
* @property {boolean} [invalid] - Whether to mark the widget invalid. An alias of the
|
|
23
|
+
* `aria-invalid` attribute.
|
|
24
|
+
* @property {boolean} [multiple] - Whether to allow selecting more than one `<Option>`. An alias
|
|
25
|
+
* of the `aria-multiselectable` attribute.
|
|
26
|
+
* @property {string} [searchTerms] - Search terms to be used to filter the items.
|
|
27
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
28
|
+
* @property {(event: CustomEvent) => void} [onChange] - Custom `Change` event handler.
|
|
29
|
+
* @property {(event: CustomEvent) => void} [onFilter] - Custom `Filter` event handler.
|
|
47
30
|
*/
|
|
48
|
-
|
|
31
|
+
|
|
49
32
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @type {string}
|
|
33
|
+
* @type {import('../../typedefs').CommonEventHandlers & Props & Record<string, any>}
|
|
52
34
|
*/
|
|
53
|
-
|
|
35
|
+
let {
|
|
36
|
+
/* eslint-disable prefer-const */
|
|
37
|
+
class: className,
|
|
38
|
+
hidden = false,
|
|
39
|
+
disabled = false,
|
|
40
|
+
readonly = false,
|
|
41
|
+
required = false,
|
|
42
|
+
invalid = false,
|
|
43
|
+
multiple = false,
|
|
44
|
+
searchTerms = '',
|
|
45
|
+
children,
|
|
46
|
+
onFilter,
|
|
47
|
+
...restProps
|
|
48
|
+
/* eslint-enable prefer-const */
|
|
49
|
+
} = $props();
|
|
54
50
|
|
|
55
51
|
/**
|
|
56
52
|
* @type {boolean}
|
|
57
53
|
*/
|
|
58
|
-
let filtered = false;
|
|
59
|
-
|
|
60
|
-
const dispatch = createEventDispatcher();
|
|
54
|
+
let filtered = $state(false);
|
|
61
55
|
</script>
|
|
62
56
|
|
|
63
57
|
<div
|
|
58
|
+
{...restProps}
|
|
64
59
|
role="listbox"
|
|
65
60
|
class="sui listbox {className}"
|
|
66
61
|
class:filtered
|
|
67
62
|
tabindex={disabled ? -1 : 0}
|
|
68
|
-
|
|
63
|
+
{hidden}
|
|
69
64
|
aria-hidden={hidden}
|
|
70
65
|
aria-disabled={disabled}
|
|
71
66
|
aria-readonly={readonly}
|
|
72
67
|
aria-required={required}
|
|
73
68
|
aria-invalid={invalid}
|
|
74
69
|
aria-multiselectable={multiple}
|
|
75
|
-
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}}
|
|
81
|
-
on:filter
|
|
82
|
-
on:filter={(/** @type {CustomEvent} */ { detail: { matched, total } }) => {
|
|
70
|
+
onFilter={(/** @type {CustomEvent} */ event) => {
|
|
71
|
+
const {
|
|
72
|
+
detail: { matched, total },
|
|
73
|
+
} = event;
|
|
74
|
+
|
|
83
75
|
filtered = matched !== total;
|
|
76
|
+
onFilter?.(event);
|
|
84
77
|
}}
|
|
78
|
+
use:activateGroup={{ searchTerms }}
|
|
85
79
|
>
|
|
86
80
|
<div role="none" class="inner" inert={disabled}>
|
|
87
|
-
|
|
81
|
+
{@render children?.()}
|
|
88
82
|
</div>
|
|
89
83
|
</div>
|
|
90
84
|
|