@davincihealthcare/elty-design-system-vue 1.86.0 → 1.88.0
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/dist/forms/ElInputSwitch.vue.d.ts +5 -0
- package/dist/forms/ElInputTextarea.vue.d.ts +9 -0
- package/dist/src/forms/ElInputSwitch.vue.cjs2.js +1 -1
- package/dist/src/forms/ElInputSwitch.vue.cjs2.js.map +1 -1
- package/dist/src/forms/ElInputSwitch.vue.esm2.js +1 -1
- package/dist/src/forms/ElInputSwitch.vue.esm2.js.map +1 -1
- package/dist/src/forms/ElInputTextarea.vue.cjs2.js +1 -1
- package/dist/src/forms/ElInputTextarea.vue.cjs2.js.map +1 -1
- package/dist/src/forms/ElInputTextarea.vue.esm2.js +1 -1
- package/dist/src/forms/ElInputTextarea.vue.esm2.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,10 +10,12 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
10
10
|
size?: ElSwitchSizes;
|
|
11
11
|
color?: ElSwitchColors;
|
|
12
12
|
align?: ElSwitchAligns;
|
|
13
|
+
disabled?: boolean;
|
|
13
14
|
}>, {
|
|
14
15
|
size: string;
|
|
15
16
|
color: string;
|
|
16
17
|
align: string;
|
|
18
|
+
disabled: boolean;
|
|
17
19
|
}>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
20
|
"update:modelValue": (val: boolean) => void;
|
|
19
21
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
@@ -22,15 +24,18 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
22
24
|
size?: ElSwitchSizes;
|
|
23
25
|
color?: ElSwitchColors;
|
|
24
26
|
align?: ElSwitchAligns;
|
|
27
|
+
disabled?: boolean;
|
|
25
28
|
}>, {
|
|
26
29
|
size: string;
|
|
27
30
|
color: string;
|
|
28
31
|
align: string;
|
|
32
|
+
disabled: boolean;
|
|
29
33
|
}>>> & {
|
|
30
34
|
"onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
|
|
31
35
|
}, {
|
|
32
36
|
size: ElSwitchSizes;
|
|
33
37
|
color: ElSwitchColors;
|
|
38
|
+
disabled: boolean;
|
|
34
39
|
align: ElSwitchAligns;
|
|
35
40
|
}, {}>;
|
|
36
41
|
export default _default;
|
|
@@ -9,6 +9,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
9
9
|
type: NumberConstructor;
|
|
10
10
|
default: number;
|
|
11
11
|
};
|
|
12
|
+
hideCharacterCounter: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
12
16
|
textareaClass: {
|
|
13
17
|
type: StringConstructor;
|
|
14
18
|
default: string;
|
|
@@ -72,6 +76,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
72
76
|
type: NumberConstructor;
|
|
73
77
|
default: number;
|
|
74
78
|
};
|
|
79
|
+
hideCharacterCounter: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
default: boolean;
|
|
82
|
+
};
|
|
75
83
|
textareaClass: {
|
|
76
84
|
type: StringConstructor;
|
|
77
85
|
default: string;
|
|
@@ -138,6 +146,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
138
146
|
validation: import('./validation-rules').InputValidation;
|
|
139
147
|
resizable: boolean;
|
|
140
148
|
maxCharacters: number;
|
|
149
|
+
hideCharacterCounter: boolean;
|
|
141
150
|
textareaClass: string;
|
|
142
151
|
focusOnMount: boolean;
|
|
143
152
|
}, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("./ElInputContainer.vue.cjs2.js"),c=require("./input.cjs.js"),m=["id","checked","disabled","data-cy"],f=["for"],p=["xs","xxs"],h=["primary","secondary"],b=["left","right"],g=e.defineComponent({__name:"ElInputSwitch",props:{modelValue:{type:Boolean},label:{},size:{default:"xs"},color:{default:"primary"},align:{default:"left"},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(o,{emit:n}){const t=o,i=n,{modelValue:a}=e.toRefs(t),r=c.UniqueID().getID(),s=e.ref(a.value);e.watch(a,()=>{s.value=a.value,i("update:modelValue",s.value)});const d=()=>{t.disabled||(s.value=!s.value,i("update:modelValue",s.value))};return(l,w)=>(e.openBlock(),e.createBlock(u.default,e.mergeProps(l.$attrs,{"no-icon":!0,name:e.unref(r)}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["w-full flex",{"justify-start":l.align==="left","justify-end":l.align==="right"}])},[e.createElementVNode("input",{id:e.unref(r),checked:e.unref(a),type:"checkbox",class:"sr-only",disabled:l.disabled,"data-cy":l.label?`${l.label.trim().replaceAll(" ","")}-switch`:"switch"},null,8,m),e.createElementVNode("button",{class:e.normalizeClass(["flex items-center justify-center gap-2",{"cursor-not-allowed":l.disabled,"cursor-pointer":!l.disabled}]),onClick:d},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center shrink-0",{"w-9 h-[1.375rem]":l.size==="xs","w-[1.625rem] h-4":l.size==="xxs","order-1":l.align==="left","order-2":l.align==="right"}])},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full rounded-full duration-200",{"w-9 h-[1.375rem]":l.size==="xs","w-[1.625rem] h-4":l.size==="xxs","bg-neutral-300":!e.unref(a)&&!l.disabled,"bg-neutral-inactive":l.disabled,"bg-primary-active":l.color==="primary"&&e.unref(a)&&!l.disabled,"bg-secondary-active":l.color==="secondary"&&e.unref(a)&&!l.disabled}])},[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-[0.125rem] bg-white rounded-full duration-200 drop-shadow",{"w-[1.125rem] h-[1.125rem]":l.size==="xs","w-3 h-3":l.size==="xxs","left-[0.125rem]":!e.unref(a),"left-4":l.size==="xs"&&e.unref(a),"left-3":l.size==="xxs"&&e.unref(a)}])},null,2)],2)],2),l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(r),class:e.normalizeClass({"text-base":l.size==="xs","text-sm":l.size==="xxs","order-2":l.align==="left","order-1":l.align==="right","text-neutral-darker cursor-pointer":!l.disabled,"text-neutral-inactive cursor-not-allowed":l.disabled})},e.toDisplayString(l.label),11,f)):e.createCommentVNode("",!0)],2)],2)]),_:1},16,["name"]))}});exports.default=g;exports.elSwitchAligns=b;exports.elSwitchColors=h;exports.elSwitchSizes=p;
|
|
2
2
|
//# sourceMappingURL=ElInputSwitch.vue.cjs2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElInputSwitch.vue.cjs2.js","sources":["../../../src/forms/ElInputSwitch.vue"],"sourcesContent":["<script lang=\"ts\">\nexport const elSwitchSizes = ['xs', 'xxs'] as const;\ntype ElSwitchSizes = (typeof elSwitchSizes)[number];\n\nexport const elSwitchColors = ['primary', 'secondary'] as const;\ntype ElSwitchColors = (typeof elSwitchColors)[number];\n\nexport const elSwitchAligns = ['left', 'right'] as const;\ntype ElSwitchAligns = (typeof elSwitchAligns)[number];\n</script>\n\n<script lang=\"ts\" setup>\nimport { ref, toRefs, watch } from 'vue';\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { UniqueID } from '@/forms/input';\n\nconst props = withDefaults(\n defineProps<{\n modelValue?: boolean;\n label: string;\n size?: ElSwitchSizes;\n color?: ElSwitchColors;\n align?: ElSwitchAligns;\n }>(),\n {\n size: 'xs',\n color: 'primary',\n align: 'left',\n },\n);\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', val: boolean): void;\n}>();\n\nconst { modelValue } = toRefs(props);\nconst uuid = UniqueID().getID();\nconst value = ref<boolean>(modelValue.value);\n\nwatch(modelValue, () => {\n value.value = modelValue.value;\n emit('update:modelValue', value.value);\n});\n\nconst toggleSwitch = () => {\n value.value = !value.value;\n emit('update:modelValue', value.value);\n};\n</script>\n\n<template>\n <ElInputContainer v-bind=\"$attrs\" :no-icon=\"true\" :name=\"uuid\">\n <div\n class=\"w-full flex\"\n :class=\"{\n 'justify-start': align === 'left',\n 'justify-end': align === 'right',\n }\"\n >\n <input\n :id=\"uuid\"\n :checked=\"modelValue\"\n type=\"checkbox\"\n class=\"sr-only\"\n :data-cy=\"label ? `${label.trim().replaceAll(' ', '')}-switch` : 'switch'\"\n />\n\n <button
|
|
1
|
+
{"version":3,"file":"ElInputSwitch.vue.cjs2.js","sources":["../../../src/forms/ElInputSwitch.vue"],"sourcesContent":["<script lang=\"ts\">\nexport const elSwitchSizes = ['xs', 'xxs'] as const;\ntype ElSwitchSizes = (typeof elSwitchSizes)[number];\n\nexport const elSwitchColors = ['primary', 'secondary'] as const;\ntype ElSwitchColors = (typeof elSwitchColors)[number];\n\nexport const elSwitchAligns = ['left', 'right'] as const;\ntype ElSwitchAligns = (typeof elSwitchAligns)[number];\n</script>\n\n<script lang=\"ts\" setup>\nimport { ref, toRefs, watch } from 'vue';\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { UniqueID } from '@/forms/input';\n\nconst props = withDefaults(\n defineProps<{\n modelValue?: boolean;\n label: string;\n size?: ElSwitchSizes;\n color?: ElSwitchColors;\n align?: ElSwitchAligns;\n disabled?: boolean;\n }>(),\n {\n size: 'xs',\n color: 'primary',\n align: 'left',\n disabled: false,\n },\n);\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', val: boolean): void;\n}>();\n\nconst { modelValue } = toRefs(props);\nconst uuid = UniqueID().getID();\nconst value = ref<boolean>(modelValue.value);\n\nwatch(modelValue, () => {\n value.value = modelValue.value;\n emit('update:modelValue', value.value);\n});\n\nconst toggleSwitch = () => {\n if (props.disabled) return;\n value.value = !value.value;\n emit('update:modelValue', value.value);\n};\n</script>\n\n<template>\n <ElInputContainer v-bind=\"$attrs\" :no-icon=\"true\" :name=\"uuid\">\n <div\n class=\"w-full flex\"\n :class=\"{\n 'justify-start': align === 'left',\n 'justify-end': align === 'right',\n }\"\n >\n <input\n :id=\"uuid\"\n :checked=\"modelValue\"\n type=\"checkbox\"\n class=\"sr-only\"\n :disabled=\"disabled\"\n :data-cy=\"label ? `${label.trim().replaceAll(' ', '')}-switch` : 'switch'\"\n />\n\n <button\n class=\"flex items-center justify-center gap-2\"\n :class=\"{ 'cursor-not-allowed': disabled, 'cursor-pointer': !disabled }\"\n @click=\"toggleSwitch\"\n >\n <div\n class=\"flex items-center shrink-0\"\n :class=\"{\n 'w-9 h-[1.375rem]': size === 'xs',\n 'w-[1.625rem] h-4': size === 'xxs',\n 'order-1': align === 'left',\n 'order-2': align === 'right',\n }\"\n >\n <div\n class=\"relative w-full rounded-full duration-200\"\n :class=\"{\n 'w-9 h-[1.375rem]': size === 'xs',\n 'w-[1.625rem] h-4': size === 'xxs',\n 'bg-neutral-300': !modelValue && !disabled,\n 'bg-neutral-inactive': disabled,\n 'bg-primary-active': color === 'primary' && modelValue && !disabled,\n 'bg-secondary-active': color === 'secondary' && modelValue && !disabled,\n }\"\n >\n <div\n class=\"absolute top-[0.125rem] bg-white rounded-full duration-200 drop-shadow\"\n :class=\"{\n 'w-[1.125rem] h-[1.125rem]': size === 'xs',\n 'w-3 h-3': size === 'xxs',\n 'left-[0.125rem]': !modelValue,\n 'left-4': size === 'xs' && modelValue,\n 'left-3': size === 'xxs' && modelValue,\n }\"\n ></div>\n </div>\n </div>\n\n <label\n v-if=\"label\"\n :for=\"uuid\"\n :class=\"{\n 'text-base': size === 'xs',\n 'text-sm': size === 'xxs',\n 'order-2': align === 'left',\n 'order-1': align === 'right',\n 'text-neutral-darker cursor-pointer': !disabled,\n 'text-neutral-inactive cursor-not-allowed': disabled,\n }\"\n >\n {{ label }}\n </label>\n </button>\n </div>\n </ElInputContainer>\n</template>\n"],"names":["elSwitchSizes","elSwitchColors","elSwitchAligns","props","__props","emit","__emit","modelValue","toRefs","uuid","UniqueID","value","ref","watch","toggleSwitch"],"mappings":"6PACaA,EAAgB,CAAC,KAAM,KAAK,EAG5BC,EAAiB,CAAC,UAAW,WAAW,EAGxCC,EAAiB,CAAC,OAAQ,OAAO,+OAS9C,MAAMC,EAAQC,EAiBRC,EAAOC,EAIP,CAAE,WAAAC,CAAA,EAAeC,EAAA,OAAOL,CAAK,EAC7BM,EAAOC,EAAAA,WAAW,QAClBC,EAAQC,EAAAA,IAAaL,EAAW,KAAK,EAE3CM,EAAA,MAAMN,EAAY,IAAM,CACtBI,EAAM,MAAQJ,EAAW,MACpBF,EAAA,oBAAqBM,EAAM,KAAK,CAAA,CACtC,EAED,MAAMG,EAAe,IAAM,CACrBX,EAAM,WACJQ,EAAA,MAAQ,CAACA,EAAM,MAChBN,EAAA,oBAAqBM,EAAM,KAAK,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineComponent as
|
|
1
|
+
import{defineComponent as c,toRefs as p,ref as b,watch as h,openBlock as n,createBlock as g,mergeProps as w,unref as a,withCtx as y,createElementVNode as s,normalizeClass as r,createElementBlock as v,toDisplayString as z,createCommentVNode as k}from"vue";import S from"./ElInputContainer.vue.esm2.js";import{UniqueID as V}from"./input.esm.js";const C=["id","checked","disabled","data-cy"],B=["for"],$=["xs","xxs"],A=["primary","secondary"],N=["left","right"],q=c({__name:"ElInputSwitch",props:{modelValue:{type:Boolean},label:{},size:{default:"xs"},color:{default:"primary"},align:{default:"left"},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(u,{emit:m}){const o=u,d=m,{modelValue:l}=p(o),t=V().getID(),i=b(l.value);h(l,()=>{i.value=l.value,d("update:modelValue",i.value)});const f=()=>{o.disabled||(i.value=!i.value,d("update:modelValue",i.value))};return(e,j)=>(n(),g(S,w(e.$attrs,{"no-icon":!0,name:a(t)}),{default:y(()=>[s("div",{class:r(["w-full flex",{"justify-start":e.align==="left","justify-end":e.align==="right"}])},[s("input",{id:a(t),checked:a(l),type:"checkbox",class:"sr-only",disabled:e.disabled,"data-cy":e.label?`${e.label.trim().replaceAll(" ","")}-switch`:"switch"},null,8,C),s("button",{class:r(["flex items-center justify-center gap-2",{"cursor-not-allowed":e.disabled,"cursor-pointer":!e.disabled}]),onClick:f},[s("div",{class:r(["flex items-center shrink-0",{"w-9 h-[1.375rem]":e.size==="xs","w-[1.625rem] h-4":e.size==="xxs","order-1":e.align==="left","order-2":e.align==="right"}])},[s("div",{class:r(["relative w-full rounded-full duration-200",{"w-9 h-[1.375rem]":e.size==="xs","w-[1.625rem] h-4":e.size==="xxs","bg-neutral-300":!a(l)&&!e.disabled,"bg-neutral-inactive":e.disabled,"bg-primary-active":e.color==="primary"&&a(l)&&!e.disabled,"bg-secondary-active":e.color==="secondary"&&a(l)&&!e.disabled}])},[s("div",{class:r(["absolute top-[0.125rem] bg-white rounded-full duration-200 drop-shadow",{"w-[1.125rem] h-[1.125rem]":e.size==="xs","w-3 h-3":e.size==="xxs","left-[0.125rem]":!a(l),"left-4":e.size==="xs"&&a(l),"left-3":e.size==="xxs"&&a(l)}])},null,2)],2)],2),e.label?(n(),v("label",{key:0,for:a(t),class:r({"text-base":e.size==="xs","text-sm":e.size==="xxs","order-2":e.align==="left","order-1":e.align==="right","text-neutral-darker cursor-pointer":!e.disabled,"text-neutral-inactive cursor-not-allowed":e.disabled})},z(e.label),11,B)):k("",!0)],2)],2)]),_:1},16,["name"]))}});export{q as default,N as elSwitchAligns,A as elSwitchColors,$ as elSwitchSizes};
|
|
2
2
|
//# sourceMappingURL=ElInputSwitch.vue.esm2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElInputSwitch.vue.esm2.js","sources":["../../../src/forms/ElInputSwitch.vue"],"sourcesContent":["<script lang=\"ts\">\nexport const elSwitchSizes = ['xs', 'xxs'] as const;\ntype ElSwitchSizes = (typeof elSwitchSizes)[number];\n\nexport const elSwitchColors = ['primary', 'secondary'] as const;\ntype ElSwitchColors = (typeof elSwitchColors)[number];\n\nexport const elSwitchAligns = ['left', 'right'] as const;\ntype ElSwitchAligns = (typeof elSwitchAligns)[number];\n</script>\n\n<script lang=\"ts\" setup>\nimport { ref, toRefs, watch } from 'vue';\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { UniqueID } from '@/forms/input';\n\nconst props = withDefaults(\n defineProps<{\n modelValue?: boolean;\n label: string;\n size?: ElSwitchSizes;\n color?: ElSwitchColors;\n align?: ElSwitchAligns;\n }>(),\n {\n size: 'xs',\n color: 'primary',\n align: 'left',\n },\n);\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', val: boolean): void;\n}>();\n\nconst { modelValue } = toRefs(props);\nconst uuid = UniqueID().getID();\nconst value = ref<boolean>(modelValue.value);\n\nwatch(modelValue, () => {\n value.value = modelValue.value;\n emit('update:modelValue', value.value);\n});\n\nconst toggleSwitch = () => {\n value.value = !value.value;\n emit('update:modelValue', value.value);\n};\n</script>\n\n<template>\n <ElInputContainer v-bind=\"$attrs\" :no-icon=\"true\" :name=\"uuid\">\n <div\n class=\"w-full flex\"\n :class=\"{\n 'justify-start': align === 'left',\n 'justify-end': align === 'right',\n }\"\n >\n <input\n :id=\"uuid\"\n :checked=\"modelValue\"\n type=\"checkbox\"\n class=\"sr-only\"\n :data-cy=\"label ? `${label.trim().replaceAll(' ', '')}-switch` : 'switch'\"\n />\n\n <button
|
|
1
|
+
{"version":3,"file":"ElInputSwitch.vue.esm2.js","sources":["../../../src/forms/ElInputSwitch.vue"],"sourcesContent":["<script lang=\"ts\">\nexport const elSwitchSizes = ['xs', 'xxs'] as const;\ntype ElSwitchSizes = (typeof elSwitchSizes)[number];\n\nexport const elSwitchColors = ['primary', 'secondary'] as const;\ntype ElSwitchColors = (typeof elSwitchColors)[number];\n\nexport const elSwitchAligns = ['left', 'right'] as const;\ntype ElSwitchAligns = (typeof elSwitchAligns)[number];\n</script>\n\n<script lang=\"ts\" setup>\nimport { ref, toRefs, watch } from 'vue';\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { UniqueID } from '@/forms/input';\n\nconst props = withDefaults(\n defineProps<{\n modelValue?: boolean;\n label: string;\n size?: ElSwitchSizes;\n color?: ElSwitchColors;\n align?: ElSwitchAligns;\n disabled?: boolean;\n }>(),\n {\n size: 'xs',\n color: 'primary',\n align: 'left',\n disabled: false,\n },\n);\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', val: boolean): void;\n}>();\n\nconst { modelValue } = toRefs(props);\nconst uuid = UniqueID().getID();\nconst value = ref<boolean>(modelValue.value);\n\nwatch(modelValue, () => {\n value.value = modelValue.value;\n emit('update:modelValue', value.value);\n});\n\nconst toggleSwitch = () => {\n if (props.disabled) return;\n value.value = !value.value;\n emit('update:modelValue', value.value);\n};\n</script>\n\n<template>\n <ElInputContainer v-bind=\"$attrs\" :no-icon=\"true\" :name=\"uuid\">\n <div\n class=\"w-full flex\"\n :class=\"{\n 'justify-start': align === 'left',\n 'justify-end': align === 'right',\n }\"\n >\n <input\n :id=\"uuid\"\n :checked=\"modelValue\"\n type=\"checkbox\"\n class=\"sr-only\"\n :disabled=\"disabled\"\n :data-cy=\"label ? `${label.trim().replaceAll(' ', '')}-switch` : 'switch'\"\n />\n\n <button\n class=\"flex items-center justify-center gap-2\"\n :class=\"{ 'cursor-not-allowed': disabled, 'cursor-pointer': !disabled }\"\n @click=\"toggleSwitch\"\n >\n <div\n class=\"flex items-center shrink-0\"\n :class=\"{\n 'w-9 h-[1.375rem]': size === 'xs',\n 'w-[1.625rem] h-4': size === 'xxs',\n 'order-1': align === 'left',\n 'order-2': align === 'right',\n }\"\n >\n <div\n class=\"relative w-full rounded-full duration-200\"\n :class=\"{\n 'w-9 h-[1.375rem]': size === 'xs',\n 'w-[1.625rem] h-4': size === 'xxs',\n 'bg-neutral-300': !modelValue && !disabled,\n 'bg-neutral-inactive': disabled,\n 'bg-primary-active': color === 'primary' && modelValue && !disabled,\n 'bg-secondary-active': color === 'secondary' && modelValue && !disabled,\n }\"\n >\n <div\n class=\"absolute top-[0.125rem] bg-white rounded-full duration-200 drop-shadow\"\n :class=\"{\n 'w-[1.125rem] h-[1.125rem]': size === 'xs',\n 'w-3 h-3': size === 'xxs',\n 'left-[0.125rem]': !modelValue,\n 'left-4': size === 'xs' && modelValue,\n 'left-3': size === 'xxs' && modelValue,\n }\"\n ></div>\n </div>\n </div>\n\n <label\n v-if=\"label\"\n :for=\"uuid\"\n :class=\"{\n 'text-base': size === 'xs',\n 'text-sm': size === 'xxs',\n 'order-2': align === 'left',\n 'order-1': align === 'right',\n 'text-neutral-darker cursor-pointer': !disabled,\n 'text-neutral-inactive cursor-not-allowed': disabled,\n }\"\n >\n {{ label }}\n </label>\n </button>\n </div>\n </ElInputContainer>\n</template>\n"],"names":["elSwitchSizes","elSwitchColors","elSwitchAligns","props","__props","emit","__emit","modelValue","toRefs","uuid","UniqueID","value","ref","watch","toggleSwitch"],"mappings":"+YACaA,EAAgB,CAAC,KAAM,KAAK,EAG5BC,EAAiB,CAAC,UAAW,WAAW,EAGxCC,EAAiB,CAAC,OAAQ,OAAO,+NAS9C,MAAMC,EAAQC,EAiBRC,EAAOC,EAIP,CAAE,WAAAC,CAAA,EAAeC,EAAOL,CAAK,EAC7BM,EAAOC,IAAW,QAClBC,EAAQC,EAAaL,EAAW,KAAK,EAE3CM,EAAMN,EAAY,IAAM,CACtBI,EAAM,MAAQJ,EAAW,MACpBF,EAAA,oBAAqBM,EAAM,KAAK,CAAA,CACtC,EAED,MAAMG,EAAe,IAAM,CACrBX,EAAM,WACJQ,EAAA,MAAQ,CAACA,EAAM,MAChBN,EAAA,oBAAqBM,EAAM,KAAK,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),M=require("./ElInputContainer.vue.cjs2.js"),o=require("./input.cjs.js"),k=["id","name","placeholder","disabled","data-cy"],E=e.defineComponent({__name:"ElInputTextarea",props:{...o.withTextualElInputProps(),resizable:{type:Boolean,default:!0},maxCharacters:{type:Number,default:-1},hideCharacterCounter:{type:Boolean,default:!1},textareaClass:{type:String,default:"min-h-20"},focusOnMount:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(r,{emit:c}){const l=e.ref(),t=r;e.onMounted(()=>{var a;t.focusOnMount&&((a=l.value)==null||a.focus())});const f=c,p=e.computed(()=>t.modelValue),h=e.computed(()=>[`max:${t.maxCharacters>0?t.maxCharacters:1e3}`,t.validation]),{value:u,errorMessage:i,uuid:d,fieldContext:v}=o.useInput(p,h,t.name,a=>f("update:modelValue",a)),n=e.computed(()=>{var a;return(a=u.value)==null?void 0:a.length}),C=e.computed(()=>t.maxCharacters<=0?!1:(n.value||0)>t.maxCharacters),g=e.computed(()=>t.errorMessage||i.value?t.errorMessage||i.value:C.value?`Limite caratteri superato (${n.value}/${t.maxCharacters})`:!1),x=a=>{a.stopPropagation()},y=()=>{l.value&&(l.value.scrollTop=l.value.scrollHeight)};return(a,s)=>(e.openBlock(),e.createBlock(M.default,e.mergeProps(a.$attrs,{class:"relative",name:e.unref(d),label:a.label,"error-message":g.value,"hidden-error-message":a.hiddenErrorMessage,"set-required-mark":e.unref(o.showRequiredMark)([a.validation])}),{default:e.withCtx(({error:b})=>[e.withDirectives(e.createElementVNode("textarea",{id:e.unref(d),ref_key:"textareaRef",ref:l,"onUpdate:modelValue":s[0]||(s[0]=m=>e.isRef(u)?u.value=m:null),name:t.name,placeholder:a.placeholder,disabled:a.disabled,class:e.normalizeClass(["el-input",[{error:b,"resize-none":!r.resizable},r.textareaClass]]),"data-cy":`${a.label.trim().replaceAll(" ","")}-textarea`,onBlur:s[1]||(s[1]=m=>e.unref(v).validate()),onInput:y,onKeydown:e.withKeys(x,["enter"])},null,42,k),[[e.vModelText,e.unref(u)]]),r.maxCharacters>0&&!r.hideCharacterCounter?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["flex justify-end text-sm font-semibold",n.value&&n.value>r.maxCharacters?"text-red-500":"text-neutral-darker"])},e.toDisplayString(n.value)+"/"+e.toDisplayString(r.maxCharacters),3)):e.createCommentVNode("",!0)]),_:1},16,["name","label","error-message","hidden-error-message","set-required-mark"]))}});exports.default=E;
|
|
2
2
|
//# sourceMappingURL=ElInputTextarea.vue.cjs2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElInputTextarea.vue.cjs2.js","sources":["../../../src/forms/ElInputTextarea.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { useInput, TextualValueType, showRequiredMark, withTextualElInputProps } from '@/forms/input';\nimport { computed, onMounted, ref } from 'vue';\n\nconst textareaRef = ref<HTMLElement>();\n\nconst props = defineProps({\n ...withTextualElInputProps(),\n resizable: {\n type: Boolean,\n default: true,\n },\n maxCharacters: {\n type: Number,\n default: -1,\n },\n textareaClass: {\n type: String,\n default: 'min-h-20',\n },\n focusOnMount: {\n type: Boolean,\n default: false,\n },\n});\n\nonMounted(() => {\n if (props.focusOnMount) {\n textareaRef.value?.focus();\n }\n});\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', value: TextualValueType): void;\n}>();\n\nconst computedModelValue = computed(() => props.modelValue);\nconst computedValidation = computed(() => [`max:${props.maxCharacters > 0 ? props.maxCharacters : 1000}`, props.validation]);\n\nconst { value, errorMessage, uuid, fieldContext } = useInput(computedModelValue, computedValidation, props.name, newValue =>\n emit('update:modelValue', newValue),\n);\n\nconst currentInsertedCharNumber = computed(() => value.value?.length);\n\nconst handleEnter = (event: KeyboardEvent) => {\n event.stopPropagation();\n};\n\nconst handleInput = () => {\n if (textareaRef.value) textareaRef.value.scrollTop = textareaRef.value.scrollHeight;\n};\n</script>\n\n<template>\n <ElInputContainer\n v-bind=\"$attrs\"\n class=\"relative\"\n :name=\"uuid\"\n :label=\"label\"\n :error-message=\"
|
|
1
|
+
{"version":3,"file":"ElInputTextarea.vue.cjs2.js","sources":["../../../src/forms/ElInputTextarea.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { useInput, TextualValueType, showRequiredMark, withTextualElInputProps } from '@/forms/input';\nimport { computed, onMounted, ref } from 'vue';\n\nconst textareaRef = ref<HTMLElement>();\n\nconst props = defineProps({\n ...withTextualElInputProps(),\n resizable: {\n type: Boolean,\n default: true,\n },\n maxCharacters: {\n type: Number,\n default: -1,\n },\n hideCharacterCounter: {\n type: Boolean,\n default: false,\n },\n textareaClass: {\n type: String,\n default: 'min-h-20',\n },\n focusOnMount: {\n type: Boolean,\n default: false,\n },\n});\n\nonMounted(() => {\n if (props.focusOnMount) {\n textareaRef.value?.focus();\n }\n});\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', value: TextualValueType): void;\n}>();\n\nconst computedModelValue = computed(() => props.modelValue);\nconst computedValidation = computed(() => [`max:${props.maxCharacters > 0 ? props.maxCharacters : 1000}`, props.validation]);\n\nconst { value, errorMessage, uuid, fieldContext } = useInput(computedModelValue, computedValidation, props.name, newValue =>\n emit('update:modelValue', newValue),\n);\n\nconst currentInsertedCharNumber = computed(() => value.value?.length);\n\nconst isExceedingLimit = computed(() => {\n if (props.maxCharacters <= 0) return false;\n return (currentInsertedCharNumber.value || 0) > props.maxCharacters;\n});\n\nconst computedErrorMessage = computed(() => {\n // Priority: props.errorMessage or errorMessage.value\n if (props.errorMessage || errorMessage.value) {\n return props.errorMessage || errorMessage.value;\n }\n // Fallback: character limit exceeded message\n if (isExceedingLimit.value) {\n return `Limite caratteri superato (${currentInsertedCharNumber.value}/${props.maxCharacters})`;\n }\n return false;\n});\n\nconst handleEnter = (event: KeyboardEvent) => {\n event.stopPropagation();\n};\n\nconst handleInput = () => {\n if (textareaRef.value) textareaRef.value.scrollTop = textareaRef.value.scrollHeight;\n};\n</script>\n\n<template>\n <ElInputContainer\n v-bind=\"$attrs\"\n class=\"relative\"\n :name=\"uuid\"\n :label=\"label\"\n :error-message=\"computedErrorMessage\"\n :hidden-error-message=\"hiddenErrorMessage\"\n :set-required-mark=\"showRequiredMark([validation])\"\n >\n <template #default=\"{ error }\">\n <textarea\n :id=\"uuid\"\n ref=\"textareaRef\"\n v-model=\"value\"\n :name=\"props.name\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n class=\"el-input\"\n :class=\"[\n {\n error,\n 'resize-none': !resizable,\n },\n textareaClass,\n ]\"\n :data-cy=\"`${label.trim().replaceAll(' ', '')}-textarea`\"\n @blur=\"fieldContext.validate()\"\n @input=\"handleInput\"\n @keydown.enter=\"handleEnter\"\n ></textarea>\n <span\n v-if=\"maxCharacters > 0 && !hideCharacterCounter\"\n class=\"flex justify-end text-sm font-semibold\"\n :class=\"currentInsertedCharNumber && currentInsertedCharNumber > maxCharacters ? 'text-red-500' : 'text-neutral-darker'\"\n >\n {{ currentInsertedCharNumber }}/{{ maxCharacters }}\n </span>\n </template>\n </ElInputContainer>\n</template>\n"],"names":["textareaRef","ref","props","__props","onMounted","_a","emit","__emit","computedModelValue","computed","computedValidation","value","errorMessage","uuid","fieldContext","useInput","newValue","currentInsertedCharNumber","isExceedingLimit","computedErrorMessage","handleEnter","event","handleInput"],"mappings":"ilBAKA,MAAMA,EAAcC,EAAAA,MAEdC,EAAQC,EAwBdC,EAAAA,UAAU,IAAM,OACVF,EAAM,gBACRG,EAAAL,EAAY,QAAZ,MAAAK,EAAmB,QACrB,CACD,EAED,MAAMC,EAAOC,EAIPC,EAAqBC,EAAA,SAAS,IAAMP,EAAM,UAAU,EACpDQ,EAAqBD,EAAAA,SAAS,IAAM,CAAC,OAAOP,EAAM,cAAgB,EAAIA,EAAM,cAAgB,GAAI,GAAIA,EAAM,UAAU,CAAC,EAErH,CAAE,MAAAS,EAAO,aAAAC,EAAc,KAAAC,EAAM,aAAAC,CAAiB,EAAAC,EAAA,SAASP,EAAoBE,EAAoBR,EAAM,KAAMc,GAC/GV,EAAK,oBAAqBU,CAAQ,CAAA,EAG9BC,EAA4BR,EAAAA,SAAS,IAAA,OAAM,OAAAJ,EAAAM,EAAM,QAAN,YAAAN,EAAa,OAAM,EAE9Da,EAAmBT,EAAAA,SAAS,IAC5BP,EAAM,eAAiB,EAAU,IAC7Be,EAA0B,OAAS,GAAKf,EAAM,aACvD,EAEKiB,EAAuBV,EAAAA,SAAS,IAEhCP,EAAM,cAAgBU,EAAa,MAC9BV,EAAM,cAAgBU,EAAa,MAGxCM,EAAiB,MACZ,8BAA8BD,EAA0B,KAAK,IAAIf,EAAM,aAAa,IAEtF,EACR,EAEKkB,EAAeC,GAAyB,CAC5CA,EAAM,gBAAgB,CAAA,EAGlBC,EAAc,IAAM,CACpBtB,EAAY,QAAmBA,EAAA,MAAM,UAAYA,EAAY,MAAM,aAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineComponent as
|
|
1
|
+
import{defineComponent as V,ref as B,onMounted as $,computed as n,openBlock as c,createBlock as w,mergeProps as I,unref as s,withCtx as z,withDirectives as N,createElementVNode as R,isRef as T,normalizeClass as f,withKeys as q,vModelText as P,createElementBlock as D,toDisplayString as p,createCommentVNode as K}from"vue";import L from"./ElInputContainer.vue.esm2.js";import{withTextualElInputProps as O,useInput as S,showRequiredMark as j}from"./input.esm.js";const A=["id","name","placeholder","disabled","data-cy"],G=V({__name:"ElInputTextarea",props:{...O(),resizable:{type:Boolean,default:!0},maxCharacters:{type:Number,default:-1},hideCharacterCounter:{type:Boolean,default:!1},textareaClass:{type:String,default:"min-h-20"},focusOnMount:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:h}){const r=B(),a=t;$(()=>{var e;a.focusOnMount&&((e=r.value)==null||e.focus())});const v=h,x=n(()=>a.modelValue),C=n(()=>[`max:${a.maxCharacters>0?a.maxCharacters:1e3}`,a.validation]),{value:o,errorMessage:i,uuid:d,fieldContext:g}=S(x,C,a.name,e=>v("update:modelValue",e)),l=n(()=>{var e;return(e=o.value)==null?void 0:e.length}),y=n(()=>a.maxCharacters<=0?!1:(l.value||0)>a.maxCharacters),b=n(()=>a.errorMessage||i.value?a.errorMessage||i.value:y.value?`Limite caratteri superato (${l.value}/${a.maxCharacters})`:!1),M=e=>{e.stopPropagation()},k=()=>{r.value&&(r.value.scrollTop=r.value.scrollHeight)};return(e,u)=>(c(),w(L,I(e.$attrs,{class:"relative",name:s(d),label:e.label,"error-message":b.value,"hidden-error-message":e.hiddenErrorMessage,"set-required-mark":s(j)([e.validation])}),{default:z(({error:E})=>[N(R("textarea",{id:s(d),ref_key:"textareaRef",ref:r,"onUpdate:modelValue":u[0]||(u[0]=m=>T(o)?o.value=m:null),name:a.name,placeholder:e.placeholder,disabled:e.disabled,class:f(["el-input",[{error:E,"resize-none":!t.resizable},t.textareaClass]]),"data-cy":`${e.label.trim().replaceAll(" ","")}-textarea`,onBlur:u[1]||(u[1]=m=>s(g).validate()),onInput:k,onKeydown:q(M,["enter"])},null,42,A),[[P,s(o)]]),t.maxCharacters>0&&!t.hideCharacterCounter?(c(),D("span",{key:0,class:f(["flex justify-end text-sm font-semibold",l.value&&l.value>t.maxCharacters?"text-red-500":"text-neutral-darker"])},p(l.value)+"/"+p(t.maxCharacters),3)):K("",!0)]),_:1},16,["name","label","error-message","hidden-error-message","set-required-mark"]))}});export{G as default};
|
|
2
2
|
//# sourceMappingURL=ElInputTextarea.vue.esm2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElInputTextarea.vue.esm2.js","sources":["../../../src/forms/ElInputTextarea.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { useInput, TextualValueType, showRequiredMark, withTextualElInputProps } from '@/forms/input';\nimport { computed, onMounted, ref } from 'vue';\n\nconst textareaRef = ref<HTMLElement>();\n\nconst props = defineProps({\n ...withTextualElInputProps(),\n resizable: {\n type: Boolean,\n default: true,\n },\n maxCharacters: {\n type: Number,\n default: -1,\n },\n textareaClass: {\n type: String,\n default: 'min-h-20',\n },\n focusOnMount: {\n type: Boolean,\n default: false,\n },\n});\n\nonMounted(() => {\n if (props.focusOnMount) {\n textareaRef.value?.focus();\n }\n});\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', value: TextualValueType): void;\n}>();\n\nconst computedModelValue = computed(() => props.modelValue);\nconst computedValidation = computed(() => [`max:${props.maxCharacters > 0 ? props.maxCharacters : 1000}`, props.validation]);\n\nconst { value, errorMessage, uuid, fieldContext } = useInput(computedModelValue, computedValidation, props.name, newValue =>\n emit('update:modelValue', newValue),\n);\n\nconst currentInsertedCharNumber = computed(() => value.value?.length);\n\nconst handleEnter = (event: KeyboardEvent) => {\n event.stopPropagation();\n};\n\nconst handleInput = () => {\n if (textareaRef.value) textareaRef.value.scrollTop = textareaRef.value.scrollHeight;\n};\n</script>\n\n<template>\n <ElInputContainer\n v-bind=\"$attrs\"\n class=\"relative\"\n :name=\"uuid\"\n :label=\"label\"\n :error-message=\"
|
|
1
|
+
{"version":3,"file":"ElInputTextarea.vue.esm2.js","sources":["../../../src/forms/ElInputTextarea.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport ElInputContainer from '@/forms/ElInputContainer.vue';\nimport { useInput, TextualValueType, showRequiredMark, withTextualElInputProps } from '@/forms/input';\nimport { computed, onMounted, ref } from 'vue';\n\nconst textareaRef = ref<HTMLElement>();\n\nconst props = defineProps({\n ...withTextualElInputProps(),\n resizable: {\n type: Boolean,\n default: true,\n },\n maxCharacters: {\n type: Number,\n default: -1,\n },\n hideCharacterCounter: {\n type: Boolean,\n default: false,\n },\n textareaClass: {\n type: String,\n default: 'min-h-20',\n },\n focusOnMount: {\n type: Boolean,\n default: false,\n },\n});\n\nonMounted(() => {\n if (props.focusOnMount) {\n textareaRef.value?.focus();\n }\n});\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', value: TextualValueType): void;\n}>();\n\nconst computedModelValue = computed(() => props.modelValue);\nconst computedValidation = computed(() => [`max:${props.maxCharacters > 0 ? props.maxCharacters : 1000}`, props.validation]);\n\nconst { value, errorMessage, uuid, fieldContext } = useInput(computedModelValue, computedValidation, props.name, newValue =>\n emit('update:modelValue', newValue),\n);\n\nconst currentInsertedCharNumber = computed(() => value.value?.length);\n\nconst isExceedingLimit = computed(() => {\n if (props.maxCharacters <= 0) return false;\n return (currentInsertedCharNumber.value || 0) > props.maxCharacters;\n});\n\nconst computedErrorMessage = computed(() => {\n // Priority: props.errorMessage or errorMessage.value\n if (props.errorMessage || errorMessage.value) {\n return props.errorMessage || errorMessage.value;\n }\n // Fallback: character limit exceeded message\n if (isExceedingLimit.value) {\n return `Limite caratteri superato (${currentInsertedCharNumber.value}/${props.maxCharacters})`;\n }\n return false;\n});\n\nconst handleEnter = (event: KeyboardEvent) => {\n event.stopPropagation();\n};\n\nconst handleInput = () => {\n if (textareaRef.value) textareaRef.value.scrollTop = textareaRef.value.scrollHeight;\n};\n</script>\n\n<template>\n <ElInputContainer\n v-bind=\"$attrs\"\n class=\"relative\"\n :name=\"uuid\"\n :label=\"label\"\n :error-message=\"computedErrorMessage\"\n :hidden-error-message=\"hiddenErrorMessage\"\n :set-required-mark=\"showRequiredMark([validation])\"\n >\n <template #default=\"{ error }\">\n <textarea\n :id=\"uuid\"\n ref=\"textareaRef\"\n v-model=\"value\"\n :name=\"props.name\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n class=\"el-input\"\n :class=\"[\n {\n error,\n 'resize-none': !resizable,\n },\n textareaClass,\n ]\"\n :data-cy=\"`${label.trim().replaceAll(' ', '')}-textarea`\"\n @blur=\"fieldContext.validate()\"\n @input=\"handleInput\"\n @keydown.enter=\"handleEnter\"\n ></textarea>\n <span\n v-if=\"maxCharacters > 0 && !hideCharacterCounter\"\n class=\"flex justify-end text-sm font-semibold\"\n :class=\"currentInsertedCharNumber && currentInsertedCharNumber > maxCharacters ? 'text-red-500' : 'text-neutral-darker'\"\n >\n {{ currentInsertedCharNumber }}/{{ maxCharacters }}\n </span>\n </template>\n </ElInputContainer>\n</template>\n"],"names":["textareaRef","ref","props","__props","onMounted","_a","emit","__emit","computedModelValue","computed","computedValidation","value","errorMessage","uuid","fieldContext","useInput","newValue","currentInsertedCharNumber","isExceedingLimit","computedErrorMessage","handleEnter","event","handleInput"],"mappings":"izBAKA,MAAMA,EAAcC,IAEdC,EAAQC,EAwBdC,EAAU,IAAM,OACVF,EAAM,gBACRG,EAAAL,EAAY,QAAZ,MAAAK,EAAmB,QACrB,CACD,EAED,MAAMC,EAAOC,EAIPC,EAAqBC,EAAS,IAAMP,EAAM,UAAU,EACpDQ,EAAqBD,EAAS,IAAM,CAAC,OAAOP,EAAM,cAAgB,EAAIA,EAAM,cAAgB,GAAI,GAAIA,EAAM,UAAU,CAAC,EAErH,CAAE,MAAAS,EAAO,aAAAC,EAAc,KAAAC,EAAM,aAAAC,CAAiB,EAAAC,EAASP,EAAoBE,EAAoBR,EAAM,KAAMc,GAC/GV,EAAK,oBAAqBU,CAAQ,CAAA,EAG9BC,EAA4BR,EAAS,IAAA,OAAM,OAAAJ,EAAAM,EAAM,QAAN,YAAAN,EAAa,OAAM,EAE9Da,EAAmBT,EAAS,IAC5BP,EAAM,eAAiB,EAAU,IAC7Be,EAA0B,OAAS,GAAKf,EAAM,aACvD,EAEKiB,EAAuBV,EAAS,IAEhCP,EAAM,cAAgBU,EAAa,MAC9BV,EAAM,cAAgBU,EAAa,MAGxCM,EAAiB,MACZ,8BAA8BD,EAA0B,KAAK,IAAIf,EAAM,aAAa,IAEtF,EACR,EAEKkB,EAAeC,GAAyB,CAC5CA,EAAM,gBAAgB,CAAA,EAGlBC,EAAc,IAAM,CACpBtB,EAAY,QAAmBA,EAAA,MAAM,UAAYA,EAAY,MAAM,aAAA"}
|