@volverjs/ui-vue 0.0.10-beta.1 → 0.0.10-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 (176) hide show
  1. package/README.md +64 -1
  2. package/auto-imports.d.ts +1 -1
  3. package/bin/icons.cjs +1 -1
  4. package/bin/icons.js +34 -19
  5. package/dist/components/VvAccordion/VvAccordion.es.js +33 -4
  6. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  7. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -4
  8. package/dist/components/VvAccordion/index.d.ts +1 -1
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +75 -27
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +5 -5
  12. package/dist/components/VvAction/VvAction.es.js +26 -4
  13. package/dist/components/VvAction/VvAction.umd.js +1 -1
  14. package/dist/components/VvAction/VvAction.vue.d.ts +17 -4
  15. package/dist/components/VvAction/index.d.ts +5 -0
  16. package/dist/components/VvAlert/VvAlert.es.js +96 -45
  17. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  18. package/dist/components/VvAlert/VvAlert.vue.d.ts +4 -4
  19. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +136 -66
  20. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  21. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +4 -4
  22. package/dist/components/VvAvatar/VvAvatar.es.js +22 -1
  23. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  24. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +79 -28
  25. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  26. package/dist/components/VvBadge/VvBadge.es.js +39 -8
  27. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  28. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +224 -41
  29. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  30. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +14 -3
  31. package/dist/components/VvBreadcrumb/index.d.ts +2 -9
  32. package/dist/components/VvButton/VvButton.es.js +67 -22
  33. package/dist/components/VvButton/VvButton.umd.js +1 -1
  34. package/dist/components/VvButton/VvButton.vue.d.ts +25 -9
  35. package/dist/components/VvButton/index.d.ts +5 -0
  36. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +33 -6
  37. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  38. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +6 -6
  39. package/dist/components/VvCard/VvCard.es.js +47 -16
  40. package/dist/components/VvCard/VvCard.umd.js +1 -1
  41. package/dist/components/VvCheckbox/VvCheckbox.es.js +32 -4
  42. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  43. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +8 -8
  44. package/dist/components/VvCheckbox/index.d.ts +1 -1
  45. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +101 -46
  46. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  47. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
  48. package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
  49. package/dist/components/VvCombobox/VvCombobox.es.js +625 -379
  50. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  51. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +112 -112
  52. package/dist/components/VvCombobox/index.d.ts +32 -32
  53. package/dist/components/VvDialog/VvDialog.es.js +65 -27
  54. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  55. package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
  56. package/dist/components/VvDropdown/VvDropdown.es.js +87 -46
  57. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  58. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +203 -189
  59. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +12 -0
  60. package/dist/components/VvDropdown/index.d.ts +32 -32
  61. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +46 -12
  62. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  63. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
  64. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +28 -1
  65. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  66. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +40 -8
  67. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  68. package/dist/components/VvIcon/VvIcon.es.js +1 -1
  69. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  70. package/dist/components/VvInputText/VvInputClearAction.d.ts +1 -1
  71. package/dist/components/VvInputText/VvInputText.es.js +149 -99
  72. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  73. package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
  74. package/dist/components/VvInputText/index.d.ts +8 -2
  75. package/dist/components/VvNav/VvNav.es.js +115 -63
  76. package/dist/components/VvNav/VvNav.umd.js +1 -1
  77. package/dist/components/VvNav/VvNav.vue.d.ts +31 -12
  78. package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
  79. package/dist/components/VvNav/index.d.ts +1 -12
  80. package/dist/components/VvNavItem/VvNavItem.es.js +413 -0
  81. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
  82. package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
  83. package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
  84. package/dist/components/VvProgress/VvProgress.es.js +33 -6
  85. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  86. package/dist/components/VvRadio/VvRadio.es.js +32 -4
  87. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  88. package/dist/components/VvRadio/VvRadio.vue.d.ts +8 -8
  89. package/dist/components/VvRadio/index.d.ts +1 -1
  90. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +101 -46
  91. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  92. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
  93. package/dist/components/VvRadioGroup/index.d.ts +1 -1
  94. package/dist/components/VvSelect/VvSelect.es.js +156 -96
  95. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  96. package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
  97. package/dist/components/VvSelect/index.d.ts +1 -1
  98. package/dist/components/VvTab/VvTab.es.js +214 -99
  99. package/dist/components/VvTab/VvTab.umd.js +1 -1
  100. package/dist/components/VvTab/VvTab.vue.d.ts +40 -11
  101. package/dist/components/VvTab/index.d.ts +9 -3
  102. package/dist/components/VvTextarea/VvTextarea.es.js +123 -77
  103. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  104. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +10 -10
  105. package/dist/components/VvTooltip/VvTooltip.es.js +40 -9
  106. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  107. package/dist/components/index.es.js +1583 -991
  108. package/dist/components/index.umd.js +1 -1
  109. package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
  110. package/dist/composables/useVolver.d.ts +1 -1
  111. package/dist/directives/index.d.ts +3 -5
  112. package/dist/directives/index.es.js +60 -23
  113. package/dist/directives/index.umd.js +1 -1
  114. package/dist/directives/v-tooltip.es.js +58 -18
  115. package/dist/directives/v-tooltip.umd.js +1 -1
  116. package/dist/icons.es.js +3 -3
  117. package/dist/icons.umd.js +1 -1
  118. package/dist/index.d.ts +3 -1
  119. package/dist/index.es.js +19 -16
  120. package/dist/index.umd.js +1 -1
  121. package/dist/props/index.d.ts +58 -34
  122. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +50 -15
  123. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +332 -83
  124. package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
  125. package/dist/stories/Tab/Tab.settings.d.ts +4 -37
  126. package/dist/types/alert.d.ts +13 -0
  127. package/dist/types/floating-ui.d.ts +6 -0
  128. package/dist/types/generic.d.ts +4 -0
  129. package/dist/types/group.d.ts +37 -0
  130. package/dist/types/index.d.ts +5 -0
  131. package/dist/types/nav.d.ts +17 -0
  132. package/package.json +60 -51
  133. package/src/Volver.ts +22 -16
  134. package/src/assets/icons/detailed.json +1 -1
  135. package/src/assets/icons/normal.json +1 -1
  136. package/src/assets/icons/simple.json +1 -1
  137. package/src/components/VvAccordion/VvAccordion.vue +2 -2
  138. package/src/components/VvAction/VvAction.vue +5 -2
  139. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
  140. package/src/components/VvBreadcrumb/index.ts +2 -8
  141. package/src/components/VvCombobox/VvCombobox.vue +19 -8
  142. package/src/components/VvCombobox/index.ts +4 -0
  143. package/src/components/VvInputText/VvInputText.vue +2 -2
  144. package/src/components/VvNav/VvNav.vue +30 -50
  145. package/src/components/VvNav/VvNavItem.vue +18 -0
  146. package/src/components/VvNav/VvNavSeparator.vue +11 -0
  147. package/src/components/VvNav/index.ts +2 -15
  148. package/src/components/VvTab/VvTab.vue +63 -35
  149. package/src/components/VvTab/index.ts +10 -4
  150. package/src/components/VvTextarea/VvTextarea.vue +1 -1
  151. package/src/composables/useUniqueId.ts +2 -2
  152. package/src/directives/index.ts +1 -4
  153. package/src/directives/v-tooltip.ts +19 -10
  154. package/src/index.ts +3 -1
  155. package/src/props/index.ts +27 -3
  156. package/src/stories/Button/ButtonModifiers.stories.ts +4 -14
  157. package/src/stories/Combobox/Combobox.settings.ts +8 -0
  158. package/src/stories/Nav/Nav.settings.ts +3 -4
  159. package/src/stories/Nav/Nav.test.ts +4 -15
  160. package/src/stories/Tab/Tab.settings.ts +9 -9
  161. package/src/stories/Tab/Tab.stories.ts +2 -2
  162. package/src/stories/Tab/Tab.test.ts +6 -14
  163. package/src/stories/argTypes.ts +1 -1
  164. package/src/types/generic.ts +6 -0
  165. package/src/types/index.ts +5 -0
  166. package/src/types/nav.ts +19 -0
  167. package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
  168. package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
  169. package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
  170. package/src/components/VvNav/VvNavItemTitle.vue +0 -11
  171. package/src/components/VvNav/VvNavSeparator.ts +0 -8
  172. package/src/types/generic.d.ts +0 -6
  173. /package/dist/components/VvNav/{VvNavSeparator.d.ts → VvNavSeparator.vue.d.ts} +0 -0
  174. /package/src/types/{alert.d.ts → alert.ts} +0 -0
  175. /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
  176. /package/src/types/{group.d.ts → group.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { unref, computed, isRef, defineComponent, h, inject, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, useSlots, createElementBlock, normalizeClass, toDisplayString, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, withDirectives, vModelText, createTextVNode, createVNode, createSlots, withCtx } from "vue";
2
2
  import { iconExists, Icon, addIcon } from "@iconify/vue";
3
- import { nanoid } from "nanoid";
3
+ import { uid } from "uid";
4
4
  import { useFocus, useElementVisibility } from "@vueuse/core";
5
5
  function isEmpty(value) {
6
6
  return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
@@ -254,6 +254,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
254
254
  ButtonType2["reset"] = "reset";
255
255
  return ButtonType2;
256
256
  })(ButtonType || {});
257
+ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
258
+ ActionTag2["nuxtLink"] = "nuxt-link";
259
+ ActionTag2["routerLink"] = "router-link";
260
+ ActionTag2["a"] = "a";
261
+ ActionTag2["button"] = "button";
262
+ return ActionTag2;
263
+ })(ActionTag || {});
257
264
  var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
258
265
  AnchorTarget2["_blank"] = "_blank";
259
266
  AnchorTarget2["_self"] = "_self";
@@ -380,7 +387,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
380
387
  color: _ctx.color,
381
388
  onLoad: _ctx.onLoad,
382
389
  icon: unref(icon)
383
- }), null, 16, ["class"])) : createCommentVNode("", true);
390
+ }), null, 16, ["class"])) : createCommentVNode("v-if", true);
384
391
  };
385
392
  }
386
393
  });
@@ -456,6 +463,12 @@ const ActiveProps = {
456
463
  */
457
464
  active: Boolean
458
465
  };
466
+ const CurrentProps = {
467
+ /**
468
+ * Whether the item is current
469
+ */
470
+ current: Boolean
471
+ };
459
472
  const PressedProps = {
460
473
  /**
461
474
  * Whether the item is pressed
@@ -700,6 +713,7 @@ const InputTextareaProps = {
700
713
  ...LabelProps,
701
714
  ...PressedProps,
702
715
  ...ActiveProps,
716
+ ...CurrentProps,
703
717
  ...LinkProps,
704
718
  /**
705
719
  * Button type
@@ -715,6 +729,13 @@ const InputTextareaProps = {
715
729
  ariaLabel: {
716
730
  type: String,
717
731
  default: void 0
732
+ },
733
+ /**
734
+ * Default tag for the action
735
+ */
736
+ defaultTag: {
737
+ type: String,
738
+ default: ActionTag.button
718
739
  }
719
740
  });
720
741
  const WRAP = {
@@ -812,7 +833,7 @@ function useDefaults(componentName, propsDefinition, props) {
812
833
  }, {});
813
834
  });
814
835
  }
815
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
836
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
816
837
  function useDebouncedInput(modelValue, emit, ms = 0, {
817
838
  getter = (value) => value,
818
839
  setter = (value) => value
@@ -1013,7 +1034,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1013
1034
  "icon-after": hasIconAfter.value,
1014
1035
  floating: props.floating && !isEmpty(props.label),
1015
1036
  dirty: isDirty.value,
1016
- focused: focused.value,
1037
+ focus: focused.value,
1017
1038
  resizable: props.resizable
1018
1039
  }))
1019
1040
  );
@@ -1050,81 +1071,106 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1050
1071
  localModelValue.value = void 0;
1051
1072
  };
1052
1073
  return (_ctx, _cache) => {
1053
- return openBlock(), createElementBlock("div", {
1054
- class: normalizeClass(unref(bemCssClasses))
1055
- }, [
1056
- unref(label) ? (openBlock(), createElementBlock("label", {
1057
- key: 0,
1058
- for: unref(hasId),
1059
- class: "vv-textarea__label"
1060
- }, toDisplayString(unref(label)), 9, _hoisted_1)) : createCommentVNode("", true),
1061
- createElementVNode("div", _hoisted_2, [
1062
- _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3, [
1063
- renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
1064
- ])) : createCommentVNode("", true),
1065
- createElementVNode("div", _hoisted_4, [
1066
- unref(hasIconBefore) ? (openBlock(), createBlock(_sfc_main$1, mergeProps({
1067
- key: 0,
1068
- class: "vv-textarea__icon"
1069
- }, unref(hasIcon)), null, 16)) : createCommentVNode("", true),
1070
- withDirectives(createElementVNode("textarea", mergeProps({
1071
- id: unref(hasId),
1072
- ref_key: "textarea",
1073
- ref: textarea,
1074
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(localModelValue) ? localModelValue.value = $event : null)
1075
- }, unref(hasAttrs), {
1076
- onKeyup: _cache[1] || (_cache[1] = ($event) => emit("keyup", $event))
1077
- }), null, 16, _hoisted_5), [
1078
- [vModelText, unref(localModelValue)]
1074
+ return openBlock(), createElementBlock(
1075
+ "div",
1076
+ {
1077
+ class: normalizeClass(unref(bemCssClasses))
1078
+ },
1079
+ [
1080
+ unref(label) ? (openBlock(), createElementBlock("label", {
1081
+ key: 0,
1082
+ for: unref(hasId),
1083
+ class: "vv-textarea__label"
1084
+ }, toDisplayString(unref(label)), 9, _hoisted_1)) : createCommentVNode("v-if", true),
1085
+ createElementVNode("div", _hoisted_2, [
1086
+ _ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3, [
1087
+ renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
1088
+ ])) : createCommentVNode("v-if", true),
1089
+ createElementVNode("div", _hoisted_4, [
1090
+ unref(hasIconBefore) ? (openBlock(), createBlock(
1091
+ _sfc_main$1,
1092
+ mergeProps({
1093
+ key: 0,
1094
+ class: "vv-textarea__icon"
1095
+ }, unref(hasIcon)),
1096
+ null,
1097
+ 16
1098
+ /* FULL_PROPS */
1099
+ )) : createCommentVNode("v-if", true),
1100
+ withDirectives(createElementVNode("textarea", mergeProps({
1101
+ id: unref(hasId),
1102
+ ref_key: "textarea",
1103
+ ref: textarea,
1104
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(localModelValue) ? localModelValue.value = $event : null)
1105
+ }, unref(hasAttrs), {
1106
+ onKeyup: _cache[1] || (_cache[1] = ($event) => emit("keyup", $event))
1107
+ }), null, 16, _hoisted_5), [
1108
+ [vModelText, unref(localModelValue)]
1109
+ ]),
1110
+ unref(hasIconAfter) ? (openBlock(), createBlock(
1111
+ _sfc_main$1,
1112
+ mergeProps({
1113
+ key: 1,
1114
+ class: "vv-textarea__icon vv-textarea__icon-after"
1115
+ }, unref(hasIcon)),
1116
+ null,
1117
+ 16
1118
+ /* FULL_PROPS */
1119
+ )) : createCommentVNode("v-if", true)
1079
1120
  ]),
1080
- unref(hasIconAfter) ? (openBlock(), createBlock(_sfc_main$1, mergeProps({
1081
- key: 1,
1082
- class: "vv-textarea__icon vv-textarea__icon-after"
1083
- }, unref(hasIcon)), null, 16)) : createCommentVNode("", true)
1121
+ _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_6, [
1122
+ renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
1123
+ ])) : createCommentVNode("v-if", true),
1124
+ unref(count) ? (openBlock(), createElementBlock("span", _hoisted_7, [
1125
+ renderSlot(_ctx.$slots, "count", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
1126
+ createTextVNode(
1127
+ toDisplayString(unref(countFormatted)),
1128
+ 1
1129
+ /* TEXT */
1130
+ )
1131
+ ])
1132
+ ])) : createCommentVNode("v-if", true)
1084
1133
  ]),
1085
- _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_6, [
1086
- renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
1087
- ])) : createCommentVNode("", true),
1088
- unref(count) ? (openBlock(), createElementBlock("span", _hoisted_7, [
1089
- renderSlot(_ctx.$slots, "count", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
1090
- createTextVNode(toDisplayString(unref(countFormatted)), 1)
1091
- ])
1092
- ])) : createCommentVNode("", true)
1093
- ]),
1094
- createVNode(unref(HintSlot), {
1095
- id: unref(hasHintId),
1096
- class: "vv-textarea__hint"
1097
- }, createSlots({ _: 2 }, [
1098
- _ctx.$slots.hint ? {
1099
- name: "hint",
1100
- fn: withCtx(() => [
1101
- renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1102
- ]),
1103
- key: "0"
1104
- } : void 0,
1105
- _ctx.$slots.loading ? {
1106
- name: "loading",
1107
- fn: withCtx(() => [
1108
- renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1109
- ]),
1110
- key: "1"
1111
- } : void 0,
1112
- _ctx.$slots.valid ? {
1113
- name: "valid",
1114
- fn: withCtx(() => [
1115
- renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1116
- ]),
1117
- key: "2"
1118
- } : void 0,
1119
- _ctx.$slots.invalid ? {
1120
- name: "invalid",
1121
- fn: withCtx(() => [
1122
- renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1123
- ]),
1124
- key: "3"
1125
- } : void 0
1126
- ]), 1032, ["id"])
1127
- ], 2);
1134
+ createVNode(unref(HintSlot), {
1135
+ id: unref(hasHintId),
1136
+ class: "vv-textarea__hint"
1137
+ }, createSlots({
1138
+ _: 2
1139
+ /* DYNAMIC */
1140
+ }, [
1141
+ _ctx.$slots.hint ? {
1142
+ name: "hint",
1143
+ fn: withCtx(() => [
1144
+ renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1145
+ ]),
1146
+ key: "0"
1147
+ } : void 0,
1148
+ _ctx.$slots.loading ? {
1149
+ name: "loading",
1150
+ fn: withCtx(() => [
1151
+ renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1152
+ ]),
1153
+ key: "1"
1154
+ } : void 0,
1155
+ _ctx.$slots.valid ? {
1156
+ name: "valid",
1157
+ fn: withCtx(() => [
1158
+ renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1159
+ ]),
1160
+ key: "2"
1161
+ } : void 0,
1162
+ _ctx.$slots.invalid ? {
1163
+ name: "invalid",
1164
+ fn: withCtx(() => [
1165
+ renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
1166
+ ]),
1167
+ key: "3"
1168
+ } : void 0
1169
+ ]), 1032, ["id"])
1170
+ ],
1171
+ 2
1172
+ /* CLASS */
1173
+ );
1128
1174
  };
1129
1175
  }
1130
1176
  });
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("nanoid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTextarea=t(e.vue,e.vue$1,e.nanoid,e.core)}(this,(function(e,t,l,o){"use strict";function a(t){return null==(l=e.unref(t))||""===l||Array.isArray(l)&&0===l.length||!(l instanceof Date)&&"object"==typeof l&&0===Object.keys(l).length;var l}function n(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const i={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),u=(e=>(e.before="before",e.after="after",e))(u||{}),d=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(d||{});const s=Symbol.for("volver");function v(){return e.inject(s)}function c(t,l,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const f=e.defineComponent({name:"VvIcon",props:i,setup(l){const o=l,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=v(),{modifiers:r}=e.toRefs(o),u=c("vv-icon",r),d=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),s=e.computed((()=>{const e=o.name??"",l=`@${d.value}:${o.prefix}:${e}`;if(t.iconExists(l))return l;const a=null==i?void 0:i.iconsCollections.find((l=>{const o=`@${d.value}:${l.prefix}:${e}`;return t.iconExists(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function f(e){const l=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),a=(null==l?void 0:l.innerHTML.trim())||"";l&&a&&t.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return i&&o.src&&!t.iconExists(`@${d.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then((e=>{e&&(f(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&f(o.svg),(l,o)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:l.inline,width:l.width,height:l.height,horizontalFlip:l.horizontalFlip,verticalFlip:l.verticalFlip,flip:l.flip,rotate:e.unref(a),color:l.color,onLoad:l.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("",!0)}}),p={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},h={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},g={disabled:Boolean},b=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},S={modifiers:[String,Array]},B={hintLabel:{type:String,default:""}},L={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},x={debounce:[Number,String]},$={icon:{type:[String,Object]},iconPosition:{type:String,default:u.before,validation:e=>Object.values(u).includes(e)}},w={tabindex:{type:[String,Number],default:0}},k={floating:Boolean},V={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const N={...{...V,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...w,...g,...y,...p,...m,...B,...h,...S,...L,...x,...$,...k,...b,minlength:[String,Number],maxlength:[String,Number],placeholder:String,required:Boolean};d.button;const O={...N,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:"soft"},spellcheck:{type:[Boolean,String],default:"default"},resizable:Boolean};const P=["for"],_={class:"vv-textarea__wrapper"},I={key:0,class:"vv-textarea__input-before"},C={class:"vv-textarea__inner"},E=["id"],z={key:1,class:"vv-textarea__input-after"},A={key:2,class:"vv-textarea__limit"};return e.defineComponent({name:"VvTextarea",props:O,emits:["update:modelValue","focus","blur","keyup"],setup(t,{emit:i}){const d=t,s=e.useSlots(),p=function(t,l,o){const a=v(),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];a.length&&a[0]===n&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===n&&(l[o]=e[o]),"object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}("VvTextarea",O,d),m=e.ref(),{id:h,icon:g,iconPosition:b,label:y,modelValue:S,count:B,valid:L,invalid:x,loading:$,modifiers:w,debounce:k,minlength:V,maxlength:N}=e.toRefs(d),j=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(h),R=e.computed((()=>`${j.value}-hint`)),q=e.computed((()=>d.floating&&a(d.placeholder)?" ":d.placeholder)),T=function(t,l,o=0,{getter:a=(e=>e),setter:n=(e=>e)}={}){let i;return"string"==typeof o&&(o=parseInt(o)),e.computed({get:()=>a(null==t?void 0:t.value),set:e=>{i&&clearTimeout(i),i=setTimeout((()=>{l("update:modelValue",n(e))}),o)}})}(S,i,null==k?void 0:k.value),{hasIcon:F,hasIconBefore:D,hasIconAfter:H}=function(t,l){const o=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===u.before))),a=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===u.after))),n=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===r.left))),i=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===r.right))),d=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===r.top))),s=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===r.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),hasIconLeft:n,hasIconRight:i,hasIconTop:d,hasIconBottom:s,hasIconBefore:o,hasIconAfter:a}}(g,b),{focused:M}=function(t,l){const{focused:a}=o.useFocus(t);return e.watch(a,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:a}}(m,i),J=o.useElementVisibility(m);e.watch(J,(e=>{e&&d.autofocus&&(M.value=!0)}));const{formatted:K}=function(t,l){const o=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==l?void 0:l.lowerLimit)&&o.value<(null==l?void 0:l.lowerLimit)?o.value-l.lowerLimit:void 0!==(null==l?void 0:l.upperLimit)&&o.value<(null==l?void 0:l.upperLimit)?l.upperLimit-o.value:0)),n=e.computed((()=>{if(!1===(null==l?void 0:l.mode))return"";if("limit"===(null==l?void 0:l.mode)&&(null==l?void 0:l.upperLimit))return`${o.value} / ${l.lowerLimit?`${l.lowerLimit}-`:""}${l.upperLimit}`;if("countdown"===(null==l?void 0:l.mode)){if(0===a.value)return;return a}return o.value}));return{length:o,gap:a,formatted:n}}(T,{mode:null==B?void 0:B.value,upperLimit:Number(null==N?void 0:N.value),lowerLimit:Number(null==V?void 0:V.value)}),U=e.computed((()=>!d.disabled&&!d.readonly)),G=e.computed((()=>U.value?d.tabindex:-1)),Q=e.computed((()=>!a(S))),W=e.computed((()=>!0===d.invalid||!0!==d.valid&&void 0)),{HintSlot:X,hasHintLabelOrSlot:Y,hasInvalidLabelOrSlot:Z,hintSlotScope:ee}=function(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>n(o.value.invalidLabel))),i=e.computed((()=>n(o.value.validLabel))),r=e.computed((()=>o.value.loadingLabel)),u=e.computed((()=>o.value.hintLabel)),d=e.computed((()=>Boolean(o.value.loading&&(l.loading||r.value)))),s=e.computed((()=>!d.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),v=e.computed((()=>!d.value&&!s.value&&Boolean(o.value.valid&&(l.valid||i.value)))),c=e.computed((()=>!d.value&&!s.value&&!v.value&&Boolean(l.hint||u.value))),f=e.computed((()=>s.value||v.value||d.value||c.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:a,validLabel:i,loadingLabel:r,hintLabel:u,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hasHintLabelOrSlot:c}),render(){var t,l,o,a,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:s,hasHintLabelOrSlot:c,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hintSlotScope:p,HintSlot:m}}(p,s),te=c("vv-textarea",w,e.computed((()=>({valid:L.value,invalid:x.value,loading:$.value,disabled:d.disabled,readonly:d.readonly,"icon-before":D.value,"icon-after":H.value,floating:d.floating&&!a(d.label),dirty:Q.value,focused:M.value,resizable:d.resizable})))),le=e.computed((()=>({name:d.name,placeholder:q.value,tabindex:G.value,disabled:d.disabled,readonly:d.readonly,required:d.required,autocomplete:d.autocomplete,minlength:d.minlength,maxlength:d.maxlength,cols:d.cols,rows:d.rows,wrap:d.wrap,spellcheck:d.spellcheck,"aria-invalid":W.value,"aria-describedby":Y.value?R.value:void 0,"aria-errormessage":Z.value?R.value:void 0}))),oe=e.computed((()=>({valid:d.valid,invalid:d.invalid,modelValue:d.modelValue,hintLabel:d.hintLabel,maxlength:d.maxlength,minlength:d.minlength,clear:ae}))),ae=()=>{T.value=void 0};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(te))},[e.unref(y)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(j),class:"vv-textarea__label"},e.toDisplayString(e.unref(y)),9,P)):e.createCommentVNode("",!0),e.createElementVNode("div",_,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(oe))))])):e.createCommentVNode("",!0),e.createElementVNode("div",C,[e.unref(D)?(e.openBlock(),e.createBlock(f,e.mergeProps({key:0,class:"vv-textarea__icon"},e.unref(F)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(j),ref_key:"textarea",ref:m,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(T)?T.value=t:null)},e.unref(le),{onKeyup:l[1]||(l[1]=e=>i("keyup",e))}),null,16,E),[[e.vModelText,e.unref(T)]]),e.unref(H)?(e.openBlock(),e.createBlock(f,e.mergeProps({key:1,class:"vv-textarea__icon vv-textarea__icon-after"},e.unref(F)),null,16)):e.createCommentVNode("",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",z,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(oe))))])):e.createCommentVNode("",!0),e.unref(B)?(e.openBlock(),e.createElementBlock("span",A,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(oe))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(K)),1)]))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(X),{id:e.unref(R),class:"vv-textarea__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","uid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTextarea=t(e.vue,e.vue$1,e.uid,e.core)}(this,(function(e,t,l,o){"use strict";function a(t){return null==(l=e.unref(t))||""===l||Array.isArray(l)&&0===l.length||!(l instanceof Date)&&"object"==typeof l&&0===Object.keys(l).length;var l}function n(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const i={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),u=(e=>(e.before="before",e.after="after",e))(u||{}),d=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(d||{}),s=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(s||{});const v=Symbol.for("volver");function c(){return e.inject(v)}function f(t,l,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const p=e.defineComponent({name:"VvIcon",props:i,setup(l){const o=l,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=c(),{modifiers:r}=e.toRefs(o),u=f("vv-icon",r),d=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),s=e.computed((()=>{const e=o.name??"",l=`@${d.value}:${o.prefix}:${e}`;if(t.iconExists(l))return l;const a=null==i?void 0:i.iconsCollections.find((l=>{const o=`@${d.value}:${l.prefix}:${e}`;return t.iconExists(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function v(e){const l=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),a=(null==l?void 0:l.innerHTML.trim())||"";l&&a&&t.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return i&&o.src&&!t.iconExists(`@${d.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then((e=>{e&&(v(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&v(o.svg),(l,o)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:l.inline,width:l.width,height:l.height,horizontalFlip:l.horizontalFlip,verticalFlip:l.verticalFlip,flip:l.flip,rotate:e.unref(a),color:l.color,onLoad:l.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),m={valid:Boolean,validLabel:[String,Array]},h={invalid:Boolean,invalidLabel:[String,Array]},g={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},b={disabled:Boolean},y=(Boolean,Boolean,Boolean,{label:[String,Number]}),S={readonly:Boolean},B={modifiers:[String,Array]},L={hintLabel:{type:String,default:""}},x={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},$={debounce:[Number,String]},k={icon:{type:[String,Object]},iconPosition:{type:String,default:u.before,validation:e=>Object.values(u).includes(e)}},w={tabindex:{type:[String,Number],default:0}},V={floating:Boolean},N={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const O={...{...N,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...w,...b,...S,...m,...h,...L,...g,...B,...x,...$,...k,...V,...y,minlength:[String,Number],maxlength:[String,Number],placeholder:String,required:Boolean};d.button,s.button;const P={...O,modelValue:String,cols:{type:[String,Number],default:20},rows:{type:[String,Number],default:2},wrap:{type:String,default:"soft"},spellcheck:{type:[Boolean,String],default:"default"},resizable:Boolean};const _=["for"],I={class:"vv-textarea__wrapper"},C={key:0,class:"vv-textarea__input-before"},E={class:"vv-textarea__inner"},z=["id"],A={key:1,class:"vv-textarea__input-after"},j={key:2,class:"vv-textarea__limit"};return e.defineComponent({name:"VvTextarea",props:P,emits:["update:modelValue","focus","blur","keyup"],setup(t,{emit:i}){const d=t,s=e.useSlots(),v=function(t,l,o){const a=c(),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];a.length&&a[0]===n&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===n&&(l[o]=e[o]),"object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}("VvTextarea",P,d),m=e.ref(),{id:h,icon:g,iconPosition:b,label:y,modelValue:S,count:B,valid:L,invalid:x,loading:$,modifiers:k,debounce:w,minlength:V,maxlength:N}=e.toRefs(d),O=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.uid()))))(h),R=e.computed((()=>`${O.value}-hint`)),q=e.computed((()=>d.floating&&a(d.placeholder)?" ":d.placeholder)),T=function(t,l,o=0,{getter:a=(e=>e),setter:n=(e=>e)}={}){let i;return"string"==typeof o&&(o=parseInt(o)),e.computed({get:()=>a(null==t?void 0:t.value),set:e=>{i&&clearTimeout(i),i=setTimeout((()=>{l("update:modelValue",n(e))}),o)}})}(S,i,null==w?void 0:w.value),{hasIcon:F,hasIconBefore:D,hasIconAfter:H}=function(t,l){const o=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===u.before))),a=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===u.after))),n=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===r.left))),i=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===r.right))),d=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===r.top))),s=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===r.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),hasIconLeft:n,hasIconRight:i,hasIconTop:d,hasIconBottom:s,hasIconBefore:o,hasIconAfter:a}}(g,b),{focused:M}=function(t,l){const{focused:a}=o.useFocus(t);return e.watch(a,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:a}}(m,i),J=o.useElementVisibility(m);e.watch(J,(e=>{e&&d.autofocus&&(M.value=!0)}));const{formatted:K}=function(t,l){const o=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==l?void 0:l.lowerLimit)&&o.value<(null==l?void 0:l.lowerLimit)?o.value-l.lowerLimit:void 0!==(null==l?void 0:l.upperLimit)&&o.value<(null==l?void 0:l.upperLimit)?l.upperLimit-o.value:0)),n=e.computed((()=>{if(!1===(null==l?void 0:l.mode))return"";if("limit"===(null==l?void 0:l.mode)&&(null==l?void 0:l.upperLimit))return`${o.value} / ${l.lowerLimit?`${l.lowerLimit}-`:""}${l.upperLimit}`;if("countdown"===(null==l?void 0:l.mode)){if(0===a.value)return;return a}return o.value}));return{length:o,gap:a,formatted:n}}(T,{mode:null==B?void 0:B.value,upperLimit:Number(null==N?void 0:N.value),lowerLimit:Number(null==V?void 0:V.value)}),U=e.computed((()=>!d.disabled&&!d.readonly)),G=e.computed((()=>U.value?d.tabindex:-1)),Q=e.computed((()=>!a(S))),W=e.computed((()=>!0===d.invalid||!0!==d.valid&&void 0)),{HintSlot:X,hasHintLabelOrSlot:Y,hasInvalidLabelOrSlot:Z,hintSlotScope:ee}=function(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>n(o.value.invalidLabel))),i=e.computed((()=>n(o.value.validLabel))),r=e.computed((()=>o.value.loadingLabel)),u=e.computed((()=>o.value.hintLabel)),d=e.computed((()=>Boolean(o.value.loading&&(l.loading||r.value)))),s=e.computed((()=>!d.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),v=e.computed((()=>!d.value&&!s.value&&Boolean(o.value.valid&&(l.valid||i.value)))),c=e.computed((()=>!d.value&&!s.value&&!v.value&&Boolean(l.hint||u.value))),f=e.computed((()=>s.value||v.value||d.value||c.value)),p=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:a,validLabel:i,loadingLabel:r,hintLabel:u,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hasHintLabelOrSlot:c}),render(){var t,l,o,a,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:s,hasHintLabelOrSlot:c,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hintSlotScope:p,HintSlot:m}}(v,s),te=f("vv-textarea",k,e.computed((()=>({valid:L.value,invalid:x.value,loading:$.value,disabled:d.disabled,readonly:d.readonly,"icon-before":D.value,"icon-after":H.value,floating:d.floating&&!a(d.label),dirty:Q.value,focus:M.value,resizable:d.resizable})))),le=e.computed((()=>({name:d.name,placeholder:q.value,tabindex:G.value,disabled:d.disabled,readonly:d.readonly,required:d.required,autocomplete:d.autocomplete,minlength:d.minlength,maxlength:d.maxlength,cols:d.cols,rows:d.rows,wrap:d.wrap,spellcheck:d.spellcheck,"aria-invalid":W.value,"aria-describedby":Y.value?R.value:void 0,"aria-errormessage":Z.value?R.value:void 0}))),oe=e.computed((()=>({valid:d.valid,invalid:d.invalid,modelValue:d.modelValue,hintLabel:d.hintLabel,maxlength:d.maxlength,minlength:d.minlength,clear:ae}))),ae=()=>{T.value=void 0};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(te))},[e.unref(y)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(O),class:"vv-textarea__label"},e.toDisplayString(e.unref(y)),9,_)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",I,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",C,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(oe))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",E,[e.unref(D)?(e.openBlock(),e.createBlock(p,e.mergeProps({key:0,class:"vv-textarea__icon"},e.unref(F)),null,16)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(O),ref_key:"textarea",ref:m,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(T)?T.value=t:null)},e.unref(le),{onKeyup:l[1]||(l[1]=e=>i("keyup",e))}),null,16,z),[[e.vModelText,e.unref(T)]]),e.unref(H)?(e.openBlock(),e.createBlock(p,e.mergeProps({key:1,class:"vv-textarea__icon vv-textarea__icon-after"},e.unref(F)),null,16)):e.createCommentVNode("v-if",!0)]),t.$slots.after?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(oe))))])):e.createCommentVNode("v-if",!0),e.unref(B)?(e.openBlock(),e.createElementBlock("span",j,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(oe))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(K)),1)]))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(X),{id:e.unref(R),class:"vv-textarea__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(ee))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
@@ -67,7 +67,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
67
67
  required: boolean;
68
68
  };
69
69
  id: (StringConstructor | NumberConstructor)[];
70
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
70
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
71
+ [x: string]: (...args: any[]) => void;
72
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
71
73
  modelValue: StringConstructor;
72
74
  cols: {
73
75
  type: (StringConstructor | NumberConstructor)[];
@@ -136,23 +138,21 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
136
138
  required: boolean;
137
139
  };
138
140
  id: (StringConstructor | NumberConstructor)[];
139
- }>> & {
140
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
141
- }, {
141
+ }>>, {
142
+ readonly: boolean;
142
143
  disabled: boolean;
144
+ valid: boolean;
145
+ invalid: boolean;
143
146
  floating: boolean;
144
- spellcheck: string | boolean;
145
- tabindex: string | number;
146
147
  required: boolean;
147
148
  iconPosition: "before" | "after";
148
- autofocus: boolean;
149
149
  loading: boolean;
150
150
  loadingLabel: string;
151
- readonly: boolean;
152
151
  hintLabel: string;
153
- invalid: boolean;
154
- valid: boolean;
152
+ tabindex: string | number;
155
153
  autocomplete: string;
154
+ autofocus: boolean;
155
+ spellcheck: string | boolean;
156
156
  count: string | boolean;
157
157
  cols: string | number;
158
158
  rows: string | number;
@@ -33,6 +33,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
33
33
  ButtonType2["reset"] = "reset";
34
34
  return ButtonType2;
35
35
  })(ButtonType || {});
36
+ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
37
+ ActionTag2["nuxtLink"] = "nuxt-link";
38
+ ActionTag2["routerLink"] = "router-link";
39
+ ActionTag2["a"] = "a";
40
+ ActionTag2["button"] = "button";
41
+ return ActionTag2;
42
+ })(ActionTag || {});
36
43
  var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
37
44
  AnchorTarget2["_blank"] = "_blank";
38
45
  AnchorTarget2["_self"] = "_self";
@@ -79,6 +86,12 @@ const ActiveProps = {
79
86
  */
80
87
  active: Boolean
81
88
  };
89
+ const CurrentProps = {
90
+ /**
91
+ * Whether the item is current
92
+ */
93
+ current: Boolean
94
+ };
82
95
  const PressedProps = {
83
96
  /**
84
97
  * Whether the item is pressed
@@ -209,6 +222,7 @@ const ModifiersProps = {
209
222
  ...LabelProps,
210
223
  ...PressedProps,
211
224
  ...ActiveProps,
225
+ ...CurrentProps,
212
226
  ...LinkProps,
213
227
  /**
214
228
  * Button type
@@ -224,6 +238,13 @@ const ModifiersProps = {
224
238
  ariaLabel: {
225
239
  type: String,
226
240
  default: void 0
241
+ },
242
+ /**
243
+ * Default tag for the action
244
+ */
245
+ defaultTag: {
246
+ type: String,
247
+ default: ActionTag.button
227
248
  }
228
249
  });
229
250
  const VvTooltipProps = {
@@ -277,15 +298,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
277
298
  }))
278
299
  );
279
300
  return (_ctx, _cache) => {
280
- return openBlock(), createElementBlock("span", {
281
- class: normalizeClass(unref(bemCssClasses)),
282
- role: "tooltip",
283
- inert: ""
284
- }, [
285
- renderSlot(_ctx.$slots, "default", {}, () => [
286
- createTextVNode(toDisplayString(_ctx.value), 1)
287
- ])
288
- ], 2);
301
+ return openBlock(), createElementBlock(
302
+ "span",
303
+ {
304
+ class: normalizeClass(unref(bemCssClasses)),
305
+ role: "tooltip",
306
+ inert: ""
307
+ },
308
+ [
309
+ renderSlot(_ctx.$slots, "default", {}, () => [
310
+ createTextVNode(
311
+ toDisplayString(_ctx.value),
312
+ 1
313
+ /* TEXT */
314
+ )
315
+ ])
316
+ ],
317
+ 2
318
+ /* CLASS */
319
+ );
289
320
  };
290
321
  }
291
322
  });
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTooltip=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});Boolean,Boolean,Boolean;const l={modifiers:[String,Array]};t.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,n.button;const r={...l,position:{type:String,default:o.bottom},value:{type:String}};return e.defineComponent({__name:"VvTooltip",props:r,setup(o){const t=o,{modifiers:n}=e.toRefs(t),l=function(o,t,n){return e.computed((()=>{const l={[o]:!0},r="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return r&&Array.isArray(r)&&r.forEach((e=>{e&&(l[`${o}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((t=>{l[`${o}--${t}`]=e.unref(n.value[t])})),l}))}("vv-tooltip",n,e.computed((()=>({[t.position]:!0}))));return(o,t)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(l)),role:"tooltip",inert:""},[e.renderSlot(o.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(o.value),1)]))],2))}})}));
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvTooltip=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});Boolean,Boolean,Boolean,Boolean;const l={modifiers:[String,Array]};t.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,n.button,r.button;const i={...l,position:{type:String,default:o.bottom},value:{type:String}};return e.defineComponent({__name:"VvTooltip",props:i,setup(o){const t=o,{modifiers:n}=e.toRefs(t),r=function(o,t,n){return e.computed((()=>{const r={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((t=>{r[`${o}--${t}`]=e.unref(n.value[t])})),r}))}("vv-tooltip",n,e.computed((()=>({[t.position]:!0}))));return(o,t)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(r)),role:"tooltip",inert:""},[e.renderSlot(o.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(o.value),1)]))],2))}})}));