@sveltia/ui 0.2.5 → 0.3.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/{core → button}/button.svelte +3 -2
- package/package/components/{core → button}/button.svelte.d.ts +5 -4
- package/package/components/{composite → button}/select-button-group.svelte +6 -3
- package/package/components/{composite → calendar}/calendar.svelte +9 -5
- package/package/components/{composite → calendar}/calendar.svelte.d.ts +1 -0
- package/package/components/{composite → checkbox}/checkbox-group.svelte +1 -1
- package/package/components/{composite → checkbox}/checkbox-group.svelte.d.ts +2 -2
- package/package/components/{core → checkbox}/checkbox.svelte +7 -5
- package/package/components/{core → checkbox}/checkbox.svelte.d.ts +4 -2
- package/package/components/{core → dialog}/dialog.svelte +4 -3
- package/package/components/{core → dialog}/dialog.svelte.d.ts +1 -0
- package/package/components/{composite → disclosure}/disclosure.svelte +5 -4
- package/package/components/{composite → disclosure}/disclosure.svelte.d.ts +2 -1
- package/package/components/{core/separator.svelte → divider/divider.svelte} +5 -4
- package/package/components/divider/divider.svelte.d.ts +29 -0
- package/package/components/{core → divider}/spacer.svelte +4 -0
- package/package/components/{core → divider}/spacer.svelte.d.ts +1 -0
- package/package/components/{core → drawer}/drawer.svelte +4 -3
- package/package/components/{core → drawer}/drawer.svelte.d.ts +1 -0
- package/package/components/{core → icon}/icon.svelte +5 -0
- package/package/components/{core → icon}/icon.svelte.d.ts +6 -2
- package/package/components/listbox/listbox.svelte +74 -0
- package/package/components/{composite → listbox}/listbox.svelte.d.ts +2 -0
- package/package/components/listbox/option-group.svelte +47 -0
- package/package/components/listbox/option-group.svelte.d.ts +38 -0
- package/package/components/{core → listbox}/option.svelte +34 -2
- package/package/components/{core → listbox}/option.svelte.d.ts +7 -3
- package/package/components/{core → menu}/menu-button.svelte +2 -16
- package/package/components/{core → menu}/menu-button.svelte.d.ts +4 -1
- package/package/components/{core → menu}/menu-item-checkbox.svelte +1 -0
- package/package/components/{core → menu}/menu-item-checkbox.svelte.d.ts +4 -1
- package/package/components/{composite → menu}/menu-item-group.svelte +5 -1
- package/package/components/{composite → menu}/menu-item-group.svelte.d.ts +1 -0
- package/package/components/{core → menu}/menu-item-radio.svelte +2 -0
- package/package/components/{core → menu}/menu-item-radio.svelte.d.ts +5 -1
- package/package/components/{core → menu}/menu-item.svelte +6 -6
- package/package/components/{core → menu}/menu-item.svelte.d.ts +4 -1
- package/package/components/{composite → menu}/menu.svelte +2 -1
- package/package/components/{composite → menu}/menu.svelte.d.ts +1 -0
- package/package/components/{composite → radio}/radio-group.svelte +6 -2
- package/package/components/{composite → radio}/radio-group.svelte.d.ts +1 -1
- package/package/components/{core → radio}/radio.svelte +6 -4
- package/package/components/{core → radio}/radio.svelte.d.ts +4 -2
- package/package/components/{composite → select}/combobox.svelte +7 -6
- package/package/components/{composite → select}/combobox.svelte.d.ts +3 -2
- package/package/components/{composite → select}/select.svelte +3 -1
- package/package/components/{composite → select}/select.svelte.d.ts +7 -3
- package/package/components/{core → slider}/slider.svelte +58 -47
- package/package/components/{core → slider}/slider.svelte.d.ts +12 -10
- package/package/components/{core → switch}/switch.svelte +36 -19
- package/package/components/{core → switch}/switch.svelte.d.ts +3 -2
- package/package/components/table/table-body.svelte +23 -0
- package/package/components/table/table-body.svelte.d.ts +34 -0
- package/package/components/table/table-cell.svelte +23 -0
- package/package/components/table/table-cell.svelte.d.ts +34 -0
- package/package/components/table/table-col-header.svelte +23 -0
- package/package/components/table/table-col-header.svelte.d.ts +34 -0
- package/package/components/table/table-foot.svelte +23 -0
- package/package/components/table/table-foot.svelte.d.ts +34 -0
- package/package/components/table/table-head.svelte +23 -0
- package/package/components/table/table-head.svelte.d.ts +34 -0
- package/package/components/table/table-row-header.svelte +23 -0
- package/package/components/table/table-row-header.svelte.d.ts +34 -0
- package/package/components/table/table-row.svelte +23 -0
- package/package/components/table/table-row.svelte.d.ts +38 -0
- package/package/components/table/table.svelte +44 -0
- package/package/components/table/table.svelte.d.ts +36 -0
- package/package/components/{composite → tabs}/tab-list.svelte +3 -2
- package/package/components/{composite → tabs}/tab-list.svelte.d.ts +6 -5
- package/package/components/{core → tabs}/tab-panel.svelte +1 -0
- package/package/components/{core → tabs}/tab-panel.svelte.d.ts +1 -0
- package/package/components/{core → tabs}/tab.svelte +2 -1
- package/package/components/{core → tabs}/tab.svelte.d.ts +1 -0
- package/package/components/{editor/markdown.svelte → text-field/markdown-editor.svelte} +10 -6
- package/package/components/text-field/markdown-editor.svelte.d.ts +26 -0
- package/package/components/{core → text-field}/number-input.svelte +13 -7
- package/package/components/{core → text-field}/number-input.svelte.d.ts +7 -3
- package/package/components/{core → text-field}/password-input.svelte +6 -3
- package/package/components/{core → text-field}/password-input.svelte.d.ts +8 -3
- package/package/components/{core → text-field}/search-bar.svelte +5 -2
- package/package/components/{core → text-field}/search-bar.svelte.d.ts +8 -3
- package/package/components/{core → text-field}/text-area.svelte +3 -1
- package/package/components/{core → text-field}/text-area.svelte.d.ts +9 -5
- package/package/components/{core → text-field}/text-input.svelte +6 -4
- package/package/components/{core → text-field}/text-input.svelte.d.ts +11 -7
- package/package/components/{core → toolbar}/toolbar.svelte +1 -0
- package/package/components/{core → toolbar}/toolbar.svelte.d.ts +2 -1
- package/package/components/util/app-shell.svelte +11 -40
- package/package/components/util/group.js +305 -0
- package/package/components/{core → util}/group.svelte +5 -11
- package/package/components/{core → util}/group.svelte.d.ts +4 -2
- package/package/components/util/popup.d.ts +30 -0
- package/package/components/{helpers → util}/popup.js +26 -25
- package/package/components/util/popup.svelte +14 -5
- package/package/components/util/{misc.d.ts → util.d.ts} +1 -0
- package/package/components/util/{misc.js → util.js} +15 -0
- package/package/index.d.ts +46 -41
- package/package/index.js +48 -83
- package/package/styles/core.scss +5 -34
- package/package/styles/variables.scss +6 -8
- package/package.json +351 -317
- package/package/components/composite/grid.svelte +0 -24
- package/package/components/composite/grid.svelte.d.ts +0 -31
- package/package/components/composite/listbox.svelte +0 -63
- package/package/components/core/grid-cell.svelte +0 -13
- package/package/components/core/grid-cell.svelte.d.ts +0 -29
- package/package/components/core/row-group.svelte +0 -13
- package/package/components/core/row-group.svelte.d.ts +0 -29
- package/package/components/core/row.svelte +0 -13
- package/package/components/core/row.svelte.d.ts +0 -33
- package/package/components/core/separator.svelte.d.ts +0 -26
- package/package/components/editor/markdown.svelte.d.ts +0 -25
- package/package/components/helpers/group.js +0 -253
- package/package/components/helpers/popup.d.ts +0 -30
- package/package/components/helpers/util.d.ts +0 -1
- package/package/components/helpers/util.js +0 -14
- package/package/components/{composite → button}/select-button-group.svelte.d.ts +4 -4
- /package/package/components/{core → button}/select-button.svelte +0 -0
- /package/package/components/{core → button}/select-button.svelte.d.ts +0 -0
- /package/package/components/{helpers → util}/group.d.ts +0 -0
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
An option within the `<Listbox>` widget. The equivalent of the HTML `<option>` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option
|
|
3
5
|
@see https://w3c.github.io/aria/#option
|
|
4
6
|
-->
|
|
5
7
|
<script>
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
+
import { onMount } from 'svelte';
|
|
9
|
+
import Button from '../button/button.svelte';
|
|
10
|
+
import Icon from '../icon/icon.svelte';
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
13
|
* CSS class name on the button.
|
|
@@ -17,10 +20,35 @@
|
|
|
17
20
|
export let label = '';
|
|
18
21
|
export let value = undefined;
|
|
19
22
|
export let selected = false;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @type {Button}
|
|
26
|
+
*/
|
|
27
|
+
let buttonComponent;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Event listener for the `select` event fired in `group.js`.
|
|
31
|
+
* @param {CustomEvent} event `select` event.
|
|
32
|
+
*/
|
|
33
|
+
const listener = ({ type }) => {
|
|
34
|
+
selected = type === 'select';
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
onMount(() => {
|
|
38
|
+
buttonComponent.element.addEventListener('select', listener);
|
|
39
|
+
buttonComponent.element.addEventListener('unselect', listener);
|
|
40
|
+
|
|
41
|
+
return () => {
|
|
42
|
+
buttonComponent.element.removeEventListener('select', listener);
|
|
43
|
+
buttonComponent.element.removeEventListener('unselect', listener);
|
|
44
|
+
};
|
|
45
|
+
});
|
|
20
46
|
</script>
|
|
21
47
|
|
|
22
48
|
<div class="sui option {className}">
|
|
23
49
|
<Button
|
|
50
|
+
bind:this={buttonComponent}
|
|
51
|
+
tabindex="-1"
|
|
24
52
|
role="option"
|
|
25
53
|
aria-selected={selected}
|
|
26
54
|
{label}
|
|
@@ -45,6 +73,9 @@
|
|
|
45
73
|
<style>.option {
|
|
46
74
|
display: contents;
|
|
47
75
|
}
|
|
76
|
+
.option:focus-visible {
|
|
77
|
+
outline-width: 0 !important;
|
|
78
|
+
}
|
|
48
79
|
.option :global([role="option"]) {
|
|
49
80
|
flex: none;
|
|
50
81
|
display: flex;
|
|
@@ -56,6 +87,7 @@
|
|
|
56
87
|
height: var(--option--medium--height);
|
|
57
88
|
white-space: nowrap;
|
|
58
89
|
}
|
|
90
|
+
.option :global(.focused),
|
|
59
91
|
.option :global([role="option"]:hover) {
|
|
60
92
|
color: var(--highlight-foreground-color);
|
|
61
93
|
background-color: var(--highlight-background-color);
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} OptionProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} OptionEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} OptionSlots */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* An option within the `<Listbox>` widget. The equivalent of the HTML `<option>` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option
|
|
7
|
+
* @see https://w3c.github.io/aria/#option
|
|
8
|
+
*/
|
|
5
9
|
export default class Option extends SvelteComponentTyped<{
|
|
6
10
|
[x: string]: any;
|
|
7
11
|
label?: string;
|
|
8
|
-
class?: string;
|
|
9
12
|
value?: any;
|
|
13
|
+
class?: string;
|
|
10
14
|
selected?: boolean;
|
|
11
15
|
}, {
|
|
12
16
|
click: MouseEvent;
|
|
@@ -34,8 +38,8 @@ declare const __propDef: {
|
|
|
34
38
|
props: {
|
|
35
39
|
[x: string]: any;
|
|
36
40
|
label?: string;
|
|
37
|
-
class?: string;
|
|
38
41
|
value?: any;
|
|
42
|
+
class?: string;
|
|
39
43
|
selected?: boolean;
|
|
40
44
|
};
|
|
41
45
|
events: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
A button to open a `<Menu>` widget.
|
|
3
4
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/
|
|
4
5
|
-->
|
|
5
6
|
<script>
|
|
7
|
+
import Button from '../button/button.svelte';
|
|
6
8
|
import Popup from '../util/popup.svelte';
|
|
7
|
-
import Button from './button.svelte';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* CSS class name on the button.
|
|
@@ -31,21 +32,6 @@
|
|
|
31
32
|
aria-haspopup="menu"
|
|
32
33
|
{...$$restProps}
|
|
33
34
|
bind:this={buttonComponent}
|
|
34
|
-
on:keydown={(event) => {
|
|
35
|
-
const { key, ctrlKey, metaKey, shiftKey, altKey } = event;
|
|
36
|
-
|
|
37
|
-
if (['ArrowUp', 'ArrowDown'].includes(key) && !ctrlKey && !metaKey && !shiftKey && !altKey) {
|
|
38
|
-
event.preventDefault();
|
|
39
|
-
|
|
40
|
-
const members = [
|
|
41
|
-
...popupComponent.dialog.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])'),
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
if (members.length) {
|
|
45
|
-
/** @type {HTMLElement} */ (key === 'ArrowUp' ? members.pop() : members.shift()).focus();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}}
|
|
49
35
|
>
|
|
50
36
|
<slot name="start-icon" slot="start-icon" />
|
|
51
37
|
<slot />
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} MenuButtonProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} MenuButtonEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MenuButtonSlots */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A button to open a `<Menu>` widget.
|
|
6
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/
|
|
7
|
+
*/
|
|
5
8
|
export default class MenuButton extends SvelteComponentTyped<{
|
|
6
9
|
[x: string]: any;
|
|
7
10
|
class?: string;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} MenuItemCheckboxProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} MenuItemCheckboxEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MenuItemCheckboxSlots */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A menu item widget with a checkbox.
|
|
6
|
+
* @see https://w3c.github.io/aria/#menuitemcheckbox
|
|
7
|
+
*/
|
|
5
8
|
export default class MenuItemCheckbox extends SvelteComponentTyped<{
|
|
6
9
|
[x: string]: any;
|
|
7
10
|
class?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} MenuItemGroupProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} MenuItemGroupEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MenuItemGroupSlots */
|
|
4
|
+
/** A menu item group. */
|
|
4
5
|
export default class MenuItemGroup extends SvelteComponentTyped<{
|
|
5
6
|
[x: string]: any;
|
|
6
7
|
title?: string;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} MenuItemRadioProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} MenuItemRadioEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MenuItemRadioSlots */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A menu item widget with a radio. Only one item can be selected within the parent `<Menu>` or
|
|
6
|
+
* `<MenuItemGroup>` component.
|
|
7
|
+
* @see https://w3c.github.io/aria/#menuitemradio
|
|
8
|
+
*/
|
|
5
9
|
export default class MenuItemRadio extends SvelteComponentTyped<{
|
|
6
10
|
[x: string]: any;
|
|
7
11
|
class?: string;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
A menu item widget.
|
|
3
4
|
@see https://w3c.github.io/aria/#menuitem
|
|
4
5
|
-->
|
|
5
6
|
<script>
|
|
6
7
|
import { writable } from 'svelte/store';
|
|
7
|
-
import
|
|
8
|
+
import Button from '../button/button.svelte';
|
|
9
|
+
import Icon from '../icon/icon.svelte';
|
|
8
10
|
import Popup from '../util/popup.svelte';
|
|
9
|
-
import
|
|
10
|
-
import Icon from './icon.svelte';
|
|
11
|
+
import Menu from './menu.svelte';
|
|
11
12
|
|
|
12
13
|
let className = '';
|
|
13
14
|
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
{role}
|
|
37
38
|
aria-checked={checked}
|
|
38
39
|
aria-haspopup={hasChildren ? 'menu' : undefined}
|
|
39
|
-
aria-expanded={$isPopupOpen ? true : undefined}
|
|
40
|
+
aria-expanded={hasChildren && $isPopupOpen ? true : undefined}
|
|
40
41
|
{...$$restProps}
|
|
41
42
|
bind:this={buttonComponent}
|
|
42
43
|
on:click
|
|
@@ -90,8 +91,7 @@
|
|
|
90
91
|
.menuitem :global(button[aria-checked="true"]) :global(.icon) {
|
|
91
92
|
color: var(--primary-accent-color-lighter);
|
|
92
93
|
}
|
|
93
|
-
.menuitem :global(button:hover)
|
|
94
|
-
.menuitem :global(button:focus) {
|
|
94
|
+
.menuitem :global(button:hover) {
|
|
95
95
|
color: var(--highlight-foreground-color);
|
|
96
96
|
background-color: var(--highlight-background-color);
|
|
97
97
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} MenuItemProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} MenuItemEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MenuItemSlots */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A menu item widget.
|
|
6
|
+
* @see https://w3c.github.io/aria/#menuitem
|
|
7
|
+
*/
|
|
5
8
|
export default class MenuItem extends SvelteComponentTyped<{
|
|
6
9
|
[x: string]: any;
|
|
7
10
|
label?: string;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
A menu widget.
|
|
3
4
|
@see https://w3c.github.io/aria/#menu
|
|
4
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/menubar/
|
|
5
6
|
-->
|
|
6
7
|
<svelte:options accessors={true} />
|
|
7
8
|
|
|
8
9
|
<script>
|
|
9
|
-
import { activateGroup } from '../
|
|
10
|
+
import { activateGroup } from '../util/group';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* CSS class name on the button.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
|
-
import { activateGroup } from '../
|
|
8
|
+
import { activateGroup } from '../util/group';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* CSS class name on the button.
|
|
@@ -24,8 +24,9 @@
|
|
|
24
24
|
|
|
25
25
|
<div
|
|
26
26
|
class="sui radio-group {className} {orientation}"
|
|
27
|
+
tabindex="-1"
|
|
27
28
|
role="radiogroup"
|
|
28
|
-
|
|
29
|
+
aria-orientation={orientation}
|
|
29
30
|
bind:this={element}
|
|
30
31
|
on:select
|
|
31
32
|
use:activateGroup
|
|
@@ -36,6 +37,9 @@
|
|
|
36
37
|
<style>.radio-group {
|
|
37
38
|
display: inline-flex;
|
|
38
39
|
}
|
|
40
|
+
.radio-group:focus-visible {
|
|
41
|
+
outline-width: 0 !important;
|
|
42
|
+
}
|
|
39
43
|
.radio-group.horizontal {
|
|
40
44
|
gap: 16px;
|
|
41
45
|
align-items: center;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
The equivalent of the HTML `<input type="radio">` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio
|
|
3
5
|
@see https://w3c.github.io/aria/#radio
|
|
4
6
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
5
7
|
-->
|
|
6
8
|
<script>
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
9
|
+
import Button from '../button/button.svelte';
|
|
10
|
+
import Icon from '../icon/icon.svelte';
|
|
11
|
+
import { getRandomId } from '../util/util';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* CSS class name on the button.
|
|
@@ -95,7 +97,7 @@
|
|
|
95
97
|
justify-content: center;
|
|
96
98
|
overflow: hidden;
|
|
97
99
|
border-width: 2px;
|
|
98
|
-
border-color: var(--
|
|
100
|
+
border-color: var(--checkbox-border-color);
|
|
99
101
|
border-radius: 24px;
|
|
100
102
|
width: 20px;
|
|
101
103
|
height: 20px;
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} RadioEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} RadioSlots */
|
|
4
4
|
/**
|
|
5
|
+
* The equivalent of the HTML `<input type="radio">` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio
|
|
5
7
|
* @see https://w3c.github.io/aria/#radio
|
|
6
8
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
7
9
|
*/
|
|
8
10
|
export default class Radio extends SvelteComponentTyped<{
|
|
9
11
|
label?: string;
|
|
10
|
-
class?: string;
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
name?: string;
|
|
13
14
|
value?: string;
|
|
15
|
+
class?: string;
|
|
14
16
|
selected?: boolean;
|
|
15
17
|
}, {
|
|
16
18
|
[evt: string]: CustomEvent<any>;
|
|
@@ -25,10 +27,10 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
25
27
|
declare const __propDef: {
|
|
26
28
|
props: {
|
|
27
29
|
label?: string | null;
|
|
28
|
-
class?: string;
|
|
29
30
|
disabled?: boolean;
|
|
30
31
|
name?: string;
|
|
31
32
|
value?: string | null;
|
|
33
|
+
class?: string;
|
|
32
34
|
selected?: boolean;
|
|
33
35
|
};
|
|
34
36
|
events: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
A variant of the `<Select>` widget with an auto-complete text input field.
|
|
3
4
|
@see https://w3c.github.io/aria/#combobox
|
|
4
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
|
|
5
6
|
-->
|
|
@@ -7,12 +8,12 @@
|
|
|
7
8
|
import { createEventDispatcher } from 'svelte';
|
|
8
9
|
import { _ } from 'svelte-i18n';
|
|
9
10
|
import { writable } from 'svelte/store';
|
|
10
|
-
import Button from '../
|
|
11
|
-
import Icon from '../
|
|
12
|
-
import
|
|
13
|
-
import
|
|
11
|
+
import Button from '../button/button.svelte';
|
|
12
|
+
import Icon from '../icon/icon.svelte';
|
|
13
|
+
import Listbox from '../listbox/listbox.svelte';
|
|
14
|
+
import TextInput from '../text-field/text-input.svelte';
|
|
14
15
|
import Popup from '../util/popup.svelte';
|
|
15
|
-
import
|
|
16
|
+
import { getRandomId } from '../util/util';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* CSS class name on the button.
|
|
@@ -162,7 +163,7 @@
|
|
|
162
163
|
display: flex;
|
|
163
164
|
align-items: center;
|
|
164
165
|
border-width: 1px;
|
|
165
|
-
border-color: var(--
|
|
166
|
+
border-color: var(--control-border-color);
|
|
166
167
|
border-radius: 4px;
|
|
167
168
|
padding: 0 32px 0 8px;
|
|
168
169
|
width: 100%;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} ComboboxEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} ComboboxSlots */
|
|
4
4
|
/**
|
|
5
|
+
* A variant of the `<Select>` widget with an auto-complete text input field.
|
|
5
6
|
* @see https://w3c.github.io/aria/#combobox
|
|
6
7
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
|
|
7
8
|
*/
|
|
@@ -9,9 +10,9 @@ export default class Combobox extends SvelteComponentTyped<{
|
|
|
9
10
|
[x: string]: any;
|
|
10
11
|
label?: string;
|
|
11
12
|
position?: PopupPosition;
|
|
12
|
-
class?: string;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
value?: string | number;
|
|
15
|
+
class?: string;
|
|
15
16
|
readOnly?: boolean;
|
|
16
17
|
}, {
|
|
17
18
|
change: CustomEvent<any>;
|
|
@@ -30,9 +31,9 @@ declare const __propDef: {
|
|
|
30
31
|
[x: string]: any;
|
|
31
32
|
label?: string;
|
|
32
33
|
position?: PopupPosition;
|
|
33
|
-
class?: string;
|
|
34
34
|
disabled?: boolean;
|
|
35
35
|
value?: (string | number | undefined);
|
|
36
|
+
class?: string;
|
|
36
37
|
readOnly?: boolean;
|
|
37
38
|
};
|
|
38
39
|
events: {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
A read-only variant of `<Combobox>`.
|
|
3
|
+
A read-only variant of `<Combobox>`. The equivalent of the HTML `<select>` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
|
|
5
|
+
@see https://w3c.github.io/aria/#combobox
|
|
4
6
|
-->
|
|
5
7
|
<script>
|
|
6
8
|
import Combobox from './combobox.svelte';
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} SelectProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} SelectEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SelectSlots */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A read-only variant of `<Combobox>`. The equivalent of the HTML `<select>` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
|
|
7
|
+
* @see https://w3c.github.io/aria/#combobox
|
|
8
|
+
*/
|
|
5
9
|
export default class Select extends SvelteComponentTyped<{
|
|
6
10
|
[x: string]: any;
|
|
7
11
|
label?: string;
|
|
8
|
-
class?: string;
|
|
9
12
|
value?: string;
|
|
13
|
+
class?: string;
|
|
10
14
|
}, {
|
|
11
15
|
change: CustomEvent<any>;
|
|
12
16
|
} & {
|
|
@@ -23,8 +27,8 @@ declare const __propDef: {
|
|
|
23
27
|
props: {
|
|
24
28
|
[x: string]: any;
|
|
25
29
|
label?: string;
|
|
26
|
-
class?: string;
|
|
27
30
|
value?: string | null;
|
|
31
|
+
class?: string;
|
|
28
32
|
};
|
|
29
33
|
events: {
|
|
30
34
|
change: CustomEvent<any>;
|