xlzw-component 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/xlzw-component.js +206 -151
- package/dist/xlzw-component.js.map +1 -1
- package/dist/xlzw-component.umd.cjs +2 -2
- package/dist/xlzw-component.umd.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(
|
|
1
|
+
(function(v,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("ant-design-vue")):typeof define=="function"&&define.amd?define(["exports","vue","ant-design-vue"],t):(v=typeof globalThis<"u"?globalThis:v||self,t(v.XlzwComponent={},v.Vue))})(this,(function(v,t){"use strict";var N=document.createElement("style");N.textContent=`#cancel[data-v-b09240e9],#submit[data-v-b09240e9],#reset[data-v-b09240e9],#sweep[data-v-b09240e9],#disable[data-v-b09240e9]{font-family:思源黑体 CN-Normal,思源黑体 CN,sans-serif;font-weight:350;font-size:13px;height:36px;line-height:36px;padding:0 20px;border-radius:5px;cursor:pointer;margin:0 5px;display:inline-block;box-sizing:border-box;text-align:center;white-space:nowrap;font-weight:500}#cancel[data-v-b09240e9]{color:#fff;background:#88a6b0}#submit[data-v-b09240e9]{color:#fff;background:#ec4408}#reset[data-v-b09240e9],#sweep[data-v-b09240e9]{color:#000;background:#fff;border:1px solid #88a6b0}#disable[data-v-b09240e9]{color:#ccc;background:#f0f0f0}[data-v-b09240e9]::deep(button){height:36px!important;font-family:思源黑体 CN-Normal,思源黑体 CN,sans-serif;font-weight:350;font-size:13px;background:#f0f0f0;color:#ccc;margin:0 5px}[data-v-868a4dd6] .ant-modal-content{padding:0!important}[data-v-868a4dd6] .ant-modal-close{color:#fff;top:10px;right:10px}[data-v-868a4dd6] .anticon-close{font-size:16px}[data-v-868a4dd6] .ant-modal-close:hover{color:#fff}[data-v-868a4dd6] .ant-modal-header{margin-bottom:0}[data-v-868a4dd6] .ant-modal-title{color:#fff;height:40px;background:#333;display:flex;align-items:center;padding:0 20px;font-size:13px;border-top-left-radius:5px;border-top-right-radius:5px}[data-v-868a4dd6] .ant-modal-body{background:#f0f0f0;padding:10px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(N);const M=(e,a)=>{const n=e.__vccOpts||e;for(const[o,l]of a)n[o]=l;return n},z={key:0,id:"reset"},P={key:1,id:"cancel"},R={key:2,id:"submit"},A={key:3,id:"sweep"},X=M({__name:"xlzw-button",props:{type:{type:String}},setup(e){const a=t.ref(!0);return(n,o)=>{const l=t.resolveComponent("a-button");return t.openBlock(),t.createElementBlock("div",null,[e.type=="reset"?(t.openBlock(),t.createElementBlock("div",z,[t.renderSlot(n.$slots,"default",{},void 0,!0)])):t.createCommentVNode("",!0),e.type=="cancel"?(t.openBlock(),t.createElementBlock("div",P,[t.renderSlot(n.$slots,"default",{},void 0,!0)])):e.type=="submit"?(t.openBlock(),t.createElementBlock("div",R,[t.renderSlot(n.$slots,"default",{},void 0,!0)])):e.type=="sweep"?(t.openBlock(),t.createElementBlock("div",A,[t.renderSlot(n.$slots,"default",{},void 0,!0)])):e.type=="disabled"?(t.openBlock(),t.createBlock(l,{key:4,type:"primary",disabled:a.value},{default:t.withCtx(()=>[t.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},8,["disabled"])):t.createCommentVNode("",!0)])}}},[["__scopeId","data-v-b09240e9"]]),T=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Y=Object.prototype.toString,L=e=>Y.call(e)==="[object Object]";function E(e){return Array.isArray(e)?e:[e]}function W(e,a={}){if(!t.isRef(e))return t.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=t.customRef(()=>({get(){return e.value[o]},set(l){var d;if(!((d=t.toValue(a.replaceRef))!==null&&d!==void 0)||d)if(Array.isArray(e.value)){const i=[...e.value];i[o]=l,e.value=i}else{const i={...e.value,[o]:l};Object.setPrototypeOf(i,Object.getPrototypeOf(e.value)),e.value=i}else e.value[o]=l}}));return n}function I(e,a,n){return t.watch(e,a,{...n,immediate:!0})}const D=T?window:void 0;function q(e){var a;const n=t.toValue(e);return(a=n==null?void 0:n.$el)!==null&&a!==void 0?a:n}function S(...e){const a=(o,l,d,i)=>(o.addEventListener(l,d,i),()=>o.removeEventListener(l,d,i)),n=t.computed(()=>{const o=E(t.toValue(e[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0});return I(()=>{var o,l;return[(o=(l=n.value)===null||l===void 0?void 0:l.map(d=>q(d)))!==null&&o!==void 0?o:[D].filter(d=>d!=null),E(t.toValue(n.value?e[1]:e[0])),E(t.unref(n.value?e[2]:e[1])),t.toValue(n.value?e[3]:e[2])]},([o,l,d,i],s,b)=>{if(!(o!=null&&o.length)||!(l!=null&&l.length)||!(d!=null&&d.length))return;const y=L(i)?{...i}:i,m=o.flatMap(f=>l.flatMap(p=>d.map(x=>a(f,p,x,y))));b(()=>{m.forEach(f=>f())})},{flush:"post"})}function G(e,a={}){var n;const{pointerTypes:o,preventDefault:l,stopPropagation:d,exact:i,onMove:s,onEnd:b,onStart:y,initialValue:m,axis:f="both",draggingElement:p=D,containerElement:x,handle:w=e,buttons:$=[0]}=a,h=t.ref((n=t.toValue(m))!==null&&n!==void 0?n:{x:0,y:0}),c=t.ref(),V=r=>o?o.includes(r.pointerType):!0,C=r=>{t.toValue(l)&&r.preventDefault(),t.toValue(d)&&r.stopPropagation()},B=r=>{var u;if(!t.toValue($).includes(r.button)||t.toValue(a.disabled)||!V(r)||t.toValue(i)&&r.target!==t.toValue(e))return;const g=t.toValue(x),_=g==null||(u=g.getBoundingClientRect)===null||u===void 0?void 0:u.call(g),k=t.toValue(e).getBoundingClientRect(),O={x:r.clientX-(g?k.left-_.left+g.scrollLeft:k.left),y:r.clientY-(g?k.top-_.top+g.scrollTop:k.top)};(y==null?void 0:y(O,r))!==!1&&(c.value=O,C(r))},tt=r=>{if(t.toValue(a.disabled)||!V(r)||!c.value)return;const u=t.toValue(x),g=t.toValue(e).getBoundingClientRect();let{x:_,y:k}=h.value;(f==="x"||f==="both")&&(_=r.clientX-c.value.x,u&&(_=Math.min(Math.max(0,_),u.scrollWidth-g.width))),(f==="y"||f==="both")&&(k=r.clientY-c.value.y,u&&(k=Math.min(Math.max(0,k),u.scrollHeight-g.height))),h.value={x:_,y:k},s==null||s(h.value,r),C(r)},et=r=>{t.toValue(a.disabled)||!V(r)||c.value&&(c.value=void 0,b==null||b(h.value,r),C(r))};if(T){const r=()=>{var u;return{capture:(u=a.capture)!==null&&u!==void 0?u:!0,passive:!t.toValue(l)}};S(w,"pointerdown",B,r),S(p,"pointermove",tt,r),S(p,"pointerup",et,r)}return{...W(h),position:h,isDragging:t.computed(()=>!!c.value),style:t.computed(()=>`left:${h.value.x}px;top:${h.value.y}px;`)}}const H=t.defineComponent({props:{title:String,width:String},emits:["resetData"],setup(e,a){const n=t.ref(!1),o=t.ref(null),l=()=>{n.value=!0},d=()=>{a.emit("resetData")},{x:i,y:s,isDragging:b}=G(o),y=C=>{n.value=!1},m=t.ref(0),f=t.ref(0),p=t.ref(!1),x=t.ref(0),w=t.ref(0),$=t.ref(0),h=t.ref(0),c=t.ref({left:0,right:0,top:0,bottom:0});t.watch([i,s],()=>{if(!p.value){m.value=i.value,f.value=s.value;const C=document.body.getBoundingClientRect(),B=o.value.getBoundingClientRect();c.value.right=C.width-B.width,c.value.bottom=C.height-B.height,$.value=x.value,h.value=w.value}p.value=!0}),t.watch(b,()=>{b||(p.value=!1)}),t.watchEffect(()=>{p.value&&(x.value=$.value+Math.min(Math.max(c.value.left,i.value),c.value.right)-m.value,w.value=h.value+Math.min(Math.max(c.value.top,s.value),c.value.bottom)-f.value)});const V=t.computed(()=>({transform:`translate(${x.value}px, ${w.value}px)`}));return{visible:n,showModal:l,handleCancel:y,modalTitleRef:o,transformStyle:V,cancel:d}}}),U={style:{background:"#fff","border-radius":"5px"}},F={style:{background:"rgb(255, 255, 255)",height:"44px",display:"flex","align-items":"center","justify-content":"end","margin-top":"10px",padding:"0 10px","border-radius":"5px"}};function J(e,a,n,o,l,d){const i=t.resolveComponent("a-modal");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(i,{destroyOnClose:"",maskClosable:!1,onCancel:e.cancel,ref:"modalRef",visible:e.visible,"onUpdate:visible":a[0]||(a[0]=s=>e.visible=s),"wrap-style":{overflow:"hidden"},width:e.width,footer:null},{title:t.withCtx(()=>[t.createElementVNode("div",{ref:"modalTitleRef",style:{width:"100%",cursor:"move",color:"#fff"}},t.toDisplayString(e.title),513)]),modalRender:t.withCtx(({originVNode:s})=>[t.createElementVNode("div",{style:t.normalizeStyle(e.transformStyle)},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s)))],4)]),default:t.withCtx(()=>[t.createElementVNode("div",U,[t.renderSlot(e.$slots,"content",{},void 0,!0)]),t.createElementVNode("div",F,[t.renderSlot(e.$slots,"footer",{},void 0,!0)])]),_:3},8,["onCancel","visible","width"])])}const K=M(H,[["render",J],["__scopeId","data-v-868a4dd6"]]),Q={style:{"font-size":"13px","font-weight":"700",padding:"15px 0px",height:"116px"}},Z={style:{padding:"0 24px"}},j={__name:"xlzw-deletePrompt",emits:["delOk"],setup(e,{expose:a,emit:n}){const o=t.ref(null),l=t.ref("");function d(){b("delOk"),i()}function i(){l.value="",o.value.handleCancel()}function s(y){l.value=y,o.value.showModal()}const b=n;return a({showModal:s}),(y,m)=>{const f=t.resolveComponent("Title"),p=t.resolveComponent("Button"),x=t.resolveComponent("Modal");return t.openBlock(),t.createBlock(x,{width:"430px",ref_key:"modalRef",ref:o,title:"确认对话框"},{content:t.withCtx(()=>[t.createElementVNode("div",Q,[t.createVNode(f,{title:"提交"}),t.createElementVNode("div",Z,t.toDisplayString(l.value),1)])]),footer:t.withCtx(()=>[t.createVNode(p,{type:"reset",onClick:i},{default:t.withCtx(()=>[...m[0]||(m[0]=[t.createTextVNode("取消",-1)])]),_:1}),t.createVNode(p,{type:"submit",onClick:d},{default:t.withCtx(()=>[...m[1]||(m[1]=[t.createTextVNode("确定",-1)])]),_:1})]),_:1},512)}}};v.Button=X,v.DeletePrompt=j,v.Model=K,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));
|
|
3
3
|
//# sourceMappingURL=xlzw-component.umd.cjs.map
|