@eslamdevui/ui 3.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/ui/accordion.ts +20 -0
- package/.nuxt/ui/alert.ts +264 -0
- package/.nuxt/ui/avatar-group.ts +52 -0
- package/.nuxt/ui/avatar.ts +54 -0
- package/.nuxt/ui/badge.ts +263 -0
- package/.nuxt/ui/breadcrumb.ts +45 -0
- package/.nuxt/ui/button-group.ts +16 -0
- package/.nuxt/ui/button.ts +378 -0
- package/.nuxt/ui/calendar.ts +103 -0
- package/.nuxt/ui/card.ts +34 -0
- package/.nuxt/ui/carousel.ts +38 -0
- package/.nuxt/ui/chat-message.ts +129 -0
- package/.nuxt/ui/chat-messages.ts +14 -0
- package/.nuxt/ui/chat-prompt-submit.ts +5 -0
- package/.nuxt/ui/chat-prompt.ts +35 -0
- package/.nuxt/ui/checkbox-group.ts +204 -0
- package/.nuxt/ui/checkbox.ts +236 -0
- package/.nuxt/ui/chip.ts +96 -0
- package/.nuxt/ui/collapsible.ts +6 -0
- package/.nuxt/ui/color-picker.ts +47 -0
- package/.nuxt/ui/command-palette.ts +51 -0
- package/.nuxt/ui/container.ts +3 -0
- package/.nuxt/ui/content-navigation.ts +339 -0
- package/.nuxt/ui/content-search-button.ts +6 -0
- package/.nuxt/ui/content-search.ts +6 -0
- package/.nuxt/ui/content-surround.ts +34 -0
- package/.nuxt/ui/content-toc.ts +150 -0
- package/.nuxt/ui/context-menu.ts +217 -0
- package/.nuxt/ui/dashboard-group.ts +3 -0
- package/.nuxt/ui/dashboard-navbar.ts +21 -0
- package/.nuxt/ui/dashboard-panel.ts +17 -0
- package/.nuxt/ui/dashboard-resize-handle.ts +3 -0
- package/.nuxt/ui/dashboard-search-button.ts +6 -0
- package/.nuxt/ui/dashboard-search.ts +6 -0
- package/.nuxt/ui/dashboard-sidebar-collapse.ts +9 -0
- package/.nuxt/ui/dashboard-sidebar-toggle.ts +9 -0
- package/.nuxt/ui/dashboard-sidebar.ts +37 -0
- package/.nuxt/ui/drawer.ts +126 -0
- package/.nuxt/ui/dropdown-menu.ts +218 -0
- package/.nuxt/ui/form-field.ts +48 -0
- package/.nuxt/ui/form.ts +3 -0
- package/.nuxt/ui/index.ts +71 -0
- package/.nuxt/ui/input-menu.ts +450 -0
- package/.nuxt/ui/input-number.ts +245 -0
- package/.nuxt/ui/input-tags.ts +310 -0
- package/.nuxt/ui/input.ts +289 -0
- package/.nuxt/ui/kbd.ts +31 -0
- package/.nuxt/ui/link.ts +22 -0
- package/.nuxt/ui/modal.ts +29 -0
- package/.nuxt/ui/navigation-menu.ts +510 -0
- package/.nuxt/ui/pagination.ts +13 -0
- package/.nuxt/ui/pin-input.ts +171 -0
- package/.nuxt/ui/popover.ts +6 -0
- package/.nuxt/ui/progress.ts +297 -0
- package/.nuxt/ui/prose.ts +321 -0
- package/.nuxt/ui/radio-group.ts +350 -0
- package/.nuxt/ui/select-menu.ts +351 -0
- package/.nuxt/ui/select.ts +346 -0
- package/.nuxt/ui/separator.ts +172 -0
- package/.nuxt/ui/skeleton.ts +3 -0
- package/.nuxt/ui/slideover.ts +71 -0
- package/.nuxt/ui/slider.ts +171 -0
- package/.nuxt/ui/stepper.ts +202 -0
- package/.nuxt/ui/switch.ts +131 -0
- package/.nuxt/ui/table.ts +148 -0
- package/.nuxt/ui/tabs.ts +256 -0
- package/.nuxt/ui/textarea.ts +294 -0
- package/.nuxt/ui/timeline.ts +321 -0
- package/.nuxt/ui/toast.ts +81 -0
- package/.nuxt/ui/toaster.ts +91 -0
- package/.nuxt/ui/tooltip.ts +9 -0
- package/.nuxt/ui/tree.ts +154 -0
- package/.nuxt/ui.css +146 -0
- package/LICENSE.md +9 -0
- package/README.md +147 -0
- package/cli/commands/make/component.mjs +95 -0
- package/cli/commands/make/index.mjs +14 -0
- package/cli/commands/make/locale.mjs +64 -0
- package/cli/index.mjs +15 -0
- package/cli/package.json +13 -0
- package/cli/templates.mjs +228 -0
- package/cli/utils.mjs +31 -0
- package/dist/module.d.mts +63 -0
- package/dist/module.json +13 -0
- package/dist/module.mjs +135 -0
- package/dist/runtime/components/Accordion.vue +73 -0
- package/dist/runtime/components/Accordion.vue.d.ts +77 -0
- package/dist/runtime/components/Alert.vue +88 -0
- package/dist/runtime/components/Alert.vue.d.ts +81 -0
- package/dist/runtime/components/App.vue +44 -0
- package/dist/runtime/components/App.vue.d.ts +24 -0
- package/dist/runtime/components/Avatar.vue +83 -0
- package/dist/runtime/components/Avatar.vue.d.ts +41 -0
- package/dist/runtime/components/AvatarGroup.vue +65 -0
- package/dist/runtime/components/AvatarGroup.vue.d.ts +31 -0
- package/dist/runtime/components/Badge.vue +60 -0
- package/dist/runtime/components/Badge.vue.d.ts +43 -0
- package/dist/runtime/components/Breadcrumb.vue +65 -0
- package/dist/runtime/components/Breadcrumb.vue.d.ts +66 -0
- package/dist/runtime/components/Button.vue +147 -0
- package/dist/runtime/components/Button.vue.d.ts +48 -0
- package/dist/runtime/components/ButtonGroup.vue +31 -0
- package/dist/runtime/components/ButtonGroup.vue.d.ts +34 -0
- package/dist/runtime/components/Calendar.vue +154 -0
- package/dist/runtime/components/Calendar.vue.d.ts +111 -0
- package/dist/runtime/components/Card.vue +37 -0
- package/dist/runtime/components/Card.vue.d.ts +29 -0
- package/dist/runtime/components/Carousel.vue +210 -0
- package/dist/runtime/components/Carousel.vue.d.ts +127 -0
- package/dist/runtime/components/ChatMessage.vue +87 -0
- package/dist/runtime/components/ChatMessage.vue.d.ts +130 -0
- package/dist/runtime/components/ChatMessages.vue +225 -0
- package/dist/runtime/components/ChatMessages.vue.d.ts +83 -0
- package/dist/runtime/components/ChatPrompt.vue +77 -0
- package/dist/runtime/components/ChatPrompt.vue.d.ts +60 -0
- package/dist/runtime/components/ChatPromptSubmit.vue +74 -0
- package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +99 -0
- package/dist/runtime/components/Checkbox.vue +90 -0
- package/dist/runtime/components/Checkbox.vue.d.ts +73 -0
- package/dist/runtime/components/CheckboxGroup.vue +124 -0
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +84 -0
- package/dist/runtime/components/Chip.vue +48 -0
- package/dist/runtime/components/Chip.vue.d.ts +57 -0
- package/dist/runtime/components/Collapsible.vue +37 -0
- package/dist/runtime/components/Collapsible.vue.d.ts +35 -0
- package/dist/runtime/components/ColorPicker.vue +216 -0
- package/dist/runtime/components/ColorPicker.vue.d.ts +48 -0
- package/dist/runtime/components/CommandPalette.vue +275 -0
- package/dist/runtime/components/CommandPalette.vue.d.ts +187 -0
- package/dist/runtime/components/Container.vue +23 -0
- package/dist/runtime/components/Container.vue.d.ts +18 -0
- package/dist/runtime/components/ContextMenu.vue +61 -0
- package/dist/runtime/components/ContextMenu.vue.d.ts +109 -0
- package/dist/runtime/components/ContextMenuContent.vue +164 -0
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +49 -0
- package/dist/runtime/components/DashboardGroup.vue +46 -0
- package/dist/runtime/components/DashboardGroup.vue.d.ts +27 -0
- package/dist/runtime/components/DashboardNavbar.vue +74 -0
- package/dist/runtime/components/DashboardNavbar.vue.d.ts +53 -0
- package/dist/runtime/components/DashboardPanel.vue +56 -0
- package/dist/runtime/components/DashboardPanel.vue.d.ts +28 -0
- package/dist/runtime/components/DashboardResizeHandle.vue +32 -0
- package/dist/runtime/components/DashboardResizeHandle.vue.d.ts +22 -0
- package/dist/runtime/components/DashboardSearch.vue +124 -0
- package/dist/runtime/components/DashboardSearch.vue.d.ts +48 -0
- package/dist/runtime/components/DashboardSearchButton.vue +72 -0
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +52 -0
- package/dist/runtime/components/DashboardSidebar.vue +170 -0
- package/dist/runtime/components/DashboardSidebar.vue.d.ts +72 -0
- package/dist/runtime/components/DashboardSidebarCollapse.vue +46 -0
- package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +15 -0
- package/dist/runtime/components/DashboardSidebarToggle.vue +43 -0
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +19 -0
- package/dist/runtime/components/Drawer.vue +112 -0
- package/dist/runtime/components/Drawer.vue.d.ts +78 -0
- package/dist/runtime/components/DropdownMenu.vue +68 -0
- package/dist/runtime/components/DropdownMenu.vue.d.ts +119 -0
- package/dist/runtime/components/DropdownMenuContent.vue +171 -0
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +52 -0
- package/dist/runtime/components/Form.vue +210 -0
- package/dist/runtime/components/Form.vue.d.ts +70 -0
- package/dist/runtime/components/FormField.vue +90 -0
- package/dist/runtime/components/FormField.vue.d.ts +61 -0
- package/dist/runtime/components/Icon.vue +19 -0
- package/dist/runtime/components/Icon.vue.d.ts +8 -0
- package/dist/runtime/components/Input.vue +147 -0
- package/dist/runtime/components/Input.vue.d.ts +77 -0
- package/dist/runtime/components/InputMenu.vue +373 -0
- package/dist/runtime/components/InputMenu.vue.d.ts +534 -0
- package/dist/runtime/components/InputNumber.vue +144 -0
- package/dist/runtime/components/InputNumber.vue.d.ts +260 -0
- package/dist/runtime/components/InputTags.vue +159 -0
- package/dist/runtime/components/InputTags.vue.d.ts +183 -0
- package/dist/runtime/components/Kbd.vue +30 -0
- package/dist/runtime/components/Kbd.vue.d.ts +34 -0
- package/dist/runtime/components/Link.vue +127 -0
- package/dist/runtime/components/Link.vue.d.ts +93 -0
- package/dist/runtime/components/LinkBase.vue +57 -0
- package/dist/runtime/components/LinkBase.vue.d.ts +25 -0
- package/dist/runtime/components/Modal.vue +130 -0
- package/dist/runtime/components/Modal.vue.d.ts +106 -0
- package/dist/runtime/components/NavigationMenu.vue +275 -0
- package/dist/runtime/components/NavigationMenu.vue.d.ts +170 -0
- package/dist/runtime/components/OverlayProvider.vue +25 -0
- package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
- package/dist/runtime/components/Pagination.vue +97 -0
- package/dist/runtime/components/Pagination.vue.d.ts +118 -0
- package/dist/runtime/components/PinInput.vue +94 -0
- package/dist/runtime/components/PinInput.vue.d.ts +60 -0
- package/dist/runtime/components/Popover.vue +73 -0
- package/dist/runtime/components/Popover.vue.d.ts +64 -0
- package/dist/runtime/components/Progress.vue +132 -0
- package/dist/runtime/components/Progress.vue.d.ts +66 -0
- package/dist/runtime/components/RadioGroup.vue +133 -0
- package/dist/runtime/components/RadioGroup.vue.d.ts +93 -0
- package/dist/runtime/components/Select.vue +225 -0
- package/dist/runtime/components/Select.vue.d.ts +253 -0
- package/dist/runtime/components/SelectMenu.vue +328 -0
- package/dist/runtime/components/SelectMenu.vue.d.ts +302 -0
- package/dist/runtime/components/Separator.vue +53 -0
- package/dist/runtime/components/Separator.vue.d.ts +54 -0
- package/dist/runtime/components/Skeleton.vue +29 -0
- package/dist/runtime/components/Skeleton.vue.d.ts +17 -0
- package/dist/runtime/components/Slideover.vue +137 -0
- package/dist/runtime/components/Slideover.vue.d.ts +107 -0
- package/dist/runtime/components/Slider.vue +94 -0
- package/dist/runtime/components/Slider.vue.d.ts +58 -0
- package/dist/runtime/components/Stepper.vue +116 -0
- package/dist/runtime/components/Stepper.vue.d.ts +85 -0
- package/dist/runtime/components/Switch.vue +89 -0
- package/dist/runtime/components/Switch.vue.d.ts +70 -0
- package/dist/runtime/components/Table.vue +286 -0
- package/dist/runtime/components/Table.vue.d.ts +185 -0
- package/dist/runtime/components/Tabs.vue +84 -0
- package/dist/runtime/components/Tabs.vue.d.ts +93 -0
- package/dist/runtime/components/Textarea.vue +169 -0
- package/dist/runtime/components/Textarea.vue.d.ts +78 -0
- package/dist/runtime/components/Timeline.vue +92 -0
- package/dist/runtime/components/Timeline.vue.d.ts +70 -0
- package/dist/runtime/components/Toast.vue +129 -0
- package/dist/runtime/components/Toast.vue.d.ts +163 -0
- package/dist/runtime/components/Toaster.vue +111 -0
- package/dist/runtime/components/Toaster.vue.d.ts +44 -0
- package/dist/runtime/components/Tooltip.vue +62 -0
- package/dist/runtime/components/Tooltip.vue.d.ts +50 -0
- package/dist/runtime/components/Tree.vue +121 -0
- package/dist/runtime/components/Tree.vue.d.ts +113 -0
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +16 -0
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +7 -0
- package/dist/runtime/components/color-mode/ColorModeButton.vue +45 -0
- package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +24 -0
- package/dist/runtime/components/color-mode/ColorModeImage.vue +17 -0
- package/dist/runtime/components/color-mode/ColorModeImage.vue.d.ts +6 -0
- package/dist/runtime/components/color-mode/ColorModeSelect.vue +49 -0
- package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +7 -0
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +44 -0
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +7 -0
- package/dist/runtime/components/locale/LocaleSelect.vue +61 -0
- package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +16 -0
- package/dist/runtime/composables/color-mode/useColorMode.d.ts +3 -0
- package/dist/runtime/composables/color-mode/useColorMode.js +5 -0
- package/dist/runtime/composables/defineLocale.d.ts +11 -0
- package/dist/runtime/composables/defineLocale.js +9 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +15 -0
- package/dist/runtime/composables/defineShortcuts.js +141 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +10 -0
- package/dist/runtime/composables/useAvatarGroup.js +10 -0
- package/dist/runtime/composables/useButtonGroup.d.ts +15 -0
- package/dist/runtime/composables/useButtonGroup.js +9 -0
- package/dist/runtime/composables/useComponentIcons.d.ts +39 -0
- package/dist/runtime/composables/useComponentIcons.js +26 -0
- package/dist/runtime/composables/useContentSearch.d.ts +6 -0
- package/dist/runtime/composables/useContentSearch.js +9 -0
- package/dist/runtime/composables/useFormField.d.ts +42 -0
- package/dist/runtime/composables/useFormField.js +66 -0
- package/dist/runtime/composables/useKbd.d.ts +36 -0
- package/dist/runtime/composables/useKbd.js +53 -0
- package/dist/runtime/composables/useLocale.d.ts +4 -0
- package/dist/runtime/composables/useLocale.js +10 -0
- package/dist/runtime/composables/useLocalePro.d.ts +3 -0
- package/dist/runtime/composables/useLocalePro.js +11 -0
- package/dist/runtime/composables/useOverlay.d.ts +38 -0
- package/dist/runtime/composables/useOverlay.js +85 -0
- package/dist/runtime/composables/usePortal.d.ts +6 -0
- package/dist/runtime/composables/usePortal.js +17 -0
- package/dist/runtime/composables/useResizable.d.ts +27 -0
- package/dist/runtime/composables/useResizable.js +173 -0
- package/dist/runtime/composables/useScrollspy.d.ts +6 -0
- package/dist/runtime/composables/useScrollspy.js +38 -0
- package/dist/runtime/composables/useToast.d.ts +13 -0
- package/dist/runtime/composables/useToast.js +62 -0
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/inertia/components/Link.vue +132 -0
- package/dist/runtime/inertia/components/Link.vue.d.ts +63 -0
- package/dist/runtime/inertia/components/LinkBase.vue +68 -0
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
- package/dist/runtime/inertia/stubs.d.ts +43 -0
- package/dist/runtime/inertia/stubs.js +82 -0
- package/dist/runtime/keyframes.css +1 -0
- package/dist/runtime/locale/ar.d.ts +3 -0
- package/dist/runtime/locale/ar.js +56 -0
- package/dist/runtime/locale/az.d.ts +3 -0
- package/dist/runtime/locale/az.js +55 -0
- package/dist/runtime/locale/bg.d.ts +3 -0
- package/dist/runtime/locale/bg.js +55 -0
- package/dist/runtime/locale/bn.d.ts +3 -0
- package/dist/runtime/locale/bn.js +55 -0
- package/dist/runtime/locale/ca.d.ts +3 -0
- package/dist/runtime/locale/ca.js +55 -0
- package/dist/runtime/locale/ckb.d.ts +3 -0
- package/dist/runtime/locale/ckb.js +56 -0
- package/dist/runtime/locale/cs.d.ts +3 -0
- package/dist/runtime/locale/cs.js +55 -0
- package/dist/runtime/locale/da.d.ts +3 -0
- package/dist/runtime/locale/da.js +55 -0
- package/dist/runtime/locale/de.d.ts +3 -0
- package/dist/runtime/locale/de.js +55 -0
- package/dist/runtime/locale/el.d.ts +3 -0
- package/dist/runtime/locale/el.js +55 -0
- package/dist/runtime/locale/en.d.ts +3 -0
- package/dist/runtime/locale/en.js +125 -0
- package/dist/runtime/locale/es.d.ts +3 -0
- package/dist/runtime/locale/es.js +55 -0
- package/dist/runtime/locale/et.d.ts +3 -0
- package/dist/runtime/locale/et.js +55 -0
- package/dist/runtime/locale/fa_ir.d.ts +3 -0
- package/dist/runtime/locale/fa_ir.js +56 -0
- package/dist/runtime/locale/fi.d.ts +3 -0
- package/dist/runtime/locale/fi.js +55 -0
- package/dist/runtime/locale/fr.d.ts +3 -0
- package/dist/runtime/locale/fr.js +55 -0
- package/dist/runtime/locale/he.d.ts +3 -0
- package/dist/runtime/locale/he.js +54 -0
- package/dist/runtime/locale/hi.d.ts +3 -0
- package/dist/runtime/locale/hi.js +55 -0
- package/dist/runtime/locale/hu.d.ts +3 -0
- package/dist/runtime/locale/hu.js +55 -0
- package/dist/runtime/locale/hy.d.ts +3 -0
- package/dist/runtime/locale/hy.js +55 -0
- package/dist/runtime/locale/id.d.ts +3 -0
- package/dist/runtime/locale/id.js +55 -0
- package/dist/runtime/locale/index.d.ts +51 -0
- package/dist/runtime/locale/index.js +51 -0
- package/dist/runtime/locale/it.d.ts +3 -0
- package/dist/runtime/locale/it.js +55 -0
- package/dist/runtime/locale/ja.d.ts +3 -0
- package/dist/runtime/locale/ja.js +55 -0
- package/dist/runtime/locale/kk.d.ts +3 -0
- package/dist/runtime/locale/kk.js +55 -0
- package/dist/runtime/locale/km.d.ts +3 -0
- package/dist/runtime/locale/km.js +55 -0
- package/dist/runtime/locale/ko.d.ts +3 -0
- package/dist/runtime/locale/ko.js +55 -0
- package/dist/runtime/locale/ky.d.ts +3 -0
- package/dist/runtime/locale/ky.js +55 -0
- package/dist/runtime/locale/lb.d.ts +3 -0
- package/dist/runtime/locale/lb.js +55 -0
- package/dist/runtime/locale/lt.d.ts +3 -0
- package/dist/runtime/locale/lt.js +55 -0
- package/dist/runtime/locale/mn.d.ts +3 -0
- package/dist/runtime/locale/mn.js +55 -0
- package/dist/runtime/locale/ms.d.ts +3 -0
- package/dist/runtime/locale/ms.js +55 -0
- package/dist/runtime/locale/nb_no.d.ts +3 -0
- package/dist/runtime/locale/nb_no.js +55 -0
- package/dist/runtime/locale/nl.d.ts +3 -0
- package/dist/runtime/locale/nl.js +55 -0
- package/dist/runtime/locale/pl.d.ts +3 -0
- package/dist/runtime/locale/pl.js +55 -0
- package/dist/runtime/locale/pt.d.ts +3 -0
- package/dist/runtime/locale/pt.js +55 -0
- package/dist/runtime/locale/pt_br.d.ts +3 -0
- package/dist/runtime/locale/pt_br.js +55 -0
- package/dist/runtime/locale/ro.d.ts +3 -0
- package/dist/runtime/locale/ro.js +55 -0
- package/dist/runtime/locale/ru.d.ts +3 -0
- package/dist/runtime/locale/ru.js +55 -0
- package/dist/runtime/locale/sk.d.ts +3 -0
- package/dist/runtime/locale/sk.js +55 -0
- package/dist/runtime/locale/sl.d.ts +3 -0
- package/dist/runtime/locale/sl.js +55 -0
- package/dist/runtime/locale/sv.d.ts +3 -0
- package/dist/runtime/locale/sv.js +55 -0
- package/dist/runtime/locale/th.d.ts +3 -0
- package/dist/runtime/locale/th.js +55 -0
- package/dist/runtime/locale/tj.d.ts +3 -0
- package/dist/runtime/locale/tj.js +55 -0
- package/dist/runtime/locale/tr.d.ts +3 -0
- package/dist/runtime/locale/tr.js +55 -0
- package/dist/runtime/locale/ug_cn.d.ts +3 -0
- package/dist/runtime/locale/ug_cn.js +56 -0
- package/dist/runtime/locale/uk.d.ts +3 -0
- package/dist/runtime/locale/uk.js +55 -0
- package/dist/runtime/locale/ur.d.ts +3 -0
- package/dist/runtime/locale/ur.js +56 -0
- package/dist/runtime/locale/uz.d.ts +3 -0
- package/dist/runtime/locale/uz.js +55 -0
- package/dist/runtime/locale/vi.d.ts +3 -0
- package/dist/runtime/locale/vi.js +55 -0
- package/dist/runtime/locale/zh_cn.d.ts +3 -0
- package/dist/runtime/locale/zh_cn.js +55 -0
- package/dist/runtime/locale/zh_tw.d.ts +3 -0
- package/dist/runtime/locale/zh_tw.js +55 -0
- package/dist/runtime/plugins/colors.d.ts +2 -0
- package/dist/runtime/plugins/colors.js +51 -0
- package/dist/runtime/types/app.config.d.ts +6 -0
- package/dist/runtime/types/content.d.ts +1 -0
- package/dist/runtime/types/content.js +0 -0
- package/dist/runtime/types/form.d.ts +87 -0
- package/dist/runtime/types/form.js +12 -0
- package/dist/runtime/types/index.d.ts +76 -0
- package/dist/runtime/types/index.js +76 -0
- package/dist/runtime/types/locale.d.ts +127 -0
- package/dist/runtime/types/locale.js +0 -0
- package/dist/runtime/types/prose.d.ts +1 -0
- package/dist/runtime/types/prose.js +0 -0
- package/dist/runtime/types/tv.d.ts +53 -0
- package/dist/runtime/types/tv.js +0 -0
- package/dist/runtime/types/utils.d.ts +41 -0
- package/dist/runtime/types/utils.js +1 -0
- package/dist/runtime/utils/content.d.ts +13 -0
- package/dist/runtime/utils/content.js +51 -0
- package/dist/runtime/utils/dashboard.d.ts +10 -0
- package/dist/runtime/utils/dashboard.js +5 -0
- package/dist/runtime/utils/form.d.ts +13 -0
- package/dist/runtime/utils/form.js +108 -0
- package/dist/runtime/utils/fuse.d.ts +4 -0
- package/dist/runtime/utils/fuse.js +63 -0
- package/dist/runtime/utils/index.d.ts +12 -0
- package/dist/runtime/utils/index.js +89 -0
- package/dist/runtime/utils/link.d.ts +7 -0
- package/dist/runtime/utils/link.js +47 -0
- package/dist/runtime/utils/locale.d.ts +15 -0
- package/dist/runtime/utils/locale.js +25 -0
- package/dist/runtime/utils/tv.d.ts +1 -0
- package/dist/runtime/utils/tv.js +4 -0
- package/dist/runtime/vue/components/Icon.vue +14 -0
- package/dist/runtime/vue/components/Icon.vue.d.ts +5 -0
- package/dist/runtime/vue/components/Link.vue +169 -0
- package/dist/runtime/vue/components/Link.vue.d.ts +93 -0
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +34 -0
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue.d.ts +38 -0
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +37 -0
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue.d.ts +5 -0
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +32 -0
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue.d.ts +5 -0
- package/dist/runtime/vue/composables/useAppConfig.d.ts +1 -0
- package/dist/runtime/vue/composables/useAppConfig.js +4 -0
- package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
- package/dist/runtime/vue/plugins/color-mode.js +6 -0
- package/dist/runtime/vue/plugins/head.d.ts +4 -0
- package/dist/runtime/vue/plugins/head.js +10 -0
- package/dist/runtime/vue/stubs.d.ts +40 -0
- package/dist/runtime/vue/stubs.js +74 -0
- package/dist/shared/ui.BcVNrqyb.mjs +5374 -0
- package/dist/types.d.mts +5 -0
- package/dist/unplugin.d.mts +88 -0
- package/dist/unplugin.mjs +242 -0
- package/dist/vite.d.mts +15 -0
- package/dist/vite.mjs +21 -0
- package/package.json +255 -0
- package/vue-plugin.d.ts +5 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/color-picker";
|
|
3
|
+
function HSLtoHSV(hsl) {
|
|
4
|
+
const x = hsl.S * (hsl.L < 50 ? hsl.L : 100 - hsl.L);
|
|
5
|
+
const v = hsl.L + x / 100;
|
|
6
|
+
return {
|
|
7
|
+
h: hsl.H,
|
|
8
|
+
s: hsl.L === 0 ? hsl.S : 2 * x / v,
|
|
9
|
+
v
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function HSVtoHSL(hsv) {
|
|
13
|
+
const x = (200 - hsv.s) * hsv.v / 100;
|
|
14
|
+
return {
|
|
15
|
+
H: hsv.h,
|
|
16
|
+
S: x === 0 || x === 200 ? 0 : Math.round(hsv.s * hsv.v / (x <= 100 ? x : 200 - x)),
|
|
17
|
+
L: Math.round(x / 2)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script setup>
|
|
23
|
+
import { ref, nextTick, computed, toValue } from "vue";
|
|
24
|
+
import { Primitive } from "reka-ui";
|
|
25
|
+
import { useEventListener, useElementBounding, watchThrottled, watchPausable } from "@vueuse/core";
|
|
26
|
+
import { isClient } from "@vueuse/shared";
|
|
27
|
+
import { ColorTranslator } from "colortranslator";
|
|
28
|
+
import { useAppConfig } from "#imports";
|
|
29
|
+
import { tv } from "../utils/tv";
|
|
30
|
+
const props = defineProps({
|
|
31
|
+
as: { type: null, required: false },
|
|
32
|
+
throttle: { type: Number, required: false, default: 50 },
|
|
33
|
+
disabled: { type: Boolean, required: false },
|
|
34
|
+
defaultValue: { type: String, required: false, default: "#FFFFFF" },
|
|
35
|
+
format: { type: String, required: false, default: "hex" },
|
|
36
|
+
size: { type: null, required: false },
|
|
37
|
+
class: { type: null, required: false },
|
|
38
|
+
ui: { type: null, required: false }
|
|
39
|
+
});
|
|
40
|
+
const modelValue = defineModel({ type: String, ...void 0 });
|
|
41
|
+
const appConfig = useAppConfig();
|
|
42
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.colorPicker || {} })({
|
|
43
|
+
size: props.size
|
|
44
|
+
}));
|
|
45
|
+
const pickedColor = computed({
|
|
46
|
+
get() {
|
|
47
|
+
try {
|
|
48
|
+
const color = new ColorTranslator(modelValue.value || props.defaultValue);
|
|
49
|
+
return HSLtoHSV(color.HSLObject);
|
|
50
|
+
} catch (_) {
|
|
51
|
+
return { h: 0, s: 0, v: 100 };
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
set(value) {
|
|
55
|
+
const color = new ColorTranslator(HSVtoHSL(value), {
|
|
56
|
+
decimals: 2,
|
|
57
|
+
labUnit: "percent",
|
|
58
|
+
cmykUnit: "percent",
|
|
59
|
+
cmykFunction: "cmyk"
|
|
60
|
+
});
|
|
61
|
+
switch (props.format) {
|
|
62
|
+
case "rgb":
|
|
63
|
+
modelValue.value = color.RGB;
|
|
64
|
+
break;
|
|
65
|
+
case "hsl":
|
|
66
|
+
modelValue.value = color.HSL;
|
|
67
|
+
break;
|
|
68
|
+
case "cmyk":
|
|
69
|
+
modelValue.value = color.CMYK;
|
|
70
|
+
break;
|
|
71
|
+
case "lab":
|
|
72
|
+
modelValue.value = color.CIELab;
|
|
73
|
+
break;
|
|
74
|
+
case "hex":
|
|
75
|
+
default:
|
|
76
|
+
modelValue.value = color.HEX;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
function useColorDraggable(targetElement, containerElement, axis = "both", initialPosition = { x: 0, y: 0 }, disabled2) {
|
|
81
|
+
const position = ref(initialPosition);
|
|
82
|
+
const pressedDelta = ref();
|
|
83
|
+
const targetRect = useElementBounding(targetElement);
|
|
84
|
+
const containerRect = useElementBounding(containerElement);
|
|
85
|
+
function start(event) {
|
|
86
|
+
if (toValue(disabled2)) return event.preventDefault();
|
|
87
|
+
const container = toValue(containerElement);
|
|
88
|
+
pressedDelta.value = {
|
|
89
|
+
x: event.clientX - (container ? event.clientX - containerRect.left.value + container.scrollLeft : targetRect.left.value),
|
|
90
|
+
y: event.clientY - (container ? event.clientY - containerRect.top.value + container.scrollTop : targetRect.top.value)
|
|
91
|
+
};
|
|
92
|
+
move(event);
|
|
93
|
+
}
|
|
94
|
+
function move(event) {
|
|
95
|
+
if (!pressedDelta.value) return;
|
|
96
|
+
const container = toValue(containerElement);
|
|
97
|
+
let { x, y } = position.value;
|
|
98
|
+
if (container && (axis === "x" || axis === "both")) {
|
|
99
|
+
x = Math.min(Math.max(0, (event.clientX - pressedDelta.value.x) / container.scrollWidth * 100), 100);
|
|
100
|
+
}
|
|
101
|
+
if (container && (axis === "y" || axis === "both")) {
|
|
102
|
+
y = Math.min(Math.max(0, (event.clientY - pressedDelta.value.y) / container.scrollHeight * 100), 100);
|
|
103
|
+
}
|
|
104
|
+
position.value = { x, y };
|
|
105
|
+
}
|
|
106
|
+
function end() {
|
|
107
|
+
if (!pressedDelta.value) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
pressedDelta.value = void 0;
|
|
111
|
+
}
|
|
112
|
+
if (isClient) {
|
|
113
|
+
useEventListener(containerElement, "pointerdown", start);
|
|
114
|
+
useEventListener(window, "pointermove", move);
|
|
115
|
+
useEventListener(window, "pointerup", end);
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
position
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function normalizeHue(hue, dir = "left") {
|
|
122
|
+
if (dir === "right") {
|
|
123
|
+
return hue * 100 / 360;
|
|
124
|
+
}
|
|
125
|
+
return hue / 100 * 360;
|
|
126
|
+
}
|
|
127
|
+
function normalizeBrightness(brightness) {
|
|
128
|
+
return 100 - brightness;
|
|
129
|
+
}
|
|
130
|
+
const selectorRef = ref(null);
|
|
131
|
+
const selectorThumbRef = ref(null);
|
|
132
|
+
const trackRef = ref(null);
|
|
133
|
+
const trackThumbRef = ref(null);
|
|
134
|
+
const disabled = computed(() => props.disabled);
|
|
135
|
+
const { position: selectorThumbPosition } = useColorDraggable(selectorThumbRef, selectorRef, "both", {
|
|
136
|
+
x: pickedColor.value.s,
|
|
137
|
+
y: normalizeBrightness(pickedColor.value.v)
|
|
138
|
+
}, disabled);
|
|
139
|
+
const { position: trackThumbPosition } = useColorDraggable(trackThumbRef, trackRef, "y", {
|
|
140
|
+
x: 0,
|
|
141
|
+
y: normalizeHue(pickedColor.value.h, "right")
|
|
142
|
+
}, disabled);
|
|
143
|
+
const { pause: pauseWatchColor, resume: resumeWatchColor } = watchPausable(pickedColor, (hsb) => {
|
|
144
|
+
selectorThumbPosition.value = {
|
|
145
|
+
x: hsb.s,
|
|
146
|
+
y: normalizeBrightness(hsb.v)
|
|
147
|
+
};
|
|
148
|
+
trackThumbPosition.value = {
|
|
149
|
+
x: 0,
|
|
150
|
+
y: normalizeHue(hsb.h, "right")
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
watchThrottled([selectorThumbPosition, trackThumbPosition], () => {
|
|
154
|
+
pauseWatchColor();
|
|
155
|
+
pickedColor.value = {
|
|
156
|
+
h: normalizeHue(trackThumbPosition.value.y),
|
|
157
|
+
s: selectorThumbPosition.value.x,
|
|
158
|
+
v: normalizeBrightness(selectorThumbPosition.value.y)
|
|
159
|
+
};
|
|
160
|
+
nextTick(resumeWatchColor);
|
|
161
|
+
}, { throttle: () => props.throttle });
|
|
162
|
+
const trackThumbColor = computed(() => new ColorTranslator(HSVtoHSL({
|
|
163
|
+
h: normalizeHue(trackThumbPosition.value.y),
|
|
164
|
+
s: 100,
|
|
165
|
+
v: 100
|
|
166
|
+
})).HEX);
|
|
167
|
+
const selectorStyle = computed(() => ({
|
|
168
|
+
backgroundColor: trackThumbColor.value
|
|
169
|
+
}));
|
|
170
|
+
const selectorThumbStyle = computed(() => ({
|
|
171
|
+
backgroundColor: new ColorTranslator(modelValue.value || props.defaultValue).HEX,
|
|
172
|
+
left: `${selectorThumbPosition.value.x}%`,
|
|
173
|
+
top: `${selectorThumbPosition.value.y}%`
|
|
174
|
+
}));
|
|
175
|
+
const trackThumbStyle = computed(() => ({
|
|
176
|
+
backgroundColor: trackThumbColor.value,
|
|
177
|
+
top: `${trackThumbPosition.value.y}%`
|
|
178
|
+
}));
|
|
179
|
+
</script>
|
|
180
|
+
|
|
181
|
+
<template>
|
|
182
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })" :data-disabled="disabled ? true : void 0">
|
|
183
|
+
<div :class="ui.picker({ class: props.ui?.picker })">
|
|
184
|
+
<div
|
|
185
|
+
ref="selectorRef"
|
|
186
|
+
:class="ui.selector({ class: props.ui?.selector })"
|
|
187
|
+
:style="selectorStyle"
|
|
188
|
+
>
|
|
189
|
+
<div :class="ui.selectorBackground({ class: props.ui?.selectorBackground })" data-color-picker-background>
|
|
190
|
+
<div
|
|
191
|
+
ref="selectorThumbRef"
|
|
192
|
+
:class="ui.selectorThumb({ class: props.ui?.selectorThumb })"
|
|
193
|
+
:style="selectorThumbStyle"
|
|
194
|
+
:data-disabled="disabled ? true : void 0"
|
|
195
|
+
/>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
<div
|
|
199
|
+
ref="trackRef"
|
|
200
|
+
:class="ui.track({ class: props.ui?.track })"
|
|
201
|
+
data-color-picker-track
|
|
202
|
+
>
|
|
203
|
+
<div
|
|
204
|
+
ref="trackThumbRef"
|
|
205
|
+
:class="ui.trackThumb({ class: props.ui?.trackThumb })"
|
|
206
|
+
:style="trackThumbStyle"
|
|
207
|
+
:data-disabled="disabled ? true : void 0"
|
|
208
|
+
/>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
</Primitive>
|
|
212
|
+
</template>
|
|
213
|
+
|
|
214
|
+
<style scoped>
|
|
215
|
+
[data-color-picker-background]{background-image:linear-gradient(0deg,#000 0,transparent),linear-gradient(90deg,#fff 0,hsla(0,0%,100%,0))}[data-color-picker-track]{background-image:linear-gradient(0deg,red,#f0f 17%,#00f 33%,#0ff 50%,#0f0 67%,#ff0 83%,red)}
|
|
216
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import theme from '#build/ui/color-picker';
|
|
3
|
+
import type { ComponentConfig } from '../types/utils';
|
|
4
|
+
type ColorPicker = ComponentConfig<typeof theme, AppConfig, 'colorPicker'>;
|
|
5
|
+
export type ColorPickerProps = {
|
|
6
|
+
/**
|
|
7
|
+
* The element or component this component should render as.
|
|
8
|
+
* @defaultValue 'div'
|
|
9
|
+
*/
|
|
10
|
+
as?: any;
|
|
11
|
+
/**
|
|
12
|
+
* Throttle time in ms for the color picker
|
|
13
|
+
*/
|
|
14
|
+
throttle?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Disable the color picker
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The default value of the color picker
|
|
21
|
+
*/
|
|
22
|
+
defaultValue?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Format of the color
|
|
25
|
+
* @defaultValue 'hex'
|
|
26
|
+
*/
|
|
27
|
+
format?: 'hex' | 'rgb' | 'hsl' | 'cmyk' | 'lab';
|
|
28
|
+
/**
|
|
29
|
+
* @defaultValue 'md'
|
|
30
|
+
*/
|
|
31
|
+
size?: ColorPicker['variants']['size'];
|
|
32
|
+
class?: any;
|
|
33
|
+
ui?: ColorPicker['slots'];
|
|
34
|
+
};
|
|
35
|
+
declare const _default: import("vue").DefineComponent<ColorPickerProps & {
|
|
36
|
+
modelValue?: string;
|
|
37
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
39
|
+
}, string, import("vue").PublicProps, Readonly<ColorPickerProps & {
|
|
40
|
+
modelValue?: string;
|
|
41
|
+
}> & Readonly<{
|
|
42
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
43
|
+
}>, {
|
|
44
|
+
format: "hex" | "rgb" | "hsl" | "cmyk" | "lab";
|
|
45
|
+
defaultValue: string;
|
|
46
|
+
throttle: number;
|
|
47
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/command-palette";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed, ref, useTemplateRef } from "vue";
|
|
7
|
+
import { ListboxRoot, ListboxFilter, ListboxContent, ListboxGroup, ListboxGroupLabel, ListboxItem, ListboxItemIndicator, useForwardProps, useForwardPropsEmits } from "reka-ui";
|
|
8
|
+
import { defu } from "defu";
|
|
9
|
+
import { reactivePick } from "@vueuse/core";
|
|
10
|
+
import { useFuse } from "@vueuse/integrations/useFuse";
|
|
11
|
+
import { useAppConfig } from "#imports";
|
|
12
|
+
import { useLocale } from "../composables/useLocale";
|
|
13
|
+
import { omit, get } from "../utils";
|
|
14
|
+
import { tv } from "../utils/tv";
|
|
15
|
+
import { highlight } from "../utils/fuse";
|
|
16
|
+
import { pickLinkProps } from "../utils/link";
|
|
17
|
+
import UIcon from "./Icon.vue";
|
|
18
|
+
import UAvatar from "./Avatar.vue";
|
|
19
|
+
import UButton from "./Button.vue";
|
|
20
|
+
import UChip from "./Chip.vue";
|
|
21
|
+
import ULinkBase from "./LinkBase.vue";
|
|
22
|
+
import ULink from "./Link.vue";
|
|
23
|
+
import UInput from "./Input.vue";
|
|
24
|
+
import UKbd from "./Kbd.vue";
|
|
25
|
+
const props = defineProps({
|
|
26
|
+
as: { type: null, required: false },
|
|
27
|
+
icon: { type: String, required: false },
|
|
28
|
+
selectedIcon: { type: String, required: false },
|
|
29
|
+
trailingIcon: { type: String, required: false },
|
|
30
|
+
placeholder: { type: String, required: false },
|
|
31
|
+
autofocus: { type: Boolean, required: false, default: true },
|
|
32
|
+
close: { type: [Boolean, Object], required: false },
|
|
33
|
+
closeIcon: { type: String, required: false },
|
|
34
|
+
back: { type: [Boolean, Object], required: false, default: true },
|
|
35
|
+
backIcon: { type: String, required: false },
|
|
36
|
+
groups: { type: Array, required: false },
|
|
37
|
+
fuse: { type: Object, required: false },
|
|
38
|
+
labelKey: { type: String, required: false, default: "label" },
|
|
39
|
+
class: { type: null, required: false },
|
|
40
|
+
ui: { type: null, required: false },
|
|
41
|
+
multiple: { type: Boolean, required: false },
|
|
42
|
+
disabled: { type: Boolean, required: false },
|
|
43
|
+
modelValue: { type: null, required: false, default: "" },
|
|
44
|
+
defaultValue: { type: null, required: false },
|
|
45
|
+
highlightOnHover: { type: Boolean, required: false },
|
|
46
|
+
selectionBehavior: { type: String, required: false },
|
|
47
|
+
loading: { type: Boolean, required: false },
|
|
48
|
+
loadingIcon: { type: String, required: false }
|
|
49
|
+
});
|
|
50
|
+
const emits = defineEmits(["update:modelValue", "highlight", "entryFocus", "leave", "update:open"]);
|
|
51
|
+
const slots = defineSlots();
|
|
52
|
+
const searchTerm = defineModel("searchTerm", { type: String, ...{ default: "" } });
|
|
53
|
+
const { t } = useLocale();
|
|
54
|
+
const appConfig = useAppConfig();
|
|
55
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "disabled", "multiple", "modelValue", "defaultValue", "highlightOnHover", "selectionBehavior"), emits);
|
|
56
|
+
const inputProps = useForwardProps(reactivePick(props, "loading", "loadingIcon"));
|
|
57
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.commandPalette || {} })());
|
|
58
|
+
const fuse = computed(() => defu({}, props.fuse, {
|
|
59
|
+
fuseOptions: {
|
|
60
|
+
ignoreLocation: true,
|
|
61
|
+
threshold: 0.1,
|
|
62
|
+
keys: [props.labelKey, "suffix"]
|
|
63
|
+
},
|
|
64
|
+
resultLimit: 12,
|
|
65
|
+
matchAllWhenSearchEmpty: true
|
|
66
|
+
}));
|
|
67
|
+
const history = ref([]);
|
|
68
|
+
const placeholder = computed(() => history.value[history.value.length - 1]?.placeholder || props.placeholder || t("commandPalette.placeholder"));
|
|
69
|
+
const groups = computed(() => history.value?.length ? [history.value[history.value.length - 1]] : props.groups);
|
|
70
|
+
const items = computed(() => groups.value?.filter((group) => {
|
|
71
|
+
if (!group.id) {
|
|
72
|
+
console.warn(`[@eslamdevui/ui] CommandPalette group is missing an \`id\` property`);
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
if (group.ignoreFilter) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
return true;
|
|
79
|
+
})?.flatMap((group) => group.items?.map((item) => ({ ...item, group: group.id })) || []) || []);
|
|
80
|
+
const { results: fuseResults } = useFuse(searchTerm, items, fuse);
|
|
81
|
+
function getGroupWithItems(group, items2) {
|
|
82
|
+
if (group?.postFilter && typeof group.postFilter === "function") {
|
|
83
|
+
items2 = group.postFilter(searchTerm.value, items2);
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
...group,
|
|
87
|
+
items: items2.slice(0, fuse.value.resultLimit).map((item) => {
|
|
88
|
+
return {
|
|
89
|
+
...item,
|
|
90
|
+
labelHtml: highlight(item, searchTerm.value, props.labelKey),
|
|
91
|
+
suffixHtml: highlight(item, searchTerm.value, void 0, [props.labelKey])
|
|
92
|
+
};
|
|
93
|
+
})
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const filteredGroups = computed(() => {
|
|
97
|
+
const groupsById = fuseResults.value.reduce((acc, result) => {
|
|
98
|
+
const { item, matches } = result;
|
|
99
|
+
if (!item.group) {
|
|
100
|
+
return acc;
|
|
101
|
+
}
|
|
102
|
+
acc[item.group] ||= [];
|
|
103
|
+
acc[item.group]?.push({ ...item, matches });
|
|
104
|
+
return acc;
|
|
105
|
+
}, {});
|
|
106
|
+
const fuseGroups = Object.entries(groupsById).map(([id, items2]) => {
|
|
107
|
+
const group = groups.value?.find((group2) => group2.id === id);
|
|
108
|
+
if (!group) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
return getGroupWithItems(group, items2);
|
|
112
|
+
}).filter((group) => !!group);
|
|
113
|
+
const nonFuseGroups = groups.value?.map((group, index) => ({ ...group, index }))?.filter((group) => group.ignoreFilter && group.items?.length)?.map((group) => ({ ...getGroupWithItems(group, group.items || []), index: group.index })) || [];
|
|
114
|
+
return nonFuseGroups.reduce((acc, group) => {
|
|
115
|
+
acc.splice(group.index, 0, group);
|
|
116
|
+
return acc;
|
|
117
|
+
}, [...fuseGroups]);
|
|
118
|
+
});
|
|
119
|
+
const listboxRootRef = useTemplateRef("listboxRootRef");
|
|
120
|
+
function navigate(item) {
|
|
121
|
+
if (!item.children?.length) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
history.value.push({
|
|
125
|
+
id: `history-${history.value.length}`,
|
|
126
|
+
label: item.label,
|
|
127
|
+
slot: item.slot,
|
|
128
|
+
placeholder: item.placeholder,
|
|
129
|
+
items: item.children
|
|
130
|
+
});
|
|
131
|
+
searchTerm.value = "";
|
|
132
|
+
listboxRootRef.value?.highlightFirstItem();
|
|
133
|
+
}
|
|
134
|
+
function navigateBack() {
|
|
135
|
+
if (!history.value.length) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
history.value.pop();
|
|
139
|
+
searchTerm.value = "";
|
|
140
|
+
listboxRootRef.value?.highlightFirstItem();
|
|
141
|
+
}
|
|
142
|
+
function onBackspace() {
|
|
143
|
+
if (!searchTerm.value) {
|
|
144
|
+
navigateBack();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function onSelect(e, item) {
|
|
148
|
+
if (item.children?.length) {
|
|
149
|
+
e.preventDefault();
|
|
150
|
+
navigate(item);
|
|
151
|
+
} else {
|
|
152
|
+
item.onSelect?.(e);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
</script>
|
|
156
|
+
|
|
157
|
+
<template>
|
|
158
|
+
<ListboxRoot v-bind="rootProps" ref="listboxRootRef" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
159
|
+
<ListboxFilter v-model="searchTerm" as-child>
|
|
160
|
+
<UInput
|
|
161
|
+
:placeholder="placeholder"
|
|
162
|
+
variant="none"
|
|
163
|
+
:autofocus="autofocus"
|
|
164
|
+
v-bind="inputProps"
|
|
165
|
+
:icon="icon || appConfig.ui.icons.search"
|
|
166
|
+
:class="ui.input({ class: props.ui?.input })"
|
|
167
|
+
@keydown.backspace="onBackspace"
|
|
168
|
+
>
|
|
169
|
+
<template v-if="history?.length && (back || !!slots.back)" #leading>
|
|
170
|
+
<slot name="back" :ui="ui">
|
|
171
|
+
<UButton
|
|
172
|
+
:icon="backIcon || appConfig.ui.icons.arrowLeft"
|
|
173
|
+
color="neutral"
|
|
174
|
+
variant="link"
|
|
175
|
+
:aria-label="t('commandPalette.back')"
|
|
176
|
+
v-bind="typeof back === 'object' ? back : {}"
|
|
177
|
+
:class="ui.back({ class: props.ui?.back })"
|
|
178
|
+
@click="navigateBack"
|
|
179
|
+
/>
|
|
180
|
+
</slot>
|
|
181
|
+
</template>
|
|
182
|
+
|
|
183
|
+
<template v-if="close || !!slots.close" #trailing>
|
|
184
|
+
<slot name="close" :ui="ui">
|
|
185
|
+
<UButton
|
|
186
|
+
v-if="close"
|
|
187
|
+
:icon="closeIcon || appConfig.ui.icons.close"
|
|
188
|
+
color="neutral"
|
|
189
|
+
variant="ghost"
|
|
190
|
+
:aria-label="t('commandPalette.close')"
|
|
191
|
+
v-bind="typeof close === 'object' ? close : {}"
|
|
192
|
+
:class="ui.close({ class: props.ui?.close })"
|
|
193
|
+
@click="emits('update:open', false)"
|
|
194
|
+
/>
|
|
195
|
+
</slot>
|
|
196
|
+
</template>
|
|
197
|
+
</UInput>
|
|
198
|
+
</ListboxFilter>
|
|
199
|
+
|
|
200
|
+
<ListboxContent :class="ui.content({ class: props.ui?.content })">
|
|
201
|
+
<div v-if="filteredGroups?.length" role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
202
|
+
<ListboxGroup v-for="group in filteredGroups" :key="`group-${group.id}`" :class="ui.group({ class: props.ui?.group })">
|
|
203
|
+
<ListboxGroupLabel v-if="get(group, props.labelKey)" :class="ui.label({ class: props.ui?.label })">
|
|
204
|
+
{{ get(group, props.labelKey) }}
|
|
205
|
+
</ListboxGroupLabel>
|
|
206
|
+
|
|
207
|
+
<ListboxItem
|
|
208
|
+
v-for="(item, index) in group.items"
|
|
209
|
+
:key="`group-${group.id}-${index}`"
|
|
210
|
+
:value="omit(item, ['matches', 'group', 'onSelect', 'labelHtml', 'suffixHtml', 'children'])"
|
|
211
|
+
:disabled="item.disabled"
|
|
212
|
+
as-child
|
|
213
|
+
@select="onSelect($event, item)"
|
|
214
|
+
>
|
|
215
|
+
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
216
|
+
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class], active: active || item.active })">
|
|
217
|
+
<slot :name="item.slot || group.slot || 'item'" :item="item" :index="index">
|
|
218
|
+
<slot :name="item.slot ? `${item.slot}-leading` : group.slot ? `${group.slot}-leading` : `item-leading`" :item="item" :index="index">
|
|
219
|
+
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon], loading: true })" />
|
|
220
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon], active: active || item.active })" />
|
|
221
|
+
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [props.ui?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active: active || item.active })" />
|
|
222
|
+
<UChip
|
|
223
|
+
v-else-if="item.chip"
|
|
224
|
+
:size="item.ui?.itemLeadingChipSize || props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
225
|
+
inset
|
|
226
|
+
standalone
|
|
227
|
+
v-bind="item.chip"
|
|
228
|
+
:class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip], active: active || item.active })"
|
|
229
|
+
/>
|
|
230
|
+
</slot>
|
|
231
|
+
|
|
232
|
+
<span v-if="item.labelHtml || get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : group.slot ? `${group.slot}-label` : `item-label`]" :class="ui.itemLabel({ class: [props.ui?.itemLabel, item.ui?.itemLabel], active: active || item.active })">
|
|
233
|
+
<slot :name="item.slot ? `${item.slot}-label` : group.slot ? `${group.slot}-label` : `item-label`" :item="item" :index="index">
|
|
234
|
+
<span v-if="item.prefix" :class="ui.itemLabelPrefix({ class: [props.ui?.itemLabelPrefix, item.ui?.itemLabelPrefix] })">{{ item.prefix }}</span>
|
|
235
|
+
|
|
236
|
+
<span :class="ui.itemLabelBase({ class: [props.ui?.itemLabelBase, item.ui?.itemLabelBase], active: active || item.active })" v-html="item.labelHtml || get(item, props.labelKey)" />
|
|
237
|
+
|
|
238
|
+
<span :class="ui.itemLabelSuffix({ class: [props.ui?.itemLabelSuffix, item.ui?.itemLabelSuffix], active: active || item.active })" v-html="item.suffixHtml || item.suffix" />
|
|
239
|
+
</slot>
|
|
240
|
+
</span>
|
|
241
|
+
|
|
242
|
+
<span :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, item.ui?.itemTrailing] })">
|
|
243
|
+
<slot :name="item.slot ? `${item.slot}-trailing` : group.slot ? `${group.slot}-trailing` : `item-trailing`" :item="item" :index="index">
|
|
244
|
+
<UIcon
|
|
245
|
+
v-if="item.children && item.children.length > 0"
|
|
246
|
+
:name="trailingIcon || appConfig.ui.icons.chevronRight"
|
|
247
|
+
:class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, item.ui?.itemTrailingIcon] })"
|
|
248
|
+
/>
|
|
249
|
+
|
|
250
|
+
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: [props.ui?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
|
|
251
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || props.ui?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
252
|
+
</span>
|
|
253
|
+
|
|
254
|
+
<UIcon v-else-if="group.highlightedIcon" :name="group.highlightedIcon" :class="ui.itemTrailingHighlightedIcon({ class: [props.ui?.itemTrailingHighlightedIcon, item.ui?.itemTrailingHighlightedIcon] })" />
|
|
255
|
+
</slot>
|
|
256
|
+
|
|
257
|
+
<ListboxItemIndicator v-if="!item.children?.length" as-child>
|
|
258
|
+
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, item.ui?.itemTrailingIcon] })" />
|
|
259
|
+
</ListboxItemIndicator>
|
|
260
|
+
</span>
|
|
261
|
+
</slot>
|
|
262
|
+
</ULinkBase>
|
|
263
|
+
</ULink>
|
|
264
|
+
</ListboxItem>
|
|
265
|
+
</ListboxGroup>
|
|
266
|
+
</div>
|
|
267
|
+
|
|
268
|
+
<div v-else :class="ui.empty({ class: props.ui?.empty })">
|
|
269
|
+
<slot name="empty" :search-term="searchTerm">
|
|
270
|
+
{{ searchTerm ? t("commandPalette.noMatch", { searchTerm }) : t("commandPalette.noData") }}
|
|
271
|
+
</slot>
|
|
272
|
+
</div>
|
|
273
|
+
</ListboxContent>
|
|
274
|
+
</ListboxRoot>
|
|
275
|
+
</template>
|