@tachybase/client 1.6.21 → 1.6.22
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 +2 -1
- package/es/api-client/APIClient.mjs +6 -3
- package/es/application/Plugin.d.ts +2 -2
- package/es/application/hoc/withDynamicSchemaProps.mjs +1 -1
- package/es/application/schema-initializer/hooks/index.mjs +4 -1
- package/es/application/schema-settings/components/SchemaSettingsChildren.mjs +14 -14
- package/es/application/utils/clientModuleRegistry.d.ts +2 -0
- package/es/application/utils/clientModuleRegistry.mjs +9 -0
- package/es/application/utils/globalDeps.mjs +3 -3
- package/es/block-provider/BlockProvider.d.ts +1 -27
- package/es/block-provider/BlockProvider.mjs +1 -3
- package/es/block-provider/BlockRequestContext.d.ts +27 -0
- package/es/block-provider/BlockRequestContext.mjs +5 -0
- package/es/block-provider/FormBlockContext.d.ts +32 -0
- package/es/block-provider/FormBlockContext.mjs +5 -0
- package/es/block-provider/FormBlockProvider.d.ts +1 -33
- package/es/block-provider/FormBlockProvider.mjs +4 -5
- package/es/built-in/acl/ACLCollectionFieldProvider.d.ts +1 -0
- package/es/built-in/acl/ACLCollectionFieldProvider.mjs +42 -0
- package/es/built-in/acl/ACLContext.d.ts +9 -0
- package/es/built-in/acl/ACLContext.mjs +24 -0
- package/es/built-in/acl/ACLPlugin.mjs +2 -1
- package/es/built-in/acl/ACLProvider.d.ts +0 -11
- package/es/built-in/acl/ACLProvider.mjs +6 -51
- package/es/built-in/acl/index.d.ts +2 -0
- package/es/built-in/acl/index.mjs +2 -0
- package/es/collection-manager/hooks/useCollectionManager_deprecated.mjs +2 -1
- package/es/collection-manager/sub-table.d.ts +1 -1
- package/es/data-source/data-source/DataSourceManager.d.ts +1 -2
- package/es/data-source/data-source/DataSourceManager.mjs +1 -2
- package/es/data-source/data-source/constants.d.ts +2 -0
- package/es/data-source/data-source/constants.mjs +3 -0
- package/es/data-source/utils.d.ts +2 -2
- package/es/data-source/utils.mjs +1 -1
- package/es/exports.d.ts +46 -0
- package/es/exports.mjs +46 -0
- package/es/filter-provider/utils.d.ts +2 -14
- package/es/filter-provider/utils.mjs +2 -57
- package/es/index.d.ts +1 -46
- package/es/index.mjs +4 -46
- package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.d.ts +2 -86
- package/es/record-provider/index.mjs +3 -3
- package/es/schema-component/antd/action/Action.mjs +7 -6
- package/es/schema-component/antd/action/hooks.mjs +3 -2
- package/es/schema-component/antd/association-field/AssociationSelect.mjs +4 -3
- package/es/schema-component/antd/association-field/hooks.mjs +18 -1
- package/es/schema-component/antd/cron/CronSet.mjs +9 -3
- package/es/schema-component/antd/filter/conditionUtils.d.ts +2 -0
- package/es/schema-component/antd/filter/conditionUtils.mjs +133 -0
- package/es/schema-component/antd/filter/dateValueUtils.d.ts +13 -0
- package/es/schema-component/antd/filter/dateValueUtils.mjs +66 -0
- package/es/schema-component/antd/filter/useFilterActionProps.d.ts +2 -4
- package/es/schema-component/antd/filter/useFilterActionProps.mjs +3 -181
- package/es/schema-component/antd/filter/useGetFilterOptions.d.ts +2 -0
- package/es/schema-component/antd/filter/useGetFilterOptions.mjs +54 -0
- package/es/schema-component/antd/form/Form.mjs +1 -1
- package/es/schema-component/antd/form-item/FormItem.FilterFormDesigner.mjs +1 -1
- package/es/schema-component/antd/form-item/FormItem.d.ts +1 -1
- package/es/schema-component/antd/form-item/FormItem.mjs +14 -12
- package/es/schema-component/antd/form-item/SchemaSettingOptions.d.ts +1 -14
- package/es/schema-component/antd/form-item/SchemaSettingOptions.mjs +1 -33
- package/es/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.mjs +4 -3
- package/es/schema-component/antd/form-item/hooks/useParseDefaultValue.mjs +5 -3
- package/es/schema-component/antd/form-item/operatorUtils.d.ts +14 -0
- package/es/schema-component/antd/form-item/operatorUtils.mjs +36 -0
- package/es/schema-component/antd/form-v2/Form.mjs +26 -167
- package/es/schema-component/antd/form-v2/FormLinkageRules.d.ts +9 -0
- package/es/schema-component/antd/form-v2/FormLinkageRules.mjs +191 -0
- package/es/schema-component/antd/form-v2/Templates.mjs +1 -1
- package/es/schema-component/antd/grid/Grid.mjs +6 -4
- package/es/schema-component/antd/grid-card/GridCard.Item.mjs +2 -2
- package/es/schema-component/antd/icon-picker/IconFilterInput.mjs +12 -4
- package/es/schema-component/antd/icon-picker/IconPicker.mjs +1 -1
- package/es/schema-component/antd/input/Json.d.ts +1 -4
- package/es/schema-component/antd/input/ReadPretty.mjs +2 -2
- package/es/schema-component/antd/input-number/ReadPretty.mjs +1 -1
- package/es/schema-component/antd/markdown/Markdown.Void.Designer.mjs +2 -1
- package/es/schema-component/antd/markdown/Markdown.Void.mjs +10 -2
- package/es/schema-component/antd/markdown/Markdown.mjs +1 -1
- package/es/schema-component/antd/markdown/util.mjs +5 -0
- package/es/schema-component/antd/rich-text/RichText.mjs +1 -1
- package/es/schema-component/antd/select/FormulaSelect.mjs +1 -2
- package/es/schema-component/antd/select/ReadPretty.mjs +2 -2
- package/es/schema-component/antd/select/Select.mjs +1 -2
- package/es/schema-component/antd/select/utils.d.ts +2 -1
- package/es/schema-component/antd/select/utils.mjs +2 -2
- package/es/schema-component/antd/time-picker/ReadPretty.mjs +1 -1
- package/es/schema-component/antd/upload/ReadPretty.mjs +5 -5
- package/es/schema-component/antd/upload/Upload.mjs +6 -5
- package/es/schema-component/antd/variable/Input.mjs +1 -1
- package/es/schema-component/antd/variable/TextArea.mjs +1 -1
- package/es/schema-component/hooks/useDesigner.mjs +9 -3
- package/es/schema-component/hooks/useOptionalNavigate.d.ts +1 -0
- package/es/schema-component/hooks/useOptionalNavigate.mjs +2 -0
- package/es/schema-settings/DataTemplates/components/Designer.mjs +2 -1
- package/es/schema-settings/VariableInput/hooks/useBaseVariable.mjs +2 -1
- package/es/schema-settings/VariableInput/hooks/useBlockCollection.mjs +1 -1
- package/es/schema-settings/VariableInput/hooks/useContextAssociationFields.mjs +2 -1
- package/es/schema-settings/VariableInput/hooks/useFormVariable.mjs +1 -1
- package/es/schema-settings/VariableInput/hooks/useRecordVariable.mjs +1 -1
- package/es/style/theme/AntdAppProvider.mjs +2 -2
- package/es/user/ChangePassword.d.ts +4 -1
- package/es/user/CurrentUserContext.d.ts +2 -0
- package/es/user/CurrentUserContext.mjs +5 -0
- package/es/user/CurrentUserProvider.d.ts +0 -3
- package/es/user/CurrentUserProvider.mjs +3 -5
- package/es/user/EditProfile.d.ts +4 -1
- package/es/user/LanguageSettings.d.ts +4 -1
- package/es/user/SwitchRole.d.ts +4 -1
- package/es/user/index.d.ts +1 -0
- package/es/user/index.mjs +1 -0
- package/es/variables/VariablesProvider.mjs +1 -1
- package/lib/api-client/APIClient.js +8 -5
- package/lib/application/hoc/withDynamicSchemaProps.js +3 -3
- package/lib/application/schema-initializer/hooks/index.js +4 -1
- package/lib/application/schema-settings/components/SchemaSettingsChildren.js +14 -14
- package/lib/application/utils/clientModuleRegistry.js +46 -0
- package/lib/application/utils/globalDeps.js +2 -2
- package/lib/block-provider/BlockProvider.js +6 -8
- package/lib/block-provider/BlockRequestContext.js +42 -0
- package/lib/block-provider/FormBlockContext.js +42 -0
- package/lib/block-provider/FormBlockProvider.js +13 -14
- package/lib/built-in/acl/ACLCollectionFieldProvider.js +76 -0
- package/lib/built-in/acl/ACLContext.js +70 -0
- package/lib/built-in/acl/ACLPlugin.js +2 -1
- package/lib/built-in/acl/ACLProvider.js +13 -76
- package/lib/built-in/acl/index.js +27 -9
- package/lib/collection-manager/hooks/useCollectionManager_deprecated.js +4 -3
- package/lib/data-source/data-source/DataSourceManager.js +6 -7
- package/lib/data-source/data-source/constants.js +40 -0
- package/lib/data-source/utils.js +2 -2
- package/lib/exports.js +769 -0
- package/lib/filter-provider/utils.js +7 -63
- package/lib/index.js +10 -714
- package/lib/record-provider/index.js +6 -6
- package/lib/schema-component/antd/action/Action.js +9 -8
- package/lib/schema-component/antd/action/hooks.js +3 -2
- package/lib/schema-component/antd/association-field/AssociationSelect.js +3 -2
- package/lib/schema-component/antd/association-field/hooks.js +18 -1
- package/lib/schema-component/antd/cron/CronSet.js +8 -2
- package/lib/schema-component/antd/filter/conditionUtils.js +180 -0
- package/lib/schema-component/antd/filter/dateValueUtils.js +116 -0
- package/lib/schema-component/antd/filter/useFilterActionProps.js +7 -186
- package/lib/schema-component/antd/filter/useGetFilterOptions.js +91 -0
- package/lib/schema-component/antd/form/Form.js +4 -4
- package/lib/schema-component/antd/form-item/FormItem.FilterFormDesigner.js +2 -2
- package/lib/schema-component/antd/form-item/FormItem.js +23 -20
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +6 -38
- package/lib/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.js +9 -7
- package/lib/schema-component/antd/form-item/hooks/useParseDefaultValue.js +12 -8
- package/lib/schema-component/antd/form-item/operatorUtils.js +76 -0
- package/lib/schema-component/antd/form-v2/Form.js +204 -317
- package/lib/schema-component/antd/form-v2/FormLinkageRules.js +236 -0
- package/lib/schema-component/antd/form-v2/Templates.js +2 -2
- package/lib/schema-component/antd/grid/Grid.js +11 -9
- package/lib/schema-component/antd/grid-card/GridCard.Item.js +2 -2
- package/lib/schema-component/antd/icon-picker/IconFilterInput.js +12 -4
- package/lib/schema-component/antd/icon-picker/IconPicker.js +1 -1
- package/lib/schema-component/antd/input/ReadPretty.js +10 -10
- package/lib/schema-component/antd/input-number/ReadPretty.js +1 -1
- package/lib/schema-component/antd/markdown/Markdown.Void.Designer.js +6 -5
- package/lib/schema-component/antd/markdown/Markdown.Void.js +138 -111
- package/lib/schema-component/antd/markdown/Markdown.js +2 -2
- package/lib/schema-component/antd/markdown/util.js +5 -0
- package/lib/schema-component/antd/rich-text/RichText.js +2 -2
- package/lib/schema-component/antd/select/FormulaSelect.js +1 -2
- package/lib/schema-component/antd/select/ReadPretty.js +2 -2
- package/lib/schema-component/antd/select/Select.js +1 -2
- package/lib/schema-component/antd/select/utils.js +6 -3
- package/lib/schema-component/antd/time-picker/ReadPretty.js +2 -2
- package/lib/schema-component/antd/upload/ReadPretty.js +5 -5
- package/lib/schema-component/antd/upload/Upload.js +6 -5
- package/lib/schema-component/antd/variable/Input.js +1 -1
- package/lib/schema-component/antd/variable/TextArea.js +1 -1
- package/lib/schema-component/hooks/useDesigner.js +57 -23
- package/lib/schema-component/hooks/useOptionalNavigate.js +36 -0
- package/lib/schema-settings/DataTemplates/components/Designer.js +4 -3
- package/lib/schema-settings/VariableInput/hooks/useBaseVariable.js +4 -3
- package/lib/schema-settings/VariableInput/hooks/useBlockCollection.js +2 -2
- package/lib/schema-settings/VariableInput/hooks/useContextAssociationFields.js +4 -3
- package/lib/schema-settings/VariableInput/hooks/useFormVariable.js +2 -2
- package/lib/schema-settings/VariableInput/hooks/useRecordVariable.js +2 -2
- package/lib/style/theme/AntdAppProvider.js +4 -4
- package/lib/user/CurrentUserContext.js +42 -0
- package/lib/user/CurrentUserProvider.js +6 -14
- package/lib/user/index.js +24 -12
- package/lib/variables/VariablesProvider.js +2 -2
- package/package.json +5 -4
|
@@ -24,20 +24,14 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
useACLContext: ()=>useACLContext,
|
|
28
|
-
useACLFieldWhitelist: ()=>useACLFieldWhitelist,
|
|
29
|
-
useACLRoleContext: ()=>useACLRoleContext,
|
|
30
|
-
ACLCollectionProvider: ()=>ACLCollectionProvider,
|
|
31
|
-
ACLCollectionFieldProvider: ()=>ACLCollectionFieldProvider,
|
|
32
|
-
useRoleRecheck: ()=>useRoleRecheck,
|
|
33
27
|
useRecordPkValue: ()=>useRecordPkValue,
|
|
34
28
|
useACLRolesCheck: ()=>useACLRolesCheck,
|
|
35
|
-
ACLContext: ()=>ACLContext,
|
|
36
29
|
ACLActionProvider: ()=>ACLActionProvider,
|
|
30
|
+
ACLCollectionProvider: ()=>ACLCollectionProvider,
|
|
37
31
|
ACLMenuItemProvider: ()=>ACLMenuItemProvider,
|
|
38
|
-
|
|
32
|
+
useACLRoleContext: ()=>useACLRoleContext,
|
|
39
33
|
ACLProvider: ()=>ACLProvider,
|
|
40
|
-
|
|
34
|
+
useRoleRecheck: ()=>useRoleRecheck,
|
|
41
35
|
ACLRolesCheckProvider: ()=>ACLRolesCheckProvider
|
|
42
36
|
});
|
|
43
37
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
@@ -53,11 +47,11 @@ const ResourceActionProvider_js_namespaceObject = require("../../collection-mana
|
|
|
53
47
|
const DataSourceProvider_js_namespaceObject = require("../../data-source/data-source/DataSourceProvider.js");
|
|
54
48
|
const external_record_provider_index_js_namespaceObject = require("../../record-provider/index.js");
|
|
55
49
|
const external_schema_component_index_js_namespaceObject = require("../../schema-component/index.js");
|
|
56
|
-
const
|
|
57
|
-
|
|
50
|
+
const external_ACLCollectionFieldProvider_js_namespaceObject = require("./ACLCollectionFieldProvider.js");
|
|
51
|
+
const external_ACLContext_js_namespaceObject = require("./ACLContext.js");
|
|
58
52
|
const ACLProvider = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_component_index_js_namespaceObject.SchemaComponentOptions, {
|
|
59
53
|
components: {
|
|
60
|
-
ACLCollectionFieldProvider,
|
|
54
|
+
ACLCollectionFieldProvider: external_ACLCollectionFieldProvider_js_namespaceObject.ACLCollectionFieldProvider,
|
|
61
55
|
ACLActionProvider,
|
|
62
56
|
ACLMenuItemProvider,
|
|
63
57
|
ACLCollectionProvider
|
|
@@ -92,25 +86,22 @@ const ACLRolesCheckProvider = (props)=>{
|
|
|
92
86
|
replace: true,
|
|
93
87
|
to: '/signin'
|
|
94
88
|
});
|
|
95
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ACLContext.Provider, {
|
|
89
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ACLContext_js_namespaceObject.ACLContext.Provider, {
|
|
96
90
|
value: result,
|
|
97
91
|
children: props.children
|
|
98
92
|
});
|
|
99
93
|
};
|
|
100
94
|
const useRoleRecheck = ()=>{
|
|
101
|
-
const ctx = (0, external_react_namespaceObject.useContext)(ACLContext);
|
|
95
|
+
const ctx = (0, external_react_namespaceObject.useContext)(external_ACLContext_js_namespaceObject.ACLContext);
|
|
102
96
|
const { allowAll } = useACLRoleContext();
|
|
103
97
|
return ()=>{
|
|
104
98
|
if (allowAll) return;
|
|
105
99
|
ctx.refresh();
|
|
106
100
|
};
|
|
107
101
|
};
|
|
108
|
-
const useACLContext = ()=>(0, external_react_namespaceObject.useContext)(ACLContext);
|
|
109
|
-
const ACLActionParamsContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)({});
|
|
110
|
-
ACLActionParamsContext.displayName = 'ACLActionParamsContext';
|
|
111
102
|
const useACLRolesCheck = ()=>{
|
|
112
103
|
var _ctx_data, _ctx_data1;
|
|
113
|
-
const ctx = (0, external_react_namespaceObject.useContext)(ACLContext);
|
|
104
|
+
const ctx = (0, external_react_namespaceObject.useContext)(external_ACLContext_js_namespaceObject.ACLContext);
|
|
114
105
|
const dataSourceName = (0, DataSourceProvider_js_namespaceObject.useDataSourceKey)();
|
|
115
106
|
const { dataSources: dataSourcesAcl } = (null == ctx ? void 0 : null == (_ctx_data = ctx.data) ? void 0 : _ctx_data.meta) || {};
|
|
116
107
|
const data = {
|
|
@@ -211,14 +202,13 @@ const ACLCollectionProvider = (props)=>{
|
|
|
211
202
|
if (!params) return null;
|
|
212
203
|
const [_, actionName] = actionPath.split(':');
|
|
213
204
|
params.actionName = actionName;
|
|
214
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ACLActionParamsContext.Provider, {
|
|
205
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ACLContext_js_namespaceObject.ACLActionParamsContext.Provider, {
|
|
215
206
|
value: {
|
|
216
207
|
params
|
|
217
208
|
},
|
|
218
209
|
children: props.children
|
|
219
210
|
});
|
|
220
211
|
};
|
|
221
|
-
const useACLActionParamsContext = ()=>(0, external_react_namespaceObject.useContext)(ACLActionParamsContext);
|
|
222
212
|
const useRecordPkValue = ()=>{
|
|
223
213
|
const { getPrimaryKey } = (0, external_collection_manager_index_js_namespaceObject.useCollection_deprecated)();
|
|
224
214
|
const record = (0, external_record_provider_index_js_namespaceObject.useRecord)();
|
|
@@ -250,63 +240,22 @@ const ACLActionProvider = (props)=>{
|
|
|
250
240
|
schema,
|
|
251
241
|
recordPkValue
|
|
252
242
|
});
|
|
253
|
-
if (!params) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ACLActionParamsContext.Provider, {
|
|
243
|
+
if (!params) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ACLContext_js_namespaceObject.ACLActionParamsContext.Provider, {
|
|
254
244
|
value: params,
|
|
255
245
|
children: props.children
|
|
256
246
|
});
|
|
257
247
|
if (editablePath.includes(actionPath) || editablePath.includes(null == actionPath ? void 0 : actionPath.split(':')[1])) {
|
|
258
|
-
if ('view' !== template || writableView) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ACLActionParamsContext.Provider, {
|
|
248
|
+
if ('view' !== template || writableView) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ACLContext_js_namespaceObject.ACLActionParamsContext.Provider, {
|
|
259
249
|
value: params,
|
|
260
250
|
children: props.children
|
|
261
251
|
});
|
|
262
252
|
return null;
|
|
263
253
|
}
|
|
264
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ACLActionParamsContext.Provider, {
|
|
254
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ACLContext_js_namespaceObject.ACLActionParamsContext.Provider, {
|
|
265
255
|
value: params,
|
|
266
256
|
children: props.children
|
|
267
257
|
});
|
|
268
258
|
};
|
|
269
|
-
const useACLFieldWhitelist = ()=>{
|
|
270
|
-
const params = (0, external_react_namespaceObject.useContext)(ACLActionParamsContext);
|
|
271
|
-
const whitelist = [].concat((null == params ? void 0 : params.whitelist) || []).concat((null == params ? void 0 : params.fields) || []).concat((null == params ? void 0 : params.appends) || []);
|
|
272
|
-
return {
|
|
273
|
-
whitelist,
|
|
274
|
-
schemaInWhitelist (fieldSchema, isSkip) {
|
|
275
|
-
if (isSkip) return true;
|
|
276
|
-
if (0 === whitelist.length) return true;
|
|
277
|
-
if (!fieldSchema) return true;
|
|
278
|
-
if (!fieldSchema['x-collection-field']) return true;
|
|
279
|
-
const [key1, key2] = fieldSchema['x-collection-field'].split('.');
|
|
280
|
-
return null == whitelist ? void 0 : whitelist.includes(key2 || key1);
|
|
281
|
-
}
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
const ACLCollectionFieldProvider = (props)=>{
|
|
285
|
-
const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
|
|
286
|
-
const field = (0, schema_namespaceObject.useField)();
|
|
287
|
-
const { allowAll } = useACLRoleContext();
|
|
288
|
-
const { whitelist } = useACLFieldWhitelist();
|
|
289
|
-
const [name] = fieldSchema.name.split('.');
|
|
290
|
-
const allowed = !fieldSchema['x-acl-ignore'] && whitelist.length > 0 ? whitelist.includes(name) : true;
|
|
291
|
-
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
292
|
-
if (!allowed) {
|
|
293
|
-
field.required = false;
|
|
294
|
-
field.display = 'hidden';
|
|
295
|
-
}
|
|
296
|
-
}, [
|
|
297
|
-
allowed
|
|
298
|
-
]);
|
|
299
|
-
if (allowAll) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
300
|
-
children: props.children
|
|
301
|
-
});
|
|
302
|
-
if (!fieldSchema['x-collection-field']) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
303
|
-
children: props.children
|
|
304
|
-
});
|
|
305
|
-
if (!allowed) return null;
|
|
306
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
307
|
-
children: props.children
|
|
308
|
-
});
|
|
309
|
-
};
|
|
310
259
|
const ACLMenuItemProvider = (props)=>{
|
|
311
260
|
const { allowAll, allowMenuItemIds = [], snippets } = useACLRoleContext();
|
|
312
261
|
const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
|
|
@@ -321,33 +270,21 @@ const ACLMenuItemProvider = (props)=>{
|
|
|
321
270
|
});
|
|
322
271
|
return null;
|
|
323
272
|
};
|
|
324
|
-
exports.ACLActionParamsContext = __webpack_exports__.ACLActionParamsContext;
|
|
325
273
|
exports.ACLActionProvider = __webpack_exports__.ACLActionProvider;
|
|
326
|
-
exports.ACLCollectionFieldProvider = __webpack_exports__.ACLCollectionFieldProvider;
|
|
327
274
|
exports.ACLCollectionProvider = __webpack_exports__.ACLCollectionProvider;
|
|
328
|
-
exports.ACLContext = __webpack_exports__.ACLContext;
|
|
329
275
|
exports.ACLMenuItemProvider = __webpack_exports__.ACLMenuItemProvider;
|
|
330
276
|
exports.ACLProvider = __webpack_exports__.ACLProvider;
|
|
331
277
|
exports.ACLRolesCheckProvider = __webpack_exports__.ACLRolesCheckProvider;
|
|
332
|
-
exports.useACLActionParamsContext = __webpack_exports__.useACLActionParamsContext;
|
|
333
|
-
exports.useACLContext = __webpack_exports__.useACLContext;
|
|
334
|
-
exports.useACLFieldWhitelist = __webpack_exports__.useACLFieldWhitelist;
|
|
335
278
|
exports.useACLRoleContext = __webpack_exports__.useACLRoleContext;
|
|
336
279
|
exports.useACLRolesCheck = __webpack_exports__.useACLRolesCheck;
|
|
337
280
|
exports.useRecordPkValue = __webpack_exports__.useRecordPkValue;
|
|
338
281
|
exports.useRoleRecheck = __webpack_exports__.useRoleRecheck;
|
|
339
282
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
340
|
-
"ACLActionParamsContext",
|
|
341
283
|
"ACLActionProvider",
|
|
342
|
-
"ACLCollectionFieldProvider",
|
|
343
284
|
"ACLCollectionProvider",
|
|
344
|
-
"ACLContext",
|
|
345
285
|
"ACLMenuItemProvider",
|
|
346
286
|
"ACLProvider",
|
|
347
287
|
"ACLRolesCheckProvider",
|
|
348
|
-
"useACLActionParamsContext",
|
|
349
|
-
"useACLContext",
|
|
350
|
-
"useACLFieldWhitelist",
|
|
351
288
|
"useACLRoleContext",
|
|
352
289
|
"useACLRolesCheck",
|
|
353
290
|
"useRecordPkValue",
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
+
"./ACLCollectionFieldProvider": function(module) {
|
|
4
|
+
module.exports = require("./ACLCollectionFieldProvider.js");
|
|
5
|
+
},
|
|
6
|
+
"./ACLContext": function(module) {
|
|
7
|
+
module.exports = require("./ACLContext.js");
|
|
8
|
+
},
|
|
3
9
|
"./ACLPlugin": function(module) {
|
|
4
10
|
module.exports = require("./ACLPlugin.js");
|
|
5
11
|
},
|
|
@@ -62,22 +68,34 @@ var __webpack_exports__ = {};
|
|
|
62
68
|
return _ACLProvider__WEBPACK_IMPORTED_MODULE_0__[key];
|
|
63
69
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
64
70
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
65
|
-
var
|
|
71
|
+
var _ACLContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./ACLContext");
|
|
72
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
73
|
+
for(var __WEBPACK_IMPORT_KEY__ in _ACLContext__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
74
|
+
return _ACLContext__WEBPACK_IMPORTED_MODULE_1__[key];
|
|
75
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
76
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
77
|
+
var _ACLCollectionFieldProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./ACLCollectionFieldProvider");
|
|
78
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
79
|
+
for(var __WEBPACK_IMPORT_KEY__ in _ACLCollectionFieldProvider__WEBPACK_IMPORTED_MODULE_2__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
80
|
+
return _ACLCollectionFieldProvider__WEBPACK_IMPORTED_MODULE_2__[key];
|
|
81
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
82
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
83
|
+
var _ACLShortcut__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./ACLShortcut");
|
|
66
84
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
67
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
68
|
-
return
|
|
85
|
+
for(var __WEBPACK_IMPORT_KEY__ in _ACLShortcut__WEBPACK_IMPORTED_MODULE_3__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
86
|
+
return _ACLShortcut__WEBPACK_IMPORTED_MODULE_3__[key];
|
|
69
87
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
70
88
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
71
|
-
var
|
|
89
|
+
var _Configuration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./Configuration");
|
|
72
90
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
73
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
74
|
-
return
|
|
91
|
+
for(var __WEBPACK_IMPORT_KEY__ in _Configuration__WEBPACK_IMPORTED_MODULE_4__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
92
|
+
return _Configuration__WEBPACK_IMPORTED_MODULE_4__[key];
|
|
75
93
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
76
94
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
77
|
-
var
|
|
95
|
+
var _ACLPlugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./ACLPlugin");
|
|
78
96
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
79
|
-
for(var __WEBPACK_IMPORT_KEY__ in
|
|
80
|
-
return
|
|
97
|
+
for(var __WEBPACK_IMPORT_KEY__ in _ACLPlugin__WEBPACK_IMPORTED_MODULE_5__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
98
|
+
return _ACLPlugin__WEBPACK_IMPORTED_MODULE_5__[key];
|
|
81
99
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
82
100
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
83
101
|
})();
|
|
@@ -43,14 +43,15 @@ const CollectionManagerProvider_js_namespaceObject = require("../../data-source/
|
|
|
43
43
|
const DataSourceManager_js_namespaceObject = require("../../data-source/data-source/DataSourceManager.js");
|
|
44
44
|
const DataSourceManagerProvider_js_namespaceObject = require("../../data-source/data-source/DataSourceManagerProvider.js");
|
|
45
45
|
const DataSourceProvider_js_namespaceObject = require("../../data-source/data-source/DataSourceProvider.js");
|
|
46
|
-
const
|
|
46
|
+
const useCompile_js_namespaceObject = require("../../schema-component/hooks/useCompile.js");
|
|
47
|
+
const useSchemaComponentContext_js_namespaceObject = require("../../schema-component/hooks/useSchemaComponentContext.js");
|
|
47
48
|
const useCollectionManager_deprecated = (dataSourceName)=>{
|
|
48
49
|
const dm = (0, DataSourceManagerProvider_js_namespaceObject.useDataSourceManager)();
|
|
49
50
|
const dataSource = (0, DataSourceProvider_js_namespaceObject.useDataSource)();
|
|
50
51
|
const cm = (0, CollectionManagerProvider_js_namespaceObject.useCollectionManager)();
|
|
51
52
|
const dataSourceNameValue = dataSourceName || (null == dataSource ? void 0 : dataSource.key) || void 0;
|
|
52
53
|
const [random, setRandom] = (0, external_react_namespaceObject.useState)((0, schema_namespaceObject.uid)());
|
|
53
|
-
const { refresh } = (0,
|
|
54
|
+
const { refresh } = (0, useSchemaComponentContext_js_namespaceObject.useSchemaComponentContext)();
|
|
54
55
|
const interfaces = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
55
56
|
var _dm_collectionFieldInterfaceManager;
|
|
56
57
|
return null == dm ? void 0 : null == (_dm_collectionFieldInterfaceManager = dm.collectionFieldInterfaceManager) ? void 0 : _dm_collectionFieldInterfaceManager.getFieldInterfaces().reduce((acc, cur)=>{
|
|
@@ -100,7 +101,7 @@ const useCollectionManager_deprecated = (dataSourceName)=>{
|
|
|
100
101
|
}), [
|
|
101
102
|
dm
|
|
102
103
|
]);
|
|
103
|
-
const compile = (0,
|
|
104
|
+
const compile = (0, useCompile_js_namespaceObject.useCompile)();
|
|
104
105
|
const getInheritedFields = (0, external_react_namespaceObject.useCallback)((name, customDataSource)=>{
|
|
105
106
|
var _getCm_getCollection, _getCm;
|
|
106
107
|
return (null == (_getCm = getCm(customDataSource)) ? void 0 : null == (_getCm_getCollection = _getCm.getCollection(name)) ? void 0 : _getCm_getCollection.getInheritedFields()) || [];
|
|
@@ -33,14 +33,15 @@ var __webpack_require__ = {};
|
|
|
33
33
|
var __webpack_exports__ = {};
|
|
34
34
|
__webpack_require__.r(__webpack_exports__);
|
|
35
35
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
DEFAULT_DATA_SOURCE_KEY: ()=>DEFAULT_DATA_SOURCE_KEY,
|
|
36
|
+
DEFAULT_DATA_SOURCE_KEY: ()=>external_constants_js_namespaceObject.DEFAULT_DATA_SOURCE_KEY,
|
|
37
37
|
DataSourceManager: ()=>DataSourceManager,
|
|
38
|
-
DEFAULT_DATA_SOURCE_TITLE: ()=>DEFAULT_DATA_SOURCE_TITLE
|
|
38
|
+
DEFAULT_DATA_SOURCE_TITLE: ()=>external_constants_js_namespaceObject.DEFAULT_DATA_SOURCE_TITLE
|
|
39
39
|
});
|
|
40
40
|
const external_lodash_namespaceObject = require("lodash");
|
|
41
41
|
var external_lodash_default = /*#__PURE__*/ __webpack_require__.n(external_lodash_namespaceObject);
|
|
42
42
|
const index_js_namespaceObject = require("../collection-field-interface/index.js");
|
|
43
43
|
const external_collection_template_index_js_namespaceObject = require("../collection-template/index.js");
|
|
44
|
+
const external_constants_js_namespaceObject = require("./constants.js");
|
|
44
45
|
const external_DataSource_js_namespaceObject = require("./DataSource.js");
|
|
45
46
|
function _define_property(obj, key, value) {
|
|
46
47
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
@@ -52,8 +53,6 @@ function _define_property(obj, key, value) {
|
|
|
52
53
|
else obj[key] = value;
|
|
53
54
|
return obj;
|
|
54
55
|
}
|
|
55
|
-
const DEFAULT_DATA_SOURCE_KEY = 'main';
|
|
56
|
-
const DEFAULT_DATA_SOURCE_TITLE = '{{t("Main")}}';
|
|
57
56
|
class DataSourceManager {
|
|
58
57
|
addCollectionMixins() {
|
|
59
58
|
let mixins = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
|
|
@@ -67,7 +66,7 @@ class DataSourceManager {
|
|
|
67
66
|
return filterCollection ? external_lodash_default().filter(allDataSources, filterCollection) : allDataSources;
|
|
68
67
|
}
|
|
69
68
|
getDataSource(key) {
|
|
70
|
-
return key ? this.dataSourceInstancesMap[key] : this.dataSourceInstancesMap[DEFAULT_DATA_SOURCE_KEY];
|
|
69
|
+
return key ? this.dataSourceInstancesMap[key] : this.dataSourceInstancesMap[external_constants_js_namespaceObject.DEFAULT_DATA_SOURCE_KEY];
|
|
71
70
|
}
|
|
72
71
|
removeDataSources(keys) {
|
|
73
72
|
keys.forEach((key)=>{
|
|
@@ -136,8 +135,8 @@ class DataSourceManager {
|
|
|
136
135
|
this.collectionFieldInterfaceManager = new index_js_namespaceObject.CollectionFieldInterfaceManager(options.fieldInterfaces, options.fieldInterfaceGroups, this);
|
|
137
136
|
this.collectionMixins.push(...options.collectionMixins || []);
|
|
138
137
|
this.addDataSource(external_DataSource_js_namespaceObject.LocalDataSource, {
|
|
139
|
-
key: DEFAULT_DATA_SOURCE_KEY,
|
|
140
|
-
displayName: DEFAULT_DATA_SOURCE_TITLE,
|
|
138
|
+
key: external_constants_js_namespaceObject.DEFAULT_DATA_SOURCE_KEY,
|
|
139
|
+
displayName: external_constants_js_namespaceObject.DEFAULT_DATA_SOURCE_TITLE,
|
|
141
140
|
collections: options.collections || []
|
|
142
141
|
});
|
|
143
142
|
(options.dataSources || []).forEach((dataSourceOptions)=>{
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
DEFAULT_DATA_SOURCE_KEY: ()=>DEFAULT_DATA_SOURCE_KEY,
|
|
28
|
+
DEFAULT_DATA_SOURCE_TITLE: ()=>DEFAULT_DATA_SOURCE_TITLE
|
|
29
|
+
});
|
|
30
|
+
const DEFAULT_DATA_SOURCE_KEY = 'main';
|
|
31
|
+
const DEFAULT_DATA_SOURCE_TITLE = '{{t("Main")}}';
|
|
32
|
+
exports.DEFAULT_DATA_SOURCE_KEY = __webpack_exports__.DEFAULT_DATA_SOURCE_KEY;
|
|
33
|
+
exports.DEFAULT_DATA_SOURCE_TITLE = __webpack_exports__.DEFAULT_DATA_SOURCE_TITLE;
|
|
34
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
35
|
+
"DEFAULT_DATA_SOURCE_KEY",
|
|
36
|
+
"DEFAULT_DATA_SOURCE_TITLE"
|
|
37
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
38
|
+
Object.defineProperty(exports, '__esModule', {
|
|
39
|
+
value: true
|
|
40
|
+
});
|
package/lib/data-source/utils.js
CHANGED
|
@@ -28,14 +28,14 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
useDataSourceHeaders: ()=>useDataSourceHeaders
|
|
29
29
|
});
|
|
30
30
|
const external_react_namespaceObject = require("react");
|
|
31
|
-
const
|
|
31
|
+
const constants_js_namespaceObject = require("./data-source/constants.js");
|
|
32
32
|
const isTitleField = (dm, field)=>{
|
|
33
33
|
var _dm_collectionFieldInterfaceManager_getFieldInterface;
|
|
34
34
|
return !field.isForeignKey && (null == (_dm_collectionFieldInterfaceManager_getFieldInterface = dm.collectionFieldInterfaceManager.getFieldInterface(field.interface)) ? void 0 : _dm_collectionFieldInterfaceManager_getFieldInterface.titleUsable);
|
|
35
35
|
};
|
|
36
36
|
const useDataSourceHeaders = (dataSource)=>{
|
|
37
37
|
const headers = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
38
|
-
if (dataSource && dataSource !==
|
|
38
|
+
if (dataSource && dataSource !== constants_js_namespaceObject.DEFAULT_DATA_SOURCE_KEY) return {
|
|
39
39
|
'x-data-source': dataSource
|
|
40
40
|
};
|
|
41
41
|
}, [
|