@volverjs/ui-vue 0.0.10-beta.75 → 0.0.10-beta.77
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 +8 -8
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +3 -3
- package/dist/components/VvAccordion/VvAccordion.es.js +9 -9
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +14 -15
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +10 -13
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +19 -19
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +19 -19
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +7 -8
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +1 -1
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +12 -18
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +32 -38
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +1 -1
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +10 -12
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +15 -20
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +266 -285
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +22 -14
- package/dist/components/VvCombobox/index.d.ts +22 -0
- package/dist/components/VvDialog/VvDialog.es.js +5 -7
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +10 -15
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -2
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +11 -14
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +5 -5
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +45 -57
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +54 -66
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNav.es.js +16 -21
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +10 -13
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +1 -1
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +10 -12
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +15 -20
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +27 -30
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +3 -3
- package/dist/components/VvTab/VvTab.es.js +18 -25
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +47 -57
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +1 -1
- package/dist/components/VvTooltip/VvTooltip.es.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +346 -394
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/index.es.js +10 -15
- package/dist/composables/index.umd.js +1 -1
- package/dist/directives/index.es.js +9 -14
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +8 -13
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +1 -1
- 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/index.es.js +9 -12
- package/dist/index.umd.js +1 -1
- package/dist/resolvers/unplugin.es.js +1 -1
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +2 -2
- package/dist/stories/Combobox/Combobox.stories.d.ts +1 -0
- package/package.json +35 -32
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { inject, computed, toRef, unref, defineComponent, useAttrs, useId, toRefs, ref, watch, onBeforeUnmount, createElementBlock, openBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, onMounted, isRef, provide, watchEffect, reactive, nextTick, Fragment, renderList, createBlock, mergeProps, createSlots, withCtx, getCurrentInstance, resolveComponent, resolveDynamicComponent, mergeDefaults, createCommentVNode, createVNode, TransitionGroup, toHandlers, useSlots, h, withDirectives, vModelCheckbox, Transition, normalizeStyle, vShow, vModelSelect, withKeys, vModelText, vModelRadio } from "vue";
|
|
1
|
+
import { inject, computed, toRef, unref, defineComponent, useAttrs, useId, toRefs, ref, watch, onBeforeUnmount, createElementBlock, openBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, onMounted, isRef, provide, watchEffect, reactive, nextTick, Fragment, renderList, createBlock, mergeProps, createSlots, withCtx, getCurrentInstance, resolveComponent, resolveDynamicComponent, mergeDefaults, createCommentVNode, createVNode, TransitionGroup, toHandlers, useSlots, h, withDirectives, vModelCheckbox, Transition, normalizeStyle, vShow, vModelSelect, mergeModels, useModel, withKeys, vModelText, vModelRadio } from "vue";
|
|
2
2
|
import { useVModel, useStorage, useMutationObserver, onClickOutside, useFocusWithin, useElementHover, onKeyStroke, useFocus, useElementVisibility, refDebounced, computedAsync } from "@vueuse/core";
|
|
3
3
|
import mitt from "mitt";
|
|
4
4
|
import { iconLoaded, Icon, addIcon } from "@iconify/vue";
|
|
5
|
-
import {
|
|
5
|
+
import { getProperty } from "dot-prop";
|
|
6
6
|
import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
7
7
|
import Sortable from "vuedraggable";
|
|
8
8
|
import { useIMask } from "vue-imask";
|
|
@@ -646,7 +646,7 @@ function useGroupStateInject(groupKey) {
|
|
|
646
646
|
const group = inject(groupKey, void 0);
|
|
647
647
|
const isInGroup = computed(() => group !== void 0);
|
|
648
648
|
function getGroupOrLocalRef(propName, props, emit) {
|
|
649
|
-
const groupPropValue = group
|
|
649
|
+
const groupPropValue = group?.[propName];
|
|
650
650
|
if (groupPropValue) {
|
|
651
651
|
return computed({
|
|
652
652
|
get() {
|
|
@@ -711,11 +711,11 @@ function useGroupProps$3(props) {
|
|
|
711
711
|
INJECTION_KEY_ACCORDION_GROUP
|
|
712
712
|
);
|
|
713
713
|
const disabled = computed(
|
|
714
|
-
() => Boolean(props.disabled ||
|
|
714
|
+
() => Boolean(props.disabled || group?.disabled.value)
|
|
715
715
|
);
|
|
716
716
|
const modifiers = computed(() => {
|
|
717
717
|
let localModifiers = props.modifiers;
|
|
718
|
-
let groupModifiers = group
|
|
718
|
+
let groupModifiers = group?.modifiers.value;
|
|
719
719
|
const toReturn = /* @__PURE__ */ new Set();
|
|
720
720
|
if (localModifiers) {
|
|
721
721
|
if (!Array.isArray(localModifiers)) {
|
|
@@ -737,7 +737,7 @@ function useGroupProps$3(props) {
|
|
|
737
737
|
group,
|
|
738
738
|
modifiers,
|
|
739
739
|
disabled,
|
|
740
|
-
bus: group
|
|
740
|
+
bus: group?.bus
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
743
|
function useModifiers(prefix, modifiers, others) {
|
|
@@ -745,7 +745,7 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
745
745
|
const toReturn = {
|
|
746
746
|
[prefix]: true
|
|
747
747
|
};
|
|
748
|
-
const modifiersArray = typeof
|
|
748
|
+
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
749
749
|
if (modifiersArray) {
|
|
750
750
|
if (Array.isArray(modifiersArray)) {
|
|
751
751
|
modifiersArray.forEach((modifier) => {
|
|
@@ -779,7 +779,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
779
779
|
const attrs = useAttrs();
|
|
780
780
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
781
781
|
const accordionName = computed(
|
|
782
|
-
() => props.name ||
|
|
782
|
+
() => props.name || attrs?.id || useId()
|
|
783
783
|
);
|
|
784
784
|
const { title, content, not } = toRefs(props);
|
|
785
785
|
const { isInGroup, modifiers, disabled, bus } = useGroupProps$3(props);
|
|
@@ -796,7 +796,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
796
796
|
watch(isExpanded, (newValue) => {
|
|
797
797
|
modelValue.value = not.value ? !newValue : newValue;
|
|
798
798
|
});
|
|
799
|
-
bus
|
|
799
|
+
bus?.on("toggle", ({ name, value }) => {
|
|
800
800
|
if (name !== accordionName.value) {
|
|
801
801
|
return;
|
|
802
802
|
}
|
|
@@ -807,7 +807,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
807
807
|
return;
|
|
808
808
|
}
|
|
809
809
|
if (isInGroup.value) {
|
|
810
|
-
bus
|
|
810
|
+
bus?.emit("toggle", {
|
|
811
811
|
name: accordionName.value,
|
|
812
812
|
value: !isExpanded.value
|
|
813
813
|
});
|
|
@@ -862,7 +862,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
862
862
|
);
|
|
863
863
|
return;
|
|
864
864
|
}
|
|
865
|
-
bus
|
|
865
|
+
bus?.emit("collapse", { name });
|
|
866
866
|
}
|
|
867
867
|
__expose({
|
|
868
868
|
isExpanded,
|
|
@@ -983,7 +983,7 @@ function usePersistence(storageKey, storageType = StorageType.local, defaultValu
|
|
|
983
983
|
if (newKey) {
|
|
984
984
|
storageValue = useStorage(
|
|
985
985
|
newKey,
|
|
986
|
-
|
|
986
|
+
storageValue?.value ?? localValue.value,
|
|
987
987
|
storage
|
|
988
988
|
);
|
|
989
989
|
if (storageValue.value) {
|
|
@@ -1000,12 +1000,12 @@ function usePersistence(storageKey, storageType = StorageType.local, defaultValu
|
|
|
1000
1000
|
}
|
|
1001
1001
|
if (isRef(storageType)) {
|
|
1002
1002
|
watch(storageType, (newType, oldType) => {
|
|
1003
|
-
if (storageKey
|
|
1003
|
+
if (storageKey?.value) {
|
|
1004
1004
|
if (newType) {
|
|
1005
1005
|
const storage = newType === StorageType.session ? sessionStorage : localStorage;
|
|
1006
1006
|
storageValue = useStorage(
|
|
1007
1007
|
storageKey.value,
|
|
1008
|
-
|
|
1008
|
+
storageValue?.value ?? localValue.value,
|
|
1009
1009
|
storage
|
|
1010
1010
|
);
|
|
1011
1011
|
}
|
|
@@ -1218,9 +1218,8 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
1218
1218
|
return openBlock(), createBlock(
|
|
1219
1219
|
_sfc_main$x,
|
|
1220
1220
|
mergeProps({
|
|
1221
|
-
key: item.title
|
|
1222
|
-
|
|
1223
|
-
}, {
|
|
1221
|
+
key: item.title
|
|
1222
|
+
}, { ref_for: true }, {
|
|
1224
1223
|
name: item.name,
|
|
1225
1224
|
title: item.title,
|
|
1226
1225
|
content: item.content
|
|
@@ -1302,7 +1301,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1302
1301
|
}
|
|
1303
1302
|
);
|
|
1304
1303
|
const pressed = computed(() => {
|
|
1305
|
-
return props.pressed ||
|
|
1304
|
+
return props.pressed || dropdownExpanded?.value;
|
|
1306
1305
|
});
|
|
1307
1306
|
const { role } = useInjectedDropdownAction();
|
|
1308
1307
|
const hasTag = computed(() => {
|
|
@@ -1310,7 +1309,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1310
1309
|
case props.disabled:
|
|
1311
1310
|
return ActionTag.button;
|
|
1312
1311
|
case props.to !== void 0:
|
|
1313
|
-
return
|
|
1312
|
+
return volver?.nuxt ? resolveComponent(ActionTag.nuxtLink) : ActionTag.routerLink;
|
|
1314
1313
|
case props.href !== void 0:
|
|
1315
1314
|
return ActionTag.a;
|
|
1316
1315
|
default:
|
|
@@ -1319,10 +1318,10 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1319
1318
|
});
|
|
1320
1319
|
const hasProps = computed(() => {
|
|
1321
1320
|
const toReturn = {
|
|
1322
|
-
...dropdownAria
|
|
1321
|
+
...dropdownAria?.value,
|
|
1323
1322
|
ariaPressed: pressed.value ? true : void 0,
|
|
1324
1323
|
ariaLabel: props.ariaLabel,
|
|
1325
|
-
role: role
|
|
1324
|
+
role: role?.value
|
|
1326
1325
|
};
|
|
1327
1326
|
switch (hasTag.value) {
|
|
1328
1327
|
case ActionTag.a:
|
|
@@ -1350,32 +1349,29 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1350
1349
|
}
|
|
1351
1350
|
});
|
|
1352
1351
|
function onClick(e) {
|
|
1353
|
-
var _a;
|
|
1354
1352
|
if (props.disabled) {
|
|
1355
1353
|
e.preventDefault();
|
|
1356
1354
|
return;
|
|
1357
1355
|
}
|
|
1358
|
-
if (
|
|
1356
|
+
if (instance?.vnode.props?.onClick) {
|
|
1359
1357
|
emit("click", e);
|
|
1360
1358
|
return;
|
|
1361
1359
|
}
|
|
1362
|
-
dropdownEventBus
|
|
1360
|
+
dropdownEventBus?.emit("click", e);
|
|
1363
1361
|
}
|
|
1364
1362
|
function onMouseover(e) {
|
|
1365
|
-
|
|
1366
|
-
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseover) {
|
|
1363
|
+
if (instance?.vnode.props?.onMouseover) {
|
|
1367
1364
|
emit("mouseover", e);
|
|
1368
1365
|
return;
|
|
1369
1366
|
}
|
|
1370
|
-
dropdownEventBus
|
|
1367
|
+
dropdownEventBus?.emit("mouseover", e);
|
|
1371
1368
|
}
|
|
1372
1369
|
function onMouseleave(e) {
|
|
1373
|
-
|
|
1374
|
-
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseleave) {
|
|
1370
|
+
if (instance?.vnode.props?.onMouseleave) {
|
|
1375
1371
|
emit("mouseleave", e);
|
|
1376
1372
|
return;
|
|
1377
1373
|
}
|
|
1378
|
-
dropdownEventBus
|
|
1374
|
+
dropdownEventBus?.emit("mouseleave", e);
|
|
1379
1375
|
}
|
|
1380
1376
|
return (_ctx, _cache) => {
|
|
1381
1377
|
return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
|
|
@@ -1410,32 +1406,32 @@ function useInjectedAlertGroup() {
|
|
|
1410
1406
|
return inject(INJECTION_KEY_ALERT_GROUP, {});
|
|
1411
1407
|
}
|
|
1412
1408
|
function useUniqueId(id) {
|
|
1413
|
-
return computed(() => String(
|
|
1409
|
+
return computed(() => String(id?.value || useId()));
|
|
1414
1410
|
}
|
|
1415
1411
|
function useComponentIcon(icon, iconPosition) {
|
|
1416
1412
|
const hasIcon = computed(() => {
|
|
1417
|
-
if (typeof
|
|
1418
|
-
return { name: icon
|
|
1413
|
+
if (typeof icon?.value === "string") {
|
|
1414
|
+
return { name: icon?.value };
|
|
1419
1415
|
}
|
|
1420
|
-
return icon
|
|
1416
|
+
return icon?.value;
|
|
1421
1417
|
});
|
|
1422
1418
|
const hasIconBefore = computed(
|
|
1423
|
-
() =>
|
|
1419
|
+
() => iconPosition?.value === Position.before ? hasIcon.value : void 0
|
|
1424
1420
|
);
|
|
1425
1421
|
const hasIconAfter = computed(
|
|
1426
|
-
() =>
|
|
1422
|
+
() => iconPosition?.value === Position.after ? hasIcon.value : void 0
|
|
1427
1423
|
);
|
|
1428
1424
|
const hasIconLeft = computed(
|
|
1429
|
-
() =>
|
|
1425
|
+
() => iconPosition?.value === Side.left ? hasIcon.value : void 0
|
|
1430
1426
|
);
|
|
1431
1427
|
const hasIconRight = computed(
|
|
1432
|
-
() =>
|
|
1428
|
+
() => iconPosition?.value === Side.right ? hasIcon.value : void 0
|
|
1433
1429
|
);
|
|
1434
1430
|
const hasIconTop = computed(
|
|
1435
|
-
() =>
|
|
1431
|
+
() => iconPosition?.value === Side.top ? hasIcon.value : void 0
|
|
1436
1432
|
);
|
|
1437
1433
|
const hasIconBottom = computed(
|
|
1438
|
-
() =>
|
|
1434
|
+
() => iconPosition?.value === Side.bottom ? hasIcon.value : void 0
|
|
1439
1435
|
);
|
|
1440
1436
|
return {
|
|
1441
1437
|
hasIcon,
|
|
@@ -1535,7 +1531,7 @@ function useVvAlert(props, emit) {
|
|
|
1535
1531
|
clearTimeout(timeout);
|
|
1536
1532
|
}
|
|
1537
1533
|
emit("close", hasId.value);
|
|
1538
|
-
bus
|
|
1534
|
+
bus?.emit("close", hasId.value);
|
|
1539
1535
|
};
|
|
1540
1536
|
watch(
|
|
1541
1537
|
() => props.autoClose,
|
|
@@ -1628,7 +1624,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1628
1624
|
const { modifiers } = toRefs(props);
|
|
1629
1625
|
const bemCssClasses = useModifiers("vv-icon", modifiers);
|
|
1630
1626
|
const provider = computed(() => {
|
|
1631
|
-
return props.provider ||
|
|
1627
|
+
return props.provider || volver?.iconsProvider;
|
|
1632
1628
|
});
|
|
1633
1629
|
const icon = computed(() => {
|
|
1634
1630
|
const name = props.name ?? "";
|
|
@@ -1636,7 +1632,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1636
1632
|
if (iconLoaded(iconName)) {
|
|
1637
1633
|
return iconName;
|
|
1638
1634
|
}
|
|
1639
|
-
const iconsCollection = volver
|
|
1635
|
+
const iconsCollection = volver?.iconsCollections.find(
|
|
1640
1636
|
(iconsCollection2) => {
|
|
1641
1637
|
const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
|
|
1642
1638
|
return iconLoaded(icon2);
|
|
@@ -1660,7 +1656,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1660
1656
|
}
|
|
1661
1657
|
function addIconFromSvg(svg) {
|
|
1662
1658
|
const svgContentEl = getSvgContent(svg);
|
|
1663
|
-
const svgContent =
|
|
1659
|
+
const svgContent = svgContentEl?.innerHTML.trim() || "";
|
|
1664
1660
|
if (svgContentEl && svgContent) {
|
|
1665
1661
|
addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
|
|
1666
1662
|
body: svgContent,
|
|
@@ -1679,7 +1675,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1679
1675
|
show.value = true;
|
|
1680
1676
|
}
|
|
1681
1677
|
}).catch((e) => {
|
|
1682
|
-
throw new Error(`Error during fetch icon: ${e
|
|
1678
|
+
throw new Error(`Error during fetch icon: ${e?.message}`);
|
|
1683
1679
|
});
|
|
1684
1680
|
}
|
|
1685
1681
|
}
|
|
@@ -1771,15 +1767,15 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
1771
1767
|
(...args) => unref(close) && unref(close)(...args),
|
|
1772
1768
|
["stop"]
|
|
1773
1769
|
))
|
|
1774
|
-
}, _cache[1] || (_cache[1] = [
|
|
1770
|
+
}, [..._cache[1] || (_cache[1] = [
|
|
1775
1771
|
createElementVNode(
|
|
1776
1772
|
"div",
|
|
1777
1773
|
{ class: "vv-alert__close-mask" },
|
|
1778
1774
|
null,
|
|
1779
1775
|
-1
|
|
1780
|
-
/*
|
|
1776
|
+
/* CACHED */
|
|
1781
1777
|
)
|
|
1782
|
-
]), 8, _hoisted_3$7)) : createCommentVNode("v-if", true)
|
|
1778
|
+
])], 8, _hoisted_3$7)) : createCommentVNode("v-if", true)
|
|
1783
1779
|
])
|
|
1784
1780
|
])) : createCommentVNode("v-if", true),
|
|
1785
1781
|
_ctx.$slots.default || _ctx.content ? (openBlock(), createElementBlock("div", _hoisted_4$6, [
|
|
@@ -2067,17 +2063,17 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
2067
2063
|
const { modifiers, items, toShow, totalItems, avatarModifiers } = toRefs(props);
|
|
2068
2064
|
const bemCssClasses = useModifiers("vv-avatar-group", modifiers);
|
|
2069
2065
|
const stringModifiers = computed(() => {
|
|
2070
|
-
if (
|
|
2066
|
+
if (avatarModifiers?.value && Array.isArray(avatarModifiers?.value)) {
|
|
2071
2067
|
return avatarModifiers.value.join(" ");
|
|
2072
2068
|
}
|
|
2073
|
-
return
|
|
2069
|
+
return avatarModifiers?.value || "";
|
|
2074
2070
|
});
|
|
2075
2071
|
const avatarItems = computed(() => {
|
|
2076
2072
|
return items.value.slice(0, toShow.value).map((item) => {
|
|
2077
2073
|
let modifiers2 = [];
|
|
2078
2074
|
let itemModifiers = [];
|
|
2079
|
-
if (avatarModifiers
|
|
2080
|
-
modifiers2 = Array.isArray(avatarModifiers
|
|
2075
|
+
if (avatarModifiers?.value) {
|
|
2076
|
+
modifiers2 = Array.isArray(avatarModifiers?.value) ? avatarModifiers?.value : [avatarModifiers?.value];
|
|
2081
2077
|
}
|
|
2082
2078
|
if (item.modifiers) {
|
|
2083
2079
|
itemModifiers = Array.isArray(item.modifiers) ? item.modifiers : [item.modifiers];
|
|
@@ -2104,9 +2100,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
2104
2100
|
return openBlock(), createBlock(
|
|
2105
2101
|
_sfc_main$r,
|
|
2106
2102
|
mergeProps({
|
|
2107
|
-
key: avatarItem.key
|
|
2108
|
-
|
|
2109
|
-
}, {
|
|
2103
|
+
key: avatarItem.key
|
|
2104
|
+
}, { ref_for: true }, {
|
|
2110
2105
|
modifiers: avatarItem.modifiers,
|
|
2111
2106
|
imgSrc: avatarItem.imgSrc
|
|
2112
2107
|
}),
|
|
@@ -2203,10 +2198,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
2203
2198
|
const props = __props;
|
|
2204
2199
|
const { modifiers } = toRefs(props);
|
|
2205
2200
|
const bemCssClasses = useModifiers("vv-breadcrumb", modifiers);
|
|
2206
|
-
const length = computed(() =>
|
|
2207
|
-
var _a;
|
|
2208
|
-
return ((_a = props.routes) == null ? void 0 : _a.length) ?? 0;
|
|
2209
|
-
});
|
|
2201
|
+
const length = computed(() => props.routes?.length ?? 0);
|
|
2210
2202
|
const isLast = (index) => index === length.value - 1;
|
|
2211
2203
|
return (_ctx, _cache) => {
|
|
2212
2204
|
return openBlock(), createElementBlock(
|
|
@@ -2326,10 +2318,10 @@ function useGroupProps$2(props, emit) {
|
|
|
2326
2318
|
const modelValue = getGroupOrLocalRef("modelValue", props, emit);
|
|
2327
2319
|
const toggle = getGroupOrLocalRef("toggle", props);
|
|
2328
2320
|
const unselectable = getGroupOrLocalRef("unselectable", props);
|
|
2329
|
-
const multiple = computed(() =>
|
|
2321
|
+
const multiple = computed(() => group?.multiple.value ?? false);
|
|
2330
2322
|
const modifiers = computed(() => {
|
|
2331
2323
|
let localModifiers = props.modifiers;
|
|
2332
|
-
let groupModifiers = group
|
|
2324
|
+
let groupModifiers = group?.modifiers.value;
|
|
2333
2325
|
const toReturn = /* @__PURE__ */ new Set();
|
|
2334
2326
|
if (localModifiers) {
|
|
2335
2327
|
if (!Array.isArray(localModifiers)) {
|
|
@@ -2346,7 +2338,7 @@ function useGroupProps$2(props, emit) {
|
|
|
2346
2338
|
return Array.from(toReturn);
|
|
2347
2339
|
});
|
|
2348
2340
|
const disabled = computed(
|
|
2349
|
-
() => Boolean(props.disabled ||
|
|
2341
|
+
() => Boolean(props.disabled || group?.disabled.value)
|
|
2350
2342
|
);
|
|
2351
2343
|
return {
|
|
2352
2344
|
// group props
|
|
@@ -2466,12 +2458,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
2466
2458
|
unselectable
|
|
2467
2459
|
} = useGroupProps$2(props, emit);
|
|
2468
2460
|
const hasId = useUniqueId(id);
|
|
2469
|
-
const name = computed(() =>
|
|
2461
|
+
const name = computed(() => attrs?.name || hasId.value);
|
|
2470
2462
|
const element = ref(null);
|
|
2471
|
-
const $el = computed(() =>
|
|
2472
|
-
var _a;
|
|
2473
|
-
return (_a = element.value) == null ? void 0 : _a.$el;
|
|
2474
|
-
});
|
|
2463
|
+
const $el = computed(() => element.value?.$el);
|
|
2475
2464
|
__expose({ $el });
|
|
2476
2465
|
const pressed = computed(() => {
|
|
2477
2466
|
if (!toggle.value) {
|
|
@@ -2493,7 +2482,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
2493
2482
|
iconPosition.value
|
|
2494
2483
|
),
|
|
2495
2484
|
"icon-only": Boolean(
|
|
2496
|
-
|
|
2485
|
+
icon?.value && !label?.value && !slots.default
|
|
2497
2486
|
)
|
|
2498
2487
|
}))
|
|
2499
2488
|
);
|
|
@@ -2775,10 +2764,10 @@ function useGroupProps$1(props, emit) {
|
|
|
2775
2764
|
const valid = getGroupOrLocalRef("valid", props);
|
|
2776
2765
|
const invalid = getGroupOrLocalRef("invalid", props);
|
|
2777
2766
|
const readonly = computed(
|
|
2778
|
-
() => Boolean(props.readonly ||
|
|
2767
|
+
() => Boolean(props.readonly || group?.readonly.value)
|
|
2779
2768
|
);
|
|
2780
2769
|
const disabled = computed(
|
|
2781
|
-
() => Boolean(props.disabled ||
|
|
2770
|
+
() => Boolean(props.disabled || group?.disabled.value)
|
|
2782
2771
|
);
|
|
2783
2772
|
return {
|
|
2784
2773
|
// local props
|
|
@@ -2857,7 +2846,6 @@ function HintSlotFactory(propsOrRef, slots) {
|
|
|
2857
2846
|
};
|
|
2858
2847
|
},
|
|
2859
2848
|
render() {
|
|
2860
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2861
2849
|
if (this.isVisible) {
|
|
2862
2850
|
let role;
|
|
2863
2851
|
if (this.hasInvalidLabelOrSlot) {
|
|
@@ -2872,7 +2860,7 @@ function HintSlotFactory(propsOrRef, slots) {
|
|
|
2872
2860
|
{
|
|
2873
2861
|
role
|
|
2874
2862
|
},
|
|
2875
|
-
|
|
2863
|
+
this.$slots.loading?.() ?? this.loadingLabel
|
|
2876
2864
|
);
|
|
2877
2865
|
}
|
|
2878
2866
|
if (this.hasInvalidLabelOrSlot) {
|
|
@@ -2881,7 +2869,7 @@ function HintSlotFactory(propsOrRef, slots) {
|
|
|
2881
2869
|
{
|
|
2882
2870
|
role
|
|
2883
2871
|
},
|
|
2884
|
-
|
|
2872
|
+
this.$slots.invalid?.() ?? this.$slots.invalid ?? this.invalidLabel
|
|
2885
2873
|
);
|
|
2886
2874
|
}
|
|
2887
2875
|
if (this.hasValidLabelOrSlot) {
|
|
@@ -2890,7 +2878,7 @@ function HintSlotFactory(propsOrRef, slots) {
|
|
|
2890
2878
|
{
|
|
2891
2879
|
role
|
|
2892
2880
|
},
|
|
2893
|
-
|
|
2881
|
+
this.$slots.valid?.() ?? this.validLabel
|
|
2894
2882
|
);
|
|
2895
2883
|
}
|
|
2896
2884
|
return h(
|
|
@@ -2898,7 +2886,7 @@ function HintSlotFactory(propsOrRef, slots) {
|
|
|
2898
2886
|
{
|
|
2899
2887
|
role
|
|
2900
2888
|
},
|
|
2901
|
-
|
|
2889
|
+
this.$slots.hint?.() ?? this.$slots.hint ?? this.hintLabel
|
|
2902
2890
|
);
|
|
2903
2891
|
}
|
|
2904
2892
|
return null;
|
|
@@ -2916,8 +2904,7 @@ function HintSlotFactory(propsOrRef, slots) {
|
|
|
2916
2904
|
function useDefaults(componentName, propsDefinition, props) {
|
|
2917
2905
|
const volver = useVolver();
|
|
2918
2906
|
const volverComponentDefaults = computed(() => {
|
|
2919
|
-
|
|
2920
|
-
if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
|
|
2907
|
+
if (!volver || !volver.defaults.value?.[componentName]) {
|
|
2921
2908
|
return void 0;
|
|
2922
2909
|
}
|
|
2923
2910
|
return volver.defaults.value[componentName];
|
|
@@ -3179,7 +3166,7 @@ function useOptions(props) {
|
|
|
3179
3166
|
return labelKey.value(option);
|
|
3180
3167
|
}
|
|
3181
3168
|
return String(
|
|
3182
|
-
labelKey.value ?
|
|
3169
|
+
labelKey.value ? getProperty(option, labelKey.value) : option
|
|
3183
3170
|
);
|
|
3184
3171
|
};
|
|
3185
3172
|
const getOptionValue = (option) => {
|
|
@@ -3189,7 +3176,7 @@ function useOptions(props) {
|
|
|
3189
3176
|
if (typeof valueKey.value === "function") {
|
|
3190
3177
|
return valueKey.value(option);
|
|
3191
3178
|
}
|
|
3192
|
-
return valueKey.value ?
|
|
3179
|
+
return valueKey.value ? getProperty(option, valueKey.value) : option;
|
|
3193
3180
|
};
|
|
3194
3181
|
const isOptionDisabled = (option) => {
|
|
3195
3182
|
if (typeof option === "string") {
|
|
@@ -3198,7 +3185,7 @@ function useOptions(props) {
|
|
|
3198
3185
|
if (typeof disabledKey.value === "function") {
|
|
3199
3186
|
return disabledKey.value(option);
|
|
3200
3187
|
}
|
|
3201
|
-
return disabledKey.value ?
|
|
3188
|
+
return disabledKey.value ? Boolean(getProperty(option, disabledKey.value)) : false;
|
|
3202
3189
|
};
|
|
3203
3190
|
const getOptionGrouped = (option) => {
|
|
3204
3191
|
if (typeof option == "string") {
|
|
@@ -3286,10 +3273,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
3286
3273
|
renderList(_ctx.options, (option, index) => {
|
|
3287
3274
|
return openBlock(), createBlock(
|
|
3288
3275
|
_sfc_main$k,
|
|
3289
|
-
mergeProps({
|
|
3290
|
-
key: index,
|
|
3291
|
-
ref_for: true
|
|
3292
|
-
}, getOptionProps(option, index)),
|
|
3276
|
+
mergeProps({ key: index }, { ref_for: true }, getOptionProps(option, index)),
|
|
3293
3277
|
null,
|
|
3294
3278
|
16
|
|
3295
3279
|
/* FULL_PROPS */
|
|
@@ -3384,6 +3368,13 @@ const VvComboboxProps = {
|
|
|
3384
3368
|
* Label for no options available
|
|
3385
3369
|
*/
|
|
3386
3370
|
noOptionsLabel: { type: String, default: "No options available" },
|
|
3371
|
+
/**
|
|
3372
|
+
* Label for selected option not found
|
|
3373
|
+
*/
|
|
3374
|
+
selectedOptionNotFoundLabel: {
|
|
3375
|
+
type: String,
|
|
3376
|
+
default: "Selected option not found"
|
|
3377
|
+
},
|
|
3387
3378
|
/**
|
|
3388
3379
|
* Label for selected option hint
|
|
3389
3380
|
*/
|
|
@@ -3420,6 +3411,10 @@ const VvComboboxProps = {
|
|
|
3420
3411
|
* Use input text to search on options
|
|
3421
3412
|
*/
|
|
3422
3413
|
searchable: Boolean,
|
|
3414
|
+
/**
|
|
3415
|
+
* If true, the search input will retain its value even when the dropdown is closed
|
|
3416
|
+
*/
|
|
3417
|
+
keepSearch: Boolean,
|
|
3423
3418
|
/**
|
|
3424
3419
|
* Search function to filter options
|
|
3425
3420
|
*/
|
|
@@ -3562,7 +3557,7 @@ const VvInputClearAction = defineComponent({
|
|
|
3562
3557
|
setup(props, { emit }) {
|
|
3563
3558
|
const { hasIcon } = useComponentIcon(computed(() => props.icon));
|
|
3564
3559
|
function onClick(e) {
|
|
3565
|
-
e
|
|
3560
|
+
e?.stopPropagation();
|
|
3566
3561
|
if (!props.disabled) {
|
|
3567
3562
|
emit("clear");
|
|
3568
3563
|
}
|
|
@@ -3661,8 +3656,7 @@ function useDropdownProvideTrigger({
|
|
|
3661
3656
|
});
|
|
3662
3657
|
},
|
|
3663
3658
|
render() {
|
|
3664
|
-
|
|
3665
|
-
return h(Fragment, {}, (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a));
|
|
3659
|
+
return h(Fragment, {}, this.$slots.default?.());
|
|
3666
3660
|
}
|
|
3667
3661
|
});
|
|
3668
3662
|
return {
|
|
@@ -3739,8 +3733,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3739
3733
|
useMutationObserver(
|
|
3740
3734
|
floatingEl.value,
|
|
3741
3735
|
() => {
|
|
3742
|
-
|
|
3743
|
-
hasCustomPosition.value = ((_a = window.getComputedStyle(floatingEl.value).getPropertyValue("--dropdown-custom-position")) == null ? void 0 : _a.trim()) === "true";
|
|
3736
|
+
hasCustomPosition.value = window.getComputedStyle(floatingEl.value).getPropertyValue("--dropdown-custom-position")?.trim() === "true";
|
|
3744
3737
|
},
|
|
3745
3738
|
{
|
|
3746
3739
|
attributeFilter: ["style"],
|
|
@@ -3827,11 +3820,10 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3827
3820
|
}
|
|
3828
3821
|
);
|
|
3829
3822
|
const dropdownPlacement = computed(() => {
|
|
3830
|
-
var _a;
|
|
3831
3823
|
if (hasCustomPosition.value) {
|
|
3832
3824
|
return void 0;
|
|
3833
3825
|
}
|
|
3834
|
-
const width = props.triggerWidth && referenceEl.value ? `${
|
|
3826
|
+
const width = props.triggerWidth && referenceEl.value ? `${referenceEl.value?.offsetWidth}px` : void 0;
|
|
3835
3827
|
return {
|
|
3836
3828
|
position: strategy.value,
|
|
3837
3829
|
top: `${y.value ?? 0}px`,
|
|
@@ -3845,7 +3837,6 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3845
3837
|
() => placement.value.split("-")[0]
|
|
3846
3838
|
);
|
|
3847
3839
|
const arrowPlacement = computed(() => {
|
|
3848
|
-
var _a, _b, _c, _d, _e;
|
|
3849
3840
|
if (hasCustomPosition.value) {
|
|
3850
3841
|
return void 0;
|
|
3851
3842
|
}
|
|
@@ -3856,9 +3847,9 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3856
3847
|
[Side.left]: Side.right
|
|
3857
3848
|
}[side.value];
|
|
3858
3849
|
return {
|
|
3859
|
-
left:
|
|
3860
|
-
top:
|
|
3861
|
-
[staticSide]: `${-(
|
|
3850
|
+
left: middlewareData.value.arrow?.x !== void 0 ? `${middlewareData.value.arrow?.x}px` : void 0,
|
|
3851
|
+
top: middlewareData.value.arrow?.y !== void 0 ? `${middlewareData.value.arrow?.y}px` : void 0,
|
|
3852
|
+
[staticSide]: `${-(arrowEl.value?.offsetWidth ?? 0) / 2}px`
|
|
3862
3853
|
};
|
|
3863
3854
|
});
|
|
3864
3855
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
@@ -3895,8 +3886,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3895
3886
|
{ ignore: [referenceEl] }
|
|
3896
3887
|
);
|
|
3897
3888
|
const hasAriaLabelledby = computed(() => {
|
|
3898
|
-
|
|
3899
|
-
return ((_b = (_a = referenceEl.value) == null ? void 0 : _a.getAttribute) == null ? void 0 : _b.call(_a, "id")) ?? void 0;
|
|
3889
|
+
return referenceEl.value?.getAttribute?.("id") ?? void 0;
|
|
3900
3890
|
});
|
|
3901
3891
|
const referenceAria = computed(() => ({
|
|
3902
3892
|
"aria-controls": hasId.value,
|
|
@@ -4047,7 +4037,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
4047
4037
|
onKeyStroke([" ", "Enter"], (e) => {
|
|
4048
4038
|
const htmlEl = e.target;
|
|
4049
4039
|
if (expanded.value && focused.value && htmlEl) {
|
|
4050
|
-
htmlEl
|
|
4040
|
+
htmlEl?.click();
|
|
4051
4041
|
}
|
|
4052
4042
|
});
|
|
4053
4043
|
const dropdownTransitionHandlers = {
|
|
@@ -4382,11 +4372,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
4382
4372
|
} = HintSlotFactory(propsDefaults, slots);
|
|
4383
4373
|
const { focused } = useComponentFocus(selectEl, emit);
|
|
4384
4374
|
function isGroup(option) {
|
|
4385
|
-
var _a;
|
|
4386
4375
|
if (typeof option === "string") {
|
|
4387
4376
|
return false;
|
|
4388
4377
|
}
|
|
4389
|
-
return
|
|
4378
|
+
return option.options?.length;
|
|
4390
4379
|
}
|
|
4391
4380
|
const {
|
|
4392
4381
|
id,
|
|
@@ -4476,7 +4465,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
4476
4465
|
watch(
|
|
4477
4466
|
() => props.options,
|
|
4478
4467
|
(newValue) => {
|
|
4479
|
-
if (
|
|
4468
|
+
if (newValue?.length && props.autoselectFirst && !isDirty.value) {
|
|
4480
4469
|
const firstOptionValue = getOptionValue(newValue[0]);
|
|
4481
4470
|
localModelValue.value = props.multiple ? [firstOptionValue] : firstOptionValue;
|
|
4482
4471
|
}
|
|
@@ -4680,8 +4669,15 @@ const __default__$b = {
|
|
|
4680
4669
|
};
|
|
4681
4670
|
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
4682
4671
|
...__default__$b,
|
|
4683
|
-
props: useVvComboboxProps(),
|
|
4684
|
-
|
|
4672
|
+
props: /* @__PURE__ */ mergeModels(useVvComboboxProps(), {
|
|
4673
|
+
"search": {
|
|
4674
|
+
type: String,
|
|
4675
|
+
default: "",
|
|
4676
|
+
required: false
|
|
4677
|
+
},
|
|
4678
|
+
"searchModifiers": {}
|
|
4679
|
+
}),
|
|
4680
|
+
emits: /* @__PURE__ */ mergeModels(["update:modelValue", "update:search", "update:options", "focus", "blur", "clear", "change:search"], ["update:search"]),
|
|
4685
4681
|
setup(__props, { emit: __emit }) {
|
|
4686
4682
|
const props = __props;
|
|
4687
4683
|
const emit = __emit;
|
|
@@ -4721,7 +4717,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4721
4717
|
collapse();
|
|
4722
4718
|
}
|
|
4723
4719
|
});
|
|
4724
|
-
const searchText =
|
|
4720
|
+
const searchText = useModel(__props, "search");
|
|
4725
4721
|
const debouncedSearchText = refDebounced(
|
|
4726
4722
|
searchText,
|
|
4727
4723
|
computed(() => Number(props.debounceSearch))
|
|
@@ -4756,16 +4752,15 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4756
4752
|
}
|
|
4757
4753
|
}
|
|
4758
4754
|
function onAfterCollapse() {
|
|
4759
|
-
if (propsDefaults.value.
|
|
4755
|
+
if (!propsDefaults.value.keepSearch) {
|
|
4760
4756
|
searchText.value = "";
|
|
4761
4757
|
}
|
|
4762
4758
|
}
|
|
4763
4759
|
function isGroup(option) {
|
|
4764
|
-
var _a;
|
|
4765
4760
|
if (typeof option === "string") {
|
|
4766
4761
|
return false;
|
|
4767
4762
|
}
|
|
4768
|
-
return
|
|
4763
|
+
return option.options?.length;
|
|
4769
4764
|
}
|
|
4770
4765
|
const {
|
|
4771
4766
|
id,
|
|
@@ -4859,15 +4854,15 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4859
4854
|
} = useOptions(props);
|
|
4860
4855
|
const hasOptions = computed(() => {
|
|
4861
4856
|
const toReturn = [...props.options, ...addedOptions.value];
|
|
4862
|
-
for (const
|
|
4857
|
+
for (const item of localModelValue.value) {
|
|
4863
4858
|
if (!toReturn.some((option) => {
|
|
4864
4859
|
const optionValue = getOptionValue(option);
|
|
4865
|
-
if (typeof optionValue === "object") {
|
|
4866
|
-
return JSON.stringify(optionValue) === JSON.stringify(
|
|
4860
|
+
if (typeof optionValue === "object" && typeof item === "object") {
|
|
4861
|
+
return JSON.stringify(optionValue) === JSON.stringify(item);
|
|
4867
4862
|
}
|
|
4868
|
-
return optionValue ===
|
|
4863
|
+
return optionValue === item;
|
|
4869
4864
|
})) {
|
|
4870
|
-
toReturn.push(
|
|
4865
|
+
toReturn.push(item);
|
|
4871
4866
|
}
|
|
4872
4867
|
}
|
|
4873
4868
|
return toReturn;
|
|
@@ -4881,7 +4876,6 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4881
4876
|
return isOptionDisabled(option) || !isSelectable.value && !isOptionSelected(option);
|
|
4882
4877
|
}
|
|
4883
4878
|
const filteredOptions = computedAsync(async () => {
|
|
4884
|
-
var _a;
|
|
4885
4879
|
if (propsDefaults.value.searchFunction) {
|
|
4886
4880
|
localLoading.value = true;
|
|
4887
4881
|
const toReturn = await Promise.resolve(
|
|
@@ -4893,7 +4887,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4893
4887
|
localLoading.value = false;
|
|
4894
4888
|
return toReturn;
|
|
4895
4889
|
}
|
|
4896
|
-
return
|
|
4890
|
+
return hasOptions.value?.filter((option) => {
|
|
4897
4891
|
return getOptionLabel(option).toLowerCase().includes(debouncedSearchText.value.toLowerCase().trim());
|
|
4898
4892
|
});
|
|
4899
4893
|
});
|
|
@@ -4958,7 +4952,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4958
4952
|
watch(
|
|
4959
4953
|
hasOptions,
|
|
4960
4954
|
(newValue) => {
|
|
4961
|
-
if (
|
|
4955
|
+
if (newValue?.length && props.autoselectFirst && !isDirty.value) {
|
|
4962
4956
|
onInput(newValue[0]);
|
|
4963
4957
|
}
|
|
4964
4958
|
},
|
|
@@ -5026,13 +5020,12 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
5026
5020
|
{ target: inputEl }
|
|
5027
5021
|
);
|
|
5028
5022
|
function onKeyupEnterInputSearch() {
|
|
5029
|
-
|
|
5030
|
-
if ((_a = filteredOptions.value) == null ? void 0 : _a.length) {
|
|
5023
|
+
if (filteredOptions.value?.length) {
|
|
5031
5024
|
if (filteredOptions.value.length === 1) {
|
|
5032
5025
|
onInput(filteredOptions.value[0]);
|
|
5033
5026
|
return;
|
|
5034
5027
|
}
|
|
5035
|
-
|
|
5028
|
+
dropdownEl.value?.focusFirstListElement();
|
|
5036
5029
|
return;
|
|
5037
5030
|
}
|
|
5038
5031
|
if (propsDefaults.value.addable) {
|
|
@@ -5105,64 +5098,50 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
5105
5098
|
tabindex: unref(hasTabindex),
|
|
5106
5099
|
onClickPassive: onClickInput
|
|
5107
5100
|
}), [
|
|
5108
|
-
renderSlot(_ctx.$slots, "value", normalizeProps(
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
toDisplayString(unref(hasValue)),
|
|
5117
|
-
1
|
|
5118
|
-
/* TEXT */
|
|
5119
|
-
)) : (openBlock(true), createElementBlock(
|
|
5120
|
-
Fragment,
|
|
5121
|
-
{ key: 1 },
|
|
5122
|
-
renderList(unref(selectedOptions), (option, index) => {
|
|
5123
|
-
return openBlock(), createBlock(_sfc_main$p, {
|
|
5124
|
-
key: index,
|
|
5125
|
-
modifiers: _ctx.badgeModifiers,
|
|
5126
|
-
class: "vv-select__badge"
|
|
5127
|
-
}, {
|
|
5128
|
-
default: withCtx(() => [
|
|
5129
|
-
createTextVNode(
|
|
5130
|
-
toDisplayString(unref(getOptionLabel)(option)) + " ",
|
|
5131
|
-
1
|
|
5132
|
-
/* TEXT */
|
|
5133
|
-
),
|
|
5134
|
-
unref(isUnselectable) ? (openBlock(), createElementBlock("button", {
|
|
5135
|
-
key: 0,
|
|
5136
|
-
"aria-label": unref(propsDefaults).deselectActionLabel,
|
|
5137
|
-
type: "button",
|
|
5138
|
-
onClick: withModifiers(($event) => onInput(option), ["stop"])
|
|
5139
|
-
}, [
|
|
5140
|
-
createVNode(_sfc_main$u, { name: "close" })
|
|
5141
|
-
], 8, _hoisted_8$3)) : createCommentVNode("v-if", true)
|
|
5142
|
-
]),
|
|
5143
|
-
_: 2
|
|
5144
|
-
/* DYNAMIC */
|
|
5145
|
-
}, 1032, ["modifiers"]);
|
|
5146
|
-
}),
|
|
5147
|
-
128
|
|
5148
|
-
/* KEYED_FRAGMENT */
|
|
5149
|
-
))
|
|
5150
|
-
],
|
|
5151
|
-
64
|
|
5152
|
-
/* STABLE_FRAGMENT */
|
|
5153
|
-
)) : (openBlock(), createElementBlock(
|
|
5101
|
+
unref(hasValue) ? renderSlot(_ctx.$slots, "value", normalizeProps(mergeProps({ key: 0 }, { selectedOptions: unref(selectedOptions), onInput })), () => [
|
|
5102
|
+
!_ctx.badges ? (openBlock(), createElementBlock(
|
|
5103
|
+
"div",
|
|
5104
|
+
_hoisted_7$3,
|
|
5105
|
+
toDisplayString(unref(hasValue)),
|
|
5106
|
+
1
|
|
5107
|
+
/* TEXT */
|
|
5108
|
+
)) : (openBlock(true), createElementBlock(
|
|
5154
5109
|
Fragment,
|
|
5155
5110
|
{ key: 1 },
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5111
|
+
renderList(unref(selectedOptions), (option, index) => {
|
|
5112
|
+
return openBlock(), createBlock(_sfc_main$p, {
|
|
5113
|
+
key: index,
|
|
5114
|
+
modifiers: _ctx.badgeModifiers,
|
|
5115
|
+
class: "vv-select__badge"
|
|
5116
|
+
}, {
|
|
5117
|
+
default: withCtx(() => [
|
|
5118
|
+
createTextVNode(
|
|
5119
|
+
toDisplayString(unref(getOptionLabel)(option)) + " ",
|
|
5120
|
+
1
|
|
5121
|
+
/* TEXT */
|
|
5122
|
+
),
|
|
5123
|
+
unref(isUnselectable) ? (openBlock(), createElementBlock("button", {
|
|
5124
|
+
key: 0,
|
|
5125
|
+
"aria-label": unref(propsDefaults).deselectActionLabel,
|
|
5126
|
+
type: "button",
|
|
5127
|
+
onClick: withModifiers(($event) => onInput(option), ["stop"])
|
|
5128
|
+
}, [
|
|
5129
|
+
createVNode(_sfc_main$u, { name: "close" })
|
|
5130
|
+
], 8, _hoisted_8$3)) : createCommentVNode("v-if", true)
|
|
5131
|
+
]),
|
|
5132
|
+
_: 2
|
|
5133
|
+
/* DYNAMIC */
|
|
5134
|
+
}, 1032, ["modifiers"]);
|
|
5135
|
+
}),
|
|
5136
|
+
128
|
|
5137
|
+
/* KEYED_FRAGMENT */
|
|
5165
5138
|
))
|
|
5139
|
+
]) : renderSlot(_ctx.$slots, "placeholder", { key: 1 }, () => [
|
|
5140
|
+
createTextVNode(
|
|
5141
|
+
toDisplayString(_ctx.placeholder),
|
|
5142
|
+
1
|
|
5143
|
+
/* TEXT */
|
|
5144
|
+
)
|
|
5166
5145
|
])
|
|
5167
5146
|
], 16, _hoisted_6$3),
|
|
5168
5147
|
unref(hasIconAfter) ? (openBlock(), createBlock(
|
|
@@ -5185,151 +5164,145 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
5185
5164
|
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
5186
5165
|
])) : createCommentVNode("v-if", true)
|
|
5187
5166
|
]),
|
|
5188
|
-
items: withCtx(() =>
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
{
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
})) : createCommentVNode("v-if", true)
|
|
5319
|
-
];
|
|
5320
|
-
}),
|
|
5167
|
+
items: withCtx(() => [
|
|
5168
|
+
!unref(disabled) && unref(filteredOptions)?.length ? (openBlock(true), createElementBlock(
|
|
5169
|
+
Fragment,
|
|
5170
|
+
{ key: 0 },
|
|
5171
|
+
renderList(unref(filteredOptions), (option, index) => {
|
|
5172
|
+
return openBlock(), createElementBlock(
|
|
5173
|
+
Fragment,
|
|
5174
|
+
{ key: index },
|
|
5175
|
+
[
|
|
5176
|
+
isGroup(option) ? (openBlock(), createElementBlock(
|
|
5177
|
+
Fragment,
|
|
5178
|
+
{ key: 0 },
|
|
5179
|
+
[
|
|
5180
|
+
createVNode(_sfc_main$h, {
|
|
5181
|
+
label: unref(getOptionLabel)(option)
|
|
5182
|
+
}, null, 8, ["label"]),
|
|
5183
|
+
(openBlock(true), createElementBlock(
|
|
5184
|
+
Fragment,
|
|
5185
|
+
null,
|
|
5186
|
+
renderList(unref(getOptionGrouped)(
|
|
5187
|
+
option
|
|
5188
|
+
), (item, i) => {
|
|
5189
|
+
return openBlock(), createBlock(_sfc_main$f, mergeProps({ ref_for: true }, {
|
|
5190
|
+
selected: isOptionSelected(item),
|
|
5191
|
+
disabled: isOptionDisabledOrNotSelectable(item),
|
|
5192
|
+
unselectable: unref(isUnselectable),
|
|
5193
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
5194
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
5195
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel,
|
|
5196
|
+
focusOnHover: _ctx.focusOnHover
|
|
5197
|
+
}, {
|
|
5198
|
+
key: i,
|
|
5199
|
+
class: "vv-dropdown-option",
|
|
5200
|
+
onClickPassive: ($event) => onInput(item)
|
|
5201
|
+
}), {
|
|
5202
|
+
default: withCtx(() => [
|
|
5203
|
+
renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, {
|
|
5204
|
+
option,
|
|
5205
|
+
selectedOptions: unref(selectedOptions),
|
|
5206
|
+
selected: isOptionSelected(item),
|
|
5207
|
+
disabled: isOptionDisabledOrNotSelectable(item)
|
|
5208
|
+
}), () => [
|
|
5209
|
+
createTextVNode(
|
|
5210
|
+
toDisplayString(unref(getOptionLabel)(item)),
|
|
5211
|
+
1
|
|
5212
|
+
/* TEXT */
|
|
5213
|
+
)
|
|
5214
|
+
])
|
|
5215
|
+
]),
|
|
5216
|
+
_: 2
|
|
5217
|
+
/* DYNAMIC */
|
|
5218
|
+
}, 1040, ["onClickPassive"]);
|
|
5219
|
+
}),
|
|
5220
|
+
128
|
|
5221
|
+
/* KEYED_FRAGMENT */
|
|
5222
|
+
))
|
|
5223
|
+
],
|
|
5224
|
+
64
|
|
5225
|
+
/* STABLE_FRAGMENT */
|
|
5226
|
+
)) : (openBlock(), createBlock(_sfc_main$f, mergeProps({
|
|
5227
|
+
key: 1,
|
|
5228
|
+
ref_for: true
|
|
5229
|
+
}, {
|
|
5230
|
+
selected: isOptionSelected(option),
|
|
5231
|
+
disabled: isOptionDisabledOrNotSelectable(option),
|
|
5232
|
+
unselectable: unref(isUnselectable),
|
|
5233
|
+
deselectHintLabel: unref(propsDefaults).deselectHintLabel,
|
|
5234
|
+
selectHintLabel: unref(propsDefaults).selectHintLabel,
|
|
5235
|
+
selectedHintLabel: unref(propsDefaults).selectedHintLabel,
|
|
5236
|
+
focusOnHover: _ctx.focusOnHover
|
|
5237
|
+
}, {
|
|
5238
|
+
class: "vv-dropdown-option",
|
|
5239
|
+
onClickPassive: ($event) => onInput(option)
|
|
5240
|
+
}), {
|
|
5241
|
+
default: withCtx(() => [
|
|
5242
|
+
renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, {
|
|
5243
|
+
option,
|
|
5244
|
+
selectedOptions: unref(selectedOptions),
|
|
5245
|
+
selected: isOptionSelected(option),
|
|
5246
|
+
disabled: isOptionDisabledOrNotSelectable(option)
|
|
5247
|
+
}), () => [
|
|
5248
|
+
createTextVNode(
|
|
5249
|
+
toDisplayString(unref(getOptionLabel)(option)),
|
|
5250
|
+
1
|
|
5251
|
+
/* TEXT */
|
|
5252
|
+
)
|
|
5253
|
+
])
|
|
5254
|
+
]),
|
|
5255
|
+
_: 2
|
|
5256
|
+
/* DYNAMIC */
|
|
5257
|
+
}, 1040, ["onClickPassive"]))
|
|
5258
|
+
],
|
|
5259
|
+
64
|
|
5260
|
+
/* STABLE_FRAGMENT */
|
|
5261
|
+
);
|
|
5262
|
+
}),
|
|
5263
|
+
128
|
|
5264
|
+
/* KEYED_FRAGMENT */
|
|
5265
|
+
)) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$f, {
|
|
5266
|
+
key: 1,
|
|
5267
|
+
modifiers: "inert"
|
|
5268
|
+
}, {
|
|
5269
|
+
default: withCtx(() => [
|
|
5270
|
+
renderSlot(_ctx.$slots, "no-options", {}, () => [
|
|
5271
|
+
createTextVNode(
|
|
5272
|
+
toDisplayString(unref(propsDefaults).addable && searchText.value.length ? unref(propsDefaults).addOptionHintLabel : unref(propsDefaults).noOptionsLabel),
|
|
5273
|
+
1
|
|
5274
|
+
/* TEXT */
|
|
5275
|
+
)
|
|
5276
|
+
])
|
|
5277
|
+
]),
|
|
5278
|
+
_: 3
|
|
5279
|
+
/* FORWARDED */
|
|
5280
|
+
})) : (openBlock(), createBlock(_sfc_main$f, {
|
|
5281
|
+
key: 2,
|
|
5282
|
+
modifiers: "inert"
|
|
5283
|
+
}, {
|
|
5284
|
+
default: withCtx(() => [
|
|
5285
|
+
renderSlot(_ctx.$slots, "no-results", {}, () => [
|
|
5286
|
+
createTextVNode(
|
|
5287
|
+
toDisplayString(unref(propsDefaults).addable ? unref(propsDefaults).addOptionHintLabel : unref(propsDefaults).noResultsLabel),
|
|
5288
|
+
1
|
|
5289
|
+
/* TEXT */
|
|
5290
|
+
)
|
|
5291
|
+
])
|
|
5292
|
+
]),
|
|
5293
|
+
_: 3
|
|
5294
|
+
/* FORWARDED */
|
|
5295
|
+
}))
|
|
5296
|
+
]),
|
|
5321
5297
|
after: withCtx(() => [
|
|
5322
|
-
renderSlot(_ctx.$slots, "dropdown::after", {}, () =>
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
}, null, 8, ["label"])) : createCommentVNode("v-if", true)
|
|
5331
|
-
];
|
|
5332
|
-
})
|
|
5298
|
+
renderSlot(_ctx.$slots, "dropdown::after", {}, () => [
|
|
5299
|
+
unref(dropdownEl)?.customPosition ? (openBlock(), createBlock(_sfc_main$n, {
|
|
5300
|
+
key: 0,
|
|
5301
|
+
label: unref(propsDefaults).closeLabel,
|
|
5302
|
+
modifiers: "secondary",
|
|
5303
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(dropdownEl).hide())
|
|
5304
|
+
}, null, 8, ["label"])) : createCommentVNode("v-if", true)
|
|
5305
|
+
])
|
|
5333
5306
|
]),
|
|
5334
5307
|
_: 2
|
|
5335
5308
|
/* DYNAMIC */
|
|
@@ -5343,7 +5316,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
5343
5316
|
id: unref(hasSearchId),
|
|
5344
5317
|
ref_key: "inputSearchEl",
|
|
5345
5318
|
ref: inputSearchEl,
|
|
5346
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
5319
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchText.value = $event),
|
|
5347
5320
|
"aria-autocomplete": "list",
|
|
5348
5321
|
"aria-controls": unref(hasDropdownId),
|
|
5349
5322
|
autocomplete: "off",
|
|
@@ -5353,7 +5326,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
5353
5326
|
placeholder: unref(propsDefaults).searchPlaceholder,
|
|
5354
5327
|
onKeyup: withKeys(onKeyupEnterInputSearch, ["enter"])
|
|
5355
5328
|
}, null, 40, _hoisted_3$4)), [
|
|
5356
|
-
[vModelText,
|
|
5329
|
+
[vModelText, searchText.value]
|
|
5357
5330
|
]) : createCommentVNode("v-if", true)
|
|
5358
5331
|
]),
|
|
5359
5332
|
key: "0"
|
|
@@ -5511,17 +5484,15 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
5511
5484
|
const transitioName = computed(() => `vv-dialog--${props.transition}`);
|
|
5512
5485
|
const dialogTransitionHandlers = {
|
|
5513
5486
|
"before-enter": () => {
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
(_b = dialogEl.value) == null ? void 0 : _b.showModal();
|
|
5487
|
+
if (!dialogEl.value?.open) {
|
|
5488
|
+
dialogEl.value?.showModal();
|
|
5517
5489
|
}
|
|
5518
5490
|
emit("open");
|
|
5519
5491
|
emit("beforeEnter");
|
|
5520
5492
|
},
|
|
5521
5493
|
"after-leave": () => {
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
(_b = dialogEl.value) == null ? void 0 : _b.close();
|
|
5494
|
+
if (dialogEl.value?.open) {
|
|
5495
|
+
dialogEl.value?.close();
|
|
5525
5496
|
}
|
|
5526
5497
|
emit("close");
|
|
5527
5498
|
emit("afterLeave");
|
|
@@ -5784,8 +5755,8 @@ function acceptedMimeTypes(acceptValue) {
|
|
|
5784
5755
|
const mimeTypes = [];
|
|
5785
5756
|
const extensions = [];
|
|
5786
5757
|
const wildcards = [];
|
|
5787
|
-
const acceptedTypes = acceptValue
|
|
5788
|
-
if (acceptedTypes
|
|
5758
|
+
const acceptedTypes = acceptValue?.split(",").map((type) => type.trim().toLowerCase());
|
|
5759
|
+
if (acceptedTypes?.length) {
|
|
5789
5760
|
acceptedTypes.forEach((type) => {
|
|
5790
5761
|
if (type.startsWith(".")) {
|
|
5791
5762
|
extensions.push(type);
|
|
@@ -5808,9 +5779,8 @@ function filterFileList(fileList, acceptValue) {
|
|
|
5808
5779
|
}
|
|
5809
5780
|
const { mimeTypes, extensions, wildcards } = acceptedMimeTypes(acceptValue);
|
|
5810
5781
|
return Array.from(fileList).filter((file) => {
|
|
5811
|
-
var _a;
|
|
5812
5782
|
const fileType = file.type.toLowerCase();
|
|
5813
|
-
const fileExtension = `.${
|
|
5783
|
+
const fileExtension = `.${file.name.split(".").pop()?.toLowerCase()}`;
|
|
5814
5784
|
const mimeMatches = mimeTypes.includes(fileType);
|
|
5815
5785
|
const wildcardMatches = wildcards.some((wildcard) => fileType.startsWith(`${wildcard}/`));
|
|
5816
5786
|
const extensionMatches = extensions.some((ext) => fileExtension === ext.toLowerCase());
|
|
@@ -5881,8 +5851,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5881
5851
|
const localModelValue = useVModel(props, "modelValue", emit);
|
|
5882
5852
|
const files = computed({
|
|
5883
5853
|
get: () => {
|
|
5884
|
-
|
|
5885
|
-
if (!localModelValue.value || !Array.isArray(localModelValue.value) && !((_a = localModelValue.value) == null ? void 0 : _a.name)) {
|
|
5854
|
+
if (!localModelValue.value || !Array.isArray(localModelValue.value) && !localModelValue.value?.name) {
|
|
5886
5855
|
return [];
|
|
5887
5856
|
}
|
|
5888
5857
|
return Array.isArray(localModelValue.value) ? localModelValue.value : [localModelValue.value];
|
|
@@ -5892,7 +5861,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5892
5861
|
localModelValue.value = value;
|
|
5893
5862
|
return;
|
|
5894
5863
|
}
|
|
5895
|
-
localModelValue.value = value
|
|
5864
|
+
localModelValue.value = value?.[0];
|
|
5896
5865
|
}
|
|
5897
5866
|
});
|
|
5898
5867
|
const isDisabledOrReadonly = computed(() => props.disabled || props.readonly);
|
|
@@ -5920,16 +5889,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5920
5889
|
isDragging.value = false;
|
|
5921
5890
|
}
|
|
5922
5891
|
function onDrop(event) {
|
|
5923
|
-
|
|
5924
|
-
if (!((_a = event.dataTransfer) == null ? void 0 : _a.files)) {
|
|
5892
|
+
if (!event.dataTransfer?.files) {
|
|
5925
5893
|
return;
|
|
5926
5894
|
}
|
|
5927
5895
|
isDragging.value = false;
|
|
5928
|
-
addFiles(
|
|
5896
|
+
addFiles(event.dataTransfer?.files);
|
|
5929
5897
|
}
|
|
5930
5898
|
function onChange() {
|
|
5931
|
-
|
|
5932
|
-
if (!((_a = inputEl.value) == null ? void 0 : _a.files)) {
|
|
5899
|
+
if (!inputEl.value?.files) {
|
|
5933
5900
|
return;
|
|
5934
5901
|
}
|
|
5935
5902
|
addFiles(inputEl.value.files);
|
|
@@ -6293,7 +6260,7 @@ function getInputValueFromDate(date, typeOfInput = "date", withSeconds) {
|
|
|
6293
6260
|
return `${toReturn}T${time}`;
|
|
6294
6261
|
}
|
|
6295
6262
|
function getDateFromInputValue(value, typeOfInput = "date") {
|
|
6296
|
-
if (!
|
|
6263
|
+
if (!value?.trim()) {
|
|
6297
6264
|
return null;
|
|
6298
6265
|
}
|
|
6299
6266
|
const today = /* @__PURE__ */ new Date();
|
|
@@ -6581,7 +6548,7 @@ const VvInputPasswordAction = defineComponent({
|
|
|
6581
6548
|
);
|
|
6582
6549
|
const { hasIcon } = useComponentIcon(activeIcon);
|
|
6583
6550
|
function onClick(e) {
|
|
6584
|
-
e
|
|
6551
|
+
e?.stopPropagation();
|
|
6585
6552
|
if (!props.disabled) {
|
|
6586
6553
|
active.value = !active.value;
|
|
6587
6554
|
emit("toggle-password", active.value);
|
|
@@ -6638,7 +6605,7 @@ const VvInputStepAction = defineComponent({
|
|
|
6638
6605
|
setup(props, { emit }) {
|
|
6639
6606
|
const isUp = computed(() => props.mode === "up");
|
|
6640
6607
|
const onClick = (e) => {
|
|
6641
|
-
e
|
|
6608
|
+
e?.stopPropagation();
|
|
6642
6609
|
if (!props.disabled) {
|
|
6643
6610
|
emit(isUp.value ? "step-up" : "step-down");
|
|
6644
6611
|
}
|
|
@@ -6749,7 +6716,7 @@ function useDebouncedInput(modelValue, emit, ms = 0, {
|
|
|
6749
6716
|
ms = Number.parseInt(ms);
|
|
6750
6717
|
}
|
|
6751
6718
|
return computed({
|
|
6752
|
-
get: () => getter(modelValue
|
|
6719
|
+
get: () => getter(modelValue?.value),
|
|
6753
6720
|
set: (value) => {
|
|
6754
6721
|
if (timeout) {
|
|
6755
6722
|
clearTimeout(timeout);
|
|
@@ -6765,22 +6732,22 @@ function useTextCount(text, options) {
|
|
|
6765
6732
|
return (unref(text) ?? "").length;
|
|
6766
6733
|
});
|
|
6767
6734
|
const gap = computed(() => {
|
|
6768
|
-
if (
|
|
6735
|
+
if (options?.lowerLimit !== void 0 && length.value < options?.lowerLimit) {
|
|
6769
6736
|
return length.value - options.lowerLimit;
|
|
6770
6737
|
}
|
|
6771
|
-
if (
|
|
6738
|
+
if (options?.upperLimit !== void 0 && length.value < options?.upperLimit) {
|
|
6772
6739
|
return options.upperLimit - length.value;
|
|
6773
6740
|
}
|
|
6774
6741
|
return 0;
|
|
6775
6742
|
});
|
|
6776
6743
|
const formatted = computed(() => {
|
|
6777
|
-
if (
|
|
6744
|
+
if (options?.mode === false) {
|
|
6778
6745
|
return "";
|
|
6779
6746
|
}
|
|
6780
|
-
if (
|
|
6747
|
+
if (options?.mode === "limit" && options?.upperLimit) {
|
|
6781
6748
|
return `${length.value} / ${options.lowerLimit ? `${options.lowerLimit}-` : ""}${options.upperLimit}`;
|
|
6782
6749
|
}
|
|
6783
|
-
if (
|
|
6750
|
+
if (options?.mode === "countdown") {
|
|
6784
6751
|
if (gap.value === 0) {
|
|
6785
6752
|
return void 0;
|
|
6786
6753
|
}
|
|
@@ -6857,7 +6824,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
6857
6824
|
const localModelValue = useDebouncedInput(
|
|
6858
6825
|
modelValue,
|
|
6859
6826
|
emit,
|
|
6860
|
-
|
|
6827
|
+
debounce?.value ?? 0
|
|
6861
6828
|
);
|
|
6862
6829
|
const hasSeconds = computed(() => {
|
|
6863
6830
|
const stepValue = typeof step.value === "number" ? step.value : Number.parseInt(step.value);
|
|
@@ -6894,7 +6861,6 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
6894
6861
|
{
|
|
6895
6862
|
emit,
|
|
6896
6863
|
onAccept: () => {
|
|
6897
|
-
var _a;
|
|
6898
6864
|
if (!maskReady.value) {
|
|
6899
6865
|
return;
|
|
6900
6866
|
}
|
|
@@ -6953,7 +6919,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
6953
6919
|
toReturn.setSeconds(date.getSeconds());
|
|
6954
6920
|
}
|
|
6955
6921
|
if (modelValueDate.value instanceof Date) {
|
|
6956
|
-
if (
|
|
6922
|
+
if (localModelValue.value?.getTime() === toReturn.getTime()) {
|
|
6957
6923
|
return;
|
|
6958
6924
|
}
|
|
6959
6925
|
localModelValue.value = toReturn;
|
|
@@ -6973,13 +6939,12 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
6973
6939
|
}
|
|
6974
6940
|
);
|
|
6975
6941
|
function updateMaskValue(newValue) {
|
|
6976
|
-
var _a;
|
|
6977
6942
|
if (newValue === void 0 || newValue === null) {
|
|
6978
6943
|
typed.value = "";
|
|
6979
6944
|
unmasked.value = "";
|
|
6980
6945
|
return;
|
|
6981
6946
|
}
|
|
6982
|
-
if (
|
|
6947
|
+
if (props.iMask?.mask === Date) {
|
|
6983
6948
|
typed.value = newValue instanceof Date ? newValue : new Date(newValue);
|
|
6984
6949
|
return;
|
|
6985
6950
|
}
|
|
@@ -7036,12 +7001,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
7036
7001
|
() => focused.value && !props.disabled && !props.readonly
|
|
7037
7002
|
);
|
|
7038
7003
|
watch(isFocused, (newValue) => {
|
|
7039
|
-
var _a, _b;
|
|
7040
7004
|
if (newValue && propsDefaults.value.selectOnFocus && inputEl.value) {
|
|
7041
7005
|
inputEl.value.select();
|
|
7042
7006
|
}
|
|
7043
|
-
if (newValue &&
|
|
7044
|
-
|
|
7007
|
+
if (newValue && suggestions.value?.size) {
|
|
7008
|
+
suggestionsDropdownEl.value?.show();
|
|
7045
7009
|
return;
|
|
7046
7010
|
}
|
|
7047
7011
|
if (isDirty.value && suggestions.value) {
|
|
@@ -7074,7 +7038,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
7074
7038
|
function onStepUp() {
|
|
7075
7039
|
if (!isDisabledOrReadonly.value) {
|
|
7076
7040
|
if (props.iMask) {
|
|
7077
|
-
typed.value = Number(typed.value) + Number(
|
|
7041
|
+
typed.value = Number(typed.value) + Number(step?.value ?? 1);
|
|
7078
7042
|
return;
|
|
7079
7043
|
}
|
|
7080
7044
|
inputEl.value.stepUp();
|
|
@@ -7084,7 +7048,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
7084
7048
|
function onStepDown() {
|
|
7085
7049
|
if (!isDisabledOrReadonly.value) {
|
|
7086
7050
|
if (props.iMask) {
|
|
7087
|
-
typed.value = Number(typed.value) - Number(
|
|
7051
|
+
typed.value = Number(typed.value) - Number(step?.value ?? 1);
|
|
7088
7052
|
return;
|
|
7089
7053
|
}
|
|
7090
7054
|
inputEl.value.stepDown();
|
|
@@ -7117,8 +7081,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
7117
7081
|
const { hasIcon: hasIconRemoveSuggestion } = useComponentIcon(iconRemoveSuggestion);
|
|
7118
7082
|
const { formatted: countFormatted } = useTextCount(localModelValue, {
|
|
7119
7083
|
mode: count.value,
|
|
7120
|
-
upperLimit: Number(maxlength
|
|
7121
|
-
lowerLimit: Number(minlength
|
|
7084
|
+
upperLimit: Number(maxlength?.value),
|
|
7085
|
+
lowerLimit: Number(minlength?.value)
|
|
7122
7086
|
});
|
|
7123
7087
|
const isDisabledOrReadonly = computed(() => props.disabled || props.readonly);
|
|
7124
7088
|
const hasTabindex = computed(() => {
|
|
@@ -7134,7 +7098,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
7134
7098
|
}
|
|
7135
7099
|
return void 0;
|
|
7136
7100
|
});
|
|
7137
|
-
const storageKey = computed(() => props.storageKey ?? (
|
|
7101
|
+
const storageKey = computed(() => props.storageKey ?? (volver?.experimentalFeatures.forceInputSuggestions ? props.name : void 0));
|
|
7138
7102
|
const suggestions = usePersistence(
|
|
7139
7103
|
storageKey,
|
|
7140
7104
|
storageType,
|
|
@@ -7149,17 +7113,15 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
7149
7113
|
).reverse();
|
|
7150
7114
|
});
|
|
7151
7115
|
const hasSuggestions = computed(
|
|
7152
|
-
() =>
|
|
7116
|
+
() => storageKey?.value && suggestions.value && suggestions.value.size > 0
|
|
7153
7117
|
);
|
|
7154
7118
|
function onSuggestionSelect(suggestion) {
|
|
7155
|
-
var _a;
|
|
7156
7119
|
localModelValue.value = suggestion;
|
|
7157
|
-
|
|
7120
|
+
suggestionsDropdownEl.value?.hide();
|
|
7158
7121
|
emit("suggestion:selected", suggestion);
|
|
7159
7122
|
}
|
|
7160
7123
|
function onSuggestionRemove(suggestion) {
|
|
7161
|
-
|
|
7162
|
-
(_a = suggestions.value) == null ? void 0 : _a.delete(suggestion);
|
|
7124
|
+
suggestions.value?.delete(suggestion);
|
|
7163
7125
|
emit("suggestion:removed", suggestion);
|
|
7164
7126
|
}
|
|
7165
7127
|
const { modifiers } = toRefs(props);
|
|
@@ -7534,12 +7496,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
7534
7496
|
const emit = __emit;
|
|
7535
7497
|
const { modifiers } = toRefs(props);
|
|
7536
7498
|
function onClick(event) {
|
|
7537
|
-
var _a;
|
|
7538
7499
|
const target = event.target;
|
|
7539
|
-
if (target
|
|
7500
|
+
if (target?.dataset.index) {
|
|
7540
7501
|
const index = Number.parseInt(target.dataset.index);
|
|
7541
|
-
const item =
|
|
7542
|
-
if (!item ||
|
|
7502
|
+
const item = props.items?.[index];
|
|
7503
|
+
if (!item || item?.disabled) {
|
|
7543
7504
|
return;
|
|
7544
7505
|
}
|
|
7545
7506
|
emit("click", item);
|
|
@@ -7565,9 +7526,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
7565
7526
|
renderList(_ctx.items, ({ on = {}, data, ...item }, index) => {
|
|
7566
7527
|
return openBlock(), createBlock(_sfc_main$8, mergeProps({
|
|
7567
7528
|
key: index,
|
|
7568
|
-
"data-index": index
|
|
7569
|
-
|
|
7570
|
-
}, item, toHandlers(on)), {
|
|
7529
|
+
"data-index": index
|
|
7530
|
+
}, { ref_for: true }, item, toHandlers(on)), {
|
|
7571
7531
|
default: withCtx(() => [
|
|
7572
7532
|
renderSlot(_ctx.$slots, "item", mergeProps({ ref_for: true }, { item, data, index }))
|
|
7573
7533
|
]),
|
|
@@ -7678,10 +7638,10 @@ function useGroupProps(props, emit) {
|
|
|
7678
7638
|
const valid = getGroupOrLocalRef("valid", props);
|
|
7679
7639
|
const invalid = getGroupOrLocalRef("invalid", props);
|
|
7680
7640
|
const readonly = computed(
|
|
7681
|
-
() => Boolean(props.readonly ||
|
|
7641
|
+
() => Boolean(props.readonly || group?.readonly.value)
|
|
7682
7642
|
);
|
|
7683
7643
|
const disabled = computed(
|
|
7684
|
-
() => Boolean(props.disabled ||
|
|
7644
|
+
() => Boolean(props.disabled || group?.disabled.value)
|
|
7685
7645
|
);
|
|
7686
7646
|
return {
|
|
7687
7647
|
// local props
|
|
@@ -7905,10 +7865,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
7905
7865
|
renderList(_ctx.options, (option, index) => {
|
|
7906
7866
|
return openBlock(), createBlock(
|
|
7907
7867
|
_sfc_main$4,
|
|
7908
|
-
mergeProps({
|
|
7909
|
-
key: index,
|
|
7910
|
-
ref_for: true
|
|
7911
|
-
}, getOptionProps(option, index)),
|
|
7868
|
+
mergeProps({ key: index }, { ref_for: true }, getOptionProps(option, index)),
|
|
7912
7869
|
null,
|
|
7913
7870
|
16
|
|
7914
7871
|
/* FULL_PROPS */
|
|
@@ -8001,8 +7958,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
8001
7958
|
const localModelValue = ref();
|
|
8002
7959
|
const activeTabKey = computed({
|
|
8003
7960
|
get: () => {
|
|
8004
|
-
|
|
8005
|
-
return props.modelValue || localModelValue.value || ((_a = tabKeys.value) == null ? void 0 : _a[0]);
|
|
7961
|
+
return props.modelValue || localModelValue.value || tabKeys.value?.[0];
|
|
8006
7962
|
},
|
|
8007
7963
|
set: (newValue) => {
|
|
8008
7964
|
localModelValue.value = newValue;
|
|
@@ -8010,10 +7966,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
8010
7966
|
}
|
|
8011
7967
|
});
|
|
8012
7968
|
const hasNavModifiers = computed(() => {
|
|
8013
|
-
var _a;
|
|
8014
7969
|
return [
|
|
8015
7970
|
"tabs",
|
|
8016
|
-
...Array.isArray(props.navModifiers) ? props.navModifiers :
|
|
7971
|
+
...Array.isArray(props.navModifiers) ? props.navModifiers : props.navModifiers?.split(" ") ?? []
|
|
8017
7972
|
];
|
|
8018
7973
|
});
|
|
8019
7974
|
function onNavClick(item) {
|
|
@@ -8215,7 +8170,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8215
8170
|
const hasPlaceholder = computed(
|
|
8216
8171
|
() => props.floating && isEmpty(props.placeholder) ? " " : props.placeholder
|
|
8217
8172
|
);
|
|
8218
|
-
const localModelValue = useDebouncedInput(modelValue, emit, debounce
|
|
8173
|
+
const localModelValue = useDebouncedInput(modelValue, emit, debounce?.value);
|
|
8219
8174
|
const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition);
|
|
8220
8175
|
const { hasIcon: hasIconRemoveSuggestion } = useComponentIcon(iconRemoveSuggestion);
|
|
8221
8176
|
const { focused } = useComponentFocus(textareaEl, emit);
|
|
@@ -8223,12 +8178,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8223
8178
|
() => focused.value && !props.disabled && !props.readonly
|
|
8224
8179
|
);
|
|
8225
8180
|
watch(isFocused, (newValue) => {
|
|
8226
|
-
var _a, _b;
|
|
8227
8181
|
if (newValue && propsDefaults.value.selectOnFocus && textareaEl.value) {
|
|
8228
8182
|
textareaEl.value.select();
|
|
8229
8183
|
}
|
|
8230
|
-
if (newValue &&
|
|
8231
|
-
|
|
8184
|
+
if (newValue && suggestions.value?.size) {
|
|
8185
|
+
suggestionsDropdownEl.value?.show();
|
|
8232
8186
|
return;
|
|
8233
8187
|
}
|
|
8234
8188
|
if (isDirty.value && suggestions.value) {
|
|
@@ -8250,9 +8204,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8250
8204
|
}
|
|
8251
8205
|
});
|
|
8252
8206
|
const { formatted: countFormatted } = useTextCount(localModelValue, {
|
|
8253
|
-
mode: count
|
|
8254
|
-
upperLimit: Number(maxlength
|
|
8255
|
-
lowerLimit: Number(minlength
|
|
8207
|
+
mode: count?.value,
|
|
8208
|
+
upperLimit: Number(maxlength?.value),
|
|
8209
|
+
lowerLimit: Number(minlength?.value)
|
|
8256
8210
|
});
|
|
8257
8211
|
const isClickable = computed(() => !props.disabled && !props.readonly);
|
|
8258
8212
|
const hasTabindex = computed(
|
|
@@ -8268,7 +8222,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8268
8222
|
}
|
|
8269
8223
|
return void 0;
|
|
8270
8224
|
});
|
|
8271
|
-
const storageKey = computed(() => props.storageKey ?? (
|
|
8225
|
+
const storageKey = computed(() => props.storageKey ?? (volver?.experimentalFeatures.forceInputSuggestions ? props.name : void 0));
|
|
8272
8226
|
const suggestions = usePersistence(
|
|
8273
8227
|
storageKey,
|
|
8274
8228
|
storageType,
|
|
@@ -8283,17 +8237,15 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8283
8237
|
).reverse();
|
|
8284
8238
|
});
|
|
8285
8239
|
const hasSuggestions = computed(
|
|
8286
|
-
() =>
|
|
8240
|
+
() => storageKey?.value && suggestions.value && suggestions.value.size > 0
|
|
8287
8241
|
);
|
|
8288
8242
|
function onSuggestionSelect(suggestion) {
|
|
8289
|
-
var _a;
|
|
8290
8243
|
localModelValue.value = suggestion;
|
|
8291
|
-
|
|
8244
|
+
suggestionsDropdownEl.value?.hide();
|
|
8292
8245
|
emit("suggestion:selected", suggestion);
|
|
8293
8246
|
}
|
|
8294
8247
|
function onSuggestionRemove(suggestion) {
|
|
8295
|
-
|
|
8296
|
-
(_a = suggestions.value) == null ? void 0 : _a.delete(suggestion);
|
|
8248
|
+
suggestions.value?.delete(suggestion);
|
|
8297
8249
|
emit("suggestion:removed", suggestion);
|
|
8298
8250
|
}
|
|
8299
8251
|
const {
|