@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
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import { queryAssignedElements, property } from 'lit/decorators.js';
|
|
3
|
-
import { FloatingElement } from '../FloatingElement.js';
|
|
4
|
-
import { UMenuItem } from '../menu-item/UMenuItem.component.js';
|
|
5
|
-
import { styles } from './UMenu.styles.js';
|
|
6
|
-
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
9
|
-
var result = void 0 ;
|
|
10
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11
|
-
if (decorator = decorators[i])
|
|
12
|
-
result = (decorator(target, key, result) ) || result;
|
|
13
|
-
if (result) __defProp(target, key, result);
|
|
14
|
-
return result;
|
|
15
|
-
};
|
|
16
|
-
class UMenu extends FloatingElement {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.type = "default";
|
|
20
|
-
this.mode = "none";
|
|
21
|
-
/**
|
|
22
|
-
* 특정 인덱스의 아이템에 포커스 (기본: 첫 번째)
|
|
23
|
-
* @param index 인덱스 (음수 가능)
|
|
24
|
-
*/
|
|
25
|
-
this.focusAt = async (index = 0) => {
|
|
26
|
-
await this.updateComplete;
|
|
27
|
-
const items = this.getItems("enabled");
|
|
28
|
-
const length = items.length;
|
|
29
|
-
if (length === 0) return;
|
|
30
|
-
index = index < 0 ? Math.max(0, length + index) : Math.min(index, length - 1);
|
|
31
|
-
const item = items[index];
|
|
32
|
-
if (item.disabled) return;
|
|
33
|
-
item.focus();
|
|
34
|
-
};
|
|
35
|
-
//#region 기본 이벤트 핸들러
|
|
36
|
-
this.handleClick = async (e) => {
|
|
37
|
-
const item = e.target;
|
|
38
|
-
if (!(item instanceof UMenuItem)) return;
|
|
39
|
-
if (item.disabled) return;
|
|
40
|
-
if (item.submenu) return;
|
|
41
|
-
const items = this.getItems("enabled");
|
|
42
|
-
if (!items.includes(item)) return;
|
|
43
|
-
const value = item.value || "";
|
|
44
|
-
if (this.mode === "single") {
|
|
45
|
-
for (const i of items) {
|
|
46
|
-
i.selected = i === item;
|
|
47
|
-
}
|
|
48
|
-
if (this.type !== "default") {
|
|
49
|
-
this.hide();
|
|
50
|
-
}
|
|
51
|
-
} else if (this.mode === "multiple") {
|
|
52
|
-
item.checked = !item.checked;
|
|
53
|
-
} else {
|
|
54
|
-
if (this.type !== "default") {
|
|
55
|
-
this.hide();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
this.emit("u-select", { value });
|
|
59
|
-
};
|
|
60
|
-
this.handleKeydown = async (e) => {
|
|
61
|
-
const item = e.target;
|
|
62
|
-
if (!(item instanceof UMenuItem)) return;
|
|
63
|
-
if (item.disabled) return;
|
|
64
|
-
const items = this.getItems("enabled");
|
|
65
|
-
if (!items.includes(item)) return;
|
|
66
|
-
const currentIndex = items.findIndex((i) => i === item);
|
|
67
|
-
let nextIndex;
|
|
68
|
-
switch (e.key) {
|
|
69
|
-
case "Enter":
|
|
70
|
-
case " ":
|
|
71
|
-
e.preventDefault();
|
|
72
|
-
item.click();
|
|
73
|
-
break;
|
|
74
|
-
case "Home":
|
|
75
|
-
e.preventDefault();
|
|
76
|
-
await this.focusAt(0);
|
|
77
|
-
break;
|
|
78
|
-
case "End":
|
|
79
|
-
e.preventDefault();
|
|
80
|
-
await this.focusAt(items.length - 1);
|
|
81
|
-
break;
|
|
82
|
-
case "ArrowDown":
|
|
83
|
-
e.preventDefault();
|
|
84
|
-
nextIndex = (currentIndex + 1) % items.length;
|
|
85
|
-
await this.focusAt(nextIndex);
|
|
86
|
-
break;
|
|
87
|
-
case "ArrowUp":
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
nextIndex = currentIndex - 1 < 0 ? items.length - 1 : currentIndex - 1;
|
|
90
|
-
await this.focusAt(nextIndex);
|
|
91
|
-
break;
|
|
92
|
-
case "ArrowLeft":
|
|
93
|
-
if (this.type === "submenu") {
|
|
94
|
-
e.preventDefault();
|
|
95
|
-
e.stopPropagation();
|
|
96
|
-
await this.hide();
|
|
97
|
-
if (this.target instanceof HTMLElement) {
|
|
98
|
-
this.target.focus();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
break;
|
|
102
|
-
case "ArrowRight":
|
|
103
|
-
if (item.submenu) {
|
|
104
|
-
e.preventDefault();
|
|
105
|
-
e.stopPropagation();
|
|
106
|
-
await item.submenu.show(item);
|
|
107
|
-
await item.submenu.focusAt(0);
|
|
108
|
-
}
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
//#endregion
|
|
113
|
-
//#region 공용 이벤트 핸들러
|
|
114
|
-
this.handleWindowFocusOut = async (_) => {
|
|
115
|
-
await this.hide();
|
|
116
|
-
};
|
|
117
|
-
this.handleWindowKeydown = async (e) => {
|
|
118
|
-
if (e.key === "Escape") {
|
|
119
|
-
await this.hide();
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
this.handleWindowPointerDown = async (e) => {
|
|
123
|
-
if (this.type === "contextmenu") {
|
|
124
|
-
const targets = e.composedPath().filter((v) => v instanceof HTMLElement);
|
|
125
|
-
for (const target of targets) {
|
|
126
|
-
if (this.contains(target)) return;
|
|
127
|
-
}
|
|
128
|
-
await this.hide();
|
|
129
|
-
} else if (this.type === "dropdown") {
|
|
130
|
-
const currentTarget = this.target;
|
|
131
|
-
if (!currentTarget || !(currentTarget instanceof HTMLElement)) return;
|
|
132
|
-
const targets = e.composedPath().filter((v) => v instanceof HTMLElement);
|
|
133
|
-
for (const target of targets) {
|
|
134
|
-
if (this.contains(target) || currentTarget.contains(target)) return;
|
|
135
|
-
}
|
|
136
|
-
await this.hide();
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
//#endregion
|
|
140
|
-
//#region 'dropdown' 이벤트 핸들러
|
|
141
|
-
this.handleAnchorPointerDown = async (e) => {
|
|
142
|
-
if (e.button !== 0) return;
|
|
143
|
-
const target = e.currentTarget;
|
|
144
|
-
if (this.visible && this.target === target)
|
|
145
|
-
await this.hide();
|
|
146
|
-
else
|
|
147
|
-
await this.show(target);
|
|
148
|
-
};
|
|
149
|
-
this.handleAnchorKeydown = async (e) => {
|
|
150
|
-
if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
|
|
151
|
-
e.preventDefault();
|
|
152
|
-
const target = e.currentTarget;
|
|
153
|
-
if (this.visible) return;
|
|
154
|
-
await this.show(target);
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region 'contextmenu' 이벤트 핸들러
|
|
159
|
-
this.handleAnchorContextMenu = async (e) => {
|
|
160
|
-
e.preventDefault();
|
|
161
|
-
await this.hide();
|
|
162
|
-
const virtual = {
|
|
163
|
-
getBoundingClientRect: () => ({
|
|
164
|
-
x: e.clientX,
|
|
165
|
-
y: e.clientY,
|
|
166
|
-
left: e.clientX,
|
|
167
|
-
top: e.clientY,
|
|
168
|
-
right: e.clientX,
|
|
169
|
-
bottom: e.clientY,
|
|
170
|
-
width: 0,
|
|
171
|
-
height: 0
|
|
172
|
-
})
|
|
173
|
-
};
|
|
174
|
-
await this.show(virtual, false);
|
|
175
|
-
};
|
|
176
|
-
//#endregion
|
|
177
|
-
//#region 'submenu' 이벤트 핸들러
|
|
178
|
-
this.handleSubmenuAnchorPointerEnter = (e) => {
|
|
179
|
-
const target = e.currentTarget;
|
|
180
|
-
if (target?.disabled) return;
|
|
181
|
-
this.show(target);
|
|
182
|
-
};
|
|
183
|
-
this.handleSubmenuAnchorPointerLeave = (e) => {
|
|
184
|
-
const related = e.relatedTarget;
|
|
185
|
-
if (related) {
|
|
186
|
-
const target = this.target;
|
|
187
|
-
if (target?.contains(related) || this.contains(related)) return;
|
|
188
|
-
}
|
|
189
|
-
this.hide();
|
|
190
|
-
};
|
|
191
|
-
this.handleSubmenuAnchorFocusIn = (e) => {
|
|
192
|
-
const target = e.currentTarget;
|
|
193
|
-
if (target?.disabled) return;
|
|
194
|
-
this.show(target);
|
|
195
|
-
};
|
|
196
|
-
this.handleSubmenuAnchorFocusOut = (e) => {
|
|
197
|
-
const related = e.relatedTarget;
|
|
198
|
-
if (related) {
|
|
199
|
-
const target = this.target;
|
|
200
|
-
if (target?.contains(related) || this.contains(related)) return;
|
|
201
|
-
}
|
|
202
|
-
this.hide();
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
static {
|
|
206
|
-
this.styles = [super.styles, styles];
|
|
207
|
-
}
|
|
208
|
-
static {
|
|
209
|
-
this.dependencies = {};
|
|
210
|
-
}
|
|
211
|
-
connectedCallback() {
|
|
212
|
-
super.connectedCallback();
|
|
213
|
-
this.addEventListener("click", this.handleClick);
|
|
214
|
-
this.addEventListener("keydown", this.handleKeydown);
|
|
215
|
-
}
|
|
216
|
-
disconnectedCallback() {
|
|
217
|
-
this.removeEventListener("click", this.handleClick);
|
|
218
|
-
this.removeEventListener("keydown", this.handleKeydown);
|
|
219
|
-
super.disconnectedCallback();
|
|
220
|
-
}
|
|
221
|
-
willUpdate(changedProperties) {
|
|
222
|
-
super.willUpdate(changedProperties);
|
|
223
|
-
if (changedProperties.has("anchors") || changedProperties.has("type")) {
|
|
224
|
-
const oldType = changedProperties.get("type") || "default";
|
|
225
|
-
const newType = this.type || "default";
|
|
226
|
-
const oldAnchors = changedProperties.get("anchors");
|
|
227
|
-
const newAnchors = this.anchors;
|
|
228
|
-
if (oldAnchors) this.unbind(oldType, oldAnchors);
|
|
229
|
-
if (newAnchors) this.bind(newType, newAnchors);
|
|
230
|
-
}
|
|
231
|
-
if (changedProperties.has("mode")) {
|
|
232
|
-
this.clearAll();
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
render() {
|
|
236
|
-
return html`<slot></slot>`;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* 모든 아이템들의 선택 상태를 해제합니다
|
|
240
|
-
* 재귀적으로 서브메뉴의 아이템들도 해제됩니다.
|
|
241
|
-
*/
|
|
242
|
-
clearAll() {
|
|
243
|
-
const items = this.getItems("all");
|
|
244
|
-
for (const item of items) {
|
|
245
|
-
item.selected = false;
|
|
246
|
-
item.checked = false;
|
|
247
|
-
if (item.submenu) {
|
|
248
|
-
item.submenu.clearAll();
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* 조건에 맞는 메뉴 아이템들을 반환합니다
|
|
254
|
-
*
|
|
255
|
-
* @param filter - 필터 조건입니다
|
|
256
|
-
* @return 조건에 맞는 아이템들의 배열입니다
|
|
257
|
-
*/
|
|
258
|
-
getItems(filter = "all") {
|
|
259
|
-
const items = this.items?.filter((item) => item instanceof UMenuItem) || [];
|
|
260
|
-
switch (filter) {
|
|
261
|
-
case "all":
|
|
262
|
-
return items;
|
|
263
|
-
case "enabled":
|
|
264
|
-
return items.filter((item) => !item.disabled);
|
|
265
|
-
case "disabled":
|
|
266
|
-
return items.filter((item) => item.disabled);
|
|
267
|
-
case "selected":
|
|
268
|
-
return items.filter((item) => item.selected);
|
|
269
|
-
case "unselected":
|
|
270
|
-
return items.filter((item) => !item.selected);
|
|
271
|
-
case "checked":
|
|
272
|
-
return items.filter((item) => item.checked);
|
|
273
|
-
case "unchecked":
|
|
274
|
-
return items.filter((item) => !item.checked);
|
|
275
|
-
default:
|
|
276
|
-
return [];
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
/** 앵커에 이벤트 바인딩 */
|
|
280
|
-
bind(type, anchors) {
|
|
281
|
-
if (type === "dropdown") {
|
|
282
|
-
this.visible = false;
|
|
283
|
-
this.placement ||= "bottom-start";
|
|
284
|
-
for (const anchor of anchors) {
|
|
285
|
-
anchor.addEventListener("pointerdown", this.handleAnchorPointerDown);
|
|
286
|
-
anchor.addEventListener("keydown", this.handleAnchorKeydown);
|
|
287
|
-
}
|
|
288
|
-
} else if (type === "contextmenu") {
|
|
289
|
-
this.visible = false;
|
|
290
|
-
this.placement ||= "bottom-start";
|
|
291
|
-
for (const anchor of anchors) {
|
|
292
|
-
anchor.addEventListener("contextmenu", this.handleAnchorContextMenu);
|
|
293
|
-
}
|
|
294
|
-
} else if (type === "submenu") {
|
|
295
|
-
this.visible = false;
|
|
296
|
-
this.placement ||= "right-start";
|
|
297
|
-
for (const anchor of anchors) {
|
|
298
|
-
anchor.addEventListener("pointerenter", this.handleSubmenuAnchorPointerEnter);
|
|
299
|
-
anchor.addEventListener("pointerleave", this.handleSubmenuAnchorPointerLeave);
|
|
300
|
-
anchor.addEventListener("focusin", this.handleSubmenuAnchorFocusIn);
|
|
301
|
-
anchor.addEventListener("focusout", this.handleSubmenuAnchorFocusOut);
|
|
302
|
-
}
|
|
303
|
-
} else {
|
|
304
|
-
this.visible = true;
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
window.addEventListener("focusout", this.handleWindowFocusOut);
|
|
308
|
-
window.addEventListener("keydown", this.handleWindowKeydown);
|
|
309
|
-
window.addEventListener("pointerdown", this.handleWindowPointerDown);
|
|
310
|
-
}
|
|
311
|
-
/** 앵커에서 이벤트 바인딩 해제 */
|
|
312
|
-
unbind(_, anchors) {
|
|
313
|
-
window.removeEventListener("focusout", this.handleWindowFocusOut);
|
|
314
|
-
window.removeEventListener("keydown", this.handleWindowKeydown);
|
|
315
|
-
window.removeEventListener("pointerdown", this.handleWindowPointerDown);
|
|
316
|
-
for (const anchor of anchors) {
|
|
317
|
-
anchor.removeEventListener("pointerdown", this.handleAnchorPointerDown);
|
|
318
|
-
anchor.removeEventListener("keydown", this.handleAnchorKeydown);
|
|
319
|
-
anchor.removeEventListener("contextmenu", this.handleAnchorContextMenu);
|
|
320
|
-
anchor.removeEventListener("pointerenter", this.handleSubmenuAnchorPointerEnter);
|
|
321
|
-
anchor.removeEventListener("pointerleave", this.handleSubmenuAnchorPointerLeave);
|
|
322
|
-
anchor.removeEventListener("focusin", this.handleSubmenuAnchorFocusIn);
|
|
323
|
-
anchor.removeEventListener("focusout", this.handleSubmenuAnchorFocusOut);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
//#endregion
|
|
327
|
-
}
|
|
328
|
-
__decorateClass([
|
|
329
|
-
queryAssignedElements({ flatten: false })
|
|
330
|
-
], UMenu.prototype, "items");
|
|
331
|
-
__decorateClass([
|
|
332
|
-
property({ type: String, reflect: true })
|
|
333
|
-
], UMenu.prototype, "type");
|
|
334
|
-
__decorateClass([
|
|
335
|
-
property({ type: String, reflect: true })
|
|
336
|
-
], UMenu.prototype, "mode");
|
|
337
|
-
|
|
338
|
-
export { UMenu };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { PropertyValues } from 'lit';
|
|
2
|
-
import { BaseElement } from '../BaseElement.js';
|
|
3
|
-
import { UMenu } from '../menu/UMenu.component.js';
|
|
4
|
-
export declare class UMenuItem extends BaseElement {
|
|
5
|
-
static styles: import('lit').CSSResultGroup[];
|
|
6
|
-
static dependencies: Record<string, typeof BaseElement>;
|
|
7
|
-
/** 서브메뉴 요소 */
|
|
8
|
-
submenu: UMenu | null;
|
|
9
|
-
/** 비활성화 여부 @default false */
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
/** 로딩 상태 @default false */
|
|
12
|
-
loading: boolean;
|
|
13
|
-
/** 선택 여부(multiple mode) @default false */
|
|
14
|
-
checked: boolean;
|
|
15
|
-
/** 선택 여부(single mode) @default false */
|
|
16
|
-
selected: boolean;
|
|
17
|
-
/** 메뉴 아이템 값 */
|
|
18
|
-
value?: string;
|
|
19
|
-
protected updated(changedProperties: PropertyValues): void;
|
|
20
|
-
render(): import('lit-html').TemplateResult<1>;
|
|
21
|
-
/** 기본 슬롯 변경 감지 */
|
|
22
|
-
private handleSlotChange;
|
|
23
|
-
/** submenu 슬롯 변경 감지 */
|
|
24
|
-
private handleSubmenuSlotChange;
|
|
25
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import { state, property } from 'lit/decorators.js';
|
|
3
|
-
import { BaseElement } from '../BaseElement.js';
|
|
4
|
-
import { UIcon } from '../icon/UIcon.component.js';
|
|
5
|
-
import { UMenu } from '../menu/UMenu.component.js';
|
|
6
|
-
import { USpinner } from '../spinner/USpinner.component.js';
|
|
7
|
-
import { styles } from './UMenuItem.styles.js';
|
|
8
|
-
|
|
9
|
-
var __defProp = Object.defineProperty;
|
|
10
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
11
|
-
var result = void 0 ;
|
|
12
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
-
if (decorator = decorators[i])
|
|
14
|
-
result = (decorator(target, key, result) ) || result;
|
|
15
|
-
if (result) __defProp(target, key, result);
|
|
16
|
-
return result;
|
|
17
|
-
};
|
|
18
|
-
class UMenuItem extends BaseElement {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.submenu = null;
|
|
22
|
-
this.disabled = false;
|
|
23
|
-
this.loading = false;
|
|
24
|
-
this.checked = false;
|
|
25
|
-
this.selected = false;
|
|
26
|
-
/** 기본 슬롯 변경 감지 */
|
|
27
|
-
this.handleSlotChange = (e) => {
|
|
28
|
-
const slot = e.target;
|
|
29
|
-
const elements = slot.assignedElements({ flatten: true });
|
|
30
|
-
const menu = elements.find((el) => el instanceof UMenu);
|
|
31
|
-
menu?.setAttribute("slot", "submenu");
|
|
32
|
-
};
|
|
33
|
-
/** submenu 슬롯 변경 감지 */
|
|
34
|
-
this.handleSubmenuSlotChange = (e) => {
|
|
35
|
-
const slot = e.target;
|
|
36
|
-
const elements = slot.assignedElements({ flatten: true });
|
|
37
|
-
const menu = elements.find((el) => el instanceof UMenu);
|
|
38
|
-
if (menu) {
|
|
39
|
-
menu.type = "submenu";
|
|
40
|
-
menu.anchors = [this];
|
|
41
|
-
this.submenu = menu;
|
|
42
|
-
} else {
|
|
43
|
-
this.submenu = null;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
static {
|
|
48
|
-
this.styles = [super.styles, styles];
|
|
49
|
-
}
|
|
50
|
-
static {
|
|
51
|
-
this.dependencies = {
|
|
52
|
-
"u-icon": UIcon,
|
|
53
|
-
"u-spinner": USpinner
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
updated(changedProperties) {
|
|
57
|
-
super.updated(changedProperties);
|
|
58
|
-
if (changedProperties.has("disabled")) {
|
|
59
|
-
this.setAttribute("tabindex", this.disabled ? "-1" : "0");
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
render() {
|
|
63
|
-
return html`
|
|
64
|
-
<u-icon class="prefix icon"
|
|
65
|
-
?hidden=${!this.checked}
|
|
66
|
-
lib="internal"
|
|
67
|
-
name="check"
|
|
68
|
-
></u-icon>
|
|
69
|
-
|
|
70
|
-
<u-spinner class="prefix icon"
|
|
71
|
-
?hidden=${!this.loading}
|
|
72
|
-
></u-spinner>
|
|
73
|
-
|
|
74
|
-
<slot name="prefix"></slot>
|
|
75
|
-
|
|
76
|
-
<span class="label">
|
|
77
|
-
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
78
|
-
</span>
|
|
79
|
-
|
|
80
|
-
<slot name="suffix"></slot>
|
|
81
|
-
|
|
82
|
-
<u-icon class="suffix icon"
|
|
83
|
-
?hidden=${this.submenu === null}
|
|
84
|
-
lib="internal"
|
|
85
|
-
name="chevron-right"
|
|
86
|
-
></u-icon>
|
|
87
|
-
|
|
88
|
-
<slot name="submenu" @slotchange=${this.handleSubmenuSlotChange}></slot>
|
|
89
|
-
`;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
__decorateClass([
|
|
93
|
-
state()
|
|
94
|
-
], UMenuItem.prototype, "submenu");
|
|
95
|
-
__decorateClass([
|
|
96
|
-
property({ type: Boolean, reflect: true })
|
|
97
|
-
], UMenuItem.prototype, "disabled");
|
|
98
|
-
__decorateClass([
|
|
99
|
-
property({ type: Boolean, reflect: true })
|
|
100
|
-
], UMenuItem.prototype, "loading");
|
|
101
|
-
__decorateClass([
|
|
102
|
-
property({ type: Boolean, reflect: true })
|
|
103
|
-
], UMenuItem.prototype, "checked");
|
|
104
|
-
__decorateClass([
|
|
105
|
-
property({ type: Boolean, reflect: true })
|
|
106
|
-
], UMenuItem.prototype, "selected");
|
|
107
|
-
__decorateClass([
|
|
108
|
-
property({ type: String })
|
|
109
|
-
], UMenuItem.prototype, "value");
|
|
110
|
-
|
|
111
|
-
export { UMenuItem };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { PropertyValues } from 'lit';
|
|
2
|
-
import { BaseElement } from '../BaseElement.js';
|
|
3
|
-
/**
|
|
4
|
-
* ProgressBar 컴포넌트는 진행 상태를 시각적으로 표시합니다.
|
|
5
|
-
* 로딩 상태나 작업 진행률을 표시하는데 사용됩니다.
|
|
6
|
-
*/
|
|
7
|
-
export declare class UProgressBar extends BaseElement {
|
|
8
|
-
static styles: import('lit').CSSResultGroup[];
|
|
9
|
-
static dependencies: Record<string, typeof BaseElement>;
|
|
10
|
-
indicatorEl: HTMLElement;
|
|
11
|
-
/** 내부 진행 상태 */
|
|
12
|
-
progressState: 'turned-on' | 'turned-off' | 'determinate' | 'indeterminate';
|
|
13
|
-
/** 내부 진행 상태 (0과 1 사이 값) */
|
|
14
|
-
progress: number;
|
|
15
|
-
/** 불확정 상태 (로딩 애니메이션 표시) */
|
|
16
|
-
indeterminate: boolean;
|
|
17
|
-
/** 최소값 (기본값: 0) */
|
|
18
|
-
minValue: number;
|
|
19
|
-
/** 최대값 (기본값: 100) */
|
|
20
|
-
maxValue: number;
|
|
21
|
-
/** 현재값 */
|
|
22
|
-
value: number;
|
|
23
|
-
protected willUpdate(changedProperties: PropertyValues): void;
|
|
24
|
-
render(): import('lit-html').TemplateResult<1>;
|
|
25
|
-
/** 내부 진행 상태 업데이트 */
|
|
26
|
-
private updateProgressState;
|
|
27
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import { query, state, property } from 'lit/decorators.js';
|
|
3
|
-
import { BaseElement } from '../BaseElement.js';
|
|
4
|
-
import { styles } from './UProgressBar.styles.js';
|
|
5
|
-
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
-
var result = void 0 ;
|
|
9
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
-
if (decorator = decorators[i])
|
|
11
|
-
result = (decorator(target, key, result) ) || result;
|
|
12
|
-
if (result) __defProp(target, key, result);
|
|
13
|
-
return result;
|
|
14
|
-
};
|
|
15
|
-
class UProgressBar extends BaseElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.progressState = "turned-on";
|
|
19
|
-
this.progress = 0;
|
|
20
|
-
this.indeterminate = false;
|
|
21
|
-
this.minValue = 0;
|
|
22
|
-
this.maxValue = 100;
|
|
23
|
-
this.value = 0;
|
|
24
|
-
}
|
|
25
|
-
static {
|
|
26
|
-
this.styles = [super.styles, styles];
|
|
27
|
-
}
|
|
28
|
-
static {
|
|
29
|
-
this.dependencies = {};
|
|
30
|
-
}
|
|
31
|
-
willUpdate(changedProperties) {
|
|
32
|
-
super.willUpdate(changedProperties);
|
|
33
|
-
if (changedProperties.has("indeterminate")) {
|
|
34
|
-
this.progressState = this.indeterminate ? "indeterminate" : "turned-on";
|
|
35
|
-
}
|
|
36
|
-
if (changedProperties.has("minValue") || changedProperties.has("maxValue") || changedProperties.has("value")) {
|
|
37
|
-
this.updateProgressState();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
render() {
|
|
41
|
-
return html`
|
|
42
|
-
<div class="indicator" part="indicator"
|
|
43
|
-
state=${this.progressState}
|
|
44
|
-
></div>
|
|
45
|
-
<div class="content" part="content">
|
|
46
|
-
<slot></slot>
|
|
47
|
-
</div>
|
|
48
|
-
`;
|
|
49
|
-
}
|
|
50
|
-
/** 내부 진행 상태 업데이트 */
|
|
51
|
-
async updateProgressState() {
|
|
52
|
-
await this.updateComplete;
|
|
53
|
-
if (this.indeterminate) return;
|
|
54
|
-
const range = this.maxValue - this.minValue;
|
|
55
|
-
const clampedValue = Math.max(this.minValue, Math.min(this.maxValue, this.value));
|
|
56
|
-
const progress = range === 0 ? 0 : (clampedValue - this.minValue) / range;
|
|
57
|
-
if (isNaN(progress)) return;
|
|
58
|
-
if (this.progress <= 0 || progress < this.progress) {
|
|
59
|
-
this.progressState = "turned-on";
|
|
60
|
-
await this.updateComplete;
|
|
61
|
-
this.progressState = "determinate";
|
|
62
|
-
}
|
|
63
|
-
if (this.progressState === "determinate") {
|
|
64
|
-
this.indicatorEl.style.setProperty("--progress-value", progress.toString());
|
|
65
|
-
}
|
|
66
|
-
if (progress >= 1) {
|
|
67
|
-
setTimeout(() => {
|
|
68
|
-
this.progressState = "turned-off";
|
|
69
|
-
setTimeout(() => {
|
|
70
|
-
this.progressState = "turned-on";
|
|
71
|
-
}, 500);
|
|
72
|
-
}, 300);
|
|
73
|
-
}
|
|
74
|
-
this.progress = progress;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
__decorateClass([
|
|
78
|
-
query(".indicator")
|
|
79
|
-
], UProgressBar.prototype, "indicatorEl");
|
|
80
|
-
__decorateClass([
|
|
81
|
-
state()
|
|
82
|
-
], UProgressBar.prototype, "progressState");
|
|
83
|
-
__decorateClass([
|
|
84
|
-
state()
|
|
85
|
-
], UProgressBar.prototype, "progress");
|
|
86
|
-
__decorateClass([
|
|
87
|
-
property({ type: Boolean, reflect: true })
|
|
88
|
-
], UProgressBar.prototype, "indeterminate");
|
|
89
|
-
__decorateClass([
|
|
90
|
-
property({ type: Number })
|
|
91
|
-
], UProgressBar.prototype, "minValue");
|
|
92
|
-
__decorateClass([
|
|
93
|
-
property({ type: Number })
|
|
94
|
-
], UProgressBar.prototype, "maxValue");
|
|
95
|
-
__decorateClass([
|
|
96
|
-
property({ type: Number })
|
|
97
|
-
], UProgressBar.prototype, "value");
|
|
98
|
-
|
|
99
|
-
export { UProgressBar };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { PropertyValues } from 'lit';
|
|
2
|
-
import { BaseElement } from '../BaseElement.js';
|
|
3
|
-
/** 원형 진행 표시기의 변형 타입 */
|
|
4
|
-
export type ProgressRingVariant = 'smooth' | 'blocks' | 'ticks';
|
|
5
|
-
/**
|
|
6
|
-
* ProgressRing 컴포넌트는 원형 진행 표시기를 제공합니다.
|
|
7
|
-
* 진행 상태를 시각적으로 나타내며, 크기와 두께를 스타일 속성으로 조절할 수 있습니다.
|
|
8
|
-
*/
|
|
9
|
-
export declare class UProgressRing extends BaseElement {
|
|
10
|
-
static styles: import('lit').CSSResultGroup[];
|
|
11
|
-
static dependencies: Record<string, typeof BaseElement>;
|
|
12
|
-
dasharray: string;
|
|
13
|
-
progress: number;
|
|
14
|
-
/** 진행 표시기의 스타일 변형을 설정합니다. */
|
|
15
|
-
variant: ProgressRingVariant;
|
|
16
|
-
/** 진행 표시기의 최소값을 설정합니다. */
|
|
17
|
-
minValue: number;
|
|
18
|
-
/** 진행 표시기의 최대값을 설정합니다. */
|
|
19
|
-
maxValue: number;
|
|
20
|
-
/** 진행 표시기의 현재 값을 설정합니다. */
|
|
21
|
-
value: number;
|
|
22
|
-
protected willUpdate(changedProperties: PropertyValues): void;
|
|
23
|
-
render(): import('lit-html').TemplateResult<1>;
|
|
24
|
-
/**
|
|
25
|
-
* 진행 상태를 0과 1 사이의 값으로 반환합니다.
|
|
26
|
-
*/
|
|
27
|
-
private updateProgressState;
|
|
28
|
-
/**
|
|
29
|
-
* variant에 따라 dasharray 값을 반환합니다.
|
|
30
|
-
* [dash-length] [gap-length] or [dash-length] 형식
|
|
31
|
-
*/
|
|
32
|
-
private updateDashArray;
|
|
33
|
-
}
|