@tachybase/client 1.6.25 → 1.6.27
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/api-client/APIClient.d.ts +3 -0
- package/es/api-client/APIClient.mjs +11 -2
- package/es/api-client/constants.d.ts +1 -0
- package/es/api-client/constants.mjs +2 -0
- package/es/api-client/index.d.ts +1 -0
- package/es/api-client/index.mjs +1 -0
- package/es/built-in/acl/Configuration/ConfigureCenter.d.ts +6 -0
- package/es/built-in/acl/Configuration/ConfigureCenter.mjs +4 -22
- package/es/built-in/acl/acl-snippet.d.ts +18 -0
- package/es/built-in/acl/acl-snippet.mjs +40 -0
- package/es/built-in/acl/index.d.ts +1 -0
- package/es/built-in/acl/index.mjs +1 -0
- package/es/built-in/admin-layout/CurrentNavigationMenuProvider.d.ts +19 -0
- package/es/built-in/admin-layout/CurrentNavigationMenuProvider.mjs +58 -0
- package/es/built-in/admin-layout/InternalAdminLayout.d.ts +3 -0
- package/es/built-in/admin-layout/InternalAdminLayout.mjs +20 -2
- package/es/built-in/admin-layout/index.d.ts +1 -0
- package/es/built-in/admin-layout/index.mjs +1 -0
- package/es/built-in/admin-layout/style.d.ts +1 -0
- package/es/built-in/admin-layout/style.mjs +22 -10
- package/es/built-in/index.d.ts +7 -1
- package/es/built-in/index.mjs +4 -2
- package/es/built-in/setting-layout/SettingsCenterDropdown.d.ts +3 -0
- package/es/built-in/setting-layout/SettingsCenterDropdown.mjs +7 -6
- package/es/collection-manager/Configuration/components/index.d.ts +24 -0
- package/es/collection-manager/templates/sql.d.ts +13 -0
- package/es/collection-manager/templates/view.d.ts +12 -0
- package/lib/api-client/APIClient.js +11 -2
- package/lib/api-client/constants.js +36 -0
- package/lib/api-client/index.js +12 -3
- package/lib/block-provider/hooks/index.js +2 -2
- package/lib/built-in/acl/Configuration/ConfigureCenter.js +4 -22
- package/lib/built-in/acl/acl-snippet.js +83 -0
- package/lib/built-in/acl/index.js +15 -6
- package/lib/built-in/admin-layout/CurrentNavigationMenuProvider.js +95 -0
- package/lib/built-in/admin-layout/InternalAdminLayout.js +28 -0
- package/lib/built-in/admin-layout/index.js +24 -15
- package/lib/built-in/admin-layout/style.js +22 -10
- package/lib/built-in/index.js +56 -41
- package/lib/built-in/setting-layout/SettingsCenterDropdown.js +7 -6
- package/lib/locale/en_US.js +9 -0
- package/lib/locale/es_ES.js +9 -0
- package/lib/locale/fr_FR.js +9 -0
- package/lib/locale/ja_JP.js +9 -0
- package/lib/locale/ko_KR.js +9 -0
- package/lib/locale/pt_BR.js +9 -0
- package/lib/locale/ru_RU.js +9 -0
- package/lib/locale/tr_TR.js +9 -0
- package/lib/locale/uk_UA.js +9 -0
- package/lib/locale/zh-CN.js +9 -0
- package/lib/locale/zh-TW.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (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 = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
CURRENT_TENANT_ID_STORAGE_KEY: ()=>CURRENT_TENANT_ID_STORAGE_KEY
|
|
28
|
+
});
|
|
29
|
+
const CURRENT_TENANT_ID_STORAGE_KEY = 'current_tenant_id';
|
|
30
|
+
exports.CURRENT_TENANT_ID_STORAGE_KEY = __webpack_exports__.CURRENT_TENANT_ID_STORAGE_KEY;
|
|
31
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
32
|
+
"CURRENT_TENANT_ID_STORAGE_KEY"
|
|
33
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
34
|
+
Object.defineProperty(exports, '__esModule', {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
package/lib/api-client/index.js
CHANGED
|
@@ -6,6 +6,9 @@ var __webpack_modules__ = {
|
|
|
6
6
|
"./APIClientProvider": function(module) {
|
|
7
7
|
module.exports = require("./APIClientProvider.js");
|
|
8
8
|
},
|
|
9
|
+
"./constants": function(module) {
|
|
10
|
+
module.exports = require("./constants.js");
|
|
11
|
+
},
|
|
9
12
|
"./context?fe51": function(module) {
|
|
10
13
|
module.exports = require("./context.js");
|
|
11
14
|
},
|
|
@@ -74,10 +77,16 @@ var __webpack_exports__ = {};
|
|
|
74
77
|
return _APIClientProvider__WEBPACK_IMPORTED_MODULE_2__[key];
|
|
75
78
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
76
79
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
77
|
-
var
|
|
80
|
+
var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./constants");
|
|
81
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
82
|
+
for(var __WEBPACK_IMPORT_KEY__ in _constants__WEBPACK_IMPORTED_MODULE_3__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
83
|
+
return _constants__WEBPACK_IMPORTED_MODULE_3__[key];
|
|
84
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
85
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
86
|
+
var _context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./context?fe51");
|
|
78
87
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
79
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
80
|
-
return
|
|
88
|
+
for(var __WEBPACK_IMPORT_KEY__ in _context__WEBPACK_IMPORTED_MODULE_4__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
89
|
+
return _context__WEBPACK_IMPORTED_MODULE_4__[key];
|
|
81
90
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
82
91
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
83
92
|
})();
|
|
@@ -18,7 +18,7 @@ var __webpack_modules__ = {
|
|
|
18
18
|
"../../filter-provider/utils": function(module) {
|
|
19
19
|
module.exports = require("../../filter-provider/utils.js");
|
|
20
20
|
},
|
|
21
|
-
"
|
|
21
|
+
"../../../schema-component": function(module) {
|
|
22
22
|
module.exports = require("../../index.js");
|
|
23
23
|
},
|
|
24
24
|
"../../record-provider": function(module) {
|
|
@@ -185,7 +185,7 @@ var __webpack_exports__ = {};
|
|
|
185
185
|
var react_i18next__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("react-i18next");
|
|
186
186
|
var react_router_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("react-router-dom");
|
|
187
187
|
var react_to_print__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("react-to-print");
|
|
188
|
-
var ___WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("
|
|
188
|
+
var ___WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("../../../schema-component");
|
|
189
189
|
var _api_client__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("../../api-client");
|
|
190
190
|
var _built_in_dynamic_page_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("../../built-in/dynamic-page/utils");
|
|
191
191
|
var _collection_manager__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("../../collection-manager");
|
|
@@ -37,15 +37,8 @@ const external_application_index_js_namespaceObject = require("../../../applicat
|
|
|
37
37
|
const external_record_provider_index_js_namespaceObject = require("../../../record-provider/index.js");
|
|
38
38
|
const external_schema_component_index_js_namespaceObject = require("../../../schema-component/index.js");
|
|
39
39
|
const external_pm_index_js_namespaceObject = require("../../pm/index.js");
|
|
40
|
+
const external_acl_snippet_js_namespaceObject = require("../acl-snippet.js");
|
|
40
41
|
const external_style_js_namespaceObject = require("../style.js");
|
|
41
|
-
const getChildrenKeys = function() {
|
|
42
|
-
let data = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], arr = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [];
|
|
43
|
-
for (const item of data){
|
|
44
|
-
arr.push(item.aclSnippet);
|
|
45
|
-
if (item.children && item.children.length) getChildrenKeys(item.children, arr);
|
|
46
|
-
}
|
|
47
|
-
return arr;
|
|
48
|
-
};
|
|
49
42
|
const SettingMenuContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)(null);
|
|
50
43
|
SettingMenuContext.displayName = 'SettingMenuContext';
|
|
51
44
|
const SettingCenterProvider = (props)=>{
|
|
@@ -83,19 +76,8 @@ const SettingsCenterConfigure = ()=>{
|
|
|
83
76
|
});
|
|
84
77
|
const resource = api.resource('roles.snippets', record.name);
|
|
85
78
|
const handleChange = async (checked, record)=>{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (checked) {
|
|
89
|
-
await resource.add({
|
|
90
|
-
values: totalKeys.map((v)=>'!' + v)
|
|
91
|
-
});
|
|
92
|
-
refresh();
|
|
93
|
-
} else {
|
|
94
|
-
await resource.remove({
|
|
95
|
-
values: totalKeys.map((v)=>'!' + v)
|
|
96
|
-
});
|
|
97
|
-
refresh();
|
|
98
|
-
}
|
|
79
|
+
await (0, external_acl_snippet_js_namespaceObject.updateAclSnippetSelection)(resource, checked, record);
|
|
80
|
+
refresh();
|
|
99
81
|
message.success(t('Saved successfully'));
|
|
100
82
|
};
|
|
101
83
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Table, {
|
|
@@ -135,7 +117,7 @@ const SettingsCenterConfigure = ()=>{
|
|
|
135
117
|
]
|
|
136
118
|
}),
|
|
137
119
|
render: (_, record)=>{
|
|
138
|
-
const checked =
|
|
120
|
+
const checked = (0, external_acl_snippet_js_namespaceObject.getAclSnippetChecked)(record, snippets);
|
|
139
121
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Checkbox, {
|
|
140
122
|
checked: checked,
|
|
141
123
|
onChange: ()=>handleChange(checked, record)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (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 = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getAclSnippetChecked: ()=>getAclSnippetChecked,
|
|
28
|
+
getChildrenAclSnippetKeys: ()=>getChildrenAclSnippetKeys,
|
|
29
|
+
isExplicitAclSnippet: ()=>isExplicitAclSnippet,
|
|
30
|
+
updateAclSnippetSelection: ()=>updateAclSnippetSelection
|
|
31
|
+
});
|
|
32
|
+
const isExplicitAclSnippet = (record)=>(null == record ? void 0 : record.aclMode) === 'explicit';
|
|
33
|
+
const isString = (value)=>'string' == typeof value;
|
|
34
|
+
function assertAclSnippetResource(resource) {
|
|
35
|
+
if ('function' != typeof resource.add || 'function' != typeof resource.remove) throw new Error('roles.snippets resource does not support acl snippet mutations');
|
|
36
|
+
}
|
|
37
|
+
const getChildrenAclSnippetKeys = function() {
|
|
38
|
+
let data = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], arr = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [];
|
|
39
|
+
for (const item of data){
|
|
40
|
+
var _item_children;
|
|
41
|
+
if (item.aclSnippet) arr.push(item.aclSnippet);
|
|
42
|
+
if (null == (_item_children = item.children) ? void 0 : _item_children.length) getChildrenAclSnippetKeys(item.children, arr);
|
|
43
|
+
}
|
|
44
|
+
return arr;
|
|
45
|
+
};
|
|
46
|
+
const getAclSnippetChecked = (record, snippets)=>isExplicitAclSnippet(record) ? snippets.includes(record.aclSnippet) : !snippets.includes("!".concat(record.aclSnippet));
|
|
47
|
+
async function updateAclSnippetSelection(resource, checked, record) {
|
|
48
|
+
assertAclSnippetResource(resource);
|
|
49
|
+
if (isExplicitAclSnippet(record)) {
|
|
50
|
+
const values = [
|
|
51
|
+
record.aclSnippet
|
|
52
|
+
].filter(isString);
|
|
53
|
+
if (checked) await resource.remove({
|
|
54
|
+
values
|
|
55
|
+
});
|
|
56
|
+
else await resource.add({
|
|
57
|
+
values
|
|
58
|
+
});
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const childrenKeys = getChildrenAclSnippetKeys(null == record ? void 0 : record.children, []);
|
|
62
|
+
const totalKeys = childrenKeys.concat(record.aclSnippet).filter(isString);
|
|
63
|
+
const values = totalKeys.map((value)=>"!".concat(value));
|
|
64
|
+
if (checked) await resource.add({
|
|
65
|
+
values
|
|
66
|
+
});
|
|
67
|
+
else await resource.remove({
|
|
68
|
+
values
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
exports.getAclSnippetChecked = __webpack_exports__.getAclSnippetChecked;
|
|
72
|
+
exports.getChildrenAclSnippetKeys = __webpack_exports__.getChildrenAclSnippetKeys;
|
|
73
|
+
exports.isExplicitAclSnippet = __webpack_exports__.isExplicitAclSnippet;
|
|
74
|
+
exports.updateAclSnippetSelection = __webpack_exports__.updateAclSnippetSelection;
|
|
75
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
76
|
+
"getAclSnippetChecked",
|
|
77
|
+
"getChildrenAclSnippetKeys",
|
|
78
|
+
"isExplicitAclSnippet",
|
|
79
|
+
"updateAclSnippetSelection"
|
|
80
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
81
|
+
Object.defineProperty(exports, '__esModule', {
|
|
82
|
+
value: true
|
|
83
|
+
});
|
|
@@ -17,6 +17,9 @@ var __webpack_modules__ = {
|
|
|
17
17
|
},
|
|
18
18
|
"./Configuration": function(module) {
|
|
19
19
|
module.exports = require("./Configuration/index.js");
|
|
20
|
+
},
|
|
21
|
+
"./acl-snippet": function(module) {
|
|
22
|
+
module.exports = require("./acl-snippet.js");
|
|
20
23
|
}
|
|
21
24
|
};
|
|
22
25
|
var __webpack_module_cache__ = {};
|
|
@@ -86,16 +89,22 @@ var __webpack_exports__ = {};
|
|
|
86
89
|
return _ACLShortcut__WEBPACK_IMPORTED_MODULE_3__[key];
|
|
87
90
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
88
91
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
89
|
-
var
|
|
92
|
+
var _acl_snippet__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./acl-snippet");
|
|
93
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
94
|
+
for(var __WEBPACK_IMPORT_KEY__ in _acl_snippet__WEBPACK_IMPORTED_MODULE_4__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
95
|
+
return _acl_snippet__WEBPACK_IMPORTED_MODULE_4__[key];
|
|
96
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
97
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
98
|
+
var _Configuration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./Configuration");
|
|
90
99
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
91
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
92
|
-
return
|
|
100
|
+
for(var __WEBPACK_IMPORT_KEY__ in _Configuration__WEBPACK_IMPORTED_MODULE_5__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
101
|
+
return _Configuration__WEBPACK_IMPORTED_MODULE_5__[key];
|
|
93
102
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
94
103
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
95
|
-
var
|
|
104
|
+
var _ACLPlugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./ACLPlugin");
|
|
96
105
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
97
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
98
|
-
return
|
|
106
|
+
for(var __WEBPACK_IMPORT_KEY__ in _ACLPlugin__WEBPACK_IMPORTED_MODULE_6__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
107
|
+
return _ACLPlugin__WEBPACK_IMPORTED_MODULE_6__[key];
|
|
99
108
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
100
109
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
101
110
|
})();
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (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 = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
CurrentNavigationMenuProvider: ()=>CurrentNavigationMenuProvider,
|
|
28
|
+
useCurrentNavigationMenu: ()=>useCurrentNavigationMenu
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
32
|
+
const client_namespaceObject = require("@tego/client");
|
|
33
|
+
const CurrentNavigationMenuContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)(null);
|
|
34
|
+
CurrentNavigationMenuContext.displayName = 'CurrentNavigationMenuContext';
|
|
35
|
+
const useCurrentNavigationMenu = ()=>{
|
|
36
|
+
const { items, update } = (0, external_react_namespaceObject.useContext)(CurrentNavigationMenuContext) || {};
|
|
37
|
+
const getItems = (0, external_react_namespaceObject.useCallback)(()=>items.current, [
|
|
38
|
+
items
|
|
39
|
+
]);
|
|
40
|
+
const addItem = (0, external_react_namespaceObject.useCallback)((item)=>{
|
|
41
|
+
if (null === item.key || void 0 === item.key) {
|
|
42
|
+
items.current.push(item);
|
|
43
|
+
update();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const index = items.current.findIndex((current)=>current.key === item.key);
|
|
47
|
+
if (-1 !== index) items.current[index] = item;
|
|
48
|
+
else items.current.push(item);
|
|
49
|
+
update();
|
|
50
|
+
}, [
|
|
51
|
+
items,
|
|
52
|
+
update
|
|
53
|
+
]);
|
|
54
|
+
const removeItem = (0, external_react_namespaceObject.useCallback)((key)=>{
|
|
55
|
+
if (null == key) return;
|
|
56
|
+
const nextItems = items.current.filter((current)=>current.key !== key);
|
|
57
|
+
if (nextItems.length === items.current.length) return;
|
|
58
|
+
items.current = nextItems;
|
|
59
|
+
update();
|
|
60
|
+
}, [
|
|
61
|
+
items,
|
|
62
|
+
update
|
|
63
|
+
]);
|
|
64
|
+
if (!items) {
|
|
65
|
+
(0, client_namespaceObject.error)('AdminLayout: You should use `CurrentNavigationMenuProvider` in the root of your app.');
|
|
66
|
+
throw new Error('AdminLayout: You should use `CurrentNavigationMenuProvider` in the root of your app.');
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
getItems,
|
|
70
|
+
addItem,
|
|
71
|
+
removeItem
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const CurrentNavigationMenuProvider = (param)=>{
|
|
75
|
+
let { children } = param;
|
|
76
|
+
const items = (0, external_react_namespaceObject.useRef)([]);
|
|
77
|
+
const [, setVersion] = (0, external_react_namespaceObject.useState)(0);
|
|
78
|
+
const update = (0, external_react_namespaceObject.useCallback)(()=>setVersion((version)=>version + 1), []);
|
|
79
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CurrentNavigationMenuContext.Provider, {
|
|
80
|
+
value: {
|
|
81
|
+
items,
|
|
82
|
+
update
|
|
83
|
+
},
|
|
84
|
+
children: children
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
exports.CurrentNavigationMenuProvider = __webpack_exports__.CurrentNavigationMenuProvider;
|
|
88
|
+
exports.useCurrentNavigationMenu = __webpack_exports__.useCurrentNavigationMenu;
|
|
89
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
90
|
+
"CurrentNavigationMenuProvider",
|
|
91
|
+
"useCurrentNavigationMenu"
|
|
92
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
93
|
+
Object.defineProperty(exports, '__esModule', {
|
|
94
|
+
value: true
|
|
95
|
+
});
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
3
12
|
(()=>{
|
|
4
13
|
__webpack_require__.d = (exports1, definition)=>{
|
|
5
14
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -28,13 +37,31 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
37
|
});
|
|
29
38
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
39
|
const external_react_namespaceObject = require("react");
|
|
40
|
+
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
31
41
|
const external_antd_namespaceObject = require("antd");
|
|
32
42
|
const external_react_router_dom_namespaceObject = require("react-router-dom");
|
|
33
43
|
const external_index_js_namespaceObject = require("../../index.js");
|
|
34
44
|
const external_AdminContent_js_namespaceObject = require("./AdminContent.js");
|
|
35
45
|
const external_AdminTabs_js_namespaceObject = require("./AdminTabs.js");
|
|
46
|
+
const external_CurrentNavigationMenuProvider_js_namespaceObject = require("./CurrentNavigationMenuProvider.js");
|
|
36
47
|
const external_MenuEditor_js_namespaceObject = require("./MenuEditor.js");
|
|
37
48
|
const external_style_js_namespaceObject = require("./style.js");
|
|
49
|
+
const NavigationMenuItems = ()=>{
|
|
50
|
+
const { getItems } = (0, external_CurrentNavigationMenuProvider_js_namespaceObject.useCurrentNavigationMenu)();
|
|
51
|
+
const { styles } = (0, external_style_js_namespaceObject.useStyles)();
|
|
52
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
53
|
+
children: getItems().map((item, index)=>{
|
|
54
|
+
var _item_key;
|
|
55
|
+
return /*#__PURE__*/ external_react_default().cloneElement(item, {
|
|
56
|
+
key: null != (_item_key = item.key) ? _item_key : "navigation-item-".concat(index),
|
|
57
|
+
className: [
|
|
58
|
+
item.props.className,
|
|
59
|
+
styles.navigationItem
|
|
60
|
+
].filter(Boolean).join(' ')
|
|
61
|
+
});
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
};
|
|
38
65
|
const InternalAdminLayout = (props)=>{
|
|
39
66
|
var _result_data_data_logo, _result_data_data, _result_data, _result_data_data1, _result_data1;
|
|
40
67
|
const sideMenuRef = (0, external_react_namespaceObject.useRef)();
|
|
@@ -72,6 +99,7 @@ const InternalAdminLayout = (props)=>{
|
|
|
72
99
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_MenuEditor_js_namespaceObject.MenuEditor, {
|
|
73
100
|
sideMenuRef: sideMenuRef
|
|
74
101
|
}),
|
|
102
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NavigationMenuItems, {}),
|
|
75
103
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
76
104
|
className: styles.headerTabs,
|
|
77
105
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AdminTabs_js_namespaceObject.AdminTabs, {})
|
|
@@ -15,6 +15,9 @@ var __webpack_modules__ = {
|
|
|
15
15
|
"./AdminTabs": function(module) {
|
|
16
16
|
module.exports = require("./AdminTabs.js");
|
|
17
17
|
},
|
|
18
|
+
"./CurrentNavigationMenuProvider": function(module) {
|
|
19
|
+
module.exports = require("./CurrentNavigationMenuProvider.js");
|
|
20
|
+
},
|
|
18
21
|
"./InternalAdminLayout": function(module) {
|
|
19
22
|
module.exports = require("./InternalAdminLayout.js");
|
|
20
23
|
},
|
|
@@ -104,34 +107,40 @@ var __webpack_exports__ = {};
|
|
|
104
107
|
return _AdminTabs__WEBPACK_IMPORTED_MODULE_4__[key];
|
|
105
108
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
106
109
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
107
|
-
var
|
|
110
|
+
var _CurrentNavigationMenuProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./CurrentNavigationMenuProvider");
|
|
111
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
112
|
+
for(var __WEBPACK_IMPORT_KEY__ in _CurrentNavigationMenuProvider__WEBPACK_IMPORTED_MODULE_5__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
113
|
+
return _CurrentNavigationMenuProvider__WEBPACK_IMPORTED_MODULE_5__[key];
|
|
114
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
115
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
116
|
+
var _InternalAdminLayout__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./InternalAdminLayout");
|
|
108
117
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
109
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
110
|
-
return
|
|
118
|
+
for(var __WEBPACK_IMPORT_KEY__ in _InternalAdminLayout__WEBPACK_IMPORTED_MODULE_6__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
119
|
+
return _InternalAdminLayout__WEBPACK_IMPORTED_MODULE_6__[key];
|
|
111
120
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
112
121
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
113
|
-
var
|
|
122
|
+
var _MenuEditor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./MenuEditor");
|
|
114
123
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
115
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
116
|
-
return
|
|
124
|
+
for(var __WEBPACK_IMPORT_KEY__ in _MenuEditor__WEBPACK_IMPORTED_MODULE_7__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
125
|
+
return _MenuEditor__WEBPACK_IMPORTED_MODULE_7__[key];
|
|
117
126
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
118
127
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
119
|
-
var
|
|
128
|
+
var _NoticeArea__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./NoticeArea");
|
|
120
129
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
121
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
122
|
-
return
|
|
130
|
+
for(var __WEBPACK_IMPORT_KEY__ in _NoticeArea__WEBPACK_IMPORTED_MODULE_8__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
131
|
+
return _NoticeArea__WEBPACK_IMPORTED_MODULE_8__[key];
|
|
123
132
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
124
133
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
125
|
-
var
|
|
134
|
+
var _filterByACL__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./filterByACL");
|
|
126
135
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
127
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
128
|
-
return
|
|
136
|
+
for(var __WEBPACK_IMPORT_KEY__ in _filterByACL__WEBPACK_IMPORTED_MODULE_9__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
137
|
+
return _filterByACL__WEBPACK_IMPORTED_MODULE_9__[key];
|
|
129
138
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
130
139
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
131
|
-
var
|
|
140
|
+
var _style__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./style?5898");
|
|
132
141
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
133
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
134
|
-
return
|
|
142
|
+
for(var __WEBPACK_IMPORT_KEY__ in _style__WEBPACK_IMPORTED_MODULE_10__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
143
|
+
return _style__WEBPACK_IMPORTED_MODULE_10__[key];
|
|
135
144
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
136
145
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
137
146
|
})();
|
|
@@ -107,7 +107,9 @@ function _templateObject6() {
|
|
|
107
107
|
}
|
|
108
108
|
function _templateObject7() {
|
|
109
109
|
const data = _tagged_template_literal([
|
|
110
|
-
"\n display: inline-flex;\n
|
|
110
|
+
"\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n height: var(--tb-header-height);\n padding: 0 8px;\n .ant-select {\n width: auto;\n min-width: auto;\n }\n .ant-select-selector {\n padding-inline: 8px !important;\n }\n .ant-select-selection-item,\n .ant-select-arrow {\n color: ",
|
|
111
|
+
" !important;\n }\n &:hover {\n background: ",
|
|
112
|
+
" !important;\n }\n "
|
|
111
113
|
]);
|
|
112
114
|
_templateObject7 = function() {
|
|
113
115
|
return data;
|
|
@@ -116,7 +118,7 @@ function _templateObject7() {
|
|
|
116
118
|
}
|
|
117
119
|
function _templateObject8() {
|
|
118
120
|
const data = _tagged_template_literal([
|
|
119
|
-
"\n
|
|
121
|
+
"\n display: inline-flex;\n position: relative;\n flex-shrink: 0;\n height: 100%;\n z-index: 10;\n "
|
|
120
122
|
]);
|
|
121
123
|
_templateObject8 = function() {
|
|
122
124
|
return data;
|
|
@@ -125,7 +127,7 @@ function _templateObject8() {
|
|
|
125
127
|
}
|
|
126
128
|
function _templateObject9() {
|
|
127
129
|
const data = _tagged_template_literal([
|
|
128
|
-
"\n flex: 1;\n "
|
|
130
|
+
"\n flex: 1 1 auto;\n display: flex;\n width: 0;\n overflow: hidden;\n white-space: nowrap;\n margin: 0;\n "
|
|
129
131
|
]);
|
|
130
132
|
_templateObject9 = function() {
|
|
131
133
|
return data;
|
|
@@ -134,7 +136,7 @@ function _templateObject9() {
|
|
|
134
136
|
}
|
|
135
137
|
function _templateObject10() {
|
|
136
138
|
const data = _tagged_template_literal([
|
|
137
|
-
"\n
|
|
139
|
+
"\n flex: 1;\n "
|
|
138
140
|
]);
|
|
139
141
|
_templateObject10 = function() {
|
|
140
142
|
return data;
|
|
@@ -143,13 +145,22 @@ function _templateObject10() {
|
|
|
143
145
|
}
|
|
144
146
|
function _templateObject11() {
|
|
145
147
|
const data = _tagged_template_literal([
|
|
146
|
-
"\n
|
|
148
|
+
"\n height: 100%;\n position: relative;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0);\n z-index: 100;\n "
|
|
147
149
|
]);
|
|
148
150
|
_templateObject11 = function() {
|
|
149
151
|
return data;
|
|
150
152
|
};
|
|
151
153
|
return data;
|
|
152
154
|
}
|
|
155
|
+
function _templateObject12() {
|
|
156
|
+
const data = _tagged_template_literal([
|
|
157
|
+
"\n display: flex;\n flex-direction: column;\n position: relative;\n height: 100%;\n > div {\n position: relative;\n }\n .ant-layout-content {\n height: calc(100vh - var(--tb-header-height));\n overflow: auto;\n }\n .ant-layout-footer {\n position: absolute;\n bottom: 0;\n text-align: center;\n width: 100%;\n z-index: 0;\n padding: 0px 50px;\n }\n "
|
|
158
|
+
]);
|
|
159
|
+
_templateObject12 = function() {
|
|
160
|
+
return data;
|
|
161
|
+
};
|
|
162
|
+
return data;
|
|
163
|
+
}
|
|
153
164
|
const useStyles = (0, external_antd_style_namespaceObject.createStyles)((param)=>{
|
|
154
165
|
let { css, token } = param;
|
|
155
166
|
return {
|
|
@@ -160,11 +171,12 @@ const useStyles = (0, external_antd_style_namespaceObject.createStyles)((param)=
|
|
|
160
171
|
titleContainer: css(_templateObject4()),
|
|
161
172
|
logo: css(_templateObject5()),
|
|
162
173
|
title: css(_templateObject6()),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
174
|
+
navigationItem: css(_templateObject7(), token.colorTextHeaderMenu, token.colorBgHeaderMenuHover),
|
|
175
|
+
right: css(_templateObject8()),
|
|
176
|
+
headerTabs: css(_templateObject9()),
|
|
177
|
+
notice: css(_templateObject10()),
|
|
178
|
+
sider: css(_templateObject11()),
|
|
179
|
+
main: css(_templateObject12())
|
|
168
180
|
};
|
|
169
181
|
});
|
|
170
182
|
exports.useStyles = __webpack_exports__.useStyles;
|