onchain-uikit 0.0.2 → 0.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/.storybook/preview.tsx +31 -0
- package/config/theme.ts +34 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +581 -311
- package/dist/index.umd.js +30 -0
- package/dist/src/App.d.ts +5 -0
- package/dist/src/components/PlmMosaic/index.d.ts +5 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/main.d.ts +0 -0
- package/dist/src/stories/Button.d.ts +14 -0
- package/dist/src/stories/Button.stories.d.ts +23 -0
- package/dist/src/stories/Header.d.ts +11 -0
- package/dist/src/stories/Header.stories.d.ts +18 -0
- package/dist/src/stories/OnChainProvider.d.ts +12 -0
- package/dist/src/stories/Page.d.ts +2 -0
- package/dist/src/stories/Page.stories.d.ts +12 -0
- package/dist/src/stories/PlmMosaic.stories.d.ts +14 -0
- package/dist/src/stories/PlmSelect/PlmSelect.stories.d.ts +21 -0
- package/dist/src/stories/PlmSelect/index.d.ts +20 -0
- package/dist/src/stories/XsButton.d.ts +22 -0
- package/dist/src/stories/XsButton.stories.d.ts +14 -0
- package/dist/src/utils/authority/basicsAuthority.d.ts +22 -0
- package/dist/src/utils/authority/index.d.ts +10 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +23 -3
- package/src/App.tsx +30 -7
- package/src/assets/styles/antd.custom.less +1144 -0
- package/src/assets/styles/mixins.less +5 -0
- package/src/components/PlmMosaic/index.module.less +6 -0
- package/src/components/PlmMosaic/index.tsx +15 -0
- package/src/global.less +973 -0
- package/src/index.ts +5 -2
- package/src/main.tsx +7 -4
- package/src/stories/OnChainProvider.tsx +37 -0
- package/src/stories/PlmMosaic.stories.ts +35 -0
- package/src/stories/PlmSelect/PlmSelect.stories.ts +50 -0
- package/src/stories/PlmSelect/index.module.less +73 -0
- package/src/stories/PlmSelect/index.tsx +136 -0
- package/src/stories/XsButton.stories.ts +30 -0
- package/src/stories/XsButton.tsx +33 -0
- package/src/typings.d.ts +636 -0
- package/src/utils/authority/basicsAuthority.ts +46 -0
- package/src/utils/authority/index.tsx +28 -0
- package/tsconfig.json +84 -5
- package/typings.d.ts +130 -0
- package/vite.config.ts +63 -5
- package/.storybook/preview.ts +0 -14
- package/dist/index.cjs.js +0 -30
- package/dist/onchain-uikit.css +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
(function(R,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("antd"),require("react")):typeof define=="function"&&define.amd?define(["exports","antd","react"],x):(R=typeof globalThis<"u"?globalThis:R||self,x(R["onchain-uikit-library"]={},R.antd,R.React))})(this,function(R,x,G){"use strict";function Be(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var N={},H={exports:{}},le;function Q(){return le||(le=1,function(n){function f(d){return d&&d.__esModule?d:{default:d}}n.exports=f,n.exports.__esModule=!0,n.exports.default=n.exports}(H)),H.exports}var A={},se;function Ze(){if(se)return A;se=1,Object.defineProperty(A,"__esModule",{value:!0}),A.default=void 0;var n={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};return A.default=n,A}var Y={},I={},M={},fe;function Je(){if(fe)return M;fe=1,Object.defineProperty(M,"__esModule",{value:!0}),M.default=void 0;var n={locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",yearFormat:"YYYY年",dayFormat:"D日",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH时mm分ss秒",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"},f=n;return M.default=f,M}var q={},ce;function de(){if(ce)return q;ce=1,Object.defineProperty(q,"__esModule",{value:!0}),q.default=void 0;var f={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]};return q.default=f,q}var ve;function pe(){if(ve)return I;ve=1;var n=Q().default;Object.defineProperty(I,"__esModule",{value:!0}),I.default=void 0;var f=n(Je()),d=n(de());const g={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},f.default),timePickerLocale:Object.assign({},d.default)};g.lang.ok="确定";var T=g;return I.default=T,I}var he;function Ke(){if(he)return Y;he=1;var n=Q().default;Object.defineProperty(Y,"__esModule",{value:!0}),Y.default=void 0;var f=n(pe()),d=f.default;return Y.default=d,Y}var _e;function Xe(){if(_e)return N;_e=1;var n=Q().default;Object.defineProperty(N,"__esModule",{value:!0}),N.default=void 0;var f=n(Ze()),d=n(Ke()),g=n(pe()),T=n(de());const v="${label}不是一个有效的${type}";var E={locale:"zh-cn",Pagination:f.default,DatePicker:g.default,TimePicker:T.default,Calendar:d.default,global:{placeholder:"请选择"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckall:"全选",filterSearchPlaceholder:"在筛选项中搜索",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开"},PageHeader:{back:"返回"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:v,method:v,array:v,object:v,number:v,date:v,boolean:v,integer:v,float:v,regexp:v,email:v,url:v,hex:v},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},Image:{preview:"预览"},QRCode:{expired:"二维码过期",refresh:"点击刷新"}};return N.default=E,N}var Ge=Xe();const He=Be(Ge),Qe=({prefixCls:n="frontend",...f},d)=>(x.ConfigProvider.config({prefixCls:n}),G.createElement(x.ConfigProvider,{prefixCls:n,locale:He,input:{autoComplete:"off"},autoInsertSpaceInButton:!1},f.children));var L={exports:{}},W={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var me;function er(){if(me)return W;me=1;var n=G,f=Symbol.for("react.element"),d=Symbol.for("react.fragment"),g=Object.prototype.hasOwnProperty,T=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function j(E,p,w){var b,C={},O=null,B=null;w!==void 0&&(O=""+w),p.key!==void 0&&(O=""+p.key),p.ref!==void 0&&(B=p.ref);for(b in p)g.call(p,b)&&!v.hasOwnProperty(b)&&(C[b]=p[b]);if(E&&E.defaultProps)for(b in p=E.defaultProps,p)C[b]===void 0&&(C[b]=p[b]);return{$$typeof:f,type:E,key:O,ref:B,props:C,_owner:T.current}}return W.Fragment=d,W.jsx=j,W.jsxs=j,W}var z={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var be;function rr(){return be||(be=1,process.env.NODE_ENV!=="production"&&function(){var n=G,f=Symbol.for("react.element"),d=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),E=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),ye=Symbol.iterator,or="@@iterator";function ir(e){if(e===null||typeof e!="object")return null;var r=ye&&e[ye]||e[or];return typeof r=="function"?r:null}var k=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];ur("error",e,t)}}function ur(e,r,t){{var a=k.ReactDebugCurrentFrame,u=a.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var l=t.map(function(i){return String(i)});l.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,l)}}var lr=!1,sr=!1,fr=!1,cr=!1,dr=!1,Re;Re=Symbol.for("react.module.reference");function vr(e){return!!(typeof e=="string"||typeof e=="function"||e===g||e===v||dr||e===T||e===w||e===b||cr||e===B||lr||sr||fr||typeof e=="object"&&e!==null&&(e.$$typeof===O||e.$$typeof===C||e.$$typeof===j||e.$$typeof===E||e.$$typeof===p||e.$$typeof===Re||e.getModuleId!==void 0))}function pr(e,r,t){var a=e.displayName;if(a)return a;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function Ee(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&h("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 g:return"Fragment";case d:return"Portal";case v:return"Profiler";case T:return"StrictMode";case w:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E:var r=e;return Ee(r)+".Consumer";case j:var t=e;return Ee(t._context)+".Provider";case p:return pr(e,e.render,"ForwardRef");case C:var a=e.displayName||null;return a!==null?a:P(e.type)||"Memo";case O:{var u=e,l=u._payload,i=u._init;try{return P(i(l))}catch{return null}}}return null}var S=Object.assign,V=0,Ce,Te,Pe,xe,Oe,Se,$e;function je(){}je.__reactDisabledLog=!0;function hr(){{if(V===0){Ce=console.log,Te=console.info,Pe=console.warn,xe=console.error,Oe=console.group,Se=console.groupCollapsed,$e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:je,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}V++}}function _r(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},e,{value:Ce}),info:S({},e,{value:Te}),warn:S({},e,{value:Pe}),error:S({},e,{value:xe}),group:S({},e,{value:Oe}),groupCollapsed:S({},e,{value:Se}),groupEnd:S({},e,{value:$e})})}V<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=k.ReactCurrentDispatcher,re;function Z(e,r,t){{if(re===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);re=a&&a[1]||""}return`
|
|
18
|
+
`+re+e}}var te=!1,J;{var mr=typeof WeakMap=="function"?WeakMap:Map;J=new mr}function we(e,r){if(!e||te)return"";{var t=J.get(e);if(t!==void 0)return t}var a;te=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var l;l=ee.current,ee.current=null,hr();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(m){a=m}Reflect.construct(e,[],i)}else{try{i.call()}catch(m){a=m}e.call(i.prototype)}}else{try{throw Error()}catch(m){a=m}e()}}catch(m){if(m&&a&&typeof m.stack=="string"){for(var o=m.stack.split(`
|
|
19
|
+
`),_=a.stack.split(`
|
|
20
|
+
`),s=o.length-1,c=_.length-1;s>=1&&c>=0&&o[s]!==_[c];)c--;for(;s>=1&&c>=0;s--,c--)if(o[s]!==_[c]){if(s!==1||c!==1)do if(s--,c--,c<0||o[s]!==_[c]){var y=`
|
|
21
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&y.includes("<anonymous>")&&(y=y.replace("<anonymous>",e.displayName)),typeof e=="function"&&J.set(e,y),y}while(s>=1&&c>=0);break}}}finally{te=!1,ee.current=l,_r(),Error.prepareStackTrace=u}var F=e?e.displayName||e.name:"",$=F?Z(F):"";return typeof e=="function"&&J.set(e,$),$}function br(e,r,t){return we(e,!1)}function gr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,t){if(e==null)return"";if(typeof e=="function")return we(e,gr(e));if(typeof e=="string")return Z(e);switch(e){case w:return Z("Suspense");case b:return Z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return br(e.render);case C:return K(e.type,r,t);case O:{var a=e,u=a._payload,l=a._init;try{return K(l(u),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,ke={},De=k.ReactDebugCurrentFrame;function X(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);De.setExtraStackFrame(t)}else De.setExtraStackFrame(null)}function yr(e,r,t,a,u){{var l=Function.call.bind(U);for(var i in e)if(l(e,i)){var o=void 0;try{if(typeof e[i]!="function"){var _=Error((a||"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 _.name="Invariant Violation",_}o=e[i](r,i,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){o=s}o&&!(o instanceof Error)&&(X(u),h("%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).",a||"React class",t,i,typeof o),X(null)),o instanceof Error&&!(o.message in ke)&&(ke[o.message]=!0,X(u),h("Failed %s type: %s",t,o.message),X(null))}}}var Rr=Array.isArray;function ae(e){return Rr(e)}function Er(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Cr(e){try{return Fe(e),!1}catch{return!0}}function Fe(e){return""+e}function Ne(e){if(Cr(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Er(e)),Fe(e)}var Ae=k.ReactCurrentOwner,Tr={key:!0,ref:!0,__self:!0,__source:!0},Ye,Ie;function Pr(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function xr(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Or(e,r){typeof e.ref=="string"&&Ae.current}function Sr(e,r){{var t=function(){Ye||(Ye=!0,h("%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 $r(e,r){{var t=function(){Ie||(Ie=!0,h("%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 jr=function(e,r,t,a,u,l,i){var o={$$typeof:f,type:e,key:r,ref:t,props:i,_owner:l};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function wr(e,r,t,a,u){{var l,i={},o=null,_=null;t!==void 0&&(Ne(t),o=""+t),xr(r)&&(Ne(r.key),o=""+r.key),Pr(r)&&(_=r.ref,Or(r,u));for(l in r)U.call(r,l)&&!Tr.hasOwnProperty(l)&&(i[l]=r[l]);if(e&&e.defaultProps){var s=e.defaultProps;for(l in s)i[l]===void 0&&(i[l]=s[l])}if(o||_){var c=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&Sr(i,c),_&&$r(i,c)}return jr(e,o,_,u,a,Ae.current,i)}}var ne=k.ReactCurrentOwner,Me=k.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Me.setExtraStackFrame(t)}else Me.setExtraStackFrame(null)}var oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===f}function qe(){{if(ne.current){var e=P(ne.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function kr(e){return""}var We={};function Dr(e){{var r=qe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function ze(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Dr(r);if(We[t])return;We[t]=!0;var a="";e&&e._owner&&e._owner!==ne.current&&(a=" It was passed a child from "+P(e._owner.type)+"."),D(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),D(null)}}function Ve(e,r){{if(typeof e!="object")return;if(ae(e))for(var t=0;t<e.length;t++){var a=e[t];ie(a)&&ze(a,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var u=ir(e);if(typeof u=="function"&&u!==e.entries)for(var l=u.call(e),i;!(i=l.next()).done;)ie(i.value)&&ze(i.value,r)}}}function Fr(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===p||r.$$typeof===C))t=r.propTypes;else return;if(t){var a=P(r);yr(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!oe){oe=!0;var u=P(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){D(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),D(null);break}}e.ref!==null&&(D(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}var Ue={};function Le(e,r,t,a,u,l){{var i=vr(e);if(!i){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" 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 _=kr();_?o+=_:o+=qe();var s;e===null?s="null":ae(e)?s="array":e!==void 0&&e.$$typeof===f?(s="<"+(P(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,o)}var c=wr(e,r,t,u,l);if(c==null)return c;if(i){var y=r.children;if(y!==void 0)if(a)if(ae(y)){for(var F=0;F<y.length;F++)Ve(y[F],e);Object.freeze&&Object.freeze(y)}else h("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 Ve(y,e)}if(U.call(r,"key")){var $=P(e),m=Object.keys(r).filter(function(Wr){return Wr!=="key"}),ue=m.length>0?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}";if(!Ue[$+ue]){var qr=m.length>0?"{"+m.join(": ..., ")+": ...}":"{}";h(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,ue,$,qr,$),Ue[$+ue]=!0}}return e===g?Nr(c):Fr(c),c}}function Ar(e,r,t){return Le(e,r,t,!0)}function Yr(e,r,t){return Le(e,r,t,!1)}var Ir=Yr,Mr=Ar;z.Fragment=g,z.jsx=Ir,z.jsxs=Mr}()),z}var ge;function tr(){return ge||(ge=1,process.env.NODE_ENV==="production"?L.exports=er():L.exports=rr()),L.exports}var ar=tr();const nr=(n,f)=>{var d;return ar.jsx(x.Button,{type:n.btnType,className:"my-button",children:((d=n.custObj)==null?void 0:d.name)||n.label})};R.OnChainProvider=Qe,R.XsButton=nr,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** vite工程入口,跟storybook无关 */
|
|
3
|
+
export declare function rootContainer(container: any): React.FunctionComponentElement<import('antd/es/config-provider').ConfigProviderProps>;
|
|
4
|
+
declare function App(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default App;
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ButtonProps {
|
|
2
|
+
/** Is this the principal call to action on the page? */
|
|
3
|
+
primary?: boolean;
|
|
4
|
+
/** What background color to use */
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
/** How large should the button be? */
|
|
7
|
+
size?: 'small' | 'medium' | 'large';
|
|
8
|
+
/** Button contents */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Optional click handler */
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
/** Primary UI component for user interaction */
|
|
14
|
+
export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ primary, size, backgroundColor, label, ...props }: import('./Button').ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {
|
|
10
|
+
backgroundColor: {
|
|
11
|
+
control: "color";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
args: {
|
|
15
|
+
onClick: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
export declare const Primary: Story;
|
|
21
|
+
export declare const Secondary: Story;
|
|
22
|
+
export declare const Large: Story;
|
|
23
|
+
export declare const Small: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type User = {
|
|
2
|
+
name: string;
|
|
3
|
+
};
|
|
4
|
+
export interface HeaderProps {
|
|
5
|
+
user?: User;
|
|
6
|
+
onLogin?: () => void;
|
|
7
|
+
onLogout?: () => void;
|
|
8
|
+
onCreateAccount?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const Header: ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ user, onLogin, onLogout, onCreateAccount }: import('./Header').HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
args: {
|
|
10
|
+
onLogin: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
11
|
+
onLogout: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
12
|
+
onCreateAccount: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
export declare const LoggedIn: Story;
|
|
18
|
+
export declare const LoggedOut: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Antd Provider
|
|
4
|
+
*/
|
|
5
|
+
export interface OnChainProviderProps {
|
|
6
|
+
/** 设置统一样式前缀 */
|
|
7
|
+
prefixCls?: string;
|
|
8
|
+
/** 内容 */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const OnChainProvider: ({ prefixCls, ...props }: OnChainProviderProps, ref: any) => React.FunctionComponentElement<import('antd/es/config-provider').ConfigProviderProps>;
|
|
12
|
+
export default OnChainProvider;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').FC<{}>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const LoggedOut: Story;
|
|
12
|
+
export declare const LoggedIn: Story;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import('../components/PlmMosaic').PlmMosaicProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {};
|
|
10
|
+
args: {};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const InLineTrue: Story;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<Omit<import('.').PlmSelectProps, "ref"> & import('react').RefAttributes<unknown>>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {};
|
|
10
|
+
args: {
|
|
11
|
+
/** 列表值 */
|
|
12
|
+
options: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
export declare const Large: Story;
|
|
21
|
+
export declare const Small: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseComponentProps } from '../../typings';
|
|
2
|
+
import { SelectProps } from 'antd';
|
|
3
|
+
export interface PlmSelectProps extends BaseComponentProps, SelectProps<any> {
|
|
4
|
+
pane?: {
|
|
5
|
+
cols?: number;
|
|
6
|
+
item?: BaseComponentProps;
|
|
7
|
+
};
|
|
8
|
+
/** 分页信息 */
|
|
9
|
+
pagination: {
|
|
10
|
+
/**网络请求URL */
|
|
11
|
+
url: string;
|
|
12
|
+
page: number;
|
|
13
|
+
pageSize: number;
|
|
14
|
+
total: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface PlmSelectForwardRefProps {
|
|
18
|
+
}
|
|
19
|
+
declare const PlmSelect: import('react').ForwardRefExoticComponent<Omit<PlmSelectProps, "ref"> & import('react').RefAttributes<unknown>>;
|
|
20
|
+
export default PlmSelect;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ButtonType } from 'antd/lib/button';
|
|
2
|
+
export interface XsButtonProps {
|
|
3
|
+
/** 按钮文本 */
|
|
4
|
+
label: string;
|
|
5
|
+
/** 按钮类型 */
|
|
6
|
+
btnType?: ButtonType;
|
|
7
|
+
/** 按钮类型2 */
|
|
8
|
+
btnType2?: "default" | "primary" | "ghost" | "dashed" | "link" | "text";
|
|
9
|
+
/** Optional click handler */
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
/** 自定义对象 */
|
|
12
|
+
custObj?: custObjTemp;
|
|
13
|
+
}
|
|
14
|
+
/** 对象 */
|
|
15
|
+
type custObjTemp = {
|
|
16
|
+
/** 年龄 */
|
|
17
|
+
name?: string;
|
|
18
|
+
/** 姓名 */
|
|
19
|
+
age?: number;
|
|
20
|
+
};
|
|
21
|
+
declare const XsButton: (props: XsButtonProps, ref: any) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export default XsButton;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import('./XsButton').XsButtonProps, ref: any) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {};
|
|
10
|
+
args: {};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Init: Story;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { APP } from '../../typings';
|
|
2
|
+
import { editedStatusParamsType } from '../plmUtils/ITab';
|
|
3
|
+
export type Mosaic = '~#~';
|
|
4
|
+
export declare class BasicsAuthorityTool {
|
|
5
|
+
/** 马赛克`~#~` */
|
|
6
|
+
static mosaic: Mosaic;
|
|
7
|
+
/**
|
|
8
|
+
* 判断有阅读权限
|
|
9
|
+
*/
|
|
10
|
+
readPermission<T>(value: T): value is Exclude<T, Mosaic>;
|
|
11
|
+
handlingError(value: string): string;
|
|
12
|
+
/** 判断是否有权限,可以用于读取和更新权限 */
|
|
13
|
+
hasAuthority<T extends Record<string, any>>(updateVo: T, key: keyof T): boolean;
|
|
14
|
+
/** 是否是马赛克 */
|
|
15
|
+
isMosaic<T>(value: T | Mosaic): value is Mosaic;
|
|
16
|
+
/** 马赛克渲染为空 */
|
|
17
|
+
mosaicBlank(value: string): string;
|
|
18
|
+
getEditAndControlledState(props: editedStatusParamsType,
|
|
19
|
+
/** 实例信息 */
|
|
20
|
+
instanceInfo: APP.ProjectInstance | APP.MaterialInstance | APP.FileInstance | APP.instanceInfoType): any;
|
|
21
|
+
}
|
|
22
|
+
export declare const BasicsAuthority: BasicsAuthorityTool;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BasicsAuthorityTool, Mosaic } from './basicsAuthority';
|
|
2
|
+
declare class AuthorityTool extends BasicsAuthorityTool {
|
|
3
|
+
/** 马赛克`~#~` */
|
|
4
|
+
mosaic: Mosaic;
|
|
5
|
+
displayData(value: string, inLine?: boolean): string | import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
/** 权限渲染方式 */
|
|
7
|
+
renderIsMosaic<V, C = React.ReactNode>(value: V, children: C, inLine?: boolean): Exclude<C | React.ReactNode, Mosaic>;
|
|
8
|
+
}
|
|
9
|
+
export declare const Authority: AuthorityTool;
|
|
10
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onchain-uikit",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
7
7
|
"build": "vite build",
|
|
8
|
+
"yalc:push": "cross-env NODE_OPTIONS=--max_old_space_size=4096 vite --mode production --config vite.config.ts build && yalc push",
|
|
8
9
|
"lint": "eslint .",
|
|
9
10
|
"preview": "vite preview",
|
|
10
11
|
"storybook": "storybook dev -p 6006",
|
|
11
12
|
"build-storybook": "storybook build"
|
|
12
13
|
},
|
|
14
|
+
"lint-staged": {
|
|
15
|
+
"*.{js,jsx,less,md,json}": [
|
|
16
|
+
"prettier --write"
|
|
17
|
+
],
|
|
18
|
+
"*.ts?(x)": [
|
|
19
|
+
"prettier --parser=typescript --write"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
13
22
|
"main": "dist/index.cjs.js",
|
|
14
23
|
"module": "dist/index.es.js",
|
|
15
24
|
"typings": "dist/index.d.ts",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
16
28
|
"peerDependencies": {
|
|
17
29
|
"antd": "5.1.4"
|
|
18
30
|
},
|
|
19
31
|
"dependencies": {
|
|
20
32
|
"antd": "5.1.4",
|
|
21
33
|
"react": "^18.3.1",
|
|
22
|
-
"react-dom": "^18.3.1"
|
|
34
|
+
"react-dom": "^18.3.1",
|
|
35
|
+
"react-highlight-words": "^0.21.0",
|
|
36
|
+
"vite-plugin-dts": "^4.5.0"
|
|
23
37
|
},
|
|
24
38
|
"devDependencies": {
|
|
25
39
|
"@chromatic-com/storybook": "^3.2.3",
|
|
@@ -31,18 +45,24 @@
|
|
|
31
45
|
"@storybook/react": "^8.5.0",
|
|
32
46
|
"@storybook/react-vite": "^8.5.0",
|
|
33
47
|
"@storybook/test": "^8.5.0",
|
|
48
|
+
"@types/less": "^3.0.7",
|
|
49
|
+
"@types/node": "^22.13.1",
|
|
34
50
|
"@types/react": "^18.3.18",
|
|
35
51
|
"@types/react-dom": "^18.3.5",
|
|
36
52
|
"@vitejs/plugin-react": "^4.3.4",
|
|
53
|
+
"babel-plugin-import": "^1.13.8",
|
|
37
54
|
"eslint": "^9.17.0",
|
|
38
55
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
39
56
|
"eslint-plugin-react-refresh": "^0.4.16",
|
|
40
57
|
"eslint-plugin-storybook": "^0.11.2",
|
|
41
58
|
"globals": "^15.14.0",
|
|
59
|
+
"less": "^4.2.2",
|
|
60
|
+
"less-loader": "^12.2.0",
|
|
42
61
|
"storybook": "^8.5.0",
|
|
43
62
|
"typescript": "~5.6.2",
|
|
44
63
|
"typescript-eslint": "^8.18.2",
|
|
45
|
-
"vite": "^6.0.5"
|
|
64
|
+
"vite": "^6.0.5",
|
|
65
|
+
"vite-plugin-dts": "^4.5.0"
|
|
46
66
|
},
|
|
47
67
|
"eslintConfig": {
|
|
48
68
|
"extends": [
|
package/src/App.tsx
CHANGED
|
@@ -1,10 +1,33 @@
|
|
|
1
|
-
import { useState } from
|
|
2
|
-
import reactLogo from
|
|
3
|
-
import viteLogo from
|
|
4
|
-
import
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import reactLogo from "./assets/react.svg";
|
|
3
|
+
import viteLogo from "/vite.svg";
|
|
4
|
+
import "./App.css";
|
|
5
|
+
import { ConfigProvider } from "antd";
|
|
6
|
+
import zhCN from "antd/lib/locale/zh_CN";
|
|
7
|
+
import React from "react";
|
|
8
|
+
|
|
9
|
+
/** vite工程入口,跟storybook无关 */
|
|
10
|
+
export function rootContainer(container: any) {
|
|
11
|
+
ConfigProvider.config({
|
|
12
|
+
prefixCls: "frontend",
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const root = React.createElement(
|
|
16
|
+
ConfigProvider,
|
|
17
|
+
{
|
|
18
|
+
prefixCls: "frontend",
|
|
19
|
+
locale: zhCN,
|
|
20
|
+
input: { autoComplete: "off" },
|
|
21
|
+
autoInsertSpaceInButton: false,
|
|
22
|
+
},
|
|
23
|
+
container
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
return root;
|
|
27
|
+
}
|
|
5
28
|
|
|
6
29
|
function App() {
|
|
7
|
-
const [count, setCount] = useState(0)
|
|
30
|
+
const [count, setCount] = useState(0);
|
|
8
31
|
|
|
9
32
|
return (
|
|
10
33
|
<>
|
|
@@ -29,7 +52,7 @@ function App() {
|
|
|
29
52
|
Click on the Vite and React logos to learn more
|
|
30
53
|
</p>
|
|
31
54
|
</>
|
|
32
|
-
)
|
|
55
|
+
);
|
|
33
56
|
}
|
|
34
57
|
|
|
35
|
-
export default App
|
|
58
|
+
export default App;
|