@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.
Files changed (195) hide show
  1. package/es/acl/ACLProvider.d.ts +16 -2
  2. package/es/acl/ACLProvider.js +271 -100
  3. package/es/acl/Configuration/ConfigureCenter.d.ts +2 -0
  4. package/es/acl/Configuration/ConfigureCenter.js +254 -0
  5. package/es/acl/Configuration/MenuConfigure.js +2 -2
  6. package/es/acl/Configuration/PermisionProvider.d.ts +4 -0
  7. package/es/acl/Configuration/PermisionProvider.js +132 -0
  8. package/es/acl/Configuration/RoleConfigure.js +98 -23
  9. package/es/acl/Configuration/RoleTable.d.ts +1 -1
  10. package/es/acl/Configuration/RoleTable.js +6 -3
  11. package/es/acl/Configuration/RolesResourcesActions.js +2 -2
  12. package/es/acl/Configuration/index.d.ts +1 -0
  13. package/es/acl/Configuration/index.js +2 -1
  14. package/es/acl/Configuration/schemas/roleCollections.js +41 -13
  15. package/es/acl/Configuration/schemas/roles.js +42 -2
  16. package/es/acl/Configuration/schemas/scopes.js +2 -0
  17. package/es/acl/index.d.ts +1 -0
  18. package/es/acl/index.js +2 -1
  19. package/es/acl/style.less +10 -0
  20. package/es/antd-config-provider/index.d.ts +3 -1
  21. package/es/antd-config-provider/index.js +25 -6
  22. package/es/antd-config-provider/loadConstrueLocale.d.ts +1 -0
  23. package/es/antd-config-provider/loadConstrueLocale.js +293 -0
  24. package/es/api-client/APIClient.js +5 -0
  25. package/es/block-provider/FormBlockProvider.js +5 -2
  26. package/es/block-provider/KanbanBlockProvider.js +3 -3
  27. package/es/block-provider/SharedFilterProvider.d.ts +1 -0
  28. package/es/block-provider/SharedFilterProvider.js +22 -6
  29. package/es/collection-manager/CollectionHistoryProvider.js +14 -2
  30. package/es/collection-manager/hooks/useCollection.d.ts +1 -0
  31. package/es/collection-manager/hooks/useCollection.js +10 -0
  32. package/es/collection-manager/interfaces/index.d.ts +0 -1
  33. package/es/collection-manager/interfaces/index.js +0 -1
  34. package/es/collection-manager/interfaces/o2m.js +1 -0
  35. package/es/collection-manager/interfaces/properties/operators.js +7 -0
  36. package/es/collection-manager/interfaces/subTable.js +1 -0
  37. package/es/collection-manager/templates/calendar.js +5 -0
  38. package/es/formula/Expression.d.ts +2 -0
  39. package/es/formula/Expression.js +296 -0
  40. package/es/formula/Result.d.ts +2 -0
  41. package/es/formula/Result.js +91 -0
  42. package/es/formula/index.d.ts +6 -0
  43. package/es/formula/index.js +8 -0
  44. package/es/i18n/i18n.js +7 -12
  45. package/es/index.d.ts +2 -1
  46. package/es/index.js +3 -2
  47. package/es/locale/en_US.d.ts +108 -28
  48. package/es/locale/en_US.js +108 -28
  49. package/es/locale/index.d.ts +201 -4
  50. package/es/locale/index.js +191 -58
  51. package/es/locale/ja_JP.d.ts +4 -0
  52. package/es/locale/ja_JP.js +4 -0
  53. package/es/locale/zh_CN.d.ts +11 -1
  54. package/es/locale/zh_CN.js +12 -2
  55. package/es/plugin-manager/PluginManager.js +19 -13
  56. package/es/pm/PluginManagerLink.js +38 -43
  57. package/es/pm/index.d.ts +1 -0
  58. package/es/pm/index.js +84 -35
  59. package/es/record-provider/index.d.ts +1 -0
  60. package/es/record-provider/index.js +7 -4
  61. package/es/route-switch/antd/admin-layout/index.d.ts +1 -0
  62. package/es/route-switch/antd/admin-layout/index.js +4 -6
  63. package/es/schema-component/antd/action/Action.js +19 -16
  64. package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +24 -23
  65. package/es/schema-component/antd/cron/Cron.d.ts +0 -1
  66. package/es/schema-component/antd/cron/Cron.js +16 -19
  67. package/es/schema-component/antd/cron/locale/index.d.ts +37 -0
  68. package/es/schema-component/antd/cron/locale/index.js +6 -0
  69. package/es/schema-component/antd/filter/useFilterActionProps.js +17 -23
  70. package/es/schema-component/antd/form-item/FormItem.js +5 -4
  71. package/es/schema-component/antd/index.d.ts +1 -2
  72. package/es/schema-component/antd/index.js +1 -2
  73. package/es/schema-component/antd/page/FixedBlock.d.ts +1 -1
  74. package/es/schema-component/antd/page/FixedBlock.js +70 -21
  75. package/es/schema-component/antd/page/Page.js +15 -10
  76. package/es/schema-component/antd/remote-select/RemoteSelect.js +12 -2
  77. package/es/schema-component/antd/table/Table.Array.js +1 -1
  78. package/es/schema-component/antd/table-v2/Table.js +13 -6
  79. package/es/schema-component/antd/table-v2/TableBlockDesigner.js +24 -8
  80. package/es/schema-component/hooks/useDesignable.d.ts +1 -1
  81. package/es/schema-component/hooks/useDesignable.js +45 -16
  82. package/es/schema-component/hooks/useFieldTitle.js +3 -1
  83. package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +3 -0
  84. package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +1 -0
  85. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -0
  86. package/es/schema-initializer/utils.js +6 -9
  87. package/es/schema-templates/BlockTemplate.js +2 -2
  88. package/es/schema-templates/SchemaTemplateManagerProvider.js +1 -1
  89. package/es/system-settings/SystemSettingsShortcut.js +1 -1
  90. package/lib/acl/ACLProvider.d.ts +16 -2
  91. package/lib/acl/ACLProvider.js +283 -102
  92. package/lib/acl/Configuration/ConfigureCenter.d.ts +2 -0
  93. package/lib/acl/Configuration/ConfigureCenter.js +278 -0
  94. package/lib/acl/Configuration/MenuConfigure.js +3 -3
  95. package/lib/acl/Configuration/PermisionProvider.d.ts +4 -0
  96. package/lib/acl/Configuration/PermisionProvider.js +156 -0
  97. package/lib/acl/Configuration/RoleConfigure.js +107 -23
  98. package/lib/acl/Configuration/RoleTable.d.ts +1 -1
  99. package/lib/acl/Configuration/RoleTable.js +8 -4
  100. package/lib/acl/Configuration/RolesResourcesActions.js +2 -2
  101. package/lib/acl/Configuration/index.d.ts +1 -0
  102. package/lib/acl/Configuration/index.js +15 -1
  103. package/lib/acl/Configuration/schemas/roleCollections.js +41 -13
  104. package/lib/acl/Configuration/schemas/roles.js +47 -2
  105. package/lib/acl/Configuration/schemas/scopes.js +2 -0
  106. package/lib/acl/index.d.ts +1 -0
  107. package/lib/acl/index.js +3 -1
  108. package/lib/acl/style.less +10 -0
  109. package/lib/antd-config-provider/index.d.ts +3 -1
  110. package/lib/antd-config-provider/index.js +40 -6
  111. package/lib/antd-config-provider/loadConstrueLocale.d.ts +1 -0
  112. package/lib/antd-config-provider/loadConstrueLocale.js +304 -0
  113. package/lib/api-client/APIClient.js +5 -0
  114. package/lib/block-provider/FormBlockProvider.js +9 -3
  115. package/lib/block-provider/KanbanBlockProvider.js +3 -3
  116. package/lib/block-provider/SharedFilterProvider.d.ts +1 -0
  117. package/lib/block-provider/SharedFilterProvider.js +26 -7
  118. package/lib/collection-manager/CollectionHistoryProvider.js +14 -1
  119. package/lib/collection-manager/hooks/useCollection.d.ts +1 -0
  120. package/lib/collection-manager/hooks/useCollection.js +10 -0
  121. package/lib/collection-manager/interfaces/index.d.ts +0 -1
  122. package/lib/collection-manager/interfaces/index.js +0 -13
  123. package/lib/collection-manager/interfaces/o2m.js +1 -0
  124. package/lib/collection-manager/interfaces/properties/operators.js +7 -0
  125. package/lib/collection-manager/interfaces/subTable.js +1 -0
  126. package/lib/collection-manager/templates/calendar.js +5 -0
  127. package/lib/formula/Expression.d.ts +2 -0
  128. package/lib/formula/Expression.js +319 -0
  129. package/lib/formula/Result.d.ts +2 -0
  130. package/lib/formula/Result.js +114 -0
  131. package/lib/formula/index.d.ts +6 -0
  132. package/lib/formula/index.js +22 -0
  133. package/lib/i18n/i18n.js +7 -14
  134. package/lib/index.d.ts +2 -1
  135. package/lib/index.js +26 -13
  136. package/lib/locale/en_US.d.ts +108 -28
  137. package/lib/locale/en_US.js +108 -28
  138. package/lib/locale/index.d.ts +201 -4
  139. package/lib/locale/index.js +197 -67
  140. package/lib/locale/ja_JP.d.ts +4 -0
  141. package/lib/locale/ja_JP.js +4 -0
  142. package/lib/locale/zh_CN.d.ts +11 -1
  143. package/lib/locale/zh_CN.js +12 -2
  144. package/lib/plugin-manager/PluginManager.js +20 -13
  145. package/lib/pm/PluginManagerLink.js +37 -43
  146. package/lib/pm/index.d.ts +1 -0
  147. package/lib/pm/index.js +90 -35
  148. package/lib/record-provider/index.d.ts +1 -0
  149. package/lib/record-provider/index.js +7 -4
  150. package/lib/route-switch/antd/admin-layout/index.d.ts +1 -0
  151. package/lib/route-switch/antd/admin-layout/index.js +5 -4
  152. package/lib/schema-component/antd/action/Action.js +19 -16
  153. package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +22 -21
  154. package/lib/schema-component/antd/cron/Cron.d.ts +0 -1
  155. package/lib/schema-component/antd/cron/Cron.js +19 -24
  156. package/lib/schema-component/antd/cron/locale/index.d.ts +37 -0
  157. package/lib/schema-component/antd/cron/locale/index.js +18 -0
  158. package/lib/schema-component/antd/filter/useFilterActionProps.js +16 -23
  159. package/lib/schema-component/antd/form-item/FormItem.js +6 -4
  160. package/lib/schema-component/antd/index.d.ts +1 -2
  161. package/lib/schema-component/antd/index.js +8 -21
  162. package/lib/schema-component/antd/page/FixedBlock.d.ts +1 -1
  163. package/lib/schema-component/antd/page/FixedBlock.js +71 -21
  164. package/lib/schema-component/antd/page/Page.js +14 -9
  165. package/lib/schema-component/antd/remote-select/RemoteSelect.js +18 -3
  166. package/lib/schema-component/antd/table/Table.Array.js +1 -1
  167. package/lib/schema-component/antd/table-v2/Table.js +14 -6
  168. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +25 -8
  169. package/lib/schema-component/hooks/useDesignable.d.ts +1 -1
  170. package/lib/schema-component/hooks/useDesignable.js +47 -18
  171. package/lib/schema-component/hooks/useFieldTitle.js +4 -1
  172. package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +3 -0
  173. package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +1 -0
  174. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -0
  175. package/lib/schema-initializer/utils.js +6 -9
  176. package/lib/schema-templates/BlockTemplate.js +2 -2
  177. package/lib/schema-templates/SchemaTemplateManagerProvider.js +1 -1
  178. package/lib/system-settings/SystemSettingsShortcut.js +1 -1
  179. package/package.json +6 -11
  180. package/es/collection-manager/interfaces/formula.d.ts +0 -2
  181. package/es/collection-manager/interfaces/formula.js +0 -74
  182. package/es/schema-component/antd/formula-input/Compute.d.ts +0 -3
  183. package/es/schema-component/antd/formula-input/Compute.js +0 -55
  184. package/es/schema-component/antd/formula-input/FormulaInput.d.ts +0 -3
  185. package/es/schema-component/antd/formula-input/FormulaInput.js +0 -167
  186. package/es/schema-component/antd/formula-input/index.d.ts +0 -1
  187. package/es/schema-component/antd/formula-input/index.js +0 -7
  188. package/lib/collection-manager/interfaces/formula.d.ts +0 -2
  189. package/lib/collection-manager/interfaces/formula.js +0 -83
  190. package/lib/schema-component/antd/formula-input/Compute.d.ts +0 -3
  191. package/lib/schema-component/antd/formula-input/Compute.js +0 -79
  192. package/lib/schema-component/antd/formula-input/FormulaInput.d.ts +0 -3
  193. package/lib/schema-component/antd/formula-input/FormulaInput.js +0 -191
  194. package/lib/schema-component/antd/formula-input/index.d.ts +0 -1
  195. package/lib/schema-component/antd/formula-input/index.js +0 -18
@@ -14,18 +14,34 @@ var collection = {
14
14
  'x-component': 'Input',
15
15
  required: true
16
16
  }
17
- }, // {
18
- // type: 'string',
19
- // name: 'name',
20
- // interface: 'input',
21
- // uiSchema: {
22
- // title: '数据表标识',
23
- // type: 'string',
24
- // 'x-component': 'Input',
25
- // description: '使用英文',
26
- // } as ISchema,
27
- // },
28
- {
17
+ }, {
18
+ type: 'string',
19
+ name: 'name',
20
+ interface: 'input',
21
+ uiSchema: {
22
+ title: '{{t("Collection name")}}',
23
+ type: 'string',
24
+ 'x-component': 'Input'
25
+ }
26
+ }, {
27
+ type: 'string',
28
+ name: 'type',
29
+ interface: 'input',
30
+ uiSchema: {
31
+ title: '{{t("Resource type")}}',
32
+ type: 'string',
33
+ 'x-component': 'Select',
34
+ enum: [{
35
+ label: '{{t("Collection")}}',
36
+ value: 'collection',
37
+ color: 'green'
38
+ }, {
39
+ label: '{{t("Association")}}',
40
+ value: 'association',
41
+ color: 'blue'
42
+ }]
43
+ }
44
+ }, {
29
45
  type: 'string',
30
46
  name: 'usingConfig',
31
47
  interface: 'input',
@@ -91,7 +107,7 @@ export var roleCollectionsSchema = {
91
107
  useDataSource: '{{ cm.useDataSourceFromRAC }}'
92
108
  },
93
109
  properties: {
94
- column1: {
110
+ column0: {
95
111
  type: 'void',
96
112
  'x-decorator': 'Table.Column.Decorator',
97
113
  'x-component': 'Table.Column',
@@ -103,6 +119,18 @@ export var roleCollectionsSchema = {
103
119
  }
104
120
  }
105
121
  },
122
+ // column1: {
123
+ // type: 'void',
124
+ // 'x-decorator': 'Table.Column.Decorator',
125
+ // 'x-component': 'Table.Column',
126
+ // properties: {
127
+ // type: {
128
+ // type: 'string',
129
+ // 'x-component': 'CollectionField',
130
+ // 'x-read-pretty': true,
131
+ // },
132
+ // },
133
+ // },
106
134
  column2: {
107
135
  type: 'void',
108
136
  'x-decorator': 'Table.Column.Decorator',
@@ -5,7 +5,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
5
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
6
 
7
7
  import { uid } from '@formily/shared';
8
+ import pick from 'lodash/pick';
9
+ import { useEffect } from 'react';
8
10
  import { useRequest } from '../../../api-client';
11
+ import { useRecord } from '../../../record-provider';
9
12
  import { useActionContext } from '../../../schema-component';
10
13
  import { roleCollectionsSchema } from './roleCollections';
11
14
  var collection = {
@@ -109,7 +112,8 @@ export var roleSchema = {
109
112
  return useRequest(function () {
110
113
  return Promise.resolve({
111
114
  data: {
112
- name: "r_".concat(uid())
115
+ name: "r_".concat(uid()),
116
+ snippets: ['!ui.*', '!pm', '!pm.*']
113
117
  }
114
118
  });
115
119
  }, _objectSpread(_objectSpread({}, options), {}, {
@@ -225,11 +229,14 @@ export var roleSchema = {
225
229
  type: 'void',
226
230
  title: '{{t("Configure")}}',
227
231
  'x-component': 'Action.Link',
232
+ 'x-decorator': 'ACLActionProvider',
233
+ 'x-acl-action': 'roles:update',
228
234
  'x-component-props': {},
229
235
  properties: {
230
236
  drawer: {
231
237
  type: 'void',
232
238
  'x-component': 'Action.Drawer',
239
+ 'x-decorator': 'PermissionProvider',
233
240
  title: '{{t("Configure permissions")}}',
234
241
  properties: {
235
242
  tabs1: {
@@ -268,6 +275,19 @@ export var roleSchema = {
268
275
  'x-component': 'MenuConfigure'
269
276
  }
270
277
  }
278
+ },
279
+ tab4: {
280
+ type: 'void',
281
+ title: '{{t("Plugin settings permissions")}}',
282
+ 'x-decorator': 'SettingCenterPermissionProvider',
283
+ 'x-component': 'Tabs.TabPane',
284
+ 'x-component-props': {},
285
+ properties: {
286
+ menu: {
287
+ 'x-decorator': 'SettingCenterProvider',
288
+ 'x-component': 'SettingsCenterConfigure'
289
+ }
290
+ }
271
291
  }
272
292
  }
273
293
  }
@@ -278,6 +298,8 @@ export var roleSchema = {
278
298
  update: {
279
299
  type: 'void',
280
300
  title: '{{t("Edit")}}',
301
+ 'x-decorator': 'ACLActionProvider',
302
+ 'x-acl-action': 'roles:update',
281
303
  'x-component': 'Action.Link',
282
304
  'x-component-props': {
283
305
  type: 'primary'
@@ -288,7 +310,23 @@ export var roleSchema = {
288
310
  'x-component': 'Action.Drawer',
289
311
  'x-decorator': 'Form',
290
312
  'x-decorator-props': {
291
- useValues: '{{ cm.useValuesFromRecord }}'
313
+ useValues: function useValues(options) {
314
+ var record = useRecord();
315
+ var result = useRequest(function () {
316
+ return Promise.resolve({
317
+ data: pick(record, ['title', 'name', 'default'])
318
+ });
319
+ }, _objectSpread(_objectSpread({}, options), {}, {
320
+ manual: true
321
+ }));
322
+ var ctx = useActionContext();
323
+ useEffect(function () {
324
+ if (ctx.visible) {
325
+ result.run();
326
+ }
327
+ }, [ctx.visible]);
328
+ return result;
329
+ }
292
330
  },
293
331
  title: '{{t("Edit role")}}',
294
332
  properties: {
@@ -335,6 +373,8 @@ export var roleSchema = {
335
373
  delete: {
336
374
  type: 'void',
337
375
  title: '{{ t("Delete") }}',
376
+ 'x-acl-action': 'roles:destroy',
377
+ 'x-decorator': 'ACLActionProvider',
338
378
  'x-component': 'Action.Link',
339
379
  'x-component-props': {
340
380
  confirm: {
@@ -224,6 +224,7 @@ export var scopesSchema = {
224
224
  type: 'void',
225
225
  title: '{{ t("Edit") }}',
226
226
  'x-action': 'update',
227
+ 'x-decorator': 'ACLActionProvider',
227
228
  'x-component': 'Action.Link',
228
229
  'x-component-props': {
229
230
  openMode: 'drawer',
@@ -310,6 +311,7 @@ export var scopesSchema = {
310
311
  destroy: {
311
312
  title: '{{ t("Delete") }}',
312
313
  'x-action': 'destroy',
314
+ 'x-decorator': 'ACLActionProvider',
313
315
  'x-component': 'Action.Link',
314
316
  'x-designer': 'Action.Designer',
315
317
  'x-component-props': {
package/es/acl/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './ACLProvider';
2
2
  export * from './ACLShortcut';
3
+ import './style.less';
package/es/acl/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './ACLProvider';
2
- export * from './ACLShortcut';
2
+ export * from './ACLShortcut';
3
+ import './style.less';
@@ -0,0 +1,10 @@
1
+ .ant-table-cell {
2
+ > .ant-space-horizontal {
3
+ .ant-space-item:empty:not(:last-child) + .ant-space-item-split {
4
+ display: none;
5
+ }
6
+ .ant-space-item-split:has(+ .ant-space-item:empty) {
7
+ display: none;
8
+ }
9
+ }
10
+ }
@@ -1,2 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
+ export declare const AppLangContext: React.Context<any>;
3
+ export declare const useAppLangContext: () => any;
2
4
  export declare function AntdConfigProvider(props: any): JSX.Element;
@@ -11,11 +11,18 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
11
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
12
 
13
13
  import { ConfigProvider, Spin } from 'antd';
14
- import React from 'react';
14
+ import moment from 'moment';
15
+ import React, { createContext, useContext } from 'react';
15
16
  import { useTranslation } from 'react-i18next';
16
17
  import { useAPIClient, useRequest } from '../api-client';
17
- import locale from '../locale';
18
+ import { loadConstrueLocale } from './loadConstrueLocale';
19
+ export var AppLangContext = /*#__PURE__*/createContext({});
20
+ export var useAppLangContext = function useAppLangContext() {
21
+ return useContext(AppLangContext);
22
+ };
18
23
  export function AntdConfigProvider(props) {
24
+ var _data$data9;
25
+
19
26
  var remoteLocale = props.remoteLocale,
20
27
  others = _objectWithoutProperties(props, _excluded);
21
28
 
@@ -28,7 +35,7 @@ export function AntdConfigProvider(props) {
28
35
  url: 'app:getLang'
29
36
  }, {
30
37
  onSuccess: function onSuccess(data) {
31
- var _data$data;
38
+ var _data$data, _data$data4, _data$data7, _data$data8;
32
39
 
33
40
  var locale = api.auth.locale;
34
41
 
@@ -38,18 +45,30 @@ export function AntdConfigProvider(props) {
38
45
  api.auth.setLocale(data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.lang);
39
46
  i18n.changeLanguage(data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3.lang);
40
47
  }
48
+
49
+ Object.keys((data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : _data$data4.resources) || {}).forEach(function (key) {
50
+ var _data$data5, _data$data6;
51
+
52
+ i18n.addResources(data === null || data === void 0 ? void 0 : (_data$data5 = data.data) === null || _data$data5 === void 0 ? void 0 : _data$data5.lang, key, (data === null || data === void 0 ? void 0 : (_data$data6 = data.data) === null || _data$data6 === void 0 ? void 0 : _data$data6.resources[key]) || {});
53
+ });
54
+ loadConstrueLocale(data === null || data === void 0 ? void 0 : data.data);
55
+ moment.locale(data === null || data === void 0 ? void 0 : (_data$data7 = data.data) === null || _data$data7 === void 0 ? void 0 : _data$data7.moment);
56
+ window['cronLocale'] = data === null || data === void 0 ? void 0 : (_data$data8 = data.data) === null || _data$data8 === void 0 ? void 0 : _data$data8.cron;
41
57
  },
42
58
  manual: !remoteLocale
43
59
  }),
60
+ data = _useRequest.data,
44
61
  loading = _useRequest.loading;
45
62
 
46
63
  if (loading) {
47
64
  return /*#__PURE__*/React.createElement(Spin, null);
48
65
  }
49
66
 
50
- return /*#__PURE__*/React.createElement(ConfigProvider, _objectSpread(_objectSpread({
67
+ return /*#__PURE__*/React.createElement(AppLangContext.Provider, {
68
+ value: data === null || data === void 0 ? void 0 : data.data
69
+ }, /*#__PURE__*/React.createElement(ConfigProvider, _objectSpread(_objectSpread({
51
70
  dropdownMatchSelectWidth: false
52
71
  }, others), {}, {
53
- locale: locale[i18n.language].antd
54
- }), props.children);
72
+ locale: (data === null || data === void 0 ? void 0 : (_data$data9 = data.data) === null || _data$data9 === void 0 ? void 0 : _data$data9.antd) || {}
73
+ }), props.children));
55
74
  }
@@ -0,0 +1 @@
1
+ export declare const loadConstrueLocale: (data: any) => void;
@@ -0,0 +1,293 @@
1
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2
+
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4
+
5
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
+
7
+ import cronstrue from 'cronstrue';
8
+
9
+ var CronstrueLocale = /*#__PURE__*/function () {
10
+ function CronstrueLocale(data) {
11
+ _classCallCheck(this, CronstrueLocale);
12
+
13
+ this.data = void 0;
14
+ this.data = data;
15
+ }
16
+
17
+ _createClass(CronstrueLocale, [{
18
+ key: "atX0SecondsPastTheMinuteGt20",
19
+ value: function atX0SecondsPastTheMinuteGt20() {
20
+ return this.data['atX0SecondsPastTheMinuteGt20'];
21
+ }
22
+ }, {
23
+ key: "atX0MinutesPastTheHourGt20",
24
+ value: function atX0MinutesPastTheHourGt20() {
25
+ return this.data['atX0MinutesPastTheHourGt20'];
26
+ }
27
+ }, {
28
+ key: "commaMonthX0ThroughMonthX1",
29
+ value: function commaMonthX0ThroughMonthX1() {
30
+ return this.data['commaMonthX0ThroughMonthX1'];
31
+ }
32
+ }, {
33
+ key: "commaYearX0ThroughYearX1",
34
+ value: function commaYearX0ThroughYearX1() {
35
+ return this.data['commaYearX0ThroughYearX1'];
36
+ }
37
+ }, {
38
+ key: "use24HourTimeFormatByDefault",
39
+ value: function use24HourTimeFormatByDefault() {
40
+ return this.data['use24HourTimeFormatByDefault'];
41
+ }
42
+ }, {
43
+ key: "anErrorOccuredWhenGeneratingTheExpressionD",
44
+ value: function anErrorOccuredWhenGeneratingTheExpressionD() {
45
+ return this.data['anErrorOccuredWhenGeneratingTheExpressionD'];
46
+ }
47
+ }, {
48
+ key: "everyMinute",
49
+ value: function everyMinute() {
50
+ return this.data['everyMinute'];
51
+ }
52
+ }, {
53
+ key: "everyHour",
54
+ value: function everyHour() {
55
+ return this.data['everyHour'];
56
+ }
57
+ }, {
58
+ key: "atSpace",
59
+ value: function atSpace() {
60
+ return this.data['atSpace'];
61
+ }
62
+ }, {
63
+ key: "everyMinuteBetweenX0AndX1",
64
+ value: function everyMinuteBetweenX0AndX1() {
65
+ return this.data['everyMinuteBetweenX0AndX1'];
66
+ }
67
+ }, {
68
+ key: "at",
69
+ value: function at() {
70
+ return this.data['at'];
71
+ }
72
+ }, {
73
+ key: "spaceAnd",
74
+ value: function spaceAnd() {
75
+ return this.data['spaceAnd'];
76
+ }
77
+ }, {
78
+ key: "everySecond",
79
+ value: function everySecond() {
80
+ return this.data['everySecond'];
81
+ }
82
+ }, {
83
+ key: "everyX0Seconds",
84
+ value: function everyX0Seconds() {
85
+ return this.data['everyX0Seconds'];
86
+ }
87
+ }, {
88
+ key: "secondsX0ThroughX1PastTheMinute",
89
+ value: function secondsX0ThroughX1PastTheMinute() {
90
+ return this.data['secondsX0ThroughX1PastTheMinute'];
91
+ }
92
+ }, {
93
+ key: "atX0SecondsPastTheMinute",
94
+ value: function atX0SecondsPastTheMinute() {
95
+ return this.data['atX0SecondsPastTheMinute'];
96
+ }
97
+ }, {
98
+ key: "everyX0Minutes",
99
+ value: function everyX0Minutes() {
100
+ return this.data['everyX0Minutes'];
101
+ }
102
+ }, {
103
+ key: "minutesX0ThroughX1PastTheHour",
104
+ value: function minutesX0ThroughX1PastTheHour() {
105
+ return this.data['minutesX0ThroughX1PastTheHour'];
106
+ }
107
+ }, {
108
+ key: "atX0MinutesPastTheHour",
109
+ value: function atX0MinutesPastTheHour() {
110
+ return this.data['atX0MinutesPastTheHour'];
111
+ }
112
+ }, {
113
+ key: "everyX0Hours",
114
+ value: function everyX0Hours() {
115
+ return this.data['everyX0Hours'];
116
+ }
117
+ }, {
118
+ key: "betweenX0AndX1",
119
+ value: function betweenX0AndX1() {
120
+ return this.data['betweenX0AndX1'];
121
+ }
122
+ }, {
123
+ key: "atX0",
124
+ value: function atX0() {
125
+ return this.data['atX0'];
126
+ }
127
+ }, {
128
+ key: "commaEveryDay",
129
+ value: function commaEveryDay() {
130
+ return this.data['commaEveryDay'];
131
+ }
132
+ }, {
133
+ key: "commaEveryX0DaysOfTheWeek",
134
+ value: function commaEveryX0DaysOfTheWeek() {
135
+ return this.data['commaEveryX0DaysOfTheWeek'];
136
+ }
137
+ }, {
138
+ key: "commaX0ThroughX1",
139
+ value: function commaX0ThroughX1() {
140
+ return this.data['commaX0ThroughX1'];
141
+ }
142
+ }, {
143
+ key: "commaAndX0ThroughX1",
144
+ value: function commaAndX0ThroughX1() {
145
+ return this.data['commaAndX0ThroughX1'];
146
+ }
147
+ }, {
148
+ key: "first",
149
+ value: function first() {
150
+ return this.data['first'];
151
+ }
152
+ }, {
153
+ key: "second",
154
+ value: function second() {
155
+ return this.data['second'];
156
+ }
157
+ }, {
158
+ key: "third",
159
+ value: function third() {
160
+ return this.data['third'];
161
+ }
162
+ }, {
163
+ key: "fourth",
164
+ value: function fourth() {
165
+ return this.data['fourth'];
166
+ }
167
+ }, {
168
+ key: "fifth",
169
+ value: function fifth() {
170
+ return this.data['fifth'];
171
+ }
172
+ }, {
173
+ key: "commaOnThe",
174
+ value: function commaOnThe() {
175
+ return this.data['commaOnThe'];
176
+ }
177
+ }, {
178
+ key: "spaceX0OfTheMonth",
179
+ value: function spaceX0OfTheMonth() {
180
+ return this.data['spaceX0OfTheMonth'];
181
+ }
182
+ }, {
183
+ key: "lastDay",
184
+ value: function lastDay() {
185
+ return this.data['lastDay'];
186
+ }
187
+ }, {
188
+ key: "commaOnTheLastX0OfTheMonth",
189
+ value: function commaOnTheLastX0OfTheMonth() {
190
+ return this.data['commaOnTheLastX0OfTheMonth'];
191
+ }
192
+ }, {
193
+ key: "commaOnlyOnX0",
194
+ value: function commaOnlyOnX0() {
195
+ return this.data['commaOnlyOnX0'];
196
+ }
197
+ }, {
198
+ key: "commaAndOnX0",
199
+ value: function commaAndOnX0() {
200
+ return this.data['commaAndOnX0'];
201
+ }
202
+ }, {
203
+ key: "commaEveryX0Months",
204
+ value: function commaEveryX0Months() {
205
+ return this.data['commaEveryX0Months'];
206
+ }
207
+ }, {
208
+ key: "commaOnlyInX0",
209
+ value: function commaOnlyInX0() {
210
+ return this.data['commaOnlyInX0'];
211
+ }
212
+ }, {
213
+ key: "commaOnTheLastDayOfTheMonth",
214
+ value: function commaOnTheLastDayOfTheMonth() {
215
+ return this.data['commaOnTheLastDayOfTheMonth'];
216
+ }
217
+ }, {
218
+ key: "commaOnTheLastWeekdayOfTheMonth",
219
+ value: function commaOnTheLastWeekdayOfTheMonth() {
220
+ return this.data['commaOnTheLastWeekdayOfTheMonth'];
221
+ }
222
+ }, {
223
+ key: "commaDaysBeforeTheLastDayOfTheMonth",
224
+ value: function commaDaysBeforeTheLastDayOfTheMonth() {
225
+ return this.data['commaDaysBeforeTheLastDayOfTheMonth'];
226
+ }
227
+ }, {
228
+ key: "firstWeekday",
229
+ value: function firstWeekday() {
230
+ return this.data['firstWeekday'];
231
+ }
232
+ }, {
233
+ key: "weekdayNearestDayX0",
234
+ value: function weekdayNearestDayX0() {
235
+ return this.data['weekdayNearestDayX0'];
236
+ }
237
+ }, {
238
+ key: "commaOnTheX0OfTheMonth",
239
+ value: function commaOnTheX0OfTheMonth() {
240
+ return this.data['commaOnTheX0OfTheMonth'];
241
+ }
242
+ }, {
243
+ key: "commaEveryX0Days",
244
+ value: function commaEveryX0Days() {
245
+ return this.data['commaEveryX0Days'];
246
+ }
247
+ }, {
248
+ key: "commaBetweenDayX0AndX1OfTheMonth",
249
+ value: function commaBetweenDayX0AndX1OfTheMonth() {
250
+ return this.data['commaBetweenDayX0AndX1OfTheMonth'];
251
+ }
252
+ }, {
253
+ key: "commaOnDayX0OfTheMonth",
254
+ value: function commaOnDayX0OfTheMonth() {
255
+ return this.data['commaOnDayX0OfTheMonth'];
256
+ }
257
+ }, {
258
+ key: "commaEveryHour",
259
+ value: function commaEveryHour() {
260
+ return this.data['commaEveryHour'];
261
+ }
262
+ }, {
263
+ key: "commaEveryX0Years",
264
+ value: function commaEveryX0Years() {
265
+ return this.data['commaEveryX0Years'];
266
+ }
267
+ }, {
268
+ key: "commaStartingX0",
269
+ value: function commaStartingX0() {
270
+ return this.data['commaStartingX0'];
271
+ }
272
+ }, {
273
+ key: "daysOfTheWeek",
274
+ value: function daysOfTheWeek() {
275
+ return this.data['daysOfTheWeek'];
276
+ }
277
+ }, {
278
+ key: "monthsOfTheYear",
279
+ value: function monthsOfTheYear() {
280
+ return this.data['monthsOfTheYear'];
281
+ }
282
+ }]);
283
+
284
+ return CronstrueLocale;
285
+ }();
286
+
287
+ export var loadConstrueLocale = function loadConstrueLocale(data) {
288
+ cronstrue.initialize({
289
+ load: function load(availableLocales) {
290
+ availableLocales[data === null || data === void 0 ? void 0 : data.lang] = new CronstrueLocale(data === null || data === void 0 ? void 0 : data.cronstrue);
291
+ }
292
+ });
293
+ };
@@ -74,6 +74,11 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
74
74
  }, {
75
75
  key: "interceptors",
76
76
  value: function interceptors() {
77
+ this.axios.interceptors.request.use(function (config) {
78
+ config.headers['X-With-ACL-Meta'] = true;
79
+ return config;
80
+ });
81
+
77
82
  _get(_getPrototypeOf(APIClient.prototype), "interceptors", this).call(this);
78
83
 
79
84
  this.notification();
@@ -7,11 +7,12 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
7
7
  import { createForm } from '@formily/core';
8
8
  import { useField } from '@formily/react';
9
9
  import { Spin } from 'antd';
10
+ import isEmpty from 'lodash/isEmpty';
10
11
  import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react';
12
+ import { useCollectionManager } from '../collection-manager';
11
13
  import { RecordProvider, useRecord } from '../record-provider';
12
- import { BlockProvider, useBlockRequestContext } from './BlockProvider';
13
14
  import { useDesignable } from '../schema-component';
14
- import { useCollectionManager } from '../collection-manager';
15
+ import { BlockProvider, useBlockRequestContext } from './BlockProvider';
15
16
  export var FormBlockContext = /*#__PURE__*/createContext({});
16
17
 
17
18
  var InternalFormBlockProvider = function InternalFormBlockProvider(props) {
@@ -31,6 +32,7 @@ var InternalFormBlockProvider = function InternalFormBlockProvider(props) {
31
32
  service = _useBlockRequestConte.service;
32
33
 
33
34
  var formBlockRef = useRef();
35
+ var record = useRecord();
34
36
 
35
37
  if (service.loading) {
36
38
  return /*#__PURE__*/React.createElement(Spin, null);
@@ -47,6 +49,7 @@ var InternalFormBlockProvider = function InternalFormBlockProvider(props) {
47
49
  formBlockRef: formBlockRef
48
50
  }
49
51
  }, readPretty ? /*#__PURE__*/React.createElement(RecordProvider, {
52
+ parent: isEmpty(record === null || record === void 0 ? void 0 : record.__parent) ? record : record === null || record === void 0 ? void 0 : record.__parent,
50
53
  record: service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.data
51
54
  }, /*#__PURE__*/React.createElement("div", {
52
55
  ref: formBlockRef
@@ -197,14 +197,14 @@ var useDisableCardDrag = function useDisableCardDrag() {
197
197
  var _useACLRoleContext = useACLRoleContext(),
198
198
  allowAll = _useACLRoleContext.allowAll,
199
199
  allowConfigure = _useACLRoleContext.allowConfigure,
200
- getActionParams = _useACLRoleContext.getActionParams;
200
+ parseAction = _useACLRoleContext.parseAction;
201
201
 
202
202
  if (allowAll || allowConfigure) {
203
203
  return false;
204
204
  }
205
205
 
206
- var result = getActionParams("".concat(ctx === null || ctx === void 0 ? void 0 : (_ctx$props = ctx.props) === null || _ctx$props === void 0 ? void 0 : _ctx$props.resource, ":update"), {
207
- skipOwnCheck: true
206
+ var result = parseAction("".concat(ctx === null || ctx === void 0 ? void 0 : (_ctx$props = ctx.props) === null || _ctx$props === void 0 ? void 0 : _ctx$props.resource, ":update"), {
207
+ ignoreScope: true
208
208
  });
209
209
  return !result;
210
210
  };
@@ -12,6 +12,7 @@ export declare type SharedFilterContextValue = {
12
12
  setSharedFilterStore: (filterStore: SharedFilterStore) => void;
13
13
  getFilterParams: (filterStore?: SharedFilterStore) => any;
14
14
  };
15
+ export declare const mergeFilter: (filters: any[], op?: string) => any;
15
16
  export declare const getFilterParams: (filterStore?: SharedFilterStore) => {
16
17
  $and: SharedFilter[];
17
18
  } | {