asai-vue-host 0.0.13 → 0.0.14

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.
@@ -209,48 +209,49 @@ const Pt = {
209
209
  if (n.sys?.onkeyboard) {
210
210
  let a = function() {
211
211
  n.keyboard.params || (n.keyboard.params = {});
212
- }, s = function(p) {
213
- p?.setAttribute("inputmode", "none"), p?.style?.setProperty("ime-mode", "disabled", "important"), n.keyboard.params.ot && (n.keyboard.params.ot.fndscb = () => {
214
- p?.removeAttribute("inputmode"), p?.style?.setProperty(
212
+ }, s = function(c) {
213
+ c?.setAttribute("inputmode", "none"), c?.style?.setProperty("ime-mode", "disabled", "important"), n.keyboard.params.ot && (n.keyboard.params.ot.fndscb = () => {
214
+ c?.removeAttribute("inputmode"), c?.style?.setProperty(
215
215
  "ime-mode",
216
216
  "normal",
217
217
  "important"
218
218
  );
219
219
  });
220
- }, i = function(p, h) {
221
- return h?.some((v) => p.target?.closest(v));
222
- }, r = function(p, h) {
223
- return h?.find((v) => p.target?.closest(v));
224
- }, d = function(p) {
225
- if (n.keyboard.params?.ot?.fnnumcb?.(), n.keyboard.params?.ot?.fndscb?.(), a(), e.value?.auto && (n.keyboard.areastyle.x = p.clientX + (e.value?.auto?.x || 0), n.keyboard.areastyle.y = p.clientY + (e.value?.auto?.y || 0)), n.keyboard.params.ot = {}, !i(
226
- p,
227
- o.data.sys.keyboard.showkeyboard?.nokeytypes
228
- )) if (p.target?.closest(".portaskeyboard"))
220
+ }, i = function(c) {
221
+ return o.data.sys.keyboard?.nokeytypes?.some(
222
+ (p) => c.target?.closest(p)
223
+ );
224
+ }, r = function(c) {
225
+ return Object.keys(
226
+ o.data.sys.keyboard?.askeytypes || {}
227
+ )?.find((p) => c.target?.closest(p));
228
+ }, d = function(c) {
229
+ if (n.keyboard.params?.ot?.fnnumcb?.(), n.keyboard.params?.ot?.fndscb?.(), a(), e.value?.auto && (n.keyboard.areastyle.x = c.clientX + (e.value?.auto?.x || 0), n.keyboard.areastyle.y = c.clientY + (e.value?.auto?.y || 0)), n.keyboard.params.ot = {}, !i(c)) if (c.target?.closest(".portaskeyboard"))
229
230
  n.keyboard.params.ot.portaskeyboard = !0;
230
- else if (p.target?.closest(".askey-luaeditor"))
231
- re.monacoDom = p.target.closest(".askey-luaeditor"), re.keyboardDom = re.monacoDom.querySelector(
231
+ else if (c.target?.closest(".askey-luaeditor"))
232
+ re.monacoDom = c.target.closest(".askey-luaeditor"), re.keyboardDom = re.monacoDom.querySelector(
232
233
  ".native-edit-context"
233
234
  ), re.monacoDomText = re.monacoDom.querySelector("textarea"), s(re.monacoDomText), e.value?.style && (n.keyboard.params.ot.style = e.value.style), Object.assign(n.keyboard.params, {
234
235
  type: "monaco",
235
236
  el: re.monacoDomText
236
237
  }), n.keyboard.showkeyboard = ".askey-luaeditor";
237
238
  else if (["textarea", "text", "number", "password"].includes(
238
- p.target?.type
239
- ) && !p.target?.disabled) {
240
- if (re.keyboardDom = p.target, s(re.keyboardDom), re.keyboardDom.type === "number") {
239
+ c.target?.type
240
+ ) && !c.target?.disabled) {
241
+ if (re.keyboardDom = c.target, s(re.keyboardDom), re.keyboardDom.type === "number") {
241
242
  n.keyboard.showkeyboard = ".askey-number", n.keyboard.params.ot.isnumber = !0, re.keyboardDom.type = "text";
242
- let h = requestAnimationFrame(() => {
243
+ let p = requestAnimationFrame(() => {
243
244
  re.keyboardDom.setSelectionRange(
244
245
  re.keyboardDom?.value?.length || 0,
245
246
  re.keyboardDom?.value?.length || 0
246
- ), re.keyboardDom.focus(), cancelAnimationFrame(h);
247
+ ), re.keyboardDom.focus(), cancelAnimationFrame(p);
247
248
  });
248
249
  n.keyboard.params.ot.fnnumcb = () => {
249
250
  re.keyboardDom.type = "number";
250
251
  };
251
252
  } else {
252
- const h = r(p, c);
253
- h ? n.keyboard.showkeyboard = h : n.keyboard.showkeyboard = ".askey-default";
253
+ const p = r(c);
254
+ console.log(666.222, p), p ? n.keyboard.showkeyboard = p : n.keyboard.showkeyboard = ".askey-default";
254
255
  }
255
256
  e.value?.style && (n.keyboard.params.ot.style = e.value.style), Object.assign(n.keyboard.params, {
256
257
  type: re.keyboardDom.type,
@@ -259,9 +260,6 @@ const Pt = {
259
260
  } else
260
261
  n.keyboard.params = {}, n.keyboard.showkeyboard = "";
261
262
  };
262
- const c = Object.keys(
263
- o.data.sys.keyboard.showkeyboard?.askeytypes || {}
264
- );
265
263
  a(), t.addEventListener("pointerdown", d), re.unmounted = () => {
266
264
  t.removeEventListener("pointerdown", d);
267
265
  };
@@ -1,4 +1,4 @@
1
- (function(Y,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Y=typeof globalThis<"u"?globalThis:Y||self,e(Y["asai-vue-host"]={},Y.Vue))})(this,(function(Y,e){"use strict";const ne=Object.freeze(Object.defineProperty({__proto__:null,get default(){return os}},Symbol.toStringTag,{value:"Module"})),Ee=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){if(typeof t.value=="function"){let o=0;const a=300,l=s=>{const r=performance.now();r-o<a?(t.value(s),o=0):o=r};n.__dbPointerDownHandler=l,n.addEventListener("pointerdown",l)}},unmounted(n){const t=n.__dbPointerDownHandler;t&&(n.removeEventListener("pointerdown",t),delete n.__dbPointerDownHandler)}}},Symbol.toStringTag,{value:"Module"}));function J(n,t){function o(g,_){_?.classList?.contains(g)&&_.classList.remove(g)}function a(g,_){_?.classList?.contains(g)||_.classList.add(g)}function l(g){a("touch-none",g)}function s(g){o("touch-none",g)}function r(g){const _=window.event||g;return _?.preventDefault(),_?.stopPropagation(),!0}function i(g){const _=window.event||g;_.cancelable&&(_?.preventDefault(),_?.stopPropagation())}function d(g){t.timeout||(t.timeout=requestAnimationFrame(()=>{g(),cancelAnimationFrame(t.timeout),t.timeout=null}))}function c(){return"ontouchstart"in window||navigator.maxTouchPoints}function m(g){c()&&t.touchstat!==1&&(g.addEventListener("touchstart",h,!0),t.touchstat=1)}function p(g){c()&&t.touchstat!==2&&(g.addEventListener("touchmove",r),l(g),t.touchstat=2)}function f(g){c()&&t.touchstat!==3&&(g.removeEventListener("touchmove",r),s(g),t.touchstat=3)}function h(g){document.body.addEventListener("touchmove",y),document.body.addEventListener("touchend",u),t.dragttm=Date.now()}function y(g){t.dragttm&&Date.now()-t.dragttm<1e3&&(t.dragtstat=2)}function u(g){document.body.removeEventListener("touchmove",y),document.body.removeEventListener("touchend",u),t.dragtstat=0}return{eStop:r,canTouch:c,eStopTouch:i,setTouchNone:l,setTouchAuto:s,fnPThrottle:d,vtTouchInit:m,vtTouchDown:p,vtTouchUp:f}}const q={},Se=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{fnPThrottle:o,vtTouchInit:a,vtTouchDown:l,vtTouchUp:s}=J(n,t.value);a(n);let r=!1,i=0,d=0,c=0,m=0;typeof t.value.domarea=="string"?q.dragAreaDom=document.getElementById(t.value.domarea):q.dragAreaDom=n;const p=y=>{console.log("handleDown",q,y),l(n),r=!0;const u=q.dragAreaDom.getBoundingClientRect();q.dragAreaDom.style.position="absolute",q.dragAreaDom.style.transform=`translate(${u.x}px, ${u.y}px)`,i=y.clientX-u.x,d=y.clientY-u.y,n.style.cursor="grabbing",document.addEventListener("pointermove",f),document.addEventListener("pointerup",h)},f=y=>{o(()=>{if(r){c=y.clientX-i,m=y.clientY-d;const u=window.innerWidth-q.dragAreaDom.offsetWidth,g=window.innerHeight-q.dragAreaDom.offsetHeight;c=Math.max(0,Math.min(c,u)),m=Math.max(0,Math.min(m,g)),q.dragAreaDom.style.transform=`translate(${c}px, ${m}px)`}})},h=()=>{r=!1,n.style.cursor="grab",s(n),document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",h)};n.addEventListener("pointerdown",p),q.unmounted=()=>{n.removeEventListener("pointerdown",p)}},unmounted(n){typeof q?.unmounted=="function"&&q.unmounted()}}},Symbol.toStringTag,{value:"Module"})),Z={},je=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{fnPThrottle:o,vtTouchInit:a,vtTouchDown:l,vtTouchUp:s}=J(n,t.value);a(n);let r=!1,i={x:0,y:0},d={x:0,y:0},c=null,m=1;const p=(t.value?.dom?document.getElementById(t.value.dom):"")||n,f=(t.value?.domarea?document.getElementById(t.value.domarea):"")||p,h=(t.value?.dommask?document.getElementById(t.value.dommask):"")||(t.value?.ujt?.$global?.sys?.zoomid?document.getElementById(t.value.ujt.$global.sys.zoomid):"")||document.getElementById("asaizoomarea")||document.body,y=()=>h&&(t.value?.scale||t.value?.ujt?.$global?.scale)||1,u=$=>{if(!h)return;if(l(n),$.preventDefault(),m=y(),t.value?.pos)d=t.value.pos;else{const w=window.getComputedStyle(f).transform?.split(", ");if(w.length>2){const S=w.pop().slice(0,-1)||0,C=w.pop()||0;d={x:parseFloat(C),y:parseFloat(S)}}else d={x:0,y:0}}r=!0,c=h.getBoundingClientRect();let x,b;x=$.clientX,b=$.clientY,i={x:(x-c.left)/m-d.x,y:(b-c.top)/m-d.y},p.setPointerCapture($.pointerId),document.addEventListener("pointermove",g),document.addEventListener("pointerup",_),document.addEventListener("pointercancel",_)},g=$=>{if(!r||!c)return;let x,b;x=$.clientX,b=$.clientY,m=y();const k=(x-c.left)/m-i.x,w=(b-c.top)/m-i.y,S=h.offsetWidth-f.offsetWidth,C=h.offsetHeight-f.offsetHeight;o(()=>{t.value.pos?(t.value.pos.x=+Math.max(0,Math.min(k,S)).toFixed(6),t.value.pos.y=+Math.max(0,Math.min(w,C)).toFixed(6)):f.style.transform=`translate(${+Math.max(0,Math.min(k,S)).toFixed(6)}px,${+Math.max(0,Math.min(w,C)).toFixed(6)}px)`})},_=$=>{s(n),$ instanceof PointerEvent&&p.hasPointerCapture($.pointerId)&&(r=!1,p.releasePointerCapture($.pointerId)),document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_)};p.addEventListener("pointerdown",u);const j=()=>c=null;window.addEventListener("resize",j),Z.unmounted=()=>{p.removeEventListener("pointerdown",u),window.removeEventListener("resize",j)}},unmounted(n){typeof Z?.unmounted=="function"&&Z.unmounted()}}},Symbol.toStringTag,{value:"Module"}));function Ce(n){const t=window.event||n;t.preventDefault(),t.stopPropagation()}const Be=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){function o(a){t.value.type===2&&Ce(a);const l=document.getElementById(t.value.dom);l&&(l.classList.contains("as-fullscreen")?l.classList.remove("as-fullscreen"):l.classList.add("as-fullscreen"))}t.value.type===2?n.addEventListener("dblclick",o):n.addEventListener("click",o)}}},Symbol.toStringTag,{value:"Module"})),I={},Ve=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{$global:o,$model:a}=t.value?.ujt||{};if(o.sys?.onkeyboard){let l=function(){o.keyboard.params||(o.keyboard.params={})},s=function(m){m?.setAttribute("inputmode","none"),m?.style?.setProperty("ime-mode","disabled","important"),o.keyboard.params.ot&&(o.keyboard.params.ot.fndscb=()=>{m?.removeAttribute("inputmode"),m?.style?.setProperty("ime-mode","normal","important")})},r=function(m,p){return p?.some(f=>m.target?.closest(f))},i=function(m,p){return p?.find(f=>m.target?.closest(f))},d=function(m){if(o.keyboard.params?.ot?.fnnumcb?.(),o.keyboard.params?.ot?.fndscb?.(),l(),t.value?.auto&&(o.keyboard.areastyle.x=m.clientX+(t.value?.auto?.x||0),o.keyboard.areastyle.y=m.clientY+(t.value?.auto?.y||0)),o.keyboard.params.ot={},!r(m,a.data.sys.keyboard.showkeyboard?.nokeytypes))if(m.target?.closest(".portaskeyboard"))o.keyboard.params.ot.portaskeyboard=!0;else if(m.target?.closest(".askey-luaeditor"))I.monacoDom=m.target.closest(".askey-luaeditor"),I.keyboardDom=I.monacoDom.querySelector(".native-edit-context"),I.monacoDomText=I.monacoDom.querySelector("textarea"),s(I.monacoDomText),t.value?.style&&(o.keyboard.params.ot.style=t.value.style),Object.assign(o.keyboard.params,{type:"monaco",el:I.monacoDomText}),o.keyboard.showkeyboard=".askey-luaeditor";else if(["textarea","text","number","password"].includes(m.target?.type)&&!m.target?.disabled){if(I.keyboardDom=m.target,s(I.keyboardDom),I.keyboardDom.type==="number"){o.keyboard.showkeyboard=".askey-number",o.keyboard.params.ot.isnumber=!0,I.keyboardDom.type="text";let p=requestAnimationFrame(()=>{I.keyboardDom.setSelectionRange(I.keyboardDom?.value?.length||0,I.keyboardDom?.value?.length||0),I.keyboardDom.focus(),cancelAnimationFrame(p)});o.keyboard.params.ot.fnnumcb=()=>{I.keyboardDom.type="number"}}else{const p=i(m,c);p?o.keyboard.showkeyboard=p:o.keyboard.showkeyboard=".askey-default"}t.value?.style&&(o.keyboard.params.ot.style=t.value.style),Object.assign(o.keyboard.params,{type:I.keyboardDom.type,el:I.keyboardDom||n})}else o.keyboard.params={},o.keyboard.showkeyboard=""};const c=Object.keys(a.data.sys.keyboard.showkeyboard?.askeytypes||{});l(),n.addEventListener("pointerdown",d),I.unmounted=()=>{n.removeEventListener("pointerdown",d)}}},unmounted(n){typeof I?.unmounted=="function"&&I.unmounted()}}},Symbol.toStringTag,{value:"Module"})),xe=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){t?.value?.right||n?.classList&&!n.classList?.contains("asailevel")&&n.classList.add("asailevel")}}},Symbol.toStringTag,{value:"Module"})),Ne=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{vtTouchInit:o,vtTouchDown:a,vtTouchUp:l}=J(n,t.value);o(n);const s=t.value.long?1e3:500;let r=null,i=!1,d=0,c=0;const m=10,p=u=>{a(n),t.value.prevent&&u.preventDefault(),i=!0,u?.touches?.[0]?(d=u.touches[0].clientX,c=u.touches[0].clientY):(d=u.clientX,c=u.clientY),t.value.press&&t.value.press(u),r=window.setTimeout(()=>{i&&t.value.hold&&t.value.hold(u)},s)},f=u=>{l(n),r!==null&&(clearTimeout(r),r=null),i&&(t.value.release&&t.value.release(u),i=!1)},y={down:p,up:f,move:u=>{if(!i)return;let g=0,_=0;u?.touches?.[0]?(g=u.touches[0].clientX,_=u.touches[0].clientY):(g=u.clientX,_=u.clientY);const j=Math.abs(g-d),$=Math.abs(_-c);(j>m||$>m)&&(r!==null&&(clearTimeout(r),r=null),i=!1)}};n.addEventListener("pointerdown",p),n.addEventListener("pointerup",f),n.addEventListener("pointercancel",f),n.addEventListener("pointerleave",f),n._pressHandlers=y},unmounted(n){const t=n._pressHandlers;t&&(n.removeEventListener("pointerdown",t.down),n.removeEventListener("pointerup",t.up),n.removeEventListener("pointercancel",t.up),n.removeEventListener("pointerleave",t.up),delete n._pressHandlers)}}},Symbol.toStringTag,{value:"Module"})),v={},Pe=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{fnPThrottle:o,vtTouchInit:a,vtTouchDown:l,vtTouchUp:s}=J(n,t.value);a(n);const{ujt:r,size:i,scale:d}=t.value;let c={x:0,y:0},m;const p={width:r?.$global?.sys?.zoomwidth||1920,height:r?.$global?.sys?.zoomheight||1200},f=()=>d||r?.$global?.scale||1;let h=!1,y,u,g,_,j=i||{w:0,h:0};const $=S=>({clientX:S.clientX,clientY:S.clientY}),x=S=>{l(n),S.preventDefault(),m=f(),h=!0;const{clientX:C,clientY:V}=$(S);y=C-window.scrollX,u=V-window.scrollY,g=n.offsetWidth,_=n.offsetHeight;const N=window.getComputedStyle(n).transform?.split(", ");if(N&&N.length>2){const M=N.pop().slice(0,-1),D=N.pop();c={x:parseFloat(D),y:parseFloat(M)}}else c={x:0,y:0};n.style.transform=`translate(${c.x}px,${c.y}px)`,S instanceof PointerEvent&&n.setPointerCapture(S.pointerId),document.addEventListener("pointermove",b),document.addEventListener("pointerup",k),document.addEventListener("pointercancel",k)},b=S=>{h&&o(()=>{const{clientX:C,clientY:V}=$(S),E=(C-window.scrollX-y)/m,N=(V-window.scrollY-u)/m;j.w=Math.min(Math.max(88,g+E),p.width-c.x),j.h=Math.min(Math.max(58,_+N),p.height-c.y),n.style.width=j.w+"px",n.style.height=j.h+"px"})},k=S=>{s(n),S instanceof PointerEvent&&n.hasPointerCapture(S.pointerId)&&n.releasePointerCapture(S.pointerId),h=!1,document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k)},w=document.createElement("div");w.classList.add("resize-bottom-right"),n.appendChild(w),w.addEventListener("pointerdown",x),v.unmounted=()=>{w.removeEventListener("pointerdown",x),w&&w.remove()}},unmounted(n){typeof v?.unmounted=="function"&&v.unmounted()}}},Symbol.toStringTag,{value:"Module"})),Me=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{fnPThrottle:o,vtTouchInit:a,vtTouchDown:l,vtTouchUp:s}=J(n,t.value);a(n);const{ujt:r,scale:i,id:d,type:c,cut:m,min:p}=t.value,f=()=>i||r?.$global?.scale||1,h={width:r?.$global?.sys?.zoomwidth||1920,height:r?.$global?.sys?.zoomheight||1200};let y=m||0;c?h.height=h.height-y:h.width=h.width-y;function u(){return typeof p=="function"?p():typeof p?.value=="number"?p?.value:typeof p=="number"?p:100}let g,_=1,j=!1,$=0,x=0,b=0,k=0;const w=E=>{if(g=document.getElementById(d),!g){console.error(`未找到 ID 为 ${d} 的元素`);return}l(n),E.preventDefault(),_=f(),j=!0,c?(b=E.clientY,k=g.offsetHeight):($=E.clientX,x=g.offsetWidth),document.addEventListener("pointermove",S),document.addEventListener("pointerup",C)},S=E=>{j&&o(()=>{if(c){const N=(b-E.clientY)/_,M=Math.max(u(),k+N);g.style.height=Math.min(M,h.height)+"px",g.style.minHeight=Math.min(M,h.height)+"px"}else{const N=($-E.clientX)/_,M=Math.max(u(),x+N);g.style.width=Math.min(M,h.width)+"px",g.style.minWidth=Math.min(M,h.width)+"px"}})},C=()=>{j=!1,s(n),document.removeEventListener("pointermove",S),document.removeEventListener("pointerup",C)};n.addEventListener("pointerdown",w);const V=()=>{n.removeEventListener("pointerdown",w)};n.__unmountResize=V},unmounted(n){n.__unmountResize&&(n.__unmountResize(),delete n.__unmountResize)}}},Symbol.toStringTag,{value:"Module"})),De=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n){n.scrollTop=n.scrollHeight;const t={autoScrollEnabled:!0,handler:()=>{const o=Math.abs(n.scrollHeight-n.scrollTop-n.clientHeight)<10;t.autoScrollEnabled=o}};n.addEventListener("scroll",t.handler),n.__scrollData__=t,n.__vueScrollUpdate__=()=>{t.autoScrollEnabled&&(n.scrollTop=n.scrollHeight)}},updated(n){const t=n.__vueScrollUpdate__;t&&t()},beforeUnmount(n){const t=n.__scrollData__;t&&t.handler&&n.removeEventListener("scroll",t.handler),delete n.__vueScrollUpdate__,delete n.__scrollData__}}},Symbol.toStringTag,{value:"Module"})),Ae=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{ujt:o,lv:a}=t?.value||{},{$global:l}=o;a&&l?.user?.info?.lv<a&&n?.classList&&!n.classList?.contains("asailevel")&&n.classList.add("asailevel")}}},Symbol.toStringTag,{value:"Module"})),Oe=Object.freeze(Object.defineProperty({__proto__:null,default:(n,t="webserver")=>{const{$model:o,$global:a,$fn:l}=n;return l.api[t]||(l.api[t]=new l.AsaiApi({baseURL:l.As.getUrlByCfg(a.link.api[t],0),Userinfo:a.user.info,ujt:n}),l.api[t].ictReq(async({url:s,opt:r})=>(r?.mm&&a?.code?.token&&(r.headers.Userinfo=`${a.code.token}`),{url:s,opt:r})),l.api[t].ictRes(s=>([908].includes(s.code)?s.data="":[909,200].includes(s.code),s))),l.api[t]}},Symbol.toStringTag,{value:"Module"})),ze=Object.freeze(Object.defineProperty({__proto__:null,default:{getUrlByCfg(n=null,t=0){return n?.url?n.url:n?.port?(t?window.location.protocol.includes("s")?"wss:":"ws:":window.location.protocol)+"//"+window.location.hostname+":"+n.port:t?window.location.origin.replace("http","ws"):window.location.origin},arrLenMax(n,t,o=0){return n.length>t&&(o?n.splice(t,n.length-t):n.splice(0,n.length-t)),n},setCookies(n,t,o=0,a="/"){let l="";if(o){const s=new Date;s.setTime(s.getTime()+o),l="; expires="+s.toUTCString()}document.cookie=n+"="+encodeURIComponent(t)+l+"; path="+(a||"/")},cookiesSet(n,t,o=0,a="/"){try{let l="";if(o){const s=new Date;s.setTime(s.getTime()+o),l="; expires="+s.toUTCString()}document.cookie=n+"="+t+l+"; path="+(a||"/")}catch{}},cookiesGet(n){try{const t=document.cookie;let o=t.substring(t.indexOf(n+"=")+(n+"=").length);const a=o.indexOf("; ");return a>-1?o.substring(0,a):o}catch{}return""},cookiesDel(n){this.setCookies(n,"",-1e3)},cookiesClear(){const n=document.cookie.split("; ");for(let t=0;t<n.length;t++){const o=n[t],a=o.indexOf("="),l=a>-1?o.substring(0,a):o;document.cookie=l+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}},readFile(n=null,t=0){return new Promise((o,a)=>{if(n){const l=new FileReader;t?l.readAsText(n):l.readAsDataURL(n),l.onload=()=>{o(l.result)}}else a()})},apiJsonp(n,t){try{let o=document.createElement("script");o.type="text/javascript",o.innerHTML=`
1
+ (function(Y,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Y=typeof globalThis<"u"?globalThis:Y||self,e(Y["asai-vue-host"]={},Y.Vue))})(this,(function(Y,e){"use strict";const ne=Object.freeze(Object.defineProperty({__proto__:null,get default(){return os}},Symbol.toStringTag,{value:"Module"})),Ee=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){if(typeof t.value=="function"){let o=0;const a=300,l=s=>{const r=performance.now();r-o<a?(t.value(s),o=0):o=r};n.__dbPointerDownHandler=l,n.addEventListener("pointerdown",l)}},unmounted(n){const t=n.__dbPointerDownHandler;t&&(n.removeEventListener("pointerdown",t),delete n.__dbPointerDownHandler)}}},Symbol.toStringTag,{value:"Module"}));function J(n,t){function o(g,_){_?.classList?.contains(g)&&_.classList.remove(g)}function a(g,_){_?.classList?.contains(g)||_.classList.add(g)}function l(g){a("touch-none",g)}function s(g){o("touch-none",g)}function r(g){const _=window.event||g;return _?.preventDefault(),_?.stopPropagation(),!0}function i(g){const _=window.event||g;_.cancelable&&(_?.preventDefault(),_?.stopPropagation())}function d(g){t.timeout||(t.timeout=requestAnimationFrame(()=>{g(),cancelAnimationFrame(t.timeout),t.timeout=null}))}function c(){return"ontouchstart"in window||navigator.maxTouchPoints}function m(g){c()&&t.touchstat!==1&&(g.addEventListener("touchstart",h,!0),t.touchstat=1)}function p(g){c()&&t.touchstat!==2&&(g.addEventListener("touchmove",r),l(g),t.touchstat=2)}function f(g){c()&&t.touchstat!==3&&(g.removeEventListener("touchmove",r),s(g),t.touchstat=3)}function h(g){document.body.addEventListener("touchmove",y),document.body.addEventListener("touchend",u),t.dragttm=Date.now()}function y(g){t.dragttm&&Date.now()-t.dragttm<1e3&&(t.dragtstat=2)}function u(g){document.body.removeEventListener("touchmove",y),document.body.removeEventListener("touchend",u),t.dragtstat=0}return{eStop:r,canTouch:c,eStopTouch:i,setTouchNone:l,setTouchAuto:s,fnPThrottle:d,vtTouchInit:m,vtTouchDown:p,vtTouchUp:f}}const q={},Se=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{fnPThrottle:o,vtTouchInit:a,vtTouchDown:l,vtTouchUp:s}=J(n,t.value);a(n);let r=!1,i=0,d=0,c=0,m=0;typeof t.value.domarea=="string"?q.dragAreaDom=document.getElementById(t.value.domarea):q.dragAreaDom=n;const p=y=>{console.log("handleDown",q,y),l(n),r=!0;const u=q.dragAreaDom.getBoundingClientRect();q.dragAreaDom.style.position="absolute",q.dragAreaDom.style.transform=`translate(${u.x}px, ${u.y}px)`,i=y.clientX-u.x,d=y.clientY-u.y,n.style.cursor="grabbing",document.addEventListener("pointermove",f),document.addEventListener("pointerup",h)},f=y=>{o(()=>{if(r){c=y.clientX-i,m=y.clientY-d;const u=window.innerWidth-q.dragAreaDom.offsetWidth,g=window.innerHeight-q.dragAreaDom.offsetHeight;c=Math.max(0,Math.min(c,u)),m=Math.max(0,Math.min(m,g)),q.dragAreaDom.style.transform=`translate(${c}px, ${m}px)`}})},h=()=>{r=!1,n.style.cursor="grab",s(n),document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",h)};n.addEventListener("pointerdown",p),q.unmounted=()=>{n.removeEventListener("pointerdown",p)}},unmounted(n){typeof q?.unmounted=="function"&&q.unmounted()}}},Symbol.toStringTag,{value:"Module"})),Z={},je=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{fnPThrottle:o,vtTouchInit:a,vtTouchDown:l,vtTouchUp:s}=J(n,t.value);a(n);let r=!1,i={x:0,y:0},d={x:0,y:0},c=null,m=1;const p=(t.value?.dom?document.getElementById(t.value.dom):"")||n,f=(t.value?.domarea?document.getElementById(t.value.domarea):"")||p,h=(t.value?.dommask?document.getElementById(t.value.dommask):"")||(t.value?.ujt?.$global?.sys?.zoomid?document.getElementById(t.value.ujt.$global.sys.zoomid):"")||document.getElementById("asaizoomarea")||document.body,y=()=>h&&(t.value?.scale||t.value?.ujt?.$global?.scale)||1,u=$=>{if(!h)return;if(l(n),$.preventDefault(),m=y(),t.value?.pos)d=t.value.pos;else{const w=window.getComputedStyle(f).transform?.split(", ");if(w.length>2){const S=w.pop().slice(0,-1)||0,C=w.pop()||0;d={x:parseFloat(C),y:parseFloat(S)}}else d={x:0,y:0}}r=!0,c=h.getBoundingClientRect();let x,b;x=$.clientX,b=$.clientY,i={x:(x-c.left)/m-d.x,y:(b-c.top)/m-d.y},p.setPointerCapture($.pointerId),document.addEventListener("pointermove",g),document.addEventListener("pointerup",_),document.addEventListener("pointercancel",_)},g=$=>{if(!r||!c)return;let x,b;x=$.clientX,b=$.clientY,m=y();const k=(x-c.left)/m-i.x,w=(b-c.top)/m-i.y,S=h.offsetWidth-f.offsetWidth,C=h.offsetHeight-f.offsetHeight;o(()=>{t.value.pos?(t.value.pos.x=+Math.max(0,Math.min(k,S)).toFixed(6),t.value.pos.y=+Math.max(0,Math.min(w,C)).toFixed(6)):f.style.transform=`translate(${+Math.max(0,Math.min(k,S)).toFixed(6)}px,${+Math.max(0,Math.min(w,C)).toFixed(6)}px)`})},_=$=>{s(n),$ instanceof PointerEvent&&p.hasPointerCapture($.pointerId)&&(r=!1,p.releasePointerCapture($.pointerId)),document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_)};p.addEventListener("pointerdown",u);const j=()=>c=null;window.addEventListener("resize",j),Z.unmounted=()=>{p.removeEventListener("pointerdown",u),window.removeEventListener("resize",j)}},unmounted(n){typeof Z?.unmounted=="function"&&Z.unmounted()}}},Symbol.toStringTag,{value:"Module"}));function Ce(n){const t=window.event||n;t.preventDefault(),t.stopPropagation()}const Be=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){function o(a){t.value.type===2&&Ce(a);const l=document.getElementById(t.value.dom);l&&(l.classList.contains("as-fullscreen")?l.classList.remove("as-fullscreen"):l.classList.add("as-fullscreen"))}t.value.type===2?n.addEventListener("dblclick",o):n.addEventListener("click",o)}}},Symbol.toStringTag,{value:"Module"})),I={},Ve=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{$global:o,$model:a}=t.value?.ujt||{};if(o.sys?.onkeyboard){let l=function(){o.keyboard.params||(o.keyboard.params={})},s=function(c){c?.setAttribute("inputmode","none"),c?.style?.setProperty("ime-mode","disabled","important"),o.keyboard.params.ot&&(o.keyboard.params.ot.fndscb=()=>{c?.removeAttribute("inputmode"),c?.style?.setProperty("ime-mode","normal","important")})},r=function(c){return a.data.sys.keyboard?.nokeytypes?.some(m=>c.target?.closest(m))},i=function(c){return Object.keys(a.data.sys.keyboard?.askeytypes||{})?.find(m=>c.target?.closest(m))},d=function(c){if(o.keyboard.params?.ot?.fnnumcb?.(),o.keyboard.params?.ot?.fndscb?.(),l(),t.value?.auto&&(o.keyboard.areastyle.x=c.clientX+(t.value?.auto?.x||0),o.keyboard.areastyle.y=c.clientY+(t.value?.auto?.y||0)),o.keyboard.params.ot={},!r(c))if(c.target?.closest(".portaskeyboard"))o.keyboard.params.ot.portaskeyboard=!0;else if(c.target?.closest(".askey-luaeditor"))I.monacoDom=c.target.closest(".askey-luaeditor"),I.keyboardDom=I.monacoDom.querySelector(".native-edit-context"),I.monacoDomText=I.monacoDom.querySelector("textarea"),s(I.monacoDomText),t.value?.style&&(o.keyboard.params.ot.style=t.value.style),Object.assign(o.keyboard.params,{type:"monaco",el:I.monacoDomText}),o.keyboard.showkeyboard=".askey-luaeditor";else if(["textarea","text","number","password"].includes(c.target?.type)&&!c.target?.disabled){if(I.keyboardDom=c.target,s(I.keyboardDom),I.keyboardDom.type==="number"){o.keyboard.showkeyboard=".askey-number",o.keyboard.params.ot.isnumber=!0,I.keyboardDom.type="text";let m=requestAnimationFrame(()=>{I.keyboardDom.setSelectionRange(I.keyboardDom?.value?.length||0,I.keyboardDom?.value?.length||0),I.keyboardDom.focus(),cancelAnimationFrame(m)});o.keyboard.params.ot.fnnumcb=()=>{I.keyboardDom.type="number"}}else{const m=i(c);console.log(666.222,m),m?o.keyboard.showkeyboard=m:o.keyboard.showkeyboard=".askey-default"}t.value?.style&&(o.keyboard.params.ot.style=t.value.style),Object.assign(o.keyboard.params,{type:I.keyboardDom.type,el:I.keyboardDom||n})}else o.keyboard.params={},o.keyboard.showkeyboard=""};l(),n.addEventListener("pointerdown",d),I.unmounted=()=>{n.removeEventListener("pointerdown",d)}}},unmounted(n){typeof I?.unmounted=="function"&&I.unmounted()}}},Symbol.toStringTag,{value:"Module"})),xe=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){t?.value?.right||n?.classList&&!n.classList?.contains("asailevel")&&n.classList.add("asailevel")}}},Symbol.toStringTag,{value:"Module"})),Ne=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{vtTouchInit:o,vtTouchDown:a,vtTouchUp:l}=J(n,t.value);o(n);const s=t.value.long?1e3:500;let r=null,i=!1,d=0,c=0;const m=10,p=u=>{a(n),t.value.prevent&&u.preventDefault(),i=!0,u?.touches?.[0]?(d=u.touches[0].clientX,c=u.touches[0].clientY):(d=u.clientX,c=u.clientY),t.value.press&&t.value.press(u),r=window.setTimeout(()=>{i&&t.value.hold&&t.value.hold(u)},s)},f=u=>{l(n),r!==null&&(clearTimeout(r),r=null),i&&(t.value.release&&t.value.release(u),i=!1)},y={down:p,up:f,move:u=>{if(!i)return;let g=0,_=0;u?.touches?.[0]?(g=u.touches[0].clientX,_=u.touches[0].clientY):(g=u.clientX,_=u.clientY);const j=Math.abs(g-d),$=Math.abs(_-c);(j>m||$>m)&&(r!==null&&(clearTimeout(r),r=null),i=!1)}};n.addEventListener("pointerdown",p),n.addEventListener("pointerup",f),n.addEventListener("pointercancel",f),n.addEventListener("pointerleave",f),n._pressHandlers=y},unmounted(n){const t=n._pressHandlers;t&&(n.removeEventListener("pointerdown",t.down),n.removeEventListener("pointerup",t.up),n.removeEventListener("pointercancel",t.up),n.removeEventListener("pointerleave",t.up),delete n._pressHandlers)}}},Symbol.toStringTag,{value:"Module"})),v={},Pe=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{fnPThrottle:o,vtTouchInit:a,vtTouchDown:l,vtTouchUp:s}=J(n,t.value);a(n);const{ujt:r,size:i,scale:d}=t.value;let c={x:0,y:0},m;const p={width:r?.$global?.sys?.zoomwidth||1920,height:r?.$global?.sys?.zoomheight||1200},f=()=>d||r?.$global?.scale||1;let h=!1,y,u,g,_,j=i||{w:0,h:0};const $=S=>({clientX:S.clientX,clientY:S.clientY}),x=S=>{l(n),S.preventDefault(),m=f(),h=!0;const{clientX:C,clientY:V}=$(S);y=C-window.scrollX,u=V-window.scrollY,g=n.offsetWidth,_=n.offsetHeight;const N=window.getComputedStyle(n).transform?.split(", ");if(N&&N.length>2){const M=N.pop().slice(0,-1),D=N.pop();c={x:parseFloat(D),y:parseFloat(M)}}else c={x:0,y:0};n.style.transform=`translate(${c.x}px,${c.y}px)`,S instanceof PointerEvent&&n.setPointerCapture(S.pointerId),document.addEventListener("pointermove",b),document.addEventListener("pointerup",k),document.addEventListener("pointercancel",k)},b=S=>{h&&o(()=>{const{clientX:C,clientY:V}=$(S),E=(C-window.scrollX-y)/m,N=(V-window.scrollY-u)/m;j.w=Math.min(Math.max(88,g+E),p.width-c.x),j.h=Math.min(Math.max(58,_+N),p.height-c.y),n.style.width=j.w+"px",n.style.height=j.h+"px"})},k=S=>{s(n),S instanceof PointerEvent&&n.hasPointerCapture(S.pointerId)&&n.releasePointerCapture(S.pointerId),h=!1,document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k)},w=document.createElement("div");w.classList.add("resize-bottom-right"),n.appendChild(w),w.addEventListener("pointerdown",x),v.unmounted=()=>{w.removeEventListener("pointerdown",x),w&&w.remove()}},unmounted(n){typeof v?.unmounted=="function"&&v.unmounted()}}},Symbol.toStringTag,{value:"Module"})),Me=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{fnPThrottle:o,vtTouchInit:a,vtTouchDown:l,vtTouchUp:s}=J(n,t.value);a(n);const{ujt:r,scale:i,id:d,type:c,cut:m,min:p}=t.value,f=()=>i||r?.$global?.scale||1,h={width:r?.$global?.sys?.zoomwidth||1920,height:r?.$global?.sys?.zoomheight||1200};let y=m||0;c?h.height=h.height-y:h.width=h.width-y;function u(){return typeof p=="function"?p():typeof p?.value=="number"?p?.value:typeof p=="number"?p:100}let g,_=1,j=!1,$=0,x=0,b=0,k=0;const w=E=>{if(g=document.getElementById(d),!g){console.error(`未找到 ID 为 ${d} 的元素`);return}l(n),E.preventDefault(),_=f(),j=!0,c?(b=E.clientY,k=g.offsetHeight):($=E.clientX,x=g.offsetWidth),document.addEventListener("pointermove",S),document.addEventListener("pointerup",C)},S=E=>{j&&o(()=>{if(c){const N=(b-E.clientY)/_,M=Math.max(u(),k+N);g.style.height=Math.min(M,h.height)+"px",g.style.minHeight=Math.min(M,h.height)+"px"}else{const N=($-E.clientX)/_,M=Math.max(u(),x+N);g.style.width=Math.min(M,h.width)+"px",g.style.minWidth=Math.min(M,h.width)+"px"}})},C=()=>{j=!1,s(n),document.removeEventListener("pointermove",S),document.removeEventListener("pointerup",C)};n.addEventListener("pointerdown",w);const V=()=>{n.removeEventListener("pointerdown",w)};n.__unmountResize=V},unmounted(n){n.__unmountResize&&(n.__unmountResize(),delete n.__unmountResize)}}},Symbol.toStringTag,{value:"Module"})),De=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n){n.scrollTop=n.scrollHeight;const t={autoScrollEnabled:!0,handler:()=>{const o=Math.abs(n.scrollHeight-n.scrollTop-n.clientHeight)<10;t.autoScrollEnabled=o}};n.addEventListener("scroll",t.handler),n.__scrollData__=t,n.__vueScrollUpdate__=()=>{t.autoScrollEnabled&&(n.scrollTop=n.scrollHeight)}},updated(n){const t=n.__vueScrollUpdate__;t&&t()},beforeUnmount(n){const t=n.__scrollData__;t&&t.handler&&n.removeEventListener("scroll",t.handler),delete n.__vueScrollUpdate__,delete n.__scrollData__}}},Symbol.toStringTag,{value:"Module"})),Ae=Object.freeze(Object.defineProperty({__proto__:null,default:{mounted(n,t){const{ujt:o,lv:a}=t?.value||{},{$global:l}=o;a&&l?.user?.info?.lv<a&&n?.classList&&!n.classList?.contains("asailevel")&&n.classList.add("asailevel")}}},Symbol.toStringTag,{value:"Module"})),Oe=Object.freeze(Object.defineProperty({__proto__:null,default:(n,t="webserver")=>{const{$model:o,$global:a,$fn:l}=n;return l.api[t]||(l.api[t]=new l.AsaiApi({baseURL:l.As.getUrlByCfg(a.link.api[t],0),Userinfo:a.user.info,ujt:n}),l.api[t].ictReq(async({url:s,opt:r})=>(r?.mm&&a?.code?.token&&(r.headers.Userinfo=`${a.code.token}`),{url:s,opt:r})),l.api[t].ictRes(s=>([908].includes(s.code)?s.data="":[909,200].includes(s.code),s))),l.api[t]}},Symbol.toStringTag,{value:"Module"})),ze=Object.freeze(Object.defineProperty({__proto__:null,default:{getUrlByCfg(n=null,t=0){return n?.url?n.url:n?.port?(t?window.location.protocol.includes("s")?"wss:":"ws:":window.location.protocol)+"//"+window.location.hostname+":"+n.port:t?window.location.origin.replace("http","ws"):window.location.origin},arrLenMax(n,t,o=0){return n.length>t&&(o?n.splice(t,n.length-t):n.splice(0,n.length-t)),n},setCookies(n,t,o=0,a="/"){let l="";if(o){const s=new Date;s.setTime(s.getTime()+o),l="; expires="+s.toUTCString()}document.cookie=n+"="+encodeURIComponent(t)+l+"; path="+(a||"/")},cookiesSet(n,t,o=0,a="/"){try{let l="";if(o){const s=new Date;s.setTime(s.getTime()+o),l="; expires="+s.toUTCString()}document.cookie=n+"="+t+l+"; path="+(a||"/")}catch{}},cookiesGet(n){try{const t=document.cookie;let o=t.substring(t.indexOf(n+"=")+(n+"=").length);const a=o.indexOf("; ");return a>-1?o.substring(0,a):o}catch{}return""},cookiesDel(n){this.setCookies(n,"",-1e3)},cookiesClear(){const n=document.cookie.split("; ");for(let t=0;t<n.length;t++){const o=n[t],a=o.indexOf("="),l=a>-1?o.substring(0,a):o;document.cookie=l+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}},readFile(n=null,t=0){return new Promise((o,a)=>{if(n){const l=new FileReader;t?l.readAsText(n):l.readAsDataURL(n),l.onload=()=>{o(l.result)}}else a()})},apiJsonp(n,t){try{let o=document.createElement("script");o.type="text/javascript",o.innerHTML=`
2
2
  window.cbdata;
3
3
  function asaiJsonp(data) {
4
4
  cbdata=data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asai-vue-host",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "asai for you",
5
5
  "author": "Asai",
6
6
  "license": "ISC",