@volverjs/ui-vue 0.0.4 → 0.0.5-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/README.md +2 -2
- package/auto-imports.d.ts +12 -3
- package/bin/icons.cjs +1 -73
- package/dist/Volver.d.ts +19 -11
- package/dist/components/VvAccordion/VvAccordion.es.js +165 -106
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
- package/dist/components/VvAccordion/index.d.ts +8 -3
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +264 -164
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
- package/dist/components/VvAccordionGroup/index.d.ts +8 -0
- package/dist/components/VvAction/VvAction.es.js +276 -98
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +12 -12
- package/dist/components/VvAction/index.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +213 -44
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
- package/dist/components/VvBadge/index.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +247 -75
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
- package/dist/components/VvBreadcrumb/index.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +646 -360
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +18 -18
- package/dist/components/VvButton/index.d.ts +13 -13
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +261 -79
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
- package/dist/components/VvButtonGroup/index.d.ts +1 -1
- package/dist/components/VvCard/VvCard.es.js +57 -38
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +562 -274
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
- package/dist/components/VvCheckbox/index.d.ts +5 -5
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +661 -340
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
- package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
- package/dist/components/VvCombobox/VvCombobox.es.js +1546 -983
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +138 -51
- package/dist/components/VvCombobox/index.d.ts +41 -10
- package/dist/components/VvDialog/VvDialog.es.js +387 -141
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
- package/dist/components/VvDialog/index.d.ts +4 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +452 -244
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +130 -42
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +13 -13
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
- package/dist/components/VvDropdown/index.d.ts +40 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +373 -160
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +43 -28
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +285 -90
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +113 -65
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
- package/dist/components/VvIcon/index.d.ts +2 -2
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +986 -462
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +100 -20
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +66 -13
- package/dist/components/VvProgress/VvProgress.es.js +216 -45
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
- package/dist/components/VvProgress/index.d.ts +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +499 -238
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadio/index.d.ts +5 -5
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +598 -304
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
- package/dist/components/VvRadioGroup/index.d.ts +3 -3
- package/dist/components/VvSelect/VvSelect.es.js +631 -324
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
- package/dist/components/VvSelect/index.d.ts +3 -3
- package/dist/components/VvTextarea/VvTextarea.es.js +676 -355
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +20 -20
- package/dist/components/VvTextarea/index.d.ts +4 -4
- package/dist/components/VvTooltip/VvTooltip.es.js +215 -47
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
- package/dist/components/VvTooltip/index.d.ts +2 -2
- package/dist/components/index.es.js +3522 -2231
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
- package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
- package/dist/composables/group/useProvideGroupState.d.ts +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcon.d.ts +7 -7
- package/dist/composables/useDebouncedInput.d.ts +4 -1
- package/dist/composables/useDefaults.d.ts +2 -0
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/composables/useOptions.d.ts +2 -2
- package/dist/composables/useTextCount.d.ts +3 -3
- package/dist/composables/useUniqueId.d.ts +1 -1
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +1 -0
- package/dist/directives/index.es.js +264 -55
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.d.ts +3 -0
- package/dist/directives/v-contextmenu.es.js +42 -0
- package/dist/directives/v-contextmenu.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +222 -53
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.d.ts +3 -1
- package/dist/icons.es.js +40 -23
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +112 -3607
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +50 -18
- package/dist/resolvers/unplugin.d.ts +7 -1
- package/dist/resolvers/unplugin.es.js +77 -37
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +12 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +12 -0
- package/dist/stories/InputText/InputText.settings.d.ts +53 -0
- package/dist/stories/argTypes.d.ts +13 -1
- package/package.json +126 -40
- package/src/Volver.ts +49 -22
- 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 +19 -22
- package/src/components/VvAccordion/index.ts +12 -4
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
- package/src/components/VvAccordionGroup/index.ts +8 -0
- package/src/components/VvAction/VvAction.vue +7 -7
- package/src/components/VvAction/index.ts +1 -1
- package/src/components/VvBadge/VvBadge.vue +2 -2
- package/src/components/VvBadge/index.ts +1 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
- package/src/components/VvButton/VvButton.vue +11 -11
- package/src/components/VvButton/index.ts +10 -9
- package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
- package/src/components/VvButtonGroup/index.ts +1 -1
- package/src/components/VvCard/VvCard.vue +2 -2
- package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
- package/src/components/VvCheckbox/index.ts +11 -7
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
- package/src/components/VvCheckboxGroup/index.ts +1 -1
- package/src/components/VvCombobox/VvCombobox.vue +44 -26
- package/src/components/VvCombobox/index.ts +1 -1
- package/src/components/VvDialog/VvDialog.vue +28 -11
- package/src/components/VvDialog/index.ts +5 -2
- package/src/components/VvDropdown/VvDropdown.vue +7 -5
- package/src/components/VvDropdown/VvDropdownAction.vue +7 -5
- package/src/components/VvDropdown/VvDropdownOption.vue +17 -10
- package/src/components/VvDropdown/index.ts +3 -3
- package/src/components/VvIcon/VvIcon.vue +3 -3
- package/src/components/VvIcon/index.ts +3 -3
- package/src/components/VvInputText/VvInputClearAction.ts +2 -2
- package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
- package/src/components/VvInputText/VvInputStepAction.ts +3 -2
- package/src/components/VvInputText/VvInputText.vue +130 -37
- package/src/components/VvInputText/VvInputTextActions.ts +5 -8
- package/src/components/VvInputText/index.ts +62 -1
- package/src/components/VvProgress/VvProgress.vue +2 -2
- package/src/components/VvProgress/index.ts +1 -1
- package/src/components/VvRadio/VvRadio.vue +3 -7
- package/src/components/VvRadio/index.ts +11 -7
- package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
- package/src/components/VvRadioGroup/index.ts +1 -1
- package/src/components/VvSelect/VvSelect.vue +4 -4
- package/src/components/VvSelect/index.ts +1 -1
- package/src/components/VvTextarea/VvTextarea.vue +6 -6
- package/src/components/VvTextarea/index.ts +1 -1
- package/src/components/VvTooltip/VvTooltip.vue +2 -2
- package/src/components/VvTooltip/index.ts +3 -3
- package/src/composables/dropdown/useInjectDropdown.ts +2 -2
- package/src/composables/dropdown/useProvideDropdown.ts +2 -2
- package/src/composables/group/useInjectedGroupState.ts +1 -1
- package/src/composables/group/useProvideGroupState.ts +1 -1
- package/src/composables/useComponentIcon.ts +1 -1
- package/src/composables/useDebouncedInput.ts +10 -3
- package/src/composables/useDefaults.ts +89 -0
- package/src/composables/useModifiers.ts +4 -2
- package/src/composables/useOptions.ts +1 -1
- package/src/composables/useVolver.ts +2 -2
- package/src/directives/index.ts +3 -1
- package/src/directives/v-contextmenu.ts +40 -0
- package/src/directives/v-tooltip.ts +2 -2
- package/src/icons.ts +1 -1
- package/src/index.ts +0 -2
- package/src/props/index.ts +20 -10
- package/src/resolvers/unplugin.ts +15 -1
- package/src/stories/Accordion/Accordion.stories.mdx +8 -2
- package/src/stories/Accordion/Accordion.test.ts +21 -15
- package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
- package/src/stories/Dropdown/DropdownContextmenuDirective.stories.mdx +41 -0
- package/src/stories/InputText/InputText.settings.ts +53 -0
- package/src/stories/InputText/InputText.stories.mdx +40 -0
- package/src/stories/InputText/InputText.test.ts +5 -2
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +1 -1
- package/src/stories/argTypes.ts +12 -2
- package/src/types/group.d.ts +5 -0
|
@@ -1,61 +1,89 @@
|
|
|
1
|
-
import { unref
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { unref, toRefs, computed, h, inject, defineComponent, ref, openBlock, createBlock, mergeProps, createCommentVNode, watch, useSlots, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withModifiers, withDirectives, isRef, vModelDynamic, createTextVNode, createVNode } from "vue";
|
|
2
|
+
import { Mask } from "maska";
|
|
3
|
+
import { toReactive, useFocus, useElementVisibility } from "@vueuse/core";
|
|
4
|
+
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
5
|
+
import { nanoid } from "nanoid";
|
|
6
|
+
function resolveFieldData(data, field) {
|
|
7
|
+
if (data && Object.keys(data).length && field) {
|
|
8
|
+
if (field.indexOf(".") === -1) {
|
|
9
|
+
return data[field];
|
|
10
|
+
} else {
|
|
11
|
+
const fields = field.split(".");
|
|
12
|
+
let value = data;
|
|
13
|
+
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
14
|
+
if (data == null) {
|
|
14
15
|
return null;
|
|
15
|
-
|
|
16
|
+
}
|
|
17
|
+
value = value[fields[i]];
|
|
16
18
|
}
|
|
17
|
-
return
|
|
19
|
+
return value;
|
|
18
20
|
}
|
|
19
|
-
} else
|
|
21
|
+
} else {
|
|
20
22
|
return null;
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
|
-
function
|
|
23
|
-
return ((
|
|
25
|
+
function isEmpty(value) {
|
|
26
|
+
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));
|
|
24
27
|
}
|
|
25
|
-
function
|
|
26
|
-
return typeof
|
|
28
|
+
function isString(value) {
|
|
29
|
+
return typeof value === "string" || value instanceof String;
|
|
27
30
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
31
|
+
function joinLines(errors) {
|
|
32
|
+
if (Array.isArray(errors)) {
|
|
33
|
+
return errors.filter((e) => isString(e)).join(" ");
|
|
34
|
+
}
|
|
35
|
+
return errors;
|
|
30
36
|
}
|
|
31
|
-
function
|
|
37
|
+
function HintSlotFactory(parentProps, parentSlots) {
|
|
38
|
+
const {
|
|
39
|
+
invalid: invalidSlot,
|
|
40
|
+
valid: validSlot,
|
|
41
|
+
hint: hintSlot,
|
|
42
|
+
loading: loadingSlot
|
|
43
|
+
} = parentSlots;
|
|
32
44
|
const {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
hintLabel,
|
|
46
|
+
modelValue,
|
|
47
|
+
valid,
|
|
48
|
+
validLabel,
|
|
49
|
+
invalid,
|
|
50
|
+
invalidLabel,
|
|
51
|
+
...otherProps
|
|
52
|
+
} = toRefs(parentProps);
|
|
53
|
+
const loading = resolveFieldData(otherProps, "loading");
|
|
54
|
+
const loadingLabel = resolveFieldData(otherProps, "loadingLabel");
|
|
55
|
+
const hasInvalid = computed(() => {
|
|
56
|
+
if (!invalid.value) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
if (invalid.value && invalidSlot) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
if ((invalidLabel == null ? void 0 : invalidLabel.value) && Array.isArray(invalidLabel.value) && invalidLabel.value.length > 0) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
if ((invalidLabel == null ? void 0 : invalidLabel.value) && !isEmpty(invalidLabel)) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
});
|
|
70
|
+
const hasHint = computed(
|
|
71
|
+
() => !!(hintLabel && hintLabel.value || hintSlot)
|
|
72
|
+
);
|
|
73
|
+
const hasValid = computed(
|
|
74
|
+
() => !!(validLabel && validLabel.value || validSlot)
|
|
75
|
+
);
|
|
76
|
+
const hasLoading = computed(
|
|
77
|
+
() => !!((loading == null ? void 0 : loading.value) && loadingSlot || (loading == null ? void 0 : loading.value) && (loadingLabel == null ? void 0 : loadingLabel.value))
|
|
78
|
+
);
|
|
79
|
+
const isVisible = computed(
|
|
80
|
+
() => hasHint.value || hasValid.value || hasInvalid.value || hasLoading.value
|
|
53
81
|
);
|
|
54
82
|
return {
|
|
55
|
-
hasInvalid
|
|
56
|
-
hasHint
|
|
57
|
-
hasValid
|
|
58
|
-
hasLoading
|
|
83
|
+
hasInvalid,
|
|
84
|
+
hasHint,
|
|
85
|
+
hasValid,
|
|
86
|
+
hasLoading,
|
|
59
87
|
HintSlot: {
|
|
60
88
|
name: "HintSlot",
|
|
61
89
|
props: {
|
|
@@ -64,42 +92,50 @@ function Xe(e, t) {
|
|
|
64
92
|
default: () => ({})
|
|
65
93
|
}
|
|
66
94
|
},
|
|
67
|
-
setup(
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
hintLabel
|
|
71
|
-
modelValue
|
|
72
|
-
valid
|
|
73
|
-
validLabel
|
|
74
|
-
invalid
|
|
75
|
-
invalidLabel
|
|
76
|
-
loading
|
|
77
|
-
loadingLabel
|
|
78
|
-
...
|
|
95
|
+
setup(props) {
|
|
96
|
+
const hintContent = computed(() => {
|
|
97
|
+
const slotProps = toReactive({
|
|
98
|
+
hintLabel,
|
|
99
|
+
modelValue,
|
|
100
|
+
valid,
|
|
101
|
+
validLabel,
|
|
102
|
+
invalid,
|
|
103
|
+
invalidLabel,
|
|
104
|
+
loading,
|
|
105
|
+
loadingLabel,
|
|
106
|
+
...props.params
|
|
79
107
|
});
|
|
80
|
-
|
|
108
|
+
if (invalid == null ? void 0 : invalid.value) {
|
|
109
|
+
return (invalidSlot == null ? void 0 : invalidSlot(slotProps)) || joinLines(invalidLabel == null ? void 0 : invalidLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
110
|
+
}
|
|
111
|
+
if (valid == null ? void 0 : valid.value)
|
|
112
|
+
return (validSlot == null ? void 0 : validSlot(slotProps)) || joinLines(validLabel == null ? void 0 : validLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
113
|
+
if (loading == null ? void 0 : loading.value)
|
|
114
|
+
return (loadingSlot == null ? void 0 : loadingSlot(slotProps)) || joinLines(loadingLabel == null ? void 0 : loadingLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
115
|
+
return (hintSlot == null ? void 0 : hintSlot(slotProps)) || joinLines(hintLabel == null ? void 0 : hintLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
81
116
|
});
|
|
82
117
|
return {
|
|
83
|
-
isVisible
|
|
84
|
-
hasInvalid
|
|
85
|
-
hasValid
|
|
86
|
-
hintContent
|
|
118
|
+
isVisible,
|
|
119
|
+
hasInvalid,
|
|
120
|
+
hasValid,
|
|
121
|
+
hintContent
|
|
87
122
|
};
|
|
88
123
|
},
|
|
89
124
|
render() {
|
|
90
|
-
if (this.isVisible)
|
|
91
|
-
return
|
|
125
|
+
if (this.isVisible) {
|
|
126
|
+
return h(
|
|
92
127
|
"small",
|
|
93
128
|
{
|
|
94
129
|
role: this.hasInvalid ? "alert" : this.hasValid ? "status" : void 0
|
|
95
130
|
},
|
|
96
131
|
this.hintContent
|
|
97
132
|
);
|
|
133
|
+
}
|
|
98
134
|
}
|
|
99
135
|
}
|
|
100
136
|
};
|
|
101
137
|
}
|
|
102
|
-
const
|
|
138
|
+
const VvIconProps = {
|
|
103
139
|
/**
|
|
104
140
|
* Color
|
|
105
141
|
*/
|
|
@@ -123,7 +159,7 @@ const Ye = {
|
|
|
123
159
|
*/
|
|
124
160
|
name: {
|
|
125
161
|
type: String,
|
|
126
|
-
required:
|
|
162
|
+
required: true
|
|
127
163
|
},
|
|
128
164
|
/**
|
|
129
165
|
* By default 'vv'
|
|
@@ -193,77 +229,160 @@ const Ye = {
|
|
|
193
229
|
type: [String, Array]
|
|
194
230
|
}
|
|
195
231
|
};
|
|
196
|
-
var
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
232
|
+
var Side = /* @__PURE__ */ ((Side2) => {
|
|
233
|
+
Side2["left"] = "left";
|
|
234
|
+
Side2["right"] = "right";
|
|
235
|
+
Side2["top"] = "top";
|
|
236
|
+
Side2["bottom"] = "bottom";
|
|
237
|
+
return Side2;
|
|
238
|
+
})(Side || {});
|
|
239
|
+
var Placement = /* @__PURE__ */ ((Placement2) => {
|
|
240
|
+
Placement2["topStart"] = "top-start";
|
|
241
|
+
Placement2["topEnd"] = "top-end";
|
|
242
|
+
Placement2["bottomStart"] = "bottom-start";
|
|
243
|
+
Placement2["bottomEnd"] = "bottom-end";
|
|
244
|
+
Placement2["leftStart"] = "left-start";
|
|
245
|
+
Placement2["leftEnd"] = "left-end";
|
|
246
|
+
Placement2["rightStart"] = "right-start";
|
|
247
|
+
Placement2["rightEnd"] = "right-end";
|
|
248
|
+
return Placement2;
|
|
249
|
+
})(Placement || {});
|
|
250
|
+
var Position = /* @__PURE__ */ ((Position2) => {
|
|
251
|
+
Position2["before"] = "before";
|
|
252
|
+
Position2["after"] = "after";
|
|
253
|
+
return Position2;
|
|
254
|
+
})(Position || {});
|
|
255
|
+
var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
256
|
+
ButtonType2["button"] = "button";
|
|
257
|
+
ButtonType2["submit"] = "submit";
|
|
258
|
+
ButtonType2["reset"] = "reset";
|
|
259
|
+
return ButtonType2;
|
|
260
|
+
})(ButtonType || {});
|
|
261
|
+
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
262
|
+
AnchorTarget2["_blank"] = "_blank";
|
|
263
|
+
AnchorTarget2["_self"] = "_self";
|
|
264
|
+
AnchorTarget2["_parent"] = "_parent";
|
|
265
|
+
AnchorTarget2["_top"] = "_top";
|
|
266
|
+
return AnchorTarget2;
|
|
267
|
+
})(AnchorTarget || {});
|
|
268
|
+
const INJECTION_KEY_VOLVER = Symbol.for("volver");
|
|
269
|
+
function useVolver() {
|
|
270
|
+
return inject(INJECTION_KEY_VOLVER);
|
|
200
271
|
}
|
|
201
|
-
function
|
|
202
|
-
return
|
|
203
|
-
const
|
|
204
|
-
[
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
272
|
+
function useModifiers(prefix, modifiers, others) {
|
|
273
|
+
return computed(() => {
|
|
274
|
+
const toReturn = {
|
|
275
|
+
[prefix]: true
|
|
276
|
+
};
|
|
277
|
+
const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
|
|
278
|
+
if (modifiersArray) {
|
|
279
|
+
if (Array.isArray(modifiersArray)) {
|
|
280
|
+
modifiersArray.forEach((modifier) => {
|
|
281
|
+
if (modifier) {
|
|
282
|
+
toReturn[`${prefix}--${modifier}`] = true;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (others) {
|
|
288
|
+
Object.keys(others.value).forEach((key) => {
|
|
289
|
+
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
return toReturn;
|
|
211
293
|
});
|
|
212
294
|
}
|
|
213
|
-
const
|
|
295
|
+
const __default__$1 = {
|
|
214
296
|
name: "VvIcon"
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
297
|
+
};
|
|
298
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
299
|
+
...__default__$1,
|
|
300
|
+
props: VvIconProps,
|
|
301
|
+
setup(__props) {
|
|
302
|
+
const props = __props;
|
|
303
|
+
const show = ref(true);
|
|
304
|
+
const volver = useVolver();
|
|
305
|
+
const { modifiers } = toRefs(props);
|
|
306
|
+
const bemCssClasses = useModifiers("vv-icon", modifiers);
|
|
307
|
+
const provider = computed(() => {
|
|
308
|
+
return props.provider || (volver == null ? void 0 : volver.iconsProvider);
|
|
309
|
+
});
|
|
310
|
+
const icon = computed(() => {
|
|
311
|
+
const _name = props.name ?? "";
|
|
312
|
+
const iconName = `@${provider.value}:${props.prefix}:${props.name}`;
|
|
313
|
+
if (iconExists(_name)) {
|
|
314
|
+
return _name;
|
|
315
|
+
} else if (iconExists(iconName)) {
|
|
316
|
+
return iconName;
|
|
317
|
+
} else {
|
|
318
|
+
return (volver == null ? void 0 : volver.iconsCollections.find(
|
|
319
|
+
(iconsCollection) => {
|
|
320
|
+
const icon2 = `@${provider.value}:${iconsCollection.prefix}:${_name}`;
|
|
321
|
+
if (iconExists(icon2)) {
|
|
322
|
+
return icon2;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
)) || _name;
|
|
326
|
+
}
|
|
228
327
|
});
|
|
229
|
-
function
|
|
230
|
-
let
|
|
231
|
-
if (typeof window
|
|
232
|
-
const { JSDOM
|
|
233
|
-
|
|
328
|
+
function getSvgContent(svg) {
|
|
329
|
+
let dom = null;
|
|
330
|
+
if (typeof window === "undefined") {
|
|
331
|
+
const { JSDOM } = require("jsdom");
|
|
332
|
+
dom = new JSDOM().window;
|
|
234
333
|
}
|
|
235
|
-
|
|
334
|
+
const domParser = dom ? new dom.DOMParser() : new window.DOMParser();
|
|
335
|
+
const svgDomString = domParser.parseFromString(svg, "text/html");
|
|
336
|
+
const svgEl = svgDomString.querySelector("svg");
|
|
337
|
+
return svgEl;
|
|
236
338
|
}
|
|
237
|
-
function
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
339
|
+
function addIconFromSvg(svg) {
|
|
340
|
+
const svgContentEl = getSvgContent(svg);
|
|
341
|
+
const svgContent = (svgContentEl == null ? void 0 : svgContentEl.innerHTML.trim()) || "";
|
|
342
|
+
if (svgContentEl && svgContent) {
|
|
343
|
+
addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
|
|
344
|
+
body: svgContent,
|
|
345
|
+
// Set height and width from svg content
|
|
346
|
+
height: svgContentEl.viewBox.baseVal.height,
|
|
347
|
+
width: svgContentEl.viewBox.baseVal.width
|
|
348
|
+
});
|
|
349
|
+
}
|
|
245
350
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
351
|
+
if (volver) {
|
|
352
|
+
if (props.src && !iconExists(`@${provider.value}:${props.prefix}:${props.name}`)) {
|
|
353
|
+
show.value = false;
|
|
354
|
+
volver.fetchIcon(props.src).then((svg) => {
|
|
355
|
+
if (svg) {
|
|
356
|
+
addIconFromSvg(svg);
|
|
357
|
+
show.value = true;
|
|
358
|
+
}
|
|
359
|
+
}).catch((e) => {
|
|
360
|
+
throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
|
|
361
|
+
});
|
|
362
|
+
} else if (props.svg) {
|
|
363
|
+
addIconFromSvg(props.svg);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return (_ctx, _cache) => {
|
|
367
|
+
return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
|
|
368
|
+
key: 0,
|
|
369
|
+
class: unref(bemCssClasses)
|
|
370
|
+
}, {
|
|
371
|
+
inline: _ctx.inline,
|
|
372
|
+
width: _ctx.width,
|
|
373
|
+
height: _ctx.height,
|
|
374
|
+
horizontalFlip: _ctx.horizontalFlip,
|
|
375
|
+
verticalFlip: _ctx.verticalFlip,
|
|
376
|
+
flip: _ctx.flip,
|
|
377
|
+
rotate: _ctx.rotate,
|
|
378
|
+
color: _ctx.color,
|
|
379
|
+
onLoad: _ctx.onLoad,
|
|
380
|
+
icon: unref(icon)
|
|
381
|
+
}), null, 16, ["class"])) : createCommentVNode("", true);
|
|
382
|
+
};
|
|
265
383
|
}
|
|
266
|
-
})
|
|
384
|
+
});
|
|
385
|
+
const LinkProps = {
|
|
267
386
|
/**
|
|
268
387
|
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
269
388
|
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
@@ -280,7 +399,7 @@ const Qe = {
|
|
|
280
399
|
*/
|
|
281
400
|
target: {
|
|
282
401
|
type: String,
|
|
283
|
-
validator: (
|
|
402
|
+
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
284
403
|
},
|
|
285
404
|
/**
|
|
286
405
|
* Anchor rel
|
|
@@ -289,7 +408,8 @@ const Qe = {
|
|
|
289
408
|
type: String,
|
|
290
409
|
default: "noopener noreferrer"
|
|
291
410
|
}
|
|
292
|
-
}
|
|
411
|
+
};
|
|
412
|
+
const ValidProps = {
|
|
293
413
|
/**
|
|
294
414
|
* Valid status
|
|
295
415
|
*/
|
|
@@ -298,7 +418,8 @@ const Qe = {
|
|
|
298
418
|
* Valid label
|
|
299
419
|
*/
|
|
300
420
|
validLabel: [String, Array]
|
|
301
|
-
}
|
|
421
|
+
};
|
|
422
|
+
const InvalidProps = {
|
|
302
423
|
/**
|
|
303
424
|
* Invalid status
|
|
304
425
|
*/
|
|
@@ -307,7 +428,8 @@ const Qe = {
|
|
|
307
428
|
* Invalid label
|
|
308
429
|
*/
|
|
309
430
|
invalidLabel: [String, Array]
|
|
310
|
-
}
|
|
431
|
+
};
|
|
432
|
+
const LoadingProps = {
|
|
311
433
|
/**
|
|
312
434
|
* Loading status
|
|
313
435
|
*/
|
|
@@ -319,53 +441,63 @@ const Qe = {
|
|
|
319
441
|
type: String,
|
|
320
442
|
default: "Loading..."
|
|
321
443
|
}
|
|
322
|
-
}
|
|
444
|
+
};
|
|
445
|
+
const DisabledProps = {
|
|
323
446
|
/**
|
|
324
447
|
* Whether the form control is disabled
|
|
325
448
|
*/
|
|
326
449
|
disabled: Boolean
|
|
327
|
-
}
|
|
450
|
+
};
|
|
451
|
+
const ActiveProps = {
|
|
328
452
|
/**
|
|
329
453
|
* Whether the item is active
|
|
330
454
|
*/
|
|
331
455
|
active: Boolean
|
|
332
|
-
}
|
|
456
|
+
};
|
|
457
|
+
const PressedProps = {
|
|
333
458
|
/**
|
|
334
459
|
* Whether the item is pressed
|
|
335
460
|
*/
|
|
336
461
|
pressed: Boolean
|
|
337
|
-
}
|
|
462
|
+
};
|
|
463
|
+
const LabelProps = {
|
|
338
464
|
/**
|
|
339
465
|
* The item label
|
|
340
466
|
*/
|
|
341
467
|
label: [String, Number]
|
|
342
|
-
}
|
|
468
|
+
};
|
|
469
|
+
const ReadonlyProps = {
|
|
343
470
|
/**
|
|
344
471
|
* The value is not editable
|
|
345
472
|
*/
|
|
346
473
|
readonly: Boolean
|
|
347
|
-
}
|
|
474
|
+
};
|
|
475
|
+
const ModifiersProps = {
|
|
348
476
|
/**
|
|
349
477
|
* Component BEM modifiers
|
|
350
478
|
*/
|
|
351
479
|
modifiers: [String, Array]
|
|
352
|
-
}
|
|
480
|
+
};
|
|
481
|
+
const HintProps = {
|
|
353
482
|
hintLabel: { type: String, default: "" }
|
|
354
|
-
}
|
|
483
|
+
};
|
|
484
|
+
const CountProps = {
|
|
355
485
|
/**
|
|
356
486
|
* Show character limit
|
|
357
487
|
*/
|
|
358
488
|
count: {
|
|
359
489
|
type: [Boolean, String],
|
|
360
|
-
default:
|
|
361
|
-
validator: (
|
|
490
|
+
default: false,
|
|
491
|
+
validator: (value) => [true, false, "limit", "countdown"].includes(value)
|
|
362
492
|
}
|
|
363
|
-
}
|
|
493
|
+
};
|
|
494
|
+
const DebounceProps = {
|
|
364
495
|
/**
|
|
365
496
|
* Milliseconds to wait before emitting the input event
|
|
366
497
|
*/
|
|
367
498
|
debounce: [Number, String]
|
|
368
|
-
}
|
|
499
|
+
};
|
|
500
|
+
const IconProps = {
|
|
369
501
|
/**
|
|
370
502
|
* VvIcon name or props
|
|
371
503
|
* @see VVIcon
|
|
@@ -376,79 +508,180 @@ const Qe = {
|
|
|
376
508
|
*/
|
|
377
509
|
iconPosition: {
|
|
378
510
|
type: String,
|
|
379
|
-
default:
|
|
380
|
-
validation: (
|
|
511
|
+
default: Position.before,
|
|
512
|
+
validation: (value) => Object.values(Position).includes(value)
|
|
381
513
|
}
|
|
382
|
-
}
|
|
514
|
+
};
|
|
515
|
+
const TabindexProps = {
|
|
383
516
|
/**
|
|
384
517
|
* Global attribute tabindex
|
|
385
518
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
|
|
386
519
|
*/
|
|
387
520
|
tabindex: { type: [String, Number], default: 0 }
|
|
388
|
-
}
|
|
521
|
+
};
|
|
522
|
+
const FloatingLabelProps = {
|
|
389
523
|
/**
|
|
390
524
|
* If true the label will be floating
|
|
391
525
|
*/
|
|
392
526
|
floating: Boolean
|
|
393
|
-
}
|
|
527
|
+
};
|
|
528
|
+
const IdProps = {
|
|
394
529
|
/**
|
|
395
530
|
* Global attribute id
|
|
396
531
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
397
532
|
*/
|
|
398
533
|
id: [String, Number]
|
|
399
534
|
};
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
535
|
+
({
|
|
536
|
+
/**
|
|
537
|
+
* Dropdown placement
|
|
538
|
+
*/
|
|
539
|
+
placement: {
|
|
540
|
+
type: String,
|
|
541
|
+
default: Side.bottom,
|
|
542
|
+
validator: (value) => {
|
|
543
|
+
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
/**
|
|
547
|
+
* Dropdown strategy
|
|
548
|
+
*/
|
|
549
|
+
strategy: {
|
|
550
|
+
type: String,
|
|
551
|
+
default: "absolute",
|
|
552
|
+
validator: (value) => {
|
|
553
|
+
return ["fixed", "absolute"].includes(value);
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
/**
|
|
557
|
+
* Dropdown show / hide transition name
|
|
558
|
+
*/
|
|
559
|
+
transitionName: {
|
|
560
|
+
type: String
|
|
561
|
+
},
|
|
562
|
+
/**
|
|
563
|
+
* Offset of the dropdown from the trigger
|
|
564
|
+
* @see https://floating-ui.com/docs/offset
|
|
565
|
+
*/
|
|
566
|
+
offset: {
|
|
567
|
+
type: [Number, String, Object],
|
|
568
|
+
default: 0
|
|
569
|
+
},
|
|
570
|
+
/**
|
|
571
|
+
* Move dropdown to the side if there is no space in the default position
|
|
572
|
+
* @see https://floating-ui.com/docs/shift
|
|
573
|
+
*/
|
|
574
|
+
shift: {
|
|
575
|
+
type: [Boolean, Object],
|
|
576
|
+
default: false
|
|
577
|
+
},
|
|
578
|
+
/**
|
|
579
|
+
* Flip dropdown position if there is no space in the default position
|
|
580
|
+
* @see https://floating-ui.com/docs/flip
|
|
581
|
+
*/
|
|
582
|
+
flip: {
|
|
583
|
+
type: [Boolean, Object],
|
|
584
|
+
default: true
|
|
585
|
+
},
|
|
586
|
+
/**
|
|
587
|
+
* Size of the dropdown
|
|
588
|
+
* @see https://floating-ui.com/docs/size
|
|
589
|
+
*/
|
|
590
|
+
size: {
|
|
591
|
+
type: [Boolean, Object],
|
|
592
|
+
default: () => ({ padding: 10 })
|
|
593
|
+
},
|
|
594
|
+
/**
|
|
595
|
+
* Automatically change the position of the dropdown
|
|
596
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
597
|
+
*/
|
|
598
|
+
autoPlacement: {
|
|
599
|
+
type: [Boolean, Object],
|
|
600
|
+
default: false
|
|
601
|
+
},
|
|
602
|
+
/**
|
|
603
|
+
* Add arrow to the dropdown
|
|
604
|
+
* @see https://floating-ui.com/docs/arrow
|
|
605
|
+
*/
|
|
606
|
+
arrow: {
|
|
607
|
+
type: Boolean,
|
|
608
|
+
default: false
|
|
609
|
+
},
|
|
610
|
+
/**
|
|
611
|
+
* Close dropdown on click outside
|
|
612
|
+
*/
|
|
613
|
+
autoClose: {
|
|
614
|
+
type: Boolean,
|
|
615
|
+
default: true
|
|
616
|
+
},
|
|
617
|
+
/**
|
|
618
|
+
* Autofocus first item on dropdown open
|
|
619
|
+
*/
|
|
620
|
+
autofocusFirst: {
|
|
621
|
+
type: Boolean,
|
|
622
|
+
default: true
|
|
623
|
+
},
|
|
624
|
+
/**
|
|
625
|
+
* Set dropdown width to the same as the trigger
|
|
626
|
+
*/
|
|
627
|
+
triggerWidth: {
|
|
628
|
+
type: Boolean
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
const IdNameProps = {
|
|
632
|
+
...IdProps,
|
|
403
633
|
/**
|
|
404
634
|
* Input / Textarea name
|
|
405
635
|
* Name of the form control. Submitted with the form as part of a name/value pair
|
|
406
636
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
|
|
407
637
|
*/
|
|
408
|
-
name: { type: String, required:
|
|
409
|
-
}
|
|
638
|
+
name: { type: String, required: true }
|
|
639
|
+
};
|
|
640
|
+
const AutofocusProps = {
|
|
410
641
|
/**
|
|
411
642
|
* Global attribute autofocus
|
|
412
643
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
|
|
413
644
|
*/
|
|
414
645
|
autofocus: Boolean
|
|
415
|
-
}
|
|
646
|
+
};
|
|
647
|
+
const AutocompleteProps = {
|
|
416
648
|
/**
|
|
417
649
|
* Global attribute autocomplete
|
|
418
650
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
|
|
419
651
|
*/
|
|
420
652
|
autocomplete: { type: String, default: "off" }
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
...
|
|
424
|
-
...
|
|
425
|
-
...
|
|
426
|
-
...
|
|
427
|
-
...
|
|
428
|
-
...
|
|
429
|
-
...
|
|
430
|
-
...
|
|
431
|
-
...
|
|
432
|
-
...
|
|
433
|
-
...
|
|
434
|
-
...
|
|
435
|
-
...
|
|
436
|
-
...
|
|
437
|
-
...
|
|
653
|
+
};
|
|
654
|
+
const InputTextareaProps = {
|
|
655
|
+
...IdNameProps,
|
|
656
|
+
...AutofocusProps,
|
|
657
|
+
...AutocompleteProps,
|
|
658
|
+
...TabindexProps,
|
|
659
|
+
...DisabledProps,
|
|
660
|
+
...ReadonlyProps,
|
|
661
|
+
...ValidProps,
|
|
662
|
+
...InvalidProps,
|
|
663
|
+
...HintProps,
|
|
664
|
+
...LoadingProps,
|
|
665
|
+
...ModifiersProps,
|
|
666
|
+
...CountProps,
|
|
667
|
+
...DebounceProps,
|
|
668
|
+
...IconProps,
|
|
669
|
+
...FloatingLabelProps,
|
|
670
|
+
...LabelProps,
|
|
438
671
|
/**
|
|
439
672
|
* Input / Textarea minlength
|
|
440
673
|
* Minimum length (number of characters) of value
|
|
441
674
|
* Available for input types: text, search, url, tel, email, password
|
|
442
675
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength
|
|
443
676
|
*/
|
|
444
|
-
minlength: Number,
|
|
677
|
+
minlength: [String, Number],
|
|
445
678
|
/**
|
|
446
679
|
* Input / Textarea maxlength
|
|
447
680
|
* Maximum length (number of characters) of value
|
|
448
681
|
* Available for input types: text, search, url, tel, email, password
|
|
449
682
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength
|
|
450
683
|
*/
|
|
451
|
-
maxlength: Number,
|
|
684
|
+
maxlength: [String, Number],
|
|
452
685
|
/**
|
|
453
686
|
* Input / Textarea placeholder
|
|
454
687
|
* Text that appears in the form control when it has no value set
|
|
@@ -465,17 +698,21 @@ const ft = {
|
|
|
465
698
|
required: Boolean
|
|
466
699
|
};
|
|
467
700
|
({
|
|
468
|
-
...
|
|
469
|
-
...
|
|
470
|
-
...
|
|
471
|
-
...
|
|
472
|
-
...
|
|
701
|
+
...DisabledProps,
|
|
702
|
+
...LabelProps,
|
|
703
|
+
...PressedProps,
|
|
704
|
+
...ActiveProps,
|
|
705
|
+
...LinkProps,
|
|
473
706
|
/**
|
|
474
707
|
* Button type
|
|
475
708
|
*/
|
|
476
|
-
type:
|
|
709
|
+
type: {
|
|
710
|
+
type: String,
|
|
711
|
+
default: ButtonType.button,
|
|
712
|
+
validator: (value) => Object.values(ButtonType).includes(value)
|
|
713
|
+
}
|
|
477
714
|
});
|
|
478
|
-
const
|
|
715
|
+
const INPUT_TYPES = {
|
|
479
716
|
TEXT: "text",
|
|
480
717
|
PASSWORD: "password",
|
|
481
718
|
NUMBER: "number",
|
|
@@ -489,15 +726,18 @@ const r = {
|
|
|
489
726
|
DATETIME_LOCAL: "datetime-local",
|
|
490
727
|
MONTH: "month",
|
|
491
728
|
WEEK: "week"
|
|
492
|
-
}
|
|
729
|
+
};
|
|
730
|
+
const TYPES_ICON = {
|
|
493
731
|
PASSWORD_SHOW: "eye-on",
|
|
494
732
|
PASSWORD_HIDE: "eye-off",
|
|
495
733
|
DATE: "calendar",
|
|
496
734
|
TIME: "time",
|
|
497
735
|
COLOR: "color",
|
|
498
736
|
SEARCH: "close"
|
|
499
|
-
}
|
|
500
|
-
|
|
737
|
+
};
|
|
738
|
+
const VvInputTextEvents = ["update:modelValue", "focus", "blur", "keyup"];
|
|
739
|
+
const VvInputTextProps = {
|
|
740
|
+
...InputTextareaProps,
|
|
501
741
|
/**
|
|
502
742
|
* Input value
|
|
503
743
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
@@ -509,8 +749,8 @@ const r = {
|
|
|
509
749
|
*/
|
|
510
750
|
type: {
|
|
511
751
|
type: String,
|
|
512
|
-
default:
|
|
513
|
-
validator: (
|
|
752
|
+
default: INPUT_TYPES.TEXT,
|
|
753
|
+
validator: (value) => Object.values(INPUT_TYPES).includes(value)
|
|
514
754
|
},
|
|
515
755
|
/**
|
|
516
756
|
* Minimum value
|
|
@@ -548,7 +788,7 @@ const r = {
|
|
|
548
788
|
*/
|
|
549
789
|
iconShowPassword: {
|
|
550
790
|
type: String,
|
|
551
|
-
default:
|
|
791
|
+
default: TYPES_ICON.PASSWORD_SHOW
|
|
552
792
|
},
|
|
553
793
|
/**
|
|
554
794
|
* VvIcon name for hide password button
|
|
@@ -556,7 +796,7 @@ const r = {
|
|
|
556
796
|
*/
|
|
557
797
|
iconHidePassword: {
|
|
558
798
|
type: String,
|
|
559
|
-
default:
|
|
799
|
+
default: TYPES_ICON.PASSWORD_HIDE
|
|
560
800
|
},
|
|
561
801
|
/**
|
|
562
802
|
* VvIcon name for clear button
|
|
@@ -564,7 +804,7 @@ const r = {
|
|
|
564
804
|
*/
|
|
565
805
|
iconClear: {
|
|
566
806
|
type: String,
|
|
567
|
-
default:
|
|
807
|
+
default: TYPES_ICON.SEARCH
|
|
568
808
|
},
|
|
569
809
|
/**
|
|
570
810
|
* Label for step up button
|
|
@@ -600,15 +840,76 @@ const r = {
|
|
|
600
840
|
labelClear: {
|
|
601
841
|
type: String,
|
|
602
842
|
default: "Clear"
|
|
843
|
+
},
|
|
844
|
+
/**
|
|
845
|
+
* Input mask, only for text type
|
|
846
|
+
* @see https://beholdr.github.io/maska/
|
|
847
|
+
*/
|
|
848
|
+
mask: {
|
|
849
|
+
type: String,
|
|
850
|
+
default: void 0
|
|
851
|
+
},
|
|
852
|
+
/**
|
|
853
|
+
* Show mask before typing
|
|
854
|
+
* @see https://beholdr.github.io/maska/#/?id=maskinput-options
|
|
855
|
+
*/
|
|
856
|
+
maskEager: {
|
|
857
|
+
type: Boolean,
|
|
858
|
+
default: false
|
|
859
|
+
},
|
|
860
|
+
/**
|
|
861
|
+
* Write values reverse (ex. for numbers)
|
|
862
|
+
* @see https://beholdr.github.io/maska/#/?id=maskinput-options
|
|
863
|
+
*/
|
|
864
|
+
maskReversed: {
|
|
865
|
+
type: Boolean,
|
|
866
|
+
default: false
|
|
867
|
+
},
|
|
868
|
+
/**
|
|
869
|
+
* Add mask custom tokens
|
|
870
|
+
* @see https://beholdr.github.io/maska/#/?id=custom-tokens
|
|
871
|
+
*/
|
|
872
|
+
maskTokens: {
|
|
873
|
+
type: Object,
|
|
874
|
+
default: void 0
|
|
875
|
+
},
|
|
876
|
+
/**
|
|
877
|
+
* Replace default tokens
|
|
878
|
+
* @see https://beholdr.github.io/maska/#/?id=custom-tokens
|
|
879
|
+
*/
|
|
880
|
+
maskTokensReplace: {
|
|
881
|
+
type: Boolean,
|
|
882
|
+
default: false
|
|
883
|
+
},
|
|
884
|
+
/**
|
|
885
|
+
* Adjust input width to content
|
|
886
|
+
*/
|
|
887
|
+
autoWidth: {
|
|
888
|
+
type: Boolean,
|
|
889
|
+
default: false
|
|
890
|
+
},
|
|
891
|
+
/**
|
|
892
|
+
* Hide type number, password and search actions
|
|
893
|
+
*/
|
|
894
|
+
hideActions: {
|
|
895
|
+
type: Boolean,
|
|
896
|
+
default: false
|
|
897
|
+
},
|
|
898
|
+
/**
|
|
899
|
+
* Add unit label to input
|
|
900
|
+
*/
|
|
901
|
+
unit: {
|
|
902
|
+
type: String
|
|
603
903
|
}
|
|
604
|
-
}
|
|
904
|
+
};
|
|
905
|
+
const VvInputPasswordAction = defineComponent({
|
|
605
906
|
components: {
|
|
606
|
-
VvIcon:
|
|
907
|
+
VvIcon: _sfc_main$1
|
|
607
908
|
},
|
|
608
909
|
props: {
|
|
609
910
|
disabled: {
|
|
610
911
|
type: Boolean,
|
|
611
|
-
default:
|
|
912
|
+
default: false
|
|
612
913
|
},
|
|
613
914
|
labelShow: {
|
|
614
915
|
type: String,
|
|
@@ -620,33 +921,38 @@ const r = {
|
|
|
620
921
|
},
|
|
621
922
|
iconShow: {
|
|
622
923
|
type: String,
|
|
623
|
-
default:
|
|
924
|
+
default: TYPES_ICON.PASSWORD_SHOW
|
|
624
925
|
},
|
|
625
926
|
iconHide: {
|
|
626
927
|
type: String,
|
|
627
|
-
default:
|
|
928
|
+
default: TYPES_ICON.PASSWORD_HIDE
|
|
628
929
|
}
|
|
629
930
|
},
|
|
630
931
|
emits: ["toggle-password"],
|
|
631
|
-
setup(
|
|
632
|
-
const
|
|
633
|
-
|
|
932
|
+
setup(props, { emit }) {
|
|
933
|
+
const active = ref(false);
|
|
934
|
+
const activeIcon = computed(
|
|
935
|
+
() => active.value ? props.iconHide : props.iconShow
|
|
634
936
|
);
|
|
635
|
-
function
|
|
636
|
-
|
|
937
|
+
function onClick(e) {
|
|
938
|
+
e == null ? void 0 : e.stopPropagation();
|
|
939
|
+
if (!props.disabled) {
|
|
940
|
+
active.value = !active.value;
|
|
941
|
+
emit("toggle-password", active.value);
|
|
942
|
+
}
|
|
637
943
|
}
|
|
638
944
|
return {
|
|
639
|
-
active
|
|
640
|
-
activeIcon
|
|
641
|
-
onClick
|
|
945
|
+
active,
|
|
946
|
+
activeIcon,
|
|
947
|
+
onClick
|
|
642
948
|
};
|
|
643
949
|
},
|
|
644
950
|
render() {
|
|
645
|
-
const
|
|
951
|
+
const icon = h(_sfc_main$1, {
|
|
646
952
|
name: this.activeIcon,
|
|
647
|
-
class: "vv-input-
|
|
953
|
+
class: "vv-input-text__icon"
|
|
648
954
|
});
|
|
649
|
-
return
|
|
955
|
+
return h(
|
|
650
956
|
"button",
|
|
651
957
|
{
|
|
652
958
|
disabled: this.disabled,
|
|
@@ -655,56 +961,63 @@ const r = {
|
|
|
655
961
|
type: "button",
|
|
656
962
|
onClick: this.onClick
|
|
657
963
|
},
|
|
658
|
-
|
|
964
|
+
icon
|
|
659
965
|
);
|
|
660
966
|
}
|
|
661
|
-
})
|
|
967
|
+
});
|
|
968
|
+
const VvInputStepAction = defineComponent({
|
|
662
969
|
components: {
|
|
663
|
-
VvIcon:
|
|
970
|
+
VvIcon: _sfc_main$1
|
|
664
971
|
},
|
|
665
972
|
props: {
|
|
666
973
|
disabled: {
|
|
667
974
|
type: Boolean,
|
|
668
|
-
default:
|
|
975
|
+
default: false
|
|
669
976
|
},
|
|
670
977
|
label: {
|
|
671
978
|
type: String
|
|
672
979
|
},
|
|
673
980
|
mode: {
|
|
674
981
|
type: String,
|
|
675
|
-
validator: (
|
|
982
|
+
validator: (v) => ["up", "down"].includes(v),
|
|
676
983
|
default: "up"
|
|
677
984
|
}
|
|
678
985
|
},
|
|
679
986
|
emits: ["step-up", "step-down"],
|
|
680
|
-
setup(
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
987
|
+
setup(props, { emit }) {
|
|
988
|
+
const isUp = computed(() => props.mode === "up");
|
|
989
|
+
const onClick = (e) => {
|
|
990
|
+
e == null ? void 0 : e.stopPropagation();
|
|
991
|
+
if (!props.disabled) {
|
|
992
|
+
emit(isUp.value ? "step-up" : "step-down");
|
|
686
993
|
}
|
|
687
994
|
};
|
|
995
|
+
return {
|
|
996
|
+
isUp,
|
|
997
|
+
onClick
|
|
998
|
+
};
|
|
688
999
|
},
|
|
689
1000
|
render() {
|
|
690
|
-
return
|
|
1001
|
+
return h("button", {
|
|
691
1002
|
class: [
|
|
692
|
-
"vv-input-text__action-chevron",
|
|
1003
|
+
"vv-input-text__action vv-input-text__action-chevron",
|
|
693
1004
|
this.isUp && "vv-input-text__action-chevron-up"
|
|
694
1005
|
],
|
|
695
1006
|
disabled: this.disabled,
|
|
696
1007
|
ariaLabel: this.label,
|
|
1008
|
+
type: "button",
|
|
697
1009
|
onClick: this.onClick
|
|
698
1010
|
});
|
|
699
1011
|
}
|
|
700
|
-
})
|
|
1012
|
+
});
|
|
1013
|
+
const VvInputClearAction = defineComponent({
|
|
701
1014
|
components: {
|
|
702
|
-
VvIcon:
|
|
1015
|
+
VvIcon: _sfc_main$1
|
|
703
1016
|
},
|
|
704
1017
|
props: {
|
|
705
1018
|
disabled: {
|
|
706
1019
|
type: Boolean,
|
|
707
|
-
default:
|
|
1020
|
+
default: false
|
|
708
1021
|
},
|
|
709
1022
|
label: {
|
|
710
1023
|
type: String,
|
|
@@ -716,20 +1029,23 @@ const r = {
|
|
|
716
1029
|
}
|
|
717
1030
|
},
|
|
718
1031
|
emits: ["clear"],
|
|
719
|
-
setup(
|
|
720
|
-
function
|
|
721
|
-
|
|
1032
|
+
setup(props, { emit }) {
|
|
1033
|
+
function onClick(e) {
|
|
1034
|
+
e == null ? void 0 : e.stopPropagation();
|
|
1035
|
+
if (!props.disabled) {
|
|
1036
|
+
emit("clear");
|
|
1037
|
+
}
|
|
722
1038
|
}
|
|
723
1039
|
return {
|
|
724
|
-
onClick
|
|
1040
|
+
onClick
|
|
725
1041
|
};
|
|
726
1042
|
},
|
|
727
1043
|
render() {
|
|
728
|
-
const
|
|
1044
|
+
const icon = h(_sfc_main$1, {
|
|
729
1045
|
name: this.icon,
|
|
730
|
-
class: "vv-input-
|
|
1046
|
+
class: "vv-input-text__icon"
|
|
731
1047
|
});
|
|
732
|
-
return
|
|
1048
|
+
return h(
|
|
733
1049
|
"button",
|
|
734
1050
|
{
|
|
735
1051
|
disabled: this.disabled,
|
|
@@ -738,51 +1054,54 @@ const r = {
|
|
|
738
1054
|
type: "button",
|
|
739
1055
|
onClick: this.onClick
|
|
740
1056
|
},
|
|
741
|
-
|
|
1057
|
+
icon
|
|
742
1058
|
);
|
|
743
1059
|
}
|
|
744
1060
|
});
|
|
745
|
-
function
|
|
1061
|
+
function VvInputTextActionsFactory(type, parentProps) {
|
|
746
1062
|
return {
|
|
747
1063
|
name: "VvInputTextActions",
|
|
748
1064
|
components: {
|
|
749
|
-
VvIcon:
|
|
750
|
-
VvInputPasswordAction
|
|
751
|
-
VvInputStepAction
|
|
752
|
-
VvInputClearAction
|
|
1065
|
+
VvIcon: _sfc_main$1,
|
|
1066
|
+
VvInputPasswordAction,
|
|
1067
|
+
VvInputStepAction,
|
|
1068
|
+
VvInputClearAction
|
|
753
1069
|
},
|
|
754
1070
|
setup() {
|
|
1071
|
+
const isDisabled = computed(() => {
|
|
1072
|
+
return parentProps.disabled || parentProps.readonly;
|
|
1073
|
+
});
|
|
755
1074
|
return {
|
|
756
|
-
isDisabled
|
|
757
|
-
labelStepUp:
|
|
758
|
-
labelStepDown:
|
|
759
|
-
labelShowPassword:
|
|
760
|
-
labelHidePassword:
|
|
761
|
-
labelClear:
|
|
762
|
-
iconShowPassword:
|
|
763
|
-
iconHidePassword:
|
|
1075
|
+
isDisabled,
|
|
1076
|
+
labelStepUp: parentProps.labelStepUp,
|
|
1077
|
+
labelStepDown: parentProps.labelStepDown,
|
|
1078
|
+
labelShowPassword: parentProps.labelShowPassword,
|
|
1079
|
+
labelHidePassword: parentProps.labelHidePassword,
|
|
1080
|
+
labelClear: parentProps.labelClear,
|
|
1081
|
+
iconShowPassword: parentProps.iconShowPassword,
|
|
1082
|
+
iconHidePassword: parentProps.iconHidePassword
|
|
764
1083
|
};
|
|
765
1084
|
},
|
|
766
1085
|
render() {
|
|
767
|
-
let
|
|
768
|
-
switch (
|
|
769
|
-
case
|
|
770
|
-
const { onClear
|
|
771
|
-
|
|
772
|
-
|
|
1086
|
+
let actions = null;
|
|
1087
|
+
switch (type) {
|
|
1088
|
+
case INPUT_TYPES.SEARCH: {
|
|
1089
|
+
const { onClear } = this.$attrs;
|
|
1090
|
+
actions = [
|
|
1091
|
+
h(VvInputClearAction, {
|
|
773
1092
|
disabled: this.isDisabled,
|
|
774
1093
|
label: this.labelShowPassword,
|
|
775
|
-
onClear
|
|
1094
|
+
onClear
|
|
776
1095
|
})
|
|
777
1096
|
];
|
|
778
1097
|
break;
|
|
779
1098
|
}
|
|
780
|
-
case
|
|
781
|
-
const { onTogglePassword
|
|
782
|
-
|
|
783
|
-
|
|
1099
|
+
case INPUT_TYPES.PASSWORD: {
|
|
1100
|
+
const { onTogglePassword } = this.$attrs;
|
|
1101
|
+
actions = [
|
|
1102
|
+
h(VvInputPasswordAction, {
|
|
784
1103
|
disabled: this.isDisabled,
|
|
785
|
-
onTogglePassword
|
|
1104
|
+
onTogglePassword,
|
|
786
1105
|
labelShow: this.labelShowPassword,
|
|
787
1106
|
labelHide: this.labelHidePassword,
|
|
788
1107
|
iconShow: this.iconShowPassword,
|
|
@@ -791,258 +1110,463 @@ function ee(e, t) {
|
|
|
791
1110
|
];
|
|
792
1111
|
break;
|
|
793
1112
|
}
|
|
794
|
-
case
|
|
795
|
-
const { onStepUp
|
|
796
|
-
|
|
797
|
-
|
|
1113
|
+
case INPUT_TYPES.NUMBER: {
|
|
1114
|
+
const { onStepUp, onStepDown } = this.$attrs;
|
|
1115
|
+
actions = [
|
|
1116
|
+
h(VvInputStepAction, {
|
|
798
1117
|
mode: "up",
|
|
799
|
-
disabled: this.isDisabled ||
|
|
1118
|
+
disabled: this.isDisabled || parentProps.max !== void 0 && parentProps.modelValue === parentProps.max,
|
|
800
1119
|
label: this.labelStepUp,
|
|
801
|
-
onStepUp
|
|
802
|
-
onStepDown
|
|
1120
|
+
onStepUp,
|
|
1121
|
+
onStepDown
|
|
803
1122
|
}),
|
|
804
|
-
|
|
1123
|
+
h(VvInputStepAction, {
|
|
805
1124
|
mode: "down",
|
|
806
|
-
disabled: this.isDisabled ||
|
|
1125
|
+
disabled: this.isDisabled || parentProps.min !== void 0 && parentProps.modelValue === parentProps.min,
|
|
807
1126
|
label: this.labelStepDown,
|
|
808
|
-
onStepUp
|
|
809
|
-
onStepDown
|
|
1127
|
+
onStepUp,
|
|
1128
|
+
onStepDown
|
|
810
1129
|
})
|
|
811
1130
|
];
|
|
812
1131
|
break;
|
|
813
1132
|
}
|
|
814
1133
|
}
|
|
815
|
-
return Array.isArray(
|
|
1134
|
+
return Array.isArray(actions) ? h("div", { class: "vv-input-text__actions-group" }, actions) : actions;
|
|
816
1135
|
}
|
|
817
1136
|
};
|
|
818
1137
|
}
|
|
819
|
-
const
|
|
820
|
-
function
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
1138
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
|
|
1139
|
+
function useDebouncedInput(modelValue, emit, ms = 0, {
|
|
1140
|
+
getter = (value) => value,
|
|
1141
|
+
setter = (value) => value
|
|
1142
|
+
} = {}) {
|
|
1143
|
+
let timeout;
|
|
1144
|
+
if (typeof ms === "string") {
|
|
1145
|
+
ms = parseInt(ms);
|
|
1146
|
+
}
|
|
1147
|
+
return computed({
|
|
1148
|
+
get: () => getter(modelValue == null ? void 0 : modelValue.value),
|
|
1149
|
+
set: (value) => {
|
|
1150
|
+
if (timeout) {
|
|
1151
|
+
clearTimeout(timeout);
|
|
1152
|
+
}
|
|
1153
|
+
timeout = setTimeout(() => {
|
|
1154
|
+
emit("update:modelValue", setter(value));
|
|
1155
|
+
}, ms);
|
|
828
1156
|
}
|
|
829
1157
|
});
|
|
830
1158
|
}
|
|
831
|
-
function
|
|
832
|
-
const { focused
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
})
|
|
836
|
-
|
|
1159
|
+
function useComponentFocus(inputTemplateRef, emit) {
|
|
1160
|
+
const { focused } = useFocus(inputTemplateRef);
|
|
1161
|
+
watch(focused, (newValue) => {
|
|
1162
|
+
emit(newValue ? "focus" : "blur", unref(inputTemplateRef));
|
|
1163
|
+
});
|
|
1164
|
+
return {
|
|
1165
|
+
focused
|
|
837
1166
|
};
|
|
838
1167
|
}
|
|
839
|
-
function
|
|
840
|
-
const
|
|
841
|
-
() => Boolean((
|
|
842
|
-
)
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
() => Boolean((
|
|
848
|
-
)
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
() => Boolean((e == null ? void 0 : e.value) && t.value === T.bottom)
|
|
1168
|
+
function useComponentIcon(icon, iconPosition) {
|
|
1169
|
+
const hasIconBefore = computed(
|
|
1170
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Position.before)
|
|
1171
|
+
);
|
|
1172
|
+
const hasIconAfter = computed(
|
|
1173
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Position.after)
|
|
1174
|
+
);
|
|
1175
|
+
const hasIconLeft = computed(
|
|
1176
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.left)
|
|
1177
|
+
);
|
|
1178
|
+
const hasIconRight = computed(
|
|
1179
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.right)
|
|
852
1180
|
);
|
|
1181
|
+
const hasIconTop = computed(
|
|
1182
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.top)
|
|
1183
|
+
);
|
|
1184
|
+
const hasIconBottom = computed(
|
|
1185
|
+
() => Boolean((icon == null ? void 0 : icon.value) && iconPosition.value === Side.bottom)
|
|
1186
|
+
);
|
|
1187
|
+
const hasIcon = computed(() => {
|
|
1188
|
+
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
1189
|
+
return { name: icon == null ? void 0 : icon.value };
|
|
1190
|
+
}
|
|
1191
|
+
return icon == null ? void 0 : icon.value;
|
|
1192
|
+
});
|
|
853
1193
|
return {
|
|
854
|
-
hasIcon
|
|
855
|
-
hasIconLeft
|
|
856
|
-
hasIconRight
|
|
857
|
-
hasIconTop
|
|
858
|
-
hasIconBottom
|
|
859
|
-
hasIconBefore
|
|
860
|
-
hasIconAfter
|
|
1194
|
+
hasIcon,
|
|
1195
|
+
hasIconLeft,
|
|
1196
|
+
hasIconRight,
|
|
1197
|
+
hasIconTop,
|
|
1198
|
+
hasIconBottom,
|
|
1199
|
+
hasIconBefore,
|
|
1200
|
+
hasIconAfter
|
|
861
1201
|
};
|
|
862
1202
|
}
|
|
863
|
-
function
|
|
864
|
-
const
|
|
1203
|
+
function useTextCount(text, options) {
|
|
1204
|
+
const length = computed(() => {
|
|
1205
|
+
return (unref(text) ?? "").length;
|
|
1206
|
+
});
|
|
1207
|
+
const gap = computed(() => {
|
|
1208
|
+
if ((options == null ? void 0 : options.lowerLimit) !== void 0 && length.value < (options == null ? void 0 : options.lowerLimit)) {
|
|
1209
|
+
return length.value - options.lowerLimit;
|
|
1210
|
+
}
|
|
1211
|
+
if ((options == null ? void 0 : options.upperLimit) !== void 0 && length.value < (options == null ? void 0 : options.upperLimit)) {
|
|
1212
|
+
return options.upperLimit - length.value;
|
|
1213
|
+
}
|
|
1214
|
+
return 0;
|
|
1215
|
+
});
|
|
1216
|
+
const formatted = computed(() => {
|
|
1217
|
+
if ((options == null ? void 0 : options.mode) === false) {
|
|
1218
|
+
return "";
|
|
1219
|
+
}
|
|
1220
|
+
if ((options == null ? void 0 : options.mode) === "limit" && (options == null ? void 0 : options.upperLimit)) {
|
|
1221
|
+
return `${length.value} / ${options.lowerLimit ? `${options.lowerLimit}-` : ""}${options.upperLimit}`;
|
|
1222
|
+
}
|
|
1223
|
+
if ((options == null ? void 0 : options.mode) === "countdown") {
|
|
1224
|
+
if (gap.value === 0) {
|
|
1225
|
+
return void 0;
|
|
1226
|
+
}
|
|
1227
|
+
return gap;
|
|
1228
|
+
}
|
|
1229
|
+
return length.value;
|
|
1230
|
+
});
|
|
865
1231
|
return {
|
|
866
|
-
length
|
|
867
|
-
gap
|
|
868
|
-
formatted
|
|
1232
|
+
length,
|
|
1233
|
+
gap,
|
|
1234
|
+
formatted
|
|
869
1235
|
};
|
|
870
1236
|
}
|
|
871
|
-
const
|
|
1237
|
+
const _hoisted_1 = ["for"];
|
|
1238
|
+
const _hoisted_2 = { class: "vv-input-text__wrapper" };
|
|
1239
|
+
const _hoisted_3 = {
|
|
872
1240
|
key: 0,
|
|
873
1241
|
class: "vv-input-text__input-before"
|
|
874
|
-
}
|
|
1242
|
+
};
|
|
1243
|
+
const _hoisted_4 = ["onClick"];
|
|
1244
|
+
const _hoisted_5 = ["id"];
|
|
1245
|
+
const _hoisted_6 = {
|
|
875
1246
|
key: 1,
|
|
1247
|
+
class: "vv-input-text__unit"
|
|
1248
|
+
};
|
|
1249
|
+
const _hoisted_7 = {
|
|
1250
|
+
key: 5,
|
|
876
1251
|
class: "vv-input-text__input-after"
|
|
877
|
-
}
|
|
878
|
-
|
|
1252
|
+
};
|
|
1253
|
+
const _hoisted_8 = {
|
|
1254
|
+
key: 6,
|
|
879
1255
|
class: "vv-input-text__limit"
|
|
880
|
-
}
|
|
1256
|
+
};
|
|
1257
|
+
const __default__ = {
|
|
881
1258
|
name: "VvInputText"
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
1259
|
+
};
|
|
1260
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1261
|
+
...__default__,
|
|
1262
|
+
props: VvInputTextProps,
|
|
1263
|
+
emits: VvInputTextEvents,
|
|
1264
|
+
setup(__props, { expose, emit }) {
|
|
1265
|
+
const props = __props;
|
|
1266
|
+
const slots = useSlots();
|
|
1267
|
+
const inputEl = ref();
|
|
1268
|
+
const innerEl = ref();
|
|
1269
|
+
expose({ $inner: innerEl });
|
|
1270
|
+
const {
|
|
1271
|
+
id,
|
|
1272
|
+
icon,
|
|
1273
|
+
iconPosition,
|
|
1274
|
+
label,
|
|
1275
|
+
modelValue,
|
|
1276
|
+
count,
|
|
1277
|
+
valid,
|
|
1278
|
+
invalid,
|
|
1279
|
+
loading
|
|
1280
|
+
} = toRefs(props);
|
|
1281
|
+
const hasId = useUniqueId(id);
|
|
1282
|
+
const hasDescribedBy = computed(() => `${hasId.value}-hint`);
|
|
1283
|
+
const inputTextPlaceholder = computed(
|
|
1284
|
+
() => props.floating && isEmpty(props.placeholder) ? " " : props.placeholder
|
|
1285
|
+
);
|
|
1286
|
+
const localModelValue = useDebouncedInput(
|
|
1287
|
+
modelValue,
|
|
1288
|
+
emit,
|
|
1289
|
+
props.debounce,
|
|
1290
|
+
{
|
|
1291
|
+
getter: (value) => {
|
|
1292
|
+
if (mask.value) {
|
|
1293
|
+
return mask.value.masked(value ?? "");
|
|
1294
|
+
}
|
|
1295
|
+
return value;
|
|
1296
|
+
},
|
|
1297
|
+
setter: (value) => {
|
|
1298
|
+
if (mask.value) {
|
|
1299
|
+
value = mask.value.unmasked(value);
|
|
1300
|
+
}
|
|
1301
|
+
if (props.type === INPUT_TYPES.NUMBER) {
|
|
1302
|
+
return Number(value);
|
|
1303
|
+
}
|
|
1304
|
+
return value;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
);
|
|
1308
|
+
const { focused } = useComponentFocus(inputEl, emit);
|
|
1309
|
+
const isFocused = computed(
|
|
1310
|
+
() => focused.value && !props.disabled && !props.readonly
|
|
1311
|
+
);
|
|
1312
|
+
const isVisible = useElementVisibility(inputEl);
|
|
1313
|
+
watch(isVisible, (newValue) => {
|
|
1314
|
+
if (newValue && props.autofocus && !props.disabled && !props.readonly) {
|
|
1315
|
+
focused.value = true;
|
|
1316
|
+
}
|
|
902
1317
|
});
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
1318
|
+
const showPassword = ref(false);
|
|
1319
|
+
const isPassword = computed(() => props.type === INPUT_TYPES.PASSWORD);
|
|
1320
|
+
const onTogglePassword = () => {
|
|
1321
|
+
showPassword.value = !showPassword.value;
|
|
1322
|
+
};
|
|
1323
|
+
const isDateTime = computed(
|
|
1324
|
+
() => props.type === INPUT_TYPES.TIME || props.type === INPUT_TYPES.DATETIME_LOCAL || props.type === INPUT_TYPES.DATE || props.type === INPUT_TYPES.WEEK || props.type === INPUT_TYPES.MONTH
|
|
1325
|
+
);
|
|
1326
|
+
const isNumber = computed(() => props.type === INPUT_TYPES.NUMBER);
|
|
1327
|
+
const onStepUp = () => {
|
|
1328
|
+
if (isClickable.value) {
|
|
1329
|
+
inputEl.value.stepUp();
|
|
1330
|
+
localModelValue.value = unref(inputEl).value;
|
|
1331
|
+
}
|
|
1332
|
+
};
|
|
1333
|
+
const onStepDown = () => {
|
|
1334
|
+
if (isClickable.value) {
|
|
1335
|
+
inputEl.value.stepDown();
|
|
1336
|
+
localModelValue.value = unref(inputEl).value;
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
const isSearch = computed(() => props.type === INPUT_TYPES.SEARCH);
|
|
1340
|
+
const onClear = () => {
|
|
1341
|
+
localModelValue.value = void 0;
|
|
1342
|
+
};
|
|
1343
|
+
const { hasIcon, hasIconBefore, hasIconAfter } = useComponentIcon(
|
|
1344
|
+
icon,
|
|
1345
|
+
iconPosition
|
|
1346
|
+
);
|
|
1347
|
+
const defaultAfterIcon = computed(() => {
|
|
1348
|
+
switch (props.type) {
|
|
1349
|
+
case INPUT_TYPES.COLOR:
|
|
1350
|
+
return { name: TYPES_ICON.COLOR };
|
|
1351
|
+
case INPUT_TYPES.DATE:
|
|
1352
|
+
case INPUT_TYPES.DATETIME_LOCAL:
|
|
1353
|
+
case INPUT_TYPES.WEEK:
|
|
1354
|
+
case INPUT_TYPES.MONTH:
|
|
1355
|
+
return { name: TYPES_ICON.DATE };
|
|
1356
|
+
case INPUT_TYPES.TIME:
|
|
1357
|
+
return { name: TYPES_ICON.TIME };
|
|
927
1358
|
default:
|
|
928
1359
|
return "";
|
|
929
1360
|
}
|
|
930
|
-
})
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
1361
|
+
});
|
|
1362
|
+
const { formatted: countFormatted } = useTextCount(localModelValue, {
|
|
1363
|
+
mode: props.count,
|
|
1364
|
+
upperLimit: Number(props.maxlength),
|
|
1365
|
+
lowerLimit: Number(props.minlength)
|
|
1366
|
+
});
|
|
1367
|
+
const isClickable = computed(() => !props.disabled && !props.readonly);
|
|
1368
|
+
const hasTabindex = computed(
|
|
1369
|
+
() => isClickable.value ? props.tabindex : -1
|
|
1370
|
+
);
|
|
1371
|
+
const isDirty = computed(() => !isEmpty(modelValue));
|
|
1372
|
+
const isInvalid = computed(() => {
|
|
1373
|
+
if (invalid.value === true) {
|
|
1374
|
+
return true;
|
|
1375
|
+
}
|
|
1376
|
+
if (valid.value === true) {
|
|
1377
|
+
return false;
|
|
1378
|
+
}
|
|
1379
|
+
return void 0;
|
|
1380
|
+
});
|
|
1381
|
+
const { modifiers } = toRefs(props);
|
|
1382
|
+
const bemCssClasses = useModifiers(
|
|
942
1383
|
"vv-input-text",
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
valid:
|
|
946
|
-
invalid:
|
|
947
|
-
loading:
|
|
948
|
-
disabled:
|
|
949
|
-
readonly:
|
|
950
|
-
"icon-before":
|
|
951
|
-
"icon-after":
|
|
952
|
-
floating:
|
|
953
|
-
dirty:
|
|
954
|
-
focus:
|
|
1384
|
+
modifiers,
|
|
1385
|
+
computed(() => ({
|
|
1386
|
+
valid: valid.value,
|
|
1387
|
+
invalid: invalid.value,
|
|
1388
|
+
loading: loading.value,
|
|
1389
|
+
disabled: props.disabled,
|
|
1390
|
+
readonly: props.readonly,
|
|
1391
|
+
"icon-before": hasIconBefore.value,
|
|
1392
|
+
"icon-after": hasIconAfter.value || !isEmpty(defaultAfterIcon),
|
|
1393
|
+
floating: props.floating && !isEmpty(props.label),
|
|
1394
|
+
dirty: isDirty.value,
|
|
1395
|
+
focus: isFocused.value,
|
|
1396
|
+
"auto-width": props.autoWidth
|
|
955
1397
|
}))
|
|
956
|
-
)
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1398
|
+
);
|
|
1399
|
+
const hasAttrs = computed(() => {
|
|
1400
|
+
const type = (() => {
|
|
1401
|
+
if (isPassword.value && showPassword.value) {
|
|
1402
|
+
return INPUT_TYPES.TEXT;
|
|
1403
|
+
}
|
|
1404
|
+
if (isDateTime.value && !isDirty.value && !focused.value) {
|
|
1405
|
+
return INPUT_TYPES.TEXT;
|
|
1406
|
+
}
|
|
1407
|
+
return props.type;
|
|
1408
|
+
})();
|
|
1409
|
+
const toReturn = {
|
|
1410
|
+
type,
|
|
1411
|
+
name: props.name,
|
|
1412
|
+
tabindex: hasTabindex.value,
|
|
1413
|
+
disabled: props.disabled,
|
|
1414
|
+
readonly: props.readonly,
|
|
1415
|
+
required: props.required,
|
|
1416
|
+
autocomplete: props.autocomplete,
|
|
1417
|
+
"aria-invalid": isInvalid.value,
|
|
1418
|
+
"aria-describedby": !hasInvalid.value && hasHint.value ? hasDescribedBy.value : void 0,
|
|
1419
|
+
"aria-errormessage": hasInvalid.value ? hasDescribedBy.value : void 0
|
|
968
1420
|
};
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1421
|
+
if (type === INPUT_TYPES.DATE || type === INPUT_TYPES.MONTH || type === INPUT_TYPES.WEEK || type === INPUT_TYPES.TIME || type === INPUT_TYPES.DATETIME_LOCAL || type === INPUT_TYPES.NUMBER) {
|
|
1422
|
+
toReturn.step = props.step;
|
|
1423
|
+
toReturn.max = props.max !== void 0 ? String(props.max) : void 0;
|
|
1424
|
+
toReturn.min = props.min !== void 0 ? String(props.min) : void 0;
|
|
1425
|
+
}
|
|
1426
|
+
if (type === INPUT_TYPES.TEXT || type === INPUT_TYPES.SEARCH || type === INPUT_TYPES.URL || type === INPUT_TYPES.TEL || type === INPUT_TYPES.EMAIL || type === INPUT_TYPES.PASSWORD || type === INPUT_TYPES.NUMBER) {
|
|
1427
|
+
toReturn.placeholder = inputTextPlaceholder.value;
|
|
1428
|
+
}
|
|
1429
|
+
if (type === INPUT_TYPES.TEXT || type === INPUT_TYPES.SEARCH || type === INPUT_TYPES.URL || type === INPUT_TYPES.TEL || type === INPUT_TYPES.EMAIL || type === INPUT_TYPES.PASSWORD) {
|
|
1430
|
+
toReturn.minlength = props.minlength;
|
|
1431
|
+
toReturn.maxlength = props.maxlength;
|
|
1432
|
+
toReturn.pattern = props.pattern;
|
|
1433
|
+
}
|
|
1434
|
+
if (type === INPUT_TYPES.EMAIL) {
|
|
1435
|
+
toReturn.multiple = props.multiple;
|
|
1436
|
+
}
|
|
1437
|
+
return toReturn;
|
|
1438
|
+
});
|
|
1439
|
+
const slotProps = computed(() => ({
|
|
1440
|
+
valid: props.valid,
|
|
1441
|
+
invalid: props.invalid,
|
|
1442
|
+
modelValue: props.modelValue,
|
|
1443
|
+
togglePassword: onTogglePassword,
|
|
1444
|
+
stepUp: onStepUp,
|
|
1445
|
+
stepDown: onStepDown,
|
|
1446
|
+
clear: onClear
|
|
1447
|
+
}));
|
|
1448
|
+
const { HintSlot, hasHint, hasInvalid } = HintSlotFactory(props, slots);
|
|
1449
|
+
const PasswordInputActions = VvInputTextActionsFactory(
|
|
1450
|
+
INPUT_TYPES.PASSWORD,
|
|
1451
|
+
props
|
|
987
1452
|
);
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1453
|
+
const NumberInputActions = VvInputTextActionsFactory(
|
|
1454
|
+
INPUT_TYPES.NUMBER,
|
|
1455
|
+
props
|
|
1456
|
+
);
|
|
1457
|
+
const SearchInputActions = VvInputTextActionsFactory(
|
|
1458
|
+
INPUT_TYPES.SEARCH,
|
|
1459
|
+
props
|
|
1460
|
+
);
|
|
1461
|
+
const mask = ref();
|
|
1462
|
+
watch(
|
|
1463
|
+
[
|
|
1464
|
+
() => props.mask,
|
|
1465
|
+
() => props.type,
|
|
1466
|
+
() => props.maskEager,
|
|
1467
|
+
() => props.maskReversed,
|
|
1468
|
+
() => props.maskTokens,
|
|
1469
|
+
() => props.maskTokensReplace
|
|
1470
|
+
],
|
|
1471
|
+
([newMask, newType, eager, reversed, tokens, tokensReplace]) => {
|
|
1472
|
+
if (newMask && newType === INPUT_TYPES.TEXT) {
|
|
1473
|
+
mask.value = new Mask({
|
|
1474
|
+
mask: newMask,
|
|
1475
|
+
eager,
|
|
1476
|
+
reversed,
|
|
1477
|
+
tokens,
|
|
1478
|
+
tokensReplace
|
|
1479
|
+
});
|
|
1480
|
+
return;
|
|
1481
|
+
}
|
|
1482
|
+
mask.value = void 0;
|
|
1483
|
+
},
|
|
1484
|
+
{ immediate: true }
|
|
1485
|
+
);
|
|
1486
|
+
const onClickInner = () => {
|
|
1487
|
+
if (isClickable.value) {
|
|
1488
|
+
focused.value = true;
|
|
1489
|
+
}
|
|
1490
|
+
};
|
|
1491
|
+
const hasStyle = computed(() => {
|
|
1492
|
+
if (!props.autoWidth) {
|
|
1493
|
+
return void 0;
|
|
1494
|
+
}
|
|
1495
|
+
return {
|
|
1496
|
+
width: localModelValue.value !== void 0 ? `${String(localModelValue.value).length + 1}ch` : void 0
|
|
1497
|
+
};
|
|
1498
|
+
});
|
|
1499
|
+
return (_ctx, _cache) => {
|
|
1500
|
+
return openBlock(), createElementBlock("div", {
|
|
1501
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
1502
|
+
}, [
|
|
1503
|
+
unref(label) ? (openBlock(), createElementBlock("label", {
|
|
1504
|
+
key: 0,
|
|
1505
|
+
for: unref(hasId),
|
|
1506
|
+
class: "vv-input-text__label"
|
|
1507
|
+
}, toDisplayString(unref(label)), 9, _hoisted_1)) : createCommentVNode("", true),
|
|
1508
|
+
createElementVNode("div", _hoisted_2, [
|
|
1509
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
1510
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1511
|
+
])) : createCommentVNode("", true),
|
|
1512
|
+
createElementVNode("div", {
|
|
1513
|
+
ref_key: "innerEl",
|
|
1514
|
+
ref: innerEl,
|
|
1515
|
+
class: "vv-input-text__inner",
|
|
1516
|
+
onClick: withModifiers(onClickInner, ["stop"])
|
|
1517
|
+
}, [
|
|
1518
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
1519
|
+
key: 0,
|
|
1520
|
+
class: "vv-input-text__icon"
|
|
1521
|
+
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
1522
|
+
withDirectives(createElementVNode("input", mergeProps({
|
|
1523
|
+
id: unref(hasId),
|
|
1524
|
+
ref_key: "inputEl",
|
|
1525
|
+
ref: inputEl,
|
|
1526
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(localModelValue) ? localModelValue.value = $event : null)
|
|
1527
|
+
}, unref(hasAttrs), {
|
|
1528
|
+
style: unref(hasStyle),
|
|
1529
|
+
onKeyup: _cache[1] || (_cache[1] = ($event) => emit("keyup", $event))
|
|
1530
|
+
}), null, 16, _hoisted_5), [
|
|
1531
|
+
[vModelDynamic, unref(localModelValue)]
|
|
1532
|
+
]),
|
|
1533
|
+
(_ctx.unit || _ctx.$slots.unit) && unref(isDirty) ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
1534
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
|
|
1535
|
+
createTextVNode(toDisplayString(_ctx.unit), 1)
|
|
1536
|
+
])
|
|
1537
|
+
])) : createCommentVNode("", true)
|
|
1538
|
+
], 8, _hoisted_4),
|
|
1539
|
+
unref(hasIconAfter) || unref(defaultAfterIcon) ? (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
1016
1540
|
key: 1,
|
|
1017
1541
|
class: "vv-input-text__icon vv-input-text__icon-after"
|
|
1018
|
-
},
|
|
1542
|
+
}, unref(hasIconAfter) ? unref(hasIcon) : unref(defaultAfterIcon)), null, 16)) : unref(isPassword) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(PasswordInputActions), {
|
|
1019
1543
|
key: 2,
|
|
1020
|
-
onTogglePassword
|
|
1021
|
-
})) :
|
|
1544
|
+
onTogglePassword
|
|
1545
|
+
})) : unref(isNumber) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(NumberInputActions), {
|
|
1022
1546
|
key: 3,
|
|
1023
|
-
onStepUp
|
|
1024
|
-
onStepDown
|
|
1025
|
-
})) :
|
|
1547
|
+
onStepUp,
|
|
1548
|
+
onStepDown
|
|
1549
|
+
})) : unref(isSearch) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(SearchInputActions), {
|
|
1026
1550
|
key: 4,
|
|
1027
|
-
onClear
|
|
1028
|
-
})) :
|
|
1551
|
+
onClear
|
|
1552
|
+
})) : createCommentVNode("", true),
|
|
1553
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
1554
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1555
|
+
])) : createCommentVNode("", true),
|
|
1556
|
+
unref(count) ? (openBlock(), createElementBlock("span", _hoisted_8, [
|
|
1557
|
+
renderSlot(_ctx.$slots, "count", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
|
|
1558
|
+
createTextVNode(toDisplayString(unref(countFormatted)), 1)
|
|
1559
|
+
])
|
|
1560
|
+
])) : createCommentVNode("", true)
|
|
1029
1561
|
]),
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
])
|
|
1037
|
-
])) : O("", !0)
|
|
1038
|
-
]),
|
|
1039
|
-
$e(s(Te), {
|
|
1040
|
-
id: s(E),
|
|
1041
|
-
class: "vv-input-text__hint"
|
|
1042
|
-
}, null, 8, ["id"])
|
|
1043
|
-
], 2));
|
|
1562
|
+
createVNode(unref(HintSlot), {
|
|
1563
|
+
id: unref(hasDescribedBy),
|
|
1564
|
+
class: "vv-input-text__hint"
|
|
1565
|
+
}, null, 8, ["id"])
|
|
1566
|
+
], 2);
|
|
1567
|
+
};
|
|
1044
1568
|
}
|
|
1045
1569
|
});
|
|
1046
1570
|
export {
|
|
1047
|
-
|
|
1571
|
+
_sfc_main as default
|
|
1048
1572
|
};
|