@volverjs/ui-vue 0.0.10-beta.24 → 0.0.10-beta.26
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/auto-imports.d.ts +1 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +14 -12
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +169 -89
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +31 -5
- package/dist/components/VvAccordionGroup/index.d.ts +7 -4
- package/dist/components/VvAction/VvAction.es.js +14 -12
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +2 -11
- package/dist/components/VvAction/index.d.ts +1 -5
- package/dist/components/VvAlert/VvAlert.es.js +14 -12
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +14 -12
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +14 -12
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +14 -12
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +14 -12
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +14 -12
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +14 -12
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +2 -19
- package/dist/components/VvButton/index.d.ts +1 -5
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +14 -12
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +14 -12
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +14 -12
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +14 -12
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +58 -34
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +2 -8
- package/dist/components/VvCombobox/index.d.ts +9 -2
- package/dist/components/VvDialog/VvDialog.es.js +14 -12
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +24 -16
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -19
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +13 -1
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +9 -0
- package/dist/components/VvDropdown/index.d.ts +37 -0
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +64 -15
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +322 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +14 -12
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +131 -76
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +14 -12
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/index.d.ts +5 -5
- package/dist/components/VvInputText/VvInputText.es.js +979 -107
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +44 -1
- package/dist/components/VvInputText/index.d.ts +28 -0
- package/dist/components/VvNav/VvNav.es.js +14 -12
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +14 -12
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +14 -12
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +14 -12
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +14 -12
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +14 -12
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvTab/VvTab.es.js +14 -12
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +14 -12
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.es.js +14 -12
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +435 -195
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +3 -23
- package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -3
- package/dist/composables/usePersistence.d.ts +3 -0
- package/dist/constants.d.ts +24 -21
- package/dist/directives/index.es.js +14 -12
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +14 -12
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +11 -11
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +51 -9
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +327 -64
- package/dist/stories/Button/Button.settings.d.ts +0 -1
- package/dist/types/nav.d.ts +1 -2
- package/package.json +1 -1
- 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/VvAccordionGroup/VvAccordionGroup.vue +86 -69
- package/src/components/VvAccordionGroup/index.ts +3 -5
- package/src/components/VvCombobox/VvCombobox.vue +2 -0
- package/src/components/VvDropdown/VvDropdown.vue +11 -2
- package/src/components/VvDropdown/VvDropdownItem.vue +4 -1
- package/src/components/VvDropdown/VvDropdownOption.vue +3 -21
- package/src/components/VvDropdown/index.ts +35 -1
- package/src/components/VvInputText/VvInputText.vue +98 -3
- package/src/components/VvInputText/index.ts +24 -1
- package/src/composables/dropdown/useProvideDropdown.ts +4 -4
- package/src/composables/usePersistence.ts +76 -0
- package/src/constants.ts +23 -18
- package/src/props/index.ts +12 -7
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +2 -2
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +5 -5
- package/src/stories/Button/Button.settings.ts +1 -4
- package/src/types/nav.ts +1 -3
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { inject, computed, toRef, unref, defineComponent, useAttrs, toRefs, ref, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, provide, watchEffect, reactive, Fragment, renderList, createBlock, mergeProps, withCtx, resolveDynamicComponent, mergeDefaults, createCommentVNode, createVNode, TransitionGroup, toHandlers, useSlots,
|
|
1
|
+
import { inject, computed, toRef, unref, defineComponent, useAttrs, toRefs, ref, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, reactive, onMounted, nextTick, Fragment, renderList, createBlock, mergeProps, createSlots, withCtx, resolveDynamicComponent, mergeDefaults, createCommentVNode, createVNode, TransitionGroup, toHandlers, useSlots, h, withDirectives, vModelCheckbox, Transition, normalizeStyle, vShow, vModelSelect, vModelText, vModelRadio } from "vue";
|
|
2
2
|
import { uid } from "uid";
|
|
3
|
-
import { useVModel,
|
|
3
|
+
import { useVModel, useStorage, useMutationObserver, onClickOutside, useFocusWithin, useElementHover, onKeyStroke, useFocus, useElementVisibility, refDebounced, computedAsync } from "@vueuse/core";
|
|
4
4
|
import mitt from "mitt";
|
|
5
5
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
6
6
|
import { get } from "ts-dot-prop";
|
|
7
7
|
import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
8
8
|
import { useIMask } from "vue-imask";
|
|
9
9
|
import Sortable from "vuedraggable";
|
|
10
|
+
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
11
|
+
StorageType2["local"] = "local";
|
|
12
|
+
StorageType2["session"] = "session";
|
|
13
|
+
return StorageType2;
|
|
14
|
+
})(StorageType || {});
|
|
10
15
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
11
16
|
Strategy2["absolute"] = "absolute";
|
|
12
17
|
Strategy2["fixed"] = "fixed";
|
|
@@ -64,13 +69,6 @@ var DropdownItemRole = /* @__PURE__ */ ((DropdownItemRole2) => {
|
|
|
64
69
|
DropdownItemRole2["presentation"] = "presentation";
|
|
65
70
|
return DropdownItemRole2;
|
|
66
71
|
})(DropdownItemRole || {});
|
|
67
|
-
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
68
|
-
AnchorTarget2["_blank"] = "_blank";
|
|
69
|
-
AnchorTarget2["_self"] = "_self";
|
|
70
|
-
AnchorTarget2["_parent"] = "_parent";
|
|
71
|
-
AnchorTarget2["_top"] = "_top";
|
|
72
|
-
return AnchorTarget2;
|
|
73
|
-
})(AnchorTarget || {});
|
|
74
72
|
const INJECTION_KEY_VOLVER = Symbol.for("volver");
|
|
75
73
|
const INJECTION_KEY_BUTTON_GROUP = Symbol.for(
|
|
76
74
|
"buttonGroup"
|
|
@@ -111,11 +109,7 @@ const LinkProps = {
|
|
|
111
109
|
/**
|
|
112
110
|
* Anchor target
|
|
113
111
|
*/
|
|
114
|
-
target:
|
|
115
|
-
type: String,
|
|
116
|
-
default: void 0,
|
|
117
|
-
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
118
|
-
},
|
|
112
|
+
target: String,
|
|
119
113
|
/**
|
|
120
114
|
* Anchor rel
|
|
121
115
|
*/
|
|
@@ -589,6 +583,14 @@ const NavProps = {
|
|
|
589
583
|
default: () => []
|
|
590
584
|
}
|
|
591
585
|
};
|
|
586
|
+
const StorageProps = {
|
|
587
|
+
storageType: {
|
|
588
|
+
type: String,
|
|
589
|
+
default: StorageType.local,
|
|
590
|
+
validator: (value) => Object.values(StorageType).includes(value)
|
|
591
|
+
},
|
|
592
|
+
storageKey: String
|
|
593
|
+
};
|
|
592
594
|
function useInjectedGroupState(groupKey) {
|
|
593
595
|
const group = inject(groupKey, void 0);
|
|
594
596
|
const isInGroup = computed(() => group !== void 0);
|
|
@@ -875,11 +877,13 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
875
877
|
});
|
|
876
878
|
const VvAccordionGroupProps = {
|
|
877
879
|
...ModifiersProps,
|
|
880
|
+
...StorageProps,
|
|
878
881
|
/**
|
|
879
882
|
* VModel
|
|
880
883
|
*/
|
|
881
884
|
modelValue: {
|
|
882
|
-
type: [String, Array]
|
|
885
|
+
type: [String, Array],
|
|
886
|
+
default: void 0
|
|
883
887
|
},
|
|
884
888
|
/**
|
|
885
889
|
* Accordion items
|
|
@@ -907,13 +911,69 @@ const VvAccordionGroupProps = {
|
|
|
907
911
|
/**
|
|
908
912
|
* If true, the accordion items will be opened by default
|
|
909
913
|
*/
|
|
910
|
-
not: Boolean
|
|
911
|
-
/**
|
|
912
|
-
* Enable local storage persistence
|
|
913
|
-
*/
|
|
914
|
-
storeKey: String
|
|
914
|
+
not: Boolean
|
|
915
915
|
};
|
|
916
916
|
const VvAccordionGroupEvents = ["update:modelValue"];
|
|
917
|
+
const usePersistence = (storageKey, storageType = StorageType.local, defaultValue) => {
|
|
918
|
+
const localValue = ref();
|
|
919
|
+
if (defaultValue) {
|
|
920
|
+
localValue.value = defaultValue;
|
|
921
|
+
}
|
|
922
|
+
let storageValue;
|
|
923
|
+
if (storageKey) {
|
|
924
|
+
watch(
|
|
925
|
+
storageKey,
|
|
926
|
+
(newKey, oldKey) => {
|
|
927
|
+
const storage = unref(storageType) === StorageType.session ? sessionStorage : localStorage;
|
|
928
|
+
if (oldKey && oldKey !== newKey) {
|
|
929
|
+
storage.removeItem(oldKey);
|
|
930
|
+
}
|
|
931
|
+
if (newKey) {
|
|
932
|
+
storageValue = useStorage(
|
|
933
|
+
newKey,
|
|
934
|
+
(storageValue == null ? void 0 : storageValue.value) ?? localValue.value,
|
|
935
|
+
storage
|
|
936
|
+
);
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
storageValue = void 0;
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
immediate: true
|
|
943
|
+
}
|
|
944
|
+
);
|
|
945
|
+
}
|
|
946
|
+
if (isRef(storageType)) {
|
|
947
|
+
watch(storageType, (newType, oldType) => {
|
|
948
|
+
if (storageKey == null ? void 0 : storageKey.value) {
|
|
949
|
+
if (newType) {
|
|
950
|
+
const storage = newType === StorageType.session ? sessionStorage : localStorage;
|
|
951
|
+
storageValue = useStorage(
|
|
952
|
+
storageKey.value,
|
|
953
|
+
(storageValue == null ? void 0 : storageValue.value) ?? localValue.value,
|
|
954
|
+
storage
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
if (oldType && oldType !== newType) {
|
|
958
|
+
const oldStorage = oldType === StorageType.session ? sessionStorage : localStorage;
|
|
959
|
+
oldStorage.removeItem(storageKey.value);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
return computed({
|
|
965
|
+
get: () => {
|
|
966
|
+
return (storageValue == null ? void 0 : storageValue.value) ?? localValue.value;
|
|
967
|
+
},
|
|
968
|
+
set: (value) => {
|
|
969
|
+
if (storageValue) {
|
|
970
|
+
storageValue.value = value;
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
localValue.value = value;
|
|
974
|
+
}
|
|
975
|
+
});
|
|
976
|
+
};
|
|
917
977
|
function useProvideGroupState(key, groupState) {
|
|
918
978
|
provide(key, groupState);
|
|
919
979
|
}
|
|
@@ -927,7 +987,14 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
927
987
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
928
988
|
const props = __props;
|
|
929
989
|
const emit = __emit;
|
|
930
|
-
const {
|
|
990
|
+
const {
|
|
991
|
+
disabled,
|
|
992
|
+
modifiers,
|
|
993
|
+
itemModifiers,
|
|
994
|
+
items,
|
|
995
|
+
storageKey,
|
|
996
|
+
storageType
|
|
997
|
+
} = toRefs(props);
|
|
931
998
|
watchEffect(() => {
|
|
932
999
|
if (typeof props.modelValue === "string" && props.collapse) {
|
|
933
1000
|
console.warn(
|
|
@@ -936,77 +1003,78 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
936
1003
|
}
|
|
937
1004
|
});
|
|
938
1005
|
const accordionNames = reactive(/* @__PURE__ */ new Set());
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
(newKey, oldKey) => {
|
|
943
|
-
if (oldKey && oldKey !== newKey) {
|
|
944
|
-
localStorage.removeItem(oldKey);
|
|
945
|
-
}
|
|
946
|
-
if (newKey) {
|
|
947
|
-
modelValue = useLocalStorage(newKey, modelValue.value);
|
|
948
|
-
return;
|
|
949
|
-
}
|
|
950
|
-
modelValue = ref(new Set(modelValue.value));
|
|
951
|
-
},
|
|
952
|
-
{ immediate: true }
|
|
1006
|
+
const storageModelValue = usePersistence(
|
|
1007
|
+
storageKey,
|
|
1008
|
+
storageType
|
|
953
1009
|
);
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
emit(
|
|
959
|
-
"update:modelValue",
|
|
960
|
-
[...accordionNames].filter(
|
|
961
|
-
(name) => !modelValue.value.has(name)
|
|
962
|
-
)
|
|
963
|
-
);
|
|
964
|
-
return;
|
|
965
|
-
}
|
|
966
|
-
if (props.collapse) {
|
|
967
|
-
emit("update:modelValue", [...modelValue.value]);
|
|
968
|
-
return;
|
|
1010
|
+
const localModelValue = computed({
|
|
1011
|
+
get: () => {
|
|
1012
|
+
if (props.modelValue !== null && props.modelValue !== void 0) {
|
|
1013
|
+
return props.modelValue;
|
|
969
1014
|
}
|
|
970
|
-
|
|
1015
|
+
return storageModelValue.value;
|
|
971
1016
|
},
|
|
972
|
-
{
|
|
973
|
-
|
|
974
|
-
|
|
1017
|
+
set: (newValue) => {
|
|
1018
|
+
emit("update:modelValue", newValue);
|
|
1019
|
+
storageModelValue.value = newValue;
|
|
975
1020
|
}
|
|
976
|
-
);
|
|
977
|
-
|
|
978
|
-
() =>
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
return;
|
|
1021
|
+
});
|
|
1022
|
+
const expandedAccordions = computed({
|
|
1023
|
+
get: () => {
|
|
1024
|
+
if (localModelValue.value === void 0) {
|
|
1025
|
+
return /* @__PURE__ */ new Set();
|
|
982
1026
|
}
|
|
983
1027
|
let toReturn = /* @__PURE__ */ new Set();
|
|
984
1028
|
if (props.not) {
|
|
985
|
-
if (typeof
|
|
1029
|
+
if (typeof localModelValue.value === "string") {
|
|
986
1030
|
toReturn = new Set(
|
|
987
|
-
[...accordionNames].filter(
|
|
1031
|
+
[...accordionNames].filter(
|
|
1032
|
+
(name) => name !== localModelValue.value
|
|
1033
|
+
)
|
|
988
1034
|
);
|
|
989
|
-
} else if (Array.isArray(
|
|
1035
|
+
} else if (Array.isArray(localModelValue.value)) {
|
|
990
1036
|
toReturn = new Set(
|
|
991
1037
|
[...accordionNames].filter(
|
|
992
|
-
(name) => !
|
|
1038
|
+
(name) => !localModelValue.value.includes(
|
|
1039
|
+
name
|
|
1040
|
+
)
|
|
993
1041
|
)
|
|
994
1042
|
);
|
|
995
1043
|
}
|
|
996
|
-
} else if (typeof
|
|
997
|
-
toReturn = /* @__PURE__ */ new Set([
|
|
998
|
-
} else if (Array.isArray(
|
|
999
|
-
toReturn = new Set(
|
|
1000
|
-
}
|
|
1001
|
-
for (const name of accordionNames) {
|
|
1002
|
-
bus.emit("toggle", { name, value: toReturn.has(name) });
|
|
1044
|
+
} else if (typeof localModelValue.value === "string") {
|
|
1045
|
+
toReturn = /* @__PURE__ */ new Set([localModelValue.value]);
|
|
1046
|
+
} else if (Array.isArray(localModelValue.value)) {
|
|
1047
|
+
toReturn = new Set(localModelValue.value);
|
|
1003
1048
|
}
|
|
1004
|
-
|
|
1049
|
+
return toReturn;
|
|
1005
1050
|
},
|
|
1006
|
-
{
|
|
1007
|
-
|
|
1051
|
+
set: (newValue) => {
|
|
1052
|
+
if (props.not) {
|
|
1053
|
+
localModelValue.value = [...accordionNames].filter(
|
|
1054
|
+
(name) => !newValue.has(name)
|
|
1055
|
+
);
|
|
1056
|
+
return;
|
|
1057
|
+
}
|
|
1058
|
+
if (props.collapse) {
|
|
1059
|
+
localModelValue.value = [...newValue];
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1062
|
+
localModelValue.value = newValue.values().next().value;
|
|
1008
1063
|
}
|
|
1009
|
-
);
|
|
1064
|
+
});
|
|
1065
|
+
onMounted(() => {
|
|
1066
|
+
if (props.not && localModelValue.value === void 0) {
|
|
1067
|
+
localModelValue.value = props.collapse ? [] : [...accordionNames.values()].splice(1, accordionNames.size);
|
|
1068
|
+
}
|
|
1069
|
+
nextTick(() => {
|
|
1070
|
+
for (const name of accordionNames) {
|
|
1071
|
+
bus.emit("toggle", {
|
|
1072
|
+
name,
|
|
1073
|
+
value: expandedAccordions.value.has(name)
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
});
|
|
1010
1078
|
const bus = mitt();
|
|
1011
1079
|
useProvideGroupState(INJECTION_KEY_ACCORDION_GROUP, {
|
|
1012
1080
|
disabled,
|
|
@@ -1020,19 +1088,22 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
1020
1088
|
accordionNames.delete(name);
|
|
1021
1089
|
});
|
|
1022
1090
|
bus.on("toggle", ({ name, value }) => {
|
|
1091
|
+
const newValue = new Set(expandedAccordions.value);
|
|
1023
1092
|
if (value) {
|
|
1024
1093
|
if (!props.collapse) {
|
|
1025
|
-
for (const item of
|
|
1094
|
+
for (const item of newValue) {
|
|
1026
1095
|
if (item !== name) {
|
|
1027
1096
|
bus.emit("toggle", { name: item, value: false });
|
|
1028
1097
|
}
|
|
1029
1098
|
}
|
|
1030
|
-
|
|
1099
|
+
newValue.clear();
|
|
1031
1100
|
}
|
|
1032
|
-
|
|
1101
|
+
newValue.add(name);
|
|
1102
|
+
expandedAccordions.value = newValue;
|
|
1033
1103
|
return;
|
|
1034
1104
|
}
|
|
1035
|
-
|
|
1105
|
+
newValue.delete(name);
|
|
1106
|
+
expandedAccordions.value = newValue;
|
|
1036
1107
|
});
|
|
1037
1108
|
const expand = (name) => {
|
|
1038
1109
|
if (typeof name === "string") {
|
|
@@ -1066,7 +1137,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
1066
1137
|
}
|
|
1067
1138
|
};
|
|
1068
1139
|
bus.on("collapse", ({ name }) => collapse(name));
|
|
1069
|
-
__expose({
|
|
1140
|
+
__expose({ expandedAccordions, expand, collapse });
|
|
1070
1141
|
const bemCssClasses = useModifiers(
|
|
1071
1142
|
"vv-accordion-group",
|
|
1072
1143
|
modifiers,
|
|
@@ -1082,7 +1153,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
1082
1153
|
},
|
|
1083
1154
|
[
|
|
1084
1155
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
|
|
1085
|
-
|
|
1156
|
+
expandedAccordions: unref(expandedAccordions),
|
|
1086
1157
|
expand,
|
|
1087
1158
|
collapse
|
|
1088
1159
|
})), () => [
|
|
@@ -1099,16 +1170,25 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
1099
1170
|
title: item.title,
|
|
1100
1171
|
content: item.content
|
|
1101
1172
|
}),
|
|
1102
|
-
{
|
|
1103
|
-
header: withCtx((data) => [
|
|
1104
|
-
renderSlot(_ctx.$slots, `header::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
1105
|
-
]),
|
|
1106
|
-
details: withCtx((data) => [
|
|
1107
|
-
renderSlot(_ctx.$slots, `details::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
1108
|
-
]),
|
|
1173
|
+
createSlots({
|
|
1109
1174
|
_: 2
|
|
1110
1175
|
/* DYNAMIC */
|
|
1111
|
-
},
|
|
1176
|
+
}, [
|
|
1177
|
+
_ctx.$slots[`summary::${item.name}`] ? {
|
|
1178
|
+
name: "summary",
|
|
1179
|
+
fn: withCtx((data) => [
|
|
1180
|
+
renderSlot(_ctx.$slots, `summary::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
1181
|
+
]),
|
|
1182
|
+
key: "0"
|
|
1183
|
+
} : void 0,
|
|
1184
|
+
_ctx.$slots[`content::${item.name}`] ? {
|
|
1185
|
+
name: "default",
|
|
1186
|
+
fn: withCtx((data) => [
|
|
1187
|
+
renderSlot(_ctx.$slots, `content::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
1188
|
+
]),
|
|
1189
|
+
key: "1"
|
|
1190
|
+
} : void 0
|
|
1191
|
+
]),
|
|
1112
1192
|
1040
|
|
1113
1193
|
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
1114
1194
|
);
|
|
@@ -3373,6 +3453,31 @@ const VvDropdownProps = {
|
|
|
3373
3453
|
validator: (value) => Object.values(DropdownRole).includes(value)
|
|
3374
3454
|
}
|
|
3375
3455
|
};
|
|
3456
|
+
const VvDropdownItemProps = {
|
|
3457
|
+
focusOnHover: {
|
|
3458
|
+
type: Boolean,
|
|
3459
|
+
default: false
|
|
3460
|
+
}
|
|
3461
|
+
};
|
|
3462
|
+
const VvDropdownOptionProps = {
|
|
3463
|
+
...DisabledProps,
|
|
3464
|
+
...SelectedProps,
|
|
3465
|
+
...UnselectableProps,
|
|
3466
|
+
...ModifiersProps,
|
|
3467
|
+
deselectHintLabel: {
|
|
3468
|
+
type: String
|
|
3469
|
+
},
|
|
3470
|
+
selectHintLabel: {
|
|
3471
|
+
type: String
|
|
3472
|
+
},
|
|
3473
|
+
selectedHintLabel: {
|
|
3474
|
+
type: String
|
|
3475
|
+
},
|
|
3476
|
+
focusOnHover: {
|
|
3477
|
+
type: Boolean,
|
|
3478
|
+
default: false
|
|
3479
|
+
}
|
|
3480
|
+
};
|
|
3376
3481
|
function useProvideDropdownTrigger({
|
|
3377
3482
|
reference,
|
|
3378
3483
|
id,
|
|
@@ -3403,14 +3508,14 @@ function useProvideDropdownTrigger({
|
|
|
3403
3508
|
}
|
|
3404
3509
|
function useProvideDropdownItem({
|
|
3405
3510
|
role,
|
|
3406
|
-
|
|
3511
|
+
...others
|
|
3407
3512
|
}) {
|
|
3408
3513
|
const itemRole = computed(
|
|
3409
3514
|
() => role.value === DropdownRole.listbox ? DropdownItemRole.option : DropdownItemRole.presentation
|
|
3410
3515
|
);
|
|
3411
3516
|
provide(INJECTION_KEY_DROPDOWN_ITEM, {
|
|
3412
3517
|
role: itemRole,
|
|
3413
|
-
|
|
3518
|
+
...others
|
|
3414
3519
|
});
|
|
3415
3520
|
return { itemRole };
|
|
3416
3521
|
}
|
|
@@ -3661,7 +3766,6 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3661
3766
|
});
|
|
3662
3767
|
bus.on("click", toggle);
|
|
3663
3768
|
const { role, modifiers } = toRefs(props);
|
|
3664
|
-
const { itemRole } = useProvideDropdownItem({ role, expanded });
|
|
3665
3769
|
const bemCssClasses = useModifiers(
|
|
3666
3770
|
"vv-dropdown",
|
|
3667
3771
|
modifiers,
|
|
@@ -3730,6 +3834,13 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3730
3834
|
}
|
|
3731
3835
|
});
|
|
3732
3836
|
};
|
|
3837
|
+
const hovered = useElementHover(floatingEl);
|
|
3838
|
+
const { itemRole } = useProvideDropdownItem({
|
|
3839
|
+
role,
|
|
3840
|
+
expanded,
|
|
3841
|
+
focused,
|
|
3842
|
+
hovered
|
|
3843
|
+
});
|
|
3733
3844
|
onKeyStroke("Escape", (e) => {
|
|
3734
3845
|
if (expanded.value) {
|
|
3735
3846
|
e.preventDefault();
|
|
@@ -3855,7 +3966,9 @@ const __default__$d = {
|
|
|
3855
3966
|
};
|
|
3856
3967
|
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
3857
3968
|
...__default__$d,
|
|
3969
|
+
props: VvDropdownItemProps,
|
|
3858
3970
|
setup(__props) {
|
|
3971
|
+
const props = __props;
|
|
3859
3972
|
const { role, expanded } = useInjectedDropdownItem();
|
|
3860
3973
|
const element = ref(null);
|
|
3861
3974
|
useProvideDropdownAction({ expanded });
|
|
@@ -3863,7 +3976,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3863
3976
|
const { focused } = useFocus(element);
|
|
3864
3977
|
const { focused: focusedWithin } = useFocusWithin(element);
|
|
3865
3978
|
watch(hovered, (newValue) => {
|
|
3866
|
-
if (newValue) {
|
|
3979
|
+
if (newValue && props.focusOnHover) {
|
|
3867
3980
|
focused.value = true;
|
|
3868
3981
|
}
|
|
3869
3982
|
});
|
|
@@ -3890,21 +4003,7 @@ const __default__$c = {
|
|
|
3890
4003
|
};
|
|
3891
4004
|
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
3892
4005
|
...__default__$c,
|
|
3893
|
-
props:
|
|
3894
|
-
...DisabledProps,
|
|
3895
|
-
...SelectedProps,
|
|
3896
|
-
...UnselectableProps,
|
|
3897
|
-
...ModifiersProps,
|
|
3898
|
-
deselectHintLabel: {
|
|
3899
|
-
type: String
|
|
3900
|
-
},
|
|
3901
|
-
selectHintLabel: {
|
|
3902
|
-
type: String
|
|
3903
|
-
},
|
|
3904
|
-
selectedHintLabel: {
|
|
3905
|
-
type: String
|
|
3906
|
-
}
|
|
3907
|
-
},
|
|
4006
|
+
props: VvDropdownOptionProps,
|
|
3908
4007
|
setup(__props) {
|
|
3909
4008
|
const props = __props;
|
|
3910
4009
|
const { modifiers } = toRefs(props);
|
|
@@ -3930,7 +4029,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
3930
4029
|
class: normalizeClass(unref(bemCssClasses)),
|
|
3931
4030
|
tabindex: _ctx.disabled ? -1 : 0,
|
|
3932
4031
|
"aria-selected": _ctx.selected,
|
|
3933
|
-
"aria-disabled": _ctx.disabled
|
|
4032
|
+
"aria-disabled": _ctx.disabled,
|
|
4033
|
+
"focus-on-hover": _ctx.focusOnHover
|
|
3934
4034
|
}, {
|
|
3935
4035
|
default: withCtx(() => [
|
|
3936
4036
|
renderSlot(_ctx.$slots, "default"),
|
|
@@ -3949,7 +4049,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
3949
4049
|
]),
|
|
3950
4050
|
_: 3
|
|
3951
4051
|
/* FORWARDED */
|
|
3952
|
-
}, 8, ["class", "tabindex", "aria-selected", "aria-disabled"]);
|
|
4052
|
+
}, 8, ["class", "tabindex", "aria-selected", "aria-disabled", "focus-on-hover"]);
|
|
3953
4053
|
};
|
|
3954
4054
|
}
|
|
3955
4055
|
});
|
|
@@ -4047,7 +4147,7 @@ const _hoisted_4$4 = { class: "vv-select__inner" };
|
|
|
4047
4147
|
const _hoisted_5$4 = ["id"];
|
|
4048
4148
|
const _hoisted_6$4 = ["disabled", "hidden"];
|
|
4049
4149
|
const _hoisted_7$4 = ["disabled", "value"];
|
|
4050
|
-
const _hoisted_8$
|
|
4150
|
+
const _hoisted_8$3 = ["disabled", "label"];
|
|
4051
4151
|
const _hoisted_9$2 = ["disabled", "value"];
|
|
4052
4152
|
const _hoisted_10$1 = {
|
|
4053
4153
|
key: 1,
|
|
@@ -4236,7 +4336,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
4236
4336
|
128
|
|
4237
4337
|
/* KEYED_FRAGMENT */
|
|
4238
4338
|
))
|
|
4239
|
-
], 8, _hoisted_8$
|
|
4339
|
+
], 8, _hoisted_8$3))
|
|
4240
4340
|
],
|
|
4241
4341
|
64
|
|
4242
4342
|
/* STABLE_FRAGMENT */
|
|
@@ -4316,7 +4416,7 @@ const _hoisted_7$3 = {
|
|
|
4316
4416
|
key: 0,
|
|
4317
4417
|
class: "vv-select__value"
|
|
4318
4418
|
};
|
|
4319
|
-
const _hoisted_8$
|
|
4419
|
+
const _hoisted_8$2 = ["aria-label", "onClick"];
|
|
4320
4420
|
const _hoisted_9$1 = {
|
|
4321
4421
|
key: 1,
|
|
4322
4422
|
class: "vv-select__input-after"
|
|
@@ -4689,7 +4789,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4689
4789
|
onClick: withModifiers(($event) => onInput(option), ["stop"])
|
|
4690
4790
|
}, [
|
|
4691
4791
|
createVNode(_sfc_main$u, { name: "close" })
|
|
4692
|
-
], 8, _hoisted_8$
|
|
4792
|
+
], 8, _hoisted_8$2)) : createCommentVNode("v-if", true)
|
|
4693
4793
|
]),
|
|
4694
4794
|
_: 2
|
|
4695
4795
|
/* DYNAMIC */
|
|
@@ -4762,6 +4862,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4762
4862
|
}, {
|
|
4763
4863
|
key: i,
|
|
4764
4864
|
class: "vv-dropdown-option",
|
|
4865
|
+
"focus-on-hover": "",
|
|
4765
4866
|
onClickPassive: ($event) => onInput(item)
|
|
4766
4867
|
}), {
|
|
4767
4868
|
default: withCtx(() => [
|
|
@@ -4797,6 +4898,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4797
4898
|
selectedHintLabel: unref(propsDefaults).selectedHintLabel
|
|
4798
4899
|
}, {
|
|
4799
4900
|
class: "vv-dropdown-option",
|
|
4901
|
+
"focus-on-hover": "",
|
|
4800
4902
|
onClickPassive: ($event) => onInput(option)
|
|
4801
4903
|
}), {
|
|
4802
4904
|
default: withCtx(() => [
|
|
@@ -5231,6 +5333,7 @@ const VvInputTextEvents = [
|
|
|
5231
5333
|
];
|
|
5232
5334
|
const VvInputTextProps = {
|
|
5233
5335
|
...InputTextareaProps,
|
|
5336
|
+
...StorageProps,
|
|
5234
5337
|
/**
|
|
5235
5338
|
* Input value
|
|
5236
5339
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
@@ -5299,6 +5402,14 @@ const VvInputTextProps = {
|
|
|
5299
5402
|
type: [String, Object],
|
|
5300
5403
|
default: ACTION_ICONS.clear
|
|
5301
5404
|
},
|
|
5405
|
+
/**
|
|
5406
|
+
* VvIcon name for remove suggestion button
|
|
5407
|
+
* @see VVIcon
|
|
5408
|
+
*/
|
|
5409
|
+
iconRemoveSuggestion: {
|
|
5410
|
+
type: [String, Object],
|
|
5411
|
+
default: ACTION_ICONS.remove
|
|
5412
|
+
},
|
|
5302
5413
|
/**
|
|
5303
5414
|
* Label for step up button
|
|
5304
5415
|
*/
|
|
@@ -5334,6 +5445,13 @@ const VvInputTextProps = {
|
|
|
5334
5445
|
type: String,
|
|
5335
5446
|
default: "Clear"
|
|
5336
5447
|
},
|
|
5448
|
+
/**
|
|
5449
|
+
* Label for remove suggestion button
|
|
5450
|
+
*/
|
|
5451
|
+
labelRemoveSuggestion: {
|
|
5452
|
+
type: String,
|
|
5453
|
+
default: "Remove suggestion"
|
|
5454
|
+
},
|
|
5337
5455
|
/**
|
|
5338
5456
|
* iMask options
|
|
5339
5457
|
* @see https://imask.js.org/guide.html
|
|
@@ -5375,6 +5493,13 @@ const VvInputTextProps = {
|
|
|
5375
5493
|
selectOnFocus: {
|
|
5376
5494
|
type: Boolean,
|
|
5377
5495
|
default: false
|
|
5496
|
+
},
|
|
5497
|
+
/**
|
|
5498
|
+
* Maximum number of suggestions
|
|
5499
|
+
*/
|
|
5500
|
+
maxSuggestions: {
|
|
5501
|
+
type: Number,
|
|
5502
|
+
default: 5
|
|
5378
5503
|
}
|
|
5379
5504
|
};
|
|
5380
5505
|
const VvInputPasswordAction = defineComponent({
|
|
@@ -5669,24 +5794,25 @@ function useTextCount(text, options) {
|
|
|
5669
5794
|
};
|
|
5670
5795
|
}
|
|
5671
5796
|
const _hoisted_1$6 = ["for"];
|
|
5672
|
-
const _hoisted_2$4 = {
|
|
5673
|
-
const _hoisted_3$2 = {
|
|
5797
|
+
const _hoisted_2$4 = {
|
|
5674
5798
|
key: 0,
|
|
5675
5799
|
class: "vv-input-text__input-before"
|
|
5676
5800
|
};
|
|
5677
|
-
const
|
|
5678
|
-
const
|
|
5801
|
+
const _hoisted_3$2 = ["id"];
|
|
5802
|
+
const _hoisted_4$2 = {
|
|
5679
5803
|
key: 1,
|
|
5680
5804
|
class: "vv-input-text__unit"
|
|
5681
5805
|
};
|
|
5682
|
-
const
|
|
5806
|
+
const _hoisted_5$2 = {
|
|
5683
5807
|
key: 5,
|
|
5684
5808
|
class: "vv-input-text__input-after"
|
|
5685
5809
|
};
|
|
5686
|
-
const
|
|
5810
|
+
const _hoisted_6$2 = {
|
|
5687
5811
|
key: 6,
|
|
5688
5812
|
class: "vv-input-text__limit"
|
|
5689
5813
|
};
|
|
5814
|
+
const _hoisted_7$2 = { class: "flex-1" };
|
|
5815
|
+
const _hoisted_8$1 = ["title", "onClick"];
|
|
5690
5816
|
const __default__$6 = {
|
|
5691
5817
|
name: "VvInputText"
|
|
5692
5818
|
};
|
|
@@ -5707,6 +5833,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5707
5833
|
id,
|
|
5708
5834
|
icon,
|
|
5709
5835
|
iconPosition,
|
|
5836
|
+
iconRemoveSuggestion,
|
|
5710
5837
|
label,
|
|
5711
5838
|
modelValue,
|
|
5712
5839
|
count,
|
|
@@ -5718,7 +5845,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5718
5845
|
minlength,
|
|
5719
5846
|
type,
|
|
5720
5847
|
iMask,
|
|
5721
|
-
step
|
|
5848
|
+
step,
|
|
5849
|
+
storageKey,
|
|
5850
|
+
storageType
|
|
5722
5851
|
} = toRefs(props);
|
|
5723
5852
|
const hasId = useUniqueId(id);
|
|
5724
5853
|
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
@@ -5822,6 +5951,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5822
5951
|
);
|
|
5823
5952
|
const inputEl = el;
|
|
5824
5953
|
const innerEl = ref();
|
|
5954
|
+
const wrapperEl = ref();
|
|
5955
|
+
const dropdownEl = ref();
|
|
5825
5956
|
__expose({ $inner: innerEl });
|
|
5826
5957
|
const localModelValue = useDebouncedInput(
|
|
5827
5958
|
modelValue,
|
|
@@ -5833,9 +5964,27 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5833
5964
|
() => focused.value && !props.disabled && !props.readonly
|
|
5834
5965
|
);
|
|
5835
5966
|
watch(isFocused, (newValue) => {
|
|
5967
|
+
var _a;
|
|
5836
5968
|
if (newValue && propsDefaults.value.selectOnFocus && inputEl.value) {
|
|
5837
5969
|
inputEl.value.select();
|
|
5838
5970
|
}
|
|
5971
|
+
if (newValue) {
|
|
5972
|
+
(_a = dropdownEl.value) == null ? void 0 : _a.show();
|
|
5973
|
+
return;
|
|
5974
|
+
}
|
|
5975
|
+
setTimeout(() => {
|
|
5976
|
+
if (isDirty.value && suggestions.value) {
|
|
5977
|
+
const suggestionsLimit = props.maxSuggestions - 1;
|
|
5978
|
+
if (suggestions.value.size > suggestionsLimit && !suggestions.value.has(localModelValue.value)) {
|
|
5979
|
+
suggestions.value = new Set(
|
|
5980
|
+
[...suggestions.value].slice(
|
|
5981
|
+
suggestions.value.size - suggestionsLimit
|
|
5982
|
+
)
|
|
5983
|
+
);
|
|
5984
|
+
}
|
|
5985
|
+
suggestions.value.add(localModelValue.value);
|
|
5986
|
+
}
|
|
5987
|
+
}, 300);
|
|
5839
5988
|
});
|
|
5840
5989
|
const isVisible = useElementVisibility(inputEl);
|
|
5841
5990
|
watch(isVisible, (newValue) => {
|
|
@@ -5894,6 +6043,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5894
6043
|
}
|
|
5895
6044
|
return void 0;
|
|
5896
6045
|
});
|
|
6046
|
+
const { hasIcon: hasIconRemoveSuggestion } = useComponentIcon(iconRemoveSuggestion);
|
|
5897
6047
|
const { formatted: countFormatted } = useTextCount(localModelValue, {
|
|
5898
6048
|
mode: count.value,
|
|
5899
6049
|
upperLimit: Number(maxlength == null ? void 0 : maxlength.value),
|
|
@@ -5913,6 +6063,31 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5913
6063
|
}
|
|
5914
6064
|
return void 0;
|
|
5915
6065
|
});
|
|
6066
|
+
const suggestions = usePersistence(
|
|
6067
|
+
storageKey,
|
|
6068
|
+
storageType,
|
|
6069
|
+
/* @__PURE__ */ new Set()
|
|
6070
|
+
);
|
|
6071
|
+
const filteredSuggestions = computed(() => {
|
|
6072
|
+
if (!suggestions.value) {
|
|
6073
|
+
return [];
|
|
6074
|
+
}
|
|
6075
|
+
return [...suggestions.value].filter(
|
|
6076
|
+
(suggestion) => isEmpty(localModelValue.value) || `${suggestion}`.toLowerCase().includes(`${localModelValue.value}`.toLowerCase()) && suggestion !== localModelValue.value
|
|
6077
|
+
);
|
|
6078
|
+
});
|
|
6079
|
+
const hasSuggestions = computed(
|
|
6080
|
+
() => (storageKey == null ? void 0 : storageKey.value) && suggestions.value && suggestions.value.size > 0
|
|
6081
|
+
);
|
|
6082
|
+
const onSuggestionSelect = (suggestion) => {
|
|
6083
|
+
var _a;
|
|
6084
|
+
localModelValue.value = suggestion;
|
|
6085
|
+
(_a = dropdownEl.value) == null ? void 0 : _a.hide();
|
|
6086
|
+
};
|
|
6087
|
+
const onSuggestionRemove = (suggestion) => {
|
|
6088
|
+
var _a;
|
|
6089
|
+
(_a = suggestions.value) == null ? void 0 : _a.delete(suggestion);
|
|
6090
|
+
};
|
|
5916
6091
|
const { modifiers } = toRefs(props);
|
|
5917
6092
|
const bemCssClasses = useModifiers(
|
|
5918
6093
|
"vv-input-text",
|
|
@@ -6043,79 +6218,89 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6043
6218
|
for: unref(hasId),
|
|
6044
6219
|
class: "vv-input-text__label"
|
|
6045
6220
|
}, toDisplayString(unref(label)), 9, _hoisted_1$6)) : createCommentVNode("v-if", true),
|
|
6046
|
-
createElementVNode(
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
"
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6221
|
+
createElementVNode(
|
|
6222
|
+
"div",
|
|
6223
|
+
{
|
|
6224
|
+
ref_key: "wrapperEl",
|
|
6225
|
+
ref: wrapperEl,
|
|
6226
|
+
class: "vv-input-text__wrapper"
|
|
6227
|
+
},
|
|
6228
|
+
[
|
|
6229
|
+
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
|
|
6230
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
6231
|
+
])) : createCommentVNode("v-if", true),
|
|
6232
|
+
createElementVNode(
|
|
6233
|
+
"div",
|
|
6234
|
+
{
|
|
6235
|
+
ref_key: "innerEl",
|
|
6236
|
+
ref: innerEl,
|
|
6237
|
+
class: "vv-input-text__inner",
|
|
6238
|
+
onClick: withModifiers(onClickInner, ["stop"])
|
|
6239
|
+
},
|
|
6240
|
+
[
|
|
6241
|
+
unref(hasIconBefore) ? (openBlock(), createBlock(
|
|
6242
|
+
_sfc_main$u,
|
|
6243
|
+
mergeProps({ key: 0 }, unref(hasIconBefore), { class: "vv-input-text__icon" }),
|
|
6244
|
+
null,
|
|
6245
|
+
16
|
|
6246
|
+
/* FULL_PROPS */
|
|
6247
|
+
)) : createCommentVNode("v-if", true),
|
|
6248
|
+
createElementVNode("input", mergeProps({
|
|
6249
|
+
id: unref(hasId),
|
|
6250
|
+
ref_key: "inputEl",
|
|
6251
|
+
ref: inputEl
|
|
6252
|
+
}, unref(hasAttrs), {
|
|
6253
|
+
style: unref(hasStyle),
|
|
6254
|
+
onKeyup: _cache[0] || (_cache[0] = ($event) => emit("keyup", $event)),
|
|
6255
|
+
onKeydown: onKeyDown,
|
|
6256
|
+
onKeypress: _cache[1] || (_cache[1] = ($event) => emit("keypress", $event))
|
|
6257
|
+
}), null, 16, _hoisted_3$2),
|
|
6258
|
+
(_ctx.unit || _ctx.$slots.unit) && unref(isDirty) ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
6259
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
|
|
6260
|
+
createTextVNode(
|
|
6261
|
+
toDisplayString(_ctx.unit),
|
|
6262
|
+
1
|
|
6263
|
+
/* TEXT */
|
|
6264
|
+
)
|
|
6265
|
+
])
|
|
6266
|
+
])) : createCommentVNode("v-if", true)
|
|
6267
|
+
],
|
|
6268
|
+
512
|
|
6269
|
+
/* NEED_PATCH */
|
|
6270
|
+
),
|
|
6271
|
+
unref(iconAfter) ? (openBlock(), createBlock(
|
|
6272
|
+
_sfc_main$u,
|
|
6273
|
+
mergeProps({ key: 1 }, unref(iconAfter), { class: "vv-input-text__icon vv-input-text__icon-after" }),
|
|
6274
|
+
null,
|
|
6275
|
+
16
|
|
6276
|
+
/* FULL_PROPS */
|
|
6277
|
+
)) : unref(isPassword) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(PasswordInputActions), {
|
|
6278
|
+
key: 2,
|
|
6279
|
+
onTogglePassword
|
|
6280
|
+
})) : unref(isNumber) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(NumberInputActions), {
|
|
6281
|
+
key: 3,
|
|
6282
|
+
onStepUp,
|
|
6283
|
+
onStepDown
|
|
6284
|
+
})) : unref(isSearch) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(SearchInputActions), {
|
|
6285
|
+
key: 4,
|
|
6286
|
+
onClear
|
|
6287
|
+
})) : createCommentVNode("v-if", true),
|
|
6288
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
|
|
6289
|
+
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
6290
|
+
])) : createCommentVNode("v-if", true),
|
|
6291
|
+
unref(count) ? (openBlock(), createElementBlock("span", _hoisted_6$2, [
|
|
6292
|
+
renderSlot(_ctx.$slots, "count", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
|
|
6293
|
+
createTextVNode(
|
|
6294
|
+
toDisplayString(unref(countFormatted)),
|
|
6295
|
+
1
|
|
6296
|
+
/* TEXT */
|
|
6297
|
+
)
|
|
6298
|
+
])
|
|
6299
|
+
])) : createCommentVNode("v-if", true)
|
|
6300
|
+
],
|
|
6301
|
+
512
|
|
6302
|
+
/* NEED_PATCH */
|
|
6303
|
+
),
|
|
6119
6304
|
createVNode(unref(HintSlot), {
|
|
6120
6305
|
id: unref(hasHintId),
|
|
6121
6306
|
class: "vv-input-text__hint"
|
|
@@ -6151,7 +6336,62 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6151
6336
|
]),
|
|
6152
6337
|
key: "3"
|
|
6153
6338
|
} : void 0
|
|
6154
|
-
]), 1032, ["id"])
|
|
6339
|
+
]), 1032, ["id"]),
|
|
6340
|
+
unref(hasSuggestions) ? (openBlock(), createBlock(_sfc_main$i, {
|
|
6341
|
+
key: 1,
|
|
6342
|
+
ref_key: "dropdownEl",
|
|
6343
|
+
ref: dropdownEl,
|
|
6344
|
+
reference: unref(wrapperEl),
|
|
6345
|
+
"autofocus-first": false,
|
|
6346
|
+
"trigger-width": true
|
|
6347
|
+
}, {
|
|
6348
|
+
items: withCtx(() => [
|
|
6349
|
+
(openBlock(true), createElementBlock(
|
|
6350
|
+
Fragment,
|
|
6351
|
+
null,
|
|
6352
|
+
renderList(unref(filteredSuggestions), (value) => {
|
|
6353
|
+
return openBlock(), createBlock(_sfc_main$g, {
|
|
6354
|
+
key: value,
|
|
6355
|
+
onClick: withModifiers(($event) => onSuggestionSelect(value), ["stop"])
|
|
6356
|
+
}, {
|
|
6357
|
+
default: withCtx(() => [
|
|
6358
|
+
createElementVNode("div", _hoisted_7$2, [
|
|
6359
|
+
renderSlot(_ctx.$slots, "suggestion", normalizeProps(guardReactiveProps({ value })), () => [
|
|
6360
|
+
createTextVNode(
|
|
6361
|
+
toDisplayString(value),
|
|
6362
|
+
1
|
|
6363
|
+
/* TEXT */
|
|
6364
|
+
)
|
|
6365
|
+
])
|
|
6366
|
+
]),
|
|
6367
|
+
unref(suggestions) && unref(hasIconRemoveSuggestion) ? (openBlock(), createElementBlock("button", {
|
|
6368
|
+
key: 0,
|
|
6369
|
+
type: "button",
|
|
6370
|
+
tabindex: "-1",
|
|
6371
|
+
class: "cursor-pointer",
|
|
6372
|
+
title: _ctx.labelRemoveSuggestion,
|
|
6373
|
+
onClick: withModifiers(($event) => onSuggestionRemove(value), ["stop"])
|
|
6374
|
+
}, [
|
|
6375
|
+
createVNode(
|
|
6376
|
+
_sfc_main$u,
|
|
6377
|
+
normalizeProps(guardReactiveProps(unref(hasIconRemoveSuggestion))),
|
|
6378
|
+
null,
|
|
6379
|
+
16
|
|
6380
|
+
/* FULL_PROPS */
|
|
6381
|
+
)
|
|
6382
|
+
], 8, _hoisted_8$1)) : createCommentVNode("v-if", true)
|
|
6383
|
+
]),
|
|
6384
|
+
_: 2
|
|
6385
|
+
/* DYNAMIC */
|
|
6386
|
+
}, 1032, ["onClick"]);
|
|
6387
|
+
}),
|
|
6388
|
+
128
|
|
6389
|
+
/* KEYED_FRAGMENT */
|
|
6390
|
+
))
|
|
6391
|
+
]),
|
|
6392
|
+
_: 3
|
|
6393
|
+
/* FORWARDED */
|
|
6394
|
+
}, 8, ["reference"])) : createCommentVNode("v-if", true)
|
|
6155
6395
|
],
|
|
6156
6396
|
2
|
|
6157
6397
|
/* CLASS */
|