@nocobase/plugin-mobile-client 0.10.1-alpha.1 → 0.11.1-alpha.1
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/client.d.ts +2 -3
- package/client.js +1 -30
- package/lib/client/MobileClientProvider.d.ts +2 -0
- package/lib/client/MobileClientProvider.js +64 -0
- package/lib/client/core/schema/components/container/Container.Designer.js +2 -2
- package/lib/client/core/schema/components/container/Container.js +20 -51
- package/lib/client/core/schema/components/container/style.d.ts +5 -0
- package/lib/client/core/schema/components/container/style.js +48 -0
- package/lib/client/core/schema/components/header/Header.Designer.js +8 -8
- package/lib/client/core/schema/components/header/Header.js +10 -11
- package/lib/client/core/schema/components/menu/Menu.Designer.js +18 -18
- package/lib/client/core/schema/components/menu/Menu.Item.js +1 -8
- package/lib/client/core/schema/components/menu/Menu.d.ts +1 -1
- package/lib/client/core/schema/components/menu/Menu.js +18 -26
- package/lib/client/core/schema/components/menu/style.d.ts +4 -0
- package/lib/client/core/schema/components/menu/style.js +34 -0
- package/lib/client/core/schema/components/page/Page.Designer.js +2 -2
- package/lib/client/core/schema/components/page/Page.js +9 -43
- package/lib/client/core/schema/components/page/style.d.ts +6 -0
- package/lib/client/core/schema/components/page/style.js +55 -0
- package/lib/client/core/schema/components/settings/Settings.js +1 -8
- package/lib/client/core/schema/components/tab-bar/TabBar.Item.d.ts +1 -1
- package/lib/client/core/schema/components/tab-bar/TabBar.Item.js +10 -17
- package/lib/client/core/schema/components/tab-bar/TabBar.d.ts +1 -1
- package/lib/client/core/schema/components/tab-bar/TabBar.js +30 -33
- package/lib/client/core/schema/hooks/useSchemaPatch.js +9 -6
- package/lib/client/core/schema/scopes/grid-card.js +4 -4
- package/lib/client/devices/iOS6.js +4 -4
- package/lib/client/devices/index.js +9 -9
- package/lib/client/index.d.ts +11 -2
- package/lib/client/index.js +62 -26
- package/lib/client/locale/index.js +2 -5
- package/lib/client/router/Application.js +8 -15
- package/lib/client/router/InterfaceRouter.d.ts +1 -5
- package/lib/client/router/InterfaceRouter.js +10 -38
- package/lib/client/router/index.d.ts +0 -1
- package/lib/client/router/index.js +0 -11
- package/lib/server/migrations/20230620203218-mobile-ui-schema-uid.js +1 -1
- package/package.json +26 -10
- package/server.d.ts +2 -3
- package/server.js +1 -30
- package/src/client/MobileClientProvider.tsx +41 -0
- package/src/client/core/schema/components/container/Container.Designer.tsx +2 -2
- package/src/client/core/schema/components/container/Container.tsx +18 -64
- package/src/client/core/schema/components/container/style.ts +35 -0
- package/src/client/core/schema/components/header/Header.Designer.tsx +3 -3
- package/src/client/core/schema/components/header/Header.tsx +11 -12
- package/src/client/core/schema/components/menu/Menu.Designer.tsx +5 -5
- package/src/client/core/schema/components/menu/Menu.Item.tsx +10 -2
- package/src/client/core/schema/components/menu/Menu.tsx +9 -16
- package/src/client/core/schema/components/menu/style.ts +20 -0
- package/src/client/core/schema/components/page/Page.Designer.tsx +2 -2
- package/src/client/core/schema/components/page/Page.tsx +6 -46
- package/src/client/core/schema/components/page/style.ts +43 -0
- package/src/client/core/schema/components/settings/Settings.tsx +1 -2
- package/src/client/core/schema/components/tab-bar/TabBar.Item.tsx +4 -5
- package/src/client/core/schema/components/tab-bar/TabBar.tsx +15 -8
- package/src/client/core/schema/hooks/useSchemaPatch.ts +8 -2
- package/src/client/core/schema/scopes/grid-card.ts +1 -1
- package/src/client/devices/iOS6.tsx +1 -1
- package/src/client/devices/index.tsx +1 -1
- package/src/client/index.tsx +45 -30
- package/src/client/locale/index.ts +2 -4
- package/src/client/router/Application.tsx +5 -4
- package/src/client/router/InterfaceRouter.tsx +11 -43
- package/src/client/router/index.ts +0 -1
- package/docs/en-US/index.md +0 -7
- package/docs/en-US/installation.md +0 -13
- package/docs/en-US/tabs.json +0 -14
- package/docs/en-US/usage.md +0 -1
- package/docs/zh-CN/index.md +0 -7
- package/docs/zh-CN/installation.md +0 -13
- package/docs/zh-CN/tabs.json +0 -14
- package/docs/zh-CN/usage.md +0 -2
- package/lib/client/router/RouteSwitchProvider.d.ts +0 -2
- package/lib/client/router/RouteSwitchProvider.js +0 -59
- package/src/client/router/RouteSwitchProvider.tsx +0 -31
- package/types.d.ts +0 -0
package/client.d.ts
CHANGED
package/client.js
CHANGED
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
4
|
-
|
|
5
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
6
|
-
|
|
7
|
-
var _index = _interopRequireWildcard(require("./lib/client"));
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "__esModule", {
|
|
10
|
-
value: true
|
|
11
|
-
});
|
|
12
|
-
var _exportNames = {};
|
|
13
|
-
Object.defineProperty(exports, "default", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _index.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
Object.keys(_index).forEach(function (key) {
|
|
21
|
-
if (key === "default" || key === "__esModule") return;
|
|
22
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
23
|
-
if (key in exports && exports[key] === _index[key]) return;
|
|
24
|
-
Object.defineProperty(exports, key, {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _index[key];
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
1
|
+
module.exports = require('./lib/client/index.js');
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MobileClientProvider = void 0;
|
|
7
|
+
function _client() {
|
|
8
|
+
const data = require("@nocobase/client");
|
|
9
|
+
_client = function _client() {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _react() {
|
|
15
|
+
const data = _interopRequireWildcard(require("react"));
|
|
16
|
+
_react = function _react() {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _reactRouterDom() {
|
|
22
|
+
const data = require("react-router-dom");
|
|
23
|
+
_reactRouterDom = function _reactRouterDom() {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
var _configuration = require("./configuration");
|
|
29
|
+
var _bridge = require("./core/bridge");
|
|
30
|
+
var _locale = require("./locale");
|
|
31
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
+
const MobileClientProvider = _react().default.memo(props => {
|
|
34
|
+
const _useTranslation = (0, _locale.useTranslation)(),
|
|
35
|
+
t = _useTranslation.t;
|
|
36
|
+
const location = (0, _reactRouterDom().useLocation)();
|
|
37
|
+
const navigation = (0, _reactRouterDom().useNavigate)();
|
|
38
|
+
(0, _react().useEffect)(() => {
|
|
39
|
+
if ((0, _bridge.isJSBridge)() && location.pathname === '/admin') {
|
|
40
|
+
navigation('/mobile', {
|
|
41
|
+
replace: true
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}, [location.pathname, navigation]);
|
|
45
|
+
return _react().default.createElement(_client().SettingsCenterProvider, {
|
|
46
|
+
settings: {
|
|
47
|
+
['mobile-client']: {
|
|
48
|
+
title: t('Mobile Client-side'),
|
|
49
|
+
icon: 'MobileOutlined',
|
|
50
|
+
tabs: {
|
|
51
|
+
interface: {
|
|
52
|
+
title: t('Interface Configuration'),
|
|
53
|
+
component: _configuration.InterfaceConfiguration
|
|
54
|
+
},
|
|
55
|
+
app: {
|
|
56
|
+
title: t('App Configuration'),
|
|
57
|
+
component: _configuration.AppConfiguration
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}, props.children);
|
|
63
|
+
});
|
|
64
|
+
exports.MobileClientProvider = MobileClientProvider;
|
|
@@ -81,8 +81,8 @@ const ContainerDesigner = () => {
|
|
|
81
81
|
return _react2().default.createElement(_client().SchemaSettings, _objectSpread({
|
|
82
82
|
title: _react2().default.createElement(_antd().Button, {
|
|
83
83
|
style: {
|
|
84
|
-
borderColor: '
|
|
85
|
-
color: '
|
|
84
|
+
borderColor: 'var(--colorSettings)',
|
|
85
|
+
color: 'var(--colorSettings)',
|
|
86
86
|
width: '100%'
|
|
87
87
|
},
|
|
88
88
|
icon: _react2().default.createElement(_icons().MenuOutlined, null),
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MContainer = void 0;
|
|
7
|
-
function _css() {
|
|
8
|
-
const data = require("@emotion/css");
|
|
9
|
-
_css = function _css() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _react() {
|
|
15
8
|
const data = require("@formily/react");
|
|
16
9
|
_react = function _react() {
|
|
@@ -40,6 +33,8 @@ function _reactRouterDom() {
|
|
|
40
33
|
return data;
|
|
41
34
|
}
|
|
42
35
|
var _Container = require("./Container.Designer");
|
|
36
|
+
var _style = _interopRequireDefault(require("./style"));
|
|
37
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
43
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
44
39
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
45
40
|
const findGrid = (schema, uid) => {
|
|
@@ -71,71 +66,45 @@ const TabContentComponent = () => {
|
|
|
71
66
|
};
|
|
72
67
|
const InternalContainer = props => {
|
|
73
68
|
var _fieldSchema$properti;
|
|
69
|
+
const _useStyles = (0, _style.default)(),
|
|
70
|
+
styles = _useStyles.styles;
|
|
71
|
+
const _useToken = (0, _client().useToken)(),
|
|
72
|
+
token = _useToken.token;
|
|
74
73
|
const Designer = (0, _client().useDesigner)();
|
|
75
74
|
const fieldSchema = (0, _react().useFieldSchema)();
|
|
75
|
+
const navigate = (0, _reactRouterDom().useNavigate)();
|
|
76
76
|
const params = (0, _reactRouterDom().useParams)();
|
|
77
77
|
const location = (0, _reactRouterDom().useLocation)();
|
|
78
78
|
const tabBarSchema = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$properti = fieldSchema.properties) === null || _fieldSchema$properti === void 0 ? void 0 : _fieldSchema$properti['tabBar'];
|
|
79
|
-
const tabBarCurrentFirstKey =
|
|
79
|
+
const tabBarCurrentFirstKey = tabBarSchema !== null && tabBarSchema !== void 0 && tabBarSchema.properties ? Object.keys(tabBarSchema.properties)[0] : null;
|
|
80
80
|
let redirectToUid = null;
|
|
81
81
|
if (tabBarCurrentFirstKey) {
|
|
82
82
|
var _tabBarSchema$propert;
|
|
83
83
|
redirectToUid = tabBarSchema === null || tabBarSchema === void 0 ? void 0 : (_tabBarSchema$propert = tabBarSchema.properties[tabBarCurrentFirstKey]) === null || _tabBarSchema$propert === void 0 ? void 0 : _tabBarSchema$propert['x-uid'];
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
if (!
|
|
87
|
-
|
|
85
|
+
(0, _react2().useEffect)(() => {
|
|
86
|
+
if (redirectToUid && !params.name) {
|
|
87
|
+
const locationPath = location.pathname.endsWith('/') ? location.pathname.slice(0, -1) : location.pathname;
|
|
88
|
+
navigate(`${locationPath}/tab_${redirectToUid}`, {
|
|
89
|
+
replace: true
|
|
90
|
+
});
|
|
88
91
|
}
|
|
89
|
-
|
|
90
|
-
return [!params.name ? {
|
|
91
|
-
type: 'redirect',
|
|
92
|
-
to: `${locationPath}/tab_${redirectToUid}`,
|
|
93
|
-
from: location.pathname
|
|
94
|
-
} : null, {
|
|
95
|
-
type: 'route',
|
|
96
|
-
path: location.pathname,
|
|
97
|
-
component: TabContentComponent
|
|
98
|
-
}].filter(Boolean);
|
|
99
|
-
}, [redirectToUid, params.name, location.pathname]);
|
|
92
|
+
}, [location.pathname, navigate, params.name, redirectToUid]);
|
|
100
93
|
return _react2().default.createElement(_client().SortableItem, {
|
|
101
94
|
eid: "nb-mobile-scroll-wrapper",
|
|
102
|
-
className: (0,
|
|
103
|
-
& > .general-schema-designer > .general-schema-designer-icons {
|
|
104
|
-
right: unset;
|
|
105
|
-
left: 2px;
|
|
106
|
-
}
|
|
107
|
-
background: #f0f2f5;
|
|
108
|
-
display: flex;
|
|
109
|
-
flex-direction: column;
|
|
110
|
-
width: 100%;
|
|
111
|
-
height: 100%;
|
|
112
|
-
overflow-y: scroll;
|
|
113
|
-
position: initial !important;
|
|
114
|
-
`)
|
|
95
|
+
className: (0, _client().cx)('nb-mobile-container', styles.mobileContainer)
|
|
115
96
|
}, _react2().default.createElement(Designer, null), _react2().default.createElement("div", {
|
|
116
97
|
style: {
|
|
117
|
-
paddingBottom:
|
|
98
|
+
paddingBottom: redirectToUid ? token.paddingLG * 2 : 0
|
|
118
99
|
},
|
|
119
|
-
className:
|
|
120
|
-
},
|
|
121
|
-
routes: tabRoutes
|
|
122
|
-
}) : _react2().default.createElement(_client().SchemaComponent, {
|
|
100
|
+
className: "nb-mobile-container-content"
|
|
101
|
+
}, redirectToUid ? _react2().default.createElement(TabContentComponent, null) : _react2().default.createElement(_client().SchemaComponent, {
|
|
123
102
|
filterProperties: schema => {
|
|
124
103
|
return schema['x-component'] !== 'MTabBar';
|
|
125
104
|
},
|
|
126
105
|
schema: fieldSchema
|
|
127
106
|
})), _react2().default.createElement("div", {
|
|
128
|
-
className: (0,
|
|
129
|
-
& > .general-schema-designer {
|
|
130
|
-
--nb-designer-top: 20px;
|
|
131
|
-
}
|
|
132
|
-
position: absolute;
|
|
133
|
-
background: #ffffff;
|
|
134
|
-
width: 100%;
|
|
135
|
-
bottom: 0;
|
|
136
|
-
left: 0;
|
|
137
|
-
z-index: 1000;
|
|
138
|
-
`)
|
|
107
|
+
className: (0, _client().cx)('nb-mobile-container-tab-bar', styles.tabBar)
|
|
139
108
|
}, _react2().default.createElement(_client().SchemaComponent, {
|
|
140
109
|
onlyRenderProperties: true,
|
|
141
110
|
filterProperties: schema => {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
function _client() {
|
|
8
|
+
const data = require("@nocobase/client");
|
|
9
|
+
_client = function _client() {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
const useStyles = (0, _client().createStyles)(({
|
|
15
|
+
token,
|
|
16
|
+
css
|
|
17
|
+
}) => {
|
|
18
|
+
return {
|
|
19
|
+
mobileContainer: css`
|
|
20
|
+
--adm-color-primary: ${token.colorPrimary};
|
|
21
|
+
|
|
22
|
+
& > .general-schema-designer > .general-schema-designer-icons {
|
|
23
|
+
right: unset;
|
|
24
|
+
left: 2px;
|
|
25
|
+
}
|
|
26
|
+
background: var(--nb-box-bg);
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: 100%;
|
|
31
|
+
overflow-y: scroll;
|
|
32
|
+
position: initial !important;
|
|
33
|
+
`,
|
|
34
|
+
tabBar: css`
|
|
35
|
+
& > .general-schema-designer {
|
|
36
|
+
--nb-designer-top: ${token.marginMD}px;
|
|
37
|
+
}
|
|
38
|
+
position: absolute;
|
|
39
|
+
background: ${token.colorBgContainer};
|
|
40
|
+
width: 100%;
|
|
41
|
+
bottom: 0;
|
|
42
|
+
left: 0;
|
|
43
|
+
z-index: 1000;
|
|
44
|
+
`
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
var _default = useStyles;
|
|
48
|
+
exports.default = _default;
|
|
@@ -4,6 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.HeaderDesigner = void 0;
|
|
7
|
+
function _antdV() {
|
|
8
|
+
const data = require("@formily/antd-v5");
|
|
9
|
+
_antdV = function _antdV() {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
7
14
|
function _react() {
|
|
8
15
|
const data = require("@formily/react");
|
|
9
16
|
_react = function _react() {
|
|
@@ -25,13 +32,6 @@ function _react2() {
|
|
|
25
32
|
};
|
|
26
33
|
return data;
|
|
27
34
|
}
|
|
28
|
-
function _antd() {
|
|
29
|
-
const data = require("@formily/antd");
|
|
30
|
-
_antd = function _antd() {
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
35
|
var _locale = require("../../../../locale");
|
|
36
36
|
var _hooks = require("../../hooks");
|
|
37
37
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -46,7 +46,7 @@ const HeaderDesigner = () => {
|
|
|
46
46
|
}, _react2().default.createElement(_client().SchemaSettings.ModalItem, {
|
|
47
47
|
title: t('Edit info'),
|
|
48
48
|
components: {
|
|
49
|
-
Switch:
|
|
49
|
+
Switch: _antdV().Switch
|
|
50
50
|
},
|
|
51
51
|
initialValues: field.componentProps,
|
|
52
52
|
schema: {
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MHeader = void 0;
|
|
7
|
-
function _css() {
|
|
8
|
-
const data = require("@emotion/css");
|
|
9
|
-
_css = function _css() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _react() {
|
|
15
8
|
const data = require("@formily/react");
|
|
16
9
|
_react = function _react() {
|
|
@@ -68,15 +61,21 @@ const InternalHeader = props => {
|
|
|
68
61
|
const navigate = (0, _reactRouterDom().useNavigate)();
|
|
69
62
|
const _useDocumentTitle = (0, _client().useDocumentTitle)(),
|
|
70
63
|
setTitle = _useDocumentTitle.setTitle;
|
|
64
|
+
const _useToken = (0, _client().useToken)(),
|
|
65
|
+
token = _useToken.token;
|
|
71
66
|
(0, _react2().useEffect)(() => {
|
|
72
67
|
// sync title
|
|
73
68
|
setTitle(compiledTitle);
|
|
74
69
|
}, [compiledTitle]);
|
|
70
|
+
const style = (0, _react2().useMemo)(() => {
|
|
71
|
+
return {
|
|
72
|
+
width: '100%',
|
|
73
|
+
background: token.colorBgContainer
|
|
74
|
+
};
|
|
75
|
+
}, [token.colorBgContainer]);
|
|
75
76
|
return _react2().default.createElement(_client().SortableItem, {
|
|
76
|
-
className: (0,
|
|
77
|
-
|
|
78
|
-
background: #fff;
|
|
79
|
-
`)
|
|
77
|
+
className: (0, _client().cx)('nb-mobile-header'),
|
|
78
|
+
style: style
|
|
80
79
|
}, _react2().default.createElement(_antdMobile().NavBar, {
|
|
81
80
|
backArrow: showBack,
|
|
82
81
|
onBack: () => navigate(-1)
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MenuDesigner = void 0;
|
|
7
|
-
function _client() {
|
|
8
|
-
const data = require("@nocobase/client");
|
|
9
|
-
_client = function _client() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _icons() {
|
|
15
8
|
const data = require("@ant-design/icons");
|
|
16
9
|
_icons = function _icons() {
|
|
@@ -19,13 +12,19 @@ function _icons() {
|
|
|
19
12
|
return data;
|
|
20
13
|
}
|
|
21
14
|
function _react() {
|
|
22
|
-
const data =
|
|
15
|
+
const data = require("@formily/react");
|
|
23
16
|
_react = function _react() {
|
|
24
17
|
return data;
|
|
25
18
|
};
|
|
26
19
|
return data;
|
|
27
20
|
}
|
|
28
|
-
|
|
21
|
+
function _client() {
|
|
22
|
+
const data = require("@nocobase/client");
|
|
23
|
+
_client = function _client() {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
29
28
|
function _antd() {
|
|
30
29
|
const data = require("antd");
|
|
31
30
|
_antd = function _antd() {
|
|
@@ -34,12 +33,13 @@ function _antd() {
|
|
|
34
33
|
return data;
|
|
35
34
|
}
|
|
36
35
|
function _react2() {
|
|
37
|
-
const data = require("
|
|
36
|
+
const data = _interopRequireDefault(require("react"));
|
|
38
37
|
_react2 = function _react2() {
|
|
39
38
|
return data;
|
|
40
39
|
};
|
|
41
40
|
return data;
|
|
42
41
|
}
|
|
42
|
+
var _locale = require("../../../../locale");
|
|
43
43
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
44
44
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
45
45
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -49,25 +49,25 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
49
49
|
const MenuDesigner = props => {
|
|
50
50
|
const _useTranslation = (0, _locale.useTranslation)(),
|
|
51
51
|
t = _useTranslation.t;
|
|
52
|
-
const fieldSchema = (0,
|
|
52
|
+
const fieldSchema = (0, _react().useFieldSchema)();
|
|
53
53
|
const _useDesignable = (0, _client().useDesignable)(),
|
|
54
54
|
dn = _useDesignable.dn;
|
|
55
|
-
const field = (0,
|
|
55
|
+
const field = (0, _react().useField)();
|
|
56
56
|
const schemaSettingsProps = {
|
|
57
57
|
dn,
|
|
58
58
|
field,
|
|
59
59
|
fieldSchema
|
|
60
60
|
};
|
|
61
|
-
return
|
|
62
|
-
title:
|
|
61
|
+
return _react2().default.createElement(_client().SchemaSettings, _objectSpread({
|
|
62
|
+
title: _react2().default.createElement(_antd().Button, {
|
|
63
63
|
style: {
|
|
64
|
-
borderColor: '
|
|
65
|
-
color: '
|
|
64
|
+
borderColor: 'var(--colorSettings)',
|
|
65
|
+
color: 'var(--colorSettings)'
|
|
66
66
|
},
|
|
67
|
-
icon:
|
|
67
|
+
icon: _react2().default.createElement(_icons().MenuOutlined, null),
|
|
68
68
|
type: "dashed"
|
|
69
69
|
}, t('Menu configuration'))
|
|
70
|
-
}, schemaSettingsProps),
|
|
70
|
+
}, schemaSettingsProps), _react2().default.createElement(_client().SchemaSettings.Remove, {
|
|
71
71
|
key: "remove",
|
|
72
72
|
removeParentsIfNoChildren: true,
|
|
73
73
|
confirm: {
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MenuItem = void 0;
|
|
7
|
-
function _css() {
|
|
8
|
-
const data = require("@emotion/css");
|
|
9
|
-
_css = function _css() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _react() {
|
|
15
8
|
const data = require("@formily/react");
|
|
16
9
|
_react = function _react() {
|
|
@@ -69,7 +62,7 @@ const InternalMenuItem = props => {
|
|
|
69
62
|
navigate(params.name ? `/mobile/${fieldSchema['x-uid']}` : `${locationPath}/${fieldSchema['x-uid']}`);
|
|
70
63
|
};
|
|
71
64
|
return _react2().default.createElement(_client().SortableItem, {
|
|
72
|
-
className: (0,
|
|
65
|
+
className: (0, _client().cx)('nb-mobile-menu-item', (0, _client().css)`
|
|
73
66
|
width: 100%;
|
|
74
67
|
background: var(--adm-color-background);
|
|
75
68
|
> .adm-list-item {
|
|
@@ -5,13 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MMenu = void 0;
|
|
7
7
|
function _react() {
|
|
8
|
-
const data =
|
|
8
|
+
const data = require("@formily/react");
|
|
9
9
|
_react = function _react() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
var _Menu = require("./Menu.Item");
|
|
15
14
|
function _client() {
|
|
16
15
|
const data = require("@nocobase/client");
|
|
17
16
|
_client = function _client() {
|
|
@@ -19,35 +18,32 @@ function _client() {
|
|
|
19
18
|
};
|
|
20
19
|
return data;
|
|
21
20
|
}
|
|
22
|
-
function
|
|
23
|
-
const data = require("
|
|
24
|
-
|
|
21
|
+
function _antdMobile() {
|
|
22
|
+
const data = require("antd-mobile");
|
|
23
|
+
_antdMobile = function _antdMobile() {
|
|
25
24
|
return data;
|
|
26
25
|
};
|
|
27
26
|
return data;
|
|
28
27
|
}
|
|
29
|
-
var _Menu2 = require("./Menu.Designer");
|
|
30
28
|
function _react2() {
|
|
31
|
-
const data = require("
|
|
29
|
+
const data = _interopRequireDefault(require("react"));
|
|
32
30
|
_react2 = function _react2() {
|
|
33
31
|
return data;
|
|
34
32
|
};
|
|
35
33
|
return data;
|
|
36
34
|
}
|
|
37
|
-
function _antdMobile() {
|
|
38
|
-
const data = require("antd-mobile");
|
|
39
|
-
_antdMobile = function _antdMobile() {
|
|
40
|
-
return data;
|
|
41
|
-
};
|
|
42
|
-
return data;
|
|
43
|
-
}
|
|
44
35
|
var _locale = require("../../../../locale");
|
|
45
|
-
var _schema = require("./schema");
|
|
46
36
|
var _common = require("../../common");
|
|
37
|
+
var _Menu = require("./Menu.Designer");
|
|
38
|
+
var _Menu2 = require("./Menu.Item");
|
|
39
|
+
var _schema = require("./schema");
|
|
40
|
+
var _style = _interopRequireDefault(require("./style"));
|
|
47
41
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
48
42
|
const InternalMenu = props => {
|
|
43
|
+
const _useStyles = (0, _style.default)(),
|
|
44
|
+
styles = _useStyles.styles;
|
|
49
45
|
const Designer = (0, _client().useDesigner)();
|
|
50
|
-
const fieldSchema = (0,
|
|
46
|
+
const fieldSchema = (0, _react().useFieldSchema)();
|
|
51
47
|
const _useDesignable = (0, _client().useDesignable)(),
|
|
52
48
|
insertBeforeEnd = _useDesignable.insertBeforeEnd,
|
|
53
49
|
designable = _useDesignable.designable;
|
|
@@ -66,16 +62,12 @@ const InternalMenu = props => {
|
|
|
66
62
|
properties
|
|
67
63
|
});
|
|
68
64
|
};
|
|
69
|
-
return
|
|
70
|
-
className: (0,
|
|
71
|
-
|
|
72
|
-
width: 100%;
|
|
73
|
-
margin-bottom: var(--nb-spacing);
|
|
74
|
-
`)
|
|
75
|
-
}, _react().default.createElement(_antdMobile().List, null, designable && _react().default.createElement(_antdMobile().List.Item, null, _react().default.createElement(Designer, null)), _react().default.createElement(_client().DndContext, null, _react().default.createElement(_client().SchemaComponent, {
|
|
65
|
+
return _react2().default.createElement(_client().SortableItem, {
|
|
66
|
+
className: (0, _client().cx)('nb-mobile-menu', styles.mobileMenu)
|
|
67
|
+
}, _react2().default.createElement(_antdMobile().List, null, designable && _react2().default.createElement(_antdMobile().List.Item, null, _react2().default.createElement(Designer, null)), _react2().default.createElement(_client().DndContext, null, _react2().default.createElement(_client().SchemaComponent, {
|
|
76
68
|
onlyRenderProperties: true,
|
|
77
69
|
schema: fieldSchema
|
|
78
|
-
})), designable ?
|
|
70
|
+
})), designable ? _react2().default.createElement(_antdMobile().List.Item, null, _react2().default.createElement(_client().SchemaInitializer.ActionModal, {
|
|
79
71
|
buttonText: t('Add menu item'),
|
|
80
72
|
title: t('Add menu item'),
|
|
81
73
|
schema: _schema.menuItemSchema,
|
|
@@ -84,5 +76,5 @@ const InternalMenu = props => {
|
|
|
84
76
|
};
|
|
85
77
|
const MMenu = InternalMenu;
|
|
86
78
|
exports.MMenu = MMenu;
|
|
87
|
-
MMenu.Item =
|
|
88
|
-
MMenu.Designer =
|
|
79
|
+
MMenu.Item = _Menu2.MenuItem;
|
|
80
|
+
MMenu.Designer = _Menu.MenuDesigner;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
function _client() {
|
|
8
|
+
const data = require("@nocobase/client");
|
|
9
|
+
_client = function _client() {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
const useStyles = (0, _client().createStyles)(({
|
|
15
|
+
token,
|
|
16
|
+
css
|
|
17
|
+
}) => {
|
|
18
|
+
return {
|
|
19
|
+
mobileMenu: css`
|
|
20
|
+
--adm-color-primary: ${token.colorPrimary};
|
|
21
|
+
--adm-color-primary-hover: ${token.colorPrimaryHover};
|
|
22
|
+
--adm-color-primary-active: ${token.colorPrimaryActive};
|
|
23
|
+
--padding-left: ${token.paddingSM}px;
|
|
24
|
+
--adm-color-background: ${token.colorBgContainer};
|
|
25
|
+
--adm-color-border: ${token.colorBorder};
|
|
26
|
+
|
|
27
|
+
background: ${token.colorBgContainer};
|
|
28
|
+
width: 100%;
|
|
29
|
+
margin-bottom: var(--nb-spacing);
|
|
30
|
+
`
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
var _default = useStyles;
|
|
34
|
+
exports.default = _default;
|
|
@@ -75,8 +75,8 @@ const PageDesigner = props => {
|
|
|
75
75
|
return _react2().default.createElement(_client().SchemaSettings, _objectSpread({
|
|
76
76
|
title: _react2().default.createElement(_antd().Button, {
|
|
77
77
|
style: {
|
|
78
|
-
borderColor: '
|
|
79
|
-
color: '
|
|
78
|
+
borderColor: 'var(--colorSettings)',
|
|
79
|
+
color: 'var(--colorSettings)',
|
|
80
80
|
width: '100%'
|
|
81
81
|
},
|
|
82
82
|
icon: _react2().default.createElement(_icons().MenuOutlined, null),
|