@nocobase/plugin-mobile-client 0.10.0-alpha.5 → 0.11.0-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.js +15 -30
- package/lib/client/core/schema/components/header/Header.Designer.js +8 -8
- package/lib/client/core/schema/components/header/Header.js +1 -8
- 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 +15 -22
- package/lib/client/core/schema/components/page/Page.js +7 -14
- 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 +25 -32
- package/lib/client/core/schema/hooks/useSchemaPatch.js +4 -5
- 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/router/Application.js +6 -14
- 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.tsx +13 -29
- package/src/client/core/schema/components/header/Header.Designer.tsx +3 -3
- package/src/client/core/schema/components/header/Header.tsx +1 -2
- package/src/client/core/schema/components/menu/Menu.Item.tsx +10 -2
- package/src/client/core/schema/components/menu/Menu.tsx +7 -6
- package/src/client/core/schema/components/page/Page.tsx +3 -4
- 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 +8 -7
- package/src/client/core/schema/hooks/useSchemaPatch.ts +2 -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/router/Application.tsx +3 -3
- 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;
|
|
@@ -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() {
|
|
@@ -73,38 +66,32 @@ const InternalContainer = props => {
|
|
|
73
66
|
var _fieldSchema$properti;
|
|
74
67
|
const Designer = (0, _client().useDesigner)();
|
|
75
68
|
const fieldSchema = (0, _react().useFieldSchema)();
|
|
69
|
+
const navigate = (0, _reactRouterDom().useNavigate)();
|
|
76
70
|
const params = (0, _reactRouterDom().useParams)();
|
|
77
71
|
const location = (0, _reactRouterDom().useLocation)();
|
|
78
72
|
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 =
|
|
73
|
+
const tabBarCurrentFirstKey = tabBarSchema !== null && tabBarSchema !== void 0 && tabBarSchema.properties ? Object.keys(tabBarSchema.properties)[0] : null;
|
|
80
74
|
let redirectToUid = null;
|
|
81
75
|
if (tabBarCurrentFirstKey) {
|
|
82
76
|
var _tabBarSchema$propert;
|
|
83
77
|
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
78
|
}
|
|
85
|
-
|
|
86
|
-
if (!
|
|
87
|
-
|
|
79
|
+
(0, _react2().useEffect)(() => {
|
|
80
|
+
if (redirectToUid && !params.name) {
|
|
81
|
+
const locationPath = location.pathname.endsWith('/') ? location.pathname.slice(0, -1) : location.pathname;
|
|
82
|
+
navigate(`${locationPath}/tab_${redirectToUid}`, {
|
|
83
|
+
replace: true
|
|
84
|
+
});
|
|
88
85
|
}
|
|
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]);
|
|
86
|
+
}, [location.pathname, navigate, params.name, redirectToUid]);
|
|
100
87
|
return _react2().default.createElement(_client().SortableItem, {
|
|
101
88
|
eid: "nb-mobile-scroll-wrapper",
|
|
102
|
-
className: (0,
|
|
89
|
+
className: (0, _client().cx)('nb-mobile-container', (0, _client().css)`
|
|
103
90
|
& > .general-schema-designer > .general-schema-designer-icons {
|
|
104
91
|
right: unset;
|
|
105
92
|
left: 2px;
|
|
106
93
|
}
|
|
107
|
-
background:
|
|
94
|
+
background: var(--nb-box-bg);
|
|
108
95
|
display: flex;
|
|
109
96
|
flex-direction: column;
|
|
110
97
|
width: 100%;
|
|
@@ -114,18 +101,16 @@ const InternalContainer = props => {
|
|
|
114
101
|
`)
|
|
115
102
|
}, _react2().default.createElement(Designer, null), _react2().default.createElement("div", {
|
|
116
103
|
style: {
|
|
117
|
-
paddingBottom:
|
|
104
|
+
paddingBottom: redirectToUid ? '50px' : '0px'
|
|
118
105
|
},
|
|
119
|
-
className: (0,
|
|
120
|
-
},
|
|
121
|
-
routes: tabRoutes
|
|
122
|
-
}) : _react2().default.createElement(_client().SchemaComponent, {
|
|
106
|
+
className: (0, _client().cx)('nb-mobile-container-content')
|
|
107
|
+
}, redirectToUid ? _react2().default.createElement(TabContentComponent, null) : _react2().default.createElement(_client().SchemaComponent, {
|
|
123
108
|
filterProperties: schema => {
|
|
124
109
|
return schema['x-component'] !== 'MTabBar';
|
|
125
110
|
},
|
|
126
111
|
schema: fieldSchema
|
|
127
112
|
})), _react2().default.createElement("div", {
|
|
128
|
-
className: (0,
|
|
113
|
+
className: (0, _client().cx)('nb-mobile-container-tab-bar', (0, _client().css)`
|
|
129
114
|
& > .general-schema-designer {
|
|
130
115
|
--nb-designer-top: 20px;
|
|
131
116
|
}
|
|
@@ -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() {
|
|
@@ -73,7 +66,7 @@ const InternalHeader = props => {
|
|
|
73
66
|
setTitle(compiledTitle);
|
|
74
67
|
}, [compiledTitle]);
|
|
75
68
|
return _react2().default.createElement(_client().SortableItem, {
|
|
76
|
-
className: (0,
|
|
69
|
+
className: (0, _client().cx)('nb-mobile-header', (0, _client().css)`
|
|
77
70
|
width: 100%;
|
|
78
71
|
background: #fff;
|
|
79
72
|
`)
|
|
@@ -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,29 @@ 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");
|
|
47
40
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
48
41
|
const InternalMenu = props => {
|
|
49
42
|
const Designer = (0, _client().useDesigner)();
|
|
50
|
-
const fieldSchema = (0,
|
|
43
|
+
const fieldSchema = (0, _react().useFieldSchema)();
|
|
51
44
|
const _useDesignable = (0, _client().useDesignable)(),
|
|
52
45
|
insertBeforeEnd = _useDesignable.insertBeforeEnd,
|
|
53
46
|
designable = _useDesignable.designable;
|
|
@@ -66,16 +59,16 @@ const InternalMenu = props => {
|
|
|
66
59
|
properties
|
|
67
60
|
});
|
|
68
61
|
};
|
|
69
|
-
return
|
|
70
|
-
className: (0,
|
|
62
|
+
return _react2().default.createElement(_client().SortableItem, {
|
|
63
|
+
className: (0, _client().cx)('nb-mobile-menu', (0, _client().css)`
|
|
71
64
|
background: #ffffff;
|
|
72
65
|
width: 100%;
|
|
73
66
|
margin-bottom: var(--nb-spacing);
|
|
74
67
|
`)
|
|
75
|
-
},
|
|
68
|
+
}, _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
69
|
onlyRenderProperties: true,
|
|
77
70
|
schema: fieldSchema
|
|
78
|
-
})), designable ?
|
|
71
|
+
})), designable ? _react2().default.createElement(_antdMobile().List.Item, null, _react2().default.createElement(_client().SchemaInitializer.ActionModal, {
|
|
79
72
|
buttonText: t('Add menu item'),
|
|
80
73
|
title: t('Add menu item'),
|
|
81
74
|
schema: _schema.menuItemSchema,
|
|
@@ -84,5 +77,5 @@ const InternalMenu = props => {
|
|
|
84
77
|
};
|
|
85
78
|
const MMenu = InternalMenu;
|
|
86
79
|
exports.MMenu = MMenu;
|
|
87
|
-
MMenu.Item =
|
|
88
|
-
MMenu.Designer =
|
|
80
|
+
MMenu.Item = _Menu2.MenuItem;
|
|
81
|
+
MMenu.Designer = _Menu.MenuDesigner;
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MPage = 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() {
|
|
@@ -54,10 +47,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
54
47
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
55
48
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
56
49
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
57
|
-
const globalActionCSS = (0,
|
|
50
|
+
const globalActionCSS = (0, _client().css)`
|
|
58
51
|
#nb-position-container > & {
|
|
59
52
|
height: 49px;
|
|
60
|
-
border-top: 1px solid
|
|
53
|
+
border-top: 1px solid var(--nb-box-bg);
|
|
61
54
|
margin-bottom: 0px !important;
|
|
62
55
|
padding: 0 var(--nb-spacing);
|
|
63
56
|
align-items: center;
|
|
@@ -80,10 +73,10 @@ const InternalPage = props => {
|
|
|
80
73
|
let hasGlobalActions = false;
|
|
81
74
|
if (!tabsSchema && fieldSchema.properties) {
|
|
82
75
|
hasGlobalActions = (0, _helpers.countGridCol)(fieldSchema.properties['grid'], 2) === 1;
|
|
83
|
-
} else if (searchParams.has('tab') &&
|
|
76
|
+
} else if (searchParams.has('tab') && tabsSchema !== null && tabsSchema !== void 0 && (_tabsSchema$propertie = tabsSchema.properties) !== null && _tabsSchema$propertie !== void 0 && _tabsSchema$propertie[searchParams.get('tab')]) {
|
|
84
77
|
var _tabsSchema$propertie2, _tabsSchema$propertie3;
|
|
85
78
|
hasGlobalActions = (0, _helpers.countGridCol)((_tabsSchema$propertie2 = tabsSchema.properties[searchParams.get('tab')]) === null || _tabsSchema$propertie2 === void 0 ? void 0 : (_tabsSchema$propertie3 = _tabsSchema$propertie2.properties) === null || _tabsSchema$propertie3 === void 0 ? void 0 : _tabsSchema$propertie3['grid'], 2) === 1;
|
|
86
|
-
} else if (tabsSchema
|
|
79
|
+
} else if (tabsSchema !== null && tabsSchema !== void 0 && tabsSchema.properties) {
|
|
87
80
|
const schema = Object.values(tabsSchema.properties).sort((t1, t2) => t1['x-index'] - t2['x-index'])[0];
|
|
88
81
|
if (schema) {
|
|
89
82
|
setTimeout(() => {
|
|
@@ -112,8 +105,8 @@ const InternalPage = props => {
|
|
|
112
105
|
}, [hasGlobalActions, onlyInPage]);
|
|
113
106
|
return _react2().default.createElement(_client().SortableItem, {
|
|
114
107
|
eid: "nb-mobile-scroll-wrapper",
|
|
115
|
-
className: (0,
|
|
116
|
-
background:
|
|
108
|
+
className: (0, _client().cx)('nb-mobile-page', (0, _client().css)`
|
|
109
|
+
background: var(--nb-box-bg);
|
|
117
110
|
display: flex;
|
|
118
111
|
flex-direction: column;
|
|
119
112
|
width: 100%;
|
|
@@ -126,7 +119,7 @@ const InternalPage = props => {
|
|
|
126
119
|
style: {
|
|
127
120
|
paddingBottom: tabsSchema ? null : 'var(--nb-spacing)'
|
|
128
121
|
},
|
|
129
|
-
className: (0,
|
|
122
|
+
className: (0, _client().cx)('nb-mobile-page-header', (0, _client().css)`
|
|
130
123
|
& > .ant-tabs > .ant-tabs-nav {
|
|
131
124
|
.ant-tabs-tab {
|
|
132
125
|
margin: 0 !important;
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MSettings = exports.InternalSettings = 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 _client() {
|
|
15
8
|
const data = require("@nocobase/client");
|
|
16
9
|
_client = function _client() {
|
|
@@ -30,7 +23,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
30
23
|
const InternalSettings = () => {
|
|
31
24
|
const Designer = (0, _client().useDesigner)();
|
|
32
25
|
return _react().default.createElement(_client().SortableItem, {
|
|
33
|
-
className: (0,
|
|
26
|
+
className: (0, _client().cx)('nb-mobile-setting', (0, _client().css)`
|
|
34
27
|
margin-bottom: var(--nb-spacing);
|
|
35
28
|
`)
|
|
36
29
|
}, _react().default.createElement(Designer, null), _react().default.createElement(_client().SettingsMenu, {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.TabBarItem = exports.Designer = 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
|
};
|
|
@@ -18,52 +18,45 @@ function _client() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
var _locale = require("../../../../locale");
|
|
22
21
|
function _react2() {
|
|
23
|
-
const data = require("
|
|
22
|
+
const data = _interopRequireDefault(require("react"));
|
|
24
23
|
_react2 = function _react2() {
|
|
25
24
|
return data;
|
|
26
25
|
};
|
|
27
26
|
return data;
|
|
28
27
|
}
|
|
28
|
+
var _locale = require("../../../../locale");
|
|
29
29
|
var _hooks = require("../../hooks");
|
|
30
|
-
function _css() {
|
|
31
|
-
const data = require("@emotion/css");
|
|
32
|
-
_css = function _css() {
|
|
33
|
-
return data;
|
|
34
|
-
};
|
|
35
|
-
return data;
|
|
36
|
-
}
|
|
37
30
|
var _schema = require("./schema");
|
|
38
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
32
|
const InternalItem = () => {
|
|
40
33
|
// NOTE: nothing to do
|
|
41
34
|
// return <TabBar.Item {...props}></TabBar.Item>;
|
|
42
35
|
const Designer = (0, _client().useDesigner)();
|
|
43
|
-
return
|
|
44
|
-
className: (0,
|
|
36
|
+
return _react2().default.createElement(_client().SortableItem, {
|
|
37
|
+
className: (0, _client().cx)('nb-mobile-tab-bar-item', (0, _client().css)`
|
|
45
38
|
position: absolute !important;
|
|
46
39
|
width: 100%;
|
|
47
40
|
height: 100%;
|
|
48
41
|
top: 0;
|
|
49
42
|
left: 0;
|
|
50
43
|
`)
|
|
51
|
-
},
|
|
44
|
+
}, _react2().default.createElement(Designer, null));
|
|
52
45
|
};
|
|
53
46
|
const Designer = () => {
|
|
54
47
|
const _useTranslation = (0, _locale.useTranslation)(),
|
|
55
48
|
t = _useTranslation.t;
|
|
56
|
-
const fieldSchema = (0,
|
|
49
|
+
const fieldSchema = (0, _react().useFieldSchema)();
|
|
57
50
|
const _useSchemaPatch = (0, _hooks.useSchemaPatch)(),
|
|
58
51
|
onUpdateComponentProps = _useSchemaPatch.onUpdateComponentProps;
|
|
59
|
-
const field = (0,
|
|
52
|
+
const field = (0, _react().useField)();
|
|
60
53
|
const tabItems = Object.keys(fieldSchema.parent.properties).length;
|
|
61
|
-
return
|
|
54
|
+
return _react2().default.createElement(_client().GeneralSchemaDesigner, null, _react2().default.createElement(_client().SchemaSettings.ModalItem, {
|
|
62
55
|
title: t('Edit info'),
|
|
63
56
|
initialValues: field.componentProps,
|
|
64
57
|
schema: _schema.tabItemSchema,
|
|
65
58
|
onSubmit: onUpdateComponentProps
|
|
66
|
-
}), tabItems > 1 ?
|
|
59
|
+
}), tabItems > 1 ? _react2().default.createElement(_client().SchemaSettings.Remove, {
|
|
67
60
|
key: "remove",
|
|
68
61
|
removeParentsIfNoChildren: true,
|
|
69
62
|
confirm: {
|