buefy
Version:
Lightweight UI components for Vue.js (v3) based on Bulma
2 lines • 71.1 kB
JavaScript
/*! Buefy v3.0.2 | MIT License | github.com/buefy/buefy */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Table={},e.Vue)}(this,(function(e,t){"use strict";function o(e,t){return t.split(".").reduce(((e,t)=>e?e[t]:null),e)}function i(e,t,o){if(!e)return-1;if(!o||"function"!=typeof o)return e.indexOf(t);for(let i=0;i<e.length;i++)if(o(e[i],t))return i;return-1}function n(e){void 0!==e.remove?e.remove():void 0!==e.parentNode&&null!==e.parentNode&&e.parentNode.removeChild(e)}function l(e){return e?e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):e}function a(e){return e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function s(e,t){return JSON.parse(JSON.stringify(e)).sort((i=t,(e,t)=>i.map((i=>{const{field:n,order:l,customSort:a}=i;if("function"==typeof a)return a(e,t,"desc"!==l);{const i=o(e,n),a=o(t,n),s=i>a?1:i<a?-1:0;return"desc"===l?-s:s}})).reduce(((e,t)=>e||t),0)));var i}function r(e){return void 0===e?null:isNaN(+e)?`${e}`:e+"px"}const c=e=>null==e;const u=(e,t)=>{const{type:o,target:i}=t;let n=0,l=0;if(null!=i&&i!==e.target){const t=e.target.getBoundingClientRect(),o=i.getBoundingClientRect();n=o.left-t.left,l=o.top-t.top}const a=e.touches[0]||e.changedTouches[0];return new DragEvent(o,{dataTransfer:new DataTransfer,bubbles:!0,screenX:a.screenX,screenY:a.screenY,clientX:a.clientX+n,clientY:a.clientY+l,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey})};function d(e,t,o){let i;return function(...o){const n=this;clearTimeout(i),i=setTimeout((function(){i=void 0,e.apply(n,o)}),t)}}let h={defaultIconPack:"mdi",defaultIconComponent:null,defaultIconPrev:"chevron-left",defaultIconNext:"chevron-right",defaultLocale:void 0,defaultInputAutocomplete:"on",defaultInputHasCounter:!0,defaultCompatFallthrough:!0,defaultUseHtml5Validation:!0,defaultStatusIcon:!0,defaultLinkTags:["a","button","input","router-link","nuxt-link","n-link","RouterLink","NuxtLink","NLink"]};var p=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,f=t.defineComponent({inheritAttrs:!1,props:{compatFallthrough:{type:Boolean,default:()=>h.defaultCompatFallthrough}},computed:{rootAttrs(){return this.compatFallthrough?{class:this.$attrs.class,style:this.$attrs.style,id:this.$attrs.id}:{}},fallthroughAttrs(){if(this.compatFallthrough){const e=this.$attrs,{style:t,class:o,id:i}=e;return((e,t)=>{var o={};for(var i in e)m.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&p)for(var i of p(e))t.indexOf(i)<0&&g.call(e,i)&&(o[i]=e[i]);return o})(e,["style","class","id"])}return this.$attrs}}}),b=t.defineComponent({props:{modelValue:[String,Number,Boolean,Function,Object,Array],nativeValue:[String,Number,Boolean,Function,Object,Array],type:String,disabled:Boolean,required:Boolean,name:String,size:String},emits:{"update:modelValue":e=>!0},data(){return{newValue:this.modelValue}},computed:{computedValue:{get(){return this.newValue},set(e){this.newValue=e,this.$emit("update:modelValue",e)}},disabledOrUndefined(){return this.disabled||void 0},requiredOrUndefined(){return this.required||void 0}},watch:{modelValue(e){this.newValue=e}},methods:{focus(){this.$refs.input.focus()}}}),k=t.defineComponent({name:"BCheckbox",mixins:[b],props:{indeterminate:Boolean,ariaLabelledby:String,trueValue:{type:[String,Number,Boolean,Function,Object,Array],default:!0},falseValue:{type:[String,Number,Boolean,Function,Object,Array],default:!1},autocomplete:{type:String,default:"on"},inputId:{type:String,default:""}}}),C=(e,t)=>{const o=e.__vccOpts||e;for(const[e,i]of t)o[e]=i;return o};const y=["disabled"],v=["id",".indeterminate","autocomplete","disabled","required","name","value","true-value","false-value","aria-labelledby"],w=["id"];var S=C(k,[["render",function(e,o,i,n,l,a){return t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(["b-checkbox checkbox",[e.size,{"is-disabled":e.disabled}]]),ref:"label",disabled:e.disabledOrUndefined,onClick:o[2]||(o[2]=(...t)=>e.focus&&e.focus(...t)),onKeydown:[o[3]||(o[3]=t.withKeys(t.withModifiers((t=>e.$refs.label.click()),["prevent"]),["enter"])),o[4]||(o[4]=t.withKeys(t.withModifiers((t=>e.$refs.label.click()),["prevent"]),["space"]))]},[t.createCommentVNode(" Checkbox needs to listen for a space event instead of a just a\n click and enter event so that that using the keyboard spacebar will also\n trigger the checkbox change in the b-table "),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=t=>e.computedValue=t),id:e.inputId,".indeterminate":e.indeterminate,type:"checkbox",ref:"input",onClick:o[1]||(o[1]=t.withModifiers((()=>{}),["stop"])),autocomplete:e.autocomplete,disabled:e.disabledOrUndefined,required:e.requiredOrUndefined,name:e.name,value:e.nativeValue,"true-value":e.trueValue,"false-value":e.falseValue,"aria-labelledby":e.ariaLabelledby},null,40,v),[[t.vModelCheckbox,e.computedValue]]),t.createElementVNode("span",{class:t.normalizeClass(["check",e.type])},null,2),t.createElementVNode("span",{id:e.ariaLabelledby,class:"control-label"},[t.renderSlot(e.$slots,"default")],8,w)],42,y)}]]);const B={sizes:{default:"mdi-24px","is-small":null,"is-medium":"mdi-36px","is-large":"mdi-48px"},iconPrefix:"mdi-"},D=()=>{const e="fa-";return{sizes:{default:null,"is-small":null,"is-medium":e+"lg","is-large":e+"2x"},iconPrefix:e,internalIcons:{information:"info-circle",alert:"exclamation-triangle","alert-circle":"exclamation-circle","chevron-right":"angle-right","chevron-left":"angle-left","chevron-down":"angle-down","eye-off":"eye-slash","menu-down":"caret-down","menu-up":"caret-up","close-circle":"times-circle"}}};var V=C(t.defineComponent({name:"BIcon",props:{type:[String,Object],component:String,pack:String,icon:{type:String,required:!0},size:String,customSize:String,customClass:String,both:Boolean},computed:{iconConfig(){return{mdi:B,fa:D(),fas:D(),far:D(),fad:D(),fab:D(),fal:D(),"fa-solid":D(),"fa-regular":D(),"fa-light":D(),"fa-thin":D(),"fa-duotone":D(),"fa-brands":D()}[this.newPack]},iconPrefix(){return this.iconConfig&&this.iconConfig.iconPrefix?this.iconConfig.iconPrefix:""},newIcon(){return`${this.iconPrefix}${this.getEquivalentIconOf(this.icon)}`},newPack(){return this.pack||h.defaultIconPack},newType(){if(!this.type)return;let e=[];if("string"==typeof this.type)e=this.type.split("-");else for(const t in this.type)if(this.type[t]){e=t.split("-");break}if(e.length<=1)return;const[,...t]=e;return`has-text-${t.join("-")}`},newCustomSize(){return this.customSize||this.customSizeByPack},customSizeByPack(){if(this.iconConfig&&this.iconConfig.sizes){if(this.size&&void 0!==this.iconConfig.sizes[this.size])return this.iconConfig.sizes[this.size];if(this.iconConfig.sizes.default)return this.iconConfig.sizes.default}return null},useIconComponent(){return this.component||h.defaultIconComponent}},methods:{getEquivalentIconOf(e){if(!this.both)return e;if(null==this.iconConfig)return e;const t=this.iconConfig;return t&&t.internalIcons&&t.internalIcons[e]?t.internalIcons[e]:e}}}),[["render",function(e,o,i,n,l,a){return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["icon",[e.newType,e.size]])},[e.useIconComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.useIconComponent),{key:1,icon:[e.newPack,e.newIcon],size:e.newCustomSize,class:t.normalizeClass([e.customClass])},null,8,["icon","size","class"])):(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass([e.newPack,e.newIcon,e.newCustomSize,e.customClass])},null,2))],2)}]]);const P=t.defineComponent({props:{size:String,expanded:Boolean,loading:Boolean,rounded:Boolean,icon:String,iconPack:String,maxlength:[Number,String],useHtml5Validation:{type:Boolean,default:()=>h.defaultUseHtml5Validation},validationMessage:String,locale:{type:[String,Array],default:()=>h.defaultLocale},statusIcon:{type:Boolean,default:()=>h.defaultStatusIcon}},emits:{blur:e=>!0,focus:e=>!0},data(){return{isValid:!0,isFocused:!1,newIconPack:this.iconPack||h.defaultIconPack,_elementRef:""}},computed:{parentField(){let e=this.$parent;for(let t=0;t<3;t++)e&&!e.$data._isField&&(e=e.$parent);return e},statusType(){const{newType:e}=this.parentField||{};if(e){if("string"==typeof e)return e;for(const t in e)if(e[t])return t}},statusMessage(){if(this.parentField)return this.parentField.newMessage||this.parentField.$slots.message},iconSize(){switch(this.size){case"is-small":return this.size;case"is-medium":return;case"is-large":return"mdi"===this.newIconPack?"is-medium":""}}},methods:{focus(){const e=this.getElement();void 0!==e&&this.$nextTick((()=>{e&&e.focus()}))},onBlur(e){this.isFocused=!1,this.$emit("blur",e),this.checkHtml5Validity()},onFocus(e){this.isFocused=!0,this.$emit("focus",e)},getElement(){let e=this.$refs[this.$data._elementRef];for(;null!=e&&"object"==typeof e&&"$refs"in e;){const t=e;e=t.$refs[t.$data._elementRef]}return e},setInvalid(){const e=this.validationMessage||this.getElement().validationMessage;this.setValidity("is-danger",e)},setValidity(e,t){this.$nextTick((()=>{this.parentField&&(this.parentField.type||(this.parentField.newType=e),this.parentField.message||(this.parentField.newMessage=t))}))},checkHtml5Validity(){if(!this.useHtml5Validation)return!1;const e=this.getElement();return null!=e&&(e.checkValidity()?(this.setValidity(null,null),this.isValid=!0):(this.setInvalid(),this.isValid=!1),this.isValid)}}});var x=t.defineComponent({name:"BInput",components:{BIcon:V},mixins:[f,P],props:{modelValue:{type:[Number,String]},type:{type:String,default:"text"},lazy:{type:Boolean,default:!1},passwordReveal:Boolean,iconClickable:Boolean,hasCounter:{type:Boolean,default:()=>h.defaultInputHasCounter},customClass:{type:String,default:""},iconRight:String,iconRightClickable:Boolean,iconRightType:String,autocomplete:String},emits:{"icon-click":e=>!0,"icon-right-click":e=>!0,"update:modelValue":e=>!0},data(){return{newValue:this.modelValue,newType:this.type,newAutocomplete:this.autocomplete||h.defaultInputAutocomplete,isPasswordVisible:!1,_elementRef:"textarea"===this.type?"textarea":"input"}},computed:{computedValue:{get(){return this.newValue},set(e){this.newValue=e,this.$emit("update:modelValue",e)}},rootClasses(){return[this.iconPosition,this.size,{"is-expanded":this.expanded,"is-loading":this.loading,"is-clearfix":!this.hasMessage}]},inputClasses(){return[this.statusType,this.size,{"is-rounded":this.rounded}]},hasIconRight(){return this.passwordReveal||this.loading||this.statusIcon&&this.statusTypeIcon||this.iconRight},rightIcon(){return this.passwordReveal?this.passwordVisibleIcon:this.iconRight?this.iconRight:this.statusTypeIcon},rightIconType(){return this.passwordReveal?"is-primary":this.iconRight?this.iconRightType||void 0:this.statusType},iconPosition(){let e="";return this.icon&&(e+="has-icons-left "),this.hasIconRight&&(e+="has-icons-right"),e},statusTypeIcon(){switch(this.statusType){case"is-success":return"check";case"is-danger":return"alert-circle";case"is-info":return"information";case"is-warning":return"alert";default:return}},hasMessage(){return!!this.statusMessage},passwordVisibleIcon(){return this.isPasswordVisible?"eye-off":"eye"},valueLength(){return"string"==typeof this.computedValue?Array.from(this.computedValue).length:"number"==typeof this.computedValue?this.computedValue.toString().length:0}},watch:{modelValue(e){const t=this.computedValue!=e;this.newValue=e,t&&this.$nextTick((()=>{!this.isValid&&this.checkHtml5Validity()}))},type(e){this.newType=e}},methods:{togglePasswordVisibility(){this.isPasswordVisible=!this.isPasswordVisible,this.newType=this.isPasswordVisible?"text":"password",this.$nextTick((()=>{this.focus()}))},iconClick(e,t){this.$emit(e,t),this.$nextTick((()=>{this.focus()}))},rightIconClick(e){this.passwordReveal?this.togglePasswordVisibility():this.iconRightClickable&&this.iconClick("icon-right-click",e)},onInput(){this.lazy||this.revalidate()},onChange(){this.lazy&&this.revalidate()},revalidate(){!this.isValid&&this.checkHtml5Validity()}}});const I=["type","autocomplete","maxlength"],R=["maxlength"],E=["type","autocomplete","maxlength"],N=["maxlength"];var $=C(x,[["render",function(e,o,i,n,l,a){const s=t.resolveComponent("b-icon");return t.openBlock(),t.createElementBlock("div",t.mergeProps({class:["control",e.rootClasses]},e.rootAttrs),[e.lazy?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},["textarea"!==e.type?t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:0,ref:"input",class:["input",[e.inputClasses,e.customClass]],type:e.newType,autocomplete:e.newAutocomplete,maxlength:e.maxlength,"onUpdate:modelValue":o[0]||(o[0]=t=>e.computedValue=t)},e.fallthroughAttrs,{onInput:o[1]||(o[1]=(...t)=>e.onInput&&e.onInput(...t)),onChange:o[2]||(o[2]=(...t)=>e.onChange&&e.onChange(...t)),onBlur:o[3]||(o[3]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:o[4]||(o[4]=(...t)=>e.onFocus&&e.onFocus(...t))}),null,16,I)),[[t.vModelDynamic,e.computedValue,void 0,{lazy:!0}]]):t.withDirectives((t.openBlock(),t.createElementBlock("textarea",t.mergeProps({key:1,ref:"textarea",class:["textarea",[e.inputClasses,e.customClass]],maxlength:e.maxlength,"onUpdate:modelValue":o[5]||(o[5]=t=>e.computedValue=t)},e.fallthroughAttrs,{onInput:o[6]||(o[6]=(...t)=>e.onInput&&e.onInput(...t)),onChange:o[7]||(o[7]=(...t)=>e.onChange&&e.onChange(...t)),onBlur:o[8]||(o[8]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:o[9]||(o[9]=(...t)=>e.onFocus&&e.onFocus(...t))}),null,16,R)),[[t.vModelText,e.computedValue,void 0,{lazy:!0}]])],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},["textarea"!==e.type?t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:0,ref:"input",class:["input",[e.inputClasses,e.customClass]],type:e.newType,autocomplete:e.newAutocomplete,maxlength:e.maxlength,"onUpdate:modelValue":o[10]||(o[10]=t=>e.computedValue=t)},e.fallthroughAttrs,{onInput:o[11]||(o[11]=(...t)=>e.onInput&&e.onInput(...t)),onChange:o[12]||(o[12]=(...t)=>e.onChange&&e.onChange(...t)),onBlur:o[13]||(o[13]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:o[14]||(o[14]=(...t)=>e.onFocus&&e.onFocus(...t))}),null,16,E)),[[t.vModelDynamic,e.computedValue]]):t.withDirectives((t.openBlock(),t.createElementBlock("textarea",t.mergeProps({key:1,ref:"textarea",class:["textarea",[e.inputClasses,e.customClass]],maxlength:e.maxlength,"onUpdate:modelValue":o[15]||(o[15]=t=>e.computedValue=t)},e.fallthroughAttrs,{onInput:o[16]||(o[16]=(...t)=>e.onInput&&e.onInput(...t)),onChange:o[17]||(o[17]=(...t)=>e.onChange&&e.onChange(...t)),onBlur:o[18]||(o[18]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:o[19]||(o[19]=(...t)=>e.onFocus&&e.onFocus(...t))}),null,16,N)),[[t.vModelText,e.computedValue]])],64)),e.icon?(t.openBlock(),t.createBlock(s,{key:2,class:t.normalizeClass(["is-left",{"is-clickable":e.iconClickable}]),icon:e.icon,pack:e.iconPack,size:e.iconSize,onClick:o[20]||(o[20]=t=>e.iconClick("icon-click",t))},null,8,["class","icon","pack","size"])):t.createCommentVNode("v-if",!0),!e.loading&&e.hasIconRight&&e.rightIcon?(t.openBlock(),t.createBlock(s,{key:3,class:t.normalizeClass(["is-right",{"is-clickable":e.passwordReveal||e.iconRightClickable}]),icon:e.rightIcon,pack:e.iconPack,size:e.iconSize,type:e.rightIconType,both:"",onClick:e.rightIconClick},null,8,["class","icon","pack","size","type","onClick"])):t.createCommentVNode("v-if",!0),e.maxlength&&e.hasCounter&&"number"!==e.type?(t.openBlock(),t.createElementBlock("small",{key:4,class:t.normalizeClass(["help counter",{"is-invisible":!e.isFocused}])},t.toDisplayString(e.valueLength)+" / "+t.toDisplayString(e.maxlength),3)):t.createCommentVNode("v-if",!0)],16)}]]);const T="undefined"==typeof window?Object:window.HTMLElement,M=t.defineComponent({name:"BLoading",props:{modelValue:Boolean,programmatic:Boolean,container:[Object,Function,T],isFullPage:{type:Boolean,default:!0},animation:{type:String,default:"fade"},canCancel:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}}},emits:{close:()=>!0,"update:is-full-page":e=>!0,"update:modelValue":e=>!0},data(){return{isActive:this.modelValue||!1,displayInFullPage:this.isFullPage}},watch:{modelValue(e){this.isActive=e},isFullPage(e){this.displayInFullPage=e}},methods:{cancel(){this.canCancel&&this.isActive&&this.close()},close(...e){this.onCancel.apply(null,e),this.$emit("close"),this.$emit("update:modelValue",!1),this.programmatic&&(this.isActive=!1,setTimeout((()=>{n(this.$el)}),150))},keyPress({key:e}){"Escape"!==e&&"Esc"!==e||this.cancel()}},created(){"undefined"!=typeof window&&document.addEventListener("keyup",this.keyPress)},mounted(){this.programmatic&&(this.container?(this.displayInFullPage=!1,this.$emit("update:is-full-page",!1),this.container.appendChild(this.$el)):document.body.appendChild(this.$el),this.isActive=!0)},beforeUnmount(){"undefined"!=typeof window&&document.removeEventListener("keyup",this.keyPress)}}),A=t.createElementVNode("div",{class:"loading-icon"},null,-1);var z=C(M,[["render",function(e,o,i,n,l,a){return t.openBlock(),t.createBlock(t.Transition,{name:e.animation},{default:t.withCtx((()=>[e.isActive?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["loading-overlay is-active",{"is-full-page":e.displayInFullPage}])},[t.createElementVNode("div",{class:"loading-background",onClick:o[0]||(o[0]=(...t)=>e.cancel&&e.cancel(...t))}),t.renderSlot(e.$slots,"default",{},(()=>[A]))],2)),[[t.vShow,e.isActive]]):t.createCommentVNode("v-if",!0)])),_:3},8,["name"])}]]),F=t.defineComponent({name:"BSlotComponent",props:{component:{type:Object,required:!0},name:{type:String,default:"default"},scoped:{type:Boolean},props:{type:Object},tag:{type:[String,Object],default:"div"}},methods:{refresh(){this.$forceUpdate()}},render(){return t.h(this.tag,{},this.component.$slots?this.scoped?this.component.$slots[this.name](this.props):this.component.$slots[this.name]():void 0)}}),L=t.defineComponent({name:"BSelect",components:{BIcon:V},mixins:[f,P],props:{modelValue:{type:[String,Number,Boolean,Object,Array,Function,Date,null],default:null},placeholder:String,multiple:Boolean,nativeSize:[String,Number]},emits:{blur:e=>!0,focus:e=>!0,"update:modelValue":e=>!0},data(){return{selected:this.modelValue,_elementRef:"select"}},computed:{computedValue:{get(){return this.selected},set(e){this.selected=e,this.$emit("update:modelValue",e),!this.isValid&&this.checkHtml5Validity()}},spanClasses(){return[this.size,this.statusType,{"is-fullwidth":this.expanded,"is-loading":this.loading,"is-multiple":this.multiple,"is-rounded":this.rounded,"is-empty":null===this.selected}]}},watch:{modelValue(e){this.selected=e,!this.isValid&&this.checkHtml5Validity()}}});const O=["multiple","size"],K={key:0,value:null,disabled:"",hidden:""};var U=C(L,[["render",function(e,o,i,n,l,a){const s=t.resolveComponent("b-icon");return t.openBlock(),t.createElementBlock("div",t.mergeProps({class:["control",{"is-expanded":e.expanded,"has-icons-left":e.icon}]},e.rootAttrs),[t.createElementVNode("span",{class:t.normalizeClass(["select",e.spanClasses])},[t.withDirectives(t.createElementVNode("select",t.mergeProps({"onUpdate:modelValue":o[0]||(o[0]=t=>e.computedValue=t),ref:"select",multiple:e.multiple,size:e.nativeSize},e.fallthroughAttrs,{onBlur:o[1]||(o[1]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:o[2]||(o[2]=t=>e.$emit("focus",t))}),[e.placeholder?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[null==e.computedValue?(t.openBlock(),t.createElementBlock("option",K,t.toDisplayString(e.placeholder),1)):t.createCommentVNode("v-if",!0)],64)):t.createCommentVNode("v-if",!0),t.renderSlot(e.$slots,"default")],16,O),[[t.vModelSelect,e.computedValue]])],2),e.icon?(t.openBlock(),t.createBlock(s,{key:0,class:"is-left",icon:e.icon,pack:e.iconPack,size:e.iconSize},null,8,["icon","pack","size"])):t.createCommentVNode("v-if",!0)],16)}]]),j=t.defineComponent({name:"BTableMobileSort",components:{BSelect:U,BIcon:V},props:{currentSortColumn:Object,sortMultipleData:Array,isAsc:Boolean,columns:Array,placeholder:String,iconPack:String,sortIcon:{type:String,default:"arrow-up"},sortIconSize:{type:String,default:"is-small"},sortMultiple:{type:Boolean,default:!1}},emits:{removePriority:e=>!0,sort:(e,t)=>!0},data(){return{sortMultipleSelect:null,sortMultipleSelectIndex:-1,mobileSort:this.currentSortColumn,mobileSortIndex:this.columns?this.columns.indexOf(this.currentSortColumn):-1,defaultEvent:{shiftKey:!0,altKey:!0,ctrlKey:!0},ignoreSort:!1}},computed:{showPlaceholder(){return!this.columns||!this.columns.some((e=>e===this.mobileSort))},sortableColumns(){return this.columns&&this.columns.filter((e=>e.sortable))}},watch:{sortMultipleSelect(e){this.ignoreSort?this.ignoreSort=!1:this.$emit("sort",e,this.defaultEvent)},sortMultipleSelectIndex(e){this.sortMultipleSelect=-1!==e?this.columns[e]:null},mobileSort(e){this.currentSortColumn!==e&&this.$emit("sort",e,this.defaultEvent)},mobileSortIndex(e){-1!==e&&(this.mobileSort=this.columns[e])},currentSortColumn(e){this.mobileSort=e,this.mobileSortIndex=this.columns?this.columns.indexOf(e):-1},columns(e){this.sortMultiple?this.sortMultipleSelectIndex=e.indexOf(this.sortMultipleSelect):this.mobileSortIndex=e.indexOf(this.mobileSort)}},methods:{removePriority(){this.$emit("removePriority",this.sortMultipleSelect),this.ignoreSort=!0;const e=this.sortMultipleData.filter((e=>e.field!==this.sortMultipleSelect.field)).map((e=>e.field));this.sortMultipleSelectIndex=this.columns.findIndex((t=>e.includes(t.field)))},getSortingObjectOfColumn(e){return this.sortMultipleData.filter((t=>t.field===e.field))[0]},columnIsDesc(e){const t=e&&this.getSortingObjectOfColumn(e);return!t||!(!t.order||"desc"!==t.order)},getLabel(e){const t=this.getSortingObjectOfColumn(e);return t?e.label+"("+(this.sortMultipleData.indexOf(t)+1)+")":e.label},sort(){this.$emit("sort",this.sortMultiple?this.sortMultipleSelect:this.mobileSort,this.defaultEvent)}}});const H={class:"field table-mobile-sort"},_={class:"field has-addons"},q=["value"],W=["value"],Y={class:"control"};var X=C(j,[["render",function(e,o,i,n,l,a){const s=t.resolveComponent("b-select"),r=t.resolveComponent("b-icon");return t.openBlock(),t.createElementBlock("div",H,[t.createElementVNode("div",_,[e.sortMultiple?(t.openBlock(),t.createBlock(s,{key:0,modelValue:e.sortMultipleSelectIndex,"onUpdate:modelValue":o[0]||(o[0]=t=>e.sortMultipleSelectIndex=t),expanded:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.sortableColumns,((o,i)=>(t.openBlock(),t.createElementBlock("option",{key:i,value:i},[t.createTextVNode(t.toDisplayString(e.getLabel(o))+" ",1),e.getSortingObjectOfColumn(o)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.columnIsDesc(o)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(" ↓ ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(" ↑ ")],64))],64)):t.createCommentVNode("v-if",!0)],8,q)))),128))])),_:1},8,["modelValue"])):(t.openBlock(),t.createBlock(s,{key:1,modelValue:e.mobileSortIndex,"onUpdate:modelValue":o[1]||(o[1]=t=>e.mobileSortIndex=t),expanded:""},{default:t.withCtx((()=>[e.placeholder?t.withDirectives((t.openBlock(),t.createElementBlock("option",{key:0,value:{},selected:"",disabled:"",hidden:""},t.toDisplayString(e.placeholder),513)),[[t.vShow,e.showPlaceholder]]):t.createCommentVNode("v-if",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.sortableColumns,((e,o)=>(t.openBlock(),t.createElementBlock("option",{key:o,value:o},t.toDisplayString(e.label),9,W)))),128))])),_:1},8,["modelValue"])),t.createElementVNode("div",Y,[e.sortMultiple&&e.sortMultipleData.length>0?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("button",{class:"button is-primary",onClick:o[2]||(o[2]=(...t)=>e.sort&&e.sort(...t))},[t.createVNode(r,{class:t.normalizeClass({"is-desc":e.columnIsDesc(e.sortMultipleSelect)}),icon:e.sortIcon,pack:e.iconPack,size:e.sortIconSize,both:""},null,8,["class","icon","pack","size"])]),t.createElementVNode("button",{class:"button is-primary",onClick:o[3]||(o[3]=(...t)=>e.removePriority&&e.removePriority(...t))},[t.createVNode(r,{icon:"delete",size:e.sortIconSize,both:""},null,8,["size"])])],64)):e.sortMultiple?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("button",{key:1,class:"button is-primary",onClick:o[4]||(o[4]=(...t)=>e.sort&&e.sort(...t))},[t.withDirectives(t.createVNode(r,{class:t.normalizeClass({"is-desc":!e.isAsc}),icon:e.sortIcon,pack:e.iconPack,size:e.sortIconSize,both:""},null,8,["class","icon","pack","size"]),[[t.vShow,e.currentSortColumn===e.mobileSort]])]))])])])}]]);var J=C(t.defineComponent({name:"BPaginationButton",props:{page:{type:Object,required:!0},tag:{type:[String,Object],default:"a",validator:e=>"object"==typeof e||h.defaultLinkTags.indexOf(e)>=0},disabled:{type:Boolean,default:!1}},computed:{href(){return"a"===this.tag?"#":void 0},isDisabled(){return this.disabled||this.page.disabled},disabledOrUndefined(){return this.isDisabled||void 0}}}),[["render",function(e,o,i,n,l,a){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tag),t.mergeProps({role:"button",href:e.href,disabled:e.disabledOrUndefined,class:["pagination-link",{"is-current":e.page.isCurrent,[e.page.class]:!0}]},e.$attrs,{onClick:t.withModifiers(e.page.click,["prevent"]),"aria-label":e.page["aria-label"],"aria-current":e.page.isCurrent||void 0}),{default:t.withCtx((()=>[t.renderSlot(e.$slots,"default",{},(()=>[t.createTextVNode(t.toDisplayString(e.page.number),1)]))])),_:3},16,["href","disabled","class","onClick","aria-label","aria-current"])}]]),G=t.defineComponent({name:"BPagination",components:{BIcon:V,BPaginationButton:J},props:{total:[Number,String],perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},rangeBefore:{type:[Number,String],default:1},rangeAfter:{type:[Number,String],default:1},size:String,simple:Boolean,rounded:Boolean,order:String,iconPack:String,iconPrev:{type:String,default:()=>h.defaultIconPrev},iconNext:{type:String,default:()=>h.defaultIconNext},ariaNextLabel:String,ariaPreviousLabel:String,ariaPageLabel:String,ariaCurrentLabel:String,pageInput:{type:Boolean,default:!1},pageInputPosition:String,debouncePageInput:[Number,String]},data(){return{inputValue:this.modelValue,debounceHandlePageInput:void 0}},emits:{change:e=>!0,"update:modelValue":e=>!0},computed:{rootClasses(){return[this.order,this.size,this.pageInputPosition,{"is-simple":this.simple,"is-rounded":this.rounded,"has-input":this.pageInput}]},beforeCurrent(){return parseInt(this.rangeBefore+"")},afterCurrent(){return parseInt(this.rangeAfter+"")},pageCount(){return Math.ceil(+this.total/+this.perPage)},firstItem(){const e=+this.modelValue*+this.perPage-+this.perPage+1;return e>=0?e:0},hasPrev(){return+this.modelValue>1},hasFirst(){return+this.modelValue>=2+this.beforeCurrent},hasFirstEllipsis(){return+this.modelValue>=this.beforeCurrent+4},hasLast(){return+this.modelValue<=this.pageCount-(1+this.afterCurrent)},hasLastEllipsis(){return+this.modelValue<this.pageCount-(2+this.afterCurrent)},hasNext(){return+this.modelValue<this.pageCount},pagesInRange(){if(this.simple)return;let e=Math.max(1,+this.modelValue-this.beforeCurrent);e-1==2&&e--;let t=Math.min(+this.modelValue+this.afterCurrent,this.pageCount);this.pageCount-t===2&&t++;const o=[];for(let i=e;i<=t;i++)o.push(this.getPage(i));return o}},watch:{pageCount(e){this.modelValue>e&&this.last()},modelValue(e){this.inputValue=e},debouncePageInput:{handler(e){this.debounceHandlePageInput=d(this.handleOnInputPageChange,e)},immediate:!0}},methods:{prev(e){this.changePage(+this.modelValue-1,e)},next(e){this.changePage(+this.modelValue+1,e)},first(e){this.changePage(1,e)},last(e){this.changePage(this.pageCount,e)},changePage(e,t){this.modelValue===e||e<1||e>this.pageCount||(this.$emit("update:modelValue",e),this.$emit("change",e),t&&t.target&&this.$nextTick((()=>t.target.focus())))},getPage(e,t={}){return{number:e,isCurrent:this.modelValue===e,click:t=>this.changePage(e,t),input:(e,t)=>this.changePage(+t,e),disabled:t.disabled||!1,class:t.class||"","aria-label":t["aria-label"]||this.getAriaPageLabel(e,this.modelValue===e)}},getAriaPageLabel(e,t){return!this.ariaPageLabel||t&&this.ariaCurrentLabel?this.ariaPageLabel&&t&&this.ariaCurrentLabel?this.ariaCurrentLabel+", "+this.ariaPageLabel+" "+e+".":null:this.ariaPageLabel+" "+e+"."},handleOnInputPageChange(e){this.getPage(+this.inputValue).input(e,this.inputValue)},handleOnInputDebounce(e){this.debouncePageInput?this.debounceHandlePageInput(e):this.handleOnInputPageChange(e)},handleOnKeyPress(e){const t=e.which||e.keyCode;return t>=48&&t<=57||e.preventDefault()},handleAllowableInputPageRange(e){const t=e.target;+t.value>0&&+t.value<=this.pageCount?this.handleOnInputValue(e):(this.inputValue=1,this.inputValue="")},handleOnInputValue(e){const t=+e.target.value;this.inputValue=t,Number.isInteger(this.inputValue)?this.handleOnInputDebounce(e):this.inputValue=this.modelValue}}});const Q={class:"control pagination-input"},Z=["value","size","maxlength"],ee={key:4,class:"info"},te={key:5,class:"pagination-list"},oe={key:0},ie={key:1},ne=[t.createElementVNode("span",{class:"pagination-ellipsis"},"…",-1)],le={key:2},ae=[t.createElementVNode("span",{class:"pagination-ellipsis"},"…",-1)],se={key:3};var re=C(G,[["render",function(e,o,i,n,l,a){const s=t.resolveComponent("b-icon"),r=t.resolveComponent("BPaginationButton");return t.openBlock(),t.createElementBlock("nav",{class:t.normalizeClass(["pagination",e.rootClasses])},[e.$slots.previous?t.renderSlot(e.$slots,"previous",{key:0,page:e.getPage(+e.modelValue-1,{disabled:!e.hasPrev,class:"pagination-previous","aria-label":e.ariaPreviousLabel})},(()=>[t.createVNode(s,{icon:e.iconPrev,pack:e.iconPack,both:"","aria-hidden":"true"},null,8,["icon","pack"])])):(t.openBlock(),t.createBlock(r,{key:1,class:"pagination-previous",disabled:!e.hasPrev,page:e.getPage(+e.modelValue-1),"aria-label":e.ariaPreviousLabel},{default:t.withCtx((()=>[t.createVNode(s,{icon:e.iconPrev,pack:e.iconPack,both:"","aria-hidden":"true"},null,8,["icon","pack"])])),_:1},8,["disabled","page","aria-label"])),e.$slots.next?t.renderSlot(e.$slots,"next",{key:2,page:e.getPage(+e.modelValue+1,{disabled:!e.hasNext,class:"pagination-next","aria-label":e.ariaNextLabel})},(()=>[t.createVNode(s,{icon:e.iconNext,pack:e.iconPack,both:"","aria-hidden":"true"},null,8,["icon","pack"])])):(t.openBlock(),t.createBlock(r,{key:3,class:"pagination-next",disabled:!e.hasNext,page:e.getPage(+e.modelValue+1),"aria-label":e.ariaNextLabel},{default:t.withCtx((()=>[t.createVNode(s,{icon:e.iconNext,pack:e.iconPack,both:"","aria-hidden":"true"},null,8,["icon","pack"])])),_:1},8,["disabled","page","aria-label"])),t.createElementVNode("div",Q,[e.pageInput?(t.openBlock(),t.createElementBlock("input",{key:0,class:"input",value:e.inputValue,onInput:o[0]||(o[0]=(...t)=>e.handleAllowableInputPageRange&&e.handleAllowableInputPageRange(...t)),onKeypress:o[1]||(o[1]=(...t)=>e.handleOnKeyPress&&e.handleOnKeyPress(...t)),size:e.pageCount.toString().length,maxlength:e.pageCount.toString().length},null,40,Z)):t.createCommentVNode("v-if",!0)]),e.simple?(t.openBlock(),t.createElementBlock("small",ee,[1==e.perPage?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(e.firstItem)+" / "+t.toDisplayString(e.total),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(e.firstItem)+"-"+t.toDisplayString(Math.min(+e.modelValue*+e.perPage,+e.total))+" / "+t.toDisplayString(e.total),1)],64))])):(t.openBlock(),t.createElementBlock("ul",te,[t.createCommentVNode("First"),e.hasFirst?(t.openBlock(),t.createElementBlock("li",oe,[e.$slots.default?t.renderSlot(e.$slots,"default",{key:0,page:e.getPage(1)}):(t.openBlock(),t.createBlock(r,{key:1,page:e.getPage(1)},null,8,["page"]))])):t.createCommentVNode("v-if",!0),e.hasFirstEllipsis?(t.openBlock(),t.createElementBlock("li",ie,[...ne])):t.createCommentVNode("v-if",!0),t.createCommentVNode("Pages"),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.pagesInRange,(o=>(t.openBlock(),t.createElementBlock("li",{key:o.number},[e.$slots.default?t.renderSlot(e.$slots,"default",{key:0,page:o}):(t.openBlock(),t.createBlock(r,{key:1,page:o},null,8,["page"]))])))),128)),t.createCommentVNode("Last"),e.hasLastEllipsis?(t.openBlock(),t.createElementBlock("li",le,[...ae])):t.createCommentVNode("v-if",!0),e.hasLast?(t.openBlock(),t.createElementBlock("li",se,[e.$slots.default?t.renderSlot(e.$slots,"default",{key:0,page:e.getPage(e.pageCount)}):(t.openBlock(),t.createBlock(r,{key:1,page:e.getPage(e.pageCount)},null,8,["page"]))])):t.createCommentVNode("v-if",!0)]))],2)}]]),ce=t.defineComponent({name:"BTablePagination",components:{BPagination:re},props:{paginated:Boolean,total:[Number,String],perPage:[Number,String],currentPage:[Number,String],paginationSimple:Boolean,paginationSize:String,rounded:Boolean,iconPack:String,ariaNextLabel:String,ariaPreviousLabel:String,ariaPageLabel:String,ariaCurrentLabel:String,pageInput:Boolean,paginationOrder:String,pageInputPosition:String,debouncePageInput:[Number,String]},emits:{"page-change":e=>!0,"update:currentPage":e=>!0},data(){return{newCurrentPage:this.currentPage}},watch:{currentPage(e){this.newCurrentPage=e}},methods:{pageChanged(e){this.newCurrentPage=e>0?e:1,this.$emit("update:currentPage",this.newCurrentPage),this.$emit("page-change",this.newCurrentPage)}}});const ue={class:"top level"},de={class:"level-left"},he={class:"level-right"},pe={key:0,class:"level-item"};var me=C(ce,[["render",function(e,o,i,n,l,a){const s=t.resolveComponent("b-pagination");return t.openBlock(),t.createElementBlock("div",ue,[t.createElementVNode("div",de,[t.renderSlot(e.$slots,"default")]),t.createElementVNode("div",he,[e.paginated?(t.openBlock(),t.createElementBlock("div",pe,[t.createVNode(s,{"icon-pack":e.iconPack,total:e.total,"per-page":e.perPage,simple:e.paginationSimple,size:e.paginationSize,"model-value":e.newCurrentPage,rounded:e.rounded,onChange:e.pageChanged,"aria-next-label":e.ariaNextLabel,"aria-previous-label":e.ariaPreviousLabel,"aria-page-label":e.ariaPageLabel,"aria-current-label":e.ariaCurrentLabel,"page-input":e.pageInput,order:e.paginationOrder,"page-input-position":e.pageInputPosition,"debounce-page-input":e.debouncePageInput},null,8,["icon-pack","total","per-page","simple","size","model-value","rounded","onChange","aria-next-label","aria-previous-label","aria-page-label","aria-current-label","page-input","order","page-input-position","debounce-page-input"])])):t.createCommentVNode("v-if",!0)])])}]]),ge=Object.defineProperty,fe=Object.defineProperties,be=Object.getOwnPropertyDescriptors,ke=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,ve=(e,t,o)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,we=(e,t)=>{for(var o in t||(t={}))Ce.call(t,o)&&ve(e,o,t[o]);if(ke)for(var o of ke(t))ye.call(t,o)&&ve(e,o,t[o]);return e};function Se(e,i){return n=we(we({},{label:void 0,customKey:void 0,field:void 0,meta:void 0,width:void 0,numeric:void 0,centered:void 0,searchable:void 0,sortable:void 0,visible:!0,subheading:void 0,customSort:void 0,customSearch:void 0,sticky:void 0,headerSelectable:void 0,headerClass:void 0,thAttrs:()=>({}),tdAttrs:()=>({})}),i),l={newKey:i.customKey||i.label,_isTableColumn:!0,get thClasses(){const e=this.thAttrs(this),t=[this.headerClass,{"is-sortable":this.sortable,"is-sticky":this.sticky,"is-unselectable":this.isHeaderUnSelectable}];return e&&e.class&&t.push(e.class),t},get thStyle(){const e=this.thAttrs(this),t=[this.style];return e&&e.style&&t.push(e.style),t},get thWrapStyle(){return this.style},get style(){var e;return{width:null!=(e=r(this.width))?e:void 0}},getRootClasses(e){const t=this.tdAttrs(e,this),o=[this.rootClasses];return t&&t.class&&o.push(t.class),o},getRootStyle(e){const t=this.tdAttrs(e,this),o=[];return t&&t.style&&o.push(t.style),o},$slots:{default:e=>[t.h("span",{innerHTML:o(e.row,i.field)})]},get rootClasses(){return[this.cellClass,{"has-text-right":this.numeric&&!this.centered,"has-text-centered":this.centered,"is-sticky":this.sticky}]},get isHeaderUnSelectable(){return!this.headerSelectable&&!!this.sortable}},fe(n,be(l));var n,l}const Be={thAttrs:()=>({}),tdAttrs:()=>({}),getRootClasses:()=>[],getRootStyle:()=>{},$slots:{}};var De=t.defineComponent({name:"BTable",components:{BCheckbox:S,BIcon:V,BInput:$,BLoading:z,BSlotComponent:F,BTableMobileSort:X,BTablePagination:me},mixins:[f],provide(){return{$table:this}},props:{data:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},bordered:Boolean,striped:Boolean,narrowed:Boolean,hoverable:Boolean,loading:Boolean,detailed:Boolean,checkable:Boolean,headerCheckable:{type:Boolean,default:!0},checkboxType:{type:String,default:"is-primary"},checkboxPosition:{type:String,default:"left",validator:e=>["left","right"].indexOf(e)>=0},stickyCheckbox:{type:Boolean,default:!1},selected:Object,isRowSelectable:{type:Function,default:()=>!0},focusable:Boolean,customIsChecked:Function,isRowCheckable:{type:Function,default:()=>!0},checkedRows:{type:Array,default:()=>[]},mobileCards:{type:Boolean,default:!0},defaultSort:[String,Array],defaultSortDirection:{type:String,default:"asc"},sortIcon:{type:String,default:"arrow-up"},sortIconSize:{type:String,default:"is-small"},sortMultiple:{type:Boolean,default:!1},sortMultipleData:{type:Array,default:()=>[]},sortMultipleKey:{type:String,default:null},paginated:Boolean,currentPage:{type:Number,default:1},perPage:{type:[Number,String],default:20},showDetailIcon:{type:Boolean,default:!0},detailIcon:{type:String,default:"chevron-right"},paginationPosition:{type:String,default:"bottom",validator:e=>["bottom","top","both"].indexOf(e)>=0},paginationRounded:Boolean,backendSorting:Boolean,backendFiltering:Boolean,rowClass:{type:Function,default:()=>""},openedDetailed:{type:Array,default:()=>[]},hasDetailedVisible:{type:Function,default:()=>!0},detailKey:{type:String,default:""},detailTransition:{type:String,default:""},customDetailRow:{type:Boolean,default:!1},backendPagination:Boolean,total:{type:[Number,String],default:0},iconPack:String,mobileSortPlaceholder:String,customRowKey:String,draggable:{type:Boolean,default:!1},draggableColumn:{type:Boolean,default:!1},scrollable:Boolean,ariaNextLabel:String,ariaPreviousLabel:String,ariaPageLabel:String,ariaCurrentLabel:String,stickyHeader:Boolean,height:[Number,String],filtersEvent:{type:String,default:""},cardLayout:Boolean,showHeader:{type:Boolean,default:!0},debounceSearch:Number,caption:String,showCaption:{type:Boolean,default:!0},pageInput:{type:Boolean,default:!1},paginationOrder:String,pageInputPosition:String,debouncePageInput:[Number,String]},emits:{cellclick:(e,t,o,i)=>!0,check:(e,t)=>!0,"check-all":e=>!0,click:e=>!0,columndragend:e=>!0,columndragleave:e=>!0,columndragover:e=>!0,columndragstart:e=>!0,columndrop:e=>!0,contextmenu:(e,t)=>!0,dblclick:e=>!0,"details-close":e=>!0,"details-open":e=>!0,dragend:e=>!0,dragleave:e=>!0,dragover:e=>!0,dragstart:e=>!0,drop:e=>!0,"filters-change":e=>!0,"page-change":e=>!0,select:(e,t)=>!0,sort:(e,t,o)=>!0,"sorting-priority-removed":e=>!0,"update:checkedRows":e=>!0,"update:currentPage":e=>!0,"update:openedDetailed":e=>!0,"update:selected":e=>!0},data(){return{sortMultipleDataLocal:[],getValueByPath:o,visibleDetailRows:this.openedDetailed,newData:this.data,newDataTotal:this.backendPagination?this.total:this.data.length,newCheckedRows:[...this.checkedRows],lastCheckedRowIndex:null,newCurrentPage:this.currentPage,currentSortColumn:{},isAsc:!0,filters:{},defaultSlots:[],firstTimeSort:!0,isDraggingRow:!1,isDraggingColumn:!1,debouncedHandleFiltersChange:void 0,_selectedRow:null,mayBeTouchDragging:!1,touchDragoverTarget:null,_draggedCellEl:void 0,draggedCellContent:""}},computed:{sortMultipleDataComputed(){return this.backendSorting?this.sortMultipleData:this.sortMultipleDataLocal},tableClasses(){return{"is-bordered":this.bordered,"is-striped":this.striped,"is-narrow":this.narrowed,"is-hoverable":(this.hoverable||this.focusable)&&this.visibleData.length}},tableWrapperClasses(){return{"has-mobile-cards":this.mobileCards,"has-sticky-header":this.stickyHeader,"is-card-list":this.cardLayout,"table-container":this.isScrollable}},tableStyle(){return{height:r(this.height)}},touchDraggedCellClasses(){return{"has-mobile-cards":this.mobileCards}},visibleData(){if(!this.paginated)return this.newData;const e=this.newCurrentPage,t=+this.perPage;if(this.newData.length<=t)return this.newData;{const o=(e-1)*t,i=parseInt(o+"",10)+parseInt(t+"",10);return this.newData.slice(o,i)}},visibleColumns(){return this.newColumns?this.newColumns.filter((e=>e.visible||void 0===e.visible)):this.newColumns},isAllChecked(){const e=this.visibleData.filter((e=>this.isRowCheckable(e)));if(0===e.length)return!1;return!e.some((e=>i(this.newCheckedRows,e,this.customIsChecked)<0))},isAllUncheckable(){return 0===this.visibleData.filter((e=>this.isRowCheckable(e))).length},hasSortablenewColumns(){return this.newColumns.some((e=>e.sortable))},hasSearchablenewColumns(){return this.newColumns.some((e=>e.searchable))},hasCustomSubheadings(){return!(!this.$slots||!this.$slots.subheading)||this.newColumns.some((e=>e.subheading||e.$slots.subheading))},columnCount(){let e=this.visibleColumns.length;return e+=this.checkable?1:0,e+=this.detailed&&this.showDetailIcon?1:0,e},showDetailRowIcon(){return this.detailed&&this.showDetailIcon},isScrollable(){return!!this.scrollable||!!this.newColumns&&this.newColumns.some((e=>e.sticky))},newColumns(){return this.columns&&this.columns.length?this.columns.map((e=>Se(0,e))):this.defaultSlots},canDragRow(){return this.draggable&&!this.isDraggingColumn},canDragColumn(){return this.draggableColumn&&!this.isDraggingRow}},watch:{data(e){this.newData=e,this.backendFiltering||(this.newData=e.filter((e=>this.isRowFiltered(e)))),this.backendSorting||this.sort(this.currentSortColumn,!0),this.backendPagination||(this.newDataTotal=this.newData.length)},total(e){this.backendPagination&&(this.newDataTotal=e)},currentPage(e){this.newCurrentPage=e},newCurrentPage(e){this.$emit("update:currentPage",e)},checkedRows(e){this.newCheckedRows=[...e]},debounceSearch:{handler(e){this.debouncedHandleFiltersChange=d(this.handleFiltersChange,e)},immediate:!0},filters:{handler(e){this.debounceSearch?this.debouncedHandleFiltersChange(e):this.handleFiltersChange(e)},deep:!0},openedDetailed(e){this.visibleDetailRows=e}},methods:{onFiltersEvent(e){this.$emit(`filters-event-${this.filtersEvent}`,{event:e,filters:this.filters})},handleFiltersChange(e){this.backendFiltering?this.$emit("filters-change",e):(this.newData=this.data.filter((e=>this.isRowFiltered(e))),this.backendPagination||(this.newDataTotal=this.newData.length),this.backendSorting||(this.sortMultiple&&this.sortMultipleDataLocal&&this.sortMultipleDataLocal.length>0?this.doSortMultiColumn():Object.keys(this.currentSortColumn).length>0&&this.doSortSingleColumn(this.currentSortColumn)))},findIndexOfSortData(e){const t=this.sortMultipleDataComputed.filter((t=>t.field===e.field))[0];return this.sortMultipleDataComputed.indexOf(t)+1},removeSortingPriority(e){this.backendSorting?this.$emit("sorting-priority-removed",e.field):(this.sortMultipleDataLocal=this.sortMultipleDataLocal.filter((t=>t.field!==e.field)),0===this.sortMultipleDataLocal.length?this.resetMultiSorting():this.newData=s(this.newData,this.sortMultipleDataLocal))},resetMultiSorting(){this.sortMultipleDataLocal=[],this.currentSortColumn=Be,this.newData=this.data},sortBy(e,t,i,n){let l=[];return l=i&&"function"==typeof i?[...e].sort(((e,t)=>i(e,t,n))):[...e].sort(((e,i)=>{let l=o(e,t),a=o(i,t);return"boolean"==typeof l&&"boolean"==typeof a?n?+l-+a:+a-+l:!c(a)&&c(l)?n?1:-1:!c(l)&&c(a)?n?-1:1:l===a?0:(l="string"==typeof l?l.toUpperCase():l,a="string"==typeof a?a.toUpperCase():a,n?l>a?1:-1:l>a?-1:1)})),l},sortMultiColumn(e){if(this.currentSortColumn=Be,!this.backendSorting){const t=this.sortMultipleDataLocal.filter((t=>t.field===e.field))[0];t?t.order="desc"===t.order?"asc":"desc":this.sortMultipleDataLocal.push({field:e.field,order:this.isAsc?"asc":"desc",customSort:e.customSort}),this.doSortMultiColumn()}},doSortMultiColumn(){this.newData=s(this.newData,this.sortMultipleDataLocal)},sort(e,o=!1,i=null){e&&e.sortable&&(!this.backendSorting&&this.sortMultiple&&(this.sortMultipleKey&&i[this.sortMultipleKey]||!this.sortMultipleKey)?o?this.doSortMultiColumn():this.sortMultiColumn(e):(this.sortMultiple&&(this.sortMultipleDataLocal=[]),o||(this.isAsc=t.toRaw(e)===t.toRaw(this.currentSortColumn)?!this.isAsc:"desc"!==this.defaultSortDirection.toLowerCase()),this.firstTimeSort||this.$emit("sort",e.field,this.isAsc?"asc":"desc",i),this.backendSorting||this.doSortSingleColumn(e),this.currentSortColumn=e))},doSortSingleColumn(e){this.newData=this.sortBy(this.newData,e.field,e.customSort,this.isAsc)},isRowSelected(e,t){return!!t&&(this.customRowKey?e[this.customRowKey]===t[this.customRowKey]:e===t)},isRowChecked(e){return i(this.newCheckedRows,e,this.customIsChecked)>=0},removeCheckedRow(e){const t=i(this.newCheckedRows,e,this.customIsChecked);t>=0&&this.newCheckedRows.splice(t,1)},checkAll(){const e=this.isAllChecked;this.visibleData.forEach((t=>{this.isRowCheckable(t)&&this.removeCheckedRow(t),e||this.isRowCheckable(t)&&this.newCheckedRows.push(t)})),this.$emit("check",this.newCheckedRows),this.$emit("check-all",this.newCheckedRows),this.$emit("update:checkedRows",this.newCheckedRows)},checkRow(e,t,o){if(!this.isRowCheckable(e))return;const i=this.lastCheckedRowIndex;this.lastCheckedRowIndex=t,o.shiftKey&&null!==i&&t!==i?this.shiftCheckRow(e,t,i):this.isRowChecked(e)?this.removeCheckedRow(e):this.newCheckedRows.push(e),this.$emit("check",this.newCheckedRows,e),this.$emit("update:checkedRows",this.newCheckedRows)},shiftCheckRow(e,t,o){const i=this.visibleData.slice(Math.min(t,o),Math.max(t,o)+1),n=!this.isRowChecked(e);i.forEach((e=>{this.removeCheckedRow(e),n&&this.isRowCheckable(e)&&this.newCheckedRows.push(e)}))},selectRow(e){this.$emit("click",e),this._selectedRow=e,this.selected!==e&&this.isRowSelectable(e)&&(this.$emit("select",e,this.selected),this.$emit("update:selected",e))},toggleDetails(e){this.isVisibleDetailRow(e)?(this.closeDetailRow(e),this.$emit("details-close",e)):(this.openDetailRow(e),this.$emit("details-open",e)),this.$emit("update:openedDetailed",this.visibleDetailRows)},openDetailRow(e){const t=this.handleDetailKey(e);this.visibleDetailRows.push(t)},closeDetailRow(e){const t=this.handleDetailKey(e),o=this.visibleDetailRows.indexOf(t);o>=0&&this.visibleDetailRows.splice(o,1)},isVisibleDetailRow(e){const t=this.handleDetailKey(e);return this.visibleDetailRows.indexOf(t)>=0},isActiveDetailRow(e){return this.detailed&&!this.customDetailRow&&this.isVisibleDetailRow(e)},isActiveCustomDetailRow(e){return this.detailed&&this.customDetailRow&&this.isVisibleDetailRow(e)},isRowFiltered(e){for(const t in this.filters){if(!this.filters[t])continue;const o=this.filters[t],i=this.newColumns.filter((e=>e.field===t))[0];if(i&&i.customSearch&&"function"==typeof i.customSearch){if(!i.customSearch(e,o))return!1}else{const i=this.getValueByPath(e,t);if(null==i)return!1;if(Number.isInteger(i)){if(i!==Number(o))return!1}else{const e=new RegExp(l(o+""),"i");if(Array.isArray(i)){if(!i.some((t=>e.test(a(t))||e.test(t))))return!1}else if(!e.test(a(i))&&!e.test(i))return!1}}}return!0},handleDetailKey(e){const t=this.detailKey;return t.length&&e?e[t]:e},checkPredefinedDetailedRows(){if(this.openedDetailed.length>0&&!this.detailKey.length)throw new Error('If you set a predefined opened-detailed, you must provide a unique key using the prop "detail-key"')},checkSort(){if(this.newColumns.length&&this.firstTimeSort)this.initSort(),this.firstTimeSort=!1;else if(this.newColumns.length&&t.toRaw(this.currentSortColumn)!==Be)for(let e=0;e<this.newColumns.length;e++)if(this.newColumns[e].field===this.currentSortColumn.field){this.currentSortColumn=this.newColumns[e];break}},hasCustomFooterSlot(){var e;const o=this.$slots.footer();if(o.length>1)return!0;if(o[0].type===t.Fragment)return!0;const i=null==(e=o[0].el)?void 0:e.tag;return"th"===i||"td"===i},hasBottomLeftSlot(){return void 0!==this.$slots["bottom-left"]},pressedArrow(e){if(!this.visibleData.length)return;let t=this.visibleData.indexOf(this.selected)+e;t=t<0?0:t>this.visibleData.length-1?this.visibleData.length-1:t;const o=this.visibleData[t];if(this.isRowSelectable(o))this.selectRow(o);else{let o=null;if(e>0)for(let e=t;e<this.visibleData.length&&null===o;e++)this.isRowSelectable(this.visibleData[e])&&(o=e);else for(let e=t;e>=0&&null===o;e--)this.isRowSelectable(this.visibleData[e])&&(o=e);o>=0&&this.selectRow(this.visibleData[o])}},focus(){this.focusable&&this.$el.querySelector("table").focus()},initSort(){if(this.sortMultiple&&this.sortMultipleData)this.sortMultipleData.forEach((e=>{this.sortMultiColumn(e)}));else{if(!this.defaultSort)return;let e="",t=this.defaultSortDirection;Array.isArray(this.defaultSort)?(e=this.defaultSort[0],this.defaultSort[1]&&(t=this.defaultSort[1])):e=this.defaultSort;const o=this.newColumns.filter((t=>t.field===e))[0];o&&(this.isAsc="desc"!==t.toLowerCase(),this.sort(o,!0))}},handleDragStart(e,t,o){this.canDragRow&&(this.isDraggingRow=!0,this.$emit("dragstart",{event:e,row:t,index:o}))},handleDragEnd(e,t,o){this.canDragRow&&(this.isDraggingRow=!1,this.$emit("dragend",{event:e,row:t,index:o}))},handleDrop(e,t,o){this.canDragRow&&this.$emit("drop",{event:e,row:t,index:o})},handleDragOver(e,t,o){this.canDragRow&&this.$emit("dragover",{event:e,row:t,index:o})},handleDragLeave(e,t,o){this.canDragRow&&this.$emit("dragleave",{event:e,row:t,index:o})},emitEventForRow(e,o,i){return null!