@eslamdevui/ui 3.2.0-beta.1 → 3.2.0-beta.2
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/alert.ts +5 -0
- package/.nuxt/ui/badge.ts +5 -0
- package/.nuxt/ui/button-group.ts +13 -0
- package/.nuxt/ui/button.ts +5 -0
- package/.nuxt/ui/carousel.ts +5 -0
- package/.nuxt/ui/content/content-navigation.ts +339 -0
- package/.nuxt/ui/content/content-search-button.ts +6 -0
- package/.nuxt/ui/content/content-search.ts +6 -0
- package/.nuxt/ui/content/content-surround.ts +39 -0
- package/.nuxt/ui/content/content-toc.ts +150 -0
- package/.nuxt/ui/content/index.ts +5 -0
- package/.nuxt/ui/content-surround.ts +5 -0
- package/.nuxt/ui/content-toc.ts +6 -6
- package/.nuxt/ui/dashboard-navbar.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar-collapse.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar-toggle.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar.ts +10 -0
- package/.nuxt/ui/error.ts +9 -0
- package/.nuxt/ui/index.ts +48 -1
- package/.nuxt/ui/input-menu.ts +9 -0
- package/.nuxt/ui/input-number.ts +5 -0
- package/.nuxt/ui/input-tags.ts +9 -0
- package/.nuxt/ui/input.ts +9 -0
- package/.nuxt/ui/prose/a.ts +6 -0
- package/.nuxt/ui/prose/accordion-item.ts +3 -0
- package/.nuxt/ui/prose/accordion.ts +6 -0
- package/.nuxt/ui/prose/badge.ts +3 -0
- package/.nuxt/ui/prose/blockquote.ts +3 -0
- package/.nuxt/ui/prose/callout.ts +129 -0
- package/.nuxt/ui/prose/card-group.ts +3 -0
- package/.nuxt/ui/prose/card.ts +119 -0
- package/.nuxt/ui/prose/code-collapse.ts +19 -0
- package/.nuxt/ui/prose/code-group.ts +13 -0
- package/.nuxt/ui/prose/code-icon.ts +66 -0
- package/.nuxt/ui/prose/code-preview.ts +14 -0
- package/.nuxt/ui/prose/code-tree.ts +28 -0
- package/.nuxt/ui/prose/code.ts +27 -0
- package/.nuxt/ui/prose/collapsible.ts +12 -0
- package/.nuxt/ui/prose/em.ts +3 -0
- package/.nuxt/ui/prose/field-group.ts +3 -0
- package/.nuxt/ui/prose/field.ts +11 -0
- package/.nuxt/ui/prose/h1.ts +6 -0
- package/.nuxt/ui/prose/h2.ts +14 -0
- package/.nuxt/ui/prose/h3.ts +14 -0
- package/.nuxt/ui/prose/h4.ts +6 -0
- package/.nuxt/ui/prose/hr.ts +3 -0
- package/.nuxt/ui/prose/icon.ts +3 -0
- package/.nuxt/ui/prose/img.ts +3 -0
- package/.nuxt/ui/prose/index.ts +41 -0
- package/.nuxt/ui/prose/kbd.ts +3 -0
- package/.nuxt/ui/prose/li.ts +3 -0
- package/.nuxt/ui/prose/ol.ts +3 -0
- package/.nuxt/ui/prose/p.ts +3 -0
- package/.nuxt/ui/prose/pre.ts +17 -0
- package/.nuxt/ui/prose/steps.ts +19 -0
- package/.nuxt/ui/prose/strong.ts +3 -0
- package/.nuxt/ui/prose/table.ts +6 -0
- package/.nuxt/ui/prose/tabs-item.ts +3 -0
- package/.nuxt/ui/prose/tabs.ts +5 -0
- package/.nuxt/ui/prose/tbody.ts +3 -0
- package/.nuxt/ui/prose/td.ts +3 -0
- package/.nuxt/ui/prose/th.ts +3 -0
- package/.nuxt/ui/prose/thead.ts +3 -0
- package/.nuxt/ui/prose/tr.ts +3 -0
- package/.nuxt/ui/prose/ul.ts +3 -0
- package/.nuxt/ui/select-menu.ts +9 -0
- package/.nuxt/ui/select.ts +9 -0
- package/.nuxt/ui/textarea.ts +9 -0
- package/.nuxt/ui/toast.ts +5 -0
- package/LICENSE.md +9 -9
- package/README.md +147 -147
- package/cli/commands/make/component.mjs +95 -95
- package/cli/commands/make/index.mjs +14 -14
- package/cli/commands/make/locale.mjs +64 -64
- package/cli/index.mjs +15 -15
- package/cli/package.json +13 -13
- package/cli/templates.mjs +236 -228
- package/cli/utils.mjs +31 -31
- package/dist/module.json +1 -1
- package/dist/module.mjs +18 -13
- package/dist/runtime/components/Accordion.vue +36 -36
- package/dist/runtime/components/Alert.vue +46 -46
- package/dist/runtime/components/App.vue +10 -10
- package/dist/runtime/components/Avatar.vue +27 -27
- package/dist/runtime/components/AvatarGroup.vue +4 -4
- package/dist/runtime/components/Badge.vue +16 -16
- package/dist/runtime/components/Breadcrumb.vue +32 -32
- package/dist/runtime/components/Button.vue +28 -28
- package/dist/runtime/components/ButtonGroup.vue +3 -3
- package/dist/runtime/components/Calendar.vue +74 -74
- package/dist/runtime/components/Card.vue +13 -13
- package/dist/runtime/components/Carousel.vue +58 -58
- package/dist/runtime/components/ChatMessage.vue +35 -35
- package/dist/runtime/components/ChatMessages.vue +71 -71
- package/dist/runtime/components/ChatMessages.vue.d.ts +1 -2
- package/dist/runtime/components/ChatPrompt.vue +30 -31
- package/dist/runtime/components/ChatPrompt.vue.d.ts +4 -4
- package/dist/runtime/components/ChatPromptSubmit.vue +10 -10
- package/dist/runtime/components/Checkbox.vue +33 -33
- package/dist/runtime/components/CheckboxGroup.vue +32 -32
- package/dist/runtime/components/Chip.vue +11 -11
- package/dist/runtime/components/Collapsible.vue +9 -9
- package/dist/runtime/components/ColorPicker.vue +30 -30
- package/dist/runtime/components/CommandPalette.vue +117 -117
- package/dist/runtime/components/Container.vue +3 -3
- package/dist/runtime/components/ContextMenu.vue +22 -22
- package/dist/runtime/components/ContextMenuContent.vue +105 -105
- package/dist/runtime/components/DashboardGroup.vue +3 -3
- package/dist/runtime/components/DashboardNavbar.vue +41 -41
- package/dist/runtime/components/DashboardNavbar.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardPanel.vue +29 -29
- package/dist/runtime/components/DashboardPanel.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardResizeHandle.vue +7 -7
- package/dist/runtime/components/DashboardSearch.vue +24 -25
- package/dist/runtime/components/DashboardSearch.vue.d.ts +3 -3
- package/dist/runtime/components/DashboardSearchButton.vue +63 -41
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +7 -1
- package/dist/runtime/components/DashboardSidebar.vue +77 -77
- package/dist/runtime/components/DashboardSidebarCollapse.vue +7 -7
- package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.vue +14 -17
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +4 -6
- package/dist/runtime/components/Drawer.vue +55 -55
- package/dist/runtime/components/DropdownMenu.vue +24 -24
- package/dist/runtime/components/DropdownMenuContent.vue +107 -107
- package/dist/runtime/components/Error.vue +57 -0
- package/dist/runtime/components/Error.vue.d.ts +52 -0
- package/dist/runtime/components/Form.vue +8 -8
- package/dist/runtime/components/Form.vue.d.ts +1 -1
- package/dist/runtime/components/FormField.vue +37 -37
- package/dist/runtime/components/Icon.vue +1 -1
- package/dist/runtime/components/Input.vue +34 -34
- package/dist/runtime/components/InputMenu.vue +163 -163
- package/dist/runtime/components/InputNumber.vue +49 -49
- package/dist/runtime/components/InputTags.vue +55 -55
- package/dist/runtime/components/Kbd.vue +5 -5
- package/dist/runtime/components/Link.vue +14 -14
- package/dist/runtime/components/LinkBase.vue +8 -8
- package/dist/runtime/components/Modal.vue +69 -69
- package/dist/runtime/components/NavigationMenu.vue +166 -166
- package/dist/runtime/components/OverlayProvider.vue +9 -9
- package/dist/runtime/components/Pagination.vue +47 -47
- package/dist/runtime/components/PinInput.vue +20 -20
- package/dist/runtime/components/Popover.vue +17 -17
- package/dist/runtime/components/Progress.vue +19 -19
- package/dist/runtime/components/RadioGroup.vue +43 -43
- package/dist/runtime/components/Select.vue +96 -96
- package/dist/runtime/components/SelectMenu.vue +130 -130
- package/dist/runtime/components/Separator.vue +15 -15
- package/dist/runtime/components/Skeleton.vue +10 -10
- package/dist/runtime/components/Slideover.vue +76 -76
- package/dist/runtime/components/Slider.vue +27 -27
- package/dist/runtime/components/Stepper.vue +51 -51
- package/dist/runtime/components/Switch.vue +33 -33
- package/dist/runtime/components/Table.vue +77 -77
- package/dist/runtime/components/Tabs.vue +37 -37
- package/dist/runtime/components/Textarea.vue +33 -33
- package/dist/runtime/components/Timeline.vue +38 -38
- package/dist/runtime/components/Toast.vue +69 -69
- package/dist/runtime/components/Toaster.vue +28 -28
- package/dist/runtime/components/Tooltip.vue +19 -19
- package/dist/runtime/components/Tree.vue +60 -60
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +2 -2
- package/dist/runtime/components/color-mode/ColorModeButton.vue +16 -16
- package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +3 -3
- package/dist/runtime/components/color-mode/ColorModeImage.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeSelect.vue +19 -19
- package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +19 -19
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
- package/dist/runtime/components/content/ContentNavigation.vue +175 -0
- package/dist/runtime/components/content/ContentNavigation.vue.d.ts +53 -0
- package/dist/runtime/components/content/ContentSearch.vue +184 -0
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +111 -0
- package/dist/runtime/components/content/ContentSearchButton.vue +95 -0
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +12 -0
- package/dist/runtime/components/content/ContentSurround.vue +61 -0
- package/dist/runtime/components/content/ContentSurround.vue.d.ts +59 -0
- package/dist/runtime/components/content/ContentToc.vue +146 -0
- package/dist/runtime/components/content/ContentToc.vue.d.ts +88 -0
- package/dist/runtime/components/locale/LocaleSelect.vue +20 -20
- package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +1 -1
- package/dist/runtime/components/prose/A.vue +24 -0
- package/dist/runtime/components/prose/A.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Accordion.vue +43 -0
- package/dist/runtime/components/prose/Accordion.vue.d.ts +16 -0
- package/dist/runtime/components/prose/AccordionItem.vue +25 -0
- package/dist/runtime/components/prose/AccordionItem.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Badge.vue +21 -0
- package/dist/runtime/components/prose/Badge.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Blockquote.vue +21 -0
- package/dist/runtime/components/prose/Blockquote.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Callout.vue +60 -0
- package/dist/runtime/components/prose/Callout.vue.d.ts +26 -0
- package/dist/runtime/components/prose/Card.vue +83 -0
- package/dist/runtime/components/prose/Card.vue.d.ts +30 -0
- package/dist/runtime/components/prose/CardGroup.vue +21 -0
- package/dist/runtime/components/prose/CardGroup.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Code.vue +23 -0
- package/dist/runtime/components/prose/Code.vue.d.ts +22 -0
- package/dist/runtime/components/prose/CodeCollapse.vue +44 -0
- package/dist/runtime/components/prose/CodeCollapse.vue.d.ts +46 -0
- package/dist/runtime/components/prose/CodeGroup.vue +70 -0
- package/dist/runtime/components/prose/CodeGroup.vue.d.ts +37 -0
- package/dist/runtime/components/prose/CodeIcon.vue +28 -0
- package/dist/runtime/components/prose/CodeIcon.vue.d.ts +24 -0
- package/dist/runtime/components/prose/CodePreview.vue +28 -0
- package/dist/runtime/components/prose/CodePreview.vue.d.ts +19 -0
- package/dist/runtime/components/prose/CodeTree.vue +160 -0
- package/dist/runtime/components/prose/CodeTree.vue.d.ts +30 -0
- package/dist/runtime/components/prose/Collapsible.vue +41 -0
- package/dist/runtime/components/prose/Collapsible.vue.d.ts +38 -0
- package/dist/runtime/components/prose/Em.vue +19 -0
- package/dist/runtime/components/prose/Em.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Field.vue +48 -0
- package/dist/runtime/components/prose/Field.vue.d.ts +39 -0
- package/dist/runtime/components/prose/FieldGroup.vue +23 -0
- package/dist/runtime/components/prose/FieldGroup.vue.d.ts +18 -0
- package/dist/runtime/components/prose/H1.vue +28 -0
- package/dist/runtime/components/prose/H1.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H2.vue +32 -0
- package/dist/runtime/components/prose/H2.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H3.vue +32 -0
- package/dist/runtime/components/prose/H3.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H4.vue +28 -0
- package/dist/runtime/components/prose/H4.vue.d.ts +19 -0
- package/dist/runtime/components/prose/Hr.vue +18 -0
- package/dist/runtime/components/prose/Hr.vue.d.ts +5 -0
- package/dist/runtime/components/prose/Icon.vue +19 -0
- package/dist/runtime/components/prose/Icon.vue.d.ts +6 -0
- package/dist/runtime/components/prose/Img.vue +40 -0
- package/dist/runtime/components/prose/Img.vue.d.ts +9 -0
- package/dist/runtime/components/prose/Kbd.vue +19 -0
- package/dist/runtime/components/prose/Kbd.vue.d.ts +6 -0
- package/dist/runtime/components/prose/Li.vue +21 -0
- package/dist/runtime/components/prose/Li.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Ol.vue +21 -0
- package/dist/runtime/components/prose/Ol.vue.d.ts +13 -0
- package/dist/runtime/components/prose/P.vue +21 -0
- package/dist/runtime/components/prose/P.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Pre.vue +63 -0
- package/dist/runtime/components/prose/Pre.vue.d.ts +25 -0
- package/dist/runtime/components/prose/Script.vue +12 -0
- package/dist/runtime/components/prose/Script.vue.d.ts +12 -0
- package/dist/runtime/components/prose/Steps.vue +22 -0
- package/dist/runtime/components/prose/Steps.vue.d.ts +22 -0
- package/dist/runtime/components/prose/Strong.vue +21 -0
- package/dist/runtime/components/prose/Strong.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Table.vue +24 -0
- package/dist/runtime/components/prose/Table.vue.d.ts +18 -0
- package/dist/runtime/components/prose/Tabs.vue +78 -0
- package/dist/runtime/components/prose/Tabs.vue.d.ts +36 -0
- package/dist/runtime/components/prose/TabsItem.vue +25 -0
- package/dist/runtime/components/prose/TabsItem.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Tbody.vue +21 -0
- package/dist/runtime/components/prose/Tbody.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Td.vue +21 -0
- package/dist/runtime/components/prose/Td.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Th.vue +21 -0
- package/dist/runtime/components/prose/Th.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Thead.vue +21 -0
- package/dist/runtime/components/prose/Thead.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Tr.vue +21 -0
- package/dist/runtime/components/prose/Tr.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Ul.vue +21 -0
- package/dist/runtime/components/prose/Ul.vue.d.ts +13 -0
- package/dist/runtime/components/prose/callout/Caution.vue +11 -0
- package/dist/runtime/components/prose/callout/Caution.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Note.vue +11 -0
- package/dist/runtime/components/prose/callout/Note.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Tip.vue +11 -0
- package/dist/runtime/components/prose/callout/Tip.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Warning.vue +11 -0
- package/dist/runtime/components/prose/callout/Warning.vue.d.ts +14 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +2 -2
- package/dist/runtime/composables/usePortal.d.ts +1 -1
- package/dist/runtime/composables/useResizable.d.ts +1 -1
- package/dist/runtime/inertia/components/Link.vue +12 -12
- package/dist/runtime/inertia/components/LinkBase.vue +15 -15
- package/dist/runtime/types/app.config.d.ts +6 -6
- package/dist/runtime/types/content.d.ts +4 -1
- package/dist/runtime/types/content.js +4 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/prose.d.ts +42 -1
- package/dist/runtime/types/prose.js +42 -0
- package/dist/runtime/types/tv.d.ts +2 -2
- package/dist/runtime/utils/index.d.ts +1 -1
- package/dist/runtime/utils/index.js +13 -4
- package/dist/runtime/vue/components/Icon.vue +1 -1
- package/dist/runtime/vue/components/Link.vue +31 -31
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +7 -7
- package/dist/shared/{ui.BcVNrqyb.mjs → ui.DQZ75GCP.mjs} +183 -180
- package/dist/unplugin.mjs +9 -9
- package/dist/vite.mjs +1 -1
- package/package.json +8 -9
- package/vue-plugin.d.ts +5 -5
|
@@ -61,111 +61,111 @@ const groups = computed(
|
|
|
61
61
|
</script>
|
|
62
62
|
|
|
63
63
|
<template>
|
|
64
|
-
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
65
|
-
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
|
66
|
-
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
|
|
67
|
-
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, loading: true })" />
|
|
68
|
-
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, active })" />
|
|
69
|
-
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [uiOverride?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active })" />
|
|
70
|
-
</slot>
|
|
71
|
-
|
|
72
|
-
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: [uiOverride?.itemLabel, item.ui?.itemLabel], active })">
|
|
73
|
-
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
74
|
-
{{ get(item, props.labelKey) }}
|
|
75
|
-
</slot>
|
|
76
|
-
|
|
77
|
-
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: [uiOverride?.itemLabelExternalIcon, item.ui?.itemLabelExternalIcon], color: item?.color, active })" />
|
|
78
|
-
</span>
|
|
79
|
-
|
|
80
|
-
<span :class="ui.itemTrailing({ class: [uiOverride?.itemTrailing, item.ui?.itemTrailing] })">
|
|
81
|
-
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
82
|
-
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color, active })" />
|
|
83
|
-
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: [uiOverride?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
|
|
84
|
-
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
85
|
-
</span>
|
|
86
|
-
</slot>
|
|
87
|
-
|
|
88
|
-
<DropdownMenu.ItemIndicator as-child>
|
|
89
|
-
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color })" />
|
|
90
|
-
</DropdownMenu.ItemIndicator>
|
|
91
|
-
</span>
|
|
92
|
-
</slot>
|
|
93
|
-
</DefineItemTemplate>
|
|
94
|
-
|
|
95
|
-
<DropdownMenu.Portal v-bind="portalProps">
|
|
96
|
-
<component :is="sub ? DropdownMenu.SubContent : DropdownMenu.Content" :class="props.class" v-bind="contentProps">
|
|
97
|
-
<slot name="content-top" />
|
|
98
|
-
|
|
99
|
-
<div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
100
|
-
<DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
|
|
101
|
-
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
102
|
-
<DropdownMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: [uiOverride?.label, item.ui?.label, item.class] })">
|
|
103
|
-
<ReuseItemTemplate :item="item" :index="index" />
|
|
104
|
-
</DropdownMenu.Label>
|
|
105
|
-
<DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: [uiOverride?.separator, item.ui?.separator, item.class] })" />
|
|
106
|
-
<DropdownMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
|
|
107
|
-
<DropdownMenu.SubTrigger
|
|
108
|
-
as="button"
|
|
109
|
-
type="button"
|
|
110
|
-
:disabled="item.disabled"
|
|
111
|
-
:text-value="get(item, props.labelKey)"
|
|
112
|
-
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
113
|
-
>
|
|
114
|
-
<ReuseItemTemplate :item="item" :index="index" />
|
|
115
|
-
</DropdownMenu.SubTrigger>
|
|
116
|
-
|
|
117
|
-
<UDropdownMenuContent
|
|
118
|
-
sub
|
|
119
|
-
:class="props.class"
|
|
120
|
-
:ui="ui"
|
|
121
|
-
:ui-override="uiOverride"
|
|
122
|
-
:portal="portal"
|
|
123
|
-
:items="item.children"
|
|
124
|
-
align="start"
|
|
125
|
-
:align-offset="-4"
|
|
126
|
-
:side-offset="3"
|
|
127
|
-
:label-key="labelKey"
|
|
128
|
-
:checked-icon="checkedIcon"
|
|
129
|
-
:loading-icon="loadingIcon"
|
|
130
|
-
:external-icon="externalIcon"
|
|
131
|
-
v-bind="item.content"
|
|
132
|
-
>
|
|
133
|
-
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
134
|
-
<slot :name="name" v-bind="slotData" />
|
|
135
|
-
</template>
|
|
136
|
-
</UDropdownMenuContent>
|
|
137
|
-
</DropdownMenu.Sub>
|
|
138
|
-
<DropdownMenu.CheckboxItem
|
|
139
|
-
v-else-if="item.type === 'checkbox'"
|
|
140
|
-
:model-value="item.checked"
|
|
141
|
-
:disabled="item.disabled"
|
|
142
|
-
:text-value="get(item, props.labelKey)"
|
|
143
|
-
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
144
|
-
@update:model-value="item.onUpdateChecked"
|
|
145
|
-
@select="item.onSelect"
|
|
146
|
-
>
|
|
147
|
-
<ReuseItemTemplate :item="item" :index="index" />
|
|
148
|
-
</DropdownMenu.CheckboxItem>
|
|
149
|
-
<DropdownMenu.Item
|
|
150
|
-
v-else
|
|
151
|
-
as-child
|
|
152
|
-
:disabled="item.disabled"
|
|
153
|
-
:text-value="get(item, props.labelKey)"
|
|
154
|
-
@select="item.onSelect"
|
|
155
|
-
>
|
|
156
|
-
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
157
|
-
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color, active })">
|
|
158
|
-
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
159
|
-
</ULinkBase>
|
|
160
|
-
</ULink>
|
|
161
|
-
</DropdownMenu.Item>
|
|
162
|
-
</template>
|
|
163
|
-
</DropdownMenu.Group>
|
|
164
|
-
</div>
|
|
165
|
-
|
|
166
|
-
<slot />
|
|
167
|
-
|
|
168
|
-
<slot name="content-bottom" />
|
|
169
|
-
</component>
|
|
170
|
-
</DropdownMenu.Portal>
|
|
64
|
+
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
65
|
+
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
|
66
|
+
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
|
|
67
|
+
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, loading: true })" />
|
|
68
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, active })" />
|
|
69
|
+
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [uiOverride?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active })" />
|
|
70
|
+
</slot>
|
|
71
|
+
|
|
72
|
+
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: [uiOverride?.itemLabel, item.ui?.itemLabel], active })">
|
|
73
|
+
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
74
|
+
{{ get(item, props.labelKey) }}
|
|
75
|
+
</slot>
|
|
76
|
+
|
|
77
|
+
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: [uiOverride?.itemLabelExternalIcon, item.ui?.itemLabelExternalIcon], color: item?.color, active })" />
|
|
78
|
+
</span>
|
|
79
|
+
|
|
80
|
+
<span :class="ui.itemTrailing({ class: [uiOverride?.itemTrailing, item.ui?.itemTrailing] })">
|
|
81
|
+
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
82
|
+
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color, active })" />
|
|
83
|
+
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: [uiOverride?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
|
|
84
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
85
|
+
</span>
|
|
86
|
+
</slot>
|
|
87
|
+
|
|
88
|
+
<DropdownMenu.ItemIndicator as-child>
|
|
89
|
+
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color })" />
|
|
90
|
+
</DropdownMenu.ItemIndicator>
|
|
91
|
+
</span>
|
|
92
|
+
</slot>
|
|
93
|
+
</DefineItemTemplate>
|
|
94
|
+
|
|
95
|
+
<DropdownMenu.Portal v-bind="portalProps">
|
|
96
|
+
<component :is="sub ? DropdownMenu.SubContent : DropdownMenu.Content" :class="props.class" v-bind="contentProps">
|
|
97
|
+
<slot name="content-top" />
|
|
98
|
+
|
|
99
|
+
<div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
100
|
+
<DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
|
|
101
|
+
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
102
|
+
<DropdownMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: [uiOverride?.label, item.ui?.label, item.class] })">
|
|
103
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
104
|
+
</DropdownMenu.Label>
|
|
105
|
+
<DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: [uiOverride?.separator, item.ui?.separator, item.class] })" />
|
|
106
|
+
<DropdownMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
|
|
107
|
+
<DropdownMenu.SubTrigger
|
|
108
|
+
as="button"
|
|
109
|
+
type="button"
|
|
110
|
+
:disabled="item.disabled"
|
|
111
|
+
:text-value="get(item, props.labelKey)"
|
|
112
|
+
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
113
|
+
>
|
|
114
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
115
|
+
</DropdownMenu.SubTrigger>
|
|
116
|
+
|
|
117
|
+
<UDropdownMenuContent
|
|
118
|
+
sub
|
|
119
|
+
:class="props.class"
|
|
120
|
+
:ui="ui"
|
|
121
|
+
:ui-override="uiOverride"
|
|
122
|
+
:portal="portal"
|
|
123
|
+
:items="item.children"
|
|
124
|
+
align="start"
|
|
125
|
+
:align-offset="-4"
|
|
126
|
+
:side-offset="3"
|
|
127
|
+
:label-key="labelKey"
|
|
128
|
+
:checked-icon="checkedIcon"
|
|
129
|
+
:loading-icon="loadingIcon"
|
|
130
|
+
:external-icon="externalIcon"
|
|
131
|
+
v-bind="item.content"
|
|
132
|
+
>
|
|
133
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
134
|
+
<slot :name="name" v-bind="slotData" />
|
|
135
|
+
</template>
|
|
136
|
+
</UDropdownMenuContent>
|
|
137
|
+
</DropdownMenu.Sub>
|
|
138
|
+
<DropdownMenu.CheckboxItem
|
|
139
|
+
v-else-if="item.type === 'checkbox'"
|
|
140
|
+
:model-value="item.checked"
|
|
141
|
+
:disabled="item.disabled"
|
|
142
|
+
:text-value="get(item, props.labelKey)"
|
|
143
|
+
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
144
|
+
@update:model-value="item.onUpdateChecked"
|
|
145
|
+
@select="item.onSelect"
|
|
146
|
+
>
|
|
147
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
148
|
+
</DropdownMenu.CheckboxItem>
|
|
149
|
+
<DropdownMenu.Item
|
|
150
|
+
v-else
|
|
151
|
+
as-child
|
|
152
|
+
:disabled="item.disabled"
|
|
153
|
+
:text-value="get(item, props.labelKey)"
|
|
154
|
+
@select="item.onSelect"
|
|
155
|
+
>
|
|
156
|
+
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
157
|
+
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color, active })">
|
|
158
|
+
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
159
|
+
</ULinkBase>
|
|
160
|
+
</ULink>
|
|
161
|
+
</DropdownMenu.Item>
|
|
162
|
+
</template>
|
|
163
|
+
</DropdownMenu.Group>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<slot />
|
|
167
|
+
|
|
168
|
+
<slot name="content-bottom" />
|
|
169
|
+
</component>
|
|
170
|
+
</DropdownMenu.Portal>
|
|
171
171
|
</template>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/error";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { Primitive } from "reka-ui";
|
|
8
|
+
import { useAppConfig, useRouter } from "#imports";
|
|
9
|
+
import { useLocalePro } from "../composables/useLocalePro";
|
|
10
|
+
import { tv } from "../utils/tv";
|
|
11
|
+
import UButton from "./Button.vue";
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
as: { type: null, required: false, default: "main" },
|
|
14
|
+
error: { type: Object, required: false, default: () => ({}) },
|
|
15
|
+
redirect: { type: String, required: false, default: "/" },
|
|
16
|
+
clear: { type: [Boolean, Object], required: false, default: true },
|
|
17
|
+
class: { type: null, required: false },
|
|
18
|
+
ui: { type: null, required: false }
|
|
19
|
+
});
|
|
20
|
+
const emit = defineEmits(["clear"]);
|
|
21
|
+
defineSlots();
|
|
22
|
+
const { t } = useLocalePro();
|
|
23
|
+
const appConfig = useAppConfig();
|
|
24
|
+
const router = useRouter();
|
|
25
|
+
const uiPro = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.error || {} })());
|
|
26
|
+
const handleError = () => {
|
|
27
|
+
if (props.error) {
|
|
28
|
+
emit("clear");
|
|
29
|
+
}
|
|
30
|
+
router.push(props.redirect);
|
|
31
|
+
};
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<Primitive :as="as" :class="uiPro.root({ class: [props.ui?.root, props.class] })">
|
|
36
|
+
<p :class="uiPro.statusCode({ class: props.ui?.statusCode })">
|
|
37
|
+
{{ props.error?.statusCode }}
|
|
38
|
+
</p>
|
|
39
|
+
<h1 v-if="props.error?.statusMessage" :class="uiPro.statusMessage({ class: props.ui?.statusMessage })">
|
|
40
|
+
{{ props.error.statusMessage }}
|
|
41
|
+
</h1>
|
|
42
|
+
<p v-if="props.error?.message && props.error.message !== props.error.statusMessage" :class="uiPro.message({ class: props.ui?.message })">
|
|
43
|
+
{{ props.error?.message }}
|
|
44
|
+
</p>
|
|
45
|
+
<div :class="uiPro.links({ class: props.ui?.links })">
|
|
46
|
+
<UButton
|
|
47
|
+
v-if="clear"
|
|
48
|
+
size="lg"
|
|
49
|
+
color="primary"
|
|
50
|
+
variant="solid"
|
|
51
|
+
:label="t('error.clear')"
|
|
52
|
+
v-bind="typeof clear === 'object' ? clear : {}"
|
|
53
|
+
@click="handleError"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</Primitive>
|
|
57
|
+
</template>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import type { ButtonProps, ComponentConfig } from '../types';
|
|
3
|
+
import type { NuxtError } from '#app';
|
|
4
|
+
import theme from '#build/ui/error';
|
|
5
|
+
type Error = ComponentConfig<typeof theme, AppConfig, 'error'>;
|
|
6
|
+
export interface ErrorProps {
|
|
7
|
+
/**
|
|
8
|
+
* The element or component this component should render as.
|
|
9
|
+
* @defaultValue 'div'
|
|
10
|
+
*/
|
|
11
|
+
as?: any;
|
|
12
|
+
error?: Partial<NuxtError & {
|
|
13
|
+
message: string;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* The URL to redirect to when the error is cleared.
|
|
17
|
+
* @defaultValue '/'
|
|
18
|
+
*/
|
|
19
|
+
redirect?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Display a button to clear the error in the links slot.
|
|
22
|
+
* `{ size: 'lg', color: 'primary', variant: 'solid', label: 'Back to home' }`{lang="ts-type"}
|
|
23
|
+
* @defaultValue true
|
|
24
|
+
*/
|
|
25
|
+
clear?: boolean | Partial<ButtonProps>;
|
|
26
|
+
class?: any;
|
|
27
|
+
ui?: Error['slots'];
|
|
28
|
+
}
|
|
29
|
+
export interface ErrorSlots {
|
|
30
|
+
default(props?: {}): any;
|
|
31
|
+
statusCode(props?: {}): any;
|
|
32
|
+
statusMessage(props?: {}): any;
|
|
33
|
+
links(props?: {}): any;
|
|
34
|
+
}
|
|
35
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ErrorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
36
|
+
clear: () => any;
|
|
37
|
+
}, string, import("vue").PublicProps, Readonly<ErrorProps> & Readonly<{
|
|
38
|
+
onClear?: (() => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
error: Partial<NuxtError & {
|
|
41
|
+
message: string;
|
|
42
|
+
}>;
|
|
43
|
+
clear: boolean | Partial<ButtonProps>;
|
|
44
|
+
as: any;
|
|
45
|
+
redirect: string;
|
|
46
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ErrorSlots>;
|
|
47
|
+
export default _default;
|
|
48
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
49
|
+
new (): {
|
|
50
|
+
$slots: S;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -199,12 +199,12 @@ defineExpose({
|
|
|
199
199
|
</script>
|
|
200
200
|
|
|
201
201
|
<template>
|
|
202
|
-
<component
|
|
203
|
-
:is="parentBus ? 'div' : 'form'"
|
|
204
|
-
:id="formId"
|
|
205
|
-
:class="ui({ class: props.class })"
|
|
206
|
-
@submit.prevent="onSubmitWrapper"
|
|
207
|
-
>
|
|
208
|
-
<slot :errors="errors" :loading="loading" />
|
|
209
|
-
</component>
|
|
202
|
+
<component
|
|
203
|
+
:is="parentBus ? 'div' : 'form'"
|
|
204
|
+
:id="formId"
|
|
205
|
+
:class="ui({ class: props.class })"
|
|
206
|
+
@submit.prevent="onSubmitWrapper"
|
|
207
|
+
>
|
|
208
|
+
<slot :errors="errors" :loading="loading" />
|
|
209
|
+
</component>
|
|
210
210
|
</template>
|
|
@@ -56,7 +56,7 @@ declare const _default: <S extends FormSchema, T extends boolean = true>(__VLS_p
|
|
|
56
56
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
57
57
|
readonly onError?: ((payload: FormErrorEvent) => any) | undefined;
|
|
58
58
|
readonly onSubmit?: ((payload: FormSubmitEvent<FormData<S, T>>) => any) | undefined;
|
|
59
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "
|
|
59
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onError" | "onSubmit"> & FormProps<S, T> & Partial<{}>> & import("vue").PublicProps;
|
|
60
60
|
expose(exposed: import("vue").ShallowUnwrapRef<Form<S>>): void;
|
|
61
61
|
attrs: any;
|
|
62
62
|
slots: FormSlots;
|
|
@@ -50,41 +50,41 @@ provide(formFieldInjectionKey, computed(() => ({
|
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
52
|
<template>
|
|
53
|
-
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
54
|
-
<div :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
55
|
-
<div v-if="label || !!slots.label" :class="ui.labelWrapper({ class: props.ui?.labelWrapper })">
|
|
56
|
-
<Label :for="id" :class="ui.label({ class: props.ui?.label })">
|
|
57
|
-
<slot name="label" :label="label">
|
|
58
|
-
{{ label }}
|
|
59
|
-
</slot>
|
|
60
|
-
</Label>
|
|
61
|
-
<span v-if="hint || !!slots.hint" :id="`${ariaId}-hint`" :class="ui.hint({ class: props.ui?.hint })">
|
|
62
|
-
<slot name="hint" :hint="hint">
|
|
63
|
-
{{ hint }}
|
|
64
|
-
</slot>
|
|
65
|
-
</span>
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<p v-if="description || !!slots.description" :id="`${ariaId}-description`" :class="ui.description({ class: props.ui?.description })">
|
|
69
|
-
<slot name="description" :description="description">
|
|
70
|
-
{{ description }}
|
|
71
|
-
</slot>
|
|
72
|
-
</p>
|
|
73
|
-
</div>
|
|
74
|
-
|
|
75
|
-
<div :class="[(label || !!slots.label || description || !!slots.description) && ui.container({ class: props.ui?.container })]">
|
|
76
|
-
<slot :error="error" />
|
|
77
|
-
|
|
78
|
-
<div v-if="typeof error === 'string' && error || !!slots.error" :id="`${ariaId}-error`" :class="ui.error({ class: props.ui?.error })">
|
|
79
|
-
<slot name="error" :error="error">
|
|
80
|
-
{{ error }}
|
|
81
|
-
</slot>
|
|
82
|
-
</div>
|
|
83
|
-
<div v-else-if="help || !!slots.help" :class="ui.help({ class: props.ui?.help })">
|
|
84
|
-
<slot name="help" :help="help">
|
|
85
|
-
{{ help }}
|
|
86
|
-
</slot>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</Primitive>
|
|
53
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
54
|
+
<div :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
55
|
+
<div v-if="label || !!slots.label" :class="ui.labelWrapper({ class: props.ui?.labelWrapper })">
|
|
56
|
+
<Label :for="id" :class="ui.label({ class: props.ui?.label })">
|
|
57
|
+
<slot name="label" :label="label">
|
|
58
|
+
{{ label }}
|
|
59
|
+
</slot>
|
|
60
|
+
</Label>
|
|
61
|
+
<span v-if="hint || !!slots.hint" :id="`${ariaId}-hint`" :class="ui.hint({ class: props.ui?.hint })">
|
|
62
|
+
<slot name="hint" :hint="hint">
|
|
63
|
+
{{ hint }}
|
|
64
|
+
</slot>
|
|
65
|
+
</span>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<p v-if="description || !!slots.description" :id="`${ariaId}-description`" :class="ui.description({ class: props.ui?.description })">
|
|
69
|
+
<slot name="description" :description="description">
|
|
70
|
+
{{ description }}
|
|
71
|
+
</slot>
|
|
72
|
+
</p>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div :class="[(label || !!slots.label || description || !!slots.description) && ui.container({ class: props.ui?.container })]">
|
|
76
|
+
<slot :error="error" />
|
|
77
|
+
|
|
78
|
+
<div v-if="typeof error === 'string' && error || !!slots.error" :id="`${ariaId}-error`" :class="ui.error({ class: props.ui?.error })">
|
|
79
|
+
<slot name="error" :error="error">
|
|
80
|
+
{{ error }}
|
|
81
|
+
</slot>
|
|
82
|
+
</div>
|
|
83
|
+
<div v-else-if="help || !!slots.help" :class="ui.help({ class: props.ui?.help })">
|
|
84
|
+
<slot name="help" :help="help">
|
|
85
|
+
{{ help }}
|
|
86
|
+
</slot>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</Primitive>
|
|
90
90
|
</template>
|
|
@@ -110,38 +110,38 @@ defineExpose({
|
|
|
110
110
|
</script>
|
|
111
111
|
|
|
112
112
|
<template>
|
|
113
|
-
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
114
|
-
<input
|
|
115
|
-
:id="id"
|
|
116
|
-
ref="inputRef"
|
|
117
|
-
:type="type"
|
|
118
|
-
:value="modelValue"
|
|
119
|
-
:name="name"
|
|
120
|
-
:placeholder="placeholder"
|
|
121
|
-
:class="ui.base({ class: props.ui?.base })"
|
|
122
|
-
:disabled="disabled"
|
|
123
|
-
:required="required"
|
|
124
|
-
:autocomplete="autocomplete"
|
|
125
|
-
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
126
|
-
@input="onInput"
|
|
127
|
-
@blur="onBlur"
|
|
128
|
-
@change="onChange"
|
|
129
|
-
@focus="emitFormFocus"
|
|
130
|
-
>
|
|
131
|
-
|
|
132
|
-
<slot />
|
|
133
|
-
|
|
134
|
-
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
135
|
-
<slot name="leading">
|
|
136
|
-
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
137
|
-
<UAvatar v-else-if="!!avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
|
|
138
|
-
</slot>
|
|
139
|
-
</span>
|
|
140
|
-
|
|
141
|
-
<span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
142
|
-
<slot name="trailing">
|
|
143
|
-
<UIcon v-if="trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
144
|
-
</slot>
|
|
145
|
-
</span>
|
|
146
|
-
</Primitive>
|
|
113
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
114
|
+
<input
|
|
115
|
+
:id="id"
|
|
116
|
+
ref="inputRef"
|
|
117
|
+
:type="type"
|
|
118
|
+
:value="modelValue"
|
|
119
|
+
:name="name"
|
|
120
|
+
:placeholder="placeholder"
|
|
121
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
122
|
+
:disabled="disabled"
|
|
123
|
+
:required="required"
|
|
124
|
+
:autocomplete="autocomplete"
|
|
125
|
+
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
126
|
+
@input="onInput"
|
|
127
|
+
@blur="onBlur"
|
|
128
|
+
@change="onChange"
|
|
129
|
+
@focus="emitFormFocus"
|
|
130
|
+
>
|
|
131
|
+
|
|
132
|
+
<slot />
|
|
133
|
+
|
|
134
|
+
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
135
|
+
<slot name="leading">
|
|
136
|
+
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
137
|
+
<UAvatar v-else-if="!!avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
|
|
138
|
+
</slot>
|
|
139
|
+
</span>
|
|
140
|
+
|
|
141
|
+
<span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
142
|
+
<slot name="trailing">
|
|
143
|
+
<UIcon v-if="trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
144
|
+
</slot>
|
|
145
|
+
</span>
|
|
146
|
+
</Primitive>
|
|
147
147
|
</template>
|