@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,27 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { BaseElement } from '../BaseElement.js';
|
|
3
|
+
/**
|
|
4
|
+
* MenuItem 컴포넌트는 메뉴의 개별 항목을 나타냅니다.
|
|
5
|
+
* u-menu 및 u-context-menu와 함께 사용됩니다.
|
|
6
|
+
*/
|
|
7
|
+
export declare class MenuItem extends BaseElement {
|
|
8
|
+
static styles: import('lit').CSSResultGroup[];
|
|
9
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
10
|
+
/** 메뉴 항목이 비활성화 상태인지 여부입니다. */
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
/** 메뉴 항목이 선택된 상태인지 여부입니다. */
|
|
13
|
+
selected: boolean;
|
|
14
|
+
/** 체크 가능한 경우, 체크 상태인지 여부입니다. */
|
|
15
|
+
checked: boolean;
|
|
16
|
+
/** 메뉴 항목에 체크 표시를 할 수 있는지 여부입니다. */
|
|
17
|
+
checkable: boolean;
|
|
18
|
+
/** 메뉴 항목의 값입니다. */
|
|
19
|
+
value: string;
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
22
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
23
|
+
/** 메뉴 항목의 앞부분을 렌더링합니다. */
|
|
24
|
+
private renderPrefixItem;
|
|
25
|
+
/** 클릭 이벤트를 처리합니다. */
|
|
26
|
+
private handleClick;
|
|
27
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { html as d, nothing as n } from "lit";
|
|
2
|
+
import { property as s } from "lit/decorators.js";
|
|
3
|
+
import { BaseElement as o } from "../BaseElement.js";
|
|
4
|
+
import { styles as p } from "./MenuItem.styles.js";
|
|
5
|
+
var u = Object.defineProperty, i = (l, e, c, f) => {
|
|
6
|
+
for (var t = void 0, a = l.length - 1, h; a >= 0; a--)
|
|
7
|
+
(h = l[a]) && (t = h(e, c, t) || t);
|
|
8
|
+
return t && u(e, c, t), t;
|
|
9
|
+
};
|
|
10
|
+
class r extends o {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.disabled = !1, this.selected = !1, this.checked = !1, this.checkable = !1, this.value = "", this.handleClick = (e) => {
|
|
13
|
+
if (this.disabled) {
|
|
14
|
+
e.preventDefault(), e.stopPropagation();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
this.checkable ? (this.checked = !this.checked, this.emit("u-check", { checked: this.checked })) : this.emit("u-select", { value: this.value });
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static {
|
|
21
|
+
this.styles = [super.styles, p];
|
|
22
|
+
}
|
|
23
|
+
static {
|
|
24
|
+
this.dependencies = {};
|
|
25
|
+
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
super.connectedCallback(), this.setAttribute("role", "menuitem"), this.setAttribute("tabindex", this.disabled ? "-1" : "0");
|
|
28
|
+
}
|
|
29
|
+
updated(e) {
|
|
30
|
+
super.updated(e), e.has("disabled") && (this.setAttribute("tabindex", this.disabled ? "-1" : "0"), this.setAttribute("aria-disabled", this.disabled ? "true" : "false")), e.has("checked") && this.setAttribute("aria-checked", this.checked ? "true" : "false");
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return d`
|
|
34
|
+
<div class="container" @click=${this.handleClick}>
|
|
35
|
+
${this.renderPrefixItem()}
|
|
36
|
+
<slot name="prefix"></slot>
|
|
37
|
+
<span class="content">
|
|
38
|
+
<slot></slot>
|
|
39
|
+
</span>
|
|
40
|
+
<slot name="suffix"></slot>
|
|
41
|
+
</div>
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
/** 메뉴 항목의 앞부분을 렌더링합니다. */
|
|
45
|
+
renderPrefixItem() {
|
|
46
|
+
return this.checkable ? d`
|
|
47
|
+
<span class="checker" ?checked=${this.checked}>✓</span>
|
|
48
|
+
` : n;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
i([
|
|
52
|
+
s({ type: Boolean, reflect: !0 })
|
|
53
|
+
], r.prototype, "disabled");
|
|
54
|
+
i([
|
|
55
|
+
s({ type: Boolean, reflect: !0 })
|
|
56
|
+
], r.prototype, "selected");
|
|
57
|
+
i([
|
|
58
|
+
s({ type: Boolean, reflect: !0 })
|
|
59
|
+
], r.prototype, "checked");
|
|
60
|
+
i([
|
|
61
|
+
s({ type: Boolean })
|
|
62
|
+
], r.prototype, "checkable");
|
|
63
|
+
i([
|
|
64
|
+
s({ type: String })
|
|
65
|
+
], r.prototype, "value");
|
|
66
|
+
export {
|
|
67
|
+
r as MenuItem
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { css as e } from "lit";
|
|
2
|
+
const r = e`
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
|
|
6
|
+
--selected-color: var(--u-blue-600, #0066cc);
|
|
7
|
+
--selected-bg-color: var(--u-blue-50, #e8f4f8);
|
|
8
|
+
}
|
|
9
|
+
:host([disabled]) {
|
|
10
|
+
opacity: 0.5;
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
cursor: not-allowed;
|
|
13
|
+
}
|
|
14
|
+
:host([disabled]) .container {
|
|
15
|
+
cursor: not-allowed;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
18
|
+
:host(:not([disabled])) .container:hover {
|
|
19
|
+
background-color: var(--u-bg-color-hover, #f5f5f5);
|
|
20
|
+
}
|
|
21
|
+
:host([selected]) .container {
|
|
22
|
+
color: var(--selected-color, #0066cc);
|
|
23
|
+
background-color: var(--selected-bg-color, #e8f4f8);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.container {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: row;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: 8px;
|
|
31
|
+
padding: 8px 12px;
|
|
32
|
+
line-height: 1.5;
|
|
33
|
+
border-radius: 4px;
|
|
34
|
+
background-color: transparent;
|
|
35
|
+
transition: background-color 0.2s ease;
|
|
36
|
+
user-select: none;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.checker {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
opacity: 0;
|
|
45
|
+
width: 1em;
|
|
46
|
+
font-size: 0.75em;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
color: var(--u-blue-600, #0066cc);
|
|
49
|
+
transition: opacity 0.2s ease;
|
|
50
|
+
}
|
|
51
|
+
.checker[checked] {
|
|
52
|
+
opacity: 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.content {
|
|
56
|
+
flex: 1;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
text-overflow: ellipsis;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
export {
|
|
63
|
+
r as styles
|
|
64
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseElement } from '../BaseElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* 각 패널은 독립적인 크기와 콘텐츠를 가질 수 있습니다.
|
|
4
|
+
*/
|
|
5
|
+
export declare class Panel extends BaseElement {
|
|
6
|
+
static styles: import('lit').CSSResultGroup[];
|
|
7
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { html as e } from "lit";
|
|
2
|
+
import { BaseElement as s } from "../BaseElement.js";
|
|
3
|
+
import { styles as t } from "./Panel.styles.js";
|
|
4
|
+
class o extends s {
|
|
5
|
+
static {
|
|
6
|
+
this.styles = [super.styles, t];
|
|
7
|
+
}
|
|
8
|
+
static {
|
|
9
|
+
this.dependencies = {};
|
|
10
|
+
}
|
|
11
|
+
connectedCallback() {
|
|
12
|
+
super.connectedCallback(), this.classList.add("scrollable");
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return e`<slot></slot>`;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
o as Panel
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { BaseElement } from '../BaseElement.js';
|
|
3
|
+
/** 원형 진행 표시기의 변형 타입 */
|
|
4
|
+
export type ProgressRingVariant = 'smooth' | 'blocks' | 'ticks';
|
|
5
|
+
/**
|
|
6
|
+
* ProgressRing 컴포넌트는 원형 진행 표시기를 제공합니다.
|
|
7
|
+
* 진행 상태를 시각적으로 나타내며, 크기와 두께를 스타일 속성으로 조절할 수 있습니다.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ProgressRing extends BaseElement {
|
|
10
|
+
static styles: import('lit').CSSResultGroup[];
|
|
11
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
12
|
+
progress: number;
|
|
13
|
+
dasharray: string;
|
|
14
|
+
/** 진행 표시기의 스타일 변형을 설정합니다. */
|
|
15
|
+
variant: ProgressRingVariant;
|
|
16
|
+
/** 진행 표시기의 최소값을 설정합니다. */
|
|
17
|
+
minValue: number;
|
|
18
|
+
/** 진행 표시기의 최대값을 설정합니다. */
|
|
19
|
+
maxValue: number;
|
|
20
|
+
/** 진행 표시기의 현재 값을 설정합니다. */
|
|
21
|
+
value: number;
|
|
22
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
23
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
24
|
+
/** 진행 상태를 0과 1 사이의 값으로 반환합니다. */
|
|
25
|
+
private updateProgress;
|
|
26
|
+
/**
|
|
27
|
+
* variant에 따라 dasharray 값을 반환합니다.
|
|
28
|
+
* [dash-length] [gap-length] or [dash-length] 형식
|
|
29
|
+
*/
|
|
30
|
+
private updateDashArray;
|
|
31
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { html as d } from "lit";
|
|
2
|
+
import { state as n, property as h } from "lit/decorators.js";
|
|
3
|
+
import { BaseElement as c } from "../BaseElement.js";
|
|
4
|
+
import { styles as m } from "./ProgressRing.styles.js";
|
|
5
|
+
var y = Object.defineProperty, a = (p, r, s, o) => {
|
|
6
|
+
for (var e = void 0, l = p.length - 1, u; l >= 0; l--)
|
|
7
|
+
(u = p[l]) && (e = u(r, s, e) || e);
|
|
8
|
+
return e && y(r, s, e), e;
|
|
9
|
+
};
|
|
10
|
+
const t = 100;
|
|
11
|
+
class i extends c {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.progress = 0, this.dasharray = t.toString(), this.variant = "smooth", this.minValue = 0, this.maxValue = 100, this.value = 0;
|
|
14
|
+
}
|
|
15
|
+
static {
|
|
16
|
+
this.styles = [super.styles, m];
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
this.dependencies = {};
|
|
20
|
+
}
|
|
21
|
+
willUpdate(r) {
|
|
22
|
+
super.willUpdate(r), r.has("variant") && (this.dasharray = this.updateDashArray(this.variant)), (r.has("minValue") || r.has("maxValue") || r.has("value")) && (this.progress = this.updateProgress(this.minValue, this.maxValue, this.value));
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return d`
|
|
26
|
+
<svg class="progress-ring" part="base">
|
|
27
|
+
<defs>
|
|
28
|
+
<mask id="progress-mask">
|
|
29
|
+
<circle
|
|
30
|
+
pathLength="${t}"
|
|
31
|
+
stroke="white"
|
|
32
|
+
stroke-dasharray="${t}"
|
|
33
|
+
stroke-dashoffset="${t * (1 - this.progress)}"
|
|
34
|
+
></circle>
|
|
35
|
+
</mask>
|
|
36
|
+
</defs>
|
|
37
|
+
|
|
38
|
+
<circle
|
|
39
|
+
class="track"
|
|
40
|
+
pathLength="${t}"
|
|
41
|
+
stroke-dasharray="${this.dasharray}"
|
|
42
|
+
></circle>
|
|
43
|
+
<circle
|
|
44
|
+
class="indicator"
|
|
45
|
+
pathLength="${t}"
|
|
46
|
+
stroke-dasharray="${this.dasharray}"
|
|
47
|
+
mask="url(#progress-mask)"
|
|
48
|
+
></circle>
|
|
49
|
+
</svg>
|
|
50
|
+
<div class="label" part="label">${Math.round(this.progress * 100)}%</div>
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
/** 진행 상태를 0과 1 사이의 값으로 반환합니다. */
|
|
54
|
+
updateProgress(r, s, o) {
|
|
55
|
+
return r = Number(r ?? 0), s = Number(s ?? 100), o = Math.min(Math.max(Number(o ?? 0), r), s), s === r ? 0 : (o - r) / (s - r);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* variant에 따라 dasharray 값을 반환합니다.
|
|
59
|
+
* [dash-length] [gap-length] or [dash-length] 형식
|
|
60
|
+
*/
|
|
61
|
+
updateDashArray(r) {
|
|
62
|
+
return r === "ticks" ? "1 1" : r === "blocks" ? "8 2" : t.toString();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
a([
|
|
66
|
+
n()
|
|
67
|
+
], i.prototype, "progress");
|
|
68
|
+
a([
|
|
69
|
+
n()
|
|
70
|
+
], i.prototype, "dasharray");
|
|
71
|
+
a([
|
|
72
|
+
h({ type: String, reflect: !0 })
|
|
73
|
+
], i.prototype, "variant");
|
|
74
|
+
a([
|
|
75
|
+
h({ type: Number })
|
|
76
|
+
], i.prototype, "minValue");
|
|
77
|
+
a([
|
|
78
|
+
h({ type: Number })
|
|
79
|
+
], i.prototype, "maxValue");
|
|
80
|
+
a([
|
|
81
|
+
h({ type: Number })
|
|
82
|
+
], i.prototype, "value");
|
|
83
|
+
export {
|
|
84
|
+
i as ProgressRing
|
|
85
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { css as t } from "lit";
|
|
2
|
+
const r = t`
|
|
3
|
+
:host {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
font-size: inherit;
|
|
7
|
+
|
|
8
|
+
--track-width: 0.25em;
|
|
9
|
+
--track-color: var(--u-neutral-200, #e5e7eb);
|
|
10
|
+
--indicator-color: var(--u-blue-600, #3b82f6);
|
|
11
|
+
}
|
|
12
|
+
/* smooth variant - 매끄러운 원형 */
|
|
13
|
+
:host([variant="smooth"]) .mask {
|
|
14
|
+
stroke-linecap: round;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.progress-ring {
|
|
18
|
+
width: 6em;
|
|
19
|
+
height: 6em;
|
|
20
|
+
transform: rotate(-90deg); /* 0%가 위에서 시작하도록 회전 */
|
|
21
|
+
}
|
|
22
|
+
.progress-ring circle {
|
|
23
|
+
fill: none;
|
|
24
|
+
stroke-width: var(--track-width);
|
|
25
|
+
r: calc(3em - var(--track-width) / 2);
|
|
26
|
+
cx: 3em;
|
|
27
|
+
cy: 3em;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.track {
|
|
31
|
+
stroke: var(--track-color);
|
|
32
|
+
}
|
|
33
|
+
.indicator {
|
|
34
|
+
stroke: var(--indicator-color);
|
|
35
|
+
transition: stroke-dashoffset 350ms ease;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* 라벨 중앙 숫자 */
|
|
39
|
+
.label {
|
|
40
|
+
position: absolute;
|
|
41
|
+
inset: 0;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
font-size: 1.1em;
|
|
47
|
+
color: var(--indicator-color);
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
export {
|
|
52
|
+
r as styles
|
|
53
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseElement } from '../BaseElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* Spinner 컴포넌트는 로딩 상태를 시각적으로 표시하는 회전하는 원형 스피너를 제공합니다.
|
|
4
|
+
*/
|
|
5
|
+
export declare class Spinner extends BaseElement {
|
|
6
|
+
static styles: import('lit').CSSResultGroup[];
|
|
7
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
8
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { html as s } from "lit";
|
|
2
|
+
import { BaseElement as e } from "../BaseElement.js";
|
|
3
|
+
import { styles as r } from "./Spinner.styles.js";
|
|
4
|
+
class a extends e {
|
|
5
|
+
static {
|
|
6
|
+
this.styles = [super.styles, r];
|
|
7
|
+
}
|
|
8
|
+
static {
|
|
9
|
+
this.dependencies = {};
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return s`
|
|
13
|
+
<svg class="spinner" part="base">
|
|
14
|
+
<circle class="track"></circle>
|
|
15
|
+
<circle class="indicator"></circle>
|
|
16
|
+
</svg>
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
a as Spinner
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { css as r } from "lit";
|
|
2
|
+
const t = r`
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
font-size: inherit;
|
|
6
|
+
|
|
7
|
+
--track-width: 0.125em;
|
|
8
|
+
--track-color: var(--u-neutral-200, #e5e7eb);
|
|
9
|
+
--indicator-color: var(--u-neutral-800, #1f2937);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.spinner {
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
width: 1em;
|
|
15
|
+
height: 1em;
|
|
16
|
+
}
|
|
17
|
+
.spinner circle {
|
|
18
|
+
fill: none;
|
|
19
|
+
stroke-width: var(--track-width);
|
|
20
|
+
r: calc(0.5em - var(--track-width) / 2);
|
|
21
|
+
cx: 0.5em;
|
|
22
|
+
cy: 0.5em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.track {
|
|
26
|
+
stroke: var(--track-color);
|
|
27
|
+
transform-origin: 0% 0%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.indicator {
|
|
31
|
+
stroke: var(--indicator-color);
|
|
32
|
+
stroke-linecap: round;
|
|
33
|
+
stroke-dasharray: 150% 75%;
|
|
34
|
+
transform-origin: 50% 50%;
|
|
35
|
+
animation: spin 2s linear infinite;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@keyframes spin {
|
|
39
|
+
0% {
|
|
40
|
+
transform: rotate(0deg);
|
|
41
|
+
stroke-dasharray: 0.05em, 3em;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
50% {
|
|
45
|
+
transform: rotate(450deg);
|
|
46
|
+
stroke-dasharray: 1.375em, 1.375em;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
100% {
|
|
50
|
+
transform: rotate(1080deg);
|
|
51
|
+
stroke-dasharray: 0.05em, 3em;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
export {
|
|
56
|
+
t as styles
|
|
57
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseElement } from '../BaseElement.js';
|
|
2
|
+
import { PanelOrientation } from './SplitPanel.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* SplitPanel 컴포넌트는 화면을 여러 개의 패널로 분할하여 표시합니다.
|
|
5
|
+
*/
|
|
6
|
+
export declare class SplitPanel extends BaseElement {
|
|
7
|
+
static styles: import('lit').CSSResultGroup[];
|
|
8
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
9
|
+
private panels;
|
|
10
|
+
private splitters;
|
|
11
|
+
private isDragging;
|
|
12
|
+
private currentSplitter;
|
|
13
|
+
private totalSize;
|
|
14
|
+
private startPosition;
|
|
15
|
+
private startRatio;
|
|
16
|
+
/** 분할 방향을 설정합니다. 'horizontal'은 좌우 분할, 'vertical'은 상하 분할입니다. */
|
|
17
|
+
orientation: PanelOrientation;
|
|
18
|
+
/** 초기 패널 크기 비율을 설정합니다. (예: [30, 70]은 첫 번째 패널이 30%, 두 번째 패널이 70%를 차지) */
|
|
19
|
+
ratio: number[];
|
|
20
|
+
disconnectedCallback(): void;
|
|
21
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
22
|
+
private handleSlotChange;
|
|
23
|
+
private handleMouseDown;
|
|
24
|
+
private handleMouseMove;
|
|
25
|
+
private handleMouseUp;
|
|
26
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { html as f } from "lit";
|
|
2
|
+
import { property as p } from "lit/decorators.js";
|
|
3
|
+
import { arrayAttributeConverter as g } from "../../internals/attribute-converters.js";
|
|
4
|
+
import { BaseElement as v } from "../BaseElement.js";
|
|
5
|
+
import { Panel as c } from "../panel/Panel.js";
|
|
6
|
+
import { Splitter as u } from "./Splitter.js";
|
|
7
|
+
import { styles as y } from "./SplitPanel.styles.js";
|
|
8
|
+
var S = Object.defineProperty, d = (a, s, r, o) => {
|
|
9
|
+
for (var t = void 0, e = a.length - 1, i; e >= 0; e--)
|
|
10
|
+
(i = a[e]) && (t = i(s, r, t) || t);
|
|
11
|
+
return t && S(s, r, t), t;
|
|
12
|
+
};
|
|
13
|
+
class m extends v {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.panels = [], this.splitters = [], this.isDragging = !1, this.currentSplitter = null, this.totalSize = 0, this.startPosition = 0, this.startRatio = [], this.orientation = "horizontal", this.ratio = [], this.handleSlotChange = async (s) => {
|
|
16
|
+
const t = s.target.assignedElements({ flatten: !0 }).filter((e) => e instanceof c);
|
|
17
|
+
if (!(this.panels.length === t.length && this.panels.every((e, i) => e === t[i]))) {
|
|
18
|
+
if (this.splitters.forEach((e) => e.remove()), this.splitters = [], this.panels = t, t.forEach((e, i) => {
|
|
19
|
+
if (i === t.length - 1)
|
|
20
|
+
return;
|
|
21
|
+
const n = new u();
|
|
22
|
+
n.orientation = this.orientation, n.addEventListener("mousedown", this.handleMouseDown), this.splitters.push(n), e.after(n);
|
|
23
|
+
}), this.ratio.length === t.length) {
|
|
24
|
+
const e = this.ratio.reduce((i, n) => i + n, 0);
|
|
25
|
+
t.forEach((i, n) => {
|
|
26
|
+
const l = this.ratio[n] / e * 100;
|
|
27
|
+
i.style.flex = `${l} 1 0%`;
|
|
28
|
+
});
|
|
29
|
+
return;
|
|
30
|
+
} else
|
|
31
|
+
t.forEach((e) => {
|
|
32
|
+
e.style.flex = `${100 / t.length} 1 0%`;
|
|
33
|
+
});
|
|
34
|
+
this.requestUpdate(), await this.updateComplete;
|
|
35
|
+
}
|
|
36
|
+
}, this.handleMouseDown = (s) => {
|
|
37
|
+
s.preventDefault();
|
|
38
|
+
const r = s.currentTarget;
|
|
39
|
+
this.currentSplitter = r, this.isDragging = !0, this.startPosition = this.orientation === "horizontal" ? s.clientX : s.clientY;
|
|
40
|
+
const o = this.getBoundingClientRect(), t = this.orientation === "horizontal" ? o.width : o.height, e = this.splitters.reduce((i, n) => i + n.size, 0);
|
|
41
|
+
this.totalSize = t - e, this.startRatio = this.panels.map((i) => {
|
|
42
|
+
const n = i.getBoundingClientRect();
|
|
43
|
+
return (this.orientation === "horizontal" ? n.width : n.height) / this.totalSize * 100;
|
|
44
|
+
}), r.dragging = !0, document.addEventListener("mousemove", this.handleMouseMove), document.addEventListener("mouseup", this.handleMouseUp), document.body.style.userSelect = "none", document.body.style.cursor = this.orientation === "horizontal" ? "col-resize" : "row-resize";
|
|
45
|
+
}, this.handleMouseMove = (s) => {
|
|
46
|
+
if (!this.isDragging || !this.currentSplitter) return;
|
|
47
|
+
s.preventDefault();
|
|
48
|
+
const o = (this.orientation === "horizontal" ? s.clientX : s.clientY) - this.startPosition, t = this.splitters.indexOf(this.currentSplitter);
|
|
49
|
+
if (t === -1) return;
|
|
50
|
+
const e = this.panels[t], i = this.panels[t + 1];
|
|
51
|
+
if (!e || !i) return;
|
|
52
|
+
const n = o / this.totalSize * 100, l = this.startRatio[t] + n, h = this.startRatio[t + 1] - n;
|
|
53
|
+
l < 0 || h < 0 || (e.style.flex = `${l} 1 0%`, i.style.flex = `${h} 1 0%`);
|
|
54
|
+
}, this.handleMouseUp = (s) => {
|
|
55
|
+
this.isDragging && (this.isDragging = !1, this.currentSplitter && (this.currentSplitter.dragging = !1, this.currentSplitter = null), document.removeEventListener("mousemove", this.handleMouseMove), document.removeEventListener("mouseup", this.handleMouseUp), document.body.style.userSelect = "", document.body.style.cursor = "");
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
static {
|
|
59
|
+
this.styles = [super.styles, y];
|
|
60
|
+
}
|
|
61
|
+
static {
|
|
62
|
+
this.dependencies = {
|
|
63
|
+
"u-panel": c,
|
|
64
|
+
"u-splitter": u
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
disconnectedCallback() {
|
|
68
|
+
document.removeEventListener("mousemove", this.handleMouseMove), document.removeEventListener("mouseup", this.handleMouseUp), this.splitters.forEach((s) => {
|
|
69
|
+
s.removeEventListener("mousedown", this.handleMouseDown), s.remove();
|
|
70
|
+
}), super.disconnectedCallback();
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
return f`
|
|
74
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
75
|
+
`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
d([
|
|
79
|
+
p({ type: String, reflect: !0 })
|
|
80
|
+
], m.prototype, "orientation");
|
|
81
|
+
d([
|
|
82
|
+
p({ type: Array, converter: g(parseFloat) })
|
|
83
|
+
], m.prototype, "ratio");
|
|
84
|
+
export {
|
|
85
|
+
m as SplitPanel
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { css as o } from "lit";
|
|
2
|
+
const i = o`
|
|
3
|
+
:host {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
}
|
|
10
|
+
:host([orientation="horizontal"]) {
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
}
|
|
13
|
+
:host([orientation="vertical"]) {
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
export {
|
|
18
|
+
i as styles
|
|
19
|
+
};
|