@iyulab/components 0.1.6 → 0.1.8
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 +42 -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 -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/BaseElement.styles.js +1 -1
- package/dist/components/FloatingElement.d.ts +31 -19
- package/dist/components/FloatingElement.js +46 -34
- package/dist/components/FloatingElement.styles.js +5 -4
- package/dist/components/ModalElement.d.ts +70 -0
- package/dist/components/ModalElement.js +144 -0
- package/dist/components/ModalElement.styles.js +29 -0
- package/dist/components/alert/{Alert.d.ts → UAlert.component.d.ts} +1 -1
- package/dist/components/alert/{Alert.js → UAlert.component.js} +20 -18
- package/dist/components/alert/UAlert.d.ts +8 -0
- package/dist/components/alert/UAlert.js +5 -0
- package/dist/components/alert/{Alert.styles.js → UAlert.styles.js} +1 -3
- package/dist/components/button/{Button.d.ts → UButton.component.d.ts} +1 -1
- package/dist/components/button/{Button.js → UButton.component.js} +7 -7
- package/dist/components/button/UButton.d.ts +7 -0
- package/dist/components/button/UButton.js +5 -0
- package/dist/components/copy-button/{CopyButton.d.ts → UCopyButton.component.d.ts} +1 -1
- package/dist/components/copy-button/{CopyButton.js → UCopyButton.component.js} +10 -10
- package/dist/components/copy-button/UCopyButton.d.ts +7 -0
- package/dist/components/copy-button/UCopyButton.js +5 -0
- package/dist/components/dialog/UDialog.component.d.ts +15 -0
- package/dist/components/dialog/UDialog.component.js +65 -0
- package/dist/components/dialog/UDialog.d.ts +7 -0
- package/dist/components/dialog/UDialog.js +5 -0
- package/dist/components/dialog/{Dialog.styles.js → UDialog.styles.js} +14 -29
- package/dist/components/divider/{Divider.d.ts → UDivider.component.d.ts} +1 -1
- package/dist/components/divider/{Divider.js → UDivider.component.js} +6 -6
- package/dist/components/divider/UDivider.d.ts +7 -0
- package/dist/components/divider/UDivider.js +5 -0
- package/dist/components/drawer/UDrawer.component.d.ts +16 -0
- package/dist/components/drawer/UDrawer.component.js +59 -0
- package/dist/components/drawer/UDrawer.d.ts +8 -0
- package/dist/components/drawer/UDrawer.js +5 -0
- package/dist/components/drawer/UDrawer.styles.js +82 -0
- package/dist/components/form/{Form.d.ts → UForm.component.d.ts} +2 -2
- package/dist/components/form/{Form.js → UForm.component.js} +14 -12
- package/dist/components/form/UForm.d.ts +7 -0
- package/dist/components/form/UForm.js +5 -0
- package/dist/components/icon/{Icon.d.ts → UIcon.component.d.ts} +5 -4
- package/dist/components/icon/{Icon.js → UIcon.component.js} +9 -10
- package/dist/components/icon/UIcon.d.ts +8 -0
- package/dist/components/icon/UIcon.js +5 -0
- package/dist/components/icon-button/{IconButton.d.ts → UIconButton.component.d.ts} +3 -2
- package/dist/components/icon-button/{IconButton.js → UIconButton.component.js} +15 -15
- package/dist/components/icon-button/UIconButton.d.ts +7 -0
- package/dist/components/icon-button/UIconButton.js +5 -0
- package/dist/components/input/{Input.d.ts → UInput.component.d.ts} +14 -10
- package/dist/components/input/{Input.js → UInput.component.js} +71 -76
- package/dist/components/input/UInput.d.ts +7 -0
- package/dist/components/input/UInput.js +5 -0
- package/dist/components/input/{Input.styles.js → UInput.styles.js} +27 -24
- package/dist/components/menu/UMenu.component.d.ts +70 -0
- package/dist/components/menu/UMenu.component.js +327 -0
- package/dist/components/menu/UMenu.d.ts +8 -0
- package/dist/components/menu/UMenu.js +5 -0
- package/dist/components/menu/UMenu.styles.js +39 -0
- package/dist/components/menu-item/UMenuItem.component.d.ts +19 -0
- package/dist/components/menu-item/UMenuItem.component.js +96 -0
- package/dist/components/menu-item/UMenuItem.d.ts +7 -0
- package/dist/components/menu-item/UMenuItem.js +5 -0
- package/dist/components/menu-item/UMenuItem.styles.js +65 -0
- package/dist/components/progress-bar/{ProgressBar.d.ts → UProgressBar.component.d.ts} +1 -1
- package/dist/components/progress-bar/{ProgressBar.js → UProgressBar.component.js} +10 -10
- package/dist/components/progress-bar/UProgressBar.d.ts +7 -0
- package/dist/components/progress-bar/UProgressBar.js +5 -0
- package/dist/components/progress-ring/{ProgressRing.d.ts → UProgressRing.component.d.ts} +1 -1
- package/dist/components/progress-ring/{ProgressRing.js → UProgressRing.component.js} +9 -9
- package/dist/components/progress-ring/UProgressRing.d.ts +8 -0
- package/dist/components/progress-ring/UProgressRing.js +5 -0
- package/dist/components/skeleton/USkeleton.component.d.ts +22 -0
- package/dist/components/skeleton/USkeleton.component.js +58 -0
- package/dist/components/skeleton/USkeleton.d.ts +8 -0
- package/dist/components/skeleton/USkeleton.js +5 -0
- package/dist/components/skeleton/USkeleton.styles.js +74 -0
- package/dist/components/spinner/{Spinner.d.ts → USpinner.component.d.ts} +1 -1
- package/dist/components/spinner/{Spinner.js → USpinner.component.js} +3 -3
- package/dist/components/spinner/USpinner.d.ts +7 -0
- package/dist/components/spinner/USpinner.js +5 -0
- package/dist/components/split-panel/{SplitPanel.d.ts → USplitPanel.component.d.ts} +1 -1
- package/dist/components/split-panel/{SplitPanel.js → USplitPanel.component.js} +13 -13
- package/dist/components/split-panel/USplitPanel.d.ts +7 -0
- package/dist/components/split-panel/USplitPanel.js +5 -0
- package/dist/components/tooltip/{Tooltip.d.ts → UTooltip.component.d.ts} +6 -7
- package/dist/components/tooltip/{Tooltip.js → UTooltip.component.js} +12 -16
- package/dist/components/tooltip/UTooltip.d.ts +7 -0
- package/dist/components/tooltip/UTooltip.js +5 -0
- package/dist/components/tooltip/{Tooltip.styles.js → UTooltip.styles.js} +1 -0
- package/dist/components/tree/{Tree.d.ts → UTree.component.d.ts} +4 -4
- package/dist/components/tree/{Tree.js → UTree.component.js} +10 -10
- package/dist/components/tree/UTree.d.ts +7 -0
- package/dist/components/tree/UTree.js +5 -0
- package/dist/components/tree/UTree.styles.d.ts +1 -0
- package/dist/components/tree/{Tree.styles.js → UTree.styles.js} +0 -1
- package/dist/components/tree-item/{TreeItem.d.ts → UTreeItem.component.d.ts} +2 -2
- package/dist/components/tree-item/{TreeItem.js → UTreeItem.component.js} +15 -15
- package/dist/components/tree-item/UTreeItem.d.ts +7 -0
- package/dist/components/tree-item/UTreeItem.js +5 -0
- package/dist/index.d.ts +29 -2
- package/dist/index.js +40 -42
- package/dist/internals/attribute-converters.d.ts +5 -3
- package/dist/internals/node-helpers.d.ts +9 -9
- package/dist/internals/node-helpers.js +2 -2
- package/dist/utilities/icons.js +1 -4
- package/dist/utilities/notifier.d.ts +1 -1
- package/dist/utilities/notifier.js +3 -3
- package/package.json +60 -59
- package/dist/components/alert/index.d.ts +0 -7
- package/dist/components/alert/index.js +0 -5
- package/dist/components/button/index.d.ts +0 -7
- package/dist/components/button/index.js +0 -5
- package/dist/components/context-menu/ContextMenu.d.ts +0 -29
- package/dist/components/context-menu/ContextMenu.js +0 -148
- package/dist/components/context-menu/ContextMenu.styles.js +0 -15
- package/dist/components/context-menu/index.d.ts +0 -7
- package/dist/components/context-menu/index.js +0 -5
- package/dist/components/copy-button/index.d.ts +0 -7
- package/dist/components/copy-button/index.js +0 -5
- package/dist/components/dialog/Dialog.d.ts +0 -37
- package/dist/components/dialog/Dialog.js +0 -160
- package/dist/components/dialog/index.d.ts +0 -7
- package/dist/components/dialog/index.js +0 -5
- package/dist/components/divider/index.d.ts +0 -7
- package/dist/components/divider/index.js +0 -5
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +0 -27
- package/dist/components/dropdown-menu/DropdownMenu.js +0 -135
- package/dist/components/dropdown-menu/DropdownMenu.styles.js +0 -15
- package/dist/components/dropdown-menu/index.d.ts +0 -7
- package/dist/components/dropdown-menu/index.js +0 -5
- package/dist/components/form/index.d.ts +0 -7
- package/dist/components/form/index.js +0 -5
- package/dist/components/icon/index.d.ts +0 -7
- package/dist/components/icon/index.js +0 -5
- package/dist/components/icon-button/index.d.ts +0 -7
- package/dist/components/icon-button/index.js +0 -5
- package/dist/components/index.d.ts +0 -20
- package/dist/components/input/index.d.ts +0 -7
- package/dist/components/input/index.js +0 -5
- package/dist/components/menu/Menu.d.ts +0 -25
- package/dist/components/menu/Menu.js +0 -168
- package/dist/components/menu/Menu.styles.js +0 -21
- package/dist/components/menu/index.d.ts +0 -7
- package/dist/components/menu/index.js +0 -5
- package/dist/components/menu-item/MenuItem.d.ts +0 -36
- package/dist/components/menu-item/MenuItem.js +0 -267
- package/dist/components/menu-item/MenuItem.styles.js +0 -70
- package/dist/components/menu-item/index.d.ts +0 -7
- package/dist/components/menu-item/index.js +0 -5
- package/dist/components/progress-bar/index.d.ts +0 -7
- package/dist/components/progress-bar/index.js +0 -5
- package/dist/components/progress-ring/index.d.ts +0 -7
- package/dist/components/progress-ring/index.js +0 -5
- package/dist/components/spinner/index.d.ts +0 -7
- package/dist/components/spinner/index.js +0 -5
- package/dist/components/split-panel/index.d.ts +0 -7
- package/dist/components/split-panel/index.js +0 -5
- package/dist/components/tooltip/index.d.ts +0 -7
- package/dist/components/tooltip/index.js +0 -5
- package/dist/components/tree/index.d.ts +0 -3
- package/dist/components/tree/index.js +0 -5
- package/dist/components/tree-item/index.d.ts +0 -3
- package/dist/components/tree-item/index.js +0 -5
- package/dist/events/index.d.ts +0 -6
- package/dist/integrations/react/UAlert.d.ts +0 -8
- package/dist/integrations/react/UAlert.js +0 -10
- package/dist/integrations/react/UButton.d.ts +0 -8
- package/dist/integrations/react/UButton.js +0 -10
- package/dist/integrations/react/UContextMenu.d.ts +0 -8
- package/dist/integrations/react/UContextMenu.js +0 -10
- package/dist/integrations/react/UCopyButton.d.ts +0 -8
- package/dist/integrations/react/UCopyButton.js +0 -10
- package/dist/integrations/react/UDialog.d.ts +0 -8
- package/dist/integrations/react/UDialog.js +0 -10
- package/dist/integrations/react/UDivider.d.ts +0 -8
- package/dist/integrations/react/UDivider.js +0 -10
- package/dist/integrations/react/UDropdownMenu.d.ts +0 -8
- package/dist/integrations/react/UDropdownMenu.js +0 -10
- package/dist/integrations/react/UForm.d.ts +0 -8
- package/dist/integrations/react/UForm.js +0 -10
- package/dist/integrations/react/UIcon.d.ts +0 -8
- package/dist/integrations/react/UIcon.js +0 -10
- package/dist/integrations/react/UIconButton.d.ts +0 -8
- package/dist/integrations/react/UIconButton.js +0 -10
- package/dist/integrations/react/UInput.d.ts +0 -8
- package/dist/integrations/react/UInput.js +0 -10
- package/dist/integrations/react/UMenu.d.ts +0 -8
- package/dist/integrations/react/UMenu.js +0 -10
- package/dist/integrations/react/UMenuItem.d.ts +0 -8
- package/dist/integrations/react/UMenuItem.js +0 -10
- package/dist/integrations/react/UProgressBar.d.ts +0 -8
- package/dist/integrations/react/UProgressBar.js +0 -10
- package/dist/integrations/react/UProgressRing.d.ts +0 -8
- package/dist/integrations/react/UProgressRing.js +0 -10
- package/dist/integrations/react/USpinner.d.ts +0 -8
- package/dist/integrations/react/USpinner.js +0 -10
- package/dist/integrations/react/USplitPanel.d.ts +0 -8
- package/dist/integrations/react/USplitPanel.js +0 -10
- package/dist/integrations/react/UTooltip.d.ts +0 -8
- package/dist/integrations/react/UTooltip.js +0 -10
- package/dist/integrations/react/UTree.d.ts +0 -8
- package/dist/integrations/react/UTree.js +0 -10
- package/dist/integrations/react/UTreeItem.d.ts +0 -8
- package/dist/integrations/react/UTreeItem.js +0 -10
- package/dist/integrations/react/index.d.ts +0 -27
- package/dist/integrations/react/index.js +0 -20
- package/dist/internals/index.d.ts +0 -3
- package/dist/utilities/decorators.js +0 -28
- package/dist/utilities/index.d.ts +0 -5
- /package/dist/components/{alert/Alert.styles.d.ts → ModalElement.styles.d.ts} +0 -0
- /package/dist/components/{button/Button.styles.d.ts → alert/UAlert.styles.d.ts} +0 -0
- /package/dist/components/{context-menu/ContextMenu.styles.d.ts → button/UButton.styles.d.ts} +0 -0
- /package/dist/components/button/{Button.styles.js → UButton.styles.js} +0 -0
- /package/dist/components/copy-button/{CopyButton.styles.d.ts → UCopyButton.styles.d.ts} +0 -0
- /package/dist/components/copy-button/{CopyButton.styles.js → UCopyButton.styles.js} +0 -0
- /package/dist/components/dialog/{Dialog.styles.d.ts → UDialog.styles.d.ts} +0 -0
- /package/dist/components/divider/{Divider.styles.d.ts → UDivider.styles.d.ts} +0 -0
- /package/dist/components/divider/{Divider.styles.js → UDivider.styles.js} +0 -0
- /package/dist/components/{dropdown-menu/DropdownMenu.styles.d.ts → drawer/UDrawer.styles.d.ts} +0 -0
- /package/dist/components/form/{Form.styles.d.ts → UForm.styles.d.ts} +0 -0
- /package/dist/components/form/{Form.styles.js → UForm.styles.js} +0 -0
- /package/dist/components/icon/{Icon.styles.d.ts → UIcon.styles.d.ts} +0 -0
- /package/dist/components/icon/{Icon.styles.js → UIcon.styles.js} +0 -0
- /package/dist/components/icon-button/{IconButton.styles.d.ts → UIconButton.styles.d.ts} +0 -0
- /package/dist/components/icon-button/{IconButton.styles.js → UIconButton.styles.js} +0 -0
- /package/dist/components/input/{Input.styles.d.ts → UInput.styles.d.ts} +0 -0
- /package/dist/components/menu/{Menu.styles.d.ts → UMenu.styles.d.ts} +0 -0
- /package/dist/components/menu-item/{MenuItem.styles.d.ts → UMenuItem.styles.d.ts} +0 -0
- /package/dist/components/progress-bar/{ProgressBar.styles.d.ts → UProgressBar.styles.d.ts} +0 -0
- /package/dist/components/progress-bar/{ProgressBar.styles.js → UProgressBar.styles.js} +0 -0
- /package/dist/components/progress-ring/{ProgressRing.styles.d.ts → UProgressRing.styles.d.ts} +0 -0
- /package/dist/components/progress-ring/{ProgressRing.styles.js → UProgressRing.styles.js} +0 -0
- /package/dist/components/{spinner/Spinner.styles.d.ts → skeleton/USkeleton.styles.d.ts} +0 -0
- /package/dist/components/{split-panel/SplitPanel.styles.d.ts → spinner/USpinner.styles.d.ts} +0 -0
- /package/dist/components/spinner/{Spinner.styles.js → USpinner.styles.js} +0 -0
- /package/dist/components/{tooltip/Tooltip.styles.d.ts → split-panel/USplitPanel.styles.d.ts} +0 -0
- /package/dist/components/split-panel/{SplitPanel.styles.js → USplitPanel.styles.js} +0 -0
- /package/dist/components/{tree-item/TreeItem.styles.d.ts → tooltip/UTooltip.styles.d.ts} +0 -0
- /package/dist/components/{tree/Tree.styles.d.ts → tree-item/UTreeItem.styles.d.ts} +0 -0
- /package/dist/components/tree-item/{TreeItem.styles.js → UTreeItem.styles.js} +0 -0
|
@@ -7,8 +7,8 @@ import { BaseElement } from './BaseElement.js';
|
|
|
7
7
|
*
|
|
8
8
|
* 1. for, anchor 속성을 통해 연결될 대상 엘리먼트를 지정할 수 있습니다.
|
|
9
9
|
* 2. visible 속성을 통해 엘리먼트의 표시 여부를 제어할 수 있습니다.
|
|
10
|
-
* 3.
|
|
11
|
-
* 4.
|
|
10
|
+
* 3. show() 및 hide() 메서드를 통해 프로그래밍적으로 표시하거나 숨길 수 있습니다.
|
|
11
|
+
* 4. strategy, placement, distance, shift 속성을 통해 표시 위치 결정 방식을 설정할 수 있습니다.
|
|
12
12
|
*/
|
|
13
13
|
export declare class FloatingElement extends BaseElement {
|
|
14
14
|
/** 기본 스타일을 정의합니다. */
|
|
@@ -21,8 +21,20 @@ export declare class FloatingElement extends BaseElement {
|
|
|
21
21
|
* 연결될 대상 엘리먼트 입니다. 지정하지 않으면 부모 엘리먼트를 사용합니다.
|
|
22
22
|
*/
|
|
23
23
|
anchor?: HTMLElement;
|
|
24
|
+
/**
|
|
25
|
+
* 앵커 엘리먼트를 찾기 위한 CSS 선택자입니다. querySelector를 사용하여 DOM에서 대상을 검색합니다.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* - `id`로 찾기: for="#target-id"
|
|
29
|
+
* - `class`로 찾기: for=".target-class"
|
|
30
|
+
* - `태그명`으로 찾기: for="target-tag-name"
|
|
31
|
+
* - `속성`으로 찾기: for="[data-role='target']"
|
|
32
|
+
*/
|
|
33
|
+
for?: string;
|
|
24
34
|
/**
|
|
25
35
|
* 현재 엘리먼트가 보여지는지 여부입니다.
|
|
36
|
+
*
|
|
37
|
+
* @default false
|
|
26
38
|
*/
|
|
27
39
|
visible: boolean;
|
|
28
40
|
/**
|
|
@@ -33,16 +45,6 @@ export declare class FloatingElement extends BaseElement {
|
|
|
33
45
|
* - `fixed`: 엘리먼트가 뷰포트에 고정되어 스크롤과 무관하게 위치합니다.
|
|
34
46
|
*/
|
|
35
47
|
strategy: 'absolute' | 'fixed';
|
|
36
|
-
/**
|
|
37
|
-
* 앵커 엘리먼트를 찾기 위한 CSS 선택자입니다. querySelector를 사용하여 DOM에서 대상을 검색합니다.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* - `id`로 찾기: for="#target-id"
|
|
41
|
-
* - `class`로 찾기: for=".target-class"
|
|
42
|
-
* - `태그명`으로 찾기: for="target-tag-name"
|
|
43
|
-
* - `속성`으로 찾기: for="[data-role='target']"
|
|
44
|
-
*/
|
|
45
|
-
for?: string;
|
|
46
48
|
/**
|
|
47
49
|
* 대상 엘리먼트로부터의 배치 위치입니다.
|
|
48
50
|
* 지정하지 않으면 `floating-ui`의 `autoPlacement`가 적용됩니다.
|
|
@@ -54,15 +56,29 @@ export declare class FloatingElement extends BaseElement {
|
|
|
54
56
|
* @default 0
|
|
55
57
|
*/
|
|
56
58
|
distance: number;
|
|
59
|
+
/**
|
|
60
|
+
* 대상 엘리먼트로의 기준축에서의 오프셋 (px) 입니다.
|
|
61
|
+
*
|
|
62
|
+
* @default 0
|
|
63
|
+
*/
|
|
64
|
+
offset: number;
|
|
65
|
+
/**
|
|
66
|
+
* 엘리먼트가 화면 안에 머물도록 자동으로 조정할지 여부입니다.
|
|
67
|
+
*
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
shift: boolean;
|
|
57
71
|
connectedCallback(): void;
|
|
58
72
|
disconnectedCallback(): void;
|
|
59
73
|
protected willUpdate(changedProperties: PropertyValues): void;
|
|
74
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
60
75
|
/**
|
|
61
76
|
* 현재 엘리먼트를 표시합니다.
|
|
62
77
|
*
|
|
63
78
|
* @param anchor - 위치 계산에 사용할 앵커 엘리먼트입니다. 지정하지 않으면 this.anchor 가 사용됩니다.
|
|
79
|
+
* @param auto - 표시 후 자동 위치 업데이트 활성화 여부입니다. 기본값은 true 입니다.
|
|
64
80
|
*/
|
|
65
|
-
show(anchor?: Element | VirtualElement): Promise<void>;
|
|
81
|
+
show(anchor?: Element | VirtualElement, auto?: boolean): Promise<void>;
|
|
66
82
|
/**
|
|
67
83
|
* 현재 엘리먼트를 숨깁니다.
|
|
68
84
|
*/
|
|
@@ -73,12 +89,8 @@ export declare class FloatingElement extends BaseElement {
|
|
|
73
89
|
* @param target - 위치 계산에 사용할 앵커 엘리먼트입니다.
|
|
74
90
|
*/
|
|
75
91
|
protected reposition(target: Element | VirtualElement): Promise<void>;
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
*
|
|
79
|
-
* @param enable - 자동 위치 업데이트 활성화 여부
|
|
80
|
-
*/
|
|
81
|
-
protected autoPosition(enable: boolean): void;
|
|
92
|
+
/** 표시 상태 변경 이벤트를 발생시킵니다. */
|
|
93
|
+
private updateVisibleState;
|
|
82
94
|
/** 애니메이션 프레임을 사용하여 표시 상태를 스케줄링합니다. */
|
|
83
95
|
private scheduleVisible;
|
|
84
96
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { state, property } from 'lit/decorators.js';
|
|
2
|
-
import { offset, shift, flip, autoPlacement
|
|
3
|
-
import { getParentElement,
|
|
2
|
+
import { autoUpdate, computePosition, offset, shift, flip, autoPlacement } from '@floating-ui/dom';
|
|
3
|
+
import { getParentElement, querySelectorWithin } from '../internals/node-helpers.js';
|
|
4
4
|
import { BaseElement } from './BaseElement.js';
|
|
5
5
|
import { styles } from './FloatingElement.styles.js';
|
|
6
6
|
|
|
@@ -23,6 +23,8 @@ class FloatingElement extends BaseElement {
|
|
|
23
23
|
this.visible = false;
|
|
24
24
|
this.strategy = "absolute";
|
|
25
25
|
this.distance = 0;
|
|
26
|
+
this.offset = 0;
|
|
27
|
+
this.shift = false;
|
|
26
28
|
}
|
|
27
29
|
static {
|
|
28
30
|
/** 기본 스타일을 정의합니다. */
|
|
@@ -38,27 +40,42 @@ class FloatingElement extends BaseElement {
|
|
|
38
40
|
}
|
|
39
41
|
disconnectedCallback() {
|
|
40
42
|
if (this.rafId !== null) cancelAnimationFrame(this.rafId);
|
|
41
|
-
this.
|
|
43
|
+
if (this.cleanup !== null) this.cleanup();
|
|
44
|
+
this.rafId = null;
|
|
45
|
+
this.cleanup = null;
|
|
42
46
|
super.disconnectedCallback();
|
|
43
47
|
}
|
|
44
48
|
willUpdate(changedProperties) {
|
|
45
49
|
super.willUpdate(changedProperties);
|
|
46
50
|
if (changedProperties.has("for")) {
|
|
47
|
-
const founded = this.for ?
|
|
51
|
+
const founded = this.for ? querySelectorWithin(this, this.for) : void 0;
|
|
48
52
|
this.anchor = founded || void 0;
|
|
49
53
|
}
|
|
50
54
|
}
|
|
55
|
+
updated(changedProperties) {
|
|
56
|
+
super.updated(changedProperties);
|
|
57
|
+
if (changedProperties.has("visible")) {
|
|
58
|
+
this.toggleAttribute("inert", !this.visible);
|
|
59
|
+
this.toggleAttribute("aria-hidden", !this.visible);
|
|
60
|
+
this.updateVisibleState(this.visible);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
51
63
|
/**
|
|
52
64
|
* 현재 엘리먼트를 표시합니다.
|
|
53
65
|
*
|
|
54
66
|
* @param anchor - 위치 계산에 사용할 앵커 엘리먼트입니다. 지정하지 않으면 this.anchor 가 사용됩니다.
|
|
67
|
+
* @param auto - 표시 후 자동 위치 업데이트 활성화 여부입니다. 기본값은 true 입니다.
|
|
55
68
|
*/
|
|
56
|
-
async show(anchor) {
|
|
69
|
+
async show(anchor, auto = true) {
|
|
57
70
|
anchor ||= this.anchor;
|
|
58
71
|
if (!anchor) return;
|
|
59
72
|
await this.updateComplete;
|
|
60
73
|
await this.reposition(anchor);
|
|
61
|
-
|
|
74
|
+
if (auto === true) {
|
|
75
|
+
this.cleanup = autoUpdate(anchor, this, () => {
|
|
76
|
+
this.reposition(anchor);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
62
79
|
this.scheduleVisible(true);
|
|
63
80
|
}
|
|
64
81
|
/**
|
|
@@ -66,7 +83,8 @@ class FloatingElement extends BaseElement {
|
|
|
66
83
|
*/
|
|
67
84
|
async hide() {
|
|
68
85
|
await this.updateComplete;
|
|
69
|
-
this.
|
|
86
|
+
if (this.cleanup !== null) this.cleanup();
|
|
87
|
+
this.cleanup = null;
|
|
70
88
|
this.scheduleVisible(false);
|
|
71
89
|
}
|
|
72
90
|
/**
|
|
@@ -75,23 +93,19 @@ class FloatingElement extends BaseElement {
|
|
|
75
93
|
* @param target - 위치 계산에 사용할 앵커 엘리먼트입니다.
|
|
76
94
|
*/
|
|
77
95
|
async reposition(target) {
|
|
78
|
-
const middleware = [
|
|
79
|
-
offset({ mainAxis: this.distance }),
|
|
80
|
-
shift(),
|
|
81
|
-
flip()
|
|
82
|
-
];
|
|
83
|
-
if (!this.placement) {
|
|
84
|
-
middleware.push(autoPlacement());
|
|
85
|
-
}
|
|
86
96
|
const position = await computePosition(target, this, {
|
|
87
97
|
strategy: this.strategy,
|
|
88
98
|
placement: this.placement,
|
|
89
|
-
middleware
|
|
99
|
+
middleware: [
|
|
100
|
+
offset({ mainAxis: this.distance, crossAxis: this.offset }),
|
|
101
|
+
shift({ mainAxis: this.shift }),
|
|
102
|
+
this.placement ? flip() : autoPlacement()
|
|
103
|
+
]
|
|
90
104
|
});
|
|
91
105
|
Object.assign(this.style, {
|
|
92
106
|
left: `${position.x}px`,
|
|
93
107
|
top: `${position.y}px`,
|
|
94
|
-
// placement 에 따라 transform-origin 값을 결정합니다.
|
|
108
|
+
// placement 에 따라 transform-origin 값을 결정합니다.(애니메이션용)
|
|
95
109
|
transformOrigin: (() => {
|
|
96
110
|
switch (position.placement) {
|
|
97
111
|
case "top":
|
|
@@ -116,20 +130,12 @@ class FloatingElement extends BaseElement {
|
|
|
116
130
|
})()
|
|
117
131
|
});
|
|
118
132
|
}
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (this.cleanup) {
|
|
126
|
-
this.cleanup();
|
|
127
|
-
this.cleanup = null;
|
|
128
|
-
}
|
|
129
|
-
if (enable && this.anchor) {
|
|
130
|
-
this.cleanup = autoUpdate(this.anchor, this, () => {
|
|
131
|
-
this.reposition(this.anchor);
|
|
132
|
-
});
|
|
133
|
+
/** 표시 상태 변경 이벤트를 발생시킵니다. */
|
|
134
|
+
updateVisibleState(visible) {
|
|
135
|
+
if (visible) {
|
|
136
|
+
this.emit("u-show");
|
|
137
|
+
} else {
|
|
138
|
+
this.emit("u-hide");
|
|
133
139
|
}
|
|
134
140
|
}
|
|
135
141
|
/** 애니메이션 프레임을 사용하여 표시 상태를 스케줄링합니다. */
|
|
@@ -147,20 +153,26 @@ class FloatingElement extends BaseElement {
|
|
|
147
153
|
__decorateClass([
|
|
148
154
|
state()
|
|
149
155
|
], FloatingElement.prototype, "anchor");
|
|
156
|
+
__decorateClass([
|
|
157
|
+
property({ type: String })
|
|
158
|
+
], FloatingElement.prototype, "for");
|
|
150
159
|
__decorateClass([
|
|
151
160
|
property({ type: Boolean, reflect: true })
|
|
152
161
|
], FloatingElement.prototype, "visible");
|
|
153
162
|
__decorateClass([
|
|
154
163
|
property({ type: String, reflect: true })
|
|
155
164
|
], FloatingElement.prototype, "strategy");
|
|
156
|
-
__decorateClass([
|
|
157
|
-
property({ type: String })
|
|
158
|
-
], FloatingElement.prototype, "for");
|
|
159
165
|
__decorateClass([
|
|
160
166
|
property({ type: String })
|
|
161
167
|
], FloatingElement.prototype, "placement");
|
|
162
168
|
__decorateClass([
|
|
163
169
|
property({ type: Number })
|
|
164
170
|
], FloatingElement.prototype, "distance");
|
|
171
|
+
__decorateClass([
|
|
172
|
+
property({ type: Number })
|
|
173
|
+
], FloatingElement.prototype, "offset");
|
|
174
|
+
__decorateClass([
|
|
175
|
+
property({ type: Boolean })
|
|
176
|
+
], FloatingElement.prototype, "shift");
|
|
165
177
|
|
|
166
178
|
export { FloatingElement };
|
|
@@ -11,16 +11,17 @@ const styles = css`
|
|
|
11
11
|
opacity: 0;
|
|
12
12
|
pointer-events: none;
|
|
13
13
|
}
|
|
14
|
+
:host([visible]) {
|
|
15
|
+
opacity: 1;
|
|
16
|
+
pointer-events: auto;
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
:host([strategy="absolute"]) {
|
|
15
20
|
position: absolute;
|
|
16
21
|
}
|
|
17
22
|
:host([strategy="fixed"]) {
|
|
18
23
|
position: fixed;
|
|
19
24
|
}
|
|
20
|
-
:host([visible]) {
|
|
21
|
-
opacity: 0.8;
|
|
22
|
-
pointer-events: auto;
|
|
23
|
-
}
|
|
24
25
|
`;
|
|
25
26
|
|
|
26
27
|
export { styles };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CSSResultGroup, PropertyValues } from 'lit';
|
|
2
|
+
import { BaseElement } from './BaseElement.js';
|
|
3
|
+
/**
|
|
4
|
+
* ModalElement는 다이얼로그, 드로어 등 화면에 오버레이로 표시되는 엘리먼트를 구현하기 위한 기본 클래스입니다.
|
|
5
|
+
* 이 클래스를 상속하여 커스텀 모달 컴포넌트를 만들 수 있습니다.
|
|
6
|
+
*
|
|
7
|
+
* 1. open 속성을 통해 엘리먼트의 표시 여부를 제어할 수 있습니다.
|
|
8
|
+
* 2. modal 속성을 통해 배경 차단 및 포커스 트랩을 활성화할 수 있습니다.
|
|
9
|
+
* 3. closable 속성을 통해 이벤트에 의한 닫기 허용 여부를 설정할 수 있습니다.
|
|
10
|
+
* 4. show() 및 hide() 메서드를 통해 프로그래밍적으로 표시하거나 숨길 수 있습니다.
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class ModalElement extends BaseElement {
|
|
13
|
+
/** 기본 스타일을 정의합니다. */
|
|
14
|
+
static styles: CSSResultGroup;
|
|
15
|
+
/** 종속된 컴포넌트를 정의합니다. */
|
|
16
|
+
static dependencies: Record<string, typeof BaseElement>;
|
|
17
|
+
/**
|
|
18
|
+
* 현재 엘리먼트의 열림/닫힘 상태입니다.
|
|
19
|
+
*
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
open: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 엘리먼트의 위치 결정 전략입니다.
|
|
25
|
+
* - `absolute`: 엘리먼트가 문서 흐름에 따라 배치됩니다.
|
|
26
|
+
* - `fixed`: 엘리먼트가 뷰포트에 고정되어 스크롤과 무관하게 위치합니다.
|
|
27
|
+
*
|
|
28
|
+
* @default 'fixed'
|
|
29
|
+
*/
|
|
30
|
+
strategy: 'absolute' | 'fixed';
|
|
31
|
+
/**
|
|
32
|
+
* 모달 모드 여부, true인 경우 배경이 차단되고 포커스 트랩이 활성화됩니다.
|
|
33
|
+
* false인 경우 배경이 차단되지 않고 포커스 트랩도 비활성화됩니다.
|
|
34
|
+
*
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
modal: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 이벤트에 의한 모달 닫기 허용 여부, 예: 오버레이 클릭, ESC 키 등
|
|
40
|
+
* 닫기를 시도해야할 경우, hide() 메서드를 호출합니다.
|
|
41
|
+
*
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
closable: boolean;
|
|
45
|
+
connectedCallback(): void;
|
|
46
|
+
disconnectedCallback(): void;
|
|
47
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
48
|
+
/**
|
|
49
|
+
* 모달을 표시합니다
|
|
50
|
+
*/
|
|
51
|
+
show(): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* 모달을 숨깁니다
|
|
54
|
+
*/
|
|
55
|
+
hide(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* 모달이 차단 상태일 때 호출 됩니다
|
|
58
|
+
*/
|
|
59
|
+
protected block(): Promise<void>;
|
|
60
|
+
/** 엘리먼트의 열림/닫힘 상태를 업데이트합니다 */
|
|
61
|
+
private updateOpenState;
|
|
62
|
+
/** 모달 모드 상태를 업데이트합니다 */
|
|
63
|
+
private updateModalState;
|
|
64
|
+
/** 백드롭 클릭 핸들러 */
|
|
65
|
+
private handlePointerdown;
|
|
66
|
+
/** 키보드 이벤트 핸들러 */
|
|
67
|
+
private handleWindowKeydown;
|
|
68
|
+
/** 포커스 트랩 핸들러 */
|
|
69
|
+
private handleWindowFocusin;
|
|
70
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { property } from 'lit/decorators.js';
|
|
2
|
+
import { BaseElement } from './BaseElement.js';
|
|
3
|
+
import { styles } from './ModalElement.styles.js';
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
7
|
+
var result = void 0 ;
|
|
8
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
|
+
if (decorator = decorators[i])
|
|
10
|
+
result = (decorator(target, key, result) ) || result;
|
|
11
|
+
if (result) __defProp(target, key, result);
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
class ModalElement extends BaseElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.open = false;
|
|
18
|
+
this.strategy = "fixed";
|
|
19
|
+
this.modal = true;
|
|
20
|
+
this.closable = true;
|
|
21
|
+
/** 백드롭 클릭 핸들러 */
|
|
22
|
+
this.handlePointerdown = (e) => {
|
|
23
|
+
if (!this.modal || !this.open) return;
|
|
24
|
+
const origin = e.composedPath()[0];
|
|
25
|
+
if (origin === this) {
|
|
26
|
+
if (this.closable) {
|
|
27
|
+
this.hide();
|
|
28
|
+
} else {
|
|
29
|
+
this.block();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/** 키보드 이벤트 핸들러 */
|
|
34
|
+
this.handleWindowKeydown = (e) => {
|
|
35
|
+
if (!this.modal || !this.open) return;
|
|
36
|
+
if (e.key === "Escape" && this.open) {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
if (this.closable) {
|
|
39
|
+
this.hide();
|
|
40
|
+
} else {
|
|
41
|
+
this.block();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/** 포커스 트랩 핸들러 */
|
|
46
|
+
this.handleWindowFocusin = (e) => {
|
|
47
|
+
if (!this.modal || !this.open) return;
|
|
48
|
+
const target = e.target;
|
|
49
|
+
if (!this.contains(target)) {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
this.focus();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
static {
|
|
56
|
+
/** 기본 스타일을 정의합니다. */
|
|
57
|
+
this.styles = [super.styles, styles];
|
|
58
|
+
}
|
|
59
|
+
static {
|
|
60
|
+
/** 종속된 컴포넌트를 정의합니다. */
|
|
61
|
+
this.dependencies = {};
|
|
62
|
+
}
|
|
63
|
+
connectedCallback() {
|
|
64
|
+
super.connectedCallback();
|
|
65
|
+
this.setAttribute("tabindex", "-1");
|
|
66
|
+
this.addEventListener("pointerdown", this.handlePointerdown);
|
|
67
|
+
}
|
|
68
|
+
disconnectedCallback() {
|
|
69
|
+
window.removeEventListener("keydown", this.handleWindowKeydown);
|
|
70
|
+
window.removeEventListener("focusin", this.handleWindowFocusin);
|
|
71
|
+
super.disconnectedCallback();
|
|
72
|
+
}
|
|
73
|
+
updated(changedProperties) {
|
|
74
|
+
super.updated(changedProperties);
|
|
75
|
+
if (changedProperties.has("open")) {
|
|
76
|
+
this.toggleAttribute("aria-hidden", !this.open);
|
|
77
|
+
this.toggleAttribute("inert", !this.open);
|
|
78
|
+
this.updateOpenState(this.open);
|
|
79
|
+
}
|
|
80
|
+
if (changedProperties.has("modal")) {
|
|
81
|
+
this.updateModalState(this.modal);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 모달을 표시합니다
|
|
86
|
+
*/
|
|
87
|
+
async show() {
|
|
88
|
+
await this.updateComplete;
|
|
89
|
+
requestAnimationFrame(() => {
|
|
90
|
+
this.open = true;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 모달을 숨깁니다
|
|
95
|
+
*/
|
|
96
|
+
async hide() {
|
|
97
|
+
await this.updateComplete;
|
|
98
|
+
requestAnimationFrame(() => {
|
|
99
|
+
this.open = false;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* 모달이 차단 상태일 때 호출 됩니다
|
|
104
|
+
*/
|
|
105
|
+
async block() {
|
|
106
|
+
await this.updateComplete;
|
|
107
|
+
}
|
|
108
|
+
/** 엘리먼트의 열림/닫힘 상태를 업데이트합니다 */
|
|
109
|
+
updateOpenState(open) {
|
|
110
|
+
if (open) {
|
|
111
|
+
this.emit("u-show");
|
|
112
|
+
document.body.style.overflow = this.modal ? "hidden" : "";
|
|
113
|
+
} else {
|
|
114
|
+
this.emit("u-hide");
|
|
115
|
+
document.body.style.overflow = "";
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/** 모달 모드 상태를 업데이트합니다 */
|
|
119
|
+
updateModalState(modal) {
|
|
120
|
+
if (modal) {
|
|
121
|
+
window.addEventListener("keydown", this.handleWindowKeydown);
|
|
122
|
+
window.addEventListener("focusin", this.handleWindowFocusin);
|
|
123
|
+
document.body.style.overflow = this.open ? "hidden" : "";
|
|
124
|
+
} else {
|
|
125
|
+
window.removeEventListener("keydown", this.handleWindowKeydown);
|
|
126
|
+
window.removeEventListener("focusin", this.handleWindowFocusin);
|
|
127
|
+
document.body.style.overflow = "";
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
__decorateClass([
|
|
132
|
+
property({ type: Boolean, reflect: true })
|
|
133
|
+
], ModalElement.prototype, "open");
|
|
134
|
+
__decorateClass([
|
|
135
|
+
property({ type: String, reflect: true })
|
|
136
|
+
], ModalElement.prototype, "strategy");
|
|
137
|
+
__decorateClass([
|
|
138
|
+
property({ type: Boolean, reflect: true })
|
|
139
|
+
], ModalElement.prototype, "modal");
|
|
140
|
+
__decorateClass([
|
|
141
|
+
property({ type: Boolean, reflect: true })
|
|
142
|
+
], ModalElement.prototype, "closable");
|
|
143
|
+
|
|
144
|
+
export { ModalElement };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
|
|
3
|
+
const styles = css`
|
|
4
|
+
:host {
|
|
5
|
+
position: fixed;
|
|
6
|
+
z-index: 9999;
|
|
7
|
+
top: 0;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
right: 0;
|
|
11
|
+
opacity: 0;
|
|
12
|
+
background: transparent;
|
|
13
|
+
transition: opacity 0.3s, background 0.3s ease;
|
|
14
|
+
}
|
|
15
|
+
:host([open]) {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
}
|
|
18
|
+
:host([modal]) {
|
|
19
|
+
background: var(--u-overlay-bg-color);
|
|
20
|
+
}
|
|
21
|
+
:host([strategy="fixed"]) {
|
|
22
|
+
position: fixed;
|
|
23
|
+
}
|
|
24
|
+
:host([strategy="absolute"]) {
|
|
25
|
+
position: absolute;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export { styles };
|
|
@@ -5,7 +5,7 @@ export type AlertType = "error" | "warning" | "info" | "success" | "notice";
|
|
|
5
5
|
* 사용자에게 메시지를 표시하는 Alert 컴포넌트입니다.
|
|
6
6
|
* 자동 닫힘 타이머, 접기/펼치기 기능 등을 제공합니다.
|
|
7
7
|
*/
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class UAlert extends BaseElement {
|
|
9
9
|
static styles: import('lit').CSSResultGroup[];
|
|
10
10
|
static dependencies: Record<string, typeof BaseElement>;
|
|
11
11
|
private timeoutId?;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
import { BaseElement } from '../BaseElement.js';
|
|
4
|
-
import {
|
|
5
|
-
import { styles } from './
|
|
4
|
+
import { UIcon } from '../icon/UIcon.component.js';
|
|
5
|
+
import { styles } from './UAlert.styles.js';
|
|
6
6
|
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
7
7
|
|
|
8
8
|
var __defProp = Object.defineProperty;
|
|
@@ -14,7 +14,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
14
14
|
if (result) __defProp(target, key, result);
|
|
15
15
|
return result;
|
|
16
16
|
};
|
|
17
|
-
class
|
|
17
|
+
class UAlert extends BaseElement {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments);
|
|
20
20
|
this.open = false;
|
|
@@ -28,39 +28,41 @@ class Alert extends BaseElement {
|
|
|
28
28
|
}
|
|
29
29
|
static {
|
|
30
30
|
this.dependencies = {
|
|
31
|
-
"u-icon":
|
|
31
|
+
"u-icon": UIcon
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
updated(changedProperties) {
|
|
35
35
|
super.updated(changedProperties);
|
|
36
|
+
if (changedProperties.has("open")) {
|
|
37
|
+
this.toggleAttribute("aria-hidden", !this.open);
|
|
38
|
+
this.toggleAttribute("inert", !this.open);
|
|
39
|
+
this.updateOpenState(this.open);
|
|
40
|
+
}
|
|
36
41
|
if (changedProperties.has("minRows") && this.minRows < this.maxRows && this.minRows > 0) {
|
|
37
42
|
this.style.setProperty("--min-content-rows", `${this.minRows}`);
|
|
38
43
|
}
|
|
39
44
|
if (changedProperties.has("maxRows") && this.maxRows > this.minRows && this.maxRows > 0) {
|
|
40
45
|
this.style.setProperty("--max-content-rows", `${this.maxRows}`);
|
|
41
46
|
}
|
|
42
|
-
if (changedProperties.has("open")) {
|
|
43
|
-
this.updateOpenState(this.open);
|
|
44
|
-
}
|
|
45
47
|
}
|
|
46
48
|
render() {
|
|
47
49
|
return html`
|
|
48
50
|
<div class="container" part="base">
|
|
49
51
|
<div class="header" part="header">
|
|
50
52
|
<u-icon class="icon" part="icon"
|
|
51
|
-
.
|
|
53
|
+
.lib=${"internal"}
|
|
52
54
|
.name=${this.getIconName(this.type)}
|
|
53
55
|
></u-icon>
|
|
54
56
|
<div class="title" part="title">
|
|
55
57
|
${this.heading || this.type.toUpperCase()}
|
|
56
58
|
</div>
|
|
57
59
|
<u-icon class="close-btn" part="close-btn"
|
|
58
|
-
.
|
|
60
|
+
.lib=${"internal"}
|
|
59
61
|
.name=${"x-lg"}
|
|
60
62
|
@click=${this.hide}
|
|
61
63
|
></u-icon>
|
|
62
64
|
</div>
|
|
63
|
-
<div class="content
|
|
65
|
+
<div class="content" part="content" scrollable>
|
|
64
66
|
${this.content ? unsafeHTML(this.content) : html`<slot></slot>`}
|
|
65
67
|
</div>
|
|
66
68
|
<div class="footer" part="footer">
|
|
@@ -121,24 +123,24 @@ class Alert extends BaseElement {
|
|
|
121
123
|
}
|
|
122
124
|
__decorateClass([
|
|
123
125
|
property({ type: Boolean, reflect: true })
|
|
124
|
-
],
|
|
126
|
+
], UAlert.prototype, "open");
|
|
125
127
|
__decorateClass([
|
|
126
128
|
property({ type: String, reflect: true })
|
|
127
|
-
],
|
|
129
|
+
], UAlert.prototype, "type");
|
|
128
130
|
__decorateClass([
|
|
129
131
|
property({ type: String })
|
|
130
|
-
],
|
|
132
|
+
], UAlert.prototype, "heading");
|
|
131
133
|
__decorateClass([
|
|
132
134
|
property({ type: String })
|
|
133
|
-
],
|
|
135
|
+
], UAlert.prototype, "content");
|
|
134
136
|
__decorateClass([
|
|
135
137
|
property({ type: Number })
|
|
136
|
-
],
|
|
138
|
+
], UAlert.prototype, "minRows");
|
|
137
139
|
__decorateClass([
|
|
138
140
|
property({ type: Number })
|
|
139
|
-
],
|
|
141
|
+
], UAlert.prototype, "maxRows");
|
|
140
142
|
__decorateClass([
|
|
141
143
|
property({ type: Number })
|
|
142
|
-
],
|
|
144
|
+
], UAlert.prototype, "duration");
|
|
143
145
|
|
|
144
|
-
export {
|
|
146
|
+
export { UAlert };
|
|
@@ -17,13 +17,11 @@ const styles = css`
|
|
|
17
17
|
|
|
18
18
|
opacity: 0;
|
|
19
19
|
transform: scale(0.8);
|
|
20
|
-
transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
21
|
-
pointer-events: none;
|
|
20
|
+
transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
22
21
|
}
|
|
23
22
|
:host([open]) {
|
|
24
23
|
opacity: 1;
|
|
25
24
|
transform: scale(1);
|
|
26
|
-
pointer-events: auto;
|
|
27
25
|
}
|
|
28
26
|
:host([type="error"]) {
|
|
29
27
|
--icon-primary-color: var(--u-red-700);
|
|
@@ -5,7 +5,7 @@ import { BaseElement } from '../BaseElement.js';
|
|
|
5
5
|
* @slot prefix - 버튼의 접두사로 표시할 콘텐츠를 삽입합니다.
|
|
6
6
|
* @slot suffix - 버튼의 접미사로 표시할 콘텐츠를 삽입합니다.
|
|
7
7
|
*/
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class UButton extends BaseElement {
|
|
9
9
|
static styles: import('lit').CSSResultGroup[];
|
|
10
10
|
static dependencies: Record<string, typeof BaseElement>;
|
|
11
11
|
/** 버튼이 비활성화 상태인지 여부를 설정합니다. 비활성화된 버튼은 클릭할 수 없습니다. */
|