@iyulab/components 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -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/UDataElement.d.ts +44 -0
- package/dist/components/UDataElement.js +101 -0
- package/dist/components/UDataElement.styles.js +95 -0
- package/dist/components/UElement.d.ts +54 -0
- package/dist/components/UElement.js +83 -0
- package/dist/components/UElement.styles.js +67 -0
- package/dist/components/UFloatingElement.d.ts +125 -0
- package/dist/components/UFloatingElement.js +238 -0
- package/dist/components/UFloatingElement.styles.d.ts +9 -0
- package/dist/components/UFloatingElement.styles.js +46 -0
- 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 +32 -33
- 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 +55 -4
- package/dist/components/icon/UIcon.styles.js +5 -5
- 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 +151 -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 +315 -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 +145 -0
- package/dist/components/textarea/UTextarea.styles.d.ts +1 -0
- package/dist/components/textarea/UTextarea.styles.js +157 -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 +41 -8
- package/dist/index.js +56 -46
- 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.d.ts +23 -0
- package/dist/utilities/elements.js +67 -16
- package/dist/utilities/icons.d.ts +67 -0
- package/dist/utilities/icons.js +200 -0
- package/dist/utilities/sanitizers.d.ts +35 -0
- package/dist/utilities/sanitizers.js +75 -0
- package/package.json +24 -21
- 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.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/copy.svg.js +0 -3
- package/dist/assets/icons/dash-lg.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/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/BaseElement.d.ts +0 -33
- package/dist/components/BaseElement.js +0 -59
- package/dist/components/BaseElement.styles.js +0 -28
- package/dist/components/FloatingElement.d.ts +0 -104
- package/dist/components/FloatingElement.js +0 -195
- package/dist/components/FloatingElement.styles.js +0 -23
- package/dist/components/ModalElement.d.ts +0 -70
- package/dist/components/ModalElement.js +0 -144
- package/dist/components/ModalElement.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 -67
- package/dist/components/carousel/UCarousel.component.js +0 -243
- 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 -119
- 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/{BaseElement.styles.d.ts → UDataElement.styles.d.ts} +0 -0
- /package/dist/components/{FloatingElement.styles.d.ts → UElement.styles.d.ts} +0 -0
- /package/dist/components/{ModalElement.styles.d.ts → UFormControlElement.styles.d.ts} +0 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { UElement } from "./UElement.js";
|
|
2
|
+
import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
3
|
+
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
4
|
+
import { getParentElement, querySelectorAllWithin } from "../utilities/elements.js";
|
|
5
|
+
import { styles } from "./UFloatingElement.styles.js";
|
|
6
|
+
import { property, state } from "lit/decorators.js";
|
|
7
|
+
import { arrow, autoPlacement, autoUpdate, computePosition, flip, offset, shift } from "@floating-ui/dom";
|
|
8
|
+
//#region src/components/UFloatingElement.ts
|
|
9
|
+
/**
|
|
10
|
+
* UFloatingElement는 팝오버, 툴팁 등 화면에 떠 있는 엘리먼트를 구현하기 위한 기본 클래스입니다.
|
|
11
|
+
* 이 클래스를 상속하여 커스텀 팝오버 컴포넌트를 만들 수 있습니다.
|
|
12
|
+
*
|
|
13
|
+
* @event show - 엘리먼트가 표시되기 전에 발생합니다. 이벤트 핸들러에서 false를 반환하면 표시가 취소됩니다.
|
|
14
|
+
* @event hide - 엘리먼트가 숨겨지기 전에 발생합니다. 이벤트 핸들러에서 false를 반환하면 숨김이 취소됩니다.
|
|
15
|
+
*/
|
|
16
|
+
var UFloatingElement = class extends UElement {
|
|
17
|
+
constructor(..._args) {
|
|
18
|
+
super(..._args);
|
|
19
|
+
this.open = false;
|
|
20
|
+
this.disabled = false;
|
|
21
|
+
this.strategy = "absolute";
|
|
22
|
+
this.offset = 0;
|
|
23
|
+
this.shift = false;
|
|
24
|
+
this.arrow = false;
|
|
25
|
+
this.showDelay = 0;
|
|
26
|
+
this.hideDelay = 0;
|
|
27
|
+
this.cleanup = null;
|
|
28
|
+
}
|
|
29
|
+
static {
|
|
30
|
+
this.styles = [super.styles, styles];
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback();
|
|
34
|
+
if (!this.anchors || this.anchors.length === 0) {
|
|
35
|
+
const parent = getParentElement(this);
|
|
36
|
+
this.anchors = parent ? [parent] : [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
disconnectedCallback() {
|
|
40
|
+
if (this.cleanup !== null) this.cleanup();
|
|
41
|
+
this.cleanup = null;
|
|
42
|
+
clearTimeout(this.showTimer);
|
|
43
|
+
clearTimeout(this.hideTimer);
|
|
44
|
+
this.showTimer = void 0;
|
|
45
|
+
this.hideTimer = void 0;
|
|
46
|
+
super.disconnectedCallback();
|
|
47
|
+
}
|
|
48
|
+
willUpdate(changedProperties) {
|
|
49
|
+
super.willUpdate(changedProperties);
|
|
50
|
+
if (changedProperties.has("for")) this.anchors = this.getAnchors(this.for);
|
|
51
|
+
if (changedProperties.has("arrow")) this.toggleArrowElement(this.arrow);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 현재 엘리먼트를 표시합니다.
|
|
55
|
+
*
|
|
56
|
+
* @param target - 위치 계산에 사용할 타겟 엘리먼트입니다.
|
|
57
|
+
* @returns 표시 성공 여부를 나타내는 Promise입니다.
|
|
58
|
+
*/
|
|
59
|
+
async show(target) {
|
|
60
|
+
if (this.disabled) return false;
|
|
61
|
+
if (this.hideTimer) {
|
|
62
|
+
clearTimeout(this.hideTimer);
|
|
63
|
+
this.hideTimer = void 0;
|
|
64
|
+
}
|
|
65
|
+
if (this.showTimer) return true;
|
|
66
|
+
if (this.cleanup !== null) {
|
|
67
|
+
this.cleanup();
|
|
68
|
+
this.cleanup = null;
|
|
69
|
+
}
|
|
70
|
+
await this.reposition(target);
|
|
71
|
+
this.cleanup = autoUpdate(target, this, () => {
|
|
72
|
+
this.reposition(target);
|
|
73
|
+
});
|
|
74
|
+
this.targetEl = target;
|
|
75
|
+
if (this.open) return true;
|
|
76
|
+
if (this.fire("show")) {
|
|
77
|
+
if (this.showDelay > 0) this.showTimer = window.setTimeout(() => {
|
|
78
|
+
this.showTimer = void 0;
|
|
79
|
+
this.open = true;
|
|
80
|
+
}, this.showDelay);
|
|
81
|
+
else this.open = true;
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 현재 엘리먼트를 숨깁니다.
|
|
88
|
+
*
|
|
89
|
+
* @returns 숨김 성공 여부를 나타내는 Promise입니다.
|
|
90
|
+
*/
|
|
91
|
+
async hide() {
|
|
92
|
+
if (this.disabled) return false;
|
|
93
|
+
if (this.showTimer) {
|
|
94
|
+
clearTimeout(this.showTimer);
|
|
95
|
+
this.showTimer = void 0;
|
|
96
|
+
}
|
|
97
|
+
if (this.hideTimer) return true;
|
|
98
|
+
if (this.cleanup !== null) {
|
|
99
|
+
this.cleanup();
|
|
100
|
+
this.cleanup = null;
|
|
101
|
+
}
|
|
102
|
+
await this.updateComplete;
|
|
103
|
+
this.targetEl = void 0;
|
|
104
|
+
if (!this.open) return true;
|
|
105
|
+
if (this.fire("hide")) {
|
|
106
|
+
if (this.hideDelay > 0) this.hideTimer = window.setTimeout(() => {
|
|
107
|
+
this.hideTimer = void 0;
|
|
108
|
+
this.open = false;
|
|
109
|
+
}, this.hideDelay);
|
|
110
|
+
else this.open = false;
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* `@floating-ui/dom` 를 이용하여 위치를 계산하고 style 을 적용합니다.
|
|
117
|
+
*
|
|
118
|
+
* @param target - 위치 계산에 사용할 타겟 엘리먼트입니다.
|
|
119
|
+
*/
|
|
120
|
+
async reposition(target) {
|
|
121
|
+
const position = await computePosition(target, this, {
|
|
122
|
+
strategy: this.strategy,
|
|
123
|
+
placement: this.placement,
|
|
124
|
+
middleware: [
|
|
125
|
+
offset(this.offset),
|
|
126
|
+
shift({ mainAxis: this.shift }),
|
|
127
|
+
this.placement ? flip() : autoPlacement(),
|
|
128
|
+
...this.arrowEl ? [arrow({ element: this.arrowEl })] : []
|
|
129
|
+
]
|
|
130
|
+
});
|
|
131
|
+
const config = {
|
|
132
|
+
top: {
|
|
133
|
+
transform: "center bottom",
|
|
134
|
+
aside: "bottom",
|
|
135
|
+
clipPath: "polygon(0 0, 100% 0, 50% 70%)"
|
|
136
|
+
},
|
|
137
|
+
bottom: {
|
|
138
|
+
transform: "center top",
|
|
139
|
+
aside: "top",
|
|
140
|
+
clipPath: "polygon(50% 30%, 100% 100%, 0 100%)"
|
|
141
|
+
},
|
|
142
|
+
left: {
|
|
143
|
+
transform: "right center",
|
|
144
|
+
aside: "right",
|
|
145
|
+
clipPath: "polygon(0 0, 70% 50%, 0 100%)"
|
|
146
|
+
},
|
|
147
|
+
right: {
|
|
148
|
+
transform: "left center",
|
|
149
|
+
aside: "left",
|
|
150
|
+
clipPath: "polygon(100% 0, 100% 100%, 30% 50%)"
|
|
151
|
+
}
|
|
152
|
+
}[position.placement.split("-")[0]];
|
|
153
|
+
Object.assign(this.style, {
|
|
154
|
+
left: `${position.x}px`,
|
|
155
|
+
top: `${position.y}px`,
|
|
156
|
+
transformOrigin: config.transform
|
|
157
|
+
});
|
|
158
|
+
const arrowData = position.middlewareData.arrow;
|
|
159
|
+
if (!this.arrowEl || !arrowData) return;
|
|
160
|
+
Object.assign(this.arrowEl.style, {
|
|
161
|
+
left: arrowData.x != null ? `${arrowData.x}px` : "",
|
|
162
|
+
top: arrowData.y != null ? `${arrowData.y}px` : "",
|
|
163
|
+
right: "",
|
|
164
|
+
bottom: "",
|
|
165
|
+
[config.aside]: `-${this.arrowEl.offsetWidth - 1}px`,
|
|
166
|
+
clipPath: config.clipPath
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* 이벤트에서 사용할 가상 타겟 엘리먼트를 생성합니다.
|
|
171
|
+
*
|
|
172
|
+
* @param event - 마우스 이벤트 객체입니다.
|
|
173
|
+
* @returns 가상 타겟 엘리먼트입니다.
|
|
174
|
+
*/
|
|
175
|
+
createVirtualTarget(event) {
|
|
176
|
+
return { getBoundingClientRect: () => ({
|
|
177
|
+
width: 0,
|
|
178
|
+
height: 0,
|
|
179
|
+
x: event.clientX,
|
|
180
|
+
y: event.clientY,
|
|
181
|
+
top: event.clientY,
|
|
182
|
+
left: event.clientX,
|
|
183
|
+
right: event.clientX,
|
|
184
|
+
bottom: event.clientY
|
|
185
|
+
}) };
|
|
186
|
+
}
|
|
187
|
+
/** arrow 속성의 변경에 따라 화살표 요소를 추가 또는 제거하는 메서드입니다. */
|
|
188
|
+
toggleArrowElement(enabled) {
|
|
189
|
+
if (enabled) {
|
|
190
|
+
if (this.arrowEl) return;
|
|
191
|
+
this.arrowEl = document.createElement("div");
|
|
192
|
+
this.arrowEl.id = "arrow";
|
|
193
|
+
this.renderRoot.appendChild(this.arrowEl);
|
|
194
|
+
} else {
|
|
195
|
+
if (!this.arrowEl) return;
|
|
196
|
+
this.renderRoot.removeChild(this.arrowEl);
|
|
197
|
+
this.arrowEl = void 0;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/** 쿼리 선택자를 사용하여 앵커 엘리먼트를 찾습니다. */
|
|
201
|
+
getAnchors(selectors) {
|
|
202
|
+
if (selectors) {
|
|
203
|
+
const anchors = querySelectorAllWithin(this, selectors);
|
|
204
|
+
return Array.from(anchors);
|
|
205
|
+
} else {
|
|
206
|
+
const parent = getParentElement(this);
|
|
207
|
+
return parent ? [parent] : [];
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
__decorate([property({
|
|
212
|
+
type: Boolean,
|
|
213
|
+
reflect: true
|
|
214
|
+
}), __decorateMetadata("design:type", Boolean)], UFloatingElement.prototype, "open", void 0);
|
|
215
|
+
__decorate([property({
|
|
216
|
+
type: Boolean,
|
|
217
|
+
reflect: true
|
|
218
|
+
}), __decorateMetadata("design:type", Boolean)], UFloatingElement.prototype, "disabled", void 0);
|
|
219
|
+
__decorate([property({
|
|
220
|
+
type: String,
|
|
221
|
+
reflect: true
|
|
222
|
+
}), __decorateMetadata("design:type", String)], UFloatingElement.prototype, "for", void 0);
|
|
223
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", Object)], UFloatingElement.prototype, "strategy", void 0);
|
|
224
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", Object)], UFloatingElement.prototype, "placement", void 0);
|
|
225
|
+
__decorate([property({ type: Number }), __decorateMetadata("design:type", Object)], UFloatingElement.prototype, "offset", void 0);
|
|
226
|
+
__decorate([property({ type: Boolean }), __decorateMetadata("design:type", Boolean)], UFloatingElement.prototype, "shift", void 0);
|
|
227
|
+
__decorate([property({ type: Boolean }), __decorateMetadata("design:type", Boolean)], UFloatingElement.prototype, "arrow", void 0);
|
|
228
|
+
__decorate([property({
|
|
229
|
+
type: Number,
|
|
230
|
+
attribute: "show-delay"
|
|
231
|
+
}), __decorateMetadata("design:type", Number)], UFloatingElement.prototype, "showDelay", void 0);
|
|
232
|
+
__decorate([property({
|
|
233
|
+
type: Number,
|
|
234
|
+
attribute: "hide-delay"
|
|
235
|
+
}), __decorateMetadata("design:type", Number)], UFloatingElement.prototype, "hideDelay", void 0);
|
|
236
|
+
__decorate([state(), __decorateMetadata("design:type", Array)], UFloatingElement.prototype, "anchors", void 0);
|
|
237
|
+
//#endregion
|
|
238
|
+
export { UFloatingElement };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/UFloatingElement.styles.ts
|
|
3
|
+
/**
|
|
4
|
+
* **주의**:
|
|
5
|
+
* 조상 요소에 transform + overflow의 조합일 경우,
|
|
6
|
+
* floating element가 뷰포트가 아닌 부모 요소를 기준으로 위치하게 됩니다.
|
|
7
|
+
* 이 경우, floating element가 부모 요소의 경계를 벗어나지 못하게 됩니다.
|
|
8
|
+
*
|
|
9
|
+
* **해결 방안**: 상위 레이어로 위치 변경
|
|
10
|
+
*/
|
|
11
|
+
var styles = css`
|
|
12
|
+
:host {
|
|
13
|
+
position: absolute;
|
|
14
|
+
z-index: 1000;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
width: max-content;
|
|
18
|
+
|
|
19
|
+
opacity: 0;
|
|
20
|
+
visibility: hidden;
|
|
21
|
+
pointer-events: none;
|
|
22
|
+
transition: opacity 0.2s ease, visibility 0s 0.2s;
|
|
23
|
+
}
|
|
24
|
+
:host([open]) {
|
|
25
|
+
opacity: 1;
|
|
26
|
+
visibility: visible;
|
|
27
|
+
pointer-events: auto;
|
|
28
|
+
transition-delay: 0s;
|
|
29
|
+
}
|
|
30
|
+
:host([strategy="absolute"]) {
|
|
31
|
+
position: absolute;
|
|
32
|
+
}
|
|
33
|
+
:host([strategy="fixed"]) {
|
|
34
|
+
position: fixed;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* 화살표: clip-path로 삼각형 */
|
|
38
|
+
#arrow {
|
|
39
|
+
position: absolute;
|
|
40
|
+
width: 0.5em;
|
|
41
|
+
height: 0.5em;
|
|
42
|
+
background-color: inherit;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { styles };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { CSSResultGroup } from 'lit';
|
|
2
|
+
import { UElement } from './UElement.js';
|
|
3
|
+
/**
|
|
4
|
+
* 폼 컨트롤 컴포넌트의 공통 기반 클래스입니다.
|
|
5
|
+
* 사용자 입력을 받는 모든 컴포넌트가 이 클래스를 확장합니다.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class UFormControlElement<T> extends UElement {
|
|
8
|
+
static styles: CSSResultGroup;
|
|
9
|
+
static formAssociated: boolean;
|
|
10
|
+
/** 비활성 상태 */
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
/** 읽기 전용 상태 */
|
|
13
|
+
readonly: boolean;
|
|
14
|
+
/** 필수 입력 여부 */
|
|
15
|
+
required: boolean;
|
|
16
|
+
/** 유효성 검증 실패 상태 */
|
|
17
|
+
invalid: boolean;
|
|
18
|
+
/** 값 변경시 자동 유효성 검증 여부 */
|
|
19
|
+
novalidate: boolean;
|
|
20
|
+
/** 필드 라벨 */
|
|
21
|
+
label?: string;
|
|
22
|
+
/** 보조 설명 텍스트 */
|
|
23
|
+
description?: string;
|
|
24
|
+
/** 커스텀 유효성 검증 메시지 */
|
|
25
|
+
validationMessage?: string;
|
|
26
|
+
/** 폼 제출 시 사용되는 이름 */
|
|
27
|
+
name?: string;
|
|
28
|
+
/** 폼 제출 시 사용되는 값 */
|
|
29
|
+
value?: T;
|
|
30
|
+
/**
|
|
31
|
+
* ElementInternals는 폼과의 연동, 유효성 검사 상태 관리 등을 지원하는 네이티브 API입니다.
|
|
32
|
+
*/
|
|
33
|
+
protected internals?: ElementInternals;
|
|
34
|
+
/**
|
|
35
|
+
* 폼과의 연동을 위해 `form` 속성을 제공합니다. ElementInternals를 지원하는 브라우저에서 폼 요소에 접근할 수 있습니다.
|
|
36
|
+
* 지원하지 않는 브라우저에서는 null을 반환합니다.
|
|
37
|
+
*/
|
|
38
|
+
get form(): HTMLFormElement | null;
|
|
39
|
+
/**
|
|
40
|
+
* 각 컴포넌트가 자신의 검증 로직으로 validity 상태를 갱신하면, 이 객체를 통해 유효성 상태를 확인할 수 있습니다.
|
|
41
|
+
* ElementInternals를 지원하지 않는 브라우저에서는 undefined를 반환합니다.
|
|
42
|
+
*/
|
|
43
|
+
get validity(): ValidityState | undefined;
|
|
44
|
+
connectedCallback(): void;
|
|
45
|
+
/**
|
|
46
|
+
* 컴포넌트 자체 유효성을 검증하고 `invalid` 상태를 갱신합니다.
|
|
47
|
+
* 각 컴포넌트가 자신의 검증 로직으로 구현합니다.
|
|
48
|
+
*
|
|
49
|
+
* @returns 유효하면 `true`, 아니면 `false`
|
|
50
|
+
*/
|
|
51
|
+
abstract validate(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 폼이 리셋될 때 호출되는 메서드입니다.
|
|
54
|
+
* 각 컴포넌트가 자신의 초기 상태로 리셋하는 로직을 구현합니다.
|
|
55
|
+
*/
|
|
56
|
+
abstract reset(): void;
|
|
57
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { UElement } from "./UElement.js";
|
|
2
|
+
import { styles } from "./UFormControlElement.styles.js";
|
|
3
|
+
import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
4
|
+
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
5
|
+
import { property } from "lit/decorators.js";
|
|
6
|
+
//#region src/components/UFormControlElement.ts
|
|
7
|
+
/**
|
|
8
|
+
* 폼 컨트롤 컴포넌트의 공통 기반 클래스입니다.
|
|
9
|
+
* 사용자 입력을 받는 모든 컴포넌트가 이 클래스를 확장합니다.
|
|
10
|
+
*/
|
|
11
|
+
var UFormControlElement = class extends UElement {
|
|
12
|
+
constructor(..._args) {
|
|
13
|
+
super(..._args);
|
|
14
|
+
this.disabled = false;
|
|
15
|
+
this.readonly = false;
|
|
16
|
+
this.required = false;
|
|
17
|
+
this.invalid = false;
|
|
18
|
+
this.novalidate = false;
|
|
19
|
+
}
|
|
20
|
+
static {
|
|
21
|
+
this.styles = [super.styles, styles];
|
|
22
|
+
}
|
|
23
|
+
static {
|
|
24
|
+
this.formAssociated = true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 폼과의 연동을 위해 `form` 속성을 제공합니다. ElementInternals를 지원하는 브라우저에서 폼 요소에 접근할 수 있습니다.
|
|
28
|
+
* 지원하지 않는 브라우저에서는 null을 반환합니다.
|
|
29
|
+
*/
|
|
30
|
+
get form() {
|
|
31
|
+
return this.internals?.form ?? null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 각 컴포넌트가 자신의 검증 로직으로 validity 상태를 갱신하면, 이 객체를 통해 유효성 상태를 확인할 수 있습니다.
|
|
35
|
+
* ElementInternals를 지원하지 않는 브라우저에서는 undefined를 반환합니다.
|
|
36
|
+
*/
|
|
37
|
+
get validity() {
|
|
38
|
+
return this.internals?.validity;
|
|
39
|
+
}
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
super.connectedCallback();
|
|
42
|
+
if ("attachInternals" in this) this.internals = this.attachInternals();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
__decorate([property({
|
|
46
|
+
type: Boolean,
|
|
47
|
+
reflect: true
|
|
48
|
+
}), __decorateMetadata("design:type", Boolean)], UFormControlElement.prototype, "disabled", void 0);
|
|
49
|
+
__decorate([property({
|
|
50
|
+
type: Boolean,
|
|
51
|
+
reflect: true
|
|
52
|
+
}), __decorateMetadata("design:type", Boolean)], UFormControlElement.prototype, "readonly", void 0);
|
|
53
|
+
__decorate([property({
|
|
54
|
+
type: Boolean,
|
|
55
|
+
reflect: true
|
|
56
|
+
}), __decorateMetadata("design:type", Boolean)], UFormControlElement.prototype, "required", void 0);
|
|
57
|
+
__decorate([property({
|
|
58
|
+
type: Boolean,
|
|
59
|
+
reflect: true
|
|
60
|
+
}), __decorateMetadata("design:type", Boolean)], UFormControlElement.prototype, "invalid", void 0);
|
|
61
|
+
__decorate([property({ type: Boolean }), __decorateMetadata("design:type", Boolean)], UFormControlElement.prototype, "novalidate", void 0);
|
|
62
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UFormControlElement.prototype, "label", void 0);
|
|
63
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UFormControlElement.prototype, "description", void 0);
|
|
64
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UFormControlElement.prototype, "validationMessage", void 0);
|
|
65
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UFormControlElement.prototype, "name", void 0);
|
|
66
|
+
__decorate([property({ type: Object }), __decorateMetadata("design:type", Object)], UFormControlElement.prototype, "value", void 0);
|
|
67
|
+
//#endregion
|
|
68
|
+
export { UFormControlElement };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/UFormControlElement.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
|
+
:host([disabled]) {
|
|
5
|
+
pointer-events: none;
|
|
6
|
+
opacity: 0.5;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host([readonly]) {
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { styles };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { CSSResultGroup, PropertyValues } from 'lit';
|
|
2
|
+
import { UElement } from './UElement.js';
|
|
3
|
+
/** closeOn에 지정할 수 있는 닫기 트리거 */
|
|
4
|
+
export type CloseOnPolicy = 'escape' | 'backdrop' | 'button';
|
|
5
|
+
/** 오버레이 모드 */
|
|
6
|
+
export type OverlayMode = 'modal' | 'non-modal';
|
|
7
|
+
/**
|
|
8
|
+
* UOverlayElement는 다이얼로그, 드로어 등 화면에 오버레이로 표시되는 엘리먼트의 기본 클래스입니다.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class UOverlayElement extends UElement {
|
|
11
|
+
static styles: CSSResultGroup;
|
|
12
|
+
/**
|
|
13
|
+
* 열림/닫힘 상태
|
|
14
|
+
*
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
open: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* contained 모드 여부
|
|
20
|
+
* - true이면 position: absolute로 부모 기준 오버레이
|
|
21
|
+
* - modal이어도 body scroll lock을 적용하지 않음
|
|
22
|
+
*
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
contained: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 오버레이 모드
|
|
28
|
+
* - `modal` — focus trap, scroll lock, 백드롭 차단 (기본값)
|
|
29
|
+
* - `non-modal` — 주변 UI와 자유 상호작용, 배경 투명, scroll lock 없음
|
|
30
|
+
*
|
|
31
|
+
* @default 'modal'
|
|
32
|
+
*/
|
|
33
|
+
mode: OverlayMode;
|
|
34
|
+
/**
|
|
35
|
+
* 사용자 상호작용에 의한 닫기 트리거 목록, 어트리뷰트는 쉼표로 구분된 배열 형태입니다.
|
|
36
|
+
*
|
|
37
|
+
* @default
|
|
38
|
+
* ['escape', 'backdrop', 'button']
|
|
39
|
+
*/
|
|
40
|
+
closeOn: CloseOnPolicy[];
|
|
41
|
+
/** focus trap 인스턴스 (modal일 때만 사용) */
|
|
42
|
+
private focusTrap?;
|
|
43
|
+
/** modal이고 contained가 아닌 경우에만 body scroll lock */
|
|
44
|
+
private get shouldLockBody();
|
|
45
|
+
connectedCallback(): void;
|
|
46
|
+
disconnectedCallback(): void;
|
|
47
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
48
|
+
/**
|
|
49
|
+
* 오버레이를 표시합니다. u-show 이벤트가 취소되면 열리지 않습니다.
|
|
50
|
+
*/
|
|
51
|
+
show(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 오버레이를 숨깁니다. u-hide 이벤트가 취소되면 닫히지 않습니다.
|
|
54
|
+
*/
|
|
55
|
+
hide(): boolean;
|
|
56
|
+
/** closeOn 정책에 따라 닫기를 시도합니다. */
|
|
57
|
+
requestClose(source: string): void;
|
|
58
|
+
/** 오버레이가 열릴 때 설정을 적용합니다. */
|
|
59
|
+
private setup;
|
|
60
|
+
/** 오버레이가 닫힐 때 설정을 해제합니다. */
|
|
61
|
+
private cleanup;
|
|
62
|
+
/** host 자체를 클릭한 경우(백드롭)만 닫기 요청 */
|
|
63
|
+
private handlePointerdown;
|
|
64
|
+
/** ESC 키 입력 시 닫기 요청 (최상위 오버레이에 대해서만) */
|
|
65
|
+
private handleWindowKeydown;
|
|
66
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { UElement } from "./UElement.js";
|
|
2
|
+
import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
3
|
+
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
4
|
+
import { OverlayManager } from "../utilities/OverlayManager.js";
|
|
5
|
+
import { arrayAttrConverter } from "../utilities/converters.js";
|
|
6
|
+
import { styles } from "./UOverlayElement.styles.js";
|
|
7
|
+
import { property } from "lit/decorators.js";
|
|
8
|
+
import { createFocusTrap } from "focus-trap";
|
|
9
|
+
//#region src/components/UOverlayElement.ts
|
|
10
|
+
/**
|
|
11
|
+
* UOverlayElement는 다이얼로그, 드로어 등 화면에 오버레이로 표시되는 엘리먼트의 기본 클래스입니다.
|
|
12
|
+
*/
|
|
13
|
+
var UOverlayElement = class extends UElement {
|
|
14
|
+
constructor(..._args) {
|
|
15
|
+
super(..._args);
|
|
16
|
+
this.open = false;
|
|
17
|
+
this.contained = false;
|
|
18
|
+
this.mode = "modal";
|
|
19
|
+
this.closeOn = [
|
|
20
|
+
"escape",
|
|
21
|
+
"backdrop",
|
|
22
|
+
"button"
|
|
23
|
+
];
|
|
24
|
+
this.handlePointerdown = (e) => {
|
|
25
|
+
if (e.composedPath()[0] === this) this.requestClose("backdrop");
|
|
26
|
+
};
|
|
27
|
+
this.handleWindowKeydown = (e) => {
|
|
28
|
+
if (!this.open || e.key !== "Escape") return;
|
|
29
|
+
if (!OverlayManager.isTopmost(this)) return;
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
this.requestClose("escape");
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static {
|
|
35
|
+
this.styles = [super.styles, styles];
|
|
36
|
+
}
|
|
37
|
+
/** modal이고 contained가 아닌 경우에만 body scroll lock */
|
|
38
|
+
get shouldLockBody() {
|
|
39
|
+
return this.mode === "modal" && !this.contained;
|
|
40
|
+
}
|
|
41
|
+
connectedCallback() {
|
|
42
|
+
super.connectedCallback();
|
|
43
|
+
this.setAttribute("tabindex", "-1");
|
|
44
|
+
}
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
this.cleanup();
|
|
47
|
+
super.disconnectedCallback();
|
|
48
|
+
}
|
|
49
|
+
updated(changedProperties) {
|
|
50
|
+
super.updated(changedProperties);
|
|
51
|
+
if (changedProperties.has("open")) this.open ? this.setup() : this.cleanup();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 오버레이를 표시합니다. u-show 이벤트가 취소되면 열리지 않습니다.
|
|
55
|
+
*/
|
|
56
|
+
show() {
|
|
57
|
+
if (this.open) return true;
|
|
58
|
+
if (this.fire("show")) {
|
|
59
|
+
this.open = true;
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 오버레이를 숨깁니다. u-hide 이벤트가 취소되면 닫히지 않습니다.
|
|
66
|
+
*/
|
|
67
|
+
hide() {
|
|
68
|
+
if (!this.open) return true;
|
|
69
|
+
if (this.fire("hide")) {
|
|
70
|
+
this.open = false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
/** closeOn 정책에 따라 닫기를 시도합니다. */
|
|
76
|
+
requestClose(source) {
|
|
77
|
+
if (this.closeOn.includes(source)) this.hide();
|
|
78
|
+
}
|
|
79
|
+
/** 오버레이가 열릴 때 설정을 적용합니다. */
|
|
80
|
+
setup() {
|
|
81
|
+
OverlayManager.add(this, this.shouldLockBody);
|
|
82
|
+
window.addEventListener("keydown", this.handleWindowKeydown);
|
|
83
|
+
this.addEventListener("pointerdown", this.handlePointerdown);
|
|
84
|
+
if (this.mode === "modal") {
|
|
85
|
+
if (!this.focusTrap) this.focusTrap = createFocusTrap(this, {
|
|
86
|
+
escapeDeactivates: false,
|
|
87
|
+
clickOutsideDeactivates: false,
|
|
88
|
+
allowOutsideClick: true,
|
|
89
|
+
fallbackFocus: this,
|
|
90
|
+
trapStack: OverlayManager.trapStack,
|
|
91
|
+
tabbableOptions: { getShadowRoot: true }
|
|
92
|
+
});
|
|
93
|
+
this.focusTrap.activate();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** 오버레이가 닫힐 때 설정을 해제합니다. */
|
|
97
|
+
cleanup() {
|
|
98
|
+
this.focusTrap?.deactivate();
|
|
99
|
+
window.removeEventListener("keydown", this.handleWindowKeydown);
|
|
100
|
+
this.removeEventListener("pointerdown", this.handlePointerdown);
|
|
101
|
+
OverlayManager.remove(this, this.shouldLockBody);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
__decorate([property({
|
|
105
|
+
type: Boolean,
|
|
106
|
+
reflect: true
|
|
107
|
+
}), __decorateMetadata("design:type", Boolean)], UOverlayElement.prototype, "open", void 0);
|
|
108
|
+
__decorate([property({
|
|
109
|
+
type: Boolean,
|
|
110
|
+
reflect: true
|
|
111
|
+
}), __decorateMetadata("design:type", Boolean)], UOverlayElement.prototype, "contained", void 0);
|
|
112
|
+
__decorate([property({
|
|
113
|
+
type: String,
|
|
114
|
+
reflect: true
|
|
115
|
+
}), __decorateMetadata("design:type", Object)], UOverlayElement.prototype, "mode", void 0);
|
|
116
|
+
__decorate([property({
|
|
117
|
+
type: Array,
|
|
118
|
+
reflect: true,
|
|
119
|
+
attribute: "close-on",
|
|
120
|
+
converter: arrayAttrConverter()
|
|
121
|
+
}), __decorateMetadata("design:type", Array)], UOverlayElement.prototype, "closeOn", void 0);
|
|
122
|
+
//#endregion
|
|
123
|
+
export { UOverlayElement };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import('lit').CSSResult;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/UOverlayElement.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
|
+
:host {
|
|
5
|
+
position: fixed;
|
|
6
|
+
z-index: 9999;
|
|
7
|
+
inset: 0;
|
|
8
|
+
display: flex;
|
|
9
|
+
background: var(--u-overlay-bg-color, rgba(0, 0, 0, 0.4));
|
|
10
|
+
|
|
11
|
+
opacity: 0;
|
|
12
|
+
visibility: hidden;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
transition: opacity 0.2s ease, visibility 0s 0.2s;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
}
|
|
17
|
+
:host([open]) {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
visibility: visible;
|
|
20
|
+
pointer-events: auto;
|
|
21
|
+
transition-delay: 0s;
|
|
22
|
+
}
|
|
23
|
+
:host([contained]) {
|
|
24
|
+
position: absolute;
|
|
25
|
+
}
|
|
26
|
+
:host([mode="non-modal"]) {
|
|
27
|
+
background: transparent;
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
}
|
|
30
|
+
:host([mode="non-modal"][open]) {
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { styles };
|