@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,51 @@
|
|
|
1
|
+
export function mapContentNavigationItem(item, options) {
|
|
2
|
+
const navMap = {
|
|
3
|
+
[options?.labelAttribute || "title"]: "label",
|
|
4
|
+
path: "to"
|
|
5
|
+
};
|
|
6
|
+
return Object.keys(item).reduce((link, key) => {
|
|
7
|
+
const typedKey = key;
|
|
8
|
+
const value = item[typedKey];
|
|
9
|
+
if (value) {
|
|
10
|
+
const mappedKey = navMap[key] || key;
|
|
11
|
+
link[mappedKey] = value;
|
|
12
|
+
}
|
|
13
|
+
return link;
|
|
14
|
+
}, {});
|
|
15
|
+
}
|
|
16
|
+
export function mapContentNavigation(navigation, options) {
|
|
17
|
+
return navigation.map((item) => mapContentNavigationItem(item, options));
|
|
18
|
+
}
|
|
19
|
+
export function findPageHeadline(navigation, page) {
|
|
20
|
+
if (!navigation?.length || !page) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
for (const link of navigation) {
|
|
24
|
+
if (link.children) {
|
|
25
|
+
for (const childLink of link.children) {
|
|
26
|
+
if (childLink.path === page.path) {
|
|
27
|
+
return link.title;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const headline = findPageHeadline(link.children, page);
|
|
31
|
+
if (headline) {
|
|
32
|
+
return headline;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
export function findPageBreadcrumb(navigation, page) {
|
|
39
|
+
if (!navigation?.length || !page) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
return navigation.reduce((breadcrumb, link) => {
|
|
43
|
+
if (page.path && (page.path + "/").startsWith(link.path + "/")) {
|
|
44
|
+
breadcrumb.push(link);
|
|
45
|
+
if (link.children) {
|
|
46
|
+
breadcrumb.push(...findPageBreadcrumb(link.children, page));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return breadcrumb;
|
|
50
|
+
}, []);
|
|
51
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { UseResizableProps } from '../composables/useResizable';
|
|
3
|
+
export interface DashboardContext extends Pick<UseResizableProps, 'storage' | 'storageKey' | 'persistent' | 'unit'> {
|
|
4
|
+
sidebarOpen?: Ref<boolean>;
|
|
5
|
+
sidebarCollapsed?: Ref<boolean>;
|
|
6
|
+
toggleSearch?: () => void;
|
|
7
|
+
toggleSidebar?: () => void;
|
|
8
|
+
collapseSidebar?: (collapsed: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const useDashboard: <T extends DashboardContext | null | undefined = DashboardContext>(fallback?: T | undefined) => T extends null ? DashboardContext | null : DashboardContext, provideDashboardContext: (contextValue: DashboardContext) => DashboardContext;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
|
+
import type { ValidationError as JoiError, Schema as JoiSchema } from 'joi';
|
|
3
|
+
import type { ObjectSchema as YupObjectSchema, ValidationError as YupError } from 'yup';
|
|
4
|
+
import type { Struct } from 'superstruct';
|
|
5
|
+
import type { FormSchema, ValidateReturnSchema } from '../types/form';
|
|
6
|
+
export declare function isYupSchema(schema: any): schema is YupObjectSchema<any>;
|
|
7
|
+
export declare function isYupError(error: any): error is YupError;
|
|
8
|
+
export declare function isSuperStructSchema(schema: any): schema is Struct<any, any>;
|
|
9
|
+
export declare function isJoiSchema(schema: any): schema is JoiSchema;
|
|
10
|
+
export declare function isJoiError(error: any): error is JoiError;
|
|
11
|
+
export declare function isStandardSchema(schema: any): schema is StandardSchemaV1;
|
|
12
|
+
export declare function validateStandardSchema(state: any, schema: StandardSchemaV1): Promise<ValidateReturnSchema<typeof state>>;
|
|
13
|
+
export declare function validateSchema<T extends object>(state: T, schema: FormSchema<T>): Promise<ValidateReturnSchema<typeof state>>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export function isYupSchema(schema) {
|
|
2
|
+
return schema.validate && schema.__isYupSchema__;
|
|
3
|
+
}
|
|
4
|
+
export function isYupError(error) {
|
|
5
|
+
return error.inner !== void 0;
|
|
6
|
+
}
|
|
7
|
+
export function isSuperStructSchema(schema) {
|
|
8
|
+
return "schema" in schema && typeof schema.coercer === "function" && typeof schema.validator === "function" && typeof schema.refiner === "function";
|
|
9
|
+
}
|
|
10
|
+
export function isJoiSchema(schema) {
|
|
11
|
+
return schema.validateAsync !== void 0 && schema.id !== void 0;
|
|
12
|
+
}
|
|
13
|
+
export function isJoiError(error) {
|
|
14
|
+
return error.isJoi === true;
|
|
15
|
+
}
|
|
16
|
+
export function isStandardSchema(schema) {
|
|
17
|
+
return "~standard" in schema;
|
|
18
|
+
}
|
|
19
|
+
export async function validateStandardSchema(state, schema) {
|
|
20
|
+
const result = await schema["~standard"].validate(state);
|
|
21
|
+
if (result.issues) {
|
|
22
|
+
return {
|
|
23
|
+
errors: result.issues?.map((issue) => ({
|
|
24
|
+
name: issue.path?.map((item) => typeof item === "object" ? item.key : item).join(".") || "",
|
|
25
|
+
message: issue.message
|
|
26
|
+
})) || [],
|
|
27
|
+
result: null
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
errors: null,
|
|
32
|
+
result: result.value
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async function validateYupSchema(state, schema) {
|
|
36
|
+
try {
|
|
37
|
+
const result = await schema.validate(state, { abortEarly: false });
|
|
38
|
+
return {
|
|
39
|
+
errors: null,
|
|
40
|
+
result
|
|
41
|
+
};
|
|
42
|
+
} catch (error) {
|
|
43
|
+
if (isYupError(error)) {
|
|
44
|
+
const errors = error.inner.map((issue) => ({
|
|
45
|
+
name: issue.path ?? "",
|
|
46
|
+
message: issue.message
|
|
47
|
+
}));
|
|
48
|
+
return {
|
|
49
|
+
errors,
|
|
50
|
+
result: null
|
|
51
|
+
};
|
|
52
|
+
} else {
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async function validateSuperstructSchema(state, schema) {
|
|
58
|
+
const [err, result] = schema.validate(state);
|
|
59
|
+
if (err) {
|
|
60
|
+
const errors = err.failures().map((error) => ({
|
|
61
|
+
message: error.message,
|
|
62
|
+
name: error.path.join(".")
|
|
63
|
+
}));
|
|
64
|
+
return {
|
|
65
|
+
errors,
|
|
66
|
+
result: null
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
errors: null,
|
|
71
|
+
result
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
async function validateJoiSchema(state, schema) {
|
|
75
|
+
try {
|
|
76
|
+
const result = await schema.validateAsync(state, { abortEarly: false });
|
|
77
|
+
return {
|
|
78
|
+
errors: null,
|
|
79
|
+
result
|
|
80
|
+
};
|
|
81
|
+
} catch (error) {
|
|
82
|
+
if (isJoiError(error)) {
|
|
83
|
+
const errors = error.details.map((issue) => ({
|
|
84
|
+
name: issue.path.join("."),
|
|
85
|
+
message: issue.message
|
|
86
|
+
}));
|
|
87
|
+
return {
|
|
88
|
+
errors,
|
|
89
|
+
result: null
|
|
90
|
+
};
|
|
91
|
+
} else {
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export function validateSchema(state, schema) {
|
|
97
|
+
if (isStandardSchema(schema)) {
|
|
98
|
+
return validateStandardSchema(state, schema);
|
|
99
|
+
} else if (isJoiSchema(schema)) {
|
|
100
|
+
return validateJoiSchema(state, schema);
|
|
101
|
+
} else if (isYupSchema(schema)) {
|
|
102
|
+
return validateYupSchema(state, schema);
|
|
103
|
+
} else if (isSuperStructSchema(schema)) {
|
|
104
|
+
return validateSuperstructSchema(state, schema);
|
|
105
|
+
} else {
|
|
106
|
+
throw new Error("Form validation failed: Unsupported form schema");
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
function truncateHTMLFromStart(html, maxLength) {
|
|
2
|
+
let truncated = "";
|
|
3
|
+
let totalLength = 0;
|
|
4
|
+
let insideTag = false;
|
|
5
|
+
for (let i = html.length - 1; i >= 0; i--) {
|
|
6
|
+
if (html[i] === ">") {
|
|
7
|
+
insideTag = true;
|
|
8
|
+
} else if (html[i] === "<") {
|
|
9
|
+
insideTag = false;
|
|
10
|
+
truncated = html[i] + truncated;
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
if (!insideTag) {
|
|
14
|
+
totalLength++;
|
|
15
|
+
}
|
|
16
|
+
if (totalLength <= maxLength) {
|
|
17
|
+
truncated = html[i] + truncated;
|
|
18
|
+
} else {
|
|
19
|
+
truncated = "..." + truncated;
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return truncated;
|
|
24
|
+
}
|
|
25
|
+
export function highlight(item, searchTerm, forceKey, omitKeys) {
|
|
26
|
+
function generateHighlightedText(value, indices = []) {
|
|
27
|
+
value = value || "";
|
|
28
|
+
let content = "";
|
|
29
|
+
let nextUnhighlightedRegionStartingIndex = 0;
|
|
30
|
+
indices.forEach((region) => {
|
|
31
|
+
if (region.length === 2 && region[0] === region[1]) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const lastIndiceNextIndex = region[1] + 1;
|
|
35
|
+
const isMatched = lastIndiceNextIndex - region[0] >= searchTerm.length;
|
|
36
|
+
content += [
|
|
37
|
+
value.substring(nextUnhighlightedRegionStartingIndex, region[0]),
|
|
38
|
+
isMatched && `<mark>`,
|
|
39
|
+
value.substring(region[0], lastIndiceNextIndex),
|
|
40
|
+
isMatched && "</mark>"
|
|
41
|
+
].filter(Boolean).join("");
|
|
42
|
+
nextUnhighlightedRegionStartingIndex = lastIndiceNextIndex;
|
|
43
|
+
});
|
|
44
|
+
content += value.substring(nextUnhighlightedRegionStartingIndex);
|
|
45
|
+
const markIndex = content.indexOf("<mark>");
|
|
46
|
+
if (markIndex !== -1) {
|
|
47
|
+
content = truncateHTMLFromStart(content, content.length - markIndex);
|
|
48
|
+
}
|
|
49
|
+
return content;
|
|
50
|
+
}
|
|
51
|
+
if (!item.matches?.length) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
for (const match of item.matches) {
|
|
55
|
+
if (forceKey && match.key !== forceKey) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (omitKeys?.includes(match.key)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
return generateHighlightedText(match.value, match.indices);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function pick<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Pick<Data, Keys>;
|
|
2
|
+
export declare function omit<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Omit<Data, Keys>;
|
|
3
|
+
export declare function get(object: Record<string, any> | undefined, path: (string | number)[] | string, defaultValue?: any): any;
|
|
4
|
+
export declare function set(object: Record<string, any>, path: (string | number)[] | string, value: any): void;
|
|
5
|
+
export declare function looseToNumber(val: any): any;
|
|
6
|
+
export declare function compare<T>(value?: T, currentValue?: T, comparator?: string | ((a: T, b: T) => boolean)): boolean;
|
|
7
|
+
export declare function isArrayOfArray<A>(item: A[] | A[][]): item is A[][];
|
|
8
|
+
export declare function getSlotChildrenText(children: any): string;
|
|
9
|
+
export declare function transformUI(ui: Record<string, ((args: {
|
|
10
|
+
class?: string;
|
|
11
|
+
}) => any) | any>, uiProp?: Record<string, string>): Record<string, any>;
|
|
12
|
+
export * from './content';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { isEqual } from "ohash/utils";
|
|
2
|
+
export function pick(data, keys) {
|
|
3
|
+
const result = {};
|
|
4
|
+
for (const key of keys) {
|
|
5
|
+
result[key] = data[key];
|
|
6
|
+
}
|
|
7
|
+
return result;
|
|
8
|
+
}
|
|
9
|
+
export function omit(data, keys) {
|
|
10
|
+
const result = { ...data };
|
|
11
|
+
for (const key of keys) {
|
|
12
|
+
delete result[key];
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
export function get(object, path, defaultValue) {
|
|
17
|
+
if (typeof path === "string") {
|
|
18
|
+
path = path.split(".").map((key) => {
|
|
19
|
+
const numKey = Number(key);
|
|
20
|
+
return Number.isNaN(numKey) ? key : numKey;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
let result = object;
|
|
24
|
+
for (const key of path) {
|
|
25
|
+
if (result === void 0 || result === null) {
|
|
26
|
+
return defaultValue;
|
|
27
|
+
}
|
|
28
|
+
result = result[key];
|
|
29
|
+
}
|
|
30
|
+
return result !== void 0 ? result : defaultValue;
|
|
31
|
+
}
|
|
32
|
+
export function set(object, path, value) {
|
|
33
|
+
if (typeof path === "string") {
|
|
34
|
+
path = path.split(".").map((key) => {
|
|
35
|
+
const numKey = Number(key);
|
|
36
|
+
return Number.isNaN(numKey) ? key : numKey;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
path.reduce((acc, key, i) => {
|
|
40
|
+
if (acc[key] === void 0) acc[key] = {};
|
|
41
|
+
if (i === path.length - 1) acc[key] = value;
|
|
42
|
+
return acc[key];
|
|
43
|
+
}, object);
|
|
44
|
+
}
|
|
45
|
+
export function looseToNumber(val) {
|
|
46
|
+
const n = Number.parseFloat(val);
|
|
47
|
+
return Number.isNaN(n) ? val : n;
|
|
48
|
+
}
|
|
49
|
+
export function compare(value, currentValue, comparator) {
|
|
50
|
+
if (value === void 0 || currentValue === void 0) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
if (typeof value === "string") {
|
|
54
|
+
return value === currentValue;
|
|
55
|
+
}
|
|
56
|
+
if (typeof comparator === "function") {
|
|
57
|
+
return comparator(value, currentValue);
|
|
58
|
+
}
|
|
59
|
+
if (typeof comparator === "string") {
|
|
60
|
+
return get(value, comparator) === get(currentValue, comparator);
|
|
61
|
+
}
|
|
62
|
+
return isEqual(value, currentValue);
|
|
63
|
+
}
|
|
64
|
+
export function isArrayOfArray(item) {
|
|
65
|
+
return Array.isArray(item[0]);
|
|
66
|
+
}
|
|
67
|
+
export function getSlotChildrenText(children) {
|
|
68
|
+
if (!children) return "";
|
|
69
|
+
if (typeof children === "string") return children;
|
|
70
|
+
if (Array.isArray(children)) {
|
|
71
|
+
return children.map(getSlotChildrenText).join("");
|
|
72
|
+
}
|
|
73
|
+
if (typeof children === "object") {
|
|
74
|
+
if (children.children) {
|
|
75
|
+
return getSlotChildrenText(children.children);
|
|
76
|
+
}
|
|
77
|
+
if (typeof children.default === "function") {
|
|
78
|
+
return getSlotChildrenText(children.default());
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return "";
|
|
82
|
+
}
|
|
83
|
+
export function transformUI(ui, uiProp) {
|
|
84
|
+
return Object.entries(ui).reduce((acc, [key, value]) => {
|
|
85
|
+
acc[key] = typeof value === "function" ? value({ class: uiProp?.[key] }) : value;
|
|
86
|
+
return acc;
|
|
87
|
+
}, uiProp ? { ...uiProp } : {});
|
|
88
|
+
}
|
|
89
|
+
export * from "./content.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LinkProps } from '../types';
|
|
2
|
+
export declare function pickLinkProps(link: LinkProps & {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}): import("@vueuse/shared").ReactivePickReturn<LinkProps & {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}, string>;
|
|
7
|
+
export declare function isPartiallyEqual(item1: any, item2: any): boolean;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { reactivePick } from "@vueuse/core";
|
|
2
|
+
import { isEqual, diff } from "ohash/utils";
|
|
3
|
+
export function pickLinkProps(link) {
|
|
4
|
+
const keys = Object.keys(link);
|
|
5
|
+
const ariaKeys = keys.filter((key) => key.startsWith("aria-"));
|
|
6
|
+
const dataKeys = keys.filter((key) => key.startsWith("data-"));
|
|
7
|
+
const propsToInclude = [
|
|
8
|
+
"active",
|
|
9
|
+
"activeClass",
|
|
10
|
+
"ariaCurrentValue",
|
|
11
|
+
"as",
|
|
12
|
+
"disabled",
|
|
13
|
+
"exact",
|
|
14
|
+
"exactActiveClass",
|
|
15
|
+
"exactHash",
|
|
16
|
+
"exactQuery",
|
|
17
|
+
"external",
|
|
18
|
+
"href",
|
|
19
|
+
"download",
|
|
20
|
+
"inactiveClass",
|
|
21
|
+
"noPrefetch",
|
|
22
|
+
"noRel",
|
|
23
|
+
"prefetch",
|
|
24
|
+
"prefetchedClass",
|
|
25
|
+
"rel",
|
|
26
|
+
"replace",
|
|
27
|
+
"target",
|
|
28
|
+
"to",
|
|
29
|
+
"type",
|
|
30
|
+
"title",
|
|
31
|
+
"onClick",
|
|
32
|
+
...ariaKeys,
|
|
33
|
+
...dataKeys
|
|
34
|
+
];
|
|
35
|
+
return reactivePick(link, ...propsToInclude);
|
|
36
|
+
}
|
|
37
|
+
export function isPartiallyEqual(item1, item2) {
|
|
38
|
+
const diffedKeys = diff(item1, item2).reduce((filtered, q) => {
|
|
39
|
+
if (q.type === "added") {
|
|
40
|
+
filtered.add(q.key);
|
|
41
|
+
}
|
|
42
|
+
return filtered;
|
|
43
|
+
}, /* @__PURE__ */ new Set());
|
|
44
|
+
const item1Filtered = Object.fromEntries(Object.entries(item1).filter(([key]) => !diffedKeys.has(key)));
|
|
45
|
+
const item2Filtered = Object.fromEntries(Object.entries(item2).filter(([key]) => !diffedKeys.has(key)));
|
|
46
|
+
return isEqual(item1Filtered, item2Filtered);
|
|
47
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { Locale, Direction } from '../types/locale';
|
|
3
|
+
import type { MaybeRef } from '@vueuse/core';
|
|
4
|
+
export type TranslatorOption = Record<string, string | number>;
|
|
5
|
+
export type Translator = (path: string, option?: TranslatorOption) => string;
|
|
6
|
+
export type LocaleContext<M> = {
|
|
7
|
+
locale: Ref<Locale<M>>;
|
|
8
|
+
lang: Ref<string>;
|
|
9
|
+
dir: Ref<Direction>;
|
|
10
|
+
code: Ref<string>;
|
|
11
|
+
t: Translator;
|
|
12
|
+
};
|
|
13
|
+
export declare function buildTranslator<M>(locale: MaybeRef<Locale<M>>): Translator;
|
|
14
|
+
export declare function translate<M>(path: string, option: undefined | TranslatorOption, locale: Locale<M>): string;
|
|
15
|
+
export declare function buildLocaleContext<M>(locale: MaybeRef<Locale<M>>): LocaleContext<M>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { computed, isRef, ref, unref } from "vue";
|
|
2
|
+
import { get } from "./index.js";
|
|
3
|
+
export function buildTranslator(locale) {
|
|
4
|
+
return (path, option) => translate(path, option, unref(locale));
|
|
5
|
+
}
|
|
6
|
+
export function translate(path, option, locale) {
|
|
7
|
+
const prop = get(locale, `messages.${path}`, path);
|
|
8
|
+
return prop.replace(
|
|
9
|
+
/\{(\w+)\}/g,
|
|
10
|
+
(_, key) => `${option?.[key] ?? `{${key}}`}`
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
export function buildLocaleContext(locale) {
|
|
14
|
+
const lang = computed(() => unref(locale).name);
|
|
15
|
+
const code = computed(() => unref(locale).code);
|
|
16
|
+
const dir = computed(() => unref(locale).dir);
|
|
17
|
+
const localeRef = isRef(locale) ? locale : ref(locale);
|
|
18
|
+
return {
|
|
19
|
+
lang,
|
|
20
|
+
code,
|
|
21
|
+
dir,
|
|
22
|
+
locale: localeRef,
|
|
23
|
+
t: buildTranslator(locale)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tv: import("tailwind-variants").CreateTV;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { Icon as IconifyIcon } from "@iconify/vue";
|
|
7
|
+
defineProps({
|
|
8
|
+
name: { type: String, required: true }
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<IconifyIcon :icon="name.replace(/^i-/, '')" />
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface IconProps {
|
|
2
|
+
name: string;
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/link";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { defu } from "defu";
|
|
8
|
+
import { isEqual } from "ohash/utils";
|
|
9
|
+
import { useForwardProps } from "reka-ui";
|
|
10
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
11
|
+
import { hasProtocol } from "ufo";
|
|
12
|
+
import { useRoute, RouterLink } from "vue-router";
|
|
13
|
+
import { useAppConfig } from "#imports";
|
|
14
|
+
import { tv } from "../../utils/tv";
|
|
15
|
+
import { isPartiallyEqual } from "../../utils/link";
|
|
16
|
+
import ULinkBase from "../../components/LinkBase.vue";
|
|
17
|
+
defineOptions({ inheritAttrs: false });
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
as: { type: null, required: false, default: "button" },
|
|
20
|
+
type: { type: null, required: false, default: "button" },
|
|
21
|
+
disabled: { type: Boolean, required: false },
|
|
22
|
+
active: { type: Boolean, required: false, default: void 0 },
|
|
23
|
+
exact: { type: Boolean, required: false },
|
|
24
|
+
exactQuery: { type: [Boolean, String], required: false },
|
|
25
|
+
exactHash: { type: Boolean, required: false },
|
|
26
|
+
inactiveClass: { type: String, required: false, default: "" },
|
|
27
|
+
custom: { type: Boolean, required: false },
|
|
28
|
+
raw: { type: Boolean, required: false },
|
|
29
|
+
class: { type: null, required: false },
|
|
30
|
+
to: { type: null, required: false },
|
|
31
|
+
href: { type: null, required: false },
|
|
32
|
+
external: { type: Boolean, required: false },
|
|
33
|
+
target: { type: [String, Object, null], required: false },
|
|
34
|
+
rel: { type: [String, Object, null], required: false },
|
|
35
|
+
noRel: { type: Boolean, required: false },
|
|
36
|
+
prefetchedClass: { type: String, required: false },
|
|
37
|
+
prefetch: { type: Boolean, required: false },
|
|
38
|
+
prefetchOn: { type: [String, Object], required: false },
|
|
39
|
+
noPrefetch: { type: Boolean, required: false },
|
|
40
|
+
activeClass: { type: String, required: false, default: "" },
|
|
41
|
+
exactActiveClass: { type: String, required: false },
|
|
42
|
+
ariaCurrentValue: { type: String, required: false, default: "page" },
|
|
43
|
+
viewTransition: { type: Boolean, required: false },
|
|
44
|
+
replace: { type: Boolean, required: false }
|
|
45
|
+
});
|
|
46
|
+
defineSlots();
|
|
47
|
+
const route = useRoute();
|
|
48
|
+
const appConfig = useAppConfig();
|
|
49
|
+
const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "exactQuery", "exactHash", "activeClass", "inactiveClass", "to", "href", "raw", "custom", "class"));
|
|
50
|
+
const ui = computed(() => tv({
|
|
51
|
+
extend: tv(theme),
|
|
52
|
+
...defu({
|
|
53
|
+
variants: {
|
|
54
|
+
active: {
|
|
55
|
+
true: props.activeClass,
|
|
56
|
+
false: props.inactiveClass
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}, appConfig.ui?.link || {})
|
|
60
|
+
}));
|
|
61
|
+
const to = computed(() => props.to ?? props.href);
|
|
62
|
+
const isExternal = computed(() => {
|
|
63
|
+
if (props.external) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
if (!to.value) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
return typeof to.value === "string" && hasProtocol(to.value, { acceptRelative: true });
|
|
70
|
+
});
|
|
71
|
+
function isLinkActive({ route: linkRoute, isActive, isExactActive }) {
|
|
72
|
+
if (props.active !== void 0) {
|
|
73
|
+
return props.active;
|
|
74
|
+
}
|
|
75
|
+
if (!to.value) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
if (props.exactQuery === "partial") {
|
|
79
|
+
if (!isPartiallyEqual(linkRoute.query, route.query)) return false;
|
|
80
|
+
} else if (props.exactQuery === true) {
|
|
81
|
+
if (!isEqual(linkRoute.query, route.query)) return false;
|
|
82
|
+
}
|
|
83
|
+
if (props.exactHash && linkRoute.hash !== route.hash) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (props.exact && isExactActive) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
if (!props.exact && isActive) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
function resolveLinkClass({ route: route2, isActive, isExactActive } = {}) {
|
|
95
|
+
const active = isLinkActive({ route: route2, isActive, isExactActive });
|
|
96
|
+
if (props.raw) {
|
|
97
|
+
return [props.class, active ? props.activeClass : props.inactiveClass];
|
|
98
|
+
}
|
|
99
|
+
return ui.value({ class: props.class, active, disabled: props.disabled });
|
|
100
|
+
}
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
<template>
|
|
104
|
+
<template v-if="!isExternal && !!to">
|
|
105
|
+
<RouterLink v-slot="{ href, navigate, route: linkRoute, isActive, isExactActive }" v-bind="routerLinkProps" :to="to" custom>
|
|
106
|
+
<template v-if="custom">
|
|
107
|
+
<slot
|
|
108
|
+
v-bind="{
|
|
109
|
+
...$attrs,
|
|
110
|
+
...exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {},
|
|
111
|
+
as,
|
|
112
|
+
type,
|
|
113
|
+
disabled,
|
|
114
|
+
href,
|
|
115
|
+
navigate,
|
|
116
|
+
active: isLinkActive({ route: linkRoute, isActive, isExactActive })
|
|
117
|
+
}"
|
|
118
|
+
/>
|
|
119
|
+
</template>
|
|
120
|
+
<ULinkBase
|
|
121
|
+
v-else
|
|
122
|
+
v-bind="{
|
|
123
|
+
...$attrs,
|
|
124
|
+
...exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {},
|
|
125
|
+
as,
|
|
126
|
+
type,
|
|
127
|
+
disabled,
|
|
128
|
+
href,
|
|
129
|
+
navigate
|
|
130
|
+
}"
|
|
131
|
+
:class="resolveLinkClass({ route: linkRoute, isActive, isExactActive })"
|
|
132
|
+
>
|
|
133
|
+
<slot :active="isLinkActive({ route: linkRoute, isActive, isExactActive })" />
|
|
134
|
+
</ULinkBase>
|
|
135
|
+
</RouterLink>
|
|
136
|
+
</template>
|
|
137
|
+
|
|
138
|
+
<template v-else>
|
|
139
|
+
<template v-if="custom">
|
|
140
|
+
<slot
|
|
141
|
+
v-bind="{
|
|
142
|
+
...$attrs,
|
|
143
|
+
as,
|
|
144
|
+
type,
|
|
145
|
+
disabled,
|
|
146
|
+
href: to,
|
|
147
|
+
target: isExternal ? '_blank' : void 0,
|
|
148
|
+
active,
|
|
149
|
+
isExternal
|
|
150
|
+
}"
|
|
151
|
+
/>
|
|
152
|
+
</template>
|
|
153
|
+
<ULinkBase
|
|
154
|
+
v-else
|
|
155
|
+
v-bind="{
|
|
156
|
+
...$attrs,
|
|
157
|
+
as,
|
|
158
|
+
type,
|
|
159
|
+
disabled,
|
|
160
|
+
href: to,
|
|
161
|
+
target: isExternal ? '_blank' : void 0,
|
|
162
|
+
isExternal
|
|
163
|
+
}"
|
|
164
|
+
:class="resolveLinkClass()"
|
|
165
|
+
>
|
|
166
|
+
<slot :active="active" />
|
|
167
|
+
</ULinkBase>
|
|
168
|
+
</template>
|
|
169
|
+
</template>
|