xframelib 1.1.0 → 1.1.1

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 CHANGED
@@ -13,6 +13,7 @@
13
13
 
14
14
  > 基于 VUE3+Hprose+Typescript+Widget 的前端框架,与ElementUI、AntDesign VUE、Quasar等界面库无关,一直是来源于项目和服务于项目。
15
15
 
16
+ - v1.1.1 增加基于fetch流式方式请求数据的相关方法(例如:streamFetch**);给IWidgetConfig增加componentProps属性支持配置widget组件外部绑定属性对象;
16
17
  - v1.1.0 增加traverseXYArrayFromInsideOut从内到外遍历;增加NavigatorPlugin工具插件提供全局浏览器API方法(如:电池电量、通知、振动等);规范workers将worker-bigimage和worker-XXTEA合并到worker-xmath中,将iconv编码转码独立为worker-iconv;更新依赖库版本;
17
18
  - v1.0.9 增加LocalForage二次导出等;解决iconv-lite库升级的代码更新问题;更新依赖库版本;
18
19
  - v1.0.8 优化LayoutContainer组件,增加属性(默认值为false):noTop、noMain、noBack、noFront、noLeft、noRight、noBottom来支持移除无用布局层,用noMain来取代enableRouterView属性;优化XWindow组件,增加right和bottom属性来进行窗体初始化定位;更新依赖库版本;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ const t=Symbol("Comlink.proxy"),e=Symbol("Comlink.endpoint"),i=Symbol("Comlink.releaseProxy"),s=Symbol("Comlink.finalizer"),n=Symbol("Comlink.thrown"),r=t=>"object"==typeof t&&null!==t||"function"==typeof t,o={canHandle:e=>r(e)&&e[t],serialize(t){const{port1:e,port2:i}=new MessageChannel;return a(t,e),[i,[i]]},deserialize:t=>(t.start(),function(t){const e=new Map;return t.addEventListener("message",(function(t){const{data:i}=t;if(!i||!i.id)return;const s=e.get(i.id);if(s)try{s(i)}finally{e.delete(i.id)}})),p(t,e,[],void 0)}(t))},h=new Map([["proxy",o],["throw",{canHandle:t=>r(t)&&n in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function a(e,i=globalThis,r=["*"]){i.addEventListener("message",(function o(h){if(!h||!h.data)return;if(!function(t,e){for(const i of t){if(e===i||"*"===i)return!0;if(i instanceof RegExp&&i.test(e))return!0}return!1}(r,h.origin))return void console.warn(`Invalid origin '${h.origin}' for comlink proxy`);const{id:c,type:u,path:f}=Object.assign({path:[]},h.data),d=(h.data.argumentList||[]).map(v);let p;try{const i=f.slice(0,-1).reduce(((t,e)=>t[e]),e),s=f.reduce(((t,e)=>t[e]),e);switch(u){case"GET":p=s;break;case"SET":i[f.slice(-1)[0]]=v(h.data.value),p=!0;break;case"APPLY":p=s.apply(i,d);break;case"CONSTRUCT":p=function(e){return Object.assign(e,{[t]:!0})}(new s(...d));break;case"ENDPOINT":{const{port1:t,port2:i}=new MessageChannel;a(e,i),p=function(t,e){return w.set(t,e),t}(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(t){p={value:t,[n]:0}}Promise.resolve(p).catch((t=>({value:t,[n]:0}))).then((t=>{const[n,r]=m(t);i.postMessage(Object.assign(Object.assign({},n),{id:c}),r),"RELEASE"===u&&(i.removeEventListener("message",o),l(i),s in e&&"function"==typeof e[s]&&e[s]())})).catch((t=>{const[e,s]=m({value:new TypeError("Unserializable return value"),[n]:0});i.postMessage(Object.assign(Object.assign({},e),{id:c}),s)}))})),i.start&&i.start()}function l(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function c(t){if(t)throw new Error("Proxy has been released and is not useable")}function u(t){return y(t,new Map,{type:"RELEASE"}).then((()=>{l(t)}))}const f=new WeakMap,d="FinalizationRegistry"in globalThis&&new FinalizationRegistry((t=>{const e=(f.get(t)||0)-1;f.set(t,e),0===e&&u(t)}));function p(t,s,n=[],r=function(){}){let o=!1;const h=new Proxy(r,{get(e,r){if(c(o),r===i)return()=>{!function(t){d&&d.unregister(t)}(h),u(t),s.clear(),o=!0};if("then"===r){if(0===n.length)return{then:()=>h};const e=y(t,s,{type:"GET",path:n.map((t=>t.toString()))}).then(v);return e.then.bind(e)}return p(t,s,[...n,r])},set(e,i,r){c(o);const[h,a]=m(r);return y(t,s,{type:"SET",path:[...n,i].map((t=>t.toString())),value:h},a).then(v)},apply(i,r,h){c(o);const a=n[n.length-1];if(a===e)return y(t,s,{type:"ENDPOINT"}).then(v);if("bind"===a)return p(t,s,n.slice(0,-1));const[l,u]=g(h);return y(t,s,{type:"APPLY",path:n.map((t=>t.toString())),argumentList:l},u).then(v)},construct(e,i){c(o);const[r,h]=g(i);return y(t,s,{type:"CONSTRUCT",path:n.map((t=>t.toString())),argumentList:r},h).then(v)}});return function(t,e){const i=(f.get(e)||0)+1;f.set(e,i),d&&d.register(t,e,t)}(h,t),h}function g(t){const e=t.map(m);return[e.map((t=>t[0])),(i=e.map((t=>t[1])),Array.prototype.concat.apply([],i))];var i}const w=new WeakMap;function m(t){for(const[e,i]of h)if(i.canHandle(t)){const[s,n]=i.serialize(t);return[{type:"HANDLER",name:e,value:s},n]}return[{type:"RAW",value:t},w.get(t)||[]]}function v(t){switch(t.type){case"HANDLER":return h.get(t.name).deserialize(t.value);case"RAW":return t.value}}function y(t,e,i,s){return new Promise((n=>{const r=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.set(r,n),t.start&&t.start(),t.postMessage(Object.assign({id:r},i),s)}))}var S,b,_={exports:{}},E=_.exports={};function T(){throw new Error("setTimeout has not been defined")}function A(){throw new Error("clearTimeout has not been defined")}function F(t){if(S===setTimeout)return setTimeout(t,0);if((S===T||!S)&&setTimeout)return S=setTimeout,setTimeout(t,0);try{return S(t,0)}catch(e){try{return S.call(null,t,0)}catch(e){return S.call(this,t,0)}}}!function(){try{S="function"==typeof setTimeout?setTimeout:T}catch(t){S=T}try{b="function"==typeof clearTimeout?clearTimeout:A}catch(t){b=A}}();var O,z=[],x=!1,C=-1;function R(){x&&O&&(x=!1,O.length?z=O.concat(z):C=-1,z.length&&L())}function L(){if(!x){var t=F(R);x=!0;for(var e=z.length;e;){for(O=z,z=[];++C<e;)O&&O[C].run();C=-1,e=z.length}O=null,x=!1,function(t){if(b===clearTimeout)return clearTimeout(t);if((b===A||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(t);try{return b(t)}catch(e){try{return b.call(null,t)}catch(e){return b.call(this,t)}}}(t)}}function k(t,e){this.fun=t,this.array=e}function M(){}E.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];z.push(new k(t,e)),1!==z.length||x||F(L)},k.prototype.run=function(){this.fun.apply(null,this.array)},E.title="browser",E.browser=!0,E.env={},E.argv=[],E.version="",E.versions={},E.on=M,E.addListener=M,E.once=M,E.off=M,E.removeListener=M,E.removeAllListeners=M,E.emit=M,E.prependListener=M,E.prependOnceListener=M,E.listeners=function(t){return[]},E.binding=function(t){throw new Error("process.binding is not supported")},E.cwd=function(){return"/"},E.chdir=function(t){throw new Error("process.chdir is not supported")},E.umask=function(){return 0};const D=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}(_.exports);var W="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,j=new Set,G="object"==typeof D&&D?D:{},U=(t,e,i,s)=>{"function"==typeof G.emitWarning?G.emitWarning(t,e,i,s):console.error(`[${i}] ${e}: ${t}`)},N=globalThis.AbortController,P=globalThis.AbortSignal;if(typeof N>"u"){P=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},N=class{constructor(){e()}signal=new P;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(let e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==G.env?.LRU_CACHE_IGNORE_AC_WARNING,e=()=>{t&&(t=!1,U("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var I=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),H=t=>I(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?B:null:null,B=class extends Array{constructor(t){super(t),this.fill(0)}},V=class t{heap;length;static#t=!1;static create(e){let i=H(e);if(!i)return[];t.#t=!0;let s=new t(e,i);return t.#t=!1,s}constructor(e,i){if(!t.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},$=class t{#t;#e;#i;#s;#n;#r;#o;#h;get perf(){return this.#h}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#l;#c;#u;#f;#d;#p;#g;#w;#m;#v;#y;#S;#b;#_;#E;#T;#A;#F;static unsafeExposeInternals(t){return{starts:t.#S,ttls:t.#b,autopurgeTimers:t.#_,sizes:t.#y,keyMap:t.#c,keyList:t.#u,valList:t.#f,next:t.#d,prev:t.#p,get head(){return t.#g},get tail(){return t.#w},free:t.#m,isBackgroundFetch:e=>t.#O(e),backgroundFetch:(e,i,s,n)=>t.#z(e,i,s,n),moveToTail:e=>t.#x(e),indexes:e=>t.#C(e),rindexes:e=>t.#R(e),isStale:e=>t.#L(e)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#l}get size(){return this.#a}get fetchMethod(){return this.#r}get memoMethod(){return this.#o}get dispose(){return this.#i}get onInsert(){return this.#s}get disposeAfter(){return this.#n}constructor(e){let{max:i=0,ttl:s,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,onInsert:c,disposeAfter:u,noDisposeOnSet:f,noUpdateTTL:d,maxSize:p=0,maxEntrySize:g=0,sizeCalculation:w,fetchMethod:m,memoMethod:v,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:_,ignoreFetchAbort:E,perf:T}=e;if(void 0!==T&&"function"!=typeof T?.now)throw new TypeError("perf option must have a now() method if specified");if(this.#h=T??W,0!==i&&!I(i))throw new TypeError("max option must be a nonnegative integer");let A=i?H(i):Array;if(!A)throw new Error("invalid max value: "+i);if(this.#t=i,this.#e=p,this.maxEntrySize=g||this.#e,this.sizeCalculation=w,this.sizeCalculation){if(!this.#e&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==v&&"function"!=typeof v)throw new TypeError("memoMethod must be a function if defined");if(this.#o=v,void 0!==m&&"function"!=typeof m)throw new TypeError("fetchMethod must be a function if specified");if(this.#r=m,this.#T=!!m,this.#c=new Map,this.#u=new Array(i).fill(void 0),this.#f=new Array(i).fill(void 0),this.#d=new A(i),this.#p=new A(i),this.#g=0,this.#w=0,this.#m=V.create(i),this.#a=0,this.#l=0,"function"==typeof l&&(this.#i=l),"function"==typeof c&&(this.#s=c),"function"==typeof u?(this.#n=u,this.#v=[]):(this.#n=void 0,this.#v=void 0),this.#E=!!this.#i,this.#F=!!this.#s,this.#A=!!this.#n,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!E,0!==this.maxEntrySize){if(0!==this.#e&&!I(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!I(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#k()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=I(n)||0===n?n:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!I(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(0===this.#t&&0===this.ttl&&0===this.#e)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let e="LRU_CACHE_UNBOUNDED";(t=>!j.has(t))(e)&&(j.add(e),U("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,t))}}getRemainingTTL(t){return this.#c.has(t)?1/0:0}#M(){let t=new B(this.#t),e=new B(this.#t);this.#b=t,this.#S=e;let i=this.ttlAutopurge?new Array(this.#t):void 0;this.#_=i,this.#D=(s,n,r=this.#h.now())=>{if(e[s]=0!==n?r:0,t[s]=n,i?.[s]&&(clearTimeout(i[s]),i[s]=void 0),0!==n&&i){let t=setTimeout((()=>{this.#L(s)&&this.#W(this.#u[s],"expire")}),n+1);t.unref&&t.unref(),i[s]=t}},this.#j=i=>{e[i]=0!==t[i]?this.#h.now():0},this.#G=(i,r)=>{if(t[r]){let o=t[r],h=e[r];if(!o||!h)return;i.ttl=o,i.start=h,i.now=s||n();let a=i.now-h;i.remainingTTL=o-a}};let s=0,n=()=>{let t=this.#h.now();if(this.ttlResolution>0){s=t;let e=setTimeout((()=>s=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{let r=this.#c.get(i);if(void 0===r)return 0;let o=t[r],h=e[r];return o&&h?o-((s||n())-h):1/0},this.#L=i=>{let r=e[i],o=t[i];return!!o&&!!r&&(s||n())-r>o}}#j=()=>{};#G=()=>{};#D=()=>{};#L=()=>!1;#k(){let t=new B(this.#t);this.#l=0,this.#y=t,this.#U=e=>{this.#l-=t[e],t[e]=0},this.#N=(t,e,i,s)=>{if(this.#O(e))return 0;if(!I(i)){if(!s)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof s)throw new TypeError("sizeCalculation must be a function");if(i=s(e,t),!I(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return i},this.#P=(e,i,s)=>{if(t[e]=i,this.#e){let i=this.#e-t[e];for(;this.#l>i;)this.#I(!0)}this.#l+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#l)}}#U=t=>{};#P=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#C({allowStale:t=this.allowStale}={}){if(this.#a)for(let e=this.#w;this.#H(e)&&((t||!this.#L(e))&&(yield e),e!==this.#g);)e=this.#p[e]}*#R({allowStale:t=this.allowStale}={}){if(this.#a)for(let e=this.#g;this.#H(e)&&((t||!this.#L(e))&&(yield e),e!==this.#w);)e=this.#d[e]}#H(t){return void 0!==t&&this.#c.get(this.#u[t])===t}*entries(){for(let t of this.#C())void 0!==this.#f[t]&&void 0!==this.#u[t]&&!this.#O(this.#f[t])&&(yield[this.#u[t],this.#f[t]])}*rentries(){for(let t of this.#R())void 0!==this.#f[t]&&void 0!==this.#u[t]&&!this.#O(this.#f[t])&&(yield[this.#u[t],this.#f[t]])}*keys(){for(let t of this.#C()){let e=this.#u[t];void 0!==e&&!this.#O(this.#f[t])&&(yield e)}}*rkeys(){for(let t of this.#R()){let e=this.#u[t];void 0!==e&&!this.#O(this.#f[t])&&(yield e)}}*values(){for(let t of this.#C())void 0!==this.#f[t]&&!this.#O(this.#f[t])&&(yield this.#f[t])}*rvalues(){for(let t of this.#R())void 0!==this.#f[t]&&!this.#O(this.#f[t])&&(yield this.#f[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#C()){let s=this.#f[i],n=this.#O(s)?s.__staleWhileFetching:s;if(void 0!==n&&t(n,this.#u[i],this))return this.get(this.#u[i],e)}}forEach(t,e=this){for(let i of this.#C()){let s=this.#f[i],n=this.#O(s)?s.__staleWhileFetching:s;void 0!==n&&t.call(e,n,this.#u[i],this)}}rforEach(t,e=this){for(let i of this.#R()){let s=this.#f[i],n=this.#O(s)?s.__staleWhileFetching:s;void 0!==n&&t.call(e,n,this.#u[i],this)}}purgeStale(){let t=!1;for(let e of this.#R({allowStale:!0}))this.#L(e)&&(this.#W(this.#u[e],"expire"),t=!0);return t}info(t){let e=this.#c.get(t);if(void 0===e)return;let i=this.#f[e],s=this.#O(i)?i.__staleWhileFetching:i;if(void 0===s)return;let n={value:s};if(this.#b&&this.#S){let t=this.#b[e],i=this.#S[e];if(t&&i){let e=t-(this.#h.now()-i);n.ttl=e,n.start=Date.now()}}return this.#y&&(n.size=this.#y[e]),n}dump(){let t=[];for(let e of this.#C({allowStale:!0})){let i=this.#u[e],s=this.#f[e],n=this.#O(s)?s.__staleWhileFetching:s;if(void 0===n||void 0===i)continue;let r={value:n};if(this.#b&&this.#S){r.ttl=this.#b[e];let t=this.#h.now()-this.#S[e];r.start=Math.floor(Date.now()-t)}this.#y&&(r.size=this.#y[e]),t.unshift([i,r])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let t=Date.now()-i.start;i.start=this.#h.now()-t}this.set(e,i.value,i)}}set(t,e,i={}){if(void 0===e)return this.delete(t),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:h}=i,{noUpdateTTL:a=this.noUpdateTTL}=i,l=this.#N(t,e,i.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#W(t,"set"),this;let c=0===this.#a?void 0:this.#c.get(t);if(void 0===c)c=0===this.#a?this.#w:0!==this.#m.length?this.#m.pop():this.#a===this.#t?this.#I(!1):this.#a,this.#u[c]=t,this.#f[c]=e,this.#c.set(t,c),this.#d[this.#w]=c,this.#p[c]=this.#w,this.#w=c,this.#a++,this.#P(c,l,h),h&&(h.set="add"),a=!1,this.#F&&this.#s?.(e,t,"add");else{this.#x(c);let i=this.#f[c];if(e!==i){if(this.#T&&this.#O(i)){i.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:e}=i;void 0!==e&&!r&&(this.#E&&this.#i?.(e,t,"set"),this.#A&&this.#v?.push([e,t,"set"]))}else r||(this.#E&&this.#i?.(i,t,"set"),this.#A&&this.#v?.push([i,t,"set"]));if(this.#U(c),this.#P(c,l,h),this.#f[c]=e,h){h.set="replace";let t=i&&this.#O(i)?i.__staleWhileFetching:i;void 0!==t&&(h.oldValue=t)}}else h&&(h.set="update");this.#F&&this.onInsert?.(e,t,e===i?"update":"replace")}if(0!==s&&!this.#b&&this.#M(),this.#b&&(a||this.#D(c,s,n),h&&this.#G(h,c)),!r&&this.#A&&this.#v){let t,e=this.#v;for(;t=e?.shift();)this.#n?.(...t)}return this}pop(){try{for(;this.#a;){let t=this.#f[this.#g];if(this.#I(!0),this.#O(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#A&&this.#v){let t,e=this.#v;for(;t=e?.shift();)this.#n?.(...t)}}}#I(t){let e=this.#g,i=this.#u[e],s=this.#f[e];return this.#T&&this.#O(s)?s.__abortController.abort(new Error("evicted")):(this.#E||this.#A)&&(this.#E&&this.#i?.(s,i,"evict"),this.#A&&this.#v?.push([s,i,"evict"])),this.#U(e),this.#_?.[e]&&(clearTimeout(this.#_[e]),this.#_[e]=void 0),t&&(this.#u[e]=void 0,this.#f[e]=void 0,this.#m.push(e)),1===this.#a?(this.#g=this.#w=0,this.#m.length=0):this.#g=this.#d[e],this.#c.delete(i),this.#a--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#c.get(t);if(void 0!==n){let t=this.#f[n];if(this.#O(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#L(n))return i&&this.#j(n),s&&(s.has="hit",this.#G(s,n)),!0;s&&(s.has="stale",this.#G(s,n))}else s&&(s.has="miss");return!1}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=this.#c.get(t);if(void 0===s||!i&&this.#L(s))return;let n=this.#f[s];return this.#O(n)?n.__staleWhileFetching:n}#z(t,e,i,s){let n=void 0===e?void 0:this.#f[e];if(this.#O(n))return n;let r=new N,{signal:o}=i;o?.addEventListener("abort",(()=>r.abort(o.reason)),{signal:r.signal});let h={signal:r.signal,options:i,context:s},a=(s,n=!1)=>{let{aborted:o}=r.signal,a=i.ignoreFetchAbort&&void 0!==s,u=i.ignoreFetchAbort||!(!i.allowStaleOnFetchAbort||void 0===s);if(i.status&&(o&&!n?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,a&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),o&&!a&&!n)return l(r.signal.reason,u);let f=c,d=this.#f[e];return(d===c||a&&n&&void 0===d)&&(void 0===s?void 0!==f.__staleWhileFetching?this.#f[e]=f.__staleWhileFetching:this.#W(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,s,h.options))),s},l=(s,n)=>{let{aborted:o}=r.signal,h=o&&i.allowStaleOnFetchAbort,a=h||i.allowStaleOnFetchRejection,l=a||i.noDeleteOnFetchRejection,u=c;if(this.#f[e]===c&&(!l||!n&&void 0===u.__staleWhileFetching?this.#W(t,"fetch"):h||(this.#f[e]=u.__staleWhileFetching)),a)return i.status&&void 0!==u.__staleWhileFetching&&(i.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw s};i.status&&(i.status.fetchDispatched=!0);let c=new Promise(((e,s)=>{let o=this.#r?.(t,n,h);o&&o instanceof Promise&&o.then((t=>e(void 0===t?void 0:t)),s),r.signal.addEventListener("abort",(()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(e(void 0),i.allowStaleOnFetchAbort&&(e=t=>a(t,!0)))}))})).then(a,(t=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=t),l(t,!1)))),u=Object.assign(c,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return void 0===e?(this.set(t,u,{...h.options,status:void 0}),e=this.#c.get(t)):this.#f[e]=u,u}#O(t){if(!this.#T)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof N}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:h=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=!1,status:w,signal:m}=e;if(!this.#T)return w&&(w.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:w});let v={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:o,size:h,sizeCalculation:a,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:d,ignoreFetchAbort:f,status:w,signal:m},y=this.#c.get(t);if(void 0===y){w&&(w.fetch="miss");let e=this.#z(t,y,v,p);return e.__returned=e}{let e=this.#f[y];if(this.#O(e)){let t=i&&void 0!==e.__staleWhileFetching;return w&&(w.fetch="inflight",t&&(w.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}let n=this.#L(y);if(!g&&!n)return w&&(w.fetch="hit"),this.#x(y),s&&this.#j(y),w&&this.#G(w,y),e;let r=this.#z(t,y,v,p),o=void 0!==r.__staleWhileFetching&&i;return w&&(w.fetch=n?"stale":"refresh",o&&n&&(w.returnedStale=!0)),o?r.__staleWhileFetching:r.__returned=r}}async forceFetch(t,e={}){let i=await this.fetch(t,e);if(void 0===i)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let i=this.#o;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...r}=e,o=this.get(t,r);if(!n&&void 0!==o)return o;let h=i(t,o,{options:r,context:s});return this.set(t,h,r),h}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,o=this.#c.get(t);if(void 0!==o){let e=this.#f[o],h=this.#O(e);return r&&this.#G(r,o),this.#L(o)?(r&&(r.get="stale"),h?(r&&i&&void 0!==e.__staleWhileFetching&&(r.returnedStale=!0),i?e.__staleWhileFetching:void 0):(n||this.#W(t,"expire"),r&&i&&(r.returnedStale=!0),i?e:void 0)):(r&&(r.get="hit"),h?e.__staleWhileFetching:(this.#x(o),s&&this.#j(o),e))}r&&(r.get="miss")}#B(t,e){this.#p[e]=t,this.#d[t]=e}#x(t){t!==this.#w&&(t===this.#g?this.#g=this.#d[t]:this.#B(this.#p[t],this.#d[t]),this.#B(this.#w,t),this.#w=t)}delete(t){return this.#W(t,"delete")}#W(t,e){let i=!1;if(0!==this.#a){let s=this.#c.get(t);if(void 0!==s)if(this.#_?.[s]&&(clearTimeout(this.#_?.[s]),this.#_[s]=void 0),i=!0,1===this.#a)this.#V(e);else{this.#U(s);let i=this.#f[s];if(this.#O(i)?i.__abortController.abort(new Error("deleted")):(this.#E||this.#A)&&(this.#E&&this.#i?.(i,t,e),this.#A&&this.#v?.push([i,t,e])),this.#c.delete(t),this.#u[s]=void 0,this.#f[s]=void 0,s===this.#w)this.#w=this.#p[s];else if(s===this.#g)this.#g=this.#d[s];else{let t=this.#p[s];this.#d[t]=this.#d[s];let e=this.#d[s];this.#p[e]=this.#p[s]}this.#a--,this.#m.push(s)}}if(this.#A&&this.#v?.length){let t,e=this.#v;for(;t=e?.shift();)this.#n?.(...t)}return i}clear(){return this.#V("delete")}#V(t){for(let e of this.#R({allowStale:!0})){let i=this.#f[e];if(this.#O(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#u[e];this.#E&&this.#i?.(i,s,t),this.#A&&this.#v?.push([i,s,t])}}if(this.#c.clear(),this.#f.fill(void 0),this.#u.fill(void 0),this.#b&&this.#S){this.#b.fill(0),this.#S.fill(0);for(let t of this.#_??[])void 0!==t&&clearTimeout(t);this.#_?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#g=0,this.#w=0,this.#m.length=0,this.#l=0,this.#a=0,this.#A&&this.#v){let t,e=this.#v;for(;t=e?.shift();)this.#n?.(...t)}}};class Y{static defaultOptions={max:1e3,maxAge:18e5};static cache=new $(this.defaultOptions);static createCache(t=this.defaultOptions){return new $(t)}static set(t,e,i=this.cache){let s=i;s||(s=this.cache),s.set(t,e)}static get(t,e=this.cache){let i=e;return i||(i=this.cache),i.get(t)}static remove(t,e=this.cache){let i=e;return i||(i=this.cache),i.del(t)}static has(t,e=this.cache){let i=e;return i||(i=this.cache),i.has(t)}static count(t=this.cache){let e=t;return e||(e=this.cache),e.size}static maxSize(t=this.cache){let e=t;return e||(e=this.cache),e.max}static peek(t,e=this.cache){let i=e;return i||(i=this.cache),i.peek(t)}static keys(t=this.cache){let e=t;return e||(e=this.cache),e.keys()}static clear(t=this.cache){let e=t;e||(e=this.cache),e.clear()}}const X=new Map;async function q(t,e=void 0){const i={max:1e3,maxAage:18e5};let s=i;e&&(s={...i,...e});const n=Y.createCache(s);return X.set(t,n),n}async function J(t=""){let e;return e=X.has(t)?X.get(t):await q(t),e}a(Object.freeze({__proto__:null,clear:async function(t=""){const e=await J(t);return e&&Y.clear(e),!1},count:async function(t=""){const e=await J(t);return e?Y.count(e):0},createCache:q,get:async function(t,e=""){const i=await J(e);if(i){const e=Y.get(t,i);return console.log("666000",t,e),e}},getCacheObject:J,has:async function(t,e=""){const i=await J(e);return!!i&&Y.has(t,i)},keys:async function(t=""){const e=await J(t);if(e)return Y.keys(e)},maxSize:async function(t=""){const e=await J(t);return e?Y.maxSize(e):0},peek:async function(t,e=""){const i=await J(e);return!!i&&Y.peek(t,i)},remove:async function(t,e=""){const i=await J(e);if(i)return Y.remove(t,i)},set:async function(t,e,i=""){const s=await J(i);return!!s&&(Y.set(t,e,s),!0)}}));
@@ -1,5 +1,5 @@
1
- import { LayoutContainerEnum, IWidgetConfig } from '../../model/Layout';
2
1
  import { Ref } from 'vue';
2
+ import { IWidgetConfig, LayoutContainerEnum } from '../../model/Layout';
3
3
  /**
4
4
  * 布局对象定义
5
5
  */
package/dist/index.css CHANGED
@@ -1,20 +1,3 @@
1
- .adivider {
2
- width: 100%;
3
- margin: 10px 0;
4
- display: flex;
5
- align-items: center;
6
- justify-items: center;
7
- }
8
-
9
- .adivider .line {
10
- border: v-bind(lineColor) 1px solid;
11
- }
12
-
13
- .adivider .contentText {
14
- background-color: inherit;
15
- font-size: 18px;
16
- }
17
-
18
1
  .splitpanes {
19
2
  display: flex;
20
3
  width: 100%;
@@ -147,112 +130,6 @@
147
130
  margin-top: 1px;
148
131
  }
149
132
 
150
- .layoutContainer {
151
- position: relative;
152
- width: 100%;
153
- height: 100%;
154
- padding: 0;
155
- margin: 0;
156
- --layout-top-height: 70px;
157
- --layout-left-width: 200px;
158
- --layout-right-width: 200px;
159
- --layout-bottom-height: 60px;
160
- --layout-top-zindex: 100;
161
- --layout-bottom-zindex: 100;
162
- --layout-centermain-zindex: 80;
163
- --layout-centerback-zindex: 90;
164
- --layout-centerfront-zindex: 110;
165
- --layout-left-zindex: 100;
166
- --layout-right-zindex: 100;
167
- }
168
-
169
- .topContainer {
170
- position: absolute;
171
- top: 0px;
172
- left: 0px;
173
- width: 100%;
174
- height: var(--layout-top-height);
175
- z-index: var(--layout-top-zindex);
176
- overflow: hidden;
177
- pointer-events: none;
178
- }
179
-
180
- .topContainer > * {
181
- pointer-events: all !important;
182
- }
183
-
184
- .bottomContainer {
185
- position: absolute;
186
- bottom: 0px;
187
- left: 0px;
188
- width: 100%;
189
- height: var(--layout-bottom-height);
190
- z-index: var(--layout-bottom-zindex);
191
- overflow: hidden;
192
- pointer-events: none;
193
- }
194
-
195
- .bottomContainer > * {
196
- pointer-events: all !important;
197
- }
198
-
199
- .leftContainer {
200
- position: absolute;
201
- top: 0px;
202
- left: 0px;
203
- bottom: 0;
204
- z-index: var(--layout-left-zindex);
205
- width: var(--layout-left-width);
206
- overflow: hidden;
207
- pointer-events: none;
208
- }
209
-
210
- .leftContainer > * {
211
- pointer-events: all !important;
212
- }
213
-
214
- .rightContainer {
215
- position: absolute;
216
- top: 0px;
217
- right: 0px;
218
- bottom: 0;
219
- width: var(--layout-right-width);
220
- z-index: var(--layout-right-zindex);
221
- overflow: hidden;
222
- pointer-events: none;
223
- }
224
-
225
- .rightContainer > * {
226
- pointer-events: all !important;
227
- }
228
-
229
- .centerdiv {
230
- position: absolute;
231
- top: 0;
232
- left: 0;
233
- bottom: 0;
234
- width: 100%;
235
- background-color: transparent;
236
- overflow: hidden;
237
- pointer-events: none;
238
- }
239
-
240
- .centerdiv > * {
241
- pointer-events: all !important;
242
- }
243
-
244
- .mainContainer {
245
- z-index: var(--layout-centermain-zindex);
246
- }
247
-
248
- .backContainer {
249
- z-index: var(--layout-centerback-zindex);
250
- }
251
-
252
- .centerFrontContainer {
253
- z-index: var(--layout-centerfront-zindex);
254
- }
255
-
256
133
  .iconify {
257
134
  color: #000;
258
135
  }
@@ -405,4 +282,127 @@
405
282
 
406
283
  .cursor-s-resize {
407
284
  cursor: s-resize;
285
+ }
286
+
287
+ .adivider {
288
+ width: 100%;
289
+ margin: 10px 0;
290
+ display: flex;
291
+ align-items: center;
292
+ justify-items: center;
293
+ }
294
+
295
+ .adivider .line {
296
+ border: v-bind(lineColor) 1px solid;
297
+ }
298
+
299
+ .adivider .contentText {
300
+ background-color: inherit;
301
+ font-size: 18px;
302
+ }
303
+
304
+ .layoutContainer {
305
+ position: relative;
306
+ width: 100%;
307
+ height: 100%;
308
+ padding: 0;
309
+ margin: 0;
310
+ --layout-top-height: 70px;
311
+ --layout-left-width: 200px;
312
+ --layout-right-width: 200px;
313
+ --layout-bottom-height: 60px;
314
+ --layout-top-zindex: 100;
315
+ --layout-bottom-zindex: 100;
316
+ --layout-centermain-zindex: 80;
317
+ --layout-centerback-zindex: 90;
318
+ --layout-centerfront-zindex: 110;
319
+ --layout-left-zindex: 100;
320
+ --layout-right-zindex: 100;
321
+ }
322
+
323
+ .topContainer {
324
+ position: absolute;
325
+ top: 0px;
326
+ left: 0px;
327
+ width: 100%;
328
+ height: var(--layout-top-height);
329
+ z-index: var(--layout-top-zindex);
330
+ overflow: hidden;
331
+ pointer-events: none;
332
+ }
333
+
334
+ .topContainer > * {
335
+ pointer-events: all !important;
336
+ }
337
+
338
+ .bottomContainer {
339
+ position: absolute;
340
+ bottom: 0px;
341
+ left: 0px;
342
+ width: 100%;
343
+ height: var(--layout-bottom-height);
344
+ z-index: var(--layout-bottom-zindex);
345
+ overflow: hidden;
346
+ pointer-events: none;
347
+ }
348
+
349
+ .bottomContainer > * {
350
+ pointer-events: all !important;
351
+ }
352
+
353
+ .leftContainer {
354
+ position: absolute;
355
+ top: 0px;
356
+ left: 0px;
357
+ bottom: 0;
358
+ z-index: var(--layout-left-zindex);
359
+ width: var(--layout-left-width);
360
+ overflow: hidden;
361
+ pointer-events: none;
362
+ }
363
+
364
+ .leftContainer > * {
365
+ pointer-events: all !important;
366
+ }
367
+
368
+ .rightContainer {
369
+ position: absolute;
370
+ top: 0px;
371
+ right: 0px;
372
+ bottom: 0;
373
+ width: var(--layout-right-width);
374
+ z-index: var(--layout-right-zindex);
375
+ overflow: hidden;
376
+ pointer-events: none;
377
+ }
378
+
379
+ .rightContainer > * {
380
+ pointer-events: all !important;
381
+ }
382
+
383
+ .centerdiv {
384
+ position: absolute;
385
+ top: 0;
386
+ left: 0;
387
+ bottom: 0;
388
+ width: 100%;
389
+ background-color: transparent;
390
+ overflow: hidden;
391
+ pointer-events: none;
392
+ }
393
+
394
+ .centerdiv > * {
395
+ pointer-events: all !important;
396
+ }
397
+
398
+ .mainContainer {
399
+ z-index: var(--layout-centermain-zindex);
400
+ }
401
+
402
+ .backContainer {
403
+ z-index: var(--layout-centerback-zindex);
404
+ }
405
+
406
+ .centerFrontContainer {
407
+ z-index: var(--layout-centerfront-zindex);
408
408
  }