@iyulab/components 1.3.4 → 1.4.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 +20 -0
- package/dist/_virtual/_glob-assets_raw/dark.css.e8ac080d.js +1 -1
- package/dist/assets/locales/ar.json.js +23 -0
- package/dist/assets/locales/de.json.js +23 -0
- package/dist/assets/locales/en.json.js +23 -0
- package/dist/assets/locales/es.json.js +23 -0
- package/dist/assets/locales/fr.json.js +23 -0
- package/dist/assets/locales/id.json.js +23 -0
- package/dist/assets/locales/ja.json.js +23 -0
- package/dist/assets/locales/ko.json.js +23 -0
- package/dist/assets/locales/pt-BR.json.js +23 -0
- package/dist/assets/locales/ru.json.js +23 -0
- package/dist/assets/locales/th.json.js +23 -0
- package/dist/assets/locales/vi.json.js +23 -0
- package/dist/assets/locales/zh-CN.json.js +23 -0
- package/dist/assets/locales/zh-TW.json.js +23 -0
- package/dist/components/UFloatingElement.js +13 -4
- package/dist/components/UFormControlElement.d.ts +38 -8
- package/dist/components/UFormControlElement.js +61 -6
- package/dist/components/UOverlayElement.d.ts +4 -0
- package/dist/components/UOverlayElement.js +14 -4
- package/dist/components/alert/UAlert.js +10 -4
- package/dist/components/alert/UAlert.styles.js +0 -6
- package/dist/components/avatar/UAvatar.js +1 -1
- package/dist/components/badge/UBadge.d.ts +1 -1
- package/dist/components/badge/UBadge.js +2 -2
- package/dist/components/badge/UBadge.styles.js +1 -1
- package/dist/components/breadcrumb/UBreadcrumb.js +1 -1
- package/dist/components/breadcrumb-item/UBreadcrumbItem.js +1 -1
- package/dist/components/button/UButton.d.ts +6 -11
- package/dist/components/button/UButton.js +1 -1
- package/dist/components/button/UButton.styles.js +50 -51
- package/dist/components/button-group/UButtonGroup.js +1 -1
- package/dist/components/card/UCard.js +1 -1
- package/dist/components/carousel/UCarousel.js +2 -2
- package/dist/components/checkbox/UCheckbox.d.ts +4 -1
- package/dist/components/checkbox/UCheckbox.js +11 -8
- package/dist/components/checkbox/UCheckbox.styles.js +12 -7
- package/dist/components/chip/UChip.js +6 -3
- package/dist/components/dialog/UDialog.js +2 -2
- package/dist/components/divider/UDivider.js +1 -1
- package/dist/components/drawer/UDrawer.js +2 -2
- package/dist/components/drawer/UDrawer.styles.js +0 -6
- package/dist/components/field/UField.js +1 -1
- package/dist/components/form/UForm.js +1 -1
- package/dist/components/icon/UIcon.js +1 -1
- package/dist/components/icon-button/UIconButton.d.ts +0 -1
- package/dist/components/icon-button/UIconButton.js +2 -7
- package/dist/components/input/UInput.d.ts +2 -3
- package/dist/components/input/UInput.js +37 -9
- package/dist/components/input/UInput.styles.js +1 -4
- package/dist/components/menu/UMenu.js +1 -1
- package/dist/components/menu-item/UMenuItem.js +1 -1
- package/dist/components/menu-item/UMenuItem.styles.js +4 -3
- package/dist/components/option/UOption.d.ts +4 -1
- package/dist/components/option/UOption.js +10 -4
- package/dist/components/option/UOption.styles.js +5 -4
- package/dist/components/panel/UPanel.js +1 -1
- package/dist/components/popover/UPopover.js +1 -1
- package/dist/components/progress-bar/UProgressBar.js +1 -1
- package/dist/components/progress-bar/UProgressBar.styles.js +2 -2
- package/dist/components/progress-ring/UProgressRing.js +1 -1
- package/dist/components/progress-ring/UProgressRing.styles.js +2 -2
- package/dist/components/radio/URadio.d.ts +1 -1
- package/dist/components/radio/URadio.js +5 -6
- package/dist/components/radio/URadio.styles.js +21 -16
- package/dist/components/rating/URating.d.ts +3 -2
- package/dist/components/rating/URating.js +30 -37
- package/dist/components/select/USelect.d.ts +8 -5
- package/dist/components/select/USelect.js +29 -41
- package/dist/components/select/USelect.styles.js +5 -5
- package/dist/components/skeleton/USkeleton.js +1 -1
- package/dist/components/slider/USlider.d.ts +3 -2
- package/dist/components/slider/USlider.js +20 -30
- package/dist/components/slider/USlider.styles.js +2 -2
- package/dist/components/spinner/USpinner.js +1 -1
- package/dist/components/spinner/USpinner.styles.js +1 -1
- package/dist/components/split-panel/USplitPanel.js +25 -13
- package/dist/components/switch/USwitch.d.ts +4 -1
- package/dist/components/switch/USwitch.js +11 -8
- package/dist/components/switch/USwitch.styles.js +5 -1
- package/dist/components/tab/UTab.js +6 -3
- package/dist/components/tab-panel/UTabPanel.d.ts +5 -0
- package/dist/components/tab-panel/UTabPanel.js +12 -4
- package/dist/components/tab-panel/UTabPanel.styles.js +7 -3
- package/dist/components/tag/UTag.js +1 -1
- package/dist/components/tag/UTag.styles.js +14 -13
- package/dist/components/textarea/UTextarea.d.ts +1 -1
- package/dist/components/textarea/UTextarea.js +17 -6
- package/dist/components/tooltip/UTooltip.js +1 -1
- package/dist/components/tree/UTree.js +1 -1
- package/dist/components/tree-item/UTreeItem.js +10 -4
- package/dist/components/tree-item/UTreeItem.styles.js +5 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +6 -8
- package/dist/react/UTabPanel.d.ts +1 -0
- package/dist/react/UTabPanel.js +3 -1
- package/dist/styles/dark.css +99 -99
- package/dist/utilities/Locale.d.ts +38 -0
- package/dist/utilities/Locale.js +93 -0
- package/dist/utilities/Toast.d.ts +9 -0
- package/dist/utilities/Toast.js +15 -7
- package/dist/utilities/elements.d.ts +0 -23
- package/dist/utilities/elements.js +1 -34
- package/package.json +2 -3
- package/skills/iyulab-components/SKILL.md +2 -3
- package/skills/iyulab-components/references/components/input.md +1 -2
- package/skills/iyulab-components/references/components/option.md +1 -0
- package/skills/iyulab-components/references/components/select.md +1 -2
- package/skills/iyulab-components/references/components/tab-panel.md +6 -0
- package/skills/iyulab-components/references/extensions/form-control.md +22 -6
- package/skills/iyulab-components/references/usage.md +11 -0
- package/skills/iyulab-components/references/utilities/elements.md +1 -17
- package/skills/iyulab-components/references/utilities/locale.md +36 -0
- package/skills/iyulab-components/references/utilities/theme.md +12 -0
- package/skills/iyulab-components/references/utilities/toast.md +6 -0
- package/dist/components/UDataElement.d.ts +0 -44
- package/dist/components/UDataElement.js +0 -101
- package/dist/components/UDataElement.styles.d.ts +0 -1
- package/dist/components/UDataElement.styles.js +0 -95
- package/dist/core/locale.d.ts +0 -69
- package/dist/core/locale.js +0 -85
- package/dist/utilities/sanitizers.d.ts +0 -35
- package/dist/utilities/sanitizers.js +0 -75
- package/skills/iyulab-components/references/extensions/data.md +0 -60
- package/skills/iyulab-components/references/utilities/sanitizers.md +0 -32
|
@@ -2,8 +2,8 @@ import { UElement } from "../UElement.js";
|
|
|
2
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
4
4
|
import { styles } from "./UField.styles.js";
|
|
5
|
-
import { customElement, property } from "lit/decorators.js";
|
|
6
5
|
import { html, nothing } from "lit";
|
|
6
|
+
import { customElement, property } from "lit/decorators.js";
|
|
7
7
|
import { isFocusable } from "tabbable";
|
|
8
8
|
//#region src/components/field/UField.ts
|
|
9
9
|
var UField = class UField extends UElement {
|
|
@@ -4,8 +4,8 @@ import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm
|
|
|
4
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
5
5
|
import { arrayAttrConverter } from "../../utilities/converters.js";
|
|
6
6
|
import { styles } from "./UForm.styles.js";
|
|
7
|
-
import { customElement, property } from "lit/decorators.js";
|
|
8
7
|
import { html } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
9
|
//#region src/components/form/UForm.ts
|
|
10
10
|
var UForm = class UForm extends UElement {
|
|
11
11
|
constructor(..._args) {
|
|
@@ -3,8 +3,8 @@ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/hel
|
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
4
4
|
import { IconRegistry, getDefaultBaseUrl } from "../../utilities/icons.js";
|
|
5
5
|
import { styles } from "./UIcon.styles.js";
|
|
6
|
-
import { customElement, property } from "lit/decorators.js";
|
|
7
6
|
import { nothing } from "lit";
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
8
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
9
9
|
import { until } from "lit/directives/until.js";
|
|
10
10
|
//#region src/components/icon/UIcon.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { UElement } from "../UElement.js";
|
|
2
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
4
|
-
import "../icon/UIcon.js";
|
|
5
4
|
import "../button/UButton.js";
|
|
5
|
+
import "../icon/UIcon.js";
|
|
6
6
|
import "../tooltip/UTooltip.js";
|
|
7
7
|
import { styles } from "./UIconButton.styles.js";
|
|
8
|
-
import { customElement, property } from "lit/decorators.js";
|
|
9
8
|
import { html } from "lit";
|
|
9
|
+
import { customElement, property } from "lit/decorators.js";
|
|
10
10
|
//#region src/components/icon-button/UIconButton.ts
|
|
11
11
|
var UIconButton = class UIconButton extends UElement {
|
|
12
12
|
constructor(..._args) {
|
|
@@ -42,16 +42,11 @@ var UIconButton = class UIconButton extends UElement {
|
|
|
42
42
|
<u-tooltip part="tooltip"
|
|
43
43
|
.placement=${this.tooltipPlacement}
|
|
44
44
|
.offset=${this.tooltipOffset}
|
|
45
|
-
@show=${this.handleStopTooltipEvent}
|
|
46
|
-
@hide=${this.handleStopTooltipEvent}
|
|
47
45
|
>
|
|
48
46
|
<slot></slot>
|
|
49
47
|
</u-tooltip>
|
|
50
48
|
`;
|
|
51
49
|
}
|
|
52
|
-
handleStopTooltipEvent(e) {
|
|
53
|
-
e.stopImmediatePropagation();
|
|
54
|
-
}
|
|
55
50
|
};
|
|
56
51
|
__decorate([property({
|
|
57
52
|
type: String,
|
|
@@ -19,8 +19,7 @@ export type InputVariant = 'outlined' | 'filled' | 'underlined' | 'borderless';
|
|
|
19
19
|
* @csspart input - 네이티브 input 요소
|
|
20
20
|
* @csspart popover - 드롭다운 팝오버 요소
|
|
21
21
|
*
|
|
22
|
-
* @cssprop --input-popover-
|
|
23
|
-
* @cssprop --input-popover-max-width - 드롭다운 팝오버의 최대 너비 (기본값: 80vw)
|
|
22
|
+
* @cssprop --input-popover-width - 드롭다운 팝오버의 너비 (기본값: 앵커(트리거) 너비)
|
|
24
23
|
* @cssprop --input-popover-min-height - 드롭다운 팝오버의 최소 높이 (기본값: 0px)
|
|
25
24
|
* @cssprop --input-popover-max-height - 드롭다운 팝오버의 최대 높이 (기본값: 50vh)
|
|
26
25
|
*
|
|
@@ -74,7 +73,7 @@ export declare class UInput extends UFormControlElement<string> {
|
|
|
74
73
|
private options;
|
|
75
74
|
disconnectedCallback(): void;
|
|
76
75
|
render(): import('lit-html').TemplateResult<1>;
|
|
77
|
-
|
|
76
|
+
protected setValidity(): void;
|
|
78
77
|
reset(): void;
|
|
79
78
|
focus(options?: FocusOptions): void;
|
|
80
79
|
blur(): void;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
|
|
2
2
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
3
3
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
-
import "../icon/UIcon.js";
|
|
5
4
|
import "../spinner/USpinner.js";
|
|
5
|
+
import "../icon/UIcon.js";
|
|
6
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
6
7
|
import "../field/UField.js";
|
|
7
8
|
import { UOption } from "../option/UOption.js";
|
|
8
9
|
import { UPopover } from "../popover/UPopover.js";
|
|
9
10
|
import { styles } from "./UInput.styles.js";
|
|
10
|
-
import { customElement, property, query, state } from "lit/decorators.js";
|
|
11
11
|
import { html } from "lit";
|
|
12
|
+
import { customElement, property, query, state } from "lit/decorators.js";
|
|
12
13
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
13
14
|
import { live } from "lit/directives/live.js";
|
|
14
15
|
//#region src/components/input/UInput.ts
|
|
@@ -53,7 +54,6 @@ var UInput = class UInput extends UFormControlElement {
|
|
|
53
54
|
this.handleInputBlur = (_) => {
|
|
54
55
|
this.value = this.inputEl?.value || "";
|
|
55
56
|
this.internals?.setFormValue(this.value);
|
|
56
|
-
this.internals?.setValidity(this.inputEl?.validity, this.validationMessage || this.inputEl?.validationMessage, this.containerEl);
|
|
57
57
|
if (!this.novalidate) this.validate();
|
|
58
58
|
this.dispatchEvent(new Event("change", {
|
|
59
59
|
bubbles: true,
|
|
@@ -119,11 +119,9 @@ var UInput = class UInput extends UFormControlElement {
|
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
this.handlePopoverShow = (e) => {
|
|
122
|
-
e.stopPropagation();
|
|
123
122
|
if (this.options.length === 0) e.preventDefault();
|
|
124
123
|
};
|
|
125
124
|
this.handlePopoverHide = (e) => {
|
|
126
|
-
e.stopPropagation();
|
|
127
125
|
if (this.options.length === 0) e.preventDefault();
|
|
128
126
|
};
|
|
129
127
|
}
|
|
@@ -201,6 +199,7 @@ var UInput = class UInput extends UFormControlElement {
|
|
|
201
199
|
scrollable
|
|
202
200
|
for=".container"
|
|
203
201
|
trigger="focus"
|
|
202
|
+
strategy="fixed"
|
|
204
203
|
placement="bottom-start"
|
|
205
204
|
offset="1"
|
|
206
205
|
@show=${this.handlePopoverShow}
|
|
@@ -210,10 +209,39 @@ var UInput = class UInput extends UFormControlElement {
|
|
|
210
209
|
</u-popover>
|
|
211
210
|
`;
|
|
212
211
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
setValidity() {
|
|
213
|
+
const v = this.inputEl?.validity;
|
|
214
|
+
let flags = {};
|
|
215
|
+
let message = "";
|
|
216
|
+
if (v?.valueMissing) {
|
|
217
|
+
flags = { valueMissing: true };
|
|
218
|
+
message = Locale.getValue("valueMissing");
|
|
219
|
+
} else if (v?.badInput) {
|
|
220
|
+
flags = { badInput: true };
|
|
221
|
+
message = Locale.getValue("badInput");
|
|
222
|
+
} else if (v?.typeMismatch) {
|
|
223
|
+
flags = { typeMismatch: true };
|
|
224
|
+
message = Locale.getValue("typeMismatch");
|
|
225
|
+
} else if (v?.patternMismatch) {
|
|
226
|
+
flags = { patternMismatch: true };
|
|
227
|
+
message = Locale.getValue("patternMismatch", { pattern: this.pattern ?? "" });
|
|
228
|
+
} else if (v?.tooShort) {
|
|
229
|
+
flags = { tooShort: true };
|
|
230
|
+
message = Locale.getValue("tooShort", { min: this.minlength ?? 0 });
|
|
231
|
+
} else if (v?.tooLong) {
|
|
232
|
+
flags = { tooLong: true };
|
|
233
|
+
message = Locale.getValue("tooLong", { max: this.maxlength ?? 0 });
|
|
234
|
+
} else if (v?.rangeUnderflow) {
|
|
235
|
+
flags = { rangeUnderflow: true };
|
|
236
|
+
message = Locale.getValue("rangeUnderflow", { min: this.min ?? "" });
|
|
237
|
+
} else if (v?.rangeOverflow) {
|
|
238
|
+
flags = { rangeOverflow: true };
|
|
239
|
+
message = Locale.getValue("rangeOverflow", { max: this.max ?? "" });
|
|
240
|
+
} else if (v?.stepMismatch) {
|
|
241
|
+
flags = { stepMismatch: true };
|
|
242
|
+
message = Locale.getValue("stepMismatch", { step: this.step ?? 1 });
|
|
243
|
+
}
|
|
244
|
+
this.commit(flags, message, this.containerEl ?? void 0);
|
|
217
245
|
}
|
|
218
246
|
reset() {
|
|
219
247
|
this.value = "";
|
|
@@ -2,8 +2,6 @@ import { css } from "lit";
|
|
|
2
2
|
//#region src/components/input/UInput.styles.ts
|
|
3
3
|
var styles = css`
|
|
4
4
|
:host {
|
|
5
|
-
--input-popover-min-width: 100%;
|
|
6
|
-
--input-popover-max-width: 80vw;
|
|
7
5
|
--input-popover-min-height: 0px;
|
|
8
6
|
--input-popover-max-height: 50vh;
|
|
9
7
|
}
|
|
@@ -167,8 +165,7 @@ var styles = css`
|
|
|
167
165
|
}
|
|
168
166
|
|
|
169
167
|
u-popover {
|
|
170
|
-
|
|
171
|
-
max-width: var(--input-popover-max-width);
|
|
168
|
+
width: var(--input-popover-width, var(--anchor-width, 100%));
|
|
172
169
|
min-height: var(--input-popover-min-height);
|
|
173
170
|
max-height: var(--input-popover-max-height);
|
|
174
171
|
padding: 4px;
|
|
@@ -3,8 +3,8 @@ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/hel
|
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
4
4
|
import { UMenuItem } from "../menu-item/UMenuItem.js";
|
|
5
5
|
import { styles } from "./UMenu.styles.js";
|
|
6
|
-
import { customElement, property } from "lit/decorators.js";
|
|
7
6
|
import { html } from "lit";
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
8
|
//#region src/components/menu/UMenu.ts
|
|
9
9
|
var UMenu = class UMenu extends UElement {
|
|
10
10
|
constructor(..._args) {
|
|
@@ -5,8 +5,8 @@ import "../icon/UIcon.js";
|
|
|
5
5
|
import { UDivider } from "../divider/UDivider.js";
|
|
6
6
|
import "../popover/UPopover.js";
|
|
7
7
|
import { styles } from "./UMenuItem.styles.js";
|
|
8
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
9
8
|
import { html } from "lit";
|
|
9
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
10
10
|
import { live } from "lit/directives/live.js";
|
|
11
11
|
//#region src/components/menu-item/UMenuItem.ts
|
|
12
12
|
var _UMenuItem;
|
|
@@ -3,6 +3,7 @@ import { css } from "lit";
|
|
|
3
3
|
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
--menu-item-depth: 0;
|
|
6
|
+
--menu-item-color: var(--u-primary-color, var(--u-blue-600));
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
:host {
|
|
@@ -49,12 +50,12 @@ var styles = css`
|
|
|
49
50
|
/* indicator: highlight */
|
|
50
51
|
:host([selected][indicator="highlight"]) .header {
|
|
51
52
|
font-weight: 600;
|
|
52
|
-
color: var(--
|
|
53
|
-
background-color: var(--u-
|
|
53
|
+
color: color-mix(in srgb, var(--menu-item-color) 85%, black);
|
|
54
|
+
background-color: color-mix(in srgb, var(--menu-item-color) 15%, var(--u-bg-color));
|
|
54
55
|
}
|
|
55
56
|
:host([selected][indicator="highlight"]) .header:hover,
|
|
56
57
|
:host([selected][indicator="highlight"]:focus-visible) .header {
|
|
57
|
-
background-color: var(--u-
|
|
58
|
+
background-color: color-mix(in srgb, var(--menu-item-color) 25%, var(--u-bg-color));
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
.prefix-checker {
|
|
@@ -32,8 +32,11 @@ export declare class UOption extends UElement {
|
|
|
32
32
|
value: string;
|
|
33
33
|
connectedCallback(): void;
|
|
34
34
|
render(): import('lit-html').TemplateResult<1>;
|
|
35
|
-
getText(): string;
|
|
36
35
|
private renderMarker;
|
|
36
|
+
/** 라벨(기본 slot)의 텍스트 노드만 추출한다 — 엘리먼트 자식(예: 설명용 `<p>`)은 제외. */
|
|
37
|
+
getText(): string;
|
|
38
|
+
/** 라벨(기본 slot) 노드를 clone해서 반환한다 — 원본은 옵션 목록에 계속 slot돼 있어야 하므로. */
|
|
39
|
+
getContent(): Node[];
|
|
37
40
|
}
|
|
38
41
|
declare global {
|
|
39
42
|
interface HTMLElementTagNameMap {
|
|
@@ -3,8 +3,8 @@ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/hel
|
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
4
4
|
import "../icon/UIcon.js";
|
|
5
5
|
import { styles } from "./UOption.styles.js";
|
|
6
|
-
import { customElement, property } from "lit/decorators.js";
|
|
7
6
|
import { html, nothing } from "lit";
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
8
|
//#region src/components/option/UOption.ts
|
|
9
9
|
var UOption = class UOption extends UElement {
|
|
10
10
|
constructor(..._args) {
|
|
@@ -31,9 +31,6 @@ var UOption = class UOption extends UElement {
|
|
|
31
31
|
<slot name="suffix"></slot>
|
|
32
32
|
`;
|
|
33
33
|
}
|
|
34
|
-
getText() {
|
|
35
|
-
return this.renderRoot.querySelector("slot:not([name])")?.assignedNodes({ flatten: true }).map((n) => n.textContent?.trim()).filter(Boolean).join("") || this.value;
|
|
36
|
-
}
|
|
37
34
|
renderMarker() {
|
|
38
35
|
if (this.marker === "radio") return html`<span class="radio-marker" part="radio-marker"></span>`;
|
|
39
36
|
if (this.marker === "check") return html`
|
|
@@ -45,6 +42,15 @@ var UOption = class UOption extends UElement {
|
|
|
45
42
|
`;
|
|
46
43
|
return nothing;
|
|
47
44
|
}
|
|
45
|
+
/** 라벨(기본 slot)의 텍스트 노드만 추출한다 — 엘리먼트 자식(예: 설명용 `<p>`)은 제외. */
|
|
46
|
+
getText() {
|
|
47
|
+
return this.renderRoot.querySelector("slot:not([name])")?.assignedNodes({ flatten: true }).filter((n) => n.nodeType === Node.TEXT_NODE).map((n) => n.textContent ?? "").join("").replace(/\s+/g, " ").trim() || this.value;
|
|
48
|
+
}
|
|
49
|
+
/** 라벨(기본 slot) 노드를 clone해서 반환한다 — 원본은 옵션 목록에 계속 slot돼 있어야 하므로. */
|
|
50
|
+
getContent() {
|
|
51
|
+
const nodes = this.renderRoot.querySelector("slot:not([name])")?.assignedNodes({ flatten: true }).map((n) => n.cloneNode(true)) ?? [];
|
|
52
|
+
return nodes.length > 0 ? nodes : [document.createTextNode(this.value)];
|
|
53
|
+
}
|
|
48
54
|
};
|
|
49
55
|
__decorate([property({
|
|
50
56
|
type: Boolean,
|
|
@@ -2,17 +2,18 @@ import { css } from "lit";
|
|
|
2
2
|
//#region src/components/option/UOption.styles.ts
|
|
3
3
|
var styles = css`
|
|
4
4
|
:host {
|
|
5
|
+
--option-color: var(--u-primary-color, var(--u-blue-600));
|
|
5
6
|
--option-color-interactive: inherit;
|
|
6
7
|
--option-border-color-interactive: var(--u-border-color-hover);
|
|
7
8
|
--option-background-color-interactive: var(--u-bg-color-hover);
|
|
8
9
|
|
|
9
10
|
--option-color-active: inherit;
|
|
10
|
-
--option-border-color-active: var(--
|
|
11
|
-
--option-background-color-active: var(--u-
|
|
11
|
+
--option-border-color-active: var(--option-color);
|
|
12
|
+
--option-background-color-active: color-mix(in srgb, var(--option-color) 15%, var(--u-bg-color));
|
|
12
13
|
|
|
13
14
|
--option-color-active-interactive: inherit;
|
|
14
|
-
--option-border-color-active-interactive: var(--
|
|
15
|
-
--option-background-color-active-interactive: var(--u-
|
|
15
|
+
--option-border-color-active-interactive: var(--option-color);
|
|
16
|
+
--option-background-color-active-interactive: color-mix(in srgb, var(--option-color) 25%, var(--u-bg-color));
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
:host {
|
|
@@ -2,8 +2,8 @@ import { UElement } from "../UElement.js";
|
|
|
2
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
4
4
|
import { styles } from "./UPanel.styles.js";
|
|
5
|
-
import { customElement, property } from "lit/decorators.js";
|
|
6
5
|
import { html } from "lit";
|
|
6
|
+
import { customElement, property } from "lit/decorators.js";
|
|
7
7
|
//#region src/components/panel/UPanel.ts
|
|
8
8
|
var UPanel = class UPanel extends UElement {
|
|
9
9
|
constructor(..._args) {
|
|
@@ -3,8 +3,8 @@ import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm
|
|
|
3
3
|
import { UFloatingElement } from "../UFloatingElement.js";
|
|
4
4
|
import { arrayAttrConverter } from "../../utilities/converters.js";
|
|
5
5
|
import { styles } from "./UPopover.styles.js";
|
|
6
|
-
import { customElement, property } from "lit/decorators.js";
|
|
7
6
|
import { html } from "lit";
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
8
|
//#region src/components/popover/UPopover.ts
|
|
9
9
|
var _UPopover;
|
|
10
10
|
var UPopover = class UPopover extends UFloatingElement {
|
|
@@ -2,8 +2,8 @@ import { UElement } from "../UElement.js";
|
|
|
2
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
4
4
|
import { styles } from "./UProgressBar.styles.js";
|
|
5
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
6
5
|
import { html } from "lit";
|
|
6
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
7
7
|
//#region src/components/progress-bar/UProgressBar.ts
|
|
8
8
|
var UProgressBar = class UProgressBar extends UElement {
|
|
9
9
|
constructor(..._args) {
|
|
@@ -3,8 +3,8 @@ import { css } from "lit";
|
|
|
3
3
|
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
--progress-bar-height: 0.5em;
|
|
6
|
-
--progress-bar-color: var(--u-blue-600);
|
|
7
|
-
--progress-bar-buffer-color: var(--u-
|
|
6
|
+
--progress-bar-color: var(--u-primary-color, var(--u-blue-600));
|
|
7
|
+
--progress-bar-buffer-color: color-mix(in srgb, var(--progress-bar-color) 35%, var(--u-bg-color));
|
|
8
8
|
--progress-bar-track-color: var(--u-neutral-200);
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -2,8 +2,8 @@ import { UElement } from "../UElement.js";
|
|
|
2
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
|
|
3
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
4
4
|
import { styles } from "./UProgressRing.styles.js";
|
|
5
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
6
5
|
import { html } from "lit";
|
|
6
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
7
7
|
//#region src/components/progress-ring/UProgressRing.ts
|
|
8
8
|
var PATH_LENGTH = 100;
|
|
9
9
|
var RADIUS = 44;
|
|
@@ -3,10 +3,10 @@ import { css } from "lit";
|
|
|
3
3
|
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
--progress-ring-size: 6em;
|
|
6
|
-
--progress-ring-color: var(--u-blue-600);
|
|
6
|
+
--progress-ring-color: var(--u-primary-color, var(--u-blue-600));
|
|
7
7
|
--progress-ring-track-width: 6;
|
|
8
8
|
--progress-ring-track-color: var(--u-neutral-200);
|
|
9
|
-
--progress-ring-buffer-color: var(--u-
|
|
9
|
+
--progress-ring-buffer-color: color-mix(in srgb, var(--progress-ring-color) 35%, var(--u-bg-color));
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/* === Status Colors === */
|
|
@@ -25,7 +25,7 @@ export declare class URadio extends UFormControlElement<string> {
|
|
|
25
25
|
disconnectedCallback(): void;
|
|
26
26
|
protected updated(changedProperties: PropertyValues): void;
|
|
27
27
|
render(): import('lit-html').TemplateResult<1>;
|
|
28
|
-
|
|
28
|
+
protected setValidity(): void;
|
|
29
29
|
reset(): void;
|
|
30
30
|
private setup;
|
|
31
31
|
private cleanup;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
|
|
2
2
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
3
3
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
4
5
|
import "../field/UField.js";
|
|
5
6
|
import { UOption } from "../option/UOption.js";
|
|
6
7
|
import { styles } from "./URadio.styles.js";
|
|
7
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
8
8
|
import { html } from "lit";
|
|
9
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
9
10
|
//#region src/components/radio/URadio.ts
|
|
10
11
|
var URadio = class URadio extends UFormControlElement {
|
|
11
12
|
constructor(..._args) {
|
|
@@ -94,10 +95,9 @@ var URadio = class URadio extends UFormControlElement {
|
|
|
94
95
|
</u-field>
|
|
95
96
|
`;
|
|
96
97
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return !this.invalid;
|
|
98
|
+
setValidity() {
|
|
99
|
+
const missing = this.required && !this.value;
|
|
100
|
+
this.commit(missing ? { valueMissing: true } : {}, missing ? Locale.getValue("valueMissing") : "", this);
|
|
101
101
|
}
|
|
102
102
|
reset() {
|
|
103
103
|
this.value = void 0;
|
|
@@ -125,7 +125,6 @@ var URadio = class URadio extends UFormControlElement {
|
|
|
125
125
|
option.selected = option.value === this.value;
|
|
126
126
|
});
|
|
127
127
|
this.internals?.setFormValue(this.value || "");
|
|
128
|
-
this.internals?.setValidity(this.required && !this.value ? { valueMissing: true } : {}, this.validationMessage || "", this);
|
|
129
128
|
if (!this.novalidate) this.validate();
|
|
130
129
|
this.dispatchEvent(new Event("change", {
|
|
131
130
|
bubbles: true,
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
2
|
//#region src/components/radio/URadio.styles.ts
|
|
3
3
|
var styles = css`
|
|
4
|
+
:host {
|
|
5
|
+
--radio-color: var(--u-primary-color, var(--u-blue-600));
|
|
6
|
+
--radio-color-active: color-mix(in srgb, var(--radio-color) 85%, black);
|
|
7
|
+
}
|
|
8
|
+
|
|
4
9
|
:host {
|
|
5
10
|
display: inline-flex;
|
|
6
11
|
flex-direction: column;
|
|
@@ -44,40 +49,40 @@ var styles = css`
|
|
|
44
49
|
/* Default + Filled */
|
|
45
50
|
:host([type="default"][variant="filled"]) ::slotted(u-option) {
|
|
46
51
|
--option-color-active: #fff;
|
|
47
|
-
--option-border-color-active: var(--
|
|
48
|
-
--option-background-color-active: var(--
|
|
52
|
+
--option-border-color-active: var(--radio-color);
|
|
53
|
+
--option-background-color-active: var(--radio-color);
|
|
49
54
|
--option-color-active-interactive: #fff;
|
|
50
|
-
--option-border-color-active-interactive: var(--
|
|
51
|
-
--option-background-color-active-interactive: var(--
|
|
55
|
+
--option-border-color-active-interactive: var(--radio-color-active);
|
|
56
|
+
--option-background-color-active-interactive: var(--radio-color-active);
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
/* Default + Outlined */
|
|
55
60
|
:host([type="default"][variant="outlined"]) ::slotted(u-option) {
|
|
56
|
-
--option-color-active: var(--
|
|
57
|
-
--option-border-color-active: var(--
|
|
61
|
+
--option-color-active: var(--radio-color-active);
|
|
62
|
+
--option-border-color-active: var(--radio-color);
|
|
58
63
|
--option-background-color-active: transparent;
|
|
59
|
-
--option-color-active-interactive: var(--
|
|
60
|
-
--option-border-color-active-interactive: var(--
|
|
64
|
+
--option-color-active-interactive: var(--radio-color-active);
|
|
65
|
+
--option-border-color-active-interactive: var(--radio-color-active);
|
|
61
66
|
--option-background-color-active-interactive: transparent;
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
/* Button + Filled */
|
|
65
70
|
:host([type="button"][variant="filled"]) ::slotted(u-option) {
|
|
66
71
|
--option-color-active: #fff;
|
|
67
|
-
--option-border-color-active: var(--
|
|
68
|
-
--option-background-color-active: var(--
|
|
72
|
+
--option-border-color-active: var(--radio-color);
|
|
73
|
+
--option-background-color-active: var(--radio-color);
|
|
69
74
|
--option-color-active-interactive: #fff;
|
|
70
|
-
--option-border-color-active-interactive: var(--
|
|
71
|
-
--option-background-color-active-interactive: var(--
|
|
75
|
+
--option-border-color-active-interactive: var(--radio-color-active);
|
|
76
|
+
--option-background-color-active-interactive: var(--radio-color-active);
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
/* Button + Outlined */
|
|
75
80
|
:host([type="button"][variant="outlined"]) ::slotted(u-option) {
|
|
76
|
-
--option-color-active: var(--
|
|
77
|
-
--option-border-color-active: var(--
|
|
81
|
+
--option-color-active: var(--radio-color-active);
|
|
82
|
+
--option-border-color-active: var(--radio-color);
|
|
78
83
|
--option-background-color-active: transparent;
|
|
79
|
-
--option-color-active-interactive: var(--
|
|
80
|
-
--option-border-color-active-interactive: var(--
|
|
84
|
+
--option-color-active-interactive: var(--radio-color-active);
|
|
85
|
+
--option-border-color-active-interactive: var(--radio-color-active);
|
|
81
86
|
--option-background-color-active-interactive: transparent;
|
|
82
87
|
}
|
|
83
88
|
|
|
@@ -27,13 +27,14 @@ export declare class URating extends UFormControlElement<number> {
|
|
|
27
27
|
private buffer;
|
|
28
28
|
private symbol;
|
|
29
29
|
private symbolOff;
|
|
30
|
+
protected shouldValidate(changed: PropertyValues): boolean;
|
|
30
31
|
private get interactive();
|
|
31
32
|
protected updated(changedProperties: PropertyValues): void;
|
|
32
33
|
render(): import('lit-html').TemplateResult<1>;
|
|
33
|
-
|
|
34
|
+
protected setValidity(): void;
|
|
35
|
+
private isStepMismatch;
|
|
34
36
|
reset(): void;
|
|
35
37
|
private onChangeValue;
|
|
36
|
-
private getValidity;
|
|
37
38
|
private handleSlotChange;
|
|
38
39
|
private handleSymbolPointerMove;
|
|
39
40
|
private handleSymbolPointerLeave;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { formatTemplate, getLocaleStrings, resolveLocale } from "../../core/locale.js";
|
|
2
1
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
|
|
3
2
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
4
3
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
5
4
|
import "../icon/UIcon.js";
|
|
5
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
6
6
|
import "../field/UField.js";
|
|
7
7
|
import { styles } from "./URating.styles.js";
|
|
8
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
9
8
|
import { html } from "lit";
|
|
9
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
10
10
|
//#region src/components/rating/URating.ts
|
|
11
11
|
var URating = class URating extends UFormControlElement {
|
|
12
12
|
constructor(..._args) {
|
|
@@ -78,6 +78,13 @@ var URating = class URating extends UFormControlElement {
|
|
|
78
78
|
static {
|
|
79
79
|
this.styles = [super.styles, styles];
|
|
80
80
|
}
|
|
81
|
+
shouldValidate(changed) {
|
|
82
|
+
return super.shouldValidate(changed) || [
|
|
83
|
+
"min",
|
|
84
|
+
"max",
|
|
85
|
+
"precision"
|
|
86
|
+
].some((k) => changed.has(k));
|
|
87
|
+
}
|
|
81
88
|
get interactive() {
|
|
82
89
|
return !this.disabled && !this.readonly;
|
|
83
90
|
}
|
|
@@ -129,13 +136,28 @@ var URating = class URating extends UFormControlElement {
|
|
|
129
136
|
</div>
|
|
130
137
|
`;
|
|
131
138
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
setValidity() {
|
|
140
|
+
const v = this.value || 0;
|
|
141
|
+
let flags = {};
|
|
142
|
+
let message = "";
|
|
143
|
+
if (this.required && !v) {
|
|
144
|
+
flags = { valueMissing: true };
|
|
145
|
+
message = Locale.getValue("valueMissing");
|
|
146
|
+
} else if (v && v < this.min) {
|
|
147
|
+
flags = { rangeUnderflow: true };
|
|
148
|
+
message = Locale.getValue("rangeUnderflow", { min: this.min });
|
|
149
|
+
} else if (v && v > this.max) {
|
|
150
|
+
flags = { rangeOverflow: true };
|
|
151
|
+
message = Locale.getValue("rangeOverflow", { max: this.max });
|
|
152
|
+
} else if (v && this.precision < 1 && this.isStepMismatch(v)) {
|
|
153
|
+
flags = { stepMismatch: true };
|
|
154
|
+
message = Locale.getValue("stepMismatch", { step: this.precision });
|
|
137
155
|
}
|
|
138
|
-
|
|
156
|
+
this.commit(flags, message, this.renderRoot.querySelector(".symbols") ?? void 0);
|
|
157
|
+
}
|
|
158
|
+
isStepMismatch(v) {
|
|
159
|
+
const remainder = Math.abs(v % this.precision);
|
|
160
|
+
return remainder > .001 && Math.abs(remainder - this.precision) > .001;
|
|
139
161
|
}
|
|
140
162
|
reset() {
|
|
141
163
|
this.value = 0;
|
|
@@ -144,41 +166,12 @@ var URating = class URating extends UFormControlElement {
|
|
|
144
166
|
onChangeValue() {
|
|
145
167
|
this.buffer = -1;
|
|
146
168
|
this.internals?.setFormValue(this.value?.toString() || "");
|
|
147
|
-
const { flags, message } = this.getValidity();
|
|
148
|
-
this.internals?.setValidity(flags, this.validationMessage || message, this.renderRoot.querySelector(".symbols") || void 0);
|
|
149
169
|
if (!this.novalidate) this.validate();
|
|
150
170
|
this.dispatchEvent(new Event("change", {
|
|
151
171
|
bubbles: true,
|
|
152
172
|
composed: true
|
|
153
173
|
}));
|
|
154
174
|
}
|
|
155
|
-
getValidity() {
|
|
156
|
-
const v = this.value || 0;
|
|
157
|
-
const s = getLocaleStrings(resolveLocale(this.locale));
|
|
158
|
-
if (this.required && !v) return {
|
|
159
|
-
flags: { valueMissing: true },
|
|
160
|
-
message: s.required
|
|
161
|
-
};
|
|
162
|
-
if (v && v < this.min) return {
|
|
163
|
-
flags: { rangeUnderflow: true },
|
|
164
|
-
message: formatTemplate(s.minValue, { min: this.min })
|
|
165
|
-
};
|
|
166
|
-
if (v && v > this.max) return {
|
|
167
|
-
flags: { rangeOverflow: true },
|
|
168
|
-
message: formatTemplate(s.maxValue, { max: this.max })
|
|
169
|
-
};
|
|
170
|
-
if (v && this.precision < 1) {
|
|
171
|
-
const remainder = Math.abs(v % this.precision);
|
|
172
|
-
if (remainder > .001 && Math.abs(remainder - this.precision) > .001) return {
|
|
173
|
-
flags: { stepMismatch: true },
|
|
174
|
-
message: formatTemplate(s.stepMismatch, { step: this.precision })
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
return {
|
|
178
|
-
flags: {},
|
|
179
|
-
message: ""
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
175
|
calibrate(e, score) {
|
|
183
176
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
184
177
|
const ratio = Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
|