@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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { unref, computed, isRef, defineComponent, h, inject, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, useSlots, onMounted, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withModifiers, createTextVNode, createVNode, createSlots, withCtx } from "vue";
|
|
1
|
+
import { unref, computed, isRef, defineComponent, h, inject, mergeDefaults, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, useSlots, onMounted, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withModifiers, createTextVNode, createVNode, createSlots, withCtx } from "vue";
|
|
2
2
|
import { useIMask } from "vue-imask";
|
|
3
3
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
4
|
-
import {
|
|
4
|
+
import { uid } from "uid";
|
|
5
5
|
import { useFocus, useElementVisibility } from "@vueuse/core";
|
|
6
6
|
function isEmpty(value) {
|
|
7
7
|
return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
|
|
@@ -127,99 +127,21 @@ function HintSlotFactory(propsOrRef, slots) {
|
|
|
127
127
|
HintSlot
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
type: [String, Number]
|
|
146
|
-
},
|
|
147
|
-
/**
|
|
148
|
-
* Icon name
|
|
149
|
-
* Can be the full composition of iconify name "@{provider}:{prefix}:{name}" or "{prefix}:{name}" or "{name}"
|
|
150
|
-
* https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
151
|
-
*/
|
|
152
|
-
name: {
|
|
153
|
-
type: String,
|
|
154
|
-
required: true
|
|
155
|
-
},
|
|
156
|
-
/**
|
|
157
|
-
* By default 'vv'
|
|
158
|
-
* If custom collection is not added with "addCollection" DS class method, this prop could not be used
|
|
159
|
-
* Icon provider: https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
160
|
-
*/
|
|
161
|
-
provider: {
|
|
162
|
-
type: String
|
|
163
|
-
},
|
|
164
|
-
/**
|
|
165
|
-
* The name of icon set.
|
|
166
|
-
* Icon default options prefix: simple | normal | detailed
|
|
167
|
-
*/
|
|
168
|
-
prefix: {
|
|
169
|
-
type: String,
|
|
170
|
-
default: "normal"
|
|
171
|
-
},
|
|
172
|
-
/**
|
|
173
|
-
* Url remote SVG icon
|
|
174
|
-
*/
|
|
175
|
-
src: String,
|
|
176
|
-
/**
|
|
177
|
-
* Horizontal flip
|
|
178
|
-
*/
|
|
179
|
-
horizontalFlip: Boolean,
|
|
180
|
-
/**
|
|
181
|
-
* Vertical flip
|
|
182
|
-
*/
|
|
183
|
-
verticalFlip: Boolean,
|
|
184
|
-
/**
|
|
185
|
-
* String alternative to "horizontalFlip" and "verticalFlip".
|
|
186
|
-
* Example: https://docs.iconify.design/icon-components/vue/transform.html
|
|
187
|
-
*/
|
|
188
|
-
flip: String,
|
|
189
|
-
/**
|
|
190
|
-
* Icon render mode
|
|
191
|
-
* 'style' = 'bg' or 'mask', depending on icon content
|
|
192
|
-
* 'bg' = span with style using `background`
|
|
193
|
-
* 'mask' = span with style using `mask`
|
|
194
|
-
* 'svg' = svg
|
|
195
|
-
* Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
|
|
196
|
-
*/
|
|
197
|
-
mode: String,
|
|
198
|
-
/**
|
|
199
|
-
* Toggles inline or block mode
|
|
200
|
-
* Example https://docs.iconify.design/icon-components/vue/inline.html
|
|
201
|
-
*/
|
|
202
|
-
inline: Boolean,
|
|
203
|
-
/**
|
|
204
|
-
* rotates icon
|
|
205
|
-
* Example https://docs.iconify.design/icon-components/vue/transform.html
|
|
206
|
-
*/
|
|
207
|
-
rotate: [Number, String],
|
|
208
|
-
/**
|
|
209
|
-
* A callback that is called when icon data has been loaded
|
|
210
|
-
*/
|
|
211
|
-
onLoad: Function,
|
|
212
|
-
/**
|
|
213
|
-
* SVG icon string
|
|
214
|
-
*/
|
|
215
|
-
svg: String,
|
|
216
|
-
/**
|
|
217
|
-
* Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
|
|
218
|
-
* @values string | string[]
|
|
219
|
-
*/
|
|
220
|
-
modifiers: {
|
|
221
|
-
type: [String, Array]
|
|
222
|
-
}
|
|
130
|
+
const ACTION_ICONS = {
|
|
131
|
+
showPassword: "eye-on",
|
|
132
|
+
hidePassword: "eye-off",
|
|
133
|
+
showDatePicker: "calendar",
|
|
134
|
+
showTimePicker: "time",
|
|
135
|
+
showColorPicker: "color",
|
|
136
|
+
clear: "close",
|
|
137
|
+
add: "add",
|
|
138
|
+
remove: "trash",
|
|
139
|
+
edit: "edit",
|
|
140
|
+
download: "download"
|
|
141
|
+
};
|
|
142
|
+
const VvIconPropsDefaults = {
|
|
143
|
+
prefix: "normal"
|
|
144
|
+
/* normal */
|
|
223
145
|
};
|
|
224
146
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
225
147
|
Strategy2["absolute"] = "absolute";
|
|
@@ -255,6 +177,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
255
177
|
ButtonType2["reset"] = "reset";
|
|
256
178
|
return ButtonType2;
|
|
257
179
|
})(ButtonType || {});
|
|
180
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
181
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
182
|
+
ActionTag2["routerLink"] = "router-link";
|
|
183
|
+
ActionTag2["a"] = "a";
|
|
184
|
+
ActionTag2["button"] = "button";
|
|
185
|
+
return ActionTag2;
|
|
186
|
+
})(ActionTag || {});
|
|
258
187
|
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
259
188
|
AnchorTarget2["_blank"] = "_blank";
|
|
260
189
|
AnchorTarget2["_self"] = "_self";
|
|
@@ -294,7 +223,24 @@ const __default__$1 = {
|
|
|
294
223
|
};
|
|
295
224
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
296
225
|
...__default__$1,
|
|
297
|
-
props:
|
|
226
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
227
|
+
name: {},
|
|
228
|
+
color: {},
|
|
229
|
+
width: {},
|
|
230
|
+
height: {},
|
|
231
|
+
provider: {},
|
|
232
|
+
prefix: {},
|
|
233
|
+
src: {},
|
|
234
|
+
horizontalFlip: { type: Boolean },
|
|
235
|
+
verticalFlip: { type: Boolean },
|
|
236
|
+
flip: {},
|
|
237
|
+
mode: {},
|
|
238
|
+
inline: { type: Boolean },
|
|
239
|
+
rotate: {},
|
|
240
|
+
onLoad: { type: Function },
|
|
241
|
+
svg: {},
|
|
242
|
+
modifiers: {}
|
|
243
|
+
}, VvIconPropsDefaults),
|
|
298
244
|
setup(__props) {
|
|
299
245
|
const props = __props;
|
|
300
246
|
const hasRotate = computed(() => {
|
|
@@ -381,7 +327,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
381
327
|
color: _ctx.color,
|
|
382
328
|
onLoad: _ctx.onLoad,
|
|
383
329
|
icon: unref(icon)
|
|
384
|
-
}), null, 16, ["class"])) : createCommentVNode("", true);
|
|
330
|
+
}), null, 16, ["class"])) : createCommentVNode("v-if", true);
|
|
385
331
|
};
|
|
386
332
|
}
|
|
387
333
|
});
|
|
@@ -402,6 +348,7 @@ const LinkProps = {
|
|
|
402
348
|
*/
|
|
403
349
|
target: {
|
|
404
350
|
type: String,
|
|
351
|
+
default: void 0,
|
|
405
352
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
406
353
|
},
|
|
407
354
|
/**
|
|
@@ -416,27 +363,33 @@ const ValidProps = {
|
|
|
416
363
|
/**
|
|
417
364
|
* Valid status
|
|
418
365
|
*/
|
|
419
|
-
valid: Boolean,
|
|
366
|
+
valid: { type: Boolean, default: false },
|
|
420
367
|
/**
|
|
421
368
|
* Valid label
|
|
422
369
|
*/
|
|
423
|
-
validLabel: [String, Array]
|
|
370
|
+
validLabel: { type: [String, Array], default: void 0 }
|
|
424
371
|
};
|
|
425
372
|
const InvalidProps = {
|
|
426
373
|
/**
|
|
427
374
|
* Invalid status
|
|
428
375
|
*/
|
|
429
|
-
invalid:
|
|
376
|
+
invalid: {
|
|
377
|
+
type: Boolean,
|
|
378
|
+
default: false
|
|
379
|
+
},
|
|
430
380
|
/**
|
|
431
381
|
* Invalid label
|
|
432
382
|
*/
|
|
433
|
-
invalidLabel: [String, Array]
|
|
383
|
+
invalidLabel: { type: [String, Array], default: void 0 }
|
|
434
384
|
};
|
|
435
385
|
const LoadingProps = {
|
|
436
386
|
/**
|
|
437
387
|
* Loading status
|
|
438
388
|
*/
|
|
439
|
-
loading:
|
|
389
|
+
loading: {
|
|
390
|
+
type: Boolean,
|
|
391
|
+
default: false
|
|
392
|
+
},
|
|
440
393
|
/**
|
|
441
394
|
* Loading label
|
|
442
395
|
*/
|
|
@@ -449,37 +402,64 @@ const DisabledProps = {
|
|
|
449
402
|
/**
|
|
450
403
|
* Whether the form control is disabled
|
|
451
404
|
*/
|
|
452
|
-
disabled:
|
|
405
|
+
disabled: {
|
|
406
|
+
type: Boolean,
|
|
407
|
+
default: false
|
|
408
|
+
}
|
|
453
409
|
};
|
|
454
410
|
const ActiveProps = {
|
|
455
411
|
/**
|
|
456
412
|
* Whether the item is active
|
|
457
413
|
*/
|
|
458
|
-
active:
|
|
414
|
+
active: {
|
|
415
|
+
type: Boolean,
|
|
416
|
+
default: false
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
const CurrentProps = {
|
|
420
|
+
/**
|
|
421
|
+
* Whether the item is current
|
|
422
|
+
*/
|
|
423
|
+
current: {
|
|
424
|
+
type: Boolean,
|
|
425
|
+
default: false
|
|
426
|
+
}
|
|
459
427
|
};
|
|
460
428
|
const PressedProps = {
|
|
461
429
|
/**
|
|
462
430
|
* Whether the item is pressed
|
|
463
431
|
*/
|
|
464
|
-
pressed:
|
|
432
|
+
pressed: {
|
|
433
|
+
type: Boolean,
|
|
434
|
+
default: false
|
|
435
|
+
}
|
|
465
436
|
};
|
|
466
437
|
const LabelProps = {
|
|
467
438
|
/**
|
|
468
439
|
* The item label
|
|
469
440
|
*/
|
|
470
|
-
label:
|
|
441
|
+
label: {
|
|
442
|
+
type: [String, Number],
|
|
443
|
+
default: void 0
|
|
444
|
+
}
|
|
471
445
|
};
|
|
472
446
|
const ReadonlyProps = {
|
|
473
447
|
/**
|
|
474
448
|
* The value is not editable
|
|
475
449
|
*/
|
|
476
|
-
readonly:
|
|
450
|
+
readonly: {
|
|
451
|
+
type: Boolean,
|
|
452
|
+
default: false
|
|
453
|
+
}
|
|
477
454
|
};
|
|
478
455
|
const ModifiersProps = {
|
|
479
456
|
/**
|
|
480
457
|
* Component BEM modifiers
|
|
481
458
|
*/
|
|
482
|
-
modifiers:
|
|
459
|
+
modifiers: {
|
|
460
|
+
type: [String, Array],
|
|
461
|
+
default: void 0
|
|
462
|
+
}
|
|
483
463
|
};
|
|
484
464
|
const HintProps = {
|
|
485
465
|
hintLabel: { type: String, default: "" }
|
|
@@ -498,14 +478,20 @@ const DebounceProps = {
|
|
|
498
478
|
/**
|
|
499
479
|
* Milliseconds to wait before emitting the input event
|
|
500
480
|
*/
|
|
501
|
-
debounce:
|
|
481
|
+
debounce: {
|
|
482
|
+
type: [Number, String],
|
|
483
|
+
default: void 0
|
|
484
|
+
}
|
|
502
485
|
};
|
|
503
486
|
const IconProps = {
|
|
504
487
|
/**
|
|
505
488
|
* VvIcon name or props
|
|
506
489
|
* @see VVIcon
|
|
507
490
|
*/
|
|
508
|
-
icon: {
|
|
491
|
+
icon: {
|
|
492
|
+
type: [String, Object],
|
|
493
|
+
default: void 0
|
|
494
|
+
},
|
|
509
495
|
/**
|
|
510
496
|
* VvIcon position
|
|
511
497
|
*/
|
|
@@ -526,7 +512,10 @@ const FloatingLabelProps = {
|
|
|
526
512
|
/**
|
|
527
513
|
* If true the label will be floating
|
|
528
514
|
*/
|
|
529
|
-
floating:
|
|
515
|
+
floating: {
|
|
516
|
+
type: Boolean,
|
|
517
|
+
default: false
|
|
518
|
+
}
|
|
530
519
|
};
|
|
531
520
|
const IdProps = {
|
|
532
521
|
/**
|
|
@@ -556,7 +545,8 @@ const IdProps = {
|
|
|
556
545
|
* Dropdown show / hide transition name
|
|
557
546
|
*/
|
|
558
547
|
transitionName: {
|
|
559
|
-
type: String
|
|
548
|
+
type: String,
|
|
549
|
+
default: void 0
|
|
560
550
|
},
|
|
561
551
|
/**
|
|
562
552
|
* Offset of the dropdown from the trigger
|
|
@@ -624,7 +614,8 @@ const IdProps = {
|
|
|
624
614
|
* Set dropdown width to the same as the trigger
|
|
625
615
|
*/
|
|
626
616
|
triggerWidth: {
|
|
627
|
-
type: Boolean
|
|
617
|
+
type: Boolean,
|
|
618
|
+
default: false
|
|
628
619
|
}
|
|
629
620
|
});
|
|
630
621
|
const IdNameProps = {
|
|
@@ -641,7 +632,10 @@ const AutofocusProps = {
|
|
|
641
632
|
* Global attribute autofocus
|
|
642
633
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
|
|
643
634
|
*/
|
|
644
|
-
autofocus:
|
|
635
|
+
autofocus: {
|
|
636
|
+
type: Boolean,
|
|
637
|
+
default: false
|
|
638
|
+
}
|
|
645
639
|
};
|
|
646
640
|
const AutocompleteProps = {
|
|
647
641
|
/**
|
|
@@ -673,34 +667,41 @@ const InputTextareaProps = {
|
|
|
673
667
|
* Available for input types: text, search, url, tel, email, password
|
|
674
668
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength
|
|
675
669
|
*/
|
|
676
|
-
minlength: [String, Number],
|
|
670
|
+
minlength: { type: [String, Number], default: void 0 },
|
|
677
671
|
/**
|
|
678
672
|
* Input / Textarea maxlength
|
|
679
673
|
* Maximum length (number of characters) of value
|
|
680
674
|
* Available for input types: text, search, url, tel, email, password
|
|
681
675
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength
|
|
682
676
|
*/
|
|
683
|
-
maxlength: [String, Number],
|
|
677
|
+
maxlength: { type: [String, Number], default: void 0 },
|
|
684
678
|
/**
|
|
685
679
|
* Input / Textarea placeholder
|
|
686
680
|
* Text that appears in the form control when it has no value set
|
|
687
681
|
* Available for input types: text, search, url, tel, email, password, number
|
|
688
682
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#placeholder
|
|
689
683
|
*/
|
|
690
|
-
placeholder:
|
|
684
|
+
placeholder: {
|
|
685
|
+
type: String,
|
|
686
|
+
default: void 0
|
|
687
|
+
},
|
|
691
688
|
/**
|
|
692
689
|
* Input / Textarea required
|
|
693
690
|
* A value is required or must be check for the form to be submittable
|
|
694
691
|
* Available for all input types except color
|
|
695
692
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#required
|
|
696
693
|
*/
|
|
697
|
-
required:
|
|
694
|
+
required: {
|
|
695
|
+
type: Boolean,
|
|
696
|
+
default: false
|
|
697
|
+
}
|
|
698
698
|
};
|
|
699
699
|
({
|
|
700
700
|
...DisabledProps,
|
|
701
701
|
...LabelProps,
|
|
702
702
|
...PressedProps,
|
|
703
703
|
...ActiveProps,
|
|
704
|
+
...CurrentProps,
|
|
704
705
|
...LinkProps,
|
|
705
706
|
/**
|
|
706
707
|
* Button type
|
|
@@ -716,6 +717,13 @@ const InputTextareaProps = {
|
|
|
716
717
|
ariaLabel: {
|
|
717
718
|
type: String,
|
|
718
719
|
default: void 0
|
|
720
|
+
},
|
|
721
|
+
/**
|
|
722
|
+
* Default tag for the action
|
|
723
|
+
*/
|
|
724
|
+
defaultTag: {
|
|
725
|
+
type: String,
|
|
726
|
+
default: ActionTag.button
|
|
719
727
|
}
|
|
720
728
|
});
|
|
721
729
|
const INPUT_TYPES = {
|
|
@@ -733,14 +741,6 @@ const INPUT_TYPES = {
|
|
|
733
741
|
MONTH: "month",
|
|
734
742
|
WEEK: "week"
|
|
735
743
|
};
|
|
736
|
-
const TYPES_ICON = {
|
|
737
|
-
PASSWORD_SHOW: "eye-on",
|
|
738
|
-
PASSWORD_HIDE: "eye-off",
|
|
739
|
-
DATE: "calendar",
|
|
740
|
-
TIME: "time",
|
|
741
|
-
COLOR: "color",
|
|
742
|
-
SEARCH: "close"
|
|
743
|
-
};
|
|
744
744
|
const VvInputTextEvents = [
|
|
745
745
|
"update:modelValue",
|
|
746
746
|
"update:masked",
|
|
@@ -809,24 +809,24 @@ const VvInputTextProps = {
|
|
|
809
809
|
* @see VVIcon
|
|
810
810
|
*/
|
|
811
811
|
iconShowPassword: {
|
|
812
|
-
type: String,
|
|
813
|
-
default:
|
|
812
|
+
type: [String, Object],
|
|
813
|
+
default: ACTION_ICONS.showPassword
|
|
814
814
|
},
|
|
815
815
|
/**
|
|
816
816
|
* VvIcon name for hide password button
|
|
817
817
|
* @see VVIcon
|
|
818
818
|
*/
|
|
819
819
|
iconHidePassword: {
|
|
820
|
-
type: String,
|
|
821
|
-
default:
|
|
820
|
+
type: [String, Object],
|
|
821
|
+
default: ACTION_ICONS.hidePassword
|
|
822
822
|
},
|
|
823
823
|
/**
|
|
824
824
|
* VvIcon name for clear button
|
|
825
825
|
* @see VVIcon
|
|
826
826
|
*/
|
|
827
827
|
iconClear: {
|
|
828
|
-
type: String,
|
|
829
|
-
default:
|
|
828
|
+
type: [String, Object],
|
|
829
|
+
default: ACTION_ICONS.clear
|
|
830
830
|
},
|
|
831
831
|
/**
|
|
832
832
|
* Label for step up button
|
|
@@ -906,6 +906,41 @@ const VvInputTextProps = {
|
|
|
906
906
|
default: false
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
|
+
function useComponentIcon(icon, iconPosition) {
|
|
910
|
+
const hasIcon = computed(() => {
|
|
911
|
+
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
912
|
+
return { name: icon == null ? void 0 : icon.value };
|
|
913
|
+
}
|
|
914
|
+
return icon == null ? void 0 : icon.value;
|
|
915
|
+
});
|
|
916
|
+
const hasIconBefore = computed(
|
|
917
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
|
|
918
|
+
);
|
|
919
|
+
const hasIconAfter = computed(
|
|
920
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
|
|
921
|
+
);
|
|
922
|
+
const hasIconLeft = computed(
|
|
923
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
|
|
924
|
+
);
|
|
925
|
+
const hasIconRight = computed(
|
|
926
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
|
|
927
|
+
);
|
|
928
|
+
const hasIconTop = computed(
|
|
929
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
|
|
930
|
+
);
|
|
931
|
+
const hasIconBottom = computed(
|
|
932
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
|
|
933
|
+
);
|
|
934
|
+
return {
|
|
935
|
+
hasIcon,
|
|
936
|
+
hasIconLeft,
|
|
937
|
+
hasIconRight,
|
|
938
|
+
hasIconTop,
|
|
939
|
+
hasIconBottom,
|
|
940
|
+
hasIconBefore,
|
|
941
|
+
hasIconAfter
|
|
942
|
+
};
|
|
943
|
+
}
|
|
909
944
|
const VvInputPasswordAction = defineComponent({
|
|
910
945
|
components: {
|
|
911
946
|
VvIcon: _sfc_main$1
|
|
@@ -924,12 +959,12 @@ const VvInputPasswordAction = defineComponent({
|
|
|
924
959
|
default: "Hide password"
|
|
925
960
|
},
|
|
926
961
|
iconShow: {
|
|
927
|
-
type: String,
|
|
928
|
-
default:
|
|
962
|
+
type: [String, Object],
|
|
963
|
+
default: ACTION_ICONS.showPassword
|
|
929
964
|
},
|
|
930
965
|
iconHide: {
|
|
931
|
-
type: String,
|
|
932
|
-
default:
|
|
966
|
+
type: [String, Object],
|
|
967
|
+
default: ACTION_ICONS.hidePassword
|
|
933
968
|
}
|
|
934
969
|
},
|
|
935
970
|
emits: ["toggle-password"],
|
|
@@ -938,6 +973,7 @@ const VvInputPasswordAction = defineComponent({
|
|
|
938
973
|
const activeIcon = computed(
|
|
939
974
|
() => active.value ? props.iconHide : props.iconShow
|
|
940
975
|
);
|
|
976
|
+
const { hasIcon } = useComponentIcon(activeIcon);
|
|
941
977
|
function onClick(e) {
|
|
942
978
|
e == null ? void 0 : e.stopPropagation();
|
|
943
979
|
if (!props.disabled) {
|
|
@@ -948,14 +984,15 @@ const VvInputPasswordAction = defineComponent({
|
|
|
948
984
|
return {
|
|
949
985
|
active,
|
|
950
986
|
activeIcon,
|
|
987
|
+
hasIcon,
|
|
951
988
|
onClick
|
|
952
989
|
};
|
|
953
990
|
},
|
|
954
991
|
render() {
|
|
955
|
-
const icon = h(_sfc_main$1, {
|
|
956
|
-
|
|
992
|
+
const icon = this.hasIcon ? h(_sfc_main$1, {
|
|
993
|
+
...this.hasIcon,
|
|
957
994
|
class: "vv-input-text__icon"
|
|
958
|
-
});
|
|
995
|
+
}) : void 0;
|
|
959
996
|
return h(
|
|
960
997
|
"button",
|
|
961
998
|
{
|
|
@@ -1028,12 +1065,13 @@ const VvInputClearAction = defineComponent({
|
|
|
1028
1065
|
default: "Clear"
|
|
1029
1066
|
},
|
|
1030
1067
|
icon: {
|
|
1031
|
-
type: String,
|
|
1068
|
+
type: [String, Object],
|
|
1032
1069
|
default: "close"
|
|
1033
1070
|
}
|
|
1034
1071
|
},
|
|
1035
1072
|
emits: ["clear"],
|
|
1036
1073
|
setup(props, { emit }) {
|
|
1074
|
+
const { hasIcon } = useComponentIcon(computed(() => props.icon));
|
|
1037
1075
|
function onClick(e) {
|
|
1038
1076
|
e == null ? void 0 : e.stopPropagation();
|
|
1039
1077
|
if (!props.disabled) {
|
|
@@ -1041,14 +1079,15 @@ const VvInputClearAction = defineComponent({
|
|
|
1041
1079
|
}
|
|
1042
1080
|
}
|
|
1043
1081
|
return {
|
|
1082
|
+
hasIcon,
|
|
1044
1083
|
onClick
|
|
1045
1084
|
};
|
|
1046
1085
|
},
|
|
1047
1086
|
render() {
|
|
1048
|
-
const icon = h(_sfc_main$1, {
|
|
1049
|
-
|
|
1087
|
+
const icon = this.hasIcon ? h(_sfc_main$1, {
|
|
1088
|
+
...this.hasIcon,
|
|
1050
1089
|
class: "vv-input-text__icon"
|
|
1051
|
-
});
|
|
1090
|
+
}) : void 0;
|
|
1052
1091
|
return h(
|
|
1053
1092
|
"button",
|
|
1054
1093
|
{
|
|
@@ -1192,7 +1231,7 @@ function useDefaults(componentName, propsDefinition, props) {
|
|
|
1192
1231
|
}, {});
|
|
1193
1232
|
});
|
|
1194
1233
|
}
|
|
1195
|
-
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) ||
|
|
1234
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
1196
1235
|
function useDebouncedInput(modelValue, emit, ms = 0, {
|
|
1197
1236
|
getter = (value) => value,
|
|
1198
1237
|
setter = (value) => value
|
|
@@ -1222,41 +1261,6 @@ function useComponentFocus(inputTemplateRef, emit) {
|
|
|
1222
1261
|
focused
|
|
1223
1262
|
};
|
|
1224
1263
|
}
|
|
1225
|
-
function useComponentIcon(icon, iconPosition) {
|
|
1226
|
-
const hasIconBefore = computed(
|
|
1227
|
-
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Position.before)
|
|
1228
|
-
);
|
|
1229
|
-
const hasIconAfter = computed(
|
|
1230
|
-
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Position.after)
|
|
1231
|
-
);
|
|
1232
|
-
const hasIconLeft = computed(
|
|
1233
|
-
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.left)
|
|
1234
|
-
);
|
|
1235
|
-
const hasIconRight = computed(
|
|
1236
|
-
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.right)
|
|
1237
|
-
);
|
|
1238
|
-
const hasIconTop = computed(
|
|
1239
|
-
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.top)
|
|
1240
|
-
);
|
|
1241
|
-
const hasIconBottom = computed(
|
|
1242
|
-
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.bottom)
|
|
1243
|
-
);
|
|
1244
|
-
const hasIcon = computed(() => {
|
|
1245
|
-
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
1246
|
-
return { name: icon == null ? void 0 : icon.value };
|
|
1247
|
-
}
|
|
1248
|
-
return icon == null ? void 0 : icon.value;
|
|
1249
|
-
});
|
|
1250
|
-
return {
|
|
1251
|
-
hasIcon,
|
|
1252
|
-
hasIconLeft,
|
|
1253
|
-
hasIconRight,
|
|
1254
|
-
hasIconTop,
|
|
1255
|
-
hasIconBottom,
|
|
1256
|
-
hasIconBefore,
|
|
1257
|
-
hasIconAfter
|
|
1258
|
-
};
|
|
1259
|
-
}
|
|
1260
1264
|
function useTextCount(text, options) {
|
|
1261
1265
|
const length = computed(() => {
|
|
1262
1266
|
return (unref(text) ?? "").length;
|
|
@@ -1297,17 +1301,16 @@ const _hoisted_3 = {
|
|
|
1297
1301
|
key: 0,
|
|
1298
1302
|
class: "vv-input-text__input-before"
|
|
1299
1303
|
};
|
|
1300
|
-
const _hoisted_4 = ["
|
|
1301
|
-
const _hoisted_5 =
|
|
1302
|
-
const _hoisted_6 = {
|
|
1304
|
+
const _hoisted_4 = ["id"];
|
|
1305
|
+
const _hoisted_5 = {
|
|
1303
1306
|
key: 1,
|
|
1304
1307
|
class: "vv-input-text__unit"
|
|
1305
1308
|
};
|
|
1306
|
-
const
|
|
1309
|
+
const _hoisted_6 = {
|
|
1307
1310
|
key: 5,
|
|
1308
1311
|
class: "vv-input-text__input-after"
|
|
1309
1312
|
};
|
|
1310
|
-
const
|
|
1313
|
+
const _hoisted_7 = {
|
|
1311
1314
|
key: 6,
|
|
1312
1315
|
class: "vv-input-text__limit"
|
|
1313
1316
|
};
|
|
@@ -1318,8 +1321,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1318
1321
|
...__default__,
|
|
1319
1322
|
props: VvInputTextProps,
|
|
1320
1323
|
emits: VvInputTextEvents,
|
|
1321
|
-
setup(__props, { expose: __expose, emit }) {
|
|
1324
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1322
1325
|
const props = __props;
|
|
1326
|
+
const emit = __emit;
|
|
1323
1327
|
const slots = useSlots();
|
|
1324
1328
|
const propsDefaults = useDefaults(
|
|
1325
1329
|
"VvInputText",
|
|
@@ -1482,7 +1486,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1482
1486
|
return;
|
|
1483
1487
|
}
|
|
1484
1488
|
inputEl.value.stepUp();
|
|
1485
|
-
localModelValue.value = unref(inputEl).value;
|
|
1489
|
+
localModelValue.value = Number(unref(inputEl).value);
|
|
1486
1490
|
}
|
|
1487
1491
|
};
|
|
1488
1492
|
const onStepDown = () => {
|
|
@@ -1492,31 +1496,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1492
1496
|
return;
|
|
1493
1497
|
}
|
|
1494
1498
|
inputEl.value.stepDown();
|
|
1495
|
-
localModelValue.value = unref(inputEl).value;
|
|
1499
|
+
localModelValue.value = Number(unref(inputEl).value);
|
|
1496
1500
|
}
|
|
1497
1501
|
};
|
|
1498
1502
|
const isSearch = computed(() => props.type === INPUT_TYPES.SEARCH);
|
|
1499
1503
|
const onClear = () => {
|
|
1500
1504
|
localModelValue.value = "";
|
|
1501
1505
|
};
|
|
1502
|
-
const {
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1506
|
+
const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition);
|
|
1507
|
+
const iconAfter = computed(() => {
|
|
1508
|
+
if (hasIconAfter.value !== void 0) {
|
|
1509
|
+
return hasIconAfter.value;
|
|
1510
|
+
}
|
|
1507
1511
|
switch (props.type) {
|
|
1508
1512
|
case INPUT_TYPES.COLOR:
|
|
1509
|
-
return { name:
|
|
1513
|
+
return { name: ACTION_ICONS.showColorPicker };
|
|
1510
1514
|
case INPUT_TYPES.DATE:
|
|
1511
1515
|
case INPUT_TYPES.DATETIME_LOCAL:
|
|
1512
1516
|
case INPUT_TYPES.WEEK:
|
|
1513
1517
|
case INPUT_TYPES.MONTH:
|
|
1514
|
-
return { name:
|
|
1518
|
+
return { name: ACTION_ICONS.showDatePicker };
|
|
1515
1519
|
case INPUT_TYPES.TIME:
|
|
1516
|
-
return { name:
|
|
1517
|
-
default:
|
|
1518
|
-
return "";
|
|
1520
|
+
return { name: ACTION_ICONS.showTimePicker };
|
|
1519
1521
|
}
|
|
1522
|
+
return void 0;
|
|
1520
1523
|
});
|
|
1521
1524
|
const { formatted: countFormatted } = useTextCount(localModelValue, {
|
|
1522
1525
|
mode: count.value,
|
|
@@ -1547,8 +1550,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1547
1550
|
loading: loading.value,
|
|
1548
1551
|
disabled: props.disabled,
|
|
1549
1552
|
readonly: props.readonly,
|
|
1550
|
-
"icon-before": hasIconBefore.value,
|
|
1551
|
-
"icon-after":
|
|
1553
|
+
"icon-before": !!hasIconBefore.value,
|
|
1554
|
+
"icon-after": !!iconAfter.value,
|
|
1552
1555
|
floating: props.floating && !isEmpty(props.label),
|
|
1553
1556
|
dirty: isDirty.value,
|
|
1554
1557
|
focus: isFocused.value,
|
|
@@ -1656,101 +1659,136 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1656
1659
|
emit("keydown", event);
|
|
1657
1660
|
};
|
|
1658
1661
|
return (_ctx, _cache) => {
|
|
1659
|
-
return openBlock(), createElementBlock(
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1662
|
+
return openBlock(), createElementBlock(
|
|
1663
|
+
"div",
|
|
1664
|
+
{
|
|
1665
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1666
|
+
},
|
|
1667
|
+
[
|
|
1668
|
+
unref(label) ? (openBlock(), createElementBlock("label", {
|
|
1669
|
+
key: 0,
|
|
1670
|
+
for: unref(hasId),
|
|
1671
|
+
class: "vv-input-text__label"
|
|
1672
|
+
}, toDisplayString(unref(label)), 9, _hoisted_1)) : createCommentVNode("v-if", true),
|
|
1673
|
+
createElementVNode("div", _hoisted_2, [
|
|
1674
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
1675
|
+
createCommentVNode(" @slot Slot before input icon "),
|
|
1676
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1677
|
+
])) : createCommentVNode("v-if", true),
|
|
1678
|
+
createElementVNode(
|
|
1679
|
+
"div",
|
|
1680
|
+
{
|
|
1681
|
+
ref_key: "innerEl",
|
|
1682
|
+
ref: innerEl,
|
|
1683
|
+
class: "vv-input-text__inner",
|
|
1684
|
+
onClick: withModifiers(onClickInner, ["stop"])
|
|
1685
|
+
},
|
|
1686
|
+
[
|
|
1687
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(
|
|
1688
|
+
_sfc_main$1,
|
|
1689
|
+
mergeProps({ key: 0 }, unref(hasIconBefore), { class: "vv-input-text__icon" }),
|
|
1690
|
+
null,
|
|
1691
|
+
16
|
|
1692
|
+
/* FULL_PROPS */
|
|
1693
|
+
)) : createCommentVNode("v-if", true),
|
|
1694
|
+
createElementVNode("input", mergeProps({
|
|
1695
|
+
id: unref(hasId),
|
|
1696
|
+
ref_key: "inputEl",
|
|
1697
|
+
ref: inputEl
|
|
1698
|
+
}, unref(hasAttrs), {
|
|
1699
|
+
style: unref(hasStyle),
|
|
1700
|
+
onKeyup: _cache[0] || (_cache[0] = ($event) => emit("keyup", $event)),
|
|
1701
|
+
onKeydown: onKeyDown,
|
|
1702
|
+
onKeypress: _cache[1] || (_cache[1] = ($event) => emit("keypress", $event))
|
|
1703
|
+
}), null, 16, _hoisted_4),
|
|
1704
|
+
(_ctx.unit || _ctx.$slots.unit) && unref(isDirty) ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
1705
|
+
createCommentVNode(" @slot Slot to replace unit"),
|
|
1706
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
|
|
1707
|
+
createTextVNode(
|
|
1708
|
+
toDisplayString(_ctx.unit),
|
|
1709
|
+
1
|
|
1710
|
+
/* TEXT */
|
|
1711
|
+
)
|
|
1712
|
+
])
|
|
1713
|
+
])) : createCommentVNode("v-if", true)
|
|
1714
|
+
],
|
|
1715
|
+
512
|
|
1716
|
+
/* NEED_PATCH */
|
|
1717
|
+
),
|
|
1718
|
+
createCommentVNode(" @slot Slot to replace right icon "),
|
|
1719
|
+
unref(iconAfter) ? (openBlock(), createBlock(
|
|
1720
|
+
_sfc_main$1,
|
|
1721
|
+
mergeProps({ key: 1 }, unref(iconAfter), { class: "vv-input-text__icon vv-input-text__icon-after" }),
|
|
1722
|
+
null,
|
|
1723
|
+
16
|
|
1724
|
+
/* FULL_PROPS */
|
|
1725
|
+
)) : unref(isPassword) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(PasswordInputActions), {
|
|
1726
|
+
key: 2,
|
|
1727
|
+
onTogglePassword
|
|
1728
|
+
})) : unref(isNumber) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(NumberInputActions), {
|
|
1729
|
+
key: 3,
|
|
1730
|
+
onStepUp,
|
|
1731
|
+
onStepDown
|
|
1732
|
+
})) : unref(isSearch) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(SearchInputActions), {
|
|
1733
|
+
key: 4,
|
|
1734
|
+
onClear
|
|
1735
|
+
})) : createCommentVNode("v-if", true),
|
|
1736
|
+
createCommentVNode(" @slot Slot after input "),
|
|
1737
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
1738
|
+
createCommentVNode(" @slot Slot before input icon "),
|
|
1739
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1740
|
+
])) : createCommentVNode("v-if", true),
|
|
1741
|
+
unref(count) ? (openBlock(), createElementBlock("span", _hoisted_7, [
|
|
1742
|
+
createCommentVNode(" @slot Slot to replace count "),
|
|
1743
|
+
renderSlot(_ctx.$slots, "count", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
|
|
1744
|
+
createTextVNode(
|
|
1745
|
+
toDisplayString(unref(countFormatted)),
|
|
1746
|
+
1
|
|
1747
|
+
/* TEXT */
|
|
1748
|
+
)
|
|
1694
1749
|
])
|
|
1695
|
-
])) : createCommentVNode("", true)
|
|
1696
|
-
]
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
class: "vv-input-
|
|
1700
|
-
},
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
} : void 0,
|
|
1738
|
-
_ctx.$slots.valid ? {
|
|
1739
|
-
name: "valid",
|
|
1740
|
-
fn: withCtx(() => [
|
|
1741
|
-
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1742
|
-
]),
|
|
1743
|
-
key: "2"
|
|
1744
|
-
} : void 0,
|
|
1745
|
-
_ctx.$slots.invalid ? {
|
|
1746
|
-
name: "invalid",
|
|
1747
|
-
fn: withCtx(() => [
|
|
1748
|
-
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1749
|
-
]),
|
|
1750
|
-
key: "3"
|
|
1751
|
-
} : void 0
|
|
1752
|
-
]), 1032, ["id"])
|
|
1753
|
-
], 2);
|
|
1750
|
+
])) : createCommentVNode("v-if", true)
|
|
1751
|
+
]),
|
|
1752
|
+
createVNode(unref(HintSlot), {
|
|
1753
|
+
id: unref(hasHintId),
|
|
1754
|
+
class: "vv-input-text__hint"
|
|
1755
|
+
}, createSlots({
|
|
1756
|
+
_: 2
|
|
1757
|
+
/* DYNAMIC */
|
|
1758
|
+
}, [
|
|
1759
|
+
_ctx.$slots.hint ? {
|
|
1760
|
+
name: "hint",
|
|
1761
|
+
fn: withCtx(() => [
|
|
1762
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1763
|
+
]),
|
|
1764
|
+
key: "0"
|
|
1765
|
+
} : void 0,
|
|
1766
|
+
_ctx.$slots.loading ? {
|
|
1767
|
+
name: "loading",
|
|
1768
|
+
fn: withCtx(() => [
|
|
1769
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1770
|
+
]),
|
|
1771
|
+
key: "1"
|
|
1772
|
+
} : void 0,
|
|
1773
|
+
_ctx.$slots.valid ? {
|
|
1774
|
+
name: "valid",
|
|
1775
|
+
fn: withCtx(() => [
|
|
1776
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1777
|
+
]),
|
|
1778
|
+
key: "2"
|
|
1779
|
+
} : void 0,
|
|
1780
|
+
_ctx.$slots.invalid ? {
|
|
1781
|
+
name: "invalid",
|
|
1782
|
+
fn: withCtx(() => [
|
|
1783
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
1784
|
+
]),
|
|
1785
|
+
key: "3"
|
|
1786
|
+
} : void 0
|
|
1787
|
+
]), 1032, ["id"])
|
|
1788
|
+
],
|
|
1789
|
+
2
|
|
1790
|
+
/* CLASS */
|
|
1791
|
+
);
|
|
1754
1792
|
};
|
|
1755
1793
|
}
|
|
1756
1794
|
});
|