@volverjs/ui-vue 0.0.9-beta.7 → 0.0.9-beta.8

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 (52) hide show
  1. package/dist/components/VvAlert/VvAlert.es.js +7 -6
  2. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  3. package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
  4. package/dist/components/VvAlert/index.d.ts +3 -3
  5. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +7 -6
  6. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  7. package/dist/components/VvCheckbox/VvCheckbox.es.js +65 -2
  8. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  9. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
  10. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +71 -3
  11. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  12. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +4 -4
  13. package/dist/components/VvCombobox/VvCombobox.es.js +62 -56
  14. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  15. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +4 -4
  16. package/dist/components/VvInputText/VvInputText.es.js +61 -2
  17. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  18. package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
  19. package/dist/components/VvRadio/VvRadio.es.js +65 -2
  20. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  21. package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
  22. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +71 -3
  23. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  24. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +4 -4
  25. package/dist/components/VvSelect/VvSelect.es.js +61 -2
  26. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  27. package/dist/components/VvSelect/VvSelect.vue.d.ts +4 -4
  28. package/dist/components/VvTextarea/VvTextarea.es.js +61 -2
  29. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  30. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
  31. package/dist/components/common/HintSlot.d.ts +4 -3
  32. package/dist/components/index.es.js +104 -67
  33. package/dist/components/index.umd.js +1 -1
  34. package/dist/composables/index.d.ts +1 -2
  35. package/dist/icons.es.js +3 -3
  36. package/dist/icons.umd.js +1 -1
  37. package/package.json +21 -21
  38. package/src/assets/icons/detailed.json +1 -1
  39. package/src/assets/icons/normal.json +1 -1
  40. package/src/assets/icons/simple.json +1 -1
  41. package/src/components/VvAlert/VvAlert.vue +5 -1
  42. package/src/components/VvAlert/index.ts +3 -3
  43. package/src/components/VvCheckbox/VvCheckbox.vue +8 -1
  44. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +8 -1
  45. package/src/components/VvCombobox/VvCombobox.vue +1 -1
  46. package/src/components/VvInputText/VvInputText.vue +8 -1
  47. package/src/components/VvRadio/VvRadio.vue +8 -1
  48. package/src/components/VvRadioGroup/VvRadioGroup.vue +8 -1
  49. package/src/components/VvSelect/VvSelect.vue +8 -1
  50. package/src/components/VvTextarea/VvTextarea.vue +8 -1
  51. package/src/components/common/HintSlot.ts +7 -2
  52. package/src/composables/index.ts +1 -3
@@ -329,25 +329,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
329
329
  clear: () => void;
330
330
  }): any;
331
331
  hint?(_: {
332
- modelValue: any;
332
+ modelValue: unknown;
333
333
  valid: boolean;
334
334
  invalid: boolean;
335
335
  loading: boolean;
336
336
  }): any;
337
337
  loading?(_: {
338
- modelValue: any;
338
+ modelValue: unknown;
339
339
  valid: boolean;
340
340
  invalid: boolean;
341
341
  loading: boolean;
342
342
  }): any;
343
343
  valid?(_: {
344
- modelValue: any;
344
+ modelValue: unknown;
345
345
  valid: boolean;
346
346
  invalid: boolean;
347
347
  loading: boolean;
348
348
  }): any;
349
349
  invalid?(_: {
350
- modelValue: any;
350
+ modelValue: unknown;
351
351
  valid: boolean;
352
352
  invalid: boolean;
353
353
  loading: boolean;
@@ -36,6 +36,7 @@ var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
36
36
  AnchorTarget2["_top"] = "_top";
37
37
  return AnchorTarget2;
38
38
  })(AnchorTarget || {});
39
+ const INJECTION_KEY_VOLVER = Symbol.for("volver");
39
40
  const INJECTION_KEY_RADIO_GROUP = Symbol.for("radioGroup");
40
41
  const LinkProps = {
41
42
  /**
@@ -469,7 +470,8 @@ function joinLines(items) {
469
470
  }
470
471
  return items;
471
472
  }
472
- function HintSlotFactory(props, slots) {
473
+ function HintSlotFactory(propsOrRef, slots) {
474
+ const props = unref(propsOrRef);
473
475
  const invalidLabel = computed(() => joinLines(props.invalidLabel));
474
476
  const validLabel = computed(() => joinLines(props.validLabel));
475
477
  const loadingLabel = computed(() => props.loadingLabel);
@@ -573,6 +575,62 @@ function HintSlotFactory(props, slots) {
573
575
  HintSlot
574
576
  };
575
577
  }
578
+ function useVolver() {
579
+ return inject(INJECTION_KEY_VOLVER);
580
+ }
581
+ function useDefaults(componentName, propsDefinition, props) {
582
+ const volver = useVolver();
583
+ const volverComponentDefaults = computed(() => {
584
+ var _a;
585
+ if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
586
+ return void 0;
587
+ }
588
+ return volver.defaults.value[componentName];
589
+ });
590
+ return computed(() => {
591
+ if (volverComponentDefaults.value === void 0) {
592
+ return props;
593
+ }
594
+ const componentDefaults = volverComponentDefaults.value;
595
+ const simplifiedPropsDefinition = propsDefinition;
596
+ const simplifiedProps = props;
597
+ return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
598
+ const propValue = simplifiedProps[key];
599
+ acc[key] = propValue;
600
+ if (key in componentDefaults) {
601
+ if (Array.isArray(simplifiedPropsDefinition[key])) {
602
+ const typeArray = simplifiedPropsDefinition[key];
603
+ if (typeArray.length) {
604
+ const typeFunction = typeArray[0];
605
+ if (typeFunction === propValue) {
606
+ acc[key] = componentDefaults[key];
607
+ }
608
+ }
609
+ }
610
+ if (typeof simplifiedPropsDefinition[key] === "function") {
611
+ const typeFunction = simplifiedPropsDefinition[key];
612
+ if (typeFunction() === propValue) {
613
+ acc[key] = componentDefaults[key];
614
+ }
615
+ }
616
+ if (typeof simplifiedPropsDefinition[key] === "object") {
617
+ let defaultValue = simplifiedPropsDefinition[key].default;
618
+ if (typeof defaultValue === "function") {
619
+ defaultValue = defaultValue();
620
+ }
621
+ if (typeof defaultValue === "object") {
622
+ if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
623
+ acc[key] = componentDefaults[key];
624
+ }
625
+ } else if (defaultValue === propValue) {
626
+ acc[key] = componentDefaults[key];
627
+ }
628
+ }
629
+ }
630
+ return acc;
631
+ }, {});
632
+ });
633
+ }
576
634
  const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
577
635
  function useModifiers(prefix, modifiers, others) {
578
636
  return computed(() => {
@@ -609,6 +667,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
609
667
  setup(__props, { emit }) {
610
668
  const props = __props;
611
669
  const slots = useSlots();
670
+ const propsDefaults = useDefaults(
671
+ "VvRadio",
672
+ VvRadioProps,
673
+ props
674
+ );
612
675
  const { id, disabled, readonly, modelValue, valid, invalid } = useGroupProps(props, emit);
613
676
  const hasId = useUniqueId(id);
614
677
  const hasHintId = computed(() => `${hasId.value}-hint`);
@@ -659,7 +722,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
659
722
  hasHintLabelOrSlot,
660
723
  hasInvalidLabelOrSlot,
661
724
  hintSlotScope
662
- } = HintSlotFactory(props, slots);
725
+ } = HintSlotFactory(propsDefaults, slots);
663
726
  return (_ctx, _cache) => {
664
727
  return openBlock(), createElementBlock("label", {
665
728
  class: normalizeClass(unref(bemCssClasses)),
@@ -1 +1 @@
1
- !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadio=l(e.vue,e.nanoid)}(this,(function(e,l){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});const o=Symbol.for("radioGroup"),i={valid:Boolean,validLabel:[String,Array]},r={invalid:Boolean,invalidLabel:[String,Array]},u={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},d={disabled:Boolean},s=(Boolean,Boolean,{label:[String,Number]}),v={readonly:Boolean},f={modifiers:[String,Array]},c={hintLabel:{type:String,default:""}};a.before;const p={tabindex:{type:[String,Number],default:0}},b={id:[String,Number]};t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const h={...{...b,name:{type:String,required:!0}},...p,...i,...r,...c,...d,...v,...f,...s,...u,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]};function m(e,l,t){return t?y(e,t)===y(l,t):g(e,l)}function g(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const t=Array.isArray(e),a=Array.isArray(l);let n,o,i;if(t&&a){if(o=e.length,o!=l.length)return!1;for(n=o;0!=n--;)if(!g(e[n],l[n]))return!1;return!0}if(t!=a)return!1;const r=e instanceof Date,u=l instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==l.getTime();const d=e instanceof RegExp,s=l instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==l.toString();const v=Object.keys(e);if(o=v.length,o!==Object.keys(l).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(l,v[n]))return!1;for(n=o;0!=n--;)if(i=v[n],!g(e[i],l[i]))return!1;return!0}return e!=e&&l!=l}function y(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const t=l.split(".");let a=e;for(let l=0,n=t.length;l<n;++l){if(null==e)return null;a=a[t[l]]}return a}}return null}function S(l){const t=e.inject(l,void 0),a=e.computed((()=>{return l=t,!(null==(a=e.unref(l))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var l,a}));return{group:t,isInGroup:a,getGroupOrLocalRef:function(l,a,n){if(null==t?void 0:t.value){const a=e.unref(t.value)[l];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const o=e.toRef(a,l);return e.computed({get:()=>o.value,set(e){n&&n(`update:${l}`,e)}})}}}n.button;const L=h;function O(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const B=["for"],$=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvRadio",props:L,emits:["click","update:modelValue","change","blur"],setup(t,{emit:a}){const n=t,i=e.useSlots(),{id:r,disabled:u,readonly:d,modelValue:s,valid:v,invalid:f}=function(l,t){const{id:a}=e.toRefs(l),{group:n,isInGroup:i,getGroupOrLocalRef:r}=S(o),u=r("modelValue",l,t),d=r("valid",l),s=r("invalid",l),v=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==n?void 0:n.value)?void 0:e.readonly.value))})),f=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{id:a,group:n,isInGroup:i,modelValue:u,valid:d,invalid:s,readonly:v,disabled:f}}(n,a),c=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(r),p=e.computed((()=>`${c.value}-hint`)),b=e.computed((()=>g.value?-1:n.tabindex)),h=e.ref(),g=e.computed((()=>u.value||d.value)),y=e.computed((()=>!0===f.value||!0!==v.value&&void 0)),L=e.computed((()=>Array.isArray(s.value)?function(e,l){if(null!=e&&l&&l.length)for(const t of l)if(m(e,t))return!0;return!1}(n.value,s.value):m(n.value,s.value))),V=e.computed((()=>!["string","number","boolean"].includes(typeof n.value)||n.value)),A=e.computed({get:()=>L.value?V.value:null,set(e){Array.isArray(s.value)?s.value=[n.value]:s.value=n.value,a("change",e)}}),{modifiers:R}=e.toRefs(n),x=function(l,t,a){return e.computed((()=>{const n={[l]:!0},o="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((t=>{n[`${l}--${t}`]=e.unref(a.value[t])})),n}))}("vv-radio",R,e.computed((()=>({valid:v.value,invalid:f.value,disabled:u.value,readonly:d.value})))),{HintSlot:j,hasHintLabelOrSlot:k,hasInvalidLabelOrSlot:P,hintSlotScope:I}=function(l,t){const a=e.computed((()=>O(l.invalidLabel))),n=e.computed((()=>O(l.validLabel))),o=e.computed((()=>l.loadingLabel)),i=e.computed((()=>l.hintLabel)),r=e.computed((()=>Boolean(l.loading&&(t.loading||o.value)))),u=e.computed((()=>!r.value&&Boolean(l.invalid&&(t.invalid||a.value)))),d=e.computed((()=>!r.value&&!u.value&&Boolean(l.valid&&(t.valid||n.value)))),s=e.computed((()=>!r.value&&!u.value&&!d.value&&Boolean(t.hint||i.value))),v=e.computed((()=>u.value||d.value||r.value||s.value)),f=e.computed((()=>({modelValue:l.modelValue,valid:l.valid,invalid:l.invalid,loading:l.loading}))),c=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:a,validLabel:n,loadingLabel:o,hintLabel:i,hasInvalidLabelOrSlot:u,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hasHintLabelOrSlot:s}),render(){var l,t,a,n,o,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==(t=(l=this.$slots).loading)?void 0:t.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(a=this.$slots).invalid)?void 0:n.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(o=this.$slots).valid)?void 0:i.call(o))??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:u,hasHintLabelOrSlot:s,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hintSlotScope:f,HintSlot:c}}(n,i);return(l,t)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(x)),for:e.unref(c)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(c),ref_key:"input",ref:h,"onUpdate:modelValue":t[0]||(t[0]=l=>e.isRef(A)?A.value=l:null),type:"radio",class:"vv-radio__input",name:l.name,disabled:e.unref(g),value:e.unref(V),tabindex:e.unref(b),"aria-invalid":e.unref(y),"aria-describedby":e.unref(k)?e.unref(p):void 0,"aria-errormessage":e.unref(P)?e.unref(p):void 0},null,8,$),[[e.vModelRadio,e.unref(A)]]),e.renderSlot(l.$slots,"default",{value:e.unref(s)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(j),{id:e.unref(p),class:"vv-radio__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(I))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(I))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(I))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(I))))])),key:"3"}:void 0]),1032,["id"])],10,B))}})}));
1
+ !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadio=l(e.vue,e.nanoid)}(this,(function(e,l){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});const o=Symbol.for("volver"),i=Symbol.for("radioGroup"),r={valid:Boolean,validLabel:[String,Array]},u={invalid:Boolean,invalidLabel:[String,Array]},d={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},s={disabled:Boolean},v=(Boolean,Boolean,{label:[String,Number]}),f={readonly:Boolean},c={modifiers:[String,Array]},p={hintLabel:{type:String,default:""}};a.before;const b={tabindex:{type:[String,Number],default:0}},m={id:[String,Number]};t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const g={...{...m,name:{type:String,required:!0}},...b,...r,...u,...p,...s,...f,...c,...v,...d,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]};function h(e,l,t){return t?S(e,t)===S(l,t):y(e,l)}function y(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const t=Array.isArray(e),a=Array.isArray(l);let n,o,i;if(t&&a){if(o=e.length,o!=l.length)return!1;for(n=o;0!=n--;)if(!y(e[n],l[n]))return!1;return!0}if(t!=a)return!1;const r=e instanceof Date,u=l instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==l.getTime();const d=e instanceof RegExp,s=l instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==l.toString();const v=Object.keys(e);if(o=v.length,o!==Object.keys(l).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(l,v[n]))return!1;for(n=o;0!=n--;)if(i=v[n],!y(e[i],l[i]))return!1;return!0}return e!=e&&l!=l}function S(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const t=l.split(".");let a=e;for(let l=0,n=t.length;l<n;++l){if(null==e)return null;a=a[t[l]]}return a}}return null}function L(l){const t=e.inject(l,void 0),a=e.computed((()=>{return l=t,!(null==(a=e.unref(l))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var l,a}));return{group:t,isInGroup:a,getGroupOrLocalRef:function(l,a,n){if(null==t?void 0:t.value){const a=e.unref(t.value)[l];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const o=e.toRef(a,l);return e.computed({get:()=>o.value,set(e){n&&n(`update:${l}`,e)}})}}}n.button;const O=g;function B(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function $(l,t,a){const n=e.inject(o),i=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[l]))return n.defaults.value[l]}));return e.computed((()=>{if(void 0===i.value)return a;const e=i.value,l=t,n=a;return Object.keys(l).reduce(((t,a)=>{const o=n[a];if(t[a]=o,a in e){if(Array.isArray(l[a])){const n=l[a];if(n.length){n[0]===o&&(t[a]=e[a])}}if("function"==typeof l[a]){(0,l[a])()===o&&(t[a]=e[a])}if("object"==typeof l[a]){let n=l[a].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(o)&&(t[a]=e[a]):n===o&&(t[a]=e[a])}}return t}),{})}))}const V=["for"],A=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvRadio",props:O,emits:["click","update:modelValue","change","blur"],setup(t,{emit:a}){const n=t,o=e.useSlots(),r=$("VvRadio",O,n),{id:u,disabled:d,readonly:s,modelValue:v,valid:f,invalid:c}=function(l,t){const{id:a}=e.toRefs(l),{group:n,isInGroup:o,getGroupOrLocalRef:r}=L(i),u=r("modelValue",l,t),d=r("valid",l),s=r("invalid",l),v=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==n?void 0:n.value)?void 0:e.readonly.value))})),f=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{id:a,group:n,isInGroup:o,modelValue:u,valid:d,invalid:s,readonly:v,disabled:f}}(n,a),p=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(u),b=e.computed((()=>`${p.value}-hint`)),m=e.computed((()=>y.value?-1:n.tabindex)),g=e.ref(),y=e.computed((()=>d.value||s.value)),S=e.computed((()=>!0===c.value||!0!==f.value&&void 0)),j=e.computed((()=>Array.isArray(v.value)?function(e,l){if(null!=e&&l&&l.length)for(const t of l)if(h(e,t))return!0;return!1}(n.value,v.value):h(n.value,v.value))),R=e.computed((()=>!["string","number","boolean"].includes(typeof n.value)||n.value)),k=e.computed({get:()=>j.value?R.value:null,set(e){Array.isArray(v.value)?v.value=[n.value]:v.value=n.value,a("change",e)}}),{modifiers:x}=e.toRefs(n),N=function(l,t,a){return e.computed((()=>{const n={[l]:!0},o="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((t=>{n[`${l}--${t}`]=e.unref(a.value[t])})),n}))}("vv-radio",x,e.computed((()=>({valid:f.value,invalid:c.value,disabled:d.value,readonly:s.value})))),{HintSlot:P,hasHintLabelOrSlot:I,hasInvalidLabelOrSlot:C,hintSlotScope:w}=function(l,t){const a=e.unref(l),n=e.computed((()=>B(a.invalidLabel))),o=e.computed((()=>B(a.validLabel))),i=e.computed((()=>a.loadingLabel)),r=e.computed((()=>a.hintLabel)),u=e.computed((()=>Boolean(a.loading&&(t.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.invalid&&(t.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.valid&&(t.valid||o.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(t.hint||r.value))),f=e.computed((()=>d.value||s.value||u.value||v.value)),c=e.computed((()=>({modelValue:a.modelValue,valid:a.valid,invalid:a.invalid,loading:a.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:f,invalidLabel:n,validLabel:o,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var l,t,a,n,o,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==(t=(l=this.$slots).loading)?void 0:t.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(a=this.$slots).invalid)?void 0:n.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(o=this.$slots).valid)?void 0:i.call(o))??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:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:c,HintSlot:p}}(r,o);return(l,t)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(N)),for:e.unref(p)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(p),ref_key:"input",ref:g,"onUpdate:modelValue":t[0]||(t[0]=l=>e.isRef(k)?k.value=l:null),type:"radio",class:"vv-radio__input",name:l.name,disabled:e.unref(y),value:e.unref(R),tabindex:e.unref(m),"aria-invalid":e.unref(S),"aria-describedby":e.unref(I)?e.unref(b):void 0,"aria-errormessage":e.unref(C)?e.unref(b):void 0},null,8,A),[[e.vModelRadio,e.unref(k)]]),e.renderSlot(l.$slots,"default",{value:e.unref(v)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(P),{id:e.unref(b),class:"vv-radio__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"3"}:void 0]),1032,["id"])],10,V))}})}));
@@ -72,25 +72,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
72
72
  value: any;
73
73
  }): any;
74
74
  hint?(_: {
75
- modelValue: any;
75
+ modelValue: unknown;
76
76
  valid: boolean;
77
77
  invalid: boolean;
78
78
  loading: boolean;
79
79
  }): any;
80
80
  loading?(_: {
81
- modelValue: any;
81
+ modelValue: unknown;
82
82
  valid: boolean;
83
83
  invalid: boolean;
84
84
  loading: boolean;
85
85
  }): any;
86
86
  valid?(_: {
87
- modelValue: any;
87
+ modelValue: unknown;
88
88
  valid: boolean;
89
89
  invalid: boolean;
90
90
  loading: boolean;
91
91
  }): any;
92
92
  invalid?(_: {
93
- modelValue: any;
93
+ modelValue: unknown;
94
94
  valid: boolean;
95
95
  invalid: boolean;
96
96
  loading: boolean;
@@ -38,6 +38,7 @@ var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
38
38
  AnchorTarget2["_top"] = "_top";
39
39
  return AnchorTarget2;
40
40
  })(AnchorTarget || {});
41
+ const INJECTION_KEY_VOLVER = Symbol.for("volver");
41
42
  const INJECTION_KEY_RADIO_GROUP = Symbol.for("radioGroup");
42
43
  function equals(obj1, obj2, field) {
43
44
  if (field)
@@ -130,7 +131,8 @@ function joinLines(items) {
130
131
  }
131
132
  return items;
132
133
  }
133
- function HintSlotFactory(props, slots) {
134
+ function HintSlotFactory(propsOrRef, slots) {
135
+ const props = unref(propsOrRef);
134
136
  const invalidLabel = computed(() => joinLines(props.invalidLabel));
135
137
  const validLabel = computed(() => joinLines(props.validLabel));
136
138
  const loadingLabel = computed(() => props.loadingLabel);
@@ -619,6 +621,62 @@ function useGroupProps(props, emit) {
619
621
  disabled
620
622
  };
621
623
  }
624
+ function useVolver() {
625
+ return inject(INJECTION_KEY_VOLVER);
626
+ }
627
+ function useDefaults(componentName, propsDefinition, props) {
628
+ const volver = useVolver();
629
+ const volverComponentDefaults = computed(() => {
630
+ var _a;
631
+ if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
632
+ return void 0;
633
+ }
634
+ return volver.defaults.value[componentName];
635
+ });
636
+ return computed(() => {
637
+ if (volverComponentDefaults.value === void 0) {
638
+ return props;
639
+ }
640
+ const componentDefaults = volverComponentDefaults.value;
641
+ const simplifiedPropsDefinition = propsDefinition;
642
+ const simplifiedProps = props;
643
+ return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
644
+ const propValue = simplifiedProps[key];
645
+ acc[key] = propValue;
646
+ if (key in componentDefaults) {
647
+ if (Array.isArray(simplifiedPropsDefinition[key])) {
648
+ const typeArray = simplifiedPropsDefinition[key];
649
+ if (typeArray.length) {
650
+ const typeFunction = typeArray[0];
651
+ if (typeFunction === propValue) {
652
+ acc[key] = componentDefaults[key];
653
+ }
654
+ }
655
+ }
656
+ if (typeof simplifiedPropsDefinition[key] === "function") {
657
+ const typeFunction = simplifiedPropsDefinition[key];
658
+ if (typeFunction() === propValue) {
659
+ acc[key] = componentDefaults[key];
660
+ }
661
+ }
662
+ if (typeof simplifiedPropsDefinition[key] === "object") {
663
+ let defaultValue = simplifiedPropsDefinition[key].default;
664
+ if (typeof defaultValue === "function") {
665
+ defaultValue = defaultValue();
666
+ }
667
+ if (typeof defaultValue === "object") {
668
+ if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
669
+ acc[key] = componentDefaults[key];
670
+ }
671
+ } else if (defaultValue === propValue) {
672
+ acc[key] = componentDefaults[key];
673
+ }
674
+ }
675
+ }
676
+ return acc;
677
+ }, {});
678
+ });
679
+ }
622
680
  const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
623
681
  function useModifiers(prefix, modifiers, others) {
624
682
  return computed(() => {
@@ -655,6 +713,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
655
713
  setup(__props, { emit }) {
656
714
  const props = __props;
657
715
  const slots = useSlots();
716
+ const propsDefaults = useDefaults(
717
+ "VvRadio",
718
+ VvRadioProps,
719
+ props
720
+ );
658
721
  const { id, disabled, readonly, modelValue, valid, invalid } = useGroupProps(props, emit);
659
722
  const hasId = useUniqueId(id);
660
723
  const hasHintId = computed(() => `${hasId.value}-hint`);
@@ -705,7 +768,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
705
768
  hasHintLabelOrSlot,
706
769
  hasInvalidLabelOrSlot,
707
770
  hintSlotScope
708
- } = HintSlotFactory(props, slots);
771
+ } = HintSlotFactory(propsDefaults, slots);
709
772
  return (_ctx, _cache) => {
710
773
  return openBlock(), createElementBlock("label", {
711
774
  class: normalizeClass(unref(bemCssClasses)),
@@ -824,6 +887,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
824
887
  setup(__props, { emit }) {
825
888
  const props = __props;
826
889
  const slots = useSlots();
890
+ const propsDefaults = useDefaults(
891
+ "VvRadioGroup",
892
+ VvRadioGroupProps,
893
+ props
894
+ );
827
895
  const modelValue = useVModel(props, "modelValue", emit);
828
896
  const { disabled, readonly, vertical, valid, invalid, modifiers } = toRefs(props);
829
897
  useProvideGroupState({
@@ -854,7 +922,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
854
922
  value: getOptionValue(option)
855
923
  };
856
924
  };
857
- const { HintSlot, hintSlotScope } = HintSlotFactory(props, slots);
925
+ const { HintSlot, hintSlotScope } = HintSlotFactory(propsDefaults, slots);
858
926
  return (_ctx, _cache) => {
859
927
  return openBlock(), createElementBlock("fieldset", {
860
928
  class: normalizeClass(unref(bemCssClasses))
@@ -1 +1 @@
1
- !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("nanoid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","nanoid","@vueuse/core","ts-dot-prop"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadioGroup=l(e.vue,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,l,t,o){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{});const r=Symbol.for("radioGroup");function u(e,l,t){return t?s(e,t)===s(l,t):d(e,l)}function d(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const t=Array.isArray(e),o=Array.isArray(l);let a,n,i;if(t&&o){if(n=e.length,n!=l.length)return!1;for(a=n;0!=a--;)if(!d(e[a],l[a]))return!1;return!0}if(t!=o)return!1;const r=e instanceof Date,u=l instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==l.getTime();const s=e instanceof RegExp,v=l instanceof RegExp;if(s!=v)return!1;if(s&&v)return e.toString()==l.toString();const c=Object.keys(e);if(n=c.length,n!==Object.keys(l).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(l,c[a]))return!1;for(a=n;0!=a--;)if(i=c[a],!d(e[i],l[i]))return!1;return!0}return e!=e&&l!=l}function s(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const t=l.split(".");let o=e;for(let l=0,a=t.length;l<a;++l){if(null==e)return null;o=o[t[l]]}return o}}return null}function v(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function c(l,t){const o=e.computed((()=>v(l.invalidLabel))),a=e.computed((()=>v(l.validLabel))),n=e.computed((()=>l.loadingLabel)),i=e.computed((()=>l.hintLabel)),r=e.computed((()=>Boolean(l.loading&&(t.loading||n.value)))),u=e.computed((()=>!r.value&&Boolean(l.invalid&&(t.invalid||o.value)))),d=e.computed((()=>!r.value&&!u.value&&Boolean(l.valid&&(t.valid||a.value)))),s=e.computed((()=>!r.value&&!u.value&&!d.value&&Boolean(t.hint||i.value))),c=e.computed((()=>u.value||d.value||r.value||s.value)),f=e.computed((()=>({modelValue:l.modelValue,valid:l.valid,invalid:l.invalid,loading:l.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:o,validLabel:a,loadingLabel:n,hintLabel:i,hasInvalidLabelOrSlot:u,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hasHintLabelOrSlot:s}),render(){var l,t,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==(t=(l=this.$slots).loading)?void 0:t.call(l))??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:u,hasHintLabelOrSlot:s,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hintSlotScope:f,HintSlot:p}}const f={valid:Boolean,validLabel:[String,Array]},p={invalid:Boolean,invalidLabel:[String,Array]},m={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},b={disabled:Boolean},g=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},h={modifiers:[String,Array]},S={hintLabel:{type:String,default:""}},L={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};n.before;const B={tabindex:{type:[String,Number],default:0}},O={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const k={...{...O,name:{type:String,required:!0}},...B,...f,...p,...S,...b,...y,...h,...g,...m,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},$={...f,...p,...L,...S,...b,...y,...h,...g,...m,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};function V(l){const t=e.inject(l,void 0),o=e.computed((()=>{return l=t,!(null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var l,o}));return{group:t,isInGroup:o,getGroupOrLocalRef:function(l,o,a){if(null==t?void 0:t.value){const o=e.unref(t.value)[l];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const n=e.toRef(o,l);return e.computed({get:()=>n.value,set(e){a&&a(`update:${l}`,e)}})}}}i.button;const R=k;function x(l,t,o){return e.computed((()=>{const a={[l]:!0},n="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${l}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((t=>{a[`${l}--${t}`]=e.unref(o.value[t])})),a}))}const A=["for"],P=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],j=e.defineComponent({name:"VvRadio",props:R,emits:["click","update:modelValue","change","blur"],setup(t,{emit:o}){const a=t,n=e.useSlots(),{id:i,disabled:d,readonly:s,modelValue:v,valid:f,invalid:p}=function(l,t){const{id:o}=e.toRefs(l),{group:a,isInGroup:n,getGroupOrLocalRef:i}=V(r),u=i("modelValue",l,t),d=i("valid",l),s=i("invalid",l),v=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),c=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:o,group:a,isInGroup:n,modelValue:u,valid:d,invalid:s,readonly:v,disabled:c}}(a,o),m=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(i),b=e.computed((()=>`${m.value}-hint`)),g=e.computed((()=>h.value?-1:a.tabindex)),y=e.ref(),h=e.computed((()=>d.value||s.value)),S=e.computed((()=>!0===p.value||!0!==f.value&&void 0)),L=e.computed((()=>Array.isArray(v.value)?function(e,l){if(null!=e&&l&&l.length)for(const t of l)if(u(e,t))return!0;return!1}(a.value,v.value):u(a.value,v.value))),B=e.computed((()=>!["string","number","boolean"].includes(typeof a.value)||a.value)),O=e.computed({get:()=>L.value?B.value:null,set(e){Array.isArray(v.value)?v.value=[a.value]:v.value=a.value,o("change",e)}}),{modifiers:k}=e.toRefs(a),$=x("vv-radio",k,e.computed((()=>({valid:f.value,invalid:p.value,disabled:d.value,readonly:s.value})))),{HintSlot:R,hasHintLabelOrSlot:j,hasInvalidLabelOrSlot:C,hintSlotScope:w}=c(a,n);return(l,t)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref($)),for:e.unref(m)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(m),ref_key:"input",ref:y,"onUpdate:modelValue":t[0]||(t[0]=l=>e.isRef(O)?O.value=l:null),type:"radio",class:"vv-radio__input",name:l.name,disabled:e.unref(h),value:e.unref(B),tabindex:e.unref(g),"aria-invalid":e.unref(S),"aria-describedby":e.unref(j)?e.unref(b):void 0,"aria-errormessage":e.unref(C)?e.unref(b):void 0},null,8,P),[[e.vModelRadio,e.unref(O)]]),e.renderSlot(l.$slots,"default",{value:e.unref(v)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(R),{id:e.unref(b),class:"vv-radio__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"3"}:void 0]),1032,["id"])],10,A))}}),C=$;const w=["textContent"],N={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:C,emits:["update:modelValue","change"],setup(l,{emit:a}){const n=l,i=e.useSlots(),u=t.useVModel(n,"modelValue",a),{disabled:d,readonly:s,vertical:v,valid:f,invalid:p,modifiers:m}=e.toRefs(n);!function(l){if(Object.keys(l).some((t=>"key"!==t&&!e.isRef(l[t]))))throw Error("One or more groupState props aren't ref.");e.provide(l.key,e.computed((()=>l)))}({key:r,modelValue:u,disabled:d,readonly:s,valid:f,invalid:p});const{getOptionLabel:b,getOptionValue:g}=function(l){const{options:t,labelKey:a,valueKey:n,disabledKey:i}=e.toRefs(l);return{options:t,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof a.value?a.value(e):o.get(e,a.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):o.get(e,n.value),getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):o.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),y=x("vv-radio-group",m,e.computed((()=>({disabled:d.value,readonly:s.value,horizontal:!v.value,valid:f.value,invalid:p.value})))),{HintSlot:h,hintSlotScope:S}=c(n,i);return(l,t)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(y))},[l.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(l.label)},null,8,w)):e.createCommentVNode("",!0),e.createElementVNode("div",N,[l.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.options,((l,t)=>(e.openBlock(),e.createBlock(j,e.mergeProps({key:t},((e,l)=>({id:`${n.name}_opt${l}`,name:n.name,label:b(e),value:g(e)}))(l,t)),null,16)))),128)):e.renderSlot(l.$slots,"default",{key:1})]),e.createVNode(e.unref(h),{class:"vv-radio-group__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(S))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(S))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(S))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(S))))])),key:"3"}:void 0]),1024)],2))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("nanoid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","nanoid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadioGroup=t(e.vue,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,t,l,o){"use strict";var n=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(n||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{});const r=Symbol.for("volver"),u=Symbol.for("radioGroup");function d(e,t,l){return l?v(e,l)===v(t,l):s(e,t)}function s(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),o=Array.isArray(t);let n,a,i;if(l&&o){if(a=e.length,a!=t.length)return!1;for(n=a;0!=n--;)if(!s(e[n],t[n]))return!1;return!0}if(l!=o)return!1;const r=e instanceof Date,u=t instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,v=t instanceof RegExp;if(d!=v)return!1;if(d&&v)return e.toString()==t.toString();const f=Object.keys(e);if(a=f.length,a!==Object.keys(t).length)return!1;for(n=a;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,f[n]))return!1;for(n=a;0!=n--;)if(i=f[n],!s(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function v(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let o=e;for(let t=0,n=l.length;t<n;++t){if(null==e)return null;o=o[l[t]]}return o}}return null}function f(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function c(t,l){const o=e.unref(t),n=e.computed((()=>f(o.invalidLabel))),a=e.computed((()=>f(o.validLabel))),i=e.computed((()=>o.loadingLabel)),r=e.computed((()=>o.hintLabel)),u=e.computed((()=>Boolean(o.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(o.invalid&&(l.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(o.valid&&(l.valid||a.value)))),v=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),c=e.computed((()=>d.value||s.value||u.value||v.value)),p=e.computed((()=>({modelValue:o.modelValue,valid:o.valid,invalid:o.invalid,loading:o.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:n,validLabel:a,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,o,n,a,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==(n=(o=this.$slots).invalid)?void 0:n.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(a=this.$slots).valid)?void 0:i.call(a))??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:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:m}}const p={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},g={disabled:Boolean},y=(Boolean,Boolean,{label:[String,Number]}),h={readonly:Boolean},S={modifiers:[String,Array]},L={hintLabel:{type:String,default:""}},O={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};a.before;const B={tabindex:{type:[String,Number],default:0}},k={id:[String,Number]};n.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const V={...{...k,name:{type:String,required:!0}},...B,...p,...m,...L,...g,...h,...S,...y,...b,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},$={...p,...m,...O,...L,...g,...h,...S,...y,...b,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};function R(t){const l=e.inject(t,void 0),o=e.computed((()=>{return t=l,!(null==(o=e.unref(t))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var t,o}));return{group:l,isInGroup:o,getGroupOrLocalRef:function(t,o,n){if(null==l?void 0:l.value){const o=e.unref(l.value)[t];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const a=e.toRef(o,t);return e.computed({get:()=>a.value,set(e){n&&n(`update:${t}`,e)}})}}}i.button;const j=V;function A(t,l,o){const n=e.inject(r),a=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[t]))return n.defaults.value[t]}));return e.computed((()=>{if(void 0===a.value)return o;const e=a.value,t=l,n=o;return Object.keys(t).reduce(((l,o)=>{const a=n[o];if(l[o]=a,o in e){if(Array.isArray(t[o])){const n=t[o];if(n.length){n[0]===a&&(l[o]=e[o])}}if("function"==typeof t[o]){(0,t[o])()===a&&(l[o]=e[o])}if("object"==typeof t[o]){let n=t[o].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(a)&&(l[o]=e[o]):n===a&&(l[o]=e[o])}}return l}),{})}))}function x(t,l,o){return e.computed((()=>{const n={[t]:!0},a="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{n[`${t}--${l}`]=e.unref(o.value[l])})),n}))}const P=["for"],C=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],N=e.defineComponent({name:"VvRadio",props:j,emits:["click","update:modelValue","change","blur"],setup(l,{emit:o}){const n=l,a=e.useSlots(),i=A("VvRadio",j,n),{id:r,disabled:s,readonly:v,modelValue:f,valid:p,invalid:m}=function(t,l){const{id:o}=e.toRefs(t),{group:n,isInGroup:a,getGroupOrLocalRef:i}=R(u),r=i("modelValue",t,l),d=i("valid",t),s=i("invalid",t),v=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==n?void 0:n.value)?void 0:e.readonly.value))})),f=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{id:o,group:n,isInGroup:a,modelValue:r,valid:d,invalid:s,readonly:v,disabled:f}}(n,o),b=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.nanoid()))))(r),g=e.computed((()=>`${b.value}-hint`)),y=e.computed((()=>S.value?-1:n.tabindex)),h=e.ref(),S=e.computed((()=>s.value||v.value)),L=e.computed((()=>!0===m.value||!0!==p.value&&void 0)),O=e.computed((()=>Array.isArray(f.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(d(e,l))return!0;return!1}(n.value,f.value):d(n.value,f.value))),B=e.computed((()=>!["string","number","boolean"].includes(typeof n.value)||n.value)),k=e.computed({get:()=>O.value?B.value:null,set(e){Array.isArray(f.value)?f.value=[n.value]:f.value=n.value,o("change",e)}}),{modifiers:V}=e.toRefs(n),$=x("vv-radio",V,e.computed((()=>({valid:p.value,invalid:m.value,disabled:s.value,readonly:v.value})))),{HintSlot:N,hasHintLabelOrSlot:w,hasInvalidLabelOrSlot:_,hintSlotScope:z}=c(i,a);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref($)),for:e.unref(b)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(b),ref_key:"input",ref:h,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(k)?k.value=t:null),type:"radio",class:"vv-radio__input",name:t.name,disabled:e.unref(S),value:e.unref(B),tabindex:e.unref(y),"aria-invalid":e.unref(L),"aria-describedby":e.unref(w)?e.unref(g):void 0,"aria-errormessage":e.unref(_)?e.unref(g):void 0},null,8,C),[[e.vModelRadio,e.unref(k)]]),e.renderSlot(t.$slots,"default",{value:e.unref(f)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(N),{id:e.unref(g),class:"vv-radio__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(z))))])),key:"3"}:void 0]),1032,["id"])],10,P))}}),w=$;const _=["textContent"],z={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:w,emits:["update:modelValue","change"],setup(t,{emit:n}){const a=t,i=e.useSlots(),r=A("VvRadioGroup",w,a),d=l.useVModel(a,"modelValue",n),{disabled:s,readonly:v,vertical:f,valid:p,invalid:m,modifiers:b}=e.toRefs(a);!function(t){if(Object.keys(t).some((l=>"key"!==l&&!e.isRef(t[l]))))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed((()=>t)))}({key:u,modelValue:d,disabled:s,readonly:v,valid:p,invalid:m});const{getOptionLabel:g,getOptionValue:y}=function(t){const{options:l,labelKey:n,valueKey:a,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof n.value?n.value(e):o.get(e,n.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):o.get(e,a.value),getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):o.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(a),h=x("vv-radio-group",b,e.computed((()=>({disabled:s.value,readonly:v.value,horizontal:!f.value,valid:p.value,invalid:m.value})))),{HintSlot:S,hintSlotScope:L}=c(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(h))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,_)):e.createCommentVNode("",!0),e.createElementVNode("div",z,[t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,((t,l)=>(e.openBlock(),e.createBlock(N,e.mergeProps({key:l},((e,t)=>({id:`${a.name}_opt${t}`,name:a.name,label:g(e),value:y(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(S),{class:"vv-radio-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(L))))])),key:"3"}:void 0]),1024)],2))}})}));
@@ -97,25 +97,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
97
97
  }, {}>, {
98
98
  default?(_: {}): any;
99
99
  hint?(_: {
100
- modelValue: any;
100
+ modelValue: unknown;
101
101
  valid: boolean;
102
102
  invalid: boolean;
103
103
  loading: boolean;
104
104
  }): any;
105
105
  loading?(_: {
106
- modelValue: any;
106
+ modelValue: unknown;
107
107
  valid: boolean;
108
108
  invalid: boolean;
109
109
  loading: boolean;
110
110
  }): any;
111
111
  valid?(_: {
112
- modelValue: any;
112
+ modelValue: unknown;
113
113
  valid: boolean;
114
114
  invalid: boolean;
115
115
  loading: boolean;
116
116
  }): any;
117
117
  invalid?(_: {
118
- modelValue: any;
118
+ modelValue: unknown;
119
119
  valid: boolean;
120
120
  invalid: boolean;
121
121
  loading: boolean;
@@ -268,7 +268,8 @@ function joinLines(items) {
268
268
  }
269
269
  return items;
270
270
  }
271
- function HintSlotFactory(props, slots) {
271
+ function HintSlotFactory(propsOrRef, slots) {
272
+ const props = unref(propsOrRef);
272
273
  const invalidLabel = computed(() => joinLines(props.invalidLabel));
273
274
  const validLabel = computed(() => joinLines(props.validLabel));
274
275
  const loadingLabel = computed(() => props.loadingLabel);
@@ -723,6 +724,59 @@ const VvSelectProps = {
723
724
  placeholder: String
724
725
  };
725
726
  const VvSelectEmits = ["update:modelValue", "focus", "blur"];
727
+ function useDefaults(componentName, propsDefinition, props) {
728
+ const volver = useVolver();
729
+ const volverComponentDefaults = computed(() => {
730
+ var _a;
731
+ if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
732
+ return void 0;
733
+ }
734
+ return volver.defaults.value[componentName];
735
+ });
736
+ return computed(() => {
737
+ if (volverComponentDefaults.value === void 0) {
738
+ return props;
739
+ }
740
+ const componentDefaults = volverComponentDefaults.value;
741
+ const simplifiedPropsDefinition = propsDefinition;
742
+ const simplifiedProps = props;
743
+ return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
744
+ const propValue = simplifiedProps[key];
745
+ acc[key] = propValue;
746
+ if (key in componentDefaults) {
747
+ if (Array.isArray(simplifiedPropsDefinition[key])) {
748
+ const typeArray = simplifiedPropsDefinition[key];
749
+ if (typeArray.length) {
750
+ const typeFunction = typeArray[0];
751
+ if (typeFunction === propValue) {
752
+ acc[key] = componentDefaults[key];
753
+ }
754
+ }
755
+ }
756
+ if (typeof simplifiedPropsDefinition[key] === "function") {
757
+ const typeFunction = simplifiedPropsDefinition[key];
758
+ if (typeFunction() === propValue) {
759
+ acc[key] = componentDefaults[key];
760
+ }
761
+ }
762
+ if (typeof simplifiedPropsDefinition[key] === "object") {
763
+ let defaultValue = simplifiedPropsDefinition[key].default;
764
+ if (typeof defaultValue === "function") {
765
+ defaultValue = defaultValue();
766
+ }
767
+ if (typeof defaultValue === "object") {
768
+ if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
769
+ acc[key] = componentDefaults[key];
770
+ }
771
+ } else if (defaultValue === propValue) {
772
+ acc[key] = componentDefaults[key];
773
+ }
774
+ }
775
+ }
776
+ return acc;
777
+ }, {});
778
+ });
779
+ }
726
780
  const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
727
781
  function useComponentFocus(inputTemplateRef, emit) {
728
782
  const { focused } = useFocus(inputTemplateRef);
@@ -826,13 +880,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
826
880
  setup(__props, { emit }) {
827
881
  const props = __props;
828
882
  const slots = useSlots();
883
+ const propsDefaults = useDefaults(
884
+ "VvSelect",
885
+ VvSelectProps,
886
+ props
887
+ );
829
888
  const select = ref();
830
889
  const {
831
890
  HintSlot,
832
891
  hasHintLabelOrSlot,
833
892
  hasInvalidLabelOrSlot,
834
893
  hintSlotScope
835
- } = HintSlotFactory(props, slots);
894
+ } = HintSlotFactory(propsDefaults, slots);
836
895
  const {
837
896
  id,
838
897
  modifiers,
@@ -1 +1 @@
1
- !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@iconify/vue"),require("nanoid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid","@vueuse/core","ts-dot-prop"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=l(e.vue,e.vue$1,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,l,o,t,n){"use strict";const a={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 i=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(i||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{});const d=Symbol.for("volver");function s(l,o,t){return e.computed((()=>{const n={[l]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((o=>{n[`${l}--${o}`]=e.unref(t.value[o])})),n}))}const c=e.defineComponent({name:"VvIcon",props:a,setup(o){const t=o,n=e.computed((()=>"string"==typeof t.rotate?parseFloat(t.rotate):t.rotate)),a=e.ref(!0),i=e.inject(d),{modifiers:r}=e.toRefs(t),u=s("vv-icon",r),c=e.computed((()=>t.provider||(null==i?void 0:i.iconsProvider))),v=e.computed((()=>{const e=t.name??"",o=`@${c.value}:${t.prefix}:${e}`;if(l.iconExists(o))return o;const n=null==i?void 0:i.iconsCollections.find((o=>{const t=`@${c.value}:${o.prefix}:${e}`;return l.iconExists(t)}));return n?`@${c.value}:${n.prefix}:${e}`:e}));function p(e){const o=function(e){let l;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");l=(new e).window}return(l?new l.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),n=(null==o?void 0:o.innerHTML.trim())||"";o&&n&&l.addIcon(`@${c.value}:${t.prefix}:${t.name}`,{body:n,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&t.src&&!l.iconExists(`@${c.value}:${t.prefix}:${t.name}`)&&(a.value=!1,i.fetchIcon(t.src).then((e=>{e&&(p(e),a.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),t.svg&&p(t.svg),(o,t)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(n),color:o.color,onLoad:o.onLoad,icon:e.unref(v)}),null,16,["class"])):e.createCommentVNode("",!0)}});function v(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const p={valid:Boolean,validLabel:[String,Array]},f={invalid:Boolean,invalidLabel:[String,Array]},m={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},g={disabled:Boolean},b=(Boolean,Boolean,{label:[String,Number]}),h={readonly:Boolean},y={modifiers:[String,Array]},S={hintLabel:{type:String,default:""}},B={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},k={icon:{type:[String,Object]},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},L={tabindex:{type:[String,Number],default:0}},$={floating:Boolean},V={unselectable:{type:Boolean,default:!0}},O={id:[String,Number]};i.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const w={...O,name:{type:String,required:!0}},E={autofocus:Boolean},P={autocomplete:{type:String,default:"off"}};u.button;const x={...w,...E,...P,...L,...p,...f,...S,...m,...g,...h,...y,...B,...k,...$,...V,...b,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const I=["for"],N={class:"vv-select__wrapper"},_={key:0,class:"vv-select__input-before"},A={class:"vv-select__inner"},C=["id"],F=["disabled","hidden"],j=["disabled","value"],z=["disabled","label"],q=["disabled","value"],D={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:x,emits:["update:modelValue","focus","blur"],setup(l,{emit:a}){const u=l,d=e.useSlots(),p=e.ref(),{HintSlot:f,hasHintLabelOrSlot:m,hasInvalidLabelOrSlot:g,hintSlotScope:b}=function(l,o){const t=e.computed((()=>v(l.invalidLabel))),n=e.computed((()=>v(l.validLabel))),a=e.computed((()=>l.loadingLabel)),i=e.computed((()=>l.hintLabel)),r=e.computed((()=>Boolean(l.loading&&(o.loading||a.value)))),u=e.computed((()=>!r.value&&Boolean(l.invalid&&(o.invalid||t.value)))),d=e.computed((()=>!r.value&&!u.value&&Boolean(l.valid&&(o.valid||n.value)))),s=e.computed((()=>!r.value&&!u.value&&!d.value&&Boolean(o.hint||i.value))),c=e.computed((()=>u.value||d.value||r.value||s.value)),p=e.computed((()=>({modelValue:l.modelValue,valid:l.valid,invalid:l.invalid,loading:l.loading}))),f=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:t,validLabel:n,loadingLabel:a,hintLabel:i,hasInvalidLabelOrSlot:u,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hasHintLabelOrSlot:s}),render(){var l,o,t,n,a,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==(o=(l=this.$slots).loading)?void 0:o.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(t=this.$slots).invalid)?void 0:n.call(t))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(a=this.$slots).valid)?void 0:i.call(a))??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:u,hasHintLabelOrSlot:s,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hintSlotScope:p,HintSlot:f}}(u,d),{id:h,modifiers:y,disabled:S,readonly:B,loading:k,icon:L,iconPosition:$,invalid:V,valid:O,floating:w,multiple:E}=e.toRefs(u),P=(l=>e.computed((()=>String((null==l?void 0:l.value)||o.nanoid()))))(h),x=e.computed((()=>`${P.value}-hint`)),{focused:R}=function(l,o){const{focused:n}=t.useFocus(l);return e.watch(n,(t=>{o(t?"focus":"blur",e.unref(l))})),{focused:n}}(p,a),H=t.useElementVisibility(p);e.watch(H,(e=>{e&&u.autofocus&&(R.value=!0)}));const{hasIcon:K,hasIconBefore:M,hasIconAfter:T}=function(l,o){const t=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.before))),n=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===r.after))),a=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.left))),u=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.right))),d=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.top))),s=e.computed((()=>Boolean((null==l?void 0:l.value)&&o.value===i.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==l?void 0:l.value)?{name:null==l?void 0:l.value}:null==l?void 0:l.value)),hasIconLeft:a,hasIconRight:u,hasIconTop:d,hasIconBottom:s,hasIconBefore:t,hasIconAfter:n}}(L,$),G=e.computed((()=>{return l=u.modelValue,!(null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var l,o})),J=e.computed((()=>u.disabled||u.readonly)),U=e.computed((()=>J.value?-1:u.tabindex)),Q=e.computed((()=>!0===u.invalid||!0!==u.valid&&void 0)),W=s("vv-select",y,e.computed((()=>({valid:O.value,invalid:V.value,loading:k.value,disabled:S.value,readonly:B.value,"icon-before":M.value,"icon-after":T.value,dirty:G.value,focus:R.value,floating:w.value,multiple:E.value})))),X=e.computed((()=>({name:u.name,tabindex:U.value,disabled:J.value,required:u.required,size:u.size,autocomplete:u.autocomplete,multiple:u.multiple,"aria-invalid":Q.value,"aria-describedby":m.value?x.value:void 0,"aria-errormessage":g.value?x.value:void 0}))),Y=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:Z,getOptionValue:ee,getOptionDisabled:le,getOptionGrouped:oe}=function(l){const{options:o,labelKey:t,valueKey:a,disabledKey:i}=e.toRefs(l);return{options:o,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof t.value?t.value(e):n.get(e,t.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):n.get(e,a.value),getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):n.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(u),te=e.computed({get:()=>u.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),a("update:modelValue",e)}}),ne=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(W))},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(P)},e.toDisplayString(l.label),9,I)):e.createCommentVNode("",!0),e.createElementVNode("div",N,[l.$slots.before?(e.openBlock(),e.createElementBlock("div",_,[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(Y))))])):e.createCommentVNode("",!0),e.createElementVNode("div",A,[e.unref(M)?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(K)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(P),ref_key:"select",ref:p,"onUpdate:modelValue":o[0]||(o[0]=l=>e.isRef(te)?te.value=l:null)},e.unref(X)),[l.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!l.unselectable,hidden:!l.unselectable},e.toDisplayString(l.placeholder),9,F)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,((l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[ne(l)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${o}`,disabled:e.unref(le)(l),label:e.unref(Z)(l)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(oe)(l),((l,t)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${o}-item-${t}`,disabled:e.unref(le)(l),value:e.unref(ee)(l)},e.toDisplayString(e.unref(Z)(l)),9,q)))),128))],8,z)):(e.openBlock(),e.createElementBlock("option",{key:o,disabled:e.unref(le)(l),value:e.unref(ee)(l)},e.toDisplayString(e.unref(Z)(l)),9,j))],64)))),256))],16,C),[[e.vModelSelect,e.unref(te)]]),e.unref(T)?(e.openBlock(),e.createBlock(c,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(K)),null,16)):e.createCommentVNode("",!0)]),l.$slots.after?(e.openBlock(),e.createElementBlock("div",D,[e.renderSlot(l.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(Y))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(f),{id:e.unref(x),class:"vv-select__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(b))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(b))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(b))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(b))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("@iconify/vue"),require("nanoid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid","@vueuse/core","ts-dot-prop"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvSelect=o(e.vue,e.vue$1,e.nanoid,e.core,e.tsDotProp)}(this,(function(e,o,l,t,n){"use strict";const a={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 i=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(i||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{});const d=Symbol.for("volver");function s(){return e.inject(d)}function c(o,l,t){return e.computed((()=>{const n={[o]:!0},a="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${o}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((l=>{n[`${o}--${l}`]=e.unref(t.value[l])})),n}))}const v=e.defineComponent({name:"VvIcon",props:a,setup(l){const t=l,n=e.computed((()=>"string"==typeof t.rotate?parseFloat(t.rotate):t.rotate)),a=e.ref(!0),i=s(),{modifiers:r}=e.toRefs(t),u=c("vv-icon",r),d=e.computed((()=>t.provider||(null==i?void 0:i.iconsProvider))),v=e.computed((()=>{const e=t.name??"",l=`@${d.value}:${t.prefix}:${e}`;if(o.iconExists(l))return l;const n=null==i?void 0:i.iconsCollections.find((l=>{const t=`@${d.value}:${l.prefix}:${e}`;return o.iconExists(t)}));return n?`@${d.value}:${n.prefix}:${e}`:e}));function p(e){const l=function(e){let o;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");o=(new e).window}return(o?new o.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),n=(null==l?void 0:l.innerHTML.trim())||"";l&&n&&o.addIcon(`@${d.value}:${t.prefix}:${t.name}`,{body:n,height:l.viewBox.baseVal.height,width:l.viewBox.baseVal.width})}return i&&t.src&&!o.iconExists(`@${d.value}:${t.prefix}:${t.name}`)&&(a.value=!1,i.fetchIcon(t.src).then((e=>{e&&(p(e),a.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),t.svg&&p(t.svg),(l,t)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(o.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(n),color:l.color,onLoad:l.onLoad,icon:e.unref(v)}),null,16,["class"])):e.createCommentVNode("",!0)}});function p(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(o=e)||o instanceof String;var o})).join(" "):e}const f={valid:Boolean,validLabel:[String,Array]},m={invalid:Boolean,invalidLabel:[String,Array]},g={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},b={disabled:Boolean},h=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},S={modifiers:[String,Array]},B={hintLabel:{type:String,default:""}},k={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},L={icon:{type:[String,Object]},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},$={tabindex:{type:[String,Number],default:0}},V={floating:Boolean},O={unselectable:{type:Boolean,default:!0}},w={id:[String,Number]};i.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const E={...w,name:{type:String,required:!0}},P={autofocus:Boolean},x={autocomplete:{type:String,default:"off"}};u.button;const N={...E,...P,...x,...$,...f,...m,...B,...g,...b,...y,...S,...k,...L,...V,...O,...h,multiple:Boolean,required:Boolean,size:[String,Number],modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},placeholder:String};const I=["for"],A={class:"vv-select__wrapper"},_={key:0,class:"vv-select__input-before"},j={class:"vv-select__inner"},C=["id"],F=["disabled","hidden"],z=["disabled","value"],q=["disabled","label"],D=["disabled","value"],R={key:1,class:"vv-select__input-after"};return e.defineComponent({name:"VvSelect",props:N,emits:["update:modelValue","focus","blur"],setup(o,{emit:a}){const u=o,d=e.useSlots(),f=function(o,l,t){const n=s(),a=e.computed((()=>{var e;if(n&&(null==(e=n.defaults.value)?void 0:e[o]))return n.defaults.value[o]}));return e.computed((()=>{if(void 0===a.value)return t;const e=a.value,o=l,n=t;return Object.keys(o).reduce(((l,t)=>{const a=n[t];if(l[t]=a,t in e){if(Array.isArray(o[t])){const n=o[t];n.length&&n[0]===a&&(l[t]=e[t])}if("function"==typeof o[t]&&(0,o[t])()===a&&(l[t]=e[t]),"object"==typeof o[t]){let n=o[t].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(a)&&(l[t]=e[t]):n===a&&(l[t]=e[t])}}return l}),{})}))}("VvSelect",N,u),m=e.ref(),{HintSlot:g,hasHintLabelOrSlot:b,hasInvalidLabelOrSlot:h,hintSlotScope:y}=function(o,l){const t=e.unref(o),n=e.computed((()=>p(t.invalidLabel))),a=e.computed((()=>p(t.validLabel))),i=e.computed((()=>t.loadingLabel)),r=e.computed((()=>t.hintLabel)),u=e.computed((()=>Boolean(t.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(t.invalid&&(l.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(t.valid&&(l.valid||a.value)))),c=e.computed((()=>!u.value&&!d.value&&!s.value&&Boolean(l.hint||r.value))),v=e.computed((()=>d.value||s.value||u.value||c.value)),f=e.computed((()=>({modelValue:t.modelValue,valid:t.valid,invalid:t.invalid,loading:t.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:n,validLabel:a,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:c}),render(){var o,l,t,n,a,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=(o=this.$slots).loading)?void 0:l.call(o))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(t=this.$slots).invalid)?void 0:n.call(t))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(a=this.$slots).valid)?void 0:i.call(a))??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:d,hasHintLabelOrSlot:c,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:f,HintSlot:m}}(f,d),{id:S,modifiers:B,disabled:k,readonly:L,loading:$,icon:V,iconPosition:O,invalid:w,valid:E,floating:P,multiple:x}=e.toRefs(u),H=(o=>e.computed((()=>String((null==o?void 0:o.value)||l.nanoid()))))(S),K=e.computed((()=>`${H.value}-hint`)),{focused:M}=function(o,l){const{focused:n}=t.useFocus(o);return e.watch(n,(t=>{l(t?"focus":"blur",e.unref(o))})),{focused:n}}(m,a),T=t.useElementVisibility(m);e.watch(T,(e=>{e&&u.autofocus&&(M.value=!0)}));const{hasIcon:J,hasIconBefore:G,hasIconAfter:U}=function(o,l){const t=e.computed((()=>Boolean((null==o?void 0:o.value)&&l.value===r.before))),n=e.computed((()=>Boolean((null==o?void 0:o.value)&&l.value===r.after))),a=e.computed((()=>Boolean((null==o?void 0:o.value)&&l.value===i.left))),u=e.computed((()=>Boolean((null==o?void 0:o.value)&&l.value===i.right))),d=e.computed((()=>Boolean((null==o?void 0:o.value)&&l.value===i.top))),s=e.computed((()=>Boolean((null==o?void 0:o.value)&&l.value===i.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==o?void 0:o.value)?{name:null==o?void 0:o.value}:null==o?void 0:o.value)),hasIconLeft:a,hasIconRight:u,hasIconTop:d,hasIconBottom:s,hasIconBefore:t,hasIconAfter:n}}(V,O),Q=e.computed((()=>{return o=u.modelValue,!(null==(l=e.unref(o))||""===l||Array.isArray(l)&&0===l.length||!(l instanceof Date)&&"object"==typeof l&&0===Object.keys(l).length);var o,l})),W=e.computed((()=>u.disabled||u.readonly)),X=e.computed((()=>W.value?-1:u.tabindex)),Y=e.computed((()=>!0===u.invalid||!0!==u.valid&&void 0)),Z=c("vv-select",B,e.computed((()=>({valid:E.value,invalid:w.value,loading:$.value,disabled:k.value,readonly:L.value,"icon-before":G.value,"icon-after":U.value,dirty:Q.value,focus:M.value,floating:P.value,multiple:x.value})))),ee=e.computed((()=>({name:u.name,tabindex:X.value,disabled:W.value,required:u.required,size:u.size,autocomplete:u.autocomplete,multiple:u.multiple,"aria-invalid":Y.value,"aria-describedby":b.value?K.value:void 0,"aria-errormessage":h.value?K.value:void 0}))),oe=e.computed((()=>({valid:u.valid,invalid:u.invalid,modelValue:u.modelValue}))),{getOptionLabel:le,getOptionValue:te,getOptionDisabled:ne,getOptionGrouped:ae}=function(o){const{options:l,labelKey:t,valueKey:a,disabledKey:i}=e.toRefs(o);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof t.value?t.value(e):n.get(e,t.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):n.get(e,a.value),getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):n.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(u),ie=e.computed({get:()=>u.modelValue,set:e=>{Array.isArray(e)&&(e=e.filter((e=>void 0!==e))),a("update:modelValue",e)}}),re=e=>"string"!=typeof e&&(e&&e.options&&e.options.length>0);return(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Z))},[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(H)},e.toDisplayString(o.label),9,I)):e.createCommentVNode("",!0),e.createElementVNode("div",A,[o.$slots.before?(e.openBlock(),e.createElementBlock("div",_,[e.renderSlot(o.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(oe))))])):e.createCommentVNode("",!0),e.createElementVNode("div",j,[e.unref(G)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:0,class:"vv-select__icon"},e.unref(J)),null,16)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("select",e.mergeProps({id:e.unref(H),ref_key:"select",ref:m,"onUpdate:modelValue":l[0]||(l[0]=o=>e.isRef(ie)?ie.value=o:null)},e.unref(ee)),[o.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:void 0,disabled:!o.unselectable,hidden:!o.unselectable},e.toDisplayString(o.placeholder),9,F)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options,((o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[re(o)?(e.openBlock(),e.createElementBlock("optgroup",{key:`group-${l}`,disabled:e.unref(ne)(o),label:e.unref(le)(o)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ae)(o),((o,t)=>(e.openBlock(),e.createElementBlock("option",{key:`group-${l}-item-${t}`,disabled:e.unref(ne)(o),value:e.unref(te)(o)},e.toDisplayString(e.unref(le)(o)),9,D)))),128))],8,q)):(e.openBlock(),e.createElementBlock("option",{key:l,disabled:e.unref(ne)(o),value:e.unref(te)(o)},e.toDisplayString(e.unref(le)(o)),9,z))],64)))),256))],16,C),[[e.vModelSelect,e.unref(ie)]]),e.unref(U)?(e.openBlock(),e.createBlock(v,e.mergeProps({key:1,class:"vv-select__icon vv-select__icon-after"},e.unref(J)),null,16)):e.createCommentVNode("",!0)]),o.$slots.after?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(o.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(oe))))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(g),{id:e.unref(K),class:"vv-select__hint"},e.createSlots({_:2},[o.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(o.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"0"}:void 0,o.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(o.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"1"}:void 0,o.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(o.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"2"}:void 0,o.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(o.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
@@ -172,25 +172,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
172
172
  modelValue: string | number | boolean | unknown[] | Record<string, any> | undefined;
173
173
  }): any;
174
174
  hint?(_: {
175
- modelValue: any;
175
+ modelValue: unknown;
176
176
  valid: boolean;
177
177
  invalid: boolean;
178
178
  loading: boolean;
179
179
  }): any;
180
180
  loading?(_: {
181
- modelValue: any;
181
+ modelValue: unknown;
182
182
  valid: boolean;
183
183
  invalid: boolean;
184
184
  loading: boolean;
185
185
  }): any;
186
186
  valid?(_: {
187
- modelValue: any;
187
+ modelValue: unknown;
188
188
  valid: boolean;
189
189
  invalid: boolean;
190
190
  loading: boolean;
191
191
  }): any;
192
192
  invalid?(_: {
193
- modelValue: any;
193
+ modelValue: unknown;
194
194
  valid: boolean;
195
195
  invalid: boolean;
196
196
  loading: boolean;