@gopowerteam/form-render 0.0.54 → 0.0.56
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/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),k=require("@arco-design/web-vue"),ne=require("dayjs"),fe=require("./resolver.cjs");const me=Symbol("ArcoConfigProvider"),he="arco",ve="$arco",X=e=>{var l,n,r;const a=t.getCurrentInstance(),c=t.inject(me,void 0),o=(r=(n=c==null?void 0:c.prefixCls)!=null?n:(l=a==null?void 0:a.appContext.config.globalProperties[ve])==null?void 0:l.classPrefix)!=null?r:he;return e?`${o}-${e}`:o},pe=Object.prototype.toString;function J(e){return pe.call(e)==="[object Number]"&&e===e}var Q=(e,l)=>{for(const[n,r]of l)e[n]=r;return e};const ye=t.defineComponent({name:"IconDown",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:e=>["butt","round","square"].includes(e)},strokeLinejoin:{type:String,default:"miter",validator:e=>["arcs","bevel","miter","miter-clip","round"].includes(e)},rotate:Number,spin:Boolean},emits:{click:e=>!0},setup(e,{emit:l}){const n=X("icon"),r=t.computed(()=>[n,`${n}-down`,{[`${n}-spin`]:e.spin}]),a=t.computed(()=>{const o={};return e.size&&(o.fontSize=J(e.size)?`${e.size}px`:e.size),e.rotate&&(o.transform=`rotate(${e.rotate}deg)`),o});return{cls:r,innerStyle:a,onClick:o=>{l("click",o)}}}}),ge=["stroke-width","stroke-linecap","stroke-linejoin"],be=t.createElementVNode("path",{d:"M39.6 17.443 24.043 33 8.487 17.443"},null,-1),ke=[be];function we(e,l,n,r,a,c){return t.openBlock(),t.createElementBlock("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.innerStyle),"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,onClick:l[0]||(l[0]=(...o)=>e.onClick&&e.onClick(...o))},ke,14,ge)}var q=Q(ye,[["render",we]]);const Ce=Object.assign(q,{install:(e,l)=>{var n;const r=(n=l==null?void 0:l.iconPrefix)!=null?n:"";e.component(r+q.name,q)}}),Se=t.defineComponent({name:"IconUp",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:e=>["butt","round","square"].includes(e)},strokeLinejoin:{type:String,default:"miter",validator:e=>["arcs","bevel","miter","miter-clip","round"].includes(e)},rotate:Number,spin:Boolean},emits:{click:e=>!0},setup(e,{emit:l}){const n=X("icon"),r=t.computed(()=>[n,`${n}-up`,{[`${n}-spin`]:e.spin}]),a=t.computed(()=>{const o={};return e.size&&(o.fontSize=J(e.size)?`${e.size}px`:e.size),e.rotate&&(o.transform=`rotate(${e.rotate}deg)`),o});return{cls:r,innerStyle:a,onClick:o=>{l("click",o)}}}}),xe=["stroke-width","stroke-linecap","stroke-linejoin"],Ve=t.createElementVNode("path",{d:"M39.6 30.557 24.043 15 8.487 30.557"},null,-1),Ne=[Ve];function $e(e,l,n,r,a,c){return t.openBlock(),t.createElementBlock("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.innerStyle),"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,onClick:l[0]||(l[0]=(...o)=>e.onClick&&e.onClick(...o))},Ne,14,xe)}var G=Q(Se,[["render",$e]]);const Fe=Object.assign(G,{install:(e,l)=>{var n;const r=(n=l==null?void 0:l.iconPrefix)!=null?n:"";e.component(r+G.name,G)}}),Be=t.defineComponent({name:"IconSearch",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:e=>["butt","round","square"].includes(e)},strokeLinejoin:{type:String,default:"miter",validator:e=>["arcs","bevel","miter","miter-clip","round"].includes(e)},rotate:Number,spin:Boolean},emits:{click:e=>!0},setup(e,{emit:l}){const n=X("icon"),r=t.computed(()=>[n,`${n}-search`,{[`${n}-spin`]:e.spin}]),a=t.computed(()=>{const o={};return e.size&&(o.fontSize=J(e.size)?`${e.size}px`:e.size),e.rotate&&(o.transform=`rotate(${e.rotate}deg)`),o});return{cls:r,innerStyle:a,onClick:o=>{l("click",o)}}}}),Ee=["stroke-width","stroke-linecap","stroke-linejoin"],Oe=t.createElementVNode("path",{d:"M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485"},null,-1),Ie=[Oe];function _e(e,l,n,r,a,c){return t.openBlock(),t.createElementBlock("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.innerStyle),"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,onClick:l[0]||(l[0]=(...o)=>e.onClick&&e.onClick(...o))},Ie,14,Ee)}var H=Q(Be,[["render",_e]]);const Me=Object.assign(H,{install:(e,l)=>{var n;const r=(n=l==null?void 0:l.iconPrefix)!=null?n:"";e.component(r+H.name,H)}}),U=Symbol("__MODAL__");function ae(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function V(e){return typeof e=="function"?e():t.unref(e)}const oe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Re=Object.prototype.toString,je=e=>Re.call(e)==="[object Object]",ze=()=>{};function Te(e,l={}){if(!t.isRef(e))return t.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const r in e.value)n[r]=t.customRef(()=>({get(){return e.value[r]},set(a){var c;if((c=V(l.replaceRef))==null||c)if(Array.isArray(e.value)){const o=[...e.value];o[r]=a,e.value=o}else{const o={...e.value,[r]:a};Object.setPrototypeOf(o,Object.getPrototypeOf(e.value)),e.value=o}else e.value[r]=a}}));return n}function Le(e,l=!0){t.getCurrentInstance()?t.onMounted(e):l?e():t.nextTick(e)}function _(e){var l;const n=V(e);return(l=n==null?void 0:n.$el)!=null?l:n}const W=oe?window:void 0;function Y(...e){let l,n,r,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,a]=e,l=W):[l,n,r,a]=e,!l)return ze;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const c=[],o=()=>{c.forEach(u=>u()),c.length=0},f=(u,d,i,v)=>(u.addEventListener(d,i,v),()=>u.removeEventListener(d,i,v)),g=t.watch(()=>[_(l),V(a)],([u,d])=>{if(o(),!u)return;const i=je(d)?{...d}:d;c.push(...n.flatMap(v=>r.map(h=>f(u,v,h,i))))},{immediate:!0,flush:"post"}),s=()=>{g(),o()};return ae(s),s}function Pe(){const e=t.ref(!1);return t.getCurrentInstance()&&t.onMounted(()=>{e.value=!0}),e}function De(e){const l=Pe();return t.computed(()=>(l.value,!!e()))}function Ae(e,l={}){var n,r;const{pointerTypes:a,preventDefault:c,stopPropagation:o,exact:f,onMove:g,onEnd:s,onStart:u,initialValue:d,axis:i="both",draggingElement:v=W,containerElement:h,handle:w=e}=l,p=t.ref((n=V(d))!=null?n:{x:0,y:0}),S=t.ref(),$=b=>a?a.includes(b.pointerType):!0,y=b=>{V(c)&&b.preventDefault(),V(o)&&b.stopPropagation()},C=b=>{var O;if(!$(b)||V(f)&&b.target!==V(e))return;const x=V(h),I=(O=x==null?void 0:x.getBoundingClientRect)==null?void 0:O.call(x),F=V(e).getBoundingClientRect(),B={x:b.clientX-(x?F.left-I.left:F.left),y:b.clientY-(x?F.top-I.top:F.top)};(u==null?void 0:u(B,b))!==!1&&(S.value=B,y(b))},E=b=>{var O;if(!$(b)||!S.value)return;const x=V(h),I=(O=x==null?void 0:x.getBoundingClientRect)==null?void 0:O.call(x),F=V(e).getBoundingClientRect();let{x:B,y:M}=p.value;(i==="x"||i==="both")&&(B=b.clientX-S.value.x,x&&(B=Math.min(Math.max(0,B),I.width-F.width))),(i==="y"||i==="both")&&(M=b.clientY-S.value.y,x&&(M=Math.min(Math.max(0,M),I.height-F.height))),p.value={x:B,y:M},g==null||g(p.value,b),y(b)},L=b=>{$(b)&&S.value&&(S.value=void 0,s==null||s(p.value,b),y(b))};if(oe){const b={capture:(r=l.capture)!=null?r:!0};Y(w,"pointerdown",C,b),Y(v,"pointermove",E,b),Y(v,"pointerup",L,b)}return{...Te(p),position:p,isDragging:t.computed(()=>!!S.value),style:t.computed(()=>`left:${p.value.x}px;top:${p.value.y}px;`)}}function Ue(e,l,n={}){const{window:r=W,...a}=n;let c;const o=De(()=>r&&"ResizeObserver"in r),f=()=>{c&&(c.disconnect(),c=void 0)},g=t.computed(()=>Array.isArray(e)?e.map(d=>_(d)):[_(e)]),s=t.watch(g,d=>{if(f(),o.value&&r){c=new ResizeObserver(l);for(const i of d)i&&c.observe(i,a)}},{immediate:!0,flush:"post",deep:!0}),u=()=>{f(),s()};return ae(u),{isSupported:o,stop:u}}function R(e,l={width:0,height:0},n={}){const{window:r=W,box:a="content-box"}=n,c=t.computed(()=>{var d,i;return(i=(d=_(e))==null?void 0:d.namespaceURI)==null?void 0:i.includes("svg")}),o=t.ref(l.width),f=t.ref(l.height),{stop:g}=Ue(e,([d])=>{const i=a==="border-box"?d.borderBoxSize:a==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(r&&c.value){const v=_(e);if(v){const h=r.getComputedStyle(v);o.value=Number.parseFloat(h.width),f.value=Number.parseFloat(h.height)}}else if(i){const v=Array.isArray(i)?i:[i];o.value=v.reduce((h,{inlineSize:w})=>h+w,0),f.value=v.reduce((h,{blockSize:w})=>h+w,0)}else o.value=d.contentRect.width,f.value=d.contentRect.height},n);Le(()=>{const d=_(e);d&&(o.value="offsetWidth"in d?d.offsetWidth:l.width,f.value="offsetHeight"in d?d.offsetHeight:l.height)});const s=t.watch(()=>_(e),d=>{o.value=d?l.width:0,f.value=d?l.height:0});function u(){g(),s()}return{width:o,height:f,stop:u}}const We=e=>(t.pushScopeId("data-v-189513f2"),e=e(),t.popScopeId(),e),qe={class:"title text-16px font-bold"},Ge={class:"action"},He=["form"],Ye={key:2,class:"modal-loading"},Xe=We(()=>t.createElementVNode("div",{class:"lds-ring"},[t.createElementVNode("div"),t.createElementVNode("div"),t.createElementVNode("div"),t.createElementVNode("div")],-1)),Je=[Xe],Qe={name:"ModalContainer",inheritAttrs:!0},Ke=t.defineComponent({...Qe,props:{id:{},form:{},component:{},componentProps:{},width:{},maxWidth:{},maxHeight:{default:90},sizes:{},size:{default:"middle"},fullscreen:{type:Boolean},title:{},header:{type:Boolean,default:!0},footer:{type:Boolean,default:!1},closeable:{type:Boolean,default:!0},esc:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},mode:{default:"dialog"},type:{},offset:{},backgroundColor:{},bodyStyle:{},submitText:{default:"确定"},cancelText:{default:"取消"},zIndex:{default:1e3}},emits:["submit"],setup(e,{expose:l,emit:n}){t.useCssVars(m=>({b10a2d42:m.zIndex}));const r=e,a=n,c=t.inject(U),o=t.ref(!1);let f=0,g=0;const s=t.shallowRef(),u=t.shallowRef(),d=t.shallowRef(),i=t.shallowRef(),v=t.shallowRef(),h=t.shallowRef(),{height:w}=R(s),{height:p}=R(d,void 0,{box:"border-box"}),{height:S}=R(i,void 0,{box:"border-box"}),{height:$}=R(v),{height:y}=R(h),{x:C,y:E}=Ae(d,{initialValue:{x:0,y:0}});function L(){c==null||c.close(r.id)}function b(m){return typeof m=="number"?`${m}px`:m}const O=t.computed(()=>{const m={};return r.mode==="dialog"&&(m.justifyContent="center"),r.mode==="drawer"&&(m.justifyContent="flex-end"),m}),x=t.computed(()=>{const m={};return r.size&&(m.width=b(r.sizes[r.size])),r.width&&(m.width=b(r.width)),r.maxWidth&&(m.maxWidth=b(r.maxWidth)),r.fullscreen&&(m.maxWidth="unset",m.width="100%",m.position="fixed",m.top=0,m.left=0,m.bottom=0,m.right=0,m.borderRadius=0),r.draggable&&!r.fullscreen&&r.mode==="dialog"&&(m.transform=`translate3d(${C.value-f}px, ${E.value-g}px, 0px)`),r.mode==="drawer"&&(m.borderRadius=0,m.height="100%"),r.offset&&r.mode==="dialog"&&(m.marginLeft=`${r.offset.x||0}px`,m.marginTop=`${r.offset.y||0}px`),r.backgroundColor&&(m.backgroundColor=r.backgroundColor),m}),I=t.computed(()=>{const m={};return r.draggable&&!r.fullscreen&&r.mode==="dialog"&&(m.cursor="move"),m}),F=t.computed(()=>{const m={},N=$.value+y.value+p.value+S.value,te=Math.floor(w.value*(Number(b(r.maxHeight).replace("%",""))/100));return r.maxHeight&&(m.maxHeight=`${te-N}px`),r.mode==="drawer"&&(m.maxHeight="unset",m.height=`${w.value-N}px`),r.fullscreen&&(m.maxHeight="unset",m.height=`calc(100% - ${N}px)`),r.type!=="component"&&(m.padding="0"),r.bodyStyle&&Object.assign(m,r.bodyStyle),m});function B(){const m=u.value;if(r.form&&m){const N=m.querySelector(`form[name="${r.form}"]`);N&&N.dispatchEvent(new Event("submit"))}a("submit")}function M(){c==null||c.close(r.id)}function ue(){window&&window.addEventListener("resize",()=>{t.triggerRef(s),t.triggerRef(u),u.value&&(f=u.value.offsetLeft,g=u.value.offsetTop)})}function ie(){if(r.closeable&&r.esc){const m=({key:N})=>{N==="Escape"&&(c==null||c.close(r.id),window.removeEventListener("keydown",m))};window.addEventListener("keydown",m)}}function de(){f=u.value.offsetLeft,g=u.value.offsetTop}t.onMounted(()=>{ie(),ue()}),t.onUnmounted(()=>{});function se(){return o.value=!0,()=>ee()}function ee(){o.value=!1}return l({showLoading:se,hideLoading:ee}),(m,N)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"wrapperRef",ref:s,class:"modal-wrapper",style:t.normalizeStyle(O.value),onClick:N[0]||(N[0]=t.withModifiers(te=>m.maskClosable&&L(),["self"]))},[t.createElementVNode("div",{ref_key:"contentRef",ref:u,class:t.normalizeClass(["modal-content",{[`${m.mode}-mode`]:!0}]),style:t.normalizeStyle(x.value)},[m.header?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"headerRef",ref:d,class:"modal-header",style:t.normalizeStyle(I.value),onMousedown:de},[t.createElementVNode("div",qe,t.toDisplayString(m.title),1),t.createElementVNode("div",Ge,[m.closeable?(t.openBlock(),t.createElementBlock("div",{key:0,class:"i-icon-park-outline:close block cursor-pointer",onClick:L})):t.createCommentVNode("",!0)])],36)):t.createCommentVNode("",!0),t.createElementVNode("div",{id:"modal-header-slot",ref_key:"headerSlotRef",ref:v},null,512),t.createElementVNode("div",{class:"modal-body",style:t.normalizeStyle(F.value)},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(m.component),t.normalizeProps(t.guardReactiveProps(m.componentProps)),null,16))],4),t.createElementVNode("div",{id:"modal-footer-slot",ref_key:"footerSlotRef",ref:h},null,512),m.footer?(t.openBlock(),t.createElementBlock("div",{key:1,ref_key:"footerRef",ref:i,class:"modal-footer space-x-2"},[t.createElementVNode("button",{class:"cancel-button",type:"button",onClick:M},t.toDisplayString(m.cancelText),1),t.createElementVNode("button",{class:"submit-button",form:m.form,type:"submit",onClick:B},t.toDisplayString(m.submitText),9,He)],512)):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createElementBlock("div",Ye,Je)):t.createCommentVNode("",!0)],6)],4))}}),K=(e,l)=>{const n=e.__vccOpts||e;for(const[r,a]of l)n[r]=a;return n},Ze=K(Ke,[["__scopeId","data-v-189513f2"]]),et={class:"modal-dialog"},tt={class:"dialog-body"},nt={class:"dialog-title"},rt={class:"dialog-content"},lt=t.defineComponent({__name:"modal-dialog",props:{type:{},title:{},content:{},okText:{default:"确定"},cancelText:{default:"取消"},onOk:{},onCancel:{},footer:{}},setup(e){const l=e,n=ce(),r=t.computed(()=>l.title?l.title:{confirm:"提示",info:"提示",warning:"警告",error:"错误",success:"成功"}[l.type]);async function a(){l.onOk&&await l.onOk(),n.close()}async function c(){l.onCancel&&await l.onCancel(),n.close()}return(o,f)=>(t.openBlock(),t.createElementBlock("section",et,[t.createElementVNode("div",tt,[t.createElementVNode("div",nt,t.toDisplayString(r.value),1),t.createElementVNode("div",rt,t.toDisplayString(o.content),1)]),t.createElementVNode("div",{class:"dialog-footer space-x-2",style:t.normalizeStyle(o.type==="confirm"?{"justify-content":"end"}:{"border-top":"none"})},[o.footer?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.footer),{key:0})):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("button",{class:"submit-button",type:"submit",onClick:a},t.toDisplayString(o.okText),1),o.type==="confirm"?(t.openBlock(),t.createElementBlock("button",{key:0,class:"cancel-button",type:"button",onClick:c},t.toDisplayString(o.cancelText),1)):t.createCommentVNode("",!0)],64))],4)]))}}),at=K(lt,[["__scopeId","data-v-8326e5a5"]]),ot={key:0,class:"modal-teleport"},ct={name:"ModalProvider",inheritAttrs:!0},ut=t.defineComponent({...ct,props:{appendToBody:{type:[Boolean,String],default:!1},sizes:{default:()=>({small:520,middle:860,large:1190})},maxWidth:{default:"90%"},maxHeight:{default:"90%"},offset:{default:()=>({x:0,y:0})}},setup(e,{expose:l}){const n=t.shallowRef([]),r=t.ref(!1),a=t.getCurrentInstance();function c(i,v={},h={}){const w=t.defineAsyncComponent(()=>Promise.resolve(typeof i=="string"?at:i));typeof i=="string"&&(v.type=i,h.size="small",h.fullscreen=!1,h.mode="dialog",h.footer=!1,h.header=!1);const p=Math.random().toString(32).slice(2),S=Object.assign({zIndex:typeof i=="string"?1100:1e3},h),$=new Promise((y,C)=>{n.value.push({id:p,component:w,props:v||{},options:{...S,type:typeof i=="string"?i:"component"},resolve:y,reject:C,listeners:[]}),t.triggerRef(n)}).catch(y=>y==="CANCEL"?new Promise(()=>{}):Promise.reject(y));return Object.assign($,{close:()=>o(p)})}function o(i,v){const h=n.value.findIndex(p=>p.id===i);if(h<0)return;const w=n.value[h];v===void 0?w==null||w.reject("CANCEL"):w==null||w.resolve(v),n.value.splice(h,1),t.triggerRef(n)}function f(){!n.value||n.value.length===0||(n.value.forEach(i=>{i==null||i.reject("CANCEL")}),n.value=[],t.triggerRef(n))}function g(i,v){const h=n.value.find(p=>p.id===i);if(!h)return;const w=h.listeners.find(p=>p.event===v);w&&w.callback({open:c,close:p=>o(h.id,p),closeAll:f,showLoading:()=>s(h.id),hideLoading:()=>u(h.id),confirm:p=>c("confirm",p),success:p=>c("success",p),error:p=>c("error",p),warning:p=>c("warning",p),info:p=>c("info",p)})}function s(i){if(!a)return;const[v]=a.refs[`modal-container_${i}`];if(v)return v.showLoading()}function u(i){if(!a)return;const[v]=a.refs[`modal-container_${i}`];if(v)return v.hideLoading()}function d(i,v,h){const w=n.value.find(p=>p.id===i);w&&w.listeners.push({event:v,callback:h})}return t.provide(U,{open:c,close:o,closeAll:f,addEventListener:d}),l({elements:n,open:c,close:o,closeAll:f}),t.onMounted(()=>{r.value=!0}),(i,v)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.renderSlot(i.$slots,"default",{},void 0,!0),r.value?(t.openBlock(),t.createElementBlock("div",ot,[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!i.appendToBody,to:typeof i.appendToBody=="string"?i.appendToBody:"body"},[t.createVNode(t.TransitionGroup,{name:"modal-fade"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,h=>(t.openBlock(),t.createBlock(Ze,t.mergeProps({id:h.id,key:h.id,ref_for:!0,ref:`modal-container_${h.id}`,component:h.component,"component-props":h.props,"max-height":i.maxHeight,"max-width":i.maxWidth,offset:i.offset,sizes:i.sizes},h.options,{onSubmit:()=>g(h.id,"submit")}),null,16,["id","component","component-props","max-height","max-width","offset","sizes","onSubmit"]))),128))]),_:1})],8,["disabled","to"]))])):t.createCommentVNode("",!0)],64))}}),it=K(ut,[["__scopeId","data-v-45a851d0"]]);function D(e,l){var n,r;let a=e==null?void 0:e.parent;for(;a&&((n=a==null?void 0:a.type)==null?void 0:n.name)!==l;)a=a.parent;return((r=a==null?void 0:a.type)==null?void 0:r.name)===l?a:null}function ce(){const e=t.inject(U),l=t.getCurrentInstance();function n(r,a,c){if(!e)throw new Error("Not Found Modal Provider Component");return e.open(r,a,c)}return{open:n,close(r){var a;if(!e)throw new Error("Not Found Modal Provider Component");const c=D(l,"ModalContainer"),o=(a=c==null?void 0:c.props)==null?void 0:a.id;if(!o)throw new Error("Not Found Current Modal Container");e.close(o,r)},closeAll(){if(!e)throw new Error("Not Found Modal Provider Component");e.closeAll()},showLoading(){var r;if(!e)throw new Error("Not Found Modal Provider Component");const a=D(l,"ModalContainer");if(!((r=a==null?void 0:a.props)!=null&&r.id))throw new Error("Not Found Current Modal Container");a!=null&&a.exposed&&(a==null||a.exposed.showLoading())},hideLoading(){var r;if(!e)throw new Error("Not Found Modal Provider Component");const a=D(l,"ModalContainer");if(!((r=a==null?void 0:a.props)!=null&&r.id))throw new Error("Not Found Current Modal Container");a!=null&&a.exposed&&(a==null||a.exposed.hideLoading())},confirm(r){return this.open("confirm",r)},info(r){return this.open("info",r)},error(r){return this.open("error",r)},warning(r){return this.open("warning",r)},success(r){return this.open("success",r)}}}function dt(e){var l;const n=t.inject(U),r=t.getCurrentInstance(),a=D(r,"ModalContainer"),c=(l=a==null?void 0:a.props)==null?void 0:l.id;n&&c&&n.addEventListener(c,"submit",e)}const re={id:Symbol("ID"),source:Symbol("Source")};function st(e,l){const n=t.ref({});return e==null||e.forEach(a=>{let c=null;a.default&&(c=(typeof a.default=="function"?a.default():a.default)||null),l&&l[a.key]!==void 0&&(c=l[a.key]),n.value[a.key]=c}),[n,a=>{n.value=a}]}function ft(e){function l(n,r){return e!=null&&e.disabledDate?e.disabledDate(n,r):!1}return(n,r)=>{switch(e==null?void 0:e.type){case"week":return t.createVNode(k.WeekPicker,{modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,"disabled-date":l,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null);case"month":return t.createVNode(k.MonthPicker,{modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,"disabled-date":l,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null);case"quarter":return t.createVNode(k.QuarterPicker,{modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,"disabled-date":l,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null);case"year":return t.createVNode(k.YearPicker,{modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,"disabled-date":l,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null);case"date":default:return t.createVNode(k.DatePicker,{"disabled-input":!0,modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,"disabled-date":l,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null)}}}function mt(e){return(l,n)=>{switch(e==null?void 0:e.type){case"number":return t.createVNode(k.InputNumber,{modelValue:l[n.key],"onUpdate:modelValue":r=>l[n.key]=r,hideButton:!0,"read-only":e==null?void 0:e.readonly,placeholder:e==null?void 0:e.placeholder,allowClear:e==null?void 0:e.clearable},null);case"string":default:return t.createVNode(k.Input,{modelValue:l[n.key],"onUpdate:modelValue":r=>l[n.key]=r,placeholder:e==null?void 0:e.placeholder,readonly:e==null?void 0:e.readonly,allowClear:e==null?void 0:e.clearable},null)}}}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function Z(e,l,n){const r=t.watch(e,(...a)=>(t.nextTick(()=>r()),l(...a)),n);return r}function ht(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const j=new WeakMap;function vt(){const e=t.ref(new Map);return[e,n=>e.value=n]}function pt(e){let l,n=!1;const[r,a]=vt(),c=()=>{if(!e.autoSumbit||!l)return;let s=l;for(;s&&s.$el.tagName!=="FORM";)s=s.$parent;s&&s.$el&&s.$el.dispatchEvent(new Event("submit"))},o=(s,u)=>{const d=s();d instanceof Promise?d.then(u):u(d)},f=async()=>{const s=j.get(e.options);switch(typeof s){case"function":j.set(e.options,a);return;case"object":a(s);return}j.set(e.options,a),o(e.options,u=>{const d=j.get(e.options);j.set(e.options,u),d(u)})},g=()=>{o(e.options,s=>{a(s)})};switch(!0){case e.options instanceof Function:{e.cache!==!1?f():g();break}case t.isRef(e.options):{Z(e.options,()=>{a(e.options.value)},{immediate:!0});break}default:r.value=e.options}return(s,u)=>{let d;return e.default&&!n&&(s[u.key]=e.default,n=!0),t.createVNode(k.Select,{ref:i=>l=i,multiple:e.multiple,modelValue:s[u.key],"onUpdate:modelValue":i=>s[u.key]=i,placeholder:e.placeholder,allowClear:e.clearable,allowSearch:e.searchable,"allow-create":e.createable,maxTagCount:e.maxTagCount??2,onChange:c},ht(d=Array.from(r.value.entries()).map(([i,v])=>t.createVNode(k.Option,{key:i,value:i,label:v},null)))?d:{default:()=>[d]})}}function yt(e){function l(){e!=null&&e.autoSumbit}return(n,r)=>(e!=null&&e.default&&(n[r.key]=e.default),t.createVNode(k.Switch,{modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,checkedText:(e==null?void 0:e.openLabel)??"是",uncheckedText:(e==null?void 0:e.closeLabel)??"否",checkedValue:(e==null?void 0:e.openValue)??!0,uncheckedValue:(e==null?void 0:e.closeValue)??!1,onChange:l},null))}function gt(e){return(l,n)=>{let r=[];function a(f){r=f}function c(f){if(f&&f.length===2){const[g,s]=f.sort(),u=ne(g).startOf("days"),d=ne(s).endOf("days");l[n.key]=[u.format((e==null?void 0:e.valueFormat)||"YYYY-MM-DD"),d.format((e==null?void 0:e.valueFormat)||"YYYY-MM-DD")]}}function o(f){return e!=null&&e.disabledDate?e.disabledDate(r,f):!1}return t.createVNode("div",null,[t.createVNode(k.RangePicker,{"disabled-input":!0,style:{width:"300px"},modelValue:l[n.key],"onUpdate:modelValue":f=>l[n.key]=f,onSelect:a,onChange:c,mode:e==null?void 0:e.type,allowClear:e==null?void 0:e.clearable,"disabled-date":o,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null)])}}function bt(e){return(l,n)=>t.createVNode(k.Textarea,{modelValue:l[n.key],"onUpdate:modelValue":r=>l[n.key]=r,placeholder:e==null?void 0:e.placeholder,autoSize:e==null?void 0:e.autosize,maxLength:e==null?void 0:e.maxLength},null)}const z=new WeakMap;function kt(){const e=t.ref([]);return[e,n=>e.value=n]}function wt(e){let l,n=!1;const[r,a]=kt(),c=()=>{if(!e.autoSumbit||!l)return;let u=l;for(;u&&u.$el.tagName!=="FORM";)u=u.$parent;u&&u.$el&&u.$el.dispatchEvent(new Event("submit"))},o=(u,d)=>{const i=u();i instanceof Promise?i.then(d):d(i)},f=async()=>{const u=z.get(e.options);switch(typeof u){case"function":z.set(e.options,a);return;case"object":a(u);return}z.set(e.options,a),o(e.options,d=>{const i=z.get(e.options);z.set(e.options,d),i(d)})},g=()=>{o(e.options,u=>{a(u)})};switch(!0){case e.options instanceof Function:{e.cache!==!1?f():g();break}case t.isRef(e.options):{Z(e.options,()=>{a(e.options.value)},{immediate:!0});break}default:r.value=e.options}function s(u,d){var h;const i=((h=e.fieldNames)==null?void 0:h.title)||"title",v=d[i];return v?v.toLowerCase().includes(u.toLowerCase()):!1}return(u,d)=>(e.default&&!n&&(u[d.key]=e.default,n=!0),t.createVNode(k.TreeSelect,{ref:i=>l=i,multiple:e.multiple,modelValue:u[d.key],"onUpdate:modelValue":i=>u[d.key]=i,placeholder:e.placeholder,allowClear:e.clearable,allowSearch:e.searchable,maxTagCount:e.maxTagCount??2,onChange:c,filterTreeNode:s,data:r.value,fieldNames:e.fieldNames,treeProps:e.treeProps},{...e.slots}))}const T=new WeakMap;function Ct(){const e=t.ref([]);return[e,n=>e.value=n]}function St(e){let l,n=!1;const[r,a]=Ct(),c=()=>{if(!e.autoSumbit||!l)return;let s=l;for(;s&&s.$el.tagName!=="FORM";)s=s.$parent;s&&s.$el&&s.$el.dispatchEvent(new Event("submit"))},o=(s,u)=>{const d=s();d instanceof Promise?d.then(u):u(d)},f=async()=>{const s=T.get(e.options);switch(typeof s){case"function":T.set(e.options,a);return;case"object":a(s);return}T.set(e.options,a),o(e.options,u=>{const d=T.get(e.options);T.set(e.options,u),d(u)})},g=()=>{o(e.options,s=>{a(s)})};switch(!0){case e.options instanceof Function:{e.cache!==!1?f():g();break}case t.isRef(e.options):{Z(e.options,()=>{a(e.options.value)},{immediate:!0});break}default:r.value=e.options}return(s,u)=>(e.default&&!n&&(s[u.key]=e.default,n=!0),t.createVNode(k.Cascader,{pathMode:e.pathMode,ref:d=>l=d,multiple:e.multiple,modelValue:s[u.key],"onUpdate:modelValue":d=>s[u.key]=d,placeholder:e.placeholder,allowClear:e.clearable,allowSearch:e.searchable,maxTagCount:e.maxTagCount??2,onChange:c,options:r.value},null))}function xt(e){return l=>e(l)}const Vt={thousands:!0,inputUnit:"元",outputUnit:"元"},P={分:10**0,元:10**2,万:10**4};function Nt(e){e={...Vt,...e||{}};const l=o=>{if(o==null)return;if((e==null?void 0:e.inputUnit)===(e==null?void 0:e.outputUnit))return o;const f=P[e.outputUnit]/P[e.inputUnit];return o*f},n=o=>{if((e==null?void 0:e.inputUnit)===(e==null?void 0:e.outputUnit))return o;const f=P[e.inputUnit]/P[e.outputUnit];return o*f},r=o=>{const f=o.split(".");return f[0]=f[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),f.join(".")},a=o=>{const f=o;return e!=null&&e.thousands?r(f):f},c=o=>o.replace(/,/g,"");return(o,f)=>{const g=t.ref(l(o[f.key]));return t.watch(g,s=>{o[f.key]=n(s)}),t.createVNode(k.InputNumber,{modelValue:g.value,"onUpdate:modelValue":s=>g.value=s,formatter:a,parser:c,precision:e==null?void 0:e.precision,hideButton:!0,"read-only":e==null?void 0:e.readonly,placeholder:e==null?void 0:e.placeholder,allowClear:e==null?void 0:e.clearable},{prefix:(e==null?void 0:e.prefix)&&(()=>typeof(e==null?void 0:e.suffix)=="string"?t.createVNode("span",null,[e.suffix]):e.suffix()),suffix:()=>typeof(e==null?void 0:e.suffix)=="string"?t.createVNode("span",null,[e.suffix]):typeof(e==null?void 0:e.suffix)=="function"?e.suffix():e==null?void 0:e.inputUnit})}}function $t(){return{input:mt,textarea:bt,select:pt,treeSelect:wt,date:ft,switch:yt,dateRange:gt,render:xt,cascader:St,currency:Nt}}function Ft(e,l){l.render||(l.render=r=>r.input());const n=l.render({...$t()});return{default:()=>n(e,l)}}function Bt(e,l){return t.h(k.FormItem,{field:l.key,label:l.title},Ft(e,l))}function Et(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const Ot=t.defineComponent({props:{form:{type:Object,required:!0}},setup(e){const l=ce(),n=e.form.map(o=>({...o,collapsed:!1})),r=Array.from(new Set(n.map(o=>o.group).flat().filter(Boolean))),a=n.reduce((o,f)=>((f.group?[f.group].flat():["默认"]).forEach(g=>{let s=o.find(u=>u.group===g);s||(s={group:g,instance:void 0,form:[]},o.push(s)),s.form.push(f)}),o),[]).sort((o,f)=>o.group==="默认"?-1:f.group==="默认"?1:o.group>f.group?-1:1),c=t.ref("默认");return dt(()=>{const o=a.find(f=>f.group===c.value);if(o&&o.instance){const f=o.instance.formSource;o.instance.validate().then(()=>{l.close(f)})}}),{formItems:n,groups:r,groupForms:a,activeTab:c}},render(){const e=this.groupForms.find(l=>l.group===this.activeTab);if(this.groups.length){let l;return t.createVNode(k.Tabs,{"active-key":this.activeTab,"onUpdate:active-key":n=>this.activeTab=n},Et(l=this.groupForms.map(n=>t.createVNode(k.TabPane,{title:n.group,key:n.group},{default:()=>[t.createVNode(A,{form:n.form,ref:r=>n.instance=r},null)]})))?l:{default:()=>[l]})}else return t.createVNode(A,{form:this.formItems,ref:l=>e.instance=l},null)}});function le(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const A=t.defineComponent({props:{form:{type:Object,required:!0},value:{type:Object,required:!1},layout:{type:String,required:!1,default:"horizontal"},columns:{type:Number,required:!1},modelValue:{type:Object,required:!1},minWidth:{type:Number,required:!1,default:400},name:{type:String,required:!1,default:`form-${Math.random().toString(32).slice(2)}`},id:{type:String,required:!1,default:`form-${Math.random().toString(32).slice(2)}`},collapsedMode:{type:String,required:!1,default:"append"},submitable:{type:Boolean,required:!1,default:!1},searchable:{type:Boolean,required:!1,default:!1},footer:{type:Boolean,required:!1,default:!1}},emits:["submit","cancel","update:model-value"],expose:["formSource","updateFormField","updateFormSource","reset","validate"],setup(e,{emit:l}){const n=t.ref(),[r,a]=st(e.form,e.modelValue||e.value),c=t.ref(e.columns||0),o=t.ref(!0),f=t.ref(),g=()=>o.value=!o.value;t.provide(re.id,e.id),t.provide(re.source,r);const s=()=>{l("submit",r.value),l("update:model-value",r.value)},u=t.computed(()=>{if(!c.value)return 1;const y=e.form.reduce((C,E)=>C+((E==null?void 0:E.span)||1),0);return c.value-y%c.value}),d=t.computed(()=>e.form.reduce((y,C)=>(C.rule&&(y[C.key]=C.rule),y),{}));function i(){var C;if(e.columns)return;const y=(C=n.value)==null?void 0:C.$el;y&&(c.value=Math.floor(y.offsetWidth/e.minWidth))}function v(){var C;const y=(C=n.value)==null?void 0:C.$el;y&&(y.id=e.id)}function h(){f.value.open(Ot,{form:e.form},{title:"高级搜索",footer:!0,submitText:"搜索"}).then(y=>{y&&(w(y),s())})}t.onMounted(()=>{i(),v()});function w(y){a({...r.value,...y||{}})}function p(y,C){r.value[y]=C,w({...r.value})}function S(){var y;(y=n.value)==null||y.resetFields()}function $(){var y;return(y=n.value)==null?void 0:y.validate()}return t.onMounted(()=>{window&&window.addEventListener("resize",i)}),{formSource:r,formInstance:n,formColumns:c,formRules:d,formCollspased:o,formActiosSpan:u,toggleFormCollapsed:g,updateFormField:p,updateFormSource:w,reset:S,validate:$,onSubmitSuccess:s,openCollapsedDialog:h,modalInstance:f}},render(){const e=()=>{const n=[],r=this.footer?{span:this.formColumns}:{span:this.formActiosSpan};if(this.searchable&&(n.push(t.createVNode(k.Button,{type:"primary",htmlType:"submit"},{default:()=>[t.createTextVNode("搜索")]})),n.push(t.createVNode(k.Button,{type:"secondary",onClick:()=>{var a;return(a=this.formInstance)==null?void 0:a.resetFields()}},{default:()=>[t.createTextVNode("重置")]}))),this.submitable&&(n.push(t.createVNode(k.Button,{type:"primary",htmlType:"submit"},{default:()=>[t.createTextVNode("提交")]})),n.push(t.createVNode(k.Button,{type:"secondary",onClick:()=>this.$emit("cancel")},{default:()=>[t.createTextVNode("取消")]}))),this.form.some(a=>!!a.collapsed)&&(this.collapsedMode==="append"&&n.push(t.createVNode(k.Button,{onClick:this.toggleFormCollapsed},{default:()=>this.formCollspased?"展开":"收起",icon:()=>this.formCollspased?t.createVNode(Ce,null,null):t.createVNode(Fe,null,null)})),this.collapsedMode==="dialog"&&n.push(t.createVNode(k.Button,{onClick:this.openCollapsedDialog},{default:()=>"高级搜索",icon:()=>t.createVNode(Me,null,null)}))),this.$slots.actions&&n.push(...this.$slots.actions()),n.length)return t.createVNode(k.GridItem,r,{default:()=>[t.createVNode(k.FormItem,{contentClass:this.footer?"form-footer":""},{default:()=>[t.createVNode(k.Space,null,le(n)?n:{default:()=>[n]})]})]})},l=this.form.filter(n=>this.formCollspased?!n.collapsed:!0).filter(n=>{switch(!0){case typeof n.visiable=="boolean":return n.visiable;case typeof n.visiable=="function":return n.visiable(this.formSource);default:return!0}});return t.createVNode("div",{class:"form-render"},[t.createVNode(it,{ref:n=>this.modalInstance=n},{default:()=>[t.createVNode(k.Form,t.mergeProps({name:this.name},{labelAlign:"right",layout:this.$props.layout,rules:this.formRules,onSubmitSuccess:this.onSubmitSuccess,"auto-label-width":!0,ref:n=>this.formInstance=n,model:this.formSource}),{default:()=>[t.createVNode(k.Grid,{cols:this.formColumns,"col-gap":24,"rol-gap":10},{default:()=>[l.filter(()=>this.formColumns!==0).map(n=>{let r;return t.createVNode(k.GridItem,{span:n.span},le(r=Bt(this.formSource,n))?r:{default:()=>[r]})}),e()]})]})]})])}});function It(e){return e}function _t(e){const l=t.getCurrentInstance(),n=t.ref();function r(){var c,o;const a=(o=(c=l==null?void 0:l.proxy)==null?void 0:c.$refs)==null?void 0:o[e];a&&(n.value=a)}return t.onMounted(r),t.onUpdated(r),n}const Mt={install(e,l){e.component("FormRender",A)}};exports.FormRenderResolver=fe.FormRenderResolver;exports.FormRender=A;exports.default=Mt;exports.defineForm=It;exports.useForm=_t;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),k=require("@arco-design/web-vue"),ne=require("dayjs"),fe=require("./resolver.cjs");const me=Symbol("ArcoConfigProvider"),he="arco",ve="$arco",X=e=>{var l,n,r;const a=t.getCurrentInstance(),u=t.inject(me,void 0),o=(r=(n=u==null?void 0:u.prefixCls)!=null?n:(l=a==null?void 0:a.appContext.config.globalProperties[ve])==null?void 0:l.classPrefix)!=null?r:he;return e?`${o}-${e}`:o},pe=Object.prototype.toString;function J(e){return pe.call(e)==="[object Number]"&&e===e}var Q=(e,l)=>{for(const[n,r]of l)e[n]=r;return e};const ye=t.defineComponent({name:"IconDown",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:e=>["butt","round","square"].includes(e)},strokeLinejoin:{type:String,default:"miter",validator:e=>["arcs","bevel","miter","miter-clip","round"].includes(e)},rotate:Number,spin:Boolean},emits:{click:e=>!0},setup(e,{emit:l}){const n=X("icon"),r=t.computed(()=>[n,`${n}-down`,{[`${n}-spin`]:e.spin}]),a=t.computed(()=>{const o={};return e.size&&(o.fontSize=J(e.size)?`${e.size}px`:e.size),e.rotate&&(o.transform=`rotate(${e.rotate}deg)`),o});return{cls:r,innerStyle:a,onClick:o=>{l("click",o)}}}}),ge=["stroke-width","stroke-linecap","stroke-linejoin"],be=t.createElementVNode("path",{d:"M39.6 17.443 24.043 33 8.487 17.443"},null,-1),ke=[be];function we(e,l,n,r,a,u){return t.openBlock(),t.createElementBlock("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.innerStyle),"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,onClick:l[0]||(l[0]=(...o)=>e.onClick&&e.onClick(...o))},ke,14,ge)}var q=Q(ye,[["render",we]]);const Ce=Object.assign(q,{install:(e,l)=>{var n;const r=(n=l==null?void 0:l.iconPrefix)!=null?n:"";e.component(r+q.name,q)}}),Se=t.defineComponent({name:"IconUp",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:e=>["butt","round","square"].includes(e)},strokeLinejoin:{type:String,default:"miter",validator:e=>["arcs","bevel","miter","miter-clip","round"].includes(e)},rotate:Number,spin:Boolean},emits:{click:e=>!0},setup(e,{emit:l}){const n=X("icon"),r=t.computed(()=>[n,`${n}-up`,{[`${n}-spin`]:e.spin}]),a=t.computed(()=>{const o={};return e.size&&(o.fontSize=J(e.size)?`${e.size}px`:e.size),e.rotate&&(o.transform=`rotate(${e.rotate}deg)`),o});return{cls:r,innerStyle:a,onClick:o=>{l("click",o)}}}}),xe=["stroke-width","stroke-linecap","stroke-linejoin"],Ve=t.createElementVNode("path",{d:"M39.6 30.557 24.043 15 8.487 30.557"},null,-1),Ne=[Ve];function $e(e,l,n,r,a,u){return t.openBlock(),t.createElementBlock("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.innerStyle),"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,onClick:l[0]||(l[0]=(...o)=>e.onClick&&e.onClick(...o))},Ne,14,xe)}var G=Q(Se,[["render",$e]]);const Fe=Object.assign(G,{install:(e,l)=>{var n;const r=(n=l==null?void 0:l.iconPrefix)!=null?n:"";e.component(r+G.name,G)}}),Be=t.defineComponent({name:"IconSearch",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:e=>["butt","round","square"].includes(e)},strokeLinejoin:{type:String,default:"miter",validator:e=>["arcs","bevel","miter","miter-clip","round"].includes(e)},rotate:Number,spin:Boolean},emits:{click:e=>!0},setup(e,{emit:l}){const n=X("icon"),r=t.computed(()=>[n,`${n}-search`,{[`${n}-spin`]:e.spin}]),a=t.computed(()=>{const o={};return e.size&&(o.fontSize=J(e.size)?`${e.size}px`:e.size),e.rotate&&(o.transform=`rotate(${e.rotate}deg)`),o});return{cls:r,innerStyle:a,onClick:o=>{l("click",o)}}}}),Ee=["stroke-width","stroke-linecap","stroke-linejoin"],Oe=t.createElementVNode("path",{d:"M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485"},null,-1),Ie=[Oe];function _e(e,l,n,r,a,u){return t.openBlock(),t.createElementBlock("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.innerStyle),"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,onClick:l[0]||(l[0]=(...o)=>e.onClick&&e.onClick(...o))},Ie,14,Ee)}var H=Q(Be,[["render",_e]]);const Me=Object.assign(H,{install:(e,l)=>{var n;const r=(n=l==null?void 0:l.iconPrefix)!=null?n:"";e.component(r+H.name,H)}}),U=Symbol("__MODAL__");function ae(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function V(e){return typeof e=="function"?e():t.unref(e)}const oe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Re=Object.prototype.toString,je=e=>Re.call(e)==="[object Object]",ze=()=>{};function Te(e,l={}){if(!t.isRef(e))return t.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const r in e.value)n[r]=t.customRef(()=>({get(){return e.value[r]},set(a){var u;if((u=V(l.replaceRef))==null||u)if(Array.isArray(e.value)){const o=[...e.value];o[r]=a,e.value=o}else{const o={...e.value,[r]:a};Object.setPrototypeOf(o,Object.getPrototypeOf(e.value)),e.value=o}else e.value[r]=a}}));return n}function Le(e,l=!0){t.getCurrentInstance()?t.onMounted(e):l?e():t.nextTick(e)}function _(e){var l;const n=V(e);return(l=n==null?void 0:n.$el)!=null?l:n}const W=oe?window:void 0;function Y(...e){let l,n,r,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,a]=e,l=W):[l,n,r,a]=e,!l)return ze;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const u=[],o=()=>{u.forEach(c=>c()),u.length=0},s=(c,d,i,v)=>(c.addEventListener(d,i,v),()=>c.removeEventListener(d,i,v)),g=t.watch(()=>[_(l),V(a)],([c,d])=>{if(o(),!c)return;const i=je(d)?{...d}:d;u.push(...n.flatMap(v=>r.map(h=>s(c,v,h,i))))},{immediate:!0,flush:"post"}),f=()=>{g(),o()};return ae(f),f}function Pe(){const e=t.ref(!1);return t.getCurrentInstance()&&t.onMounted(()=>{e.value=!0}),e}function De(e){const l=Pe();return t.computed(()=>(l.value,!!e()))}function Ae(e,l={}){var n,r;const{pointerTypes:a,preventDefault:u,stopPropagation:o,exact:s,onMove:g,onEnd:f,onStart:c,initialValue:d,axis:i="both",draggingElement:v=W,containerElement:h,handle:w=e}=l,p=t.ref((n=V(d))!=null?n:{x:0,y:0}),S=t.ref(),$=b=>a?a.includes(b.pointerType):!0,y=b=>{V(u)&&b.preventDefault(),V(o)&&b.stopPropagation()},C=b=>{var O;if(!$(b)||V(s)&&b.target!==V(e))return;const x=V(h),I=(O=x==null?void 0:x.getBoundingClientRect)==null?void 0:O.call(x),F=V(e).getBoundingClientRect(),B={x:b.clientX-(x?F.left-I.left:F.left),y:b.clientY-(x?F.top-I.top:F.top)};(c==null?void 0:c(B,b))!==!1&&(S.value=B,y(b))},E=b=>{var O;if(!$(b)||!S.value)return;const x=V(h),I=(O=x==null?void 0:x.getBoundingClientRect)==null?void 0:O.call(x),F=V(e).getBoundingClientRect();let{x:B,y:M}=p.value;(i==="x"||i==="both")&&(B=b.clientX-S.value.x,x&&(B=Math.min(Math.max(0,B),I.width-F.width))),(i==="y"||i==="both")&&(M=b.clientY-S.value.y,x&&(M=Math.min(Math.max(0,M),I.height-F.height))),p.value={x:B,y:M},g==null||g(p.value,b),y(b)},L=b=>{$(b)&&S.value&&(S.value=void 0,f==null||f(p.value,b),y(b))};if(oe){const b={capture:(r=l.capture)!=null?r:!0};Y(w,"pointerdown",C,b),Y(v,"pointermove",E,b),Y(v,"pointerup",L,b)}return{...Te(p),position:p,isDragging:t.computed(()=>!!S.value),style:t.computed(()=>`left:${p.value.x}px;top:${p.value.y}px;`)}}function Ue(e,l,n={}){const{window:r=W,...a}=n;let u;const o=De(()=>r&&"ResizeObserver"in r),s=()=>{u&&(u.disconnect(),u=void 0)},g=t.computed(()=>Array.isArray(e)?e.map(d=>_(d)):[_(e)]),f=t.watch(g,d=>{if(s(),o.value&&r){u=new ResizeObserver(l);for(const i of d)i&&u.observe(i,a)}},{immediate:!0,flush:"post",deep:!0}),c=()=>{s(),f()};return ae(c),{isSupported:o,stop:c}}function R(e,l={width:0,height:0},n={}){const{window:r=W,box:a="content-box"}=n,u=t.computed(()=>{var d,i;return(i=(d=_(e))==null?void 0:d.namespaceURI)==null?void 0:i.includes("svg")}),o=t.ref(l.width),s=t.ref(l.height),{stop:g}=Ue(e,([d])=>{const i=a==="border-box"?d.borderBoxSize:a==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(r&&u.value){const v=_(e);if(v){const h=r.getComputedStyle(v);o.value=Number.parseFloat(h.width),s.value=Number.parseFloat(h.height)}}else if(i){const v=Array.isArray(i)?i:[i];o.value=v.reduce((h,{inlineSize:w})=>h+w,0),s.value=v.reduce((h,{blockSize:w})=>h+w,0)}else o.value=d.contentRect.width,s.value=d.contentRect.height},n);Le(()=>{const d=_(e);d&&(o.value="offsetWidth"in d?d.offsetWidth:l.width,s.value="offsetHeight"in d?d.offsetHeight:l.height)});const f=t.watch(()=>_(e),d=>{o.value=d?l.width:0,s.value=d?l.height:0});function c(){g(),f()}return{width:o,height:s,stop:c}}const We=e=>(t.pushScopeId("data-v-189513f2"),e=e(),t.popScopeId(),e),qe={class:"title text-16px font-bold"},Ge={class:"action"},He=["form"],Ye={key:2,class:"modal-loading"},Xe=We(()=>t.createElementVNode("div",{class:"lds-ring"},[t.createElementVNode("div"),t.createElementVNode("div"),t.createElementVNode("div"),t.createElementVNode("div")],-1)),Je=[Xe],Qe={name:"ModalContainer",inheritAttrs:!0},Ke=t.defineComponent({...Qe,props:{id:{},form:{},component:{},componentProps:{},width:{},maxWidth:{},maxHeight:{default:90},sizes:{},size:{default:"middle"},fullscreen:{type:Boolean},title:{},header:{type:Boolean,default:!0},footer:{type:Boolean,default:!1},closeable:{type:Boolean,default:!0},esc:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},mode:{default:"dialog"},type:{},offset:{},backgroundColor:{},bodyStyle:{},submitText:{default:"确定"},cancelText:{default:"取消"},zIndex:{default:1e3}},emits:["submit"],setup(e,{expose:l,emit:n}){t.useCssVars(m=>({b10a2d42:m.zIndex}));const r=e,a=n,u=t.inject(U),o=t.ref(!1);let s=0,g=0;const f=t.shallowRef(),c=t.shallowRef(),d=t.shallowRef(),i=t.shallowRef(),v=t.shallowRef(),h=t.shallowRef(),{height:w}=R(f),{height:p}=R(d,void 0,{box:"border-box"}),{height:S}=R(i,void 0,{box:"border-box"}),{height:$}=R(v),{height:y}=R(h),{x:C,y:E}=Ae(d,{initialValue:{x:0,y:0}});function L(){u==null||u.close(r.id)}function b(m){return typeof m=="number"?`${m}px`:m}const O=t.computed(()=>{const m={};return r.mode==="dialog"&&(m.justifyContent="center"),r.mode==="drawer"&&(m.justifyContent="flex-end"),m}),x=t.computed(()=>{const m={};return r.size&&(m.width=b(r.sizes[r.size])),r.width&&(m.width=b(r.width)),r.maxWidth&&(m.maxWidth=b(r.maxWidth)),r.fullscreen&&(m.maxWidth="unset",m.width="100%",m.position="fixed",m.top=0,m.left=0,m.bottom=0,m.right=0,m.borderRadius=0),r.draggable&&!r.fullscreen&&r.mode==="dialog"&&(m.transform=`translate3d(${C.value-s}px, ${E.value-g}px, 0px)`),r.mode==="drawer"&&(m.borderRadius=0,m.height="100%"),r.offset&&r.mode==="dialog"&&(m.marginLeft=`${r.offset.x||0}px`,m.marginTop=`${r.offset.y||0}px`),r.backgroundColor&&(m.backgroundColor=r.backgroundColor),m}),I=t.computed(()=>{const m={};return r.draggable&&!r.fullscreen&&r.mode==="dialog"&&(m.cursor="move"),m}),F=t.computed(()=>{const m={},N=$.value+y.value+p.value+S.value,te=Math.floor(w.value*(Number(b(r.maxHeight).replace("%",""))/100));return r.maxHeight&&(m.maxHeight=`${te-N}px`),r.mode==="drawer"&&(m.maxHeight="unset",m.height=`${w.value-N}px`),r.fullscreen&&(m.maxHeight="unset",m.height=`calc(100% - ${N}px)`),r.type!=="component"&&(m.padding="0"),r.bodyStyle&&Object.assign(m,r.bodyStyle),m});function B(){const m=c.value;if(r.form&&m){const N=m.querySelector(`form[name="${r.form}"]`);N&&N.dispatchEvent(new Event("submit"))}a("submit")}function M(){u==null||u.close(r.id)}function ue(){window&&window.addEventListener("resize",()=>{t.triggerRef(f),t.triggerRef(c),c.value&&(s=c.value.offsetLeft,g=c.value.offsetTop)})}function ie(){if(r.closeable&&r.esc){const m=({key:N})=>{N==="Escape"&&(u==null||u.close(r.id),window.removeEventListener("keydown",m))};window.addEventListener("keydown",m)}}function de(){s=c.value.offsetLeft,g=c.value.offsetTop}t.onMounted(()=>{ie(),ue()}),t.onUnmounted(()=>{});function se(){return o.value=!0,()=>ee()}function ee(){o.value=!1}return l({showLoading:se,hideLoading:ee}),(m,N)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"wrapperRef",ref:f,class:"modal-wrapper",style:t.normalizeStyle(O.value),onClick:N[0]||(N[0]=t.withModifiers(te=>m.maskClosable&&L(),["self"]))},[t.createElementVNode("div",{ref_key:"contentRef",ref:c,class:t.normalizeClass(["modal-content",{[`${m.mode}-mode`]:!0}]),style:t.normalizeStyle(x.value)},[m.header?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"headerRef",ref:d,class:"modal-header",style:t.normalizeStyle(I.value),onMousedown:de},[t.createElementVNode("div",qe,t.toDisplayString(m.title),1),t.createElementVNode("div",Ge,[m.closeable?(t.openBlock(),t.createElementBlock("div",{key:0,class:"i-icon-park-outline:close block cursor-pointer",onClick:L})):t.createCommentVNode("",!0)])],36)):t.createCommentVNode("",!0),t.createElementVNode("div",{id:"modal-header-slot",ref_key:"headerSlotRef",ref:v},null,512),t.createElementVNode("div",{class:"modal-body",style:t.normalizeStyle(F.value)},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(m.component),t.normalizeProps(t.guardReactiveProps(m.componentProps)),null,16))],4),t.createElementVNode("div",{id:"modal-footer-slot",ref_key:"footerSlotRef",ref:h},null,512),m.footer?(t.openBlock(),t.createElementBlock("div",{key:1,ref_key:"footerRef",ref:i,class:"modal-footer space-x-2"},[t.createElementVNode("button",{class:"cancel-button",type:"button",onClick:M},t.toDisplayString(m.cancelText),1),t.createElementVNode("button",{class:"submit-button",form:m.form,type:"submit",onClick:B},t.toDisplayString(m.submitText),9,He)],512)):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createElementBlock("div",Ye,Je)):t.createCommentVNode("",!0)],6)],4))}}),K=(e,l)=>{const n=e.__vccOpts||e;for(const[r,a]of l)n[r]=a;return n},Ze=K(Ke,[["__scopeId","data-v-189513f2"]]),et={class:"modal-dialog"},tt={class:"dialog-body"},nt={class:"dialog-title"},rt={class:"dialog-content"},lt=t.defineComponent({__name:"modal-dialog",props:{type:{},title:{},content:{},okText:{default:"确定"},cancelText:{default:"取消"},onOk:{},onCancel:{},footer:{}},setup(e){const l=e,n=ce(),r=t.computed(()=>l.title?l.title:{confirm:"提示",info:"提示",warning:"警告",error:"错误",success:"成功"}[l.type]);async function a(){l.onOk&&await l.onOk(),n.close()}async function u(){l.onCancel&&await l.onCancel(),n.close()}return(o,s)=>(t.openBlock(),t.createElementBlock("section",et,[t.createElementVNode("div",tt,[t.createElementVNode("div",nt,t.toDisplayString(r.value),1),t.createElementVNode("div",rt,t.toDisplayString(o.content),1)]),t.createElementVNode("div",{class:"dialog-footer space-x-2",style:t.normalizeStyle(o.type==="confirm"?{"justify-content":"end"}:{"border-top":"none"})},[o.footer?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.footer),{key:0})):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("button",{class:"submit-button",type:"submit",onClick:a},t.toDisplayString(o.okText),1),o.type==="confirm"?(t.openBlock(),t.createElementBlock("button",{key:0,class:"cancel-button",type:"button",onClick:u},t.toDisplayString(o.cancelText),1)):t.createCommentVNode("",!0)],64))],4)]))}}),at=K(lt,[["__scopeId","data-v-8326e5a5"]]),ot={key:0,class:"modal-teleport"},ct={name:"ModalProvider",inheritAttrs:!0},ut=t.defineComponent({...ct,props:{appendToBody:{type:[Boolean,String],default:!1},sizes:{default:()=>({small:520,middle:860,large:1190})},maxWidth:{default:"90%"},maxHeight:{default:"90%"},offset:{default:()=>({x:0,y:0})}},setup(e,{expose:l}){const n=t.shallowRef([]),r=t.ref(!1),a=t.getCurrentInstance();function u(i,v={},h={}){const w=t.defineAsyncComponent(()=>Promise.resolve(typeof i=="string"?at:i));typeof i=="string"&&(v.type=i,h.size="small",h.fullscreen=!1,h.mode="dialog",h.footer=!1,h.header=!1);const p=Math.random().toString(32).slice(2),S=Object.assign({zIndex:typeof i=="string"?1100:1e3},h),$=new Promise((y,C)=>{n.value.push({id:p,component:w,props:v||{},options:{...S,type:typeof i=="string"?i:"component"},resolve:y,reject:C,listeners:[]}),t.triggerRef(n)}).catch(y=>y==="CANCEL"?new Promise(()=>{}):Promise.reject(y));return Object.assign($,{close:()=>o(p)})}function o(i,v){const h=n.value.findIndex(p=>p.id===i);if(h<0)return;const w=n.value[h];v===void 0?w==null||w.reject("CANCEL"):w==null||w.resolve(v),n.value.splice(h,1),t.triggerRef(n)}function s(){!n.value||n.value.length===0||(n.value.forEach(i=>{i==null||i.reject("CANCEL")}),n.value=[],t.triggerRef(n))}function g(i,v){const h=n.value.find(p=>p.id===i);if(!h)return;const w=h.listeners.find(p=>p.event===v);w&&w.callback({open:u,close:p=>o(h.id,p),closeAll:s,showLoading:()=>f(h.id),hideLoading:()=>c(h.id),confirm:p=>u("confirm",p),success:p=>u("success",p),error:p=>u("error",p),warning:p=>u("warning",p),info:p=>u("info",p)})}function f(i){if(!a)return;const[v]=a.refs[`modal-container_${i}`];if(v)return v.showLoading()}function c(i){if(!a)return;const[v]=a.refs[`modal-container_${i}`];if(v)return v.hideLoading()}function d(i,v,h){const w=n.value.find(p=>p.id===i);w&&w.listeners.push({event:v,callback:h})}return t.provide(U,{open:u,close:o,closeAll:s,addEventListener:d}),l({elements:n,open:u,close:o,closeAll:s}),t.onMounted(()=>{r.value=!0}),(i,v)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.renderSlot(i.$slots,"default",{},void 0,!0),r.value?(t.openBlock(),t.createElementBlock("div",ot,[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!i.appendToBody,to:typeof i.appendToBody=="string"?i.appendToBody:"body"},[t.createVNode(t.TransitionGroup,{name:"modal-fade"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,h=>(t.openBlock(),t.createBlock(Ze,t.mergeProps({id:h.id,key:h.id,ref_for:!0,ref:`modal-container_${h.id}`,component:h.component,"component-props":h.props,"max-height":i.maxHeight,"max-width":i.maxWidth,offset:i.offset,sizes:i.sizes},h.options,{onSubmit:()=>g(h.id,"submit")}),null,16,["id","component","component-props","max-height","max-width","offset","sizes","onSubmit"]))),128))]),_:1})],8,["disabled","to"]))])):t.createCommentVNode("",!0)],64))}}),it=K(ut,[["__scopeId","data-v-45a851d0"]]);function D(e,l){var n,r;let a=e==null?void 0:e.parent;for(;a&&((n=a==null?void 0:a.type)==null?void 0:n.name)!==l;)a=a.parent;return((r=a==null?void 0:a.type)==null?void 0:r.name)===l?a:null}function ce(){const e=t.inject(U),l=t.getCurrentInstance();function n(r,a,u){if(!e)throw new Error("Not Found Modal Provider Component");return e.open(r,a,u)}return{open:n,close(r){var a;if(!e)throw new Error("Not Found Modal Provider Component");const u=D(l,"ModalContainer"),o=(a=u==null?void 0:u.props)==null?void 0:a.id;if(!o)throw new Error("Not Found Current Modal Container");e.close(o,r)},closeAll(){if(!e)throw new Error("Not Found Modal Provider Component");e.closeAll()},showLoading(){var r;if(!e)throw new Error("Not Found Modal Provider Component");const a=D(l,"ModalContainer");if(!((r=a==null?void 0:a.props)!=null&&r.id))throw new Error("Not Found Current Modal Container");a!=null&&a.exposed&&(a==null||a.exposed.showLoading())},hideLoading(){var r;if(!e)throw new Error("Not Found Modal Provider Component");const a=D(l,"ModalContainer");if(!((r=a==null?void 0:a.props)!=null&&r.id))throw new Error("Not Found Current Modal Container");a!=null&&a.exposed&&(a==null||a.exposed.hideLoading())},confirm(r){return this.open("confirm",r)},info(r){return this.open("info",r)},error(r){return this.open("error",r)},warning(r){return this.open("warning",r)},success(r){return this.open("success",r)}}}function dt(e){var l;const n=t.inject(U),r=t.getCurrentInstance(),a=D(r,"ModalContainer"),u=(l=a==null?void 0:a.props)==null?void 0:l.id;n&&u&&n.addEventListener(u,"submit",e)}const re={id:Symbol("ID"),source:Symbol("Source")};function st(e,l){const n=t.ref({});return e==null||e.forEach(a=>{let u=null;a.default&&(u=(typeof a.default=="function"?a.default():a.default)||null),l&&l[a.key]!==void 0&&(u=l[a.key]),n.value[a.key]=u}),[n,a=>{n.value=a}]}function ft(e){function l(n,r){return e!=null&&e.disabledDate?e.disabledDate(n,r):!1}return(n,r)=>{switch(e==null?void 0:e.type){case"week":return t.createVNode(k.WeekPicker,{modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,"disabled-date":l,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null);case"month":return t.createVNode(k.MonthPicker,{modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,"disabled-date":l,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null);case"quarter":return t.createVNode(k.QuarterPicker,{modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,"disabled-date":l,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null);case"year":return t.createVNode(k.YearPicker,{modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,"disabled-date":l,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null);case"date":default:return t.createVNode(k.DatePicker,{"disabled-input":!0,modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,"disabled-date":l,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null)}}}function mt(e){return(l,n)=>{switch(e==null?void 0:e.type){case"number":return t.createVNode(k.InputNumber,{modelValue:l[n.key],"onUpdate:modelValue":r=>l[n.key]=r,hideButton:!0,"read-only":e==null?void 0:e.readonly,placeholder:e==null?void 0:e.placeholder,allowClear:e==null?void 0:e.clearable},null);case"string":default:return t.createVNode(k.Input,{modelValue:l[n.key],"onUpdate:modelValue":r=>l[n.key]=r,placeholder:e==null?void 0:e.placeholder,readonly:e==null?void 0:e.readonly,allowClear:e==null?void 0:e.clearable},null)}}}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function Z(e,l,n){const r=t.watch(e,(...a)=>(t.nextTick(()=>r()),l(...a)),n);return r}function ht(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const j=new WeakMap;function vt(){const e=t.ref(new Map);return[e,n=>e.value=n]}function pt(e){let l,n=!1;const[r,a]=vt(),u=f=>{if(e.onChange&&e.onChange(f),!e.autoSumbit||!l)return;let c=l;for(;c&&c.$el.tagName!=="FORM";)c=c.$parent;c&&c.$el&&c.$el.dispatchEvent(new Event("submit"))},o=(f,c)=>{const d=f();d instanceof Promise?d.then(c):c(d)},s=async()=>{const f=j.get(e.options);switch(typeof f){case"function":j.set(e.options,a);return;case"object":a(f);return}j.set(e.options,a),o(e.options,c=>{const d=j.get(e.options);j.set(e.options,c),d(c)})},g=()=>{o(e.options,f=>{a(f)})};switch(!0){case e.options instanceof Function:{e.cache!==!1?s():g();break}case t.isRef(e.options):{Z(()=>e.options,()=>{a(e.options.value)},{immediate:!0});break}default:r.value=e.options}return(f,c)=>{let d;return e.default&&!n&&(f[c.key]=e.default,n=!0),t.createVNode(k.Select,{ref:i=>l=i,multiple:e.multiple,modelValue:f[c.key],"onUpdate:modelValue":i=>f[c.key]=i,placeholder:e.placeholder,allowClear:e.clearable,allowSearch:e.searchable,"allow-create":e.createable,maxTagCount:e.maxTagCount??2,onChange:u},ht(d=Array.from(r.value.entries()).map(([i,v])=>t.createVNode(k.Option,{key:i,value:i,label:v},null)))?d:{default:()=>[d]})}}function yt(e){function l(){e!=null&&e.autoSumbit}return(n,r)=>(e!=null&&e.default&&(n[r.key]=e.default),t.createVNode(k.Switch,{modelValue:n[r.key],"onUpdate:modelValue":a=>n[r.key]=a,checkedText:(e==null?void 0:e.openLabel)??"是",uncheckedText:(e==null?void 0:e.closeLabel)??"否",checkedValue:(e==null?void 0:e.openValue)??!0,uncheckedValue:(e==null?void 0:e.closeValue)??!1,onChange:l},null))}function gt(e){return(l,n)=>{let r=[];function a(s){r=s}function u(s){if(s&&s.length===2){const[g,f]=s.sort(),c=ne(g).startOf("days"),d=ne(f).endOf("days");l[n.key]=[c.format((e==null?void 0:e.valueFormat)||"YYYY-MM-DD"),d.format((e==null?void 0:e.valueFormat)||"YYYY-MM-DD")]}}function o(s){return e!=null&&e.disabledDate?e.disabledDate(r,s):!1}return t.createVNode("div",null,[t.createVNode(k.RangePicker,{"disabled-input":!0,style:{width:"300px"},modelValue:l[n.key],"onUpdate:modelValue":s=>l[n.key]=s,onSelect:a,onChange:u,mode:e==null?void 0:e.type,allowClear:e==null?void 0:e.clearable,"disabled-date":o,format:e==null?void 0:e.labelFormat,"value-format":e==null?void 0:e.valueFormat},null)])}}function bt(e){return(l,n)=>t.createVNode(k.Textarea,{modelValue:l[n.key],"onUpdate:modelValue":r=>l[n.key]=r,placeholder:e==null?void 0:e.placeholder,autoSize:e==null?void 0:e.autosize,maxLength:e==null?void 0:e.maxLength},null)}const z=new WeakMap;function kt(){const e=t.ref([]);return[e,n=>e.value=n]}function wt(e){let l,n=!1;const[r,a]=kt(),u=()=>{if(!e.autoSumbit||!l)return;let c=l;for(;c&&c.$el.tagName!=="FORM";)c=c.$parent;c&&c.$el&&c.$el.dispatchEvent(new Event("submit"))},o=(c,d)=>{const i=c();i instanceof Promise?i.then(d):d(i)},s=async()=>{const c=z.get(e.options);switch(typeof c){case"function":z.set(e.options,a);return;case"object":a(c);return}z.set(e.options,a),o(e.options,d=>{const i=z.get(e.options);z.set(e.options,d),i(d)})},g=()=>{o(e.options,c=>{a(c)})};switch(!0){case e.options instanceof Function:{e.cache!==!1?s():g();break}case t.isRef(e.options):{Z(e.options,()=>{a(e.options.value)},{immediate:!0});break}default:r.value=e.options}function f(c,d){var h;const i=((h=e.fieldNames)==null?void 0:h.title)||"title",v=d[i];return v?v.toLowerCase().includes(c.toLowerCase()):!1}return(c,d)=>(e.default&&!n&&(c[d.key]=e.default,n=!0),t.createVNode(k.TreeSelect,{ref:i=>l=i,multiple:e.multiple,modelValue:c[d.key],"onUpdate:modelValue":i=>c[d.key]=i,placeholder:e.placeholder,allowClear:e.clearable,allowSearch:e.searchable,maxTagCount:e.maxTagCount??2,onChange:u,filterTreeNode:f,data:r.value,fieldNames:e.fieldNames,treeProps:e.treeProps},{...e.slots}))}const T=new WeakMap;function Ct(){const e=t.ref([]);return[e,n=>e.value=n]}function St(e){let l,n=!1;const[r,a]=Ct(),u=()=>{if(!e.autoSumbit||!l)return;let f=l;for(;f&&f.$el.tagName!=="FORM";)f=f.$parent;f&&f.$el&&f.$el.dispatchEvent(new Event("submit"))},o=(f,c)=>{const d=f();d instanceof Promise?d.then(c):c(d)},s=async()=>{const f=T.get(e.options);switch(typeof f){case"function":T.set(e.options,a);return;case"object":a(f);return}T.set(e.options,a),o(e.options,c=>{const d=T.get(e.options);T.set(e.options,c),d(c)})},g=()=>{o(e.options,f=>{a(f)})};switch(!0){case e.options instanceof Function:{e.cache!==!1?s():g();break}case t.isRef(e.options):{Z(e.options,()=>{a(e.options.value)},{immediate:!0});break}default:r.value=e.options}return(f,c)=>(e.default&&!n&&(f[c.key]=e.default,n=!0),t.createVNode(k.Cascader,{pathMode:e.pathMode,ref:d=>l=d,multiple:e.multiple,modelValue:f[c.key],"onUpdate:modelValue":d=>f[c.key]=d,placeholder:e.placeholder,allowClear:e.clearable,allowSearch:e.searchable,maxTagCount:e.maxTagCount??2,onChange:u,options:r.value},null))}function xt(e){return l=>e(l)}const Vt={thousands:!0,inputUnit:"元",outputUnit:"元"},P={分:10**0,元:10**2,万:10**4};function Nt(e){e={...Vt,...e||{}};const l=o=>{if(o==null)return;if((e==null?void 0:e.inputUnit)===(e==null?void 0:e.outputUnit))return o;const s=P[e.outputUnit]/P[e.inputUnit];return o*s},n=o=>{if(o==null)return;if((e==null?void 0:e.inputUnit)===(e==null?void 0:e.outputUnit))return o;const s=P[e.inputUnit]/P[e.outputUnit];return o*s},r=o=>{const s=o.split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),s.join(".")},a=o=>{const s=o;return e!=null&&e.thousands?r(s):s},u=o=>o.replace(/,/g,"");return(o,s)=>{const g=t.ref(l(o[s.key]));return t.watch(g,f=>{o[s.key]=n(f)}),t.createVNode(k.InputNumber,{modelValue:g.value,"onUpdate:modelValue":f=>g.value=f,formatter:a,parser:u,precision:e==null?void 0:e.precision,hideButton:!0,"read-only":e==null?void 0:e.readonly,placeholder:e==null?void 0:e.placeholder,allowClear:e==null?void 0:e.clearable},{prefix:(e==null?void 0:e.prefix)&&(()=>typeof(e==null?void 0:e.prefix)=="string"?t.createVNode("span",null,[e.prefix]):e.prefix()),suffix:()=>typeof(e==null?void 0:e.suffix)=="string"?t.createVNode("span",null,[e.suffix]):typeof(e==null?void 0:e.suffix)=="function"?e.suffix():e==null?void 0:e.inputUnit})}}function $t(){return{input:mt,textarea:bt,select:pt,treeSelect:wt,date:ft,switch:yt,dateRange:gt,render:xt,cascader:St,currency:Nt}}function Ft(e,l){l.render||(l.render=r=>r.input());const n=l.render({...$t()});return{default:()=>n(e,l)}}function Bt(e,l){return t.h(k.FormItem,{field:l.key,label:l.title},Ft(e,l))}function Et(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const Ot=t.defineComponent({props:{form:{type:Object,required:!0}},setup(e){const l=ce(),n=e.form.map(o=>({...o,collapsed:!1})),r=Array.from(new Set(n.map(o=>o.group).flat().filter(Boolean))),a=n.reduce((o,s)=>((s.group?[s.group].flat():["默认"]).forEach(g=>{let f=o.find(c=>c.group===g);f||(f={group:g,instance:void 0,form:[]},o.push(f)),f.form.push(s)}),o),[]).sort((o,s)=>o.group==="默认"?-1:s.group==="默认"?1:o.group>s.group?-1:1),u=t.ref("默认");return dt(()=>{const o=a.find(s=>s.group===u.value);if(o&&o.instance){const s=o.instance.formSource;o.instance.validate().then(()=>{l.close(s)})}}),{formItems:n,groups:r,groupForms:a,activeTab:u}},render(){const e=this.groupForms.find(l=>l.group===this.activeTab);if(this.groups.length){let l;return t.createVNode(k.Tabs,{"active-key":this.activeTab,"onUpdate:active-key":n=>this.activeTab=n},Et(l=this.groupForms.map(n=>t.createVNode(k.TabPane,{title:n.group,key:n.group},{default:()=>[t.createVNode(A,{form:n.form,ref:r=>n.instance=r},null)]})))?l:{default:()=>[l]})}else return t.createVNode(A,{form:this.formItems,ref:l=>e.instance=l},null)}});function le(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const A=t.defineComponent({props:{form:{type:Object,required:!0},value:{type:Object,required:!1},layout:{type:String,required:!1,default:"horizontal"},columns:{type:Number,required:!1},modelValue:{type:Object,required:!1},minWidth:{type:Number,required:!1,default:400},name:{type:String,required:!1,default:`form-${Math.random().toString(32).slice(2)}`},id:{type:String,required:!1,default:`form-${Math.random().toString(32).slice(2)}`},collapsedMode:{type:String,required:!1,default:"append"},submitable:{type:Boolean,required:!1,default:!1},searchable:{type:Boolean,required:!1,default:!1},footer:{type:Boolean,required:!1,default:!1}},emits:["submit","cancel","update:model-value"],expose:["formSource","updateFormField","updateFormSource","reset","validate"],setup(e,{emit:l}){const n=t.ref(),[r,a]=st(e.form,e.modelValue||e.value),u=t.ref(e.columns||0),o=t.ref(!0),s=t.ref(),g=()=>o.value=!o.value;t.provide(re.id,e.id),t.provide(re.source,r);const f=()=>{l("submit",r.value),l("update:model-value",r.value)},c=t.computed(()=>{if(!u.value)return 1;const y=e.form.reduce((C,E)=>C+((E==null?void 0:E.span)||1),0);return u.value-y%u.value}),d=t.computed(()=>e.form.reduce((y,C)=>(C.rule&&(y[C.key]=C.rule),y),{}));function i(){var C;if(e.columns)return;const y=(C=n.value)==null?void 0:C.$el;y&&(u.value=Math.floor(y.offsetWidth/e.minWidth))}function v(){var C;const y=(C=n.value)==null?void 0:C.$el;y&&(y.id=e.id)}function h(){s.value.open(Ot,{form:e.form},{title:"高级搜索",footer:!0,submitText:"搜索"}).then(y=>{y&&(w(y),f())})}t.onMounted(()=>{i(),v()});function w(y){a({...r.value,...y||{}})}function p(y,C){r.value[y]=C,w({...r.value})}function S(){var y;(y=n.value)==null||y.resetFields()}function $(){var y;return(y=n.value)==null?void 0:y.validate()}return t.onMounted(()=>{window&&window.addEventListener("resize",i)}),{formSource:r,formInstance:n,formColumns:u,formRules:d,formCollspased:o,formActiosSpan:c,toggleFormCollapsed:g,updateFormField:p,updateFormSource:w,reset:S,validate:$,onSubmitSuccess:f,openCollapsedDialog:h,modalInstance:s}},render(){const e=()=>{const n=[],r=this.footer?{span:this.formColumns}:{span:this.formActiosSpan};if(this.searchable&&(n.push(t.createVNode(k.Button,{type:"primary",htmlType:"submit"},{default:()=>[t.createTextVNode("搜索")]})),n.push(t.createVNode(k.Button,{type:"secondary",onClick:()=>{var a;return(a=this.formInstance)==null?void 0:a.resetFields()}},{default:()=>[t.createTextVNode("重置")]}))),this.submitable&&(n.push(t.createVNode(k.Button,{type:"primary",htmlType:"submit"},{default:()=>[t.createTextVNode("提交")]})),n.push(t.createVNode(k.Button,{type:"secondary",onClick:()=>this.$emit("cancel")},{default:()=>[t.createTextVNode("取消")]}))),this.form.some(a=>!!a.collapsed)&&(this.collapsedMode==="append"&&n.push(t.createVNode(k.Button,{onClick:this.toggleFormCollapsed},{default:()=>this.formCollspased?"展开":"收起",icon:()=>this.formCollspased?t.createVNode(Ce,null,null):t.createVNode(Fe,null,null)})),this.collapsedMode==="dialog"&&n.push(t.createVNode(k.Button,{onClick:this.openCollapsedDialog},{default:()=>"高级搜索",icon:()=>t.createVNode(Me,null,null)}))),this.$slots.actions&&n.push(...this.$slots.actions()),n.length)return t.createVNode(k.GridItem,r,{default:()=>[t.createVNode(k.FormItem,{contentClass:this.footer?"form-footer":""},{default:()=>[t.createVNode(k.Space,null,le(n)?n:{default:()=>[n]})]})]})},l=this.form.filter(n=>this.formCollspased?!n.collapsed:!0).filter(n=>{switch(!0){case typeof n.visiable=="boolean":return n.visiable;case typeof n.visiable=="function":return n.visiable(this.formSource);default:return!0}});return t.createVNode("div",{class:"form-render"},[t.createVNode(it,{ref:n=>this.modalInstance=n},{default:()=>[t.createVNode(k.Form,t.mergeProps({name:this.name},{labelAlign:"right",layout:this.$props.layout,rules:this.formRules,onSubmitSuccess:this.onSubmitSuccess,"auto-label-width":!0,ref:n=>this.formInstance=n,model:this.formSource}),{default:()=>[t.createVNode(k.Grid,{cols:this.formColumns,"col-gap":24,"rol-gap":10},{default:()=>[l.filter(()=>this.formColumns!==0).map(n=>{let r;return t.createVNode(k.GridItem,{span:n.span},le(r=Bt(this.formSource,n))?r:{default:()=>[r]})}),e()]})]})]})])}});function It(e){return e}function _t(e){const l=t.getCurrentInstance(),n=t.ref();function r(){var u,o;const a=(o=(u=l==null?void 0:l.proxy)==null?void 0:u.$refs)==null?void 0:o[e];a&&(n.value=a)}return t.onMounted(r),t.onUpdated(r),n}const Mt={install(e,l){e.component("FormRender",A)}};exports.FormRenderResolver=fe.FormRenderResolver;exports.FormRender=A;exports.default=Mt;exports.defineForm=It;exports.useForm=_t;
|
package/dist/es/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import $e from "dayjs";
|
|
|
4
4
|
import { FormRenderResolver as Kn } from "./resolver.mjs";
|
|
5
5
|
const Ct = Symbol("ArcoConfigProvider"), $t = "arco", Ft = "$arco", ge = (e) => {
|
|
6
6
|
var r, t, n;
|
|
7
|
-
const l = U(),
|
|
7
|
+
const l = U(), u = le(Ct, void 0), a = (n = (t = u == null ? void 0 : u.prefixCls) != null ? t : (r = l == null ? void 0 : l.appContext.config.globalProperties[Ft]) == null ? void 0 : r.classPrefix) != null ? n : $t;
|
|
8
8
|
return e ? `${a}-${e}` : a;
|
|
9
9
|
}, Ot = Object.prototype.toString;
|
|
10
10
|
function pe(e) {
|
|
@@ -61,7 +61,7 @@ const _t = P({
|
|
|
61
61
|
}), It = ["stroke-width", "stroke-linecap", "stroke-linejoin"], Mt = /* @__PURE__ */ w("path", {
|
|
62
62
|
d: "M39.6 17.443 24.043 33 8.487 17.443"
|
|
63
63
|
}, null, -1), jt = [Mt];
|
|
64
|
-
function Tt(e, r, t, n, l,
|
|
64
|
+
function Tt(e, r, t, n, l, u) {
|
|
65
65
|
return S(), F("svg", {
|
|
66
66
|
viewBox: "0 0 48 48",
|
|
67
67
|
fill: "none",
|
|
@@ -128,7 +128,7 @@ const Lt = Object.assign(ie, {
|
|
|
128
128
|
}), Pt = ["stroke-width", "stroke-linecap", "stroke-linejoin"], Vt = /* @__PURE__ */ w("path", {
|
|
129
129
|
d: "M39.6 30.557 24.043 15 8.487 30.557"
|
|
130
130
|
}, null, -1), Rt = [Vt];
|
|
131
|
-
function Nt(e, r, t, n, l,
|
|
131
|
+
function Nt(e, r, t, n, l, u) {
|
|
132
132
|
return S(), F("svg", {
|
|
133
133
|
viewBox: "0 0 48 48",
|
|
134
134
|
fill: "none",
|
|
@@ -195,7 +195,7 @@ const Et = Object.assign(de, {
|
|
|
195
195
|
}), Bt = ["stroke-width", "stroke-linecap", "stroke-linejoin"], Dt = /* @__PURE__ */ w("path", {
|
|
196
196
|
d: "M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485"
|
|
197
197
|
}, null, -1), Ut = [Dt];
|
|
198
|
-
function Wt(e, r, t, n, l,
|
|
198
|
+
function Wt(e, r, t, n, l, u) {
|
|
199
199
|
return S(), F("svg", {
|
|
200
200
|
viewBox: "0 0 48 48",
|
|
201
201
|
fill: "none",
|
|
@@ -237,8 +237,8 @@ function Xt(e, r = {}) {
|
|
|
237
237
|
return e.value[n];
|
|
238
238
|
},
|
|
239
239
|
set(l) {
|
|
240
|
-
var
|
|
241
|
-
if ((
|
|
240
|
+
var u;
|
|
241
|
+
if ((u = I(r.replaceRef)) == null || u)
|
|
242
242
|
if (Array.isArray(e.value)) {
|
|
243
243
|
const a = [...e.value];
|
|
244
244
|
a[n] = l, e.value = a;
|
|
@@ -266,23 +266,23 @@ function fe(...e) {
|
|
|
266
266
|
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([t, n, l] = e, r = ce) : [r, t, n, l] = e, !r)
|
|
267
267
|
return Gt;
|
|
268
268
|
Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
},
|
|
269
|
+
const u = [], a = () => {
|
|
270
|
+
u.forEach((o) => o()), u.length = 0;
|
|
271
|
+
}, d = (o, i, c, h) => (o.addEventListener(i, c, h), () => o.removeEventListener(i, c, h)), p = K(
|
|
272
272
|
() => [B(r), I(l)],
|
|
273
|
-
([
|
|
274
|
-
if (a(), !
|
|
273
|
+
([o, i]) => {
|
|
274
|
+
if (a(), !o)
|
|
275
275
|
return;
|
|
276
276
|
const c = Yt(i) ? { ...i } : i;
|
|
277
|
-
|
|
278
|
-
...t.flatMap((h) => n.map((m) =>
|
|
277
|
+
u.push(
|
|
278
|
+
...t.flatMap((h) => n.map((m) => d(o, h, m, c)))
|
|
279
279
|
);
|
|
280
280
|
},
|
|
281
281
|
{ immediate: !0, flush: "post" }
|
|
282
|
-
),
|
|
282
|
+
), s = () => {
|
|
283
283
|
p(), a();
|
|
284
284
|
};
|
|
285
|
-
return Le(
|
|
285
|
+
return Le(s), s;
|
|
286
286
|
}
|
|
287
287
|
function Qt() {
|
|
288
288
|
const e = $(!1);
|
|
@@ -298,12 +298,12 @@ function Zt(e, r = {}) {
|
|
|
298
298
|
var t, n;
|
|
299
299
|
const {
|
|
300
300
|
pointerTypes: l,
|
|
301
|
-
preventDefault:
|
|
301
|
+
preventDefault: u,
|
|
302
302
|
stopPropagation: a,
|
|
303
|
-
exact:
|
|
303
|
+
exact: d,
|
|
304
304
|
onMove: p,
|
|
305
|
-
onEnd:
|
|
306
|
-
onStart:
|
|
305
|
+
onEnd: s,
|
|
306
|
+
onStart: o,
|
|
307
307
|
initialValue: i,
|
|
308
308
|
axis: c = "both",
|
|
309
309
|
draggingElement: h = ce,
|
|
@@ -312,16 +312,16 @@ function Zt(e, r = {}) {
|
|
|
312
312
|
} = r, y = $(
|
|
313
313
|
(t = I(i)) != null ? t : { x: 0, y: 0 }
|
|
314
314
|
), O = $(), j = (b) => l ? l.includes(b.pointerType) : !0, g = (b) => {
|
|
315
|
-
I(
|
|
315
|
+
I(u) && b.preventDefault(), I(a) && b.stopPropagation();
|
|
316
316
|
}, x = (b) => {
|
|
317
317
|
var R;
|
|
318
|
-
if (!j(b) || I(
|
|
318
|
+
if (!j(b) || I(d) && b.target !== I(e))
|
|
319
319
|
return;
|
|
320
320
|
const _ = I(m), N = (R = _ == null ? void 0 : _.getBoundingClientRect) == null ? void 0 : R.call(_), T = I(e).getBoundingClientRect(), L = {
|
|
321
321
|
x: b.clientX - (_ ? T.left - N.left : T.left),
|
|
322
322
|
y: b.clientY - (_ ? T.top - N.top : T.top)
|
|
323
323
|
};
|
|
324
|
-
(
|
|
324
|
+
(o == null ? void 0 : o(L, b)) !== !1 && (O.value = L, g(b));
|
|
325
325
|
}, V = (b) => {
|
|
326
326
|
var R;
|
|
327
327
|
if (!j(b) || !O.value)
|
|
@@ -333,7 +333,7 @@ function Zt(e, r = {}) {
|
|
|
333
333
|
y: W
|
|
334
334
|
}, p == null || p(y.value, b), g(b);
|
|
335
335
|
}, Z = (b) => {
|
|
336
|
-
j(b) && O.value && (O.value = void 0,
|
|
336
|
+
j(b) && O.value && (O.value = void 0, s == null || s(y.value, b), g(b));
|
|
337
337
|
};
|
|
338
338
|
if (ze) {
|
|
339
339
|
const b = { capture: (n = r.capture) != null ? n : !0 };
|
|
@@ -350,66 +350,66 @@ function Zt(e, r = {}) {
|
|
|
350
350
|
}
|
|
351
351
|
function en(e, r, t = {}) {
|
|
352
352
|
const { window: n = ce, ...l } = t;
|
|
353
|
-
let
|
|
354
|
-
const a = Kt(() => n && "ResizeObserver" in n),
|
|
355
|
-
|
|
356
|
-
}, p = C(() => Array.isArray(e) ? e.map((i) => B(i)) : [B(e)]),
|
|
353
|
+
let u;
|
|
354
|
+
const a = Kt(() => n && "ResizeObserver" in n), d = () => {
|
|
355
|
+
u && (u.disconnect(), u = void 0);
|
|
356
|
+
}, p = C(() => Array.isArray(e) ? e.map((i) => B(i)) : [B(e)]), s = K(
|
|
357
357
|
p,
|
|
358
358
|
(i) => {
|
|
359
|
-
if (
|
|
360
|
-
|
|
359
|
+
if (d(), a.value && n) {
|
|
360
|
+
u = new ResizeObserver(r);
|
|
361
361
|
for (const c of i)
|
|
362
|
-
c &&
|
|
362
|
+
c && u.observe(c, l);
|
|
363
363
|
}
|
|
364
364
|
},
|
|
365
365
|
{ immediate: !0, flush: "post", deep: !0 }
|
|
366
|
-
),
|
|
367
|
-
|
|
366
|
+
), o = () => {
|
|
367
|
+
d(), s();
|
|
368
368
|
};
|
|
369
|
-
return Le(
|
|
369
|
+
return Le(o), {
|
|
370
370
|
isSupported: a,
|
|
371
|
-
stop:
|
|
371
|
+
stop: o
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
374
|
function Y(e, r = { width: 0, height: 0 }, t = {}) {
|
|
375
|
-
const { window: n = ce, box: l = "content-box" } = t,
|
|
375
|
+
const { window: n = ce, box: l = "content-box" } = t, u = C(() => {
|
|
376
376
|
var i, c;
|
|
377
377
|
return (c = (i = B(e)) == null ? void 0 : i.namespaceURI) == null ? void 0 : c.includes("svg");
|
|
378
|
-
}), a = $(r.width),
|
|
378
|
+
}), a = $(r.width), d = $(r.height), { stop: p } = en(
|
|
379
379
|
e,
|
|
380
380
|
([i]) => {
|
|
381
381
|
const c = l === "border-box" ? i.borderBoxSize : l === "content-box" ? i.contentBoxSize : i.devicePixelContentBoxSize;
|
|
382
|
-
if (n &&
|
|
382
|
+
if (n && u.value) {
|
|
383
383
|
const h = B(e);
|
|
384
384
|
if (h) {
|
|
385
385
|
const m = n.getComputedStyle(h);
|
|
386
|
-
a.value = Number.parseFloat(m.width),
|
|
386
|
+
a.value = Number.parseFloat(m.width), d.value = Number.parseFloat(m.height);
|
|
387
387
|
}
|
|
388
388
|
} else if (c) {
|
|
389
389
|
const h = Array.isArray(c) ? c : [c];
|
|
390
|
-
a.value = h.reduce((m, { inlineSize: k }) => m + k, 0),
|
|
390
|
+
a.value = h.reduce((m, { inlineSize: k }) => m + k, 0), d.value = h.reduce((m, { blockSize: k }) => m + k, 0);
|
|
391
391
|
} else
|
|
392
|
-
a.value = i.contentRect.width,
|
|
392
|
+
a.value = i.contentRect.width, d.value = i.contentRect.height;
|
|
393
393
|
},
|
|
394
394
|
t
|
|
395
395
|
);
|
|
396
396
|
Jt(() => {
|
|
397
397
|
const i = B(e);
|
|
398
|
-
i && (a.value = "offsetWidth" in i ? i.offsetWidth : r.width,
|
|
398
|
+
i && (a.value = "offsetWidth" in i ? i.offsetWidth : r.width, d.value = "offsetHeight" in i ? i.offsetHeight : r.height);
|
|
399
399
|
});
|
|
400
|
-
const
|
|
400
|
+
const s = K(
|
|
401
401
|
() => B(e),
|
|
402
402
|
(i) => {
|
|
403
|
-
a.value = i ? r.width : 0,
|
|
403
|
+
a.value = i ? r.width : 0, d.value = i ? r.height : 0;
|
|
404
404
|
}
|
|
405
405
|
);
|
|
406
|
-
function
|
|
407
|
-
p(),
|
|
406
|
+
function o() {
|
|
407
|
+
p(), s();
|
|
408
408
|
}
|
|
409
409
|
return {
|
|
410
410
|
width: a,
|
|
411
|
-
height:
|
|
412
|
-
stop:
|
|
411
|
+
height: d,
|
|
412
|
+
stop: o
|
|
413
413
|
};
|
|
414
414
|
}
|
|
415
415
|
const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "title text-16px font-bold" }, rn = { class: "action" }, ln = ["form"], an = {
|
|
@@ -459,13 +459,13 @@ const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "titl
|
|
|
459
459
|
He((f) => ({
|
|
460
460
|
b10a2d42: f.zIndex
|
|
461
461
|
}));
|
|
462
|
-
const n = e, l = t,
|
|
463
|
-
let
|
|
464
|
-
const
|
|
462
|
+
const n = e, l = t, u = le(ue), a = $(!1);
|
|
463
|
+
let d = 0, p = 0;
|
|
464
|
+
const s = E(), o = E(), i = E(), c = E(), h = E(), m = E(), { height: k } = Y(s), { height: y } = Y(i, void 0, { box: "border-box" }), { height: O } = Y(c, void 0, { box: "border-box" }), { height: j } = Y(h), { height: g } = Y(m), { x, y: V } = Zt(i, {
|
|
465
465
|
initialValue: { x: 0, y: 0 }
|
|
466
466
|
});
|
|
467
467
|
function Z() {
|
|
468
|
-
|
|
468
|
+
u == null || u.close(n.id);
|
|
469
469
|
}
|
|
470
470
|
function b(f) {
|
|
471
471
|
return typeof f == "number" ? `${f}px` : f;
|
|
@@ -475,7 +475,7 @@ const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "titl
|
|
|
475
475
|
return n.mode === "dialog" && (f.justifyContent = "center"), n.mode === "drawer" && (f.justifyContent = "flex-end"), f;
|
|
476
476
|
}), _ = C(() => {
|
|
477
477
|
const f = {};
|
|
478
|
-
return n.size && (f.width = b(n.sizes[n.size])), n.width && (f.width = b(n.width)), n.maxWidth && (f.maxWidth = b(n.maxWidth)), n.fullscreen && (f.maxWidth = "unset", f.width = "100%", f.position = "fixed", f.top = 0, f.left = 0, f.bottom = 0, f.right = 0, f.borderRadius = 0), n.draggable && !n.fullscreen && n.mode === "dialog" && (f.transform = `translate3d(${x.value -
|
|
478
|
+
return n.size && (f.width = b(n.sizes[n.size])), n.width && (f.width = b(n.width)), n.maxWidth && (f.maxWidth = b(n.maxWidth)), n.fullscreen && (f.maxWidth = "unset", f.width = "100%", f.position = "fixed", f.top = 0, f.left = 0, f.bottom = 0, f.right = 0, f.borderRadius = 0), n.draggable && !n.fullscreen && n.mode === "dialog" && (f.transform = `translate3d(${x.value - d}px, ${V.value - p}px, 0px)`), n.mode === "drawer" && (f.borderRadius = 0, f.height = "100%"), n.offset && n.mode === "dialog" && (f.marginLeft = `${n.offset.x || 0}px`, f.marginTop = `${n.offset.y || 0}px`), n.backgroundColor && (f.backgroundColor = n.backgroundColor), f;
|
|
479
479
|
}), N = C(() => {
|
|
480
480
|
const f = {};
|
|
481
481
|
return n.draggable && !n.fullscreen && n.mode === "dialog" && (f.cursor = "move"), f;
|
|
@@ -484,7 +484,7 @@ const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "titl
|
|
|
484
484
|
return n.maxHeight && (f.maxHeight = `${Se - M}px`), n.mode === "drawer" && (f.maxHeight = "unset", f.height = `${k.value - M}px`), n.fullscreen && (f.maxHeight = "unset", f.height = `calc(100% - ${M}px)`), n.type !== "component" && (f.padding = "0"), n.bodyStyle && Object.assign(f, n.bodyStyle), f;
|
|
485
485
|
});
|
|
486
486
|
function L() {
|
|
487
|
-
const f =
|
|
487
|
+
const f = o.value;
|
|
488
488
|
if (n.form && f) {
|
|
489
489
|
const M = f.querySelector(`form[name="${n.form}"]`);
|
|
490
490
|
M && M.dispatchEvent(new Event("submit"));
|
|
@@ -492,23 +492,23 @@ const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "titl
|
|
|
492
492
|
l("submit");
|
|
493
493
|
}
|
|
494
494
|
function W() {
|
|
495
|
-
|
|
495
|
+
u == null || u.close(n.id);
|
|
496
496
|
}
|
|
497
497
|
function Ve() {
|
|
498
498
|
window && window.addEventListener("resize", () => {
|
|
499
|
-
Q(
|
|
499
|
+
Q(s), Q(o), o.value && (d = o.value.offsetLeft, p = o.value.offsetTop);
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
502
|
function Re() {
|
|
503
503
|
if (n.closeable && n.esc) {
|
|
504
504
|
const f = ({ key: M }) => {
|
|
505
|
-
M === "Escape" && (
|
|
505
|
+
M === "Escape" && (u == null || u.close(n.id), window.removeEventListener("keydown", f));
|
|
506
506
|
};
|
|
507
507
|
window.addEventListener("keydown", f);
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
function Ne() {
|
|
511
|
-
|
|
511
|
+
d = o.value.offsetLeft, p = o.value.offsetTop;
|
|
512
512
|
}
|
|
513
513
|
D(() => {
|
|
514
514
|
Re(), Ve();
|
|
@@ -525,14 +525,14 @@ const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "titl
|
|
|
525
525
|
hideLoading: xe
|
|
526
526
|
}), (f, M) => (S(), F("div", {
|
|
527
527
|
ref_key: "wrapperRef",
|
|
528
|
-
ref:
|
|
528
|
+
ref: s,
|
|
529
529
|
class: "modal-wrapper",
|
|
530
530
|
style: z(R.value),
|
|
531
531
|
onClick: M[0] || (M[0] = Ge((Se) => f.maskClosable && Z(), ["self"]))
|
|
532
532
|
}, [
|
|
533
533
|
w("div", {
|
|
534
534
|
ref_key: "contentRef",
|
|
535
|
-
ref:
|
|
535
|
+
ref: o,
|
|
536
536
|
class: ae(["modal-content", { [`${f.mode}-mode`]: !0 }]),
|
|
537
537
|
style: z(_.value)
|
|
538
538
|
}, [
|
|
@@ -619,10 +619,10 @@ const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "titl
|
|
|
619
619
|
async function l() {
|
|
620
620
|
r.onOk && await r.onOk(), t.close();
|
|
621
621
|
}
|
|
622
|
-
async function
|
|
622
|
+
async function u() {
|
|
623
623
|
r.onCancel && await r.onCancel(), t.close();
|
|
624
624
|
}
|
|
625
|
-
return (a,
|
|
625
|
+
return (a, d) => (S(), F("section", fn, [
|
|
626
626
|
w("div", mn, [
|
|
627
627
|
w("div", hn, A(n.value), 1),
|
|
628
628
|
w("div", vn, A(a.content), 1)
|
|
@@ -641,7 +641,7 @@ const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "titl
|
|
|
641
641
|
key: 0,
|
|
642
642
|
class: "cancel-button",
|
|
643
643
|
type: "button",
|
|
644
|
-
onClick:
|
|
644
|
+
onClick: u
|
|
645
645
|
}, A(a.cancelText), 1)) : H("", !0)
|
|
646
646
|
], 64))
|
|
647
647
|
], 4)
|
|
@@ -668,7 +668,7 @@ const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "titl
|
|
|
668
668
|
},
|
|
669
669
|
setup(e, { expose: r }) {
|
|
670
670
|
const t = E([]), n = $(!1), l = U();
|
|
671
|
-
function
|
|
671
|
+
function u(c, h = {}, m = {}) {
|
|
672
672
|
const k = qe(
|
|
673
673
|
() => Promise.resolve(typeof c == "string" ? gn : c)
|
|
674
674
|
);
|
|
@@ -701,7 +701,7 @@ const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "titl
|
|
|
701
701
|
const k = t.value[m];
|
|
702
702
|
h === void 0 ? k == null || k.reject("CANCEL") : k == null || k.resolve(h), t.value.splice(m, 1), Q(t);
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function d() {
|
|
705
705
|
!t.value || t.value.length === 0 || (t.value.forEach((c) => {
|
|
706
706
|
c == null || c.reject("CANCEL");
|
|
707
707
|
}), t.value = [], Q(t));
|
|
@@ -712,26 +712,26 @@ const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "titl
|
|
|
712
712
|
return;
|
|
713
713
|
const k = m.listeners.find((y) => y.event === h);
|
|
714
714
|
k && k.callback({
|
|
715
|
-
open:
|
|
715
|
+
open: u,
|
|
716
716
|
close: (y) => a(m.id, y),
|
|
717
|
-
closeAll:
|
|
718
|
-
showLoading: () =>
|
|
719
|
-
hideLoading: () =>
|
|
720
|
-
confirm: (y) =>
|
|
721
|
-
success: (y) =>
|
|
722
|
-
error: (y) =>
|
|
723
|
-
warning: (y) =>
|
|
724
|
-
info: (y) =>
|
|
717
|
+
closeAll: d,
|
|
718
|
+
showLoading: () => s(m.id),
|
|
719
|
+
hideLoading: () => o(m.id),
|
|
720
|
+
confirm: (y) => u("confirm", y),
|
|
721
|
+
success: (y) => u("success", y),
|
|
722
|
+
error: (y) => u("error", y),
|
|
723
|
+
warning: (y) => u("warning", y),
|
|
724
|
+
info: (y) => u("info", y)
|
|
725
725
|
});
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function s(c) {
|
|
728
728
|
if (!l)
|
|
729
729
|
return;
|
|
730
730
|
const [h] = l.refs[`modal-container_${c}`];
|
|
731
731
|
if (h)
|
|
732
732
|
return h.showLoading();
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function o(c) {
|
|
735
735
|
if (!l)
|
|
736
736
|
return;
|
|
737
737
|
const [h] = l.refs[`modal-container_${c}`];
|
|
@@ -746,15 +746,15 @@ const tn = (e) => (nt("data-v-189513f2"), e = e(), rt(), e), nn = { class: "titl
|
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
748
|
return me(ue, {
|
|
749
|
-
open:
|
|
749
|
+
open: u,
|
|
750
750
|
close: a,
|
|
751
|
-
closeAll:
|
|
751
|
+
closeAll: d,
|
|
752
752
|
addEventListener: i
|
|
753
753
|
}), r({
|
|
754
754
|
elements: t,
|
|
755
|
-
open:
|
|
755
|
+
open: u,
|
|
756
756
|
close: a,
|
|
757
|
-
closeAll:
|
|
757
|
+
closeAll: d
|
|
758
758
|
}), D(() => {
|
|
759
759
|
n.value = !0;
|
|
760
760
|
}), (c, h) => (S(), F(he, null, [
|
|
@@ -797,10 +797,10 @@ function ne(e, r) {
|
|
|
797
797
|
}
|
|
798
798
|
function Pe() {
|
|
799
799
|
const e = le(ue), r = U();
|
|
800
|
-
function t(n, l,
|
|
800
|
+
function t(n, l, u) {
|
|
801
801
|
if (!e)
|
|
802
802
|
throw new Error("Not Found Modal Provider Component");
|
|
803
|
-
return e.open(n, l,
|
|
803
|
+
return e.open(n, l, u);
|
|
804
804
|
}
|
|
805
805
|
return {
|
|
806
806
|
open: t,
|
|
@@ -808,7 +808,7 @@ function Pe() {
|
|
|
808
808
|
var l;
|
|
809
809
|
if (!e)
|
|
810
810
|
throw new Error("Not Found Modal Provider Component");
|
|
811
|
-
const
|
|
811
|
+
const u = ne(r, "ModalContainer"), a = (l = u == null ? void 0 : u.props) == null ? void 0 : l.id;
|
|
812
812
|
if (!a)
|
|
813
813
|
throw new Error("Not Found Current Modal Container");
|
|
814
814
|
e.close(a, n);
|
|
@@ -855,8 +855,8 @@ function Pe() {
|
|
|
855
855
|
}
|
|
856
856
|
function xn(e) {
|
|
857
857
|
var r;
|
|
858
|
-
const t = le(ue), n = U(), l = ne(n, "ModalContainer"),
|
|
859
|
-
t &&
|
|
858
|
+
const t = le(ue), n = U(), l = ne(n, "ModalContainer"), u = (r = l == null ? void 0 : l.props) == null ? void 0 : r.id;
|
|
859
|
+
t && u && t.addEventListener(u, "submit", e);
|
|
860
860
|
}
|
|
861
861
|
const Fe = {
|
|
862
862
|
id: Symbol("ID"),
|
|
@@ -865,8 +865,8 @@ const Fe = {
|
|
|
865
865
|
function Sn(e, r) {
|
|
866
866
|
const t = $({});
|
|
867
867
|
return e == null || e.forEach((l) => {
|
|
868
|
-
let
|
|
869
|
-
l.default && (
|
|
868
|
+
let u = null;
|
|
869
|
+
l.default && (u = (typeof l.default == "function" ? l.default() : l.default) || null), r && r[l.key] !== void 0 && (u = r[l.key]), t.value[l.key] = u;
|
|
870
870
|
}), [t, (l) => {
|
|
871
871
|
t.value = l;
|
|
872
872
|
}];
|
|
@@ -961,42 +961,42 @@ function On() {
|
|
|
961
961
|
}
|
|
962
962
|
function _n(e) {
|
|
963
963
|
let r, t = !1;
|
|
964
|
-
const [n, l] = On(),
|
|
965
|
-
if (!e.autoSumbit || !r)
|
|
964
|
+
const [n, l] = On(), u = (s) => {
|
|
965
|
+
if (e.onChange && e.onChange(s), !e.autoSumbit || !r)
|
|
966
966
|
return;
|
|
967
|
-
let
|
|
968
|
-
for (;
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
}, a = (
|
|
972
|
-
const i =
|
|
973
|
-
i instanceof Promise ? i.then(
|
|
974
|
-
},
|
|
975
|
-
const
|
|
976
|
-
switch (typeof
|
|
967
|
+
let o = r;
|
|
968
|
+
for (; o && o.$el.tagName !== "FORM"; )
|
|
969
|
+
o = o.$parent;
|
|
970
|
+
o && o.$el && o.$el.dispatchEvent(new Event("submit"));
|
|
971
|
+
}, a = (s, o) => {
|
|
972
|
+
const i = s();
|
|
973
|
+
i instanceof Promise ? i.then(o) : o(i);
|
|
974
|
+
}, d = async () => {
|
|
975
|
+
const s = G.get(e.options);
|
|
976
|
+
switch (typeof s) {
|
|
977
977
|
case "function":
|
|
978
978
|
G.set(e.options, l);
|
|
979
979
|
return;
|
|
980
980
|
case "object":
|
|
981
|
-
l(
|
|
981
|
+
l(s);
|
|
982
982
|
return;
|
|
983
983
|
}
|
|
984
|
-
G.set(e.options, l), a(e.options, (
|
|
984
|
+
G.set(e.options, l), a(e.options, (o) => {
|
|
985
985
|
const i = G.get(e.options);
|
|
986
|
-
G.set(e.options,
|
|
986
|
+
G.set(e.options, o), i(o);
|
|
987
987
|
});
|
|
988
988
|
}, p = () => {
|
|
989
|
-
a(e.options, (
|
|
990
|
-
l(
|
|
989
|
+
a(e.options, (s) => {
|
|
990
|
+
l(s);
|
|
991
991
|
});
|
|
992
992
|
};
|
|
993
993
|
switch (!0) {
|
|
994
994
|
case e.options instanceof Function: {
|
|
995
|
-
e.cache !== !1 ?
|
|
995
|
+
e.cache !== !1 ? d() : p();
|
|
996
996
|
break;
|
|
997
997
|
}
|
|
998
998
|
case oe(e.options): {
|
|
999
|
-
we(e.options, () => {
|
|
999
|
+
we(() => e.options, () => {
|
|
1000
1000
|
l(e.options.value);
|
|
1001
1001
|
}, {
|
|
1002
1002
|
immediate: !0
|
|
@@ -1006,19 +1006,19 @@ function _n(e) {
|
|
|
1006
1006
|
default:
|
|
1007
1007
|
n.value = e.options;
|
|
1008
1008
|
}
|
|
1009
|
-
return (
|
|
1009
|
+
return (s, o) => {
|
|
1010
1010
|
let i;
|
|
1011
|
-
return e.default && !t && (
|
|
1011
|
+
return e.default && !t && (s[o.key] = e.default, t = !0), v(ft, {
|
|
1012
1012
|
ref: (c) => r = c,
|
|
1013
1013
|
multiple: e.multiple,
|
|
1014
|
-
modelValue:
|
|
1015
|
-
"onUpdate:modelValue": (c) =>
|
|
1014
|
+
modelValue: s[o.key],
|
|
1015
|
+
"onUpdate:modelValue": (c) => s[o.key] = c,
|
|
1016
1016
|
placeholder: e.placeholder,
|
|
1017
1017
|
allowClear: e.clearable,
|
|
1018
1018
|
allowSearch: e.searchable,
|
|
1019
1019
|
"allow-create": e.createable,
|
|
1020
1020
|
maxTagCount: e.maxTagCount ?? 2,
|
|
1021
|
-
onChange:
|
|
1021
|
+
onChange: u
|
|
1022
1022
|
}, Fn(i = Array.from(n.value.entries()).map(([c, h]) => v(mt, {
|
|
1023
1023
|
key: c,
|
|
1024
1024
|
value: c,
|
|
@@ -1045,17 +1045,17 @@ function In(e) {
|
|
|
1045
1045
|
function Mn(e) {
|
|
1046
1046
|
return (r, t) => {
|
|
1047
1047
|
let n = [];
|
|
1048
|
-
function l(
|
|
1049
|
-
n =
|
|
1048
|
+
function l(d) {
|
|
1049
|
+
n = d;
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1052
|
-
if (
|
|
1053
|
-
const [p,
|
|
1054
|
-
r[t.key] = [
|
|
1051
|
+
function u(d) {
|
|
1052
|
+
if (d && d.length === 2) {
|
|
1053
|
+
const [p, s] = d.sort(), o = $e(p).startOf("days"), i = $e(s).endOf("days");
|
|
1054
|
+
r[t.key] = [o.format((e == null ? void 0 : e.valueFormat) || "YYYY-MM-DD"), i.format((e == null ? void 0 : e.valueFormat) || "YYYY-MM-DD")];
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
|
-
function a(
|
|
1058
|
-
return e != null && e.disabledDate ? e.disabledDate(n,
|
|
1057
|
+
function a(d) {
|
|
1058
|
+
return e != null && e.disabledDate ? e.disabledDate(n, d) : !1;
|
|
1059
1059
|
}
|
|
1060
1060
|
return v("div", null, [v(vt, {
|
|
1061
1061
|
"disabled-input": !0,
|
|
@@ -1063,9 +1063,9 @@ function Mn(e) {
|
|
|
1063
1063
|
width: "300px"
|
|
1064
1064
|
},
|
|
1065
1065
|
modelValue: r[t.key],
|
|
1066
|
-
"onUpdate:modelValue": (
|
|
1066
|
+
"onUpdate:modelValue": (d) => r[t.key] = d,
|
|
1067
1067
|
onSelect: l,
|
|
1068
|
-
onChange:
|
|
1068
|
+
onChange: u,
|
|
1069
1069
|
mode: e == null ? void 0 : e.type,
|
|
1070
1070
|
allowClear: e == null ? void 0 : e.clearable,
|
|
1071
1071
|
"disabled-date": a,
|
|
@@ -1090,24 +1090,24 @@ function Tn() {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
function Ln(e) {
|
|
1092
1092
|
let r, t = !1;
|
|
1093
|
-
const [n, l] = Tn(),
|
|
1093
|
+
const [n, l] = Tn(), u = () => {
|
|
1094
1094
|
if (!e.autoSumbit || !r)
|
|
1095
1095
|
return;
|
|
1096
|
-
let
|
|
1097
|
-
for (;
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
}, a = (
|
|
1101
|
-
const c =
|
|
1096
|
+
let o = r;
|
|
1097
|
+
for (; o && o.$el.tagName !== "FORM"; )
|
|
1098
|
+
o = o.$parent;
|
|
1099
|
+
o && o.$el && o.$el.dispatchEvent(new Event("submit"));
|
|
1100
|
+
}, a = (o, i) => {
|
|
1101
|
+
const c = o();
|
|
1102
1102
|
c instanceof Promise ? c.then(i) : i(c);
|
|
1103
|
-
},
|
|
1104
|
-
const
|
|
1105
|
-
switch (typeof
|
|
1103
|
+
}, d = async () => {
|
|
1104
|
+
const o = X.get(e.options);
|
|
1105
|
+
switch (typeof o) {
|
|
1106
1106
|
case "function":
|
|
1107
1107
|
X.set(e.options, l);
|
|
1108
1108
|
return;
|
|
1109
1109
|
case "object":
|
|
1110
|
-
l(
|
|
1110
|
+
l(o);
|
|
1111
1111
|
return;
|
|
1112
1112
|
}
|
|
1113
1113
|
X.set(e.options, l), a(e.options, (i) => {
|
|
@@ -1115,13 +1115,13 @@ function Ln(e) {
|
|
|
1115
1115
|
X.set(e.options, i), c(i);
|
|
1116
1116
|
});
|
|
1117
1117
|
}, p = () => {
|
|
1118
|
-
a(e.options, (
|
|
1119
|
-
l(
|
|
1118
|
+
a(e.options, (o) => {
|
|
1119
|
+
l(o);
|
|
1120
1120
|
});
|
|
1121
1121
|
};
|
|
1122
1122
|
switch (!0) {
|
|
1123
1123
|
case e.options instanceof Function: {
|
|
1124
|
-
e.cache !== !1 ?
|
|
1124
|
+
e.cache !== !1 ? d() : p();
|
|
1125
1125
|
break;
|
|
1126
1126
|
}
|
|
1127
1127
|
case oe(e.options): {
|
|
@@ -1135,22 +1135,22 @@ function Ln(e) {
|
|
|
1135
1135
|
default:
|
|
1136
1136
|
n.value = e.options;
|
|
1137
1137
|
}
|
|
1138
|
-
function
|
|
1138
|
+
function s(o, i) {
|
|
1139
1139
|
var m;
|
|
1140
1140
|
const c = ((m = e.fieldNames) == null ? void 0 : m.title) || "title", h = i[c];
|
|
1141
|
-
return h ? h.toLowerCase().includes(
|
|
1141
|
+
return h ? h.toLowerCase().includes(o.toLowerCase()) : !1;
|
|
1142
1142
|
}
|
|
1143
|
-
return (
|
|
1143
|
+
return (o, i) => (e.default && !t && (o[i.key] = e.default, t = !0), v(gt, {
|
|
1144
1144
|
ref: (c) => r = c,
|
|
1145
1145
|
multiple: e.multiple,
|
|
1146
|
-
modelValue:
|
|
1147
|
-
"onUpdate:modelValue": (c) =>
|
|
1146
|
+
modelValue: o[i.key],
|
|
1147
|
+
"onUpdate:modelValue": (c) => o[i.key] = c,
|
|
1148
1148
|
placeholder: e.placeholder,
|
|
1149
1149
|
allowClear: e.clearable,
|
|
1150
1150
|
allowSearch: e.searchable,
|
|
1151
1151
|
maxTagCount: e.maxTagCount ?? 2,
|
|
1152
|
-
onChange:
|
|
1153
|
-
filterTreeNode:
|
|
1152
|
+
onChange: u,
|
|
1153
|
+
filterTreeNode: s,
|
|
1154
1154
|
data: n.value,
|
|
1155
1155
|
fieldNames: e.fieldNames,
|
|
1156
1156
|
treeProps: e.treeProps
|
|
@@ -1165,38 +1165,38 @@ function zn() {
|
|
|
1165
1165
|
}
|
|
1166
1166
|
function Pn(e) {
|
|
1167
1167
|
let r, t = !1;
|
|
1168
|
-
const [n, l] = zn(),
|
|
1168
|
+
const [n, l] = zn(), u = () => {
|
|
1169
1169
|
if (!e.autoSumbit || !r)
|
|
1170
1170
|
return;
|
|
1171
|
-
let
|
|
1172
|
-
for (;
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
}, a = (
|
|
1176
|
-
const i =
|
|
1177
|
-
i instanceof Promise ? i.then(
|
|
1178
|
-
},
|
|
1179
|
-
const
|
|
1180
|
-
switch (typeof
|
|
1171
|
+
let s = r;
|
|
1172
|
+
for (; s && s.$el.tagName !== "FORM"; )
|
|
1173
|
+
s = s.$parent;
|
|
1174
|
+
s && s.$el && s.$el.dispatchEvent(new Event("submit"));
|
|
1175
|
+
}, a = (s, o) => {
|
|
1176
|
+
const i = s();
|
|
1177
|
+
i instanceof Promise ? i.then(o) : o(i);
|
|
1178
|
+
}, d = async () => {
|
|
1179
|
+
const s = J.get(e.options);
|
|
1180
|
+
switch (typeof s) {
|
|
1181
1181
|
case "function":
|
|
1182
1182
|
J.set(e.options, l);
|
|
1183
1183
|
return;
|
|
1184
1184
|
case "object":
|
|
1185
|
-
l(
|
|
1185
|
+
l(s);
|
|
1186
1186
|
return;
|
|
1187
1187
|
}
|
|
1188
|
-
J.set(e.options, l), a(e.options, (
|
|
1188
|
+
J.set(e.options, l), a(e.options, (o) => {
|
|
1189
1189
|
const i = J.get(e.options);
|
|
1190
|
-
J.set(e.options,
|
|
1190
|
+
J.set(e.options, o), i(o);
|
|
1191
1191
|
});
|
|
1192
1192
|
}, p = () => {
|
|
1193
|
-
a(e.options, (
|
|
1194
|
-
l(
|
|
1193
|
+
a(e.options, (s) => {
|
|
1194
|
+
l(s);
|
|
1195
1195
|
});
|
|
1196
1196
|
};
|
|
1197
1197
|
switch (!0) {
|
|
1198
1198
|
case e.options instanceof Function: {
|
|
1199
|
-
e.cache !== !1 ?
|
|
1199
|
+
e.cache !== !1 ? d() : p();
|
|
1200
1200
|
break;
|
|
1201
1201
|
}
|
|
1202
1202
|
case oe(e.options): {
|
|
@@ -1210,17 +1210,17 @@ function Pn(e) {
|
|
|
1210
1210
|
default:
|
|
1211
1211
|
n.value = e.options;
|
|
1212
1212
|
}
|
|
1213
|
-
return (
|
|
1213
|
+
return (s, o) => (e.default && !t && (s[o.key] = e.default, t = !0), v(pt, {
|
|
1214
1214
|
pathMode: e.pathMode,
|
|
1215
1215
|
ref: (i) => r = i,
|
|
1216
1216
|
multiple: e.multiple,
|
|
1217
|
-
modelValue:
|
|
1218
|
-
"onUpdate:modelValue": (i) =>
|
|
1217
|
+
modelValue: s[o.key],
|
|
1218
|
+
"onUpdate:modelValue": (i) => s[o.key] = i,
|
|
1219
1219
|
placeholder: e.placeholder,
|
|
1220
1220
|
allowClear: e.clearable,
|
|
1221
1221
|
allowSearch: e.searchable,
|
|
1222
1222
|
maxTagCount: e.maxTagCount ?? 2,
|
|
1223
|
-
onChange:
|
|
1223
|
+
onChange: u,
|
|
1224
1224
|
options: n.value
|
|
1225
1225
|
}, null));
|
|
1226
1226
|
}
|
|
@@ -1246,36 +1246,38 @@ function Nn(e) {
|
|
|
1246
1246
|
return;
|
|
1247
1247
|
if ((e == null ? void 0 : e.inputUnit) === (e == null ? void 0 : e.outputUnit))
|
|
1248
1248
|
return a;
|
|
1249
|
-
const
|
|
1250
|
-
return a *
|
|
1249
|
+
const d = te[e.outputUnit] / te[e.inputUnit];
|
|
1250
|
+
return a * d;
|
|
1251
1251
|
}, t = (a) => {
|
|
1252
|
+
if (a == null)
|
|
1253
|
+
return;
|
|
1252
1254
|
if ((e == null ? void 0 : e.inputUnit) === (e == null ? void 0 : e.outputUnit))
|
|
1253
1255
|
return a;
|
|
1254
|
-
const
|
|
1255
|
-
return a *
|
|
1256
|
+
const d = te[e.inputUnit] / te[e.outputUnit];
|
|
1257
|
+
return a * d;
|
|
1256
1258
|
}, n = (a) => {
|
|
1257
|
-
const
|
|
1258
|
-
return
|
|
1259
|
+
const d = a.split(".");
|
|
1260
|
+
return d[0] = d[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), d.join(".");
|
|
1259
1261
|
}, l = (a) => {
|
|
1260
|
-
const
|
|
1261
|
-
return e != null && e.thousands ? n(
|
|
1262
|
-
},
|
|
1263
|
-
return (a,
|
|
1264
|
-
const p = $(r(a[
|
|
1265
|
-
return K(p, (
|
|
1266
|
-
a[
|
|
1262
|
+
const d = a;
|
|
1263
|
+
return e != null && e.thousands ? n(d) : d;
|
|
1264
|
+
}, u = (a) => a.replace(/,/g, "");
|
|
1265
|
+
return (a, d) => {
|
|
1266
|
+
const p = $(r(a[d.key]));
|
|
1267
|
+
return K(p, (s) => {
|
|
1268
|
+
a[d.key] = t(s);
|
|
1267
1269
|
}), v(je, {
|
|
1268
1270
|
modelValue: p.value,
|
|
1269
|
-
"onUpdate:modelValue": (
|
|
1271
|
+
"onUpdate:modelValue": (s) => p.value = s,
|
|
1270
1272
|
formatter: l,
|
|
1271
|
-
parser:
|
|
1273
|
+
parser: u,
|
|
1272
1274
|
precision: e == null ? void 0 : e.precision,
|
|
1273
1275
|
hideButton: !0,
|
|
1274
1276
|
"read-only": e == null ? void 0 : e.readonly,
|
|
1275
1277
|
placeholder: e == null ? void 0 : e.placeholder,
|
|
1276
1278
|
allowClear: e == null ? void 0 : e.clearable
|
|
1277
1279
|
}, {
|
|
1278
|
-
prefix: (e == null ? void 0 : e.prefix) && (() => typeof (e == null ? void 0 : e.
|
|
1280
|
+
prefix: (e == null ? void 0 : e.prefix) && (() => typeof (e == null ? void 0 : e.prefix) == "string" ? v("span", null, [e.prefix]) : e.prefix()),
|
|
1279
1281
|
suffix: () => typeof (e == null ? void 0 : e.suffix) == "string" ? v("span", null, [e.suffix]) : typeof (e == null ? void 0 : e.suffix) == "function" ? e.suffix() : e == null ? void 0 : e.inputUnit
|
|
1280
1282
|
});
|
|
1281
1283
|
};
|
|
@@ -1323,27 +1325,27 @@ const Un = /* @__PURE__ */ P({
|
|
|
1323
1325
|
const r = Pe(), t = e.form.map((a) => ({
|
|
1324
1326
|
...a,
|
|
1325
1327
|
collapsed: !1
|
|
1326
|
-
})), n = Array.from(new Set(t.map((a) => a.group).flat().filter(Boolean))), l = t.reduce((a,
|
|
1327
|
-
let
|
|
1328
|
-
|
|
1328
|
+
})), n = Array.from(new Set(t.map((a) => a.group).flat().filter(Boolean))), l = t.reduce((a, d) => ((d.group ? [d.group].flat() : ["默认"]).forEach((p) => {
|
|
1329
|
+
let s = a.find((o) => o.group === p);
|
|
1330
|
+
s || (s = {
|
|
1329
1331
|
group: p,
|
|
1330
1332
|
instance: void 0,
|
|
1331
1333
|
form: []
|
|
1332
|
-
}, a.push(
|
|
1333
|
-
}), a), []).sort((a,
|
|
1334
|
+
}, a.push(s)), s.form.push(d);
|
|
1335
|
+
}), a), []).sort((a, d) => a.group === "默认" ? -1 : d.group === "默认" ? 1 : a.group > d.group ? -1 : 1), u = $("默认");
|
|
1334
1336
|
return xn(() => {
|
|
1335
|
-
const a = l.find((
|
|
1337
|
+
const a = l.find((d) => d.group === u.value);
|
|
1336
1338
|
if (a && a.instance) {
|
|
1337
|
-
const
|
|
1339
|
+
const d = a.instance.formSource;
|
|
1338
1340
|
a.instance.validate().then(() => {
|
|
1339
|
-
r.close(
|
|
1341
|
+
r.close(d);
|
|
1340
1342
|
});
|
|
1341
1343
|
}
|
|
1342
1344
|
}), {
|
|
1343
1345
|
formItems: t,
|
|
1344
1346
|
groups: n,
|
|
1345
1347
|
groupForms: l,
|
|
1346
|
-
activeTab:
|
|
1348
|
+
activeTab: u
|
|
1347
1349
|
};
|
|
1348
1350
|
},
|
|
1349
1351
|
render() {
|
|
@@ -1438,22 +1440,22 @@ const ve = /* @__PURE__ */ P({
|
|
|
1438
1440
|
setup(e, {
|
|
1439
1441
|
emit: r
|
|
1440
1442
|
}) {
|
|
1441
|
-
const t = $(), [n, l] = Sn(e.form, e.modelValue || e.value),
|
|
1443
|
+
const t = $(), [n, l] = Sn(e.form, e.modelValue || e.value), u = $(e.columns || 0), a = $(!0), d = $(), p = () => a.value = !a.value;
|
|
1442
1444
|
me(Fe.id, e.id), me(Fe.source, n);
|
|
1443
|
-
const
|
|
1445
|
+
const s = () => {
|
|
1444
1446
|
r("submit", n.value), r("update:model-value", n.value);
|
|
1445
|
-
},
|
|
1446
|
-
if (!
|
|
1447
|
+
}, o = C(() => {
|
|
1448
|
+
if (!u.value)
|
|
1447
1449
|
return 1;
|
|
1448
1450
|
const g = e.form.reduce((x, V) => x + ((V == null ? void 0 : V.span) || 1), 0);
|
|
1449
|
-
return
|
|
1451
|
+
return u.value - g % u.value;
|
|
1450
1452
|
}), i = C(() => e.form.reduce((g, x) => (x.rule && (g[x.key] = x.rule), g), {}));
|
|
1451
1453
|
function c() {
|
|
1452
1454
|
var x;
|
|
1453
1455
|
if (e.columns)
|
|
1454
1456
|
return;
|
|
1455
1457
|
const g = (x = t.value) == null ? void 0 : x.$el;
|
|
1456
|
-
g && (
|
|
1458
|
+
g && (u.value = Math.floor(g.offsetWidth / e.minWidth));
|
|
1457
1459
|
}
|
|
1458
1460
|
function h() {
|
|
1459
1461
|
var x;
|
|
@@ -1461,14 +1463,14 @@ const ve = /* @__PURE__ */ P({
|
|
|
1461
1463
|
g && (g.id = e.id);
|
|
1462
1464
|
}
|
|
1463
1465
|
function m() {
|
|
1464
|
-
|
|
1466
|
+
d.value.open(Un, {
|
|
1465
1467
|
form: e.form
|
|
1466
1468
|
}, {
|
|
1467
1469
|
title: "高级搜索",
|
|
1468
1470
|
footer: !0,
|
|
1469
1471
|
submitText: "搜索"
|
|
1470
1472
|
}).then((g) => {
|
|
1471
|
-
g && (k(g),
|
|
1473
|
+
g && (k(g), s());
|
|
1472
1474
|
});
|
|
1473
1475
|
}
|
|
1474
1476
|
D(() => {
|
|
@@ -1498,18 +1500,18 @@ const ve = /* @__PURE__ */ P({
|
|
|
1498
1500
|
}), {
|
|
1499
1501
|
formSource: n,
|
|
1500
1502
|
formInstance: t,
|
|
1501
|
-
formColumns:
|
|
1503
|
+
formColumns: u,
|
|
1502
1504
|
formRules: i,
|
|
1503
1505
|
formCollspased: a,
|
|
1504
|
-
formActiosSpan:
|
|
1506
|
+
formActiosSpan: o,
|
|
1505
1507
|
toggleFormCollapsed: p,
|
|
1506
1508
|
updateFormField: y,
|
|
1507
1509
|
updateFormSource: k,
|
|
1508
1510
|
reset: O,
|
|
1509
1511
|
validate: j,
|
|
1510
|
-
onSubmitSuccess:
|
|
1512
|
+
onSubmitSuccess: s,
|
|
1511
1513
|
openCollapsedDialog: m,
|
|
1512
|
-
modalInstance:
|
|
1514
|
+
modalInstance: d
|
|
1513
1515
|
};
|
|
1514
1516
|
},
|
|
1515
1517
|
render() {
|
|
@@ -1612,8 +1614,8 @@ function Yn(e) {
|
|
|
1612
1614
|
function Gn(e) {
|
|
1613
1615
|
const r = U(), t = $();
|
|
1614
1616
|
function n() {
|
|
1615
|
-
var
|
|
1616
|
-
const l = (a = (
|
|
1617
|
+
var u, a;
|
|
1618
|
+
const l = (a = (u = r == null ? void 0 : r.proxy) == null ? void 0 : u.$refs) == null ? void 0 : a[e];
|
|
1617
1619
|
l && (t.value = l);
|
|
1618
1620
|
}
|
|
1619
1621
|
return D(n), at(n), t;
|