@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
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default Slider;
|
|
2
|
+
type Slider = SvelteComponent<Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "value" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* The equivalent of the HTML `<input type="range">` element, but it comes with the multi-thumb
|
|
6
9
|
* support.
|
|
@@ -9,55 +12,164 @@
|
|
|
9
12
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/slider/
|
|
10
13
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/slider-multithumb/
|
|
11
14
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
declare const Slider: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
/**
|
|
17
|
+
* - Current value.
|
|
18
|
+
*/
|
|
19
|
+
value?: number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* - Minimum allowed value. An alias of the `aria-valuemin` attribute.
|
|
22
|
+
*/
|
|
18
23
|
min?: number | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* - Maximum allowed value. An alias of the `aria-valuemax` attribute.
|
|
26
|
+
*/
|
|
27
|
+
max?: number | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* - `aria-label` on the slider.
|
|
30
|
+
*/
|
|
31
|
+
sliderLabel?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* - Value list for a multi-thumb slider.
|
|
34
|
+
*/
|
|
35
|
+
values?: [number, number] | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* - `aria-label` on a multi-thumb slider.
|
|
38
|
+
*/
|
|
39
|
+
sliderLabels?: [string, string] | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* - Step option like `<input type="range">`.
|
|
42
|
+
*/
|
|
19
43
|
step?: number | undefined;
|
|
20
|
-
|
|
44
|
+
/**
|
|
45
|
+
* - Visible labels on the slider.
|
|
46
|
+
*/
|
|
47
|
+
optionLabels?: string[] | number[] | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* - Make the text input container flexible.
|
|
50
|
+
*/
|
|
51
|
+
flex?: boolean | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* - The `class` attribute on the wrapper element.
|
|
54
|
+
*/
|
|
55
|
+
class?: string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* - Whether to hide the widget.
|
|
58
|
+
*/
|
|
21
59
|
hidden?: boolean | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
62
|
+
* attribute.
|
|
63
|
+
*/
|
|
64
|
+
disabled?: boolean | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* - Whether to make the widget read-only. An alias of the
|
|
67
|
+
* `aria-readonly` attribute.
|
|
68
|
+
*/
|
|
22
69
|
readonly?: boolean | undefined;
|
|
23
|
-
|
|
70
|
+
/**
|
|
71
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
72
|
+
* `aria-invalid` attribute.
|
|
73
|
+
*/
|
|
74
|
+
invalid?: boolean | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* - Primary slot content.
|
|
77
|
+
*/
|
|
78
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* - `change` event
|
|
81
|
+
* handler.
|
|
82
|
+
*/
|
|
83
|
+
onChange?: ((detail: {
|
|
84
|
+
values?: number[];
|
|
85
|
+
value?: number;
|
|
86
|
+
}) => void) | undefined;
|
|
87
|
+
} & Record<string, any>, {
|
|
88
|
+
[evt: string]: CustomEvent<any>;
|
|
89
|
+
}, {}, {}, "value">;
|
|
90
|
+
type Props = {
|
|
91
|
+
/**
|
|
92
|
+
* - Current value.
|
|
93
|
+
*/
|
|
94
|
+
value?: number | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* - Minimum allowed value. An alias of the `aria-valuemin` attribute.
|
|
97
|
+
*/
|
|
98
|
+
min?: number | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* - Maximum allowed value. An alias of the `aria-valuemax` attribute.
|
|
101
|
+
*/
|
|
102
|
+
max?: number | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* - `aria-label` on the slider.
|
|
105
|
+
*/
|
|
24
106
|
sliderLabel?: string | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* - Value list for a multi-thumb slider.
|
|
109
|
+
*/
|
|
110
|
+
values?: [number, number] | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* - `aria-label` on a multi-thumb slider.
|
|
113
|
+
*/
|
|
25
114
|
sliderLabels?: [string, string] | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* - Step option like `<input type="range">`.
|
|
117
|
+
*/
|
|
118
|
+
step?: number | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* - Visible labels on the slider.
|
|
121
|
+
*/
|
|
26
122
|
optionLabels?: string[] | number[] | undefined;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
123
|
+
/**
|
|
124
|
+
* - Make the text input container flexible.
|
|
125
|
+
*/
|
|
126
|
+
flex?: boolean | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* - The `class` attribute on the wrapper element.
|
|
129
|
+
*/
|
|
130
|
+
class?: string | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* - Whether to hide the widget.
|
|
133
|
+
*/
|
|
134
|
+
hidden?: boolean | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
137
|
+
* attribute.
|
|
138
|
+
*/
|
|
139
|
+
disabled?: boolean | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* - Whether to make the widget read-only. An alias of the
|
|
142
|
+
* `aria-readonly` attribute.
|
|
143
|
+
*/
|
|
144
|
+
readonly?: boolean | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
147
|
+
* `aria-invalid` attribute.
|
|
148
|
+
*/
|
|
149
|
+
invalid?: boolean | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* - Primary slot content.
|
|
152
|
+
*/
|
|
153
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* - `change` event
|
|
156
|
+
* handler.
|
|
157
|
+
*/
|
|
158
|
+
onChange?: ((detail: {
|
|
159
|
+
values?: number[];
|
|
160
|
+
value?: number;
|
|
161
|
+
}) => void) | undefined;
|
|
62
162
|
};
|
|
63
|
-
|
|
163
|
+
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> {
|
|
164
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
165
|
+
$$bindings?: Bindings;
|
|
166
|
+
} & Exports;
|
|
167
|
+
(internal: unknown, props: Props & {
|
|
168
|
+
$$events?: Events;
|
|
169
|
+
$$slots?: Slots;
|
|
170
|
+
}): Exports & {
|
|
171
|
+
$set?: any;
|
|
172
|
+
$on?: any;
|
|
173
|
+
};
|
|
174
|
+
z_$$bindings?: Bindings;
|
|
175
|
+
}
|
|
@@ -5,58 +5,49 @@
|
|
|
5
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/switch/
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
|
-
import { createEventDispatcher } from 'svelte';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The `class` attribute on the wrapper element.
|
|
12
|
-
* @type {string}
|
|
13
|
-
*/
|
|
14
|
-
let className = '';
|
|
15
|
-
export { className as class };
|
|
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
8
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @
|
|
9
|
+
* @typedef {object} Props
|
|
10
|
+
* @property {string | undefined} [label] - Text label displayed next to the switch.
|
|
11
|
+
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
12
|
+
* @property {boolean} [hidden] - Whether to hide the widget.
|
|
13
|
+
* @property {boolean} [disabled] - Whether to disable the widget. An alias of the `aria-disabled`
|
|
14
|
+
* attribute.
|
|
15
|
+
* @property {boolean} [readonly] - Whether to make the widget read-only. An alias of the
|
|
16
|
+
* `aria-readonly` attribute.
|
|
17
|
+
* @property {boolean} [required] - Whether to mark the widget required. An alias of the
|
|
18
|
+
* `aria-required` attribute.
|
|
19
|
+
* @property {boolean} [invalid] - Whether to mark the widget invalid. An alias of the
|
|
20
|
+
* `aria-invalid` attribute.
|
|
21
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
22
|
+
* @property {(event: CustomEvent) => void} [onChange] - Custom `Change` event handler.
|
|
29
23
|
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Whether to mark the widget required. An alias of the `aria-required` attribute.
|
|
33
|
-
* @type {boolean}
|
|
34
|
-
*/
|
|
35
|
-
export let required = false;
|
|
36
|
-
/**
|
|
37
|
-
* Whether to mark the widget invalid. An alias of the `aria-invalid` attribute.
|
|
38
|
-
* @type {boolean}
|
|
39
|
-
*/
|
|
40
|
-
export let invalid = false;
|
|
41
|
-
/**
|
|
42
|
-
* Whether to check the widget. An alias of the `aria-checked` attribute.
|
|
43
|
-
* @type {boolean | 'mixed'}
|
|
44
|
-
*/
|
|
45
|
-
export let checked = false;
|
|
24
|
+
|
|
46
25
|
/**
|
|
47
|
-
*
|
|
48
|
-
* @type {string | undefined}
|
|
26
|
+
* @type {Props & Record<string, any>}
|
|
49
27
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
28
|
+
let {
|
|
29
|
+
/* eslint-disable prefer-const */
|
|
30
|
+
checked = $bindable(false),
|
|
31
|
+
label = undefined,
|
|
32
|
+
class: className,
|
|
33
|
+
hidden = false,
|
|
34
|
+
disabled = false,
|
|
35
|
+
readonly = false,
|
|
36
|
+
required = false,
|
|
37
|
+
invalid = false,
|
|
38
|
+
children,
|
|
39
|
+
onChange,
|
|
40
|
+
...restProps
|
|
41
|
+
/* eslint-enable prefer-const */
|
|
42
|
+
} = $props();
|
|
53
43
|
</script>
|
|
54
44
|
|
|
55
45
|
<button
|
|
46
|
+
{...restProps}
|
|
56
47
|
role="switch"
|
|
57
48
|
class="sui switch {className}"
|
|
58
49
|
type="button"
|
|
59
|
-
|
|
50
|
+
{hidden}
|
|
60
51
|
disabled={disabled || undefined}
|
|
61
52
|
aria-checked={checked}
|
|
62
53
|
aria-hidden={hidden}
|
|
@@ -64,11 +55,10 @@
|
|
|
64
55
|
aria-readonly={readonly}
|
|
65
56
|
aria-required={required}
|
|
66
57
|
aria-invalid={invalid}
|
|
67
|
-
{
|
|
68
|
-
on:click={() => {
|
|
58
|
+
onclick={() => {
|
|
69
59
|
if (!disabled && !readonly) {
|
|
70
60
|
checked = !checked;
|
|
71
|
-
|
|
61
|
+
onChange?.(new CustomEvent('Change', { detail: { checked } }));
|
|
72
62
|
}
|
|
73
63
|
}}
|
|
74
64
|
>
|
|
@@ -76,7 +66,7 @@
|
|
|
76
66
|
{#if label}
|
|
77
67
|
{label}
|
|
78
68
|
{:else}
|
|
79
|
-
|
|
69
|
+
{@render children?.()}
|
|
80
70
|
{/if}
|
|
81
71
|
</button>
|
|
82
72
|
|
|
@@ -1,54 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default Switch;
|
|
2
|
+
type Switch = SvelteComponent<Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "checked" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A variant of `<Checkbox>`, looking like a switch that can be often seen on mobile apps.
|
|
6
9
|
* @see https://w3c.github.io/aria/#switch
|
|
7
10
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/switch/
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
declare const Switch: $$__sveltets_2_IsomorphicComponent<{
|
|
13
|
+
/**
|
|
14
|
+
* - Text label displayed next to the switch.
|
|
15
|
+
*/
|
|
16
|
+
label?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* - The `class` attribute on the wrapper element.
|
|
19
|
+
*/
|
|
11
20
|
class?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* - Whether to hide the widget.
|
|
23
|
+
*/
|
|
24
|
+
hidden?: boolean | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
27
|
+
* attribute.
|
|
28
|
+
*/
|
|
12
29
|
disabled?: boolean | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* - Whether to make the widget read-only. An alias of the
|
|
32
|
+
* `aria-readonly` attribute.
|
|
33
|
+
*/
|
|
34
|
+
readonly?: boolean | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* - Whether to mark the widget required. An alias of the
|
|
37
|
+
* `aria-required` attribute.
|
|
38
|
+
*/
|
|
39
|
+
required?: boolean | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
42
|
+
* `aria-invalid` attribute.
|
|
43
|
+
*/
|
|
13
44
|
invalid?: boolean | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* - Primary slot content.
|
|
47
|
+
*/
|
|
48
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* - Custom `Change` event handler.
|
|
51
|
+
*/
|
|
52
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
53
|
+
} & Record<string, any>, {
|
|
54
|
+
[evt: string]: CustomEvent<any>;
|
|
55
|
+
}, {}, {}, "checked">;
|
|
56
|
+
type Props = {
|
|
57
|
+
/**
|
|
58
|
+
* - Text label displayed next to the switch.
|
|
59
|
+
*/
|
|
14
60
|
label?: string | undefined;
|
|
15
|
-
|
|
16
|
-
|
|
61
|
+
/**
|
|
62
|
+
* - The `class` attribute on the wrapper element.
|
|
63
|
+
*/
|
|
64
|
+
class?: string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* - Whether to hide the widget.
|
|
67
|
+
*/
|
|
17
68
|
hidden?: boolean | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
71
|
+
* attribute.
|
|
72
|
+
*/
|
|
73
|
+
disabled?: boolean | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* - Whether to make the widget read-only. An alias of the
|
|
76
|
+
* `aria-readonly` attribute.
|
|
77
|
+
*/
|
|
18
78
|
readonly?: boolean | undefined;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
label?: string | undefined;
|
|
38
|
-
checked?: boolean | "mixed" | undefined;
|
|
39
|
-
required?: boolean | undefined;
|
|
40
|
-
hidden?: boolean | undefined;
|
|
41
|
-
readonly?: boolean | undefined;
|
|
42
|
-
};
|
|
43
|
-
events: {
|
|
44
|
-
change: CustomEvent<any>;
|
|
45
|
-
} & {
|
|
46
|
-
[evt: string]: CustomEvent<any>;
|
|
47
|
-
};
|
|
48
|
-
slots: {
|
|
49
|
-
default: {};
|
|
50
|
-
};
|
|
51
|
-
exports?: undefined;
|
|
52
|
-
bindings?: undefined;
|
|
79
|
+
/**
|
|
80
|
+
* - Whether to mark the widget required. An alias of the
|
|
81
|
+
* `aria-required` attribute.
|
|
82
|
+
*/
|
|
83
|
+
required?: boolean | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
86
|
+
* `aria-invalid` attribute.
|
|
87
|
+
*/
|
|
88
|
+
invalid?: boolean | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* - Primary slot content.
|
|
91
|
+
*/
|
|
92
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* - Custom `Change` event handler.
|
|
95
|
+
*/
|
|
96
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
53
97
|
};
|
|
54
|
-
|
|
98
|
+
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> {
|
|
99
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
100
|
+
$$bindings?: Bindings;
|
|
101
|
+
} & Exports;
|
|
102
|
+
(internal: unknown, props: Props & {
|
|
103
|
+
$$events?: Events;
|
|
104
|
+
$$slots?: Slots;
|
|
105
|
+
}): Exports & {
|
|
106
|
+
$set?: any;
|
|
107
|
+
$on?: any;
|
|
108
|
+
};
|
|
109
|
+
z_$$bindings?: Bindings;
|
|
110
|
+
}
|
|
@@ -6,40 +6,44 @@
|
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
8
|
import { generateElementId } from '@sveltia/utils/element';
|
|
9
|
-
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
10
|
+
* @typedef {object} Props
|
|
11
|
+
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
12
|
+
* @property {string} [label] - Display label for the row group.
|
|
13
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
13
14
|
*/
|
|
14
|
-
let className = '';
|
|
15
|
-
export { className as class };
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
|
-
*
|
|
19
|
-
* @type {string}
|
|
17
|
+
* @type {Props & Record<string, any>}
|
|
20
18
|
*/
|
|
21
|
-
|
|
19
|
+
let {
|
|
20
|
+
/* eslint-disable prefer-const */
|
|
21
|
+
class: className,
|
|
22
|
+
label = '',
|
|
23
|
+
children,
|
|
24
|
+
...restProps
|
|
25
|
+
/* eslint-enable prefer-const */
|
|
26
|
+
} = $props();
|
|
22
27
|
|
|
23
28
|
const id = generateElementId('tbody');
|
|
24
29
|
</script>
|
|
25
30
|
|
|
26
31
|
<div
|
|
32
|
+
{...restProps}
|
|
27
33
|
role="rowgroup"
|
|
28
34
|
class="sui table-body row-group {className}"
|
|
29
35
|
aria-labelledby={label ? `${id}-label` : undefined}
|
|
30
36
|
aria-roledescription="table body"
|
|
31
|
-
{...$$restProps}
|
|
32
37
|
>
|
|
33
38
|
{#if label}
|
|
34
39
|
<div role="row" class="row-group-caption">
|
|
35
40
|
<!-- We need `colspan` here but cannot place `<th>` under `<div>`, so use a hack -->
|
|
36
|
-
<!-- prettier-ignore -->
|
|
37
41
|
<svelte:element this={'th'} role="rowheader" id="{id}-label" colspan="9999">
|
|
38
42
|
{label}
|
|
39
43
|
</svelte:element>
|
|
40
44
|
</div>
|
|
41
45
|
{/if}
|
|
42
|
-
|
|
46
|
+
{@render children?.()}
|
|
43
47
|
</div>
|
|
44
48
|
|
|
45
49
|
<style>[role=rowgroup] {
|
|
@@ -1,38 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default TableBody;
|
|
2
|
+
type TableBody = SvelteComponent<Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* The equivalent of the HTML `<tbody>` element.
|
|
6
9
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody
|
|
7
10
|
* @see https://w3c.github.io/aria/#rowgroup
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
declare const TableBody: $$__sveltets_2_IsomorphicComponent<{
|
|
13
|
+
/**
|
|
14
|
+
* - The `class` attribute on the wrapper element.
|
|
15
|
+
*/
|
|
11
16
|
class?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* - Display label for the row group.
|
|
19
|
+
*/
|
|
12
20
|
label?: string | undefined;
|
|
13
|
-
|
|
21
|
+
/**
|
|
22
|
+
* - Primary slot content.
|
|
23
|
+
*/
|
|
24
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
25
|
+
} & Record<string, any>, {
|
|
14
26
|
[evt: string]: CustomEvent<any>;
|
|
15
|
-
}, {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
events: {
|
|
30
|
-
[evt: string]: CustomEvent<any>;
|
|
31
|
-
};
|
|
32
|
-
slots: {
|
|
33
|
-
default: {};
|
|
34
|
-
};
|
|
35
|
-
exports?: undefined;
|
|
36
|
-
bindings?: undefined;
|
|
27
|
+
}, {}, {}, "">;
|
|
28
|
+
type Props = {
|
|
29
|
+
/**
|
|
30
|
+
* - The `class` attribute on the wrapper element.
|
|
31
|
+
*/
|
|
32
|
+
class?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* - Display label for the row group.
|
|
35
|
+
*/
|
|
36
|
+
label?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* - Primary slot content.
|
|
39
|
+
*/
|
|
40
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
37
41
|
};
|
|
38
|
-
|
|
42
|
+
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> {
|
|
43
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
44
|
+
$$bindings?: Bindings;
|
|
45
|
+
} & Exports;
|
|
46
|
+
(internal: unknown, props: Props & {
|
|
47
|
+
$$events?: Events;
|
|
48
|
+
$$slots?: Slots;
|
|
49
|
+
}): Exports & {
|
|
50
|
+
$set?: any;
|
|
51
|
+
$on?: any;
|
|
52
|
+
};
|
|
53
|
+
z_$$bindings?: Bindings;
|
|
54
|
+
}
|
|
@@ -6,15 +6,25 @@
|
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* @
|
|
9
|
+
* @typedef {object} Props
|
|
10
|
+
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
11
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @type {Props & Record<string, any>}
|
|
16
|
+
*/
|
|
17
|
+
let {
|
|
18
|
+
/* eslint-disable prefer-const */
|
|
19
|
+
class: className,
|
|
20
|
+
children,
|
|
21
|
+
...restProps
|
|
22
|
+
/* eslint-enable prefer-const */
|
|
23
|
+
} = $props();
|
|
14
24
|
</script>
|
|
15
25
|
|
|
16
|
-
<div role="cell" class="sui table-cell {className}"
|
|
17
|
-
|
|
26
|
+
<div {...restProps} role="cell" class="sui table-cell {className}">
|
|
27
|
+
{@render children?.()}
|
|
18
28
|
</div>
|
|
19
29
|
|
|
20
30
|
<style>.table-cell {
|