@volverjs/ui-vue 0.0.9-beta.1 → 0.0.9-beta.11
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/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 +228 -176
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +35 -14
- package/dist/components/VvCombobox/index.d.ts +27 -8
- package/dist/components/VvDialog/VvDialog.es.js +34 -26
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +21 -10
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +4 -11
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +9 -0
- package/dist/components/VvDropdown/index.d.ts +1 -7
- 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 +87 -14
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
- 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 +4 -4
- 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 +87 -14
- 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 +984 -507
- 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 +7 -0
- package/dist/resolvers/unplugin.es.js +3 -0
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +43 -258
- 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/Nav/Nav.settings.d.ts +3 -21
- package/package.json +55 -47
- 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 +30 -15
- package/src/components/VvCombobox/index.ts +24 -0
- package/src/components/VvDialog/VvDialog.vue +16 -17
- package/src/components/VvDropdown/VvDropdown.vue +7 -3
- package/src/components/VvDropdown/index.ts +2 -8
- package/src/components/VvInputText/VvInputText.vue +8 -1
- 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 +8 -1
- 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/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,6 +1,6 @@
|
|
|
1
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, vModelDynamic, 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";
|
|
@@ -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, {});
|
|
1294
|
+
function useInjectedAlertGroup() {
|
|
1295
|
+
return inject(INJECTION_KEY_ALERT_GROUP, {});
|
|
1254
1296
|
}
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
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
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
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
|
+
}
|
|
1368
|
+
};
|
|
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
|
*/
|
|
@@ -2333,13 +2652,7 @@ const VvComboboxProps = {
|
|
|
2333
2652
|
const VvDropdownProps = {
|
|
2334
2653
|
...IdProps,
|
|
2335
2654
|
...DropdownProps,
|
|
2336
|
-
|
|
2337
|
-
* Component BEM modifiers
|
|
2338
|
-
*/
|
|
2339
|
-
modifiers: {
|
|
2340
|
-
type: [String, Array],
|
|
2341
|
-
default: "mobile"
|
|
2342
|
-
},
|
|
2655
|
+
...ModifiersProps,
|
|
2343
2656
|
/**
|
|
2344
2657
|
* Show / hide dropdown programmatically
|
|
2345
2658
|
*/
|
|
@@ -2412,12 +2725,12 @@ function useProvideDropdownAction({
|
|
|
2412
2725
|
expanded
|
|
2413
2726
|
});
|
|
2414
2727
|
}
|
|
2415
|
-
const _hoisted_1$
|
|
2728
|
+
const _hoisted_1$b = ["id", "tabindex", "role", "aria-labelledby"];
|
|
2416
2729
|
const __default__$b = {
|
|
2417
2730
|
name: "VvDropdown",
|
|
2418
2731
|
inheritAttrs: false
|
|
2419
2732
|
};
|
|
2420
|
-
const _sfc_main$
|
|
2733
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
2421
2734
|
...__default__$b,
|
|
2422
2735
|
props: VvDropdownProps,
|
|
2423
2736
|
emits: [
|
|
@@ -2534,7 +2847,11 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2534
2847
|
referenceEl,
|
|
2535
2848
|
floatingEl,
|
|
2536
2849
|
{
|
|
2537
|
-
whileElementsMounted:
|
|
2850
|
+
whileElementsMounted: (...args) => {
|
|
2851
|
+
return autoUpdate(...args, {
|
|
2852
|
+
animationFrame: props.strategy === "fixed"
|
|
2853
|
+
});
|
|
2854
|
+
},
|
|
2538
2855
|
placement: computed(() => props.placement),
|
|
2539
2856
|
strategy: computed(() => props.strategy),
|
|
2540
2857
|
middleware
|
|
@@ -2621,7 +2938,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2621
2938
|
onClickOutside(
|
|
2622
2939
|
floatingEl,
|
|
2623
2940
|
() => {
|
|
2624
|
-
if (!props.keepOpen) {
|
|
2941
|
+
if (!props.keepOpen && expanded.value) {
|
|
2625
2942
|
expanded.value = false;
|
|
2626
2943
|
}
|
|
2627
2944
|
},
|
|
@@ -2659,7 +2976,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2659
2976
|
}
|
|
2660
2977
|
return [
|
|
2661
2978
|
...element.querySelectorAll(
|
|
2662
|
-
'a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'
|
|
2979
|
+
'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
2663
2980
|
)
|
|
2664
2981
|
].filter(
|
|
2665
2982
|
(el) => !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden")
|
|
@@ -2801,7 +3118,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2801
3118
|
renderSlot(_ctx.$slots, "items", normalizeProps(guardReactiveProps({
|
|
2802
3119
|
role: unref(itemRole)
|
|
2803
3120
|
})))
|
|
2804
|
-
], 16, _hoisted_1$
|
|
3121
|
+
], 16, _hoisted_1$b),
|
|
2805
3122
|
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps({ expanded: unref(expanded) })))
|
|
2806
3123
|
], 6), [
|
|
2807
3124
|
[vShow, unref(expanded)]
|
|
@@ -2816,7 +3133,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2816
3133
|
const __default__$a = {
|
|
2817
3134
|
name: "VvDropdownItem"
|
|
2818
3135
|
};
|
|
2819
|
-
const _sfc_main$
|
|
3136
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
2820
3137
|
...__default__$a,
|
|
2821
3138
|
setup(__props) {
|
|
2822
3139
|
const { role, expanded } = useInjectedDropdownItem();
|
|
@@ -2841,11 +3158,11 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
2841
3158
|
};
|
|
2842
3159
|
}
|
|
2843
3160
|
});
|
|
2844
|
-
const _hoisted_1$
|
|
3161
|
+
const _hoisted_1$a = ["title"];
|
|
2845
3162
|
const __default__$9 = {
|
|
2846
3163
|
name: "VvDropdownOption"
|
|
2847
3164
|
};
|
|
2848
|
-
const _sfc_main$
|
|
3165
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
2849
3166
|
...__default__$9,
|
|
2850
3167
|
props: {
|
|
2851
3168
|
...DisabledProps,
|
|
@@ -2883,7 +3200,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
2883
3200
|
}
|
|
2884
3201
|
});
|
|
2885
3202
|
return (_ctx, _cache) => {
|
|
2886
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3203
|
+
return openBlock(), createBlock(_sfc_main$d, {
|
|
2887
3204
|
class: normalizeClass(unref(bemCssClasses)),
|
|
2888
3205
|
tabindex: _ctx.disabled ? -1 : 0,
|
|
2889
3206
|
"aria-selected": _ctx.selected,
|
|
@@ -2898,14 +3215,14 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
2898
3215
|
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps({ disabled: _ctx.disabled, selected: _ctx.selected, unselectable: _ctx.unselectable })), () => [
|
|
2899
3216
|
createTextVNode(toDisplayString(unref(hintLabel)), 1)
|
|
2900
3217
|
])
|
|
2901
|
-
], 8, _hoisted_1$
|
|
3218
|
+
], 8, _hoisted_1$a)
|
|
2902
3219
|
]),
|
|
2903
3220
|
_: 3
|
|
2904
3221
|
}, 8, ["class", "tabindex", "aria-selected", "aria-disabled"]);
|
|
2905
3222
|
};
|
|
2906
3223
|
}
|
|
2907
3224
|
});
|
|
2908
|
-
const _hoisted_1$
|
|
3225
|
+
const _hoisted_1$9 = {
|
|
2909
3226
|
class: "vv-dropdown-optgroup",
|
|
2910
3227
|
role: "presentation",
|
|
2911
3228
|
tabindex: "-1"
|
|
@@ -2913,7 +3230,7 @@ const _hoisted_1$7 = {
|
|
|
2913
3230
|
const __default__$8 = {
|
|
2914
3231
|
name: "VvDropdownOptgroup"
|
|
2915
3232
|
};
|
|
2916
|
-
const _sfc_main$
|
|
3233
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
2917
3234
|
...__default__$8,
|
|
2918
3235
|
props: {
|
|
2919
3236
|
...LabelProps
|
|
@@ -2921,7 +3238,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
2921
3238
|
setup(__props) {
|
|
2922
3239
|
const props = __props;
|
|
2923
3240
|
return (_ctx, _cache) => {
|
|
2924
|
-
return openBlock(), createElementBlock("li", _hoisted_1$
|
|
3241
|
+
return openBlock(), createElementBlock("li", _hoisted_1$9, toDisplayString(props.label), 1);
|
|
2925
3242
|
};
|
|
2926
3243
|
}
|
|
2927
3244
|
});
|
|
@@ -3018,13 +3335,13 @@ function useComponentIcon(icon, iconPosition) {
|
|
|
3018
3335
|
hasIconAfter
|
|
3019
3336
|
};
|
|
3020
3337
|
}
|
|
3021
|
-
const _hoisted_1$
|
|
3338
|
+
const _hoisted_1$8 = ["for"];
|
|
3022
3339
|
const _hoisted_2$6 = { class: "vv-select__wrapper" };
|
|
3023
3340
|
const _hoisted_3$4 = {
|
|
3024
3341
|
key: 0,
|
|
3025
3342
|
class: "vv-select__input-before"
|
|
3026
3343
|
};
|
|
3027
|
-
const _hoisted_4$
|
|
3344
|
+
const _hoisted_4$4 = { class: "vv-select__inner" };
|
|
3028
3345
|
const _hoisted_5$3 = ["id"];
|
|
3029
3346
|
const _hoisted_6$3 = ["disabled", "hidden"];
|
|
3030
3347
|
const _hoisted_7$3 = ["disabled", "value"];
|
|
@@ -3037,20 +3354,25 @@ const _hoisted_10 = {
|
|
|
3037
3354
|
const __default__$7 = {
|
|
3038
3355
|
name: "VvSelect"
|
|
3039
3356
|
};
|
|
3040
|
-
const _sfc_main$
|
|
3357
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
3041
3358
|
...__default__$7,
|
|
3042
3359
|
props: VvSelectProps,
|
|
3043
3360
|
emits: VvSelectEmits,
|
|
3044
3361
|
setup(__props, { emit }) {
|
|
3045
3362
|
const props = __props;
|
|
3046
3363
|
const slots = useSlots();
|
|
3364
|
+
const propsDefaults = useDefaults(
|
|
3365
|
+
"VvSelect",
|
|
3366
|
+
VvSelectProps,
|
|
3367
|
+
props
|
|
3368
|
+
);
|
|
3047
3369
|
const select = ref();
|
|
3048
3370
|
const {
|
|
3049
3371
|
HintSlot,
|
|
3050
3372
|
hasHintLabelOrSlot,
|
|
3051
3373
|
hasInvalidLabelOrSlot,
|
|
3052
3374
|
hintSlotScope
|
|
3053
|
-
} = HintSlotFactory(
|
|
3375
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
3054
3376
|
const {
|
|
3055
3377
|
id,
|
|
3056
3378
|
modifiers,
|
|
@@ -3156,13 +3478,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
3156
3478
|
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
3157
3479
|
key: 0,
|
|
3158
3480
|
for: unref(hasId)
|
|
3159
|
-
}, toDisplayString(_ctx.label), 9, _hoisted_1$
|
|
3481
|
+
}, toDisplayString(_ctx.label), 9, _hoisted_1$8)) : createCommentVNode("", true),
|
|
3160
3482
|
createElementVNode("div", _hoisted_2$6, [
|
|
3161
3483
|
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3$4, [
|
|
3162
3484
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
3163
3485
|
])) : createCommentVNode("", true),
|
|
3164
|
-
createElementVNode("div", _hoisted_4$
|
|
3165
|
-
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$
|
|
3486
|
+
createElementVNode("div", _hoisted_4$4, [
|
|
3487
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
3166
3488
|
key: 0,
|
|
3167
3489
|
class: "vv-select__icon"
|
|
3168
3490
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
@@ -3202,7 +3524,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
3202
3524
|
], 16, _hoisted_5$3), [
|
|
3203
3525
|
[vModelSelect, unref(localModelValue)]
|
|
3204
3526
|
]),
|
|
3205
|
-
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$
|
|
3527
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
3206
3528
|
key: 1,
|
|
3207
3529
|
class: "vv-select__icon vv-select__icon-after"
|
|
3208
3530
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
@@ -3248,63 +3570,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
3248
3570
|
};
|
|
3249
3571
|
}
|
|
3250
3572
|
});
|
|
3251
|
-
|
|
3252
|
-
const volver = useVolver();
|
|
3253
|
-
const volverComponentDefaults = computed(() => {
|
|
3254
|
-
var _a;
|
|
3255
|
-
if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
|
|
3256
|
-
return void 0;
|
|
3257
|
-
}
|
|
3258
|
-
return volver.defaults.value[componentName];
|
|
3259
|
-
});
|
|
3260
|
-
return computed(() => {
|
|
3261
|
-
if (volverComponentDefaults.value === void 0) {
|
|
3262
|
-
return props;
|
|
3263
|
-
}
|
|
3264
|
-
const componentDefaults = volverComponentDefaults.value;
|
|
3265
|
-
const simplifiedPropsDefinition = propsDefinition;
|
|
3266
|
-
const simplifiedProps = props;
|
|
3267
|
-
return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
|
|
3268
|
-
const propValue = simplifiedProps[key];
|
|
3269
|
-
acc[key] = propValue;
|
|
3270
|
-
if (key in componentDefaults) {
|
|
3271
|
-
if (Array.isArray(simplifiedPropsDefinition[key])) {
|
|
3272
|
-
const typeArray = simplifiedPropsDefinition[key];
|
|
3273
|
-
if (typeArray.length) {
|
|
3274
|
-
const typeFunction = typeArray[0];
|
|
3275
|
-
if (typeFunction === propValue) {
|
|
3276
|
-
acc[key] = componentDefaults[key];
|
|
3277
|
-
}
|
|
3278
|
-
}
|
|
3279
|
-
}
|
|
3280
|
-
if (typeof simplifiedPropsDefinition[key] === "function") {
|
|
3281
|
-
const typeFunction = simplifiedPropsDefinition[key];
|
|
3282
|
-
if (typeFunction() === propValue) {
|
|
3283
|
-
acc[key] = componentDefaults[key];
|
|
3284
|
-
}
|
|
3285
|
-
}
|
|
3286
|
-
if (typeof simplifiedPropsDefinition[key] === "object") {
|
|
3287
|
-
let defaultValue = simplifiedPropsDefinition[key].default;
|
|
3288
|
-
if (typeof defaultValue === "function") {
|
|
3289
|
-
defaultValue = defaultValue();
|
|
3290
|
-
}
|
|
3291
|
-
if (typeof defaultValue === "object") {
|
|
3292
|
-
if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
|
|
3293
|
-
acc[key] = componentDefaults[key];
|
|
3294
|
-
}
|
|
3295
|
-
} else if (defaultValue === propValue) {
|
|
3296
|
-
acc[key] = componentDefaults[key];
|
|
3297
|
-
}
|
|
3298
|
-
}
|
|
3299
|
-
}
|
|
3300
|
-
return acc;
|
|
3301
|
-
}, {});
|
|
3302
|
-
});
|
|
3303
|
-
}
|
|
3304
|
-
const _hoisted_1$5 = ["id"];
|
|
3573
|
+
const _hoisted_1$7 = ["id"];
|
|
3305
3574
|
const _hoisted_2$5 = ["id", "for"];
|
|
3306
3575
|
const _hoisted_3$3 = ["id", "aria-controls", "placeholder"];
|
|
3307
|
-
const _hoisted_4$
|
|
3576
|
+
const _hoisted_4$3 = {
|
|
3308
3577
|
key: 0,
|
|
3309
3578
|
class: "vv-select__input-before"
|
|
3310
3579
|
};
|
|
@@ -3322,13 +3591,13 @@ const _hoisted_9 = {
|
|
|
3322
3591
|
const __default__$6 = {
|
|
3323
3592
|
name: "VvCombobox",
|
|
3324
3593
|
components: {
|
|
3325
|
-
VvDropdown: _sfc_main$
|
|
3326
|
-
VvDropdownOption: _sfc_main$
|
|
3327
|
-
VvDropdownOptgroup: _sfc_main$
|
|
3328
|
-
VvButton: _sfc_main$
|
|
3594
|
+
VvDropdown: _sfc_main$e,
|
|
3595
|
+
VvDropdownOption: _sfc_main$c,
|
|
3596
|
+
VvDropdownOptgroup: _sfc_main$b,
|
|
3597
|
+
VvButton: _sfc_main$j
|
|
3329
3598
|
}
|
|
3330
3599
|
};
|
|
3331
|
-
const _sfc_main$
|
|
3600
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
3332
3601
|
...__default__$6,
|
|
3333
3602
|
props: VvComboboxProps,
|
|
3334
3603
|
emits: VvComboboxEvents,
|
|
@@ -3351,7 +3620,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3351
3620
|
hasHintLabelOrSlot,
|
|
3352
3621
|
hasInvalidLabelOrSlot,
|
|
3353
3622
|
hintSlotScope
|
|
3354
|
-
} = HintSlotFactory(
|
|
3623
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
3355
3624
|
const inputEl = ref(null);
|
|
3356
3625
|
const inputSearchEl = ref(null);
|
|
3357
3626
|
const wrapperEl = ref(null);
|
|
@@ -3400,7 +3669,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3400
3669
|
expanded.value = false;
|
|
3401
3670
|
};
|
|
3402
3671
|
const onAfterExpand = () => {
|
|
3403
|
-
if (
|
|
3672
|
+
if (propsDefaults.value.searchable) {
|
|
3404
3673
|
if (inputSearchEl.value) {
|
|
3405
3674
|
inputSearchEl.value.focus({
|
|
3406
3675
|
preventScroll: true
|
|
@@ -3409,7 +3678,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3409
3678
|
}
|
|
3410
3679
|
};
|
|
3411
3680
|
const onAfterCollapse = () => {
|
|
3412
|
-
if (
|
|
3681
|
+
if (propsDefaults.value.searchable) {
|
|
3413
3682
|
searchText.value = "";
|
|
3414
3683
|
}
|
|
3415
3684
|
};
|
|
@@ -3423,14 +3692,15 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3423
3692
|
loading,
|
|
3424
3693
|
valid,
|
|
3425
3694
|
invalid,
|
|
3426
|
-
floating
|
|
3427
|
-
searchable
|
|
3695
|
+
floating
|
|
3428
3696
|
} = toRefs(props);
|
|
3429
3697
|
const hasId = useUniqueId(id);
|
|
3430
3698
|
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
3431
3699
|
const hasDropdownId = computed(() => `${hasId.value}-dropdown`);
|
|
3432
3700
|
const hasSearchId = computed(() => `${hasId.value}-search`);
|
|
3433
3701
|
const hasLabelId = computed(() => `${hasId.value}-label`);
|
|
3702
|
+
const localLoading = ref(false);
|
|
3703
|
+
const isLoading = computed(() => localLoading.value || loading.value);
|
|
3434
3704
|
const dropdownEl = ref();
|
|
3435
3705
|
const { hasIcon, hasIconBefore, hasIconAfter } = useComponentIcon(
|
|
3436
3706
|
icon,
|
|
@@ -3445,7 +3715,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3445
3715
|
modifiers,
|
|
3446
3716
|
computed(() => ({
|
|
3447
3717
|
disabled: disabled.value,
|
|
3448
|
-
loading:
|
|
3718
|
+
loading: isLoading.value,
|
|
3449
3719
|
readonly: readonly.value,
|
|
3450
3720
|
"icon-before": Boolean(hasIconBefore.value),
|
|
3451
3721
|
"icon-after": Boolean(hasIconAfter.value),
|
|
@@ -3463,8 +3733,19 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3463
3733
|
getOptionDisabled,
|
|
3464
3734
|
getOptionGrouped
|
|
3465
3735
|
} = useOptions(props);
|
|
3466
|
-
const filteredOptions =
|
|
3736
|
+
const filteredOptions = computedAsync(async () => {
|
|
3467
3737
|
var _a;
|
|
3738
|
+
if (propsDefaults.value.searchFunction) {
|
|
3739
|
+
localLoading.value = true;
|
|
3740
|
+
const toReturn = await Promise.resolve(
|
|
3741
|
+
propsDefaults.value.searchFunction(
|
|
3742
|
+
debouncedSearchText.value,
|
|
3743
|
+
props.options
|
|
3744
|
+
)
|
|
3745
|
+
);
|
|
3746
|
+
localLoading.value = false;
|
|
3747
|
+
return toReturn;
|
|
3748
|
+
}
|
|
3468
3749
|
return (_a = props.options) == null ? void 0 : _a.filter((option) => {
|
|
3469
3750
|
return getOptionLabel(option).toLowerCase().includes(debouncedSearchText.value.toLowerCase().trim());
|
|
3470
3751
|
});
|
|
@@ -3541,7 +3822,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3541
3822
|
invalid: invalid.value,
|
|
3542
3823
|
invalidLabel: propsDefaults.value.invalidLabel,
|
|
3543
3824
|
hintLabel: propsDefaults.value.hintLabel,
|
|
3544
|
-
loading:
|
|
3825
|
+
loading: isLoading.value,
|
|
3545
3826
|
loadingLabel: propsDefaults.value.loadingLabel,
|
|
3546
3827
|
disabled: disabled.value,
|
|
3547
3828
|
readonly: readonly.value,
|
|
@@ -3569,7 +3850,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3569
3850
|
flip: propsDefaults.value.flip,
|
|
3570
3851
|
autoPlacement: propsDefaults.value.autoPlacement,
|
|
3571
3852
|
arrow: propsDefaults.value.arrow,
|
|
3572
|
-
autofocusFirst:
|
|
3853
|
+
autofocusFirst: propsDefaults.value.searchable ? true : propsDefaults.value.autofocusFirst,
|
|
3573
3854
|
triggerWidth: propsDefaults.value.triggerWidth,
|
|
3574
3855
|
modifiers: propsDefaults.value.dropdownModifiers
|
|
3575
3856
|
}));
|
|
@@ -3601,14 +3882,14 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3601
3882
|
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
3602
3883
|
key: 0,
|
|
3603
3884
|
id: unref(hasLabelId),
|
|
3604
|
-
for: unref(searchable
|
|
3885
|
+
for: unref(propsDefaults).searchable ? unref(hasSearchId) : void 0
|
|
3605
3886
|
}, toDisplayString(_ctx.label), 9, _hoisted_2$5)) : createCommentVNode("", true),
|
|
3606
3887
|
createElementVNode("div", {
|
|
3607
3888
|
ref_key: "wrapperEl",
|
|
3608
3889
|
ref: wrapperEl,
|
|
3609
3890
|
class: "vv-select__wrapper"
|
|
3610
3891
|
}, [
|
|
3611
|
-
createVNode(_sfc_main$
|
|
3892
|
+
createVNode(_sfc_main$e, mergeProps({
|
|
3612
3893
|
ref_key: "dropdownEl",
|
|
3613
3894
|
ref: dropdownEl,
|
|
3614
3895
|
modelValue: unref(expanded),
|
|
@@ -3619,11 +3900,11 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3619
3900
|
onAfterCollapse
|
|
3620
3901
|
}), createSlots({
|
|
3621
3902
|
default: withCtx(({ aria }) => [
|
|
3622
|
-
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
3903
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
3623
3904
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
3624
3905
|
])) : createCommentVNode("", true),
|
|
3625
3906
|
createElementVNode("div", _hoisted_5$2, [
|
|
3626
|
-
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$
|
|
3907
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
3627
3908
|
key: 0,
|
|
3628
3909
|
class: "vv-select__icon"
|
|
3629
3910
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
@@ -3643,7 +3924,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3643
3924
|
renderSlot(_ctx.$slots, "value", normalizeProps(guardReactiveProps({ selectedOptions: unref(selectedOptions), onInput })), () => [
|
|
3644
3925
|
unref(hasValue) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3645
3926
|
!_ctx.badges ? (openBlock(), createElementBlock("div", _hoisted_7$2, toDisplayString(unref(hasValue)), 1)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(selectedOptions), (option, index) => {
|
|
3646
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3927
|
+
return openBlock(), createBlock(_sfc_main$l, {
|
|
3647
3928
|
key: index,
|
|
3648
3929
|
modifiers: _ctx.badgeModifiers,
|
|
3649
3930
|
class: "vv-select__badge"
|
|
@@ -3655,7 +3936,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3655
3936
|
"aria-label": unref(propsDefaults).deselectActionLabel,
|
|
3656
3937
|
onClick: withModifiers(($event) => onInput(option), ["stop"])
|
|
3657
3938
|
}, [
|
|
3658
|
-
createVNode(_sfc_main$
|
|
3939
|
+
createVNode(_sfc_main$n, { name: "close" })
|
|
3659
3940
|
], 8, _hoisted_8$1)) : createCommentVNode("", true)
|
|
3660
3941
|
]),
|
|
3661
3942
|
_: 2
|
|
@@ -3666,7 +3947,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3666
3947
|
], 64))
|
|
3667
3948
|
])
|
|
3668
3949
|
], 16, _hoisted_6$2),
|
|
3669
|
-
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$
|
|
3950
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
3670
3951
|
key: 1,
|
|
3671
3952
|
class: "vv-select__icon vv-select__icon-after"
|
|
3672
3953
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
@@ -3675,107 +3956,110 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3675
3956
|
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
3676
3957
|
])) : createCommentVNode("", true)
|
|
3677
3958
|
]),
|
|
3678
|
-
items: withCtx(() =>
|
|
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
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3959
|
+
items: withCtx(() => {
|
|
3960
|
+
var _a;
|
|
3961
|
+
return [
|
|
3962
|
+
((_a = unref(filteredOptions)) == null ? void 0 : _a.length) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(filteredOptions), (option, index) => {
|
|
3963
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
3964
|
+
isGroup(option) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3965
|
+
createVNode(_sfc_main$b, {
|
|
3966
|
+
label: unref(getOptionLabel)(option)
|
|
3967
|
+
}, null, 8, ["label"]),
|
|
3968
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getOptionGrouped)(
|
|
3969
|
+
option
|
|
3970
|
+
), (item, i) => {
|
|
3971
|
+
return openBlock(), createBlock(_sfc_main$c, mergeProps({
|
|
3972
|
+
disabled: unref(getOptionDisabled)(item),
|
|
3973
|
+
selected: getOptionSelected(item),
|
|
3974
|
+
unselectable: _ctx.unselectable,
|
|
3975
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
3976
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
3977
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
3978
|
+
}, {
|
|
3979
|
+
key: i,
|
|
3980
|
+
class: "vv-dropdown-option",
|
|
3981
|
+
onClickPassive: ($event) => onInput(item)
|
|
3982
|
+
}), {
|
|
3983
|
+
default: withCtx(() => [
|
|
3984
|
+
renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps({
|
|
3985
|
+
option,
|
|
3986
|
+
selectedOptions: unref(selectedOptions),
|
|
3987
|
+
selected: getOptionSelected(item),
|
|
3988
|
+
disabled: unref(getOptionDisabled)(item)
|
|
3989
|
+
})), () => [
|
|
3990
|
+
createTextVNode(toDisplayString(unref(getOptionLabel)(item)), 1)
|
|
3991
|
+
])
|
|
3992
|
+
]),
|
|
3993
|
+
_: 2
|
|
3994
|
+
}, 1040, ["onClickPassive"]);
|
|
3995
|
+
}), 128))
|
|
3996
|
+
], 64)) : (openBlock(), createBlock(_sfc_main$c, mergeProps({ key: 1 }, {
|
|
3997
|
+
disabled: unref(getOptionDisabled)(option),
|
|
3998
|
+
selected: getOptionSelected(option),
|
|
3999
|
+
unselectable: _ctx.unselectable,
|
|
4000
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
4001
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
4002
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
4003
|
+
}, {
|
|
4004
|
+
class: "vv-dropdown-option",
|
|
4005
|
+
onClickPassive: ($event) => onInput(option)
|
|
4006
|
+
}), {
|
|
4007
|
+
default: withCtx(() => [
|
|
4008
|
+
renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps({
|
|
4009
|
+
option,
|
|
4010
|
+
selectedOptions: unref(selectedOptions),
|
|
4011
|
+
selected: getOptionSelected(option),
|
|
4012
|
+
disabled: unref(getOptionDisabled)(option)
|
|
4013
|
+
})), () => [
|
|
4014
|
+
createTextVNode(toDisplayString(unref(getOptionLabel)(option)), 1)
|
|
4015
|
+
])
|
|
4016
|
+
]),
|
|
4017
|
+
_: 2
|
|
4018
|
+
}, 1040, ["onClickPassive"]))
|
|
4019
|
+
], 64);
|
|
4020
|
+
}), 128)) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$c, {
|
|
4021
|
+
key: 1,
|
|
4022
|
+
modifiers: "inert"
|
|
4023
|
+
}, {
|
|
4024
|
+
default: withCtx(() => [
|
|
4025
|
+
renderSlot(_ctx.$slots, "no-options", {}, () => [
|
|
4026
|
+
createTextVNode(toDisplayString(unref(propsDefaults).noOptionsLabel), 1)
|
|
4027
|
+
])
|
|
4028
|
+
]),
|
|
4029
|
+
_: 3
|
|
4030
|
+
})) : (openBlock(), createBlock(_sfc_main$c, {
|
|
4031
|
+
key: 2,
|
|
4032
|
+
modifiers: "inert"
|
|
4033
|
+
}, {
|
|
4034
|
+
default: withCtx(() => [
|
|
4035
|
+
renderSlot(_ctx.$slots, "no-results", {}, () => [
|
|
4036
|
+
createTextVNode(toDisplayString(unref(propsDefaults).noResultsLabel), 1)
|
|
4037
|
+
])
|
|
4038
|
+
]),
|
|
4039
|
+
_: 3
|
|
4040
|
+
}))
|
|
4041
|
+
];
|
|
4042
|
+
}),
|
|
3759
4043
|
after: withCtx(() => [
|
|
3760
4044
|
renderSlot(_ctx.$slots, "dropdown::after", {}, () => {
|
|
3761
4045
|
var _a;
|
|
3762
4046
|
return [
|
|
3763
|
-
((_a = unref(dropdownEl)) == null ? void 0 : _a.customPosition) ? (openBlock(), createBlock(_sfc_main$
|
|
4047
|
+
((_a = unref(dropdownEl)) == null ? void 0 : _a.customPosition) ? (openBlock(), createBlock(_sfc_main$j, {
|
|
3764
4048
|
key: 0,
|
|
3765
|
-
label:
|
|
4049
|
+
label: unref(propsDefaults).closeLabel,
|
|
3766
4050
|
modifiers: "secondary",
|
|
3767
4051
|
onClick: _cache[1] || (_cache[1] = ($event) => unref(dropdownEl).hide())
|
|
3768
|
-
})) : createCommentVNode("", true)
|
|
4052
|
+
}, null, 8, ["label"])) : createCommentVNode("", true)
|
|
3769
4053
|
];
|
|
3770
4054
|
})
|
|
3771
4055
|
]),
|
|
3772
4056
|
_: 2
|
|
3773
4057
|
}, [
|
|
3774
|
-
unref(searchable
|
|
4058
|
+
unref(propsDefaults).searchable || _ctx.$slots["dropdown::before"] ? {
|
|
3775
4059
|
name: "before",
|
|
3776
4060
|
fn: withCtx(() => [
|
|
3777
4061
|
renderSlot(_ctx.$slots, "dropdown::before"),
|
|
3778
|
-
unref(searchable
|
|
4062
|
+
unref(propsDefaults).searchable ? withDirectives((openBlock(), createElementBlock("input", {
|
|
3779
4063
|
key: 0,
|
|
3780
4064
|
id: unref(hasSearchId),
|
|
3781
4065
|
ref_key: "inputSearchEl",
|
|
@@ -3789,7 +4073,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3789
4073
|
class: "vv-dropdown__search",
|
|
3790
4074
|
placeholder: unref(propsDefaults).searchPlaceholder
|
|
3791
4075
|
}, null, 8, _hoisted_3$3)), [
|
|
3792
|
-
[vShow, unref(expanded)],
|
|
3793
4076
|
[vModelText, unref(searchText)]
|
|
3794
4077
|
]) : createCommentVNode("", true)
|
|
3795
4078
|
]),
|
|
@@ -3830,7 +4113,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3830
4113
|
key: "3"
|
|
3831
4114
|
} : void 0
|
|
3832
4115
|
]), 1032, ["id"])
|
|
3833
|
-
], 10, _hoisted_1$
|
|
4116
|
+
], 10, _hoisted_1$7)) : (openBlock(), createBlock(_sfc_main$a, mergeProps({ key: 1 }, unref(selectProps), {
|
|
3834
4117
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => emit("update:modelValue", $event))
|
|
3835
4118
|
}), null, 16));
|
|
3836
4119
|
};
|
|
@@ -3875,35 +4158,36 @@ const VvDialogProps = {
|
|
|
3875
4158
|
*/
|
|
3876
4159
|
keepOpen: { type: Boolean, default: false }
|
|
3877
4160
|
};
|
|
3878
|
-
const _hoisted_1$
|
|
4161
|
+
const _hoisted_1$6 = ["onCancel"];
|
|
4162
|
+
const _hoisted_2$4 = {
|
|
3879
4163
|
key: 0,
|
|
3880
4164
|
class: "vv-dialog__header"
|
|
3881
4165
|
};
|
|
3882
|
-
const
|
|
3883
|
-
const
|
|
4166
|
+
const _hoisted_3$2 = { class: "vv-dialog__content" };
|
|
4167
|
+
const _hoisted_4$2 = {
|
|
3884
4168
|
key: 1,
|
|
3885
4169
|
class: "vv-dialog__footer"
|
|
3886
4170
|
};
|
|
3887
4171
|
const __default__$5 = {
|
|
3888
4172
|
name: "VvDialog"
|
|
3889
4173
|
};
|
|
3890
|
-
const _sfc_main$
|
|
4174
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
3891
4175
|
...__default__$5,
|
|
3892
4176
|
props: VvDialogProps,
|
|
3893
4177
|
emits: VvDialogEvents,
|
|
3894
4178
|
setup(__props, { expose: __expose, emit }) {
|
|
3895
4179
|
const props = __props;
|
|
3896
4180
|
const dialogEl = ref();
|
|
4181
|
+
const modelValue = useVModel(props, "modelValue", emit);
|
|
3897
4182
|
const localModelValue = ref(false);
|
|
3898
|
-
const
|
|
3899
|
-
get()
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
localModelValue.value = value;
|
|
4183
|
+
const isOpened = computed({
|
|
4184
|
+
get: () => modelValue.value ?? localModelValue.value,
|
|
4185
|
+
set: (newValue) => {
|
|
4186
|
+
if (modelValue.value === void 0) {
|
|
4187
|
+
localModelValue.value = newValue;
|
|
4188
|
+
return;
|
|
3905
4189
|
}
|
|
3906
|
-
|
|
4190
|
+
modelValue.value = newValue;
|
|
3907
4191
|
}
|
|
3908
4192
|
});
|
|
3909
4193
|
const modalWrapper = ref(null);
|
|
@@ -3954,36 +4238,36 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3954
4238
|
};
|
|
3955
4239
|
onClickOutside(modalWrapper, () => {
|
|
3956
4240
|
if (!props.keepOpen) {
|
|
3957
|
-
|
|
4241
|
+
close();
|
|
3958
4242
|
}
|
|
3959
4243
|
});
|
|
3960
4244
|
function close() {
|
|
3961
|
-
|
|
4245
|
+
isOpened.value = false;
|
|
3962
4246
|
}
|
|
3963
4247
|
function open() {
|
|
3964
|
-
|
|
4248
|
+
isOpened.value = true;
|
|
3965
4249
|
}
|
|
3966
4250
|
__expose({ close, open });
|
|
3967
|
-
|
|
3968
|
-
if (
|
|
3969
|
-
e.preventDefault();
|
|
4251
|
+
const onCancel = () => {
|
|
4252
|
+
if (!props.keepOpen) {
|
|
3970
4253
|
close();
|
|
3971
4254
|
}
|
|
3972
|
-
}
|
|
4255
|
+
};
|
|
3973
4256
|
return (_ctx, _cache) => {
|
|
3974
4257
|
return openBlock(), createBlock(Transition, mergeProps({ name: unref(transitioName) }, toHandlers(dialogTransitionHandlers)), {
|
|
3975
4258
|
default: withCtx(() => [
|
|
3976
4259
|
withDirectives(createElementVNode("dialog", mergeProps(unref(dialogAttrs), {
|
|
3977
4260
|
ref_key: "dialogEl",
|
|
3978
4261
|
ref: dialogEl,
|
|
3979
|
-
class: unref(dialogClass)
|
|
4262
|
+
class: unref(dialogClass),
|
|
4263
|
+
onCancel: withModifiers(onCancel, ["stop", "prevent"])
|
|
3980
4264
|
}), [
|
|
3981
4265
|
createElementVNode("article", {
|
|
3982
4266
|
ref_key: "modalWrapper",
|
|
3983
4267
|
ref: modalWrapper,
|
|
3984
4268
|
class: "vv-dialog__wrapper"
|
|
3985
4269
|
}, [
|
|
3986
|
-
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header",
|
|
4270
|
+
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_2$4, [
|
|
3987
4271
|
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
3988
4272
|
createTextVNode(toDisplayString(_ctx.title) + " ", 1),
|
|
3989
4273
|
createElementVNode("button", {
|
|
@@ -3992,19 +4276,19 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3992
4276
|
class: "vv-dialog__close",
|
|
3993
4277
|
onClickPassive: close
|
|
3994
4278
|
}, [
|
|
3995
|
-
createVNode(_sfc_main$
|
|
4279
|
+
createVNode(_sfc_main$n, { name: "close" })
|
|
3996
4280
|
], 32)
|
|
3997
4281
|
])
|
|
3998
4282
|
])) : createCommentVNode("", true),
|
|
3999
|
-
createElementVNode("div",
|
|
4283
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
4000
4284
|
renderSlot(_ctx.$slots, "default")
|
|
4001
4285
|
]),
|
|
4002
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer",
|
|
4286
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_4$2, [
|
|
4003
4287
|
renderSlot(_ctx.$slots, "footer")
|
|
4004
4288
|
])) : createCommentVNode("", true)
|
|
4005
4289
|
], 512)
|
|
4006
|
-
], 16), [
|
|
4007
|
-
[vShow, unref(
|
|
4290
|
+
], 16, _hoisted_1$6), [
|
|
4291
|
+
[vShow, unref(isOpened)]
|
|
4008
4292
|
])
|
|
4009
4293
|
]),
|
|
4010
4294
|
_: 3
|
|
@@ -4204,7 +4488,7 @@ const VvInputTextProps = {
|
|
|
4204
4488
|
};
|
|
4205
4489
|
const VvInputPasswordAction = defineComponent({
|
|
4206
4490
|
components: {
|
|
4207
|
-
VvIcon: _sfc_main$
|
|
4491
|
+
VvIcon: _sfc_main$n
|
|
4208
4492
|
},
|
|
4209
4493
|
props: {
|
|
4210
4494
|
disabled: {
|
|
@@ -4248,7 +4532,7 @@ const VvInputPasswordAction = defineComponent({
|
|
|
4248
4532
|
};
|
|
4249
4533
|
},
|
|
4250
4534
|
render() {
|
|
4251
|
-
const icon = h(_sfc_main$
|
|
4535
|
+
const icon = h(_sfc_main$n, {
|
|
4252
4536
|
name: this.activeIcon,
|
|
4253
4537
|
class: "vv-input-text__icon"
|
|
4254
4538
|
});
|
|
@@ -4267,7 +4551,7 @@ const VvInputPasswordAction = defineComponent({
|
|
|
4267
4551
|
});
|
|
4268
4552
|
const VvInputStepAction = defineComponent({
|
|
4269
4553
|
components: {
|
|
4270
|
-
VvIcon: _sfc_main$
|
|
4554
|
+
VvIcon: _sfc_main$n
|
|
4271
4555
|
},
|
|
4272
4556
|
props: {
|
|
4273
4557
|
disabled: {
|
|
@@ -4312,7 +4596,7 @@ const VvInputStepAction = defineComponent({
|
|
|
4312
4596
|
});
|
|
4313
4597
|
const VvInputClearAction = defineComponent({
|
|
4314
4598
|
components: {
|
|
4315
|
-
VvIcon: _sfc_main$
|
|
4599
|
+
VvIcon: _sfc_main$n
|
|
4316
4600
|
},
|
|
4317
4601
|
props: {
|
|
4318
4602
|
disabled: {
|
|
@@ -4341,7 +4625,7 @@ const VvInputClearAction = defineComponent({
|
|
|
4341
4625
|
};
|
|
4342
4626
|
},
|
|
4343
4627
|
render() {
|
|
4344
|
-
const icon = h(_sfc_main$
|
|
4628
|
+
const icon = h(_sfc_main$n, {
|
|
4345
4629
|
name: this.icon,
|
|
4346
4630
|
class: "vv-input-text__icon"
|
|
4347
4631
|
});
|
|
@@ -4362,7 +4646,7 @@ function VvInputTextActionsFactory(type, parentProps) {
|
|
|
4362
4646
|
return {
|
|
4363
4647
|
name: "VvInputTextActions",
|
|
4364
4648
|
components: {
|
|
4365
|
-
VvIcon: _sfc_main$
|
|
4649
|
+
VvIcon: _sfc_main$n,
|
|
4366
4650
|
VvInputPasswordAction,
|
|
4367
4651
|
VvInputStepAction,
|
|
4368
4652
|
VvInputClearAction
|
|
@@ -4489,7 +4773,7 @@ function useTextCount(text, options) {
|
|
|
4489
4773
|
formatted
|
|
4490
4774
|
};
|
|
4491
4775
|
}
|
|
4492
|
-
const _hoisted_1$
|
|
4776
|
+
const _hoisted_1$5 = ["for"];
|
|
4493
4777
|
const _hoisted_2$3 = { class: "vv-input-text__wrapper" };
|
|
4494
4778
|
const _hoisted_3$1 = {
|
|
4495
4779
|
key: 0,
|
|
@@ -4512,13 +4796,18 @@ const _hoisted_8 = {
|
|
|
4512
4796
|
const __default__$4 = {
|
|
4513
4797
|
name: "VvInputText"
|
|
4514
4798
|
};
|
|
4515
|
-
const _sfc_main$
|
|
4799
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
4516
4800
|
...__default__$4,
|
|
4517
4801
|
props: VvInputTextProps,
|
|
4518
4802
|
emits: VvInputTextEvents,
|
|
4519
4803
|
setup(__props, { expose: __expose, emit }) {
|
|
4520
4804
|
const props = __props;
|
|
4521
4805
|
const slots = useSlots();
|
|
4806
|
+
const propsDefaults = useDefaults(
|
|
4807
|
+
"VvInputText",
|
|
4808
|
+
VvInputTextProps,
|
|
4809
|
+
props
|
|
4810
|
+
);
|
|
4522
4811
|
const inputEl = ref();
|
|
4523
4812
|
const innerEl = ref();
|
|
4524
4813
|
__expose({ $inner: innerEl });
|
|
@@ -4705,7 +4994,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4705
4994
|
hasHintLabelOrSlot,
|
|
4706
4995
|
hasInvalidLabelOrSlot,
|
|
4707
4996
|
hintSlotScope
|
|
4708
|
-
} = HintSlotFactory(
|
|
4997
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
4709
4998
|
const PasswordInputActions = VvInputTextActionsFactory(
|
|
4710
4999
|
INPUT_TYPES.PASSWORD,
|
|
4711
5000
|
props
|
|
@@ -4764,7 +5053,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4764
5053
|
key: 0,
|
|
4765
5054
|
for: unref(hasId),
|
|
4766
5055
|
class: "vv-input-text__label"
|
|
4767
|
-
}, toDisplayString(unref(label)), 9, _hoisted_1$
|
|
5056
|
+
}, toDisplayString(unref(label)), 9, _hoisted_1$5)) : createCommentVNode("", true),
|
|
4768
5057
|
createElementVNode("div", _hoisted_2$3, [
|
|
4769
5058
|
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
4770
5059
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
@@ -4775,7 +5064,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4775
5064
|
class: "vv-input-text__inner",
|
|
4776
5065
|
onClick: withModifiers(onClickInner, ["stop"])
|
|
4777
5066
|
}, [
|
|
4778
|
-
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$
|
|
5067
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
4779
5068
|
key: 0,
|
|
4780
5069
|
class: "vv-input-text__icon"
|
|
4781
5070
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
@@ -4796,7 +5085,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4796
5085
|
])
|
|
4797
5086
|
])) : createCommentVNode("", true)
|
|
4798
5087
|
], 8, _hoisted_4$1),
|
|
4799
|
-
unref(hasIconAfter) || unref(defaultAfterIcon) ? (openBlock(), createBlock(_sfc_main$
|
|
5088
|
+
unref(hasIconAfter) || unref(defaultAfterIcon) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
4800
5089
|
key: 1,
|
|
4801
5090
|
class: "vv-input-text__icon vv-input-text__icon-after"
|
|
4802
5091
|
}, unref(hasIconAfter) ? unref(hasIcon) : unref(defaultAfterIcon)), null, 16)) : unref(isPassword) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(PasswordInputActions), {
|
|
@@ -4856,6 +5145,79 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4856
5145
|
};
|
|
4857
5146
|
}
|
|
4858
5147
|
});
|
|
5148
|
+
const VvNavProps = {
|
|
5149
|
+
...ModifiersProps,
|
|
5150
|
+
items: {
|
|
5151
|
+
type: Array,
|
|
5152
|
+
required: true,
|
|
5153
|
+
default: () => []
|
|
5154
|
+
}
|
|
5155
|
+
};
|
|
5156
|
+
const VvNavEvents = ["click"];
|
|
5157
|
+
const _hoisted_1$4 = {
|
|
5158
|
+
class: "vv-nav__menu",
|
|
5159
|
+
role: "menu",
|
|
5160
|
+
"aria-busy": "true"
|
|
5161
|
+
};
|
|
5162
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
5163
|
+
__name: "VvNav",
|
|
5164
|
+
props: VvNavProps,
|
|
5165
|
+
emits: VvNavEvents,
|
|
5166
|
+
setup(__props, { emit }) {
|
|
5167
|
+
const props = __props;
|
|
5168
|
+
const { modifiers, items } = toRefs(props);
|
|
5169
|
+
const activeItem = ref(null);
|
|
5170
|
+
const bemCssClasses = useModifiers("vv-nav", modifiers);
|
|
5171
|
+
const localItems = computed(() => {
|
|
5172
|
+
return items.value.map((item, index) => {
|
|
5173
|
+
return {
|
|
5174
|
+
...item,
|
|
5175
|
+
id: item.id || `nav-item_${index}`
|
|
5176
|
+
};
|
|
5177
|
+
});
|
|
5178
|
+
});
|
|
5179
|
+
function onClick(item) {
|
|
5180
|
+
if (!item.disabled) {
|
|
5181
|
+
emit("click", item);
|
|
5182
|
+
activeItem.value = item.id;
|
|
5183
|
+
}
|
|
5184
|
+
}
|
|
5185
|
+
return (_ctx, _cache) => {
|
|
5186
|
+
return openBlock(), createElementBlock("nav", {
|
|
5187
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
5188
|
+
}, [
|
|
5189
|
+
createElementVNode("ul", _hoisted_1$4, [
|
|
5190
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(localItems), (navItem) => {
|
|
5191
|
+
return openBlock(), createElementBlock("li", {
|
|
5192
|
+
key: navItem.id,
|
|
5193
|
+
class: "vv-nav__item",
|
|
5194
|
+
role: "presentation"
|
|
5195
|
+
}, [
|
|
5196
|
+
createVNode(_sfc_main$o, mergeProps({
|
|
5197
|
+
disabled: navItem.disabled,
|
|
5198
|
+
to: navItem.to,
|
|
5199
|
+
href: navItem.href,
|
|
5200
|
+
tabindex: 0
|
|
5201
|
+
}, {
|
|
5202
|
+
class: [{
|
|
5203
|
+
current: unref(activeItem) == navItem.id,
|
|
5204
|
+
disabled: navItem.disabled
|
|
5205
|
+
}, "vv-nav__item-label"]
|
|
5206
|
+
}, toHandlers(navItem.on), {
|
|
5207
|
+
onClick: ($event) => onClick(navItem)
|
|
5208
|
+
}), {
|
|
5209
|
+
default: withCtx(() => [
|
|
5210
|
+
createTextVNode(toDisplayString(navItem.title), 1)
|
|
5211
|
+
]),
|
|
5212
|
+
_: 2
|
|
5213
|
+
}, 1040, ["class", "onClick"])
|
|
5214
|
+
]);
|
|
5215
|
+
}), 128))
|
|
5216
|
+
])
|
|
5217
|
+
], 2);
|
|
5218
|
+
};
|
|
5219
|
+
}
|
|
5220
|
+
});
|
|
4859
5221
|
const VvProgressProps = {
|
|
4860
5222
|
...ModifiersProps,
|
|
4861
5223
|
/**
|
|
@@ -4889,7 +5251,7 @@ const VvProgressProps = {
|
|
|
4889
5251
|
const __default__$3 = {
|
|
4890
5252
|
name: "VvProgress"
|
|
4891
5253
|
};
|
|
4892
|
-
const _sfc_main$
|
|
5254
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
4893
5255
|
...__default__$3,
|
|
4894
5256
|
props: VvProgressProps,
|
|
4895
5257
|
setup(__props) {
|
|
@@ -4945,18 +5307,23 @@ function useGroupProps(props, emit) {
|
|
|
4945
5307
|
disabled
|
|
4946
5308
|
};
|
|
4947
5309
|
}
|
|
4948
|
-
const _hoisted_1$
|
|
5310
|
+
const _hoisted_1$3 = ["for"];
|
|
4949
5311
|
const _hoisted_2$2 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid", "aria-describedby", "aria-errormessage"];
|
|
4950
5312
|
const __default__$2 = {
|
|
4951
5313
|
name: "VvRadio"
|
|
4952
5314
|
};
|
|
4953
|
-
const _sfc_main$
|
|
5315
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
4954
5316
|
...__default__$2,
|
|
4955
5317
|
props: VvRadioProps,
|
|
4956
5318
|
emits: VvRadioEvents,
|
|
4957
5319
|
setup(__props, { emit }) {
|
|
4958
5320
|
const props = __props;
|
|
4959
5321
|
const slots = useSlots();
|
|
5322
|
+
const propsDefaults = useDefaults(
|
|
5323
|
+
"VvRadio",
|
|
5324
|
+
VvRadioProps,
|
|
5325
|
+
props
|
|
5326
|
+
);
|
|
4960
5327
|
const { id, disabled, readonly, modelValue, valid, invalid } = useGroupProps(props, emit);
|
|
4961
5328
|
const hasId = useUniqueId(id);
|
|
4962
5329
|
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
@@ -5007,7 +5374,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
5007
5374
|
hasHintLabelOrSlot,
|
|
5008
5375
|
hasInvalidLabelOrSlot,
|
|
5009
5376
|
hintSlotScope
|
|
5010
|
-
} = HintSlotFactory(
|
|
5377
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
5011
5378
|
return (_ctx, _cache) => {
|
|
5012
5379
|
return openBlock(), createElementBlock("label", {
|
|
5013
5380
|
class: normalizeClass(unref(bemCssClasses)),
|
|
@@ -5066,24 +5433,29 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
5066
5433
|
key: "3"
|
|
5067
5434
|
} : void 0
|
|
5068
5435
|
]), 1032, ["id"])
|
|
5069
|
-
], 10, _hoisted_1$
|
|
5436
|
+
], 10, _hoisted_1$3);
|
|
5070
5437
|
};
|
|
5071
5438
|
}
|
|
5072
5439
|
});
|
|
5073
5440
|
const VvRadioGroupProps = CheckboxRadioGroupProps;
|
|
5074
5441
|
const VvRadioGroupEvents = ["update:modelValue", "change"];
|
|
5075
|
-
const _hoisted_1$
|
|
5442
|
+
const _hoisted_1$2 = ["textContent"];
|
|
5076
5443
|
const _hoisted_2$1 = { class: "vv-radio-group__wrapper" };
|
|
5077
5444
|
const __default__$1 = {
|
|
5078
5445
|
name: "VvRadioGroup"
|
|
5079
5446
|
};
|
|
5080
|
-
const _sfc_main$
|
|
5447
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
5081
5448
|
...__default__$1,
|
|
5082
5449
|
props: VvRadioGroupProps,
|
|
5083
5450
|
emits: VvRadioGroupEvents,
|
|
5084
5451
|
setup(__props, { emit }) {
|
|
5085
5452
|
const props = __props;
|
|
5086
5453
|
const slots = useSlots();
|
|
5454
|
+
const propsDefaults = useDefaults(
|
|
5455
|
+
"VvRadioGroup",
|
|
5456
|
+
VvRadioGroupProps,
|
|
5457
|
+
props
|
|
5458
|
+
);
|
|
5087
5459
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
5088
5460
|
const { disabled, readonly, vertical, valid, invalid, modifiers } = toRefs(props);
|
|
5089
5461
|
useProvideGroupState({
|
|
@@ -5114,7 +5486,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
5114
5486
|
value: getOptionValue(option)
|
|
5115
5487
|
};
|
|
5116
5488
|
};
|
|
5117
|
-
const { HintSlot, hintSlotScope } = HintSlotFactory(
|
|
5489
|
+
const { HintSlot, hintSlotScope } = HintSlotFactory(propsDefaults, slots);
|
|
5118
5490
|
return (_ctx, _cache) => {
|
|
5119
5491
|
return openBlock(), createElementBlock("fieldset", {
|
|
5120
5492
|
class: normalizeClass(unref(bemCssClasses))
|
|
@@ -5122,10 +5494,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
5122
5494
|
_ctx.label ? (openBlock(), createElementBlock("legend", {
|
|
5123
5495
|
key: 0,
|
|
5124
5496
|
textContent: toDisplayString(_ctx.label)
|
|
5125
|
-
}, null, 8, _hoisted_1$
|
|
5497
|
+
}, null, 8, _hoisted_1$2)) : createCommentVNode("", true),
|
|
5126
5498
|
createElementVNode("div", _hoisted_2$1, [
|
|
5127
5499
|
_ctx.options.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.options, (option, index) => {
|
|
5128
|
-
return openBlock(), createBlock(_sfc_main$
|
|
5500
|
+
return openBlock(), createBlock(_sfc_main$4, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
|
|
5129
5501
|
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
5130
5502
|
]),
|
|
5131
5503
|
createVNode(unref(HintSlot), { class: "vv-radio-group__hint" }, createSlots({ _: 2 }, [
|
|
@@ -5162,6 +5534,61 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
5162
5534
|
};
|
|
5163
5535
|
}
|
|
5164
5536
|
});
|
|
5537
|
+
const VvTabProps = {
|
|
5538
|
+
...ModifiersProps,
|
|
5539
|
+
items: {
|
|
5540
|
+
type: Array,
|
|
5541
|
+
required: true,
|
|
5542
|
+
default: () => []
|
|
5543
|
+
}
|
|
5544
|
+
};
|
|
5545
|
+
const VvTabEvents = ["click"];
|
|
5546
|
+
const _hoisted_1$1 = ["id"];
|
|
5547
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
5548
|
+
__name: "VvTab",
|
|
5549
|
+
props: VvTabProps,
|
|
5550
|
+
emits: VvTabEvents,
|
|
5551
|
+
setup(__props, { emit }) {
|
|
5552
|
+
const props = __props;
|
|
5553
|
+
const { modifiers, items } = toRefs(props);
|
|
5554
|
+
const activeTab = ref(null);
|
|
5555
|
+
const bemCssClasses = useModifiers("vv-tab", modifiers);
|
|
5556
|
+
const localItems = computed(() => {
|
|
5557
|
+
return items.value.map((item, index) => {
|
|
5558
|
+
return {
|
|
5559
|
+
...item,
|
|
5560
|
+
id: item.id || `tab-item_${index}`
|
|
5561
|
+
};
|
|
5562
|
+
});
|
|
5563
|
+
});
|
|
5564
|
+
function onClick(item) {
|
|
5565
|
+
if (!item.disabled) {
|
|
5566
|
+
emit("click", item);
|
|
5567
|
+
activeTab.value = item.id;
|
|
5568
|
+
}
|
|
5569
|
+
}
|
|
5570
|
+
return (_ctx, _cache) => {
|
|
5571
|
+
return openBlock(), createElementBlock("div", {
|
|
5572
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
5573
|
+
}, [
|
|
5574
|
+
createVNode(_sfc_main$6, {
|
|
5575
|
+
items: unref(localItems),
|
|
5576
|
+
modifiers: "tabs full",
|
|
5577
|
+
onClick
|
|
5578
|
+
}, null, 8, ["items"]),
|
|
5579
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(localItems), (item) => {
|
|
5580
|
+
return openBlock(), createElementBlock("article", {
|
|
5581
|
+
id: item.id,
|
|
5582
|
+
key: item.id,
|
|
5583
|
+
class: normalizeClass([{ target: unref(activeTab) === item.id }, "vv-tab__panel"])
|
|
5584
|
+
}, [
|
|
5585
|
+
renderSlot(_ctx.$slots, `${item.id}`)
|
|
5586
|
+
], 10, _hoisted_1$1);
|
|
5587
|
+
}), 128))
|
|
5588
|
+
], 2);
|
|
5589
|
+
};
|
|
5590
|
+
}
|
|
5591
|
+
});
|
|
5165
5592
|
const WRAP = {
|
|
5166
5593
|
hard: "hard",
|
|
5167
5594
|
soft: "soft"
|
|
@@ -5223,13 +5650,18 @@ const _hoisted_7 = {
|
|
|
5223
5650
|
const __default__ = {
|
|
5224
5651
|
name: "VvTextarea"
|
|
5225
5652
|
};
|
|
5226
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5653
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
5227
5654
|
...__default__,
|
|
5228
5655
|
props: VvTextareaProps,
|
|
5229
5656
|
emits: VvTextareaEvents,
|
|
5230
5657
|
setup(__props, { emit }) {
|
|
5231
5658
|
const props = __props;
|
|
5232
5659
|
const slots = useSlots();
|
|
5660
|
+
const propsDefaults = useDefaults(
|
|
5661
|
+
"VvTextarea",
|
|
5662
|
+
VvTextareaProps,
|
|
5663
|
+
props
|
|
5664
|
+
);
|
|
5233
5665
|
const textarea = ref();
|
|
5234
5666
|
const {
|
|
5235
5667
|
id,
|
|
@@ -5284,7 +5716,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
5284
5716
|
hasHintLabelOrSlot,
|
|
5285
5717
|
hasInvalidLabelOrSlot,
|
|
5286
5718
|
hintSlotScope
|
|
5287
|
-
} = HintSlotFactory(
|
|
5719
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
5288
5720
|
const bemCssClasses = useModifiers(
|
|
5289
5721
|
"vv-textarea",
|
|
5290
5722
|
modifiers,
|
|
@@ -5348,7 +5780,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
5348
5780
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
5349
5781
|
])) : createCommentVNode("", true),
|
|
5350
5782
|
createElementVNode("div", _hoisted_4, [
|
|
5351
|
-
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$
|
|
5783
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
5352
5784
|
key: 0,
|
|
5353
5785
|
class: "vv-textarea__icon"
|
|
5354
5786
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
|
|
@@ -5362,7 +5794,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
5362
5794
|
}), null, 16, _hoisted_5), [
|
|
5363
5795
|
[vModelText, unref(localModelValue)]
|
|
5364
5796
|
]),
|
|
5365
|
-
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$
|
|
5797
|
+
unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
5366
5798
|
key: 1,
|
|
5367
5799
|
class: "vv-textarea__icon vv-textarea__icon-after"
|
|
5368
5800
|
}, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
|
|
@@ -5413,24 +5845,69 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
5413
5845
|
};
|
|
5414
5846
|
}
|
|
5415
5847
|
});
|
|
5848
|
+
const VvTooltipProps = {
|
|
5849
|
+
...ModifiersProps,
|
|
5850
|
+
/**
|
|
5851
|
+
* Define the tooltip position
|
|
5852
|
+
* @default Side.bottom
|
|
5853
|
+
*/
|
|
5854
|
+
position: {
|
|
5855
|
+
type: String,
|
|
5856
|
+
default: Side.bottom
|
|
5857
|
+
},
|
|
5858
|
+
value: {
|
|
5859
|
+
type: String
|
|
5860
|
+
}
|
|
5861
|
+
};
|
|
5862
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5863
|
+
__name: "VvTooltip",
|
|
5864
|
+
props: VvTooltipProps,
|
|
5865
|
+
setup(__props) {
|
|
5866
|
+
const props = __props;
|
|
5867
|
+
const { modifiers } = toRefs(props);
|
|
5868
|
+
const bemCssClasses = useModifiers(
|
|
5869
|
+
"vv-tooltip",
|
|
5870
|
+
modifiers,
|
|
5871
|
+
computed(() => ({
|
|
5872
|
+
[props.position]: true
|
|
5873
|
+
}))
|
|
5874
|
+
);
|
|
5875
|
+
return (_ctx, _cache) => {
|
|
5876
|
+
return openBlock(), createElementBlock("span", {
|
|
5877
|
+
class: normalizeClass(unref(bemCssClasses)),
|
|
5878
|
+
role: "tooltip",
|
|
5879
|
+
inert: ""
|
|
5880
|
+
}, [
|
|
5881
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
5882
|
+
createTextVNode(toDisplayString(_ctx.value), 1)
|
|
5883
|
+
])
|
|
5884
|
+
], 2);
|
|
5885
|
+
};
|
|
5886
|
+
}
|
|
5887
|
+
});
|
|
5416
5888
|
export {
|
|
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$
|
|
5430
|
-
_sfc_main$
|
|
5431
|
-
_sfc_main$
|
|
5432
|
-
_sfc_main$
|
|
5433
|
-
_sfc_main$
|
|
5434
|
-
_sfc_main$
|
|
5435
|
-
_sfc_main as
|
|
5889
|
+
_sfc_main$q as VvAccordion,
|
|
5890
|
+
_sfc_main$p as VvAccordionGroup,
|
|
5891
|
+
_sfc_main$o as VvAction,
|
|
5892
|
+
_sfc_main$m as VvAlert,
|
|
5893
|
+
_sfc_main$l as VvBadge,
|
|
5894
|
+
_sfc_main$k as VvBreadcrumb,
|
|
5895
|
+
_sfc_main$j as VvButton,
|
|
5896
|
+
_sfc_main$i as VvButtonGroup,
|
|
5897
|
+
_sfc_main$h as VvCard,
|
|
5898
|
+
_sfc_main$g as VvCheckbox,
|
|
5899
|
+
_sfc_main$f as VvCheckboxGroup,
|
|
5900
|
+
_sfc_main$9 as VvCombobox,
|
|
5901
|
+
_sfc_main$8 as VvDialog,
|
|
5902
|
+
_sfc_main$e as VvDropdown,
|
|
5903
|
+
_sfc_main$n as VvIcon,
|
|
5904
|
+
_sfc_main$7 as VvInputText,
|
|
5905
|
+
_sfc_main$6 as VvNav,
|
|
5906
|
+
_sfc_main$5 as VvProgress,
|
|
5907
|
+
_sfc_main$4 as VvRadio,
|
|
5908
|
+
_sfc_main$3 as VvRadioGroup,
|
|
5909
|
+
_sfc_main$a as VvSelect,
|
|
5910
|
+
_sfc_main$2 as VvTab,
|
|
5911
|
+
_sfc_main$1 as VvTextarea,
|
|
5912
|
+
_sfc_main as VvTooltip
|
|
5436
5913
|
};
|