@volverjs/ui-vue 0.0.10-beta.17 → 0.0.10-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-imports.d.ts +3 -2
- package/bin/icons.js +1 -1
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +2 -1
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +4 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +2 -2
- package/dist/components/VvAction/VvAction.es.js +2 -1
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +3 -2
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +1 -1
- package/dist/components/VvAlert/index.d.ts +2 -2
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +5 -3
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +2 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +5 -3
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +7 -7
- package/dist/components/VvButton/index.d.ts +3 -3
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +2 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +2 -1
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +7 -7
- package/dist/components/VvCheckbox/index.d.ts +3 -3
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +4 -2
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +3 -3
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +11 -6
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +3 -3
- package/dist/components/VvCombobox/index.d.ts +1 -1
- package/dist/components/VvDialog/VvDialog.es.js +60 -54
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +2 -1
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +1 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +2 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +1 -1
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -103
- package/dist/components/VvInputFile/VvInputFile.es.js +59 -51
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +1 -1
- package/dist/components/VvInputText/VvInputClearAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +48 -42
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +3 -3
- package/dist/components/VvInputText/index.d.ts +1 -1
- package/dist/components/VvNav/VvNav.es.js +7 -6
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +2 -1
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +2 -1
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +5 -5
- package/dist/components/VvRadio/index.d.ts +2 -2
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +4 -2
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +3 -3
- package/dist/components/VvRadioGroup/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +3 -2
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +3 -3
- package/dist/components/VvSelect/index.d.ts +1 -1
- package/dist/components/VvTab/VvTab.es.js +9 -7
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +2 -2
- package/dist/components/VvTextarea/VvTextarea.es.js +3 -2
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +5 -5
- package/dist/components/VvTextarea/index.d.ts +2 -2
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +1 -1
- package/dist/components/index.es.js +238 -204
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +37 -4
- package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
- package/dist/composables/index.es.js +14 -3
- package/dist/composables/index.umd.js +1 -1
- package/dist/directives/index.d.ts +3 -3
- package/dist/directives/index.es.js +3 -3
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +1 -1
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +6 -6
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +62 -0
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +5 -5
- package/dist/resolvers/unplugin.es.js +59 -6
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +59 -117
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +519 -661
- package/dist/utils/ObjectUtilities.d.ts +0 -1
- package/package.json +53 -53
- package/src/Volver.ts +9 -4
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/directives/index.ts +3 -3
- package/src/resolvers/unplugin.ts +3 -13
- package/src/utils/ObjectUtilities.ts +0 -11
|
@@ -14,15 +14,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
14
14
|
default: boolean;
|
|
15
15
|
};
|
|
16
16
|
value: {
|
|
17
|
-
type: (
|
|
17
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
18
18
|
default: undefined;
|
|
19
19
|
};
|
|
20
20
|
uncheckedValue: {
|
|
21
|
-
type: (
|
|
21
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
22
22
|
default: undefined;
|
|
23
23
|
};
|
|
24
24
|
modelValue: {
|
|
25
|
-
type: (
|
|
25
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
26
26
|
default: undefined;
|
|
27
27
|
};
|
|
28
28
|
icon: {
|
|
@@ -100,7 +100,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
100
100
|
$el: globalThis.ComputedRef<HTMLElement | undefined>;
|
|
101
101
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
102
102
|
[x: string]: (...args: any[]) => void;
|
|
103
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<
|
|
103
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
|
|
104
104
|
iconPosition: {
|
|
105
105
|
type: globalThis.PropType<"left" | "right" | "top" | "bottom">;
|
|
106
106
|
default: Side;
|
|
@@ -115,15 +115,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
115
115
|
default: boolean;
|
|
116
116
|
};
|
|
117
117
|
value: {
|
|
118
|
-
type: (
|
|
118
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
119
119
|
default: undefined;
|
|
120
120
|
};
|
|
121
121
|
uncheckedValue: {
|
|
122
|
-
type: (
|
|
122
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
123
123
|
default: undefined;
|
|
124
124
|
};
|
|
125
125
|
modelValue: {
|
|
126
|
-
type: (
|
|
126
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
127
127
|
default: undefined;
|
|
128
128
|
};
|
|
129
129
|
icon: {
|
|
@@ -29,21 +29,21 @@ export declare const VvButtonProps: {
|
|
|
29
29
|
* Button toggle value
|
|
30
30
|
*/
|
|
31
31
|
value: {
|
|
32
|
-
type: (
|
|
32
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
33
33
|
default: undefined;
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
36
|
* Value associated with the unchecked state
|
|
37
37
|
*/
|
|
38
38
|
uncheckedValue: {
|
|
39
|
-
type: (
|
|
39
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
40
40
|
default: undefined;
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
43
|
* Button toggle model value
|
|
44
44
|
*/
|
|
45
45
|
modelValue: {
|
|
46
|
-
type: (
|
|
46
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
47
47
|
default: undefined;
|
|
48
48
|
};
|
|
49
49
|
icon: {
|
|
@@ -337,7 +337,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
337
337
|
...__default__,
|
|
338
338
|
props: VvButtonGroupProps,
|
|
339
339
|
emits: VvButtonGroupEvents,
|
|
340
|
-
setup(__props, { emit }) {
|
|
340
|
+
setup(__props, { emit: __emit }) {
|
|
341
|
+
const emit = __emit;
|
|
341
342
|
const props = __props;
|
|
342
343
|
const {
|
|
343
344
|
disabled,
|
|
@@ -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).VvButtonGroup=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||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});const u=Symbol.for("buttonGroup"),n={disabled:{type:Boolean,default:!1}},a=(Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});t.before;const i={unselectable:{type:Boolean,default:!0}};o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,l.button,r.button;const s={...a,...n,...i,itemModifiers:{type:[String,Array],default:""},toggle:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:[String,Number,Boolean,Array],default:void 0}};return e.defineComponent({name:"VvButtonGroup",props:s,emits:["update:modelValue"],setup(o,{emit:t}){const l=o,{disabled:
|
|
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).VvButtonGroup=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||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});const u=Symbol.for("buttonGroup"),n={disabled:{type:Boolean,default:!1}},a=(Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});t.before;const i={unselectable:{type:Boolean,default:!0}};o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,l.button,r.button;const s={...a,...n,...i,itemModifiers:{type:[String,Array],default:""},toggle:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:[String,Number,Boolean,Array],default:void 0}};return e.defineComponent({name:"VvButtonGroup",props:s,emits:["update:modelValue"],setup(o,{emit:t}){const l=t,r=o,{disabled:n,toggle:a,modifiers:i,multiple:s,unselectable:d,itemModifiers:f}=e.toRefs(r);e.watchEffect((()=>{"string"==typeof r.modelValue&&s.value&&console.warn("[VvButtonGroup]: modelValue is a string but multiple is true.")}));const p=e.computed({get:()=>s.value?r.modelValue:Array.isArray(r.modelValue)?r.modelValue[0]:r.modelValue,set:e=>void 0===e||!Array.isArray(r.modelValue)&&!s.value||Array.isArray(e)?l("update:modelValue",e):l("update:modelValue",[e])});!function(o){if(Object.keys(o).some((t=>"key"!==t&&!e.isRef(o[t]))))throw Error("One or more groupState props aren't ref.");e.provide(o.key,e.computed((()=>o)))}({key:u,modelValue:p,disabled:n,toggle:a,multiple:s,unselectable:d,modifiers:f});const m=function(o,t,l){return e.computed((()=>{const r={[o]:!0},u="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return u&&Array.isArray(u)&&u.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((t=>{r[`${o}--${t}`]=e.unref(l.value[t])})),r}))}("vv-button-group",i);return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m)),role:"group"},[e.renderSlot(o.$slots,"default")],2))}})}));
|
|
@@ -29,7 +29,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
29
29
|
};
|
|
30
30
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
31
|
[x: string]: (...args: any[]) => void;
|
|
32
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<
|
|
32
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
|
|
33
33
|
itemModifiers: {
|
|
34
34
|
type: globalThis.PropType<string | string[]>;
|
|
35
35
|
default: string;
|
|
@@ -4,7 +4,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
4
4
|
type: globalThis.PropType<string | string[]>;
|
|
5
5
|
default: undefined;
|
|
6
6
|
};
|
|
7
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<
|
|
7
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
|
|
8
8
|
title: StringConstructor;
|
|
9
9
|
modifiers: {
|
|
10
10
|
type: globalThis.PropType<string | string[]>;
|
|
@@ -749,8 +749,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
749
749
|
...__default__,
|
|
750
750
|
props: VvCheckboxProps,
|
|
751
751
|
emits: VvCheckboxEvents,
|
|
752
|
-
setup(__props, { emit }) {
|
|
752
|
+
setup(__props, { emit: __emit }) {
|
|
753
753
|
const props = __props;
|
|
754
|
+
const emit = __emit;
|
|
754
755
|
const slots = useSlots();
|
|
755
756
|
const propsDefaults = useDefaults(
|
|
756
757
|
"VvCheckbox",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=t(e.vue,e.uid)}(this,(function(e,t){"use strict";var l=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),o=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(o||{});const i=Symbol.for("volver"),r=Symbol.for("checkGroup"),u={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},d={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},s={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},v={disabled:{type:Boolean,default:!1}},c=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),f={readonly:{type:Boolean,default:!1}},p={modifiers:{type:[String,Array],default:void 0}},b={hintLabel:{type:String,default:""}};a.before;const h={tabindex:{type:[String,Number],default:0}},m={id:[String,Number]};l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const y={...{...m,name:{type:String,required:!0}},...h,...u,...d,...b,...v,...f,...p,...c,...s,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}};function g(e,t,l){return l?L(e,l)===L(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),a=Array.isArray(t);let n,o,i;if(l&&a){if(o=e.length,o!=t.length)return!1;for(n=o;0!=n--;)if(!S(e[n],t[n]))return!1;return!0}if(l!=a)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,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const v=Object.keys(e);if(o=v.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,v[n]))return!1;for(n=o;0!=n--;)if(i=v[n],!S(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function L(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let a=e;for(let t=0,n=l.length;t<n;++t){if(null==e)return null;a=a[l[t]]}return a}}return null}function k(t){const l=e.inject(t,void 0),a=e.computed((()=>{return t=l,!(null==(a=e.unref(t))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var t,a}));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,n){if(null==l?void 0:l.value){const a=e.unref(l.value)[t];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const o=e.toRef(a,t);return e.computed({get:()=>o.value,set(e){n&&n(`update:${t}`,e)}})}}}n.button,o.button;const B={...y,...p,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function O(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function x(t,l,a){const n=e.inject(i),o=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===o.value)return a;const e=o.value,t=l,n=a;return Object.keys(t).reduce(((l,a)=>{const o=n[a];if(l[a]=o,a in e){if(Array.isArray(t[a])){const n=t[a];if(n.length){n[0]===o&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===o&&(l[a]=e[a])}if("object"==typeof t[a]){let n=t[a].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(o)&&(l[a]=e[a]):n===o&&(l[a]=e[a])}}return l}),{})}))}const V=["for"],A=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:B,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const n=l,o=e.useSlots(),
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=t(e.vue,e.uid)}(this,(function(e,t){"use strict";var l=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),o=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(o||{});const i=Symbol.for("volver"),r=Symbol.for("checkGroup"),u={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},d={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},s={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},v={disabled:{type:Boolean,default:!1}},c=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),f={readonly:{type:Boolean,default:!1}},p={modifiers:{type:[String,Array],default:void 0}},b={hintLabel:{type:String,default:""}};a.before;const h={tabindex:{type:[String,Number],default:0}},m={id:[String,Number]};l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const y={...{...m,name:{type:String,required:!0}},...h,...u,...d,...b,...v,...f,...p,...c,...s,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}};function g(e,t,l){return l?L(e,l)===L(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),a=Array.isArray(t);let n,o,i;if(l&&a){if(o=e.length,o!=t.length)return!1;for(n=o;0!=n--;)if(!S(e[n],t[n]))return!1;return!0}if(l!=a)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,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const v=Object.keys(e);if(o=v.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,v[n]))return!1;for(n=o;0!=n--;)if(i=v[n],!S(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function L(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let a=e;for(let t=0,n=l.length;t<n;++t){if(null==e)return null;a=a[l[t]]}return a}}return null}function k(t){const l=e.inject(t,void 0),a=e.computed((()=>{return t=l,!(null==(a=e.unref(t))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var t,a}));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,n){if(null==l?void 0:l.value){const a=e.unref(l.value)[t];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const o=e.toRef(a,t);return e.computed({get:()=>o.value,set(e){n&&n(`update:${t}`,e)}})}}}n.button,o.button;const B={...y,...p,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function O(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}function x(t,l,a){const n=e.inject(i),o=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===o.value)return a;const e=o.value,t=l,n=a;return Object.keys(t).reduce(((l,a)=>{const o=n[a];if(l[a]=o,a in e){if(Array.isArray(t[a])){const n=t[a];if(n.length){n[0]===o&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===o&&(l[a]=e[a])}if("object"==typeof t[a]){let n=t[a].default;"function"==typeof n&&(n=n()),"object"==typeof n?JSON.stringify(n)===JSON.stringify(o)&&(l[a]=e[a]):n===o&&(l[a]=e[a])}}return l}),{})}))}const V=["for"],A=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:B,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const n=l,o=a,i=e.useSlots(),u=x("VvCheckbox",B,n),{id:d,disabled:s,readonly:v,valid:c,invalid:f,propsSwitch:p,modelValue:b,indeterminate:h,isInGroup:m}=function(t,l){const{group:a,isInGroup:n,getGroupOrLocalRef:o}=k(r),{id:i,switch:u,indeterminate:d}=e.toRefs(t),s=o("modelValue",t,l),v=o("valid",t),c=o("invalid",t),f=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:u,indeterminate:d,group:a,isInGroup:n,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(n,o),y=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(d),S=e.computed((()=>`${y.value}-hint`)),L=e.computed((()=>w.value?-1:n.tabindex)),$=e.ref(),j=e.computed((()=>void 0!==n.uncheckedValue&&!m.value)),w=e.computed((()=>s.value||v.value)),R=e.computed((()=>!0===f.value||!0!==c.value&&void 0)),C=e.computed((()=>j.value?b.value===n.value:Array.isArray(b.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(g(e,l))return!0;return!1}(n.value,b.value):g(n.value,b.value))),N=e.computed((()=>!!h.value||!(C.value||!j.value||n.uncheckedValue===b.value))),I=e.computed((()=>{if(!j.value)return!["string","number","boolean"].includes(typeof n.value)||n.value})),P=e.computed({get:()=>C.value,set(e){if(j.value)b.value=e?n.value:n.uncheckedValue;else if(Array.isArray(b.value)||m.value){const t=new Set(Array.isArray(b.value)?b.value:void 0!==b.value?[b.value]:[]);e?t.add(n.value):t.delete(n.value),b.value=[...t]}else b.value=e?n.value:void 0;o("change",e)}}),{modifiers:E}=e.toRefs(n),G=function(t,l,a){return e.computed((()=>{const n={[t]:!0},o="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{n[`${t}--${l}`]=e.unref(a.value[l])})),n}))}("vv-checkbox",E,e.computed((()=>({switch:p.value,valid:c.value,invalid:f.value,disabled:s.value,readonly:v.value,indeterminate:h.value}))));e.watchEffect((()=>{j.value&&Array.isArray(b.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>N.value),(e=>{$.value.indeterminate=!!e})),e.onMounted((()=>{N.value&&($.value.indeterminate=!0)}));const{HintSlot:H,hasHintLabelOrSlot:T,hasInvalidLabelOrSlot:_,hintSlotScope:z}=function(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),n=e.computed((()=>O(a.value.invalidLabel))),o=e.computed((()=>O(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(l.invalid||n.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(l.valid||o.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)),f=e.computed((()=>({modelValue:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:n,validLabel:o,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,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==(l=(t=this.$slots).loading)?void 0:l.call(t))??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:f,HintSlot:p}}(u,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(G)),for:e.unref(y)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(y),ref_key:"input",ref:$,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(P)?P.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(w),value:e.unref(I),tabindex:e.unref(L),"aria-invalid":e.unref(R),"aria-describedby":e.unref(T)?e.unref(S):void 0,"aria-errormessage":e.unref(_)?e.unref(S):void 0},null,8,A),[[e.vModelCheckbox,e.unref(P)]]),e.renderSlot(t.$slots,"default",{value:e.unref(b)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(H),{id:e.unref(S),class:"vv-checkbox__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,V))}})}));
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
2
|
indeterminate: BooleanConstructor;
|
|
3
|
-
uncheckedValue: (
|
|
3
|
+
uncheckedValue: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
4
4
|
switch: BooleanConstructor;
|
|
5
5
|
modifiers: {
|
|
6
6
|
type: globalThis.PropType<string | string[]>;
|
|
7
7
|
default: undefined;
|
|
8
8
|
};
|
|
9
9
|
value: {
|
|
10
|
-
type: (
|
|
10
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
11
11
|
default: undefined;
|
|
12
12
|
};
|
|
13
13
|
modelValue: {
|
|
14
|
-
type: (ObjectConstructor |
|
|
14
|
+
type: (ObjectConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
15
15
|
default: undefined;
|
|
16
16
|
};
|
|
17
17
|
loading: {
|
|
@@ -65,20 +65,20 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
65
65
|
id: (StringConstructor | NumberConstructor)[];
|
|
66
66
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
67
67
|
[x: string]: (...args: any[]) => void;
|
|
68
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<
|
|
68
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
|
|
69
69
|
indeterminate: BooleanConstructor;
|
|
70
|
-
uncheckedValue: (
|
|
70
|
+
uncheckedValue: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
71
71
|
switch: BooleanConstructor;
|
|
72
72
|
modifiers: {
|
|
73
73
|
type: globalThis.PropType<string | string[]>;
|
|
74
74
|
default: undefined;
|
|
75
75
|
};
|
|
76
76
|
value: {
|
|
77
|
-
type: (
|
|
77
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
78
78
|
default: undefined;
|
|
79
79
|
};
|
|
80
80
|
modelValue: {
|
|
81
|
-
type: (ObjectConstructor |
|
|
81
|
+
type: (ObjectConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
82
82
|
default: undefined;
|
|
83
83
|
};
|
|
84
84
|
loading: {
|
|
@@ -8,7 +8,7 @@ export declare const VvCheckboxProps: {
|
|
|
8
8
|
/**
|
|
9
9
|
* Value associated with the unchecked state
|
|
10
10
|
*/
|
|
11
|
-
uncheckedValue: (
|
|
11
|
+
uncheckedValue: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
12
12
|
/**
|
|
13
13
|
* If true, the input will be displayed as a switch
|
|
14
14
|
*/
|
|
@@ -18,11 +18,11 @@ export declare const VvCheckboxProps: {
|
|
|
18
18
|
default: undefined;
|
|
19
19
|
};
|
|
20
20
|
value: {
|
|
21
|
-
type: (
|
|
21
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
22
22
|
default: undefined;
|
|
23
23
|
};
|
|
24
24
|
modelValue: {
|
|
25
|
-
type: (ObjectConstructor |
|
|
25
|
+
type: (ObjectConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
26
26
|
default: undefined;
|
|
27
27
|
};
|
|
28
28
|
loading: {
|
|
@@ -801,8 +801,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
801
801
|
...__default__$1,
|
|
802
802
|
props: VvCheckboxProps,
|
|
803
803
|
emits: VvCheckboxEvents,
|
|
804
|
-
setup(__props, { emit }) {
|
|
804
|
+
setup(__props, { emit: __emit }) {
|
|
805
805
|
const props = __props;
|
|
806
|
+
const emit = __emit;
|
|
806
807
|
const slots = useSlots();
|
|
807
808
|
const propsDefaults = useDefaults(
|
|
808
809
|
"VvCheckbox",
|
|
@@ -1044,8 +1045,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1044
1045
|
...__default__,
|
|
1045
1046
|
props: VvCheckboxGroupProps,
|
|
1046
1047
|
emits: VvCheckboxGroupEvents,
|
|
1047
|
-
setup(__props, { emit }) {
|
|
1048
|
+
setup(__props, { emit: __emit }) {
|
|
1048
1049
|
const props = __props;
|
|
1050
|
+
const emit = __emit;
|
|
1049
1051
|
const slots = useSlots();
|
|
1050
1052
|
const propsDefaults = useDefaults(
|
|
1051
1053
|
"VvCheckboxGroup",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=t(e.vue,e.uid,e.core,e.tsDotProp)}(this,(function(e,t,l,a){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});const u=Symbol.for("volver"),d=Symbol.for("checkGroup");function s(e,t,l){return l?c(e,l)===c(t,l):v(e,t)}function v(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),a=Array.isArray(t);let o,n,i;if(l&&a){if(n=e.length,n!=t.length)return!1;for(o=n;0!=o--;)if(!v(e[o],t[o]))return!1;return!0}if(l!=a)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,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const c=Object.keys(e);if(n=c.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,c[o]))return!1;for(o=n;0!=o--;)if(i=c[o],!v(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function c(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let a=e;for(let t=0,o=l.length;t<o;++t){if(null==e)return null;a=a[l[t]]}return a}}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 p(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),o=e.computed((()=>f(a.value.invalidLabel))),n=e.computed((()=>f(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(l.invalid||o.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(l.valid||n.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:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),b=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:o,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,a,o,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==(o=(a=this.$slots).invalid)?void 0:o.call(a))??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:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:b}}const b={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},m={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},y={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},h={disabled:{type:Boolean,default:!1}},g=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),S={readonly:{type:Boolean,default:!1}},k={modifiers:{type:[String,Array],default:void 0}},L={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"}};n.before;const O={tabindex:{type:[String,Number],default:0}},V={id:[String,Number]};o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const x={...{...V,name:{type:String,required:!0}},...O,...b,...m,...L,...h,...S,...k,...g,...y,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},$={...b,...m,...B,...L,...h,...S,...k,...g,...y,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}};function A(t){const l=e.inject(t,void 0),a=e.computed((()=>{return t=l,!(null==(a=e.unref(t))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var t,a}));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,o){if(null==l?void 0:l.value){const a=e.unref(l.value)[t];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const n=e.toRef(a,t);return e.computed({get:()=>n.value,set(e){o&&o(`update:${t}`,e)}})}}}i.button,r.button;const C={...x,...k,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function j(t,l,a){const o=e.inject(u),n=e.computed((()=>{var e;if(o&&(null==(e=o.defaults.value)?void 0:e[t]))return o.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return a;const e=n.value,t=l,o=a;return Object.keys(t).reduce(((l,a)=>{const n=o[a];if(l[a]=n,a in e){if(Array.isArray(t[a])){const o=t[a];if(o.length){o[0]===n&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===n&&(l[a]=e[a])}if("object"==typeof t[a]){let o=t[a].default;"function"==typeof o&&(o=o()),"object"==typeof o?JSON.stringify(o)===JSON.stringify(n)&&(l[a]=e[a]):o===n&&(l[a]=e[a])}}return l}),{})}))}function w(t,l,a){return e.computed((()=>{const o={[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&&(o[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{o[`${t}--${l}`]=e.unref(a.value[l])})),o}))}const R=["for"],P=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],N=e.defineComponent({name:"VvCheckbox",props:C,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const o=l,n=e.useSlots(),i=j("VvCheckbox",C,o),{id:r,disabled:u,readonly:v,valid:c,invalid:f,propsSwitch:b,modelValue:m,indeterminate:y,isInGroup:h}=function(t,l){const{group:a,isInGroup:o,getGroupOrLocalRef:n}=A(d),{id:i,switch:r,indeterminate:u}=e.toRefs(t),s=n("modelValue",t,l),v=n("valid",t),c=n("invalid",t),f=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:r,indeterminate:u,group:a,isInGroup:o,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(o,a),g=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(r),S=e.computed((()=>`${g.value}-hint`)),k=e.computed((()=>O.value?-1:o.tabindex)),L=e.ref(),B=e.computed((()=>void 0!==o.uncheckedValue&&!h.value)),O=e.computed((()=>u.value||v.value)),V=e.computed((()=>!0===f.value||!0!==c.value&&void 0)),x=e.computed((()=>B.value?m.value===o.value:Array.isArray(m.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(s(e,l))return!0;return!1}(o.value,m.value):s(o.value,m.value))),$=e.computed((()=>!!y.value||!(x.value||!B.value||o.uncheckedValue===m.value))),N=e.computed((()=>{if(!B.value)return!["string","number","boolean"].includes(typeof o.value)||o.value})),E=e.computed({get:()=>x.value,set(e){if(B.value)m.value=e?o.value:o.uncheckedValue;else if(Array.isArray(m.value)||h.value){const t=new Set(Array.isArray(m.value)?m.value:void 0!==m.value?[m.value]:[]);e?t.add(o.value):t.delete(o.value),m.value=[...t]}else m.value=e?o.value:void 0;a("change",e)}}),{modifiers:_}=e.toRefs(o),z=w("vv-checkbox",_,e.computed((()=>({switch:b.value,valid:c.value,invalid:f.value,disabled:u.value,readonly:v.value,indeterminate:y.value}))));e.watchEffect((()=>{B.value&&Array.isArray(m.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>$.value),(e=>{L.value.indeterminate=!!e})),e.onMounted((()=>{$.value&&(L.value.indeterminate=!0)}));const{HintSlot:G,hasHintLabelOrSlot:I,hasInvalidLabelOrSlot:D,hintSlotScope:H}=p(i,n);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(z)),for:e.unref(g)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(g),ref_key:"input",ref:L,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(E)?E.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(O),value:e.unref(N),tabindex:e.unref(k),"aria-invalid":e.unref(V),"aria-describedby":e.unref(I)?e.unref(S):void 0,"aria-errormessage":e.unref(D)?e.unref(S):void 0},null,8,P),[[e.vModelCheckbox,e.unref(E)]]),e.renderSlot(t.$slots,"default",{value:e.unref(m)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(G),{id:e.unref(S),class:"vv-checkbox__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(H))))])),key:"3"}:void 0]),1032,["id"])],10,R))}}),E=$;const _=["textContent"],z={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:E,emits:["update:modelValue","change"],setup(t,{emit:o}){const n=t,i=e.useSlots(),r=j("VvCheckboxGroup",E,n),u=l.useVModel(n,"modelValue",o),{disabled:s,readonly:v,vertical:c,valid:f,invalid:b,modifiers:m}=e.toRefs(n);!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:d,modelValue:u,disabled:s,readonly:v,valid:f,invalid:b});const{getOptionLabel:y,getOptionValue:h}=function(t){const{options:l,labelKey:o,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof o.value?o.value(e):a.get(e,o.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):a.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):a.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),g=w("vv-checkbox-group",m,e.computed((()=>({disabled:s.value,readonly:v.value,horizontal:!c.value,valid:f.value,invalid:b.value})))),{HintSlot:S,hintSlotScope:k}=p(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(g))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,_)):e.createCommentVNode("v-if",!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:`${n.name}_opt${t}`,name:n.name,label:y(e),value:h(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(S),{class:"vv-checkbox-group__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(k))))])),key:"3"}:void 0]),1024)],2))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("uid"),require("@vueuse/core"),require("ts-dot-prop")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core","ts-dot-prop"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=t(e.vue,e.uid,e.core,e.tsDotProp)}(this,(function(e,t,l,a){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});const u=Symbol.for("volver"),d=Symbol.for("checkGroup");function s(e,t,l){return l?c(e,l)===c(t,l):v(e,t)}function v(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const l=Array.isArray(e),a=Array.isArray(t);let o,n,i;if(l&&a){if(n=e.length,n!=t.length)return!1;for(o=n;0!=o--;)if(!v(e[o],t[o]))return!1;return!0}if(l!=a)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,s=t instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==t.toString();const c=Object.keys(e);if(n=c.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,c[o]))return!1;for(o=n;0!=o--;)if(i=c[o],!v(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function c(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const l=t.split(".");let a=e;for(let t=0,o=l.length;t<o;++t){if(null==e)return null;a=a[l[t]]}return a}}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 p(t,l){const a=e.computed((()=>e.isRef(t)?t.value:t)),o=e.computed((()=>f(a.value.invalidLabel))),n=e.computed((()=>f(a.value.validLabel))),i=e.computed((()=>a.value.loadingLabel)),r=e.computed((()=>a.value.hintLabel)),u=e.computed((()=>Boolean(a.value.loading&&(l.loading||i.value)))),d=e.computed((()=>!u.value&&Boolean(a.value.invalid&&(l.invalid||o.value)))),s=e.computed((()=>!u.value&&!d.value&&Boolean(a.value.valid&&(l.valid||n.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:a.value.modelValue,valid:a.value.valid,invalid:a.value.invalid,loading:a.value.loading}))),b=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:o,validLabel:n,loadingLabel:i,hintLabel:r,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hasHintLabelOrSlot:v}),render(){var t,l,a,o,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==(o=(a=this.$slots).invalid)?void 0:o.call(a))??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:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:s,hasLoadingLabelOrSlot:u,hintSlotScope:p,HintSlot:b}}const b={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},m={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},y={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},h={disabled:{type:Boolean,default:!1}},g=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),S={readonly:{type:Boolean,default:!1}},k={modifiers:{type:[String,Array],default:void 0}},L={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"}};n.before;const O={tabindex:{type:[String,Number],default:0}},V={id:[String,Number]};o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const x={...{...V,name:{type:String,required:!0}},...O,...b,...m,...L,...h,...S,...k,...g,...y,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},$={...b,...m,...B,...L,...h,...S,...k,...g,...y,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}};function A(t){const l=e.inject(t,void 0),a=e.computed((()=>{return t=l,!(null==(a=e.unref(t))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var t,a}));return{group:l,isInGroup:a,getGroupOrLocalRef:function(t,a,o){if(null==l?void 0:l.value){const a=e.unref(l.value)[t];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const n=e.toRef(a,t);return e.computed({get:()=>n.value,set(e){o&&o(`update:${t}`,e)}})}}}i.button,r.button;const C={...x,...k,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function j(t,l,a){const o=e.inject(u),n=e.computed((()=>{var e;if(o&&(null==(e=o.defaults.value)?void 0:e[t]))return o.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return a;const e=n.value,t=l,o=a;return Object.keys(t).reduce(((l,a)=>{const n=o[a];if(l[a]=n,a in e){if(Array.isArray(t[a])){const o=t[a];if(o.length){o[0]===n&&(l[a]=e[a])}}if("function"==typeof t[a]){(0,t[a])()===n&&(l[a]=e[a])}if("object"==typeof t[a]){let o=t[a].default;"function"==typeof o&&(o=o()),"object"==typeof o?JSON.stringify(o)===JSON.stringify(n)&&(l[a]=e[a]):o===n&&(l[a]=e[a])}}return l}),{})}))}function w(t,l,a){return e.computed((()=>{const o={[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&&(o[`${t}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((l=>{o[`${t}--${l}`]=e.unref(a.value[l])})),o}))}const R=["for"],P=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],N=e.defineComponent({name:"VvCheckbox",props:C,emits:["click","update:modelValue","change","blur"],setup(l,{emit:a}){const o=l,n=a,i=e.useSlots(),r=j("VvCheckbox",C,o),{id:u,disabled:v,readonly:c,valid:f,invalid:b,propsSwitch:m,modelValue:y,indeterminate:h,isInGroup:g}=function(t,l){const{group:a,isInGroup:o,getGroupOrLocalRef:n}=A(d),{id:i,switch:r,indeterminate:u}=e.toRefs(t),s=n("modelValue",t,l),v=n("valid",t),c=n("invalid",t),f=e.computed((()=>{var e;return Boolean(t.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:r,indeterminate:u,group:a,isInGroup:o,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(o,n),S=(l=>e.computed((()=>String((null==l?void 0:l.value)||t.uid()))))(u),k=e.computed((()=>`${S.value}-hint`)),L=e.computed((()=>V.value?-1:o.tabindex)),B=e.ref(),O=e.computed((()=>void 0!==o.uncheckedValue&&!g.value)),V=e.computed((()=>v.value||c.value)),x=e.computed((()=>!0===b.value||!0!==f.value&&void 0)),$=e.computed((()=>O.value?y.value===o.value:Array.isArray(y.value)?function(e,t){if(null!=e&&t&&t.length)for(const l of t)if(s(e,l))return!0;return!1}(o.value,y.value):s(o.value,y.value))),N=e.computed((()=>!!h.value||!($.value||!O.value||o.uncheckedValue===y.value))),E=e.computed((()=>{if(!O.value)return!["string","number","boolean"].includes(typeof o.value)||o.value})),_=e.computed({get:()=>$.value,set(e){if(O.value)y.value=e?o.value:o.uncheckedValue;else if(Array.isArray(y.value)||g.value){const t=new Set(Array.isArray(y.value)?y.value:void 0!==y.value?[y.value]:[]);e?t.add(o.value):t.delete(o.value),y.value=[...t]}else y.value=e?o.value:void 0;n("change",e)}}),{modifiers:z}=e.toRefs(o),G=w("vv-checkbox",z,e.computed((()=>({switch:m.value,valid:f.value,invalid:b.value,disabled:v.value,readonly:c.value,indeterminate:h.value}))));e.watchEffect((()=>{O.value&&Array.isArray(y.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>N.value),(e=>{B.value.indeterminate=!!e})),e.onMounted((()=>{N.value&&(B.value.indeterminate=!0)}));const{HintSlot:I,hasHintLabelOrSlot:D,hasInvalidLabelOrSlot:H,hintSlotScope:q}=p(r,i);return(t,l)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(G)),for:e.unref(S)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(S),ref_key:"input",ref:B,"onUpdate:modelValue":l[0]||(l[0]=t=>e.isRef(_)?_.value=t:null),type:"checkbox",class:"vv-checkbox__input",name:t.name,disabled:e.unref(V),value:e.unref(E),tabindex:e.unref(L),"aria-invalid":e.unref(x),"aria-describedby":e.unref(D)?e.unref(k):void 0,"aria-errormessage":e.unref(H)?e.unref(k):void 0},null,8,P),[[e.vModelCheckbox,e.unref(_)]]),e.renderSlot(t.$slots,"default",{value:e.unref(y)},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)])),e.createVNode(e.unref(I),{id:e.unref(k),class:"vv-checkbox__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(q))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(q))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(q))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(q))))])),key:"3"}:void 0]),1032,["id"])],10,R))}}),E=$;const _=["textContent"],z={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:E,emits:["update:modelValue","change"],setup(t,{emit:o}){const n=t,i=o,r=e.useSlots(),u=j("VvCheckboxGroup",E,n),s=l.useVModel(n,"modelValue",i),{disabled:v,readonly:c,vertical:f,valid:b,invalid:m,modifiers:y}=e.toRefs(n);!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:d,modelValue:s,disabled:v,readonly:c,valid:b,invalid:m});const{getOptionLabel:h,getOptionValue:g}=function(t){const{options:l,labelKey:o,valueKey:n,disabledKey:i}=e.toRefs(t);return{options:l,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof o.value?o.value(e):a.get(e,o.value)),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof n.value?n.value(e):a.get(e,n.value),isOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof i.value?i.value(e):a.get(e,i.value)),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(n),S=w("vv-checkbox-group",y,e.computed((()=>({disabled:v.value,readonly:c.value,horizontal:!f.value,valid:b.value,invalid:m.value})))),{HintSlot:k,hintSlotScope:L}=p(u,r);return(t,l)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(S))},[t.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(t.label)},null,8,_)):e.createCommentVNode("v-if",!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:`${n.name}_opt${t}`,name:n.name,label:h(e),value:g(e)}))(t,l)),null,16)))),128)):e.renderSlot(t.$slots,"default",{key:1})]),e.createVNode(e.unref(k),{class:"vv-checkbox-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))}})}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Option } from '../../types/generic';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
3
|
modelValue: {
|
|
4
|
-
type: (SymbolConstructor | ArrayConstructor |
|
|
4
|
+
type: (SymbolConstructor | ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
5
5
|
default: undefined;
|
|
6
6
|
};
|
|
7
7
|
name: {
|
|
@@ -74,9 +74,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
74
74
|
};
|
|
75
75
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
76
76
|
[x: string]: (...args: any[]) => void;
|
|
77
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<
|
|
77
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
|
|
78
78
|
modelValue: {
|
|
79
|
-
type: (SymbolConstructor | ArrayConstructor |
|
|
79
|
+
type: (SymbolConstructor | ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
80
80
|
default: undefined;
|
|
81
81
|
};
|
|
82
82
|
name: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const VvCheckboxGroupProps: {
|
|
2
2
|
modelValue: {
|
|
3
|
-
type: (SymbolConstructor | ArrayConstructor |
|
|
3
|
+
type: (SymbolConstructor | ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
4
4
|
default: undefined;
|
|
5
5
|
};
|
|
6
6
|
name: {
|
|
@@ -628,7 +628,7 @@ const __default__$9 = {
|
|
|
628
628
|
};
|
|
629
629
|
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
630
630
|
...__default__$9,
|
|
631
|
-
props: mergeDefaults({
|
|
631
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
632
632
|
name: {},
|
|
633
633
|
color: {},
|
|
634
634
|
width: {},
|
|
@@ -836,8 +836,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
836
836
|
"leave",
|
|
837
837
|
"leave-cancelled"
|
|
838
838
|
],
|
|
839
|
-
setup(__props, { expose: __expose, emit }) {
|
|
839
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
840
840
|
const props = __props;
|
|
841
|
+
const emit = __emit;
|
|
841
842
|
const { id } = toRefs(props);
|
|
842
843
|
const hasId = useUniqueId(id);
|
|
843
844
|
const attrs = useAttrs();
|
|
@@ -1802,8 +1803,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1802
1803
|
...__default__$4,
|
|
1803
1804
|
props: VvSelectProps,
|
|
1804
1805
|
emits: VvSelectEmits,
|
|
1805
|
-
setup(__props, { emit }) {
|
|
1806
|
+
setup(__props, { emit: __emit }) {
|
|
1806
1807
|
const props = __props;
|
|
1808
|
+
const emit = __emit;
|
|
1807
1809
|
const slots = useSlots();
|
|
1808
1810
|
const propsDefaults = useDefaults(
|
|
1809
1811
|
"VvSelect",
|
|
@@ -2089,8 +2091,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2089
2091
|
...__default__$2,
|
|
2090
2092
|
props: VvActionProps,
|
|
2091
2093
|
emits: VvActionEvents,
|
|
2092
|
-
setup(__props, { expose: __expose, emit }) {
|
|
2094
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2093
2095
|
const props = __props;
|
|
2096
|
+
const emit = __emit;
|
|
2094
2097
|
const volver = useVolver();
|
|
2095
2098
|
const element = ref(null);
|
|
2096
2099
|
__expose({ $el: element });
|
|
@@ -2349,10 +2352,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2349
2352
|
...__default__$1,
|
|
2350
2353
|
props: VvButtonProps,
|
|
2351
2354
|
emits: VvButtonEvents,
|
|
2352
|
-
setup(__props, { expose: __expose, emit }) {
|
|
2355
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2353
2356
|
const props = __props;
|
|
2354
2357
|
const attrs = useAttrs();
|
|
2355
2358
|
const slots = useSlots();
|
|
2359
|
+
const emit = __emit;
|
|
2356
2360
|
const {
|
|
2357
2361
|
id,
|
|
2358
2362
|
modifiers,
|
|
@@ -2519,8 +2523,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2519
2523
|
...__default__,
|
|
2520
2524
|
props: VvComboboxProps,
|
|
2521
2525
|
emits: VvComboboxEvents,
|
|
2522
|
-
setup(__props, { emit }) {
|
|
2526
|
+
setup(__props, { emit: __emit }) {
|
|
2523
2527
|
const props = __props;
|
|
2528
|
+
const emit = __emit;
|
|
2524
2529
|
const slots = useSlots();
|
|
2525
2530
|
const propsDefaults = useDefaults(
|
|
2526
2531
|
"VvCombobox",
|