xmirror-components 1.0.3 → 1.0.4
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/build/dist/xmirror-components.js +1347 -523
- package/build/dist/xmirror-components.umd.cjs +12 -12
- package/build/es/hooks/index.d.ts +1 -0
- package/build/es/hooks/index.js +1 -0
- package/build/es/hooks/useRequest/index.d.ts +19 -0
- package/build/es/hooks/useRequest/index.js +28 -0
- package/build/{es/Button → lib/hooks}/index.js +3 -2
- package/build/lib/hooks/useRequest/index.js +30 -0
- package/build/package.json +1 -1
- package/package.json +1 -1
- package/build/es/Button/button.d.ts +0 -6
- package/build/es/Button/button.js +0 -22
- package/build/es/Button/index.d.ts +0 -3
- package/build/es/ChunkUploader/FileItem.d.ts +0 -13
- package/build/es/ChunkUploader/FileItem.js +0 -472
- package/build/es/ChunkUploader/UploaderContext.d.ts +0 -8
- package/build/es/ChunkUploader/UploaderContext.js +0 -65
- package/build/es/ChunkUploader/generateFileUniqueID.d.ts +0 -2
- package/build/es/ChunkUploader/generateFileUniqueID.js +0 -140
- package/build/es/ChunkUploader/index.d.ts +0 -4
- package/build/es/ChunkUploader/index.js +0 -259
- package/build/es/GlobalLoading/index.d.ts +0 -11
- package/build/es/GlobalLoading/index.js +0 -32
- package/build/es/LevelGroup/index.d.ts +0 -10
- package/build/es/LevelGroup/index.js +0 -33
- package/build/es/LevelTag/index.d.ts +0 -21
- package/build/es/LevelTag/index.js +0 -84
- package/build/es/SearchArea/Item/index.d.ts +0 -13
- package/build/es/SearchArea/Item/index.js +0 -38
- package/build/es/SearchArea/ToggleButton/index.d.ts +0 -9
- package/build/es/SearchArea/ToggleButton/index.js +0 -24
- package/build/es/SearchArea/index.d.ts +0 -13
- package/build/es/SearchArea/index.js +0 -153
- package/build/es/Table/Footer/index.d.ts +0 -3
- package/build/es/Table/Footer/index.js +0 -82
- package/build/es/Table/PopoverSetColumns/index.d.ts +0 -11
- package/build/es/Table/PopoverSetColumns/index.js +0 -164
- package/build/es/Table/index.d.ts +0 -4
- package/build/es/Table/index.js +0 -230
- package/build/es/Uploader/index.d.ts +0 -10
- package/build/es/Uploader/index.js +0 -175
- package/build/lib/Button/button.js +0 -22
- package/build/lib/Button/index.js +0 -7
- /package/build/es/{AntdApp → components/AntdApp}/index.d.ts +0 -0
- /package/build/es/{AntdApp → components/AntdApp}/index.js +0 -0
- /package/build/es/{CheckboxValue → components/CheckboxValue}/index.d.ts +0 -0
- /package/build/es/{CheckboxValue → components/CheckboxValue}/index.js +0 -0
- /package/build/es/{IconButton → components/IconButton}/index.d.ts +0 -0
- /package/build/es/{IconButton → components/IconButton}/index.js +0 -0
- /package/build/es/{IconFont → components/IconFont}/index.d.ts +0 -0
- /package/build/es/{IconFont → components/IconFont}/index.js +0 -0
- /package/build/es/{SwitchValue → components/SwitchValue}/index.d.ts +0 -0
- /package/build/es/{SwitchValue → components/SwitchValue}/index.js +0 -0
- /package/build/es/{index.d.ts → components/index.d.ts} +0 -0
- /package/build/es/{index.js → components/index.js} +0 -0
- /package/build/lib/{AntdApp → components/AntdApp}/index.js +0 -0
- /package/build/lib/{CheckboxValue → components/CheckboxValue}/index.js +0 -0
- /package/build/lib/{IconButton → components/IconButton}/index.js +0 -0
- /package/build/lib/{IconFont → components/IconFont}/index.js +0 -0
- /package/build/lib/{SwitchValue → components/SwitchValue}/index.js +0 -0
- /package/build/lib/{index.js → components/index.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(m
|
|
1
|
+
(function(j,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("antd")):typeof define=="function"&&define.amd?define(["exports","react","antd"],m):(j=typeof globalThis<"u"?globalThis:j||self,m(j.XMirrorComponents={},j.React,j.antd))})(this,function(j,m,H){"use strict";var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var le={exports:{}},$={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Je;function Ir(){if(Je)return $;Je=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,i,o){var c=null;if(o!==void 0&&(c=""+o),i.key!==void 0&&(c=""+i.key),"key"in i){o={};for(var s in i)s!=="key"&&(o[s]=i[s])}else o=i;return i=o.ref,{$$typeof:e,type:a,key:c,ref:i!==void 0?i:null,props:o}}return $.Fragment=t,$.jsx=r,$.jsxs=r,$}var ee={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
at`)?" (<anonymous>)":-1<
|
|
19
|
-
`+
|
|
20
|
-
`),
|
|
21
|
-
`);for(
|
|
22
|
-
`+
|
|
17
|
+
*/var Xe;function Br(){return Xe||(Xe=1,process.env.NODE_ENV!=="production"&&function(){function e(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===on?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case U:return"Fragment";case V:return"Portal";case A:return"Profiler";case I:return"StrictMode";case J:return"Suspense";case w:return"SuspenseList"}if(typeof n=="object")switch(typeof n.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case he:return(n.displayName||"Context")+".Provider";case ie:return(n._context.displayName||"Context")+".Consumer";case ue:var v=n.render;return n=n.displayName,n||(n=v.displayName||v.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case C:return v=n.displayName||null,v!==null?v:e(n.type)||"Memo";case B:v=n._payload,n=n._init;try{return e(n(v))}catch{}}return null}function t(n){return""+n}function r(n){try{t(n);var v=!1}catch{v=!0}if(v){v=console;var b=v.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return b.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),t(n)}}function a(){}function i(){if(ce===0){Sr=console.log,Or=console.info,xr=console.warn,Pr=console.error,Ar=console.group,Cr=console.groupCollapsed,Nr=console.groupEnd;var n={configurable:!0,enumerable:!0,value:a,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}ce++}function o(){if(ce--,ce===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:q({},n,{value:Sr}),info:q({},n,{value:Or}),warn:q({},n,{value:xr}),error:q({},n,{value:Pr}),group:q({},n,{value:Ar}),groupCollapsed:q({},n,{value:Cr}),groupEnd:q({},n,{value:Nr})})}0>ce&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function c(n){if(ze===void 0)try{throw Error()}catch(b){var v=b.stack.trim().match(/\n( *(at )?)/);ze=v&&v[1]||"",kr=-1<b.stack.indexOf(`
|
|
18
|
+
at`)?" (<anonymous>)":-1<b.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
+
`+ze+n+kr}function s(n,v){if(!n||De)return"";var b=Ve.get(n);if(b!==void 0)return b;De=!0,b=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var E=null;E=X.H,X.H=null,i();try{var O={DetermineComponentFrameRoot:function(){try{if(v){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(Y){var pe=Y}Reflect.construct(n,[],z)}else{try{z.call()}catch(Y){pe=Y}n.call(z.prototype)}}else{try{throw Error()}catch(Y){pe=Y}(z=n())&&typeof z.catch=="function"&&z.catch(function(){})}}catch(Y){if(Y&&pe&&typeof Y.stack=="string")return[Y.stack,pe.stack]}return[null,null]}};O.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var R=Object.getOwnPropertyDescriptor(O.DetermineComponentFrameRoot,"name");R&&R.configurable&&Object.defineProperty(O.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=O.DetermineComponentFrameRoot(),G=y[0],K=y[1];if(G&&K){var x=G.split(`
|
|
20
|
+
`),Z=K.split(`
|
|
21
|
+
`);for(y=R=0;R<x.length&&!x[R].includes("DetermineComponentFrameRoot");)R++;for(;y<Z.length&&!Z[y].includes("DetermineComponentFrameRoot");)y++;if(R===x.length||y===Z.length)for(R=x.length-1,y=Z.length-1;1<=R&&0<=y&&x[R]!==Z[y];)y--;for(;1<=R&&0<=y;R--,y--)if(x[R]!==Z[y]){if(R!==1||y!==1)do if(R--,y--,0>y||x[R]!==Z[y]){var se=`
|
|
22
|
+
`+x[R].replace(" at new "," at ");return n.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",n.displayName)),typeof n=="function"&&Ve.set(n,se),se}while(1<=R&&0<=y);break}}}finally{De=!1,X.H=E,o(),Error.prepareStackTrace=b}return x=(x=n?n.displayName||n.name:"")?c(x):"",typeof n=="function"&&Ve.set(n,x),x}function f(n){if(n==null)return"";if(typeof n=="function"){var v=n.prototype;return s(n,!(!v||!v.isReactComponent))}if(typeof n=="string")return c(n);switch(n){case J:return c("Suspense");case w:return c("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case ue:return n=s(n.render,!1),n;case C:return f(n.type);case B:v=n._payload,n=n._init;try{return f(n(v))}catch{}}return""}function u(){var n=X.A;return n===null?null:n.getOwner()}function d(n){if(_r.call(n,"key")){var v=Object.getOwnPropertyDescriptor(n,"key").get;if(v&&v.isReactWarning)return!1}return n.key!==void 0}function l(n,v){function b(){Mr||(Mr=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}b.isReactWarning=!0,Object.defineProperty(n,"key",{get:b,configurable:!0})}function p(){var n=e(this.type);return Wr[n]||(Wr[n]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),n=this.props.ref,n!==void 0?n:null}function h(n,v,b,E,O,R){return b=R.ref,n={$$typeof:W,type:n,key:v,props:R,_owner:O},(b!==void 0?b:null)!==null?Object.defineProperty(n,"ref",{enumerable:!1,get:p}):Object.defineProperty(n,"ref",{enumerable:!1,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}function g(n,v,b,E,O,R){if(typeof n=="string"||typeof n=="function"||n===U||n===A||n===I||n===J||n===w||n===ye||typeof n=="object"&&n!==null&&(n.$$typeof===B||n.$$typeof===C||n.$$typeof===he||n.$$typeof===ie||n.$$typeof===ue||n.$$typeof===un||n.getModuleId!==void 0)){var y=v.children;if(y!==void 0)if(E)if(Ue(y)){for(E=0;E<y.length;E++)T(y[E],n);Object.freeze&&Object.freeze(y)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else T(y,n)}else y="",(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),n===null?E="null":Ue(n)?E="array":n!==void 0&&n.$$typeof===W?(E="<"+(e(n.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):E=typeof n,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,y);if(_r.call(v,"key")){y=e(n);var G=Object.keys(v).filter(function(x){return x!=="key"});E=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",Lr[y+E]||(G=0<G.length?"{"+G.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
23
|
let props = %s;
|
|
24
24
|
<%s {...props} />
|
|
25
25
|
React keys must be passed directly to JSX without using spread:
|
|
26
26
|
let props = %s;
|
|
27
|
-
<%s key={someKey} {...props} />`,
|
|
27
|
+
<%s key={someKey} {...props} />`,E,y,G,y),Lr[y+E]=!0)}if(y=null,b!==void 0&&(r(b),y=""+b),d(v)&&(r(v.key),y=""+v.key),"key"in v){b={};for(var K in v)K!=="key"&&(b[K]=v[K])}else b=v;return y&&l(b,typeof n=="function"?n.displayName||n.name||"Unknown":n),h(n,y,R,O,u(),b)}function T(n,v){if(typeof n=="object"&&n&&n.$$typeof!==cn){if(Ue(n))for(var b=0;b<n.length;b++){var E=n[b];P(E)&&L(E,v)}else if(P(n))n._store&&(n._store.validated=1);else if(n===null||typeof n!="object"?b=null:(b=jr&&n[jr]||n["@@iterator"],b=typeof b=="function"?b:null),typeof b=="function"&&b!==n.entries&&(b=b.call(n),b!==n))for(;!(n=b.next()).done;)P(n.value)&&L(n.value,v)}}function P(n){return typeof n=="object"&&n!==null&&n.$$typeof===W}function L(n,v){if(n._store&&!n._store.validated&&n.key==null&&(n._store.validated=1,v=M(v),!Fr[v])){Fr[v]=!0;var b="";n&&n._owner!=null&&n._owner!==u()&&(b=null,typeof n._owner.tag=="number"?b=e(n._owner.type):typeof n._owner.name=="string"&&(b=n._owner.name),b=" It was passed a child from "+b+".");var E=X.getCurrentStack;X.getCurrentStack=function(){var O=f(n.type);return E&&(O+=E()||""),O},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',v,b),X.getCurrentStack=E}}function M(n){var v="",b=u();return b&&(b=e(b.type))&&(v=`
|
|
28
28
|
|
|
29
|
-
Check the render method of \``+
|
|
29
|
+
Check the render method of \``+b+"`."),v||(n=e(n))&&(v=`
|
|
30
30
|
|
|
31
|
-
Check the top-level render call using <`+
|
|
31
|
+
Check the top-level render call using <`+n+">."),v}var F=m,W=Symbol.for("react.transitional.element"),V=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),ie=Symbol.for("react.consumer"),he=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),ye=Symbol.for("react.offscreen"),jr=Symbol.iterator,on=Symbol.for("react.client.reference"),X=F.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_r=Object.prototype.hasOwnProperty,q=Object.assign,un=Symbol.for("react.client.reference"),Ue=Array.isArray,ce=0,Sr,Or,xr,Pr,Ar,Cr,Nr;a.__reactDisabledLog=!0;var ze,kr,De=!1,Ve=new(typeof WeakMap=="function"?WeakMap:Map),cn=Symbol.for("react.client.reference"),Mr,Wr={},Lr={},Fr={};ee.Fragment=U,ee.jsx=function(n,v,b,E,O){return g(n,v,b,!1,E,O)},ee.jsxs=function(n,v,b,E,O){return g(n,v,b,!0,E,O)}}()),ee}var qe;function Gr(){return qe||(qe=1,process.env.NODE_ENV==="production"?le.exports=Ir():le.exports=Br()),le.exports}var k=Gr();const Yr=({checked:e,onChange:t,trueValue:r=!0,falseValue:a=!1,trueLabel:i="",falseLabel:o="",children:c,...s})=>{const f=e===r,u=d=>{t==null||t(d.target.checked?r:a,d)};return k.jsx(H.Checkbox,{checked:f,onChange:u,...s,children:c||(f?i:o)})};var Hr=typeof global=="object"&&global&&global.Object===Object&&global,Ur=typeof self=="object"&&self&&self.Object===Object&&self,zr=Hr||Ur||Function("return this")(),de=zr.Symbol,Ze=Object.prototype,Dr=Ze.hasOwnProperty,Vr=Ze.toString,re=de?de.toStringTag:void 0;function Jr(e){var t=Dr.call(e,re),r=e[re];try{e[re]=void 0;var a=!0}catch{}var i=Vr.call(e);return a&&(t?e[re]=r:delete e[re]),i}var Xr=Object.prototype,qr=Xr.toString;function Zr(e){return qr.call(e)}var Qr="[object Null]",Kr="[object Undefined]",Qe=de?de.toStringTag:void 0;function $r(e){return e==null?e===void 0?Kr:Qr:Qe&&Qe in Object(e)?Jr(e):Zr(e)}function et(e){return e!=null&&typeof e=="object"}var rt=Array.isArray;function tt(){}var nt="[object String]";function at(e){return typeof e=="string"||!rt(e)&&et(e)&&$r(e)==nt}var Te={exports:{}};/*!
|
|
32
32
|
Copyright (c) 2018 Jed Watson.
|
|
33
33
|
Licensed under the MIT License (MIT), see
|
|
34
34
|
http://jedwatson.github.io/classnames
|
|
35
|
-
*/var se;function tr(){return se||(se=1,function(r){(function(){var u={}.hasOwnProperty;function t(){for(var n="",c=0;c<arguments.length;c++){var l=arguments[c];l&&(n=s(n,i(l)))}return n}function i(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var c="";for(var l in n)u.call(n,l)&&n[l]&&(c=s(c,l));return c}function s(n,c){return c?n?n+" "+c:n+c:n}r.exports?(t.default=t,r.exports=t):window.classNames=t})()}(I)),I.exports}var nr=tr();const or=Me(nr);function B(r,u){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,n=[],c;try{for(;(u===void 0||u-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(l){c={error:l}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(c)throw c.error}}return n}typeof SuppressedError=="function"&&SuppressedError;var ce=function(r){return typeof r=="function"},ar=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";function ie(r,u){if(r===u)return!0;for(var t=0;t<r.length;t++)if(!Object.is(r[t],u[t]))return!1;return!0}function fe(r){var u=g.useRef(r);return u.current=r,u}var ur=function(r){ar&&(ce(r)||console.error("useUnmount expected parameter is a function, got ".concat(typeof r)));var u=fe(r);g.useEffect(function(){return function(){u.current()}},[])},sr=!!(typeof window<"u"&&window.document&&window.document.createElement);function cr(r,u){var t=B(g.useState(r),2),i=t[0],s=t[1],n=g.useMemo(function(){var c=!0,l=function(){return s(function(h){return h===r?c:r})},d=function(h){return s(h)},b=function(){return s(r)},_=function(){return s(c)};return{toggle:l,set:d,setLeft:b,setRight:_}},[]);return[i,n]}function ir(r){var u=B(cr(!1),2),t=u[0],i=u[1],s=i.toggle,n=i.set,c=g.useMemo(function(){var l=function(){return n(!0)},d=function(){return n(!1)};return{toggle:s,set:function(b){return n(!!b)},setTrue:l,setFalse:d}},[]);return[t,c]}function le(r,u){if(sr){if(!r)return u;var t;return ce(r)?t=r():"current"in r?t=r.current:t=r,t}}var fr=function(r){var u=function(t,i,s){var n=g.useRef(!1),c=g.useRef([]),l=g.useRef([]),d=g.useRef();r(function(){var b,_=Array.isArray(s)?s:[s],h=_.map(function(M){return le(M)});if(!n.current){n.current=!0,c.current=h,l.current=i,d.current=t();return}(h.length!==c.current.length||!ie(c.current,h)||!ie(l.current,i))&&((b=d.current)===null||b===void 0||b.call(d),c.current=h,l.current=i,d.current=t())}),ur(function(){var b;(b=d.current)===null||b===void 0||b.call(d),n.current=!1})};return u},lr=fr(g.useEffect);function ve(r,u,t){t===void 0&&(t={});var i=t.enable,s=i===void 0?!0:i,n=fe(u);lr(function(){if(s){var c=le(t.target,window);if(c!=null&&c.addEventListener){var l=function(b){return n.current(b)},d=Array.isArray(r)?r:[r];return d.forEach(function(b){c.addEventListener(b,l,{capture:t.capture,once:t.once,passive:t.passive})}),function(){d.forEach(function(b){c.removeEventListener(b,l,{capture:t.capture})})}}}},[r,t.capture,t.once,t.passive,s],t.target)}const vr=function(r,u){var t={},i=t.onEnter,s=t.onLeave,n=t.onChange,c=B(ir(),2),l=c[0],d=c[1],b=d.setTrue,_=d.setFalse;return ve("mouseenter",function(){i==null||i(),b(),n==null||n(!0)},{target:r}),ve("mouseleave",function(){s==null||s(),_(),n==null||n(!1)},{target:r}),l},de=g.forwardRef(({type:r="",className:u="",symbol:t=!1,...i},s)=>t?T.jsx("svg",{className:`iconfont-symbol ${r} ${u}`,"aria-hidden":"true",ref:s,...i,children:T.jsx("use",{xlinkHref:`#${r}`})}):T.jsx("i",{className:`iconfont ${r} ${u}`,ref:s,...i})),dr={btn_icon__warp:"_btn_icon__warp_ay6he_1"},br=(r,u)=>{const t=g.useRef(null),{icon:i,tooltipDisabled:s=!1,onClick:n=De,disabled:c,size:l="middle",style:d={},className:b,loading:_=!1,...h}=r,M=vr(t),z=()=>rr(i)&&i.includes("icon-")?T.jsx(de,{type:i}):i,Y=T.jsx(S.Button,{onClick:n,size:l,disabled:c,style:d,ref:u,loading:_,className:or([b,dr.btn_icon__warp]),icon:z()});if(!i)throw new Error("IconButton 组件必须传入 icon 属性");return T.jsxs(g.Fragment,{children:[s&&Y,!s&&T.jsx(S.Tooltip,{open:M,trigger:"contextMenu",destroyTooltipOnHide:!0,...h,children:T.jsx("span",{ref:t,style:{display:"inline-block"},className:"icon-button-box",children:Y})})]})},Er=g.forwardRef(br),gr=({checked:r,onChange:u,trueValue:t=!0,falseValue:i=!1,...s})=>{const n=r===t,c=(l,d)=>{u==null||u(l?t:i,d)};return T.jsx(S.Switch,{checked:n,onChange:c,...s})};m.message=S.message,m.notification=S.notification,m.modal=S.Modal;function mr({children:r}){const u=S.App.useApp();return m.message=u.message,m.modal=u.modal,m.notification=u.notification,r}m.App=mr,m.CheckboxValue=Fe,m.IconButton=Er,m.IconFont=de,m.SwitchValue=gr,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
35
|
+
*/var Ke;function ot(){return Ke||(Ke=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(o=i(o,a(s)))}return o}function a(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var c="";for(var s in o)t.call(o,s)&&o[s]&&(c=i(c,s));return c}function i(o,c){return c?o?o+" "+c:o+c:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(Te)),Te.exports}var it=ot();const ut=Ee(it);var ct=function(e){return function(t,r){var a=m.useRef(!1);e(function(){return function(){a.current=!1}},[]),e(function(){if(!a.current)a.current=!0;else return t()},r)}},N=function(){return N=Object.assign||function(t){for(var r,a=1,i=arguments.length;a<i;a++){r=arguments[a];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},N.apply(this,arguments)};function $e(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(r[a[i]]=e[a[i]]);return r}function st(e,t,r,a){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function s(d){try{u(a.next(d))}catch(l){c(l)}}function f(d){try{u(a.throw(d))}catch(l){c(l)}}function u(d){d.done?o(d.value):i(d.value).then(s,f)}u((a=a.apply(e,t||[])).next())})}function ft(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,i,o,c=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return c.next=s(0),c.throw=s(1),c.return=s(2),typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function s(u){return function(d){return f([u,d])}}function f(u){if(a)throw new TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(r=0)),r;)try{if(a=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(d){u=[6,d],i=0}finally{a=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),i,o=[],c;try{for(;(t===void 0||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(s){c={error:s}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(c)throw c.error}}return o}function S(e,t,r){if(r||arguments.length===2)for(var a=0,i=t.length,o;a<i;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var te=function(e){return typeof e=="function"},ve=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";function Q(e){ve&&(te(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var t=m.useRef(e);t.current=m.useMemo(function(){return e},[e]);var r=m.useRef();return r.current||(r.current=function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];return t.current.apply(this,a)}),r.current}const we=ct(m.useEffect);var er=function(e,t){var r=t.manual,a=t.ready,i=a===void 0?!0:a,o=t.defaultParams,c=o===void 0?[]:o,s=t.refreshDeps,f=s===void 0?[]:s,u=t.refreshDepsAction,d=m.useRef(!1);return d.current=!1,we(function(){!r&&i&&(d.current=!0,e.run.apply(e,S([],_(c),!1)))},[i]),we(function(){d.current||r||(d.current=!0,u?u():e.refresh())},S([],_(f),!1)),{onBefore:function(){if(!i)return{stopNow:!0}}}};er.onInit=function(e){var t=e.ready,r=t===void 0?!0:t,a=e.manual;return{loading:!a&&r}};function Re(e,t){if(e===t)return!0;for(var r=0;r<e.length;r++)if(!Object.is(e[r],t[r]))return!1;return!0}function rr(e,t){var r=m.useRef({deps:t,obj:void 0,initialized:!1}).current;return(r.initialized===!1||!Re(r.deps,t))&&(r.deps=t,r.obj=e(),r.initialized=!0),r.obj}function je(e){var t=m.useRef(e);return t.current=e,t}var be=function(e){ve&&(te(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=je(e);m.useEffect(function(){return function(){t.current()}},[])},ge=new Map,lt=function(e,t,r){var a=ge.get(e);a!=null&&a.timer&&clearTimeout(a.timer);var i=void 0;t>-1&&(i=setTimeout(function(){ge.delete(e)},t)),ge.set(e,N(N({},r),{timer:i}))},dt=function(e){return ge.get(e)},me=new Map,vt=function(e){return me.get(e)},bt=function(e,t){me.set(e,t),t.then(function(r){return me.delete(e),r}).catch(function(){me.delete(e)})},D={},gt=function(e,t){D[e]&&D[e].forEach(function(r){return r(t)})},_e=function(e,t){return D[e]||(D[e]=[]),D[e].push(t),function(){var a=D[e].indexOf(t);D[e].splice(a,1)}},mt=function(e,t){var r=t.cacheKey,a=t.cacheTime,i=a===void 0?5*60*1e3:a,o=t.staleTime,c=o===void 0?0:o,s=t.setCache,f=t.getCache,u=m.useRef(),d=m.useRef(),l=function(h,g){s?s(g):lt(h,i,g),gt(h,g.data)},p=function(h,g){return g===void 0&&(g=[]),f?f(g):dt(h)};return rr(function(){if(r){var h=p(r);h&&Object.hasOwnProperty.call(h,"data")&&(e.state.data=h.data,e.state.params=h.params,(c===-1||new Date().getTime()-h.time<=c)&&(e.state.loading=!1)),u.current=_e(r,function(g){e.setState({data:g})})}},[]),be(function(){var h;(h=u.current)===null||h===void 0||h.call(u)}),r?{onBefore:function(h){var g=p(r,h);return!g||!Object.hasOwnProperty.call(g,"data")?{}:c===-1||new Date().getTime()-g.time<=c?{loading:!1,data:g==null?void 0:g.data,error:void 0,returnNow:!0}:{data:g==null?void 0:g.data,error:void 0}},onRequest:function(h,g){var T=vt(r);return T&&T!==d.current?{servicePromise:T}:(T=h.apply(void 0,S([],_(g),!1)),d.current=T,bt(r,T),{servicePromise:T})},onSuccess:function(h,g){var T;r&&((T=u.current)===null||T===void 0||T.call(u),l(r,{data:h,params:g,time:new Date().getTime()}),u.current=_e(r,function(P){e.setState({data:P})}))},onMutate:function(h){var g;r&&((g=u.current)===null||g===void 0||g.call(u),l(r,{data:h,params:e.state.params,time:new Date().getTime()}),u.current=_e(r,function(T){e.setState({data:T})}))}}:{}},Se,tr;function Oe(){if(tr)return Se;tr=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Se=e,Se}var xe,nr;function ht(){if(nr)return xe;nr=1;var e=typeof fe=="object"&&fe&&fe.Object===Object&&fe;return xe=e,xe}var Pe,ar;function or(){if(ar)return Pe;ar=1;var e=ht(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Pe=r,Pe}var Ae,ir;function yt(){if(ir)return Ae;ir=1;var e=or(),t=function(){return e.Date.now()};return Ae=t,Ae}var Ce,ur;function pt(){if(ur)return Ce;ur=1;var e=/\s/;function t(r){for(var a=r.length;a--&&e.test(r.charAt(a)););return a}return Ce=t,Ce}var Ne,cr;function Et(){if(cr)return Ne;cr=1;var e=pt(),t=/^\s+/;function r(a){return a&&a.slice(0,e(a)+1).replace(t,"")}return Ne=r,Ne}var ke,sr;function fr(){if(sr)return ke;sr=1;var e=or(),t=e.Symbol;return ke=t,ke}var Me,lr;function Tt(){if(lr)return Me;lr=1;var e=fr(),t=Object.prototype,r=t.hasOwnProperty,a=t.toString,i=e?e.toStringTag:void 0;function o(c){var s=r.call(c,i),f=c[i];try{c[i]=void 0;var u=!0}catch{}var d=a.call(c);return u&&(s?c[i]=f:delete c[i]),d}return Me=o,Me}var We,dr;function wt(){if(dr)return We;dr=1;var e=Object.prototype,t=e.toString;function r(a){return t.call(a)}return We=r,We}var Le,vr;function Rt(){if(vr)return Le;vr=1;var e=fr(),t=Tt(),r=wt(),a="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function c(s){return s==null?s===void 0?i:a:o&&o in Object(s)?t(s):r(s)}return Le=c,Le}var Fe,br;function jt(){if(br)return Fe;br=1;function e(t){return t!=null&&typeof t=="object"}return Fe=e,Fe}var Ie,gr;function _t(){if(gr)return Ie;gr=1;var e=Rt(),t=jt(),r="[object Symbol]";function a(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Ie=a,Ie}var Be,mr;function St(){if(mr)return Be;mr=1;var e=Et(),t=Oe(),r=_t(),a=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;function f(u){if(typeof u=="number")return u;if(r(u))return a;if(t(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=t(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=e(u);var l=o.test(u);return l||c.test(u)?s(u.slice(2),l?2:8):i.test(u)?a:+u}return Be=f,Be}var Ge,hr;function yr(){if(hr)return Ge;hr=1;var e=Oe(),t=yt(),r=St(),a="Expected a function",i=Math.max,o=Math.min;function c(s,f,u){var d,l,p,h,g,T,P=0,L=!1,M=!1,F=!0;if(typeof s!="function")throw new TypeError(a);f=r(f)||0,e(u)&&(L=!!u.leading,M="maxWait"in u,p=M?i(r(u.maxWait)||0,f):p,F="trailing"in u?!!u.trailing:F);function W(w){var C=d,B=l;return d=l=void 0,P=w,h=s.apply(B,C),h}function V(w){return P=w,g=setTimeout(A,f),L?W(w):h}function U(w){var C=w-T,B=w-P,ye=f-C;return M?o(ye,p-B):ye}function I(w){var C=w-T,B=w-P;return T===void 0||C>=f||C<0||M&&B>=p}function A(){var w=t();if(I(w))return ie(w);g=setTimeout(A,U(w))}function ie(w){return g=void 0,F&&d?W(w):(d=l=void 0,h)}function he(){g!==void 0&&clearTimeout(g),P=0,d=T=l=g=void 0}function ue(){return g===void 0?h:ie(t())}function J(){var w=t(),C=I(w);if(d=arguments,l=this,T=w,C){if(g===void 0)return V(T);if(M)return clearTimeout(g),g=setTimeout(A,f),W(T)}return g===void 0&&(g=setTimeout(A,f)),h}return J.cancel=he,J.flush=ue,J}return Ge=c,Ge}var Ot=yr();const xt=Ee(Ot);var Pt=function(e,t){var r=t.debounceWait,a=t.debounceLeading,i=t.debounceTrailing,o=t.debounceMaxWait,c=m.useRef(),s=m.useMemo(function(){var f={};return a!==void 0&&(f.leading=a),i!==void 0&&(f.trailing=i),o!==void 0&&(f.maxWait=o),f},[a,i,o]);return m.useEffect(function(){if(r){var f=e.runAsync.bind(e);return c.current=xt(function(u){u()},r,s),e.runAsync=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return new Promise(function(l,p){var h;(h=c.current)===null||h===void 0||h.call(c,function(){f.apply(void 0,S([],_(u),!1)).then(l).catch(p)})})},function(){var u;(u=c.current)===null||u===void 0||u.cancel(),e.runAsync=f}}},[r,s]),r?{onCancel:function(){var f;(f=c.current)===null||f===void 0||f.cancel()}}:{}},At=function(e,t){var r=t.loadingDelay,a=t.ready,i=m.useRef();if(!r)return{};var o=function(){i.current&&clearTimeout(i.current)};return{onBefore:function(){return o(),a!==!1&&(i.current=setTimeout(function(){e.setState({loading:!0})},r)),{loading:!1}},onFinally:function(){o()},onCancel:function(){o()}}},ne=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ye(){return ne?document.visibilityState!=="hidden":!0}var ae=[];function Ct(e){return ae.push(e),function(){var r=ae.indexOf(e);ae.splice(r,1)}}if(ne){var Nt=function(){if(Ye())for(var e=0;e<ae.length;e++){var t=ae[e];t()}};window.addEventListener("visibilitychange",Nt,!1)}var kt=function(e,t){var r=t.pollingInterval,a=t.pollingWhenHidden,i=a===void 0?!0:a,o=t.pollingErrorRetryCount,c=o===void 0?-1:o,s=m.useRef(),f=m.useRef(),u=m.useRef(0),d=function(){var l;s.current&&clearTimeout(s.current),(l=f.current)===null||l===void 0||l.call(f)};return we(function(){r||d()},[r]),r?{onBefore:function(){d()},onError:function(){u.current+=1},onSuccess:function(){u.current=0},onFinally:function(){c===-1||c!==-1&&u.current<=c?s.current=setTimeout(function(){!i&&!Ye()?f.current=Ct(function(){e.refresh()}):e.refresh()},r):u.current=0},onCancel:function(){d()}}:{}};function Mt(e,t){var r=!1;return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];r||(r=!0,e.apply(void 0,S([],_(a),!1)),setTimeout(function(){r=!1},t))}}function Wt(){return ne&&typeof navigator.onLine<"u"?navigator.onLine:!0}var oe=[];function Lt(e){return oe.push(e),function(){var r=oe.indexOf(e);r>-1&&oe.splice(r,1)}}if(ne){var pr=function(){if(!(!Ye()||!Wt()))for(var e=0;e<oe.length;e++){var t=oe[e];t()}};window.addEventListener("visibilitychange",pr,!1),window.addEventListener("focus",pr,!1)}var Ft=function(e,t){var r=t.refreshOnWindowFocus,a=t.focusTimespan,i=a===void 0?5e3:a,o=m.useRef(),c=function(){var s;(s=o.current)===null||s===void 0||s.call(o)};return m.useEffect(function(){if(r){var s=Mt(e.refresh.bind(e),i);o.current=Lt(function(){s()})}return function(){c()}},[r,i]),be(function(){c()}),{}},It=function(e,t){var r=t.retryInterval,a=t.retryCount,i=m.useRef(),o=m.useRef(0),c=m.useRef(!1);return a?{onBefore:function(){c.current||(o.current=0),c.current=!1,i.current&&clearTimeout(i.current)},onSuccess:function(){o.current=0},onError:function(){if(o.current+=1,a===-1||o.current<=a){var s=r??Math.min(1e3*Math.pow(2,o.current),3e4);i.current=setTimeout(function(){c.current=!0,e.refresh()},s)}else o.current=0},onCancel:function(){o.current=0,i.current&&clearTimeout(i.current)}}:{}},He,Er;function Bt(){if(Er)return He;Er=1;var e=yr(),t=Oe(),r="Expected a function";function a(i,o,c){var s=!0,f=!0;if(typeof i!="function")throw new TypeError(r);return t(c)&&(s="leading"in c?!!c.leading:s,f="trailing"in c?!!c.trailing:f),e(i,o,{leading:s,maxWait:o,trailing:f})}return He=a,He}var Gt=Bt();const Yt=Ee(Gt);var Ht=function(e,t){var r=t.throttleWait,a=t.throttleLeading,i=t.throttleTrailing,o=m.useRef(),c={};return a!==void 0&&(c.leading=a),i!==void 0&&(c.trailing=i),m.useEffect(function(){if(r){var s=e.runAsync.bind(e);return o.current=Yt(function(f){f()},r,c),e.runAsync=function(){for(var f=[],u=0;u<arguments.length;u++)f[u]=arguments[u];return new Promise(function(d,l){var p;(p=o.current)===null||p===void 0||p.call(o,function(){s.apply(void 0,S([],_(f),!1)).then(d).catch(l)})})},function(){var f;e.runAsync=s,(f=o.current)===null||f===void 0||f.cancel()}}},[r,a,i]),r?{onCancel:function(){var s;(s=o.current)===null||s===void 0||s.cancel()}}:{}},Ut=function(e){ve&&(te(e)||console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof e,'".'))),m.useEffect(function(){e==null||e()},[])},zt=function(){var e=_(m.useState({}),2),t=e[1];return m.useCallback(function(){return t({})},[])},Dt=function(){function e(t,r,a,i){i===void 0&&(i={}),this.serviceRef=t,this.options=r,this.subscribe=a,this.initState=i,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=N(N(N({},this.state),{loading:!r.manual}),i)}return e.prototype.setState=function(t){t===void 0&&(t={}),this.state=N(N({},this.state),t),this.subscribe()},e.prototype.runPluginHandler=function(t){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var i=this.pluginImpls.map(function(o){var c;return(c=o[t])===null||c===void 0?void 0:c.call.apply(c,S([o],_(r),!1))}).filter(Boolean);return Object.assign.apply(Object,S([{}],_(i),!1))},e.prototype.runAsync=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return st(this,void 0,void 0,function(){var a,i,o,c,s,f,u,d,l,p,h,g,T,P,L,M,F,W,V,U,I;return ft(this,function(A){switch(A.label){case 0:if(this.count+=1,a=this.count,i=this.runPluginHandler("onBefore",t),o=i.stopNow,c=o===void 0?!1:o,s=i.returnNow,f=s===void 0?!1:s,u=$e(i,["stopNow","returnNow"]),c)return[2,new Promise(function(){})];if(this.setState(N({loading:!0,params:t},u)),f)return[2,Promise.resolve(u.data)];(T=(g=this.options).onBefore)===null||T===void 0||T.call(g,t),A.label=1;case 1:return A.trys.push([1,3,,4]),d=this.runPluginHandler("onRequest",this.serviceRef.current,t).servicePromise,d||(d=(h=this.serviceRef).current.apply(h,S([],_(t),!1))),[4,d];case 2:return l=A.sent(),a!==this.count?[2,new Promise(function(){})]:(this.setState({data:l,error:void 0,loading:!1}),(L=(P=this.options).onSuccess)===null||L===void 0||L.call(P,l,t),this.runPluginHandler("onSuccess",l,t),(F=(M=this.options).onFinally)===null||F===void 0||F.call(M,t,l,void 0),a===this.count&&this.runPluginHandler("onFinally",t,l,void 0),[2,l]);case 3:if(p=A.sent(),a!==this.count)return[2,new Promise(function(){})];throw this.setState({error:p,loading:!1}),(V=(W=this.options).onError)===null||V===void 0||V.call(W,p,t),this.runPluginHandler("onError",p,t),(I=(U=this.options).onFinally)===null||I===void 0||I.call(U,t,void 0,p),a===this.count&&this.runPluginHandler("onFinally",t,void 0,p),p;case 4:return[2]}})})},e.prototype.run=function(){for(var t=this,r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];this.runAsync.apply(this,S([],_(r),!1)).catch(function(i){t.options.onError||console.error(i)})},e.prototype.cancel=function(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")},e.prototype.refresh=function(){this.run.apply(this,S([],_(this.state.params||[]),!1))},e.prototype.refreshAsync=function(){return this.runAsync.apply(this,S([],_(this.state.params||[]),!1))},e.prototype.mutate=function(t){var r=te(t)?t(this.state.data):t;this.runPluginHandler("onMutate",r),this.setState({data:r})},e}();function Vt(e,t,r){t===void 0&&(t={}),r===void 0&&(r=[]);var a=t.manual,i=a===void 0?!1:a,o=t.ready,c=o===void 0?!0:o,s=$e(t,["manual","ready"]);ve&&t.defaultParams&&!Array.isArray(t.defaultParams)&&console.warn("expected defaultParams is array, got ".concat(typeof t.defaultParams));var f=N({manual:i,ready:c},s),u=je(e),d=zt(),l=rr(function(){var p=r.map(function(h){var g;return(g=h==null?void 0:h.onInit)===null||g===void 0?void 0:g.call(h,f)}).filter(Boolean);return new Dt(u,f,d,Object.assign.apply(Object,S([{}],_(p),!1)))},[]);return l.options=f,l.pluginImpls=r.map(function(p){return p(l,f)}),Ut(function(){if(!i&&c){var p=l.state.params||t.defaultParams||[];l.run.apply(l,S([],_(p),!1))}}),be(function(){l.cancel()}),{loading:l.state.loading,data:l.state.data,error:l.state.error,params:l.state.params||[],cancel:Q(l.cancel.bind(l)),refresh:Q(l.refresh.bind(l)),refreshAsync:Q(l.refreshAsync.bind(l)),run:Q(l.run.bind(l)),runAsync:Q(l.runAsync.bind(l)),mutate:Q(l.mutate.bind(l))}}function Jt(e,t,r){return Vt(e,t,S(S([],_(r||[]),!1),[Pt,At,kt,Ft,Ht,er,mt,It],!1))}function Xt(e,t){var r=_(m.useState(e),2),a=r[0],i=r[1],o=m.useMemo(function(){var c=!0,s=function(){return i(function(l){return l===e?c:e})},f=function(l){return i(l)},u=function(){return i(e)},d=function(){return i(c)};return{toggle:s,set:f,setLeft:u,setRight:d}},[]);return[a,o]}function qt(e){var t=_(Xt(!1),2),r=t[0],a=t[1],i=a.toggle,o=a.set,c=m.useMemo(function(){var s=function(){return o(!0)},f=function(){return o(!1)};return{toggle:i,set:function(u){return o(!!u)},setTrue:s,setFalse:f}},[]);return[r,c]}function Tr(e,t){if(ne){if(!e)return t;var r;return te(e)?r=e():"current"in e?r=e.current:r=e,r}}var Zt=function(e){var t=function(r,a,i){var o=m.useRef(!1),c=m.useRef([]),s=m.useRef([]),f=m.useRef();e(function(){var u,d=Array.isArray(i)?i:[i],l=d.map(function(p){return Tr(p)});if(!o.current){o.current=!0,c.current=l,s.current=a,f.current=r();return}(l.length!==c.current.length||!Re(c.current,l)||!Re(s.current,a))&&((u=f.current)===null||u===void 0||u.call(f),c.current=l,s.current=a,f.current=r())}),be(function(){var u;(u=f.current)===null||u===void 0||u.call(f),o.current=!1})};return t},Qt=Zt(m.useEffect);function wr(e,t,r){r===void 0&&(r={});var a=r.enable,i=a===void 0?!0:a,o=je(t);Qt(function(){if(i){var c=Tr(r.target,window);if(c!=null&&c.addEventListener){var s=function(u){return o.current(u)},f=Array.isArray(e)?e:[e];return f.forEach(function(u){c.addEventListener(u,s,{capture:r.capture,once:r.once,passive:r.passive})}),function(){f.forEach(function(u){c.removeEventListener(u,s,{capture:r.capture})})}}}},[e,r.capture,r.once,r.passive,i],r.target)}const Kt=function(e,t){var r={},a=r.onEnter,i=r.onLeave,o=r.onChange,c=_(qt(),2),s=c[0],f=c[1],u=f.setTrue,d=f.setFalse;return wr("mouseenter",function(){a==null||a(),u(),o==null||o(!0)},{target:e}),wr("mouseleave",function(){i==null||i(),d(),o==null||o(!1)},{target:e}),s},Rr=m.forwardRef(({type:e="",className:t="",symbol:r=!1,...a},i)=>r?k.jsx("svg",{className:`iconfont-symbol ${e} ${t}`,"aria-hidden":"true",ref:i,...a,children:k.jsx("use",{xlinkHref:`#${e}`})}):k.jsx("i",{className:`iconfont ${e} ${t}`,ref:i,...a})),$t={btn_icon__warp:"_btn_icon__warp_ay6he_1"},en=(e,t)=>{const r=m.useRef(null),{icon:a,tooltipDisabled:i=!1,onClick:o=tt,disabled:c,size:s="middle",style:f={},className:u,loading:d=!1,...l}=e,p=Kt(r),h=()=>at(a)&&a.includes("icon-")?k.jsx(Rr,{type:a}):a,g=k.jsx(H.Button,{onClick:o,size:s,disabled:c,style:f,ref:t,loading:d,className:ut([u,$t.btn_icon__warp]),icon:h()});if(!a)throw new Error("IconButton 组件必须传入 icon 属性");return k.jsxs(m.Fragment,{children:[i&&g,!i&&k.jsx(H.Tooltip,{open:p,trigger:"contextMenu",destroyTooltipOnHide:!0,...l,children:k.jsx("span",{ref:r,style:{display:"inline-block"},className:"icon-button-box",children:g})})]})},rn=m.forwardRef(en),tn=({checked:e,onChange:t,trueValue:r=!0,falseValue:a=!1,...i})=>{const o=e===r,c=(s,f)=>{t==null||t(s?r:a,f)};return k.jsx(H.Switch,{checked:o,onChange:c,...i})};j.message=H.message,j.notification=H.notification,j.modal=H.Modal;function nn({children:e}){const t=H.App.useApp();return j.message=t.message,j.modal=t.modal,j.notification=t.notification,e}function an(e,t,r){const a=Jt(e,{...t,onError(o,c){var s;((t==null?void 0:t.errorMessage)??!0)&&j.message.error(o.message),(s=t==null?void 0:t.onError)==null||s.call(t,o,c)}},r),i=a.data&&typeof a.data=="object"&&"data"in a.data?a.data.data:a.data;return{...a,data:i}}j.App=nn,j.CheckboxValue=Yr,j.IconButton=rn,j.IconFont=Rr,j.SwitchValue=tn,j.useRequest=an,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useRequest } from './useRequest';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useRequest } from './useRequest';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Options as OriginalOptions, Plugin, Service, Result as OriginalResult } from 'ahooks/lib/useRequest/src/types';
|
|
2
|
+
interface Options<TData, TParams extends unknown[]> extends OriginalOptions<TData, TParams> {
|
|
3
|
+
/**
|
|
4
|
+
* 是否显示错误信息
|
|
5
|
+
* @default true
|
|
6
|
+
*/
|
|
7
|
+
errorMessage?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface WrappedResult<TData, TParams extends unknown[]> extends Omit<OriginalResult<TData, TParams>, 'data'> {
|
|
10
|
+
/**
|
|
11
|
+
* 直接返回data,而不是返回 { code, data, success } 形式
|
|
12
|
+
* @default data
|
|
13
|
+
*/
|
|
14
|
+
data?: TData extends {
|
|
15
|
+
data: infer U;
|
|
16
|
+
} ? U : TData;
|
|
17
|
+
}
|
|
18
|
+
declare function useWrappedRequest<TData, TParams extends unknown[]>(service: Service<TData, TParams>, options?: Options<TData, TParams>, plugins?: Array<Plugin<TData, TParams>>): WrappedResult<TData, TParams>;
|
|
19
|
+
export default useWrappedRequest;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { useRequest } from 'ahooks';
|
|
13
|
+
import { message } from '@/components/AntdApp';
|
|
14
|
+
function useWrappedRequest(service, options, plugins) {
|
|
15
|
+
var result = useRequest(service, __assign(__assign({}, options), { onError: function (error, params) {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
if ((_a = options === null || options === void 0 ? void 0 : options.errorMessage) !== null && _a !== void 0 ? _a : true) {
|
|
18
|
+
message.error(error.message);
|
|
19
|
+
}
|
|
20
|
+
(_b = options === null || options === void 0 ? void 0 : options.onError) === null || _b === void 0 ? void 0 : _b.call(options, error, params);
|
|
21
|
+
} }), plugins);
|
|
22
|
+
// 处理 data 可能嵌套的情况,直接返回data,而不是返回 { code, data, success } 形式
|
|
23
|
+
var normalizedData = (result.data && typeof result.data === 'object' && 'data' in result.data
|
|
24
|
+
? result.data.data
|
|
25
|
+
: result.data);
|
|
26
|
+
return __assign(__assign({}, result), { data: normalizedData });
|
|
27
|
+
}
|
|
28
|
+
export default useWrappedRequest;
|
|
@@ -3,5 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
exports.useRequest = void 0;
|
|
7
|
+
var useRequest_1 = require("./useRequest");
|
|
8
|
+
Object.defineProperty(exports, "useRequest", { enumerable: true, get: function () { return __importDefault(useRequest_1).default; } });
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var ahooks_1 = require("ahooks");
|
|
15
|
+
var AntdApp_1 = require("@/components/AntdApp");
|
|
16
|
+
function useWrappedRequest(service, options, plugins) {
|
|
17
|
+
var result = (0, ahooks_1.useRequest)(service, __assign(__assign({}, options), { onError: function (error, params) {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
if ((_a = options === null || options === void 0 ? void 0 : options.errorMessage) !== null && _a !== void 0 ? _a : true) {
|
|
20
|
+
AntdApp_1.message.error(error.message);
|
|
21
|
+
}
|
|
22
|
+
(_b = options === null || options === void 0 ? void 0 : options.onError) === null || _b === void 0 ? void 0 : _b.call(options, error, params);
|
|
23
|
+
} }), plugins);
|
|
24
|
+
// 处理 data 可能嵌套的情况,直接返回data,而不是返回 { code, data, success } 形式
|
|
25
|
+
var normalizedData = (result.data && typeof result.data === 'object' && 'data' in result.data
|
|
26
|
+
? result.data.data
|
|
27
|
+
: result.data);
|
|
28
|
+
return __assign(__assign({}, result), { data: normalizedData });
|
|
29
|
+
}
|
|
30
|
+
exports.default = useWrappedRequest;
|
package/build/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
var react_1 = __importDefault(require("react"));
|
|
18
|
-
var antd_1 = require("antd");
|
|
19
|
-
var Button = function (props) {
|
|
20
|
-
return react_1.default.createElement(antd_1.Button, __assign({}, props));
|
|
21
|
-
};
|
|
22
|
-
exports.default = Button;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
export declare const formatFileSize: (size?: number) => string;
|
|
4
|
-
declare const _default: React.ForwardRefExoticComponent<{
|
|
5
|
-
file: any;
|
|
6
|
-
params?: {};
|
|
7
|
-
uploadSource?: string;
|
|
8
|
-
callback: any;
|
|
9
|
-
retry: any;
|
|
10
|
-
remove: any;
|
|
11
|
-
onChangeStatus: any;
|
|
12
|
-
} & React.RefAttributes<unknown>>;
|
|
13
|
-
export default _default;
|