@sveltia/ui 0.1.5 → 0.2.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.json +22 -11
- package/package/components/composite/calendar.svelte +0 -240
- package/package/components/composite/calendar.svelte.d.ts +0 -20
- package/package/components/composite/checkbox-group.svelte +0 -43
- package/package/components/composite/checkbox-group.svelte.d.ts +0 -24
- package/package/components/composite/combobox.svelte +0 -206
- package/package/components/composite/combobox.svelte.d.ts +0 -32
- package/package/components/composite/disclosure.svelte +0 -60
- package/package/components/composite/disclosure.svelte.d.ts +0 -26
- package/package/components/composite/grid.svelte +0 -24
- package/package/components/composite/grid.svelte.d.ts +0 -22
- package/package/components/composite/listbox.svelte +0 -63
- package/package/components/composite/listbox.svelte.d.ts +0 -39
- package/package/components/composite/menu-item-group.svelte +0 -31
- package/package/components/composite/menu-item-group.svelte.d.ts +0 -23
- package/package/components/composite/menu.svelte +0 -44
- package/package/components/composite/menu.svelte.d.ts +0 -32
- package/package/components/composite/radio-button-group.svelte +0 -45
- package/package/components/composite/radio-button-group.svelte.d.ts +0 -27
- package/package/components/composite/select-button-group.svelte +0 -71
- package/package/components/composite/select-button-group.svelte.d.ts +0 -31
- package/package/components/composite/select.svelte +0 -34
- package/package/components/composite/select.svelte.d.ts +0 -26
- package/package/components/composite/tab-list.svelte +0 -76
- package/package/components/composite/tab-list.svelte.d.ts +0 -42
- package/package/components/core/button.svelte +0 -205
- package/package/components/core/button.svelte.d.ts +0 -78
- package/package/components/core/checkbox.svelte +0 -104
- package/package/components/core/checkbox.svelte.d.ts +0 -30
- package/package/components/core/dialog.svelte +0 -274
- package/package/components/core/dialog.svelte.d.ts +0 -45
- package/package/components/core/grid-cell.svelte +0 -14
- package/package/components/core/grid-cell.svelte.d.ts +0 -21
- package/package/components/core/group.svelte +0 -31
- package/package/components/core/group.svelte.d.ts +0 -23
- package/package/components/core/icon.svelte +0 -21
- package/package/components/core/icon.svelte.d.ts +0 -20
- package/package/components/core/menu-button.svelte +0 -57
- package/package/components/core/menu-button.svelte.d.ts +0 -30
- package/package/components/core/menu-item-checkbox.svelte +0 -24
- package/package/components/core/menu-item-checkbox.svelte.d.ts +0 -24
- package/package/components/core/menu-item-radio.svelte +0 -19
- package/package/components/core/menu-item-radio.svelte.d.ts +0 -24
- package/package/components/core/menu-item.svelte +0 -113
- package/package/components/core/menu-item.svelte.d.ts +0 -29
- package/package/components/core/number-input.svelte +0 -112
- package/package/components/core/number-input.svelte.d.ts +0 -28
- package/package/components/core/option.svelte +0 -59
- package/package/components/core/option.svelte.d.ts +0 -35
- package/package/components/core/password-input.svelte +0 -81
- package/package/components/core/password-input.svelte.d.ts +0 -25
- package/package/components/core/radio-button.svelte +0 -93
- package/package/components/core/radio-button.svelte.d.ts +0 -27
- package/package/components/core/row-group.svelte +0 -14
- package/package/components/core/row-group.svelte.d.ts +0 -21
- package/package/components/core/row.svelte +0 -14
- package/package/components/core/row.svelte.d.ts +0 -23
- package/package/components/core/search-bar.svelte +0 -90
- package/package/components/core/search-bar.svelte.d.ts +0 -35
- package/package/components/core/select-button.svelte +0 -31
- package/package/components/core/select-button.svelte.d.ts +0 -35
- package/package/components/core/separator.svelte +0 -28
- package/package/components/core/separator.svelte.d.ts +0 -20
- package/package/components/core/slider.svelte +0 -270
- package/package/components/core/slider.svelte.d.ts +0 -35
- package/package/components/core/spacer.svelte +0 -22
- package/package/components/core/spacer.svelte.d.ts +0 -19
- package/package/components/core/switch.svelte +0 -80
- package/package/components/core/switch.svelte.d.ts +0 -27
- package/package/components/core/tab-panel.svelte +0 -23
- package/package/components/core/tab-panel.svelte.d.ts +0 -25
- package/package/components/core/tab.svelte +0 -22
- package/package/components/core/tab.svelte.d.ts +0 -31
- package/package/components/core/text-area.svelte +0 -90
- package/package/components/core/text-area.svelte.d.ts +0 -43
- package/package/components/core/text-input.svelte +0 -145
- package/package/components/core/text-input.svelte.d.ts +0 -53
- package/package/components/core/toolbar.svelte +0 -74
- package/package/components/core/toolbar.svelte.d.ts +0 -26
- package/package/components/editor/markdown.svelte +0 -78
- package/package/components/editor/markdown.svelte.d.ts +0 -19
- package/package/components/helpers/group.d.ts +0 -37
- package/package/components/helpers/group.js +0 -246
- package/package/components/helpers/popup.d.ts +0 -26
- package/package/components/helpers/popup.js +0 -154
- package/package/components/helpers/util.d.ts +0 -1
- package/package/components/helpers/util.js +0 -8
- package/package/components/util/app-shell.svelte +0 -284
- package/package/components/util/app-shell.svelte.d.ts +0 -28
- package/package/components/util/misc.d.ts +0 -2
- package/package/components/util/misc.js +0 -22
- package/package/components/util/popup.svelte +0 -145
- package/package/components/util/popup.svelte.d.ts +0 -37
- package/package/components/util/portal.svelte +0 -34
- package/package/components/util/portal.svelte.d.ts +0 -21
- package/package/index.d.ts +0 -41
- package/package/index.js +0 -66
- package/package/locales/en.d.ts +0 -42
- package/package/locales/en.js +0 -41
- package/package/locales/ja.d.ts +0 -42
- package/package/locales/ja.js +0 -41
- package/package/styles/core.scss +0 -134
- package/package/styles/variables.scss +0 -114
- package/package/typedef.d.ts +0 -0
- package/package/typedef.js +0 -0
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#dialog
|
|
4
|
-
@see https://w3c.github.io/aria-practices/#dialog_modal
|
|
5
|
-
-->
|
|
6
|
-
<script>
|
|
7
|
-
import { createEventDispatcher, onMount } from 'svelte';
|
|
8
|
-
import { _ } from 'svelte-i18n';
|
|
9
|
-
import Button from './button.svelte';
|
|
10
|
-
import Icon from './icon.svelte';
|
|
11
|
-
import Spacer from './spacer.svelte';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* CSS class name on the button.
|
|
15
|
-
* @type {String}
|
|
16
|
-
*/
|
|
17
|
-
let className = '';
|
|
18
|
-
|
|
19
|
-
export { className as class };
|
|
20
|
-
|
|
21
|
-
export let open = false;
|
|
22
|
-
|
|
23
|
-
export let title = '';
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Width of the dialog.
|
|
27
|
-
* @type {('small'|'medium'|'large')}
|
|
28
|
-
*/
|
|
29
|
-
export let size = 'medium';
|
|
30
|
-
|
|
31
|
-
export let modal = true;
|
|
32
|
-
|
|
33
|
-
export let showCancel = true;
|
|
34
|
-
|
|
35
|
-
export let showOk = true;
|
|
36
|
-
|
|
37
|
-
export let showClose = false;
|
|
38
|
-
|
|
39
|
-
export let okLabel = '';
|
|
40
|
-
|
|
41
|
-
export let okDisabled = false;
|
|
42
|
-
|
|
43
|
-
export let cancelLabel = '';
|
|
44
|
-
|
|
45
|
-
export let cancelDisabled = false;
|
|
46
|
-
|
|
47
|
-
export let closeOnBackdropClick = false;
|
|
48
|
-
|
|
49
|
-
const dispatch = createEventDispatcher();
|
|
50
|
-
/** @type {?HTMLDialogElement} */
|
|
51
|
-
let dialog;
|
|
52
|
-
let showDialog = false;
|
|
53
|
-
let showContent = false;
|
|
54
|
-
let closeDialogTimer = 0;
|
|
55
|
-
|
|
56
|
-
$: {
|
|
57
|
-
if (dialog) {
|
|
58
|
-
if (open) {
|
|
59
|
-
window.clearTimeout(closeDialogTimer);
|
|
60
|
-
(document.querySelector('.sui.app-shell') || document.body).appendChild(dialog);
|
|
61
|
-
showContent = true;
|
|
62
|
-
|
|
63
|
-
if (modal) {
|
|
64
|
-
dialog.showModal();
|
|
65
|
-
} else {
|
|
66
|
-
dialog.show();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
window.requestAnimationFrame(() => {
|
|
70
|
-
showDialog = true;
|
|
71
|
-
});
|
|
72
|
-
} else {
|
|
73
|
-
showDialog = false;
|
|
74
|
-
|
|
75
|
-
closeDialogTimer = window.setTimeout(() => {
|
|
76
|
-
showContent = false;
|
|
77
|
-
dialog?.close();
|
|
78
|
-
dialog?.remove();
|
|
79
|
-
}, 500);
|
|
80
|
-
|
|
81
|
-
if (dialog.returnValue === 'ok') {
|
|
82
|
-
dispatch('ok');
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (dialog.returnValue === 'cancel') {
|
|
86
|
-
dispatch('cancel');
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
dispatch('close', dialog.returnValue);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
onMount(() => {
|
|
95
|
-
dialog.remove();
|
|
96
|
-
|
|
97
|
-
// onUnmount
|
|
98
|
-
return () => {
|
|
99
|
-
dialog?.close();
|
|
100
|
-
dialog?.remove();
|
|
101
|
-
};
|
|
102
|
-
});
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
106
|
-
<dialog
|
|
107
|
-
bind:this={dialog}
|
|
108
|
-
class="sui dialog {className} {size}"
|
|
109
|
-
class:open={showDialog}
|
|
110
|
-
on:click={({ target }) => {
|
|
111
|
-
if (closeOnBackdropClick && target?.matches('dialog')) {
|
|
112
|
-
dialog.returnValue = 'cancel';
|
|
113
|
-
open = false;
|
|
114
|
-
}
|
|
115
|
-
}}
|
|
116
|
-
on:cancel={() => {
|
|
117
|
-
// Cancelled with the Escape key
|
|
118
|
-
open = false;
|
|
119
|
-
}}
|
|
120
|
-
>
|
|
121
|
-
<form method="dialog" on:submit|preventDefault>
|
|
122
|
-
{#if showContent}
|
|
123
|
-
{#if title || showClose || $$slots.header || $$slots['header-extra']}
|
|
124
|
-
<div class="header">
|
|
125
|
-
{#if $$slots.header}
|
|
126
|
-
<slot name="header" />
|
|
127
|
-
{:else}
|
|
128
|
-
<div class="title">
|
|
129
|
-
{title}
|
|
130
|
-
</div>
|
|
131
|
-
<Spacer flex={true} />
|
|
132
|
-
{#if $$slots['header-extra']}
|
|
133
|
-
<slot name="header-extra" />
|
|
134
|
-
{/if}
|
|
135
|
-
{#if showClose}
|
|
136
|
-
<Button
|
|
137
|
-
class="ternary iconic"
|
|
138
|
-
on:click={() => {
|
|
139
|
-
dialog.returnValue = 'close';
|
|
140
|
-
open = false;
|
|
141
|
-
}}
|
|
142
|
-
>
|
|
143
|
-
<Icon slot="start-icon" name="close" label={$_('sui._.close')} />
|
|
144
|
-
</Button>
|
|
145
|
-
{/if}
|
|
146
|
-
{/if}
|
|
147
|
-
</div>
|
|
148
|
-
{/if}
|
|
149
|
-
<div class="main">
|
|
150
|
-
<slot />
|
|
151
|
-
</div>
|
|
152
|
-
{#if showOk || showCancel || $$slots.footer || $$slots['footer-extra']}
|
|
153
|
-
<div class="footer">
|
|
154
|
-
{#if $$slots.footer}
|
|
155
|
-
<slot name="footer" />
|
|
156
|
-
{:else}
|
|
157
|
-
{#if $$slots['footer-extra']}
|
|
158
|
-
<slot name="footer-extra" />
|
|
159
|
-
{/if}
|
|
160
|
-
<Spacer flex={true} />
|
|
161
|
-
{#if showOk}
|
|
162
|
-
<Button
|
|
163
|
-
class="primary"
|
|
164
|
-
label={okLabel || $_('sui._.ok')}
|
|
165
|
-
disabled={okDisabled}
|
|
166
|
-
on:click={() => {
|
|
167
|
-
dialog.returnValue = 'ok';
|
|
168
|
-
open = false;
|
|
169
|
-
}}
|
|
170
|
-
/>
|
|
171
|
-
{/if}
|
|
172
|
-
{#if showCancel}
|
|
173
|
-
<Button
|
|
174
|
-
class="secondary"
|
|
175
|
-
label={cancelLabel || $_('sui._.cancel')}
|
|
176
|
-
disabled={cancelDisabled}
|
|
177
|
-
on:click={() => {
|
|
178
|
-
dialog.returnValue = 'cancel';
|
|
179
|
-
open = false;
|
|
180
|
-
}}
|
|
181
|
-
/>
|
|
182
|
-
{/if}
|
|
183
|
-
{/if}
|
|
184
|
-
</div>
|
|
185
|
-
{/if}
|
|
186
|
-
{/if}
|
|
187
|
-
</form>
|
|
188
|
-
</dialog>
|
|
189
|
-
|
|
190
|
-
<style>dialog {
|
|
191
|
-
display: flex;
|
|
192
|
-
justify-content: center;
|
|
193
|
-
align-items: center;
|
|
194
|
-
background-color: var(--popup-backdrop-color);
|
|
195
|
-
}
|
|
196
|
-
dialog.open form {
|
|
197
|
-
opacity: 1;
|
|
198
|
-
transform: scale(100%);
|
|
199
|
-
transition-duration: 100ms;
|
|
200
|
-
}
|
|
201
|
-
dialog:not(.open) {
|
|
202
|
-
pointer-events: none !important;
|
|
203
|
-
}
|
|
204
|
-
dialog:not(.open) form {
|
|
205
|
-
opacity: 0;
|
|
206
|
-
transform: scale(90%);
|
|
207
|
-
pointer-events: none;
|
|
208
|
-
transition-duration: 200ms;
|
|
209
|
-
}
|
|
210
|
-
dialog:not(.open) :global(*) {
|
|
211
|
-
pointer-events: none !important;
|
|
212
|
-
}
|
|
213
|
-
dialog :global(a),
|
|
214
|
-
dialog :global(input),
|
|
215
|
-
dialog :global(textarea),
|
|
216
|
-
dialog :global(button),
|
|
217
|
-
dialog :global([tabindex="0"]) {
|
|
218
|
-
pointer-events: all;
|
|
219
|
-
}
|
|
220
|
-
dialog form {
|
|
221
|
-
display: flex;
|
|
222
|
-
flex-direction: column;
|
|
223
|
-
border-radius: 4px;
|
|
224
|
-
background-color: var(--secondary-background-color-translucent);
|
|
225
|
-
backdrop-filter: blur(16px);
|
|
226
|
-
box-shadow: 0 8px 16px var(--popup-shadow-color);
|
|
227
|
-
will-change: opacity, transform;
|
|
228
|
-
transition-property: opacity, transform;
|
|
229
|
-
}
|
|
230
|
-
dialog.small form {
|
|
231
|
-
width: 400px;
|
|
232
|
-
max-height: 400px;
|
|
233
|
-
}
|
|
234
|
-
dialog.medium form {
|
|
235
|
-
width: 600px;
|
|
236
|
-
max-height: 600px;
|
|
237
|
-
}
|
|
238
|
-
dialog.large form {
|
|
239
|
-
width: 800px;
|
|
240
|
-
max-height: 800px;
|
|
241
|
-
}
|
|
242
|
-
dialog.x-large form {
|
|
243
|
-
width: 1000px;
|
|
244
|
-
max-height: 1000px;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.header,
|
|
248
|
-
.footer {
|
|
249
|
-
display: flex;
|
|
250
|
-
align-items: center;
|
|
251
|
-
gap: 8px;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.header {
|
|
255
|
-
box-sizing: content-box;
|
|
256
|
-
margin: 0 16px;
|
|
257
|
-
border-width: 0 0 1px;
|
|
258
|
-
border-color: var(--secondary-border-color);
|
|
259
|
-
padding: 16px 8px;
|
|
260
|
-
height: 32px;
|
|
261
|
-
}
|
|
262
|
-
.header .title {
|
|
263
|
-
font-size: 16px;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.footer {
|
|
267
|
-
margin: 0 24px 24px;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.main {
|
|
271
|
-
overflow: auto;
|
|
272
|
-
margin: 24px 24px;
|
|
273
|
-
white-space: normal;
|
|
274
|
-
}</style>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} DialogProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} DialogEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} DialogSlots */
|
|
4
|
-
/**
|
|
5
|
-
* @see https://w3c.github.io/aria/#dialog
|
|
6
|
-
* @see https://w3c.github.io/aria-practices/#dialog_modal
|
|
7
|
-
*/
|
|
8
|
-
export default class Dialog {
|
|
9
|
-
}
|
|
10
|
-
export type DialogProps = typeof __propDef.props;
|
|
11
|
-
export type DialogEvents = typeof __propDef.events;
|
|
12
|
-
export type DialogSlots = typeof __propDef.slots;
|
|
13
|
-
declare const __propDef: {
|
|
14
|
-
props: {
|
|
15
|
-
title?: string;
|
|
16
|
-
open?: boolean;
|
|
17
|
-
class?: string;
|
|
18
|
-
size?: ('small' | 'medium' | 'large');
|
|
19
|
-
modal?: boolean;
|
|
20
|
-
showCancel?: boolean;
|
|
21
|
-
showOk?: boolean;
|
|
22
|
-
showClose?: boolean;
|
|
23
|
-
okLabel?: string;
|
|
24
|
-
okDisabled?: boolean;
|
|
25
|
-
cancelLabel?: string;
|
|
26
|
-
cancelDisabled?: boolean;
|
|
27
|
-
closeOnBackdropClick?: boolean;
|
|
28
|
-
};
|
|
29
|
-
events: {
|
|
30
|
-
submit: SubmitEvent;
|
|
31
|
-
ok: CustomEvent<any>;
|
|
32
|
-
cancel: CustomEvent<any>;
|
|
33
|
-
close: CustomEvent<any>;
|
|
34
|
-
} & {
|
|
35
|
-
[evt: string]: CustomEvent<any>;
|
|
36
|
-
};
|
|
37
|
-
slots: {
|
|
38
|
-
header: {};
|
|
39
|
-
'header-extra': {};
|
|
40
|
-
default: {};
|
|
41
|
-
footer: {};
|
|
42
|
-
'footer-extra': {};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
/**
|
|
3
|
-
* CSS class name on the button.
|
|
4
|
-
* @type {String}
|
|
5
|
-
*/
|
|
6
|
-
// eslint-disable-next-line padding-line-between-statements
|
|
7
|
-
let className = '';
|
|
8
|
-
|
|
9
|
-
export { className as class };
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<div role="gridcell" class="sui grid-cell {className}" {...$$restProps}>
|
|
13
|
-
<slot />
|
|
14
|
-
</div>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} GridCellProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} GridCellEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} GridCellSlots */
|
|
4
|
-
export default class GridCell {
|
|
5
|
-
}
|
|
6
|
-
export type GridCellProps = typeof __propDef.props;
|
|
7
|
-
export type GridCellEvents = typeof __propDef.events;
|
|
8
|
-
export type GridCellSlots = typeof __propDef.slots;
|
|
9
|
-
declare const __propDef: {
|
|
10
|
-
props: {
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
class?: string;
|
|
13
|
-
};
|
|
14
|
-
events: {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {
|
|
18
|
-
default: {};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { getRandomId } from '../helpers/util';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* CSS class name on the button.
|
|
6
|
-
* @type {String}
|
|
7
|
-
*/
|
|
8
|
-
let className = '';
|
|
9
|
-
|
|
10
|
-
export { className as class };
|
|
11
|
-
|
|
12
|
-
export let title = '';
|
|
13
|
-
|
|
14
|
-
export let ariaLabel = '';
|
|
15
|
-
|
|
16
|
-
const id = getRandomId('group');
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<div
|
|
20
|
-
class="sui group {className}"
|
|
21
|
-
role="group"
|
|
22
|
-
{id}
|
|
23
|
-
aria-label={ariaLabel || undefined}
|
|
24
|
-
aria-labelledby={title ? '{id}-title' : undefined}
|
|
25
|
-
{...$$restProps}
|
|
26
|
-
>
|
|
27
|
-
{#if title}
|
|
28
|
-
<div class="title" id="{id}-title">{title}</div>
|
|
29
|
-
{/if}
|
|
30
|
-
<slot />
|
|
31
|
-
</div>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} GroupProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} GroupEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} GroupSlots */
|
|
4
|
-
export default class Group {
|
|
5
|
-
}
|
|
6
|
-
export type GroupProps = typeof __propDef.props;
|
|
7
|
-
export type GroupEvents = typeof __propDef.events;
|
|
8
|
-
export type GroupSlots = typeof __propDef.slots;
|
|
9
|
-
declare const __propDef: {
|
|
10
|
-
props: {
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
title?: string;
|
|
13
|
-
class?: string;
|
|
14
|
-
ariaLabel?: string;
|
|
15
|
-
};
|
|
16
|
-
events: {
|
|
17
|
-
[evt: string]: CustomEvent<any>;
|
|
18
|
-
};
|
|
19
|
-
slots: {
|
|
20
|
-
default: {};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
/**
|
|
3
|
-
* CSS class name on the button.
|
|
4
|
-
* @type {String}
|
|
5
|
-
*/
|
|
6
|
-
let className = '';
|
|
7
|
-
|
|
8
|
-
export { className as class };
|
|
9
|
-
|
|
10
|
-
export let name = '';
|
|
11
|
-
|
|
12
|
-
export let label = '';
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<span
|
|
16
|
-
class="sui icon material-symbols-outlined {className}"
|
|
17
|
-
aria-label={label || undefined}
|
|
18
|
-
aria-hidden={label ? undefined : true}
|
|
19
|
-
>
|
|
20
|
-
{name}
|
|
21
|
-
</span>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} IconProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} IconEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} IconSlots */
|
|
4
|
-
export default class Icon {
|
|
5
|
-
}
|
|
6
|
-
export type IconProps = typeof __propDef.props;
|
|
7
|
-
export type IconEvents = typeof __propDef.events;
|
|
8
|
-
export type IconSlots = typeof __propDef.slots;
|
|
9
|
-
declare const __propDef: {
|
|
10
|
-
props: {
|
|
11
|
-
label?: string;
|
|
12
|
-
class?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
};
|
|
15
|
-
events: {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {};
|
|
19
|
-
};
|
|
20
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria-practices/#menubutton
|
|
4
|
-
-->
|
|
5
|
-
<script>
|
|
6
|
-
import Popup from '../util/popup.svelte';
|
|
7
|
-
import Button from './button.svelte';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* CSS class name on the button.
|
|
11
|
-
* @type {String}
|
|
12
|
-
*/
|
|
13
|
-
let className = '';
|
|
14
|
-
|
|
15
|
-
export { className as class };
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Where to show the dropdown menu.
|
|
19
|
-
* @type {PopupPosition}
|
|
20
|
-
*/
|
|
21
|
-
export let popupPosition = 'bottom-left';
|
|
22
|
-
|
|
23
|
-
/** @type {?Button} */
|
|
24
|
-
let buttonComponent;
|
|
25
|
-
/** @type {?Popup} */
|
|
26
|
-
let popupComponent;
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<Button
|
|
30
|
-
class="sui menu-button {className}"
|
|
31
|
-
aria-haspopup="menu"
|
|
32
|
-
{...$$restProps}
|
|
33
|
-
bind:this={buttonComponent}
|
|
34
|
-
on:keydown={(event) => {
|
|
35
|
-
const { key, ctrlKey, metaKey, shiftKey, altKey } = event;
|
|
36
|
-
|
|
37
|
-
if (['ArrowUp', 'ArrowDown'].includes(key) && !ctrlKey && !metaKey && !shiftKey && !altKey) {
|
|
38
|
-
event.preventDefault();
|
|
39
|
-
|
|
40
|
-
const members = [
|
|
41
|
-
...popupComponent.dialog.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])'),
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
if (members.length) {
|
|
45
|
-
(key === 'ArrowUp' ? members.pop() : members.shift()).focus();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}}
|
|
49
|
-
>
|
|
50
|
-
<slot name="start-icon" slot="start-icon" />
|
|
51
|
-
<slot />
|
|
52
|
-
<slot name="end-icon" slot="end-icon" />
|
|
53
|
-
</Button>
|
|
54
|
-
|
|
55
|
-
<Popup anchor={buttonComponent?.element} position={popupPosition} bind:this={popupComponent}>
|
|
56
|
-
<slot name="popup" />
|
|
57
|
-
</Popup>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} MenuButtonProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} MenuButtonEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} MenuButtonSlots */
|
|
4
|
-
/** @see https://w3c.github.io/aria-practices/#menubutton */
|
|
5
|
-
export default class MenuButton {
|
|
6
|
-
}
|
|
7
|
-
export type MenuButtonProps = typeof __propDef.props;
|
|
8
|
-
export type MenuButtonEvents = typeof __propDef.events;
|
|
9
|
-
export type MenuButtonSlots = typeof __propDef.slots;
|
|
10
|
-
declare const __propDef: {
|
|
11
|
-
props: {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
class?: string;
|
|
14
|
-
popupPosition?: any;
|
|
15
|
-
};
|
|
16
|
-
events: {
|
|
17
|
-
[evt: string]: CustomEvent<any>;
|
|
18
|
-
};
|
|
19
|
-
slots: {
|
|
20
|
-
'start-icon': {
|
|
21
|
-
slot: string;
|
|
22
|
-
};
|
|
23
|
-
default: {};
|
|
24
|
-
'end-icon': {
|
|
25
|
-
slot: string;
|
|
26
|
-
};
|
|
27
|
-
popup: {};
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#menuitemcheckbox
|
|
4
|
-
-->
|
|
5
|
-
<script>
|
|
6
|
-
import MenuItem from './menu-item.svelte';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* CSS class name on the button.
|
|
10
|
-
* @type {String}
|
|
11
|
-
*/
|
|
12
|
-
let className = '';
|
|
13
|
-
|
|
14
|
-
export { className as class };
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<MenuItem
|
|
18
|
-
class="sui menu-item-checkbox {className}"
|
|
19
|
-
role="menuitemcheckbox"
|
|
20
|
-
{...$$restProps}
|
|
21
|
-
on:click
|
|
22
|
-
>
|
|
23
|
-
<slot />
|
|
24
|
-
</MenuItem>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} MenuItemCheckboxProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} MenuItemCheckboxEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} MenuItemCheckboxSlots */
|
|
4
|
-
/** @see https://w3c.github.io/aria/#menuitemcheckbox */
|
|
5
|
-
export default class MenuItemCheckbox {
|
|
6
|
-
}
|
|
7
|
-
export type MenuItemCheckboxProps = typeof __propDef.props;
|
|
8
|
-
export type MenuItemCheckboxEvents = typeof __propDef.events;
|
|
9
|
-
export type MenuItemCheckboxSlots = typeof __propDef.slots;
|
|
10
|
-
declare const __propDef: {
|
|
11
|
-
props: {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
class?: string;
|
|
14
|
-
};
|
|
15
|
-
events: {
|
|
16
|
-
click: any;
|
|
17
|
-
} & {
|
|
18
|
-
[evt: string]: CustomEvent<any>;
|
|
19
|
-
};
|
|
20
|
-
slots: {
|
|
21
|
-
default: {};
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#menuitemradio
|
|
4
|
-
-->
|
|
5
|
-
<script>
|
|
6
|
-
import MenuItem from './menu-item.svelte';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* CSS class name on the button.
|
|
10
|
-
* @type {String}
|
|
11
|
-
*/
|
|
12
|
-
let className = '';
|
|
13
|
-
|
|
14
|
-
export { className as class };
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<MenuItem class="sui menu-item-radio {className}" role="menuitemradio" {...$$restProps} on:click>
|
|
18
|
-
<slot />
|
|
19
|
-
</MenuItem>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} MenuItemRadioProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} MenuItemRadioEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} MenuItemRadioSlots */
|
|
4
|
-
/** @see https://w3c.github.io/aria/#menuitemradio */
|
|
5
|
-
export default class MenuItemRadio {
|
|
6
|
-
}
|
|
7
|
-
export type MenuItemRadioProps = typeof __propDef.props;
|
|
8
|
-
export type MenuItemRadioEvents = typeof __propDef.events;
|
|
9
|
-
export type MenuItemRadioSlots = typeof __propDef.slots;
|
|
10
|
-
declare const __propDef: {
|
|
11
|
-
props: {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
class?: string;
|
|
14
|
-
};
|
|
15
|
-
events: {
|
|
16
|
-
click: any;
|
|
17
|
-
} & {
|
|
18
|
-
[evt: string]: CustomEvent<any>;
|
|
19
|
-
};
|
|
20
|
-
slots: {
|
|
21
|
-
default: {};
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export {};
|