@nocobase/plugin-mobile-client 0.13.0-alpha.4 → 0.13.0-alpha.5
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 +50 -2327
- package/dist/index.js +37 -16
- package/dist/locale/en-US.js +22 -4
- package/dist/locale/fr-FR.js +22 -4
- package/dist/locale/zh-CN.js +22 -4
- package/dist/server/index.js +33 -11
- package/dist/server/migrations/20230620203218-mobile-ui-schema-uid.js +24 -7
- package/dist/server/plugin.js +33 -14
- package/dist/server/routes.js +26 -4
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -1,1604 +1,53 @@
|
|
|
1
|
-
(function() {
|
|
2
|
-
|
|
3
|
-
try {
|
|
4
|
-
if (typeof document != "undefined") {
|
|
5
|
-
var elementStyle = document.createElement("style");
|
|
6
|
-
elementStyle.id = "@nocobase/plugin-mobile-client";
|
|
7
|
-
elementStyle.appendChild(document.createTextNode(":root {\n --adm-radius-s: 4px;\n --adm-radius-m: 8px;\n --adm-radius-l: 12px;\n --adm-font-size-1: 9px;\n --adm-font-size-2: 10px;\n --adm-font-size-3: 11px;\n --adm-font-size-4: 12px;\n --adm-font-size-5: 13px;\n --adm-font-size-6: 14px;\n --adm-font-size-7: 15px;\n --adm-font-size-8: 16px;\n --adm-font-size-9: 17px;\n --adm-font-size-10: 18px;\n --adm-color-primary: #1677ff;\n --adm-color-success: #00b578;\n --adm-color-warning: #ff8f1f;\n --adm-color-danger: #ff3141;\n --adm-color-text: #333333;\n --adm-color-text-secondary: #666666;\n --adm-color-weak: #999999;\n --adm-color-light: #cccccc;\n --adm-color-border: #eeeeee;\n --adm-color-background: #ffffff;\n --adm-color-white: #ffffff;\n --adm-color-box: #f5f5f5;\n --adm-color-text-light-solid: var(--adm-color-white);\n --adm-color-text-dark-solid: #000000;\n --adm-color-fill-content: var(--adm-color-box);\n --adm-font-size-main: var(--adm-font-size-5);\n --adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',\n helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',\n 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;\n --adm-border-color: var(--adm-color-border);\n}\nhtml[data-prefers-color-scheme='dark'] {\n --adm-color-primary: #3086ff;\n --adm-color-success: #34b368;\n --adm-color-warning: #ffa930;\n --adm-color-danger: #ff4a58;\n --adm-color-text: #e6e6e6;\n --adm-color-text-secondary: #b3b3b3;\n --adm-color-weak: #808080;\n --adm-color-light: #4d4d4d;\n --adm-color-border: #2b2b2b;\n --adm-color-box: #0a0a0a;\n --adm-color-background: #1a1a1a;\n --adm-border-color: var(--adm-color-border);\n}\n:root {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\nbody {\n color: var(--adm-color-text);\n font-size: var(--adm-font-size-main);\n font-family: var(--adm-font-family);\n}\na,\nbutton {\n cursor: pointer;\n}\na {\n color: var(--adm-color-primary);\n transition: opacity ease-in-out 0.2s;\n}\na:active {\n opacity: 0.8;\n}\n.adm-plain-anchor {\n color: unset;\n transition: none;\n}\n.adm-plain-anchor:active {\n opacity: unset;\n}\nbody.adm-overflow-hidden {\n overflow: hidden !important;\n}\ndiv.adm-px-tester {\n --size: 1;\n height: calc(var(--size) / 2 * 2px);\n width: 0;\n position: fixed;\n right: -100vw;\n bottom: -100vh;\n -webkit-user-select: none;\n user-select: none;\n pointer-events: none;\n}\n.adm-safe-area {\n --multiple: var(--adm-safe-area-multiple, 1);\n display: block;\n width: 100%;\n}\n.adm-safe-area-position-top {\n padding-top: calc(env(safe-area-inset-top) * var(--multiple));\n}\n.adm-safe-area-position-bottom {\n padding-bottom: calc(env(safe-area-inset-bottom) * var(--multiple));\n}\n.adm-badge-wrapper {\n display: inline-block;\n position: relative;\n}\n.adm-badge {\n display: inline-flex;\n vertical-align: middle;\n box-sizing: content-box;\n border-radius: 100px;\n background-color: var(--color);\n --right: 0;\n --top: 0;\n --color: var(--adm-badge-color, #ff411c);\n}\n.adm-badge-content {\n color: var(--adm-color-text-light-solid);\n box-sizing: border-box;\n min-width: 8px;\n padding: 1px 4px;\n font-size: var(--adm-font-size-1);\n line-height: 12px;\n white-space: nowrap;\n font-weight: normal;\n text-align: center;\n}\n.adm-badge-fixed {\n position: absolute;\n right: var(--right);\n top: var(--top);\n transform: translate(50%, -50%);\n}\n.adm-badge-dot {\n min-width: 10px;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n}\n.adm-badge-bordered {\n border: solid 1px var(--adm-color-text-light-solid);\n}\n.adm-list {\n --header-font-size: var(--adm-font-size-7);\n --prefix-width: 'auto';\n --prefix-padding-right: 12px;\n --align-items: center;\n --active-background-color: var(--adm-color-border);\n --border-inner: solid 1px var(--adm-color-border);\n --border-top: solid 1px var(--adm-color-border);\n --border-bottom: solid 1px var(--adm-color-border);\n --padding-left: 12px;\n --padding-right: 12px;\n --font-size: var(--adm-font-size-9);\n --extra-max-width: 70%;\n}\n.adm-list-header {\n color: var(--adm-color-weak);\n font-size: var(--header-font-size);\n padding: 8px var(--padding-right) 8px var(--padding-left);\n}\n.adm-list-body {\n background-color: var(--adm-color-background);\n overflow: hidden;\n font-size: var(--font-size);\n}\n.adm-list-body-inner {\n margin-top: -1px;\n}\n.adm-list-default .adm-list-body {\n border-top: var(--border-top);\n border-bottom: var(--border-bottom);\n}\n.adm-list-card {\n margin: 12px;\n}\n.adm-list-card .adm-list-body {\n border-radius: 8px;\n}\n.adm-list-card .adm-list-header {\n padding-left: 0;\n}\n.adm-list-item {\n display: block;\n padding-left: var(--padding-left);\n position: relative;\n background-color: var(--adm-color-background);\n line-height: 1.5;\n}\n.adm-list-item-title,\n.adm-list-item-description {\n color: var(--adm-color-weak);\n font-size: var(--adm-font-size-main);\n}\n.adm-list-item-content {\n display: flex;\n align-items: var(--align-items);\n justify-content: flex-start;\n border-top: var(--border-inner);\n padding-right: var(--padding-right);\n}\n.adm-list-item-content-prefix {\n width: var(--prefix-width);\n flex: none;\n padding-right: var(--prefix-padding-right);\n}\n.adm-list-item-content-main {\n flex: auto;\n padding: 12px 0;\n}\n.adm-list-item-content-extra {\n flex: none;\n padding-left: 12px;\n font-size: var(--adm-font-size-7);\n color: var(--adm-color-weak);\n max-width: var(--extra-max-width);\n}\n.adm-list-item-content-arrow {\n flex: none;\n display: flex;\n align-items: center;\n margin-left: 4px;\n color: var(--adm-color-light);\n font-size: 19px;\n}\n.adm-list-item-disabled {\n cursor: not-allowed;\n}\n.adm-list-item-disabled.adm-list-item-disabled > .adm-list-item-content > * {\n opacity: 0.4;\n pointer-events: none;\n}\na.adm-list-item:active:not(.adm-list-item-disabled) {\n background-color: var(--active-background-color);\n}\na.adm-list-item:active:not(.adm-list-item-disabled)::after {\n content: ' ';\n display: block;\n position: absolute;\n width: 100%;\n bottom: -1px;\n left: 0;\n border-bottom: var(--border-inner);\n}\n.adm-nav-bar {\n --height: 45px;\n --border-bottom: none;\n display: flex;\n align-items: center;\n height: var(--height);\n border-bottom: var(--border-bottom);\n padding: 0 12px;\n white-space: nowrap;\n}\n.adm-nav-bar-left,\n.adm-nav-bar-right {\n flex: 1;\n}\n.adm-nav-bar-title {\n flex: auto;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.adm-nav-bar-back {\n display: flex;\n align-items: center;\n margin-right: 16px;\n padding: 6px 0;\n cursor: pointer;\n}\n.adm-nav-bar-back-arrow {\n font-size: 24px;\n margin-right: 4px;\n}\n.adm-nav-bar-left {\n font-size: var(--adm-font-size-7);\n display: flex;\n justify-content: flex-start;\n align-items: center;\n}\n.adm-nav-bar-title {\n justify-content: center;\n white-space: nowrap;\n font-size: var(--adm-font-size-10);\n padding: 0 12px;\n}\n.adm-nav-bar-right {\n text-align: right;\n}\n.adm-tab-bar-wrap {\n display: flex;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n overflow: hidden;\n min-height: 48px;\n}\n.adm-tab-bar-item {\n flex: 1;\n color: var(--adm-color-text-secondary);\n white-space: nowrap;\n padding: 4px 8px;\n width: -webkit-min-content;\n width: min-content;\n position: relative;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n.adm-tab-bar-item-icon {\n font-size: 24px;\n height: 24px;\n line-height: 1;\n}\n.adm-tab-bar-item-title {\n font-size: var(--adm-font-size-2);\n line-height: 15px;\n}\n.adm-tab-bar-item-title-with-icon {\n margin-top: 2px;\n}\n.adm-tab-bar-item-active {\n color: var(--adm-color-primary);\n}\n.adm-tab-bar-icon-badge {\n --top: 6px;\n}\n.adm-tab-bar-title-badge {\n --right: -2px;\n --top: -2px;\n}"));
|
|
8
|
-
document.head.appendChild(elementStyle);
|
|
9
|
-
}
|
|
10
|
-
} catch (e) {
|
|
11
|
-
console.error("vite-plugin-css-injected-by-js", e);
|
|
12
|
-
}
|
|
13
|
-
})();
|
|
14
|
-
(function(global2, factory) {
|
|
15
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("@nocobase/client"), require("react-router-dom"), require("antd"), require("react-i18next"), require("@ant-design/icons"), require("@formily/react"), require("lodash"), require("ahooks"), require("@formily/shared"), require("@formily/antd-v5")) : typeof define === "function" && define.amd ? define(["exports", "react", "@nocobase/client", "react-router-dom", "antd", "react-i18next", "@ant-design/icons", "@formily/react", "lodash", "ahooks", "@formily/shared", "@formily/antd-v5"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["@nocobase/plugin-mobile-client"] = {}, global2.react, global2["@nocobase/client"], global2["react-router-dom"], global2.antd, global2["react-i18next"], global2["@ant-design/icons"], global2["@formily/react"], global2.lodash, global2.ahooks, global2["@formily/shared"], global2["@formily/antd-v5"]));
|
|
16
|
-
})(this, function(exports2, React, client, reactRouterDom, antd, reactI18next, icons, react, lodash, ahooks, shared, antdV5) {
|
|
17
|
-
"use strict";var __defProp = Object.defineProperty;
|
|
18
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19
|
-
var __publicField = (obj, key, value) => {
|
|
20
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
|
-
return value;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
function _interopNamespaceDefault(e2) {
|
|
25
|
-
const n2 = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
26
|
-
if (e2) {
|
|
27
|
-
for (const k2 in e2) {
|
|
28
|
-
if (k2 !== "default") {
|
|
29
|
-
const d2 = Object.getOwnPropertyDescriptor(e2, k2);
|
|
30
|
-
Object.defineProperty(n2, k2, d2.get ? d2 : {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: () => e2[k2]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
n2.default = e2;
|
|
38
|
-
return Object.freeze(n2);
|
|
39
|
-
}
|
|
40
|
-
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
41
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
42
|
-
function getDefaultExportFromCjs(x) {
|
|
43
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
44
|
-
}
|
|
45
|
-
var jsxRuntime = { exports: {} };
|
|
46
|
-
var reactJsxRuntime_production_min = {};
|
|
47
|
-
/**
|
|
48
|
-
* @license React
|
|
49
|
-
* react-jsx-runtime.production.min.js
|
|
50
|
-
*
|
|
51
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
52
|
-
*
|
|
53
|
-
* This source code is licensed under the MIT license found in the
|
|
54
|
-
* LICENSE file in the root directory of this source tree.
|
|
55
|
-
*/
|
|
56
|
-
var f$1 = React, k$1 = Symbol.for("react.element"), l$1 = Symbol.for("react.fragment"), m$1 = Object.prototype.hasOwnProperty, n$1 = f$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$1 = { key: true, ref: true, __self: true, __source: true };
|
|
57
|
-
function q$1(c2, a, g2) {
|
|
58
|
-
var b2, d2 = {}, e2 = null, h2 = null;
|
|
59
|
-
void 0 !== g2 && (e2 = "" + g2);
|
|
60
|
-
void 0 !== a.key && (e2 = "" + a.key);
|
|
61
|
-
void 0 !== a.ref && (h2 = a.ref);
|
|
62
|
-
for (b2 in a)
|
|
63
|
-
m$1.call(a, b2) && !p$1.hasOwnProperty(b2) && (d2[b2] = a[b2]);
|
|
64
|
-
if (c2 && c2.defaultProps)
|
|
65
|
-
for (b2 in a = c2.defaultProps, a)
|
|
66
|
-
void 0 === d2[b2] && (d2[b2] = a[b2]);
|
|
67
|
-
return { $$typeof: k$1, type: c2, key: e2, ref: h2, props: d2, _owner: n$1.current };
|
|
68
|
-
}
|
|
69
|
-
reactJsxRuntime_production_min.Fragment = l$1;
|
|
70
|
-
reactJsxRuntime_production_min.jsx = q$1;
|
|
71
|
-
reactJsxRuntime_production_min.jsxs = q$1;
|
|
72
|
-
{
|
|
73
|
-
jsxRuntime.exports = reactJsxRuntime_production_min;
|
|
74
|
-
}
|
|
75
|
-
var jsxRuntimeExports = jsxRuntime.exports;
|
|
76
|
-
const NAMESPACE = "mobile-client";
|
|
77
|
-
function generateNTemplate(key) {
|
|
78
|
-
return `{{t('${key}', { ns: '${NAMESPACE}', nsMode: 'fallback' })}}`;
|
|
79
|
-
}
|
|
80
|
-
function useTranslation() {
|
|
81
|
-
return reactI18next.useTranslation([NAMESPACE, "client"], {
|
|
82
|
-
nsMode: "fallback"
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
const AppConfiguration = () => {
|
|
86
|
-
const { t: t2 } = useTranslation();
|
|
87
|
-
const location = reactRouterDom.useLocation();
|
|
88
|
-
const targetUrl = React.useMemo(() => {
|
|
89
|
-
let baseUrl = "/mobile";
|
|
90
|
-
if (location.pathname.startsWith("/apps")) {
|
|
91
|
-
baseUrl = location.pathname.split("/").slice(0, 3).join("/");
|
|
92
|
-
}
|
|
93
|
-
return baseUrl;
|
|
94
|
-
}, [location.pathname]);
|
|
95
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
96
|
-
antd.Card,
|
|
97
|
-
{
|
|
98
|
-
style: {
|
|
99
|
-
minHeight: "600px"
|
|
100
|
-
},
|
|
101
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Form, { layout: "vertical", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
102
|
-
antd.Form.Item,
|
|
103
|
-
{
|
|
104
|
-
tooltip: `${t2("The full address is")} ${window.origin}${targetUrl}`,
|
|
105
|
-
label: t2("Mobile client access address"),
|
|
106
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Input, { value: targetUrl, disabled: true })
|
|
107
|
-
}
|
|
108
|
-
) })
|
|
109
|
-
}
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
const InterfaceContext = React.createContext(null);
|
|
113
|
-
const InterfaceProvider = (props) => {
|
|
114
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(InterfaceContext.Provider, { value: { interface: true }, children: props.children });
|
|
115
|
-
};
|
|
116
|
-
const useInterfaceContext = () => {
|
|
117
|
-
return React.useContext(InterfaceContext);
|
|
118
|
-
};
|
|
119
|
-
const InterfaceRouter = React.memo(() => {
|
|
120
|
-
const plugin = client.usePlugin(MobileClientPlugin);
|
|
121
|
-
const MobileRouter = plugin.getMobileRouterComponent();
|
|
122
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(InterfaceProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
123
|
-
"div",
|
|
124
|
-
{
|
|
125
|
-
className: client.css`
|
|
1
|
+
(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-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-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-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-border-color: var(--adm-color-border)}:root{-webkit-tap-highlight-color:rgba(0,0,0,0)}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;right:-100vw;bottom:-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, #ff411c)}.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)}})();
|
|
2
|
+
(function(m,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("react/jsx-runtime"),require("@nocobase/client"),require("react-router-dom"),require("react"),require("antd"),require("react-i18next"),require("@ant-design/icons"),require("@formily/react"),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","antd","react-i18next","@ant-design/icons","@formily/react","lodash","ahooks","@formily/shared","@formily/antd-v5"],o):(m=typeof globalThis!="undefined"?globalThis:m||self,o(m["@nocobase/plugin-mobile-client"]={},m.jsxRuntime,m["@nocobase/client"],m["react-router-dom"],m.react,m.antd,m["react-i18next"],m["@ant-design/icons"],m["@formily/react"],m.lodash,m.ahooks,m["@formily/shared"],m["@formily/antd-v5"]))})(this,function(m,o,a,v,l,I,ce,T,f,U,le,de,Ct){"use strict";var fi=Object.defineProperty,bi=Object.defineProperties;var gi=Object.getOwnPropertyDescriptors;var wt=Object.getOwnPropertySymbols;var hi=Object.prototype.hasOwnProperty,vi=Object.prototype.propertyIsEnumerable;var Oe=(m,o,a)=>o in m?fi(m,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):m[o]=a,$=(m,o)=>{for(var a in o||(o={}))hi.call(o,a)&&Oe(m,a,o[a]);if(wt)for(var a of wt(o))vi.call(o,a)&&Oe(m,a,o[a]);return m},A=(m,o)=>bi(m,gi(o));var Pt=(m,o,a)=>(Oe(m,typeof o!="symbol"?o+"":o,a),a);var _=(m,o,a)=>new Promise((v,l)=>{var I=f=>{try{T(a.next(f))}catch(U){l(U)}},ce=f=>{try{T(a.throw(f))}catch(U){l(U)}},T=f=>f.done?v(f.value):Promise.resolve(f.value).then(I,ce);T((a=a.apply(m,o)).next())});function It(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=It(l),ke="mobile-client";function N(e){return`{{t('${e}', { ns: '${ke}', nsMode: 'fallback' })}}`}function w(){return ce.useTranslation([ke,"client"],{nsMode:"fallback"})}const Tt=()=>{const{t:e}=w(),t=v.useLocation(),n=l.useMemo(()=>{let r="/mobile";return t.pathname.startsWith("/apps")&&(r=t.pathname.split("/").slice(0,3).join("/")),r},[t.pathname]);return o.jsx(I.Card,{style:{minHeight:"600px"},children:o.jsx(I.Form,{layout:"vertical",children:o.jsx(I.Form.Item,{tooltip:`${e("The full address is")} ${window.origin}${n}`,label:e("Mobile client access address"),children:o.jsx(I.Input,{value:n,disabled:!0})})})})},Ee=l.createContext(null),Mt=e=>o.jsx(Ee.Provider,{value:{interface:!0},children:e.children}),Ne=()=>l.useContext(Ee),Be=l.memo(()=>{const t=a.usePlugin(Ie).getMobileRouterComponent();return o.jsx(Mt,{children:o.jsx("div",{className:a.css`
|
|
126
3
|
display: flex;
|
|
127
4
|
width: 100%;
|
|
128
5
|
height: 100%;
|
|
129
6
|
position: relative;
|
|
130
|
-
`,
|
|
131
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(MobileRouter, {})
|
|
132
|
-
}
|
|
133
|
-
) });
|
|
134
|
-
});
|
|
135
|
-
InterfaceRouter.displayName = "InterfaceRouter";
|
|
136
|
-
const iOS6 = (props) => {
|
|
137
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
138
|
-
"div",
|
|
139
|
-
{
|
|
140
|
-
className: client.cx(
|
|
141
|
-
"nb-mobile-device-ios6",
|
|
142
|
-
client.css(`
|
|
7
|
+
`,children:o.jsx(t,{})})})});Be.displayName="InterfaceRouter";const Ot=e=>o.jsx("div",{className:a.cx("nb-mobile-device-ios6",a.css(`
|
|
143
8
|
display: flex;
|
|
144
9
|
width: 375px;
|
|
145
10
|
height: 667px;
|
|
146
|
-
`),
|
|
147
|
-
props.className
|
|
148
|
-
),
|
|
149
|
-
children: props.children
|
|
150
|
-
}
|
|
151
|
-
);
|
|
152
|
-
};
|
|
153
|
-
const MobileDevice = (props) => {
|
|
154
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
155
|
-
"div",
|
|
156
|
-
{
|
|
157
|
-
className: client.cx(
|
|
158
|
-
"nb-mobile-device-wrapper",
|
|
159
|
-
client.css`
|
|
11
|
+
`),e.className),children:e.children}),kt=e=>o.jsx("div",{className:a.cx("nb-mobile-device-wrapper",a.css`
|
|
160
12
|
width: 100%;
|
|
161
13
|
height: 100%;
|
|
162
14
|
display: flex;
|
|
163
15
|
justify-content: center;
|
|
164
16
|
align-items: center;
|
|
165
17
|
margin-top: 50px;
|
|
166
|
-
`
|
|
167
|
-
),
|
|
168
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
169
|
-
iOS6,
|
|
170
|
-
{
|
|
171
|
-
className: client.css`
|
|
18
|
+
`),children:o.jsx(Ot,$({className:a.css`
|
|
172
19
|
box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
};
|
|
187
|
-
const isJSBridge = () => !!getJsBridge();
|
|
188
|
-
const JSBridgeFunction = {
|
|
189
|
-
/**
|
|
190
|
-
* @description JSBridge injects
|
|
191
|
-
*/
|
|
192
|
-
onBackPressed: () => {
|
|
193
|
-
if (history.length === 1) {
|
|
194
|
-
invoke({ action: "moveTaskToBack" });
|
|
195
|
-
} else {
|
|
196
|
-
history.back();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
Object.keys(JSBridgeFunction).forEach((key) => {
|
|
201
|
-
window[key] = JSBridgeFunction[key];
|
|
202
|
-
});
|
|
203
|
-
const MobileClientProvider = React.memo((props) => {
|
|
204
|
-
const { t: t2 } = useTranslation();
|
|
205
|
-
const location = reactRouterDom.useLocation();
|
|
206
|
-
const navigation = reactRouterDom.useNavigate();
|
|
207
|
-
React.useEffect(() => {
|
|
208
|
-
if (isJSBridge() && location.pathname === "/admin") {
|
|
209
|
-
navigation("/mobile", { replace: true });
|
|
210
|
-
}
|
|
211
|
-
}, [location.pathname, navigation]);
|
|
212
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
213
|
-
client.SettingsCenterProvider,
|
|
214
|
-
{
|
|
215
|
-
settings: {
|
|
216
|
-
["mobile-client"]: {
|
|
217
|
-
title: t2("Mobile Client-side"),
|
|
218
|
-
icon: "MobileOutlined",
|
|
219
|
-
tabs: {
|
|
220
|
-
interface: {
|
|
221
|
-
title: t2("Interface Configuration"),
|
|
222
|
-
component: InterfaceConfiguration
|
|
223
|
-
},
|
|
224
|
-
app: {
|
|
225
|
-
title: t2("App Configuration"),
|
|
226
|
-
component: AppConfiguration
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
children: props.children
|
|
232
|
-
}
|
|
233
|
-
);
|
|
234
|
-
});
|
|
235
|
-
const MBlockInitializers = {
|
|
236
|
-
title: '{{t("Add block")}}',
|
|
237
|
-
icon: "PlusOutlined",
|
|
238
|
-
wrap: client.gridRowColWrap,
|
|
239
|
-
items: [
|
|
240
|
-
{
|
|
241
|
-
key: "dataBlocks",
|
|
242
|
-
type: "itemGroup",
|
|
243
|
-
title: '{{t("Data blocks")}}',
|
|
244
|
-
children: [
|
|
245
|
-
{
|
|
246
|
-
key: "GridCard",
|
|
247
|
-
type: "item",
|
|
248
|
-
title: '{{t("Grid Card")}}',
|
|
249
|
-
component: "GridCardBlockInitializer"
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
key: "table",
|
|
253
|
-
type: "item",
|
|
254
|
-
title: '{{t("Table")}}',
|
|
255
|
-
component: "TableBlockInitializer"
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
key: "form",
|
|
259
|
-
type: "item",
|
|
260
|
-
title: '{{t("Form")}}',
|
|
261
|
-
component: "FormBlockInitializer"
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
key: "details",
|
|
265
|
-
type: "item",
|
|
266
|
-
title: '{{t("Details")}}',
|
|
267
|
-
component: "DetailsBlockInitializer"
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
key: "calendar",
|
|
271
|
-
type: "item",
|
|
272
|
-
title: '{{t("Calendar")}}',
|
|
273
|
-
component: "CalendarBlockInitializer"
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
key: "mapBlock",
|
|
277
|
-
type: "item",
|
|
278
|
-
title: generateNTemplate("Map"),
|
|
279
|
-
component: "MapBlockInitializer"
|
|
280
|
-
}
|
|
281
|
-
]
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
key: "otherBlocks",
|
|
285
|
-
type: "itemGroup",
|
|
286
|
-
title: '{{t("Other blocks")}}',
|
|
287
|
-
children: [
|
|
288
|
-
{
|
|
289
|
-
key: "menu",
|
|
290
|
-
type: "item",
|
|
291
|
-
title: generateNTemplate("Menu"),
|
|
292
|
-
component: "MMenuBlockInitializer",
|
|
293
|
-
sort: 100
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
key: "markdown",
|
|
297
|
-
type: "item",
|
|
298
|
-
title: '{{t("Markdown")}}',
|
|
299
|
-
component: "MarkdownBlockInitializer"
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
key: "settings",
|
|
303
|
-
type: "item",
|
|
304
|
-
title: generateNTemplate("Settings"),
|
|
305
|
-
component: "MSettingsBlockInitializer",
|
|
306
|
-
sort: 100
|
|
307
|
-
}
|
|
308
|
-
]
|
|
309
|
-
}
|
|
310
|
-
]
|
|
311
|
-
};
|
|
312
|
-
const MMenuBlockInitializer = (props) => {
|
|
313
|
-
const { insert } = props;
|
|
314
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
315
|
-
client.SchemaInitializer.Item,
|
|
316
|
-
{
|
|
317
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MenuOutlined, {}),
|
|
318
|
-
onClick: async () => {
|
|
319
|
-
insert({
|
|
320
|
-
type: "void",
|
|
321
|
-
"x-component": "MMenu",
|
|
322
|
-
"x-designer": "MMenu.Designer",
|
|
323
|
-
"x-component-props": {}
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
);
|
|
328
|
-
};
|
|
329
|
-
const global$1 = "";
|
|
330
|
-
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
331
|
-
if (canUseDom) {
|
|
332
|
-
document.addEventListener("touchstart", () => {
|
|
333
|
-
}, true);
|
|
334
|
-
}
|
|
335
|
-
function attachPropertiesToComponent(component, properties) {
|
|
336
|
-
const ret = component;
|
|
337
|
-
for (const key in properties) {
|
|
338
|
-
if (properties.hasOwnProperty(key)) {
|
|
339
|
-
ret[key] = properties[key];
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
return ret;
|
|
343
|
-
}
|
|
344
|
-
var classnames = { exports: {} };
|
|
345
|
-
/*!
|
|
346
|
-
Copyright (c) 2018 Jed Watson.
|
|
347
|
-
Licensed under the MIT License (MIT), see
|
|
348
|
-
http://jedwatson.github.io/classnames
|
|
349
|
-
*/
|
|
350
|
-
(function(module2) {
|
|
351
|
-
(function() {
|
|
352
|
-
var hasOwn = {}.hasOwnProperty;
|
|
353
|
-
function classNames2() {
|
|
354
|
-
var classes = [];
|
|
355
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
356
|
-
var arg = arguments[i];
|
|
357
|
-
if (!arg)
|
|
358
|
-
continue;
|
|
359
|
-
var argType = typeof arg;
|
|
360
|
-
if (argType === "string" || argType === "number") {
|
|
361
|
-
classes.push(arg);
|
|
362
|
-
} else if (Array.isArray(arg)) {
|
|
363
|
-
if (arg.length) {
|
|
364
|
-
var inner = classNames2.apply(null, arg);
|
|
365
|
-
if (inner) {
|
|
366
|
-
classes.push(inner);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
} else if (argType === "object") {
|
|
370
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
371
|
-
classes.push(arg.toString());
|
|
372
|
-
continue;
|
|
373
|
-
}
|
|
374
|
-
for (var key in arg) {
|
|
375
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
376
|
-
classes.push(key);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
return classes.join(" ");
|
|
382
|
-
}
|
|
383
|
-
if (module2.exports) {
|
|
384
|
-
classNames2.default = classNames2;
|
|
385
|
-
module2.exports = classNames2;
|
|
386
|
-
} else {
|
|
387
|
-
window.classNames = classNames2;
|
|
388
|
-
}
|
|
389
|
-
})();
|
|
390
|
-
})(classnames);
|
|
391
|
-
var classnamesExports = classnames.exports;
|
|
392
|
-
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
393
|
-
function withNativeProps(props, element) {
|
|
394
|
-
const p2 = Object.assign({}, element.props);
|
|
395
|
-
if (props.className) {
|
|
396
|
-
p2.className = classNames(element.props.className, props.className);
|
|
397
|
-
}
|
|
398
|
-
if (props.style) {
|
|
399
|
-
p2.style = Object.assign(Object.assign({}, p2.style), props.style);
|
|
400
|
-
}
|
|
401
|
-
if (props.tabIndex !== void 0) {
|
|
402
|
-
p2.tabIndex = props.tabIndex;
|
|
403
|
-
}
|
|
404
|
-
for (const key in props) {
|
|
405
|
-
if (!props.hasOwnProperty(key))
|
|
406
|
-
continue;
|
|
407
|
-
if (key.startsWith("data-") || key.startsWith("aria-")) {
|
|
408
|
-
p2[key] = props[key];
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
return React.cloneElement(element, p2);
|
|
412
|
-
}
|
|
413
|
-
var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
414
|
-
var _freeGlobal = freeGlobal$1;
|
|
415
|
-
var freeGlobal = _freeGlobal;
|
|
416
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
417
|
-
var root$2 = freeGlobal || freeSelf || Function("return this")();
|
|
418
|
-
var _root = root$2;
|
|
419
|
-
var root$1 = _root;
|
|
420
|
-
var Symbol$3 = root$1.Symbol;
|
|
421
|
-
var _Symbol = Symbol$3;
|
|
422
|
-
var Symbol$2 = _Symbol;
|
|
423
|
-
var objectProto$7 = Object.prototype;
|
|
424
|
-
var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
|
|
425
|
-
var nativeObjectToString$1 = objectProto$7.toString;
|
|
426
|
-
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
427
|
-
function getRawTag$1(value) {
|
|
428
|
-
var isOwn = hasOwnProperty$5.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
429
|
-
try {
|
|
430
|
-
value[symToStringTag$1] = void 0;
|
|
431
|
-
var unmasked = true;
|
|
432
|
-
} catch (e2) {
|
|
433
|
-
}
|
|
434
|
-
var result = nativeObjectToString$1.call(value);
|
|
435
|
-
if (unmasked) {
|
|
436
|
-
if (isOwn) {
|
|
437
|
-
value[symToStringTag$1] = tag;
|
|
438
|
-
} else {
|
|
439
|
-
delete value[symToStringTag$1];
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
return result;
|
|
443
|
-
}
|
|
444
|
-
var _getRawTag = getRawTag$1;
|
|
445
|
-
var objectProto$6 = Object.prototype;
|
|
446
|
-
var nativeObjectToString = objectProto$6.toString;
|
|
447
|
-
function objectToString$1(value) {
|
|
448
|
-
return nativeObjectToString.call(value);
|
|
449
|
-
}
|
|
450
|
-
var _objectToString = objectToString$1;
|
|
451
|
-
var Symbol$1 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
|
|
452
|
-
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
453
|
-
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
454
|
-
function baseGetTag$3(value) {
|
|
455
|
-
if (value == null) {
|
|
456
|
-
return value === void 0 ? undefinedTag : nullTag;
|
|
457
|
-
}
|
|
458
|
-
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
459
|
-
}
|
|
460
|
-
var _baseGetTag = baseGetTag$3;
|
|
461
|
-
function isObject$3(value) {
|
|
462
|
-
var type = typeof value;
|
|
463
|
-
return value != null && (type == "object" || type == "function");
|
|
464
|
-
}
|
|
465
|
-
var isObject_1 = isObject$3;
|
|
466
|
-
var baseGetTag$2 = _baseGetTag, isObject$2 = isObject_1;
|
|
467
|
-
var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
468
|
-
function isFunction$2(value) {
|
|
469
|
-
if (!isObject$2(value)) {
|
|
470
|
-
return false;
|
|
471
|
-
}
|
|
472
|
-
var tag = baseGetTag$2(value);
|
|
473
|
-
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
474
|
-
}
|
|
475
|
-
var isFunction_1 = isFunction$2;
|
|
476
|
-
var root = _root;
|
|
477
|
-
var coreJsData$1 = root["__core-js_shared__"];
|
|
478
|
-
var _coreJsData = coreJsData$1;
|
|
479
|
-
var coreJsData = _coreJsData;
|
|
480
|
-
var maskSrcKey = function() {
|
|
481
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
482
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
483
|
-
}();
|
|
484
|
-
function isMasked$1(func) {
|
|
485
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
486
|
-
}
|
|
487
|
-
var _isMasked = isMasked$1;
|
|
488
|
-
var funcProto$1 = Function.prototype;
|
|
489
|
-
var funcToString$1 = funcProto$1.toString;
|
|
490
|
-
function toSource$1(func) {
|
|
491
|
-
if (func != null) {
|
|
492
|
-
try {
|
|
493
|
-
return funcToString$1.call(func);
|
|
494
|
-
} catch (e2) {
|
|
495
|
-
}
|
|
496
|
-
try {
|
|
497
|
-
return func + "";
|
|
498
|
-
} catch (e2) {
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
return "";
|
|
502
|
-
}
|
|
503
|
-
var _toSource = toSource$1;
|
|
504
|
-
var isFunction$1 = isFunction_1, isMasked = _isMasked, isObject$1 = isObject_1, toSource = _toSource;
|
|
505
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
506
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
507
|
-
var funcProto = Function.prototype, objectProto$5 = Object.prototype;
|
|
508
|
-
var funcToString = funcProto.toString;
|
|
509
|
-
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
510
|
-
var reIsNative = RegExp(
|
|
511
|
-
"^" + funcToString.call(hasOwnProperty$4).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
512
|
-
);
|
|
513
|
-
function baseIsNative$1(value) {
|
|
514
|
-
if (!isObject$1(value) || isMasked(value)) {
|
|
515
|
-
return false;
|
|
516
|
-
}
|
|
517
|
-
var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
|
|
518
|
-
return pattern.test(toSource(value));
|
|
519
|
-
}
|
|
520
|
-
var _baseIsNative = baseIsNative$1;
|
|
521
|
-
function getValue$1(object, key) {
|
|
522
|
-
return object == null ? void 0 : object[key];
|
|
523
|
-
}
|
|
524
|
-
var _getValue = getValue$1;
|
|
525
|
-
var baseIsNative = _baseIsNative, getValue = _getValue;
|
|
526
|
-
function getNative$1(object, key) {
|
|
527
|
-
var value = getValue(object, key);
|
|
528
|
-
return baseIsNative(value) ? value : void 0;
|
|
529
|
-
}
|
|
530
|
-
var _getNative = getNative$1;
|
|
531
|
-
var getNative = _getNative;
|
|
532
|
-
var defineProperty$2 = function() {
|
|
533
|
-
try {
|
|
534
|
-
var func = getNative(Object, "defineProperty");
|
|
535
|
-
func({}, "", {});
|
|
536
|
-
return func;
|
|
537
|
-
} catch (e2) {
|
|
538
|
-
}
|
|
539
|
-
}();
|
|
540
|
-
var _defineProperty = defineProperty$2;
|
|
541
|
-
var defineProperty$1 = _defineProperty;
|
|
542
|
-
function baseAssignValue$2(object, key, value) {
|
|
543
|
-
if (key == "__proto__" && defineProperty$1) {
|
|
544
|
-
defineProperty$1(object, key, {
|
|
545
|
-
"configurable": true,
|
|
546
|
-
"enumerable": true,
|
|
547
|
-
"value": value,
|
|
548
|
-
"writable": true
|
|
549
|
-
});
|
|
550
|
-
} else {
|
|
551
|
-
object[key] = value;
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
var _baseAssignValue = baseAssignValue$2;
|
|
555
|
-
function eq$2(value, other) {
|
|
556
|
-
return value === other || value !== value && other !== other;
|
|
557
|
-
}
|
|
558
|
-
var eq_1 = eq$2;
|
|
559
|
-
var baseAssignValue$1 = _baseAssignValue, eq$1 = eq_1;
|
|
560
|
-
var objectProto$4 = Object.prototype;
|
|
561
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
562
|
-
function assignValue$1(object, key, value) {
|
|
563
|
-
var objValue = object[key];
|
|
564
|
-
if (!(hasOwnProperty$3.call(object, key) && eq$1(objValue, value)) || value === void 0 && !(key in object)) {
|
|
565
|
-
baseAssignValue$1(object, key, value);
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
var _assignValue = assignValue$1;
|
|
569
|
-
var assignValue = _assignValue, baseAssignValue = _baseAssignValue;
|
|
570
|
-
function copyObject$1(source, props, object, customizer) {
|
|
571
|
-
var isNew = !object;
|
|
572
|
-
object || (object = {});
|
|
573
|
-
var index = -1, length = props.length;
|
|
574
|
-
while (++index < length) {
|
|
575
|
-
var key = props[index];
|
|
576
|
-
var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
|
|
577
|
-
if (newValue === void 0) {
|
|
578
|
-
newValue = source[key];
|
|
579
|
-
}
|
|
580
|
-
if (isNew) {
|
|
581
|
-
baseAssignValue(object, key, newValue);
|
|
582
|
-
} else {
|
|
583
|
-
assignValue(object, key, newValue);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
return object;
|
|
587
|
-
}
|
|
588
|
-
var _copyObject = copyObject$1;
|
|
589
|
-
function identity$2(value) {
|
|
590
|
-
return value;
|
|
591
|
-
}
|
|
592
|
-
var identity_1 = identity$2;
|
|
593
|
-
function apply$1(func, thisArg, args) {
|
|
594
|
-
switch (args.length) {
|
|
595
|
-
case 0:
|
|
596
|
-
return func.call(thisArg);
|
|
597
|
-
case 1:
|
|
598
|
-
return func.call(thisArg, args[0]);
|
|
599
|
-
case 2:
|
|
600
|
-
return func.call(thisArg, args[0], args[1]);
|
|
601
|
-
case 3:
|
|
602
|
-
return func.call(thisArg, args[0], args[1], args[2]);
|
|
603
|
-
}
|
|
604
|
-
return func.apply(thisArg, args);
|
|
605
|
-
}
|
|
606
|
-
var _apply = apply$1;
|
|
607
|
-
var apply = _apply;
|
|
608
|
-
var nativeMax = Math.max;
|
|
609
|
-
function overRest$1(func, start, transform) {
|
|
610
|
-
start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
|
|
611
|
-
return function() {
|
|
612
|
-
var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
|
|
613
|
-
while (++index < length) {
|
|
614
|
-
array[index] = args[start + index];
|
|
615
|
-
}
|
|
616
|
-
index = -1;
|
|
617
|
-
var otherArgs = Array(start + 1);
|
|
618
|
-
while (++index < start) {
|
|
619
|
-
otherArgs[index] = args[index];
|
|
620
|
-
}
|
|
621
|
-
otherArgs[start] = transform(array);
|
|
622
|
-
return apply(func, this, otherArgs);
|
|
623
|
-
};
|
|
624
|
-
}
|
|
625
|
-
var _overRest = overRest$1;
|
|
626
|
-
function constant$1(value) {
|
|
627
|
-
return function() {
|
|
628
|
-
return value;
|
|
629
|
-
};
|
|
630
|
-
}
|
|
631
|
-
var constant_1 = constant$1;
|
|
632
|
-
var constant = constant_1, defineProperty = _defineProperty, identity$1 = identity_1;
|
|
633
|
-
var baseSetToString$1 = !defineProperty ? identity$1 : function(func, string) {
|
|
634
|
-
return defineProperty(func, "toString", {
|
|
635
|
-
"configurable": true,
|
|
636
|
-
"enumerable": false,
|
|
637
|
-
"value": constant(string),
|
|
638
|
-
"writable": true
|
|
639
|
-
});
|
|
640
|
-
};
|
|
641
|
-
var _baseSetToString = baseSetToString$1;
|
|
642
|
-
var HOT_COUNT = 800, HOT_SPAN = 16;
|
|
643
|
-
var nativeNow = Date.now;
|
|
644
|
-
function shortOut$1(func) {
|
|
645
|
-
var count = 0, lastCalled = 0;
|
|
646
|
-
return function() {
|
|
647
|
-
var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
|
|
648
|
-
lastCalled = stamp;
|
|
649
|
-
if (remaining > 0) {
|
|
650
|
-
if (++count >= HOT_COUNT) {
|
|
651
|
-
return arguments[0];
|
|
652
|
-
}
|
|
653
|
-
} else {
|
|
654
|
-
count = 0;
|
|
655
|
-
}
|
|
656
|
-
return func.apply(void 0, arguments);
|
|
657
|
-
};
|
|
658
|
-
}
|
|
659
|
-
var _shortOut = shortOut$1;
|
|
660
|
-
var baseSetToString = _baseSetToString, shortOut = _shortOut;
|
|
661
|
-
var setToString$1 = shortOut(baseSetToString);
|
|
662
|
-
var _setToString = setToString$1;
|
|
663
|
-
var identity = identity_1, overRest = _overRest, setToString = _setToString;
|
|
664
|
-
function baseRest$1(func, start) {
|
|
665
|
-
return setToString(overRest(func, start, identity), func + "");
|
|
666
|
-
}
|
|
667
|
-
var _baseRest = baseRest$1;
|
|
668
|
-
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
669
|
-
function isLength$2(value) {
|
|
670
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
|
|
671
|
-
}
|
|
672
|
-
var isLength_1 = isLength$2;
|
|
673
|
-
var isFunction = isFunction_1, isLength$1 = isLength_1;
|
|
674
|
-
function isArrayLike$2(value) {
|
|
675
|
-
return value != null && isLength$1(value.length) && !isFunction(value);
|
|
676
|
-
}
|
|
677
|
-
var isArrayLike_1 = isArrayLike$2;
|
|
678
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
679
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
680
|
-
function isIndex$2(value, length) {
|
|
681
|
-
var type = typeof value;
|
|
682
|
-
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
683
|
-
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
684
|
-
}
|
|
685
|
-
var _isIndex = isIndex$2;
|
|
686
|
-
var eq = eq_1, isArrayLike$1 = isArrayLike_1, isIndex$1 = _isIndex, isObject = isObject_1;
|
|
687
|
-
function isIterateeCall$1(value, index, object) {
|
|
688
|
-
if (!isObject(object)) {
|
|
689
|
-
return false;
|
|
690
|
-
}
|
|
691
|
-
var type = typeof index;
|
|
692
|
-
if (type == "number" ? isArrayLike$1(object) && isIndex$1(index, object.length) : type == "string" && index in object) {
|
|
693
|
-
return eq(object[index], value);
|
|
694
|
-
}
|
|
695
|
-
return false;
|
|
696
|
-
}
|
|
697
|
-
var _isIterateeCall = isIterateeCall$1;
|
|
698
|
-
var baseRest = _baseRest, isIterateeCall = _isIterateeCall;
|
|
699
|
-
function createAssigner$1(assigner) {
|
|
700
|
-
return baseRest(function(object, sources) {
|
|
701
|
-
var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
|
|
702
|
-
customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
|
|
703
|
-
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
704
|
-
customizer = length < 3 ? void 0 : customizer;
|
|
705
|
-
length = 1;
|
|
706
|
-
}
|
|
707
|
-
object = Object(object);
|
|
708
|
-
while (++index < length) {
|
|
709
|
-
var source = sources[index];
|
|
710
|
-
if (source) {
|
|
711
|
-
assigner(object, source, index, customizer);
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
return object;
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
var _createAssigner = createAssigner$1;
|
|
718
|
-
function baseTimes$1(n2, iteratee) {
|
|
719
|
-
var index = -1, result = Array(n2);
|
|
720
|
-
while (++index < n2) {
|
|
721
|
-
result[index] = iteratee(index);
|
|
722
|
-
}
|
|
723
|
-
return result;
|
|
724
|
-
}
|
|
725
|
-
var _baseTimes = baseTimes$1;
|
|
726
|
-
function isObjectLike$3(value) {
|
|
727
|
-
return value != null && typeof value == "object";
|
|
728
|
-
}
|
|
729
|
-
var isObjectLike_1 = isObjectLike$3;
|
|
730
|
-
var baseGetTag$1 = _baseGetTag, isObjectLike$2 = isObjectLike_1;
|
|
731
|
-
var argsTag$1 = "[object Arguments]";
|
|
732
|
-
function baseIsArguments$1(value) {
|
|
733
|
-
return isObjectLike$2(value) && baseGetTag$1(value) == argsTag$1;
|
|
734
|
-
}
|
|
735
|
-
var _baseIsArguments = baseIsArguments$1;
|
|
736
|
-
var baseIsArguments = _baseIsArguments, isObjectLike$1 = isObjectLike_1;
|
|
737
|
-
var objectProto$3 = Object.prototype;
|
|
738
|
-
var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
|
|
739
|
-
var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
|
|
740
|
-
var isArguments$1 = baseIsArguments(function() {
|
|
741
|
-
return arguments;
|
|
742
|
-
}()) ? baseIsArguments : function(value) {
|
|
743
|
-
return isObjectLike$1(value) && hasOwnProperty$2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
744
|
-
};
|
|
745
|
-
var isArguments_1 = isArguments$1;
|
|
746
|
-
var isArray$1 = Array.isArray;
|
|
747
|
-
var isArray_1 = isArray$1;
|
|
748
|
-
var isBuffer$1 = { exports: {} };
|
|
749
|
-
function stubFalse() {
|
|
750
|
-
return false;
|
|
751
|
-
}
|
|
752
|
-
var stubFalse_1 = stubFalse;
|
|
753
|
-
isBuffer$1.exports;
|
|
754
|
-
(function(module2, exports3) {
|
|
755
|
-
var root2 = _root, stubFalse2 = stubFalse_1;
|
|
756
|
-
var freeExports = exports3 && !exports3.nodeType && exports3;
|
|
757
|
-
var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
|
|
758
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
759
|
-
var Buffer2 = moduleExports ? root2.Buffer : void 0;
|
|
760
|
-
var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
|
|
761
|
-
var isBuffer2 = nativeIsBuffer || stubFalse2;
|
|
762
|
-
module2.exports = isBuffer2;
|
|
763
|
-
})(isBuffer$1, isBuffer$1.exports);
|
|
764
|
-
var isBufferExports = isBuffer$1.exports;
|
|
765
|
-
var baseGetTag = _baseGetTag, isLength = isLength_1, isObjectLike = isObjectLike_1;
|
|
766
|
-
var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", weakMapTag = "[object WeakMap]";
|
|
767
|
-
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
768
|
-
var typedArrayTags = {};
|
|
769
|
-
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
770
|
-
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
771
|
-
function baseIsTypedArray$1(value) {
|
|
772
|
-
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
773
|
-
}
|
|
774
|
-
var _baseIsTypedArray = baseIsTypedArray$1;
|
|
775
|
-
function baseUnary$1(func) {
|
|
776
|
-
return function(value) {
|
|
777
|
-
return func(value);
|
|
778
|
-
};
|
|
779
|
-
}
|
|
780
|
-
var _baseUnary = baseUnary$1;
|
|
781
|
-
var _nodeUtil = { exports: {} };
|
|
782
|
-
_nodeUtil.exports;
|
|
783
|
-
(function(module2, exports3) {
|
|
784
|
-
var freeGlobal2 = _freeGlobal;
|
|
785
|
-
var freeExports = exports3 && !exports3.nodeType && exports3;
|
|
786
|
-
var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
|
|
787
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
788
|
-
var freeProcess = moduleExports && freeGlobal2.process;
|
|
789
|
-
var nodeUtil2 = function() {
|
|
790
|
-
try {
|
|
791
|
-
var types = freeModule && freeModule.require && freeModule.require("util").types;
|
|
792
|
-
if (types) {
|
|
793
|
-
return types;
|
|
794
|
-
}
|
|
795
|
-
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
796
|
-
} catch (e2) {
|
|
797
|
-
}
|
|
798
|
-
}();
|
|
799
|
-
module2.exports = nodeUtil2;
|
|
800
|
-
})(_nodeUtil, _nodeUtil.exports);
|
|
801
|
-
var _nodeUtilExports = _nodeUtil.exports;
|
|
802
|
-
var baseIsTypedArray = _baseIsTypedArray, baseUnary = _baseUnary, nodeUtil = _nodeUtilExports;
|
|
803
|
-
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
804
|
-
var isTypedArray$1 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
805
|
-
var isTypedArray_1 = isTypedArray$1;
|
|
806
|
-
var baseTimes = _baseTimes, isArguments = isArguments_1, isArray = isArray_1, isBuffer = isBufferExports, isIndex = _isIndex, isTypedArray = isTypedArray_1;
|
|
807
|
-
var objectProto$2 = Object.prototype;
|
|
808
|
-
var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
|
|
809
|
-
function arrayLikeKeys$1(value, inherited) {
|
|
810
|
-
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
811
|
-
for (var key in value) {
|
|
812
|
-
if ((inherited || hasOwnProperty$1.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
813
|
-
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
814
|
-
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
815
|
-
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
816
|
-
isIndex(key, length)))) {
|
|
817
|
-
result.push(key);
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
return result;
|
|
821
|
-
}
|
|
822
|
-
var _arrayLikeKeys = arrayLikeKeys$1;
|
|
823
|
-
var objectProto$1 = Object.prototype;
|
|
824
|
-
function isPrototype$1(value) {
|
|
825
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$1;
|
|
826
|
-
return value === proto;
|
|
827
|
-
}
|
|
828
|
-
var _isPrototype = isPrototype$1;
|
|
829
|
-
function overArg$1(func, transform) {
|
|
830
|
-
return function(arg) {
|
|
831
|
-
return func(transform(arg));
|
|
832
|
-
};
|
|
833
|
-
}
|
|
834
|
-
var _overArg = overArg$1;
|
|
835
|
-
var overArg = _overArg;
|
|
836
|
-
var nativeKeys$1 = overArg(Object.keys, Object);
|
|
837
|
-
var _nativeKeys = nativeKeys$1;
|
|
838
|
-
var isPrototype = _isPrototype, nativeKeys = _nativeKeys;
|
|
839
|
-
var objectProto = Object.prototype;
|
|
840
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
841
|
-
function baseKeys$1(object) {
|
|
842
|
-
if (!isPrototype(object)) {
|
|
843
|
-
return nativeKeys(object);
|
|
844
|
-
}
|
|
845
|
-
var result = [];
|
|
846
|
-
for (var key in Object(object)) {
|
|
847
|
-
if (hasOwnProperty.call(object, key) && key != "constructor") {
|
|
848
|
-
result.push(key);
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
return result;
|
|
852
|
-
}
|
|
853
|
-
var _baseKeys = baseKeys$1;
|
|
854
|
-
var arrayLikeKeys = _arrayLikeKeys, baseKeys = _baseKeys, isArrayLike = isArrayLike_1;
|
|
855
|
-
function keys$1(object) {
|
|
856
|
-
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
857
|
-
}
|
|
858
|
-
var keys_1 = keys$1;
|
|
859
|
-
var copyObject = _copyObject, createAssigner = _createAssigner, keys = keys_1;
|
|
860
|
-
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
861
|
-
copyObject(source, keys(source), object, customizer);
|
|
862
|
-
});
|
|
863
|
-
var assignWith_1 = assignWith;
|
|
864
|
-
const assignWith$1 = /* @__PURE__ */ getDefaultExportFromCjs(assignWith_1);
|
|
865
|
-
function mergeProps(...items) {
|
|
866
|
-
function customizer(objValue, srcValue) {
|
|
867
|
-
return srcValue === void 0 ? objValue : srcValue;
|
|
868
|
-
}
|
|
869
|
-
let ret = Object.assign({}, items[0]);
|
|
870
|
-
for (let i = 1; i < items.length; i++) {
|
|
871
|
-
ret = assignWith$1(ret, items[i], customizer);
|
|
872
|
-
}
|
|
873
|
-
return ret;
|
|
874
|
-
}
|
|
875
|
-
function LeftOutline(props) {
|
|
876
|
-
return /* @__PURE__ */ React__namespace.createElement("svg", Object.assign({
|
|
877
|
-
width: "1em",
|
|
878
|
-
height: "1em",
|
|
879
|
-
viewBox: "0 0 48 48",
|
|
880
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
881
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
882
|
-
}, props, {
|
|
883
|
-
style: Object.assign({
|
|
884
|
-
verticalAlign: "-0.125em"
|
|
885
|
-
}, props.style),
|
|
886
|
-
className: ["antd-mobile-icon", props.className].filter(Boolean).join(" ")
|
|
887
|
-
}), /* @__PURE__ */ React__namespace.createElement("g", {
|
|
888
|
-
id: "LeftOutline-LeftOutline",
|
|
889
|
-
stroke: "none",
|
|
890
|
-
strokeWidth: 1,
|
|
891
|
-
fill: "none",
|
|
892
|
-
fillRule: "evenodd"
|
|
893
|
-
}, /* @__PURE__ */ React__namespace.createElement("g", {
|
|
894
|
-
id: "LeftOutline-编组"
|
|
895
|
-
}, /* @__PURE__ */ React__namespace.createElement("rect", {
|
|
896
|
-
id: "LeftOutline-矩形",
|
|
897
|
-
fill: "#FFFFFF",
|
|
898
|
-
opacity: 0,
|
|
899
|
-
x: 0,
|
|
900
|
-
y: 0,
|
|
901
|
-
width: 48,
|
|
902
|
-
height: 48
|
|
903
|
-
}), /* @__PURE__ */ React__namespace.createElement("path", {
|
|
904
|
-
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",
|
|
905
|
-
id: "LeftOutline-路径",
|
|
906
|
-
fill: "currentColor",
|
|
907
|
-
fillRule: "nonzero"
|
|
908
|
-
}))));
|
|
909
|
-
}
|
|
910
|
-
function RightOutline(props) {
|
|
911
|
-
return /* @__PURE__ */ React__namespace.createElement("svg", Object.assign({
|
|
912
|
-
width: "1em",
|
|
913
|
-
height: "1em",
|
|
914
|
-
viewBox: "0 0 48 48",
|
|
915
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
916
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
917
|
-
}, props, {
|
|
918
|
-
style: Object.assign({
|
|
919
|
-
verticalAlign: "-0.125em"
|
|
920
|
-
}, props.style),
|
|
921
|
-
className: ["antd-mobile-icon", props.className].filter(Boolean).join(" ")
|
|
922
|
-
}), /* @__PURE__ */ React__namespace.createElement("g", {
|
|
923
|
-
id: "RightOutline-RightOutline",
|
|
924
|
-
stroke: "none",
|
|
925
|
-
strokeWidth: 1,
|
|
926
|
-
fill: "none",
|
|
927
|
-
fillRule: "evenodd"
|
|
928
|
-
}, /* @__PURE__ */ React__namespace.createElement("g", {
|
|
929
|
-
id: "RightOutline-RightOutlined"
|
|
930
|
-
}, /* @__PURE__ */ React__namespace.createElement("rect", {
|
|
931
|
-
id: "RightOutline-矩形",
|
|
932
|
-
fill: "#FFFFFF",
|
|
933
|
-
opacity: 0,
|
|
934
|
-
x: 0,
|
|
935
|
-
y: 0,
|
|
936
|
-
width: 48,
|
|
937
|
-
height: 48
|
|
938
|
-
}), /* @__PURE__ */ React__namespace.createElement("path", {
|
|
939
|
-
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",
|
|
940
|
-
id: "RightOutline-right",
|
|
941
|
-
fill: "currentColor",
|
|
942
|
-
fillRule: "nonzero"
|
|
943
|
-
}))));
|
|
944
|
-
}
|
|
945
|
-
const safeArea = "";
|
|
946
|
-
const classPrefix$5 = "adm-safe-area";
|
|
947
|
-
const SafeArea = (props) => {
|
|
948
|
-
return withNativeProps(props, React.createElement("div", {
|
|
949
|
-
className: classNames(classPrefix$5, `${classPrefix$5}-position-${props.position}`)
|
|
950
|
-
}));
|
|
951
|
-
};
|
|
952
|
-
const badge = "";
|
|
953
|
-
const classPrefix$4 = `adm-badge`;
|
|
954
|
-
const dot = React.createElement(React.Fragment, null);
|
|
955
|
-
const Badge$1 = (props) => {
|
|
956
|
-
const {
|
|
957
|
-
content,
|
|
958
|
-
color,
|
|
959
|
-
children
|
|
960
|
-
} = props;
|
|
961
|
-
const isDot = content === dot;
|
|
962
|
-
const badgeCls = classNames(classPrefix$4, !!children && `${classPrefix$4}-fixed`, isDot && `${classPrefix$4}-dot`, props.bordered && `${classPrefix$4}-bordered`);
|
|
963
|
-
const element = content || content === 0 ? withNativeProps(props, React.createElement("div", {
|
|
964
|
-
className: badgeCls,
|
|
965
|
-
style: {
|
|
966
|
-
"--color": color
|
|
967
|
-
}
|
|
968
|
-
}, !isDot && React.createElement("div", {
|
|
969
|
-
className: `${classPrefix$4}-content`
|
|
970
|
-
}, content))) : null;
|
|
971
|
-
return children ? React.createElement("div", {
|
|
972
|
-
className: classNames(`${classPrefix$4}-wrapper`, props.wrapperClassName),
|
|
973
|
-
style: props.wrapperStyle
|
|
974
|
-
}, children, element) : element;
|
|
975
|
-
};
|
|
976
|
-
const Badge = attachPropertiesToComponent(Badge$1, {
|
|
977
|
-
dot
|
|
978
|
-
});
|
|
979
|
-
function usePropsValue(options) {
|
|
980
|
-
const {
|
|
981
|
-
value,
|
|
982
|
-
defaultValue,
|
|
983
|
-
onChange
|
|
984
|
-
} = options;
|
|
985
|
-
const update = ahooks.useUpdate();
|
|
986
|
-
const stateRef = React.useRef(value !== void 0 ? value : defaultValue);
|
|
987
|
-
if (value !== void 0) {
|
|
988
|
-
stateRef.current = value;
|
|
989
|
-
}
|
|
990
|
-
const setState = ahooks.useMemoizedFn((v2, forceTrigger = false) => {
|
|
991
|
-
const nextValue = typeof v2 === "function" ? v2(stateRef.current) : v2;
|
|
992
|
-
if (!forceTrigger && nextValue === stateRef.current)
|
|
993
|
-
return;
|
|
994
|
-
stateRef.current = nextValue;
|
|
995
|
-
update();
|
|
996
|
-
return onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);
|
|
997
|
-
});
|
|
998
|
-
return [stateRef.current, setState];
|
|
999
|
-
}
|
|
1000
|
-
var reactIs = { exports: {} };
|
|
1001
|
-
var reactIs_production_min = {};
|
|
1002
|
-
/**
|
|
1003
|
-
* @license React
|
|
1004
|
-
* react-is.production.min.js
|
|
1005
|
-
*
|
|
1006
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1007
|
-
*
|
|
1008
|
-
* This source code is licensed under the MIT license found in the
|
|
1009
|
-
* LICENSE file in the root directory of this source tree.
|
|
1010
|
-
*/
|
|
1011
|
-
var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u;
|
|
1012
|
-
u = Symbol.for("react.module.reference");
|
|
1013
|
-
function v(a) {
|
|
1014
|
-
if ("object" === typeof a && null !== a) {
|
|
1015
|
-
var r = a.$$typeof;
|
|
1016
|
-
switch (r) {
|
|
1017
|
-
case b:
|
|
1018
|
-
switch (a = a.type, a) {
|
|
1019
|
-
case d:
|
|
1020
|
-
case f:
|
|
1021
|
-
case e:
|
|
1022
|
-
case m:
|
|
1023
|
-
case n:
|
|
1024
|
-
return a;
|
|
1025
|
-
default:
|
|
1026
|
-
switch (a = a && a.$$typeof, a) {
|
|
1027
|
-
case k:
|
|
1028
|
-
case h:
|
|
1029
|
-
case l:
|
|
1030
|
-
case q:
|
|
1031
|
-
case p:
|
|
1032
|
-
case g:
|
|
1033
|
-
return a;
|
|
1034
|
-
default:
|
|
1035
|
-
return r;
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
case c:
|
|
1039
|
-
return r;
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
reactIs_production_min.ContextConsumer = h;
|
|
1044
|
-
reactIs_production_min.ContextProvider = g;
|
|
1045
|
-
reactIs_production_min.Element = b;
|
|
1046
|
-
reactIs_production_min.ForwardRef = l;
|
|
1047
|
-
reactIs_production_min.Fragment = d;
|
|
1048
|
-
reactIs_production_min.Lazy = q;
|
|
1049
|
-
reactIs_production_min.Memo = p;
|
|
1050
|
-
reactIs_production_min.Portal = c;
|
|
1051
|
-
reactIs_production_min.Profiler = f;
|
|
1052
|
-
reactIs_production_min.StrictMode = e;
|
|
1053
|
-
reactIs_production_min.Suspense = m;
|
|
1054
|
-
reactIs_production_min.SuspenseList = n;
|
|
1055
|
-
reactIs_production_min.isAsyncMode = function() {
|
|
1056
|
-
return false;
|
|
1057
|
-
};
|
|
1058
|
-
reactIs_production_min.isConcurrentMode = function() {
|
|
1059
|
-
return false;
|
|
1060
|
-
};
|
|
1061
|
-
reactIs_production_min.isContextConsumer = function(a) {
|
|
1062
|
-
return v(a) === h;
|
|
1063
|
-
};
|
|
1064
|
-
reactIs_production_min.isContextProvider = function(a) {
|
|
1065
|
-
return v(a) === g;
|
|
1066
|
-
};
|
|
1067
|
-
reactIs_production_min.isElement = function(a) {
|
|
1068
|
-
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
1069
|
-
};
|
|
1070
|
-
reactIs_production_min.isForwardRef = function(a) {
|
|
1071
|
-
return v(a) === l;
|
|
1072
|
-
};
|
|
1073
|
-
reactIs_production_min.isFragment = function(a) {
|
|
1074
|
-
return v(a) === d;
|
|
1075
|
-
};
|
|
1076
|
-
reactIs_production_min.isLazy = function(a) {
|
|
1077
|
-
return v(a) === q;
|
|
1078
|
-
};
|
|
1079
|
-
reactIs_production_min.isMemo = function(a) {
|
|
1080
|
-
return v(a) === p;
|
|
1081
|
-
};
|
|
1082
|
-
reactIs_production_min.isPortal = function(a) {
|
|
1083
|
-
return v(a) === c;
|
|
1084
|
-
};
|
|
1085
|
-
reactIs_production_min.isProfiler = function(a) {
|
|
1086
|
-
return v(a) === f;
|
|
1087
|
-
};
|
|
1088
|
-
reactIs_production_min.isStrictMode = function(a) {
|
|
1089
|
-
return v(a) === e;
|
|
1090
|
-
};
|
|
1091
|
-
reactIs_production_min.isSuspense = function(a) {
|
|
1092
|
-
return v(a) === m;
|
|
1093
|
-
};
|
|
1094
|
-
reactIs_production_min.isSuspenseList = function(a) {
|
|
1095
|
-
return v(a) === n;
|
|
1096
|
-
};
|
|
1097
|
-
reactIs_production_min.isValidElementType = function(a) {
|
|
1098
|
-
return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
|
|
1099
|
-
};
|
|
1100
|
-
reactIs_production_min.typeOf = v;
|
|
1101
|
-
{
|
|
1102
|
-
reactIs.exports = reactIs_production_min;
|
|
1103
|
-
}
|
|
1104
|
-
var reactIsExports = reactIs.exports;
|
|
1105
|
-
function traverseReactNode(children, fn) {
|
|
1106
|
-
let i = 0;
|
|
1107
|
-
function handle(target) {
|
|
1108
|
-
React.Children.forEach(target, (child) => {
|
|
1109
|
-
if (!reactIsExports.isFragment(child)) {
|
|
1110
|
-
fn(child, i);
|
|
1111
|
-
i += 1;
|
|
1112
|
-
} else {
|
|
1113
|
-
handle(child.props.children);
|
|
1114
|
-
}
|
|
1115
|
-
});
|
|
1116
|
-
}
|
|
1117
|
-
handle(children);
|
|
1118
|
-
}
|
|
1119
|
-
const list = "";
|
|
1120
|
-
const classPrefix$3 = `adm-list`;
|
|
1121
|
-
const defaultProps$2 = {
|
|
1122
|
-
mode: "default"
|
|
1123
|
-
};
|
|
1124
|
-
const List$1 = React.forwardRef((p2, ref) => {
|
|
1125
|
-
const props = mergeProps(defaultProps$2, p2);
|
|
1126
|
-
const nativeElementRef = React.useRef(null);
|
|
1127
|
-
React.useImperativeHandle(ref, () => ({
|
|
1128
|
-
get nativeElement() {
|
|
1129
|
-
return nativeElementRef.current;
|
|
1130
|
-
}
|
|
1131
|
-
}));
|
|
1132
|
-
return withNativeProps(props, React.createElement("div", {
|
|
1133
|
-
className: classNames(classPrefix$3, `${classPrefix$3}-${props.mode}`),
|
|
1134
|
-
ref: nativeElementRef
|
|
1135
|
-
}, props.header && React.createElement("div", {
|
|
1136
|
-
className: `${classPrefix$3}-header`
|
|
1137
|
-
}, props.header), React.createElement("div", {
|
|
1138
|
-
className: `${classPrefix$3}-body`
|
|
1139
|
-
}, React.createElement("div", {
|
|
1140
|
-
className: `${classPrefix$3}-body-inner`
|
|
1141
|
-
}, props.children))));
|
|
1142
|
-
});
|
|
1143
|
-
function isNodeWithContent(node) {
|
|
1144
|
-
return node !== void 0 && node !== null && node !== false;
|
|
1145
|
-
}
|
|
1146
|
-
const classPrefix$2 = `adm-list-item`;
|
|
1147
|
-
const ListItem = (props) => {
|
|
1148
|
-
var _a;
|
|
1149
|
-
const clickable = (_a = props.clickable) !== null && _a !== void 0 ? _a : !!props.onClick;
|
|
1150
|
-
const arrow = props.arrow === void 0 ? clickable : props.arrow;
|
|
1151
|
-
const content = React.createElement("div", {
|
|
1152
|
-
className: `${classPrefix$2}-content`
|
|
1153
|
-
}, isNodeWithContent(props.prefix) && React.createElement("div", {
|
|
1154
|
-
className: `${classPrefix$2}-content-prefix`
|
|
1155
|
-
}, props.prefix), React.createElement("div", {
|
|
1156
|
-
className: `${classPrefix$2}-content-main`
|
|
1157
|
-
}, isNodeWithContent(props.title) && React.createElement("div", {
|
|
1158
|
-
className: `${classPrefix$2}-title`
|
|
1159
|
-
}, props.title), props.children, isNodeWithContent(props.description) && React.createElement("div", {
|
|
1160
|
-
className: `${classPrefix$2}-description`
|
|
1161
|
-
}, props.description)), isNodeWithContent(props.extra) && React.createElement("div", {
|
|
1162
|
-
className: `${classPrefix$2}-content-extra`
|
|
1163
|
-
}, props.extra), isNodeWithContent(arrow) && React.createElement("div", {
|
|
1164
|
-
className: `${classPrefix$2}-content-arrow`
|
|
1165
|
-
}, arrow === true ? React.createElement(RightOutline, null) : arrow));
|
|
1166
|
-
return withNativeProps(props, React.createElement(clickable ? "a" : "div", {
|
|
1167
|
-
className: classNames(`${classPrefix$2}`, clickable ? ["adm-plain-anchor"] : [], props.disabled && `${classPrefix$2}-disabled`),
|
|
1168
|
-
onClick: props.disabled ? void 0 : props.onClick
|
|
1169
|
-
}, content));
|
|
1170
|
-
};
|
|
1171
|
-
const List = attachPropertiesToComponent(List$1, {
|
|
1172
|
-
Item: ListItem
|
|
1173
|
-
});
|
|
1174
|
-
const navBar = "";
|
|
1175
|
-
const classPrefix$1 = `adm-nav-bar`;
|
|
1176
|
-
const defaultProps$1 = {
|
|
1177
|
-
backArrow: true
|
|
1178
|
-
};
|
|
1179
|
-
const NavBar = (p2) => {
|
|
1180
|
-
const props = mergeProps(defaultProps$1, p2);
|
|
1181
|
-
const {
|
|
1182
|
-
back,
|
|
1183
|
-
backArrow
|
|
1184
|
-
} = props;
|
|
1185
|
-
return withNativeProps(props, React.createElement("div", {
|
|
1186
|
-
className: classNames(classPrefix$1)
|
|
1187
|
-
}, React.createElement("div", {
|
|
1188
|
-
className: `${classPrefix$1}-left`,
|
|
1189
|
-
role: "button"
|
|
1190
|
-
}, back !== null && React.createElement("div", {
|
|
1191
|
-
className: `${classPrefix$1}-back`,
|
|
1192
|
-
onClick: props.onBack
|
|
1193
|
-
}, backArrow && React.createElement("span", {
|
|
1194
|
-
className: `${classPrefix$1}-back-arrow`
|
|
1195
|
-
}, backArrow === true ? React.createElement(LeftOutline, null) : backArrow), React.createElement("span", {
|
|
1196
|
-
"aria-hidden": "true"
|
|
1197
|
-
}, back)), props.left), React.createElement("div", {
|
|
1198
|
-
className: `${classPrefix$1}-title`
|
|
1199
|
-
}, props.children), React.createElement("div", {
|
|
1200
|
-
className: `${classPrefix$1}-right`
|
|
1201
|
-
}, props.right)));
|
|
1202
|
-
};
|
|
1203
|
-
const tabBar = "";
|
|
1204
|
-
const TabBarItem$1 = () => {
|
|
1205
|
-
return null;
|
|
1206
|
-
};
|
|
1207
|
-
const classPrefix = `adm-tab-bar`;
|
|
1208
|
-
const defaultProps = {
|
|
1209
|
-
safeArea: false
|
|
1210
|
-
};
|
|
1211
|
-
const TabBar$1 = (p2) => {
|
|
1212
|
-
var _a;
|
|
1213
|
-
const props = mergeProps(defaultProps, p2);
|
|
1214
|
-
let firstActiveKey = null;
|
|
1215
|
-
const items = [];
|
|
1216
|
-
traverseReactNode(props.children, (child, index) => {
|
|
1217
|
-
if (!React.isValidElement(child))
|
|
1218
|
-
return;
|
|
1219
|
-
const key = child.key;
|
|
1220
|
-
if (typeof key !== "string")
|
|
1221
|
-
return;
|
|
1222
|
-
if (index === 0) {
|
|
1223
|
-
firstActiveKey = key;
|
|
1224
|
-
}
|
|
1225
|
-
items.push(child);
|
|
1226
|
-
});
|
|
1227
|
-
const [activeKey, setActiveKey] = usePropsValue({
|
|
1228
|
-
value: props.activeKey,
|
|
1229
|
-
defaultValue: (_a = props.defaultActiveKey) !== null && _a !== void 0 ? _a : firstActiveKey,
|
|
1230
|
-
onChange: (v2) => {
|
|
1231
|
-
var _a2;
|
|
1232
|
-
if (v2 === null)
|
|
1233
|
-
return;
|
|
1234
|
-
(_a2 = props.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, v2);
|
|
1235
|
-
}
|
|
1236
|
-
});
|
|
1237
|
-
return withNativeProps(props, React.createElement("div", {
|
|
1238
|
-
className: classPrefix
|
|
1239
|
-
}, React.createElement("div", {
|
|
1240
|
-
className: `${classPrefix}-wrap`
|
|
1241
|
-
}, items.map((item) => {
|
|
1242
|
-
const active = item.key === activeKey;
|
|
1243
|
-
function renderContent() {
|
|
1244
|
-
const iconElement = item.props.icon && React.createElement("div", {
|
|
1245
|
-
className: `${classPrefix}-item-icon`
|
|
1246
|
-
}, typeof item.props.icon === "function" ? item.props.icon(active) : item.props.icon);
|
|
1247
|
-
const titleElement = item.props.title && React.createElement("div", {
|
|
1248
|
-
className: classNames(`${classPrefix}-item-title`, Boolean(iconElement) && `${classPrefix}-item-title-with-icon`)
|
|
1249
|
-
}, typeof item.props.title === "function" ? item.props.title(active) : item.props.title);
|
|
1250
|
-
if (iconElement) {
|
|
1251
|
-
return React.createElement(React.Fragment, null, React.createElement(Badge, {
|
|
1252
|
-
content: item.props.badge,
|
|
1253
|
-
className: `${classPrefix}-icon-badge`
|
|
1254
|
-
}, iconElement), titleElement);
|
|
1255
|
-
} else if (titleElement) {
|
|
1256
|
-
return React.createElement(Badge, {
|
|
1257
|
-
content: item.props.badge,
|
|
1258
|
-
className: `${classPrefix}-title-badge`
|
|
1259
|
-
}, titleElement);
|
|
1260
|
-
}
|
|
1261
|
-
return null;
|
|
1262
|
-
}
|
|
1263
|
-
return withNativeProps(item.props, React.createElement("div", {
|
|
1264
|
-
key: item.key,
|
|
1265
|
-
onClick: () => {
|
|
1266
|
-
const {
|
|
1267
|
-
key
|
|
1268
|
-
} = item;
|
|
1269
|
-
if (key === void 0 || key === null)
|
|
1270
|
-
return;
|
|
1271
|
-
setActiveKey(key.toString());
|
|
1272
|
-
},
|
|
1273
|
-
className: classNames(`${classPrefix}-item`, {
|
|
1274
|
-
[`${classPrefix}-item-active`]: active
|
|
1275
|
-
})
|
|
1276
|
-
}, renderContent()));
|
|
1277
|
-
})), props.safeArea && React.createElement(SafeArea, {
|
|
1278
|
-
position: "bottom"
|
|
1279
|
-
})));
|
|
1280
|
-
};
|
|
1281
|
-
const TabBar = attachPropertiesToComponent(TabBar$1, {
|
|
1282
|
-
Item: TabBarItem$1
|
|
1283
|
-
});
|
|
1284
|
-
const PageSchema = {
|
|
1285
|
-
type: "void",
|
|
1286
|
-
"x-component": "MPage",
|
|
1287
|
-
"x-designer": "MPage.Designer",
|
|
1288
|
-
"x-component-props": {},
|
|
1289
|
-
properties: {
|
|
1290
|
-
grid: {
|
|
1291
|
-
type: "void",
|
|
1292
|
-
"x-component": "Grid",
|
|
1293
|
-
"x-initializer": "MBlockInitializers",
|
|
1294
|
-
"x-component-props": {
|
|
1295
|
-
showDivider: false
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
};
|
|
1300
|
-
const MenuDesigner = (props) => {
|
|
1301
|
-
const { t: t2 } = useTranslation();
|
|
1302
|
-
const fieldSchema = react.useFieldSchema();
|
|
1303
|
-
const { dn } = client.useDesignable();
|
|
1304
|
-
const field = react.useField();
|
|
1305
|
-
const schemaSettingsProps = {
|
|
1306
|
-
dn,
|
|
1307
|
-
field,
|
|
1308
|
-
fieldSchema
|
|
1309
|
-
};
|
|
1310
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1311
|
-
client.SchemaSettings,
|
|
1312
|
-
{
|
|
1313
|
-
title: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1314
|
-
antd.Button,
|
|
1315
|
-
{
|
|
1316
|
-
style: {
|
|
1317
|
-
borderColor: "var(--colorSettings)",
|
|
1318
|
-
color: "var(--colorSettings)"
|
|
1319
|
-
},
|
|
1320
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MenuOutlined, {}),
|
|
1321
|
-
type: "dashed",
|
|
1322
|
-
children: t2("Menu configuration")
|
|
1323
|
-
}
|
|
1324
|
-
),
|
|
1325
|
-
...schemaSettingsProps,
|
|
1326
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1327
|
-
client.SchemaSettings.Remove,
|
|
1328
|
-
{
|
|
1329
|
-
removeParentsIfNoChildren: true,
|
|
1330
|
-
confirm: {
|
|
1331
|
-
title: t2("Delete menu block")
|
|
1332
|
-
},
|
|
1333
|
-
breakRemoveOn: {
|
|
1334
|
-
"x-component": "Grid"
|
|
1335
|
-
}
|
|
1336
|
-
},
|
|
1337
|
-
"remove"
|
|
1338
|
-
)
|
|
1339
|
-
}
|
|
1340
|
-
);
|
|
1341
|
-
};
|
|
1342
|
-
const useSchemaPatch = () => {
|
|
1343
|
-
const { dn } = client.useDesignable();
|
|
1344
|
-
const fieldSchema = react.useFieldSchema();
|
|
1345
|
-
const field = react.useField();
|
|
1346
|
-
const onUpdateComponentProps = ahooks.useMemoizedFn(async (data) => {
|
|
1347
|
-
lodash.set(fieldSchema, "x-component-props", data);
|
|
1348
|
-
field.componentProps = { ...field.componentProps, ...data };
|
|
1349
|
-
await dn.emit("patch", {
|
|
1350
|
-
schema: {
|
|
1351
|
-
["x-uid"]: fieldSchema["x-uid"],
|
|
1352
|
-
"x-component-props": fieldSchema["x-component-props"],
|
|
1353
|
-
"x-server-hooks": [
|
|
1354
|
-
{
|
|
1355
|
-
type: "onSelfSave",
|
|
1356
|
-
method: "extractTextToLocale"
|
|
1357
|
-
}
|
|
1358
|
-
]
|
|
1359
|
-
}
|
|
1360
|
-
});
|
|
1361
|
-
await dn.refresh();
|
|
1362
|
-
});
|
|
1363
|
-
return { onUpdateComponentProps };
|
|
1364
|
-
};
|
|
1365
|
-
const menuItemSchema = {
|
|
1366
|
-
properties: {
|
|
1367
|
-
name: {
|
|
1368
|
-
type: "string",
|
|
1369
|
-
title: generateNTemplate("Menu name"),
|
|
1370
|
-
required: true,
|
|
1371
|
-
"x-component": "Input",
|
|
1372
|
-
"x-decorator": "FormItem"
|
|
1373
|
-
},
|
|
1374
|
-
icon: {
|
|
1375
|
-
"x-decorator": "FormItem",
|
|
1376
|
-
"x-component": "IconPicker",
|
|
1377
|
-
title: generateNTemplate("Icon"),
|
|
1378
|
-
"x-component-props": {}
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
};
|
|
1382
|
-
const InternalMenuItem = (props) => {
|
|
1383
|
-
const { icon, name } = props;
|
|
1384
|
-
const Designer2 = client.useDesigner();
|
|
1385
|
-
const navigate = reactRouterDom.useNavigate();
|
|
1386
|
-
const location = reactRouterDom.useLocation();
|
|
1387
|
-
const fieldSchema = react.useFieldSchema();
|
|
1388
|
-
const compile = client.useCompile();
|
|
1389
|
-
const params = reactRouterDom.useParams();
|
|
1390
|
-
const onToPage = () => {
|
|
1391
|
-
const locationPath = location.pathname.endsWith("/") ? location.pathname.slice(0, -1) : location.pathname;
|
|
1392
|
-
navigate(params.name ? `/mobile/${fieldSchema["x-uid"]}` : `${locationPath}/${fieldSchema["x-uid"]}`);
|
|
1393
|
-
};
|
|
1394
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1395
|
-
client.SortableItem,
|
|
1396
|
-
{
|
|
1397
|
-
className: client.cx(
|
|
1398
|
-
"nb-mobile-menu-item",
|
|
1399
|
-
client.css`
|
|
20
|
+
`},e))}),Et=()=>o.jsx(kt,{children:o.jsx(Be,{})}),je=()=>window.JsBridge,Nt=(e,t)=>je().invoke(e,t),Bt=()=>!!je(),Ae={onBackPressed:()=>{history.length===1?Nt({action:"moveTaskToBack"}):history.back()}};Object.keys(Ae).forEach(e=>{window[e]=Ae[e]});const jt=l.memo(e=>{const{t}=w(),n=v.useLocation(),r=v.useNavigate();return l.useEffect(()=>{Bt()&&n.pathname==="/admin"&&r("/mobile",{replace:!0})},[n.pathname,r]),o.jsx(a.SettingsCenterProvider,{settings:{"mobile-client":{title:t("Mobile Client-side"),icon:"MobileOutlined",tabs:{interface:{title:t("Interface Configuration"),component:Et},app:{title:t("App Configuration"),component:Tt}}}},children:e.children})}),At={title:'{{t("Add block")}}',icon:"PlusOutlined",wrap:a.gridRowColWrap,items:[{key:"dataBlocks",type:"itemGroup",title:'{{t("Data blocks")}}',children:[{key:"GridCard",type:"item",title:'{{t("Grid Card")}}',component:"GridCardBlockInitializer"},{key:"table",type:"item",title:'{{t("Table")}}',component:"TableBlockInitializer"},{key:"form",type:"item",title:'{{t("Form")}}',component:"FormBlockInitializer"},{key:"details",type:"item",title:'{{t("Details")}}',component:"DetailsBlockInitializer"},{key:"calendar",type:"item",title:'{{t("Calendar")}}',component:"CalendarBlockInitializer"},{key:"mapBlock",type:"item",title:N("Map"),component:"MapBlockInitializer"}]},{key:"otherBlocks",type:"itemGroup",title:'{{t("Other blocks")}}',children:[{key:"menu",type:"item",title:N("Menu"),component:"MMenuBlockInitializer",sort:100},{key:"markdown",type:"item",title:'{{t("Markdown")}}',component:"MarkdownBlockInitializer"},{key:"settings",type:"item",title:N("Settings"),component:"MSettingsBlockInitializer",sort:100}]}]},_t=e=>{const{insert:t}=e;return o.jsx(a.SchemaInitializer.Item,{icon:o.jsx(T.MenuOutlined,{}),onClick:()=>_(this,null,function*(){t({type:"void","x-component":"MMenu","x-designer":"MMenu.Designer","x-component-props":{}})})})},yi="";!!(typeof window!="undefined"&&typeof document!="undefined"&&window.document&&window.document.createElement)&&document.addEventListener("touchstart",()=>{},!0);function pe(e,t){const n=e;for(const r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}var W=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function _e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fe={exports:{}};/*!
|
|
21
|
+
Copyright (c) 2018 Jed Watson.
|
|
22
|
+
Licensed under the MIT License (MIT), see
|
|
23
|
+
http://jedwatson.github.io/classnames
|
|
24
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i<arguments.length;i++){var c=arguments[i];if(c){var d=typeof c;if(d==="string"||d==="number")r.push(c);else if(Array.isArray(c)){if(c.length){var s=n.apply(null,c);s&&r.push(s)}}else if(d==="object"){if(c.toString!==Object.prototype.toString&&!c.toString.toString().includes("[native code]")){r.push(c.toString());continue}for(var u in c)t.call(c,u)&&c[u]&&r.push(u)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Fe);var Ft=Fe.exports;const O=_e(Ft);function F(e,t){const n=Object.assign({},t.props);e.className&&(n.className=O(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 r in e)e.hasOwnProperty(r)&&(r.startsWith("data-")||r.startsWith("aria-"))&&(n[r]=e[r]);return l.cloneElement(t,n)}var Lt=typeof W=="object"&&W&&W.Object===Object&&W,Le=Lt,Dt=Le,zt=typeof self=="object"&&self&&self.Object===Object&&self,Gt=Dt||zt||Function("return this")(),ue=Gt,Ut=ue,qt=Ut.Symbol,De=qt,ze=De,Ge=Object.prototype,Ht=Ge.hasOwnProperty,Vt=Ge.toString,q=ze?ze.toStringTag:void 0;function Kt(e){var t=Ht.call(e,q),n=e[q];try{e[q]=void 0;var r=!0}catch(c){}var i=Vt.call(e);return r&&(t?e[q]=n:delete e[q]),i}var Wt=Kt,Jt=Object.prototype,Xt=Jt.toString;function Zt(e){return Xt.call(e)}var Qt=Zt,Ue=De,Yt=Wt,Rt=Qt,en="[object Null]",tn="[object Undefined]",qe=Ue?Ue.toStringTag:void 0;function nn(e){return e==null?e===void 0?tn:en:qe&&qe in Object(e)?Yt(e):Rt(e)}var me=nn;function rn(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var fe=rn,on=me,an=fe,sn="[object AsyncFunction]",cn="[object Function]",ln="[object GeneratorFunction]",dn="[object Proxy]";function pn(e){if(!an(e))return!1;var t=on(e);return t==cn||t==ln||t==sn||t==dn}var He=pn,un=ue,mn=un["__core-js_shared__"],fn=mn,be=fn,Ve=function(){var e=/[^.]+$/.exec(be&&be.keys&&be.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function bn(e){return!!Ve&&Ve in e}var gn=bn,hn=Function.prototype,vn=hn.toString;function yn(e){if(e!=null){try{return vn.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var xn=yn,Sn=He,$n=gn,wn=fe,Pn=xn,Cn=/[\\^$.*+?()[\]{}|]/g,In=/^\[object .+?Constructor\]$/,Tn=Function.prototype,Mn=Object.prototype,On=Tn.toString,kn=Mn.hasOwnProperty,En=RegExp("^"+On.call(kn).replace(Cn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Nn(e){if(!wn(e)||$n(e))return!1;var t=Sn(e)?En:In;return t.test(Pn(e))}var Bn=Nn;function jn(e,t){return e==null?void 0:e[t]}var An=jn,_n=Bn,Fn=An;function Ln(e,t){var n=Fn(e,t);return _n(n)?n:void 0}var Dn=Ln,zn=Dn,Gn=function(){try{var e=zn(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Ke=Gn,We=Ke;function Un(e,t,n){t=="__proto__"&&We?We(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Je=Un;function qn(e,t){return e===t||e!==e&&t!==t}var Xe=qn,Hn=Je,Vn=Xe,Kn=Object.prototype,Wn=Kn.hasOwnProperty;function Jn(e,t,n){var r=e[t];(!(Wn.call(e,t)&&Vn(r,n))||n===void 0&&!(t in e))&&Hn(e,t,n)}var Xn=Jn,Zn=Xn,Qn=Je;function Yn(e,t,n,r){var i=!n;n||(n={});for(var c=-1,d=t.length;++c<d;){var s=t[c],u=r?r(n[s],e[s],s,n,e):void 0;u===void 0&&(u=e[s]),i?Qn(n,s,u):Zn(n,s,u)}return n}var Rn=Yn;function er(e){return e}var Ze=er;function tr(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 nr=tr,rr=nr,Qe=Math.max;function or(e,t,n){return t=Qe(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,c=Qe(r.length-t,0),d=Array(c);++i<c;)d[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(d),rr(e,this,s)}}var ar=or;function ir(e){return function(){return e}}var sr=ir,cr=sr,Ye=Ke,lr=Ze,dr=Ye?function(e,t){return Ye(e,"toString",{configurable:!0,enumerable:!1,value:cr(t),writable:!0})}:lr,pr=dr,ur=800,mr=16,fr=Date.now;function br(e){var t=0,n=0;return function(){var r=fr(),i=mr-(r-n);if(n=r,i>0){if(++t>=ur)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var gr=br,hr=pr,vr=gr,yr=vr(hr),xr=yr,Sr=Ze,$r=ar,wr=xr;function Pr(e,t){return wr($r(e,t,Sr),e+"")}var Cr=Pr,Ir=9007199254740991;function Tr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ir}var Re=Tr,Mr=He,Or=Re;function kr(e){return e!=null&&Or(e.length)&&!Mr(e)}var et=kr,Er=9007199254740991,Nr=/^(?:0|[1-9]\d*)$/;function Br(e,t){var n=typeof e;return t=t==null?Er:t,!!t&&(n=="number"||n!="symbol"&&Nr.test(e))&&e>-1&&e%1==0&&e<t}var tt=Br,jr=Xe,Ar=et,_r=tt,Fr=fe;function Lr(e,t,n){if(!Fr(n))return!1;var r=typeof t;return(r=="number"?Ar(n)&&_r(t,n.length):r=="string"&&t in n)?jr(n[t],e):!1}var Dr=Lr,zr=Cr,Gr=Dr;function Ur(e){return zr(function(t,n){var r=-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&&Gr(n[0],n[1],d)&&(c=i<3?void 0:c,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,c)}return t})}var qr=Ur;function Hr(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Vr=Hr;function Kr(e){return e!=null&&typeof e=="object"}var ge=Kr,Wr=me,Jr=ge,Xr="[object Arguments]";function Zr(e){return Jr(e)&&Wr(e)==Xr}var Qr=Zr,nt=Qr,Yr=ge,rt=Object.prototype,Rr=rt.hasOwnProperty,eo=rt.propertyIsEnumerable,to=nt(function(){return arguments}())?nt:function(e){return Yr(e)&&Rr.call(e,"callee")&&!eo.call(e,"callee")},no=to,ro=Array.isArray,oo=ro,J={exports:{}};function ao(){return!1}var io=ao;J.exports,function(e,t){var n=ue,r=io,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||r;e.exports=p}(J,J.exports);var so=J.exports,co=me,lo=Re,po=ge,uo="[object Arguments]",mo="[object Array]",fo="[object Boolean]",bo="[object Date]",go="[object Error]",ho="[object Function]",vo="[object Map]",yo="[object Number]",xo="[object Object]",So="[object RegExp]",$o="[object Set]",wo="[object String]",Po="[object WeakMap]",Co="[object ArrayBuffer]",Io="[object DataView]",To="[object Float32Array]",Mo="[object Float64Array]",Oo="[object Int8Array]",ko="[object Int16Array]",Eo="[object Int32Array]",No="[object Uint8Array]",Bo="[object Uint8ClampedArray]",jo="[object Uint16Array]",Ao="[object Uint32Array]",h={};h[To]=h[Mo]=h[Oo]=h[ko]=h[Eo]=h[No]=h[Bo]=h[jo]=h[Ao]=!0,h[uo]=h[mo]=h[Co]=h[fo]=h[Io]=h[bo]=h[go]=h[ho]=h[vo]=h[yo]=h[xo]=h[So]=h[$o]=h[wo]=h[Po]=!1;function _o(e){return po(e)&&lo(e.length)&&!!h[co(e)]}var Fo=_o;function Lo(e){return function(t){return e(t)}}var Do=Lo,X={exports:{}};X.exports,function(e,t){var n=Le,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,c=i&&i.exports===r,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}(X,X.exports);var zo=X.exports,Go=Fo,Uo=Do,ot=zo,at=ot&&ot.isTypedArray,qo=at?Uo(at):Go,Ho=qo,Vo=Vr,Ko=no,Wo=oo,Jo=so,Xo=tt,Zo=Ho,Qo=Object.prototype,Yo=Qo.hasOwnProperty;function Ro(e,t){var n=Wo(e),r=!n&&Ko(e),i=!n&&!r&&Jo(e),c=!n&&!r&&!i&&Zo(e),d=n||r||i||c,s=d?Vo(e.length,String):[],u=s.length;for(var p in e)(t||Yo.call(e,p))&&!(d&&(p=="length"||i&&(p=="offset"||p=="parent")||c&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||Xo(p,u)))&&s.push(p);return s}var ea=Ro,ta=Object.prototype;function na(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||ta;return e===n}var ra=na;function oa(e,t){return function(n){return e(t(n))}}var aa=oa,ia=aa,sa=ia(Object.keys,Object),ca=sa,la=ra,da=ca,pa=Object.prototype,ua=pa.hasOwnProperty;function ma(e){if(!la(e))return da(e);var t=[];for(var n in Object(e))ua.call(e,n)&&n!="constructor"&&t.push(n);return t}var fa=ma,ba=ea,ga=fa,ha=et;function va(e){return ha(e)?ba(e):ga(e)}var ya=va,xa=Rn,Sa=qr,$a=ya,wa=Sa(function(e,t,n,r){xa(t,$a(t),e,r)}),Pa=wa;const Ca=_e(Pa);function he(...e){function t(r,i){return i===void 0?r:i}let n=Object.assign({},e[0]);for(let r=1;r<e.length;r++)n=Ca(n,e[r],t);return n}function Ia(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 Ta(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 Si="",it="adm-safe-area",Ma=e=>F(e,l.createElement("div",{className:O(it,`${it}-position-${e.position}`)})),$i="",D="adm-badge",st=l.createElement(l.Fragment,null),ct=pe(e=>{const{content:t,color:n,children:r}=e,i=t===st,c=O(D,!!r&&`${D}-fixed`,i&&`${D}-dot`,e.bordered&&`${D}-bordered`),d=t||t===0?F(e,l.createElement("div",{className:c,style:{"--color":n}},!i&&l.createElement("div",{className:`${D}-content`},t))):null;return r?l.createElement("div",{className:O(`${D}-wrapper`,e.wrapperClassName),style:e.wrapperStyle},r,d):d},{dot:st});function Oa(e){const{value:t,defaultValue:n,onChange:r}=e,i=le.useUpdate(),c=l.useRef(t!==void 0?t:n);t!==void 0&&(c.current=t);const d=le.useMemoizedFn((s,u=!1)=>{const p=typeof s=="function"?s(c.current):s;if(!(!u&&p===c.current))return c.current=p,i(),r==null?void 0:r(p)});return[c.current,d]}var lt={exports:{}},b={};/**
|
|
25
|
+
* @license React
|
|
26
|
+
* react-is.production.min.js
|
|
27
|
+
*
|
|
28
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the MIT license found in the
|
|
31
|
+
* LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/var ve=Symbol.for("react.element"),ye=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),ee=Symbol.for("react.context"),ka=Symbol.for("react.server_context"),te=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),Ea=Symbol.for("react.offscreen"),dt;dt=Symbol.for("react.module.reference");function P(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ve:switch(e=e.type,e){case Z:case Y:case Q:case ne:case re:return e;default:switch(e=e&&e.$$typeof,e){case ka:case ee:case te:case ae:case oe:case R:return e;default:return t}}case ye:return t}}}b.ContextConsumer=ee,b.ContextProvider=R,b.Element=ve,b.ForwardRef=te,b.Fragment=Z,b.Lazy=ae,b.Memo=oe,b.Portal=ye,b.Profiler=Y,b.StrictMode=Q,b.Suspense=ne,b.SuspenseList=re,b.isAsyncMode=function(){return!1},b.isConcurrentMode=function(){return!1},b.isContextConsumer=function(e){return P(e)===ee},b.isContextProvider=function(e){return P(e)===R},b.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ve},b.isForwardRef=function(e){return P(e)===te},b.isFragment=function(e){return P(e)===Z},b.isLazy=function(e){return P(e)===ae},b.isMemo=function(e){return P(e)===oe},b.isPortal=function(e){return P(e)===ye},b.isProfiler=function(e){return P(e)===Y},b.isStrictMode=function(e){return P(e)===Q},b.isSuspense=function(e){return P(e)===ne},b.isSuspenseList=function(e){return P(e)===re},b.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Z||e===Y||e===Q||e===ne||e===re||e===Ea||typeof e=="object"&&e!==null&&(e.$$typeof===ae||e.$$typeof===oe||e.$$typeof===R||e.$$typeof===ee||e.$$typeof===te||e.$$typeof===dt||e.getModuleId!==void 0)},b.typeOf=P,lt.exports=b;var Na=lt.exports;function Ba(e,t){let n=0;function r(i){l.Children.forEach(i,c=>{Na.isFragment(c)?r(c.props.children):(t(c,n),n+=1)})}r(e)}const Pi="",H="adm-list",ja={mode:"default"},Aa=l.forwardRef((e,t)=>{const n=he(ja,e),r=l.useRef(null);return l.useImperativeHandle(t,()=>({get nativeElement(){return r.current}})),F(n,l.createElement("div",{className:O(H,`${H}-${n.mode}`),ref:r},n.header&&l.createElement("div",{className:`${H}-header`},n.header),l.createElement("div",{className:`${H}-body`},l.createElement("div",{className:`${H}-body-inner`},n.children))))});function V(e){return e!=null&&e!==!1}const k="adm-list-item",ie=pe(Aa,{Item:e=>{var t;const n=(t=e.clickable)!==null&&t!==void 0?t:!!e.onClick,r=e.arrow===void 0?n:e.arrow,i=l.createElement("div",{className:`${k}-content`},V(e.prefix)&&l.createElement("div",{className:`${k}-content-prefix`},e.prefix),l.createElement("div",{className:`${k}-content-main`},V(e.title)&&l.createElement("div",{className:`${k}-title`},e.title),e.children,V(e.description)&&l.createElement("div",{className:`${k}-description`},e.description)),V(e.extra)&&l.createElement("div",{className:`${k}-content-extra`},e.extra),V(r)&&l.createElement("div",{className:`${k}-content-arrow`},r===!0?l.createElement(Ta,null):r));return F(e,l.createElement(n?"a":"div",{className:O(`${k}`,n?["adm-plain-anchor"]:[],e.disabled&&`${k}-disabled`),onClick:e.disabled?void 0:e.onClick},i))}}),Ii="",z="adm-nav-bar",_a={backArrow:!0},Fa=e=>{const t=he(_a,e),{back:n,backArrow:r}=t;return F(t,l.createElement("div",{className:O(z)},l.createElement("div",{className:`${z}-left`,role:"button"},n!==null&&l.createElement("div",{className:`${z}-back`,onClick:t.onBack},r&&l.createElement("span",{className:`${z}-back-arrow`},r===!0?l.createElement(Ia,null):r),l.createElement("span",{"aria-hidden":"true"},n)),t.left),l.createElement("div",{className:`${z}-title`},t.children),l.createElement("div",{className:`${z}-right`},t.right)))},Ti="",La=()=>null,E="adm-tab-bar",Da={safeArea:!1},xe=pe(e=>{var t;const n=he(Da,e);let r=null;const i=[];Ba(n.children,(s,u)=>{if(!l.isValidElement(s))return;const p=s.key;typeof p=="string"&&(u===0&&(r=p),i.push(s))});const[c,d]=Oa({value:n.activeKey,defaultValue:(t=n.defaultActiveKey)!==null&&t!==void 0?t:r,onChange:s=>{var u;s!==null&&((u=n.onChange)===null||u===void 0||u.call(n,s))}});return F(n,l.createElement("div",{className:E},l.createElement("div",{className:`${E}-wrap`},i.map(s=>{const u=s.key===c;function p(){const g=s.props.icon&&l.createElement("div",{className:`${E}-item-icon`},typeof s.props.icon=="function"?s.props.icon(u):s.props.icon),x=s.props.title&&l.createElement("div",{className:O(`${E}-item-title`,!!g&&`${E}-item-title-with-icon`)},typeof s.props.title=="function"?s.props.title(u):s.props.title);return g?l.createElement(l.Fragment,null,l.createElement(ct,{content:s.props.badge,className:`${E}-icon-badge`},g),x):x?l.createElement(ct,{content:s.props.badge,className:`${E}-title-badge`},x):null}return F(s.props,l.createElement("div",{key:s.key,onClick:()=>{const{key:g}=s;g!=null&&d(g.toString())},className:O(`${E}-item`,{[`${E}-item-active`]:u})},p()))})),n.safeArea&&l.createElement(Ma,{position:"bottom"})))},{Item:La}),pt={type:"void","x-component":"MPage","x-designer":"MPage.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"MBlockInitializers","x-component-props":{showDivider:!1}}}},za=e=>{const{t}=w(),n=f.useFieldSchema(),{dn:r}=a.useDesignable(),i=f.useField(),c={dn:r,field:i,fieldSchema:n};return o.jsx(a.SchemaSettings,A($({title:o.jsx(I.Button,{style:{borderColor:"var(--colorSettings)",color:"var(--colorSettings)"},icon:o.jsx(T.MenuOutlined,{}),type:"dashed",children:t("Menu configuration")})},c),{children:o.jsx(a.SchemaSettings.Remove,{removeParentsIfNoChildren:!0,confirm:{title:t("Delete menu block")},breakRemoveOn:{"x-component":"Grid"}},"remove")}))},K=()=>{const{dn:e}=a.useDesignable(),t=f.useFieldSchema(),n=f.useField();return{onUpdateComponentProps:le.useMemoizedFn(i=>_(this,null,function*(){U.set(t,"x-component-props",i),n.componentProps=$($({},n.componentProps),i),yield e.emit("patch",{schema:{"x-uid":t["x-uid"],"x-component-props":t["x-component-props"],"x-server-hooks":[{type:"onSelfSave",method:"extractTextToLocale"}]}}),yield e.refresh()}))}},ut={properties:{name:{type:"string",title:N("Menu name"),required:!0,"x-component":"Input","x-decorator":"FormItem"},icon:{"x-decorator":"FormItem","x-component":"IconPicker",title:N("Icon"),"x-component-props":{}}}},Ga=e=>{const{icon:t,name:n}=e,r=a.useDesigner(),i=v.useNavigate(),c=v.useLocation(),d=f.useFieldSchema(),s=a.useCompile(),u=v.useParams(),p=()=>{const g=c.pathname.endsWith("/")?c.pathname.slice(0,-1):c.pathname;i(u.name?`/mobile/${d["x-uid"]}`:`${g}/${d["x-uid"]}`)};return o.jsxs(a.SortableItem,{className:a.cx("nb-mobile-menu-item",a.css`
|
|
1400
33
|
width: 100%;
|
|
1401
34
|
background: var(--adm-color-background);
|
|
1402
35
|
> .adm-list-item {
|
|
1403
36
|
background: inherit;
|
|
1404
37
|
}
|
|
1405
|
-
`
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
}
|
|
1412
|
-
);
|
|
1413
|
-
};
|
|
1414
|
-
const MenuItemDesigner = () => {
|
|
1415
|
-
const { t: t2 } = useTranslation();
|
|
1416
|
-
const { onUpdateComponentProps } = useSchemaPatch();
|
|
1417
|
-
const field = react.useField();
|
|
1418
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(client.GeneralSchemaDesigner, { children: [
|
|
1419
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1420
|
-
client.SchemaSettings.ModalItem,
|
|
1421
|
-
{
|
|
1422
|
-
title: t2("Edit menu info"),
|
|
1423
|
-
initialValues: field.componentProps,
|
|
1424
|
-
schema: menuItemSchema,
|
|
1425
|
-
onSubmit: onUpdateComponentProps
|
|
1426
|
-
}
|
|
1427
|
-
),
|
|
1428
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1429
|
-
client.SchemaSettings.Remove,
|
|
1430
|
-
{
|
|
1431
|
-
removeParentsIfNoChildren: true,
|
|
1432
|
-
confirm: {
|
|
1433
|
-
title: t2("Delete menu item?")
|
|
1434
|
-
},
|
|
1435
|
-
breakRemoveOn: {
|
|
1436
|
-
"x-component": "MMenu"
|
|
1437
|
-
}
|
|
1438
|
-
},
|
|
1439
|
-
"remove"
|
|
1440
|
-
)
|
|
1441
|
-
] });
|
|
1442
|
-
};
|
|
1443
|
-
const MenuItem = InternalMenuItem;
|
|
1444
|
-
MenuItem.Designer = MenuItemDesigner;
|
|
1445
|
-
const useStyles$2 = client.createStyles(({ token, css }) => {
|
|
1446
|
-
return {
|
|
1447
|
-
mobileMenu: css`
|
|
1448
|
-
--adm-color-primary: ${token.colorPrimary};
|
|
1449
|
-
--adm-color-primary-hover: ${token.colorPrimaryHover};
|
|
1450
|
-
--adm-color-primary-active: ${token.colorPrimaryActive};
|
|
1451
|
-
--padding-left: ${token.paddingSM}px;
|
|
1452
|
-
--adm-color-background: ${token.colorBgContainer};
|
|
1453
|
-
--adm-color-border: ${token.colorBorder};
|
|
38
|
+
`),children:[o.jsx(ie.Item,A($({arrow:!0,clickable:!0},e),{prefix:o.jsx(a.Icon,{type:t}),onClick:p,children:s(n)})),o.jsx(r,{})]})},Ua=()=>{const{t:e}=w(),{onUpdateComponentProps:t}=K(),n=f.useField();return o.jsxs(a.GeneralSchemaDesigner,{children:[o.jsx(a.SchemaSettings.ModalItem,{title:e("Edit menu info"),initialValues:n.componentProps,schema:ut,onSubmit:t}),o.jsx(a.SchemaSettings.Remove,{removeParentsIfNoChildren:!0,confirm:{title:e("Delete menu item?")},breakRemoveOn:{"x-component":"MMenu"}},"remove")]})},mt=Ga;mt.Designer=Ua;const qa=a.createStyles(({token:e,css:t})=>({mobileMenu:t`
|
|
39
|
+
--adm-color-primary: ${e.colorPrimary};
|
|
40
|
+
--adm-color-primary-hover: ${e.colorPrimaryHover};
|
|
41
|
+
--adm-color-primary-active: ${e.colorPrimaryActive};
|
|
42
|
+
--padding-left: ${e.paddingSM}px;
|
|
43
|
+
--adm-color-background: ${e.colorBgContainer};
|
|
44
|
+
--adm-color-border: ${e.colorBorder};
|
|
1454
45
|
|
|
1455
|
-
background: ${
|
|
46
|
+
background: ${e.colorBgContainer};
|
|
1456
47
|
width: 100%;
|
|
1457
48
|
margin-bottom: var(--nb-spacing);
|
|
1458
|
-
`
|
|
1459
|
-
|
|
1460
|
-
});
|
|
1461
|
-
const InternalMenu = (props) => {
|
|
1462
|
-
const { styles } = useStyles$2();
|
|
1463
|
-
const Designer2 = client.useDesigner();
|
|
1464
|
-
const fieldSchema = react.useFieldSchema();
|
|
1465
|
-
const { insertBeforeEnd, designable } = client.useDesignable();
|
|
1466
|
-
const { t: t2 } = useTranslation();
|
|
1467
|
-
const onAddMenuItem = (values) => {
|
|
1468
|
-
const properties = {
|
|
1469
|
-
page: PageSchema
|
|
1470
|
-
};
|
|
1471
|
-
return insertBeforeEnd({
|
|
1472
|
-
type: "void",
|
|
1473
|
-
title: values.name,
|
|
1474
|
-
"x-component": "MMenu.Item",
|
|
1475
|
-
"x-component-props": values,
|
|
1476
|
-
"x-designer": "MMenu.Item.Designer",
|
|
1477
|
-
properties
|
|
1478
|
-
});
|
|
1479
|
-
};
|
|
1480
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(client.SortableItem, { className: client.cx("nb-mobile-menu", styles.mobileMenu), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(List, { children: [
|
|
1481
|
-
designable && /* @__PURE__ */ jsxRuntimeExports.jsx(List.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, {}) }),
|
|
1482
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(client.DndContext, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(client.SchemaComponent, { onlyRenderProperties: true, schema: fieldSchema }) }),
|
|
1483
|
-
designable ? /* @__PURE__ */ jsxRuntimeExports.jsx(List.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1484
|
-
client.SchemaInitializer.ActionModal,
|
|
1485
|
-
{
|
|
1486
|
-
buttonText: t2("Add menu item"),
|
|
1487
|
-
title: t2("Add menu item"),
|
|
1488
|
-
schema: menuItemSchema,
|
|
1489
|
-
onSubmit: onAddMenuItem
|
|
1490
|
-
}
|
|
1491
|
-
) }) : null
|
|
1492
|
-
] }) });
|
|
1493
|
-
};
|
|
1494
|
-
const MMenu = InternalMenu;
|
|
1495
|
-
MMenu.Item = MenuItem;
|
|
1496
|
-
MMenu.Designer = MenuDesigner;
|
|
1497
|
-
const findSchema = (schema, component) => {
|
|
1498
|
-
const gridSchema = schema.reduceProperties(
|
|
1499
|
-
(schema2, next) => schema2 || next["x-component"] === component && next
|
|
1500
|
-
);
|
|
1501
|
-
return gridSchema;
|
|
1502
|
-
};
|
|
1503
|
-
const findGridSchema = (schema) => {
|
|
1504
|
-
return findSchema(schema, "Grid");
|
|
1505
|
-
};
|
|
1506
|
-
const allowComponents = ["Grid", "Grid.Row"];
|
|
1507
|
-
const plusComponent = ["Grid.Col"];
|
|
1508
|
-
const countGridCol = (schema, countToStop) => {
|
|
1509
|
-
if (!schema)
|
|
1510
|
-
return 0;
|
|
1511
|
-
let count = 0;
|
|
1512
|
-
if (plusComponent.includes(schema["x-component"])) {
|
|
1513
|
-
count += 1;
|
|
1514
|
-
}
|
|
1515
|
-
if (typeof countToStop === "number" && count >= countToStop)
|
|
1516
|
-
return count;
|
|
1517
|
-
if (allowComponents.includes(schema["x-component"])) {
|
|
1518
|
-
schema.mapProperties((schema2) => {
|
|
1519
|
-
count += countGridCol(schema2, countToStop);
|
|
1520
|
-
});
|
|
1521
|
-
}
|
|
1522
|
-
return count;
|
|
1523
|
-
};
|
|
1524
|
-
const ContainerDesigner = () => {
|
|
1525
|
-
const { t: t2 } = useTranslation();
|
|
1526
|
-
const fieldSchema = react.useFieldSchema();
|
|
1527
|
-
const { onUpdateComponentProps } = useSchemaPatch();
|
|
1528
|
-
const field = react.useField();
|
|
1529
|
-
const { dn } = client.useDesignable();
|
|
1530
|
-
const navigate = reactRouterDom.useNavigate();
|
|
1531
|
-
const tabBarSchema = findSchema(fieldSchema, "MTabBar");
|
|
1532
|
-
const tabBarEnabled = tabBarSchema && field.componentProps.tabBarEnabled !== false;
|
|
1533
|
-
const schemaSettingsProps = {
|
|
1534
|
-
dn,
|
|
1535
|
-
field,
|
|
1536
|
-
fieldSchema
|
|
1537
|
-
};
|
|
1538
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1539
|
-
client.SchemaSettings,
|
|
1540
|
-
{
|
|
1541
|
-
title: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1542
|
-
antd.Button,
|
|
1543
|
-
{
|
|
1544
|
-
style: {
|
|
1545
|
-
borderColor: "var(--colorSettings)",
|
|
1546
|
-
color: "var(--colorSettings)",
|
|
1547
|
-
width: "100%"
|
|
1548
|
-
},
|
|
1549
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MenuOutlined, {}),
|
|
1550
|
-
type: "dashed",
|
|
1551
|
-
children: t2("App level Configuration")
|
|
1552
|
-
}
|
|
1553
|
-
),
|
|
1554
|
-
...schemaSettingsProps,
|
|
1555
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1556
|
-
client.SchemaSettings.SwitchItem,
|
|
1557
|
-
{
|
|
1558
|
-
checked: tabBarEnabled,
|
|
1559
|
-
title: t2("Enable TabBar"),
|
|
1560
|
-
onChange: async (v2) => {
|
|
1561
|
-
if (v2) {
|
|
1562
|
-
if (!tabBarSchema) {
|
|
1563
|
-
const pageSchema = findSchema(fieldSchema, "MPage");
|
|
1564
|
-
await dn.insertBeforeEnd({
|
|
1565
|
-
type: "void",
|
|
1566
|
-
"x-component": "MTabBar",
|
|
1567
|
-
"x-component-props": {},
|
|
1568
|
-
name: "tabBar",
|
|
1569
|
-
properties: {
|
|
1570
|
-
[shared.uid()]: {
|
|
1571
|
-
type: "void",
|
|
1572
|
-
"x-component": "MTabBar.Item",
|
|
1573
|
-
"x-designer": "MTabBar.Item.Designer",
|
|
1574
|
-
"x-component-props": {
|
|
1575
|
-
icon: "HomeOutlined",
|
|
1576
|
-
title: generateNTemplate("Untitled")
|
|
1577
|
-
},
|
|
1578
|
-
properties: {
|
|
1579
|
-
page: pageSchema.toJSON()
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
});
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
|
-
await onUpdateComponentProps({
|
|
1587
|
-
tabBarEnabled: v2
|
|
1588
|
-
});
|
|
1589
|
-
if (v2 === false) {
|
|
1590
|
-
navigate("../");
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1594
|
-
)
|
|
1595
|
-
}
|
|
1596
|
-
);
|
|
1597
|
-
};
|
|
1598
|
-
const useStyles$1 = client.createStyles(({ token, css }) => {
|
|
1599
|
-
return {
|
|
1600
|
-
mobileContainer: css`
|
|
1601
|
-
--adm-color-primary: ${token.colorPrimary};
|
|
49
|
+
`})),Se=e=>{const{styles:t}=qa(),n=a.useDesigner(),r=f.useFieldSchema(),{insertBeforeEnd:i,designable:c}=a.useDesignable(),{t:d}=w(),s=u=>{const p={page:pt};return i({type:"void",title:u.name,"x-component":"MMenu.Item","x-component-props":u,"x-designer":"MMenu.Item.Designer",properties:p})};return o.jsx(a.SortableItem,{className:a.cx("nb-mobile-menu",t.mobileMenu),children:o.jsxs(ie,{children:[c&&o.jsx(ie.Item,{children:o.jsx(n,{})}),o.jsx(a.DndContext,{children:o.jsx(a.SchemaComponent,{onlyRenderProperties:!0,schema:r})}),c?o.jsx(ie.Item,{children:o.jsx(a.SchemaInitializer.ActionModal,{buttonText:d("Add menu item"),title:d("Add menu item"),schema:ut,onSubmit:s})}):null]})})};Se.Item=mt,Se.Designer=za;const se=(e,t)=>e.reduceProperties((r,i)=>r||i["x-component"]===t&&i),Ha=e=>se(e,"Grid"),Va=["Grid","Grid.Row"],Ka=["Grid.Col"],$e=(e,t)=>{if(!e)return 0;let n=0;return Ka.includes(e["x-component"])&&(n+=1),typeof t=="number"&&n>=t||Va.includes(e["x-component"])&&e.mapProperties(r=>{n+=$e(r,t)}),n},Wa=()=>{const{t:e}=w(),t=f.useFieldSchema(),{onUpdateComponentProps:n}=K(),r=f.useField(),{dn:i}=a.useDesignable(),c=v.useNavigate(),d=se(t,"MTabBar"),s=d&&r.componentProps.tabBarEnabled!==!1,u={dn:i,field:r,fieldSchema:t};return o.jsx(a.SchemaSettings,A($({title:o.jsx(I.Button,{style:{borderColor:"var(--colorSettings)",color:"var(--colorSettings)",width:"100%"},icon:o.jsx(T.MenuOutlined,{}),type:"dashed",children:e("App level Configuration")})},u),{children:o.jsx(a.SchemaSettings.SwitchItem,{checked:s,title:e("Enable TabBar"),onChange:p=>_(this,null,function*(){if(p&&!d){const g=se(t,"MPage");yield i.insertBeforeEnd({type:"void","x-component":"MTabBar","x-component-props":{},name:"tabBar",properties:{[de.uid()]:{type:"void","x-component":"MTabBar.Item","x-designer":"MTabBar.Item.Designer","x-component-props":{icon:"HomeOutlined",title:N("Untitled")},properties:{page:g.toJSON()}}}})}yield n({tabBarEnabled:p}),p===!1&&c("../")})})}))},Ja=a.createStyles(({token:e,css:t})=>({mobileContainer:t`
|
|
50
|
+
--adm-color-primary: ${e.colorPrimary};
|
|
1602
51
|
|
|
1603
52
|
& > .general-schema-designer > .general-schema-designer-icons {
|
|
1604
53
|
right: unset;
|
|
@@ -1611,381 +60,45 @@ var __publicField = (obj, key, value) => {
|
|
|
1611
60
|
height: 100%;
|
|
1612
61
|
overflow-y: scroll;
|
|
1613
62
|
position: initial !important;
|
|
1614
|
-
`,
|
|
1615
|
-
tabBar: css`
|
|
63
|
+
`,tabBar:t`
|
|
1616
64
|
& > .general-schema-designer {
|
|
1617
|
-
--nb-designer-top: ${
|
|
65
|
+
--nb-designer-top: ${e.marginMD}px;
|
|
1618
66
|
}
|
|
1619
67
|
position: absolute;
|
|
1620
|
-
background: ${
|
|
68
|
+
background: ${e.colorBgContainer};
|
|
1621
69
|
width: 100%;
|
|
1622
70
|
bottom: 0;
|
|
1623
71
|
left: 0;
|
|
1624
72
|
z-index: 1000;
|
|
1625
|
-
`
|
|
1626
|
-
};
|
|
1627
|
-
});
|
|
1628
|
-
const findGrid = (schema, uid) => {
|
|
1629
|
-
return schema.reduceProperties((final, next) => {
|
|
1630
|
-
if (final)
|
|
1631
|
-
return final;
|
|
1632
|
-
if (next["x-component"] === "MTabBar") {
|
|
1633
|
-
return findGrid(next, uid);
|
|
1634
|
-
}
|
|
1635
|
-
if (next["x-component"] === "MTabBar.Item" && uid === next["x-uid"]) {
|
|
1636
|
-
return next;
|
|
1637
|
-
}
|
|
1638
|
-
});
|
|
1639
|
-
};
|
|
1640
|
-
const TabContentComponent = () => {
|
|
1641
|
-
const { name } = reactRouterDom.useParams();
|
|
1642
|
-
const fieldSchema = react.useFieldSchema();
|
|
1643
|
-
if (!name)
|
|
1644
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
1645
|
-
const gridSchema = findGrid(fieldSchema.properties["tabBar"], name.replace("tab_", ""));
|
|
1646
|
-
if (!gridSchema) {
|
|
1647
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Navigate, { replace: true, to: "../" });
|
|
1648
|
-
}
|
|
1649
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(client.SchemaComponent, { schema: gridSchema });
|
|
1650
|
-
};
|
|
1651
|
-
const InternalContainer = (props) => {
|
|
1652
|
-
var _a, _b;
|
|
1653
|
-
const { styles } = useStyles$1();
|
|
1654
|
-
const { token } = client.useToken();
|
|
1655
|
-
const Designer2 = client.useDesigner();
|
|
1656
|
-
const fieldSchema = react.useFieldSchema();
|
|
1657
|
-
const navigate = reactRouterDom.useNavigate();
|
|
1658
|
-
const params = reactRouterDom.useParams();
|
|
1659
|
-
const location = reactRouterDom.useLocation();
|
|
1660
|
-
const field = react.useField();
|
|
1661
|
-
const isTabBarEnabled = field.componentProps.tabBarEnabled !== false;
|
|
1662
|
-
const tabBarSchema = (_a = fieldSchema == null ? void 0 : fieldSchema.properties) == null ? void 0 : _a["tabBar"];
|
|
1663
|
-
const tabBarCurrentFirstKey = (tabBarSchema == null ? void 0 : tabBarSchema.properties) ? Object.keys(tabBarSchema.properties)[0] : null;
|
|
1664
|
-
let redirectToUid = null;
|
|
1665
|
-
if (tabBarCurrentFirstKey) {
|
|
1666
|
-
redirectToUid = (_b = tabBarSchema == null ? void 0 : tabBarSchema.properties[tabBarCurrentFirstKey]) == null ? void 0 : _b["x-uid"];
|
|
1667
|
-
}
|
|
1668
|
-
React.useEffect(() => {
|
|
1669
|
-
if (redirectToUid && !params.name) {
|
|
1670
|
-
const locationPath = location.pathname.endsWith("/") ? location.pathname.slice(0, -1) : location.pathname;
|
|
1671
|
-
navigate(`${locationPath}/tab_${redirectToUid}`, { replace: true });
|
|
1672
|
-
}
|
|
1673
|
-
}, [location.pathname, navigate, params.name, redirectToUid]);
|
|
1674
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(client.SortableItem, { eid: "nb-mobile-scroll-wrapper", className: client.cx("nb-mobile-container", styles.mobileContainer), children: [
|
|
1675
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, {}),
|
|
1676
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1677
|
-
"div",
|
|
1678
|
-
{
|
|
1679
|
-
style: {
|
|
1680
|
-
paddingBottom: redirectToUid ? token.paddingLG * 2 : 0
|
|
1681
|
-
},
|
|
1682
|
-
className: "nb-mobile-container-content",
|
|
1683
|
-
children: redirectToUid ? /* @__PURE__ */ jsxRuntimeExports.jsx(TabContentComponent, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1684
|
-
client.SchemaComponent,
|
|
1685
|
-
{
|
|
1686
|
-
filterProperties: (schema) => {
|
|
1687
|
-
return schema["x-component"] !== "MTabBar";
|
|
1688
|
-
},
|
|
1689
|
-
schema: fieldSchema
|
|
1690
|
-
}
|
|
1691
|
-
)
|
|
1692
|
-
}
|
|
1693
|
-
),
|
|
1694
|
-
isTabBarEnabled && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: client.cx("nb-mobile-container-tab-bar", styles.tabBar), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1695
|
-
client.SchemaComponent,
|
|
1696
|
-
{
|
|
1697
|
-
onlyRenderProperties: true,
|
|
1698
|
-
filterProperties: (schema) => {
|
|
1699
|
-
return schema["x-component"] === "MTabBar";
|
|
1700
|
-
},
|
|
1701
|
-
schema: fieldSchema
|
|
1702
|
-
}
|
|
1703
|
-
) })
|
|
1704
|
-
] });
|
|
1705
|
-
};
|
|
1706
|
-
const MContainer = InternalContainer;
|
|
1707
|
-
MContainer.Designer = ContainerDesigner;
|
|
1708
|
-
MContainer.displayName = "MContainer";
|
|
1709
|
-
const tabItemSchema = {
|
|
1710
|
-
properties: {
|
|
1711
|
-
title: {
|
|
1712
|
-
type: "string",
|
|
1713
|
-
title: `{{ t('Title') }}`,
|
|
1714
|
-
required: true,
|
|
1715
|
-
"x-component": "Input",
|
|
1716
|
-
"x-decorator": "FormItem"
|
|
1717
|
-
},
|
|
1718
|
-
icon: {
|
|
1719
|
-
required: true,
|
|
1720
|
-
"x-decorator": "FormItem",
|
|
1721
|
-
"x-component": "IconPicker",
|
|
1722
|
-
title: `{{ t('Icon') }}`,
|
|
1723
|
-
"x-component-props": {}
|
|
1724
|
-
}
|
|
1725
|
-
}
|
|
1726
|
-
};
|
|
1727
|
-
const InternalItem = () => {
|
|
1728
|
-
const Designer2 = client.useDesigner();
|
|
1729
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1730
|
-
client.SortableItem,
|
|
1731
|
-
{
|
|
1732
|
-
className: client.cx(
|
|
1733
|
-
"nb-mobile-tab-bar-item",
|
|
1734
|
-
client.css`
|
|
73
|
+
`})),ft=(e,t)=>e.reduceProperties((n,r)=>{if(n)return n;if(r["x-component"]==="MTabBar")return ft(r,t);if(r["x-component"]==="MTabBar.Item"&&t===r["x-uid"])return r}),Xa=()=>{const{name:e}=v.useParams(),t=f.useFieldSchema();if(!e)return o.jsx(o.Fragment,{});const n=ft(t.properties.tabBar,e.replace("tab_",""));return n?o.jsx(a.SchemaComponent,{schema:n}):o.jsx(v.Navigate,{replace:!0,to:"../"})},we=e=>{var L,B;const{styles:t}=Ja(),{token:n}=a.useToken(),r=a.useDesigner(),i=f.useFieldSchema(),c=v.useNavigate(),d=v.useParams(),s=v.useLocation(),p=f.useField().componentProps.tabBarEnabled!==!1,g=(L=i==null?void 0:i.properties)==null?void 0:L.tabBar,x=g!=null&&g.properties?Object.keys(g.properties)[0]:null;let S=null;return x&&(S=(B=g==null?void 0:g.properties[x])==null?void 0:B["x-uid"]),l.useEffect(()=>{if(S&&!d.name){const C=s.pathname.endsWith("/")?s.pathname.slice(0,-1):s.pathname;c(`${C}/tab_${S}`,{replace:!0})}},[s.pathname,c,d.name,S]),o.jsxs(a.SortableItem,{eid:"nb-mobile-scroll-wrapper",className:a.cx("nb-mobile-container",t.mobileContainer),children:[o.jsx(r,{}),o.jsx("div",{style:{paddingBottom:S?n.paddingLG*2:0},className:"nb-mobile-container-content",children:S?o.jsx(Xa,{}):o.jsx(a.SchemaComponent,{filterProperties:C=>C["x-component"]!=="MTabBar",schema:i})}),p&&o.jsx("div",{className:a.cx("nb-mobile-container-tab-bar",t.tabBar),children:o.jsx(a.SchemaComponent,{onlyRenderProperties:!0,filterProperties:C=>C["x-component"]==="MTabBar",schema:i})})]})};we.Designer=Wa,we.displayName="MContainer";const bt={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":{}}}},Za=()=>{const e=a.useDesigner();return o.jsx(a.SortableItem,{className:a.cx("nb-mobile-tab-bar-item",a.css`
|
|
1735
74
|
position: absolute !important;
|
|
1736
75
|
width: 100%;
|
|
1737
76
|
height: 100%;
|
|
1738
77
|
top: 0;
|
|
1739
78
|
left: 0;
|
|
1740
|
-
`
|
|
1741
|
-
),
|
|
1742
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, {})
|
|
1743
|
-
}
|
|
1744
|
-
);
|
|
1745
|
-
};
|
|
1746
|
-
const Designer = () => {
|
|
1747
|
-
const { t: t2 } = useTranslation();
|
|
1748
|
-
const fieldSchema = react.useFieldSchema();
|
|
1749
|
-
const { onUpdateComponentProps } = useSchemaPatch();
|
|
1750
|
-
const field = react.useField();
|
|
1751
|
-
const tabItems = Object.keys(fieldSchema.parent.properties).length;
|
|
1752
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(client.GeneralSchemaDesigner, { children: [
|
|
1753
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1754
|
-
client.SchemaSettings.ModalItem,
|
|
1755
|
-
{
|
|
1756
|
-
title: t2("Edit info"),
|
|
1757
|
-
initialValues: field.componentProps,
|
|
1758
|
-
schema: tabItemSchema,
|
|
1759
|
-
onSubmit: onUpdateComponentProps
|
|
1760
|
-
}
|
|
1761
|
-
),
|
|
1762
|
-
tabItems > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1763
|
-
client.SchemaSettings.Remove,
|
|
1764
|
-
{
|
|
1765
|
-
removeParentsIfNoChildren: true,
|
|
1766
|
-
confirm: {
|
|
1767
|
-
title: t2("Delete tab item?")
|
|
1768
|
-
},
|
|
1769
|
-
breakRemoveOn: {
|
|
1770
|
-
"x-component": "MTabBar"
|
|
1771
|
-
}
|
|
1772
|
-
},
|
|
1773
|
-
"remove"
|
|
1774
|
-
) : null
|
|
1775
|
-
] });
|
|
1776
|
-
};
|
|
1777
|
-
const TabBarItem = InternalItem;
|
|
1778
|
-
TabBarItem.Designer = Designer;
|
|
1779
|
-
const InternalTabBar = (props) => {
|
|
1780
|
-
const fieldSchema = react.useFieldSchema();
|
|
1781
|
-
const { designable } = client.useDesignable();
|
|
1782
|
-
const { t: t2 } = useTranslation();
|
|
1783
|
-
const { insertBeforeEnd } = client.useDesignable();
|
|
1784
|
-
const navigate = reactRouterDom.useNavigate();
|
|
1785
|
-
const params = reactRouterDom.useParams();
|
|
1786
|
-
const compile = client.useCompile();
|
|
1787
|
-
const onAddTab = React.useCallback((values) => {
|
|
1788
|
-
return insertBeforeEnd({
|
|
1789
|
-
type: "void",
|
|
1790
|
-
"x-component": "MTabBar.Item",
|
|
1791
|
-
"x-component-props": values,
|
|
1792
|
-
"x-designer": "MTabBar.Item.Designer",
|
|
1793
|
-
properties: {
|
|
1794
|
-
[shared.uid()]: PageSchema
|
|
1795
|
-
},
|
|
1796
|
-
"x-server-hooks": [
|
|
1797
|
-
{
|
|
1798
|
-
type: "onSelfSave",
|
|
1799
|
-
method: "extractTextToLocale"
|
|
1800
|
-
}
|
|
1801
|
-
]
|
|
1802
|
-
});
|
|
1803
|
-
}, []);
|
|
1804
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1805
|
-
client.SortableItem,
|
|
1806
|
-
{
|
|
1807
|
-
className: client.cx(
|
|
1808
|
-
"nb-mobile-tab-bar",
|
|
1809
|
-
client.css`
|
|
79
|
+
`),children:o.jsx(e,{})})},Qa=()=>{const{t:e}=w(),t=f.useFieldSchema(),{onUpdateComponentProps:n}=K(),r=f.useField(),i=Object.keys(t.parent.properties).length;return o.jsxs(a.GeneralSchemaDesigner,{children:[o.jsx(a.SchemaSettings.ModalItem,{title:e("Edit info"),initialValues:r.componentProps,schema:bt,onSubmit:n}),i>1?o.jsx(a.SchemaSettings.Remove,{removeParentsIfNoChildren:!0,confirm:{title:e("Delete tab item?")},breakRemoveOn:{"x-component":"MTabBar"}},"remove"):null]})},gt=Za;gt.Designer=Qa;const Pe=e=>{const t=f.useFieldSchema(),{designable:n}=a.useDesignable(),{t:r}=w(),{insertBeforeEnd:i}=a.useDesignable(),c=v.useNavigate(),d=v.useParams(),s=a.useCompile(),u=l.useCallback(p=>i({type:"void","x-component":"MTabBar.Item","x-component-props":p,"x-designer":"MTabBar.Item.Designer",properties:{[de.uid()]:pt},"x-server-hooks":[{type:"onSelfSave",method:"extractTextToLocale"}]}),[]);return o.jsx(a.SortableItem,{className:a.cx("nb-mobile-tab-bar",a.css`
|
|
1810
80
|
position: relative;
|
|
1811
81
|
width: 100%;
|
|
1812
82
|
display: flex;
|
|
1813
83
|
align-items: center;
|
|
1814
|
-
`
|
|
1815
|
-
),
|
|
1816
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(client.DndContext, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1817
|
-
TabBar,
|
|
1818
|
-
{
|
|
1819
|
-
activeKey: params.name,
|
|
1820
|
-
onChange: (key) => {
|
|
1821
|
-
if (key === "add-tab") {
|
|
1822
|
-
return;
|
|
1823
|
-
}
|
|
1824
|
-
navigate(`/mobile/${key}`);
|
|
1825
|
-
},
|
|
1826
|
-
safeArea: true,
|
|
1827
|
-
className: client.cx(
|
|
1828
|
-
client.css`
|
|
84
|
+
`),children:o.jsx(a.DndContext,{children:o.jsxs(xe,{activeKey:d.name,onChange:p=>{p!=="add-tab"&&c(`/mobile/${p}`)},safeArea:!0,className:a.cx(a.css`
|
|
1829
85
|
width: 100%;
|
|
1830
|
-
`
|
|
1831
|
-
),
|
|
1832
|
-
children: [
|
|
1833
|
-
fieldSchema.mapProperties((schema, name) => {
|
|
1834
|
-
const cp = schema["x-component-props"];
|
|
1835
|
-
return /* @__PURE__ */ React.createElement(
|
|
1836
|
-
TabBar.Item,
|
|
1837
|
-
{
|
|
1838
|
-
...cp,
|
|
1839
|
-
key: `tab_${schema["x-uid"]}`,
|
|
1840
|
-
title: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1841
|
-
t2(compile(cp.title)),
|
|
1842
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(client.SchemaComponent, { schema, name })
|
|
1843
|
-
] }),
|
|
1844
|
-
icon: cp.icon ? /* @__PURE__ */ jsxRuntimeExports.jsx(client.Icon, { type: cp.icon }) : void 0
|
|
1845
|
-
}
|
|
1846
|
-
);
|
|
1847
|
-
}),
|
|
1848
|
-
designable && (!fieldSchema.properties || Object.keys(fieldSchema.properties).length < 5) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1849
|
-
TabBar.Item,
|
|
1850
|
-
{
|
|
1851
|
-
className: client.css`
|
|
86
|
+
`),children:[t.mapProperties((p,g)=>{const x=p["x-component-props"];return l.createElement(xe.Item,A($({},x),{key:`tab_${p["x-uid"]}`,title:o.jsxs(o.Fragment,{children:[r(s(x.title)),o.jsx(a.SchemaComponent,{schema:p,name:g})]}),icon:x.icon?o.jsx(a.Icon,{type:x.icon}):void 0}))}),n&&(!t.properties||Object.keys(t.properties).length<5)?o.jsx(xe.Item,{className:a.css`
|
|
1852
87
|
.adm-tab-bar-item-icon {
|
|
1853
88
|
height: auto;
|
|
1854
89
|
}
|
|
1855
|
-
`,
|
|
1856
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(client.SchemaInitializer.ActionModal, { title: t2("Add tab"), onSubmit: onAddTab, schema: tabItemSchema })
|
|
1857
|
-
},
|
|
1858
|
-
"add-tab"
|
|
1859
|
-
) : null
|
|
1860
|
-
]
|
|
1861
|
-
}
|
|
1862
|
-
) })
|
|
1863
|
-
}
|
|
1864
|
-
);
|
|
1865
|
-
};
|
|
1866
|
-
const MTabBar = InternalTabBar;
|
|
1867
|
-
MTabBar.Item = TabBarItem;
|
|
1868
|
-
MTabBar.displayName = "MTabBar";
|
|
1869
|
-
const PageDesigner = (props) => {
|
|
1870
|
-
var _a, _b, _c, _d;
|
|
1871
|
-
const { showBack } = props;
|
|
1872
|
-
const { t: t2 } = useTranslation();
|
|
1873
|
-
const field = react.useField();
|
|
1874
|
-
const fieldSchema = react.useFieldSchema();
|
|
1875
|
-
const { dn } = client.useDesignable();
|
|
1876
|
-
const { onUpdateComponentProps } = useSchemaPatch();
|
|
1877
|
-
const headerSchema = (_a = fieldSchema == null ? void 0 : fieldSchema.properties) == null ? void 0 : _a["header"];
|
|
1878
|
-
const isHeaderEnabled = !!headerSchema && ((_b = field.componentProps) == null ? void 0 : _b.headerEnabled) !== false;
|
|
1879
|
-
const tabsSchema = (_c = fieldSchema == null ? void 0 : fieldSchema.properties) == null ? void 0 : _c["tabs"];
|
|
1880
|
-
const isTabsEnabled = !!tabsSchema && ((_d = field.componentProps) == null ? void 0 : _d.tabsEnabled) !== false;
|
|
1881
|
-
const schemaSettingsProps = {
|
|
1882
|
-
dn,
|
|
1883
|
-
field,
|
|
1884
|
-
fieldSchema
|
|
1885
|
-
};
|
|
1886
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1887
|
-
client.SchemaSettings,
|
|
1888
|
-
{
|
|
1889
|
-
title: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1890
|
-
antd.Button,
|
|
1891
|
-
{
|
|
1892
|
-
style: {
|
|
1893
|
-
borderColor: "var(--colorSettings)",
|
|
1894
|
-
color: "var(--colorSettings)",
|
|
1895
|
-
width: "100%"
|
|
1896
|
-
},
|
|
1897
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MenuOutlined, {}),
|
|
1898
|
-
type: "dashed",
|
|
1899
|
-
children: t2("Page configuration")
|
|
1900
|
-
}
|
|
1901
|
-
),
|
|
1902
|
-
...schemaSettingsProps,
|
|
1903
|
-
children: [
|
|
1904
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1905
|
-
client.SchemaSettings.SwitchItem,
|
|
1906
|
-
{
|
|
1907
|
-
checked: isHeaderEnabled,
|
|
1908
|
-
title: t2("Enable Header"),
|
|
1909
|
-
onChange: async (v2) => {
|
|
1910
|
-
var _a2;
|
|
1911
|
-
if (!headerSchema) {
|
|
1912
|
-
await dn.insertAfterBegin({
|
|
1913
|
-
type: "void",
|
|
1914
|
-
name: "header",
|
|
1915
|
-
"x-component": "MHeader",
|
|
1916
|
-
"x-designer": "MHeader.Designer",
|
|
1917
|
-
"x-component-props": {
|
|
1918
|
-
title: (_a2 = fieldSchema.parent["x-component-props"]) == null ? void 0 : _a2.name,
|
|
1919
|
-
showBack
|
|
1920
|
-
}
|
|
1921
|
-
});
|
|
1922
|
-
}
|
|
1923
|
-
await onUpdateComponentProps({
|
|
1924
|
-
headerEnabled: v2
|
|
1925
|
-
});
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
),
|
|
1929
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1930
|
-
client.SchemaSettings.SwitchItem,
|
|
1931
|
-
{
|
|
1932
|
-
checked: isTabsEnabled,
|
|
1933
|
-
title: t2("Enable Tabs"),
|
|
1934
|
-
onChange: async (v2) => {
|
|
1935
|
-
if (!tabsSchema) {
|
|
1936
|
-
const gridSchema = findGridSchema(fieldSchema);
|
|
1937
|
-
await dn.remove(gridSchema);
|
|
1938
|
-
return dn.insertBeforeEnd({
|
|
1939
|
-
type: "void",
|
|
1940
|
-
name: "tabs",
|
|
1941
|
-
"x-component": "Tabs",
|
|
1942
|
-
"x-component-props": {},
|
|
1943
|
-
"x-initializer": "TabPaneInitializers",
|
|
1944
|
-
"x-initializer-props": {
|
|
1945
|
-
gridInitializer: "MBlockInitializers"
|
|
1946
|
-
},
|
|
1947
|
-
properties: {
|
|
1948
|
-
tab1: {
|
|
1949
|
-
type: "void",
|
|
1950
|
-
title: generateNTemplate("Untitled"),
|
|
1951
|
-
"x-component": "Tabs.TabPane",
|
|
1952
|
-
"x-designer": "Tabs.Designer",
|
|
1953
|
-
"x-component-props": {},
|
|
1954
|
-
properties: {
|
|
1955
|
-
grid: {
|
|
1956
|
-
...gridSchema,
|
|
1957
|
-
"x-uid": shared.uid()
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
}
|
|
1962
|
-
});
|
|
1963
|
-
}
|
|
1964
|
-
await onUpdateComponentProps({
|
|
1965
|
-
tabsEnabled: v2
|
|
1966
|
-
});
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
)
|
|
1970
|
-
]
|
|
1971
|
-
}
|
|
1972
|
-
);
|
|
1973
|
-
};
|
|
1974
|
-
const useStyles = client.createStyles(({ token, css }) => {
|
|
1975
|
-
return {
|
|
1976
|
-
globalActionCSS: css`
|
|
90
|
+
`,icon:o.jsx(a.SchemaInitializer.ActionModal,{title:r("Add tab"),onSubmit:u,schema:bt})},"add-tab"):null]})})})};Pe.Item=gt,Pe.displayName="MTabBar";const Ya=e=>{var S,L,B,C;const{showBack:t}=e,{t:n}=w(),r=f.useField(),i=f.useFieldSchema(),{dn:c}=a.useDesignable(),{onUpdateComponentProps:d}=K(),s=(S=i==null?void 0:i.properties)==null?void 0:S.header,u=!!s&&((L=r.componentProps)==null?void 0:L.headerEnabled)!==!1,p=(B=i==null?void 0:i.properties)==null?void 0:B.tabs,g=!!p&&((C=r.componentProps)==null?void 0:C.tabsEnabled)!==!1,x={dn:c,field:r,fieldSchema:i};return o.jsxs(a.SchemaSettings,A($({title:o.jsx(I.Button,{style:{borderColor:"var(--colorSettings)",color:"var(--colorSettings)",width:"100%"},icon:o.jsx(T.MenuOutlined,{}),type:"dashed",children:n("Page configuration")})},x),{children:[o.jsx(a.SchemaSettings.SwitchItem,{checked:u,title:n("Enable Header"),onChange:G=>_(this,null,function*(){var j;s||(yield c.insertAfterBegin({type:"void",name:"header","x-component":"MHeader","x-designer":"MHeader.Designer","x-component-props":{title:(j=i.parent["x-component-props"])==null?void 0:j.name,showBack:t}})),yield d({headerEnabled:G})})}),o.jsx(a.SchemaSettings.SwitchItem,{checked:g,title:n("Enable Tabs"),onChange:G=>_(this,null,function*(){if(!p){const j=Ha(i);return yield c.remove(j),c.insertBeforeEnd({type:"void",name:"tabs","x-component":"Tabs","x-component-props":{},"x-initializer":"TabPaneInitializers","x-initializer-props":{gridInitializer:"MBlockInitializers"},properties:{tab1:{type:"void",title:N("Untitled"),"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:A($({},j),{"x-uid":de.uid()})}}}})}yield d({tabsEnabled:G})})})]}))},Ra=a.createStyles(({token:e,css:t})=>({globalActionCSS:t`
|
|
1977
91
|
#nb-position-container > & {
|
|
1978
|
-
height: ${
|
|
92
|
+
height: ${e.sizeXXL}px;
|
|
1979
93
|
border-top: 1px solid var(--nb-box-bg);
|
|
1980
94
|
margin-bottom: 0px !important;
|
|
1981
95
|
padding: 0 var(--nb-spacing);
|
|
1982
96
|
align-items: center;
|
|
1983
97
|
overflow-x: auto;
|
|
1984
|
-
background: ${
|
|
98
|
+
background: ${e.colorBgContainer};
|
|
1985
99
|
z-index: 100;
|
|
1986
100
|
}
|
|
1987
|
-
`,
|
|
1988
|
-
mobilePage: css`
|
|
101
|
+
`,mobilePage:t`
|
|
1989
102
|
background: var(--nb-box-bg);
|
|
1990
103
|
display: flex;
|
|
1991
104
|
flex-direction: column;
|
|
@@ -1994,327 +107,31 @@ var __publicField = (obj, key, value) => {
|
|
|
1994
107
|
overflow-x: hidden;
|
|
1995
108
|
overflow-y: auto;
|
|
1996
109
|
padding-bottom: var(--nb-spacing);
|
|
1997
|
-
`,
|
|
1998
|
-
mobilePageHeader: css`
|
|
110
|
+
`,mobilePageHeader:t`
|
|
1999
111
|
& > .ant-tabs > .ant-tabs-nav {
|
|
2000
112
|
.ant-tabs-tab {
|
|
2001
113
|
margin: 0 !important;
|
|
2002
|
-
padding: 0 ${
|
|
114
|
+
padding: 0 ${e.paddingContentHorizontal}px !important;
|
|
2003
115
|
}
|
|
2004
|
-
background: ${
|
|
116
|
+
background: ${e.colorBgContainer};
|
|
2005
117
|
}
|
|
2006
118
|
display: flex;
|
|
2007
119
|
flex-direction: column;
|
|
2008
|
-
`
|
|
2009
|
-
};
|
|
2010
|
-
});
|
|
2011
|
-
const InternalPage = (props) => {
|
|
2012
|
-
var _a, _b, _c, _d, _e;
|
|
2013
|
-
const { styles } = useStyles();
|
|
2014
|
-
const Designer2 = client.useDesigner();
|
|
2015
|
-
const field = react.useField();
|
|
2016
|
-
const fieldSchema = react.useFieldSchema();
|
|
2017
|
-
const [searchParams, setSearchParams] = reactRouterDom.useSearchParams();
|
|
2018
|
-
const tabsSchema = (_a = fieldSchema.properties) == null ? void 0 : _a["tabs"];
|
|
2019
|
-
const isHeaderEnabled = field.componentProps.headerEnabled !== false;
|
|
2020
|
-
const isTabsEnabled = field.componentProps.tabsEnabled !== false;
|
|
2021
|
-
let pageSchema = findSchema(fieldSchema, "MPage");
|
|
2022
|
-
if (!isTabsEnabled && !pageSchema && tabsSchema) {
|
|
2023
|
-
const schemaArr = Object.values(tabsSchema.properties || {}).sort((k1, k2) => {
|
|
2024
|
-
return k1["x-index"] - k2["x-index"];
|
|
2025
|
-
});
|
|
2026
|
-
if (schemaArr.length !== 0) {
|
|
2027
|
-
pageSchema = (_b = Object.values(schemaArr[0].properties)) == null ? void 0 : _b[0];
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
|
-
const onlyInPage = fieldSchema.root === fieldSchema.parent;
|
|
2031
|
-
let hasGlobalActions = false;
|
|
2032
|
-
if (!tabsSchema && fieldSchema.properties) {
|
|
2033
|
-
hasGlobalActions = countGridCol(fieldSchema.properties["grid"], 2) === 1;
|
|
2034
|
-
} else if (searchParams.has("tab") && ((_c = tabsSchema == null ? void 0 : tabsSchema.properties) == null ? void 0 : _c[searchParams.get("tab")])) {
|
|
2035
|
-
hasGlobalActions = countGridCol((_e = (_d = tabsSchema.properties[searchParams.get("tab")]) == null ? void 0 : _d.properties) == null ? void 0 : _e["grid"], 2) === 1;
|
|
2036
|
-
} else if (tabsSchema == null ? void 0 : tabsSchema.properties) {
|
|
2037
|
-
const schema = Object.values(tabsSchema.properties).sort((t1, t2) => t1["x-index"] - t2["x-index"])[0];
|
|
2038
|
-
if (schema) {
|
|
2039
|
-
setTimeout(() => {
|
|
2040
|
-
setSearchParams([["tab", schema.name.toString()]], {
|
|
2041
|
-
replace: true
|
|
2042
|
-
});
|
|
2043
|
-
});
|
|
2044
|
-
}
|
|
2045
|
-
}
|
|
2046
|
-
const onTabsChange = React.useCallback(
|
|
2047
|
-
(key) => {
|
|
2048
|
-
setSearchParams([["tab", key]], {
|
|
2049
|
-
replace: true
|
|
2050
|
-
});
|
|
2051
|
-
},
|
|
2052
|
-
[setSearchParams]
|
|
2053
|
-
);
|
|
2054
|
-
const GlobalActionProvider = React.useCallback(
|
|
2055
|
-
(props2) => {
|
|
2056
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(client.TabsContextProvider, { children: hasGlobalActions ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2057
|
-
client.ActionBarProvider,
|
|
2058
|
-
{
|
|
2059
|
-
container: (typeof props2.active !== "undefined" ? props2.active : true) && onlyInPage ? document.getElementById("nb-position-container") : null,
|
|
2060
|
-
forceProps: {
|
|
2061
|
-
layout: "one-column",
|
|
2062
|
-
className: styles.globalActionCSS
|
|
2063
|
-
},
|
|
2064
|
-
children: props2.children
|
|
2065
|
-
}
|
|
2066
|
-
) : props2.children });
|
|
2067
|
-
},
|
|
2068
|
-
[hasGlobalActions, onlyInPage, styles.globalActionCSS]
|
|
2069
|
-
);
|
|
2070
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(client.SortableItem, { eid: "nb-mobile-scroll-wrapper", className: client.cx("nb-mobile-page", styles.mobilePage), children: [
|
|
2071
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, { ...fieldSchema == null ? void 0 : fieldSchema["x-designer-props"] }),
|
|
2072
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2073
|
-
"div",
|
|
2074
|
-
{
|
|
2075
|
-
style: {
|
|
2076
|
-
paddingBottom: tabsSchema ? null : "var(--nb-spacing)"
|
|
2077
|
-
},
|
|
2078
|
-
className: client.cx("nb-mobile-page-header", styles.mobilePageHeader),
|
|
2079
|
-
children: [
|
|
2080
|
-
isHeaderEnabled && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2081
|
-
react.RecursionField,
|
|
2082
|
-
{
|
|
2083
|
-
schema: fieldSchema,
|
|
2084
|
-
filterProperties: (s) => {
|
|
2085
|
-
return "MHeader" === s["x-component"];
|
|
2086
|
-
}
|
|
2087
|
-
}
|
|
2088
|
-
),
|
|
2089
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2090
|
-
client.TabsContextProvider,
|
|
2091
|
-
{
|
|
2092
|
-
PaneRoot: GlobalActionProvider,
|
|
2093
|
-
activeKey: searchParams.get("tab"),
|
|
2094
|
-
onChange: onTabsChange,
|
|
2095
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2096
|
-
react.RecursionField,
|
|
2097
|
-
{
|
|
2098
|
-
schema: isTabsEnabled ? fieldSchema : pageSchema,
|
|
2099
|
-
filterProperties: (s) => {
|
|
2100
|
-
return "Tabs" === s["x-component"] || "Grid.Row" === s["x-component"];
|
|
2101
|
-
}
|
|
2102
|
-
}
|
|
2103
|
-
)
|
|
2104
|
-
}
|
|
2105
|
-
)
|
|
2106
|
-
]
|
|
2107
|
-
}
|
|
2108
|
-
),
|
|
2109
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(GlobalActionProvider, { children: !tabsSchema && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2110
|
-
react.RecursionField,
|
|
2111
|
-
{
|
|
2112
|
-
schema: fieldSchema,
|
|
2113
|
-
filterProperties: (s) => {
|
|
2114
|
-
return s["x-component"] !== "MHeader";
|
|
2115
|
-
}
|
|
2116
|
-
}
|
|
2117
|
-
) })
|
|
2118
|
-
] });
|
|
2119
|
-
};
|
|
2120
|
-
const MPage = InternalPage;
|
|
2121
|
-
MPage.Designer = PageDesigner;
|
|
2122
|
-
MPage.displayName = "MPage";
|
|
2123
|
-
const HeaderDesigner = () => {
|
|
2124
|
-
const field = react.useField();
|
|
2125
|
-
const { onUpdateComponentProps } = useSchemaPatch();
|
|
2126
|
-
const { t: t2 } = useTranslation();
|
|
2127
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(client.GeneralSchemaDesigner, { draggable: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2128
|
-
client.SchemaSettings.ModalItem,
|
|
2129
|
-
{
|
|
2130
|
-
title: t2("Edit info"),
|
|
2131
|
-
components: { Switch: antdV5.Switch },
|
|
2132
|
-
initialValues: field.componentProps,
|
|
2133
|
-
schema: {
|
|
2134
|
-
properties: {
|
|
2135
|
-
title: {
|
|
2136
|
-
type: "string",
|
|
2137
|
-
title: t2("Title"),
|
|
2138
|
-
required: true,
|
|
2139
|
-
"x-component": "Input",
|
|
2140
|
-
"x-decorator": "FormItem"
|
|
2141
|
-
},
|
|
2142
|
-
showBack: {
|
|
2143
|
-
type: "boolean",
|
|
2144
|
-
title: t2("Display back button"),
|
|
2145
|
-
"x-component": "Switch",
|
|
2146
|
-
"x-decorator": "FormItem"
|
|
2147
|
-
}
|
|
2148
|
-
}
|
|
2149
|
-
},
|
|
2150
|
-
onSubmit: onUpdateComponentProps
|
|
2151
|
-
}
|
|
2152
|
-
) });
|
|
2153
|
-
};
|
|
2154
|
-
const InternalHeader = (props) => {
|
|
2155
|
-
const field = react.useField();
|
|
2156
|
-
const { title = generateNTemplate("Untitled"), showBack = false } = { ...props, ...field == null ? void 0 : field.componentProps };
|
|
2157
|
-
const Designer2 = client.useDesigner();
|
|
2158
|
-
const compile = client.useCompile();
|
|
2159
|
-
const compiledTitle = compile(title);
|
|
2160
|
-
const navigate = reactRouterDom.useNavigate();
|
|
2161
|
-
const { setTitle } = client.useDocumentTitle();
|
|
2162
|
-
const { token } = client.useToken();
|
|
2163
|
-
React.useEffect(() => {
|
|
2164
|
-
setTitle(compiledTitle);
|
|
2165
|
-
}, [compiledTitle]);
|
|
2166
|
-
const style = React.useMemo(() => {
|
|
2167
|
-
return {
|
|
2168
|
-
width: "100%",
|
|
2169
|
-
background: token.colorBgContainer
|
|
2170
|
-
};
|
|
2171
|
-
}, [token.colorBgContainer]);
|
|
2172
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(client.SortableItem, { className: client.cx("nb-mobile-header"), style, children: [
|
|
2173
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(NavBar, { backArrow: showBack, onBack: () => navigate(-1), children: compiledTitle }),
|
|
2174
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, {})
|
|
2175
|
-
] });
|
|
2176
|
-
};
|
|
2177
|
-
const MHeader = InternalHeader;
|
|
2178
|
-
MHeader.Designer = HeaderDesigner;
|
|
2179
|
-
const SettingsDesigner = () => {
|
|
2180
|
-
const { t: t2 } = useTranslation();
|
|
2181
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(client.GeneralSchemaDesigner, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2182
|
-
client.SchemaSettings.Remove,
|
|
2183
|
-
{
|
|
2184
|
-
removeParentsIfNoChildren: true,
|
|
2185
|
-
confirm: {
|
|
2186
|
-
title: t2("Delete settings block")
|
|
2187
|
-
},
|
|
2188
|
-
breakRemoveOn: {
|
|
2189
|
-
"x-component": "Grid"
|
|
2190
|
-
}
|
|
2191
|
-
},
|
|
2192
|
-
"remove"
|
|
2193
|
-
) });
|
|
2194
|
-
};
|
|
2195
|
-
const InternalSettings = () => {
|
|
2196
|
-
const Designer2 = client.useDesigner();
|
|
2197
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2198
|
-
client.SortableItem,
|
|
2199
|
-
{
|
|
2200
|
-
className: client.cx(
|
|
2201
|
-
"nb-mobile-setting",
|
|
2202
|
-
client.css`
|
|
120
|
+
`})),Ce=e=>{var C,G,j,St,$t;const{styles:t}=Ra(),n=a.useDesigner(),r=f.useField(),i=f.useFieldSchema(),[c,d]=v.useSearchParams(),s=(C=i.properties)==null?void 0:C.tabs,u=r.componentProps.headerEnabled!==!1,p=r.componentProps.tabsEnabled!==!1;let g=se(i,"MPage");if(!p&&!g&&s){const y=Object.values(s.properties||{}).sort((Te,Me)=>Te["x-index"]-Me["x-index"]);y.length!==0&&(g=(G=Object.values(y[0].properties))==null?void 0:G[0])}const x=i.root===i.parent;let S=!1;if(!s&&i.properties)S=$e(i.properties.grid,2)===1;else if(c.has("tab")&&((j=s==null?void 0:s.properties)!=null&&j[c.get("tab")]))S=$e(($t=(St=s.properties[c.get("tab")])==null?void 0:St.properties)==null?void 0:$t.grid,2)===1;else if(s!=null&&s.properties){const y=Object.values(s.properties).sort((Te,Me)=>Te["x-index"]-Me["x-index"])[0];y&&setTimeout(()=>{d([["tab",y.name.toString()]],{replace:!0})})}const L=l.useCallback(y=>{d([["tab",y]],{replace:!0})},[d]),B=l.useCallback(y=>o.jsx(a.TabsContextProvider,{children:S?o.jsx(a.ActionBarProvider,{container:(typeof y.active=="undefined"||y.active)&&x?document.getElementById("nb-position-container"):null,forceProps:{layout:"one-column",className:t.globalActionCSS},children:y.children}):y.children}),[S,x,t.globalActionCSS]);return o.jsxs(a.SortableItem,{eid:"nb-mobile-scroll-wrapper",className:a.cx("nb-mobile-page",t.mobilePage),children:[o.jsx(n,$({},i==null?void 0:i["x-designer-props"])),o.jsxs("div",{style:{paddingBottom:s?null:"var(--nb-spacing)"},className:a.cx("nb-mobile-page-header",t.mobilePageHeader),children:[u&&o.jsx(f.RecursionField,{schema:i,filterProperties:y=>y["x-component"]==="MHeader"}),o.jsx(a.TabsContextProvider,{PaneRoot:B,activeKey:c.get("tab"),onChange:L,children:o.jsx(f.RecursionField,{schema:p?i:g,filterProperties:y=>y["x-component"]==="Tabs"||y["x-component"]==="Grid.Row"})})]}),o.jsx(B,{children:!s&&o.jsx(f.RecursionField,{schema:i,filterProperties:y=>y["x-component"]!=="MHeader"})})]})};Ce.Designer=Ya,Ce.displayName="MPage";const ei=()=>{const e=f.useField(),{onUpdateComponentProps:t}=K(),{t:n}=w();return o.jsx(a.GeneralSchemaDesigner,{draggable:!1,children:o.jsx(a.SchemaSettings.ModalItem,{title:n("Edit info"),components:{Switch:Ct.Switch},initialValues:e.componentProps,schema:{properties:{title:{type:"string",title:n("Title"),required:!0,"x-component":"Input","x-decorator":"FormItem"},showBack:{type:"boolean",title:n("Display back button"),"x-component":"Switch","x-decorator":"FormItem"}}},onSubmit:t})})},ht=e=>{const t=f.useField(),{title:n=N("Untitled"),showBack:r=!1}=$($({},e),t==null?void 0:t.componentProps),i=a.useDesigner(),d=a.useCompile()(n),s=v.useNavigate(),{setTitle:u}=a.useDocumentTitle(),{token:p}=a.useToken();l.useEffect(()=>{u(d)},[d]);const g=l.useMemo(()=>({width:"100%",background:p.colorBgContainer}),[p.colorBgContainer]);return o.jsxs(a.SortableItem,{className:a.cx("nb-mobile-header"),style:g,children:[o.jsx(Fa,{backArrow:r,onBack:()=>s(-1),children:d}),o.jsx(i,{})]})};ht.Designer=ei;const ti=()=>{const{t:e}=w();return o.jsx(a.GeneralSchemaDesigner,{children:o.jsx(a.SchemaSettings.Remove,{removeParentsIfNoChildren:!0,confirm:{title:e("Delete settings block")},breakRemoveOn:{"x-component":"Grid"}},"remove")})},vt=()=>{const e=a.useDesigner();return o.jsxs(a.SortableItem,{className:a.cx("nb-mobile-setting",a.css`
|
|
2203
121
|
margin-bottom: var(--nb-spacing);
|
|
2204
|
-
`
|
|
2205
|
-
),
|
|
2206
|
-
children: [
|
|
2207
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, {}),
|
|
2208
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(client.SettingsMenu, { redirectUrl: "/mobile" })
|
|
2209
|
-
]
|
|
2210
|
-
}
|
|
2211
|
-
);
|
|
2212
|
-
};
|
|
2213
|
-
const MSettings = InternalSettings;
|
|
2214
|
-
MSettings.Designer = SettingsDesigner;
|
|
2215
|
-
const MSettingsBlockInitializer = (props) => {
|
|
2216
|
-
const { insert } = props;
|
|
2217
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2218
|
-
client.SchemaInitializer.Item,
|
|
2219
|
-
{
|
|
2220
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.SettingOutlined, {}),
|
|
2221
|
-
onClick: async () => {
|
|
2222
|
-
insert({
|
|
2223
|
-
type: "void",
|
|
2224
|
-
"x-component": "MSettings",
|
|
2225
|
-
"x-designer": "MSettings.Designer",
|
|
2226
|
-
"x-component-props": {}
|
|
2227
|
-
});
|
|
2228
|
-
}
|
|
2229
|
-
}
|
|
2230
|
-
);
|
|
2231
|
-
};
|
|
2232
|
-
const listCss = client.css`
|
|
122
|
+
`),children:[o.jsx(e,{}),o.jsx(a.SettingsMenu,{redirectUrl:"/mobile"})]})};vt.Designer=ti;const ni=e=>{const{insert:t}=e;return o.jsx(a.SchemaInitializer.Item,{icon:o.jsx(T.SettingOutlined,{}),onClick:()=>_(this,null,function*(){t({type:"void","x-component":"MSettings","x-designer":"MSettings.Designer","x-component-props":{}})})})},ri=a.css`
|
|
2233
123
|
padding: 0 var(--nb-spacing);
|
|
2234
124
|
& > .nb-action-bar {
|
|
2235
125
|
padding: unset !important;
|
|
2236
126
|
background: unset !important;
|
|
2237
127
|
}
|
|
2238
|
-
|
|
2239
|
-
const useGridCardBlockItemProps = () => {
|
|
2240
|
-
return {
|
|
2241
|
-
className: listCss
|
|
2242
|
-
};
|
|
2243
|
-
};
|
|
2244
|
-
const columnCountConfig = {
|
|
2245
|
-
xs: 1,
|
|
2246
|
-
sm: 1,
|
|
2247
|
-
md: 1,
|
|
2248
|
-
lg: 1,
|
|
2249
|
-
xl: 1,
|
|
2250
|
-
xxl: 1
|
|
2251
|
-
};
|
|
2252
|
-
const useGridCardBlockProps = () => {
|
|
2253
|
-
const isInterface = useInterfaceContext();
|
|
2254
|
-
return {
|
|
2255
|
-
columnCount: isInterface ? columnCountConfig : null,
|
|
2256
|
-
pagination: {
|
|
2257
|
-
simple: true
|
|
2258
|
-
}
|
|
2259
|
-
};
|
|
2260
|
-
};
|
|
2261
|
-
const MobileCore = (props) => {
|
|
2262
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2263
|
-
client.SchemaInitializerProvider,
|
|
2264
|
-
{
|
|
2265
|
-
initializers: {
|
|
2266
|
-
MBlockInitializers
|
|
2267
|
-
},
|
|
2268
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2269
|
-
client.SchemaComponentOptions,
|
|
2270
|
-
{
|
|
2271
|
-
components: {
|
|
2272
|
-
MMenuBlockInitializer,
|
|
2273
|
-
MSettingsBlockInitializer,
|
|
2274
|
-
MContainer,
|
|
2275
|
-
MMenu,
|
|
2276
|
-
MTabBar,
|
|
2277
|
-
MPage,
|
|
2278
|
-
MHeader,
|
|
2279
|
-
MSettings
|
|
2280
|
-
},
|
|
2281
|
-
scope: {
|
|
2282
|
-
useGridCardBlockItemProps,
|
|
2283
|
-
useGridCardBlockProps
|
|
2284
|
-
},
|
|
2285
|
-
children: props.children
|
|
2286
|
-
}
|
|
2287
|
-
)
|
|
2288
|
-
}
|
|
2289
|
-
);
|
|
2290
|
-
};
|
|
2291
|
-
const OpenInNewTab = () => {
|
|
2292
|
-
const location = reactRouterDom.useLocation();
|
|
2293
|
-
const { t: t2 } = useTranslation();
|
|
2294
|
-
const onOpenInNewTab = () => {
|
|
2295
|
-
let baseUrl = window.origin;
|
|
2296
|
-
if (window.location.pathname.startsWith("/apps")) {
|
|
2297
|
-
baseUrl = window.origin + window.location.pathname.split("/").slice(0, 3).join("/");
|
|
2298
|
-
}
|
|
2299
|
-
window.open(`${baseUrl}${location.pathname}${location.search}`);
|
|
2300
|
-
};
|
|
2301
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2302
|
-
"div",
|
|
2303
|
-
{
|
|
2304
|
-
className: client.css`
|
|
128
|
+
`,oi=()=>({className:ri}),ai={xs:1,sm:1,md:1,lg:1,xl:1,xxl:1},ii=()=>({columnCount:Ne()?ai:null,pagination:{simple:!0}}),si=e=>o.jsx(a.SchemaInitializerProvider,{initializers:{MBlockInitializers:At},children:o.jsx(a.SchemaComponentOptions,{components:{MMenuBlockInitializer:_t,MSettingsBlockInitializer:ni,MContainer:we,MMenu:Se,MTabBar:Pe,MPage:Ce,MHeader:ht,MSettings:vt},scope:{useGridCardBlockItemProps:oi,useGridCardBlockProps:ii},children:e.children})}),ci=()=>{const e=v.useLocation(),{t}=w(),n=()=>{let r=window.origin;window.location.pathname.startsWith("/apps")&&(r=window.origin+window.location.pathname.split("/").slice(0,3).join("/")),window.open(`${r}${e.pathname}${e.search}`)};return o.jsx("div",{className:a.css`
|
|
2305
129
|
position: absolute;
|
|
2306
130
|
top: -40px;
|
|
2307
131
|
right: 0;
|
|
2308
|
-
`,
|
|
2309
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { type: "dashed", onClick: onOpenInNewTab, icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.LinkOutlined, {}), children: t2("Open in new tab") })
|
|
2310
|
-
}
|
|
2311
|
-
);
|
|
2312
|
-
};
|
|
2313
|
-
const commonCSSVariables = client.css`
|
|
132
|
+
`,children:o.jsx(I.Button,{type:"dashed",onClick:n,icon:o.jsx(T.LinkOutlined,{}),children:t("Open in new tab")})})},li=a.css`
|
|
2314
133
|
--nb-spacing: 14px;
|
|
2315
|
-
|
|
2316
|
-
const commonCSSOverride = client.css``;
|
|
2317
|
-
const commonDesignerCSS = client.css`
|
|
134
|
+
`,di=a.css``,pi=a.css`
|
|
2318
135
|
--nb-designer-top: 2px;
|
|
2319
136
|
--nb-designer-right: 2px;
|
|
2320
137
|
.nb-sortable-designer:hover {
|
|
@@ -2349,107 +166,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2349
166
|
}
|
|
2350
167
|
}
|
|
2351
168
|
}
|
|
2352
|
-
|
|
2353
|
-
const drawerProps = {
|
|
2354
|
-
getContainer: ".nb-mobile-application",
|
|
2355
|
-
width: "90%",
|
|
2356
|
-
style: {
|
|
2357
|
-
position: "absolute"
|
|
2358
|
-
}
|
|
2359
|
-
};
|
|
2360
|
-
const modalProps = {
|
|
2361
|
-
...drawerProps,
|
|
2362
|
-
style: {
|
|
2363
|
-
maxWidth: "calc(100% - 16px)"
|
|
2364
|
-
},
|
|
2365
|
-
maskStyle: {
|
|
2366
|
-
position: "absolute"
|
|
2367
|
-
},
|
|
2368
|
-
wrapClassName: client.css`
|
|
169
|
+
`,yt={getContainer:".nb-mobile-application",width:"90%",style:{position:"absolute"}},ui=A($({},yt),{style:{maxWidth:"calc(100% - 16px)"},maskStyle:{position:"absolute"},wrapClassName:a.css`
|
|
2369
170
|
position: absolute !important;
|
|
2370
|
-
`
|
|
2371
|
-
};
|
|
2372
|
-
const useMobileSchemaUid = () => {
|
|
2373
|
-
var _a, _b, _c;
|
|
2374
|
-
const ctx = client.useSystemSettings();
|
|
2375
|
-
return (_c = (_b = (_a = ctx == null ? void 0 : ctx.data) == null ? void 0 : _a.data) == null ? void 0 : _b.options) == null ? void 0 : _c.mobileSchemaUid;
|
|
2376
|
-
};
|
|
2377
|
-
const MApplication = (props) => {
|
|
2378
|
-
const mobileSchemaUid = useMobileSchemaUid();
|
|
2379
|
-
const params = reactRouterDom.useParams();
|
|
2380
|
-
const interfaceContext = useInterfaceContext();
|
|
2381
|
-
const Provider = React.useMemo(() => {
|
|
2382
|
-
return interfaceContext ? React.Fragment : client.AdminProvider;
|
|
2383
|
-
}, [interfaceContext]);
|
|
2384
|
-
client.useViewport();
|
|
2385
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Provider, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(MobileCore, { children: [
|
|
2386
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(OpenInNewTab, {}),
|
|
2387
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(client.ActionContextProvider, { modalProps, drawerProps, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2388
|
-
"div",
|
|
2389
|
-
{
|
|
2390
|
-
className: client.cx(
|
|
2391
|
-
"nb-mobile-application",
|
|
2392
|
-
commonDesignerCSS,
|
|
2393
|
-
commonCSSVariables,
|
|
2394
|
-
commonCSSOverride,
|
|
2395
|
-
client.css`
|
|
171
|
+
`}),mi=()=>{var t,n,r;const e=a.useSystemSettings();return(r=(n=(t=e==null?void 0:e.data)==null?void 0:t.data)==null?void 0:n.options)==null?void 0:r.mobileSchemaUid},xt=e=>{const t=mi(),n=v.useParams(),r=Ne(),i=l.useMemo(()=>r?l.Fragment:a.AdminProvider,[r]);return a.useViewport(),o.jsx(i,{children:o.jsxs(si,{children:[o.jsx(ci,{}),o.jsx(a.ActionContextProvider,{modalProps:ui,drawerProps:yt,children:o.jsxs("div",{className:a.cx("nb-mobile-application",pi,li,di,a.css`
|
|
2396
172
|
display: flex;
|
|
2397
173
|
flex-direction: column;
|
|
2398
174
|
width: 100%;
|
|
2399
175
|
height: 100%;
|
|
2400
176
|
position: relative;
|
|
2401
177
|
overflow: hidden;
|
|
2402
|
-
`
|
|
2403
|
-
),
|
|
2404
|
-
children: [
|
|
2405
|
-
params.name && !params.name.startsWith("tab_") ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Outlet, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(client.RemoteSchemaComponent, { uid: mobileSchemaUid, children: props.children }, mobileSchemaUid),
|
|
2406
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "nb-position-container" })
|
|
2407
|
-
]
|
|
2408
|
-
}
|
|
2409
|
-
) })
|
|
2410
|
-
] }) });
|
|
2411
|
-
};
|
|
2412
|
-
class MobileClientPlugin extends client.Plugin {
|
|
2413
|
-
constructor() {
|
|
2414
|
-
super(...arguments);
|
|
2415
|
-
__publicField(this, "mobileRouter");
|
|
2416
|
-
}
|
|
2417
|
-
async load() {
|
|
2418
|
-
this.setMobileRouter();
|
|
2419
|
-
this.addRoutes();
|
|
2420
|
-
this.app.use(MobileClientProvider);
|
|
2421
|
-
}
|
|
2422
|
-
setMobileRouter() {
|
|
2423
|
-
const router = client.createRouterManager({ type: "hash" });
|
|
2424
|
-
router.add("root", {
|
|
2425
|
-
path: "/",
|
|
2426
|
-
element: /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Navigate, { replace: true, to: "/mobile" })
|
|
2427
|
-
});
|
|
2428
|
-
router.add("mobile", {
|
|
2429
|
-
path: "/mobile",
|
|
2430
|
-
element: /* @__PURE__ */ jsxRuntimeExports.jsx(MApplication, {})
|
|
2431
|
-
});
|
|
2432
|
-
router.add("mobile.page", {
|
|
2433
|
-
path: "/mobile/:name",
|
|
2434
|
-
element: /* @__PURE__ */ jsxRuntimeExports.jsx(client.RouteSchemaComponent, {})
|
|
2435
|
-
});
|
|
2436
|
-
this.mobileRouter = router;
|
|
2437
|
-
}
|
|
2438
|
-
getMobileRouterComponent() {
|
|
2439
|
-
return this.mobileRouter.getRouterComponent();
|
|
2440
|
-
}
|
|
2441
|
-
addRoutes() {
|
|
2442
|
-
this.app.router.add("mobile", {
|
|
2443
|
-
path: "/mobile",
|
|
2444
|
-
element: /* @__PURE__ */ jsxRuntimeExports.jsx(MApplication, {})
|
|
2445
|
-
});
|
|
2446
|
-
this.app.router.add("mobile.page", {
|
|
2447
|
-
path: "/mobile/:name",
|
|
2448
|
-
Component: "RouteSchemaComponent"
|
|
2449
|
-
});
|
|
2450
|
-
}
|
|
2451
|
-
}
|
|
2452
|
-
exports2.MobileClientPlugin = MobileClientPlugin;
|
|
2453
|
-
exports2.default = MobileClientPlugin;
|
|
2454
|
-
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
2455
|
-
});
|
|
178
|
+
`),children:[n.name&&!n.name.startsWith("tab_")?o.jsx(v.Outlet,{}):o.jsx(a.RemoteSchemaComponent,{uid:t,children:e.children},t),o.jsx("div",{id:"nb-position-container"})]})})]})})};class Ie extends a.Plugin{constructor(){super(...arguments);Pt(this,"mobileRouter")}load(){return _(this,null,function*(){this.setMobileRouter(),this.addRoutes(),this.app.use(jt)})}setMobileRouter(){const n=a.createRouterManager({type:"hash"});n.add("root",{path:"/",element:o.jsx(v.Navigate,{replace:!0,to:"/mobile"})}),n.add("mobile",{path:"/mobile",element:o.jsx(xt,{})}),n.add("mobile.page",{path:"/mobile/:name",element:o.jsx(a.RouteSchemaComponent,{})}),this.mobileRouter=n}getMobileRouterComponent(){return this.mobileRouter.getRouterComponent()}addRoutes(){this.app.router.add("mobile",{path:"/mobile",element:o.jsx(xt,{})}),this.app.router.add("mobile.page",{path:"/mobile/:name",Component:"RouteSchemaComponent"})}}m.MobileClientPlugin=Ie,m.default=Ie,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|