@sveltia/ui 0.10.4 → 0.10.6
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/LICENSE.txt +1 -1
- package/package/components/button/button.svelte +6 -6
- package/package/components/dialog/dialog.svelte +10 -8
- package/package/components/dialog/dialog.svelte.d.ts +6 -0
- package/package/components/drawer/drawer.svelte +34 -24
- package/package/components/drawer/drawer.svelte.d.ts +6 -0
- package/package/components/select/combobox.svelte +8 -2
- package/package/components/text-field/search-bar.svelte +1 -1
- package/package/components/util/app-shell.svelte +1 -1
- package/package/components/util/modal.svelte +7 -8
- package/package/components/util/modal.svelte.d.ts +2 -2
- package/package/components/util/popup.svelte +1 -0
- package/package/components/util/popup.svelte.d.ts +6 -0
- package/package/services/group.js +20 -9
- package/package/styles/variables.scss +1 -1
- package/package.json +18 -18
package/LICENSE.txt
CHANGED
|
@@ -231,11 +231,11 @@ button:global(.primary) {
|
|
|
231
231
|
font-weight: var(--sui-button-primary-font-weight, normal);
|
|
232
232
|
}
|
|
233
233
|
button:global(.primary):hover, button:global(.primary):focus-visible, button:global(.primary)[aria-expanded=true] {
|
|
234
|
-
color: var(--sui-button-primary-foreground-color-focus);
|
|
234
|
+
color: var(--sui-button-primary-foreground-color-focus, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));
|
|
235
235
|
background-color: var(--sui-button-primary-background-color-focus, var(--sui-primary-accent-color-light));
|
|
236
236
|
}
|
|
237
237
|
button:global(.primary):active {
|
|
238
|
-
color: var(--sui-button-primary-foreground-color-active);
|
|
238
|
+
color: var(--sui-button-primary-foreground-color-active, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));
|
|
239
239
|
background-color: var(--sui-button-primary-background-color-active, var(--sui-primary-accent-color-dark));
|
|
240
240
|
}
|
|
241
241
|
button:global(.secondary) {
|
|
@@ -247,11 +247,11 @@ button:global(.secondary) {
|
|
|
247
247
|
font-weight: var(--sui-button-secondary-font-weight, normal);
|
|
248
248
|
}
|
|
249
249
|
button:global(.secondary):hover, button:global(.secondary):focus-visible, button:global(.secondary)[aria-expanded=true] {
|
|
250
|
-
color: var(--sui-button-secondary-foreground-color-focus);
|
|
250
|
+
color: var(--sui-button-secondary-foreground-color-focus, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));
|
|
251
251
|
background-color: var(--sui-button-secondary-background-color-focus, var(--sui-hover-background-color));
|
|
252
252
|
}
|
|
253
253
|
button:global(.secondary):active {
|
|
254
|
-
color: var(--sui-button-secondary-foreground-color-active);
|
|
254
|
+
color: var(--sui-button-secondary-foreground-color-active, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));
|
|
255
255
|
background-color: var(--sui-button-secondary-background-color-active, var(--sui-active-background-color));
|
|
256
256
|
}
|
|
257
257
|
button:global(.secondary)[aria-pressed=true] {
|
|
@@ -267,11 +267,11 @@ button:global(.tertiary) {
|
|
|
267
267
|
font-weight: var(--sui-button-tertiary-font-weight, normal);
|
|
268
268
|
}
|
|
269
269
|
button:global(.tertiary):hover, button:global(.tertiary):focus-visible, button:global(.tertiary)[aria-expanded=true] {
|
|
270
|
-
color: var(--sui-button-tertiary-foreground-color-focus);
|
|
270
|
+
color: var(--sui-button-tertiary-foreground-color-focus, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));
|
|
271
271
|
background-color: var(--sui-button-tertiary-background-color-focus, var(--sui-hover-background-color));
|
|
272
272
|
}
|
|
273
273
|
button:global(.tertiary):active {
|
|
274
|
-
color: var(--sui-button-tertiary-foreground-color-active);
|
|
274
|
+
color: var(--sui-button-tertiary-foreground-color-active, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));
|
|
275
275
|
background-color: var(--sui-button-tertiary-background-color-active, var(--sui-active-background-color));
|
|
276
276
|
}
|
|
277
277
|
button:global(.tertiary)[aria-pressed=true] {
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
on:closing
|
|
111
111
|
on:close
|
|
112
112
|
>
|
|
113
|
+
<slot name="extra-content" slot="extra-content" />
|
|
113
114
|
<div role="none" class="content {className} {size}">
|
|
114
115
|
{#if title || showClose || $$slots.header || $$slots['header-extra']}
|
|
115
116
|
<div role="none" class="header">
|
|
@@ -183,6 +184,7 @@
|
|
|
183
184
|
position: relative;
|
|
184
185
|
display: flex;
|
|
185
186
|
flex-direction: column;
|
|
187
|
+
overflow: hidden;
|
|
186
188
|
border-radius: var(--sui-dialog-content-border-radius, 4px);
|
|
187
189
|
max-width: calc(100dvw - var(--sui-dialog-content-margin, 16px) * 2);
|
|
188
190
|
background-color: var(--sui-dialog-content-background-color, var(--sui-secondary-background-color-translucent));
|
|
@@ -200,8 +202,8 @@
|
|
|
200
202
|
transform: scale(90%);
|
|
201
203
|
}
|
|
202
204
|
.content.small {
|
|
203
|
-
width: var(--sui-dialog-small-content-width, 400px);
|
|
204
|
-
max-height: var(--sui-dialog-small-content-max-height, 400px);
|
|
205
|
+
width: var(--sui-dialog-small-content-width, var(--sui-dialog-content-width, 400px));
|
|
206
|
+
max-height: var(--sui-dialog-small-content-max-height, var(--sui-dialog-content-max-height, 400px));
|
|
205
207
|
}
|
|
206
208
|
@media (max-height: 400px) {
|
|
207
209
|
.content.small {
|
|
@@ -209,8 +211,8 @@
|
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
213
|
.content.medium {
|
|
212
|
-
width: var(--sui-dialog-medium-content-width, 600px);
|
|
213
|
-
max-height: var(--sui-dialog-medium-content-max-height, 600px);
|
|
214
|
+
width: var(--sui-dialog-medium-content-width, var(--sui-dialog-content-width, 600px));
|
|
215
|
+
max-height: var(--sui-dialog-medium-content-max-height, var(--sui-dialog-content-max-height, 600px));
|
|
214
216
|
}
|
|
215
217
|
@media (max-height: 600px) {
|
|
216
218
|
.content.medium {
|
|
@@ -218,8 +220,8 @@
|
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
222
|
.content.large {
|
|
221
|
-
width: var(--sui-dialog-large-content-width, 800px);
|
|
222
|
-
max-height: var(--sui-dialog-large-content-max-height, 800px);
|
|
223
|
+
width: var(--sui-dialog-large-content-width, var(--sui-dialog-content-width, 800px));
|
|
224
|
+
max-height: var(--sui-dialog-large-content-max-height, var(--sui-dialog-content-max-height, 800px));
|
|
223
225
|
}
|
|
224
226
|
@media (max-height: 800px) {
|
|
225
227
|
.content.large {
|
|
@@ -227,8 +229,8 @@
|
|
|
227
229
|
}
|
|
228
230
|
}
|
|
229
231
|
.content.x-large {
|
|
230
|
-
width: var(--sui-dialog-x-large-content-width, 1000px);
|
|
231
|
-
max-height: var(--sui-dialog-x-large-content-max-height, 1000px);
|
|
232
|
+
width: var(--sui-dialog-x-large-content-width, var(--sui-dialog-content-width, 1000px));
|
|
233
|
+
max-height: var(--sui-dialog-x-large-content-max-height, var(--sui-dialog-content-max-height, 1000px));
|
|
232
234
|
}
|
|
233
235
|
@media (max-height: 1000px) {
|
|
234
236
|
.content.x-large {
|
|
@@ -31,6 +31,9 @@ export default class Dialog extends SvelteComponent<{
|
|
|
31
31
|
} & {
|
|
32
32
|
[evt: string]: CustomEvent<any>;
|
|
33
33
|
}, {
|
|
34
|
+
'extra-content': {
|
|
35
|
+
slot: string;
|
|
36
|
+
};
|
|
34
37
|
header: {};
|
|
35
38
|
'header-extra': {};
|
|
36
39
|
'close-icon': {
|
|
@@ -73,6 +76,9 @@ declare const __propDef: {
|
|
|
73
76
|
[evt: string]: CustomEvent<any>;
|
|
74
77
|
};
|
|
75
78
|
slots: {
|
|
79
|
+
'extra-content': {
|
|
80
|
+
slot: string;
|
|
81
|
+
};
|
|
76
82
|
header: {};
|
|
77
83
|
'header-extra': {};
|
|
78
84
|
'close-icon': {
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
on:closing
|
|
85
85
|
on:close
|
|
86
86
|
>
|
|
87
|
+
<slot name="extra-content" slot="extra-content" />
|
|
87
88
|
<div role="none" class="content {className} {size} {position} {orientation}">
|
|
88
89
|
<div role="none" class="extra-control">
|
|
89
90
|
{#if showClose === 'outside'}
|
|
@@ -149,6 +150,7 @@
|
|
|
149
150
|
position: absolute;
|
|
150
151
|
display: flex;
|
|
151
152
|
flex-direction: column;
|
|
153
|
+
overflow: hidden;
|
|
152
154
|
max-width: 100dvw;
|
|
153
155
|
max-height: 100dvh;
|
|
154
156
|
background-color: var(--sui-secondary-background-color-translucent);
|
|
@@ -171,11 +173,11 @@
|
|
|
171
173
|
transition-duration: 300ms;
|
|
172
174
|
}
|
|
173
175
|
.content.right {
|
|
174
|
-
inset: 0 0 0 auto;
|
|
176
|
+
inset: var(--sui-drawer-right-content-inset, 0 0 0 auto);
|
|
175
177
|
border-radius: var(--sui-drawer-right-content-border-radius, var(--sui-drawer-content-border-radius, 4px 0 0 4px));
|
|
176
178
|
}
|
|
177
179
|
.content.right.full {
|
|
178
|
-
border-radius: var(--sui-drawer-right-full-content-border-radius, 0);
|
|
180
|
+
border-radius: var(--sui-drawer-right-full-content-border-radius, var(--sui-drawer-right-content-border-radius, 0));
|
|
179
181
|
}
|
|
180
182
|
.content.right .extra-control {
|
|
181
183
|
inset: 0 100% auto auto;
|
|
@@ -184,11 +186,11 @@
|
|
|
184
186
|
transform: translateX(105%);
|
|
185
187
|
}
|
|
186
188
|
.content.left {
|
|
187
|
-
inset: 0 auto 0 0;
|
|
189
|
+
inset: var(--sui-drawer-left-content-inset, 0 auto 0 0);
|
|
188
190
|
border-radius: var(--sui-drawer-left-content-border-radius, var(--sui-drawer-content-border-radius, 0 4px 4px 0));
|
|
189
191
|
}
|
|
190
192
|
.content.left.full {
|
|
191
|
-
border-radius: var(--sui-drawer-left-full-content-border-radius, 0);
|
|
193
|
+
border-radius: var(--sui-drawer-left-full-content-border-radius, var(--sui-drawer-left-content-border-radius, 0));
|
|
192
194
|
}
|
|
193
195
|
.content.left .extra-control {
|
|
194
196
|
inset: 0 auto auto 100%;
|
|
@@ -196,24 +198,28 @@
|
|
|
196
198
|
:global(dialog:not(.open)) .content.left {
|
|
197
199
|
transform: translateX(-105%);
|
|
198
200
|
}
|
|
199
|
-
.content.vertical {
|
|
200
|
-
max-width: var(--sui-drawer-vertical-max-width, calc(100dvw - 56px));
|
|
201
|
-
height: var(--sui-drawer-vertical-height, 100dvh);
|
|
202
|
-
}
|
|
203
201
|
:global(dialog.open) .content.vertical {
|
|
204
202
|
transform: translateX(0%);
|
|
205
203
|
}
|
|
206
204
|
.content.vertical.small {
|
|
207
|
-
width: var(--sui-drawer-vertical-small-width, 400px);
|
|
205
|
+
width: var(--sui-drawer-vertical-small-width, var(--sui-drawer-vertical-width, 400px));
|
|
206
|
+
max-width: var(--sui-drawer-vertical-small-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));
|
|
207
|
+
height: var(--sui-drawer-vertical-small-height, var(--sui-drawer-vertical-height, 100dvh));
|
|
208
208
|
}
|
|
209
209
|
.content.vertical.medium {
|
|
210
|
-
width: var(--sui-drawer-vertical-medium-width, 600px);
|
|
210
|
+
width: var(--sui-drawer-vertical-medium-width, var(--sui-drawer-vertical-width, 600px));
|
|
211
|
+
max-width: var(--sui-drawer-vertical-medium-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));
|
|
212
|
+
height: var(--sui-drawer-vertical-medium-height, var(--sui-drawer-vertical-height, 100dvh));
|
|
211
213
|
}
|
|
212
214
|
.content.vertical.large {
|
|
213
|
-
width: var(--sui-drawer-vertical-large-width, 800px);
|
|
215
|
+
width: var(--sui-drawer-vertical-large-width, var(--sui-drawer-vertical-width, 800px));
|
|
216
|
+
max-width: var(--sui-drawer-vertical-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));
|
|
217
|
+
height: var(--sui-drawer-vertical-large-height, var(--sui-drawer-vertical-height, 100dvh));
|
|
214
218
|
}
|
|
215
219
|
.content.vertical.x-large {
|
|
216
|
-
width: var(--sui-drawer-vertical-x-large-width, 1000px);
|
|
220
|
+
width: var(--sui-drawer-vertical-x-large-width, var(--sui-drawer-vertical-width, 1000px));
|
|
221
|
+
max-width: var(--sui-drawer-vertical-x-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));
|
|
222
|
+
height: var(--sui-drawer-vertical-x-large-height, var(--sui-drawer-vertical-height, 100dvh));
|
|
217
223
|
}
|
|
218
224
|
.content.vertical.full {
|
|
219
225
|
width: 100dvw;
|
|
@@ -221,11 +227,11 @@
|
|
|
221
227
|
height: 100dvh;
|
|
222
228
|
}
|
|
223
229
|
.content.top {
|
|
224
|
-
inset: 0 0 auto 0;
|
|
230
|
+
inset: var(--sui-drawer-top-content-inset, 0 0 auto 0);
|
|
225
231
|
border-radius: var(--sui-drawer-top-content-border-radius, var(--sui-drawer-content-border-radius, 0 0 4px 4px));
|
|
226
232
|
}
|
|
227
233
|
.content.top.full {
|
|
228
|
-
border-radius: var(--sui-drawer-top-full-content-border-radius, 0);
|
|
234
|
+
border-radius: var(--sui-drawer-top-full-content-border-radius, var(--sui-drawer-top-content-border-radius, 0));
|
|
229
235
|
}
|
|
230
236
|
.content.top .extra-control {
|
|
231
237
|
inset: 100% 0 auto auto;
|
|
@@ -234,11 +240,11 @@
|
|
|
234
240
|
transform: translateY(-105%);
|
|
235
241
|
}
|
|
236
242
|
.content.bottom {
|
|
237
|
-
inset: auto 0 0 0;
|
|
243
|
+
inset: var(--sui-drawer-bottom-content-inset, auto 0 0 0);
|
|
238
244
|
border-radius: var(--sui-drawer-bottom-content-border-radius, var(--sui-drawer-content-border-radius, 4px 4px 0 0));
|
|
239
245
|
}
|
|
240
246
|
.content.bottom.full {
|
|
241
|
-
border-radius: var(--sui-drawer-bottom-full-content-border-radius, 0);
|
|
247
|
+
border-radius: var(--sui-drawer-bottom-full-content-border-radius, var(--sui-drawer-bottom-content-border-radius, 0));
|
|
242
248
|
}
|
|
243
249
|
.content.bottom .extra-control {
|
|
244
250
|
inset: auto 0 100% auto;
|
|
@@ -246,24 +252,28 @@
|
|
|
246
252
|
:global(dialog:not(.open)) .content.bottom {
|
|
247
253
|
transform: translateY(105%);
|
|
248
254
|
}
|
|
249
|
-
.content.horizontal {
|
|
250
|
-
width: var(--sui-drawer-horizontal-width, 100dvw);
|
|
251
|
-
max-height: var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px));
|
|
252
|
-
}
|
|
253
255
|
:global(dialog.open) .content.horizontal {
|
|
254
256
|
transform: translateY(0%);
|
|
255
257
|
}
|
|
256
258
|
.content.horizontal.small {
|
|
257
|
-
|
|
259
|
+
width: var(--sui-drawer-horizontal-small-width, var(--sui-drawer-horizontal-width, 100dvw));
|
|
260
|
+
height: var(--sui-drawer-horizontal-small-height, var(--sui-drawer-horizontal-height, 400px));
|
|
261
|
+
max-height: var(--sui-drawer-horizontal-small-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));
|
|
258
262
|
}
|
|
259
263
|
.content.horizontal.medium {
|
|
260
|
-
|
|
264
|
+
width: var(--sui-drawer-horizontal-medium-width, var(--sui-drawer-horizontal-width, 100dvw));
|
|
265
|
+
height: var(--sui-drawer-horizontal-medium-height, var(--sui-drawer-horizontal-height, 600px));
|
|
266
|
+
max-height: var(--sui-drawer-horizontal-medium-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));
|
|
261
267
|
}
|
|
262
268
|
.content.horizontal.large {
|
|
263
|
-
|
|
269
|
+
width: var(--sui-drawer-horizontal-large-width, var(--sui-drawer-horizontal-width, 100dvw));
|
|
270
|
+
height: var(--sui-drawer-horizontal-large-height, var(--sui-drawer-horizontal-height, 800px));
|
|
271
|
+
max-height: var(--sui-drawer-horizontal-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));
|
|
264
272
|
}
|
|
265
273
|
.content.horizontal.x-large {
|
|
266
|
-
|
|
274
|
+
width: var(--sui-drawer-horizontal-x-large-width, var(--sui-drawer-horizontal-width, 100dvw));
|
|
275
|
+
height: var(--sui-drawer-horizontal-x-large-height, var(--sui-drawer-horizontal-height, 1000px));
|
|
276
|
+
max-height: var(--sui-drawer-horizontal-x-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));
|
|
267
277
|
}
|
|
268
278
|
.content.horizontal.full {
|
|
269
279
|
width: 100dvw;
|
|
@@ -26,6 +26,9 @@ export default class Drawer extends SvelteComponent<{
|
|
|
26
26
|
} & {
|
|
27
27
|
[evt: string]: CustomEvent<any>;
|
|
28
28
|
}, {
|
|
29
|
+
'extra-content': {
|
|
30
|
+
slot: string;
|
|
31
|
+
};
|
|
29
32
|
'close-button': {
|
|
30
33
|
slot: string;
|
|
31
34
|
};
|
|
@@ -62,6 +65,9 @@ declare const __propDef: {
|
|
|
62
65
|
[evt: string]: CustomEvent<any>;
|
|
63
66
|
};
|
|
64
67
|
slots: {
|
|
68
|
+
'extra-content': {
|
|
69
|
+
slot: string;
|
|
70
|
+
};
|
|
65
71
|
'close-button': {
|
|
66
72
|
slot: string;
|
|
67
73
|
};
|
|
@@ -100,7 +100,13 @@
|
|
|
100
100
|
}
|
|
101
101
|
</script>
|
|
102
102
|
|
|
103
|
-
<div
|
|
103
|
+
<div
|
|
104
|
+
role="none"
|
|
105
|
+
class="sui combobox {className}"
|
|
106
|
+
class:editable
|
|
107
|
+
hidden={hidden || undefined}
|
|
108
|
+
{...$$restProps}
|
|
109
|
+
>
|
|
104
110
|
{#if !editable}
|
|
105
111
|
<div
|
|
106
112
|
role="combobox"
|
|
@@ -206,7 +212,7 @@
|
|
|
206
212
|
border-top-left-radius: 0;
|
|
207
213
|
border-bottom-left-radius: 0;
|
|
208
214
|
}
|
|
209
|
-
.combobox.
|
|
215
|
+
.combobox:not(.editable) > :global(button) {
|
|
210
216
|
background-color: transparent !important;
|
|
211
217
|
}
|
|
212
218
|
.combobox > :global(button[tabindex="-1"]) {
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
var(--sui-success-color-hue) var(--sui-alert-foreground-color-saturation)
|
|
113
113
|
var(--sui-alert-foreground-color-lightness)
|
|
114
114
|
);
|
|
115
|
-
--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) /
|
|
115
|
+
--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 35%);
|
|
116
116
|
--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl) / 75%);
|
|
117
117
|
--sui-active-background-color: hsl(var(--sui-background-color-5-hsl) / 100%);
|
|
118
118
|
--sui-content-background-color: hsl(var(--sui-background-color-1-hsl));
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
8
|
import { createEventDispatcher, onMount } from 'svelte';
|
|
9
|
+
import { sleep } from '../../services/util';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* The `class` attribute on the `<dialog>` element.
|
|
@@ -98,13 +99,11 @@
|
|
|
98
99
|
(document.querySelector('.sui.app-shell') ?? document.body).appendChild(dialog);
|
|
99
100
|
showContent = true;
|
|
100
101
|
dialog.showModal();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
setActiveClass = true;
|
|
107
|
-
});
|
|
102
|
+
dispatch('open');
|
|
103
|
+
await sleep(100);
|
|
104
|
+
setOpenClass = true;
|
|
105
|
+
await waitForTransition();
|
|
106
|
+
setActiveClass = true;
|
|
108
107
|
};
|
|
109
108
|
|
|
110
109
|
/**
|
|
@@ -186,7 +185,7 @@
|
|
|
186
185
|
}
|
|
187
186
|
}}
|
|
188
187
|
>
|
|
189
|
-
<slot name="
|
|
188
|
+
<slot name="extra-content" />
|
|
190
189
|
{#if showContent || keepContent}
|
|
191
190
|
<slot />
|
|
192
191
|
{/if}
|
|
@@ -21,7 +21,7 @@ export default class Modal extends SvelteComponent<{
|
|
|
21
21
|
} & {
|
|
22
22
|
[evt: string]: CustomEvent<any>;
|
|
23
23
|
}, {
|
|
24
|
-
'
|
|
24
|
+
'extra-content': {};
|
|
25
25
|
default: {};
|
|
26
26
|
}> {
|
|
27
27
|
get close(): (returnValue: string) => void;
|
|
@@ -76,7 +76,7 @@ declare const __propDef: {
|
|
|
76
76
|
[evt: string]: CustomEvent<any>;
|
|
77
77
|
};
|
|
78
78
|
slots: {
|
|
79
|
-
'
|
|
79
|
+
'extra-content': {};
|
|
80
80
|
default: {};
|
|
81
81
|
};
|
|
82
82
|
};
|
|
@@ -22,6 +22,9 @@ export default class Popup extends SvelteComponent<{
|
|
|
22
22
|
} & {
|
|
23
23
|
[evt: string]: CustomEvent<any>;
|
|
24
24
|
}, {
|
|
25
|
+
'extra-content': {
|
|
26
|
+
slot: string;
|
|
27
|
+
};
|
|
25
28
|
default: {};
|
|
26
29
|
}> {
|
|
27
30
|
/**accessor*/
|
|
@@ -76,6 +79,9 @@ declare const __propDef: {
|
|
|
76
79
|
[evt: string]: CustomEvent<any>;
|
|
77
80
|
};
|
|
78
81
|
slots: {
|
|
82
|
+
'extra-content': {
|
|
83
|
+
slot: string;
|
|
84
|
+
};
|
|
79
85
|
default: {};
|
|
80
86
|
};
|
|
81
87
|
};
|
|
@@ -61,7 +61,6 @@ class Group {
|
|
|
61
61
|
|
|
62
62
|
this.parent = parent;
|
|
63
63
|
this.role = /** @type {string} */ (parent.getAttribute('role'));
|
|
64
|
-
this.grid = this.role === 'listbox' && parent.matches('.grid');
|
|
65
64
|
this.multi = this.parent.getAttribute('aria-multiselectable') === 'true';
|
|
66
65
|
this.id = getRandomId(this.role);
|
|
67
66
|
this.parentGroupSelector = `[role="group"], [role="${this.role}"]`;
|
|
@@ -112,9 +111,7 @@ class Group {
|
|
|
112
111
|
});
|
|
113
112
|
|
|
114
113
|
parent.addEventListener('click', (event) => {
|
|
115
|
-
|
|
116
|
-
this.onClick(event);
|
|
117
|
-
}
|
|
114
|
+
this.onClick(event);
|
|
118
115
|
});
|
|
119
116
|
|
|
120
117
|
parent.addEventListener('keydown', (event) => {
|
|
@@ -176,6 +173,14 @@ class Group {
|
|
|
176
173
|
return this.parent.matches('[aria-readonly="true"]');
|
|
177
174
|
}
|
|
178
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Whether the widget is displayed in grid mode.
|
|
178
|
+
* @type {boolean}
|
|
179
|
+
*/
|
|
180
|
+
get grid() {
|
|
181
|
+
return this.role === 'grid' || (this.role === 'listbox' && this.parent.matches('.grid'));
|
|
182
|
+
}
|
|
183
|
+
|
|
179
184
|
/**
|
|
180
185
|
* Select (and move focus to) the given target.
|
|
181
186
|
* @param {(MouseEvent | KeyboardEvent)} event - Triggered event.
|
|
@@ -241,11 +246,14 @@ class Group {
|
|
|
241
246
|
}
|
|
242
247
|
|
|
243
248
|
if (this.focusChild) {
|
|
244
|
-
|
|
249
|
+
// Wait a bit before the element is rerendered
|
|
250
|
+
window.requestAnimationFrame(() => {
|
|
251
|
+
element.tabIndex = isTarget ? 0 : -1;
|
|
245
252
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
253
|
+
if (isTarget) {
|
|
254
|
+
element.focus();
|
|
255
|
+
}
|
|
256
|
+
});
|
|
249
257
|
} else {
|
|
250
258
|
element.classList.toggle('focused', isTarget);
|
|
251
259
|
}
|
|
@@ -299,7 +307,10 @@ class Group {
|
|
|
299
307
|
onClick(event) {
|
|
300
308
|
// eslint-disable-next-line prefer-destructuring
|
|
301
309
|
const target = /** @type {HTMLElement} */ (event.target);
|
|
302
|
-
|
|
310
|
+
|
|
311
|
+
const newTarget = target.matches(this.selector)
|
|
312
|
+
? target
|
|
313
|
+
: /** @type {HTMLElement | null} */ (target.closest(this.selector));
|
|
303
314
|
|
|
304
315
|
if (!newTarget || event.button !== 0) {
|
|
305
316
|
return;
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
var(--sui-alert-foreground-color-lightness)
|
|
98
98
|
);
|
|
99
99
|
// Background
|
|
100
|
-
--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) /
|
|
100
|
+
--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 35%);
|
|
101
101
|
--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl) / 75%);
|
|
102
102
|
--sui-active-background-color: hsl(var(--sui-background-color-5-hsl) / 100%);
|
|
103
103
|
--sui-content-background-color: hsl(var(--sui-background-color-1-hsl));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -23,36 +23,36 @@
|
|
|
23
23
|
"test:unit": "vitest"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"svelte": "^4.2.
|
|
26
|
+
"svelte": "^4.2.12"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@playwright/test": "^1.
|
|
29
|
+
"@playwright/test": "^1.42.1",
|
|
30
30
|
"@sveltejs/adapter-auto": "^3.1.1",
|
|
31
|
-
"@sveltejs/kit": "^2.
|
|
32
|
-
"@sveltejs/package": "^2.
|
|
33
|
-
"@sveltejs/vite-plugin-svelte": "^3.0.
|
|
34
|
-
"cspell": "^8.
|
|
35
|
-
"eslint": "^8.
|
|
31
|
+
"@sveltejs/kit": "^2.5.3",
|
|
32
|
+
"@sveltejs/package": "^2.3.0",
|
|
33
|
+
"@sveltejs/vite-plugin-svelte": "^3.0.2",
|
|
34
|
+
"cspell": "^8.6.0",
|
|
35
|
+
"eslint": "^8.57.0",
|
|
36
36
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
37
37
|
"eslint-config-prettier": "^9.1.0",
|
|
38
38
|
"eslint-plugin-import": "^2.29.1",
|
|
39
|
-
"eslint-plugin-jsdoc": "^48.
|
|
39
|
+
"eslint-plugin-jsdoc": "^48.2.1",
|
|
40
40
|
"eslint-plugin-svelte": "^2.35.1",
|
|
41
41
|
"npm-run-all": "^4.1.5",
|
|
42
|
-
"postcss": "^8.4.
|
|
42
|
+
"postcss": "^8.4.35",
|
|
43
43
|
"postcss-html": "^1.6.0",
|
|
44
|
-
"prettier": "^3.2.
|
|
45
|
-
"prettier-plugin-svelte": "^3.
|
|
46
|
-
"sass": "^1.
|
|
47
|
-
"stylelint": "^16.2.
|
|
44
|
+
"prettier": "^3.2.5",
|
|
45
|
+
"prettier-plugin-svelte": "^3.2.2",
|
|
46
|
+
"sass": "^1.71.1",
|
|
47
|
+
"stylelint": "^16.2.1",
|
|
48
48
|
"stylelint-config-recommended-scss": "^14.0.0",
|
|
49
|
-
"stylelint-scss": "^6.
|
|
50
|
-
"svelte-check": "^3.6.
|
|
49
|
+
"stylelint-scss": "^6.2.1",
|
|
50
|
+
"svelte-check": "^3.6.6",
|
|
51
51
|
"svelte-i18n": "^4.0.0",
|
|
52
52
|
"svelte-preprocess": "^5.1.3",
|
|
53
53
|
"tslib": "^2.6.2",
|
|
54
|
-
"vite": "^5.
|
|
55
|
-
"vitest": "^1.
|
|
54
|
+
"vite": "^5.1.5",
|
|
55
|
+
"vitest": "^1.3.1"
|
|
56
56
|
},
|
|
57
57
|
"exports": {
|
|
58
58
|
"./package.json": "./package.json",
|