@lekseek/ui
Version:
Vue 3 components library
1 lines • 127 kB
JavaScript
(function(u,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(u=typeof globalThis<"u"?globalThis:u||self,t(u["Lekseek UI"]={},u.Vue))})(this,function(u,t){"use strict";function ce(e,o,s){return`${e}${o?`__${o}`:""}${s?`--${s}`:""}`}const Ze={asyncContent:{errorText:"Something went wrong",reloadText:"Try again"},autocomplete:{noMatchingItems:"No matching items"},infiniteScroll:{loadingText:"Loading...",completeText:"That is all!",errorText:"Loading data failed"},phoneInput:{errorText:"Type valid phone number"},pagination:{page:"Page",total:"of"},select:{placeholder:"Select",search:"Search",noMatchingItems:"No matching items"},image:{downloadFailed:"Image download failed",checkNetwork:"Check your network connection and try again",downloadImage:"Download image"},fileUploader:{selectFromDisk:"Select from disk",dropAreaText:"Move the file here",dropAreaTextWhenDragging:"Drop the file",dropAreaTextWhenDisabled:"Area disabled",title:"File add",validationError:"Invalid file",sizeError:"Invalid file size"},weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],timeline:{noItems:"No items to show"},table:{loading:"Loading",noItems:"No items to show"}},Qe={asyncContent:{errorText:"Co\u015B posz\u0142o nie tak.",reloadText:"Spr\xF3buj ponownie"},autocomplete:{noMatchingItems:"Brak pasuj\u0105cych wynik\xF3w"},infiniteScroll:{loadingText:"\u0141adowanie danych",completeText:"To ju\u017C wszystko!",errorText:"B\u0142\u0105d \u0142adowania danych"},phoneInput:{errorText:"Podaj poprawny numer"},pagination:{page:"Strona:",total:"z"},select:{placeholder:"Wybierz",search:"Szukaj",noMatchingItems:"Brak pasuj\u0105cych wynik\xF3w"},image:{downloadFailed:"Nie uda\u0142o si\u0119 pobra\u0107 grafiki",checkNetwork:"Sprawd\u017A, czy masz po\u0142\u0105czenie z Internetem i spr\xF3buj ponownie",downloadImage:"Pobierz grafik\u0119"},fileUploader:{selectFromDisk:"Wybierz z dysku",dropAreaText:"Przeci\u0105gnij plik tutaj",dropAreaTextWhenDragging:"Upu\u015B\u0107 plik",dropAreaTextWhenDisabled:"Obszar nieaktywny",title:"Dodawanie pliku",validationError:"Plik jest nieprawid\u0142owy",sizeError:"Nieprawid\u0142owy rozmiar pliku"},weekdays:["Poniedzia\u0142ek","Wtorek","\u015Aroda","Czwartek","Pi\u0105tek","Sobota","Niedziela"],months:["Stycze\u0144","Luty","Marzec","Kwiecie\u0144","Maj","Czerwiec","Lipiec","Sierpie\u0144","Wrzesie\u0144","Pa\u017Adziernik","Listopad","Grudzie\u0144"],timeline:{noItems:"Brak element\xF3w do wy\u015Bwietlenia"},table:{loading:"\u0141adowanie danych",noItems:"Brak element\xF3w do wy\u015Bwietlenia"}},_e={asyncContent:{errorText:"\u0412\u0438\u043D\u0438\u043A\u043B\u0430 \u043F\u043E\u043C\u0438\u043B\u043A\u0430.",reloadText:"\u0421\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437"},autocomplete:{noMatchingItems:"\u041D\u0435\u043C\u0430\u0454 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u043D\u0438\u0445 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0456\u0432"},infiniteScroll:{loadingText:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0434\u0430\u043D\u0438\u0445",completeText:"\u0426\u0435 \u0432\u0441\u0435!",errorText:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u0456 \u0434\u0430\u043D\u0438\u0445"},phoneInput:{errorText:"\u0412\u0432\u0435\u0434\u0456\u0442\u044C \u0434\u0456\u0439\u0441\u043D\u0438\u0439 \u043D\u043E\u043C\u0435\u0440"},pagination:{page:"\u0421\u0442\u043E\u0440\u0456\u043D\u043A\u0430:",total:"\u0437"},select:{placeholder:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438",search:"\u041F\u043E\u0448\u0443\u043A",noMatchingItems:"\u041D\u0435\u043C\u0430\u0454 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u043D\u0438\u0445 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u0456\u0432"},image:{downloadFailed:"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F",checkNetwork:"\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435, \u0447\u0438 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u043E \u0432\u0438 \u0434\u043E \u0406\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0443, \u0456 \u043F\u043E\u0432\u0442\u043E\u0440\u0456\u0442\u044C \u0441\u043F\u0440\u043E\u0431\u0443",downloadImage:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0456\u043B\u044E\u0441\u0442\u0440\u0430\u0446\u0456\u044E"},fileUploader:{selectFromDisk:"\u0412\u0438\u0431\u0435\u0440\u0430\u0442\u0438 \u0437 \u0434\u0438\u0441\u043A\u0430",dropAreaText:"\u041F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0444\u0430\u0439\u043B \u0441\u044E\u0434\u0438",dropAreaTextWhenDragging:"\u0421\u043A\u0438\u043D\u044C\u0442\u0435 \u0444\u0430\u0439\u043B",dropAreaTextWhenDisabled:"\u041D\u0435\u0430\u043A\u0442\u0438\u0432\u043D\u0430 \u0437\u043E\u043D\u0430",title:"\u0414\u043E\u0434\u0430\u0432\u0430\u043D\u043D\u044F \u0444\u0430\u0439\u043B\u0443",validationError:"\u0424\u0430\u0439\u043B \u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u0439",sizeError:"\u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440 \u0444\u0430\u0439\u043B\u0443"},weekdays:["\u041F\u043E\u043D\u0435\u0434\u0456\u043B\u043E\u043A","\u0412\u0456\u0432\u0442\u043E\u0440\u043E\u043A","\u0421\u0435\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440","\u041F'\u044F\u0442\u043D\u0438\u0446\u044F","\u0421\u0443\u0431\u043E\u0442\u0430","\u041D\u0435\u0434\u0456\u043B\u044F"],months:["\u0421\u0456\u0447\u0435\u043D\u044C","\u041B\u044E\u0442\u0438\u0439","\u0411\u0435\u0440\u0435\u0437\u0435\u043D\u044C","\u041A\u0432\u0456\u0442\u0435\u043D\u044C","\u041C\u0430\u0439","\u0427\u0435\u0440\u0432\u0435\u043D\u044C","\u041B\u0438\u043F\u0435\u043D\u044C","\u0421\u0435\u0440\u043F\u0435\u043D\u044C","\u0412\u0435\u0440\u0435\u0441\u0435\u043D\u044C","\u0416\u043E\u0432\u0442\u0435\u043D\u044C","\u041B\u0438\u0441\u0442\u043E\u043F\u0430\u0434","\u0413\u0440\u0443\u0434\u0435\u043D\u044C"],timeline:{noItems:"\u041D\u0435\u043C\u0430\u0454 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u0434\u043B\u044F \u0432\u0456\u0434\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F"},table:{loading:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0434\u0430\u043D\u0438\u0445",noItems:"\u041D\u0435\u043C\u0430\u0454 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u0434\u043B\u044F \u0432\u0456\u0434\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F"}};var v=(e=>(e.PL="pl",e.EN="en",e.UK="uk",e))(v||{});const xe={locale:v.PL,locales:{[v.PL]:Qe,[v.EN]:Ze,[v.UK]:_e},t(){return this.locales[this.locale]}},we={bem:{hyphenate:!0},...{test:{elAttrName:"data-test",elNamePrefix:""},testElName(e){return{[this.test.elAttrName]:`${this.test.elNamePrefix}${e}`}}},...xe,...{icons:{prefix:"fa-",type:"fa",values:{error:"exclamation-triangle",spinner:"spinner",check:"check",previous:"chevron-left",next:"chevron-right",expand:"chevron-down",collapse:"chevron-up",file:"file-import",close:"times",hamburger:"bars"}}}},ye=Symbol("ui");function ve(e,o={}){const s=o.bem||we.bem;e.mixin({name:"BemMixin",methods:{$bem({b:n,e:i,m:a}){const r=C=>C.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),d=this.$options.name,h=n||s.hyphenate?r(d):d,m=a?typeof a=="string"?[a]:Array.isArray(a)?a:Object.keys(a).filter(C=>a[C]):[],p=ce(h,i),y=m.map(C=>ce(h,i,C));return[p,...y]}}});const l=t.reactive({...we,...o});e.config.globalProperties.$ui=l,e.provide(ye,l)}const et=t.defineComponent({name:"LsIcon",props:{name:{type:String,default:""},prefix:{type:String,default:""},type:{type:String,default:""},size:{type:String,default:null},rotate:{type:String,default:null},flip:{type:String,default:null},pulse:{type:Boolean,default:!1},spin:{type:Boolean,default:!1}},computed:{computedPrefix(){return this.prefix||this.$ui.icons.prefix},computedType(){return this.type||this.$ui.icons.type},classes(){let e=[];return e=[`${this.computedPrefix}${this.name}`,this.computedType],[...this.$bem({m:{[`size-${this.size}`]:!!this.size,[`rotate-${this.rotate}`]:!!this.rotate,[`flip-${this.flip}`]:!!this.flip,pulse:this.pulse,spin:this.spin}}),...e]}}}),wl="",f=(e,o)=>{const s=e.__vccOpts||e;for(const[l,n]of o)s[l]=n;return s};function tt(e,o,s,l,n,i){return t.openBlock(),t.createElementBlock("i",t.mergeProps({class:e.classes},e.$ui.testElName("icon")),[t.renderSlot(e.$slots,"default")],16)}const T=f(et,[["render",tt]]),ot=t.defineComponent({name:"LsSpinner",components:{LsIcon:T},props:{size:{type:String,default:"3x"}}});function st(e,o,s,l,n,i){const a=t.resolveComponent("LsIcon");return t.openBlock(),t.createBlock(a,t.mergeProps({name:e.$ui.icons.values.spinner,spin:"",size:e.size},e.$ui.testElName("spinner")),null,16,["name","size"])}const ee=f(ot,[["render",st]]),Y=(e,o)=>o?`has-${e}-${o}`:null,me=e=>Y("color",e),H=e=>Y("bg-color",e),lt=e=>Y("hover-color",e),Le=e=>Y("hover-bg-color",e),Ve=e=>Y("border-color",e),nt=e=>Y("gradient",e),Ie="is-elevated",Ce="is-hoverable",z={bordered:{type:Boolean,default:!1}};function R(e){return t.computed(()=>({"is-bordered":e.value}))}const K={elevated:{type:Boolean,default:!1}};function te(e){return t.computed(()=>({"is-elevated":e.value}))}const ke={depressed:{type:Boolean,default:!1}};function Te(e){return t.computed(()=>({"is-depressed":e.value}))}const N={rounded:{type:Boolean,default:!1},roundedLg:{type:Boolean,default:!1},round:{type:Boolean,default:!1}};function P(e,o,s){return t.computed(()=>({"is-rounded":e.value,"is-rounded-lg":o.value,"is-round":(s==null?void 0:s.value)||!1}))}const V={dark:{type:Boolean,default:!1},light:{type:Boolean,default:!1}};function A(e,o){return t.computed(()=>({"is-dark":e.value,"is-light":o.value}))}const De={to:{type:[Object,String],default:null},href:{type:String,default:null},newWindow:{type:Boolean,default:!1}};function ze(e,o,s){return{component:t.computed(()=>e.value?"RouterLink":o.value?"a":"span"),target:t.computed(()=>s.value?"_blank":"_self")}}const oe={error:{type:Boolean,default:!1}};function Pe(e){return{validationBorderClass:t.computed(()=>({"is-bordered":e.value,"has-border-color-error":e.value}))}}const rt={padding:{type:String,default:null}};function at(e){return t.computed(()=>({[`has-padding-${e.value}`]:e.value}))}const J={size:{type:String,default:"md"}},it=t.defineComponent({name:"LsButton",components:{LsSpinner:ee,LsIcon:T},props:{color:{type:String,default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},leftIcon:{type:String,default:null},rightIcon:{type:String,default:null},title:{type:String,default:null},block:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1},uppercase:{type:Boolean,default:!1},gradient:{type:String,default:null},theme:{type:String,default:null},...V,...z,...N,...De,...K,...J},setup(e){const{dark:o,light:s,bordered:l,rounded:n,roundedLg:i,round:a,to:r,href:d,newWindow:h,elevated:m}=t.toRefs(e),{component:p,target:y}=ze(r,d,h);return{themeClass:A(o,s),borderedClass:R(l),roundedClass:P(n,i,a),elevatedClass:te(m),component:p,target:y}},data(){return{isFocused:!1}},computed:{classes(){let e=[];return this.color&&this.color!=="default"&&(this.plain?e=[me(this.color),lt(`${this.color}-darken-1`)]:e=[H(this.color),Le(`${this.color}-darken-1`)]),[...e,...this.$bem({m:{[this.size]:!0,disabled:this.disabled||this.loading,block:this.block,[`gradient-${this.gradient}`]:!!this.gradient,uppercase:this.uppercase,[`theme-${this.theme}`]:!!this.theme}}),{[Ce]:this.hoverable},this.themeClass,this.borderedClass,this.roundedClass,this.elevatedClass]}}}),Ll="",dt=["title","disabled"];function ct(e,o,s,l,n,i){var d;const a=t.resolveComponent("LsIcon"),r=t.resolveComponent("LsSpinner");return t.openBlock(),t.createElementBlock("button",t.mergeProps({title:(d=e.title)!=null?d:void 0,class:e.classes,type:"button",disabled:e.disabled||e.loading},e.$ui.testElName("button")),[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.component),{to:e.to,href:e.href,target:e.target,rel:e.newWindow?"noopener":"",class:t.normalizeClass(e.$bem({e:"container",m:{"with-icons":!!e.leftIcon||!!e.rightIcon}}))},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"container",{},()=>[e.leftIcon?(t.openBlock(),t.createBlock(a,{key:0,name:e.leftIcon,class:t.normalizeClass(e.$bem({e:"icon"}))},null,8,["name","class"])):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(e.$bem({e:"content"}))},[t.renderSlot(e.$slots,"default"),e.loading?(t.openBlock(),t.createBlock(r,{key:0,color:e.dark?"white":"default",class:t.normalizeClass(e.$bem({e:"loader"})),size:"1x"},null,8,["color","class"])):t.createCommentVNode("",!0)],2),e.rightIcon?(t.openBlock(),t.createBlock(a,{key:1,name:e.rightIcon,class:t.normalizeClass(e.$bem({e:"icon"}))},null,8,["name","class"])):t.createCommentVNode("",!0)])]),_:3},8,["to","href","target","rel","class"]))],16,dt)}const G=f(it,[["render",ct]]),mt=t.defineComponent({name:"LsAsyncContent",components:{LsSpinner:ee,LsIcon:T,LsButton:G},props:{loading:{type:Boolean,required:!0},spinnerSize:{type:String,default:"2x"},loadingText:{type:String,default:""},error:{type:Boolean,default:!1},errorText:{type:String,default:""},reloadable:{type:Boolean,default:!1},reloadText:{type:String,default:""}},emits:["reload"],computed:{computedErrorText(){return this.errorText||this.$ui.t().asyncContent.errorText},computedReloadText(){return this.reloadText||this.$ui.t().asyncContent.reloadText}},methods:{reload(){this.$emit("reload")}}}),Vl="",ut={key:0};function pt(e,o,s,l,n,i){const a=t.resolveComponent("LsSpinner"),r=t.resolveComponent("LsIcon"),d=t.resolveComponent("LsButton");return t.openBlock(),t.createElementBlock("div",t.mergeProps({class:e.$bem({})},e.$ui.testElName("async-content")),[e.loading?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.$bem({e:"loading-wrapper"}))},[t.renderSlot(e.$slots,"loader",{},()=>[t.createVNode(a,{class:t.normalizeClass(e.$bem({e:"loader"})),size:e.spinnerSize},null,8,["class","size"])]),t.createElementVNode("p",{class:t.normalizeClass(e.$bem({e:"loading-text"}))},t.toDisplayString(e.loadingText),3)],2)):e.error?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(e.$bem({e:"error-wrapper"}))},[t.createVNode(r,{class:t.normalizeClass(e.$bem({e:"error-icon"})),size:"3x",name:e.$ui.icons.values.error},null,8,["class","name"]),t.createElementVNode("p",{class:t.normalizeClass(e.$bem({e:"error-text"}))},t.toDisplayString(e.computedErrorText),3),e.reloadable?(t.openBlock(),t.createBlock(d,t.mergeProps({key:0,color:"primary",rounded:"",dark:"",class:e.$bem({e:"reload-button"})},e.$ui.testElName("async-content-reload"),{onClick:e.reload}),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.computedReloadText),1)]),_:1},16,["class","onClick"])):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0),t.createVNode(t.Transition,{name:"slide"},{default:t.withCtx(()=>[!e.loading&&!e.error?(t.openBlock(),t.createElementBlock("div",ut,[t.renderSlot(e.$slots,"default")])):t.createCommentVNode("",!0)]),_:3})],16)}const Ae=f(mt,[["render",pt]]),ht=t.defineComponent({name:"LsInput",components:{LsIcon:T},props:{modelValue:{type:[String,Number],default:null},placeholder:{type:String,default:null},type:{type:String,default:"text"},required:{type:Boolean,default:!1},min:{type:Number,default:null},max:{type:Number,default:null},maxlength:{type:Number,default:null},step:{type:Number,default:1},label:{type:String,default:null},width:{type:Number,default:null},leftIcon:{type:String,default:null},rightIcon:{type:String,default:null},leftIconClickable:{type:Boolean,default:!1},rightIconClickable:{type:Boolean,default:!1},leftIconColor:{type:String,default:null},rightIconColor:{type:String,default:null},rememberCaretPosition:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},...V,...z,...N,...oe,...ke,...J},emits:["update:modelValue","enter","focus","blur","click-left-icon","click-right-icon","click","mouseenter","mouseleave","input"],setup(e){const{dark:o,light:s,bordered:l,rounded:n,roundedLg:i,round:a,error:r,depressed:d}=t.toRefs(e),{validationBorderClass:h}=Pe(r);return{themeClass:A(o,s),borderedClass:R(l),roundedClass:P(n,i,a),depressedClass:Te(d),validationBorderClass:h}},data(){return{isFocused:!1}},computed:{widthStyle(){return this.width?{width:`${this.width}px`}:{}},styles(){return{...this.widthStyle}},classes(){return[...this.$bem({m:{[this.size]:!0,light:this.light,dark:this.dark,disabled:this.disabled,round:this.round,rounded:this.rounded,"rounded-lg":this.roundedLg}}),{[Ie]:this.isFocused},this.borderedClass,this.validationBorderClass,this.roundedClass,this.depressedClass]}},methods:{setFocusStatus(e){this.isFocused=e},onFocus(){this.setFocusStatus(!0),this.$emit("focus")},onBlur(e){this.setFocusStatus(!1),this.$emit("blur",e)},onInput(e){const o=e.target.value;this.$emit("update:modelValue",o),this.$emit("input",o)},enter(e){const o=e.target.value;this.$emit("enter",o)},onLeftIconClick(){this.leftIconClickable&&this.$emit("click-left-icon")},onRightIconClick(){this.rightIconClickable&&this.$emit("click-right-icon")},focus(){this.$refs.input.focus()}}}),Il="",ft=["autofocus","type","min","max","maxlength","required","step","value","readonly","placeholder","disabled"];function gt(e,o,s,l,n,i){var r,d,h;const a=t.resolveComponent("LsIcon");return t.openBlock(),t.createElementBlock("span",t.mergeProps({class:e.classes,style:e.styles},e.$ui.testElName("input")),[t.renderSlot(e.$slots,"before"),e.leftIcon?(t.openBlock(),t.createElementBlock("div",t.mergeProps({key:0,class:[...e.$bem({e:"icon",m:{clickable:e.leftIconClickable,round:e.round}}),e.roundedClass]},e.$ui.testElName("input-icon-left"),{onClick:o[0]||(o[0]=(...m)=>e.onLeftIconClick&&e.onLeftIconClick(...m))}),[t.createVNode(a,{name:e.leftIcon,color:e.leftIconColor},null,8,["name","color"])],16)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(e.$bem({e:"content",m:{disabled:e.disabled,["left-padding"]:!e.leftIcon,["right-padding"]:!e.rightIcon}}))},[e.label&&(e.modelValue||e.placeholder)?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(e.$bem({e:"label"}))},t.toDisplayString(e.label),3)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"before-text"),t.createElementVNode("input",t.mergeProps({ref:"input",autofocus:e.autofocus,type:e.type,min:(r=e.min)!=null?r:void 0,max:(d=e.max)!=null?d:void 0,maxlength:(h=e.maxlength)!=null?h:void 0,required:e.required,step:e.step,value:e.modelValue||void 0,readonly:e.readonly,placeholder:e.placeholder||e.label||void 0,class:e.$bem({e:"input",m:{"with-label":!!e.label&&(!!e.modelValue||!!e.placeholder)}}),disabled:e.disabled,"data-test":"field"},e.$ui.testElName("input-field"),{onInput:o[1]||(o[1]=(...m)=>e.onInput&&e.onInput(...m)),onFocus:o[2]||(o[2]=(...m)=>e.onFocus&&e.onFocus(...m)),onBlur:o[3]||(o[3]=(...m)=>e.onBlur&&e.onBlur(...m)),onKeydown:o[4]||(o[4]=t.withKeys((...m)=>e.enter&&e.enter(...m),["enter"])),onClick:o[5]||(o[5]=m=>e.$emit("click")),onMouseenter:o[6]||(o[6]=m=>e.$emit("mouseenter")),onMouseleave:o[7]||(o[7]=m=>e.$emit("mouseleave"))}),null,16,ft),t.renderSlot(e.$slots,"after-text")],2),e.rightIcon?(t.openBlock(),t.createElementBlock("div",t.mergeProps({key:1,class:[...e.$bem({e:"icon",m:{clickable:e.rightIconClickable,round:e.round}}),e.roundedClass]},e.$ui.testElName("input-icon-right"),{onClick:o[8]||(o[8]=(...m)=>e.onRightIconClick&&e.onRightIconClick(...m))}),[t.createVNode(a,{name:e.rightIcon,color:e.rightIconColor},null,8,["name","color"])],16)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"after")],16)}const q=f(ht,[["render",gt]]),$t=t.defineComponent({name:"LsTextarea",components:{LsIcon:T},props:{modelValue:{type:[String,Number],default:null},placeholder:{type:String,default:null},type:{type:String,default:"text"},required:{type:Boolean,default:!1},maxlength:{type:Number,default:null},rows:{type:Number,default:null},label:{type:String,default:null},leftIcon:{type:String,default:null},rightIcon:{type:String,default:null},leftIconClickable:{type:Boolean,default:!1},rightIconClickable:{type:Boolean,default:!1},leftIconColor:{type:String,default:null},rightIconColor:{type:String,default:null},width:{type:Number,default:null},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},...V,...z,...N,...oe,...ke,...J},emits:["enter","focus","blur","update:modelValue","click-left-icon","click-right-icon","enter-no-shift","enter-shift","input"],setup(e){const{dark:o,light:s,bordered:l,rounded:n,roundedLg:i,round:a,error:r,depressed:d}=t.toRefs(e),{validationBorderClass:h}=Pe(r);return{themeClass:A(o,s),borderedClass:R(l),roundedClass:P(n,i,a),depressedClass:Te(d),validationBorderClass:h}},data(){return{isFocused:!1}},computed:{widthStyle(){return this.width?{width:`${this.width}px`}:{}},styles(){return{...this.widthStyle}},classes(){return[...this.$bem({m:{[this.size]:!0,light:this.light,dark:this.dark,disabled:this.disabled,rounded:this.rounded,"rounded-lg":this.roundedLg,round:this.round}}),{[Ie]:this.isFocused},this.borderedClass,this.validationBorderClass,this.roundedClass,this.depressedClass]}},methods:{setFocusStatus(e){this.isFocused=e},onFocus(){this.setFocusStatus(!0),this.$emit("focus")},onBlur(){this.setFocusStatus(!1),this.$emit("blur")},input(e){const o=e.target.value;this.$emit("update:modelValue",o),this.$emit("input",o)},onLeftIconClick(){this.leftIconClickable&&this.$emit("click-left-icon")},onRightIconClick(){this.rightIconClickable&&this.$emit("click-right-icon")},enter(e){const o=e.target.value;e.shiftKey?this.$emit("enter-shift",e):this.$emit("enter-no-shift",e),this.$emit("enter",o)},focus(){this.$refs.textarea.focus()}}}),Tl="",yt=["readonly","autofocus","rows","required","value","placeholder","maxlength","disabled"];function Ct(e,o,s,l,n,i){var r;const a=t.resolveComponent("LsIcon");return t.openBlock(),t.createElementBlock("span",t.mergeProps({class:e.classes,style:e.styles},e.$ui.testElName("textarea")),[t.renderSlot(e.$slots,"before"),e.leftIcon?(t.openBlock(),t.createElementBlock("div",t.mergeProps({key:0,class:["is-hoverable",[...e.$bem({e:"icon",m:{clickable:e.leftIconClickable,round:e.round}}),e.roundedClass]]},e.$ui.testElName("textarea-icon-left"),{onClick:o[0]||(o[0]=(...d)=>e.onLeftIconClick&&e.onLeftIconClick(...d))}),[t.createVNode(a,{name:e.leftIcon,color:e.leftIconColor},null,8,["name","color"])],16)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(e.$bem({e:"content",m:{disabled:e.disabled,["left-padding"]:!e.leftIcon,["right-padding"]:!e.rightIcon}}))},[e.label&&(e.modelValue||e.placeholder)?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(e.$bem({e:"label"}))},t.toDisplayString(e.label),3)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"before-text"),t.createElementVNode("textarea",t.mergeProps({ref:"textarea",readonly:e.readonly,autofocus:e.autofocus,rows:e.rows,required:e.required,value:e.modelValue||void 0,placeholder:e.placeholder||e.label||void 0,maxlength:(r=e.maxlength)!=null?r:void 0,class:e.$bem({e:"textarea",m:{"with-label":!!e.label&&(!!e.modelValue||!!e.placeholder)}}),"data-test":"field",disabled:e.disabled},e.$ui.testElName("textarea-field"),{onInput:o[1]||(o[1]=(...d)=>e.input&&e.input(...d)),onFocus:o[2]||(o[2]=(...d)=>e.onFocus&&e.onFocus(...d)),onBlur:o[3]||(o[3]=(...d)=>e.onBlur&&e.onBlur(...d)),onKeydown:o[4]||(o[4]=t.withKeys((...d)=>e.enter&&e.enter(...d),["enter"]))}),null,16,yt),t.renderSlot(e.$slots,"after-text")],2),e.rightIcon?(t.openBlock(),t.createElementBlock("div",t.mergeProps({key:1,class:["is-hoverable",[...e.$bem({e:"icon",m:{clickable:e.rightIconClickable,round:e.round}}),e.roundedClass]]},e.$ui.testElName("textarea-icon-right"),{onClick:o[5]||(o[5]=(...d)=>e.onRightIconClick&&e.onRightIconClick(...d))}),[t.createVNode(a,{name:e.rightIcon,color:e.rightIconColor},null,8,["name","color"])],16)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"after")],16)}const be=f($t,[["render",Ct]]),kt=t.defineComponent({name:"LsBadge",props:{color:{type:String,default:null},disabled:{type:Boolean,default:!1},size:{type:String,default:"md"},...V,...z,...K,...N},emits:["click"],setup(e){const{dark:o,light:s,bordered:l,rounded:n,roundedLg:i,elevated:a}=t.toRefs(e);return{themeClass:A(o,s),borderedClass:R(l),elevatedClass:te(a),roundedClass:P(n,i)}},computed:{classes(){return[...this.color?[H(this.color),me("white")]:[],...this.$bem({m:{[this.size]:!0,disabled:this.disabled,round:this.round}}),this.themeClass,this.borderedClass,this.elevatedClass,this.roundedClass]}}}),Dl="",bt=["disabled"];function Bt(e,o,s,l,n,i){return t.openBlock(),t.createElementBlock("span",t.mergeProps({disabled:e.disabled,class:e.classes},e.$ui.testElName("badge")),[t.renderSlot(e.$slots,"default")],16,bt)}const Be=f(kt,[["render",Bt]]),St=t.defineComponent({name:"LsIconButton",components:{LsButton:G,LsIcon:T},props:{icon:{type:String,default:""},iconType:{type:String,default:void 0},iconPrefix:{type:String,default:void 0},disabled:{type:Boolean,default:!1},color:{type:String,default:"default"},title:{type:String,default:null},loading:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1},gradient:{type:String,default:null},theme:{type:String,default:null},...z,...V,...N,...J},computed:{classes(){const e=[this.size];return this.$bem({m:e})}}}),zl="";function Et(e,o,s,l,n,i){const a=t.resolveComponent("LsIcon"),r=t.resolveComponent("LsButton");return t.openBlock(),t.createBlock(r,t.mergeProps({class:e.classes,bordered:e.bordered,light:e.light,dark:e.dark,rounded:e.rounded,"rounded-lg":e.roundedLg,round:e.round,color:e.color,disabled:e.disabled,size:e.size,title:e.title,loading:e.loading,plain:e.plain,hoverable:e.hoverable,gradient:e.gradient,theme:e.theme},e.$ui.testElName("icon-button")),{container:t.withCtx(()=>[e.loading?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(a,{key:0,name:e.icon,type:e.iconType,prefix:e.iconPrefix},null,8,["name","type","prefix"])),t.renderSlot(e.$slots,"default")]),_:3},16,["class","bordered","light","dark","rounded","rounded-lg","round","color","disabled","size","title","loading","plain","hoverable","gradient","theme"])}const O=f(St,[["render",Et]]),se="__v-click-outside",Nt=typeof window<"u",wt=typeof navigator<"u",Lt=Nt&&("ontouchstart"in window||wt&&navigator.msMaxTouchPoints>0)?["touchstart"]:["click"];function Vt(e){const o=typeof e=="function";if(!o&&typeof e!="object")throw new Error("v-click-outside: Binding value must be a function or an object");return{handler:o?e:e.handler,middleware:e.middleware||(s=>s),events:e.events||Lt,isActive:e.isActive!==!1}}function It({el:e,event:o,handler:s,middleware:l}){const n=o.path||o.composedPath&&o.composedPath();(n?n.indexOf(e)<0:!e.contains(o.target))&&l(o)&&s(o)}function Fe(e,{value:o}){const{events:s,handler:l,middleware:n,isActive:i}=Vt(o);!i||(e[se]=s.map(a=>({event:a,handler:r=>It({event:r,el:e,handler:l,middleware:n})})),e[se].forEach(({event:a,handler:r})=>setTimeout(()=>{!e[se]||document.documentElement.addEventListener(a,r,!1)},0)))}function Me(e){(e[se]||[]).forEach(({event:s,handler:l})=>document.documentElement.removeEventListener(s,l,!1)),delete e[se]}function Tt(e,{value:o,oldValue:s}){JSON.stringify(o)!==JSON.stringify(s)&&(Me(e),Fe(e,{value:o}))}const X={beforeMount:Fe,updated:Tt,unmounted:Me},Dt=t.defineComponent({name:"LsAutocomplete",components:{LsInput:q,LsTextarea:be,LsAsyncContent:Ae,LsBadge:Be,LsIconButton:O},directives:{ClickOutside:X},props:{modelValue:{type:[Object,Array],default:null},items:{type:Array,required:!0},placeholder:{type:String,default:null},type:{type:String,default:"text"},required:{type:Boolean,default:!1},min:{type:Number,default:null},max:{type:Number,default:null},maxlength:{type:Number,default:null},step:{type:Number,default:1},label:{type:String,default:null},width:{type:Number,default:null},leftIcon:{type:String,default:null},leftIconClickable:{type:Boolean,default:!1},leftIconColor:{type:String,default:null},disabled:{type:Boolean,default:!1},maxHeight:{type:Number,default:320},listPosition:{type:String,default:"bottom",validator:e=>["top","bottom"].includes(e)},itemsLoading:{type:Boolean,default:!1},itemsError:{type:Boolean,default:!1},itemsReloadable:{type:Boolean,default:!1},textarea:{type:Boolean,default:!1},rows:{type:Number,default:null},noMatchingItemsText:{type:String,default:""},external:{type:Boolean,default:!1},searchDelay:{type:Number,default:0},multiple:{type:Boolean,default:!1},...V,...z,...N,...oe,...ke,...J},emits:["update:modelValue","enter","focus","blur","click-left-icon","click-right-icon","select","update","reload","search"],setup(e){const{dark:o,light:s,bordered:l,rounded:n,roundedLg:i}=t.toRefs(e);return{themeClass:A(o,s),borderedClass:R(l),roundedClass:P(n,i)}},data(){return{isFocused:!1,isExpanded:!1,listClicked:!1,activeItemKey:null,searchText:"",searchTimeout:null}},computed:{selectedItems(){return Array.isArray(this.modelValue)?this.modelValue:this.modelValue?[this.modelValue]:[]},selectedItem(){return Array.isArray(this.modelValue)?null:this.modelValue},computedNoMatchingItemsText(){return this.noMatchingItemsText||this.$ui.t().autocomplete.noMatchingItems},component(){return this.textarea?be:q},filteredItems(){const e=this.external?this.items:this.items.filter(o=>{var s;return!this.searchText||((s=o.text)==null?void 0:s.toLowerCase().includes(this.searchText.toLowerCase()||""))||o.header||o.divider});return e.filter((o,s)=>{var i;const l=(o.header||o.divider)&&!o.key,n=!((i=e[s+1])==null?void 0:i.key);return!(l&&n)})},inputClasses(){return[...this.$bem({e:"input",m:{expanded:this.isExpanded}})]},itemsClasses(){return[...this.$bem({e:"items",m:{"theme-default":!this.light&&!this.dark,[this.listPosition]:!0,rounded:this.rounded,"rounded-lg":this.roundedLg,round:this.round}}),this.themeClass]}},methods:{isItemSelected(e){return!!e&&this.selectedItems.map(o=>o.key).includes(e)},onKeydown(e){e.code==="Tab"&&this.closeList()},scrollToActiveItem(){if(this.activeItemKey){const e=this.$refs.list,o=e.offsetHeight,s=e.scrollTop,l=e.querySelectorAll(`[data-item-key="${this.activeItemKey}"]`)[0],n=l.offsetTop,i=l.offsetHeight;n<s?e.scrollTo({top:n}):n+i>o+s&&e.scrollTo({top:n-o+i})}},goToPrevious(){this.focus(),t.nextTick(()=>{const e=this.filteredItems.filter(l=>!!l.key&&!l.disabled);let o=e.length;this.activeItemKey&&(o=e.findIndex(l=>l.key===this.activeItemKey));const s=e[o-1];s&&(this.activeItemKey=s.key||null,this.scrollToActiveItem())})},goToNext(){this.focus(),t.nextTick(()=>{const e=this.filteredItems.filter(l=>!!l.key&&!l.disabled);let o=-1;this.activeItemKey&&(o=e.findIndex(l=>l.key===this.activeItemKey));const s=e[o+1];s&&(this.activeItemKey=s.key||null,this.scrollToActiveItem())})},update(e){this.$emit("update:modelValue",e),this.$emit("update",e)},removeItemFromSelected(e){const o=this.selectedItems.filter(s=>s.key!==e.key);this.update(o)},handleItemClick(e){if(this.multiple)if(this.isItemSelected(e.key))this.removeItemFromSelected(e);else{const o=[...this.selectedItems,e];this.update(o)}else(!this.isItemSelected(e.key)||Array.isArray(this.modelValue))&&(this.$emit("select",e),this.update(e)),this.isFocused=!1,this.isExpanded=!1,this.listClicked=!1;this.activeItemKey=null},selectActiveItem(){if(this.activeItemKey){const e=this.items.find(o=>o.key===this.activeItemKey);e&&this.handleItemClick(e)}},handleInputEnter(){this.isExpanded?this.selectActiveItem():this.focus()},closeList(){this.isFocused=!1,this.isExpanded=!1,this.listClicked=!1,this.activeItemKey=null},itemClasses(e){return[...this.$bem({e:"item",m:{disabled:e.disabled===!0,active:e.key===this.activeItemKey,selected:this.isItemSelected(e.key)}}),Ce]},cleanSelection(){this.update(null)},reload(){this.$emit("reload")},search(e){this.$emit("search",e)},handleInput(e){this.searchText=e,this.searchDelay?(clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.search(e)},this.searchDelay)):this.search(e)},expand(){this.searchText="",this.isExpanded=!0},focus(){this.$emit("focus"),this.isFocused=!0,this.expand()},clickOutsideHandler(e){this.$refs.input.$el.contains(e.target)||this.closeList()},blur(e){this.$emit("blur",e)},enter(e){this.$emit("enter",{key:null,text:e})}}}),Al="",zt=["data-item-key"],Pt=["onClick"];function At(e,o,s,l,n,i){const a=t.resolveComponent("LsIconButton"),r=t.resolveComponent("LsBadge"),d=t.resolveComponent("LsAsyncContent"),h=t.resolveDirective("click-outside");return t.openBlock(),t.createElementBlock("div",t.mergeProps({class:e.$bem({})},e.$ui.testElName("autocomplete")),[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.component),t.mergeProps({ref:"input",readonly:!e.isExpanded,"model-value":e.isExpanded?e.searchText:!e.multiple&&e.selectedItem?e.selectedItem.text:"",placeholder:e.placeholder,type:e.type,required:e.required,min:e.min,max:e.max,maxlength:e.maxlength,step:e.step,label:e.label,width:e.width,rows:e.rows,"left-icon":e.leftIcon,"left-icon-clickable":e.leftIconClickable,"left-icon-color":e.leftIconColor,"right-icon":e.selectedItem&&e.selectedItem.key?e.$ui.icons.values.close:null,"right-icon-clickable":"",disabled:e.disabled,bordered:e.bordered,dark:e.dark,light:e.light,rounded:e.rounded,"rounded-lg":e.roundedLg,round:e.round,error:e.error,class:e.inputClasses,depressed:e.depressed,size:e.size},e.$ui.testElName("autocomplete-input"),{onEnter:e.enter,onFocus:e.focus,onClick:e.expand,onBlur:e.blur,onInput:e.handleInput,onClickLeftIcon:o[1]||(o[1]=m=>e.$emit("click-left-icon")),onClickRightIcon:e.cleanSelection,onKeydown:[t.withKeys(e.goToPrevious,["up"]),t.withKeys(e.goToNext,["down"]),t.withKeys(t.withModifiers(e.handleInputEnter,["prevent","stop"]),["enter"]),t.withKeys(e.closeList,["esc"]),e.onKeydown]}),t.createSlots({after:t.withCtx(()=>[e.isExpanded?(t.openBlock(),t.createBlock(t.Transition,{key:0,name:"slide-top"},{default:t.withCtx(()=>[t.withDirectives((t.openBlock(),t.createElementBlock("div",t.mergeProps({ref:"list",class:e.itemsClasses,style:{maxHeight:`${e.maxHeight}px`}},e.$ui.testElName("autocomplete-list"),{onClick:o[0]||(o[0]=t.withModifiers(m=>e.listClicked=!0,["stop"]))}),[t.createVNode(d,{loading:e.itemsLoading,error:e.itemsError,reloadable:e.itemsReloadable,onReload:e.reload},{default:t.withCtx(()=>[e.filteredItems.length===0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.$bem({e:"no-items-text"}))},t.toDisplayString(e.computedNoMatchingItemsText),3)):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(e.filteredItems,(m,p)=>(t.openBlock(),t.createElementBlock("div",{key:p,"data-item-key":m.key},[m.header?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.$bem({e:"item-header"}))},t.toDisplayString(m.header),3)):t.createCommentVNode("",!0),m.key?(t.openBlock(),t.createElementBlock("div",t.mergeProps({key:1,class:e.itemClasses(m)},e.$ui.testElName("autocomplete-list-item"),{onClick:y=>e.handleItemClick(m)}),[t.renderSlot(e.$slots,"item",{id:m.key,text:m.text,metadata:m.metadata,isActive:e.isItemSelected(m.key)},()=>[t.createTextVNode(t.toDisplayString(m.text),1)])],16,Pt)):t.createCommentVNode("",!0),m.divider?(t.openBlock(),t.createElementBlock("div",{key:2,class:t.normalizeClass(e.$bem({e:"item-divider"}))},null,2)):t.createCommentVNode("",!0)],8,zt))),128))]),_:3},8,["loading","error","reloadable","onReload"])],16)),[[h,e.clickOutsideHandler]])]),_:3})):t.createCommentVNode("",!0)]),_:2},[e.multiple?{name:"before-text",fn:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(e.$bem({e:"selected-items"}))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.selectedItems,(m,p)=>(t.openBlock(),t.createBlock(r,{key:p,class:t.normalizeClass(e.$bem({e:"selected-item-badge"})),color:"primary",round:""},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"selected-item",{id:m.key,text:m.text,metadata:m.metadata},()=>[t.createElementVNode("div",{class:t.normalizeClass(e.$bem({e:"selected-item-badge-text"}))},t.toDisplayString(m.text),3)]),t.createVNode(a,{icon:e.$ui.icons.values.close,size:"sm",round:"",color:"primary",class:t.normalizeClass(e.$bem({e:"selected-item-remove"})),onClick:y=>e.removeItemFromSelected(m)},null,8,["icon","class","onClick"])]),_:2},1032,["class"]))),128))],2)])}:void 0]),1040,["readonly","model-value","placeholder","type","required","min","max","maxlength","step","label","width","rows","left-icon","left-icon-clickable","left-icon-color","right-icon","disabled","bordered","dark","light","rounded","rounded-lg","round","error","class","depressed","size","onEnter","onFocus","onClick","onBlur","onInput","onClickRightIcon","onKeydown"]))],16)}const Ft=f(Dt,[["render",At]]),Mt=t.defineComponent({name:"LsCard",props:{title:{type:String,default:""}}}),Fl="";function Rt(e,o,s,l,n,i){return t.openBlock(),t.createElementBlock("div",t.mergeProps({class:e.$bem({})},e.$ui.testElName("card")),[e.title?(t.openBlock(),t.createElementBlock("header",{key:0,class:t.normalizeClass(e.$bem({e:"header"}))},[t.createElementVNode("h3",{class:t.normalizeClass(e.$bem({e:"title"}))},t.toDisplayString(e.title),3)],2)):t.createCommentVNode("",!0),t.createElementVNode("main",t.mergeProps({class:e.$bem({e:"body"})},e.$ui.testElName("card-body")),[t.renderSlot(e.$slots,"default")],16),e.$slots.footer?(t.openBlock(),t.createElementBlock("footer",t.mergeProps({key:1,class:e.$bem({e:"footer"})},e.$ui.testElName("card-footer")),[t.renderSlot(e.$slots,"footer")],16)):t.createCommentVNode("",!0)],16)}const Ot=f(Mt,[["render",Rt]]),Ht=t.defineComponent({name:"LsCheckbox",components:{LsIcon:T},props:{modelValue:{type:Boolean,required:!0},id:{type:[Number,String],required:!0},label:{type:String,default:null},color:{type:String,default:"primary"},disabled:{type:Boolean,default:!1},...N,...z,...V,...oe},emits:["update:modelValue","change"],computed:{selectedValue:{get(){return this.modelValue},set(e){this.update(e)}},checkmarkClasses(){const e=this.modelValue?[`has-bg-color-${this.color}`]:[];return[...this.$bem({e:"checkmark",m:{rounded:this.rounded,unchecked:!this.modelValue,bordered:this.bordered,dark:this.dark,light:this.light,error:this.error}}),...e]}},methods:{update(e){this.$emit("update:modelValue",e),this.$emit("change",e)}}}),Ml="",Wt=["id","disabled"],qt=["for"];function jt(e,o,s,l,n,i){const a=t.resolveComponent("LsIcon");return t.openBlock(),t.createElementBlock("div",t.mergeProps({class:e.$bem({m:{disabled:e.disabled}})},e.$ui.testElName("checkbox")),[t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({id:`check_${e.id}`,ref:"checkboxRef",key:e.id,"onUpdate:modelValue":o[0]||(o[0]=r=>e.selectedValue=r),class:e.$bem({e:"input"}),type:"checkbox",disabled:e.disabled},e.$ui.testElName("checkbox-input")),null,16,Wt)),[[t.vModelCheckbox,e.selectedValue]]),t.createElementVNode("label",{class:t.normalizeClass(e.$bem({e:"label"})),for:`check_${e.id}`},[t.createElementVNode("span",{class:t.normalizeClass(e.checkmarkClasses)},[e.selectedValue?(t.openBlock(),t.createBlock(a,{key:0,name:e.$ui.icons.values.check},null,8,["name"])):t.createCommentVNode("",!0)],2),t.renderSlot(e.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(e.label),1)])],10,qt)],16)}const Ut=f(Ht,[["render",jt]]);function j(e,o=!0){function s({b:l,e:n,m:i}){const a=y=>y.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),r=e,d=l||o?a(r):r,h=i?typeof i=="string"?[i]:Array.isArray(i)?i:Object.keys(i).filter(y=>i[y]):[],m=ce(d,n),p=h.map(y=>ce(d,n,y));return[m,...p]}return s}const Kt={name:"LsProgressBar"},Re=t.defineComponent({...Kt,props:{loading:{type:Boolean,default:!1}},setup(e){const o=j("ls-progress-bar");return(s,l)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(o)({}))},[e.loading?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(o)({e:"progress"}))},null,2)):t.createCommentVNode("",!0)],2))}}),Rl="";var Z=(e=>(e.DAYS="days",e.MONTHS="months",e))(Z||{});const Gt=["data-date","onClick"],Xt={name:"LsDatepicker"},Yt=t.defineComponent({...Xt,props:{modelValue:{default:null},firstDayOfWeek:{default:1},disableBefore:{default:null},disableAfter:{default:null},rounded:{type:Boolean,default:!1},roundedLg:{type:Boolean,default:!1},round:{type:Boolean,default:!1},weekdayFormat:{default:"narrow"},highlightSaturdays:{type:Boolean,default:!1},highlightSundays:{type:Boolean,default:!1},holidays:{default:()=>[]},highlightedDates:{default:()=>[]},loading:{type:Boolean,default:!1},sixWeeks:{type:Boolean,default:!1}},emits:["select","update:model-value","select-month"],setup(e,{emit:o}){var fe,ge;const s=e,l=Ye(),n=j("ls-datepicker"),i=new Date,a=i.setHours(0,0,0,0),r=t.ref(((fe=s.modelValue)!=null?fe:i).getMonth()),d=t.ref(((ge=s.modelValue)!=null?ge:i).getFullYear()),h=t.ref(Z.DAYS),{rounded:m,roundedLg:p,round:y}=t.toRefs(s),C=(b,c)=>{const g=new Date(b);return g.setDate(g.getDate()+c),g},S=t.computed(()=>new Date(d.value,r.value,1)),I=t.computed(()=>Intl.DateTimeFormat(l.locale,{year:"numeric",month:"long"}).format(S.value)),E=t.computed(()=>(7+S.value.getDay()-s.firstDayOfWeek)%7),$=t.computed(()=>C(S.value,-E.value)),w=t.computed(()=>new Date(d.value,r.value+1,0).getDate()),L=t.computed(()=>s.sixWeeks?6:Math.ceil((w.value+E.value)/7)),_=t.computed(()=>{const b=[];for(let c=0;c<L.value;c++){const g=[];for(let B=0;B<7;B++)g.push(C($.value,c*7+B));b.push(g)}return b}),x=b=>Intl.DateTimeFormat(l.locale,{month:"long"}).format(new Date(d.value,b,1)),k=b=>Intl.DateTimeFormat(l.locale,{year:"numeric",month:"2-digit",day:"2-digit"}).format(b),D=()=>{r.value>0?r.value--:(d.value--,r.value=11),W()},M=()=>{r.value<11?r.value++:(d.value++,r.value=0),W()},ne=()=>{d.value--},ue=()=>{d.value++},pe=()=>{h.value===Z.DAYS?D():ne()},re=()=>{h.value===Z.DAYS?M():ue()},ae=()=>{h.value=Z.MONTHS},U=b=>{r.value=b,h.value=Z.DAYS,W()},Ee=b=>{const c=C($.value,b);return Intl.DateTimeFormat(l.locale,{weekday:s.weekdayFormat}).format(c)},Ne=b=>{var Je;const c=de=>de.setHours(0,0,0,0),g=c(b),B=b.getMonth()!==r.value,F=(Je=s.disableBefore&&g<s.disableBefore.setHours(0,0,0,0)||s.disableAfter&&g>s.disableAfter.setHours(0,0,0,0))!=null?Je:!1,ie=!!s.modelValue&&c(s.modelValue)===g,$e=s.holidays.map(de=>c(de)).includes(g),Sl=s.highlightedDates.map(de=>c(de)).includes(g);return[...n({e:"days-view-date",m:{today:a===g,selected:ie,"other-month":B,disabled:F,saturday:s.highlightSaturdays&&b.getDay()===6,sunday:s.highlightSundays&&b.getDay()===0,holiday:$e,highlighted:Sl}}),P(m,p,y).value]},he=b=>{o("update:model-value",b),o("select",b);const c=b.getMonth();c!==r.value&&t.nextTick(()=>{const g=b.getFullYear();r.value=c,d.value=g,W(!0)})},W=(b=!1)=>{o("select-month",{dateSelected:b,month:r.value,year:d.value,startDate:new Date($.value),endDate:C($.value,L.value*7-1)})};return t.onMounted(()=>{W()}),(b,c)=>(t.openBlock(),t.createElementBlock("div",t.mergeProps({class:t.unref(n)({})},t.unref(l).testElName("datepicker")),[t.createElementVNode("div",t.mergeProps({class:t.unref(n)({e:"controls"})},t.unref(l).testElName("datepicker-controls")),[t.createVNode(t.unref(O),t.mergeProps({icon:"chevron-left",hoverable:"",rounded:t.unref(m),"rounded-lg":t.unref(p),round:t.unref(y),class:t.unref(n)({e:"control-button"})},t.unref(l).testElName("datepicker-prev"),{onClick:pe}),null,16,["rounded","rounded-lg","round","class"]),t.createElementVNode("div",t.mergeProps({class:t.unref(n)({e:"display"})},t.unref(l).testElName("datepicker-display")),[h.value==="days"?(t.openBlock(),t.createBlock(t.unref(G),{key:0,hoverable:"",rounded:t.unref(m),"rounded-lg":t.unref(p),round:t.unref(y),block:"",class:t.normalizeClass(t.unref(n)({e:"display-button"})),onClick:ae},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(I)),1)]),_:1},8,["rounded","rounded-lg","round","class"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:1,"onUpdate:modelValue":c[0]||(c[0]=g=>d.value=g),type:"number",class:t.normalizeClass(t.unref(n)({e:"display-year"}))},null,2)),[[t.vModelText,d.value]])],16),t.createVNode(t.unref(O),t.mergeProps({icon:"chevron-right",hoverable:"",rounded:t.unref(m),"rounded-lg":t.unref(p),round:t.unref(y),class:t.unref(n)({e:"control-button"})},t.unref(l).testElName("datepicker-next"),{onClick:re}),null,16,["rounded","rounded-lg","round","class"])],16),h.value==="days"?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(n)({e:"days-view"}))},[t.createElementVNode("div",{class:t.normalizeClass(t.unref(n)({e:"days-view-header"}))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(7,(g,B)=>t.createElementVNode("div",{key:B,class:t.normalizeClass(t.unref(n)({e:"days-view-header-item"}))},t.toDisplayString(Ee(B)),3)),64))],2),t.createElementVNode("div",{class:t.normalizeClass(t.unref(n)({e:"days-view-body"}))},[t.createVNode(t.unref(Re),{loading:e.loading},null,8,["loading"]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(_),(g,B)=>(t.openBlock(),t.createElementBlock("div",{key:B,class:t.normalizeClass(t.unref(n)({e:"days-view-row"}))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g,(F,ie)=>(t.openBlock(),t.createElementBlock("div",{key:ie,class:t.normalizeClass(t.unref(n)({e:"days-view-row-item"}))},[t.createElementVNode("div",t.mergeProps({class:Ne(F)},t.unref(l).testElName("datepicker-date"),{"data-date":k(F),onClick:$e=>he(F)}),t.toDisplayString(F.getDate()),17,Gt)],2))),128))],2))),128))],2)],2)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(t.unref(n)({e:"months-view"}))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(12,(g,B)=>t.createVNode(t.unref(G),t.mergeProps({key:B,hoverable:"",rounded:t.unref(m),"rounded-lg":t.unref(p),round:t.unref(y),class:t.unref(n)({e:"months-view-month"})},t.unref(l).testElName("datepicker-month"),{onClick:F=>U(B)}),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(x(B)),1)]),_:2},1040,["rounded","rounded-lg","round","class","onClick"])),64))],2))],16))}}),Ol="",Oe=e=>{var n;const o=i=>["auto","inherit","initial","unset"].includes(i),s=["px","em","rem","%","vh","vw"],l=new RegExp(`(\\d*\\.?\\d+)(${s.join("|")})`);switch(!0){case o(e):return!0;case((n=l.exec(e))==null?void 0:n[0])===e:return!0;default:return!1}},Jt=t.defineComponent({name:"LsTile",props:{height:{type:String,default:"auto",validator:e=>Oe(e)},width:{type:String,default:"auto",validator:e=>Oe(e)},image:{type:String,default:null},color:{type:String,default:null},underlineColor:{type:String,default:null},hoverBgColor:{type:String,default:null},centerContent:{type:Boolean,default:!1},listItem:{type:Boolean,default:!1},...V,...z,...K,...N},emits:["click"],setup(e){const{dark:o,light:s,bordered:l,rounded:n,roundedLg:i,round:a,elevated:r}=t.toRefs(e);return{themeClass:A(o,s),borderedClass:R(l),elevatedClass:te(r),roundedClass:P(n,i,a)}},computed:{component(){return this.listItem?"li":"div"},classes(){return[H(this.color),Le(this.hoverBgColor),Ve(this.underlineColor),...this.$bem({m:{underlined:!!this.underlineColor,"center-content":this.centerContent}}),this.themeClass,this.borderedClass,this.elevatedClass,this.roundedClass]},styles(){return{"--tile-height":this.height,"--tile-width":this.width,"--tile-bg-image":this.image?`url(${this.image})`:"none"}}},methods:{click(){this.$emit("click")}}}),Hl="";function Zt(e,o,s,l,n,i){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.component),t.mergeProps({class:e.classes,style:e.styles},e.$ui.testElName("tile"),{onClick:e.click}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["class","style","onClick"])}const He=f(Jt,[["render",Zt]]),Qt=t.defineComponent({name:"LsFileUploader",components:{LsIcon:T,LsButton:G,LsTile:He},props:{buttonText:{type:String,default:null},buttonColor:{type:String,default:"primary"},dropAreaText:{type:String,default:""},errorText:{type:String,default:""},dropAreaTextWhenDragging:{type:String,default:""},dropAreaTextWhenDisabled:{type:String,default:""},isButtonHidden:{type:Boolean,default:!1},isDropAreaHidden:{type:Boolean,default:!1},multipleFiles:{type:Boolean,default:!1},color:{type:String,default:"default"},acceptedTypes:{type:Array,default:()=>[]},acceptedExtensions:{type:Array,default:()=>[]},maxSize:{type:Number,default:null},...V,...N,...K},emits:["upload"],data(){return{isDraggedInDropArea:!1,isDropAreaDisabled:!1}},computed:{dropAreaClasses(){return[...this.$bem({e:"drop-area",m:{disabled:this.isDropAreaDisabled}})]},buttonClasses(){return[...this.$bem({e:"upload-button"})]},btnText(){return this.buttonText||this.$ui.t().fileUploader.selectFromDisk},computedDropAreaText(){return this.isDropAreaDisabled?this.dropAreaTextWhenDisabled||this.$ui.t().fileUploader.dropAreaTextWhenDisabled:this.isDraggedInDropArea?this.dropAreaTextWhenDragging||this.$ui.t().fileUploader.dropAreaTextWhenDragging:this.dropAreaText||this.$ui.t().fileUploader.dropAreaText},uploadErrorText(){return this.errorText||this.$ui.t().fileUploader.validationError},uploadSizeFileErrorText(){return this.$ui.t().fileUploader.sizeError},acceptString(){return[...this.acceptedTypes,...this.acceptedExtensions].join(",")}},methods:{onDrop(e){this.toggleDrag(),e.dataTransfer&&this.emitFileUpload(e.dataTransfer.