treqit-ui-library 1.4.8 → 1.4.10

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(l,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(l=typeof globalThis<"u"?globalThis:l||self,e(l.TreqitUiLibrary={},l.Vue))})(this,(function(l,e){"use strict";const c=(t,n)=>{const o=t.__vccOpts||t;for(const[i,a]of n)o[i]=a;return o},p=["type","disabled"],y={key:0,class:"btn-loader"},r=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 n=t,o=e.computed(()=>["btn",`btn--${n.variant}`,`btn--${n.size==="sm"?"small":n.size}`,{"btn--loading":n.loading,"btn--full":n.full}]);return(i,a)=>(e.openBlock(),e.createElementBlock("button",{type:t.type,class:e.normalizeClass(o.value),disabled:t.disabled||t.loading,onClick:a[0]||(a[0]=s=>i.$emit("click"))},[t.loading?(e.openBlock(),e.createElementBlock("div",y,[...a[1]||(a[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(i.$slots,"default",{},void 0,!0)],2)],10,p))}},[["__scopeId","data-v-8db92d47"]]),u=c({__name:"Overlay",props:{modelValue:{type:Boolean,default:!1},contained:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,i=n;function a(){i("update:modelValue",!1)}return e.watch(()=>o.modelValue,s=>{!o.contained&&typeof document<"u"&&(document.body.style.overflow=s?"hidden":"")}),(s,d)=>(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(a,["self"])},[e.renderSlot(s.$slots,"default",{},void 0,!0)],2)):e.createCommentVNode("",!0)]),_:3}))}},[["__scopeId","data-v-11b69f56"]]),m=c({__name:"Icon",props:{icon:{type:String,required:!1},size:{type:[String,Number],default:24},color:{type:String,default:null}},setup(t){const n=t,o={"x-small":12,small:16,medium:24,large:32,"x-large":40},i=e.computed(()=>n.icon?["icon","mdi",n.icon]:["icon"]),a=e.computed(()=>{let s=n.size;typeof n.size=="string"&&o[n.size]&&(s=o[n.size]);const d={fontSize:`${s}px`};return n.color&&(d.color=n.color),d});return(s,d)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(i.value),style:e.normalizeStyle(a.value),"aria-hidden":"true"},null,6))}},[["__scopeId","data-v-4a07735a"]]),f=t=>{t.component("Overlay",u),t.component("Button",r),t.component("Icon",m)},b={install:f};l.Button=r,l.Icon=m,l.Overlay=u,l.default=b,l.install=f,Object.defineProperties(l,{__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 m=(t,o)=>{const l=t.__vccOpts||t;for(const[a,n]of o)l[a]=n;return l},X={key:0,class:"avatar-initials"},$=m({__name:"Avatar",props:{size:{type:[String,Number],default:48},rounded:{type:[String,Number,Boolean],default:!0},color:{type:String,default:"var(--treqit-gray-300)"},initials:{type:String,default:null}},setup(t){const o=t,l=e.computed(()=>["avatar",{"avatar--rounded-sm":o.rounded==="sm","avatar--rounded-lg":o.rounded==="lg"}]),a=e.computed(()=>{const n={width:`${o.size}px`,height:`${o.size}px`,backgroundColor:o.color};return o.rounded===!0||o.rounded===""?n.borderRadius="50%":o.rounded===!1||o.rounded===0||o.rounded==="0"?n.borderRadius="0px":typeof o.rounded=="number"&&(n.borderRadius=`${o.rounded}px`),n});return(n,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.value),style:e.normalizeStyle(a.value)},[e.renderSlot(n.$slots,"default",{},()=>[t.initials?(e.openBlock(),e.createElementBlock("span",X,e.toDisplayString(t.initials),1)):e.createCommentVNode("",!0)],!0)],6))}},[["__scopeId","data-v-2e02a766"]]),W=["type","disabled"],Y={key:0,class:"btn-loader"},x=m({__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 o=t,l=e.computed(()=>["btn",`btn--${o.variant}`,`btn--${o.size==="sm"?"small":o.size}`,{"btn--loading":o.loading,"btn--full":o.full}]);return(a,n)=>(e.openBlock(),e.createElementBlock("button",{type:t.type,class:e.normalizeClass(l.value),disabled:t.disabled||t.loading,onClick:n[0]||(n[0]=r=>a.$emit("click"))},[t.loading?(e.openBlock(),e.createElementBlock("div",Y,[...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(a.$slots,"default",{},void 0,!0)],2)],10,W))}},[["__scopeId","data-v-8db92d47"]]),K={class:"card"},C=m({__name:"Card",setup(t){return(o,l)=>(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(o.$slots,"default",{},void 0,!0)]))}},[["__scopeId","data-v-09430cb2"]]),N=m({__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 o=t,l=e.computed(()=>["chip",`chip--${o.variant}`]);return(a,n)=>{const r=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.value)},[e.renderSlot(a.$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=>a.$emit("remove"),["stop"])),"aria-label":"Remove"},[e.createVNode(r,{name:"close",size:"14","stroke-width":"2.5"})])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-6b6b7ae9"]]),E=m(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 o=t,l=e.computed(()=>{const a=["col"],n={cols:"col-",xs:"col-xs-",sm:"col-sm-",md:"col-md-",lg:"col-lg-",xl:"col-xl-"};for(const r in n)o[r]&&a.push(`${n[r]}${o[r]}`);return a});return(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.value)},[e.renderSlot(a.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-a5db8165"]]),_=m({__name:"Icon",props:{icon:{type:String,required:!1},size:{type:[String,Number],default:24},color:{type:String,default:null}},setup(t){const o=t,l={"x-small":12,small:16,medium:24,large:32,"x-large":40},a=e.computed(()=>o.icon?["icon","mdi",o.icon]:["icon"]),n=e.computed(()=>{let r=o.size;typeof o.size=="string"&&l[o.size]&&(r=l[o.size]);const s={fontSize:`${r}px`};return o.color&&(s.color=o.color),s});return(r,s)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(a.value),style:e.normalizeStyle(n.value),"aria-hidden":"true"},null,6))}},[["__scopeId","data-v-4a07735a"]]),J=["for"],Q={key:0,class:"date-picker__required"},Z={class:"date-picker__input-wrapper"},v=["id","value","disabled","readonly","min","max","required"],ee={key:1,class:"date-picker__error"},te={key:2,class:"date-picker__help"},I=m(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:o}){const l=t,a=o,n=e.computed(()=>`date-picker-${Math.random().toString(36).substr(2,9)}`),r=e.computed(()=>["date-picker",`date-picker--${l.size}`,`date-picker--${l.variant}`,{"date-picker--disabled":l.disabled,"date-picker--readonly":l.readonly,"date-picker--error":l.errorMessage,"date-picker--required":l.required}]),s=e.computed(()=>["date-picker__input",{"date-picker__input--with-icon":l.showIcon}]),c=p=>{const h=p.target;a("update:modelValue",h.value)},d=p=>{const h=p.target;a("change",h.value)},f=p=>{a("blur",p)},y=p=>{a("focus",p)};return(p,h)=>(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,J)):e.createCommentVNode("",!0),e.createElementVNode("div",Z,[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:c,onChange:d,onBlur:f,onFocus:y},null,42,v),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",ee,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0),t.helpText&&!t.errorMessage?(e.openBlock(),e.createElementBlock("div",te,e.toDisplayString(t.helpText),1)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-f09e8bb1"]]),oe=["aria-labelledby"],le={key:0,class:"dialog-header"},ae={id:"dialog-title",class:"dialog-title"},z=m({__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}},emits:["update:modelValue","ok"],setup(t,{emit:o}){const l=t,a=o,n=()=>{a("update:modelValue",!1)},r=()=>{l.persistent||n()},s=e.computed(()=>l.width?"":`dialog-content--${l.size}`),c=e.computed(()=>{const d={};return l.width&&(d.maxWidth=typeof l.width=="number"||!isNaN(Number(l.width))?`${l.width}px`:l.width,d.width=d.maxWidth),d});return e.watch(()=>l.modelValue,d=>{typeof document<"u"&&(document.body.style.overflow=d?"hidden":"")}),e.onUnmounted(()=>{typeof document<"u"&&(document.body.style.overflow="")}),(d,f)=>{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]),style:e.normalizeStyle(c.value),role:"dialog","aria-modal":"true","aria-labelledby":t.title?"dialog-title":void 0,onClick:f[0]||(f[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(y,{icon:"mdi-close",size:"24"})])])):e.createCommentVNode("",!0),e.createElementVNode("main",{class:e.normalizeClass(["dialog-body",{scrollable:t.scrollable}])},[e.renderSlot(d.$slots,"default",{},void 0,!0)],2)],14,oe)])):e.createCommentVNode("",!0)]),_:3})])}}},[["__scopeId","data-v-b9e605dc"]]),T=m({__name:"Divider",props:{vertical:{type:Boolean,default:!1},height:{type:[String,Number],default:1}},setup(t){const o=t,l=e.computed(()=>["divider",o.vertical?"divider--vertical":"divider--horizontal"]),a=e.computed(()=>o.vertical?{}:{height:`${o.height}px`});return(n,r)=>(e.openBlock(),e.createElementBlock("hr",{class:e.normalizeClass(l.value),style:e.normalizeStyle(a.value)},null,6))}},[["__scopeId","data-v-cbf66f89"]]),ne={class:"spinner-container"},S=m({__name:"ProgressSpinner",setup(t){return(o,l)=>(e.openBlock(),e.createElementBlock("div",ne,[...l[0]||(l[0]=[e.createElementVNode("div",{class:"spinner"},null,-1)])]))}},[["__scopeId","data-v-69bc6c98"]]),re={key:0,class:"placeholder"},ie=["src","alt"],D=m({__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 o=t,l=e.ref(!0),a=e.ref(!1),n=()=>{l.value=!1,a.value=!1},r=()=>{l.value=!1,a.value=!0};e.watch(()=>o.src,()=>{l.value=!0,a.value=!1},{immediate:!0});const s=e.computed(()=>({width:o.width,height:o.height,minWidth:o.width,minHeight:o.height,maxHeight:o.maxHeight}));return(c,d)=>{const f=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:"image-container",style:e.normalizeStyle(s.value)},[l.value||a.value?(e.openBlock(),e.createElementBlock("div",re,[l.value?(e.openBlock(),e.createBlock(S,{key:0})):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createBlock(f,{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,ie),[[e.vShow,!l.value&&!a.value]])],4)}}},[["__scopeId","data-v-a3997b8b"]]),se=["src"],ce={key:0,class:"slideshow-text-content"},de={key:0,class:"slideshow-title"},me=["innerHTML"],M=m({__name:"ImageSlideshow",props:{modelValue:{type:Boolean,required:!0},images:{type:Array,required:!0},startIndex:{type:Number,default:0},name:{type:String,default:""},description:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:o}){const l=useRuntimeConfig(),a=t,n=o,r=e.ref(0),s=e.ref(0),c=e.ref(a.startIndex);e.watch(()=>a.modelValue,u=>{u?(c.value=a.startIndex,window.addEventListener("keydown",h),document.body.style.overflow="hidden"):(window.removeEventListener("keydown",h),document.body.style.overflow="")});const d=e.computed(()=>{if(!a.images||a.images.length===0)return"";const u=a.images[c.value];return`${l.public.s3BaseUrl}${u}.jpg`}),f=()=>{n("update:modelValue",!1)},y=()=>{c.value=(c.value+1)%a.images.length},p=()=>{c.value=(c.value-1+a.images.length)%a.images.length},h=u=>{u.key==="Escape"&&f(),u.key==="ArrowRight"&&y(),u.key==="ArrowLeft"&&p()},w=u=>{r.value=u.touches[0].clientX,s.value=u.touches[0].clientY},k=u=>{const b=u.changedTouches[0].clientX,B=u.changedTouches[0].clientY,V=b-r.value,Fe=B-s.value;Math.abs(V)>Math.abs(Fe)&&(V>50?p():V<-50&&y())};return e.onUnmounted(()=>{window.removeEventListener("keydown",h),document.body.style.overflow=""}),(u,b)=>{const B=e.resolveComponent("Icon");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"slideshow-fade"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"slideshow-overlay",onClick:e.withModifiers(f,["self"])},[e.createElementVNode("button",{class:"slideshow-close-btn",onClick:e.withModifiers(f,["stop"]),"aria-label":"Close slideshow"},[e.createVNode(B,{icon:"mdi-close",size:"48"})]),e.createElementVNode("div",{class:"slideshow-content",onTouchstartPassive:w,onTouchendPassive:k},[e.createElementVNode("button",{class:"slideshow-nav-btn prev",onClick:e.withModifiers(p,["stop"]),"aria-label":"Previous image",style:{fontSize:"48px"}},[e.createVNode(B,{icon:"mdi-chevron-left",size:"80"})]),e.createElementVNode("img",{src:d.value,class:"slideshow-image",alt:"Slideshow image"},null,8,se),e.createElementVNode("button",{class:"slideshow-nav-btn next",onClick:e.withModifiers(y,["stop"]),"aria-label":"Next image",style:{fontSize:"48px"}},[e.createVNode(B,{icon:"mdi-chevron-right",size:"80"})]),t.name||t.description?(e.openBlock(),e.createElementBlock("div",ce,[t.name?(e.openBlock(),e.createElementBlock("h3",de,e.toDisplayString(t.name),1)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",{key:1,class:"slideshow-description",innerHTML:t.description},null,8,me)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],32)])):e.createCommentVNode("",!0)]),_:1})])}}},[["__scopeId","data-v-93d78bf4"]]),ue=["for"],fe={class:"input-container"},pe=["id","type","value","placeholder","disabled"],q=m({__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:o}){const l=t,a=o,n=r=>{a("update:modelValue",r.target.value)};return(r,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input-wrapper",l.class])},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:"input-label"},e.toDisplayString(t.label),9,ue)):e.createCommentVNode("",!0),e.createElementVNode("div",fe,[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,pe)])],2))}},[["__scopeId","data-v-9c7a100f"]]),P=m({__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:o}){const l=t,a=o,n=()=>{a("update:modelValue",!1)},r=e.computed(()=>["navigation-drawer",`navigation-drawer--${l.location}`]),s=e.computed(()=>({width:`${l.width}px`})),c=e.computed(()=>`slide-from-${l.location}`);return e.watch(()=>l.modelValue,d=>{typeof document<"u"&&(d?document.body.style.overflow="hidden":document.body.style.overflow="")}),e.onUnmounted(()=>{typeof document<"u"&&(document.body.style.overflow="")}),(d,f)=>(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:c.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(d.$slots,"default",{},void 0,!0)],6)):e.createCommentVNode("",!0)]),_:3},8,["name"])]))}},[["__scopeId","data-v-a13e59a5"]]),ye=["aria-valuenow"],he=["width","height","viewBox"],ge=["cx","cy","r","stroke-width"],ke=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset"],be={key:0,class:"progress-circular__content"},g=44,A=m({__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 o=t,l=e.computed(()=>(g-o.width)/2),a=e.computed(()=>2*Math.PI*l.value),n=e.computed(()=>({width:`${o.size}px`,height:`${o.size}px`,color:o.color==="primary"?"#3C9273":o.color})),r=e.computed(()=>o.width/o.size*g),s=e.computed(()=>o.indeterminate?null:a.value*(1-o.modelValue/100));return(c,d)=>(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 ${g} ${g}`},[e.createElementVNode("circle",{class:"progress-circular__underlay",fill:"transparent",cx:g/2,cy:g/2,r:l.value,"stroke-width":r.value},null,8,ge),e.createElementVNode("circle",{class:"progress-circular__overlay",fill:"transparent",cx:g/2,cy:g/2,r:l.value,"stroke-width":r.value,"stroke-dasharray":a.value,"stroke-dashoffset":s.value},null,8,ke)],8,he)),c.$slots.default?(e.openBlock(),e.createElementBlock("div",be,[e.renderSlot(c.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],12,ye))}},[["__scopeId","data-v-bdb14b7f"]]),L=m({__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 o=t,l=e.computed(()=>({justifyContent:o.justify,alignItems:o.align,gap:o.gap,flexWrap:o.wrap?"wrap":"nowrap"}));return(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:"flex-row",style:e.normalizeStyle(l.value)},[e.renderSlot(a.$slots,"default",{},void 0,!0)],4))}},[["__scopeId","data-v-fc69ad3e"]]),Be=["for"],_e={class:"select-container"},Se=["id","value","disabled","multiple"],we=["selected"],Ve=["value"],$e={key:0,class:"select-icon","aria-hidden":"true"},F=m({__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:o}){const l=t,a=o;e.computed(()=>!l.options||l.options.length===0?[]:typeof l.options[0]=="string"?l.options.map(r=>({text:r,value:r})):l.options);const n=r=>{if(l.multiple){const s=Array.from(r.target.selectedOptions).map(c=>c.value);a("update:modelValue",s)}else a("update:modelValue",r.target.value)};return(r,s)=>{const c=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["select-wrapper",l.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",_e,[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,d=>(e.openBlock(),e.createElementBlock("option",{key:d.value,value:d.value},e.toDisplayString(d.text),9,Ve))),128))],42,Se),t.hideArrow?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(c,{icon:"mdi-chevron-down",size:"20"})]))])],2)}}},[["__scopeId","data-v-d4f9136e"]]),xe={class:"spacer"},O=m({__name:"Spacer",setup(t){return(o,l)=>(e.openBlock(),e.createElementBlock("div",xe))}},[["__scopeId","data-v-370a82d1"]]),Ce={class:"textarea-wrapper"},Ne=["for"],Ee=["id","value","placeholder","rows","maxlength"],Ie={key:1,class:"error-message"},R=m({__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(o,l)=>(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:l[0]||(l[0]=a=>o.$emit("update:modelValue",a.target.value)),class:e.normalizeClass(["textarea-input",{"has-error":t.error}])},null,42,Ee),t.error?(e.openBlock(),e.createElementBlock("p",Ie,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-a2a785c2"]]);class ze{static newGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(o){const l=Math.random()*16|0;return(o=="x"?l:l&3|8).toString(16)})}static isValidGuid(){const o=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;return function(l){return l&&o.test(l)}}static isEmptyGuid(o){return o==="00000000-0000-0000-0000-000000000000"}static emptyGuid(){return"00000000-0000-0000-0000-000000000000"}}const Te={class:"input-container"},De=["id","type","value","autocomplete","maxlength"],Me=["for"],qe={class:"error-container"},j=m(e.defineComponent({__name:"TextField",props:{id:{type:String,default:()=>`textfield-${ze.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:o,emit:l}){const a=t,n=l,r=e.ref([]),s=e.ref(!0),c=e.inject("form",null),d=e.getCurrentInstance(),f=async()=>{r.value=[];let k=!0;for(const u of a.rules){const b=u(a.modelValue);b!==!0&&(k=!1,r.value.push(b))}return{valid:k,errors:r.value}},y=()=>{n("update:modelValue",""),p()},p=()=>{r.value=[],s.value=!0},h=k=>{const u=k.target;n("update:modelValue",u.value),s.value||f()},w=()=>{s.value=!1,a.trim&&typeof a.modelValue=="string"&&n("update:modelValue",a.modelValue.trim()),f()};return e.onMounted(()=>{c&&d&&c.register({id:a.id,validate:f,reset:y,resetValidation:p})}),e.onUnmounted(()=>{c&&d&&c.unregister({id:a.id})}),o({validate:f,reset:y,resetValidation:p,id:a.id,errors:r}),(k,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-field-wrapper",{"has-value":t.modelValue}])},[e.createElementVNode("div",Te,[e.createElementVNode("input",{id:t.id,type:t.type,value:t.modelValue,placeholder:" ",onInput:h,onBlur:w,class:"text-field-input",autocomplete:t.autocomplete,maxlength:t.maxlength},null,40,De),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}])},[...u[0]||(u[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,(b,B)=>(e.openBlock(),e.createElementBlock("p",{key:B,class:"error-message"},e.toDisplayString(b),1))),128))])],2))}}),[["__scopeId","data-v-02dabc6c"]]),Pe=["aria-label"],Ae={class:"tooltip-content"},U=m({__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 o=t,l=e.ref(!1),a=()=>{o.disabled||(l.value=!0)},n=()=>{l.value=!1},r=e.computed(()=>["tooltip",`tooltip--${o.location}`]);return(s,c)=>(e.openBlock(),e.createElementBlock("div",{class:"tooltip-container",onMouseenter:a,onMouseleave:n,onFocusin:a,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(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(r.value)},[e.createElementVNode("div",Ae,e.toDisplayString(t.text),1),c[0]||(c[0]=e.createElementVNode("div",{class:"tooltip-arrow"},null,-1))],2)):e.createCommentVNode("",!0)]),_:1})],40,Pe))}},[["__scopeId","data-v-a7533144"]]),H=m({__name:"Overlay",props:{modelValue:{type:Boolean,default:!1},contained:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:o}){const l=t,a=o;function n(){a("update:modelValue",!1)}return e.watch(()=>l.modelValue,r=>{!l.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-11b69f56"]]),G=t=>{t.component("Avatar",$),t.component("Button",x),t.component("Card",C),t.component("Chip",N),t.component("Column",E),t.component("DatePicker",I),t.component("Dialog",z),t.component("Divider",T),t.component("Icon",_),t.component("Overlay",H),t.component("Image",D),t.component("ImageSlideShow",M),t.component("Input",q),t.component("NavigationDrawer",P),t.component("Progress",A),t.component("ProgressSpinner",S),t.component("Row",L),t.component("Select",F),t.component("Spacer",O),t.component("TextArea",R),t.component("TextField",j),t.component("Tooltip",U)},Le={install:G};i.Avatar=$,i.Button=x,i.Card=C,i.Chip=N,i.Column=E,i.DatePicker=I,i.Dialog=z,i.Divider=T,i.Icon=_,i.Image=D,i.ImageSlideShow=M,i.Input=q,i.NavigationDrawer=P,i.Overlay=H,i.Progress=A,i.ProgressSpinner=S,i.Row=L,i.Select=F,i.Spacer=O,i.TextArea=R,i.TextField=j,i.Tooltip=U,i.default=Le,i.install=G,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "name": "treqit-ui-library",
16
16
  "private": false,
17
- "version": "1.4.8",
17
+ "version": "1.4.10",
18
18
  "type": "module",
19
19
  "types": "./dist/index.d.ts",
20
20
  "scripts": {
@@ -23,6 +23,8 @@
23
23
  "preview": "vite preview"
24
24
  },
25
25
  "dependencies": {
26
+ "@types/luxon": "^3.7.1",
27
+ "luxon": "^3.7.2",
26
28
  "vue": "^3.5.22"
27
29
  },
28
30
  "devDependencies": {