@mi-avalon/libs 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ItemsRow/index.d.ts +42 -0
- package/dist/components/ItemsRow/index.js +20 -0
- package/dist/components/MDescriptions/index.d.ts +65 -0
- package/dist/components/MDescriptions/index.js +25 -0
- package/dist/components/ThemeContext/index.d.ts +11 -0
- package/dist/components/ThemeContext/index.js +17 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -2
- package/dist/components/utils.d.ts +1 -0
- package/dist/components/utils.js +16 -0
- package/dist/index.es.js +353 -287
- package/dist/index.umd.js +11 -11
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(d,
|
|
1
|
+
(function(d,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("antd")):typeof define=="function"&&define.amd?define(["exports","react","antd"],h):(d=typeof globalThis<"u"?globalThis:d||self,h(d.MiAvalonLibs={},d.React,d.antd))})(this,function(d,h,y){"use strict";var Or=Object.defineProperty;var wr=(d,h,y)=>h in d?Or(d,h,{enumerable:!0,configurable:!0,writable:!0,value:y}):d[h]=y;var l=(d,h,y)=>(wr(d,typeof h!="symbol"?h+"":h,y),y);const ue=(g=>g&&g.__esModule?g:{default:g})(h);var K={exports:{}},N={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.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 le;function Fe(){if(le)return N;le=1;var g=ue.default,S=Symbol.for("react.element"),Y=Symbol.for("react.fragment"),O=Object.prototype.hasOwnProperty,D=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$={key:!0,ref:!0,__self:!0,__source:!0};function _(x,v,A){var m,C={},T=null,M=null;A!==void 0&&(T=""+A),v.key!==void 0&&(T=""+v.key),v.ref!==void 0&&(M=v.ref);for(m in v)O.call(v,m)&&!$.hasOwnProperty(m)&&(C[m]=v[m]);if(x&&x.defaultProps)for(m in v=x.defaultProps,v)C[m]===void 0&&(C[m]=v[m]);return{$$typeof:S,type:x,key:T,ref:M,props:C,_owner:D.current}}return N.Fragment=Y,N.jsx=_,N.jsxs=_,N}var H={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,19 +14,19 @@
|
|
|
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
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),c=a.length-1,
|
|
21
|
-
`+a[c].replace(" at new "," at ");return e.displayName&&
|
|
17
|
+
*/var ce;function Ie(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var g=ue.default,S=Symbol.for("react.element"),Y=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),x=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),Z=Symbol.iterator,F="@@iterator";function X(e){if(e===null||typeof e!="object")return null;var r=Z&&e[Z]||e[F];return typeof r=="function"?r:null}var j=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Le("error",e,t)}}function Le(e,r,t){{var n=j.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Ue=!1,Ze=!1,Be=!1,Je=!1,qe=!1,ve;ve=Symbol.for("react.module.reference");function Ge(e){return!!(typeof e=="string"||typeof e=="function"||e===O||e===$||qe||e===D||e===A||e===m||Je||e===M||Ue||Ze||Be||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===C||e.$$typeof===_||e.$$typeof===x||e.$$typeof===v||e.$$typeof===ve||e.getModuleId!==void 0))}function Ke(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function pe(e){return e.displayName||"Context"}function w(e){if(e==null)return null;if(typeof e.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case Y:return"Portal";case $:return"Profiler";case D:return"StrictMode";case A:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:var r=e;return pe(r)+".Consumer";case _:var t=e;return pe(t._context)+".Provider";case v:return Ke(e,e.render,"ForwardRef");case C:var n=e.displayName||null;return n!==null?n:w(e.type)||"Memo";case T:{var o=e,s=o._payload,i=o._init;try{return w(i(s))}catch{return null}}}return null}var P=Object.assign,V=0,he,ge,me,be,_e,Ee,Re;function ye(){}ye.__reactDisabledLog=!0;function Xe(){{if(V===0){he=console.log,ge=console.info,me=console.warn,be=console.error,_e=console.group,Ee=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ye,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}V++}}function Qe(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:he}),info:P({},e,{value:ge}),warn:P({},e,{value:me}),error:P({},e,{value:be}),group:P({},e,{value:_e}),groupCollapsed:P({},e,{value:Ee}),groupEnd:P({},e,{value:Re})})}V<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Q=j.ReactCurrentDispatcher,ee;function B(e,r,t){{if(ee===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);ee=n&&n[1]||""}return`
|
|
18
|
+
`+ee+e}}var re=!1,J;{var er=typeof WeakMap=="function"?WeakMap:Map;J=new er}function Se(e,r){if(!e||re)return"";{var t=J.get(e);if(t!==void 0)return t}var n;re=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=Q.current,Q.current=null,Xe();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(E){n=E}Reflect.construct(e,[],i)}else{try{i.call()}catch(E){n=E}e.call(i.prototype)}}else{try{throw Error()}catch(E){n=E}e()}}catch(E){if(E&&n&&typeof E.stack=="string"){for(var a=E.stack.split(`
|
|
19
|
+
`),b=n.stack.split(`
|
|
20
|
+
`),c=a.length-1,f=b.length-1;c>=1&&f>=0&&a[c]!==b[f];)f--;for(;c>=1&&f>=0;c--,f--)if(a[c]!==b[f]){if(c!==1||f!==1)do if(c--,f--,f<0||a[c]!==b[f]){var R=`
|
|
21
|
+
`+a[c].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),typeof e=="function"&&J.set(e,R),R}while(c>=1&&f>=0);break}}}finally{re=!1,Q.current=s,Qe(),Error.prepareStackTrace=o}var W=e?e.displayName||e.name:"",k=W?B(W):"";return typeof e=="function"&&J.set(e,k),k}function rr(e,r,t){return Se(e,!1)}function tr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function q(e,r,t){if(e==null)return"";if(typeof e=="function")return Se(e,tr(e));if(typeof e=="string")return B(e);switch(e){case A:return B("Suspense");case m:return B("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return rr(e.render);case C:return q(e.type,r,t);case T:{var n=e,o=n._payload,s=n._init;try{return q(s(o),r,t)}catch{}}}return""}var L=Object.prototype.hasOwnProperty,Ce={},Oe=j.ReactDebugCurrentFrame;function G(e){if(e){var r=e._owner,t=q(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(t)}else Oe.setExtraStackFrame(null)}function nr(e,r,t,n,o){{var s=Function.call.bind(L);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var b=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw b.name="Invariant Violation",b}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}a&&!(a instanceof Error)&&(G(o),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),G(null)),a instanceof Error&&!(a.message in Ce)&&(Ce[a.message]=!0,G(o),p("Failed %s type: %s",t,a.message),G(null))}}}var ar=Array.isArray;function te(e){return ar(e)}function ir(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function or(e){try{return we(e),!1}catch{return!0}}function we(e){return""+e}function De(e){if(or(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ir(e)),we(e)}var U=j.ReactCurrentOwner,sr={key:!0,ref:!0,__self:!0,__source:!0},xe,Te,ne;ne={};function ur(e){if(L.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function lr(e){if(L.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function cr(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=w(U.current.type);ne[t]||(p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',w(U.current.type),e.ref),ne[t]=!0)}}function fr(e,r){{var t=function(){xe||(xe=!0,p("%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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function dr(e,r){{var t=function(){Te||(Te=!0,p("%s: `ref` 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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var vr=function(e,r,t,n,o,s,i){var a={$$typeof:S,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function pr(e,r,t,n,o){{var s,i={},a=null,b=null;t!==void 0&&(De(t),a=""+t),lr(r)&&(De(r.key),a=""+r.key),ur(r)&&(b=r.ref,cr(r,o));for(s in r)L.call(r,s)&&!sr.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var c=e.defaultProps;for(s in c)i[s]===void 0&&(i[s]=c[s])}if(a||b){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&fr(i,f),b&&dr(i,f)}return vr(e,a,b,o,n,U.current,i)}}var ae=j.ReactCurrentOwner,je=j.ReactDebugCurrentFrame;function I(e){if(e){var r=e._owner,t=q(e.type,e._source,r?r.type:null);je.setExtraStackFrame(t)}else je.setExtraStackFrame(null)}var ie;ie=!1;function oe(e){return typeof e=="object"&&e!==null&&e.$$typeof===S}function Ae(){{if(ae.current){var e=w(ae.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function hr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+r+":"+t+"."}return""}}var
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var Ye={};function gr(e){{var r=Ae();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+t+">.")}return r}}function
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function Pe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=gr(r);if(Ye[t])return;Ye[t]=!0;var n="";e&&e._owner&&e._owner!==ae.current&&(n=" It was passed a child from "+w(e._owner.type)+"."),I(e),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),I(null)}}function ke(e,r){{if(typeof e!="object")return;if(te(e))for(var t=0;t<e.length;t++){var n=e[t];oe(n)&&Pe(n,r)}else if(oe(e))e._store&&(e._store.validated=!0);else if(e){var o=X(e);if(typeof o=="function"&&o!==e.entries)for(var s=o.call(e),i;!(i=s.next()).done;)oe(i.value)&&Pe(i.value,r)}}}function mr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===v||r.$$typeof===C))t=r.propTypes;else return;if(t){var n=w(r);nr(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var o=w(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function br(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){I(e),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),I(null);break}}e.ref!==null&&(I(e),p("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}var $e={};function Me(e,r,t,n,o,s){{var i=Ge(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var b=hr(o);b?a+=b:a+=Ae();var c;e===null?c="null":te(e)?c="array":e!==void 0&&e.$$typeof===S?(c="<"+(w(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):c=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,a)}var f=pr(e,r,t,o,s);if(f==null)return f;if(i){var R=r.children;if(R!==void 0)if(n)if(te(R)){for(var W=0;W<R.length;W++)ke(R[W],e);Object.freeze&&Object.freeze(R)}else p("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 ke(R,e)}if(L.call(r,"key")){var k=w(e),E=Object.keys(r).filter(function(Cr){return Cr!=="key"}),se=E.length>0?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}";if(!$e[k+se]){var Sr=E.length>0?"{"+E.join(": ..., ")+": ...}":"{}";p(`A props object containing a "key" prop is being spread into JSX:
|
|
28
28
|
let props = %s;
|
|
29
29
|
<%s {...props} />
|
|
30
30
|
React keys must be passed directly to JSX without using spread:
|
|
31
31
|
let props = %s;
|
|
32
|
-
<%s key={someKey} {...props} />`,
|
|
32
|
+
<%s key={someKey} {...props} />`,se,k,Sr,k),$e[k+se]=!0}}return e===O?br(f):mr(f),f}}function _r(e,r,t){return Me(e,r,t,!0)}function Er(e,r,t){return Me(e,r,t,!1)}var Rr=Er,yr=_r;H.Fragment=O,H.jsx=Rr,H.jsxs=yr}()),H}process.env.NODE_ENV==="production"?K.exports=Fe():K.exports=Ie();var z=K.exports;const fe=h.createContext({theme:{cssVar:!0,algorithm:[y.theme.defaultAlgorithm]}});fe.Provider;function We(){return h.useContext(fe)}function Ne(g){const{theme:S}=We();return z.jsx(y.ConfigProvider,{theme:S,children:g.children})}const de=g=>{const{data:S,title:Y,column:O=3,lineHeight:D,align:$="left",itemLayout:_,colon:x=!0,bordered:v=!1,style:A,className:m,labelStyle:C,contentStyle:T}=g,M={...D?{lineHeight:`${D}px`}:{},textAlign:$,..._!=null&&_.label?{width:`${_.label}px`}:{},...C},Z={...D?{lineHeight:`${D}px`}:{},..._!=null&&_.value?{width:`${_.value}px`}:{},...T};return z.jsx(Ne,{children:z.jsx(y.Descriptions,{title:Y,column:O,colon:x,bordered:v,style:A,className:m,labelStyle:M,contentStyle:Z,children:S.map((F,X)=>{var j;return z.jsx(y.Descriptions.Item,{label:F.label,span:F.span,children:F.value||"-"},((j=F.label)==null?void 0:j.toString())||X)})})})};de.displayName="MDescriptions";const xr="",He=({type:g="primary",children:S,onClick:Y,custom:O})=>z.jsx(y.Button,{type:g,onClick:Y,className:"my-button",children:O||S}),ze={YMD_Hms:"YYYY-MM-DD HH:mm:ss",YMD:"YYYY-MM-DD",YMD2:"YYYYMMDD",YMD_POINT:"YYYY.M.DD",Hms:"HH:mm:ss",Hm:"HH:mm",YMD_000:"YYYY-MM-DD 00:00:00",YMD_end:"YYYY-MM-DD 23:59:59",YMD_Hm:"YYYYMMDD HHmm"},Ve=10;class u{}l(u,"integerRegex",/^-?\d+$/),l(u,"positiveIntegerRegex",/^[1-9]\d*$/),l(u,"negativeIntegerRegex",/^-[1-9]\d*$/),l(u,"floatRegex",/^-?\d+(\.\d+)?$/),l(u,"letter",/^[a-zA-Z]+$/),l(u,"chinese",/^[\u4e00-\u9fa5]+$/),l(u,"number",/^[0-9]*$/),l(u,"username",/^[a-zA-Z]\w{3,15}$/),l(u,"strongUsername",/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,20}$/),l(u,"password",/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/),l(u,"strongPassword",/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/),l(u,"phone",/^1[3-9]\d{9}$/),l(u,"phoneWithAreaCode",/^\+?\d{2,3}-?\d{8,11}$/),l(u,"email",/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/),l(u,"idCard",/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/),l(u,"bankCard",/^[1-9]\d{3,30}$/),l(u,"zipCode",/^[1-9]\d{5}$/),l(u,"ip",/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/),l(u,"url",/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/),l(u,"carNumber",/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/),l(u,"time",/^([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/),l(u,"date",/^(\d{4})-(\d{2})-(\d{2})$/),d.DATE_FORMAT=ze,d.MDescriptions=de,d.MyButton=He,d.PAGE_SIZE=Ve,d.PatternType=u,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|