@volverjs/ui-vue 0.0.10-beta.2 → 0.0.10-beta.21
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/LICENSE +1 -1
- package/README.md +98 -3
- package/auto-imports.d.ts +6 -2
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +23 -16
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +70 -14
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +13 -6
- package/dist/components/VvAccordion/index.d.ts +4 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +117 -38
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -8
- package/dist/components/VvAccordionGroup/index.d.ts +4 -1
- package/dist/components/VvAction/VvAction.es.js +58 -13
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +59 -12
- package/dist/components/VvAction/index.d.ts +25 -4
- package/dist/components/VvAlert/VvAlert.es.js +195 -152
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +18 -8
- package/dist/components/VvAlert/index.d.ts +9 -5
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +240 -174
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +13 -6
- package/dist/components/VvAlertGroup/index.d.ts +6 -2
- package/dist/components/VvAvatar/VvAvatar.es.js +54 -9
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
- package/dist/components/VvAvatar/index.d.ts +4 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +111 -36
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
- package/dist/components/VvAvatarGroup/index.d.ts +4 -1
- package/dist/components/VvBadge/VvBadge.es.js +73 -17
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
- package/dist/components/VvBadge/index.d.ts +4 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +259 -49
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
- package/dist/components/VvBreadcrumb/index.d.ts +6 -10
- package/dist/components/VvButton/VvButton.es.js +187 -141
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +101 -27
- package/dist/components/VvButton/index.d.ts +41 -14
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +69 -16
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +23 -10
- package/dist/components/VvButtonGroup/index.d.ts +8 -2
- package/dist/components/VvCard/VvCard.es.js +84 -25
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
- package/dist/components/VvCard/index.d.ts +4 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +91 -22
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +104 -32
- package/dist/components/VvCheckbox/index.d.ts +45 -12
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +180 -67
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +100 -29
- package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
- package/dist/components/VvCombobox/VvCombobox.es.js +758 -531
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +181 -108
- package/dist/components/VvCombobox/index.d.ts +53 -22
- package/dist/components/VvDialog/VvDialog.es.js +136 -141
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdown.es.js +121 -55
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +101 -75
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +72 -11
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +26 -7
- package/dist/components/VvDropdown/index.d.ts +16 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +82 -22
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +56 -8
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +76 -17
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +23 -96
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
- package/dist/components/VvIcon/index.d.ts +33 -48
- package/dist/components/VvInputFile/VvInputFile.es.js +1734 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +313 -0
- package/dist/components/VvInputFile/index.d.ts +179 -0
- package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +331 -293
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +162 -55
- package/dist/components/VvInputText/index.d.ts +71 -29
- package/dist/components/VvNav/VvNav.es.js +151 -73
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +41 -14
- package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +2 -0
- package/dist/components/VvNav/index.d.ts +5 -13
- package/dist/components/VvNavItem/VvNavItem.es.js +436 -0
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
- package/dist/components/VvProgress/VvProgress.es.js +65 -14
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
- package/dist/components/VvProgress/index.d.ts +4 -1
- package/dist/components/VvRadio/VvRadio.es.js +89 -21
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +102 -30
- package/dist/components/VvRadio/index.d.ts +44 -11
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +180 -66
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +100 -29
- package/dist/components/VvRadioGroup/index.d.ts +45 -12
- package/dist/components/VvSelect/VvSelect.es.js +248 -226
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +112 -39
- package/dist/components/VvSelect/index.d.ts +48 -14
- package/dist/components/VvTab/VvTab.es.js +256 -110
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +50 -13
- package/dist/components/VvTab/index.d.ts +13 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +229 -212
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +155 -48
- package/dist/components/VvTextarea/index.d.ts +68 -19
- package/dist/components/VvTooltip/VvTooltip.es.js +72 -17
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +10 -3
- package/dist/components/VvTooltip/index.d.ts +4 -1
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +2902 -1329
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +37 -4
- package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +88 -1
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/composables/useComponentIcon.d.ts +9 -8
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +92 -31
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +90 -26
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +210 -210
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +81 -16
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +287 -73
- package/dist/resolvers/unplugin.d.ts +6 -1
- package/dist/resolvers/unplugin.es.js +78 -10
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +72 -84
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +623 -461
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
- package/dist/stories/Icon/Icon.settings.d.ts +1 -0
- package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
- package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
- package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
- package/dist/stories/Tab/Tab.settings.d.ts +4 -37
- package/dist/types/alert.d.ts +13 -0
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/floating-ui.d.ts +6 -0
- package/dist/types/generic.d.ts +4 -0
- package/dist/types/group.d.ts +37 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/input-file.d.ts +16 -0
- package/dist/types/nav.d.ts +18 -0
- package/dist/utils/ObjectUtilities.d.ts +0 -1
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +97 -80
- package/src/Volver.ts +31 -20
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/VvAccordion.vue +2 -2
- package/src/components/VvAction/VvAction.vue +5 -2
- package/src/components/VvAlert/index.ts +1 -3
- package/src/components/VvAlertGroup/index.ts +2 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
- package/src/components/VvBreadcrumb/index.ts +2 -8
- package/src/components/VvButton/VvButton.vue +6 -6
- package/src/components/VvButton/index.ts +2 -4
- package/src/components/VvCombobox/VvCombobox.vue +24 -16
- package/src/components/VvCombobox/index.ts +4 -0
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvIcon/index.ts +35 -48
- package/src/components/VvInputFile/VvInputFile.vue +365 -0
- package/src/components/VvInputFile/index.ts +116 -0
- package/src/components/VvInputText/VvInputClearAction.ts +10 -6
- package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
- package/src/components/VvInputText/VvInputText.vue +17 -18
- package/src/components/VvInputText/index.ts +7 -15
- package/src/components/VvNav/VvNav.vue +30 -50
- package/src/components/VvNav/VvNavItem.vue +18 -0
- package/src/components/VvNav/VvNavSeparator.vue +11 -0
- package/src/components/VvNav/index.ts +2 -15
- package/src/components/VvSelect/VvSelect.vue +5 -8
- package/src/components/VvTab/VvTab.vue +63 -35
- package/src/components/VvTab/index.ts +10 -4
- package/src/components/VvTextarea/VvTextarea.vue +6 -9
- package/src/components/index.ts +10 -0
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +76 -0
- package/src/composables/useComponentIcon.ts +15 -14
- package/src/composables/useUniqueId.ts +2 -2
- package/src/directives/index.ts +3 -6
- package/src/directives/v-tooltip.ts +19 -10
- package/src/index.ts +3 -1
- package/src/props/index.ts +115 -27
- package/src/resolvers/unplugin.ts +24 -14
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
- package/src/stories/Combobox/Combobox.settings.ts +8 -0
- package/src/stories/Icon/Icon.settings.ts +3 -3
- package/src/stories/InputFile/InputFile.settings.ts +36 -0
- package/src/stories/InputFile/InputFile.stories.ts +89 -0
- package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
- package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
- package/src/stories/Nav/Nav.settings.ts +3 -4
- package/src/stories/Nav/Nav.test.ts +4 -15
- package/src/stories/Tab/Tab.settings.ts +9 -9
- package/src/stories/Tab/Tab.stories.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +6 -14
- package/src/stories/argTypes.ts +1 -1
- package/src/types/blurhash.ts +21 -0
- package/src/types/generic.ts +6 -0
- package/src/types/index.ts +7 -0
- package/src/types/input-file.ts +18 -0
- package/src/types/nav.ts +20 -0
- package/src/utils/ObjectUtilities.ts +0 -11
- package/src/workers/blurhash.ts +9 -0
- package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
- package/dist/components/VvNav/VvNavSeparator.d.ts +0 -2
- package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
- package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
- package/src/components/VvNav/VvNavItemTitle.vue +0 -11
- package/src/components/VvNav/VvNavSeparator.ts +0 -8
- package/src/types/generic.d.ts +0 -6
- /package/src/types/{alert.d.ts → alert.ts} +0 -0
- /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
- /package/src/types/{group.d.ts → group.ts} +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
|
-
import {
|
|
8
|
+
import { uid } from 'uid'
|
|
9
9
|
import { VvAccordionEvents, VvAccordionProps, useGroupProps } from '.'
|
|
10
10
|
|
|
11
11
|
// props, attrs and emit
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
// data
|
|
17
17
|
const accordionName = computed(
|
|
18
|
-
() => props.name || (attrs?.id as string) ||
|
|
18
|
+
() => props.name || (attrs?.id as string) || uid(),
|
|
19
19
|
)
|
|
20
20
|
const {
|
|
21
21
|
modifiers,
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
case props.href !== undefined:
|
|
56
56
|
return ActionTag.a
|
|
57
57
|
default:
|
|
58
|
-
return
|
|
58
|
+
return props.defaultTag // button
|
|
59
59
|
}
|
|
60
60
|
})
|
|
61
61
|
|
|
@@ -85,12 +85,14 @@
|
|
|
85
85
|
to: props.to,
|
|
86
86
|
target: props.target,
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
case ActionTag.button:
|
|
89
89
|
return {
|
|
90
90
|
...toReturn,
|
|
91
91
|
type: props.type,
|
|
92
92
|
disabled: props.disabled,
|
|
93
93
|
}
|
|
94
|
+
default:
|
|
95
|
+
return toReturn
|
|
94
96
|
}
|
|
95
97
|
})
|
|
96
98
|
|
|
@@ -132,6 +134,7 @@
|
|
|
132
134
|
active,
|
|
133
135
|
pressed,
|
|
134
136
|
disabled,
|
|
137
|
+
current,
|
|
135
138
|
}"
|
|
136
139
|
@click.passive="onClick"
|
|
137
140
|
@mouseover.passive="onMouseover"
|
|
@@ -86,9 +86,7 @@ export const useVvAlert = (
|
|
|
86
86
|
const hasTitleId = computed(() => `${hasId.value}-title`)
|
|
87
87
|
|
|
88
88
|
// icon
|
|
89
|
-
const hasIcon = computed(() =>
|
|
90
|
-
typeof props.icon === 'string' ? { name: props.icon } : props.icon,
|
|
91
|
-
)
|
|
89
|
+
const { hasIcon } = useComponentIcon(computed(() => props.icon))
|
|
92
90
|
|
|
93
91
|
// props
|
|
94
92
|
const hasClass = useModifiers(
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ModifiersProps } from '@/props'
|
|
2
2
|
import type { ExtractPropTypes } from 'vue'
|
|
3
|
+
import type { VvIconProps } from '../VvIcon'
|
|
3
4
|
|
|
4
5
|
export type AlertItem = {
|
|
5
6
|
id: string | number
|
|
6
7
|
title?: string
|
|
7
|
-
icon?: string |
|
|
8
|
+
icon?: string | VvIconProps
|
|
8
9
|
content?: string
|
|
9
10
|
footer?: string
|
|
10
11
|
modifiers?: string | string[]
|
|
@@ -7,46 +7,47 @@
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
8
|
import { useModifiers } from '../../composables/useModifiers'
|
|
9
9
|
import { VvBreadcrumbProps } from '.'
|
|
10
|
+
import VvAction from '../VvAction/VvAction.vue'
|
|
10
11
|
|
|
11
12
|
const props = defineProps(VvBreadcrumbProps)
|
|
12
13
|
const { modifiers } = toRefs(props)
|
|
13
14
|
const bemCssClasses = useModifiers('vv-breadcrumb', modifiers)
|
|
15
|
+
const length = computed(() => props.routes?.length ?? 0)
|
|
16
|
+
|
|
17
|
+
const isLast = (index: number) => index === length.value - 1
|
|
14
18
|
</script>
|
|
15
19
|
|
|
16
20
|
<template>
|
|
17
21
|
<nav :class="bemCssClasses" aria-label="breadcrumbs">
|
|
18
22
|
<ol class="vv-breadcrumb__list">
|
|
19
23
|
<li
|
|
20
|
-
v-for="(route, index) in routes"
|
|
21
|
-
:key="`${
|
|
22
|
-
:class="
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
v-for="({ label, ...route }, index) in routes"
|
|
25
|
+
:key="`${label}-${index}`"
|
|
26
|
+
:class="
|
|
27
|
+
!isLast(index)
|
|
28
|
+
? 'vv-breadcrumb__item'
|
|
29
|
+
: 'vv-breadcrumb__item-active'
|
|
30
|
+
"
|
|
27
31
|
itemprop="itemListElement"
|
|
28
32
|
itemtype="https://schema.org/ListItem"
|
|
29
33
|
itemscope
|
|
30
34
|
>
|
|
31
|
-
<
|
|
32
|
-
:is="route.to ? 'router-link' : route.href ? 'a' : 'span'"
|
|
35
|
+
<VvAction
|
|
33
36
|
v-bind="route"
|
|
34
|
-
:class="
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
:aria-current="
|
|
39
|
-
index === Number(routes?.length) - 1
|
|
40
|
-
? 'page'
|
|
41
|
-
: undefined
|
|
37
|
+
:class="
|
|
38
|
+
!isLast(index)
|
|
39
|
+
? 'vv-breadcrumb__link'
|
|
40
|
+
: 'vv-breadcrumb__label'
|
|
42
41
|
"
|
|
42
|
+
:aria-current="isLast(index) ? 'page' : undefined"
|
|
43
43
|
itemprop="item"
|
|
44
|
+
default-tag="span"
|
|
44
45
|
>
|
|
45
46
|
<!-- @slot Slot for label -->
|
|
46
47
|
<slot name="label" v-bind="{ route, index }">
|
|
47
|
-
{{
|
|
48
|
+
{{ label }}
|
|
48
49
|
</slot>
|
|
49
|
-
</
|
|
50
|
+
</VvAction>
|
|
50
51
|
<meta itemprop="position" :content="`${index + 1}`" />
|
|
51
52
|
</li>
|
|
52
53
|
</ol>
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { ModifiersProps } from '../../props'
|
|
2
|
-
|
|
3
|
-
export interface Route {
|
|
4
|
-
label: string
|
|
5
|
-
to?: string | { [key: string]: unknown }
|
|
6
|
-
title?: string
|
|
7
|
-
href?: string
|
|
8
|
-
}
|
|
2
|
+
import type { NavItem } from '../../types'
|
|
9
3
|
|
|
10
4
|
export const VvBreadcrumbProps = {
|
|
11
5
|
...ModifiersProps,
|
|
12
|
-
routes: Array as PropType<
|
|
6
|
+
routes: Array as PropType<NavItem[]>,
|
|
13
7
|
}
|
|
@@ -74,9 +74,7 @@
|
|
|
74
74
|
* @description Define icon attributes.
|
|
75
75
|
* @returns {Object} The icon attributes.
|
|
76
76
|
*/
|
|
77
|
-
const
|
|
78
|
-
typeof icon?.value === 'string' ? { name: icon?.value } : icon?.value,
|
|
79
|
-
)
|
|
77
|
+
const { hasIcon } = useComponentIcon(icon)
|
|
80
78
|
|
|
81
79
|
/**
|
|
82
80
|
* @description Catch click event
|
|
@@ -146,9 +144,11 @@
|
|
|
146
144
|
<template v-else>
|
|
147
145
|
<!-- @slot Before label and icon -->
|
|
148
146
|
<slot name="before" />
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
<VvIcon
|
|
148
|
+
v-if="hasIcon"
|
|
149
|
+
v-bind="hasIcon"
|
|
150
|
+
class="vv-button__icon"
|
|
151
|
+
/>
|
|
152
152
|
<span v-if="label" class="vv-button__label">
|
|
153
153
|
<!-- @slot Use this slot for button label -->
|
|
154
154
|
<slot name="label">
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
LoadingProps,
|
|
7
7
|
ModifiersProps,
|
|
8
8
|
UnselectableProps,
|
|
9
|
+
IconProps,
|
|
9
10
|
} from '../../props'
|
|
10
11
|
import { INJECTION_KEY_BUTTON_GROUP, Side } from '../../constants'
|
|
11
12
|
|
|
@@ -17,10 +18,7 @@ export const VvButtonProps = {
|
|
|
17
18
|
...ModifiersProps,
|
|
18
19
|
...UnselectableProps,
|
|
19
20
|
...LoadingProps,
|
|
20
|
-
|
|
21
|
-
* Button icon
|
|
22
|
-
*/
|
|
23
|
-
icon: [String, Object],
|
|
21
|
+
...IconProps,
|
|
24
22
|
/**
|
|
25
23
|
* Button icon position
|
|
26
24
|
*/
|
|
@@ -87,9 +87,13 @@
|
|
|
87
87
|
searchText,
|
|
88
88
|
computed(() => Number(props.debounceSearch)),
|
|
89
89
|
)
|
|
90
|
-
watch(debouncedSearchText, () =>
|
|
91
|
-
emit('
|
|
92
|
-
|
|
90
|
+
watch(debouncedSearchText, () => {
|
|
91
|
+
emit('update:search', debouncedSearchText.value)
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated change:search should not be used, use update:search instead
|
|
94
|
+
*/
|
|
95
|
+
emit('change:search', debouncedSearchText.value)
|
|
96
|
+
})
|
|
93
97
|
|
|
94
98
|
// expanded
|
|
95
99
|
const expanded = ref(false)
|
|
@@ -147,10 +151,7 @@
|
|
|
147
151
|
const dropdownEl = ref()
|
|
148
152
|
|
|
149
153
|
// icons
|
|
150
|
-
const {
|
|
151
|
-
icon,
|
|
152
|
-
iconPosition,
|
|
153
|
-
)
|
|
154
|
+
const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition)
|
|
154
155
|
|
|
155
156
|
// dirty
|
|
156
157
|
const isDirty = computed(() => !isEmpty(props.modelValue))
|
|
@@ -168,12 +169,12 @@
|
|
|
168
169
|
disabled: disabled.value,
|
|
169
170
|
loading: isLoading.value,
|
|
170
171
|
readonly: readonly.value,
|
|
171
|
-
'icon-before':
|
|
172
|
-
'icon-after':
|
|
172
|
+
'icon-before': hasIconBefore.value !== undefined,
|
|
173
|
+
'icon-after': hasIconAfter.value !== undefined,
|
|
173
174
|
valid: valid.value,
|
|
174
175
|
invalid: invalid.value,
|
|
175
176
|
dirty: isDirty.value,
|
|
176
|
-
focus: focused.value,
|
|
177
|
+
focus: focused.value || focusedWithin.value || expanded.value,
|
|
177
178
|
floating: floating.value,
|
|
178
179
|
badges: props.badges,
|
|
179
180
|
})),
|
|
@@ -266,12 +267,13 @@
|
|
|
266
267
|
return
|
|
267
268
|
}
|
|
268
269
|
|
|
270
|
+
// get option value
|
|
269
271
|
const value = getOptionValue(option)
|
|
270
|
-
|
|
271
272
|
let toReturn: string | string[] | Option | Option[] | undefined = value
|
|
272
|
-
|
|
273
|
+
|
|
274
|
+
// check multiple prop, override value with array and remove or add the value
|
|
273
275
|
if (props.multiple) {
|
|
274
|
-
// check
|
|
276
|
+
// check max-values prop and block check new values
|
|
275
277
|
if (Array.isArray(props.modelValue)) {
|
|
276
278
|
const maxValues = Number(props.maxValues)
|
|
277
279
|
if (
|
|
@@ -294,7 +296,13 @@
|
|
|
294
296
|
if (!props.keepOpen) {
|
|
295
297
|
collapse()
|
|
296
298
|
}
|
|
297
|
-
if (
|
|
299
|
+
if (Array.isArray(props.modelValue)) {
|
|
300
|
+
if (props.unselectable && props.modelValue.includes(value)) {
|
|
301
|
+
toReturn = []
|
|
302
|
+
} else {
|
|
303
|
+
toReturn = [value]
|
|
304
|
+
}
|
|
305
|
+
} else if (props.unselectable && value === props.modelValue) {
|
|
298
306
|
toReturn = undefined
|
|
299
307
|
}
|
|
300
308
|
}
|
|
@@ -418,8 +426,8 @@
|
|
|
418
426
|
<div class="vv-select__inner">
|
|
419
427
|
<VvIcon
|
|
420
428
|
v-if="hasIconBefore"
|
|
429
|
+
v-bind="hasIconBefore"
|
|
421
430
|
class="vv-select__icon"
|
|
422
|
-
v-bind="hasIcon"
|
|
423
431
|
/>
|
|
424
432
|
<div
|
|
425
433
|
ref="inputEl"
|
|
@@ -482,8 +490,8 @@
|
|
|
482
490
|
</div>
|
|
483
491
|
<VvIcon
|
|
484
492
|
v-if="hasIconAfter"
|
|
493
|
+
v-bind="hasIconAfter"
|
|
485
494
|
class="vv-select__icon vv-select__icon-after"
|
|
486
|
-
v-bind="hasIcon"
|
|
487
495
|
/>
|
|
488
496
|
</div>
|
|
489
497
|
<div v-if="$slots.after" class="vv-select__input-after">
|
|
@@ -20,6 +20,10 @@ import type { Option } from '../../types/generic'
|
|
|
20
20
|
|
|
21
21
|
export const VvComboboxEvents = [
|
|
22
22
|
'update:modelValue',
|
|
23
|
+
'update:search',
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated change:search should not be used, use update:search instead
|
|
26
|
+
*/
|
|
23
27
|
'change:search',
|
|
24
28
|
'focus',
|
|
25
29
|
'blur',
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
8
|
import { Icon, addIcon, iconExists } from '@iconify/vue'
|
|
9
|
-
import { VvIconProps } from '.'
|
|
9
|
+
import { type VvIconProps, VvIconPropsDefaults } from '.'
|
|
10
10
|
|
|
11
11
|
// props
|
|
12
|
-
const props = defineProps(
|
|
12
|
+
const props = withDefaults(defineProps<VvIconProps>(), VvIconPropsDefaults)
|
|
13
13
|
|
|
14
14
|
const hasRotate = computed(() => {
|
|
15
15
|
if (typeof props.rotate === 'string') {
|
|
@@ -1,71 +1,56 @@
|
|
|
1
|
-
import type { PropType } from 'vue'
|
|
2
1
|
import type { IconifyIconOnLoad, IconifyRenderMode } from '@iconify/vue'
|
|
3
2
|
|
|
3
|
+
export const ACTION_ICONS = {
|
|
4
|
+
showPassword: 'eye-on',
|
|
5
|
+
hidePassword: 'eye-off',
|
|
6
|
+
showDatePicker: 'calendar',
|
|
7
|
+
showTimePicker: 'time',
|
|
8
|
+
showColorPicker: 'color',
|
|
9
|
+
clear: 'close',
|
|
10
|
+
add: 'add',
|
|
11
|
+
remove: 'trash',
|
|
12
|
+
edit: 'edit',
|
|
13
|
+
download: 'download',
|
|
14
|
+
} as const
|
|
15
|
+
|
|
4
16
|
export enum IconPrefix {
|
|
5
17
|
simple = 'simple',
|
|
6
18
|
normal = 'normal',
|
|
7
19
|
detailed = 'detailed',
|
|
8
20
|
}
|
|
9
21
|
|
|
10
|
-
export
|
|
11
|
-
/**
|
|
12
|
-
* Color
|
|
13
|
-
*/
|
|
14
|
-
color: String,
|
|
15
|
-
/**
|
|
16
|
-
* Width
|
|
17
|
-
*/
|
|
18
|
-
width: {
|
|
19
|
-
type: [String, Number],
|
|
20
|
-
},
|
|
21
|
-
/**
|
|
22
|
-
* Height
|
|
23
|
-
*/
|
|
24
|
-
height: {
|
|
25
|
-
type: [String, Number],
|
|
26
|
-
},
|
|
22
|
+
export type VvIconProps = {
|
|
27
23
|
/**
|
|
28
24
|
* Icon name
|
|
29
25
|
* Can be the full composition of iconify name "@{provider}:{prefix}:{name}" or "{prefix}:{name}" or "{name}"
|
|
30
26
|
* https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
31
27
|
*/
|
|
32
|
-
name:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
name: string
|
|
29
|
+
color?: string
|
|
30
|
+
width?: string | number
|
|
31
|
+
height?: string | number
|
|
36
32
|
/**
|
|
37
|
-
* By default 'vv'
|
|
38
33
|
* If custom collection is not added with "addCollection" DS class method, this prop could not be used
|
|
39
34
|
* Icon provider: https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
40
35
|
*/
|
|
41
|
-
provider
|
|
42
|
-
type: String,
|
|
43
|
-
},
|
|
36
|
+
provider?: string
|
|
44
37
|
/**
|
|
38
|
+
* @default 'normal'
|
|
45
39
|
* The name of icon set.
|
|
46
40
|
* Icon default options prefix: simple | normal | detailed
|
|
47
41
|
*/
|
|
48
|
-
prefix
|
|
49
|
-
type: String as PropType<`${IconPrefix}` | string>,
|
|
50
|
-
default: 'normal',
|
|
51
|
-
},
|
|
42
|
+
prefix?: IconPrefix | string
|
|
52
43
|
/**
|
|
53
44
|
* Url remote SVG icon
|
|
54
45
|
*/
|
|
55
|
-
src
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*/
|
|
59
|
-
horizontalFlip: Boolean,
|
|
60
|
-
/**
|
|
61
|
-
* Vertical flip
|
|
62
|
-
*/
|
|
63
|
-
verticalFlip: Boolean,
|
|
46
|
+
src?: string
|
|
47
|
+
horizontalFlip?: boolean
|
|
48
|
+
verticalFlip?: boolean
|
|
64
49
|
/**
|
|
65
50
|
* String alternative to "horizontalFlip" and "verticalFlip".
|
|
66
51
|
* Example: https://docs.iconify.design/icon-components/vue/transform.html
|
|
67
52
|
*/
|
|
68
|
-
flip
|
|
53
|
+
flip?: string
|
|
69
54
|
/**
|
|
70
55
|
* Icon render mode
|
|
71
56
|
* 'style' = 'bg' or 'mask', depending on icon content
|
|
@@ -74,30 +59,32 @@ export const VvIconProps = {
|
|
|
74
59
|
* 'svg' = svg
|
|
75
60
|
* Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
|
|
76
61
|
*/
|
|
77
|
-
mode
|
|
62
|
+
mode?: IconifyRenderMode
|
|
78
63
|
/**
|
|
79
64
|
* Toggles inline or block mode
|
|
80
65
|
* Example https://docs.iconify.design/icon-components/vue/inline.html
|
|
81
66
|
*/
|
|
82
|
-
inline
|
|
67
|
+
inline?: boolean
|
|
83
68
|
/**
|
|
84
69
|
* rotates icon
|
|
85
70
|
* Example https://docs.iconify.design/icon-components/vue/transform.html
|
|
86
71
|
*/
|
|
87
|
-
rotate
|
|
72
|
+
rotate?: number | string
|
|
88
73
|
/**
|
|
89
74
|
* A callback that is called when icon data has been loaded
|
|
90
75
|
*/
|
|
91
|
-
onLoad
|
|
76
|
+
onLoad?: IconifyIconOnLoad
|
|
92
77
|
/**
|
|
93
78
|
* SVG icon string
|
|
94
79
|
*/
|
|
95
|
-
svg
|
|
80
|
+
svg?: string
|
|
96
81
|
/**
|
|
97
82
|
* Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
|
|
98
83
|
* @values string | string[]
|
|
99
84
|
*/
|
|
100
|
-
modifiers
|
|
101
|
-
|
|
102
|
-
|
|
85
|
+
modifiers?: string | string[]
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const VvIconPropsDefaults = {
|
|
89
|
+
prefix: IconPrefix.normal,
|
|
103
90
|
}
|