xmirror-components 1.0.24 → 1.0.25
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
CHANGED
|
@@ -105,8 +105,7 @@ Valid keys: `+JSON.stringify(Object.keys(y),null," "));var v=re(M,F,O,q,$+"."+F
|
|
|
105
105
|
0 1 0 0 0
|
|
106
106
|
0 0 1 0 0
|
|
107
107
|
0 0 0 18 -6`}),J.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})})}exports.message=Ae.message;exports.notification=Ae.notification;exports.modal=Ae.Modal;function co({children:e}){const r=Ae.App.useApp();return exports.message=r.message,exports.modal=r.modal,exports.notification=r.notification,e||""}function fo({children:e,...r}){return J.jsxs(Ae.App,{...r,children:[J.jsx(jn,{}),J.jsx(co,{children:e})]})}const Nn=N.forwardRef(({type:e="",className:r="",symbol:n=!1,...t},a)=>n?J.jsx("svg",{className:`iconfont-symbol ${e} ${r}`,"aria-hidden":"true",ref:a,...t,children:J.jsx("use",{xlinkHref:`#${e}`})}):J.jsx("i",{className:`iconfont ${e} ${r}`,ref:a,...t})),lo=({checked:e,onChange:r,trueValue:n=!0,falseValue:t=!1,trueLabel:a="",falseLabel:o="",children:i,...s})=>{const f=e===n,u=d=>{r==null||r(d.target.checked?n:t,d)};return J.jsx(Ae.Checkbox,{checked:f,onChange:u,...s,children:i||(f?a:o)})},po=({checked:e,onChange:r,trueValue:n=!0,falseValue:t=!1,...a})=>{const o=e===n,i=(s,f)=>{r==null||r(s?n:t,f)};return J.jsx(Ae.Switch,{checked:o,onChange:i,...a})};var vo=typeof global=="object"&&global&&global.Object===Object&&global,mo=typeof self=="object"&&self&&self.Object===Object&&self,ho=vo||mo||Function("return this")(),gr=ho.Symbol,kn=Object.prototype,yo=kn.hasOwnProperty,go=kn.toString,Xe=gr?gr.toStringTag:void 0;function bo(e){var r=yo.call(e,Xe),n=e[Xe];try{e[Xe]=void 0;var t=!0}catch{}var a=go.call(e);return t&&(r?e[Xe]=n:delete e[Xe]),a}var Eo=Object.prototype,xo=Eo.toString;function To(e){return xo.call(e)}var So="[object Null]",wo="[object Undefined]",Bt=gr?gr.toStringTag:void 0;function Ro(e){return e==null?e===void 0?wo:So:Bt&&Bt in Object(e)?bo(e):To(e)}function Co(e){return e!=null&&typeof e=="object"}var Oo=Array.isArray;function _o(){}var Po="[object String]";function Ao(e){return typeof e=="string"||!Oo(e)&&Co(e)&&Ro(e)==Po}const jo=Ye(Ae.Button)`
|
|
108
|
-
|
|
109
|
-
font-size: 16px;
|
|
108
|
+
font-size: 18px;
|
|
110
109
|
color: var(--color-primary);
|
|
111
110
|
background-color: transparent;
|
|
112
111
|
border: none;
|
|
@@ -124,6 +123,6 @@ Valid keys: `+JSON.stringify(Object.keys(y),null," "));var v=re(M,F,O,q,$+"."+F
|
|
|
124
123
|
}
|
|
125
124
|
|
|
126
125
|
span {
|
|
127
|
-
font-size:
|
|
126
|
+
font-size: 18px;
|
|
128
127
|
}
|
|
129
128
|
`,No=({children:e,tooltipDisabled:r,disabled:n,disabledReason:t,title:a,...o})=>r?e:J.jsx(Ae.Tooltip,{title:n&&t||a,...o,children:e}),ko=e=>{const{icon:r,tooltipDisabled:n=!1,title:t,hide:a=!1,disabledReason:o,onClick:i=_o,disabled:s,size:f="small",style:u={},className:d,loading:p=!1,...b}=e,g=()=>Ao(r)?J.jsx(Nn,{type:r}):r;return r||console.warn("Icon props not found"),J.jsx(No,{tooltipDisabled:n,hide:a,disabled:s,disabledReason:o,title:t,...b,children:J.jsx(jo,{icon:g(),size:f,className:d,disabled:s,style:u,loading:p,onClick:i})})};var $o=function(e){return function(r,n){var t=N.useRef(!1);e(function(){return function(){t.current=!1}},[]),e(function(){if(!t.current)t.current=!0;else return r()},n)}},xe=function(){return xe=Object.assign||function(r){for(var n,t=1,a=arguments.length;t<a;t++){n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},xe.apply(this,arguments)};function $n(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 a=0,t=Object.getOwnPropertySymbols(e);a<t.length;a++)r.indexOf(t[a])<0&&Object.prototype.propertyIsEnumerable.call(e,t[a])&&(n[t[a]]=e[t[a]]);return n}function Mo(e,r,n,t){function a(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function s(d){try{u(t.next(d))}catch(p){i(p)}}function f(d){try{u(t.throw(d))}catch(p){i(p)}}function u(d){d.done?o(d.value):a(d.value).then(s,f)}u((t=t.apply(e,r||[])).next())})}function Io(e,r){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,a,o,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(d){return f([u,d])}}function f(u){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(n=0)),n;)try{if(t=1,a&&(o=u[0]&2?a.return:u[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,u[1])).done)return o;switch(a=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,a=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=r.call(e,n)}catch(d){u=[6,d],a=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function ue(e,r){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var t=n.call(e),a,o=[],i;try{for(;(r===void 0||r-- >0)&&!(a=t.next()).done;)o.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(n=t.return)&&n.call(t)}finally{if(i)throw i.error}}return o}function ce(e,r,n){if(n||arguments.length===2)for(var t=0,a=r.length,o;t<a;t++)(o||!(t in r))&&(o||(o=Array.prototype.slice.call(r,0,t)),o[t]=r[t]);return e.concat(o||Array.prototype.slice.call(r))}var Tr=function(e){return typeof e=="function"},Sr=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";function qe(e){Sr&&(Tr(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var r=N.useRef(e);r.current=N.useMemo(function(){return e},[e]);var n=N.useRef();return n.current||(n.current=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];return r.current.apply(this,t)}),n.current}const rt=$o(N.useEffect);var Mn=function(e,r){var n=r.manual,t=r.ready,a=t===void 0?!0:t,o=r.defaultParams,i=o===void 0?[]:o,s=r.refreshDeps,f=s===void 0?[]:s,u=r.refreshDepsAction,d=N.useRef(!1);return d.current=!1,rt(function(){!n&&a&&(d.current=!0,e.run.apply(e,ce([],ue(i),!1)))},[a]),rt(function(){d.current||n||(d.current=!0,u?u():e.refresh())},ce([],ue(f),!1)),{onBefore:function(){if(!a)return{stopNow:!0}}}};Mn.onInit=function(e){var r=e.ready,n=r===void 0?!0:r,t=e.manual;return{loading:!t&&n}};function Lo(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}function In(e,r){var n=N.useRef({deps:r,obj:void 0,initialized:!1}).current;return(n.initialized===!1||!Lo(n.deps,r))&&(n.deps=r,n.obj=e(),n.initialized=!0),n.obj}function Ln(e){var r=N.useRef(e);return r.current=e,r}var lt=function(e){Sr&&(Tr(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var r=Ln(e);N.useEffect(function(){return function(){r.current()}},[])},mr=new Map,qo=function(e,r,n){var t=mr.get(e);t!=null&&t.timer&&clearTimeout(t.timer);var a=void 0;r>-1&&(a=setTimeout(function(){mr.delete(e)},r)),mr.set(e,xe(xe({},n),{timer:a}))},Do=function(e){return mr.get(e)},hr=new Map,Fo=function(e){return hr.get(e)},Wo=function(e,r){hr.set(e,r),r.then(function(n){return hr.delete(e),n}).catch(function(){hr.delete(e)})},Me={},Yo=function(e,r){Me[e]&&Me[e].forEach(function(n){return n(r)})},$r=function(e,r){return Me[e]||(Me[e]=[]),Me[e].push(r),function(){var t=Me[e].indexOf(r);Me[e].splice(t,1)}},zo=function(e,r){var n=r.cacheKey,t=r.cacheTime,a=t===void 0?5*60*1e3:t,o=r.staleTime,i=o===void 0?0:o,s=r.setCache,f=r.getCache,u=N.useRef(),d=N.useRef(),p=function(g,m){s?s(m):qo(g,a,m),Yo(g,m.data)},b=function(g,m){return m===void 0&&(m=[]),f?f(m):Do(g)};return In(function(){if(n){var g=b(n);g&&Object.hasOwnProperty.call(g,"data")&&(e.state.data=g.data,e.state.params=g.params,(i===-1||new Date().getTime()-g.time<=i)&&(e.state.loading=!1)),u.current=$r(n,function(m){e.setState({data:m})})}},[]),lt(function(){var g;(g=u.current)===null||g===void 0||g.call(u)}),n?{onBefore:function(g){var m=b(n,g);return!m||!Object.hasOwnProperty.call(m,"data")?{}:i===-1||new Date().getTime()-m.time<=i?{loading:!1,data:m==null?void 0:m.data,error:void 0,returnNow:!0}:{data:m==null?void 0:m.data,error:void 0}},onRequest:function(g,m){var h=Fo(n);return h&&h!==d.current?{servicePromise:h}:(h=g.apply(void 0,ce([],ue(m),!1)),d.current=h,Wo(n,h),{servicePromise:h})},onSuccess:function(g,m){var h;n&&((h=u.current)===null||h===void 0||h.call(u),p(n,{data:g,params:m,time:new Date().getTime()}),u.current=$r(n,function(x){e.setState({data:x})}))},onMutate:function(g){var m;n&&((m=u.current)===null||m===void 0||m.call(u),p(n,{data:g,params:e.state.params,time:new Date().getTime()}),u.current=$r(n,function(h){e.setState({data:h})}))}}:{}},Mr,Vt;function dt(){if(Vt)return Mr;Vt=1;function e(r){var n=typeof r;return r!=null&&(n=="object"||n=="function")}return Mr=e,Mr}var Ir,Ht;function Uo(){if(Ht)return Ir;Ht=1;var e=typeof ir=="object"&&ir&&ir.Object===Object&&ir;return Ir=e,Ir}var Lr,Xt;function qn(){if(Xt)return Lr;Xt=1;var e=Uo(),r=typeof self=="object"&&self&&self.Object===Object&&self,n=e||r||Function("return this")();return Lr=n,Lr}var qr,Jt;function Go(){if(Jt)return qr;Jt=1;var e=qn(),r=function(){return e.Date.now()};return qr=r,qr}var Dr,Kt;function Bo(){if(Kt)return Dr;Kt=1;var e=/\s/;function r(n){for(var t=n.length;t--&&e.test(n.charAt(t)););return t}return Dr=r,Dr}var Fr,Zt;function Vo(){if(Zt)return Fr;Zt=1;var e=Bo(),r=/^\s+/;function n(t){return t&&t.slice(0,e(t)+1).replace(r,"")}return Fr=n,Fr}var Wr,Qt;function Dn(){if(Qt)return Wr;Qt=1;var e=qn(),r=e.Symbol;return Wr=r,Wr}var Yr,en;function Ho(){if(en)return Yr;en=1;var e=Dn(),r=Object.prototype,n=r.hasOwnProperty,t=r.toString,a=e?e.toStringTag:void 0;function o(i){var s=n.call(i,a),f=i[a];try{i[a]=void 0;var u=!0}catch{}var d=t.call(i);return u&&(s?i[a]=f:delete i[a]),d}return Yr=o,Yr}var zr,rn;function Xo(){if(rn)return zr;rn=1;var e=Object.prototype,r=e.toString;function n(t){return r.call(t)}return zr=n,zr}var Ur,tn;function Jo(){if(tn)return Ur;tn=1;var e=Dn(),r=Ho(),n=Xo(),t="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function i(s){return s==null?s===void 0?a:t:o&&o in Object(s)?r(s):n(s)}return Ur=i,Ur}var Gr,nn;function Ko(){if(nn)return Gr;nn=1;function e(r){return r!=null&&typeof r=="object"}return Gr=e,Gr}var Br,an;function Zo(){if(an)return Br;an=1;var e=Jo(),r=Ko(),n="[object Symbol]";function t(a){return typeof a=="symbol"||r(a)&&e(a)==n}return Br=t,Br}var Vr,on;function Qo(){if(on)return Vr;on=1;var e=Vo(),r=dt(),n=Zo(),t=NaN,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt;function f(u){if(typeof u=="number")return u;if(n(u))return t;if(r(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=r(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=e(u);var p=o.test(u);return p||i.test(u)?s(u.slice(2),p?2:8):a.test(u)?t:+u}return Vr=f,Vr}var Hr,sn;function Fn(){if(sn)return Hr;sn=1;var e=dt(),r=Go(),n=Qo(),t="Expected a function",a=Math.max,o=Math.min;function i(s,f,u){var d,p,b,g,m,h,x=0,w=!1,_=!1,T=!0;if(typeof s!="function")throw new TypeError(t);f=n(f)||0,e(u)&&(w=!!u.leading,_="maxWait"in u,b=_?a(n(u.maxWait)||0,f):b,T="trailing"in u?!!u.trailing:T);function S(X){var Q=d,de=p;return d=p=void 0,x=X,g=s.apply(de,Q),g}function l(X){return x=X,m=setTimeout(K,f),w?S(X):g}function A(X){var Q=X-h,de=X-x,ne=f-Q;return _?o(ne,b-de):ne}function P(X){var Q=X-h,de=X-x;return h===void 0||Q>=f||Q<0||_&&de>=b}function K(){var X=r();if(P(X))return me(X);m=setTimeout(K,A(X))}function me(X){return m=void 0,T&&d?S(X):(d=p=void 0,g)}function le(){m!==void 0&&clearTimeout(m),x=0,d=h=p=m=void 0}function te(){return m===void 0?g:me(r())}function he(){var X=r(),Q=P(X);if(d=arguments,p=this,h=X,Q){if(m===void 0)return l(h);if(_)return clearTimeout(m),m=setTimeout(K,f),S(h)}return m===void 0&&(m=setTimeout(K,f)),g}return he.cancel=le,he.flush=te,he}return Hr=i,Hr}var ei=Fn();const ri=tt(ei);var ti=function(e,r){var n=r.debounceWait,t=r.debounceLeading,a=r.debounceTrailing,o=r.debounceMaxWait,i=N.useRef(),s=N.useMemo(function(){var f={};return t!==void 0&&(f.leading=t),a!==void 0&&(f.trailing=a),o!==void 0&&(f.maxWait=o),f},[t,a,o]);return N.useEffect(function(){if(n){var f=e.runAsync.bind(e);return i.current=ri(function(u){u()},n,s),e.runAsync=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return new Promise(function(p,b){var g;(g=i.current)===null||g===void 0||g.call(i,function(){f.apply(void 0,ce([],ue(u),!1)).then(p).catch(b)})})},function(){var u;(u=i.current)===null||u===void 0||u.cancel(),e.runAsync=f}}},[n,s]),n?{onCancel:function(){var f;(f=i.current)===null||f===void 0||f.cancel()}}:{}},ni=function(e,r){var n=r.loadingDelay,t=r.ready,a=N.useRef();if(!n)return{};var o=function(){a.current&&clearTimeout(a.current)};return{onBefore:function(){return o(),t!==!1&&(a.current=setTimeout(function(){e.setState({loading:!0})},n)),{loading:!1}},onFinally:function(){o()},onCancel:function(){o()}}},wr=!!(typeof window<"u"&&window.document&&window.document.createElement);function pt(){return wr?document.visibilityState!=="hidden":!0}var Ke=[];function ai(e){return Ke.push(e),function(){var n=Ke.indexOf(e);Ke.splice(n,1)}}if(wr){var oi=function(){if(pt())for(var e=0;e<Ke.length;e++){var r=Ke[e];r()}};window.addEventListener("visibilitychange",oi,!1)}var ii=function(e,r){var n=r.pollingInterval,t=r.pollingWhenHidden,a=t===void 0?!0:t,o=r.pollingErrorRetryCount,i=o===void 0?-1:o,s=N.useRef(),f=N.useRef(),u=N.useRef(0),d=function(){var p;s.current&&clearTimeout(s.current),(p=f.current)===null||p===void 0||p.call(f)};return rt(function(){n||d()},[n]),n?{onBefore:function(){d()},onError:function(){u.current+=1},onSuccess:function(){u.current=0},onFinally:function(){i===-1||i!==-1&&u.current<=i?s.current=setTimeout(function(){!a&&!pt()?f.current=ai(function(){e.refresh()}):e.refresh()},n):u.current=0},onCancel:function(){d()}}:{}};function si(e,r){var n=!1;return function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];n||(n=!0,e.apply(void 0,ce([],ue(t),!1)),setTimeout(function(){n=!1},r))}}function ui(){return wr&&typeof navigator.onLine<"u"?navigator.onLine:!0}var Ze=[];function ci(e){return Ze.push(e),function(){var n=Ze.indexOf(e);n>-1&&Ze.splice(n,1)}}if(wr){var un=function(){if(!(!pt()||!ui()))for(var e=0;e<Ze.length;e++){var r=Ze[e];r()}};window.addEventListener("visibilitychange",un,!1),window.addEventListener("focus",un,!1)}var fi=function(e,r){var n=r.refreshOnWindowFocus,t=r.focusTimespan,a=t===void 0?5e3:t,o=N.useRef(),i=function(){var s;(s=o.current)===null||s===void 0||s.call(o)};return N.useEffect(function(){if(n){var s=si(e.refresh.bind(e),a);o.current=ci(function(){s()})}return function(){i()}},[n,a]),lt(function(){i()}),{}},li=function(e,r){var n=r.retryInterval,t=r.retryCount,a=N.useRef(),o=N.useRef(0),i=N.useRef(!1);return t?{onBefore:function(){i.current||(o.current=0),i.current=!1,a.current&&clearTimeout(a.current)},onSuccess:function(){o.current=0},onError:function(){if(o.current+=1,t===-1||o.current<=t){var s=n??Math.min(1e3*Math.pow(2,o.current),3e4);a.current=setTimeout(function(){i.current=!0,e.refresh()},s)}else o.current=0},onCancel:function(){o.current=0,a.current&&clearTimeout(a.current)}}:{}},Xr,cn;function di(){if(cn)return Xr;cn=1;var e=Fn(),r=dt(),n="Expected a function";function t(a,o,i){var s=!0,f=!0;if(typeof a!="function")throw new TypeError(n);return r(i)&&(s="leading"in i?!!i.leading:s,f="trailing"in i?!!i.trailing:f),e(a,o,{leading:s,maxWait:o,trailing:f})}return Xr=t,Xr}var pi=di();const vi=tt(pi);var mi=function(e,r){var n=r.throttleWait,t=r.throttleLeading,a=r.throttleTrailing,o=N.useRef(),i={};return t!==void 0&&(i.leading=t),a!==void 0&&(i.trailing=a),N.useEffect(function(){if(n){var s=e.runAsync.bind(e);return o.current=vi(function(f){f()},n,i),e.runAsync=function(){for(var f=[],u=0;u<arguments.length;u++)f[u]=arguments[u];return new Promise(function(d,p){var b;(b=o.current)===null||b===void 0||b.call(o,function(){s.apply(void 0,ce([],ue(f),!1)).then(d).catch(p)})})},function(){var f;e.runAsync=s,(f=o.current)===null||f===void 0||f.cancel()}}},[n,t,a]),n?{onCancel:function(){var s;(s=o.current)===null||s===void 0||s.cancel()}}:{}},hi=function(e){Sr&&(Tr(e)||console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof e,'".'))),N.useEffect(function(){e==null||e()},[])},yi=function(){var e=ue(N.useState({}),2),r=e[1];return N.useCallback(function(){return r({})},[])},gi=function(){function e(r,n,t,a){a===void 0&&(a={}),this.serviceRef=r,this.options=n,this.subscribe=t,this.initState=a,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=xe(xe(xe({},this.state),{loading:!n.manual}),a)}return e.prototype.setState=function(r){r===void 0&&(r={}),this.state=xe(xe({},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 a=this.pluginImpls.map(function(o){var i;return(i=o[r])===null||i===void 0?void 0:i.call.apply(i,ce([o],ue(n),!1))}).filter(Boolean);return Object.assign.apply(Object,ce([{}],ue(a),!1))},e.prototype.runAsync=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return Mo(this,void 0,void 0,function(){var t,a,o,i,s,f,u,d,p,b,g,m,h,x,w,_,T,S,l,A,P;return Io(this,function(K){switch(K.label){case 0:if(this.count+=1,t=this.count,a=this.runPluginHandler("onBefore",r),o=a.stopNow,i=o===void 0?!1:o,s=a.returnNow,f=s===void 0?!1:s,u=$n(a,["stopNow","returnNow"]),i)return[2,new Promise(function(){})];if(this.setState(xe({loading:!0,params:r},u)),f)return[2,Promise.resolve(u.data)];(h=(m=this.options).onBefore)===null||h===void 0||h.call(m,r),K.label=1;case 1:return K.trys.push([1,3,,4]),d=this.runPluginHandler("onRequest",this.serviceRef.current,r).servicePromise,d||(d=(g=this.serviceRef).current.apply(g,ce([],ue(r),!1))),[4,d];case 2:return p=K.sent(),t!==this.count?[2,new Promise(function(){})]:(this.setState({data:p,error:void 0,loading:!1}),(w=(x=this.options).onSuccess)===null||w===void 0||w.call(x,p,r),this.runPluginHandler("onSuccess",p,r),(T=(_=this.options).onFinally)===null||T===void 0||T.call(_,r,p,void 0),t===this.count&&this.runPluginHandler("onFinally",r,p,void 0),[2,p]);case 3:if(b=K.sent(),t!==this.count)return[2,new Promise(function(){})];throw this.setState({error:b,loading:!1}),(l=(S=this.options).onError)===null||l===void 0||l.call(S,b,r),this.runPluginHandler("onError",b,r),(P=(A=this.options).onFinally)===null||P===void 0||P.call(A,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,ce([],ue(n),!1)).catch(function(a){r.options.onError||console.error(a)})},e.prototype.cancel=function(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")},e.prototype.refresh=function(){this.run.apply(this,ce([],ue(this.state.params||[]),!1))},e.prototype.refreshAsync=function(){return this.runAsync.apply(this,ce([],ue(this.state.params||[]),!1))},e.prototype.mutate=function(r){var n=Tr(r)?r(this.state.data):r;this.runPluginHandler("onMutate",n),this.setState({data:n})},e}();function bi(e,r,n){r===void 0&&(r={}),n===void 0&&(n=[]);var t=r.manual,a=t===void 0?!1:t,o=r.ready,i=o===void 0?!0:o,s=$n(r,["manual","ready"]);Sr&&r.defaultParams&&!Array.isArray(r.defaultParams)&&console.warn("expected defaultParams is array, got ".concat(typeof r.defaultParams));var f=xe({manual:a,ready:i},s),u=Ln(e),d=yi(),p=In(function(){var b=n.map(function(g){var m;return(m=g==null?void 0:g.onInit)===null||m===void 0?void 0:m.call(g,f)}).filter(Boolean);return new gi(u,f,d,Object.assign.apply(Object,ce([{}],ue(b),!1)))},[]);return p.options=f,p.pluginImpls=n.map(function(b){return b(p,f)}),hi(function(){if(!a&&i){var b=p.state.params||r.defaultParams||[];p.run.apply(p,ce([],ue(b),!1))}}),lt(function(){p.cancel()}),{loading:p.state.loading,data:p.state.data,error:p.state.error,params:p.state.params||[],cancel:qe(p.cancel.bind(p)),refresh:qe(p.refresh.bind(p)),refreshAsync:qe(p.refreshAsync.bind(p)),run:qe(p.run.bind(p)),runAsync:qe(p.runAsync.bind(p)),mutate:qe(p.mutate.bind(p))}}function Ei(e,r,n){return bi(e,r,ce(ce([],ue(n||[]),!1),[ti,ni,ii,fi,mi,Mn,zo,li],!1))}function xi(e,r,n){const t=Ei(e,{...r,onError(o,i){var s;((r==null?void 0:r.errorMessage)??!0)&&exports.message.error(o.message),(s=r==null?void 0:r.onError)==null||s.call(r,o,i)}},n),a=t.data&&typeof t.data=="object"&&"data"in t.data?t.data.data:t.data;return{...t,data:a}}exports.App=fo;exports.CheckboxValue=lo;exports.GlobalLoading=jn;exports.IconButton=ko;exports.IconFont=Nn;exports.SwitchValue=po;exports.useRequest=xi;
|
package/build/dist/index.mjs
CHANGED
|
@@ -3265,8 +3265,7 @@ function Uo(e) {
|
|
|
3265
3265
|
return typeof e == "string" || !Wo(e) && Fo(e) && qo(e) == zo;
|
|
3266
3266
|
}
|
|
3267
3267
|
const Go = ze(Qn)`
|
|
3268
|
-
|
|
3269
|
-
font-size: 16px;
|
|
3268
|
+
font-size: 18px;
|
|
3270
3269
|
color: var(--color-primary);
|
|
3271
3270
|
background-color: transparent;
|
|
3272
3271
|
border: none;
|
|
@@ -3284,7 +3283,7 @@ const Go = ze(Qn)`
|
|
|
3284
3283
|
}
|
|
3285
3284
|
|
|
3286
3285
|
span {
|
|
3287
|
-
font-size:
|
|
3286
|
+
font-size: 18px;
|
|
3288
3287
|
}
|
|
3289
3288
|
`, Bo = ({
|
|
3290
3289
|
children: e,
|
|
@@ -29,7 +29,7 @@ import { Tooltip, Button } from 'antd';
|
|
|
29
29
|
import { noop, isString } from 'lodash-es';
|
|
30
30
|
import IconFont from '../IconFont';
|
|
31
31
|
import styled from '@emotion/styled';
|
|
32
|
-
var StyledButton = styled(Button)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
32
|
+
var StyledButton = styled(Button)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 18px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 18px;\n }\n"], ["\n font-size: 18px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 18px;\n }\n"])));
|
|
33
33
|
var ButtonTooltip = function (_a) {
|
|
34
34
|
var children = _a.children, tooltipDisabled = _a.tooltipDisabled, disabled = _a.disabled, disabledReason = _a.disabledReason, title = _a.title, attrs = __rest(_a, ["children", "tooltipDisabled", "disabled", "disabledReason", "title"]);
|
|
35
35
|
if (tooltipDisabled) {
|
|
@@ -35,7 +35,7 @@ var antd_1 = require("antd");
|
|
|
35
35
|
var lodash_es_1 = require("lodash-es");
|
|
36
36
|
var IconFont_1 = __importDefault(require("../IconFont"));
|
|
37
37
|
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
38
|
-
var StyledButton = (0, styled_1.default)(antd_1.Button)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
38
|
+
var StyledButton = (0, styled_1.default)(antd_1.Button)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 18px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 18px;\n }\n"], ["\n font-size: 18px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 18px;\n }\n"])));
|
|
39
39
|
var ButtonTooltip = function (_a) {
|
|
40
40
|
var children = _a.children, tooltipDisabled = _a.tooltipDisabled, disabled = _a.disabled, disabledReason = _a.disabledReason, title = _a.title, attrs = __rest(_a, ["children", "tooltipDisabled", "disabled", "disabledReason", "title"]);
|
|
41
41
|
if (tooltipDisabled) {
|
package/build/package.json
CHANGED