@nuxt/ui 4.7.0 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/{ui.css → ui.static.css} +0 -10
- package/LICENSE.md +1 -1
- package/cli/commands/make/component.mjs +6 -2
- package/cli/templates.mjs +46 -20
- package/cli/utils.mjs +19 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -4
- package/dist/runtime/components/Accordion.vue +15 -14
- package/dist/runtime/components/Alert.vue +20 -20
- package/dist/runtime/components/AuthForm.vue +37 -37
- package/dist/runtime/components/Avatar.d.vue.ts +4 -0
- package/dist/runtime/components/Avatar.vue +14 -12
- package/dist/runtime/components/Avatar.vue.d.ts +4 -0
- package/dist/runtime/components/AvatarGroup.d.vue.ts +4 -0
- package/dist/runtime/components/AvatarGroup.vue +11 -8
- package/dist/runtime/components/AvatarGroup.vue.d.ts +4 -0
- package/dist/runtime/components/Badge.vue +11 -11
- package/dist/runtime/components/Banner.vue +25 -23
- package/dist/runtime/components/BlogPost.d.vue.ts +1 -1
- package/dist/runtime/components/BlogPost.vue +30 -28
- package/dist/runtime/components/BlogPost.vue.d.ts +1 -1
- package/dist/runtime/components/BlogPosts.vue +6 -6
- package/dist/runtime/components/Breadcrumb.d.vue.ts +4 -0
- package/dist/runtime/components/Breadcrumb.vue +21 -18
- package/dist/runtime/components/Breadcrumb.vue.d.ts +4 -0
- package/dist/runtime/components/Button.vue +17 -16
- package/dist/runtime/components/Calendar.vue +21 -20
- package/dist/runtime/components/Card.vue +11 -11
- package/dist/runtime/components/Carousel.vue +23 -22
- package/dist/runtime/components/ChangelogVersion.vue +31 -29
- package/dist/runtime/components/ChangelogVersions.vue +8 -8
- package/dist/runtime/components/ChatMessage.d.vue.ts +6 -0
- package/dist/runtime/components/ChatMessage.vue +46 -36
- package/dist/runtime/components/ChatMessage.vue.d.ts +6 -0
- package/dist/runtime/components/ChatMessages.vue +14 -14
- package/dist/runtime/components/ChatPalette.vue +6 -6
- package/dist/runtime/components/ChatPrompt.d.vue.ts +7 -0
- package/dist/runtime/components/ChatPrompt.vue +22 -12
- package/dist/runtime/components/ChatPrompt.vue.d.ts +7 -0
- package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +3 -3
- package/dist/runtime/components/ChatPromptSubmit.vue +6 -6
- package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +3 -3
- package/dist/runtime/components/ChatReasoning.vue +20 -20
- package/dist/runtime/components/ChatShimmer.vue +7 -7
- package/dist/runtime/components/ChatTool.d.vue.ts +1 -1
- package/dist/runtime/components/ChatTool.vue +19 -19
- package/dist/runtime/components/ChatTool.vue.d.ts +1 -1
- package/dist/runtime/components/Checkbox.d.vue.ts +2 -0
- package/dist/runtime/components/Checkbox.vue +25 -24
- package/dist/runtime/components/Checkbox.vue.d.ts +2 -0
- package/dist/runtime/components/CheckboxGroup.d.vue.ts +1 -1
- package/dist/runtime/components/CheckboxGroup.vue +17 -14
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Chip.vue +8 -8
- package/dist/runtime/components/Collapsible.vue +8 -7
- package/dist/runtime/components/ColorPicker.d.vue.ts +2 -0
- package/dist/runtime/components/ColorPicker.vue +10 -10
- package/dist/runtime/components/ColorPicker.vue.d.ts +2 -0
- package/dist/runtime/components/CommandPalette.d.vue.ts +5 -5
- package/dist/runtime/components/CommandPalette.vue +92 -69
- package/dist/runtime/components/CommandPalette.vue.d.ts +5 -5
- package/dist/runtime/components/Container.vue +4 -4
- package/dist/runtime/components/ContextMenu.vue +16 -15
- package/dist/runtime/components/DashboardGroup.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardGroup.vue +6 -4
- package/dist/runtime/components/DashboardGroup.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardNavbar.vue +16 -16
- package/dist/runtime/components/DashboardPanel.vue +7 -7
- package/dist/runtime/components/DashboardResizeHandle.vue +5 -5
- package/dist/runtime/components/DashboardSearch.d.vue.ts +16 -1
- package/dist/runtime/components/DashboardSearch.vue +13 -11
- package/dist/runtime/components/DashboardSearch.vue.d.ts +16 -1
- package/dist/runtime/components/DashboardSearchButton.d.vue.ts +2 -2
- package/dist/runtime/components/DashboardSearchButton.vue +15 -15
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +2 -2
- package/dist/runtime/components/DashboardSidebar.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardSidebar.vue +22 -22
- package/dist/runtime/components/DashboardSidebar.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebarCollapse.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardSidebarCollapse.vue +5 -5
- package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.vue +5 -5
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardToolbar.vue +6 -6
- package/dist/runtime/components/Drawer.d.vue.ts +1 -1
- package/dist/runtime/components/Drawer.vue +23 -22
- package/dist/runtime/components/Drawer.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenu.vue +21 -20
- package/dist/runtime/components/Editor.vue +8 -7
- package/dist/runtime/components/EditorDragHandle.d.vue.ts +2 -2
- package/dist/runtime/components/EditorDragHandle.vue +8 -8
- package/dist/runtime/components/EditorDragHandle.vue.d.ts +2 -2
- package/dist/runtime/components/EditorToolbar.vue +10 -9
- package/dist/runtime/components/Empty.vue +14 -14
- package/dist/runtime/components/Error.d.vue.ts +9 -1
- package/dist/runtime/components/Error.vue +17 -10
- package/dist/runtime/components/Error.vue.d.ts +9 -1
- package/dist/runtime/components/FieldGroup.vue +4 -4
- package/dist/runtime/components/FileUpload.vue +36 -37
- package/dist/runtime/components/Footer.vue +10 -10
- package/dist/runtime/components/FooterColumns.vue +15 -15
- package/dist/runtime/components/Form.d.vue.ts +1 -1
- package/dist/runtime/components/Form.vue +5 -5
- package/dist/runtime/components/Form.vue.d.ts +1 -1
- package/dist/runtime/components/FormField.d.vue.ts +2 -1
- package/dist/runtime/components/FormField.vue +21 -21
- package/dist/runtime/components/FormField.vue.d.ts +2 -1
- package/dist/runtime/components/Header.vue +19 -19
- package/dist/runtime/components/Input.vue +19 -19
- package/dist/runtime/components/InputDate.vue +21 -20
- package/dist/runtime/components/InputMenu.d.vue.ts +52 -51
- package/dist/runtime/components/InputMenu.vue +66 -63
- package/dist/runtime/components/InputMenu.vue.d.ts +52 -51
- package/dist/runtime/components/InputNumber.vue +25 -24
- package/dist/runtime/components/InputTags.vue +26 -25
- package/dist/runtime/components/InputTime.vue +21 -20
- package/dist/runtime/components/Kbd.vue +5 -5
- package/dist/runtime/components/Link.d.vue.ts +11 -2
- package/dist/runtime/components/Link.vue +13 -4
- package/dist/runtime/components/Link.vue.d.ts +11 -2
- package/dist/runtime/components/Listbox.d.vue.ts +13 -9
- package/dist/runtime/components/Listbox.vue +34 -32
- package/dist/runtime/components/Listbox.vue.d.ts +13 -9
- package/dist/runtime/components/Main.vue +4 -4
- package/dist/runtime/components/Marquee.vue +5 -5
- package/dist/runtime/components/Modal.d.vue.ts +2 -2
- package/dist/runtime/components/Modal.vue +25 -24
- package/dist/runtime/components/Modal.vue.d.ts +2 -2
- package/dist/runtime/components/NavigationMenu.vue +66 -65
- package/dist/runtime/components/Page.vue +7 -7
- package/dist/runtime/components/PageAnchors.vue +11 -11
- package/dist/runtime/components/PageAside.vue +9 -9
- package/dist/runtime/components/PageBody.vue +4 -4
- package/dist/runtime/components/PageCTA.vue +18 -16
- package/dist/runtime/components/PageCard.vue +25 -23
- package/dist/runtime/components/PageColumns.vue +4 -4
- package/dist/runtime/components/PageFeature.vue +17 -15
- package/dist/runtime/components/PageGrid.vue +4 -4
- package/dist/runtime/components/PageHeader.vue +14 -14
- package/dist/runtime/components/PageHero.vue +20 -18
- package/dist/runtime/components/PageLinks.vue +12 -12
- package/dist/runtime/components/PageList.vue +4 -4
- package/dist/runtime/components/PageLogos.vue +16 -16
- package/dist/runtime/components/PageSection.d.vue.ts +1 -1
- package/dist/runtime/components/PageSection.vue +24 -22
- package/dist/runtime/components/PageSection.vue.d.ts +1 -1
- package/dist/runtime/components/Pagination.d.vue.ts +2 -2
- package/dist/runtime/components/Pagination.vue +23 -22
- package/dist/runtime/components/Pagination.vue.d.ts +2 -2
- package/dist/runtime/components/PinInput.vue +15 -14
- package/dist/runtime/components/Popover.vue +9 -8
- package/dist/runtime/components/PricingPlan.vue +36 -36
- package/dist/runtime/components/PricingPlans.vue +6 -6
- package/dist/runtime/components/PricingTable.vue +44 -44
- package/dist/runtime/components/Progress.d.vue.ts +1 -1
- package/dist/runtime/components/Progress.vue +12 -11
- package/dist/runtime/components/Progress.vue.d.ts +1 -1
- package/dist/runtime/components/RadioGroup.d.vue.ts +2 -0
- package/dist/runtime/components/RadioGroup.vue +28 -27
- package/dist/runtime/components/RadioGroup.vue.d.ts +2 -0
- package/dist/runtime/components/ScrollArea.vue +13 -13
- package/dist/runtime/components/Select.vue +38 -40
- package/dist/runtime/components/SelectMenu.d.vue.ts +46 -46
- package/dist/runtime/components/SelectMenu.vue +49 -48
- package/dist/runtime/components/SelectMenu.vue.d.ts +46 -46
- package/dist/runtime/components/Separator.d.vue.ts +9 -3
- package/dist/runtime/components/Separator.vue +29 -16
- package/dist/runtime/components/Separator.vue.d.ts +9 -3
- package/dist/runtime/components/Sidebar.vue +28 -28
- package/dist/runtime/components/Skeleton.vue +5 -5
- package/dist/runtime/components/Slideover.d.vue.ts +3 -3
- package/dist/runtime/components/Slideover.vue +24 -23
- package/dist/runtime/components/Slideover.vue.d.ts +3 -3
- package/dist/runtime/components/Slider.vue +16 -15
- package/dist/runtime/components/Stepper.vue +19 -18
- package/dist/runtime/components/Switch.d.vue.ts +2 -0
- package/dist/runtime/components/Switch.vue +26 -23
- package/dist/runtime/components/Switch.vue.d.ts +2 -0
- package/dist/runtime/components/Table.vue +26 -25
- package/dist/runtime/components/Tabs.vue +22 -21
- package/dist/runtime/components/Textarea.vue +19 -18
- package/dist/runtime/components/Theme.d.vue.ts +13 -5
- package/dist/runtime/components/Theme.vue +32 -4
- package/dist/runtime/components/Theme.vue.d.ts +13 -5
- package/dist/runtime/components/Timeline.vue +15 -15
- package/dist/runtime/components/Toast.vue +35 -34
- package/dist/runtime/components/Toaster.d.vue.ts +1 -1
- package/dist/runtime/components/Toaster.vue +10 -9
- package/dist/runtime/components/Toaster.vue.d.ts +1 -1
- package/dist/runtime/components/Tooltip.vue +13 -12
- package/dist/runtime/components/Tree.vue +24 -23
- package/dist/runtime/components/User.vue +23 -21
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +5 -2
- package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeButton.vue +8 -6
- package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeImage.vue +4 -2
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +1 -0
- package/dist/runtime/components/content/ContentNavigation.vue +31 -30
- package/dist/runtime/components/content/ContentSearch.d.vue.ts +30 -3
- package/dist/runtime/components/content/ContentSearch.vue +66 -32
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +30 -3
- package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +2 -2
- package/dist/runtime/components/content/ContentSearchButton.vue +15 -15
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +2 -2
- package/dist/runtime/components/content/ContentSurround.vue +14 -12
- package/dist/runtime/components/content/ContentToc.vue +34 -33
- package/dist/runtime/components/prose/A.vue +4 -4
- package/dist/runtime/components/prose/Accordion.vue +4 -4
- package/dist/runtime/components/prose/AccordionItem.vue +5 -5
- package/dist/runtime/components/prose/Badge.vue +4 -4
- package/dist/runtime/components/prose/Blockquote.vue +4 -4
- package/dist/runtime/components/prose/Callout.vue +8 -8
- package/dist/runtime/components/prose/Card.vue +12 -12
- package/dist/runtime/components/prose/CardGroup.vue +4 -4
- package/dist/runtime/components/prose/Code.vue +4 -4
- package/dist/runtime/components/prose/CodeCollapse.vue +8 -8
- package/dist/runtime/components/prose/CodeGroup.vue +9 -9
- package/dist/runtime/components/prose/CodePreview.vue +6 -6
- package/dist/runtime/components/prose/CodeTree.vue +14 -14
- package/dist/runtime/components/prose/Collapsible.vue +7 -7
- package/dist/runtime/components/prose/Em.vue +4 -4
- package/dist/runtime/components/prose/Field.vue +13 -13
- package/dist/runtime/components/prose/FieldGroup.vue +4 -4
- package/dist/runtime/components/prose/H1.vue +5 -5
- package/dist/runtime/components/prose/H2.vue +7 -7
- package/dist/runtime/components/prose/H3.vue +7 -7
- package/dist/runtime/components/prose/H4.vue +5 -5
- package/dist/runtime/components/prose/Hr.vue +4 -4
- package/dist/runtime/components/prose/Icon.vue +4 -4
- package/dist/runtime/components/prose/Img.vue +17 -12
- package/dist/runtime/components/prose/Kbd.d.vue.ts +10 -2
- package/dist/runtime/components/prose/Kbd.vue +8 -5
- package/dist/runtime/components/prose/Kbd.vue.d.ts +10 -2
- package/dist/runtime/components/prose/Li.vue +4 -4
- package/dist/runtime/components/prose/Ol.vue +4 -4
- package/dist/runtime/components/prose/P.vue +4 -4
- package/dist/runtime/components/prose/Pre.vue +9 -9
- package/dist/runtime/components/prose/Prompt.vue +12 -12
- package/dist/runtime/components/prose/Steps.vue +4 -4
- package/dist/runtime/components/prose/Strong.vue +4 -4
- package/dist/runtime/components/prose/Table.vue +5 -5
- package/dist/runtime/components/prose/Tabs.vue +4 -4
- package/dist/runtime/components/prose/TabsItem.vue +5 -5
- package/dist/runtime/components/prose/Tbody.vue +4 -4
- package/dist/runtime/components/prose/Td.vue +4 -4
- package/dist/runtime/components/prose/Th.vue +4 -4
- package/dist/runtime/components/prose/Thead.vue +4 -4
- package/dist/runtime/components/prose/Tr.vue +4 -4
- package/dist/runtime/components/prose/Ul.vue +4 -4
- package/dist/runtime/composables/defineShortcuts.js +7 -2
- package/dist/runtime/composables/index.d.ts +1 -2
- package/dist/runtime/composables/index.js +1 -2
- package/dist/runtime/composables/useAvatarGroup.d.ts +12 -1
- package/dist/runtime/composables/useAvatarGroup.js +4 -2
- package/dist/runtime/composables/useComponentIcons.js +1 -1
- package/dist/runtime/composables/useComponentProps.d.ts +180 -0
- package/dist/runtime/composables/useComponentProps.js +59 -0
- package/dist/runtime/composables/useContentSearch.d.ts +4 -2
- package/dist/runtime/composables/useContentSearch.js +64 -7
- package/dist/runtime/composables/useFieldGroup.d.ts +9 -1
- package/dist/runtime/composables/useFormField.d.ts +21 -1
- package/dist/runtime/composables/useForwardProps.d.ts +13 -0
- package/dist/runtime/composables/useForwardProps.js +14 -0
- package/dist/runtime/composables/usePrefix.d.ts +6 -0
- package/dist/runtime/composables/usePrefix.js +11 -0
- package/dist/runtime/composables/useResizable.d.ts +4 -0
- package/dist/runtime/composables/useResizable.js +1 -1
- package/dist/runtime/locale/ar.js +1 -0
- package/dist/runtime/locale/az.js +1 -0
- package/dist/runtime/locale/be.js +1 -0
- package/dist/runtime/locale/bg.js +1 -0
- package/dist/runtime/locale/bn.js +1 -0
- package/dist/runtime/locale/ca.js +1 -0
- package/dist/runtime/locale/ckb.js +1 -0
- package/dist/runtime/locale/cs.js +1 -0
- package/dist/runtime/locale/da.js +1 -0
- package/dist/runtime/locale/de.js +1 -0
- package/dist/runtime/locale/de_ch.js +1 -0
- package/dist/runtime/locale/el.js +1 -0
- package/dist/runtime/locale/en.js +1 -0
- package/dist/runtime/locale/es.js +1 -0
- package/dist/runtime/locale/et.js +1 -0
- package/dist/runtime/locale/eu.js +1 -0
- package/dist/runtime/locale/fa_ir.js +1 -0
- package/dist/runtime/locale/fi.js +1 -0
- package/dist/runtime/locale/fr.js +1 -0
- package/dist/runtime/locale/gl.js +1 -0
- package/dist/runtime/locale/he.js +1 -0
- package/dist/runtime/locale/hi.js +1 -0
- package/dist/runtime/locale/hr.js +1 -0
- package/dist/runtime/locale/hu.js +1 -0
- package/dist/runtime/locale/hy.js +1 -0
- package/dist/runtime/locale/id.js +1 -0
- package/dist/runtime/locale/is.js +1 -0
- package/dist/runtime/locale/it.js +1 -0
- package/dist/runtime/locale/ja.js +1 -0
- package/dist/runtime/locale/ka.js +1 -0
- package/dist/runtime/locale/kk.js +1 -0
- package/dist/runtime/locale/km.js +1 -0
- package/dist/runtime/locale/ko.js +1 -0
- package/dist/runtime/locale/ky.js +1 -0
- package/dist/runtime/locale/lb.js +1 -0
- package/dist/runtime/locale/lo.js +1 -0
- package/dist/runtime/locale/lt.js +1 -0
- package/dist/runtime/locale/mn.js +1 -0
- package/dist/runtime/locale/ms.js +1 -0
- package/dist/runtime/locale/nb_no.js +1 -0
- package/dist/runtime/locale/nl.js +1 -0
- package/dist/runtime/locale/pl.js +1 -0
- package/dist/runtime/locale/pt.js +1 -0
- package/dist/runtime/locale/pt_br.js +1 -0
- package/dist/runtime/locale/ro.js +1 -0
- package/dist/runtime/locale/ru.js +1 -0
- package/dist/runtime/locale/sk.js +1 -0
- package/dist/runtime/locale/sl.js +1 -0
- package/dist/runtime/locale/sq.js +1 -0
- package/dist/runtime/locale/sv.js +1 -0
- package/dist/runtime/locale/th.js +1 -0
- package/dist/runtime/locale/tj.js +1 -0
- package/dist/runtime/locale/tr.js +1 -0
- package/dist/runtime/locale/ug_cn.js +1 -0
- package/dist/runtime/locale/uk.js +1 -0
- package/dist/runtime/locale/ur.js +1 -0
- package/dist/runtime/locale/uz.js +1 -0
- package/dist/runtime/locale/vi.js +1 -0
- package/dist/runtime/locale/zh_cn.js +1 -0
- package/dist/runtime/locale/zh_tw.js +1 -0
- package/dist/runtime/plugins/colors.js +1 -1
- package/dist/runtime/types/content.d.ts +1 -0
- package/dist/runtime/types/content.js +1 -0
- package/dist/runtime/types/form.d.ts +2 -2
- package/dist/runtime/types/locale.d.ts +1 -0
- package/dist/runtime/utils/dashboard.d.ts +1 -1
- package/dist/runtime/utils/link.d.ts +1 -1
- package/dist/runtime/utils/link.js +1 -0
- package/dist/runtime/utils/{fuse.d.ts → search.d.ts} +2 -1
- package/dist/runtime/utils/{fuse.js → search.js} +11 -2
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +1 -0
- package/dist/runtime/vue/overrides/inertia/Link.d.vue.ts +1 -1
- package/dist/runtime/vue/overrides/inertia/Link.vue +5 -0
- package/dist/runtime/vue/overrides/inertia/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/overrides/none/Link.d.vue.ts +1 -1
- package/dist/runtime/vue/overrides/none/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/overrides/vue-router/Link.d.vue.ts +1 -1
- package/dist/runtime/vue/overrides/vue-router/Link.vue.d.ts +1 -1
- package/dist/shared/{ui.BIQuJqNV.mjs → ui.CoJ8bnb0.mjs} +244 -83
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +27 -34
- package/dist/runtime/composables/useComponentUI.d.ts +0 -33
- package/dist/runtime/composables/useComponentUI.js +0 -13
- package/dist/runtime/composables/useResolvedVariants.d.ts +0 -21
- package/dist/runtime/composables/useResolvedVariants.js +0 -14
|
@@ -5,13 +5,13 @@ import theme from "#build/ui/dashboard-panel";
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, useId, toRef } from "vue";
|
|
7
7
|
import { useAppConfig } from "#imports";
|
|
8
|
-
import {
|
|
8
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
9
9
|
import { useResizable } from "../composables/useResizable";
|
|
10
10
|
import { useDashboard } from "../utils/dashboard";
|
|
11
11
|
import { tv } from "../utils/tv";
|
|
12
12
|
import UDashboardResizeHandle from "./DashboardResizeHandle.vue";
|
|
13
13
|
defineOptions({ inheritAttrs: false });
|
|
14
|
-
const
|
|
14
|
+
const _props = defineProps({
|
|
15
15
|
class: { type: null, required: false },
|
|
16
16
|
ui: { type: Object, required: false },
|
|
17
17
|
id: { type: String, required: false },
|
|
@@ -21,8 +21,8 @@ const props = defineProps({
|
|
|
21
21
|
resizable: { type: Boolean, required: false, default: false }
|
|
22
22
|
});
|
|
23
23
|
defineSlots();
|
|
24
|
+
const props = useComponentProps("dashboardPanel", _props);
|
|
24
25
|
const appConfig = useAppConfig();
|
|
25
|
-
const uiProp = useComponentUI("dashboardPanel", props);
|
|
26
26
|
const dashboardContext = useDashboard({ storageKey: "dashboard", unit: "%" });
|
|
27
27
|
const id = `${dashboardContext.storageKey}-panel-${props.id || useId()}`;
|
|
28
28
|
const { el, size, isDragging, onMouseDown, onTouchStart, onDoubleClick } = useResizable(id, toRef(() => ({ ...dashboardContext, ...props })));
|
|
@@ -38,13 +38,13 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardPane
|
|
|
38
38
|
v-bind="$attrs"
|
|
39
39
|
:data-dragging="isDragging"
|
|
40
40
|
data-slot="root"
|
|
41
|
-
:class="ui.root({ class: [
|
|
41
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
42
42
|
:style="[size ? { '--width': `${size}${dashboardContext.unit}` } : void 0]"
|
|
43
43
|
>
|
|
44
44
|
<slot>
|
|
45
45
|
<slot name="header" />
|
|
46
46
|
|
|
47
|
-
<div data-slot="body" :class="ui.body({ class:
|
|
47
|
+
<div data-slot="body" :class="ui.body({ class: props.ui?.body })">
|
|
48
48
|
<slot name="body" />
|
|
49
49
|
</div>
|
|
50
50
|
|
|
@@ -54,10 +54,10 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardPane
|
|
|
54
54
|
|
|
55
55
|
<slot name="resize-handle" :on-mouse-down="onMouseDown" :on-touch-start="onTouchStart" :on-double-click="onDoubleClick">
|
|
56
56
|
<UDashboardResizeHandle
|
|
57
|
-
v-if="resizable"
|
|
57
|
+
v-if="props.resizable"
|
|
58
58
|
:aria-controls="id"
|
|
59
59
|
data-slot="handle"
|
|
60
|
-
:class="ui.handle({ class:
|
|
60
|
+
:class="ui.handle({ class: props.ui?.handle })"
|
|
61
61
|
@mousedown="onMouseDown"
|
|
62
62
|
@touchstart="onTouchStart"
|
|
63
63
|
@dblclick="onDoubleClick"
|
|
@@ -7,23 +7,23 @@ import { computed } from "vue";
|
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
9
|
import { tv } from "../utils/tv";
|
|
10
|
-
import {
|
|
11
|
-
const
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
|
+
const _props = defineProps({
|
|
12
12
|
as: { type: null, required: false },
|
|
13
13
|
class: { type: null, required: false },
|
|
14
14
|
ui: { type: Object, required: false }
|
|
15
15
|
});
|
|
16
16
|
defineSlots();
|
|
17
|
+
const props = useComponentProps("dashboardResizeHandle", _props);
|
|
17
18
|
const appConfig = useAppConfig();
|
|
18
|
-
const uiProp = useComponentUI("dashboardResizeHandle", props);
|
|
19
19
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardResizeHandle || {} }));
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
23
|
<Primitive
|
|
24
|
-
:as="as"
|
|
24
|
+
:as="props.as"
|
|
25
25
|
role="separator"
|
|
26
|
-
:class="ui({ class: [
|
|
26
|
+
:class="ui({ class: [props.ui?.base, props.class] })"
|
|
27
27
|
>
|
|
28
28
|
<slot />
|
|
29
29
|
</Primitive>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
3
|
import theme from '#build/ui/dashboard-search';
|
|
4
|
+
import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
|
|
4
5
|
import type { ButtonProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, LinkPropsKeys } from '../types';
|
|
5
6
|
import type { ComponentConfig } from '../types/tv';
|
|
6
7
|
type DashboardSearch = ComponentConfig<typeof theme, AppConfig, 'dashboardSearch'>;
|
|
7
|
-
export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPaletteItem> extends Pick<ModalProps, 'title' | 'description' | 'overlay' | 'transition' | 'content' | 'dismissible' | 'fullscreen' | 'modal' | 'portal'>, Pick<CommandPaletteProps<CommandPaletteGroup<T>, T>, 'icon' | 'placeholder' | 'autofocus' | 'loading' | 'loadingIcon' | 'closeIcon' | 'groups'
|
|
8
|
+
export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPaletteItem> extends Pick<ModalProps, 'title' | 'description' | 'overlay' | 'transition' | 'content' | 'dismissible' | 'fullscreen' | 'modal' | 'portal'>, Pick<CommandPaletteProps<CommandPaletteGroup<T>, T>, 'icon' | 'placeholder' | 'autofocus' | 'loading' | 'loadingIcon' | 'closeIcon' | 'groups'> {
|
|
8
9
|
/**
|
|
9
10
|
* @defaultValue 'md'
|
|
10
11
|
*/
|
|
@@ -21,6 +22,20 @@ export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPale
|
|
|
21
22
|
* @defaultValue 'meta_k'
|
|
22
23
|
*/
|
|
23
24
|
shortcut?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Options for [useFuse](https://vueuse.org/integrations/useFuse) passed to the [CommandPalette](https://ui.nuxt.com/docs/components/command-palette).
|
|
27
|
+
* @defaultValue {
|
|
28
|
+
fuseOptions: {
|
|
29
|
+
ignoreLocation: true,
|
|
30
|
+
useTokenSearch: true,
|
|
31
|
+
threshold: 0.1,
|
|
32
|
+
keys: ['label', 'description', 'suffix']
|
|
33
|
+
},
|
|
34
|
+
resultLimit: 12,
|
|
35
|
+
matchAllWhenSearchEmpty: true
|
|
36
|
+
}
|
|
37
|
+
*/
|
|
38
|
+
fuse?: UseFuseOptions<T>;
|
|
24
39
|
/**
|
|
25
40
|
* Delay (in milliseconds) before the search term is passed to Fuse (debounced).
|
|
26
41
|
* Useful for large datasets where running fuzzy search on every keystroke is the bottleneck — the input stays responsive while Fuse only re-runs after typing settles.
|
|
@@ -4,20 +4,21 @@ import theme from "#build/ui/dashboard-search";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, useTemplateRef } from "vue";
|
|
7
|
-
import { useForwardProps } from "reka-ui";
|
|
8
7
|
import { defu } from "defu";
|
|
9
8
|
import { reactivePick } from "@vueuse/core";
|
|
10
9
|
import { useAppConfig, useColorMode, defineShortcuts, useRuntimeHook } from "#imports";
|
|
11
|
-
import {
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
12
12
|
import { useLocale } from "../composables/useLocale";
|
|
13
13
|
import { omit, transformUI } from "../utils";
|
|
14
14
|
import { tv } from "../utils/tv";
|
|
15
15
|
import UCommandPalette from "./CommandPalette.vue";
|
|
16
16
|
import UModal from "./Modal.vue";
|
|
17
|
-
const
|
|
17
|
+
const _props = defineProps({
|
|
18
18
|
size: { type: null, required: false },
|
|
19
19
|
close: { type: [Boolean, Object], required: false, default: true },
|
|
20
20
|
shortcut: { type: String, required: false, default: "meta_k" },
|
|
21
|
+
fuse: { type: Object, required: false },
|
|
21
22
|
searchDelay: { type: Number, required: false, default: 100 },
|
|
22
23
|
colorMode: { type: Boolean, required: false, default: true },
|
|
23
24
|
class: { type: null, required: false },
|
|
@@ -37,10 +38,10 @@ const props = defineProps({
|
|
|
37
38
|
loading: { type: Boolean, required: false },
|
|
38
39
|
loadingIcon: { type: null, required: false },
|
|
39
40
|
closeIcon: { type: null, required: false },
|
|
40
|
-
groups: { type: Array, required: false }
|
|
41
|
-
fuse: { type: Object, required: false }
|
|
41
|
+
groups: { type: Array, required: false }
|
|
42
42
|
});
|
|
43
43
|
const slots = defineSlots();
|
|
44
|
+
const props = useComponentProps("dashboardSearch", _props);
|
|
44
45
|
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
45
46
|
const searchTerm = defineModel("searchTerm", { type: String, ...{ default: "" } });
|
|
46
47
|
useRuntimeHook("dashboard:search:toggle", () => {
|
|
@@ -49,12 +50,13 @@ useRuntimeHook("dashboard:search:toggle", () => {
|
|
|
49
50
|
const { t } = useLocale();
|
|
50
51
|
const colorMode = useColorMode();
|
|
51
52
|
const appConfig = useAppConfig();
|
|
52
|
-
const uiProp = useComponentUI("dashboardSearch", props);
|
|
53
53
|
const commandPaletteProps = useForwardProps(reactivePick(props, "size", "icon", "placeholder", "autofocus", "loading", "loadingIcon", "close", "closeIcon", "searchDelay"));
|
|
54
54
|
const modalProps = useForwardProps(reactivePick(props, "overlay", "transition", "content", "dismissible", "fullscreen", "modal", "portal"));
|
|
55
55
|
const getProxySlots = () => omit(slots, ["content"]);
|
|
56
56
|
const fuse = computed(() => defu({}, props.fuse, {
|
|
57
|
-
fuseOptions: {
|
|
57
|
+
fuseOptions: {
|
|
58
|
+
useTokenSearch: true
|
|
59
|
+
}
|
|
58
60
|
}));
|
|
59
61
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSearch || {} })({
|
|
60
62
|
size: props.size,
|
|
@@ -115,11 +117,11 @@ defineExpose({
|
|
|
115
117
|
<template>
|
|
116
118
|
<UModal
|
|
117
119
|
v-model:open="open"
|
|
118
|
-
:title="title || t('dashboardSearch.title')"
|
|
119
|
-
:description="description || t('dashboardSearch.description')"
|
|
120
|
+
:title="props.title || t('dashboardSearch.title')"
|
|
121
|
+
:description="props.description || t('dashboardSearch.description')"
|
|
120
122
|
v-bind="modalProps"
|
|
121
123
|
data-slot="modal"
|
|
122
|
-
:class="ui.modal({ class: [
|
|
124
|
+
:class="ui.modal({ class: [props.ui?.modal, props.class] })"
|
|
123
125
|
>
|
|
124
126
|
<template #content="contentData">
|
|
125
127
|
<slot name="content" v-bind="contentData">
|
|
@@ -130,7 +132,7 @@ defineExpose({
|
|
|
130
132
|
:groups="groups"
|
|
131
133
|
:fuse="fuse"
|
|
132
134
|
:input="{ fixed: true }"
|
|
133
|
-
:ui="transformUI(omit(ui, ['modal']),
|
|
135
|
+
:ui="transformUI(omit(ui, ['modal']), props.ui)"
|
|
134
136
|
@update:model-value="onSelect"
|
|
135
137
|
@update:open="open = $event"
|
|
136
138
|
>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
3
|
import theme from '#build/ui/dashboard-search';
|
|
4
|
+
import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
|
|
4
5
|
import type { ButtonProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, LinkPropsKeys } from '../types';
|
|
5
6
|
import type { ComponentConfig } from '../types/tv';
|
|
6
7
|
type DashboardSearch = ComponentConfig<typeof theme, AppConfig, 'dashboardSearch'>;
|
|
7
|
-
export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPaletteItem> extends Pick<ModalProps, 'title' | 'description' | 'overlay' | 'transition' | 'content' | 'dismissible' | 'fullscreen' | 'modal' | 'portal'>, Pick<CommandPaletteProps<CommandPaletteGroup<T>, T>, 'icon' | 'placeholder' | 'autofocus' | 'loading' | 'loadingIcon' | 'closeIcon' | 'groups'
|
|
8
|
+
export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPaletteItem> extends Pick<ModalProps, 'title' | 'description' | 'overlay' | 'transition' | 'content' | 'dismissible' | 'fullscreen' | 'modal' | 'portal'>, Pick<CommandPaletteProps<CommandPaletteGroup<T>, T>, 'icon' | 'placeholder' | 'autofocus' | 'loading' | 'loadingIcon' | 'closeIcon' | 'groups'> {
|
|
8
9
|
/**
|
|
9
10
|
* @defaultValue 'md'
|
|
10
11
|
*/
|
|
@@ -21,6 +22,20 @@ export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPale
|
|
|
21
22
|
* @defaultValue 'meta_k'
|
|
22
23
|
*/
|
|
23
24
|
shortcut?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Options for [useFuse](https://vueuse.org/integrations/useFuse) passed to the [CommandPalette](https://ui.nuxt.com/docs/components/command-palette).
|
|
27
|
+
* @defaultValue {
|
|
28
|
+
fuseOptions: {
|
|
29
|
+
ignoreLocation: true,
|
|
30
|
+
useTokenSearch: true,
|
|
31
|
+
threshold: 0.1,
|
|
32
|
+
keys: ['label', 'description', 'suffix']
|
|
33
|
+
},
|
|
34
|
+
resultLimit: 12,
|
|
35
|
+
matchAllWhenSearchEmpty: true
|
|
36
|
+
}
|
|
37
|
+
*/
|
|
38
|
+
fuse?: UseFuseOptions<T>;
|
|
24
39
|
/**
|
|
25
40
|
* Delay (in milliseconds) before the search term is passed to Fuse (debounced).
|
|
26
41
|
* Useful for large datasets where running fuzzy search on every keystroke is the bottleneck — the input stays responsive while Fuse only re-runs after typing settles.
|
|
@@ -47,10 +47,10 @@ export interface DashboardSearchButtonProps extends Omit<ButtonProps, LinkPropsK
|
|
|
47
47
|
declare const _default: typeof __VLS_export;
|
|
48
48
|
export default _default;
|
|
49
49
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DashboardSearchButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSearchButtonProps> & Readonly<{}>, {
|
|
50
|
-
color: "error" | "primary" | "secondary" | "success" | "info" | "warning"
|
|
51
|
-
collapsed: boolean;
|
|
50
|
+
color: "error" | "neutral" | "primary" | "secondary" | "success" | "info" | "warning";
|
|
52
51
|
tooltip: boolean | TooltipProps;
|
|
53
52
|
kbds: KbdProps["value"][] | KbdProps[];
|
|
53
|
+
collapsed: boolean;
|
|
54
54
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ButtonSlots>;
|
|
55
55
|
type __VLS_WithSlots<T, S> = T & {
|
|
56
56
|
new (): {
|
|
@@ -4,11 +4,11 @@ import theme from "#build/ui/dashboard-search-button";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
|
-
import { useForwardProps } from "reka-ui";
|
|
8
7
|
import { defu } from "defu";
|
|
9
8
|
import { reactiveOmit, createReusableTemplate } from "@vueuse/core";
|
|
10
9
|
import { useAppConfig } from "#imports";
|
|
11
|
-
import {
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
12
12
|
import { useLocale } from "../composables/useLocale";
|
|
13
13
|
import { useDashboard } from "../utils/dashboard";
|
|
14
14
|
import { omit, transformUI } from "../utils";
|
|
@@ -17,7 +17,7 @@ import UButton from "./Button.vue";
|
|
|
17
17
|
import UKbd from "./Kbd.vue";
|
|
18
18
|
import UTooltip from "./Tooltip.vue";
|
|
19
19
|
defineOptions({ inheritAttrs: false });
|
|
20
|
-
const
|
|
20
|
+
const _props = defineProps({
|
|
21
21
|
icon: { type: null, required: false },
|
|
22
22
|
label: { type: String, required: false },
|
|
23
23
|
color: { type: null, required: false, default: "neutral" },
|
|
@@ -48,13 +48,13 @@ const props = defineProps({
|
|
|
48
48
|
viewTransition: { type: Boolean, required: false }
|
|
49
49
|
});
|
|
50
50
|
const slots = defineSlots();
|
|
51
|
+
const props = useComponentProps("dashboardSearchButton", _props);
|
|
51
52
|
const [DefineButtonTemplate, ReuseButtonTemplate] = createReusableTemplate();
|
|
52
53
|
const getProxySlots = () => omit(slots, ["trailing"]);
|
|
53
54
|
const buttonProps = useForwardProps(reactiveOmit(props, "icon", "label", "variant", "collapsed", "tooltip", "kbds", "class", "ui"));
|
|
54
55
|
const tooltipProps = toRef(() => defu(typeof props.tooltip === "boolean" ? {} : props.tooltip, { delayDuration: 0, content: { side: "right" } }));
|
|
55
56
|
const { t } = useLocale();
|
|
56
57
|
const appConfig = useAppConfig();
|
|
57
|
-
const uiProp = useComponentUI("dashboardSearchButton", props);
|
|
58
58
|
const { toggleSearch } = useDashboard({ toggleSearch: () => {
|
|
59
59
|
} });
|
|
60
60
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSearchButton || {} })({
|
|
@@ -65,19 +65,19 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSear
|
|
|
65
65
|
<template>
|
|
66
66
|
<DefineButtonTemplate>
|
|
67
67
|
<UButton
|
|
68
|
-
:icon="icon || appConfig.ui.icons.search"
|
|
69
|
-
:label="label || t('dashboardSearchButton.label')"
|
|
70
|
-
:variant="variant || (collapsed ? 'ghost' : 'outline')"
|
|
68
|
+
:icon="props.icon || appConfig.ui.icons.search"
|
|
69
|
+
:label="props.label || t('dashboardSearchButton.label')"
|
|
70
|
+
:variant="props.variant || (props.collapsed ? 'ghost' : 'outline')"
|
|
71
71
|
v-bind="{
|
|
72
72
|
...buttonProps,
|
|
73
|
-
...collapsed ? {
|
|
73
|
+
...props.collapsed ? {
|
|
74
74
|
'square': true,
|
|
75
|
-
'aria-label': label || t('dashboardSearchButton.label')
|
|
75
|
+
'aria-label': props.label || t('dashboardSearchButton.label')
|
|
76
76
|
} : {},
|
|
77
77
|
...$attrs
|
|
78
78
|
}"
|
|
79
|
-
:class="ui.base({ class: [
|
|
80
|
-
:ui="transformUI(ui,
|
|
79
|
+
:class="ui.base({ class: [props.ui?.base, props.class] })"
|
|
80
|
+
:ui="transformUI(ui, props.ui)"
|
|
81
81
|
@click="toggleSearch"
|
|
82
82
|
>
|
|
83
83
|
<template v-for="(_, name) in getProxySlots()" #[name]="slotData">
|
|
@@ -85,10 +85,10 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSear
|
|
|
85
85
|
</template>
|
|
86
86
|
|
|
87
87
|
<template #trailing="{ ui: uiProxy }">
|
|
88
|
-
<span data-slot="trailing" :class="ui.trailing({ class:
|
|
88
|
+
<span data-slot="trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
89
89
|
<slot name="trailing" :ui="uiProxy">
|
|
90
|
-
<template v-if="kbds?.length">
|
|
91
|
-
<UKbd v-for="(kbd, index) in kbds" :key="index" variant="subtle" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
90
|
+
<template v-if="props.kbds?.length">
|
|
91
|
+
<UKbd v-for="(kbd, index) in props.kbds" :key="index" variant="subtle" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
92
92
|
</template>
|
|
93
93
|
</slot>
|
|
94
94
|
</span>
|
|
@@ -96,7 +96,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSear
|
|
|
96
96
|
</UButton>
|
|
97
97
|
</DefineButtonTemplate>
|
|
98
98
|
|
|
99
|
-
<UTooltip v-if="collapsed && tooltip" :text="label || t('dashboardSearchButton.label')" v-bind="tooltipProps">
|
|
99
|
+
<UTooltip v-if="props.collapsed && props.tooltip" :text="props.label || t('dashboardSearchButton.label')" v-bind="tooltipProps">
|
|
100
100
|
<ReuseButtonTemplate />
|
|
101
101
|
</UTooltip>
|
|
102
102
|
<ReuseButtonTemplate v-else />
|
|
@@ -47,10 +47,10 @@ export interface DashboardSearchButtonProps extends Omit<ButtonProps, LinkPropsK
|
|
|
47
47
|
declare const _default: typeof __VLS_export;
|
|
48
48
|
export default _default;
|
|
49
49
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DashboardSearchButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSearchButtonProps> & Readonly<{}>, {
|
|
50
|
-
color: "error" | "primary" | "secondary" | "success" | "info" | "warning"
|
|
51
|
-
collapsed: boolean;
|
|
50
|
+
color: "error" | "neutral" | "primary" | "secondary" | "success" | "info" | "warning";
|
|
52
51
|
tooltip: boolean | TooltipProps;
|
|
53
52
|
kbds: KbdProps["value"][] | KbdProps[];
|
|
53
|
+
collapsed: boolean;
|
|
54
54
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ButtonSlots>;
|
|
55
55
|
type __VLS_WithSlots<T, S> = T & {
|
|
56
56
|
new (): {
|
|
@@ -10,7 +10,7 @@ type DashboardSidebarMenu<T> = T extends 'modal' ? ModalProps : T extends 'slide
|
|
|
10
10
|
export interface DashboardSidebarProps<T extends DashboardSidebarMode = DashboardSidebarMode> extends Pick<UseResizableProps, 'id' | 'side' | 'minSize' | 'maxSize' | 'defaultSize' | 'resizable' | 'collapsible' | 'collapsedSize'> {
|
|
11
11
|
/**
|
|
12
12
|
* The mode of the sidebar menu.
|
|
13
|
-
* @defaultValue '
|
|
13
|
+
* @defaultValue 'slideover'
|
|
14
14
|
*/
|
|
15
15
|
mode?: T;
|
|
16
16
|
/**
|
|
@@ -7,7 +7,7 @@ import { ref, computed, toRef, useId, watch } from "vue";
|
|
|
7
7
|
import { defu } from "defu";
|
|
8
8
|
import { createReusableTemplate } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig, useRuntimeHook, useRoute } from "#imports";
|
|
10
|
-
import {
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
11
|
import { useResizable } from "../composables/useResizable";
|
|
12
12
|
import { useLocale } from "../composables/useLocale";
|
|
13
13
|
import { useDashboard } from "../utils/dashboard";
|
|
@@ -18,7 +18,7 @@ import USlideover from "./Slideover.vue";
|
|
|
18
18
|
import UModal from "./Modal.vue";
|
|
19
19
|
import UDrawer from "./Drawer.vue";
|
|
20
20
|
defineOptions({ inheritAttrs: false });
|
|
21
|
-
const
|
|
21
|
+
const _props = defineProps({
|
|
22
22
|
mode: { type: null, required: false, default: "slideover" },
|
|
23
23
|
menu: { type: null, required: false },
|
|
24
24
|
toggle: { type: [Boolean, Object], required: false, default: true },
|
|
@@ -36,12 +36,12 @@ const props = defineProps({
|
|
|
36
36
|
collapsedSize: { type: Number, required: false, default: 0 }
|
|
37
37
|
});
|
|
38
38
|
const slots = defineSlots();
|
|
39
|
+
const props = useComponentProps("dashboardSidebar", _props);
|
|
39
40
|
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
40
41
|
const collapsed = defineModel("collapsed", { type: Boolean, ...{ default: false } });
|
|
41
42
|
const route = useRoute();
|
|
42
43
|
const { t } = useLocale();
|
|
43
44
|
const appConfig = useAppConfig();
|
|
44
|
-
const uiProp = useComponentUI("dashboardSidebar", props);
|
|
45
45
|
const dashboardContext = useDashboard({
|
|
46
46
|
storageKey: "dashboard",
|
|
47
47
|
unit: "%",
|
|
@@ -82,11 +82,11 @@ function toggleOpen() {
|
|
|
82
82
|
<DefineToggleTemplate>
|
|
83
83
|
<slot name="toggle" :open="open" :toggle="toggleOpen" :ui="ui">
|
|
84
84
|
<UDashboardSidebarToggle
|
|
85
|
-
v-if="toggle"
|
|
86
|
-
v-bind="typeof toggle === 'object' ? toggle : {}"
|
|
87
|
-
:side="toggleSide"
|
|
85
|
+
v-if="props.toggle"
|
|
86
|
+
v-bind="typeof props.toggle === 'object' ? props.toggle : {}"
|
|
87
|
+
:side="props.toggleSide"
|
|
88
88
|
data-slot="toggle"
|
|
89
|
-
:class="ui.toggle({ class:
|
|
89
|
+
:class="ui.toggle({ class: props.ui?.toggle, toggleSide: props.toggleSide })"
|
|
90
90
|
/>
|
|
91
91
|
</slot>
|
|
92
92
|
</DefineToggleTemplate>
|
|
@@ -94,10 +94,10 @@ function toggleOpen() {
|
|
|
94
94
|
<DefineResizeHandleTemplate>
|
|
95
95
|
<slot name="resize-handle" :on-mouse-down="onMouseDown" :on-touch-start="onTouchStart" :on-double-click="onDoubleClick" :ui="ui">
|
|
96
96
|
<UDashboardResizeHandle
|
|
97
|
-
v-if="resizable"
|
|
97
|
+
v-if="props.resizable"
|
|
98
98
|
:aria-controls="id"
|
|
99
99
|
data-slot="handle"
|
|
100
|
-
:class="ui.handle({ class:
|
|
100
|
+
:class="ui.handle({ class: props.ui?.handle })"
|
|
101
101
|
@mousedown="onMouseDown"
|
|
102
102
|
@touchstart="onTouchStart"
|
|
103
103
|
@dblclick="onDoubleClick"
|
|
@@ -105,7 +105,7 @@ function toggleOpen() {
|
|
|
105
105
|
</slot>
|
|
106
106
|
</DefineResizeHandleTemplate>
|
|
107
107
|
|
|
108
|
-
<ReuseResizeHandleTemplate v-if="side === 'right'" />
|
|
108
|
+
<ReuseResizeHandleTemplate v-if="props.side === 'right'" />
|
|
109
109
|
|
|
110
110
|
<div
|
|
111
111
|
:id="id"
|
|
@@ -114,23 +114,23 @@ function toggleOpen() {
|
|
|
114
114
|
:data-collapsed="isCollapsed"
|
|
115
115
|
:data-dragging="isDragging"
|
|
116
116
|
data-slot="root"
|
|
117
|
-
:class="ui.root({ class: [
|
|
117
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
118
118
|
:style="{ '--width': `${size || 0}${dashboardContext.unit}` }"
|
|
119
119
|
>
|
|
120
|
-
<div v-if="!!slots.header" data-slot="header" :class="ui.header({ class:
|
|
120
|
+
<div v-if="!!slots.header" data-slot="header" :class="ui.header({ class: props.ui?.header })">
|
|
121
121
|
<slot name="header" :collapsed="isCollapsed" :collapse="collapse" />
|
|
122
122
|
</div>
|
|
123
123
|
|
|
124
|
-
<div data-slot="body" :class="ui.body({ class:
|
|
124
|
+
<div data-slot="body" :class="ui.body({ class: props.ui?.body })">
|
|
125
125
|
<slot :collapsed="isCollapsed" :collapse="collapse" />
|
|
126
126
|
</div>
|
|
127
127
|
|
|
128
|
-
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class:
|
|
128
|
+
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
129
129
|
<slot name="footer" :collapsed="isCollapsed" :collapse="collapse" />
|
|
130
130
|
</div>
|
|
131
131
|
</div>
|
|
132
132
|
|
|
133
|
-
<ReuseResizeHandleTemplate v-if="side === 'left'" />
|
|
133
|
+
<ReuseResizeHandleTemplate v-if="props.side === 'left'" />
|
|
134
134
|
|
|
135
135
|
<Menu
|
|
136
136
|
v-model:open="open"
|
|
@@ -138,27 +138,27 @@ function toggleOpen() {
|
|
|
138
138
|
:description="t('dashboardSidebar.description')"
|
|
139
139
|
v-bind="menuProps"
|
|
140
140
|
:ui="{
|
|
141
|
-
overlay: ui.overlay({ class:
|
|
142
|
-
content: ui.content({ class:
|
|
141
|
+
overlay: ui.overlay({ class: props.ui?.overlay }),
|
|
142
|
+
content: ui.content({ class: props.ui?.content })
|
|
143
143
|
}"
|
|
144
144
|
>
|
|
145
145
|
<template #content="contentData">
|
|
146
146
|
<slot name="content" v-bind="contentData">
|
|
147
|
-
<div v-if="!!slots.header || mode !== 'drawer'" data-slot="header" :class="ui.header({ class:
|
|
148
|
-
<ReuseToggleTemplate v-if="mode !== 'drawer' && toggleSide === 'left'" />
|
|
147
|
+
<div v-if="!!slots.header || props.mode !== 'drawer'" data-slot="header" :class="ui.header({ class: props.ui?.header, menu: true })">
|
|
148
|
+
<ReuseToggleTemplate v-if="props.mode !== 'drawer' && props.toggleSide === 'left'" />
|
|
149
149
|
|
|
150
150
|
<slot name="header" :collapsed="false" :collapse="() => {
|
|
151
151
|
}" />
|
|
152
152
|
|
|
153
|
-
<ReuseToggleTemplate v-if="mode !== 'drawer' && toggleSide === 'right'" />
|
|
153
|
+
<ReuseToggleTemplate v-if="props.mode !== 'drawer' && props.toggleSide === 'right'" />
|
|
154
154
|
</div>
|
|
155
155
|
|
|
156
|
-
<div data-slot="body" :class="ui.body({ class:
|
|
156
|
+
<div data-slot="body" :class="ui.body({ class: props.ui?.body, menu: true })">
|
|
157
157
|
<slot :collapsed="false" :collapse="() => {
|
|
158
158
|
}" />
|
|
159
159
|
</div>
|
|
160
160
|
|
|
161
|
-
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class:
|
|
161
|
+
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class: props.ui?.footer, menu: true })">
|
|
162
162
|
<slot name="footer" :collapsed="false" :collapse="() => {
|
|
163
163
|
}" />
|
|
164
164
|
</div>
|
|
@@ -10,7 +10,7 @@ type DashboardSidebarMenu<T> = T extends 'modal' ? ModalProps : T extends 'slide
|
|
|
10
10
|
export interface DashboardSidebarProps<T extends DashboardSidebarMode = DashboardSidebarMode> extends Pick<UseResizableProps, 'id' | 'side' | 'minSize' | 'maxSize' | 'defaultSize' | 'resizable' | 'collapsible' | 'collapsedSize'> {
|
|
11
11
|
/**
|
|
12
12
|
* The mode of the sidebar menu.
|
|
13
|
-
* @defaultValue '
|
|
13
|
+
* @defaultValue 'slideover'
|
|
14
14
|
*/
|
|
15
15
|
mode?: T;
|
|
16
16
|
/**
|
|
@@ -20,7 +20,7 @@ export interface DashboardSidebarCollapseProps extends Omit<ButtonProps, LinkPro
|
|
|
20
20
|
declare const _default: typeof __VLS_export;
|
|
21
21
|
export default _default;
|
|
22
22
|
declare const __VLS_export: import("vue").DefineComponent<DashboardSidebarCollapseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSidebarCollapseProps> & Readonly<{}>, {
|
|
23
|
-
color: "error" | "primary" | "secondary" | "success" | "info" | "warning"
|
|
23
|
+
color: "error" | "neutral" | "primary" | "secondary" | "success" | "info" | "warning";
|
|
24
24
|
variant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
25
25
|
side: "left" | "right";
|
|
26
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -4,15 +4,15 @@ import theme from "#build/ui/dashboard-sidebar-collapse";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { ref, computed } from "vue";
|
|
7
|
-
import { useForwardProps } from "reka-ui";
|
|
8
7
|
import { reactiveOmit } from "@vueuse/core";
|
|
9
8
|
import { useAppConfig } from "#imports";
|
|
10
9
|
import { useLocale } from "../composables/useLocale";
|
|
11
|
-
import {
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
12
12
|
import { useDashboard } from "../utils/dashboard";
|
|
13
13
|
import { tv } from "../utils/tv";
|
|
14
14
|
import UButton from "./Button.vue";
|
|
15
|
-
const
|
|
15
|
+
const _props = defineProps({
|
|
16
16
|
color: { type: null, required: false, default: "neutral" },
|
|
17
17
|
variant: { type: null, required: false, default: "ghost" },
|
|
18
18
|
side: { type: String, required: false, default: "left" },
|
|
@@ -40,10 +40,10 @@ const props = defineProps({
|
|
|
40
40
|
exactActiveClass: { type: String, required: false },
|
|
41
41
|
viewTransition: { type: Boolean, required: false }
|
|
42
42
|
});
|
|
43
|
+
const props = useComponentProps("dashboardSidebarCollapse", _props);
|
|
43
44
|
const buttonProps = useForwardProps(reactiveOmit(props, "icon", "side", "class"));
|
|
44
45
|
const { t } = useLocale();
|
|
45
46
|
const appConfig = useAppConfig();
|
|
46
|
-
const uiProp = useComponentUI("dashboardSidebarCollapse", props);
|
|
47
47
|
const { sidebarCollapsed, collapseSidebar } = useDashboard({ sidebarCollapsed: ref(false), collapseSidebar: () => {
|
|
48
48
|
} });
|
|
49
49
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSidebarCollapse || {} }));
|
|
@@ -57,7 +57,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSide
|
|
|
57
57
|
'aria-label': sidebarCollapsed ? t('dashboardSidebarCollapse.expand') : t('dashboardSidebarCollapse.collapse'),
|
|
58
58
|
...$attrs
|
|
59
59
|
}"
|
|
60
|
-
:class="ui({ class: [
|
|
60
|
+
:class="ui({ class: [props.ui?.base, props.class], side: props.side })"
|
|
61
61
|
@click="collapseSidebar?.(!sidebarCollapsed)"
|
|
62
62
|
/>
|
|
63
63
|
</template>
|
|
@@ -20,7 +20,7 @@ export interface DashboardSidebarCollapseProps extends Omit<ButtonProps, LinkPro
|
|
|
20
20
|
declare const _default: typeof __VLS_export;
|
|
21
21
|
export default _default;
|
|
22
22
|
declare const __VLS_export: import("vue").DefineComponent<DashboardSidebarCollapseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSidebarCollapseProps> & Readonly<{}>, {
|
|
23
|
-
color: "error" | "primary" | "secondary" | "success" | "info" | "warning"
|
|
23
|
+
color: "error" | "neutral" | "primary" | "secondary" | "success" | "info" | "warning";
|
|
24
24
|
variant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
25
25
|
side: "left" | "right";
|
|
26
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -20,7 +20,7 @@ export interface DashboardSidebarToggleProps extends Omit<ButtonProps, LinkProps
|
|
|
20
20
|
declare const _default: typeof __VLS_export;
|
|
21
21
|
export default _default;
|
|
22
22
|
declare const __VLS_export: import("vue").DefineComponent<DashboardSidebarToggleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSidebarToggleProps> & Readonly<{}>, {
|
|
23
|
-
color: "error" | "primary" | "secondary" | "success" | "info" | "warning"
|
|
23
|
+
color: "error" | "neutral" | "primary" | "secondary" | "success" | "info" | "warning";
|
|
24
24
|
variant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
25
25
|
side: "left" | "right";
|
|
26
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -4,16 +4,16 @@ import theme from "#build/ui/dashboard-sidebar-toggle";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { ref, computed } from "vue";
|
|
7
|
-
import { useForwardProps } from "reka-ui";
|
|
8
7
|
import { reactiveOmit } from "@vueuse/core";
|
|
9
8
|
import { useAppConfig } from "#imports";
|
|
10
9
|
import { useLocale } from "../composables/useLocale";
|
|
11
|
-
import {
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
12
12
|
import { useDashboard } from "../utils/dashboard";
|
|
13
13
|
import { tv } from "../utils/tv";
|
|
14
14
|
import UButton from "./Button.vue";
|
|
15
15
|
defineOptions({ inheritAttrs: false });
|
|
16
|
-
const
|
|
16
|
+
const _props = defineProps({
|
|
17
17
|
color: { type: null, required: false, default: "neutral" },
|
|
18
18
|
variant: { type: null, required: false, default: "ghost" },
|
|
19
19
|
side: { type: String, required: false, default: "left" },
|
|
@@ -41,10 +41,10 @@ const props = defineProps({
|
|
|
41
41
|
exactActiveClass: { type: String, required: false },
|
|
42
42
|
viewTransition: { type: Boolean, required: false }
|
|
43
43
|
});
|
|
44
|
+
const props = useComponentProps("dashboardSidebarToggle", _props);
|
|
44
45
|
const buttonProps = useForwardProps(reactiveOmit(props, "icon", "side", "class"));
|
|
45
46
|
const { t } = useLocale();
|
|
46
47
|
const appConfig = useAppConfig();
|
|
47
|
-
const uiProp = useComponentUI("dashboardSidebarToggle", props);
|
|
48
48
|
const { sidebarOpen, toggleSidebar } = useDashboard({ sidebarOpen: ref(false), toggleSidebar: () => {
|
|
49
49
|
} });
|
|
50
50
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSidebarToggle || {} }));
|
|
@@ -58,7 +58,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSide
|
|
|
58
58
|
'aria-label': sidebarOpen ? t('dashboardSidebarToggle.close') : t('dashboardSidebarToggle.open'),
|
|
59
59
|
...$attrs
|
|
60
60
|
}"
|
|
61
|
-
:class="ui({ class: [
|
|
61
|
+
:class="ui({ class: [props.ui?.base, props.class], side: props.side })"
|
|
62
62
|
@click="toggleSidebar"
|
|
63
63
|
/>
|
|
64
64
|
</template>
|
|
@@ -20,7 +20,7 @@ export interface DashboardSidebarToggleProps extends Omit<ButtonProps, LinkProps
|
|
|
20
20
|
declare const _default: typeof __VLS_export;
|
|
21
21
|
export default _default;
|
|
22
22
|
declare const __VLS_export: import("vue").DefineComponent<DashboardSidebarToggleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSidebarToggleProps> & Readonly<{}>, {
|
|
23
|
-
color: "error" | "primary" | "secondary" | "success" | "info" | "warning"
|
|
23
|
+
color: "error" | "neutral" | "primary" | "secondary" | "success" | "info" | "warning";
|
|
24
24
|
variant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
25
25
|
side: "left" | "right";
|
|
26
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|