@iyulab/components 1.49.1 → 1.51.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 +48 -0
- package/README.md +1 -1
- package/dist/components/UFormControlElement.d.ts +29 -2
- package/dist/components/UFormControlElement.js +31 -0
- package/dist/components/UFormControlElement.styles.js +1 -1
- package/dist/components/breadcrumb/UBreadcrumb.d.ts +5 -2
- package/dist/components/breadcrumb/UBreadcrumb.js +18 -21
- package/dist/components/button/UButton.d.ts +6 -0
- package/dist/components/button/UButton.js +16 -5
- package/dist/components/button/UButton.styles.js +1 -1
- package/dist/components/checkbox/UCheckbox.d.ts +8 -0
- package/dist/components/checkbox/UCheckbox.js +10 -2
- package/dist/components/checkbox/UCheckbox.styles.js +2 -2
- package/dist/components/date-picker/UDatePicker.js +5 -5
- package/dist/components/date-picker/UDatePicker.styles.js +4 -4
- package/dist/components/file-input/UFileInput.js +5 -5
- package/dist/components/input/UInput.js +5 -4
- package/dist/components/input/UInput.styles.js +14 -14
- package/dist/components/radio/URadio.js +7 -6
- package/dist/components/radio/URadio.styles.js +1 -1
- package/dist/components/rating/URating.js +7 -7
- package/dist/components/rating/URating.styles.js +1 -1
- package/dist/components/select/USelect.js +6 -6
- package/dist/components/select/USelect.styles.js +15 -15
- package/dist/components/slider/USlider.js +6 -6
- package/dist/components/switch/USwitch.d.ts +8 -0
- package/dist/components/switch/USwitch.js +10 -2
- package/dist/components/switch/USwitch.styles.js +2 -2
- package/dist/components/textarea/UTextarea.js +2 -2
- package/dist/components/textarea/UTextarea.styles.js +15 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/utilities/Dialog.js +2 -1
- package/dist/utilities/OverlayManager.js +2 -1
- package/dist/utilities/keyboard.d.ts +20 -0
- package/dist/utilities/keyboard.js +25 -0
- package/package.json +1 -1
- package/skills/iyulab-components/SKILL.md +1 -0
- package/skills/iyulab-components/references/usage.md +3 -1
- package/skills/iyulab-components/references/utilities/keyboard.md +27 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.51.0] - 2026-09-30
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `isImeComposing(event)` — whether a key event belongs to an IME composition (Korean, Japanese,
|
|
8
|
+
Chinese …). It checks `isComposing` and also `keyCode` 229, because Safari delivers the key that
|
|
9
|
+
confirms a composition after `compositionend` with `isComposing` false. Use it in any handler that
|
|
10
|
+
acts on Enter while the user types text.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **`Dialog.prompt` no longer confirms on the Enter that finishes an IME composition** — typing a
|
|
15
|
+
Korean name and pressing Enter closed the dialog before the last syllable was committed.
|
|
16
|
+
- `u-input` no longer submits its form on Safari's composition-confirming Enter (it already ignored
|
|
17
|
+
the Enter that Chrome and Firefox send while composing).
|
|
18
|
+
|
|
19
|
+
### Documentation
|
|
20
|
+
|
|
21
|
+
- README component list includes `u-expander`.
|
|
22
|
+
|
|
23
|
+
## [1.50.0] - 2026-09-29
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- `protected effectivelyDisabled` on the form control base class — `disabled` or disabled by an
|
|
28
|
+
ancestor `<fieldset>`. Subclasses that draw their own controls should read it instead of
|
|
29
|
+
`disabled`.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- **`form.reset()` now resets form controls.** A native form reset — including `u-button
|
|
34
|
+
type="reset"` — left every control as it was. Controls now implement the standard
|
|
35
|
+
`formResetCallback` and return to their default: the `value` attribute (`checked` for
|
|
36
|
+
`u-checkbox` and `u-switch`, taken when the control is first connected), or empty when there is
|
|
37
|
+
none, with validation marks cleared. A control's own `reset()` is unchanged: it empties that
|
|
38
|
+
control.
|
|
39
|
+
- **Form controls and `u-button` now follow a disabled `<fieldset>`.** Inside `<fieldset disabled>`
|
|
40
|
+
they were only left out of the submitted data: the inner input stayed enabled and focusable, the
|
|
41
|
+
control did not look disabled, and a `u-button type="submit"` still submitted the form. They now
|
|
42
|
+
implement the standard `formDisabledCallback` and behave exactly as with their own `disabled`
|
|
43
|
+
attribute. The `disabled` property itself is not changed, so a control disabled on its own stays
|
|
44
|
+
disabled when the fieldset is enabled again. Built-in disabled styles now use `:host(:disabled)`,
|
|
45
|
+
which matches both cases.
|
|
46
|
+
- `u-breadcrumb` with a custom `separator` slot rendered no separators at all. Separators are now
|
|
47
|
+
placed between the items whatever the order of the slotted elements, and follow later changes to
|
|
48
|
+
the separator slot. Separators are marked `aria-hidden`, so a text separator such as `/` is no
|
|
49
|
+
longer read out between items.
|
|
50
|
+
|
|
3
51
|
## [1.49.1] - 2026-09-28
|
|
4
52
|
|
|
5
53
|
### Fixed
|
package/README.md
CHANGED
|
@@ -100,7 +100,7 @@ npx skills add ./node_modules/@iyulab/components
|
|
|
100
100
|
|
|
101
101
|
**Navigation** — `u-menu`, `u-menu-item`, `u-tab-panel`, `u-breadcrumb`, `u-breadcrumb-item`, `u-tree`, `u-tree-item`
|
|
102
102
|
|
|
103
|
-
**Layout & Display** — `u-avatar`, `u-card`, `u-carousel`, `u-divider`, `u-icon`, `u-panel`, `u-split-panel`, `u-tag`, `u-text`
|
|
103
|
+
**Layout & Display** — `u-avatar`, `u-card`, `u-carousel`, `u-divider`, `u-expander`, `u-icon`, `u-panel`, `u-split-panel`, `u-tag`, `u-text`
|
|
104
104
|
|
|
105
105
|
## Theming
|
|
106
106
|
|
|
@@ -9,6 +9,17 @@ export declare abstract class UFormControlElement<T> extends UElement {
|
|
|
9
9
|
static formAssociated: boolean;
|
|
10
10
|
/** 비활성 상태 */
|
|
11
11
|
disabled: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* UA 가 알려 준 비활성 상태 — 조상 `<fieldset disabled>` 든 자기 `disabled` 속성이든(`formDisabledCallback`).
|
|
14
|
+
* ⚠사용자의 `disabled` 를 **덮어쓰지 않고** 따로 든다: 덮어쓰면 ⑴사용자가 준 값을 잃고 ⑵반영된
|
|
15
|
+
* `disabled` 속성이 스스로를 비활성으로 붙잡아 fieldset 을 다시 켜도 풀리지 않는다.
|
|
16
|
+
*/
|
|
17
|
+
private formDisabled;
|
|
18
|
+
/**
|
|
19
|
+
* 실제로 비활성인가 — 자기 `disabled` **또는** 조상 fieldset. 렌더·상호작용은 이것을 읽는다.
|
|
20
|
+
* 스타일은 같은 뜻의 표준 의사클래스 `:host(:disabled)` 를 쓴다(form-associated 요소는 둘 다에서 매칭된다).
|
|
21
|
+
*/
|
|
22
|
+
protected get effectivelyDisabled(): boolean;
|
|
12
23
|
/** 읽기 전용 상태 */
|
|
13
24
|
readonly: boolean;
|
|
14
25
|
/** 필수 입력 여부 */
|
|
@@ -61,6 +72,8 @@ export declare abstract class UFormControlElement<T> extends UElement {
|
|
|
61
72
|
* 네이티브와 동일하게 그 메시지가 다른 모든 검증 결과보다 우선한다.
|
|
62
73
|
*/
|
|
63
74
|
protected commit(flags: ValidityStateFlags, message: string, anchor?: HTMLElement): void;
|
|
75
|
+
/** form-associated 표준 콜백 — 조상 fieldset 의 비활성 상태가 바뀔 때 UA 가 부른다. */
|
|
76
|
+
formDisabledCallback(disabled: boolean): void;
|
|
64
77
|
connectedCallback(): void;
|
|
65
78
|
/**
|
|
66
79
|
* 호스트에 세팅된 `aria-label`/`aria-description` 은 접근성 트리에 노출되는 노드가 아니다 —
|
|
@@ -120,8 +133,22 @@ export declare abstract class UFormControlElement<T> extends UElement {
|
|
|
120
133
|
*/
|
|
121
134
|
validate(report?: boolean): boolean;
|
|
122
135
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
136
|
+
* **이 컨트롤 하나를** 비우고 검증 상태를 지운다(지우기 버튼이 쓰는 경로). 각 컴포넌트가 구현한다.
|
|
137
|
+
*
|
|
138
|
+
* ⚠«폼 초기화» 와 다르다 — 폼 단위 초기화는 두 경로 모두 **처음 값으로 되돌린다**:
|
|
139
|
+
* 네이티브 `form.reset()` 은 기본값(콘텐츠 속성, 아래 `formResetCallback`)으로,
|
|
140
|
+
* `u-form.reset()` 은 모델 스냅샷으로.
|
|
125
141
|
*/
|
|
126
142
|
abstract reset(): void;
|
|
143
|
+
/**
|
|
144
|
+
* form-associated 표준 콜백 — 소속 `<form>` 이 리셋될 때 UA 가 부른다. 네이티브 입력과 같이
|
|
145
|
+
* **기본값**(콘텐츠 속성)으로 되돌린다: 비운 뒤(`reset()`) 기본값을 다시 얹는다.
|
|
146
|
+
*/
|
|
147
|
+
formResetCallback(): void;
|
|
148
|
+
/**
|
|
149
|
+
* 기본값을 다시 얹는다. 기본은 `value` 콘텐츠 속성 — 속성이 없으면 비운 상태가 곧 기본값이다.
|
|
150
|
+
* 속성값은 그 컨트롤이 선언한 변환기를 거친다(`attributeChangedCallback` 경로 — 숫자·배열 값 컨트롤도 같다).
|
|
151
|
+
* 기본값이 다른 속성에 있는 컨트롤(체크형의 `checked`)은 덮어쓴다.
|
|
152
|
+
*/
|
|
153
|
+
protected restoreDefaults(): void;
|
|
127
154
|
}
|
|
@@ -12,6 +12,7 @@ var UFormControlElement = class extends UElement {
|
|
|
12
12
|
constructor(..._args) {
|
|
13
13
|
super(..._args);
|
|
14
14
|
this.disabled = false;
|
|
15
|
+
this.formDisabled = false;
|
|
15
16
|
this.readonly = false;
|
|
16
17
|
this.required = false;
|
|
17
18
|
this.invalid = false;
|
|
@@ -30,6 +31,13 @@ var UFormControlElement = class extends UElement {
|
|
|
30
31
|
this.formAssociated = true;
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
34
|
+
* 실제로 비활성인가 — 자기 `disabled` **또는** 조상 fieldset. 렌더·상호작용은 이것을 읽는다.
|
|
35
|
+
* 스타일은 같은 뜻의 표준 의사클래스 `:host(:disabled)` 를 쓴다(form-associated 요소는 둘 다에서 매칭된다).
|
|
36
|
+
*/
|
|
37
|
+
get effectivelyDisabled() {
|
|
38
|
+
return this.disabled || this.formDisabled;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
33
41
|
* 폼과의 연동을 위해 `form` 속성을 제공합니다. ElementInternals를 지원하는 브라우저에서 폼 요소에 접근할 수 있습니다.
|
|
34
42
|
* 지원하지 않는 브라우저에서는 null을 반환합니다.
|
|
35
43
|
*/
|
|
@@ -69,6 +77,12 @@ var UFormControlElement = class extends UElement {
|
|
|
69
77
|
if (this.customMessage) this.internals?.setValidity({ customError: true }, this.customMessage, anchor);
|
|
70
78
|
else this.internals?.setValidity(flags, message, anchor);
|
|
71
79
|
}
|
|
80
|
+
/** form-associated 표준 콜백 — 조상 fieldset 의 비활성 상태가 바뀔 때 UA 가 부른다. */
|
|
81
|
+
formDisabledCallback(disabled) {
|
|
82
|
+
const old = this.formDisabled;
|
|
83
|
+
this.formDisabled = disabled;
|
|
84
|
+
this.updateComplete.then(() => this.requestUpdate("formDisabled", old));
|
|
85
|
+
}
|
|
72
86
|
connectedCallback() {
|
|
73
87
|
super.connectedCallback();
|
|
74
88
|
if (!this.internals && "attachInternals" in this) this.internals = this.attachInternals();
|
|
@@ -149,6 +163,23 @@ var UFormControlElement = class extends UElement {
|
|
|
149
163
|
if (report) this.invalid = !valid;
|
|
150
164
|
return valid;
|
|
151
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* form-associated 표준 콜백 — 소속 `<form>` 이 리셋될 때 UA 가 부른다. 네이티브 입력과 같이
|
|
168
|
+
* **기본값**(콘텐츠 속성)으로 되돌린다: 비운 뒤(`reset()`) 기본값을 다시 얹는다.
|
|
169
|
+
*/
|
|
170
|
+
formResetCallback() {
|
|
171
|
+
this.reset();
|
|
172
|
+
this.restoreDefaults();
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* 기본값을 다시 얹는다. 기본은 `value` 콘텐츠 속성 — 속성이 없으면 비운 상태가 곧 기본값이다.
|
|
176
|
+
* 속성값은 그 컨트롤이 선언한 변환기를 거친다(`attributeChangedCallback` 경로 — 숫자·배열 값 컨트롤도 같다).
|
|
177
|
+
* 기본값이 다른 속성에 있는 컨트롤(체크형의 `checked`)은 덮어쓴다.
|
|
178
|
+
*/
|
|
179
|
+
restoreDefaults() {
|
|
180
|
+
const value = this.getAttribute("value");
|
|
181
|
+
if (value !== null) this.attributeChangedCallback("value", null, value);
|
|
182
|
+
}
|
|
152
183
|
};
|
|
153
184
|
__decorate([property({
|
|
154
185
|
type: Boolean,
|
|
@@ -12,9 +12,12 @@ export declare class UBreadcrumb extends UElement {
|
|
|
12
12
|
static styles: import('lit').CSSResultGroup[];
|
|
13
13
|
private separator?;
|
|
14
14
|
render(): import('lit-html').TemplateResult<1>;
|
|
15
|
-
private handleSlotChange;
|
|
16
15
|
private handleSeparatorSlotChange;
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* 항목 사이에 구분자를 놓는다. 항목은 **언제나 기본 슬롯의 배정 결과**에서 구한다 —
|
|
18
|
+
* 항목은 슬롯된 라이트 DOM 이라 섀도의 `nav` 자식을 훑으면 `<slot>` 하나만 나온다.
|
|
19
|
+
*/
|
|
20
|
+
private layout;
|
|
18
21
|
private createSeparator;
|
|
19
22
|
}
|
|
20
23
|
declare global {
|
|
@@ -9,16 +9,25 @@ import { customElement } from "lit/decorators.js";
|
|
|
9
9
|
var UBreadcrumb = class UBreadcrumb extends UElement {
|
|
10
10
|
constructor(..._args) {
|
|
11
11
|
super(..._args);
|
|
12
|
-
this.handleSlotChange = (e) => {
|
|
13
|
-
const items = e.target.assignedElements({ flatten: true }).filter((el) => el instanceof HTMLElement);
|
|
14
|
-
this.appendSeparator(items);
|
|
15
|
-
};
|
|
16
12
|
this.handleSeparatorSlotChange = (e) => {
|
|
17
13
|
const slot = e.target;
|
|
18
14
|
this.separator = slot.assignedNodes({ flatten: true }).at(0);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
this.layout();
|
|
16
|
+
};
|
|
17
|
+
this.layout = () => {
|
|
18
|
+
const nav = this.shadowRoot?.querySelector("nav");
|
|
19
|
+
const slot = nav?.querySelector("slot:not([name])");
|
|
20
|
+
if (!nav || !slot) return;
|
|
21
|
+
const items = slot.assignedElements({ flatten: true }).filter((el) => el instanceof HTMLElement);
|
|
22
|
+
nav.querySelectorAll(".separator").forEach((el) => el.remove());
|
|
23
|
+
items.forEach((item) => item.removeAttribute("data-last"));
|
|
24
|
+
items.forEach((item, i) => {
|
|
25
|
+
item.style.order = String(i * 2);
|
|
26
|
+
if (i < items.length - 1) {
|
|
27
|
+
const sep = this.createSeparator(i);
|
|
28
|
+
nav.appendChild(sep);
|
|
29
|
+
} else item.setAttribute("data-last", "");
|
|
30
|
+
});
|
|
22
31
|
};
|
|
23
32
|
}
|
|
24
33
|
static {
|
|
@@ -27,30 +36,18 @@ var UBreadcrumb = class UBreadcrumb extends UElement {
|
|
|
27
36
|
render() {
|
|
28
37
|
return html`
|
|
29
38
|
<nav aria-label=${Locale.getValue("breadcrumb")} part="nav">
|
|
30
|
-
<slot @slotchange=${this.
|
|
39
|
+
<slot @slotchange=${this.layout}></slot>
|
|
31
40
|
</nav>
|
|
32
41
|
<div hidden aria-hidden="true">
|
|
33
42
|
<slot name="separator" @slotchange=${this.handleSeparatorSlotChange}></slot>
|
|
34
43
|
</div>
|
|
35
44
|
`;
|
|
36
45
|
}
|
|
37
|
-
appendSeparator(items) {
|
|
38
|
-
const nav = this.shadowRoot?.querySelector("nav");
|
|
39
|
-
if (!nav) return;
|
|
40
|
-
nav.querySelectorAll(".separator").forEach((el) => el.remove());
|
|
41
|
-
items.forEach((item) => item.removeAttribute("data-last"));
|
|
42
|
-
items.forEach((item, i) => {
|
|
43
|
-
item.style.order = String(i * 2);
|
|
44
|
-
if (i < items.length - 1) {
|
|
45
|
-
const sep = this.createSeparator(i);
|
|
46
|
-
nav.appendChild(sep);
|
|
47
|
-
} else item.setAttribute("data-last", "");
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
46
|
createSeparator(index) {
|
|
51
47
|
const sep = document.createElement("span");
|
|
52
48
|
sep.setAttribute("class", "separator");
|
|
53
49
|
sep.setAttribute("part", "separator");
|
|
50
|
+
sep.setAttribute("aria-hidden", "true");
|
|
54
51
|
sep.style.order = String(index * 2 + 1);
|
|
55
52
|
if (this.separator) sep.appendChild(this.separator.cloneNode(true));
|
|
56
53
|
else {
|
|
@@ -77,6 +77,12 @@ export declare class UButton extends UElement {
|
|
|
77
77
|
rounded: boolean;
|
|
78
78
|
/** 비활성화 여부 */
|
|
79
79
|
disabled: boolean;
|
|
80
|
+
/** UA 가 알려 준 비활성 상태 — 폼 컨트롤 기반 클래스와 같은 계약(사용자 `disabled` 와 따로 든다). */
|
|
81
|
+
private formDisabled;
|
|
82
|
+
/** 자기 `disabled` 또는 조상 fieldset. */
|
|
83
|
+
protected get effectivelyDisabled(): boolean;
|
|
84
|
+
/** form-associated 표준 콜백 — 조상 fieldset 의 비활성 상태가 바뀔 때 UA 가 부른다. */
|
|
85
|
+
formDisabledCallback(disabled: boolean): void;
|
|
80
86
|
/** 로딩 상태 여부 */
|
|
81
87
|
loading: boolean;
|
|
82
88
|
/** 버튼 타입 */
|
|
@@ -15,10 +15,11 @@ var UButton = class UButton extends UElement {
|
|
|
15
15
|
this.size = "md";
|
|
16
16
|
this.rounded = false;
|
|
17
17
|
this.disabled = false;
|
|
18
|
+
this.formDisabled = false;
|
|
18
19
|
this.loading = false;
|
|
19
20
|
this.type = "button";
|
|
20
21
|
this.handleClick = (e) => {
|
|
21
|
-
if (this.
|
|
22
|
+
if (this.effectivelyDisabled || this.loading) {
|
|
22
23
|
e.preventDefault();
|
|
23
24
|
e.stopImmediatePropagation();
|
|
24
25
|
return;
|
|
@@ -43,6 +44,16 @@ var UButton = class UButton extends UElement {
|
|
|
43
44
|
delegatesFocus: true
|
|
44
45
|
};
|
|
45
46
|
}
|
|
47
|
+
/** 자기 `disabled` 또는 조상 fieldset. */
|
|
48
|
+
get effectivelyDisabled() {
|
|
49
|
+
return this.disabled || this.formDisabled;
|
|
50
|
+
}
|
|
51
|
+
/** form-associated 표준 콜백 — 조상 fieldset 의 비활성 상태가 바뀔 때 UA 가 부른다. */
|
|
52
|
+
formDisabledCallback(disabled) {
|
|
53
|
+
const old = this.formDisabled;
|
|
54
|
+
this.formDisabled = disabled;
|
|
55
|
+
this.updateComplete.then(() => this.requestUpdate("formDisabled", old));
|
|
56
|
+
}
|
|
46
57
|
set form(val) {
|
|
47
58
|
if (val) this.setAttribute("form", val);
|
|
48
59
|
else this.removeAttribute("form");
|
|
@@ -82,9 +93,9 @@ var UButton = class UButton extends UElement {
|
|
|
82
93
|
if (this.href) return html`
|
|
83
94
|
<a part="link"
|
|
84
95
|
aria-label=${ifDefined(ariaLabel)}
|
|
85
|
-
?disabled=${this.
|
|
86
|
-
tabindex=${this.
|
|
87
|
-
href=${ifDefined(this.
|
|
96
|
+
?disabled=${this.effectivelyDisabled || this.loading}
|
|
97
|
+
tabindex=${this.effectivelyDisabled || this.loading ? -1 : 0}
|
|
98
|
+
href=${ifDefined(this.effectivelyDisabled || this.loading ? void 0 : this.href)}
|
|
88
99
|
download=${ifDefined(this.download)}
|
|
89
100
|
target=${ifDefined(this.target)}
|
|
90
101
|
rel=${ifDefined(this.rel)}
|
|
@@ -97,7 +108,7 @@ var UButton = class UButton extends UElement {
|
|
|
97
108
|
<button part="button"
|
|
98
109
|
aria-label=${ifDefined(ariaLabel)}
|
|
99
110
|
type=${this.type}
|
|
100
|
-
?disabled=${this.
|
|
111
|
+
?disabled=${this.effectivelyDisabled || this.loading}
|
|
101
112
|
>
|
|
102
113
|
${this.renderContent()}
|
|
103
114
|
</button>
|
|
@@ -33,6 +33,14 @@ export declare class UCheckbox extends UFormControlElement<string> {
|
|
|
33
33
|
indeterminate: boolean;
|
|
34
34
|
/** 체크 여부 */
|
|
35
35
|
checked: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 네이티브 `defaultChecked` 에 해당하는 값 — **처음 연결될 때의 `checked` 속성**.
|
|
38
|
+
* `checked` 는 반영(reflect)되는 속성이라 사용자가 바꾸면 속성도 바뀐다. 그래서 속성을
|
|
39
|
+
* 리셋 시점에 읽으면 «현재» 가 나온다 — 기본값은 그 전에 붙잡아 둔다.
|
|
40
|
+
*/
|
|
41
|
+
private defaultChecked?;
|
|
42
|
+
connectedCallback(): void;
|
|
43
|
+
protected restoreDefaults(): void;
|
|
36
44
|
inputEl?: HTMLInputElement;
|
|
37
45
|
protected shouldValidate(changed: PropertyValues): boolean;
|
|
38
46
|
/** `checked`(또는 그 값을 함께 결정하는 `value`)가 바뀌는 모든 경로(초기 속성 설정 ·
|
|
@@ -18,7 +18,7 @@ var UCheckbox = class UCheckbox extends UFormControlElement {
|
|
|
18
18
|
this.checked = false;
|
|
19
19
|
this.handleInputChange = (e) => {
|
|
20
20
|
e.stopImmediatePropagation();
|
|
21
|
-
if (this.readonly || this.
|
|
21
|
+
if (this.readonly || this.effectivelyDisabled) return;
|
|
22
22
|
const input = e.target;
|
|
23
23
|
this.indeterminate = false;
|
|
24
24
|
this.checked = input.checked;
|
|
@@ -29,6 +29,14 @@ var UCheckbox = class UCheckbox extends UFormControlElement {
|
|
|
29
29
|
static {
|
|
30
30
|
this.styles = [super.styles, styles];
|
|
31
31
|
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
this.defaultChecked ??= this.hasAttribute("checked");
|
|
34
|
+
super.connectedCallback();
|
|
35
|
+
}
|
|
36
|
+
restoreDefaults() {
|
|
37
|
+
super.restoreDefaults();
|
|
38
|
+
this.checked = this.defaultChecked ?? false;
|
|
39
|
+
}
|
|
32
40
|
shouldValidate(changed) {
|
|
33
41
|
return super.shouldValidate(changed) || changed.has("checked");
|
|
34
42
|
}
|
|
@@ -45,7 +53,7 @@ var UCheckbox = class UCheckbox extends UFormControlElement {
|
|
|
45
53
|
<input part="input"
|
|
46
54
|
type="checkbox"
|
|
47
55
|
aria-label=${ifDefined(this.contentAriaLabel)}
|
|
48
|
-
?disabled=${this.
|
|
56
|
+
?disabled=${this.effectivelyDisabled || this.readonly}
|
|
49
57
|
?required=${this.required}
|
|
50
58
|
.checked=${live(this.checked)}
|
|
51
59
|
@change=${this.handleInputChange}
|
|
@@ -25,7 +25,7 @@ var styles = css`
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/* === 상태 스타일 === */
|
|
28
|
-
:host(
|
|
28
|
+
:host(:disabled) {
|
|
29
29
|
opacity: 0.6;
|
|
30
30
|
cursor: not-allowed;
|
|
31
31
|
}
|
|
@@ -42,7 +42,7 @@ var styles = css`
|
|
|
42
42
|
:host([indeterminate]) .checkbox u-icon {
|
|
43
43
|
transform: scale(1);
|
|
44
44
|
}
|
|
45
|
-
:host(:not(
|
|
45
|
+
:host(:not(:disabled):not([readonly]):hover) {
|
|
46
46
|
--checkbox-border-color: var(--u-input-border-color-hover, #BDBDBD);
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -192,16 +192,16 @@ var UDatePicker = class UDatePicker extends UFormControlElement {
|
|
|
192
192
|
return html`
|
|
193
193
|
<u-field part="field"
|
|
194
194
|
?required=${this.required}
|
|
195
|
-
?disabled=${this.
|
|
195
|
+
?disabled=${this.effectivelyDisabled}
|
|
196
196
|
?invalid=${this.invalid}
|
|
197
197
|
.label=${this.label}
|
|
198
198
|
.description=${this.description}
|
|
199
199
|
.validationMessage=${this.validationMessage}
|
|
200
200
|
>
|
|
201
201
|
<div class="container" part="container"
|
|
202
|
-
tabindex=${this.
|
|
202
|
+
tabindex=${this.effectivelyDisabled ? "-1" : "0"}
|
|
203
203
|
role="combobox"
|
|
204
|
-
aria-disabled=${ifDefined(this.
|
|
204
|
+
aria-disabled=${ifDefined(this.effectivelyDisabled ? "true" : void 0)}
|
|
205
205
|
aria-haspopup="dialog"
|
|
206
206
|
aria-expanded=${this.open}
|
|
207
207
|
aria-label=${ifDefined(this.resolvedAriaLabel)}
|
|
@@ -210,7 +210,7 @@ var UDatePicker = class UDatePicker extends UFormControlElement {
|
|
|
210
210
|
>
|
|
211
211
|
<span class="text-content ${!displayText ? "placeholder" : ""}">${displayText || this.placeholder || ""}</span>
|
|
212
212
|
<u-icon class="suffix-item"
|
|
213
|
-
?hidden=${!this.clearable || !this.value || this.
|
|
213
|
+
?hidden=${!this.clearable || !this.value || this.effectivelyDisabled || this.readonly}
|
|
214
214
|
role="button"
|
|
215
215
|
tabindex="0"
|
|
216
216
|
aria-label=${Locale.getValue("clear")}
|
|
@@ -388,7 +388,7 @@ var UDatePicker = class UDatePicker extends UFormControlElement {
|
|
|
388
388
|
* Tab 순서에서 빠지고 프로그램적 `.focus()`는 여전히 통과하므로, `UInput.focus()`가
|
|
389
389
|
* 네이티브 `disabled` `<input>`에서 얻는 것과 같은 no-op을 여기서 직접 재현한다. */
|
|
390
390
|
focus(options) {
|
|
391
|
-
if (this.
|
|
391
|
+
if (this.effectivelyDisabled) return;
|
|
392
392
|
this.containerEl?.focus(options);
|
|
393
393
|
}
|
|
394
394
|
blur() {
|
|
@@ -28,18 +28,18 @@ var styles = css`
|
|
|
28
28
|
box-shadow var(--u-duration-normal, 220ms) var(--u-ease-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
29
29
|
}
|
|
30
30
|
:host([readonly]) .container,
|
|
31
|
-
:host(
|
|
31
|
+
:host(:disabled) .container {
|
|
32
32
|
cursor: not-allowed;
|
|
33
33
|
border-color: var(--u-border-color-weak, #EEEEEE);
|
|
34
34
|
background-color: var(--u-bg-color-disabled, #FAFAFA);
|
|
35
35
|
}
|
|
36
|
-
:host(:not([readonly]):not(
|
|
36
|
+
:host(:not([readonly]):not(:disabled)) .container:hover {
|
|
37
37
|
box-shadow: 0 0 0 1px var(--u-input-border-color-hover, #BDBDBD);
|
|
38
38
|
}
|
|
39
|
-
:host(:not([readonly]):not(
|
|
39
|
+
:host(:not([readonly]):not(:disabled)) .container:focus-within {
|
|
40
40
|
box-shadow: 0 0 0 1px var(--u-input-border-color-focus, #1565C0);
|
|
41
41
|
}
|
|
42
|
-
:host([invalid]:not([readonly]):not(
|
|
42
|
+
:host([invalid]:not([readonly]):not(:disabled)) .container {
|
|
43
43
|
box-shadow: 0 0 0 1px var(--u-input-border-color-invalid, #C62828);
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -16,7 +16,7 @@ var UFileInput = class UFileInput extends UFormControlElement {
|
|
|
16
16
|
this.multiple = false;
|
|
17
17
|
this.handleTriggerClick = (e) => {
|
|
18
18
|
e.stopImmediatePropagation();
|
|
19
|
-
if (this.
|
|
19
|
+
if (this.effectivelyDisabled || this.readonly) return;
|
|
20
20
|
this.inputEl?.click();
|
|
21
21
|
};
|
|
22
22
|
this.handleInputChange = (e) => {
|
|
@@ -86,7 +86,7 @@ var UFileInput = class UFileInput extends UFormControlElement {
|
|
|
86
86
|
return html`
|
|
87
87
|
<u-field part="field"
|
|
88
88
|
?required=${this.required}
|
|
89
|
-
?disabled=${this.
|
|
89
|
+
?disabled=${this.effectivelyDisabled}
|
|
90
90
|
?invalid=${this.invalid}
|
|
91
91
|
.label=${this.label}
|
|
92
92
|
.description=${this.description}
|
|
@@ -96,14 +96,14 @@ var UFileInput = class UFileInput extends UFormControlElement {
|
|
|
96
96
|
<button class="trigger" part="trigger"
|
|
97
97
|
type="button"
|
|
98
98
|
aria-label=${ifDefined(this.triggerAriaLabel)}
|
|
99
|
-
?disabled=${this.
|
|
99
|
+
?disabled=${this.effectivelyDisabled || this.readonly}
|
|
100
100
|
@click=${this.handleTriggerClick}
|
|
101
101
|
>${Locale.getValue("chooseFile")}</button>
|
|
102
102
|
|
|
103
103
|
<span class="status" part="status" ?data-empty=${!hasFiles}>${status}</span>
|
|
104
104
|
|
|
105
105
|
<u-icon class="clear-btn" part="clear-button"
|
|
106
|
-
?hidden=${!hasFiles || this.
|
|
106
|
+
?hidden=${!hasFiles || this.effectivelyDisabled || this.readonly}
|
|
107
107
|
role="button"
|
|
108
108
|
tabindex="0"
|
|
109
109
|
aria-label=${Locale.getValue("clear")}
|
|
@@ -119,7 +119,7 @@ var UFileInput = class UFileInput extends UFormControlElement {
|
|
|
119
119
|
name=${ifDefined(this.name)}
|
|
120
120
|
accept=${ifDefined(this.accept)}
|
|
121
121
|
?multiple=${this.multiple}
|
|
122
|
-
?disabled=${this.
|
|
122
|
+
?disabled=${this.effectivelyDisabled || this.readonly}
|
|
123
123
|
@change=${this.handleInputChange}
|
|
124
124
|
/>
|
|
125
125
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
|
|
2
2
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
|
|
3
3
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
+
import { isImeComposing } from "../../utilities/keyboard.js";
|
|
4
5
|
import "../spinner/USpinner.js";
|
|
5
6
|
import "../icon/UIcon.js";
|
|
6
7
|
import { Locale } from "../../utilities/Locale.js";
|
|
@@ -165,14 +166,14 @@ var UInput = class UInput extends UFormControlElement {
|
|
|
165
166
|
super.disconnectedCallback();
|
|
166
167
|
}
|
|
167
168
|
render() {
|
|
168
|
-
const editable = !this.
|
|
169
|
+
const editable = !this.effectivelyDisabled && !this.readonly;
|
|
169
170
|
const showToggle = this.type === "password" && editable;
|
|
170
171
|
const showClear = this.clearable && editable && !!this.value;
|
|
171
172
|
const showStepper = this.type === "number" && editable;
|
|
172
173
|
return html`
|
|
173
174
|
<u-field part="field"
|
|
174
175
|
?required=${this.required}
|
|
175
|
-
?disabled=${this.
|
|
176
|
+
?disabled=${this.effectivelyDisabled}
|
|
176
177
|
?invalid=${this.invalid}
|
|
177
178
|
.label=${this.label}
|
|
178
179
|
.description=${this.description}
|
|
@@ -188,7 +189,7 @@ var UInput = class UInput extends UFormControlElement {
|
|
|
188
189
|
aria-description=${ifDefined(this.resolvedAriaDescription)}
|
|
189
190
|
name=${ifDefined(this.name)}
|
|
190
191
|
?required=${this.required}
|
|
191
|
-
?disabled=${this.
|
|
192
|
+
?disabled=${this.effectivelyDisabled}
|
|
192
193
|
?readonly=${this.readonly}
|
|
193
194
|
minlength=${ifDefined(this.minlength)}
|
|
194
195
|
maxlength=${ifDefined(this.maxlength)}
|
|
@@ -356,7 +357,7 @@ var UInput = class UInput extends UFormControlElement {
|
|
|
356
357
|
* 아니면 `requestSubmit()` 한다(검증도 그 안에서 돈다).
|
|
357
358
|
*/
|
|
358
359
|
handleImplicitSubmission(e) {
|
|
359
|
-
if (e
|
|
360
|
+
if (isImeComposing(e) || this.composing || e.shiftKey || e.ctrlKey || e.altKey || e.metaKey) return;
|
|
360
361
|
setTimeout(() => {
|
|
361
362
|
const form = this.form;
|
|
362
363
|
if (e.defaultPrevented || !form || !this.isConnected) return;
|
|
@@ -30,17 +30,17 @@ var styles = css`
|
|
|
30
30
|
overflow: hidden;
|
|
31
31
|
}
|
|
32
32
|
:host([readonly]) .container,
|
|
33
|
-
:host(
|
|
33
|
+
:host(:disabled) .container {
|
|
34
34
|
border-color: var(--u-border-color-weak, #EEEEEE);
|
|
35
35
|
background-color: var(--u-bg-color-disabled, #FAFAFA);
|
|
36
36
|
}
|
|
37
|
-
:host(:not([readonly]):not(
|
|
37
|
+
:host(:not([readonly]):not(:disabled)) .container:hover {
|
|
38
38
|
box-shadow: 0 0 0 1px var(--u-input-border-color-hover, #BDBDBD);
|
|
39
39
|
}
|
|
40
|
-
:host(:not([readonly]):not(
|
|
40
|
+
:host(:not([readonly]):not(:disabled)) .container:focus-within {
|
|
41
41
|
box-shadow: 0 0 0 1px var(--u-input-border-color-focus, #1565C0);
|
|
42
42
|
}
|
|
43
|
-
:host([invalid]:not([readonly]):not(
|
|
43
|
+
:host([invalid]:not([readonly]):not(:disabled)) .container {
|
|
44
44
|
box-shadow: 0 0 0 1px var(--u-input-border-color-invalid, #C62828);
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -52,20 +52,20 @@ var styles = css`
|
|
|
52
52
|
background-color: var(--u-neutral-200, #EEEEEE);
|
|
53
53
|
}
|
|
54
54
|
:host([variant="filled"][readonly]) .container,
|
|
55
|
-
:host([variant="filled"]
|
|
55
|
+
:host([variant="filled"]:disabled) .container {
|
|
56
56
|
background-color: var(--u-bg-color-disabled, #FAFAFA);
|
|
57
57
|
border-bottom-color: var(--u-border-color-weak, #EEEEEE);
|
|
58
58
|
}
|
|
59
|
-
:host([variant="filled"]:not([readonly]):not(
|
|
59
|
+
:host([variant="filled"]:not([readonly]):not(:disabled)) .container:hover {
|
|
60
60
|
box-shadow: none;
|
|
61
61
|
background-color: var(--u-neutral-300, #E0E0E0);
|
|
62
62
|
border-bottom-color: var(--u-input-border-color-hover, #BDBDBD);
|
|
63
63
|
}
|
|
64
|
-
:host([variant="filled"]:not([readonly]):not(
|
|
64
|
+
:host([variant="filled"]:not([readonly]):not(:disabled)) .container:focus-within {
|
|
65
65
|
box-shadow: none;
|
|
66
66
|
border-bottom-color: var(--u-input-border-color-focus, #1565C0);
|
|
67
67
|
}
|
|
68
|
-
:host([variant="filled"][invalid]:not([readonly]):not(
|
|
68
|
+
:host([variant="filled"][invalid]:not([readonly]):not(:disabled)) .container {
|
|
69
69
|
box-shadow: none;
|
|
70
70
|
border-bottom-color: var(--u-input-border-color-invalid, #C62828);
|
|
71
71
|
}
|
|
@@ -80,20 +80,20 @@ var styles = css`
|
|
|
80
80
|
background-color: transparent;
|
|
81
81
|
}
|
|
82
82
|
:host([variant="underlined"][readonly]) .container,
|
|
83
|
-
:host([variant="underlined"]
|
|
83
|
+
:host([variant="underlined"]:disabled) .container {
|
|
84
84
|
background-color: transparent;
|
|
85
85
|
border-bottom-color: var(--u-border-color-weak, #EEEEEE);
|
|
86
86
|
}
|
|
87
|
-
:host([variant="underlined"]:not([readonly]):not(
|
|
87
|
+
:host([variant="underlined"]:not([readonly]):not(:disabled)) .container:hover {
|
|
88
88
|
box-shadow: none;
|
|
89
89
|
border-bottom-color: var(--u-input-border-color-hover, #BDBDBD);
|
|
90
90
|
}
|
|
91
|
-
:host([variant="underlined"]:not([readonly]):not(
|
|
91
|
+
:host([variant="underlined"]:not([readonly]):not(:disabled)) .container:focus-within {
|
|
92
92
|
box-shadow: none;
|
|
93
93
|
border-bottom-color: var(--u-input-border-color-focus, #1565C0);
|
|
94
94
|
border-bottom-width: 2px;
|
|
95
95
|
}
|
|
96
|
-
:host([variant="underlined"][invalid]:not([readonly]):not(
|
|
96
|
+
:host([variant="underlined"][invalid]:not([readonly]):not(:disabled)) .container {
|
|
97
97
|
box-shadow: none;
|
|
98
98
|
border-bottom-color: var(--u-input-border-color-invalid, #C62828);
|
|
99
99
|
}
|
|
@@ -106,8 +106,8 @@ var styles = css`
|
|
|
106
106
|
padding: 0;
|
|
107
107
|
box-shadow: none;
|
|
108
108
|
}
|
|
109
|
-
:host([variant="borderless"]:not([readonly]):not(
|
|
110
|
-
:host([variant="borderless"]:not([readonly]):not(
|
|
109
|
+
:host([variant="borderless"]:not([readonly]):not(:disabled)) .container:hover,
|
|
110
|
+
:host([variant="borderless"]:not([readonly]):not(:disabled)) .container:focus-within {
|
|
111
111
|
box-shadow: none;
|
|
112
112
|
}
|
|
113
113
|
|