xlzw-component 1.0.1 → 1.0.2

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.
@@ -1,3 +1,3 @@
1
- (function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.XlzwComponent={},o.Vue))})(this,(function(o,e){"use strict";var i=document.createElement("style");i.textContent=`#cancel[data-v-e093e9d4],#submit[data-v-e093e9d4],#reset[data-v-e093e9d4],#sweep[data-v-e093e9d4],#disable[data-v-e093e9d4]{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-e093e9d4]{color:#fff;background:#88a6b0}#submit[data-v-e093e9d4]{color:#fff;background:#ec4408}#reset[data-v-e093e9d4],#sweep[data-v-e093e9d4]{color:#000;background:#fff;border:1px solid #88a6b0}#disable[data-v-e093e9d4]{color:#ccc;background:#f0f0f0}button[data-v-e093e9d4]{height:36px!important;font-family:思源黑体 CN-Normal,思源黑体 CN,sans-serif;font-weight:350;font-size:13px;background:#f0f0f0;color:#ccc;margin:0 5px}
2
- /*$vite$:1*/`,document.head.appendChild(i);const l=(t,d)=>{const n=t.__vccOpts||t;for(const[r,a]of d)n[r]=a;return n},c={key:0,id:"reset"},s={key:1,id:"cancel"},f={key:2,id:"submit"},p={key:3,id:"sweep"},u=l({__name:"xlzw-button",props:{type:{type:String}},setup(t){const d=e.ref(!0);return(n,r)=>{const a=e.resolveComponent("a-button");return e.openBlock(),e.createElementBlock("div",null,[t.type=="reset"?(e.openBlock(),e.createElementBlock("div",c,[e.renderSlot(n.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0),t.type=="cancel"?(e.openBlock(),e.createElementBlock("div",s,[e.renderSlot(n.$slots,"default",{},void 0,!0)])):t.type=="submit"?(e.openBlock(),e.createElementBlock("div",f,[e.renderSlot(n.$slots,"default",{},void 0,!0)])):t.type=="sweep"?(e.openBlock(),e.createElementBlock("div",p,[e.renderSlot(n.$slots,"default",{},void 0,!0)])):t.type=="disabled"?(e.openBlock(),e.createBlock(a,{key:4,type:"primary",disabled:d.value},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},8,["disabled"])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-e093e9d4"]]);o.XlzwButton=u,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.XlzwComponent={},b.Vue))})(this,(function(b,e){"use strict";var M=document.createElement("style");M.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-0dd67275]::deep(.ant-modal-content){padding:0!important}[data-v-0dd67275]::deep(.ant-modal-close){color:#fff;top:10px;right:10px}[data-v-0dd67275]::deep(.anticon-close){font-size:16px}[data-v-0dd67275]::deep(.ant-modal-close:hover){color:#fff}[data-v-0dd67275]::deep(.ant-modal-header){margin-bottom:0}[data-v-0dd67275]::deep(.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-0dd67275]::deep(.ant-modal-body){background:#f0f0f0;padding:10px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}
2
+ /*$vite$:1*/`,document.head.appendChild(M);const T=(t,r)=>{const o=t.__vccOpts||t;for(const[n,l]of r)o[n]=l;return o},O={key:0,id:"reset"},A={key:1,id:"cancel"},P={key:2,id:"submit"},R={key:3,id:"sweep"},X=T({__name:"xlzw-button",props:{type:{type:String}},setup(t){const r=e.ref(!0);return(o,n)=>{const l=e.resolveComponent("a-button");return e.openBlock(),e.createElementBlock("div",null,[t.type=="reset"?(e.openBlock(),e.createElementBlock("div",O,[e.renderSlot(o.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0),t.type=="cancel"?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(o.$slots,"default",{},void 0,!0)])):t.type=="submit"?(e.openBlock(),e.createElementBlock("div",P,[e.renderSlot(o.$slots,"default",{},void 0,!0)])):t.type=="sweep"?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(o.$slots,"default",{},void 0,!0)])):t.type=="disabled"?(e.openBlock(),e.createBlock(l,{key:4,type:"primary",disabled:r.value},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["disabled"])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-b09240e9"]]),N=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Y=Object.prototype.toString,L=t=>Y.call(t)==="[object Object]";function S(t){return Array.isArray(t)?t:[t]}function W(t,r={}){if(!e.isRef(t))return e.toRefs(t);const o=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const n in t.value)o[n]=e.customRef(()=>({get(){return t.value[n]},set(l){var i;if(!((i=e.toValue(r.replaceRef))!==null&&i!==void 0)||i)if(Array.isArray(t.value)){const d=[...t.value];d[n]=l,t.value=d}else{const d={...t.value,[n]:l};Object.setPrototypeOf(d,Object.getPrototypeOf(t.value)),t.value=d}else t.value[n]=l}}));return o}function I(t,r,o){return e.watch(t,r,{...o,immediate:!0})}const D=N?window:void 0;function G(t){var r;const o=e.toValue(t);return(r=o==null?void 0:o.$el)!==null&&r!==void 0?r:o}function _(...t){const r=(n,l,i,d)=>(n.addEventListener(l,i,d),()=>n.removeEventListener(l,i,d)),o=e.computed(()=>{const n=S(e.toValue(t[0])).filter(l=>l!=null);return n.every(l=>typeof l!="string")?n:void 0});return I(()=>{var n,l;return[(n=(l=o.value)===null||l===void 0?void 0:l.map(i=>G(i)))!==null&&n!==void 0?n:[D].filter(i=>i!=null),S(e.toValue(o.value?t[1]:t[0])),S(e.unref(o.value?t[2]:t[1])),e.toValue(o.value?t[3]:t[2])]},([n,l,i,d],c,y)=>{if(!(n!=null&&n.length)||!(l!=null&&l.length)||!(i!=null&&i.length))return;const x=L(d)?{...d}:d,V=n.flatMap(u=>l.flatMap(g=>i.map(v=>r(u,g,v,x))));y(()=>{V.forEach(u=>u())})},{flush:"post"})}function H(t,r={}){var o;const{pointerTypes:n,preventDefault:l,stopPropagation:i,exact:d,onMove:c,onEnd:y,onStart:x,initialValue:V,axis:u="both",draggingElement:g=D,containerElement:v,handle:C=t,buttons:B=[0]}=r,p=e.ref((o=e.toValue(V))!==null&&o!==void 0?o:{x:0,y:0}),s=e.ref(),$=a=>n?n.includes(a.pointerType):!0,k=a=>{e.toValue(l)&&a.preventDefault(),e.toValue(i)&&a.stopPropagation()},E=a=>{var f;if(!e.toValue(B).includes(a.button)||e.toValue(r.disabled)||!$(a)||e.toValue(d)&&a.target!==e.toValue(t))return;const m=e.toValue(v),w=m==null||(f=m.getBoundingClientRect)===null||f===void 0?void 0:f.call(m),h=e.toValue(t).getBoundingClientRect(),z={x:a.clientX-(m?h.left-w.left+m.scrollLeft:h.left),y:a.clientY-(m?h.top-w.top+m.scrollTop:h.top)};(x==null?void 0:x(z,a))!==!1&&(s.value=z,k(a))},Q=a=>{if(e.toValue(r.disabled)||!$(a)||!s.value)return;const f=e.toValue(v),m=e.toValue(t).getBoundingClientRect();let{x:w,y:h}=p.value;(u==="x"||u==="both")&&(w=a.clientX-s.value.x,f&&(w=Math.min(Math.max(0,w),f.scrollWidth-m.width))),(u==="y"||u==="both")&&(h=a.clientY-s.value.y,f&&(h=Math.min(Math.max(0,h),f.scrollHeight-m.height))),p.value={x:w,y:h},c==null||c(p.value,a),k(a)},Z=a=>{e.toValue(r.disabled)||!$(a)||s.value&&(s.value=void 0,y==null||y(p.value,a),k(a))};if(N){const a=()=>{var f;return{capture:(f=r.capture)!==null&&f!==void 0?f:!0,passive:!e.toValue(l)}};_(C,"pointerdown",E,a),_(g,"pointermove",Q,a),_(g,"pointerup",Z,a)}return{...W(p),position:p,isDragging:e.computed(()=>!!s.value),style:e.computed(()=>`left:${p.value.x}px;top:${p.value.y}px;`)}}const q=e.defineComponent({props:{title:String,width:String},emits:["resetData"],setup(t,r){const o=e.ref(!1),n=e.ref(null),l=()=>{o.value=!0},i=()=>{r.emit("resetData")},{x:d,y:c,isDragging:y}=H(n),x=k=>{o.value=!1},V=e.ref(0),u=e.ref(0),g=e.ref(!1),v=e.ref(0),C=e.ref(0),B=e.ref(0),p=e.ref(0),s=e.ref({left:0,right:0,top:0,bottom:0});e.watch([d,c],()=>{if(!g.value){V.value=d.value,u.value=c.value;const k=document.body.getBoundingClientRect(),E=n.value.getBoundingClientRect();s.value.right=k.width-E.width,s.value.bottom=k.height-E.height,B.value=v.value,p.value=C.value}g.value=!0}),e.watch(y,()=>{y||(g.value=!1)}),e.watchEffect(()=>{g.value&&(v.value=B.value+Math.min(Math.max(s.value.left,d.value),s.value.right)-V.value,C.value=p.value+Math.min(Math.max(s.value.top,c.value),s.value.bottom)-u.value)});const $=e.computed(()=>({transform:`translate(${v.value}px, ${C.value}px)`}));return{visible:o,showModal:l,handleCancel:x,modalTitleRef:n,transformStyle:$,cancel:i}}}),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(t,r,o,n,l,i){const d=e.resolveComponent("a-modal");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(d,{destroyOnClose:"",maskClosable:!1,onCancel:t.cancel,ref:"modalRef",visible:t.visible,"onUpdate:visible":r[0]||(r[0]=c=>t.visible=c),"wrap-style":{overflow:"hidden"},width:t.width,footer:null},{title:e.withCtx(()=>[e.createElementVNode("div",{ref:"modalTitleRef",style:{width:"100%",cursor:"move",color:"#fff"}},e.toDisplayString(t.title),513)]),modalRender:e.withCtx(({originVNode:c})=>[e.createElementVNode("div",{style:e.normalizeStyle(t.transformStyle)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c)))],4)]),default:e.withCtx(()=>[e.createElementVNode("div",U,[e.renderSlot(t.$slots,"content",{},void 0,!0)]),e.createElementVNode("div",F,[e.renderSlot(t.$slots,"footer",{},void 0,!0)])]),_:3},8,["onCancel","visible","width"])])}const K=T(q,[["render",J],["__scopeId","data-v-0dd67275"]]);b.XlzwButton=X,b.model=K,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));
3
3
  //# sourceMappingURL=xlzw-component.umd.cjs.map