@iyulab/components 0.1.4 → 0.1.6
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 +18 -18
- package/LICENSE +20 -20
- package/README.md +33 -33
- package/dist/assets/icons/arrow-clockwise.svg.js +1 -1
- package/dist/assets/icons/arrow-down.svg.js +1 -1
- package/dist/assets/icons/arrow-up.svg.js +1 -1
- package/dist/assets/icons/ban.svg.js +1 -1
- package/dist/assets/icons/bell-fill.svg.js +1 -1
- package/dist/assets/icons/check-circle-fill.svg.js +1 -1
- package/dist/assets/icons/check-lg.svg.js +1 -1
- package/dist/assets/icons/chevron-down.svg.js +1 -1
- package/dist/assets/icons/chevron-left.svg.js +1 -1
- package/dist/assets/icons/chevron-right.svg.js +1 -1
- package/dist/assets/icons/chevron-up.svg.js +1 -1
- package/dist/assets/icons/copy.svg.js +1 -1
- package/dist/assets/icons/dash-lg.svg.js +1 -1
- package/dist/assets/icons/exclamation-circle-fill.svg.js +1 -1
- package/dist/assets/icons/exclamation-triangle-fill.svg.js +1 -1
- package/dist/assets/icons/eye-slash.svg.js +1 -1
- package/dist/assets/icons/eye.svg.js +1 -1
- package/dist/assets/icons/info-circle-fill.svg.js +1 -1
- package/dist/assets/icons/layout-sidebar.svg.js +1 -1
- package/dist/assets/icons/lightbulb-fill.svg.js +1 -1
- package/dist/assets/icons/lightbulb-off.svg.js +1 -1
- package/dist/assets/icons/lightbulb.svg.js +1 -1
- package/dist/assets/icons/mic-fill.svg.js +1 -1
- package/dist/assets/icons/mic-mute-fill.svg.js +1 -1
- package/dist/assets/icons/paperclip.svg.js +1 -1
- package/dist/assets/icons/pencil-square.svg.js +1 -1
- package/dist/assets/icons/plus-lg.svg.js +1 -1
- package/dist/assets/icons/search.svg.js +1 -1
- package/dist/assets/icons/speedometer.svg.js +1 -1
- package/dist/assets/icons/x-lg.svg.js +1 -1
- package/dist/assets/styles/dark.css +129 -125
- package/dist/assets/styles/dark.css.js +1 -1
- package/dist/assets/styles/light.css +129 -126
- package/dist/assets/styles/light.css.js +1 -1
- package/dist/components/BaseElement.styles.js +2 -2
- package/dist/components/FloatingElement.d.ts +84 -0
- package/dist/components/FloatingElement.js +166 -0
- package/dist/components/FloatingElement.styles.js +26 -0
- package/dist/components/alert/Alert.d.ts +8 -4
- package/dist/components/alert/Alert.js +24 -15
- package/dist/components/alert/Alert.styles.js +32 -39
- package/dist/components/alert/index.js +5 -0
- package/dist/components/button/Button.js +4 -2
- package/dist/components/button/Button.styles.js +13 -20
- package/dist/components/button/index.js +5 -0
- package/dist/components/context-menu/ContextMenu.d.ts +20 -39
- package/dist/components/context-menu/ContextMenu.js +92 -137
- package/dist/components/context-menu/ContextMenu.styles.js +3 -28
- package/dist/components/context-menu/index.d.ts +1 -1
- package/dist/components/context-menu/index.js +5 -0
- package/dist/components/copy-button/CopyButton.d.ts +7 -3
- package/dist/components/copy-button/CopyButton.js +69 -0
- package/dist/components/copy-button/CopyButton.styles.js +17 -0
- package/dist/components/copy-button/index.js +5 -0
- package/dist/components/dialog/Dialog.d.ts +14 -7
- package/dist/components/dialog/Dialog.js +88 -27
- package/dist/components/dialog/Dialog.styles.js +60 -11
- package/dist/components/dialog/index.js +5 -0
- package/dist/components/divider/Divider.d.ts +10 -10
- package/dist/components/divider/Divider.js +32 -32
- package/dist/components/divider/Divider.styles.js +10 -10
- package/dist/components/divider/index.js +5 -0
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +27 -0
- package/dist/components/dropdown-menu/DropdownMenu.js +135 -0
- package/dist/components/dropdown-menu/DropdownMenu.styles.d.ts +1 -0
- package/dist/components/dropdown-menu/DropdownMenu.styles.js +15 -0
- package/dist/components/dropdown-menu/index.d.ts +7 -0
- package/dist/components/dropdown-menu/index.js +5 -0
- package/dist/components/form/Form.d.ts +3 -1
- package/dist/components/form/Form.js +3 -1
- package/dist/components/form/Form.styles.js +1 -0
- package/dist/components/form/index.js +5 -0
- package/dist/components/icon/Icon.d.ts +6 -12
- package/dist/components/icon/Icon.js +15 -30
- package/dist/components/icon/Icon.styles.js +1 -1
- package/dist/components/icon/index.js +5 -0
- package/dist/components/icon-button/IconButton.d.ts +3 -3
- package/dist/components/icon-button/IconButton.js +6 -6
- package/dist/components/icon-button/IconButton.styles.js +14 -29
- package/dist/components/icon-button/index.js +5 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/components/input/Input.d.ts +14 -13
- package/dist/components/input/Input.js +57 -56
- package/dist/components/input/Input.styles.js +54 -56
- package/dist/components/input/index.js +5 -0
- package/dist/components/menu/Menu.d.ts +4 -15
- package/dist/components/menu/Menu.js +43 -28
- package/dist/components/menu/Menu.styles.js +7 -19
- package/dist/components/menu/index.js +5 -0
- package/dist/components/menu-item/MenuItem.d.ts +21 -12
- package/dist/components/menu-item/MenuItem.js +184 -15
- package/dist/components/menu-item/MenuItem.styles.js +6 -0
- package/dist/components/menu-item/index.js +5 -0
- package/dist/components/progress-bar/ProgressBar.d.ts +1 -1
- package/dist/components/progress-bar/ProgressBar.js +2 -2
- package/dist/components/progress-bar/ProgressBar.styles.js +10 -10
- package/dist/components/progress-bar/index.js +5 -0
- package/dist/components/progress-ring/ProgressRing.d.ts +2 -2
- package/dist/components/progress-ring/ProgressRing.js +7 -6
- package/dist/components/progress-ring/ProgressRing.styles.js +8 -9
- package/dist/components/progress-ring/index.js +5 -0
- package/dist/components/spinner/Spinner.styles.js +5 -3
- package/dist/components/spinner/index.js +5 -0
- package/dist/components/split-panel/SplitPanel.d.ts +11 -3
- package/dist/components/split-panel/SplitPanel.js +44 -27
- package/dist/components/split-panel/SplitPanel.styles.js +1 -16
- package/dist/components/split-panel/index.js +5 -0
- package/dist/components/tooltip/Tooltip.d.ts +9 -29
- package/dist/components/tooltip/Tooltip.js +27 -149
- package/dist/components/tooltip/Tooltip.styles.js +9 -23
- package/dist/components/tooltip/index.js +5 -0
- package/dist/components/tree/index.js +5 -0
- package/dist/components/tree-item/index.js +5 -0
- package/dist/index.js +28 -5
- package/dist/integrations/react/UDropdownMenu.d.ts +8 -0
- package/dist/integrations/react/UDropdownMenu.js +10 -0
- package/dist/integrations/react/index.d.ts +1 -1
- package/dist/integrations/react/index.js +1 -1
- package/dist/internals/index.d.ts +0 -1
- package/dist/internals/node-helpers.d.ts +6 -1
- package/dist/internals/node-helpers.js +5 -6
- package/dist/utilities/decorators.js +2 -0
- package/dist/utilities/icons.d.ts +46 -0
- package/dist/utilities/icons.js +114 -0
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/notifier.d.ts +17 -7
- package/dist/utilities/notifier.js +51 -41
- package/dist/utilities/theme.d.ts +15 -20
- package/dist/utilities/theme.js +24 -20
- package/package.json +59 -58
- package/dist/components/panel/Panel.d.ts +0 -9
- package/dist/components/panel/Panel.js +0 -17
- package/dist/components/panel/Panel.styles.js +0 -12
- package/dist/components/panel/index.d.ts +0 -7
- package/dist/integrations/react/UPanel.d.ts +0 -8
- package/dist/integrations/react/UPanel.js +0 -10
- package/dist/internals/icon-helpers.d.ts +0 -32
- package/dist/internals/icon-helpers.js +0 -48
- /package/dist/components/{panel/Panel.styles.d.ts → FloatingElement.styles.d.ts} +0 -0
|
@@ -3,32 +3,17 @@ import { css } from 'lit';
|
|
|
3
3
|
const styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
position: relative;
|
|
6
|
-
display:
|
|
6
|
+
display: flex;
|
|
7
7
|
width: 100%;
|
|
8
8
|
height: 100%;
|
|
9
9
|
overflow: hidden;
|
|
10
|
-
|
|
11
|
-
--divider-size: 2px;
|
|
12
|
-
--divider-color: var(--u-neutral-200, #d1d5db);
|
|
13
|
-
--divider-handle-size: 4px;
|
|
14
|
-
--divider-handle-color: var(--u-blue-500, #3b82f6);
|
|
15
10
|
}
|
|
16
11
|
:host([orientation="horizontal"]) {
|
|
17
|
-
display: flex;
|
|
18
12
|
flex-direction: row;
|
|
19
13
|
}
|
|
20
14
|
:host([orientation="vertical"]) {
|
|
21
|
-
display: flex;
|
|
22
15
|
flex-direction: column;
|
|
23
16
|
}
|
|
24
|
-
|
|
25
|
-
::slotted(u-divider) {
|
|
26
|
-
background-color: var(--divider-color, var(--u-neutral-200, #d1d5db));
|
|
27
|
-
|
|
28
|
-
--divider-size: var(--divider-size, 2px);
|
|
29
|
-
--handler-size: var(--divider-handle-size, 4px);
|
|
30
|
-
--handler-color: var(--divider-handle-color, var(--u-blue-500, #3b82f6));
|
|
31
|
-
}
|
|
32
17
|
`;
|
|
33
18
|
|
|
34
19
|
export { styles };
|
|
@@ -1,40 +1,20 @@
|
|
|
1
1
|
import { PropertyValues } from 'lit';
|
|
2
|
-
import { Placement } from '@floating-ui/dom';
|
|
3
2
|
import { BaseElement } from '../BaseElement.js';
|
|
3
|
+
import { FloatingElement } from '../FloatingElement.js';
|
|
4
4
|
/**
|
|
5
5
|
* Tooltip 컴포넌트는 대상 엘리먼트에 툴팁을 표시하는 기능을 제공합니다.
|
|
6
6
|
*/
|
|
7
|
-
export declare class Tooltip extends
|
|
7
|
+
export declare class Tooltip extends FloatingElement {
|
|
8
8
|
static styles: import('lit').CSSResultGroup[];
|
|
9
9
|
static dependencies: Record<string, typeof BaseElement>;
|
|
10
|
-
/** 툴팁이 연결될 대상 엘리먼트입니다. 지정하지 않으면 부모 엘리먼트가 대상이 됩니다. */
|
|
11
|
-
triggers: HTMLElement[];
|
|
12
|
-
/** 트리거 셀렉터 문자열입니다. 이 속성을 사용하여 트리거 엘리먼트를 지정할 수 있습니다. */
|
|
13
|
-
triggerSelectors?: string;
|
|
14
|
-
/** 'fixed' 위치에서 포지션을 계산할지 여부를 설정합니다. 기본값은 false입니다. */
|
|
15
|
-
hoist: boolean;
|
|
16
|
-
/** 툴팁이 나타날 위치를 설정합니다. */
|
|
17
|
-
placement?: Placement;
|
|
18
|
-
/** 툴팁의 위치에서 대상 엘리먼트까지의 거리를 픽셀단위로 설정합니다. 기본값은 8입니다. */
|
|
19
|
-
distance: number;
|
|
20
|
-
/** 툴팁의 표시 딜레이 시간을 밀리초 단위로 설정합니다. 기본값은 0입니다. */
|
|
21
|
-
delay: number;
|
|
22
|
-
constructor();
|
|
23
|
-
connectedCallback(): void;
|
|
24
10
|
disconnectedCallback(): void;
|
|
25
|
-
protected willUpdate(changedProperties: PropertyValues): void;
|
|
26
11
|
protected updated(changedProperties: PropertyValues): void;
|
|
27
12
|
render(): import('lit-html').TemplateResult<1>;
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
private detachTriggers;
|
|
36
|
-
/**
|
|
37
|
-
* 툴팁이 나타날 위치에 따라 transform-origin 값을 반환합니다.
|
|
38
|
-
*/
|
|
39
|
-
private getTransformOrigin;
|
|
13
|
+
/** 바인딩 이벤트 핸들러 */
|
|
14
|
+
private _show;
|
|
15
|
+
private _hide;
|
|
16
|
+
/** 대상 엘리먼트에 트리거 이벤트를 바인딩합니다. */
|
|
17
|
+
private attachAnchor;
|
|
18
|
+
/** 바인딩된 트리거 이벤트를 제거합니다. */
|
|
19
|
+
private detachAnchor;
|
|
40
20
|
}
|
|
@@ -1,70 +1,13 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
|
-
import {
|
|
3
|
-
import { offset, shift, flip, autoPlacement, computePosition } from '@floating-ui/dom';
|
|
4
|
-
import { getParentElement, findElementsBy } from '../../internals/node-helpers.js';
|
|
5
|
-
import { BaseElement } from '../BaseElement.js';
|
|
2
|
+
import { FloatingElement } from '../FloatingElement.js';
|
|
6
3
|
import { styles } from './Tooltip.styles.js';
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
10
|
-
var result = void 0 ;
|
|
11
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12
|
-
if (decorator = decorators[i])
|
|
13
|
-
result = (decorator(target, key, result) ) || result;
|
|
14
|
-
if (result) __defProp(target, key, result);
|
|
15
|
-
return result;
|
|
16
|
-
};
|
|
17
|
-
class Tooltip extends BaseElement {
|
|
5
|
+
class Tooltip extends FloatingElement {
|
|
18
6
|
constructor() {
|
|
19
|
-
super();
|
|
20
|
-
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.delay = 0;
|
|
24
|
-
/** 툴팁을 표시합니다. */
|
|
25
|
-
this.show = async (event) => {
|
|
26
|
-
await this.updateComplete;
|
|
27
|
-
const trigger = event?.currentTarget;
|
|
28
|
-
if (trigger instanceof HTMLElement === false) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const middleware = [
|
|
32
|
-
offset({ mainAxis: this.distance }),
|
|
33
|
-
shift(),
|
|
34
|
-
flip()
|
|
35
|
-
];
|
|
36
|
-
if (!this.placement) {
|
|
37
|
-
middleware.push(autoPlacement());
|
|
38
|
-
}
|
|
39
|
-
const position = await computePosition(trigger, this, {
|
|
40
|
-
strategy: this.hoist ? "fixed" : "absolute",
|
|
41
|
-
placement: this.placement,
|
|
42
|
-
middleware
|
|
43
|
-
});
|
|
44
|
-
Object.assign(this.style, {
|
|
45
|
-
left: `${position.x}px`,
|
|
46
|
-
top: `${position.y}px`,
|
|
47
|
-
transformOrigin: this.getTransformOrigin(position.placement)
|
|
48
|
-
});
|
|
49
|
-
if (this.delay > 0) {
|
|
50
|
-
await new Promise((resolve) => setTimeout(resolve, this.delay));
|
|
51
|
-
}
|
|
52
|
-
requestAnimationFrame(() => {
|
|
53
|
-
this.setAttribute("open", "");
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
/** 툴팁을 숨깁니다. */
|
|
57
|
-
this.hide = async (event) => {
|
|
58
|
-
await this.updateComplete;
|
|
59
|
-
if ("relatedTarget" in event) {
|
|
60
|
-
const relatedTarget = event["relatedTarget"];
|
|
61
|
-
if (this.contains(relatedTarget)) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
this.removeAttribute("open");
|
|
66
|
-
};
|
|
67
|
-
this.setAttribute("tabindex", "0");
|
|
7
|
+
super(...arguments);
|
|
8
|
+
/** 바인딩 이벤트 핸들러 */
|
|
9
|
+
this._show = () => this.show();
|
|
10
|
+
this._hide = () => this.hide();
|
|
68
11
|
}
|
|
69
12
|
static {
|
|
70
13
|
this.styles = [super.styles, styles];
|
|
@@ -72,101 +15,36 @@ class Tooltip extends BaseElement {
|
|
|
72
15
|
static {
|
|
73
16
|
this.dependencies = {};
|
|
74
17
|
}
|
|
75
|
-
connectedCallback() {
|
|
76
|
-
super.connectedCallback();
|
|
77
|
-
if (this.triggers.length === 0) {
|
|
78
|
-
const parent = getParentElement(this);
|
|
79
|
-
if (parent) this.triggers = [parent];
|
|
80
|
-
}
|
|
81
|
-
this.addEventListener("mouseleave", this.hide);
|
|
82
|
-
this.addEventListener("focusout", this.hide);
|
|
83
|
-
}
|
|
84
18
|
disconnectedCallback() {
|
|
85
|
-
this.
|
|
19
|
+
this.detachAnchor(this.anchor);
|
|
86
20
|
super.disconnectedCallback();
|
|
87
21
|
}
|
|
88
|
-
willUpdate(changedProperties) {
|
|
89
|
-
super.willUpdate(changedProperties);
|
|
90
|
-
if (changedProperties.has("triggerSelectors") && this.triggerSelectors) {
|
|
91
|
-
this.triggers = findElementsBy(this, this.triggerSelectors);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
22
|
updated(changedProperties) {
|
|
95
23
|
super.updated(changedProperties);
|
|
96
|
-
if (changedProperties.has("
|
|
97
|
-
|
|
98
|
-
this.
|
|
99
|
-
this.attachTriggers(this.triggers);
|
|
24
|
+
if (changedProperties.has("anchor")) {
|
|
25
|
+
this.detachAnchor(changedProperties.get("anchor"));
|
|
26
|
+
this.attachAnchor(this.anchor);
|
|
100
27
|
}
|
|
101
28
|
}
|
|
102
29
|
render() {
|
|
103
|
-
return html
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
for (const trigger of triggers) {
|
|
121
|
-
trigger.removeEventListener("mouseenter", this.show);
|
|
122
|
-
trigger.removeEventListener("mouseleave", this.hide);
|
|
123
|
-
trigger.removeEventListener("focusin", this.show);
|
|
124
|
-
trigger.removeEventListener("focusout", this.hide);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* 툴팁이 나타날 위치에 따라 transform-origin 값을 반환합니다.
|
|
129
|
-
*/
|
|
130
|
-
getTransformOrigin(placement) {
|
|
131
|
-
switch (placement) {
|
|
132
|
-
case "top":
|
|
133
|
-
case "top-start":
|
|
134
|
-
case "top-end":
|
|
135
|
-
return "center bottom";
|
|
136
|
-
case "bottom":
|
|
137
|
-
case "bottom-start":
|
|
138
|
-
case "bottom-end":
|
|
139
|
-
return "center top";
|
|
140
|
-
case "left":
|
|
141
|
-
case "left-start":
|
|
142
|
-
case "left-end":
|
|
143
|
-
return "right center";
|
|
144
|
-
case "right":
|
|
145
|
-
case "right-start":
|
|
146
|
-
case "right-end":
|
|
147
|
-
return "left center";
|
|
148
|
-
default:
|
|
149
|
-
return "center";
|
|
150
|
-
}
|
|
30
|
+
return html`<slot></slot>`;
|
|
31
|
+
}
|
|
32
|
+
/** 대상 엘리먼트에 트리거 이벤트를 바인딩합니다. */
|
|
33
|
+
attachAnchor(target) {
|
|
34
|
+
if (!target) return;
|
|
35
|
+
target.addEventListener("pointerenter", this._show);
|
|
36
|
+
target.addEventListener("pointerleave", this._hide);
|
|
37
|
+
target.addEventListener("focusin", this._show);
|
|
38
|
+
target.addEventListener("focusout", this._hide);
|
|
39
|
+
}
|
|
40
|
+
/** 바인딩된 트리거 이벤트를 제거합니다. */
|
|
41
|
+
detachAnchor(target) {
|
|
42
|
+
if (!target) return;
|
|
43
|
+
target.removeEventListener("pointerenter", this._show);
|
|
44
|
+
target.removeEventListener("pointerleave", this._hide);
|
|
45
|
+
target.removeEventListener("focusin", this._show);
|
|
46
|
+
target.removeEventListener("focusout", this._hide);
|
|
151
47
|
}
|
|
152
48
|
}
|
|
153
|
-
__decorateClass([
|
|
154
|
-
property({ attribute: false })
|
|
155
|
-
], Tooltip.prototype, "triggers");
|
|
156
|
-
__decorateClass([
|
|
157
|
-
property({ type: String, attribute: "trigger-selectors" })
|
|
158
|
-
], Tooltip.prototype, "triggerSelectors");
|
|
159
|
-
__decorateClass([
|
|
160
|
-
property({ type: Boolean, reflect: true })
|
|
161
|
-
], Tooltip.prototype, "hoist");
|
|
162
|
-
__decorateClass([
|
|
163
|
-
property({ type: String })
|
|
164
|
-
], Tooltip.prototype, "placement");
|
|
165
|
-
__decorateClass([
|
|
166
|
-
property({ type: Number })
|
|
167
|
-
], Tooltip.prototype, "distance");
|
|
168
|
-
__decorateClass([
|
|
169
|
-
property({ type: Number })
|
|
170
|
-
], Tooltip.prototype, "delay");
|
|
171
49
|
|
|
172
50
|
export { Tooltip };
|
|
@@ -2,34 +2,20 @@ import { css } from 'lit';
|
|
|
2
2
|
|
|
3
3
|
const styles = css`
|
|
4
4
|
:host {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
display: block;
|
|
11
|
-
width: max-content;
|
|
12
|
-
padding: 8px;
|
|
13
|
-
color: var(--u-tooltip-text-color);
|
|
14
|
-
font-family: var(--u-font-modern, inherit);
|
|
15
|
-
font-size: 14px;
|
|
16
|
-
line-height: 1.5;
|
|
5
|
+
padding: 6px 8px;
|
|
6
|
+
color: var(--u-tooltip-txt-color);
|
|
7
|
+
font-family: var(--u-font-display, inherit);
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
line-height: 1.25;
|
|
17
10
|
border: none;
|
|
18
11
|
border-radius: 4px;
|
|
19
12
|
background-color: var(--u-tooltip-bg-color);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
transform: scale(0);
|
|
24
|
-
transition: opacity 0.15s ease, transform 0.15s ease;
|
|
25
|
-
}
|
|
26
|
-
:host([hoist]) {
|
|
27
|
-
position: fixed;
|
|
13
|
+
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
|
|
14
|
+
transform: scale(0.8);
|
|
15
|
+
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
28
16
|
}
|
|
29
|
-
:host([
|
|
30
|
-
opacity: 0.8;
|
|
17
|
+
:host([visible]) {
|
|
31
18
|
transform: scale(1);
|
|
32
|
-
pointer-events: auto;
|
|
33
19
|
}
|
|
34
20
|
`;
|
|
35
21
|
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,41 @@
|
|
|
1
|
+
import './components/alert/index.js';
|
|
2
|
+
import './components/button/index.js';
|
|
3
|
+
import './components/context-menu/index.js';
|
|
4
|
+
import './components/copy-button/index.js';
|
|
5
|
+
import './components/dialog/index.js';
|
|
6
|
+
import './components/divider/index.js';
|
|
7
|
+
import './components/dropdown-menu/index.js';
|
|
8
|
+
import './components/form/index.js';
|
|
9
|
+
import './components/icon/index.js';
|
|
10
|
+
import './components/icon-button/index.js';
|
|
11
|
+
import './components/input/index.js';
|
|
12
|
+
import './components/menu/index.js';
|
|
13
|
+
import './components/menu-item/index.js';
|
|
14
|
+
import './components/progress-bar/index.js';
|
|
15
|
+
import './components/progress-ring/index.js';
|
|
16
|
+
import './components/spinner/index.js';
|
|
17
|
+
import './components/split-panel/index.js';
|
|
18
|
+
import './components/tooltip/index.js';
|
|
19
|
+
import './components/tree/index.js';
|
|
20
|
+
import './components/tree-item/index.js';
|
|
21
|
+
export { BrowserStorage } from './utilities/BrowserStorage.js';
|
|
22
|
+
export { getPropertyMeta, propertyMeta, setPropertyMeta } from './utilities/decorators.js';
|
|
23
|
+
export { getDefaultBaseUrl, icons, setDefaultBaseUrl } from './utilities/icons.js';
|
|
24
|
+
export { notifier } from './utilities/notifier.js';
|
|
25
|
+
export { theme } from './utilities/theme.js';
|
|
1
26
|
export { Alert } from './components/alert/Alert.js';
|
|
2
27
|
export { Button } from './components/button/Button.js';
|
|
3
28
|
export { ContextMenu } from './components/context-menu/ContextMenu.js';
|
|
29
|
+
export { CopyButton } from './components/copy-button/CopyButton.js';
|
|
4
30
|
export { Dialog } from './components/dialog/Dialog.js';
|
|
5
31
|
export { Divider } from './components/divider/Divider.js';
|
|
32
|
+
export { DropdownMenu } from './components/dropdown-menu/DropdownMenu.js';
|
|
6
33
|
export { Form } from './components/form/Form.js';
|
|
7
34
|
export { Icon } from './components/icon/Icon.js';
|
|
8
35
|
export { IconButton } from './components/icon-button/IconButton.js';
|
|
9
36
|
export { Input } from './components/input/Input.js';
|
|
10
37
|
export { Menu } from './components/menu/Menu.js';
|
|
11
|
-
export {
|
|
38
|
+
export { MenuItem } from './components/menu-item/MenuItem.js';
|
|
12
39
|
export { ProgressBar } from './components/progress-bar/ProgressBar.js';
|
|
13
40
|
export { ProgressRing } from './components/progress-ring/ProgressRing.js';
|
|
14
41
|
export { Spinner } from './components/spinner/Spinner.js';
|
|
@@ -16,7 +43,3 @@ export { SplitPanel } from './components/split-panel/SplitPanel.js';
|
|
|
16
43
|
export { Tooltip } from './components/tooltip/Tooltip.js';
|
|
17
44
|
export { Tree } from './components/tree/Tree.js';
|
|
18
45
|
export { TreeItem } from './components/tree-item/TreeItem.js';
|
|
19
|
-
export { BrowserStorage } from './utilities/BrowserStorage.js';
|
|
20
|
-
export { getPropertyMeta, propertyMeta, setPropertyMeta } from './utilities/decorators.js';
|
|
21
|
-
export { notifier } from './utilities/notifier.js';
|
|
22
|
-
export { Theme, theme } from './utilities/theme.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DropdownMenu } from '../../components/dropdown-menu/index';
|
|
3
|
+
|
|
4
|
+
export declare const UDropdownMenu: React.ForwardRefExoticComponent<
|
|
5
|
+
Partial<DropdownMenu> & React.HTMLAttributes<DropdownMenu>
|
|
6
|
+
>;
|
|
7
|
+
|
|
8
|
+
export type UDropdownMenuProps = React.ComponentProps<typeof UDropdownMenu>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { DropdownMenu } from '../../components/dropdown-menu/index';
|
|
4
|
+
|
|
5
|
+
export const UDropdownMenu = createComponent({
|
|
6
|
+
react: React,
|
|
7
|
+
tagName: 'u-dropdown-menu',
|
|
8
|
+
elementClass: DropdownMenu,
|
|
9
|
+
events: {}
|
|
10
|
+
});
|
|
@@ -11,13 +11,13 @@ export { UContextMenu, UContextMenuProps } from './UContextMenu';
|
|
|
11
11
|
export { UCopyButton, UCopyButtonProps } from './UCopyButton';
|
|
12
12
|
export { UDialog, UDialogProps } from './UDialog';
|
|
13
13
|
export { UDivider, UDividerProps } from './UDivider';
|
|
14
|
+
export { UDropdownMenu, UDropdownMenuProps } from './UDropdownMenu';
|
|
14
15
|
export { UForm, UFormProps } from './UForm';
|
|
15
16
|
export { UIcon, UIconProps } from './UIcon';
|
|
16
17
|
export { UIconButton, UIconButtonProps } from './UIconButton';
|
|
17
18
|
export { UInput, UInputProps } from './UInput';
|
|
18
19
|
export { UMenu, UMenuProps } from './UMenu';
|
|
19
20
|
export { UMenuItem, UMenuItemProps } from './UMenuItem';
|
|
20
|
-
export { UPanel, UPanelProps } from './UPanel';
|
|
21
21
|
export { UProgressBar, UProgressBarProps } from './UProgressBar';
|
|
22
22
|
export { UProgressRing, UProgressRingProps } from './UProgressRing';
|
|
23
23
|
export { USpinner, USpinnerProps } from './USpinner';
|
|
@@ -4,13 +4,13 @@ export { UContextMenu } from './UContextMenu.js';
|
|
|
4
4
|
export { UCopyButton } from './UCopyButton.js';
|
|
5
5
|
export { UDialog } from './UDialog.js';
|
|
6
6
|
export { UDivider } from './UDivider.js';
|
|
7
|
+
export { UDropdownMenu } from './UDropdownMenu.js';
|
|
7
8
|
export { UForm } from './UForm.js';
|
|
8
9
|
export { UIcon } from './UIcon.js';
|
|
9
10
|
export { UIconButton } from './UIconButton.js';
|
|
10
11
|
export { UInput } from './UInput.js';
|
|
11
12
|
export { UMenu } from './UMenu.js';
|
|
12
13
|
export { UMenuItem } from './UMenuItem.js';
|
|
13
|
-
export { UPanel } from './UPanel.js';
|
|
14
14
|
export { UProgressBar } from './UProgressBar.js';
|
|
15
15
|
export { UProgressRing } from './UProgressRing.js';
|
|
16
16
|
export { USpinner } from './USpinner.js';
|
|
@@ -5,8 +5,13 @@
|
|
|
5
5
|
* 찾을 수 없는 경우 undefined을 반환합니다.
|
|
6
6
|
*/
|
|
7
7
|
export declare function getParentElement(element: Element): HTMLElement | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* element 기준으로 selector와 매치되는 첫번째 HTMLElement를 반환합니다.
|
|
10
|
+
* - 탐색은 element가 존재하는 shadow DOM 또는 document 루트 안에서 이루어집니다.
|
|
11
|
+
*/
|
|
12
|
+
export declare function querySelectorFrom(element: Element, selectors: string): HTMLElement | null;
|
|
8
13
|
/**
|
|
9
14
|
* element 기준으로 selector와 매치되는 모든 HTMLElement를 반환합니다.
|
|
10
15
|
* - 탐색은 element가 존재하는 shadow DOM 또는 document 루트 안에서 이루어집니다.
|
|
11
16
|
*/
|
|
12
|
-
export declare function
|
|
17
|
+
export declare function querySelectorAllFrom(element: Element, selectors: string): HTMLElement[];
|
|
@@ -6,15 +6,14 @@ function getParentElement(element) {
|
|
|
6
6
|
return root instanceof Document ? root.documentElement : root instanceof ShadowRoot ? root.host : root instanceof HTMLElement ? root : void 0;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
if (!selectors) return
|
|
9
|
+
function querySelectorFrom(element, selectors) {
|
|
10
|
+
if (!selectors) return null;
|
|
11
11
|
const rootNode = element.getRootNode({ composed: false });
|
|
12
12
|
if (rootNode instanceof ShadowRoot || rootNode instanceof Document) {
|
|
13
|
-
|
|
14
|
-
return Array.from(nodeList);
|
|
13
|
+
return rootNode.querySelector(selectors);
|
|
15
14
|
} else {
|
|
16
|
-
return
|
|
15
|
+
return null;
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
export {
|
|
19
|
+
export { getParentElement, querySelectorFrom };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
type IconResolver = (name: string) => string | undefined | Promise<string | undefined>;
|
|
2
|
+
/**
|
|
3
|
+
* 아이콘 레지스트리 클래스입니다.
|
|
4
|
+
* 아이콘 라이브러리를 등록하고, 아이콘을 조회하는 기능을 제공합니다.
|
|
5
|
+
*/
|
|
6
|
+
declare class IconRegistry {
|
|
7
|
+
private static _instance;
|
|
8
|
+
private libs;
|
|
9
|
+
private constructor();
|
|
10
|
+
static get instance(): IconRegistry;
|
|
11
|
+
/**
|
|
12
|
+
* 지정된 아이콘 라이브러리가 등록되었는지 확인합니다.
|
|
13
|
+
*/
|
|
14
|
+
has(lib: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* 지정된 아이콘 라이브러리를 등록합니다.
|
|
17
|
+
* 이미 등록된 라이브러리 이름인 경우, 경고 메시지를 출력합니다.
|
|
18
|
+
*/
|
|
19
|
+
register(lib: string, resolver: IconResolver): void;
|
|
20
|
+
/**
|
|
21
|
+
* 지정된 아이콘 라이브러리를 등록 해제합니다.
|
|
22
|
+
*/
|
|
23
|
+
unregister(lib: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* 지정된 아이콘 라이브러리의 svg 아이콘 소스를 가져옵니다.
|
|
26
|
+
*/
|
|
27
|
+
resolve(lib: string, name: string): Promise<string | undefined>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 전역 아이콘 레지스트리 인스턴스에 접근합니다.
|
|
31
|
+
* 기본 내장 아이콘 라이브러리가 포함되어 있습니다.
|
|
32
|
+
*/
|
|
33
|
+
export declare const icons: IconRegistry;
|
|
34
|
+
/**
|
|
35
|
+
* `default` 라이브러리에서 아이콘을 로드할 때 사용할 기본 URL을 반환합니다.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getDefaultBaseUrl(): string;
|
|
38
|
+
/**
|
|
39
|
+
* `default` 라이브러리에서 아이콘을 로드할 때 사용할 기본 URL을 설정합니다.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* - `/assets/icons/`
|
|
43
|
+
* - `https://cdn.example.com/icons/`
|
|
44
|
+
*/
|
|
45
|
+
export declare function setDefaultBaseUrl(url: string): void;
|
|
46
|
+
export {};
|