xmirror-components 1.0.4 → 1.0.6
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 +490 -1359
- package/build/dist/xmirror-components.umd.cjs +12 -12
- package/build/es/AntdApp/index.d.ts +12 -0
- package/build/es/AntdApp/index.js +14 -0
- package/build/es/CheckboxValue/index.d.ts +40 -0
- package/build/es/CheckboxValue/index.js +33 -0
- package/build/es/IconButton/index.d.ts +42 -0
- package/build/es/IconButton/index.js +51 -0
- package/build/es/IconFont/index.d.ts +21 -0
- package/build/es/IconFont/index.js +32 -0
- package/build/es/SwitchValue/index.d.ts +30 -0
- package/build/es/SwitchValue/index.js +36 -0
- package/build/es/components/IconFont/index.d.ts +1 -1
- package/build/es/components/index.d.ts +1 -4
- package/build/es/components/index.js +1 -4
- package/build/es/index.d.ts +2 -0
- package/build/es/index.js +2 -0
- package/build/lib/AntdApp/index.js +19 -0
- package/build/lib/CheckboxValue/index.js +38 -0
- package/build/lib/IconButton/index.js +91 -0
- package/build/lib/IconFont/index.js +67 -0
- package/build/lib/SwitchValue/index.js +41 -0
- package/build/lib/components/index.js +3 -9
- package/build/lib/index.js +13 -0
- package/build/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(m,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("antd"),require("react")):typeof define=="function"&&define.amd?define(["exports","antd","react"],T):(m=typeof globalThis<"u"?globalThis:m||self,T(m.XMirrorComponents={},m.antd,m.React))})(this,function(m,T,p){"use strict";m.message=T.message,m.notification=T.notification,m.modal=T.Modal;function Pe({children:r}){const c=T.App.useApp();return m.message=c.message,m.modal=c.modal,m.notification=c.notification,r}function Me(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var L={exports:{}},N={};/**
|
|
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 te;function Ye(){if(te)return N;te=1;var r=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function t(s,u,a){var i=null;if(a!==void 0&&(i=""+a),u.key!==void 0&&(i=""+u.key),"key"in u){a={};for(var v in u)v!=="key"&&(a[v]=u[v])}else a=u;return u=a.ref,{$$typeof:r,type:s,key:i,ref:u!==void 0?u:null,props:a}}return N.Fragment=c,N.jsx=t,N.jsxs=t,N}var k={};/**
|
|
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 ne;function We(){return ne||(ne=1,process.env.NODE_ENV!=="production"&&function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_r?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case J:return"Fragment";case pr:return"Portal";case Ee:return"Profiler";case be:return"StrictMode";case Z:return"Suspense";case Q:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case pe:return(e.displayName||"Context")+".Provider";case me:return(e._context.displayName||"Context")+".Consumer";case X:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return n=e.displayName||null,n!==null?n:r(e.type)||"Memo";case q:n=e._payload,e=e._init;try{return r(e(n))}catch{}}return null}function c(e){return""+e}function t(e){try{c(e);var n=!1}catch{n=!0}if(n){n=console;var o=n.error,l=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",l),c(e)}}function s(){}function u(){if(W===0){Te=console.log,he=console.info,je=console.warn,we=console.error,Se=console.group,Re=console.groupCollapsed,Oe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:s,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}function a(){if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:x({},e,{value:Te}),info:x({},e,{value:he}),warn:x({},e,{value:je}),error:x({},e,{value:we}),group:x({},e,{value:Se}),groupCollapsed:x({},e,{value:Re}),groupEnd:x({},e,{value:Oe})})}0>W&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function i(e){if($===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);$=n&&n[1]||"",xe=-1<o.stack.indexOf(`
|
|
18
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
+
`+$+e+xe}function v(e,n){if(!e||ee)return"";var o=re.get(e);if(o!==void 0)return o;ee=!0,o=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var l=null;l=O.H,O.H=null,u();try{var E={DetermineComponentFrameRoot:function(){try{if(n){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(w){var V=w}Reflect.construct(e,[],R)}else{try{R.call()}catch(w){V=w}e.call(R.prototype)}}else{try{throw Error()}catch(w){V=w}(R=e())&&typeof R.catch=="function"&&R.catch(function(){})}}catch(w){if(w&&V&&typeof w.stack=="string")return[w.stack,V.stack]}return[null,null]}};E.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(E.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(E.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=E.DetermineComponentFrameRoot(),j=f[0],C=f[1];if(j&&C){var y=j.split(`
|
|
20
|
+
`),A=C.split(`
|
|
21
|
+
`);for(f=g=0;g<y.length&&!y[g].includes("DetermineComponentFrameRoot");)g++;for(;f<A.length&&!A[f].includes("DetermineComponentFrameRoot");)f++;if(g===y.length||f===A.length)for(g=y.length-1,f=A.length-1;1<=g&&0<=f&&y[g]!==A[f];)f--;for(;1<=g&&0<=f;g--,f--)if(y[g]!==A[f]){if(g!==1||f!==1)do if(g--,f--,0>f||y[g]!==A[f]){var U=`
|
|
22
|
+
`+y[g].replace(" at new "," at ");return e.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",e.displayName)),typeof e=="function"&&re.set(e,U),U}while(1<=g&&0<=f);break}}}finally{ee=!1,O.H=l,a(),Error.prepareStackTrace=o}return y=(y=e?e.displayName||e.name:"")?i(y):"",typeof e=="function"&&re.set(e,y),y}function b(e){if(e==null)return"";if(typeof e=="function"){var n=e.prototype;return v(e,!(!n||!n.isReactComponent))}if(typeof e=="string")return i(e);switch(e){case Z:return i("Suspense");case Q:return i("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case X:return e=v(e.render,!1),e;case K:return b(e.type);case q:n=e._payload,e=e._init;try{return b(e(n))}catch{}}return""}function d(){var e=O.A;return e===null?null:e.getOwner()}function h(e){if(_e.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function _(e,n){function o(){Ae||(Ae=!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)",n))}o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}function M(){var e=r(this.type);return Ce[e]||(Ce[e]=!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.")),e=this.props.ref,e!==void 0?e:null}function G(e,n,o,l,E,g){return o=g.ref,e={$$typeof:I,type:e,key:n,props:g,_owner:E},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:M}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function Y(e,n,o,l,E,g){if(typeof e=="string"||typeof e=="function"||e===J||e===Ee||e===be||e===Z||e===Q||e===yr||typeof e=="object"&&e!==null&&(e.$$typeof===q||e.$$typeof===K||e.$$typeof===pe||e.$$typeof===me||e.$$typeof===X||e.$$typeof===Tr||e.getModuleId!==void 0)){var f=n.children;if(f!==void 0)if(l)if(D(f)){for(l=0;l<f.length;l++)de(f[l],e);Object.freeze&&Object.freeze(f)}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 de(f,e)}else f="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?l="null":D(e)?l="array":e!==void 0&&e.$$typeof===I?(l="<"+(r(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,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",l,f);if(_e.call(n,"key")){f=r(e);var j=Object.keys(n).filter(function(y){return y!=="key"});l=0<j.length?"{key: someKey, "+j.join(": ..., ")+": ...}":"{key: someKey}",Ne[f+l]||(j=0<j.length?"{"+j.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} />`,l,f,j,f),Ne[f+l]=!0)}if(f=null,o!==void 0&&(t(o),f=""+o),h(n)&&(t(n.key),f=""+n.key),"key"in n){o={};for(var C in n)C!=="key"&&(o[C]=n[C])}else o=n;return f&&_(o,typeof e=="function"?e.displayName||e.name||"Unknown":e),G(e,f,g,E,d(),o)}function de(e,n){if(typeof e=="object"&&e&&e.$$typeof!==hr){if(D(e))for(var o=0;o<e.length;o++){var l=e[o];H(l)&&ge(l,n)}else if(H(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?o=null:(o=ye&&e[ye]||e["@@iterator"],o=typeof o=="function"?o:null),typeof o=="function"&&o!==e.entries&&(o=o.call(e),o!==e))for(;!(e=o.next()).done;)H(e.value)&&ge(e.value,n)}}function H(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}function ge(e,n){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,n=Er(n),!ke[n])){ke[n]=!0;var o="";e&&e._owner!=null&&e._owner!==d()&&(o=null,typeof e._owner.tag=="number"?o=r(e._owner.type):typeof e._owner.name=="string"&&(o=e._owner.name),o=" It was passed a child from "+o+".");var l=O.getCurrentStack;O.getCurrentStack=function(){var E=b(e.type);return l&&(E+=l()||""),E},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.',n,o),O.getCurrentStack=l}}function Er(e){var n="",o=d();return o&&(o=r(o.type))&&(n=`
|
|
28
28
|
|
|
29
|
-
Check the render method of \``+
|
|
29
|
+
Check the render method of \``+o+"`."),n||(e=r(e))&&(n=`
|
|
30
30
|
|
|
31
|
-
Check the top-level render call using <`+
|
|
31
|
+
Check the top-level render call using <`+e+">."),n}var mr=p,I=Symbol.for("react.transitional.element"),pr=Symbol.for("react.portal"),J=Symbol.for("react.fragment"),be=Symbol.for("react.strict_mode"),Ee=Symbol.for("react.profiler"),me=Symbol.for("react.consumer"),pe=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),yr=Symbol.for("react.offscreen"),ye=Symbol.iterator,_r=Symbol.for("react.client.reference"),O=mr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=Object.prototype.hasOwnProperty,x=Object.assign,Tr=Symbol.for("react.client.reference"),D=Array.isArray,W=0,Te,he,je,we,Se,Re,Oe;s.__reactDisabledLog=!0;var $,xe,ee=!1,re=new(typeof WeakMap=="function"?WeakMap:Map),hr=Symbol.for("react.client.reference"),Ae,Ce={},Ne={},ke={};k.Fragment=J,k.jsx=function(e,n,o,l,E){return Y(e,n,o,!1,l,E)},k.jsxs=function(e,n,o,l,E){return Y(e,n,o,!0,l,E)}}()),k}var oe;function Ue(){return oe||(oe=1,process.env.NODE_ENV==="production"?L.exports=Ye():L.exports=We()),L.exports}var S=Ue(),Le=typeof global=="object"&&global&&global.Object===Object&&global,Fe=typeof self=="object"&&self&&self.Object===Object&&self,Ve=Le||Fe||Function("return this")(),F=Ve.Symbol,ae=Object.prototype,Be=ae.hasOwnProperty,ze=ae.toString,P=F?F.toStringTag:void 0;function Ge(r){var c=Be.call(r,P),t=r[P];try{r[P]=void 0;var s=!0}catch{}var u=ze.call(r);return s&&(c?r[P]=t:delete r[P]),u}var He=Object.prototype,Ie=He.toString;function Je(r){return Ie.call(r)}var Xe="[object Null]",Ze="[object Undefined]",ue=F?F.toStringTag:void 0;function Qe(r){return r==null?r===void 0?Ze:Xe:ue&&ue in Object(r)?Ge(r):Je(r)}function Ke(r){return r!=null&&typeof r=="object"}var qe=Array.isArray;function De(){}var $e="[object String]";function er(r){return typeof r=="string"||!qe(r)&&Ke(r)&&Qe(r)==$e}var B={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 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"})});
|
|
35
|
+
*/var ie;function rr(){return ie||(ie=1,function(r){(function(){var c={}.hasOwnProperty;function t(){for(var a="",i=0;i<arguments.length;i++){var v=arguments[i];v&&(a=u(a,s(v)))}return a}function s(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return t.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var i="";for(var v in a)c.call(a,v)&&a[v]&&(i=u(i,v));return i}function u(a,i){return i?a?a+" "+i:a+i:a}r.exports?(t.default=t,r.exports=t):window.classNames=t})()}(B)),B.exports}var tr=rr();const nr=Me(tr);function z(r,c){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var s=t.call(r),u,a=[],i;try{for(;(c===void 0||c-- >0)&&!(u=s.next()).done;)a.push(u.value)}catch(v){i={error:v}}finally{try{u&&!u.done&&(t=s.return)&&t.call(s)}finally{if(i)throw i.error}}return a}typeof SuppressedError=="function"&&SuppressedError;var se=function(r){return typeof r=="function"},or=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";function ce(r,c){if(r===c)return!0;for(var t=0;t<r.length;t++)if(!Object.is(r[t],c[t]))return!1;return!0}function fe(r){var c=p.useRef(r);return c.current=r,c}var ar=function(r){or&&(se(r)||console.error("useUnmount expected parameter is a function, got ".concat(typeof r)));var c=fe(r);p.useEffect(function(){return function(){c.current()}},[])},ur=!!(typeof window<"u"&&window.document&&window.document.createElement);function ir(r,c){var t=z(p.useState(r),2),s=t[0],u=t[1],a=p.useMemo(function(){var i=!0,v=function(){return u(function(_){return _===r?i:r})},b=function(_){return u(_)},d=function(){return u(r)},h=function(){return u(i)};return{toggle:v,set:b,setLeft:d,setRight:h}},[]);return[s,a]}function sr(r){var c=z(ir(!1),2),t=c[0],s=c[1],u=s.toggle,a=s.set,i=p.useMemo(function(){var v=function(){return a(!0)},b=function(){return a(!1)};return{toggle:u,set:function(d){return a(!!d)},setTrue:v,setFalse:b}},[]);return[t,i]}function le(r,c){if(ur){if(!r)return c;var t;return se(r)?t=r():"current"in r?t=r.current:t=r,t}}var cr=function(r){var c=function(t,s,u){var a=p.useRef(!1),i=p.useRef([]),v=p.useRef([]),b=p.useRef();r(function(){var d,h=Array.isArray(u)?u:[u],_=h.map(function(M){return le(M)});if(!a.current){a.current=!0,i.current=_,v.current=s,b.current=t();return}(_.length!==i.current.length||!ce(i.current,_)||!ce(v.current,s))&&((d=b.current)===null||d===void 0||d.call(b),i.current=_,v.current=s,b.current=t())}),ar(function(){var d;(d=b.current)===null||d===void 0||d.call(b),a.current=!1})};return c},fr=cr(p.useEffect);function ve(r,c,t){t===void 0&&(t={});var s=t.enable,u=s===void 0?!0:s,a=fe(c);fr(function(){if(u){var i=le(t.target,window);if(i!=null&&i.addEventListener){var v=function(d){return a.current(d)},b=Array.isArray(r)?r:[r];return b.forEach(function(d){i.addEventListener(d,v,{capture:t.capture,once:t.once,passive:t.passive})}),function(){b.forEach(function(d){i.removeEventListener(d,v,{capture:t.capture})})}}}},[r,t.capture,t.once,t.passive,u],t.target)}const lr=function(r,c){var t={},s=t.onEnter,u=t.onLeave,a=t.onChange,i=z(sr(),2),v=i[0],b=i[1],d=b.setTrue,h=b.setFalse;return ve("mouseenter",function(){s==null||s(),d(),a==null||a(!0)},{target:r}),ve("mouseleave",function(){u==null||u(),h(),a==null||a(!1)},{target:r}),v},vr=p.forwardRef(({type:r="",className:c="",symbol:t=!1,...s},u)=>t?S.jsx("svg",{className:`iconfont-symbol ${r} ${c}`,"aria-hidden":"true",ref:u,...s,children:S.jsx("use",{xlinkHref:`#${r}`})}):S.jsx("i",{className:`iconfont ${r} ${c}`,ref:u,...s})),dr={btn_icon__warp:"_btn_icon__warp_ay6he_1"},gr=(r,c)=>{const t=p.useRef(null),{icon:s,tooltipDisabled:u=!1,onClick:a=De,disabled:i,size:v="middle",style:b={},className:d,loading:h=!1,..._}=r,M=lr(t),G=()=>er(s)&&s.includes("icon-")?S.jsx(vr,{type:s}):s,Y=S.jsx(T.Button,{onClick:a,size:v,disabled:i,style:b,ref:c,loading:h,className:nr([d,dr.btn_icon__warp]),icon:G()});if(!s)throw new Error("IconButton 组件必须传入 icon 属性");return S.jsxs(p.Fragment,{children:[u&&Y,!u&&S.jsx(T.Tooltip,{open:M,trigger:"contextMenu",destroyTooltipOnHide:!0,..._,children:S.jsx("span",{ref:t,style:{display:"inline-block"},className:"icon-button-box",children:Y})})]})},br=p.forwardRef(gr);m.App=Pe,m.IconButton=br,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type MessageInstance } from 'antd/es/message/interface';
|
|
3
|
+
import { type NotificationInstance } from 'antd/es/notification/interface';
|
|
4
|
+
import { type ModalStaticFunctions } from 'antd/es/modal/confirm';
|
|
5
|
+
declare let message: MessageInstance;
|
|
6
|
+
declare let notification: NotificationInstance;
|
|
7
|
+
declare let modal: Omit<ModalStaticFunctions, 'warn'>;
|
|
8
|
+
declare function Index({ children }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): ReactNode;
|
|
11
|
+
export { message, notification, modal };
|
|
12
|
+
export default Index;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { App, message as AntdMessage, notification as AntdNotification, Modal as AntdModal, } from 'antd';
|
|
2
|
+
var message = AntdMessage;
|
|
3
|
+
var notification = AntdNotification;
|
|
4
|
+
var modal = AntdModal;
|
|
5
|
+
function Index(_a) {
|
|
6
|
+
var children = _a.children;
|
|
7
|
+
var staticFunction = App.useApp();
|
|
8
|
+
message = staticFunction.message;
|
|
9
|
+
modal = staticFunction.modal;
|
|
10
|
+
notification = staticFunction.notification;
|
|
11
|
+
return children;
|
|
12
|
+
}
|
|
13
|
+
export { message, notification, modal };
|
|
14
|
+
export default Index;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Checkbox } from 'antd';
|
|
3
|
+
import { type CheckboxChangeEvent } from 'antd/es/checkbox';
|
|
4
|
+
/**
|
|
5
|
+
* checkbox 可自定义 value 和 label
|
|
6
|
+
* 使用场景:
|
|
7
|
+
* 1. 需要自定义 value 和 label
|
|
8
|
+
*/
|
|
9
|
+
interface CheckboxValueProps<T = any, F = any> extends Omit<React.ComponentProps<typeof Checkbox>, 'checked' | 'onChange'> {
|
|
10
|
+
/**
|
|
11
|
+
* 选中值
|
|
12
|
+
*/
|
|
13
|
+
trueValue?: T;
|
|
14
|
+
/**
|
|
15
|
+
* 未选中值
|
|
16
|
+
*/
|
|
17
|
+
falseValue?: F;
|
|
18
|
+
/**
|
|
19
|
+
* 选中值
|
|
20
|
+
*/
|
|
21
|
+
checked?: T | F;
|
|
22
|
+
/**
|
|
23
|
+
* 选中事件
|
|
24
|
+
*/
|
|
25
|
+
onChange?: (value: T | F, event: CheckboxChangeEvent) => void;
|
|
26
|
+
/**
|
|
27
|
+
* 选中标签
|
|
28
|
+
*/
|
|
29
|
+
trueLabel?: string;
|
|
30
|
+
/**
|
|
31
|
+
* 未选中标签
|
|
32
|
+
*/
|
|
33
|
+
falseLabel?: string;
|
|
34
|
+
/**
|
|
35
|
+
* 子元素
|
|
36
|
+
*/
|
|
37
|
+
children?: React.ReactNode;
|
|
38
|
+
}
|
|
39
|
+
declare const CheckboxValue: <T = any, F = any>({ checked, onChange, trueValue, falseValue, trueLabel, falseLabel, children, ...props }: CheckboxValueProps<T, F>) => React.JSX.Element;
|
|
40
|
+
export default CheckboxValue;
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { Checkbox } from 'antd';
|
|
25
|
+
var CheckboxValue = function (_a) {
|
|
26
|
+
var checked = _a.checked, onChange = _a.onChange, _b = _a.trueValue, trueValue = _b === void 0 ? true : _b, _c = _a.falseValue, falseValue = _c === void 0 ? false : _c, _d = _a.trueLabel, trueLabel = _d === void 0 ? '' : _d, _e = _a.falseLabel, falseLabel = _e === void 0 ? '' : _e, children = _a.children, props = __rest(_a, ["checked", "onChange", "trueValue", "falseValue", "trueLabel", "falseLabel", "children"]);
|
|
27
|
+
var _checked = checked === trueValue;
|
|
28
|
+
var change = function (e) {
|
|
29
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked ? trueValue : falseValue, e);
|
|
30
|
+
};
|
|
31
|
+
return (React.createElement(Checkbox, __assign({ checked: _checked, onChange: change }, props), children || (_checked ? trueLabel : falseLabel)));
|
|
32
|
+
};
|
|
33
|
+
export default CheckboxValue;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { type ForwardedRef } from 'react';
|
|
2
|
+
interface IconButtonProps {
|
|
3
|
+
/**
|
|
4
|
+
* 图标
|
|
5
|
+
*/
|
|
6
|
+
icon?: React.ReactNode | string;
|
|
7
|
+
/**
|
|
8
|
+
* 是否禁用 tooltip
|
|
9
|
+
*/
|
|
10
|
+
tooltipDisabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 点击事件
|
|
13
|
+
*/
|
|
14
|
+
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
15
|
+
/**
|
|
16
|
+
* 是否禁用
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 大小
|
|
21
|
+
*/
|
|
22
|
+
size?: 'small' | 'middle' | 'large';
|
|
23
|
+
/**
|
|
24
|
+
* 样式
|
|
25
|
+
*/
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
/**
|
|
28
|
+
* 类名
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* 是否加载中
|
|
33
|
+
*/
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 其他属性
|
|
37
|
+
*/
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}
|
|
40
|
+
export declare const Icon: (props: IconButtonProps, buttonRef: ForwardedRef<any>) => React.JSX.Element;
|
|
41
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<any>>;
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React, { Fragment, useRef } from 'react';
|
|
24
|
+
import { Tooltip, Button } from 'antd';
|
|
25
|
+
import { noop, isString } from 'lodash-es';
|
|
26
|
+
import classNames from 'classnames';
|
|
27
|
+
import { useHover } from 'ahooks';
|
|
28
|
+
import IconFont from '@/components/IconFont';
|
|
29
|
+
import styles from './index.module.less';
|
|
30
|
+
export var Icon = function (props, buttonRef) {
|
|
31
|
+
var ref = useRef(null);
|
|
32
|
+
var Icon = props.icon, _a = props.tooltipDisabled, tooltipDisabled = _a === void 0 ? false : _a, _b = props.onClick, onClick = _b === void 0 ? noop : _b, disabled = props.disabled, _c = props.size, size = _c === void 0 ? 'middle' : _c, _d = props.style, style = _d === void 0 ? {} : _d, className = props.className, _e = props.loading, loading = _e === void 0 ? false : _e, attrs = __rest(props, ["icon", "tooltipDisabled", "onClick", "disabled", "size", "style", "className", "loading"]);
|
|
33
|
+
var visible = useHover(ref);
|
|
34
|
+
var createIcon = function () {
|
|
35
|
+
if (isString(Icon) && Icon.includes('icon-')) {
|
|
36
|
+
return React.createElement(IconFont, { type: Icon });
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return Icon;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var children = (React.createElement(Button, { onClick: onClick, size: size, disabled: disabled, style: style, ref: buttonRef, loading: loading, className: classNames([className, styles.btn_icon__warp]), icon: createIcon() }));
|
|
43
|
+
if (!Icon) {
|
|
44
|
+
throw new Error('IconButton 组件必须传入 icon 属性');
|
|
45
|
+
}
|
|
46
|
+
return (React.createElement(Fragment, null,
|
|
47
|
+
tooltipDisabled && children,
|
|
48
|
+
!tooltipDisabled && (React.createElement(Tooltip, __assign({ open: visible, trigger: 'contextMenu', destroyTooltipOnHide: true }, attrs),
|
|
49
|
+
React.createElement("span", { ref: ref, style: { display: 'inline-block' }, className: "icon-button-box" }, children)))));
|
|
50
|
+
};
|
|
51
|
+
export default React.forwardRef(Icon);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IconFontCommonProps {
|
|
3
|
+
/**
|
|
4
|
+
* 图标类型
|
|
5
|
+
*/
|
|
6
|
+
type: string;
|
|
7
|
+
/**
|
|
8
|
+
* 类名
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 是否使用 symbol 模式
|
|
13
|
+
*/
|
|
14
|
+
symbol?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const IconFont: React.ForwardRefExoticComponent<((IconFontCommonProps & React.HTMLAttributes<HTMLElement> & {
|
|
17
|
+
symbol?: false;
|
|
18
|
+
}) | Omit<IconFontCommonProps & React.SVGProps<SVGSVGElement> & {
|
|
19
|
+
symbol: true;
|
|
20
|
+
}, "ref">) & React.RefAttributes<SVGSVGElement | HTMLElement>>;
|
|
21
|
+
export default IconFont;
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React, { forwardRef } from 'react';
|
|
24
|
+
var IconFont = forwardRef(function (_a, ref) {
|
|
25
|
+
var _b = _a.type, type = _b === void 0 ? '' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.symbol, symbol = _d === void 0 ? false : _d, attrs = __rest(_a, ["type", "className", "symbol"]);
|
|
26
|
+
if (symbol) {
|
|
27
|
+
return (React.createElement("svg", __assign({ className: "iconfont-symbol ".concat(type, " ").concat(className), "aria-hidden": "true", ref: ref }, attrs),
|
|
28
|
+
React.createElement("use", { xlinkHref: "#".concat(type) })));
|
|
29
|
+
}
|
|
30
|
+
return (React.createElement("i", __assign({ className: "iconfont ".concat(type, " ").concat(className), ref: ref }, attrs)));
|
|
31
|
+
});
|
|
32
|
+
export default IconFont;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SwitchProps } from 'antd/es/switch';
|
|
3
|
+
/**
|
|
4
|
+
* Switch 可自定义 value
|
|
5
|
+
* 使用场景:
|
|
6
|
+
* 1. 需要自定义 value 的 switch
|
|
7
|
+
*/
|
|
8
|
+
interface SwitchValueProps<T = any, F = any> extends Omit<SwitchProps, 'checked' | 'onChange'> {
|
|
9
|
+
/**
|
|
10
|
+
* 选中值
|
|
11
|
+
*/
|
|
12
|
+
trueValue?: T;
|
|
13
|
+
/**
|
|
14
|
+
* 未选中值
|
|
15
|
+
*/
|
|
16
|
+
falseValue?: F;
|
|
17
|
+
/**
|
|
18
|
+
* 选中值
|
|
19
|
+
*/
|
|
20
|
+
checked?: T | F;
|
|
21
|
+
/**
|
|
22
|
+
* 选中事件
|
|
23
|
+
*/
|
|
24
|
+
onChange?: (value: T | F, event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Switch 可自定义 value
|
|
28
|
+
*/
|
|
29
|
+
declare const Index: ({ checked, onChange, trueValue, falseValue, ...props }: SwitchValueProps) => React.JSX.Element;
|
|
30
|
+
export default Index;
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { Switch } from 'antd';
|
|
25
|
+
/**
|
|
26
|
+
* Switch 可自定义 value
|
|
27
|
+
*/
|
|
28
|
+
var Index = function (_a) {
|
|
29
|
+
var checked = _a.checked, onChange = _a.onChange, _b = _a.trueValue, trueValue = _b === void 0 ? true : _b, _c = _a.falseValue, falseValue = _c === void 0 ? false : _c, props = __rest(_a, ["checked", "onChange", "trueValue", "falseValue"]);
|
|
30
|
+
var _checked = checked === trueValue;
|
|
31
|
+
var change = function (checked, event) {
|
|
32
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(checked ? trueValue : falseValue, event);
|
|
33
|
+
};
|
|
34
|
+
return (React.createElement(Switch, __assign({ checked: _checked, onChange: change }, props)));
|
|
35
|
+
};
|
|
36
|
+
export default Index;
|
|
@@ -17,5 +17,5 @@ declare const IconFont: React.ForwardRefExoticComponent<((IconFontCommonProps &
|
|
|
17
17
|
symbol?: false;
|
|
18
18
|
}) | Omit<IconFontCommonProps & React.SVGProps<SVGSVGElement> & {
|
|
19
19
|
symbol: true;
|
|
20
|
-
}, "ref">) & React.RefAttributes<
|
|
20
|
+
}, "ref">) & React.RefAttributes<SVGSVGElement | HTMLElement>>;
|
|
21
21
|
export default IconFont;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export { default as CheckboxValue } from './CheckboxValue';
|
|
2
|
-
export { default as IconButton } from './IconButton';
|
|
3
|
-
export { default as IconFont } from './IconFont';
|
|
4
|
-
export { default as SwitchValue } from './SwitchValue';
|
|
5
1
|
export { default as App, message, notification, modal } from './AntdApp';
|
|
2
|
+
export { default as IconButton } from './IconButton';
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export { default as CheckboxValue } from './CheckboxValue';
|
|
2
|
-
export { default as IconButton } from './IconButton';
|
|
3
|
-
export { default as IconFont } from './IconFont';
|
|
4
|
-
export { default as SwitchValue } from './SwitchValue';
|
|
5
1
|
export { default as App, message, notification, modal } from './AntdApp';
|
|
2
|
+
export { default as IconButton } from './IconButton';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.modal = exports.notification = exports.message = void 0;
|
|
4
|
+
var antd_1 = require("antd");
|
|
5
|
+
var message = antd_1.message;
|
|
6
|
+
exports.message = message;
|
|
7
|
+
var notification = antd_1.notification;
|
|
8
|
+
exports.notification = notification;
|
|
9
|
+
var modal = antd_1.Modal;
|
|
10
|
+
exports.modal = modal;
|
|
11
|
+
function Index(_a) {
|
|
12
|
+
var children = _a.children;
|
|
13
|
+
var staticFunction = antd_1.App.useApp();
|
|
14
|
+
exports.message = message = staticFunction.message;
|
|
15
|
+
exports.modal = modal = staticFunction.modal;
|
|
16
|
+
exports.notification = notification = staticFunction.notification;
|
|
17
|
+
return children;
|
|
18
|
+
}
|
|
19
|
+
exports.default = Index;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
var react_1 = __importDefault(require("react"));
|
|
29
|
+
var antd_1 = require("antd");
|
|
30
|
+
var CheckboxValue = function (_a) {
|
|
31
|
+
var checked = _a.checked, onChange = _a.onChange, _b = _a.trueValue, trueValue = _b === void 0 ? true : _b, _c = _a.falseValue, falseValue = _c === void 0 ? false : _c, _d = _a.trueLabel, trueLabel = _d === void 0 ? '' : _d, _e = _a.falseLabel, falseLabel = _e === void 0 ? '' : _e, children = _a.children, props = __rest(_a, ["checked", "onChange", "trueValue", "falseValue", "trueLabel", "falseLabel", "children"]);
|
|
32
|
+
var _checked = checked === trueValue;
|
|
33
|
+
var change = function (e) {
|
|
34
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked ? trueValue : falseValue, e);
|
|
35
|
+
};
|
|
36
|
+
return (react_1.default.createElement(antd_1.Checkbox, __assign({ checked: _checked, onChange: change }, props), children || (_checked ? trueLabel : falseLabel)));
|
|
37
|
+
};
|
|
38
|
+
exports.default = CheckboxValue;
|