@volverjs/ui-vue 0.0.8 → 0.0.9-beta.10

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 (136) hide show
  1. package/README.md +4 -4
  2. package/auto-imports.d.ts +2 -0
  3. package/dist/components/VvAccordion/VvAccordion.es.js +7 -0
  4. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +7 -0
  5. package/dist/components/VvAction/VvAction.es.js +9 -1
  6. package/dist/components/VvAction/VvAction.umd.js +1 -1
  7. package/dist/components/VvAction/VvAction.vue.d.ts +9 -0
  8. package/dist/components/VvAction/index.d.ts +4 -0
  9. package/dist/components/VvAlert/VvAlert.es.js +14 -6
  10. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  11. package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
  12. package/dist/components/VvAlert/index.d.ts +3 -3
  13. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +54 -10
  14. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  15. package/dist/components/VvAvatar/VvAvatar.es.js +7 -0
  16. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +7 -0
  17. package/dist/components/VvBadge/VvBadge.es.js +7 -0
  18. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +7 -0
  19. package/dist/components/VvButton/VvButton.es.js +11 -2
  20. package/dist/components/VvButton/VvButton.umd.js +1 -1
  21. package/dist/components/VvButton/VvButton.vue.d.ts +9 -0
  22. package/dist/components/VvButton/index.d.ts +4 -0
  23. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +7 -0
  24. package/dist/components/VvCard/VvCard.es.js +7 -0
  25. package/dist/components/VvCheckbox/VvCheckbox.es.js +91 -14
  26. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  27. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
  28. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +97 -15
  29. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +4 -4
  31. package/dist/components/VvCombobox/VvCombobox.es.js +164 -94
  32. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  33. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +35 -14
  34. package/dist/components/VvCombobox/index.d.ts +24 -7
  35. package/dist/components/VvDialog/VvDialog.es.js +67 -27
  36. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  37. package/dist/components/VvDropdown/VvDropdown.es.js +58 -20
  38. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  39. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +13 -12
  40. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +9 -0
  41. package/dist/components/VvDropdown/index.d.ts +1 -7
  42. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +9 -1
  43. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  44. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +7 -0
  45. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +7 -0
  46. package/dist/components/VvInputText/VvInputText.es.js +87 -14
  47. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  48. package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
  49. package/dist/components/VvNav/VvNav.es.js +10 -2
  50. package/dist/components/VvNav/VvNav.umd.js +1 -1
  51. package/dist/components/VvNav/index.d.ts +1 -1
  52. package/dist/components/VvProgress/VvProgress.es.js +7 -0
  53. package/dist/components/VvRadio/VvRadio.es.js +91 -14
  54. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  55. package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
  56. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +97 -15
  57. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  58. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +4 -4
  59. package/dist/components/VvSelect/VvSelect.es.js +87 -14
  60. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  61. package/dist/components/VvSelect/VvSelect.vue.d.ts +4 -4
  62. package/dist/components/VvTab/VvTab.es.js +10 -2
  63. package/dist/components/VvTab/VvTab.umd.js +1 -1
  64. package/dist/components/VvTextarea/VvTextarea.es.js +87 -14
  65. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  66. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
  67. package/dist/components/VvTooltip/VvTooltip.es.js +7 -0
  68. package/dist/components/common/HintSlot.d.ts +4 -3
  69. package/dist/components/index.d.ts +5 -0
  70. package/dist/components/index.es.js +958 -431
  71. package/dist/components/index.umd.js +1 -1
  72. package/dist/composables/alert/useAlert.d.ts +27 -0
  73. package/dist/composables/index.d.ts +1 -0
  74. package/dist/composables/index.es.js +81 -0
  75. package/dist/composables/index.umd.js +1 -0
  76. package/dist/constants.d.ts +10 -0
  77. package/dist/directives/index.es.js +7 -0
  78. package/dist/directives/v-tooltip.es.js +7 -0
  79. package/dist/icons.es.js +3 -3
  80. package/dist/icons.umd.js +1 -1
  81. package/dist/props/index.d.ts +7 -0
  82. package/dist/resolvers/unplugin.es.js +3 -0
  83. package/dist/resolvers/unplugin.umd.js +1 -1
  84. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +43 -258
  85. package/dist/stories/Alert/Alert.settings.d.ts +3 -7
  86. package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +2 -2
  87. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +6 -0
  88. package/dist/stories/Button/Button.settings.d.ts +3 -13
  89. package/dist/stories/Combobox/Combobox.settings.d.ts +117 -19
  90. package/dist/stories/Nav/Nav.settings.d.ts +3 -21
  91. package/package.json +54 -46
  92. package/src/assets/icons/detailed.json +1 -1
  93. package/src/assets/icons/normal.json +1 -1
  94. package/src/assets/icons/simple.json +1 -1
  95. package/src/components/VvAction/VvAction.vue +2 -1
  96. package/src/components/VvAlert/VvAlert.vue +5 -1
  97. package/src/components/VvAlert/index.ts +3 -3
  98. package/src/components/VvAlertGroup/VvAlertGroup.vue +30 -0
  99. package/src/components/VvAlertGroup/index.ts +11 -1
  100. package/src/components/VvButton/VvButton.vue +1 -0
  101. package/src/components/VvCheckbox/VvCheckbox.vue +8 -1
  102. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +8 -1
  103. package/src/components/VvCombobox/VvCombobox.vue +9 -4
  104. package/src/components/VvCombobox/index.ts +24 -0
  105. package/src/components/VvDialog/VvDialog.vue +36 -17
  106. package/src/components/VvDialog/index.ts +13 -1
  107. package/src/components/VvDropdown/VvDropdown.vue +44 -15
  108. package/src/components/VvDropdown/index.ts +2 -8
  109. package/src/components/VvInputText/VvInputText.vue +8 -1
  110. package/src/components/VvNav/VvNav.vue +1 -1
  111. package/src/components/VvNav/index.ts +1 -1
  112. package/src/components/VvRadio/VvRadio.vue +8 -1
  113. package/src/components/VvRadioGroup/VvRadioGroup.vue +8 -1
  114. package/src/components/VvSelect/VvSelect.vue +8 -1
  115. package/src/components/VvTextarea/VvTextarea.vue +8 -1
  116. package/src/components/common/HintSlot.ts +26 -13
  117. package/src/components/index.ts +5 -0
  118. package/src/composables/alert/useAlert.ts +103 -0
  119. package/src/composables/index.ts +1 -0
  120. package/src/constants.ts +21 -0
  121. package/src/props/index.ts +7 -0
  122. package/src/resolvers/unplugin.ts +3 -0
  123. package/src/stories/Alert/Alert.settings.ts +3 -1
  124. package/src/stories/AlertGroup/AlertGroup.test.ts +13 -0
  125. package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +3 -3
  126. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +118 -0
  127. package/src/stories/Button/Button.settings.ts +5 -3
  128. package/src/stories/Combobox/Combobox.settings.ts +119 -2
  129. package/src/stories/Nav/Nav.settings.ts +3 -1
  130. package/src/stories/Tab/Tab.stories.ts +3 -3
  131. package/src/stories/Textarea/TextareaLength.stories.ts +1 -1
  132. package/src/types/alert.d.ts +20 -0
  133. /package/dist/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue.d.ts +0 -0
  134. /package/dist/components/{VvNavSeparator → VvNav}/VvNavSeparator.d.ts +0 -0
  135. /package/src/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue +0 -0
  136. /package/src/components/{VvNavSeparator → VvNav}/VvNavSeparator.ts +0 -0
@@ -79,6 +79,9 @@ const INJECTION_KEY_DROPDOWN_ITEM = Symbol.for(
79
79
  const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for(
80
80
  "dropdownAction"
81
81
  );
82
+ const INJECTION_KEY_ALERT_GROUP = Symbol.for(
83
+ "alertGroup"
84
+ );
82
85
  const LinkProps = {
83
86
  /**
84
87
  * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
@@ -484,6 +487,13 @@ const ActionProps = {
484
487
  type: String,
485
488
  default: ButtonType.button,
486
489
  validator: (value) => Object.values(ButtonType).includes(value)
490
+ },
491
+ /**
492
+ * Button aria-label
493
+ */
494
+ ariaLabel: {
495
+ type: String,
496
+ default: void 0
487
497
  }
488
498
  };
489
499
  function equals(obj1, obj2, field) {
@@ -723,14 +733,14 @@ function useModifiers(prefix, modifiers, others) {
723
733
  return toReturn;
724
734
  });
725
735
  }
726
- const _hoisted_1$f = ["id", "open"];
727
- const _hoisted_2$c = ["aria-controls", "aria-expanded"];
728
- const _hoisted_3$6 = ["aria-hidden"];
729
- const __default__$m = {
736
+ const _hoisted_1$i = ["id", "open"];
737
+ const _hoisted_2$d = ["aria-controls", "aria-expanded"];
738
+ const _hoisted_3$7 = ["aria-hidden"];
739
+ const __default__$n = {
730
740
  name: "VvAccordion"
731
741
  };
732
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
733
- ...__default__$m,
742
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
743
+ ...__default__$n,
734
744
  props: VvAccordionProps,
735
745
  emits: VvAccordionEvents,
736
746
  setup(__props, { emit }) {
@@ -812,7 +822,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
812
822
  renderSlot(_ctx.$slots, "summary", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
813
823
  createTextVNode(toDisplayString(unref(title)), 1)
814
824
  ])
815
- ], 8, _hoisted_2$c),
825
+ ], 8, _hoisted_2$d),
816
826
  createElementVNode("div", {
817
827
  "aria-hidden": !unref(isOpen),
818
828
  class: "vv-accordion__content"
@@ -820,8 +830,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
820
830
  renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
821
831
  createTextVNode(toDisplayString(unref(content)), 1)
822
832
  ])
823
- ], 8, _hoisted_3$6)
824
- ], 10, _hoisted_1$f);
833
+ ], 8, _hoisted_3$7)
834
+ ], 10, _hoisted_1$i);
825
835
  };
826
836
  }
827
837
  });
@@ -874,11 +884,11 @@ function useProvideGroupState(groupState) {
874
884
  computed(() => groupState)
875
885
  );
876
886
  }
877
- const __default__$l = {
887
+ const __default__$m = {
878
888
  name: "VvAccordionGroup"
879
889
  };
880
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
881
- ...__default__$l,
890
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
891
+ ...__default__$m,
882
892
  props: VvAccordionGroupProps,
883
893
  emits: VvAccordionGroupEvents,
884
894
  setup(__props, { emit }) {
@@ -945,7 +955,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
945
955
  }, [
946
956
  renderSlot(_ctx.$slots, "default", {}, () => [
947
957
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item) => {
948
- return openBlock(), createBlock(_sfc_main$m, mergeProps({
958
+ return openBlock(), createBlock(_sfc_main$q, mergeProps({
949
959
  key: item.title
950
960
  }, {
951
961
  name: item.name,
@@ -966,88 +976,128 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
966
976
  };
967
977
  }
968
978
  });
969
- const VvBadgeProps = {
970
- ...ModifiersProps,
971
- value: [String, Number]
972
- };
973
- const __default__$k = {
974
- name: "VvBadge"
979
+ const VvActionEvents = ["click", "mouseover", "mouseleave"];
980
+ const VvActionProps = ActionProps;
981
+ function useVolver() {
982
+ return inject(INJECTION_KEY_VOLVER);
983
+ }
984
+ function useInjectedDropdownTrigger() {
985
+ return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
986
+ }
987
+ function useInjectedDropdownItem() {
988
+ return inject(INJECTION_KEY_DROPDOWN_ITEM, {});
989
+ }
990
+ function useInjectedDropdownAction() {
991
+ return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
992
+ }
993
+ const __default__$l = {
994
+ name: "VvAction"
975
995
  };
976
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
977
- ...__default__$k,
978
- props: VvBadgeProps,
979
- setup(__props) {
996
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
997
+ ...__default__$l,
998
+ props: VvActionProps,
999
+ emits: VvActionEvents,
1000
+ setup(__props, { expose: __expose, emit }) {
980
1001
  const props = __props;
981
- const { modifiers } = toRefs(props);
982
- const bemCssClasses = useModifiers("vv-badge", modifiers);
983
- return (_ctx, _cache) => {
984
- return openBlock(), createElementBlock("span", {
985
- class: normalizeClass(unref(bemCssClasses)),
986
- role: "status"
987
- }, [
988
- renderSlot(_ctx.$slots, "default", {}, () => [
989
- createTextVNode(toDisplayString(_ctx.value), 1)
990
- ])
991
- ], 2);
1002
+ const volver = useVolver();
1003
+ const element = ref(null);
1004
+ __expose({ $el: element });
1005
+ const {
1006
+ reference: dropdownTriggerReference,
1007
+ bus: dropdownEventBus,
1008
+ aria: dropdownAria,
1009
+ expanded: dropdownExpanded
1010
+ } = useInjectedDropdownTrigger();
1011
+ watch(
1012
+ () => element.value,
1013
+ (newValue) => {
1014
+ if (dropdownTriggerReference) {
1015
+ dropdownTriggerReference.value = newValue;
1016
+ }
1017
+ }
1018
+ );
1019
+ const pressed = computed(() => {
1020
+ return props.pressed || (dropdownExpanded == null ? void 0 : dropdownExpanded.value);
1021
+ });
1022
+ const { role } = useInjectedDropdownAction();
1023
+ const hasTag = computed(() => {
1024
+ switch (true) {
1025
+ case props.disabled:
1026
+ return ActionTag.button;
1027
+ case props.to !== void 0:
1028
+ return (volver == null ? void 0 : volver.nuxt) ? ActionTag.nuxtLink : ActionTag.routerLink;
1029
+ case props.href !== void 0:
1030
+ return ActionTag.a;
1031
+ default:
1032
+ return ActionTag.button;
1033
+ }
1034
+ });
1035
+ const hasProps = computed(() => {
1036
+ const toReturn = {
1037
+ ...dropdownAria == null ? void 0 : dropdownAria.value,
1038
+ ariaPressed: pressed.value ? true : void 0,
1039
+ ariaLabel: props.ariaLabel,
1040
+ role: role == null ? void 0 : role.value
1041
+ };
1042
+ switch (hasTag.value) {
1043
+ case ActionTag.a:
1044
+ return {
1045
+ ...toReturn,
1046
+ href: props.href,
1047
+ target: props.target,
1048
+ rel: props.rel
1049
+ };
1050
+ case ActionTag.routerLink:
1051
+ case ActionTag.nuxtLink:
1052
+ return {
1053
+ ...toReturn,
1054
+ to: props.to,
1055
+ target: props.target
1056
+ };
1057
+ default:
1058
+ return {
1059
+ ...toReturn,
1060
+ type: props.type,
1061
+ disabled: props.disabled
1062
+ };
1063
+ }
1064
+ });
1065
+ const onClick = (e) => {
1066
+ if (props.disabled) {
1067
+ e.preventDefault();
1068
+ return;
1069
+ }
1070
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
1071
+ emit("click", e);
1072
+ };
1073
+ const onMouseover = (e) => {
1074
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
1075
+ emit("mouseover", e);
1076
+ };
1077
+ const onMouseleave = (e) => {
1078
+ dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
1079
+ emit("mouseleave", e);
992
1080
  };
993
- }
994
- });
995
- const VvBreadcrumbProps = {
996
- ...ModifiersProps,
997
- routes: Array
998
- };
999
- const _hoisted_1$e = { class: "vv-breadcrumb__list" };
1000
- const _hoisted_2$b = ["content"];
1001
- const __default__$j = {
1002
- name: "VvBreadcrumb"
1003
- };
1004
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
1005
- ...__default__$j,
1006
- props: VvBreadcrumbProps,
1007
- setup(__props) {
1008
- const props = __props;
1009
- const { modifiers } = toRefs(props);
1010
- const bemCssClasses = useModifiers("vv-breadcrumb", modifiers);
1011
1081
  return (_ctx, _cache) => {
1012
- return openBlock(), createElementBlock("nav", {
1013
- class: normalizeClass(unref(bemCssClasses)),
1014
- "aria-label": "breadcrumbs"
1015
- }, [
1016
- createElementVNode("ol", _hoisted_1$e, [
1017
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.routes, (route, index) => {
1018
- var _a, _b, _c, _d;
1019
- return openBlock(), createElementBlock("li", {
1020
- key: `${route.label}-${index}`,
1021
- class: normalizeClass({
1022
- "vv-breadcrumb__item": index < Number((_a = _ctx.routes) == null ? void 0 : _a.length) - 1,
1023
- "vv-breadcrumb__item-active": index === Number((_b = _ctx.routes) == null ? void 0 : _b.length) - 1
1024
- }),
1025
- itemprop: "itemListElement",
1026
- itemtype: "https://schema.org/ListItem",
1027
- itemscope: ""
1028
- }, [
1029
- (openBlock(), createBlock(resolveDynamicComponent(route.to ? "router-link" : route.href ? "a" : "span"), mergeProps(route, {
1030
- class: {
1031
- "vv-breadcrumb__link": index < Number((_c = _ctx.routes) == null ? void 0 : _c.length) - 1
1032
- },
1033
- "aria-current": index === Number((_d = _ctx.routes) == null ? void 0 : _d.length) - 1 ? "page" : void 0,
1034
- itemprop: "item"
1035
- }), {
1036
- default: withCtx(() => [
1037
- renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps({ route, index })), () => [
1038
- createTextVNode(toDisplayString(route.label), 1)
1039
- ])
1040
- ]),
1041
- _: 2
1042
- }, 1040, ["class", "aria-current"])),
1043
- createElementVNode("meta", {
1044
- itemprop: "position",
1045
- content: `${index + 1}`
1046
- }, null, 8, _hoisted_2$b)
1047
- ], 2);
1048
- }), 128))
1049
- ])
1050
- ], 2);
1082
+ return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
1083
+ ref_key: "element",
1084
+ ref: element,
1085
+ class: {
1086
+ active: _ctx.active,
1087
+ pressed: unref(pressed),
1088
+ disabled: _ctx.disabled
1089
+ },
1090
+ onClickPassive: onClick,
1091
+ onMouseoverPassive: onMouseover,
1092
+ onMouseleavePassive: onMouseleave
1093
+ }), {
1094
+ default: withCtx(() => [
1095
+ renderSlot(_ctx.$slots, "default", {}, () => [
1096
+ createTextVNode(toDisplayString(_ctx.label), 1)
1097
+ ])
1098
+ ]),
1099
+ _: 3
1100
+ }, 16, ["class"]);
1051
1101
  };
1052
1102
  }
1053
1103
  });
@@ -1145,14 +1195,11 @@ const VvIconProps = {
1145
1195
  type: [String, Array]
1146
1196
  }
1147
1197
  };
1148
- function useVolver() {
1149
- return inject(INJECTION_KEY_VOLVER);
1150
- }
1151
- const __default__$i = {
1198
+ const __default__$k = {
1152
1199
  name: "VvIcon"
1153
1200
  };
1154
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
1155
- ...__default__$i,
1201
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1202
+ ...__default__$k,
1156
1203
  props: VvIconProps,
1157
1204
  setup(__props) {
1158
1205
  const props = __props;
@@ -1244,124 +1291,307 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1244
1291
  };
1245
1292
  }
1246
1293
  });
1247
- const VvActionEvents = ["click", "mouseover", "mouseleave"];
1248
- const VvActionProps = ActionProps;
1249
- function useInjectedDropdownTrigger() {
1250
- return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
1251
- }
1252
- function useInjectedDropdownItem() {
1253
- return inject(INJECTION_KEY_DROPDOWN_ITEM, {});
1294
+ function useInjectedAlertGroup() {
1295
+ return inject(INJECTION_KEY_ALERT_GROUP, {});
1254
1296
  }
1255
- function useInjectedDropdownAction() {
1256
- return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
1257
- }
1258
- const __default__$h = {
1259
- name: "VvAction"
1260
- };
1261
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
1262
- ...__default__$h,
1263
- props: VvActionProps,
1264
- emits: VvActionEvents,
1265
- setup(__props, { expose: __expose, emit }) {
1266
- const props = __props;
1267
- const volver = useVolver();
1268
- const element = ref(null);
1269
- __expose({ $el: element });
1270
- const {
1271
- reference: dropdownTriggerReference,
1272
- bus: dropdownEventBus,
1273
- aria: dropdownAria,
1274
- expanded: dropdownExpanded
1275
- } = useInjectedDropdownTrigger();
1276
- watch(
1277
- () => element.value,
1278
- (newValue) => {
1279
- if (dropdownTriggerReference) {
1280
- dropdownTriggerReference.value = newValue;
1281
- }
1282
- }
1283
- );
1284
- const pressed = computed(() => {
1285
- return props.pressed || (dropdownExpanded == null ? void 0 : dropdownExpanded.value);
1286
- });
1287
- const { role } = useInjectedDropdownAction();
1288
- const hasTag = computed(() => {
1289
- switch (true) {
1290
- case props.disabled:
1291
- return ActionTag.button;
1292
- case props.to !== void 0:
1293
- return (volver == null ? void 0 : volver.nuxt) ? ActionTag.nuxtLink : ActionTag.routerLink;
1294
- case props.href !== void 0:
1295
- return ActionTag.a;
1296
- default:
1297
- return ActionTag.button;
1298
- }
1299
- });
1300
- const hasProps = computed(() => {
1301
- const toReturn = {
1302
- ...dropdownAria == null ? void 0 : dropdownAria.value,
1303
- "aria-pressed": pressed.value ? true : void 0,
1304
- role: role == null ? void 0 : role.value
1305
- };
1306
- switch (hasTag.value) {
1307
- case ActionTag.a:
1308
- return {
1309
- ...toReturn,
1310
- href: props.href,
1311
- target: props.target,
1312
- rel: props.rel
1313
- };
1314
- case ActionTag.routerLink:
1315
- case ActionTag.nuxtLink:
1316
- return {
1317
- ...toReturn,
1318
- to: props.to,
1319
- target: props.target
1320
- };
1321
- default:
1322
- return {
1323
- ...toReturn,
1324
- type: props.type,
1325
- disabled: props.disabled
1326
- };
1327
- }
1328
- });
1329
- const onClick = (e) => {
1330
- if (props.disabled) {
1331
- e.preventDefault();
1297
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
1298
+ const VvAlertProps = {
1299
+ ...IdProps,
1300
+ ...ModifiersProps,
1301
+ ...IconProps,
1302
+ /**
1303
+ * The alert is dismissable
1304
+ * @default false
1305
+ * @type boolean
1306
+ */
1307
+ dismissable: {
1308
+ type: Boolean,
1309
+ default: false
1310
+ },
1311
+ /**
1312
+ * The alert auto close after the specified time in milliseconds
1313
+ * @default 0
1314
+ * @type number
1315
+ */
1316
+ autoClose: {
1317
+ type: Number,
1318
+ default: 0
1319
+ },
1320
+ /**
1321
+ * The alert close label
1322
+ * @default 'Close'
1323
+ * @type string
1324
+ */
1325
+ closeLabel: {
1326
+ type: String,
1327
+ default: "Close"
1328
+ },
1329
+ /**
1330
+ * The alert title
1331
+ * @default ''
1332
+ * @type string
1333
+ */
1334
+ title: {
1335
+ type: String,
1336
+ default: void 0
1337
+ },
1338
+ /**
1339
+ * The alert content
1340
+ * @default ''
1341
+ * @type string
1342
+ */
1343
+ content: {
1344
+ type: String,
1345
+ default: void 0
1346
+ },
1347
+ /**
1348
+ * The alert footer
1349
+ * @default ''
1350
+ * @type string
1351
+ */
1352
+ footer: {
1353
+ type: String,
1354
+ default: void 0
1355
+ },
1356
+ /**
1357
+ * The alert role
1358
+ * @default 'alert'
1359
+ * @type string
1360
+ * @values 'alert', 'alertdialog'
1361
+ * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Alert_Role
1362
+ * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Alertdialog_role
1363
+ */
1364
+ role: {
1365
+ type: String,
1366
+ default: "alert"
1367
+ }
1368
+ };
1369
+ const VvAlertEvents = ["close"];
1370
+ const useVvAlert = (props, emit) => {
1371
+ const { bus } = useInjectedAlertGroup();
1372
+ const hasId = useUniqueId(computed(() => props.id));
1373
+ const hasTitleId = computed(() => `${hasId.value}-title`);
1374
+ const hasIcon = computed(
1375
+ () => typeof props.icon === "string" ? { name: props.icon } : props.icon
1376
+ );
1377
+ const hasClass = useModifiers(
1378
+ "vv-alert",
1379
+ computed(() => props.modifiers),
1380
+ computed(() => ({
1381
+ dismissable: props.autoClose > 0 || props.dismissable,
1382
+ "auto-close": props.autoClose > 0,
1383
+ hover: isMouseover.value
1384
+ }))
1385
+ );
1386
+ const hasStyle = computed(() => ({
1387
+ "--alert-duration": `${props.autoClose}ms`
1388
+ }));
1389
+ const close = () => {
1390
+ if (timeout) {
1391
+ clearTimeout(timeout);
1392
+ }
1393
+ emit("close", hasId.value);
1394
+ bus == null ? void 0 : bus.emit("close", hasId.value);
1395
+ };
1396
+ let timeout;
1397
+ watch(
1398
+ () => props.autoClose,
1399
+ (value) => {
1400
+ if (value > 0) {
1401
+ timeout = setTimeout(close, value);
1332
1402
  return;
1333
1403
  }
1334
- dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
1335
- emit("click", e);
1336
- };
1337
- const onMouseover = (e) => {
1338
- dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
1339
- emit("mouseover", e);
1340
- };
1341
- const onMouseleave = (e) => {
1342
- dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
1343
- emit("mouseleave", e);
1344
- };
1404
+ if (timeout) {
1405
+ clearTimeout(timeout);
1406
+ }
1407
+ },
1408
+ {
1409
+ immediate: true
1410
+ }
1411
+ );
1412
+ const isMouseover = ref(false);
1413
+ const onMouseover = withModifiers(() => {
1414
+ isMouseover.value = true;
1415
+ if (timeout) {
1416
+ clearTimeout(timeout);
1417
+ }
1418
+ }, ["passive"]);
1419
+ const onMouseleave = withModifiers(() => {
1420
+ isMouseover.value = false;
1421
+ if (props.autoClose > 0) {
1422
+ timeout = setTimeout(close, props.autoClose);
1423
+ }
1424
+ }, ["passive"]);
1425
+ return {
1426
+ close,
1427
+ hasIcon,
1428
+ hasTitleId,
1429
+ hasProps: computed(() => ({
1430
+ onMouseover,
1431
+ onMouseleave,
1432
+ class: hasClass.value,
1433
+ style: hasStyle.value,
1434
+ role: props.role,
1435
+ "aria-labelledby": hasTitleId.value
1436
+ }))
1437
+ };
1438
+ };
1439
+ const _hoisted_1$h = {
1440
+ key: 0,
1441
+ class: "vv-alert__header"
1442
+ };
1443
+ const _hoisted_2$c = ["id"];
1444
+ const _hoisted_3$6 = ["aria-label"];
1445
+ const _hoisted_4$5 = /* @__PURE__ */ createElementVNode("div", { class: "vv-alert__close-mask" }, null, -1);
1446
+ const _hoisted_5$4 = [
1447
+ _hoisted_4$5
1448
+ ];
1449
+ const _hoisted_6$4 = {
1450
+ key: 1,
1451
+ class: "vv-alert__content"
1452
+ };
1453
+ const _hoisted_7$4 = {
1454
+ key: 2,
1455
+ class: "vv-alert__footer"
1456
+ };
1457
+ const __default__$j = {
1458
+ name: "VvAlert"
1459
+ };
1460
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1461
+ ...__default__$j,
1462
+ props: VvAlertProps,
1463
+ emits: VvAlertEvents,
1464
+ setup(__props, { expose: __expose, emit }) {
1465
+ const props = __props;
1466
+ const { hasProps, hasTitleId, hasIcon, close } = useVvAlert(props, emit);
1467
+ __expose({ close });
1345
1468
  return (_ctx, _cache) => {
1346
- return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
1347
- ref_key: "element",
1348
- ref: element,
1349
- class: {
1350
- active: _ctx.active,
1351
- pressed: unref(pressed),
1352
- disabled: _ctx.disabled
1353
- },
1354
- onClickPassive: onClick,
1355
- onMouseoverPassive: onMouseover,
1356
- onMouseleavePassive: onMouseleave
1357
- }), {
1358
- default: withCtx(() => [
1469
+ return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(hasProps))), [
1470
+ _ctx.$slots.header || _ctx.$slots.title || _ctx.$slots.close || _ctx.$slots["title::before"] || _ctx.$slots["title::after"] || _ctx.title || _ctx.dismissable || _ctx.autoClose ? (openBlock(), createElementBlock("div", _hoisted_1$h, [
1471
+ unref(hasIcon) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-alert__icon" }), null, 16)) : createCommentVNode("", true),
1472
+ renderSlot(_ctx.$slots, "header", {}, () => [
1473
+ renderSlot(_ctx.$slots, "title::before"),
1474
+ _ctx.$slots.title || _ctx.title ? (openBlock(), createElementBlock("strong", {
1475
+ key: 0,
1476
+ id: unref(hasTitleId),
1477
+ class: "vv-alert__title"
1478
+ }, [
1479
+ renderSlot(_ctx.$slots, "title", {}, () => [
1480
+ createTextVNode(toDisplayString(_ctx.title), 1)
1481
+ ])
1482
+ ], 8, _hoisted_2$c)) : createCommentVNode("", true),
1483
+ renderSlot(_ctx.$slots, "title::after")
1484
+ ]),
1485
+ renderSlot(_ctx.$slots, "close", normalizeProps(guardReactiveProps({ close: unref(close) })), () => [
1486
+ _ctx.dismissable || _ctx.autoClose ? (openBlock(), createElementBlock("button", {
1487
+ key: 0,
1488
+ class: "vv-alert__close",
1489
+ type: "button",
1490
+ "aria-label": _ctx.closeLabel,
1491
+ onClick: _cache[0] || (_cache[0] = withModifiers(
1492
+ //@ts-ignore
1493
+ (...args) => unref(close) && unref(close)(...args),
1494
+ ["stop"]
1495
+ ))
1496
+ }, _hoisted_5$4, 8, _hoisted_3$6)) : createCommentVNode("", true)
1497
+ ])
1498
+ ])) : createCommentVNode("", true),
1499
+ _ctx.$slots.default || _ctx.content ? (openBlock(), createElementBlock("div", _hoisted_6$4, [
1359
1500
  renderSlot(_ctx.$slots, "default", {}, () => [
1360
- createTextVNode(toDisplayString(_ctx.label), 1)
1501
+ createTextVNode(toDisplayString(_ctx.content), 1)
1361
1502
  ])
1362
- ]),
1363
- _: 3
1364
- }, 16, ["class"]);
1503
+ ])) : createCommentVNode("", true),
1504
+ _ctx.$slots.footer || _ctx.footer ? (openBlock(), createElementBlock("div", _hoisted_7$4, [
1505
+ renderSlot(_ctx.$slots, "footer", {}, () => [
1506
+ createTextVNode(toDisplayString(_ctx.footer), 1)
1507
+ ])
1508
+ ])) : createCommentVNode("", true)
1509
+ ], 16);
1510
+ };
1511
+ }
1512
+ });
1513
+ const VvBadgeProps = {
1514
+ ...ModifiersProps,
1515
+ value: [String, Number]
1516
+ };
1517
+ const __default__$i = {
1518
+ name: "VvBadge"
1519
+ };
1520
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1521
+ ...__default__$i,
1522
+ props: VvBadgeProps,
1523
+ setup(__props) {
1524
+ const props = __props;
1525
+ const { modifiers } = toRefs(props);
1526
+ const bemCssClasses = useModifiers("vv-badge", modifiers);
1527
+ return (_ctx, _cache) => {
1528
+ return openBlock(), createElementBlock("span", {
1529
+ class: normalizeClass(unref(bemCssClasses)),
1530
+ role: "status"
1531
+ }, [
1532
+ renderSlot(_ctx.$slots, "default", {}, () => [
1533
+ createTextVNode(toDisplayString(_ctx.value), 1)
1534
+ ])
1535
+ ], 2);
1536
+ };
1537
+ }
1538
+ });
1539
+ const VvBreadcrumbProps = {
1540
+ ...ModifiersProps,
1541
+ routes: Array
1542
+ };
1543
+ const _hoisted_1$g = { class: "vv-breadcrumb__list" };
1544
+ const _hoisted_2$b = ["content"];
1545
+ const __default__$h = {
1546
+ name: "VvBreadcrumb"
1547
+ };
1548
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1549
+ ...__default__$h,
1550
+ props: VvBreadcrumbProps,
1551
+ setup(__props) {
1552
+ const props = __props;
1553
+ const { modifiers } = toRefs(props);
1554
+ const bemCssClasses = useModifiers("vv-breadcrumb", modifiers);
1555
+ return (_ctx, _cache) => {
1556
+ return openBlock(), createElementBlock("nav", {
1557
+ class: normalizeClass(unref(bemCssClasses)),
1558
+ "aria-label": "breadcrumbs"
1559
+ }, [
1560
+ createElementVNode("ol", _hoisted_1$g, [
1561
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.routes, (route, index) => {
1562
+ var _a, _b, _c, _d;
1563
+ return openBlock(), createElementBlock("li", {
1564
+ key: `${route.label}-${index}`,
1565
+ class: normalizeClass({
1566
+ "vv-breadcrumb__item": index < Number((_a = _ctx.routes) == null ? void 0 : _a.length) - 1,
1567
+ "vv-breadcrumb__item-active": index === Number((_b = _ctx.routes) == null ? void 0 : _b.length) - 1
1568
+ }),
1569
+ itemprop: "itemListElement",
1570
+ itemtype: "https://schema.org/ListItem",
1571
+ itemscope: ""
1572
+ }, [
1573
+ (openBlock(), createBlock(resolveDynamicComponent(route.to ? "router-link" : route.href ? "a" : "span"), mergeProps(route, {
1574
+ class: {
1575
+ "vv-breadcrumb__link": index < Number((_c = _ctx.routes) == null ? void 0 : _c.length) - 1
1576
+ },
1577
+ "aria-current": index === Number((_d = _ctx.routes) == null ? void 0 : _d.length) - 1 ? "page" : void 0,
1578
+ itemprop: "item"
1579
+ }), {
1580
+ default: withCtx(() => [
1581
+ renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps({ route, index })), () => [
1582
+ createTextVNode(toDisplayString(route.label), 1)
1583
+ ])
1584
+ ]),
1585
+ _: 2
1586
+ }, 1040, ["class", "aria-current"])),
1587
+ createElementVNode("meta", {
1588
+ itemprop: "position",
1589
+ content: `${index + 1}`
1590
+ }, null, 8, _hoisted_2$b)
1591
+ ], 2);
1592
+ }), 128))
1593
+ ])
1594
+ ], 2);
1365
1595
  };
1366
1596
  }
1367
1597
  });
@@ -1469,8 +1699,7 @@ function useGroupProps$2(props, emit) {
1469
1699
  label
1470
1700
  };
1471
1701
  }
1472
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
1473
- const _hoisted_1$d = {
1702
+ const _hoisted_1$f = {
1474
1703
  key: 1,
1475
1704
  class: "vv-button__label"
1476
1705
  };
@@ -1481,7 +1710,7 @@ const _hoisted_2$a = {
1481
1710
  const __default__$g = {
1482
1711
  name: "VvButton"
1483
1712
  };
1484
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
1713
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1485
1714
  ...__default__$g,
1486
1715
  props: VvButtonProps,
1487
1716
  emits: VvButtonEvents,
@@ -1560,7 +1789,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1560
1789
  }
1561
1790
  };
1562
1791
  return (_ctx, _cache) => {
1563
- return openBlock(), createBlock(_sfc_main$h, mergeProps({
1792
+ return openBlock(), createBlock(_sfc_main$o, mergeProps({
1564
1793
  disabled: unref(disabled),
1565
1794
  pressed: unref(pressed),
1566
1795
  active: _ctx.active,
@@ -1568,7 +1797,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1568
1797
  to: _ctx.to,
1569
1798
  href: _ctx.href,
1570
1799
  target: _ctx.target,
1571
- rel: _ctx.rel
1800
+ rel: _ctx.rel,
1801
+ ariaLabel: _ctx.ariaLabel
1572
1802
  }, {
1573
1803
  id: unref(hasId),
1574
1804
  ref_key: "element",
@@ -1579,15 +1809,15 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1579
1809
  default: withCtx(() => [
1580
1810
  renderSlot(_ctx.$slots, "default", {}, () => [
1581
1811
  _ctx.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
1582
- _ctx.loadingIcon ? (openBlock(), createBlock(_sfc_main$i, {
1812
+ _ctx.loadingIcon ? (openBlock(), createBlock(_sfc_main$n, {
1583
1813
  key: 0,
1584
1814
  class: "vv-button__loading-icon",
1585
1815
  name: _ctx.loadingIcon
1586
1816
  }, null, 8, ["name"])) : createCommentVNode("", true),
1587
- _ctx.loadingLabel ? (openBlock(), createElementBlock("span", _hoisted_1$d, toDisplayString(_ctx.loadingLabel), 1)) : createCommentVNode("", true)
1817
+ _ctx.loadingLabel ? (openBlock(), createElementBlock("span", _hoisted_1$f, toDisplayString(_ctx.loadingLabel), 1)) : createCommentVNode("", true)
1588
1818
  ]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1589
1819
  renderSlot(_ctx.$slots, "before"),
1590
- unref(icon) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1820
+ unref(icon) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
1591
1821
  key: 0,
1592
1822
  class: "vv-button__icon"
1593
1823
  }, unref(hasIconProps)), null, 16)) : createCommentVNode("", true),
@@ -1627,7 +1857,7 @@ const VvButtonGroupEvents = ["update:modelValue"];
1627
1857
  const __default__$f = {
1628
1858
  name: "VvButtonGroup"
1629
1859
  };
1630
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
1860
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1631
1861
  ...__default__$f,
1632
1862
  props: VvButtonGroupProps,
1633
1863
  emits: VvButtonGroupEvents,
@@ -1686,7 +1916,7 @@ const VvCardProps = {
1686
1916
  ...ModifiersProps,
1687
1917
  title: String
1688
1918
  };
1689
- const _hoisted_1$c = {
1919
+ const _hoisted_1$e = {
1690
1920
  key: 0,
1691
1921
  class: "vv-card__header"
1692
1922
  };
@@ -1701,7 +1931,7 @@ const _hoisted_3$5 = {
1701
1931
  const __default__$e = {
1702
1932
  name: "VvCard"
1703
1933
  };
1704
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
1934
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1705
1935
  ...__default__$e,
1706
1936
  props: VvCardProps,
1707
1937
  setup(__props) {
@@ -1712,7 +1942,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
1712
1942
  return openBlock(), createElementBlock("article", {
1713
1943
  class: normalizeClass(unref(bemCssClasses))
1714
1944
  }, [
1715
- _ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_1$c, [
1945
+ _ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_1$e, [
1716
1946
  renderSlot(_ctx.$slots, "header", {}, () => [
1717
1947
  createTextVNode(toDisplayString(_ctx.title), 1)
1718
1948
  ])
@@ -1784,19 +2014,27 @@ function joinLines(items) {
1784
2014
  }
1785
2015
  return items;
1786
2016
  }
1787
- function HintSlotFactory(props, slots) {
1788
- const invalidLabel = computed(() => joinLines(props.invalidLabel));
1789
- const validLabel = computed(() => joinLines(props.validLabel));
1790
- const loadingLabel = computed(() => props.loadingLabel);
1791
- const hintLabel = computed(() => props.hintLabel);
2017
+ function HintSlotFactory(propsOrRef, slots) {
2018
+ const props = computed(() => {
2019
+ if (isRef(propsOrRef)) {
2020
+ return propsOrRef.value;
2021
+ }
2022
+ return propsOrRef;
2023
+ });
2024
+ const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
2025
+ const validLabel = computed(() => joinLines(props.value.validLabel));
2026
+ const loadingLabel = computed(() => props.value.loadingLabel);
2027
+ const hintLabel = computed(() => props.value.hintLabel);
1792
2028
  const hasLoadingLabelOrSlot = computed(
1793
- () => Boolean(props.loading && (slots.loading || loadingLabel.value))
2029
+ () => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
1794
2030
  );
1795
2031
  const hasInvalidLabelOrSlot = computed(
1796
- () => !hasLoadingLabelOrSlot.value && Boolean(props.invalid && (slots.invalid || invalidLabel.value))
2032
+ () => !hasLoadingLabelOrSlot.value && Boolean(
2033
+ props.value.invalid && (slots.invalid || invalidLabel.value)
2034
+ )
1797
2035
  );
1798
2036
  const hasValidLabelOrSlot = computed(
1799
- () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
2037
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
1800
2038
  );
1801
2039
  const hasHintLabelOrSlot = computed(
1802
2040
  () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
@@ -1805,10 +2043,10 @@ function HintSlotFactory(props, slots) {
1805
2043
  () => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
1806
2044
  );
1807
2045
  const hintSlotScope = computed(() => ({
1808
- modelValue: props.modelValue,
1809
- valid: props.valid,
1810
- invalid: props.invalid,
1811
- loading: props.loading
2046
+ modelValue: props.value.modelValue,
2047
+ valid: props.value.valid,
2048
+ invalid: props.value.invalid,
2049
+ loading: props.value.loading
1812
2050
  }));
1813
2051
  const HintSlot = defineComponent({
1814
2052
  name: "HintSlot",
@@ -1888,18 +2126,76 @@ function HintSlotFactory(props, slots) {
1888
2126
  HintSlot
1889
2127
  };
1890
2128
  }
1891
- const _hoisted_1$b = ["for"];
2129
+ function useDefaults(componentName, propsDefinition, props) {
2130
+ const volver = useVolver();
2131
+ const volverComponentDefaults = computed(() => {
2132
+ var _a;
2133
+ if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
2134
+ return void 0;
2135
+ }
2136
+ return volver.defaults.value[componentName];
2137
+ });
2138
+ return computed(() => {
2139
+ if (volverComponentDefaults.value === void 0) {
2140
+ return props;
2141
+ }
2142
+ const componentDefaults = volverComponentDefaults.value;
2143
+ const simplifiedPropsDefinition = propsDefinition;
2144
+ const simplifiedProps = props;
2145
+ return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
2146
+ const propValue = simplifiedProps[key];
2147
+ acc[key] = propValue;
2148
+ if (key in componentDefaults) {
2149
+ if (Array.isArray(simplifiedPropsDefinition[key])) {
2150
+ const typeArray = simplifiedPropsDefinition[key];
2151
+ if (typeArray.length) {
2152
+ const typeFunction = typeArray[0];
2153
+ if (typeFunction === propValue) {
2154
+ acc[key] = componentDefaults[key];
2155
+ }
2156
+ }
2157
+ }
2158
+ if (typeof simplifiedPropsDefinition[key] === "function") {
2159
+ const typeFunction = simplifiedPropsDefinition[key];
2160
+ if (typeFunction() === propValue) {
2161
+ acc[key] = componentDefaults[key];
2162
+ }
2163
+ }
2164
+ if (typeof simplifiedPropsDefinition[key] === "object") {
2165
+ let defaultValue = simplifiedPropsDefinition[key].default;
2166
+ if (typeof defaultValue === "function") {
2167
+ defaultValue = defaultValue();
2168
+ }
2169
+ if (typeof defaultValue === "object") {
2170
+ if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
2171
+ acc[key] = componentDefaults[key];
2172
+ }
2173
+ } else if (defaultValue === propValue) {
2174
+ acc[key] = componentDefaults[key];
2175
+ }
2176
+ }
2177
+ }
2178
+ return acc;
2179
+ }, {});
2180
+ });
2181
+ }
2182
+ const _hoisted_1$d = ["for"];
1892
2183
  const _hoisted_2$8 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid", "aria-describedby", "aria-errormessage"];
1893
2184
  const __default__$d = {
1894
2185
  name: "VvCheckbox"
1895
2186
  };
1896
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
2187
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1897
2188
  ...__default__$d,
1898
2189
  props: VvCheckboxProps,
1899
2190
  emits: VvCheckboxEvents,
1900
2191
  setup(__props, { emit }) {
1901
2192
  const props = __props;
1902
2193
  const slots = useSlots();
2194
+ const propsDefaults = useDefaults(
2195
+ "VvCheckbox",
2196
+ VvCheckboxProps,
2197
+ props
2198
+ );
1903
2199
  const {
1904
2200
  id,
1905
2201
  disabled,
@@ -2012,7 +2308,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
2012
2308
  hasHintLabelOrSlot,
2013
2309
  hasInvalidLabelOrSlot,
2014
2310
  hintSlotScope
2015
- } = HintSlotFactory(props, slots);
2311
+ } = HintSlotFactory(propsDefaults, slots);
2016
2312
  return (_ctx, _cache) => {
2017
2313
  return openBlock(), createElementBlock("label", {
2018
2314
  class: normalizeClass(unref(bemCssClasses)),
@@ -2071,7 +2367,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
2071
2367
  key: "3"
2072
2368
  } : void 0
2073
2369
  ]), 1032, ["id"])
2074
- ], 10, _hoisted_1$b);
2370
+ ], 10, _hoisted_1$d);
2075
2371
  };
2076
2372
  }
2077
2373
  });
@@ -2109,18 +2405,23 @@ function useOptions(props) {
2109
2405
  getOptionGrouped
2110
2406
  };
2111
2407
  }
2112
- const _hoisted_1$a = ["textContent"];
2408
+ const _hoisted_1$c = ["textContent"];
2113
2409
  const _hoisted_2$7 = { class: "vv-checkbox-group__wrapper" };
2114
2410
  const __default__$c = {
2115
2411
  name: "VvCheckboxGroup"
2116
2412
  };
2117
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
2413
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2118
2414
  ...__default__$c,
2119
2415
  props: VvCheckboxGroupProps,
2120
2416
  emits: VvCheckboxGroupEvents,
2121
2417
  setup(__props, { emit }) {
2122
2418
  const props = __props;
2123
2419
  const slots = useSlots();
2420
+ const propsDefaults = useDefaults(
2421
+ "VvCheckboxGroup",
2422
+ VvCheckboxGroupProps,
2423
+ props
2424
+ );
2124
2425
  const modelValue = useVModel(props, "modelValue", emit);
2125
2426
  const { disabled, readonly, vertical, valid, invalid, modifiers } = toRefs(props);
2126
2427
  useProvideGroupState({
@@ -2151,7 +2452,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2151
2452
  value: getOptionValue(option)
2152
2453
  };
2153
2454
  };
2154
- const { HintSlot, hintSlotScope } = HintSlotFactory(props, slots);
2455
+ const { HintSlot, hintSlotScope } = HintSlotFactory(propsDefaults, slots);
2155
2456
  return (_ctx, _cache) => {
2156
2457
  return openBlock(), createElementBlock("fieldset", {
2157
2458
  class: normalizeClass(unref(bemCssClasses))
@@ -2159,10 +2460,10 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2159
2460
  _ctx.label ? (openBlock(), createElementBlock("legend", {
2160
2461
  key: 0,
2161
2462
  textContent: toDisplayString(_ctx.label)
2162
- }, null, 8, _hoisted_1$a)) : createCommentVNode("", true),
2463
+ }, null, 8, _hoisted_1$c)) : createCommentVNode("", true),
2163
2464
  createElementVNode("div", _hoisted_2$7, [
2164
2465
  _ctx.options.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.options, (option, index) => {
2165
- return openBlock(), createBlock(_sfc_main$d, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
2466
+ return openBlock(), createBlock(_sfc_main$g, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
2166
2467
  }), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
2167
2468
  ]),
2168
2469
  createVNode(unref(HintSlot), { class: "vv-checkbox-group__hint" }, createSlots({ _: 2 }, [
@@ -2221,6 +2522,13 @@ const VvComboboxProps = {
2221
2522
  ...UnselectableProps,
2222
2523
  ...DropdownProps,
2223
2524
  ...LabelProps,
2525
+ /**
2526
+ * Dropdown show / hide transition name
2527
+ */
2528
+ transitionName: {
2529
+ type: String,
2530
+ default: "vv-dropdown--mobile-fade-block"
2531
+ },
2224
2532
  /**
2225
2533
  * modelValue can be a string, number, boolean, object or array of string, number, boolean, object
2226
2534
  */
@@ -2252,6 +2560,10 @@ const VvComboboxProps = {
2252
2560
  * Label for deselected option hint
2253
2561
  */
2254
2562
  deselectHintLabel: { type: String, default: "Press enter to remove" },
2563
+ /**
2564
+ * Label close button
2565
+ */
2566
+ closeLabel: { type: String, default: "Close" },
2255
2567
  /**
2256
2568
  * Select input placeholder
2257
2569
  */
@@ -2260,6 +2572,13 @@ const VvComboboxProps = {
2260
2572
  * Use input text to search on options
2261
2573
  */
2262
2574
  searchable: Boolean,
2575
+ /**
2576
+ * Search function to filter options
2577
+ */
2578
+ searchFunction: {
2579
+ type: Function,
2580
+ default: void 0
2581
+ },
2263
2582
  /**
2264
2583
  * On searchable select is the input search placeholder
2265
2584
  */
@@ -2333,13 +2652,7 @@ const VvComboboxProps = {
2333
2652
  const VvDropdownProps = {
2334
2653
  ...IdProps,
2335
2654
  ...DropdownProps,
2336
- /**
2337
- * Component BEM modifiers
2338
- */
2339
- modifiers: {
2340
- type: [String, Array],
2341
- default: "mobile"
2342
- },
2655
+ ...ModifiersProps,
2343
2656
  /**
2344
2657
  * Show / hide dropdown programmatically
2345
2658
  */
@@ -2412,12 +2725,12 @@ function useProvideDropdownAction({
2412
2725
  expanded
2413
2726
  });
2414
2727
  }
2415
- const _hoisted_1$9 = ["id", "tabindex", "role", "aria-labelledby"];
2728
+ const _hoisted_1$b = ["id", "tabindex", "role", "aria-labelledby"];
2416
2729
  const __default__$b = {
2417
2730
  name: "VvDropdown",
2418
2731
  inheritAttrs: false
2419
2732
  };
2420
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
2733
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
2421
2734
  ...__default__$b,
2422
2735
  props: VvDropdownProps,
2423
2736
  emits: [
@@ -2425,7 +2738,15 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2425
2738
  "beforeExpand",
2426
2739
  "beforeCollapse",
2427
2740
  "afterExpand",
2428
- "afterCollapse"
2741
+ "afterCollapse",
2742
+ "before-enter",
2743
+ "after-leave",
2744
+ "enter",
2745
+ "after-enter",
2746
+ "enter-cancelled",
2747
+ "before-leave",
2748
+ "leave",
2749
+ "leave-cancelled"
2429
2750
  ],
2430
2751
  setup(__props, { expose: __expose, emit }) {
2431
2752
  const props = __props;
@@ -2526,7 +2847,11 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2526
2847
  referenceEl,
2527
2848
  floatingEl,
2528
2849
  {
2529
- whileElementsMounted: autoUpdate,
2850
+ whileElementsMounted: (...args) => {
2851
+ return autoUpdate(...args, {
2852
+ animationFrame: props.strategy === "fixed"
2853
+ });
2854
+ },
2530
2855
  placement: computed(() => props.placement),
2531
2856
  strategy: computed(() => props.strategy),
2532
2857
  middleware
@@ -2613,7 +2938,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2613
2938
  onClickOutside(
2614
2939
  floatingEl,
2615
2940
  () => {
2616
- if (!props.keepOpen) {
2941
+ if (!props.keepOpen && expanded.value) {
2617
2942
  expanded.value = false;
2618
2943
  }
2619
2944
  },
@@ -2651,7 +2976,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2651
2976
  }
2652
2977
  return [
2653
2978
  ...element.querySelectorAll(
2654
- 'a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'
2979
+ 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
2655
2980
  )
2656
2981
  ].filter(
2657
2982
  (el) => !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden")
@@ -2729,11 +3054,33 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2729
3054
  htmlEl == null ? void 0 : htmlEl.click();
2730
3055
  }
2731
3056
  });
2732
- const onTransitionBeforeEnter = () => {
2733
- emit(expanded.value ? "beforeExpand" : "beforeCollapse");
2734
- };
2735
- const onTransitionAfterLeave = () => {
2736
- emit(expanded.value ? "afterExpand" : "afterCollapse");
3057
+ const dropdownTransitionHandlers = {
3058
+ "before-enter": () => {
3059
+ emit(expanded.value ? "beforeExpand" : "beforeCollapse");
3060
+ emit("before-enter");
3061
+ },
3062
+ "after-leave": () => {
3063
+ emit(expanded.value ? "afterExpand" : "afterCollapse");
3064
+ emit("after-leave");
3065
+ },
3066
+ enter: () => {
3067
+ emit("enter");
3068
+ },
3069
+ "after-enter": () => {
3070
+ emit("after-enter");
3071
+ },
3072
+ "enter-cancelled": () => {
3073
+ emit("enter-cancelled");
3074
+ },
3075
+ "before-leave": () => {
3076
+ emit("before-leave");
3077
+ },
3078
+ leave: () => {
3079
+ emit("leave");
3080
+ },
3081
+ "leave-cancelled": () => {
3082
+ emit("leave-cancelled");
3083
+ }
2737
3084
  };
2738
3085
  return (_ctx, _cache) => {
2739
3086
  return openBlock(), createElementBlock(Fragment, null, [
@@ -2743,10 +3090,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2743
3090
  ]),
2744
3091
  _: 3
2745
3092
  }),
2746
- createVNode(Transition, mergeProps({ name: _ctx.transitionName }, toHandlers({
2747
- beforeEnter: onTransitionBeforeEnter,
2748
- onAfterLeave: onTransitionAfterLeave
2749
- })), {
3093
+ createVNode(Transition, mergeProps({ name: _ctx.transitionName }, toHandlers(dropdownTransitionHandlers)), {
2750
3094
  default: withCtx(() => [
2751
3095
  withDirectives(createElementVNode("div", {
2752
3096
  ref_key: "floatingEl",
@@ -2774,7 +3118,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2774
3118
  renderSlot(_ctx.$slots, "items", normalizeProps(guardReactiveProps({
2775
3119
  role: unref(itemRole)
2776
3120
  })))
2777
- ], 16, _hoisted_1$9),
3121
+ ], 16, _hoisted_1$b),
2778
3122
  renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps({ expanded: unref(expanded) })))
2779
3123
  ], 6), [
2780
3124
  [vShow, unref(expanded)]
@@ -2789,7 +3133,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2789
3133
  const __default__$a = {
2790
3134
  name: "VvDropdownItem"
2791
3135
  };
2792
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
3136
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
2793
3137
  ...__default__$a,
2794
3138
  setup(__props) {
2795
3139
  const { role, expanded } = useInjectedDropdownItem();
@@ -2814,11 +3158,11 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2814
3158
  };
2815
3159
  }
2816
3160
  });
2817
- const _hoisted_1$8 = ["title"];
3161
+ const _hoisted_1$a = ["title"];
2818
3162
  const __default__$9 = {
2819
3163
  name: "VvDropdownOption"
2820
3164
  };
2821
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3165
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2822
3166
  ...__default__$9,
2823
3167
  props: {
2824
3168
  ...DisabledProps,
@@ -2856,7 +3200,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2856
3200
  }
2857
3201
  });
2858
3202
  return (_ctx, _cache) => {
2859
- return openBlock(), createBlock(_sfc_main$a, {
3203
+ return openBlock(), createBlock(_sfc_main$d, {
2860
3204
  class: normalizeClass(unref(bemCssClasses)),
2861
3205
  tabindex: _ctx.disabled ? -1 : 0,
2862
3206
  "aria-selected": _ctx.selected,
@@ -2871,14 +3215,14 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2871
3215
  renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps({ disabled: _ctx.disabled, selected: _ctx.selected, unselectable: _ctx.unselectable })), () => [
2872
3216
  createTextVNode(toDisplayString(unref(hintLabel)), 1)
2873
3217
  ])
2874
- ], 8, _hoisted_1$8)
3218
+ ], 8, _hoisted_1$a)
2875
3219
  ]),
2876
3220
  _: 3
2877
3221
  }, 8, ["class", "tabindex", "aria-selected", "aria-disabled"]);
2878
3222
  };
2879
3223
  }
2880
3224
  });
2881
- const _hoisted_1$7 = {
3225
+ const _hoisted_1$9 = {
2882
3226
  class: "vv-dropdown-optgroup",
2883
3227
  role: "presentation",
2884
3228
  tabindex: "-1"
@@ -2886,7 +3230,7 @@ const _hoisted_1$7 = {
2886
3230
  const __default__$8 = {
2887
3231
  name: "VvDropdownOptgroup"
2888
3232
  };
2889
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
3233
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2890
3234
  ...__default__$8,
2891
3235
  props: {
2892
3236
  ...LabelProps
@@ -2894,7 +3238,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2894
3238
  setup(__props) {
2895
3239
  const props = __props;
2896
3240
  return (_ctx, _cache) => {
2897
- return openBlock(), createElementBlock("li", _hoisted_1$7, toDisplayString(props.label), 1);
3241
+ return openBlock(), createElementBlock("li", _hoisted_1$9, toDisplayString(props.label), 1);
2898
3242
  };
2899
3243
  }
2900
3244
  });
@@ -2991,13 +3335,13 @@ function useComponentIcon(icon, iconPosition) {
2991
3335
  hasIconAfter
2992
3336
  };
2993
3337
  }
2994
- const _hoisted_1$6 = ["for"];
3338
+ const _hoisted_1$8 = ["for"];
2995
3339
  const _hoisted_2$6 = { class: "vv-select__wrapper" };
2996
3340
  const _hoisted_3$4 = {
2997
3341
  key: 0,
2998
3342
  class: "vv-select__input-before"
2999
3343
  };
3000
- const _hoisted_4$3 = { class: "vv-select__inner" };
3344
+ const _hoisted_4$4 = { class: "vv-select__inner" };
3001
3345
  const _hoisted_5$3 = ["id"];
3002
3346
  const _hoisted_6$3 = ["disabled", "hidden"];
3003
3347
  const _hoisted_7$3 = ["disabled", "value"];
@@ -3010,20 +3354,25 @@ const _hoisted_10 = {
3010
3354
  const __default__$7 = {
3011
3355
  name: "VvSelect"
3012
3356
  };
3013
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3357
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3014
3358
  ...__default__$7,
3015
3359
  props: VvSelectProps,
3016
3360
  emits: VvSelectEmits,
3017
3361
  setup(__props, { emit }) {
3018
3362
  const props = __props;
3019
3363
  const slots = useSlots();
3364
+ const propsDefaults = useDefaults(
3365
+ "VvSelect",
3366
+ VvSelectProps,
3367
+ props
3368
+ );
3020
3369
  const select = ref();
3021
3370
  const {
3022
3371
  HintSlot,
3023
3372
  hasHintLabelOrSlot,
3024
3373
  hasInvalidLabelOrSlot,
3025
3374
  hintSlotScope
3026
- } = HintSlotFactory(props, slots);
3375
+ } = HintSlotFactory(propsDefaults, slots);
3027
3376
  const {
3028
3377
  id,
3029
3378
  modifiers,
@@ -3129,13 +3478,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3129
3478
  _ctx.label ? (openBlock(), createElementBlock("label", {
3130
3479
  key: 0,
3131
3480
  for: unref(hasId)
3132
- }, toDisplayString(_ctx.label), 9, _hoisted_1$6)) : createCommentVNode("", true),
3481
+ }, toDisplayString(_ctx.label), 9, _hoisted_1$8)) : createCommentVNode("", true),
3133
3482
  createElementVNode("div", _hoisted_2$6, [
3134
3483
  _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3$4, [
3135
3484
  renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
3136
3485
  ])) : createCommentVNode("", true),
3137
- createElementVNode("div", _hoisted_4$3, [
3138
- unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
3486
+ createElementVNode("div", _hoisted_4$4, [
3487
+ unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
3139
3488
  key: 0,
3140
3489
  class: "vv-select__icon"
3141
3490
  }, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
@@ -3175,7 +3524,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3175
3524
  ], 16, _hoisted_5$3), [
3176
3525
  [vModelSelect, unref(localModelValue)]
3177
3526
  ]),
3178
- unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
3527
+ unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
3179
3528
  key: 1,
3180
3529
  class: "vv-select__icon vv-select__icon-after"
3181
3530
  }, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
@@ -3221,63 +3570,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3221
3570
  };
3222
3571
  }
3223
3572
  });
3224
- function useDefaults(componentName, propsDefinition, props) {
3225
- const volver = useVolver();
3226
- const volverComponentDefaults = computed(() => {
3227
- var _a;
3228
- if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
3229
- return void 0;
3230
- }
3231
- return volver.defaults.value[componentName];
3232
- });
3233
- return computed(() => {
3234
- if (volverComponentDefaults.value === void 0) {
3235
- return props;
3236
- }
3237
- const componentDefaults = volverComponentDefaults.value;
3238
- const simplifiedPropsDefinition = propsDefinition;
3239
- const simplifiedProps = props;
3240
- return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
3241
- const propValue = simplifiedProps[key];
3242
- acc[key] = propValue;
3243
- if (key in componentDefaults) {
3244
- if (Array.isArray(simplifiedPropsDefinition[key])) {
3245
- const typeArray = simplifiedPropsDefinition[key];
3246
- if (typeArray.length) {
3247
- const typeFunction = typeArray[0];
3248
- if (typeFunction === propValue) {
3249
- acc[key] = componentDefaults[key];
3250
- }
3251
- }
3252
- }
3253
- if (typeof simplifiedPropsDefinition[key] === "function") {
3254
- const typeFunction = simplifiedPropsDefinition[key];
3255
- if (typeFunction() === propValue) {
3256
- acc[key] = componentDefaults[key];
3257
- }
3258
- }
3259
- if (typeof simplifiedPropsDefinition[key] === "object") {
3260
- let defaultValue = simplifiedPropsDefinition[key].default;
3261
- if (typeof defaultValue === "function") {
3262
- defaultValue = defaultValue();
3263
- }
3264
- if (typeof defaultValue === "object") {
3265
- if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
3266
- acc[key] = componentDefaults[key];
3267
- }
3268
- } else if (defaultValue === propValue) {
3269
- acc[key] = componentDefaults[key];
3270
- }
3271
- }
3272
- }
3273
- return acc;
3274
- }, {});
3275
- });
3276
- }
3277
- const _hoisted_1$5 = ["id"];
3573
+ const _hoisted_1$7 = ["id"];
3278
3574
  const _hoisted_2$5 = ["id", "for"];
3279
3575
  const _hoisted_3$3 = ["id", "aria-controls", "placeholder"];
3280
- const _hoisted_4$2 = {
3576
+ const _hoisted_4$3 = {
3281
3577
  key: 0,
3282
3578
  class: "vv-select__input-before"
3283
3579
  };
@@ -3295,13 +3591,13 @@ const _hoisted_9 = {
3295
3591
  const __default__$6 = {
3296
3592
  name: "VvCombobox",
3297
3593
  components: {
3298
- VvDropdown: _sfc_main$b,
3299
- VvDropdownOption: _sfc_main$9,
3300
- VvDropdownOptgroup: _sfc_main$8,
3301
- VvButton: _sfc_main$g
3594
+ VvDropdown: _sfc_main$e,
3595
+ VvDropdownOption: _sfc_main$c,
3596
+ VvDropdownOptgroup: _sfc_main$b,
3597
+ VvButton: _sfc_main$j
3302
3598
  }
3303
3599
  };
3304
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3600
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3305
3601
  ...__default__$6,
3306
3602
  props: VvComboboxProps,
3307
3603
  emits: VvComboboxEvents,
@@ -3324,7 +3620,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3324
3620
  hasHintLabelOrSlot,
3325
3621
  hasInvalidLabelOrSlot,
3326
3622
  hintSlotScope
3327
- } = HintSlotFactory(props, slots);
3623
+ } = HintSlotFactory(propsDefaults, slots);
3328
3624
  const inputEl = ref(null);
3329
3625
  const inputSearchEl = ref(null);
3330
3626
  const wrapperEl = ref(null);
@@ -3438,6 +3734,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3438
3734
  } = useOptions(props);
3439
3735
  const filteredOptions = computed(() => {
3440
3736
  var _a;
3737
+ if (propsDefaults.value.searchFunction) {
3738
+ return propsDefaults.value.searchFunction(
3739
+ debouncedSearchText.value,
3740
+ props.options
3741
+ );
3742
+ }
3441
3743
  return (_a = props.options) == null ? void 0 : _a.filter((option) => {
3442
3744
  return getOptionLabel(option).toLowerCase().includes(debouncedSearchText.value.toLowerCase().trim());
3443
3745
  });
@@ -3542,7 +3844,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3542
3844
  flip: propsDefaults.value.flip,
3543
3845
  autoPlacement: propsDefaults.value.autoPlacement,
3544
3846
  arrow: propsDefaults.value.arrow,
3545
- autofocusFirst: searchable.value ? false : propsDefaults.value.autofocusFirst,
3847
+ autofocusFirst: searchable.value ? true : propsDefaults.value.autofocusFirst,
3546
3848
  triggerWidth: propsDefaults.value.triggerWidth,
3547
3849
  modifiers: propsDefaults.value.dropdownModifiers
3548
3850
  }));
@@ -3581,7 +3883,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3581
3883
  ref: wrapperEl,
3582
3884
  class: "vv-select__wrapper"
3583
3885
  }, [
3584
- createVNode(_sfc_main$b, mergeProps({
3886
+ createVNode(_sfc_main$e, mergeProps({
3585
3887
  ref_key: "dropdownEl",
3586
3888
  ref: dropdownEl,
3587
3889
  modelValue: unref(expanded),
@@ -3592,11 +3894,11 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3592
3894
  onAfterCollapse
3593
3895
  }), createSlots({
3594
3896
  default: withCtx(({ aria }) => [
3595
- _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
3897
+ _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
3596
3898
  renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
3597
3899
  ])) : createCommentVNode("", true),
3598
3900
  createElementVNode("div", _hoisted_5$2, [
3599
- unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
3901
+ unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
3600
3902
  key: 0,
3601
3903
  class: "vv-select__icon"
3602
3904
  }, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
@@ -3616,7 +3918,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3616
3918
  renderSlot(_ctx.$slots, "value", normalizeProps(guardReactiveProps({ selectedOptions: unref(selectedOptions), onInput })), () => [
3617
3919
  unref(hasValue) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3618
3920
  !_ctx.badges ? (openBlock(), createElementBlock("div", _hoisted_7$2, toDisplayString(unref(hasValue)), 1)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(selectedOptions), (option, index) => {
3619
- return openBlock(), createBlock(_sfc_main$k, {
3921
+ return openBlock(), createBlock(_sfc_main$l, {
3620
3922
  key: index,
3621
3923
  modifiers: _ctx.badgeModifiers,
3622
3924
  class: "vv-select__badge"
@@ -3628,7 +3930,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3628
3930
  "aria-label": unref(propsDefaults).deselectActionLabel,
3629
3931
  onClick: withModifiers(($event) => onInput(option), ["stop"])
3630
3932
  }, [
3631
- createVNode(_sfc_main$i, { name: "close" })
3933
+ createVNode(_sfc_main$n, { name: "close" })
3632
3934
  ], 8, _hoisted_8$1)) : createCommentVNode("", true)
3633
3935
  ]),
3634
3936
  _: 2
@@ -3639,7 +3941,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3639
3941
  ], 64))
3640
3942
  ])
3641
3943
  ], 16, _hoisted_6$2),
3642
- unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
3944
+ unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
3643
3945
  key: 1,
3644
3946
  class: "vv-select__icon vv-select__icon-after"
3645
3947
  }, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
@@ -3652,13 +3954,13 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3652
3954
  unref(filteredOptions).length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(filteredOptions), (option, index) => {
3653
3955
  return openBlock(), createElementBlock(Fragment, { key: index }, [
3654
3956
  isGroup(option) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3655
- createVNode(_sfc_main$8, {
3957
+ createVNode(_sfc_main$b, {
3656
3958
  label: unref(getOptionLabel)(option)
3657
3959
  }, null, 8, ["label"]),
3658
3960
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getOptionGrouped)(
3659
3961
  option
3660
3962
  ), (item, i) => {
3661
- return openBlock(), createBlock(_sfc_main$9, mergeProps({
3963
+ return openBlock(), createBlock(_sfc_main$c, mergeProps({
3662
3964
  disabled: unref(getOptionDisabled)(item),
3663
3965
  selected: getOptionSelected(item),
3664
3966
  unselectable: _ctx.unselectable,
@@ -3683,7 +3985,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3683
3985
  _: 2
3684
3986
  }, 1040, ["onClickPassive"]);
3685
3987
  }), 128))
3686
- ], 64)) : (openBlock(), createBlock(_sfc_main$9, mergeProps({ key: 1 }, {
3988
+ ], 64)) : (openBlock(), createBlock(_sfc_main$c, mergeProps({ key: 1 }, {
3687
3989
  disabled: unref(getOptionDisabled)(option),
3688
3990
  selected: getOptionSelected(option),
3689
3991
  unselectable: _ctx.unselectable,
@@ -3707,7 +4009,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3707
4009
  _: 2
3708
4010
  }, 1040, ["onClickPassive"]))
3709
4011
  ], 64);
3710
- }), 128)) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$9, {
4012
+ }), 128)) : !_ctx.options.length ? (openBlock(), createBlock(_sfc_main$c, {
3711
4013
  key: 1,
3712
4014
  modifiers: "inert"
3713
4015
  }, {
@@ -3717,7 +4019,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3717
4019
  ])
3718
4020
  ]),
3719
4021
  _: 3
3720
- })) : (openBlock(), createBlock(_sfc_main$9, {
4022
+ })) : (openBlock(), createBlock(_sfc_main$c, {
3721
4023
  key: 2,
3722
4024
  modifiers: "inert"
3723
4025
  }, {
@@ -3733,12 +4035,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3733
4035
  renderSlot(_ctx.$slots, "dropdown::after", {}, () => {
3734
4036
  var _a;
3735
4037
  return [
3736
- ((_a = unref(dropdownEl)) == null ? void 0 : _a.customPosition) ? (openBlock(), createBlock(_sfc_main$g, {
4038
+ ((_a = unref(dropdownEl)) == null ? void 0 : _a.customPosition) ? (openBlock(), createBlock(_sfc_main$j, {
3737
4039
  key: 0,
3738
- label: "Close",
4040
+ label: unref(propsDefaults).closeLabel,
3739
4041
  modifiers: "secondary",
3740
4042
  onClick: _cache[1] || (_cache[1] = ($event) => unref(dropdownEl).hide())
3741
- })) : createCommentVNode("", true)
4043
+ }, null, 8, ["label"])) : createCommentVNode("", true)
3742
4044
  ];
3743
4045
  })
3744
4046
  ]),
@@ -3762,7 +4064,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3762
4064
  class: "vv-dropdown__search",
3763
4065
  placeholder: unref(propsDefaults).searchPlaceholder
3764
4066
  }, null, 8, _hoisted_3$3)), [
3765
- [vShow, unref(expanded)],
3766
4067
  [vModelText, unref(searchText)]
3767
4068
  ]) : createCommentVNode("", true)
3768
4069
  ]),
@@ -3803,13 +4104,25 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3803
4104
  key: "3"
3804
4105
  } : void 0
3805
4106
  ]), 1032, ["id"])
3806
- ], 10, _hoisted_1$5)) : (openBlock(), createBlock(_sfc_main$7, mergeProps({ key: 1 }, unref(selectProps), {
4107
+ ], 10, _hoisted_1$7)) : (openBlock(), createBlock(_sfc_main$a, mergeProps({ key: 1 }, unref(selectProps), {
3807
4108
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => emit("update:modelValue", $event))
3808
4109
  }), null, 16));
3809
4110
  };
3810
4111
  }
3811
4112
  });
3812
- const VvDialogEvents = ["open", "close", "update:modelValue"];
4113
+ const VvDialogEvents = [
4114
+ "open",
4115
+ "close",
4116
+ "update:modelValue",
4117
+ "before-enter",
4118
+ "after-leave",
4119
+ "enter",
4120
+ "after-enter",
4121
+ "enter-cancelled",
4122
+ "before-leave",
4123
+ "leave",
4124
+ "leave-cancelled"
4125
+ ];
3813
4126
  const VvDialogProps = {
3814
4127
  ...IdProps,
3815
4128
  /**
@@ -3836,35 +4149,36 @@ const VvDialogProps = {
3836
4149
  */
3837
4150
  keepOpen: { type: Boolean, default: false }
3838
4151
  };
3839
- const _hoisted_1$4 = {
4152
+ const _hoisted_1$6 = ["onCancel"];
4153
+ const _hoisted_2$4 = {
3840
4154
  key: 0,
3841
4155
  class: "vv-dialog__header"
3842
4156
  };
3843
- const _hoisted_2$4 = { class: "vv-dialog__content" };
3844
- const _hoisted_3$2 = {
4157
+ const _hoisted_3$2 = { class: "vv-dialog__content" };
4158
+ const _hoisted_4$2 = {
3845
4159
  key: 1,
3846
4160
  class: "vv-dialog__footer"
3847
4161
  };
3848
4162
  const __default__$5 = {
3849
4163
  name: "VvDialog"
3850
4164
  };
3851
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4165
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
3852
4166
  ...__default__$5,
3853
4167
  props: VvDialogProps,
3854
4168
  emits: VvDialogEvents,
3855
4169
  setup(__props, { expose: __expose, emit }) {
3856
4170
  const props = __props;
3857
4171
  const dialogEl = ref();
4172
+ const modelValue = useVModel(props, "modelValue", emit);
3858
4173
  const localModelValue = ref(false);
3859
- const modelValue = computed({
3860
- get() {
3861
- return props.modelValue ?? localModelValue.value;
3862
- },
3863
- set(value) {
3864
- if (props.modelValue === void 0) {
3865
- localModelValue.value = value;
4174
+ const isOpened = computed({
4175
+ get: () => modelValue.value ?? localModelValue.value,
4176
+ set: (newValue) => {
4177
+ if (modelValue.value === void 0) {
4178
+ localModelValue.value = newValue;
4179
+ return;
3866
4180
  }
3867
- emit("update:modelValue", value);
4181
+ modelValue.value = newValue;
3868
4182
  }
3869
4183
  });
3870
4184
  const modalWrapper = ref(null);
@@ -3886,45 +4200,65 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3886
4200
  var _a;
3887
4201
  (_a = dialogEl.value) == null ? void 0 : _a.showModal();
3888
4202
  emit("open");
4203
+ emit("before-enter");
3889
4204
  },
3890
4205
  "after-leave": () => {
3891
4206
  var _a;
3892
4207
  (_a = dialogEl.value) == null ? void 0 : _a.close();
3893
4208
  emit("close");
4209
+ emit("after-leave");
4210
+ },
4211
+ enter: () => {
4212
+ emit("enter");
4213
+ },
4214
+ "after-enter": () => {
4215
+ emit("after-enter");
4216
+ },
4217
+ "enter-cancelled": () => {
4218
+ emit("enter-cancelled");
4219
+ },
4220
+ "before-leave": () => {
4221
+ emit("before-leave");
4222
+ },
4223
+ leave: () => {
4224
+ emit("leave");
4225
+ },
4226
+ "leave-cancelled": () => {
4227
+ emit("leave-cancelled");
3894
4228
  }
3895
4229
  };
3896
4230
  onClickOutside(modalWrapper, () => {
3897
4231
  if (!props.keepOpen) {
3898
- modelValue.value = false;
4232
+ close();
3899
4233
  }
3900
4234
  });
3901
4235
  function close() {
3902
- modelValue.value = false;
4236
+ isOpened.value = false;
3903
4237
  }
3904
4238
  function open() {
3905
- modelValue.value = true;
4239
+ isOpened.value = true;
3906
4240
  }
3907
4241
  __expose({ close, open });
3908
- onKeyStroke("Escape", (e) => {
3909
- if (modelValue.value) {
3910
- e.preventDefault();
4242
+ const onCancel = () => {
4243
+ if (!props.keepOpen) {
3911
4244
  close();
3912
4245
  }
3913
- });
4246
+ };
3914
4247
  return (_ctx, _cache) => {
3915
4248
  return openBlock(), createBlock(Transition, mergeProps({ name: unref(transitioName) }, toHandlers(dialogTransitionHandlers)), {
3916
4249
  default: withCtx(() => [
3917
4250
  withDirectives(createElementVNode("dialog", mergeProps(unref(dialogAttrs), {
3918
4251
  ref_key: "dialogEl",
3919
4252
  ref: dialogEl,
3920
- class: unref(dialogClass)
4253
+ class: unref(dialogClass),
4254
+ onCancel: withModifiers(onCancel, ["stop", "prevent"])
3921
4255
  }), [
3922
4256
  createElementVNode("article", {
3923
4257
  ref_key: "modalWrapper",
3924
4258
  ref: modalWrapper,
3925
4259
  class: "vv-dialog__wrapper"
3926
4260
  }, [
3927
- _ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_1$4, [
4261
+ _ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_2$4, [
3928
4262
  renderSlot(_ctx.$slots, "header", {}, () => [
3929
4263
  createTextVNode(toDisplayString(_ctx.title) + " ", 1),
3930
4264
  createElementVNode("button", {
@@ -3933,19 +4267,19 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3933
4267
  class: "vv-dialog__close",
3934
4268
  onClickPassive: close
3935
4269
  }, [
3936
- createVNode(_sfc_main$i, { name: "close" })
4270
+ createVNode(_sfc_main$n, { name: "close" })
3937
4271
  ], 32)
3938
4272
  ])
3939
4273
  ])) : createCommentVNode("", true),
3940
- createElementVNode("div", _hoisted_2$4, [
4274
+ createElementVNode("div", _hoisted_3$2, [
3941
4275
  renderSlot(_ctx.$slots, "default")
3942
4276
  ]),
3943
- _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_3$2, [
4277
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_4$2, [
3944
4278
  renderSlot(_ctx.$slots, "footer")
3945
4279
  ])) : createCommentVNode("", true)
3946
4280
  ], 512)
3947
- ], 16), [
3948
- [vShow, unref(modelValue)]
4281
+ ], 16, _hoisted_1$6), [
4282
+ [vShow, unref(isOpened)]
3949
4283
  ])
3950
4284
  ]),
3951
4285
  _: 3
@@ -4145,7 +4479,7 @@ const VvInputTextProps = {
4145
4479
  };
4146
4480
  const VvInputPasswordAction = defineComponent({
4147
4481
  components: {
4148
- VvIcon: _sfc_main$i
4482
+ VvIcon: _sfc_main$n
4149
4483
  },
4150
4484
  props: {
4151
4485
  disabled: {
@@ -4189,7 +4523,7 @@ const VvInputPasswordAction = defineComponent({
4189
4523
  };
4190
4524
  },
4191
4525
  render() {
4192
- const icon = h(_sfc_main$i, {
4526
+ const icon = h(_sfc_main$n, {
4193
4527
  name: this.activeIcon,
4194
4528
  class: "vv-input-text__icon"
4195
4529
  });
@@ -4208,7 +4542,7 @@ const VvInputPasswordAction = defineComponent({
4208
4542
  });
4209
4543
  const VvInputStepAction = defineComponent({
4210
4544
  components: {
4211
- VvIcon: _sfc_main$i
4545
+ VvIcon: _sfc_main$n
4212
4546
  },
4213
4547
  props: {
4214
4548
  disabled: {
@@ -4253,7 +4587,7 @@ const VvInputStepAction = defineComponent({
4253
4587
  });
4254
4588
  const VvInputClearAction = defineComponent({
4255
4589
  components: {
4256
- VvIcon: _sfc_main$i
4590
+ VvIcon: _sfc_main$n
4257
4591
  },
4258
4592
  props: {
4259
4593
  disabled: {
@@ -4282,7 +4616,7 @@ const VvInputClearAction = defineComponent({
4282
4616
  };
4283
4617
  },
4284
4618
  render() {
4285
- const icon = h(_sfc_main$i, {
4619
+ const icon = h(_sfc_main$n, {
4286
4620
  name: this.icon,
4287
4621
  class: "vv-input-text__icon"
4288
4622
  });
@@ -4303,7 +4637,7 @@ function VvInputTextActionsFactory(type, parentProps) {
4303
4637
  return {
4304
4638
  name: "VvInputTextActions",
4305
4639
  components: {
4306
- VvIcon: _sfc_main$i,
4640
+ VvIcon: _sfc_main$n,
4307
4641
  VvInputPasswordAction,
4308
4642
  VvInputStepAction,
4309
4643
  VvInputClearAction
@@ -4430,7 +4764,7 @@ function useTextCount(text, options) {
4430
4764
  formatted
4431
4765
  };
4432
4766
  }
4433
- const _hoisted_1$3 = ["for"];
4767
+ const _hoisted_1$5 = ["for"];
4434
4768
  const _hoisted_2$3 = { class: "vv-input-text__wrapper" };
4435
4769
  const _hoisted_3$1 = {
4436
4770
  key: 0,
@@ -4453,13 +4787,18 @@ const _hoisted_8 = {
4453
4787
  const __default__$4 = {
4454
4788
  name: "VvInputText"
4455
4789
  };
4456
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4790
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4457
4791
  ...__default__$4,
4458
4792
  props: VvInputTextProps,
4459
4793
  emits: VvInputTextEvents,
4460
4794
  setup(__props, { expose: __expose, emit }) {
4461
4795
  const props = __props;
4462
4796
  const slots = useSlots();
4797
+ const propsDefaults = useDefaults(
4798
+ "VvInputText",
4799
+ VvInputTextProps,
4800
+ props
4801
+ );
4463
4802
  const inputEl = ref();
4464
4803
  const innerEl = ref();
4465
4804
  __expose({ $inner: innerEl });
@@ -4646,7 +4985,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4646
4985
  hasHintLabelOrSlot,
4647
4986
  hasInvalidLabelOrSlot,
4648
4987
  hintSlotScope
4649
- } = HintSlotFactory(props, slots);
4988
+ } = HintSlotFactory(propsDefaults, slots);
4650
4989
  const PasswordInputActions = VvInputTextActionsFactory(
4651
4990
  INPUT_TYPES.PASSWORD,
4652
4991
  props
@@ -4705,7 +5044,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4705
5044
  key: 0,
4706
5045
  for: unref(hasId),
4707
5046
  class: "vv-input-text__label"
4708
- }, toDisplayString(unref(label)), 9, _hoisted_1$3)) : createCommentVNode("", true),
5047
+ }, toDisplayString(unref(label)), 9, _hoisted_1$5)) : createCommentVNode("", true),
4709
5048
  createElementVNode("div", _hoisted_2$3, [
4710
5049
  _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
4711
5050
  renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
@@ -4716,7 +5055,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4716
5055
  class: "vv-input-text__inner",
4717
5056
  onClick: withModifiers(onClickInner, ["stop"])
4718
5057
  }, [
4719
- unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
5058
+ unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
4720
5059
  key: 0,
4721
5060
  class: "vv-input-text__icon"
4722
5061
  }, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
@@ -4737,7 +5076,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4737
5076
  ])
4738
5077
  ])) : createCommentVNode("", true)
4739
5078
  ], 8, _hoisted_4$1),
4740
- unref(hasIconAfter) || unref(defaultAfterIcon) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
5079
+ unref(hasIconAfter) || unref(defaultAfterIcon) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
4741
5080
  key: 1,
4742
5081
  class: "vv-input-text__icon vv-input-text__icon-after"
4743
5082
  }, unref(hasIconAfter) ? unref(hasIcon) : unref(defaultAfterIcon)), null, 16)) : unref(isPassword) && !_ctx.hideActions && unref(isClickable) ? (openBlock(), createBlock(unref(PasswordInputActions), {
@@ -4797,6 +5136,79 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4797
5136
  };
4798
5137
  }
4799
5138
  });
5139
+ const VvNavProps = {
5140
+ ...ModifiersProps,
5141
+ items: {
5142
+ type: Array,
5143
+ required: true,
5144
+ default: () => []
5145
+ }
5146
+ };
5147
+ const VvNavEvents = ["click"];
5148
+ const _hoisted_1$4 = {
5149
+ class: "vv-nav__menu",
5150
+ role: "menu",
5151
+ "aria-busy": "true"
5152
+ };
5153
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
5154
+ __name: "VvNav",
5155
+ props: VvNavProps,
5156
+ emits: VvNavEvents,
5157
+ setup(__props, { emit }) {
5158
+ const props = __props;
5159
+ const { modifiers, items } = toRefs(props);
5160
+ const activeItem = ref(null);
5161
+ const bemCssClasses = useModifiers("vv-nav", modifiers);
5162
+ const localItems = computed(() => {
5163
+ return items.value.map((item, index) => {
5164
+ return {
5165
+ ...item,
5166
+ id: item.id || `nav-item_${index}`
5167
+ };
5168
+ });
5169
+ });
5170
+ function onClick(item) {
5171
+ if (!item.disabled) {
5172
+ emit("click", item);
5173
+ activeItem.value = item.id;
5174
+ }
5175
+ }
5176
+ return (_ctx, _cache) => {
5177
+ return openBlock(), createElementBlock("nav", {
5178
+ class: normalizeClass(unref(bemCssClasses))
5179
+ }, [
5180
+ createElementVNode("ul", _hoisted_1$4, [
5181
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(localItems), (navItem) => {
5182
+ return openBlock(), createElementBlock("li", {
5183
+ key: navItem.id,
5184
+ class: "vv-nav__item",
5185
+ role: "presentation"
5186
+ }, [
5187
+ createVNode(_sfc_main$o, mergeProps({
5188
+ disabled: navItem.disabled,
5189
+ to: navItem.to,
5190
+ href: navItem.href,
5191
+ tabindex: 0
5192
+ }, {
5193
+ class: [{
5194
+ current: unref(activeItem) == navItem.id,
5195
+ disabled: navItem.disabled
5196
+ }, "vv-nav__item-label"]
5197
+ }, toHandlers(navItem.on), {
5198
+ onClick: ($event) => onClick(navItem)
5199
+ }), {
5200
+ default: withCtx(() => [
5201
+ createTextVNode(toDisplayString(navItem.title), 1)
5202
+ ]),
5203
+ _: 2
5204
+ }, 1040, ["class", "onClick"])
5205
+ ]);
5206
+ }), 128))
5207
+ ])
5208
+ ], 2);
5209
+ };
5210
+ }
5211
+ });
4800
5212
  const VvProgressProps = {
4801
5213
  ...ModifiersProps,
4802
5214
  /**
@@ -4830,7 +5242,7 @@ const VvProgressProps = {
4830
5242
  const __default__$3 = {
4831
5243
  name: "VvProgress"
4832
5244
  };
4833
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5245
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4834
5246
  ...__default__$3,
4835
5247
  props: VvProgressProps,
4836
5248
  setup(__props) {
@@ -4886,18 +5298,23 @@ function useGroupProps(props, emit) {
4886
5298
  disabled
4887
5299
  };
4888
5300
  }
4889
- const _hoisted_1$2 = ["for"];
5301
+ const _hoisted_1$3 = ["for"];
4890
5302
  const _hoisted_2$2 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid", "aria-describedby", "aria-errormessage"];
4891
5303
  const __default__$2 = {
4892
5304
  name: "VvRadio"
4893
5305
  };
4894
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
5306
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4895
5307
  ...__default__$2,
4896
5308
  props: VvRadioProps,
4897
5309
  emits: VvRadioEvents,
4898
5310
  setup(__props, { emit }) {
4899
5311
  const props = __props;
4900
5312
  const slots = useSlots();
5313
+ const propsDefaults = useDefaults(
5314
+ "VvRadio",
5315
+ VvRadioProps,
5316
+ props
5317
+ );
4901
5318
  const { id, disabled, readonly, modelValue, valid, invalid } = useGroupProps(props, emit);
4902
5319
  const hasId = useUniqueId(id);
4903
5320
  const hasHintId = computed(() => `${hasId.value}-hint`);
@@ -4948,7 +5365,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
4948
5365
  hasHintLabelOrSlot,
4949
5366
  hasInvalidLabelOrSlot,
4950
5367
  hintSlotScope
4951
- } = HintSlotFactory(props, slots);
5368
+ } = HintSlotFactory(propsDefaults, slots);
4952
5369
  return (_ctx, _cache) => {
4953
5370
  return openBlock(), createElementBlock("label", {
4954
5371
  class: normalizeClass(unref(bemCssClasses)),
@@ -5007,24 +5424,29 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
5007
5424
  key: "3"
5008
5425
  } : void 0
5009
5426
  ]), 1032, ["id"])
5010
- ], 10, _hoisted_1$2);
5427
+ ], 10, _hoisted_1$3);
5011
5428
  };
5012
5429
  }
5013
5430
  });
5014
5431
  const VvRadioGroupProps = CheckboxRadioGroupProps;
5015
5432
  const VvRadioGroupEvents = ["update:modelValue", "change"];
5016
- const _hoisted_1$1 = ["textContent"];
5433
+ const _hoisted_1$2 = ["textContent"];
5017
5434
  const _hoisted_2$1 = { class: "vv-radio-group__wrapper" };
5018
5435
  const __default__$1 = {
5019
5436
  name: "VvRadioGroup"
5020
5437
  };
5021
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5438
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5022
5439
  ...__default__$1,
5023
5440
  props: VvRadioGroupProps,
5024
5441
  emits: VvRadioGroupEvents,
5025
5442
  setup(__props, { emit }) {
5026
5443
  const props = __props;
5027
5444
  const slots = useSlots();
5445
+ const propsDefaults = useDefaults(
5446
+ "VvRadioGroup",
5447
+ VvRadioGroupProps,
5448
+ props
5449
+ );
5028
5450
  const modelValue = useVModel(props, "modelValue", emit);
5029
5451
  const { disabled, readonly, vertical, valid, invalid, modifiers } = toRefs(props);
5030
5452
  useProvideGroupState({
@@ -5055,7 +5477,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5055
5477
  value: getOptionValue(option)
5056
5478
  };
5057
5479
  };
5058
- const { HintSlot, hintSlotScope } = HintSlotFactory(props, slots);
5480
+ const { HintSlot, hintSlotScope } = HintSlotFactory(propsDefaults, slots);
5059
5481
  return (_ctx, _cache) => {
5060
5482
  return openBlock(), createElementBlock("fieldset", {
5061
5483
  class: normalizeClass(unref(bemCssClasses))
@@ -5063,10 +5485,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5063
5485
  _ctx.label ? (openBlock(), createElementBlock("legend", {
5064
5486
  key: 0,
5065
5487
  textContent: toDisplayString(_ctx.label)
5066
- }, null, 8, _hoisted_1$1)) : createCommentVNode("", true),
5488
+ }, null, 8, _hoisted_1$2)) : createCommentVNode("", true),
5067
5489
  createElementVNode("div", _hoisted_2$1, [
5068
5490
  _ctx.options.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.options, (option, index) => {
5069
- return openBlock(), createBlock(_sfc_main$2, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
5491
+ return openBlock(), createBlock(_sfc_main$4, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
5070
5492
  }), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
5071
5493
  ]),
5072
5494
  createVNode(unref(HintSlot), { class: "vv-radio-group__hint" }, createSlots({ _: 2 }, [
@@ -5103,6 +5525,61 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5103
5525
  };
5104
5526
  }
5105
5527
  });
5528
+ const VvTabProps = {
5529
+ ...ModifiersProps,
5530
+ items: {
5531
+ type: Array,
5532
+ required: true,
5533
+ default: () => []
5534
+ }
5535
+ };
5536
+ const VvTabEvents = ["click"];
5537
+ const _hoisted_1$1 = ["id"];
5538
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
5539
+ __name: "VvTab",
5540
+ props: VvTabProps,
5541
+ emits: VvTabEvents,
5542
+ setup(__props, { emit }) {
5543
+ const props = __props;
5544
+ const { modifiers, items } = toRefs(props);
5545
+ const activeTab = ref(null);
5546
+ const bemCssClasses = useModifiers("vv-tab", modifiers);
5547
+ const localItems = computed(() => {
5548
+ return items.value.map((item, index) => {
5549
+ return {
5550
+ ...item,
5551
+ id: item.id || `tab-item_${index}`
5552
+ };
5553
+ });
5554
+ });
5555
+ function onClick(item) {
5556
+ if (!item.disabled) {
5557
+ emit("click", item);
5558
+ activeTab.value = item.id;
5559
+ }
5560
+ }
5561
+ return (_ctx, _cache) => {
5562
+ return openBlock(), createElementBlock("div", {
5563
+ class: normalizeClass(unref(bemCssClasses))
5564
+ }, [
5565
+ createVNode(_sfc_main$6, {
5566
+ items: unref(localItems),
5567
+ modifiers: "tabs full",
5568
+ onClick
5569
+ }, null, 8, ["items"]),
5570
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(localItems), (item) => {
5571
+ return openBlock(), createElementBlock("article", {
5572
+ id: item.id,
5573
+ key: item.id,
5574
+ class: normalizeClass([{ target: unref(activeTab) === item.id }, "vv-tab__panel"])
5575
+ }, [
5576
+ renderSlot(_ctx.$slots, `${item.id}`)
5577
+ ], 10, _hoisted_1$1);
5578
+ }), 128))
5579
+ ], 2);
5580
+ };
5581
+ }
5582
+ });
5106
5583
  const WRAP = {
5107
5584
  hard: "hard",
5108
5585
  soft: "soft"
@@ -5164,13 +5641,18 @@ const _hoisted_7 = {
5164
5641
  const __default__ = {
5165
5642
  name: "VvTextarea"
5166
5643
  };
5167
- const _sfc_main = /* @__PURE__ */ defineComponent({
5644
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5168
5645
  ...__default__,
5169
5646
  props: VvTextareaProps,
5170
5647
  emits: VvTextareaEvents,
5171
5648
  setup(__props, { emit }) {
5172
5649
  const props = __props;
5173
5650
  const slots = useSlots();
5651
+ const propsDefaults = useDefaults(
5652
+ "VvTextarea",
5653
+ VvTextareaProps,
5654
+ props
5655
+ );
5174
5656
  const textarea = ref();
5175
5657
  const {
5176
5658
  id,
@@ -5225,7 +5707,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
5225
5707
  hasHintLabelOrSlot,
5226
5708
  hasInvalidLabelOrSlot,
5227
5709
  hintSlotScope
5228
- } = HintSlotFactory(props, slots);
5710
+ } = HintSlotFactory(propsDefaults, slots);
5229
5711
  const bemCssClasses = useModifiers(
5230
5712
  "vv-textarea",
5231
5713
  modifiers,
@@ -5289,7 +5771,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
5289
5771
  renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
5290
5772
  ])) : createCommentVNode("", true),
5291
5773
  createElementVNode("div", _hoisted_4, [
5292
- unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
5774
+ unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
5293
5775
  key: 0,
5294
5776
  class: "vv-textarea__icon"
5295
5777
  }, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
@@ -5303,7 +5785,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
5303
5785
  }), null, 16, _hoisted_5), [
5304
5786
  [vModelText, unref(localModelValue)]
5305
5787
  ]),
5306
- unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
5788
+ unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
5307
5789
  key: 1,
5308
5790
  class: "vv-textarea__icon vv-textarea__icon-after"
5309
5791
  }, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
@@ -5354,24 +5836,69 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
5354
5836
  };
5355
5837
  }
5356
5838
  });
5839
+ const VvTooltipProps = {
5840
+ ...ModifiersProps,
5841
+ /**
5842
+ * Define the tooltip position
5843
+ * @default Side.bottom
5844
+ */
5845
+ position: {
5846
+ type: String,
5847
+ default: Side.bottom
5848
+ },
5849
+ value: {
5850
+ type: String
5851
+ }
5852
+ };
5853
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5854
+ __name: "VvTooltip",
5855
+ props: VvTooltipProps,
5856
+ setup(__props) {
5857
+ const props = __props;
5858
+ const { modifiers } = toRefs(props);
5859
+ const bemCssClasses = useModifiers(
5860
+ "vv-tooltip",
5861
+ modifiers,
5862
+ computed(() => ({
5863
+ [props.position]: true
5864
+ }))
5865
+ );
5866
+ return (_ctx, _cache) => {
5867
+ return openBlock(), createElementBlock("span", {
5868
+ class: normalizeClass(unref(bemCssClasses)),
5869
+ role: "tooltip",
5870
+ inert: ""
5871
+ }, [
5872
+ renderSlot(_ctx.$slots, "default", {}, () => [
5873
+ createTextVNode(toDisplayString(_ctx.value), 1)
5874
+ ])
5875
+ ], 2);
5876
+ };
5877
+ }
5878
+ });
5357
5879
  export {
5358
- _sfc_main$m as VvAccordion,
5359
- _sfc_main$l as VvAccordionGroup,
5360
- _sfc_main$k as VvBadge,
5361
- _sfc_main$j as VvBreadcrumb,
5362
- _sfc_main$g as VvButton,
5363
- _sfc_main$f as VvButtonGroup,
5364
- _sfc_main$e as VvCard,
5365
- _sfc_main$d as VvCheckbox,
5366
- _sfc_main$c as VvCheckboxGroup,
5367
- _sfc_main$6 as VvCombobox,
5368
- _sfc_main$5 as VvDialog,
5369
- _sfc_main$b as VvDropdown,
5370
- _sfc_main$i as VvIcon,
5371
- _sfc_main$4 as VvInputText,
5372
- _sfc_main$3 as VvProgress,
5373
- _sfc_main$2 as VvRadio,
5374
- _sfc_main$1 as VvRadioGroup,
5375
- _sfc_main$7 as VvSelect,
5376
- _sfc_main as VvTextarea
5880
+ _sfc_main$q as VvAccordion,
5881
+ _sfc_main$p as VvAccordionGroup,
5882
+ _sfc_main$o as VvAction,
5883
+ _sfc_main$m as VvAlert,
5884
+ _sfc_main$l as VvBadge,
5885
+ _sfc_main$k as VvBreadcrumb,
5886
+ _sfc_main$j as VvButton,
5887
+ _sfc_main$i as VvButtonGroup,
5888
+ _sfc_main$h as VvCard,
5889
+ _sfc_main$g as VvCheckbox,
5890
+ _sfc_main$f as VvCheckboxGroup,
5891
+ _sfc_main$9 as VvCombobox,
5892
+ _sfc_main$8 as VvDialog,
5893
+ _sfc_main$e as VvDropdown,
5894
+ _sfc_main$n as VvIcon,
5895
+ _sfc_main$7 as VvInputText,
5896
+ _sfc_main$6 as VvNav,
5897
+ _sfc_main$5 as VvProgress,
5898
+ _sfc_main$4 as VvRadio,
5899
+ _sfc_main$3 as VvRadioGroup,
5900
+ _sfc_main$a as VvSelect,
5901
+ _sfc_main$2 as VvTab,
5902
+ _sfc_main$1 as VvTextarea,
5903
+ _sfc_main as VvTooltip
5377
5904
  };