treqit-ui-library 1.4.20 → 1.4.27

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.
@@ -1 +1 @@
1
- (function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.TreqitUiLibrary={},i.Vue))})(this,(function(i,e){"use strict";const d=(t,l)=>{const a=t.__vccOpts||t;for(const[o,n]of l)a[o]=n;return a},G={key:0,class:"avatar-initials"},S=d({__name:"Avatar",props:{size:{type:[String,Number],default:48},rounded:{type:[String,Number,Boolean],default:!0},color:{type:String,default:null},initials:{type:String,default:null}},setup(t){const l=t,a=e.computed(()=>["avatar",{"avatar--rounded-sm":l.rounded==="sm","avatar--rounded-lg":l.rounded==="lg"}]),o=e.computed(()=>{const n={width:`${l.size}px`,height:`${l.size}px`,backgroundColor:l.color||"var(--surface-secondary)",transition:"background-color 0.3s ease"};return l.rounded===!0||l.rounded===""?n.borderRadius="50%":l.rounded===!1||l.rounded===0||l.rounded==="0"?n.borderRadius="0px":typeof l.rounded=="number"&&(n.borderRadius=`${l.rounded}px`),n});return(n,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value),style:e.normalizeStyle(o.value)},[e.renderSlot(n.$slots,"default",{},()=>[t.initials?(e.openBlock(),e.createElementBlock("span",G,e.toDisplayString(t.initials),1)):e.createCommentVNode("",!0)],!0)],6))}},[["__scopeId","data-v-b02c0c4e"]]),H=["type","disabled"],L={key:0,class:"btn-loader"},$=d({__name:"Button",props:{variant:{type:String,default:"primary",validator:t=>["primary","secondary","destructive","flat","elevated","text","outlined","outlined-primary","outlined-secondary","rounded"].includes(t)},size:{type:String,default:"medium",validator:t=>["sm","small","medium","large","x-large"].includes(t)},type:{type:String,default:"button"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},full:{type:Boolean,default:!1}},emits:["click"],setup(t){const l=t,a=e.computed(()=>["btn",`btn--${l.variant}`,`btn--${l.size==="sm"?"small":l.size}`,{"btn--loading":l.loading,"btn--full":l.full}]);return(o,n)=>(e.openBlock(),e.createElementBlock("button",{type:t.type,class:e.normalizeClass(a.value),disabled:t.disabled||t.loading,onClick:n[0]||(n[0]=r=>o.$emit("click"))},[t.loading?(e.openBlock(),e.createElementBlock("div",L,[...n[1]||(n[1]=[e.createElementVNode("div",{class:"simple-spinner"},null,-1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["btn-content",{"content-hidden":t.loading}])},[e.renderSlot(o.$slots,"default",{},void 0,!0)],2)],10,H))}},[["__scopeId","data-v-7e659005"]]),U={class:"card"},V=d({__name:"Card",setup(t){return(l,a)=>(e.openBlock(),e.createElementBlock("div",U,[e.renderSlot(l.$slots,"default",{},void 0,!0)]))}},[["__scopeId","data-v-82f14ba1"]]),x=d({__name:"Chip",props:{variant:{type:String,default:"secondary",validator:t=>["primary","secondary","success","warning","danger"].includes(t)},removable:{type:Boolean,default:!1}},emits:["remove"],setup(t){const l=t,a=e.computed(()=>["chip",`chip--${l.variant}`]);return(o,n)=>{const r=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(o.$slots,"default",{},void 0,!0),t.removable?(e.openBlock(),e.createElementBlock("button",{key:0,class:"remove-btn",onClick:n[0]||(n[0]=e.withModifiers(s=>o.$emit("remove"),["stop"])),"aria-label":"Remove"},[e.createVNode(r,{name:"close",size:"14","stroke-width":"2.5"})])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-9815960f"]]),w=d(e.defineComponent({__name:"Column",props:{cols:{type:[String,Number],default:null},xs:{type:[String,Number],default:null},sm:{type:[String,Number],default:null},md:{type:[String,Number],default:null},lg:{type:[String,Number],default:null},xl:{type:[String,Number],default:null}},setup(t){const l=t,a=e.computed(()=>{const o=["col"],n={cols:"col-",xs:"col-xs-",sm:"col-sm-",md:"col-md-",lg:"col-lg-",xl:"col-xl-"};for(const r in n)l[r]&&o.push(`${n[r]}${l[r]}`);return o});return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(o.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-a5db8165"]]),_=d({__name:"Icon",props:{icon:{type:String,required:!1},size:{type:[String,Number],default:24},color:{type:String,default:null}},setup(t){const l=t,a={"x-small":12,small:16,medium:24,large:32,"x-large":40},o=e.computed(()=>l.icon?["icon","mdi",l.icon]:["icon"]),n=e.computed(()=>{let r=l.size;typeof l.size=="string"&&a[l.size]&&(r=a[l.size]);const s={fontSize:`${r}px`};return l.color&&(s.color=l.color),s});return(r,s)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(o.value),style:e.normalizeStyle(n.value),"aria-hidden":"true"},null,6))}},[["__scopeId","data-v-7cd4d2d4"]]),W=["for"],X={key:0,class:"date-picker__required"},J={class:"date-picker__input-wrapper"},K=["id","value","disabled","readonly","min","max","required"],Q={key:1,class:"date-picker__error"},Y={key:2,class:"date-picker__help"},C=d(e.defineComponent({__name:"DatePicker",props:{modelValue:{default:""},label:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},required:{type:Boolean},min:{},max:{},errorMessage:{},helpText:{},size:{default:"medium"},variant:{default:"default"},showIcon:{type:Boolean,default:!0}},emits:["update:modelValue","change","blur","focus"],setup(t,{emit:l}){const a=t,o=l,n=e.computed(()=>`date-picker-${Math.random().toString(36).substr(2,9)}`),r=e.computed(()=>["date-picker",`date-picker--${a.size}`,`date-picker--${a.variant}`,{"date-picker--disabled":a.disabled,"date-picker--readonly":a.readonly,"date-picker--error":a.errorMessage,"date-picker--required":a.required}]),s=e.computed(()=>["date-picker__input",{"date-picker__input--with-icon":a.showIcon}]),m=f=>{const g=f.target;o("update:modelValue",g.value)},c=f=>{const g=f.target;o("change",g.value)},u=f=>{o("blur",f)},y=f=>{o("focus",f)};return(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["date-picker",r.value])},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:n.value,class:"date-picker__label"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",X,"*")):e.createCommentVNode("",!0)],8,W)):e.createCommentVNode("",!0),e.createElementVNode("div",J,[e.createElementVNode("input",{id:n.value,type:"date",value:t.modelValue,disabled:t.disabled,readonly:t.readonly,min:t.min,max:t.max,required:t.required,class:e.normalizeClass(s.value),onInput:m,onChange:c,onBlur:u,onFocus:y},null,42,K),t.showIcon?(e.openBlock(),e.createBlock(_,{key:0,icon:"mdi-calendar",class:"date-picker__icon"})):e.createCommentVNode("",!0)]),t.errorMessage?(e.openBlock(),e.createElementBlock("div",Q,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0),t.helpText&&!t.errorMessage?(e.openBlock(),e.createElementBlock("div",Y,e.toDisplayString(t.helpText),1)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-44192e9d"]]),Z=["aria-labelledby"],v={key:0,class:"dialog-header"},ee={id:"dialog-title",class:"dialog-title"},N=d({__name:"Dialog",props:{modelValue:{type:Boolean,required:!0},title:{type:String,default:""},persistent:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},size:{type:String,default:"md"},width:{type:[String,Number],default:null},okOnly:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},emits:["update:modelValue","ok"],setup(t,{emit:l}){const a=t,o=l,n=()=>{o("update:modelValue",!1)},r=()=>{a.persistent||n()},s=e.computed(()=>a.fullscreen||a.width?"":`dialog-content--${a.size}`),m=e.computed(()=>{if(a.fullscreen)return{};const c={};return a.width&&(c.maxWidth=typeof a.width=="number"||!isNaN(Number(a.width))?`${a.width}px`:a.width,c.width=c.maxWidth),c});return e.watch(()=>a.modelValue,c=>{typeof document<"u"&&(document.body.style.overflow=c?"hidden":"")}),e.onUnmounted(()=>{typeof document<"u"&&(document.body.style.overflow="")}),(c,u)=>{const y=e.resolveComponent("Icon");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dialog-fade"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dialog-overlay",onClick:r},[e.createElementVNode("div",{class:e.normalizeClass(["dialog-content",[s.value,{"dialog-content--fullscreen":t.fullscreen}]]),style:e.normalizeStyle(m.value),role:"dialog","aria-modal":"true","aria-labelledby":t.title?"dialog-title":void 0,onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},[t.title?(e.openBlock(),e.createElementBlock("header",v,[e.createElementVNode("h2",ee,e.toDisplayString(t.title),1),e.createElementVNode("button",{onClick:n,class:"dialog-close-btn","aria-label":"Close dialog"},[e.createVNode(y,{icon:"mdi-close",size:"24"})])])):e.createCommentVNode("",!0),e.createElementVNode("main",{class:e.normalizeClass(["dialog-body",{scrollable:t.scrollable}])},[e.renderSlot(c.$slots,"default",{},void 0,!0)],2)],14,Z)])):e.createCommentVNode("",!0)]),_:3})])}}},[["__scopeId","data-v-fcf7a3f1"]]),E=d({__name:"Divider",props:{vertical:{type:Boolean,default:!1},height:{type:[String,Number],default:1}},setup(t){const l=t,a=e.computed(()=>["divider",l.vertical?"divider--vertical":"divider--horizontal"]),o=e.computed(()=>l.vertical?{}:{height:`${l.height}px`});return(n,r)=>(e.openBlock(),e.createElementBlock("hr",{class:e.normalizeClass(a.value),style:e.normalizeStyle(o.value)},null,6))}},[["__scopeId","data-v-97348551"]]),te={class:"spinner-container"},b=d({__name:"ProgressSpinner",setup(t){return(l,a)=>(e.openBlock(),e.createElementBlock("div",te,[...a[0]||(a[0]=[e.createElementVNode("div",{class:"spinner"},null,-1)])]))}},[["__scopeId","data-v-28112817"]]),le={key:0,class:"placeholder"},ae=["src","alt"],z=d({__name:"Image",props:{src:{type:String,required:!0},alt:{type:String,required:!1},width:{type:String,default:"100%"},height:{type:String,default:"auto"},maxHeight:{type:String,default:void 0},fit:{type:String,default:"cover"}},setup(t){const l=t,a=e.ref(!0),o=e.ref(!1),n=()=>{a.value=!1,o.value=!1},r=()=>{a.value=!1,o.value=!0};e.watch(()=>l.src,()=>{a.value=!0,o.value=!1},{immediate:!0});const s=e.computed(()=>({width:l.width,height:l.height,minWidth:l.width,minHeight:l.height,maxHeight:l.maxHeight}));return(m,c)=>{const u=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:"image-container",style:e.normalizeStyle(s.value)},[a.value||o.value?(e.openBlock(),e.createElementBlock("div",le,[a.value?(e.openBlock(),e.createBlock(b,{key:0})):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(u,{key:1,name:"image-off",size:48})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("img",{src:t.src,alt:t.alt,class:"image",style:e.normalizeStyle({objectFit:t.fit,maxHeight:t.maxHeight}),onLoad:n,onError:r},null,44,ae),[[e.vShow,!a.value&&!o.value]])],4)}}},[["__scopeId","data-v-a3997b8b"]]),oe=["for"],ne={class:"input-container"},re=["id","type","value","placeholder","disabled"],I=d({__name:"Input",props:{modelValue:{type:[String,Number],default:""},label:{type:String,default:""},placeholder:{type:String,default:""},type:{type:String,default:"text"},disabled:{type:Boolean,default:!1},id:{type:String,default:()=>`input-${Math.random().toString(36).substring(2,9)}`},class:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:l}){const a=t,o=l,n=r=>{o("update:modelValue",r.target.value)};return(r,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input-wrapper",a.class])},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:"input-label"},e.toDisplayString(t.label),9,oe)):e.createCommentVNode("",!0),e.createElementVNode("div",ne,[e.createElementVNode("input",{id:t.id,type:t.type,value:t.modelValue,onInput:n,placeholder:t.placeholder,disabled:t.disabled,class:"input-field"},null,40,re)])],2))}},[["__scopeId","data-v-218a8bde"]]),D=d({__name:"NavigationDrawer",props:{modelValue:{type:Boolean,required:!0},location:{type:String,default:"left",validator:t=>["left","right"].includes(t)},width:{type:[String,Number],default:300}},emits:["update:modelValue"],setup(t,{emit:l}){const a=t,o=l,n=()=>{o("update:modelValue",!1)},r=e.computed(()=>["navigation-drawer",`navigation-drawer--${a.location}`]),s=e.computed(()=>({width:`${a.width}px`})),m=e.computed(()=>`slide-from-${a.location}`);return e.watch(()=>a.modelValue,c=>{typeof document<"u"&&(c?document.body.style.overflow="hidden":document.body.style.overflow="")}),e.onUnmounted(()=>{typeof document<"u"&&(document.body.style.overflow="")}),(c,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"overlay",onClick:n,"aria-hidden":"true"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:m.value},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(r.value),style:e.normalizeStyle(s.value),role:"dialog","aria-modal":"true"},[e.renderSlot(c.$slots,"default",{},void 0,!0)],6)):e.createCommentVNode("",!0)]),_:3},8,["name"])]))}},[["__scopeId","data-v-a9459219"]]),ie=["aria-valuenow"],se=["width","height","viewBox"],ce=["cx","cy","r","stroke-width"],de=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset"],me={key:0,class:"progress-circular__content"},p=44,T=d({__name:"Progress",props:{modelValue:{type:[Number,String],default:0},size:{type:[Number,String],default:60},width:{type:[Number,String],default:10},color:{type:String,default:"primary"},indeterminate:{type:Boolean,default:!1}},setup(t){const l=t,a=e.computed(()=>(p-l.width)/2),o=e.computed(()=>2*Math.PI*a.value),n=e.computed(()=>({width:`${l.size}px`,height:`${l.size}px`,color:l.color==="primary"?"var(--primary-color)":l.color})),r=e.computed(()=>l.width/l.size*p),s=e.computed(()=>l.indeterminate?null:o.value*(1-l.modelValue/100));return(m,c)=>(e.openBlock(),e.createElementBlock("div",{class:"progress-circular",style:e.normalizeStyle(n.value),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":t.indeterminate?void 0:t.modelValue},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.size,height:t.size,viewBox:`0 0 ${p} ${p}`},[e.createElementVNode("circle",{class:"progress-circular__underlay",fill:"transparent",cx:p/2,cy:p/2,r:a.value,"stroke-width":r.value},null,8,ce),e.createElementVNode("circle",{class:"progress-circular__overlay",fill:"transparent",cx:p/2,cy:p/2,r:a.value,"stroke-width":r.value,"stroke-dasharray":o.value,"stroke-dashoffset":s.value},null,8,de)],8,se)),m.$slots.default?(e.openBlock(),e.createElementBlock("div",me,[e.renderSlot(m.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],12,ie))}},[["__scopeId","data-v-2e383161"]]),M=d({__name:"Row",props:{justify:{type:String,default:"flex-start"},align:{type:String,default:"stretch"},gap:{type:String,default:"0"},wrap:{type:Boolean,default:!0}},setup(t){const l=t,a=e.computed(()=>({justifyContent:l.justify,alignItems:l.align,gap:l.gap,flexWrap:l.wrap?"wrap":"nowrap"}));return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"flex-row",style:e.normalizeStyle(a.value)},[e.renderSlot(o.$slots,"default",{},void 0,!0)],4))}},[["__scopeId","data-v-fc69ad3e"]]),ue=["for"],fe={class:"select-container"},pe=["id","value","disabled","multiple"],ye=["selected"],ge=["value"],he={key:0,class:"select-icon","aria-hidden":"true"},q=d({__name:"Select",props:{modelValue:{type:[String,Number,Array],default:""},options:{type:Array,required:!0},label:{type:String,default:""},placeholder:{type:String,default:"Select an option"},disabled:{type:Boolean,default:!1},id:{type:String,default:()=>`select-${Math.random().toString(36).substring(2,9)}`},multiple:{type:Boolean,default:!1},hideArrow:{type:Boolean,default:!1},class:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:l}){const a=t,o=l;e.computed(()=>!a.options||a.options.length===0?[]:typeof a.options[0]=="string"?a.options.map(r=>({text:r,value:r})):a.options);const n=r=>{if(a.multiple){const s=Array.from(r.target.selectedOptions).map(m=>m.value);o("update:modelValue",s)}else o("update:modelValue",r.target.value)};return(r,s)=>{const m=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["select-wrapper",a.class])},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:"select-label"},e.toDisplayString(t.label),9,ue)):e.createCommentVNode("",!0),e.createElementVNode("div",fe,[e.createElementVNode("select",{id:t.id,value:t.modelValue,onChange:n,disabled:t.disabled,multiple:t.multiple,class:e.normalizeClass([{"no-arrow":t.hideArrow},"select-input"])},[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:"",disabled:"",selected:!t.modelValue},e.toDisplayString(t.placeholder),9,ye)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,c=>(e.openBlock(),e.createElementBlock("option",{key:c.value,value:c.value},e.toDisplayString(c.text),9,ge))),128))],42,pe),t.hideArrow?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",he,[e.createVNode(m,{icon:"mdi-chevron-down",size:"20"})]))])],2)}}},[["__scopeId","data-v-a36629f1"]]),ke={class:"spacer"},P=d({__name:"Spacer",setup(t){return(l,a)=>(e.openBlock(),e.createElementBlock("div",ke))}},[["__scopeId","data-v-370a82d1"]]),Be={class:"textarea-wrapper"},_e=["for"],be=["id","value","placeholder","rows","maxlength"],Se={key:1,class:"error-message"},A=d({__name:"TextArea",props:{id:{type:String,required:!1},label:{type:String,default:""},modelValue:{type:String,default:""},placeholder:{type:String,default:""},rows:{type:[String,Number],default:3},maxlength:{type:[String,Number],default:null},error:{type:String,default:""}},emits:["update:modelValue"],setup(t){return(l,a)=>(e.openBlock(),e.createElementBlock("div",Be,[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:"textarea-label"},e.toDisplayString(t.label),9,_e)):e.createCommentVNode("",!0),e.createElementVNode("textarea",{id:t.id,value:t.modelValue,placeholder:t.placeholder,rows:t.rows,maxlength:t.maxlength,onInput:a[0]||(a[0]=o=>l.$emit("update:modelValue",o.target.value)),class:e.normalizeClass(["textarea-input",{"has-error":t.error}])},null,42,be),t.error?(e.openBlock(),e.createElementBlock("p",Se,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-99d40ec4"]]);class $e{static newGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(l){const a=Math.random()*16|0;return(l=="x"?a:a&3|8).toString(16)})}static isValidGuid(){const l=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;return function(a){return a&&l.test(a)}}static isEmptyGuid(l){return l==="00000000-0000-0000-0000-000000000000"}static emptyGuid(){return"00000000-0000-0000-0000-000000000000"}}const Ve={class:"input-container"},xe=["id","type","value","autocomplete","maxlength"],we=["for"],Ce={class:"error-container"},F=d(e.defineComponent({__name:"TextField",props:{id:{type:String,default:()=>`textfield-${$e.newGuid()}`},label:{type:String,default:""},modelValue:{type:[String,Number],default:""},rules:{type:Array,default:()=>[]},type:{type:String,default:"text"},trim:{type:Boolean,default:!1},placeholder:{type:String,default:""},autocomplete:{type:String,default:"off"},maxlength:{type:[String,Number],default:void 0}},emits:["update:modelValue"],setup(t,{expose:l,emit:a}){const o=t,n=a,r=e.ref([]),s=e.ref(!0),m=e.inject("form",null),c=e.getCurrentInstance(),u=async()=>{r.value=[];let k=!0;for(const h of o.rules){const B=h(o.modelValue);B!==!0&&(k=!1,r.value.push(B))}return{valid:k,errors:r.value}},y=()=>{n("update:modelValue",""),f()},f=()=>{r.value=[],s.value=!0},g=k=>{const h=k.target;n("update:modelValue",h.value),s.value||u()},Ie=()=>{s.value=!1,o.trim&&typeof o.modelValue=="string"&&n("update:modelValue",o.modelValue.trim()),u()};return e.onMounted(()=>{m&&c&&m.register({id:o.id,validate:u,reset:y,resetValidation:f})}),e.onUnmounted(()=>{m&&c&&m.unregister({id:o.id})}),l({validate:u,reset:y,resetValidation:f,id:o.id,errors:r}),(k,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-field-wrapper",{"has-value":t.modelValue}])},[e.createElementVNode("div",Ve,[e.createElementVNode("input",{id:t.id,type:t.type,value:t.modelValue,placeholder:" ",onInput:g,onBlur:Ie,class:"text-field-input",autocomplete:t.autocomplete,maxlength:t.maxlength},null,40,xe),t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:"text-field-label"},e.toDisplayString(t.placeholder?t.placeholder:t.label),9,we)):e.createCommentVNode("",!0),e.createElementVNode("fieldset",{"aria-hidden":"true",class:e.normalizeClass(["text-field-fieldset",{"has-error":r.value.length>0}])},[...h[0]||(h[0]=[e.createElementVNode("legend",{class:"text-field-legend"},null,-1)])],2)]),e.createElementVNode("div",Ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(B,De)=>(e.openBlock(),e.createElementBlock("p",{key:De,class:"error-message"},e.toDisplayString(B),1))),128))])],2))}}),[["__scopeId","data-v-f4c602d7"]]),Ne=["aria-label"],Ee={class:"tooltip-content"},O=d({__name:"Tooltip",props:{text:{type:String,required:!0},location:{type:String,default:"top",validator:t=>["top","bottom","left","right"].includes(t)},disabled:{type:Boolean,default:!1}},setup(t){const l=t,a=e.ref(!1),o=()=>{l.disabled||(a.value=!0)},n=()=>{a.value=!1},r=e.computed(()=>["tooltip",`tooltip--${l.location}`]);return(s,m)=>(e.openBlock(),e.createElementBlock("div",{class:"tooltip-container",onMouseenter:o,onMouseleave:n,onFocusin:o,onFocusout:n,role:"tooltip","aria-label":t.text},[e.renderSlot(s.$slots,"default",{},void 0,!0),e.createVNode(e.Transition,{name:"tooltip-fade"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(r.value)},[e.createElementVNode("div",Ee,e.toDisplayString(t.text),1),m[0]||(m[0]=e.createElementVNode("div",{class:"tooltip-arrow"},null,-1))],2)):e.createCommentVNode("",!0)]),_:1})],40,Ne))}},[["__scopeId","data-v-66afe288"]]),j=d({__name:"Overlay",props:{modelValue:{type:Boolean,default:!1},contained:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:l}){const a=t,o=l;function n(){o("update:modelValue",!1)}return e.watch(()=>a.modelValue,r=>{!a.contained&&typeof document<"u"&&(document.body.style.overflow=r?"hidden":"")}),(r,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"overlay-fade"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overlay",{"overlay--contained":t.contained}]),onClick:e.withModifiers(n,["self"])},[e.renderSlot(r.$slots,"default",{},void 0,!0)],2)):e.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-45f15f75"]]),R=t=>{t.component("Avatar",S),t.component("Button",$),t.component("Card",V),t.component("Chip",x),t.component("Column",w),t.component("DatePicker",C),t.component("Dialog",N),t.component("Divider",E),t.component("Icon",_),t.component("Overlay",j),t.component("Image",z),t.component("Input",I),t.component("NavigationDrawer",D),t.component("Progress",T),t.component("ProgressSpinner",b),t.component("Row",M),t.component("Select",q),t.component("Spacer",P),t.component("TextArea",A),t.component("TextField",F),t.component("Tooltip",O)},ze={install:R};i.Avatar=S,i.Button=$,i.Card=V,i.Chip=x,i.Column=w,i.DatePicker=C,i.Dialog=N,i.Divider=E,i.Icon=_,i.Image=z,i.Input=I,i.NavigationDrawer=D,i.Overlay=j,i.Progress=T,i.ProgressSpinner=b,i.Row=M,i.Select=q,i.Spacer=P,i.TextArea=A,i.TextField=F,i.Tooltip=O,i.default=ze,i.install=R,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.TreqitUiLibrary={},i.Vue))})(this,(function(i,e){"use strict";const c=(t,l)=>{const a=t.__vccOpts||t;for(const[o,n]of l)a[o]=n;return a},G={key:0,class:"avatar-initials"},S=c({__name:"Avatar",props:{size:{type:[String,Number],default:48},rounded:{type:[String,Number,Boolean],default:!0},color:{type:String,default:null},initials:{type:String,default:null}},setup(t){const l=t,a=e.computed(()=>["avatar",{"avatar--rounded-sm":l.rounded==="sm","avatar--rounded-lg":l.rounded==="lg"}]),o=e.computed(()=>{const n={width:`${l.size}px`,height:`${l.size}px`,backgroundColor:l.color||"var(--surface-secondary)",transition:"background-color 0.3s ease"};return l.rounded===!0||l.rounded===""?n.borderRadius="50%":l.rounded===!1||l.rounded===0||l.rounded==="0"?n.borderRadius="0px":typeof l.rounded=="number"&&(n.borderRadius=`${l.rounded}px`),n});return(n,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value),style:e.normalizeStyle(o.value)},[e.renderSlot(n.$slots,"default",{},()=>[t.initials?(e.openBlock(),e.createElementBlock("span",G,e.toDisplayString(t.initials),1)):e.createCommentVNode("",!0)],!0)],6))}},[["__scopeId","data-v-b02c0c4e"]]),H=["type","disabled"],U={key:0,class:"btn-loader"},w=c({__name:"Button",props:{variant:{type:String,default:"primary",validator:t=>["primary","secondary","destructive","flat","elevated","text","outlined","outlined-primary","outlined-secondary","rounded"].includes(t)},size:{type:String,default:"medium",validator:t=>["sm","small","medium","large","x-large"].includes(t)},type:{type:String,default:"button"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},full:{type:Boolean,default:!1}},emits:["click"],setup(t){const l=t,a=e.computed(()=>["btn",`btn--${l.variant}`,`btn--${l.size==="sm"?"small":l.size}`,{"btn--loading":l.loading,"btn--full":l.full}]);return(o,n)=>(e.openBlock(),e.createElementBlock("button",{type:t.type,class:e.normalizeClass(a.value),disabled:t.disabled||t.loading,onClick:n[0]||(n[0]=r=>o.$emit("click"))},[t.loading?(e.openBlock(),e.createElementBlock("div",U,[...n[1]||(n[1]=[e.createElementVNode("div",{class:"simple-spinner"},null,-1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["btn-content",{"content-hidden":t.loading}])},[e.renderSlot(o.$slots,"default",{},void 0,!0)],2)],10,H))}},[["__scopeId","data-v-067910e7"]]),W={class:"card"},$=c({__name:"Card",setup(t){return(l,a)=>(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(l.$slots,"default",{},void 0,!0)]))}},[["__scopeId","data-v-82f14ba1"]]),x=["primary","secondary","success","warning","danger","elevated"],X=x.map(t=>`outlined-${t}`),J=[...x,...X],V=c({__name:"Chip",props:{variant:{type:String,default:"secondary",validator:t=>J.includes(t)},removable:{type:Boolean,default:!1}},emits:["remove"],setup(t){const l=t,a=e.computed(()=>["chip",`chip--${l.variant}`]);return(o,n)=>{const r=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(o.$slots,"default",{},void 0,!0),t.removable?(e.openBlock(),e.createElementBlock("button",{key:0,class:"remove-btn",onClick:n[0]||(n[0]=e.withModifiers(s=>o.$emit("remove"),["stop"])),"aria-label":"Remove"},[e.createVNode(r,{name:"close",size:"14","stroke-width":"2.5"})])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-27452944"]]),C=c(e.defineComponent({__name:"Column",props:{cols:{type:[String,Number],default:null},xs:{type:[String,Number],default:null},sm:{type:[String,Number],default:null},md:{type:[String,Number],default:null},lg:{type:[String,Number],default:null},xl:{type:[String,Number],default:null}},setup(t){const l=t,a=e.computed(()=>{const o=["col"],n={cols:"col-",xs:"col-xs-",sm:"col-sm-",md:"col-md-",lg:"col-lg-",xl:"col-xl-"};for(const r in n)l[r]&&o.push(`${n[r]}${l[r]}`);return o});return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.renderSlot(o.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-a5db8165"]]),b=c({__name:"Icon",props:{icon:{type:String,required:!1},size:{type:[String,Number],default:24},color:{type:String,default:null}},setup(t){const l=t,a={"x-small":12,small:16,medium:24,large:32,"x-large":40},o=e.computed(()=>l.icon?["icon","mdi",l.icon]:["icon"]),n=e.computed(()=>{let r=l.size;typeof l.size=="string"&&a[l.size]&&(r=a[l.size]);const s={fontSize:`${r}px`};return l.color&&(s.color=l.color),s});return(r,s)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(o.value),style:e.normalizeStyle(n.value),"aria-hidden":"true"},null,6))}},[["__scopeId","data-v-7cd4d2d4"]]),K=["for"],Q={key:0,class:"date-picker__required"},Y={class:"date-picker__input-wrapper"},Z=["id","value","disabled","readonly","min","max","required"],v={key:1,class:"date-picker__error"},ee={key:2,class:"date-picker__help"},N=c(e.defineComponent({__name:"DatePicker",props:{modelValue:{default:""},label:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},required:{type:Boolean},min:{},max:{},errorMessage:{},helpText:{},size:{default:"medium"},variant:{default:"default"},showIcon:{type:Boolean,default:!0}},emits:["update:modelValue","change","blur","focus"],setup(t,{emit:l}){const a=t,o=l,n=e.computed(()=>`date-picker-${Math.random().toString(36).substr(2,9)}`),r=e.computed(()=>["date-picker",`date-picker--${a.size}`,`date-picker--${a.variant}`,{"date-picker--disabled":a.disabled,"date-picker--readonly":a.readonly,"date-picker--error":a.errorMessage,"date-picker--required":a.required}]),s=e.computed(()=>["date-picker__input",{"date-picker__input--with-icon":a.showIcon}]),d=f=>{const g=f.target;o("update:modelValue",g.value)},m=f=>{const g=f.target;o("change",g.value)},u=f=>{o("blur",f)},p=f=>{o("focus",f)};return(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["date-picker",r.value])},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:n.value,class:"date-picker__label"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Q,"*")):e.createCommentVNode("",!0)],8,K)):e.createCommentVNode("",!0),e.createElementVNode("div",Y,[e.createElementVNode("input",{id:n.value,type:"date",value:t.modelValue,disabled:t.disabled,readonly:t.readonly,min:t.min,max:t.max,required:t.required,class:e.normalizeClass(s.value),onInput:d,onChange:m,onBlur:u,onFocus:p},null,42,Z),t.showIcon?(e.openBlock(),e.createBlock(b,{key:0,icon:"mdi-calendar",class:"date-picker__icon"})):e.createCommentVNode("",!0)]),t.errorMessage?(e.openBlock(),e.createElementBlock("div",v,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0),t.helpText&&!t.errorMessage?(e.openBlock(),e.createElementBlock("div",ee,e.toDisplayString(t.helpText),1)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-44192e9d"]]),te=["aria-labelledby"],le={key:0,class:"dialog-header"},ae={id:"dialog-title",class:"dialog-title"},E=c({__name:"Dialog",props:{modelValue:{type:Boolean,required:!0},title:{type:String,default:""},persistent:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},size:{type:String,default:"md"},width:{type:[String,Number],default:null},okOnly:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},emits:["update:modelValue","ok"],setup(t,{emit:l}){const a=t,o=l,n=()=>{o("update:modelValue",!1)},r=()=>{a.persistent||n()},s=e.computed(()=>a.fullscreen||a.width?"":`dialog-content--${a.size}`),d=e.computed(()=>{if(a.fullscreen)return{};const m={};return a.width&&(m.maxWidth=typeof a.width=="number"||!isNaN(Number(a.width))?`${a.width}px`:a.width,m.width=m.maxWidth),m});return e.watch(()=>a.modelValue,m=>{typeof document<"u"&&(document.body.style.overflow=m?"hidden":"")}),e.onUnmounted(()=>{typeof document<"u"&&(document.body.style.overflow="")}),(m,u)=>{const p=e.resolveComponent("Icon");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dialog-fade"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dialog-overlay",onClick:r},[e.createElementVNode("div",{class:e.normalizeClass(["dialog-content",[s.value,{"dialog-content--fullscreen":t.fullscreen}]]),style:e.normalizeStyle(d.value),role:"dialog","aria-modal":"true","aria-labelledby":t.title?"dialog-title":void 0,onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},[t.title?(e.openBlock(),e.createElementBlock("header",le,[e.createElementVNode("h2",ae,e.toDisplayString(t.title),1),e.createElementVNode("button",{onClick:n,class:"dialog-close-btn","aria-label":"Close dialog"},[e.createVNode(p,{icon:"mdi-close",size:"24"})])])):e.createCommentVNode("",!0),e.createElementVNode("main",{class:e.normalizeClass(["dialog-body",{scrollable:t.scrollable}])},[e.renderSlot(m.$slots,"default",{},void 0,!0)],2)],14,te)])):e.createCommentVNode("",!0)]),_:3})])}}},[["__scopeId","data-v-fcf7a3f1"]]),z=c({__name:"Divider",props:{vertical:{type:Boolean,default:!1},height:{type:[String,Number],default:1}},setup(t){const l=t,a=e.computed(()=>["divider",l.vertical?"divider--vertical":"divider--horizontal"]),o=e.computed(()=>l.vertical?{}:{height:`${l.height}px`});return(n,r)=>(e.openBlock(),e.createElementBlock("hr",{class:e.normalizeClass(a.value),style:e.normalizeStyle(o.value)},null,6))}},[["__scopeId","data-v-97348551"]]),oe={class:"spinner-container"},B=c({__name:"ProgressSpinner",setup(t){return(l,a)=>(e.openBlock(),e.createElementBlock("div",oe,[...a[0]||(a[0]=[e.createElementVNode("div",{class:"spinner"},null,-1)])]))}},[["__scopeId","data-v-28112817"]]),ne={key:0,class:"placeholder"},re=["src","alt"],I=c({__name:"Image",props:{src:{type:String,required:!0},alt:{type:String,required:!1},width:{type:String,default:"100%"},height:{type:String,default:"auto"},maxHeight:{type:String,default:void 0},fit:{type:String,default:"cover"}},setup(t){const l=t,a=e.ref(!0),o=e.ref(!1),n=()=>{a.value=!1,o.value=!1},r=()=>{a.value=!1,o.value=!0};e.watch(()=>l.src,()=>{a.value=!0,o.value=!1},{immediate:!0});const s=e.computed(()=>({width:l.width,height:l.height,minWidth:l.width,minHeight:l.height,maxHeight:l.maxHeight}));return(d,m)=>{const u=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:"image-container",style:e.normalizeStyle(s.value)},[a.value||o.value?(e.openBlock(),e.createElementBlock("div",ne,[a.value?(e.openBlock(),e.createBlock(B,{key:0})):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(u,{key:1,name:"image-off",size:48})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("img",{src:t.src,alt:t.alt,class:"image",style:e.normalizeStyle({objectFit:t.fit,maxHeight:t.maxHeight}),onLoad:n,onError:r},null,44,re),[[e.vShow,!a.value&&!o.value]])],4)}}},[["__scopeId","data-v-a3997b8b"]]),ie=["for"],se={class:"input-container"},ce=["id","type","value","placeholder","disabled"],D=c({__name:"Input",props:{modelValue:{type:[String,Number],default:""},label:{type:String,default:""},placeholder:{type:String,default:""},type:{type:String,default:"text"},disabled:{type:Boolean,default:!1},id:{type:String,default:()=>`input-${Math.random().toString(36).substring(2,9)}`},class:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:l}){const a=t,o=l,n=r=>{o("update:modelValue",r.target.value)};return(r,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input-wrapper",a.class])},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:"input-label"},e.toDisplayString(t.label),9,ie)):e.createCommentVNode("",!0),e.createElementVNode("div",se,[e.createElementVNode("input",{id:t.id,type:t.type,value:t.modelValue,onInput:n,placeholder:t.placeholder,disabled:t.disabled,class:"input-field"},null,40,ce)])],2))}},[["__scopeId","data-v-11c0c78b"]]),de={width:"28",height:"28",viewBox:"0 0 24 24",fill:"none"},me=["fill"],ue=["fill"],fe=["fill"],pe=["aria-modal"],T=c({__name:"NavigationDrawer",props:{width:{type:[String,Number],default:300},dark:{type:Boolean,default:!1},light:{type:Boolean,default:!1}},setup(t){const l=t,a=e.ref(!1),o=e.ref(!1),n=()=>{o.value=window.innerWidth<=768,o.value||(a.value=!1)};e.onMounted(()=>{n(),window.addEventListener("resize",n)}),e.onUnmounted(()=>{window.removeEventListener("resize",n),document.body.style.overflow=""});const r=()=>{a.value=!0,o.value&&(document.body.style.overflow="hidden")},s=()=>{a.value=!1,o.value&&(document.body.style.overflow="")},d=e.computed(()=>["navigation-drawer",l.dark?"navigation-drawer--dark":"",l.light?"navigation-drawer--light":"",o.value?"navigation-drawer--mobile":"navigation-drawer--desktop"]),m=e.computed(()=>({width:typeof l.width=="number"?`${l.width}px`:l.width})),u=e.computed(()=>l.dark?"var(--surface-color, #fff)":"var(--text-color, #222)");return(p,f)=>(e.openBlock(),e.createElementBlock("div",null,[o.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"navigation-drawer__toggle-btn",onClick:r,"aria-label":"Open navigation drawer"},[e.renderSlot(p.$slots,"toggle",{},()=>[(e.openBlock(),e.createElementBlock("svg",de,[e.createElementVNode("rect",{y:"5",width:"24",height:"2",rx:"1",fill:u.value},null,8,me),e.createElementVNode("rect",{y:"11",width:"24",height:"2",rx:"1",fill:u.value},null,8,ue),e.createElementVNode("rect",{y:"17",width:"24",height:"2",rx:"1",fill:u.value},null,8,fe)]))],!0)])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[o.value&&a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"navigation-drawer__overlay",onClick:s,"aria-hidden":"true"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:o.value?"slide-from-left":null},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("aside",{class:e.normalizeClass([...d.value,o.value&&a.value?"navigation-drawer--open":""]),style:e.normalizeStyle(m.value),role:"navigation","aria-modal":o.value?"true":void 0,tabindex:"-1"},[o.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"navigation-drawer__close-btn",onClick:s,"aria-label":"Close navigation drawer"},[...f[0]||(f[0]=[e.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"}),e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)])])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"default",{},void 0,!0)],14,pe),[[e.vShow,!o.value||a.value]])]),_:3},8,["name"])]))}},[["__scopeId","data-v-bd9dc140"]]),ye=["aria-valuenow"],ge=["width","height","viewBox"],he=["cx","cy","r","stroke-width"],ke=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset"],_e={key:0,class:"progress-circular__content"},y=44,M=c({__name:"Progress",props:{modelValue:{type:[Number,String],default:0},size:{type:[Number,String],default:60},width:{type:[Number,String],default:10},color:{type:String,default:"primary"},indeterminate:{type:Boolean,default:!1}},setup(t){const l=t,a=e.computed(()=>(y-l.width)/2),o=e.computed(()=>2*Math.PI*a.value),n=e.computed(()=>({width:`${l.size}px`,height:`${l.size}px`,color:l.color==="primary"?"var(--primary-color)":l.color})),r=e.computed(()=>l.width/l.size*y),s=e.computed(()=>l.indeterminate?null:o.value*(1-l.modelValue/100));return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:"progress-circular",style:e.normalizeStyle(n.value),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":t.indeterminate?void 0:t.modelValue},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.size,height:t.size,viewBox:`0 0 ${y} ${y}`},[e.createElementVNode("circle",{class:"progress-circular__underlay",fill:"transparent",cx:y/2,cy:y/2,r:a.value,"stroke-width":r.value},null,8,he),e.createElementVNode("circle",{class:"progress-circular__overlay",fill:"transparent",cx:y/2,cy:y/2,r:a.value,"stroke-width":r.value,"stroke-dasharray":o.value,"stroke-dashoffset":s.value},null,8,ke)],8,ge)),d.$slots.default?(e.openBlock(),e.createElementBlock("div",_e,[e.renderSlot(d.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],12,ye))}},[["__scopeId","data-v-2e383161"]]),q=c({__name:"Row",props:{justify:{type:String,default:"flex-start"},align:{type:String,default:"stretch"},gap:{type:String,default:"0"},wrap:{type:Boolean,default:!0}},setup(t){const l=t,a=e.computed(()=>({justifyContent:l.justify,alignItems:l.align,gap:l.gap,flexWrap:l.wrap?"wrap":"nowrap"}));return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"flex-row",style:e.normalizeStyle(a.value)},[e.renderSlot(o.$slots,"default",{},void 0,!0)],4))}},[["__scopeId","data-v-fc69ad3e"]]),be=["for"],Be={class:"select-container"},Se=["id","value","disabled","multiple"],we=["selected"],$e=["value"],xe={key:0,class:"select-icon","aria-hidden":"true"},P=c({__name:"Select",props:{modelValue:{type:[String,Number,Array],default:""},options:{type:Array,required:!0},label:{type:String,default:""},placeholder:{type:String,default:"Select an option"},disabled:{type:Boolean,default:!1},id:{type:String,default:()=>`select-${Math.random().toString(36).substring(2,9)}`},multiple:{type:Boolean,default:!1},hideArrow:{type:Boolean,default:!1},class:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:l}){const a=t,o=l;e.computed(()=>!a.options||a.options.length===0?[]:typeof a.options[0]=="string"?a.options.map(r=>({text:r,value:r})):a.options);const n=r=>{if(a.multiple){const s=Array.from(r.target.selectedOptions).map(d=>d.value);o("update:modelValue",s)}else o("update:modelValue",r.target.value)};return(r,s)=>{const d=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["select-wrapper",a.class])},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:"select-label"},e.toDisplayString(t.label),9,be)):e.createCommentVNode("",!0),e.createElementVNode("div",Be,[e.createElementVNode("select",{id:t.id,value:t.modelValue,onChange:n,disabled:t.disabled,multiple:t.multiple,class:e.normalizeClass([{"no-arrow":t.hideArrow},"select-input"])},[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,value:"",disabled:"",selected:!t.modelValue},e.toDisplayString(t.placeholder),9,we)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,m=>(e.openBlock(),e.createElementBlock("option",{key:m.value,value:m.value},e.toDisplayString(m.text),9,$e))),128))],42,Se),t.hideArrow?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(d,{icon:"mdi-chevron-down",size:"20"})]))])],2)}}},[["__scopeId","data-v-0e059790"]]),Ve={class:"spacer"},A=c({__name:"Spacer",setup(t){return(l,a)=>(e.openBlock(),e.createElementBlock("div",Ve))}},[["__scopeId","data-v-370a82d1"]]),Ce={class:"textarea-wrapper"},Ne=["for"],Ee=["id","value","placeholder","rows","maxlength"],ze={key:1,class:"error-message"},O=c({__name:"TextArea",props:{id:{type:String,required:!1},label:{type:String,default:""},modelValue:{type:String,default:""},placeholder:{type:String,default:""},rows:{type:[String,Number],default:3},maxlength:{type:[String,Number],default:null},error:{type:String,default:""}},emits:["update:modelValue"],setup(t){return(l,a)=>(e.openBlock(),e.createElementBlock("div",Ce,[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:"textarea-label"},e.toDisplayString(t.label),9,Ne)):e.createCommentVNode("",!0),e.createElementVNode("textarea",{id:t.id,value:t.modelValue,placeholder:t.placeholder,rows:t.rows,maxlength:t.maxlength,onInput:a[0]||(a[0]=o=>l.$emit("update:modelValue",o.target.value)),class:e.normalizeClass(["textarea-input",{"has-error":t.error}])},null,42,Ee),t.error?(e.openBlock(),e.createElementBlock("p",ze,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-003408a6"]]);class Ie{static newGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(l){const a=Math.random()*16|0;return(l=="x"?a:a&3|8).toString(16)})}static isValidGuid(){const l=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;return function(a){return a&&l.test(a)}}static isEmptyGuid(l){return l==="00000000-0000-0000-0000-000000000000"}static emptyGuid(){return"00000000-0000-0000-0000-000000000000"}}const De={class:"input-container"},Te=["id","type","value","autocomplete","maxlength"],Me=["for"],qe={class:"error-container"},F=c(e.defineComponent({__name:"TextField",props:{id:{type:String,default:()=>`textfield-${Ie.newGuid()}`},label:{type:String,default:""},modelValue:{type:[String,Number],default:""},rules:{type:Array,default:()=>[]},type:{type:String,default:"text"},trim:{type:Boolean,default:!1},placeholder:{type:String,default:""},autocomplete:{type:String,default:"off"},maxlength:{type:[String,Number],default:void 0}},emits:["update:modelValue"],setup(t,{expose:l,emit:a}){const o=t,n=a,r=e.ref([]),s=e.ref(!0),d=e.inject("form",null),m=e.getCurrentInstance(),u=async()=>{r.value=[];let k=!0;for(const h of o.rules){const _=h(o.modelValue);_!==!0&&(k=!1,r.value.push(_))}return{valid:k,errors:r.value}},p=()=>{n("update:modelValue",""),f()},f=()=>{r.value=[],s.value=!0},g=k=>{const h=k.target;n("update:modelValue",h.value),s.value||u()},Fe=()=>{s.value=!1,o.trim&&typeof o.modelValue=="string"&&n("update:modelValue",o.modelValue.trim()),u()};return e.onMounted(()=>{d&&m&&d.register({id:o.id,validate:u,reset:p,resetValidation:f})}),e.onUnmounted(()=>{d&&m&&d.unregister({id:o.id})}),l({validate:u,reset:p,resetValidation:f,id:o.id,errors:r}),(k,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-field-wrapper",{"has-value":t.modelValue}])},[e.createElementVNode("div",De,[e.createElementVNode("input",{id:t.id,type:t.type,value:t.modelValue,placeholder:" ",onInput:g,onBlur:Fe,class:"text-field-input",autocomplete:t.autocomplete,maxlength:t.maxlength},null,40,Te),t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:"text-field-label"},e.toDisplayString(t.placeholder?t.placeholder:t.label),9,Me)):e.createCommentVNode("",!0),e.createElementVNode("fieldset",{"aria-hidden":"true",class:e.normalizeClass(["text-field-fieldset",{"has-error":r.value.length>0}])},[...h[0]||(h[0]=[e.createElementVNode("legend",{class:"text-field-legend"},null,-1)])],2)]),e.createElementVNode("div",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(_,je)=>(e.openBlock(),e.createElementBlock("p",{key:je,class:"error-message"},e.toDisplayString(_),1))),128))])],2))}}),[["__scopeId","data-v-babd6e9f"]]),Pe=["aria-label"],Ae={class:"tooltip-content"},j=c({__name:"Tooltip",props:{text:{type:String,required:!0},location:{type:String,default:"top",validator:t=>["top","bottom","left","right"].includes(t)},disabled:{type:Boolean,default:!1}},setup(t){const l=t,a=e.ref(!1),o=()=>{l.disabled||(a.value=!0)},n=()=>{a.value=!1},r=e.computed(()=>["tooltip",`tooltip--${l.location}`]);return(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:"tooltip-container",onMouseenter:o,onMouseleave:n,onFocusin:o,onFocusout:n,role:"tooltip","aria-label":t.text},[e.renderSlot(s.$slots,"default",{},void 0,!0),e.createVNode(e.Transition,{name:"tooltip-fade"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(r.value)},[e.createElementVNode("div",Ae,e.toDisplayString(t.text),1),d[0]||(d[0]=e.createElementVNode("div",{class:"tooltip-arrow"},null,-1))],2)):e.createCommentVNode("",!0)]),_:1})],40,Pe))}},[["__scopeId","data-v-66afe288"]]),R=c({__name:"Overlay",props:{modelValue:{type:Boolean,default:!1},contained:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:l}){const a=t,o=l;function n(){o("update:modelValue",!1)}return e.watch(()=>a.modelValue,r=>{!a.contained&&typeof document<"u"&&(document.body.style.overflow=r?"hidden":"")}),(r,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"overlay-fade"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overlay",{"overlay--contained":t.contained}]),onClick:e.withModifiers(n,["self"])},[e.renderSlot(r.$slots,"default",{},void 0,!0)],2)):e.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-45f15f75"]]),L=t=>{t.component("Avatar",S),t.component("Button",w),t.component("Card",$),t.component("Chip",V),t.component("Column",C),t.component("DatePicker",N),t.component("Dialog",E),t.component("Divider",z),t.component("Icon",b),t.component("Overlay",R),t.component("Image",I),t.component("Input",D),t.component("NavigationDrawer",T),t.component("Progress",M),t.component("ProgressSpinner",B),t.component("Row",q),t.component("Select",P),t.component("Spacer",A),t.component("TextArea",O),t.component("TextField",F),t.component("Tooltip",j)},Oe={install:L};i.Avatar=S,i.Button=w,i.Card=$,i.Chip=V,i.Column=C,i.DatePicker=N,i.Dialog=E,i.Divider=z,i.Icon=b,i.Image=I,i.Input=D,i.NavigationDrawer=T,i.Overlay=R,i.Progress=M,i.ProgressSpinner=B,i.Row=q,i.Select=P,i.Spacer=A,i.TextArea=O,i.TextField=F,i.Tooltip=j,i.default=Oe,i.install=L,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "name": "treqit-ui-library",
24
24
  "private": false,
25
- "version": "1.4.20",
25
+ "version": "1.4.27",
26
26
  "type": "module",
27
27
  "types": "./dist/index.d.ts",
28
28
  "scripts": {