@vxe-ui/core 4.5.8 → 4.5.10
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/all.esm.js +13 -13
- package/dist/all.esm.min.js +1 -1
- package/es/src/core.js +1 -1
- package/es/src/log.js +1 -1
- package/es/src/popper-utils.js +11 -11
- package/lib/index.umd.js +13 -13
- package/lib/index.umd.min.js +1 -1
- package/lib/src/core.js +1 -1
- package/lib/src/log.js +1 -1
- package/lib/src/popper-utils.js +11 -11
- package/package.json +4 -19
- package/packages/src/popper-utils.ts +16 -16
package/dist/all.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
|
|
5
5
|
// packages_temp/src/core.ts
|
|
6
|
-
var coreVersion = "4.5.
|
|
6
|
+
var coreVersion = "4.5.10";
|
|
7
7
|
var VxeCore = {
|
|
8
8
|
coreVersion,
|
|
9
9
|
uiVersion: "",
|
|
@@ -396,7 +396,7 @@ function createLog(type, name) {
|
|
|
396
396
|
return msg;
|
|
397
397
|
};
|
|
398
398
|
}
|
|
399
|
-
var version = "4.5.
|
|
399
|
+
var version = "4.5.10";
|
|
400
400
|
var log = {
|
|
401
401
|
create: createLog,
|
|
402
402
|
warn: createLog("warn", `v${version}`),
|
|
@@ -1258,7 +1258,7 @@ var popperUtils = {
|
|
|
1258
1258
|
let arrowLeft = "";
|
|
1259
1259
|
const stys = {};
|
|
1260
1260
|
if (panelElem && targetElem) {
|
|
1261
|
-
const
|
|
1261
|
+
const domEl = document.documentElement;
|
|
1262
1262
|
const parentWrapperEl = getWrapperElement(teleportTo ? getAppendElement(appendTo) : panelElem);
|
|
1263
1263
|
if (parentWrapperEl) {
|
|
1264
1264
|
const targetWidth = targetElem.offsetWidth;
|
|
@@ -1268,8 +1268,8 @@ var popperUtils = {
|
|
|
1268
1268
|
const parentWrapperRect = parentWrapperEl.getBoundingClientRect();
|
|
1269
1269
|
const panelRect = panelElem.getBoundingClientRect();
|
|
1270
1270
|
const targetRect = targetElem.getBoundingClientRect();
|
|
1271
|
-
const visibleHeight =
|
|
1272
|
-
const visibleWidth =
|
|
1271
|
+
const visibleHeight = domEl.clientHeight;
|
|
1272
|
+
const visibleWidth = domEl.clientWidth;
|
|
1273
1273
|
const parentWrapperScrollLeft = parentWrapperEl.scrollLeft;
|
|
1274
1274
|
const parentWrapperScrollTop = parentWrapperEl.scrollTop;
|
|
1275
1275
|
const parentWrapperOffsetLeft = parentWrapperRect.left;
|
|
@@ -1289,22 +1289,22 @@ var popperUtils = {
|
|
|
1289
1289
|
if (!defaultTop) {
|
|
1290
1290
|
top = targetTop - panelHeight;
|
|
1291
1291
|
}
|
|
1292
|
-
if (top < marginSize) {
|
|
1292
|
+
if (top < marginSize - parentWrapperScrollTop) {
|
|
1293
1293
|
panelPlacement = "bottom";
|
|
1294
|
-
top = targetTop + targetHeight;
|
|
1294
|
+
top = targetTop + targetHeight - parentWrapperScrollTop;
|
|
1295
1295
|
}
|
|
1296
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
1296
|
+
if (top + panelHeight + marginSize > visibleHeight - parentWrapperScrollTop) {
|
|
1297
1297
|
panelPlacement = "top";
|
|
1298
|
-
top = targetTop - panelHeight;
|
|
1298
|
+
top = targetTop - panelHeight - parentWrapperScrollTop;
|
|
1299
1299
|
}
|
|
1300
1300
|
} else {
|
|
1301
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
1301
|
+
if (top + panelHeight + marginSize > visibleHeight - parentWrapperScrollTop) {
|
|
1302
1302
|
panelPlacement = "top";
|
|
1303
|
-
top = targetTop - panelHeight;
|
|
1303
|
+
top = targetTop - panelHeight - parentWrapperScrollTop;
|
|
1304
1304
|
}
|
|
1305
|
-
if (top < marginSize) {
|
|
1305
|
+
if (top < marginSize - parentWrapperScrollTop) {
|
|
1306
1306
|
panelPlacement = "bottom";
|
|
1307
|
-
top = targetTop + targetHeight;
|
|
1307
|
+
top = targetTop + targetHeight - parentWrapperScrollTop;
|
|
1308
1308
|
}
|
|
1309
1309
|
}
|
|
1310
1310
|
}
|
package/dist/all.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ke=Object.defineProperty,Be=(t,e,r)=>e in t?ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,v=(t,e,r)=>Be(t,typeof e!="symbol"?e+"":e,r),Ot="4.5.8",I={coreVersion:Ot,uiVersion:"",tableVersion:"",designVersion:"",ganttVersion:""};import{createCommentVNode as Xe}from"vue";import Pt from"xe-utils";import He from"dom-zindex";var N={size:"",version:1,zIndex:999,resizeInterval:500},Dt={theme:""};function G(t){const e=!t||t==="default"?"light":t;if(Dt.theme=e,typeof document!="undefined"){const r=document.documentElement;r&&r.setAttribute("data-vxe-ui-theme",e)}return I}function It(){return Dt.theme}function Ct(t){return t&&(t.zIndex&&He.setCurrent(t.zIndex),t.theme&&G(t.theme),Pt.merge(N,t)),I}function Wt(t,e){return arguments.length?Pt.get(N,t,e):N}var Nt={};import{h as Lt}from"vue";import Rt from"xe-utils";var ct={};import Ae from"xe-utils";function lt(t){return Ae.isArray(t)?t:t?[t]:[]}function kt(t){return t&&Object.assign(ct,t),I}function at(t){return arguments.length?Rt.get(ct,t):ct}function Bt(t){const e=at(t);return ut(e,t)}function ut(t,e){return Rt.isFunction(t)?Lt("span",{},lt(t({name:e}))):Lt("i",{class:t})}import _ from"xe-utils";var C={F2:"F2",F10:"F10",TAB:"Tab",ESCAPE:"Escape",ENTER:"Enter",DELETE:"Delete",BACKSPACE:"Backspace",SPACEBAR:" ",CONTEXT_MENU:"ContextMenu",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",HOME:"Home",END:"End",PROCESS:"Process",A:"A",X:"X",C:"C",V:"V",D:"D",F:"F",H:"H",M:"M",Y:"Y",Z:"Z",R:"R",P:"P"},ht=_.browse(),Xt={" ":"Spacebar",Apps:C.CONTEXT_MENU,Del:C.DELETE,Up:C.ARROW_UP,Down:C.ARROW_DOWN,Left:C.ARROW_LEFT,Right:C.ARROW_RIGHT},Ht=ht.firefox?"DOMMouseScroll":"mousewheel",ft=[];function T(t){const e=t.type===Ht;ft.forEach(({type:r,cb:n})=>{t.cancelBubble||(r===t.type||e&&r==="mousewheel")&&n(t)})}var At=class{constructor(t,e,r){v(this,"$event"),v(this,"type",""),v(this,"key",""),v(this,"code",""),this.$event=t,t&&(t.type&&(this.type=t.type),t.key&&(this.key=t.key),t.code&&(this.code=t.code)),Object.assign(this,e),_.objectEach(r,(n,o)=>{if(_.isFunction(n)){let s=null,c=!1;Object.defineProperty(this,o,{get(){return c||(c=!0,s=n()),s}})}else this[o]=n})}stopPropagation(){const t=this.$event;t&&t.stopPropagation()}preventDefault(){const t=this.$event;t&&t.preventDefault()}},_t=(t,e,r)=>(t instanceof At&&(t=t.$event),new At(t,e,r)),Mt={on(t,e,r){ft.push({comp:t,type:e,cb:r})},off(t,e){_.remove(ft,r=>r.comp===t&&r.type===e)},hasKey(t,e){if(!e)return!1;const{key:r}=t;return e=e.toLowerCase(),r?e===r.toLowerCase()||!!(Xt[r]&&Xt[r].toLowerCase()===e):!1},hasControlKey(t){return t.ctrlKey||t.metaKey}};ht.isDoc&&(ht.msie||(window.addEventListener("copy",T,!1),window.addEventListener("cut",T,!1),window.addEventListener("paste",T,!1)),document.addEventListener("scroll",T,!0),document.addEventListener("keydown",T,!1),document.addEventListener("contextmenu",T,!1),window.addEventListener("mousedown",T,!1),window.addEventListener("click",T,!1),window.addEventListener("blur",T,!1),window.addEventListener("resize",T,!1),window.addEventListener(Ht,_.throttle(T,100,{leading:!0,trailing:!1}),{passive:!0,capture:!1}));import Ut from"xe-utils";var Vt,L=[],_e=500;function Me(){L.length&&(L.forEach(t=>{t.tarList.forEach(e=>{const{target:r,width:n,heighe:o}=e,s=r.clientWidth,c=r.clientHeight;(s&&n!==s||c&&o!==c)&&(e.width=s,e.heighe=c,setTimeout(t.callback))})}),jt())}function jt(){clearTimeout(Vt),Vt=setTimeout(Me,N.resizeInterval||_e)}var Ue=class{constructor(t){v(this,"tarList",[]),v(this,"callback"),this.callback=t}observe(t){if(t){const{tarList:e}=this;e.some(r=>r.target===t)||e.push({target:t,width:t.clientWidth,heighe:t.clientHeight}),L.length||jt(),L.some(r=>r===this)||L.push(this)}}unobserve(t){Ut.remove(L,e=>e.tarList.some(r=>r.target===t))}disconnect(){Ut.remove(L,t=>t===this)}},Ft={create(t){return window.ResizeObserver?new window.ResizeObserver(t):new Ue(t)}};import zt from"xe-utils";import{reactive as Ve}from"vue";var k=Ve({language:"",langMaps:{}}),Yt=!1,Z={};function je(t){return t&&t.__esModule?t.default:t}function mt(t,e){const{langMaps:r,language:n}=k,{i18n:o}=N;if(o)return`${o(t,e)||""}`;if(Yt||(r[n]||console.error(`[vxe core] 语言包未安装。Language not installed. https://${I.uiVersion?"vxeui.com":"vxetable.cn"}/#/start/i18n`),Yt=!0),!e&&Z[t])return Z[t];const s=zt.toFormatString(zt.get(r[n],t,t),e);return e||(Z[t]=s),s}function $t(t){const{language:e}=k,r=t||"zh-CN";return e!==r&&(k.language=r,Z={}),I}function qt(t,e){return k.langMaps[t]=Object.assign({},je(e)),I}function Kt(t){const{langMaps:e}=k;return!!e[t]}function Gt(){const{language:t}=k;return t}import J from"xe-utils";function dt(t,e){return function(r,n){const o=`[vxe ${e||""}] ${mt(r,n)}`;return console[t](o),o}}var Zt="4.5.8",y={create:dt,warn:dt("warn",`v${Zt}`),err:dt("error",`v${Zt}`)},M={},R={mixin(t){return J.each(t,(e,r)=>{R.add(r,e)}),R},get(t){return M[t]||null},add(t,e){if(t&&e){const r=M[t];r?(J.each(e,(n,o)=>{!J.eqNull(r[o])&&r[o]!==n&&y.warn("vxe.error.coverProp",[`Renderer.${t}`,o])}),Object.assign(r,e)):M[t]=e}return R},forEach(t){return J.objectEach(M,t),R},delete(t){return delete M[t],R}};import U from"xe-utils";var Fe=class{constructor(){v(this,"store",{})}mixin(t){return U.each(t,(e,r)=>{this.add(r,e)}),this}has(t){return!!this.get(t)}get(t){return this.store[t]}add(t,e){const r=this.store[t],n=U.keys(r);return U.each(e,(o,s)=>{n.includes(s)&&y.warn("vxe.error.coverProp",[t,s])}),this.store[t]=r?U.merge(r,e):e,this}delete(t){delete this.store[t]}forEach(t){U.objectEach(this.store,t)}},Jt=Fe,gt=new Jt;Object.assign(gt,{_name:"Validators"});import B from"xe-utils";var ze=class{constructor(){v(this,"store",{})}mixin(t){return B.each(t,(e,r)=>{this.add(r,e)}),this}has(t){return!!this.get(t)}get(t){return this.store[t]}add(t,e){const r=this.store[t];B.isFunction(e)&&(y.warn("vxe.error.delProp",["menus -> callback","menuMethod"]),e={menuMethod:e});const n=B.keys(r);return B.each(e,(o,s)=>{n.includes(s)&&y.warn("vxe.error.coverProp",[t,s])}),this.store[t]=r?B.merge(r,e):e,this}delete(t){delete this.store[t]}forEach(t){B.objectEach(this.store,t)}},pt=new ze;Object.assign(pt,{_name:"Menus"});import X from"xe-utils";var Ye=class{constructor(){v(this,"store",{})}mixin(t){return X.each(t,(e,r)=>{this.add(r,e)}),this}has(t){return!!this.get(t)}get(t){return this.store[t]}add(t,e){const r=this.store[t];X.isFunction(e)&&(y.warn("vxe.error.delProp",["formats -> callback","cellFormatMethod"]),e={cellFormatMethod:e});const n=X.keys(r);return X.each(e,(o,s)=>{n.includes(s)&&y.warn("vxe.error.coverProp",[t,s])}),this.store[t]=r?X.merge(r,e):e,this}delete(t){delete this.store[t]}forEach(t){X.objectEach(this.store,t)}},bt=new Ye;Object.assign(bt,{_name:"Formats"});import H from"xe-utils";var $e=class{constructor(){v(this,"store",{})}mixin(t){return H.each(t,(e,r)=>{this.add(r,e)}),this}has(t){return!!this.get(t)}get(t){return this.store[t]}add(t,e){const r=this.store[t];H.isFunction(e)&&(y.warn("vxe.error.delProp",["commands -> callback","commandMethod"]),e={commandMethod:e});const n=H.keys(r);return H.each(e,(o,s)=>{n.includes(s)&&y.warn("vxe.error.coverProp",[t,s])}),this.store[t]=r?H.merge(r,e):e,this}delete(t){delete this.store[t]}forEach(t){H.objectEach(this.store,t)}},vt=new $e;Object.assign(vt,{_name:"Commands"});import Q from"xe-utils";var V={},j={mixin(t){return Q.each(t,(e,r)=>{j.add(r,e)}),j},get(t){return t?V[t]||[]:[]},add(t,e){Q.isFunction(e)&&(e={tableInterceptorMethod:e});const r=e.tableInterceptorMethod;if(r){let n=V[t];n||(n=V[t]=[]),n.indexOf(r)>-1&&y.warn("vxe.error.coverProp",["Interceptor",t]),n.push(r)}return j},delete(t,e){const r=V[t];if(r){Q.isFunction(e)&&(e={tableInterceptorMethod:e});const n=e?e.tableInterceptorMethod:null;n?Q.remove(r,o=>o===n):delete V[t]}}};import qe from"xe-utils";var O,F={text:"",html:""};function Ke(t){if(!O){O=document.createElement("textarea"),O.id="$VxeCopy";const e=O.style;e.width="48px",e.height="24px",e.position="fixed",e.zIndex="0",e.left="-500px",e.top="-500px",document.body.appendChild(O)}O.value=t}var Qt={getStore(){return F},setStore(t){Object.assign(F,t||{})},copy(t){let e=!1;try{const r=qe.toValueString(t);Ke(r),O.select(),O.setSelectionRange(0,O.value.length),e=document.execCommand("copy"),O.blur(),F.text=r,F.html=""}catch(r){}return e},getText(){return F.text||""}};import Ge from"xe-utils";function z(t,e){let r=!0,n=!1;const o=e||N.permissionMethod;if(t&&o){r=!1,n=!0;let c=!1,E=!1;const S=String(t).split("|");for(let b=0;b<S.length;b++){const Y=S[b];let w=!0,h=!1;const x=o({code:Y});if(Ge.isBoolean(x)?w=x:x&&(w=!!x.visible,h=!!x.disabled),!h&&!E&&(E=!0,n=h),w&&!c&&(c=!0,r=w),c&&E)break}}return{code:t,visible:r,disabled:n}}var te={getCheckInfo(t){return z(t)},checkVisible(t){return z(t).visible},checkDisable(t){return z(t).disabled}};import tt from"dom-zindex";var ee={next(){return tt.getNext()},getLast(){return tt.getCurrent()},nextSub(){return tt.getSubNext()},getSubLast(){return tt.getSubCurrent()}};import re from"xe-utils";var ne={getStrVal(t){return re.eqNull(t)?"":""+t},isEmptyVal(t){return t==null||t===""},getDefVal(t,e){return re.eqNull(t)?e:t},isEnabled(t){return!!(t&&t.enabled!==!1)},hasEnableConf(t,e){return!!(e&&(t?e.enabled!==!1:e.enabled))}};import et from"xe-utils";var Ze=class{constructor(t,e){v(this,"storeName","vxe_storage"),v(this,"key"),v(this,"version"),v(this,"dbPromise",null),v(this,"dbName",""),this.key=t,this.version=e}getDBName(){return`${this.key}_${this.version}`}resetDB(){this.dbPromise=null,this.dbName=""}openDB(){const t=this.getDBName();return this.dbPromise&&this.dbName===t?this.dbPromise:(this.dbName=t,this.dbPromise=new Promise((e,r)=>{const n=indexedDB.open(t,1);n.onupgradeneeded=()=>{const o=n.result;o.objectStoreNames.contains(this.storeName)||o.createObjectStore(this.storeName,{keyPath:"id"})},n.onsuccess=()=>{const o=n.result;o.onversionchange=()=>{o.close(),this.resetDB()},o.onclose=()=>{this.resetDB()},e(o)},n.onerror=()=>{r(n.error||new Error(`IdbStore open failed: ${t}`))},n.onblocked=()=>{console.warn(`[IdbStore] open blocked: ${t}`)}}).catch(e=>{throw this.resetDB(),e}),this.dbPromise)}getById(t){return this.openDB().then(e=>new Promise((r,n)=>{const o=e.transaction(this.storeName,"readonly").objectStore(this.storeName).get(t);o.onsuccess=()=>r(o.result),o.onerror=()=>n(o.error)}))}getAll(){return this.openDB().then(t=>new Promise((e,r)=>{const n=t.transaction(this.storeName,"readonly").objectStore(this.storeName);if(et.isFunction(n.getAll)){const c=n.getAll();c.onsuccess=()=>e(c.result||[]),c.onerror=()=>r(c.error);return}const o=[],s=n.openCursor();s.onsuccess=()=>{const c=s.result;c?(o.push(c.value),c.continue()):e(o)},s.onerror=()=>r(s.error)}))}updateById(t,e){return e==null?this.deleteById(t):this.openDB().then(r=>new Promise((n,o)=>{const s=r.transaction(this.storeName,"readwrite");s.objectStore(this.storeName).put({id:t,data:e}),s.oncomplete=()=>n(),s.onerror=()=>o(s.error)}))}deleteById(t){return this.openDB().then(e=>new Promise((r,n)=>{const o=e.transaction(this.storeName,"readwrite");o.objectStore(this.storeName).delete(t),o.oncomplete=()=>r(),o.onerror=()=>n(o.error)}))}clear(){return this.openDB().then(t=>new Promise((e,r)=>{const n=t.transaction(this.storeName,"readwrite");n.objectStore(this.storeName).clear(),n.oncomplete=()=>e(),n.onerror=()=>r(n.error)}))}cleanupOldDBs(){if(!indexedDB.databases)return Promise.resolve();const t=this.getDBName(),e=`${this.key}_`;return indexedDB.databases().then(r=>{r.forEach(n=>{const o=n.name;if(!o||o===t||!o.startsWith(e))return;o.slice(e.length).includes("_")||indexedDB.deleteDatabase(o)})})}},Je=class{constructor(t,e){v(this,"key"),v(this,"version"),this.key=t,this.version=e}readAll(){const t=et.toStringJSON(localStorage.getItem(this.key)||"");return t&&String(t._v)===String(this.version)?t:{_v:this.version}}writeAll(t){localStorage.setItem(this.key,et.toJSONString(t))}getById(t){const e=this.readAll(),r=Object.prototype.hasOwnProperty.call(e,t);return Promise.resolve(r&&e[t]!=null?{id:t,data:e[t]}:void 0)}getAll(){const t=this.readAll(),e=[];return Object.keys(t).forEach(r=>{r!=="_v"&&t[r]!=null&&e.push({id:r,data:t[r]})}),Promise.resolve(e)}updateById(t,e){if(e==null)return this.deleteById(t);const r=this.readAll();return r[t]=e,this.writeAll(r),Promise.resolve()}deleteById(t){const e=this.readAll();return delete e[t],this.writeAll(e),Promise.resolve()}clear(){return this.writeAll({_v:this.version}),Promise.resolve()}cleanupOldDBs(){const t=localStorage.getItem(this.key);if(!t)return Promise.resolve();const e=et.toStringJSON(t);return(!e||String(e._v)!==String(this.version))&&localStorage.removeItem(this.key),Promise.resolve()}},oe={createStore(t,e){const r=Object.assign({},e),n=r.version||N.version||0,o=r.driver;return(!o||o==="indexedDB")&&typeof indexedDB!="undefined"?new Ze(t,n):new Je(t,n)}};import Qe from"xe-utils";var Et={};function se(t){return Et[t]||(Et[t]=new RegExp(`(?:^|\\s)${t}(?!\\S)`,"g")),Et[t]}function wt(t,e){return t?t.classList?t.classList.contains(e):!!(t.className&&t.className.match&&t.className.match(se(e))):!1}function ie(t,e){t&&wt(t,e)&&(t.className=t.className.replace(se(e),""))}var ce={isPx(t){return t&&/^\d+(\.\d+)?(px)?$/.test(t)},isScale(t){return t&&/^\d+(\.\d+)?%$/.test(t)},hasClass:wt,removeClass:ie,addClass(t,e){t&&!wt(t,e)&&(ie(t,e),t.className=t.className+" "+e)},buildClass(t,e){const r=[];if(t)for(let n=0;n<t.length;n++){const o=t[n];o&&r.push(""+o)}return Qe.each(e,(n,o)=>{n&&r.push(o)}),r.join(" ")}},St={getThumbSize(t,e,r){if(e<=t)return 0;const n=t/e,o=r*n;return Math.max(20,Math.min(o,r))},getThumbOffsetSize(t,e,r,n,o){const s=r-e;if(s<=0)return 0;const c=n-o;return c<=0?0:Math.min(Math.max(t,0),s)/s*c},getScrollFromClick(t,e,r,n,o){const s=n-o,c=r-e;if(c<=0||s<=0)return 0;let E=t-o/2;return E=Math.min(Math.max(E,0),s),E/s*c},getScrollFromDrag(t,e,r,n,o,s){const c=n-r,E=o-s;if(c<=0||E<=0)return 0;let S=t-e;return S=Math.min(Math.max(S,0),E),S/E*c}};import A from"xe-utils";function le(t){if(!t)return null;const e=document.body,r=t.parentElement;return(r===e?document.documentElement:r)||null}function ae(t){return(t&&A.isFunction(t)?t({}):t)||"body"}function ue(t){const e=ae(t);return A.isString(e)?document.querySelector(e)||document.body:e}var he={updatePlacement(t,e,r){const{defaultTop:n,defaultLeft:o,placement:s,defaultPlacement:c,appendTo:E,teleportTo:S,marginSize:b,isMinWidth:Y}=Object.assign({appendTo:"",teleportTo:!1,marginSize:12,isMinWidth:!0},r);let w="bottom",h="",x="",g=0,$="",i="";const u={};if(e&&t){const l=document.body,f=le(S?ue(E):e);if(f){const a=t.offsetWidth,m=t.offsetHeight,p=e.offsetWidth,d=e.offsetHeight,P=f.getBoundingClientRect(),q=e.getBoundingClientRect(),yt=t.getBoundingClientRect(),it=l.clientHeight,K=l.clientWidth,We=f.scrollLeft,Ne=f.scrollTop,Le=P.left,Re=P.top,W=yt.left,D=yt.top;$=t.offsetWidth,S?(g=(o||W-(p-a)/2)-We,h=(n||D+m)-Ne,s==="top"?(w="top",h=D-d):s||(c==="top"?(w="top",n||(h=D-d),h<b&&(w="bottom",h=D+m),h+d+b>it&&(w="top",h=D-d)):(h+d+b>it&&(w="top",h=D-d),h<b&&(w="bottom",h=D+m))),g+p+b>K&&(g-=g+p+b-K),g<b&&(g=b),h-=Re,g-=Le):(s==="top"?(w="top",x=m):s||(h=m,D+m+d+b>it&&D-m-d>b&&(w="top",h="",x=m)),q.left+q.width+b>K&&(g=-(q.left+q.width+b-K))),A.isNumber(h)&&(u.top=h+"px"),A.isNumber(x)&&(u.bottom=x+"px"),A.isNumber(g)&&(u.left=g+"px"),Y&&A.isNumber($)&&(u.minWidth=$+"px"),g===W?a<=p&&(i=a/2):g<W&&(g+p>W+a?i=W-g+a/2:i=W-g+(p-(W-g))/2)}}return{top:h||0,bottom:x||0,left:g||0,arrowLeft:i||0,style:u,placement:w}},getWrapperElement:le,getAppendSelector:ae,getAppendElement:ue},fe=new Jt;import tr from"xe-utils";import{computed as xt,ref as rt,inject as me,provide as de}from"vue";var{getThumbOffsetSize:nt,getThumbSize:ge,getScrollFromClick:pe,getScrollFromDrag:be}=St;function ve(t){const e=me("xeSizeInfo",null),r=xt(()=>{const{size:n}=t;return n||(e?e.value:null)});return de("xeSizeInfo",r),{computeSize:r}}function Ee(t){return{computePermissionInfo:xt(()=>z(t.permissionCode,t.permissionMethod))}}function we(t){const e=me("xeScrollbarInfo",null),r=xt(()=>{const{useScrollbar:n}=t;return tr.isBoolean(n)?n:e?e.value:null});return de("xeScrollbarInfo",r),{computeIsVScrollbar:r}}var Se=t=>{const{reactData:e,internalData:r}=t,n=rt(),o=rt(),s=rt(),c=rt();return{refTrackXElem:n,refTrackYElem:o,refThumbXElem:s,refThumbYElem:c,updateThumbSize:()=>{const i=t.getScrollViewElem();if(!i||!i.clientHeight||!i.clientHeight)return;const u=n.value,l=u?ge(i.clientWidth,i.scrollWidth,u.clientWidth):0,f=s.value;f&&(f.style.width=l+"px"),e.xThumbWidth=l;const a=o.value,m=a?ge(i.clientHeight,i.scrollHeight,a.clientHeight):0,p=c.value;p&&(p.style.height=m+"px"),e.yThumbHeight=m},updateThumbOffset:()=>{const i=t.getScrollViewElem();if(!i||!i.clientHeight||!i.clientHeight)return;const{xThumbWidth:u,yThumbHeight:l}=e,f=n.value,a=s.value,m=f&&u?nt(i.scrollLeft,i.clientWidth,i.scrollWidth,f.clientWidth,u):0;r.xThumbLeft=m,a&&u&&(a.style.width=u+"px",a.style.transform=`translateX(${m}px)`);const p=o.value,d=c.value,P=p&&l?nt(i.scrollTop,i.clientHeight,i.scrollHeight,p.clientHeight,l):0;r.yThumbTop=P,d&&l&&(d.style.height=l+"px",d.style.transform=`translateY(${P}px)`)},clickTrackXEvent:i=>{const u=i.currentTarget;if(u!==i.target)return;const l=t.getScrollViewElem();if(!l)return;const{xThumbWidth:f}=e,a=u.getBoundingClientRect();l.scrollTo({left:pe(i.clientX-a.left,l.clientWidth,l.scrollWidth,u.clientWidth,f),behavior:"auto"})},clickTrackYEvent:i=>{const u=i.currentTarget;if(u!==i.target)return;const l=t.getScrollViewElem();if(!l)return;const{yThumbHeight:f}=e,a=u.getBoundingClientRect();l.scrollTo({top:pe(i.clientY-a.top,l.clientHeight,l.scrollHeight,u.clientHeight,f),behavior:"auto"})},pointerdownThumbXEvent:i=>{const u=i.currentTarget;r.isThumbDrag=!0,u.setPointerCapture(i.pointerId);const l=t.getScrollViewElem();if(!l)return;const{xThumbWidth:f}=e,a=u.parentElement,m=a.getBoundingClientRect(),p=i.clientX-m.left,d=nt(l.scrollLeft,l.clientWidth,l.scrollWidth,a.clientWidth,f);r.thumbDragOffset=p-d},pointermoveThumbXEvent:i=>{if(!i.currentTarget.hasPointerCapture(i.pointerId))return;const{isThumbDrag:l,thumbDragOffset:f}=r;if(l){const a=t.getScrollViewElem();if(!a)return;const{xThumbWidth:m}=e,d=i.currentTarget.parentElement,P=d.getBoundingClientRect();a.scrollLeft=be(i.clientX-P.left,f,a.clientWidth,a.scrollWidth,d.clientWidth,m)}},cleatPointerThumbEvent:i=>{i.currentTarget.releasePointerCapture(i.pointerId),r.isThumbDrag=!1},pointerdownThumbYEvent:i=>{const u=i.currentTarget;r.isThumbDrag=!0,u.setPointerCapture(i.pointerId);const l=t.getScrollViewElem();if(!l)return;const{yThumbHeight:f}=e,a=u.parentElement,m=a.getBoundingClientRect(),p=i.clientY-m.top,d=nt(l.scrollTop,l.clientHeight,l.scrollHeight,a.clientHeight,f);r.thumbDragOffset=p-d},pointermoveThumbYEvent:i=>{if(!i.currentTarget.hasPointerCapture(i.pointerId))return;const{isThumbDrag:l,thumbDragOffset:f}=r;if(l){const a=t.getScrollViewElem();if(!a)return;const{yThumbHeight:m}=e,d=i.currentTarget.parentElement,P=d.getBoundingClientRect();a.scrollTop=be(i.clientY-P.top,f,a.clientHeight,a.scrollHeight,d.clientHeight,m)}}}},xe={useSize:ve,useVScrollbar:we,usePermission:Ee,useInitVScrollbar:Se};import Tt from"xe-utils";var Te=[];function ye(t,e){return t&&t.install&&Te.indexOf(t)===-1&&(t.install(st,e),Te.push(t)),st}var ot={};function Oe(t){return ot[t]||null}function Pe(t){return!!ot[t]}function De(t){t&&t.name&&(ot[t.name]=t,ot[Tt.kebabCase(t.name)]=t)}function Ie(){return Xe()}function Ce(t,e,r){if(t){const n=`${t}`.match(/(\d+).(\d+).(\d+)/);if(n){const o=Tt.toNumber(n[1]);if(r){const s=Tt.toNumber(n[2]);return o>=e&&s>=r}return o>=e}}return!1}var st=Object.assign(I,{renderEmptyElement:Ie,setTheme:G,getTheme:It,setConfig:Ct,getConfig:Wt,setIcon:kt,getIcon:at,renderGlobalIcon:Bt,renderCustomIcon:ut,setLanguage:$t,hasLanguage:Kt,getLanguage:Gt,setI18n:qt,getI18n:mt,globalEvents:Mt,GLOBAL_EVENT_KEYS:C,createEvent:_t,globalResize:Ft,renderer:R,validators:gt,menus:pt,formats:bt,commands:vt,interceptor:j,clipboard:Qt,log:y,permission:te,zIndex:ee,baseUtils:ne,dbUtils:oe,domUtils:ce,scrollbarUtils:St,popperUtils:he,globalStore:Nt,hooks:fe,component:De,getComponent:Oe,hasComponent:Pe,useFns:xe,getSlotVNs:lt,checkVersion:Ce,use:ye});G();var er=st;export{C as GLOBAL_EVENT_KEYS,I as VxeCore,st as VxeUI,ne as baseUtils,Ce as checkVersion,Qt as clipboard,vt as commands,De as component,Ot as coreVersion,_t as createEvent,oe as dbUtils,er as default,ce as domUtils,bt as formats,Oe as getComponent,Wt as getConfig,mt as getI18n,at as getIcon,Gt as getLanguage,lt as getSlotVNs,It as getTheme,Mt as globalEvents,Ft as globalResize,Nt as globalStore,z as handleCheckInfo,Pe as hasComponent,Kt as hasLanguage,fe as hooks,j as interceptor,y as log,pt as menus,te as permission,he as popperUtils,ut as renderCustomIcon,Ie as renderEmptyElement,Bt as renderGlobalIcon,R as renderer,St as scrollbarUtils,Ct as setConfig,qt as setI18n,kt as setIcon,$t as setLanguage,G as setTheme,ye as use,xe as useFns,Se as useInitVScrollbar,Ee as usePermission,ve as useSize,we as useVScrollbar,gt as validators,ee as zIndex};
|
|
1
|
+
var ke=Object.defineProperty,Be=(t,e,r)=>e in t?ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,v=(t,e,r)=>Be(t,typeof e!="symbol"?e+"":e,r),yt="4.5.10",C={coreVersion:yt,uiVersion:"",tableVersion:"",designVersion:"",ganttVersion:""};import{createCommentVNode as Xe}from"vue";import Dt from"xe-utils";import He from"dom-zindex";var L={size:"",version:1,zIndex:999,resizeInterval:500},It={theme:""};function Z(t){const e=!t||t==="default"?"light":t;if(It.theme=e,typeof document!="undefined"){const r=document.documentElement;r&&r.setAttribute("data-vxe-ui-theme",e)}return C}function Ct(){return It.theme}function Wt(t){return t&&(t.zIndex&&He.setCurrent(t.zIndex),t.theme&&Z(t.theme),Dt.merge(L,t)),C}function Nt(t,e){return arguments.length?Dt.get(L,t,e):L}var Lt={};import{h as Rt}from"vue";import kt from"xe-utils";var lt={};import Ae from"xe-utils";function at(t){return Ae.isArray(t)?t:t?[t]:[]}function Bt(t){return t&&Object.assign(lt,t),C}function ut(t){return arguments.length?kt.get(lt,t):lt}function Xt(t){const e=ut(t);return ht(e,t)}function ht(t,e){return kt.isFunction(t)?Rt("span",{},at(t({name:e}))):Rt("i",{class:t})}import M from"xe-utils";var W={F2:"F2",F10:"F10",TAB:"Tab",ESCAPE:"Escape",ENTER:"Enter",DELETE:"Delete",BACKSPACE:"Backspace",SPACEBAR:" ",CONTEXT_MENU:"ContextMenu",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",HOME:"Home",END:"End",PROCESS:"Process",A:"A",X:"X",C:"C",V:"V",D:"D",F:"F",H:"H",M:"M",Y:"Y",Z:"Z",R:"R",P:"P"},ft=M.browse(),Ht={" ":"Spacebar",Apps:W.CONTEXT_MENU,Del:W.DELETE,Up:W.ARROW_UP,Down:W.ARROW_DOWN,Left:W.ARROW_LEFT,Right:W.ARROW_RIGHT},At=ft.firefox?"DOMMouseScroll":"mousewheel",mt=[];function T(t){const e=t.type===At;mt.forEach(({type:r,cb:n})=>{t.cancelBubble||(r===t.type||e&&r==="mousewheel")&&n(t)})}var _t=class{constructor(t,e,r){v(this,"$event"),v(this,"type",""),v(this,"key",""),v(this,"code",""),this.$event=t,t&&(t.type&&(this.type=t.type),t.key&&(this.key=t.key),t.code&&(this.code=t.code)),Object.assign(this,e),M.objectEach(r,(n,o)=>{if(M.isFunction(n)){let s=null,c=!1;Object.defineProperty(this,o,{get(){return c||(c=!0,s=n()),s}})}else this[o]=n})}stopPropagation(){const t=this.$event;t&&t.stopPropagation()}preventDefault(){const t=this.$event;t&&t.preventDefault()}},Mt=(t,e,r)=>(t instanceof _t&&(t=t.$event),new _t(t,e,r)),Ut={on(t,e,r){mt.push({comp:t,type:e,cb:r})},off(t,e){M.remove(mt,r=>r.comp===t&&r.type===e)},hasKey(t,e){if(!e)return!1;const{key:r}=t;return e=e.toLowerCase(),r?e===r.toLowerCase()||!!(Ht[r]&&Ht[r].toLowerCase()===e):!1},hasControlKey(t){return t.ctrlKey||t.metaKey}};ft.isDoc&&(ft.msie||(window.addEventListener("copy",T,!1),window.addEventListener("cut",T,!1),window.addEventListener("paste",T,!1)),document.addEventListener("scroll",T,!0),document.addEventListener("keydown",T,!1),document.addEventListener("contextmenu",T,!1),window.addEventListener("mousedown",T,!1),window.addEventListener("click",T,!1),window.addEventListener("blur",T,!1),window.addEventListener("resize",T,!1),window.addEventListener(At,M.throttle(T,100,{leading:!0,trailing:!1}),{passive:!0,capture:!1}));import Vt from"xe-utils";var jt,R=[],_e=500;function Me(){R.length&&(R.forEach(t=>{t.tarList.forEach(e=>{const{target:r,width:n,heighe:o}=e,s=r.clientWidth,c=r.clientHeight;(s&&n!==s||c&&o!==c)&&(e.width=s,e.heighe=c,setTimeout(t.callback))})}),Ft())}function Ft(){clearTimeout(jt),jt=setTimeout(Me,L.resizeInterval||_e)}var Ue=class{constructor(t){v(this,"tarList",[]),v(this,"callback"),this.callback=t}observe(t){if(t){const{tarList:e}=this;e.some(r=>r.target===t)||e.push({target:t,width:t.clientWidth,heighe:t.clientHeight}),R.length||Ft(),R.some(r=>r===this)||R.push(this)}}unobserve(t){Vt.remove(R,e=>e.tarList.some(r=>r.target===t))}disconnect(){Vt.remove(R,t=>t===this)}},zt={create(t){return window.ResizeObserver?new window.ResizeObserver(t):new Ue(t)}};import Yt from"xe-utils";import{reactive as Ve}from"vue";var B=Ve({language:"",langMaps:{}}),$t=!1,J={};function je(t){return t&&t.__esModule?t.default:t}function dt(t,e){const{langMaps:r,language:n}=B,{i18n:o}=L;if(o)return`${o(t,e)||""}`;if($t||(r[n]||console.error(`[vxe core] 语言包未安装。Language not installed. https://${C.uiVersion?"vxeui.com":"vxetable.cn"}/#/start/i18n`),$t=!0),!e&&J[t])return J[t];const s=Yt.toFormatString(Yt.get(r[n],t,t),e);return e||(J[t]=s),s}function qt(t){const{language:e}=B,r=t||"zh-CN";return e!==r&&(B.language=r,J={}),C}function Kt(t,e){return B.langMaps[t]=Object.assign({},je(e)),C}function Gt(t){const{langMaps:e}=B;return!!e[t]}function Zt(){const{language:t}=B;return t}import Q from"xe-utils";function gt(t,e){return function(r,n){const o=`[vxe ${e||""}] ${dt(r,n)}`;return console[t](o),o}}var Jt="4.5.10",O={create:gt,warn:gt("warn",`v${Jt}`),err:gt("error",`v${Jt}`)},U={},k={mixin(t){return Q.each(t,(e,r)=>{k.add(r,e)}),k},get(t){return U[t]||null},add(t,e){if(t&&e){const r=U[t];r?(Q.each(e,(n,o)=>{!Q.eqNull(r[o])&&r[o]!==n&&O.warn("vxe.error.coverProp",[`Renderer.${t}`,o])}),Object.assign(r,e)):U[t]=e}return k},forEach(t){return Q.objectEach(U,t),k},delete(t){return delete U[t],k}};import V from"xe-utils";var Fe=class{constructor(){v(this,"store",{})}mixin(t){return V.each(t,(e,r)=>{this.add(r,e)}),this}has(t){return!!this.get(t)}get(t){return this.store[t]}add(t,e){const r=this.store[t],n=V.keys(r);return V.each(e,(o,s)=>{n.includes(s)&&O.warn("vxe.error.coverProp",[t,s])}),this.store[t]=r?V.merge(r,e):e,this}delete(t){delete this.store[t]}forEach(t){V.objectEach(this.store,t)}},Qt=Fe,pt=new Qt;Object.assign(pt,{_name:"Validators"});import X from"xe-utils";var ze=class{constructor(){v(this,"store",{})}mixin(t){return X.each(t,(e,r)=>{this.add(r,e)}),this}has(t){return!!this.get(t)}get(t){return this.store[t]}add(t,e){const r=this.store[t];X.isFunction(e)&&(O.warn("vxe.error.delProp",["menus -> callback","menuMethod"]),e={menuMethod:e});const n=X.keys(r);return X.each(e,(o,s)=>{n.includes(s)&&O.warn("vxe.error.coverProp",[t,s])}),this.store[t]=r?X.merge(r,e):e,this}delete(t){delete this.store[t]}forEach(t){X.objectEach(this.store,t)}},bt=new ze;Object.assign(bt,{_name:"Menus"});import H from"xe-utils";var Ye=class{constructor(){v(this,"store",{})}mixin(t){return H.each(t,(e,r)=>{this.add(r,e)}),this}has(t){return!!this.get(t)}get(t){return this.store[t]}add(t,e){const r=this.store[t];H.isFunction(e)&&(O.warn("vxe.error.delProp",["formats -> callback","cellFormatMethod"]),e={cellFormatMethod:e});const n=H.keys(r);return H.each(e,(o,s)=>{n.includes(s)&&O.warn("vxe.error.coverProp",[t,s])}),this.store[t]=r?H.merge(r,e):e,this}delete(t){delete this.store[t]}forEach(t){H.objectEach(this.store,t)}},vt=new Ye;Object.assign(vt,{_name:"Formats"});import A from"xe-utils";var $e=class{constructor(){v(this,"store",{})}mixin(t){return A.each(t,(e,r)=>{this.add(r,e)}),this}has(t){return!!this.get(t)}get(t){return this.store[t]}add(t,e){const r=this.store[t];A.isFunction(e)&&(O.warn("vxe.error.delProp",["commands -> callback","commandMethod"]),e={commandMethod:e});const n=A.keys(r);return A.each(e,(o,s)=>{n.includes(s)&&O.warn("vxe.error.coverProp",[t,s])}),this.store[t]=r?A.merge(r,e):e,this}delete(t){delete this.store[t]}forEach(t){A.objectEach(this.store,t)}},Et=new $e;Object.assign(Et,{_name:"Commands"});import tt from"xe-utils";var j={},F={mixin(t){return tt.each(t,(e,r)=>{F.add(r,e)}),F},get(t){return t?j[t]||[]:[]},add(t,e){tt.isFunction(e)&&(e={tableInterceptorMethod:e});const r=e.tableInterceptorMethod;if(r){let n=j[t];n||(n=j[t]=[]),n.indexOf(r)>-1&&O.warn("vxe.error.coverProp",["Interceptor",t]),n.push(r)}return F},delete(t,e){const r=j[t];if(r){tt.isFunction(e)&&(e={tableInterceptorMethod:e});const n=e?e.tableInterceptorMethod:null;n?tt.remove(r,o=>o===n):delete j[t]}}};import qe from"xe-utils";var P,z={text:"",html:""};function Ke(t){if(!P){P=document.createElement("textarea"),P.id="$VxeCopy";const e=P.style;e.width="48px",e.height="24px",e.position="fixed",e.zIndex="0",e.left="-500px",e.top="-500px",document.body.appendChild(P)}P.value=t}var te={getStore(){return z},setStore(t){Object.assign(z,t||{})},copy(t){let e=!1;try{const r=qe.toValueString(t);Ke(r),P.select(),P.setSelectionRange(0,P.value.length),e=document.execCommand("copy"),P.blur(),z.text=r,z.html=""}catch(r){}return e},getText(){return z.text||""}};import Ge from"xe-utils";function Y(t,e){let r=!0,n=!1;const o=e||L.permissionMethod;if(t&&o){r=!1,n=!0;let c=!1,E=!1;const S=String(t).split("|");for(let b=0;b<S.length;b++){const $=S[b];let w=!0,h=!1;const x=o({code:$});if(Ge.isBoolean(x)?w=x:x&&(w=!!x.visible,h=!!x.disabled),!h&&!E&&(E=!0,n=h),w&&!c&&(c=!0,r=w),c&&E)break}}return{code:t,visible:r,disabled:n}}var ee={getCheckInfo(t){return Y(t)},checkVisible(t){return Y(t).visible},checkDisable(t){return Y(t).disabled}};import et from"dom-zindex";var re={next(){return et.getNext()},getLast(){return et.getCurrent()},nextSub(){return et.getSubNext()},getSubLast(){return et.getSubCurrent()}};import ne from"xe-utils";var oe={getStrVal(t){return ne.eqNull(t)?"":""+t},isEmptyVal(t){return t==null||t===""},getDefVal(t,e){return ne.eqNull(t)?e:t},isEnabled(t){return!!(t&&t.enabled!==!1)},hasEnableConf(t,e){return!!(e&&(t?e.enabled!==!1:e.enabled))}};import rt from"xe-utils";var Ze=class{constructor(t,e){v(this,"storeName","vxe_storage"),v(this,"key"),v(this,"version"),v(this,"dbPromise",null),v(this,"dbName",""),this.key=t,this.version=e}getDBName(){return`${this.key}_${this.version}`}resetDB(){this.dbPromise=null,this.dbName=""}openDB(){const t=this.getDBName();return this.dbPromise&&this.dbName===t?this.dbPromise:(this.dbName=t,this.dbPromise=new Promise((e,r)=>{const n=indexedDB.open(t,1);n.onupgradeneeded=()=>{const o=n.result;o.objectStoreNames.contains(this.storeName)||o.createObjectStore(this.storeName,{keyPath:"id"})},n.onsuccess=()=>{const o=n.result;o.onversionchange=()=>{o.close(),this.resetDB()},o.onclose=()=>{this.resetDB()},e(o)},n.onerror=()=>{r(n.error||new Error(`IdbStore open failed: ${t}`))},n.onblocked=()=>{console.warn(`[IdbStore] open blocked: ${t}`)}}).catch(e=>{throw this.resetDB(),e}),this.dbPromise)}getById(t){return this.openDB().then(e=>new Promise((r,n)=>{const o=e.transaction(this.storeName,"readonly").objectStore(this.storeName).get(t);o.onsuccess=()=>r(o.result),o.onerror=()=>n(o.error)}))}getAll(){return this.openDB().then(t=>new Promise((e,r)=>{const n=t.transaction(this.storeName,"readonly").objectStore(this.storeName);if(rt.isFunction(n.getAll)){const c=n.getAll();c.onsuccess=()=>e(c.result||[]),c.onerror=()=>r(c.error);return}const o=[],s=n.openCursor();s.onsuccess=()=>{const c=s.result;c?(o.push(c.value),c.continue()):e(o)},s.onerror=()=>r(s.error)}))}updateById(t,e){return e==null?this.deleteById(t):this.openDB().then(r=>new Promise((n,o)=>{const s=r.transaction(this.storeName,"readwrite");s.objectStore(this.storeName).put({id:t,data:e}),s.oncomplete=()=>n(),s.onerror=()=>o(s.error)}))}deleteById(t){return this.openDB().then(e=>new Promise((r,n)=>{const o=e.transaction(this.storeName,"readwrite");o.objectStore(this.storeName).delete(t),o.oncomplete=()=>r(),o.onerror=()=>n(o.error)}))}clear(){return this.openDB().then(t=>new Promise((e,r)=>{const n=t.transaction(this.storeName,"readwrite");n.objectStore(this.storeName).clear(),n.oncomplete=()=>e(),n.onerror=()=>r(n.error)}))}cleanupOldDBs(){if(!indexedDB.databases)return Promise.resolve();const t=this.getDBName(),e=`${this.key}_`;return indexedDB.databases().then(r=>{r.forEach(n=>{const o=n.name;if(!o||o===t||!o.startsWith(e))return;o.slice(e.length).includes("_")||indexedDB.deleteDatabase(o)})})}},Je=class{constructor(t,e){v(this,"key"),v(this,"version"),this.key=t,this.version=e}readAll(){const t=rt.toStringJSON(localStorage.getItem(this.key)||"");return t&&String(t._v)===String(this.version)?t:{_v:this.version}}writeAll(t){localStorage.setItem(this.key,rt.toJSONString(t))}getById(t){const e=this.readAll(),r=Object.prototype.hasOwnProperty.call(e,t);return Promise.resolve(r&&e[t]!=null?{id:t,data:e[t]}:void 0)}getAll(){const t=this.readAll(),e=[];return Object.keys(t).forEach(r=>{r!=="_v"&&t[r]!=null&&e.push({id:r,data:t[r]})}),Promise.resolve(e)}updateById(t,e){if(e==null)return this.deleteById(t);const r=this.readAll();return r[t]=e,this.writeAll(r),Promise.resolve()}deleteById(t){const e=this.readAll();return delete e[t],this.writeAll(e),Promise.resolve()}clear(){return this.writeAll({_v:this.version}),Promise.resolve()}cleanupOldDBs(){const t=localStorage.getItem(this.key);if(!t)return Promise.resolve();const e=rt.toStringJSON(t);return(!e||String(e._v)!==String(this.version))&&localStorage.removeItem(this.key),Promise.resolve()}},se={createStore(t,e){const r=Object.assign({},e),n=r.version||L.version||0,o=r.driver;return(!o||o==="indexedDB")&&typeof indexedDB!="undefined"?new Ze(t,n):new Je(t,n)}};import Qe from"xe-utils";var wt={};function ie(t){return wt[t]||(wt[t]=new RegExp(`(?:^|\\s)${t}(?!\\S)`,"g")),wt[t]}function St(t,e){return t?t.classList?t.classList.contains(e):!!(t.className&&t.className.match&&t.className.match(ie(e))):!1}function ce(t,e){t&&St(t,e)&&(t.className=t.className.replace(ie(e),""))}var le={isPx(t){return t&&/^\d+(\.\d+)?(px)?$/.test(t)},isScale(t){return t&&/^\d+(\.\d+)?%$/.test(t)},hasClass:St,removeClass:ce,addClass(t,e){t&&!St(t,e)&&(ce(t,e),t.className=t.className+" "+e)},buildClass(t,e){const r=[];if(t)for(let n=0;n<t.length;n++){const o=t[n];o&&r.push(""+o)}return Qe.each(e,(n,o)=>{n&&r.push(o)}),r.join(" ")}},xt={getThumbSize(t,e,r){if(e<=t)return 0;const n=t/e,o=r*n;return Math.max(20,Math.min(o,r))},getThumbOffsetSize(t,e,r,n,o){const s=r-e;if(s<=0)return 0;const c=n-o;return c<=0?0:Math.min(Math.max(t,0),s)/s*c},getScrollFromClick(t,e,r,n,o){const s=n-o,c=r-e;if(c<=0||s<=0)return 0;let E=t-o/2;return E=Math.min(Math.max(E,0),s),E/s*c},getScrollFromDrag(t,e,r,n,o,s){const c=n-r,E=o-s;if(c<=0||E<=0)return 0;let S=t-e;return S=Math.min(Math.max(S,0),E),S/E*c}};import _ from"xe-utils";function ae(t){if(!t)return null;const e=document.body,r=t.parentElement;return(r===e?document.documentElement:r)||null}function ue(t){return(t&&_.isFunction(t)?t({}):t)||"body"}function he(t){const e=ue(t);return _.isString(e)?document.querySelector(e)||document.body:e}var fe={updatePlacement(t,e,r){const{defaultTop:n,defaultLeft:o,placement:s,defaultPlacement:c,appendTo:E,teleportTo:S,marginSize:b,isMinWidth:$}=Object.assign({appendTo:"",teleportTo:!1,marginSize:12,isMinWidth:!0},r);let w="bottom",h="",x="",g=0,q="",i="";const u={};if(e&&t){const l=document.documentElement,f=ae(S?he(E):e);if(f){const a=t.offsetWidth,m=t.offsetHeight,p=e.offsetWidth,d=e.offsetHeight,y=f.getBoundingClientRect(),K=e.getBoundingClientRect(),Pt=t.getBoundingClientRect(),ct=l.clientHeight,G=l.clientWidth,Ne=f.scrollLeft,D=f.scrollTop,Le=y.left,Re=y.top,N=Pt.left,I=Pt.top;q=t.offsetWidth,S?(g=(o||N-(p-a)/2)-Ne,h=(n||I+m)-D,s==="top"?(w="top",h=I-d):s||(c==="top"?(w="top",n||(h=I-d),h<b-D&&(w="bottom",h=I+m-D),h+d+b>ct-D&&(w="top",h=I-d-D)):(h+d+b>ct-D&&(w="top",h=I-d-D),h<b-D&&(w="bottom",h=I+m-D))),g+p+b>G&&(g-=g+p+b-G),g<b&&(g=b),h-=Re,g-=Le):(s==="top"?(w="top",x=m):s||(h=m,I+m+d+b>ct&&I-m-d>b&&(w="top",h="",x=m)),K.left+K.width+b>G&&(g=-(K.left+K.width+b-G))),_.isNumber(h)&&(u.top=h+"px"),_.isNumber(x)&&(u.bottom=x+"px"),_.isNumber(g)&&(u.left=g+"px"),$&&_.isNumber(q)&&(u.minWidth=q+"px"),g===N?a<=p&&(i=a/2):g<N&&(g+p>N+a?i=N-g+a/2:i=N-g+(p-(N-g))/2)}}return{top:h||0,bottom:x||0,left:g||0,arrowLeft:i||0,style:u,placement:w}},getWrapperElement:ae,getAppendSelector:ue,getAppendElement:he},me=new Qt;import tr from"xe-utils";import{computed as Tt,ref as nt,inject as de,provide as ge}from"vue";var{getThumbOffsetSize:ot,getThumbSize:pe,getScrollFromClick:be,getScrollFromDrag:ve}=xt;function Ee(t){const e=de("xeSizeInfo",null),r=Tt(()=>{const{size:n}=t;return n||(e?e.value:null)});return ge("xeSizeInfo",r),{computeSize:r}}function we(t){return{computePermissionInfo:Tt(()=>Y(t.permissionCode,t.permissionMethod))}}function Se(t){const e=de("xeScrollbarInfo",null),r=Tt(()=>{const{useScrollbar:n}=t;return tr.isBoolean(n)?n:e?e.value:null});return ge("xeScrollbarInfo",r),{computeIsVScrollbar:r}}var xe=t=>{const{reactData:e,internalData:r}=t,n=nt(),o=nt(),s=nt(),c=nt();return{refTrackXElem:n,refTrackYElem:o,refThumbXElem:s,refThumbYElem:c,updateThumbSize:()=>{const i=t.getScrollViewElem();if(!i||!i.clientHeight||!i.clientHeight)return;const u=n.value,l=u?pe(i.clientWidth,i.scrollWidth,u.clientWidth):0,f=s.value;f&&(f.style.width=l+"px"),e.xThumbWidth=l;const a=o.value,m=a?pe(i.clientHeight,i.scrollHeight,a.clientHeight):0,p=c.value;p&&(p.style.height=m+"px"),e.yThumbHeight=m},updateThumbOffset:()=>{const i=t.getScrollViewElem();if(!i||!i.clientHeight||!i.clientHeight)return;const{xThumbWidth:u,yThumbHeight:l}=e,f=n.value,a=s.value,m=f&&u?ot(i.scrollLeft,i.clientWidth,i.scrollWidth,f.clientWidth,u):0;r.xThumbLeft=m,a&&u&&(a.style.width=u+"px",a.style.transform=`translateX(${m}px)`);const p=o.value,d=c.value,y=p&&l?ot(i.scrollTop,i.clientHeight,i.scrollHeight,p.clientHeight,l):0;r.yThumbTop=y,d&&l&&(d.style.height=l+"px",d.style.transform=`translateY(${y}px)`)},clickTrackXEvent:i=>{const u=i.currentTarget;if(u!==i.target)return;const l=t.getScrollViewElem();if(!l)return;const{xThumbWidth:f}=e,a=u.getBoundingClientRect();l.scrollTo({left:be(i.clientX-a.left,l.clientWidth,l.scrollWidth,u.clientWidth,f),behavior:"auto"})},clickTrackYEvent:i=>{const u=i.currentTarget;if(u!==i.target)return;const l=t.getScrollViewElem();if(!l)return;const{yThumbHeight:f}=e,a=u.getBoundingClientRect();l.scrollTo({top:be(i.clientY-a.top,l.clientHeight,l.scrollHeight,u.clientHeight,f),behavior:"auto"})},pointerdownThumbXEvent:i=>{const u=i.currentTarget;r.isThumbDrag=!0,u.setPointerCapture(i.pointerId);const l=t.getScrollViewElem();if(!l)return;const{xThumbWidth:f}=e,a=u.parentElement,m=a.getBoundingClientRect(),p=i.clientX-m.left,d=ot(l.scrollLeft,l.clientWidth,l.scrollWidth,a.clientWidth,f);r.thumbDragOffset=p-d},pointermoveThumbXEvent:i=>{if(!i.currentTarget.hasPointerCapture(i.pointerId))return;const{isThumbDrag:l,thumbDragOffset:f}=r;if(l){const a=t.getScrollViewElem();if(!a)return;const{xThumbWidth:m}=e,d=i.currentTarget.parentElement,y=d.getBoundingClientRect();a.scrollLeft=ve(i.clientX-y.left,f,a.clientWidth,a.scrollWidth,d.clientWidth,m)}},cleatPointerThumbEvent:i=>{i.currentTarget.releasePointerCapture(i.pointerId),r.isThumbDrag=!1},pointerdownThumbYEvent:i=>{const u=i.currentTarget;r.isThumbDrag=!0,u.setPointerCapture(i.pointerId);const l=t.getScrollViewElem();if(!l)return;const{yThumbHeight:f}=e,a=u.parentElement,m=a.getBoundingClientRect(),p=i.clientY-m.top,d=ot(l.scrollTop,l.clientHeight,l.scrollHeight,a.clientHeight,f);r.thumbDragOffset=p-d},pointermoveThumbYEvent:i=>{if(!i.currentTarget.hasPointerCapture(i.pointerId))return;const{isThumbDrag:l,thumbDragOffset:f}=r;if(l){const a=t.getScrollViewElem();if(!a)return;const{yThumbHeight:m}=e,d=i.currentTarget.parentElement,y=d.getBoundingClientRect();a.scrollTop=ve(i.clientY-y.top,f,a.clientHeight,a.scrollHeight,d.clientHeight,m)}}}},Te={useSize:Ee,useVScrollbar:Se,usePermission:we,useInitVScrollbar:xe};import Ot from"xe-utils";var Oe=[];function Pe(t,e){return t&&t.install&&Oe.indexOf(t)===-1&&(t.install(it,e),Oe.push(t)),it}var st={};function ye(t){return st[t]||null}function De(t){return!!st[t]}function Ie(t){t&&t.name&&(st[t.name]=t,st[Ot.kebabCase(t.name)]=t)}function Ce(){return Xe()}function We(t,e,r){if(t){const n=`${t}`.match(/(\d+).(\d+).(\d+)/);if(n){const o=Ot.toNumber(n[1]);if(r){const s=Ot.toNumber(n[2]);return o>=e&&s>=r}return o>=e}}return!1}var it=Object.assign(C,{renderEmptyElement:Ce,setTheme:Z,getTheme:Ct,setConfig:Wt,getConfig:Nt,setIcon:Bt,getIcon:ut,renderGlobalIcon:Xt,renderCustomIcon:ht,setLanguage:qt,hasLanguage:Gt,getLanguage:Zt,setI18n:Kt,getI18n:dt,globalEvents:Ut,GLOBAL_EVENT_KEYS:W,createEvent:Mt,globalResize:zt,renderer:k,validators:pt,menus:bt,formats:vt,commands:Et,interceptor:F,clipboard:te,log:O,permission:ee,zIndex:re,baseUtils:oe,dbUtils:se,domUtils:le,scrollbarUtils:xt,popperUtils:fe,globalStore:Lt,hooks:me,component:Ie,getComponent:ye,hasComponent:De,useFns:Te,getSlotVNs:at,checkVersion:We,use:Pe});Z();var er=it;export{W as GLOBAL_EVENT_KEYS,C as VxeCore,it as VxeUI,oe as baseUtils,We as checkVersion,te as clipboard,Et as commands,Ie as component,yt as coreVersion,Mt as createEvent,se as dbUtils,er as default,le as domUtils,vt as formats,ye as getComponent,Nt as getConfig,dt as getI18n,ut as getIcon,Zt as getLanguage,at as getSlotVNs,Ct as getTheme,Ut as globalEvents,zt as globalResize,Lt as globalStore,Y as handleCheckInfo,De as hasComponent,Gt as hasLanguage,me as hooks,F as interceptor,O as log,bt as menus,ee as permission,fe as popperUtils,ht as renderCustomIcon,Ce as renderEmptyElement,Xt as renderGlobalIcon,k as renderer,xt as scrollbarUtils,Wt as setConfig,Kt as setI18n,Bt as setIcon,qt as setLanguage,Z as setTheme,Pe as use,Te as useFns,xe as useInitVScrollbar,we as usePermission,Ee as useSize,Se as useVScrollbar,pt as validators,re as zIndex};
|
package/es/src/core.js
CHANGED
package/es/src/log.js
CHANGED
package/es/src/popper-utils.js
CHANGED
|
@@ -40,7 +40,7 @@ const popperUtils = {
|
|
|
40
40
|
let arrowLeft = "";
|
|
41
41
|
const stys = {};
|
|
42
42
|
if (panelElem && targetElem) {
|
|
43
|
-
const
|
|
43
|
+
const domEl = document.documentElement;
|
|
44
44
|
const parentWrapperEl = getWrapperElement(teleportTo ? getAppendElement(appendTo) : panelElem);
|
|
45
45
|
if (parentWrapperEl) {
|
|
46
46
|
const targetWidth = targetElem.offsetWidth;
|
|
@@ -50,8 +50,8 @@ const popperUtils = {
|
|
|
50
50
|
const parentWrapperRect = parentWrapperEl.getBoundingClientRect();
|
|
51
51
|
const panelRect = panelElem.getBoundingClientRect();
|
|
52
52
|
const targetRect = targetElem.getBoundingClientRect();
|
|
53
|
-
const visibleHeight =
|
|
54
|
-
const visibleWidth =
|
|
53
|
+
const visibleHeight = domEl.clientHeight;
|
|
54
|
+
const visibleWidth = domEl.clientWidth;
|
|
55
55
|
const parentWrapperScrollLeft = parentWrapperEl.scrollLeft;
|
|
56
56
|
const parentWrapperScrollTop = parentWrapperEl.scrollTop;
|
|
57
57
|
const parentWrapperOffsetLeft = parentWrapperRect.left;
|
|
@@ -71,22 +71,22 @@ const popperUtils = {
|
|
|
71
71
|
if (!defaultTop) {
|
|
72
72
|
top = targetTop - panelHeight;
|
|
73
73
|
}
|
|
74
|
-
if (top < marginSize) {
|
|
74
|
+
if (top < marginSize - parentWrapperScrollTop) {
|
|
75
75
|
panelPlacement = "bottom";
|
|
76
|
-
top = targetTop + targetHeight;
|
|
76
|
+
top = targetTop + targetHeight - parentWrapperScrollTop;
|
|
77
77
|
}
|
|
78
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
78
|
+
if (top + panelHeight + marginSize > visibleHeight - parentWrapperScrollTop) {
|
|
79
79
|
panelPlacement = "top";
|
|
80
|
-
top = targetTop - panelHeight;
|
|
80
|
+
top = targetTop - panelHeight - parentWrapperScrollTop;
|
|
81
81
|
}
|
|
82
82
|
} else {
|
|
83
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
83
|
+
if (top + panelHeight + marginSize > visibleHeight - parentWrapperScrollTop) {
|
|
84
84
|
panelPlacement = "top";
|
|
85
|
-
top = targetTop - panelHeight;
|
|
85
|
+
top = targetTop - panelHeight - parentWrapperScrollTop;
|
|
86
86
|
}
|
|
87
|
-
if (top < marginSize) {
|
|
87
|
+
if (top < marginSize - parentWrapperScrollTop) {
|
|
88
88
|
panelPlacement = "bottom";
|
|
89
|
-
top = targetTop + targetHeight;
|
|
89
|
+
top = targetTop + targetHeight - parentWrapperScrollTop;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
package/lib/index.umd.js
CHANGED
|
@@ -112,7 +112,7 @@ __export(index_exports, {
|
|
|
112
112
|
module.exports = __toCommonJS(index_exports);
|
|
113
113
|
|
|
114
114
|
// packages_temp/src/core.ts
|
|
115
|
-
var coreVersion = "4.5.
|
|
115
|
+
var coreVersion = "4.5.10";
|
|
116
116
|
var VxeCore = {
|
|
117
117
|
coreVersion,
|
|
118
118
|
uiVersion: "",
|
|
@@ -659,7 +659,7 @@ function createLog(type, name) {
|
|
|
659
659
|
return msg;
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
|
-
var version = "4.5.
|
|
662
|
+
var version = "4.5.10";
|
|
663
663
|
var log = {
|
|
664
664
|
create: createLog,
|
|
665
665
|
warn: createLog("warn", `v${version}`),
|
|
@@ -1520,7 +1520,7 @@ var popperUtils = {
|
|
|
1520
1520
|
let arrowLeft = "";
|
|
1521
1521
|
const stys = {};
|
|
1522
1522
|
if (panelElem && targetElem) {
|
|
1523
|
-
const
|
|
1523
|
+
const domEl = document.documentElement;
|
|
1524
1524
|
const parentWrapperEl = getWrapperElement(teleportTo ? getAppendElement(appendTo) : panelElem);
|
|
1525
1525
|
if (parentWrapperEl) {
|
|
1526
1526
|
const targetWidth = targetElem.offsetWidth;
|
|
@@ -1530,8 +1530,8 @@ var popperUtils = {
|
|
|
1530
1530
|
const parentWrapperRect = parentWrapperEl.getBoundingClientRect();
|
|
1531
1531
|
const panelRect = panelElem.getBoundingClientRect();
|
|
1532
1532
|
const targetRect = targetElem.getBoundingClientRect();
|
|
1533
|
-
const visibleHeight =
|
|
1534
|
-
const visibleWidth =
|
|
1533
|
+
const visibleHeight = domEl.clientHeight;
|
|
1534
|
+
const visibleWidth = domEl.clientWidth;
|
|
1535
1535
|
const parentWrapperScrollLeft = parentWrapperEl.scrollLeft;
|
|
1536
1536
|
const parentWrapperScrollTop = parentWrapperEl.scrollTop;
|
|
1537
1537
|
const parentWrapperOffsetLeft = parentWrapperRect.left;
|
|
@@ -1551,22 +1551,22 @@ var popperUtils = {
|
|
|
1551
1551
|
if (!defaultTop) {
|
|
1552
1552
|
top = targetTop - panelHeight;
|
|
1553
1553
|
}
|
|
1554
|
-
if (top < marginSize) {
|
|
1554
|
+
if (top < marginSize - parentWrapperScrollTop) {
|
|
1555
1555
|
panelPlacement = "bottom";
|
|
1556
|
-
top = targetTop + targetHeight;
|
|
1556
|
+
top = targetTop + targetHeight - parentWrapperScrollTop;
|
|
1557
1557
|
}
|
|
1558
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
1558
|
+
if (top + panelHeight + marginSize > visibleHeight - parentWrapperScrollTop) {
|
|
1559
1559
|
panelPlacement = "top";
|
|
1560
|
-
top = targetTop - panelHeight;
|
|
1560
|
+
top = targetTop - panelHeight - parentWrapperScrollTop;
|
|
1561
1561
|
}
|
|
1562
1562
|
} else {
|
|
1563
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
1563
|
+
if (top + panelHeight + marginSize > visibleHeight - parentWrapperScrollTop) {
|
|
1564
1564
|
panelPlacement = "top";
|
|
1565
|
-
top = targetTop - panelHeight;
|
|
1565
|
+
top = targetTop - panelHeight - parentWrapperScrollTop;
|
|
1566
1566
|
}
|
|
1567
|
-
if (top < marginSize) {
|
|
1567
|
+
if (top < marginSize - parentWrapperScrollTop) {
|
|
1568
1568
|
panelPlacement = "bottom";
|
|
1569
|
-
top = targetTop + targetHeight;
|
|
1569
|
+
top = targetTop + targetHeight - parentWrapperScrollTop;
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
1572
|
}
|
package/lib/index.umd.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(R,Y){typeof module=="object"&&typeof module.exports=="object"?module.exports=Y(require("vue"),require("xe-utils")):typeof define=="function"&&define.amd?define(["vue","xe-utils"],Y):(R=typeof globalThis!="undefined"?globalThis:R||self,R.VxeUI=Y(R.Vue,R.XEUtils))})(this,function(R,Y){var pe={vue:R,"xe-utils":Y},f=function(e){return pe[e]!==void 0?pe[e]:typeof window!="undefined"&&window[e]?window[e]:typeof globalThis!="undefined"&&globalThis[e]?globalThis[e]:pe[e]},be={exports:{}},Ar=be.exports,or=Object.create,$=Object.defineProperty,sr=Object.getOwnPropertyDescriptor,ir=Object.getOwnPropertyNames,lr=Object.getPrototypeOf,ar=Object.prototype.hasOwnProperty,cr=(e,t,r)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ur=(e,t)=>{for(var r in t)$(e,r,{get:t[r],enumerable:!0})},Ve=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ir(t))!ar.call(e,o)&&o!==r&&$(e,o,{get:()=>t[o],enumerable:!(n=sr(t,o))||n.enumerable});return e},p=(e,t,r)=>(r=e!=null?or(lr(e)):{},Ve(t||!e||!e.__esModule?$(r,"default",{value:e,enumerable:!0}):r,e)),fr=e=>Ve($({},"__esModule",{value:!0}),e),E=(e,t,r)=>cr(e,typeof t!="symbol"?t+"":t,r),je={};ur(je,{GLOBAL_EVENT_KEYS:()=>W,VxeCore:()=>N,VxeUI:()=>fe,baseUtils:()=>Lt,checkVersion:()=>rr,clipboard:()=>Ct,commands:()=>Re,component:()=>er,coreVersion:()=>ze,createEvent:()=>mt,dbUtils:()=>Wt,default:()=>Wr,domUtils:()=>kt,formats:()=>We,getComponent:()=>Zt,getConfig:()=>st,getI18n:()=>Pe,getIcon:()=>ye,getLanguage:()=>yt,getSlotVNs:()=>Te,getTheme:()=>nt,globalEvents:()=>gt,globalResize:()=>Et,globalStore:()=>it,handleCheckInfo:()=>re,hasComponent:()=>Qt,hasLanguage:()=>Tt,hooks:()=>jt,interceptor:()=>ee,log:()=>I,menus:()=>Le,permission:()=>Pt,popperUtils:()=>Vt,renderCustomIcon:()=>Ie,renderEmptyElement:()=>tr,renderGlobalIcon:()=>ut,renderer:()=>A,scrollbarUtils:()=>He,setConfig:()=>ot,setI18n:()=>_t,setIcon:()=>ct,setLanguage:()=>St,setTheme:()=>oe,use:()=>Jt,useFns:()=>Kt,useInitVScrollbar:()=>qt,usePermission:()=>Yt,useSize:()=>Ut,useVScrollbar:()=>$t,validators:()=>Ne,zIndex:()=>Dt}),be.exports=fr(je);var ze="4.5.8",N={coreVersion:ze,uiVersion:"",tableVersion:"",designVersion:"",ganttVersion:""},dr=f("vue"),Fe=p(f("xe-utils")),V=null,ve=null,L=null,Xe="z-index-manage",B=null,Ue="z-index-style",Ye="m",$e="s",q={m:1e3,s:1e3};function Ee(){return V||typeof document!="undefined"&&(V=document),V}function qe(){return V&&!ve&&(ve=V.body||V.getElementsByTagName("body")[0]),ve}function hr(){let e=0;if(Ee()){const r=qe();if(r){const n=r.getElementsByTagName("*");for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.style&&s.nodeType===1){const l=s.style.zIndex;l&&/^\d+$/.test(l)&&(e=Math.max(e,Number(l)))}}}}return e}function mr(){if(!B){const e=Ee();e&&(B=e.getElementById(Ue),B||(B=e.createElement("style"),B.id=Ue,e.getElementsByTagName("head")[0].appendChild(B)))}return B}function Ke(){const e=mr();if(e){const t="--dom-",r="-z-index";e.innerHTML=":root{"+t+"main"+r+":"+ne()+";"+t+"sub"+r+":"+Se()+"}"}}function Ge(){if(!L){const e=Ee();if(e&&(L=e.getElementById(Xe),!L)){const t=qe();t&&(L=e.createElement("div"),L.id=Xe,L.style.display="none",t.appendChild(L),xe(q.m),we(q.s))}}return L}function Je(e){return function(t){if(t){t=Number(t),q[e]=t;const r=Ge();r&&(r.dataset?r.dataset[e]=t+"":r.setAttribute("data-"+e,t+""))}return Ke(),q[e]}}var xe=Je(Ye);function Ze(e,t){return function(n){let o;const s=Ge();if(s){const l=s.dataset?s.dataset[e]:s.getAttribute("data-"+e);l&&(o=Number(l))}return o||(o=q[e]),n?Number(n)<o?t():n:o}}var ne=Ze(Ye,Qe);function Qe(){return xe(ne()+1)}var we=Je($e),et=Ze($e,tt);function Se(){return ne()+et()}function tt(){return we(et()+1),Se()}var gr={setCurrent:xe,getCurrent:ne,getNext:Qe,setSubCurrent:we,getSubCurrent:Se,getSubNext:tt,getMax:hr};Ke();var K=gr,k={size:"",version:1,zIndex:999,resizeInterval:500},rt={theme:""};function oe(e){const t=!e||e==="default"?"light":e;if(rt.theme=t,typeof document!="undefined"){const r=document.documentElement;r&&r.setAttribute("data-vxe-ui-theme",t)}return N}function nt(){return rt.theme}function ot(e){return e&&(e.zIndex&&K.setCurrent(e.zIndex),e.theme&&oe(e.theme),Fe.default.merge(k,e)),N}function st(e,t){return arguments.length?Fe.default.get(k,e,t):k}var it={},lt=f("vue"),at=p(f("xe-utils")),_e={},pr=p(f("xe-utils"));function Te(e){return pr.default.isArray(e)?e:e?[e]:[]}function ct(e){return e&&Object.assign(_e,e),N}function ye(e){return arguments.length?at.default.get(_e,e):_e}function ut(e){const t=ye(e);return Ie(t,e)}function Ie(e,t){return at.default.isFunction(e)?(0,lt.h)("span",{},Te(e({name:t}))):(0,lt.h)("i",{class:e})}var G=p(f("xe-utils")),W={F2:"F2",F10:"F10",TAB:"Tab",ESCAPE:"Escape",ENTER:"Enter",DELETE:"Delete",BACKSPACE:"Backspace",SPACEBAR:" ",CONTEXT_MENU:"ContextMenu",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",HOME:"Home",END:"End",PROCESS:"Process",A:"A",X:"X",C:"C",V:"V",D:"D",F:"F",H:"H",M:"M",Y:"Y",Z:"Z",R:"R",P:"P"},Oe=G.default.browse(),ft={" ":"Spacebar",Apps:W.CONTEXT_MENU,Del:W.DELETE,Up:W.ARROW_UP,Down:W.ARROW_DOWN,Left:W.ARROW_LEFT,Right:W.ARROW_RIGHT},dt=Oe.firefox?"DOMMouseScroll":"mousewheel",Ce=[];function y(e){const t=e.type===dt;Ce.forEach(({type:r,cb:n})=>{e.cancelBubble||(r===e.type||t&&r==="mousewheel")&&n(e)})}var ht=class{constructor(e,t,r){E(this,"$event"),E(this,"type",""),E(this,"key",""),E(this,"code",""),this.$event=e,e&&(e.type&&(this.type=e.type),e.key&&(this.key=e.key),e.code&&(this.code=e.code)),Object.assign(this,t),G.default.objectEach(r,(n,o)=>{if(G.default.isFunction(n)){let s=null,l=!1;Object.defineProperty(this,o,{get(){return l||(l=!0,s=n()),s}})}else this[o]=n})}stopPropagation(){const e=this.$event;e&&e.stopPropagation()}preventDefault(){const e=this.$event;e&&e.preventDefault()}},mt=(e,t,r)=>(e instanceof ht&&(e=e.$event),new ht(e,t,r)),gt={on(e,t,r){Ce.push({comp:e,type:t,cb:r})},off(e,t){G.default.remove(Ce,r=>r.comp===e&&r.type===t)},hasKey(e,t){if(!t)return!1;const{key:r}=e;return t=t.toLowerCase(),r?t===r.toLowerCase()||!!(ft[r]&&ft[r].toLowerCase()===t):!1},hasControlKey(e){return e.ctrlKey||e.metaKey}};Oe.isDoc&&(Oe.msie||(window.addEventListener("copy",y,!1),window.addEventListener("cut",y,!1),window.addEventListener("paste",y,!1)),document.addEventListener("scroll",y,!0),document.addEventListener("keydown",y,!1),document.addEventListener("contextmenu",y,!1),window.addEventListener("mousedown",y,!1),window.addEventListener("click",y,!1),window.addEventListener("blur",y,!1),window.addEventListener("resize",y,!1),window.addEventListener(dt,G.default.throttle(y,100,{leading:!0,trailing:!1}),{passive:!0,capture:!1}));var pt=p(f("xe-utils")),bt,H=[],br=500;function vr(){H.length&&(H.forEach(e=>{e.tarList.forEach(t=>{const{target:r,width:n,heighe:o}=t,s=r.clientWidth,l=r.clientHeight;(s&&n!==s||l&&o!==l)&&(t.width=s,t.heighe=l,setTimeout(e.callback))})}),vt())}function vt(){clearTimeout(bt),bt=setTimeout(vr,k.resizeInterval||br)}var Er=class{constructor(e){E(this,"tarList",[]),E(this,"callback"),this.callback=e}observe(e){if(e){const{tarList:t}=this;t.some(r=>r.target===e)||t.push({target:e,width:e.clientWidth,heighe:e.clientHeight}),H.length||vt(),H.some(r=>r===this)||H.push(this)}}unobserve(e){pt.default.remove(H,t=>t.tarList.some(r=>r.target===e))}disconnect(){pt.default.remove(H,e=>e===this)}},Et={create(e){return window.ResizeObserver?new window.ResizeObserver(e):new Er(e)}},xt=p(f("xe-utils")),xr=f("vue"),j=(0,xr.reactive)({language:"",langMaps:{}}),wt=!1,se={};function wr(e){return e&&e.__esModule?e.default:e}function Pe(e,t){const{langMaps:r,language:n}=j,{i18n:o}=k;if(o)return`${o(e,t)||""}`;if(wt||(r[n]||console.error(`[vxe core] 语言包未安装。Language not installed. https://${N.uiVersion?"vxeui.com":"vxetable.cn"}/#/start/i18n`),wt=!0),!t&&se[e])return se[e];const s=xt.default.toFormatString(xt.default.get(r[n],e,e),t);return t||(se[e]=s),s}function St(e){const{language:t}=j,r=e||"zh-CN";return t!==r&&(j.language=r,se={}),N}function _t(e,t){return j.langMaps[e]=Object.assign({},wr(t)),N}function Tt(e){const{langMaps:t}=j;return!!t[e]}function yt(){const{language:e}=j;return e}var ie=p(f("xe-utils"));function De(e,t){return function(r,n){const o=`[vxe ${t||""}] ${Pe(r,n)}`;return console[e](o),o}}var It="4.5.8",I={create:De,warn:De("warn",`v${It}`),err:De("error",`v${It}`)},J={},A={mixin(e){return ie.default.each(e,(t,r)=>{A.add(r,t)}),A},get(e){return J[e]||null},add(e,t){if(e&&t){const r=J[e];r?(ie.default.each(t,(n,o)=>{!ie.default.eqNull(r[o])&&r[o]!==n&&I.warn("vxe.error.coverProp",[`Renderer.${e}`,o])}),Object.assign(r,t)):J[e]=t}return A},forEach(e){return ie.default.objectEach(J,e),A},delete(e){return delete J[e],A}},Z=p(f("xe-utils")),Sr=class{constructor(){E(this,"store",{})}mixin(e){return Z.default.each(e,(t,r)=>{this.add(r,t)}),this}has(e){return!!this.get(e)}get(e){return this.store[e]}add(e,t){const r=this.store[e],n=Z.default.keys(r);return Z.default.each(t,(o,s)=>{n.includes(s)&&I.warn("vxe.error.coverProp",[e,s])}),this.store[e]=r?Z.default.merge(r,t):t,this}delete(e){delete this.store[e]}forEach(e){Z.default.objectEach(this.store,e)}},Ot=Sr,Ne=new Ot;Object.assign(Ne,{_name:"Validators"});var z=p(f("xe-utils")),_r=class{constructor(){E(this,"store",{})}mixin(e){return z.default.each(e,(t,r)=>{this.add(r,t)}),this}has(e){return!!this.get(e)}get(e){return this.store[e]}add(e,t){const r=this.store[e];z.default.isFunction(t)&&(I.warn("vxe.error.delProp",["menus -> callback","menuMethod"]),t={menuMethod:t});const n=z.default.keys(r);return z.default.each(t,(o,s)=>{n.includes(s)&&I.warn("vxe.error.coverProp",[e,s])}),this.store[e]=r?z.default.merge(r,t):t,this}delete(e){delete this.store[e]}forEach(e){z.default.objectEach(this.store,e)}},Le=new _r;Object.assign(Le,{_name:"Menus"});var F=p(f("xe-utils")),Tr=class{constructor(){E(this,"store",{})}mixin(e){return F.default.each(e,(t,r)=>{this.add(r,t)}),this}has(e){return!!this.get(e)}get(e){return this.store[e]}add(e,t){const r=this.store[e];F.default.isFunction(t)&&(I.warn("vxe.error.delProp",["formats -> callback","cellFormatMethod"]),t={cellFormatMethod:t});const n=F.default.keys(r);return F.default.each(t,(o,s)=>{n.includes(s)&&I.warn("vxe.error.coverProp",[e,s])}),this.store[e]=r?F.default.merge(r,t):t,this}delete(e){delete this.store[e]}forEach(e){F.default.objectEach(this.store,e)}},We=new Tr;Object.assign(We,{_name:"Formats"});var X=p(f("xe-utils")),yr=class{constructor(){E(this,"store",{})}mixin(e){return X.default.each(e,(t,r)=>{this.add(r,t)}),this}has(e){return!!this.get(e)}get(e){return this.store[e]}add(e,t){const r=this.store[e];X.default.isFunction(t)&&(I.warn("vxe.error.delProp",["commands -> callback","commandMethod"]),t={commandMethod:t});const n=X.default.keys(r);return X.default.each(t,(o,s)=>{n.includes(s)&&I.warn("vxe.error.coverProp",[e,s])}),this.store[e]=r?X.default.merge(r,t):t,this}delete(e){delete this.store[e]}forEach(e){X.default.objectEach(this.store,e)}},Re=new yr;Object.assign(Re,{_name:"Commands"});var le=p(f("xe-utils")),Q={},ee={mixin(e){return le.default.each(e,(t,r)=>{ee.add(r,t)}),ee},get(e){return e?Q[e]||[]:[]},add(e,t){le.default.isFunction(t)&&(t={tableInterceptorMethod:t});const r=t.tableInterceptorMethod;if(r){let n=Q[e];n||(n=Q[e]=[]),n.indexOf(r)>-1&&I.warn("vxe.error.coverProp",["Interceptor",e]),n.push(r)}return ee},delete(e,t){const r=Q[e];if(r){le.default.isFunction(t)&&(t={tableInterceptorMethod:t});const n=t?t.tableInterceptorMethod:null;n?le.default.remove(r,o=>o===n):delete Q[e]}}},Ir=p(f("xe-utils")),C,te={text:"",html:""};function Or(e){if(!C){C=document.createElement("textarea"),C.id="$VxeCopy";const t=C.style;t.width="48px",t.height="24px",t.position="fixed",t.zIndex="0",t.left="-500px",t.top="-500px",document.body.appendChild(C)}C.value=e}var Ct={getStore(){return te},setStore(e){Object.assign(te,e||{})},copy(e){let t=!1;try{const r=Ir.default.toValueString(e);Or(r),C.select(),C.setSelectionRange(0,C.value.length),t=document.execCommand("copy"),C.blur(),te.text=r,te.html=""}catch(r){}return t},getText(){return te.text||""}},Cr=p(f("xe-utils"));function re(e,t){let r=!0,n=!1;const o=t||k.permissionMethod;if(e&&o){r=!1,n=!0;let l=!1,w=!1;const _=String(e).split("|");for(let x=0;x<_.length;x++){const de=_[x];let S=!0,d=!1;const T=o({code:de});if(Cr.default.isBoolean(T)?S=T:T&&(S=!!T.visible,d=!!T.disabled),!d&&!w&&(w=!0,n=d),S&&!l&&(l=!0,r=S),l&&w)break}}return{code:e,visible:r,disabled:n}}var Pt={getCheckInfo(e){return re(e)},checkVisible(e){return re(e).visible},checkDisable(e){return re(e).disabled}},Dt={next(){return K.getNext()},getLast(){return K.getCurrent()},nextSub(){return K.getSubNext()},getSubLast(){return K.getSubCurrent()}},Nt=p(f("xe-utils")),Lt={getStrVal(e){return Nt.default.eqNull(e)?"":""+e},isEmptyVal(e){return e==null||e===""},getDefVal(e,t){return Nt.default.eqNull(e)?t:e},isEnabled(e){return!!(e&&e.enabled!==!1)},hasEnableConf(e,t){return!!(t&&(e?t.enabled!==!1:t.enabled))}},ae=p(f("xe-utils")),Pr=class{constructor(e,t){E(this,"storeName","vxe_storage"),E(this,"key"),E(this,"version"),E(this,"dbPromise",null),E(this,"dbName",""),this.key=e,this.version=t}getDBName(){return`${this.key}_${this.version}`}resetDB(){this.dbPromise=null,this.dbName=""}openDB(){const e=this.getDBName();return this.dbPromise&&this.dbName===e?this.dbPromise:(this.dbName=e,this.dbPromise=new Promise((t,r)=>{const n=indexedDB.open(e,1);n.onupgradeneeded=()=>{const o=n.result;o.objectStoreNames.contains(this.storeName)||o.createObjectStore(this.storeName,{keyPath:"id"})},n.onsuccess=()=>{const o=n.result;o.onversionchange=()=>{o.close(),this.resetDB()},o.onclose=()=>{this.resetDB()},t(o)},n.onerror=()=>{r(n.error||new Error(`IdbStore open failed: ${e}`))},n.onblocked=()=>{console.warn(`[IdbStore] open blocked: ${e}`)}}).catch(t=>{throw this.resetDB(),t}),this.dbPromise)}getById(e){return this.openDB().then(t=>new Promise((r,n)=>{const o=t.transaction(this.storeName,"readonly").objectStore(this.storeName).get(e);o.onsuccess=()=>r(o.result),o.onerror=()=>n(o.error)}))}getAll(){return this.openDB().then(e=>new Promise((t,r)=>{const n=e.transaction(this.storeName,"readonly").objectStore(this.storeName);if(ae.default.isFunction(n.getAll)){const l=n.getAll();l.onsuccess=()=>t(l.result||[]),l.onerror=()=>r(l.error);return}const o=[],s=n.openCursor();s.onsuccess=()=>{const l=s.result;l?(o.push(l.value),l.continue()):t(o)},s.onerror=()=>r(s.error)}))}updateById(e,t){return t==null?this.deleteById(e):this.openDB().then(r=>new Promise((n,o)=>{const s=r.transaction(this.storeName,"readwrite");s.objectStore(this.storeName).put({id:e,data:t}),s.oncomplete=()=>n(),s.onerror=()=>o(s.error)}))}deleteById(e){return this.openDB().then(t=>new Promise((r,n)=>{const o=t.transaction(this.storeName,"readwrite");o.objectStore(this.storeName).delete(e),o.oncomplete=()=>r(),o.onerror=()=>n(o.error)}))}clear(){return this.openDB().then(e=>new Promise((t,r)=>{const n=e.transaction(this.storeName,"readwrite");n.objectStore(this.storeName).clear(),n.oncomplete=()=>t(),n.onerror=()=>r(n.error)}))}cleanupOldDBs(){if(!indexedDB.databases)return Promise.resolve();const e=this.getDBName(),t=`${this.key}_`;return indexedDB.databases().then(r=>{r.forEach(n=>{const o=n.name;if(!o||o===e||!o.startsWith(t))return;o.slice(t.length).includes("_")||indexedDB.deleteDatabase(o)})})}},Dr=class{constructor(e,t){E(this,"key"),E(this,"version"),this.key=e,this.version=t}readAll(){const e=ae.default.toStringJSON(localStorage.getItem(this.key)||"");return e&&String(e._v)===String(this.version)?e:{_v:this.version}}writeAll(e){localStorage.setItem(this.key,ae.default.toJSONString(e))}getById(e){const t=this.readAll(),r=Object.prototype.hasOwnProperty.call(t,e);return Promise.resolve(r&&t[e]!=null?{id:e,data:t[e]}:void 0)}getAll(){const e=this.readAll(),t=[];return Object.keys(e).forEach(r=>{r!=="_v"&&e[r]!=null&&t.push({id:r,data:e[r]})}),Promise.resolve(t)}updateById(e,t){if(t==null)return this.deleteById(e);const r=this.readAll();return r[e]=t,this.writeAll(r),Promise.resolve()}deleteById(e){const t=this.readAll();return delete t[e],this.writeAll(t),Promise.resolve()}clear(){return this.writeAll({_v:this.version}),Promise.resolve()}cleanupOldDBs(){const e=localStorage.getItem(this.key);if(!e)return Promise.resolve();const t=ae.default.toStringJSON(e);return(!t||String(t._v)!==String(this.version))&&localStorage.removeItem(this.key),Promise.resolve()}},Wt={createStore(e,t){const r=Object.assign({},t),n=r.version||k.version||0,o=r.driver;return(!o||o==="indexedDB")&&typeof indexedDB!="undefined"?new Pr(e,n):new Dr(e,n)}},Nr=p(f("xe-utils")),Be={};function Rt(e){return Be[e]||(Be[e]=new RegExp(`(?:^|\\s)${e}(?!\\S)`,"g")),Be[e]}function ke(e,t){return e?e.classList?e.classList.contains(t):!!(e.className&&e.className.match&&e.className.match(Rt(t))):!1}function Bt(e,t){e&&ke(e,t)&&(e.className=e.className.replace(Rt(t),""))}var kt={isPx(e){return e&&/^\d+(\.\d+)?(px)?$/.test(e)},isScale(e){return e&&/^\d+(\.\d+)?%$/.test(e)},hasClass:ke,removeClass:Bt,addClass(e,t){e&&!ke(e,t)&&(Bt(e,t),e.className=e.className+" "+t)},buildClass(e,t){const r=[];if(e)for(let n=0;n<e.length;n++){const o=e[n];o&&r.push(""+o)}return Nr.default.each(t,(n,o)=>{n&&r.push(o)}),r.join(" ")}},He={getThumbSize(e,t,r){if(t<=e)return 0;const n=e/t,o=r*n;return Math.max(20,Math.min(o,r))},getThumbOffsetSize(e,t,r,n,o){const s=r-t;if(s<=0)return 0;const l=n-o;return l<=0?0:Math.min(Math.max(e,0),s)/s*l},getScrollFromClick(e,t,r,n,o){const s=n-o,l=r-t;if(l<=0||s<=0)return 0;let w=e-o/2;return w=Math.min(Math.max(w,0),s),w/s*l},getScrollFromDrag(e,t,r,n,o,s){const l=n-r,w=o-s;if(l<=0||w<=0)return 0;let _=e-t;return _=Math.min(Math.max(_,0),w),_/w*l}},U=p(f("xe-utils"));function Ht(e){if(!e)return null;const t=document.body,r=e.parentElement;return(r===t?document.documentElement:r)||null}function At(e){return(e&&U.default.isFunction(e)?e({}):e)||"body"}function Mt(e){const t=At(e);return U.default.isString(t)?document.querySelector(t)||document.body:t}var Vt={updatePlacement(e,t,r){const{defaultTop:n,defaultLeft:o,placement:s,defaultPlacement:l,appendTo:w,teleportTo:_,marginSize:x,isMinWidth:de}=Object.assign({appendTo:"",teleportTo:!1,marginSize:12,isMinWidth:!0},r);let S="bottom",d="",T="",b=0,he="",i="";const u={};if(t&&e){const a=document.body,h=Ht(_?Mt(w):t);if(h){const c=e.offsetWidth,m=e.offsetHeight,v=t.offsetWidth,g=t.offsetHeight,P=h.getBoundingClientRect(),me=t.getBoundingClientRect(),nr=e.getBoundingClientRect(),Me=a.clientHeight,ge=a.clientWidth,Rr=h.scrollLeft,Br=h.scrollTop,kr=P.left,Hr=P.top,M=nr.left,D=nr.top;he=e.offsetWidth,_?(b=(o||M-(v-c)/2)-Rr,d=(n||D+m)-Br,s==="top"?(S="top",d=D-g):s||(l==="top"?(S="top",n||(d=D-g),d<x&&(S="bottom",d=D+m),d+g+x>Me&&(S="top",d=D-g)):(d+g+x>Me&&(S="top",d=D-g),d<x&&(S="bottom",d=D+m))),b+v+x>ge&&(b-=b+v+x-ge),b<x&&(b=x),d-=Hr,b-=kr):(s==="top"?(S="top",T=m):s||(d=m,D+m+g+x>Me&&D-m-g>x&&(S="top",d="",T=m)),me.left+me.width+x>ge&&(b=-(me.left+me.width+x-ge))),U.default.isNumber(d)&&(u.top=d+"px"),U.default.isNumber(T)&&(u.bottom=T+"px"),U.default.isNumber(b)&&(u.left=b+"px"),de&&U.default.isNumber(he)&&(u.minWidth=he+"px"),b===M?c<=v&&(i=c/2):b<M&&(b+v>M+c?i=M-b+c/2:i=M-b+(v-(M-b))/2)}}return{top:d||0,bottom:T||0,left:b||0,arrowLeft:i||0,style:u,placement:S}},getWrapperElement:Ht,getAppendSelector:At,getAppendElement:Mt},jt=new Ot,Lr=p(f("xe-utils")),O=f("vue"),{getThumbOffsetSize:ce,getThumbSize:zt,getScrollFromClick:Ft,getScrollFromDrag:Xt}=He;function Ut(e){const t=(0,O.inject)("xeSizeInfo",null),r=(0,O.computed)(()=>{const{size:n}=e;return n||(t?t.value:null)});return(0,O.provide)("xeSizeInfo",r),{computeSize:r}}function Yt(e){return{computePermissionInfo:(0,O.computed)(()=>re(e.permissionCode,e.permissionMethod))}}function $t(e){const t=(0,O.inject)("xeScrollbarInfo",null),r=(0,O.computed)(()=>{const{useScrollbar:n}=e;return Lr.default.isBoolean(n)?n:t?t.value:null});return(0,O.provide)("xeScrollbarInfo",r),{computeIsVScrollbar:r}}var qt=e=>{const{reactData:t,internalData:r}=e,n=(0,O.ref)(),o=(0,O.ref)(),s=(0,O.ref)(),l=(0,O.ref)();return{refTrackXElem:n,refTrackYElem:o,refThumbXElem:s,refThumbYElem:l,updateThumbSize:()=>{const i=e.getScrollViewElem();if(!i||!i.clientHeight||!i.clientHeight)return;const u=n.value,a=u?zt(i.clientWidth,i.scrollWidth,u.clientWidth):0,h=s.value;h&&(h.style.width=a+"px"),t.xThumbWidth=a;const c=o.value,m=c?zt(i.clientHeight,i.scrollHeight,c.clientHeight):0,v=l.value;v&&(v.style.height=m+"px"),t.yThumbHeight=m},updateThumbOffset:()=>{const i=e.getScrollViewElem();if(!i||!i.clientHeight||!i.clientHeight)return;const{xThumbWidth:u,yThumbHeight:a}=t,h=n.value,c=s.value,m=h&&u?ce(i.scrollLeft,i.clientWidth,i.scrollWidth,h.clientWidth,u):0;r.xThumbLeft=m,c&&u&&(c.style.width=u+"px",c.style.transform=`translateX(${m}px)`);const v=o.value,g=l.value,P=v&&a?ce(i.scrollTop,i.clientHeight,i.scrollHeight,v.clientHeight,a):0;r.yThumbTop=P,g&&a&&(g.style.height=a+"px",g.style.transform=`translateY(${P}px)`)},clickTrackXEvent:i=>{const u=i.currentTarget;if(u!==i.target)return;const a=e.getScrollViewElem();if(!a)return;const{xThumbWidth:h}=t,c=u.getBoundingClientRect();a.scrollTo({left:Ft(i.clientX-c.left,a.clientWidth,a.scrollWidth,u.clientWidth,h),behavior:"auto"})},clickTrackYEvent:i=>{const u=i.currentTarget;if(u!==i.target)return;const a=e.getScrollViewElem();if(!a)return;const{yThumbHeight:h}=t,c=u.getBoundingClientRect();a.scrollTo({top:Ft(i.clientY-c.top,a.clientHeight,a.scrollHeight,u.clientHeight,h),behavior:"auto"})},pointerdownThumbXEvent:i=>{const u=i.currentTarget;r.isThumbDrag=!0,u.setPointerCapture(i.pointerId);const a=e.getScrollViewElem();if(!a)return;const{xThumbWidth:h}=t,c=u.parentElement,m=c.getBoundingClientRect(),v=i.clientX-m.left,g=ce(a.scrollLeft,a.clientWidth,a.scrollWidth,c.clientWidth,h);r.thumbDragOffset=v-g},pointermoveThumbXEvent:i=>{if(!i.currentTarget.hasPointerCapture(i.pointerId))return;const{isThumbDrag:a,thumbDragOffset:h}=r;if(a){const c=e.getScrollViewElem();if(!c)return;const{xThumbWidth:m}=t,g=i.currentTarget.parentElement,P=g.getBoundingClientRect();c.scrollLeft=Xt(i.clientX-P.left,h,c.clientWidth,c.scrollWidth,g.clientWidth,m)}},cleatPointerThumbEvent:i=>{i.currentTarget.releasePointerCapture(i.pointerId),r.isThumbDrag=!1},pointerdownThumbYEvent:i=>{const u=i.currentTarget;r.isThumbDrag=!0,u.setPointerCapture(i.pointerId);const a=e.getScrollViewElem();if(!a)return;const{yThumbHeight:h}=t,c=u.parentElement,m=c.getBoundingClientRect(),v=i.clientY-m.top,g=ce(a.scrollTop,a.clientHeight,a.scrollHeight,c.clientHeight,h);r.thumbDragOffset=v-g},pointermoveThumbYEvent:i=>{if(!i.currentTarget.hasPointerCapture(i.pointerId))return;const{isThumbDrag:a,thumbDragOffset:h}=r;if(a){const c=e.getScrollViewElem();if(!c)return;const{yThumbHeight:m}=t,g=i.currentTarget.parentElement,P=g.getBoundingClientRect();c.scrollTop=Xt(i.clientY-P.top,h,c.clientHeight,c.scrollHeight,g.clientHeight,m)}}}},Kt={useSize:Ut,useVScrollbar:$t,usePermission:Yt,useInitVScrollbar:qt},Ae=p(f("xe-utils")),Gt=[];function Jt(e,t){return e&&e.install&&Gt.indexOf(e)===-1&&(e.install(fe,t),Gt.push(e)),fe}var ue={};function Zt(e){return ue[e]||null}function Qt(e){return!!ue[e]}function er(e){e&&e.name&&(ue[e.name]=e,ue[Ae.default.kebabCase(e.name)]=e)}function tr(){return(0,dr.createCommentVNode)()}function rr(e,t,r){if(e){const n=`${e}`.match(/(\d+).(\d+).(\d+)/);if(n){const o=Ae.default.toNumber(n[1]);if(r){const s=Ae.default.toNumber(n[2]);return o>=t&&s>=r}return o>=t}}return!1}var fe=Object.assign(N,{renderEmptyElement:tr,setTheme:oe,getTheme:nt,setConfig:ot,getConfig:st,setIcon:ct,getIcon:ye,renderGlobalIcon:ut,renderCustomIcon:Ie,setLanguage:St,hasLanguage:Tt,getLanguage:yt,setI18n:_t,getI18n:Pe,globalEvents:gt,GLOBAL_EVENT_KEYS:W,createEvent:mt,globalResize:Et,renderer:A,validators:Ne,menus:Le,formats:We,commands:Re,interceptor:ee,clipboard:Ct,log:I,permission:Pt,zIndex:Dt,baseUtils:Lt,dbUtils:Wt,domUtils:kt,scrollbarUtils:He,popperUtils:Vt,globalStore:it,hooks:jt,component:er,getComponent:Zt,hasComponent:Qt,useFns:Kt,getSlotVNs:Te,checkVersion:rr,use:Jt});oe();var Wr=fe;return be.exports});
|
|
1
|
+
(function(B,$){typeof module=="object"&&typeof module.exports=="object"?module.exports=$(require("vue"),require("xe-utils")):typeof define=="function"&&define.amd?define(["vue","xe-utils"],$):(B=typeof globalThis!="undefined"?globalThis:B||self,B.VxeUI=$(B.Vue,B.XEUtils))})(this,function(B,$){var be={vue:B,"xe-utils":$},f=function(e){return be[e]!==void 0?be[e]:typeof window!="undefined"&&window[e]?window[e]:typeof globalThis!="undefined"&&globalThis[e]?globalThis[e]:be[e]},ve={exports:{}},Ar=ve.exports,sr=Object.create,q=Object.defineProperty,ir=Object.getOwnPropertyDescriptor,lr=Object.getOwnPropertyNames,ar=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty,ur=(e,t,r)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fr=(e,t)=>{for(var r in t)q(e,r,{get:t[r],enumerable:!0})},je=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of lr(t))!cr.call(e,o)&&o!==r&&q(e,o,{get:()=>t[o],enumerable:!(n=ir(t,o))||n.enumerable});return e},p=(e,t,r)=>(r=e!=null?sr(ar(e)):{},je(t||!e||!e.__esModule?q(r,"default",{value:e,enumerable:!0}):r,e)),dr=e=>je(q({},"__esModule",{value:!0}),e),E=(e,t,r)=>ur(e,typeof t!="symbol"?t+"":t,r),ze={};fr(ze,{GLOBAL_EVENT_KEYS:()=>R,VxeCore:()=>L,VxeUI:()=>de,baseUtils:()=>Wt,checkVersion:()=>nr,clipboard:()=>Pt,commands:()=>Be,component:()=>tr,coreVersion:()=>Fe,createEvent:()=>gt,dbUtils:()=>Rt,default:()=>Rr,domUtils:()=>Ht,formats:()=>Re,getComponent:()=>Qt,getConfig:()=>it,getI18n:()=>De,getIcon:()=>Ie,getLanguage:()=>It,getSlotVNs:()=>ye,getTheme:()=>ot,globalEvents:()=>pt,globalResize:()=>xt,globalStore:()=>lt,handleCheckInfo:()=>ne,hasComponent:()=>er,hasLanguage:()=>yt,hooks:()=>zt,interceptor:()=>te,log:()=>I,menus:()=>We,permission:()=>Dt,popperUtils:()=>jt,renderCustomIcon:()=>Oe,renderEmptyElement:()=>rr,renderGlobalIcon:()=>ft,renderer:()=>M,scrollbarUtils:()=>Ae,setConfig:()=>st,setI18n:()=>Tt,setIcon:()=>ut,setLanguage:()=>_t,setTheme:()=>se,use:()=>Zt,useFns:()=>Gt,useInitVScrollbar:()=>Kt,usePermission:()=>$t,useSize:()=>Yt,useVScrollbar:()=>qt,validators:()=>Le,zIndex:()=>Nt}),ve.exports=dr(ze);var Fe="4.5.10",L={coreVersion:Fe,uiVersion:"",tableVersion:"",designVersion:"",ganttVersion:""},hr=f("vue"),Xe=p(f("xe-utils")),j=null,Ee=null,W=null,Ue="z-index-manage",k=null,Ye="z-index-style",$e="m",qe="s",K={m:1e3,s:1e3};function xe(){return j||typeof document!="undefined"&&(j=document),j}function Ke(){return j&&!Ee&&(Ee=j.body||j.getElementsByTagName("body")[0]),Ee}function mr(){let e=0;if(xe()){const r=Ke();if(r){const n=r.getElementsByTagName("*");for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.style&&s.nodeType===1){const l=s.style.zIndex;l&&/^\d+$/.test(l)&&(e=Math.max(e,Number(l)))}}}}return e}function gr(){if(!k){const e=xe();e&&(k=e.getElementById(Ye),k||(k=e.createElement("style"),k.id=Ye,e.getElementsByTagName("head")[0].appendChild(k)))}return k}function Ge(){const e=gr();if(e){const t="--dom-",r="-z-index";e.innerHTML=":root{"+t+"main"+r+":"+oe()+";"+t+"sub"+r+":"+_e()+"}"}}function Je(){if(!W){const e=xe();if(e&&(W=e.getElementById(Ue),!W)){const t=Ke();t&&(W=e.createElement("div"),W.id=Ue,W.style.display="none",t.appendChild(W),we(K.m),Se(K.s))}}return W}function Ze(e){return function(t){if(t){t=Number(t),K[e]=t;const r=Je();r&&(r.dataset?r.dataset[e]=t+"":r.setAttribute("data-"+e,t+""))}return Ge(),K[e]}}var we=Ze($e);function Qe(e,t){return function(n){let o;const s=Je();if(s){const l=s.dataset?s.dataset[e]:s.getAttribute("data-"+e);l&&(o=Number(l))}return o||(o=K[e]),n?Number(n)<o?t():n:o}}var oe=Qe($e,et);function et(){return we(oe()+1)}var Se=Ze(qe),tt=Qe(qe,rt);function _e(){return oe()+tt()}function rt(){return Se(tt()+1),_e()}var pr={setCurrent:we,getCurrent:oe,getNext:et,setSubCurrent:Se,getSubCurrent:_e,getSubNext:rt,getMax:mr};Ge();var G=pr,H={size:"",version:1,zIndex:999,resizeInterval:500},nt={theme:""};function se(e){const t=!e||e==="default"?"light":e;if(nt.theme=t,typeof document!="undefined"){const r=document.documentElement;r&&r.setAttribute("data-vxe-ui-theme",t)}return L}function ot(){return nt.theme}function st(e){return e&&(e.zIndex&&G.setCurrent(e.zIndex),e.theme&&se(e.theme),Xe.default.merge(H,e)),L}function it(e,t){return arguments.length?Xe.default.get(H,e,t):H}var lt={},at=f("vue"),ct=p(f("xe-utils")),Te={},br=p(f("xe-utils"));function ye(e){return br.default.isArray(e)?e:e?[e]:[]}function ut(e){return e&&Object.assign(Te,e),L}function Ie(e){return arguments.length?ct.default.get(Te,e):Te}function ft(e){const t=Ie(e);return Oe(t,e)}function Oe(e,t){return ct.default.isFunction(e)?(0,at.h)("span",{},ye(e({name:t}))):(0,at.h)("i",{class:e})}var J=p(f("xe-utils")),R={F2:"F2",F10:"F10",TAB:"Tab",ESCAPE:"Escape",ENTER:"Enter",DELETE:"Delete",BACKSPACE:"Backspace",SPACEBAR:" ",CONTEXT_MENU:"ContextMenu",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",HOME:"Home",END:"End",PROCESS:"Process",A:"A",X:"X",C:"C",V:"V",D:"D",F:"F",H:"H",M:"M",Y:"Y",Z:"Z",R:"R",P:"P"},Ce=J.default.browse(),dt={" ":"Spacebar",Apps:R.CONTEXT_MENU,Del:R.DELETE,Up:R.ARROW_UP,Down:R.ARROW_DOWN,Left:R.ARROW_LEFT,Right:R.ARROW_RIGHT},ht=Ce.firefox?"DOMMouseScroll":"mousewheel",Pe=[];function y(e){const t=e.type===ht;Pe.forEach(({type:r,cb:n})=>{e.cancelBubble||(r===e.type||t&&r==="mousewheel")&&n(e)})}var mt=class{constructor(e,t,r){E(this,"$event"),E(this,"type",""),E(this,"key",""),E(this,"code",""),this.$event=e,e&&(e.type&&(this.type=e.type),e.key&&(this.key=e.key),e.code&&(this.code=e.code)),Object.assign(this,t),J.default.objectEach(r,(n,o)=>{if(J.default.isFunction(n)){let s=null,l=!1;Object.defineProperty(this,o,{get(){return l||(l=!0,s=n()),s}})}else this[o]=n})}stopPropagation(){const e=this.$event;e&&e.stopPropagation()}preventDefault(){const e=this.$event;e&&e.preventDefault()}},gt=(e,t,r)=>(e instanceof mt&&(e=e.$event),new mt(e,t,r)),pt={on(e,t,r){Pe.push({comp:e,type:t,cb:r})},off(e,t){J.default.remove(Pe,r=>r.comp===e&&r.type===t)},hasKey(e,t){if(!t)return!1;const{key:r}=e;return t=t.toLowerCase(),r?t===r.toLowerCase()||!!(dt[r]&&dt[r].toLowerCase()===t):!1},hasControlKey(e){return e.ctrlKey||e.metaKey}};Ce.isDoc&&(Ce.msie||(window.addEventListener("copy",y,!1),window.addEventListener("cut",y,!1),window.addEventListener("paste",y,!1)),document.addEventListener("scroll",y,!0),document.addEventListener("keydown",y,!1),document.addEventListener("contextmenu",y,!1),window.addEventListener("mousedown",y,!1),window.addEventListener("click",y,!1),window.addEventListener("blur",y,!1),window.addEventListener("resize",y,!1),window.addEventListener(ht,J.default.throttle(y,100,{leading:!0,trailing:!1}),{passive:!0,capture:!1}));var bt=p(f("xe-utils")),vt,A=[],vr=500;function Er(){A.length&&(A.forEach(e=>{e.tarList.forEach(t=>{const{target:r,width:n,heighe:o}=t,s=r.clientWidth,l=r.clientHeight;(s&&n!==s||l&&o!==l)&&(t.width=s,t.heighe=l,setTimeout(e.callback))})}),Et())}function Et(){clearTimeout(vt),vt=setTimeout(Er,H.resizeInterval||vr)}var xr=class{constructor(e){E(this,"tarList",[]),E(this,"callback"),this.callback=e}observe(e){if(e){const{tarList:t}=this;t.some(r=>r.target===e)||t.push({target:e,width:e.clientWidth,heighe:e.clientHeight}),A.length||Et(),A.some(r=>r===this)||A.push(this)}}unobserve(e){bt.default.remove(A,t=>t.tarList.some(r=>r.target===e))}disconnect(){bt.default.remove(A,e=>e===this)}},xt={create(e){return window.ResizeObserver?new window.ResizeObserver(e):new xr(e)}},wt=p(f("xe-utils")),wr=f("vue"),z=(0,wr.reactive)({language:"",langMaps:{}}),St=!1,ie={};function Sr(e){return e&&e.__esModule?e.default:e}function De(e,t){const{langMaps:r,language:n}=z,{i18n:o}=H;if(o)return`${o(e,t)||""}`;if(St||(r[n]||console.error(`[vxe core] 语言包未安装。Language not installed. https://${L.uiVersion?"vxeui.com":"vxetable.cn"}/#/start/i18n`),St=!0),!t&&ie[e])return ie[e];const s=wt.default.toFormatString(wt.default.get(r[n],e,e),t);return t||(ie[e]=s),s}function _t(e){const{language:t}=z,r=e||"zh-CN";return t!==r&&(z.language=r,ie={}),L}function Tt(e,t){return z.langMaps[e]=Object.assign({},Sr(t)),L}function yt(e){const{langMaps:t}=z;return!!t[e]}function It(){const{language:e}=z;return e}var le=p(f("xe-utils"));function Ne(e,t){return function(r,n){const o=`[vxe ${t||""}] ${De(r,n)}`;return console[e](o),o}}var Ot="4.5.10",I={create:Ne,warn:Ne("warn",`v${Ot}`),err:Ne("error",`v${Ot}`)},Z={},M={mixin(e){return le.default.each(e,(t,r)=>{M.add(r,t)}),M},get(e){return Z[e]||null},add(e,t){if(e&&t){const r=Z[e];r?(le.default.each(t,(n,o)=>{!le.default.eqNull(r[o])&&r[o]!==n&&I.warn("vxe.error.coverProp",[`Renderer.${e}`,o])}),Object.assign(r,t)):Z[e]=t}return M},forEach(e){return le.default.objectEach(Z,e),M},delete(e){return delete Z[e],M}},Q=p(f("xe-utils")),_r=class{constructor(){E(this,"store",{})}mixin(e){return Q.default.each(e,(t,r)=>{this.add(r,t)}),this}has(e){return!!this.get(e)}get(e){return this.store[e]}add(e,t){const r=this.store[e],n=Q.default.keys(r);return Q.default.each(t,(o,s)=>{n.includes(s)&&I.warn("vxe.error.coverProp",[e,s])}),this.store[e]=r?Q.default.merge(r,t):t,this}delete(e){delete this.store[e]}forEach(e){Q.default.objectEach(this.store,e)}},Ct=_r,Le=new Ct;Object.assign(Le,{_name:"Validators"});var F=p(f("xe-utils")),Tr=class{constructor(){E(this,"store",{})}mixin(e){return F.default.each(e,(t,r)=>{this.add(r,t)}),this}has(e){return!!this.get(e)}get(e){return this.store[e]}add(e,t){const r=this.store[e];F.default.isFunction(t)&&(I.warn("vxe.error.delProp",["menus -> callback","menuMethod"]),t={menuMethod:t});const n=F.default.keys(r);return F.default.each(t,(o,s)=>{n.includes(s)&&I.warn("vxe.error.coverProp",[e,s])}),this.store[e]=r?F.default.merge(r,t):t,this}delete(e){delete this.store[e]}forEach(e){F.default.objectEach(this.store,e)}},We=new Tr;Object.assign(We,{_name:"Menus"});var X=p(f("xe-utils")),yr=class{constructor(){E(this,"store",{})}mixin(e){return X.default.each(e,(t,r)=>{this.add(r,t)}),this}has(e){return!!this.get(e)}get(e){return this.store[e]}add(e,t){const r=this.store[e];X.default.isFunction(t)&&(I.warn("vxe.error.delProp",["formats -> callback","cellFormatMethod"]),t={cellFormatMethod:t});const n=X.default.keys(r);return X.default.each(t,(o,s)=>{n.includes(s)&&I.warn("vxe.error.coverProp",[e,s])}),this.store[e]=r?X.default.merge(r,t):t,this}delete(e){delete this.store[e]}forEach(e){X.default.objectEach(this.store,e)}},Re=new yr;Object.assign(Re,{_name:"Formats"});var U=p(f("xe-utils")),Ir=class{constructor(){E(this,"store",{})}mixin(e){return U.default.each(e,(t,r)=>{this.add(r,t)}),this}has(e){return!!this.get(e)}get(e){return this.store[e]}add(e,t){const r=this.store[e];U.default.isFunction(t)&&(I.warn("vxe.error.delProp",["commands -> callback","commandMethod"]),t={commandMethod:t});const n=U.default.keys(r);return U.default.each(t,(o,s)=>{n.includes(s)&&I.warn("vxe.error.coverProp",[e,s])}),this.store[e]=r?U.default.merge(r,t):t,this}delete(e){delete this.store[e]}forEach(e){U.default.objectEach(this.store,e)}},Be=new Ir;Object.assign(Be,{_name:"Commands"});var ae=p(f("xe-utils")),ee={},te={mixin(e){return ae.default.each(e,(t,r)=>{te.add(r,t)}),te},get(e){return e?ee[e]||[]:[]},add(e,t){ae.default.isFunction(t)&&(t={tableInterceptorMethod:t});const r=t.tableInterceptorMethod;if(r){let n=ee[e];n||(n=ee[e]=[]),n.indexOf(r)>-1&&I.warn("vxe.error.coverProp",["Interceptor",e]),n.push(r)}return te},delete(e,t){const r=ee[e];if(r){ae.default.isFunction(t)&&(t={tableInterceptorMethod:t});const n=t?t.tableInterceptorMethod:null;n?ae.default.remove(r,o=>o===n):delete ee[e]}}},Or=p(f("xe-utils")),C,re={text:"",html:""};function Cr(e){if(!C){C=document.createElement("textarea"),C.id="$VxeCopy";const t=C.style;t.width="48px",t.height="24px",t.position="fixed",t.zIndex="0",t.left="-500px",t.top="-500px",document.body.appendChild(C)}C.value=e}var Pt={getStore(){return re},setStore(e){Object.assign(re,e||{})},copy(e){let t=!1;try{const r=Or.default.toValueString(e);Cr(r),C.select(),C.setSelectionRange(0,C.value.length),t=document.execCommand("copy"),C.blur(),re.text=r,re.html=""}catch(r){}return t},getText(){return re.text||""}},Pr=p(f("xe-utils"));function ne(e,t){let r=!0,n=!1;const o=t||H.permissionMethod;if(e&&o){r=!1,n=!0;let l=!1,w=!1;const _=String(e).split("|");for(let x=0;x<_.length;x++){const he=_[x];let S=!0,d=!1;const T=o({code:he});if(Pr.default.isBoolean(T)?S=T:T&&(S=!!T.visible,d=!!T.disabled),!d&&!w&&(w=!0,n=d),S&&!l&&(l=!0,r=S),l&&w)break}}return{code:e,visible:r,disabled:n}}var Dt={getCheckInfo(e){return ne(e)},checkVisible(e){return ne(e).visible},checkDisable(e){return ne(e).disabled}},Nt={next(){return G.getNext()},getLast(){return G.getCurrent()},nextSub(){return G.getSubNext()},getSubLast(){return G.getSubCurrent()}},Lt=p(f("xe-utils")),Wt={getStrVal(e){return Lt.default.eqNull(e)?"":""+e},isEmptyVal(e){return e==null||e===""},getDefVal(e,t){return Lt.default.eqNull(e)?t:e},isEnabled(e){return!!(e&&e.enabled!==!1)},hasEnableConf(e,t){return!!(t&&(e?t.enabled!==!1:t.enabled))}},ce=p(f("xe-utils")),Dr=class{constructor(e,t){E(this,"storeName","vxe_storage"),E(this,"key"),E(this,"version"),E(this,"dbPromise",null),E(this,"dbName",""),this.key=e,this.version=t}getDBName(){return`${this.key}_${this.version}`}resetDB(){this.dbPromise=null,this.dbName=""}openDB(){const e=this.getDBName();return this.dbPromise&&this.dbName===e?this.dbPromise:(this.dbName=e,this.dbPromise=new Promise((t,r)=>{const n=indexedDB.open(e,1);n.onupgradeneeded=()=>{const o=n.result;o.objectStoreNames.contains(this.storeName)||o.createObjectStore(this.storeName,{keyPath:"id"})},n.onsuccess=()=>{const o=n.result;o.onversionchange=()=>{o.close(),this.resetDB()},o.onclose=()=>{this.resetDB()},t(o)},n.onerror=()=>{r(n.error||new Error(`IdbStore open failed: ${e}`))},n.onblocked=()=>{console.warn(`[IdbStore] open blocked: ${e}`)}}).catch(t=>{throw this.resetDB(),t}),this.dbPromise)}getById(e){return this.openDB().then(t=>new Promise((r,n)=>{const o=t.transaction(this.storeName,"readonly").objectStore(this.storeName).get(e);o.onsuccess=()=>r(o.result),o.onerror=()=>n(o.error)}))}getAll(){return this.openDB().then(e=>new Promise((t,r)=>{const n=e.transaction(this.storeName,"readonly").objectStore(this.storeName);if(ce.default.isFunction(n.getAll)){const l=n.getAll();l.onsuccess=()=>t(l.result||[]),l.onerror=()=>r(l.error);return}const o=[],s=n.openCursor();s.onsuccess=()=>{const l=s.result;l?(o.push(l.value),l.continue()):t(o)},s.onerror=()=>r(s.error)}))}updateById(e,t){return t==null?this.deleteById(e):this.openDB().then(r=>new Promise((n,o)=>{const s=r.transaction(this.storeName,"readwrite");s.objectStore(this.storeName).put({id:e,data:t}),s.oncomplete=()=>n(),s.onerror=()=>o(s.error)}))}deleteById(e){return this.openDB().then(t=>new Promise((r,n)=>{const o=t.transaction(this.storeName,"readwrite");o.objectStore(this.storeName).delete(e),o.oncomplete=()=>r(),o.onerror=()=>n(o.error)}))}clear(){return this.openDB().then(e=>new Promise((t,r)=>{const n=e.transaction(this.storeName,"readwrite");n.objectStore(this.storeName).clear(),n.oncomplete=()=>t(),n.onerror=()=>r(n.error)}))}cleanupOldDBs(){if(!indexedDB.databases)return Promise.resolve();const e=this.getDBName(),t=`${this.key}_`;return indexedDB.databases().then(r=>{r.forEach(n=>{const o=n.name;if(!o||o===e||!o.startsWith(t))return;o.slice(t.length).includes("_")||indexedDB.deleteDatabase(o)})})}},Nr=class{constructor(e,t){E(this,"key"),E(this,"version"),this.key=e,this.version=t}readAll(){const e=ce.default.toStringJSON(localStorage.getItem(this.key)||"");return e&&String(e._v)===String(this.version)?e:{_v:this.version}}writeAll(e){localStorage.setItem(this.key,ce.default.toJSONString(e))}getById(e){const t=this.readAll(),r=Object.prototype.hasOwnProperty.call(t,e);return Promise.resolve(r&&t[e]!=null?{id:e,data:t[e]}:void 0)}getAll(){const e=this.readAll(),t=[];return Object.keys(e).forEach(r=>{r!=="_v"&&e[r]!=null&&t.push({id:r,data:e[r]})}),Promise.resolve(t)}updateById(e,t){if(t==null)return this.deleteById(e);const r=this.readAll();return r[e]=t,this.writeAll(r),Promise.resolve()}deleteById(e){const t=this.readAll();return delete t[e],this.writeAll(t),Promise.resolve()}clear(){return this.writeAll({_v:this.version}),Promise.resolve()}cleanupOldDBs(){const e=localStorage.getItem(this.key);if(!e)return Promise.resolve();const t=ce.default.toStringJSON(e);return(!t||String(t._v)!==String(this.version))&&localStorage.removeItem(this.key),Promise.resolve()}},Rt={createStore(e,t){const r=Object.assign({},t),n=r.version||H.version||0,o=r.driver;return(!o||o==="indexedDB")&&typeof indexedDB!="undefined"?new Dr(e,n):new Nr(e,n)}},Lr=p(f("xe-utils")),ke={};function Bt(e){return ke[e]||(ke[e]=new RegExp(`(?:^|\\s)${e}(?!\\S)`,"g")),ke[e]}function He(e,t){return e?e.classList?e.classList.contains(t):!!(e.className&&e.className.match&&e.className.match(Bt(t))):!1}function kt(e,t){e&&He(e,t)&&(e.className=e.className.replace(Bt(t),""))}var Ht={isPx(e){return e&&/^\d+(\.\d+)?(px)?$/.test(e)},isScale(e){return e&&/^\d+(\.\d+)?%$/.test(e)},hasClass:He,removeClass:kt,addClass(e,t){e&&!He(e,t)&&(kt(e,t),e.className=e.className+" "+t)},buildClass(e,t){const r=[];if(e)for(let n=0;n<e.length;n++){const o=e[n];o&&r.push(""+o)}return Lr.default.each(t,(n,o)=>{n&&r.push(o)}),r.join(" ")}},Ae={getThumbSize(e,t,r){if(t<=e)return 0;const n=e/t,o=r*n;return Math.max(20,Math.min(o,r))},getThumbOffsetSize(e,t,r,n,o){const s=r-t;if(s<=0)return 0;const l=n-o;return l<=0?0:Math.min(Math.max(e,0),s)/s*l},getScrollFromClick(e,t,r,n,o){const s=n-o,l=r-t;if(l<=0||s<=0)return 0;let w=e-o/2;return w=Math.min(Math.max(w,0),s),w/s*l},getScrollFromDrag(e,t,r,n,o,s){const l=n-r,w=o-s;if(l<=0||w<=0)return 0;let _=e-t;return _=Math.min(Math.max(_,0),w),_/w*l}},Y=p(f("xe-utils"));function At(e){if(!e)return null;const t=document.body,r=e.parentElement;return(r===t?document.documentElement:r)||null}function Mt(e){return(e&&Y.default.isFunction(e)?e({}):e)||"body"}function Vt(e){const t=Mt(e);return Y.default.isString(t)?document.querySelector(t)||document.body:t}var jt={updatePlacement(e,t,r){const{defaultTop:n,defaultLeft:o,placement:s,defaultPlacement:l,appendTo:w,teleportTo:_,marginSize:x,isMinWidth:he}=Object.assign({appendTo:"",teleportTo:!1,marginSize:12,isMinWidth:!0},r);let S="bottom",d="",T="",b=0,me="",i="";const u={};if(t&&e){const a=document.documentElement,h=At(_?Vt(w):t);if(h){const c=e.offsetWidth,m=e.offsetHeight,v=t.offsetWidth,g=t.offsetHeight,P=h.getBoundingClientRect(),ge=t.getBoundingClientRect(),or=e.getBoundingClientRect(),Ve=a.clientHeight,pe=a.clientWidth,Br=h.scrollLeft,D=h.scrollTop,kr=P.left,Hr=P.top,V=or.left,N=or.top;me=e.offsetWidth,_?(b=(o||V-(v-c)/2)-Br,d=(n||N+m)-D,s==="top"?(S="top",d=N-g):s||(l==="top"?(S="top",n||(d=N-g),d<x-D&&(S="bottom",d=N+m-D),d+g+x>Ve-D&&(S="top",d=N-g-D)):(d+g+x>Ve-D&&(S="top",d=N-g-D),d<x-D&&(S="bottom",d=N+m-D))),b+v+x>pe&&(b-=b+v+x-pe),b<x&&(b=x),d-=Hr,b-=kr):(s==="top"?(S="top",T=m):s||(d=m,N+m+g+x>Ve&&N-m-g>x&&(S="top",d="",T=m)),ge.left+ge.width+x>pe&&(b=-(ge.left+ge.width+x-pe))),Y.default.isNumber(d)&&(u.top=d+"px"),Y.default.isNumber(T)&&(u.bottom=T+"px"),Y.default.isNumber(b)&&(u.left=b+"px"),he&&Y.default.isNumber(me)&&(u.minWidth=me+"px"),b===V?c<=v&&(i=c/2):b<V&&(b+v>V+c?i=V-b+c/2:i=V-b+(v-(V-b))/2)}}return{top:d||0,bottom:T||0,left:b||0,arrowLeft:i||0,style:u,placement:S}},getWrapperElement:At,getAppendSelector:Mt,getAppendElement:Vt},zt=new Ct,Wr=p(f("xe-utils")),O=f("vue"),{getThumbOffsetSize:ue,getThumbSize:Ft,getScrollFromClick:Xt,getScrollFromDrag:Ut}=Ae;function Yt(e){const t=(0,O.inject)("xeSizeInfo",null),r=(0,O.computed)(()=>{const{size:n}=e;return n||(t?t.value:null)});return(0,O.provide)("xeSizeInfo",r),{computeSize:r}}function $t(e){return{computePermissionInfo:(0,O.computed)(()=>ne(e.permissionCode,e.permissionMethod))}}function qt(e){const t=(0,O.inject)("xeScrollbarInfo",null),r=(0,O.computed)(()=>{const{useScrollbar:n}=e;return Wr.default.isBoolean(n)?n:t?t.value:null});return(0,O.provide)("xeScrollbarInfo",r),{computeIsVScrollbar:r}}var Kt=e=>{const{reactData:t,internalData:r}=e,n=(0,O.ref)(),o=(0,O.ref)(),s=(0,O.ref)(),l=(0,O.ref)();return{refTrackXElem:n,refTrackYElem:o,refThumbXElem:s,refThumbYElem:l,updateThumbSize:()=>{const i=e.getScrollViewElem();if(!i||!i.clientHeight||!i.clientHeight)return;const u=n.value,a=u?Ft(i.clientWidth,i.scrollWidth,u.clientWidth):0,h=s.value;h&&(h.style.width=a+"px"),t.xThumbWidth=a;const c=o.value,m=c?Ft(i.clientHeight,i.scrollHeight,c.clientHeight):0,v=l.value;v&&(v.style.height=m+"px"),t.yThumbHeight=m},updateThumbOffset:()=>{const i=e.getScrollViewElem();if(!i||!i.clientHeight||!i.clientHeight)return;const{xThumbWidth:u,yThumbHeight:a}=t,h=n.value,c=s.value,m=h&&u?ue(i.scrollLeft,i.clientWidth,i.scrollWidth,h.clientWidth,u):0;r.xThumbLeft=m,c&&u&&(c.style.width=u+"px",c.style.transform=`translateX(${m}px)`);const v=o.value,g=l.value,P=v&&a?ue(i.scrollTop,i.clientHeight,i.scrollHeight,v.clientHeight,a):0;r.yThumbTop=P,g&&a&&(g.style.height=a+"px",g.style.transform=`translateY(${P}px)`)},clickTrackXEvent:i=>{const u=i.currentTarget;if(u!==i.target)return;const a=e.getScrollViewElem();if(!a)return;const{xThumbWidth:h}=t,c=u.getBoundingClientRect();a.scrollTo({left:Xt(i.clientX-c.left,a.clientWidth,a.scrollWidth,u.clientWidth,h),behavior:"auto"})},clickTrackYEvent:i=>{const u=i.currentTarget;if(u!==i.target)return;const a=e.getScrollViewElem();if(!a)return;const{yThumbHeight:h}=t,c=u.getBoundingClientRect();a.scrollTo({top:Xt(i.clientY-c.top,a.clientHeight,a.scrollHeight,u.clientHeight,h),behavior:"auto"})},pointerdownThumbXEvent:i=>{const u=i.currentTarget;r.isThumbDrag=!0,u.setPointerCapture(i.pointerId);const a=e.getScrollViewElem();if(!a)return;const{xThumbWidth:h}=t,c=u.parentElement,m=c.getBoundingClientRect(),v=i.clientX-m.left,g=ue(a.scrollLeft,a.clientWidth,a.scrollWidth,c.clientWidth,h);r.thumbDragOffset=v-g},pointermoveThumbXEvent:i=>{if(!i.currentTarget.hasPointerCapture(i.pointerId))return;const{isThumbDrag:a,thumbDragOffset:h}=r;if(a){const c=e.getScrollViewElem();if(!c)return;const{xThumbWidth:m}=t,g=i.currentTarget.parentElement,P=g.getBoundingClientRect();c.scrollLeft=Ut(i.clientX-P.left,h,c.clientWidth,c.scrollWidth,g.clientWidth,m)}},cleatPointerThumbEvent:i=>{i.currentTarget.releasePointerCapture(i.pointerId),r.isThumbDrag=!1},pointerdownThumbYEvent:i=>{const u=i.currentTarget;r.isThumbDrag=!0,u.setPointerCapture(i.pointerId);const a=e.getScrollViewElem();if(!a)return;const{yThumbHeight:h}=t,c=u.parentElement,m=c.getBoundingClientRect(),v=i.clientY-m.top,g=ue(a.scrollTop,a.clientHeight,a.scrollHeight,c.clientHeight,h);r.thumbDragOffset=v-g},pointermoveThumbYEvent:i=>{if(!i.currentTarget.hasPointerCapture(i.pointerId))return;const{isThumbDrag:a,thumbDragOffset:h}=r;if(a){const c=e.getScrollViewElem();if(!c)return;const{yThumbHeight:m}=t,g=i.currentTarget.parentElement,P=g.getBoundingClientRect();c.scrollTop=Ut(i.clientY-P.top,h,c.clientHeight,c.scrollHeight,g.clientHeight,m)}}}},Gt={useSize:Yt,useVScrollbar:qt,usePermission:$t,useInitVScrollbar:Kt},Me=p(f("xe-utils")),Jt=[];function Zt(e,t){return e&&e.install&&Jt.indexOf(e)===-1&&(e.install(de,t),Jt.push(e)),de}var fe={};function Qt(e){return fe[e]||null}function er(e){return!!fe[e]}function tr(e){e&&e.name&&(fe[e.name]=e,fe[Me.default.kebabCase(e.name)]=e)}function rr(){return(0,hr.createCommentVNode)()}function nr(e,t,r){if(e){const n=`${e}`.match(/(\d+).(\d+).(\d+)/);if(n){const o=Me.default.toNumber(n[1]);if(r){const s=Me.default.toNumber(n[2]);return o>=t&&s>=r}return o>=t}}return!1}var de=Object.assign(L,{renderEmptyElement:rr,setTheme:se,getTheme:ot,setConfig:st,getConfig:it,setIcon:ut,getIcon:Ie,renderGlobalIcon:ft,renderCustomIcon:Oe,setLanguage:_t,hasLanguage:yt,getLanguage:It,setI18n:Tt,getI18n:De,globalEvents:pt,GLOBAL_EVENT_KEYS:R,createEvent:gt,globalResize:xt,renderer:M,validators:Le,menus:We,formats:Re,commands:Be,interceptor:te,clipboard:Pt,log:I,permission:Dt,zIndex:Nt,baseUtils:Wt,dbUtils:Rt,domUtils:Ht,scrollbarUtils:Ae,popperUtils:jt,globalStore:lt,hooks:zt,component:tr,getComponent:Qt,hasComponent:er,useFns:Gt,getSlotVNs:ye,checkVersion:nr,use:Zt});se();var Rr=de;return ve.exports});
|
package/lib/src/core.js
CHANGED
package/lib/src/log.js
CHANGED
package/lib/src/popper-utils.js
CHANGED
|
@@ -73,7 +73,7 @@ const popperUtils = {
|
|
|
73
73
|
let arrowLeft = "";
|
|
74
74
|
const stys = {};
|
|
75
75
|
if (panelElem && targetElem) {
|
|
76
|
-
const
|
|
76
|
+
const domEl = document.documentElement;
|
|
77
77
|
const parentWrapperEl = getWrapperElement(teleportTo ? getAppendElement(appendTo) : panelElem);
|
|
78
78
|
if (parentWrapperEl) {
|
|
79
79
|
const targetWidth = targetElem.offsetWidth;
|
|
@@ -83,8 +83,8 @@ const popperUtils = {
|
|
|
83
83
|
const parentWrapperRect = parentWrapperEl.getBoundingClientRect();
|
|
84
84
|
const panelRect = panelElem.getBoundingClientRect();
|
|
85
85
|
const targetRect = targetElem.getBoundingClientRect();
|
|
86
|
-
const visibleHeight =
|
|
87
|
-
const visibleWidth =
|
|
86
|
+
const visibleHeight = domEl.clientHeight;
|
|
87
|
+
const visibleWidth = domEl.clientWidth;
|
|
88
88
|
const parentWrapperScrollLeft = parentWrapperEl.scrollLeft;
|
|
89
89
|
const parentWrapperScrollTop = parentWrapperEl.scrollTop;
|
|
90
90
|
const parentWrapperOffsetLeft = parentWrapperRect.left;
|
|
@@ -104,22 +104,22 @@ const popperUtils = {
|
|
|
104
104
|
if (!defaultTop) {
|
|
105
105
|
top = targetTop - panelHeight;
|
|
106
106
|
}
|
|
107
|
-
if (top < marginSize) {
|
|
107
|
+
if (top < marginSize - parentWrapperScrollTop) {
|
|
108
108
|
panelPlacement = "bottom";
|
|
109
|
-
top = targetTop + targetHeight;
|
|
109
|
+
top = targetTop + targetHeight - parentWrapperScrollTop;
|
|
110
110
|
}
|
|
111
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
111
|
+
if (top + panelHeight + marginSize > visibleHeight - parentWrapperScrollTop) {
|
|
112
112
|
panelPlacement = "top";
|
|
113
|
-
top = targetTop - panelHeight;
|
|
113
|
+
top = targetTop - panelHeight - parentWrapperScrollTop;
|
|
114
114
|
}
|
|
115
115
|
} else {
|
|
116
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
116
|
+
if (top + panelHeight + marginSize > visibleHeight - parentWrapperScrollTop) {
|
|
117
117
|
panelPlacement = "top";
|
|
118
|
-
top = targetTop - panelHeight;
|
|
118
|
+
top = targetTop - panelHeight - parentWrapperScrollTop;
|
|
119
119
|
}
|
|
120
|
-
if (top < marginSize) {
|
|
120
|
+
if (top < marginSize - parentWrapperScrollTop) {
|
|
121
121
|
panelPlacement = "bottom";
|
|
122
|
-
top = targetTop + targetHeight;
|
|
122
|
+
top = targetTop + targetHeight - parentWrapperScrollTop;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vxe-ui/core",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.10",
|
|
4
4
|
"description": "Vxe UI core library",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -9,11 +9,8 @@
|
|
|
9
9
|
"lint:ox": "oxfmt --check packages/** types/**",
|
|
10
10
|
"esfix": "eslint --fix packages/** types/**",
|
|
11
11
|
"oxfix": "oxfmt packages/** types/** --write",
|
|
12
|
-
"lib
|
|
13
|
-
"
|
|
14
|
-
"lib:old": "npm run lib:pack && npm run lib:modules",
|
|
15
|
-
"lib:new": "node scripts/build-modules.js",
|
|
16
|
-
"lib": "npm run lib:new"
|
|
12
|
+
"lib": "node scripts/build-modules.js",
|
|
13
|
+
"clean:all": "node scripts/clean-all"
|
|
17
14
|
},
|
|
18
15
|
"files": [
|
|
19
16
|
"dist",
|
|
@@ -33,10 +30,9 @@
|
|
|
33
30
|
},
|
|
34
31
|
"dependencies": {
|
|
35
32
|
"dom-zindex": "^1.0.8",
|
|
36
|
-
"xe-utils": "^4.
|
|
33
|
+
"xe-utils": "^4.1.5"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
|
-
"@rollup/plugin-commonjs": "^29.0.0",
|
|
40
36
|
"@types/node": "^20.12.12",
|
|
41
37
|
"@types/resize-observer-browser": "^0.1.11",
|
|
42
38
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
@@ -55,22 +51,11 @@
|
|
|
55
51
|
"eslint-plugin-promise": "^6.1.1",
|
|
56
52
|
"eslint-plugin-vue": "^8.0.3",
|
|
57
53
|
"esbuild": "~0.28.2",
|
|
58
|
-
"gulp": "^4.0.2",
|
|
59
|
-
"gulp-autoprefixer": "^8.0.0",
|
|
60
|
-
"gulp-babel": "^8.0.0",
|
|
61
|
-
"gulp-clean-css": "^4.3.0",
|
|
62
|
-
"gulp-concat": "^2.6.1",
|
|
63
|
-
"gulp-rename": "^2.0.0",
|
|
64
|
-
"gulp-replace": "^1.1.4",
|
|
65
|
-
"gulp-sourcemaps": "^3.0.0",
|
|
66
|
-
"gulp-typescript": "^5.0.1",
|
|
67
|
-
"gulp-uglify": "^3.0.2",
|
|
68
54
|
"oxfmt": "~0.51.0",
|
|
69
55
|
"postcss": "^8.4.38",
|
|
70
56
|
"sass": "~1.101.7",
|
|
71
57
|
"sass-loader": "^14.2.1",
|
|
72
58
|
"sass-embedded": "^1.106.1",
|
|
73
|
-
"rollup": "^4.53.3",
|
|
74
59
|
"typescript": "~5.9.3",
|
|
75
60
|
"vue": "3.4.27"
|
|
76
61
|
},
|
|
@@ -55,7 +55,7 @@ export const popperUtils: VxePopperUtils = {
|
|
|
55
55
|
let arrowLeft: number | '' = ''
|
|
56
56
|
const stys: Record<string, string> = {}
|
|
57
57
|
if (panelElem && targetElem) {
|
|
58
|
-
const
|
|
58
|
+
const domEl = document.documentElement
|
|
59
59
|
const parentWrapperEl = getWrapperElement(teleportTo ? getAppendElement(appendTo) : panelElem)
|
|
60
60
|
if (parentWrapperEl) {
|
|
61
61
|
const targetWidth = targetElem.offsetWidth
|
|
@@ -66,8 +66,8 @@ export const popperUtils: VxePopperUtils = {
|
|
|
66
66
|
const parentWrapperRect = parentWrapperEl.getBoundingClientRect()
|
|
67
67
|
const panelRect = panelElem.getBoundingClientRect()
|
|
68
68
|
const targetRect = targetElem.getBoundingClientRect()
|
|
69
|
-
const visibleHeight =
|
|
70
|
-
const visibleWidth =
|
|
69
|
+
const visibleHeight = domEl.clientHeight
|
|
70
|
+
const visibleWidth = domEl.clientWidth
|
|
71
71
|
|
|
72
72
|
const parentWrapperScrollLeft = parentWrapperEl.scrollLeft
|
|
73
73
|
const parentWrapperScrollTop = parentWrapperEl.scrollTop
|
|
@@ -79,8 +79,8 @@ export const popperUtils: VxePopperUtils = {
|
|
|
79
79
|
minWidth = targetElem.offsetWidth
|
|
80
80
|
|
|
81
81
|
if (teleportTo) {
|
|
82
|
-
left = (defaultLeft || targetLeft - (panelWidth - targetWidth) / 2) - parentWrapperScrollLeft
|
|
83
|
-
top = (defaultTop || targetTop + targetHeight) - parentWrapperScrollTop
|
|
82
|
+
left = (defaultLeft || (targetLeft - (panelWidth - targetWidth) / 2)) - parentWrapperScrollLeft
|
|
83
|
+
top = (defaultTop || (targetTop + targetHeight)) - parentWrapperScrollTop
|
|
84
84
|
if (placement === 'top') {
|
|
85
85
|
panelPlacement = 'top'
|
|
86
86
|
top = targetTop - panelHeight
|
|
@@ -91,25 +91,25 @@ export const popperUtils: VxePopperUtils = {
|
|
|
91
91
|
top = targetTop - panelHeight
|
|
92
92
|
}
|
|
93
93
|
// 如果上面不够放,则向下
|
|
94
|
-
if (top < marginSize) {
|
|
94
|
+
if (top < (marginSize - parentWrapperScrollTop)) {
|
|
95
95
|
panelPlacement = 'bottom'
|
|
96
|
-
top = targetTop + targetHeight
|
|
96
|
+
top = targetTop + targetHeight - parentWrapperScrollTop
|
|
97
97
|
}
|
|
98
98
|
// 如果下面不够放,则向上(优先)
|
|
99
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
99
|
+
if (top + panelHeight + marginSize > (visibleHeight - parentWrapperScrollTop)) {
|
|
100
100
|
panelPlacement = 'top'
|
|
101
|
-
top = targetTop - panelHeight
|
|
101
|
+
top = targetTop - panelHeight - parentWrapperScrollTop
|
|
102
102
|
}
|
|
103
103
|
} else {
|
|
104
|
-
|
|
105
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
104
|
+
// 如果下面不够放,则向上
|
|
105
|
+
if (top + panelHeight + marginSize > (visibleHeight - parentWrapperScrollTop)) {
|
|
106
106
|
panelPlacement = 'top'
|
|
107
|
-
top = targetTop - panelHeight
|
|
107
|
+
top = targetTop - panelHeight - parentWrapperScrollTop
|
|
108
108
|
}
|
|
109
109
|
// 如果上面不够放,则向下(优先)
|
|
110
|
-
if (top < marginSize) {
|
|
110
|
+
if (top < (marginSize - parentWrapperScrollTop)) {
|
|
111
111
|
panelPlacement = 'bottom'
|
|
112
|
-
top = targetTop + targetHeight
|
|
112
|
+
top = targetTop + targetHeight - parentWrapperScrollTop
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -130,10 +130,10 @@ export const popperUtils: VxePopperUtils = {
|
|
|
130
130
|
panelPlacement = 'top'
|
|
131
131
|
bottom = targetHeight
|
|
132
132
|
} else if (!placement) {
|
|
133
|
-
|
|
133
|
+
// 如果下面不够放,则向上
|
|
134
134
|
top = targetHeight
|
|
135
135
|
if (targetTop + targetHeight + panelHeight + marginSize > visibleHeight) {
|
|
136
|
-
|
|
136
|
+
// 如果上面不够放,则向下(优先)
|
|
137
137
|
if (targetTop - targetHeight - panelHeight > marginSize) {
|
|
138
138
|
panelPlacement = 'top'
|
|
139
139
|
top = ''
|