@luis-angel-martin-dzul/vue-input-styles 0.0.42 → 0.0.44
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/README.md +9 -17
- package/dist/vue-input-styles.es.js +444 -446
- package/dist/vue-input-styles.umd.js +3 -3
- package/package.json +1 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.VueInputStyles={},d.Vue))})(this,(function(d,e){"use strict";class c{static type={success:"success",error:"error",warning:"warning",info:"info",neutral:"neutral"};static container=null;static iconMap={success:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C178.6 576 64 461.4 64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576zM438 209.7C427.3 201.9 412.3 204.3 404.5 215L285.1 379.2L233 327.1C223.6 317.7 208.4 317.7 199.1 327.1C189.8 336.5 189.7 351.7 199.1 361L271.1 433C276.1 438 282.9 440.5 289.9 440C296.9 439.5 303.3 435.9 307.4 430.2L443.3 243.2C451.1 232.5 448.7 217.5 438 209.7z"/></svg>',error:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM231 231C240.4 221.6 255.6 221.6 264.9 231L319.9 286L374.9 231C384.3 221.6 399.5 221.6 408.8 231C418.1 240.4 418.2 255.6 408.8 264.9L353.8 319.9L408.8 374.9C418.2 384.3 418.2 399.5 408.8 408.8C399.4 418.1 384.2 418.2 374.9 408.8L319.9 353.8L264.9 408.8C255.5 418.2 240.3 418.2 231 408.8C221.7 399.4 221.6 384.2 231 374.9L286 319.9L231 264.9C221.6 255.5 221.6 240.3 231 231z"/></svg>',warning:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C178.6 576 64 461.4 64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576zM320 384C302.3 384 288 398.3 288 416C288 433.7 302.3 448 320 448C337.7 448 352 433.7 352 416C352 398.3 337.7 384 320 384zM320 192C301.8 192 287.3 207.5 288.6 225.7L296 329.7C296.9 342.3 307.4 352 319.9 352C332.5 352 342.9 342.3 343.8 329.7L351.2 225.7C352.5 207.5 338.1 192 319.8 192z"/></svg>',info:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM288 224C288 206.3 302.3 192 320 192C337.7 192 352 206.3 352 224C352 241.7 337.7 256 320 256C302.3 256 288 241.7 288 224zM280 288L328 288C341.3 288 352 298.7 352 312L352 400L360 400C373.3 400 384 410.7 384 424C384 437.3 373.3 448 360 448L280 448C266.7 448 256 437.3 256 424C256 410.7 266.7 400 280 400L304 400L304 336L280 336C266.7 336 256 325.3 256 312C256 298.7 266.7 288 280 288z"/></svg>',neutral:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576C178.6 576 64 461.4 64 320zM272 272C272 254.3 257.7 240 240 240C222.3 240 208 254.3 208 272C208 289.7 222.3 304 240 304C257.7 304 272 289.7 272 272zM400 304C417.7 304 432 289.7 432 272C432 254.3 417.7 240 400 240C382.3 240 368 254.3 368 272C368 289.7 382.3 304 400 304z"/></svg>'};static#e(r,
|
|
1
|
+
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.VueInputStyles={},d.Vue))})(this,(function(d,e){"use strict";class c{static type={success:"success",error:"error",warning:"warning",info:"info",neutral:"neutral"};static container=null;static iconMap={success:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C178.6 576 64 461.4 64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576zM438 209.7C427.3 201.9 412.3 204.3 404.5 215L285.1 379.2L233 327.1C223.6 317.7 208.4 317.7 199.1 327.1C189.8 336.5 189.7 351.7 199.1 361L271.1 433C276.1 438 282.9 440.5 289.9 440C296.9 439.5 303.3 435.9 307.4 430.2L443.3 243.2C451.1 232.5 448.7 217.5 438 209.7z"/></svg>',error:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM231 231C240.4 221.6 255.6 221.6 264.9 231L319.9 286L374.9 231C384.3 221.6 399.5 221.6 408.8 231C418.1 240.4 418.2 255.6 408.8 264.9L353.8 319.9L408.8 374.9C418.2 384.3 418.2 399.5 408.8 408.8C399.4 418.1 384.2 418.2 374.9 408.8L319.9 353.8L264.9 408.8C255.5 418.2 240.3 418.2 231 408.8C221.7 399.4 221.6 384.2 231 374.9L286 319.9L231 264.9C221.6 255.5 221.6 240.3 231 231z"/></svg>',warning:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C178.6 576 64 461.4 64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576zM320 384C302.3 384 288 398.3 288 416C288 433.7 302.3 448 320 448C337.7 448 352 433.7 352 416C352 398.3 337.7 384 320 384zM320 192C301.8 192 287.3 207.5 288.6 225.7L296 329.7C296.9 342.3 307.4 352 319.9 352C332.5 352 342.9 342.3 343.8 329.7L351.2 225.7C352.5 207.5 338.1 192 319.8 192z"/></svg>',info:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM288 224C288 206.3 302.3 192 320 192C337.7 192 352 206.3 352 224C352 241.7 337.7 256 320 256C302.3 256 288 241.7 288 224zM280 288L328 288C341.3 288 352 298.7 352 312L352 400L360 400C373.3 400 384 410.7 384 424C384 437.3 373.3 448 360 448L280 448C266.7 448 256 437.3 256 424C256 410.7 266.7 400 280 400L304 400L304 336L280 336C266.7 336 256 325.3 256 312C256 298.7 266.7 288 280 288z"/></svg>',neutral:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576C178.6 576 64 461.4 64 320zM272 272C272 254.3 257.7 240 240 240C222.3 240 208 254.3 208 272C208 289.7 222.3 304 240 304C257.7 304 272 289.7 272 272zM400 304C417.7 304 432 289.7 432 272C432 254.3 417.7 240 400 240C382.3 240 368 254.3 368 272C368 289.7 382.3 304 400 304z"/></svg>'};static#e(r,l,n=c.type.info,a=4e3){c.ensureContainer();const o=c.container.querySelector(`.alert-${n}`);o&&o.remove();const s=document.createElement("div");s.className=`alert alert-${n}`;const i=c.iconMap[n]||"";s.innerHTML=`
|
|
2
2
|
<div class="alert-icon">${i}</div>
|
|
3
3
|
<div class="alert-texts">
|
|
4
4
|
<div class="alert-title">${r}</div>
|
|
5
|
-
<div class="alert-message">${
|
|
5
|
+
<div class="alert-message">${l}</div>
|
|
6
6
|
</div>
|
|
7
7
|
<div class="alert-close">×</div>
|
|
8
|
-
`,a.querySelector(".alert-close").addEventListener("click",()=>{c.remove(a)}),c.container.appendChild(a),setTimeout(()=>a.classList.add("show"),10),s>0&&setTimeout(()=>c.remove(a),s)}static success(r,t=""){this.#e(r,t,this.type.success)}static error(r,t=""){this.#e(r,t,this.type.error)}static warning(r,t=""){this.#e(r,t,this.type.warning)}static info(r,t=""){this.#e(r,t,this.type.info)}static neutral(r,t=""){this.#e(r,t,this.type.neutral)}static ensureContainer(){this.container||(this.container=document.createElement("div"),this.container.className="alert-container",document.body.appendChild(this.container))}static remove(r){r.classList.add("hide"),setTimeout(()=>r.remove(),250)}}const m=(l,r)=>{const t=l.__vccOpts||l;for(const[n,s]of r)t[n]=s;return t},C={name:"ButtonStyle",emits:["click"],props:{class:{type:String,default:""},variant:{type:String,default:"solid"},color:{type:String,default:"gray"},disabled:{type:Boolean,default:!1},delay:{type:String,default:"1.5"},full:{type:Boolean,default:!1}},data(){return{internalDisabled:!1}},computed:{isDisabled(){return this.disabled||this.internalDisabled},buttonClasses(){if(this.class)return`${this.class} disabled:opacity-60 disabled:cursor-not-allowed`;const l=["h-min font-semibold items-center justify-center rounded px-3 py-1.5 gap-1"];l.push(this.full?"w-full flex":"inline-flex");const r={solid:{gray:"text-white bg-slate-600 enabled:hover:bg-slate-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",green:"text-white bg-emerald-600 enabled:hover:bg-emerald-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",blue:"text-white bg-sky-600 enabled:hover:bg-sky-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",red:"text-white bg-rose-600 enabled:hover:bg-rose-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",yellow:"text-white bg-amber-600 enabled:hover:bg-amber-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed"},outline:{gray:"text-slate-700 enabled:hover:bg-slate-50 border border-slate-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",green:"text-emerald-700 enabled:hover:bg-emerald-50 border border-emerald-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",blue:"text-sky-700 enabled:hover:bg-sky-50 border border-sky-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",red:"text-rose-700 enabled:hover:bg-rose-50 border border-rose-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",yellow:"text-amber-700 enabled:hover:bg-amber-50 border border-amber-700 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed"}};return l.push(r[this.variant][this.color]),l}},methods:{handleClick(l){this.isDisabled||(this.$emit("click",l),this.internalDisabled=!0,setTimeout(()=>{this.internalDisabled=!1},1e3*Number(this.delay)))}}},V=["disabled"];function E(l,r,t,n,s,o){return e.openBlock(),e.createElementBlock("button",{disabled:o.isDisabled,type:"button",onClick:r[0]||(r[0]=(...a)=>o.handleClick&&o.handleClick(...a)),class:e.normalizeClass(o.buttonClasses)},[e.renderSlot(l.$slots,"default")],10,V)}const u=m(C,[["render",E]]),_={name:"CheckStyle",props:{label:{type:String,default:""},list:{type:Array,default:()=>[]},grid:{type:String,default:"grid grid-cols-4"},all:{type:Boolean,default:!1},modelValue:{type:[Array,String,Number,Object],default:()=>[]},returnAll:{type:Boolean,default:!1},returnType:{type:String,default:"id"}},data(){return{realSelection:[]}},computed:{getUUID(){return crypto.randomUUID()},isAllSelected(){return this.list.length>0&&this.realSelection.length===this.list.length}},watch:{modelValue:{immediate:!0,handler(l){Array.isArray(l)?this.realSelection=[...l]:l?this.realSelection=[l]:this.realSelection=[]}}},methods:{getValue(l){return this.returnType==="object"?l:this.returnType==="text"?l.name:l.id},isChecked(l){const r=this.getValue(l);return this.realSelection.includes(r)},emitExternal(){if(!this.returnAll&&this.realSelection.length===this.list.length){this.$emit("update:modelValue","");return}this.$emit("update:modelValue",this.realSelection.length?[...this.realSelection]:"")},onChange(l){const r=this.getValue(l);this.realSelection.includes(r)?this.realSelection=this.realSelection.filter(t=>t!==r):this.all?this.realSelection.push(r):this.realSelection=[r],this.emitExternal()},toggleSelectAll(){this.all&&(this.isAllSelected?this.realSelection=[]:this.realSelection=this.list.map(l=>this.getValue(l)),this.emitExternal())}}},D={class:"w-full"},N={class:"flex items-center justify-between"},T={class:"block text-sm font-medium text-gray-700"},U={key:0,class:"flex items-center gap-2 select-none"},I=["id","checked"],L=["for"],q=["id","checked","onChange"],M=["for"];function z(l,r,t,n,s,o){return e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("div",N,[e.createElementVNode("h3",T,e.toDisplayString(t.label),1),t.all?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("input",{type:"checkbox",id:"todos-"+o.getUUID,checked:o.isAllSelected,onChange:r[0]||(r[0]=(...a)=>o.toggleSelectAll&&o.toggleSelectAll(...a)),class:"w-4 h-4 text-indigo-600 border-gray-300 rounded focus:ring-indigo-200"},null,40,I),e.createElementVNode("label",{for:"todos-"+o.getUUID,class:"text-sm text-gray-600 uppercase truncate"}," Seleccionar todos ",8,L)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["max-h-48 overflow-auto space-y-1",t.grid])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.list,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:"flex items-center gap-2 select-none"},[e.createElementVNode("input",{type:"checkbox",id:o.getUUID+"-"+a.id,checked:o.isChecked(a),onChange:i=>o.onChange(a),class:"w-4 h-4 text-indigo-600 border-gray-300 rounded focus:ring-indigo-200"},null,40,q),e.createElementVNode("label",{for:o.getUUID+"-"+a.id,class:"truncate text-gray-700"},e.toDisplayString(a.name),9,M)]))),128))],2)])}const h=m(_,[["render",z]]),A={name:"ComboBoxStyle",props:{modelValue:[String,Number,Object,null],label:{type:String,default:""},placeholder:{type:String,default:"Buscar..."},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},oEmpty:{type:String,default:"- Sin registros"}},data(){return{search:"",open:!1}},watch:{modelValue(l){const r=this.list.find(t=>t.id===l);r&&(this.search=r.name)}},computed:{getUUID(){return crypto.randomUUID()},filteredList(){return this.search?this.list.filter(l=>l.name.toLowerCase().includes(this.search.toLowerCase())):this.list},model:{get(){return this.modelValue},set(l){this.$emit("update:modelValue",l)}}},methods:{selectItem(l){this.model=l.id,this.search=l.name,this.open=!1},closeWithDelay(){setTimeout(()=>{this.open=!1},150)}}},P={class:"w-full"},F=["for"],j={key:0,class:"text-red-800 ml-2"},K={key:0,class:"relative"},O={class:"z-2 absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-7 h-7"},W={class:"relative w-full"},H=["id","placeholder"],R={key:0,class:"absolute z-10 left-0 right-0 mt-0.5 bg-white border border-gray-200 rounded shadow max-h-48 overflow-auto"},G={key:0,class:"w-full text-gray-800 bg-white px-3 py-2"},J=["onClick"],Q={key:1,class:"relative w-full"},X=["id","placeholder"],Y={key:0,class:"absolute z-10 left-0 right-0 mt-0.5 bg-white border border-gray-200 rounded shadow max-h-48 overflow-auto"},Z={key:0,class:"w-full text-gray-800 bg-white px-3 py-2"},$=["onClick"];function v(l,r,t,n,s,o){return e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("label",{class:"block text-sm font-medium text-gray-700",for:o.getUUID},[t.required?(e.openBlock(),e.createElementBlock("span",j,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label),1)],8,F),l.$slots.icon?(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",O,[e.renderSlot(l.$slots,"icon")]),e.createElementVNode("div",W,[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:o.getUUID,type:"text","onUpdate:modelValue":r[0]||(r[0]=a=>s.search=a),placeholder:t.placeholder},{disabled:t.disabled,required:t.required},{class:"w-full text-gray-800 bg-white pl-10 pr-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed",onFocus:r[1]||(r[1]=a=>!t.disabled&&(s.open=!0)),onInput:r[2]||(r[2]=a=>!t.disabled&&(s.open=!0)),onBlur:r[3]||(r[3]=(...a)=>o.closeWithDelay&&o.closeWithDelay(...a))}),null,16,H),[[e.vModelText,s.search]]),s.open&&!t.disabled?(e.openBlock(),e.createElementBlock("div",R,[o.filteredList.length===0?(e.openBlock(),e.createElementBlock("div",G,e.toDisplayString(t.oEmpty),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.filteredList,(a,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,onClick:g=>o.selectItem(a),class:"w-full text-gray-800 bg-white hover:bg-gray-100 px-3 py-2"},e.toDisplayString(a.name),9,J))),128))])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",Q,[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:o.getUUID,type:"text","onUpdate:modelValue":r[4]||(r[4]=a=>s.search=a),placeholder:t.placeholder},{disabled:t.disabled,required:t.required},{class:"w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed",onFocus:r[5]||(r[5]=a=>!t.disabled&&(s.open=!0)),onInput:r[6]||(r[6]=a=>!t.disabled&&(s.open=!0)),onBlur:r[7]||(r[7]=(...a)=>o.closeWithDelay&&o.closeWithDelay(...a))}),null,16,X),[[e.vModelText,s.search]]),s.open&&!t.disabled?(e.openBlock(),e.createElementBlock("div",Y,[o.filteredList.length===0?(e.openBlock(),e.createElementBlock("div",Z,e.toDisplayString(t.oEmpty),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.filteredList,(a,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,onClick:g=>o.selectItem(a),class:"w-full text-gray-800 bg-white hover:bg-gray-100 px-3 py-2"},e.toDisplayString(a.name),9,$))),128))])):e.createCommentVNode("",!0)]))])}const b=m(A,[["render",v]]),ee={name:"DateTimeStyle",props:{modelValue:String,disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},mode:{type:String,default:"datetime"},label:{type:String,default:"Seleccionar fecha"},secondsMode:{type:String,default:"default"}},data(){return{localDate:"",localTime:""}},computed:{model:{get(){return this.modelValue},set(l){this.$emit("update:modelValue",l)}},showDate(){return["date","datetime","datetime2"].includes(this.mode)},showTime(){return["time","datetime"].includes(this.mode)},segundos(){return this.secondsMode==="max"?"59":"01"},dateInputClass(){let l="w-full text-gray-800 bg-white px-3 py-1.5 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed";return this.showDate&&this.showTime?l+" rounded-l":l+" rounded"},timeInputClass(){let l="w-full text-gray-800 bg-white px-3 py-1.5 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed";return this.showDate&&this.showTime?l+" rounded-r":l+" rounded"},gridClass(){return this.showDate&&this.showTime?"grid grid-cols-2":""}},watch:{modelValue:{immediate:!0,handler(l){if(!l){this.localDate="",this.localTime="";return}if(this.mode==="date")this.localDate=l;else if(this.mode==="time")this.localTime=l;else if(this.mode==="datetime"){const[r,t]=l.split("T");this.localDate=r||"",this.localTime=t?t.slice(0,5):""}else this.mode==="datetime2"&&(this.localDate=l.split("T")[0]||"",this.localTime="")}},mode:{immediate:!0,handler(){this.parseValue(this.modelValue)}}},methods:{parseValue(l){if(!l){this.localDate="",this.localTime="";return}if(this.mode==="date")this.localDate=l,this.localTime="";else if(this.mode==="time")this.localDate="",this.localTime=l;else if(this.mode==="datetime"){const[r,t]=l.split("T");this.localDate=r||"",this.localTime=t?t.slice(0,5):""}else this.mode==="datetime2"&&(this.localDate=l.split("T")[0]||"",this.localTime="");this.emitValue()},emitValue(){let l="";this.mode==="date"?l=this.localDate||"":this.mode==="time"?l=this.localTime||"":this.mode==="datetime"?!this.localDate||!this.localTime?l="":l=`${this.localDate}T${this.localTime}:${this.segundos}.000`:this.mode==="datetime2"&&(this.localDate?l=`${this.localDate}T${this.secondsMode==="max"?"23:59:59.000":"00:01:00.000"}`:l=""),this.model=l}}},te={class:"w-full"},le={class:"block text-sm font-medium text-gray-700"},re={key:0,class:"text-red-800 ml-2"};function oe(l,r,t,n,s,o){return e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("label",le,[t.required?(e.openBlock(),e.createElementBlock("span",re,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label),1)]),e.createElementVNode("div",{class:e.normalizeClass(o.gridClass)},[o.showDate?e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,type:"date"},{disabled:t.disabled,required:t.required},{"onUpdate:modelValue":r[0]||(r[0]=a=>s.localDate=a),onInput:r[1]||(r[1]=(...a)=>o.emitValue&&o.emitValue(...a)),class:o.dateInputClass}),null,16)),[[e.vModelText,s.localDate]]):e.createCommentVNode("",!0),o.showTime?e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:1,type:"time"},{disabled:t.disabled,required:t.required},{"onUpdate:modelValue":r[2]||(r[2]=a=>s.localTime=a),onInput:r[3]||(r[3]=(...a)=>o.emitValue&&o.emitValue(...a)),class:o.timeInputClass}),null,16)),[[e.vModelText,s.localTime]]):e.createCommentVNode("",!0)],2)])}const y=m(ee,[["render",oe]]),ae={name:"InputDecimalStyle",props:{modelValue:{type:[String,Number],default:""},label:{type:String,default:""},placeholder:{type:String,default:""},decimals:{type:String,default:"2"},maxlength:{type:String,default:"14"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},computed:{getUUID(){return crypto.randomUUID()},formattedValue(){if(this.modelValue===""||this.modelValue===null)return"";const l=parseFloat(this.modelValue);return isNaN(l)?"":l.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:Number(this.decimals)})}},methods:{onKeyDown(l){const r=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"];if(!((l.ctrlKey||l.metaKey)&&["a","c","v","x","z"].includes(l.key.toLowerCase()))&&!r.includes(l.key)){if(l.key>="0"&&l.key<="9"){const t=l.target.value.replace(/,/g,""),n=l.target.selectionStart,s=t.split(".");if(s.length===2){const o=s[1];n>t.indexOf(".")&&o.length>=Number(this.decimals)&&l.preventDefault()}return}l.key==="."||l.key===","?(Number(this.decimals)===0||l.target.value.includes("."))&&l.preventDefault():l.preventDefault()}},onInput(l){let r=l.target.value.replace(/[^0-9.]/g,"");Number(this.decimals)===0&&(r=r.replace(/\./g,""));const t=r.split(".");t.length>2&&(r=t[0]+"."+t.slice(1).join("")),t[1]&&t[1].length>Number(this.decimals)&&(r=t[0]+"."+t[1].slice(0,Number(this.decimals))),this.$emit("update:modelValue",r)},onPaste(l){let t=(l.clipboardData||window.clipboardData).getData("text").replace(/[^0-9.]/g,"");Number(this.decimals)===0&&(t=t.replace(/\./g,""));const n=t.split(".");n.length>2&&(t=n[0]+"."+n.slice(1).join("")),n[1]&&n[1].length>Number(this.decimals)&&(t=n[0]+"."+n[1].slice(0,Number(this.decimals))),t!==""&&this.$emit("update:modelValue",t)},onBlur(){let l=this.modelValue?parseFloat(this.modelValue):"";!isNaN(l)&&l!==""&&(l=l.toFixed(Number(this.decimals))),this.$emit("update:modelValue",l)}}},se={class:"w-full"},ne=["for"],ie={key:0,class:"text-red-800 ml-2"},de={key:0,class:"relative"},ce={class:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-5 h-5"},me=["id","value","placeholder","maxlength"],ge=["id","value","placeholder","maxlength"];function ue(l,r,t,n,s,o){return e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("label",{class:"block text-sm font-medium text-gray-700",for:o.getUUID},[t.required?(e.openBlock(),e.createElementBlock("span",ie,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label),1)],8,ne),l.$slots.icon?(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",ce,[e.renderSlot(l.$slots,"icon")]),e.createElementVNode("input",e.mergeProps({type:"text",id:o.getUUID,value:o.formattedValue,onInput:r[0]||(r[0]=(...a)=>o.onInput&&o.onInput(...a)),onKeydown:r[1]||(r[1]=(...a)=>o.onKeyDown&&o.onKeyDown(...a)),onBlur:r[2]||(r[2]=(...a)=>o.onBlur&&o.onBlur(...a)),inputmode:"decimal",placeholder:t.placeholder,onPaste:r[3]||(r[3]=e.withModifiers((...a)=>o.onPaste&&o.onPaste(...a),["prevent"])),maxlength:t.maxlength?Number(t.maxlength):null},{disabled:t.disabled,required:t.required},{class:"w-full text-gray-800 bg-white pl-8 pr-3 py-1.5 rounded border border-gray-200 text-right focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"}),null,16,me)])):(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:1,type:"text",id:o.getUUID,value:o.formattedValue,onInput:r[4]||(r[4]=(...a)=>o.onInput&&o.onInput(...a)),onKeydown:r[5]||(r[5]=(...a)=>o.onKeyDown&&o.onKeyDown(...a)),onBlur:r[6]||(r[6]=(...a)=>o.onBlur&&o.onBlur(...a)),inputmode:"decimal",placeholder:t.placeholder,onPaste:r[7]||(r[7]=e.withModifiers((...a)=>o.onPaste&&o.onPaste(...a),["prevent"])),maxlength:t.maxlength?Number(t.maxlength):null},{disabled:t.disabled,required:t.required},{class:"w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 text-right focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"}),null,16,ge))])}const f=m(ae,[["render",ue]]),he={name:"InputStyle",props:{modelValue:{type:[String,Number],default:""},label:{type:String,default:""},type:{type:String,default:"text"},maxlength:{type:String,default:null},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},computed:{getUUID(){return crypto.randomUUID()},model:{get(){return this.modelValue},set(l){this.$emit("update:modelValue",l)}}}},be={class:"w-full"},ye=["for"],fe={key:0,class:"text-red-800 ml-2"},pe={key:0,class:"relative"},ke={class:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-5 h-5"},xe=["id","type","maxlength","placeholder"],we=["id","type","maxlength","placeholder"];function Be(l,r,t,n,s,o){return e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("label",{class:"block text-sm font-medium text-gray-700",for:o.getUUID},[t.required?(e.openBlock(),e.createElementBlock("span",fe,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label),1)],8,ye),l.$slots.icon?(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("div",ke,[e.renderSlot(l.$slots,"icon")]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:o.getUUID,type:t.type,maxlength:t.maxlength?Number(t.maxlength):null,placeholder:t.placeholder},{disabled:t.disabled,required:t.required},{"onUpdate:modelValue":r[0]||(r[0]=a=>o.model=a),class:"w-full text-gray-800 bg-white pl-8 pr-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"}),null,16,xe),[[e.vModelDynamic,o.model]])])):e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:1,id:o.getUUID,type:t.type,maxlength:t.maxlength?Number(t.maxlength):null,placeholder:t.placeholder},{disabled:t.disabled,required:t.required},{"onUpdate:modelValue":r[1]||(r[1]=a=>o.model=a),class:"w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"}),null,16,we)),[[e.vModelDynamic,o.model]])])}const p=m(he,[["render",Be]]),Se={name:"SelectStyle",props:{modelValue:[String,Number,Object,null],label:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},option:{type:String,default:"- Seleccione…"},oEmpty:{type:String,default:"- Sin registros"}},computed:{getUUID(){return crypto.randomUUID()},model:{get(){return this.modelValue},set(l){this.$emit("update:modelValue",l)}}}},Ce={class:"w-full"},Ve=["for"],Ee={key:0,class:"text-red-800 ml-2"},_e=["id"],De={value:"",disabled:""},Ne=["value"];function Te(l,r,t,n,s,o){return e.openBlock(),e.createElementBlock("div",Ce,[e.createElementVNode("label",{class:"block text-sm font-medium text-gray-700",for:o.getUUID},[t.required?(e.openBlock(),e.createElementBlock("span",Ee,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label),1)],8,Ve),e.withDirectives(e.createElementVNode("select",e.mergeProps({"onUpdate:modelValue":r[0]||(r[0]=a=>o.model=a)},{disabled:t.disabled,required:t.required},{id:o.getUUID,class:"w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"}),[e.createElementVNode("option",De,e.toDisplayString(t.list.length>0?t.option:t.oEmpty),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.list,(a,i)=>(e.openBlock(),e.createElementBlock("option",{key:i,value:a.id},e.toDisplayString(a.text),9,Ne))),128))],16,_e),[[e.vModelSelect,o.model]])])}const k=m(Se,[["render",Te]]),Ue={props:{modelValue:{type:Number,default:0},steps:{type:Array,required:!0},type:{type:String,default:"circle"},text:{type:String,default:"all"},color:{type:String,default:"green"},btnPrevious:{type:String,default:"Anterior"},btnNext:{type:String,default:"Siguiente"},btnFinish:{type:String,default:"Finalizar"},button:{type:Boolean,default:!0},selected:{type:Boolean,default:!1}},emits:["update:modelValue","submit"],computed:{step:{get(){return this.modelValue},set(l){this.$emit("update:modelValue",l)}},solid(){return{gray:"text-white bg-slate-600 hover:bg-slate-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",green:"text-white bg-emerald-600 hover:bg-emerald-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",blue:"text-white bg-sky-600 hover:bg-sky-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",red:"text-white bg-rose-600 hover:bg-rose-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",yellow:"text-white bg-amber-600 hover:bg-amber-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none"}},barActive(){return this.solid[this.color].split(" ").find(l=>l.startsWith("bg-"))},lineActive(){return this.barActive},progressWidth(){const l=this.steps.length;return this.step===0?10:this.step/(l-1)*100}},methods:{circleClass(l){return this.step===l?`${this.barActive} text-white`:this.step>l?`${this.barActive} text-white opacity-90`:"bg-white text-gray-400 border-gray-300"},textClass(l){return this.step>=l?this.barActive.replace("bg-","text-"):"text-gray-400"},next(){this.step<this.steps.length-1&&this.step++},previous(){this.step>0&&this.step--},select(l){this.step=l},submitForm(){this.$emit("submit")}}},Ie={class:"flex items-center gap-6 w-full"},Le=["disabled"],qe={class:"flex-1"},Me={key:0,class:"flex items-center"},ze=["onClick"],Ae={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Pe={key:1,class:"text-sm"},Fe={key:1,class:"w-full"},je={key:0,class:"text-xs mb-1 block"},Ke={class:"w-full h-3 rounded-full bg-gray-200 overflow-hidden relative"},Oe={key:1};function We(l,r,t,n,s,o){return e.openBlock(),e.createElementBlock("div",Ie,[t.button?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:o.step===0,onClick:r[0]||(r[0]=(...a)=>o.previous&&o.previous(...a)),class:e.normalizeClass(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold",o.solid[t.color]])},[r[3]||(r[3]=e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)),e.createTextVNode(" "+e.toDisplayString(t.btnPrevious),1)],10,Le)):e.createCommentVNode("",!0),e.createElementVNode("div",qe,[t.type==="circle"?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.steps,(a,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:e.normalizeClass(["flex items-center",i<t.steps.length-1?"flex-1":""])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col items-center relative",t.selected?"cursor-pointer":"pointer-events-none"]),onClick:g=>o.select(i)},[e.createElementVNode("div",{class:e.normalizeClass(["w-9 h-9 rounded-full flex items-center justify-center border-2 font-semibold transition-colors duration-200",o.circleClass(i)])},[o.step>i?(e.openBlock(),e.createElementBlock("svg",Ae,[...r[4]||(r[4]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):(e.openBlock(),e.createElementBlock("span",Pe,e.toDisplayString(i+1),1))],2),t.text==="all"||t.text==="only"&&o.step===i?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["absolute -top-5 text-xs font-medium whitespace-nowrap transition-colors duration-200",o.textClass(i)])},e.toDisplayString(a),3)):e.createCommentVNode("",!0)],10,ze),i<t.steps.length-1?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex-1 h-2 mx-3 rounded transition-colors duration-200",o.step>i?o.lineActive:"bg-gray-300"])},null,2)):e.createCommentVNode("",!0)],2))),128))])):t.type==="linear"?(e.openBlock(),e.createElementBlock("div",Fe,[t.text==="all"?(e.openBlock(),e.createElementBlock("span",je,e.toDisplayString(Math.round(o.progressWidth))+"% ",1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ke,[r[6]||(r[6]=e.createElementVNode("div",{class:"absolute inset-0"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["h-full rounded-full transition-all duration-300 relative shadow-md",o.barActive]),style:e.normalizeStyle({width:o.progressWidth+"%"})},[...r[5]||(r[5]=[e.createElementVNode("div",{class:"absolute inset-0 bg-white/20 mix-blend-overlay animate-pulse"},null,-1)])],6)])])):e.createCommentVNode("",!0)]),t.button?(e.openBlock(),e.createElementBlock("div",Oe,[o.step<t.steps.length-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:r[1]||(r[1]=(...a)=>o.next&&o.next(...a)),class:e.normalizeClass(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold",o.solid[t.color]])},[e.createTextVNode(e.toDisplayString(t.btnNext)+" ",1),r[7]||(r[7]=e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))],2)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",onClick:r[2]||(r[2]=(...a)=>o.submitForm&&o.submitForm(...a)),class:e.normalizeClass(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold",o.solid[t.color]])},[e.createTextVNode(e.toDisplayString(t.btnFinish)+" ",1),r[8]||(r[8]=e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1))],2))])):e.createCommentVNode("",!0)])}const x=m(Ue,[["render",We]]),He={name:"TableStyle",props:{columns:{type:Array,required:!0},rows:{type:Array,default:()=>[]}}},Re={class:"w-full overflow-x-auto bg-white border border-gray-300 rounded shadow-sm"},Ge={class:"min-w-full"},Je={class:"bg-gray-800"},Qe={key:1},Xe={key:0},Ye=["colspan"];function Ze(l,r,t,n,s,o){return e.openBlock(),e.createElementBlock("div",Re,[e.createElementVNode("table",Ge,[e.createElementVNode("thead",null,[e.createElementVNode("tr",Je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(a,i)=>(e.openBlock(),e.createElementBlock("th",{key:i,class:"px-4 py-1.5 text-left text-sm font-semibold text-white border-b border-gray-600"},e.toDisplayString(a.label),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,(a,i)=>(e.openBlock(),e.createElementBlock("tr",{key:i,class:"hover:bg-gray-100 transition-colors cursor-default"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(g,ct)=>(e.openBlock(),e.createElementBlock("td",{key:ct,class:"px-4 py-1.5 text-sm text-gray-700 border-b border-gray-200"},[l.$slots[g.field]?e.renderSlot(l.$slots,g.field,{key:0,row:a}):(e.openBlock(),e.createElementBlock("span",Qe,e.toDisplayString(a[g.field]),1))]))),128))]))),128)),t.rows.length===0?(e.openBlock(),e.createElementBlock("tr",Xe,[e.createElementVNode("td",{colspan:t.columns.length,class:"px-4 py-10 text-center text-gray-500 text-sm bg-gray-50"},[...r[0]||(r[0]=[e.createElementVNode("div",{class:"flex flex-col items-center gap-3"},[e.createElementVNode("span",{class:"text-gray-600 font-medium"},"No hay datos para mostrar")],-1)])],8,Ye)])):e.createCommentVNode("",!0)])])])}const w=m(He,[["render",Ze]]),$e={name:"TextAreaStyle",props:{modelValue:String,label:{type:String,default:""},note:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},row:{type:String,default:"3"},maxlength:{type:String,default:null}},computed:{getUUID(){return crypto.randomUUID()},model:{get(){return this.modelValue},set(l){this.$emit("update:modelValue",l)}}}},ve={class:"w-full"},et={class:"flex justify-between"},tt=["for"],lt={key:0,class:"text-red-800 ml-2"},rt=["for"],ot=["id","placeholder","maxlength","rows"];function at(l,r,t,n,s,o){return e.openBlock(),e.createElementBlock("div",ve,[e.createElementVNode("div",et,[e.createElementVNode("label",{class:"block text-sm font-medium text-gray-700",for:o.getUUID},[t.required?(e.openBlock(),e.createElementBlock("span",lt,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label),1)],8,tt),t.note?(e.openBlock(),e.createElementBlock("label",{key:0,class:"block text-xs text-gray-700",for:o.getUUID},e.toDisplayString(t.note),9,rt)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({"onUpdate:modelValue":r[0]||(r[0]=a=>o.model=a),id:o.getUUID,placeholder:t.placeholder},{disabled:t.disabled,required:t.required},{maxlength:t.maxlength?Number(t.maxlength):null,rows:Number(t.row),class:"w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed resize-none"}),null,16,ot),[[e.vModelText,o.model]])])}const B=m($e,[["render",at]]),st={name:"ToggleStyle",props:{modelValue:{type:Boolean,default:!1},label:{type:String,default:""},color:{type:String,default:"gray"},shape:{type:String,default:"round"},disabled:{type:Boolean,default:!1}},computed:{model:{get(){return this.modelValue},set(l){this.$emit("update:modelValue",l)}},shapeToggle(){return{round:"rounded-full",square:"rounded-md"}[this.shape]},computedClasses(){const l={gray:"bg-slate-600 hover:bg-slate-700 border border-gray-800 cursor-pointer",green:"bg-emerald-600 hover:bg-emerald-700 border border-green-700 cursor-pointer",blue:"bg-sky-600 hover:bg-sky-700 border border-blue-700 cursor-pointer",red:"bg-rose-600 hover:bg-rose-700 border border-red-700 cursor-pointer",yellow:"bg-amber-600 hover:bg-amber-700 border border-yellow-600 cursor-pointer"};return this.model?l[this.color]:"bg-gray-200 border border-gray-300"},disabledColorClasses(){const l={gray:"bg-slate-600 border border-slate-300 cursor-not-allowed opacity-60",green:"bg-emerald-600 border border-emerald-300 cursor-not-allowed opacity-60",blue:"bg-sky-600 border border-sky-300 cursor-not-allowed opacity-60",red:"bg-rose-600 border border-rose-300 cursor-not-allowed opacity-60",yellow:"bg-amber-600 border border-amber-300 cursor-not-allowed opacity-60"};return this.modelValue?l[this.color]:"bg-gray-200 border border-gray-300 cursor-not-allowed"},disabledClasses(){return this.disabledColorClasses}},methods:{toggle(){this.disabled||(this.model=!this.model)}}},nt={class:"block text-sm font-medium text-gray-700"};function it(l,r,t,n,s,o){return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("label",nt,e.toDisplayString(t.label),1),e.createElementVNode("div",{class:e.normalizeClass(["relative w-11 h-6 inline-flex items-center transition-colors duration-300 px-1",o.shapeToggle,t.disabled?o.disabledClasses:o.computedClasses]),onClick:r[0]||(r[0]=(...a)=>o.toggle&&o.toggle(...a))},[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0.75 left-1 w-4 h-4 bg-white shadow transform transition-all duration-300",o.shapeToggle,o.model?"translate-x-full":"translate-x-0"])},null,2)],2)])}const S=m(st,[["render",it]]),dt={install(l){l.component("AlertStyle",c),l.component("ButtonStyle",u),l.component("CheckStyle",h),l.component("ComboBoxStyle",b),l.component("DateTimeStyle",y),l.component("InputDecimalStyle",f),l.component("InputStyle",p),l.component("SelectStyle",k),l.component("StepperStyle",x),l.component("TableStyle",w),l.component("TextAreaStyle",B),l.component("ToggleStyle",S),l.config.globalProperties.$alertstyle=c}};d.AlertStyle=c,d.ButtonStyle=u,d.CheckStyle=h,d.ComboBoxStyle=b,d.DateTimeStyle=y,d.InputDecimalStyle=f,d.InputStyle=p,d.SelectStyle=k,d.StepperStyle=x,d.TableStyle=w,d.TextAreaStyle=B,d.ToggleStyle=S,d.default=dt,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
8
|
+
`,s.querySelector(".alert-close").addEventListener("click",()=>{c.remove(s)}),c.container.appendChild(s),setTimeout(()=>s.classList.add("show"),10),a>0&&setTimeout(()=>c.remove(s),a)}static success(r,l=""){this.#e(r,l,this.type.success)}static error(r,l=""){this.#e(r,l,this.type.error)}static warning(r,l=""){this.#e(r,l,this.type.warning)}static info(r,l=""){this.#e(r,l,this.type.info)}static neutral(r,l=""){this.#e(r,l,this.type.neutral)}static ensureContainer(){this.container||(this.container=document.createElement("div"),this.container.className="alert-container",document.body.appendChild(this.container))}static remove(r){r.classList.add("hide"),setTimeout(()=>r.remove(),250)}}const m=(t,r)=>{const l=t.__vccOpts||t;for(const[n,a]of r)l[n]=a;return l},B={name:"ButtonStyle",emits:["click"],props:{type:{type:String,default:"button",validator:t=>["button","submit"].includes(t)},class:{type:String,default:""},variant:{type:String,default:"solid"},color:{type:String,default:"gray"},disabled:{type:Boolean,default:!1},delay:{type:String,default:"1.5"}},data(){return{internalDisabled:!1}},computed:{isDisabled(){return this.disabled||this.internalDisabled},buttonClasses(){if(this.class)return`${this.class} cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed`;const t=["h-min font-semibold items-center justify-center rounded px-3 py-1.5 gap-1 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed"],r={solid:{gray:"text-white bg-slate-600 enabled:hover:bg-slate-700",green:"text-white bg-emerald-600 enabled:hover:bg-emerald-700",blue:"text-white bg-sky-600 enabled:hover:bg-sky-700",red:"text-white bg-rose-600 enabled:hover:bg-rose-700",yellow:"text-white bg-amber-600 enabled:hover:bg-amber-700"},outline:{gray:"text-slate-700 enabled:hover:bg-slate-50 border border-slate-700",green:"text-emerald-700 enabled:hover:bg-emerald-50 border border-emerald-700",blue:"text-sky-700 enabled:hover:bg-sky-50 border border-sky-700",red:"text-rose-700 enabled:hover:bg-rose-50 border border-rose-700",yellow:"text-amber-700 enabled:hover:bg-amber-50 border border-amber-700"}};return t.push(r[this.variant][this.color]),t}},methods:{handleClick(t){this.isDisabled||(this.$emit("click",t),this.internalDisabled=!0,setTimeout(()=>{this.internalDisabled=!1},1e3*Number(this.delay)))}}},V=["type","disabled"];function E(t,r,l,n,a,o){return e.openBlock(),e.createElementBlock("button",{type:l.type,onClick:r[0]||(r[0]=(...s)=>o.handleClick&&o.handleClick(...s)),disabled:o.isDisabled,class:e.normalizeClass(o.buttonClasses)},[e.renderSlot(t.$slots,"default")],10,V)}const g=m(B,[["render",E]]),D={name:"CheckStyle",props:{label:{type:String,default:""},list:{type:Array,default:()=>[]},grid:{type:String,default:"grid grid-cols-4"},all:{type:Boolean,default:!1},modelValue:{type:[Array,String,Number,Object],default:()=>[]},returnAll:{type:Boolean,default:!1},returnType:{type:String,default:"id"}},data(){return{realSelection:[]}},computed:{getUUID(){return crypto.randomUUID()},isAllSelected(){return this.list.length>0&&this.realSelection.length===this.list.length}},watch:{modelValue:{immediate:!0,handler(t){Array.isArray(t)?this.realSelection=[...t]:t?this.realSelection=[t]:this.realSelection=[]}}},methods:{getValue(t){return this.returnType==="object"?t:this.returnType==="text"?t.name:t.id},isChecked(t){const r=this.getValue(t);return this.realSelection.includes(r)},emitExternal(){if(!this.returnAll&&this.realSelection.length===this.list.length){this.$emit("update:modelValue","");return}this.$emit("update:modelValue",this.realSelection.length?[...this.realSelection]:"")},onChange(t){const r=this.getValue(t);this.realSelection.includes(r)?this.realSelection=this.realSelection.filter(l=>l!==r):this.all?this.realSelection.push(r):this.realSelection=[r],this.emitExternal()},toggleSelectAll(){this.all&&(this.isAllSelected?this.realSelection=[]:this.realSelection=this.list.map(t=>this.getValue(t)),this.emitExternal())}}},_={class:"w-full"},N={class:"flex items-center justify-between"},T={class:"block text-sm font-medium text-gray-700"},U={key:0,class:"flex items-center gap-2 select-none"},I=["id","checked"],L=["for"],M=["id","checked","onChange"],q=["for"];function z(t,r,l,n,a,o){return e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("div",N,[e.createElementVNode("h3",T,e.toDisplayString(l.label),1),l.all?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("input",{type:"checkbox",id:"todos-"+o.getUUID,checked:o.isAllSelected,onChange:r[0]||(r[0]=(...s)=>o.toggleSelectAll&&o.toggleSelectAll(...s)),class:"w-4 h-4 accent-indigo-600 border-gray-300 rounded focus:ring-indigo-200"},null,40,I),e.createElementVNode("label",{for:"todos-"+o.getUUID,class:"text-sm text-gray-600 uppercase truncate"}," Seleccionar todos ",8,L)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["max-h-48 overflow-auto space-y-1",l.grid])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.list,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:"flex items-center gap-2 select-none"},[e.createElementVNode("input",{type:"checkbox",id:o.getUUID+"-"+s.id,checked:o.isChecked(s),onChange:i=>o.onChange(s),class:"w-4 h-4 accent-indigo-600 border-gray-300 rounded focus:ring-indigo-200"},null,40,M),e.createElementVNode("label",{for:o.getUUID+"-"+s.id,class:"truncate text-gray-700"},e.toDisplayString(s.name),9,q)]))),128))],2)])}const u=m(D,[["render",z]]),A={name:"ComboBoxStyle",props:{modelValue:[String,Number,Object,null],label:{type:String,default:""},placeholder:{type:String,default:"Buscar..."},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},oEmpty:{type:String,default:"- Sin registros"}},data(){return{uuid:crypto.randomUUID(),search:"",searchCopy:"",open:!1}},computed:{filteredList(){return this.search?this.list.filter(t=>t.name.toLowerCase().includes(this.search.toLowerCase())):this.list},model:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},watch:{modelValue:{immediate:!0,handler(t){if(t===null||t===""){this.search="",this.searchCopy="";return}const r=this.list.find(l=>l.id===t);r&&(this.search=r.name,this.searchCopy=r.name)}}},methods:{selectItem(t){this.model=t.id,this.search=t.name,this.searchCopy=t.name,this.open=!1},clearItem(){this.disabled||(this.model=null,this.search="",this.searchCopy="",this.open=!1)},closeWithDelay(){setTimeout(()=>{this.model?this.search.trim()!==this.searchCopy&&(this.search=this.searchCopy):this.search="",this.open=!1},120)}}},P={class:"w-full relative"},F=["for"],j={class:"text-sm font-medium text-gray-700"},K={key:0,class:"text-red-800 ml-1"},O={key:0,class:"relative"},W={class:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-5 h-5"},H=["id","placeholder","disabled","required"],R=["id","placeholder","disabled","required"],G={key:2,class:"absolute z-10 left-0 right-0 mt-0.5 bg-white border border-gray-200 rounded shadow max-h-48 overflow-auto"},J={key:0,class:"px-3 py-2 text-gray-800"},Q=["onMousedown"];function X(t,r,l,n,a,o){return e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("label",{class:"flex justify-between",for:a.uuid},[e.createElementVNode("div",j,[e.createTextVNode(e.toDisplayString(l.label)+" ",1),l.required?(e.openBlock(),e.createElementBlock("span",K,"*")):e.createCommentVNode("",!0)]),o.model?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-xs px-2.5 rounded text-red-800 hover:bg-red-50 cursor-pointer",onMousedown:r[0]||(r[0]=e.withModifiers(()=>{},["prevent"])),onClick:r[1]||(r[1]=(...s)=>o.clearItem&&o.clearItem(...s))},"Limpiar ",32)):e.createCommentVNode("",!0)],8,F),t.$slots.icon?(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",W,[e.renderSlot(t.$slots,"icon")]),e.withDirectives(e.createElementVNode("input",{id:a.uuid,type:"text","onUpdate:modelValue":r[2]||(r[2]=s=>a.search=s),placeholder:l.placeholder,disabled:l.disabled,required:l.required,onBlur:r[3]||(r[3]=(...s)=>o.closeWithDelay&&o.closeWithDelay(...s)),onFocus:r[4]||(r[4]=s=>a.open=!l.disabled),onInput:r[5]||(r[5]=s=>a.open=!l.disabled),class:"w-full pl-10 pr-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600"},null,40,H),[[e.vModelText,a.search]])])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,id:a.uuid,type:"text","onUpdate:modelValue":r[6]||(r[6]=s=>a.search=s),placeholder:l.placeholder,disabled:l.disabled,required:l.required,onBlur:r[7]||(r[7]=(...s)=>o.closeWithDelay&&o.closeWithDelay(...s)),onFocus:r[8]||(r[8]=s=>a.open=!l.disabled),onInput:r[9]||(r[9]=s=>a.open=!l.disabled),class:"w-full px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600"},null,40,R)),[[e.vModelText,a.search]]),a.open&&!l.disabled?(e.openBlock(),e.createElementBlock("div",G,[o.filteredList.length===0?(e.openBlock(),e.createElementBlock("div",J,e.toDisplayString(l.oEmpty),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.filteredList,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,onMousedown:e.withModifiers(i=>o.selectItem(s),["prevent"]),class:"px-3 py-2 cursor-pointer hover:bg-gray-100"},e.toDisplayString(s.name),41,Q))),128))])):e.createCommentVNode("",!0)])}const y=m(A,[["render",X]]),Y={name:"DateTimeStyle",props:{modelValue:String,disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},mode:{type:String,default:"datetime"},label:{type:String,default:"Seleccionar fecha"},secondsMode:{type:String,default:"default"}},data(){return{localDate:"",localTime:""}},computed:{model:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}},showDate(){return["date","datetime","datetime2"].includes(this.mode)},showTime(){return["time","datetime"].includes(this.mode)},segundos(){return this.secondsMode==="max"?"59":"01"},dateInputClass(){let t="w-full text-gray-800 bg-white px-3 py-1.5 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed";return this.showDate&&this.showTime?t+" rounded-l":t+" rounded"},timeInputClass(){let t="w-full text-gray-800 bg-white px-3 py-1.5 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed";return this.showDate&&this.showTime?t+" rounded-r":t+" rounded"},gridClass(){return this.showDate&&this.showTime?"grid grid-cols-2":""}},watch:{modelValue:{immediate:!0,handler(t){if(!t){this.localDate="",this.localTime="";return}if(this.mode==="date")this.localDate=t;else if(this.mode==="time")this.localTime=t;else if(this.mode==="datetime"){const[r,l]=t.split("T");this.localDate=r||"",this.localTime=l?l.slice(0,5):""}else this.mode==="datetime2"&&(this.localDate=t.split("T")[0]||"",this.localTime="")}},mode:{immediate:!0,handler(){this.parseValue(this.modelValue)}}},methods:{parseValue(t){if(!t){this.localDate="",this.localTime="";return}if(this.mode==="date")this.localDate=t,this.localTime="";else if(this.mode==="time")this.localDate="",this.localTime=t;else if(this.mode==="datetime"){const[r,l]=t.split("T");this.localDate=r||"",this.localTime=l?l.slice(0,5):""}else this.mode==="datetime2"&&(this.localDate=t.split("T")[0]||"",this.localTime="");this.emitValue()},emitValue(){let t="";this.mode==="date"?t=this.localDate||"":this.mode==="time"?t=this.localTime||"":this.mode==="datetime"?!this.localDate||!this.localTime?t="":t=`${this.localDate}T${this.localTime}:${this.segundos}.000`:this.mode==="datetime2"&&(this.localDate?t=`${this.localDate}T${this.secondsMode==="max"?"23:59:59.000":"00:01:00.000"}`:t=""),this.model=t}}},Z={class:"w-full"},$={class:"block text-sm font-medium text-gray-700"},v={key:0,class:"text-red-800 ml-2"};function ee(t,r,l,n,a,o){return e.openBlock(),e.createElementBlock("div",Z,[e.createElementVNode("label",$,[l.required?(e.openBlock(),e.createElementBlock("span",v,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)]),e.createElementVNode("div",{class:e.normalizeClass(o.gridClass)},[o.showDate?e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,type:"date"},{disabled:l.disabled,required:l.required},{"onUpdate:modelValue":r[0]||(r[0]=s=>a.localDate=s),onInput:r[1]||(r[1]=(...s)=>o.emitValue&&o.emitValue(...s)),class:o.dateInputClass}),null,16)),[[e.vModelText,a.localDate]]):e.createCommentVNode("",!0),o.showTime?e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:1,type:"time"},{disabled:l.disabled,required:l.required},{"onUpdate:modelValue":r[2]||(r[2]=s=>a.localTime=s),onInput:r[3]||(r[3]=(...s)=>o.emitValue&&o.emitValue(...s)),class:o.timeInputClass}),null,16)),[[e.vModelText,a.localTime]]):e.createCommentVNode("",!0)],2)])}const b=m(Y,[["render",ee]]),te={name:"InputDecimalStyle",props:{modelValue:{type:[String,Number],default:""},label:{type:String,default:""},placeholder:{type:String,default:""},decimals:{type:String,default:"2"},maxlength:{type:String,default:"14"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},computed:{getUUID(){return crypto.randomUUID()},formattedValue(){if(this.modelValue===""||this.modelValue===null)return"";const t=parseFloat(this.modelValue);return isNaN(t)?"":t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:Number(this.decimals)})}},methods:{onKeyDown(t){const r=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"];if(!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z"].includes(t.key.toLowerCase()))&&!r.includes(t.key)){if(t.key>="0"&&t.key<="9"){const l=t.target.value.replace(/,/g,""),n=t.target.selectionStart,a=l.split(".");if(a.length===2){const o=a[1];n>l.indexOf(".")&&o.length>=Number(this.decimals)&&t.preventDefault()}return}t.key==="."||t.key===","?(Number(this.decimals)===0||t.target.value.includes("."))&&t.preventDefault():t.preventDefault()}},onInput(t){let r=t.target.value.replace(/[^0-9.]/g,"");Number(this.decimals)===0&&(r=r.replace(/\./g,""));const l=r.split(".");l.length>2&&(r=l[0]+"."+l.slice(1).join("")),l[1]&&l[1].length>Number(this.decimals)&&(r=l[0]+"."+l[1].slice(0,Number(this.decimals))),this.$emit("update:modelValue",r)},onPaste(t){let l=(t.clipboardData||window.clipboardData).getData("text").replace(/[^0-9.]/g,"");Number(this.decimals)===0&&(l=l.replace(/\./g,""));const n=l.split(".");n.length>2&&(l=n[0]+"."+n.slice(1).join("")),n[1]&&n[1].length>Number(this.decimals)&&(l=n[0]+"."+n[1].slice(0,Number(this.decimals))),l!==""&&this.$emit("update:modelValue",l)},onBlur(){let t=this.modelValue?parseFloat(this.modelValue):"";!isNaN(t)&&t!==""&&(t=t.toFixed(Number(this.decimals))),this.$emit("update:modelValue",t)}}},le={class:"w-full"},re=["for"],oe={key:0,class:"text-red-800 ml-2"},se={key:0,class:"relative"},ae={class:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-5 h-5"},ne=["id","value","placeholder","maxlength"],ie=["id","value","placeholder","maxlength"];function de(t,r,l,n,a,o){return e.openBlock(),e.createElementBlock("div",le,[e.createElementVNode("label",{class:"block text-sm font-medium text-gray-700",for:o.getUUID},[l.required?(e.openBlock(),e.createElementBlock("span",oe,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],8,re),t.$slots.icon?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",ae,[e.renderSlot(t.$slots,"icon")]),e.createElementVNode("input",e.mergeProps({type:"text",id:o.getUUID,value:o.formattedValue,onInput:r[0]||(r[0]=(...s)=>o.onInput&&o.onInput(...s)),onKeydown:r[1]||(r[1]=(...s)=>o.onKeyDown&&o.onKeyDown(...s)),onBlur:r[2]||(r[2]=(...s)=>o.onBlur&&o.onBlur(...s)),inputmode:"decimal",placeholder:l.placeholder,onPaste:r[3]||(r[3]=e.withModifiers((...s)=>o.onPaste&&o.onPaste(...s),["prevent"])),maxlength:l.maxlength?Number(l.maxlength):null},{disabled:l.disabled,required:l.required},{class:"w-full text-gray-800 bg-white pl-8 pr-3 py-1.5 rounded border border-gray-200 text-right focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"}),null,16,ne)])):(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:1,type:"text",id:o.getUUID,value:o.formattedValue,onInput:r[4]||(r[4]=(...s)=>o.onInput&&o.onInput(...s)),onKeydown:r[5]||(r[5]=(...s)=>o.onKeyDown&&o.onKeyDown(...s)),onBlur:r[6]||(r[6]=(...s)=>o.onBlur&&o.onBlur(...s)),inputmode:"decimal",placeholder:l.placeholder,onPaste:r[7]||(r[7]=e.withModifiers((...s)=>o.onPaste&&o.onPaste(...s),["prevent"])),maxlength:l.maxlength?Number(l.maxlength):null},{disabled:l.disabled,required:l.required},{class:"w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 text-right focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"}),null,16,ie))])}const f=m(te,[["render",de]]),ce={name:"InputStyle",props:{modelValue:{type:[String,Number],default:""},label:{type:String,default:""},type:{type:String,default:"text"},maxlength:{type:String,default:null},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},computed:{getUUID(){return crypto.randomUUID()},model:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}}},me={class:"w-full"},he=["for"],ge={key:0,class:"text-red-800 ml-2"},ue={key:0,class:"relative"},ye={class:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 w-5 h-5"},be=["id","type","maxlength","placeholder"],fe=["id","type","maxlength","placeholder"];function pe(t,r,l,n,a,o){return e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("label",{class:"block text-sm font-medium text-gray-700",for:o.getUUID},[l.required?(e.openBlock(),e.createElementBlock("span",ge,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],8,he),t.$slots.icon?(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("div",ye,[e.renderSlot(t.$slots,"icon")]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:o.getUUID,type:l.type,maxlength:l.maxlength?Number(l.maxlength):null,placeholder:l.placeholder},{disabled:l.disabled,required:l.required},{"onUpdate:modelValue":r[0]||(r[0]=s=>o.model=s),class:"w-full text-gray-800 bg-white pl-8 pr-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"}),null,16,be),[[e.vModelDynamic,o.model]])])):e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:1,id:o.getUUID,type:l.type,maxlength:l.maxlength?Number(l.maxlength):null,placeholder:l.placeholder},{disabled:l.disabled,required:l.required},{"onUpdate:modelValue":r[1]||(r[1]=s=>o.model=s),class:"w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"}),null,16,fe)),[[e.vModelDynamic,o.model]])])}const p=m(ce,[["render",pe]]),ke={name:"SelectStyle",props:{modelValue:[String,Number,Object,null],label:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},option:{type:String,default:"- Seleccione…"},oEmpty:{type:String,default:"- Sin registros"}},computed:{getUUID(){return crypto.randomUUID()},model:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}}},xe={class:"w-full"},we=["for"],Ce={key:0,class:"text-red-800 ml-2"},Se=["id"],Be={value:"",disabled:""},Ve=["value"];function Ee(t,r,l,n,a,o){return e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("label",{class:"block text-sm font-medium text-gray-700",for:o.getUUID},[l.required?(e.openBlock(),e.createElementBlock("span",Ce,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],8,we),e.withDirectives(e.createElementVNode("select",e.mergeProps({"onUpdate:modelValue":r[0]||(r[0]=s=>o.model=s)},{disabled:l.disabled,required:l.required},{id:o.getUUID,class:"w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed"}),[e.createElementVNode("option",Be,e.toDisplayString(l.list.length>0?l.option:l.oEmpty),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.list,(s,i)=>(e.openBlock(),e.createElementBlock("option",{key:i,value:s.id},e.toDisplayString(s.text),9,Ve))),128))],16,Se),[[e.vModelSelect,o.model]])])}const k=m(ke,[["render",Ee]]),De={props:{modelValue:{type:Number,default:0},steps:{type:Array,required:!0},type:{type:String,default:"circle"},text:{type:String,default:"all"},color:{type:String,default:"green"},btnPrevious:{type:String,default:"Anterior"},btnNext:{type:String,default:"Siguiente"},btnFinish:{type:String,default:"Finalizar"},button:{type:Boolean,default:!0},selected:{type:Boolean,default:!1}},emits:["update:modelValue","submit"],computed:{step:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}},solid(){return{gray:"text-white bg-slate-600 hover:bg-slate-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",green:"text-white bg-emerald-600 hover:bg-emerald-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",blue:"text-white bg-sky-600 hover:bg-sky-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",red:"text-white bg-rose-600 hover:bg-rose-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none",yellow:"text-white bg-amber-600 hover:bg-amber-700 cursor-pointer disabled:opacity-60 disabled:pointer-events-none"}},barActive(){return this.solid[this.color].split(" ").find(t=>t.startsWith("bg-"))},lineActive(){return this.barActive},progressWidth(){const t=this.steps.length;return this.step===0?10:this.step/(t-1)*100}},methods:{circleClass(t){return this.step===t?`${this.barActive} text-white`:this.step>t?`${this.barActive} text-white opacity-90`:"bg-white text-gray-400 border-gray-300"},textClass(t){return this.step>=t?this.barActive.replace("bg-","text-"):"text-gray-400"},next(){this.step<this.steps.length-1&&this.step++},previous(){this.step>0&&this.step--},select(t){this.step=t},submitForm(){this.$emit("submit")}}},_e={class:"flex items-center gap-6 w-full"},Ne=["disabled"],Te={class:"flex-1"},Ue={key:0,class:"flex items-center"},Ie=["onClick"],Le={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Me={key:1,class:"text-sm"},qe={key:1,class:"w-full"},ze={key:0,class:"text-xs mb-1 block"},Ae={class:"w-full h-3 rounded-full bg-gray-200 overflow-hidden relative"},Pe={key:1};function Fe(t,r,l,n,a,o){return e.openBlock(),e.createElementBlock("div",_e,[l.button?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:o.step===0,onClick:r[0]||(r[0]=(...s)=>o.previous&&o.previous(...s)),class:e.normalizeClass(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold",o.solid[l.color]])},[r[3]||(r[3]=e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)),e.createTextVNode(" "+e.toDisplayString(l.btnPrevious),1)],10,Ne)):e.createCommentVNode("",!0),e.createElementVNode("div",Te,[l.type==="circle"?(e.openBlock(),e.createElementBlock("div",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.steps,(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:e.normalizeClass(["flex items-center",i<l.steps.length-1?"flex-1":""])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col items-center relative",l.selected?"cursor-pointer":"pointer-events-none"]),onClick:h=>o.select(i)},[e.createElementVNode("div",{class:e.normalizeClass(["w-9 h-9 rounded-full flex items-center justify-center border-2 font-semibold transition-colors duration-200",o.circleClass(i)])},[o.step>i?(e.openBlock(),e.createElementBlock("svg",Le,[...r[4]||(r[4]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):(e.openBlock(),e.createElementBlock("span",Me,e.toDisplayString(i+1),1))],2),l.text==="all"||l.text==="only"&&o.step===i?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["absolute -top-5 text-xs font-medium whitespace-nowrap transition-colors duration-200",o.textClass(i)])},e.toDisplayString(s),3)):e.createCommentVNode("",!0)],10,Ie),i<l.steps.length-1?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex-1 h-2 mx-3 rounded transition-colors duration-200",o.step>i?o.lineActive:"bg-gray-300"])},null,2)):e.createCommentVNode("",!0)],2))),128))])):l.type==="linear"?(e.openBlock(),e.createElementBlock("div",qe,[l.text==="all"?(e.openBlock(),e.createElementBlock("span",ze,e.toDisplayString(Math.round(o.progressWidth))+"% ",1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ae,[r[6]||(r[6]=e.createElementVNode("div",{class:"absolute inset-0"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["h-full rounded-full transition-all duration-300 relative shadow-md",o.barActive]),style:e.normalizeStyle({width:o.progressWidth+"%"})},[...r[5]||(r[5]=[e.createElementVNode("div",{class:"absolute inset-0 bg-white/20 mix-blend-overlay animate-pulse"},null,-1)])],6)])])):e.createCommentVNode("",!0)]),l.button?(e.openBlock(),e.createElementBlock("div",Pe,[o.step<l.steps.length-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:r[1]||(r[1]=(...s)=>o.next&&o.next(...s)),class:e.normalizeClass(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold",o.solid[l.color]])},[e.createTextVNode(e.toDisplayString(l.btnNext)+" ",1),r[7]||(r[7]=e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))],2)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",onClick:r[2]||(r[2]=(...s)=>o.submitForm&&o.submitForm(...s)),class:e.normalizeClass(["h-min inline-flex items-center gap-1 px-3 py-1.5 rounded font-semibold",o.solid[l.color]])},[e.createTextVNode(e.toDisplayString(l.btnFinish)+" ",1),r[8]||(r[8]=e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1))],2))])):e.createCommentVNode("",!0)])}const x=m(De,[["render",Fe]]),je={name:"TableStyle",props:{columns:{type:Array,required:!0},rows:{type:Array,default:()=>[]}}},Ke={class:"w-full overflow-x-auto bg-white border border-gray-300 rounded shadow-sm"},Oe={class:"min-w-full"},We={class:"bg-gray-800"},He={key:1},Re={key:0},Ge=["colspan"];function Je(t,r,l,n,a,o){return e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("table",Oe,[e.createElementVNode("thead",null,[e.createElementVNode("tr",We,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,(s,i)=>(e.openBlock(),e.createElementBlock("th",{key:i,class:"px-4 py-1.5 text-left text-sm font-semibold text-white border-b border-gray-600"},e.toDisplayString(s.label),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.rows,(s,i)=>(e.openBlock(),e.createElementBlock("tr",{key:i,class:"hover:bg-gray-100 transition-colors cursor-default"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,(h,at)=>(e.openBlock(),e.createElementBlock("td",{key:at,class:"px-4 py-1.5 text-sm text-gray-700 border-b border-gray-200"},[t.$slots[h.field]?e.renderSlot(t.$slots,h.field,{key:0,row:s}):(e.openBlock(),e.createElementBlock("span",He,e.toDisplayString(s[h.field]),1))]))),128))]))),128)),l.rows.length===0?(e.openBlock(),e.createElementBlock("tr",Re,[e.createElementVNode("td",{colspan:l.columns.length,class:"px-4 py-10 text-center text-gray-500 text-sm bg-gray-50"},[...r[0]||(r[0]=[e.createElementVNode("div",{class:"flex flex-col items-center gap-3"},[e.createElementVNode("span",{class:"text-gray-600 font-medium"},"No hay datos para mostrar")],-1)])],8,Ge)])):e.createCommentVNode("",!0)])])])}const w=m(je,[["render",Je]]),Qe={name:"TextAreaStyle",props:{modelValue:String,label:{type:String,default:""},note:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},row:{type:String,default:"3"},maxlength:{type:String,default:null}},computed:{getUUID(){return crypto.randomUUID()},model:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}}},Xe={class:"w-full"},Ye={class:"flex justify-between"},Ze=["for"],$e={key:0,class:"text-red-800 ml-2"},ve=["for"],et=["id","placeholder","maxlength","rows"];function tt(t,r,l,n,a,o){return e.openBlock(),e.createElementBlock("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("label",{class:"block text-sm font-medium text-gray-700",for:o.getUUID},[l.required?(e.openBlock(),e.createElementBlock("span",$e,"*")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],8,Ze),l.note?(e.openBlock(),e.createElementBlock("label",{key:0,class:"block text-xs text-gray-700",for:o.getUUID},e.toDisplayString(l.note),9,ve)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",e.mergeProps({"onUpdate:modelValue":r[0]||(r[0]=s=>o.model=s),id:o.getUUID,placeholder:l.placeholder},{disabled:l.disabled,required:l.required},{maxlength:l.maxlength?Number(l.maxlength):null,rows:Number(l.row),class:"w-full text-gray-800 bg-white px-3 py-1.5 rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-200 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed resize-none"}),null,16,et),[[e.vModelText,o.model]])])}const C=m(Qe,[["render",tt]]),lt={name:"ToggleStyle",props:{modelValue:{type:Boolean,default:!1},label:{type:String,default:""},color:{type:String,default:"gray"},shape:{type:String,default:"round"},disabled:{type:Boolean,default:!1}},computed:{model:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}},shapeToggle(){return{round:"rounded-full",square:"rounded-md"}[this.shape]},computedClasses(){const t={gray:"bg-slate-600 hover:bg-slate-700 border border-gray-800 cursor-pointer",green:"bg-emerald-600 hover:bg-emerald-700 border border-green-700 cursor-pointer",blue:"bg-sky-600 hover:bg-sky-700 border border-blue-700 cursor-pointer",red:"bg-rose-600 hover:bg-rose-700 border border-red-700 cursor-pointer",yellow:"bg-amber-600 hover:bg-amber-700 border border-yellow-600 cursor-pointer"};return this.model?t[this.color]:"bg-gray-200 border border-gray-300"},disabledColorClasses(){const t={gray:"bg-slate-600 border border-slate-300 cursor-not-allowed opacity-60",green:"bg-emerald-600 border border-emerald-300 cursor-not-allowed opacity-60",blue:"bg-sky-600 border border-sky-300 cursor-not-allowed opacity-60",red:"bg-rose-600 border border-rose-300 cursor-not-allowed opacity-60",yellow:"bg-amber-600 border border-amber-300 cursor-not-allowed opacity-60"};return this.modelValue?t[this.color]:"bg-gray-200 border border-gray-300 cursor-not-allowed"},disabledClasses(){return this.disabledColorClasses}},methods:{toggle(){this.disabled||(this.model=!this.model)}}},rt={class:"block text-sm font-medium text-gray-700"};function ot(t,r,l,n,a,o){return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("label",rt,e.toDisplayString(l.label),1),e.createElementVNode("div",{class:e.normalizeClass(["relative w-11 h-6 inline-flex items-center transition-colors duration-300 px-1",o.shapeToggle,l.disabled?o.disabledClasses:o.computedClasses]),onClick:r[0]||(r[0]=(...s)=>o.toggle&&o.toggle(...s))},[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0.75 left-1 w-4 h-4 bg-white shadow transform transition-all duration-300",o.shapeToggle,o.model?"translate-x-full":"translate-x-0"])},null,2)],2)])}const S=m(lt,[["render",ot]]),st={install(t){t.component("AlertStyle",c),t.component("ButtonStyle",g),t.component("CheckStyle",u),t.component("ComboBoxStyle",y),t.component("DateTimeStyle",b),t.component("InputDecimalStyle",f),t.component("InputStyle",p),t.component("SelectStyle",k),t.component("StepperStyle",x),t.component("TableStyle",w),t.component("TextAreaStyle",C),t.component("ToggleStyle",S),t.config.globalProperties.$alertstyle=c}};d.AlertStyle=c,d.ButtonStyle=g,d.CheckStyle=u,d.ComboBoxStyle=y,d.DateTimeStyle=b,d.InputDecimalStyle=f,d.InputStyle=p,d.SelectStyle=k,d.StepperStyle=x,d.TableStyle=w,d.TextAreaStyle=C,d.ToggleStyle=S,d.default=st,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/package.json
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luis-angel-martin-dzul/vue-input-styles",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
|
-
|
|
7
6
|
"main": "./dist/vue-input-styles.umd.js",
|
|
8
7
|
"module": "./dist/vue-input-styles.es.js",
|
|
9
8
|
"style": "./dist/vue-input-styles.css",
|
|
10
|
-
|
|
11
9
|
"exports": {
|
|
12
10
|
".": {
|
|
13
11
|
"import": "./dist/vue-input-styles.es.js",
|
|
@@ -19,7 +17,6 @@
|
|
|
19
17
|
"dist",
|
|
20
18
|
"README.md"
|
|
21
19
|
],
|
|
22
|
-
|
|
23
20
|
"scripts": {
|
|
24
21
|
"dev": "vite",
|
|
25
22
|
"build": "vite build",
|