@nocobase/client 0.8.1-alpha.4 → 0.9.0-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.
- package/es/acl/ACLProvider.d.ts +16 -2
- package/es/acl/ACLProvider.js +271 -100
- package/es/acl/Configuration/ConfigureCenter.d.ts +2 -0
- package/es/acl/Configuration/ConfigureCenter.js +254 -0
- package/es/acl/Configuration/MenuConfigure.js +2 -2
- package/es/acl/Configuration/PermisionProvider.d.ts +4 -0
- package/es/acl/Configuration/PermisionProvider.js +132 -0
- package/es/acl/Configuration/RoleConfigure.js +98 -23
- package/es/acl/Configuration/RoleTable.d.ts +1 -1
- package/es/acl/Configuration/RoleTable.js +6 -3
- package/es/acl/Configuration/RolesResourcesActions.js +2 -2
- package/es/acl/Configuration/index.d.ts +1 -0
- package/es/acl/Configuration/index.js +2 -1
- package/es/acl/Configuration/schemas/roleCollections.js +41 -13
- package/es/acl/Configuration/schemas/roles.js +42 -2
- package/es/acl/Configuration/schemas/scopes.js +2 -0
- package/es/acl/index.d.ts +1 -0
- package/es/acl/index.js +2 -1
- package/es/acl/style.less +10 -0
- package/es/antd-config-provider/index.d.ts +3 -1
- package/es/antd-config-provider/index.js +25 -6
- package/es/antd-config-provider/loadConstrueLocale.d.ts +1 -0
- package/es/antd-config-provider/loadConstrueLocale.js +293 -0
- package/es/api-client/APIClient.js +5 -0
- package/es/block-provider/FormBlockProvider.js +5 -2
- package/es/block-provider/KanbanBlockProvider.js +3 -3
- package/es/block-provider/SharedFilterProvider.d.ts +1 -0
- package/es/block-provider/SharedFilterProvider.js +22 -6
- package/es/collection-manager/CollectionHistoryProvider.js +14 -2
- package/es/collection-manager/hooks/useCollection.d.ts +1 -0
- package/es/collection-manager/hooks/useCollection.js +10 -0
- package/es/collection-manager/interfaces/index.d.ts +0 -1
- package/es/collection-manager/interfaces/index.js +0 -1
- package/es/collection-manager/interfaces/o2m.js +1 -0
- package/es/collection-manager/interfaces/properties/operators.js +7 -0
- package/es/collection-manager/interfaces/subTable.js +1 -0
- package/es/collection-manager/templates/calendar.js +5 -0
- package/es/formula/Expression.d.ts +2 -0
- package/es/formula/Expression.js +296 -0
- package/es/formula/Result.d.ts +2 -0
- package/es/formula/Result.js +91 -0
- package/es/formula/index.d.ts +6 -0
- package/es/formula/index.js +8 -0
- package/es/i18n/i18n.js +7 -12
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -2
- package/es/locale/en_US.d.ts +108 -28
- package/es/locale/en_US.js +108 -28
- package/es/locale/index.d.ts +201 -4
- package/es/locale/index.js +191 -58
- package/es/locale/ja_JP.d.ts +4 -0
- package/es/locale/ja_JP.js +4 -0
- package/es/locale/zh_CN.d.ts +11 -1
- package/es/locale/zh_CN.js +12 -2
- package/es/plugin-manager/PluginManager.js +19 -13
- package/es/pm/PluginManagerLink.js +38 -43
- package/es/pm/index.d.ts +1 -0
- package/es/pm/index.js +84 -35
- package/es/record-provider/index.d.ts +1 -0
- package/es/record-provider/index.js +7 -4
- package/es/route-switch/antd/admin-layout/index.d.ts +1 -0
- package/es/route-switch/antd/admin-layout/index.js +4 -6
- package/es/schema-component/antd/action/Action.js +19 -16
- package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +24 -23
- package/es/schema-component/antd/cron/Cron.d.ts +0 -1
- package/es/schema-component/antd/cron/Cron.js +16 -19
- package/es/schema-component/antd/cron/locale/index.d.ts +37 -0
- package/es/schema-component/antd/cron/locale/index.js +6 -0
- package/es/schema-component/antd/filter/useFilterActionProps.js +17 -23
- package/es/schema-component/antd/form-item/FormItem.js +5 -4
- package/es/schema-component/antd/index.d.ts +1 -2
- package/es/schema-component/antd/index.js +1 -2
- package/es/schema-component/antd/page/FixedBlock.d.ts +1 -1
- package/es/schema-component/antd/page/FixedBlock.js +70 -21
- package/es/schema-component/antd/page/Page.js +15 -10
- package/es/schema-component/antd/remote-select/RemoteSelect.js +12 -2
- package/es/schema-component/antd/table/Table.Array.js +1 -1
- package/es/schema-component/antd/table-v2/Table.js +13 -6
- package/es/schema-component/antd/table-v2/TableBlockDesigner.js +24 -8
- package/es/schema-component/hooks/useDesignable.d.ts +1 -1
- package/es/schema-component/hooks/useDesignable.js +45 -16
- package/es/schema-component/hooks/useFieldTitle.js +3 -1
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +3 -0
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +1 -0
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -0
- package/es/schema-initializer/utils.js +6 -9
- package/es/schema-templates/BlockTemplate.js +2 -2
- package/es/schema-templates/SchemaTemplateManagerProvider.js +1 -1
- package/es/system-settings/SystemSettingsShortcut.js +1 -1
- package/lib/acl/ACLProvider.d.ts +16 -2
- package/lib/acl/ACLProvider.js +283 -102
- package/lib/acl/Configuration/ConfigureCenter.d.ts +2 -0
- package/lib/acl/Configuration/ConfigureCenter.js +278 -0
- package/lib/acl/Configuration/MenuConfigure.js +3 -3
- package/lib/acl/Configuration/PermisionProvider.d.ts +4 -0
- package/lib/acl/Configuration/PermisionProvider.js +156 -0
- package/lib/acl/Configuration/RoleConfigure.js +107 -23
- package/lib/acl/Configuration/RoleTable.d.ts +1 -1
- package/lib/acl/Configuration/RoleTable.js +8 -4
- package/lib/acl/Configuration/RolesResourcesActions.js +2 -2
- package/lib/acl/Configuration/index.d.ts +1 -0
- package/lib/acl/Configuration/index.js +15 -1
- package/lib/acl/Configuration/schemas/roleCollections.js +41 -13
- package/lib/acl/Configuration/schemas/roles.js +47 -2
- package/lib/acl/Configuration/schemas/scopes.js +2 -0
- package/lib/acl/index.d.ts +1 -0
- package/lib/acl/index.js +3 -1
- package/lib/acl/style.less +10 -0
- package/lib/antd-config-provider/index.d.ts +3 -1
- package/lib/antd-config-provider/index.js +40 -6
- package/lib/antd-config-provider/loadConstrueLocale.d.ts +1 -0
- package/lib/antd-config-provider/loadConstrueLocale.js +304 -0
- package/lib/api-client/APIClient.js +5 -0
- package/lib/block-provider/FormBlockProvider.js +9 -3
- package/lib/block-provider/KanbanBlockProvider.js +3 -3
- package/lib/block-provider/SharedFilterProvider.d.ts +1 -0
- package/lib/block-provider/SharedFilterProvider.js +26 -7
- package/lib/collection-manager/CollectionHistoryProvider.js +14 -1
- package/lib/collection-manager/hooks/useCollection.d.ts +1 -0
- package/lib/collection-manager/hooks/useCollection.js +10 -0
- package/lib/collection-manager/interfaces/index.d.ts +0 -1
- package/lib/collection-manager/interfaces/index.js +0 -13
- package/lib/collection-manager/interfaces/o2m.js +1 -0
- package/lib/collection-manager/interfaces/properties/operators.js +7 -0
- package/lib/collection-manager/interfaces/subTable.js +1 -0
- package/lib/collection-manager/templates/calendar.js +5 -0
- package/lib/formula/Expression.d.ts +2 -0
- package/lib/formula/Expression.js +319 -0
- package/lib/formula/Result.d.ts +2 -0
- package/lib/formula/Result.js +114 -0
- package/lib/formula/index.d.ts +6 -0
- package/lib/formula/index.js +22 -0
- package/lib/i18n/i18n.js +7 -14
- package/lib/index.d.ts +2 -1
- package/lib/index.js +26 -13
- package/lib/locale/en_US.d.ts +108 -28
- package/lib/locale/en_US.js +108 -28
- package/lib/locale/index.d.ts +201 -4
- package/lib/locale/index.js +197 -67
- package/lib/locale/ja_JP.d.ts +4 -0
- package/lib/locale/ja_JP.js +4 -0
- package/lib/locale/zh_CN.d.ts +11 -1
- package/lib/locale/zh_CN.js +12 -2
- package/lib/plugin-manager/PluginManager.js +20 -13
- package/lib/pm/PluginManagerLink.js +37 -43
- package/lib/pm/index.d.ts +1 -0
- package/lib/pm/index.js +90 -35
- package/lib/record-provider/index.d.ts +1 -0
- package/lib/record-provider/index.js +7 -4
- package/lib/route-switch/antd/admin-layout/index.d.ts +1 -0
- package/lib/route-switch/antd/admin-layout/index.js +5 -4
- package/lib/schema-component/antd/action/Action.js +19 -16
- package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +22 -21
- package/lib/schema-component/antd/cron/Cron.d.ts +0 -1
- package/lib/schema-component/antd/cron/Cron.js +19 -24
- package/lib/schema-component/antd/cron/locale/index.d.ts +37 -0
- package/lib/schema-component/antd/cron/locale/index.js +18 -0
- package/lib/schema-component/antd/filter/useFilterActionProps.js +16 -23
- package/lib/schema-component/antd/form-item/FormItem.js +6 -4
- package/lib/schema-component/antd/index.d.ts +1 -2
- package/lib/schema-component/antd/index.js +8 -21
- package/lib/schema-component/antd/page/FixedBlock.d.ts +1 -1
- package/lib/schema-component/antd/page/FixedBlock.js +71 -21
- package/lib/schema-component/antd/page/Page.js +14 -9
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +18 -3
- package/lib/schema-component/antd/table/Table.Array.js +1 -1
- package/lib/schema-component/antd/table-v2/Table.js +14 -6
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +25 -8
- package/lib/schema-component/hooks/useDesignable.d.ts +1 -1
- package/lib/schema-component/hooks/useDesignable.js +47 -18
- package/lib/schema-component/hooks/useFieldTitle.js +4 -1
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +3 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +1 -0
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -0
- package/lib/schema-initializer/utils.js +6 -9
- package/lib/schema-templates/BlockTemplate.js +2 -2
- package/lib/schema-templates/SchemaTemplateManagerProvider.js +1 -1
- package/lib/system-settings/SystemSettingsShortcut.js +1 -1
- package/package.json +6 -11
- package/es/collection-manager/interfaces/formula.d.ts +0 -2
- package/es/collection-manager/interfaces/formula.js +0 -74
- package/es/schema-component/antd/formula-input/Compute.d.ts +0 -3
- package/es/schema-component/antd/formula-input/Compute.js +0 -55
- package/es/schema-component/antd/formula-input/FormulaInput.d.ts +0 -3
- package/es/schema-component/antd/formula-input/FormulaInput.js +0 -167
- package/es/schema-component/antd/formula-input/index.d.ts +0 -1
- package/es/schema-component/antd/formula-input/index.js +0 -7
- package/lib/collection-manager/interfaces/formula.d.ts +0 -2
- package/lib/collection-manager/interfaces/formula.js +0 -83
- package/lib/schema-component/antd/formula-input/Compute.d.ts +0 -3
- package/lib/schema-component/antd/formula-input/Compute.js +0 -79
- package/lib/schema-component/antd/formula-input/FormulaInput.d.ts +0 -3
- package/lib/schema-component/antd/formula-input/FormulaInput.js +0 -191
- package/lib/schema-component/antd/formula-input/index.d.ts +0 -1
- package/lib/schema-component/antd/formula-input/index.js +0 -18
|
@@ -15,6 +15,8 @@ var _reactI18next = require("react-i18next");
|
|
|
15
15
|
|
|
16
16
|
var _blockProvider = require("../../../block-provider");
|
|
17
17
|
|
|
18
|
+
var _SharedFilterProvider = require("../../../block-provider/SharedFilterProvider");
|
|
19
|
+
|
|
18
20
|
var _collectionManager = require("../../../collection-manager");
|
|
19
21
|
|
|
20
22
|
var _actionHooks = require("../../../collection-manager/action-hooks");
|
|
@@ -29,6 +31,18 @@ var _page = require("../page");
|
|
|
29
31
|
|
|
30
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
33
|
|
|
34
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
35
|
+
|
|
36
|
+
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."); }
|
|
37
|
+
|
|
38
|
+
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); }
|
|
39
|
+
|
|
40
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
41
|
+
|
|
42
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
43
|
+
|
|
44
|
+
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; }
|
|
45
|
+
|
|
32
46
|
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; }
|
|
33
47
|
|
|
34
48
|
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; }
|
|
@@ -107,17 +121,20 @@ var TableBlockDesigner = function TableBlockDesigner() {
|
|
|
107
121
|
}
|
|
108
122
|
},
|
|
109
123
|
onSubmit: function onSubmit(_ref) {
|
|
110
|
-
var _service$params2, _schema2;
|
|
124
|
+
var _service$params2, _service$params2$, _service$params3, _schema2;
|
|
111
125
|
|
|
112
126
|
var filter = _ref.filter;
|
|
113
127
|
var params = field.decoratorProps.params || {};
|
|
114
128
|
params.filter = filter;
|
|
115
129
|
field.decoratorProps.params = params;
|
|
116
130
|
fieldSchema['x-decorator-props']['params'] = params;
|
|
117
|
-
|
|
118
|
-
|
|
131
|
+
var filters = ((_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : (_service$params2$ = _service$params2[1]) === null || _service$params2$ === void 0 ? void 0 : _service$params2$.filters) || {};
|
|
132
|
+
service.run(_objectSpread(_objectSpread({}, (_service$params3 = service.params) === null || _service$params3 === void 0 ? void 0 : _service$params3[0]), {}, {
|
|
133
|
+
filter: (0, _SharedFilterProvider.mergeFilter)([].concat(_toConsumableArray(Object.values(filters)), [filter])),
|
|
119
134
|
page: 1
|
|
120
|
-
})
|
|
135
|
+
}), {
|
|
136
|
+
filters: filters
|
|
137
|
+
});
|
|
121
138
|
dn.emit('patch', {
|
|
122
139
|
schema: (_schema2 = {}, _defineProperty(_schema2, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema2, 'x-decorator-props', fieldSchema['x-decorator-props']), _schema2)
|
|
123
140
|
});
|
|
@@ -194,7 +211,7 @@ var TableBlockDesigner = function TableBlockDesigner() {
|
|
|
194
211
|
}
|
|
195
212
|
},
|
|
196
213
|
onSubmit: function onSubmit(_ref2) {
|
|
197
|
-
var _schema3, _service$
|
|
214
|
+
var _schema3, _service$params4;
|
|
198
215
|
|
|
199
216
|
var sort = _ref2.sort;
|
|
200
217
|
var sortArr = sort.map(function (item) {
|
|
@@ -207,7 +224,7 @@ var TableBlockDesigner = function TableBlockDesigner() {
|
|
|
207
224
|
dn.emit('patch', {
|
|
208
225
|
schema: (_schema3 = {}, _defineProperty(_schema3, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema3, 'x-decorator-props', fieldSchema['x-decorator-props']), _schema3)
|
|
209
226
|
});
|
|
210
|
-
service.run(_objectSpread(_objectSpread({}, (_service$
|
|
227
|
+
service.run(_objectSpread(_objectSpread({}, (_service$params4 = service.params) === null || _service$params4 === void 0 ? void 0 : _service$params4[0]), {}, {
|
|
211
228
|
sort: sortArr
|
|
212
229
|
}));
|
|
213
230
|
}
|
|
@@ -231,13 +248,13 @@ var TableBlockDesigner = function TableBlockDesigner() {
|
|
|
231
248
|
value: 200
|
|
232
249
|
}],
|
|
233
250
|
onChange: function onChange(pageSize) {
|
|
234
|
-
var _service$
|
|
251
|
+
var _service$params5, _schema4;
|
|
235
252
|
|
|
236
253
|
var params = field.decoratorProps.params || {};
|
|
237
254
|
params.pageSize = pageSize;
|
|
238
255
|
field.decoratorProps.params = params;
|
|
239
256
|
fieldSchema['x-decorator-props']['params'] = params;
|
|
240
|
-
service.run(_objectSpread(_objectSpread({}, (_service$
|
|
257
|
+
service.run(_objectSpread(_objectSpread({}, (_service$params5 = service.params) === null || _service$params5 === void 0 ? void 0 : _service$params5[0]), {}, {
|
|
241
258
|
pageSize: pageSize,
|
|
242
259
|
page: 1
|
|
243
260
|
}));
|
|
@@ -36,7 +36,7 @@ export declare class Designable {
|
|
|
36
36
|
loadAPIClientEvents(): void;
|
|
37
37
|
prepareProperty(schema: ISchema): void;
|
|
38
38
|
on(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch', listener: any): void;
|
|
39
|
-
emit(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch', ...args: any[]):
|
|
39
|
+
emit(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch', ...args: any[]): Promise<any>;
|
|
40
40
|
parentsIn(schema: Schema): boolean;
|
|
41
41
|
refresh(): void;
|
|
42
42
|
insertAdjacent(position: Position, schema: ISchema, options?: InsertAdjacentOptions): void;
|
|
@@ -28,7 +28,7 @@ var _reactI18next = require("react-i18next");
|
|
|
28
28
|
|
|
29
29
|
var _apiClient = require("../../api-client");
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _context6 = require("../context");
|
|
32
32
|
|
|
33
33
|
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); }
|
|
34
34
|
|
|
@@ -439,25 +439,54 @@ var Designable = /*#__PURE__*/function () {
|
|
|
439
439
|
}
|
|
440
440
|
}, {
|
|
441
441
|
key: "emit",
|
|
442
|
-
value: function
|
|
443
|
-
var
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
442
|
+
value: function () {
|
|
443
|
+
var _emit = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(name) {
|
|
444
|
+
var _this = this;
|
|
445
|
+
|
|
446
|
+
var _len,
|
|
447
|
+
args,
|
|
448
|
+
_key,
|
|
449
|
+
opts,
|
|
450
|
+
others,
|
|
451
|
+
_args5 = arguments;
|
|
452
|
+
|
|
453
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
454
|
+
while (1) {
|
|
455
|
+
switch (_context5.prev = _context5.next) {
|
|
456
|
+
case 0:
|
|
457
|
+
if (this.events[name]) {
|
|
458
|
+
_context5.next = 2;
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
return _context5.abrupt("return");
|
|
463
|
+
|
|
464
|
+
case 2:
|
|
465
|
+
for (_len = _args5.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
466
|
+
args[_key - 1] = _args5[_key];
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
opts = args[0], others = args.slice(1);
|
|
470
|
+
return _context5.abrupt("return", Promise.all(this.events[name].map(function (fn) {
|
|
471
|
+
return fn.bind(_this).apply(void 0, [_objectSpread({
|
|
472
|
+
current: _this.current
|
|
473
|
+
}, opts)].concat(_toConsumableArray(others)));
|
|
474
|
+
})));
|
|
475
|
+
|
|
476
|
+
case 5:
|
|
477
|
+
case "end":
|
|
478
|
+
return _context5.stop();
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}, _callee5, this);
|
|
482
|
+
}));
|
|
448
483
|
|
|
449
|
-
|
|
450
|
-
|
|
484
|
+
function emit(_x5) {
|
|
485
|
+
return _emit.apply(this, arguments);
|
|
451
486
|
}
|
|
452
487
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
this.events[name].forEach(function (fn) {
|
|
456
|
-
return fn.bind(_this).apply(void 0, [_objectSpread({
|
|
457
|
-
current: _this.current
|
|
458
|
-
}, opts)].concat(_toConsumableArray(others)));
|
|
459
|
-
});
|
|
460
|
-
}
|
|
488
|
+
return emit;
|
|
489
|
+
}()
|
|
461
490
|
}, {
|
|
462
491
|
key: "parentsIn",
|
|
463
492
|
value: function parentsIn(schema) {
|
|
@@ -930,7 +959,7 @@ var Designable = /*#__PURE__*/function () {
|
|
|
930
959
|
exports.Designable = Designable;
|
|
931
960
|
|
|
932
961
|
function useDesignable() {
|
|
933
|
-
var _useContext = (0, _react2.useContext)(
|
|
962
|
+
var _useContext = (0, _react2.useContext)(_context6.SchemaComponentContext),
|
|
934
963
|
designable = _useContext.designable,
|
|
935
964
|
setDesignable = _useContext.setDesignable,
|
|
936
965
|
refresh = _useContext.refresh,
|
|
@@ -9,6 +9,8 @@ var _react = require("@formily/react");
|
|
|
9
9
|
|
|
10
10
|
var _react2 = require("react");
|
|
11
11
|
|
|
12
|
+
var _useCompile = require("./useCompile");
|
|
13
|
+
|
|
12
14
|
var _collectionManager = require("../../collection-manager");
|
|
13
15
|
|
|
14
16
|
var useFieldTitle = function useFieldTitle() {
|
|
@@ -24,11 +26,12 @@ var useFieldTitle = function useFieldTitle() {
|
|
|
24
26
|
getCollectionJoinField = _useCollectionManager.getCollectionJoinField;
|
|
25
27
|
|
|
26
28
|
var collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
|
29
|
+
var compile = (0, _useCompile.useCompile)();
|
|
27
30
|
(0, _react2.useEffect)(function () {
|
|
28
31
|
if (!(field === null || field === void 0 ? void 0 : field.title)) {
|
|
29
32
|
var _collectionField$uiSc;
|
|
30
33
|
|
|
31
|
-
field.title = collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc = collectionField.uiSchema) === null || _collectionField$uiSc === void 0 ? void 0 : _collectionField$uiSc.title;
|
|
34
|
+
field.title = compile(collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc = collectionField.uiSchema) === null || _collectionField$uiSc === void 0 ? void 0 : _collectionField$uiSc.title);
|
|
32
35
|
}
|
|
33
36
|
}, [collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc2 = collectionField.uiSchema) === null || _collectionField$uiSc2 === void 0 ? void 0 : _collectionField$uiSc2.title]);
|
|
34
37
|
};
|
|
@@ -93,6 +93,7 @@ export declare const ReadPrettyFormActionInitializers: {
|
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
|
+
'x-decorator'?: undefined;
|
|
96
97
|
'x-acl-action'?: undefined;
|
|
97
98
|
'x-action-settings'?: undefined;
|
|
98
99
|
};
|
|
@@ -105,6 +106,7 @@ export declare const ReadPrettyFormActionInitializers: {
|
|
|
105
106
|
'x-component': string;
|
|
106
107
|
'x-designer': string;
|
|
107
108
|
'x-action': string;
|
|
109
|
+
'x-decorator': string;
|
|
108
110
|
'x-acl-action': string;
|
|
109
111
|
'x-action-settings': {
|
|
110
112
|
assignedValues: {};
|
|
@@ -148,6 +150,7 @@ export declare const ReadPrettyFormActionInitializers: {
|
|
|
148
150
|
};
|
|
149
151
|
type?: undefined;
|
|
150
152
|
properties?: undefined;
|
|
153
|
+
'x-decorator'?: undefined;
|
|
151
154
|
'x-acl-action'?: undefined;
|
|
152
155
|
};
|
|
153
156
|
})[];
|
|
@@ -104,6 +104,7 @@ var ReadPrettyFormActionInitializers = {
|
|
|
104
104
|
'x-component': 'Action',
|
|
105
105
|
'x-designer': 'Action.Designer',
|
|
106
106
|
'x-action': 'customize:update',
|
|
107
|
+
'x-decorator': 'ACLActionProvider',
|
|
107
108
|
'x-acl-action': 'update',
|
|
108
109
|
'x-action-settings': {
|
|
109
110
|
assignedValues: {},
|
|
@@ -191,6 +191,7 @@ var TableActionColumnInitializers = function TableActionColumnInitializers(props
|
|
|
191
191
|
title: '{{ t("Update record") }}',
|
|
192
192
|
'x-component': 'Action.Link',
|
|
193
193
|
'x-action': 'customize:update',
|
|
194
|
+
'x-decorator': 'ACLActionProvider',
|
|
194
195
|
'x-acl-action': 'update',
|
|
195
196
|
'x-designer': 'Action.Designer',
|
|
196
197
|
'x-action-settings': {
|
|
@@ -331,7 +331,6 @@ var useFormItemInitializerFields = function useFormItemInitializerFields(options
|
|
|
331
331
|
var schema = {
|
|
332
332
|
type: 'string',
|
|
333
333
|
name: field.name,
|
|
334
|
-
// title: field?.uiSchema?.title || field.name,
|
|
335
334
|
'x-designer': 'FormItem.Designer',
|
|
336
335
|
'x-component': field.interface === 'o2m' && !snapshot ? 'TableField' : 'CollectionField',
|
|
337
336
|
'x-decorator': 'FormItem',
|
|
@@ -406,7 +405,6 @@ var useAssociatedFormItemInitializerFields = function useAssociatedFormItemIniti
|
|
|
406
405
|
var schema = {
|
|
407
406
|
type: 'string',
|
|
408
407
|
name: "".concat(field.name, ".").concat(subField.name),
|
|
409
|
-
// title: subField?.uiSchema?.title || subField.name,
|
|
410
408
|
'x-designer': 'FormItem.Designer',
|
|
411
409
|
'x-component': 'CollectionField',
|
|
412
410
|
'x-read-pretty': readPretty,
|
|
@@ -415,8 +413,7 @@ var useAssociatedFormItemInitializerFields = function useAssociatedFormItemIniti
|
|
|
415
413
|
},
|
|
416
414
|
'x-decorator': 'FormItem',
|
|
417
415
|
'x-collection-field': "".concat(name, ".").concat(field.name, ".").concat(subField.name)
|
|
418
|
-
};
|
|
419
|
-
|
|
416
|
+
};
|
|
420
417
|
return {
|
|
421
418
|
type: 'item',
|
|
422
419
|
title: (subField === null || subField === void 0 ? void 0 : (_subField$uiSchema2 = subField.uiSchema) === null || _subField$uiSchema2 === void 0 ? void 0 : _subField$uiSchema2.title) || subField.name,
|
|
@@ -879,7 +876,7 @@ var createDetailsBlockSchema = function createDetailsBlockSchema(options) {
|
|
|
879
876
|
var resourceName = resource || association || collection;
|
|
880
877
|
var schema = {
|
|
881
878
|
type: 'void',
|
|
882
|
-
'x-acl-action': "".concat(resourceName, ":
|
|
879
|
+
'x-acl-action': "".concat(resourceName, ":view"),
|
|
883
880
|
'x-decorator': 'DetailsBlockProvider',
|
|
884
881
|
'x-decorator-props': _objectSpread({
|
|
885
882
|
resource: resourceName,
|
|
@@ -1051,8 +1048,8 @@ var createReadPrettyFormBlockSchema = function createReadPrettyFormBlockSchema(o
|
|
|
1051
1048
|
}
|
|
1052
1049
|
}
|
|
1053
1050
|
})
|
|
1054
|
-
};
|
|
1055
|
-
|
|
1051
|
+
}; // console.log(JSON.stringify(schema, null, 2));
|
|
1052
|
+
|
|
1056
1053
|
return schema;
|
|
1057
1054
|
};
|
|
1058
1055
|
|
|
@@ -1127,8 +1124,8 @@ var createTableBlockSchema = function createTableBlockSchema(options) {
|
|
|
1127
1124
|
}
|
|
1128
1125
|
}
|
|
1129
1126
|
})
|
|
1130
|
-
};
|
|
1131
|
-
|
|
1127
|
+
}; // console.log(JSON.stringify(schema, null, 2));
|
|
1128
|
+
|
|
1132
1129
|
return schema;
|
|
1133
1130
|
};
|
|
1134
1131
|
|
|
@@ -46,7 +46,7 @@ var BlockTemplate = (0, _react.observer)(function (props) {
|
|
|
46
46
|
var template = (0, _react2.useMemo)(function () {
|
|
47
47
|
return getTemplateById(templateId);
|
|
48
48
|
}, [templateId]);
|
|
49
|
-
return template ? /*#__PURE__*/_react2.default.createElement(
|
|
49
|
+
return template ? /*#__PURE__*/_react2.default.createElement(BlockTemplateContext.Provider, {
|
|
50
50
|
value: {
|
|
51
51
|
dn: dn,
|
|
52
52
|
field: field,
|
|
@@ -56,6 +56,6 @@ var BlockTemplate = (0, _react.observer)(function (props) {
|
|
|
56
56
|
}, /*#__PURE__*/_react2.default.createElement(_.RemoteSchemaComponent, {
|
|
57
57
|
noForm: true,
|
|
58
58
|
uid: template === null || template === void 0 ? void 0 : template.uid
|
|
59
|
-
}))
|
|
59
|
+
})) : null;
|
|
60
60
|
});
|
|
61
61
|
exports.BlockTemplate = BlockTemplate;
|
|
@@ -87,7 +87,7 @@ var SchemaTemplateManagerProvider = function SchemaTemplateManagerProvider(props
|
|
|
87
87
|
exports.SchemaTemplateManagerProvider = SchemaTemplateManagerProvider;
|
|
88
88
|
|
|
89
89
|
var regenerateUid = function regenerateUid(s) {
|
|
90
|
-
s['x-uid'] = (0, _shared.uid)();
|
|
90
|
+
s['name'] = s['x-uid'] = (0, _shared.uid)();
|
|
91
91
|
Object.keys(s.properties || {}).forEach(function (key) {
|
|
92
92
|
regenerateUid(s.properties[key]);
|
|
93
93
|
});
|
|
@@ -61,7 +61,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
61
61
|
|
|
62
62
|
var langs = Object.keys(_locale.default).map(function (lang) {
|
|
63
63
|
return {
|
|
64
|
-
label: _locale.default[lang].label,
|
|
64
|
+
label: "".concat(_locale.default[lang].label, " (").concat(lang, ")"),
|
|
65
65
|
value: lang
|
|
66
66
|
};
|
|
67
67
|
});
|
package/package.json
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-alpha.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"licenses": [
|
|
6
|
-
{
|
|
7
|
-
"type": "Apache-2.0",
|
|
8
|
-
"url": "http://www.apache.org/licenses/LICENSE-2.0"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
5
|
"main": "lib",
|
|
12
6
|
"module": "es/index.js",
|
|
13
7
|
"typings": "es/index.d.ts",
|
|
@@ -19,8 +13,8 @@
|
|
|
19
13
|
"@formily/antd": "2.0.20",
|
|
20
14
|
"@formily/core": "2.0.20",
|
|
21
15
|
"@formily/react": "2.0.20",
|
|
22
|
-
"@nocobase/sdk": "0.
|
|
23
|
-
"@nocobase/utils": "0.
|
|
16
|
+
"@nocobase/sdk": "0.9.0-alpha.2",
|
|
17
|
+
"@nocobase/utils": "0.9.0-alpha.2",
|
|
24
18
|
"ahooks": "^3.7.2",
|
|
25
19
|
"antd": "4.22.8",
|
|
26
20
|
"axios": "^0.26.1",
|
|
@@ -28,7 +22,8 @@
|
|
|
28
22
|
"cron-parser": "^4.6.0",
|
|
29
23
|
"cronstrue": "^2.11.0",
|
|
30
24
|
"file-saver": "^2.0.5",
|
|
31
|
-
"i18next": "^
|
|
25
|
+
"i18next": "^22.4.9",
|
|
26
|
+
"i18next-http-backend": "^2.1.1",
|
|
32
27
|
"json-templates": "^4.2.0",
|
|
33
28
|
"marked": "^4.0.12",
|
|
34
29
|
"mathjs": "^10.6.0",
|
|
@@ -60,5 +55,5 @@
|
|
|
60
55
|
"@types/marked": "^4.0.1",
|
|
61
56
|
"axios-mock-adapter": "^1.20.0"
|
|
62
57
|
},
|
|
63
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "b8f76ad38e60e677c5bb4aab0a4cdb28d98a0f49"
|
|
64
59
|
}
|
|
@@ -1,74 +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 { defaultProps, operators } from './properties';
|
|
8
|
-
export var formula = {
|
|
9
|
-
name: 'formula',
|
|
10
|
-
type: 'object',
|
|
11
|
-
group: 'advanced',
|
|
12
|
-
order: 1,
|
|
13
|
-
title: '{{t("Formula")}}',
|
|
14
|
-
description: '{{t("Formula description")}}',
|
|
15
|
-
sortable: true,
|
|
16
|
-
default: {
|
|
17
|
-
type: 'formula',
|
|
18
|
-
// name,
|
|
19
|
-
uiSchema: {
|
|
20
|
-
type: 'number',
|
|
21
|
-
// title,
|
|
22
|
-
"x-disabled": true,
|
|
23
|
-
'x-component': 'Formula.Result',
|
|
24
|
-
'x-component-props': {
|
|
25
|
-
stringMode: true,
|
|
26
|
-
step: '1'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
properties: _objectSpread(_objectSpread({}, defaultProps), {}, {
|
|
31
|
-
'expression': {
|
|
32
|
-
type: 'string',
|
|
33
|
-
title: '{{t("Expression")}}',
|
|
34
|
-
required: true,
|
|
35
|
-
description: '{{t("Input +, -, *, /, ( ) to calculate, input @ to open field variables.")}}',
|
|
36
|
-
'x-component': 'Formula.Expression',
|
|
37
|
-
'x-decorator': 'FormItem',
|
|
38
|
-
'x-component-props': {
|
|
39
|
-
'supports': ['number', 'percent', 'integer'],
|
|
40
|
-
'useCurrentFields': '{{ useCurrentFields }}'
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
'uiSchema.x-component-props.step': {
|
|
44
|
-
type: 'string',
|
|
45
|
-
title: '{{t("Precision")}}',
|
|
46
|
-
'x-component': 'Select',
|
|
47
|
-
'x-decorator': 'FormItem',
|
|
48
|
-
required: true,
|
|
49
|
-
default: '0',
|
|
50
|
-
enum: [{
|
|
51
|
-
value: '0',
|
|
52
|
-
label: '1'
|
|
53
|
-
}, {
|
|
54
|
-
value: '0.1',
|
|
55
|
-
label: '1.0'
|
|
56
|
-
}, {
|
|
57
|
-
value: '0.01',
|
|
58
|
-
label: '1.00'
|
|
59
|
-
}, {
|
|
60
|
-
value: '0.001',
|
|
61
|
-
label: '1.000'
|
|
62
|
-
}, {
|
|
63
|
-
value: '0.0001',
|
|
64
|
-
label: '1.0000'
|
|
65
|
-
}, {
|
|
66
|
-
value: '0.00001',
|
|
67
|
-
label: '1.00000'
|
|
68
|
-
}]
|
|
69
|
-
}
|
|
70
|
-
}),
|
|
71
|
-
filterable: {
|
|
72
|
-
operators: operators.number
|
|
73
|
-
}
|
|
74
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var _excluded = ["onChange"];
|
|
2
|
-
|
|
3
|
-
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; }
|
|
4
|
-
|
|
5
|
-
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; }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
-
|
|
11
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
-
|
|
13
|
-
import { onFormValuesChange } from '@formily/core';
|
|
14
|
-
import { connect, mapReadPretty, useFieldSchema, useFormEffects } from '@formily/react';
|
|
15
|
-
import { InputNumber } from 'antd';
|
|
16
|
-
import _ from 'lodash';
|
|
17
|
-
import * as math from 'mathjs';
|
|
18
|
-
import React from 'react';
|
|
19
|
-
import { useCollection } from '../../../collection-manager/hooks';
|
|
20
|
-
import { ReadPretty } from '../input-number/ReadPretty';
|
|
21
|
-
|
|
22
|
-
var AntdCompute = function AntdCompute(props) {
|
|
23
|
-
var onChange = props.onChange,
|
|
24
|
-
others = _objectWithoutProperties(props, _excluded);
|
|
25
|
-
|
|
26
|
-
var _useCollection = useCollection(),
|
|
27
|
-
getField = _useCollection.getField;
|
|
28
|
-
|
|
29
|
-
var fieldSchema = useFieldSchema();
|
|
30
|
-
var options = getField(fieldSchema.name);
|
|
31
|
-
var expression = options.expression;
|
|
32
|
-
useFormEffects(function () {
|
|
33
|
-
onFormValuesChange(function (form) {
|
|
34
|
-
var scope = _.cloneDeep(form.values);
|
|
35
|
-
|
|
36
|
-
var result;
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
result = math.evaluate(expression, scope);
|
|
40
|
-
result = Number.isFinite(result) ? math.round(result, 9) : null;
|
|
41
|
-
} catch (_unused) {}
|
|
42
|
-
|
|
43
|
-
if (onChange) {
|
|
44
|
-
onChange(result);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
return /*#__PURE__*/React.createElement(InputNumber, _objectSpread(_objectSpread({}, others), {}, {
|
|
49
|
-
readOnly: true,
|
|
50
|
-
stringMode: true
|
|
51
|
-
}));
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export var Compute = connect(AntdCompute, mapReadPretty(ReadPretty));
|
|
55
|
-
export default Compute;
|