@tachybase/client 0.23.8-alpha.34 → 0.23.8-alpha.36
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/es/built-in/admin-layout/AdminLayout.d.ts +2 -0
- package/es/built-in/admin-layout/AdminLayout.mjs +14 -0
- package/es/built-in/admin-layout/AdminLayoutPlugin.d.ts +5 -0
- package/es/built-in/admin-layout/AdminLayoutPlugin.mjs +14 -0
- package/es/built-in/admin-layout/AdminProvider.d.ts +2 -0
- package/es/built-in/admin-layout/AdminProvider.mjs +22 -0
- package/es/built-in/admin-layout/InternalAdminLayout.d.ts +2 -0
- package/es/built-in/admin-layout/InternalAdminLayout.mjs +82 -0
- package/es/built-in/admin-layout/MenuEditor.d.ts +7 -0
- package/es/built-in/admin-layout/MenuEditor.mjs +114 -0
- package/es/built-in/admin-layout/filterByACL.d.ts +1 -0
- package/es/built-in/admin-layout/filterByACL.mjs +15 -0
- package/es/built-in/admin-layout/index.d.ts +8 -10
- package/es/built-in/admin-layout/index.mjs +8 -232
- package/es/built-in/index.mjs +3 -2
- package/es/built-in/setting-layout/SettingLayout.mjs +2 -1
- package/es/built-in/user-settings/index.mjs +2 -2
- package/lib/application/schema-initializer/hooks/index.js +2 -2
- package/lib/block-provider/hooks/index.js +2 -2
- package/lib/built-in/admin-layout/AdminLayout.js +48 -0
- package/lib/built-in/admin-layout/AdminLayoutPlugin.js +48 -0
- package/lib/built-in/admin-layout/AdminProvider.js +70 -0
- package/lib/built-in/admin-layout/InternalAdminLayout.js +116 -0
- package/lib/built-in/admin-layout/MenuEditor.js +150 -0
- package/lib/built-in/admin-layout/filterByACL.js +51 -0
- package/lib/built-in/admin-layout/index.js +67 -280
- package/lib/built-in/index.js +12 -8
- package/lib/built-in/setting-layout/SettingLayout.js +2 -1
- package/lib/built-in/user-settings/index.js +2 -2
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
"../../../schema-component": function(module) {
|
|
3
|
+
"../../../schema-component?2c44": function(module) {
|
|
4
4
|
module.exports = require("../../../schema-component/index.js");
|
|
5
5
|
},
|
|
6
6
|
"../../hooks": function(module) {
|
|
@@ -83,7 +83,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
83
83
|
});
|
|
84
84
|
var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("react");
|
|
85
85
|
var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/ __webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
86
|
-
var _schema_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../../schema-component");
|
|
86
|
+
var _schema_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../../schema-component?2c44");
|
|
87
87
|
var _hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../hooks");
|
|
88
88
|
var _components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("../components");
|
|
89
89
|
var _components_SchemaInitializerButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("../components/SchemaInitializerButton");
|
|
@@ -15,7 +15,7 @@ var __webpack_modules__ = {
|
|
|
15
15
|
"../../filter-provider/utils": function(module) {
|
|
16
16
|
module.exports = require("../../filter-provider/utils.js");
|
|
17
17
|
},
|
|
18
|
-
"
|
|
18
|
+
"../../../schema-component?8d08": function(module) {
|
|
19
19
|
module.exports = require("../../index.js");
|
|
20
20
|
},
|
|
21
21
|
"../../record-provider": function(module) {
|
|
@@ -229,7 +229,7 @@ var lodash_omit__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/ __webpack_r
|
|
|
229
229
|
var react_i18next__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("react-i18next");
|
|
230
230
|
var react_router_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("react-router-dom");
|
|
231
231
|
var react_to_print__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("react-to-print");
|
|
232
|
-
var ___WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("
|
|
232
|
+
var ___WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("../../../schema-component?8d08");
|
|
233
233
|
var _api_client__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("../../api-client");
|
|
234
234
|
var _built_in_dynamic_page_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("../../built-in/dynamic-page/utils");
|
|
235
235
|
var _collection_manager__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("../../collection-manager");
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
AdminLayout: ()=>AdminLayout
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
require("react");
|
|
33
|
+
const external_AdminProvider_js_namespaceObject = require("./AdminProvider.js");
|
|
34
|
+
const external_InternalAdminLayout_js_namespaceObject = require("./InternalAdminLayout.js");
|
|
35
|
+
const external_NoticeArea_js_namespaceObject = require("./NoticeArea.js");
|
|
36
|
+
const AdminLayout = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_AdminProvider_js_namespaceObject.AdminProvider, {
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_NoticeArea_js_namespaceObject.NoticeArea, {}),
|
|
39
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_InternalAdminLayout_js_namespaceObject.InternalAdminLayout, {
|
|
40
|
+
...props
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
var __webpack_export_target__ = exports;
|
|
45
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
46
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
47
|
+
value: true
|
|
48
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
AdminLayoutPlugin: ()=>AdminLayoutPlugin
|
|
30
|
+
});
|
|
31
|
+
const Plugin_js_namespaceObject = require("../../application/Plugin.js");
|
|
32
|
+
const SchemaTemplateManagerProvider_js_namespaceObject = require("../../schema-templates/SchemaTemplateManagerProvider.js");
|
|
33
|
+
const external_AdminLayout_js_namespaceObject = require("./AdminLayout.js");
|
|
34
|
+
class AdminLayoutPlugin extends Plugin_js_namespaceObject.Plugin {
|
|
35
|
+
async afterAdd() {
|
|
36
|
+
await this.app.pm.add(SchemaTemplateManagerProvider_js_namespaceObject.RemoteSchemaTemplateManagerPlugin);
|
|
37
|
+
}
|
|
38
|
+
async load() {
|
|
39
|
+
this.app.addComponents({
|
|
40
|
+
AdminLayout: external_AdminLayout_js_namespaceObject.AdminLayout
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
var __webpack_export_target__ = exports;
|
|
45
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
46
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
47
|
+
value: true
|
|
48
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = function(module) {
|
|
5
|
+
var getter = module && module.__esModule ? function() {
|
|
6
|
+
return module['default'];
|
|
7
|
+
} : function() {
|
|
8
|
+
return module;
|
|
9
|
+
};
|
|
10
|
+
__webpack_require__.d(getter, {
|
|
11
|
+
a: getter
|
|
12
|
+
});
|
|
13
|
+
return getter;
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
18
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: definition[key]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = function(obj, prop) {
|
|
26
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
27
|
+
};
|
|
28
|
+
})();
|
|
29
|
+
(()=>{
|
|
30
|
+
__webpack_require__.r = function(exports1) {
|
|
31
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
32
|
+
value: 'Module'
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
var __webpack_exports__ = {};
|
|
40
|
+
__webpack_require__.r(__webpack_exports__);
|
|
41
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
42
|
+
AdminProvider: ()=>AdminProvider
|
|
43
|
+
});
|
|
44
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
45
|
+
require("react");
|
|
46
|
+
const NoticesManager_js_namespaceObject = require("../../application/NoticesManager.js");
|
|
47
|
+
const index_js_namespaceObject = require("../../collection-manager/index.js");
|
|
48
|
+
const external_common_index_js_namespaceObject = require("../../common/index.js");
|
|
49
|
+
const external_user_index_js_namespaceObject = require("../../user/index.js");
|
|
50
|
+
const VariablesProvider_js_namespaceObject = require("../../variables/VariablesProvider.js");
|
|
51
|
+
var VariablesProvider_js_default = /*#__PURE__*/ __webpack_require__.n(VariablesProvider_js_namespaceObject);
|
|
52
|
+
const external_acl_index_js_namespaceObject = require("../acl/index.js");
|
|
53
|
+
const AdminProvider = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NoticesManager_js_namespaceObject.NoticeManagerProvider, {
|
|
54
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_common_index_js_namespaceObject.CurrentAppInfoProvider, {
|
|
55
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_user_index_js_namespaceObject.NavigateIfNotSignIn, {
|
|
56
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.RemoteCollectionManagerProvider, {
|
|
57
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VariablesProvider_js_default(), {
|
|
58
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_acl_index_js_namespaceObject.ACLRolesCheckProvider, {
|
|
59
|
+
children: props.children
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
var __webpack_export_target__ = exports;
|
|
67
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
68
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
69
|
+
value: true
|
|
70
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
InternalAdminLayout: ()=>InternalAdminLayout
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
|
+
const external_antd_namespaceObject = require("antd");
|
|
34
|
+
const external_react_router_dom_namespaceObject = require("react-router-dom");
|
|
35
|
+
const external_index_js_namespaceObject = require("../../index.js");
|
|
36
|
+
const external_AdminContent_js_namespaceObject = require("./AdminContent.js");
|
|
37
|
+
const external_AdminTabs_js_namespaceObject = require("./AdminTabs.js");
|
|
38
|
+
const external_MenuEditor_js_namespaceObject = require("./MenuEditor.js");
|
|
39
|
+
const external_style_js_namespaceObject = require("./style.js");
|
|
40
|
+
const InternalAdminLayout = (props)=>{
|
|
41
|
+
var _result_data_data_logo, _result_data_data, _result_data, _result_data_data1, _result_data1;
|
|
42
|
+
const sideMenuRef = (0, external_react_namespaceObject.useRef)();
|
|
43
|
+
const result = (0, external_index_js_namespaceObject.useSystemSettings)();
|
|
44
|
+
const app = (0, external_index_js_namespaceObject.useApp)();
|
|
45
|
+
const params = (0, external_react_router_dom_namespaceObject.useParams)();
|
|
46
|
+
const { styles } = (0, external_style_js_namespaceObject.useStyles)();
|
|
47
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Layout, {
|
|
48
|
+
className: styles.layout,
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Layout.Header, {
|
|
51
|
+
className: styles.header,
|
|
52
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
53
|
+
className: styles.headerA,
|
|
54
|
+
children: [
|
|
55
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
56
|
+
className: styles.headerB,
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
59
|
+
className: styles.titleContainer,
|
|
60
|
+
onClick: ()=>{
|
|
61
|
+
location.href = app.adminUrl;
|
|
62
|
+
},
|
|
63
|
+
children: [
|
|
64
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
|
|
65
|
+
className: styles.logo,
|
|
66
|
+
src: null == result ? void 0 : null === (_result_data = result.data) || void 0 === _result_data ? void 0 : null === (_result_data_data = _result_data.data) || void 0 === _result_data_data ? void 0 : null === (_result_data_data_logo = _result_data_data.logo) || void 0 === _result_data_data_logo ? void 0 : _result_data_data_logo.url
|
|
67
|
+
}),
|
|
68
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("h1", {
|
|
69
|
+
className: styles.title,
|
|
70
|
+
children: null == result ? void 0 : null === (_result_data1 = result.data) || void 0 === _result_data1 ? void 0 : null === (_result_data_data1 = _result_data1.data) || void 0 === _result_data_data1 ? void 0 : _result_data_data1.title
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
}),
|
|
74
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_MenuEditor_js_namespaceObject.MenuEditor, {
|
|
75
|
+
sideMenuRef: sideMenuRef
|
|
76
|
+
}),
|
|
77
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
78
|
+
className: styles.editor,
|
|
79
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AdminTabs_js_namespaceObject.AdminTabs, {})
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
84
|
+
className: styles.right,
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_index_js_namespaceObject.PinnedPluginList, {}),
|
|
87
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_index_js_namespaceObject.CurrentUser, {})
|
|
88
|
+
]
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
})
|
|
92
|
+
}),
|
|
93
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Layout, {
|
|
94
|
+
children: [
|
|
95
|
+
params.name && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Layout.Sider, {
|
|
96
|
+
className: styles.sider,
|
|
97
|
+
theme: 'light',
|
|
98
|
+
ref: sideMenuRef
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Layout.Content, {
|
|
101
|
+
className: styles.main,
|
|
102
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
103
|
+
className: "amplifier-block",
|
|
104
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AdminContent_js_namespaceObject.AdminContent, {})
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
var __webpack_export_target__ = exports;
|
|
113
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
114
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
115
|
+
value: true
|
|
116
|
+
});
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
MenuEditor: ()=>MenuEditor,
|
|
30
|
+
SchemaIdContext: ()=>SchemaIdContext,
|
|
31
|
+
useMenuProps: ()=>useMenuProps
|
|
32
|
+
});
|
|
33
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
34
|
+
const external_react_namespaceObject = require("react");
|
|
35
|
+
const external_react_router_namespaceObject = require("react-router");
|
|
36
|
+
const index_js_namespaceObject = require("../../api-client/index.js");
|
|
37
|
+
const external_hooks_index_js_namespaceObject = require("../../hooks/index.js");
|
|
38
|
+
const external_schema_component_index_js_namespaceObject = require("../../schema-component/index.js");
|
|
39
|
+
const external_acl_index_js_namespaceObject = require("../acl/index.js");
|
|
40
|
+
const external_document_title_index_js_namespaceObject = require("../document-title/index.js");
|
|
41
|
+
const external_filterByACL_js_namespaceObject = require("./filterByACL.js");
|
|
42
|
+
const SchemaIdContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)(null);
|
|
43
|
+
SchemaIdContext.displayName = 'SchemaIdContext';
|
|
44
|
+
const useMenuProps = ()=>{
|
|
45
|
+
const defaultSelectedUid = (0, external_react_namespaceObject.useContext)(SchemaIdContext);
|
|
46
|
+
return {
|
|
47
|
+
selectedUid: defaultSelectedUid,
|
|
48
|
+
defaultSelectedUid
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const MenuEditor = (props)=>{
|
|
52
|
+
const { setTitle } = (0, external_document_title_index_js_namespaceObject.useDocumentTitle)();
|
|
53
|
+
const navigate = (0, external_react_router_namespaceObject.useNavigate)();
|
|
54
|
+
const params = (0, external_react_router_namespaceObject.useParams)();
|
|
55
|
+
const location = (0, external_react_router_namespaceObject.useLocation)();
|
|
56
|
+
const isMatchAdmin = (0, external_react_router_namespaceObject.useMatch)('/admin');
|
|
57
|
+
const isMatchAdminName = (0, external_react_router_namespaceObject.useMatch)('/admin/:name');
|
|
58
|
+
const defaultSelectedUid = params.name;
|
|
59
|
+
const { sideMenuRef } = props;
|
|
60
|
+
const ctx = (0, external_acl_index_js_namespaceObject.useACLRoleContext)();
|
|
61
|
+
const [current, setCurrent] = (0, external_react_namespaceObject.useState)(null);
|
|
62
|
+
const onSelect = (param)=>{
|
|
63
|
+
let { item } = param;
|
|
64
|
+
const schema = item.props.schema;
|
|
65
|
+
setTitle(schema.title);
|
|
66
|
+
setCurrent(schema);
|
|
67
|
+
navigate("/admin/".concat(schema['x-uid']));
|
|
68
|
+
};
|
|
69
|
+
const adminSchemaUid = (0, external_hooks_index_js_namespaceObject.useAdminSchemaUid)();
|
|
70
|
+
const { data, loading } = (0, index_js_namespaceObject.useRequest)({
|
|
71
|
+
url: "/uiSchemas:getJsonSchema/".concat(adminSchemaUid)
|
|
72
|
+
}, {
|
|
73
|
+
refreshDeps: [
|
|
74
|
+
adminSchemaUid
|
|
75
|
+
],
|
|
76
|
+
onSuccess (data) {
|
|
77
|
+
const schema = (0, external_filterByACL_js_namespaceObject.filterByACL)(null == data ? void 0 : data.data, ctx);
|
|
78
|
+
if (isMatchAdmin) {
|
|
79
|
+
const s = (0, external_schema_component_index_js_namespaceObject.findMenuItem)(schema);
|
|
80
|
+
if (s) {
|
|
81
|
+
navigate("/admin/".concat(s['x-uid']));
|
|
82
|
+
setTitle(s.title);
|
|
83
|
+
} else navigate("/admin/");
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (!isMatchAdminName) return;
|
|
87
|
+
const s = (0, external_schema_component_index_js_namespaceObject.findByUid)(schema, defaultSelectedUid);
|
|
88
|
+
if (s) setTitle(s.title);
|
|
89
|
+
else {
|
|
90
|
+
const s = (0, external_schema_component_index_js_namespaceObject.findMenuItem)(schema);
|
|
91
|
+
if (s) {
|
|
92
|
+
navigate("/admin/".concat(s['x-uid']));
|
|
93
|
+
setTitle(s.title);
|
|
94
|
+
} else navigate("/admin/");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
const match = (0, external_react_router_namespaceObject.useMatch)('/admin/:name');
|
|
99
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
100
|
+
if (match) {
|
|
101
|
+
const schema = (0, external_filterByACL_js_namespaceObject.filterByACL)(null == data ? void 0 : data.data, ctx);
|
|
102
|
+
const s = (0, external_schema_component_index_js_namespaceObject.findByUid)(schema, defaultSelectedUid);
|
|
103
|
+
if (s) setTitle(s.title);
|
|
104
|
+
}
|
|
105
|
+
}, [
|
|
106
|
+
null == data ? void 0 : data.data,
|
|
107
|
+
location.pathname,
|
|
108
|
+
defaultSelectedUid
|
|
109
|
+
]);
|
|
110
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
111
|
+
var _Object_values_shift, _current_root, _data_data;
|
|
112
|
+
const properties = (null === (_Object_values_shift = Object.values((null == current ? void 0 : null === (_current_root = current.root) || void 0 === _current_root ? void 0 : _current_root.properties) || {}).shift()) || void 0 === _Object_values_shift ? void 0 : _Object_values_shift['properties']) || (null == data ? void 0 : null === (_data_data = data.data) || void 0 === _data_data ? void 0 : _data_data.properties);
|
|
113
|
+
if (null == sideMenuRef ? void 0 : sideMenuRef.current) {
|
|
114
|
+
const pageType = properties && Object.values(properties).find((item)=>item['x-uid'] === params.name && 'Menu.Item' === item['x-component']);
|
|
115
|
+
const isSettingPage = null == location ? void 0 : location.pathname.includes('/settings');
|
|
116
|
+
if (pageType || isSettingPage) sideMenuRef.current.style.display = 'none';
|
|
117
|
+
else sideMenuRef.current.style.display = 'block';
|
|
118
|
+
}
|
|
119
|
+
}, [
|
|
120
|
+
null == data ? void 0 : data.data,
|
|
121
|
+
params.name,
|
|
122
|
+
sideMenuRef
|
|
123
|
+
]);
|
|
124
|
+
const schema = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
125
|
+
const s = (0, external_filterByACL_js_namespaceObject.filterByACL)(null == data ? void 0 : data.data, ctx);
|
|
126
|
+
if (null == s ? void 0 : s['x-component-props']) s['x-component-props']['useProps'] = useMenuProps;
|
|
127
|
+
return s;
|
|
128
|
+
}, [
|
|
129
|
+
null == data ? void 0 : data.data
|
|
130
|
+
]);
|
|
131
|
+
if (loading) return;
|
|
132
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SchemaIdContext.Provider, {
|
|
133
|
+
value: defaultSelectedUid,
|
|
134
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_component_index_js_namespaceObject.SchemaComponent, {
|
|
135
|
+
memoized: true,
|
|
136
|
+
scope: {
|
|
137
|
+
useMenuProps,
|
|
138
|
+
onSelect,
|
|
139
|
+
sideMenuRef,
|
|
140
|
+
defaultSelectedUid
|
|
141
|
+
},
|
|
142
|
+
schema: schema
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
var __webpack_export_target__ = exports;
|
|
147
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
148
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
149
|
+
value: true
|
|
150
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
filterByACL: function() {
|
|
30
|
+
return filterByACL;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const filterByACL = (schema, options)=>{
|
|
34
|
+
const { allowAll, allowMenuItemIds = [] } = options;
|
|
35
|
+
if (allowAll) return schema;
|
|
36
|
+
const filterSchema = (s)=>{
|
|
37
|
+
if (!s) return;
|
|
38
|
+
for(const key in s.properties)if (Object.prototype.hasOwnProperty.call(s.properties, key)) {
|
|
39
|
+
const element = s.properties[key];
|
|
40
|
+
if (element['x-uid'] && !allowMenuItemIds.includes(element['x-uid'])) delete s.properties[key];
|
|
41
|
+
if (element['x-uid']) filterSchema(element);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
filterSchema(schema);
|
|
45
|
+
return schema;
|
|
46
|
+
};
|
|
47
|
+
var __webpack_export_target__ = exports;
|
|
48
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
49
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
50
|
+
value: true
|
|
51
|
+
});
|