@volverjs/ui-vue 0.0.10-beta.23 → 0.0.10-beta.24

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.
Files changed (89) hide show
  1. package/dist/components/VvAccordion/VvAccordion.es.js +119 -79
  2. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  3. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +18 -4
  4. package/dist/components/VvAccordion/index.d.ts +4 -8
  5. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +250 -119
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +18 -6
  8. package/dist/components/VvAccordionGroup/index.d.ts +3 -1
  9. package/dist/components/VvAction/VvAction.vue.d.ts +1 -1
  10. package/dist/components/VvAlert/VvAlert.vue.d.ts +1 -1
  11. package/dist/components/VvButton/VvButton.es.js +92 -98
  12. package/dist/components/VvButton/VvButton.umd.js +1 -1
  13. package/dist/components/VvButton/VvButton.vue.d.ts +7 -7
  14. package/dist/components/VvButton/index.d.ts +11 -11
  15. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +7 -13
  16. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  17. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +3 -3
  18. package/dist/components/VvCheckbox/VvCheckbox.es.js +81 -87
  19. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  20. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +6 -6
  21. package/dist/components/VvCheckbox/index.d.ts +2 -2
  22. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +15 -29
  23. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  24. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +5 -5
  25. package/dist/components/VvCombobox/VvCombobox.es.js +13 -16
  26. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  27. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +11 -11
  28. package/dist/components/VvCombobox/index.d.ts +1 -1
  29. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +5 -5
  30. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +1 -1
  31. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +1 -1
  32. package/dist/components/VvDropdown/index.d.ts +1 -1
  33. package/dist/components/VvInputFile/VvInputFile.es.js +183 -168
  34. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  35. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +16 -9
  36. package/dist/components/VvInputFile/index.d.ts +12 -3
  37. package/dist/components/VvInputText/VvInputClearAction.d.ts +1 -1
  38. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  39. package/dist/components/VvInputText/VvInputText.vue.d.ts +6 -6
  40. package/dist/components/VvProgress/VvProgress.vue.d.ts +1 -1
  41. package/dist/components/VvRadio/VvRadio.es.js +64 -70
  42. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  43. package/dist/components/VvRadio/VvRadio.vue.d.ts +6 -6
  44. package/dist/components/VvRadio/index.d.ts +6 -6
  45. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +15 -29
  46. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  47. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +5 -5
  48. package/dist/components/VvSelect/VvSelect.vue.d.ts +8 -8
  49. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +5 -5
  50. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +3 -3
  51. package/dist/components/VvTooltip/index.d.ts +1 -1
  52. package/dist/components/index.es.js +462 -323
  53. package/dist/components/index.umd.js +1 -1
  54. package/dist/composables/alert/useInjectAlert.d.ts +1 -6
  55. package/dist/composables/group/useInjectedGroupState.d.ts +4 -5
  56. package/dist/composables/group/useProvideGroupState.d.ts +3 -3
  57. package/dist/constants.d.ts +6 -10
  58. package/dist/icons.es.js +3 -3
  59. package/dist/icons.umd.js +1 -1
  60. package/dist/index.es.js +3 -2
  61. package/dist/index.umd.js +1 -1
  62. package/dist/props/index.d.ts +1 -1
  63. package/dist/resolvers/unplugin.es.js +3 -2
  64. package/dist/resolvers/unplugin.umd.js +1 -1
  65. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +38 -14
  66. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +259 -101
  67. package/dist/types/group.d.ts +37 -15
  68. package/package.json +37 -36
  69. package/src/assets/icons/detailed.json +1 -1
  70. package/src/assets/icons/normal.json +1 -1
  71. package/src/assets/icons/simple.json +1 -1
  72. package/src/components/VvAccordion/VvAccordion.vue +119 -56
  73. package/src/components/VvAccordion/index.ts +8 -23
  74. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +140 -41
  75. package/src/components/VvAccordionGroup/index.ts +3 -1
  76. package/src/components/VvButton/index.ts +7 -12
  77. package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -2
  78. package/src/components/VvCheckbox/index.ts +2 -2
  79. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +1 -2
  80. package/src/components/VvInputFile/VvInputFile.vue +71 -47
  81. package/src/components/VvInputFile/index.ts +5 -4
  82. package/src/components/VvRadio/index.ts +5 -5
  83. package/src/components/VvRadioGroup/VvRadioGroup.vue +1 -2
  84. package/src/composables/group/useInjectedGroupState.ts +20 -16
  85. package/src/composables/group/useProvideGroupState.ts +10 -15
  86. package/src/constants.ts +19 -14
  87. package/src/stories/AccordionGroup/AccordionGroup.test.ts +15 -9
  88. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +1 -1
  89. package/src/types/group.ts +22 -14
@@ -1,11 +1,12 @@
1
- import { unref, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, watch, Fragment, renderList, createBlock, mergeProps, withCtx, resolveDynamicComponent, mergeDefaults, createCommentVNode, createVNode, TransitionGroup, toHandlers, useSlots, h, onMounted, withDirectives, vModelCheckbox, createSlots, nextTick, Transition, normalizeStyle, vShow, vModelSelect, vModelText, vModelRadio, onBeforeUnmount } from "vue";
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, isRef, h, onMounted, withDirectives, vModelCheckbox, createSlots, nextTick, Transition, normalizeStyle, vShow, vModelSelect, vModelText, vModelRadio } from "vue";
2
2
  import { uid } from "uid";
3
- import { useToggle, useStorage, useVModel, useMutationObserver, onClickOutside, useFocusWithin, onKeyStroke, useElementHover, useFocus, useElementVisibility, refDebounced, computedAsync } from "@vueuse/core";
4
- import { iconExists, Icon, addIcon } from "@iconify/vue";
3
+ import { useVModel, useLocalStorage, useMutationObserver, onClickOutside, useFocusWithin, onKeyStroke, useElementHover, useFocus, useElementVisibility, refDebounced, computedAsync } from "@vueuse/core";
5
4
  import mitt from "mitt";
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
+ import Sortable from "vuedraggable";
9
10
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
10
11
  Strategy2["absolute"] = "absolute";
11
12
  Strategy2["fixed"] = "fixed";
@@ -71,10 +72,18 @@ var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
71
72
  return AnchorTarget2;
72
73
  })(AnchorTarget || {});
73
74
  const INJECTION_KEY_VOLVER = Symbol.for("volver");
74
- const INJECTION_KEY_BUTTON_GROUP = Symbol.for("buttonGroup");
75
- const INJECTION_KEY_RADIO_GROUP = Symbol.for("radioGroup");
76
- const INJECTION_KEY_CHECK_GROUP = Symbol.for("checkGroup");
77
- const INJECTION_KEY_ACCORDION_GROUP = Symbol.for("accordionGroup");
75
+ const INJECTION_KEY_BUTTON_GROUP = Symbol.for(
76
+ "buttonGroup"
77
+ );
78
+ const INJECTION_KEY_RADIO_GROUP = Symbol.for(
79
+ "radioGroup"
80
+ );
81
+ const INJECTION_KEY_CHECK_GROUP = Symbol.for(
82
+ "checkGroup"
83
+ );
84
+ const INJECTION_KEY_ACCORDION_GROUP = Symbol.for(
85
+ "accordionGroup"
86
+ );
78
87
  const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
79
88
  "dropdownTrigger"
80
89
  );
@@ -580,120 +589,15 @@ const NavProps = {
580
589
  default: () => []
581
590
  }
582
591
  };
583
- function equals(obj1, obj2, field) {
584
- if (field) {
585
- return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
586
- }
587
- return deepEquals(obj1, obj2);
588
- }
589
- function deepEquals(a, b) {
590
- if (a === b)
591
- return true;
592
- if (a && b && typeof a == "object" && typeof b == "object") {
593
- const arrA = Array.isArray(a);
594
- const arrB = Array.isArray(b);
595
- let i, length, key;
596
- if (arrA && arrB) {
597
- length = a.length;
598
- if (length != b.length)
599
- return false;
600
- for (i = length; i-- !== 0; )
601
- if (!deepEquals(a[i], b[i]))
602
- return false;
603
- return true;
604
- }
605
- if (arrA != arrB)
606
- return false;
607
- const dateA = a instanceof Date, dateB = b instanceof Date;
608
- if (dateA != dateB)
609
- return false;
610
- if (dateA && dateB)
611
- return a.getTime() == b.getTime();
612
- const regexpA = a instanceof RegExp, regexpB = b instanceof RegExp;
613
- if (regexpA != regexpB)
614
- return false;
615
- if (regexpA && regexpB)
616
- return a.toString() == b.toString();
617
- const keys = Object.keys(a);
618
- length = keys.length;
619
- if (length !== Object.keys(b).length)
620
- return false;
621
- for (i = length; i-- !== 0; )
622
- if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
623
- return false;
624
- for (i = length; i-- !== 0; ) {
625
- key = keys[i];
626
- if (!deepEquals(a[key], b[key]))
627
- return false;
628
- }
629
- return true;
630
- }
631
- return a !== a && b !== b;
632
- }
633
- function resolveFieldData(data, field) {
634
- if (data && Object.keys(data).length && field) {
635
- if (field.indexOf(".") === -1) {
636
- return data[field];
637
- } else {
638
- const fields = field.split(".");
639
- let value = data;
640
- for (let i = 0, len = fields.length; i < len; ++i) {
641
- if (data == null) {
642
- return null;
643
- }
644
- value = value[fields[i]];
645
- }
646
- return value;
647
- }
648
- } else {
649
- return null;
650
- }
651
- }
652
- function findIndexInList(value, list) {
653
- let index = -1;
654
- if (list) {
655
- for (let i = 0; i < list.length; i++) {
656
- if (equals(list[i], value)) {
657
- index = i;
658
- break;
659
- }
660
- }
661
- }
662
- return index;
663
- }
664
- function contains(value, list) {
665
- if (value != null && list && list.length) {
666
- for (const val of list) {
667
- if (equals(value, val)) {
668
- return true;
669
- }
670
- }
671
- }
672
- return false;
673
- }
674
- function isEmpty(value) {
675
- return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
676
- }
677
- function removeFromList(value, list) {
678
- const indexElToRemove = findIndexInList(value, list);
679
- if (indexElToRemove > -1) {
680
- return list.filter((el, elIndex) => elIndex !== indexElToRemove);
681
- } else {
682
- return list;
683
- }
684
- }
685
- function isString(value) {
686
- return typeof value === "string" || value instanceof String;
687
- }
688
592
  function useInjectedGroupState(groupKey) {
689
593
  const group = inject(groupKey, void 0);
690
- const isInGroup = computed(() => !isEmpty(group));
594
+ const isInGroup = computed(() => group !== void 0);
691
595
  function getGroupOrLocalRef(propName, props, emit) {
692
- if (group == null ? void 0 : group.value) {
693
- const groupPropValue = unref(group.value)[propName];
596
+ const groupPropValue = group == null ? void 0 : group[propName];
597
+ if (groupPropValue) {
694
598
  return computed({
695
599
  get() {
696
- return groupPropValue == null ? void 0 : groupPropValue.value;
600
+ return groupPropValue.value;
697
601
  },
698
602
  set(value) {
699
603
  groupPropValue.value = value;
@@ -706,8 +610,9 @@ function useInjectedGroupState(groupKey) {
706
610
  return propRef.value;
707
611
  },
708
612
  set(value) {
709
- if (emit)
613
+ if (emit) {
710
614
  emit(`update:${propName}`, value);
615
+ }
711
616
  }
712
617
  });
713
618
  }
@@ -748,23 +653,16 @@ const VvAccordionProps = {
748
653
  not: Boolean
749
654
  };
750
655
  const VvAccordionEvents = ["update:modelValue"];
751
- function useGroupProps$3(props, emit) {
752
- const { group, isInGroup, getGroupOrLocalRef } = useInjectedGroupState(
656
+ function useGroupProps$3(props) {
657
+ const { group, isInGroup } = useInjectedGroupState(
753
658
  INJECTION_KEY_ACCORDION_GROUP
754
659
  );
755
- const { title, content } = toRefs(props);
756
- const modelValue = getGroupOrLocalRef("modelValue", props, emit);
757
- const not = getGroupOrLocalRef("not", props);
758
- const collapse = getGroupOrLocalRef("collapse", props);
759
660
  const disabled = computed(
760
- () => {
761
- var _a;
762
- return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
763
- }
661
+ () => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
764
662
  );
765
663
  const modifiers = computed(() => {
766
664
  let localModifiers = props.modifiers;
767
- let groupModifiers = group == null ? void 0 : group.value.modifiers.value;
665
+ let groupModifiers = group == null ? void 0 : group.modifiers.value;
768
666
  const toReturn = /* @__PURE__ */ new Set();
769
667
  if (localModifiers) {
770
668
  if (!Array.isArray(localModifiers)) {
@@ -782,16 +680,11 @@ function useGroupProps$3(props, emit) {
782
680
  });
783
681
  return {
784
682
  // group props
785
- modelValue,
786
- not,
787
683
  isInGroup,
788
684
  group,
789
- collapse,
790
685
  modifiers,
791
686
  disabled,
792
- // local props
793
- title,
794
- content
687
+ bus: group == null ? void 0 : group.bus
795
688
  };
796
689
  }
797
690
  function useModifiers(prefix, modifiers, others) {
@@ -827,62 +720,103 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
827
720
  ...__default__$r,
828
721
  props: VvAccordionProps,
829
722
  emits: VvAccordionEvents,
830
- setup(__props, { emit: __emit }) {
723
+ setup(__props, { expose: __expose, emit: __emit }) {
831
724
  const props = __props;
832
725
  const attrs = useAttrs();
833
726
  const emit = __emit;
727
+ const modelValue = useVModel(props, "modelValue", emit);
834
728
  const accordionName = computed(
835
729
  () => props.name || (attrs == null ? void 0 : attrs.id) || uid()
836
730
  );
837
- const {
838
- modifiers,
839
- title,
840
- content,
841
- disabled,
842
- collapse,
731
+ const { title, content, not } = toRefs(props);
732
+ const { isInGroup, modifiers, disabled, bus } = useGroupProps$3(props);
733
+ const isExpanded = ref(false);
734
+ watch(
843
735
  modelValue,
844
- isInGroup,
845
- not
846
- } = useGroupProps$3(props, emit);
847
- const localModelValue = ref(false);
848
- const isOpen = computed({
849
- get: () => {
850
- let toReturn = modelValue.value;
851
- if (isInGroup.value) {
852
- if (collapse.value && Array.isArray(modelValue.value)) {
853
- toReturn = modelValue.value.includes(accordionName.value);
854
- } else {
855
- toReturn = modelValue.value === accordionName.value;
856
- }
857
- } else if (modelValue.value === void 0) {
858
- toReturn = localModelValue.value;
736
+ (newValue) => {
737
+ if (typeof newValue === "boolean") {
738
+ isExpanded.value = not.value ? !newValue : newValue;
859
739
  }
860
- return not.value ? !toReturn : toReturn;
861
740
  },
862
- set: (newValue) => {
863
- if (not.value) {
864
- newValue = !newValue;
865
- }
866
- if (isInGroup.value) {
867
- if (collapse.value && Array.isArray(modelValue.value)) {
868
- if (newValue) {
869
- modelValue.value.push(accordionName.value);
870
- return;
871
- }
872
- modelValue.value = modelValue.value.filter(
873
- (name) => name !== accordionName.value
874
- );
875
- return;
741
+ { immediate: true }
742
+ );
743
+ watch(isExpanded, (newValue) => {
744
+ modelValue.value = not.value ? !newValue : newValue;
745
+ });
746
+ bus == null ? void 0 : bus.on("toggle", ({ name, value }) => {
747
+ if (name !== accordionName.value) {
748
+ return;
749
+ }
750
+ isExpanded.value = value;
751
+ });
752
+ const onClick = () => {
753
+ if (disabled.value) {
754
+ return;
755
+ }
756
+ if (isInGroup.value) {
757
+ bus == null ? void 0 : bus.emit("toggle", {
758
+ name: accordionName.value,
759
+ value: !isExpanded.value
760
+ });
761
+ return;
762
+ }
763
+ isExpanded.value = !isExpanded.value;
764
+ };
765
+ watch(
766
+ accordionName,
767
+ (newValue, oldValue) => {
768
+ if (bus) {
769
+ if (oldValue && oldValue !== newValue) {
770
+ bus.emit("unregister", { name: oldValue });
876
771
  }
877
- modelValue.value = newValue ? accordionName.value : null;
878
- return;
772
+ bus.emit("register", { name: newValue });
879
773
  }
880
- if (modelValue.value === void 0 && typeof newValue === "boolean") {
881
- localModelValue.value = newValue;
882
- return;
883
- }
884
- modelValue.value = newValue;
774
+ },
775
+ {
776
+ immediate: true
777
+ }
778
+ );
779
+ onBeforeUnmount(() => {
780
+ if (bus) {
781
+ bus.emit("unregister", { name: accordionName.value });
782
+ }
783
+ });
784
+ const expand = () => {
785
+ if (isExpanded.value) {
786
+ return;
787
+ }
788
+ onClick();
789
+ };
790
+ const collapse = () => {
791
+ if (!isExpanded.value) {
792
+ return;
793
+ }
794
+ onClick();
795
+ };
796
+ const groupExpand = (name) => {
797
+ if (!bus) {
798
+ console.warn(
799
+ `[VvAccordion]: You are trying to expand accordion group of "${accordionName.value}" but it is not in a group`
800
+ );
801
+ return;
802
+ }
803
+ bus.emit("expand", { name });
804
+ };
805
+ const groupCollapse = (name) => {
806
+ if (!bus) {
807
+ console.warn(
808
+ `[VvAccordion]: You are trying to collapse accordion group of "${accordionName.value}" but it is not in a group`
809
+ );
810
+ return;
885
811
  }
812
+ bus == null ? void 0 : bus.emit("collapse", { name });
813
+ };
814
+ __expose({
815
+ isExpanded,
816
+ expand,
817
+ collapse,
818
+ groupExpand,
819
+ groupCollapse
886
820
  });
887
821
  const bemCssClasses = useModifiers(
888
822
  "vv-accordion",
@@ -891,20 +825,25 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
891
825
  disabled: disabled.value
892
826
  }))
893
827
  );
894
- const onClick = useToggle(isOpen);
895
828
  return (_ctx, _cache) => {
896
829
  return openBlock(), createElementBlock("details", {
897
830
  id: unref(accordionName),
898
831
  class: normalizeClass(unref(bemCssClasses)),
899
- open: unref(isOpen)
832
+ open: unref(isExpanded)
900
833
  }, [
901
834
  createElementVNode("summary", {
902
835
  "aria-controls": unref(accordionName),
903
- "aria-expanded": unref(isOpen),
836
+ "aria-expanded": unref(isExpanded),
904
837
  class: "vv-accordion__summary",
905
- onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(onClick)(), ["prevent"]))
838
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => onClick(), ["prevent"]))
906
839
  }, [
907
- renderSlot(_ctx.$slots, "summary", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
840
+ renderSlot(_ctx.$slots, "summary", normalizeProps(guardReactiveProps({
841
+ isExpanded: unref(isExpanded),
842
+ expand,
843
+ collapse,
844
+ groupExpand,
845
+ groupCollapse
846
+ })), () => [
908
847
  createTextVNode(
909
848
  toDisplayString(unref(title)),
910
849
  1
@@ -913,10 +852,16 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
913
852
  ])
914
853
  ], 8, _hoisted_2$f),
915
854
  createElementVNode("div", {
916
- "aria-hidden": !unref(isOpen),
855
+ "aria-hidden": !unref(isExpanded),
917
856
  class: "vv-accordion__content"
918
857
  }, [
919
- renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
858
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
859
+ isExpanded: unref(isExpanded),
860
+ expand,
861
+ collapse,
862
+ groupExpand,
863
+ groupCollapse
864
+ })), () => [
920
865
  createTextVNode(
921
866
  toDisplayString(unref(content)),
922
867
  1
@@ -933,7 +878,9 @@ const VvAccordionGroupProps = {
933
878
  /**
934
879
  * VModel
935
880
  */
936
- modelValue: [String, Array],
881
+ modelValue: {
882
+ type: [String, Array]
883
+ },
937
884
  /**
938
885
  * Accordion items
939
886
  * @type VvAccordionGroupItem
@@ -967,15 +914,8 @@ const VvAccordionGroupProps = {
967
914
  storeKey: String
968
915
  };
969
916
  const VvAccordionGroupEvents = ["update:modelValue"];
970
- function useProvideGroupState(groupState) {
971
- if (Object.keys(groupState).some(
972
- (k) => k !== "key" && !isRef(groupState[k])
973
- ))
974
- throw Error("One or more groupState props aren't ref.");
975
- provide(
976
- groupState.key,
977
- computed(() => groupState)
978
- );
917
+ function useProvideGroupState(key, groupState) {
918
+ provide(key, groupState);
979
919
  }
980
920
  const __default__$q = {
981
921
  name: "VvAccordionGroup"
@@ -984,58 +924,149 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
984
924
  ...__default__$q,
985
925
  props: VvAccordionGroupProps,
986
926
  emits: VvAccordionGroupEvents,
987
- setup(__props, { emit: __emit }) {
927
+ setup(__props, { expose: __expose, emit: __emit }) {
988
928
  const props = __props;
989
929
  const emit = __emit;
990
- const { disabled, collapse, modifiers, itemModifiers, items, not } = toRefs(props);
930
+ const { disabled, modifiers, itemModifiers, items } = toRefs(props);
991
931
  watchEffect(() => {
992
- if (typeof props.modelValue === "string" && collapse.value) {
932
+ if (typeof props.modelValue === "string" && props.collapse) {
993
933
  console.warn(
994
934
  `[VvAccordionGroup]: modelValue is a string but collapse is true.`
995
935
  );
996
936
  }
997
937
  });
998
- let localModelValue = ref([]);
938
+ const accordionNames = reactive(/* @__PURE__ */ new Set());
939
+ let modelValue = ref(/* @__PURE__ */ new Set());
999
940
  watch(
1000
941
  () => props.storeKey,
1001
- (newKey) => {
942
+ (newKey, oldKey) => {
943
+ if (oldKey && oldKey !== newKey) {
944
+ localStorage.removeItem(oldKey);
945
+ }
1002
946
  if (newKey) {
1003
- localModelValue = useStorage(newKey, localModelValue.value);
1004
- } else {
1005
- localModelValue = ref([]);
947
+ modelValue = useLocalStorage(newKey, modelValue.value);
948
+ return;
1006
949
  }
950
+ modelValue = ref(new Set(modelValue.value));
1007
951
  },
1008
952
  { immediate: true }
1009
953
  );
1010
- const modelValue = computed({
1011
- get: () => {
1012
- var _a;
1013
- if (props.modelValue !== void 0) {
1014
- if (!collapse.value) {
1015
- return Array.isArray(props.modelValue) ? props.modelValue[0] : props.modelValue;
1016
- }
1017
- return props.modelValue;
954
+ watch(
955
+ [modelValue, accordionNames, () => props.not, () => props.collapse],
956
+ () => {
957
+ if (props.not) {
958
+ emit(
959
+ "update:modelValue",
960
+ [...accordionNames].filter(
961
+ (name) => !modelValue.value.has(name)
962
+ )
963
+ );
964
+ return;
1018
965
  }
1019
- return !collapse.value ? (_a = localModelValue.value) == null ? void 0 : _a[0] : localModelValue.value;
966
+ if (props.collapse) {
967
+ emit("update:modelValue", [...modelValue.value]);
968
+ return;
969
+ }
970
+ emit("update:modelValue", modelValue.value.values().next().value);
1020
971
  },
1021
- set: (newValue) => {
1022
- if (props.modelValue !== void 0) {
1023
- if ((Array.isArray(props.modelValue) || collapse.value) && !Array.isArray(newValue)) {
1024
- newValue = [newValue];
972
+ {
973
+ deep: true,
974
+ immediate: true
975
+ }
976
+ );
977
+ watch(
978
+ () => props.modelValue,
979
+ (newValue, oldValue) => {
980
+ if (newValue === void 0 || newValue === null || JSON.stringify(newValue) === JSON.stringify(oldValue)) {
981
+ return;
982
+ }
983
+ let toReturn = /* @__PURE__ */ new Set();
984
+ if (props.not) {
985
+ if (typeof newValue === "string") {
986
+ toReturn = new Set(
987
+ [...accordionNames].filter((name) => name !== newValue)
988
+ );
989
+ } else if (Array.isArray(newValue)) {
990
+ toReturn = new Set(
991
+ [...accordionNames].filter(
992
+ (name) => !newValue.includes(name)
993
+ )
994
+ );
1025
995
  }
1026
- return emit("update:modelValue", newValue);
996
+ } else if (typeof newValue === "string") {
997
+ toReturn = /* @__PURE__ */ new Set([newValue]);
998
+ } else if (Array.isArray(newValue)) {
999
+ toReturn = new Set(newValue);
1027
1000
  }
1028
- localModelValue.value = Array.isArray(newValue) ? newValue : [newValue];
1001
+ for (const name of accordionNames) {
1002
+ bus.emit("toggle", { name, value: toReturn.has(name) });
1003
+ }
1004
+ modelValue.value = toReturn;
1005
+ },
1006
+ {
1007
+ immediate: true
1029
1008
  }
1030
- });
1031
- useProvideGroupState({
1032
- key: INJECTION_KEY_ACCORDION_GROUP,
1033
- modelValue,
1009
+ );
1010
+ const bus = mitt();
1011
+ useProvideGroupState(INJECTION_KEY_ACCORDION_GROUP, {
1034
1012
  disabled,
1035
- collapse,
1036
1013
  modifiers: itemModifiers,
1037
- not
1014
+ bus
1038
1015
  });
1016
+ bus.on("register", ({ name }) => {
1017
+ accordionNames.add(name);
1018
+ });
1019
+ bus.on("unregister", ({ name }) => {
1020
+ accordionNames.delete(name);
1021
+ });
1022
+ bus.on("toggle", ({ name, value }) => {
1023
+ if (value) {
1024
+ if (!props.collapse) {
1025
+ for (const item of modelValue.value) {
1026
+ if (item !== name) {
1027
+ bus.emit("toggle", { name: item, value: false });
1028
+ }
1029
+ }
1030
+ modelValue.value.clear();
1031
+ }
1032
+ modelValue.value.add(name);
1033
+ return;
1034
+ }
1035
+ modelValue.value.delete(name);
1036
+ });
1037
+ const expand = (name) => {
1038
+ if (typeof name === "string") {
1039
+ bus.emit("toggle", { name, value: true });
1040
+ return;
1041
+ }
1042
+ if (Array.isArray(name)) {
1043
+ for (const item of name) {
1044
+ bus.emit("toggle", { name: item, value: true });
1045
+ }
1046
+ return;
1047
+ }
1048
+ for (const item of accordionNames) {
1049
+ bus.emit("toggle", { name: item, value: true });
1050
+ }
1051
+ };
1052
+ bus.on("expand", ({ name }) => expand(name));
1053
+ const collapse = (name) => {
1054
+ if (typeof name === "string") {
1055
+ bus.emit("toggle", { name, value: false });
1056
+ return;
1057
+ }
1058
+ if (Array.isArray(name)) {
1059
+ for (const item of name) {
1060
+ bus.emit("toggle", { name: item, value: false });
1061
+ }
1062
+ return;
1063
+ }
1064
+ for (const item of accordionNames) {
1065
+ bus.emit("toggle", { name: item, value: false });
1066
+ }
1067
+ };
1068
+ bus.on("collapse", ({ name }) => collapse(name));
1069
+ __expose({ modelValue, expand, collapse });
1039
1070
  const bemCssClasses = useModifiers(
1040
1071
  "vv-accordion-group",
1041
1072
  modifiers,
@@ -1050,7 +1081,11 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
1050
1081
  class: normalizeClass(unref(bemCssClasses))
1051
1082
  },
1052
1083
  [
1053
- renderSlot(_ctx.$slots, "default", {}, () => [
1084
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
1085
+ modelValue: unref(modelValue),
1086
+ expand,
1087
+ collapse
1088
+ })), () => [
1054
1089
  (openBlock(true), createElementBlock(
1055
1090
  Fragment,
1056
1091
  null,
@@ -2147,14 +2182,11 @@ function useGroupProps$2(props, emit) {
2147
2182
  const { id, iconPosition, icon, label, pressed } = toRefs(props);
2148
2183
  const modelValue = getGroupOrLocalRef("modelValue", props, emit);
2149
2184
  const toggle = getGroupOrLocalRef("toggle", props);
2150
- const unselectable = getGroupOrLocalRef(
2151
- "unselectable",
2152
- props
2153
- );
2154
- const multiple = computed(() => (group == null ? void 0 : group.value.multiple.value) ?? false);
2185
+ const unselectable = getGroupOrLocalRef("unselectable", props);
2186
+ const multiple = computed(() => (group == null ? void 0 : group.multiple.value) ?? false);
2155
2187
  const modifiers = computed(() => {
2156
2188
  let localModifiers = props.modifiers;
2157
- let groupModifiers = group == null ? void 0 : group.value.modifiers.value;
2189
+ let groupModifiers = group == null ? void 0 : group.modifiers.value;
2158
2190
  const toReturn = /* @__PURE__ */ new Set();
2159
2191
  if (localModifiers) {
2160
2192
  if (!Array.isArray(localModifiers)) {
@@ -2171,10 +2203,7 @@ function useGroupProps$2(props, emit) {
2171
2203
  return Array.from(toReturn);
2172
2204
  });
2173
2205
  const disabled = computed(
2174
- () => {
2175
- var _a;
2176
- return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
2177
- }
2206
+ () => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
2178
2207
  );
2179
2208
  return {
2180
2209
  // group props
@@ -2194,6 +2223,111 @@ function useGroupProps$2(props, emit) {
2194
2223
  label
2195
2224
  };
2196
2225
  }
2226
+ function equals(obj1, obj2, field) {
2227
+ if (field) {
2228
+ return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
2229
+ }
2230
+ return deepEquals(obj1, obj2);
2231
+ }
2232
+ function deepEquals(a, b) {
2233
+ if (a === b)
2234
+ return true;
2235
+ if (a && b && typeof a == "object" && typeof b == "object") {
2236
+ const arrA = Array.isArray(a);
2237
+ const arrB = Array.isArray(b);
2238
+ let i, length, key;
2239
+ if (arrA && arrB) {
2240
+ length = a.length;
2241
+ if (length != b.length)
2242
+ return false;
2243
+ for (i = length; i-- !== 0; )
2244
+ if (!deepEquals(a[i], b[i]))
2245
+ return false;
2246
+ return true;
2247
+ }
2248
+ if (arrA != arrB)
2249
+ return false;
2250
+ const dateA = a instanceof Date, dateB = b instanceof Date;
2251
+ if (dateA != dateB)
2252
+ return false;
2253
+ if (dateA && dateB)
2254
+ return a.getTime() == b.getTime();
2255
+ const regexpA = a instanceof RegExp, regexpB = b instanceof RegExp;
2256
+ if (regexpA != regexpB)
2257
+ return false;
2258
+ if (regexpA && regexpB)
2259
+ return a.toString() == b.toString();
2260
+ const keys = Object.keys(a);
2261
+ length = keys.length;
2262
+ if (length !== Object.keys(b).length)
2263
+ return false;
2264
+ for (i = length; i-- !== 0; )
2265
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
2266
+ return false;
2267
+ for (i = length; i-- !== 0; ) {
2268
+ key = keys[i];
2269
+ if (!deepEquals(a[key], b[key]))
2270
+ return false;
2271
+ }
2272
+ return true;
2273
+ }
2274
+ return a !== a && b !== b;
2275
+ }
2276
+ function resolveFieldData(data, field) {
2277
+ if (data && Object.keys(data).length && field) {
2278
+ if (field.indexOf(".") === -1) {
2279
+ return data[field];
2280
+ } else {
2281
+ const fields = field.split(".");
2282
+ let value = data;
2283
+ for (let i = 0, len = fields.length; i < len; ++i) {
2284
+ if (data == null) {
2285
+ return null;
2286
+ }
2287
+ value = value[fields[i]];
2288
+ }
2289
+ return value;
2290
+ }
2291
+ } else {
2292
+ return null;
2293
+ }
2294
+ }
2295
+ function findIndexInList(value, list) {
2296
+ let index = -1;
2297
+ if (list) {
2298
+ for (let i = 0; i < list.length; i++) {
2299
+ if (equals(list[i], value)) {
2300
+ index = i;
2301
+ break;
2302
+ }
2303
+ }
2304
+ }
2305
+ return index;
2306
+ }
2307
+ function contains(value, list) {
2308
+ if (value != null && list && list.length) {
2309
+ for (const val of list) {
2310
+ if (equals(value, val)) {
2311
+ return true;
2312
+ }
2313
+ }
2314
+ }
2315
+ return false;
2316
+ }
2317
+ function isEmpty(value) {
2318
+ return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
2319
+ }
2320
+ function removeFromList(value, list) {
2321
+ const indexElToRemove = findIndexInList(value, list);
2322
+ if (indexElToRemove > -1) {
2323
+ return list.filter((el, elIndex) => elIndex !== indexElToRemove);
2324
+ } else {
2325
+ return list;
2326
+ }
2327
+ }
2328
+ function isString(value) {
2329
+ return typeof value === "string" || value instanceof String;
2330
+ }
2197
2331
  const _hoisted_1$g = {
2198
2332
  key: 1,
2199
2333
  class: "vv-button__label"
@@ -2407,8 +2541,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
2407
2541
  return emit("update:modelValue", newValue);
2408
2542
  }
2409
2543
  });
2410
- useProvideGroupState({
2411
- key: INJECTION_KEY_BUTTON_GROUP,
2544
+ useProvideGroupState(INJECTION_KEY_BUTTON_GROUP, {
2412
2545
  modelValue,
2413
2546
  disabled,
2414
2547
  toggle,
@@ -2513,16 +2646,10 @@ function useGroupProps$1(props, emit) {
2513
2646
  const valid = getGroupOrLocalRef("valid", props);
2514
2647
  const invalid = getGroupOrLocalRef("invalid", props);
2515
2648
  const readonly = computed(
2516
- () => {
2517
- var _a;
2518
- return Boolean(props.readonly || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.readonly.value));
2519
- }
2649
+ () => Boolean(props.readonly || (group == null ? void 0 : group.readonly.value))
2520
2650
  );
2521
2651
  const disabled = computed(
2522
- () => {
2523
- var _a;
2524
- return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
2525
- }
2652
+ () => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
2526
2653
  );
2527
2654
  return {
2528
2655
  // local props
@@ -2964,8 +3091,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
2964
3091
  );
2965
3092
  const modelValue = useVModel(props, "modelValue", emit);
2966
3093
  const { disabled, readonly, vertical, valid, invalid, modifiers } = toRefs(props);
2967
- useProvideGroupState({
2968
- key: INJECTION_KEY_CHECK_GROUP,
3094
+ useProvideGroupState(INJECTION_KEY_CHECK_GROUP, {
2969
3095
  modelValue,
2970
3096
  disabled,
2971
3097
  readonly,
@@ -6221,16 +6347,10 @@ function useGroupProps(props, emit) {
6221
6347
  const valid = getGroupOrLocalRef("valid", props);
6222
6348
  const invalid = getGroupOrLocalRef("invalid", props);
6223
6349
  const readonly = computed(
6224
- () => {
6225
- var _a;
6226
- return Boolean(props.readonly || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.readonly.value));
6227
- }
6350
+ () => Boolean(props.readonly || (group == null ? void 0 : group.readonly.value))
6228
6351
  );
6229
6352
  const disabled = computed(
6230
- () => {
6231
- var _a;
6232
- return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
6233
- }
6353
+ () => Boolean(props.disabled || (group == null ? void 0 : group.disabled.value))
6234
6354
  );
6235
6355
  return {
6236
6356
  // local props
@@ -6405,8 +6525,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
6405
6525
  );
6406
6526
  const modelValue = useVModel(props, "modelValue", emit);
6407
6527
  const { disabled, readonly, vertical, valid, invalid, modifiers } = toRefs(props);
6408
- useProvideGroupState({
6409
- key: INJECTION_KEY_RADIO_GROUP,
6528
+ useProvideGroupState(INJECTION_KEY_RADIO_GROUP, {
6410
6529
  modelValue,
6411
6530
  disabled,
6412
6531
  readonly,
@@ -6967,8 +7086,7 @@ const VvInputFileProps = {
6967
7086
  * Input value
6968
7087
  */
6969
7088
  modelValue: {
6970
- type: Object,
6971
- required: true
7089
+ type: Object
6972
7090
  },
6973
7091
  /**
6974
7092
  * Whether to show progress bar
@@ -7012,6 +7130,10 @@ const VvInputFileProps = {
7012
7130
  * Show drop area
7013
7131
  */
7014
7132
  dropArea: { type: Boolean, default: false },
7133
+ /**
7134
+ * Enable sorting
7135
+ */
7136
+ sortable: { type: Boolean, default: false },
7015
7137
  /**
7016
7138
  * Label for add button
7017
7139
  */
@@ -7071,12 +7193,11 @@ const _hoisted_3 = ["src", "alt"];
7071
7193
  const _hoisted_4 = { class: "vv-input-file__wrapper" };
7072
7194
  const _hoisted_5 = ["id", "readonly", "placeholder", "aria-describedby", "aria-invalid", "aria-errormessage", "multiple", "accept", "capture", "name"];
7073
7195
  const _hoisted_6 = ["value"];
7074
- const _hoisted_7 = { class: "vv-input-file__list" };
7075
- const _hoisted_8 = ["onClick"];
7076
- const _hoisted_9 = ["title", "onClick"];
7077
- const _hoisted_10 = { class: "vv-input-file__item-name" };
7078
- const _hoisted_11 = { class: "vv-input-file__item-info" };
7079
- const _hoisted_12 = ["title", "onClick"];
7196
+ const _hoisted_7 = ["onClick"];
7197
+ const _hoisted_8 = ["title", "onClick"];
7198
+ const _hoisted_9 = { class: "vv-input-file__item-name" };
7199
+ const _hoisted_10 = { class: "vv-input-file__item-info" };
7200
+ const _hoisted_11 = ["title", "onClick"];
7080
7201
  const __default__ = {
7081
7202
  name: "VvInputFile"
7082
7203
  };
@@ -7125,12 +7246,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7125
7246
  hintSlotScope
7126
7247
  } = HintSlotFactory(propsDefaults, slots);
7127
7248
  const localModelValue = useVModel(props, "modelValue", emit);
7128
- const files = computed(() => {
7129
- var _a;
7130
- if (!localModelValue.value || !Array.isArray(localModelValue.value) && !((_a = localModelValue.value) == null ? void 0 : _a.name)) {
7131
- return [];
7249
+ const files = computed({
7250
+ get: () => {
7251
+ var _a;
7252
+ if (!localModelValue.value || !Array.isArray(localModelValue.value) && !((_a = localModelValue.value) == null ? void 0 : _a.name)) {
7253
+ return [];
7254
+ }
7255
+ return Array.isArray(localModelValue.value) ? localModelValue.value : [localModelValue.value];
7256
+ },
7257
+ set: (value) => {
7258
+ if (isMultiple.value) {
7259
+ localModelValue.value = value;
7260
+ return;
7261
+ }
7262
+ localModelValue.value = value == null ? void 0 : value[0];
7132
7263
  }
7133
- return Array.isArray(localModelValue.value) ? localModelValue.value : [localModelValue.value];
7134
7264
  });
7135
7265
  const hasMax = computed(() => {
7136
7266
  return typeof props.max === "string" ? parseInt(props.max) : props.max;
@@ -7284,6 +7414,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7284
7414
  }
7285
7415
  return props.iconReplace;
7286
7416
  });
7417
+ const onSortEnd = ({ newIndex }) => {
7418
+ if (newIndex !== null) {
7419
+ selectedFileIndex.value = newIndex;
7420
+ }
7421
+ };
7287
7422
  return (_ctx, _cache) => {
7288
7423
  return openBlock(), createElementBlock(
7289
7424
  "div",
@@ -7370,60 +7505,64 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7370
7505
  /* FULL_PROPS */
7371
7506
  )) : createCommentVNode("v-if", true)
7372
7507
  ]),
7373
- createElementVNode("ul", _hoisted_7, [
7374
- (openBlock(true), createElementBlock(
7375
- Fragment,
7376
- null,
7377
- renderList(files.value, (file, index) => {
7378
- return openBlock(), createElementBlock("li", {
7379
- key: index,
7380
- class: normalizeClass(["vv-input-file__item", {
7381
- active: index === selectedFileIndex.value && hasDropArea.value && files.value.length > 1
7382
- }]),
7383
- onClick: withModifiers(($event) => onClickSelectFile(index), ["stop"])
7508
+ createVNode(unref(Sortable), {
7509
+ modelValue: files.value,
7510
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => files.value = $event),
7511
+ tag: "ul",
7512
+ class: "vv-input-file__list",
7513
+ "item-key": "name",
7514
+ move: () => _ctx.sortable,
7515
+ onEnd: onSortEnd
7516
+ }, {
7517
+ item: withCtx(({ element: file, index }) => [
7518
+ createElementVNode("li", {
7519
+ class: normalizeClass(["vv-input-file__item", {
7520
+ active: index === selectedFileIndex.value && hasDropArea.value && files.value.length > 1,
7521
+ "cursor-move": _ctx.sortable
7522
+ }]),
7523
+ onClick: withModifiers(($event) => onClickSelectFile(index), ["stop"])
7524
+ }, [
7525
+ unref(hasIconDownload) ? (openBlock(), createElementBlock("button", {
7526
+ key: 0,
7527
+ type: "button",
7528
+ class: "vv-input-file__item-action",
7529
+ title: _ctx.labelDownload,
7530
+ onClick: withModifiers(($event) => onClickDownloadFile(file), ["stop"])
7384
7531
  }, [
7385
- unref(hasIconDownload) ? (openBlock(), createElementBlock("button", {
7386
- key: 0,
7387
- type: "button",
7388
- class: "vv-input-file__item-action",
7389
- title: _ctx.labelDownload,
7390
- onClick: withModifiers(($event) => onClickDownloadFile(file), ["stop"])
7391
- }, [
7392
- createVNode(
7393
- _sfc_main$u,
7394
- normalizeProps(guardReactiveProps(unref(hasIconDownload))),
7395
- null,
7396
- 16
7397
- /* FULL_PROPS */
7398
- )
7399
- ], 8, _hoisted_9)) : createCommentVNode("v-if", true),
7400
- createElementVNode(
7401
- "div",
7402
- _hoisted_10,
7403
- toDisplayString(file.name),
7404
- 1
7405
- /* TEXT */
7406
- ),
7407
- createElementVNode(
7408
- "small",
7409
- _hoisted_11,
7410
- toDisplayString(sizeInKiB(file.size)) + " KB ",
7411
- 1
7412
- /* TEXT */
7413
- ),
7414
- !unref(readonly) ? (openBlock(), createElementBlock("button", {
7415
- key: 1,
7416
- type: "button",
7417
- class: "vv-input-file__item-remove",
7418
- title: _ctx.labelRemove,
7419
- onClick: withModifiers(($event) => onClickRemoveFile(index), ["stop"])
7420
- }, null, 8, _hoisted_12)) : createCommentVNode("v-if", true)
7421
- ], 10, _hoisted_8);
7422
- }),
7423
- 128
7424
- /* KEYED_FRAGMENT */
7425
- ))
7426
- ]),
7532
+ createVNode(
7533
+ _sfc_main$u,
7534
+ normalizeProps(guardReactiveProps(unref(hasIconDownload))),
7535
+ null,
7536
+ 16
7537
+ /* FULL_PROPS */
7538
+ )
7539
+ ], 8, _hoisted_8)) : createCommentVNode("v-if", true),
7540
+ createElementVNode(
7541
+ "div",
7542
+ _hoisted_9,
7543
+ toDisplayString(file.name),
7544
+ 1
7545
+ /* TEXT */
7546
+ ),
7547
+ createElementVNode(
7548
+ "small",
7549
+ _hoisted_10,
7550
+ toDisplayString(sizeInKiB(file.size)) + " KB ",
7551
+ 1
7552
+ /* TEXT */
7553
+ ),
7554
+ !unref(readonly) ? (openBlock(), createElementBlock("button", {
7555
+ key: 1,
7556
+ type: "button",
7557
+ class: "vv-input-file__item-remove",
7558
+ title: _ctx.labelRemove,
7559
+ onClick: withModifiers(($event) => onClickRemoveFile(index), ["stop"])
7560
+ }, null, 8, _hoisted_11)) : createCommentVNode("v-if", true)
7561
+ ], 10, _hoisted_7)
7562
+ ]),
7563
+ _: 1
7564
+ /* STABLE */
7565
+ }, 8, ["modelValue", "move"]),
7427
7566
  createVNode(unref(HintSlot), {
7428
7567
  id: hasHintId.value,
7429
7568
  class: "vv-input-file__hint"