@gx-design-vue/pro-utils 0.2.0-beta.71 → 0.2.0-beta.73
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/pro-utils.js +5 -5
- package/dist/pro-utils.umd.cjs +3 -3
- package/dist/slots/index.d.ts +7 -4
- package/package.json +1 -1
package/dist/pro-utils.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Gx Design Pro
|
|
3
|
-
* Version: 0.2.0-beta.
|
|
3
|
+
* Version: 0.2.0-beta.72
|
|
4
4
|
* Author: gx12358
|
|
5
5
|
* Copyright (C) 2024 gx12358
|
|
6
6
|
* License: MIT License
|
|
7
7
|
* Description: Gx Design Pro Utils
|
|
8
|
-
* Date Created: 2025-08-
|
|
8
|
+
* Date Created: 2025-08-16
|
|
9
9
|
* Homepage:
|
|
10
10
|
* Contact: gx12358@gmail.com
|
|
11
11
|
*/
|
|
@@ -448,14 +448,14 @@ function T(e = [], t = !0) {
|
|
|
448
448
|
Array.isArray(i) ? r.push(...T(i, t)) : i?.type === _ || i?.type === "template" ? r.push(...T(i.children, t)) : i && m(i) ? t && !ie(i) ? r.push(i) : t || r.push(i) : re(i) && r.push(i);
|
|
449
449
|
}), r;
|
|
450
450
|
}
|
|
451
|
-
function b(e, ...
|
|
452
|
-
return typeof e == "function" ? e?.(...
|
|
451
|
+
function b({ vnode: e, defaultVnode: t }, ...n) {
|
|
452
|
+
return e === !1 ? null : e ? typeof e == "function" ? e?.(...n) : e : t || null;
|
|
453
453
|
}
|
|
454
454
|
function oe(e, t, n, r) {
|
|
455
455
|
const i = n || "default";
|
|
456
456
|
let o;
|
|
457
457
|
const f = t[i], s = e?.[i];
|
|
458
|
-
return f === !1 ? o =
|
|
458
|
+
return f === !1 ? o = !1 : f === !0 ? o = r?.default || s : p(f) && r?.render ? m(f) ? o = f : o = s : o = f || s, o ? r?.render ? m(o) ? o : b(o) : o : null;
|
|
459
459
|
}
|
|
460
460
|
function se(e, t, n, r) {
|
|
461
461
|
const i = n || "default";
|
package/dist/pro-utils.umd.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Gx Design Pro
|
|
3
|
-
* Version: 0.2.0-beta.
|
|
3
|
+
* Version: 0.2.0-beta.72
|
|
4
4
|
* Author: gx12358
|
|
5
5
|
* Copyright (C) 2024 gx12358
|
|
6
6
|
* License: MIT License
|
|
7
7
|
* Description: Gx Design Pro Utils
|
|
8
|
-
* Date Created: 2025-08-
|
|
8
|
+
* Date Created: 2025-08-16
|
|
9
9
|
* Homepage:
|
|
10
10
|
* Contact: gx12358@gmail.com
|
|
11
11
|
*/
|
|
12
12
|
(function(l,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(l=typeof globalThis<"u"?globalThis:l||self,d(l.GPorUtils={},l.vue))})(this,(function(l,d){"use strict";class de{constructor(){this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}_utf8_encode(t){t=t.replace(/\r\n/g,`
|
|
13
|
-
`);let n="";for(let r=0;r<t.length;r++){const i=t.charCodeAt(r);i<128?n+=String.fromCharCode(i):i>127&&i<2048?(n+=String.fromCharCode(i>>6|192),n+=String.fromCharCode(i&63|128)):(n+=String.fromCharCode(i>>12|224),n+=String.fromCharCode(i>>6&63|128),n+=String.fromCharCode(i&63|128))}return n}_utf8_decode(t){let n="",r=0,i=0,o=0,f=0;for(;r<t.length;)i=t.charCodeAt(r),i<128?(n+=String.fromCharCode(i),r++):i>191&&i<224?(o=t.charCodeAt(r+1),n+=String.fromCharCode((i&31)<<6|o&63),r+=2):(o=t.charCodeAt(r+1),f=t.charCodeAt(r+2),n+=String.fromCharCode((i&15)<<12|(o&63)<<6|f&63),r+=3);return n}encode(t){let n="",r,i,o,f,c,s,u,a=0;for(t=this._utf8_encode(t);a<t.length;)r=t.charCodeAt(a++),i=t.charCodeAt(a++),o=t.charCodeAt(a++),f=r>>2,c=(r&3)<<4|i>>4,s=(i&15)<<2|o>>6,u=o&63,Number.isNaN(i)?s=u=64:Number.isNaN(o)&&(u=64),n=n+this._keyStr.charAt(f)+this._keyStr.charAt(c)+this._keyStr.charAt(s)+this._keyStr.charAt(u);return n}decode(t){let n="",r,i,o,f,c,s,u,a=0;for(t=t.replace(/[^A-Z0-9+/=]/gi,"");a<t.length;)f=this._keyStr.indexOf(t.charAt(a++)),c=this._keyStr.indexOf(t.charAt(a++)),s=this._keyStr.indexOf(t.charAt(a++)),u=this._keyStr.indexOf(t.charAt(a++)),r=f<<2|c>>4,i=(c&15)<<4|s>>2,o=(s&3)<<6|u,n=n+String.fromCharCode(r),s!==64&&(n=n+String.fromCharCode(i)),u!==64&&(n=n+String.fromCharCode(o));return n=this._utf8_decode(n),n}}function b(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function m(e){return typeof e=="boolean"}function g(e){return typeof e=="number"}function y(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function h(e){return e!==null&&b(e,"Object")}function $(e){return typeof e=="string"||e instanceof String}function ye(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function ge(e){if(typeof e!="string")return!1;try{const t=JSON.parse(e);return typeof t=="object"&&t!==null}catch{return!1}}function he(){const e=navigator.userAgent||navigator.vendor;return!!(/iPhone/.test(e)||/Android/.test(e)&&/Mobile/.test(e)||/Windows Phone/.test(e)||/Mobile/.test(e)&&!_())}function _(){const e=navigator.userAgent||navigator.vendor;return!!(/iPad/.test(e)||/Macintosh/.test(e)&&"ontouchend"in document||/Android/.test(e)&&!/Mobile/.test(e))}function W(...e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(r){if($(r))t.push(r);else if(y(r))for(let i=0;i<r.length;i++){const o=W(r[i]);o&&t.push(o)}else if(h(r))for(const i in r)r[i]&&t.push(i)}}return t.filter(n=>n).join(" ")}function me(e,t){if(typeof t!="string"&&!Array.isArray(t))return;const n=Array.isArray(t)?t:t.split(":");let r=e;for(let i=0;i<n.length;i++)if(r&&Object.prototype.hasOwnProperty.call(r,n[i]))r=r[n[i]];else return;return r}const A=typeof window>"u";function pe(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase())}const B=function(e,t){if(A||!e||!t)return"";t=pe(t),t==="float"&&(t="cssFloat");try{const n=e.style[t];if(n)return n;const r=document?.defaultView?.getComputedStyle(e,"");return r?r[t]:""}catch{return e.style[t]}},z=(e,t)=>A?void 0:(t==null?B(e,"overflow"):t?B(e,"overflow-y"):B(e,"overflow-x")).match(/(scroll|auto|overlay)/),we=(e,t)=>{if(A)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(z(n,t))return n;n=n.parentNode}return n},Ae=(e,t)=>{if(A||!e||!t)return!1;const n=e.getBoundingClientRect();let r;return[window,document,document.documentElement,null,void 0].includes(t)?r={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:r=t.getBoundingClientRect(),n.top<r.bottom&&n.bottom>r.top&&n.right>r.left&&n.left<r.right};function F(e){return e!=null&&e===e.window}function q(e,t){if(typeof window>"u")return 0;const n=t?"scrollTop":"scrollLeft";let r=0;return F(e)?r=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?r=e.documentElement[n]:e&&(r=e[n]),e&&!F(e)&&typeof r!="number"&&(r=(e.ownerDocument||e).documentElement?.[n]),r}let H=e=>setTimeout(e,16),x=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(H=e=>window.requestAnimationFrame(e),x=e=>window.cancelAnimationFrame(e));let J=0;const P=new Map;function Z(e){P.delete(e)}function U(e,t=1){J+=1;const n=J;function r(i){if(i===0)Z(n),e();else{const o=H(()=>{r(i-1)});P.set(n,o)}}return r(t),n}U.cancel=e=>{const t=P.get(e);return Z(t),x(t)};function Se(e,t,n,r){const i=n-t;return e/=r/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function ve(e,t={}){const{getContainer:n=()=>window,callback:r,duration:i=450}=t,o=n(),f=q(o,!0),c=Date.now(),s=()=>{const a=Date.now()-c,T=Se(a>i?i:a,f,e,i);F(o)?o.scrollTo(window.pageXOffset,T):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=T:o.scrollTop=T,a<i?U(s):typeof r=="function"&&r()};o&&U(s)}function Oe(e){let t;const n=i=>()=>{t=null,e(...i)},r=(...i)=>{t==null&&(t=requestAnimationFrame(n(i)))};return r.cancel=()=>cancelAnimationFrame(t),r}function K(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function X(e){return e==null||typeof e!="object"&&typeof e!="function"}function G(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function S(e){return p(e)}function p(e,t=new Map){if(X(e))return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){const n=Array.from({length:e.length});t.set(e,n);for(let r=0;r<e.length;r++)n[r]=p(e[r],t);return Object.prototype.hasOwnProperty.call(e,"index")&&(n.index=e.index),Object.prototype.hasOwnProperty.call(e,"input")&&(n.input=e.input),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const n=new RegExp(e.source,e.flags);return n.lastIndex=e.lastIndex,n}if(e instanceof Map){const n=new Map;t.set(e,n);for(const[r,i]of e)n.set(r,p(i,t));return n}if(e instanceof Set){const n=new Set;t.set(e,n);for(const r of e)n.add(p(r,t));return n}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(G(e)){const n=new(Object.getPrototypeOf(e)).constructor(e.length);t.set(e,n);for(let r=0;r<e.length;r++)n[r]=p(e[r],t);return n}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const n=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return t.set(e,n),w(n,e,t),n}if(typeof File<"u"&&e instanceof File){const n=new File([e],e.name,{type:e.type});return t.set(e,n),w(n,e,t),n}if(e instanceof Blob){const n=new Blob([e],{type:e.type});return t.set(e,n),w(n,e,t),n}if(e instanceof Error){const n=new e.constructor;return t.set(e,n),n.message=e.message,n.name=e.name,n.stack=e.stack,n.cause=e.cause,w(n,e,t),n}if(typeof e=="object"&&e!==null){const n={};return t.set(e,n),w(n,e,t),n}return e}function w(e,t,n){const r=[...Object.keys(t),...K(t)];for(let i=0;i<r.length;i++){const o=r[i],f=Object.getOwnPropertyDescriptor(e,o);(f==null||f.writable)&&(e[o]=p(t[o],n))}}const Ce=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Te=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Ce;function I(e,t,n,r){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let i,o,f;if(Array.isArray(e)){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!I(e[o],t[o],n,r))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!I(o[1],t.get(o[0]),n,r))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===t.toString();if(f=Object.keys(e),i=f.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,f[o]))return!1;for(o=i;o--!==0;){const c=f[o];if(!n?.includes(c)&&!(c==="_owner"&&e.$$typeof)&&!I(e[c],t[c],n,r))return r&&console.log(c),!1}return!0}return e!==e&&t!==t}function Ue(e){return/\w.(?:png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const Y=e=>e==null,Ie=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch(t){return console.error("isUrl error",t),!1}};function D(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}const Re=(...e)=>{const t={},n=e.length;let r,i=0;for(;i<n;i+=1)for(r in e[i])Object.prototype.hasOwnProperty.call(e[i],r)&&(typeof t[r]=="object"&&typeof e[i][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[i][r])?t[r]={...t[r],...e[i][r]}:t[r]=e[i][r]);return t};function v(e,t,n){const r=m(n?.omitNil)?n?.omitNil:!0,i=m(n?.omitEmpty)?n?.omitEmpty:!0,o=Object.keys(t);for(let f=0;f<o.length;f++){const c=o[f],s=t[c],u=e[c];Array.isArray(s)?Array.isArray(u)?s.length===0&&!i?e[c]=s:e[c]=v(u,s,n):e[c]=v([],s,n):D(s)?D(u)?Object.keys(s).length===0&&!i?e[c]=s:e[c]=v(u,s,n):e[c]=v({},s,n):r?(u===void 0||!Y(s))&&(e[c]=s):e[c]=s}return e}let Q=0;const j=(e=21)=>{if(typeof window>"u"||!window.crypto)return(Q+=1).toFixed(0);let t="";const n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){const r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t},Ee=()=>typeof window>"u"?j():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():j(),Ne=e=>{if(e&&e!==!0)return e},Be=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Fe=e=>{const t={};return Object.keys(e||{}).forEach(n=>{Array.isArray(e[n])&&e[n]?.length===0||e[n]!==void 0&&(t[n]=e[n])}),t},k=e=>e!=null&&e!=="";function Pe(e){if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:e.split(":")?.slice(-1)[0]}function ee(e){return e&&(e.type===d.Comment||e.type===d.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function De(e,t){return R(e[t]?.())}function R(e=[],t=!0){const n=Array.isArray(e)?e:[e],r=[];return n.forEach(i=>{Array.isArray(i)?r.push(...R(i,t)):i?.type===d.Fragment||i?.type==="template"?r.push(...R(i.children,t)):i&&d.isVNode(i)?t&&!ee(i)?r.push(i):t||r.push(i):k(i)&&r.push(i)}),r}function L(e,...t){return typeof e=="function"?e?.(...t):e}function te(e,t,n,r){const i=n||"default";let o;const f=t[i],c=e?.[i];return f===!1?o=null:f===!0?o=r?.default||c:h(f)&&r?.render?d.isVNode(f)?o=f:o=c:o=f||c,o?r?.render?d.isVNode(o)?o:L(o):o:null}function ne(e,t,n,r){const i=n||"default";let o;const f=t[i],c=e?.[i]?.(r);return f===!1?o=!1:f===!0?o=c:h(f)?d.isVNode(f)?o=f:o=c:o=f||c,o?d.isVNode(o)?o:L(o,r):null}function Le(e,t,n,r){const i={};return n.forEach(o=>{const f=r?.render?ne(e,t,o,r?.params):te(e,t,o);(m(f)||f)&&(i[o]=f)}),i}const O={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3","ogg","wav","aac","m4a","webm"],imageType:["jpeg","jpg","png","gif","bmp","tiff","tif","webp","heic","heif","svg","ico","raw","cr2","nef","arw","dng","psd","eps"],videoType:["mp4","avi","mov","wmv","mkv","flv","webm","mpeg","mpg","3gp","ogv","mxf","vob","rm","rmvb","ts","mts","m2ts","divx","xvid"],audioType:["mp3","wav","aac","flac","ogg","wma","m4a","alac","opus","amr","aiff","au","pcm","ape"]};function Ve(e){return e!=null}const Me=({suffixCls:e,customizePrefixCls:t,isPor:n,className:r})=>{const i=r||(n?"gx-pro":"gx");return t||(e?`${i}-${e}`:i)},be=(e,t)=>e?y(e)?e.join("-"):e.toString():`${t||0}`;function $e(e,{align:t,showIndex:n}){const r=S(e);if(n&&e.length&&e.every(i=>i.dataIndex!=="sortIndex")){const i=e[0];r.unshift({title:"序号",align:t,fixed:i.fixed,width:60,uuid:oe().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else r.filter(i=>i.dataIndex!=="sortIndex");return r}function _e(e,...t){return typeof e=="function"?e(...t):e}function We(e){return JSON.parse(JSON.stringify(e))}function ze(e,t){if(h(e)){const{pageSize:n=10,total:r=0}=e;let{current:i=1}=e;return r-t<=n*(i-1)&&(i=i-1),i===0?1:i}return 1}function qe(e=[],t,n="children"){function r(i,o){return o.map((f,c)=>{const s=`${i}-${c+1}`;return f[n]&&(f[n]=r(s,f[n])),f.sortIndex=s,f})}return S(e).map((i,o)=>{const f=h(t)&&t.current||1,c=h(t)&&t.pageSize||10,s=`${(f-1)*c+(o+1)}`;return i[n]&&(i[n]=r(`${s}`,i[n])),i.sortIndex=s,i})}function He(e,t){return y(e)?e?.filter((n,r)=>{if(g(t))return r<=t-1;if(y(t)&&t.length===2){const i=t[0]-1,o=t[1]?t[1]-1:e.length-1;return r<=o&&r>=i}else if(y(t)&&t.length===1){const i=t[0]-1,o=e.length-1;return r<=o&&r>=i}return!0}):[]}function re(e,t,n,r=0){const i=g(r)&&(r===0||r===1)?r:0,o=e[n],f=t[n];let c=0;return o<f?c=i===0?-1:0:o>f&&(c=i===0?0:-1),c}function ie(e,t,n,r=0){const i=g(r)&&(r===0||r===1)?r:0,o=new Date(e[n]),f=new Date(t[n]);let c=0;return o<f?c=i===0?-1:0:o>f&&(c=i===0?0:-1),c}function xe(e,t,n=0){return e.sort((r,i)=>re(r,i,t,n))}function Je(e,t,n=0){return e.sort((r,i)=>ie(r,i,t,n))}function Ze(e){let t=S(e);const n=new Set(t);return t=Array.from(n),t}function Ke(e,t){const n=["null","undefined"];let r=!0;return e===0?r=!0:n.includes(e)?r=!1:e||(r=!1),r?{value:e,success:r}:{value:t===""?t:t||"-",success:r}}function Xe(e){let t="";if(e>-1){const n=Math.floor(e/3600),r=Math.floor(e/60)%60,i=Number.parseInt(String(e%60));n<10?t="0"+n+":":t=n+":",r<10&&(t+="0"),t+=r+":",i<10&&(t+="0"),t+=i}return t.split(":")[0]==="00"?`${t.split(":")[1]}:${t.split(":")[2]}`:t}function oe(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(t,n){const r=e,i=[],o=n||r.length;let f,c;if(t)for(f=0;f<t;f+=1)i[f]=r[Number.parseInt(String(Math.random()*o))];else for(i[8]="-",i[13]="-",i[18]="-",i[23]="-",i[14]="4",f=0;f<36;f+=1)i[f]||(c=Math.random()*16,i[f]=r[f===19?c&&3||8:c]);return i.join("")},uuidFast(){const t=e,n=Array.from({length:36});let r=0,i,o;for(o=0;o<36;o+=1)o===8||o===13||o===18||o===23?n[o]="-":o===14?n[o]="4":(r<=2&&(r=33554432+Math.random()*16777216||0),i=r&&15,r=r>4,n[o]=t[o===19?i&&3||8:i]);return n.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16||0;return(t==="x"?n:n&&3||8).toString(16)})}}}function ce(e,t){if(!Array.isArray(e)||e.length===0)return 0;const n=t||"children";return Math.max(...e.map(r=>{const i=r[n];return 1+(i?ce(i,n):0)}))}function fe(e,t="children"){let n=[];return e.forEach(r=>{n.push(r),y(r[t])&&r[t].length>0&&(n=n.concat(fe(r[t],t)))}),n}function Ge(e,t){if(!e||!y(e)||e?.length===0)return[];const{id:n="id",parentId:r="parentId",children:i="children",emptyChildren:o=!0}=t||{},f=t?.rootId??0,c=S(e);return c.map(s=>(!o&&s[i]&&s[i]?.length===0&&delete s[i],s)).filter(s=>{const u=c.filter(a=>s[n]===a[r]);return u.length>0?s[i]=u:o&&(s[i]=[]),f===!1?!0:s[r]===f})}function le(e,t){return e.map(n=>{const r={...n};return r.children&&(r.children=le(r.children,t)),t(r)||r.children&&r.children.length>0?r:null}).filter(Boolean)}function Ye(e,t,n){const{value:r,children:i}=n||{value:"value",children:"children"};let o=[];function f(c,s){if(c[r]===t)return o=[...s,c[r]],!0;if(c[i]){for(const u of c[i])if(f(u,[...s,c[r]]))return!0}return!1}for(const c of e)if(f(c,[]))break;return o}function Qe(e){return e&&y(e)?e[e.length-1]:null}function se(e,t,n){const r=n?.value||"id",i=n?.children||"children";for(const o of e){if(o[r]===t)return o;const f=o[i];if(f){const c=se(f,t,n);if(c)return c}}}function je(e){return URL.createObjectURL(e)}function ke(e){return new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=i=>n(i)})}function et(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let i=r.length;const o=new Uint8Array(i);for(;i--;)o[i]=r.charCodeAt(i);return new Blob([o],{type:n})}function tt(e,t){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],i=atob(n[1]);let o=i.length;const f=new Uint8Array(o);for(;o--;)f[o]=i.charCodeAt(o);return new File([f],t,{type:r})}function nt(e,t,n){return new window.File([e],t,{type:n})}function ue(e){if(!e||typeof e!="string")return"";const t=e.indexOf("?");return t>0?`${e.substring(0,t)}`:e}function E(e){if(!e||typeof e!="string")return"";const t=ue(e),n=t.lastIndexOf(".");return n>0&&`${t?.substring?.(n)?.split("?")?.[0]}`?.split(".")?.[1]||""}function C(e,t){if(t)return t;if(!e||e==="data:")return"4";let n="4";return N(e)?e.includes("data:image/")?n="png":e.includes("data:video/")?n="mp4":e.includes("data:audio/")&&(n="mp3"):e instanceof Blob?(e=String(e),e.includes("image")?n="png":e.includes("video")?n="mp4":e.includes("audio")&&(n="mp3")):n=E(e).toLowerCase(),O.imageType.includes(n)?"1":O.videoType.includes(n)?"3":O.audioType.includes(n)?"2":"4"}function ae(e){const{url:t="",fileType:n="1"}=e||{};let r="",i={play:!1,height:0,size:0,width:0,duration:0};function o(){i={play:!1,height:0,size:0,width:0,duration:0}}return t instanceof File?r=URL.createObjectURL(t):N(t)?r=t:t instanceof Blob?r=URL.createObjectURL(t):(t.includes("https")||t.includes("http"))&&(r=t),new Promise(f=>{let c;if(n==="4"){f(i);return}n==="1"?(c=document.createElement("img"),c.src=r):n==="2"?(c=document.createElement("audio"),c.src=r):n==="3"&&(c=document.createElement("video"),c.src=r),n==="1"?c.onload=function(){o(),i.play=!0,i.width=c.width||0,i.height=c.height||0,f(i),c=null}:c.oncanplay=function(){o(),i.play=!0,i.width=c?.videoWidth||0,i.height=c?.videoHeight||0,i.duration=c?.duration||0,f(i),c=null},c.onerror=function(){o(),f(i),c=null}})}async function rt(e){const{url:t="",currentTime:n,videoSuffix:r="",videoAllowPlay:i=!1}=e;let o="",f=r,c="1",s;return t instanceof File?(o=URL.createObjectURL(t),f=E(t.name),c=C(t.name)):t instanceof Blob?(o=URL.createObjectURL(t),c=C(t)):N(t)?(o=t,c=C(t)):(t.includes("https")||t.includes("http"))&&(o=t,f=E(t),c=C(t)),(f?O.videoAllowType.includes(f.toLowerCase()):!1)?i?V(o,n):(s=await ae({url:o,fileType:c}),s.play?V(o,n):new Promise(a=>{a("")})):new Promise(a=>{a("")})}async function V(e,t=0){return new Promise(n=>{let r=document.createElement("video");r&&(r.controls=!0,r.muted=!0,r.setAttribute("src",e),r.setAttribute("muted",String(!0)),r.setAttribute("crossorigin","anonymous"),r.setAttribute("autoplay",String(!0)),r.addEventListener("loadeddata",async()=>{let i;for(r?.addEventListener("seeked",async()=>{i&&i()});t<(r?.duration||0);){r&&(r.currentTime=t),await new Promise(T=>i=T);const o=document.createElement("canvas"),f=.8,c=o.getContext("2d"),s=r?.videoWidth||0*f,u=r?.videoHeight||0*f,a=0;o.width=r?.videoWidth||0*f,o.height=r?.videoHeight||0*f,r&&c.drawImage(r,0,0,s+a,u+a),r=null,n(s===0||u===0?"":o.toDataURL("image/png",1))}}))})}function N(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(n=>e.includes(n)))}function it(e){return typeof e=="string"&&/^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e)}function ot(e,t,n,r=!1){e&&t&&n&&e.addEventListener(t,n,r)}function ct(e,t,n,r=!1){e&&t&&n&&e.removeEventListener(t,n,r)}function ft(){return/windows|win32/i.test(navigator.userAgent)}function lt(e){return m(e)?e:!!e}function M(e,t){const n=`^\\d+(?:\\.\\d{0,${e}})?`,r=new RegExp(n),i=t.toString().match(r);if(i){const o=i[0];if(o.includes(".")){const[f,c]=o.split(".");if(/^0*$/.test(c))return f}return o}return t.toString()}function st(e,t){const{toChinese:n=!1,fixed:r=2,min:i=1e4}=t||{},o=g(i)?i:1e4,f=g(r)?r:2,c=n?e<o?"":e<1e8?"万":"亿":e<o?"":e<1e8?"w":"亿";if(!g(e))return{str:`${e}`,number:`${e}`};if(e<o)return{str:`${e}`,number:`${e}`};if(f===0){const u=(e/(e<1e8?1e4:1e8)).toFixed(1).split(".")[0];return{str:`${u}${c}`,number:u,unit:c}}let s;return e<1e8?(s=M(f,e/1e4),{str:s+c,number:s,unit:c}):(s=M(f,e/1e8),{str:s+c,number:s,unit:c})}function ut(e,t){let n=0;const r=m(t.removeAfter)?t.removeAfter:!0,i=t.id||"hiddenElement",o={opacity:0,visibility:"hidden",position:"fixed",zIndex:-1,top:0,left:0};let f=document.querySelector(`#${i}`);if(!f){const s=document.createElement("div");s.id=i,document.body.appendChild(s),f=document.querySelector(`#${i}`)}Object.assign(f.style,o);const c=document.createElement(t.createName||"span");return c.innerHTML=e,(t.cssObject||h(t.cssObject))&&Object.assign(c.style,t.cssObject),f.append(c),n=c.getBoundingClientRect()[t.type||"width"],r&&f.removeChild(c),n}function at(e){e=g(e)&&!Number.isNaN(e)?e:0;const t=["零","一","二","三","四","五","六","七","八","九"],n=["","十","百","千","万"];e=Number.parseInt(`${e}`);const r=f=>{const c=f.toString().split("").reverse();let s="";for(let u=0;u<c.length;u++)s=(u===0&&c[u]==="0"||u>0&&c[u]==="0"&&c[u-1]==="0"?"":(e<20&&u>0?"":t[c[u]])+(c[u]==="0"?n[0]:n[u]))+s;return s},i=Math.floor(e/1e4);let o=e%1e4;return o.toString().length<4&&(o="0"+o),i?r(i)+"万"+r(o):r(e)}function dt(e,t){Object.keys(e).forEach(n=>{t(n,e[n])})}l.Base64=de,l.arrayRepeat=Ze,l.arraySlice=He,l.blobToDataURL=nt,l.checkFileType=C,l.classNames=W,l.cloneDeep=S,l.compareArray=re,l.compareArraySort=xe,l.compareArrayTimeSort=Je,l.compareTime=ie,l.convertValueBoolean=lt,l.copyProperties=w,l.dataURLtoBlob=et,l.dataURLtoFile=tt,l.deepCopy=We,l.deepMerge=v,l.fileTypes=O,l.filterEmpty=R,l.filterTree=le,l.findSourceByTree=se,l.findValueAndAncestors=Ye,l.forInObject=dt,l.formatDuration=Xe,l.formatNumber=M,l.genColumnKey=be,l.generateVideoPicture=V,l.getArrayLast=Qe,l.getBase64=ke,l.getBlobUrl=je,l.getFileSuffix=E,l.getKeys=Pe,l.getLevelData=fe,l.getMaxFloor=ce,l.getMediaInfos=ae,l.getPrefixCls=Me,l.getRandomNumber=oe,l.getScroll=q,l.getScrollContainer=we,l.getSlot=te,l.getSlotVNode=ne,l.getSlotsChildren=De,l.getSlotsProps=Le,l.getSortIndex=qe,l.getSymbols=K,l.getTextWidth=ut,l.getValueFromObjectByKey=me,l.getVideoCoverPicture=rt,l.getVideoFileUrl=ue,l.handleCurrentPage=ze,l.handleEmptyField=Ke,l.handleShowIndex=$e,l.is=b,l.isArray=y,l.isBase64=N,l.isBoolean=m,l.isBrowser=Te,l.isDataURLBase64=it,l.isDeepEqualReact=I,l.isEmptyElement=ee,l.isFunction=ye,l.isImg=Ue,l.isInContainer=Ae,l.isJSONStr=ge,l.isMobile=he,l.isNil=Y,l.isNotNil=Ve,l.isNumber=g,l.isObject=h,l.isPlainObject=D,l.isPrimitive=X,l.isScroll=z,l.isServer=A,l.isString=$,l.isTablet=_,l.isTypedArray=G,l.isUrl=Ie,l.isValid=k,l.isWindowsOs=ft,l.merge=Re,l.nanoid=Ee,l.off=ct,l.omitBoolean=Ne,l.omitUndefined=Be,l.omitUndefinedAndEmptyArr=Fe,l.on=ot,l.raf=U,l.runFunction=_e,l.scrollTo=ve,l.slotRender=L,l.throttleByAnimationFrame=Oe,l.toChinesNum=at,l.toConvertNumberShow=st,l.treeData=Ge,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
|
13
|
+
`);let n="";for(let r=0;r<t.length;r++){const i=t.charCodeAt(r);i<128?n+=String.fromCharCode(i):i>127&&i<2048?(n+=String.fromCharCode(i>>6|192),n+=String.fromCharCode(i&63|128)):(n+=String.fromCharCode(i>>12|224),n+=String.fromCharCode(i>>6&63|128),n+=String.fromCharCode(i&63|128))}return n}_utf8_decode(t){let n="",r=0,i=0,o=0,c=0;for(;r<t.length;)i=t.charCodeAt(r),i<128?(n+=String.fromCharCode(i),r++):i>191&&i<224?(o=t.charCodeAt(r+1),n+=String.fromCharCode((i&31)<<6|o&63),r+=2):(o=t.charCodeAt(r+1),c=t.charCodeAt(r+2),n+=String.fromCharCode((i&15)<<12|(o&63)<<6|c&63),r+=3);return n}encode(t){let n="",r,i,o,c,f,s,u,a=0;for(t=this._utf8_encode(t);a<t.length;)r=t.charCodeAt(a++),i=t.charCodeAt(a++),o=t.charCodeAt(a++),c=r>>2,f=(r&3)<<4|i>>4,s=(i&15)<<2|o>>6,u=o&63,Number.isNaN(i)?s=u=64:Number.isNaN(o)&&(u=64),n=n+this._keyStr.charAt(c)+this._keyStr.charAt(f)+this._keyStr.charAt(s)+this._keyStr.charAt(u);return n}decode(t){let n="",r,i,o,c,f,s,u,a=0;for(t=t.replace(/[^A-Z0-9+/=]/gi,"");a<t.length;)c=this._keyStr.indexOf(t.charAt(a++)),f=this._keyStr.indexOf(t.charAt(a++)),s=this._keyStr.indexOf(t.charAt(a++)),u=this._keyStr.indexOf(t.charAt(a++)),r=c<<2|f>>4,i=(f&15)<<4|s>>2,o=(s&3)<<6|u,n=n+String.fromCharCode(r),s!==64&&(n=n+String.fromCharCode(i)),u!==64&&(n=n+String.fromCharCode(o));return n=this._utf8_decode(n),n}}function b(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function m(e){return typeof e=="boolean"}function g(e){return typeof e=="number"}function y(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function h(e){return e!==null&&b(e,"Object")}function $(e){return typeof e=="string"||e instanceof String}function ye(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function ge(e){if(typeof e!="string")return!1;try{const t=JSON.parse(e);return typeof t=="object"&&t!==null}catch{return!1}}function he(){const e=navigator.userAgent||navigator.vendor;return!!(/iPhone/.test(e)||/Android/.test(e)&&/Mobile/.test(e)||/Windows Phone/.test(e)||/Mobile/.test(e)&&!_())}function _(){const e=navigator.userAgent||navigator.vendor;return!!(/iPad/.test(e)||/Macintosh/.test(e)&&"ontouchend"in document||/Android/.test(e)&&!/Mobile/.test(e))}function W(...e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(r){if($(r))t.push(r);else if(y(r))for(let i=0;i<r.length;i++){const o=W(r[i]);o&&t.push(o)}else if(h(r))for(const i in r)r[i]&&t.push(i)}}return t.filter(n=>n).join(" ")}function me(e,t){if(typeof t!="string"&&!Array.isArray(t))return;const n=Array.isArray(t)?t:t.split(":");let r=e;for(let i=0;i<n.length;i++)if(r&&Object.prototype.hasOwnProperty.call(r,n[i]))r=r[n[i]];else return;return r}const A=typeof window>"u";function pe(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase())}const B=function(e,t){if(A||!e||!t)return"";t=pe(t),t==="float"&&(t="cssFloat");try{const n=e.style[t];if(n)return n;const r=document?.defaultView?.getComputedStyle(e,"");return r?r[t]:""}catch{return e.style[t]}},z=(e,t)=>A?void 0:(t==null?B(e,"overflow"):t?B(e,"overflow-y"):B(e,"overflow-x")).match(/(scroll|auto|overlay)/),we=(e,t)=>{if(A)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(z(n,t))return n;n=n.parentNode}return n},Ae=(e,t)=>{if(A||!e||!t)return!1;const n=e.getBoundingClientRect();let r;return[window,document,document.documentElement,null,void 0].includes(t)?r={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:r=t.getBoundingClientRect(),n.top<r.bottom&&n.bottom>r.top&&n.right>r.left&&n.left<r.right};function F(e){return e!=null&&e===e.window}function q(e,t){if(typeof window>"u")return 0;const n=t?"scrollTop":"scrollLeft";let r=0;return F(e)?r=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?r=e.documentElement[n]:e&&(r=e[n]),e&&!F(e)&&typeof r!="number"&&(r=(e.ownerDocument||e).documentElement?.[n]),r}let H=e=>setTimeout(e,16),x=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(H=e=>window.requestAnimationFrame(e),x=e=>window.cancelAnimationFrame(e));let J=0;const P=new Map;function Z(e){P.delete(e)}function U(e,t=1){J+=1;const n=J;function r(i){if(i===0)Z(n),e();else{const o=H(()=>{r(i-1)});P.set(n,o)}}return r(t),n}U.cancel=e=>{const t=P.get(e);return Z(t),x(t)};function Se(e,t,n,r){const i=n-t;return e/=r/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function ve(e,t={}){const{getContainer:n=()=>window,callback:r,duration:i=450}=t,o=n(),c=q(o,!0),f=Date.now(),s=()=>{const a=Date.now()-f,T=Se(a>i?i:a,c,e,i);F(o)?o.scrollTo(window.pageXOffset,T):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=T:o.scrollTop=T,a<i?U(s):typeof r=="function"&&r()};o&&U(s)}function Oe(e){let t;const n=i=>()=>{t=null,e(...i)},r=(...i)=>{t==null&&(t=requestAnimationFrame(n(i)))};return r.cancel=()=>cancelAnimationFrame(t),r}function K(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function X(e){return e==null||typeof e!="object"&&typeof e!="function"}function G(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function S(e){return p(e)}function p(e,t=new Map){if(X(e))return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){const n=Array.from({length:e.length});t.set(e,n);for(let r=0;r<e.length;r++)n[r]=p(e[r],t);return Object.prototype.hasOwnProperty.call(e,"index")&&(n.index=e.index),Object.prototype.hasOwnProperty.call(e,"input")&&(n.input=e.input),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const n=new RegExp(e.source,e.flags);return n.lastIndex=e.lastIndex,n}if(e instanceof Map){const n=new Map;t.set(e,n);for(const[r,i]of e)n.set(r,p(i,t));return n}if(e instanceof Set){const n=new Set;t.set(e,n);for(const r of e)n.add(p(r,t));return n}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(G(e)){const n=new(Object.getPrototypeOf(e)).constructor(e.length);t.set(e,n);for(let r=0;r<e.length;r++)n[r]=p(e[r],t);return n}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const n=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return t.set(e,n),w(n,e,t),n}if(typeof File<"u"&&e instanceof File){const n=new File([e],e.name,{type:e.type});return t.set(e,n),w(n,e,t),n}if(e instanceof Blob){const n=new Blob([e],{type:e.type});return t.set(e,n),w(n,e,t),n}if(e instanceof Error){const n=new e.constructor;return t.set(e,n),n.message=e.message,n.name=e.name,n.stack=e.stack,n.cause=e.cause,w(n,e,t),n}if(typeof e=="object"&&e!==null){const n={};return t.set(e,n),w(n,e,t),n}return e}function w(e,t,n){const r=[...Object.keys(t),...K(t)];for(let i=0;i<r.length;i++){const o=r[i],c=Object.getOwnPropertyDescriptor(e,o);(c==null||c.writable)&&(e[o]=p(t[o],n))}}const Ce=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Te=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Ce;function I(e,t,n,r){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let i,o,c;if(Array.isArray(e)){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!I(e[o],t[o],n,r))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!I(o[1],t.get(o[0]),n,r))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===t.toString();if(c=Object.keys(e),i=c.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,c[o]))return!1;for(o=i;o--!==0;){const f=c[o];if(!n?.includes(f)&&!(f==="_owner"&&e.$$typeof)&&!I(e[f],t[f],n,r))return r&&console.log(f),!1}return!0}return e!==e&&t!==t}function Ue(e){return/\w.(?:png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const Y=e=>e==null,Ie=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch(t){return console.error("isUrl error",t),!1}};function D(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}const Re=(...e)=>{const t={},n=e.length;let r,i=0;for(;i<n;i+=1)for(r in e[i])Object.prototype.hasOwnProperty.call(e[i],r)&&(typeof t[r]=="object"&&typeof e[i][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[i][r])?t[r]={...t[r],...e[i][r]}:t[r]=e[i][r]);return t};function v(e,t,n){const r=m(n?.omitNil)?n?.omitNil:!0,i=m(n?.omitEmpty)?n?.omitEmpty:!0,o=Object.keys(t);for(let c=0;c<o.length;c++){const f=o[c],s=t[f],u=e[f];Array.isArray(s)?Array.isArray(u)?s.length===0&&!i?e[f]=s:e[f]=v(u,s,n):e[f]=v([],s,n):D(s)?D(u)?Object.keys(s).length===0&&!i?e[f]=s:e[f]=v(u,s,n):e[f]=v({},s,n):r?(u===void 0||!Y(s))&&(e[f]=s):e[f]=s}return e}let Q=0;const j=(e=21)=>{if(typeof window>"u"||!window.crypto)return(Q+=1).toFixed(0);let t="";const n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){const r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t},Ee=()=>typeof window>"u"?j():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():j(),Ne=e=>{if(e&&e!==!0)return e},Be=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Fe=e=>{const t={};return Object.keys(e||{}).forEach(n=>{Array.isArray(e[n])&&e[n]?.length===0||e[n]!==void 0&&(t[n]=e[n])}),t},k=e=>e!=null&&e!=="";function Pe(e){if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:e.split(":")?.slice(-1)[0]}function ee(e){return e&&(e.type===d.Comment||e.type===d.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function De(e,t){return R(e[t]?.())}function R(e=[],t=!0){const n=Array.isArray(e)?e:[e],r=[];return n.forEach(i=>{Array.isArray(i)?r.push(...R(i,t)):i?.type===d.Fragment||i?.type==="template"?r.push(...R(i.children,t)):i&&d.isVNode(i)?t&&!ee(i)?r.push(i):t||r.push(i):k(i)&&r.push(i)}),r}function L({vnode:e,defaultVnode:t},...n){return e===!1?null:e?typeof e=="function"?e?.(...n):e:t||null}function te(e,t,n,r){const i=n||"default";let o;const c=t[i],f=e?.[i];return c===!1?o=!1:c===!0?o=r?.default||f:h(c)&&r?.render?d.isVNode(c)?o=c:o=f:o=c||f,o?r?.render?d.isVNode(o)?o:L(o):o:null}function ne(e,t,n,r){const i=n||"default";let o;const c=t[i],f=e?.[i]?.(r);return c===!1?o=!1:c===!0?o=f:h(c)?d.isVNode(c)?o=c:o=f:o=c||f,o?d.isVNode(o)?o:L(o,r):null}function Le(e,t,n,r){const i={};return n.forEach(o=>{const c=r?.render?ne(e,t,o,r?.params):te(e,t,o);(m(c)||c)&&(i[o]=c)}),i}const O={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3","ogg","wav","aac","m4a","webm"],imageType:["jpeg","jpg","png","gif","bmp","tiff","tif","webp","heic","heif","svg","ico","raw","cr2","nef","arw","dng","psd","eps"],videoType:["mp4","avi","mov","wmv","mkv","flv","webm","mpeg","mpg","3gp","ogv","mxf","vob","rm","rmvb","ts","mts","m2ts","divx","xvid"],audioType:["mp3","wav","aac","flac","ogg","wma","m4a","alac","opus","amr","aiff","au","pcm","ape"]};function Ve(e){return e!=null}const Me=({suffixCls:e,customizePrefixCls:t,isPor:n,className:r})=>{const i=r||(n?"gx-pro":"gx");return t||(e?`${i}-${e}`:i)},be=(e,t)=>e?y(e)?e.join("-"):e.toString():`${t||0}`;function $e(e,{align:t,showIndex:n}){const r=S(e);if(n&&e.length&&e.every(i=>i.dataIndex!=="sortIndex")){const i=e[0];r.unshift({title:"序号",align:t,fixed:i.fixed,width:60,uuid:oe().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else r.filter(i=>i.dataIndex!=="sortIndex");return r}function _e(e,...t){return typeof e=="function"?e(...t):e}function We(e){return JSON.parse(JSON.stringify(e))}function ze(e,t){if(h(e)){const{pageSize:n=10,total:r=0}=e;let{current:i=1}=e;return r-t<=n*(i-1)&&(i=i-1),i===0?1:i}return 1}function qe(e=[],t,n="children"){function r(i,o){return o.map((c,f)=>{const s=`${i}-${f+1}`;return c[n]&&(c[n]=r(s,c[n])),c.sortIndex=s,c})}return S(e).map((i,o)=>{const c=h(t)&&t.current||1,f=h(t)&&t.pageSize||10,s=`${(c-1)*f+(o+1)}`;return i[n]&&(i[n]=r(`${s}`,i[n])),i.sortIndex=s,i})}function He(e,t){return y(e)?e?.filter((n,r)=>{if(g(t))return r<=t-1;if(y(t)&&t.length===2){const i=t[0]-1,o=t[1]?t[1]-1:e.length-1;return r<=o&&r>=i}else if(y(t)&&t.length===1){const i=t[0]-1,o=e.length-1;return r<=o&&r>=i}return!0}):[]}function re(e,t,n,r=0){const i=g(r)&&(r===0||r===1)?r:0,o=e[n],c=t[n];let f=0;return o<c?f=i===0?-1:0:o>c&&(f=i===0?0:-1),f}function ie(e,t,n,r=0){const i=g(r)&&(r===0||r===1)?r:0,o=new Date(e[n]),c=new Date(t[n]);let f=0;return o<c?f=i===0?-1:0:o>c&&(f=i===0?0:-1),f}function xe(e,t,n=0){return e.sort((r,i)=>re(r,i,t,n))}function Je(e,t,n=0){return e.sort((r,i)=>ie(r,i,t,n))}function Ze(e){let t=S(e);const n=new Set(t);return t=Array.from(n),t}function Ke(e,t){const n=["null","undefined"];let r=!0;return e===0?r=!0:n.includes(e)?r=!1:e||(r=!1),r?{value:e,success:r}:{value:t===""?t:t||"-",success:r}}function Xe(e){let t="";if(e>-1){const n=Math.floor(e/3600),r=Math.floor(e/60)%60,i=Number.parseInt(String(e%60));n<10?t="0"+n+":":t=n+":",r<10&&(t+="0"),t+=r+":",i<10&&(t+="0"),t+=i}return t.split(":")[0]==="00"?`${t.split(":")[1]}:${t.split(":")[2]}`:t}function oe(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(t,n){const r=e,i=[],o=n||r.length;let c,f;if(t)for(c=0;c<t;c+=1)i[c]=r[Number.parseInt(String(Math.random()*o))];else for(i[8]="-",i[13]="-",i[18]="-",i[23]="-",i[14]="4",c=0;c<36;c+=1)i[c]||(f=Math.random()*16,i[c]=r[c===19?f&&3||8:f]);return i.join("")},uuidFast(){const t=e,n=Array.from({length:36});let r=0,i,o;for(o=0;o<36;o+=1)o===8||o===13||o===18||o===23?n[o]="-":o===14?n[o]="4":(r<=2&&(r=33554432+Math.random()*16777216||0),i=r&&15,r=r>4,n[o]=t[o===19?i&&3||8:i]);return n.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16||0;return(t==="x"?n:n&&3||8).toString(16)})}}}function fe(e,t){if(!Array.isArray(e)||e.length===0)return 0;const n=t||"children";return Math.max(...e.map(r=>{const i=r[n];return 1+(i?fe(i,n):0)}))}function ce(e,t="children"){let n=[];return e.forEach(r=>{n.push(r),y(r[t])&&r[t].length>0&&(n=n.concat(ce(r[t],t)))}),n}function Ge(e,t){if(!e||!y(e)||e?.length===0)return[];const{id:n="id",parentId:r="parentId",children:i="children",emptyChildren:o=!0}=t||{},c=t?.rootId??0,f=S(e);return f.map(s=>(!o&&s[i]&&s[i]?.length===0&&delete s[i],s)).filter(s=>{const u=f.filter(a=>s[n]===a[r]);return u.length>0?s[i]=u:o&&(s[i]=[]),c===!1?!0:s[r]===c})}function le(e,t){return e.map(n=>{const r={...n};return r.children&&(r.children=le(r.children,t)),t(r)||r.children&&r.children.length>0?r:null}).filter(Boolean)}function Ye(e,t,n){const{value:r,children:i}=n||{value:"value",children:"children"};let o=[];function c(f,s){if(f[r]===t)return o=[...s,f[r]],!0;if(f[i]){for(const u of f[i])if(c(u,[...s,f[r]]))return!0}return!1}for(const f of e)if(c(f,[]))break;return o}function Qe(e){return e&&y(e)?e[e.length-1]:null}function se(e,t,n){const r=n?.value||"id",i=n?.children||"children";for(const o of e){if(o[r]===t)return o;const c=o[i];if(c){const f=se(c,t,n);if(f)return f}}}function je(e){return URL.createObjectURL(e)}function ke(e){return new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=i=>n(i)})}function et(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let i=r.length;const o=new Uint8Array(i);for(;i--;)o[i]=r.charCodeAt(i);return new Blob([o],{type:n})}function tt(e,t){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],i=atob(n[1]);let o=i.length;const c=new Uint8Array(o);for(;o--;)c[o]=i.charCodeAt(o);return new File([c],t,{type:r})}function nt(e,t,n){return new window.File([e],t,{type:n})}function ue(e){if(!e||typeof e!="string")return"";const t=e.indexOf("?");return t>0?`${e.substring(0,t)}`:e}function E(e){if(!e||typeof e!="string")return"";const t=ue(e),n=t.lastIndexOf(".");return n>0&&`${t?.substring?.(n)?.split("?")?.[0]}`?.split(".")?.[1]||""}function C(e,t){if(t)return t;if(!e||e==="data:")return"4";let n="4";return N(e)?e.includes("data:image/")?n="png":e.includes("data:video/")?n="mp4":e.includes("data:audio/")&&(n="mp3"):e instanceof Blob?(e=String(e),e.includes("image")?n="png":e.includes("video")?n="mp4":e.includes("audio")&&(n="mp3")):n=E(e).toLowerCase(),O.imageType.includes(n)?"1":O.videoType.includes(n)?"3":O.audioType.includes(n)?"2":"4"}function ae(e){const{url:t="",fileType:n="1"}=e||{};let r="",i={play:!1,height:0,size:0,width:0,duration:0};function o(){i={play:!1,height:0,size:0,width:0,duration:0}}return t instanceof File?r=URL.createObjectURL(t):N(t)?r=t:t instanceof Blob?r=URL.createObjectURL(t):(t.includes("https")||t.includes("http"))&&(r=t),new Promise(c=>{let f;if(n==="4"){c(i);return}n==="1"?(f=document.createElement("img"),f.src=r):n==="2"?(f=document.createElement("audio"),f.src=r):n==="3"&&(f=document.createElement("video"),f.src=r),n==="1"?f.onload=function(){o(),i.play=!0,i.width=f.width||0,i.height=f.height||0,c(i),f=null}:f.oncanplay=function(){o(),i.play=!0,i.width=f?.videoWidth||0,i.height=f?.videoHeight||0,i.duration=f?.duration||0,c(i),f=null},f.onerror=function(){o(),c(i),f=null}})}async function rt(e){const{url:t="",currentTime:n,videoSuffix:r="",videoAllowPlay:i=!1}=e;let o="",c=r,f="1",s;return t instanceof File?(o=URL.createObjectURL(t),c=E(t.name),f=C(t.name)):t instanceof Blob?(o=URL.createObjectURL(t),f=C(t)):N(t)?(o=t,f=C(t)):(t.includes("https")||t.includes("http"))&&(o=t,c=E(t),f=C(t)),(c?O.videoAllowType.includes(c.toLowerCase()):!1)?i?V(o,n):(s=await ae({url:o,fileType:f}),s.play?V(o,n):new Promise(a=>{a("")})):new Promise(a=>{a("")})}async function V(e,t=0){return new Promise(n=>{let r=document.createElement("video");r&&(r.controls=!0,r.muted=!0,r.setAttribute("src",e),r.setAttribute("muted",String(!0)),r.setAttribute("crossorigin","anonymous"),r.setAttribute("autoplay",String(!0)),r.addEventListener("loadeddata",async()=>{let i;for(r?.addEventListener("seeked",async()=>{i&&i()});t<(r?.duration||0);){r&&(r.currentTime=t),await new Promise(T=>i=T);const o=document.createElement("canvas"),c=.8,f=o.getContext("2d"),s=r?.videoWidth||0*c,u=r?.videoHeight||0*c,a=0;o.width=r?.videoWidth||0*c,o.height=r?.videoHeight||0*c,r&&f.drawImage(r,0,0,s+a,u+a),r=null,n(s===0||u===0?"":o.toDataURL("image/png",1))}}))})}function N(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(n=>e.includes(n)))}function it(e){return typeof e=="string"&&/^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e)}function ot(e,t,n,r=!1){e&&t&&n&&e.addEventListener(t,n,r)}function ft(e,t,n,r=!1){e&&t&&n&&e.removeEventListener(t,n,r)}function ct(){return/windows|win32/i.test(navigator.userAgent)}function lt(e){return m(e)?e:!!e}function M(e,t){const n=`^\\d+(?:\\.\\d{0,${e}})?`,r=new RegExp(n),i=t.toString().match(r);if(i){const o=i[0];if(o.includes(".")){const[c,f]=o.split(".");if(/^0*$/.test(f))return c}return o}return t.toString()}function st(e,t){const{toChinese:n=!1,fixed:r=2,min:i=1e4}=t||{},o=g(i)?i:1e4,c=g(r)?r:2,f=n?e<o?"":e<1e8?"万":"亿":e<o?"":e<1e8?"w":"亿";if(!g(e))return{str:`${e}`,number:`${e}`};if(e<o)return{str:`${e}`,number:`${e}`};if(c===0){const u=(e/(e<1e8?1e4:1e8)).toFixed(1).split(".")[0];return{str:`${u}${f}`,number:u,unit:f}}let s;return e<1e8?(s=M(c,e/1e4),{str:s+f,number:s,unit:f}):(s=M(c,e/1e8),{str:s+f,number:s,unit:f})}function ut(e,t){let n=0;const r=m(t.removeAfter)?t.removeAfter:!0,i=t.id||"hiddenElement",o={opacity:0,visibility:"hidden",position:"fixed",zIndex:-1,top:0,left:0};let c=document.querySelector(`#${i}`);if(!c){const s=document.createElement("div");s.id=i,document.body.appendChild(s),c=document.querySelector(`#${i}`)}Object.assign(c.style,o);const f=document.createElement(t.createName||"span");return f.innerHTML=e,(t.cssObject||h(t.cssObject))&&Object.assign(f.style,t.cssObject),c.append(f),n=f.getBoundingClientRect()[t.type||"width"],r&&c.removeChild(f),n}function at(e){e=g(e)&&!Number.isNaN(e)?e:0;const t=["零","一","二","三","四","五","六","七","八","九"],n=["","十","百","千","万"];e=Number.parseInt(`${e}`);const r=c=>{const f=c.toString().split("").reverse();let s="";for(let u=0;u<f.length;u++)s=(u===0&&f[u]==="0"||u>0&&f[u]==="0"&&f[u-1]==="0"?"":(e<20&&u>0?"":t[f[u]])+(f[u]==="0"?n[0]:n[u]))+s;return s},i=Math.floor(e/1e4);let o=e%1e4;return o.toString().length<4&&(o="0"+o),i?r(i)+"万"+r(o):r(e)}function dt(e,t){Object.keys(e).forEach(n=>{t(n,e[n])})}l.Base64=de,l.arrayRepeat=Ze,l.arraySlice=He,l.blobToDataURL=nt,l.checkFileType=C,l.classNames=W,l.cloneDeep=S,l.compareArray=re,l.compareArraySort=xe,l.compareArrayTimeSort=Je,l.compareTime=ie,l.convertValueBoolean=lt,l.copyProperties=w,l.dataURLtoBlob=et,l.dataURLtoFile=tt,l.deepCopy=We,l.deepMerge=v,l.fileTypes=O,l.filterEmpty=R,l.filterTree=le,l.findSourceByTree=se,l.findValueAndAncestors=Ye,l.forInObject=dt,l.formatDuration=Xe,l.formatNumber=M,l.genColumnKey=be,l.generateVideoPicture=V,l.getArrayLast=Qe,l.getBase64=ke,l.getBlobUrl=je,l.getFileSuffix=E,l.getKeys=Pe,l.getLevelData=ce,l.getMaxFloor=fe,l.getMediaInfos=ae,l.getPrefixCls=Me,l.getRandomNumber=oe,l.getScroll=q,l.getScrollContainer=we,l.getSlot=te,l.getSlotVNode=ne,l.getSlotsChildren=De,l.getSlotsProps=Le,l.getSortIndex=qe,l.getSymbols=K,l.getTextWidth=ut,l.getValueFromObjectByKey=me,l.getVideoCoverPicture=rt,l.getVideoFileUrl=ue,l.handleCurrentPage=ze,l.handleEmptyField=Ke,l.handleShowIndex=$e,l.is=b,l.isArray=y,l.isBase64=N,l.isBoolean=m,l.isBrowser=Te,l.isDataURLBase64=it,l.isDeepEqualReact=I,l.isEmptyElement=ee,l.isFunction=ye,l.isImg=Ue,l.isInContainer=Ae,l.isJSONStr=ge,l.isMobile=he,l.isNil=Y,l.isNotNil=Ve,l.isNumber=g,l.isObject=h,l.isPlainObject=D,l.isPrimitive=X,l.isScroll=z,l.isServer=A,l.isString=$,l.isTablet=_,l.isTypedArray=G,l.isUrl=Ie,l.isValid=k,l.isWindowsOs=ct,l.merge=Re,l.nanoid=Ee,l.off=ft,l.omitBoolean=Ne,l.omitUndefined=Be,l.omitUndefinedAndEmptyArr=Fe,l.on=ot,l.raf=U,l.runFunction=_e,l.scrollTo=ve,l.slotRender=L,l.throttleByAnimationFrame=Oe,l.toChinesNum=at,l.toConvertNumberShow=st,l.treeData=Ge,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/slots/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { CustomRender, WithFalse } from '../typings';
|
|
3
3
|
export type SlotsPropsResult<S extends object, K extends keyof S, Render extends boolean> = {
|
|
4
|
-
[P in K]: Render extends true ? WithFalse<CustomRender> : S[P];
|
|
4
|
+
[P in K]: Render extends true ? WithFalse<CustomRender> : S[P] | false;
|
|
5
5
|
};
|
|
6
6
|
export declare function getKeys(keys: string | string[]): string | undefined;
|
|
7
7
|
export declare function isEmptyElement(c: any): any;
|
|
@@ -9,7 +9,10 @@ export declare function getSlotsChildren<T extends Readonly<Record<string, any>>
|
|
|
9
9
|
export declare function filterEmpty(children?: any[], isEmpty?: boolean): VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
}>[];
|
|
12
|
-
export declare function slotRender
|
|
12
|
+
export declare function slotRender({ vnode, defaultVnode }: {
|
|
13
|
+
vnode: any;
|
|
14
|
+
defaultVnode?: any;
|
|
15
|
+
}, ...arg: any): CustomRender;
|
|
13
16
|
/**
|
|
14
17
|
* @Author gx12358
|
|
15
18
|
* @DateTime 2024/2/2
|
|
@@ -23,14 +26,14 @@ export declare function getSlot<S extends object, K extends keyof S = keyof S>(s
|
|
|
23
26
|
export declare function getSlot<S extends object, K extends keyof S = keyof S>(slots: S, props: Record<string, any>, key: K, options?: {
|
|
24
27
|
render?: false;
|
|
25
28
|
default?: any;
|
|
26
|
-
}): S[K];
|
|
29
|
+
}): S[K] | false;
|
|
27
30
|
/**
|
|
28
31
|
* @Author gx12358
|
|
29
32
|
* @DateTime 2024/2/2
|
|
30
33
|
* @lastTime 2024/2/2
|
|
31
34
|
* @description VNode
|
|
32
35
|
*/
|
|
33
|
-
export declare function getSlotVNode<S extends object, K extends keyof S = keyof S>(slots: S, props: Record<string, any>, key: K, arg?: any):
|
|
36
|
+
export declare function getSlotVNode<S extends object, K extends keyof S = keyof S>(slots: S, props: Record<string, any>, key: K, arg?: any): WithFalse<CustomRender>;
|
|
34
37
|
/**
|
|
35
38
|
* @Author gx12358
|
|
36
39
|
* @DateTime 2024/10/13
|