UNPKG

@lekseek/ui

Version:

Vue 3 components library

1 lines 127 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");function fe(e,o,s){return`${e}${o?`__${o}`:""}${s?`--${s}`:""}`}const Je={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"}},Ze={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"}},Qe={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 se=(e=>(e.PL="pl",e.EN="en",e.UK="uk",e))(se||{});const _e={locale:se.PL,locales:{[se.PL]:Ze,[se.EN]:Je,[se.UK]:Qe},t(){return this.locales[this.locale]}},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"}}},et={test:{elAttrName:"data-test",elNamePrefix:""},testElName(e){return{[this.test.elAttrName]:`${this.test.elNamePrefix}${e}`}}},Ne={bem:{hyphenate:!0},...et,..._e,...xe},ve=Symbol("ui");function tt(e,o={}){const s=o.bem||Ne.bem;e.mixin({name:"BemMixin",methods:{$bem({b:n,e:i,m:a}){const r=y=>y.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),d=this.$options.name,p=n||s.hyphenate?r(d):d,c=a?typeof a=="string"?[a]:Array.isArray(a)?a:Object.keys(a).filter(y=>a[y]):[],m=fe(p,i),$=c.map(y=>fe(p,i,y));return[m,...$]}}});const l=t.reactive({...Ne,...o});e.config.globalProperties.$ui=l,e.provide(ve,l)}const ot=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]}}});const h=(e,o)=>{const s=e.__vccOpts||e;for(const[l,n]of o)s[l]=n;return s};function st(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 I=h(ot,[["render",st]]),lt=t.defineComponent({name:"LsSpinner",components:{LsIcon:I},props:{size:{type:String,default:"3x"}}});function nt(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 re=h(lt,[["render",nt]]),Z=(e,o)=>o?`has-${e}-${o}`:null,ge=e=>Z("color",e),O=e=>Z("bg-color",e),rt=e=>Z("hover-color",e),Ie=e=>Z("hover-bg-color",e),Te=e=>Z("border-color",e),at=e=>Z("gradient",e),De="is-elevated",be="is-hoverable",D={bordered:{type:Boolean,default:!1}};function M(e){return t.computed(()=>({"is-bordered":e.value}))}const U={elevated:{type:Boolean,default:!1}};function ae(e){return t.computed(()=>({"is-elevated":e.value}))}const Be={depressed:{type:Boolean,default:!1}};function ze(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 z(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 L={dark:{type:Boolean,default:!1},light:{type:Boolean,default:!1}};function P(e,o){return t.computed(()=>({"is-dark":e.value,"is-light":o.value}))}const Pe={to:{type:[Object,String],default:null},href:{type:String,default:null},newWindow:{type:Boolean,default:!1}};function Ae(e,o,s){return{component:t.computed(()=>e.value?"RouterLink":o.value?"a":"span"),target:t.computed(()=>s.value?"_blank":"_self")}}const ie={error:{type:Boolean,default:!1}};function Fe(e){return{validationBorderClass:t.computed(()=>({"is-bordered":e.value,"has-border-color-error":e.value}))}}const it={padding:{type:String,default:null}};function dt(e){return t.computed(()=>({[`has-padding-${e.value}`]:e.value}))}const Q={size:{type:String,default:"md"}},ut=t.defineComponent({name:"LsButton",components:{LsSpinner:re,LsIcon:I},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},...L,...D,...N,...Pe,...U,...Q},setup(e){const{dark:o,light:s,bordered:l,rounded:n,roundedLg:i,round:a,to:r,href:d,newWindow:p,elevated:c}=t.toRefs(e),{component:m,target:$}=Ae(r,d,p);return{themeClass:P(o,s),borderedClass:M(l),roundedClass:z(n,i,a),elevatedClass:ae(c),component:m,target:$}},data(){return{isFocused:!1}},computed:{classes(){let e=[];return this.color&&this.color!=="default"&&(this.plain?e=[ge(this.color),rt(`${this.color}-darken-1`)]:e=[O(this.color),Ie(`${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}}),{[be]:this.hoverable},this.themeClass,this.borderedClass,this.roundedClass,this.elevatedClass]}}});const ct=["title","disabled"];function mt(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,ct)}const j=h(ut,[["render",mt]]),pt=t.defineComponent({name:"LsAsyncContent",components:{LsSpinner:re,LsIcon:I,LsButton:j},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")}}});const ht={key:0};function ft(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",ht,[t.renderSlot(e.$slots,"default")])):t.createCommentVNode("",!0)]),_:3})],16)}const Me=h(pt,[["render",ft]]),gt=t.defineComponent({name:"LsInput",components:{LsIcon:I},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},...L,...D,...N,...ie,...Be,...Q},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:p}=Fe(r);return{themeClass:P(o,s),borderedClass:M(l),roundedClass:z(n,i,a),depressedClass:ze(d),validationBorderClass:p}},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}}),{[De]: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()}}});const $t=["autofocus","type","min","max","maxlength","required","step","value","readonly","placeholder","disabled"];function yt(e,o,s,l,n,i){var r,d,p;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]=(...c)=>e.onLeftIconClick&&e.onLeftIconClick(...c))}),[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:(p=e.maxlength)!=null?p: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]=(...c)=>e.onInput&&e.onInput(...c)),onFocus:o[2]||(o[2]=(...c)=>e.onFocus&&e.onFocus(...c)),onBlur:o[3]||(o[3]=(...c)=>e.onBlur&&e.onBlur(...c)),onKeydown:o[4]||(o[4]=t.withKeys((...c)=>e.enter&&e.enter(...c),["enter"])),onClick:o[5]||(o[5]=c=>e.$emit("click")),onMouseenter:o[6]||(o[6]=c=>e.$emit("mouseenter")),onMouseleave:o[7]||(o[7]=c=>e.$emit("mouseleave"))}),null,16,$t),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]=(...c)=>e.onRightIconClick&&e.onRightIconClick(...c))}),[t.createVNode(a,{name:e.rightIcon,color:e.rightIconColor},null,8,["name","color"])],16)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"after")],16)}const W=h(gt,[["render",yt]]),Ct=t.defineComponent({name:"LsTextarea",components:{LsIcon:I},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},...L,...D,...N,...ie,...Be,...Q},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:p}=Fe(r);return{themeClass:P(o,s),borderedClass:M(l),roundedClass:z(n,i,a),depressedClass:ze(d),validationBorderClass:p}},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}}),{[De]: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()}}});const vt=["readonly","autofocus","rows","required","value","placeholder","maxlength","disabled"];function kt(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,vt),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 ke=h(Ct,[["render",kt]]),bt=t.defineComponent({name:"LsBadge",props:{color:{type:String,default:null},disabled:{type:Boolean,default:!1},size:{type:String,default:"md"},...L,...D,...U,...N},emits:["click"],setup(e){const{dark:o,light:s,bordered:l,rounded:n,roundedLg:i,elevated:a}=t.toRefs(e);return{themeClass:P(o,s),borderedClass:M(l),elevatedClass:ae(a),roundedClass:z(n,i)}},computed:{classes(){return[...this.color?[O(this.color),ge("white")]:[],...this.$bem({m:{[this.size]:!0,disabled:this.disabled,round:this.round}}),this.themeClass,this.borderedClass,this.elevatedClass,this.roundedClass]}}});const Bt=["disabled"];function St(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 Se=h(bt,[["render",St]]),Et=t.defineComponent({name:"LsIconButton",components:{LsButton:j,LsIcon:I},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},...D,...L,...N,...Q},computed:{classes(){const e=[this.size];return this.$bem({m:e})}}});function Nt(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 F=h(Et,[["render",Nt]]),ne="__v-click-outside",wt=typeof window<"u",Lt=typeof navigator<"u",Vt=wt&&("ontouchstart"in window||Lt&&navigator.msMaxTouchPoints>0),It=Vt?["touchstart"]:["click"];function Tt(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||It,isActive:e.isActive!==!1}}function Dt({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 Re(e,{value:o}){const{events:s,handler:l,middleware:n,isActive:i}=Tt(o);!i||(e[ne]=s.map(a=>({event:a,handler:r=>Dt({event:r,el:e,handler:l,middleware:n})})),e[ne].forEach(({event:a,handler:r})=>setTimeout(()=>{!e[ne]||document.documentElement.addEventListener(a,r,!1)},0)))}function Oe(e){(e[ne]||[]).forEach(({event:s,handler:l})=>document.documentElement.removeEventListener(s,l,!1)),delete e[ne]}function zt(e,{value:o,oldValue:s}){JSON.stringify(o)!==JSON.stringify(s)&&(Oe(e),Re(e,{value:o}))}const K={beforeMount:Re,updated:zt,unmounted:Oe},Pt=t.defineComponent({name:"LsAutocomplete",components:{LsInput:W,LsTextarea:ke,LsAsyncContent:Me,LsBadge:Se,LsIconButton:F},directives:{ClickOutside:K},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},...L,...D,...N,...ie,...Be,...Q},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:P(o,s),borderedClass:M(l),roundedClass:z(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?ke:W},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)}}),be]},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})}}});const At=["data-item-key"],Ft=["onClick"];function Mt(e,o,s,l,n,i){const a=t.resolveComponent("LsIconButton"),r=t.resolveComponent("LsBadge"),d=t.resolveComponent("LsAsyncContent"),p=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]=c=>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(c=>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,(c,m)=>(t.openBlock(),t.createElementBlock("div",{key:m,"data-item-key":c.key},[c.header?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.$bem({e:"item-header"}))},t.toDisplayString(c.header),3)):t.createCommentVNode("",!0),c.key?(t.openBlock(),t.createElementBlock("div",t.mergeProps({key:1,class:e.itemClasses(c)},e.$ui.testElName("autocomplete-list-item"),{onClick:$=>e.handleItemClick(c)}),[t.renderSlot(e.$slots,"item",{id:c.key,text:c.text,metadata:c.metadata,isActive:e.isItemSelected(c.key)},()=>[t.createTextVNode(t.toDisplayString(c.text),1)])],16,Ft)):t.createCommentVNode("",!0),c.divider?(t.openBlock(),t.createElementBlock("div",{key:2,class:t.normalizeClass(e.$bem({e:"item-divider"}))},null,2)):t.createCommentVNode("",!0)],8,At))),128))]),_:3},8,["loading","error","reloadable","onReload"])],16)),[[p,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,(c,m)=>(t.openBlock(),t.createBlock(r,{key:m,class:t.normalizeClass(e.$bem({e:"selected-item-badge"})),color:"primary",round:""},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"selected-item",{id:c.key,text:c.text,metadata:c.metadata},()=>[t.createElementVNode("div",{class:t.normalizeClass(e.$bem({e:"selected-item-badge-text"}))},t.toDisplayString(c.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:$=>e.removeItemFromSelected(c)},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 Rt=h(Pt,[["render",Mt]]),Ot=t.defineComponent({name:"LsCard",props:{title:{type:String,default:""}}});function Ht(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 Wt=h(Ot,[["render",Ht]]),qt=t.defineComponent({name:"LsCheckbox",components:{LsIcon:I},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,...D,...L,...ie},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)}}});const jt=["id","disabled"],Ut=["for"];function Kt(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,jt)),[[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,Ut)],16)}const Gt=h(qt,[["render",Kt]]);function q(e,o=!0){function s({b:l,e:n,m:i}){const a=$=>$.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,p=i?typeof i=="string"?[i]:Array.isArray(i)?i:Object.keys(i).filter($=>i[$]):[],c=fe(d,n),m=p.map($=>fe(d,n,$));return[c,...m]}return s}const Xt={name:"LsProgressBar"},He=t.defineComponent({...Xt,props:{loading:{type:Boolean,default:!1}},setup(e){const o=q("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))}});var J=(e=>(e.DAYS="days",e.MONTHS="months",e))(J||{});const Yt=["data-date","onClick"],Jt={name:"LsDatepicker"},Zt=t.defineComponent({...Jt,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 me,pe;const s=e,l=Xe(),n=q("ls-datepicker"),i=new Date,a=i.setHours(0,0,0,0),r=t.ref(((me=s.modelValue)!=null?me:i).getMonth()),d=t.ref(((pe=s.modelValue)!=null?pe:i).getFullYear()),p=t.ref(J.DAYS),{rounded:c,roundedLg:m,round:$}=t.toRefs(s),y=(v,u)=>{const f=new Date(v);return f.setDate(f.getDate()+u),f},b=t.computed(()=>new Date(d.value,r.value,1)),w=t.computed(()=>Intl.DateTimeFormat(l.locale,{year:"numeric",month:"long"}).format(b.value)),B=t.computed(()=>(7+b.value.getDay()-s.firstDayOfWeek)%7),g=t.computed(()=>y(b.value,-B.value)),S=t.computed(()=>new Date(d.value,r.value+1,0).getDate()),E=t.computed(()=>s.sixWeeks?6:Math.ceil((S.value+B.value)/7)),G=t.computed(()=>{const v=[];for(let u=0;u<E.value;u++){const f=[];for(let k=0;k<7;k++)f.push(y(g.value,u*7+k));v.push(f)}return v}),X=v=>Intl.DateTimeFormat(l.locale,{month:"long"}).format(new Date(d.value,v,1)),C=v=>Intl.DateTimeFormat(l.locale,{year:"numeric",month:"2-digit",day:"2-digit"}).format(v),V=()=>{r.value>0?r.value--:(d.value--,r.value=11),R()},A=()=>{r.value<11?r.value++:(d.value++,r.value=0),R()},_=()=>{d.value--},de=()=>{d.value++},ue=()=>{p.value===J.DAYS?V():_()},x=()=>{p.value===J.DAYS?A():de()},ee=()=>{p.value=J.MONTHS},H=v=>{r.value=v,p.value=J.DAYS,R()},$e=v=>{const u=y(g.value,v);return Intl.DateTimeFormat(l.locale,{weekday:s.weekdayFormat}).format(u)},ye=v=>{var Ee;const u=oe=>oe.setHours(0,0,0,0),f=u(v),k=v.getMonth()!==r.value,T=(Ee=s.disableBefore&&f<s.disableBefore.setHours(0,0,0,0)||s.disableAfter&&f>s.disableAfter.setHours(0,0,0,0))!=null?Ee:!1,te=!!s.modelValue&&u(s.modelValue)===f,he=s.holidays.map(oe=>u(oe)).includes(f),Ye=s.highlightedDates.map(oe=>u(oe)).includes(f);return[...n({e:"days-view-date",m:{today:a===f,selected:te,"other-month":k,disabled:T,saturday:s.highlightSaturdays&&v.getDay()===6,sunday:s.highlightSundays&&v.getDay()===0,holiday:he,highlighted:Ye}}),z(c,m,$).value]},ce=v=>{o("update:model-value",v),o("select",v);const u=v.getMonth();u!==r.value&&t.nextTick(()=>{const f=v.getFullYear();r.value=u,d.value=f,R(!0)})},R=(v=!1)=>{o("select-month",{dateSelected:v,month:r.value,year:d.value,startDate:new Date(g.value),endDate:y(g.value,E.value*7-1)})};return t.onMounted(()=>{R()}),(v,u)=>(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(F),t.mergeProps({icon:"chevron-left",hoverable:"",rounded:t.unref(c),"rounded-lg":t.unref(m),round:t.unref($),class:t.unref(n)({e:"control-button"})},t.unref(l).testElName("datepicker-prev"),{onClick:ue}),null,16,["rounded","rounded-lg","round","class"]),t.createElementVNode("div",t.mergeProps({class:t.unref(n)({e:"display"})},t.unref(l).testElName("datepicker-display")),[p.value==="days"?(t.openBlock(),t.createBlock(t.unref(j),{key:0,hoverable:"",rounded:t.unref(c),"rounded-lg":t.unref(m),round:t.unref($),block:"",class:t.normalizeClass(t.unref(n)({e:"display-button"})),onClick:ee},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(w)),1)]),_:1},8,["rounded","rounded-lg","round","class"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:1,"onUpdate:modelValue":u[0]||(u[0]=f=>d.value=f),type:"number",class:t.normalizeClass(t.unref(n)({e:"display-year"}))},null,2)),[[t.vModelText,d.value]])],16),t.createVNode(t.unref(F),t.mergeProps({icon:"chevron-right",hoverable:"",rounded:t.unref(c),"rounded-lg":t.unref(m),round:t.unref($),class:t.unref(n)({e:"control-button"})},t.unref(l).testElName("datepicker-next"),{onClick:x}),null,16,["rounded","rounded-lg","round","class"])],16),p.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,(f,k)=>t.createElementVNode("div",{key:k,class:t.normalizeClass(t.unref(n)({e:"days-view-header-item"}))},t.toDisplayString($e(k)),3)),64))],2),t.createElementVNode("div",{class:t.normalizeClass(t.unref(n)({e:"days-view-body"}))},[t.createVNode(t.unref(He),{loading:e.loading},null,8,["loading"]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(G),(f,k)=>(t.openBlock(),t.createElementBlock("div",{key:k,class:t.normalizeClass(t.unref(n)({e:"days-view-row"}))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f,(T,te)=>(t.openBlock(),t.createElementBlock("div",{key:te,class:t.normalizeClass(t.unref(n)({e:"days-view-row-item"}))},[t.createElementVNode("div",t.mergeProps({class:ye(T)},t.unref(l).testElName("datepicker-date"),{"data-date":C(T),onClick:he=>ce(T)}),t.toDisplayString(T.getDate()),17,Yt)],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,(f,k)=>t.createVNode(t.unref(j),t.mergeProps({key:k,hoverable:"",rounded:t.unref(c),"rounded-lg":t.unref(m),round:t.unref($),class:t.unref(n)({e:"months-view-month"})},t.unref(l).testElName("datepicker-month"),{onClick:T=>H(k)}),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(X(k)),1)]),_:2},1040,["rounded","rounded-lg","round","class","onClick"])),64))],2))],16))}});const we=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}},Qt=t.defineComponent({name:"LsTile",props:{height:{type:String,default:"auto",validator:e=>we(e)},width:{type:String,default:"auto",validator:e=>we(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},...L,...D,...U,...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:P(o,s),borderedClass:M(l),elevatedClass:ae(r),roundedClass:z(n,i,a)}},computed:{component(){return this.listItem?"li":"div"},classes(){return[O(this.color),Ie(this.hoverBgColor),Te(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")}}});function _t(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 We=h(Qt,[["render",_t]]),xt=t.defineComponent({name:"LsFileUploader",components:{LsIcon:I,LsButton:j,LsTile:We},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},...L,...N,...U},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.files)},toggleDrag(){this.isDraggedInDropArea=!this.isDraggedInDropArea},validateFiles(e){let o=0;for(const s of e){const n=`.${s.n