@sveltia/ui 0.6.6 → 0.7.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/button/button.svelte +112 -75
- package/package/components/button/button.svelte.d.ts +45 -18
- package/package/components/button/select-button-group.svelte +51 -30
- package/package/components/button/select-button-group.svelte.d.ts +12 -8
- package/package/components/button/select-button.svelte +50 -2
- package/package/components/button/select-button.svelte.d.ts +16 -0
- package/package/components/calendar/calendar.svelte +5 -3
- package/package/components/checkbox/checkbox-group.svelte +28 -10
- package/package/components/checkbox/checkbox-group.svelte.d.ts +4 -2
- package/package/components/checkbox/checkbox.svelte +114 -71
- package/package/components/checkbox/checkbox.svelte.d.ts +13 -7
- package/package/components/dialog/dialog.svelte +37 -17
- package/package/components/dialog/dialog.svelte.d.ts +0 -4
- package/package/components/disclosure/disclosure.svelte +48 -21
- package/package/components/disclosure/disclosure.svelte.d.ts +19 -0
- package/package/components/divider/divider.svelte +14 -6
- package/package/components/divider/divider.svelte.d.ts +3 -1
- package/package/components/divider/spacer.svelte +17 -5
- package/package/components/divider/spacer.svelte.d.ts +2 -0
- package/package/components/drawer/drawer.svelte +13 -6
- package/package/components/listbox/listbox.svelte +55 -20
- package/package/components/listbox/listbox.svelte.d.ts +12 -13
- package/package/components/listbox/option-group.svelte +22 -5
- package/package/components/listbox/option-group.svelte.d.ts +4 -0
- package/package/components/listbox/option.svelte +41 -14
- package/package/components/listbox/option.svelte.d.ts +9 -3
- package/package/components/menu/menu-button.svelte +51 -5
- package/package/components/menu/menu-button.svelte.d.ts +15 -0
- package/package/components/menu/menu-item-checkbox.svelte +41 -2
- package/package/components/menu/menu-item-checkbox.svelte.d.ts +14 -0
- package/package/components/menu/menu-item-group.svelte +26 -9
- package/package/components/menu/menu-item-group.svelte.d.ts +4 -2
- package/package/components/menu/menu-item-radio.svelte +47 -3
- package/package/components/menu/menu-item-radio.svelte.d.ts +14 -0
- package/package/components/menu/menu-item.svelte +48 -21
- package/package/components/menu/menu-item.svelte.d.ts +10 -4
- package/package/components/menu/menu.svelte +17 -9
- package/package/components/menu/menu.svelte.d.ts +8 -8
- package/package/components/radio/radio-group.svelte +50 -11
- package/package/components/radio/radio-group.svelte.d.ts +13 -5
- package/package/components/radio/radio.svelte +76 -45
- package/package/components/radio/radio.svelte.d.ts +11 -5
- package/package/components/select/combobox.svelte +59 -29
- package/package/components/select/combobox.svelte.d.ts +8 -2
- package/package/components/select/select.svelte +31 -6
- package/package/components/select/select.svelte.d.ts +10 -2
- package/package/components/slider/slider.svelte +158 -70
- package/package/components/slider/slider.svelte.d.ts +12 -4
- package/package/components/switch/switch.svelte +71 -29
- package/package/components/switch/switch.svelte.d.ts +11 -3
- package/package/components/table/table-row-header.svelte +1 -0
- package/package/components/table/table-row.svelte +16 -3
- package/package/components/table/table-row.svelte.d.ts +4 -0
- package/package/components/table/table.svelte +2 -1
- package/package/components/table/table.svelte.d.ts +4 -0
- package/package/components/tabs/tab-list.svelte +33 -16
- package/package/components/tabs/tab-list.svelte.d.ts +8 -18
- package/package/components/tabs/tab-panel.svelte +1 -2
- package/package/components/tabs/tab.svelte +25 -3
- package/package/components/tabs/tab.svelte.d.ts +10 -0
- package/package/components/text-field/markdown-editor.svelte +54 -22
- package/package/components/text-field/markdown-editor.svelte.d.ts +11 -1
- package/package/components/text-field/number-input.svelte +66 -15
- package/package/components/text-field/number-input.svelte.d.ts +13 -5
- package/package/components/text-field/password-input.svelte +42 -9
- package/package/components/text-field/password-input.svelte.d.ts +11 -1
- package/package/components/text-field/search-bar.svelte +67 -17
- package/package/components/text-field/search-bar.svelte.d.ts +26 -1
- package/package/components/text-field/text-area.svelte +55 -21
- package/package/components/text-field/text-area.svelte.d.ts +12 -19
- package/package/components/text-field/text-input.svelte +71 -46
- package/package/components/text-field/text-input.svelte.d.ts +34 -14
- package/package/components/toast/toast.svelte +120 -0
- package/package/components/toast/toast.svelte.d.ts +36 -0
- package/package/components/toolbar/toolbar.svelte +33 -10
- package/package/components/toolbar/toolbar.svelte.d.ts +7 -1
- package/package/components/util/app-shell.svelte +133 -69
- package/package/components/util/group.svelte +21 -6
- package/package/components/util/group.svelte.d.ts +4 -2
- package/package/components/util/popup.svelte +63 -11
- package/package/components/util/popup.svelte.d.ts +13 -3
- package/package/components/util/portal.svelte +1 -1
- package/package/components/util/portal.svelte.d.ts +2 -0
- package/package/index.d.ts +2 -0
- package/package/index.js +4 -3
- package/package/{components/util → services}/events.d.ts +1 -1
- package/package/{components/util → services}/events.js +3 -2
- package/package/services/group.d.ts +1 -0
- package/package/{components/util → services}/group.js +17 -15
- package/package/{components/util → services}/util.d.ts +1 -1
- package/package/{components/util → services}/util.js +2 -2
- package/package/styles/core.scss +36 -7
- package/package/styles/variables.scss +98 -62
- package/package.json +42 -34
- package/package/components/util/group.d.ts +0 -1
- /package/package/{components/util → services}/popup.d.ts +0 -0
- /package/package/{components/util → services}/popup.js +0 -0
|
@@ -6,45 +6,60 @@
|
|
|
6
6
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
+
import { getRandomId } from '../../services/util';
|
|
9
10
|
import Button from '../button/button.svelte';
|
|
10
|
-
import Icon from '../icon/icon.svelte';
|
|
11
|
-
import { getRandomId } from '../util/util';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
13
|
+
* The `class` attribute on the wrapper element.
|
|
15
14
|
* @type {string}
|
|
16
15
|
*/
|
|
17
16
|
let className = '';
|
|
18
|
-
|
|
19
17
|
export { className as class };
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/** @type {boolean} */
|
|
31
|
-
export let selected = false;
|
|
32
|
-
|
|
33
|
-
/** @type {boolean} */
|
|
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
|
+
*/
|
|
34
27
|
export let disabled = false;
|
|
28
|
+
/**
|
|
29
|
+
* Whether to check the widget. An alias of the `aria-checked` attribute.
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
*/
|
|
32
|
+
export let checked = false;
|
|
33
|
+
/**
|
|
34
|
+
* The `name` attribute on the `<button>` element.
|
|
35
|
+
* @type {string | undefined}
|
|
36
|
+
*/
|
|
37
|
+
export let name = undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The `value` attribute on the `<button>` element.
|
|
40
|
+
* @type {string | undefined}
|
|
41
|
+
*/
|
|
42
|
+
export let value = undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Text label displayed next to the checkbox.
|
|
45
|
+
* @type {string | undefined}
|
|
46
|
+
*/
|
|
47
|
+
export let label = undefined;
|
|
35
48
|
|
|
36
49
|
const id = getRandomId('checkbox');
|
|
37
|
-
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Reference to the `Button` component.
|
|
53
|
+
* @type {Button | undefined}
|
|
54
|
+
*/
|
|
38
55
|
let buttonComponent;
|
|
39
56
|
</script>
|
|
40
57
|
|
|
41
|
-
{#if name && value && selected}
|
|
42
|
-
<input type="hidden" {name} {value} />
|
|
43
|
-
{/if}
|
|
44
|
-
|
|
45
58
|
<span
|
|
46
59
|
class="sui radio {className}"
|
|
60
|
+
class:disabled
|
|
47
61
|
role="none"
|
|
62
|
+
hidden={hidden || undefined}
|
|
48
63
|
{...$$restProps}
|
|
49
64
|
on:click={(event) => {
|
|
50
65
|
if (!(/** @type {HTMLElement} */ (event.target).matches('button'))) {
|
|
@@ -54,20 +69,20 @@
|
|
|
54
69
|
>
|
|
55
70
|
<Button
|
|
56
71
|
{id}
|
|
72
|
+
role="radio"
|
|
73
|
+
{hidden}
|
|
57
74
|
{disabled}
|
|
58
75
|
{name}
|
|
59
76
|
{value}
|
|
60
|
-
|
|
61
|
-
aria-checked={selected}
|
|
77
|
+
aria-checked={checked}
|
|
62
78
|
aria-labelledby="{id}-label"
|
|
63
79
|
bind:this={buttonComponent}
|
|
64
80
|
on:click={(event) => {
|
|
65
81
|
event.preventDefault();
|
|
66
|
-
|
|
82
|
+
checked = true;
|
|
67
83
|
}}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</Button>
|
|
84
|
+
on:select
|
|
85
|
+
/>
|
|
71
86
|
{#if $$slots.default || label}
|
|
72
87
|
<label id="{id}-label">
|
|
73
88
|
{#if $$slots.default}
|
|
@@ -91,33 +106,49 @@
|
|
|
91
106
|
-webkit-user-select: none;
|
|
92
107
|
user-select: none;
|
|
93
108
|
}
|
|
94
|
-
.radio
|
|
95
|
-
|
|
109
|
+
.radio:hover :global(button) {
|
|
110
|
+
background-color: var(--sui-hover-background-color);
|
|
96
111
|
}
|
|
97
|
-
.radio
|
|
98
|
-
color: var(--sui-
|
|
112
|
+
.radio:hover :global(button[aria-checked="true"]) {
|
|
113
|
+
border-color: var(--sui-primary-accent-color-light);
|
|
114
|
+
color: var(--sui-primary-accent-color-text);
|
|
115
|
+
}
|
|
116
|
+
.radio:hover :global(button[aria-checked="true"]::before) {
|
|
117
|
+
background-color: var(--sui-primary-accent-color-light);
|
|
118
|
+
}
|
|
119
|
+
.radio:active :global(button) {
|
|
120
|
+
background-color: var(--sui-active-background-color);
|
|
121
|
+
}
|
|
122
|
+
.radio:active :global(button[aria-checked="true"]) {
|
|
123
|
+
border-color: var(--sui-primary-accent-color-dark);
|
|
124
|
+
color: var(--sui-primary-accent-color-dark);
|
|
99
125
|
}
|
|
100
126
|
.radio :global(button) {
|
|
101
127
|
justify-content: center;
|
|
102
128
|
overflow: hidden;
|
|
103
|
-
border-width:
|
|
129
|
+
border-width: 1.5px;
|
|
104
130
|
border-color: var(--sui-checkbox-border-color);
|
|
105
|
-
border-radius:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
131
|
+
border-radius: var(--sui-checkbox-height);
|
|
132
|
+
padding: 0;
|
|
133
|
+
width: var(--sui-checkbox-height);
|
|
134
|
+
height: var(--sui-checkbox-height);
|
|
135
|
+
background-color: var(--sui-checkbox-background-color);
|
|
109
136
|
transition: all 200ms;
|
|
110
137
|
}
|
|
111
|
-
.radio :global(button)
|
|
112
|
-
|
|
113
|
-
|
|
138
|
+
.radio :global(button::before) {
|
|
139
|
+
content: "";
|
|
140
|
+
border-radius: var(--sui-checkbox-height);
|
|
141
|
+
width: calc(var(--sui-checkbox-height) - 7px);
|
|
142
|
+
height: calc(var(--sui-checkbox-height) - 7px);
|
|
143
|
+
background-color: var(--sui-primary-accent-color);
|
|
144
|
+
transition: all 200ms;
|
|
145
|
+
will-change: opacity;
|
|
114
146
|
}
|
|
115
147
|
.radio :global(button[aria-checked="true"]) {
|
|
116
|
-
border-color: var(--sui-primary-accent-color
|
|
117
|
-
color: var(--sui-primary-accent-color-lighter);
|
|
148
|
+
border-color: var(--sui-primary-accent-color);
|
|
118
149
|
}
|
|
119
|
-
.radio :global(button[aria-checked="false"]) {
|
|
120
|
-
|
|
150
|
+
.radio :global(button[aria-checked="false"]::before) {
|
|
151
|
+
opacity: 0;
|
|
121
152
|
}
|
|
122
153
|
.radio label {
|
|
123
154
|
cursor: inherit;
|
|
@@ -12,10 +12,13 @@ export default class Radio extends SvelteComponent<{
|
|
|
12
12
|
class?: string;
|
|
13
13
|
name?: string;
|
|
14
14
|
label?: string;
|
|
15
|
+
checked?: boolean;
|
|
15
16
|
disabled?: boolean;
|
|
16
17
|
value?: string;
|
|
17
|
-
|
|
18
|
+
hidden?: boolean;
|
|
18
19
|
}, {
|
|
20
|
+
select: Event;
|
|
21
|
+
} & {
|
|
19
22
|
[evt: string]: CustomEvent<any>;
|
|
20
23
|
}, {
|
|
21
24
|
default: {};
|
|
@@ -29,13 +32,16 @@ declare const __propDef: {
|
|
|
29
32
|
props: {
|
|
30
33
|
[x: string]: any;
|
|
31
34
|
class?: string;
|
|
32
|
-
name?: string;
|
|
33
|
-
label?: string |
|
|
35
|
+
name?: string | undefined;
|
|
36
|
+
label?: string | undefined;
|
|
37
|
+
checked?: boolean;
|
|
34
38
|
disabled?: boolean;
|
|
35
|
-
value?: string |
|
|
36
|
-
|
|
39
|
+
value?: string | undefined;
|
|
40
|
+
hidden?: boolean | undefined;
|
|
37
41
|
};
|
|
38
42
|
events: {
|
|
43
|
+
select: Event;
|
|
44
|
+
} & {
|
|
39
45
|
[evt: string]: CustomEvent<any>;
|
|
40
46
|
};
|
|
41
47
|
slots: {
|
|
@@ -8,44 +8,63 @@
|
|
|
8
8
|
import { createEventDispatcher } from 'svelte';
|
|
9
9
|
import { _ } from 'svelte-i18n';
|
|
10
10
|
import { writable } from 'svelte/store';
|
|
11
|
+
import { getRandomId } from '../../services/util';
|
|
11
12
|
import Button from '../button/button.svelte';
|
|
12
13
|
import Icon from '../icon/icon.svelte';
|
|
13
14
|
import Listbox from '../listbox/listbox.svelte';
|
|
14
15
|
import TextInput from '../text-field/text-input.svelte';
|
|
15
16
|
import Popup from '../util/popup.svelte';
|
|
16
|
-
import { getRandomId } from '../util/util';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* The `class` attribute on the wrapper element.
|
|
20
20
|
* @type {string}
|
|
21
21
|
*/
|
|
22
22
|
let className = '';
|
|
23
|
-
|
|
24
23
|
export { className as class };
|
|
25
|
-
|
|
26
24
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @type {
|
|
25
|
+
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
26
|
+
* @type {boolean | undefined}
|
|
29
27
|
*/
|
|
30
|
-
export let
|
|
31
|
-
|
|
28
|
+
export let hidden = undefined;
|
|
32
29
|
/**
|
|
33
|
-
* Whether the
|
|
30
|
+
* Whether to disable the widget. An alias of the `aria-disabled` attribute.
|
|
31
|
+
* @type {boolean}
|
|
34
32
|
*/
|
|
35
|
-
export let readOnly = false;
|
|
36
|
-
|
|
37
33
|
export let disabled = false;
|
|
38
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Whether to disable the widget. An alias of the `aria-readonly` attribute.
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
*/
|
|
38
|
+
export let readonly = false;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to disable the widget. An alias of the `aria-required` attribute.
|
|
41
|
+
* @type {boolean}
|
|
42
|
+
*/
|
|
43
|
+
export let required = false;
|
|
44
|
+
/**
|
|
45
|
+
* Whether to disable the widget. An alias of the `aria-invalid` attribute.
|
|
46
|
+
* @type {boolean}
|
|
47
|
+
*/
|
|
48
|
+
export let invalid = false;
|
|
49
|
+
/**
|
|
50
|
+
* Text label displayed on the readonly item.
|
|
51
|
+
* @type {string}
|
|
52
|
+
*/
|
|
39
53
|
export let label = '';
|
|
40
|
-
|
|
41
54
|
/**
|
|
42
55
|
* Selected option’s value.
|
|
43
56
|
* @type {(string | number | undefined)}
|
|
44
57
|
*/
|
|
45
58
|
export let value = undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Where to show the dropdown menu.
|
|
61
|
+
* @type {PopupPosition}
|
|
62
|
+
*/
|
|
63
|
+
export let position = 'bottom-left';
|
|
46
64
|
|
|
47
65
|
const dispatch = createEventDispatcher();
|
|
48
66
|
const id = getRandomId('combobox');
|
|
67
|
+
/** @type {HTMLElement} */
|
|
49
68
|
let comboboxElement;
|
|
50
69
|
/** @type {TextInput?} */
|
|
51
70
|
let inputComponent;
|
|
@@ -54,16 +73,18 @@
|
|
|
54
73
|
let isPopupOpen = writable(false);
|
|
55
74
|
</script>
|
|
56
75
|
|
|
57
|
-
<div class="sui combobox {className}" {...$$restProps}>
|
|
58
|
-
{#if
|
|
76
|
+
<div class="sui combobox {className}" class:readonly hidden={hidden || undefined} {...$$restProps}>
|
|
77
|
+
{#if readonly}
|
|
59
78
|
<div
|
|
60
|
-
class:selected={value !== undefined}
|
|
61
|
-
role="combobox"
|
|
62
79
|
{id}
|
|
80
|
+
class:selected={value !== undefined}
|
|
63
81
|
tabindex={disabled ? -1 : 0}
|
|
82
|
+
role="combobox"
|
|
64
83
|
aria-controls="{id}-popup"
|
|
65
84
|
aria-expanded={$isPopupOpen}
|
|
66
|
-
aria-
|
|
85
|
+
aria-hidden={hidden}
|
|
86
|
+
aria-disabled={disabled}
|
|
87
|
+
aria-readonly="true"
|
|
67
88
|
aria-haspopup="listbox"
|
|
68
89
|
aria-activedescendant="selected-option"
|
|
69
90
|
{...$$restProps}
|
|
@@ -78,10 +99,13 @@
|
|
|
78
99
|
role="combobox"
|
|
79
100
|
{id}
|
|
80
101
|
{value}
|
|
102
|
+
{hidden}
|
|
81
103
|
{disabled}
|
|
104
|
+
{readonly}
|
|
105
|
+
{required}
|
|
106
|
+
{invalid}
|
|
82
107
|
aria-controls="{id}-popup"
|
|
83
108
|
aria-expanded={$isPopupOpen}
|
|
84
|
-
aria-disabled={disabled ? true : undefined}
|
|
85
109
|
aria-haspopup="listbox"
|
|
86
110
|
aria-activedescendant="selected-option"
|
|
87
111
|
{...$$restProps}
|
|
@@ -89,12 +113,13 @@
|
|
|
89
113
|
/>
|
|
90
114
|
{/if}
|
|
91
115
|
<Button
|
|
116
|
+
variant="ghost"
|
|
117
|
+
iconic
|
|
118
|
+
{hidden}
|
|
92
119
|
{disabled}
|
|
93
|
-
tabindex={
|
|
120
|
+
tabindex={readonly || disabled ? -1 : 0}
|
|
94
121
|
aria-controls="{id}-popup"
|
|
95
122
|
aria-expanded={$isPopupOpen}
|
|
96
|
-
aria-disabled={disabled ? true : undefined}
|
|
97
|
-
class="ghost iconic"
|
|
98
123
|
on:click={(event) => {
|
|
99
124
|
event.stopPropagation();
|
|
100
125
|
|
|
@@ -112,8 +137,10 @@
|
|
|
112
137
|
</div>
|
|
113
138
|
<Popup
|
|
114
139
|
id="{id}-popup"
|
|
115
|
-
|
|
140
|
+
class="combobox"
|
|
141
|
+
anchor={comboboxElement ?? inputComponent?.element}
|
|
116
142
|
{position}
|
|
143
|
+
touchOptimized={true}
|
|
117
144
|
bind:open={isPopupOpen}
|
|
118
145
|
bind:this={popupComponent}
|
|
119
146
|
>
|
|
@@ -138,7 +165,7 @@
|
|
|
138
165
|
display: flex;
|
|
139
166
|
align-items: center;
|
|
140
167
|
position: relative;
|
|
141
|
-
min-width: var(--sui-combobox-min-width,
|
|
168
|
+
min-width: var(--sui-combobox-min-width, calc(var(--sui-option-height) * 5));
|
|
142
169
|
}
|
|
143
170
|
.combobox :global(.icon) {
|
|
144
171
|
font-size: var(--sui-font-size-xx-large);
|
|
@@ -156,6 +183,9 @@
|
|
|
156
183
|
border-top-left-radius: 0;
|
|
157
184
|
border-bottom-left-radius: 0;
|
|
158
185
|
}
|
|
186
|
+
.combobox.readonly > :global(button) {
|
|
187
|
+
background-color: transparent !important;
|
|
188
|
+
}
|
|
159
189
|
.combobox > :global(button[tabindex="-1"]) {
|
|
160
190
|
pointer-events: none;
|
|
161
191
|
}
|
|
@@ -164,10 +194,10 @@
|
|
|
164
194
|
align-items: center;
|
|
165
195
|
border-width: 1px;
|
|
166
196
|
border-color: var(--sui-control-border-color);
|
|
167
|
-
border-radius:
|
|
168
|
-
padding: 0
|
|
197
|
+
border-radius: var(--sui-textbox-border-radius);
|
|
198
|
+
padding: 0 var(--sui-textbox-height) 0 calc(var(--sui-textbox-height) / 4);
|
|
169
199
|
width: 100%;
|
|
170
|
-
height: var(--sui-textbox-
|
|
200
|
+
height: var(--sui-textbox-height);
|
|
171
201
|
color: var(--sui-control-foreground-color);
|
|
172
202
|
background-color: var(--sui-disabled-background-color);
|
|
173
203
|
font-family: var(--sui-control-font-family);
|
|
@@ -182,7 +212,7 @@
|
|
|
182
212
|
font-style: italic;
|
|
183
213
|
}
|
|
184
214
|
.combobox div[role=combobox]:hover, .combobox div[role=combobox]:focus {
|
|
185
|
-
background-color: var(--sui-
|
|
215
|
+
background-color: var(--sui-hover-background-color);
|
|
186
216
|
}
|
|
187
217
|
.combobox div[role=combobox][aria-disabled=true] {
|
|
188
218
|
background-color: var(--sui-disabled-background-color);
|
|
@@ -203,7 +233,7 @@
|
|
|
203
233
|
.combobox + :global([role="listbox"]) {
|
|
204
234
|
position: fixed;
|
|
205
235
|
z-index: 100;
|
|
206
|
-
border-radius:
|
|
236
|
+
border-radius: var(--sui-control-medium-border-radius);
|
|
207
237
|
box-shadow: 0 8px 16px var(--sui-popup-shadow-color);
|
|
208
238
|
overflow: auto;
|
|
209
239
|
background-color: var(--sui-secondary-background-color);
|
|
@@ -10,10 +10,13 @@ export default class Combobox extends SvelteComponent<{
|
|
|
10
10
|
[x: string]: any;
|
|
11
11
|
class?: string;
|
|
12
12
|
label?: string;
|
|
13
|
+
invalid?: boolean;
|
|
13
14
|
disabled?: boolean;
|
|
14
|
-
|
|
15
|
+
required?: boolean;
|
|
15
16
|
value?: string | number;
|
|
16
17
|
position?: PopupPosition;
|
|
18
|
+
hidden?: boolean;
|
|
19
|
+
readonly?: boolean;
|
|
17
20
|
}, {
|
|
18
21
|
change: CustomEvent<any>;
|
|
19
22
|
} & {
|
|
@@ -31,10 +34,13 @@ declare const __propDef: {
|
|
|
31
34
|
[x: string]: any;
|
|
32
35
|
class?: string;
|
|
33
36
|
label?: string;
|
|
37
|
+
invalid?: boolean;
|
|
34
38
|
disabled?: boolean;
|
|
35
|
-
|
|
39
|
+
required?: boolean;
|
|
36
40
|
value?: (string | number | undefined);
|
|
37
41
|
position?: PopupPosition;
|
|
42
|
+
hidden?: boolean | undefined;
|
|
43
|
+
readonly?: boolean;
|
|
38
44
|
};
|
|
39
45
|
events: {
|
|
40
46
|
change: CustomEvent<any>;
|
|
@@ -8,18 +8,39 @@
|
|
|
8
8
|
import Combobox from './combobox.svelte';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* The `class` attribute on the wrapper element.
|
|
12
12
|
* @type {string}
|
|
13
13
|
*/
|
|
14
14
|
let className = '';
|
|
15
|
-
|
|
16
15
|
export { className as class };
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
18
|
+
* @type {boolean | undefined}
|
|
19
|
+
*/
|
|
20
|
+
export let hidden = undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to disable the widget. An alias of the `aria-disabled` attribute.
|
|
23
|
+
* @type {boolean}
|
|
24
|
+
*/
|
|
25
|
+
export let disabled = false;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to disable the widget. An alias of the `aria-required` attribute.
|
|
28
|
+
* @type {boolean}
|
|
29
|
+
*/
|
|
30
|
+
export let required = false;
|
|
31
|
+
/**
|
|
32
|
+
* Whether to disable the widget. An alias of the `aria-invalid` attribute.
|
|
33
|
+
* @type {boolean}
|
|
34
|
+
*/
|
|
35
|
+
export let invalid = false;
|
|
36
|
+
/**
|
|
37
|
+
* Text label displayed on the readonly item.
|
|
38
|
+
* @type {string}
|
|
39
|
+
*/
|
|
18
40
|
export let label = '';
|
|
19
|
-
|
|
20
41
|
/**
|
|
21
42
|
* Selected option’s value.
|
|
22
|
-
* @type {string
|
|
43
|
+
* @type {(string | number | undefined)}
|
|
23
44
|
*/
|
|
24
45
|
export let value = undefined;
|
|
25
46
|
</script>
|
|
@@ -27,8 +48,12 @@
|
|
|
27
48
|
<Combobox
|
|
28
49
|
bind:value
|
|
29
50
|
class="sui select {className}"
|
|
51
|
+
{hidden}
|
|
52
|
+
{disabled}
|
|
53
|
+
readonly={true}
|
|
54
|
+
{required}
|
|
55
|
+
{invalid}
|
|
30
56
|
{label}
|
|
31
|
-
readOnly={true}
|
|
32
57
|
{...$$restProps}
|
|
33
58
|
on:change
|
|
34
59
|
>
|
|
@@ -10,7 +10,11 @@ export default class Select extends SvelteComponent<{
|
|
|
10
10
|
[x: string]: any;
|
|
11
11
|
class?: string;
|
|
12
12
|
label?: string;
|
|
13
|
-
|
|
13
|
+
invalid?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
value?: string | number;
|
|
17
|
+
hidden?: boolean;
|
|
14
18
|
}, {
|
|
15
19
|
change: CustomEvent<any>;
|
|
16
20
|
} & {
|
|
@@ -28,7 +32,11 @@ declare const __propDef: {
|
|
|
28
32
|
[x: string]: any;
|
|
29
33
|
class?: string;
|
|
30
34
|
label?: string;
|
|
31
|
-
|
|
35
|
+
invalid?: boolean;
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
required?: boolean;
|
|
38
|
+
value?: (string | number | undefined);
|
|
39
|
+
hidden?: boolean | undefined;
|
|
32
40
|
};
|
|
33
41
|
events: {
|
|
34
42
|
change: CustomEvent<any>;
|