vuiii 1.0.0-beta.7 → 1.0.0-beta.8
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/components/Checkbox.vue.d.ts +91 -25
- package/dist/components/CheckboxGroup.vue.d.ts +91 -56
- package/dist/components/Form.vue.d.ts +184 -82
- package/dist/components/FormFields.vue.d.ts +99 -50
- package/dist/components/Input.vue.d.ts +13 -13
- package/dist/components/Select.vue.d.ts +25 -13
- package/dist/icons/mail.vue.d.ts +2 -0
- package/dist/index.d.ts +1 -3
- package/dist/stories/Input.stories.d.ts +422 -0
- package/dist/stories/icons.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +20 -0
- package/dist/vuiii.mjs +760 -822
- package/dist/vuiii.umd.js +1 -1
- package/package.json +4 -2
package/dist/vuiii.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m.vui={},m.Vue,m.VueRouter))})(this,function(m,e,y){"use strict";const Uo="",f=(t,o)=>{const r=t.__vccOpts||t;for(const[n,c]of o)r[n]=c;return r},F={},D={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},P=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16 17l-4 4m0 0l-4-4m4 4V3"},null,-1)];function A(t,o){return e.openBlock(),e.createElementBlock("svg",D,P)}const T=Object.freeze(Object.defineProperty({__proto__:null,default:f(F,[["render",A]])},Symbol.toStringTag,{value:"Module"})),R={},G={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},q=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 16l-4-4m0 0l4-4m-4 4h18"},null,-1)];function x(t,o){return e.openBlock(),e.createElementBlock("svg",G,q)}const K=Object.freeze(Object.defineProperty({__proto__:null,default:f(R,[["render",x]])},Symbol.toStringTag,{value:"Module"})),U={},H={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Q=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"},null,-1)];function W(t,o){return e.openBlock(),e.createElementBlock("svg",H,Q)}const X=Object.freeze(Object.defineProperty({__proto__:null,default:f(U,[["render",W]])},Symbol.toStringTag,{value:"Module"})),Y={},J={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Z=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8 7l4-4m0 0l4 4m-4-4v18"},null,-1)];function v(t,o){return e.openBlock(),e.createElementBlock("svg",J,Z)}const ee=Object.freeze(Object.defineProperty({__proto__:null,default:f(Y,[["render",v]])},Symbol.toStringTag,{value:"Module"})),te={},oe={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ne=[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 re(t,o){return e.openBlock(),e.createElementBlock("svg",oe,ne)}const le=Object.freeze(Object.defineProperty({__proto__:null,default:f(te,[["render",re]])},Symbol.toStringTag,{value:"Module"})),se={},ae={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ce=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 13l4 4L19 7"},null,-1)];function ie(t,o){return e.openBlock(),e.createElementBlock("svg",ae,ce)}const de=Object.freeze(Object.defineProperty({__proto__:null,default:f(se,[["render",ie]])},Symbol.toStringTag,{value:"Module"})),pe={},_e={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},me=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19l-7-7 7-7"},null,-1)];function ue(t,o){return e.openBlock(),e.createElementBlock("svg",_e,me)}const fe=Object.freeze(Object.defineProperty({__proto__:null,default:f(pe,[["render",ue]])},Symbol.toStringTag,{value:"Module"})),he={},ke={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},be=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 5l7 7-7 7"},null,-1)];function ge(t,o){return e.openBlock(),e.createElementBlock("svg",ke,be)}const $e=Object.freeze(Object.defineProperty({__proto__:null,default:f(he,[["render",ge]])},Symbol.toStringTag,{value:"Module"})),ye={},Be={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},we=[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 Ce(t,o){return e.openBlock(),e.createElementBlock("svg",Be,we)}const Ve=Object.freeze(Object.defineProperty({__proto__:null,default:f(ye,[["render",Ce]])},Symbol.toStringTag,{value:"Module"})),Se={},Ee={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Me=[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 Ne(t,o){return e.openBlock(),e.createElementBlock("svg",Ee,Me)}const Ie=Object.freeze(Object.defineProperty({__proto__:null,default:f(Se,[["render",Ne]])},Symbol.toStringTag,{value:"Module"})),je={},Oe={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Le=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function ze(t,o){return e.openBlock(),e.createElementBlock("svg",Oe,Le)}const Fe=Object.freeze(Object.defineProperty({__proto__:null,default:f(je,[["render",ze]])},Symbol.toStringTag,{value:"Module"})),De={},Pe={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Ae=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4v16m8-8H4"},null,-1)];function Te(t,o){return e.openBlock(),e.createElementBlock("svg",Pe,Ae)}const Re=Object.freeze(Object.defineProperty({__proto__:null,default:f(De,[["render",Te]])},Symbol.toStringTag,{value:"Module"})),Ge={},qe={fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},xe=[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 Ke(t,o){return e.openBlock(),e.createElementBlock("svg",qe,xe)}const Ue=Object.freeze(Object.defineProperty({__proto__:null,default:f(Ge,[["render",Ke]])},Symbol.toStringTag,{value:"Module"})),gn="",He={},Qe=t=>(e.pushScopeId("data-v-74889b0a"),t=t(),e.popScopeId(),t),We={class:"IconSpinner",fill:"none",stroke:"currentColor",viewBox:"0 0 25 25",xmlns:"http://www.w3.org/2000/svg"},Xe=[Qe(()=>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 Ye(t,o){return e.openBlock(),e.createElementBlock("svg",We,Xe)}const Je=Object.freeze(Object.defineProperty({__proto__:null,default:f(He,[["render",Ye],["__scopeId","data-v-74889b0a"]])},Symbol.toStringTag,{value:"Module"})),Ze={},ve={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},et=[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 tt(t,o){return e.openBlock(),e.createElementBlock("svg",ve,et)}const ot=Object.freeze(Object.defineProperty({__proto__:null,default:f(Ze,[["render",tt]])},Symbol.toStringTag,{value:"Module"})),nt={},rt={"aria-hidden":"true",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},lt=[e.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},null,-1)];function st(t,o){return e.openBlock(),e.createElementBlock("svg",rt,lt)}const at=Object.freeze(Object.defineProperty({__proto__:null,default:f(nt,[["render",st]])},Symbol.toStringTag,{value:"Module"}));function ct(t,o){var r;return(r=Object.entries(t).map(([n,c])=>({path:n,source:c})).find(n=>n.path.endsWith(`/${o}`)))==null?void 0:r.source.default}let B;const it=Object.assign({"../icons/arrow-narrow-down.vue":T,"../icons/arrow-narrow-left.vue":K,"../icons/arrow-narrow-right.vue":X,"../icons/arrow-narrow-up.vue":ee,"../icons/check-circle.vue":le,"../icons/check.vue":de,"../icons/chevron-left.vue":fe,"../icons/chevron-right.vue":$e,"../icons/exclamation-circle.vue":Ve,"../icons/exclamation.vue":Ie,"../icons/minus.vue":Fe,"../icons/plus.vue":Re,"../icons/search.vue":Ue,"../icons/spinner.vue":Je,"../icons/trash.vue":ot,"../icons/x.vue":at});function dt(t){B=t}function pt(t){let o;return B&&(o=B(t)),o||(o=ct(it,`${t}.vue`)),o}const Sn="",k=f(e.defineComponent({__name:"Icon",props:{name:null},setup(t){const o=t,r=e.shallowRef(void 0);return e.watch(()=>o.name,()=>r.value=pt(o.name),{immediate:!0}),(n,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),{class:"Icon"}))}}),[["__scopeId","data-v-6151c333"]]),Mn="",_t={class:"Breadcrumbs"},mt=f(e.defineComponent({__name:"Breadcrumbs",props:{breadcrumbs:{default:()=>({})}},setup(t){return(o,r)=>{const n=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",_t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.breadcrumbs,(c,i,l)=>(e.openBlock(),e.createElementBlock("div",{key:l,class:"Breadcrumbs__breadcrumb"},[e.createVNode(n,{to:c,class:"Breadcrumbs__link"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i),1)]),_:2},1032,["to"]),e.createVNode(k,{name:"chevron-right",class:"Breadcrumbs__arrow"})]))),128))])}}}),[["__scopeId","data-v-36e0aab2"]]),In="",ut={key:1},w=e.defineComponent({__name:"Button",props:{size:null,variant:null,prefixIcon:null,suffixIcon:null,label:null,block:{type:Boolean},loading:{type:Boolean},active:{type:Boolean}},setup(t){const o=e.useAttrs(),r=e.computed(()=>o.to?"router-link":o.href?"a":"button");return(n,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),e.mergeProps({class:["Button vuiii-button",{[`vuiii-button--${n.$props.variant}`]:n.$props.variant,[`vuiii-button--${n.$props.size}`]:n.$props.size,"vuiii-button--disabled":n.$props.loading||n.$attrs.disabled,"vuiii-button--loading":n.$props.loading,"vuiii-button--active":n.$props.active,"vuiii-button--block":n.$props.block}]},n.$attrs,{type:n.$attrs.type||(e.unref(r)==="button"?"button":void 0)}),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"prefix",{},()=>[n.$props.prefixIcon&&!n.$props.loading?(e.openBlock(),e.createBlock(k,{key:0,class:"vuiii-button__icon vuiii-button__icon--prefix",name:n.$props.prefixIcon},null,8,["name"])):e.createCommentVNode("",!0)]),n.$props.loading?(e.openBlock(),e.createBlock(k,{key:0,class:"vuiii-button__icon vuiii-button__icon--prefix",name:"spinner"})):e.createCommentVNode("",!0),n.$slots.default||n.$props.label?(e.openBlock(),e.createElementBlock("span",ut,[e.renderSlot(n.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.$props.label),1)])])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"suffix",{},()=>[n.$props.suffixIcon?(e.openBlock(),e.createBlock(k,{key:0,class:"vuiii-button__icon vuiii-button__icon--suffix",name:n.$props.suffixIcon},null,8,["name"])):e.createCommentVNode("",!0)])]),_:3},16,["class","type"]))}}),jn="",ft=t=>t.target.getAttribute("type")==="number"?t.target.valueAsNumber:t.target.getAttribute("type")==="checkbox"?t.target.checked:t.target.value,ht=e.defineComponent({emits:["update:modelValue"],computed:{normalizedAttrs(){const{class:t,...o}=this.$attrs;return{...o,onInput:r=>this.$emit("update:modelValue",ft(r))}}}}),On="",kt=e.defineComponent({mixins:[ht],inheritAttrs:!1,props:{modelValue:Boolean,required:Boolean,switch:Boolean,caption:{type:String,default:""}}}),bt=t=>(e.pushScopeId("data-v-18ef5cd1"),t=t(),e.popScopeId(),t),gt=["checked","required"],$t=[bt(()=>e.createElementVNode("div",{class:"Checkbox__switchDot"},null,-1))],yt={key:1,class:"Checkbox__label"},Bt={key:0,class:"Checkbox__required"};function wt(t,o,r,n,c,i){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,gt),[[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}])},$t,2)):e.createCommentVNode("",!0),t.$slots.default||t.caption?(e.openBlock(),e.createElementBlock("div",yt,[t.required?(e.openBlock(),e.createElementBlock("span",Bt,"*")):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.caption),1)],!0)])):e.createCommentVNode("",!0)],2)}const E=f(kt,[["render",wt],["__scopeId","data-v-18ef5cd1"]]);function $(t,o){return typeof o=="function"?o(t):o?t[o]:t}function Ct(t,o={}){return{value:$(t,o.value),label:$(t,o.label),disabled:o.disabled&&$(t,o.disabled),description:o.description&&$(t,o.description),data:t}}function C(t,o={}){return Array.isArray(t)?t.map(r=>Ct(r,o)):typeof t=="object"&&t!==null?Object.entries(t||{}).reduce((r,[n,c])=>r.concat({value:n,label:c,data:n}),[]):[]}const zn="",Vt=e.defineComponent({components:{Checkbox:E},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 C(this.options,{value:this.optionValueKey,label:this.optionLabelKey,disabled:this.optionDisabledKey})},checkedValues(){return this.modelValue.reduce((t,o)=>({...t,[o]:!0}),{})}},methods:{toggleCheckedValue(t){const o={...this.checkedValues,[t]:!this.checkedValues[t]},r=Object.entries(o).filter(([n,c])=>c).map(([n])=>n);this.$emit("update:modelValue",r)}}}),St={class:"CheckboxGroup"};function Et(t,o,r,n,c,i){const l=e.resolveComponent("Checkbox");return e.openBlock(),e.createElementBlock("div",St,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedOptions,s=>(e.openBlock(),e.createElementBlock("div",{key:s.value},[e.createVNode(l,{disabled:s.disabled,"model-value":t.checkedValues[s.value],caption:s.label,"onUpdate:modelValue":a=>t.toggleCheckedValue(s.value)},null,8,["disabled","model-value","caption","onUpdate:modelValue"])]))),128))])}const Mt=f(Vt,[["render",Et],["__scopeId","data-v-b33477ce"]]),Fn="",Nt={key:0,class:"FormGroup__header"},It=["for"],jt={key:0,class:"FormGroup__required"},Ot={key:1,class:"FormGroup__description"},Lt={key:2,class:"FormGroup__hint"},zt={key:3,class:"FormGroup__error"},M=f(e.defineComponent({__name:"FormGroup",props:{label:null,for:null,required:{type:Boolean},error:{type:[String,Boolean]},description:null,hint:null},setup(t){return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["FormGroup",{"FormGroup--invalid":o.$props.error}])},[o.$props.label?(e.openBlock(),e.createElementBlock("div",Nt,[e.createElementVNode("label",{class:"FormGroup__label",for:o.$props.for},e.toDisplayString(o.$props.label),9,It),o.$props.required?(e.openBlock(),e.createElementBlock("div",jt,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),o.$slots.description||o.$props.description?(e.openBlock(),e.createElementBlock("div",Ot,[e.renderSlot(o.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(o.$props.description),1)],!0)])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{},void 0,!0),o.$slots.hint||o.$props.hint?(e.openBlock(),e.createElementBlock("div",Lt,[e.renderSlot(o.$slots,"hint",{},()=>[e.createTextVNode(e.toDisplayString(o.$props.hint),1)],!0)])):e.createCommentVNode("",!0),o.$props.error&&typeof o.$props.error=="string"?(e.openBlock(),e.createElementBlock("div",zt,e.toDisplayString(o.$props.error),1)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-3281da9f"]]),Pn="",Ft=e.defineComponent({components:{FormGroup:M},props:{fields:{type:Object,default:()=>({})},modelValue:{type:Object,default:()=>({})},errors:{type:Object,default:()=>({})}},emits:["update:modelValue"],methods:{getFieldValue(t){var r;return(((r=this.fields[t].value)==null?void 0:r.getter)||(n=>n[t]))(this.modelValue)},setFieldValue(t,o){var c;const n=(((c=this.fields[t].value)==null?void 0:c.setter)||((i,l)=>({...l,[t]:i})))(o,this.modelValue);this.$emit("update:modelValue",n)}}}),Dt={class:"FormFields"};function Pt(t,o,r,n,c,i){const l=e.resolveComponent("FormGroup");return e.openBlock(),e.createElementBlock("div",Dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,(s,a)=>{var p;return e.openBlock(),e.createBlock(l,{key:a,label:s.label,description:s.description,hint:s.hint,required:s.required,error:(p=t.errors)==null?void 0:p[a]},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.component),e.mergeProps({"model-value":t.getFieldValue(String(a))},s.props,{"onUpdate:modelValue":_=>t.setFieldValue(String(a),_)}),null,16,["model-value","onUpdate:modelValue"]))]),_:2},1032,["label","description","hint","required","error"])}),128))])}const N=f(Ft,[["render",Pt],["__scopeId","data-v-e0fd8fc8"]]),An="",At=e.defineComponent({components:{Button:w,FormFields:N,Icon:k},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)}}}),Tt={class:"Form"},Rt=["disabled"],Gt={key:0,class:"Form__title"},qt={key:0,class:"Form__buttons"};function xt(t,o,r,n,c,i){const l=e.resolveComponent("FormFields"),s=e.resolveComponent("Button"),a=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",Tt,[t.modelValue?(e.openBlock(),e.createElementBlock("form",{key:0,disabled:t.submitting,onSubmit:o[3]||(o[3]=e.withModifiers(p=>{var _;return(_=t.handleSubmit)==null?void 0:_.call(t)},["prevent"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.structure,(p,_)=>(e.openBlock(),e.createElementBlock("div",{key:_},[p.title?(e.openBlock(),e.createElementBlock("div",Gt,e.toDisplayString(p.title),1)):e.createCommentVNode("",!0),e.createVNode(l,{fields:p.fields,"model-value":t.modelValue,errors:t.errors,"onUpdate:modelValue":o[0]||(o[0]=d=>t.$emit("update:modelValue",d)),onChange:o[1]||(o[1]=d=>t.$emit("change",d))},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",qt,[t.submit?(e.openBlock(),e.createBlock(s,{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(s,{key:1,label:t.cancelLabel,disabled:t.submitting,onClick:o[2]||(o[2]=p=>t.handleCancel())},null,8,["label","disabled"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],!0)],40,Rt)):(e.openBlock(),e.createBlock(a,{key:1,name:"spinner"}))])}const Kt=f(At,[["render",xt],["__scopeId","data-v-4a2acd7e"]]),Tn="",Ut=["aria-label","type","value"],Ht={inheritAttrs:!1},Qt=e.defineComponent({...Ht,__name:"Input",props:{modelValue:null,prefixIcon:null,suffixIcon:null,size:null,invalid:{type:Boolean}},emits:["update:modelValue","prefix-click","suffix-click"],setup(t){const o=t,r=e.useAttrs(),n=e.useSlots(),c=e.ref(),i=e.computed(()=>Boolean(n.prefix||o.prefixIcon)),l=e.computed(()=>Boolean(n.suffix||o.suffixIcon)),s=e.computed(()=>Boolean(r.onPrefixIconClick)),a=e.computed(()=>Boolean(r.onSuffixIconClick)),p=_=>{const d=_.target;return r.type==="number"?d.valueAsNumber:r.type==="date"?d.valueAsDate:d.value};return(_,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["Input vuiii-input",{"vuiii-input--invalid":_.$props.invalid,"vuiii-input--disabled":_.$attrs.disabled,[`vuiii-input--${_.$props.size}`]:_.$props.size}]),onClick:d[3]||(d[3]=u=>c.value.focus())},[e.unref(i)?e.renderSlot(_.$slots,"prefix",{key:0},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s)?"button":"div"),{class:e.normalizeClass(["Input__prefix",{"Input__prefix--clickable":e.unref(s)}]),tabindex:"-1",onClick:d[0]||(d[0]=e.withModifiers(u=>_.$emit("prefix-click"),["prevent"]))},{default:e.withCtx(()=>[e.createVNode(k,{class:"Input__icon",name:_.$props.prefixIcon||""},null,8,["name"])]),_:1},8,["class"]))]):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref_key:"input",ref:c,"aria-label":_.$attrs.placeholder||"input"},_.$attrs,{class:["vuiii-input__nested Input__input",{"Input__input--withPrefixIcon":_.$props.prefixIcon,"Input__input--withSuffixIcon":_.$props.suffixIcon}],type:_.$attrs.type||"text",value:_.$props.modelValue,onInput:d[1]||(d[1]=u=>_.$emit("update:modelValue",p(u)))}),null,16,Ut),e.unref(l)?e.renderSlot(_.$slots,"suffix",{key:1},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)?"button":"div"),{class:e.normalizeClass(["Input__suffix",{"Input__suffix--clickable":e.unref(a)}]),tabindex:"-1",onClick:d[2]||(d[2]=e.withModifiers(u=>_.$emit("suffix-click"),["prevent"]))},{default:e.withCtx(()=>[e.createVNode(k,{class:"Input__icon",name:_.$props.suffixIcon||""},null,8,["name"])]),_:1},8,["class"]))]):e.createCommentVNode("",!0)],2))}}),Rn="",Wt=e.defineComponent({components:{Icon:k},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"}))}}}),Xt={key:1,class:"ModalLayout__header"},Yt={class:"ModalLayout__title"},Jt={class:"ModalLayout__body"},Zt={key:2,class:"ModalLayout__footer"};function vt(t,o,r,n,c,i){const l=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]=s=>t.close())},[e.createVNode(l,{name:"x",class:"ModalLayout__closeIcon"})])),t.hasHeader?(e.openBlock(),e.createElementBlock("div",Xt,[e.renderSlot(t.$slots,"header",{},()=>[e.createElementVNode("div",Yt,e.toDisplayString(t.title),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Jt,[e.renderSlot(t.$slots,"default",{},void 0,!0)]),t.hasFooter?(e.openBlock(),e.createElementBlock("div",Zt,[e.renderSlot(t.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],6)}const I=f(Wt,[["render",vt],["__scopeId","data-v-386279ac"]]);let eo=1;function to(){return eo++}const Gn="",oo={class:"Radio"},no=["value","checked","disabled","onInput"],ro={class:"Radio__label"},lo={inheritAttrs:!1},so=e.defineComponent({...lo,__name:"Radio",props:{modelValue:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null},emits:["update:modelValue"],setup(t){const o=t,r="Radio-input-"+to(),n=e.computed(()=>C(o.options,{value:o.optionValue,label:o.optionLabel,disabled:o.optionDisabled}));return(c,i)=>(e.openBlock(),e.createElementBlock("div",oo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n),l=>(e.openBlock(),e.createElementBlock("label",{key:l.value,class:e.normalizeClass(["Radio__option",{"Radio--disabled":l.disabled}])},[e.createElementVNode("input",e.mergeProps(c.$attrs,{value:l.value,checked:c.$props.modelValue===l.value,class:"Radio__input vuiii-input",type:"radio",name:r,disabled:l.disabled,onInput:s=>c.$emit("update:modelValue",l.value)}),null,16,no),e.createElementVNode("div",ro,[e.renderSlot(c.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.label),1)],!0)])],2))),128))]))}}),ao=f(so,[["__scopeId","data-v-fc28702a"]]),co=["value"],io=["disabled"],po=["disabled","value"],_o=e.defineComponent({__name:"Select",props:{value:null,options:null,optionLabel:{default:void 0},optionValue:{default:void 0},optionDisabled:{default:void 0},placeholder:{default:void 0},size:{default:"normal"},allowEmpty:{type:Boolean}},setup(t){const o=t,r=e.computed(()=>C(o.options,{value:o.optionValue,label:o.optionLabel,disabled:o.optionDisabled}));return(n,c)=>(e.openBlock(),e.createElementBlock("select",{class:e.normalizeClass(["Select vuiii-input",{[`vuiii-input--${n.$props.size}`]:n.$props.size}]),value:n.$props.value},[n.$props.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,disabled:!n.$props.allowEmpty,selected:"",value:void 0},e.toDisplayString(n.$props.placeholder),9,io)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),i=>(e.openBlock(),e.createElementBlock("option",{key:i.value,disabled:i.disabled,value:i.value},e.toDisplayString(i.label),9,po))),128))],10,co))}}),qn="",xn="",mo={class:"vuiii-table vuiii-table--hover"},uo=["width"],fo=e.defineComponent({__name:"Table",props:{items:null,columns:null,rowClass:null},setup(t){const o=t,r=e.computed(()=>Object.entries(o.columns).reduce((i,[l,s])=>({...i,[l]:typeof s=="string"?{label:s}:s}),{})),n=(i,l)=>{const s=r.value[l],a=typeof s.value=="function"?s.value(i):i[l];return s.format?s.format(a):a},c=i=>typeof o.rowClass=="function"?o.rowClass(i):o.rowClass;return(i,l)=>{const s=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("table",mo,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),(a,p)=>(e.openBlock(),e.createElementBlock("th",{key:p,style:e.normalizeStyle({textAlign:a.align||"left"}),width:a.width},e.toDisplayString(a.label),13,uo))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(a,p)=>(e.openBlock(),e.createElementBlock("tr",{key:p,class:e.normalizeClass(c(a))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),(_,d)=>(e.openBlock(),e.createElementBlock("td",{key:d,style:e.normalizeStyle({textAlign:_.align||"left"})},[e.renderSlot(i.$slots,d,e.normalizeProps(e.guardReactiveProps({item:a})),()=>[_.href?(e.openBlock(),e.createBlock(s,{key:0,class:"vuiii-link",to:_.href(a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n(a,d)),1)]),_:2},1032,["to"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n(a,d)),1)],64))])],4))),128))],2))),128))])])}}}),ho=["value"],ko=e.defineComponent({__name:"Textarea",props:{modelValue:null,size:null},emits:["update:modelValue"],setup(t){return(o,r)=>(e.openBlock(),e.createElementBlock("textarea",e.mergeProps(o.$attrs,{class:["Textarea vuiii-input",{[`vuiii-input--${o.$props.size}`]:o.$props.size}],value:o.$props.modelValue,onInput:r[0]||(r[0]=n=>o.$emit("update:modelValue",n.target.value))}),null,16,ho))}}),Kn="",bo=e.defineComponent({components:{ModalLayout:I,Button:w},props:{title:{type:String,default:""},message:{type:String,default:""},buttons:{type:Array,default:()=>[]}},emits:["close"]}),go={class:"ModalLayoutDialog__buttons"};function $o(t,o,r,n,c,i){var a;const l=e.resolveComponent("Button"),s=e.resolveComponent("ModalLayout");return e.openBlock(),e.createBlock(s,{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},[(a=t.buttons)!=null&&a.length?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",go,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,(p,_)=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"ModalLayoutDialog__buttonWrapper"},[e.createVNode(l,{type:"button",variant:p.variant,"prefix-icon":p.icon,autofocus:"",onClick:d=>t.$emit("close",p.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),_:2},1032,["variant","prefix-icon","onClick"])]))),128))])]),key:"0"}:void 0]),1032,["title"])}const yo=f(bo,[["render",$o],["__scopeId","data-v-612c6cb9"]]),Un="",Bo=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 c;const r=()=>{this.$emit("closeModal",{modal:t,result:o})},n=this.modalInstances[t.id].$el;(c=n.$attrs)!=null&&c.onBeforeClose?n.$attrs.onBeforeClose(r):r()},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)}}}),wo={class:"ModalStack"},Co={key:0,class:"ModalStack__backdrop"},Vo=["onClick"];function So(t,o,r,n,c,i){return e.openBlock(),e.createElementBlock("div",wo,[e.createVNode(e.Transition,{name:"ModalStack__backdrop"},{default:e.withCtx(()=>[t.modals.length?(e.openBlock(),e.createElementBlock("div",Co)):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,l=>{var s;return e.openBlock(),e.createElementBlock("div",{key:l.id,class:"ModalStack__modalWrapper",onClick:a=>t.closeModalByBackdropClick(a,l)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component),e.mergeProps(l.props,{ref_for:!0,ref:t.registerReference(l.id),class:["ModalStack__modal",{isActive:((s=t.activeModal)==null?void 0:s.id)===l.id}],onClose:a=>t.closeModal(l,a)}),null,16,["class","onClose"]))],8,Vo)}),128))]),_:1})])}const Eo=f(Bo,[["render",So],["__scopeId","data-v-2f4ee2c2"]]),Mo={cancelLabel:"Cancel",confirmLabel:"OK"},No=(t,o={})=>{let r=1;o={...Mo,...o};const n=e.reactive({modals:[]}),c=(d,u)=>{var h;n.modals=n.modals.filter(({id:b})=>b!==d.id),d.resolve(u),(h=d.focusElement)==null||h.focus()},i=e.createApp({parent:t,data(){return n},render(){return e.h(Eo,{modals:n.modals,onCloseModal:({modal:d,result:u})=>c(d,u)})}}),l=document.createElement("div");document.body.appendChild(l),i.mount(l);const s=(d,u)=>{var b;const h=document.activeElement;return(b=h.blur)==null||b.call(h),new Promise(g=>{n.modals.push({id:r++,component:d,props:u,resolve:g,focusElement:h})})},a=d=>s(yo,d),p=d=>{typeof d=="string"&&(d={message:d});const{title:u,message:h,confirmVariant:b,confirmLabel:g=o.confirmLabel,confirmIcon:S}=d;return a({title:u,message:h,buttons:[{variant:b||"primary",label:g||"",icon:S}]})},_=d=>{typeof d=="string"&&(d={message:d});const{title:u,message:h,cancelLabel:b=o.cancelLabel,cancelVariant:g,cancelIcon:S,confirmLabel:qo=o.confirmLabel,confirmVariant:xo,confirmIcon:Ko}=d;return a({title:u,message:h,buttons:[{variant:g,label:b||"",icon:S,value:!1},{variant:xo||"primary",label:qo||"",icon:Ko,value:!0}]})};t.config.globalProperties.$modal={open:s,dialog:a,alert:p,confirm:_}};function j(){var t;return(t=e.getCurrentInstance())==null?void 0:t.appContext.config.globalProperties.$modal}const Hn="",Io=e.defineComponent({components:{Icon:k},props:{messages:{type:Array,default:()=>[]}},emits:["remove-message"],computed:{messagesInReverse(){return[...this.messages].reverse()}}}),jo={class:"Snackbar"},Oo=["onClick"];function Lo(t,o,r,n,c,i){const l=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",jo,[e.createVNode(e.TransitionGroup,{name:"Snackbar__transition"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.messagesInReverse,(s,a)=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:"Snackbar__message"},[e.createElementVNode("div",{class:"Snackbar__messageWrapper",style:e.normalizeStyle({transform:`translateY(-${100*a}%)`})},[e.createElementVNode("div",{class:e.normalizeClass(["Snackbar__messageBlock",`Snackbar__messageBlock--${s.type}`])},[e.createElementVNode("div",null,e.toDisplayString(s.text),1),e.createElementVNode("div",{class:"Snackbar__messageClose",onClick:p=>t.$emit("remove-message",s.id)},[e.createVNode(l,{class:"Snackbar__messageCloseIcon",name:"x"})],8,Oo)],2)],4)]))),128))]),_:1})])}const zo=f(Io,[["render",Lo],["__scopeId","data-v-272e7ab3"]]),Fo=1e4,Do=5,Po=t=>{let o=1;const r=e.reactive({messages:[]}),n=s=>{r.messages=r.messages.filter(({id:a})=>a!==s)},c=e.createApp({parent:t,data(){return r},render(){return e.h(zo,{messages:this.messages,onRemoveMessage:n})}}),i=document.createElement("div");document.body.appendChild(i),c.mount(i);const l=(s,a="success",p=Fo)=>{const _=o++;r.messages.push({text:s,type:a,id:_}),r.messages.length>Do&&r.messages.shift(),p>0&&setTimeout(()=>n(_),p)};t.config.globalProperties.$snackbar={success:s=>l(s,"success"),error:s=>l(s,"error",0)}};function O(){var t;return(t=e.getCurrentInstance())==null?void 0:t.appContext.config.globalProperties.$snackbar}class V extends Error{}function L(t,o={}){const r=O(),n=j(),c=y.useRouter(),i=e.ref(!1),l=e.ref(),s=e.ref(Object.freeze({})),a=async p=>{var _,d;if(!(o.confirm&&n&&!await n.confirm(typeof o.confirm=="function"?o.confirm(p):o.confirm))){try{if(i.value=!0,o.validator){const u=await o.validator(p);if((_=o.onValidationResults)==null||_.call(o,u),!u)throw new V;if(typeof u=="object"&&(s.value=(u==null?void 0:u.errors)||{},!(u!=null&&u.isValid)))throw new V}l.value=await t(p)}catch(u){if(o.errorMessage&&r&&r.error(typeof o.errorMessage=="function"?o.errorMessage(u,p):o.errorMessage||u.message),i.value=!1,o.onError&&o.onError({error:u,data:p,router:c,snackbar:r}))return;throw u}return i.value=!1,o.successMessage&&r&&r.success(typeof o.successMessage=="function"?o.successMessage(l.value,p):o.successMessage),(d=o.onSuccess)==null||d.call(o,{result:l.value,data:p,router:c,snackbar:r}),o.redirectOnSuccess&&c.push(typeof o.redirectOnSuccess=="function"?o.redirectOnSuccess(l.value,p):o.redirectOnSuccess),l.value}};return o.immediate&&e.onMounted(a),{submit:a,errors:s,result:l,isSubmitting:i}}const Ao=(t,o={})=>{const{isSubmitting:r,submit:n,result:c}=L(t,{onSuccess:({router:i,data:l,result:s})=>{var a;return(a=o.onSuccess)==null?void 0:a.call(o,{data:s,params:l,router:i})},onError:({router:i,error:l,data:s})=>{var a;return(a=o.onError)==null?void 0:a.call(o,{error:l,params:s,router:i})},successMessage:o.successMessage,errorMessage:o.errorMessage,immediate:o.immediate});return{load:n,isLoading:r,data:c}};function To(t,o){const r=n=>{var c;(c=t.value)!=null&&c.contains(n.target)||o()};window.addEventListener("mousedown",r),e.onUnmounted(()=>{window.removeEventListener("mousedown",r)})}function Ro(t,o){const r=n=>{n.key===t&&o(n)};e.onMounted(()=>{window.addEventListener("keydown",r)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",r)})}function z(t,o={}){const r=y.useRoute(),n=y.useRouter(),c=e.computed(()=>{var s;let l=r.query;return(s=o.filter)!=null&&s.length&&(l=Object.fromEntries(Object.entries(l).filter(([a])=>{var p;return(p=o.filter)==null?void 0:p.includes(a)}))),o.parse&&(l=Object.fromEntries(Object.entries(l).map(([a,p])=>{var _;return[a,(_=o.parse)!=null&&_[a]?o.parse[a](p):p]}))),l}),i=l=>(o.serialize&&(l=Object.fromEntries(Object.entries(l).map(([s,a])=>{var p;return[s,(p=o.serialize)!=null&&p[s]?o.serialize[s](a):a]}))),n.push({query:l}));return e.watch(c,()=>t(c.value),{immediate:o.immediate}),{params:c,setQuery:i}}function Go(t,o={}){const{params:r,setQuery:n}=z(l=>t(l.page),{filter:["page"],parse:{page:l=>Number(l)||1},immediate:o.immediate});return{page:e.computed(()=>r.value.page),setPage:l=>n({page:String(l)})}}m.Breadcrumbs=mt,m.Button=w,m.Checkbox=E,m.CheckboxGroup=Mt,m.Form=Kt,m.FormFields=N,m.FormGroup=M,m.Icon=k,m.Input=Qt,m.ModalLayout=I,m.Radio=ao,m.Select=_o,m.Table=fo,m.Textarea=ko,m.ValidationError=V,m.modal=No,m.registerCustomIconResolver=dt,m.snackbar=Po,m.useLoadData=Ao,m.useModal=j,m.useOnClickOutside=To,m.useOnKeyPress=Ro,m.usePageFromRouteQuery=Go,m.useRouteQuery=z,m.useSnackbar=O,m.useSubmitAction=L,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m.vui={},m.Vue,m.VueRouter))})(this,function(m,e,g){"use strict";const Gt="",f=(t,o)=>{const r=t.__vccOpts||t;for(const[l,c]of o)r[l]=c;return r},F={},D={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},P=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16 17l-4 4m0 0l-4-4m4 4V3"},null,-1)];function T(t,o){return e.openBlock(),e.createElementBlock("svg",D,P)}const R=Object.freeze(Object.defineProperty({__proto__:null,default:f(F,[["render",T]])},Symbol.toStringTag,{value:"Module"})),A={},x={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:"M7 16l-4-4m0 0l4-4m-4 4h18"},null,-1)];function q(t,o){return e.openBlock(),e.createElementBlock("svg",x,G)}const U=Object.freeze(Object.defineProperty({__proto__:null,default:f(A,[["render",q]])},Symbol.toStringTag,{value:"Module"})),H={},K={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Q=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"},null,-1)];function W(t,o){return e.openBlock(),e.createElementBlock("svg",K,Q)}const X=Object.freeze(Object.defineProperty({__proto__:null,default:f(H,[["render",W]])},Symbol.toStringTag,{value:"Module"})),Y={},J={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Z=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8 7l4-4m0 0l4 4m-4-4v18"},null,-1)];function v(t,o){return e.openBlock(),e.createElementBlock("svg",J,Z)}const ee=Object.freeze(Object.defineProperty({__proto__:null,default:f(Y,[["render",v]])},Symbol.toStringTag,{value:"Module"})),oe={},te={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ne=[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 re(t,o){return e.openBlock(),e.createElementBlock("svg",te,ne)}const le=Object.freeze(Object.defineProperty({__proto__:null,default:f(oe,[["render",re]])},Symbol.toStringTag,{value:"Module"})),se={},ae={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},ce=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 13l4 4L19 7"},null,-1)];function ie(t,o){return e.openBlock(),e.createElementBlock("svg",ae,ce)}const de=Object.freeze(Object.defineProperty({__proto__:null,default:f(se,[["render",ie]])},Symbol.toStringTag,{value:"Module"})),pe={},_e={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},me=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19l-7-7 7-7"},null,-1)];function ue(t,o){return e.openBlock(),e.createElementBlock("svg",_e,me)}const fe=Object.freeze(Object.defineProperty({__proto__:null,default:f(pe,[["render",ue]])},Symbol.toStringTag,{value:"Module"})),ke={},he={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},be=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 5l7 7-7 7"},null,-1)];function $e(t,o){return e.openBlock(),e.createElementBlock("svg",he,be)}const ge=Object.freeze(Object.defineProperty({__proto__:null,default:f(ke,[["render",$e]])},Symbol.toStringTag,{value:"Module"})),ye={},Be={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},we=[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 Ce(t,o){return e.openBlock(),e.createElementBlock("svg",Be,we)}const Ve=Object.freeze(Object.defineProperty({__proto__:null,default:f(ye,[["render",Ce]])},Symbol.toStringTag,{value:"Module"})),Ee={},Se={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},Me=[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 Ne(t,o){return e.openBlock(),e.createElementBlock("svg",Se,Me)}const Ie=Object.freeze(Object.defineProperty({__proto__:null,default:f(Ee,[["render",Ne]])},Symbol.toStringTag,{value:"Module"})),je={},Le={fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Oe=[e.createElementVNode("path",{d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},null,-1)];function ze(t,o){return e.openBlock(),e.createElementBlock("svg",Le,Oe)}const Fe=Object.freeze(Object.defineProperty({__proto__:null,default:f(je,[["render",ze]])},Symbol.toStringTag,{value:"Module"})),De={},Pe={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Te=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function Re(t,o){return e.openBlock(),e.createElementBlock("svg",Pe,Te)}const Ae=Object.freeze(Object.defineProperty({__proto__:null,default:f(De,[["render",Re]])},Symbol.toStringTag,{value:"Module"})),xe={},Ge={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},qe=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4v16m8-8H4"},null,-1)];function Ue(t,o){return e.openBlock(),e.createElementBlock("svg",Ge,qe)}const He=Object.freeze(Object.defineProperty({__proto__:null,default:f(xe,[["render",Ue]])},Symbol.toStringTag,{value:"Module"})),Ke={},Qe={fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},We=[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 Xe(t,o){return e.openBlock(),e.createElementBlock("svg",Qe,We)}const Ye=Object.freeze(Object.defineProperty({__proto__:null,default:f(Ke,[["render",Xe]])},Symbol.toStringTag,{value:"Module"})),bn="",Je={},Ze=t=>(e.pushScopeId("data-v-74889b0a"),t=t(),e.popScopeId(),t),ve={class:"IconSpinner",fill:"none",stroke:"currentColor",viewBox:"0 0 25 25",xmlns:"http://www.w3.org/2000/svg"},eo=[Ze(()=>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 oo(t,o){return e.openBlock(),e.createElementBlock("svg",ve,eo)}const to=Object.freeze(Object.defineProperty({__proto__:null,default:f(Je,[["render",oo],["__scopeId","data-v-74889b0a"]])},Symbol.toStringTag,{value:"Module"})),no={},ro={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},lo=[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 so(t,o){return e.openBlock(),e.createElementBlock("svg",ro,lo)}const ao=Object.freeze(Object.defineProperty({__proto__:null,default:f(no,[["render",so]])},Symbol.toStringTag,{value:"Module"})),co={},io={"aria-hidden":"true",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},po=[e.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},null,-1)];function _o(t,o){return e.openBlock(),e.createElementBlock("svg",io,po)}const mo=Object.freeze(Object.defineProperty({__proto__:null,default:f(co,[["render",_o]])},Symbol.toStringTag,{value:"Module"}));function uo(t,o){var r;return(r=Object.entries(t).map(([l,c])=>({path:l,source:c})).find(l=>l.path.endsWith(`/${o}`)))==null?void 0:r.source.default}let w;const fo=Object.assign({"../icons/arrow-narrow-down.vue":R,"../icons/arrow-narrow-left.vue":U,"../icons/arrow-narrow-right.vue":X,"../icons/arrow-narrow-up.vue":ee,"../icons/check-circle.vue":le,"../icons/check.vue":de,"../icons/chevron-left.vue":fe,"../icons/chevron-right.vue":ge,"../icons/exclamation-circle.vue":Ve,"../icons/exclamation.vue":Ie,"../icons/mail.vue":Fe,"../icons/minus.vue":Ae,"../icons/plus.vue":He,"../icons/search.vue":Ye,"../icons/spinner.vue":to,"../icons/trash.vue":ao,"../icons/x.vue":mo});function ko(t){w=t}function ho(t){let o;return w&&(o=w(t)),o||(o=uo(fo,`${t}.vue`)),o}const Vn="",h=f(e.defineComponent({__name:"Icon",props:{name:null},setup(t){const o=t,r=e.shallowRef(void 0);return e.watch(()=>o.name,()=>r.value=ho(o.name),{immediate:!0}),(l,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),{class:"Icon"}))}}),[["__scopeId","data-v-6151c333"]]),Sn="",bo={class:"Breadcrumbs"},$o=f(e.defineComponent({__name:"Breadcrumbs",props:{breadcrumbs:{default:()=>({})}},setup(t){return(o,r)=>{const l=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",bo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.breadcrumbs,(c,i,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"Breadcrumbs__breadcrumb"},[e.createVNode(l,{to:c,class:"Breadcrumbs__link"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i),1)]),_:2},1032,["to"]),e.createVNode(h,{name:"chevron-right",class:"Breadcrumbs__arrow"})]))),128))])}}}),[["__scopeId","data-v-36e0aab2"]]),Nn="",go={key:1},y=e.defineComponent({__name:"Button",props:{size:null,variant:null,prefixIcon:null,suffixIcon:null,label:null,block:{type:Boolean},loading:{type:Boolean},active:{type:Boolean}},setup(t){const o=e.useAttrs(),r=e.computed(()=>o.to?"router-link":o.href?"a":"button");return(l,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),e.mergeProps({class:["Button vuiii-button",{[`vuiii-button--${l.$props.variant}`]:l.$props.variant,[`vuiii-button--${l.$props.size}`]:l.$props.size,"vuiii-button--disabled":l.$props.loading||l.$attrs.disabled,"vuiii-button--loading":l.$props.loading,"vuiii-button--active":l.$props.active,"vuiii-button--block":l.$props.block}]},l.$attrs,{type:l.$attrs.type||(e.unref(r)==="button"?"button":void 0)}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"prefix",{},()=>[l.$props.prefixIcon&&!l.$props.loading?(e.openBlock(),e.createBlock(h,{key:0,class:"vuiii-button__icon vuiii-button__icon--prefix",name:l.$props.prefixIcon},null,8,["name"])):e.createCommentVNode("",!0)]),l.$props.loading?(e.openBlock(),e.createBlock(h,{key:0,class:"vuiii-button__icon vuiii-button__icon--prefix",name:"spinner"})):e.createCommentVNode("",!0),l.$slots.default||l.$props.label?(e.openBlock(),e.createElementBlock("span",go,[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.$props.label),1)])])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"suffix",{},()=>[l.$props.suffixIcon?(e.openBlock(),e.createBlock(h,{key:0,class:"vuiii-button__icon vuiii-button__icon--suffix",name:l.$props.suffixIcon},null,8,["name"])):e.createCommentVNode("",!0)])]),_:3},16,["class","type"]))}}),In="",jn="",yo=t=>(e.pushScopeId("data-v-871f98aa"),t=t(),e.popScopeId(),t),Bo=["checked","required","disabled"],wo=[yo(()=>e.createElementVNode("div",{class:"Checkbox__switchDot"},null,-1))],Co={key:1,class:"Checkbox__label"},Vo={key:0,class:"Checkbox__required"},Eo={inheritAttrs:!1},So=e.defineComponent({...Eo,__name:"Checkbox",props:{modelValue:{type:Boolean},required:{type:Boolean},disabled:{type:Boolean},switch:{type:Boolean},label:null},emits:["update:modelValue"],setup(t){return(o,r)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["Checkbox",{"Checkbox--disabled":o.$props.disabled}])},[e.withDirectives(e.createElementVNode("input",{checked:o.$props.modelValue,class:"Checkbox__input vuiii-input",required:o.$props.required,disabled:o.$props.disabled,type:"checkbox",onInput:r[0]||(r[0]=l=>o.$emit("update:modelValue",l.target.checked))},null,40,Bo),[[e.vShow,!o.$props.switch]]),o.$props.switch?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["Checkbox__switch",{"Checkbox__switch--active":o.$props.modelValue}])},wo,2)):e.createCommentVNode("",!0),o.$slots.default||o.$props.label?(e.openBlock(),e.createElementBlock("div",Co,[o.$props.required?(e.openBlock(),e.createElementBlock("span",Vo,"*")):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.$props.label),1)],!0)])):e.createCommentVNode("",!0)],2))}}),S=f(So,[["__scopeId","data-v-871f98aa"]]);function B(t,o){return typeof o=="function"?o(t):o?t[o]:t}function Mo(t,o={}){return{value:B(t,o.value),label:B(t,o.label),disabled:o.disabled&&B(t,o.disabled),description:o.description&&B(t,o.description),data:t}}function C(t,o={}){return Array.isArray(t)?t.map(r=>Mo(r,o)):typeof t=="object"&&t!==null?Object.entries(t||{}).reduce((r,[l,c])=>r.concat({value:l,label:c,data:l}),[]):[]}const On="",No={class:"CheckboxGroup"},Io=f(e.defineComponent({__name:"CheckboxGroup",props:{modelValue:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null,optionDescription:null},emits:["update:modelValue"],setup(t,{emit:o}){const r=t,l=e.computed(()=>C(r.options,{value:r.optionValue,label:r.optionLabel,disabled:r.optionDisabled,description:r.optionDescription})),c=e.computed(()=>r.modelValue.reduce((n,s)=>({...n,[s]:!0}),{})),i=(n,s)=>{const a={...c.value,[n]:s},p=Object.entries(a).filter(([d,_])=>_).map(([d])=>d);o("update:modelValue",p)};return(n,s)=>(e.openBlock(),e.createElementBlock("div",No,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),a=>(e.openBlock(),e.createElementBlock("div",{key:a.value},[e.createVNode(S,{disabled:a.disabled,"model-value":e.unref(c)[a.value],caption:a.label,"onUpdate:modelValue":p=>i(a.value,p)},null,8,["disabled","model-value","caption","onUpdate:modelValue"])]))),128))]))}}),[["__scopeId","data-v-a8029dc8"]]),Fn="",jo={key:0,class:"FormGroup__header"},Lo=["for"],Oo={key:0,class:"FormGroup__required"},zo={key:1,class:"FormGroup__description"},Fo={key:2,class:"FormGroup__hint"},Do={key:3,class:"FormGroup__error"},M=f(e.defineComponent({__name:"FormGroup",props:{label:null,for:null,required:{type:Boolean},error:{type:[String,Boolean]},description:null,hint:null},setup(t){return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["FormGroup",{"FormGroup--invalid":o.$props.error}])},[o.$props.label?(e.openBlock(),e.createElementBlock("div",jo,[e.createElementVNode("label",{class:"FormGroup__label",for:o.$props.for},e.toDisplayString(o.$props.label),9,Lo),o.$props.required?(e.openBlock(),e.createElementBlock("div",Oo,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),o.$slots.description||o.$props.description?(e.openBlock(),e.createElementBlock("div",zo,[e.renderSlot(o.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(o.$props.description),1)],!0)])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{},void 0,!0),o.$slots.hint||o.$props.hint?(e.openBlock(),e.createElementBlock("div",Fo,[e.renderSlot(o.$slots,"hint",{},()=>[e.createTextVNode(e.toDisplayString(o.$props.hint),1)],!0)])):e.createCommentVNode("",!0),o.$props.error&&typeof o.$props.error=="string"?(e.openBlock(),e.createElementBlock("div",Do,e.toDisplayString(o.$props.error),1)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-3281da9f"]]),Pn="",Po={class:"FormFields"},N=f(e.defineComponent({__name:"FormFields",props:{fields:null,modelValue:null,errors:{default:()=>({})}},emits:["update:modelValue"],setup(t,{emit:o}){const r=t,l=i=>{var s;return(((s=r.fields[i].value)==null?void 0:s.getter)||(a=>a[i]))(r.modelValue)},c=(i,n)=>{var p;const a=(((p=r.fields[i].value)==null?void 0:p.setter)||((d,_)=>({..._,[i]:d})))(n,r.modelValue);o("update:modelValue",a)};return(i,n)=>(e.openBlock(),e.createElementBlock("div",Po,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.$props.fields,(s,a)=>{var p;return e.openBlock(),e.createBlock(M,{key:a,label:s.label,description:s.description,hint:s.hint,required:s.required,error:(p=i.$props.errors)==null?void 0:p[a]},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.component),e.mergeProps({"model-value":l(String(a))},s.props,{"onUpdate:modelValue":d=>c(String(a),d)}),null,16,["model-value","onUpdate:modelValue"]))]),_:2},1032,["label","description","hint","required","error"])}),128))]))}}),[["__scopeId","data-v-25bfba91"]]),Rn="",To={class:"Form"},Ro=["disabled"],Ao={key:0,class:"Form__title"},xo={key:0,class:"Form__buttons"},Go=f(e.defineComponent({__name:"Form",props:{structure:{default:()=>[]},modelValue:null,errors:{default:()=>({})},submit:{type:Function,default:void 0},submitLabel:{default:"Submit"},cancel:{type:[Function,null],default:void 0},cancelLabel:{default:"Cancel"},submitting:{type:Boolean}},emits:["update:modelValue","change","submit","cancel"],setup(t,{emit:o}){const r=t,l=g.useRouter(),c=()=>{var n;o("submit"),typeof r.submit=="function"?(n=r.submit)==null||n.call(r,r.modelValue):r.submit&&l.push(r.submit)},i=()=>{var n;o("cancel"),typeof r.cancel=="function"?(n=r.cancel)==null||n.call(r):r.cancel&&l.push(r.cancel)};return(n,s)=>(e.openBlock(),e.createElementBlock("div",To,[n.$props.modelValue?(e.openBlock(),e.createElementBlock("form",{key:0,disabled:n.$props.submitting,onSubmit:s[3]||(s[3]=e.withModifiers(a=>c==null?void 0:c(),["prevent"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.$props.structure,(a,p)=>(e.openBlock(),e.createElementBlock("div",{key:p},[a.title?(e.openBlock(),e.createElementBlock("div",Ao,e.toDisplayString(a.title),1)):e.createCommentVNode("",!0),e.createVNode(N,{fields:a.fields,"model-value":n.$props.modelValue,errors:n.$props.errors,"onUpdate:modelValue":s[0]||(s[0]=d=>n.$emit("update:modelValue",d)),onChange:s[1]||(s[1]=d=>n.$emit("change",d))},null,8,["fields","model-value","errors"])]))),128)),e.renderSlot(n.$slots,"buttons",e.normalizeProps(e.guardReactiveProps({cancel:n.$props.cancel,submit:n.$props.submit,submitting:n.$props.submitting})),()=>[n.$props.submit||n.$props.cancel?(e.openBlock(),e.createElementBlock("div",xo,[n.$props.submit?(e.openBlock(),e.createBlock(y,{key:0,variant:"primary",type:"submit",label:n.$props.submitLabel,loading:n.$props.submitting,"prefix-icon":n.$props.submitting?"spinner":void 0},null,8,["label","loading","prefix-icon"])):e.createCommentVNode("",!0),n.$props.cancel?(e.openBlock(),e.createBlock(y,{key:1,label:n.$props.cancelLabel,disabled:n.$props.submitting,onClick:s[2]||(s[2]=a=>i())},null,8,["label","disabled"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],!0)],40,Ro)):(e.openBlock(),e.createBlock(h,{key:1,name:"spinner"}))]))}}),[["__scopeId","data-v-065d38a8"]]),xn="",qo=["aria-label","type","value"],Uo={inheritAttrs:!1},Ho=e.defineComponent({...Uo,__name:"Input",props:{modelValue:null,prefixIcon:null,suffixIcon:null,size:null,invalid:{type:Boolean}},emits:["update:modelValue","prefix-icon-click","suffix-icon-click"],setup(t){const o=t,r=e.useAttrs(),l=e.useSlots(),c=e.ref(),i=e.computed(()=>Boolean(l.prefix||o.prefixIcon)),n=e.computed(()=>Boolean(l.suffix||o.suffixIcon)),s=e.computed(()=>Boolean(r.onPrefixIconClick)),a=e.computed(()=>Boolean(r.onSuffixIconClick)),p=d=>{const _=d.target;return r.type==="number"?_.valueAsNumber:r.type==="date"?_.valueAsDate:_.value};return(d,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["Input vuiii-input",{"vuiii-input--invalid":d.$props.invalid,"vuiii-input--disabled":d.$attrs.disabled,[`vuiii-input--${d.$props.size}`]:d.$props.size}]),onClick:_[3]||(_[3]=u=>c.value.focus())},[e.unref(i)?e.renderSlot(d.$slots,"prefix",{key:0},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s)?"button":"div"),{class:e.normalizeClass(["Input__prefix",{"Input__prefix--clickable":e.unref(s)}]),tabindex:"-1",onClick:_[0]||(_[0]=e.withModifiers(u=>d.$emit("prefix-icon-click"),["prevent"]))},{default:e.withCtx(()=>[e.createVNode(h,{class:"Input__icon",name:d.$props.prefixIcon||""},null,8,["name"])]),_:1},8,["class"]))]):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref_key:"input",ref:c,"aria-label":d.$attrs.placeholder||"input"},d.$attrs,{class:["vuiii-input__nested Input__input",{"Input__input--withPrefixIcon":d.$props.prefixIcon,"Input__input--withSuffixIcon":d.$props.suffixIcon}],type:d.$attrs.type||"text",value:d.$props.modelValue,onInput:_[1]||(_[1]=u=>d.$emit("update:modelValue",p(u)))}),null,16,qo),e.unref(n)?e.renderSlot(d.$slots,"suffix",{key:1},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)?"button":"div"),{class:e.normalizeClass(["Input__suffix",{"Input__suffix--clickable":e.unref(a)}]),tabindex:"-1",onClick:_[2]||(_[2]=e.withModifiers(u=>d.$emit("suffix-icon-click"),["prevent"]))},{default:e.withCtx(()=>[e.createVNode(h,{class:"Input__icon",name:d.$props.suffixIcon||""},null,8,["name"])]),_:1},8,["class"]))]):e.createCommentVNode("",!0)],2))}}),Gn="",Ko=e.defineComponent({components:{Icon:h},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"}))}}}),Qo={key:1,class:"ModalLayout__header"},Wo={class:"ModalLayout__title"},Xo={class:"ModalLayout__body"},Yo={key:2,class:"ModalLayout__footer"};function Jo(t,o,r,l,c,i){const n=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]=s=>t.close())},[e.createVNode(n,{name:"x",class:"ModalLayout__closeIcon"})])),t.hasHeader?(e.openBlock(),e.createElementBlock("div",Qo,[e.renderSlot(t.$slots,"header",{},()=>[e.createElementVNode("div",Wo,e.toDisplayString(t.title),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Xo,[e.renderSlot(t.$slots,"default",{},void 0,!0)]),t.hasFooter?(e.openBlock(),e.createElementBlock("div",Yo,[e.renderSlot(t.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],6)}const I=f(Ko,[["render",Jo],["__scopeId","data-v-386279ac"]]);let Zo=1;function vo(){return Zo++}const qn="",et={class:"Radio"},ot=["value","checked","disabled","onInput"],tt={class:"Radio__label"},nt={inheritAttrs:!1},rt=e.defineComponent({...nt,__name:"Radio",props:{modelValue:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null},emits:["update:modelValue"],setup(t){const o=t,r="Radio-input-"+vo(),l=e.computed(()=>C(o.options,{value:o.optionValue,label:o.optionLabel,disabled:o.optionDisabled}));return(c,i)=>(e.openBlock(),e.createElementBlock("div",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),n=>(e.openBlock(),e.createElementBlock("label",{key:n.value,class:e.normalizeClass(["Radio__option",{"Radio--disabled":n.disabled}])},[e.createElementVNode("input",e.mergeProps(c.$attrs,{value:n.value,checked:c.$props.modelValue===n.value,class:"Radio__input vuiii-input",type:"radio",name:r,disabled:n.disabled,onInput:s=>c.$emit("update:modelValue",n.value)}),null,16,ot),e.createElementVNode("div",tt,[e.renderSlot(c.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.label),1)],!0)])],2))),128))]))}}),lt=f(rt,[["__scopeId","data-v-fc28702a"]]),st=["value"],at=["disabled"],ct=["disabled","value"],it=e.defineComponent({__name:"Select",props:{modelValue:null,options:null,optionLabel:{default:void 0},optionValue:{default:void 0},optionDisabled:{default:void 0},placeholder:{default:void 0},size:{default:"normal"},allowEmpty:{type:Boolean}},emits:["update:modelValue"],setup(t){const o=t,r=e.computed(()=>C(o.options,{value:o.optionValue,label:o.optionLabel,disabled:o.optionDisabled}));return(l,c)=>(e.openBlock(),e.createElementBlock("select",{class:e.normalizeClass(["Select vuiii-input",{[`vuiii-input--${l.$props.size}`]:l.$props.size}]),value:l.$props.modelValue,onInput:c[0]||(c[0]=i=>l.$emit("update:modelValue",i.target.value))},[l.$props.placeholder?(e.openBlock(),e.createElementBlock("option",{key:0,disabled:!l.$props.allowEmpty,selected:"",value:void 0},e.toDisplayString(l.$props.placeholder),9,at)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),i=>(e.openBlock(),e.createElementBlock("option",{key:i.value,disabled:i.disabled,value:i.value},e.toDisplayString(i.label),9,ct))),128))],42,st))}}),Un="",Hn="",dt={class:"vuiii-table vuiii-table--hover"},pt=["width"],_t=e.defineComponent({__name:"Table",props:{items:null,columns:null,rowClass:null},setup(t){const o=t,r=e.computed(()=>Object.entries(o.columns).reduce((i,[n,s])=>({...i,[n]:typeof s=="string"?{label:s}:s}),{})),l=(i,n)=>{const s=r.value[n],a=typeof s.value=="function"?s.value(i):i[n];return s.format?s.format(a):a},c=i=>typeof o.rowClass=="function"?o.rowClass(i):o.rowClass;return(i,n)=>{const s=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("table",dt,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),(a,p)=>(e.openBlock(),e.createElementBlock("th",{key:p,style:e.normalizeStyle({textAlign:a.align||"left"}),width:a.width},e.toDisplayString(a.label),13,pt))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(a,p)=>(e.openBlock(),e.createElementBlock("tr",{key:p,class:e.normalizeClass(c(a))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),(d,_)=>(e.openBlock(),e.createElementBlock("td",{key:_,style:e.normalizeStyle({textAlign:d.align||"left"})},[e.renderSlot(i.$slots,_,e.normalizeProps(e.guardReactiveProps({item:a})),()=>[d.href?(e.openBlock(),e.createBlock(s,{key:0,class:"vuiii-link",to:d.href(a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l(a,_)),1)]),_:2},1032,["to"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l(a,_)),1)],64))])],4))),128))],2))),128))])])}}}),mt=["value"],ut=e.defineComponent({__name:"Textarea",props:{modelValue:null,size:null},emits:["update:modelValue"],setup(t){return(o,r)=>(e.openBlock(),e.createElementBlock("textarea",e.mergeProps(o.$attrs,{class:["Textarea vuiii-input",{[`vuiii-input--${o.$props.size}`]:o.$props.size}],value:o.$props.modelValue,onInput:r[0]||(r[0]=l=>o.$emit("update:modelValue",l.target.value))}),null,16,mt))}}),Kn="",ft=e.defineComponent({components:{ModalLayout:I,Button:y},props:{title:{type:String,default:""},message:{type:String,default:""},buttons:{type:Array,default:()=>[]}},emits:["close"]}),kt={class:"ModalLayoutDialog__buttons"};function ht(t,o,r,l,c,i){var a;const n=e.resolveComponent("Button"),s=e.resolveComponent("ModalLayout");return e.openBlock(),e.createBlock(s,{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},[(a=t.buttons)!=null&&a.length?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,(p,d)=>(e.openBlock(),e.createElementBlock("span",{key:d,class:"ModalLayoutDialog__buttonWrapper"},[e.createVNode(n,{type:"button",variant:p.variant,"prefix-icon":p.icon,autofocus:"",onClick:_=>t.$emit("close",p.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),_:2},1032,["variant","prefix-icon","onClick"])]))),128))])]),key:"0"}:void 0]),1032,["title"])}const bt=f(ft,[["render",ht],["__scopeId","data-v-612c6cb9"]]),Qn="",$t=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 c;const r=()=>{this.$emit("closeModal",{modal:t,result:o})},l=this.modalInstances[t.id].$el;(c=l.$attrs)!=null&&c.onBeforeClose?l.$attrs.onBeforeClose(r):r()},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)}}}),gt={class:"ModalStack"},yt={key:0,class:"ModalStack__backdrop"},Bt=["onClick"];function wt(t,o,r,l,c,i){return e.openBlock(),e.createElementBlock("div",gt,[e.createVNode(e.Transition,{name:"ModalStack__backdrop"},{default:e.withCtx(()=>[t.modals.length?(e.openBlock(),e.createElementBlock("div",yt)):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,n=>{var s;return e.openBlock(),e.createElementBlock("div",{key:n.id,class:"ModalStack__modalWrapper",onClick:a=>t.closeModalByBackdropClick(a,n)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),e.mergeProps(n.props,{ref_for:!0,ref:t.registerReference(n.id),class:["ModalStack__modal",{isActive:((s=t.activeModal)==null?void 0:s.id)===n.id}],onClose:a=>t.closeModal(n,a)}),null,16,["class","onClose"]))],8,Bt)}),128))]),_:1})])}const Ct=f($t,[["render",wt],["__scopeId","data-v-2f4ee2c2"]]),Vt={cancelLabel:"Cancel",confirmLabel:"OK"},Et=(t,o={})=>{let r=1;o={...Vt,...o};const l=e.reactive({modals:[]}),c=(_,u)=>{var k;l.modals=l.modals.filter(({id:b})=>b!==_.id),_.resolve(u),(k=_.focusElement)==null||k.focus()},i=e.createApp({parent:t,data(){return l},render(){return e.h(Ct,{modals:l.modals,onCloseModal:({modal:_,result:u})=>c(_,u)})}}),n=document.createElement("div");document.body.appendChild(n),i.mount(n);const s=(_,u)=>{var b;const k=document.activeElement;return(b=k.blur)==null||b.call(k),new Promise($=>{l.modals.push({id:r++,component:_,props:u,resolve:$,focusElement:k})})},a=_=>s(bt,_),p=_=>{typeof _=="string"&&(_={message:_});const{title:u,message:k,confirmVariant:b,confirmLabel:$=o.confirmLabel,confirmIcon:E}=_;return a({title:u,message:k,buttons:[{variant:b||"primary",label:$||"",icon:E}]})},d=_=>{typeof _=="string"&&(_={message:_});const{title:u,message:k,cancelLabel:b=o.cancelLabel,cancelVariant:$,cancelIcon:E,confirmLabel:Rt=o.confirmLabel,confirmVariant:At,confirmIcon:xt}=_;return a({title:u,message:k,buttons:[{variant:$,label:b||"",icon:E,value:!1},{variant:At||"primary",label:Rt||"",icon:xt,value:!0}]})};t.config.globalProperties.$modal={open:s,dialog:a,alert:p,confirm:d}};function j(){var t;return(t=e.getCurrentInstance())==null?void 0:t.appContext.config.globalProperties.$modal}const Wn="",St=e.defineComponent({components:{Icon:h},props:{messages:{type:Array,default:()=>[]}},emits:["remove-message"],computed:{messagesInReverse(){return[...this.messages].reverse()}}}),Mt={class:"Snackbar"},Nt=["onClick"];function It(t,o,r,l,c,i){const n=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",Mt,[e.createVNode(e.TransitionGroup,{name:"Snackbar__transition"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.messagesInReverse,(s,a)=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:"Snackbar__message"},[e.createElementVNode("div",{class:"Snackbar__messageWrapper",style:e.normalizeStyle({transform:`translateY(-${100*a}%)`})},[e.createElementVNode("div",{class:e.normalizeClass(["Snackbar__messageBlock",`Snackbar__messageBlock--${s.type}`])},[e.createElementVNode("div",null,e.toDisplayString(s.text),1),e.createElementVNode("div",{class:"Snackbar__messageClose",onClick:p=>t.$emit("remove-message",s.id)},[e.createVNode(n,{class:"Snackbar__messageCloseIcon",name:"x"})],8,Nt)],2)],4)]))),128))]),_:1})])}const jt=f(St,[["render",It],["__scopeId","data-v-272e7ab3"]]),Lt=1e4,Ot=5,zt=t=>{let o=1;const r=e.reactive({messages:[]}),l=s=>{r.messages=r.messages.filter(({id:a})=>a!==s)},c=e.createApp({parent:t,data(){return r},render(){return e.h(jt,{messages:this.messages,onRemoveMessage:l})}}),i=document.createElement("div");document.body.appendChild(i),c.mount(i);const n=(s,a="success",p=Lt)=>{const d=o++;r.messages.push({text:s,type:a,id:d}),r.messages.length>Ot&&r.messages.shift(),p>0&&setTimeout(()=>l(d),p)};t.config.globalProperties.$snackbar={success:s=>n(s,"success"),error:s=>n(s,"error",0)}};function L(){var t;return(t=e.getCurrentInstance())==null?void 0:t.appContext.config.globalProperties.$snackbar}class V extends Error{}function O(t,o={}){const r=L(),l=j(),c=g.useRouter(),i=e.ref(!1),n=e.ref(),s=e.ref(Object.freeze({})),a=async p=>{var d,_;if(!(o.confirm&&l&&!await l.confirm(typeof o.confirm=="function"?o.confirm(p):o.confirm))){try{if(i.value=!0,o.validator){const u=await o.validator(p);if((d=o.onValidationResults)==null||d.call(o,u),!u)throw new V;if(typeof u=="object"&&(s.value=(u==null?void 0:u.errors)||{},!(u!=null&&u.isValid)))throw new V}n.value=await t(p)}catch(u){if(o.errorMessage&&r&&r.error(typeof o.errorMessage=="function"?o.errorMessage(u,p):o.errorMessage||u.message),i.value=!1,o.onError&&o.onError({error:u,data:p,router:c,snackbar:r}))return;throw u}return i.value=!1,o.successMessage&&r&&r.success(typeof o.successMessage=="function"?o.successMessage(n.value,p):o.successMessage),(_=o.onSuccess)==null||_.call(o,{result:n.value,data:p,router:c,snackbar:r}),o.redirectOnSuccess&&c.push(typeof o.redirectOnSuccess=="function"?o.redirectOnSuccess(n.value,p):o.redirectOnSuccess),n.value}};return o.immediate&&e.onMounted(a),{submit:a,errors:s,result:n,isSubmitting:i}}const Ft=(t,o={})=>{const{isSubmitting:r,submit:l,result:c}=O(t,{onSuccess:({router:i,data:n,result:s})=>{var a;return(a=o.onSuccess)==null?void 0:a.call(o,{data:s,params:n,router:i})},onError:({router:i,error:n,data:s})=>{var a;return(a=o.onError)==null?void 0:a.call(o,{error:n,params:s,router:i})},successMessage:o.successMessage,errorMessage:o.errorMessage,immediate:o.immediate});return{load:l,isLoading:r,data:c}};function Dt(t,o){const r=l=>{var c;(c=t.value)!=null&&c.contains(l.target)||o()};window.addEventListener("mousedown",r),e.onUnmounted(()=>{window.removeEventListener("mousedown",r)})}function Pt(t,o){const r=l=>{l.key===t&&o(l)};e.onMounted(()=>{window.addEventListener("keydown",r)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",r)})}function z(t,o={}){const r=g.useRoute(),l=g.useRouter(),c=e.computed(()=>{var s;let n=r.query;return(s=o.filter)!=null&&s.length&&(n=Object.fromEntries(Object.entries(n).filter(([a])=>{var p;return(p=o.filter)==null?void 0:p.includes(a)}))),o.parse&&(n=Object.fromEntries(Object.entries(n).map(([a,p])=>{var d;return[a,(d=o.parse)!=null&&d[a]?o.parse[a](p):p]}))),n}),i=n=>(o.serialize&&(n=Object.fromEntries(Object.entries(n).map(([s,a])=>{var p;return[s,(p=o.serialize)!=null&&p[s]?o.serialize[s](a):a]}))),l.push({query:n}));return e.watch(c,()=>t(c.value),{immediate:o.immediate}),{params:c,setQuery:i}}function Tt(t,o={}){const{params:r,setQuery:l}=z(n=>t(n.page),{filter:["page"],parse:{page:n=>Number(n)||1},immediate:o.immediate});return{page:e.computed(()=>r.value.page),setPage:n=>l({page:String(n)})}}m.Breadcrumbs=$o,m.Button=y,m.Checkbox=S,m.CheckboxGroup=Io,m.Form=Go,m.FormFields=N,m.FormGroup=M,m.Icon=h,m.Input=Ho,m.ModalLayout=I,m.Radio=lt,m.Select=it,m.Table=_t,m.Textarea=ut,m.ValidationError=V,m.modal=Et,m.registerCustomIconResolver=ko,m.snackbar=zt,m.useLoadData=Ft,m.useModal=j,m.useOnClickOutside=Dt,m.useOnKeyPress=Pt,m.usePageFromRouteQuery=Tt,m.useRouteQuery=z,m.useSnackbar=L,m.useSubmitAction=O,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vuiii",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.8",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite",
|
|
6
6
|
"build": "vite build && vue-tsc --emitDeclarationOnly --declaration",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"unpkg": "./dist/vuiii.umd.js",
|
|
24
24
|
"jsdelivr": "./dist/vuiii.umd.js",
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
|
-
"dependencies": {
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"storybook": "^6.5.14"
|
|
28
|
+
},
|
|
27
29
|
"devDependencies": {
|
|
28
30
|
"@babel/core": "^7.20.2",
|
|
29
31
|
"@babel/runtime": "^7.18.3",
|