@iyulab/components 0.4.0 → 1.0.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 +59 -0
- package/README.md +42 -236
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js +6 -0
- package/dist/_virtual/_glob-assets_raw/bell-fill.svg.d37c41d9.js +4 -0
- package/dist/_virtual/_glob-assets_raw/check-circle-fill.svg.51c33a2a.js +4 -0
- package/dist/_virtual/_glob-assets_raw/check-lg.svg.371c5e78.js +4 -0
- package/dist/_virtual/_glob-assets_raw/chevron-down.svg.0ccd06ea.js +4 -0
- package/dist/_virtual/_glob-assets_raw/chevron-left.svg.b4601050.js +4 -0
- package/dist/_virtual/_glob-assets_raw/chevron-right.svg.0711bb67.js +4 -0
- package/dist/_virtual/_glob-assets_raw/chevron-up.svg.ed917211.js +4 -0
- package/dist/_virtual/_glob-assets_raw/dark.css.e8ac080d.js +4 -0
- package/dist/_virtual/_glob-assets_raw/dash-lg.svg.b40b8b3a.js +4 -0
- package/dist/_virtual/_glob-assets_raw/exclamation-circle-fill.svg.dc8c523e.js +4 -0
- package/dist/_virtual/_glob-assets_raw/exclamation-triangle-fill.svg.7949d2c7.js +4 -0
- package/dist/_virtual/_glob-assets_raw/eye-slash.svg.240afafa.js +4 -0
- package/dist/_virtual/_glob-assets_raw/eye.svg.2e5e9c4c.js +4 -0
- package/dist/_virtual/_glob-assets_raw/info-circle-fill.svg.6580071d.js +4 -0
- package/dist/_virtual/_glob-assets_raw/light.css.637cb2f8.js +4 -0
- package/dist/_virtual/_glob-assets_raw/plus-lg.svg.294e9073.js +4 -0
- package/dist/_virtual/_glob-assets_raw/search.svg.0ba2012d.js +4 -0
- package/dist/_virtual/_glob-assets_raw/star-fill.svg.f24b5a2d.js +4 -0
- package/dist/_virtual/_glob-assets_raw/star.svg.4af61468.js +4 -0
- package/dist/_virtual/_glob-assets_raw/three-dots-vertical.svg.9fee78c5.js +4 -0
- package/dist/_virtual/_glob-assets_raw/three-dots.svg.6a7a5b23.js +4 -0
- package/dist/_virtual/_glob-assets_raw/x-lg.svg.f34b882c.js +4 -0
- package/dist/components/{UJsonElement.d.ts → UDataElement.d.ts} +3 -5
- package/dist/components/UDataElement.js +101 -0
- package/dist/components/{UJsonElement.styles.js → UDataElement.styles.js} +4 -4
- package/dist/components/UElement.d.ts +18 -23
- package/dist/components/UElement.js +82 -95
- package/dist/components/UElement.styles.js +43 -4
- package/dist/components/UFloatingElement.d.ts +69 -48
- package/dist/components/UFloatingElement.js +236 -193
- package/dist/components/UFloatingElement.styles.d.ts +8 -0
- package/dist/components/UFloatingElement.styles.js +28 -5
- package/dist/components/UFormControlElement.d.ts +57 -0
- package/dist/components/UFormControlElement.js +68 -0
- package/dist/components/UFormControlElement.styles.js +14 -0
- package/dist/components/UOverlayElement.d.ts +66 -0
- package/dist/components/UOverlayElement.js +123 -0
- package/dist/components/UOverlayElement.styles.d.ts +1 -0
- package/dist/components/UOverlayElement.styles.js +35 -0
- package/dist/components/alert/UAlert.d.ts +58 -3
- package/dist/components/alert/UAlert.js +115 -4
- package/dist/components/alert/UAlert.styles.js +73 -48
- package/dist/components/avatar/UAvatar.d.ts +27 -0
- package/dist/components/avatar/UAvatar.js +42 -0
- package/dist/components/avatar/UAvatar.styles.d.ts +1 -0
- package/dist/components/avatar/UAvatar.styles.js +45 -0
- package/dist/components/badge/UBadge.d.ts +28 -0
- package/dist/components/badge/UBadge.js +40 -0
- package/dist/components/badge/UBadge.styles.d.ts +1 -0
- package/dist/components/badge/UBadge.styles.js +113 -0
- package/dist/components/breadcrumb/UBreadcrumb.d.ts +24 -0
- package/dist/components/breadcrumb/UBreadcrumb.js +65 -0
- package/dist/components/breadcrumb/UBreadcrumb.styles.d.ts +1 -0
- package/dist/components/breadcrumb/UBreadcrumb.styles.js +37 -0
- package/dist/components/breadcrumb-item/UBreadcrumbItem.d.ts +30 -0
- package/dist/components/breadcrumb-item/UBreadcrumbItem.js +52 -0
- package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.d.ts +1 -0
- package/dist/components/breadcrumb-item/UBreadcrumbItem.styles.js +41 -0
- package/dist/components/button/UButton.d.ts +46 -3
- package/dist/components/button/UButton.js +104 -4
- package/dist/components/button/UButton.styles.js +121 -48
- package/dist/components/button-group/UButtonGroup.d.ts +28 -0
- package/dist/components/button-group/UButtonGroup.js +93 -0
- package/dist/components/button-group/UButtonGroup.styles.d.ts +1 -0
- package/dist/components/button-group/UButtonGroup.styles.js +34 -0
- package/dist/components/card/UCard.d.ts +30 -3
- package/dist/components/card/UCard.js +61 -4
- package/dist/components/card/UCard.styles.js +13 -12
- package/dist/components/carousel/UCarousel.d.ts +65 -3
- package/dist/components/carousel/UCarousel.js +219 -2
- package/dist/components/carousel/UCarousel.styles.js +17 -17
- package/dist/components/checkbox/UCheckbox.d.ts +39 -0
- package/dist/components/checkbox/UCheckbox.js +88 -0
- package/dist/components/checkbox/UCheckbox.styles.d.ts +1 -0
- package/dist/components/checkbox/UCheckbox.styles.js +211 -0
- package/dist/components/chip/UChip.d.ts +43 -0
- package/dist/components/chip/UChip.js +103 -0
- package/dist/components/chip/UChip.styles.d.ts +1 -0
- package/dist/components/chip/UChip.styles.js +31 -0
- package/dist/components/dialog/UDialog.d.ts +29 -2
- package/dist/components/dialog/UDialog.js +66 -4
- package/dist/components/dialog/UDialog.styles.js +90 -39
- package/dist/components/divider/UDivider.d.ts +27 -2
- package/dist/components/divider/UDivider.js +45 -4
- package/dist/components/divider/UDivider.styles.js +80 -10
- package/dist/components/drawer/UDrawer.d.ts +25 -3
- package/dist/components/drawer/UDrawer.js +54 -4
- package/dist/components/drawer/UDrawer.styles.js +67 -60
- package/dist/components/field/UField.d.ts +31 -0
- package/dist/components/field/UField.js +64 -0
- package/dist/components/field/UField.styles.d.ts +1 -0
- package/dist/components/field/UField.styles.js +47 -0
- package/dist/components/form/UForm.d.ts +38 -2
- package/dist/components/form/UForm.js +105 -4
- package/dist/components/form/UForm.styles.js +5 -5
- package/dist/components/icon/UIcon.d.ts +23 -4
- package/dist/components/icon/UIcon.js +56 -4
- package/dist/components/icon/UIcon.styles.js +5 -6
- package/dist/components/icon-button/UIconButton.d.ts +48 -0
- package/dist/components/icon-button/UIconButton.js +88 -0
- package/dist/components/icon-button/UIconButton.styles.d.ts +1 -0
- package/dist/components/icon-button/UIconButton.styles.js +24 -0
- package/dist/components/input/UInput.d.ts +95 -3
- package/dist/components/input/UInput.js +258 -2
- package/dist/components/input/UInput.styles.js +120 -86
- package/dist/components/menu/UMenu.d.ts +41 -3
- package/dist/components/menu/UMenu.js +178 -4
- package/dist/components/menu/UMenu.styles.js +16 -30
- package/dist/components/menu-item/UMenuItem.d.ts +48 -2
- package/dist/components/menu-item/UMenuItem.js +159 -2
- package/dist/components/menu-item/UMenuItem.styles.js +120 -34
- package/dist/components/option/UOption.d.ts +42 -0
- package/dist/components/option/UOption.js +64 -0
- package/dist/components/option/UOption.styles.d.ts +1 -0
- package/dist/components/option/UOption.styles.js +132 -0
- package/dist/components/panel/UPanel.d.ts +22 -0
- package/dist/components/panel/UPanel.js +36 -0
- package/dist/components/panel/UPanel.styles.d.ts +1 -0
- package/dist/components/panel/UPanel.styles.js +14 -0
- package/dist/components/popover/UPopover.d.ts +69 -0
- package/dist/components/popover/UPopover.js +235 -0
- package/dist/components/popover/UPopover.styles.d.ts +1 -0
- package/dist/components/popover/UPopover.styles.js +9 -0
- package/dist/components/progress-bar/UProgressBar.d.ts +46 -2
- package/dist/components/progress-bar/UProgressBar.js +94 -2
- package/dist/components/progress-bar/UProgressBar.styles.js +110 -36
- package/dist/components/progress-ring/UProgressRing.d.ts +46 -3
- package/dist/components/progress-ring/UProgressRing.js +152 -2
- package/dist/components/progress-ring/UProgressRing.styles.js +88 -25
- package/dist/components/radio/URadio.d.ts +41 -0
- package/dist/components/radio/URadio.js +152 -0
- package/dist/components/radio/URadio.styles.d.ts +1 -0
- package/dist/components/radio/URadio.styles.js +111 -0
- package/dist/components/rating/URating.d.ts +48 -0
- package/dist/components/rating/URating.js +196 -0
- package/dist/components/rating/URating.styles.d.ts +1 -0
- package/dist/components/rating/URating.styles.js +55 -0
- package/dist/components/select/USelect.d.ts +70 -0
- package/dist/components/select/USelect.js +316 -0
- package/dist/components/select/USelect.styles.d.ts +1 -0
- package/dist/components/select/USelect.styles.js +200 -0
- package/dist/components/skeleton/USkeleton.d.ts +27 -3
- package/dist/components/skeleton/USkeleton.js +37 -4
- package/dist/components/skeleton/USkeleton.styles.js +15 -18
- package/dist/components/slider/USlider.d.ts +88 -0
- package/dist/components/slider/USlider.js +286 -0
- package/dist/components/slider/USlider.styles.d.ts +1 -0
- package/dist/components/slider/USlider.styles.js +125 -0
- package/dist/components/spinner/USpinner.d.ts +23 -2
- package/dist/components/spinner/USpinner.js +37 -3
- package/dist/components/spinner/USpinner.styles.js +34 -13
- package/dist/components/split-panel/USplitPanel.d.ts +49 -2
- package/dist/components/split-panel/USplitPanel.js +239 -3
- package/dist/components/split-panel/USplitPanel.styles.js +47 -15
- package/dist/components/switch/USwitch.d.ts +43 -0
- package/dist/components/switch/USwitch.js +80 -0
- package/dist/components/switch/USwitch.styles.d.ts +1 -0
- package/dist/components/switch/USwitch.styles.js +191 -0
- package/dist/components/tab/UTab.d.ts +31 -0
- package/dist/components/tab/UTab.js +68 -0
- package/dist/components/tab/UTab.styles.d.ts +1 -0
- package/dist/components/tab/UTab.styles.js +46 -0
- package/dist/components/tab-panel/UTabPanel.d.ts +45 -0
- package/dist/components/tab-panel/UTabPanel.js +150 -0
- package/dist/components/tab-panel/UTabPanel.styles.d.ts +1 -0
- package/dist/components/tab-panel/UTabPanel.styles.js +201 -0
- package/dist/components/tag/UTag.d.ts +26 -3
- package/dist/components/tag/UTag.js +41 -4
- package/dist/components/tag/UTag.styles.js +206 -60
- package/dist/components/textarea/UTextarea.d.ts +65 -0
- package/dist/components/textarea/UTextarea.js +148 -0
- package/dist/components/textarea/UTextarea.styles.d.ts +1 -0
- package/dist/components/textarea/UTextarea.styles.js +164 -0
- package/dist/components/tooltip/UTooltip.d.ts +28 -2
- package/dist/components/tooltip/UTooltip.js +104 -4
- package/dist/components/tooltip/UTooltip.styles.js +10 -12
- package/dist/components/tree/UTree.d.ts +62 -2
- package/dist/components/tree/UTree.js +308 -3
- package/dist/components/tree/UTree.styles.js +13 -19
- package/dist/components/tree-item/UTreeItem.d.ts +61 -2
- package/dist/components/tree-item/UTreeItem.js +191 -2
- package/dist/components/tree-item/UTreeItem.styles.js +96 -37
- package/dist/events/CheckEvent.d.ts +7 -0
- package/dist/events/CollapseEvent.d.ts +7 -0
- package/dist/events/ExpandEvent.d.ts +7 -0
- package/dist/events/HideEvent.d.ts +7 -0
- package/dist/events/NavigateEvent.d.ts +7 -0
- package/dist/events/PickEvent.d.ts +18 -0
- package/dist/events/RemoveEvent.d.ts +7 -0
- package/dist/events/ShiftEvent.d.ts +16 -0
- package/dist/events/ShowEvent.d.ts +7 -0
- package/dist/index.d.ts +37 -10
- package/dist/index.js +56 -52
- package/dist/react/UAlert.d.ts +13 -0
- package/dist/{react-components → react}/UAlert.js +5 -2
- package/dist/react/UAvatar.d.ts +9 -0
- package/dist/react/UAvatar.js +10 -0
- package/dist/react/UBadge.d.ts +9 -0
- package/dist/react/UBadge.js +10 -0
- package/dist/react/UBreadcrumb.d.ts +9 -0
- package/dist/react/UBreadcrumb.js +10 -0
- package/dist/react/UBreadcrumbItem.d.ts +11 -0
- package/dist/react/UBreadcrumbItem.js +12 -0
- package/dist/{react-components → react}/UButton.d.ts +3 -2
- package/dist/{react-components → react}/UButton.js +2 -2
- package/dist/react/UButtonGroup.d.ts +9 -0
- package/dist/react/UButtonGroup.js +10 -0
- package/dist/{react-components → react}/UCard.d.ts +3 -2
- package/dist/{react-components → react}/UCard.js +2 -2
- package/dist/{react-components → react}/UCarousel.d.ts +3 -2
- package/dist/{react-components → react}/UCarousel.js +2 -2
- package/dist/react/UCheckbox.d.ts +9 -0
- package/dist/react/UCheckbox.js +10 -0
- package/dist/react/UChip.d.ts +13 -0
- package/dist/react/UChip.js +13 -0
- package/dist/{react-components → react}/UDialog.d.ts +3 -2
- package/dist/{react-components → react}/UDialog.js +2 -2
- package/dist/{react-components → react}/UDivider.d.ts +3 -2
- package/dist/{react-components → react}/UDivider.js +2 -2
- package/dist/{react-components → react}/UDrawer.d.ts +3 -2
- package/dist/{react-components → react}/UDrawer.js +2 -2
- package/dist/react/UField.d.ts +9 -0
- package/dist/react/UField.js +10 -0
- package/dist/react/UForm.d.ts +10 -0
- package/dist/{react-components → react}/UForm.js +4 -2
- package/dist/{react-components → react}/UIcon.d.ts +3 -2
- package/dist/{react-components → react}/UIcon.js +2 -2
- package/dist/react/UIconButton.d.ts +9 -0
- package/dist/react/UIconButton.js +10 -0
- package/dist/react/UInput.d.ts +11 -0
- package/dist/{react-components → react}/UInput.js +5 -2
- package/dist/react/UMenu.d.ts +10 -0
- package/dist/{react-components → react}/UMenu.js +4 -2
- package/dist/react/UMenuItem.d.ts +11 -0
- package/dist/{react-components → react}/UMenuItem.js +4 -2
- package/dist/react/UOption.d.ts +9 -0
- package/dist/react/UOption.js +10 -0
- package/dist/react/UPanel.d.ts +9 -0
- package/dist/react/UPanel.js +10 -0
- package/dist/react/UPopover.d.ts +11 -0
- package/dist/react/UPopover.js +13 -0
- package/dist/react/UProgressBar.d.ts +9 -0
- package/dist/{react-components → react}/UProgressBar.js +2 -2
- package/dist/react/UProgressRing.d.ts +9 -0
- package/dist/{react-components → react}/UProgressRing.js +2 -2
- package/dist/react/URadio.d.ts +10 -0
- package/dist/react/URadio.js +12 -0
- package/dist/react/URating.d.ts +10 -0
- package/dist/react/URating.js +12 -0
- package/dist/react/USelect.d.ts +10 -0
- package/dist/react/USelect.js +12 -0
- package/dist/{react-components → react}/USkeleton.d.ts +3 -2
- package/dist/{react-components → react}/USkeleton.js +2 -2
- package/dist/react/USlider.d.ts +10 -0
- package/dist/react/USlider.js +12 -0
- package/dist/{react-components → react}/USpinner.d.ts +3 -2
- package/dist/{react-components → react}/USpinner.js +2 -2
- package/dist/react/USplitPanel.d.ts +13 -0
- package/dist/{react-components → react}/USplitPanel.js +6 -2
- package/dist/react/USwitch.d.ts +10 -0
- package/dist/react/USwitch.js +12 -0
- package/dist/react/UTab.d.ts +11 -0
- package/dist/react/UTab.js +12 -0
- package/dist/react/UTabPanel.d.ts +9 -0
- package/dist/react/UTabPanel.js +10 -0
- package/dist/{react-components → react}/UTag.d.ts +3 -2
- package/dist/{react-components → react}/UTag.js +2 -2
- package/dist/react/UTextarea.d.ts +11 -0
- package/dist/react/UTextarea.js +13 -0
- package/dist/react/UTooltip.d.ts +11 -0
- package/dist/{react-components → react}/UTooltip.js +5 -2
- package/dist/react/UTree.d.ts +10 -0
- package/dist/{react-components → react}/UTree.js +4 -2
- package/dist/react/UTreeItem.d.ts +17 -0
- package/dist/{react-components → react}/UTreeItem.js +7 -2
- package/dist/{react-components → react}/index.d.ts +40 -27
- package/dist/{react-components → react}/index.js +40 -20
- package/dist/{assets/styles → styles}/dark.css +68 -3
- package/dist/{assets/styles → styles}/light.css +68 -3
- package/dist/utilities/BrowserStorage.d.ts +2 -1
- package/dist/utilities/BrowserStorage.js +69 -86
- package/dist/utilities/Dialog.d.ts +83 -0
- package/dist/utilities/Dialog.js +141 -0
- package/dist/utilities/OverlayManager.d.ts +37 -0
- package/dist/utilities/OverlayManager.js +68 -0
- package/dist/utilities/Theme.js +134 -141
- package/dist/utilities/Toast.d.ts +45 -0
- package/dist/utilities/Toast.js +114 -0
- package/dist/utilities/converters.d.ts +44 -1
- package/dist/utilities/converters.js +112 -14
- package/dist/utilities/elements.js +62 -33
- package/dist/utilities/icons.d.ts +67 -0
- package/dist/utilities/icons.js +200 -0
- package/dist/utilities/sanitizers.js +64 -32
- package/package.json +26 -19
- package/plugins/vite-plugin-glob-resolve.d.ts +12 -0
- package/plugins/vite-plugin-glob-resolve.js +66 -0
- package/plugins/vite-plugin-react-wrapper.d.ts +12 -0
- package/plugins/vite-plugin-react-wrapper.js +206 -0
- package/skills/iyulab-components/SKILL.md +138 -0
- package/skills/iyulab-components/references/components/alert.md +74 -0
- package/skills/iyulab-components/references/components/avatar.md +41 -0
- package/skills/iyulab-components/references/components/badge.md +38 -0
- package/skills/iyulab-components/references/components/breadcrumb.md +75 -0
- package/skills/iyulab-components/references/components/button-group.md +38 -0
- package/skills/iyulab-components/references/components/button.md +56 -0
- package/skills/iyulab-components/references/components/card.md +53 -0
- package/skills/iyulab-components/references/components/carousel.md +63 -0
- package/skills/iyulab-components/references/components/checkbox.md +70 -0
- package/skills/iyulab-components/references/components/chip.md +64 -0
- package/skills/iyulab-components/references/components/dialog.md +71 -0
- package/skills/iyulab-components/references/components/divider.md +56 -0
- package/skills/iyulab-components/references/components/drawer.md +63 -0
- package/skills/iyulab-components/references/components/field.md +42 -0
- package/skills/iyulab-components/references/components/form.md +68 -0
- package/skills/iyulab-components/references/components/icon-button.md +56 -0
- package/skills/iyulab-components/references/components/icon.md +49 -0
- package/skills/iyulab-components/references/components/input.md +95 -0
- package/skills/iyulab-components/references/components/menu.md +106 -0
- package/skills/iyulab-components/references/components/option.md +70 -0
- package/skills/iyulab-components/references/components/panel.md +38 -0
- package/skills/iyulab-components/references/components/popover.md +62 -0
- package/skills/iyulab-components/references/components/progress-bar.md +61 -0
- package/skills/iyulab-components/references/components/progress-ring.md +58 -0
- package/skills/iyulab-components/references/components/radio.md +67 -0
- package/skills/iyulab-components/references/components/rating.md +74 -0
- package/skills/iyulab-components/references/components/select.md +86 -0
- package/skills/iyulab-components/references/components/skeleton.md +46 -0
- package/skills/iyulab-components/references/components/slider.md +89 -0
- package/skills/iyulab-components/references/components/spinner.md +47 -0
- package/skills/iyulab-components/references/components/split-panel.md +65 -0
- package/skills/iyulab-components/references/components/switch.md +81 -0
- package/skills/iyulab-components/references/components/tab-panel.md +93 -0
- package/skills/iyulab-components/references/components/tag.md +55 -0
- package/skills/iyulab-components/references/components/textarea.md +67 -0
- package/skills/iyulab-components/references/components/tooltip.md +58 -0
- package/skills/iyulab-components/references/components/tree.md +128 -0
- package/skills/iyulab-components/references/extensions/data.md +60 -0
- package/skills/iyulab-components/references/extensions/element.md +57 -0
- package/skills/iyulab-components/references/extensions/floating.md +60 -0
- package/skills/iyulab-components/references/extensions/form-control.md +79 -0
- package/skills/iyulab-components/references/extensions/overlay.md +76 -0
- package/skills/iyulab-components/references/usage.md +216 -0
- package/skills/iyulab-components/references/utilities/browser-storage.md +54 -0
- package/skills/iyulab-components/references/utilities/converters.md +42 -0
- package/skills/iyulab-components/references/utilities/dialog.md +75 -0
- package/skills/iyulab-components/references/utilities/elements.md +55 -0
- package/skills/iyulab-components/references/utilities/icons.md +53 -0
- package/skills/iyulab-components/references/utilities/overlay-manager.md +34 -0
- package/skills/iyulab-components/references/utilities/sanitizers.md +32 -0
- package/skills/iyulab-components/references/utilities/theme.md +45 -0
- package/skills/iyulab-components/references/utilities/toast.md +58 -0
- package/dist/assets/icons/arrow-down-up.svg.js +0 -3
- package/dist/assets/icons/arrow-down.svg.js +0 -3
- package/dist/assets/icons/arrow-repeat.svg.js +0 -3
- package/dist/assets/icons/arrow-up.svg.js +0 -3
- package/dist/assets/icons/ban.svg.js +0 -3
- package/dist/assets/icons/bell-fill.svg.js +0 -3
- package/dist/assets/icons/box-arrow-up-right.svg.js +0 -3
- package/dist/assets/icons/check-circle-fill.svg.js +0 -3
- package/dist/assets/icons/check-lg.svg.js +0 -3
- package/dist/assets/icons/chevron-down.svg.js +0 -3
- package/dist/assets/icons/chevron-left.svg.js +0 -3
- package/dist/assets/icons/chevron-right.svg.js +0 -3
- package/dist/assets/icons/chevron-up.svg.js +0 -3
- package/dist/assets/icons/code-slash.svg.js +0 -3
- package/dist/assets/icons/copy.svg.js +0 -3
- package/dist/assets/icons/dash-lg.svg.js +0 -3
- package/dist/assets/icons/download.svg.js +0 -3
- package/dist/assets/icons/exclamation-circle-fill.svg.js +0 -3
- package/dist/assets/icons/exclamation-triangle-fill.svg.js +0 -3
- package/dist/assets/icons/eye-slash.svg.js +0 -3
- package/dist/assets/icons/eye.svg.js +0 -3
- package/dist/assets/icons/file-earmark.svg.js +0 -3
- package/dist/assets/icons/flag.svg.js +0 -3
- package/dist/assets/icons/globe.svg.js +0 -3
- package/dist/assets/icons/hand-thumbs-down-fill.svg.js +0 -3
- package/dist/assets/icons/hand-thumbs-down.svg.js +0 -3
- package/dist/assets/icons/hand-thumbs-up-fill.svg.js +0 -3
- package/dist/assets/icons/hand-thumbs-up.svg.js +0 -3
- package/dist/assets/icons/info-circle-fill.svg.js +0 -3
- package/dist/assets/icons/lightbulb-fill.svg.js +0 -3
- package/dist/assets/icons/lightbulb-off.svg.js +0 -3
- package/dist/assets/icons/lightbulb.svg.js +0 -3
- package/dist/assets/icons/mic-fill.svg.js +0 -3
- package/dist/assets/icons/mic-mute-fill.svg.js +0 -3
- package/dist/assets/icons/paperclip.svg.js +0 -3
- package/dist/assets/icons/pencil-square.svg.js +0 -3
- package/dist/assets/icons/plus-lg.svg.js +0 -3
- package/dist/assets/icons/search.svg.js +0 -3
- package/dist/assets/icons/share.svg.js +0 -3
- package/dist/assets/icons/sort-alpha-down.svg.js +0 -3
- package/dist/assets/icons/sort-alpha-up.svg.js +0 -3
- package/dist/assets/icons/stop-circle.svg.js +0 -3
- package/dist/assets/icons/tools.svg.js +0 -3
- package/dist/assets/icons/x-lg.svg.js +0 -3
- package/dist/assets/styles/dark.css.js +0 -3
- package/dist/assets/styles/light.css.js +0 -3
- package/dist/components/UJsonElement.js +0 -93
- package/dist/components/UModalElement.d.ts +0 -70
- package/dist/components/UModalElement.js +0 -144
- package/dist/components/UModalElement.styles.js +0 -29
- package/dist/components/alert/UAlert.component.d.ts +0 -40
- package/dist/components/alert/UAlert.component.js +0 -146
- package/dist/components/button/UButton.component.d.ts +0 -23
- package/dist/components/button/UButton.component.js +0 -72
- package/dist/components/card/UCard.component.d.ts +0 -21
- package/dist/components/card/UCard.component.js +0 -66
- package/dist/components/carousel/UCarousel.component.d.ts +0 -78
- package/dist/components/carousel/UCarousel.component.js +0 -264
- package/dist/components/dialog/UDialog.component.d.ts +0 -17
- package/dist/components/dialog/UDialog.component.js +0 -70
- package/dist/components/divider/UDivider.component.d.ts +0 -10
- package/dist/components/divider/UDivider.component.js +0 -30
- package/dist/components/drawer/UDrawer.component.d.ts +0 -18
- package/dist/components/drawer/UDrawer.component.js +0 -64
- package/dist/components/form/UForm.component.d.ts +0 -24
- package/dist/components/form/UForm.component.js +0 -76
- package/dist/components/icon/UIcon.component.d.ts +0 -29
- package/dist/components/icon/UIcon.component.js +0 -57
- package/dist/components/input/UInput.component.d.ts +0 -92
- package/dist/components/input/UInput.component.js +0 -267
- package/dist/components/menu/UMenu.component.d.ts +0 -67
- package/dist/components/menu/UMenu.component.js +0 -338
- package/dist/components/menu-item/UMenuItem.component.d.ts +0 -25
- package/dist/components/menu-item/UMenuItem.component.js +0 -111
- package/dist/components/progress-bar/UProgressBar.component.d.ts +0 -27
- package/dist/components/progress-bar/UProgressBar.component.js +0 -99
- package/dist/components/progress-ring/UProgressRing.component.d.ts +0 -33
- package/dist/components/progress-ring/UProgressRing.component.js +0 -114
- package/dist/components/skeleton/USkeleton.component.d.ts +0 -22
- package/dist/components/skeleton/USkeleton.component.js +0 -58
- package/dist/components/spinner/USpinner.component.d.ts +0 -9
- package/dist/components/spinner/USpinner.component.js +0 -22
- package/dist/components/split-panel/USplitPanel.component.d.ts +0 -44
- package/dist/components/split-panel/USplitPanel.component.js +0 -185
- package/dist/components/tag/UTag.component.d.ts +0 -23
- package/dist/components/tag/UTag.component.js +0 -72
- package/dist/components/tooltip/UTooltip.component.d.ts +0 -27
- package/dist/components/tooltip/UTooltip.component.js +0 -88
- package/dist/components/tree/UTree.component.d.ts +0 -37
- package/dist/components/tree/UTree.component.js +0 -120
- package/dist/components/tree-item/UTreeItem.component.d.ts +0 -41
- package/dist/components/tree-item/UTreeItem.component.js +0 -161
- package/dist/events/UChangeEvent.d.ts +0 -6
- package/dist/events/UHideEvent.d.ts +0 -6
- package/dist/events/UInputEvent.d.ts +0 -6
- package/dist/events/UResizeEvent.d.ts +0 -6
- package/dist/events/USelectEvent.d.ts +0 -6
- package/dist/events/UShowEvent.d.ts +0 -6
- package/dist/react-components/UAlert.d.ts +0 -8
- package/dist/react-components/UForm.d.ts +0 -8
- package/dist/react-components/UInput.d.ts +0 -8
- package/dist/react-components/UMenu.d.ts +0 -8
- package/dist/react-components/UMenuItem.d.ts +0 -8
- package/dist/react-components/UProgressBar.d.ts +0 -8
- package/dist/react-components/UProgressRing.d.ts +0 -8
- package/dist/react-components/USplitPanel.d.ts +0 -8
- package/dist/react-components/UTooltip.d.ts +0 -8
- package/dist/react-components/UTree.d.ts +0 -8
- package/dist/react-components/UTreeItem.d.ts +0 -8
- package/dist/utilities/IconRegistry.d.ts +0 -40
- package/dist/utilities/IconRegistry.js +0 -134
- package/dist/utilities/Notifier.d.ts +0 -31
- package/dist/utilities/Notifier.js +0 -79
- package/dist/utilities/decorators.d.ts +0 -28
- /package/dist/components/{UJsonElement.styles.d.ts → UDataElement.styles.d.ts} +0 -0
- /package/dist/components/{UModalElement.styles.d.ts → UFormControlElement.styles.d.ts} +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { UElement } from "./UElement.js";
|
|
2
|
+
import "./icon/UIcon.js";
|
|
3
|
+
import { buildElementHTML } from "../utilities/elements.js";
|
|
4
|
+
import { styles } from "./UDataElement.styles.js";
|
|
5
|
+
import { html } from "lit";
|
|
6
|
+
//#region src/components/UDataElement.ts
|
|
7
|
+
/**
|
|
8
|
+
* `UDataElement`는 light DOM 내 `<script type="application/json">` 태그에서
|
|
9
|
+
* JSON 데이터를 읽어 컴포넌트 프로퍼티에 자동으로 매핑하는 기반 클래스입니다.
|
|
10
|
+
*
|
|
11
|
+
* 사용 예시:
|
|
12
|
+
* ```html
|
|
13
|
+
* <my-component>
|
|
14
|
+
* <script type="application/json">{ "items": [1, 2, 3] }<\/script>
|
|
15
|
+
* </my-component>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* JSON 최상위 키가 컴포넌트의 프로퍼티 이름과 일치하면 자동으로 할당됩니다.
|
|
19
|
+
*/
|
|
20
|
+
var UDataElement = class extends UElement {
|
|
21
|
+
static {
|
|
22
|
+
this.styles = [super.styles, styles];
|
|
23
|
+
}
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback();
|
|
26
|
+
queueMicrotask(() => this.load());
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 지정한 태그와 데이터로 커스텀 엘리먼트 HTML 문자열을 생성합니다.
|
|
30
|
+
* 데이터는 `<script type="application/json">` 태그로 주입됩니다.
|
|
31
|
+
* 태그이름이 등록되지 않은 경우 빈 문자열을 반환합니다.
|
|
32
|
+
*
|
|
33
|
+
* @param json - JSON 데이터 객체 또는 문자열
|
|
34
|
+
* @param attrs - 추가 속성 객체 (선택적, `buildElementHTML` 규칙 적용)
|
|
35
|
+
* @returns 생성된 HTML 문자열
|
|
36
|
+
*/
|
|
37
|
+
static buildHTML(json, attrs = {}) {
|
|
38
|
+
const tag = customElements.getName(this);
|
|
39
|
+
if (!tag) {
|
|
40
|
+
console.warn(`Custom element for ${this.name} is not defined.`);
|
|
41
|
+
return "";
|
|
42
|
+
}
|
|
43
|
+
return buildElementHTML(tag, attrs, `<script type="application/json">${(typeof json === "string" ? json : JSON.stringify(json)).replace(/&/g, "\\u0026").replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/-->/g, "--\\>")}<\/script>`);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* `data` 객체를 컴포넌트 프로퍼티에 할당합니다.
|
|
47
|
+
* `data`가 제공되지 않은 경우 light DOM 내 `<script type="application/json">` 태그에서 JSON 데이터를 읽어 프로퍼티에 자동으로 할당합니다.
|
|
48
|
+
* 오류가 발생할 경우 `error()`를 호출하여 에러 UI로 대체합니다.
|
|
49
|
+
*
|
|
50
|
+
* @param data - JSON 데이터 객체 (선택적)
|
|
51
|
+
*/
|
|
52
|
+
async load(data) {
|
|
53
|
+
try {
|
|
54
|
+
if (!data) {
|
|
55
|
+
const script = this.querySelector("script[type=\"application/json\"]");
|
|
56
|
+
if (!script) throw new Error("Missing <script type=\"application/json\">");
|
|
57
|
+
data = JSON.parse(script.textContent ?? "{}");
|
|
58
|
+
script.remove();
|
|
59
|
+
}
|
|
60
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) throw new Error("Invalid JSON data: expected an object at the top level");
|
|
61
|
+
Object.assign(this, data);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
await this.error(error);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 오류 발생 시 Lit이 주입한 스타일시트를 보존하고 나머지 렌더링 결과를 에러 UI로 교체합니다.
|
|
68
|
+
* 일반적으로 JSON 파싱 오류의 경우 `data`가 객체가 아닌 문자열이거나 JSON 형식이 잘못된 경우입니다.
|
|
69
|
+
* 이 함수는 Lit 렌더링이 완료된 후에 호출됩니다.
|
|
70
|
+
*
|
|
71
|
+
* @param error - 발생한 오류 객체
|
|
72
|
+
*/
|
|
73
|
+
async error(error) {
|
|
74
|
+
await this.updateComplete;
|
|
75
|
+
if (!this.shadowRoot) return;
|
|
76
|
+
const tag = this.localName;
|
|
77
|
+
const type = error instanceof Error ? error.constructor.name : "UnknownError";
|
|
78
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
79
|
+
this.replace(html`
|
|
80
|
+
<div class="error-container">
|
|
81
|
+
<div class="error-header">
|
|
82
|
+
<u-icon class="error-icon" lib="internal" name="exclamation-triangle-fill"></u-icon>
|
|
83
|
+
<span class="error-title">Render Error</span>
|
|
84
|
+
<code class="error-tag"><${tag}></code>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="error-body">
|
|
87
|
+
<div class="error-row">
|
|
88
|
+
<span class="error-label">Type</span>
|
|
89
|
+
<code class="error-type">${type}</code>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="error-row">
|
|
92
|
+
<span class="error-label">Message</span>
|
|
93
|
+
<pre class="error-message">${message}</pre>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
`);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
//#endregion
|
|
101
|
+
export { UDataElement };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/UDataElement.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
.error-container {
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
@@ -91,5 +91,5 @@ const styles = css`
|
|
|
91
91
|
line-height: 1.55;
|
|
92
92
|
}
|
|
93
93
|
`;
|
|
94
|
-
|
|
94
|
+
//#endregion
|
|
95
95
|
export { styles };
|
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
import { LitElement, CSSResultGroup, RenderOptions } from 'lit';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* 모든 UI 컴포넌트의 기반 클래스.
|
|
4
|
+
* LitElement를 확장하여 이벤트 발행 및 렌더 교체 헬퍼를 제공합니다.
|
|
5
5
|
*/
|
|
6
6
|
export declare class UElement extends LitElement {
|
|
7
|
-
/**
|
|
8
|
-
* 기본 스타일을 정의합니다.
|
|
9
|
-
*/
|
|
10
7
|
static styles: CSSResultGroup;
|
|
11
8
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* 커스텀 엘리먼트를 정의합니다.
|
|
20
|
-
* 이미 정의된 엘리먼트는 다시 정의하지 않습니다.
|
|
21
|
-
* @param name - 커스텀 엘리먼트의 이름
|
|
22
|
-
* @param options - 엘리먼트 정의 옵션
|
|
9
|
+
* 커스텀 이벤트를 생성하여 발행합니다.
|
|
10
|
+
* 기본적으로 bubbles, composed, cancelable이 활성화됩니다.
|
|
11
|
+
*
|
|
12
|
+
* @typeParam T - 이벤트 detail의 타입
|
|
13
|
+
* @param name - 이벤트 이름 (예: 'show')
|
|
14
|
+
* @param options - CustomEventInit 오버라이드
|
|
15
|
+
* @returns preventDefault가 호출되지 않았으면 true
|
|
23
16
|
*/
|
|
24
|
-
|
|
17
|
+
protected fire<T>(name: string, options?: CustomEventInit): boolean;
|
|
25
18
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @
|
|
19
|
+
* 네이티브 이벤트를 호스트 엘리먼트에서 (재)발행합니다.
|
|
20
|
+
* 기존 이벤트를 전달하면 원본을 중단하고 동일 타입으로 재발행하며,
|
|
21
|
+
* 새 이벤트를 직접 전달할 수도 있습니다.
|
|
22
|
+
*
|
|
23
|
+
* @param event - 재발행할 이벤트 또는 새로 생성한 네이티브 이벤트
|
|
24
|
+
* @param options - EventInit 오버라이드
|
|
25
|
+
* @returns preventDefault가 호출되지 않았으면 true
|
|
31
26
|
*/
|
|
32
|
-
protected
|
|
27
|
+
protected relay(event: Event, options?: EventInit): boolean;
|
|
33
28
|
/**
|
|
34
29
|
* 현재 shadow DOM의 렌더 결과를 지정한 템플릿으로 완전히 교체합니다.
|
|
35
30
|
*
|
|
@@ -1,96 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (!this.shadowRoot) return;
|
|
84
|
-
Array.from(this.shadowRoot.childNodes).forEach((node) => {
|
|
85
|
-
if (!(node instanceof HTMLStyleElement)) {
|
|
86
|
-
node.parentNode?.removeChild(node);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
const container = document.createElement("div");
|
|
90
|
-
container.style.display = "contents";
|
|
91
|
-
this.shadowRoot.appendChild(container);
|
|
92
|
-
render(value, container, options);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
1
|
+
import { styles } from "./UElement.styles.js";
|
|
2
|
+
import { LitElement, render } from "lit";
|
|
3
|
+
//#region src/components/UElement.ts
|
|
4
|
+
/**
|
|
5
|
+
* 모든 UI 컴포넌트의 기반 클래스.
|
|
6
|
+
* LitElement를 확장하여 이벤트 발행 및 렌더 교체 헬퍼를 제공합니다.
|
|
7
|
+
*/
|
|
8
|
+
var UElement = class extends LitElement {
|
|
9
|
+
static {
|
|
10
|
+
this.styles = styles;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 커스텀 이벤트를 생성하여 발행합니다.
|
|
14
|
+
* 기본적으로 bubbles, composed, cancelable이 활성화됩니다.
|
|
15
|
+
*
|
|
16
|
+
* @typeParam T - 이벤트 detail의 타입
|
|
17
|
+
* @param name - 이벤트 이름 (예: 'show')
|
|
18
|
+
* @param options - CustomEventInit 오버라이드
|
|
19
|
+
* @returns preventDefault가 호출되지 않았으면 true
|
|
20
|
+
*/
|
|
21
|
+
fire(name, options) {
|
|
22
|
+
return this.dispatchEvent(new CustomEvent(name, {
|
|
23
|
+
bubbles: true,
|
|
24
|
+
composed: true,
|
|
25
|
+
cancelable: true,
|
|
26
|
+
...options
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 네이티브 이벤트를 호스트 엘리먼트에서 (재)발행합니다.
|
|
31
|
+
* 기존 이벤트를 전달하면 원본을 중단하고 동일 타입으로 재발행하며,
|
|
32
|
+
* 새 이벤트를 직접 전달할 수도 있습니다.
|
|
33
|
+
*
|
|
34
|
+
* @param event - 재발행할 이벤트 또는 새로 생성한 네이티브 이벤트
|
|
35
|
+
* @param options - EventInit 오버라이드
|
|
36
|
+
* @returns preventDefault가 호출되지 않았으면 true
|
|
37
|
+
*/
|
|
38
|
+
relay(event, options) {
|
|
39
|
+
event.stopImmediatePropagation();
|
|
40
|
+
const ctor = event.constructor;
|
|
41
|
+
return this.dispatchEvent(new ctor(event.type, {
|
|
42
|
+
...event,
|
|
43
|
+
...options
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 현재 shadow DOM의 렌더 결과를 지정한 템플릿으로 완전히 교체합니다.
|
|
48
|
+
*
|
|
49
|
+
* @param value - Lit 템플릿 결과 또는 기타 렌더링 가능한 값
|
|
50
|
+
* @param options - Lit의 RenderOptions (예: renderBefore 등)
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Lit은 브라우저 환경에 따라 스타일을 두 가지 방식으로 주입합니다.
|
|
54
|
+
*
|
|
55
|
+
* - **모던 브라우저**: `shadowRoot.adoptedStyleSheets`에 `CSSStyleSheet` 객체로 주입.
|
|
56
|
+
* 이 경우 `<style>` 태그 노드는 존재하지 않으므로 전체 `shadowRoot`를 교체해도 스타일이 유지됩니다.
|
|
57
|
+
*
|
|
58
|
+
* - **구형 브라우저 (폴리필 환경)**: `<style>` 태그를 shadow DOM 안에 직접 주입.
|
|
59
|
+
* 이 경우 `<style>` 태그 노드를 제거하면 스타일이 사라지므로, 에러 UI로 교체할 때는 `<style>` 태그 노드를 보존해야 합니다.
|
|
60
|
+
*
|
|
61
|
+
* 따라서 `<style>` 태그 노드는 보존하고 나머지 노드를 제거한 뒤
|
|
62
|
+
* 에러 div를 append하는 방식으로 양쪽 환경 모두에서 안전하게 동작합니다.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* this.replace(html`
|
|
67
|
+
* <span class="error">Something went wrong</span>
|
|
68
|
+
* `);
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
replace(value, options) {
|
|
72
|
+
if (!this.renderRoot) return;
|
|
73
|
+
Array.from(this.renderRoot.childNodes).forEach((node) => {
|
|
74
|
+
if (!(node instanceof HTMLStyleElement)) node.parentNode?.removeChild(node);
|
|
75
|
+
});
|
|
76
|
+
const container = document.createElement("div");
|
|
77
|
+
container.style.display = "contents";
|
|
78
|
+
this.renderRoot.appendChild(container);
|
|
79
|
+
render(value, container, options);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
//#endregion
|
|
96
83
|
export { UElement };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/UElement.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
color: var(--u-txt-color, inherit);
|
|
6
6
|
font-family: var(--u-font-base, inherit);
|
|
@@ -15,14 +15,53 @@ const styles = css`
|
|
|
15
15
|
overflow-wrap: inherit;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/* Focus Styles */
|
|
19
|
+
:host(:focus-visible) {
|
|
20
|
+
outline: 2px solid var(--u-blue-500);
|
|
21
|
+
outline-offset: 2px;
|
|
22
|
+
}
|
|
23
|
+
:focus-visible {
|
|
24
|
+
outline: 2px solid var(--u-blue-500);
|
|
25
|
+
outline-offset: 2px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Hidden Attribute */
|
|
29
|
+
:host([hidden]) {
|
|
30
|
+
display: none !important;
|
|
31
|
+
}
|
|
18
32
|
[hidden] {
|
|
19
33
|
display: none !important;
|
|
20
34
|
}
|
|
21
35
|
|
|
36
|
+
/* Scrollbar Styles */
|
|
37
|
+
:host([scrollable]) {
|
|
38
|
+
scrollbar-width: thin;
|
|
39
|
+
scrollbar-color: var(--u-scrollbar-color) var(--u-scrollbar-track-color);
|
|
40
|
+
}
|
|
41
|
+
:host([scrollable])::-webkit-scrollbar {
|
|
42
|
+
width: 8px;
|
|
43
|
+
height: 8px;
|
|
44
|
+
}
|
|
45
|
+
:host([scrollable])::-webkit-scrollbar-thumb {
|
|
46
|
+
background: var(--u-scrollbar-color);
|
|
47
|
+
}
|
|
48
|
+
:host([scrollable])::-webkit-scrollbar-track {
|
|
49
|
+
background: var(--u-scrollbar-track-color);
|
|
50
|
+
}
|
|
22
51
|
[scrollable] {
|
|
23
52
|
scrollbar-width: thin;
|
|
24
53
|
scrollbar-color: var(--u-scrollbar-color) var(--u-scrollbar-track-color);
|
|
25
54
|
}
|
|
55
|
+
[scrollable]::-webkit-scrollbar {
|
|
56
|
+
width: 8px;
|
|
57
|
+
height: 8px;
|
|
58
|
+
}
|
|
59
|
+
[scrollable]::-webkit-scrollbar-thumb {
|
|
60
|
+
background: var(--u-scrollbar-color);
|
|
61
|
+
}
|
|
62
|
+
[scrollable]::-webkit-scrollbar-track {
|
|
63
|
+
background: var(--u-scrollbar-track-color);
|
|
64
|
+
}
|
|
26
65
|
`;
|
|
27
|
-
|
|
66
|
+
//#endregion
|
|
28
67
|
export { styles };
|
|
@@ -1,46 +1,39 @@
|
|
|
1
1
|
import { CSSResultGroup, PropertyValues } from 'lit';
|
|
2
|
-
import { Placement, VirtualElement } from '@floating-ui/dom';
|
|
2
|
+
import { OffsetOptions, Placement, VirtualElement } from '@floating-ui/dom';
|
|
3
3
|
import { UElement } from './UElement.js';
|
|
4
|
+
export type FloatingStrategy = 'absolute' | 'fixed';
|
|
4
5
|
/**
|
|
5
6
|
* UFloatingElement는 팝오버, 툴팁 등 화면에 떠 있는 엘리먼트를 구현하기 위한 기본 클래스입니다.
|
|
6
7
|
* 이 클래스를 상속하여 커스텀 팝오버 컴포넌트를 만들 수 있습니다.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* 3. show() 및 hide() 메서드를 통해 프로그래밍적으로 표시하거나 숨길 수 있습니다.
|
|
11
|
-
* 4. strategy, placement, distance, shift 속성을 통해 표시 위치 결정 방식을 설정할 수 있습니다.
|
|
9
|
+
* @event show - 엘리먼트가 표시되기 전에 발생합니다. 이벤트 핸들러에서 false를 반환하면 표시가 취소됩니다.
|
|
10
|
+
* @event hide - 엘리먼트가 숨겨지기 전에 발생합니다. 이벤트 핸들러에서 false를 반환하면 숨김이 취소됩니다.
|
|
12
11
|
*/
|
|
13
12
|
export declare class UFloatingElement extends UElement {
|
|
14
|
-
/** 기본 스타일을 정의합니다. */
|
|
15
13
|
static styles: CSSResultGroup;
|
|
16
|
-
/** 종속된 컴포넌트를 정의합니다. */
|
|
17
|
-
static dependencies: Record<string, typeof UElement>;
|
|
18
|
-
private rafId;
|
|
19
|
-
private cleanup;
|
|
20
14
|
/**
|
|
21
|
-
* 엘리먼트가
|
|
15
|
+
* 현재 엘리먼트가 보여지는지 여부입니다.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
22
18
|
*/
|
|
23
|
-
|
|
19
|
+
open: boolean;
|
|
24
20
|
/**
|
|
25
|
-
*
|
|
21
|
+
* 엘리먼트가 비활성화 상태인지 여부입니다.
|
|
22
|
+
* true일 경우 엘리먼트가 표시되지 않고, 앵커와의 상호작용도 발생하지 않습니다.
|
|
23
|
+
*
|
|
24
|
+
* @default false
|
|
26
25
|
*/
|
|
27
|
-
|
|
26
|
+
disabled: boolean;
|
|
28
27
|
/**
|
|
29
28
|
* 앵커 엘리먼트를 찾기 위한 CSS 선택자입니다. querySelector를 사용하여 DOM에서 대상을 검색합니다.
|
|
30
29
|
*
|
|
31
|
-
* @
|
|
32
|
-
* - `id`로 찾기:
|
|
33
|
-
* - `class`로 찾기:
|
|
34
|
-
* - `태그명`으로 찾기:
|
|
35
|
-
* - `속성`으로 찾기:
|
|
30
|
+
* @remarks
|
|
31
|
+
* - `id`로 찾기: "#target-id"
|
|
32
|
+
* - `class`로 찾기: ".target-class"
|
|
33
|
+
* - `태그명`으로 찾기: "target-tag-name"
|
|
34
|
+
* - `속성`으로 찾기: "[data-role='target']"
|
|
36
35
|
*/
|
|
37
36
|
for?: string;
|
|
38
|
-
/**
|
|
39
|
-
* 현재 엘리먼트가 보여지는지 여부입니다.
|
|
40
|
-
*
|
|
41
|
-
* @default false
|
|
42
|
-
*/
|
|
43
|
-
visible: boolean;
|
|
44
37
|
/**
|
|
45
38
|
* 현재 엘리먼트의 위치 결정 전략입니다.
|
|
46
39
|
*
|
|
@@ -48,57 +41,85 @@ export declare class UFloatingElement extends UElement {
|
|
|
48
41
|
* - `absolute`: 엘리먼트가 문서 흐름에 따라 배치됩니다.
|
|
49
42
|
* - `fixed`: 엘리먼트가 뷰포트에 고정되어 스크롤과 무관하게 위치합니다.
|
|
50
43
|
*/
|
|
51
|
-
strategy:
|
|
44
|
+
strategy: FloatingStrategy;
|
|
52
45
|
/**
|
|
53
46
|
* 대상 엘리먼트로부터의 배치 위치입니다.
|
|
54
|
-
* 지정하지 않으면
|
|
47
|
+
* 지정하지 않으면 자동으로 가장 적절한 위치가 선택됩니다.
|
|
48
|
+
*
|
|
49
|
+
* @default undefined
|
|
55
50
|
*/
|
|
56
51
|
placement?: Placement;
|
|
57
52
|
/**
|
|
58
|
-
* 대상 엘리먼트로부터의
|
|
53
|
+
* 대상 엘리먼트로부터의 픽셀 단위의 간격입니다.
|
|
54
|
+
* 상세 간격 조정을 위한 { mainAxis, crossAxis } 형태의 객체도 허용합니다.
|
|
59
55
|
*
|
|
60
56
|
* @default 0
|
|
61
57
|
*/
|
|
62
|
-
|
|
58
|
+
offset: OffsetOptions;
|
|
63
59
|
/**
|
|
64
|
-
*
|
|
60
|
+
* 엘리먼트가 화면 안에 머물도록 자동으로 위치를 조정할지 여부입니다.
|
|
65
61
|
*
|
|
66
|
-
* @default
|
|
62
|
+
* @default false
|
|
67
63
|
*/
|
|
68
|
-
|
|
64
|
+
shift: boolean;
|
|
69
65
|
/**
|
|
70
|
-
*
|
|
66
|
+
* 화살표를 표시할지 여부입니다. true로 설정하면 화살표 요소가 root 내부에 추가됩니다.
|
|
71
67
|
*
|
|
72
68
|
* @default false
|
|
73
69
|
*/
|
|
74
|
-
|
|
70
|
+
arrow: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* 엘리먼트가 표시되기 전 지연 시간(ms)입니다.
|
|
73
|
+
*
|
|
74
|
+
* @default 0
|
|
75
|
+
*/
|
|
76
|
+
showDelay: number;
|
|
77
|
+
/**
|
|
78
|
+
* 엘리먼트가 숨겨지기 전 지연 시간(ms)입니다.
|
|
79
|
+
*
|
|
80
|
+
* @default 0
|
|
81
|
+
*/
|
|
82
|
+
hideDelay: number;
|
|
83
|
+
/** 연결된 엘리먼트 입니다. 기본으로 부모 엘리먼트가 포함됩니다. */
|
|
84
|
+
anchors?: HTMLElement[];
|
|
85
|
+
/** 현재 위치에 연결된 타겟 엘리먼트입니다. */
|
|
86
|
+
protected targetEl?: HTMLElement | VirtualElement;
|
|
87
|
+
/** arrow를 사용할 때 만들어지는 화살표 엘리먼트입니다. */
|
|
88
|
+
protected arrowEl?: HTMLElement;
|
|
89
|
+
private cleanup;
|
|
90
|
+
private showTimer?;
|
|
91
|
+
private hideTimer?;
|
|
75
92
|
connectedCallback(): void;
|
|
76
93
|
disconnectedCallback(): void;
|
|
77
94
|
protected willUpdate(changedProperties: PropertyValues): void;
|
|
78
|
-
protected updated(changedProperties: PropertyValues): void;
|
|
79
|
-
/**
|
|
80
|
-
* for 속성에 따라 element를 기준으로 앵커 엘리먼트를 탐색하여 anchors로 설정합니다.
|
|
81
|
-
*/
|
|
82
|
-
scan(element: Element): void;
|
|
83
95
|
/**
|
|
84
96
|
* 현재 엘리먼트를 표시합니다.
|
|
85
97
|
*
|
|
86
98
|
* @param target - 위치 계산에 사용할 타겟 엘리먼트입니다.
|
|
87
|
-
* @
|
|
99
|
+
* @returns 표시 성공 여부를 나타내는 Promise입니다.
|
|
88
100
|
*/
|
|
89
|
-
show(target: Element | VirtualElement
|
|
101
|
+
show(target: Element | VirtualElement): Promise<boolean>;
|
|
90
102
|
/**
|
|
91
103
|
* 현재 엘리먼트를 숨깁니다.
|
|
104
|
+
*
|
|
105
|
+
* @returns 숨김 성공 여부를 나타내는 Promise입니다.
|
|
92
106
|
*/
|
|
93
|
-
hide(): Promise<
|
|
107
|
+
hide(): Promise<boolean>;
|
|
94
108
|
/**
|
|
95
|
-
*
|
|
109
|
+
* `@floating-ui/dom` 를 이용하여 위치를 계산하고 style 을 적용합니다.
|
|
96
110
|
*
|
|
97
111
|
* @param target - 위치 계산에 사용할 타겟 엘리먼트입니다.
|
|
98
112
|
*/
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
113
|
+
reposition(target: Element | VirtualElement): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* 이벤트에서 사용할 가상 타겟 엘리먼트를 생성합니다.
|
|
116
|
+
*
|
|
117
|
+
* @param event - 마우스 이벤트 객체입니다.
|
|
118
|
+
* @returns 가상 타겟 엘리먼트입니다.
|
|
119
|
+
*/
|
|
120
|
+
protected createVirtualTarget(event: MouseEvent | PointerEvent): VirtualElement;
|
|
121
|
+
/** arrow 속성의 변경에 따라 화살표 요소를 추가 또는 제거하는 메서드입니다. */
|
|
122
|
+
private toggleArrowElement;
|
|
123
|
+
/** 쿼리 선택자를 사용하여 앵커 엘리먼트를 찾습니다. */
|
|
124
|
+
private getAnchors;
|
|
104
125
|
}
|