xmirror-components 1.0.26 → 1.0.28-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/index.cjs +1 -1
- package/build/dist/index.mjs +78 -78
- package/build/es/components/IconButton/index.d.ts +4 -4
- package/build/es/components/IconButton/index.js +3 -3
- package/build/es/components/Table/Footer/index.d.ts +5 -0
- package/build/es/components/Table/Footer/index.js +84 -0
- package/build/es/components/Table/PopoverSetColumns/index.d.ts +14 -0
- package/build/es/components/Table/PopoverSetColumns/index.js +174 -0
- package/build/es/components/Table/index.d.ts +5 -0
- package/build/es/components/Table/index.js +189 -0
- package/build/es/components/Table/types.d.ts +63 -0
- package/build/es/components/Table/types.js +1 -0
- package/build/lib/components/IconButton/index.js +3 -4
- package/build/lib/components/Table/Footer/index.js +119 -0
- package/build/lib/components/Table/PopoverSetColumns/index.js +212 -0
- package/build/lib/components/Table/index.js +227 -0
- package/build/lib/components/Table/types.js +2 -0
- package/build/lib/index.d.ts +2 -2
- package/build/package.json +1 -1
- package/build/types/components/IconButton/index.d.ts +4 -4
- package/build/types/components/Table/Footer/index.d.ts +5 -0
- package/build/types/components/Table/PopoverSetColumns/index.d.ts +14 -0
- package/build/types/components/Table/index.d.ts +5 -0
- package/build/types/components/Table/types.d.ts +63 -0
- package/package.json +1 -1
package/build/dist/index.cjs
CHANGED
|
@@ -118,4 +118,4 @@ Valid keys: `+JSON.stringify(Object.keys(u),null," "));var v=J(M,D,O,j,$+"."+D,
|
|
|
118
118
|
background: var(--color-primary-bg);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
`,xi=({children:e,tooltipDisabled:r,disabled:n,disabledReason:t,title:i,...a})=>r?e:U.jsx(ge.Tooltip,{title:n&&t||i,...a,children:e}),Ti=P.forwardRef((e,r)=>{const{iconButton:n}=P.useContext(cr),{icon:t,tooltipDisabled:i=!1,title:a,hide:o=!1,disabledReason:s,onClick:f=hi,disabled:c,size:d=n.size||"small",style:p={},className:b,loading:g=!1,...h}=e,y=()=>gi(t)?U.jsx(En,{type:t}):t,E=n.render;return t||console.warn("Icon props not found"),U.jsx(E,{...e,children:U.jsx(xi,{tooltipDisabled:i,hide:o,disabled:c,disabledReason:s,title:a,...h,children:U.jsx(Ei,{ref:r,icon:y(),size:d,className:zr(["icon-button",n.className,b]),disabled:c,style:{...n.style,...p},loading:g,onClick:f})})})});var Si=function(e){return function(r,n){var t=P.useRef(!1);e(function(){return function(){t.current=!1}},[]),e(function(){if(!t.current)t.current=!0;else return r()},n)}},le=function(){return le=Object.assign||function(r){for(var n,t=1,i=arguments.length;t<i;t++){n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},le.apply(this,arguments)};function Tn(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,t=Object.getOwnPropertySymbols(e);i<t.length;i++)r.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]]);return n}function Ri(e,r,n,t){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(d){try{c(t.next(d))}catch(p){o(p)}}function f(d){try{c(t.throw(d))}catch(p){o(p)}}function c(d){d.done?a(d.value):i(d.value).then(s,f)}c((t=t.apply(e,r||[])).next())})}function wi(e,r){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},t,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(d){return f([c,d])}}function f(c){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(t=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){n.label=c[1];break}if(c[0]===6&&n.label<a[1]){n.label=a[1],a=c;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(c);break}a[2]&&n.ops.pop(),n.trys.pop();continue}c=r.call(e,n)}catch(d){c=[6,d],i=0}finally{t=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ee(e,r){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var t=n.call(e),i,a=[],o;try{for(;(r===void 0||r-- >0)&&!(i=t.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=t.return)&&n.call(t)}finally{if(o)throw o.error}}return a}function re(e,r,n){if(n||arguments.length===2)for(var t=0,i=r.length,a;t<i;t++)(a||!(t in r))&&(a||(a=Array.prototype.slice.call(r,0,t)),a[t]=r[t]);return e.concat(a||Array.prototype.slice.call(r))}var ur=function(e){return typeof e=="function"},fr=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";function Re(e){fr&&(ur(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var r=P.useRef(e);r.current=P.useMemo(function(){return e},[e]);var n=P.useRef(void 0);return n.current||(n.current=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return r.current.apply(this,t)}),n.current}const Ur=Si(P.useEffect);var Sn=function(e,r){var n=r.manual,t=r.ready,i=t===void 0?!0:t,a=r.defaultParams,o=a===void 0?[]:a,s=r.refreshDeps,f=s===void 0?[]:s,c=r.refreshDepsAction,d=P.useRef(!1);return d.current=!1,Ur(function(){!n&&i&&(d.current=!0,e.run.apply(e,re([],ee(o),!1)))},[i]),Ur(function(){d.current||n||(d.current=!0,c?c():e.refresh())},re([],ee(f),!1)),{onBefore:function(){if(!i)return{stopNow:!0}}}};Sn.onInit=function(e){var r=e.ready,n=r===void 0?!0:r,t=e.manual;return{loading:!t&&n}};function Oi(e,r){if(e===r)return!0;for(var n=0;n<e.length;n++)if(!Object.is(e[n],r[n]))return!1;return!0}var Rn=function(e,r){var n=P.useRef({deps:r,obj:void 0,initialized:!1}).current;return(n.initialized===!1||!Oi(n.deps,r))&&(n.deps=r,n.obj=e(),n.initialized=!0),n.obj};function wn(e){var r=P.useRef(e);return r.current=e,r}var Qr=function(e){fr&&(ur(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var r=wn(e);P.useEffect(function(){return function(){r.current()}},[])},er=new Map,_i=function(e,r,n){var t=er.get(e);t!=null&&t.timer&&clearTimeout(t.timer);var i=void 0;r>-1&&(i=setTimeout(function(){er.delete(e)},r)),er.set(e,le(le({},n),{timer:i}))},Pi=function(e){return er.get(e)},rr=new Map,Ci=function(e){return rr.get(e)},Ai=function(e,r){rr.set(e,r),r.then(function(n){return rr.delete(e),n}).catch(function(){rr.delete(e)})},Te={},ji=function(e,r){Te[e]&&Te[e].forEach(function(n){return n(r)})},Tr=function(e,r){return Te[e]||(Te[e]=[]),Te[e].push(r),function(){var t=Te[e].indexOf(r);Te[e].splice(t,1)}},Ni=function(e,r){var n=r.cacheKey,t=r.cacheTime,i=t===void 0?5*60*1e3:t,a=r.staleTime,o=a===void 0?0:a,s=r.setCache,f=r.getCache,c=P.useRef(void 0),d=P.useRef(void 0),p=function(g,h){s?s(h):_i(g,i,h),ji(g,h.data)},b=function(g,h){return h===void 0&&(h=[]),f?f(h):Pi(g)};return Rn(function(){if(n){var g=b(n);g&&Object.hasOwnProperty.call(g,"data")&&(e.state.data=g.data,e.state.params=g.params,(o===-1||Date.now()-g.time<=o)&&(e.state.loading=!1)),c.current=Tr(n,function(h){e.setState({data:h})})}},[]),Qr(function(){var g;(g=c.current)===null||g===void 0||g.call(c)}),n?{onBefore:function(g){var h=b(n,g);return!h||!Object.hasOwnProperty.call(h,"data")?{}:o===-1||Date.now()-h.time<=o?{loading:!1,data:h==null?void 0:h.data,error:void 0,returnNow:!0}:{data:h==null?void 0:h.data,error:void 0}},onRequest:function(g,h){var y=Ci(n);return y&&y!==d.current?{servicePromise:y}:(y=g.apply(void 0,re([],ee(h),!1)),d.current=y,Ai(n,y),{servicePromise:y})},onSuccess:function(g,h){var y;n&&((y=c.current)===null||y===void 0||y.call(c),p(n,{data:g,params:h,time:Date.now()}),c.current=Tr(n,function(E){e.setState({data:E})}))},onMutate:function(g){var h;n&&((h=c.current)===null||h===void 0||h.call(c),p(n,{data:g,params:e.state.params,time:Date.now()}),c.current=Tr(n,function(y){e.setState({data:y})}))}}:{}},Sr,Nt;function et(){if(Nt)return Sr;Nt=1;function e(r){var n=typeof r;return r!=null&&(n=="object"||n=="function")}return Sr=e,Sr}var Rr,kt;function ki(){if(kt)return Rr;kt=1;var e=typeof Ge=="object"&&Ge&&Ge.Object===Object&&Ge;return Rr=e,Rr}var wr,$t;function On(){if($t)return wr;$t=1;var e=ki(),r=typeof self=="object"&&self&&self.Object===Object&&self,n=e||r||Function("return this")();return wr=n,wr}var Or,Mt;function $i(){if(Mt)return Or;Mt=1;var e=On(),r=function(){return e.Date.now()};return Or=r,Or}var _r,It;function Mi(){if(It)return _r;It=1;var e=/\s/;function r(n){for(var t=n.length;t--&&e.test(n.charAt(t)););return t}return _r=r,_r}var Pr,Dt;function Ii(){if(Dt)return Pr;Dt=1;var e=Mi(),r=/^\s+/;function n(t){return t&&t.slice(0,e(t)+1).replace(r,"")}return Pr=n,Pr}var Cr,Lt;function _n(){if(Lt)return Cr;Lt=1;var e=On(),r=e.Symbol;return Cr=r,Cr}var Ar,Ft;function Di(){if(Ft)return Ar;Ft=1;var e=_n(),r=Object.prototype,n=r.hasOwnProperty,t=r.toString,i=e?e.toStringTag:void 0;function a(o){var s=n.call(o,i),f=o[i];try{o[i]=void 0;var c=!0}catch{}var d=t.call(o);return c&&(s?o[i]=f:delete o[i]),d}return Ar=a,Ar}var jr,qt;function Li(){if(qt)return jr;qt=1;var e=Object.prototype,r=e.toString;function n(t){return r.call(t)}return jr=n,jr}var Nr,Yt;function Fi(){if(Yt)return Nr;Yt=1;var e=_n(),r=Di(),n=Li(),t="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:t:a&&a in Object(s)?r(s):n(s)}return Nr=o,Nr}var kr,Wt;function qi(){if(Wt)return kr;Wt=1;function e(r){return r!=null&&typeof r=="object"}return kr=e,kr}var $r,zt;function Yi(){if(zt)return $r;zt=1;var e=Fi(),r=qi(),n="[object Symbol]";function t(i){return typeof i=="symbol"||r(i)&&e(i)==n}return $r=t,$r}var Mr,Ut;function Wi(){if(Ut)return Mr;Ut=1;var e=Ii(),r=et(),n=Yi(),t=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function f(c){if(typeof c=="number")return c;if(n(c))return t;if(r(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=r(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=e(c);var p=a.test(c);return p||o.test(c)?s(c.slice(2),p?2:8):i.test(c)?t:+c}return Mr=f,Mr}var Ir,Gt;function Pn(){if(Gt)return Ir;Gt=1;var e=et(),r=$i(),n=Wi(),t="Expected a function",i=Math.max,a=Math.min;function o(s,f,c){var d,p,b,g,h,y,E=0,S=!1,C=!1,x=!0;if(typeof s!="function")throw new TypeError(t);f=n(f)||0,e(c)&&(S=!!c.leading,C="maxWait"in c,b=C?i(n(c.maxWait)||0,f):b,x="trailing"in c?!!c.trailing:x);function R(G){var V=d,ae=p;return d=p=void 0,E=G,g=s.apply(ae,V),g}function l(G){return E=G,h=setTimeout(B,f),S?R(G):g}function k(G){var V=G-y,ae=G-E,X=f-V;return C?a(X,b-ae):X}function A(G){var V=G-y,ae=G-E;return y===void 0||V>=f||V<0||C&&ae>=b}function B(){var G=r();if(A(G))return ce(G);h=setTimeout(B,k(G))}function ce(G){return h=void 0,x&&d?R(G):(d=p=void 0,g)}function ne(){h!==void 0&&clearTimeout(h),E=0,d=y=p=h=void 0}function Z(){return h===void 0?g:ce(r())}function ue(){var G=r(),V=A(G);if(d=arguments,p=this,y=G,V){if(h===void 0)return l(y);if(C)return clearTimeout(h),h=setTimeout(B,f),R(y)}return h===void 0&&(h=setTimeout(B,f)),g}return ue.cancel=ne,ue.flush=Z,ue}return Ir=o,Ir}var zi=Pn();const Ui=ar(zi);var Gi=function(e,r){var n=r.debounceWait,t=r.debounceLeading,i=r.debounceTrailing,a=r.debounceMaxWait,o=P.useRef(void 0),s=P.useMemo(function(){var f={};return t!==void 0&&(f.leading=t),i!==void 0&&(f.trailing=i),a!==void 0&&(f.maxWait=a),f},[t,i,a]);return P.useEffect(function(){if(n){var f=e.runAsync.bind(e);return o.current=Ui(function(c){c()},n,s),e.runAsync=function(){for(var c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];return new Promise(function(p,b){var g;(g=o.current)===null||g===void 0||g.call(o,function(){f.apply(void 0,re([],ee(c),!1)).then(p).catch(b)})})},function(){var c;(c=o.current)===null||c===void 0||c.cancel(),e.runAsync=f}}},[n,s]),n?{onCancel:function(){var f;(f=o.current)===null||f===void 0||f.cancel()}}:{}},Bi=function(e,r){var n=r.loadingDelay,t=r.ready,i=P.useRef(void 0);if(!n)return{};var a=function(){i.current&&clearTimeout(i.current)};return{onBefore:function(){return a(),t!==!1&&(i.current=setTimeout(function(){e.setState({loading:!0})},n)),{loading:!1}},onFinally:function(){a()},onCancel:function(){a()}}},lr=!!(typeof window<"u"&&window.document&&window.document.createElement);function rt(){return lr?document.visibilityState!=="hidden":!0}var De=[];function Vi(e){return De.push(e),function(){var n=De.indexOf(e);De.splice(n,1)}}if(lr){var Hi=function(){if(rt())for(var e=0;e<De.length;e++){var r=De[e];r()}};window.addEventListener("visibilitychange",Hi,!1)}var Xi=function(e,r){var n=r.pollingInterval,t=r.pollingWhenHidden,i=t===void 0?!0:t,a=r.pollingErrorRetryCount,o=a===void 0?-1:a,s=P.useRef(void 0),f=P.useRef(void 0),c=P.useRef(0),d=function(){var p;s.current&&clearTimeout(s.current),(p=f.current)===null||p===void 0||p.call(f)};return Ur(function(){n||d()},[n]),n?{onBefore:function(){d()},onError:function(){c.current+=1},onSuccess:function(){c.current=0},onFinally:function(){o===-1||o!==-1&&c.current<=o?s.current=setTimeout(function(){!i&&!rt()?f.current=Vi(function(){e.refresh()}):e.refresh()},n):c.current=0},onCancel:function(){d()}}:{}};function Ji(e,r){var n=!1;return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];n||(n=!0,e.apply(void 0,re([],ee(t),!1)),setTimeout(function(){n=!1},r))}}var Zi=function(){return lr&&typeof navigator.onLine<"u"?navigator.onLine:!0},Le=[];function Ki(e){return Le.push(e),function(){var n=Le.indexOf(e);n>-1&&Le.splice(n,1)}}if(lr){var Bt=function(){if(!(!rt()||!Zi()))for(var e=0;e<Le.length;e++){var r=Le[e];r()}};window.addEventListener("visibilitychange",Bt,!1),window.addEventListener("focus",Bt,!1)}var Qi=function(e,r){var n=r.refreshOnWindowFocus,t=r.focusTimespan,i=t===void 0?5e3:t,a=P.useRef(void 0),o=function(){var s;(s=a.current)===null||s===void 0||s.call(a)};return P.useEffect(function(){if(n){var s=Ji(e.refresh.bind(e),i);a.current=Ki(function(){s()})}return function(){o()}},[n,i]),Qr(function(){o()}),{}},eo=function(e,r){var n=r.retryInterval,t=r.retryCount,i=P.useRef(void 0),a=P.useRef(0),o=P.useRef(!1);return t?{onBefore:function(){o.current||(a.current=0),o.current=!1,i.current&&clearTimeout(i.current)},onSuccess:function(){a.current=0},onError:function(){if(a.current+=1,t===-1||a.current<=t){var s=n??Math.min(1e3*Math.pow(2,a.current),3e4);i.current=setTimeout(function(){o.current=!0,e.refresh()},s)}else a.current=0},onCancel:function(){a.current=0,i.current&&clearTimeout(i.current)}}:{}},Dr,Vt;function ro(){if(Vt)return Dr;Vt=1;var e=Pn(),r=et(),n="Expected a function";function t(i,a,o){var s=!0,f=!0;if(typeof i!="function")throw new TypeError(n);return r(o)&&(s="leading"in o?!!o.leading:s,f="trailing"in o?!!o.trailing:f),e(i,a,{leading:s,maxWait:a,trailing:f})}return Dr=t,Dr}var to=ro();const no=ar(to);var ao=function(e,r){var n=r.throttleWait,t=r.throttleLeading,i=r.throttleTrailing,a=P.useRef(void 0),o={};return t!==void 0&&(o.leading=t),i!==void 0&&(o.trailing=i),P.useEffect(function(){if(n){var s=e.runAsync.bind(e);return a.current=no(function(f){f()},n,o),e.runAsync=function(){for(var f=[],c=0;c<arguments.length;c++)f[c]=arguments[c];return new Promise(function(d,p){var b;(b=a.current)===null||b===void 0||b.call(a,function(){s.apply(void 0,re([],ee(f),!1)).then(d).catch(p)})})},function(){var f;e.runAsync=s,(f=a.current)===null||f===void 0||f.cancel()}}},[n,t,i]),n?{onCancel:function(){var s;(s=a.current)===null||s===void 0||s.cancel()}}:{}},io=function(e){fr&&(ur(e)||console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof e,'".'))),P.useEffect(function(){e==null||e()},[])},oo=function(){var e=ee(P.useState({}),2),r=e[1];return P.useCallback(function(){return r({})},[])},so=function(){function e(r,n,t,i){i===void 0&&(i={}),this.serviceRef=r,this.options=n,this.subscribe=t,this.initState=i,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=le(le(le({},this.state),{loading:!n.manual}),i)}return e.prototype.setState=function(r){r===void 0&&(r={}),this.state=le(le({},this.state),r),this.subscribe()},e.prototype.runPluginHandler=function(r){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var i=this.pluginImpls.map(function(a){var o;return(o=a[r])===null||o===void 0?void 0:o.call.apply(o,re([a],ee(n),!1))}).filter(Boolean);return Object.assign.apply(Object,re([{}],ee(i),!1))},e.prototype.runAsync=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return Ri(this,void 0,void 0,function(){var t,i,a,o,s,f,c,d,p,b,g,h,y,E,S,C,x,R,l,k,A;return wi(this,function(B){switch(B.label){case 0:if(this.count+=1,t=this.count,i=this.runPluginHandler("onBefore",r),a=i.stopNow,o=a===void 0?!1:a,s=i.returnNow,f=s===void 0?!1:s,c=Tn(i,["stopNow","returnNow"]),o)return[2,new Promise(function(){})];if(this.setState(le({loading:!0,params:r},c)),f)return[2,Promise.resolve(c.data)];(y=(h=this.options).onBefore)===null||y===void 0||y.call(h,r),B.label=1;case 1:return B.trys.push([1,3,,4]),d=this.runPluginHandler("onRequest",this.serviceRef.current,r).servicePromise,d||(d=(g=this.serviceRef).current.apply(g,re([],ee(r),!1))),[4,d];case 2:return p=B.sent(),t!==this.count?[2,new Promise(function(){})]:(this.setState({data:p,error:void 0,loading:!1}),(S=(E=this.options).onSuccess)===null||S===void 0||S.call(E,p,r),this.runPluginHandler("onSuccess",p,r),(x=(C=this.options).onFinally)===null||x===void 0||x.call(C,r,p,void 0),t===this.count&&this.runPluginHandler("onFinally",r,p,void 0),[2,p]);case 3:if(b=B.sent(),t!==this.count)return[2,new Promise(function(){})];throw this.setState({error:b,loading:!1}),(l=(R=this.options).onError)===null||l===void 0||l.call(R,b,r),this.runPluginHandler("onError",b,r),(A=(k=this.options).onFinally)===null||A===void 0||A.call(k,r,void 0,b),t===this.count&&this.runPluginHandler("onFinally",r,void 0,b),b;case 4:return[2]}})})},e.prototype.run=function(){for(var r=this,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.runAsync.apply(this,re([],ee(n),!1)).catch(function(i){r.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,re([],ee(this.state.params||[]),!1))},e.prototype.refreshAsync=function(){return this.runAsync.apply(this,re([],ee(this.state.params||[]),!1))},e.prototype.mutate=function(r){var n=ur(r)?r(this.state.data):r;this.runPluginHandler("onMutate",n),this.setState({data:n})},e}();function co(e,r,n){r===void 0&&(r={}),n===void 0&&(n=[]);var t=r.manual,i=t===void 0?!1:t,a=r.ready,o=a===void 0?!0:a,s=Tn(r,["manual","ready"]);fr&&r.defaultParams&&!Array.isArray(r.defaultParams)&&console.warn("expected defaultParams is array, got ".concat(typeof r.defaultParams));var f=le({manual:i,ready:o},s),c=wn(e),d=oo(),p=Rn(function(){var b=n.map(function(g){var h;return(h=g==null?void 0:g.onInit)===null||h===void 0?void 0:h.call(g,f)}).filter(Boolean);return new so(c,f,d,Object.assign.apply(Object,re([{}],ee(b),!1)))},[]);return p.options=f,p.pluginImpls=n.map(function(b){return b(p,f)}),io(function(){if(!i&&o){var b=p.state.params||r.defaultParams||[];p.run.apply(p,re([],ee(b),!1))}}),Qr(function(){p.cancel()}),{loading:p.state.loading,data:p.state.data,error:p.state.error,params:p.state.params||[],cancel:Re(p.cancel.bind(p)),refresh:Re(p.refresh.bind(p)),refreshAsync:Re(p.refreshAsync.bind(p)),run:Re(p.run.bind(p)),runAsync:Re(p.runAsync.bind(p)),mutate:Re(p.mutate.bind(p))}}function uo(e,r,n){return co(e,r,re(re([],ee(n||[]),!1),[Gi,Bi,Xi,Qi,ao,Sn,Ni,eo],!1))}function fo(e,r,n){const t=uo(e,{...r,onError(a,o){var s;((r==null?void 0:r.errorMessage)??!0)&&exports.message.error(a.message),(s=r==null?void 0:r.onError)==null||s.call(r,a,o)}},n),i=t.data&&typeof t.data=="object"&&"data"in t.data?t.data.data:t.data;return{...t,data:i}}exports.App=Za;exports.CheckboxValue=ei;exports.ConfigContext=cr;exports.ConfigProvider=bn;exports.GlobalLoading=hn;exports.IconButton=Ti;exports.IconFont=En;exports.SwitchValue=ri;exports.useRequest=fo;
|
|
121
|
+
`,xi=({children:e,tooltipDisabled:r,disabled:n,disabledReason:t,title:i,...a})=>r?e:U.jsx(ge.Tooltip,{title:n&&t||i,...a,children:e}),Ti=(e,r)=>{const{iconButton:n}=P.useContext(cr),{icon:t,tooltipDisabled:i=!1,title:a,hide:o=!1,disabledReason:s,onClick:f=hi,disabled:c,size:d=n.size||"small",style:p={},className:b,loading:g=!1,...h}=e,y=()=>gi(t)?U.jsx(En,{type:t}):t,E=n.render;return t||console.warn("Icon props not found"),U.jsx(E,{...e,children:U.jsx(xi,{tooltipDisabled:i,hide:o,disabled:c,disabledReason:s,title:a,...h,children:U.jsx(Ei,{ref:r,icon:y(),size:d,className:zr(["icon-button",n.className,b]),disabled:c,style:{...n.style,...p},loading:g,onClick:f})})})},Si=P.forwardRef(Ti);var Ri=function(e){return function(r,n){var t=P.useRef(!1);e(function(){return function(){t.current=!1}},[]),e(function(){if(!t.current)t.current=!0;else return r()},n)}},le=function(){return le=Object.assign||function(r){for(var n,t=1,i=arguments.length;t<i;t++){n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},le.apply(this,arguments)};function Tn(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,t=Object.getOwnPropertySymbols(e);i<t.length;i++)r.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]]);return n}function wi(e,r,n,t){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(d){try{c(t.next(d))}catch(p){o(p)}}function f(d){try{c(t.throw(d))}catch(p){o(p)}}function c(d){d.done?a(d.value):i(d.value).then(s,f)}c((t=t.apply(e,r||[])).next())})}function Oi(e,r){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},t,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(d){return f([c,d])}}function f(c){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(t=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){n.label=c[1];break}if(c[0]===6&&n.label<a[1]){n.label=a[1],a=c;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(c);break}a[2]&&n.ops.pop(),n.trys.pop();continue}c=r.call(e,n)}catch(d){c=[6,d],i=0}finally{t=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ee(e,r){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var t=n.call(e),i,a=[],o;try{for(;(r===void 0||r-- >0)&&!(i=t.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=t.return)&&n.call(t)}finally{if(o)throw o.error}}return a}function re(e,r,n){if(n||arguments.length===2)for(var t=0,i=r.length,a;t<i;t++)(a||!(t in r))&&(a||(a=Array.prototype.slice.call(r,0,t)),a[t]=r[t]);return e.concat(a||Array.prototype.slice.call(r))}var ur=function(e){return typeof e=="function"},fr=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";function Re(e){fr&&(ur(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var r=P.useRef(e);r.current=P.useMemo(function(){return e},[e]);var n=P.useRef(void 0);return n.current||(n.current=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return r.current.apply(this,t)}),n.current}const Ur=Ri(P.useEffect);var Sn=function(e,r){var n=r.manual,t=r.ready,i=t===void 0?!0:t,a=r.defaultParams,o=a===void 0?[]:a,s=r.refreshDeps,f=s===void 0?[]:s,c=r.refreshDepsAction,d=P.useRef(!1);return d.current=!1,Ur(function(){!n&&i&&(d.current=!0,e.run.apply(e,re([],ee(o),!1)))},[i]),Ur(function(){d.current||n||(d.current=!0,c?c():e.refresh())},re([],ee(f),!1)),{onBefore:function(){if(!i)return{stopNow:!0}}}};Sn.onInit=function(e){var r=e.ready,n=r===void 0?!0:r,t=e.manual;return{loading:!t&&n}};function _i(e,r){if(e===r)return!0;for(var n=0;n<e.length;n++)if(!Object.is(e[n],r[n]))return!1;return!0}var Rn=function(e,r){var n=P.useRef({deps:r,obj:void 0,initialized:!1}).current;return(n.initialized===!1||!_i(n.deps,r))&&(n.deps=r,n.obj=e(),n.initialized=!0),n.obj};function wn(e){var r=P.useRef(e);return r.current=e,r}var Qr=function(e){fr&&(ur(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var r=wn(e);P.useEffect(function(){return function(){r.current()}},[])},er=new Map,Pi=function(e,r,n){var t=er.get(e);t!=null&&t.timer&&clearTimeout(t.timer);var i=void 0;r>-1&&(i=setTimeout(function(){er.delete(e)},r)),er.set(e,le(le({},n),{timer:i}))},Ci=function(e){return er.get(e)},rr=new Map,Ai=function(e){return rr.get(e)},ji=function(e,r){rr.set(e,r),r.then(function(n){return rr.delete(e),n}).catch(function(){rr.delete(e)})},Te={},Ni=function(e,r){Te[e]&&Te[e].forEach(function(n){return n(r)})},Tr=function(e,r){return Te[e]||(Te[e]=[]),Te[e].push(r),function(){var t=Te[e].indexOf(r);Te[e].splice(t,1)}},ki=function(e,r){var n=r.cacheKey,t=r.cacheTime,i=t===void 0?5*60*1e3:t,a=r.staleTime,o=a===void 0?0:a,s=r.setCache,f=r.getCache,c=P.useRef(void 0),d=P.useRef(void 0),p=function(g,h){s?s(h):Pi(g,i,h),Ni(g,h.data)},b=function(g,h){return h===void 0&&(h=[]),f?f(h):Ci(g)};return Rn(function(){if(n){var g=b(n);g&&Object.hasOwnProperty.call(g,"data")&&(e.state.data=g.data,e.state.params=g.params,(o===-1||Date.now()-g.time<=o)&&(e.state.loading=!1)),c.current=Tr(n,function(h){e.setState({data:h})})}},[]),Qr(function(){var g;(g=c.current)===null||g===void 0||g.call(c)}),n?{onBefore:function(g){var h=b(n,g);return!h||!Object.hasOwnProperty.call(h,"data")?{}:o===-1||Date.now()-h.time<=o?{loading:!1,data:h==null?void 0:h.data,error:void 0,returnNow:!0}:{data:h==null?void 0:h.data,error:void 0}},onRequest:function(g,h){var y=Ai(n);return y&&y!==d.current?{servicePromise:y}:(y=g.apply(void 0,re([],ee(h),!1)),d.current=y,ji(n,y),{servicePromise:y})},onSuccess:function(g,h){var y;n&&((y=c.current)===null||y===void 0||y.call(c),p(n,{data:g,params:h,time:Date.now()}),c.current=Tr(n,function(E){e.setState({data:E})}))},onMutate:function(g){var h;n&&((h=c.current)===null||h===void 0||h.call(c),p(n,{data:g,params:e.state.params,time:Date.now()}),c.current=Tr(n,function(y){e.setState({data:y})}))}}:{}},Sr,Nt;function et(){if(Nt)return Sr;Nt=1;function e(r){var n=typeof r;return r!=null&&(n=="object"||n=="function")}return Sr=e,Sr}var Rr,kt;function $i(){if(kt)return Rr;kt=1;var e=typeof Ge=="object"&&Ge&&Ge.Object===Object&&Ge;return Rr=e,Rr}var wr,$t;function On(){if($t)return wr;$t=1;var e=$i(),r=typeof self=="object"&&self&&self.Object===Object&&self,n=e||r||Function("return this")();return wr=n,wr}var Or,Mt;function Mi(){if(Mt)return Or;Mt=1;var e=On(),r=function(){return e.Date.now()};return Or=r,Or}var _r,It;function Ii(){if(It)return _r;It=1;var e=/\s/;function r(n){for(var t=n.length;t--&&e.test(n.charAt(t)););return t}return _r=r,_r}var Pr,Dt;function Di(){if(Dt)return Pr;Dt=1;var e=Ii(),r=/^\s+/;function n(t){return t&&t.slice(0,e(t)+1).replace(r,"")}return Pr=n,Pr}var Cr,Lt;function _n(){if(Lt)return Cr;Lt=1;var e=On(),r=e.Symbol;return Cr=r,Cr}var Ar,Ft;function Li(){if(Ft)return Ar;Ft=1;var e=_n(),r=Object.prototype,n=r.hasOwnProperty,t=r.toString,i=e?e.toStringTag:void 0;function a(o){var s=n.call(o,i),f=o[i];try{o[i]=void 0;var c=!0}catch{}var d=t.call(o);return c&&(s?o[i]=f:delete o[i]),d}return Ar=a,Ar}var jr,qt;function Fi(){if(qt)return jr;qt=1;var e=Object.prototype,r=e.toString;function n(t){return r.call(t)}return jr=n,jr}var Nr,Yt;function qi(){if(Yt)return Nr;Yt=1;var e=_n(),r=Li(),n=Fi(),t="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:t:a&&a in Object(s)?r(s):n(s)}return Nr=o,Nr}var kr,Wt;function Yi(){if(Wt)return kr;Wt=1;function e(r){return r!=null&&typeof r=="object"}return kr=e,kr}var $r,zt;function Wi(){if(zt)return $r;zt=1;var e=qi(),r=Yi(),n="[object Symbol]";function t(i){return typeof i=="symbol"||r(i)&&e(i)==n}return $r=t,$r}var Mr,Ut;function zi(){if(Ut)return Mr;Ut=1;var e=Di(),r=et(),n=Wi(),t=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function f(c){if(typeof c=="number")return c;if(n(c))return t;if(r(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=r(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=e(c);var p=a.test(c);return p||o.test(c)?s(c.slice(2),p?2:8):i.test(c)?t:+c}return Mr=f,Mr}var Ir,Gt;function Pn(){if(Gt)return Ir;Gt=1;var e=et(),r=Mi(),n=zi(),t="Expected a function",i=Math.max,a=Math.min;function o(s,f,c){var d,p,b,g,h,y,E=0,S=!1,C=!1,x=!0;if(typeof s!="function")throw new TypeError(t);f=n(f)||0,e(c)&&(S=!!c.leading,C="maxWait"in c,b=C?i(n(c.maxWait)||0,f):b,x="trailing"in c?!!c.trailing:x);function R(G){var V=d,ae=p;return d=p=void 0,E=G,g=s.apply(ae,V),g}function l(G){return E=G,h=setTimeout(B,f),S?R(G):g}function k(G){var V=G-y,ae=G-E,X=f-V;return C?a(X,b-ae):X}function A(G){var V=G-y,ae=G-E;return y===void 0||V>=f||V<0||C&&ae>=b}function B(){var G=r();if(A(G))return ce(G);h=setTimeout(B,k(G))}function ce(G){return h=void 0,x&&d?R(G):(d=p=void 0,g)}function ne(){h!==void 0&&clearTimeout(h),E=0,d=y=p=h=void 0}function Z(){return h===void 0?g:ce(r())}function ue(){var G=r(),V=A(G);if(d=arguments,p=this,y=G,V){if(h===void 0)return l(y);if(C)return clearTimeout(h),h=setTimeout(B,f),R(y)}return h===void 0&&(h=setTimeout(B,f)),g}return ue.cancel=ne,ue.flush=Z,ue}return Ir=o,Ir}var Ui=Pn();const Gi=ar(Ui);var Bi=function(e,r){var n=r.debounceWait,t=r.debounceLeading,i=r.debounceTrailing,a=r.debounceMaxWait,o=P.useRef(void 0),s=P.useMemo(function(){var f={};return t!==void 0&&(f.leading=t),i!==void 0&&(f.trailing=i),a!==void 0&&(f.maxWait=a),f},[t,i,a]);return P.useEffect(function(){if(n){var f=e.runAsync.bind(e);return o.current=Gi(function(c){c()},n,s),e.runAsync=function(){for(var c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];return new Promise(function(p,b){var g;(g=o.current)===null||g===void 0||g.call(o,function(){f.apply(void 0,re([],ee(c),!1)).then(p).catch(b)})})},function(){var c;(c=o.current)===null||c===void 0||c.cancel(),e.runAsync=f}}},[n,s]),n?{onCancel:function(){var f;(f=o.current)===null||f===void 0||f.cancel()}}:{}},Vi=function(e,r){var n=r.loadingDelay,t=r.ready,i=P.useRef(void 0);if(!n)return{};var a=function(){i.current&&clearTimeout(i.current)};return{onBefore:function(){return a(),t!==!1&&(i.current=setTimeout(function(){e.setState({loading:!0})},n)),{loading:!1}},onFinally:function(){a()},onCancel:function(){a()}}},lr=!!(typeof window<"u"&&window.document&&window.document.createElement);function rt(){return lr?document.visibilityState!=="hidden":!0}var De=[];function Hi(e){return De.push(e),function(){var n=De.indexOf(e);De.splice(n,1)}}if(lr){var Xi=function(){if(rt())for(var e=0;e<De.length;e++){var r=De[e];r()}};window.addEventListener("visibilitychange",Xi,!1)}var Ji=function(e,r){var n=r.pollingInterval,t=r.pollingWhenHidden,i=t===void 0?!0:t,a=r.pollingErrorRetryCount,o=a===void 0?-1:a,s=P.useRef(void 0),f=P.useRef(void 0),c=P.useRef(0),d=function(){var p;s.current&&clearTimeout(s.current),(p=f.current)===null||p===void 0||p.call(f)};return Ur(function(){n||d()},[n]),n?{onBefore:function(){d()},onError:function(){c.current+=1},onSuccess:function(){c.current=0},onFinally:function(){o===-1||o!==-1&&c.current<=o?s.current=setTimeout(function(){!i&&!rt()?f.current=Hi(function(){e.refresh()}):e.refresh()},n):c.current=0},onCancel:function(){d()}}:{}};function Zi(e,r){var n=!1;return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];n||(n=!0,e.apply(void 0,re([],ee(t),!1)),setTimeout(function(){n=!1},r))}}var Ki=function(){return lr&&typeof navigator.onLine<"u"?navigator.onLine:!0},Le=[];function Qi(e){return Le.push(e),function(){var n=Le.indexOf(e);n>-1&&Le.splice(n,1)}}if(lr){var Bt=function(){if(!(!rt()||!Ki()))for(var e=0;e<Le.length;e++){var r=Le[e];r()}};window.addEventListener("visibilitychange",Bt,!1),window.addEventListener("focus",Bt,!1)}var eo=function(e,r){var n=r.refreshOnWindowFocus,t=r.focusTimespan,i=t===void 0?5e3:t,a=P.useRef(void 0),o=function(){var s;(s=a.current)===null||s===void 0||s.call(a)};return P.useEffect(function(){if(n){var s=Zi(e.refresh.bind(e),i);a.current=Qi(function(){s()})}return function(){o()}},[n,i]),Qr(function(){o()}),{}},ro=function(e,r){var n=r.retryInterval,t=r.retryCount,i=P.useRef(void 0),a=P.useRef(0),o=P.useRef(!1);return t?{onBefore:function(){o.current||(a.current=0),o.current=!1,i.current&&clearTimeout(i.current)},onSuccess:function(){a.current=0},onError:function(){if(a.current+=1,t===-1||a.current<=t){var s=n??Math.min(1e3*Math.pow(2,a.current),3e4);i.current=setTimeout(function(){o.current=!0,e.refresh()},s)}else a.current=0},onCancel:function(){a.current=0,i.current&&clearTimeout(i.current)}}:{}},Dr,Vt;function to(){if(Vt)return Dr;Vt=1;var e=Pn(),r=et(),n="Expected a function";function t(i,a,o){var s=!0,f=!0;if(typeof i!="function")throw new TypeError(n);return r(o)&&(s="leading"in o?!!o.leading:s,f="trailing"in o?!!o.trailing:f),e(i,a,{leading:s,maxWait:a,trailing:f})}return Dr=t,Dr}var no=to();const ao=ar(no);var io=function(e,r){var n=r.throttleWait,t=r.throttleLeading,i=r.throttleTrailing,a=P.useRef(void 0),o={};return t!==void 0&&(o.leading=t),i!==void 0&&(o.trailing=i),P.useEffect(function(){if(n){var s=e.runAsync.bind(e);return a.current=ao(function(f){f()},n,o),e.runAsync=function(){for(var f=[],c=0;c<arguments.length;c++)f[c]=arguments[c];return new Promise(function(d,p){var b;(b=a.current)===null||b===void 0||b.call(a,function(){s.apply(void 0,re([],ee(f),!1)).then(d).catch(p)})})},function(){var f;e.runAsync=s,(f=a.current)===null||f===void 0||f.cancel()}}},[n,t,i]),n?{onCancel:function(){var s;(s=a.current)===null||s===void 0||s.cancel()}}:{}},oo=function(e){fr&&(ur(e)||console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof e,'".'))),P.useEffect(function(){e==null||e()},[])},so=function(){var e=ee(P.useState({}),2),r=e[1];return P.useCallback(function(){return r({})},[])},co=function(){function e(r,n,t,i){i===void 0&&(i={}),this.serviceRef=r,this.options=n,this.subscribe=t,this.initState=i,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=le(le(le({},this.state),{loading:!n.manual}),i)}return e.prototype.setState=function(r){r===void 0&&(r={}),this.state=le(le({},this.state),r),this.subscribe()},e.prototype.runPluginHandler=function(r){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var i=this.pluginImpls.map(function(a){var o;return(o=a[r])===null||o===void 0?void 0:o.call.apply(o,re([a],ee(n),!1))}).filter(Boolean);return Object.assign.apply(Object,re([{}],ee(i),!1))},e.prototype.runAsync=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return wi(this,void 0,void 0,function(){var t,i,a,o,s,f,c,d,p,b,g,h,y,E,S,C,x,R,l,k,A;return Oi(this,function(B){switch(B.label){case 0:if(this.count+=1,t=this.count,i=this.runPluginHandler("onBefore",r),a=i.stopNow,o=a===void 0?!1:a,s=i.returnNow,f=s===void 0?!1:s,c=Tn(i,["stopNow","returnNow"]),o)return[2,new Promise(function(){})];if(this.setState(le({loading:!0,params:r},c)),f)return[2,Promise.resolve(c.data)];(y=(h=this.options).onBefore)===null||y===void 0||y.call(h,r),B.label=1;case 1:return B.trys.push([1,3,,4]),d=this.runPluginHandler("onRequest",this.serviceRef.current,r).servicePromise,d||(d=(g=this.serviceRef).current.apply(g,re([],ee(r),!1))),[4,d];case 2:return p=B.sent(),t!==this.count?[2,new Promise(function(){})]:(this.setState({data:p,error:void 0,loading:!1}),(S=(E=this.options).onSuccess)===null||S===void 0||S.call(E,p,r),this.runPluginHandler("onSuccess",p,r),(x=(C=this.options).onFinally)===null||x===void 0||x.call(C,r,p,void 0),t===this.count&&this.runPluginHandler("onFinally",r,p,void 0),[2,p]);case 3:if(b=B.sent(),t!==this.count)return[2,new Promise(function(){})];throw this.setState({error:b,loading:!1}),(l=(R=this.options).onError)===null||l===void 0||l.call(R,b,r),this.runPluginHandler("onError",b,r),(A=(k=this.options).onFinally)===null||A===void 0||A.call(k,r,void 0,b),t===this.count&&this.runPluginHandler("onFinally",r,void 0,b),b;case 4:return[2]}})})},e.prototype.run=function(){for(var r=this,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.runAsync.apply(this,re([],ee(n),!1)).catch(function(i){r.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,re([],ee(this.state.params||[]),!1))},e.prototype.refreshAsync=function(){return this.runAsync.apply(this,re([],ee(this.state.params||[]),!1))},e.prototype.mutate=function(r){var n=ur(r)?r(this.state.data):r;this.runPluginHandler("onMutate",n),this.setState({data:n})},e}();function uo(e,r,n){r===void 0&&(r={}),n===void 0&&(n=[]);var t=r.manual,i=t===void 0?!1:t,a=r.ready,o=a===void 0?!0:a,s=Tn(r,["manual","ready"]);fr&&r.defaultParams&&!Array.isArray(r.defaultParams)&&console.warn("expected defaultParams is array, got ".concat(typeof r.defaultParams));var f=le({manual:i,ready:o},s),c=wn(e),d=so(),p=Rn(function(){var b=n.map(function(g){var h;return(h=g==null?void 0:g.onInit)===null||h===void 0?void 0:h.call(g,f)}).filter(Boolean);return new co(c,f,d,Object.assign.apply(Object,re([{}],ee(b),!1)))},[]);return p.options=f,p.pluginImpls=n.map(function(b){return b(p,f)}),oo(function(){if(!i&&o){var b=p.state.params||r.defaultParams||[];p.run.apply(p,re([],ee(b),!1))}}),Qr(function(){p.cancel()}),{loading:p.state.loading,data:p.state.data,error:p.state.error,params:p.state.params||[],cancel:Re(p.cancel.bind(p)),refresh:Re(p.refresh.bind(p)),refreshAsync:Re(p.refreshAsync.bind(p)),run:Re(p.run.bind(p)),runAsync:Re(p.runAsync.bind(p)),mutate:Re(p.mutate.bind(p))}}function fo(e,r,n){return uo(e,r,re(re([],ee(n||[]),!1),[Bi,Vi,Ji,eo,io,Sn,ki,ro],!1))}function lo(e,r,n){const t=fo(e,{...r,onError(a,o){var s;((r==null?void 0:r.errorMessage)??!0)&&exports.message.error(a.message),(s=r==null?void 0:r.onError)==null||s.call(r,a,o)}},n),i=t.data&&typeof t.data=="object"&&"data"in t.data?t.data.data:t.data;return{...t,data:i}}exports.App=Za;exports.CheckboxValue=ei;exports.ConfigContext=cr;exports.ConfigProvider=bn;exports.GlobalLoading=hn;exports.IconButton=Si;exports.IconFont=En;exports.SwitchValue=ri;exports.useRequest=lo;
|
package/build/dist/index.mjs
CHANGED
|
@@ -3028,7 +3028,7 @@ function di({ children: e }) {
|
|
|
3028
3028
|
const r = Qt.useApp();
|
|
3029
3029
|
return Rn = r.message, li = r.modal, fi = r.notification, e || "";
|
|
3030
3030
|
}
|
|
3031
|
-
function
|
|
3031
|
+
function Po({ children: e, config: r, ...n }) {
|
|
3032
3032
|
return /* @__PURE__ */ z.jsx(
|
|
3033
3033
|
ui,
|
|
3034
3034
|
{
|
|
@@ -3125,7 +3125,7 @@ const zr = /* @__PURE__ */ ir(vi), mi = Jt(
|
|
|
3125
3125
|
}
|
|
3126
3126
|
);
|
|
3127
3127
|
}
|
|
3128
|
-
),
|
|
3128
|
+
), Co = ({
|
|
3129
3129
|
checked: e,
|
|
3130
3130
|
onChange: r,
|
|
3131
3131
|
trueValue: n = !0,
|
|
@@ -3147,7 +3147,7 @@ const zr = /* @__PURE__ */ ir(vi), mi = Jt(
|
|
|
3147
3147
|
children: o || (f ? i : a)
|
|
3148
3148
|
}
|
|
3149
3149
|
);
|
|
3150
|
-
},
|
|
3150
|
+
}, Ao = ({
|
|
3151
3151
|
checked: e,
|
|
3152
3152
|
onChange: r,
|
|
3153
3153
|
trueValue: n = !0,
|
|
@@ -3228,7 +3228,7 @@ const ki = de.forwardRef((e, r) => /* @__PURE__ */ z.jsx(Fn, { ref: r, ...e })),
|
|
|
3228
3228
|
...a,
|
|
3229
3229
|
children: e
|
|
3230
3230
|
}
|
|
3231
|
-
),
|
|
3231
|
+
), Mi = (e, r) => {
|
|
3232
3232
|
const { iconButton: n } = Gr(et), {
|
|
3233
3233
|
icon: t,
|
|
3234
3234
|
tooltipDisabled: i = !1,
|
|
@@ -3276,8 +3276,8 @@ const ki = de.forwardRef((e, r) => /* @__PURE__ */ z.jsx(Fn, { ref: r, ...e })),
|
|
|
3276
3276
|
)
|
|
3277
3277
|
}
|
|
3278
3278
|
);
|
|
3279
|
-
});
|
|
3280
|
-
var
|
|
3279
|
+
}, jo = de.forwardRef(Mi);
|
|
3280
|
+
var Di = function(e) {
|
|
3281
3281
|
return function(r, n) {
|
|
3282
3282
|
var t = H(!1);
|
|
3283
3283
|
e(function() {
|
|
@@ -3308,7 +3308,7 @@ function _n(e, r) {
|
|
|
3308
3308
|
r.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (n[t[i]] = e[t[i]]);
|
|
3309
3309
|
return n;
|
|
3310
3310
|
}
|
|
3311
|
-
function
|
|
3311
|
+
function Li(e, r, n, t) {
|
|
3312
3312
|
function i(a) {
|
|
3313
3313
|
return a instanceof n ? a : new n(function(o) {
|
|
3314
3314
|
o(a);
|
|
@@ -3335,7 +3335,7 @@ function Di(e, r, n, t) {
|
|
|
3335
3335
|
c((t = t.apply(e, r || [])).next());
|
|
3336
3336
|
});
|
|
3337
3337
|
}
|
|
3338
|
-
function
|
|
3338
|
+
function Fi(e, r) {
|
|
3339
3339
|
var n = { label: 0, sent: function() {
|
|
3340
3340
|
if (a[0] & 1) throw a[1];
|
|
3341
3341
|
return a[1];
|
|
@@ -3433,7 +3433,7 @@ function we(e) {
|
|
|
3433
3433
|
return r.current.apply(this, t);
|
|
3434
3434
|
}), n.current;
|
|
3435
3435
|
}
|
|
3436
|
-
const Ur =
|
|
3436
|
+
const Ur = Di(Se);
|
|
3437
3437
|
var On = function(e, r) {
|
|
3438
3438
|
var n = r.manual, t = r.ready, i = t === void 0 ? !0 : t, a = r.defaultParams, o = a === void 0 ? [] : a, s = r.refreshDeps, f = s === void 0 ? [] : s, c = r.refreshDepsAction, d = H(!1);
|
|
3439
3439
|
return d.current = !1, Ur(function() {
|
|
@@ -3455,7 +3455,7 @@ On.onInit = function(e) {
|
|
|
3455
3455
|
loading: !t && n
|
|
3456
3456
|
};
|
|
3457
3457
|
};
|
|
3458
|
-
function
|
|
3458
|
+
function qi(e, r) {
|
|
3459
3459
|
if (e === r)
|
|
3460
3460
|
return !0;
|
|
3461
3461
|
for (var n = 0; n < e.length; n++)
|
|
@@ -3469,7 +3469,7 @@ var Pn = function(e, r) {
|
|
|
3469
3469
|
obj: void 0,
|
|
3470
3470
|
initialized: !1
|
|
3471
3471
|
}).current;
|
|
3472
|
-
return (n.initialized === !1 || !
|
|
3472
|
+
return (n.initialized === !1 || !qi(n.deps, r)) && (n.deps = r, n.obj = e(), n.initialized = !0), n.obj;
|
|
3473
3473
|
};
|
|
3474
3474
|
function Cn(e) {
|
|
3475
3475
|
var r = H(e);
|
|
@@ -3483,7 +3483,7 @@ var rt = function(e) {
|
|
|
3483
3483
|
r.current();
|
|
3484
3484
|
};
|
|
3485
3485
|
}, []);
|
|
3486
|
-
}, rr = /* @__PURE__ */ new Map(),
|
|
3486
|
+
}, rr = /* @__PURE__ */ new Map(), Yi = function(e, r, n) {
|
|
3487
3487
|
var t = rr.get(e);
|
|
3488
3488
|
t != null && t.timer && clearTimeout(t.timer);
|
|
3489
3489
|
var i = void 0;
|
|
@@ -3492,17 +3492,17 @@ var rt = function(e) {
|
|
|
3492
3492
|
}, r)), rr.set(e, le(le({}, n), {
|
|
3493
3493
|
timer: i
|
|
3494
3494
|
}));
|
|
3495
|
-
},
|
|
3495
|
+
}, Wi = function(e) {
|
|
3496
3496
|
return rr.get(e);
|
|
3497
|
-
}, tr = /* @__PURE__ */ new Map(),
|
|
3497
|
+
}, tr = /* @__PURE__ */ new Map(), zi = function(e) {
|
|
3498
3498
|
return tr.get(e);
|
|
3499
|
-
},
|
|
3499
|
+
}, Ui = function(e, r) {
|
|
3500
3500
|
tr.set(e, r), r.then(function(n) {
|
|
3501
3501
|
return tr.delete(e), n;
|
|
3502
3502
|
}).catch(function() {
|
|
3503
3503
|
tr.delete(e);
|
|
3504
3504
|
});
|
|
3505
|
-
}, Te = {},
|
|
3505
|
+
}, Te = {}, Gi = function(e, r) {
|
|
3506
3506
|
Te[e] && Te[e].forEach(function(n) {
|
|
3507
3507
|
return n(r);
|
|
3508
3508
|
});
|
|
@@ -3511,11 +3511,11 @@ var rt = function(e) {
|
|
|
3511
3511
|
var t = Te[e].indexOf(r);
|
|
3512
3512
|
Te[e].splice(t, 1);
|
|
3513
3513
|
};
|
|
3514
|
-
},
|
|
3514
|
+
}, Bi = function(e, r) {
|
|
3515
3515
|
var n = r.cacheKey, t = r.cacheTime, i = t === void 0 ? 5 * 60 * 1e3 : t, a = r.staleTime, o = a === void 0 ? 0 : a, s = r.setCache, f = r.getCache, c = H(void 0), d = H(void 0), p = function(g, h) {
|
|
3516
|
-
s ? s(h) :
|
|
3516
|
+
s ? s(h) : Yi(g, i, h), Gi(g, h.data);
|
|
3517
3517
|
}, b = function(g, h) {
|
|
3518
|
-
return h === void 0 && (h = []), f ? f(h) :
|
|
3518
|
+
return h === void 0 && (h = []), f ? f(h) : Wi(g);
|
|
3519
3519
|
};
|
|
3520
3520
|
return Pn(function() {
|
|
3521
3521
|
if (n) {
|
|
@@ -3543,10 +3543,10 @@ var rt = function(e) {
|
|
|
3543
3543
|
};
|
|
3544
3544
|
},
|
|
3545
3545
|
onRequest: function(g, h) {
|
|
3546
|
-
var y =
|
|
3546
|
+
var y = zi(n);
|
|
3547
3547
|
return y && y !== d.current ? {
|
|
3548
3548
|
servicePromise: y
|
|
3549
|
-
} : (y = g.apply(void 0, re([], ee(h), !1)), d.current = y,
|
|
3549
|
+
} : (y = g.apply(void 0, re([], ee(h), !1)), d.current = y, Ui(n, y), {
|
|
3550
3550
|
servicePromise: y
|
|
3551
3551
|
});
|
|
3552
3552
|
},
|
|
@@ -3586,7 +3586,7 @@ function tt() {
|
|
|
3586
3586
|
return Sr = e, Sr;
|
|
3587
3587
|
}
|
|
3588
3588
|
var Rr, It;
|
|
3589
|
-
function
|
|
3589
|
+
function Vi() {
|
|
3590
3590
|
if (It) return Rr;
|
|
3591
3591
|
It = 1;
|
|
3592
3592
|
var e = typeof Be == "object" && Be && Be.Object === Object && Be;
|
|
@@ -3596,11 +3596,11 @@ var wr, Mt;
|
|
|
3596
3596
|
function An() {
|
|
3597
3597
|
if (Mt) return wr;
|
|
3598
3598
|
Mt = 1;
|
|
3599
|
-
var e =
|
|
3599
|
+
var e = Vi(), r = typeof self == "object" && self && self.Object === Object && self, n = e || r || Function("return this")();
|
|
3600
3600
|
return wr = n, wr;
|
|
3601
3601
|
}
|
|
3602
3602
|
var _r, Dt;
|
|
3603
|
-
function
|
|
3603
|
+
function Hi() {
|
|
3604
3604
|
if (Dt) return _r;
|
|
3605
3605
|
Dt = 1;
|
|
3606
3606
|
var e = An(), r = function() {
|
|
@@ -3609,7 +3609,7 @@ function Vi() {
|
|
|
3609
3609
|
return _r = r, _r;
|
|
3610
3610
|
}
|
|
3611
3611
|
var Or, Lt;
|
|
3612
|
-
function
|
|
3612
|
+
function Xi() {
|
|
3613
3613
|
if (Lt) return Or;
|
|
3614
3614
|
Lt = 1;
|
|
3615
3615
|
var e = /\s/;
|
|
@@ -3621,10 +3621,10 @@ function Hi() {
|
|
|
3621
3621
|
return Or = r, Or;
|
|
3622
3622
|
}
|
|
3623
3623
|
var Pr, Ft;
|
|
3624
|
-
function
|
|
3624
|
+
function Ji() {
|
|
3625
3625
|
if (Ft) return Pr;
|
|
3626
3626
|
Ft = 1;
|
|
3627
|
-
var e =
|
|
3627
|
+
var e = Xi(), r = /^\s+/;
|
|
3628
3628
|
function n(t) {
|
|
3629
3629
|
return t && t.slice(0, e(t) + 1).replace(r, "");
|
|
3630
3630
|
}
|
|
@@ -3638,7 +3638,7 @@ function jn() {
|
|
|
3638
3638
|
return Cr = r, Cr;
|
|
3639
3639
|
}
|
|
3640
3640
|
var Ar, Yt;
|
|
3641
|
-
function
|
|
3641
|
+
function Zi() {
|
|
3642
3642
|
if (Yt) return Ar;
|
|
3643
3643
|
Yt = 1;
|
|
3644
3644
|
var e = jn(), r = Object.prototype, n = r.hasOwnProperty, t = r.toString, i = e ? e.toStringTag : void 0;
|
|
@@ -3655,7 +3655,7 @@ function Ji() {
|
|
|
3655
3655
|
return Ar = a, Ar;
|
|
3656
3656
|
}
|
|
3657
3657
|
var jr, Wt;
|
|
3658
|
-
function
|
|
3658
|
+
function Ki() {
|
|
3659
3659
|
if (Wt) return jr;
|
|
3660
3660
|
Wt = 1;
|
|
3661
3661
|
var e = Object.prototype, r = e.toString;
|
|
@@ -3665,17 +3665,17 @@ function Zi() {
|
|
|
3665
3665
|
return jr = n, jr;
|
|
3666
3666
|
}
|
|
3667
3667
|
var Nr, zt;
|
|
3668
|
-
function
|
|
3668
|
+
function Qi() {
|
|
3669
3669
|
if (zt) return Nr;
|
|
3670
3670
|
zt = 1;
|
|
3671
|
-
var e = jn(), r =
|
|
3671
|
+
var e = jn(), r = Zi(), n = Ki(), t = "[object Null]", i = "[object Undefined]", a = e ? e.toStringTag : void 0;
|
|
3672
3672
|
function o(s) {
|
|
3673
3673
|
return s == null ? s === void 0 ? i : t : a && a in Object(s) ? r(s) : n(s);
|
|
3674
3674
|
}
|
|
3675
3675
|
return Nr = o, Nr;
|
|
3676
3676
|
}
|
|
3677
3677
|
var kr, Ut;
|
|
3678
|
-
function
|
|
3678
|
+
function eo() {
|
|
3679
3679
|
if (Ut) return kr;
|
|
3680
3680
|
Ut = 1;
|
|
3681
3681
|
function e(r) {
|
|
@@ -3684,20 +3684,20 @@ function Qi() {
|
|
|
3684
3684
|
return kr = e, kr;
|
|
3685
3685
|
}
|
|
3686
3686
|
var $r, Gt;
|
|
3687
|
-
function
|
|
3687
|
+
function ro() {
|
|
3688
3688
|
if (Gt) return $r;
|
|
3689
3689
|
Gt = 1;
|
|
3690
|
-
var e =
|
|
3690
|
+
var e = Qi(), r = eo(), n = "[object Symbol]";
|
|
3691
3691
|
function t(i) {
|
|
3692
3692
|
return typeof i == "symbol" || r(i) && e(i) == n;
|
|
3693
3693
|
}
|
|
3694
3694
|
return $r = t, $r;
|
|
3695
3695
|
}
|
|
3696
3696
|
var Ir, Bt;
|
|
3697
|
-
function
|
|
3697
|
+
function to() {
|
|
3698
3698
|
if (Bt) return Ir;
|
|
3699
3699
|
Bt = 1;
|
|
3700
|
-
var e =
|
|
3700
|
+
var e = Ji(), r = tt(), n = ro(), t = NaN, i = /^[-+]0x[0-9a-f]+$/i, a = /^0b[01]+$/i, o = /^0o[0-7]+$/i, s = parseInt;
|
|
3701
3701
|
function f(c) {
|
|
3702
3702
|
if (typeof c == "number")
|
|
3703
3703
|
return c;
|
|
@@ -3719,7 +3719,7 @@ var Mr, Vt;
|
|
|
3719
3719
|
function Nn() {
|
|
3720
3720
|
if (Vt) return Mr;
|
|
3721
3721
|
Vt = 1;
|
|
3722
|
-
var e = tt(), r =
|
|
3722
|
+
var e = tt(), r = Hi(), n = to(), t = "Expected a function", i = Math.max, a = Math.min;
|
|
3723
3723
|
function o(s, f, c) {
|
|
3724
3724
|
var d, p, b, g, h, y, E = 0, S = !1, P = !1, x = !0;
|
|
3725
3725
|
if (typeof s != "function")
|
|
@@ -3769,9 +3769,9 @@ function Nn() {
|
|
|
3769
3769
|
}
|
|
3770
3770
|
return Mr = o, Mr;
|
|
3771
3771
|
}
|
|
3772
|
-
var
|
|
3773
|
-
const
|
|
3774
|
-
var
|
|
3772
|
+
var no = Nn();
|
|
3773
|
+
const ao = /* @__PURE__ */ ir(no);
|
|
3774
|
+
var io = function(e, r) {
|
|
3775
3775
|
var n = r.debounceWait, t = r.debounceLeading, i = r.debounceTrailing, a = r.debounceMaxWait, o = H(void 0), s = Kt(function() {
|
|
3776
3776
|
var f = {};
|
|
3777
3777
|
return t !== void 0 && (f.leading = t), i !== void 0 && (f.trailing = i), a !== void 0 && (f.maxWait = a), f;
|
|
@@ -3779,7 +3779,7 @@ var ao = function(e, r) {
|
|
|
3779
3779
|
return Se(function() {
|
|
3780
3780
|
if (n) {
|
|
3781
3781
|
var f = e.runAsync.bind(e);
|
|
3782
|
-
return o.current =
|
|
3782
|
+
return o.current = ao(function(c) {
|
|
3783
3783
|
c();
|
|
3784
3784
|
}, n, s), e.runAsync = function() {
|
|
3785
3785
|
for (var c = [], d = 0; d < arguments.length; d++)
|
|
@@ -3801,7 +3801,7 @@ var ao = function(e, r) {
|
|
|
3801
3801
|
(f = o.current) === null || f === void 0 || f.cancel();
|
|
3802
3802
|
}
|
|
3803
3803
|
} : {};
|
|
3804
|
-
},
|
|
3804
|
+
}, oo = function(e, r) {
|
|
3805
3805
|
var n = r.loadingDelay, t = r.ready, i = H(void 0);
|
|
3806
3806
|
if (!n)
|
|
3807
3807
|
return {};
|
|
@@ -3830,23 +3830,23 @@ function nt() {
|
|
|
3830
3830
|
return lr ? document.visibilityState !== "hidden" : !0;
|
|
3831
3831
|
}
|
|
3832
3832
|
var Le = [];
|
|
3833
|
-
function
|
|
3833
|
+
function so(e) {
|
|
3834
3834
|
return Le.push(e), function() {
|
|
3835
3835
|
var n = Le.indexOf(e);
|
|
3836
3836
|
Le.splice(n, 1);
|
|
3837
3837
|
};
|
|
3838
3838
|
}
|
|
3839
3839
|
if (lr) {
|
|
3840
|
-
var
|
|
3840
|
+
var co = function() {
|
|
3841
3841
|
if (nt())
|
|
3842
3842
|
for (var e = 0; e < Le.length; e++) {
|
|
3843
3843
|
var r = Le[e];
|
|
3844
3844
|
r();
|
|
3845
3845
|
}
|
|
3846
3846
|
};
|
|
3847
|
-
window.addEventListener("visibilitychange",
|
|
3847
|
+
window.addEventListener("visibilitychange", co, !1);
|
|
3848
3848
|
}
|
|
3849
|
-
var
|
|
3849
|
+
var uo = function(e, r) {
|
|
3850
3850
|
var n = r.pollingInterval, t = r.pollingWhenHidden, i = t === void 0 ? !0 : t, a = r.pollingErrorRetryCount, o = a === void 0 ? -1 : a, s = H(void 0), f = H(void 0), c = H(0), d = function() {
|
|
3851
3851
|
var p;
|
|
3852
3852
|
s.current && clearTimeout(s.current), (p = f.current) === null || p === void 0 || p.call(f);
|
|
@@ -3866,7 +3866,7 @@ var co = function(e, r) {
|
|
|
3866
3866
|
onFinally: function() {
|
|
3867
3867
|
o === -1 || // When an error occurs, the request is not repeated after pollingErrorRetryCount retries
|
|
3868
3868
|
o !== -1 && c.current <= o ? s.current = setTimeout(function() {
|
|
3869
|
-
!i && !nt() ? f.current =
|
|
3869
|
+
!i && !nt() ? f.current = so(function() {
|
|
3870
3870
|
e.refresh();
|
|
3871
3871
|
}) : e.refresh();
|
|
3872
3872
|
}, n) : c.current = 0;
|
|
@@ -3876,7 +3876,7 @@ var co = function(e, r) {
|
|
|
3876
3876
|
}
|
|
3877
3877
|
} : {};
|
|
3878
3878
|
};
|
|
3879
|
-
function
|
|
3879
|
+
function fo(e, r) {
|
|
3880
3880
|
var n = !1;
|
|
3881
3881
|
return function() {
|
|
3882
3882
|
for (var t = [], i = 0; i < arguments.length; i++)
|
|
@@ -3886,10 +3886,10 @@ function uo(e, r) {
|
|
|
3886
3886
|
}, r));
|
|
3887
3887
|
};
|
|
3888
3888
|
}
|
|
3889
|
-
var
|
|
3889
|
+
var lo = function() {
|
|
3890
3890
|
return lr && typeof navigator.onLine < "u" ? navigator.onLine : !0;
|
|
3891
3891
|
}, Fe = [];
|
|
3892
|
-
function
|
|
3892
|
+
function po(e) {
|
|
3893
3893
|
return Fe.push(e), function() {
|
|
3894
3894
|
var n = Fe.indexOf(e);
|
|
3895
3895
|
n > -1 && Fe.splice(n, 1);
|
|
@@ -3897,7 +3897,7 @@ function lo(e) {
|
|
|
3897
3897
|
}
|
|
3898
3898
|
if (lr) {
|
|
3899
3899
|
var Ht = function() {
|
|
3900
|
-
if (!(!nt() || !
|
|
3900
|
+
if (!(!nt() || !lo()))
|
|
3901
3901
|
for (var e = 0; e < Fe.length; e++) {
|
|
3902
3902
|
var r = Fe[e];
|
|
3903
3903
|
r();
|
|
@@ -3905,15 +3905,15 @@ if (lr) {
|
|
|
3905
3905
|
};
|
|
3906
3906
|
window.addEventListener("visibilitychange", Ht, !1), window.addEventListener("focus", Ht, !1);
|
|
3907
3907
|
}
|
|
3908
|
-
var
|
|
3908
|
+
var vo = function(e, r) {
|
|
3909
3909
|
var n = r.refreshOnWindowFocus, t = r.focusTimespan, i = t === void 0 ? 5e3 : t, a = H(void 0), o = function() {
|
|
3910
3910
|
var s;
|
|
3911
3911
|
(s = a.current) === null || s === void 0 || s.call(a);
|
|
3912
3912
|
};
|
|
3913
3913
|
return Se(function() {
|
|
3914
3914
|
if (n) {
|
|
3915
|
-
var s =
|
|
3916
|
-
a.current =
|
|
3915
|
+
var s = fo(e.refresh.bind(e), i);
|
|
3916
|
+
a.current = po(function() {
|
|
3917
3917
|
s();
|
|
3918
3918
|
});
|
|
3919
3919
|
}
|
|
@@ -3923,7 +3923,7 @@ var po = function(e, r) {
|
|
|
3923
3923
|
}, [n, i]), rt(function() {
|
|
3924
3924
|
o();
|
|
3925
3925
|
}), {};
|
|
3926
|
-
},
|
|
3926
|
+
}, mo = function(e, r) {
|
|
3927
3927
|
var n = r.retryInterval, t = r.retryCount, i = H(void 0), a = H(0), o = H(!1);
|
|
3928
3928
|
return t ? {
|
|
3929
3929
|
onBefore: function() {
|
|
@@ -3946,7 +3946,7 @@ var po = function(e, r) {
|
|
|
3946
3946
|
}
|
|
3947
3947
|
} : {};
|
|
3948
3948
|
}, Dr, Xt;
|
|
3949
|
-
function
|
|
3949
|
+
function ho() {
|
|
3950
3950
|
if (Xt) return Dr;
|
|
3951
3951
|
Xt = 1;
|
|
3952
3952
|
var e = Nn(), r = tt(), n = "Expected a function";
|
|
@@ -3962,14 +3962,14 @@ function mo() {
|
|
|
3962
3962
|
}
|
|
3963
3963
|
return Dr = t, Dr;
|
|
3964
3964
|
}
|
|
3965
|
-
var
|
|
3966
|
-
const
|
|
3967
|
-
var
|
|
3965
|
+
var yo = ho();
|
|
3966
|
+
const go = /* @__PURE__ */ ir(yo);
|
|
3967
|
+
var bo = function(e, r) {
|
|
3968
3968
|
var n = r.throttleWait, t = r.throttleLeading, i = r.throttleTrailing, a = H(void 0), o = {};
|
|
3969
3969
|
return t !== void 0 && (o.leading = t), i !== void 0 && (o.trailing = i), Se(function() {
|
|
3970
3970
|
if (n) {
|
|
3971
3971
|
var s = e.runAsync.bind(e);
|
|
3972
|
-
return a.current =
|
|
3972
|
+
return a.current = go(function(f) {
|
|
3973
3973
|
f();
|
|
3974
3974
|
}, n, o), e.runAsync = function() {
|
|
3975
3975
|
for (var f = [], c = 0; c < arguments.length; c++)
|
|
@@ -3991,16 +3991,16 @@ var go = function(e, r) {
|
|
|
3991
3991
|
(s = a.current) === null || s === void 0 || s.cancel();
|
|
3992
3992
|
}
|
|
3993
3993
|
} : {};
|
|
3994
|
-
},
|
|
3994
|
+
}, Eo = function(e) {
|
|
3995
3995
|
fr && (ur(e) || console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof e, '".'))), Se(function() {
|
|
3996
3996
|
e == null || e();
|
|
3997
3997
|
}, []);
|
|
3998
|
-
},
|
|
3998
|
+
}, xo = function() {
|
|
3999
3999
|
var e = ee(Zt({}), 2), r = e[1];
|
|
4000
4000
|
return kn(function() {
|
|
4001
4001
|
return r({});
|
|
4002
4002
|
}, []);
|
|
4003
|
-
},
|
|
4003
|
+
}, To = (
|
|
4004
4004
|
/** @class */
|
|
4005
4005
|
function() {
|
|
4006
4006
|
function e(r, n, t, i) {
|
|
@@ -4026,9 +4026,9 @@ var go = function(e, r) {
|
|
|
4026
4026
|
}, e.prototype.runAsync = function() {
|
|
4027
4027
|
for (var r = [], n = 0; n < arguments.length; n++)
|
|
4028
4028
|
r[n] = arguments[n];
|
|
4029
|
-
return
|
|
4029
|
+
return Li(this, void 0, void 0, function() {
|
|
4030
4030
|
var t, i, a, o, s, f, c, d, p, b, g, h, y, E, S, P, x, R, l, N, C;
|
|
4031
|
-
return
|
|
4031
|
+
return Fi(this, function(G) {
|
|
4032
4032
|
switch (G.label) {
|
|
4033
4033
|
case 0:
|
|
4034
4034
|
if (this.count += 1, t = this.count, i = this.runPluginHandler("onBefore", r), a = i.stopNow, o = a === void 0 ? !1 : a, s = i.returnNow, f = s === void 0 ? !1 : s, c = _n(i, ["stopNow", "returnNow"]), o)
|
|
@@ -4087,23 +4087,23 @@ var go = function(e, r) {
|
|
|
4087
4087
|
}, e;
|
|
4088
4088
|
}()
|
|
4089
4089
|
);
|
|
4090
|
-
function
|
|
4090
|
+
function So(e, r, n) {
|
|
4091
4091
|
r === void 0 && (r = {}), n === void 0 && (n = []);
|
|
4092
4092
|
var t = r.manual, i = t === void 0 ? !1 : t, a = r.ready, o = a === void 0 ? !0 : a, s = _n(r, ["manual", "ready"]);
|
|
4093
4093
|
fr && r.defaultParams && !Array.isArray(r.defaultParams) && console.warn("expected defaultParams is array, got ".concat(typeof r.defaultParams));
|
|
4094
4094
|
var f = le({
|
|
4095
4095
|
manual: i,
|
|
4096
4096
|
ready: o
|
|
4097
|
-
}, s), c = Cn(e), d =
|
|
4097
|
+
}, s), c = Cn(e), d = xo(), p = Pn(function() {
|
|
4098
4098
|
var b = n.map(function(g) {
|
|
4099
4099
|
var h;
|
|
4100
4100
|
return (h = g == null ? void 0 : g.onInit) === null || h === void 0 ? void 0 : h.call(g, f);
|
|
4101
4101
|
}).filter(Boolean);
|
|
4102
|
-
return new
|
|
4102
|
+
return new To(c, f, d, Object.assign.apply(Object, re([{}], ee(b), !1)));
|
|
4103
4103
|
}, []);
|
|
4104
4104
|
return p.options = f, p.pluginImpls = n.map(function(b) {
|
|
4105
4105
|
return b(p, f);
|
|
4106
|
-
}),
|
|
4106
|
+
}), Eo(function() {
|
|
4107
4107
|
if (!i && o) {
|
|
4108
4108
|
var b = p.state.params || r.defaultParams || [];
|
|
4109
4109
|
p.run.apply(p, re([], ee(b), !1));
|
|
@@ -4123,11 +4123,11 @@ function To(e, r, n) {
|
|
|
4123
4123
|
mutate: we(p.mutate.bind(p))
|
|
4124
4124
|
};
|
|
4125
4125
|
}
|
|
4126
|
-
function
|
|
4127
|
-
return
|
|
4126
|
+
function Ro(e, r, n) {
|
|
4127
|
+
return So(e, r, re(re([], ee(n || []), !1), [io, oo, uo, vo, bo, On, Bi, mo], !1));
|
|
4128
4128
|
}
|
|
4129
|
-
function
|
|
4130
|
-
const t =
|
|
4129
|
+
function No(e, r, n) {
|
|
4130
|
+
const t = Ro(e, {
|
|
4131
4131
|
...r,
|
|
4132
4132
|
onError(a, o) {
|
|
4133
4133
|
var s;
|
|
@@ -4140,17 +4140,17 @@ function jo(e, r, n) {
|
|
|
4140
4140
|
};
|
|
4141
4141
|
}
|
|
4142
4142
|
export {
|
|
4143
|
-
|
|
4144
|
-
|
|
4143
|
+
Po as App,
|
|
4144
|
+
Co as CheckboxValue,
|
|
4145
4145
|
et as ConfigContext,
|
|
4146
4146
|
ui as ConfigProvider,
|
|
4147
4147
|
ci as GlobalLoading,
|
|
4148
|
-
|
|
4148
|
+
jo as IconButton,
|
|
4149
4149
|
mi as IconFont,
|
|
4150
|
-
|
|
4150
|
+
Ao as SwitchValue,
|
|
4151
4151
|
Rn as message,
|
|
4152
4152
|
li as modal,
|
|
4153
4153
|
fi as notification,
|
|
4154
4154
|
ai as setGlobalLoading,
|
|
4155
|
-
|
|
4155
|
+
No as useRequest
|
|
4156
4156
|
};
|
|
@@ -48,9 +48,9 @@ export interface IconButtonProps extends Omit<ButtonTooltipProps, 'children'> {
|
|
|
48
48
|
*/
|
|
49
49
|
loading?: boolean;
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* sca 权限id属性
|
|
52
52
|
*/
|
|
53
|
-
flag?:
|
|
53
|
+
flag?: string | number;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
export default
|
|
55
|
+
declare const _default: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
56
|
+
export default _default;
|
|
@@ -44,7 +44,7 @@ var ButtonTooltip = function (_a) {
|
|
|
44
44
|
return (React.createElement(Tooltip, __assign({ title: disabled ? disabledReason || title : title }, attrs), children));
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
var IconButton = function (props, ref) {
|
|
48
48
|
var iconButton = useContext(ConfigContext).iconButton;
|
|
49
49
|
var Icon = props.icon, _a = props.tooltipDisabled, tooltipDisabled = _a === void 0 ? false : _a, title = props.title, _b = props.hide, hide = _b === void 0 ? false : _b, disabledReason = props.disabledReason, _c = props.onClick, onClick = _c === void 0 ? noop : _c, disabled = props.disabled, _d = props.size, size = _d === void 0 ? iconButton.size || 'small' : _d, _e = props.style, style = _e === void 0 ? {} : _e, className = props.className, _f = props.loading, loading = _f === void 0 ? false : _f, attrs = __rest(props, ["icon", "tooltipDisabled", "title", "hide", "disabledReason", "onClick", "disabled", "size", "style", "className", "loading"]);
|
|
50
50
|
var createIcon = function () {
|
|
@@ -62,6 +62,6 @@ export var IconButton = React.forwardRef(function (props, ref) {
|
|
|
62
62
|
return (React.createElement(IconButtonRender, __assign({}, props),
|
|
63
63
|
React.createElement(ButtonTooltip, __assign({ tooltipDisabled: tooltipDisabled, hide: hide, disabled: disabled, disabledReason: disabledReason, title: title }, attrs),
|
|
64
64
|
React.createElement(StyledButton, { ref: ref, icon: createIcon(), size: size, className: classNames(['icon-button', iconButton.className, className]), disabled: disabled, style: __assign(__assign({}, iconButton.style), style), loading: loading, onClick: onClick }))));
|
|
65
|
-
}
|
|
66
|
-
export default IconButton;
|
|
65
|
+
};
|
|
66
|
+
export default React.forwardRef(IconButton);
|
|
67
67
|
var templateObject_1;
|