@iyulab/components 0.1.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 +4 -0
- package/LICENSE +21 -0
- package/README.md +33 -0
- package/dist/assets/icons/arrow-clockwise.svg.js +7 -0
- package/dist/assets/icons/arrow-down.svg.js +6 -0
- package/dist/assets/icons/arrow-up.svg.js +6 -0
- package/dist/assets/icons/ban.svg.js +6 -0
- package/dist/assets/icons/bell-fill.svg.js +6 -0
- package/dist/assets/icons/check-circle-fill.svg.js +6 -0
- package/dist/assets/icons/check-lg.svg.js +6 -0
- package/dist/assets/icons/chevron-down.svg.js +6 -0
- package/dist/assets/icons/chevron-left.svg.js +6 -0
- package/dist/assets/icons/chevron-right.svg.js +6 -0
- package/dist/assets/icons/chevron-up.svg.js +6 -0
- package/dist/assets/icons/copy.svg.js +6 -0
- package/dist/assets/icons/dash-lg.svg.js +6 -0
- package/dist/assets/icons/exclamation-circle-fill.svg.js +6 -0
- package/dist/assets/icons/exclamation-triangle-fill.svg.js +6 -0
- package/dist/assets/icons/eye-slash.svg.js +8 -0
- package/dist/assets/icons/eye.svg.js +7 -0
- package/dist/assets/icons/info-circle-fill.svg.js +6 -0
- package/dist/assets/icons/layout-sidebar.svg.js +6 -0
- package/dist/assets/icons/lightbulb-fill.svg.js +6 -0
- package/dist/assets/icons/lightbulb-off.svg.js +6 -0
- package/dist/assets/icons/lightbulb.svg.js +6 -0
- package/dist/assets/icons/mic-fill.svg.js +7 -0
- package/dist/assets/icons/mic-mute-fill.svg.js +7 -0
- package/dist/assets/icons/paperclip.svg.js +6 -0
- package/dist/assets/icons/pencil-square.svg.js +7 -0
- package/dist/assets/icons/plus-lg.svg.js +6 -0
- package/dist/assets/icons/search.svg.js +6 -0
- package/dist/assets/icons/speedometer.svg.js +7 -0
- package/dist/assets/icons/x-lg.svg.js +6 -0
- package/dist/assets/styles/dark.css +126 -0
- package/dist/assets/styles/dark.css.js +4 -0
- package/dist/assets/styles/light.css +127 -0
- package/dist/assets/styles/light.css.js +4 -0
- package/dist/components/BaseElement.d.ts +33 -0
- package/dist/components/BaseElement.js +49 -0
- package/dist/components/BaseElement.styles.d.ts +1 -0
- package/dist/components/BaseElement.styles.js +29 -0
- package/dist/components/alert/Alert.d.ts +36 -0
- package/dist/components/alert/Alert.js +107 -0
- package/dist/components/alert/Alert.styles.d.ts +1 -0
- package/dist/components/alert/Alert.styles.js +114 -0
- package/dist/components/alert/index.d.ts +7 -0
- package/dist/components/button/Button.d.ts +16 -0
- package/dist/components/button/Button.js +45 -0
- package/dist/components/button/Button.styles.d.ts +1 -0
- package/dist/components/button/Button.styles.js +89 -0
- package/dist/components/button/index.d.ts +7 -0
- package/dist/components/context-menu/ContextMenu.d.ts +48 -0
- package/dist/components/context-menu/ContextMenu.js +142 -0
- package/dist/components/context-menu/ContextMenu.styles.d.ts +1 -0
- package/dist/components/context-menu/ContextMenu.styles.js +40 -0
- package/dist/components/context-menu/index.d.ts +7 -0
- package/dist/components/copy-button/CopyButton.d.ts +15 -0
- package/dist/components/copy-button/CopyButton.styles.d.ts +1 -0
- package/dist/components/copy-button/index.d.ts +7 -0
- package/dist/components/dialog/Dialog.d.ts +30 -0
- package/dist/components/dialog/Dialog.js +66 -0
- package/dist/components/dialog/Dialog.styles.d.ts +1 -0
- package/dist/components/dialog/Dialog.styles.js +32 -0
- package/dist/components/dialog/index.d.ts +7 -0
- package/dist/components/form/Form.d.ts +22 -0
- package/dist/components/form/Form.js +53 -0
- package/dist/components/form/Form.styles.d.ts +1 -0
- package/dist/components/form/Form.styles.js +18 -0
- package/dist/components/form/index.d.ts +7 -0
- package/dist/components/icon/Icon.d.ts +35 -0
- package/dist/components/icon/Icon.js +63 -0
- package/dist/components/icon/Icon.styles.d.ts +1 -0
- package/dist/components/icon/Icon.styles.js +17 -0
- package/dist/components/icon/index.d.ts +7 -0
- package/dist/components/icon-button/IconButton.d.ts +19 -0
- package/dist/components/icon-button/IconButton.js +51 -0
- package/dist/components/icon-button/IconButton.styles.d.ts +1 -0
- package/dist/components/icon-button/IconButton.styles.js +69 -0
- package/dist/components/icon-button/index.d.ts +7 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/input/Input.d.ts +73 -0
- package/dist/components/input/Input.js +193 -0
- package/dist/components/input/Input.styles.d.ts +1 -0
- package/dist/components/input/Input.styles.js +149 -0
- package/dist/components/input/index.d.ts +7 -0
- package/dist/components/menu/Menu.d.ts +36 -0
- package/dist/components/menu/Menu.js +103 -0
- package/dist/components/menu/Menu.styles.d.ts +1 -0
- package/dist/components/menu/Menu.styles.js +33 -0
- package/dist/components/menu/index.d.ts +7 -0
- package/dist/components/menu-item/MenuItem.d.ts +27 -0
- package/dist/components/menu-item/MenuItem.js +68 -0
- package/dist/components/menu-item/MenuItem.styles.d.ts +1 -0
- package/dist/components/menu-item/MenuItem.styles.js +64 -0
- package/dist/components/menu-item/index.d.ts +7 -0
- package/dist/components/panel/Panel.d.ts +10 -0
- package/dist/components/panel/Panel.js +20 -0
- package/dist/components/panel/Panel.styles.d.ts +1 -0
- package/dist/components/panel/Panel.styles.js +12 -0
- package/dist/components/panel/index.d.ts +7 -0
- package/dist/components/progress-ring/ProgressRing.d.ts +31 -0
- package/dist/components/progress-ring/ProgressRing.js +85 -0
- package/dist/components/progress-ring/ProgressRing.styles.d.ts +1 -0
- package/dist/components/progress-ring/ProgressRing.styles.js +53 -0
- package/dist/components/progress-ring/index.d.ts +7 -0
- package/dist/components/spinner/Spinner.d.ts +9 -0
- package/dist/components/spinner/Spinner.js +22 -0
- package/dist/components/spinner/Spinner.styles.d.ts +1 -0
- package/dist/components/spinner/Spinner.styles.js +57 -0
- package/dist/components/spinner/index.d.ts +7 -0
- package/dist/components/split-panel/SplitPanel.d.ts +26 -0
- package/dist/components/split-panel/SplitPanel.js +86 -0
- package/dist/components/split-panel/SplitPanel.styles.d.ts +1 -0
- package/dist/components/split-panel/SplitPanel.styles.js +19 -0
- package/dist/components/split-panel/SplitPanel.types.d.ts +2 -0
- package/dist/components/split-panel/Splitter.d.ts +17 -0
- package/dist/components/split-panel/Splitter.js +39 -0
- package/dist/components/split-panel/Splitter.styles.d.ts +1 -0
- package/dist/components/split-panel/Splitter.styles.js +45 -0
- package/dist/components/split-panel/index.d.ts +7 -0
- package/dist/components/tooltip/Tooltip.d.ts +44 -0
- package/dist/components/tooltip/Tooltip.js +130 -0
- package/dist/components/tooltip/Tooltip.styles.d.ts +1 -0
- package/dist/components/tooltip/Tooltip.styles.js +36 -0
- package/dist/components/tooltip/index.d.ts +7 -0
- package/dist/events/UChangeEvent.d.ts +6 -0
- package/dist/events/UHideEvent.d.ts +6 -0
- package/dist/events/UInputEvent.d.ts +6 -0
- package/dist/events/UResizeEvent.d.ts +6 -0
- package/dist/events/USelectEvent.d.ts +6 -0
- package/dist/events/UShowEvent.d.ts +6 -0
- package/dist/events/index.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +40 -0
- package/dist/integrations/react/UAlert.d.ts +8 -0
- package/dist/integrations/react/UAlert.js +10 -0
- package/dist/integrations/react/UButton.d.ts +8 -0
- package/dist/integrations/react/UButton.js +10 -0
- package/dist/integrations/react/UContextMenu.d.ts +8 -0
- package/dist/integrations/react/UContextMenu.js +10 -0
- package/dist/integrations/react/UCopyButton.d.ts +8 -0
- package/dist/integrations/react/UCopyButton.js +10 -0
- package/dist/integrations/react/UDialog.d.ts +8 -0
- package/dist/integrations/react/UDialog.js +10 -0
- package/dist/integrations/react/UForm.d.ts +8 -0
- package/dist/integrations/react/UForm.js +10 -0
- package/dist/integrations/react/UIcon.d.ts +8 -0
- package/dist/integrations/react/UIcon.js +10 -0
- package/dist/integrations/react/UIconButton.d.ts +8 -0
- package/dist/integrations/react/UIconButton.js +10 -0
- package/dist/integrations/react/UInput.d.ts +8 -0
- package/dist/integrations/react/UInput.js +10 -0
- package/dist/integrations/react/UMenu.d.ts +8 -0
- package/dist/integrations/react/UMenu.js +10 -0
- package/dist/integrations/react/UMenuItem.d.ts +8 -0
- package/dist/integrations/react/UMenuItem.js +10 -0
- package/dist/integrations/react/UPanel.d.ts +8 -0
- package/dist/integrations/react/UPanel.js +10 -0
- package/dist/integrations/react/UProgressRing.d.ts +8 -0
- package/dist/integrations/react/UProgressRing.js +10 -0
- package/dist/integrations/react/USpinner.d.ts +8 -0
- package/dist/integrations/react/USpinner.js +10 -0
- package/dist/integrations/react/USplitPanel.d.ts +8 -0
- package/dist/integrations/react/USplitPanel.js +10 -0
- package/dist/integrations/react/UTooltip.d.ts +8 -0
- package/dist/integrations/react/UTooltip.js +10 -0
- package/dist/integrations/react/index.d.ts +23 -0
- package/dist/integrations/react/index.js +16 -0
- package/dist/internals/attribute-converters.d.ts +10 -0
- package/dist/internals/attribute-converters.js +12 -0
- package/dist/internals/icons.d.ts +6 -0
- package/dist/internals/icons.js +67 -0
- package/dist/internals/index.d.ts +4 -0
- package/dist/internals/node-helpers.d.ts +12 -0
- package/dist/internals/node-helpers.js +21 -0
- package/dist/internals/react-wrapper.d.ts +21 -0
- package/dist/utilities/decorators.d.ts +28 -0
- package/dist/utilities/decorators.js +21 -0
- package/dist/utilities/index.d.ts +4 -0
- package/dist/utilities/notifier.d.ts +26 -0
- package/dist/utilities/notifier.js +29 -0
- package/dist/utilities/storage.d.ts +60 -0
- package/dist/utilities/storage.js +120 -0
- package/dist/utilities/theme.d.ts +54 -0
- package/dist/utilities/theme.js +108 -0
- package/package.json +58 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { html as l } from "lit";
|
|
2
|
+
import { property as n } from "lit/decorators.js";
|
|
3
|
+
import { offset as m, shift as u, flip as d, autoPlacement as p, computePosition as g } from "@floating-ui/dom";
|
|
4
|
+
import { getParentElement as f } from "../../internals/node-helpers.js";
|
|
5
|
+
import { BaseElement as v } from "../BaseElement.js";
|
|
6
|
+
import { MenuItem as C } from "../menu-item/MenuItem.js";
|
|
7
|
+
import { styles as y } from "./ContextMenu.styles.js";
|
|
8
|
+
var b = Object.defineProperty, o = (h, t, s, a) => {
|
|
9
|
+
for (var e = void 0, i = h.length - 1, c; i >= 0; i--)
|
|
10
|
+
(c = h[i]) && (e = c(t, s, e) || e);
|
|
11
|
+
return e && b(t, s, e), e;
|
|
12
|
+
};
|
|
13
|
+
class r extends v {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.mouseX = 0, this.mouseY = 0, this.open = !1, this.hoist = !0, this.distance = 2, this.show = async (t, s) => {
|
|
16
|
+
t !== void 0 && (this.mouseX = t), s !== void 0 && (this.mouseY = s), await this.updateComplete;
|
|
17
|
+
const a = {
|
|
18
|
+
getBoundingClientRect: () => ({
|
|
19
|
+
width: 0,
|
|
20
|
+
height: 0,
|
|
21
|
+
x: this.mouseX,
|
|
22
|
+
y: this.mouseY,
|
|
23
|
+
top: this.mouseY,
|
|
24
|
+
left: this.mouseX,
|
|
25
|
+
right: this.mouseX,
|
|
26
|
+
bottom: this.mouseY
|
|
27
|
+
})
|
|
28
|
+
}, e = [
|
|
29
|
+
m({ mainAxis: this.distance }),
|
|
30
|
+
u({ padding: 8 }),
|
|
31
|
+
d()
|
|
32
|
+
];
|
|
33
|
+
this.placement || e.push(p({ allowedPlacements: ["bottom-start", "bottom-end", "top-start", "top-end"] }));
|
|
34
|
+
const i = await g(a, this, {
|
|
35
|
+
placement: this.placement || "bottom-start",
|
|
36
|
+
middleware: e,
|
|
37
|
+
strategy: this.hoist ? "fixed" : "absolute"
|
|
38
|
+
});
|
|
39
|
+
Object.assign(this.style, {
|
|
40
|
+
left: `${i.x}px`,
|
|
41
|
+
top: `${i.y}px`,
|
|
42
|
+
transformOrigin: this.getTransformOrigin(i.placement)
|
|
43
|
+
}), await this.updateComplete, requestAnimationFrame(() => {
|
|
44
|
+
this.open = !0, this.emit("u-show");
|
|
45
|
+
});
|
|
46
|
+
}, this.hide = async () => {
|
|
47
|
+
await this.updateComplete, requestAnimationFrame(() => {
|
|
48
|
+
this.open = !1, this.emit("u-hide");
|
|
49
|
+
});
|
|
50
|
+
}, this.handleContextMenu = (t) => {
|
|
51
|
+
t.preventDefault(), t.stopPropagation(), this.show(t.clientX, t.clientY);
|
|
52
|
+
}, this.handleDocumentClick = (t) => {
|
|
53
|
+
this.open && !this.contains(t.target) && this.hide();
|
|
54
|
+
}, this.handleDocumentContextMenu = (t) => {
|
|
55
|
+
this.open && !this.trigger?.contains(t.target) && this.hide();
|
|
56
|
+
}, this.handleSlotChange = () => {
|
|
57
|
+
this.shadowRoot?.querySelector("slot")?.assignedElements({ flatten: !0 })?.forEach((a) => {
|
|
58
|
+
a.addEventListener("u-select", () => {
|
|
59
|
+
this.hide();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
static {
|
|
65
|
+
this.styles = [super.styles, y];
|
|
66
|
+
}
|
|
67
|
+
static {
|
|
68
|
+
this.dependencies = {
|
|
69
|
+
"u-menu-item": C
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
connectedCallback() {
|
|
73
|
+
super.connectedCallback(), this.trigger ||= f(this), this.setAttribute("role", "menu");
|
|
74
|
+
}
|
|
75
|
+
disconnectedCallback() {
|
|
76
|
+
this.detachTrigger(this.trigger), super.disconnectedCallback();
|
|
77
|
+
}
|
|
78
|
+
updated(t) {
|
|
79
|
+
if (super.updated(t), t.has("trigger") && this.trigger) {
|
|
80
|
+
const s = t.get("trigger");
|
|
81
|
+
this.detachTrigger(s), this.attachTrigger(this.trigger);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
return l`
|
|
86
|
+
<div class="container">
|
|
87
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
88
|
+
</div>
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* 메뉴가 나타날 위치에 따라 transform-origin 값을 반환합니다.
|
|
93
|
+
*/
|
|
94
|
+
getTransformOrigin(t) {
|
|
95
|
+
switch (t) {
|
|
96
|
+
case "top":
|
|
97
|
+
case "top-start":
|
|
98
|
+
case "top-end":
|
|
99
|
+
return "center bottom";
|
|
100
|
+
case "bottom":
|
|
101
|
+
case "bottom-start":
|
|
102
|
+
case "bottom-end":
|
|
103
|
+
return "center top";
|
|
104
|
+
case "left":
|
|
105
|
+
case "left-start":
|
|
106
|
+
case "left-end":
|
|
107
|
+
return "right center";
|
|
108
|
+
case "right":
|
|
109
|
+
case "right-start":
|
|
110
|
+
case "right-end":
|
|
111
|
+
return "left center";
|
|
112
|
+
default:
|
|
113
|
+
return "top left";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** 대상 엘리먼트에 컨텍스트 메뉴 이벤트를 바인딩 합니다. */
|
|
117
|
+
attachTrigger(t) {
|
|
118
|
+
t && (t.addEventListener("contextmenu", this.handleContextMenu), document.addEventListener("click", this.handleDocumentClick), document.addEventListener("contextmenu", this.handleDocumentContextMenu));
|
|
119
|
+
}
|
|
120
|
+
/** 대상 엘리먼트에 바인딩된 컨텍스트 메뉴 이벤트를 제거합니다. */
|
|
121
|
+
detachTrigger(t) {
|
|
122
|
+
t && (t.removeEventListener("contextmenu", this.handleContextMenu), document.removeEventListener("click", this.handleDocumentClick), document.removeEventListener("contextmenu", this.handleDocumentContextMenu));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
o([
|
|
126
|
+
n({ attribute: !1 })
|
|
127
|
+
], r.prototype, "trigger");
|
|
128
|
+
o([
|
|
129
|
+
n({ type: Boolean, reflect: !0 })
|
|
130
|
+
], r.prototype, "open");
|
|
131
|
+
o([
|
|
132
|
+
n({ type: Boolean, reflect: !0 })
|
|
133
|
+
], r.prototype, "hoist");
|
|
134
|
+
o([
|
|
135
|
+
n({ type: String })
|
|
136
|
+
], r.prototype, "placement");
|
|
137
|
+
o([
|
|
138
|
+
n({ type: Number })
|
|
139
|
+
], r.prototype, "distance");
|
|
140
|
+
export {
|
|
141
|
+
r as ContextMenu
|
|
142
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { css as o } from "lit";
|
|
2
|
+
const e = o`
|
|
3
|
+
:host {
|
|
4
|
+
position: absolute;
|
|
5
|
+
z-index: 1000;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
display: block;
|
|
9
|
+
width: max-content;
|
|
10
|
+
min-width: 180px;
|
|
11
|
+
|
|
12
|
+
opacity: 0;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
transform: scale(0.95);
|
|
15
|
+
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
16
|
+
}
|
|
17
|
+
:host([open]) {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
transform: scale(1);
|
|
20
|
+
pointer-events: auto;
|
|
21
|
+
}
|
|
22
|
+
:host([hoist]) {
|
|
23
|
+
position: fixed;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.container {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
gap: 2px;
|
|
30
|
+
padding: 4px;
|
|
31
|
+
border: 1px solid var(--u-border-color, #ddd);
|
|
32
|
+
border-radius: 8px;
|
|
33
|
+
background-color: var(--u-bg-color, #fff);
|
|
34
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
export {
|
|
39
|
+
e as styles
|
|
40
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseElement } from '../BaseElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* 복사 버튼 컴포넌트입니다.
|
|
4
|
+
*/
|
|
5
|
+
export declare class CopyButton extends BaseElement {
|
|
6
|
+
static styles: import('lit').CSSResultGroup[];
|
|
7
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
8
|
+
/** 버튼의 테두리 유무를 설정합니다. 기본값은 true로, 테두리가 없습니다. */
|
|
9
|
+
borderless: boolean;
|
|
10
|
+
/** 버튼이 비활성화 상태인지 여부를 설정합니다. 비활성화된 버튼은 클릭할 수 없습니다. */
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
/** 버튼의 복사 상태를 설정합니다. 복사가 완료되면 true로 변경됩니다. */
|
|
13
|
+
copied: boolean;
|
|
14
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { BaseElement } from '../BaseElement.js';
|
|
3
|
+
/**
|
|
4
|
+
* Dialog 컴포넌트는 모달 대화상자를 제공합니다.
|
|
5
|
+
* 오버레이와 함께 화면 중앙에 표시되며, 헤더, 본문, 푸터 영역을 슬롯으로 제공합니다.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Dialog extends BaseElement {
|
|
8
|
+
static styles: import('lit').CSSResultGroup[];
|
|
9
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
10
|
+
overlayEl: HTMLDivElement;
|
|
11
|
+
/** 다이얼로그가 열려있는지 여부 */
|
|
12
|
+
open: boolean;
|
|
13
|
+
/** 오버레이 클릭 시 닫기 활성화 여부 */
|
|
14
|
+
closeOnOverlayClick: boolean;
|
|
15
|
+
/** ESC 키로 닫기 활성화 여부 */
|
|
16
|
+
closeOnEscape: boolean;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
disconnectedCallback(): void;
|
|
19
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
20
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
21
|
+
/** 다이얼로그를 표시합니다 */
|
|
22
|
+
show: () => Promise<void>;
|
|
23
|
+
/** 다이얼로그를 숨깁니다 */
|
|
24
|
+
hide: () => Promise<void>;
|
|
25
|
+
/** 오버레이 클릭 핸들러 */
|
|
26
|
+
private handleOverlayClick;
|
|
27
|
+
/** 키보드 이벤트 핸들러 */
|
|
28
|
+
private handleKeyDown;
|
|
29
|
+
private updateOpenState;
|
|
30
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { html as p } from "lit";
|
|
2
|
+
import { query as d, property as a } from "lit/decorators.js";
|
|
3
|
+
import { BaseElement as h } from "../BaseElement.js";
|
|
4
|
+
import { styles as c } from "./Dialog.styles.js";
|
|
5
|
+
var y = Object.defineProperty, s = (i, e, n, u) => {
|
|
6
|
+
for (var t = void 0, l = i.length - 1, r; l >= 0; l--)
|
|
7
|
+
(r = i[l]) && (t = r(e, n, t) || t);
|
|
8
|
+
return t && y(e, n, t), t;
|
|
9
|
+
};
|
|
10
|
+
class o extends h {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.open = !1, this.closeOnOverlayClick = !0, this.closeOnEscape = !0, this.show = async () => {
|
|
13
|
+
this.open = !0, await this.updateComplete;
|
|
14
|
+
}, this.hide = async () => {
|
|
15
|
+
await this.updateComplete, this.open = !1;
|
|
16
|
+
}, this.handleOverlayClick = (e) => {
|
|
17
|
+
this.closeOnOverlayClick && e.target === this.overlayEl && this.hide();
|
|
18
|
+
}, this.handleKeyDown = (e) => {
|
|
19
|
+
this.closeOnEscape && e.key === "Escape" && this.open && (e.preventDefault(), this.hide());
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
static {
|
|
23
|
+
this.styles = [super.styles, c];
|
|
24
|
+
}
|
|
25
|
+
static {
|
|
26
|
+
this.dependencies = {};
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback(), window.addEventListener("keydown", this.handleKeyDown);
|
|
30
|
+
}
|
|
31
|
+
disconnectedCallback() {
|
|
32
|
+
window.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback();
|
|
33
|
+
}
|
|
34
|
+
updated(e) {
|
|
35
|
+
super.updated(e), e.has("open") && this.updateOpenState(this.open);
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
return p`
|
|
39
|
+
<div class="overlay" part="overlay"
|
|
40
|
+
?hidden=${!this.open}
|
|
41
|
+
@click=${this.handleOverlayClick}>
|
|
42
|
+
<div class="panel" part="panel">
|
|
43
|
+
<slot></slot>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
updateOpenState(e) {
|
|
49
|
+
e ? (document.body.style.overflow = "hidden", this.emit("u-show")) : (document.body.style.overflow = "", this.emit("u-hide"));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
s([
|
|
53
|
+
d(".overlay")
|
|
54
|
+
], o.prototype, "overlayEl");
|
|
55
|
+
s([
|
|
56
|
+
a({ type: Boolean, reflect: !0 })
|
|
57
|
+
], o.prototype, "open");
|
|
58
|
+
s([
|
|
59
|
+
a({ type: Boolean })
|
|
60
|
+
], o.prototype, "closeOnOverlayClick");
|
|
61
|
+
s([
|
|
62
|
+
a({ type: Boolean })
|
|
63
|
+
], o.prototype, "closeOnEscape");
|
|
64
|
+
export {
|
|
65
|
+
o as Dialog
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { css as o } from "lit";
|
|
2
|
+
const r = o`
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.overlay {
|
|
8
|
+
position: fixed;
|
|
9
|
+
z-index: 9999;
|
|
10
|
+
top: 0;
|
|
11
|
+
left: 0;
|
|
12
|
+
width: 100vw;
|
|
13
|
+
height: 100vh;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
background: var(--u-overlay-bg-color);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.panel {
|
|
21
|
+
display: block;
|
|
22
|
+
background: var(--u-panel-bg-color);
|
|
23
|
+
border: 1px solid var(--u-border-color);
|
|
24
|
+
border-radius: 6px;
|
|
25
|
+
max-width: 90vw;
|
|
26
|
+
max-height: 90vh;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
export {
|
|
31
|
+
r as styles
|
|
32
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseElement } from '../BaseElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* Form 컴포넌트는 여러 입력 요소를 그룹화하고 관리하는 폼 컨테이너입니다.
|
|
4
|
+
* 폼 내의 입력 요소들의 값 변경을 감지하고, 포함 및 제외 규칙에 따라 폼 컨텍스트에 데이터를 자동으로 업데이트합니다.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Form extends BaseElement {
|
|
7
|
+
static styles: import('lit').CSSResultGroup[];
|
|
8
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
9
|
+
/** 포함할 입력 요소의 name 속성 목록입니다. */
|
|
10
|
+
includes: string[];
|
|
11
|
+
/** 제외할 입력 요소의 name 속성 목록입니다. */
|
|
12
|
+
excludes: string[];
|
|
13
|
+
/** 폼의 컨텍스트 데이터를 설정합니다. */
|
|
14
|
+
context?: any;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
18
|
+
/** 폼 내의 모든 입력 요소를 검증합니다. */
|
|
19
|
+
validate(): boolean;
|
|
20
|
+
/** 입력 요소의 변경 이벤트를 처리합니다. */
|
|
21
|
+
private handleChange;
|
|
22
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { html as u } from "lit";
|
|
2
|
+
import { property as i } from "lit/decorators.js";
|
|
3
|
+
import { arrayAttributeConverter as d } from "../../internals/attribute-converters.js";
|
|
4
|
+
import { BaseElement as p } from "../BaseElement.js";
|
|
5
|
+
import { Input as h } from "../input/Input.js";
|
|
6
|
+
import { styles as f } from "./Form.styles.js";
|
|
7
|
+
var m = Object.defineProperty, a = (t, n, r, s) => {
|
|
8
|
+
for (var e = void 0, o = t.length - 1, c; o >= 0; o--)
|
|
9
|
+
(c = t[o]) && (e = c(n, r, e) || e);
|
|
10
|
+
return e && m(n, r, e), e;
|
|
11
|
+
};
|
|
12
|
+
class l extends p {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this.includes = [], this.excludes = [], this.handleChange = (n) => {
|
|
15
|
+
const r = n.target, s = r.name, e = r.value;
|
|
16
|
+
s && this.includes.includes(s) && (this.excludes.includes(s) || this.context && typeof this.context == "object" && (this.context[s] = e));
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static {
|
|
20
|
+
this.styles = [super.styles, f];
|
|
21
|
+
}
|
|
22
|
+
static {
|
|
23
|
+
this.dependencies = {};
|
|
24
|
+
}
|
|
25
|
+
connectedCallback() {
|
|
26
|
+
super.connectedCallback(), this.addEventListener("change", this.handleChange);
|
|
27
|
+
}
|
|
28
|
+
disconnectedCallback() {
|
|
29
|
+
this.removeEventListener("change", this.handleChange), super.disconnectedCallback();
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return u`
|
|
33
|
+
<slot></slot>
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
/** 폼 내의 모든 입력 요소를 검증합니다. */
|
|
37
|
+
validate() {
|
|
38
|
+
const r = this.shadowRoot?.querySelector("slot")?.assignedElements({ flatten: !0 }).filter((e) => e instanceof h) || [];
|
|
39
|
+
return Array.from(r).every((e) => e.validate());
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
a([
|
|
43
|
+
i({ type: Array, converter: d((t) => t) })
|
|
44
|
+
], l.prototype, "includes");
|
|
45
|
+
a([
|
|
46
|
+
i({ type: Array, converter: d((t) => t) })
|
|
47
|
+
], l.prototype, "excludes");
|
|
48
|
+
a([
|
|
49
|
+
i({ type: Object, attribute: !1 })
|
|
50
|
+
], l.prototype, "context");
|
|
51
|
+
export {
|
|
52
|
+
l as Form
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { css as t } from "lit";
|
|
2
|
+
const e = t`
|
|
3
|
+
:host {
|
|
4
|
+
width: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: stretch;
|
|
8
|
+
justify-content: flex-start;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:host * {
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
export {
|
|
17
|
+
e as styles
|
|
18
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BaseElement } from '../BaseElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* 아이콘 컴포넌트입니다. SVG 아이콘을 이름으로 불러와서 렌더링합니다.
|
|
4
|
+
*/
|
|
5
|
+
export declare class Icon extends BaseElement {
|
|
6
|
+
static styles: import('lit').CSSResultGroup[];
|
|
7
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
8
|
+
/**
|
|
9
|
+
* 아이콘을 외부에서 불러올 때 사용되는 기본 경로를 설정합니다.
|
|
10
|
+
* @default '/assets/icons/'
|
|
11
|
+
*/
|
|
12
|
+
static remoteBaseUrl: string;
|
|
13
|
+
/**
|
|
14
|
+
* 아이콘을 외부에서 로드할때 사용하는 설정입니다.
|
|
15
|
+
* @see {@link Icon.remoteBaseUrl}에서 외부 기본 경로를 설정할 수 있습니다.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
remote: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 사용할 아이콘의 이름을 지정합니다.
|
|
21
|
+
* @description 외부에서 불러오는 SVG 아이콘인 경우, 이름은 파일명(확장자 제외)이어야 합니다.
|
|
22
|
+
*/
|
|
23
|
+
name?: string;
|
|
24
|
+
render(): import('lit-html/directive.js').DirectiveResult<typeof import('lit-html/directives/until.js').UntilDirective>;
|
|
25
|
+
/**
|
|
26
|
+
* 아이콘의 HTML 콘텐츠를 가져옵니다.
|
|
27
|
+
* 외부 아이콘 경로를 사용하거나, 내부 레지스트리에서 아이콘을 찾습니다.
|
|
28
|
+
* @param name 아이콘 이름
|
|
29
|
+
*/
|
|
30
|
+
private load;
|
|
31
|
+
/**
|
|
32
|
+
* SVG 콘텐츠가 유효한 HTML인지 검사합니다.
|
|
33
|
+
*/
|
|
34
|
+
private validate;
|
|
35
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { nothing as n } from "lit";
|
|
2
|
+
import { property as l } from "lit/decorators.js";
|
|
3
|
+
import { unsafeHTML as c } from "lit/directives/unsafe-html.js";
|
|
4
|
+
import { until as u } from "lit/directives/until.js";
|
|
5
|
+
import { BaseElement as d } from "../BaseElement.js";
|
|
6
|
+
import { icons as h } from "../../internals/icons.js";
|
|
7
|
+
import { styles as v } from "./Icon.styles.js";
|
|
8
|
+
var y = Object.defineProperty, p = (m, e, s, r) => {
|
|
9
|
+
for (var t = void 0, i = m.length - 1, f; i >= 0; i--)
|
|
10
|
+
(f = m[i]) && (t = f(e, s, t) || t);
|
|
11
|
+
return t && y(e, s, t), t;
|
|
12
|
+
};
|
|
13
|
+
const a = class o extends d {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.remote = !1;
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.styles = [super.styles, v];
|
|
19
|
+
}
|
|
20
|
+
static {
|
|
21
|
+
this.dependencies = {};
|
|
22
|
+
}
|
|
23
|
+
static {
|
|
24
|
+
this.remoteBaseUrl = "/assets/icons/";
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
return this.name ? u(this.load(this.name).then((e) => this.validate(e) ? c(e) : n), n) : n;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 아이콘의 HTML 콘텐츠를 가져옵니다.
|
|
31
|
+
* 외부 아이콘 경로를 사용하거나, 내부 레지스트리에서 아이콘을 찾습니다.
|
|
32
|
+
* @param name 아이콘 이름
|
|
33
|
+
*/
|
|
34
|
+
async load(e) {
|
|
35
|
+
if (this.remote) {
|
|
36
|
+
const s = o.remoteBaseUrl.endsWith("/") ? `${o.remoteBaseUrl}${e}.svg` : `${o.remoteBaseUrl}/${e}.svg`;
|
|
37
|
+
try {
|
|
38
|
+
const r = await fetch(s);
|
|
39
|
+
return r.ok ? (await r.text())?.trim() : void 0;
|
|
40
|
+
} catch (r) {
|
|
41
|
+
console.error(r);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
} else
|
|
45
|
+
return h.get(e)?.trim();
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* SVG 콘텐츠가 유효한 HTML인지 검사합니다.
|
|
49
|
+
*/
|
|
50
|
+
validate(e) {
|
|
51
|
+
return !(!e || !e.endsWith("</svg>"));
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
p([
|
|
55
|
+
l({ type: Boolean })
|
|
56
|
+
], a.prototype, "remote");
|
|
57
|
+
p([
|
|
58
|
+
l({ type: String })
|
|
59
|
+
], a.prototype, "name");
|
|
60
|
+
let w = a;
|
|
61
|
+
export {
|
|
62
|
+
w as Icon
|
|
63
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { css as o } from "lit";
|
|
2
|
+
const e = o`
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
font-size: inherit;
|
|
6
|
+
color: var(--u-icon-color, currentColor);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
svg {
|
|
10
|
+
width: 1em;
|
|
11
|
+
height: 1em;
|
|
12
|
+
fill: currentColor;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
export {
|
|
16
|
+
e as styles
|
|
17
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseElement } from '../BaseElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* IconButton 컴포넌트는 아이콘만 표시하는 버튼입니다.
|
|
4
|
+
*/
|
|
5
|
+
export declare class IconButton extends BaseElement {
|
|
6
|
+
static styles: import('lit').CSSResultGroup[];
|
|
7
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
8
|
+
/** 경계선이 없는 버튼 스타일을 적용합니다. */
|
|
9
|
+
borderless: boolean;
|
|
10
|
+
/** 버튼이 비활성화 상태인지 여부를 설정합니다. 비활성화된 버튼은 클릭할 수 없습니다. */
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
/** 버튼이 로딩 상태인지 여부를 설정합니다. 로딩 중에는 버튼이 비활성화되고 스피너가 표시됩니다. */
|
|
13
|
+
loading: boolean;
|
|
14
|
+
/** 아이콘을 외부에서 불러와야 하는지 여부를 설정합니다. */
|
|
15
|
+
remote: boolean;
|
|
16
|
+
/** 아이콘의 이름을 지정합니다. */
|
|
17
|
+
name?: string;
|
|
18
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { html as n } from "lit";
|
|
2
|
+
import { property as t } from "lit/decorators.js";
|
|
3
|
+
import { ifDefined as m } from "lit/directives/if-defined.js";
|
|
4
|
+
import { BaseElement as d } from "../BaseElement.js";
|
|
5
|
+
import { Spinner as f } from "../spinner/Spinner.js";
|
|
6
|
+
import { Icon as u } from "../icon/Icon.js";
|
|
7
|
+
import { styles as c } from "./IconButton.styles.js";
|
|
8
|
+
var y = Object.defineProperty, r = (s, p, l, h) => {
|
|
9
|
+
for (var e = void 0, i = s.length - 1, a; i >= 0; i--)
|
|
10
|
+
(a = s[i]) && (e = a(p, l, e) || e);
|
|
11
|
+
return e && y(p, l, e), e;
|
|
12
|
+
};
|
|
13
|
+
class o extends d {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.borderless = !1, this.disabled = !1, this.loading = !1, this.remote = !1;
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.styles = [super.styles, c];
|
|
19
|
+
}
|
|
20
|
+
static {
|
|
21
|
+
this.dependencies = {
|
|
22
|
+
"u-spinner": f,
|
|
23
|
+
"u-icon": u
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
return n`
|
|
28
|
+
<button part="base" ?disabled=${this.disabled || this.loading}>
|
|
29
|
+
${this.loading ? n`<u-spinner></u-spinner>` : n`<u-icon ?remote=${this.remote} name=${m(this.name)}></u-icon>`}
|
|
30
|
+
</button>
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
r([
|
|
35
|
+
t({ type: Boolean, reflect: !0 })
|
|
36
|
+
], o.prototype, "borderless");
|
|
37
|
+
r([
|
|
38
|
+
t({ type: Boolean, reflect: !0 })
|
|
39
|
+
], o.prototype, "disabled");
|
|
40
|
+
r([
|
|
41
|
+
t({ type: Boolean, reflect: !0 })
|
|
42
|
+
], o.prototype, "loading");
|
|
43
|
+
r([
|
|
44
|
+
t({ type: Boolean })
|
|
45
|
+
], o.prototype, "remote");
|
|
46
|
+
r([
|
|
47
|
+
t({ type: String })
|
|
48
|
+
], o.prototype, "name");
|
|
49
|
+
export {
|
|
50
|
+
o as IconButton
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|