@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
|
@@ -66,17 +66,17 @@
|
|
|
66
66
|
const id = getRandomId('combobox');
|
|
67
67
|
/** @type {HTMLElement} */
|
|
68
68
|
let comboboxElement;
|
|
69
|
-
/** @type {TextInput
|
|
69
|
+
/** @type {TextInput | undefined} */
|
|
70
70
|
let inputComponent;
|
|
71
|
-
/** @type {Popup
|
|
71
|
+
/** @type {Popup | undefined} */
|
|
72
72
|
let popupComponent;
|
|
73
73
|
let isPopupOpen = writable(false);
|
|
74
74
|
/** @type {string} */
|
|
75
75
|
let label = '';
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* Update the `value` and `label` whenever an option is selected
|
|
79
|
-
* @param {HTMLButtonElement} target Selected option.
|
|
78
|
+
* Update the `value` and `label` whenever an option is selected.
|
|
79
|
+
* @param {HTMLButtonElement} target - Selected option.
|
|
80
80
|
*/
|
|
81
81
|
const onSelect = (target) => {
|
|
82
82
|
// @todo support more types
|
|
@@ -88,12 +88,12 @@
|
|
|
88
88
|
$: {
|
|
89
89
|
if (popupComponent?.content) {
|
|
90
90
|
window.requestAnimationFrame(() => {
|
|
91
|
-
const selected = popupComponent
|
|
91
|
+
const selected = popupComponent?.content?.querySelector(
|
|
92
92
|
'[role="option"][aria-selected="true"]',
|
|
93
93
|
);
|
|
94
94
|
|
|
95
95
|
if (selected) {
|
|
96
|
-
onSelect(/** @type {HTMLButtonElement
|
|
96
|
+
onSelect(/** @type {HTMLButtonElement} */ (selected));
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
}
|
|
@@ -157,7 +157,9 @@
|
|
|
157
157
|
}
|
|
158
158
|
}}
|
|
159
159
|
>
|
|
160
|
-
<
|
|
160
|
+
<slot name="chevron-icon" slot="start-icon">
|
|
161
|
+
<Icon name="expand_more" />
|
|
162
|
+
</slot>
|
|
161
163
|
</Button>
|
|
162
164
|
</div>
|
|
163
165
|
<Popup
|
|
@@ -172,7 +174,7 @@
|
|
|
172
174
|
<Listbox
|
|
173
175
|
on:click={(event) => {
|
|
174
176
|
if (/** @type {HTMLElement} */ (event.target).matches('[role="option"]')) {
|
|
175
|
-
onSelect(/** @type {HTMLButtonElement
|
|
177
|
+
onSelect(/** @type {HTMLButtonElement} */ (event.target));
|
|
176
178
|
}
|
|
177
179
|
}}
|
|
178
180
|
>
|
|
@@ -9,20 +9,23 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export default class Combobox extends SvelteComponent<{
|
|
11
11
|
[x: string]: any;
|
|
12
|
-
class?: string;
|
|
13
|
-
invalid?: boolean;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
required?: boolean;
|
|
16
|
-
value?: string | number;
|
|
17
|
-
position?: PopupPosition;
|
|
18
|
-
hidden?: boolean;
|
|
19
|
-
readonly?: boolean;
|
|
20
|
-
editable?: boolean;
|
|
12
|
+
class?: string | undefined;
|
|
13
|
+
invalid?: boolean | undefined;
|
|
14
|
+
disabled?: boolean | undefined;
|
|
15
|
+
required?: boolean | undefined;
|
|
16
|
+
value?: string | number | undefined;
|
|
17
|
+
position?: PopupPosition | undefined;
|
|
18
|
+
hidden?: boolean | undefined;
|
|
19
|
+
readonly?: boolean | undefined;
|
|
20
|
+
editable?: boolean | undefined;
|
|
21
21
|
}, {
|
|
22
22
|
change: CustomEvent<any>;
|
|
23
23
|
} & {
|
|
24
24
|
[evt: string]: CustomEvent<any>;
|
|
25
25
|
}, {
|
|
26
|
+
'chevron-icon': {
|
|
27
|
+
slot: string;
|
|
28
|
+
};
|
|
26
29
|
default: {};
|
|
27
30
|
}> {
|
|
28
31
|
}
|
|
@@ -33,15 +36,15 @@ import { SvelteComponent } from "svelte";
|
|
|
33
36
|
declare const __propDef: {
|
|
34
37
|
props: {
|
|
35
38
|
[x: string]: any;
|
|
36
|
-
class?: string;
|
|
37
|
-
invalid?: boolean;
|
|
38
|
-
disabled?: boolean;
|
|
39
|
-
required?: boolean;
|
|
39
|
+
class?: string | undefined;
|
|
40
|
+
invalid?: boolean | undefined;
|
|
41
|
+
disabled?: boolean | undefined;
|
|
42
|
+
required?: boolean | undefined;
|
|
40
43
|
value?: (string | number | undefined);
|
|
41
|
-
position?: PopupPosition;
|
|
44
|
+
position?: PopupPosition | undefined;
|
|
42
45
|
hidden?: boolean | undefined;
|
|
43
|
-
readonly?: boolean;
|
|
44
|
-
editable?: boolean;
|
|
46
|
+
readonly?: boolean | undefined;
|
|
47
|
+
editable?: boolean | undefined;
|
|
45
48
|
};
|
|
46
49
|
events: {
|
|
47
50
|
change: CustomEvent<any>;
|
|
@@ -49,6 +52,9 @@ declare const __propDef: {
|
|
|
49
52
|
[evt: string]: CustomEvent<any>;
|
|
50
53
|
};
|
|
51
54
|
slots: {
|
|
55
|
+
'chevron-icon': {
|
|
56
|
+
slot: string;
|
|
57
|
+
};
|
|
52
58
|
default: {};
|
|
53
59
|
};
|
|
54
60
|
};
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export default class Select extends SvelteComponent<{
|
|
11
11
|
[x: string]: any;
|
|
12
|
-
class?: string;
|
|
13
|
-
invalid?: boolean;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
required?: boolean;
|
|
16
|
-
value?: string | number;
|
|
17
|
-
hidden?: boolean;
|
|
18
|
-
readonly?: boolean;
|
|
12
|
+
class?: string | undefined;
|
|
13
|
+
invalid?: boolean | undefined;
|
|
14
|
+
disabled?: boolean | undefined;
|
|
15
|
+
required?: boolean | undefined;
|
|
16
|
+
value?: string | number | undefined;
|
|
17
|
+
hidden?: boolean | undefined;
|
|
18
|
+
readonly?: boolean | undefined;
|
|
19
19
|
}, {
|
|
20
20
|
change: CustomEvent<any>;
|
|
21
21
|
} & {
|
|
@@ -31,13 +31,13 @@ import { SvelteComponent } from "svelte";
|
|
|
31
31
|
declare const __propDef: {
|
|
32
32
|
props: {
|
|
33
33
|
[x: string]: any;
|
|
34
|
-
class?: string;
|
|
35
|
-
invalid?: boolean;
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
required?: boolean;
|
|
34
|
+
class?: string | undefined;
|
|
35
|
+
invalid?: boolean | undefined;
|
|
36
|
+
disabled?: boolean | undefined;
|
|
37
|
+
required?: boolean | undefined;
|
|
38
38
|
value?: (string | number | undefined);
|
|
39
39
|
hidden?: boolean | undefined;
|
|
40
|
-
readonly?: boolean;
|
|
40
|
+
readonly?: boolean | undefined;
|
|
41
41
|
};
|
|
42
42
|
events: {
|
|
43
43
|
change: CustomEvent<any>;
|
|
@@ -38,26 +38,26 @@
|
|
|
38
38
|
export let invalid = false;
|
|
39
39
|
/**
|
|
40
40
|
* Minimum allowed value. An alias of the `aria-valuemin` attribute.
|
|
41
|
-
* @type {number
|
|
41
|
+
* @type {number}
|
|
42
42
|
*/
|
|
43
43
|
export let min = 0;
|
|
44
44
|
/**
|
|
45
45
|
* Maximum allowed value. An alias of the `aria-valuemax` attribute.
|
|
46
|
-
* @type {number
|
|
46
|
+
* @type {number}
|
|
47
47
|
*/
|
|
48
48
|
export let max = 100;
|
|
49
49
|
|
|
50
50
|
export let value = 0;
|
|
51
51
|
export let sliderLabel = '';
|
|
52
|
-
/** @type {[number, number]} */
|
|
52
|
+
/** @type {[number, number] | undefined} */
|
|
53
53
|
export let values = undefined;
|
|
54
|
-
/** @type {[string, string]} */
|
|
54
|
+
/** @type {[string, string] | undefined} */
|
|
55
55
|
export let sliderLabels = undefined;
|
|
56
56
|
export let step = 1;
|
|
57
57
|
/** @type {(string[] | number[])} */
|
|
58
58
|
export let optionLabels = [];
|
|
59
59
|
|
|
60
|
-
$: multiThumb =
|
|
60
|
+
$: multiThumb = Array.isArray(values);
|
|
61
61
|
|
|
62
62
|
const dispatch = createEventDispatcher();
|
|
63
63
|
/** @type {HTMLElement | undefined} */
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* Move a thumb with mouse.
|
|
79
|
-
* @param {number} diff Distance from the original X position in pixels.
|
|
79
|
+
* @param {number} diff - Distance from the original X position in pixels.
|
|
80
80
|
*/
|
|
81
81
|
const moveThumb = (diff) => {
|
|
82
82
|
if (diff < 0) {
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
if (multiThumb) {
|
|
106
|
-
values[targetValueIndex] = valueList[index];
|
|
106
|
+
/** @type {[number, number]} */ (values)[targetValueIndex] = valueList[index];
|
|
107
107
|
} else {
|
|
108
108
|
value = valueList[index];
|
|
109
109
|
}
|
|
@@ -111,8 +111,9 @@
|
|
|
111
111
|
|
|
112
112
|
/**
|
|
113
113
|
* Handle the `keydown` event fired on the slider.
|
|
114
|
-
* @param {KeyboardEvent} event `keydown` event.
|
|
115
|
-
* @param {number} [valueIndex] Index in the {@link values} array to be used to get/set the
|
|
114
|
+
* @param {KeyboardEvent} event - `keydown` event.
|
|
115
|
+
* @param {number} [valueIndex] - Index in the {@link values} array to be used to get/set the
|
|
116
|
+
* value.
|
|
116
117
|
*/
|
|
117
118
|
const onKeyDown = (event, valueIndex = 0) => {
|
|
118
119
|
const { key, ctrlKey, metaKey, shiftKey, altKey } = event;
|
|
@@ -122,7 +123,7 @@
|
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
const _value = multiThumb ? values[valueIndex] : value;
|
|
126
|
+
const _value = multiThumb ? /** @type {[number, number]} */ (values)[valueIndex] : value;
|
|
126
127
|
let index = -1;
|
|
127
128
|
|
|
128
129
|
if (['ArrowDown', 'ArrowLeft'].includes(key)) {
|
|
@@ -153,7 +154,7 @@
|
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
if (multiThumb) {
|
|
156
|
-
values[valueIndex] = valueList[index];
|
|
157
|
+
/** @type {[number, number]} */ (values)[valueIndex] = valueList[index];
|
|
157
158
|
} else {
|
|
158
159
|
value = valueList[index];
|
|
159
160
|
}
|
|
@@ -162,7 +163,7 @@
|
|
|
162
163
|
|
|
163
164
|
/**
|
|
164
165
|
* Handle the `pointermove` event fired anywhere on the page.
|
|
165
|
-
* @param {PointerEvent} event `pointermove` event.
|
|
166
|
+
* @param {PointerEvent} event - `pointermove` event.
|
|
166
167
|
*/
|
|
167
168
|
const onPointerMove = (event) => {
|
|
168
169
|
const { screenX, pointerId } = event;
|
|
@@ -176,7 +177,7 @@
|
|
|
176
177
|
|
|
177
178
|
/**
|
|
178
179
|
* Handle the `pointerup` and `pointercancel` events fired anywhere on the page.
|
|
179
|
-
* @param {PointerEvent} event `pointerup` or `pointercancel` event.
|
|
180
|
+
* @param {PointerEvent} event - `pointerup` or `pointercancel` event.
|
|
180
181
|
*/
|
|
181
182
|
const onPointerUp = (event) => {
|
|
182
183
|
const { pointerId } = event;
|
|
@@ -199,8 +200,9 @@
|
|
|
199
200
|
|
|
200
201
|
/**
|
|
201
202
|
* Handle the `pointerdown` event fired on the slider.
|
|
202
|
-
* @param {PointerEvent} event `pointerdown` event.
|
|
203
|
-
* @param {number} [valueIndex] Index in the {@link values} array to be used to get/set the
|
|
203
|
+
* @param {PointerEvent} event - `pointerdown` event.
|
|
204
|
+
* @param {number} [valueIndex] - Index in the {@link values} array to be used to get/set the
|
|
205
|
+
* value.
|
|
204
206
|
*/
|
|
205
207
|
const onPointerDown = (event, valueIndex = 0) => {
|
|
206
208
|
const { clientX, screenX, pointerId } = event;
|
|
@@ -210,7 +212,7 @@
|
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
dragging = true;
|
|
213
|
-
startX = clientX - base.getBoundingClientRect().x;
|
|
215
|
+
startX = clientX - /** @type {HTMLElement} */ (base).getBoundingClientRect().x;
|
|
214
216
|
startScreenX = screenX;
|
|
215
217
|
targetPointerId = pointerId;
|
|
216
218
|
targetValueIndex = valueIndex;
|
|
@@ -222,7 +224,7 @@
|
|
|
222
224
|
|
|
223
225
|
/**
|
|
224
226
|
* Handle the `click` event fired on the slider.
|
|
225
|
-
* @param {MouseEvent} event `click` event.
|
|
227
|
+
* @param {MouseEvent} event - `click` event.
|
|
226
228
|
*/
|
|
227
229
|
const onClick = (event) => {
|
|
228
230
|
if (disabled || readonly || multiThumb || dragging) {
|
|
@@ -237,8 +239,10 @@
|
|
|
237
239
|
*/
|
|
238
240
|
const onValueChange = () => {
|
|
239
241
|
if (multiThumb) {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
+
const [value0, value1] = /** @type {[number, number]} */ (values);
|
|
243
|
+
|
|
244
|
+
sliderPositions[0] = positionList[valueList.indexOf(value0)];
|
|
245
|
+
sliderPositions[1] = positionList[valueList.indexOf(value1)];
|
|
242
246
|
dispatch('change', { values });
|
|
243
247
|
} else {
|
|
244
248
|
sliderPositions[0] = positionList[valueList.indexOf(value)];
|
|
@@ -269,7 +273,7 @@
|
|
|
269
273
|
const observer = new ResizeObserver(() => init());
|
|
270
274
|
const query = window.matchMedia('(pointer: coarse)');
|
|
271
275
|
|
|
272
|
-
observer.observe(base);
|
|
276
|
+
observer.observe(/** @type {HTMLElement} */ (base));
|
|
273
277
|
query.addEventListener('change', init);
|
|
274
278
|
init();
|
|
275
279
|
|
|
@@ -323,7 +327,7 @@
|
|
|
323
327
|
aria-invalid={invalid}
|
|
324
328
|
aria-valuemin={min}
|
|
325
329
|
aria-valuemax={max}
|
|
326
|
-
aria-valuenow={multiThumb ? values[0] : value}
|
|
330
|
+
aria-valuenow={multiThumb ? values?.[0] : value}
|
|
327
331
|
style:left="{sliderPositions[0]}px"
|
|
328
332
|
on:pointerdown={(event) => onPointerDown(event, 0)}
|
|
329
333
|
on:keydown={(event) => onKeyDown(event, 0)}
|
|
@@ -339,7 +343,7 @@
|
|
|
339
343
|
aria-invalid={invalid}
|
|
340
344
|
aria-valuemin={min}
|
|
341
345
|
aria-valuemax={max}
|
|
342
|
-
aria-valuenow={values[1]}
|
|
346
|
+
aria-valuenow={values?.[1]}
|
|
343
347
|
style:left="{sliderPositions[1]}px"
|
|
344
348
|
on:pointerdown={(event) => onPointerDown(event, 1)}
|
|
345
349
|
on:keydown={(event) => onKeyDown(event, 1)}
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export default class Slider extends SvelteComponent<{
|
|
13
13
|
[x: string]: any;
|
|
14
|
-
class?: string;
|
|
15
|
-
invalid?: boolean;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
max?: number;
|
|
18
|
-
min?: number;
|
|
19
|
-
step?: number;
|
|
20
|
-
value?: number;
|
|
21
|
-
hidden?: boolean;
|
|
22
|
-
readonly?: boolean;
|
|
23
|
-
values?: [number, number];
|
|
24
|
-
sliderLabel?: string;
|
|
25
|
-
sliderLabels?: [string, string];
|
|
26
|
-
optionLabels?: string[] | number[];
|
|
14
|
+
class?: string | undefined;
|
|
15
|
+
invalid?: boolean | undefined;
|
|
16
|
+
disabled?: boolean | undefined;
|
|
17
|
+
max?: number | undefined;
|
|
18
|
+
min?: number | undefined;
|
|
19
|
+
step?: number | undefined;
|
|
20
|
+
value?: number | undefined;
|
|
21
|
+
hidden?: boolean | undefined;
|
|
22
|
+
readonly?: boolean | undefined;
|
|
23
|
+
values?: [number, number] | undefined;
|
|
24
|
+
sliderLabel?: string | undefined;
|
|
25
|
+
sliderLabels?: [string, string] | undefined;
|
|
26
|
+
optionLabels?: string[] | number[] | undefined;
|
|
27
27
|
}, {
|
|
28
28
|
click: MouseEvent;
|
|
29
29
|
change: CustomEvent<any>;
|
|
@@ -38,19 +38,19 @@ import { SvelteComponent } from "svelte";
|
|
|
38
38
|
declare const __propDef: {
|
|
39
39
|
props: {
|
|
40
40
|
[x: string]: any;
|
|
41
|
-
class?: string;
|
|
42
|
-
invalid?: boolean;
|
|
43
|
-
disabled?: boolean;
|
|
41
|
+
class?: string | undefined;
|
|
42
|
+
invalid?: boolean | undefined;
|
|
43
|
+
disabled?: boolean | undefined;
|
|
44
44
|
max?: number | undefined;
|
|
45
45
|
min?: number | undefined;
|
|
46
|
-
step?: number;
|
|
47
|
-
value?: number;
|
|
46
|
+
step?: number | undefined;
|
|
47
|
+
value?: number | undefined;
|
|
48
48
|
hidden?: boolean | undefined;
|
|
49
|
-
readonly?: boolean;
|
|
50
|
-
values?: [number, number];
|
|
51
|
-
sliderLabel?: string;
|
|
52
|
-
sliderLabels?: [string, string];
|
|
53
|
-
optionLabels?:
|
|
49
|
+
readonly?: boolean | undefined;
|
|
50
|
+
values?: [number, number] | undefined;
|
|
51
|
+
sliderLabel?: string | undefined;
|
|
52
|
+
sliderLabels?: [string, string] | undefined;
|
|
53
|
+
optionLabels?: string[] | number[] | undefined;
|
|
54
54
|
};
|
|
55
55
|
events: {
|
|
56
56
|
click: MouseEvent;
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/switch/
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
|
+
import { createEventDispatcher } from 'svelte';
|
|
9
|
+
|
|
8
10
|
/**
|
|
9
11
|
* The `class` attribute on the wrapper element.
|
|
10
12
|
* @type {string}
|
|
@@ -46,6 +48,8 @@
|
|
|
46
48
|
* @type {string | undefined}
|
|
47
49
|
*/
|
|
48
50
|
export let label = undefined;
|
|
51
|
+
|
|
52
|
+
const dispatch = createEventDispatcher();
|
|
49
53
|
</script>
|
|
50
54
|
|
|
51
55
|
<button
|
|
@@ -64,6 +68,7 @@
|
|
|
64
68
|
on:click={() => {
|
|
65
69
|
if (!disabled && !readonly) {
|
|
66
70
|
checked = !checked;
|
|
71
|
+
dispatch('change', { checked });
|
|
67
72
|
}
|
|
68
73
|
}}
|
|
69
74
|
>
|
|
@@ -8,15 +8,17 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class Switch extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
12
|
-
invalid?: boolean;
|
|
13
|
-
label?: string;
|
|
14
|
-
checked?: boolean | "mixed";
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
required?: boolean;
|
|
17
|
-
hidden?: boolean;
|
|
18
|
-
readonly?: boolean;
|
|
11
|
+
class?: string | undefined;
|
|
12
|
+
invalid?: boolean | undefined;
|
|
13
|
+
label?: string | undefined;
|
|
14
|
+
checked?: boolean | "mixed" | undefined;
|
|
15
|
+
disabled?: boolean | undefined;
|
|
16
|
+
required?: boolean | undefined;
|
|
17
|
+
hidden?: boolean | undefined;
|
|
18
|
+
readonly?: boolean | undefined;
|
|
19
19
|
}, {
|
|
20
|
+
change: CustomEvent<any>;
|
|
21
|
+
} & {
|
|
20
22
|
[evt: string]: CustomEvent<any>;
|
|
21
23
|
}, {
|
|
22
24
|
default: {};
|
|
@@ -29,16 +31,18 @@ import { SvelteComponent } from "svelte";
|
|
|
29
31
|
declare const __propDef: {
|
|
30
32
|
props: {
|
|
31
33
|
[x: string]: any;
|
|
32
|
-
class?: string;
|
|
33
|
-
invalid?: boolean;
|
|
34
|
+
class?: string | undefined;
|
|
35
|
+
invalid?: boolean | undefined;
|
|
34
36
|
label?: string | undefined;
|
|
35
|
-
checked?: boolean |
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
required?: boolean;
|
|
37
|
+
checked?: boolean | "mixed" | undefined;
|
|
38
|
+
disabled?: boolean | undefined;
|
|
39
|
+
required?: boolean | undefined;
|
|
38
40
|
hidden?: boolean | undefined;
|
|
39
|
-
readonly?: boolean;
|
|
41
|
+
readonly?: boolean | undefined;
|
|
40
42
|
};
|
|
41
43
|
events: {
|
|
44
|
+
change: CustomEvent<any>;
|
|
45
|
+
} & {
|
|
42
46
|
[evt: string]: CustomEvent<any>;
|
|
43
47
|
};
|
|
44
48
|
slots: {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class TableBody extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
12
|
-
label?: string;
|
|
11
|
+
class?: string | undefined;
|
|
12
|
+
label?: string | undefined;
|
|
13
13
|
}, {
|
|
14
14
|
[evt: string]: CustomEvent<any>;
|
|
15
15
|
}, {
|
|
@@ -23,8 +23,8 @@ import { SvelteComponent } from "svelte";
|
|
|
23
23
|
declare const __propDef: {
|
|
24
24
|
props: {
|
|
25
25
|
[x: string]: any;
|
|
26
|
-
class?: string;
|
|
27
|
-
label?: string;
|
|
26
|
+
class?: string | undefined;
|
|
27
|
+
label?: string | undefined;
|
|
28
28
|
};
|
|
29
29
|
events: {
|
|
30
30
|
[evt: string]: CustomEvent<any>;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class TableCell extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
11
|
+
class?: string | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
14
14
|
}, {
|
|
@@ -22,7 +22,7 @@ import { SvelteComponent } from "svelte";
|
|
|
22
22
|
declare const __propDef: {
|
|
23
23
|
props: {
|
|
24
24
|
[x: string]: any;
|
|
25
|
-
class?: string;
|
|
25
|
+
class?: string | undefined;
|
|
26
26
|
};
|
|
27
27
|
events: {
|
|
28
28
|
[evt: string]: CustomEvent<any>;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class TableColHeader extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
11
|
+
class?: string | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
14
14
|
}, {
|
|
@@ -22,7 +22,7 @@ import { SvelteComponent } from "svelte";
|
|
|
22
22
|
declare const __propDef: {
|
|
23
23
|
props: {
|
|
24
24
|
[x: string]: any;
|
|
25
|
-
class?: string;
|
|
25
|
+
class?: string | undefined;
|
|
26
26
|
};
|
|
27
27
|
events: {
|
|
28
28
|
[evt: string]: CustomEvent<any>;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class TableFoot extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
11
|
+
class?: string | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
14
14
|
}, {
|
|
@@ -22,7 +22,7 @@ import { SvelteComponent } from "svelte";
|
|
|
22
22
|
declare const __propDef: {
|
|
23
23
|
props: {
|
|
24
24
|
[x: string]: any;
|
|
25
|
-
class?: string;
|
|
25
|
+
class?: string | undefined;
|
|
26
26
|
};
|
|
27
27
|
events: {
|
|
28
28
|
[evt: string]: CustomEvent<any>;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class TableHead extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
11
|
+
class?: string | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
14
14
|
}, {
|
|
@@ -22,7 +22,7 @@ import { SvelteComponent } from "svelte";
|
|
|
22
22
|
declare const __propDef: {
|
|
23
23
|
props: {
|
|
24
24
|
[x: string]: any;
|
|
25
|
-
class?: string;
|
|
25
|
+
class?: string | undefined;
|
|
26
26
|
};
|
|
27
27
|
events: {
|
|
28
28
|
[evt: string]: CustomEvent<any>;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class TableRowHeader extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
11
|
+
class?: string | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
14
14
|
}, {
|
|
@@ -22,7 +22,7 @@ import { SvelteComponent } from "svelte";
|
|
|
22
22
|
declare const __propDef: {
|
|
23
23
|
props: {
|
|
24
24
|
[x: string]: any;
|
|
25
|
-
class?: string;
|
|
25
|
+
class?: string | undefined;
|
|
26
26
|
};
|
|
27
27
|
events: {
|
|
28
28
|
[evt: string]: CustomEvent<any>;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class TableRow extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
11
|
+
class?: string | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
14
14
|
}, {
|
|
@@ -22,7 +22,7 @@ import { SvelteComponent } from "svelte";
|
|
|
22
22
|
declare const __propDef: {
|
|
23
23
|
props: {
|
|
24
24
|
[x: string]: any;
|
|
25
|
-
class?: string;
|
|
25
|
+
class?: string | undefined;
|
|
26
26
|
};
|
|
27
27
|
events: {
|
|
28
28
|
[evt: string]: CustomEvent<any>;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class Table extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
11
|
+
class?: string | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
14
14
|
}, {
|
|
@@ -22,7 +22,7 @@ import { SvelteComponent } from "svelte";
|
|
|
22
22
|
declare const __propDef: {
|
|
23
23
|
props: {
|
|
24
24
|
[x: string]: any;
|
|
25
|
-
class?: string;
|
|
25
|
+
class?: string | undefined;
|
|
26
26
|
};
|
|
27
27
|
events: {
|
|
28
28
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
The container of `<TabList>` and `<TabPanels>`. The component name derives from XUL. This can be
|
|
4
|
+
omitted if not using vertical tabs.
|
|
5
|
+
-->
|
|
6
|
+
<script>
|
|
7
|
+
/**
|
|
8
|
+
* The `class` attribute on the wrapper element.
|
|
9
|
+
* @type {string}
|
|
10
|
+
*/
|
|
11
|
+
let className = '';
|
|
12
|
+
export { className as class };
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Orientation of the widget. This is typically contrary to `<TabList>`’s `orientation`.
|
|
16
|
+
* @type {'horizontal' | 'vertical'}
|
|
17
|
+
*/
|
|
18
|
+
export let orientation = 'vertical';
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div role="none" class="sui tab-box {orientation} {className}">
|
|
22
|
+
<slot />
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<style>.tab-box {
|
|
26
|
+
display: flex;
|
|
27
|
+
}
|
|
28
|
+
.tab-box.vertical {
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
}</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TabBoxProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TabBoxEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TabBoxSlots */
|
|
4
|
+
/**
|
|
5
|
+
* The container of `<TabList>` and `<TabPanels>`. The component name derives from XUL. This can be
|
|
6
|
+
* omitted if not using vertical tabs.
|
|
7
|
+
*/
|
|
8
|
+
export default class TabBox extends SvelteComponent<{
|
|
9
|
+
class?: string | undefined;
|
|
10
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {
|
|
14
|
+
default: {};
|
|
15
|
+
}> {
|
|
16
|
+
}
|
|
17
|
+
export type TabBoxProps = typeof __propDef.props;
|
|
18
|
+
export type TabBoxEvents = typeof __propDef.events;
|
|
19
|
+
export type TabBoxSlots = typeof __propDef.slots;
|
|
20
|
+
import { SvelteComponent } from "svelte";
|
|
21
|
+
declare const __propDef: {
|
|
22
|
+
props: {
|
|
23
|
+
class?: string | undefined;
|
|
24
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
25
|
+
};
|
|
26
|
+
events: {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
};
|
|
29
|
+
slots: {
|
|
30
|
+
default: {};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {};
|