@iyulab/components 2.33.0 → 2.34.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/CHANGELOG.md +39 -0
- package/dist/components/auto-scroll/UAutoScroll.d.ts +14 -0
- package/dist/components/auto-scroll/UAutoScroll.js +25 -2
- package/dist/components/badge/UBadge.d.ts +2 -0
- package/dist/components/badge/UBadge.js +4 -2
- package/dist/components/badge/UBadge.styles.js +11 -2
- package/dist/components/breadcrumb-item/UBreadcrumbItem.d.ts +2 -0
- package/dist/components/breadcrumb-item/UBreadcrumbItem.js +6 -4
- package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.js +11 -2
- package/dist/components/button/UButton.d.ts +2 -0
- package/dist/components/button/UButton.js +4 -2
- package/dist/components/button/UButton.styles.js +11 -2
- package/dist/components/carousel/UCarousel.d.ts +23 -1
- package/dist/components/carousel/UCarousel.js +64 -5
- package/dist/components/dialog/UDialog.d.ts +3 -0
- package/dist/components/dialog/UDialog.js +8 -1
- package/dist/components/dialog/UDialog.styles.js +10 -3
- package/dist/components/drawer/UDrawer.d.ts +3 -0
- package/dist/components/drawer/UDrawer.js +8 -1
- package/dist/components/drawer/UDrawer.styles.js +10 -3
- package/dist/components/input/UInput.d.ts +2 -0
- package/dist/components/input/UInput.js +4 -2
- package/dist/components/input/UInput.styles.js +11 -2
- package/dist/components/menu-item/UMenuItem.d.ts +2 -0
- package/dist/components/menu-item/UMenuItem.js +4 -2
- package/dist/components/menu-item/UMenuItem.styles.js +11 -2
- package/dist/components/option/UOption.d.ts +2 -0
- package/dist/components/option/UOption.js +4 -2
- package/dist/components/option/UOption.styles.js +16 -2
- package/dist/components/radio/URadio.styles.js +5 -2
- package/dist/components/select/USelect.d.ts +21 -2
- package/dist/components/select/USelect.js +144 -41
- package/dist/components/select/USelect.styles.js +60 -22
- package/dist/components/tab/UTab.d.ts +2 -0
- package/dist/components/tab/UTab.js +4 -2
- package/dist/components/tab/UTab.styles.js +16 -2
- package/dist/components/tab-panel/UTabPanel.styles.js +14 -14
- package/dist/components/tree-item/UTreeItem.d.ts +2 -0
- package/dist/components/tree-item/UTreeItem.js +4 -2
- package/dist/components/tree-item/UTreeItem.styles.js +11 -2
- package/dist/utilities/slotPresence.d.ts +21 -0
- package/dist/utilities/slotPresence.js +41 -0
- package/dist/utilities/unattended.d.ts +5 -0
- package/dist/utilities/unattended.js +7 -0
- package/package.json +1 -1
- package/skills/iyulab-components/references/components/auto-scroll.md +5 -0
- package/skills/iyulab-components/references/components/carousel.md +19 -1
- package/skills/iyulab-components/references/components/dialog.md +1 -0
- package/skills/iyulab-components/references/components/drawer.md +1 -0
- package/skills/iyulab-components/references/components/select.md +16 -11
|
@@ -170,6 +170,52 @@ var styles = css`
|
|
|
170
170
|
inline-size: var(--_chars, auto);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
|
|
174
|
+
.value-area {
|
|
175
|
+
position: relative;
|
|
176
|
+
flex: 1;
|
|
177
|
+
min-width: 0;
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
flex-wrap: wrap;
|
|
181
|
+
gap: 4px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
input.search {
|
|
187
|
+
all: unset;
|
|
188
|
+
box-sizing: border-box;
|
|
189
|
+
min-width: 0;
|
|
190
|
+
line-height: 1.5;
|
|
191
|
+
min-block-size: 1.5em;
|
|
192
|
+
color: inherit;
|
|
193
|
+
cursor: inherit;
|
|
194
|
+
}
|
|
195
|
+
:host(:not([multiple])) input.search {
|
|
196
|
+
position: absolute;
|
|
197
|
+
inset: 0;
|
|
198
|
+
width: 100%;
|
|
199
|
+
}
|
|
200
|
+
:host([multiple]) input.search {
|
|
201
|
+
flex: 1 1 2ch;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
:host([multiple][searchable]) .chips-content {
|
|
206
|
+
flex: 0 1 auto;
|
|
207
|
+
}
|
|
208
|
+
.container.typing slot[name="display"] {
|
|
209
|
+
visibility: hidden;
|
|
210
|
+
}
|
|
211
|
+
:host([multiple]) .container.typing slot[name="display"] {
|
|
212
|
+
visibility: visible;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
:host([multiple]) .container.typing .placeholder {
|
|
216
|
+
display: none;
|
|
217
|
+
}
|
|
218
|
+
|
|
173
219
|
.chips-content {
|
|
174
220
|
flex: 1;
|
|
175
221
|
min-width: 0;
|
|
@@ -178,14 +224,26 @@ var styles = css`
|
|
|
178
224
|
gap: 4px;
|
|
179
225
|
}
|
|
180
226
|
|
|
181
|
-
|
|
227
|
+
|
|
228
|
+
.affix {
|
|
229
|
+
display: inline-flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
flex: none;
|
|
232
|
+
}
|
|
233
|
+
.affix[hidden] {
|
|
234
|
+
display: none;
|
|
235
|
+
}
|
|
236
|
+
.affix-prefix {
|
|
182
237
|
margin-right: 0.25em;
|
|
183
238
|
}
|
|
184
|
-
|
|
239
|
+
.affix-suffix {
|
|
185
240
|
margin-left: 0.25em;
|
|
186
241
|
}
|
|
187
242
|
|
|
188
243
|
.suffix-item {
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
position: relative;
|
|
189
247
|
margin-left: 0.25em;
|
|
190
248
|
font-size: 1em;
|
|
191
249
|
color: var(--u-icon-color, #616161);
|
|
@@ -237,26 +295,6 @@ var styles = css`
|
|
|
237
295
|
color: var(--u-txt-color-weak, #616161);
|
|
238
296
|
}
|
|
239
297
|
|
|
240
|
-
.search-input {
|
|
241
|
-
display: flex;
|
|
242
|
-
align-items: center;
|
|
243
|
-
gap: 0.4em;
|
|
244
|
-
padding: var(--u-field-padding-block, 0.3em) var(--u-field-padding-inline, 0.6em);
|
|
245
|
-
color: var(--u-txt-color-weak, #616161);
|
|
246
|
-
border-bottom: 1px solid var(--u-border-color, #E0E0E0);
|
|
247
|
-
}
|
|
248
|
-
.search-input input {
|
|
249
|
-
all: unset;
|
|
250
|
-
|
|
251
|
-
min-block-size: max(24px, var(--u-target-size, 0px));
|
|
252
|
-
flex: 1;
|
|
253
|
-
min-width: 0;
|
|
254
|
-
line-height: 1.5;
|
|
255
|
-
}
|
|
256
|
-
.search-input input::placeholder {
|
|
257
|
-
color: var(--u-txt-color-weak, #616161);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
298
|
|
|
261
299
|
:host {
|
|
262
300
|
font-size: var(--u-density, 14px);
|
|
@@ -21,6 +21,8 @@ export type TabCountAppearance = 'badge' | 'plain';
|
|
|
21
21
|
*/
|
|
22
22
|
export declare class UTab extends UElement {
|
|
23
23
|
static styles: import('lit').CSSResultGroup[];
|
|
24
|
+
/** 접두 · 접미 슬롯이 찼는가 — 그 옆 간격은 섀도 안 상자가 갖는다(`::slotted` 여백은 문서의 전역 리셋에 진다). */
|
|
25
|
+
private readonly affixes;
|
|
24
26
|
/** 탭 비활성화 여부 */
|
|
25
27
|
disabled: boolean;
|
|
26
28
|
/** 탭 닫기 가능 여부 */
|
|
@@ -2,6 +2,7 @@ import { Locale } from "../../utilities/Locale.js";
|
|
|
2
2
|
import { UElement } from "../UElement.js";
|
|
3
3
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";
|
|
4
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
5
|
+
import { SlotPresence } from "../../utilities/slotPresence.js";
|
|
5
6
|
import "../button/UButton.js";
|
|
6
7
|
import "../icon/UIcon.js";
|
|
7
8
|
import { formatNumber } from "../../utilities/format.js";
|
|
@@ -17,6 +18,7 @@ var UTab = class UTab extends UElement {
|
|
|
17
18
|
}
|
|
18
19
|
constructor(..._args) {
|
|
19
20
|
super(..._args);
|
|
21
|
+
this.affixes = new SlotPresence(this, ["prefix", "suffix"]);
|
|
20
22
|
this.disabled = false;
|
|
21
23
|
this.removable = false;
|
|
22
24
|
this.value = "";
|
|
@@ -91,11 +93,11 @@ var UTab = class UTab extends UElement {
|
|
|
91
93
|
}
|
|
92
94
|
renderLabel() {
|
|
93
95
|
return html`
|
|
94
|
-
<slot name="prefix"></slot>
|
|
96
|
+
<span class="affix affix-prefix" ?hidden=${!this.affixes.has("prefix")}><slot name="prefix"></slot></span>
|
|
95
97
|
<slot></slot>
|
|
96
98
|
${this.count == null || Number.isNaN(this.count) ? nothing : html`<span class="count ${(this.countAppearance ?? _UTab.countAppearance) === "plain" ? "plain" : "badge"}"
|
|
97
99
|
part="count">${formatNumber(this.count)}</span>`}
|
|
98
|
-
<slot name="suffix"></slot>
|
|
100
|
+
<span class="affix affix-suffix" ?hidden=${!this.affixes.has("suffix")}><slot name="suffix"></slot></span>
|
|
99
101
|
`;
|
|
100
102
|
}
|
|
101
103
|
};
|
|
@@ -27,6 +27,11 @@ var styles = css`
|
|
|
27
27
|
|
|
28
28
|
min-height: var(--u-target-size, 0px);
|
|
29
29
|
border-radius: inherit;
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
border-style: solid;
|
|
33
|
+
border-width: var(--_tab-border-width, 0);
|
|
34
|
+
border-color: var(--_tab-border-color, transparent);
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
:host(:hover:not([disabled])) {
|
|
@@ -37,10 +42,19 @@ var styles = css`
|
|
|
37
42
|
cursor: not-allowed;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
|
-
|
|
45
|
+
|
|
46
|
+
.affix {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
flex: none;
|
|
50
|
+
}
|
|
51
|
+
.affix[hidden] {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
.affix-prefix {
|
|
41
55
|
margin-right: 0.2em;
|
|
42
56
|
}
|
|
43
|
-
|
|
57
|
+
.affix-suffix {
|
|
44
58
|
margin-left: 0.2em;
|
|
45
59
|
}
|
|
46
60
|
|
|
@@ -141,36 +141,36 @@ var styles = css`
|
|
|
141
141
|
background-color: var(--u-neutral-0, #FFFFFF);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
|
|
145
|
+
:host([appearance="card"]) ::slotted(u-tab) {
|
|
146
|
+
--_tab-border-color: var(--u-border-color, #E0E0E0);
|
|
147
|
+
}
|
|
144
148
|
:host([appearance="card"][placement="top"]) ::slotted(u-tab) {
|
|
145
|
-
border-
|
|
146
|
-
border-right: 1px solid var(--u-border-color, #E0E0E0);
|
|
149
|
+
--_tab-border-width: 0 1px 1px 0;
|
|
147
150
|
}
|
|
148
151
|
:host([appearance="card"][placement="top"]) ::slotted(u-tab[active]) {
|
|
149
|
-
border-
|
|
152
|
+
--_tab-border-width: 0 1px 0 0;
|
|
150
153
|
}
|
|
151
154
|
|
|
152
155
|
:host([appearance="card"][placement="bottom"]) ::slotted(u-tab) {
|
|
153
|
-
border-
|
|
154
|
-
border-right: 1px solid var(--u-border-color, #E0E0E0);
|
|
156
|
+
--_tab-border-width: 1px 1px 0 0;
|
|
155
157
|
}
|
|
156
158
|
:host([appearance="card"][placement="bottom"]) ::slotted(u-tab[active]) {
|
|
157
|
-
border-
|
|
159
|
+
--_tab-border-width: 0 1px 0 0;
|
|
158
160
|
}
|
|
159
161
|
|
|
160
162
|
:host([appearance="card"][placement="left"]) ::slotted(u-tab) {
|
|
161
|
-
border-
|
|
162
|
-
border-bottom: 1px solid var(--u-border-color, #E0E0E0);
|
|
163
|
+
--_tab-border-width: 0 1px 1px 0;
|
|
163
164
|
}
|
|
164
165
|
:host([appearance="card"][placement="left"]) ::slotted(u-tab[active]) {
|
|
165
|
-
border-
|
|
166
|
+
--_tab-border-width: 0 0 1px 0;
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
:host([appearance="card"][placement="right"]) ::slotted(u-tab) {
|
|
169
|
-
border-
|
|
170
|
-
border-bottom: 1px solid var(--u-border-color, #E0E0E0);
|
|
170
|
+
--_tab-border-width: 0 0 1px 1px;
|
|
171
171
|
}
|
|
172
172
|
:host([appearance="card"][placement="right"]) ::slotted(u-tab[active]) {
|
|
173
|
-
border-
|
|
173
|
+
--_tab-border-width: 0 0 1px 0;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
|
|
@@ -182,11 +182,11 @@ var styles = css`
|
|
|
182
182
|
border-radius: var(--u-radius-xl, 8px);
|
|
183
183
|
}
|
|
184
184
|
:host([appearance="pill"]) ::slotted(u-tab) {
|
|
185
|
-
border: 1px
|
|
185
|
+
--_tab-border-width: 1px;
|
|
186
186
|
border-radius: var(--u-radius-lg, 6px);
|
|
187
187
|
}
|
|
188
188
|
:host([appearance="pill"]) ::slotted(u-tab[active]) {
|
|
189
|
-
border-color: var(--u-border-color, #E0E0E0);
|
|
189
|
+
--_tab-border-color: var(--u-border-color, #E0E0E0);
|
|
190
190
|
background-color: var(--u-neutral-0, #FFFFFF);
|
|
191
191
|
box-shadow: var(--u-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.04));
|
|
192
192
|
}
|
|
@@ -21,6 +21,8 @@ export type TreeItemTrigger = 'item' | 'icon';
|
|
|
21
21
|
*/
|
|
22
22
|
export declare class UTreeItem extends UElement {
|
|
23
23
|
static styles: import('lit').CSSResultGroup[];
|
|
24
|
+
/** 접두 · 접미 슬롯이 찼는가 — 그 옆 간격은 섀도 안 상자가 갖는다(`::slotted` 여백은 문서의 전역 리셋에 진다). */
|
|
25
|
+
private readonly affixes;
|
|
24
26
|
/** 비활성화 여부 */
|
|
25
27
|
disabled: boolean;
|
|
26
28
|
/** 펼침/접힌 상태 */
|
|
@@ -3,6 +3,7 @@ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.155.0/hel
|
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
4
4
|
import { HostAria } from "../../utilities/hostAria.js";
|
|
5
5
|
import "../spinner/USpinner.js";
|
|
6
|
+
import { SlotPresence } from "../../utilities/slotPresence.js";
|
|
6
7
|
import "../icon/UIcon.js";
|
|
7
8
|
import { isFromNestedControl } from "../../utilities/nestedControl.js";
|
|
8
9
|
import { styles } from "./UTreeItem.styles.js";
|
|
@@ -16,6 +17,7 @@ var UTreeItem = class UTreeItem extends UElement {
|
|
|
16
17
|
}
|
|
17
18
|
constructor(..._args) {
|
|
18
19
|
super(..._args);
|
|
20
|
+
this.affixes = new SlotPresence(this, ["prefix", "suffix"]);
|
|
19
21
|
this.disabled = false;
|
|
20
22
|
this.expanded = false;
|
|
21
23
|
this.selectable = false;
|
|
@@ -144,11 +146,11 @@ var UTreeItem = class UTreeItem extends UElement {
|
|
|
144
146
|
></u-icon>
|
|
145
147
|
</span>
|
|
146
148
|
|
|
147
|
-
<slot name="prefix"></slot>
|
|
149
|
+
<span class="affix affix-prefix" ?hidden=${!this.affixes.has("prefix")}><slot name="prefix"></slot></span>
|
|
148
150
|
<div class="content" part="content">
|
|
149
151
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
150
152
|
</div>
|
|
151
|
-
<slot name="suffix"></slot>
|
|
153
|
+
<span class="affix affix-suffix" ?hidden=${!this.affixes.has("suffix")}><slot name="suffix"></slot></span>
|
|
152
154
|
</div>
|
|
153
155
|
|
|
154
156
|
<div class="subtree" part="subtree" ?hidden=${!this.expanded || this.leaf}>
|
|
@@ -44,10 +44,19 @@ var styles = css`
|
|
|
44
44
|
background-color: color-mix(in srgb, var(--tree-item-color) 15%, var(--u-bg-color, #FFFFFF));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
|
|
48
|
+
.affix {
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
flex: none;
|
|
52
|
+
}
|
|
53
|
+
.affix[hidden] {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
.affix-prefix {
|
|
48
57
|
margin-right: 0.2em;
|
|
49
58
|
}
|
|
50
|
-
|
|
59
|
+
.affix-suffix {
|
|
51
60
|
margin-left: 0.2em;
|
|
52
61
|
}
|
|
53
62
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* 이름 붙은 슬롯(`prefix` · `suffix` 등)에 라이트 DOM 자식이 꽂혀 있는가 — 슬롯을 감싼 섀도 안 상자를 비었을 때 그리지 않으려고 쓴다.
|
|
4
|
+
*
|
|
5
|
+
* 슬롯 옆 간격을 `::slotted()` 의 여백으로 주면 문서의 전역 리셋(Tailwind preflight 류 `* { margin: 0 }`)에 진다 — 캡슐화 문맥이
|
|
6
|
+
* 다르면 문서 쪽 normal 선언이 이긴다. 간격은 섀도 안 상자가 갖고, 그 상자는 꽂힌 것이 있을 때만 선다.
|
|
7
|
+
*
|
|
8
|
+
* 첫 렌더 전에도 답하도록 `slotchange` 가 아니라 자식 목록을 본다(직속 자식의 `slot` 속성).
|
|
9
|
+
*/
|
|
10
|
+
export declare class SlotPresence implements ReactiveController {
|
|
11
|
+
private readonly host;
|
|
12
|
+
private readonly names;
|
|
13
|
+
private present;
|
|
14
|
+
private readonly observer;
|
|
15
|
+
constructor(host: ReactiveControllerHost & HTMLElement, names: readonly string[]);
|
|
16
|
+
/** 그 이름의 슬롯에 꽂힌 자식이 있는가. */
|
|
17
|
+
has(name: string): boolean;
|
|
18
|
+
hostConnected(): void;
|
|
19
|
+
hostDisconnected(): void;
|
|
20
|
+
private sync;
|
|
21
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/utilities/slotPresence.ts
|
|
2
|
+
/**
|
|
3
|
+
* 이름 붙은 슬롯(`prefix` · `suffix` 등)에 라이트 DOM 자식이 꽂혀 있는가 — 슬롯을 감싼 섀도 안 상자를 비었을 때 그리지 않으려고 쓴다.
|
|
4
|
+
*
|
|
5
|
+
* 슬롯 옆 간격을 `::slotted()` 의 여백으로 주면 문서의 전역 리셋(Tailwind preflight 류 `* { margin: 0 }`)에 진다 — 캡슐화 문맥이
|
|
6
|
+
* 다르면 문서 쪽 normal 선언이 이긴다. 간격은 섀도 안 상자가 갖고, 그 상자는 꽂힌 것이 있을 때만 선다.
|
|
7
|
+
*
|
|
8
|
+
* 첫 렌더 전에도 답하도록 `slotchange` 가 아니라 자식 목록을 본다(직속 자식의 `slot` 속성).
|
|
9
|
+
*/
|
|
10
|
+
var SlotPresence = class {
|
|
11
|
+
constructor(host, names) {
|
|
12
|
+
this.host = host;
|
|
13
|
+
this.names = names;
|
|
14
|
+
this.present = /* @__PURE__ */ new Set();
|
|
15
|
+
this.observer = new MutationObserver(() => this.sync());
|
|
16
|
+
host.addController(this);
|
|
17
|
+
}
|
|
18
|
+
/** 그 이름의 슬롯에 꽂힌 자식이 있는가. */
|
|
19
|
+
has(name) {
|
|
20
|
+
return this.present.has(name);
|
|
21
|
+
}
|
|
22
|
+
hostConnected() {
|
|
23
|
+
this.sync();
|
|
24
|
+
this.observer.observe(this.host, {
|
|
25
|
+
childList: true,
|
|
26
|
+
attributes: true,
|
|
27
|
+
attributeFilter: ["slot"],
|
|
28
|
+
subtree: true
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
hostDisconnected() {
|
|
32
|
+
this.observer.disconnect();
|
|
33
|
+
}
|
|
34
|
+
sync() {
|
|
35
|
+
const next = new Set(this.names.filter((name) => Array.from(this.host.children).some((c) => c.slot === name)));
|
|
36
|
+
if (next.size === this.present.size && [...next].every((n) => this.present.has(n))) return;
|
|
37
|
+
this.present = next;
|
|
38
|
+
this.host.requestUpdate();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
export { SlotPresence };
|
package/package.json
CHANGED
|
@@ -12,6 +12,9 @@ production floor, a kiosk, a lobby screen — so a list longer than the screen i
|
|
|
12
12
|
One round: it waits `pause` at the top, scrolls to the end at `speed` (px per second), waits `pause` at the end and
|
|
13
13
|
returns to the top. Content that fits does not move. It steps aside for a person: it stands still while the mouse is
|
|
14
14
|
over it or focus is inside it, and scrolling by hand always works (it carries on from where the person left it).
|
|
15
|
+
On a full-screen wall display the cursor is always over it and a tap leaves focus in it, so set `unattended` there:
|
|
16
|
+
the pointer and focus from a tap no longer stop it, and keyboard focus stops it only until `resume-delay` (30 seconds)
|
|
17
|
+
passes untouched — the pair of `u-carousel`'s `unattended`. `paused` still stops it.
|
|
15
18
|
For a user who asked for reduced motion (`prefers-reduced-motion: reduce`) it does not move at all. When it leaves the
|
|
16
19
|
screen and comes back — a carousel returning to its slide — it starts over from the top.
|
|
17
20
|
|
|
@@ -50,6 +53,8 @@ Otherwise it scrolls at `speed`.
|
|
|
50
53
|
| `duration` | `number` | `0` | — | Time for one round (wait + scroll + wait), in ms; the speed follows from the distance. `0` uses `speed` |
|
|
51
54
|
| `pause` | `number` | `3000` | — | Wait at the top and at the end, in ms |
|
|
52
55
|
| `paused` | `boolean` | `false` | ✓ | Do not scroll by itself — by hand only |
|
|
56
|
+
| `unattended` | `boolean` | `false` | ✓ | A screen nobody operates — the pointer over it and focus that came from a tap do not stop it; keyboard focus does, until `resumeDelay` passes without a key press or a click |
|
|
57
|
+
| `resumeDelay` | `number` | `30000` | — | `resume-delay` — with `unattended`, the idle time in ms before a stop caused by keyboard focus ends |
|
|
53
58
|
|
|
54
59
|
## Methods
|
|
55
60
|
|
|
@@ -23,7 +23,8 @@ Slide carousel. Each direct child element becomes one slide.
|
|
|
23
23
|
|
|
24
24
|
With `autoplay`, the carousel renders a stop/start button as the first control of its indicator
|
|
25
25
|
row (WCAG 2.2.2). Rotation pauses while the mouse is over the carousel and stops when keyboard focus
|
|
26
|
-
moves into it, until the user presses start (WAI-ARIA APG carousel pattern)
|
|
26
|
+
moves into it, until the user presses start (WAI-ARIA APG carousel pattern) — on a screen nobody operates, see
|
|
27
|
+
`unattended` below. Slides are
|
|
27
28
|
`aria-live="off"` while rotating and `polite` when stopped. For a user who has asked for reduced
|
|
28
29
|
motion (`prefers-reduced-motion: reduce`) the carousel starts stopped — the start button turns
|
|
29
30
|
rotation on — and it stops if that setting is turned on while the page is open.
|
|
@@ -51,6 +52,19 @@ the current tab fills over `autoplay-interval` while the carousel rotates. When
|
|
|
51
52
|
|
|
52
53
|
Give the carousel a height (`flex: 1` in a full-screen column, or a fixed height) — the row takes its share of it.
|
|
53
54
|
|
|
55
|
+
### Nobody at the screen — `unattended`
|
|
56
|
+
|
|
57
|
+
A full-screen wall display always has the mouse cursor over it, and someone who tapped a slide once leaves focus in it —
|
|
58
|
+
under the rules for a carousel a person is using, the board would stop on that slide for good, and the people reading
|
|
59
|
+
it from across the room would take a stopped board for a current one. `unattended` changes two of those rules: the
|
|
60
|
+
pointer never pauses rotation, and rotation stopped by keyboard focus starts again after `resume-delay` (30 seconds by
|
|
61
|
+
default) without a key press or a click in it. The stop button still stops it, and that stop stays (WCAG 2.2.2).
|
|
62
|
+
`startRotation()` / `stopRotation()` do what the button does, from code.
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<u-carousel autoplay loop unattended pagination pagination-style="labels" autoplay-interval="20000" aria-label="Floor board">…</u-carousel>
|
|
66
|
+
```
|
|
67
|
+
|
|
54
68
|
---
|
|
55
69
|
|
|
56
70
|
## Slots
|
|
@@ -70,6 +84,8 @@ Give the carousel a height (`flex: 1` in a full-screen column, or a fixed height
|
|
|
70
84
|
| `pagination` | `boolean` | `false` | Show dot pagination |
|
|
71
85
|
| `paginationStyle` | `'dots'\|'labels'` | `'dots'` | `pagination-style` — `labels` puts a row under the slides: each slide's name and a progress bar (see below) |
|
|
72
86
|
| `draggable` | `boolean` | `false` | Drag to navigate |
|
|
87
|
+
| `unattended` | `boolean` | `false` | A screen nobody operates — the pointer does not pause rotation, and a stop caused by keyboard focus ends after `resumeDelay` (see above) |
|
|
88
|
+
| `resumeDelay` | `number` | `30000` | `resume-delay` — with `unattended`, the idle time in ms before rotation stopped by keyboard focus starts again |
|
|
73
89
|
| `slidesPerView` | `number` | `1` | Visible slides at once |
|
|
74
90
|
| `slidesPerMove` | `number` | `1` | Slides to advance per step |
|
|
75
91
|
| `gap` | `number` | `0` | Gap between slides in px |
|
|
@@ -82,6 +98,8 @@ Give the carousel a height (`flex: 1` in a full-screen column, or a fixed height
|
|
|
82
98
|
| `prev()` | Go to previous slide |
|
|
83
99
|
| `next()` | Go to next slide |
|
|
84
100
|
| `goTo(index)` | Jump to a specific slide index |
|
|
101
|
+
| `startRotation()` | Start automatic rotation again — whatever stopped it (the stop button, keyboard focus, reduced motion) |
|
|
102
|
+
| `stopRotation()` | Stop automatic rotation, as the stop button does |
|
|
85
103
|
|
|
86
104
|
## CSS Parts
|
|
87
105
|
|
|
@@ -94,4 +94,5 @@ message that needs a response.
|
|
|
94
94
|
| `panel` | The dialog panel |
|
|
95
95
|
| `header` | Header area |
|
|
96
96
|
| `body` | Body area |
|
|
97
|
+
| `footer` | Footer area around the `footer` slot — its padding and top divider (not drawn when the slot is empty). They live here, not on the slotted element, so a document-wide reset such as Tailwind's preflight cannot strip them |
|
|
97
98
|
| `close-btn` | Close button |
|
|
@@ -65,6 +65,7 @@ Same as `u-dialog`: exposed as a **`dialog`** (`aria-modal` when modal), named b
|
|
|
65
65
|
| `panel` | Drawer panel |
|
|
66
66
|
| `header` | Header area |
|
|
67
67
|
| `body` | Body area |
|
|
68
|
+
| `footer` | Footer area around the `footer` slot — its padding and top divider (not drawn when the slot is empty). They live here, not on the slotted element, so a document-wide reset such as Tailwind's preflight cannot strip them |
|
|
68
69
|
| `close-btn` | Close button |
|
|
69
70
|
|
|
70
71
|
## CSS Custom Properties
|
|
@@ -73,20 +73,25 @@ Options of different kinds can be grouped under headings with [`u-option-group`]
|
|
|
73
73
|
|--------|-------------|
|
|
74
74
|
| `validate()` | Validate; sets `invalid` |
|
|
75
75
|
| `reset()` | Reset value |
|
|
76
|
-
| `focus(options?)` | Focus the trigger |
|
|
76
|
+
| `focus(options?)` | Focus the trigger (its search input, when `searchable`) |
|
|
77
77
|
| `blur()` | Blur the trigger |
|
|
78
78
|
|
|
79
79
|
## Keyboard & accessibility
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
`
|
|
87
|
-
`
|
|
88
|
-
the
|
|
89
|
-
`
|
|
81
|
+
Without `searchable` the trigger is a `role="combobox"` (APG *select-only combobox*) whose dropdown holds a
|
|
82
|
+
`role="listbox"`; opening it focuses the first option. Typing on the closed trigger is **type-ahead**: a letter picks
|
|
83
|
+
the next option whose text starts with it (repeat the letter to cycle), and letters typed within half a second form a
|
|
84
|
+
word (`ch` → *cherry*); on an open list the same keys move the focus instead of picking.
|
|
85
|
+
|
|
86
|
+
With `searchable` the combobox is an **editable input inside the trigger** (APG *editable combobox with list
|
|
87
|
+
autocomplete*): `Tab` lands in it, and typing — including the first syllable of an IME composition — opens the list and
|
|
88
|
+
becomes the query at once, so nothing typed is lost. While there is a query the selected value is hidden behind it
|
|
89
|
+
(`multiple` keeps its chips and types after them). The first visible option is the **active candidate** — shown like a
|
|
90
|
+
hovered option and announced through the input's `aria-activedescendant` — and `Enter` picks it (closing the list, or
|
|
91
|
+
toggling it with `multiple`); the `Enter` that commits an IME composition does not. `ArrowDown`/`ArrowUp` open a closed
|
|
92
|
+
list and, on an open one, move to the first/last visible option; letters typed on an option go back to the input.
|
|
93
|
+
`Escape` closes the list (the focus stays in the input) and closing clears the query, so the trigger shows the value
|
|
94
|
+
again. On an option, arrows, `Home`/`End`, `Enter`/`Space` (select) and `Escape` (close) work as usual.
|
|
90
95
|
|
|
91
96
|
## CSS Parts
|
|
92
97
|
|
|
@@ -95,7 +100,7 @@ the first/last visible option; on an option, arrows, `Home`/`End`, `Enter`/`Spac
|
|
|
95
100
|
| `field` | Outer field wrapper |
|
|
96
101
|
| `container` | Trigger area |
|
|
97
102
|
| `popover` | Dropdown list container |
|
|
98
|
-
| `search-input` |
|
|
103
|
+
| `search-input` | The search input inside the trigger (the combobox, when `searchable`) |
|
|
99
104
|
| `no-matches` | *No matches* status line in the dropdown (empty and hidden otherwise) |
|
|
100
105
|
|
|
101
106
|
## CSS Custom Properties
|