@iyulab/components 0.1.11 → 0.2.1
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 +113 -59
- package/LICENSE +20 -20
- package/README.md +283 -26
- package/dist/assets/icons/arrow-down.svg.js +1 -1
- package/dist/assets/icons/arrow-repeat.svg.js +3 -0
- 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/box-arrow-up-right.svg.js +3 -0
- 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/file-earmark.svg.js +3 -0
- package/dist/assets/icons/flag.svg.js +3 -0
- package/dist/assets/icons/globe.svg.js +3 -0
- package/dist/assets/icons/hand-thumbs-down-fill.svg.js +3 -0
- package/dist/assets/icons/hand-thumbs-down.svg.js +3 -0
- package/dist/assets/icons/hand-thumbs-up-fill.svg.js +3 -0
- package/dist/assets/icons/hand-thumbs-up.svg.js +3 -0
- 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/share.svg.js +3 -0
- package/dist/assets/icons/stop-circle.svg.js +3 -0
- package/dist/assets/icons/tools.svg.js +3 -0
- package/dist/assets/icons/x-lg.svg.js +1 -1
- package/dist/assets/styles/dark.css +129 -129
- package/dist/assets/styles/dark.css.js +1 -1
- package/dist/assets/styles/light.css +129 -129
- package/dist/assets/styles/light.css.js +1 -1
- package/dist/components/FloatingElement.d.ts +13 -5
- package/dist/components/FloatingElement.js +31 -14
- package/dist/components/button/UButton.component.d.ts +7 -0
- package/dist/components/button/UButton.component.js +20 -1
- package/dist/components/button/UButton.styles.js +51 -8
- package/dist/components/dialog/UDialog.component.d.ts +2 -0
- package/dist/components/dialog/UDialog.component.js +14 -9
- package/dist/components/drawer/UDrawer.component.d.ts +2 -0
- package/dist/components/drawer/UDrawer.component.js +14 -9
- package/dist/components/form/UForm.component.js +3 -3
- package/dist/components/icon/UIcon.component.d.ts +1 -4
- package/dist/components/icon/UIcon.component.js +2 -2
- package/dist/components/menu/UMenu.component.js +53 -41
- package/dist/components/menu-item/UMenuItem.component.d.ts +2 -2
- package/dist/components/menu-item/UMenuItem.component.js +1 -2
- package/dist/components/split-panel/USplitPanel.component.js +4 -4
- package/dist/components/tag/UTag.component.d.ts +23 -0
- package/dist/components/tag/UTag.component.js +72 -0
- package/dist/components/tag/UTag.d.ts +8 -0
- package/dist/components/tag/UTag.js +5 -0
- package/dist/components/tag/UTag.styles.js +83 -0
- package/dist/components/tooltip/UTooltip.component.d.ts +8 -0
- package/dist/components/tooltip/UTooltip.component.js +59 -17
- package/dist/components/tooltip/UTooltip.styles.js +15 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +5 -4
- package/dist/react-components/UTag.d.ts +8 -0
- package/dist/react-components/UTag.js +10 -0
- package/dist/react-components/index.d.ts +1 -1
- package/dist/react-components/index.js +1 -1
- package/dist/utilities/{icons.d.ts → IconRegistry.d.ts} +20 -26
- package/dist/utilities/{icons.js → IconRegistry.js} +29 -20
- package/dist/utilities/{notifier.d.ts → Notifier.d.ts} +8 -13
- package/dist/utilities/{notifier.js → Notifier.js} +8 -10
- package/dist/utilities/{theme.d.ts → Theme.d.ts} +13 -18
- package/dist/utilities/{theme.js → Theme.js} +39 -35
- package/dist/{internals/attribute-converters.d.ts → utilities/converters.d.ts} +1 -1
- package/dist/{internals/attribute-converters.js → utilities/converters.js} +2 -2
- package/dist/{internals/node-helpers.js → utilities/elements.js} +6 -5
- package/package.json +60 -60
- package/dist/assets/icons/arrow-clockwise.svg.js +0 -3
- package/dist/assets/icons/speedometer.svg.js +0 -3
- package/dist/components/icon-button/UIconButton.component.d.ts +0 -20
- package/dist/components/icon-button/UIconButton.component.js +0 -59
- package/dist/components/icon-button/UIconButton.d.ts +0 -7
- package/dist/components/icon-button/UIconButton.js +0 -5
- package/dist/components/icon-button/UIconButton.styles.js +0 -54
- package/dist/internals/react-wrapper.d.ts +0 -21
- package/dist/react-components/UIconButton.d.ts +0 -8
- package/dist/react-components/UIconButton.js +0 -10
- /package/dist/components/{icon-button/UIconButton.styles.d.ts → tag/UTag.styles.d.ts} +0 -0
- /package/dist/{internals/node-helpers.d.ts → utilities/elements.d.ts} +0 -0
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
2
3
|
import { FloatingElement } from '../FloatingElement.js';
|
|
3
4
|
import { styles } from './UTooltip.styles.js';
|
|
4
5
|
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = void 0 ;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (decorator(target, key, result) ) || result;
|
|
12
|
+
if (result) __defProp(target, key, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
5
15
|
class UTooltip extends FloatingElement {
|
|
6
16
|
constructor() {
|
|
7
17
|
super(...arguments);
|
|
18
|
+
this.interactive = false;
|
|
8
19
|
/** this 바인딩 이벤트 핸들러 */
|
|
9
|
-
this._show = () =>
|
|
10
|
-
|
|
20
|
+
this._show = (event) => {
|
|
21
|
+
const target = event.currentTarget;
|
|
22
|
+
if (!target) return;
|
|
23
|
+
this.show(target);
|
|
24
|
+
};
|
|
25
|
+
/** this 바인딩 이벤트 핸들러 */
|
|
26
|
+
this._hide = (event) => {
|
|
27
|
+
if (this.interactive) {
|
|
28
|
+
const target = this.target;
|
|
29
|
+
const related = event.relatedTarget;
|
|
30
|
+
if (!target || !related) return;
|
|
31
|
+
if (this.contains(related) || target.contains(related)) return;
|
|
32
|
+
}
|
|
33
|
+
this.hide();
|
|
34
|
+
};
|
|
11
35
|
}
|
|
12
36
|
static {
|
|
13
37
|
this.styles = [super.styles, styles];
|
|
@@ -17,30 +41,48 @@ class UTooltip extends FloatingElement {
|
|
|
17
41
|
}
|
|
18
42
|
updated(changedProperties) {
|
|
19
43
|
super.updated(changedProperties);
|
|
20
|
-
if (changedProperties.has("
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
if (
|
|
44
|
+
if (changedProperties.has("anchors")) {
|
|
45
|
+
const oldAnchors = changedProperties.get("anchors");
|
|
46
|
+
const newAnchors = this.anchors;
|
|
47
|
+
if (oldAnchors) this.unbind(oldAnchors);
|
|
48
|
+
if (newAnchors) this.bind(newAnchors);
|
|
49
|
+
}
|
|
50
|
+
if (changedProperties.has("distance")) {
|
|
51
|
+
if (this.distance > 0) {
|
|
52
|
+
this.style.setProperty("--interactive-area", `${this.distance}px`);
|
|
53
|
+
} else {
|
|
54
|
+
this.style.removeProperty("--interactive-area");
|
|
55
|
+
}
|
|
25
56
|
}
|
|
26
57
|
}
|
|
27
58
|
render() {
|
|
28
59
|
return html`<slot></slot>`;
|
|
29
60
|
}
|
|
30
61
|
/** 바인딩 이벤트 핸들러 */
|
|
31
|
-
bind(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
62
|
+
bind(anchors) {
|
|
63
|
+
for (const anchor of anchors) {
|
|
64
|
+
anchor.addEventListener("pointerenter", this._show);
|
|
65
|
+
anchor.addEventListener("pointerleave", this._hide);
|
|
66
|
+
anchor.addEventListener("focusin", this._show);
|
|
67
|
+
anchor.addEventListener("focusout", this._hide);
|
|
68
|
+
}
|
|
69
|
+
this.addEventListener("pointerleave", this._hide);
|
|
70
|
+
this.addEventListener("focusout", this._hide);
|
|
36
71
|
}
|
|
37
72
|
/** 바인딩 해제 이벤트 핸들러 */
|
|
38
|
-
unbind(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
73
|
+
unbind(anchors) {
|
|
74
|
+
for (const anchor of anchors) {
|
|
75
|
+
anchor.removeEventListener("pointerenter", this._show);
|
|
76
|
+
anchor.removeEventListener("pointerleave", this._hide);
|
|
77
|
+
anchor.removeEventListener("focusin", this._show);
|
|
78
|
+
anchor.removeEventListener("focusout", this._hide);
|
|
79
|
+
}
|
|
80
|
+
this.addEventListener("pointerleave", this._hide);
|
|
81
|
+
this.addEventListener("focusout", this._hide);
|
|
43
82
|
}
|
|
44
83
|
}
|
|
84
|
+
__decorateClass([
|
|
85
|
+
property({ type: Boolean, reflect: true })
|
|
86
|
+
], UTooltip.prototype, "interactive");
|
|
45
87
|
|
|
46
88
|
export { UTooltip };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
|
|
3
3
|
const styles = css`
|
|
4
|
+
:host {
|
|
5
|
+
--interactive-area: 0px;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
:host {
|
|
5
9
|
padding: 6px 8px;
|
|
6
10
|
color: var(--u-tooltip-txt-color);
|
|
@@ -18,6 +22,17 @@ const styles = css`
|
|
|
18
22
|
opacity: 0.8;
|
|
19
23
|
transform: scale(1);
|
|
20
24
|
}
|
|
25
|
+
|
|
26
|
+
/* 툴팁을 distance만큼 감싸는 보이지 않는 영역 */
|
|
27
|
+
:host([interactive])::before {
|
|
28
|
+
content: '';
|
|
29
|
+
position: absolute;
|
|
30
|
+
/* 툴팁을 distance만큼 모든 방향으로 확장 */
|
|
31
|
+
inset: calc(var(--interactive-area) * -1);
|
|
32
|
+
background: transparent;
|
|
33
|
+
pointer-events: auto;
|
|
34
|
+
z-index: -1;
|
|
35
|
+
}
|
|
21
36
|
`;
|
|
22
37
|
|
|
23
38
|
export { styles };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from './components/divider/UDivider.js';
|
|
|
5
5
|
export * from './components/drawer/UDrawer.js';
|
|
6
6
|
export * from './components/form/UForm.js';
|
|
7
7
|
export * from './components/icon/UIcon.js';
|
|
8
|
-
export * from './components/icon-button/UIconButton.js';
|
|
9
8
|
export * from './components/input/UInput.js';
|
|
10
9
|
export * from './components/menu/UMenu.js';
|
|
11
10
|
export * from './components/menu-item/UMenuItem.js';
|
|
@@ -14,6 +13,7 @@ export * from './components/progress-ring/UProgressRing.js';
|
|
|
14
13
|
export * from './components/skeleton/USkeleton.js';
|
|
15
14
|
export * from './components/spinner/USpinner.js';
|
|
16
15
|
export * from './components/split-panel/USplitPanel.js';
|
|
16
|
+
export * from './components/tag/UTag.js';
|
|
17
17
|
export * from './components/tooltip/UTooltip.js';
|
|
18
18
|
export * from './components/tree/UTree.js';
|
|
19
19
|
export * from './components/tree-item/UTreeItem.js';
|
|
@@ -24,5 +24,6 @@ export * from './events/UResizeEvent';
|
|
|
24
24
|
export * from './events/USelectEvent';
|
|
25
25
|
export * from './events/UShowEvent';
|
|
26
26
|
export * from './utilities/BrowserStorage.js';
|
|
27
|
-
export * from './utilities/
|
|
28
|
-
export * from './utilities/
|
|
27
|
+
export * from './utilities/IconRegistry.js';
|
|
28
|
+
export * from './utilities/Notifier.js';
|
|
29
|
+
export * from './utilities/Theme.js';
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import './components/divider/UDivider.js';
|
|
|
5
5
|
import './components/drawer/UDrawer.js';
|
|
6
6
|
import './components/form/UForm.js';
|
|
7
7
|
import './components/icon/UIcon.js';
|
|
8
|
-
import './components/icon-button/UIconButton.js';
|
|
9
8
|
import './components/input/UInput.js';
|
|
10
9
|
import './components/menu/UMenu.js';
|
|
11
10
|
import './components/menu-item/UMenuItem.js';
|
|
@@ -14,12 +13,14 @@ import './components/progress-ring/UProgressRing.js';
|
|
|
14
13
|
import './components/skeleton/USkeleton.js';
|
|
15
14
|
import './components/spinner/USpinner.js';
|
|
16
15
|
import './components/split-panel/USplitPanel.js';
|
|
16
|
+
import './components/tag/UTag.js';
|
|
17
17
|
import './components/tooltip/UTooltip.js';
|
|
18
18
|
import './components/tree/UTree.js';
|
|
19
19
|
import './components/tree-item/UTreeItem.js';
|
|
20
20
|
export { BrowserStorage } from './utilities/BrowserStorage.js';
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
21
|
+
export { IconRegistry, getDefaultBaseUrl, setDefaultBaseUrl } from './utilities/IconRegistry.js';
|
|
22
|
+
export { Notifier } from './utilities/Notifier.js';
|
|
23
|
+
export { Theme } from './utilities/Theme.js';
|
|
23
24
|
export { UAlert } from './components/alert/UAlert.component.js';
|
|
24
25
|
export { UButton } from './components/button/UButton.component.js';
|
|
25
26
|
export { UDialog } from './components/dialog/UDialog.component.js';
|
|
@@ -27,7 +28,6 @@ export { UDivider } from './components/divider/UDivider.component.js';
|
|
|
27
28
|
export { UDrawer } from './components/drawer/UDrawer.component.js';
|
|
28
29
|
export { UForm } from './components/form/UForm.component.js';
|
|
29
30
|
export { UIcon } from './components/icon/UIcon.component.js';
|
|
30
|
-
export { UIconButton } from './components/icon-button/UIconButton.component.js';
|
|
31
31
|
export { UInput } from './components/input/UInput.component.js';
|
|
32
32
|
export { UMenu } from './components/menu/UMenu.component.js';
|
|
33
33
|
export { UMenuItem } from './components/menu-item/UMenuItem.component.js';
|
|
@@ -36,6 +36,7 @@ export { UProgressRing } from './components/progress-ring/UProgressRing.componen
|
|
|
36
36
|
export { USkeleton } from './components/skeleton/USkeleton.component.js';
|
|
37
37
|
export { USpinner } from './components/spinner/USpinner.component.js';
|
|
38
38
|
export { USplitPanel } from './components/split-panel/USplitPanel.component.js';
|
|
39
|
+
export { UTag } from './components/tag/UTag.component.js';
|
|
39
40
|
export { UTooltip } from './components/tooltip/UTooltip.component.js';
|
|
40
41
|
export { UTree } from './components/tree/UTree.component.js';
|
|
41
42
|
export { UTreeItem } from './components/tree-item/UTreeItem.component.js';
|
|
@@ -12,7 +12,6 @@ export { UDivider, UDividerProps } from './UDivider';
|
|
|
12
12
|
export { UDrawer, UDrawerProps } from './UDrawer';
|
|
13
13
|
export { UForm, UFormProps } from './UForm';
|
|
14
14
|
export { UIcon, UIconProps } from './UIcon';
|
|
15
|
-
export { UIconButton, UIconButtonProps } from './UIconButton';
|
|
16
15
|
export { UInput, UInputProps } from './UInput';
|
|
17
16
|
export { UMenu, UMenuProps } from './UMenu';
|
|
18
17
|
export { UMenuItem, UMenuItemProps } from './UMenuItem';
|
|
@@ -21,6 +20,7 @@ export { UProgressRing, UProgressRingProps } from './UProgressRing';
|
|
|
21
20
|
export { USkeleton, USkeletonProps } from './USkeleton';
|
|
22
21
|
export { USpinner, USpinnerProps } from './USpinner';
|
|
23
22
|
export { USplitPanel, USplitPanelProps } from './USplitPanel';
|
|
23
|
+
export { UTag, UTagProps } from './UTag';
|
|
24
24
|
export { UTooltip, UTooltipProps } from './UTooltip';
|
|
25
25
|
export { UTree, UTreeProps } from './UTree';
|
|
26
26
|
export { UTreeItem, UTreeItemProps } from './UTreeItem';
|
|
@@ -5,7 +5,6 @@ export { UDivider } from './UDivider.js';
|
|
|
5
5
|
export { UDrawer } from './UDrawer.js';
|
|
6
6
|
export { UForm } from './UForm.js';
|
|
7
7
|
export { UIcon } from './UIcon.js';
|
|
8
|
-
export { UIconButton } from './UIconButton.js';
|
|
9
8
|
export { UInput } from './UInput.js';
|
|
10
9
|
export { UMenu } from './UMenu.js';
|
|
11
10
|
export { UMenuItem } from './UMenuItem.js';
|
|
@@ -14,6 +13,7 @@ export { UProgressRing } from './UProgressRing.js';
|
|
|
14
13
|
export { USkeleton } from './USkeleton.js';
|
|
15
14
|
export { USpinner } from './USpinner.js';
|
|
16
15
|
export { USplitPanel } from './USplitPanel.js';
|
|
16
|
+
export { UTag } from './UTag.js';
|
|
17
17
|
export { UTooltip } from './UTooltip.js';
|
|
18
18
|
export { UTree } from './UTree.js';
|
|
19
19
|
export { UTreeItem } from './UTreeItem.js';
|
|
@@ -1,46 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `default` 라이브러리에서 아이콘을 로드할 때 사용할 기본 URL을 반환합니다.
|
|
3
|
+
*/
|
|
4
|
+
declare function getDefaultBaseUrl(): string;
|
|
5
|
+
/**
|
|
6
|
+
* `default` 라이브러리에서 아이콘을 로드할 때 사용할 기본 URL을 설정합니다.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* - `/assets/icons/`
|
|
10
|
+
* - `https://cdn.example.com/icons/`
|
|
11
|
+
*/
|
|
12
|
+
declare function setDefaultBaseUrl(url: string): void;
|
|
1
13
|
type IconResolver = (name: string) => string | undefined | Promise<string | undefined>;
|
|
2
14
|
/**
|
|
3
|
-
* 아이콘
|
|
15
|
+
* 아이콘 레지스트리입니다.
|
|
4
16
|
* 아이콘 라이브러리를 등록하고, 아이콘을 조회하는 기능을 제공합니다.
|
|
5
17
|
*/
|
|
6
18
|
declare class IconRegistry {
|
|
7
|
-
private static
|
|
8
|
-
|
|
19
|
+
private static libs;
|
|
20
|
+
/** 클래스 생성 방지 */
|
|
9
21
|
private constructor();
|
|
10
|
-
static get instance(): IconRegistry;
|
|
11
22
|
/**
|
|
12
23
|
* 지정된 아이콘 라이브러리가 등록되었는지 확인합니다.
|
|
13
24
|
*/
|
|
14
|
-
has(lib: string): boolean;
|
|
25
|
+
static has(lib: string): boolean;
|
|
15
26
|
/**
|
|
16
27
|
* 지정된 아이콘 라이브러리를 등록합니다.
|
|
17
28
|
* 이미 등록된 라이브러리 이름인 경우, 경고 메시지를 출력합니다.
|
|
18
29
|
*/
|
|
19
|
-
register(lib: string, resolver: IconResolver): void;
|
|
30
|
+
static register(lib: string, resolver: IconResolver): void;
|
|
20
31
|
/**
|
|
21
32
|
* 지정된 아이콘 라이브러리를 등록 해제합니다.
|
|
22
33
|
*/
|
|
23
|
-
unregister(lib: string): void;
|
|
34
|
+
static unregister(lib: string): void;
|
|
24
35
|
/**
|
|
25
36
|
* 지정된 아이콘 라이브러리의 svg 아이콘 소스를 가져옵니다.
|
|
26
37
|
*/
|
|
27
|
-
resolve(lib: string, name: string): Promise<string | undefined>;
|
|
38
|
+
static resolve(lib: string, name: string): Promise<string | undefined>;
|
|
28
39
|
}
|
|
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 {};
|
|
40
|
+
export { IconRegistry, getDefaultBaseUrl, setDefaultBaseUrl, };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as arrowClockwise from '../assets/icons/arrow-clockwise.svg.js';
|
|
2
1
|
import * as arrowDown from '../assets/icons/arrow-down.svg.js';
|
|
2
|
+
import * as arrowRepeat from '../assets/icons/arrow-repeat.svg.js';
|
|
3
3
|
import * as arrowUp from '../assets/icons/arrow-up.svg.js';
|
|
4
4
|
import * as ban from '../assets/icons/ban.svg.js';
|
|
5
5
|
import * as bellFill from '../assets/icons/bell-fill.svg.js';
|
|
6
|
+
import * as boxArrowUpRight from '../assets/icons/box-arrow-up-right.svg.js';
|
|
6
7
|
import * as checkCircleFill from '../assets/icons/check-circle-fill.svg.js';
|
|
7
8
|
import * as checkLg from '../assets/icons/check-lg.svg.js';
|
|
8
9
|
import * as chevronDown from '../assets/icons/chevron-down.svg.js';
|
|
@@ -15,6 +16,13 @@ import * as exclamationCircleFill from '../assets/icons/exclamation-circle-fill.
|
|
|
15
16
|
import * as exclamationTriangleFill from '../assets/icons/exclamation-triangle-fill.svg.js';
|
|
16
17
|
import * as eyeSlash from '../assets/icons/eye-slash.svg.js';
|
|
17
18
|
import * as eye from '../assets/icons/eye.svg.js';
|
|
19
|
+
import * as fileEarmark from '../assets/icons/file-earmark.svg.js';
|
|
20
|
+
import * as flag from '../assets/icons/flag.svg.js';
|
|
21
|
+
import * as globe from '../assets/icons/globe.svg.js';
|
|
22
|
+
import * as handThumbsDownFill from '../assets/icons/hand-thumbs-down-fill.svg.js';
|
|
23
|
+
import * as handThumbsDown from '../assets/icons/hand-thumbs-down.svg.js';
|
|
24
|
+
import * as handThumbsUpFill from '../assets/icons/hand-thumbs-up-fill.svg.js';
|
|
25
|
+
import * as handThumbsUp from '../assets/icons/hand-thumbs-up.svg.js';
|
|
18
26
|
import * as infoCircleFill from '../assets/icons/info-circle-fill.svg.js';
|
|
19
27
|
import * as layoutSidebar from '../assets/icons/layout-sidebar.svg.js';
|
|
20
28
|
import * as lightbulbFill from '../assets/icons/lightbulb-fill.svg.js';
|
|
@@ -26,13 +34,21 @@ import * as paperclip from '../assets/icons/paperclip.svg.js';
|
|
|
26
34
|
import * as pencilSquare from '../assets/icons/pencil-square.svg.js';
|
|
27
35
|
import * as plusLg from '../assets/icons/plus-lg.svg.js';
|
|
28
36
|
import * as search from '../assets/icons/search.svg.js';
|
|
29
|
-
import * as
|
|
37
|
+
import * as share from '../assets/icons/share.svg.js';
|
|
38
|
+
import * as stopCircle from '../assets/icons/stop-circle.svg.js';
|
|
39
|
+
import * as tools from '../assets/icons/tools.svg.js';
|
|
30
40
|
import * as xLg from '../assets/icons/x-lg.svg.js';
|
|
31
41
|
|
|
32
42
|
let defaultIconBaseUrl = "/assets/icons/";
|
|
43
|
+
function getDefaultBaseUrl() {
|
|
44
|
+
return defaultIconBaseUrl;
|
|
45
|
+
}
|
|
46
|
+
function setDefaultBaseUrl(url) {
|
|
47
|
+
defaultIconBaseUrl = url;
|
|
48
|
+
}
|
|
33
49
|
const defaultIconCache = /* @__PURE__ */ new Map();
|
|
34
50
|
const internalIconBundle = new Map(
|
|
35
|
-
Object.entries(/* #__PURE__ */ Object.assign({"../assets/icons/arrow-
|
|
51
|
+
Object.entries(/* #__PURE__ */ Object.assign({"../assets/icons/arrow-down.svg": arrowDown,"../assets/icons/arrow-repeat.svg": arrowRepeat,"../assets/icons/arrow-up.svg": arrowUp,"../assets/icons/ban.svg": ban,"../assets/icons/bell-fill.svg": bellFill,"../assets/icons/box-arrow-up-right.svg": boxArrowUpRight,"../assets/icons/check-circle-fill.svg": checkCircleFill,"../assets/icons/check-lg.svg": checkLg,"../assets/icons/chevron-down.svg": chevronDown,"../assets/icons/chevron-left.svg": chevronLeft,"../assets/icons/chevron-right.svg": chevronRight,"../assets/icons/chevron-up.svg": chevronUp,"../assets/icons/copy.svg": copy,"../assets/icons/dash-lg.svg": dashLg,"../assets/icons/exclamation-circle-fill.svg": exclamationCircleFill,"../assets/icons/exclamation-triangle-fill.svg": exclamationTriangleFill,"../assets/icons/eye-slash.svg": eyeSlash,"../assets/icons/eye.svg": eye,"../assets/icons/file-earmark.svg": fileEarmark,"../assets/icons/flag.svg": flag,"../assets/icons/globe.svg": globe,"../assets/icons/hand-thumbs-down-fill.svg": handThumbsDownFill,"../assets/icons/hand-thumbs-down.svg": handThumbsDown,"../assets/icons/hand-thumbs-up-fill.svg": handThumbsUpFill,"../assets/icons/hand-thumbs-up.svg": handThumbsUp,"../assets/icons/info-circle-fill.svg": infoCircleFill,"../assets/icons/layout-sidebar.svg": layoutSidebar,"../assets/icons/lightbulb-fill.svg": lightbulbFill,"../assets/icons/lightbulb-off.svg": lightbulbOff,"../assets/icons/lightbulb.svg": lightbulb,"../assets/icons/mic-fill.svg": micFill,"../assets/icons/mic-mute-fill.svg": micMuteFill,"../assets/icons/paperclip.svg": paperclip,"../assets/icons/pencil-square.svg": pencilSquare,"../assets/icons/plus-lg.svg": plusLg,"../assets/icons/search.svg": search,"../assets/icons/share.svg": share,"../assets/icons/stop-circle.svg": stopCircle,"../assets/icons/tools.svg": tools,"../assets/icons/x-lg.svg": xLg
|
|
36
52
|
|
|
37
53
|
|
|
38
54
|
})).map(([path, module]) => {
|
|
@@ -41,26 +57,23 @@ const internalIconBundle = new Map(
|
|
|
41
57
|
}).filter(([name]) => name !== "")
|
|
42
58
|
);
|
|
43
59
|
class IconRegistry {
|
|
44
|
-
|
|
60
|
+
static {
|
|
45
61
|
this.libs = /* @__PURE__ */ new Map();
|
|
46
62
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this._instance = new IconRegistry();
|
|
50
|
-
}
|
|
51
|
-
return this._instance;
|
|
63
|
+
/** 클래스 생성 방지 */
|
|
64
|
+
constructor() {
|
|
52
65
|
}
|
|
53
66
|
/**
|
|
54
67
|
* 지정된 아이콘 라이브러리가 등록되었는지 확인합니다.
|
|
55
68
|
*/
|
|
56
|
-
has(lib) {
|
|
69
|
+
static has(lib) {
|
|
57
70
|
return this.libs.has(lib);
|
|
58
71
|
}
|
|
59
72
|
/**
|
|
60
73
|
* 지정된 아이콘 라이브러리를 등록합니다.
|
|
61
74
|
* 이미 등록된 라이브러리 이름인 경우, 경고 메시지를 출력합니다.
|
|
62
75
|
*/
|
|
63
|
-
register(lib, resolver) {
|
|
76
|
+
static register(lib, resolver) {
|
|
64
77
|
if (this.libs.has(lib)) {
|
|
65
78
|
console.warn(`Icon library "${lib}" is already registered`);
|
|
66
79
|
} else {
|
|
@@ -70,23 +83,23 @@ class IconRegistry {
|
|
|
70
83
|
/**
|
|
71
84
|
* 지정된 아이콘 라이브러리를 등록 해제합니다.
|
|
72
85
|
*/
|
|
73
|
-
unregister(lib) {
|
|
86
|
+
static unregister(lib) {
|
|
74
87
|
this.libs.delete(lib);
|
|
75
88
|
}
|
|
76
89
|
/**
|
|
77
90
|
* 지정된 아이콘 라이브러리의 svg 아이콘 소스를 가져옵니다.
|
|
78
91
|
*/
|
|
79
|
-
async resolve(lib, name) {
|
|
92
|
+
static async resolve(lib, name) {
|
|
80
93
|
const resolver = this.libs.get(lib);
|
|
81
94
|
if (!resolver) return void 0;
|
|
82
95
|
const svg = await resolver(name);
|
|
83
96
|
return svg?.trim();
|
|
84
97
|
}
|
|
85
98
|
}
|
|
86
|
-
IconRegistry.
|
|
99
|
+
IconRegistry.register("internal", (name) => {
|
|
87
100
|
return internalIconBundle.get(name);
|
|
88
101
|
});
|
|
89
|
-
IconRegistry.
|
|
102
|
+
IconRegistry.register("default", async (name) => {
|
|
90
103
|
if (defaultIconCache.has(name)) {
|
|
91
104
|
return defaultIconCache.get(name);
|
|
92
105
|
}
|
|
@@ -103,9 +116,5 @@ IconRegistry.instance.register("default", async (name) => {
|
|
|
103
116
|
return void 0;
|
|
104
117
|
}
|
|
105
118
|
});
|
|
106
|
-
const icons = IconRegistry.instance;
|
|
107
|
-
function getDefaultBaseUrl() {
|
|
108
|
-
return defaultIconBaseUrl;
|
|
109
|
-
}
|
|
110
119
|
|
|
111
|
-
export { getDefaultBaseUrl,
|
|
120
|
+
export { IconRegistry, getDefaultBaseUrl, setDefaultBaseUrl };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AlertType } from '../components/alert/UAlert.component.js';
|
|
2
|
+
/** 토스트 알림의 화면 위치 타입 */
|
|
2
3
|
export type ScreenPosition = "top-left" | "top-center" | "top-right" | "middle-left" | "middle-center" | "middle-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
3
4
|
/** 토스트 알림 옵션 */
|
|
4
5
|
export interface ToastOptions {
|
|
@@ -14,23 +15,17 @@ export interface ToastOptions {
|
|
|
14
15
|
position?: ScreenPosition;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* 알림 유틸리티 전역 인스턴스입니다.
|
|
18
19
|
*/
|
|
19
|
-
declare class Notifier {
|
|
20
|
-
private static
|
|
21
|
-
private
|
|
22
|
-
|
|
20
|
+
export declare class Notifier {
|
|
21
|
+
private static containers;
|
|
22
|
+
private static toasts;
|
|
23
|
+
/** 개별 인스턴스 생성을 방지합니다. */
|
|
23
24
|
private constructor();
|
|
24
|
-
static get instance(): Notifier;
|
|
25
25
|
/**
|
|
26
26
|
* 토스트 알림을 생성합니다.
|
|
27
27
|
*/
|
|
28
|
-
toast(options: ToastOptions): Promise<void>;
|
|
28
|
+
static toast(options: ToastOptions): Promise<void>;
|
|
29
29
|
/** 위치에 맞는 컨테이너 엘리먼트를 가져오거나, 생성합니다. */
|
|
30
|
-
private getOrCreateContainer;
|
|
30
|
+
private static getOrCreateContainer;
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
* 알림 유틸리티 싱글톤 인스턴스입니다.
|
|
34
|
-
*/
|
|
35
|
-
export declare const notifier: Notifier;
|
|
36
|
-
export {};
|
|
@@ -2,20 +2,19 @@ import { UAlert } from '../components/alert/UAlert.component.js';
|
|
|
2
2
|
|
|
3
3
|
UAlert.define("u-alert");
|
|
4
4
|
class Notifier {
|
|
5
|
-
|
|
5
|
+
static {
|
|
6
6
|
this.containers = /* @__PURE__ */ new Map();
|
|
7
|
+
}
|
|
8
|
+
static {
|
|
7
9
|
this.toasts = /* @__PURE__ */ new Set();
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this._instance = new Notifier();
|
|
12
|
-
}
|
|
13
|
-
return this._instance;
|
|
11
|
+
/** 개별 인스턴스 생성을 방지합니다. */
|
|
12
|
+
constructor() {
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
15
|
* 토스트 알림을 생성합니다.
|
|
17
16
|
*/
|
|
18
|
-
async toast(options) {
|
|
17
|
+
static async toast(options) {
|
|
19
18
|
const el = new UAlert();
|
|
20
19
|
el.type = options.type;
|
|
21
20
|
el.heading = options.heading;
|
|
@@ -39,7 +38,7 @@ class Notifier {
|
|
|
39
38
|
}, duration);
|
|
40
39
|
}
|
|
41
40
|
/** 위치에 맞는 컨테이너 엘리먼트를 가져오거나, 생성합니다. */
|
|
42
|
-
getOrCreateContainer(position) {
|
|
41
|
+
static getOrCreateContainer(position) {
|
|
43
42
|
let container = this.containers.get(position);
|
|
44
43
|
if (container) return container;
|
|
45
44
|
container = document.createElement("div");
|
|
@@ -76,6 +75,5 @@ class Notifier {
|
|
|
76
75
|
return container;
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
|
-
const notifier = Notifier.instance;
|
|
80
78
|
|
|
81
|
-
export {
|
|
79
|
+
export { Notifier };
|
|
@@ -25,36 +25,31 @@ export interface ThemeInitOptions {
|
|
|
25
25
|
useBuiltIn?: boolean;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* 현재 문서에 테마를 적용하고 관리하는 유틸리티
|
|
28
|
+
* 현재 문서에 테마를 적용하고 관리하는 유틸리티 전역 인스턴스입니다.
|
|
29
29
|
*/
|
|
30
30
|
export declare class Theme {
|
|
31
|
-
private static
|
|
32
|
-
private
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
|
|
31
|
+
private static readonly STORAGE_THEME_KEY;
|
|
32
|
+
private static storage;
|
|
33
|
+
private static _isInitialized;
|
|
34
|
+
private static _isDebugMode;
|
|
35
|
+
/** 개별 인스턴스 생성을 방지합니다. */
|
|
36
36
|
private constructor();
|
|
37
|
-
static get
|
|
38
|
-
get
|
|
39
|
-
get isDebugMode(): boolean;
|
|
37
|
+
static get isInitialized(): boolean;
|
|
38
|
+
static get isDebugMode(): boolean;
|
|
40
39
|
/**
|
|
41
40
|
* 테마 유틸리티를 초기화합니다.
|
|
42
41
|
*/
|
|
43
|
-
init(options?: ThemeInitOptions): Promise<void>;
|
|
42
|
+
static init(options?: ThemeInitOptions): Promise<void>;
|
|
44
43
|
/**
|
|
45
44
|
* 현재 문서에 적용된 테마를 가져옵니다.
|
|
46
45
|
*/
|
|
47
|
-
get(): ThemeType | undefined;
|
|
46
|
+
static get(): ThemeType | undefined;
|
|
48
47
|
/**
|
|
49
48
|
* 현재 문서에 적용할 테마를 설정합니다.
|
|
50
49
|
*/
|
|
51
|
-
set(theme: ThemeType): void;
|
|
50
|
+
static set(theme: ThemeType): void;
|
|
52
51
|
/** 시스템 테마 변경을 처리하는 메서드 */
|
|
53
|
-
private handleSystemThemeChanged;
|
|
52
|
+
private static handleSystemThemeChanged;
|
|
54
53
|
/** 디버그 모드시 로그 출력 함수 (인스턴스 스코프) */
|
|
55
|
-
private log;
|
|
54
|
+
private static log;
|
|
56
55
|
}
|
|
57
|
-
/**
|
|
58
|
-
* 테마 유틸리티의 싱글톤 인스턴스입니다.
|
|
59
|
-
*/
|
|
60
|
-
export declare const theme: Theme;
|