@iyulab/components 1.3.4 → 1.5.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 +30 -0
- package/dist/_virtual/_glob-assets_raw/alert-circle-fill.svg.1e438750.js +4 -0
- package/dist/_virtual/_glob-assets_raw/alert-triangle-fill.svg.1a8797c4.js +4 -0
- package/dist/_virtual/_glob-assets_raw/bell-fill.svg.d37c41d9.js +1 -1
- package/dist/_virtual/_glob-assets_raw/check.svg.4690b01e.js +4 -0
- package/dist/_virtual/_glob-assets_raw/chevron-down.svg.0ccd06ea.js +1 -1
- package/dist/_virtual/_glob-assets_raw/chevron-left.svg.b4601050.js +1 -1
- package/dist/_virtual/_glob-assets_raw/chevron-right.svg.0711bb67.js +1 -1
- package/dist/_virtual/_glob-assets_raw/chevron-up.svg.ed917211.js +1 -1
- package/dist/_virtual/_glob-assets_raw/circle-check-fill.svg.3f0fcb72.js +4 -0
- package/dist/_virtual/_glob-assets_raw/copy.svg.6192f853.js +4 -0
- package/dist/_virtual/_glob-assets_raw/dark.css.e8ac080d.js +1 -1
- package/dist/_virtual/_glob-assets_raw/eye-off.svg.7aa25df0.js +4 -0
- package/dist/_virtual/_glob-assets_raw/eye.svg.2e5e9c4c.js +1 -1
- package/dist/_virtual/_glob-assets_raw/info-circle-fill.svg.6580071d.js +1 -1
- package/dist/_virtual/_glob-assets_raw/minus.svg.4610de75.js +4 -0
- package/dist/_virtual/_glob-assets_raw/plus.svg.d83ead68.js +4 -0
- package/dist/_virtual/_glob-assets_raw/search.svg.0ba2012d.js +1 -1
- package/dist/_virtual/_glob-assets_raw/star-fill.svg.f24b5a2d.js +1 -1
- package/dist/_virtual/_glob-assets_raw/star.svg.4af61468.js +1 -1
- package/dist/_virtual/_glob-assets_raw/x.svg.5596f6bb.js +4 -0
- 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 +14 -8
- 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 +12 -9
- package/dist/components/checkbox/UCheckbox.styles.js +12 -7
- package/dist/components/chip/UChip.js +8 -5
- package/dist/components/copy-button/UCopyButton.d.ts +47 -0
- package/dist/components/copy-button/UCopyButton.js +94 -0
- package/dist/components/copy-button/UCopyButton.styles.js +21 -0
- package/dist/components/dialog/UDialog.js +3 -3
- package/dist/components/divider/UDivider.js +1 -1
- package/dist/components/drawer/UDrawer.js +3 -3
- 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/icon-button/UIconButton.styles.js +2 -2
- package/dist/components/input/UInput.d.ts +2 -3
- package/dist/components/input/UInput.js +39 -11
- package/dist/components/input/UInput.styles.js +1 -4
- package/dist/components/menu/UMenu.js +1 -1
- package/dist/components/menu-item/UMenuItem.js +2 -2
- 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 +11 -5
- 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 +30 -42
- 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 +7 -4
- 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 +11 -5
- package/dist/components/tree-item/UTreeItem.styles.js +5 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +7 -8
- package/dist/react/UCopyButton.d.ts +10 -0
- package/dist/react/UCopyButton.js +12 -0
- package/dist/react/UTabPanel.d.ts +1 -0
- package/dist/react/UTabPanel.js +3 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -0
- 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/dist/utilities/icons.d.ts +1 -1
- package/dist/utilities/icons.js +22 -25
- 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/_virtual/_glob-assets_raw/check-circle-fill.svg.51c33a2a.js +0 -4
- package/dist/_virtual/_glob-assets_raw/check-lg.svg.371c5e78.js +0 -4
- package/dist/_virtual/_glob-assets_raw/dash-lg.svg.b40b8b3a.js +0 -4
- package/dist/_virtual/_glob-assets_raw/exclamation-circle-fill.svg.dc8c523e.js +0 -4
- package/dist/_virtual/_glob-assets_raw/exclamation-triangle-fill.svg.7949d2c7.js +0 -4
- package/dist/_virtual/_glob-assets_raw/eye-slash.svg.240afafa.js +0 -4
- package/dist/_virtual/_glob-assets_raw/plus-lg.svg.294e9073.js +0 -4
- package/dist/_virtual/_glob-assets_raw/three-dots-vertical.svg.9fee78c5.js +0 -4
- package/dist/_virtual/_glob-assets_raw/three-dots.svg.6a7a5b23.js +0 -4
- package/dist/_virtual/_glob-assets_raw/x-lg.svg.f34b882c.js +0 -4
- package/dist/components/UDataElement.d.ts +0 -44
- package/dist/components/UDataElement.js +0 -101
- 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
- /package/dist/components/{UDataElement.styles.d.ts → copy-button/UCopyButton.styles.d.ts} +0 -0
|
@@ -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 "./UCard.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/card/UCard.ts
|
|
8
8
|
var UCard = class UCard extends UElement {
|
|
9
9
|
constructor(..._args) {
|
|
@@ -1,11 +1,11 @@
|
|
|
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 { styles } from "./UCarousel.styles.js";
|
|
7
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
8
7
|
import { html } from "lit";
|
|
8
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
9
9
|
//#region src/components/carousel/UCarousel.ts
|
|
10
10
|
var UCarousel = class UCarousel extends UElement {
|
|
11
11
|
constructor(..._args) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
1
2
|
import { UFormControlElement } from '../UFormControlElement.js';
|
|
2
3
|
export type CheckboxVariant = "filled" | "outline";
|
|
3
4
|
export type CheckboxColor = "blue" | "green" | "red" | "orange" | "teal" | "cyan" | "purple" | "pink" | "neutral";
|
|
@@ -29,8 +30,10 @@ export declare class UCheckbox extends UFormControlElement<string> {
|
|
|
29
30
|
indeterminate: boolean;
|
|
30
31
|
/** 체크 여부 */
|
|
31
32
|
checked: boolean;
|
|
33
|
+
inputEl?: HTMLInputElement;
|
|
34
|
+
protected shouldValidate(changed: PropertyValues): boolean;
|
|
32
35
|
render(): import('lit-html').TemplateResult<1>;
|
|
33
|
-
|
|
36
|
+
protected setValidity(): void;
|
|
34
37
|
reset(): void;
|
|
35
38
|
private handleInputChange;
|
|
36
39
|
}
|
|
@@ -2,9 +2,10 @@ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/hel
|
|
|
2
2
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
3
3
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
4
|
import "../icon/UIcon.js";
|
|
5
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
5
6
|
import { styles } from "./UCheckbox.styles.js";
|
|
6
|
-
import { customElement, property } from "lit/decorators.js";
|
|
7
7
|
import { html } from "lit";
|
|
8
|
+
import { customElement, property, query } from "lit/decorators.js";
|
|
8
9
|
import { live } from "lit/directives/live.js";
|
|
9
10
|
//#region src/components/checkbox/UCheckbox.ts
|
|
10
11
|
var UCheckbox = class UCheckbox extends UFormControlElement {
|
|
@@ -21,7 +22,6 @@ var UCheckbox = class UCheckbox extends UFormControlElement {
|
|
|
21
22
|
this.indeterminate = false;
|
|
22
23
|
this.checked = input.checked;
|
|
23
24
|
this.internals?.setFormValue(this.checked ? this.value || String(this.checked) : String(this.checked));
|
|
24
|
-
this.internals?.setValidity(input.validity, this.validationMessage || input.validationMessage, this.shadowRoot?.querySelector(".checkbox") || void 0);
|
|
25
25
|
if (!this.novalidate) this.validate();
|
|
26
26
|
this.relay(e);
|
|
27
27
|
};
|
|
@@ -29,6 +29,9 @@ var UCheckbox = class UCheckbox extends UFormControlElement {
|
|
|
29
29
|
static {
|
|
30
30
|
this.styles = [super.styles, styles];
|
|
31
31
|
}
|
|
32
|
+
shouldValidate(changed) {
|
|
33
|
+
return super.shouldValidate(changed) || changed.has("checked");
|
|
34
|
+
}
|
|
32
35
|
render() {
|
|
33
36
|
return html`
|
|
34
37
|
<label class="wrapper" part="wrapper">
|
|
@@ -42,7 +45,7 @@ var UCheckbox = class UCheckbox extends UFormControlElement {
|
|
|
42
45
|
<span class="checkbox" part="checkbox">
|
|
43
46
|
<u-icon
|
|
44
47
|
lib="internal"
|
|
45
|
-
name=${this.indeterminate ? "
|
|
48
|
+
name=${this.indeterminate ? "minus" : "check"}
|
|
46
49
|
></u-icon>
|
|
47
50
|
</span>
|
|
48
51
|
<span class="label" part="label">
|
|
@@ -51,15 +54,14 @@ var UCheckbox = class UCheckbox extends UFormControlElement {
|
|
|
51
54
|
</span>
|
|
52
55
|
</label>
|
|
53
56
|
|
|
54
|
-
<div class="description" part="description" ?hidden=${!this.description}>
|
|
55
|
-
${this.description}
|
|
57
|
+
<div class="description" part="description" ?hidden=${!(this.invalid && this.validationMessage) && !this.description}>
|
|
58
|
+
${this.invalid && this.validationMessage ? this.validationMessage : this.description}
|
|
56
59
|
</div>
|
|
57
60
|
`;
|
|
58
61
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return !this.invalid;
|
|
62
|
+
setValidity() {
|
|
63
|
+
const missing = !!this.inputEl?.validity.valueMissing;
|
|
64
|
+
this.commit(missing ? { valueMissing: true } : {}, missing ? Locale.getValue("valueMissing") : "", this.shadowRoot?.querySelector(".checkbox") ?? void 0);
|
|
63
65
|
}
|
|
64
66
|
reset() {
|
|
65
67
|
this.checked = false;
|
|
@@ -83,6 +85,7 @@ __decorate([property({
|
|
|
83
85
|
type: Boolean,
|
|
84
86
|
reflect: true
|
|
85
87
|
}), __decorateMetadata("design:type", Boolean)], UCheckbox.prototype, "checked", void 0);
|
|
88
|
+
__decorate([query("input", true), __decorateMetadata("design:type", typeof HTMLInputElement === "undefined" ? Object : HTMLInputElement)], UCheckbox.prototype, "inputEl", void 0);
|
|
86
89
|
UCheckbox = __decorate([customElement("u-checkbox")], UCheckbox);
|
|
87
90
|
//#endregion
|
|
88
91
|
export { UCheckbox };
|
|
@@ -2,6 +2,7 @@ import { css } from "lit";
|
|
|
2
2
|
//#region src/components/checkbox/UCheckbox.styles.ts
|
|
3
3
|
var styles = css`
|
|
4
4
|
:host {
|
|
5
|
+
--checkbox-fill-color: var(--u-primary-color, var(--u-blue-600));
|
|
5
6
|
--checkbox-color: inherit;
|
|
6
7
|
--checkbox-border-color: var(--u-input-border-color);
|
|
7
8
|
--checkbox-background-color: var(--u-input-bg-color);
|
|
@@ -43,22 +44,22 @@ var styles = css`
|
|
|
43
44
|
:host([variant="filled"][checked]),
|
|
44
45
|
:host([variant="filled"][indeterminate]) {
|
|
45
46
|
--checkbox-color: var(--u-neutral-100);
|
|
46
|
-
--checkbox-border-color: var(--
|
|
47
|
-
--checkbox-background-color: var(--
|
|
47
|
+
--checkbox-border-color: var(--checkbox-fill-color);
|
|
48
|
+
--checkbox-background-color: var(--checkbox-fill-color);
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
/* === Variant: outline - 테두리만 === */
|
|
51
52
|
:host([variant="outline"][checked]),
|
|
52
53
|
:host([variant="outline"][indeterminate]) {
|
|
53
|
-
--checkbox-border-color: var(--
|
|
54
|
+
--checkbox-border-color: var(--checkbox-fill-color);
|
|
54
55
|
--checkbox-background-color: transparent;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
/* === Color variants (filled) === */
|
|
58
59
|
:host([variant="filled"][color="blue"][checked]),
|
|
59
60
|
:host([variant="filled"][color="blue"][indeterminate]) {
|
|
60
|
-
--checkbox-border-color: var(--
|
|
61
|
-
--checkbox-background-color: var(--
|
|
61
|
+
--checkbox-border-color: var(--checkbox-fill-color);
|
|
62
|
+
--checkbox-background-color: var(--checkbox-fill-color);
|
|
62
63
|
}
|
|
63
64
|
:host([variant="filled"][color="green"][checked]),
|
|
64
65
|
:host([variant="filled"][color="green"][indeterminate]) {
|
|
@@ -104,8 +105,8 @@ var styles = css`
|
|
|
104
105
|
/* === Color variants (outline) === */
|
|
105
106
|
:host([variant="outline"][color="blue"][checked]),
|
|
106
107
|
:host([variant="outline"][color="blue"][indeterminate]) {
|
|
107
|
-
--checkbox-color: var(--
|
|
108
|
-
--checkbox-border-color: var(--
|
|
108
|
+
--checkbox-color: var(--checkbox-fill-color);
|
|
109
|
+
--checkbox-border-color: var(--checkbox-fill-color);
|
|
109
110
|
}
|
|
110
111
|
:host([variant="outline"][color="green"][checked]),
|
|
111
112
|
:host([variant="outline"][color="green"][indeterminate]) {
|
|
@@ -206,6 +207,10 @@ var styles = css`
|
|
|
206
207
|
font-size: 0.75em;
|
|
207
208
|
line-height: 1.2;
|
|
208
209
|
}
|
|
210
|
+
|
|
211
|
+
:host([invalid]) .description {
|
|
212
|
+
color: var(--u-red-600);
|
|
213
|
+
}
|
|
209
214
|
`;
|
|
210
215
|
//#endregion
|
|
211
216
|
export { styles };
|
|
@@ -1,13 +1,13 @@
|
|
|
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 "../tag/UTag.js";
|
|
8
8
|
import { styles } from "./UChip.styles.js";
|
|
9
|
-
import { customElement, property } from "lit/decorators.js";
|
|
10
9
|
import { html } from "lit";
|
|
10
|
+
import { customElement, property } from "lit/decorators.js";
|
|
11
11
|
//#region src/components/chip/UChip.ts
|
|
12
12
|
var UChip = class UChip extends UElement {
|
|
13
13
|
constructor(..._args) {
|
|
@@ -32,7 +32,10 @@ var UChip = class UChip extends UElement {
|
|
|
32
32
|
};
|
|
33
33
|
this.handleRemoveClick = (e) => {
|
|
34
34
|
e.stopImmediatePropagation();
|
|
35
|
-
if (this.fire("remove"
|
|
35
|
+
if (this.fire("remove", {
|
|
36
|
+
bubbles: false,
|
|
37
|
+
composed: false
|
|
38
|
+
})) this.remove();
|
|
36
39
|
};
|
|
37
40
|
}
|
|
38
41
|
static {
|
|
@@ -49,7 +52,7 @@ var UChip = class UChip extends UElement {
|
|
|
49
52
|
<u-icon class="check-icon" part="check" slot="prefix"
|
|
50
53
|
?hidden=${!this.selectable || !this.selected}
|
|
51
54
|
lib="internal"
|
|
52
|
-
name="check
|
|
55
|
+
name="check"
|
|
53
56
|
></u-icon>
|
|
54
57
|
|
|
55
58
|
<slot name="prefix" slot="prefix"></slot>
|
|
@@ -63,7 +66,7 @@ var UChip = class UChip extends UElement {
|
|
|
63
66
|
tabindex="-1"
|
|
64
67
|
aria-label="Remove"
|
|
65
68
|
@click=${this.handleRemoveClick}>
|
|
66
|
-
<u-icon lib="internal" name="x
|
|
69
|
+
<u-icon lib="internal" name="x"></u-icon>
|
|
67
70
|
</u-button>
|
|
68
71
|
</u-tag>
|
|
69
72
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Placement, OffsetOptions } from '@floating-ui/dom';
|
|
2
|
+
import { UElement } from '../UElement.js';
|
|
3
|
+
import { ButtonVariant } from '../button/UButton.js';
|
|
4
|
+
/**
|
|
5
|
+
* 클릭 시 클립보드에 텍스트를 복사하는 버튼입니다. 복사 상태를 표시하기 위해 아이콘이 변경됩니다.
|
|
6
|
+
*
|
|
7
|
+
* @slot - 툴팁에 표시할 콘텐츠
|
|
8
|
+
*
|
|
9
|
+
* @event copy - 클립보드에 실제로 쓰기 전에 발생하는 네이티브 ClipboardEvent.
|
|
10
|
+
* `preventDefault()`로 복사를 취소하거나, `clipboardData.setData('text/plain', ...)`로 복사될 값을 바꿀 수 있음
|
|
11
|
+
*
|
|
12
|
+
* @csspart button - 내부 버튼 요소
|
|
13
|
+
* @csspart icon - 아이콘 요소
|
|
14
|
+
* @csspart tooltip - 툴팁 요소
|
|
15
|
+
*/
|
|
16
|
+
export declare class UCopyButton extends UElement {
|
|
17
|
+
static styles: import('lit').CSSResultGroup[];
|
|
18
|
+
/** 버튼 스타일 변형 */
|
|
19
|
+
variant: ButtonVariant;
|
|
20
|
+
/** 원형 표시 여부 */
|
|
21
|
+
rounded: boolean;
|
|
22
|
+
/** 비활성화 여부 */
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
/** 클립보드 복사 상태를 나타냅니다. */
|
|
25
|
+
copied: boolean;
|
|
26
|
+
/** 툴팁 위치 */
|
|
27
|
+
tooltipPlacement: Placement;
|
|
28
|
+
/** 툴팁 거리 */
|
|
29
|
+
tooltipOffset: OffsetOptions;
|
|
30
|
+
/** 클립보드 복사 후 재사용 대기 시간 (ms). 0 이하이면 복사 상태로 되돌아가지 않습니다. */
|
|
31
|
+
delay: number;
|
|
32
|
+
/** 복사할 텍스트를 설정합니다. */
|
|
33
|
+
value?: string;
|
|
34
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
35
|
+
/**
|
|
36
|
+
* 클립보드에 텍스트를 복사하는 메서드입니다.
|
|
37
|
+
* 실제 쓰기 전에 취소 가능한 네이티브 `copy` 이벤트를 발행하여, 리스너가 복사를 취소하거나
|
|
38
|
+
* `clipboardData`를 통해 복사될 값을 바꿀 수 있게 합니다.
|
|
39
|
+
* 복사 후 재사용 대기 시간이 설정되어 있으면, 일정 시간 후에 복사 가능 상태로 되돌립니다.
|
|
40
|
+
*/
|
|
41
|
+
private handleButtonClick;
|
|
42
|
+
}
|
|
43
|
+
declare global {
|
|
44
|
+
interface HTMLElementTagNameMap {
|
|
45
|
+
"u-copy-button": UCopyButton;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { UElement } from "../UElement.js";
|
|
2
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
|
|
3
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
4
|
+
import "../icon-button/UIconButton.js";
|
|
5
|
+
import { styles } from "./UCopyButton.styles.js";
|
|
6
|
+
import { html } from "lit";
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
|
+
//#region src/components/copy-button/UCopyButton.ts
|
|
9
|
+
var UCopyButton = class UCopyButton extends UElement {
|
|
10
|
+
constructor(..._args) {
|
|
11
|
+
super(..._args);
|
|
12
|
+
this.variant = "ghost";
|
|
13
|
+
this.rounded = false;
|
|
14
|
+
this.disabled = false;
|
|
15
|
+
this.copied = false;
|
|
16
|
+
this.tooltipPlacement = "top";
|
|
17
|
+
this.tooltipOffset = 4;
|
|
18
|
+
this.delay = 1e3;
|
|
19
|
+
this.handleButtonClick = async () => {
|
|
20
|
+
if (!this.value) return;
|
|
21
|
+
if (this.copied) return;
|
|
22
|
+
const clipboard = new DataTransfer();
|
|
23
|
+
clipboard.setData("text/plain", this.value);
|
|
24
|
+
const event = new ClipboardEvent("copy", {
|
|
25
|
+
bubbles: false,
|
|
26
|
+
composed: false,
|
|
27
|
+
cancelable: true,
|
|
28
|
+
clipboardData: clipboard
|
|
29
|
+
});
|
|
30
|
+
if (!this.dispatchEvent(event)) return;
|
|
31
|
+
try {
|
|
32
|
+
const text = event.clipboardData?.getData("text/plain") || this.value;
|
|
33
|
+
await window.navigator.clipboard.writeText(text);
|
|
34
|
+
if (this.delay <= 0) return;
|
|
35
|
+
this.copied = true;
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
this.copied = false;
|
|
38
|
+
}, this.delay);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error("Failed to copy text to clipboard:", error);
|
|
41
|
+
this.copied = false;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
static {
|
|
46
|
+
this.styles = [super.styles, styles];
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
return html`
|
|
50
|
+
<u-icon-button part="button"
|
|
51
|
+
exportparts="icon,tooltip"
|
|
52
|
+
?disabled=${this.disabled}
|
|
53
|
+
.variant=${this.variant}
|
|
54
|
+
.rounded=${this.rounded}
|
|
55
|
+
.tooltipPlacement=${this.tooltipPlacement}
|
|
56
|
+
.tooltipOffset=${this.tooltipOffset}
|
|
57
|
+
lib="internal"
|
|
58
|
+
name=${this.copied ? "check" : "copy"}
|
|
59
|
+
@click=${this.handleButtonClick}
|
|
60
|
+
>
|
|
61
|
+
<slot></slot>
|
|
62
|
+
</u-icon-button>
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
__decorate([property({
|
|
67
|
+
type: String,
|
|
68
|
+
reflect: true
|
|
69
|
+
}), __decorateMetadata("design:type", Object)], UCopyButton.prototype, "variant", void 0);
|
|
70
|
+
__decorate([property({
|
|
71
|
+
type: Boolean,
|
|
72
|
+
reflect: true
|
|
73
|
+
}), __decorateMetadata("design:type", Object)], UCopyButton.prototype, "rounded", void 0);
|
|
74
|
+
__decorate([property({
|
|
75
|
+
type: Boolean,
|
|
76
|
+
reflect: true
|
|
77
|
+
}), __decorateMetadata("design:type", Object)], UCopyButton.prototype, "disabled", void 0);
|
|
78
|
+
__decorate([property({
|
|
79
|
+
type: Boolean,
|
|
80
|
+
reflect: true
|
|
81
|
+
}), __decorateMetadata("design:type", Boolean)], UCopyButton.prototype, "copied", void 0);
|
|
82
|
+
__decorate([property({
|
|
83
|
+
type: String,
|
|
84
|
+
attribute: "tooltip-placement"
|
|
85
|
+
}), __decorateMetadata("design:type", Object)], UCopyButton.prototype, "tooltipPlacement", void 0);
|
|
86
|
+
__decorate([property({
|
|
87
|
+
type: Number,
|
|
88
|
+
attribute: "tooltip-offset"
|
|
89
|
+
}), __decorateMetadata("design:type", Object)], UCopyButton.prototype, "tooltipOffset", void 0);
|
|
90
|
+
__decorate([property({ type: Number }), __decorateMetadata("design:type", Number)], UCopyButton.prototype, "delay", void 0);
|
|
91
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UCopyButton.prototype, "value", void 0);
|
|
92
|
+
UCopyButton = __decorate([customElement("u-copy-button")], UCopyButton);
|
|
93
|
+
//#endregion
|
|
94
|
+
export { UCopyButton };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/copy-button/UCopyButton.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
|
+
:host {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
font-size: 18px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
u-icon-button {
|
|
10
|
+
font-size: inherit;
|
|
11
|
+
}
|
|
12
|
+
u-icon-button::part(button) {
|
|
13
|
+
padding: 0.2em;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([copied]) u-icon-button {
|
|
17
|
+
color: var(--u-green-500);
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { styles };
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
import "../icon/UIcon.js";
|
|
4
3
|
import { UOverlayElement } from "../UOverlayElement.js";
|
|
5
4
|
import "../button/UButton.js";
|
|
5
|
+
import "../icon/UIcon.js";
|
|
6
6
|
import { styles } from "./UDialog.styles.js";
|
|
7
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
8
7
|
import { html } from "lit";
|
|
8
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
9
9
|
//#region src/components/dialog/UDialog.ts
|
|
10
10
|
var UDialog = class UDialog extends UOverlayElement {
|
|
11
11
|
constructor(..._args) {
|
|
@@ -34,7 +34,7 @@ var UDialog = class UDialog extends UOverlayElement {
|
|
|
34
34
|
variant="ghost"
|
|
35
35
|
?hidden=${!this.closable}
|
|
36
36
|
@click=${() => this.requestClose("button")}>
|
|
37
|
-
<u-icon lib="internal" name="x
|
|
37
|
+
<u-icon lib="internal" name="x"></u-icon>
|
|
38
38
|
</u-button>
|
|
39
39
|
</div>
|
|
40
40
|
<div class="body" part="body">
|
|
@@ -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 "./UDivider.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/divider/UDivider.ts
|
|
8
8
|
var UDivider = class UDivider extends UElement {
|
|
9
9
|
constructor(..._args) {
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
import "../icon/UIcon.js";
|
|
4
3
|
import { UOverlayElement } from "../UOverlayElement.js";
|
|
5
4
|
import "../button/UButton.js";
|
|
5
|
+
import "../icon/UIcon.js";
|
|
6
6
|
import { styles } from "./UDrawer.styles.js";
|
|
7
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
8
7
|
import { html } from "lit";
|
|
8
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
9
9
|
//#region src/components/drawer/UDrawer.ts
|
|
10
10
|
var UDrawer = class UDrawer extends UOverlayElement {
|
|
11
11
|
constructor(..._args) {
|
|
@@ -27,7 +27,7 @@ var UDrawer = class UDrawer extends UOverlayElement {
|
|
|
27
27
|
variant="ghost"
|
|
28
28
|
?hidden=${!this.closable}
|
|
29
29
|
@click=${() => this.requestClose("button")}>
|
|
30
|
-
<u-icon lib="internal" name="x
|
|
30
|
+
<u-icon lib="internal" name="x"></u-icon>
|
|
31
31
|
</u-button>
|
|
32
32
|
</div>
|
|
33
33
|
<div class="body" part="body">
|
|
@@ -7,12 +7,6 @@ var styles = css`
|
|
|
7
7
|
:host([placement="top"]) { flex-direction: column; justify-content: flex-start; }
|
|
8
8
|
:host([placement="bottom"]) { flex-direction: column; justify-content: flex-end; }
|
|
9
9
|
|
|
10
|
-
/*
|
|
11
|
-
* 패널 크기 — 슬라이드 축 방향 크기를 --drawer-size 로 제어한다.
|
|
12
|
-
* 좌우(left/right): 너비 = --drawer-size (기본 28rem), 높이 100%
|
|
13
|
-
* 상하(top/bottom): 높이 = --drawer-size (기본 16rem), 너비 100%
|
|
14
|
-
* 호스트 앱이 style="--drawer-size: 600px" 로 오버라이드한다.
|
|
15
|
-
*/
|
|
16
10
|
/* 좌우: 높이 100%, 너비 = --drawer-size */
|
|
17
11
|
:host([placement="left"]) .panel,
|
|
18
12
|
:host([placement="right"]) .panel {
|
|
@@ -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,
|
|
@@ -2,7 +2,7 @@ import { css } from "lit";
|
|
|
2
2
|
//#region src/components/icon-button/UIconButton.styles.ts
|
|
3
3
|
var styles = css`
|
|
4
4
|
:host {
|
|
5
|
-
display: inline-
|
|
5
|
+
display: inline-flex;
|
|
6
6
|
color: var(--u-icon-color);
|
|
7
7
|
font-size: 20px;
|
|
8
8
|
}
|
|
@@ -15,9 +15,9 @@ var styles = css`
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
u-button {
|
|
18
|
-
padding: 0.4em;
|
|
19
18
|
color: inherit;
|
|
20
19
|
font-size: inherit;
|
|
20
|
+
padding: 0.4em;
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
23
23
|
//#endregion
|
|
@@ -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;
|