@volverjs/ui-vue 0.0.9-beta.2 → 0.0.9-beta.20
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 +3 -3
- package/auto-imports.d.ts +2 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +7 -0
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +7 -0
- package/dist/components/VvAction/VvAction.es.js +9 -1
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +9 -0
- package/dist/components/VvAction/index.d.ts +4 -0
- package/dist/components/VvAlert/VvAlert.es.js +14 -6
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
- package/dist/components/VvAlert/index.d.ts +3 -3
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +14 -6
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +3 -3
- package/dist/components/VvAlertGroup/index.d.ts +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +7 -0
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +7 -0
- package/dist/components/VvBadge/VvBadge.es.js +7 -0
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +7 -0
- package/dist/components/VvButton/VvButton.es.js +11 -2
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +9 -0
- package/dist/components/VvButton/index.d.ts +4 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +7 -0
- package/dist/components/VvCard/VvCard.es.js +7 -0
- package/dist/components/VvCheckbox/VvCheckbox.es.js +91 -14
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +97 -15
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/VvCombobox/VvCombobox.es.js +243 -179
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +323 -95
- package/dist/components/VvCombobox/index.d.ts +123 -35
- package/dist/components/VvDialog/VvDialog.es.js +42 -30
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +19 -6
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +291 -84
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +9 -0
- package/dist/components/VvDropdown/index.d.ts +96 -27
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +9 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +7 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +7 -0
- package/dist/components/VvInputText/VvInputText.es.js +271 -109
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +23 -41
- package/dist/components/VvInputText/index.d.ts +25 -35
- package/dist/components/VvNav/VvNav.es.js +10 -2
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/index.d.ts +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +7 -0
- package/dist/components/VvRadio/VvRadio.es.js +91 -14
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +97 -15
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +4 -4
- package/dist/components/VvSelect/VvSelect.es.js +87 -14
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +5 -5
- package/dist/components/VvTab/VvTab.es.js +10 -2
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +95 -19
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
- package/dist/components/VvTooltip/VvTooltip.es.js +7 -0
- package/dist/components/common/HintSlot.d.ts +4 -3
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.es.js +1199 -614
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +27 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +81 -0
- package/dist/composables/index.umd.js +1 -0
- package/dist/constants.d.ts +10 -0
- package/dist/directives/index.es.js +7 -0
- package/dist/directives/v-tooltip.es.js +7 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +103 -27
- package/dist/resolvers/unplugin.es.js +3 -0
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +2 -2
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +54 -269
- package/dist/stories/Alert/Alert.settings.d.ts +3 -7
- package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +2 -2
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +6 -0
- package/dist/stories/Button/Button.settings.d.ts +3 -13
- package/dist/stories/Combobox/Combobox.settings.d.ts +117 -19
- package/dist/stories/InputText/InputText.settings.d.ts +31 -9
- package/dist/stories/InputText/InputText.stories.d.ts +0 -1
- package/dist/stories/InputText/InputTextMask.stories.d.ts +12 -0
- package/dist/stories/Nav/Nav.settings.d.ts +3 -21
- package/package.json +75 -66
- 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/VvAction/VvAction.vue +2 -1
- package/src/components/VvAlert/VvAlert.vue +5 -1
- package/src/components/VvAlert/index.ts +3 -3
- package/src/components/VvAlertGroup/VvAlertGroup.vue +2 -0
- package/src/components/VvButton/VvButton.vue +1 -0
- package/src/components/VvCheckbox/VvCheckbox.vue +8 -1
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +8 -1
- package/src/components/VvCombobox/VvCombobox.vue +43 -23
- package/src/components/VvCombobox/index.ts +24 -0
- package/src/components/VvDialog/VvDialog.vue +22 -19
- package/src/components/VvDropdown/VvDropdown.vue +14 -9
- package/src/components/VvInputText/VvInputText.vue +177 -55
- package/src/components/VvInputText/index.ts +32 -34
- package/src/components/VvNav/VvNav.vue +1 -1
- package/src/components/VvNav/index.ts +1 -1
- package/src/components/VvRadio/VvRadio.vue +8 -1
- package/src/components/VvRadioGroup/VvRadioGroup.vue +8 -1
- package/src/components/VvSelect/VvSelect.vue +8 -1
- package/src/components/VvTextarea/VvTextarea.vue +16 -6
- package/src/components/common/HintSlot.ts +26 -13
- package/src/components/index.ts +5 -0
- package/src/composables/alert/useAlert.ts +103 -0
- package/src/composables/index.ts +1 -0
- package/src/constants.ts +21 -0
- package/src/props/index.ts +7 -0
- package/src/resolvers/unplugin.ts +3 -0
- package/src/stories/Alert/Alert.settings.ts +3 -1
- package/src/stories/AlertGroup/AlertGroup.test.ts +13 -0
- package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +3 -3
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +118 -0
- package/src/stories/Button/Button.settings.ts +5 -3
- package/src/stories/Combobox/Combobox.settings.ts +119 -2
- package/src/stories/Combobox/Combobox.test.ts +1 -1
- package/src/stories/InputText/InputText.settings.ts +36 -15
- package/src/stories/InputText/InputText.stories.ts +4 -12
- package/src/stories/InputText/InputText.test.ts +31 -15
- package/src/stories/InputText/InputTextMask.stories.ts +122 -0
- package/src/stories/Nav/Nav.settings.ts +3 -1
- package/src/stories/Tab/Tab.stories.ts +3 -3
- package/src/stories/Textarea/TextareaLength.stories.ts +1 -1
- package/src/types/alert.d.ts +20 -0
- /package/dist/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue.d.ts +0 -0
- /package/dist/components/{VvNavSeparator → VvNav}/VvNavSeparator.d.ts +0 -0
- /package/src/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue +0 -0
- /package/src/components/{VvNavSeparator → VvNav}/VvNavSeparator.ts +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { unref, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, watch, Fragment, renderList, createBlock, mergeProps, withCtx, resolveDynamicComponent, createCommentVNode, useSlots, h, onMounted, withDirectives, vModelCheckbox, createVNode, createSlots, nextTick, Transition, toHandlers, normalizeStyle, vShow, vModelSelect, vModelText,
|
|
1
|
+
import { unref, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, watch, Fragment, renderList, createBlock, mergeProps, withCtx, resolveDynamicComponent, createCommentVNode, useSlots, h, onMounted, withDirectives, vModelCheckbox, createVNode, createSlots, nextTick, Transition, toHandlers, normalizeStyle, vShow, vModelSelect, vModelText, vModelRadio } from "vue";
|
|
2
2
|
import { nanoid } from "nanoid";
|
|
3
|
-
import { useToggle, useStorage, useVModel, useMutationObserver, onClickOutside, useFocusWithin, onKeyStroke, useElementHover, useFocus, useElementVisibility, refDebounced } from "@vueuse/core";
|
|
3
|
+
import { useToggle, useStorage, useVModel, useMutationObserver, onClickOutside, useFocusWithin, onKeyStroke, useElementHover, useFocus, useElementVisibility, refDebounced, computedAsync } from "@vueuse/core";
|
|
4
4
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
5
5
|
import { get } from "ts-dot-prop";
|
|
6
6
|
import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
7
7
|
import mitt from "mitt";
|
|
8
|
-
import {
|
|
8
|
+
import { useIMask } from "vue-imask";
|
|
9
9
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
10
10
|
Side2["left"] = "left";
|
|
11
11
|
Side2["right"] = "right";
|
|
@@ -79,6 +79,9 @@ const INJECTION_KEY_DROPDOWN_ITEM = Symbol.for(
|
|
|
79
79
|
const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for(
|
|
80
80
|
"dropdownAction"
|
|
81
81
|
);
|
|
82
|
+
const INJECTION_KEY_ALERT_GROUP = Symbol.for(
|
|
83
|
+
"alertGroup"
|
|
84
|
+
);
|
|
82
85
|
const LinkProps = {
|
|
83
86
|
/**
|
|
84
87
|
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
@@ -484,6 +487,13 @@ const ActionProps = {
|
|
|
484
487
|
type: String,
|
|
485
488
|
default: ButtonType.button,
|
|
486
489
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
490
|
+
},
|
|
491
|
+
/**
|
|
492
|
+
* Button aria-label
|
|
493
|
+
*/
|
|
494
|
+
ariaLabel: {
|
|
495
|
+
type: String,
|
|
496
|
+
default: void 0
|
|
487
497
|
}
|
|
488
498
|
};
|
|
489
499
|
function equals(obj1, obj2, field) {
|
|
@@ -723,14 +733,14 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
723
733
|
return toReturn;
|
|
724
734
|
});
|
|
725
735
|
}
|
|
726
|
-
const _hoisted_1$
|
|
727
|
-
const _hoisted_2$
|
|
728
|
-
const _hoisted_3$
|
|
729
|
-
const __default__$
|
|
736
|
+
const _hoisted_1$i = ["id", "open"];
|
|
737
|
+
const _hoisted_2$d = ["aria-controls", "aria-expanded"];
|
|
738
|
+
const _hoisted_3$7 = ["aria-hidden"];
|
|
739
|
+
const __default__$n = {
|
|
730
740
|
name: "VvAccordion"
|
|
731
741
|
};
|
|
732
|
-
const _sfc_main$
|
|
733
|
-
...__default__$
|
|
742
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
743
|
+
...__default__$n,
|
|
734
744
|
props: VvAccordionProps,
|
|
735
745
|
emits: VvAccordionEvents,
|
|
736
746
|
setup(__props, { emit }) {
|
|
@@ -812,7 +822,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
812
822
|
renderSlot(_ctx.$slots, "summary", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
|
|
813
823
|
createTextVNode(toDisplayString(unref(title)), 1)
|
|
814
824
|
])
|
|
815
|
-
], 8, _hoisted_2$
|
|
825
|
+
], 8, _hoisted_2$d),
|
|
816
826
|
createElementVNode("div", {
|
|
817
827
|
"aria-hidden": !unref(isOpen),
|
|
818
828
|
class: "vv-accordion__content"
|
|
@@ -820,8 +830,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
820
830
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
|
|
821
831
|
createTextVNode(toDisplayString(unref(content)), 1)
|
|
822
832
|
])
|
|
823
|
-
], 8, _hoisted_3$
|
|
824
|
-
], 10, _hoisted_1$
|
|
833
|
+
], 8, _hoisted_3$7)
|
|
834
|
+
], 10, _hoisted_1$i);
|
|
825
835
|
};
|
|
826
836
|
}
|
|
827
837
|
});
|
|
@@ -874,11 +884,11 @@ function useProvideGroupState(groupState) {
|
|
|
874
884
|
computed(() => groupState)
|
|
875
885
|
);
|
|
876
886
|
}
|
|
877
|
-
const __default__$
|
|
887
|
+
const __default__$m = {
|
|
878
888
|
name: "VvAccordionGroup"
|
|
879
889
|
};
|
|
880
|
-
const _sfc_main$
|
|
881
|
-
...__default__$
|
|
890
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
891
|
+
...__default__$m,
|
|
882
892
|
props: VvAccordionGroupProps,
|
|
883
893
|
emits: VvAccordionGroupEvents,
|
|
884
894
|
setup(__props, { emit }) {
|
|
@@ -945,7 +955,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
945
955
|
}, [
|
|
946
956
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
947
957
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item) => {
|
|
948
|
-
return openBlock(), createBlock(_sfc_main$
|
|
958
|
+
return openBlock(), createBlock(_sfc_main$q, mergeProps({
|
|
949
959
|
key: item.title
|
|
950
960
|
}, {
|
|
951
961
|
name: item.name,
|
|
@@ -966,88 +976,128 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
966
976
|
};
|
|
967
977
|
}
|
|
968
978
|
});
|
|
969
|
-
const
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
979
|
+
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
980
|
+
const VvActionProps = ActionProps;
|
|
981
|
+
function useVolver() {
|
|
982
|
+
return inject(INJECTION_KEY_VOLVER);
|
|
983
|
+
}
|
|
984
|
+
function useInjectedDropdownTrigger() {
|
|
985
|
+
return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
|
|
986
|
+
}
|
|
987
|
+
function useInjectedDropdownItem() {
|
|
988
|
+
return inject(INJECTION_KEY_DROPDOWN_ITEM, {});
|
|
989
|
+
}
|
|
990
|
+
function useInjectedDropdownAction() {
|
|
991
|
+
return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
|
|
992
|
+
}
|
|
993
|
+
const __default__$l = {
|
|
994
|
+
name: "VvAction"
|
|
975
995
|
};
|
|
976
|
-
const _sfc_main$
|
|
977
|
-
...__default__$
|
|
978
|
-
props:
|
|
979
|
-
|
|
996
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
997
|
+
...__default__$l,
|
|
998
|
+
props: VvActionProps,
|
|
999
|
+
emits: VvActionEvents,
|
|
1000
|
+
setup(__props, { expose: __expose, emit }) {
|
|
980
1001
|
const props = __props;
|
|
981
|
-
const
|
|
982
|
-
const
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1002
|
+
const volver = useVolver();
|
|
1003
|
+
const element = ref(null);
|
|
1004
|
+
__expose({ $el: element });
|
|
1005
|
+
const {
|
|
1006
|
+
reference: dropdownTriggerReference,
|
|
1007
|
+
bus: dropdownEventBus,
|
|
1008
|
+
aria: dropdownAria,
|
|
1009
|
+
expanded: dropdownExpanded
|
|
1010
|
+
} = useInjectedDropdownTrigger();
|
|
1011
|
+
watch(
|
|
1012
|
+
() => element.value,
|
|
1013
|
+
(newValue) => {
|
|
1014
|
+
if (dropdownTriggerReference) {
|
|
1015
|
+
dropdownTriggerReference.value = newValue;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
);
|
|
1019
|
+
const pressed = computed(() => {
|
|
1020
|
+
return props.pressed || (dropdownExpanded == null ? void 0 : dropdownExpanded.value);
|
|
1021
|
+
});
|
|
1022
|
+
const { role } = useInjectedDropdownAction();
|
|
1023
|
+
const hasTag = computed(() => {
|
|
1024
|
+
switch (true) {
|
|
1025
|
+
case props.disabled:
|
|
1026
|
+
return ActionTag.button;
|
|
1027
|
+
case props.to !== void 0:
|
|
1028
|
+
return (volver == null ? void 0 : volver.nuxt) ? ActionTag.nuxtLink : ActionTag.routerLink;
|
|
1029
|
+
case props.href !== void 0:
|
|
1030
|
+
return ActionTag.a;
|
|
1031
|
+
default:
|
|
1032
|
+
return ActionTag.button;
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
const hasProps = computed(() => {
|
|
1036
|
+
const toReturn = {
|
|
1037
|
+
...dropdownAria == null ? void 0 : dropdownAria.value,
|
|
1038
|
+
ariaPressed: pressed.value ? true : void 0,
|
|
1039
|
+
ariaLabel: props.ariaLabel,
|
|
1040
|
+
role: role == null ? void 0 : role.value
|
|
1041
|
+
};
|
|
1042
|
+
switch (hasTag.value) {
|
|
1043
|
+
case ActionTag.a:
|
|
1044
|
+
return {
|
|
1045
|
+
...toReturn,
|
|
1046
|
+
href: props.href,
|
|
1047
|
+
target: props.target,
|
|
1048
|
+
rel: props.rel
|
|
1049
|
+
};
|
|
1050
|
+
case ActionTag.routerLink:
|
|
1051
|
+
case ActionTag.nuxtLink:
|
|
1052
|
+
return {
|
|
1053
|
+
...toReturn,
|
|
1054
|
+
to: props.to,
|
|
1055
|
+
target: props.target
|
|
1056
|
+
};
|
|
1057
|
+
default:
|
|
1058
|
+
return {
|
|
1059
|
+
...toReturn,
|
|
1060
|
+
type: props.type,
|
|
1061
|
+
disabled: props.disabled
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
const onClick = (e) => {
|
|
1066
|
+
if (props.disabled) {
|
|
1067
|
+
e.preventDefault();
|
|
1068
|
+
return;
|
|
1069
|
+
}
|
|
1070
|
+
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
|
|
1071
|
+
emit("click", e);
|
|
1072
|
+
};
|
|
1073
|
+
const onMouseover = (e) => {
|
|
1074
|
+
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
|
|
1075
|
+
emit("mouseover", e);
|
|
1076
|
+
};
|
|
1077
|
+
const onMouseleave = (e) => {
|
|
1078
|
+
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
|
|
1079
|
+
emit("mouseleave", e);
|
|
992
1080
|
};
|
|
993
|
-
}
|
|
994
|
-
});
|
|
995
|
-
const VvBreadcrumbProps = {
|
|
996
|
-
...ModifiersProps,
|
|
997
|
-
routes: Array
|
|
998
|
-
};
|
|
999
|
-
const _hoisted_1$e = { class: "vv-breadcrumb__list" };
|
|
1000
|
-
const _hoisted_2$b = ["content"];
|
|
1001
|
-
const __default__$j = {
|
|
1002
|
-
name: "VvBreadcrumb"
|
|
1003
|
-
};
|
|
1004
|
-
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
1005
|
-
...__default__$j,
|
|
1006
|
-
props: VvBreadcrumbProps,
|
|
1007
|
-
setup(__props) {
|
|
1008
|
-
const props = __props;
|
|
1009
|
-
const { modifiers } = toRefs(props);
|
|
1010
|
-
const bemCssClasses = useModifiers("vv-breadcrumb", modifiers);
|
|
1011
1081
|
return (_ctx, _cache) => {
|
|
1012
|
-
return openBlock(),
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
(
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
"vv-breadcrumb__link": index < Number((_c = _ctx.routes) == null ? void 0 : _c.length) - 1
|
|
1032
|
-
},
|
|
1033
|
-
"aria-current": index === Number((_d = _ctx.routes) == null ? void 0 : _d.length) - 1 ? "page" : void 0,
|
|
1034
|
-
itemprop: "item"
|
|
1035
|
-
}), {
|
|
1036
|
-
default: withCtx(() => [
|
|
1037
|
-
renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps({ route, index })), () => [
|
|
1038
|
-
createTextVNode(toDisplayString(route.label), 1)
|
|
1039
|
-
])
|
|
1040
|
-
]),
|
|
1041
|
-
_: 2
|
|
1042
|
-
}, 1040, ["class", "aria-current"])),
|
|
1043
|
-
createElementVNode("meta", {
|
|
1044
|
-
itemprop: "position",
|
|
1045
|
-
content: `${index + 1}`
|
|
1046
|
-
}, null, 8, _hoisted_2$b)
|
|
1047
|
-
], 2);
|
|
1048
|
-
}), 128))
|
|
1049
|
-
])
|
|
1050
|
-
], 2);
|
|
1082
|
+
return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
|
|
1083
|
+
ref_key: "element",
|
|
1084
|
+
ref: element,
|
|
1085
|
+
class: {
|
|
1086
|
+
active: _ctx.active,
|
|
1087
|
+
pressed: unref(pressed),
|
|
1088
|
+
disabled: _ctx.disabled
|
|
1089
|
+
},
|
|
1090
|
+
onClickPassive: onClick,
|
|
1091
|
+
onMouseoverPassive: onMouseover,
|
|
1092
|
+
onMouseleavePassive: onMouseleave
|
|
1093
|
+
}), {
|
|
1094
|
+
default: withCtx(() => [
|
|
1095
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1096
|
+
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
1097
|
+
])
|
|
1098
|
+
]),
|
|
1099
|
+
_: 3
|
|
1100
|
+
}, 16, ["class"]);
|
|
1051
1101
|
};
|
|
1052
1102
|
}
|
|
1053
1103
|
});
|
|
@@ -1145,14 +1195,11 @@ const VvIconProps = {
|
|
|
1145
1195
|
type: [String, Array]
|
|
1146
1196
|
}
|
|
1147
1197
|
};
|
|
1148
|
-
|
|
1149
|
-
return inject(INJECTION_KEY_VOLVER);
|
|
1150
|
-
}
|
|
1151
|
-
const __default__$i = {
|
|
1198
|
+
const __default__$k = {
|
|
1152
1199
|
name: "VvIcon"
|
|
1153
1200
|
};
|
|
1154
|
-
const _sfc_main$
|
|
1155
|
-
...__default__$
|
|
1201
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
1202
|
+
...__default__$k,
|
|
1156
1203
|
props: VvIconProps,
|
|
1157
1204
|
setup(__props) {
|
|
1158
1205
|
const props = __props;
|
|
@@ -1244,124 +1291,307 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1244
1291
|
};
|
|
1245
1292
|
}
|
|
1246
1293
|
});
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
function useInjectedDropdownTrigger() {
|
|
1250
|
-
return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
|
|
1251
|
-
}
|
|
1252
|
-
function useInjectedDropdownItem() {
|
|
1253
|
-
return inject(INJECTION_KEY_DROPDOWN_ITEM, {});
|
|
1254
|
-
}
|
|
1255
|
-
function useInjectedDropdownAction() {
|
|
1256
|
-
return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
|
|
1294
|
+
function useInjectedAlertGroup() {
|
|
1295
|
+
return inject(INJECTION_KEY_ALERT_GROUP, {});
|
|
1257
1296
|
}
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1297
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
|
|
1298
|
+
const VvAlertProps = {
|
|
1299
|
+
...IdProps,
|
|
1300
|
+
...ModifiersProps,
|
|
1301
|
+
...IconProps,
|
|
1302
|
+
/**
|
|
1303
|
+
* The alert is dismissable
|
|
1304
|
+
* @default false
|
|
1305
|
+
* @type boolean
|
|
1306
|
+
*/
|
|
1307
|
+
dismissable: {
|
|
1308
|
+
type: Boolean,
|
|
1309
|
+
default: false
|
|
1310
|
+
},
|
|
1311
|
+
/**
|
|
1312
|
+
* The alert auto close after the specified time in milliseconds
|
|
1313
|
+
* @default 0
|
|
1314
|
+
* @type number
|
|
1315
|
+
*/
|
|
1316
|
+
autoClose: {
|
|
1317
|
+
type: Number,
|
|
1318
|
+
default: 0
|
|
1319
|
+
},
|
|
1320
|
+
/**
|
|
1321
|
+
* The alert close label
|
|
1322
|
+
* @default 'Close'
|
|
1323
|
+
* @type string
|
|
1324
|
+
*/
|
|
1325
|
+
closeLabel: {
|
|
1326
|
+
type: String,
|
|
1327
|
+
default: "Close"
|
|
1328
|
+
},
|
|
1329
|
+
/**
|
|
1330
|
+
* The alert title
|
|
1331
|
+
* @default ''
|
|
1332
|
+
* @type string
|
|
1333
|
+
*/
|
|
1334
|
+
title: {
|
|
1335
|
+
type: String,
|
|
1336
|
+
default: void 0
|
|
1337
|
+
},
|
|
1338
|
+
/**
|
|
1339
|
+
* The alert content
|
|
1340
|
+
* @default ''
|
|
1341
|
+
* @type string
|
|
1342
|
+
*/
|
|
1343
|
+
content: {
|
|
1344
|
+
type: String,
|
|
1345
|
+
default: void 0
|
|
1346
|
+
},
|
|
1347
|
+
/**
|
|
1348
|
+
* The alert footer
|
|
1349
|
+
* @default ''
|
|
1350
|
+
* @type string
|
|
1351
|
+
*/
|
|
1352
|
+
footer: {
|
|
1353
|
+
type: String,
|
|
1354
|
+
default: void 0
|
|
1355
|
+
},
|
|
1356
|
+
/**
|
|
1357
|
+
* The alert role
|
|
1358
|
+
* @default 'alert'
|
|
1359
|
+
* @type string
|
|
1360
|
+
* @values 'alert', 'alertdialog'
|
|
1361
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Alert_Role
|
|
1362
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Alertdialog_role
|
|
1363
|
+
*/
|
|
1364
|
+
role: {
|
|
1365
|
+
type: String,
|
|
1366
|
+
default: "alert"
|
|
1367
|
+
}
|
|
1260
1368
|
};
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
case props.href !== void 0:
|
|
1295
|
-
return ActionTag.a;
|
|
1296
|
-
default:
|
|
1297
|
-
return ActionTag.button;
|
|
1298
|
-
}
|
|
1299
|
-
});
|
|
1300
|
-
const hasProps = computed(() => {
|
|
1301
|
-
const toReturn = {
|
|
1302
|
-
...dropdownAria == null ? void 0 : dropdownAria.value,
|
|
1303
|
-
"aria-pressed": pressed.value ? true : void 0,
|
|
1304
|
-
role: role == null ? void 0 : role.value
|
|
1305
|
-
};
|
|
1306
|
-
switch (hasTag.value) {
|
|
1307
|
-
case ActionTag.a:
|
|
1308
|
-
return {
|
|
1309
|
-
...toReturn,
|
|
1310
|
-
href: props.href,
|
|
1311
|
-
target: props.target,
|
|
1312
|
-
rel: props.rel
|
|
1313
|
-
};
|
|
1314
|
-
case ActionTag.routerLink:
|
|
1315
|
-
case ActionTag.nuxtLink:
|
|
1316
|
-
return {
|
|
1317
|
-
...toReturn,
|
|
1318
|
-
to: props.to,
|
|
1319
|
-
target: props.target
|
|
1320
|
-
};
|
|
1321
|
-
default:
|
|
1322
|
-
return {
|
|
1323
|
-
...toReturn,
|
|
1324
|
-
type: props.type,
|
|
1325
|
-
disabled: props.disabled
|
|
1326
|
-
};
|
|
1327
|
-
}
|
|
1328
|
-
});
|
|
1329
|
-
const onClick = (e) => {
|
|
1330
|
-
if (props.disabled) {
|
|
1331
|
-
e.preventDefault();
|
|
1369
|
+
const VvAlertEvents = ["close"];
|
|
1370
|
+
const useVvAlert = (props, emit) => {
|
|
1371
|
+
const { bus } = useInjectedAlertGroup();
|
|
1372
|
+
const hasId = useUniqueId(computed(() => props.id));
|
|
1373
|
+
const hasTitleId = computed(() => `${hasId.value}-title`);
|
|
1374
|
+
const hasIcon = computed(
|
|
1375
|
+
() => typeof props.icon === "string" ? { name: props.icon } : props.icon
|
|
1376
|
+
);
|
|
1377
|
+
const hasClass = useModifiers(
|
|
1378
|
+
"vv-alert",
|
|
1379
|
+
computed(() => props.modifiers),
|
|
1380
|
+
computed(() => ({
|
|
1381
|
+
dismissable: props.autoClose > 0 || props.dismissable,
|
|
1382
|
+
"auto-close": props.autoClose > 0,
|
|
1383
|
+
hover: isMouseover.value
|
|
1384
|
+
}))
|
|
1385
|
+
);
|
|
1386
|
+
const hasStyle = computed(() => ({
|
|
1387
|
+
"--alert-duration": `${props.autoClose}ms`
|
|
1388
|
+
}));
|
|
1389
|
+
const close = () => {
|
|
1390
|
+
if (timeout) {
|
|
1391
|
+
clearTimeout(timeout);
|
|
1392
|
+
}
|
|
1393
|
+
emit("close", hasId.value);
|
|
1394
|
+
bus == null ? void 0 : bus.emit("close", hasId.value);
|
|
1395
|
+
};
|
|
1396
|
+
let timeout;
|
|
1397
|
+
watch(
|
|
1398
|
+
() => props.autoClose,
|
|
1399
|
+
(value) => {
|
|
1400
|
+
if (value > 0) {
|
|
1401
|
+
timeout = setTimeout(close, value);
|
|
1332
1402
|
return;
|
|
1333
1403
|
}
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1404
|
+
if (timeout) {
|
|
1405
|
+
clearTimeout(timeout);
|
|
1406
|
+
}
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
immediate: true
|
|
1410
|
+
}
|
|
1411
|
+
);
|
|
1412
|
+
const isMouseover = ref(false);
|
|
1413
|
+
const onMouseover = withModifiers(() => {
|
|
1414
|
+
isMouseover.value = true;
|
|
1415
|
+
if (timeout) {
|
|
1416
|
+
clearTimeout(timeout);
|
|
1417
|
+
}
|
|
1418
|
+
}, ["passive"]);
|
|
1419
|
+
const onMouseleave = withModifiers(() => {
|
|
1420
|
+
isMouseover.value = false;
|
|
1421
|
+
if (props.autoClose > 0) {
|
|
1422
|
+
timeout = setTimeout(close, props.autoClose);
|
|
1423
|
+
}
|
|
1424
|
+
}, ["passive"]);
|
|
1425
|
+
return {
|
|
1426
|
+
close,
|
|
1427
|
+
hasIcon,
|
|
1428
|
+
hasTitleId,
|
|
1429
|
+
hasProps: computed(() => ({
|
|
1430
|
+
onMouseover,
|
|
1431
|
+
onMouseleave,
|
|
1432
|
+
class: hasClass.value,
|
|
1433
|
+
style: hasStyle.value,
|
|
1434
|
+
role: props.role,
|
|
1435
|
+
"aria-labelledby": hasTitleId.value
|
|
1436
|
+
}))
|
|
1437
|
+
};
|
|
1438
|
+
};
|
|
1439
|
+
const _hoisted_1$h = {
|
|
1440
|
+
key: 0,
|
|
1441
|
+
class: "vv-alert__header"
|
|
1442
|
+
};
|
|
1443
|
+
const _hoisted_2$c = ["id"];
|
|
1444
|
+
const _hoisted_3$6 = ["aria-label"];
|
|
1445
|
+
const _hoisted_4$5 = /* @__PURE__ */ createElementVNode("div", { class: "vv-alert__close-mask" }, null, -1);
|
|
1446
|
+
const _hoisted_5$4 = [
|
|
1447
|
+
_hoisted_4$5
|
|
1448
|
+
];
|
|
1449
|
+
const _hoisted_6$4 = {
|
|
1450
|
+
key: 1,
|
|
1451
|
+
class: "vv-alert__content"
|
|
1452
|
+
};
|
|
1453
|
+
const _hoisted_7$4 = {
|
|
1454
|
+
key: 2,
|
|
1455
|
+
class: "vv-alert__footer"
|
|
1456
|
+
};
|
|
1457
|
+
const __default__$j = {
|
|
1458
|
+
name: "VvAlert"
|
|
1459
|
+
};
|
|
1460
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
1461
|
+
...__default__$j,
|
|
1462
|
+
props: VvAlertProps,
|
|
1463
|
+
emits: VvAlertEvents,
|
|
1464
|
+
setup(__props, { expose: __expose, emit }) {
|
|
1465
|
+
const props = __props;
|
|
1466
|
+
const { hasProps, hasTitleId, hasIcon, close } = useVvAlert(props, emit);
|
|
1467
|
+
__expose({ close });
|
|
1345
1468
|
return (_ctx, _cache) => {
|
|
1346
|
-
return openBlock(),
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1469
|
+
return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(hasProps))), [
|
|
1470
|
+
_ctx.$slots.header || _ctx.$slots.title || _ctx.$slots.close || _ctx.$slots["title::before"] || _ctx.$slots["title::after"] || _ctx.title || _ctx.dismissable || _ctx.autoClose ? (openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
1471
|
+
unref(hasIcon) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-alert__icon" }), null, 16)) : createCommentVNode("", true),
|
|
1472
|
+
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
1473
|
+
renderSlot(_ctx.$slots, "title::before"),
|
|
1474
|
+
_ctx.$slots.title || _ctx.title ? (openBlock(), createElementBlock("strong", {
|
|
1475
|
+
key: 0,
|
|
1476
|
+
id: unref(hasTitleId),
|
|
1477
|
+
class: "vv-alert__title"
|
|
1478
|
+
}, [
|
|
1479
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
1480
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
1481
|
+
])
|
|
1482
|
+
], 8, _hoisted_2$c)) : createCommentVNode("", true),
|
|
1483
|
+
renderSlot(_ctx.$slots, "title::after")
|
|
1484
|
+
]),
|
|
1485
|
+
renderSlot(_ctx.$slots, "close", normalizeProps(guardReactiveProps({ close: unref(close) })), () => [
|
|
1486
|
+
_ctx.dismissable || _ctx.autoClose ? (openBlock(), createElementBlock("button", {
|
|
1487
|
+
key: 0,
|
|
1488
|
+
class: "vv-alert__close",
|
|
1489
|
+
type: "button",
|
|
1490
|
+
"aria-label": _ctx.closeLabel,
|
|
1491
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(
|
|
1492
|
+
//@ts-ignore
|
|
1493
|
+
(...args) => unref(close) && unref(close)(...args),
|
|
1494
|
+
["stop"]
|
|
1495
|
+
))
|
|
1496
|
+
}, _hoisted_5$4, 8, _hoisted_3$6)) : createCommentVNode("", true)
|
|
1497
|
+
])
|
|
1498
|
+
])) : createCommentVNode("", true),
|
|
1499
|
+
_ctx.$slots.default || _ctx.content ? (openBlock(), createElementBlock("div", _hoisted_6$4, [
|
|
1359
1500
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1360
|
-
createTextVNode(toDisplayString(_ctx.
|
|
1501
|
+
createTextVNode(toDisplayString(_ctx.content), 1)
|
|
1361
1502
|
])
|
|
1362
|
-
]),
|
|
1363
|
-
|
|
1364
|
-
|
|
1503
|
+
])) : createCommentVNode("", true),
|
|
1504
|
+
_ctx.$slots.footer || _ctx.footer ? (openBlock(), createElementBlock("div", _hoisted_7$4, [
|
|
1505
|
+
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
1506
|
+
createTextVNode(toDisplayString(_ctx.footer), 1)
|
|
1507
|
+
])
|
|
1508
|
+
])) : createCommentVNode("", true)
|
|
1509
|
+
], 16);
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
});
|
|
1513
|
+
const VvBadgeProps = {
|
|
1514
|
+
...ModifiersProps,
|
|
1515
|
+
value: [String, Number]
|
|
1516
|
+
};
|
|
1517
|
+
const __default__$i = {
|
|
1518
|
+
name: "VvBadge"
|
|
1519
|
+
};
|
|
1520
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
1521
|
+
...__default__$i,
|
|
1522
|
+
props: VvBadgeProps,
|
|
1523
|
+
setup(__props) {
|
|
1524
|
+
const props = __props;
|
|
1525
|
+
const { modifiers } = toRefs(props);
|
|
1526
|
+
const bemCssClasses = useModifiers("vv-badge", modifiers);
|
|
1527
|
+
return (_ctx, _cache) => {
|
|
1528
|
+
return openBlock(), createElementBlock("span", {
|
|
1529
|
+
class: normalizeClass(unref(bemCssClasses)),
|
|
1530
|
+
role: "status"
|
|
1531
|
+
}, [
|
|
1532
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1533
|
+
createTextVNode(toDisplayString(_ctx.value), 1)
|
|
1534
|
+
])
|
|
1535
|
+
], 2);
|
|
1536
|
+
};
|
|
1537
|
+
}
|
|
1538
|
+
});
|
|
1539
|
+
const VvBreadcrumbProps = {
|
|
1540
|
+
...ModifiersProps,
|
|
1541
|
+
routes: Array
|
|
1542
|
+
};
|
|
1543
|
+
const _hoisted_1$g = { class: "vv-breadcrumb__list" };
|
|
1544
|
+
const _hoisted_2$b = ["content"];
|
|
1545
|
+
const __default__$h = {
|
|
1546
|
+
name: "VvBreadcrumb"
|
|
1547
|
+
};
|
|
1548
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
1549
|
+
...__default__$h,
|
|
1550
|
+
props: VvBreadcrumbProps,
|
|
1551
|
+
setup(__props) {
|
|
1552
|
+
const props = __props;
|
|
1553
|
+
const { modifiers } = toRefs(props);
|
|
1554
|
+
const bemCssClasses = useModifiers("vv-breadcrumb", modifiers);
|
|
1555
|
+
return (_ctx, _cache) => {
|
|
1556
|
+
return openBlock(), createElementBlock("nav", {
|
|
1557
|
+
class: normalizeClass(unref(bemCssClasses)),
|
|
1558
|
+
"aria-label": "breadcrumbs"
|
|
1559
|
+
}, [
|
|
1560
|
+
createElementVNode("ol", _hoisted_1$g, [
|
|
1561
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.routes, (route, index) => {
|
|
1562
|
+
var _a, _b, _c, _d;
|
|
1563
|
+
return openBlock(), createElementBlock("li", {
|
|
1564
|
+
key: `${route.label}-${index}`,
|
|
1565
|
+
class: normalizeClass({
|
|
1566
|
+
"vv-breadcrumb__item": index < Number((_a = _ctx.routes) == null ? void 0 : _a.length) - 1,
|
|
1567
|
+
"vv-breadcrumb__item-active": index === Number((_b = _ctx.routes) == null ? void 0 : _b.length) - 1
|
|
1568
|
+
}),
|
|
1569
|
+
itemprop: "itemListElement",
|
|
1570
|
+
itemtype: "https://schema.org/ListItem",
|
|
1571
|
+
itemscope: ""
|
|
1572
|
+
}, [
|
|
1573
|
+
(openBlock(), createBlock(resolveDynamicComponent(route.to ? "router-link" : route.href ? "a" : "span"), mergeProps(route, {
|
|
1574
|
+
class: {
|
|
1575
|
+
"vv-breadcrumb__link": index < Number((_c = _ctx.routes) == null ? void 0 : _c.length) - 1
|
|
1576
|
+
},
|
|
1577
|
+
"aria-current": index === Number((_d = _ctx.routes) == null ? void 0 : _d.length) - 1 ? "page" : void 0,
|
|
1578
|
+
itemprop: "item"
|
|
1579
|
+
}), {
|
|
1580
|
+
default: withCtx(() => [
|
|
1581
|
+
renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps({ route, index })), () => [
|
|
1582
|
+
createTextVNode(toDisplayString(route.label), 1)
|
|
1583
|
+
])
|
|
1584
|
+
]),
|
|
1585
|
+
_: 2
|
|
1586
|
+
}, 1040, ["class", "aria-current"])),
|
|
1587
|
+
createElementVNode("meta", {
|
|
1588
|
+
itemprop: "position",
|
|
1589
|
+
content: `${index + 1}`
|
|
1590
|
+
}, null, 8, _hoisted_2$b)
|
|
1591
|
+
], 2);
|
|
1592
|
+
}), 128))
|
|
1593
|
+
])
|
|
1594
|
+
], 2);
|
|
1365
1595
|
};
|
|
1366
1596
|
}
|
|
1367
1597
|
});
|
|
@@ -1469,8 +1699,7 @@ function useGroupProps$2(props, emit) {
|
|
|
1469
1699
|
label
|
|
1470
1700
|
};
|
|
1471
1701
|
}
|
|
1472
|
-
const
|
|
1473
|
-
const _hoisted_1$d = {
|
|
1702
|
+
const _hoisted_1$f = {
|
|
1474
1703
|
key: 1,
|
|
1475
1704
|
class: "vv-button__label"
|
|
1476
1705
|
};
|
|
@@ -1481,7 +1710,7 @@ const _hoisted_2$a = {
|
|
|
1481
1710
|
const __default__$g = {
|
|
1482
1711
|
name: "VvButton"
|
|
1483
1712
|
};
|
|
1484
|
-
const _sfc_main$
|
|
1713
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
1485
1714
|
...__default__$g,
|
|
1486
1715
|
props: VvButtonProps,
|
|
1487
1716
|
emits: VvButtonEvents,
|
|
@@ -1560,7 +1789,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
1560
1789
|
}
|
|
1561
1790
|
};
|
|
1562
1791
|
return (_ctx, _cache) => {
|
|
1563
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1792
|
+
return openBlock(), createBlock(_sfc_main$o, mergeProps({
|
|
1564
1793
|
disabled: unref(disabled),
|
|
1565
1794
|
pressed: unref(pressed),
|
|
1566
1795
|
active: _ctx.active,
|
|
@@ -1568,7 +1797,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
1568
1797
|
to: _ctx.to,
|
|
1569
1798
|
href: _ctx.href,
|
|
1570
1799
|
target: _ctx.target,
|
|
1571
|
-
rel: _ctx.rel
|
|
1800
|
+
rel: _ctx.rel,
|
|
1801
|
+
ariaLabel: _ctx.ariaLabel
|
|
1572
1802
|
}, {
|
|
1573
1803
|
id: unref(hasId),
|
|
1574
1804
|
ref_key: "element",
|
|
@@ -1579,15 +1809,15 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
1579
1809
|
default: withCtx(() => [
|
|
1580
1810
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1581
1811
|
_ctx.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
|
|
1582
|
-
_ctx.loadingIcon ? (openBlock(), createBlock(_sfc_main$
|
|
1812
|
+
_ctx.loadingIcon ? (openBlock(), createBlock(_sfc_main$n, {
|
|
1583
1813
|
key: 0,
|
|
1584
1814
|
class: "vv-button__loading-icon",
|
|
1585
1815
|
name: _ctx.loadingIcon
|
|
1586
1816
|
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
1587
|
-
_ctx.loadingLabel ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
1817
|
+
_ctx.loadingLabel ? (openBlock(), createElementBlock("span", _hoisted_1$f, toDisplayString(_ctx.loadingLabel), 1)) : createCommentVNode("", true)
|
|
1588
1818
|
]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1589
1819
|
renderSlot(_ctx.$slots, "before"),
|
|
1590
|
-
unref(icon) ? (openBlock(), createBlock(_sfc_main$
|
|
1820
|
+
unref(icon) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
1591
1821
|
key: 0,
|
|
1592
1822
|
class: "vv-button__icon"
|
|
1593
1823
|
}, unref(hasIconProps)), null, 16)) : createCommentVNode("", true),
|
|
@@ -1627,7 +1857,7 @@ const VvButtonGroupEvents = ["update:modelValue"];
|
|
|
1627
1857
|
const __default__$f = {
|
|
1628
1858
|
name: "VvButtonGroup"
|
|
1629
1859
|
};
|
|
1630
|
-
const _sfc_main$
|
|
1860
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
1631
1861
|
...__default__$f,
|
|
1632
1862
|
props: VvButtonGroupProps,
|
|
1633
1863
|
emits: VvButtonGroupEvents,
|
|
@@ -1686,7 +1916,7 @@ const VvCardProps = {
|
|
|
1686
1916
|
...ModifiersProps,
|
|
1687
1917
|
title: String
|
|
1688
1918
|
};
|
|
1689
|
-
const _hoisted_1$
|
|
1919
|
+
const _hoisted_1$e = {
|
|
1690
1920
|
key: 0,
|
|
1691
1921
|
class: "vv-card__header"
|
|
1692
1922
|
};
|
|
@@ -1701,7 +1931,7 @@ const _hoisted_3$5 = {
|
|
|
1701
1931
|
const __default__$e = {
|
|
1702
1932
|
name: "VvCard"
|
|
1703
1933
|
};
|
|
1704
|
-
const _sfc_main$
|
|
1934
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
1705
1935
|
...__default__$e,
|
|
1706
1936
|
props: VvCardProps,
|
|
1707
1937
|
setup(__props) {
|
|
@@ -1712,7 +1942,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
1712
1942
|
return openBlock(), createElementBlock("article", {
|
|
1713
1943
|
class: normalizeClass(unref(bemCssClasses))
|
|
1714
1944
|
}, [
|
|
1715
|
-
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_1$
|
|
1945
|
+
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_1$e, [
|
|
1716
1946
|
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
1717
1947
|
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
1718
1948
|
])
|
|
@@ -1784,19 +2014,27 @@ function joinLines(items) {
|
|
|
1784
2014
|
}
|
|
1785
2015
|
return items;
|
|
1786
2016
|
}
|
|
1787
|
-
function HintSlotFactory(
|
|
1788
|
-
const
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
2017
|
+
function HintSlotFactory(propsOrRef, slots) {
|
|
2018
|
+
const props = computed(() => {
|
|
2019
|
+
if (isRef(propsOrRef)) {
|
|
2020
|
+
return propsOrRef.value;
|
|
2021
|
+
}
|
|
2022
|
+
return propsOrRef;
|
|
2023
|
+
});
|
|
2024
|
+
const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
|
|
2025
|
+
const validLabel = computed(() => joinLines(props.value.validLabel));
|
|
2026
|
+
const loadingLabel = computed(() => props.value.loadingLabel);
|
|
2027
|
+
const hintLabel = computed(() => props.value.hintLabel);
|
|
1792
2028
|
const hasLoadingLabelOrSlot = computed(
|
|
1793
|
-
() => Boolean(props.loading && (slots.loading || loadingLabel.value))
|
|
2029
|
+
() => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
|
|
1794
2030
|
);
|
|
1795
2031
|
const hasInvalidLabelOrSlot = computed(
|
|
1796
|
-
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
2032
|
+
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
2033
|
+
props.value.invalid && (slots.invalid || invalidLabel.value)
|
|
2034
|
+
)
|
|
1797
2035
|
);
|
|
1798
2036
|
const hasValidLabelOrSlot = computed(
|
|
1799
|
-
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
|
|
2037
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
|
|
1800
2038
|
);
|
|
1801
2039
|
const hasHintLabelOrSlot = computed(
|
|
1802
2040
|
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
|
|
@@ -1805,10 +2043,10 @@ function HintSlotFactory(props, slots) {
|
|
|
1805
2043
|
() => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
|
|
1806
2044
|
);
|
|
1807
2045
|
const hintSlotScope = computed(() => ({
|
|
1808
|
-
modelValue: props.modelValue,
|
|
1809
|
-
valid: props.valid,
|
|
1810
|
-
invalid: props.invalid,
|
|
1811
|
-
loading: props.loading
|
|
2046
|
+
modelValue: props.value.modelValue,
|
|
2047
|
+
valid: props.value.valid,
|
|
2048
|
+
invalid: props.value.invalid,
|
|
2049
|
+
loading: props.value.loading
|
|
1812
2050
|
}));
|
|
1813
2051
|
const HintSlot = defineComponent({
|
|
1814
2052
|
name: "HintSlot",
|
|
@@ -1888,18 +2126,76 @@ function HintSlotFactory(props, slots) {
|
|
|
1888
2126
|
HintSlot
|
|
1889
2127
|
};
|
|
1890
2128
|
}
|
|
1891
|
-
|
|
2129
|
+
function useDefaults(componentName, propsDefinition, props) {
|
|
2130
|
+
const volver = useVolver();
|
|
2131
|
+
const volverComponentDefaults = computed(() => {
|
|
2132
|
+
var _a;
|
|
2133
|
+
if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
|
|
2134
|
+
return void 0;
|
|
2135
|
+
}
|
|
2136
|
+
return volver.defaults.value[componentName];
|
|
2137
|
+
});
|
|
2138
|
+
return computed(() => {
|
|
2139
|
+
if (volverComponentDefaults.value === void 0) {
|
|
2140
|
+
return props;
|
|
2141
|
+
}
|
|
2142
|
+
const componentDefaults = volverComponentDefaults.value;
|
|
2143
|
+
const simplifiedPropsDefinition = propsDefinition;
|
|
2144
|
+
const simplifiedProps = props;
|
|
2145
|
+
return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
|
|
2146
|
+
const propValue = simplifiedProps[key];
|
|
2147
|
+
acc[key] = propValue;
|
|
2148
|
+
if (key in componentDefaults) {
|
|
2149
|
+
if (Array.isArray(simplifiedPropsDefinition[key])) {
|
|
2150
|
+
const typeArray = simplifiedPropsDefinition[key];
|
|
2151
|
+
if (typeArray.length) {
|
|
2152
|
+
const typeFunction = typeArray[0];
|
|
2153
|
+
if (typeFunction === propValue) {
|
|
2154
|
+
acc[key] = componentDefaults[key];
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
if (typeof simplifiedPropsDefinition[key] === "function") {
|
|
2159
|
+
const typeFunction = simplifiedPropsDefinition[key];
|
|
2160
|
+
if (typeFunction() === propValue) {
|
|
2161
|
+
acc[key] = componentDefaults[key];
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
if (typeof simplifiedPropsDefinition[key] === "object") {
|
|
2165
|
+
let defaultValue = simplifiedPropsDefinition[key].default;
|
|
2166
|
+
if (typeof defaultValue === "function") {
|
|
2167
|
+
defaultValue = defaultValue();
|
|
2168
|
+
}
|
|
2169
|
+
if (typeof defaultValue === "object") {
|
|
2170
|
+
if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
|
|
2171
|
+
acc[key] = componentDefaults[key];
|
|
2172
|
+
}
|
|
2173
|
+
} else if (defaultValue === propValue) {
|
|
2174
|
+
acc[key] = componentDefaults[key];
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
return acc;
|
|
2179
|
+
}, {});
|
|
2180
|
+
});
|
|
2181
|
+
}
|
|
2182
|
+
const _hoisted_1$d = ["for"];
|
|
1892
2183
|
const _hoisted_2$8 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid", "aria-describedby", "aria-errormessage"];
|
|
1893
2184
|
const __default__$d = {
|
|
1894
2185
|
name: "VvCheckbox"
|
|
1895
2186
|
};
|
|
1896
|
-
const _sfc_main$
|
|
2187
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1897
2188
|
...__default__$d,
|
|
1898
2189
|
props: VvCheckboxProps,
|
|
1899
2190
|
emits: VvCheckboxEvents,
|
|
1900
2191
|
setup(__props, { emit }) {
|
|
1901
2192
|
const props = __props;
|
|
1902
2193
|
const slots = useSlots();
|
|
2194
|
+
const propsDefaults = useDefaults(
|
|
2195
|
+
"VvCheckbox",
|
|
2196
|
+
VvCheckboxProps,
|
|
2197
|
+
props
|
|
2198
|
+
);
|
|
1903
2199
|
const {
|
|
1904
2200
|
id,
|
|
1905
2201
|
disabled,
|
|
@@ -2012,7 +2308,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
2012
2308
|
hasHintLabelOrSlot,
|
|
2013
2309
|
hasInvalidLabelOrSlot,
|
|
2014
2310
|
hintSlotScope
|
|
2015
|
-
} = HintSlotFactory(
|
|
2311
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
2016
2312
|
return (_ctx, _cache) => {
|
|
2017
2313
|
return openBlock(), createElementBlock("label", {
|
|
2018
2314
|
class: normalizeClass(unref(bemCssClasses)),
|
|
@@ -2071,7 +2367,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
2071
2367
|
key: "3"
|
|
2072
2368
|
} : void 0
|
|
2073
2369
|
]), 1032, ["id"])
|
|
2074
|
-
], 10, _hoisted_1$
|
|
2370
|
+
], 10, _hoisted_1$d);
|
|
2075
2371
|
};
|
|
2076
2372
|
}
|
|
2077
2373
|
});
|
|
@@ -2109,18 +2405,23 @@ function useOptions(props) {
|
|
|
2109
2405
|
getOptionGrouped
|
|
2110
2406
|
};
|
|
2111
2407
|
}
|
|
2112
|
-
const _hoisted_1$
|
|
2408
|
+
const _hoisted_1$c = ["textContent"];
|
|
2113
2409
|
const _hoisted_2$7 = { class: "vv-checkbox-group__wrapper" };
|
|
2114
2410
|
const __default__$c = {
|
|
2115
2411
|
name: "VvCheckboxGroup"
|
|
2116
2412
|
};
|
|
2117
|
-
const _sfc_main$
|
|
2413
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
2118
2414
|
...__default__$c,
|
|
2119
2415
|
props: VvCheckboxGroupProps,
|
|
2120
2416
|
emits: VvCheckboxGroupEvents,
|
|
2121
2417
|
setup(__props, { emit }) {
|
|
2122
2418
|
const props = __props;
|
|
2123
2419
|
const slots = useSlots();
|
|
2420
|
+
const propsDefaults = useDefaults(
|
|
2421
|
+
"VvCheckboxGroup",
|
|
2422
|
+
VvCheckboxGroupProps,
|
|
2423
|
+
props
|
|
2424
|
+
);
|
|
2124
2425
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
2125
2426
|
const { disabled, readonly, vertical, valid, invalid, modifiers } = toRefs(props);
|
|
2126
2427
|
useProvideGroupState({
|
|
@@ -2151,7 +2452,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2151
2452
|
value: getOptionValue(option)
|
|
2152
2453
|
};
|
|
2153
2454
|
};
|
|
2154
|
-
const { HintSlot, hintSlotScope } = HintSlotFactory(
|
|
2455
|
+
const { HintSlot, hintSlotScope } = HintSlotFactory(propsDefaults, slots);
|
|
2155
2456
|
return (_ctx, _cache) => {
|
|
2156
2457
|
return openBlock(), createElementBlock("fieldset", {
|
|
2157
2458
|
class: normalizeClass(unref(bemCssClasses))
|
|
@@ -2159,10 +2460,10 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2159
2460
|
_ctx.label ? (openBlock(), createElementBlock("legend", {
|
|
2160
2461
|
key: 0,
|
|
2161
2462
|
textContent: toDisplayString(_ctx.label)
|
|
2162
|
-
}, null, 8, _hoisted_1$
|
|
2463
|
+
}, null, 8, _hoisted_1$c)) : createCommentVNode("", true),
|
|
2163
2464
|
createElementVNode("div", _hoisted_2$7, [
|
|
2164
2465
|
_ctx.options.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.options, (option, index) => {
|
|
2165
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2466
|
+
return openBlock(), createBlock(_sfc_main$g, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
|
|
2166
2467
|
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
2167
2468
|
]),
|
|
2168
2469
|
createVNode(unref(HintSlot), { class: "vv-checkbox-group__hint" }, createSlots({ _: 2 }, [
|
|
@@ -2221,6 +2522,13 @@ const VvComboboxProps = {
|
|
|
2221
2522
|
...UnselectableProps,
|
|
2222
2523
|
...DropdownProps,
|
|
2223
2524
|
...LabelProps,
|
|
2525
|
+
/**
|
|
2526
|
+
* Dropdown show / hide transition name
|
|
2527
|
+
*/
|
|
2528
|
+
transitionName: {
|
|
2529
|
+
type: String,
|
|
2530
|
+
default: "vv-dropdown--mobile-fade-block"
|
|
2531
|
+
},
|
|
2224
2532
|
/**
|
|
2225
2533
|
* modelValue can be a string, number, boolean, object or array of string, number, boolean, object
|
|
2226
2534
|
*/
|
|
@@ -2252,6 +2560,10 @@ const VvComboboxProps = {
|
|
|
2252
2560
|
* Label for deselected option hint
|
|
2253
2561
|
*/
|
|
2254
2562
|
deselectHintLabel: { type: String, default: "Press enter to remove" },
|
|
2563
|
+
/**
|
|
2564
|
+
* Label close button
|
|
2565
|
+
*/
|
|
2566
|
+
closeLabel: { type: String, default: "Close" },
|
|
2255
2567
|
/**
|
|
2256
2568
|
* Select input placeholder
|
|
2257
2569
|
*/
|
|
@@ -2260,6 +2572,13 @@ const VvComboboxProps = {
|
|
|
2260
2572
|
* Use input text to search on options
|
|
2261
2573
|
*/
|
|
2262
2574
|
searchable: Boolean,
|
|
2575
|
+
/**
|
|
2576
|
+
* Search function to filter options
|
|
2577
|
+
*/
|
|
2578
|
+
searchFunction: {
|
|
2579
|
+
type: Function,
|
|
2580
|
+
default: void 0
|
|
2581
|
+
},
|
|
2263
2582
|
/**
|
|
2264
2583
|
* On searchable select is the input search placeholder
|
|
2265
2584
|
*/
|
|
@@ -2406,12 +2725,12 @@ function useProvideDropdownAction({
|
|
|
2406
2725
|
expanded
|
|
2407
2726
|
});
|
|
2408
2727
|
}
|
|
2409
|
-
const _hoisted_1$
|
|
2728
|
+
const _hoisted_1$b = ["id", "tabindex", "role", "aria-labelledby"];
|
|
2410
2729
|
const __default__$b = {
|
|
2411
2730
|
name: "VvDropdown",
|
|
2412
2731
|
inheritAttrs: false
|
|
2413
2732
|
};
|
|
2414
|
-
const _sfc_main$
|
|
2733
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
2415
2734
|
...__default__$b,
|
|
2416
2735
|
props: VvDropdownProps,
|
|
2417
2736
|
emits: [
|
|
@@ -2472,7 +2791,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2472
2791
|
}
|
|
2473
2792
|
} else if (props.flip) {
|
|
2474
2793
|
if (typeof props.flip === "boolean") {
|
|
2475
|
-
toReturn.push(flip());
|
|
2794
|
+
toReturn.push(flip({ fallbackStrategy: "initialPlacement" }));
|
|
2476
2795
|
} else {
|
|
2477
2796
|
toReturn.push(flip(props.flip));
|
|
2478
2797
|
}
|
|
@@ -2528,23 +2847,29 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2528
2847
|
referenceEl,
|
|
2529
2848
|
floatingEl,
|
|
2530
2849
|
{
|
|
2531
|
-
whileElementsMounted:
|
|
2850
|
+
whileElementsMounted: (...args) => {
|
|
2851
|
+
return autoUpdate(...args, {
|
|
2852
|
+
animationFrame: props.strategy === "fixed"
|
|
2853
|
+
});
|
|
2854
|
+
},
|
|
2532
2855
|
placement: computed(() => props.placement),
|
|
2533
2856
|
strategy: computed(() => props.strategy),
|
|
2534
2857
|
middleware
|
|
2535
2858
|
}
|
|
2536
2859
|
);
|
|
2537
2860
|
const dropdownPlacement = computed(() => {
|
|
2861
|
+
var _a;
|
|
2538
2862
|
if (hasCustomPosition.value) {
|
|
2539
2863
|
return void 0;
|
|
2540
2864
|
}
|
|
2865
|
+
const width = props.triggerWidth && referenceEl.value ? `${(_a = referenceEl.value) == null ? void 0 : _a.offsetWidth}px` : void 0;
|
|
2541
2866
|
return {
|
|
2542
2867
|
position: strategy.value,
|
|
2543
2868
|
top: `${y.value ?? 0}px`,
|
|
2544
2869
|
left: `${x.value ?? 0}px`,
|
|
2545
|
-
maxWidth: maxWidth.value,
|
|
2870
|
+
maxWidth: width ? void 0 : maxWidth.value,
|
|
2546
2871
|
maxHeight: maxHeight.value,
|
|
2547
|
-
width
|
|
2872
|
+
width
|
|
2548
2873
|
};
|
|
2549
2874
|
});
|
|
2550
2875
|
const side = computed(
|
|
@@ -2615,7 +2940,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2615
2940
|
onClickOutside(
|
|
2616
2941
|
floatingEl,
|
|
2617
2942
|
() => {
|
|
2618
|
-
if (!props.keepOpen) {
|
|
2943
|
+
if (!props.keepOpen && expanded.value) {
|
|
2619
2944
|
expanded.value = false;
|
|
2620
2945
|
}
|
|
2621
2946
|
},
|
|
@@ -2653,7 +2978,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2653
2978
|
}
|
|
2654
2979
|
return [
|
|
2655
2980
|
...element.querySelectorAll(
|
|
2656
|
-
'a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'
|
|
2981
|
+
'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
2657
2982
|
)
|
|
2658
2983
|
].filter(
|
|
2659
2984
|
(el) => !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden")
|
|
@@ -2795,7 +3120,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2795
3120
|
renderSlot(_ctx.$slots, "items", normalizeProps(guardReactiveProps({
|
|
2796
3121
|
role: unref(itemRole)
|
|
2797
3122
|
})))
|
|
2798
|
-
], 16, _hoisted_1$
|
|
3123
|
+
], 16, _hoisted_1$b),
|
|
2799
3124
|
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps({ expanded: unref(expanded) })))
|
|
2800
3125
|
], 6), [
|
|
2801
3126
|
[vShow, unref(expanded)]
|
|
@@ -2810,7 +3135,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2810
3135
|
const __default__$a = {
|
|
2811
3136
|
name: "VvDropdownItem"
|
|
2812
3137
|
};
|
|
2813
|
-
const _sfc_main$
|
|
3138
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
2814
3139
|
...__default__$a,
|
|
2815
3140
|
setup(__props) {
|
|
2816
3141
|
const { role, expanded } = useInjectedDropdownItem();
|
|
@@ -2835,11 +3160,11 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
2835
3160
|
};
|
|
2836
3161
|
}
|
|
2837
3162
|
});
|
|
2838
|
-
const _hoisted_1$
|
|
3163
|
+
const _hoisted_1$a = ["title"];
|
|
2839
3164
|
const __default__$9 = {
|
|
2840
3165
|
name: "VvDropdownOption"
|
|
2841
3166
|
};
|
|
2842
|
-
const _sfc_main$
|
|
3167
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
2843
3168
|
...__default__$9,
|
|
2844
3169
|
props: {
|
|
2845
3170
|
...DisabledProps,
|
|
@@ -2877,7 +3202,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
2877
3202
|
}
|
|
2878
3203
|
});
|
|
2879
3204
|
return (_ctx, _cache) => {
|
|
2880
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3205
|
+
return openBlock(), createBlock(_sfc_main$d, {
|
|
2881
3206
|
class: normalizeClass(unref(bemCssClasses)),
|
|
2882
3207
|
tabindex: _ctx.disabled ? -1 : 0,
|
|
2883
3208
|
"aria-selected": _ctx.selected,
|
|
@@ -2892,14 +3217,14 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
2892
3217
|
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps({ disabled: _ctx.disabled, selected: _ctx.selected, unselectable: _ctx.unselectable })), () => [
|
|
2893
3218
|
createTextVNode(toDisplayString(unref(hintLabel)), 1)
|
|
2894
3219
|
])
|
|
2895
|
-
], 8, _hoisted_1$
|
|
3220
|
+
], 8, _hoisted_1$a)
|
|
2896
3221
|
]),
|
|
2897
3222
|
_: 3
|
|
2898
3223
|
}, 8, ["class", "tabindex", "aria-selected", "aria-disabled"]);
|
|
2899
3224
|
};
|
|
2900
3225
|
}
|
|
2901
3226
|
});
|
|
2902
|
-
const _hoisted_1$
|
|
3227
|
+
const _hoisted_1$9 = {
|
|
2903
3228
|
class: "vv-dropdown-optgroup",
|
|
2904
3229
|
role: "presentation",
|
|
2905
3230
|
tabindex: "-1"
|
|
@@ -2907,7 +3232,7 @@ const _hoisted_1$7 = {
|
|
|
2907
3232
|
const __default__$8 = {
|
|
2908
3233
|
name: "VvDropdownOptgroup"
|
|
2909
3234
|
};
|
|
2910
|
-
const _sfc_main$
|
|
3235
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
2911
3236
|
...__default__$8,
|
|
2912
3237
|
props: {
|
|
2913
3238
|
...LabelProps
|
|
@@ -2915,7 +3240,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
2915
3240
|
setup(__props) {
|
|
2916
3241
|
const props = __props;
|
|
2917
3242
|
return (_ctx, _cache) => {
|
|
2918
|
-
return openBlock(), createElementBlock("li", _hoisted_1$
|
|
3243
|
+
return openBlock(), createElementBlock("li", _hoisted_1$9, toDisplayString(props.label), 1);
|
|
2919
3244
|
};
|
|
2920
3245
|
}
|
|
2921
3246
|
});
|
|
@@ -3012,13 +3337,13 @@ function useComponentIcon(icon, iconPosition) {
|
|
|
3012
3337
|
hasIconAfter
|
|
3013
3338
|
};
|
|
3014
3339
|
}
|
|
3015
|
-
const _hoisted_1$
|
|
3340
|
+
const _hoisted_1$8 = ["for"];
|
|
3016
3341
|
const _hoisted_2$6 = { class: "vv-select__wrapper" };
|
|
3017
3342
|
const _hoisted_3$4 = {
|
|
3018
3343
|
key: 0,
|
|
3019
3344
|
class: "vv-select__input-before"
|
|
3020
3345
|
};
|
|
3021
|
-
const _hoisted_4$
|
|
3346
|
+
const _hoisted_4$4 = { class: "vv-select__inner" };
|
|
3022
3347
|
const _hoisted_5$3 = ["id"];
|
|
3023
3348
|
const _hoisted_6$3 = ["disabled", "hidden"];
|
|
3024
3349
|
const _hoisted_7$3 = ["disabled", "value"];
|
|
@@ -3031,20 +3356,25 @@ const _hoisted_10 = {
|
|
|
3031
3356
|
const __default__$7 = {
|
|
3032
3357
|
name: "VvSelect"
|
|
3033
3358
|
};
|
|
3034
|
-
const _sfc_main$
|
|
3359
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
3035
3360
|
...__default__$7,
|
|
3036
3361
|
props: VvSelectProps,
|
|
3037
3362
|
emits: VvSelectEmits,
|
|
3038
3363
|
setup(__props, { emit }) {
|
|
3039
3364
|
const props = __props;
|
|
3040
3365
|
const slots = useSlots();
|
|
3366
|
+
const propsDefaults = useDefaults(
|
|
3367
|
+
"VvSelect",
|
|
3368
|
+
VvSelectProps,
|
|
3369
|
+
props
|
|
3370
|
+
);
|
|
3041
3371
|
const select = ref();
|
|
3042
3372
|
const {
|
|
3043
3373
|
HintSlot,
|
|
3044
3374
|
hasHintLabelOrSlot,
|
|
3045
3375
|
hasInvalidLabelOrSlot,
|
|
3046
3376
|
hintSlotScope
|
|
3047
|
-
} = HintSlotFactory(
|
|
3377
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
3048
3378
|
const {
|
|
3049
3379
|
id,
|
|
3050
3380
|
modifiers,
|
|
@@ -3150,13 +3480,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
3150
3480
|
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
3151
3481
|
key: 0,
|
|
3152
3482
|
for: unref(hasId)
|
|
3153
|
-
}, toDisplayString(_ctx.label), 9, _hoisted_1$
|
|
3483
|
+
}, toDisplayString(_ctx.label), 9, _hoisted_1$8)) : createCommentVNode("", true),
|
|
3154
3484
|
createElementVNode("div", _hoisted_2$6, [
|
|
3155
3485
|
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3$4, [
|
|
3156
3486
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
3157
3487
|
])) : createCommentVNode("", true),
|
|
3158
|
-
createElementVNode("div", _hoisted_4$
|
|
3159
|
-
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$
|
|
3488
|
+
createElementVNode("div", _hoisted_4$4, [
|
|
3489
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
3160
3490
|
key: 0,
|
|
3161
3491
|
class: "vv-select__icon"
|
|
3162
3492
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
@@ -3196,7 +3526,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
3196
3526
|
], 16, _hoisted_5$3), [
|
|
3197
3527
|
[vModelSelect, unref(localModelValue)]
|
|
3198
3528
|
]),
|
|
3199
|
-
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$
|
|
3529
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
3200
3530
|
key: 1,
|
|
3201
3531
|
class: "vv-select__icon vv-select__icon-after"
|
|
3202
3532
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
@@ -3242,63 +3572,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
3242
3572
|
};
|
|
3243
3573
|
}
|
|
3244
3574
|
});
|
|
3245
|
-
|
|
3246
|
-
const volver = useVolver();
|
|
3247
|
-
const volverComponentDefaults = computed(() => {
|
|
3248
|
-
var _a;
|
|
3249
|
-
if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
|
|
3250
|
-
return void 0;
|
|
3251
|
-
}
|
|
3252
|
-
return volver.defaults.value[componentName];
|
|
3253
|
-
});
|
|
3254
|
-
return computed(() => {
|
|
3255
|
-
if (volverComponentDefaults.value === void 0) {
|
|
3256
|
-
return props;
|
|
3257
|
-
}
|
|
3258
|
-
const componentDefaults = volverComponentDefaults.value;
|
|
3259
|
-
const simplifiedPropsDefinition = propsDefinition;
|
|
3260
|
-
const simplifiedProps = props;
|
|
3261
|
-
return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
|
|
3262
|
-
const propValue = simplifiedProps[key];
|
|
3263
|
-
acc[key] = propValue;
|
|
3264
|
-
if (key in componentDefaults) {
|
|
3265
|
-
if (Array.isArray(simplifiedPropsDefinition[key])) {
|
|
3266
|
-
const typeArray = simplifiedPropsDefinition[key];
|
|
3267
|
-
if (typeArray.length) {
|
|
3268
|
-
const typeFunction = typeArray[0];
|
|
3269
|
-
if (typeFunction === propValue) {
|
|
3270
|
-
acc[key] = componentDefaults[key];
|
|
3271
|
-
}
|
|
3272
|
-
}
|
|
3273
|
-
}
|
|
3274
|
-
if (typeof simplifiedPropsDefinition[key] === "function") {
|
|
3275
|
-
const typeFunction = simplifiedPropsDefinition[key];
|
|
3276
|
-
if (typeFunction() === propValue) {
|
|
3277
|
-
acc[key] = componentDefaults[key];
|
|
3278
|
-
}
|
|
3279
|
-
}
|
|
3280
|
-
if (typeof simplifiedPropsDefinition[key] === "object") {
|
|
3281
|
-
let defaultValue = simplifiedPropsDefinition[key].default;
|
|
3282
|
-
if (typeof defaultValue === "function") {
|
|
3283
|
-
defaultValue = defaultValue();
|
|
3284
|
-
}
|
|
3285
|
-
if (typeof defaultValue === "object") {
|
|
3286
|
-
if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
|
|
3287
|
-
acc[key] = componentDefaults[key];
|
|
3288
|
-
}
|
|
3289
|
-
} else if (defaultValue === propValue) {
|
|
3290
|
-
acc[key] = componentDefaults[key];
|
|
3291
|
-
}
|
|
3292
|
-
}
|
|
3293
|
-
}
|
|
3294
|
-
return acc;
|
|
3295
|
-
}, {});
|
|
3296
|
-
});
|
|
3297
|
-
}
|
|
3298
|
-
const _hoisted_1$5 = ["id"];
|
|
3575
|
+
const _hoisted_1$7 = ["id"];
|
|
3299
3576
|
const _hoisted_2$5 = ["id", "for"];
|
|
3300
3577
|
const _hoisted_3$3 = ["id", "aria-controls", "placeholder"];
|
|
3301
|
-
const _hoisted_4$
|
|
3578
|
+
const _hoisted_4$3 = {
|
|
3302
3579
|
key: 0,
|
|
3303
3580
|
class: "vv-select__input-before"
|
|
3304
3581
|
};
|
|
@@ -3316,13 +3593,13 @@ const _hoisted_9 = {
|
|
|
3316
3593
|
const __default__$6 = {
|
|
3317
3594
|
name: "VvCombobox",
|
|
3318
3595
|
components: {
|
|
3319
|
-
VvDropdown: _sfc_main$
|
|
3320
|
-
VvDropdownOption: _sfc_main$
|
|
3321
|
-
VvDropdownOptgroup: _sfc_main$
|
|
3322
|
-
VvButton: _sfc_main$
|
|
3596
|
+
VvDropdown: _sfc_main$e,
|
|
3597
|
+
VvDropdownOption: _sfc_main$c,
|
|
3598
|
+
VvDropdownOptgroup: _sfc_main$b,
|
|
3599
|
+
VvButton: _sfc_main$j
|
|
3323
3600
|
}
|
|
3324
3601
|
};
|
|
3325
|
-
const _sfc_main$
|
|
3602
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
3326
3603
|
...__default__$6,
|
|
3327
3604
|
props: VvComboboxProps,
|
|
3328
3605
|
emits: VvComboboxEvents,
|
|
@@ -3345,7 +3622,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3345
3622
|
hasHintLabelOrSlot,
|
|
3346
3623
|
hasInvalidLabelOrSlot,
|
|
3347
3624
|
hintSlotScope
|
|
3348
|
-
} = HintSlotFactory(
|
|
3625
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
3349
3626
|
const inputEl = ref(null);
|
|
3350
3627
|
const inputSearchEl = ref(null);
|
|
3351
3628
|
const wrapperEl = ref(null);
|
|
@@ -3371,7 +3648,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3371
3648
|
const searchText = ref("");
|
|
3372
3649
|
const debouncedSearchText = refDebounced(
|
|
3373
3650
|
searchText,
|
|
3374
|
-
Number(props.debounceSearch)
|
|
3651
|
+
computed(() => Number(props.debounceSearch))
|
|
3375
3652
|
);
|
|
3376
3653
|
watch(
|
|
3377
3654
|
debouncedSearchText,
|
|
@@ -3394,7 +3671,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3394
3671
|
expanded.value = false;
|
|
3395
3672
|
};
|
|
3396
3673
|
const onAfterExpand = () => {
|
|
3397
|
-
if (
|
|
3674
|
+
if (propsDefaults.value.searchable) {
|
|
3398
3675
|
if (inputSearchEl.value) {
|
|
3399
3676
|
inputSearchEl.value.focus({
|
|
3400
3677
|
preventScroll: true
|
|
@@ -3403,7 +3680,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3403
3680
|
}
|
|
3404
3681
|
};
|
|
3405
3682
|
const onAfterCollapse = () => {
|
|
3406
|
-
if (
|
|
3683
|
+
if (propsDefaults.value.searchable) {
|
|
3407
3684
|
searchText.value = "";
|
|
3408
3685
|
}
|
|
3409
3686
|
};
|
|
@@ -3417,14 +3694,15 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3417
3694
|
loading,
|
|
3418
3695
|
valid,
|
|
3419
3696
|
invalid,
|
|
3420
|
-
floating
|
|
3421
|
-
searchable
|
|
3697
|
+
floating
|
|
3422
3698
|
} = toRefs(props);
|
|
3423
3699
|
const hasId = useUniqueId(id);
|
|
3424
3700
|
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
3425
3701
|
const hasDropdownId = computed(() => `${hasId.value}-dropdown`);
|
|
3426
3702
|
const hasSearchId = computed(() => `${hasId.value}-search`);
|
|
3427
3703
|
const hasLabelId = computed(() => `${hasId.value}-label`);
|
|
3704
|
+
const localLoading = ref(false);
|
|
3705
|
+
const isLoading = computed(() => localLoading.value || loading.value);
|
|
3428
3706
|
const dropdownEl = ref();
|
|
3429
3707
|
const { hasIcon, hasIconBefore, hasIconAfter } = useComponentIcon(
|
|
3430
3708
|
icon,
|
|
@@ -3439,7 +3717,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3439
3717
|
modifiers,
|
|
3440
3718
|
computed(() => ({
|
|
3441
3719
|
disabled: disabled.value,
|
|
3442
|
-
loading:
|
|
3720
|
+
loading: isLoading.value,
|
|
3443
3721
|
readonly: readonly.value,
|
|
3444
3722
|
"icon-before": Boolean(hasIconBefore.value),
|
|
3445
3723
|
"icon-after": Boolean(hasIconAfter.value),
|
|
@@ -3457,8 +3735,19 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3457
3735
|
getOptionDisabled,
|
|
3458
3736
|
getOptionGrouped
|
|
3459
3737
|
} = useOptions(props);
|
|
3460
|
-
const filteredOptions =
|
|
3738
|
+
const filteredOptions = computedAsync(async () => {
|
|
3461
3739
|
var _a;
|
|
3740
|
+
if (propsDefaults.value.searchFunction) {
|
|
3741
|
+
localLoading.value = true;
|
|
3742
|
+
const toReturn = await Promise.resolve(
|
|
3743
|
+
propsDefaults.value.searchFunction(
|
|
3744
|
+
debouncedSearchText.value,
|
|
3745
|
+
props.options
|
|
3746
|
+
)
|
|
3747
|
+
);
|
|
3748
|
+
localLoading.value = false;
|
|
3749
|
+
return toReturn;
|
|
3750
|
+
}
|
|
3462
3751
|
return (_a = props.options) == null ? void 0 : _a.filter((option) => {
|
|
3463
3752
|
return getOptionLabel(option).toLowerCase().includes(debouncedSearchText.value.toLowerCase().trim());
|
|
3464
3753
|
});
|
|
@@ -3476,12 +3765,15 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3476
3765
|
} else if (props.modelValue) {
|
|
3477
3766
|
selectedValues = [props.modelValue];
|
|
3478
3767
|
}
|
|
3479
|
-
const options = props.options.reduce(
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3768
|
+
const options = props.options.reduce(
|
|
3769
|
+
(acc, value) => {
|
|
3770
|
+
if (isGroup(value)) {
|
|
3771
|
+
return [...acc, ...getOptionGrouped(value)];
|
|
3772
|
+
}
|
|
3773
|
+
return [...acc, value];
|
|
3774
|
+
},
|
|
3775
|
+
[]
|
|
3776
|
+
);
|
|
3485
3777
|
return options.filter((option) => {
|
|
3486
3778
|
if (isGroup(option)) {
|
|
3487
3779
|
return getOptionGrouped(option).some(
|
|
@@ -3535,7 +3827,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3535
3827
|
invalid: invalid.value,
|
|
3536
3828
|
invalidLabel: propsDefaults.value.invalidLabel,
|
|
3537
3829
|
hintLabel: propsDefaults.value.hintLabel,
|
|
3538
|
-
loading:
|
|
3830
|
+
loading: isLoading.value,
|
|
3539
3831
|
loadingLabel: propsDefaults.value.loadingLabel,
|
|
3540
3832
|
disabled: disabled.value,
|
|
3541
3833
|
readonly: readonly.value,
|
|
@@ -3563,7 +3855,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3563
3855
|
flip: propsDefaults.value.flip,
|
|
3564
3856
|
autoPlacement: propsDefaults.value.autoPlacement,
|
|
3565
3857
|
arrow: propsDefaults.value.arrow,
|
|
3566
|
-
autofocusFirst:
|
|
3858
|
+
autofocusFirst: propsDefaults.value.searchable ? true : propsDefaults.value.autofocusFirst,
|
|
3567
3859
|
triggerWidth: propsDefaults.value.triggerWidth,
|
|
3568
3860
|
modifiers: propsDefaults.value.dropdownModifiers
|
|
3569
3861
|
}));
|
|
@@ -3595,14 +3887,14 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3595
3887
|
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
3596
3888
|
key: 0,
|
|
3597
3889
|
id: unref(hasLabelId),
|
|
3598
|
-
for: unref(searchable
|
|
3890
|
+
for: unref(propsDefaults).searchable ? unref(hasSearchId) : void 0
|
|
3599
3891
|
}, toDisplayString(_ctx.label), 9, _hoisted_2$5)) : createCommentVNode("", true),
|
|
3600
3892
|
createElementVNode("div", {
|
|
3601
3893
|
ref_key: "wrapperEl",
|
|
3602
3894
|
ref: wrapperEl,
|
|
3603
3895
|
class: "vv-select__wrapper"
|
|
3604
3896
|
}, [
|
|
3605
|
-
createVNode(_sfc_main$
|
|
3897
|
+
createVNode(_sfc_main$e, mergeProps({
|
|
3606
3898
|
ref_key: "dropdownEl",
|
|
3607
3899
|
ref: dropdownEl,
|
|
3608
3900
|
modelValue: unref(expanded),
|
|
@@ -3613,11 +3905,11 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3613
3905
|
onAfterCollapse
|
|
3614
3906
|
}), createSlots({
|
|
3615
3907
|
default: withCtx(({ aria }) => [
|
|
3616
|
-
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
3908
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
3617
3909
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
3618
3910
|
])) : createCommentVNode("", true),
|
|
3619
3911
|
createElementVNode("div", _hoisted_5$2, [
|
|
3620
|
-
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$
|
|
3912
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
3621
3913
|
key: 0,
|
|
3622
3914
|
class: "vv-select__icon"
|
|
3623
3915
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
@@ -3637,7 +3929,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3637
3929
|
renderSlot(_ctx.$slots, "value", normalizeProps(guardReactiveProps({ selectedOptions: unref(selectedOptions), onInput })), () => [
|
|
3638
3930
|
unref(hasValue) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3639
3931
|
!_ctx.badges ? (openBlock(), createElementBlock("div", _hoisted_7$2, toDisplayString(unref(hasValue)), 1)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(selectedOptions), (option, index) => {
|
|
3640
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3932
|
+
return openBlock(), createBlock(_sfc_main$l, {
|
|
3641
3933
|
key: index,
|
|
3642
3934
|
modifiers: _ctx.badgeModifiers,
|
|
3643
3935
|
class: "vv-select__badge"
|
|
@@ -3647,9 +3939,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3647
3939
|
_ctx.unselectable && !unref(readonly) && !unref(disabled) ? (openBlock(), createElementBlock("button", {
|
|
3648
3940
|
key: 0,
|
|
3649
3941
|
"aria-label": unref(propsDefaults).deselectActionLabel,
|
|
3942
|
+
type: "button",
|
|
3650
3943
|
onClick: withModifiers(($event) => onInput(option), ["stop"])
|
|
3651
3944
|
}, [
|
|
3652
|
-
createVNode(_sfc_main$
|
|
3945
|
+
createVNode(_sfc_main$n, { name: "close" })
|
|
3653
3946
|
], 8, _hoisted_8$1)) : createCommentVNode("", true)
|
|
3654
3947
|
]),
|
|
3655
3948
|
_: 2
|
|
@@ -3660,7 +3953,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3660
3953
|
], 64))
|
|
3661
3954
|
])
|
|
3662
3955
|
], 16, _hoisted_6$2),
|
|
3663
|
-
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$
|
|
3956
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
3664
3957
|
key: 1,
|
|
3665
3958
|
class: "vv-select__icon vv-select__icon-after"
|
|
3666
3959
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
@@ -3669,107 +3962,110 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3669
3962
|
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
3670
3963
|
])) : createCommentVNode("", true)
|
|
3671
3964
|
]),
|
|
3672
|
-
items: withCtx(() =>
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3965
|
+
items: withCtx(() => {
|
|
3966
|
+
var _a;
|
|
3967
|
+
return [
|
|
3968
|
+
!unref(disabled) && ((_a = unref(filteredOptions)) == null ? void 0 : _a.length) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(filteredOptions), (option, index) => {
|
|
3969
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
3970
|
+
isGroup(option) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3971
|
+
createVNode(_sfc_main$b, {
|
|
3972
|
+
label: unref(getOptionLabel)(option)
|
|
3973
|
+
}, null, 8, ["label"]),
|
|
3974
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getOptionGrouped)(
|
|
3975
|
+
option
|
|
3976
|
+
), (item, i) => {
|
|
3977
|
+
return openBlock(), createBlock(_sfc_main$c, mergeProps({
|
|
3978
|
+
disabled: unref(getOptionDisabled)(item),
|
|
3979
|
+
selected: getOptionSelected(item),
|
|
3980
|
+
unselectable: _ctx.unselectable,
|
|
3981
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
3982
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
3983
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
3984
|
+
}, {
|
|
3985
|
+
key: i,
|
|
3986
|
+
class: "vv-dropdown-option",
|
|
3987
|
+
onClickPassive: ($event) => onInput(item)
|
|
3988
|
+
}), {
|
|
3989
|
+
default: withCtx(() => [
|
|
3990
|
+
renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps({
|
|
3991
|
+
option,
|
|
3992
|
+
selectedOptions: unref(selectedOptions),
|
|
3993
|
+
selected: getOptionSelected(item),
|
|
3994
|
+
disabled: unref(getOptionDisabled)(item)
|
|
3995
|
+
})), () => [
|
|
3996
|
+
createTextVNode(toDisplayString(unref(getOptionLabel)(item)), 1)
|
|
3997
|
+
])
|
|
3998
|
+
]),
|
|
3999
|
+
_: 2
|
|
4000
|
+
}, 1040, ["onClickPassive"]);
|
|
4001
|
+
}), 128))
|
|
4002
|
+
], 64)) : (openBlock(), createBlock(_sfc_main$c, mergeProps({ key: 1 }, {
|
|
4003
|
+
disabled: unref(getOptionDisabled)(option),
|
|
4004
|
+
selected: getOptionSelected(option),
|
|
4005
|
+
unselectable: _ctx.unselectable,
|
|
4006
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
4007
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
4008
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
4009
|
+
}, {
|
|
4010
|
+
class: "vv-dropdown-option",
|
|
4011
|
+
onClickPassive: ($event) => onInput(option)
|
|
4012
|
+
}), {
|
|
4013
|
+
default: withCtx(() => [
|
|
4014
|
+
renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps({
|
|
4015
|
+
option,
|
|
4016
|
+
selectedOptions: unref(selectedOptions),
|
|
4017
|
+
selected: getOptionSelected(option),
|
|
4018
|
+
disabled: unref(getOptionDisabled)(option)
|
|
4019
|
+
})), () => [
|
|
4020
|
+
createTextVNode(toDisplayString(unref(getOptionLabel)(option)), 1)
|
|
4021
|
+
])
|
|
4022
|
+
]),
|
|
4023
|
+
_: 2
|
|
4024
|
+
}, 1040, ["onClickPassive"]))
|
|
4025
|
+
], 64);
|
|
4026
|
+
}), 128)) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$c, {
|
|
4027
|
+
key: 1,
|
|
4028
|
+
modifiers: "inert"
|
|
4029
|
+
}, {
|
|
4030
|
+
default: withCtx(() => [
|
|
4031
|
+
renderSlot(_ctx.$slots, "no-options", {}, () => [
|
|
4032
|
+
createTextVNode(toDisplayString(unref(propsDefaults).noOptionsLabel), 1)
|
|
4033
|
+
])
|
|
4034
|
+
]),
|
|
4035
|
+
_: 3
|
|
4036
|
+
})) : !unref(disabled) ? (openBlock(), createBlock(_sfc_main$c, {
|
|
4037
|
+
key: 2,
|
|
4038
|
+
modifiers: "inert"
|
|
4039
|
+
}, {
|
|
4040
|
+
default: withCtx(() => [
|
|
4041
|
+
renderSlot(_ctx.$slots, "no-results", {}, () => [
|
|
4042
|
+
createTextVNode(toDisplayString(unref(propsDefaults).noResultsLabel), 1)
|
|
4043
|
+
])
|
|
4044
|
+
]),
|
|
4045
|
+
_: 3
|
|
4046
|
+
})) : createCommentVNode("", true)
|
|
4047
|
+
];
|
|
4048
|
+
}),
|
|
3753
4049
|
after: withCtx(() => [
|
|
3754
4050
|
renderSlot(_ctx.$slots, "dropdown::after", {}, () => {
|
|
3755
4051
|
var _a;
|
|
3756
4052
|
return [
|
|
3757
|
-
((_a = unref(dropdownEl)) == null ? void 0 : _a.customPosition) ? (openBlock(), createBlock(_sfc_main$
|
|
4053
|
+
((_a = unref(dropdownEl)) == null ? void 0 : _a.customPosition) ? (openBlock(), createBlock(_sfc_main$j, {
|
|
3758
4054
|
key: 0,
|
|
3759
|
-
label:
|
|
4055
|
+
label: unref(propsDefaults).closeLabel,
|
|
3760
4056
|
modifiers: "secondary",
|
|
3761
4057
|
onClick: _cache[1] || (_cache[1] = ($event) => unref(dropdownEl).hide())
|
|
3762
|
-
})) : createCommentVNode("", true)
|
|
4058
|
+
}, null, 8, ["label"])) : createCommentVNode("", true)
|
|
3763
4059
|
];
|
|
3764
4060
|
})
|
|
3765
4061
|
]),
|
|
3766
4062
|
_: 2
|
|
3767
4063
|
}, [
|
|
3768
|
-
unref(searchable
|
|
4064
|
+
unref(propsDefaults).searchable || _ctx.$slots["dropdown::before"] ? {
|
|
3769
4065
|
name: "before",
|
|
3770
4066
|
fn: withCtx(() => [
|
|
3771
4067
|
renderSlot(_ctx.$slots, "dropdown::before"),
|
|
3772
|
-
unref(searchable) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
4068
|
+
unref(propsDefaults).searchable && !unref(disabled) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
3773
4069
|
key: 0,
|
|
3774
4070
|
id: unref(hasSearchId),
|
|
3775
4071
|
ref_key: "inputSearchEl",
|
|
@@ -3783,7 +4079,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3783
4079
|
class: "vv-dropdown__search",
|
|
3784
4080
|
placeholder: unref(propsDefaults).searchPlaceholder
|
|
3785
4081
|
}, null, 8, _hoisted_3$3)), [
|
|
3786
|
-
[vShow, unref(expanded)],
|
|
3787
4082
|
[vModelText, unref(searchText)]
|
|
3788
4083
|
]) : createCommentVNode("", true)
|
|
3789
4084
|
]),
|
|
@@ -3824,7 +4119,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3824
4119
|
key: "3"
|
|
3825
4120
|
} : void 0
|
|
3826
4121
|
]), 1032, ["id"])
|
|
3827
|
-
], 10, _hoisted_1$
|
|
4122
|
+
], 10, _hoisted_1$7)) : (openBlock(), createBlock(_sfc_main$a, mergeProps({ key: 1 }, unref(selectProps), {
|
|
3828
4123
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => emit("update:modelValue", $event))
|
|
3829
4124
|
}), null, 16));
|
|
3830
4125
|
};
|
|
@@ -3869,35 +4164,36 @@ const VvDialogProps = {
|
|
|
3869
4164
|
*/
|
|
3870
4165
|
keepOpen: { type: Boolean, default: false }
|
|
3871
4166
|
};
|
|
3872
|
-
const _hoisted_1$
|
|
4167
|
+
const _hoisted_1$6 = ["onCancel"];
|
|
4168
|
+
const _hoisted_2$4 = {
|
|
3873
4169
|
key: 0,
|
|
3874
4170
|
class: "vv-dialog__header"
|
|
3875
4171
|
};
|
|
3876
|
-
const
|
|
3877
|
-
const
|
|
4172
|
+
const _hoisted_3$2 = { class: "vv-dialog__content" };
|
|
4173
|
+
const _hoisted_4$2 = {
|
|
3878
4174
|
key: 1,
|
|
3879
4175
|
class: "vv-dialog__footer"
|
|
3880
4176
|
};
|
|
3881
4177
|
const __default__$5 = {
|
|
3882
4178
|
name: "VvDialog"
|
|
3883
4179
|
};
|
|
3884
|
-
const _sfc_main$
|
|
4180
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
3885
4181
|
...__default__$5,
|
|
3886
4182
|
props: VvDialogProps,
|
|
3887
4183
|
emits: VvDialogEvents,
|
|
3888
4184
|
setup(__props, { expose: __expose, emit }) {
|
|
3889
4185
|
const props = __props;
|
|
3890
4186
|
const dialogEl = ref();
|
|
4187
|
+
const modelValue = useVModel(props, "modelValue", emit);
|
|
3891
4188
|
const localModelValue = ref(false);
|
|
3892
|
-
const
|
|
3893
|
-
get()
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
localModelValue.value = value;
|
|
4189
|
+
const isOpened = computed({
|
|
4190
|
+
get: () => modelValue.value ?? localModelValue.value,
|
|
4191
|
+
set: (newValue) => {
|
|
4192
|
+
if (modelValue.value === void 0) {
|
|
4193
|
+
localModelValue.value = newValue;
|
|
4194
|
+
return;
|
|
3899
4195
|
}
|
|
3900
|
-
|
|
4196
|
+
modelValue.value = newValue;
|
|
3901
4197
|
}
|
|
3902
4198
|
});
|
|
3903
4199
|
const modalWrapper = ref(null);
|
|
@@ -3916,14 +4212,18 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3916
4212
|
const transitioName = computed(() => `vv-dialog--${props.transition}`);
|
|
3917
4213
|
const dialogTransitionHandlers = {
|
|
3918
4214
|
"before-enter": () => {
|
|
3919
|
-
var _a;
|
|
3920
|
-
(_a = dialogEl.value) == null ? void 0 : _a.
|
|
4215
|
+
var _a, _b;
|
|
4216
|
+
if (!((_a = dialogEl.value) == null ? void 0 : _a.open)) {
|
|
4217
|
+
(_b = dialogEl.value) == null ? void 0 : _b.showModal();
|
|
4218
|
+
}
|
|
3921
4219
|
emit("open");
|
|
3922
4220
|
emit("before-enter");
|
|
3923
4221
|
},
|
|
3924
4222
|
"after-leave": () => {
|
|
3925
|
-
var _a;
|
|
3926
|
-
(_a = dialogEl.value) == null ? void 0 : _a.
|
|
4223
|
+
var _a, _b;
|
|
4224
|
+
if ((_a = dialogEl.value) == null ? void 0 : _a.open) {
|
|
4225
|
+
(_b = dialogEl.value) == null ? void 0 : _b.close();
|
|
4226
|
+
}
|
|
3927
4227
|
emit("close");
|
|
3928
4228
|
emit("after-leave");
|
|
3929
4229
|
},
|
|
@@ -3948,36 +4248,36 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3948
4248
|
};
|
|
3949
4249
|
onClickOutside(modalWrapper, () => {
|
|
3950
4250
|
if (!props.keepOpen) {
|
|
3951
|
-
|
|
4251
|
+
close();
|
|
3952
4252
|
}
|
|
3953
4253
|
});
|
|
3954
4254
|
function close() {
|
|
3955
|
-
|
|
4255
|
+
isOpened.value = false;
|
|
3956
4256
|
}
|
|
3957
4257
|
function open() {
|
|
3958
|
-
|
|
4258
|
+
isOpened.value = true;
|
|
3959
4259
|
}
|
|
3960
4260
|
__expose({ close, open });
|
|
3961
|
-
|
|
3962
|
-
if (
|
|
3963
|
-
e.preventDefault();
|
|
4261
|
+
const onCancel = () => {
|
|
4262
|
+
if (!props.keepOpen) {
|
|
3964
4263
|
close();
|
|
3965
4264
|
}
|
|
3966
|
-
}
|
|
4265
|
+
};
|
|
3967
4266
|
return (_ctx, _cache) => {
|
|
3968
4267
|
return openBlock(), createBlock(Transition, mergeProps({ name: unref(transitioName) }, toHandlers(dialogTransitionHandlers)), {
|
|
3969
4268
|
default: withCtx(() => [
|
|
3970
4269
|
withDirectives(createElementVNode("dialog", mergeProps(unref(dialogAttrs), {
|
|
3971
4270
|
ref_key: "dialogEl",
|
|
3972
4271
|
ref: dialogEl,
|
|
3973
|
-
class: unref(dialogClass)
|
|
4272
|
+
class: unref(dialogClass),
|
|
4273
|
+
onCancel: withModifiers(onCancel, ["stop", "prevent"])
|
|
3974
4274
|
}), [
|
|
3975
4275
|
createElementVNode("article", {
|
|
3976
4276
|
ref_key: "modalWrapper",
|
|
3977
4277
|
ref: modalWrapper,
|
|
3978
4278
|
class: "vv-dialog__wrapper"
|
|
3979
4279
|
}, [
|
|
3980
|
-
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header",
|
|
4280
|
+
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_2$4, [
|
|
3981
4281
|
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
3982
4282
|
createTextVNode(toDisplayString(_ctx.title) + " ", 1),
|
|
3983
4283
|
createElementVNode("button", {
|
|
@@ -3986,19 +4286,19 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3986
4286
|
class: "vv-dialog__close",
|
|
3987
4287
|
onClickPassive: close
|
|
3988
4288
|
}, [
|
|
3989
|
-
createVNode(_sfc_main$
|
|
4289
|
+
createVNode(_sfc_main$n, { name: "close" })
|
|
3990
4290
|
], 32)
|
|
3991
4291
|
])
|
|
3992
4292
|
])) : createCommentVNode("", true),
|
|
3993
|
-
createElementVNode("div",
|
|
4293
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
3994
4294
|
renderSlot(_ctx.$slots, "default")
|
|
3995
4295
|
]),
|
|
3996
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer",
|
|
4296
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_4$2, [
|
|
3997
4297
|
renderSlot(_ctx.$slots, "footer")
|
|
3998
4298
|
])) : createCommentVNode("", true)
|
|
3999
4299
|
], 512)
|
|
4000
|
-
], 16), [
|
|
4001
|
-
[vShow, unref(
|
|
4300
|
+
], 16, _hoisted_1$6), [
|
|
4301
|
+
[vShow, unref(isOpened)]
|
|
4002
4302
|
])
|
|
4003
4303
|
]),
|
|
4004
4304
|
_: 3
|
|
@@ -4029,7 +4329,23 @@ const TYPES_ICON = {
|
|
|
4029
4329
|
COLOR: "color",
|
|
4030
4330
|
SEARCH: "close"
|
|
4031
4331
|
};
|
|
4032
|
-
const VvInputTextEvents = [
|
|
4332
|
+
const VvInputTextEvents = [
|
|
4333
|
+
"update:modelValue",
|
|
4334
|
+
"update:masked",
|
|
4335
|
+
"accept",
|
|
4336
|
+
"accept:typed",
|
|
4337
|
+
"accept:masked",
|
|
4338
|
+
"accept:unmasked",
|
|
4339
|
+
"complete",
|
|
4340
|
+
"complete:typed",
|
|
4341
|
+
"complete:masked",
|
|
4342
|
+
"complete:unmasked",
|
|
4343
|
+
"focus",
|
|
4344
|
+
"blur",
|
|
4345
|
+
"keyup",
|
|
4346
|
+
"keydown",
|
|
4347
|
+
"keypress"
|
|
4348
|
+
];
|
|
4033
4349
|
const VvInputTextProps = {
|
|
4034
4350
|
...InputTextareaProps,
|
|
4035
4351
|
/**
|
|
@@ -4136,44 +4452,19 @@ const VvInputTextProps = {
|
|
|
4136
4452
|
default: "Clear"
|
|
4137
4453
|
},
|
|
4138
4454
|
/**
|
|
4139
|
-
*
|
|
4140
|
-
* @see https://
|
|
4455
|
+
* iMask options
|
|
4456
|
+
* @see https://imask.js.org/guide.html
|
|
4141
4457
|
*/
|
|
4142
|
-
|
|
4143
|
-
type: String,
|
|
4144
|
-
default: void 0
|
|
4145
|
-
},
|
|
4146
|
-
/**
|
|
4147
|
-
* Show mask before typing
|
|
4148
|
-
* @see https://beholdr.github.io/maska/#/?id=maskinput-options
|
|
4149
|
-
*/
|
|
4150
|
-
maskEager: {
|
|
4151
|
-
type: Boolean,
|
|
4152
|
-
default: false
|
|
4153
|
-
},
|
|
4154
|
-
/**
|
|
4155
|
-
* Write values reverse (ex. for numbers)
|
|
4156
|
-
* @see https://beholdr.github.io/maska/#/?id=maskinput-options
|
|
4157
|
-
*/
|
|
4158
|
-
maskReversed: {
|
|
4159
|
-
type: Boolean,
|
|
4160
|
-
default: false
|
|
4161
|
-
},
|
|
4162
|
-
/**
|
|
4163
|
-
* Add mask custom tokens
|
|
4164
|
-
* @see https://beholdr.github.io/maska/#/?id=custom-tokens
|
|
4165
|
-
*/
|
|
4166
|
-
maskTokens: {
|
|
4458
|
+
iMask: {
|
|
4167
4459
|
type: Object,
|
|
4168
4460
|
default: void 0
|
|
4169
4461
|
},
|
|
4170
4462
|
/**
|
|
4171
|
-
*
|
|
4172
|
-
* @see https://beholdr.github.io/maska/#/?id=custom-tokens
|
|
4463
|
+
* Masked value
|
|
4173
4464
|
*/
|
|
4174
|
-
|
|
4175
|
-
type:
|
|
4176
|
-
default:
|
|
4465
|
+
masked: {
|
|
4466
|
+
type: String,
|
|
4467
|
+
default: void 0
|
|
4177
4468
|
},
|
|
4178
4469
|
/**
|
|
4179
4470
|
* Adjust input width to content
|
|
@@ -4194,11 +4485,18 @@ const VvInputTextProps = {
|
|
|
4194
4485
|
*/
|
|
4195
4486
|
unit: {
|
|
4196
4487
|
type: String
|
|
4488
|
+
},
|
|
4489
|
+
/**
|
|
4490
|
+
* Select input text on focus
|
|
4491
|
+
*/
|
|
4492
|
+
selectOnFocus: {
|
|
4493
|
+
type: Boolean,
|
|
4494
|
+
default: false
|
|
4197
4495
|
}
|
|
4198
4496
|
};
|
|
4199
4497
|
const VvInputPasswordAction = defineComponent({
|
|
4200
4498
|
components: {
|
|
4201
|
-
VvIcon: _sfc_main$
|
|
4499
|
+
VvIcon: _sfc_main$n
|
|
4202
4500
|
},
|
|
4203
4501
|
props: {
|
|
4204
4502
|
disabled: {
|
|
@@ -4242,7 +4540,7 @@ const VvInputPasswordAction = defineComponent({
|
|
|
4242
4540
|
};
|
|
4243
4541
|
},
|
|
4244
4542
|
render() {
|
|
4245
|
-
const icon = h(_sfc_main$
|
|
4543
|
+
const icon = h(_sfc_main$n, {
|
|
4246
4544
|
name: this.activeIcon,
|
|
4247
4545
|
class: "vv-input-text__icon"
|
|
4248
4546
|
});
|
|
@@ -4261,7 +4559,7 @@ const VvInputPasswordAction = defineComponent({
|
|
|
4261
4559
|
});
|
|
4262
4560
|
const VvInputStepAction = defineComponent({
|
|
4263
4561
|
components: {
|
|
4264
|
-
VvIcon: _sfc_main$
|
|
4562
|
+
VvIcon: _sfc_main$n
|
|
4265
4563
|
},
|
|
4266
4564
|
props: {
|
|
4267
4565
|
disabled: {
|
|
@@ -4306,7 +4604,7 @@ const VvInputStepAction = defineComponent({
|
|
|
4306
4604
|
});
|
|
4307
4605
|
const VvInputClearAction = defineComponent({
|
|
4308
4606
|
components: {
|
|
4309
|
-
VvIcon: _sfc_main$
|
|
4607
|
+
VvIcon: _sfc_main$n
|
|
4310
4608
|
},
|
|
4311
4609
|
props: {
|
|
4312
4610
|
disabled: {
|
|
@@ -4335,7 +4633,7 @@ const VvInputClearAction = defineComponent({
|
|
|
4335
4633
|
};
|
|
4336
4634
|
},
|
|
4337
4635
|
render() {
|
|
4338
|
-
const icon = h(_sfc_main$
|
|
4636
|
+
const icon = h(_sfc_main$n, {
|
|
4339
4637
|
name: this.icon,
|
|
4340
4638
|
class: "vv-input-text__icon"
|
|
4341
4639
|
});
|
|
@@ -4356,7 +4654,7 @@ function VvInputTextActionsFactory(type, parentProps) {
|
|
|
4356
4654
|
return {
|
|
4357
4655
|
name: "VvInputTextActions",
|
|
4358
4656
|
components: {
|
|
4359
|
-
VvIcon: _sfc_main$
|
|
4657
|
+
VvIcon: _sfc_main$n,
|
|
4360
4658
|
VvInputPasswordAction,
|
|
4361
4659
|
VvInputStepAction,
|
|
4362
4660
|
VvInputClearAction
|
|
@@ -4483,7 +4781,7 @@ function useTextCount(text, options) {
|
|
|
4483
4781
|
formatted
|
|
4484
4782
|
};
|
|
4485
4783
|
}
|
|
4486
|
-
const _hoisted_1$
|
|
4784
|
+
const _hoisted_1$5 = ["for"];
|
|
4487
4785
|
const _hoisted_2$3 = { class: "vv-input-text__wrapper" };
|
|
4488
4786
|
const _hoisted_3$1 = {
|
|
4489
4787
|
key: 0,
|
|
@@ -4506,16 +4804,18 @@ const _hoisted_8 = {
|
|
|
4506
4804
|
const __default__$4 = {
|
|
4507
4805
|
name: "VvInputText"
|
|
4508
4806
|
};
|
|
4509
|
-
const _sfc_main$
|
|
4807
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
4510
4808
|
...__default__$4,
|
|
4511
4809
|
props: VvInputTextProps,
|
|
4512
4810
|
emits: VvInputTextEvents,
|
|
4513
4811
|
setup(__props, { expose: __expose, emit }) {
|
|
4514
4812
|
const props = __props;
|
|
4515
4813
|
const slots = useSlots();
|
|
4516
|
-
const
|
|
4517
|
-
|
|
4518
|
-
|
|
4814
|
+
const propsDefaults = useDefaults(
|
|
4815
|
+
"VvInputText",
|
|
4816
|
+
VvInputTextProps,
|
|
4817
|
+
props
|
|
4818
|
+
);
|
|
4519
4819
|
const {
|
|
4520
4820
|
id,
|
|
4521
4821
|
icon,
|
|
@@ -4525,39 +4825,131 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4525
4825
|
count,
|
|
4526
4826
|
valid,
|
|
4527
4827
|
invalid,
|
|
4528
|
-
loading
|
|
4828
|
+
loading,
|
|
4829
|
+
debounce,
|
|
4830
|
+
maxlength,
|
|
4831
|
+
minlength,
|
|
4832
|
+
type,
|
|
4833
|
+
iMask,
|
|
4834
|
+
step
|
|
4529
4835
|
} = toRefs(props);
|
|
4530
4836
|
const hasId = useUniqueId(id);
|
|
4531
4837
|
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
4532
4838
|
const inputTextPlaceholder = computed(
|
|
4533
4839
|
() => props.floating && isEmpty(props.placeholder) ? " " : props.placeholder
|
|
4534
4840
|
);
|
|
4535
|
-
const
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4841
|
+
const maskReady = ref(false);
|
|
4842
|
+
const { el, mask, typed, masked, unmasked } = useIMask(
|
|
4843
|
+
computed(
|
|
4844
|
+
() => (iMask == null ? void 0 : iMask.value) ?? {
|
|
4845
|
+
mask: /./
|
|
4846
|
+
}
|
|
4847
|
+
),
|
|
4539
4848
|
{
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4849
|
+
emit,
|
|
4850
|
+
onAccept: () => {
|
|
4851
|
+
if (!maskReady.value) {
|
|
4852
|
+
return;
|
|
4543
4853
|
}
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4854
|
+
emit("update:masked", masked.value);
|
|
4855
|
+
if (type.value === INPUT_TYPES.NUMBER) {
|
|
4856
|
+
if (masked.value === "") {
|
|
4857
|
+
if (localModelValue.value === null || localModelValue.value === void 0) {
|
|
4858
|
+
return;
|
|
4859
|
+
}
|
|
4860
|
+
localModelValue.value = void 0;
|
|
4861
|
+
return;
|
|
4862
|
+
}
|
|
4863
|
+
if (typeof typed.value !== "number") {
|
|
4864
|
+
localModelValue.value = Number(typed.value);
|
|
4865
|
+
return;
|
|
4866
|
+
}
|
|
4867
|
+
localModelValue.value = typed.value;
|
|
4868
|
+
return;
|
|
4869
|
+
}
|
|
4870
|
+
if (type.value === INPUT_TYPES.DATE) {
|
|
4871
|
+
if (el.value instanceof HTMLInputElement && el.value.type === "date") {
|
|
4872
|
+
localModelValue.value = el.value.value;
|
|
4873
|
+
return;
|
|
4874
|
+
}
|
|
4875
|
+
let date = typed.value;
|
|
4876
|
+
if (date === null || date === "") {
|
|
4877
|
+
if (!localModelValue.value) {
|
|
4878
|
+
return;
|
|
4879
|
+
}
|
|
4880
|
+
localModelValue.value = "";
|
|
4881
|
+
return;
|
|
4882
|
+
}
|
|
4883
|
+
if (!(date instanceof Date)) {
|
|
4884
|
+
date = new Date(date);
|
|
4885
|
+
}
|
|
4886
|
+
localModelValue.value = `${date.getFullYear()}-${("0" + (date.getMonth() + 1)).slice(-2)}-${("0" + date.getDate()).slice(-2)}`;
|
|
4887
|
+
return;
|
|
4888
|
+
}
|
|
4889
|
+
if (type.value === INPUT_TYPES.DATETIME_LOCAL) {
|
|
4890
|
+
if (el.value instanceof HTMLInputElement && el.value.type === "datetime-local") {
|
|
4891
|
+
localModelValue.value = el.value.value;
|
|
4892
|
+
return;
|
|
4893
|
+
}
|
|
4894
|
+
let date = typed.value;
|
|
4895
|
+
if (date === null || date === "") {
|
|
4896
|
+
if (!localModelValue.value) {
|
|
4897
|
+
return;
|
|
4898
|
+
}
|
|
4899
|
+
localModelValue.value = "";
|
|
4900
|
+
return;
|
|
4901
|
+
}
|
|
4902
|
+
if (!(typed.value instanceof Date)) {
|
|
4903
|
+
date = new Date(date);
|
|
4904
|
+
}
|
|
4905
|
+
localModelValue.value = `${date.getFullYear()}-${("0" + (date.getMonth() + 1)).slice(-2)}-${("0" + date.getDate()).slice(-2)}T${("0" + date.getHours()).slice(-2)}:${("0" + date.getMinutes()).slice(-2)}`;
|
|
4906
|
+
return;
|
|
4549
4907
|
}
|
|
4550
|
-
if (
|
|
4551
|
-
return
|
|
4908
|
+
if (!localModelValue.value && !unmasked.value) {
|
|
4909
|
+
return;
|
|
4552
4910
|
}
|
|
4553
|
-
|
|
4911
|
+
localModelValue.value = unmasked.value;
|
|
4912
|
+
}
|
|
4913
|
+
}
|
|
4914
|
+
);
|
|
4915
|
+
onMounted(() => {
|
|
4916
|
+
if (mask.value) {
|
|
4917
|
+
maskReady.value = true;
|
|
4918
|
+
typed.value = localModelValue.value ?? "";
|
|
4919
|
+
}
|
|
4920
|
+
});
|
|
4921
|
+
watch(
|
|
4922
|
+
() => props.modelValue,
|
|
4923
|
+
(newValue) => {
|
|
4924
|
+
var _a;
|
|
4925
|
+
if (mask.value) {
|
|
4926
|
+
typed.value = newValue && ((_a = iMask == null ? void 0 : iMask.value) == null ? void 0 : _a.mask) === Date ? new Date(newValue) : newValue ?? "";
|
|
4554
4927
|
}
|
|
4555
4928
|
}
|
|
4556
4929
|
);
|
|
4930
|
+
watch(
|
|
4931
|
+
() => props.masked,
|
|
4932
|
+
(newValue) => {
|
|
4933
|
+
masked.value = newValue ?? "";
|
|
4934
|
+
}
|
|
4935
|
+
);
|
|
4936
|
+
const inputEl = el;
|
|
4937
|
+
const innerEl = ref();
|
|
4938
|
+
__expose({ $inner: innerEl });
|
|
4939
|
+
const localModelValue = useDebouncedInput(
|
|
4940
|
+
modelValue,
|
|
4941
|
+
emit,
|
|
4942
|
+
(debounce == null ? void 0 : debounce.value) ?? 0
|
|
4943
|
+
);
|
|
4557
4944
|
const { focused } = useComponentFocus(inputEl, emit);
|
|
4558
4945
|
const isFocused = computed(
|
|
4559
4946
|
() => focused.value && !props.disabled && !props.readonly
|
|
4560
4947
|
);
|
|
4948
|
+
watch(isFocused, (newValue) => {
|
|
4949
|
+
if (newValue && propsDefaults.value.selectOnFocus && inputEl.value) {
|
|
4950
|
+
inputEl.value.select();
|
|
4951
|
+
}
|
|
4952
|
+
});
|
|
4561
4953
|
const isVisible = useElementVisibility(inputEl);
|
|
4562
4954
|
watch(isVisible, (newValue) => {
|
|
4563
4955
|
if (newValue && props.autofocus && !props.disabled && !props.readonly) {
|
|
@@ -4575,19 +4967,27 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4575
4967
|
const isNumber = computed(() => props.type === INPUT_TYPES.NUMBER);
|
|
4576
4968
|
const onStepUp = () => {
|
|
4577
4969
|
if (isClickable.value) {
|
|
4970
|
+
if (iMask == null ? void 0 : iMask.value) {
|
|
4971
|
+
typed.value = typed.value + Number((step == null ? void 0 : step.value) ?? 1);
|
|
4972
|
+
return;
|
|
4973
|
+
}
|
|
4578
4974
|
inputEl.value.stepUp();
|
|
4579
4975
|
localModelValue.value = unref(inputEl).value;
|
|
4580
4976
|
}
|
|
4581
4977
|
};
|
|
4582
4978
|
const onStepDown = () => {
|
|
4583
4979
|
if (isClickable.value) {
|
|
4980
|
+
if (iMask == null ? void 0 : iMask.value) {
|
|
4981
|
+
typed.value = typed.value - Number((step == null ? void 0 : step.value) ?? 1);
|
|
4982
|
+
return;
|
|
4983
|
+
}
|
|
4584
4984
|
inputEl.value.stepDown();
|
|
4585
4985
|
localModelValue.value = unref(inputEl).value;
|
|
4586
4986
|
}
|
|
4587
4987
|
};
|
|
4588
4988
|
const isSearch = computed(() => props.type === INPUT_TYPES.SEARCH);
|
|
4589
4989
|
const onClear = () => {
|
|
4590
|
-
localModelValue.value =
|
|
4990
|
+
localModelValue.value = "";
|
|
4591
4991
|
};
|
|
4592
4992
|
const { hasIcon, hasIconBefore, hasIconAfter } = useComponentIcon(
|
|
4593
4993
|
icon,
|
|
@@ -4609,9 +5009,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4609
5009
|
}
|
|
4610
5010
|
});
|
|
4611
5011
|
const { formatted: countFormatted } = useTextCount(localModelValue, {
|
|
4612
|
-
mode:
|
|
4613
|
-
upperLimit: Number(
|
|
4614
|
-
lowerLimit: Number(
|
|
5012
|
+
mode: count.value,
|
|
5013
|
+
upperLimit: Number(maxlength == null ? void 0 : maxlength.value),
|
|
5014
|
+
lowerLimit: Number(minlength == null ? void 0 : minlength.value)
|
|
4615
5015
|
});
|
|
4616
5016
|
const isClickable = computed(() => !props.disabled && !props.readonly);
|
|
4617
5017
|
const hasTabindex = computed(
|
|
@@ -4646,17 +5046,20 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4646
5046
|
}))
|
|
4647
5047
|
);
|
|
4648
5048
|
const hasAttrs = computed(() => {
|
|
4649
|
-
const
|
|
5049
|
+
const type2 = (() => {
|
|
4650
5050
|
if (isPassword.value && showPassword.value) {
|
|
4651
5051
|
return INPUT_TYPES.TEXT;
|
|
4652
5052
|
}
|
|
4653
5053
|
if (isDateTime.value && !isDirty.value && !focused.value) {
|
|
4654
5054
|
return INPUT_TYPES.TEXT;
|
|
4655
5055
|
}
|
|
5056
|
+
if (iMask == null ? void 0 : iMask.value) {
|
|
5057
|
+
return INPUT_TYPES.TEXT;
|
|
5058
|
+
}
|
|
4656
5059
|
return props.type;
|
|
4657
5060
|
})();
|
|
4658
5061
|
const toReturn = {
|
|
4659
|
-
type,
|
|
5062
|
+
type: type2,
|
|
4660
5063
|
name: props.name,
|
|
4661
5064
|
tabindex: hasTabindex.value,
|
|
4662
5065
|
disabled: props.disabled,
|
|
@@ -4667,20 +5070,20 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4667
5070
|
"aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
|
|
4668
5071
|
"aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
|
|
4669
5072
|
};
|
|
4670
|
-
if (
|
|
5073
|
+
if (type2 === INPUT_TYPES.DATE || type2 === INPUT_TYPES.MONTH || type2 === INPUT_TYPES.WEEK || type2 === INPUT_TYPES.TIME || type2 === INPUT_TYPES.DATETIME_LOCAL || type2 === INPUT_TYPES.NUMBER) {
|
|
4671
5074
|
toReturn.step = props.step;
|
|
4672
5075
|
toReturn.max = props.max !== void 0 ? String(props.max) : void 0;
|
|
4673
5076
|
toReturn.min = props.min !== void 0 ? String(props.min) : void 0;
|
|
4674
5077
|
}
|
|
4675
|
-
if (
|
|
5078
|
+
if (type2 === INPUT_TYPES.TEXT || type2 === INPUT_TYPES.SEARCH || type2 === INPUT_TYPES.URL || type2 === INPUT_TYPES.TEL || type2 === INPUT_TYPES.EMAIL || type2 === INPUT_TYPES.PASSWORD || type2 === INPUT_TYPES.NUMBER) {
|
|
4676
5079
|
toReturn.placeholder = inputTextPlaceholder.value;
|
|
4677
5080
|
}
|
|
4678
|
-
if (
|
|
5081
|
+
if (type2 === INPUT_TYPES.TEXT || type2 === INPUT_TYPES.SEARCH || type2 === INPUT_TYPES.URL || type2 === INPUT_TYPES.TEL || type2 === INPUT_TYPES.EMAIL || type2 === INPUT_TYPES.PASSWORD) {
|
|
4679
5082
|
toReturn.minlength = props.minlength;
|
|
4680
5083
|
toReturn.maxlength = props.maxlength;
|
|
4681
5084
|
toReturn.pattern = props.pattern;
|
|
4682
5085
|
}
|
|
4683
|
-
if (
|
|
5086
|
+
if (type2 === INPUT_TYPES.EMAIL) {
|
|
4684
5087
|
toReturn.multiple = props.multiple;
|
|
4685
5088
|
}
|
|
4686
5089
|
return toReturn;
|
|
@@ -4699,7 +5102,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4699
5102
|
hasHintLabelOrSlot,
|
|
4700
5103
|
hasInvalidLabelOrSlot,
|
|
4701
5104
|
hintSlotScope
|
|
4702
|
-
} = HintSlotFactory(
|
|
5105
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
4703
5106
|
const PasswordInputActions = VvInputTextActionsFactory(
|
|
4704
5107
|
INPUT_TYPES.PASSWORD,
|
|
4705
5108
|
props
|
|
@@ -4712,31 +5115,6 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4712
5115
|
INPUT_TYPES.SEARCH,
|
|
4713
5116
|
props
|
|
4714
5117
|
);
|
|
4715
|
-
const mask = ref();
|
|
4716
|
-
watch(
|
|
4717
|
-
[
|
|
4718
|
-
() => props.mask,
|
|
4719
|
-
() => props.type,
|
|
4720
|
-
() => props.maskEager,
|
|
4721
|
-
() => props.maskReversed,
|
|
4722
|
-
() => props.maskTokens,
|
|
4723
|
-
() => props.maskTokensReplace
|
|
4724
|
-
],
|
|
4725
|
-
([newMask, newType, eager, reversed, tokens, tokensReplace]) => {
|
|
4726
|
-
if (newMask && newType === INPUT_TYPES.TEXT) {
|
|
4727
|
-
mask.value = new Mask({
|
|
4728
|
-
mask: newMask,
|
|
4729
|
-
eager,
|
|
4730
|
-
reversed,
|
|
4731
|
-
tokens,
|
|
4732
|
-
tokensReplace
|
|
4733
|
-
});
|
|
4734
|
-
return;
|
|
4735
|
-
}
|
|
4736
|
-
mask.value = void 0;
|
|
4737
|
-
},
|
|
4738
|
-
{ immediate: true }
|
|
4739
|
-
);
|
|
4740
5118
|
const onClickInner = () => {
|
|
4741
5119
|
if (isClickable.value) {
|
|
4742
5120
|
focused.value = true;
|
|
@@ -4750,6 +5128,23 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4750
5128
|
width: localModelValue.value !== void 0 ? `${String(localModelValue.value).length + 1}ch` : void 0
|
|
4751
5129
|
};
|
|
4752
5130
|
});
|
|
5131
|
+
const onKeyDown = (event) => {
|
|
5132
|
+
switch (event.code) {
|
|
5133
|
+
case "ArrowUp":
|
|
5134
|
+
if (isNumber.value) {
|
|
5135
|
+
onStepUp();
|
|
5136
|
+
event.preventDefault();
|
|
5137
|
+
}
|
|
5138
|
+
break;
|
|
5139
|
+
case "ArrowDown":
|
|
5140
|
+
if (isNumber.value) {
|
|
5141
|
+
onStepDown();
|
|
5142
|
+
event.preventDefault();
|
|
5143
|
+
}
|
|
5144
|
+
break;
|
|
5145
|
+
}
|
|
5146
|
+
emit("keydown", event);
|
|
5147
|
+
};
|
|
4753
5148
|
return (_ctx, _cache) => {
|
|
4754
5149
|
return openBlock(), createElementBlock("div", {
|
|
4755
5150
|
class: normalizeClass(unref(bemCssClasses))
|
|
@@ -4758,7 +5153,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4758
5153
|
key: 0,
|
|
4759
5154
|
for: unref(hasId),
|
|
4760
5155
|
class: "vv-input-text__label"
|
|
4761
|
-
}, toDisplayString(unref(label)), 9, _hoisted_1$
|
|
5156
|
+
}, toDisplayString(unref(label)), 9, _hoisted_1$5)) : createCommentVNode("", true),
|
|
4762
5157
|
createElementVNode("div", _hoisted_2$3, [
|
|
4763
5158
|
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
4764
5159
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
@@ -4769,28 +5164,27 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4769
5164
|
class: "vv-input-text__inner",
|
|
4770
5165
|
onClick: withModifiers(onClickInner, ["stop"])
|
|
4771
5166
|
}, [
|
|
4772
|
-
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$
|
|
5167
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
4773
5168
|
key: 0,
|
|
4774
5169
|
class: "vv-input-text__icon"
|
|
4775
5170
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
4776
|
-
|
|
5171
|
+
createElementVNode("input", mergeProps({
|
|
4777
5172
|
id: unref(hasId),
|
|
4778
5173
|
ref_key: "inputEl",
|
|
4779
|
-
ref: inputEl
|
|
4780
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(localModelValue) ? localModelValue.value = $event : null)
|
|
5174
|
+
ref: inputEl
|
|
4781
5175
|
}, unref(hasAttrs), {
|
|
4782
5176
|
style: unref(hasStyle),
|
|
4783
|
-
onKeyup: _cache[
|
|
4784
|
-
|
|
4785
|
-
[
|
|
4786
|
-
|
|
5177
|
+
onKeyup: _cache[0] || (_cache[0] = ($event) => emit("keyup", $event)),
|
|
5178
|
+
onKeydown: onKeyDown,
|
|
5179
|
+
onKeypress: _cache[1] || (_cache[1] = ($event) => emit("keypress", $event))
|
|
5180
|
+
}), null, 16, _hoisted_5$1),
|
|
4787
5181
|
(_ctx.unit || _ctx.$slots.unit) && unref(isDirty) ? (openBlock(), createElementBlock("div", _hoisted_6$1, [
|
|
4788
5182
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
|
|
4789
5183
|
createTextVNode(toDisplayString(_ctx.unit), 1)
|
|
4790
5184
|
])
|
|
4791
5185
|
])) : createCommentVNode("", true)
|
|
4792
5186
|
], 8, _hoisted_4$1),
|
|
4793
|
-
unref(hasIconAfter) || unref(defaultAfterIcon) ? (openBlock(), createBlock(_sfc_main$
|
|
5187
|
+
unref(hasIconAfter) || unref(defaultAfterIcon) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
4794
5188
|
key: 1,
|
|
4795
5189
|
class: "vv-input-text__icon vv-input-text__icon-after"
|
|
4796
5190
|
}, unref(hasIconAfter) ? unref(hasIcon) : unref(defaultAfterIcon)), null, 16)) : unref(isPassword) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(PasswordInputActions), {
|
|
@@ -4850,6 +5244,79 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4850
5244
|
};
|
|
4851
5245
|
}
|
|
4852
5246
|
});
|
|
5247
|
+
const VvNavProps = {
|
|
5248
|
+
...ModifiersProps,
|
|
5249
|
+
items: {
|
|
5250
|
+
type: Array,
|
|
5251
|
+
required: true,
|
|
5252
|
+
default: () => []
|
|
5253
|
+
}
|
|
5254
|
+
};
|
|
5255
|
+
const VvNavEvents = ["click"];
|
|
5256
|
+
const _hoisted_1$4 = {
|
|
5257
|
+
class: "vv-nav__menu",
|
|
5258
|
+
role: "menu",
|
|
5259
|
+
"aria-busy": "true"
|
|
5260
|
+
};
|
|
5261
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
5262
|
+
__name: "VvNav",
|
|
5263
|
+
props: VvNavProps,
|
|
5264
|
+
emits: VvNavEvents,
|
|
5265
|
+
setup(__props, { emit }) {
|
|
5266
|
+
const props = __props;
|
|
5267
|
+
const { modifiers, items } = toRefs(props);
|
|
5268
|
+
const activeItem = ref(null);
|
|
5269
|
+
const bemCssClasses = useModifiers("vv-nav", modifiers);
|
|
5270
|
+
const localItems = computed(() => {
|
|
5271
|
+
return items.value.map((item, index) => {
|
|
5272
|
+
return {
|
|
5273
|
+
...item,
|
|
5274
|
+
id: item.id || `nav-item_${index}`
|
|
5275
|
+
};
|
|
5276
|
+
});
|
|
5277
|
+
});
|
|
5278
|
+
function onClick(item) {
|
|
5279
|
+
if (!item.disabled) {
|
|
5280
|
+
emit("click", item);
|
|
5281
|
+
activeItem.value = item.id;
|
|
5282
|
+
}
|
|
5283
|
+
}
|
|
5284
|
+
return (_ctx, _cache) => {
|
|
5285
|
+
return openBlock(), createElementBlock("nav", {
|
|
5286
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
5287
|
+
}, [
|
|
5288
|
+
createElementVNode("ul", _hoisted_1$4, [
|
|
5289
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(localItems), (navItem) => {
|
|
5290
|
+
return openBlock(), createElementBlock("li", {
|
|
5291
|
+
key: navItem.id,
|
|
5292
|
+
class: "vv-nav__item",
|
|
5293
|
+
role: "presentation"
|
|
5294
|
+
}, [
|
|
5295
|
+
createVNode(_sfc_main$o, mergeProps({
|
|
5296
|
+
disabled: navItem.disabled,
|
|
5297
|
+
to: navItem.to,
|
|
5298
|
+
href: navItem.href,
|
|
5299
|
+
tabindex: 0
|
|
5300
|
+
}, {
|
|
5301
|
+
class: [{
|
|
5302
|
+
current: unref(activeItem) == navItem.id,
|
|
5303
|
+
disabled: navItem.disabled
|
|
5304
|
+
}, "vv-nav__item-label"]
|
|
5305
|
+
}, toHandlers(navItem.on), {
|
|
5306
|
+
onClick: ($event) => onClick(navItem)
|
|
5307
|
+
}), {
|
|
5308
|
+
default: withCtx(() => [
|
|
5309
|
+
createTextVNode(toDisplayString(navItem.title), 1)
|
|
5310
|
+
]),
|
|
5311
|
+
_: 2
|
|
5312
|
+
}, 1040, ["class", "onClick"])
|
|
5313
|
+
]);
|
|
5314
|
+
}), 128))
|
|
5315
|
+
])
|
|
5316
|
+
], 2);
|
|
5317
|
+
};
|
|
5318
|
+
}
|
|
5319
|
+
});
|
|
4853
5320
|
const VvProgressProps = {
|
|
4854
5321
|
...ModifiersProps,
|
|
4855
5322
|
/**
|
|
@@ -4883,7 +5350,7 @@ const VvProgressProps = {
|
|
|
4883
5350
|
const __default__$3 = {
|
|
4884
5351
|
name: "VvProgress"
|
|
4885
5352
|
};
|
|
4886
|
-
const _sfc_main$
|
|
5353
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
4887
5354
|
...__default__$3,
|
|
4888
5355
|
props: VvProgressProps,
|
|
4889
5356
|
setup(__props) {
|
|
@@ -4939,18 +5406,23 @@ function useGroupProps(props, emit) {
|
|
|
4939
5406
|
disabled
|
|
4940
5407
|
};
|
|
4941
5408
|
}
|
|
4942
|
-
const _hoisted_1$
|
|
5409
|
+
const _hoisted_1$3 = ["for"];
|
|
4943
5410
|
const _hoisted_2$2 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid", "aria-describedby", "aria-errormessage"];
|
|
4944
5411
|
const __default__$2 = {
|
|
4945
5412
|
name: "VvRadio"
|
|
4946
5413
|
};
|
|
4947
|
-
const _sfc_main$
|
|
5414
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
4948
5415
|
...__default__$2,
|
|
4949
5416
|
props: VvRadioProps,
|
|
4950
5417
|
emits: VvRadioEvents,
|
|
4951
5418
|
setup(__props, { emit }) {
|
|
4952
5419
|
const props = __props;
|
|
4953
5420
|
const slots = useSlots();
|
|
5421
|
+
const propsDefaults = useDefaults(
|
|
5422
|
+
"VvRadio",
|
|
5423
|
+
VvRadioProps,
|
|
5424
|
+
props
|
|
5425
|
+
);
|
|
4954
5426
|
const { id, disabled, readonly, modelValue, valid, invalid } = useGroupProps(props, emit);
|
|
4955
5427
|
const hasId = useUniqueId(id);
|
|
4956
5428
|
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
@@ -5001,7 +5473,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
5001
5473
|
hasHintLabelOrSlot,
|
|
5002
5474
|
hasInvalidLabelOrSlot,
|
|
5003
5475
|
hintSlotScope
|
|
5004
|
-
} = HintSlotFactory(
|
|
5476
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
5005
5477
|
return (_ctx, _cache) => {
|
|
5006
5478
|
return openBlock(), createElementBlock("label", {
|
|
5007
5479
|
class: normalizeClass(unref(bemCssClasses)),
|
|
@@ -5060,24 +5532,29 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
5060
5532
|
key: "3"
|
|
5061
5533
|
} : void 0
|
|
5062
5534
|
]), 1032, ["id"])
|
|
5063
|
-
], 10, _hoisted_1$
|
|
5535
|
+
], 10, _hoisted_1$3);
|
|
5064
5536
|
};
|
|
5065
5537
|
}
|
|
5066
5538
|
});
|
|
5067
5539
|
const VvRadioGroupProps = CheckboxRadioGroupProps;
|
|
5068
5540
|
const VvRadioGroupEvents = ["update:modelValue", "change"];
|
|
5069
|
-
const _hoisted_1$
|
|
5541
|
+
const _hoisted_1$2 = ["textContent"];
|
|
5070
5542
|
const _hoisted_2$1 = { class: "vv-radio-group__wrapper" };
|
|
5071
5543
|
const __default__$1 = {
|
|
5072
5544
|
name: "VvRadioGroup"
|
|
5073
5545
|
};
|
|
5074
|
-
const _sfc_main$
|
|
5546
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
5075
5547
|
...__default__$1,
|
|
5076
5548
|
props: VvRadioGroupProps,
|
|
5077
5549
|
emits: VvRadioGroupEvents,
|
|
5078
5550
|
setup(__props, { emit }) {
|
|
5079
5551
|
const props = __props;
|
|
5080
5552
|
const slots = useSlots();
|
|
5553
|
+
const propsDefaults = useDefaults(
|
|
5554
|
+
"VvRadioGroup",
|
|
5555
|
+
VvRadioGroupProps,
|
|
5556
|
+
props
|
|
5557
|
+
);
|
|
5081
5558
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
5082
5559
|
const { disabled, readonly, vertical, valid, invalid, modifiers } = toRefs(props);
|
|
5083
5560
|
useProvideGroupState({
|
|
@@ -5108,7 +5585,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
5108
5585
|
value: getOptionValue(option)
|
|
5109
5586
|
};
|
|
5110
5587
|
};
|
|
5111
|
-
const { HintSlot, hintSlotScope } = HintSlotFactory(
|
|
5588
|
+
const { HintSlot, hintSlotScope } = HintSlotFactory(propsDefaults, slots);
|
|
5112
5589
|
return (_ctx, _cache) => {
|
|
5113
5590
|
return openBlock(), createElementBlock("fieldset", {
|
|
5114
5591
|
class: normalizeClass(unref(bemCssClasses))
|
|
@@ -5116,10 +5593,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
5116
5593
|
_ctx.label ? (openBlock(), createElementBlock("legend", {
|
|
5117
5594
|
key: 0,
|
|
5118
5595
|
textContent: toDisplayString(_ctx.label)
|
|
5119
|
-
}, null, 8, _hoisted_1$
|
|
5596
|
+
}, null, 8, _hoisted_1$2)) : createCommentVNode("", true),
|
|
5120
5597
|
createElementVNode("div", _hoisted_2$1, [
|
|
5121
5598
|
_ctx.options.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.options, (option, index) => {
|
|
5122
|
-
return openBlock(), createBlock(_sfc_main$
|
|
5599
|
+
return openBlock(), createBlock(_sfc_main$4, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
|
|
5123
5600
|
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
5124
5601
|
]),
|
|
5125
5602
|
createVNode(unref(HintSlot), { class: "vv-radio-group__hint" }, createSlots({ _: 2 }, [
|
|
@@ -5156,6 +5633,61 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
5156
5633
|
};
|
|
5157
5634
|
}
|
|
5158
5635
|
});
|
|
5636
|
+
const VvTabProps = {
|
|
5637
|
+
...ModifiersProps,
|
|
5638
|
+
items: {
|
|
5639
|
+
type: Array,
|
|
5640
|
+
required: true,
|
|
5641
|
+
default: () => []
|
|
5642
|
+
}
|
|
5643
|
+
};
|
|
5644
|
+
const VvTabEvents = ["click"];
|
|
5645
|
+
const _hoisted_1$1 = ["id"];
|
|
5646
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
5647
|
+
__name: "VvTab",
|
|
5648
|
+
props: VvTabProps,
|
|
5649
|
+
emits: VvTabEvents,
|
|
5650
|
+
setup(__props, { emit }) {
|
|
5651
|
+
const props = __props;
|
|
5652
|
+
const { modifiers, items } = toRefs(props);
|
|
5653
|
+
const activeTab = ref(null);
|
|
5654
|
+
const bemCssClasses = useModifiers("vv-tab", modifiers);
|
|
5655
|
+
const localItems = computed(() => {
|
|
5656
|
+
return items.value.map((item, index) => {
|
|
5657
|
+
return {
|
|
5658
|
+
...item,
|
|
5659
|
+
id: item.id || `tab-item_${index}`
|
|
5660
|
+
};
|
|
5661
|
+
});
|
|
5662
|
+
});
|
|
5663
|
+
function onClick(item) {
|
|
5664
|
+
if (!item.disabled) {
|
|
5665
|
+
emit("click", item);
|
|
5666
|
+
activeTab.value = item.id;
|
|
5667
|
+
}
|
|
5668
|
+
}
|
|
5669
|
+
return (_ctx, _cache) => {
|
|
5670
|
+
return openBlock(), createElementBlock("div", {
|
|
5671
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
5672
|
+
}, [
|
|
5673
|
+
createVNode(_sfc_main$6, {
|
|
5674
|
+
items: unref(localItems),
|
|
5675
|
+
modifiers: "tabs full",
|
|
5676
|
+
onClick
|
|
5677
|
+
}, null, 8, ["items"]),
|
|
5678
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(localItems), (item) => {
|
|
5679
|
+
return openBlock(), createElementBlock("article", {
|
|
5680
|
+
id: item.id,
|
|
5681
|
+
key: item.id,
|
|
5682
|
+
class: normalizeClass([{ target: unref(activeTab) === item.id }, "vv-tab__panel"])
|
|
5683
|
+
}, [
|
|
5684
|
+
renderSlot(_ctx.$slots, `${item.id}`)
|
|
5685
|
+
], 10, _hoisted_1$1);
|
|
5686
|
+
}), 128))
|
|
5687
|
+
], 2);
|
|
5688
|
+
};
|
|
5689
|
+
}
|
|
5690
|
+
});
|
|
5159
5691
|
const WRAP = {
|
|
5160
5692
|
hard: "hard",
|
|
5161
5693
|
soft: "soft"
|
|
@@ -5217,13 +5749,18 @@ const _hoisted_7 = {
|
|
|
5217
5749
|
const __default__ = {
|
|
5218
5750
|
name: "VvTextarea"
|
|
5219
5751
|
};
|
|
5220
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5752
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
5221
5753
|
...__default__,
|
|
5222
5754
|
props: VvTextareaProps,
|
|
5223
5755
|
emits: VvTextareaEvents,
|
|
5224
5756
|
setup(__props, { emit }) {
|
|
5225
5757
|
const props = __props;
|
|
5226
5758
|
const slots = useSlots();
|
|
5759
|
+
const propsDefaults = useDefaults(
|
|
5760
|
+
"VvTextarea",
|
|
5761
|
+
VvTextareaProps,
|
|
5762
|
+
props
|
|
5763
|
+
);
|
|
5227
5764
|
const textarea = ref();
|
|
5228
5765
|
const {
|
|
5229
5766
|
id,
|
|
@@ -5235,14 +5772,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
5235
5772
|
valid,
|
|
5236
5773
|
invalid,
|
|
5237
5774
|
loading,
|
|
5238
|
-
modifiers
|
|
5775
|
+
modifiers,
|
|
5776
|
+
debounce,
|
|
5777
|
+
minlength,
|
|
5778
|
+
maxlength
|
|
5239
5779
|
} = toRefs(props);
|
|
5240
5780
|
const hasId = useUniqueId(id);
|
|
5241
5781
|
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
5242
5782
|
const hasPlaceholder = computed(
|
|
5243
5783
|
() => props.floating && isEmpty(props.placeholder) ? " " : props.placeholder
|
|
5244
5784
|
);
|
|
5245
|
-
const localModelValue = useDebouncedInput(modelValue, emit,
|
|
5785
|
+
const localModelValue = useDebouncedInput(modelValue, emit, debounce == null ? void 0 : debounce.value);
|
|
5246
5786
|
const { hasIcon, hasIconBefore, hasIconAfter } = useComponentIcon(
|
|
5247
5787
|
icon,
|
|
5248
5788
|
iconPosition
|
|
@@ -5255,9 +5795,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
5255
5795
|
}
|
|
5256
5796
|
});
|
|
5257
5797
|
const { formatted: countFormatted } = useTextCount(localModelValue, {
|
|
5258
|
-
mode:
|
|
5259
|
-
upperLimit: Number(
|
|
5260
|
-
lowerLimit: Number(
|
|
5798
|
+
mode: count == null ? void 0 : count.value,
|
|
5799
|
+
upperLimit: Number(maxlength == null ? void 0 : maxlength.value),
|
|
5800
|
+
lowerLimit: Number(minlength == null ? void 0 : minlength.value)
|
|
5261
5801
|
});
|
|
5262
5802
|
const isClickable = computed(() => !props.disabled && !props.readonly);
|
|
5263
5803
|
const hasTabindex = computed(
|
|
@@ -5278,7 +5818,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
5278
5818
|
hasHintLabelOrSlot,
|
|
5279
5819
|
hasInvalidLabelOrSlot,
|
|
5280
5820
|
hintSlotScope
|
|
5281
|
-
} = HintSlotFactory(
|
|
5821
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
5282
5822
|
const bemCssClasses = useModifiers(
|
|
5283
5823
|
"vv-textarea",
|
|
5284
5824
|
modifiers,
|
|
@@ -5342,7 +5882,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
5342
5882
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
5343
5883
|
])) : createCommentVNode("", true),
|
|
5344
5884
|
createElementVNode("div", _hoisted_4, [
|
|
5345
|
-
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$
|
|
5885
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
5346
5886
|
key: 0,
|
|
5347
5887
|
class: "vv-textarea__icon"
|
|
5348
5888
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
@@ -5356,7 +5896,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
5356
5896
|
}), null, 16, _hoisted_5), [
|
|
5357
5897
|
[vModelText, unref(localModelValue)]
|
|
5358
5898
|
]),
|
|
5359
|
-
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$
|
|
5899
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
5360
5900
|
key: 1,
|
|
5361
5901
|
class: "vv-textarea__icon vv-textarea__icon-after"
|
|
5362
5902
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
@@ -5407,24 +5947,69 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
5407
5947
|
};
|
|
5408
5948
|
}
|
|
5409
5949
|
});
|
|
5950
|
+
const VvTooltipProps = {
|
|
5951
|
+
...ModifiersProps,
|
|
5952
|
+
/**
|
|
5953
|
+
* Define the tooltip position
|
|
5954
|
+
* @default Side.bottom
|
|
5955
|
+
*/
|
|
5956
|
+
position: {
|
|
5957
|
+
type: String,
|
|
5958
|
+
default: Side.bottom
|
|
5959
|
+
},
|
|
5960
|
+
value: {
|
|
5961
|
+
type: String
|
|
5962
|
+
}
|
|
5963
|
+
};
|
|
5964
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5965
|
+
__name: "VvTooltip",
|
|
5966
|
+
props: VvTooltipProps,
|
|
5967
|
+
setup(__props) {
|
|
5968
|
+
const props = __props;
|
|
5969
|
+
const { modifiers } = toRefs(props);
|
|
5970
|
+
const bemCssClasses = useModifiers(
|
|
5971
|
+
"vv-tooltip",
|
|
5972
|
+
modifiers,
|
|
5973
|
+
computed(() => ({
|
|
5974
|
+
[props.position]: true
|
|
5975
|
+
}))
|
|
5976
|
+
);
|
|
5977
|
+
return (_ctx, _cache) => {
|
|
5978
|
+
return openBlock(), createElementBlock("span", {
|
|
5979
|
+
class: normalizeClass(unref(bemCssClasses)),
|
|
5980
|
+
role: "tooltip",
|
|
5981
|
+
inert: ""
|
|
5982
|
+
}, [
|
|
5983
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
5984
|
+
createTextVNode(toDisplayString(_ctx.value), 1)
|
|
5985
|
+
])
|
|
5986
|
+
], 2);
|
|
5987
|
+
};
|
|
5988
|
+
}
|
|
5989
|
+
});
|
|
5410
5990
|
export {
|
|
5411
|
-
_sfc_main$
|
|
5412
|
-
_sfc_main$
|
|
5413
|
-
_sfc_main$
|
|
5414
|
-
_sfc_main$
|
|
5415
|
-
_sfc_main$
|
|
5416
|
-
_sfc_main$
|
|
5417
|
-
_sfc_main$
|
|
5418
|
-
_sfc_main$
|
|
5419
|
-
_sfc_main$
|
|
5420
|
-
_sfc_main$
|
|
5421
|
-
_sfc_main$
|
|
5422
|
-
_sfc_main$
|
|
5423
|
-
_sfc_main$
|
|
5424
|
-
_sfc_main$
|
|
5425
|
-
_sfc_main$
|
|
5426
|
-
_sfc_main$
|
|
5427
|
-
_sfc_main$
|
|
5428
|
-
_sfc_main$
|
|
5429
|
-
_sfc_main as
|
|
5991
|
+
_sfc_main$q as VvAccordion,
|
|
5992
|
+
_sfc_main$p as VvAccordionGroup,
|
|
5993
|
+
_sfc_main$o as VvAction,
|
|
5994
|
+
_sfc_main$m as VvAlert,
|
|
5995
|
+
_sfc_main$l as VvBadge,
|
|
5996
|
+
_sfc_main$k as VvBreadcrumb,
|
|
5997
|
+
_sfc_main$j as VvButton,
|
|
5998
|
+
_sfc_main$i as VvButtonGroup,
|
|
5999
|
+
_sfc_main$h as VvCard,
|
|
6000
|
+
_sfc_main$g as VvCheckbox,
|
|
6001
|
+
_sfc_main$f as VvCheckboxGroup,
|
|
6002
|
+
_sfc_main$9 as VvCombobox,
|
|
6003
|
+
_sfc_main$8 as VvDialog,
|
|
6004
|
+
_sfc_main$e as VvDropdown,
|
|
6005
|
+
_sfc_main$n as VvIcon,
|
|
6006
|
+
_sfc_main$7 as VvInputText,
|
|
6007
|
+
_sfc_main$6 as VvNav,
|
|
6008
|
+
_sfc_main$5 as VvProgress,
|
|
6009
|
+
_sfc_main$4 as VvRadio,
|
|
6010
|
+
_sfc_main$3 as VvRadioGroup,
|
|
6011
|
+
_sfc_main$a as VvSelect,
|
|
6012
|
+
_sfc_main$2 as VvTab,
|
|
6013
|
+
_sfc_main$1 as VvTextarea,
|
|
6014
|
+
_sfc_main as VvTooltip
|
|
5430
6015
|
};
|