@gx-design-vue/pro-utils 0.2.0-beta.50 → 0.2.0-beta.51
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/index.d.ts +9 -9
- package/dist/merge/index.d.ts +3 -1
- package/dist/omitUndefined/index.d.ts +1 -4
- package/dist/pro-utils.js +472 -462
- package/dist/pro-utils.umd.cjs +2 -2
- package/dist/slots/index.d.ts +1 -1
- package/dist/typings/index.d.ts +3 -1
- package/package.json +1 -1
package/dist/pro-utils.umd.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(u,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(u=typeof globalThis<"u"?globalThis:u||self,d(u.PorUtils={},u.vue))})(this,function(u,d){"use strict";function $(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function U(e){return typeof e=="boolean"}function p(e){return typeof e=="number"}function y(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function g(e){return e!==null&&$(e,"Object")}function x(e){return typeof e=="string"||e instanceof String}function oe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function fe(e){if(typeof e!="string")return!1;try{const t=JSON.parse(e);return typeof t=="object"&&t!==null}catch{return!1}}function ue(){const e=navigator.userAgent||navigator.vendor;return!!(/iPhone/.test(e)||/Android/.test(e)&&/Mobile/.test(e)||/Windows Phone/.test(e)||/Mobile/.test(e)&&!z())}function z(){const e=navigator.userAgent||navigator.vendor;return!!(/iPad/.test(e)||/Macintosh/.test(e)&&"ontouchend"in document||/Android/.test(e)&&!/Mobile/.test(e))}function b(...e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];if(n){if(x(n))t.push(n);else if(y(n))for(let i=0;i<n.length;i++){const o=b(n[i]);o&&t.push(o)}else if(g(n))for(const i in n)n[i]&&t.push(i)}}return t.filter(r=>r).join(" ")}function D(e,t){if(typeof t!="string"&&!Array.isArray(t))return;const r=Array.isArray(t)?t:t.split(":");let n=e;for(let i=0;i<r.length;i++)if(n&&n.hasOwnProperty(r[i]))n=n[r[i]];else return;return n}function ce(e){return/\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const le=e=>e==null,h=typeof window>"u",ae=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch{return!1}},se=(...e)=>{const t={},r=e.length;let n,i=0;for(;i<r;i+=1)for(n in e[i])e[i].hasOwnProperty(n)&&(typeof t[n]=="object"&&typeof e[i][n]=="object"&&t[n]!==void 0&&t[n]!==null&&!Array.isArray(t[n])&&!Array.isArray(e[i][n])?t[n]={...t[n],...e[i][n]}:t[n]=e[i][n]);return t},W=(e,t)=>{if(typeof e!="object"||e===null)throw new Error("Target must be an object");for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const n=r,i=t[n],o=e[n];Array.isArray(i)?e[n]=[...i]:typeof i=="object"&&i!==null&&typeof o=="object"&&o!==null?e[n]=W(o,i):i!==void 0&&(e[n]=i)}return e};let q=0;const H=(e=21)=>{if(typeof window>"u"||!window.crypto)return(q+=1).toFixed(0);let t="";const r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){const n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t},de=()=>typeof window>"u"?H():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():H();/**
|
|
2
2
|
* @vue/shared v3.5.13
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
|
-
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const ie=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},oe=/-(\w)/g,ue=ie(e=>e.replace(oe,(t,n)=>n?n.toUpperCase():"")),U=function(e,t){var n;if(h||!e||!t)return"";t=ue(t),t==="float"&&(t="cssFloat");try{const r=e.style[t];if(r)return r;const i=(n=document==null?void 0:document.defaultView)==null?void 0:n.getComputedStyle(e,"");return i?i[t]:""}catch{return e.style[t]}},$=(e,t)=>h?void 0:(t==null?U(e,"overflow"):t?U(e,"overflow-y"):U(e,"overflow-x")).match(/(scroll|auto|overlay)/),fe=(e,t)=>{if(h)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if($(n,t))return n;n=n.parentNode}return n},ce=(e,t)=>{if(h||!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 ae(e){return/\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const le=e=>e==null,se=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch{return!1}},de=(...e)=>{const t={},n=e.length;let r,i=0;for(;i<n;i+=1)for(r in e[i])e[i].hasOwnProperty(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};let x=0;const z=(e=21)=>{if(typeof window>"u"||!window.crypto)return(x+=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},ge=()=>typeof window>"u"?z():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():z();function D(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&&r.hasOwnProperty(n[i]))r=r[n[i]];else return;return r}function W(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function F(e){return typeof e=="boolean"}function m(e){return typeof e=="number"}function g(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function y(e){return e!==null&&W(e,"Object")}function q(e){return typeof e=="string"||e instanceof String}function ye(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function me(e){if(typeof e!="string")return!1;try{const t=JSON.parse(e);return typeof t=="object"&&t!==null}catch{return!1}}function pe(){const e=navigator.userAgent||navigator.vendor;return!!(/iPhone/.test(e)||/Android/.test(e)&&/Mobile/.test(e)||/Windows Phone/.test(e)||/Mobile/.test(e)&&!H())}function H(){const e=navigator.userAgent||navigator.vendor;return!!(/iPad/.test(e)||/Macintosh/.test(e)&&"ontouchend"in document||/Android/.test(e)&&!/Mobile/.test(e))}function _(...e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(r){if(q(r))t.push(r);else if(g(r))for(let i=0;i<r.length;i++){const o=_(r[i]);o&&t.push(o)}else if(y(r))for(const i in r)r[i]&&t.push(i)}}return t.filter(n=>n).join(" ")}let b=e=>setTimeout(e,16),J=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(b=e=>window.requestAnimationFrame(e),J=e=>window.cancelAnimationFrame(e));let X=0;const I=new Map;function Z(e){I.delete(e)}function B(e,t=1){X+=1;const n=X;function r(i){if(i===0)Z(n),e();else{const o=b(()=>{r(i-1)});I.set(n,o)}}return r(t),n}B.cancel=e=>{const t=I.get(e);return Z(t),J(t)};function P(e){return e!=null&&e===e.window}function Y(e,t){var i;if(typeof window>"u")return 0;const n=t?"scrollTop":"scrollLeft";let r=0;return P(e)?r=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?r=e.documentElement[n]:e&&(r=e[n]),e&&!P(e)&&typeof r!="number"&&(r=(i=(e.ownerDocument||e).documentElement)==null?void 0:i[n]),r}function we(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 he(e,t={}){const{getContainer:n=()=>window,callback:r,duration:i=450}=t,o=n(),u=Y(o,!0),c=Date.now(),a=()=>{const s=Date.now()-c,O=we(s>i?i:s,u,e,i);P(o)?o.scrollTo(window.pageXOffset,O):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=O:o.scrollTop=O,s<i?B(a):typeof r=="function"&&r()};o&&B(a)}function Se(e){let t;const n=i=>()=>{t=null,e(...i)},r=(...i)=>{t==null&&(t=requestAnimationFrame(n(i)))};return r.cancel=()=>cancelAnimationFrame(t),r}const S={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3"],imageType:["bmp","png","gif","jpg","jpeg","psd","tif"],videoType:["mp4","swf","rmvb","avi","flv","mpg","rm","mov","asf","3gp","mkv","ts","f4v","webm","m4v","3g2","m3u8"],audioType:["mp3","mpeg","aac","wav","wma","mp2","flac","midi","ra","ape","aac","cda"]};function Ae(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function ve(e){return e==null||typeof e!="object"&&typeof e!="function"}function Oe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function A(e){return p(e)}function p(e,t=new Map){if(ve(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(Oe(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),...Ae(t)];for(let i=0;i<r.length;i++){const o=r[i],u=Object.getOwnPropertyDescriptor(e,o);(u==null||u.writable)&&(e[o]=p(t[o],n))}}function E(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,u;if(Array.isArray(e)){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!E(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(!E(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(u=Object.keys(e),i=u.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,u[o]))return!1;for(o=i;o--!==0;){const c=u[o];if(!(n!=null&&n.includes(c))&&!(c==="_owner"&&e.$$typeof)&&!E(e[c],t[c],n,r))return r&&console.log(c),!1}return!0}return e!==e&&t!==t}const Ee=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Re=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Ee,Te=e=>{if(e&&e!==!0)return e},Ue=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},De=e=>{const t={};return Object.keys(e||{}).forEach(n=>{var r;Array.isArray(e[n])&&((r=e[n])==null?void 0:r.length)===0||e[n]!==void 0&&(t[n]=e[n])}),t};function C(e){var t;if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:(t=e.split(":"))==null?void 0:t.slice(-1)[0]}function G(e){return e&&(e.type===d.Comment||e.type===d.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function Fe(e,t){var n;return L((n=e[t])==null?void 0:n.call(e))}function L(e=[]){const t=[];return e.forEach(n=>{Array.isArray(n)?t.push(...n):(n==null?void 0:n.type)===d.Fragment?t.push(...L(n.children)):t.push(n)}),t.filter(n=>!G(n))}function N(e,...t){return typeof e=="function"?e==null?void 0:e(...t):e}function Q(e,t,n="default",r){const i=C(n);if(i){let o;const u=D(t,n);return u===!1?o=!1:u===!0?o=e==null?void 0:e[i]:y(u)&&r?d.isVNode(u)?o=u:o=e==null?void 0:e[i]:o=u||(e==null?void 0:e[i]),r?d.isVNode(o)?o:N(o):o}}function K(e,t,n="default",r){var o,u,c;const i=C(n);if(i){let a;const l=D(t,n);return l===!1?a=!1:l===!0?a=(o=e==null?void 0:e[i])==null?void 0:o.call(e,r):y(l)?d.isVNode(l)?a=l:a=(u=e==null?void 0:e[i])==null?void 0:u.call(e,r):a=l||((c=e==null?void 0:e[i])==null?void 0:c.call(e,r)),d.isVNode(a)?a:N(a,r)}}function Ie(e,t,n,r){const i={};return e.forEach(o=>{const u=C(o);if(u){const c=r!=null&&r.render?K(t,n,o,r==null?void 0:r.params):Q(t,n,o);(F(c)||c)&&(i[u]=c)}}),i}const Be=({suffixCls:e,customizePrefixCls:t,isPor:n,className:r})=>{const i=r||(n?"gx-pro":"gx");return t||(e?`${i}-${e}`:i)},Pe=(e,t)=>e?g(e)?e.join("-"):e.toString():`${t||0}`;function Ce(e,{align:t,showIndex:n}){const r=A(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:ee().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else r.filter(i=>i.dataIndex!=="sortIndex");return r}function Le(e,...t){return typeof e=="function"?e(...t):e}function Ne(e){return JSON.parse(JSON.stringify(e))}function Me(e,t){if(y(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 Ve(e=[],t,n="children"){function r(i,o){return o.map((u,c)=>{const a=`${i}-${c+1}`;return u[n]&&(u[n]=r(a,u[n])),u.sortIndex=a,u})}return A(e).map((i,o)=>{const u=y(t)&&t.current||1,c=y(t)&&t.pageSize||10,a=`${u?(u-1)*c+(o+1):o+1}`;return i[n]&&(i[n]=r(`${a}`,i[n])),i.sortIndex=a,i})}function $e(e,t){return g(e)?e==null?void 0:e.filter((n,r)=>{if(m(t))return r<=t-1;if(g(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(g(t)&&t.length===1){const i=t[0]-1,o=e.length-1;return r<=o&&r>=i}return!0}):[]}function j(e,t,n,r=0){const i=m(r)&&(r===0||r===1)?r:0,o=e[n],u=t[n];let c=0;return o<u?c=i===0?-1:0:o>u&&(c=i===0?0:-1),c}function k(e,t,n,r=0){const i=m(r)&&(r===0||r===1)?r:0,o=new Date(e[n]),u=new Date(t[n]);let c=0;return o<u?c=i===0?-1:0:o>u&&(c=i===0?0:-1),c}function xe(e,t,n=0){return e.sort((r,i)=>j(r,i,t,n))}function ze(e,t,n=0){return e.sort((r,i)=>k(r,i,t,n))}function We(e){let t=A(e);const n=new Set(t);return t=Array.from(n),t}function qe(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 He(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 ee(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(t,n){const r=e,i=[],o=n||r.length;let u,c;if(t)for(u=0;u<t;u+=1)i[u]=r[Number.parseInt(String(Math.random()*o))];else for(i[8]="-",i[13]="-",i[18]="-",i[23]="-",i[14]="4",u=0;u<36;u+=1)i[u]||(c=Math.random()*16,i[u]=r[u===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 _e(e=[],t="children"){let n=0;function r(i=[],o){i.forEach(u=>{u.floor=o,o>n&&(n=o),u[t]&&u[t].length>0&&r(u[t],o+1)})}return r(e,1),n}function te(e,t="children"){let n=[];return e.forEach(r=>{n.push(r),g(r[t])&&r[t].length>0&&(n=n.concat(te(r[t],t)))}),n}function be(e,t){if(!e||!g(e)||(e==null?void 0:e.length)===0)return[];const{id:n="id",parentId:r="parentId",children:i="children",rootId:o=0,emptyChildren:u=!0}=t||{},c=A(e);return c.map(a=>{var l;return!u&&a[i]&&((l=a[i])==null?void 0:l.length)===0&&delete a[i],a}).filter(a=>{const l=c.filter(s=>a[n]===s[r]);return l.length>0?a[i]=l:u&&(a[i]=[]),a[r]===o})}function Je(e){return URL.createObjectURL(e)}function Xe(e){return new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=i=>n(i)})}function Ze(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 Ye(e,t){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],i=atob(n[1]);let o=i.length;const u=new Uint8Array(o);for(;o--;)u[o]=i.charCodeAt(o);return new File([u],t,{type:r})}function Ge(e,t,n){return new window.File([e],t,{type:n})}function ne(e){if(!e||typeof e!="string")return"";const t=e.indexOf("?");return t>0?`${e.substring(0,t)}`:e}function R(e){var r,i,o,u,c;if(!e||typeof e!="string")return"";const t=ne(e),n=t.lastIndexOf(".");return n>0&&((c=(u=`${(o=(i=(r=t==null?void 0:t.substring)==null?void 0:r.call(t,n))==null?void 0:i.split("?"))==null?void 0:o[0]}`)==null?void 0:u.split("."))==null?void 0:c[1])||""}function v(e,t){if(t)return t;if(!e||e==="data:")return"4";let n="4";return T(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=R(e).toLowerCase(),S.imageType.includes(n)?"1":S.videoType.includes(n)?"3":S.audioType.includes(n)?"2":"4"}function re(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):T(t)?r=t:t instanceof Blob?r=URL.createObjectURL(t):(t.includes("https")||t.includes("http"))&&(r=t),new Promise(u=>{let c;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,u(i),c=null}:c.oncanplay=function(){o(),i.play=!0,i.width=(c==null?void 0:c.videoWidth)||0,i.height=(c==null?void 0:c.videoHeight)||0,i.duration=(c==null?void 0:c.duration)||0,u(i),c=null},c.onerror=function(){o(),u(i),c=null}})}async function Qe(e){const{url:t="",currentTime:n,videoSuffix:r="",vidoeAllowPlay:i=!1}=e;let o="",u=r,c="1",a;return t instanceof File?(o=URL.createObjectURL(t),u=R(t.name),c=v(t.name)):t instanceof Blob?(o=URL.createObjectURL(t),c=v(t)):T(t)?(o=t,c=v(t)):(t.includes("https")||t.includes("http"))&&(o=t,u=R(t),c=v(t)),(u?S.videoAllowType.includes(u.toLowerCase()):!1)?i?M(o,n):(a=await re({url:o,fileType:c}),a.play?M(o,n):new Promise(s=>{s("")})):new Promise(s=>{s("")})}async function M(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 function(){let i;for(r==null||r.addEventListener("seeked",async function(){i&&i()});t<((r==null?void 0:r.duration)||0);){r&&(r.currentTime=t),await new Promise(O=>i=O);const o=document.createElement("canvas"),u=.8,c=o.getContext("2d"),a=(r==null?void 0:r.videoWidth)||0*u,l=(r==null?void 0:r.videoHeight)||0*u,s=0;o.width=(r==null?void 0:r.videoWidth)||0*u,o.height=(r==null?void 0:r.videoHeight)||0*u,r&&c.drawImage(r,0,0,a+s,l+s),r=null,n(a===0||l===0?"":o.toDataURL("image/png",1))}}))})}function T(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(n=>e.includes(n)))}function Ke(e){return typeof e=="string"&&/^data:(image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e)}function je(e,t,n,r=!1){e&&t&&n&&e.addEventListener(t,n,r)}function ke(e,t,n,r=!1){e&&t&&n&&e.removeEventListener(t,n,r)}function et(){return/windows|win32/i.test(navigator.userAgent)}function tt(e){return F(e)?e:!!e}function V(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[u,c]=o.split(".");if(/^0*$/.test(c))return u}return o}return t.toString()}function nt(e,t){const{toChinese:n=!1,fixed:r=2,min:i=1e4}=t||{},o=m(i)?i:1e4,u=m(r)?r:2,c=n?e<o?"":e<1e8?"万":"亿":e<o?"":e<1e8?"w":"亿";if(!m(e))return{str:`${e}`,number:`${e}`};if(e<o)return{str:`${e}`,number:`${e}`};if(u===0){const l=(e/(e<1e8?1e4:1e8)).toFixed(1).split(".")[0];return{str:`${l}${c}`,number:l,unit:c}}let a;return e<1e8?(a=V(u,e/1e4),{str:a+c,number:a,unit:c}):(a=V(u,e/1e8),{str:a+c,number:a,unit:c})}function rt(e,t){let n=0;const r=document.querySelector(t.root||"hiddenElement");if(!r)return 0;const i=document.createElement(t.createName||"span");return i.innerHTML=e,(t.cssObject||y(t.cssObject))&&Object.keys(t.cssObject).forEach(o=>{var u,c;(u=t.cssObject)!=null&&u[o]&&(i.style[o]=(c=t.cssObject)==null?void 0:c[o])}),r.append(i),n=i.getBoundingClientRect()[t.type||"width"],r.removeChild(i),n}f.arrayRepeat=We,f.arraySlice=$e,f.blobToDataURL=Ge,f.checkFileType=v,f.classNames=_,f.cloneDeep=A,f.compareArray=j,f.compareArraySort=xe,f.compareArrayTimeSort=ze,f.compareTime=k,f.convertValueBoolean=tt,f.copyProperties=w,f.dataURLtoBlob=Ze,f.dataURLtoFile=Ye,f.deepCopy=Ne,f.filterEmpty=L,f.formatDuraton=He,f.formatNumber=V,f.genColumnKey=Pe,f.generateVidoePicture=M,f.getBase64=Xe,f.getBlobUrl=Je,f.getFileSuffix=R,f.getLevelData=te,f.getMaxFloor=_e,f.getMediaInfos=re,f.getPrefixCls=Be,f.getRandomNumber=ee,f.getScroll=Y,f.getScrollContainer=fe,f.getSlot=Q,f.getSlotVNode=K,f.getSlotsChildren=Fe,f.getSlotsProps=Ie,f.getSortIndex=Ve,f.getTextWidth=rt,f.getValueFromObjectByKey=D,f.getVideoCoverPicture=Qe,f.getVideoFileUrl=ne,f.globalConfig=S,f.handleCurrentPage=Me,f.handleShowIndex=Ce,f.hanndleEmptyField=qe,f.is=W,f.isArray=g,f.isBase64=T,f.isBoolean=F,f.isBrowser=Re,f.isDataURLBase64=Ke,f.isDeepEqualReact=E,f.isEmptyElement=G,f.isFunction=ye,f.isImg=ae,f.isInContainer=ce,f.isJSONStr=me,f.isMobile=pe,f.isNil=le,f.isNumber=m,f.isObject=y,f.isScroll=$,f.isServer=h,f.isString=q,f.isTablet=H,f.isUrl=se,f.isWindowsOs=et,f.merge=de,f.nanoid=ge,f.off=ke,f.omitBoolean=Te,f.omitUndefined=Ue,f.omitUndefinedAndEmptyArr=De,f.on=je,f.runFunction=Le,f.scrollTo=he,f.slotRender=N,f.throttleByAnimationFrame=Se,f.toConvertNumberShow=nt,f.treeData=be,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const ye=e=>{const t=Object.create(null);return r=>t[r]||(t[r]=e(r))},ge=/-(\w)/g,pe=ye(e=>e.replace(ge,(t,r)=>r?r.toUpperCase():"")),F=function(e,t){var r;if(h||!e||!t)return"";t=pe(t),t==="float"&&(t="cssFloat");try{const n=e.style[t];if(n)return n;const i=(r=document==null?void 0:document.defaultView)==null?void 0:r.getComputedStyle(e,"");return i?i[t]:""}catch{return e.style[t]}},_=(e,t)=>h?void 0:(t==null?F(e,"overflow"):t?F(e,"overflow-y"):F(e,"overflow-x")).match(/(scroll|auto|overlay)/),me=(e,t)=>{if(h)return;let r=e;for(;r;){if([window,document,document.documentElement].includes(r))return window;if(_(r,t))return r;r=r.parentNode}return r},we=(e,t)=>{if(h||!e||!t)return!1;const r=e.getBoundingClientRect();let n;return[window,document,document.documentElement,null,void 0].includes(t)?n={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:n=t.getBoundingClientRect(),r.top<n.bottom&&r.bottom>n.top&&r.right>n.left&&r.left<n.right};function I(e){return e!=null&&e===e.window}function J(e,t){var i;if(typeof window>"u")return 0;const r=t?"scrollTop":"scrollLeft";let n=0;return I(e)?n=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?n=e.documentElement[r]:e&&(n=e[r]),e&&!I(e)&&typeof n!="number"&&(n=(i=(e.ownerDocument||e).documentElement)==null?void 0:i[r]),n}function he(e,t,r,n){const i=r-t;return e/=n/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}let X=e=>setTimeout(e,16),Z=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(X=e=>window.requestAnimationFrame(e),Z=e=>window.cancelAnimationFrame(e));let Y=0;const B=new Map;function G(e){B.delete(e)}function P(e,t=1){Y+=1;const r=Y;function n(i){if(i===0)G(r),e();else{const o=X(()=>{n(i-1)});B.set(r,o)}}return n(t),r}P.cancel=e=>{const t=B.get(e);return G(t),Z(t)};function Se(e,t={}){const{getContainer:r=()=>window,callback:n,duration:i=450}=t,o=r(),f=J(o,!0),c=Date.now(),l=()=>{const s=Date.now()-c,O=he(s>i?i:s,f,e,i);I(o)?o.scrollTo(window.pageXOffset,O):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=O:o.scrollTop=O,s<i?P(l):typeof n=="function"&&n()};o&&P(l)}function Ae(e){let t;const r=i=>()=>{t=null,e(...i)},n=(...i)=>{t==null&&(t=requestAnimationFrame(r(i)))};return n.cancel=()=>cancelAnimationFrame(t),n}const S={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3"],imageType:["bmp","png","gif","jpg","jpeg","psd","tif"],videoType:["mp4","swf","rmvb","avi","flv","mpg","rm","mov","asf","3gp","mkv","ts","f4v","webm","m4v","3g2","m3u8"],audioType:["mp3","mpeg","aac","wav","wma","mp2","flac","midi","ra","ape","aac","cda"]};function ve(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Oe(e){return e==null||typeof e!="object"&&typeof e!="function"}function Ee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function A(e){return m(e)}function m(e,t=new Map){if(Oe(e))return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){const r=Array.from({length:e.length});t.set(e,r);for(let n=0;n<e.length;n++)r[n]=m(e[n],t);return Object.prototype.hasOwnProperty.call(e,"index")&&(r.index=e.index),Object.prototype.hasOwnProperty.call(e,"input")&&(r.input=e.input),r}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}if(e instanceof Map){const r=new Map;t.set(e,r);for(const[n,i]of e)r.set(n,m(i,t));return r}if(e instanceof Set){const r=new Set;t.set(e,r);for(const n of e)r.add(m(n,t));return r}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(Ee(e)){const r=new(Object.getPrototypeOf(e)).constructor(e.length);t.set(e,r);for(let n=0;n<e.length;n++)r[n]=m(e[n],t);return r}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const r=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return t.set(e,r),w(r,e,t),r}if(typeof File<"u"&&e instanceof File){const r=new File([e],e.name,{type:e.type});return t.set(e,r),w(r,e,t),r}if(e instanceof Blob){const r=new Blob([e],{type:e.type});return t.set(e,r),w(r,e,t),r}if(e instanceof Error){const r=new e.constructor;return t.set(e,r),r.message=e.message,r.name=e.name,r.stack=e.stack,r.cause=e.cause,w(r,e,t),r}if(typeof e=="object"&&e!==null){const r={};return t.set(e,r),w(r,e,t),r}return e}function w(e,t,r){const n=[...Object.keys(t),...ve(t)];for(let i=0;i<n.length;i++){const o=n[i],f=Object.getOwnPropertyDescriptor(e,o);(f==null||f.writable)&&(e[o]=m(t[o],r))}}const Re=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"&&!Re;function E(e,t,r,n){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(!E(e[o],t[o],r,n))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(!E(o[1],t.get(o[0]),r,n))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(!(r!=null&&r.includes(c))&&!(c==="_owner"&&e.$$typeof)&&!E(e[c],t[c],r,n))return n&&console.log(c),!1}return!0}return e!==e&&t!==t}const Ue=e=>{if(e&&e!==!0)return e},De=e=>{const t={};if(Object.keys(e||{}).forEach(r=>{e[r]!==void 0&&(t[r]=e[r])}),!(Object.keys(t).length<1))return t},Fe=e=>{const t={};return Object.keys(e||{}).forEach(r=>{var n;Array.isArray(e[r])&&((n=e[r])==null?void 0:n.length)===0||e[r]!==void 0&&(t[r]=e[r])}),t};function C(e){var t;if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:(t=e.split(":"))==null?void 0:t.slice(-1)[0]}function Q(e){return e&&(e.type===d.Comment||e.type===d.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function Ie(e,t){var r;return L((r=e[t])==null?void 0:r.call(e))}function L(e=[]){const t=[];return e.forEach(r=>{Array.isArray(r)?t.push(...r):(r==null?void 0:r.type)===d.Fragment?t.push(...L(r.children)):t.push(r)}),t.filter(r=>!Q(r))}function N(e,...t){return typeof e=="function"?e==null?void 0:e(...t):e}function K(e,t,r="default",n){const i=C(r);if(i){let o;const f=D(t,r);return f===!1?o=!1:f===!0?o=e==null?void 0:e[i]:g(f)&&n?d.isVNode(f)?o=f:o=e==null?void 0:e[i]:o=f||(e==null?void 0:e[i]),n?d.isVNode(o)?o:N(o):o}}function j(e,t,r="default",n){var o,f,c;const i=C(r);if(i){let l;const a=D(t,r);return a===!1?l=!1:a===!0?l=(o=e==null?void 0:e[i])==null?void 0:o.call(e,n):g(a)?d.isVNode(a)?l=a:l=(f=e==null?void 0:e[i])==null?void 0:f.call(e,n):l=a||((c=e==null?void 0:e[i])==null?void 0:c.call(e,n)),d.isVNode(l)?l:N(l,n)}}function Be(e,t,r,n){const i={};return e.forEach(o=>{const f=C(o);if(f){const c=n!=null&&n.render?j(t,r,o,n==null?void 0:n.params):K(t,r,o);(U(c)||c)&&(i[f]=c)}}),i}const Pe=({suffixCls:e,customizePrefixCls:t,isPor:r,className:n})=>{const i=n||(r?"gx-pro":"gx");return t||(e?`${i}-${e}`:i)},Ce=(e,t)=>e?y(e)?e.join("-"):e.toString():`${t||0}`;function Le(e,{align:t,showIndex:r}){const n=A(e);if(r&&e.length&&e.every(i=>i.dataIndex!=="sortIndex")){const i=e[0];n.unshift({title:"序号",align:t,fixed:i.fixed,width:60,uuid:te().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else n.filter(i=>i.dataIndex!=="sortIndex");return n}function Ne(e,...t){return typeof e=="function"?e(...t):e}function Me(e){return JSON.parse(JSON.stringify(e))}function Ve(e,t){if(g(e)){const{pageSize:r=10,total:n=0}=e;let{current:i=1}=e;return n-t<=r*(i-1)&&(i=i-1),i===0?1:i}return 1}function $e(e=[],t,r="children"){function n(i,o){return o.map((f,c)=>{const l=`${i}-${c+1}`;return f[r]&&(f[r]=n(l,f[r])),f.sortIndex=l,f})}return A(e).map((i,o)=>{const f=g(t)&&t.current||1,c=g(t)&&t.pageSize||10,l=`${f?(f-1)*c+(o+1):o+1}`;return i[r]&&(i[r]=n(`${l}`,i[r])),i.sortIndex=l,i})}function xe(e,t){return y(e)?e==null?void 0:e.filter((r,n)=>{if(p(t))return n<=t-1;if(y(t)&&t.length===2){const i=t[0]-1,o=t[1]?t[1]-1:e.length-1;return n<=o&&n>=i}else if(y(t)&&t.length===1){const i=t[0]-1,o=e.length-1;return n<=o&&n>=i}return!0}):[]}function k(e,t,r,n=0){const i=p(n)&&(n===0||n===1)?n:0,o=e[r],f=t[r];let c=0;return o<f?c=i===0?-1:0:o>f&&(c=i===0?0:-1),c}function ee(e,t,r,n=0){const i=p(n)&&(n===0||n===1)?n:0,o=new Date(e[r]),f=new Date(t[r]);let c=0;return o<f?c=i===0?-1:0:o>f&&(c=i===0?0:-1),c}function ze(e,t,r=0){return e.sort((n,i)=>k(n,i,t,r))}function be(e,t,r=0){return e.sort((n,i)=>ee(n,i,t,r))}function We(e){let t=A(e);const r=new Set(t);return t=Array.from(r),t}function qe(e,t){const r=["null","undefined"];let n=!0;return e===0?n=!0:r.includes(e)?n=!1:e||(n=!1),n?{value:e,success:n}:{value:t===""?t:t||"-",success:n}}function He(e){let t="";if(e>-1){const r=Math.floor(e/3600),n=Math.floor(e/60)%60,i=Number.parseInt(String(e%60));r<10?t="0"+r+":":t=r+":",n<10&&(t+="0"),t+=n+":",i<10&&(t+="0"),t+=i}return t.split(":")[0]==="00"?`${t.split(":")[1]}:${t.split(":")[2]}`:t}function te(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(t,r){const n=e,i=[],o=r||n.length;let f,c;if(t)for(f=0;f<t;f+=1)i[f]=n[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]=n[f===19?c&&3||8:c]);return i.join("")},uuidFast(){const t=e,r=Array.from({length:36});let n=0,i,o;for(o=0;o<36;o+=1)o===8||o===13||o===18||o===23?r[o]="-":o===14?r[o]="4":(n<=2&&(n=33554432+Math.random()*16777216||0),i=n&&15,n=n>4,r[o]=t[o===19?i&&3||8:i]);return r.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=Math.random()*16||0;return(t==="x"?r:r&&3||8).toString(16)})}}}function _e(e=[],t="children"){let r=0;function n(i=[],o){i.forEach(f=>{f.floor=o,o>r&&(r=o),f[t]&&f[t].length>0&&n(f[t],o+1)})}return n(e,1),r}function ne(e,t="children"){let r=[];return e.forEach(n=>{r.push(n),y(n[t])&&n[t].length>0&&(r=r.concat(ne(n[t],t)))}),r}function Je(e,t){if(!e||!y(e)||(e==null?void 0:e.length)===0)return[];const{id:r="id",parentId:n="parentId",children:i="children",rootId:o=0,emptyChildren:f=!0}=t||{},c=A(e);return c.map(l=>{var a;return!f&&l[i]&&((a=l[i])==null?void 0:a.length)===0&&delete l[i],l}).filter(l=>{const a=c.filter(s=>l[r]===s[n]);return a.length>0?l[i]=a:f&&(l[i]=[]),l[n]===o})}function Xe(e){return URL.createObjectURL(e)}function Ze(e){return new Promise((t,r)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(n.result),n.onerror=i=>r(i)})}function Ye(e){const t=e.split(","),r=t[0].match(/:(.*?);/)[1],n=atob(t[1]);let i=n.length;const o=new Uint8Array(i);for(;i--;)o[i]=n.charCodeAt(i);return new Blob([o],{type:r})}function Ge(e,t){const r=e.split(","),n=r[0].match(/:(.*?);/)[1],i=atob(r[1]);let o=i.length;const f=new Uint8Array(o);for(;o--;)f[o]=i.charCodeAt(o);return new File([f],t,{type:n})}function Qe(e,t,r){return new window.File([e],t,{type:r})}function re(e){if(!e||typeof e!="string")return"";const t=e.indexOf("?");return t>0?`${e.substring(0,t)}`:e}function R(e){var n,i,o,f,c;if(!e||typeof e!="string")return"";const t=re(e),r=t.lastIndexOf(".");return r>0&&((c=(f=`${(o=(i=(n=t==null?void 0:t.substring)==null?void 0:n.call(t,r))==null?void 0:i.split("?"))==null?void 0:o[0]}`)==null?void 0:f.split("."))==null?void 0:c[1])||""}function v(e,t){if(t)return t;if(!e||e==="data:")return"4";let r="4";return T(e)?e.includes("data:image/")?r="png":e.includes("data:video/")?r="mp4":e.includes("data:audio/")&&(r="mp3"):e instanceof Blob?(e=String(e),e.includes("image")?r="png":e.includes("video")?r="mp4":e.includes("audio")&&(r="mp3")):r=R(e).toLowerCase(),S.imageType.includes(r)?"1":S.videoType.includes(r)?"3":S.audioType.includes(r)?"2":"4"}function ie(e){const{url:t="",fileType:r="1"}=e||{};let n="",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?n=URL.createObjectURL(t):T(t)?n=t:t instanceof Blob?n=URL.createObjectURL(t):(t.includes("https")||t.includes("http"))&&(n=t),new Promise(f=>{let c;r==="1"?(c=document.createElement("img"),c.src=n):r==="2"?(c=document.createElement("audio"),c.src=n):r==="3"&&(c=document.createElement("video"),c.src=n),r==="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==null?void 0:c.videoWidth)||0,i.height=(c==null?void 0:c.videoHeight)||0,i.duration=(c==null?void 0:c.duration)||0,f(i),c=null},c.onerror=function(){o(),f(i),c=null}})}async function Ke(e){const{url:t="",currentTime:r,videoSuffix:n="",vidoeAllowPlay:i=!1}=e;let o="",f=n,c="1",l;return t instanceof File?(o=URL.createObjectURL(t),f=R(t.name),c=v(t.name)):t instanceof Blob?(o=URL.createObjectURL(t),c=v(t)):T(t)?(o=t,c=v(t)):(t.includes("https")||t.includes("http"))&&(o=t,f=R(t),c=v(t)),(f?S.videoAllowType.includes(f.toLowerCase()):!1)?i?M(o,r):(l=await ie({url:o,fileType:c}),l.play?M(o,r):new Promise(s=>{s("")})):new Promise(s=>{s("")})}async function M(e,t=0){return new Promise(r=>{let n=document.createElement("video");n&&(n.controls=!0,n.muted=!0,n.setAttribute("src",e),n.setAttribute("muted",String(!0)),n.setAttribute("crossorigin","anonymous"),n.setAttribute("autoplay",String(!0)),n.addEventListener("loadeddata",async()=>{let i;for(n==null||n.addEventListener("seeked",async()=>{i&&i()});t<((n==null?void 0:n.duration)||0);){n&&(n.currentTime=t),await new Promise(O=>i=O);const o=document.createElement("canvas"),f=.8,c=o.getContext("2d"),l=(n==null?void 0:n.videoWidth)||0*f,a=(n==null?void 0:n.videoHeight)||0*f,s=0;o.width=(n==null?void 0:n.videoWidth)||0*f,o.height=(n==null?void 0:n.videoHeight)||0*f,n&&c.drawImage(n,0,0,l+s,a+s),n=null,r(l===0||a===0?"":o.toDataURL("image/png",1))}}))})}function T(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(r=>e.includes(r)))}function je(e){return typeof e=="string"&&/^data:(image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e)}function ke(e,t,r,n=!1){e&&t&&r&&e.addEventListener(t,r,n)}function et(e,t,r,n=!1){e&&t&&r&&e.removeEventListener(t,r,n)}function tt(){return/windows|win32/i.test(navigator.userAgent)}function nt(e){return U(e)?e:!!e}function V(e,t){const r=`^\\d+(?:\\.\\d{0,${e}})?`,n=new RegExp(r),i=t.toString().match(n);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 rt(e,t){const{toChinese:r=!1,fixed:n=2,min:i=1e4}=t||{},o=p(i)?i:1e4,f=p(n)?n:2,c=r?e<o?"":e<1e8?"万":"亿":e<o?"":e<1e8?"w":"亿";if(!p(e))return{str:`${e}`,number:`${e}`};if(e<o)return{str:`${e}`,number:`${e}`};if(f===0){const a=(e/(e<1e8?1e4:1e8)).toFixed(1).split(".")[0];return{str:`${a}${c}`,number:a,unit:c}}let l;return e<1e8?(l=V(f,e/1e4),{str:l+c,number:l,unit:c}):(l=V(f,e/1e8),{str:l+c,number:l,unit:c})}function it(e,t){let r=0;const n=document.querySelector(t.root||"hiddenElement");if(!n)return 0;const i=document.createElement(t.createName||"span");return i.innerHTML=e,(t.cssObject||g(t.cssObject))&&Object.keys(t.cssObject).forEach(o=>{var f,c;(f=t.cssObject)!=null&&f[o]&&(i.style[o]=(c=t.cssObject)==null?void 0:c[o])}),n.append(i),r=i.getBoundingClientRect()[t.type||"width"],n.removeChild(i),r}u.arrayRepeat=We,u.arraySlice=xe,u.blobToDataURL=Qe,u.checkFileType=v,u.classNames=b,u.cloneDeep=A,u.compareArray=k,u.compareArraySort=ze,u.compareArrayTimeSort=be,u.compareTime=ee,u.convertValueBoolean=nt,u.copyProperties=w,u.dataURLtoBlob=Ye,u.dataURLtoFile=Ge,u.deepCopy=Me,u.deepMerge=W,u.filterEmpty=L,u.formatDuraton=He,u.formatNumber=V,u.genColumnKey=Ce,u.generateVidoePicture=M,u.getBase64=Ze,u.getBlobUrl=Xe,u.getFileSuffix=R,u.getLevelData=ne,u.getMaxFloor=_e,u.getMediaInfos=ie,u.getPrefixCls=Pe,u.getRandomNumber=te,u.getScroll=J,u.getScrollContainer=me,u.getSlot=K,u.getSlotVNode=j,u.getSlotsChildren=Ie,u.getSlotsProps=Be,u.getSortIndex=$e,u.getTextWidth=it,u.getValueFromObjectByKey=D,u.getVideoCoverPicture=Ke,u.getVideoFileUrl=re,u.globalConfig=S,u.handleCurrentPage=Ve,u.handleShowIndex=Le,u.hanndleEmptyField=qe,u.is=$,u.isArray=y,u.isBase64=T,u.isBoolean=U,u.isBrowser=Te,u.isDataURLBase64=je,u.isDeepEqualReact=E,u.isEmptyElement=Q,u.isFunction=oe,u.isImg=ce,u.isInContainer=we,u.isJSONStr=fe,u.isMobile=ue,u.isNil=le,u.isNumber=p,u.isObject=g,u.isScroll=_,u.isServer=h,u.isString=x,u.isTablet=z,u.isUrl=ae,u.isWindowsOs=tt,u.merge=se,u.nanoid=de,u.off=et,u.omitBoolean=Ue,u.omitUndefined=De,u.omitUndefinedAndEmptyArr=Fe,u.on=ke,u.runFunction=Ne,u.scrollTo=Se,u.slotRender=N,u.throttleByAnimationFrame=Ae,u.toConvertNumberShow=rt,u.treeData=Je,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
package/dist/slots/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VNode } from 'vue';
|
|
2
1
|
import type { CustomRender, WithFalse } from '../typings';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
3
|
export declare function isEmptyElement(c: any): any;
|
|
4
4
|
export declare function getSlotsChildren<T extends Readonly<Record<string, any>>>(slots: T, key: keyof T): VNode[];
|
|
5
5
|
export declare function filterEmpty(children?: VNode[]): VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Slot, VNode, VNodeChild } from 'vue';
|
|
2
|
-
export type
|
|
2
|
+
export type DeepPartial<T> = T extends object ? {
|
|
3
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
4
|
+
} : T;
|
|
3
5
|
export type Nullable<T> = T | null;
|
|
4
6
|
export type WithFalse<T> = T | false;
|
|
5
7
|
export type RecordType = Record<string, any>;
|