@nocobase/client 0.8.0-alpha.7 → 0.8.0-alpha.9

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 (67) hide show
  1. package/es/collection-manager/Configuration/AddFieldAction.js +3 -1
  2. package/es/collection-manager/Configuration/CollectionFieldsTable.d.ts +15 -0
  3. package/es/collection-manager/Configuration/CollectionFieldsTable.js +73 -0
  4. package/es/collection-manager/Configuration/CollectionFieldsTableArray.d.ts +8 -0
  5. package/es/collection-manager/Configuration/CollectionFieldsTableArray.js +251 -0
  6. package/es/collection-manager/Configuration/ConfigurationTable.js +6 -2
  7. package/es/collection-manager/Configuration/index.d.ts +1 -0
  8. package/es/collection-manager/Configuration/index.js +1 -0
  9. package/es/collection-manager/Configuration/schemas/collectionFields.js +2 -2
  10. package/es/collection-manager/Configuration/schemas/collections.js +10 -1
  11. package/es/collection-manager/interfaces/properties/index.js +1 -1
  12. package/es/locale/en_US.d.ts +10 -0
  13. package/es/locale/en_US.js +10 -0
  14. package/es/locale/zh_CN.d.ts +10 -0
  15. package/es/locale/zh_CN.js +10 -0
  16. package/es/pm/index.d.ts +2 -0
  17. package/es/pm/index.js +1 -1
  18. package/es/route-switch/antd/admin-layout/index.js +1 -1
  19. package/es/schema-component/antd/calendar/Calendar.js +130 -27
  20. package/es/schema-component/antd/calendar/DeleteEvent.d.ts +3 -0
  21. package/es/schema-component/antd/calendar/DeleteEvent.js +147 -0
  22. package/es/schema-component/antd/calendar/index.js +2 -0
  23. package/es/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +143 -0
  24. package/es/schema-initializer/buttons/CalendarFormActionInitializers.js +146 -0
  25. package/es/schema-initializer/buttons/RecordBlockInitializers.js +2 -1
  26. package/es/schema-initializer/buttons/index.d.ts +1 -0
  27. package/es/schema-initializer/buttons/index.js +1 -0
  28. package/es/schema-initializer/items/DeleteEventActionInitializer.d.ts +1 -0
  29. package/es/schema-initializer/items/DeleteEventActionInitializer.js +27 -0
  30. package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +7 -7
  31. package/es/schema-initializer/items/index.d.ts +1 -0
  32. package/es/schema-initializer/items/index.js +1 -0
  33. package/es/schema-initializer/utils.js +7 -3
  34. package/lib/collection-manager/Configuration/AddFieldAction.js +3 -1
  35. package/lib/collection-manager/Configuration/CollectionFieldsTable.d.ts +15 -0
  36. package/lib/collection-manager/Configuration/CollectionFieldsTable.js +92 -0
  37. package/lib/collection-manager/Configuration/CollectionFieldsTableArray.d.ts +8 -0
  38. package/lib/collection-manager/Configuration/CollectionFieldsTableArray.js +274 -0
  39. package/lib/collection-manager/Configuration/ConfigurationTable.js +7 -2
  40. package/lib/collection-manager/Configuration/index.d.ts +1 -0
  41. package/lib/collection-manager/Configuration/index.js +13 -0
  42. package/lib/collection-manager/Configuration/schemas/collectionFields.js +2 -2
  43. package/lib/collection-manager/Configuration/schemas/collections.js +10 -1
  44. package/lib/collection-manager/interfaces/properties/index.js +1 -1
  45. package/lib/locale/en_US.d.ts +10 -0
  46. package/lib/locale/en_US.js +10 -0
  47. package/lib/locale/zh_CN.d.ts +10 -0
  48. package/lib/locale/zh_CN.js +10 -0
  49. package/lib/pm/index.d.ts +2 -0
  50. package/lib/pm/index.js +3 -1
  51. package/lib/route-switch/antd/admin-layout/index.js +1 -1
  52. package/lib/schema-component/antd/calendar/Calendar.js +131 -27
  53. package/lib/schema-component/antd/calendar/DeleteEvent.d.ts +3 -0
  54. package/lib/schema-component/antd/calendar/DeleteEvent.js +170 -0
  55. package/lib/schema-component/antd/calendar/index.js +5 -0
  56. package/lib/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +143 -0
  57. package/lib/schema-initializer/buttons/CalendarFormActionInitializers.js +153 -0
  58. package/lib/schema-initializer/buttons/RecordBlockInitializers.js +2 -1
  59. package/lib/schema-initializer/buttons/index.d.ts +1 -0
  60. package/lib/schema-initializer/buttons/index.js +13 -0
  61. package/lib/schema-initializer/items/DeleteEventActionInitializer.d.ts +1 -0
  62. package/lib/schema-initializer/items/DeleteEventActionInitializer.js +40 -0
  63. package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +1 -1
  64. package/lib/schema-initializer/items/index.d.ts +1 -0
  65. package/lib/schema-initializer/items/index.js +13 -0
  66. package/lib/schema-initializer/utils.js +7 -3
  67. package/package.json +5 -4
@@ -203,7 +203,8 @@ export var AddFieldAction = function AddFieldAction(props) {
203
203
  var scope = props.scope,
204
204
  getContainer = props.getContainer,
205
205
  record = props.item,
206
- children = props.children;
206
+ children = props.children,
207
+ trigger = props.trigger;
207
208
 
208
209
  var _useCollectionManager2 = useCollectionManager(),
209
210
  getInterface = _useCollectionManager2.getInterface;
@@ -232,6 +233,7 @@ export var AddFieldAction = function AddFieldAction(props) {
232
233
  }
233
234
  }, /*#__PURE__*/React.createElement(Dropdown, {
234
235
  getPopupContainer: getContainer,
236
+ trigger: trigger,
235
237
  overlay: /*#__PURE__*/React.createElement(Menu, {
236
238
  style: {
237
239
  maxHeight: '60vh',
@@ -0,0 +1,15 @@
1
+ import { Options, Result } from 'ahooks/lib/useRequest/src/types';
2
+ import React from 'react';
3
+ import { TableProps } from 'antd';
4
+ declare type TableVoidProps = TableProps<any> & {
5
+ request?: any;
6
+ useSelectedRowKeys?: any;
7
+ useDataSource?: (options?: Options<any, any> & {
8
+ uid?: string;
9
+ }, props?: any) => Result<any, any> & {
10
+ state?: any;
11
+ setState?: any;
12
+ };
13
+ };
14
+ export declare const CollectionFieldsTable: React.FC<TableVoidProps>;
15
+ export {};
@@ -0,0 +1,73 @@
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 { createForm } from '@formily/core';
8
+ import { FieldContext, FormContext, observer, useField, useFieldSchema } from '@formily/react';
9
+ import React, { useMemo } from 'react';
10
+ import { AsyncDataProvider, useAsyncData, useRequest } from '../..';
11
+ import { useAttach } from '@formily/react/lib/hooks/useAttach';
12
+ import { CollectionFieldsTableArray } from './CollectionFieldsTableArray';
13
+
14
+ var useDefSelectedRowKeys = function useDefSelectedRowKeys() {
15
+ var _result$state;
16
+
17
+ var result = useAsyncData();
18
+ return [result === null || result === void 0 ? void 0 : (_result$state = result.state) === null || _result$state === void 0 ? void 0 : _result$state.selectedRowKeys, function (selectedRowKeys) {
19
+ var _result$setState;
20
+
21
+ return result === null || result === void 0 ? void 0 : (_result$setState = result.setState) === null || _result$setState === void 0 ? void 0 : _result$setState.call(result, {
22
+ selectedRowKeys: selectedRowKeys
23
+ });
24
+ }];
25
+ };
26
+
27
+ var useDef = function useDef(options, props) {
28
+ var request = props.request,
29
+ dataSource = props.dataSource;
30
+
31
+ if (request) {
32
+ return useRequest(request(props), options);
33
+ } else {
34
+ return Promise.resolve({
35
+ data: dataSource
36
+ });
37
+ }
38
+ };
39
+
40
+ export var CollectionFieldsTable = observer(function (props) {
41
+ var _props$rowKey = props.rowKey,
42
+ rowKey = _props$rowKey === void 0 ? 'id' : _props$rowKey,
43
+ _props$useDataSource = props.useDataSource,
44
+ useDataSource = _props$useDataSource === void 0 ? useDef : _props$useDataSource,
45
+ _props$useSelectedRow = props.useSelectedRowKeys,
46
+ useSelectedRowKeys = _props$useSelectedRow === void 0 ? useDefSelectedRowKeys : _props$useSelectedRow;
47
+ var field = useField();
48
+ var fieldSchema = useFieldSchema();
49
+ var form = useMemo(function () {
50
+ return createForm();
51
+ }, []);
52
+ var f = useAttach(form.createArrayField(_objectSpread(_objectSpread({}, field.props), {}, {
53
+ basePath: ''
54
+ })));
55
+ var result = useDataSource({
56
+ uid: fieldSchema['x-uid'],
57
+ onSuccess: function onSuccess(data) {
58
+ form.setValues(_defineProperty({}, fieldSchema.name, data === null || data === void 0 ? void 0 : data.data));
59
+ }
60
+ }, props);
61
+ return /*#__PURE__*/React.createElement(AsyncDataProvider, {
62
+ value: result
63
+ }, /*#__PURE__*/React.createElement(FormContext.Provider, {
64
+ value: form
65
+ }, /*#__PURE__*/React.createElement(FieldContext.Provider, {
66
+ value: f
67
+ }, /*#__PURE__*/React.createElement(CollectionFieldsTableArray, _objectSpread(_objectSpread({}, props), {}, {
68
+ rowKey: rowKey,
69
+ loading: result === null || result === void 0 ? void 0 : result['loading'],
70
+ useSelectedRowKeys: useSelectedRowKeys,
71
+ pagination: false
72
+ })))));
73
+ });
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare const components: {
3
+ body: {
4
+ row: (props: any) => JSX.Element;
5
+ cell: (props: any) => JSX.Element;
6
+ };
7
+ };
8
+ export declare const CollectionFieldsTableArray: React.FC<any>;
@@ -0,0 +1,251 @@
1
+ var _excluded = ["showIndex", "useSelectedRowKeys", "useDataSource", "onChange"];
2
+
3
+ var _templateObject, _templateObject2;
4
+
5
+ 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; }
6
+
7
+ 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; }
8
+
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+
11
+ 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."); }
12
+
13
+ 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); }
14
+
15
+ 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; }
16
+
17
+ 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; }
18
+
19
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
+
21
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
22
+
23
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
24
+
25
+ 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; }
26
+
27
+ 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; }
28
+
29
+ import { css } from '@emotion/css';
30
+ import { observer, RecursionField, useField, useFieldSchema } from '@formily/react';
31
+ import { Table } from 'antd';
32
+ import { default as classNames } from 'classnames';
33
+ import React, { useState } from 'react';
34
+ import { useTranslation } from 'react-i18next';
35
+ import { RecordIndexProvider, RecordProvider, useCollectionManager, useRequest, useSchemaInitializer } from '../..';
36
+
37
+ var isColumnComponent = function isColumnComponent(schema) {
38
+ var _schema$xComponent;
39
+
40
+ return ((_schema$xComponent = schema['x-component']) === null || _schema$xComponent === void 0 ? void 0 : _schema$xComponent.endsWith('.Column')) > -1;
41
+ };
42
+
43
+ var useTableColumns = function useTableColumns() {
44
+ var field = useField();
45
+ var schema = useFieldSchema();
46
+
47
+ var _useSchemaInitializer = useSchemaInitializer(schema['x-initializer']),
48
+ exists = _useSchemaInitializer.exists,
49
+ render = _useSchemaInitializer.render;
50
+
51
+ var columns = schema.reduceProperties(function (buf, s) {
52
+ if (isColumnComponent(s)) {
53
+ return buf.concat([s]);
54
+ }
55
+ }, []).map(function (s) {
56
+ return {
57
+ title: /*#__PURE__*/React.createElement(RecursionField, {
58
+ name: s.name,
59
+ schema: s,
60
+ onlyRenderSelf: true
61
+ }),
62
+ dataIndex: s.name,
63
+ key: s.name,
64
+ render: function render(v, record) {
65
+ var _field$value;
66
+
67
+ var index = (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.indexOf(record); // console.log((Date.now() - start) / 1000);
68
+
69
+ return /*#__PURE__*/React.createElement(RecordIndexProvider, {
70
+ index: index
71
+ }, /*#__PURE__*/React.createElement(RecordProvider, {
72
+ record: record
73
+ }, /*#__PURE__*/React.createElement(RecursionField, {
74
+ schema: s,
75
+ name: index,
76
+ onlyRenderProperties: true
77
+ })));
78
+ }
79
+ };
80
+ });
81
+
82
+ if (!exists) {
83
+ return columns;
84
+ }
85
+
86
+ return columns.concat({
87
+ title: render(),
88
+ dataIndex: 'TABLE_COLUMN_INITIALIZER',
89
+ key: 'TABLE_COLUMN_INITIALIZER'
90
+ });
91
+ };
92
+
93
+ export var components = {
94
+ body: {
95
+ row: function row(props) {
96
+ return /*#__PURE__*/React.createElement("tr", _objectSpread({}, props));
97
+ },
98
+ cell: function cell(props) {
99
+ return /*#__PURE__*/React.createElement("td", _objectSpread(_objectSpread({}, props), {}, {
100
+ className: classNames(props.className, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n max-width: 300px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n "]))))
101
+ }));
102
+ }
103
+ }
104
+ };
105
+
106
+ var useDef = function useDef() {
107
+ var _useState = useState([]),
108
+ _useState2 = _slicedToArray(_useState, 2),
109
+ selectedRowKeys = _useState2[0],
110
+ setSelectedRowKeys = _useState2[1];
111
+
112
+ return [selectedRowKeys, setSelectedRowKeys];
113
+ };
114
+
115
+ var useDefDataSource = function useDefDataSource(options, props) {
116
+ var field = useField();
117
+ return useRequest(function () {
118
+ return Promise.resolve({
119
+ data: field.value
120
+ });
121
+ }, options);
122
+ };
123
+
124
+ var groupColumns = [{
125
+ dataIndex: 'name',
126
+ key: 'name'
127
+ }];
128
+ var sortKeyArr = ['primaryAndForeignKey', 'relation', 'basic', 'systemInfo'];
129
+ var CategorizeKeyNameMap = new Map([['primaryAndForeignKey', 'PK & FK fields'], ['relation', 'Association fields'], ['systemInfo', 'System fields'], ['basic', 'General fields']]);
130
+ export var CollectionFieldsTableArray = observer(function (props) {
131
+ var field = useField();
132
+ var columns = useTableColumns();
133
+
134
+ var _useTranslation = useTranslation(),
135
+ t = _useTranslation.t;
136
+
137
+ var _useCollectionManager = useCollectionManager(),
138
+ getInterface = _useCollectionManager.getInterface;
139
+
140
+ var _props$showIndex = props.showIndex,
141
+ showIndex = _props$showIndex === void 0 ? true : _props$showIndex,
142
+ _props$useSelectedRow = props.useSelectedRowKeys,
143
+ useSelectedRowKeys = _props$useSelectedRow === void 0 ? useDef : _props$useSelectedRow,
144
+ _props$useDataSource = props.useDataSource,
145
+ useDataSource = _props$useDataSource === void 0 ? useDefDataSource : _props$useDataSource,
146
+ onChange = props.onChange,
147
+ others = _objectWithoutProperties(props, _excluded);
148
+
149
+ var _useSelectedRowKeys = useSelectedRowKeys(),
150
+ _useSelectedRowKeys2 = _slicedToArray(_useSelectedRowKeys, 2),
151
+ selectedRowKeys = _useSelectedRowKeys2[0],
152
+ setSelectedRowKeys = _useSelectedRowKeys2[1];
153
+
154
+ var _useState3 = useState([]),
155
+ _useState4 = _slicedToArray(_useState3, 2),
156
+ categorizeData = _useState4[0],
157
+ setCategorizeData = _useState4[1];
158
+
159
+ useDataSource({
160
+ onSuccess: function onSuccess(data) {
161
+ field.value = (data === null || data === void 0 ? void 0 : data.data) || []; // categorize field
162
+
163
+ var categorizeMap = new Map();
164
+
165
+ var addCategorizeVal = function addCategorizeVal(categorizeKey, val) {
166
+ var fieldArr = categorizeMap.get(categorizeKey);
167
+
168
+ if (!fieldArr) {
169
+ fieldArr = [];
170
+ }
171
+
172
+ fieldArr.push(val);
173
+ categorizeMap.set(categorizeKey, fieldArr);
174
+ };
175
+
176
+ field.value.forEach(function (item) {
177
+ var itemInterface = getInterface(item === null || item === void 0 ? void 0 : item.interface);
178
+
179
+ if ((item === null || item === void 0 ? void 0 : item.primaryKey) || item.isForeignKey) {
180
+ addCategorizeVal('primaryAndForeignKey', item);
181
+ return;
182
+ }
183
+
184
+ var group = itemInterface === null || itemInterface === void 0 ? void 0 : itemInterface.group;
185
+
186
+ switch (group) {
187
+ case 'systemInfo':
188
+ case 'relation':
189
+ addCategorizeVal(group, item);
190
+ break;
191
+
192
+ default:
193
+ addCategorizeVal('basic', item);
194
+ }
195
+ });
196
+ var tmpData = [];
197
+ sortKeyArr.forEach(function (key) {
198
+ var _categorizeMap$get;
199
+
200
+ if (((_categorizeMap$get = categorizeMap.get(key)) === null || _categorizeMap$get === void 0 ? void 0 : _categorizeMap$get.length) > 0) {
201
+ tmpData.push({
202
+ key: key,
203
+ name: t(CategorizeKeyNameMap.get(key)),
204
+ data: categorizeMap.get(key)
205
+ });
206
+ }
207
+ });
208
+ setCategorizeData(tmpData);
209
+ }
210
+ });
211
+ var restProps = {
212
+ rowSelection: props.rowSelection ? _objectSpread({
213
+ type: 'checkbox',
214
+ selectedRowKeys: selectedRowKeys,
215
+ onChange: function onChange(selectedRowKeys) {
216
+ setSelectedRowKeys(selectedRowKeys);
217
+ }
218
+ }, props.rowSelection) : undefined
219
+ };
220
+
221
+ var defaultRowKey = function defaultRowKey(record) {
222
+ var _field$value2, _field$value2$indexOf;
223
+
224
+ return (_field$value2 = field.value) === null || _field$value2 === void 0 ? void 0 : (_field$value2$indexOf = _field$value2.indexOf) === null || _field$value2$indexOf === void 0 ? void 0 : _field$value2$indexOf.call(_field$value2, record);
225
+ };
226
+
227
+ var expandedRowRender = function expandedRowRender(record, index, indent, expanded) {
228
+ debugger;
229
+ return /*#__PURE__*/React.createElement(Table, _objectSpread(_objectSpread(_objectSpread({}, others), restProps), {}, {
230
+ components: components,
231
+ showHeader: true,
232
+ columns: columns,
233
+ dataSource: record.data,
234
+ pagination: false
235
+ }));
236
+ };
237
+
238
+ return /*#__PURE__*/React.createElement("div", {
239
+ className: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ant-table {\n overflow-x: auto;\n overflow-y: hidden;\n }\n "])))
240
+ }, /*#__PURE__*/React.createElement(Table, {
241
+ showHeader: false,
242
+ loading: props === null || props === void 0 ? void 0 : props.loading,
243
+ columns: groupColumns,
244
+ dataSource: categorizeData,
245
+ pagination: false,
246
+ expandable: {
247
+ expandedRowRender: expandedRowRender,
248
+ defaultExpandedRowKeys: sortKeyArr
249
+ }
250
+ }));
251
+ });
@@ -33,6 +33,7 @@ import { AddSubFieldAction } from './AddSubFieldAction';
33
33
  import { FieldSummary } from './components/FieldSummary';
34
34
  import { EditSubFieldAction } from './EditSubFieldAction';
35
35
  import { collectionSchema } from './schemas/collections';
36
+ import { CollectionFieldsTable } from ".";
36
37
 
37
38
  var useAsyncDataSource = function useAsyncDataSource(service) {
38
39
  return function (field) {
@@ -232,7 +233,9 @@ export var ConfigurationTable = function ConfigurationTable() {
232
233
  while (1) {
233
234
  switch (_context3.prev = _context3.next) {
234
235
  case 0:
235
- return _context3.abrupt("return", collections === null || collections === void 0 ? void 0 : collections.map(function (item) {
236
+ return _context3.abrupt("return", collections === null || collections === void 0 ? void 0 : collections.filter(function (item) {
237
+ return !(item.autoCreate && item.isThrough);
238
+ }).map(function (item) {
236
239
  return {
237
240
  label: compile(item.title),
238
241
  value: item.name
@@ -262,7 +265,8 @@ export var ConfigurationTable = function ConfigurationTable() {
262
265
  components: {
263
266
  AddSubFieldAction: AddSubFieldAction,
264
267
  EditSubFieldAction: EditSubFieldAction,
265
- FieldSummary: FieldSummary
268
+ FieldSummary: FieldSummary,
269
+ CollectionFieldsTable: CollectionFieldsTable
266
270
  },
267
271
  scope: {
268
272
  useDestroySubField: useDestroySubField,
@@ -3,3 +3,4 @@ export * from './ConfigurationTable';
3
3
  export * from './EditFieldAction';
4
4
  export * from './interfaces';
5
5
  export * from './components';
6
+ export * from './CollectionFieldsTable';
@@ -4,6 +4,7 @@ export * from './ConfigurationTable';
4
4
  export * from './EditFieldAction';
5
5
  export * from './interfaces';
6
6
  export * from './components';
7
+ export * from './CollectionFieldsTable';
7
8
  registerValidateFormats({
8
9
  uid: /^[A-Za-z0-9][A-Za-z0-9_-]*$/
9
10
  });
@@ -60,7 +60,7 @@ export var collectionFieldSchema = {
60
60
  resource: 'collections.fields',
61
61
  action: 'list',
62
62
  params: {
63
- pageSize: 50,
63
+ paginate: false,
64
64
  filter: {
65
65
  'interface.$not': null
66
66
  },
@@ -112,7 +112,7 @@ export var collectionFieldSchema = {
112
112
  table: {
113
113
  type: 'void',
114
114
  'x-uid': 'input',
115
- 'x-component': 'Table.Void',
115
+ 'x-component': 'CollectionFieldsTable',
116
116
  'x-component-props': {
117
117
  rowKey: 'name',
118
118
  rowSelection: {
@@ -57,7 +57,16 @@ export var collectionSchema = {
57
57
  params: {
58
58
  pageSize: 50,
59
59
  filter: {
60
- inherit: false
60
+ inherit: false,
61
+ options: {
62
+ // filter auto create through collections
63
+ autoCreate: {
64
+ $not: true
65
+ },
66
+ isThrough: {
67
+ $not: true
68
+ }
69
+ }
61
70
  },
62
71
  sort: ['sort'],
63
72
  appends: []
@@ -125,7 +125,7 @@ export var reverseFieldProperties = {
125
125
  properties: {
126
126
  autoCreateReverseField: {
127
127
  type: 'boolean',
128
- default: true,
128
+ default: false,
129
129
  'x-decorator': 'FormItem',
130
130
  'x-component': 'Checkbox',
131
131
  'x-content': '{{t("Create inverse field in the target collection")}}',
@@ -53,6 +53,12 @@ declare const _default: {
53
53
  Form: string;
54
54
  "Select data source": string;
55
55
  Calendar: string;
56
+ 'Delete events': string;
57
+ 'This event': string;
58
+ 'This and following events': string;
59
+ 'All events': string;
60
+ 'Delete this event?': string;
61
+ 'Delete Event': string;
56
62
  Kanban: string;
57
63
  "Select grouping field": string;
58
64
  Media: string;
@@ -115,6 +121,10 @@ declare const _default: {
115
121
  "Configure columns": string;
116
122
  "Edit field": string;
117
123
  "Configure fields of {{title}}": string;
124
+ "PK & FK fields": string;
125
+ "Association fields": string;
126
+ "System fields": string;
127
+ "General fields": string;
118
128
  Basic: string;
119
129
  "Single line text": string;
120
130
  "Long text": string;
@@ -53,6 +53,12 @@ export default {
53
53
  "Form": "Form",
54
54
  "Select data source": "Select data source",
55
55
  "Calendar": "Calendar",
56
+ 'Delete events': 'Delete events',
57
+ 'This event': 'This event',
58
+ 'This and following events': 'This and following events',
59
+ 'All events': 'All events',
60
+ 'Delete this event?': 'Delete this event?',
61
+ 'Delete Event': 'Delete Event',
56
62
  "Kanban": "Kanban",
57
63
  "Select grouping field": "Select grouping field",
58
64
  "Media": "Media",
@@ -115,6 +121,10 @@ export default {
115
121
  "Configure columns": "Configure columns",
116
122
  "Edit field": "Edit field",
117
123
  "Configure fields of {{title}}": "Configure fields of {{title}}",
124
+ "PK & FK fields": "PK & FK fields",
125
+ "Association fields": "Association fields",
126
+ "System fields": "System fields",
127
+ "General fields": "General fields",
118
128
  "Basic": "Basic",
119
129
  "Single line text": "Single line text",
120
130
  "Long text": "Long text",
@@ -54,6 +54,12 @@ declare const _default: {
54
54
  Form: string;
55
55
  "Select data source": string;
56
56
  Calendar: string;
57
+ 'Delete events': string;
58
+ 'This event': string;
59
+ 'This and following events': string;
60
+ 'All events': string;
61
+ 'Delete this event?': string;
62
+ 'Delete Event': string;
57
63
  Kanban: string;
58
64
  "Select grouping field": string;
59
65
  Media: string;
@@ -116,6 +122,10 @@ declare const _default: {
116
122
  "Configure columns": string;
117
123
  "Edit field": string;
118
124
  "Configure fields of {{title}}": string;
125
+ "PK & FK fields": string;
126
+ "Association fields": string;
127
+ "System fields": string;
128
+ "General fields": string;
119
129
  Basic: string;
120
130
  "Single line text": string;
121
131
  "Long text": string;
@@ -54,6 +54,12 @@ export default {
54
54
  "Form": "表单",
55
55
  "Select data source": "选择数据源",
56
56
  "Calendar": "日历",
57
+ 'Delete events': '删除日程',
58
+ 'This event': '此日程',
59
+ 'This and following events': '此日程及后续日程',
60
+ 'All events': '所有日程',
61
+ 'Delete this event?': '是否删除这个日程?',
62
+ 'Delete Event': '删除日程',
57
63
  "Kanban": "看板",
58
64
  "Select grouping field": "选择分组字段",
59
65
  "Media": "多媒体",
@@ -116,6 +122,10 @@ export default {
116
122
  "Configure columns": "配置字段",
117
123
  "Edit field": "编辑字段",
118
124
  "Configure fields of {{title}}": "「{{title}}」的字段配置",
125
+ "PK & FK fields": "主外键字段",
126
+ "Association fields": "关系字段",
127
+ "System fields": "系统字段",
128
+ "General fields": "普通字段",
119
129
  "Basic": "基本类型",
120
130
  "Single line text": "单行文本",
121
131
  "Long text": "多行文本",
package/es/pm/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import React from 'react';
2
+ export declare const SettingsCenterContext: React.Context<any>;
1
3
  export declare const SettingsCenterProvider: (props: any) => JSX.Element;
2
4
  export declare const PMProvider: (props: any) => JSX.Element;
3
5
  export default PMProvider;
package/es/pm/index.js CHANGED
@@ -33,7 +33,7 @@ import { RouteSwitchContext } from '../route-switch';
33
33
  import { useCompile } from '../schema-component';
34
34
  import { BlockTemplatesPane } from '../schema-templates';
35
35
  import { SystemSettingsPane } from '../system-settings';
36
- var SettingsCenterContext = /*#__PURE__*/createContext({});
36
+ export var SettingsCenterContext = /*#__PURE__*/createContext({});
37
37
 
38
38
  var PluginCard = function PluginCard(props) {
39
39
  var history = useHistory();
@@ -206,7 +206,7 @@ var InternalAdminLayout = function InternalAdminLayout(props) {
206
206
  theme: 'light',
207
207
  ref: sideMenuRef
208
208
  }), /*#__PURE__*/React.createElement(Layout.Content, {
209
- className: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-height: calc(100vh - 46px);\n padding-bottom: 42px;\n position: relative;\n // padding-bottom: 70px;\n > div {\n position: relative;\n // z-index: 1;\n }\n .ant-layout-footer {\n position: absolute;\n bottom: 0;\n text-align: center;\n width: 100%;\n z-index: 0;\n padding: 10px 50px;\n }\n "])))
209
+ className: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-height: calc(100vh - 46px);\n padding-bottom: 42px;\n position: relative;\n // padding-bottom: 70px;\n > div {\n position: relative;\n // z-index: 1;\n }\n .ant-layout-footer {\n position: absolute;\n bottom: 0;\n text-align: center;\n width: 100%;\n z-index: 0;\n padding: 0px 50px;\n }\n "])))
210
210
  }, service.contentLoading ? /*#__PURE__*/React.createElement(Spin, null) : props.children, /*#__PURE__*/React.createElement(Layout.Footer, null, /*#__PURE__*/React.createElement(PoweredBy, null)))));
211
211
  };
212
212