vuiii 1.0.0-beta.3 → 1.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/useSubmitAction.d.ts +1 -1
- package/dist/vuiii.es.js +1 -1
- package/dist/vuiii.umd.js +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ export declare type ValidationResults<T = any> = {
|
|
|
12
12
|
declare type ConfirmParams = Parameters<ReturnType<typeof useModal>['confirm']>[0];
|
|
13
13
|
export declare function useSubmitAction<D = unknown, R = unknown>(action: (data: D) => any | Promise<any>, options?: {
|
|
14
14
|
validator?: (data: D) => boolean | Promise<ValidationResults<D> | boolean>;
|
|
15
|
-
|
|
15
|
+
onValidationResults?: (errors?: ValidationErrors<D>) => void;
|
|
16
16
|
confirm?: ((data: D) => ConfirmParams) | ConfirmParams;
|
|
17
17
|
onSuccess?: (params: {
|
|
18
18
|
result: R;
|
package/dist/vuiii.es.js
CHANGED
|
@@ -1808,7 +1808,7 @@ function useSubmitAction(action, options = {}) {
|
|
|
1808
1808
|
}
|
|
1809
1809
|
if (options.validator) {
|
|
1810
1810
|
const validationResult = await options.validator(data);
|
|
1811
|
-
(_a = options.
|
|
1811
|
+
(_a = options.onValidationResults) == null ? void 0 : _a.call(options, validationResult);
|
|
1812
1812
|
if (!validationResult) {
|
|
1813
1813
|
return;
|
|
1814
1814
|
}
|
package/dist/vuiii.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a.vui={},a.Vue,a.VueRouter))})(this,function(a,e,h){"use strict";var En=Object.defineProperty,Mn=Object.defineProperties;var Nn=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var T=(a,e,h)=>e in a?En(a,e,{enumerable:!0,configurable:!0,writable:!0,value:h}):a[e]=h,$=(a,e)=>{for(var h in e||(e={}))P.call(e,h)&&T(a,h,e[h]);if(V)for(var h of V(e))v.call(e,h)&&T(a,h,e[h]);return a},B=(a,e)=>Mn(a,Nn(e));var R=(a,e)=>{var h={};for(var b in a)P.call(a,b)&&e.indexOf(b)<0&&(h[b]=a[b]);if(a!=null&&V)for(var b of V(a))e.indexOf(b)<0&&v.call(a,b)&&(h[b]=a[b]);return h};var b="",_=(t,o)=>{const n=t.__vccOpts||t;for(const[s,i]of o)n[s]=i;return n};const q={},K={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},G=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16 17l-4 4m0 0l-4-4m4 4V3"},null,-1)];function U(t,o){return e.openBlock(),e.createElementBlock("svg",K,G)}var H=_(q,[["render",U]]),W=Object.freeze(Object.defineProperty({__proto__:null,default:H},Symbol.toStringTag,{value:"Module"}));const X={},Y={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},J=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 16l-4-4m0 0l4-4m-4 4h18"},null,-1)];function Q(t,o){return e.openBlock(),e.createElementBlock("svg",Y,J)}var Z=_(X,[["render",Q]]),x=Object.freeze(Object.defineProperty({__proto__:null,default:Z},Symbol.toStringTag,{value:"Module"}));const ee={},te={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},oe=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"},null,-1)];function ne(t,o){return e.openBlock(),e.createElementBlock("svg",te,oe)}var re=_(ee,[["render",ne]]),le=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"}));const se={},ae={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ie=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8 7l4-4m0 0l4 4m-4-4v18"},null,-1)];function ce(t,o){return e.openBlock(),e.createElementBlock("svg",ae,ie)}var de=_(se,[["render",ce]]),_e=Object.freeze(Object.defineProperty({__proto__:null,default:de},Symbol.toStringTag,{value:"Module"}));const me={},pe={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ue=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)];function fe(t,o){return e.openBlock(),e.createElementBlock("svg",pe,ue)}var he=_(me,[["render",fe]]),ke=Object.freeze(Object.defineProperty({__proto__:null,default:he},Symbol.toStringTag,{value:"Module"}));const be={},ge={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},$e=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 13l4 4L19 7"},null,-1)];function ye(t,o){return e.openBlock(),e.createElementBlock("svg",ge,$e)}var Be=_(be,[["render",ye]]),we=Object.freeze(Object.defineProperty({__proto__:null,default:Be},Symbol.toStringTag,{value:"Module"}));const Se={},Ce={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Ve=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19l-7-7 7-7"},null,-1)];function Ee(t,o){return e.openBlock(),e.createElementBlock("svg",Ce,Ve)}var Me=_(Se,[["render",Ee]]),Ne=Object.freeze(Object.defineProperty({__proto__:null,default:Me},Symbol.toStringTag,{value:"Module"}));const Ie={},je={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ze=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 5l7 7-7 7"},null,-1)];function Fe(t,o){return e.openBlock(),e.createElementBlock("svg",je,ze)}var Oe=_(Ie,[["render",Fe]]),Le=Object.freeze(Object.defineProperty({__proto__:null,default:Oe},Symbol.toStringTag,{value:"Module"}));const Ae={},De={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Te=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)];function Pe(t,o){return e.openBlock(),e.createElementBlock("svg",De,Te)}var ve=_(Ae,[["render",Pe]]),Re=Object.freeze(Object.defineProperty({__proto__:null,default:ve},Symbol.toStringTag,{value:"Module"}));const qe={},Ke={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Ge=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)];function Ue(t,o){return e.openBlock(),e.createElementBlock("svg",Ke,Ge)}var He=_(qe,[["render",Ue]]),We=Object.freeze(Object.defineProperty({__proto__:null,default:He},Symbol.toStringTag,{value:"Module"}));const Xe={},Ye={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Je=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function Qe(t,o){return e.openBlock(),e.createElementBlock("svg",Ye,Je)}var Ze=_(Xe,[["render",Qe]]),xe=Object.freeze(Object.defineProperty({__proto__:null,default:Ze},Symbol.toStringTag,{value:"Module"}));const et={},tt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ot=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4v16m8-8H4"},null,-1)];function nt(t,o){return e.openBlock(),e.createElementBlock("svg",tt,ot)}var rt=_(et,[["render",nt]]),lt=Object.freeze(Object.defineProperty({__proto__:null,default:rt},Symbol.toStringTag,{value:"Module"}));const st={},at={fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},it=[e.createElementVNode("path",{d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},null,-1)];function ct(t,o){return e.openBlock(),e.createElementBlock("svg",at,it)}var dt=_(st,[["render",ct]]),_t=Object.freeze(Object.defineProperty({__proto__:null,default:dt},Symbol.toStringTag,{value:"Module"})),Kn="";const mt={},pt=t=>(e.pushScopeId("data-v-683816b2"),t=t(),e.popScopeId(),t),ut={class:"IconSpinner",fill:"none",stroke:"currentColor",viewBox:"0 0 25 25",xmlns:"http://www.w3.org/2000/svg"},ft=[pt(()=>e.createElementVNode("path",{d:"M23.5 12.5c0 6.1-4.9 11-11 11s-11-4.9-11-11 4.9-11 11-11","shape-rendering":"geometricPrecision",style:{"stroke-width":"2","stroke-miterlimit":"10",stroke:"currentColor",fill:"none"},"vector-effect":"non-scaling-stroke"},null,-1))];function ht(t,o){return e.openBlock(),e.createElementBlock("svg",ut,ft)}var kt=_(mt,[["render",ht],["__scopeId","data-v-683816b2"]]),bt=Object.freeze(Object.defineProperty({__proto__:null,default:kt},Symbol.toStringTag,{value:"Module"}));const gt={},$t={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},yt=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"},null,-1)];function Bt(t,o){return e.openBlock(),e.createElementBlock("svg",$t,yt)}var wt=_(gt,[["render",Bt]]),St=Object.freeze(Object.defineProperty({__proto__:null,default:wt},Symbol.toStringTag,{value:"Module"}));const Ct={},Vt={"aria-hidden":"true",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Et=[e.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},null,-1)];function Mt(t,o){return e.openBlock(),e.createElementBlock("svg",Vt,Et)}var Nt=_(Ct,[["render",Mt]]),It=Object.freeze(Object.defineProperty({__proto__:null,default:Nt},Symbol.toStringTag,{value:"Module"}));function jt(t,o){var n;return(n=Object.entries(t).map(([s,i])=>({path:s,source:i})).find(s=>s.path.endsWith(`/${o}`)))==null?void 0:n.source.default}var Wn="";let E;function zt(t){E=t}function Ft(t){let o;return E&&(o=E(t)),o||(o=jt(Ot,`${t}.vue`)),o}const Ot={"../icons/arrow-narrow-down.vue":W,"../icons/arrow-narrow-left.vue":x,"../icons/arrow-narrow-right.vue":le,"../icons/arrow-narrow-up.vue":_e,"../icons/check-circle.vue":ke,"../icons/check.vue":we,"../icons/chevron-left.vue":Ne,"../icons/chevron-right.vue":Le,"../icons/exclamation-circle.vue":Re,"../icons/exclamation.vue":We,"../icons/minus.vue":xe,"../icons/plus.vue":lt,"../icons/search.vue":_t,"../icons/spinner.vue":bt,"../icons/trash.vue":St,"../icons/x.vue":It};var y=_(e.defineComponent({name:"Icon",props:{name:{type:String,required:!0}},setup(t){const o=t,n=e.shallowRef(void 0);return e.watch(()=>o.name,()=>n.value=Ft(o.name),{immediate:!0}),(s,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n)),{class:"Icon"}))}}),[["__scopeId","data-v-cc79c81e"]]),Yn="";const Lt=e.defineComponent({components:{Icon:y},props:{breadcrumbs:{type:Object,default:()=>({})}}}),At={class:"Breadcrumbs"};function Dt(t,o,n,s,i,m){const r=e.resolveComponent("router-link"),l=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",At,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.breadcrumbs,(c,d,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"Breadcrumbs__breadcrumb"},[e.createVNode(r,{to:c,class:"Breadcrumbs__link"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d),1)]),_:2},1032,["to"]),e.createVNode(l,{name:"chevron-right",class:"Breadcrumbs__arrow"})]))),128))])}var Tt=_(Lt,[["render",Dt],["__scopeId","data-v-357000f6"]]),Jn="";const Pt=["normal","small"],vt=["default","primary","secondary","danger"];var Qn="";const Rt=e.defineComponent({components:{Icon:y},inheritAttrs:!1,props:{size:{type:String,default:"normal",validator:t=>Pt.includes(t)},variant:{type:String,default:"default",validator:t=>vt.includes(t)},prefixIcon:{type:String,default:""},suffixIcon:{type:String,default:""},label:{type:String,default:""},active:Boolean,loading:Boolean,block:Boolean,disabled:Boolean},computed:{component(){return this.$attrs.to?"router-link":this.$attrs.href?"a":"button"},classModifiers(){const t=[this.size,this.variant];return this.active&&t.push("active"),this.loading&&t.push("loading"),this.disabled&&t.push("disabled"),t.map(o=>`vuiii-button--${o}`)}}}),qt={key:1};function Kt(t,o,n,s,i,m){const r=e.resolveComponent("Icon");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.component),e.mergeProps({class:["Button vuiii-button",[t.classModifiers,{"Button--block":t.block},{"vuiii-button--disabled":t.$attrs.disabled}]]},t.$attrs,{type:t.component==="button"?"button":t.$attrs.type}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"prefix",{},()=>[t.prefixIcon&&!t.loading?(e.openBlock(),e.createBlock(r,{key:0,class:e.normalizeClass(["Button__icon Button__icon--prefix",[`Button__icon--${t.size}`]]),name:t.prefixIcon},null,8,["class","name"])):e.createCommentVNode("",!0)],!0),t.loading?(e.openBlock(),e.createBlock(r,{key:0,class:e.normalizeClass(["Button__icon Button__icon--prefix",[`Button__icon--${t.size}`]]),name:"spinner"},null,8,["class"])):e.createCommentVNode("",!0),t.$slots.default||t.label?(e.openBlock(),e.createElementBlock("span",qt,[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)],!0)])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"suffix",{},()=>[t.suffixIcon?(e.openBlock(),e.createBlock(r,{key:0,class:e.normalizeClass(["Button__icon Button__icon--suffix",[`Button__icon--${t.size}`]]),name:t.suffixIcon},null,8,["class","name"])):e.createCommentVNode("",!0)],!0)]),_:3},16,["class","type"])}var M=_(Rt,[["render",Kt],["__scopeId","data-v-24bf0302"]]),Zn="";const Gt=t=>t.target.getAttribute("type")==="number"?t.target.valueAsNumber:t.target.getAttribute("type")==="checkbox"?t.target.checked:t.target.value,w=e.defineComponent({emits:["update:modelValue"],computed:{normalizedAttrs(){const n=this.$attrs,{class:t}=n,o=R(n,["class"]);return B($({},o),{onInput:s=>this.$emit("update:modelValue",Gt(s))})}}});var xn="";const Ut=e.defineComponent({mixins:[w],inheritAttrs:!1,props:{modelValue:Boolean,required:Boolean,switch:Boolean,caption:{type:String,default:""}}}),Ht=t=>(e.pushScopeId("data-v-18ef5cd1"),t=t(),e.popScopeId(),t),Wt=["checked","required"],Xt=[Ht(()=>e.createElementVNode("div",{class:"Checkbox__switchDot"},null,-1))],Yt={key:1,class:"Checkbox__label"},Jt={key:0,class:"Checkbox__required"};function Qt(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["Checkbox",[t.$attrs.class,{"Checkbox--disabled":t.$attrs.disabled}]])},[e.withDirectives(e.createElementVNode("input",e.mergeProps(t.normalizedAttrs,{checked:t.modelValue,class:"Checkbox__input vuiii-input",required:t.required,type:"checkbox"}),null,16,Wt),[[e.vShow,!t.$props.switch]]),t.$props.switch?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["Checkbox__switch",{"Checkbox__switch--active":t.modelValue}])},Xt,2)):e.createCommentVNode("",!0),t.$slots.default||t.caption?(e.openBlock(),e.createElementBlock("div",Yt,[t.required?(e.openBlock(),e.createElementBlock("span",Jt,"*")):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.caption),1)],!0)])):e.createCommentVNode("",!0)],2)}var j=_(Ut,[["render",Qt],["__scopeId","data-v-18ef5cd1"]]);function C(t,o){return typeof o=="function"?o(t):o||o===0?t[o]:t}function N(t,o={}){return Array.isArray(t)?t.map(n=>({value:C(n,o.value),label:C(n,o.label),description:o.description&&C(n,o.description),disabled:o.disabled&&C(n,o.disabled)})):Object.entries(t||{}).reduce((n,[s,i])=>n.concat({value:s,label:i}),[])}var tr="";const Zt=e.defineComponent({components:{Checkbox:j},props:{modelValue:{type:Array,default:()=>[]},options:{type:[Array,Object],required:!0},optionLabelKey:{type:[Function,String,Number],default:void 0},optionValueKey:{type:[Function,String,Number],default:void 0},optionDisabledKey:{type:[Function,String,Number],default:void 0}},emits:["update:modelValue"],computed:{normalizedOptions(){return N(this.options,{value:this.optionValueKey,label:this.optionLabelKey,disabled:this.optionDisabledKey})},checkedValues(){return this.modelValue.reduce((t,o)=>B($({},t),{[o]:!0}),{})}},methods:{toggleCheckedValue(t){const o=B($({},this.checkedValues),{[t]:!this.checkedValues[t]}),n=Object.entries(o).filter(([s,i])=>i).map(([s])=>s);this.$emit("update:modelValue",n)}}}),xt={class:"CheckboxGroup"};function eo(t,o,n,s,i,m){const r=e.resolveComponent("Checkbox");return e.openBlock(),e.createElementBlock("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedOptions,l=>(e.openBlock(),e.createElementBlock("div",{key:l.value},[e.createVNode(r,{disabled:l.disabled,"model-value":t.checkedValues[l.value],caption:l.label,"onUpdate:modelValue":c=>t.toggleCheckedValue(l.value)},null,8,["disabled","model-value","caption","onUpdate:modelValue"])]))),128))])}var to=_(Zt,[["render",eo],["__scopeId","data-v-1a9cd604"]]),or="";const oo=e.defineComponent({props:{label:{type:String,default:""},error:{type:[String,Array,Boolean],default:""},description:{type:String,default:""},hint:{type:String,default:""},required:Boolean},computed:{errorMessage(){return Array.isArray(this.error)?this.error.filter(Boolean).join(" "):typeof this.error=="string"?this.error:""}}}),no={key:0,class:"FormGroup__header"},ro={class:"FormGroup__label"},lo={key:0,class:"FormGroup__required"},so={key:1,class:"FormGroup__description"},ao={key:2,class:"FormGroup__hint"},io={key:3,class:"FormGroup__error"};function co(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["FormGroup",{"FormGroup--invalid":t.error}])},[t.label?(e.openBlock(),e.createElementBlock("div",no,[e.createElementVNode("label",ro,e.toDisplayString(t.label),1),t.required?(e.openBlock(),e.createElementBlock("div",lo,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.$slots.description||t.description?(e.openBlock(),e.createElementBlock("div",so,[e.renderSlot(t.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(t.description),1)],!0)])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default",{},void 0,!0),t.$slots.hint||t.hint?(e.openBlock(),e.createElementBlock("div",ao,[e.renderSlot(t.$slots,"hint",{},()=>[e.createTextVNode(e.toDisplayString(t.hint),1)],!0)])):e.createCommentVNode("",!0),t.errorMessage?(e.openBlock(),e.createElementBlock("div",io,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)],2)}var z=_(oo,[["render",co],["__scopeId","data-v-2a74e30e"]]),nr="";const _o=e.defineComponent({components:{FormGroup:z},props:{fields:{type:Object,default:()=>({})},modelValue:{type:Object,default:()=>({})},errors:{type:Object,default:()=>({})}},emits:["update:modelValue"],methods:{getFieldValue(t){var n;return(((n=this.fields[t].value)==null?void 0:n.getter)||(s=>s[t]))(this.modelValue)},setFieldValue(t,o){var i;const s=(((i=this.fields[t].value)==null?void 0:i.setter)||((m,r)=>B($({},r),{[t]:m})))(o,this.modelValue);this.$emit("update:modelValue",s)}}}),mo={class:"FormFields"};function po(t,o,n,s,i,m){const r=e.resolveComponent("FormGroup");return e.openBlock(),e.createElementBlock("div",mo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,(l,c)=>{var d;return e.openBlock(),e.createBlock(r,{key:c,label:l.label,description:l.description,hint:l.hint,required:l.required,error:(d=t.errors)==null?void 0:d[c]},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component),e.mergeProps({"model-value":t.getFieldValue(String(c))},l.props,{"onUpdate:modelValue":f=>t.setFieldValue(String(c),f)}),null,16,["model-value","onUpdate:modelValue"]))]),_:2},1032,["label","description","hint","required","error"])}),128))])}var F=_(_o,[["render",po],["__scopeId","data-v-7f82ddf3"]]),rr="";const uo=e.defineComponent({components:{Button:M,FormFields:F,Icon:y},props:{structure:{type:Object,default:()=>({})},modelValue:{type:Object,default:()=>{}},errors:{type:Object,default:()=>({})},submit:{type:Function,default:void 0},submitLabel:{type:String,default:"Submit"},cancel:{type:[Function,Object],default:void 0},cancelLabel:{type:String,default:"Cancel"},submitting:Boolean},emits:["update:modelValue","change","submit","cancel"],methods:{handleSubmit(){var t;(t=this.submit)==null||t.call(this,this.modelValue)},handleCancel(){var t;typeof this.cancel=="function"?(t=this.cancel)==null||t.call(this):this.cancel&&this.$router.push(this.cancel)}}}),fo={class:"Form"},ho=["disabled"],ko={key:0,class:"Form__title"},bo={key:0,class:"Form__buttons"};function go(t,o,n,s,i,m){const r=e.resolveComponent("FormFields"),l=e.resolveComponent("Button"),c=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",fo,[t.modelValue?(e.openBlock(),e.createElementBlock("form",{key:0,disabled:t.submitting,onSubmit:o[3]||(o[3]=e.withModifiers(d=>{var f;return(f=t.handleSubmit)==null?void 0:f.call(t)},["prevent"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.structure,(d,f)=>(e.openBlock(),e.createElementBlock("div",{key:f},[d.title?(e.openBlock(),e.createElementBlock("div",ko,e.toDisplayString(d.title),1)):e.createCommentVNode("",!0),e.createVNode(r,{fields:d.fields,"model-value":t.modelValue,errors:t.errors,"onUpdate:modelValue":o[0]||(o[0]=p=>t.$emit("update:modelValue",p)),onChange:o[1]||(o[1]=p=>t.$emit("change",p))},null,8,["fields","model-value","errors"])]))),128)),e.renderSlot(t.$slots,"buttons",e.normalizeProps(e.guardReactiveProps({cancel:t.cancel,submit:t.submit})),()=>[t.submit||t.cancel?(e.openBlock(),e.createElementBlock("div",bo,[t.submit?(e.openBlock(),e.createBlock(l,{key:0,variant:"primary",type:"submit",label:t.submitLabel,disabled:t.submitting,"prefix-icon":t.submitting?"spinner":void 0},null,8,["label","disabled","prefix-icon"])):e.createCommentVNode("",!0),t.cancel?(e.openBlock(),e.createBlock(l,{key:1,label:t.cancelLabel,disabled:t.submitting,onClick:o[2]||(o[2]=d=>t.handleCancel())},null,8,["label","disabled"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],!0)],40,ho)):(e.openBlock(),e.createBlock(c,{key:1,name:"spinner"}))])}var $o=_(uo,[["render",go],["__scopeId","data-v-4a2acd7e"]]),lr="";const yo=["normal","small"],Bo=e.defineComponent({components:{Icon:y},mixins:[w],inheritAttrs:!1,props:{modelValue:{type:[Number,String],default:""},prefixIcon:{type:String,default:""},suffixIcon:{type:String,default:""},size:{type:String,default:"normal",validator:t=>yo.includes(t)},invalid:Boolean},computed:{hasPrefix(){return Boolean(this.$slots.prefix||this.prefixIcon)},hasSuffix(){return Boolean(this.$slots.suffix||this.suffixIcon)}}}),wo={class:"Input__icon Input__icon--left"},So=["aria-label","value"],Co={class:"Input__icon Input__icon--right"};function Vo(t,o,n,s,i,m){const r=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["Input vuiii-input",[t.$attrs.class,{"vuiii-input--invalid":t.invalid,"vuiii-input--disabled":t.$attrs.disabled,"vuiii-input--small":t.size==="small"}]]),onClick:o[0]||(o[0]=l=>t.$refs.input.focus())},[t.hasPrefix?e.renderSlot(t.$slots,"prefix",{key:0},()=>[e.createElementVNode("div",wo,[e.createVNode(r,{name:t.prefixIcon},null,8,["name"])])],!0):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref:"input","aria-label":t.$attrs.placeholder||"input"},t.normalizedAttrs,{class:"Input__nestedInput vuiii-input__nested",value:t.modelValue}),null,16,So),t.hasSuffix?e.renderSlot(t.$slots,"suffix",{key:1},()=>[e.createElementVNode("div",Co,[e.createVNode(r,{name:t.suffixIcon},null,8,["name"])])],!0):e.createCommentVNode("",!0)],2)}var Eo=_(Bo,[["render",Vo],["__scopeId","data-v-6a6438b5"]]),sr="";const Mo=e.defineComponent({components:{Icon:y},props:{title:{type:String,default:""},width:{type:[Number,String],default:600},hideCloser:Boolean,scroll:Boolean,plain:Boolean},computed:{hasHeader(){return Boolean(this.$slots.header||this.title)},hasFooter(){return Boolean(this.$slots.footer)},computedStyle(){const t=this.width+(Number(this.width)?"px":"");return t&&t!=="auto"?{width:"100%",maxWidth:t}:{}}},methods:{close(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape"}))}}}),No={key:1,class:"ModalLayout__header"},Io={class:"ModalLayout__title"},jo={class:"ModalLayout__body"},zo={key:2,class:"ModalLayout__footer"};function Fo(t,o,n,s,i,m){const r=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ModalLayout",{hasHeader:t.hasHeader,hasFooter:t.hasFooter,isScrollable:t.scroll,isPlain:t.plain}]),style:e.normalizeStyle(t.computedStyle)},[t.hideCloser?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"ModalLayout__close",onClick:o[0]||(o[0]=l=>t.close())},[e.createVNode(r,{name:"x",class:"ModalLayout__closeIcon"})])),t.hasHeader?(e.openBlock(),e.createElementBlock("div",No,[e.renderSlot(t.$slots,"header",{},()=>[e.createElementVNode("div",Io,e.toDisplayString(t.title),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",jo,[e.renderSlot(t.$slots,"default",{},void 0,!0)]),t.hasFooter?(e.openBlock(),e.createElementBlock("div",zo,[e.renderSlot(t.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],6)}var O=_(Mo,[["render",Fo],["__scopeId","data-v-386279ac"]]),ar="";let Oo=1;const Lo=e.defineComponent({mixins:[w],inheritAttrs:!1,props:{modelValue:{type:[String,Number],default:void 0},options:{type:[Array,Object],required:!0},optionLabelKey:{type:[Function,String,Number],default:void 0},optionValueKey:{type:[Function,String,Number],default:void 0},optionDisabledKey:{type:[Function,String,Number],default:void 0},required:Boolean},emits:["update:modelValue"],data(){return{inputName:"vuiii-radio-input-"+Oo++}},computed:{normalizedOptions(){return N(this.options,{value:this.optionValueKey,label:this.optionLabelKey,disabled:this.optionDisabledKey})}}}),Ao={class:"Radio"},Do=["value","checked","required","name","disabled"],To={class:"Radio__label"};function Po(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("div",Ao,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedOptions,r=>(e.openBlock(),e.createElementBlock("label",{key:r.value,class:e.normalizeClass(["Radio__option",{"Radio--disabled":r.disabled}])},[e.createElementVNode("input",e.mergeProps(t.normalizedAttrs,{value:r.value,checked:t.modelValue===r.value,class:"Radio__input vuiii-input",required:t.required,type:"Radio",name:t.inputName,disabled:r.disabled}),null,16,Do),e.createElementVNode("div",To,[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(r.label),1)],!0)])],2))),128))])}var vo=_(Lo,[["render",Po],["__scopeId","data-v-0251715f"]]);const Ro=["normal","small"],qo=e.defineComponent({mixins:[w],props:{modelValue:{type:[String,Number,Object],default:""},options:{type:[Array,Object],default:()=>[]},optionLabelKey:{type:[Function,String,Number],default:void 0},optionValueKey:{type:[Function,String,Number],default:void 0},optionDisabledKey:{type:[Function,String,Number],default:void 0},placeholder:{type:String,default:""},size:{type:String,default:"normal",validator:t=>Ro.includes(t)},allowEmpty:Boolean},computed:{normalizedOptions(){return N(this.options,{value:this.optionValueKey,label:this.optionLabelKey,disabled:this.optionDisabledKey})}}}),Ko=["value"],Go=["disabled"],Uo=["disabled","value"];function Ho(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("select",e.mergeProps({class:"Select vuiii-input"},t.normalizedAttrs,{class:[t.$attrs.class,{"vuiii-input--small":t.size==="small"}],value:t.modelValue}),[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,disabled:!t.allowEmpty,selected:"",value:""},e.toDisplayString(t.placeholder),9,Go)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedOptions,r=>(e.openBlock(),e.createElementBlock("option",{key:r.value,disabled:r.disabled,value:r.value},e.toDisplayString(r.label),9,Uo))),128))],16,Ko)}var Wo=_(qo,[["render",Ho]]),ir="",cr="";const Xo=e.defineComponent({props:{items:{type:Array,default:()=>[]},columns:{type:Object,default:null},rowClass:{type:[String,Function],default:null}},computed:{normalizedColumns(){return Object.entries(this.columns).reduce((t,[o,n])=>B($({},t),{[o]:typeof n=="string"?{label:n}:n}),{})}},methods:{formatValue(t,o){const n=this.normalizedColumns[o],s=typeof n.value=="function"?n.value(t):t[o];return n.format?n.format(s):s},resolveRowClass(t){return typeof this.rowClass=="function"?this.rowClass(t):this.rowClass}}}),Yo={class:"vuiii-table vuiii-table--hover"},Jo=["width"];function Qo(t,o,n,s,i,m){const r=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("table",Yo,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedColumns,(l,c)=>(e.openBlock(),e.createElementBlock("th",{key:c,style:e.normalizeStyle({textAlign:l.align||"left"}),width:l.width},e.toDisplayString(l.label),13,Jo))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(l,c)=>(e.openBlock(),e.createElementBlock("tr",{key:c,class:e.normalizeClass(t.resolveRowClass(l))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedColumns,(d,f)=>(e.openBlock(),e.createElementBlock("td",{key:f,style:e.normalizeStyle({textAlign:d.align||"left"})},[e.renderSlot(t.$slots,f,e.normalizeProps(e.guardReactiveProps({item:l})),()=>[d.href?(e.openBlock(),e.createBlock(r,{key:0,class:"vuiii-link",to:d.href(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.formatValue(l,f)),1)]),_:2},1032,["to"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.formatValue(l,f)),1)],64))])],4))),128))],2))),128))])])}var Zo=_(Xo,[["render",Qo]]);const xo=e.defineComponent({mixins:[w],props:{modelValue:{type:String,default:""}}});function en(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("textarea",e.mergeProps({class:"Textarea vuiii-input"},t.normalizedAttrs),null,16)}var tn=_(xo,[["render",en]]),dr="";const on=e.defineComponent({components:{ModalLayout:O,Button:M},props:{title:{type:String,default:""},message:{type:String,default:""},buttons:{type:Array,default:()=>[]}},emits:["close"]}),nn={class:"ModalLayoutDialog__buttons"};function rn(t,o,n,s,i,m){var c;const r=e.resolveComponent("Button"),l=e.resolveComponent("ModalLayout");return e.openBlock(),e.createBlock(l,{class:"ModalLayoutDialog",width:"480",title:t.title},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["ModalLayoutDialog__message",{"ModalLayoutDialog__message--offset":!t.title}])},e.toDisplayString(t.message),3)]),_:2},[(c=t.buttons)!=null&&c.length?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",nn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,(d,f)=>(e.openBlock(),e.createElementBlock("span",{key:f,class:"ModalLayoutDialog__buttonWrapper"},[e.createVNode(r,{type:"button",variant:d.variant,"prefix-icon":d.icon,autofocus:"",onClick:p=>t.$emit("close",d.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["variant","prefix-icon","onClick"])]))),128))])])}:void 0]),1032,["title"])}var ln=_(on,[["render",rn],["__scopeId","data-v-612c6cb9"]]),_r="";const sn=e.defineComponent({props:{modals:{type:Array,default:()=>[]}},emits:["closeModal"],data(){return{modalInstances:{},registerReference(t){return o=>this.modalInstances[t]=o}}},computed:{activeModal(){return this.modals.length?this.modals[this.modals.length-1]:null}},mounted(){window.addEventListener("keydown",this.closeActiveModalByEscapeKey)},beforeUnmount(){window.removeEventListener("keydown",this.closeActiveModalByEscapeKey)},methods:{closeModal(t,o){var i;const n=()=>{this.$emit("closeModal",{modal:t,result:o})},s=this.modalInstances[t.id].$el;(i=s.$attrs)!=null&&i.onBeforeClose?s.$attrs.onBeforeClose(n):n()},closeActiveModal(){this.activeModal&&this.closeModal(this.activeModal)},closeActiveModalByEscapeKey(t){this.activeModal&&t.key==="Escape"&&!t.defaultPrevented&&(t.preventDefault(),this.closeActiveModal())},closeModalByBackdropClick(t,o){t.target===t.currentTarget&&this.closeModal(o)}}}),an={class:"ModalStack"},cn={key:0,class:"ModalStack__backdrop"},dn=["onClick"];function _n(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("div",an,[e.createVNode(e.Transition,{name:"ModalStack__backdrop"},{default:e.withCtx(()=>[t.modals.length?(e.openBlock(),e.createElementBlock("div",cn)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{name:"ModalStack__modal"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.modals,r=>{var l;return e.openBlock(),e.createElementBlock("div",{key:r.id,class:"ModalStack__modalWrapper",onClick:c=>t.closeModalByBackdropClick(c,r)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.component),e.mergeProps(r.props,{ref_for:!0,ref:t.registerReference(r.id),class:["ModalStack__modal",{isActive:((l=t.activeModal)==null?void 0:l.id)===r.id}],onClose:c=>t.closeModal(r,c)}),null,16,["class","onClose"]))],8,dn)}),128))]),_:1})])}var mn=_(sn,[["render",_n],["__scopeId","data-v-2f4ee2c2"]]);const pn={cancelLabel:"Cancel",confirmLabel:"OK"},un=(t,o={})=>{let n=1;o=$($({},pn),o);const s=e.reactive({modals:[]}),i=(p,u)=>{var k;s.modals=s.modals.filter(({id:g})=>g!==p.id),p.resolve(u),(k=p.focusElement)==null||k.focus()},m=e.createApp({parent:t,data(){return s},render(){return e.h(mn,{modals:s.modals,onCloseModal:({modal:p,result:u})=>i(p,u)})}}),r=document.createElement("div");document.body.appendChild(r),m.mount(r);const l=(p,u)=>{var g;const k=document.activeElement;return(g=k.blur)==null||g.call(k),new Promise(S=>{s.modals.push({id:n++,component:p,props:u,resolve:S,focusElement:k})})},c=p=>l(ln,p),d=p=>{typeof p=="string"&&(p={message:p});const{title:u,message:k,confirmVariant:g,confirmLabel:S=o.confirmLabel,confirmIcon:I}=p;return c({title:u,message:k,buttons:[{variant:g||"primary",label:S||"",icon:I}]})},f=p=>{typeof p=="string"&&(p={message:p});const{title:u,message:k,cancelLabel:g=o.cancelLabel,cancelVariant:S,cancelIcon:I,confirmLabel:Sn=o.confirmLabel,confirmVariant:Cn,confirmIcon:Vn}=p;return c({title:u,message:k,buttons:[{variant:S,label:g||"",icon:I,value:!1},{variant:Cn||"primary",label:Sn||"",icon:Vn,value:!0}]})};t.config.globalProperties.$modal={open:l,dialog:c,alert:d,confirm:f}};function L(){var t;return(t=e.getCurrentInstance())==null?void 0:t.appContext.config.globalProperties.$modal}var mr="";const fn=e.defineComponent({components:{Icon:y},props:{messages:{type:Array,default:()=>[]}},emits:["remove-message"],computed:{messagesInReverse(){return[...this.messages].reverse()}}}),hn={class:"Snackbar"},kn=["onClick"];function bn(t,o,n,s,i,m){const r=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",hn,[e.createVNode(e.TransitionGroup,{name:"Snackbar__transition"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.messagesInReverse,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:l.id,class:"Snackbar__message"},[e.createElementVNode("div",{class:"Snackbar__messageWrapper",style:e.normalizeStyle({transform:`translateY(-${100*c}%)`})},[e.createElementVNode("div",{class:e.normalizeClass(["Snackbar__messageBlock",`Snackbar__messageBlock--${l.type}`])},[e.createElementVNode("div",null,e.toDisplayString(l.text),1),e.createElementVNode("div",{class:"Snackbar__messageClose",onClick:d=>t.$emit("remove-message",l.id)},[e.createVNode(r,{class:"Snackbar__messageCloseIcon",name:"x"})],8,kn)],2)],4)]))),128))]),_:1})])}var gn=_(fn,[["render",bn],["__scopeId","data-v-272e7ab3"]]);const $n=1e4,yn=5,Bn=t=>{let o=1;const n=e.reactive({messages:[]}),s=l=>{n.messages=n.messages.filter(({id:c})=>c!==l)},i=e.createApp({parent:t,data(){return n},render(){return e.h(gn,{messages:this.messages,onRemoveMessage:s})}}),m=document.createElement("div");document.body.appendChild(m),i.mount(m);const r=(l,c="success",d=$n)=>{const f=o++;n.messages.push({text:l,type:c,id:f}),n.messages.length>yn&&n.messages.shift(),d>0&&setTimeout(()=>s(f),d)};t.config.globalProperties.$snackbar={success:l=>r(l,"success"),error:l=>r(l,"error",0)}};function A(){var t;return(t=e.getCurrentInstance())==null?void 0:t.appContext.config.globalProperties.$snackbar}function D(t,o={}){const n=A(),s=L(),i=h.useRouter(),m=e.ref(!1),r=e.ref(),l=e.ref(Object.freeze({})),c=async d=>{var f,p;if(!(o.confirm&&s&&!await s.confirm(typeof o.confirm=="function"?o.confirm(d):o.confirm))){if(o.validator){const u=await o.validator(d);if((f=o.onValidation)==null||f.call(o,u),!u||typeof u=="object"&&(l.value=(u==null?void 0:u.errors)||{},!(u!=null&&u.isValid)))return}m.value=!0;try{r.value=await t(d)}catch(u){if(o.errorMessage&&n&&n.error(typeof o.errorMessage=="function"?o.errorMessage(u,d):o.errorMessage||u.message),m.value=!1,o.onError&&o.onError({error:u,data:d,router:i,snackbar:n}))return;throw u}return m.value=!1,o.successMessage&&n&&n.success(typeof o.successMessage=="function"?o.successMessage(r.value,d):o.successMessage),(p=o.onSuccess)==null||p.call(o,{result:r.value,data:d,router:i,snackbar:n}),o.redirectOnSuccess&&i.push(typeof o.redirectOnSuccess=="function"?o.redirectOnSuccess(r.value,d):o.redirectOnSuccess),r.value}};return o.immediate&&e.onMounted(c),{submit:c,errors:l,result:r,isSubmitting:m}}const wn=(t,o={})=>{const{isSubmitting:n,submit:s,result:i}=D(t,{onSuccess:({router:m,data:r,result:l})=>{var c;return(c=o.onSuccess)==null?void 0:c.call(o,{data:l,params:r,router:m})},onError:({router:m,error:r,data:l})=>{var c;return(c=o.onError)==null?void 0:c.call(o,{error:r,params:l,router:m})},successMessage:o.successMessage,errorMessage:o.errorMessage,immediate:o.immediate});return{load:s,isLoading:n,data:i}};a.Breadcrumbs=Tt,a.Button=M,a.Checkbox=j,a.CheckboxGroup=to,a.Form=$o,a.FormFields=F,a.FormGroup=z,a.Icon=y,a.Input=Eo,a.ModalLayout=O,a.Radio=vo,a.Select=Wo,a.Table=Zo,a.Textarea=tn,a.modal=un,a.registerCustomIconResolver=zt,a.snackbar=Bn,a.useLoadData=wn,a.useModal=L,a.useSnackbar=A,a.useSubmitAction=D,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a.vui={},a.Vue,a.VueRouter))})(this,function(a,e,h){"use strict";var En=Object.defineProperty,Mn=Object.defineProperties;var Nn=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var T=(a,e,h)=>e in a?En(a,e,{enumerable:!0,configurable:!0,writable:!0,value:h}):a[e]=h,$=(a,e)=>{for(var h in e||(e={}))P.call(e,h)&&T(a,h,e[h]);if(V)for(var h of V(e))v.call(e,h)&&T(a,h,e[h]);return a},B=(a,e)=>Mn(a,Nn(e));var R=(a,e)=>{var h={};for(var b in a)P.call(a,b)&&e.indexOf(b)<0&&(h[b]=a[b]);if(a!=null&&V)for(var b of V(a))e.indexOf(b)<0&&v.call(a,b)&&(h[b]=a[b]);return h};var b="",_=(t,o)=>{const n=t.__vccOpts||t;for(const[s,i]of o)n[s]=i;return n};const q={},K={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},G=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16 17l-4 4m0 0l-4-4m4 4V3"},null,-1)];function U(t,o){return e.openBlock(),e.createElementBlock("svg",K,G)}var H=_(q,[["render",U]]),W=Object.freeze(Object.defineProperty({__proto__:null,default:H},Symbol.toStringTag,{value:"Module"}));const X={},Y={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},J=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 16l-4-4m0 0l4-4m-4 4h18"},null,-1)];function Q(t,o){return e.openBlock(),e.createElementBlock("svg",Y,J)}var Z=_(X,[["render",Q]]),x=Object.freeze(Object.defineProperty({__proto__:null,default:Z},Symbol.toStringTag,{value:"Module"}));const ee={},te={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},oe=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"},null,-1)];function ne(t,o){return e.openBlock(),e.createElementBlock("svg",te,oe)}var re=_(ee,[["render",ne]]),le=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"}));const se={},ae={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ie=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8 7l4-4m0 0l4 4m-4-4v18"},null,-1)];function ce(t,o){return e.openBlock(),e.createElementBlock("svg",ae,ie)}var de=_(se,[["render",ce]]),_e=Object.freeze(Object.defineProperty({__proto__:null,default:de},Symbol.toStringTag,{value:"Module"}));const me={},pe={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ue=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)];function fe(t,o){return e.openBlock(),e.createElementBlock("svg",pe,ue)}var he=_(me,[["render",fe]]),ke=Object.freeze(Object.defineProperty({__proto__:null,default:he},Symbol.toStringTag,{value:"Module"}));const be={},ge={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},$e=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 13l4 4L19 7"},null,-1)];function ye(t,o){return e.openBlock(),e.createElementBlock("svg",ge,$e)}var Be=_(be,[["render",ye]]),we=Object.freeze(Object.defineProperty({__proto__:null,default:Be},Symbol.toStringTag,{value:"Module"}));const Se={},Ce={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Ve=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19l-7-7 7-7"},null,-1)];function Ee(t,o){return e.openBlock(),e.createElementBlock("svg",Ce,Ve)}var Me=_(Se,[["render",Ee]]),Ne=Object.freeze(Object.defineProperty({__proto__:null,default:Me},Symbol.toStringTag,{value:"Module"}));const Ie={},je={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ze=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 5l7 7-7 7"},null,-1)];function Fe(t,o){return e.openBlock(),e.createElementBlock("svg",je,ze)}var Oe=_(Ie,[["render",Fe]]),Le=Object.freeze(Object.defineProperty({__proto__:null,default:Oe},Symbol.toStringTag,{value:"Module"}));const Ae={},De={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Te=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)];function Pe(t,o){return e.openBlock(),e.createElementBlock("svg",De,Te)}var ve=_(Ae,[["render",Pe]]),Re=Object.freeze(Object.defineProperty({__proto__:null,default:ve},Symbol.toStringTag,{value:"Module"}));const qe={},Ke={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Ge=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)];function Ue(t,o){return e.openBlock(),e.createElementBlock("svg",Ke,Ge)}var He=_(qe,[["render",Ue]]),We=Object.freeze(Object.defineProperty({__proto__:null,default:He},Symbol.toStringTag,{value:"Module"}));const Xe={},Ye={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Je=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function Qe(t,o){return e.openBlock(),e.createElementBlock("svg",Ye,Je)}var Ze=_(Xe,[["render",Qe]]),xe=Object.freeze(Object.defineProperty({__proto__:null,default:Ze},Symbol.toStringTag,{value:"Module"}));const et={},tt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ot=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4v16m8-8H4"},null,-1)];function nt(t,o){return e.openBlock(),e.createElementBlock("svg",tt,ot)}var rt=_(et,[["render",nt]]),lt=Object.freeze(Object.defineProperty({__proto__:null,default:rt},Symbol.toStringTag,{value:"Module"}));const st={},at={fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},it=[e.createElementVNode("path",{d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},null,-1)];function ct(t,o){return e.openBlock(),e.createElementBlock("svg",at,it)}var dt=_(st,[["render",ct]]),_t=Object.freeze(Object.defineProperty({__proto__:null,default:dt},Symbol.toStringTag,{value:"Module"})),Kn="";const mt={},pt=t=>(e.pushScopeId("data-v-683816b2"),t=t(),e.popScopeId(),t),ut={class:"IconSpinner",fill:"none",stroke:"currentColor",viewBox:"0 0 25 25",xmlns:"http://www.w3.org/2000/svg"},ft=[pt(()=>e.createElementVNode("path",{d:"M23.5 12.5c0 6.1-4.9 11-11 11s-11-4.9-11-11 4.9-11 11-11","shape-rendering":"geometricPrecision",style:{"stroke-width":"2","stroke-miterlimit":"10",stroke:"currentColor",fill:"none"},"vector-effect":"non-scaling-stroke"},null,-1))];function ht(t,o){return e.openBlock(),e.createElementBlock("svg",ut,ft)}var kt=_(mt,[["render",ht],["__scopeId","data-v-683816b2"]]),bt=Object.freeze(Object.defineProperty({__proto__:null,default:kt},Symbol.toStringTag,{value:"Module"}));const gt={},$t={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},yt=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"},null,-1)];function Bt(t,o){return e.openBlock(),e.createElementBlock("svg",$t,yt)}var wt=_(gt,[["render",Bt]]),St=Object.freeze(Object.defineProperty({__proto__:null,default:wt},Symbol.toStringTag,{value:"Module"}));const Ct={},Vt={"aria-hidden":"true",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Et=[e.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},null,-1)];function Mt(t,o){return e.openBlock(),e.createElementBlock("svg",Vt,Et)}var Nt=_(Ct,[["render",Mt]]),It=Object.freeze(Object.defineProperty({__proto__:null,default:Nt},Symbol.toStringTag,{value:"Module"}));function jt(t,o){var n;return(n=Object.entries(t).map(([s,i])=>({path:s,source:i})).find(s=>s.path.endsWith(`/${o}`)))==null?void 0:n.source.default}var Wn="";let E;function zt(t){E=t}function Ft(t){let o;return E&&(o=E(t)),o||(o=jt(Ot,`${t}.vue`)),o}const Ot={"../icons/arrow-narrow-down.vue":W,"../icons/arrow-narrow-left.vue":x,"../icons/arrow-narrow-right.vue":le,"../icons/arrow-narrow-up.vue":_e,"../icons/check-circle.vue":ke,"../icons/check.vue":we,"../icons/chevron-left.vue":Ne,"../icons/chevron-right.vue":Le,"../icons/exclamation-circle.vue":Re,"../icons/exclamation.vue":We,"../icons/minus.vue":xe,"../icons/plus.vue":lt,"../icons/search.vue":_t,"../icons/spinner.vue":bt,"../icons/trash.vue":St,"../icons/x.vue":It};var y=_(e.defineComponent({name:"Icon",props:{name:{type:String,required:!0}},setup(t){const o=t,n=e.shallowRef(void 0);return e.watch(()=>o.name,()=>n.value=Ft(o.name),{immediate:!0}),(s,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n)),{class:"Icon"}))}}),[["__scopeId","data-v-cc79c81e"]]),Yn="";const Lt=e.defineComponent({components:{Icon:y},props:{breadcrumbs:{type:Object,default:()=>({})}}}),At={class:"Breadcrumbs"};function Dt(t,o,n,s,i,m){const r=e.resolveComponent("router-link"),l=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",At,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.breadcrumbs,(c,d,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"Breadcrumbs__breadcrumb"},[e.createVNode(r,{to:c,class:"Breadcrumbs__link"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d),1)]),_:2},1032,["to"]),e.createVNode(l,{name:"chevron-right",class:"Breadcrumbs__arrow"})]))),128))])}var Tt=_(Lt,[["render",Dt],["__scopeId","data-v-357000f6"]]),Jn="";const Pt=["normal","small"],vt=["default","primary","secondary","danger"];var Qn="";const Rt=e.defineComponent({components:{Icon:y},inheritAttrs:!1,props:{size:{type:String,default:"normal",validator:t=>Pt.includes(t)},variant:{type:String,default:"default",validator:t=>vt.includes(t)},prefixIcon:{type:String,default:""},suffixIcon:{type:String,default:""},label:{type:String,default:""},active:Boolean,loading:Boolean,block:Boolean,disabled:Boolean},computed:{component(){return this.$attrs.to?"router-link":this.$attrs.href?"a":"button"},classModifiers(){const t=[this.size,this.variant];return this.active&&t.push("active"),this.loading&&t.push("loading"),this.disabled&&t.push("disabled"),t.map(o=>`vuiii-button--${o}`)}}}),qt={key:1};function Kt(t,o,n,s,i,m){const r=e.resolveComponent("Icon");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.component),e.mergeProps({class:["Button vuiii-button",[t.classModifiers,{"Button--block":t.block},{"vuiii-button--disabled":t.$attrs.disabled}]]},t.$attrs,{type:t.component==="button"?"button":t.$attrs.type}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"prefix",{},()=>[t.prefixIcon&&!t.loading?(e.openBlock(),e.createBlock(r,{key:0,class:e.normalizeClass(["Button__icon Button__icon--prefix",[`Button__icon--${t.size}`]]),name:t.prefixIcon},null,8,["class","name"])):e.createCommentVNode("",!0)],!0),t.loading?(e.openBlock(),e.createBlock(r,{key:0,class:e.normalizeClass(["Button__icon Button__icon--prefix",[`Button__icon--${t.size}`]]),name:"spinner"},null,8,["class"])):e.createCommentVNode("",!0),t.$slots.default||t.label?(e.openBlock(),e.createElementBlock("span",qt,[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)],!0)])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"suffix",{},()=>[t.suffixIcon?(e.openBlock(),e.createBlock(r,{key:0,class:e.normalizeClass(["Button__icon Button__icon--suffix",[`Button__icon--${t.size}`]]),name:t.suffixIcon},null,8,["class","name"])):e.createCommentVNode("",!0)],!0)]),_:3},16,["class","type"])}var M=_(Rt,[["render",Kt],["__scopeId","data-v-24bf0302"]]),Zn="";const Gt=t=>t.target.getAttribute("type")==="number"?t.target.valueAsNumber:t.target.getAttribute("type")==="checkbox"?t.target.checked:t.target.value,w=e.defineComponent({emits:["update:modelValue"],computed:{normalizedAttrs(){const n=this.$attrs,{class:t}=n,o=R(n,["class"]);return B($({},o),{onInput:s=>this.$emit("update:modelValue",Gt(s))})}}});var xn="";const Ut=e.defineComponent({mixins:[w],inheritAttrs:!1,props:{modelValue:Boolean,required:Boolean,switch:Boolean,caption:{type:String,default:""}}}),Ht=t=>(e.pushScopeId("data-v-18ef5cd1"),t=t(),e.popScopeId(),t),Wt=["checked","required"],Xt=[Ht(()=>e.createElementVNode("div",{class:"Checkbox__switchDot"},null,-1))],Yt={key:1,class:"Checkbox__label"},Jt={key:0,class:"Checkbox__required"};function Qt(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["Checkbox",[t.$attrs.class,{"Checkbox--disabled":t.$attrs.disabled}]])},[e.withDirectives(e.createElementVNode("input",e.mergeProps(t.normalizedAttrs,{checked:t.modelValue,class:"Checkbox__input vuiii-input",required:t.required,type:"checkbox"}),null,16,Wt),[[e.vShow,!t.$props.switch]]),t.$props.switch?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["Checkbox__switch",{"Checkbox__switch--active":t.modelValue}])},Xt,2)):e.createCommentVNode("",!0),t.$slots.default||t.caption?(e.openBlock(),e.createElementBlock("div",Yt,[t.required?(e.openBlock(),e.createElementBlock("span",Jt,"*")):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.caption),1)],!0)])):e.createCommentVNode("",!0)],2)}var j=_(Ut,[["render",Qt],["__scopeId","data-v-18ef5cd1"]]);function C(t,o){return typeof o=="function"?o(t):o||o===0?t[o]:t}function N(t,o={}){return Array.isArray(t)?t.map(n=>({value:C(n,o.value),label:C(n,o.label),description:o.description&&C(n,o.description),disabled:o.disabled&&C(n,o.disabled)})):Object.entries(t||{}).reduce((n,[s,i])=>n.concat({value:s,label:i}),[])}var tr="";const Zt=e.defineComponent({components:{Checkbox:j},props:{modelValue:{type:Array,default:()=>[]},options:{type:[Array,Object],required:!0},optionLabelKey:{type:[Function,String,Number],default:void 0},optionValueKey:{type:[Function,String,Number],default:void 0},optionDisabledKey:{type:[Function,String,Number],default:void 0}},emits:["update:modelValue"],computed:{normalizedOptions(){return N(this.options,{value:this.optionValueKey,label:this.optionLabelKey,disabled:this.optionDisabledKey})},checkedValues(){return this.modelValue.reduce((t,o)=>B($({},t),{[o]:!0}),{})}},methods:{toggleCheckedValue(t){const o=B($({},this.checkedValues),{[t]:!this.checkedValues[t]}),n=Object.entries(o).filter(([s,i])=>i).map(([s])=>s);this.$emit("update:modelValue",n)}}}),xt={class:"CheckboxGroup"};function eo(t,o,n,s,i,m){const r=e.resolveComponent("Checkbox");return e.openBlock(),e.createElementBlock("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedOptions,l=>(e.openBlock(),e.createElementBlock("div",{key:l.value},[e.createVNode(r,{disabled:l.disabled,"model-value":t.checkedValues[l.value],caption:l.label,"onUpdate:modelValue":c=>t.toggleCheckedValue(l.value)},null,8,["disabled","model-value","caption","onUpdate:modelValue"])]))),128))])}var to=_(Zt,[["render",eo],["__scopeId","data-v-1a9cd604"]]),or="";const oo=e.defineComponent({props:{label:{type:String,default:""},error:{type:[String,Array,Boolean],default:""},description:{type:String,default:""},hint:{type:String,default:""},required:Boolean},computed:{errorMessage(){return Array.isArray(this.error)?this.error.filter(Boolean).join(" "):typeof this.error=="string"?this.error:""}}}),no={key:0,class:"FormGroup__header"},ro={class:"FormGroup__label"},lo={key:0,class:"FormGroup__required"},so={key:1,class:"FormGroup__description"},ao={key:2,class:"FormGroup__hint"},io={key:3,class:"FormGroup__error"};function co(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["FormGroup",{"FormGroup--invalid":t.error}])},[t.label?(e.openBlock(),e.createElementBlock("div",no,[e.createElementVNode("label",ro,e.toDisplayString(t.label),1),t.required?(e.openBlock(),e.createElementBlock("div",lo,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.$slots.description||t.description?(e.openBlock(),e.createElementBlock("div",so,[e.renderSlot(t.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(t.description),1)],!0)])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default",{},void 0,!0),t.$slots.hint||t.hint?(e.openBlock(),e.createElementBlock("div",ao,[e.renderSlot(t.$slots,"hint",{},()=>[e.createTextVNode(e.toDisplayString(t.hint),1)],!0)])):e.createCommentVNode("",!0),t.errorMessage?(e.openBlock(),e.createElementBlock("div",io,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)],2)}var z=_(oo,[["render",co],["__scopeId","data-v-2a74e30e"]]),nr="";const _o=e.defineComponent({components:{FormGroup:z},props:{fields:{type:Object,default:()=>({})},modelValue:{type:Object,default:()=>({})},errors:{type:Object,default:()=>({})}},emits:["update:modelValue"],methods:{getFieldValue(t){var n;return(((n=this.fields[t].value)==null?void 0:n.getter)||(s=>s[t]))(this.modelValue)},setFieldValue(t,o){var i;const s=(((i=this.fields[t].value)==null?void 0:i.setter)||((m,r)=>B($({},r),{[t]:m})))(o,this.modelValue);this.$emit("update:modelValue",s)}}}),mo={class:"FormFields"};function po(t,o,n,s,i,m){const r=e.resolveComponent("FormGroup");return e.openBlock(),e.createElementBlock("div",mo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,(l,c)=>{var d;return e.openBlock(),e.createBlock(r,{key:c,label:l.label,description:l.description,hint:l.hint,required:l.required,error:(d=t.errors)==null?void 0:d[c]},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component),e.mergeProps({"model-value":t.getFieldValue(String(c))},l.props,{"onUpdate:modelValue":f=>t.setFieldValue(String(c),f)}),null,16,["model-value","onUpdate:modelValue"]))]),_:2},1032,["label","description","hint","required","error"])}),128))])}var F=_(_o,[["render",po],["__scopeId","data-v-7f82ddf3"]]),rr="";const uo=e.defineComponent({components:{Button:M,FormFields:F,Icon:y},props:{structure:{type:Object,default:()=>({})},modelValue:{type:Object,default:()=>{}},errors:{type:Object,default:()=>({})},submit:{type:Function,default:void 0},submitLabel:{type:String,default:"Submit"},cancel:{type:[Function,Object],default:void 0},cancelLabel:{type:String,default:"Cancel"},submitting:Boolean},emits:["update:modelValue","change","submit","cancel"],methods:{handleSubmit(){var t;(t=this.submit)==null||t.call(this,this.modelValue)},handleCancel(){var t;typeof this.cancel=="function"?(t=this.cancel)==null||t.call(this):this.cancel&&this.$router.push(this.cancel)}}}),fo={class:"Form"},ho=["disabled"],ko={key:0,class:"Form__title"},bo={key:0,class:"Form__buttons"};function go(t,o,n,s,i,m){const r=e.resolveComponent("FormFields"),l=e.resolveComponent("Button"),c=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",fo,[t.modelValue?(e.openBlock(),e.createElementBlock("form",{key:0,disabled:t.submitting,onSubmit:o[3]||(o[3]=e.withModifiers(d=>{var f;return(f=t.handleSubmit)==null?void 0:f.call(t)},["prevent"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.structure,(d,f)=>(e.openBlock(),e.createElementBlock("div",{key:f},[d.title?(e.openBlock(),e.createElementBlock("div",ko,e.toDisplayString(d.title),1)):e.createCommentVNode("",!0),e.createVNode(r,{fields:d.fields,"model-value":t.modelValue,errors:t.errors,"onUpdate:modelValue":o[0]||(o[0]=p=>t.$emit("update:modelValue",p)),onChange:o[1]||(o[1]=p=>t.$emit("change",p))},null,8,["fields","model-value","errors"])]))),128)),e.renderSlot(t.$slots,"buttons",e.normalizeProps(e.guardReactiveProps({cancel:t.cancel,submit:t.submit})),()=>[t.submit||t.cancel?(e.openBlock(),e.createElementBlock("div",bo,[t.submit?(e.openBlock(),e.createBlock(l,{key:0,variant:"primary",type:"submit",label:t.submitLabel,disabled:t.submitting,"prefix-icon":t.submitting?"spinner":void 0},null,8,["label","disabled","prefix-icon"])):e.createCommentVNode("",!0),t.cancel?(e.openBlock(),e.createBlock(l,{key:1,label:t.cancelLabel,disabled:t.submitting,onClick:o[2]||(o[2]=d=>t.handleCancel())},null,8,["label","disabled"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],!0)],40,ho)):(e.openBlock(),e.createBlock(c,{key:1,name:"spinner"}))])}var $o=_(uo,[["render",go],["__scopeId","data-v-4a2acd7e"]]),lr="";const yo=["normal","small"],Bo=e.defineComponent({components:{Icon:y},mixins:[w],inheritAttrs:!1,props:{modelValue:{type:[Number,String],default:""},prefixIcon:{type:String,default:""},suffixIcon:{type:String,default:""},size:{type:String,default:"normal",validator:t=>yo.includes(t)},invalid:Boolean},computed:{hasPrefix(){return Boolean(this.$slots.prefix||this.prefixIcon)},hasSuffix(){return Boolean(this.$slots.suffix||this.suffixIcon)}}}),wo={class:"Input__icon Input__icon--left"},So=["aria-label","value"],Co={class:"Input__icon Input__icon--right"};function Vo(t,o,n,s,i,m){const r=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["Input vuiii-input",[t.$attrs.class,{"vuiii-input--invalid":t.invalid,"vuiii-input--disabled":t.$attrs.disabled,"vuiii-input--small":t.size==="small"}]]),onClick:o[0]||(o[0]=l=>t.$refs.input.focus())},[t.hasPrefix?e.renderSlot(t.$slots,"prefix",{key:0},()=>[e.createElementVNode("div",wo,[e.createVNode(r,{name:t.prefixIcon},null,8,["name"])])],!0):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref:"input","aria-label":t.$attrs.placeholder||"input"},t.normalizedAttrs,{class:"Input__nestedInput vuiii-input__nested",value:t.modelValue}),null,16,So),t.hasSuffix?e.renderSlot(t.$slots,"suffix",{key:1},()=>[e.createElementVNode("div",Co,[e.createVNode(r,{name:t.suffixIcon},null,8,["name"])])],!0):e.createCommentVNode("",!0)],2)}var Eo=_(Bo,[["render",Vo],["__scopeId","data-v-6a6438b5"]]),sr="";const Mo=e.defineComponent({components:{Icon:y},props:{title:{type:String,default:""},width:{type:[Number,String],default:600},hideCloser:Boolean,scroll:Boolean,plain:Boolean},computed:{hasHeader(){return Boolean(this.$slots.header||this.title)},hasFooter(){return Boolean(this.$slots.footer)},computedStyle(){const t=this.width+(Number(this.width)?"px":"");return t&&t!=="auto"?{width:"100%",maxWidth:t}:{}}},methods:{close(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape"}))}}}),No={key:1,class:"ModalLayout__header"},Io={class:"ModalLayout__title"},jo={class:"ModalLayout__body"},zo={key:2,class:"ModalLayout__footer"};function Fo(t,o,n,s,i,m){const r=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ModalLayout",{hasHeader:t.hasHeader,hasFooter:t.hasFooter,isScrollable:t.scroll,isPlain:t.plain}]),style:e.normalizeStyle(t.computedStyle)},[t.hideCloser?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"ModalLayout__close",onClick:o[0]||(o[0]=l=>t.close())},[e.createVNode(r,{name:"x",class:"ModalLayout__closeIcon"})])),t.hasHeader?(e.openBlock(),e.createElementBlock("div",No,[e.renderSlot(t.$slots,"header",{},()=>[e.createElementVNode("div",Io,e.toDisplayString(t.title),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",jo,[e.renderSlot(t.$slots,"default",{},void 0,!0)]),t.hasFooter?(e.openBlock(),e.createElementBlock("div",zo,[e.renderSlot(t.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],6)}var O=_(Mo,[["render",Fo],["__scopeId","data-v-386279ac"]]),ar="";let Oo=1;const Lo=e.defineComponent({mixins:[w],inheritAttrs:!1,props:{modelValue:{type:[String,Number],default:void 0},options:{type:[Array,Object],required:!0},optionLabelKey:{type:[Function,String,Number],default:void 0},optionValueKey:{type:[Function,String,Number],default:void 0},optionDisabledKey:{type:[Function,String,Number],default:void 0},required:Boolean},emits:["update:modelValue"],data(){return{inputName:"vuiii-radio-input-"+Oo++}},computed:{normalizedOptions(){return N(this.options,{value:this.optionValueKey,label:this.optionLabelKey,disabled:this.optionDisabledKey})}}}),Ao={class:"Radio"},Do=["value","checked","required","name","disabled"],To={class:"Radio__label"};function Po(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("div",Ao,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedOptions,r=>(e.openBlock(),e.createElementBlock("label",{key:r.value,class:e.normalizeClass(["Radio__option",{"Radio--disabled":r.disabled}])},[e.createElementVNode("input",e.mergeProps(t.normalizedAttrs,{value:r.value,checked:t.modelValue===r.value,class:"Radio__input vuiii-input",required:t.required,type:"Radio",name:t.inputName,disabled:r.disabled}),null,16,Do),e.createElementVNode("div",To,[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(r.label),1)],!0)])],2))),128))])}var vo=_(Lo,[["render",Po],["__scopeId","data-v-0251715f"]]);const Ro=["normal","small"],qo=e.defineComponent({mixins:[w],props:{modelValue:{type:[String,Number,Object],default:""},options:{type:[Array,Object],default:()=>[]},optionLabelKey:{type:[Function,String,Number],default:void 0},optionValueKey:{type:[Function,String,Number],default:void 0},optionDisabledKey:{type:[Function,String,Number],default:void 0},placeholder:{type:String,default:""},size:{type:String,default:"normal",validator:t=>Ro.includes(t)},allowEmpty:Boolean},computed:{normalizedOptions(){return N(this.options,{value:this.optionValueKey,label:this.optionLabelKey,disabled:this.optionDisabledKey})}}}),Ko=["value"],Go=["disabled"],Uo=["disabled","value"];function Ho(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("select",e.mergeProps({class:"Select vuiii-input"},t.normalizedAttrs,{class:[t.$attrs.class,{"vuiii-input--small":t.size==="small"}],value:t.modelValue}),[t.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,disabled:!t.allowEmpty,selected:"",value:""},e.toDisplayString(t.placeholder),9,Go)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedOptions,r=>(e.openBlock(),e.createElementBlock("option",{key:r.value,disabled:r.disabled,value:r.value},e.toDisplayString(r.label),9,Uo))),128))],16,Ko)}var Wo=_(qo,[["render",Ho]]),ir="",cr="";const Xo=e.defineComponent({props:{items:{type:Array,default:()=>[]},columns:{type:Object,default:null},rowClass:{type:[String,Function],default:null}},computed:{normalizedColumns(){return Object.entries(this.columns).reduce((t,[o,n])=>B($({},t),{[o]:typeof n=="string"?{label:n}:n}),{})}},methods:{formatValue(t,o){const n=this.normalizedColumns[o],s=typeof n.value=="function"?n.value(t):t[o];return n.format?n.format(s):s},resolveRowClass(t){return typeof this.rowClass=="function"?this.rowClass(t):this.rowClass}}}),Yo={class:"vuiii-table vuiii-table--hover"},Jo=["width"];function Qo(t,o,n,s,i,m){const r=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("table",Yo,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedColumns,(l,c)=>(e.openBlock(),e.createElementBlock("th",{key:c,style:e.normalizeStyle({textAlign:l.align||"left"}),width:l.width},e.toDisplayString(l.label),13,Jo))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(l,c)=>(e.openBlock(),e.createElementBlock("tr",{key:c,class:e.normalizeClass(t.resolveRowClass(l))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedColumns,(d,f)=>(e.openBlock(),e.createElementBlock("td",{key:f,style:e.normalizeStyle({textAlign:d.align||"left"})},[e.renderSlot(t.$slots,f,e.normalizeProps(e.guardReactiveProps({item:l})),()=>[d.href?(e.openBlock(),e.createBlock(r,{key:0,class:"vuiii-link",to:d.href(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.formatValue(l,f)),1)]),_:2},1032,["to"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.formatValue(l,f)),1)],64))])],4))),128))],2))),128))])])}var Zo=_(Xo,[["render",Qo]]);const xo=e.defineComponent({mixins:[w],props:{modelValue:{type:String,default:""}}});function en(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("textarea",e.mergeProps({class:"Textarea vuiii-input"},t.normalizedAttrs),null,16)}var tn=_(xo,[["render",en]]),dr="";const on=e.defineComponent({components:{ModalLayout:O,Button:M},props:{title:{type:String,default:""},message:{type:String,default:""},buttons:{type:Array,default:()=>[]}},emits:["close"]}),nn={class:"ModalLayoutDialog__buttons"};function rn(t,o,n,s,i,m){var c;const r=e.resolveComponent("Button"),l=e.resolveComponent("ModalLayout");return e.openBlock(),e.createBlock(l,{class:"ModalLayoutDialog",width:"480",title:t.title},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["ModalLayoutDialog__message",{"ModalLayoutDialog__message--offset":!t.title}])},e.toDisplayString(t.message),3)]),_:2},[(c=t.buttons)!=null&&c.length?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",nn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,(d,f)=>(e.openBlock(),e.createElementBlock("span",{key:f,class:"ModalLayoutDialog__buttonWrapper"},[e.createVNode(r,{type:"button",variant:d.variant,"prefix-icon":d.icon,autofocus:"",onClick:p=>t.$emit("close",d.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["variant","prefix-icon","onClick"])]))),128))])])}:void 0]),1032,["title"])}var ln=_(on,[["render",rn],["__scopeId","data-v-612c6cb9"]]),_r="";const sn=e.defineComponent({props:{modals:{type:Array,default:()=>[]}},emits:["closeModal"],data(){return{modalInstances:{},registerReference(t){return o=>this.modalInstances[t]=o}}},computed:{activeModal(){return this.modals.length?this.modals[this.modals.length-1]:null}},mounted(){window.addEventListener("keydown",this.closeActiveModalByEscapeKey)},beforeUnmount(){window.removeEventListener("keydown",this.closeActiveModalByEscapeKey)},methods:{closeModal(t,o){var i;const n=()=>{this.$emit("closeModal",{modal:t,result:o})},s=this.modalInstances[t.id].$el;(i=s.$attrs)!=null&&i.onBeforeClose?s.$attrs.onBeforeClose(n):n()},closeActiveModal(){this.activeModal&&this.closeModal(this.activeModal)},closeActiveModalByEscapeKey(t){this.activeModal&&t.key==="Escape"&&!t.defaultPrevented&&(t.preventDefault(),this.closeActiveModal())},closeModalByBackdropClick(t,o){t.target===t.currentTarget&&this.closeModal(o)}}}),an={class:"ModalStack"},cn={key:0,class:"ModalStack__backdrop"},dn=["onClick"];function _n(t,o,n,s,i,m){return e.openBlock(),e.createElementBlock("div",an,[e.createVNode(e.Transition,{name:"ModalStack__backdrop"},{default:e.withCtx(()=>[t.modals.length?(e.openBlock(),e.createElementBlock("div",cn)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{name:"ModalStack__modal"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.modals,r=>{var l;return e.openBlock(),e.createElementBlock("div",{key:r.id,class:"ModalStack__modalWrapper",onClick:c=>t.closeModalByBackdropClick(c,r)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.component),e.mergeProps(r.props,{ref_for:!0,ref:t.registerReference(r.id),class:["ModalStack__modal",{isActive:((l=t.activeModal)==null?void 0:l.id)===r.id}],onClose:c=>t.closeModal(r,c)}),null,16,["class","onClose"]))],8,dn)}),128))]),_:1})])}var mn=_(sn,[["render",_n],["__scopeId","data-v-2f4ee2c2"]]);const pn={cancelLabel:"Cancel",confirmLabel:"OK"},un=(t,o={})=>{let n=1;o=$($({},pn),o);const s=e.reactive({modals:[]}),i=(p,u)=>{var k;s.modals=s.modals.filter(({id:g})=>g!==p.id),p.resolve(u),(k=p.focusElement)==null||k.focus()},m=e.createApp({parent:t,data(){return s},render(){return e.h(mn,{modals:s.modals,onCloseModal:({modal:p,result:u})=>i(p,u)})}}),r=document.createElement("div");document.body.appendChild(r),m.mount(r);const l=(p,u)=>{var g;const k=document.activeElement;return(g=k.blur)==null||g.call(k),new Promise(S=>{s.modals.push({id:n++,component:p,props:u,resolve:S,focusElement:k})})},c=p=>l(ln,p),d=p=>{typeof p=="string"&&(p={message:p});const{title:u,message:k,confirmVariant:g,confirmLabel:S=o.confirmLabel,confirmIcon:I}=p;return c({title:u,message:k,buttons:[{variant:g||"primary",label:S||"",icon:I}]})},f=p=>{typeof p=="string"&&(p={message:p});const{title:u,message:k,cancelLabel:g=o.cancelLabel,cancelVariant:S,cancelIcon:I,confirmLabel:Sn=o.confirmLabel,confirmVariant:Cn,confirmIcon:Vn}=p;return c({title:u,message:k,buttons:[{variant:S,label:g||"",icon:I,value:!1},{variant:Cn||"primary",label:Sn||"",icon:Vn,value:!0}]})};t.config.globalProperties.$modal={open:l,dialog:c,alert:d,confirm:f}};function L(){var t;return(t=e.getCurrentInstance())==null?void 0:t.appContext.config.globalProperties.$modal}var mr="";const fn=e.defineComponent({components:{Icon:y},props:{messages:{type:Array,default:()=>[]}},emits:["remove-message"],computed:{messagesInReverse(){return[...this.messages].reverse()}}}),hn={class:"Snackbar"},kn=["onClick"];function bn(t,o,n,s,i,m){const r=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",hn,[e.createVNode(e.TransitionGroup,{name:"Snackbar__transition"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.messagesInReverse,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:l.id,class:"Snackbar__message"},[e.createElementVNode("div",{class:"Snackbar__messageWrapper",style:e.normalizeStyle({transform:`translateY(-${100*c}%)`})},[e.createElementVNode("div",{class:e.normalizeClass(["Snackbar__messageBlock",`Snackbar__messageBlock--${l.type}`])},[e.createElementVNode("div",null,e.toDisplayString(l.text),1),e.createElementVNode("div",{class:"Snackbar__messageClose",onClick:d=>t.$emit("remove-message",l.id)},[e.createVNode(r,{class:"Snackbar__messageCloseIcon",name:"x"})],8,kn)],2)],4)]))),128))]),_:1})])}var gn=_(fn,[["render",bn],["__scopeId","data-v-272e7ab3"]]);const $n=1e4,yn=5,Bn=t=>{let o=1;const n=e.reactive({messages:[]}),s=l=>{n.messages=n.messages.filter(({id:c})=>c!==l)},i=e.createApp({parent:t,data(){return n},render(){return e.h(gn,{messages:this.messages,onRemoveMessage:s})}}),m=document.createElement("div");document.body.appendChild(m),i.mount(m);const r=(l,c="success",d=$n)=>{const f=o++;n.messages.push({text:l,type:c,id:f}),n.messages.length>yn&&n.messages.shift(),d>0&&setTimeout(()=>s(f),d)};t.config.globalProperties.$snackbar={success:l=>r(l,"success"),error:l=>r(l,"error",0)}};function A(){var t;return(t=e.getCurrentInstance())==null?void 0:t.appContext.config.globalProperties.$snackbar}function D(t,o={}){const n=A(),s=L(),i=h.useRouter(),m=e.ref(!1),r=e.ref(),l=e.ref(Object.freeze({})),c=async d=>{var f,p;if(!(o.confirm&&s&&!await s.confirm(typeof o.confirm=="function"?o.confirm(d):o.confirm))){if(o.validator){const u=await o.validator(d);if((f=o.onValidationResults)==null||f.call(o,u),!u||typeof u=="object"&&(l.value=(u==null?void 0:u.errors)||{},!(u!=null&&u.isValid)))return}m.value=!0;try{r.value=await t(d)}catch(u){if(o.errorMessage&&n&&n.error(typeof o.errorMessage=="function"?o.errorMessage(u,d):o.errorMessage||u.message),m.value=!1,o.onError&&o.onError({error:u,data:d,router:i,snackbar:n}))return;throw u}return m.value=!1,o.successMessage&&n&&n.success(typeof o.successMessage=="function"?o.successMessage(r.value,d):o.successMessage),(p=o.onSuccess)==null||p.call(o,{result:r.value,data:d,router:i,snackbar:n}),o.redirectOnSuccess&&i.push(typeof o.redirectOnSuccess=="function"?o.redirectOnSuccess(r.value,d):o.redirectOnSuccess),r.value}};return o.immediate&&e.onMounted(c),{submit:c,errors:l,result:r,isSubmitting:m}}const wn=(t,o={})=>{const{isSubmitting:n,submit:s,result:i}=D(t,{onSuccess:({router:m,data:r,result:l})=>{var c;return(c=o.onSuccess)==null?void 0:c.call(o,{data:l,params:r,router:m})},onError:({router:m,error:r,data:l})=>{var c;return(c=o.onError)==null?void 0:c.call(o,{error:r,params:l,router:m})},successMessage:o.successMessage,errorMessage:o.errorMessage,immediate:o.immediate});return{load:s,isLoading:n,data:i}};a.Breadcrumbs=Tt,a.Button=M,a.Checkbox=j,a.CheckboxGroup=to,a.Form=$o,a.FormFields=F,a.FormGroup=z,a.Icon=y,a.Input=Eo,a.ModalLayout=O,a.Radio=vo,a.Select=Wo,a.Table=Zo,a.Textarea=tn,a.modal=un,a.registerCustomIconResolver=zt,a.snackbar=Bn,a.useLoadData=wn,a.useModal=L,a.useSnackbar=A,a.useSubmitAction=D,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|