@nocobase/plugin-mobile-client 1.4.0-alpha.20241105053324 → 1.4.0-alpha.3
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/client/index.js +28 -27
- package/dist/externalVersion.js +3 -3
- package/package.json +3 -3
package/dist/client/index.js
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
(function(){"use strict";try{if(typeof document!="undefined"){var a=document.createElement("style");a.id="@nocobase/plugin-mobile-client",a.appendChild(document.createTextNode(':root{--adm-radius-s: 4px;--adm-radius-m: 8px;--adm-radius-l: 12px;--adm-font-size-1: 9px;--adm-font-size-2: 10px;--adm-font-size-3: 11px;--adm-font-size-4: 12px;--adm-font-size-5: 13px;--adm-font-size-6: 14px;--adm-font-size-7: 15px;--adm-font-size-8: 16px;--adm-font-size-9: 17px;--adm-font-size-10: 18px;--adm-color-primary: #1677ff;--adm-color-success: #00b578;--adm-color-warning: #ff8f1f;--adm-color-danger: #ff3141;--adm-color-yellow: #ff9f18;--adm-color-orange: #ff6430;--adm-color-wathet: #e7f1ff;--adm-color-text: #333333;--adm-color-text-secondary: #666666;--adm-color-weak: #999999;--adm-color-light: #cccccc;--adm-color-border: #eeeeee;--adm-color-background: #ffffff;--adm-color-highlight: var(--adm-color-danger);--adm-color-white: #ffffff;--adm-color-box: #f5f5f5;--adm-color-text-light-solid: var(--adm-color-white);--adm-color-text-dark-solid: #000000;--adm-color-fill-content: var(--adm-color-box);--adm-font-size-main: var(--adm-font-size-5);--adm-font-family: -apple-system, blinkmacsystemfont, "Helvetica Neue", helvetica, segoe ui, arial, roboto, "PingFang SC", "miui", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;--adm-border-color: var(--adm-color-border)}html[data-prefers-color-scheme=dark]{--adm-color-primary: #3086ff;--adm-color-success: #34b368;--adm-color-warning: #ffa930;--adm-color-danger: #ff4a58;--adm-color-yellow: #ffa930;--adm-color-orange: #e65a2b;--adm-color-wathet: #0d2543;--adm-color-text: #e6e6e6;--adm-color-text-secondary: #b3b3b3;--adm-color-weak: #808080;--adm-color-light: #4d4d4d;--adm-color-border: #2b2b2b;--adm-color-box: #0a0a0a;--adm-color-background: #1a1a1a;--adm-color-background-body: var(--adm-color-background);--adm-border-color: var(--adm-color-border)}:root{-webkit-tap-highlight-color:rgba(0,0,0,0)}html{background-color:var(--adm-color-background-body)}body{color:var(--adm-color-text);font-size:var(--adm-font-size-main);font-family:var(--adm-font-family)}a,button{cursor:pointer}a{color:var(--adm-color-primary);transition:opacity ease-in-out .2s}a:active{opacity:.8}.adm-plain-anchor{color:unset;transition:none}.adm-plain-anchor:active{opacity:unset}body.adm-overflow-hidden{overflow:hidden!important}div.adm-px-tester{--size: 1;height:calc(var(--size) / 2 * 2px);width:0;position:fixed;
|
|
11
|
-
(function(
|
|
10
|
+
(function(){"use strict";try{if(typeof document!="undefined"){var a=document.createElement("style");a.id="@nocobase/plugin-mobile-client",a.appendChild(document.createTextNode(':root{--adm-radius-s: 4px;--adm-radius-m: 8px;--adm-radius-l: 12px;--adm-font-size-1: 9px;--adm-font-size-2: 10px;--adm-font-size-3: 11px;--adm-font-size-4: 12px;--adm-font-size-5: 13px;--adm-font-size-6: 14px;--adm-font-size-7: 15px;--adm-font-size-8: 16px;--adm-font-size-9: 17px;--adm-font-size-10: 18px;--adm-color-primary: #1677ff;--adm-color-success: #00b578;--adm-color-warning: #ff8f1f;--adm-color-danger: #ff3141;--adm-color-yellow: #ff9f18;--adm-color-orange: #ff6430;--adm-color-wathet: #e7f1ff;--adm-color-text: #333333;--adm-color-text-secondary: #666666;--adm-color-weak: #999999;--adm-color-light: #cccccc;--adm-color-border: #eeeeee;--adm-color-background: #ffffff;--adm-color-highlight: var(--adm-color-danger);--adm-color-white: #ffffff;--adm-color-box: #f5f5f5;--adm-color-text-light-solid: var(--adm-color-white);--adm-color-text-dark-solid: #000000;--adm-color-fill-content: var(--adm-color-box);--adm-font-size-main: var(--adm-font-size-5);--adm-font-family: -apple-system, blinkmacsystemfont, "Helvetica Neue", helvetica, segoe ui, arial, roboto, "PingFang SC", "miui", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;--adm-border-color: var(--adm-color-border)}html[data-prefers-color-scheme=dark]{--adm-color-primary: #3086ff;--adm-color-success: #34b368;--adm-color-warning: #ffa930;--adm-color-danger: #ff4a58;--adm-color-yellow: #ffa930;--adm-color-orange: #e65a2b;--adm-color-wathet: #0d2543;--adm-color-text: #e6e6e6;--adm-color-text-secondary: #b3b3b3;--adm-color-weak: #808080;--adm-color-light: #4d4d4d;--adm-color-border: #2b2b2b;--adm-color-box: #0a0a0a;--adm-color-background: #1a1a1a;--adm-color-background-body: var(--adm-color-background);--adm-border-color: var(--adm-color-border)}:root{-webkit-tap-highlight-color:rgba(0,0,0,0)}html{background-color:var(--adm-color-background-body)}body{color:var(--adm-color-text);font-size:var(--adm-font-size-main);font-family:var(--adm-font-family)}a,button{cursor:pointer}a{color:var(--adm-color-primary);transition:opacity ease-in-out .2s}a:active{opacity:.8}.adm-plain-anchor{color:unset;transition:none}.adm-plain-anchor:active{opacity:unset}body.adm-overflow-hidden{overflow:hidden!important}div.adm-px-tester{--size: 1;height:calc(var(--size) / 2 * 2px);width:0;position:fixed;left:-100vw;top:-100vh;-webkit-user-select:none;user-select:none;pointer-events:none}.adm-safe-area{--multiple: var(--adm-safe-area-multiple, 1);display:block;width:100%}.adm-safe-area-position-top{padding-top:calc(env(safe-area-inset-top) * var(--multiple))}.adm-safe-area-position-bottom{padding-bottom:calc(env(safe-area-inset-bottom) * var(--multiple))}.adm-badge-wrapper{display:inline-block;position:relative}.adm-badge{display:inline-flex;vertical-align:middle;box-sizing:content-box;border-radius:100px;background-color:var(--color);--right: 0;--top: 0;--color: var(--adm-badge-color, var(--adm-color-highlight))}.adm-badge-content{color:var(--adm-color-text-light-solid);box-sizing:border-box;min-width:8px;padding:1px 4px;font-size:var(--adm-font-size-1);line-height:12px;white-space:nowrap;font-weight:400;text-align:center}.adm-badge-fixed{position:absolute;right:var(--right);top:var(--top);transform:translate(50%,-50%)}.adm-badge-dot{min-width:10px;width:10px;height:10px;border-radius:5px}.adm-badge-bordered{border:solid 1px var(--adm-color-text-light-solid)}.adm-list{--header-font-size: var(--adm-font-size-7);--prefix-width: "auto";--prefix-padding-right: 12px;--align-items: center;--active-background-color: var(--adm-color-border);--border-inner: solid 1px var(--adm-color-border);--border-top: solid 1px var(--adm-color-border);--border-bottom: solid 1px var(--adm-color-border);--padding-left: 12px;--padding-right: 12px;--font-size: var(--adm-font-size-9);--extra-max-width: 70%}.adm-list-header{color:var(--adm-color-weak);font-size:var(--header-font-size);padding:8px var(--padding-right) 8px var(--padding-left)}.adm-list-body{background-color:var(--adm-color-background);overflow:hidden;font-size:var(--font-size)}.adm-list-body-inner{margin-top:-1px}.adm-list-default .adm-list-body{border-top:var(--border-top);border-bottom:var(--border-bottom)}.adm-list-card{margin:12px}.adm-list-card .adm-list-body{border-radius:8px}.adm-list-card .adm-list-header{padding-left:0}.adm-list-item{display:block;padding-left:var(--padding-left);position:relative;background-color:var(--adm-color-background);line-height:1.5}.adm-list-item-title,.adm-list-item-description{color:var(--adm-color-weak);font-size:var(--adm-font-size-main)}.adm-list-item-content{display:flex;align-items:var(--align-items);justify-content:flex-start;border-top:var(--border-inner);padding-right:var(--padding-right)}.adm-list-item-content-prefix{width:var(--prefix-width);flex:none;padding-right:var(--prefix-padding-right)}.adm-list-item-content-main{flex:auto;padding:12px 0}.adm-list-item-content-extra{flex:none;padding-left:12px;font-size:var(--adm-font-size-7);color:var(--adm-color-weak);max-width:var(--extra-max-width)}.adm-list-item-content-arrow{flex:none;display:flex;align-items:center;margin-left:4px;color:var(--adm-color-light);font-size:19px}.adm-list-item-disabled{cursor:not-allowed}.adm-list-item-disabled.adm-list-item-disabled>.adm-list-item-content>*{opacity:.4;pointer-events:none}a.adm-list-item:active:not(.adm-list-item-disabled){background-color:var(--active-background-color)}a.adm-list-item:active:not(.adm-list-item-disabled):after{content:" ";display:block;position:absolute;width:100%;bottom:-1px;left:0;border-bottom:var(--border-inner)}.adm-nav-bar{--height: 45px;--border-bottom: none;display:flex;align-items:center;height:var(--height);border-bottom:var(--border-bottom);padding:0 12px;white-space:nowrap}.adm-nav-bar-left,.adm-nav-bar-right{flex:1}.adm-nav-bar-title{flex:auto;text-align:center;overflow:hidden;text-overflow:ellipsis}.adm-nav-bar-back{display:flex;align-items:center;margin-right:16px;padding:6px 0;cursor:pointer}.adm-nav-bar-back-arrow{font-size:24px;margin-right:4px}.adm-nav-bar-left{font-size:var(--adm-font-size-7);display:flex;justify-content:flex-start;align-items:center}.adm-nav-bar-title{justify-content:center;white-space:nowrap;font-size:var(--adm-font-size-10);padding:0 12px}.adm-nav-bar-right{text-align:right}.adm-tab-bar-wrap{display:flex;flex-wrap:nowrap;justify-content:flex-start;align-items:stretch;overflow:hidden;min-height:48px}.adm-tab-bar-item{flex:1;color:var(--adm-color-text-secondary);white-space:nowrap;padding:4px 8px;width:-webkit-min-content;width:min-content;position:relative;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-direction:column}.adm-tab-bar-item-icon{font-size:24px;height:24px;line-height:1}.adm-tab-bar-item-title{font-size:var(--adm-font-size-2);line-height:15px}.adm-tab-bar-item-title-with-icon{margin-top:2px}.adm-tab-bar-item-active{color:var(--adm-color-primary)}.adm-tab-bar-icon-badge{--top: 6px}.adm-tab-bar-title-badge{--right: -2px;--top: -2px}')),document.head.appendChild(a)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
11
|
+
(function(p,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("react/jsx-runtime"),require("@nocobase/client"),require("react-router-dom"),require("react"),require("react-i18next"),require("@ant-design/icons"),require("@formily/react"),require("antd"),require("lodash"),require("ahooks"),require("@formily/shared"),require("@formily/antd-v5")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@nocobase/client","react-router-dom","react","react-i18next","@ant-design/icons","@formily/react","antd","lodash","ahooks","@formily/shared","@formily/antd-v5"],n):(p=typeof globalThis!="undefined"?globalThis:p||self,n(p["@nocobase/plugin-mobile-client"]={},p.jsxRuntime,p["@nocobase/client"],p["react-router-dom"],p.react,p["react-i18next"],p["@ant-design/icons"],p["@formily/react"],p.antd,p.lodash,p.ahooks,p["@formily/shared"],p["@formily/antd-v5"]))})(this,function(p,n,t,h,c,ae,T,f,C,q,ie,se,Ye){"use strict";var tn=Object.defineProperty,nn=Object.defineProperties;var on=Object.getOwnPropertyDescriptors;var Ze=Object.getOwnPropertySymbols;var rn=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable;var Se=(p,n,t)=>n in p?tn(p,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[n]=t,S=(p,n)=>{for(var t in n||(n={}))rn.call(n,t)&&Se(p,t,n[t]);if(Ze)for(var t of Ze(n))an.call(n,t)&&Se(p,t,n[t]);return p},N=(p,n)=>nn(p,on(n));var Qe=(p,n,t)=>(Se(p,typeof n!="symbol"?n+"":n,t),t);var A=(p,n,t)=>new Promise((h,c)=>{var ae=C=>{try{f(t.next(C))}catch(q){c(q)}},T=C=>{try{f(t.throw(C))}catch(q){c(q)}},f=C=>C.done?h(C.value):Promise.resolve(C.value).then(ae,T);f((t=t.apply(p,n)).next())});function Re(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const M=Re(c),Ce=()=>window.JsBridge,et=(e,o)=>Ce().invoke(e,o),tt=()=>!!Ce(),Ie={onBackPressed:()=>{history.length===1?et({action:"moveTaskToBack"}):history.back()}};Object.keys(Ie).forEach(e=>{window[e]=Ie[e]});const $e=c.memo(e=>{const o=h.useLocation(),r=t.useNavigateNoUpdate();return c.useEffect(()=>{tt()&&o.pathname==="/admin"&&r("/mobile",{replace:!0})},[o.pathname,r]),n.jsx(n.Fragment,{children:e.children})});$e.displayName="MobileClientProvider";const F="mobile-client";function O(e){return`{{t('${e}', { ns: '${F}', nsMode: 'fallback' })}}`}function w(){return ae.useTranslation([F,"client"],{nsMode:"fallback"})}const we={name:"mobilePage:addBlock",title:'{{t("Add block")}}',icon:"PlusOutlined",wrap:t.gridRowColWrap,items:[{name:"dataBlocks",type:"itemGroup",title:'{{t("Data blocks")}}',children:[{name:"gridCard",type:"item",title:'{{t("Grid Card")}}',Component:"GridCardBlockInitializer"},{name:"table",title:'{{t("Table")}}',Component:"TableBlockInitializer"},{name:"form",title:'{{t("Form")}}',Component:"FormBlockInitializer"},{name:"details",title:'{{t("Details")}}',Component:"DetailsBlockInitializer"},{name:"calendar",title:'{{t("Calendar")}}',Component:"CalendarBlockInitializer"},{name:"mapBlock",title:O("Map"),Component:"MapBlockInitializer"},{name:"charts",title:'{{t("Charts")}}',Component:"ChartV2BlockInitializer"}]},{name:"otherBlocks",type:"itemGroup",title:'{{t("Other blocks")}}',children:[{name:"menu",title:O("Menu"),Component:"MMenuBlockInitializer"},{name:"markdown",title:'{{t("Markdown")}}',Component:"MarkdownBlockInitializer"},{name:"settings",title:O("Settings"),Component:"MSettingsBlockInitializer"}]}]},Pe=new t.CompatibleSchemaInitializer(N(S({},we),{name:"MBlockInitializers"})),nt=new t.CompatibleSchemaInitializer(we,Pe),ot=()=>{const e=t.useSchemaInitializerItem(),{insert:o}=t.useSchemaInitializer();return n.jsx(t.SchemaInitializerItem,S({icon:n.jsx(T.MenuOutlined,{}),onClick:()=>A(this,null,function*(){o({type:"void","x-component":"MMenu","x-designer":"MMenu.Designer","x-component-props":{}})})},e))};!!(typeof window!="undefined"&&typeof document!="undefined"&&window.document&&window.document.createElement)&&document.addEventListener("touchstart",()=>{},!0);const I="${label}不是一个有效的${type}",rt={current:{locale:{locale:"zh-CH",common:{confirm:"确定",cancel:"取消",loading:"加载中",close:"关闭"},Calendar:{title:"日期选择",confirm:"确认",start:"开始",end:"结束",today:"今日",markItems:["一","二","三","四","五","六","日"],yearAndMonth:"${year}年${month}月"},Cascader:{placeholder:"请选择"},Dialog:{ok:"我知道了"},DatePicker:{tillNow:"至今"},ErrorBlock:{default:{title:"页面遇到一些小问题",description:"待会来试试"},busy:{title:"前方拥堵",description:"刷新试试"},disconnected:{title:"网络有点忙",description:"动动手指帮忙修复"},empty:{title:"没有找到你需要的东西",description:"找找其他的吧"}},Form:{required:"必填",optional:"选填",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:I,method:I,array:I,object:I,number:I,date:I,boolean:I,integer:I,float:I,regexp:I,email:I,url:I,hex:I},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}"}}},ImageUploader:{uploading:"上传中...",upload:"上传"},InfiniteScroll:{noMore:"没有更多了",failedToLoad:"加载失败",retry:"重新加载"},Input:{clear:"清除"},Mask:{name:"背景蒙层"},Modal:{ok:"我知道了"},PasscodeInput:{name:"密码输入框"},PullToRefresh:{pulling:"下拉刷新",canRelease:"释放立即刷新",complete:"刷新成功"},SearchBar:{name:"搜索框"},Slider:{name:"滑动输入条"},Stepper:{decrease:"减少",increase:"增加"},Switch:{name:"开关"},Selector:{name:"选择组"}}}};function at(){return rt.current}const it=c.createContext(null);function Me(){var e;return(e=c.useContext(it))!==null&&e!==void 0?e:at()}function le(e,o){const r=e;for(const a in o)o.hasOwnProperty(a)&&(r[a]=o[a]);return r}function st(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ke={exports:{}};/*!
|
|
12
12
|
Copyright (c) 2018 Jed Watson.
|
|
13
13
|
Licensed under the MIT License (MIT), see
|
|
14
14
|
http://jedwatson.github.io/classnames
|
|
15
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var c="",d=0;d<arguments.length;d++){var s=arguments[d];s&&(c=i(c,a(s)))}return c}function a(c){if(typeof c=="string"||typeof c=="number")return c;if(typeof c!="object")return"";if(Array.isArray(c))return n.apply(null,c);if(c.toString!==Object.prototype.toString&&!c.toString.toString().includes("[native code]"))return c.toString();var d="";for(var s in c)t.call(c,s)&&c[s]&&(d=i(d,s));return d}function i(c,d){return d?c?c+" "+d:c+d:c}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Fe);var Nt=Fe.exports;const M=_e(Nt);function D(e,t){const n=Object.assign({},t.props);e.className&&(n.className=M(t.props.className,e.className)),e.style&&(n.style=Object.assign(Object.assign({},n.style),e.style)),e.tabIndex!==void 0&&(n.tabIndex=e.tabIndex);for(const a in e)e.hasOwnProperty(a)&&(a.startsWith("data-")||a.startsWith("aria-"))&&(n[a]=e[a]);return l.cloneElement(t,n)}var At=typeof J=="object"&&J&&J.Object===Object&&J,De=At,jt=De,_t=typeof self=="object"&&self&&self.Object===Object&&self,Ft=jt||_t||Function("return this")(),me=Ft,Dt=me,Lt=Dt.Symbol,Le=Lt,ze=Le,Ge=Object.prototype,zt=Ge.hasOwnProperty,Gt=Ge.toString,V=ze?ze.toStringTag:void 0;function Ut(e){var t=zt.call(e,V),n=e[V];try{e[V]=void 0;var a=!0}catch(c){}var i=Gt.call(e);return a&&(t?e[V]=n:delete e[V]),i}var qt=Ut,Vt=Object.prototype,Ht=Vt.toString;function Kt(e){return Ht.call(e)}var Wt=Kt,Ue=Le,Jt=qt,Xt=Wt,Zt="[object Null]",Qt="[object Undefined]",qe=Ue?Ue.toStringTag:void 0;function Yt(e){return e==null?e===void 0?Qt:Zt:qe&&qe in Object(e)?Jt(e):Xt(e)}var fe=Yt;function Rt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ge=Rt,en=fe,tn=ge,nn="[object AsyncFunction]",rn="[object Function]",on="[object GeneratorFunction]",an="[object Proxy]";function sn(e){if(!tn(e))return!1;var t=en(e);return t==rn||t==on||t==nn||t==an}var Ve=sn,cn=me,ln=cn["__core-js_shared__"],dn=ln,be=dn,He=function(){var e=/[^.]+$/.exec(be&&be.keys&&be.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function pn(e){return!!He&&He in e}var un=pn,mn=Function.prototype,fn=mn.toString;function gn(e){if(e!=null){try{return fn.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var bn=gn,hn=Ve,vn=un,yn=ge,xn=bn,Sn=/[\\^$.*+?()[\]{}|]/g,$n=/^\[object .+?Constructor\]$/,Cn=Function.prototype,In=Object.prototype,Pn=Cn.toString,wn=In.hasOwnProperty,Tn=RegExp("^"+Pn.call(wn).replace(Sn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mn(e){if(!yn(e)||vn(e))return!1;var t=hn(e)?Tn:$n;return t.test(xn(e))}var On=Mn;function En(e,t){return e==null?void 0:e[t]}var kn=En,Bn=On,Nn=kn;function An(e,t){var n=Nn(e,t);return Bn(n)?n:void 0}var jn=An,_n=jn,Fn=function(){try{var e=_n(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Ke=Fn,We=Ke;function Dn(e,t,n){t=="__proto__"&&We?We(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Je=Dn;function Ln(e,t){return e===t||e!==e&&t!==t}var Xe=Ln,zn=Je,Gn=Xe,Un=Object.prototype,qn=Un.hasOwnProperty;function Vn(e,t,n){var a=e[t];(!(qn.call(e,t)&&Gn(a,n))||n===void 0&&!(t in e))&&zn(e,t,n)}var Hn=Vn,Kn=Hn,Wn=Je;function Jn(e,t,n,a){var i=!n;n||(n={});for(var c=-1,d=t.length;++c<d;){var s=t[c],u=a?a(n[s],e[s],s,n,e):void 0;u===void 0&&(u=e[s]),i?Wn(n,s,u):Kn(n,s,u)}return n}var Xn=Jn;function Zn(e){return e}var Ze=Zn;function Qn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Yn=Qn,Rn=Yn,Qe=Math.max;function er(e,t,n){return t=Qe(t===void 0?e.length-1:t,0),function(){for(var a=arguments,i=-1,c=Qe(a.length-t,0),d=Array(c);++i<c;)d[i]=a[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=a[i];return s[t]=n(d),Rn(e,this,s)}}var tr=er;function nr(e){return function(){return e}}var rr=nr,or=rr,Ye=Ke,ar=Ze,ir=Ye?function(e,t){return Ye(e,"toString",{configurable:!0,enumerable:!1,value:or(t),writable:!0})}:ar,sr=ir,cr=800,lr=16,dr=Date.now;function pr(e){var t=0,n=0;return function(){var a=dr(),i=lr-(a-n);if(n=a,i>0){if(++t>=cr)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var ur=pr,mr=sr,fr=ur,gr=fr(mr),br=gr,hr=Ze,vr=tr,yr=br;function xr(e,t){return yr(vr(e,t,hr),e+"")}var Sr=xr,$r=9007199254740991;function Cr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$r}var Re=Cr,Ir=Ve,Pr=Re;function wr(e){return e!=null&&Pr(e.length)&&!Ir(e)}var et=wr,Tr=9007199254740991,Mr=/^(?:0|[1-9]\d*)$/;function Or(e,t){var n=typeof e;return t=t==null?Tr:t,!!t&&(n=="number"||n!="symbol"&&Mr.test(e))&&e>-1&&e%1==0&&e<t}var tt=Or,Er=Xe,kr=et,Br=tt,Nr=ge;function Ar(e,t,n){if(!Nr(n))return!1;var a=typeof t;return(a=="number"?kr(n)&&Br(t,n.length):a=="string"&&t in n)?Er(n[t],e):!1}var jr=Ar,_r=Sr,Fr=jr;function Dr(e){return _r(function(t,n){var a=-1,i=n.length,c=i>1?n[i-1]:void 0,d=i>2?n[2]:void 0;for(c=e.length>3&&typeof c=="function"?(i--,c):void 0,d&&Fr(n[0],n[1],d)&&(c=i<3?void 0:c,i=1),t=Object(t);++a<i;){var s=n[a];s&&e(t,s,a,c)}return t})}var Lr=Dr;function zr(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a}var Gr=zr;function Ur(e){return e!=null&&typeof e=="object"}var he=Ur,qr=fe,Vr=he,Hr="[object Arguments]";function Kr(e){return Vr(e)&&qr(e)==Hr}var Wr=Kr,nt=Wr,Jr=he,rt=Object.prototype,Xr=rt.hasOwnProperty,Zr=rt.propertyIsEnumerable,Qr=nt(function(){return arguments}())?nt:function(e){return Jr(e)&&Xr.call(e,"callee")&&!Zr.call(e,"callee")},Yr=Qr,Rr=Array.isArray,eo=Rr,X={exports:{}};function to(){return!1}var no=to;X.exports,function(e,t){var n=me,a=no,i=t&&!t.nodeType&&t,c=i&&!0&&e&&!e.nodeType&&e,d=c&&c.exports===i,s=d?n.Buffer:void 0,u=s?s.isBuffer:void 0,p=u||a;e.exports=p}(X,X.exports);var ro=X.exports,oo=fe,ao=Re,io=he,so="[object Arguments]",co="[object Array]",lo="[object Boolean]",po="[object Date]",uo="[object Error]",mo="[object Function]",fo="[object Map]",go="[object Number]",bo="[object Object]",ho="[object RegExp]",vo="[object Set]",yo="[object String]",xo="[object WeakMap]",So="[object ArrayBuffer]",$o="[object DataView]",Co="[object Float32Array]",Io="[object Float64Array]",Po="[object Int8Array]",wo="[object Int16Array]",To="[object Int32Array]",Mo="[object Uint8Array]",Oo="[object Uint8ClampedArray]",Eo="[object Uint16Array]",ko="[object Uint32Array]",h={};h[Co]=h[Io]=h[Po]=h[wo]=h[To]=h[Mo]=h[Oo]=h[Eo]=h[ko]=!0,h[so]=h[co]=h[So]=h[lo]=h[$o]=h[po]=h[uo]=h[mo]=h[fo]=h[go]=h[bo]=h[ho]=h[vo]=h[yo]=h[xo]=!1;function Bo(e){return io(e)&&ao(e.length)&&!!h[oo(e)]}var No=Bo;function Ao(e){return function(t){return e(t)}}var jo=Ao,Z={exports:{}};Z.exports,function(e,t){var n=De,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,c=i&&i.exports===a,d=c&&n.process,s=function(){try{var u=i&&i.require&&i.require("util").types;return u||d&&d.binding&&d.binding("util")}catch(p){}}();e.exports=s}(Z,Z.exports);var _o=Z.exports,Fo=No,Do=jo,ot=_o,at=ot&&ot.isTypedArray,Lo=at?Do(at):Fo,zo=Lo,Go=Gr,Uo=Yr,qo=eo,Vo=ro,Ho=tt,Ko=zo,Wo=Object.prototype,Jo=Wo.hasOwnProperty;function Xo(e,t){var n=qo(e),a=!n&&Uo(e),i=!n&&!a&&Vo(e),c=!n&&!a&&!i&&Ko(e),d=n||a||i||c,s=d?Go(e.length,String):[],u=s.length;for(var p in e)(t||Jo.call(e,p))&&!(d&&(p=="length"||i&&(p=="offset"||p=="parent")||c&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||Ho(p,u)))&&s.push(p);return s}var Zo=Xo,Qo=Object.prototype;function Yo(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Qo;return e===n}var Ro=Yo;function ea(e,t){return function(n){return e(t(n))}}var ta=ea,na=ta,ra=na(Object.keys,Object),oa=ra,aa=Ro,ia=oa,sa=Object.prototype,ca=sa.hasOwnProperty;function la(e){if(!aa(e))return ia(e);var t=[];for(var n in Object(e))ca.call(e,n)&&n!="constructor"&&t.push(n);return t}var da=la,pa=Zo,ua=da,ma=et;function fa(e){return ma(e)?pa(e):ua(e)}var ga=fa,ba=Xn,ha=Lr,va=ga,ya=ha(function(e,t,n,a){ba(t,va(t),e,a)}),xa=ya;const Sa=_e(xa);function ve(...e){function t(a,i){return i===void 0?a:i}let n=Object.assign({},e[0]);for(let a=1;a<e.length;a++)n=Sa(n,e[a],t);return n}function $a(e){return T.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e,{style:Object.assign({verticalAlign:"-0.125em"},e.style),className:["antd-mobile-icon",e.className].filter(Boolean).join(" ")}),T.createElement("g",{id:"LeftOutline-LeftOutline",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},T.createElement("g",{id:"LeftOutline-编组"},T.createElement("rect",{id:"LeftOutline-矩形",fill:"#FFFFFF",opacity:0,x:0,y:0,width:48,height:48}),T.createElement("path",{d:"M31.7053818,5.11219264 L13.5234393,22.6612572 L13.5234393,22.6612572 C12.969699,23.2125856 12.9371261,24.0863155 13.4257204,24.6755735 L13.5234393,24.7825775 L31.7045714,42.8834676 C31.7795345,42.9580998 31.8810078,43 31.9867879,43 L35.1135102,43 C35.3344241,43 35.5135102,42.8209139 35.5135102,42.6 C35.5135102,42.4936115 35.4711279,42.391606 35.3957362,42.316542 L16.7799842,23.7816937 L16.7799842,23.7816937 L35.3764658,5.6866816 C35.5347957,5.53262122 35.5382568,5.27937888 35.3841964,5.121049 C35.3088921,5.04365775 35.205497,5 35.0975148,5 L31.9831711,5 C31.8795372,5 31.7799483,5.04022164 31.7053818,5.11219264 Z",id:"LeftOutline-路径",fill:"currentColor",fillRule:"nonzero"}))))}function Ca(e){return T.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e,{style:Object.assign({verticalAlign:"-0.125em"},e.style),className:["antd-mobile-icon",e.className].filter(Boolean).join(" ")}),T.createElement("g",{id:"RightOutline-RightOutline",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},T.createElement("g",{id:"RightOutline-RightOutlined"},T.createElement("rect",{id:"RightOutline-矩形",fill:"#FFFFFF",opacity:0,x:0,y:0,width:48,height:48}),T.createElement("path",{d:"M17.3947957,5.11219264 L35.5767382,22.6612572 L35.5767382,22.6612572 C36.1304785,23.2125856 36.1630514,24.0863155 35.6744571,24.6755735 L35.5767382,24.7825775 L17.3956061,42.8834676 C17.320643,42.9580998 17.2191697,43 17.1133896,43 L13.9866673,43 C13.7657534,43 13.5866673,42.8209139 13.5866673,42.6 C13.5866673,42.4936115 13.6290496,42.391606 13.7044413,42.316542 L32.3201933,23.7816937 L32.3201933,23.7816937 L13.7237117,5.6866816 C13.5653818,5.53262122 13.5619207,5.27937888 13.7159811,5.121049 C13.7912854,5.04365775 13.8946805,5 14.0026627,5 L17.1170064,5 C17.2206403,5 17.3202292,5.04022164 17.3947957,5.11219264 Z",id:"RightOutline-right",fill:"currentColor",fillRule:"nonzero"}))))}const it="adm-safe-area",Ia=e=>D(e,l.createElement("div",{className:M(it,`${it}-position-${e.position}`)})),z="adm-badge",st=l.createElement(l.Fragment,null),ct=ue(e=>{const{content:t,color:n,children:a}=e,i=t===st,c=M(z,{[`${z}-fixed`]:!!a,[`${z}-dot`]:i,[`${z}-bordered`]:e.bordered}),d=t||t===0?D(e,l.createElement("div",{className:c,style:{"--color":n}},!i&&l.createElement("div",{className:`${z}-content`},t))):null;return a?l.createElement("div",{className:M(`${z}-wrapper`,e.wrapperClassName),style:e.wrapperStyle},a,d):d},{dot:st});function Pa(e){const{value:t,defaultValue:n,onChange:a}=e,i=de.useUpdate(),c=l.useRef(t!==void 0?t:n);t!==void 0&&(c.current=t);const d=de.useMemoizedFn((s,u=!1)=>{const p=typeof s=="function"?s(c.current):s;if(!(!u&&p===c.current))return c.current=p,i(),a==null?void 0:a(p)});return[c.current,d]}var lt={exports:{}},g={};/**
|
|
15
|
+
*/(function(e){(function(){var o={}.hasOwnProperty;function r(){for(var l="",d=0;d<arguments.length;d++){var i=arguments[d];i&&(l=s(l,a(i)))}return l}function a(l){if(typeof l=="string"||typeof l=="number")return l;if(typeof l!="object")return"";if(Array.isArray(l))return r.apply(null,l);if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]"))return l.toString();var d="";for(var i in l)o.call(l,i)&&l[i]&&(d=s(d,i));return d}function s(l,d){return d?l?l+" "+d:l+d:l}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(ke);var lt=ke.exports;const k=st(lt);function L(e,o){const r=Object.assign({},o.props);e.className&&(r.className=k(o.props.className,e.className)),e.style&&(r.style=Object.assign(Object.assign({},r.style),e.style)),e.tabIndex!==void 0&&(r.tabIndex=e.tabIndex);for(const a in e)e.hasOwnProperty(a)&&(a.startsWith("data-")||a.startsWith("aria-"))&&(r[a]=e[a]);return c.cloneElement(o,r)}function ce(...e){const o={};return e.forEach(r=>{r&&Object.keys(r).forEach(a=>{r[a]!==void 0&&(o[a]=r[a])})}),o}function Be(e,...o){for(let r=o.length-1;r>=0;r-=1)if(o[r]!==void 0)return o[r];return e}function ct(e){return M.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e,{style:Object.assign({verticalAlign:"-0.125em"},e.style),className:["antd-mobile-icon",e.className].filter(Boolean).join(" ")}),M.createElement("g",{id:"LeftOutline-LeftOutline",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},M.createElement("g",{id:"LeftOutline-编组"},M.createElement("rect",{id:"LeftOutline-矩形",fill:"#FFFFFF",opacity:0,x:0,y:0,width:48,height:48}),M.createElement("path",{d:"M31.7053818,5.11219264 L13.5234393,22.6612572 L13.5234393,22.6612572 C12.969699,23.2125856 12.9371261,24.0863155 13.4257204,24.6755735 L13.5234393,24.7825775 L31.7045714,42.8834676 C31.7795345,42.9580998 31.8810078,43 31.9867879,43 L35.1135102,43 C35.3344241,43 35.5135102,42.8209139 35.5135102,42.6 C35.5135102,42.4936115 35.4711279,42.391606 35.3957362,42.316542 L16.7799842,23.7816937 L16.7799842,23.7816937 L35.3764658,5.6866816 C35.5347957,5.53262122 35.5382568,5.27937888 35.3841964,5.121049 C35.3088921,5.04365775 35.205497,5 35.0975148,5 L31.9831711,5 C31.8795372,5 31.7799483,5.04022164 31.7053818,5.11219264 Z",id:"LeftOutline-路径",fill:"currentColor",fillRule:"nonzero"}))))}function dt(e){return M.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e,{style:Object.assign({verticalAlign:"-0.125em"},e.style),className:["antd-mobile-icon",e.className].filter(Boolean).join(" ")}),M.createElement("g",{id:"RightOutline-RightOutline",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},M.createElement("g",{id:"RightOutline-RightOutlined"},M.createElement("rect",{id:"RightOutline-矩形",fill:"#FFFFFF",opacity:0,x:0,y:0,width:48,height:48}),M.createElement("path",{d:"M17.3947957,5.11219264 L35.5767382,22.6612572 L35.5767382,22.6612572 C36.1304785,23.2125856 36.1630514,24.0863155 35.6744571,24.6755735 L35.5767382,24.7825775 L17.3956061,42.8834676 C17.320643,42.9580998 17.2191697,43 17.1133896,43 L13.9866673,43 C13.7657534,43 13.5866673,42.8209139 13.5866673,42.6 C13.5866673,42.4936115 13.6290496,42.391606 13.7044413,42.316542 L32.3201933,23.7816937 L32.3201933,23.7816937 L13.7237117,5.6866816 C13.5653818,5.53262122 13.5619207,5.27937888 13.7159811,5.121049 C13.7912854,5.04365775 13.8946805,5 14.0026627,5 L17.1170064,5 C17.2206403,5 17.3202292,5.04022164 17.3947957,5.11219264 Z",id:"RightOutline-right",fill:"currentColor",fillRule:"nonzero"}))))}const Ee="adm-safe-area",mt=e=>L(e,c.createElement("div",{className:k(Ee,`${Ee}-position-${e.position}`)})),G="adm-badge",Ne=c.createElement(c.Fragment,null),Te=le(e=>{const{content:o,color:r,children:a}=e,s=o===Ne,l=k(G,{[`${G}-fixed`]:!!a,[`${G}-dot`]:s,[`${G}-bordered`]:e.bordered}),d=o||o===0?L(e,c.createElement("div",{className:l,style:{"--color":r}},!s&&c.createElement("div",{className:`${G}-content`},o))):null;return a?c.createElement("div",{className:k(`${G}-wrapper`,e.wrapperClassName),style:e.wrapperStyle},a,d):d},{dot:Ne});function pt(e){const{value:o,defaultValue:r,onChange:a}=e,s=ie.useUpdate(),l=c.useRef(o!==void 0?o:r);o!==void 0&&(l.current=o);const d=ie.useMemoizedFn((i,b=!1)=>{const m=typeof i=="function"?i(l.current):i;if(!(!b&&m===l.current))return l.current=m,s(),a==null?void 0:a(m)});return[l.current,d]}var Fe={exports:{}},u={};/**
|
|
16
16
|
* @license React
|
|
17
17
|
* react-is.production.min.js
|
|
18
18
|
*
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the MIT license found in the
|
|
22
22
|
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/var
|
|
23
|
+
*/var de=Symbol.for("react.element"),me=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),Z=Symbol.for("react.context"),ut=Symbol.for("react.server_context"),Q=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),bt=Symbol.for("react.offscreen"),Oe;Oe=Symbol.for("react.module.reference");function $(e){if(typeof e=="object"&&e!==null){var o=e.$$typeof;switch(o){case de:switch(e=e.type,e){case W:case J:case K:case Y:case R:return e;default:switch(e=e&&e.$$typeof,e){case ut:case Z:case Q:case te:case ee:case X:return e;default:return o}}case me:return o}}}u.ContextConsumer=Z,u.ContextProvider=X,u.Element=de,u.ForwardRef=Q,u.Fragment=W,u.Lazy=te,u.Memo=ee,u.Portal=me,u.Profiler=J,u.StrictMode=K,u.Suspense=Y,u.SuspenseList=R,u.isAsyncMode=function(){return!1},u.isConcurrentMode=function(){return!1},u.isContextConsumer=function(e){return $(e)===Z},u.isContextProvider=function(e){return $(e)===X},u.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===de},u.isForwardRef=function(e){return $(e)===Q},u.isFragment=function(e){return $(e)===W},u.isLazy=function(e){return $(e)===te},u.isMemo=function(e){return $(e)===ee},u.isPortal=function(e){return $(e)===me},u.isProfiler=function(e){return $(e)===J},u.isStrictMode=function(e){return $(e)===K},u.isSuspense=function(e){return $(e)===Y},u.isSuspenseList=function(e){return $(e)===R},u.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===W||e===J||e===K||e===Y||e===R||e===bt||typeof e=="object"&&e!==null&&(e.$$typeof===te||e.$$typeof===ee||e.$$typeof===X||e.$$typeof===Z||e.$$typeof===Q||e.$$typeof===Oe||e.getModuleId!==void 0)},u.typeOf=$,Fe.exports=u;var gt=Fe.exports;function ft(e,o){let r=0;function a(s){c.Children.forEach(s,l=>{gt.isFragment(l)?a(l.props.children):(o(l,r),r+=1)})}a(e)}const H="adm-list",ht={mode:"default"},xt=c.forwardRef((e,o)=>{const r=ce(ht,e),a=c.useRef(null);return c.useImperativeHandle(o,()=>({get nativeElement(){return a.current}})),L(r,c.createElement("div",{className:k(H,`${H}-${r.mode}`),ref:a},r.header&&c.createElement("div",{className:`${H}-header`},r.header),c.createElement("div",{className:`${H}-body`},c.createElement("div",{className:`${H}-body-inner`},r.children))))});function ne(e){return e!=null&&e!==!1}const B="adm-list-item",oe=le(xt,{Item:e=>{var o,r;const{arrow:a,arrowIcon:s}=e,{list:l={}}=Me(),d=(o=e.clickable)!==null&&o!==void 0?o:!!e.onClick,i=(r=a!=null?a:s)!==null&&r!==void 0?r:d,b=Be(l.arrowIcon,a!==!0?a:null,s!==!0?s:null),m=c.createElement("div",{className:`${B}-content`},ne(e.prefix)&&c.createElement("div",{className:`${B}-content-prefix`},e.prefix),c.createElement("div",{className:`${B}-content-main`},ne(e.title)&&c.createElement("div",{className:`${B}-title`},e.title),e.children,ne(e.description)&&c.createElement("div",{className:`${B}-description`},e.description)),ne(e.extra)&&c.createElement("div",{className:`${B}-content-extra`},e.extra),i&&c.createElement("div",{className:`${B}-content-arrow`},b||c.createElement(dt,null)));return L(e,c.createElement(d?"a":"div",{className:k(`${B}`,d?["adm-plain-anchor"]:[],e.disabled&&`${B}-disabled`),onClick:e.disabled?void 0:e.onClick},m))}}),_="adm-nav-bar",De=c.createElement(ct,null),vt=e=>{const{navBar:o={}}=Me(),r=ce(o,e),{back:a,backIcon:s,backArrow:l}=r,d=o.backIcon||De,i=Be(De,o.backIcon,l===!0?d:l,s===!0?d:s);return L(r,c.createElement("div",{className:k(_)},c.createElement("div",{className:`${_}-left`,role:"button"},a!==null&&c.createElement("div",{className:`${_}-back`,onClick:r.onBack},i&&c.createElement("span",{className:`${_}-back-arrow`},i),c.createElement("span",{"aria-hidden":"true"},a)),r.left),c.createElement("div",{className:`${_}-title`},r.children),c.createElement("div",{className:`${_}-right`},r.right)))},yt=()=>null,E="adm-tab-bar",St={safeArea:!1},pe=le(e=>{var o;const r=ce(St,e);let a=null;const s=[];ft(r.children,(i,b)=>{if(!c.isValidElement(i))return;const m=i.key;typeof m=="string"&&(b===0&&(a=m),s.push(i))});const[l,d]=pt({value:r.activeKey,defaultValue:(o=r.defaultActiveKey)!==null&&o!==void 0?o:a,onChange:i=>{var b;i!==null&&((b=r.onChange)===null||b===void 0||b.call(r,i))}});return L(r,c.createElement("div",{className:E},c.createElement("div",{className:`${E}-wrap`},s.map(i=>{const b=i.key===l;function m(){const g=i.props.icon&&c.createElement("div",{className:`${E}-item-icon`},typeof i.props.icon=="function"?i.props.icon(b):i.props.icon),x=i.props.title&&c.createElement("div",{className:k(`${E}-item-title`,!!g&&`${E}-item-title-with-icon`)},typeof i.props.title=="function"?i.props.title(b):i.props.title);return g?c.createElement(c.Fragment,null,c.createElement(Te,{content:i.props.badge,className:`${E}-icon-badge`},g),x):x?c.createElement(Te,{content:i.props.badge,className:`${E}-title-badge`},x):null}return L(i.props,c.createElement("div",{key:i.key,onClick:()=>{var g,x;const{key:y}=i;y!=null&&(d(y.toString()),(x=(g=i.props).onClick)===null||x===void 0||x.call(g))},className:k(`${E}-item`,{[`${E}-item-active`]:b})},m()))})),r.safeArea&&c.createElement(mt,{position:"bottom"})))},{Item:yt}),ze={type:"void","x-component":"MPage","x-designer":"MPage.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"mobilePage:addBlock","x-component-props":{showDivider:!1}}}},Ct=e=>{const{t:o}=w(),r=f.useFieldSchema(),{dn:a}=t.useDesignable(),s=f.useField(),l={dn:a,field:s,fieldSchema:r};return n.jsx(t.SchemaSettingsDropdown,N(S({title:n.jsx(C.Button,{style:{borderColor:"var(--colorSettings)",color:"var(--colorSettings)"},icon:n.jsx(T.MenuOutlined,{}),type:"dashed",children:o("Menu configuration")})},l),{children:n.jsx(t.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,confirm:{title:o("Delete menu block")},breakRemoveOn:{"x-component":"Grid"}},"remove")}))},V=()=>{const{dn:e}=t.useDesignable(),o=f.useFieldSchema(),r=f.useField();return{onUpdateComponentProps:ie.useMemoizedFn(s=>A(this,null,function*(){q.set(o,"x-component-props",s),r.componentProps=S(S({},r.componentProps),s),yield e.emit("patch",{schema:{"x-uid":o["x-uid"],"x-component-props":o["x-component-props"],"x-server-hooks":[{type:"onSelfSave",method:"extractTextToLocale"}]}}),yield e.refresh()}))}},Ae={properties:{name:{type:"string",title:O("Menu name"),required:!0,"x-component":"Input","x-decorator":"FormItem"},icon:{"x-decorator":"FormItem","x-component":"IconPicker",title:O("Icon"),"x-component-props":{}}}},It=e=>{const{icon:o,name:r}=e,a=t.useDesigner(),s=h.useNavigate(),l=h.useLocation(),d=f.useFieldSchema(),i=t.useCompile(),b=h.useParams(),m=()=>{const g=l.pathname.endsWith("/")?l.pathname.slice(0,-1):l.pathname;s(b.name?`/mobile/${d["x-uid"]}`:`${g}/${d["x-uid"]}`)};return n.jsxs(t.SortableItem,{className:t.cx("nb-mobile-menu-item",t.css`
|
|
24
24
|
width: 100%;
|
|
25
25
|
background: var(--adm-color-background);
|
|
26
26
|
> .adm-list-item {
|
|
27
27
|
background: inherit;
|
|
28
28
|
}
|
|
29
|
-
`),children:[
|
|
29
|
+
`),children:[n.jsx(oe.Item,N(S({arrow:!0,clickable:!0},e),{prefix:n.jsx(t.Icon,{type:o}),onClick:m,children:i(r)})),n.jsx(a,{})]})},$t=()=>{const{t:e}=w(),{onUpdateComponentProps:o}=V(),r=f.useField();return n.jsxs(t.GeneralSchemaDesigner,{children:[n.jsx(t.SchemaSettingsModalItem,{title:e("Edit menu info"),initialValues:r.componentProps,schema:Ae,onSubmit:o}),n.jsx(t.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,confirm:{title:e("Delete menu item?")},breakRemoveOn:{"x-component":"MMenu"}},"remove")]})},Le=It;Le.Designer=$t;const wt=t.createStyles(({token:e,css:o})=>({mobileMenu:o`
|
|
30
30
|
--adm-color-primary: ${e.colorPrimary};
|
|
31
31
|
--adm-color-primary-hover: ${e.colorPrimaryHover};
|
|
32
32
|
--adm-color-primary-active: ${e.colorPrimaryActive};
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
background: ${e.colorBgContainer};
|
|
38
38
|
width: 100%;
|
|
39
39
|
margin-bottom: var(--nb-spacing);
|
|
40
|
-
`}))
|
|
40
|
+
`})),ue=e=>{const{styles:o}=wt(),r=t.useDesigner(),a=f.useFieldSchema(),{insertBeforeEnd:s,designable:l}=t.useDesignable(),{t:d}=w(),i=b=>{const m={page:ze};return s({type:"void",title:b.name,"x-component":"MMenu.Item","x-component-props":b,"x-designer":"MMenu.Item.Designer",properties:m})};return n.jsx(t.SortableItem,{className:t.cx("nb-mobile-menu",o.mobileMenu),children:n.jsxs(oe,{children:[l&&n.jsx(oe.Item,{children:n.jsx(r,{})}),n.jsx(t.DndContext,{children:n.jsx(t.SchemaComponent,{onlyRenderProperties:!0,schema:a})}),l?n.jsx(oe.Item,{children:n.jsx(t.SchemaInitializerActionModal,{buttonText:d("Add menu item"),title:d("Add menu item"),schema:Ae,onSubmit:i})}):null]})})};ue.Item=Le,ue.Designer=Ct;const re=(e,o)=>e.reduceProperties((a,s)=>a||s["x-component"]===o&&s),Pt=e=>re(e,"Grid"),Mt=["Grid","Grid.Row"],kt=["Grid.Col"],be=(e,o)=>{if(!e)return 0;let r=0;return kt.includes(e["x-component"])&&(r+=1),r>=o||Mt.includes(e["x-component"])&&e.mapProperties(a=>{r+=be(a,o)}),r},Bt=()=>{const{t:e}=w(),o=f.useFieldSchema(),{onUpdateComponentProps:r}=V(),a=f.useField(),{dn:s}=t.useDesignable(),l=h.useNavigate(),d=re(o,"MTabBar"),i=d&&a.componentProps.tabBarEnabled!==!1,b={dn:s,field:a,fieldSchema:o};return n.jsx(t.SchemaSettingsDropdown,N(S({title:n.jsx(C.Button,{style:{borderColor:"var(--colorSettings)",color:"var(--colorSettings)",width:"100%"},icon:n.jsx(T.MenuOutlined,{}),type:"dashed",children:e("App level Configuration")})},b),{children:n.jsx(t.SchemaSettingsSwitchItem,{checked:i,title:e("Enable TabBar"),onChange:m=>A(this,null,function*(){if(m&&!d){const g=re(o,"MPage");yield s.remove(g),yield s.insertBeforeEnd({type:"void","x-component":"MTabBar","x-component-props":{},name:"tabBar",properties:{[se.uid()]:{type:"void","x-component":"MTabBar.Item","x-designer":"MTabBar.Item.Designer","x-component-props":{icon:"HomeOutlined",title:O("Untitled")},properties:{page:g.toJSON()}}}})}yield r({tabBarEnabled:m}),m===!1&&l("../")})})}))},Et=t.createStyles(({token:e,css:o})=>({mobileContainer:o`
|
|
41
41
|
--adm-color-primary: ${e.colorPrimary};
|
|
42
42
|
|
|
43
43
|
& > .general-schema-designer > .general-schema-designer-icons {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
height: 100%;
|
|
52
52
|
overflow-y: scroll;
|
|
53
53
|
position: initial !important;
|
|
54
|
-
`,tabBar:
|
|
54
|
+
`,tabBar:o`
|
|
55
55
|
& > .general-schema-designer {
|
|
56
56
|
--nb-designer-top: ${e.marginMD}px;
|
|
57
57
|
}
|
|
@@ -61,24 +61,25 @@
|
|
|
61
61
|
bottom: 0;
|
|
62
62
|
left: 0;
|
|
63
63
|
z-index: 1000;
|
|
64
|
-
`})),
|
|
64
|
+
`})),je=(e,o)=>e.reduceProperties((r,a)=>{if(r)return r;if(a["x-component"]==="MTabBar")return je(a,o);if(a["x-component"]==="MTabBar.Item"&&o===a["x-uid"])return a}),Nt=()=>{const{name:e}=h.useParams(),o=f.useFieldSchema();if(!e)return n.jsx(n.Fragment,{});const r=je(o.properties.tabBar,e.replace("tab_",""));return r?n.jsx(t.SchemaComponent,{schema:r}):n.jsx(h.Navigate,{replace:!0,to:"../"})},ge=e=>{var j,D;const{styles:o}=Et(),{token:r}=t.useToken(),a=t.useDesigner(),s=f.useFieldSchema(),l=h.useNavigate(),d=h.useParams(),i=h.useLocation(),m=f.useField().componentProps.tabBarEnabled!==!1,g=(j=s==null?void 0:s.properties)==null?void 0:j.tabBar,x=g!=null&&g.properties?Object.keys(g.properties)[0]:null;let y=null;return x&&(y=(D=g==null?void 0:g.properties[x])==null?void 0:D["x-uid"]),c.useEffect(()=>{if(y&&!d.name){const P=i.pathname.endsWith("/")?i.pathname.slice(0,-1):i.pathname;l(`${P}/tab_${y}`,{replace:!0})}},[i.pathname,l,d.name,y]),n.jsxs(t.SortableItem,{eid:"nb-mobile-scroll-wrapper",className:t.cx("nb-mobile-container",o.mobileContainer),children:[n.jsx(a,{}),n.jsx("div",{style:{paddingBottom:y?r.paddingLG*2:0},className:"nb-mobile-container-content",children:y?n.jsx(Nt,{}):n.jsx(t.SchemaComponent,{filterProperties:P=>P["x-component"]!=="MTabBar",schema:s})}),m&&n.jsx("div",{className:t.cx("nb-mobile-container-tab-bar",o.tabBar),children:n.jsx(t.SchemaComponent,{onlyRenderProperties:!0,filterProperties:P=>P["x-component"]==="MTabBar",schema:s})})]})};ge.Designer=Bt,ge.displayName="MContainer";const Ge={properties:{title:{type:"string",title:"{{ t('Title') }}",required:!0,"x-component":"Input","x-decorator":"FormItem"},icon:{required:!0,"x-decorator":"FormItem","x-component":"IconPicker",title:"{{ t('Icon') }}","x-component-props":{}}}},Tt=()=>{const e=t.useDesigner();return n.jsx(t.SortableItem,{className:t.cx("nb-mobile-tab-bar-item",t.css`
|
|
65
65
|
position: absolute !important;
|
|
66
66
|
width: 100%;
|
|
67
67
|
height: 100%;
|
|
68
68
|
top: 0;
|
|
69
69
|
left: 0;
|
|
70
|
-
|
|
70
|
+
padding-top: 5px;
|
|
71
|
+
`),children:n.jsx(e,{})})},Ft=()=>{const{t:e}=w(),o=f.useFieldSchema(),{onUpdateComponentProps:r}=V(),a=f.useField(),s=Object.keys(o.parent.properties).length;return n.jsxs(t.GeneralSchemaDesigner,{children:[n.jsx(t.SchemaSettingsModalItem,{title:e("Edit info"),initialValues:a.componentProps,schema:Ge,onSubmit:r}),s>1?n.jsx(t.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,confirm:{title:e("Delete tab item?")},breakRemoveOn:{"x-component":"MTabBar"}},"remove"):null]})},_e=Tt;_e.Designer=Ft;const fe=e=>{const o=f.useFieldSchema(),{designable:r}=t.useDesignable(),{t:a}=w(),{insertBeforeEnd:s}=t.useDesignable(),l=h.useNavigate(),d=h.useParams(),i=t.useCompile(),b=c.useCallback(m=>s({type:"void","x-component":"MTabBar.Item","x-component-props":m,"x-designer":"MTabBar.Item.Designer",properties:{[se.uid()]:ze},"x-server-hooks":[{type:"onSelfSave",method:"extractTextToLocale"}]}),[]);return n.jsx(t.SortableItem,{className:t.cx("nb-mobile-tab-bar",t.css`
|
|
71
72
|
position: relative;
|
|
72
73
|
width: 100%;
|
|
73
74
|
display: flex;
|
|
74
75
|
align-items: center;
|
|
75
|
-
`),children:
|
|
76
|
+
`),children:n.jsx(t.DndContext,{children:n.jsxs(pe,{activeKey:d.name,onChange:m=>{m!=="add-tab"&&l(`/mobile/${m}`)},safeArea:!0,className:t.cx(t.css`
|
|
76
77
|
width: 100%;
|
|
77
|
-
`),children:[
|
|
78
|
+
`),children:[o.mapProperties((m,g)=>{const x=m["x-component-props"];return c.createElement(pe.Item,N(S({},x),{key:`tab_${m["x-uid"]}`,title:n.jsxs(n.Fragment,{children:[a(i(x.title)),n.jsx(t.SchemaComponent,{schema:m,name:g})]}),icon:x.icon?n.jsx(t.Icon,{type:x.icon}):void 0}))}),r&&(!o.properties||Object.keys(o.properties).length<5)?n.jsx(pe.Item,{className:t.css`
|
|
78
79
|
.adm-tab-bar-item-icon {
|
|
79
80
|
height: auto;
|
|
80
81
|
}
|
|
81
|
-
`,icon:
|
|
82
|
+
`,icon:n.jsx(t.SchemaInitializerActionModal,{title:a("Add tab"),onSubmit:b,schema:Ge})},"add-tab"):null]})})})};fe.Item=_e,fe.displayName="MTabBar";const Ot=e=>{var y,j,D,P;const{showBack:o}=e,{t:r}=w(),a=f.useField(),s=f.useFieldSchema(),{dn:l}=t.useDesignable(),{onUpdateComponentProps:d}=V(),i=(y=s==null?void 0:s.properties)==null?void 0:y.header,b=!!i&&((j=a.componentProps)==null?void 0:j.headerEnabled)!==!1,m=(D=s==null?void 0:s.properties)==null?void 0:D.tabs,g=!!m&&((P=a.componentProps)==null?void 0:P.tabsEnabled)!==!1,x={dn:l,field:a,fieldSchema:s};return n.jsxs(t.SchemaSettingsDropdown,N(S({title:n.jsx(C.Button,{style:{borderColor:"var(--colorSettings)",color:"var(--colorSettings)",width:"100%"},icon:n.jsx(T.MenuOutlined,{}),type:"dashed",children:r("Page configuration")})},x),{children:[n.jsx(t.SchemaSettingsSwitchItem,{checked:b,title:r("Enable Header"),onChange:U=>A(this,null,function*(){var z;i||(yield l.insertAfterBegin({type:"void",name:"header","x-component":"MHeader","x-designer":"MHeader.Designer","x-component-props":{title:(z=s.parent["x-component-props"])==null?void 0:z.name,showBack:o}})),yield d({headerEnabled:U})})}),n.jsx(t.SchemaSettingsSwitchItem,{checked:g,title:r("Enable Tabs"),onChange:U=>A(this,null,function*(){if(!m){const z=Pt(s);return yield l.remove(z),l.insertBeforeEnd({type:"void",name:"tabs","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab","x-initializer-props":{gridInitializer:"mobilePage:addBlock"},properties:{tab1:{type:"void",title:O("Untitled"),"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:N(S({},z),{"x-uid":se.uid()})}}}})}yield d({tabsEnabled:U})})})]}))},Dt=t.createStyles(({token:e,css:o})=>({globalActionCSS:o`
|
|
82
83
|
#nb-position-container > & {
|
|
83
84
|
height: ${e.sizeXXL}px;
|
|
84
85
|
border-top: 1px solid var(--nb-box-bg);
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
background: ${e.colorBgContainer};
|
|
90
91
|
z-index: 100;
|
|
91
92
|
}
|
|
92
|
-
`,mobilePage:
|
|
93
|
+
`,mobilePage:o`
|
|
93
94
|
background: var(--nb-box-bg);
|
|
94
95
|
display: flex;
|
|
95
96
|
flex-direction: column;
|
|
@@ -98,7 +99,7 @@
|
|
|
98
99
|
// overflow-x: hidden;
|
|
99
100
|
// overflow-y: auto;
|
|
100
101
|
padding-bottom: var(--nb-spacing);
|
|
101
|
-
`,mobilePageHeader:
|
|
102
|
+
`,mobilePageHeader:o`
|
|
102
103
|
& > .ant-tabs > .ant-tabs-nav {
|
|
103
104
|
.ant-tabs-tab {
|
|
104
105
|
margin: 0 !important;
|
|
@@ -108,25 +109,25 @@
|
|
|
108
109
|
}
|
|
109
110
|
display: flex;
|
|
110
111
|
flex-direction: column;
|
|
111
|
-
`})),
|
|
112
|
+
`})),he=e=>{var P,U,z,Xe;const{styles:o}=Dt(),r=t.useDesigner(),a=f.useField(),s=f.useFieldSchema(),[l,d]=h.useSearchParams(),i=(P=s.properties)==null?void 0:P.tabs,b=a.componentProps.headerEnabled!==!1,m=a.componentProps.tabsEnabled!==!1&&i;let g=re(s,"MPage");if(!m&&!g&&i){const v=Object.values(i.properties||{}).sort((ve,ye)=>ve["x-index"]-ye["x-index"]);v.length!==0&&(g=v[0])}const x=s.root===s.parent;let y=!1;if(!i&&s.properties)y=be(s.properties.grid,2)===1;else if(l.has("tab")&&((U=i==null?void 0:i.properties)!=null&&U[l.get("tab")]))y=be((Xe=(z=i.properties[l.get("tab")])==null?void 0:z.properties)==null?void 0:Xe.grid,2)===1;else if(i!=null&&i.properties){const v=Object.values(i.properties).sort((ve,ye)=>ve["x-index"]-ye["x-index"])[0];v&&setTimeout(()=>{d([["tab",v.name.toString()]],{replace:!0})})}const j=c.useCallback(v=>{d([["tab",v]],{replace:!0})},[d]),D=c.useCallback(v=>n.jsx(t.TabsContextProvider,{children:y?n.jsx(t.ActionBarProvider,{container:(typeof v.active=="undefined"||v.active)&&x?document.getElementById("nb-position-container"):null,forceProps:{layout:"one-column",className:o.globalActionCSS},children:v.children}):v.children}),[y,x,o.globalActionCSS]);return n.jsxs(t.SortableItem,{eid:"nb-mobile-scroll-wrapper",className:t.cx("nb-mobile-page",o.mobilePage),children:[n.jsx(r,S({},s==null?void 0:s["x-designer-props"])),n.jsxs("div",{style:{paddingBottom:i?null:"var(--nb-spacing)"},className:t.cx("nb-mobile-page-header",o.mobilePageHeader,{[t.css`
|
|
112
113
|
& > .ant-nb-grid {
|
|
113
114
|
margin-top: 14px;
|
|
114
115
|
}
|
|
115
|
-
`]:
|
|
116
|
+
`]:i&&!m||!i}),children:[b&&n.jsx(f.RecursionField,{schema:s,filterProperties:v=>v["x-component"]==="MHeader"}),n.jsx(t.TabsContextProvider,{PaneRoot:D,activeKey:l.get("tab"),onChange:j,children:n.jsx(f.RecursionField,{schema:m?s:g,filterProperties:v=>v["x-component"]==="Tabs"||v["x-component"]==="Grid"||v["x-component"]==="Grid.Row"})})]}),n.jsx(D,{children:!i&&n.jsx(f.RecursionField,{schema:s,filterProperties:v=>v["x-component"]!=="MHeader"})})]})};he.Designer=Ot,he.displayName="MPage";const zt=()=>{const e=f.useField(),{onUpdateComponentProps:o}=V(),{t:r}=w();return n.jsx(t.GeneralSchemaDesigner,{draggable:!1,children:n.jsx(t.SchemaSettingsModalItem,{title:r("Edit info"),components:{Switch:Ye.Switch},initialValues:e.componentProps,schema:{properties:{title:{type:"string",title:r("Title"),required:!0,"x-component":"Input","x-decorator":"FormItem"},showBack:{type:"boolean",title:r("Display back button"),"x-component":"Switch","x-decorator":"FormItem"}}},onSubmit:o})})},Ue=e=>{const o=f.useField(),{title:r=O("Untitled"),showBack:a=!1}=S(S({},e),o==null?void 0:o.componentProps),s=t.useDesigner(),d=t.useCompile()(r),i=h.useNavigate(),{setTitle:b}=t.useDocumentTitle(),{token:m}=t.useToken();c.useEffect(()=>{b(d)},[d]);const g=c.useMemo(()=>({width:"100%",background:m.colorBgContainer}),[m.colorBgContainer]);return n.jsxs(t.SortableItem,{className:t.cx("nb-mobile-header"),style:g,children:[n.jsx(vt,{backArrow:a,onBack:()=>i(-1),children:d}),n.jsx(s,{})]})};Ue.Designer=zt;const At=()=>{const{t:e}=w();return n.jsx(t.GeneralSchemaDesigner,{children:n.jsx(t.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,confirm:{title:e("Delete settings block")},breakRemoveOn:{"x-component":"Grid"}},"remove")})},qe=()=>{const e=t.useDesigner();return n.jsxs(t.SortableItem,{className:t.cx("nb-mobile-setting",t.css`
|
|
116
117
|
margin-bottom: var(--nb-spacing);
|
|
117
|
-
`),children:[
|
|
118
|
+
`),children:[n.jsx(e,{}),n.jsx(t.SettingsMenu,{redirectUrl:"/mobile"})]})};qe.Designer=At;const Lt=()=>{const e=t.useSchemaInitializerItem(),{insert:o}=t.useSchemaInitializer();return n.jsx(t.SchemaInitializerItem,S({icon:n.jsx(T.SettingOutlined,{}),onClick:()=>A(this,null,function*(){o({type:"void","x-component":"MSettings","x-designer":"MSettings.Designer","x-component-props":{}})})},e))},He=c.createContext(null),jt=e=>n.jsx(He.Provider,{value:{interface:!0},children:e.children}),Ve=()=>c.useContext(He),Gt=t.css`
|
|
118
119
|
padding: 0 var(--nb-spacing);
|
|
119
120
|
& > .nb-action-bar {
|
|
120
121
|
padding: unset !important;
|
|
121
122
|
background: unset !important;
|
|
122
123
|
}
|
|
123
|
-
`,
|
|
124
|
+
`,_t=()=>({className:Gt}),Ut={xs:1,sm:1,md:1,lg:1,xl:1,xxl:1},qt=()=>({columnCount:Ve()?Ut:null,pagination:{simple:!0}}),Ht=e=>n.jsx(t.SchemaComponentOptions,{components:{MMenuBlockInitializer:ot,MSettingsBlockInitializer:Lt,MContainer:ge,MMenu:ue,MTabBar:fe,MPage:he,MHeader:Ue,MSettings:qe},scope:{useGridCardBlockItemProps:_t,useGridCardBlockProps:qt},children:e.children}),Vt=()=>{const{t:e}=w(),o=t.useApp(),r=()=>{window.open(o.getRouteUrl("/mobile"))};return n.jsx("div",{className:t.css`
|
|
124
125
|
position: absolute;
|
|
125
126
|
top: -40px;
|
|
126
127
|
right: 0;
|
|
127
|
-
`,children:
|
|
128
|
+
`,children:n.jsx(C.Button,{type:"dashed",onClick:r,icon:n.jsx(T.LinkOutlined,{}),children:e("Preview")})})},Wt=t.css`
|
|
128
129
|
--nb-spacing: 14px;
|
|
129
|
-
`,
|
|
130
|
+
`,Kt=t.css``,Jt=t.css`
|
|
130
131
|
--nb-designer-top: 2px;
|
|
131
132
|
--nb-designer-right: 2px;
|
|
132
133
|
.nb-sortable-designer:hover {
|
|
@@ -161,31 +162,31 @@
|
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
|
-
`,
|
|
165
|
+
`,We={getContainer:".nb-mobile-application",width:"90%",style:{position:"absolute"}},Xt=N(S({},We),{style:{maxWidth:"calc(100% - 16px)"},maskStyle:{position:"absolute"},wrapClassName:t.css`
|
|
165
166
|
position: absolute !important;
|
|
166
|
-
`}),
|
|
167
|
+
`}),Zt=()=>"nocobase-mobile-container",Ke=e=>{const o=Zt(),r=h.useParams(),a=Ve(),s=c.useMemo(()=>a?c.Fragment:t.AdminProvider,[a]);return t.useViewport(),n.jsx(s,{children:n.jsxs(Ht,{children:[n.jsx(Vt,{}),n.jsx(t.ActionContextProvider,{modalProps:Xt,drawerProps:We,children:n.jsxs("div",{className:t.cx("nb-mobile-application",Jt,Wt,Kt,t.css`
|
|
167
168
|
display: flex;
|
|
168
169
|
flex-direction: column;
|
|
169
170
|
width: 100%;
|
|
170
171
|
height: 100%;
|
|
171
172
|
position: relative;
|
|
172
173
|
overflow: hidden;
|
|
173
|
-
`),children:[
|
|
174
|
+
`),children:[r.name&&!r.name.startsWith("tab_")?n.jsx(h.Outlet,{}):n.jsx(t.RemoteSchemaComponent,{uid:o,children:e.children},o),n.jsx("div",{id:"nb-position-container"})]})})]})})},Qt=()=>{const e=t.useApp(),{t:o}=w(),r=c.useMemo(()=>e.getRouteUrl("/mobile"),[e]);return n.jsx(C.Card,{style:{minHeight:"600px"},children:n.jsx(C.Form,{layout:"vertical",children:n.jsx(C.Form.Item,{tooltip:`${o("The full address is")} ${window.origin}${r}`,label:o("Mobile client access address"),children:n.jsx(C.Input,{value:r,disabled:!0})})})})},Je=c.memo(()=>{const o=t.usePlugin(xe).getMobileRouterComponent();return n.jsx(jt,{children:n.jsx("div",{className:t.css`
|
|
174
175
|
display: flex;
|
|
175
176
|
width: 100%;
|
|
176
177
|
height: 100%;
|
|
177
178
|
position: relative;
|
|
178
|
-
`,children:
|
|
179
|
+
`,children:n.jsx(o,{})})})});Je.displayName="InterfaceRouter";const Yt=e=>n.jsx("div",{className:t.cx("nb-mobile-device-ios6",t.css(`
|
|
179
180
|
display: flex;
|
|
180
181
|
width: 375px;
|
|
181
182
|
height: 667px;
|
|
182
|
-
`),e.className),children:e.children}),
|
|
183
|
+
`),e.className),children:e.children}),Rt=e=>n.jsx("div",{className:t.cx("nb-mobile-device-wrapper",t.css`
|
|
183
184
|
width: 100%;
|
|
184
185
|
height: 100%;
|
|
185
186
|
display: flex;
|
|
186
187
|
justify-content: center;
|
|
187
188
|
align-items: center;
|
|
188
189
|
margin-top: 50px;
|
|
189
|
-
`),children:
|
|
190
|
+
`),children:n.jsx(Yt,S({className:t.css`
|
|
190
191
|
box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
|
|
191
|
-
`},e))}),
|
|
192
|
+
`},e))}),en=()=>n.jsx(Rt,{children:n.jsx(Je,{})});class xe extends t.Plugin{constructor(){super(...arguments);Qe(this,"mobileRouter")}load(){return A(this,null,function*(){this.setMobileRouter(),this.addRoutes(),this.addSettings(),this.app.use($e),this.app.schemaInitializerManager.add(Pe),this.app.schemaInitializerManager.add(nt)})}addSettings(){this.app.pluginSettingsManager.add(F,{title:`{{t("Mobile Client-side(Deprecated)", { ns: "${F}" })}}`,icon:"MobileOutlined",Component:()=>n.jsx(h.Outlet,{})}),this.app.pluginSettingsManager.add(`${F}.interface`,{title:`{{t("Interface Configuration", { ns: "${F}" })}}`,Component:en,sort:1}),this.app.pluginSettingsManager.add(`${F}.app`,{title:`{{t("App Configuration", { ns: "${F}" })}}`,Component:Qt,sort:2})}setMobileRouter(){const r=t.createRouterManager({type:"hash"},this.app);r.add("root",{path:"/",element:n.jsx(h.Navigate,{replace:!0,to:"/mobile"})}),r.add("mobile",{path:"/mobile",element:n.jsx(Ke,{})}),r.add("mobile.page",{path:"/mobile/:name",element:n.jsx(t.RouteSchemaComponent,{})}),this.mobileRouter=r}getMobileRouterComponent(){return this.mobileRouter.getRouterComponent()}addRoutes(){this.app.router.add("mobile",{path:"/mobile",element:n.jsx(Ke,{})}),this.app.router.add("mobile.page",{path:"/mobile/:name",Component:"RouteSchemaComponent"})}}p.PluginMobileClient=xe,p.default=xe,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.4.0-alpha.
|
|
11
|
+
"@nocobase/client": "1.4.0-alpha.3",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"react-router-dom": "6.21.0",
|
|
14
|
-
"@nocobase/server": "1.4.0-alpha.
|
|
14
|
+
"@nocobase/server": "1.4.0-alpha.3",
|
|
15
15
|
"antd": "5.12.8",
|
|
16
16
|
"react-i18next": "11.18.6",
|
|
17
17
|
"@ant-design/icons": "5.2.6",
|
|
18
|
-
"@nocobase/database": "1.4.0-alpha.
|
|
18
|
+
"@nocobase/database": "1.4.0-alpha.3",
|
|
19
19
|
"@formily/react": "2.3.0",
|
|
20
20
|
"@formily/shared": "2.3.2",
|
|
21
21
|
"lodash": "4.17.21",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-mobile-client",
|
|
3
|
-
"version": "1.4.0-alpha.
|
|
3
|
+
"version": "1.4.0-alpha.3",
|
|
4
4
|
"main": "./dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/mobile-client",
|
|
6
6
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/mobile-client",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@types/react-dom": "17.x",
|
|
19
19
|
"ahooks": "3.x",
|
|
20
20
|
"antd": "5.x",
|
|
21
|
-
"antd-mobile": "^5.
|
|
21
|
+
"antd-mobile": "^5.38",
|
|
22
22
|
"antd-style": "3.x",
|
|
23
23
|
"classnames": "2.x",
|
|
24
24
|
"react": "18.x",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"@nocobase/test": "1.x",
|
|
34
34
|
"@nocobase/utils": "1.x"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "9268a5b29cbbe9f83255e5cd66fa82f012aab46a"
|
|
37
37
|
}
|