@iyulab/components 2.28.0 → 2.28.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/CHANGELOG.md +19 -0
- package/dist/components/UFloatingElement.d.ts +11 -0
- package/dist/components/UFloatingElement.js +33 -1
- package/dist/components/UFloatingElement.styles.js +5 -0
- package/dist/components/button/UButton.js +6 -6
- package/dist/components/button/forwarded-aria.d.ts +6 -0
- package/dist/components/button/forwarded-aria.js +18 -1
- package/dist/components/copy-button/UCopyButton.js +1 -1
- package/dist/components/icon-button/UIconButton.js +6 -6
- package/dist/components/menu-item/UMenuItem.d.ts +12 -0
- package/dist/components/menu-item/UMenuItem.js +38 -2
- package/dist/utilities/BrowserStorage.js +3 -3
- package/dist/utilities/Dialog.js +1 -1
- package/dist/utilities/Theme.js +1 -1
- package/dist/utilities/converters.js +3 -3
- package/dist/utilities/icons.js +1 -1
- package/package.json +1 -1
- package/skills/iyulab-components/references/components/button.md +2 -0
- package/skills/iyulab-components/references/components/menu.md +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.28.1] - 2026-10-16
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- `u-button` · `u-icon-button`: an empty state attribute on the host (`aria-pressed` · `aria-expanded` · `aria-haspopup` ·
|
|
8
|
+
`aria-current`) reaches the inner button as `"true"`. React 19 writes a boolean `true` on a custom element as an empty
|
|
9
|
+
attribute, so `<UButton aria-expanded={open}>` gave the focused button `aria-expanded=""` — not valid ARIA, read as
|
|
10
|
+
«not expandable» once opened.
|
|
11
|
+
- `u-tooltip` · `u-popover`: a closed floating element takes no part in layout once its closing fade ends. A hidden
|
|
12
|
+
absolutely positioned box still counted toward its scroll container’s overflow, so a never-opened wide tooltip next
|
|
13
|
+
to an anchor near the right edge gave a vertical list a horizontal scrollbar. It is laid out again before it is
|
|
14
|
+
measured for opening.
|
|
15
|
+
- `u-menu-item` with a submenu is named by its own label only — the children's labels were part of its name
|
|
16
|
+
(«Theme Light Dark»). It now carries `aria-haspopup="menu"` and `aria-expanded`, and the submenu is `role="menu"`.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Console diagnostics begin with `[@iyulab/components]`, so a message in a console shared by several packages says which one wrote it (several also say what to do next).
|
|
21
|
+
|
|
3
22
|
## [2.28.0] - 2026-10-15
|
|
4
23
|
|
|
5
24
|
### Added
|
|
@@ -111,10 +111,21 @@ export declare class UFloatingElement extends UElement {
|
|
|
111
111
|
private trackSeq;
|
|
112
112
|
private showTimer?;
|
|
113
113
|
private hideTimer?;
|
|
114
|
+
/** `:state(parked)` 를 싣는다 — 닫힌 동안 레이아웃에서 빠진다(아래 `park()`). */
|
|
115
|
+
private readonly floatingInternals;
|
|
116
|
+
private parkSeq;
|
|
114
117
|
connectedCallback(): void;
|
|
115
118
|
disconnectedCallback(): void;
|
|
116
119
|
protected willUpdate(changedProperties: PropertyValues): void;
|
|
117
120
|
protected updated(changedProperties: PropertyValues): void;
|
|
121
|
+
/**
|
|
122
|
+
* 닫힌 떠 있는 요소는 레이아웃에서 빠진다(`:state(parked)` → `display: none`). `visibility: hidden` 인 절대 위치 상자도
|
|
123
|
+
* 스크롤 컨테이너의 넘침에 들어가, 한 번도 열리지 않은 툴팁(폭 수백 px)이 앵커 옆에 남아 세로 목록에 가로 스크롤바를
|
|
124
|
+
* 만들었다. 닫힘 전환이 끝난 뒤에 빼고(페이드는 그대로), 열거나 재기 전에 꺼낸다.
|
|
125
|
+
*/
|
|
126
|
+
private setParked;
|
|
127
|
+
private unpark;
|
|
128
|
+
private parkWhenSettled;
|
|
118
129
|
/** 자동 위치 추적을 끊고, 계산 중인 track() 이 뒤늦게 추적을 걸지 못하게 한다. */
|
|
119
130
|
private untrack;
|
|
120
131
|
/** 타겟 기준으로 위치를 계산하고, 스크롤·리사이즈를 따라 재배치하도록 추적을 건다. */
|
|
@@ -31,12 +31,15 @@ var UFloatingElement = class extends UElement {
|
|
|
31
31
|
this.hideDelay = 0;
|
|
32
32
|
this.cleanup = null;
|
|
33
33
|
this.trackSeq = 0;
|
|
34
|
+
this.floatingInternals = typeof this.attachInternals === "function" ? this.attachInternals() : void 0;
|
|
35
|
+
this.parkSeq = 0;
|
|
34
36
|
}
|
|
35
37
|
static {
|
|
36
38
|
this.styles = [super.styles, styles];
|
|
37
39
|
}
|
|
38
40
|
connectedCallback() {
|
|
39
41
|
super.connectedCallback();
|
|
42
|
+
if (!this.open) this.setParked(true);
|
|
40
43
|
if (!this.anchors || this.anchors.length === 0) {
|
|
41
44
|
const parent = getParentElement(this);
|
|
42
45
|
this.anchors = parent ? [parent] : [];
|
|
@@ -58,6 +61,8 @@ var UFloatingElement = class extends UElement {
|
|
|
58
61
|
updated(changedProperties) {
|
|
59
62
|
super.updated(changedProperties);
|
|
60
63
|
if (!changedProperties.has("open")) return;
|
|
64
|
+
if (this.open) this.unpark();
|
|
65
|
+
else this.parkWhenSettled();
|
|
61
66
|
if (this.open && this.cleanup === null) {
|
|
62
67
|
const target = this.targetEl ?? this.anchors?.[0];
|
|
63
68
|
if (target) this.track(target);
|
|
@@ -66,6 +71,29 @@ var UFloatingElement = class extends UElement {
|
|
|
66
71
|
this.targetEl = void 0;
|
|
67
72
|
}
|
|
68
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* 닫힌 떠 있는 요소는 레이아웃에서 빠진다(`:state(parked)` → `display: none`). `visibility: hidden` 인 절대 위치 상자도
|
|
76
|
+
* 스크롤 컨테이너의 넘침에 들어가, 한 번도 열리지 않은 툴팁(폭 수백 px)이 앵커 옆에 남아 세로 목록에 가로 스크롤바를
|
|
77
|
+
* 만들었다. 닫힘 전환이 끝난 뒤에 빼고(페이드는 그대로), 열거나 재기 전에 꺼낸다.
|
|
78
|
+
*/
|
|
79
|
+
setParked(parked) {
|
|
80
|
+
const states = this.floatingInternals?.states;
|
|
81
|
+
if (!states) return;
|
|
82
|
+
try {
|
|
83
|
+
if (parked) states.add("parked");
|
|
84
|
+
else states.delete("parked");
|
|
85
|
+
} catch {}
|
|
86
|
+
}
|
|
87
|
+
unpark() {
|
|
88
|
+
this.parkSeq++;
|
|
89
|
+
this.setParked(false);
|
|
90
|
+
}
|
|
91
|
+
async parkWhenSettled() {
|
|
92
|
+
const seq = ++this.parkSeq;
|
|
93
|
+
await Promise.all(this.getAnimations().map((a) => a.finished.catch(() => void 0)));
|
|
94
|
+
if (seq !== this.parkSeq || this.open || this.cleanup !== null || this.showTimer) return;
|
|
95
|
+
this.setParked(true);
|
|
96
|
+
}
|
|
69
97
|
/** 자동 위치 추적을 끊고, 계산 중인 track() 이 뒤늦게 추적을 걸지 못하게 한다. */
|
|
70
98
|
untrack() {
|
|
71
99
|
this.trackSeq++;
|
|
@@ -128,7 +156,10 @@ var UFloatingElement = class extends UElement {
|
|
|
128
156
|
this.untrack();
|
|
129
157
|
await this.updateComplete;
|
|
130
158
|
this.targetEl = void 0;
|
|
131
|
-
if (!this.open)
|
|
159
|
+
if (!this.open) {
|
|
160
|
+
this.parkWhenSettled();
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
132
163
|
if (this.fire("hide", {
|
|
133
164
|
bubbles: false,
|
|
134
165
|
composed: false
|
|
@@ -148,6 +179,7 @@ var UFloatingElement = class extends UElement {
|
|
|
148
179
|
* @param target - 위치 계산에 사용할 타겟 엘리먼트입니다.
|
|
149
180
|
*/
|
|
150
181
|
async reposition(target) {
|
|
182
|
+
this.unpark();
|
|
151
183
|
const targetRect = target.getBoundingClientRect();
|
|
152
184
|
this.style.setProperty("--anchor-width", `${targetRect.width}px`);
|
|
153
185
|
this.style.setProperty("--anchor-height", `${targetRect.height}px`);
|
|
@@ -21,6 +21,11 @@ var styles = css`
|
|
|
21
21
|
pointer-events: none;
|
|
22
22
|
transition: opacity var(--u-duration-normal, 220ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1)), visibility 0s var(--u-duration-normal, 220ms);
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
:host(:state(parked)) {
|
|
27
|
+
display: none !important;
|
|
28
|
+
}
|
|
24
29
|
:host([open]) {
|
|
25
30
|
opacity: 1;
|
|
26
31
|
visibility: visible;
|
|
@@ -3,7 +3,7 @@ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.154.0/hel
|
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js";
|
|
4
4
|
import "../spinner/USpinner.js";
|
|
5
5
|
import { styles } from "./UButton.styles.js";
|
|
6
|
-
import { FORWARDED_ARIA } from "./forwarded-aria.js";
|
|
6
|
+
import { FORWARDED_ARIA, readForwardedAria } from "./forwarded-aria.js";
|
|
7
7
|
import { html } from "lit";
|
|
8
8
|
import { customElement, property } from "lit/decorators.js";
|
|
9
9
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
@@ -114,11 +114,11 @@ var UButton = class UButton extends UElement {
|
|
|
114
114
|
inner.ariaControlsElements = targets.length ? targets : null;
|
|
115
115
|
}
|
|
116
116
|
render() {
|
|
117
|
-
const ariaLabel = this
|
|
118
|
-
const pressed = this
|
|
119
|
-
const expanded = this
|
|
120
|
-
const haspopup = this
|
|
121
|
-
const current = this
|
|
117
|
+
const ariaLabel = readForwardedAria(this, "aria-label");
|
|
118
|
+
const pressed = readForwardedAria(this, "aria-pressed");
|
|
119
|
+
const expanded = readForwardedAria(this, "aria-expanded");
|
|
120
|
+
const haspopup = readForwardedAria(this, "aria-haspopup");
|
|
121
|
+
const current = readForwardedAria(this, "aria-current");
|
|
122
122
|
if (this.href) return html`
|
|
123
123
|
<a part="link"
|
|
124
124
|
aria-label=${ifDefined(ariaLabel)}
|
|
@@ -4,3 +4,9 @@
|
|
|
4
4
|
* 허용되지 않아 `<button>` 에만 싣는다. `aria-controls` 는 id 참조라 `forwardControls()` 가 따로 옮긴다.
|
|
5
5
|
*/
|
|
6
6
|
export declare const FORWARDED_ARIA: readonly ["aria-label", "aria-pressed", "aria-expanded", "aria-haspopup", "aria-controls", "aria-current"];
|
|
7
|
+
/**
|
|
8
|
+
* 옮길 값을 호스트에서 읽는다. 상태 속성의 빈 값은 `"true"` 로 읽는다 — React 19 는 커스텀 요소의
|
|
9
|
+
* 불리언 `true` 를 빈 속성으로 쓰고(내장 요소에는 `"true"`), 빈 값은 ARIA 에서 유효하지 않아
|
|
10
|
+
* 안쪽 요소에 그대로 옮기면 보조기기가 «설정 안 됨» 으로 읽는다. 이름(`aria-label`)의 빈 값은 그대로다.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readForwardedAria(host: Element, name: (typeof FORWARDED_ARIA)[number]): string | undefined;
|
|
@@ -12,5 +12,22 @@ var FORWARDED_ARIA = [
|
|
|
12
12
|
"aria-controls",
|
|
13
13
|
"aria-current"
|
|
14
14
|
];
|
|
15
|
+
/** 값이 «있다/없다» 로도 쓰이는 상태 속성 — 빈 값은 속성 존재, 곧 `true` 다. */
|
|
16
|
+
var PRESENCE_STATES = /* @__PURE__ */ new Set([
|
|
17
|
+
"aria-pressed",
|
|
18
|
+
"aria-expanded",
|
|
19
|
+
"aria-haspopup",
|
|
20
|
+
"aria-current"
|
|
21
|
+
]);
|
|
22
|
+
/**
|
|
23
|
+
* 옮길 값을 호스트에서 읽는다. 상태 속성의 빈 값은 `"true"` 로 읽는다 — React 19 는 커스텀 요소의
|
|
24
|
+
* 불리언 `true` 를 빈 속성으로 쓰고(내장 요소에는 `"true"`), 빈 값은 ARIA 에서 유효하지 않아
|
|
25
|
+
* 안쪽 요소에 그대로 옮기면 보조기기가 «설정 안 됨» 으로 읽는다. 이름(`aria-label`)의 빈 값은 그대로다.
|
|
26
|
+
*/
|
|
27
|
+
function readForwardedAria(host, name) {
|
|
28
|
+
const value = host.getAttribute(name);
|
|
29
|
+
if (value === null) return void 0;
|
|
30
|
+
return value === "" && PRESENCE_STATES.has(name) ? "true" : value;
|
|
31
|
+
}
|
|
15
32
|
//#endregion
|
|
16
|
-
export { FORWARDED_ARIA };
|
|
33
|
+
export { FORWARDED_ARIA, readForwardedAria };
|
|
@@ -40,7 +40,7 @@ var UCopyButton = class UCopyButton extends UElement {
|
|
|
40
40
|
this.copied = false;
|
|
41
41
|
}, this.delay);
|
|
42
42
|
} catch (error) {
|
|
43
|
-
console.error("
|
|
43
|
+
console.error("[@iyulab/components] u-copy-button: failed to copy text to the clipboard:", error);
|
|
44
44
|
this.copied = false;
|
|
45
45
|
}
|
|
46
46
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UElement } from "../UElement.js";
|
|
2
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorateMetadata.js";
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js";
|
|
4
|
-
import { FORWARDED_ARIA } from "../button/forwarded-aria.js";
|
|
4
|
+
import { FORWARDED_ARIA, readForwardedAria } from "../button/forwarded-aria.js";
|
|
5
5
|
import "../button/UButton.js";
|
|
6
6
|
import "../icon/UIcon.js";
|
|
7
7
|
import "../tooltip/UTooltip.js";
|
|
@@ -49,11 +49,11 @@ var UIconButton = class UIconButton extends UElement {
|
|
|
49
49
|
if (FORWARDED_ARIA.includes(name)) this.requestUpdate();
|
|
50
50
|
}
|
|
51
51
|
render() {
|
|
52
|
-
const ariaLabel = this
|
|
53
|
-
const pressed = this
|
|
54
|
-
const expanded = this
|
|
55
|
-
const haspopup = this
|
|
56
|
-
const controls = this
|
|
52
|
+
const ariaLabel = readForwardedAria(this, "aria-label") ?? (this.slotText || void 0);
|
|
53
|
+
const pressed = readForwardedAria(this, "aria-pressed");
|
|
54
|
+
const expanded = readForwardedAria(this, "aria-expanded");
|
|
55
|
+
const haspopup = readForwardedAria(this, "aria-haspopup");
|
|
56
|
+
const controls = readForwardedAria(this, "aria-controls");
|
|
57
57
|
return html`
|
|
58
58
|
<u-button part="button"
|
|
59
59
|
aria-label=${ifDefined(ariaLabel)}
|
|
@@ -38,11 +38,23 @@ export declare class UMenuItem extends UElement {
|
|
|
38
38
|
depth: number;
|
|
39
39
|
private _parentItem;
|
|
40
40
|
get parentItem(): UMenuItem | null;
|
|
41
|
+
private readonly aria;
|
|
42
|
+
/** 하위 메뉴를 가진 동안 라벨 글자가 바뀌는 것을 본다 — 이름을 라벨에서 다시 옮긴다. */
|
|
43
|
+
private labelObserver?;
|
|
41
44
|
private _childItems;
|
|
42
45
|
get childItems(): readonly UMenuItem[];
|
|
43
46
|
connectedCallback(): void;
|
|
47
|
+
disconnectedCallback(): void;
|
|
44
48
|
protected updated(changedProperties: PropertyValues): void;
|
|
45
49
|
render(): import('lit-html').TemplateResult<1>;
|
|
50
|
+
/**
|
|
51
|
+
* 하위 메뉴를 가진 항목의 이름은 자기 라벨뿐이다. 역할이 호스트에 있고 하위 항목은 호스트의 자식이라, 내용에서 짓는
|
|
52
|
+
* 이름이 하위 항목의 글자까지 모은다(«테마 라이트 다크 …»). 라벨(기본 슬롯)의 글자를 이름으로 옮기고, 하위 메뉴가 있음과
|
|
53
|
+
* 열림을 알린다(WAI-ARIA 메뉴 패턴). 작성자가 단 `aria-*` 는 건드리지 않는다(`HostAria`). 잎 항목은 내용이 곧 이름이다.
|
|
54
|
+
*/
|
|
55
|
+
private syncSubmenuAria;
|
|
56
|
+
/** 기본 슬롯(라벨)에 든 글자 — 하위 항목(`slot="children"`)과 앞뒤 슬롯은 빠진다. */
|
|
57
|
+
private labelText;
|
|
46
58
|
private propagate;
|
|
47
59
|
private handleHeaderClick;
|
|
48
60
|
private handleSlotChange;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UElement } from "../UElement.js";
|
|
2
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorateMetadata.js";
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.js";
|
|
4
|
+
import { HostAria } from "../../utilities/hostAria.js";
|
|
4
5
|
import "../icon/UIcon.js";
|
|
5
6
|
import "../popover/UPopover.js";
|
|
6
7
|
import { UDivider } from "../divider/UDivider.js";
|
|
@@ -27,6 +28,7 @@ var UMenuItem = class UMenuItem extends UElement {
|
|
|
27
28
|
this.leaf = true;
|
|
28
29
|
this.depth = 0;
|
|
29
30
|
this._parentItem = null;
|
|
31
|
+
this.aria = new HostAria(this);
|
|
30
32
|
this._childItems = [];
|
|
31
33
|
this.handleHeaderClick = (e) => {
|
|
32
34
|
if (isFromNestedControl(e, this)) return;
|
|
@@ -47,6 +49,7 @@ var UMenuItem = class UMenuItem extends UElement {
|
|
|
47
49
|
this.handleSlotChange = (e) => {
|
|
48
50
|
const elements = e.target.assignedElements({ flatten: true });
|
|
49
51
|
for (const el of elements) if ((el instanceof _UMenuItem || el instanceof UDivider) && !el.hasAttribute("slot")) el.setAttribute("slot", "children");
|
|
52
|
+
if (!this.leaf) this.syncSubmenuAria();
|
|
50
53
|
};
|
|
51
54
|
this.handleChildrenSlotChange = (e) => {
|
|
52
55
|
const slot = e.target;
|
|
@@ -74,8 +77,14 @@ var UMenuItem = class UMenuItem extends UElement {
|
|
|
74
77
|
if (!this.hasAttribute("slot")) this.setAttribute("slot", "children");
|
|
75
78
|
}
|
|
76
79
|
}
|
|
80
|
+
disconnectedCallback() {
|
|
81
|
+
this.labelObserver?.disconnect();
|
|
82
|
+
this.labelObserver = void 0;
|
|
83
|
+
super.disconnectedCallback();
|
|
84
|
+
}
|
|
77
85
|
updated(changedProperties) {
|
|
78
86
|
super.updated(changedProperties);
|
|
87
|
+
if (changedProperties.has("leaf") || changedProperties.has("expanded")) this.syncSubmenuAria();
|
|
79
88
|
if (changedProperties.has("disabled")) {
|
|
80
89
|
this.setAttribute("tabindex", this.disabled ? "-1" : "0");
|
|
81
90
|
if (this.disabled) this.setAttribute("aria-disabled", "true");
|
|
@@ -114,13 +123,13 @@ var UMenuItem = class UMenuItem extends UElement {
|
|
|
114
123
|
</div>
|
|
115
124
|
|
|
116
125
|
${this.inline ? html`
|
|
117
|
-
<div class="submenu" part="submenu"
|
|
126
|
+
<div class="submenu" part="submenu" role="menu"
|
|
118
127
|
?hidden=${this.leaf}
|
|
119
128
|
?open=${this.expanded}
|
|
120
129
|
>
|
|
121
130
|
<slot name="children" @slotchange=${this.handleChildrenSlotChange}></slot>
|
|
122
131
|
</div>` : html`
|
|
123
|
-
<u-popover class="popover" part="popover"
|
|
132
|
+
<u-popover class="popover" part="popover" role="menu"
|
|
124
133
|
?hidden=${this.leaf}
|
|
125
134
|
?open=${live(this.expanded)}
|
|
126
135
|
for=".header"
|
|
@@ -133,6 +142,33 @@ var UMenuItem = class UMenuItem extends UElement {
|
|
|
133
142
|
</u-popover>`}
|
|
134
143
|
`;
|
|
135
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* 하위 메뉴를 가진 항목의 이름은 자기 라벨뿐이다. 역할이 호스트에 있고 하위 항목은 호스트의 자식이라, 내용에서 짓는
|
|
147
|
+
* 이름이 하위 항목의 글자까지 모은다(«테마 라이트 다크 …»). 라벨(기본 슬롯)의 글자를 이름으로 옮기고, 하위 메뉴가 있음과
|
|
148
|
+
* 열림을 알린다(WAI-ARIA 메뉴 패턴). 작성자가 단 `aria-*` 는 건드리지 않는다(`HostAria`). 잎 항목은 내용이 곧 이름이다.
|
|
149
|
+
*/
|
|
150
|
+
syncSubmenuAria() {
|
|
151
|
+
const parent = !this.leaf;
|
|
152
|
+
this.aria.set("aria-label", parent ? this.labelText() || null : null);
|
|
153
|
+
this.aria.set("aria-haspopup", parent ? "menu" : null);
|
|
154
|
+
this.aria.set("aria-expanded", parent ? String(this.expanded) : null);
|
|
155
|
+
if (parent && !this.labelObserver) {
|
|
156
|
+
this.labelObserver = new MutationObserver(() => this.aria.set("aria-label", this.labelText() || null));
|
|
157
|
+
this.labelObserver.observe(this, {
|
|
158
|
+
childList: true,
|
|
159
|
+
characterData: true,
|
|
160
|
+
subtree: true
|
|
161
|
+
});
|
|
162
|
+
} else if (!parent && this.labelObserver) {
|
|
163
|
+
this.labelObserver.disconnect();
|
|
164
|
+
this.labelObserver = void 0;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** 기본 슬롯(라벨)에 든 글자 — 하위 항목(`slot="children"`)과 앞뒤 슬롯은 빠진다. */
|
|
168
|
+
labelText() {
|
|
169
|
+
const slot = this.shadowRoot?.querySelector(".content slot");
|
|
170
|
+
return (slot ? slot.assignedNodes({ flatten: true }) : []).map((n) => n.textContent ?? "").join("").replace(/s+/g, " ").trim();
|
|
171
|
+
}
|
|
136
172
|
propagate() {
|
|
137
173
|
this._childItems.forEach((child) => {
|
|
138
174
|
child.inline = this.inline;
|
|
@@ -32,7 +32,7 @@ var BrowserStorage = class {
|
|
|
32
32
|
});
|
|
33
33
|
else throw new Error(`Unsupported storage type: "${this.options.type}" (expected "localStorage" or "cookie")`);
|
|
34
34
|
} catch (e) {
|
|
35
|
-
console.error("[BrowserStorage
|
|
35
|
+
console.error("[@iyulab/components] BrowserStorage: set failed:", e);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
@@ -47,7 +47,7 @@ var BrowserStorage = class {
|
|
|
47
47
|
else if (this.options.type === "cookie") return (await window.cookieStore.get({ name: key }))?.value || null;
|
|
48
48
|
else throw new Error(`Unsupported storage type: "${this.options.type}" (expected "localStorage" or "cookie")`);
|
|
49
49
|
} catch (e) {
|
|
50
|
-
console.error("[BrowserStorage
|
|
50
|
+
console.error("[@iyulab/components] BrowserStorage: get failed:", e);
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -62,7 +62,7 @@ var BrowserStorage = class {
|
|
|
62
62
|
else if (this.options.type === "cookie") await window.cookieStore.delete({ name: key });
|
|
63
63
|
else throw new Error(`Unsupported storage type: "${this.options.type}" (expected "localStorage" or "cookie")`);
|
|
64
64
|
} catch (e) {
|
|
65
|
-
console.error("[BrowserStorage
|
|
65
|
+
console.error("[@iyulab/components] BrowserStorage: remove failed:", e);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
};
|
package/dist/utilities/Dialog.js
CHANGED
|
@@ -157,7 +157,7 @@ var Dialog = class {
|
|
|
157
157
|
try {
|
|
158
158
|
await dialog.updateComplete;
|
|
159
159
|
} catch (error) {
|
|
160
|
-
console.error("[
|
|
160
|
+
console.error("[@iyulab/components] Dialog: failed to show the dialog.", error);
|
|
161
161
|
dialog.remove();
|
|
162
162
|
return null;
|
|
163
163
|
}
|
package/dist/utilities/Theme.js
CHANGED
|
@@ -243,7 +243,7 @@ var Theme = class {
|
|
|
243
243
|
}
|
|
244
244
|
/** 디버그 모드시 로그 출력 함수 (인스턴스 스코프) */
|
|
245
245
|
static log(...args) {
|
|
246
|
-
if (this._isDebugMode) console.log("[
|
|
246
|
+
if (this._isDebugMode) console.log("[@iyulab/components] Theme:", ...args);
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
//#endregion
|
|
@@ -33,7 +33,7 @@ function jsonAttrConverter(parser = JSON.parse) {
|
|
|
33
33
|
try {
|
|
34
34
|
return parser(value);
|
|
35
35
|
} catch {
|
|
36
|
-
console.warn(`
|
|
36
|
+
console.warn(`[@iyulab/components] failed to parse a JSON attribute — pass valid JSON, or set the property instead: ${value}`);
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
},
|
|
@@ -42,7 +42,7 @@ function jsonAttrConverter(parser = JSON.parse) {
|
|
|
42
42
|
try {
|
|
43
43
|
return JSON.stringify(value);
|
|
44
44
|
} catch {
|
|
45
|
-
console.warn(`
|
|
45
|
+
console.warn(`[@iyulab/components] failed to write a property back as a JSON attribute:`, value);
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -98,7 +98,7 @@ function urlAttrConverter(parser = (value) => new URL(value)) {
|
|
|
98
98
|
try {
|
|
99
99
|
return parser(value);
|
|
100
100
|
} catch {
|
|
101
|
-
console.warn(`
|
|
101
|
+
console.warn(`[@iyulab/components] failed to parse a URL attribute — pass an absolute URL or one relative to the page: ${value}`);
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
104
|
},
|
package/dist/utilities/icons.js
CHANGED
|
@@ -213,7 +213,7 @@ var IconRegistry = class {
|
|
|
213
213
|
if ((this.generation.get(lib) ?? 0) === generation) IconCache.set(lib, name, svg);
|
|
214
214
|
return svg;
|
|
215
215
|
} catch (error) {
|
|
216
|
-
console.error(`[
|
|
216
|
+
console.error(`[@iyulab/components] IconRegistry: Failed to resolve icon '${key}' (will retry):`, error);
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
219
|
})();
|
package/package.json
CHANGED
|
@@ -73,6 +73,8 @@ inner `<button>`/`<a>` that actually takes focus: `aria-label`, and the button s
|
|
|
73
73
|
(menu button) and `aria-current` (the current page, step or item). `aria-pressed` is dropped on a link (`href`), where it is not allowed.
|
|
74
74
|
`aria-controls` is an id reference, which cannot cross the shadow boundary, so it is carried as an
|
|
75
75
|
element reference (`ariaControlsElements`) resolved when the button renders.
|
|
76
|
+
An empty state attribute counts as `"true"` — React 19 writes a boolean `true` on a custom element
|
|
77
|
+
as an empty attribute (`<UButton aria-expanded={open}>`), and an empty value is not valid ARIA.
|
|
76
78
|
|
|
77
79
|
```html
|
|
78
80
|
<u-button aria-expanded="false" aria-controls="details">Details</u-button>
|
|
@@ -93,6 +93,12 @@ activate the menu item, and the menu item's arrow-key navigation applies only wh
|
|
|
93
93
|
| `indicator` | `'highlight'\|'check'` | `'highlight'` | ✓ | Selection indicator |
|
|
94
94
|
| `align` | `'left'\|'center'\|'right'` | `'left'` | ✓ | Text alignment |
|
|
95
95
|
|
|
96
|
+
### Accessibility
|
|
97
|
+
|
|
98
|
+
An item with a submenu is named by its own label (the default slot) — not by its children's labels — and
|
|
99
|
+
carries `aria-haspopup="menu"` and `aria-expanded`; the submenu is a `role="menu"`. An `aria-label` you set on
|
|
100
|
+
the item wins.
|
|
101
|
+
|
|
96
102
|
### Events
|
|
97
103
|
|
|
98
104
|
| Event | Description |
|