@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
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
|
+
import { createEventDispatcher, onMount } from 'svelte';
|
|
8
9
|
import { activateGroup } from '../../services/group';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -33,6 +34,56 @@
|
|
|
33
34
|
* @type {string | undefined}
|
|
34
35
|
*/
|
|
35
36
|
export let name = undefined;
|
|
37
|
+
|
|
38
|
+
const dispatch = createEventDispatcher();
|
|
39
|
+
/**
|
|
40
|
+
* A reference to the wrapper element.
|
|
41
|
+
* @type {HTMLElement | undefined}
|
|
42
|
+
*/
|
|
43
|
+
let wrapper = undefined;
|
|
44
|
+
/**
|
|
45
|
+
* The indicator’s CSS style.
|
|
46
|
+
* @type {string | undefined}
|
|
47
|
+
*/
|
|
48
|
+
let indicatorStyle = undefined;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Update the indicator position.
|
|
52
|
+
*/
|
|
53
|
+
const updateIndicator = () => {
|
|
54
|
+
window.requestAnimationFrame(() => {
|
|
55
|
+
const selected = /** @type {HTMLElement | null} */ (
|
|
56
|
+
wrapper?.querySelector('[role="tab"][aria-selected="true"]')
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
if (selected) {
|
|
60
|
+
const { offsetTop, offsetLeft, offsetWidth, offsetHeight } = selected;
|
|
61
|
+
|
|
62
|
+
indicatorStyle = Object.entries({
|
|
63
|
+
top: offsetTop,
|
|
64
|
+
left: offsetLeft,
|
|
65
|
+
width: offsetWidth,
|
|
66
|
+
height: offsetHeight,
|
|
67
|
+
})
|
|
68
|
+
.map(([key, value]) => `${key}: ${value}px`)
|
|
69
|
+
.join('; ');
|
|
70
|
+
} else {
|
|
71
|
+
indicatorStyle = undefined;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
onMount(() => {
|
|
77
|
+
const observer = new ResizeObserver(() => {
|
|
78
|
+
updateIndicator();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
observer.observe(/** @type {HTMLElement} */ (wrapper));
|
|
82
|
+
|
|
83
|
+
return () => {
|
|
84
|
+
observer.disconnect();
|
|
85
|
+
};
|
|
86
|
+
});
|
|
36
87
|
</script>
|
|
37
88
|
|
|
38
89
|
<div
|
|
@@ -44,53 +95,85 @@
|
|
|
44
95
|
aria-orientation={orientation}
|
|
45
96
|
data-name={name || undefined}
|
|
46
97
|
{...$$restProps}
|
|
98
|
+
bind:this={wrapper}
|
|
47
99
|
use:activateGroup
|
|
48
|
-
on:
|
|
100
|
+
on:initialized={() => {
|
|
101
|
+
updateIndicator();
|
|
102
|
+
}}
|
|
103
|
+
on:change={(/** @type {CustomEvent} */ event) => {
|
|
104
|
+
dispatch('change', event.detail);
|
|
105
|
+
updateIndicator();
|
|
106
|
+
}}
|
|
49
107
|
>
|
|
50
108
|
<div role="none" class="inner" inert={disabled}>
|
|
51
109
|
<slot />
|
|
52
110
|
</div>
|
|
111
|
+
<div role="none" class="indicator" style={indicatorStyle} />
|
|
53
112
|
</div>
|
|
54
113
|
|
|
55
114
|
<style>.tab-list {
|
|
115
|
+
flex: none;
|
|
116
|
+
position: relative;
|
|
56
117
|
display: flex;
|
|
57
118
|
align-items: center;
|
|
58
|
-
margin: var(--sui-focus-ring-width);
|
|
59
|
-
border-color: var(--sui-control-border-color);
|
|
119
|
+
margin: var(--sui-tab-list-margin, var(--sui-focus-ring-width));
|
|
120
|
+
border-color: var(--sui-tab-list-border-color, var(--sui-control-border-color));
|
|
121
|
+
border-radius: var(--sui-tab-list-border-radius, 0);
|
|
122
|
+
background-color: var(--sui-tab-list-background-color, transparent);
|
|
60
123
|
}
|
|
61
124
|
.tab-list[aria-orientation=horizontal] {
|
|
62
|
-
gap: 8px;
|
|
63
|
-
margin
|
|
64
|
-
border-width: 0 0 1px;
|
|
65
|
-
padding: 0 16px;
|
|
125
|
+
gap: var(--sui-horizontal-tab-list-gap, var(--sui-tab-list-gap, 8px));
|
|
126
|
+
margin: var(--sui-horizontal-tab-list-margin, var(--sui-tab-list-margin, 0 0 32px));
|
|
127
|
+
border-width: var(--sui-horizontal-tab-list-border-width, var(--sui-tab-list-border-width, 0 0 1px));
|
|
128
|
+
padding: var(--sui-horizontal-tab-list-padding, var(--sui-tab-list-padding, 0 16px));
|
|
66
129
|
}
|
|
67
130
|
.tab-list[aria-orientation=horizontal] :global(button) {
|
|
68
|
-
|
|
131
|
+
width: var(--sui-horizontal-tab-width, var(--sui-tab-width, auto));
|
|
132
|
+
height: var(--sui-horizontal-tab-height, var(--sui-tab-height, 100%));
|
|
133
|
+
justify-content: var(--sui-horizontal-tab-justify-content, center);
|
|
134
|
+
}
|
|
135
|
+
.tab-list[aria-orientation=horizontal] .indicator {
|
|
136
|
+
border-width: var(--sui-horizontal-tab-list-indicator-border-width, var(--sui-tab-list-indicator-border-width, 0 0 2px 0));
|
|
69
137
|
}
|
|
70
138
|
.tab-list[aria-orientation=vertical] {
|
|
71
|
-
gap: 8px;
|
|
139
|
+
gap: var(--sui-vertical-tab-list-gap, var(--sui-tab-list-gap, 8px));
|
|
72
140
|
flex-direction: column;
|
|
73
|
-
margin
|
|
74
|
-
border-width: 0 1px 0 0;
|
|
75
|
-
padding: 8px 0;
|
|
76
|
-
width: 240px;
|
|
141
|
+
margin: var(--sui-vertical-tab-list-margin, var(--sui-tab-list-margin, 0 32px 0 0));
|
|
142
|
+
border-width: var(--sui-vertical-tab-list-border-width, var(--sui-tab-list-border-width, 0 1px 0 0));
|
|
143
|
+
padding: var(--sui-vertical-tab-list-padding, var(--sui-tab-list-padding, 8px 0));
|
|
144
|
+
width: var(--sui-vertical-tab-list-width, 240px);
|
|
77
145
|
}
|
|
78
146
|
.tab-list[aria-orientation=vertical] :global(button) {
|
|
79
|
-
|
|
80
|
-
width: 100
|
|
147
|
+
justify-content: var(--sui-vertical-tab-justify-content, flex-start);
|
|
148
|
+
width: var(--sui-vertical-tab-width, var(--sui-tab-width, 100%));
|
|
149
|
+
height: var(--sui-vertical-tab-height, var(--sui-tab-height, auto));
|
|
150
|
+
}
|
|
151
|
+
.tab-list[aria-orientation=vertical] .indicator {
|
|
152
|
+
border-width: var(--sui-horizontal-tab-list-vertical-border-width, var(--sui-tab-list-indicator-border-width, 0 2px 0 0));
|
|
81
153
|
}
|
|
82
154
|
.tab-list :global(button) {
|
|
83
|
-
|
|
155
|
+
position: relative;
|
|
156
|
+
z-index: 1;
|
|
84
157
|
border-color: transparent;
|
|
85
158
|
margin: 0 !important;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
.tab-list :global(button[aria-selected="true"]) {
|
|
91
|
-
border-color: var(--sui-primary-accent-color-light);
|
|
159
|
+
border-radius: var(--sui-tab-border-radius, 0);
|
|
160
|
+
font-family: var(--sui-tab-font-family, var(--sui-control-font-family, inherit));
|
|
161
|
+
font-size: var(--sui-tab-font-size, var(--sui-control-font-size, inherit));
|
|
162
|
+
font-weight: var(--sui-tab-font-weight, var(--sui-control-font-weight, inherit));
|
|
92
163
|
}
|
|
93
164
|
|
|
94
165
|
.inner {
|
|
95
166
|
display: contents;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.indicator {
|
|
170
|
+
position: absolute;
|
|
171
|
+
z-index: 0;
|
|
172
|
+
inset: auto;
|
|
173
|
+
border-radius: var(--sui-tab-list-indicator-border-radius, 0);
|
|
174
|
+
border-color: var(--sui-tab-list-indicator-border-color, var(--sui-primary-accent-color-light));
|
|
175
|
+
background-color: var(--sui-tab-list-indicator-background-color, transparent);
|
|
176
|
+
box-shadow: var(--sui-tab-list-indicator-box-shadow, none);
|
|
177
|
+
pointer-events: none;
|
|
178
|
+
transition: var(--sui-tab-list-indicator-transition, all 200ms);
|
|
96
179
|
}</style>
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class TabList extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
12
|
-
name?: string;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
hidden?: boolean;
|
|
15
|
-
orientation?: "vertical" | "horizontal";
|
|
11
|
+
class?: string | undefined;
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
hidden?: boolean | undefined;
|
|
15
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
16
16
|
}, {
|
|
17
|
-
change:
|
|
17
|
+
change: CustomEvent<any>;
|
|
18
18
|
} & {
|
|
19
19
|
[evt: string]: CustomEvent<any>;
|
|
20
20
|
}, {
|
|
@@ -28,14 +28,14 @@ import { SvelteComponent } from "svelte";
|
|
|
28
28
|
declare const __propDef: {
|
|
29
29
|
props: {
|
|
30
30
|
[x: string]: any;
|
|
31
|
-
class?: string;
|
|
31
|
+
class?: string | undefined;
|
|
32
32
|
name?: string | undefined;
|
|
33
|
-
disabled?: boolean;
|
|
33
|
+
disabled?: boolean | undefined;
|
|
34
34
|
hidden?: boolean | undefined;
|
|
35
|
-
orientation?:
|
|
35
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
36
36
|
};
|
|
37
37
|
events: {
|
|
38
|
-
change:
|
|
38
|
+
change: CustomEvent<any>;
|
|
39
39
|
} & {
|
|
40
40
|
[evt: string]: CustomEvent<any>;
|
|
41
41
|
};
|
|
@@ -13,10 +13,14 @@
|
|
|
13
13
|
export { className as class };
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
|
-
<div role="tabpanel" class="sui
|
|
16
|
+
<div role="tabpanel" class="sui tab-panel {className}" {...$$restProps}>
|
|
17
17
|
<slot />
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
<style>.
|
|
20
|
+
<style>.tab-panel {
|
|
21
|
+
flex: auto;
|
|
22
|
+
transition: all 200ms;
|
|
23
|
+
}
|
|
24
|
+
.tab-panel[aria-hidden=true], .tab-panel:not([aria-hidden]) {
|
|
21
25
|
display: none;
|
|
22
26
|
}</style>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class TabPanel 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,32 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
The container of `<TabPanel>`s. The component name derives from XUL. This can be omitted if the
|
|
4
|
+
child tab panels don’t need a sliding animation.
|
|
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
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div role="none" class="sui tab-panels {className}">
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style>.tab-panels {
|
|
20
|
+
flex: auto;
|
|
21
|
+
display: flex;
|
|
22
|
+
gap: var(--sui-tab-panels-gap, 16px);
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
scroll-snap-type: x mandatory;
|
|
25
|
+
}
|
|
26
|
+
.tab-panels > :global(.tab-panel) {
|
|
27
|
+
flex: none;
|
|
28
|
+
display: block !important;
|
|
29
|
+
width: 100%;
|
|
30
|
+
overflow: auto;
|
|
31
|
+
scroll-snap-align: center;
|
|
32
|
+
}</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TabPanelsProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TabPanelsEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TabPanelsSlots */
|
|
4
|
+
/**
|
|
5
|
+
* The container of `<TabPanel>`s. The component name derives from XUL. This can be omitted if the
|
|
6
|
+
* child tab panels don’t need a sliding animation.
|
|
7
|
+
*/
|
|
8
|
+
export default class TabPanels extends SvelteComponent<{
|
|
9
|
+
class?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
}, {
|
|
13
|
+
default: {};
|
|
14
|
+
}> {
|
|
15
|
+
}
|
|
16
|
+
export type TabPanelsProps = typeof __propDef.props;
|
|
17
|
+
export type TabPanelsEvents = typeof __propDef.events;
|
|
18
|
+
export type TabPanelsSlots = typeof __propDef.slots;
|
|
19
|
+
import { SvelteComponent } from "svelte";
|
|
20
|
+
declare const __propDef: {
|
|
21
|
+
props: {
|
|
22
|
+
class?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
};
|
|
27
|
+
slots: {
|
|
28
|
+
default: {};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class Tab extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
hidden?: boolean;
|
|
14
|
-
selected?: boolean;
|
|
11
|
+
class?: string | undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
hidden?: boolean | undefined;
|
|
14
|
+
selected?: boolean | undefined;
|
|
15
15
|
}, {
|
|
16
|
-
select:
|
|
17
|
-
change:
|
|
16
|
+
select: CustomEvent<any>;
|
|
17
|
+
change: CustomEvent<any>;
|
|
18
18
|
} & {
|
|
19
19
|
[evt: string]: CustomEvent<any>;
|
|
20
20
|
}, {
|
|
@@ -34,14 +34,14 @@ import { SvelteComponent } from "svelte";
|
|
|
34
34
|
declare const __propDef: {
|
|
35
35
|
props: {
|
|
36
36
|
[x: string]: any;
|
|
37
|
-
class?: string;
|
|
38
|
-
disabled?: boolean;
|
|
37
|
+
class?: string | undefined;
|
|
38
|
+
disabled?: boolean | undefined;
|
|
39
39
|
hidden?: boolean | undefined;
|
|
40
|
-
selected?: boolean;
|
|
40
|
+
selected?: boolean | undefined;
|
|
41
41
|
};
|
|
42
42
|
events: {
|
|
43
|
-
select:
|
|
44
|
-
change:
|
|
43
|
+
select: CustomEvent<any>;
|
|
44
|
+
change: CustomEvent<any>;
|
|
45
45
|
} & {
|
|
46
46
|
[evt: string]: CustomEvent<any>;
|
|
47
47
|
};
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
/** A Markdown text editor. */
|
|
5
5
|
export default class MarkdownEditor extends SvelteComponent<{
|
|
6
6
|
[x: string]: any;
|
|
7
|
-
invalid?: boolean;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
required?: boolean;
|
|
10
|
-
value?: string;
|
|
11
|
-
hidden?: boolean;
|
|
12
|
-
readonly?: boolean;
|
|
13
|
-
flex?: boolean;
|
|
7
|
+
invalid?: boolean | undefined;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
required?: boolean | undefined;
|
|
10
|
+
value?: string | undefined;
|
|
11
|
+
hidden?: boolean | undefined;
|
|
12
|
+
readonly?: boolean | undefined;
|
|
13
|
+
flex?: boolean | undefined;
|
|
14
14
|
}, {
|
|
15
15
|
[evt: string]: CustomEvent<any>;
|
|
16
16
|
}, {}> {
|
|
@@ -22,13 +22,13 @@ import { SvelteComponent } from "svelte";
|
|
|
22
22
|
declare const __propDef: {
|
|
23
23
|
props: {
|
|
24
24
|
[x: string]: any;
|
|
25
|
-
invalid?: boolean;
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
required?: boolean;
|
|
25
|
+
invalid?: boolean | undefined;
|
|
26
|
+
disabled?: boolean | undefined;
|
|
27
|
+
required?: boolean | undefined;
|
|
28
28
|
value?: string | undefined;
|
|
29
29
|
hidden?: boolean | undefined;
|
|
30
|
-
readonly?: boolean;
|
|
31
|
-
flex?: boolean;
|
|
30
|
+
readonly?: boolean | undefined;
|
|
31
|
+
flex?: boolean | undefined;
|
|
32
32
|
};
|
|
33
33
|
events: {
|
|
34
34
|
[evt: string]: CustomEvent<any>;
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
let component;
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* Decrease the number.
|
|
89
89
|
*/
|
|
90
90
|
const decrease = () => {
|
|
91
91
|
if (isMin) {
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
99
|
+
* Increase the number.
|
|
100
100
|
*/
|
|
101
101
|
const increase = () => {
|
|
102
102
|
if (isMax) {
|
|
@@ -125,7 +125,9 @@
|
|
|
125
125
|
increase();
|
|
126
126
|
}}
|
|
127
127
|
>
|
|
128
|
-
<
|
|
128
|
+
<slot name="increase-icon" slot="start-icon">
|
|
129
|
+
<Icon name="expand_less" />
|
|
130
|
+
</slot>
|
|
129
131
|
</Button>
|
|
130
132
|
<Button
|
|
131
133
|
iconic
|
|
@@ -136,7 +138,9 @@
|
|
|
136
138
|
decrease();
|
|
137
139
|
}}
|
|
138
140
|
>
|
|
139
|
-
<
|
|
141
|
+
<slot name="decrease-icon" slot="start-icon">
|
|
142
|
+
<Icon name="expand_more" />
|
|
143
|
+
</slot>
|
|
140
144
|
</Button>
|
|
141
145
|
</div>
|
|
142
146
|
<TextInput
|
|
@@ -174,8 +178,11 @@
|
|
|
174
178
|
edited = true;
|
|
175
179
|
}
|
|
176
180
|
}}
|
|
181
|
+
on:keydown
|
|
182
|
+
on:keyup
|
|
177
183
|
on:keypress
|
|
178
184
|
on:input
|
|
185
|
+
on:change
|
|
179
186
|
/>
|
|
180
187
|
</div>
|
|
181
188
|
|
|
@@ -8,23 +8,33 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export default class NumberInput extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
class?: string;
|
|
12
|
-
invalid?: boolean;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
max?: number;
|
|
15
|
-
min?: number;
|
|
16
|
-
required?: boolean;
|
|
17
|
-
step?: number;
|
|
18
|
-
value?: string;
|
|
19
|
-
hidden?: boolean;
|
|
20
|
-
readonly?: boolean;
|
|
21
|
-
flex?: boolean;
|
|
11
|
+
class?: string | undefined;
|
|
12
|
+
invalid?: boolean | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
max?: number | undefined;
|
|
15
|
+
min?: number | undefined;
|
|
16
|
+
required?: boolean | undefined;
|
|
17
|
+
step?: number | undefined;
|
|
18
|
+
value?: string | undefined;
|
|
19
|
+
hidden?: boolean | undefined;
|
|
20
|
+
readonly?: boolean | undefined;
|
|
21
|
+
flex?: boolean | undefined;
|
|
22
22
|
}, {
|
|
23
|
+
keydown: KeyboardEvent;
|
|
24
|
+
keyup: KeyboardEvent;
|
|
23
25
|
keypress: KeyboardEvent;
|
|
24
26
|
input: Event;
|
|
27
|
+
change: Event;
|
|
25
28
|
} & {
|
|
26
29
|
[evt: string]: CustomEvent<any>;
|
|
27
|
-
}, {
|
|
30
|
+
}, {
|
|
31
|
+
'increase-icon': {
|
|
32
|
+
slot: string;
|
|
33
|
+
};
|
|
34
|
+
'decrease-icon': {
|
|
35
|
+
slot: string;
|
|
36
|
+
};
|
|
37
|
+
}> {
|
|
28
38
|
}
|
|
29
39
|
export type NumberInputProps = typeof __propDef.props;
|
|
30
40
|
export type NumberInputEvents = typeof __propDef.events;
|
|
@@ -33,24 +43,34 @@ import { SvelteComponent } from "svelte";
|
|
|
33
43
|
declare const __propDef: {
|
|
34
44
|
props: {
|
|
35
45
|
[x: string]: any;
|
|
36
|
-
class?: string;
|
|
37
|
-
invalid?: boolean;
|
|
38
|
-
disabled?: boolean;
|
|
46
|
+
class?: string | undefined;
|
|
47
|
+
invalid?: boolean | undefined;
|
|
48
|
+
disabled?: boolean | undefined;
|
|
39
49
|
max?: number | undefined;
|
|
40
50
|
min?: number | undefined;
|
|
41
|
-
required?: boolean;
|
|
42
|
-
step?: number;
|
|
51
|
+
required?: boolean | undefined;
|
|
52
|
+
step?: number | undefined;
|
|
43
53
|
value?: string | undefined;
|
|
44
54
|
hidden?: boolean | undefined;
|
|
45
|
-
readonly?: boolean;
|
|
46
|
-
flex?: boolean;
|
|
55
|
+
readonly?: boolean | undefined;
|
|
56
|
+
flex?: boolean | undefined;
|
|
47
57
|
};
|
|
48
58
|
events: {
|
|
59
|
+
keydown: KeyboardEvent;
|
|
60
|
+
keyup: KeyboardEvent;
|
|
49
61
|
keypress: KeyboardEvent;
|
|
50
62
|
input: Event;
|
|
63
|
+
change: Event;
|
|
51
64
|
} & {
|
|
52
65
|
[evt: string]: CustomEvent<any>;
|
|
53
66
|
};
|
|
54
|
-
slots: {
|
|
67
|
+
slots: {
|
|
68
|
+
'increase-icon': {
|
|
69
|
+
slot: string;
|
|
70
|
+
};
|
|
71
|
+
'decrease-icon': {
|
|
72
|
+
slot: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
55
75
|
};
|
|
56
76
|
export {};
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
|
|
65
65
|
$: {
|
|
66
66
|
if (inputComponent) {
|
|
67
|
-
inputComponent.element
|
|
67
|
+
inputComponent.element?.setAttribute('type', passwordVisible ? 'text' : 'password');
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
</script>
|
|
@@ -90,8 +90,10 @@
|
|
|
90
90
|
{invalid}
|
|
91
91
|
{...$$restProps}
|
|
92
92
|
bind:this={inputComponent}
|
|
93
|
-
on:
|
|
93
|
+
on:keydown
|
|
94
|
+
on:keyup
|
|
94
95
|
on:keypress
|
|
96
|
+
on:input
|
|
95
97
|
on:change
|
|
96
98
|
/>
|
|
97
99
|
<Button
|
|
@@ -106,7 +108,9 @@
|
|
|
106
108
|
passwordVisible = !passwordVisible;
|
|
107
109
|
}}
|
|
108
110
|
>
|
|
109
|
-
<
|
|
111
|
+
<slot name="visibility-icon" slot="start-icon">
|
|
112
|
+
<Icon name={passwordVisible ? 'visibility_off' : 'visibility'} />
|
|
113
|
+
</slot>
|
|
110
114
|
</Button>
|
|
111
115
|
</div>
|
|
112
116
|
|
|
@@ -9,21 +9,27 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export default class PasswordInput extends SvelteComponent<{
|
|
11
11
|
[x: string]: any;
|
|
12
|
-
class?: string;
|
|
13
|
-
invalid?: boolean;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
required?: boolean;
|
|
16
|
-
value?: string;
|
|
17
|
-
hidden?: boolean;
|
|
18
|
-
readonly?: boolean;
|
|
19
|
-
flex?: boolean;
|
|
12
|
+
class?: string | undefined;
|
|
13
|
+
invalid?: boolean | undefined;
|
|
14
|
+
disabled?: boolean | undefined;
|
|
15
|
+
required?: boolean | undefined;
|
|
16
|
+
value?: string | undefined;
|
|
17
|
+
hidden?: boolean | undefined;
|
|
18
|
+
readonly?: boolean | undefined;
|
|
19
|
+
flex?: boolean | undefined;
|
|
20
20
|
}, {
|
|
21
|
-
|
|
21
|
+
keydown: KeyboardEvent;
|
|
22
|
+
keyup: KeyboardEvent;
|
|
22
23
|
keypress: KeyboardEvent;
|
|
24
|
+
input: Event;
|
|
23
25
|
change: Event;
|
|
24
26
|
} & {
|
|
25
27
|
[evt: string]: CustomEvent<any>;
|
|
26
|
-
}, {
|
|
28
|
+
}, {
|
|
29
|
+
'visibility-icon': {
|
|
30
|
+
slot: string;
|
|
31
|
+
};
|
|
32
|
+
}> {
|
|
27
33
|
}
|
|
28
34
|
export type PasswordInputProps = typeof __propDef.props;
|
|
29
35
|
export type PasswordInputEvents = typeof __propDef.events;
|
|
@@ -32,22 +38,28 @@ import { SvelteComponent } from "svelte";
|
|
|
32
38
|
declare const __propDef: {
|
|
33
39
|
props: {
|
|
34
40
|
[x: string]: any;
|
|
35
|
-
class?: string;
|
|
36
|
-
invalid?: boolean;
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
required?: boolean;
|
|
41
|
+
class?: string | undefined;
|
|
42
|
+
invalid?: boolean | undefined;
|
|
43
|
+
disabled?: boolean | undefined;
|
|
44
|
+
required?: boolean | undefined;
|
|
39
45
|
value?: string | undefined;
|
|
40
46
|
hidden?: boolean | undefined;
|
|
41
|
-
readonly?: boolean;
|
|
42
|
-
flex?: boolean;
|
|
47
|
+
readonly?: boolean | undefined;
|
|
48
|
+
flex?: boolean | undefined;
|
|
43
49
|
};
|
|
44
50
|
events: {
|
|
45
|
-
|
|
51
|
+
keydown: KeyboardEvent;
|
|
52
|
+
keyup: KeyboardEvent;
|
|
46
53
|
keypress: KeyboardEvent;
|
|
54
|
+
input: Event;
|
|
47
55
|
change: Event;
|
|
48
56
|
} & {
|
|
49
57
|
[evt: string]: CustomEvent<any>;
|
|
50
58
|
};
|
|
51
|
-
slots: {
|
|
59
|
+
slots: {
|
|
60
|
+
'visibility-icon': {
|
|
61
|
+
slot: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
52
64
|
};
|
|
53
65
|
export {};
|
|
@@ -83,7 +83,9 @@
|
|
|
83
83
|
aria-hidden={hidden}
|
|
84
84
|
>
|
|
85
85
|
<span role="none">
|
|
86
|
-
<
|
|
86
|
+
<slot name="search-icon">
|
|
87
|
+
<Icon name="search" />
|
|
88
|
+
</slot>
|
|
87
89
|
</span>
|
|
88
90
|
<TextInput
|
|
89
91
|
role="searchbox"
|
|
@@ -98,10 +100,10 @@
|
|
|
98
100
|
inputmode="search"
|
|
99
101
|
{...$$restProps}
|
|
100
102
|
bind:this={inputComponent}
|
|
101
|
-
on:input
|
|
102
103
|
on:keydown
|
|
103
104
|
on:keyup
|
|
104
105
|
on:keypress
|
|
106
|
+
on:input
|
|
105
107
|
on:change
|
|
106
108
|
/>
|
|
107
109
|
{#if value}
|
|
@@ -119,7 +121,9 @@
|
|
|
119
121
|
});
|
|
120
122
|
}}
|
|
121
123
|
>
|
|
122
|
-
<
|
|
124
|
+
<slot name="close-button" slot="start-icon">
|
|
125
|
+
<Icon name="close" />
|
|
126
|
+
</slot>
|
|
123
127
|
</Button>
|
|
124
128
|
{/if}
|
|
125
129
|
</div>
|