@nocobase/client 0.7.6-alpha.2 → 0.8.0-alpha.4
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/acl/ACLShortcut.d.ts +2 -0
- package/es/acl/ACLShortcut.js +31 -2
- package/es/api-client/APIClient.d.ts +1 -0
- package/es/api-client/APIClient.js +6 -1
- package/es/application/Application.d.ts +3 -1
- package/es/application/Application.js +131 -39
- package/es/block-provider/BlockProvider.js +12 -1
- package/es/block-provider/CalendarBlockProvider.d.ts +1 -0
- package/es/block-provider/CalendarBlockProvider.js +6 -3
- package/es/block-provider/TableSelectorProvider.js +21 -6
- package/es/block-provider/hooks/index.d.ts +6 -0
- package/es/block-provider/hooks/index.js +485 -115
- package/es/collection-manager/CollectionManagerProvider.js +26 -45
- package/es/collection-manager/CollectionManagerShortcut.d.ts +2 -0
- package/es/collection-manager/CollectionManagerShortcut.js +38 -3
- package/es/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
- package/es/collection-manager/Configuration/AddFieldAction.js +44 -13
- package/es/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
- package/es/collection-manager/Configuration/EditFieldAction.js +24 -11
- package/es/collection-manager/Configuration/index.d.ts +2 -0
- package/es/collection-manager/Configuration/index.js +2 -0
- package/es/collection-manager/Configuration/schemas/collectionFields.js +2 -2
- package/es/collection-manager/index.d.ts +1 -0
- package/es/collection-manager/index.js +2 -1
- package/es/collection-manager/interfaces/index.d.ts +1 -0
- package/es/collection-manager/interfaces/index.js +1 -0
- package/es/collection-manager/interfaces/json.d.ts +2 -0
- package/es/collection-manager/interfaces/json.js +48 -0
- package/es/collection-manager/interfaces/m2o.js +3 -3
- package/es/collection-manager/interfaces/o2m.js +5 -6
- package/es/collection-manager/interfaces/o2o.js +5 -5
- package/es/collection-manager/interfaces/properties/index.d.ts +14 -0
- package/es/collection-manager/interfaces/properties/index.js +23 -0
- package/es/collection-manager/interfaces/sequence.js +13 -9
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locale/en_US.d.ts +14 -1
- package/es/locale/en_US.js +15 -2
- package/es/locale/ja_JP.d.ts +2 -1
- package/es/locale/ja_JP.js +2 -1
- package/es/locale/ru_RU.d.ts +2 -1
- package/es/locale/ru_RU.js +2 -1
- package/es/locale/tr_TR.d.ts +1 -1
- package/es/locale/tr_TR.js +1 -1
- package/es/locale/zh_CN.d.ts +40 -1
- package/es/locale/zh_CN.js +41 -2
- package/es/plugin-manager/PluginManager.js +35 -23
- package/es/pm/PluginManagerLink.d.ts +2 -0
- package/es/pm/PluginManagerLink.js +111 -0
- package/es/pm/index.d.ts +4 -0
- package/es/pm/index.js +422 -0
- package/es/route-switch/antd/admin-layout/index.js +1 -1
- package/es/schema-component/antd/action/Action.Designer.js +35 -12
- package/es/schema-component/antd/action/Action.Modal.js +4 -2
- package/es/schema-component/antd/action/Action.js +3 -3
- package/es/schema-component/antd/action/context.d.ts +2 -0
- package/es/schema-component/antd/action/hooks.d.ts +1 -0
- package/es/schema-component/antd/calendar/Calendar.Designer.js +19 -6
- package/es/schema-component/antd/calendar/Calendar.js +23 -2
- package/es/schema-component/antd/calendar/Title.js +18 -3
- package/es/schema-component/antd/calendar/components/Header.d.ts +10 -0
- package/es/schema-component/antd/calendar/components/Header.js +43 -0
- package/es/schema-component/antd/calendar/style.less +53 -9
- package/es/schema-component/antd/calendar/types.d.ts +6 -0
- package/es/schema-component/antd/calendar/utils.d.ts +2 -0
- package/es/schema-component/antd/calendar/utils.js +7 -0
- package/es/schema-component/antd/checkbox/Checkbox.js +13 -4
- package/es/schema-component/antd/formula-input/FormulaInput.js +28 -37
- package/es/schema-component/antd/input/Input.d.ts +1 -0
- package/es/schema-component/antd/input/Input.js +2 -0
- package/es/schema-component/antd/input/Json.d.ts +6 -0
- package/es/schema-component/antd/input/Json.js +41 -0
- package/es/schema-component/antd/input/ReadPretty.d.ts +3 -0
- package/es/schema-component/antd/input/ReadPretty.js +15 -0
- package/es/schema-component/antd/input/index.d.ts +1 -0
- package/es/schema-component/antd/input/index.js +2 -1
- package/es/schema-component/antd/markdown/Markdown.Void.js +5 -2
- package/es/schema-component/antd/radio/Radio.js +2 -1
- package/es/schema-component/antd/select/ReadPretty.js +2 -1
- package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +16 -2
- package/es/schema-component/antd/upload/Upload.js +2 -1
- package/es/schema-component/antd/upload/shared.js +5 -6
- package/es/schema-component/antd/upload/type.d.ts +2 -0
- package/es/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +50 -0
- package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +35 -0
- package/es/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
- package/es/schema-initializer/buttons/FormActionInitializers.js +118 -0
- package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/TabPaneInitializers.js +13 -0
- package/es/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
- package/es/schema-initializer/buttons/TableActionInitializers.js +45 -0
- package/es/schema-initializer/buttons/index.d.ts +2 -0
- package/es/schema-initializer/buttons/index.js +2 -0
- package/es/schema-initializer/components/BulkEditField.d.ts +7 -0
- package/es/schema-initializer/components/BulkEditField.js +187 -0
- package/es/schema-initializer/components/index.d.ts +1 -0
- package/es/schema-initializer/components/index.js +2 -1
- package/es/schema-initializer/items/BlockInitializer.js +8 -8
- package/es/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/BulkEditSubmitActionInitializer.js +24 -0
- package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +103 -0
- package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.js +61 -0
- package/es/schema-initializer/items/index.d.ts +3 -0
- package/es/schema-initializer/items/index.js +3 -0
- package/es/schema-initializer/utils.d.ts +1 -0
- package/es/schema-initializer/utils.js +67 -12
- package/es/schema-settings/SchemaSettings.d.ts +6 -0
- package/es/schema-settings/SchemaSettings.js +4 -1
- package/es/schema-templates/BlockTemplatePage.d.ts +1 -0
- package/es/schema-templates/BlockTemplatePage.js +7 -0
- package/es/schema-templates/SchemaTemplateShortcut.js +1 -1
- package/es/system-settings/SystemSettingsShortcut.d.ts +2 -0
- package/es/system-settings/SystemSettingsShortcut.js +134 -5
- package/lib/acl/ACLShortcut.d.ts +2 -0
- package/lib/acl/ACLShortcut.js +41 -4
- package/lib/api-client/APIClient.d.ts +1 -0
- package/lib/api-client/APIClient.js +6 -1
- package/lib/application/Application.d.ts +3 -1
- package/lib/application/Application.js +139 -39
- package/lib/block-provider/BlockProvider.js +11 -0
- package/lib/block-provider/CalendarBlockProvider.d.ts +1 -0
- package/lib/block-provider/CalendarBlockProvider.js +6 -3
- package/lib/block-provider/TableSelectorProvider.js +21 -6
- package/lib/block-provider/hooks/index.d.ts +6 -0
- package/lib/block-provider/hooks/index.js +496 -115
- package/lib/collection-manager/CollectionManagerProvider.js +28 -47
- package/lib/collection-manager/CollectionManagerShortcut.d.ts +2 -0
- package/lib/collection-manager/CollectionManagerShortcut.js +47 -4
- package/lib/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
- package/lib/collection-manager/Configuration/AddFieldAction.js +48 -12
- package/lib/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
- package/lib/collection-manager/Configuration/EditFieldAction.js +26 -10
- package/lib/collection-manager/Configuration/index.d.ts +2 -0
- package/lib/collection-manager/Configuration/index.js +26 -0
- package/lib/collection-manager/Configuration/schemas/collectionFields.js +2 -2
- package/lib/collection-manager/index.d.ts +1 -0
- package/lib/collection-manager/index.js +14 -0
- package/lib/collection-manager/interfaces/index.d.ts +1 -0
- package/lib/collection-manager/interfaces/index.js +13 -0
- package/lib/collection-manager/interfaces/json.d.ts +2 -0
- package/lib/collection-manager/interfaces/json.js +58 -0
- package/lib/collection-manager/interfaces/m2o.js +2 -2
- package/lib/collection-manager/interfaces/o2m.js +4 -5
- package/lib/collection-manager/interfaces/o2o.js +4 -4
- package/lib/collection-manager/interfaces/properties/index.d.ts +14 -0
- package/lib/collection-manager/interfaces/properties/index.js +25 -1
- package/lib/collection-manager/interfaces/sequence.js +13 -9
- package/lib/index.d.ts +1 -0
- package/lib/index.js +13 -0
- package/lib/locale/en_US.d.ts +14 -1
- package/lib/locale/en_US.js +15 -2
- package/lib/locale/ja_JP.d.ts +2 -1
- package/lib/locale/ja_JP.js +2 -1
- package/lib/locale/ru_RU.d.ts +2 -1
- package/lib/locale/ru_RU.js +2 -1
- package/lib/locale/tr_TR.d.ts +1 -1
- package/lib/locale/tr_TR.js +1 -1
- package/lib/locale/zh_CN.d.ts +40 -1
- package/lib/locale/zh_CN.js +41 -2
- package/lib/plugin-manager/PluginManager.js +33 -21
- package/lib/pm/PluginManagerLink.d.ts +2 -0
- package/lib/pm/PluginManagerLink.js +138 -0
- package/lib/pm/index.d.ts +4 -0
- package/lib/pm/index.js +474 -0
- package/lib/route-switch/antd/admin-layout/index.js +1 -1
- package/lib/schema-component/antd/action/Action.Designer.js +35 -12
- package/lib/schema-component/antd/action/Action.Modal.js +4 -2
- package/lib/schema-component/antd/action/Action.js +3 -3
- package/lib/schema-component/antd/action/context.d.ts +2 -0
- package/lib/schema-component/antd/action/hooks.d.ts +1 -0
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +19 -6
- package/lib/schema-component/antd/calendar/Calendar.js +24 -2
- package/lib/schema-component/antd/calendar/Title.js +18 -2
- package/lib/schema-component/antd/calendar/components/Header.d.ts +10 -0
- package/lib/schema-component/antd/calendar/components/Header.js +57 -0
- package/lib/schema-component/antd/calendar/style.less +53 -9
- package/lib/schema-component/antd/calendar/types.d.ts +6 -0
- package/lib/schema-component/antd/calendar/utils.d.ts +2 -0
- package/lib/schema-component/antd/calendar/utils.js +18 -2
- package/lib/schema-component/antd/checkbox/Checkbox.js +13 -4
- package/lib/schema-component/antd/formula-input/FormulaInput.js +28 -37
- package/lib/schema-component/antd/input/Input.d.ts +1 -0
- package/lib/schema-component/antd/input/Input.js +3 -0
- package/lib/schema-component/antd/input/Json.d.ts +6 -0
- package/lib/schema-component/antd/input/Json.js +53 -0
- package/lib/schema-component/antd/input/ReadPretty.d.ts +3 -0
- package/lib/schema-component/antd/input/ReadPretty.js +16 -0
- package/lib/schema-component/antd/input/index.d.ts +1 -0
- package/lib/schema-component/antd/input/index.js +13 -0
- package/lib/schema-component/antd/markdown/Markdown.Void.js +8 -2
- package/lib/schema-component/antd/radio/Radio.js +2 -1
- package/lib/schema-component/antd/select/ReadPretty.js +2 -1
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +17 -2
- package/lib/schema-component/antd/upload/Upload.js +2 -1
- package/lib/schema-component/antd/upload/shared.js +4 -5
- package/lib/schema-component/antd/upload/type.d.ts +2 -0
- package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +66 -0
- package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +50 -0
- package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
- package/lib/schema-initializer/buttons/FormActionInitializers.js +121 -2
- package/lib/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +18 -2
- package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
- package/lib/schema-initializer/buttons/TableActionInitializers.js +45 -0
- package/lib/schema-initializer/buttons/index.d.ts +2 -0
- package/lib/schema-initializer/buttons/index.js +26 -0
- package/lib/schema-initializer/components/BulkEditField.d.ts +7 -0
- package/lib/schema-initializer/components/BulkEditField.js +210 -0
- package/lib/schema-initializer/components/index.d.ts +1 -0
- package/lib/schema-initializer/components/index.js +13 -0
- package/lib/schema-initializer/items/BlockInitializer.js +8 -7
- package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.js +37 -0
- package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +121 -0
- package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.js +74 -0
- package/lib/schema-initializer/items/index.d.ts +3 -0
- package/lib/schema-initializer/items/index.js +39 -0
- package/lib/schema-initializer/utils.d.ts +1 -0
- package/lib/schema-initializer/utils.js +71 -13
- package/lib/schema-settings/SchemaSettings.d.ts +6 -0
- package/lib/schema-settings/SchemaSettings.js +3 -0
- package/lib/schema-templates/BlockTemplatePage.d.ts +1 -0
- package/lib/schema-templates/BlockTemplatePage.js +12 -2
- package/lib/schema-templates/SchemaTemplateShortcut.js +1 -1
- package/lib/system-settings/SystemSettingsShortcut.d.ts +2 -0
- package/lib/system-settings/SystemSettingsShortcut.js +145 -7
- package/package.json +5 -4
package/es/acl/ACLShortcut.d.ts
CHANGED
package/es/acl/ACLShortcut.js
CHANGED
|
@@ -14,8 +14,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
14
14
|
|
|
15
15
|
import { LockOutlined } from '@ant-design/icons';
|
|
16
16
|
import { uid } from '@formily/shared';
|
|
17
|
+
import { Card } from 'antd';
|
|
17
18
|
import React, { useState } from 'react';
|
|
18
19
|
import { useTranslation } from 'react-i18next';
|
|
20
|
+
import { useHistory } from 'react-router-dom';
|
|
19
21
|
import { PluginManager } from '../plugin-manager';
|
|
20
22
|
import { ActionContext, SchemaComponent } from '../schema-component';
|
|
21
23
|
import * as components from './Configuration';
|
|
@@ -33,14 +35,41 @@ var schema = {
|
|
|
33
35
|
}
|
|
34
36
|
})
|
|
35
37
|
};
|
|
38
|
+
var schema2 = {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: _defineProperty({}, uid(), {
|
|
41
|
+
'x-component': 'RoleTable'
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
export var ACLPane = function ACLPane() {
|
|
45
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
46
|
+
bordered: false
|
|
47
|
+
}, /*#__PURE__*/React.createElement(SchemaComponent, {
|
|
48
|
+
components: components,
|
|
49
|
+
schema: schema2
|
|
50
|
+
}));
|
|
51
|
+
};
|
|
36
52
|
export var ACLShortcut = function ACLShortcut() {
|
|
53
|
+
var _useTranslation = useTranslation(),
|
|
54
|
+
t = _useTranslation.t;
|
|
55
|
+
|
|
56
|
+
var history = useHistory();
|
|
57
|
+
return /*#__PURE__*/React.createElement(PluginManager.Toolbar.Item, {
|
|
58
|
+
icon: /*#__PURE__*/React.createElement(LockOutlined, null),
|
|
59
|
+
title: t('Roles & Permissions'),
|
|
60
|
+
onClick: function onClick() {
|
|
61
|
+
history.push('/admin/settings/acl/roles');
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export var ACLShortcut2 = function ACLShortcut2() {
|
|
37
66
|
var _useState = useState(false),
|
|
38
67
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
68
|
visible = _useState2[0],
|
|
40
69
|
setVisible = _useState2[1];
|
|
41
70
|
|
|
42
|
-
var
|
|
43
|
-
t =
|
|
71
|
+
var _useTranslation2 = useTranslation(),
|
|
72
|
+
t = _useTranslation2.t;
|
|
44
73
|
|
|
45
74
|
return /*#__PURE__*/React.createElement(ActionContext.Provider, {
|
|
46
75
|
value: {
|
|
@@ -2,6 +2,7 @@ import { APIClient as APIClientSDK } from '@nocobase/sdk';
|
|
|
2
2
|
import { Result } from 'ahooks/lib/useRequest/src/types';
|
|
3
3
|
export declare class APIClient extends APIClientSDK {
|
|
4
4
|
services: Record<string, Result<any, any>>;
|
|
5
|
+
service(uid: string): Result<any, any>;
|
|
5
6
|
interceptors(): void;
|
|
6
7
|
notification(): void;
|
|
7
8
|
}
|
|
@@ -42,11 +42,16 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
45
|
-
_this.services =
|
|
45
|
+
_this.services = {};
|
|
46
46
|
return _this;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
_createClass(APIClient, [{
|
|
50
|
+
key: "service",
|
|
51
|
+
value: function service(uid) {
|
|
52
|
+
return this.services[uid];
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
50
55
|
key: "interceptors",
|
|
51
56
|
value: function interceptors() {
|
|
52
57
|
_get(_getPrototypeOf(APIClient.prototype), "interceptors", this).call(this);
|
|
@@ -4,6 +4,7 @@ export interface ApplicationOptions {
|
|
|
4
4
|
apiClient?: any;
|
|
5
5
|
i18n?: any;
|
|
6
6
|
plugins?: any[];
|
|
7
|
+
dynamicImport?: any;
|
|
7
8
|
}
|
|
8
9
|
export declare const getCurrentTimezone: () => string;
|
|
9
10
|
export declare type PluginCallback = () => Promise<any>;
|
|
@@ -13,6 +14,7 @@ export declare class Application {
|
|
|
13
14
|
apiClient: APIClient;
|
|
14
15
|
i18n: i18next;
|
|
15
16
|
plugins: PluginCallback[];
|
|
17
|
+
options: ApplicationOptions;
|
|
16
18
|
constructor(options: ApplicationOptions);
|
|
17
19
|
use(component: any, props?: any): void;
|
|
18
20
|
main(mainComponent: any): void;
|
|
@@ -20,5 +22,5 @@ export declare class Application {
|
|
|
20
22
|
* TODO
|
|
21
23
|
*/
|
|
22
24
|
plugin(plugin: PluginCallback): void;
|
|
23
|
-
render(): (props
|
|
25
|
+
render(): (props: any) => JSX.Element;
|
|
24
26
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8
6
|
|
|
9
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
8
|
|
|
@@ -14,12 +12,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
14
12
|
|
|
15
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
14
|
|
|
17
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
18
|
-
|
|
19
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
20
|
-
|
|
21
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
22
|
-
|
|
23
15
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
16
|
|
|
25
17
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -32,7 +24,20 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
32
24
|
|
|
33
25
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
34
26
|
|
|
35
|
-
|
|
27
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
28
|
+
|
|
29
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
30
|
+
|
|
31
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
32
|
+
|
|
33
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
34
|
+
|
|
35
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
36
|
+
|
|
37
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
38
|
+
|
|
39
|
+
import { Spin } from 'antd';
|
|
40
|
+
import React, { useEffect, useState } from 'react';
|
|
36
41
|
import { I18nextProvider } from 'react-i18next';
|
|
37
42
|
import { Link, NavLink } from 'react-router-dom';
|
|
38
43
|
import { ACLProvider, ACLShortcut } from '../acl';
|
|
@@ -43,6 +48,7 @@ import { CollectionManagerShortcut } from '../collection-manager';
|
|
|
43
48
|
import { RemoteDocumentTitleProvider } from '../document-title';
|
|
44
49
|
import { i18n } from '../i18n';
|
|
45
50
|
import { PluginManagerProvider } from '../plugin-manager';
|
|
51
|
+
import PMProvider, { PluginManagerLink, SettingsCenterDropdown } from '../pm';
|
|
46
52
|
import { AdminLayout, AuthLayout, RemoteRouteSwitchProvider, RouteSchemaComponent, RouteSwitch, useRoutes } from '../route-switch';
|
|
47
53
|
import { AntdSchemaComponentProvider, DesignableSwitch, MenuItemInitializers, SchemaComponentProvider } from '../schema-component';
|
|
48
54
|
import { SchemaInitializerProvider } from '../schema-initializer';
|
|
@@ -55,6 +61,15 @@ export var getCurrentTimezone = function getCurrentTimezone() {
|
|
|
55
61
|
var timezone = String(timezoneOffset).padStart(2, '0') + ':00';
|
|
56
62
|
return (timezoneOffset > 0 ? '+' : '-') + timezone;
|
|
57
63
|
};
|
|
64
|
+
var App = /*#__PURE__*/React.memo(function (props) {
|
|
65
|
+
var C = compose.apply(void 0, _toConsumableArray(props.providers))(function () {
|
|
66
|
+
var routes = useRoutes();
|
|
67
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(RouteSwitch, {
|
|
68
|
+
routes: routes
|
|
69
|
+
}));
|
|
70
|
+
});
|
|
71
|
+
return /*#__PURE__*/React.createElement(C, null);
|
|
72
|
+
});
|
|
58
73
|
export var Application = /*#__PURE__*/function () {
|
|
59
74
|
function Application(options) {
|
|
60
75
|
var _window, _window$location;
|
|
@@ -66,6 +81,8 @@ export var Application = /*#__PURE__*/function () {
|
|
|
66
81
|
this.apiClient = void 0;
|
|
67
82
|
this.i18n = void 0;
|
|
68
83
|
this.plugins = [];
|
|
84
|
+
this.options = void 0;
|
|
85
|
+
this.options = options;
|
|
69
86
|
this.apiClient = new APIClient(_objectSpread({
|
|
70
87
|
baseURL: process.env.API_BASE_URL,
|
|
71
88
|
headers: {
|
|
@@ -101,7 +118,9 @@ export var Application = /*#__PURE__*/function () {
|
|
|
101
118
|
DesignableSwitch: DesignableSwitch,
|
|
102
119
|
CollectionManagerShortcut: CollectionManagerShortcut,
|
|
103
120
|
SystemSettingsShortcut: SystemSettingsShortcut,
|
|
104
|
-
SchemaTemplateShortcut: SchemaTemplateShortcut
|
|
121
|
+
SchemaTemplateShortcut: SchemaTemplateShortcut,
|
|
122
|
+
PluginManagerLink: PluginManagerLink,
|
|
123
|
+
SettingsCenterDropdown: SettingsCenterDropdown
|
|
105
124
|
}
|
|
106
125
|
});
|
|
107
126
|
this.use(SchemaComponentProvider, {
|
|
@@ -119,26 +138,7 @@ export var Application = /*#__PURE__*/function () {
|
|
|
119
138
|
this.use(AntdSchemaComponentProvider);
|
|
120
139
|
this.use(ACLProvider);
|
|
121
140
|
this.use(RemoteDocumentTitleProvider);
|
|
122
|
-
|
|
123
|
-
var _iterator = _createForOfIteratorHelper(options.plugins),
|
|
124
|
-
_step;
|
|
125
|
-
|
|
126
|
-
try {
|
|
127
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
128
|
-
var plugin = _step.value;
|
|
129
|
-
|
|
130
|
-
var _ref = Array.isArray(plugin) ? plugin : [plugin],
|
|
131
|
-
_ref2 = _slicedToArray(_ref, 2),
|
|
132
|
-
component = _ref2[0],
|
|
133
|
-
props = _ref2[1];
|
|
134
|
-
|
|
135
|
-
this.use(component, props);
|
|
136
|
-
}
|
|
137
|
-
} catch (err) {
|
|
138
|
-
_iterator.e(err);
|
|
139
|
-
} finally {
|
|
140
|
-
_iterator.f();
|
|
141
|
-
}
|
|
141
|
+
this.use(PMProvider);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
_createClass(Application, [{
|
|
@@ -163,12 +163,104 @@ export var Application = /*#__PURE__*/function () {
|
|
|
163
163
|
}, {
|
|
164
164
|
key: "render",
|
|
165
165
|
value: function render() {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
var _this = this;
|
|
167
|
+
|
|
168
|
+
return function (props) {
|
|
169
|
+
var _this$options = _this.options,
|
|
170
|
+
_this$options$plugins = _this$options.plugins,
|
|
171
|
+
plugins = _this$options$plugins === void 0 ? [] : _this$options$plugins,
|
|
172
|
+
dynamicImport = _this$options.dynamicImport;
|
|
173
|
+
|
|
174
|
+
var _useState = useState(false),
|
|
175
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
176
|
+
loading = _useState2[0],
|
|
177
|
+
setLoading = _useState2[1];
|
|
178
|
+
|
|
179
|
+
useEffect(function () {
|
|
180
|
+
setLoading(true);
|
|
181
|
+
|
|
182
|
+
_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
183
|
+
var _res$data;
|
|
184
|
+
|
|
185
|
+
var res, _iterator, _step, plugin, pluginModule;
|
|
186
|
+
|
|
187
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
188
|
+
while (1) {
|
|
189
|
+
switch (_context.prev = _context.next) {
|
|
190
|
+
case 0:
|
|
191
|
+
_context.next = 2;
|
|
192
|
+
return _this.apiClient.request({
|
|
193
|
+
url: 'app:getPlugins'
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
case 2:
|
|
197
|
+
res = _context.sent;
|
|
198
|
+
|
|
199
|
+
if (Array.isArray((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.data)) {
|
|
200
|
+
plugins.push.apply(plugins, _toConsumableArray(res.data.data));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
_iterator = _createForOfIteratorHelper(plugins);
|
|
204
|
+
_context.prev = 5;
|
|
205
|
+
|
|
206
|
+
_iterator.s();
|
|
207
|
+
|
|
208
|
+
case 7:
|
|
209
|
+
if ((_step = _iterator.n()).done) {
|
|
210
|
+
_context.next = 15;
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
plugin = _step.value;
|
|
215
|
+
_context.next = 11;
|
|
216
|
+
return dynamicImport(plugin);
|
|
217
|
+
|
|
218
|
+
case 11:
|
|
219
|
+
pluginModule = _context.sent;
|
|
220
|
+
|
|
221
|
+
_this.use(pluginModule.default);
|
|
222
|
+
|
|
223
|
+
case 13:
|
|
224
|
+
_context.next = 7;
|
|
225
|
+
break;
|
|
226
|
+
|
|
227
|
+
case 15:
|
|
228
|
+
_context.next = 20;
|
|
229
|
+
break;
|
|
230
|
+
|
|
231
|
+
case 17:
|
|
232
|
+
_context.prev = 17;
|
|
233
|
+
_context.t0 = _context["catch"](5);
|
|
234
|
+
|
|
235
|
+
_iterator.e(_context.t0);
|
|
236
|
+
|
|
237
|
+
case 20:
|
|
238
|
+
_context.prev = 20;
|
|
239
|
+
|
|
240
|
+
_iterator.f();
|
|
241
|
+
|
|
242
|
+
return _context.finish(20);
|
|
243
|
+
|
|
244
|
+
case 23:
|
|
245
|
+
setLoading(false);
|
|
246
|
+
|
|
247
|
+
case 24:
|
|
248
|
+
case "end":
|
|
249
|
+
return _context.stop();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}, _callee, null, [[5, 17, 20, 23]]);
|
|
253
|
+
}))();
|
|
254
|
+
}, []);
|
|
255
|
+
|
|
256
|
+
if (loading) {
|
|
257
|
+
return /*#__PURE__*/React.createElement(Spin, null);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return /*#__PURE__*/React.createElement(App, {
|
|
261
|
+
providers: _this.providers
|
|
262
|
+
});
|
|
263
|
+
};
|
|
172
264
|
}
|
|
173
265
|
}]);
|
|
174
266
|
|
|
@@ -10,7 +10,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
10
10
|
|
|
11
11
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
12
|
|
|
13
|
-
import { useField } from '@formily/react';
|
|
13
|
+
import { useField, useFieldSchema } from '@formily/react';
|
|
14
14
|
import { useRequest } from 'ahooks';
|
|
15
15
|
import template from 'lodash/template';
|
|
16
16
|
import React, { createContext, useContext } from 'react';
|
|
@@ -97,6 +97,8 @@ export var useResourceAction = function useResourceAction(props) {
|
|
|
97
97
|
return field.name;
|
|
98
98
|
});
|
|
99
99
|
var params = useActionParams(props);
|
|
100
|
+
var api = useAPIClient();
|
|
101
|
+
var fieldSchema = useFieldSchema();
|
|
100
102
|
|
|
101
103
|
if (!Object.keys(params).includes('appends') && (appends === null || appends === void 0 ? void 0 : appends.length)) {
|
|
102
104
|
params['appends'] = appends;
|
|
@@ -117,6 +119,15 @@ export var useResourceAction = function useResourceAction(props) {
|
|
|
117
119
|
return res.data;
|
|
118
120
|
});
|
|
119
121
|
}, _objectSpread(_objectSpread({}, opts), {}, {
|
|
122
|
+
onSuccess: function onSuccess(data, params) {
|
|
123
|
+
var _opts$onSuccess;
|
|
124
|
+
|
|
125
|
+
opts === null || opts === void 0 ? void 0 : (_opts$onSuccess = opts['onSuccess']) === null || _opts$onSuccess === void 0 ? void 0 : _opts$onSuccess.call(opts, data, params);
|
|
126
|
+
|
|
127
|
+
if (fieldSchema['x-uid']) {
|
|
128
|
+
api.services[fieldSchema['x-uid']] = result;
|
|
129
|
+
}
|
|
130
|
+
},
|
|
120
131
|
defaultParams: [params],
|
|
121
132
|
refreshDeps: [JSON.stringify(params.appends)]
|
|
122
133
|
}));
|
|
@@ -11,7 +11,8 @@ import { BlockProvider, useBlockRequestContext } from './BlockProvider';
|
|
|
11
11
|
export var CalendarBlockContext = /*#__PURE__*/createContext({});
|
|
12
12
|
|
|
13
13
|
var InternalCalendarBlockProvider = function InternalCalendarBlockProvider(props) {
|
|
14
|
-
var fieldNames = props.fieldNames
|
|
14
|
+
var fieldNames = props.fieldNames,
|
|
15
|
+
showLunar = props.showLunar;
|
|
15
16
|
var field = useField();
|
|
16
17
|
|
|
17
18
|
var _useBlockRequestConte = useBlockRequestContext(),
|
|
@@ -27,7 +28,8 @@ var InternalCalendarBlockProvider = function InternalCalendarBlockProvider(props
|
|
|
27
28
|
field: field,
|
|
28
29
|
service: service,
|
|
29
30
|
resource: resource,
|
|
30
|
-
fieldNames: fieldNames
|
|
31
|
+
fieldNames: fieldNames,
|
|
32
|
+
showLunar: showLunar
|
|
31
33
|
}
|
|
32
34
|
}, props.children);
|
|
33
35
|
};
|
|
@@ -57,6 +59,7 @@ export var useCalendarBlockProps = function useCalendarBlockProps() {
|
|
|
57
59
|
}
|
|
58
60
|
}, [ctx === null || ctx === void 0 ? void 0 : (_ctx$service3 = ctx.service) === null || _ctx$service3 === void 0 ? void 0 : _ctx$service3.loading]);
|
|
59
61
|
return {
|
|
60
|
-
fieldNames: ctx.fieldNames
|
|
62
|
+
fieldNames: ctx.fieldNames,
|
|
63
|
+
showLunar: ctx.showLunar
|
|
61
64
|
};
|
|
62
65
|
};
|
|
@@ -18,7 +18,8 @@ export var TableSelectorContext = /*#__PURE__*/createContext({});
|
|
|
18
18
|
|
|
19
19
|
var InternalTableSelectorProvider = function InternalTableSelectorProvider(props) {
|
|
20
20
|
var params = props.params,
|
|
21
|
-
rowKey = props.rowKey
|
|
21
|
+
rowKey = props.rowKey,
|
|
22
|
+
extraFilter = props.extraFilter;
|
|
22
23
|
var field = useField();
|
|
23
24
|
|
|
24
25
|
var _useBlockRequestConte = useBlockRequestContext(),
|
|
@@ -34,6 +35,7 @@ var InternalTableSelectorProvider = function InternalTableSelectorProvider(props
|
|
|
34
35
|
service: service,
|
|
35
36
|
resource: resource,
|
|
36
37
|
params: params,
|
|
38
|
+
extraFilter: extraFilter,
|
|
37
39
|
rowKey: rowKey
|
|
38
40
|
}
|
|
39
41
|
}, props.children);
|
|
@@ -83,10 +85,12 @@ export var TableSelectorProvider = function TableSelectorProvider(props) {
|
|
|
83
85
|
params['appends'] = appends;
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
var extraFilter;
|
|
89
|
+
|
|
86
90
|
if (collectionField) {
|
|
87
91
|
if (['oho', 'o2m'].includes(collectionField.interface)) {
|
|
88
92
|
if (record === null || record === void 0 ? void 0 : record[collectionField.sourceKey]) {
|
|
89
|
-
|
|
93
|
+
extraFilter = {
|
|
90
94
|
$or: [_defineProperty({}, collectionField.foreignKey, {
|
|
91
95
|
$is: null
|
|
92
96
|
}), _defineProperty({}, collectionField.foreignKey, {
|
|
@@ -94,7 +98,7 @@ export var TableSelectorProvider = function TableSelectorProvider(props) {
|
|
|
94
98
|
})]
|
|
95
99
|
};
|
|
96
100
|
} else {
|
|
97
|
-
|
|
101
|
+
extraFilter = _defineProperty({}, collectionField.foreignKey, {
|
|
98
102
|
$is: null
|
|
99
103
|
});
|
|
100
104
|
}
|
|
@@ -108,7 +112,7 @@ export var TableSelectorProvider = function TableSelectorProvider(props) {
|
|
|
108
112
|
|
|
109
113
|
if (targetField) {
|
|
110
114
|
if (record === null || record === void 0 ? void 0 : record[collectionField.foreignKey]) {
|
|
111
|
-
|
|
115
|
+
extraFilter = {
|
|
112
116
|
$or: [_defineProperty({}, "".concat(targetField.name, ".").concat(targetField.foreignKey), {
|
|
113
117
|
$is: null
|
|
114
118
|
}), _defineProperty({}, "".concat(targetField.name, ".").concat(targetField.foreignKey), {
|
|
@@ -116,7 +120,7 @@ export var TableSelectorProvider = function TableSelectorProvider(props) {
|
|
|
116
120
|
})]
|
|
117
121
|
};
|
|
118
122
|
} else {
|
|
119
|
-
|
|
123
|
+
extraFilter = _defineProperty({}, "".concat(targetField.name, ".").concat(targetField.foreignKey), {
|
|
120
124
|
$is: null
|
|
121
125
|
});
|
|
122
126
|
}
|
|
@@ -124,10 +128,21 @@ export var TableSelectorProvider = function TableSelectorProvider(props) {
|
|
|
124
128
|
}
|
|
125
129
|
}
|
|
126
130
|
|
|
131
|
+
if (extraFilter) {
|
|
132
|
+
if (params === null || params === void 0 ? void 0 : params.filter) {
|
|
133
|
+
params['filter'] = {
|
|
134
|
+
$and: [extraFilter, params['filter']]
|
|
135
|
+
};
|
|
136
|
+
} else {
|
|
137
|
+
params['filter'] = extraFilter;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
127
141
|
return /*#__PURE__*/React.createElement(BlockProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
128
142
|
params: params
|
|
129
143
|
}), /*#__PURE__*/React.createElement(InternalTableSelectorProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
130
|
-
params: params
|
|
144
|
+
params: params,
|
|
145
|
+
extraFilter: extraFilter
|
|
131
146
|
})));
|
|
132
147
|
};
|
|
133
148
|
export var useTableSelectorContext = function useTableSelectorContext() {
|
|
@@ -7,6 +7,12 @@ export declare const useCreateActionProps: () => {
|
|
|
7
7
|
export declare const useCustomizeUpdateActionProps: () => {
|
|
8
8
|
onClick(): Promise<void>;
|
|
9
9
|
};
|
|
10
|
+
export declare const useCustomizeBulkUpdateActionProps: () => {
|
|
11
|
+
onClick(): Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export declare const useCustomizeBulkEditActionProps: () => {
|
|
14
|
+
onClick(): Promise<void>;
|
|
15
|
+
};
|
|
10
16
|
export declare const useCustomizeRequestActionProps: () => {
|
|
11
17
|
onClick(): Promise<void>;
|
|
12
18
|
};
|