@nocobase/client 0.7.5-alpha.1 → 0.7.6-alpha.2

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.
Files changed (53) hide show
  1. package/es/application/Application.js +1 -3
  2. package/es/collection-manager/Configuration/ConfigurationTable.js +8 -3
  3. package/es/collection-manager/Configuration/schemas/collections.d.ts +2 -0
  4. package/es/collection-manager/Configuration/schemas/collections.js +23 -1
  5. package/es/collection-manager/action-hooks.d.ts +5 -0
  6. package/es/collection-manager/action-hooks.js +14 -1
  7. package/es/index.d.ts +0 -1
  8. package/es/index.js +0 -1
  9. package/es/locale/index.js +14 -2
  10. package/es/locale/tr_TR.d.ts +560 -0
  11. package/es/locale/tr_TR.js +559 -0
  12. package/es/locale/zh_CN.d.ts +3 -0
  13. package/es/locale/zh_CN.js +4 -1
  14. package/es/schema-component/antd/filter/useFilterActionProps.d.ts +12 -1
  15. package/es/schema-component/antd/filter/useFilterActionProps.js +24 -10
  16. package/es/schema-component/antd/filter/useValues.js +0 -1
  17. package/es/user/SignupPage.d.ts +6 -1
  18. package/es/user/SignupPage.js +4 -2
  19. package/lib/application/Application.js +1 -4
  20. package/lib/collection-manager/Configuration/ConfigurationTable.js +7 -2
  21. package/lib/collection-manager/Configuration/schemas/collections.d.ts +2 -0
  22. package/lib/collection-manager/Configuration/schemas/collections.js +24 -1
  23. package/lib/collection-manager/action-hooks.d.ts +5 -0
  24. package/lib/collection-manager/action-hooks.js +31 -14
  25. package/lib/index.d.ts +0 -1
  26. package/lib/index.js +0 -13
  27. package/lib/locale/index.js +18 -4
  28. package/lib/locale/tr_TR.d.ts +560 -0
  29. package/lib/locale/tr_TR.js +566 -0
  30. package/lib/locale/zh_CN.d.ts +3 -0
  31. package/lib/locale/zh_CN.js +4 -1
  32. package/lib/schema-component/antd/filter/useFilterActionProps.d.ts +12 -1
  33. package/lib/schema-component/antd/filter/useFilterActionProps.js +34 -11
  34. package/lib/schema-component/antd/filter/useValues.js +0 -1
  35. package/lib/user/SignupPage.d.ts +6 -1
  36. package/lib/user/SignupPage.js +4 -2
  37. package/package.json +4 -4
  38. package/es/file-manager/FileStorageShortcut.d.ts +0 -1
  39. package/es/file-manager/FileStorageShortcut.js +0 -61
  40. package/es/file-manager/StorageOptions.d.ts +0 -2
  41. package/es/file-manager/StorageOptions.js +0 -121
  42. package/es/file-manager/index.d.ts +0 -1
  43. package/es/file-manager/index.js +0 -1
  44. package/es/file-manager/schemas/storage.d.ts +0 -2
  45. package/es/file-manager/schemas/storage.js +0 -349
  46. package/lib/file-manager/FileStorageShortcut.d.ts +0 -1
  47. package/lib/file-manager/FileStorageShortcut.js +0 -85
  48. package/lib/file-manager/StorageOptions.d.ts +0 -2
  49. package/lib/file-manager/StorageOptions.js +0 -138
  50. package/lib/file-manager/index.d.ts +0 -1
  51. package/lib/file-manager/index.js +0 -18
  52. package/lib/file-manager/schemas/storage.d.ts +0 -2
  53. package/lib/file-manager/schemas/storage.js +0 -360
@@ -1,349 +0,0 @@
1
- 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; }
2
-
3
- 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; }
4
-
5
- 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; }
6
-
7
- import { uid } from '@formily/shared';
8
- import { useRequest } from '../../api-client';
9
- import { useActionContext } from '../../schema-component';
10
- var collection = {
11
- name: 'storages',
12
- fields: [{
13
- type: 'integer',
14
- name: 'title',
15
- interface: 'input',
16
- uiSchema: {
17
- title: '{{t("Storage display name")}}',
18
- type: 'string',
19
- 'x-component': 'Input',
20
- required: true
21
- }
22
- }, {
23
- type: 'string',
24
- name: 'name',
25
- interface: 'input',
26
- uiSchema: {
27
- title: '{{t("Storage name")}}',
28
- type: 'string',
29
- 'x-component': 'Input'
30
- }
31
- }, {
32
- type: 'string',
33
- name: 'type',
34
- interface: 'select',
35
- uiSchema: {
36
- title: '{{t("Storage type")}}',
37
- type: 'string',
38
- 'x-component': 'Select',
39
- required: true,
40
- enum: [{
41
- label: '{{t("Local storage")}}',
42
- value: 'local'
43
- }, {
44
- label: '{{t("Aliyun OSS")}}',
45
- value: 'ali-oss'
46
- }, {
47
- label: '{{t("Amazon S3")}}',
48
- value: 's3'
49
- }]
50
- }
51
- }, {
52
- type: 'string',
53
- name: 'baseUrl',
54
- interface: 'input',
55
- uiSchema: {
56
- title: '{{t("Storage base URL")}}',
57
- type: 'string',
58
- 'x-component': 'Input'
59
- }
60
- }, {
61
- type: 'boolean',
62
- name: 'default',
63
- interface: 'boolean',
64
- uiSchema: {
65
- title: '{{t("Default storage")}}',
66
- type: 'boolean',
67
- 'x-component': 'Checkbox'
68
- }
69
- }]
70
- };
71
- export var storageSchema = {
72
- type: 'object',
73
- properties: {
74
- block1: {
75
- type: 'void',
76
- 'x-decorator': 'ResourceActionProvider',
77
- 'x-decorator-props': {
78
- collection: collection,
79
- resourceName: 'storages',
80
- request: {
81
- resource: 'storages',
82
- action: 'list',
83
- params: {
84
- pageSize: 50,
85
- sort: ['id'],
86
- appends: []
87
- }
88
- }
89
- },
90
- 'x-component': 'CollectionProvider',
91
- 'x-component-props': {
92
- collection: collection
93
- },
94
- properties: {
95
- actions: {
96
- type: 'void',
97
- 'x-component': 'ActionBar',
98
- 'x-component-props': {
99
- style: {
100
- marginBottom: 16
101
- }
102
- },
103
- properties: {
104
- delete: {
105
- type: 'void',
106
- title: '{{ t("Delete") }}',
107
- 'x-component': 'Action',
108
- 'x-component-props': {
109
- useAction: '{{ cm.useBulkDestroyAction }}',
110
- confirm: {
111
- title: "{{t('Delete storage')}}",
112
- content: "{{t('Are you sure you want to delete it?')}}"
113
- }
114
- }
115
- },
116
- create: {
117
- type: 'void',
118
- title: '{{t("Add storage")}}',
119
- 'x-component': 'Action',
120
- 'x-component-props': {
121
- type: 'primary'
122
- },
123
- properties: {
124
- drawer: {
125
- type: 'void',
126
- 'x-component': 'Action.Drawer',
127
- 'x-decorator': 'Form',
128
- 'x-decorator-props': {
129
- useValues: function useValues(options) {
130
- var ctx = useActionContext();
131
- return useRequest(function () {
132
- return Promise.resolve({
133
- data: {
134
- name: "s_".concat(uid())
135
- }
136
- });
137
- }, _objectSpread(_objectSpread({}, options), {}, {
138
- refreshDeps: [ctx.visible]
139
- }));
140
- }
141
- },
142
- title: '{{t("Add storage")}}',
143
- properties: {
144
- title: {
145
- 'x-component': 'CollectionField',
146
- 'x-decorator': 'FormItem'
147
- },
148
- name: {
149
- 'x-component': 'CollectionField',
150
- 'x-decorator': 'FormItem',
151
- description: '{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'
152
- },
153
- baseUrl: {
154
- 'x-component': 'CollectionField',
155
- 'x-decorator': 'FormItem'
156
- },
157
- type: {
158
- 'x-component': 'CollectionField',
159
- 'x-decorator': 'FormItem'
160
- },
161
- options: {
162
- type: 'object',
163
- 'x-component': 'StorageOptions'
164
- },
165
- default: {
166
- 'x-component': 'CollectionField',
167
- 'x-decorator': 'FormItem',
168
- title: '',
169
- 'x-content': '{{t("Default storage")}}'
170
- },
171
- footer: {
172
- type: 'void',
173
- 'x-component': 'Action.Drawer.Footer',
174
- properties: {
175
- cancel: {
176
- title: '{{t("Cancel")}}',
177
- 'x-component': 'Action',
178
- 'x-component-props': {
179
- useAction: '{{ cm.useCancelAction }}'
180
- }
181
- },
182
- submit: {
183
- title: '{{t("Submit")}}',
184
- 'x-component': 'Action',
185
- 'x-component-props': {
186
- type: 'primary',
187
- useAction: '{{ cm.useCreateAction }}'
188
- }
189
- }
190
- }
191
- }
192
- }
193
- }
194
- }
195
- }
196
- }
197
- },
198
- table: {
199
- type: 'void',
200
- 'x-uid': 'input',
201
- 'x-component': 'Table.Void',
202
- 'x-component-props': {
203
- rowKey: 'id',
204
- rowSelection: {
205
- type: 'checkbox'
206
- },
207
- useDataSource: '{{ cm.useDataSourceFromRAC }}'
208
- },
209
- properties: {
210
- column1: {
211
- type: 'void',
212
- 'x-decorator': 'Table.Column.Decorator',
213
- 'x-component': 'Table.Column',
214
- properties: {
215
- title: {
216
- type: 'number',
217
- 'x-component': 'CollectionField',
218
- 'x-read-pretty': true
219
- }
220
- }
221
- },
222
- column2: {
223
- type: 'void',
224
- 'x-decorator': 'Table.Column.Decorator',
225
- 'x-component': 'Table.Column',
226
- properties: {
227
- name: {
228
- type: 'string',
229
- 'x-component': 'CollectionField',
230
- 'x-read-pretty': true
231
- }
232
- }
233
- },
234
- column3: {
235
- type: 'void',
236
- 'x-decorator': 'Table.Column.Decorator',
237
- 'x-component': 'Table.Column',
238
- properties: {
239
- default: {
240
- type: 'string',
241
- 'x-component': 'CollectionField',
242
- 'x-read-pretty': true
243
- }
244
- }
245
- },
246
- column4: {
247
- type: 'void',
248
- title: '{{t("Actions")}}',
249
- 'x-component': 'Table.Column',
250
- properties: {
251
- actions: {
252
- type: 'void',
253
- 'x-component': 'Space',
254
- 'x-component-props': {
255
- split: '|'
256
- },
257
- properties: {
258
- update: {
259
- type: 'void',
260
- title: '{{t("Edit")}}',
261
- 'x-component': 'Action.Link',
262
- 'x-component-props': {
263
- type: 'primary'
264
- },
265
- properties: {
266
- drawer: {
267
- type: 'void',
268
- 'x-component': 'Action.Drawer',
269
- 'x-decorator': 'Form',
270
- 'x-decorator-props': {
271
- useValues: '{{ cm.useValuesFromRecord }}'
272
- },
273
- title: '{{t("Edit storage")}}',
274
- properties: {
275
- title: {
276
- 'x-component': 'CollectionField',
277
- 'x-decorator': 'FormItem'
278
- },
279
- name: {
280
- 'x-component': 'CollectionField',
281
- 'x-decorator': 'FormItem',
282
- 'x-disabled': true
283
- },
284
- baseUrl: {
285
- 'x-component': 'CollectionField',
286
- 'x-decorator': 'FormItem'
287
- },
288
- type: {
289
- 'x-component': 'CollectionField',
290
- 'x-decorator': 'FormItem',
291
- 'x-disabled': true
292
- },
293
- options: {
294
- type: 'object',
295
- 'x-component': 'StorageOptions'
296
- },
297
- default: {
298
- title: '',
299
- 'x-component': 'CollectionField',
300
- 'x-decorator': 'FormItem',
301
- 'x-content': '{{t("Default storage")}}'
302
- },
303
- footer: {
304
- type: 'void',
305
- 'x-component': 'Action.Drawer.Footer',
306
- properties: {
307
- cancel: {
308
- title: '{{t("Cancel")}}',
309
- 'x-component': 'Action',
310
- 'x-component-props': {
311
- useAction: '{{ cm.useCancelAction }}'
312
- }
313
- },
314
- submit: {
315
- title: '{{t("Submit")}}',
316
- 'x-component': 'Action',
317
- 'x-component-props': {
318
- type: 'primary',
319
- useAction: '{{ cm.useUpdateAction }}'
320
- }
321
- }
322
- }
323
- }
324
- }
325
- }
326
- }
327
- },
328
- delete: {
329
- type: 'void',
330
- title: '{{ t("Delete") }}',
331
- 'x-component': 'Action.Link',
332
- 'x-component-props': {
333
- confirm: {
334
- title: "{{t('Delete role')}}",
335
- content: "{{t('Are you sure you want to delete it?')}}"
336
- },
337
- useAction: '{{cm.useDestroyAction}}'
338
- }
339
- }
340
- }
341
- }
342
- }
343
- }
344
- }
345
- }
346
- }
347
- }
348
- }
349
- };
@@ -1 +0,0 @@
1
- export declare const FileStorageShortcut: () => JSX.Element;
@@ -1,85 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.FileStorageShortcut = void 0;
9
-
10
- var _icons = require("@ant-design/icons");
11
-
12
- var _shared = require("@formily/shared");
13
-
14
- var _react = _interopRequireWildcard(require("react"));
15
-
16
- var _reactI18next = require("react-i18next");
17
-
18
- var _ = require("..");
19
-
20
- var _schemaComponent = require("../schema-component");
21
-
22
- var _storage = require("./schemas/storage");
23
-
24
- var _StorageOptions = require("./StorageOptions");
25
-
26
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
-
28
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
-
30
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
-
32
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
33
-
34
- 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); }
35
-
36
- 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; }
37
-
38
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
39
-
40
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
-
42
- 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; }
43
-
44
- var schema = {
45
- type: 'object',
46
- properties: _defineProperty({}, (0, _shared.uid)(), {
47
- 'x-component': 'Action.Drawer',
48
- type: 'void',
49
- title: '{{t("File storages")}}',
50
- properties: {
51
- storageSchema: _storage.storageSchema
52
- }
53
- })
54
- };
55
-
56
- var FileStorageShortcut = function FileStorageShortcut() {
57
- var _useState = (0, _react.useState)(false),
58
- _useState2 = _slicedToArray(_useState, 2),
59
- visible = _useState2[0],
60
- setVisible = _useState2[1];
61
-
62
- var _useTranslation = (0, _reactI18next.useTranslation)(),
63
- t = _useTranslation.t;
64
-
65
- return /*#__PURE__*/_react.default.createElement(_schemaComponent.ActionContext.Provider, {
66
- value: {
67
- visible: visible,
68
- setVisible: setVisible
69
- }
70
- }, /*#__PURE__*/_react.default.createElement(_.PluginManager.Toolbar.Item, {
71
- eventKey: 'FileStorage',
72
- onClick: function onClick() {
73
- setVisible(true);
74
- },
75
- icon: /*#__PURE__*/_react.default.createElement(_icons.FileOutlined, null),
76
- title: t('File storages')
77
- }), /*#__PURE__*/_react.default.createElement(_schemaComponent.SchemaComponent, {
78
- components: {
79
- StorageOptions: _StorageOptions.StorageOptions
80
- },
81
- schema: schema
82
- }));
83
- };
84
-
85
- exports.FileStorageShortcut = FileStorageShortcut;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const StorageOptions: React.MemoExoticComponent<React.FunctionComponent<unknown>>;
@@ -1,138 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.StorageOptions = void 0;
9
-
10
- var _antd = require("@formily/antd");
11
-
12
- var _react = require("@formily/react");
13
-
14
- var _react2 = _interopRequireWildcard(require("react"));
15
-
16
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
-
18
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
-
20
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
21
-
22
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
23
-
24
- 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); }
25
-
26
- 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; }
27
-
28
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
29
-
30
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
-
32
- var schema = {
33
- local: {
34
- properties: {
35
- documentRoot: {
36
- title: '{{t("Destination")}}',
37
- type: 'string',
38
- 'x-decorator': 'FormItem',
39
- 'x-component': 'Input',
40
- default: 'uploads'
41
- },
42
- serve: {
43
- type: 'string',
44
- 'x-decorator': 'FormItem',
45
- 'x-component': 'Checkbox',
46
- 'x-content': '{{t("Use the built-in static file server")}}',
47
- default: true
48
- }
49
- }
50
- },
51
- 'ali-oss': {
52
- properties: {
53
- region: {
54
- title: '{{t("Region")}}',
55
- type: 'string',
56
- 'x-decorator': 'FormItem',
57
- 'x-component': 'Input',
58
- required: true
59
- },
60
- accessKeyId: {
61
- title: '{{t("AccessKey ID")}}',
62
- type: 'string',
63
- 'x-decorator': 'FormItem',
64
- 'x-component': 'Input',
65
- required: true
66
- },
67
- accessKeySecret: {
68
- title: '{{t("AccessKey Secret")}}',
69
- type: 'string',
70
- 'x-decorator': 'FormItem',
71
- 'x-component': 'Password',
72
- required: true
73
- },
74
- bucket: {
75
- title: '{{t("Bucket")}}',
76
- type: 'string',
77
- 'x-decorator': 'FormItem',
78
- 'x-component': 'Input',
79
- required: true
80
- }
81
- }
82
- },
83
- s3: {
84
- properties: {
85
- region: {
86
- title: '{{t("Region")}}',
87
- type: 'string',
88
- 'x-decorator': 'FormItem',
89
- 'x-component': 'Input',
90
- required: true
91
- },
92
- accessKeyId: {
93
- title: '{{t("AccessKey ID")}}',
94
- type: 'string',
95
- 'x-decorator': 'FormItem',
96
- 'x-component': 'Input',
97
- required: true
98
- },
99
- secretAccessKey: {
100
- title: '{{t("AccessKey Secret")}}',
101
- type: 'string',
102
- 'x-decorator': 'FormItem',
103
- 'x-component': 'Password',
104
- required: true
105
- },
106
- bucket: {
107
- title: '{{t("Bucket")}}',
108
- type: 'string',
109
- 'x-decorator': 'FormItem',
110
- 'x-component': 'Input',
111
- required: true
112
- }
113
- }
114
- }
115
- };
116
- var StorageOptions = (0, _react.observer)(function (props) {
117
- var form = (0, _react.useForm)();
118
- var field = (0, _react.useField)();
119
-
120
- var _useState = (0, _react2.useState)(new _react.Schema({})),
121
- _useState2 = _slicedToArray(_useState, 2),
122
- s = _useState2[0],
123
- setSchema = _useState2[1];
124
-
125
- (0, _react2.useEffect)(function () {
126
- form.clearFormGraph('options.*');
127
- setSchema(new _react.Schema(schema[form.values.type] || {}));
128
- }, [form.values.type]);
129
- return /*#__PURE__*/_react2.default.createElement("div", null, /*#__PURE__*/_react2.default.createElement(_antd.FormLayout, {
130
- layout: 'vertical'
131
- }, /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
132
- key: form.values.type || 'local',
133
- basePath: field.address,
134
- onlyRenderProperties: true,
135
- schema: s
136
- })));
137
- });
138
- exports.StorageOptions = StorageOptions;
@@ -1 +0,0 @@
1
- export * from './FileStorageShortcut';
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _FileStorageShortcut = require("./FileStorageShortcut");
8
-
9
- Object.keys(_FileStorageShortcut).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _FileStorageShortcut[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function get() {
15
- return _FileStorageShortcut[key];
16
- }
17
- });
18
- });
@@ -1,2 +0,0 @@
1
- import { ISchema } from '@formily/react';
2
- export declare const storageSchema: ISchema;