@nocobase/client 0.7.3-alpha.1 → 0.7.4-alpha.1
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/application/Application.d.ts +1 -0
- package/es/application/Application.js +7 -1
- package/es/block-provider/TableFieldProvider.d.ts +1 -0
- package/es/block-provider/TableFieldProvider.js +5 -2
- package/es/block-provider/hooks/index.js +14 -2
- package/es/collection-manager/CollectionField.js +2 -2
- package/es/collection-manager/Configuration/index.js +5 -1
- package/es/collection-manager/Configuration/schemas/collections.js +2 -1
- package/es/collection-manager/interfaces/m2m.js +2 -0
- package/es/collection-manager/interfaces/m2o.js +1 -0
- package/es/collection-manager/interfaces/o2m.js +1 -0
- package/es/collection-manager/interfaces/o2o.js +3 -0
- package/es/collection-manager/interfaces/password.js +2 -1
- package/es/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/es/collection-manager/interfaces/properties/index.js +1 -0
- package/es/collection-manager/interfaces/properties/operators.js +4 -4
- package/es/locale/en_US.d.ts +3 -2
- package/es/locale/en_US.js +4 -3
- package/es/locale/zh_CN.d.ts +3 -2
- package/es/locale/zh_CN.js +3 -2
- package/es/plugin-manager/PluginManager.d.ts +1 -0
- package/es/plugin-manager/PluginManager.js +12 -2
- package/es/schema-component/antd/calendar/Calendar.Designer.js +16 -10
- package/es/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
- package/es/schema-component/antd/date-picker/DatePicker.js +1 -1
- package/es/schema-component/antd/date-picker/ReadPretty.js +1 -1
- package/es/schema-component/antd/date-picker/util.d.ts +0 -10
- package/es/schema-component/antd/date-picker/util.js +1 -79
- package/es/schema-component/antd/form-item/FormItem.js +6 -8
- package/es/schema-component/antd/input-number/InputNumber.js +1 -1
- package/es/schema-component/antd/input-number/ReadPretty.js +2 -4
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +1 -1
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +1 -1
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
- package/es/schema-component/antd/table-v2/Table.d.ts +0 -11
- package/es/schema-component/antd/table-v2/Table.js +162 -88
- package/es/schema-component/antd/table-v2/TableField.js +3 -0
- package/es/schema-component/antd/tabs/Tabs.Designer.js +23 -12
- package/es/schema-component/antd/tabs/Tabs.js +7 -1
- package/es/schema-component/core/DesignableSwitch.js +7 -1
- package/es/schema-initializer/buttons/TabPaneInitializers.js +11 -3
- package/es/schema-initializer/components/assigned-field/AssignedField.js +6 -4
- package/es/schema-initializer/items/index.js +2 -1
- package/es/schema-initializer/utils.js +16 -0
- package/lib/application/Application.d.ts +1 -0
- package/lib/application/Application.js +11 -2
- package/lib/block-provider/TableFieldProvider.d.ts +1 -0
- package/lib/block-provider/TableFieldProvider.js +4 -1
- package/lib/block-provider/hooks/index.js +14 -2
- package/lib/collection-manager/CollectionField.js +2 -2
- package/lib/collection-manager/Configuration/index.js +5 -0
- package/lib/collection-manager/Configuration/schemas/collections.js +2 -1
- package/lib/collection-manager/interfaces/m2m.js +2 -0
- package/lib/collection-manager/interfaces/m2o.js +1 -0
- package/lib/collection-manager/interfaces/o2m.js +1 -0
- package/lib/collection-manager/interfaces/o2o.js +3 -0
- package/lib/collection-manager/interfaces/password.js +3 -2
- package/lib/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/lib/collection-manager/interfaces/properties/index.js +1 -0
- package/lib/collection-manager/interfaces/properties/operators.js +4 -4
- package/lib/locale/en_US.d.ts +3 -2
- package/lib/locale/en_US.js +4 -3
- package/lib/locale/zh_CN.d.ts +3 -2
- package/lib/locale/zh_CN.js +3 -2
- package/lib/plugin-manager/PluginManager.d.ts +1 -0
- package/lib/plugin-manager/PluginManager.js +15 -2
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +16 -10
- package/lib/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
- package/lib/schema-component/antd/date-picker/DatePicker.js +2 -2
- package/lib/schema-component/antd/date-picker/ReadPretty.js +6 -6
- package/lib/schema-component/antd/date-picker/util.d.ts +0 -10
- package/lib/schema-component/antd/date-picker/util.js +6 -89
- package/lib/schema-component/antd/form-item/FormItem.js +9 -17
- package/lib/schema-component/antd/input-number/InputNumber.js +6 -6
- package/lib/schema-component/antd/input-number/ReadPretty.js +2 -5
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +2 -2
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +1 -1
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
- package/lib/schema-component/antd/table-v2/Table.d.ts +0 -11
- package/lib/schema-component/antd/table-v2/Table.js +171 -90
- package/lib/schema-component/antd/table-v2/TableField.js +3 -0
- package/lib/schema-component/antd/tabs/Tabs.Designer.js +23 -12
- package/lib/schema-component/antd/tabs/Tabs.js +8 -1
- package/lib/schema-component/core/DesignableSwitch.js +8 -1
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +11 -3
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +7 -4
- package/lib/schema-initializer/items/index.js +2 -1
- package/lib/schema-initializer/utils.js +16 -0
- package/package.json +5 -4
|
@@ -51,6 +51,11 @@ import { BlockTemplateDetails, BlockTemplatePage, SchemaTemplateShortcut } from
|
|
|
51
51
|
import { SystemSettingsProvider, SystemSettingsShortcut } from '../system-settings';
|
|
52
52
|
import { SigninPage, SignupPage } from '../user';
|
|
53
53
|
import { compose } from './compose';
|
|
54
|
+
export var getCurrentTimezone = function getCurrentTimezone() {
|
|
55
|
+
var timezoneOffset = new Date().getTimezoneOffset() / -60;
|
|
56
|
+
var timezone = String(timezoneOffset).padStart(2, '0') + ':00';
|
|
57
|
+
return (timezoneOffset > 0 ? '+' : '-') + timezone;
|
|
58
|
+
};
|
|
54
59
|
export var Application = /*#__PURE__*/function () {
|
|
55
60
|
function Application(options) {
|
|
56
61
|
var _window, _window$location;
|
|
@@ -65,7 +70,8 @@ export var Application = /*#__PURE__*/function () {
|
|
|
65
70
|
this.apiClient = new APIClient(_objectSpread({
|
|
66
71
|
baseURL: process.env.API_BASE_URL,
|
|
67
72
|
headers: {
|
|
68
|
-
'X-Hostname': (_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname
|
|
73
|
+
'X-Hostname': (_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname,
|
|
74
|
+
'X-Timezone': getCurrentTimezone()
|
|
69
75
|
}
|
|
70
76
|
}, options.apiClient));
|
|
71
77
|
this.i18n = options.i18n || i18n;
|
|
@@ -14,7 +14,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
14
14
|
|
|
15
15
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
16
|
|
|
17
|
-
import { useField } from '@formily/react';
|
|
17
|
+
import { useField, useFieldSchema } from '@formily/react';
|
|
18
18
|
import React, { createContext, useContext, useEffect } from 'react';
|
|
19
19
|
import { BlockProvider, useBlockRequestContext } from './BlockProvider';
|
|
20
20
|
import { useFormBlockContext } from './FormBlockProvider';
|
|
@@ -30,6 +30,7 @@ var InternalTableFieldProvider = function InternalTableFieldProvider(props) {
|
|
|
30
30
|
dragSort = props.dragSort,
|
|
31
31
|
fieldName = props.fieldName;
|
|
32
32
|
var field = useField();
|
|
33
|
+
var fieldSchema = useFieldSchema();
|
|
33
34
|
|
|
34
35
|
var _useBlockRequestConte = useBlockRequestContext(),
|
|
35
36
|
resource = _useBlockRequestConte.resource,
|
|
@@ -51,6 +52,7 @@ var InternalTableFieldProvider = function InternalTableFieldProvider(props) {
|
|
|
51
52
|
return /*#__PURE__*/React.createElement(TableFieldContext.Provider, {
|
|
52
53
|
value: {
|
|
53
54
|
field: field,
|
|
55
|
+
fieldSchema: fieldSchema,
|
|
54
56
|
service: service,
|
|
55
57
|
resource: resource,
|
|
56
58
|
params: params,
|
|
@@ -277,7 +279,7 @@ export var useTableFieldContext = function useTableFieldContext() {
|
|
|
277
279
|
return useContext(TableFieldContext);
|
|
278
280
|
};
|
|
279
281
|
export var useTableFieldProps = function useTableFieldProps() {
|
|
280
|
-
var _ctx$service3, _ctx$service4;
|
|
282
|
+
var _ctx$service3, _ctx$service4, _ctx$fieldSchema, _ctx$fieldSchema$pare;
|
|
281
283
|
|
|
282
284
|
var field = useField();
|
|
283
285
|
var ctx = useTableFieldContext();
|
|
@@ -298,6 +300,7 @@ export var useTableFieldProps = function useTableFieldProps() {
|
|
|
298
300
|
showIndex: ctx.showIndex,
|
|
299
301
|
dragSort: ctx.dragSort,
|
|
300
302
|
pagination: false,
|
|
303
|
+
required: ctx === null || ctx === void 0 ? void 0 : (_ctx$fieldSchema = ctx.fieldSchema) === null || _ctx$fieldSchema === void 0 ? void 0 : (_ctx$fieldSchema$pare = _ctx$fieldSchema.parent) === null || _ctx$fieldSchema$pare === void 0 ? void 0 : _ctx$fieldSchema$pare.required,
|
|
301
304
|
rowKey: function rowKey(record) {
|
|
302
305
|
var _field$value, _field$value$indexOf;
|
|
303
306
|
|
|
@@ -714,13 +714,20 @@ export var useDestroyActionProps = function useDestroyActionProps() {
|
|
|
714
714
|
|
|
715
715
|
var _useBlockRequestConte5 = useBlockRequestContext(),
|
|
716
716
|
resource = _useBlockRequestConte5.resource,
|
|
717
|
-
service = _useBlockRequestConte5.service
|
|
717
|
+
service = _useBlockRequestConte5.service,
|
|
718
|
+
block = _useBlockRequestConte5.block,
|
|
719
|
+
__parent = _useBlockRequestConte5.__parent;
|
|
720
|
+
|
|
721
|
+
var _useActionContext4 = useActionContext(),
|
|
722
|
+
setVisible = _useActionContext4.setVisible;
|
|
718
723
|
|
|
719
724
|
return {
|
|
720
725
|
onClick: function onClick() {
|
|
721
726
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
|
|
722
727
|
var _service$refresh3;
|
|
723
728
|
|
|
729
|
+
var _parent$service5, _parent$service5$refr;
|
|
730
|
+
|
|
724
731
|
return regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
725
732
|
while (1) {
|
|
726
733
|
switch (_context9.prev = _context9.next) {
|
|
@@ -733,7 +740,12 @@ export var useDestroyActionProps = function useDestroyActionProps() {
|
|
|
733
740
|
case 2:
|
|
734
741
|
service === null || service === void 0 ? void 0 : (_service$refresh3 = service.refresh) === null || _service$refresh3 === void 0 ? void 0 : _service$refresh3.call(service);
|
|
735
742
|
|
|
736
|
-
|
|
743
|
+
if (block !== 'TableField') {
|
|
744
|
+
__parent === null || __parent === void 0 ? void 0 : (_parent$service5 = __parent.service) === null || _parent$service5 === void 0 ? void 0 : (_parent$service5$refr = _parent$service5.refresh) === null || _parent$service5$refr === void 0 ? void 0 : _parent$service5$refr.call(_parent$service5);
|
|
745
|
+
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
case 4:
|
|
737
749
|
case "end":
|
|
738
750
|
return _context9.stop();
|
|
739
751
|
}
|
|
@@ -6,11 +6,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6
6
|
|
|
7
7
|
import { connect, useField, useFieldSchema } from '@formily/react';
|
|
8
8
|
import { merge } from '@formily/shared';
|
|
9
|
+
import { concat } from 'lodash';
|
|
9
10
|
import React, { useEffect } from 'react';
|
|
10
11
|
import { useCompile, useComponent, useFormBlockContext } from '..';
|
|
11
12
|
import { CollectionFieldProvider } from './CollectionFieldProvider';
|
|
12
|
-
import { useCollectionField } from './hooks';
|
|
13
|
-
import { concat } from 'lodash'; // TODO: 初步适配
|
|
13
|
+
import { useCollectionField } from './hooks'; // TODO: 初步适配
|
|
14
14
|
|
|
15
15
|
var InternalField = function InternalField(props) {
|
|
16
16
|
var field = useField();
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { registerValidateFormats } from '@formily/core';
|
|
1
2
|
export * from './AddFieldAction';
|
|
2
3
|
export * from './ConfigurationTable';
|
|
3
|
-
export * from './EditFieldAction';
|
|
4
|
+
export * from './EditFieldAction';
|
|
5
|
+
registerValidateFormats({
|
|
6
|
+
uid: /^[A-Za-z0-9][A-Za-z0-9_-]*$/
|
|
7
|
+
});
|
|
@@ -184,6 +184,7 @@ export var m2m = {
|
|
|
184
184
|
description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
|
|
185
185
|
'x-decorator': 'FormItem',
|
|
186
186
|
'x-component': 'Input',
|
|
187
|
+
'x-validator': 'uid',
|
|
187
188
|
'x-disabled': '{{ !createOnly }}'
|
|
188
189
|
}
|
|
189
190
|
}
|
|
@@ -216,6 +217,7 @@ export var m2m = {
|
|
|
216
217
|
description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
|
|
217
218
|
'x-decorator': 'FormItem',
|
|
218
219
|
'x-component': 'Input',
|
|
220
|
+
'x-validator': 'uid',
|
|
219
221
|
'x-disabled': '{{ !createOnly }}'
|
|
220
222
|
}
|
|
221
223
|
}
|
|
@@ -183,6 +183,7 @@ export var m2o = {
|
|
|
183
183
|
description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
|
|
184
184
|
'x-decorator': 'FormItem',
|
|
185
185
|
'x-component': 'Input',
|
|
186
|
+
'x-validator': 'uid',
|
|
186
187
|
'x-disabled': '{{ !createOnly }}'
|
|
187
188
|
}
|
|
188
189
|
}
|
|
@@ -211,6 +211,7 @@ export var o2m = {
|
|
|
211
211
|
description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
|
|
212
212
|
'x-decorator': 'FormItem',
|
|
213
213
|
'x-component': 'Input',
|
|
214
|
+
'x-validator': 'uid',
|
|
214
215
|
'x-disabled': '{{ !createOnly }}'
|
|
215
216
|
}
|
|
216
217
|
}
|
|
@@ -210,6 +210,7 @@ export var o2o = {
|
|
|
210
210
|
description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
|
|
211
211
|
'x-decorator': 'FormItem',
|
|
212
212
|
'x-component': 'Input',
|
|
213
|
+
'x-validator': 'uid',
|
|
213
214
|
'x-disabled': '{{ !createOnly }}'
|
|
214
215
|
}
|
|
215
216
|
}
|
|
@@ -380,6 +381,7 @@ export var oho = {
|
|
|
380
381
|
description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
|
|
381
382
|
'x-decorator': 'FormItem',
|
|
382
383
|
'x-component': 'Input',
|
|
384
|
+
'x-validator': 'uid',
|
|
383
385
|
'x-disabled': '{{ !createOnly }}'
|
|
384
386
|
}
|
|
385
387
|
}
|
|
@@ -537,6 +539,7 @@ export var obo = {
|
|
|
537
539
|
description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}",
|
|
538
540
|
'x-decorator': 'FormItem',
|
|
539
541
|
'x-component': 'Input',
|
|
542
|
+
'x-validator': 'uid',
|
|
540
543
|
'x-disabled': '{{ !createOnly }}'
|
|
541
544
|
}
|
|
542
545
|
}
|
|
@@ -4,8 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
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
|
-
import { defaultProps } from './properties';
|
|
8
7
|
import { i18n } from '../../i18n';
|
|
8
|
+
import { defaultProps } from './properties';
|
|
9
9
|
export var password = {
|
|
10
10
|
name: 'password',
|
|
11
11
|
type: 'object',
|
|
@@ -14,6 +14,7 @@ export var password = {
|
|
|
14
14
|
title: '{{t("Password")}}',
|
|
15
15
|
default: {
|
|
16
16
|
type: 'password',
|
|
17
|
+
hidden: true,
|
|
17
18
|
// name,
|
|
18
19
|
uiSchema: {
|
|
19
20
|
type: 'string',
|
|
@@ -247,6 +247,7 @@ export var defaultProps = {
|
|
|
247
247
|
'x-disabled': '{{ !createOnly }}',
|
|
248
248
|
'x-decorator': 'FormItem',
|
|
249
249
|
'x-component': 'Input',
|
|
250
|
+
'x-validator': 'uid',
|
|
250
251
|
description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"
|
|
251
252
|
},
|
|
252
253
|
type: type
|
|
@@ -87,11 +87,11 @@ export var datetime = [{
|
|
|
87
87
|
value: '$dateNotAfter'
|
|
88
88
|
}, {
|
|
89
89
|
label: "{{ t('is empty') }}",
|
|
90
|
-
value: '$
|
|
90
|
+
value: '$empty',
|
|
91
91
|
noValue: true
|
|
92
92
|
}, {
|
|
93
93
|
label: "{{ t('is not empty') }}",
|
|
94
|
-
value: '$
|
|
94
|
+
value: '$notEmpty',
|
|
95
95
|
noValue: true
|
|
96
96
|
}];
|
|
97
97
|
export var number = [{
|
|
@@ -201,11 +201,11 @@ export var time = [{
|
|
|
201
201
|
value: '$neq'
|
|
202
202
|
}, {
|
|
203
203
|
label: '{{t("is empty")}}',
|
|
204
|
-
value: '$
|
|
204
|
+
value: '$empty',
|
|
205
205
|
noValue: true
|
|
206
206
|
}, {
|
|
207
207
|
label: '{{t("is not empty")}}',
|
|
208
|
-
value: '$
|
|
208
|
+
value: '$notEmpty',
|
|
209
209
|
noValue: true
|
|
210
210
|
}];
|
|
211
211
|
export var boolean = [{
|
package/es/locale/en_US.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ declare const _default: {
|
|
|
54
54
|
"Select data source": string;
|
|
55
55
|
Calendar: string;
|
|
56
56
|
Kanban: string;
|
|
57
|
-
"Select
|
|
57
|
+
"Select grouping field": string;
|
|
58
58
|
Media: string;
|
|
59
59
|
Markdown: string;
|
|
60
60
|
Wysiwyg: string;
|
|
@@ -373,7 +373,7 @@ declare const _default: {
|
|
|
373
373
|
"Reference template": string;
|
|
374
374
|
"Create calendar block": string;
|
|
375
375
|
"Create kanban block": string;
|
|
376
|
-
"
|
|
376
|
+
"Grouping field": string;
|
|
377
377
|
"Tab name": string;
|
|
378
378
|
"Current record blocks": string;
|
|
379
379
|
"Popup message": string;
|
|
@@ -554,5 +554,6 @@ declare const _default: {
|
|
|
554
554
|
"Enabled languages": string;
|
|
555
555
|
"View all plugins": string;
|
|
556
556
|
Print: string;
|
|
557
|
+
'Single select and radio fields can be used as the grouping field': string;
|
|
557
558
|
};
|
|
558
559
|
export default _default;
|
package/es/locale/en_US.js
CHANGED
|
@@ -54,7 +54,7 @@ export default {
|
|
|
54
54
|
"Select data source": "Select data source",
|
|
55
55
|
"Calendar": "Calendar",
|
|
56
56
|
"Kanban": "Kanban",
|
|
57
|
-
"Select
|
|
57
|
+
"Select grouping field": "Select grouping field",
|
|
58
58
|
"Media": "Media",
|
|
59
59
|
"Markdown": "Markdown",
|
|
60
60
|
"Wysiwyg": "Wysiwyg",
|
|
@@ -373,7 +373,7 @@ export default {
|
|
|
373
373
|
"Reference template": "Reference template",
|
|
374
374
|
"Create calendar block": "Create calendar block",
|
|
375
375
|
"Create kanban block": "Create kanban block",
|
|
376
|
-
"
|
|
376
|
+
"Grouping field": "Grouping field",
|
|
377
377
|
"Tab name": "Tab name",
|
|
378
378
|
"Current record blocks": "Current record blocks",
|
|
379
379
|
"Popup message": "Popup message",
|
|
@@ -553,5 +553,6 @@ export default {
|
|
|
553
553
|
"Regular expression": "Pattern",
|
|
554
554
|
"Enabled languages": "Enabled languages",
|
|
555
555
|
"View all plugins": "View all plugins",
|
|
556
|
-
"Print": "Print"
|
|
556
|
+
"Print": "Print",
|
|
557
|
+
'Single select and radio fields can be used as the grouping field': 'Single select and radio fields can be used as the grouping field'
|
|
557
558
|
};
|
package/es/locale/zh_CN.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ declare const _default: {
|
|
|
54
54
|
"Select data source": string;
|
|
55
55
|
Calendar: string;
|
|
56
56
|
Kanban: string;
|
|
57
|
-
"Select
|
|
57
|
+
"Select grouping field": string;
|
|
58
58
|
Media: string;
|
|
59
59
|
Markdown: string;
|
|
60
60
|
Wysiwyg: string;
|
|
@@ -408,7 +408,8 @@ declare const _default: {
|
|
|
408
408
|
'Reference template': string;
|
|
409
409
|
'Create calendar block': string;
|
|
410
410
|
'Create kanban block': string;
|
|
411
|
-
'
|
|
411
|
+
'Grouping field': string;
|
|
412
|
+
'Single select and radio fields can be used as the grouping field': string;
|
|
412
413
|
'Tab name': string;
|
|
413
414
|
'Current record blocks': string;
|
|
414
415
|
'Popup message': string;
|
package/es/locale/zh_CN.js
CHANGED
|
@@ -54,7 +54,7 @@ export default {
|
|
|
54
54
|
"Select data source": "选择数据源",
|
|
55
55
|
"Calendar": "日历",
|
|
56
56
|
"Kanban": "看板",
|
|
57
|
-
"Select
|
|
57
|
+
"Select grouping field": "选择分组字段",
|
|
58
58
|
"Media": "多媒体",
|
|
59
59
|
"Markdown": "Markdown",
|
|
60
60
|
"Wysiwyg": "富文本",
|
|
@@ -408,7 +408,8 @@ export default {
|
|
|
408
408
|
'Reference template': '引用模板',
|
|
409
409
|
'Create calendar block': '创建日历区块',
|
|
410
410
|
'Create kanban block': '创建看板区块',
|
|
411
|
-
'
|
|
411
|
+
'Grouping field': '分组字段',
|
|
412
|
+
'Single select and radio fields can be used as the grouping field': '数据表的单选字段可以作为分组字段',
|
|
412
413
|
'Tab name': '标签名称',
|
|
413
414
|
'Current record blocks': '当前数据区块',
|
|
414
415
|
'Popup message': '弹窗提示消息',
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _templateObject;
|
|
2
|
+
|
|
3
|
+
var _excluded = ["selected", "icon", "title", "subtitle"];
|
|
2
4
|
|
|
3
5
|
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
6
|
|
|
5
7
|
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
8
|
|
|
9
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
10
|
+
|
|
7
11
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
12
|
|
|
9
13
|
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; }
|
|
@@ -25,6 +29,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
25
29
|
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; }
|
|
26
30
|
|
|
27
31
|
import { AppstoreOutlined, EllipsisOutlined } from '@ant-design/icons';
|
|
32
|
+
import { css } from '@emotion/css';
|
|
28
33
|
import { ConfigProvider, Menu, Spin, Tooltip } from 'antd';
|
|
29
34
|
import cls from 'classnames';
|
|
30
35
|
import { get } from 'lodash';
|
|
@@ -126,14 +131,19 @@ PluginManager.Toolbar.Item = function (props) {
|
|
|
126
131
|
var selected = props.selected,
|
|
127
132
|
icon = props.icon,
|
|
128
133
|
title = props.title,
|
|
134
|
+
subtitle = props.subtitle,
|
|
129
135
|
others = _objectWithoutProperties(props, _excluded);
|
|
130
136
|
|
|
131
137
|
var prefix = usePrefixCls();
|
|
132
138
|
var className = cls(_defineProperty({}, "".concat(prefix, "-menu-item-selected"), selected));
|
|
133
139
|
|
|
134
140
|
if (item.pin) {
|
|
141
|
+
var subtitleComponent = subtitle && /*#__PURE__*/React.createElement("div", {
|
|
142
|
+
className: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: 12px;\n color: #999;\n "])))
|
|
143
|
+
}, subtitle);
|
|
144
|
+
var titleComponent = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, title), subtitleComponent);
|
|
135
145
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
136
|
-
title:
|
|
146
|
+
title: titleComponent
|
|
137
147
|
}, /*#__PURE__*/React.createElement(Menu.Item, _objectSpread(_objectSpread({}, others), {}, {
|
|
138
148
|
className: className,
|
|
139
149
|
eventKey: item.component
|
|
@@ -15,12 +15,17 @@ import { GeneralSchemaDesigner, SchemaSettings } from '../../../schema-settings'
|
|
|
15
15
|
import { useSchemaTemplate } from '../../../schema-templates';
|
|
16
16
|
|
|
17
17
|
var useOptions = function useOptions() {
|
|
18
|
+
var _fields$filter;
|
|
19
|
+
|
|
20
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'string';
|
|
18
21
|
var compile = useCompile();
|
|
19
22
|
|
|
20
23
|
var _useCollection = useCollection(),
|
|
21
24
|
fields = _useCollection.fields;
|
|
22
25
|
|
|
23
|
-
var options = fields === null || fields === void 0 ? void 0 : fields.
|
|
26
|
+
var options = fields === null || fields === void 0 ? void 0 : (_fields$filter = fields.filter(function (field) {
|
|
27
|
+
return field.type === type;
|
|
28
|
+
})) === null || _fields$filter === void 0 ? void 0 : _fields$filter.map(function (field) {
|
|
24
29
|
var _field$uiSchema;
|
|
25
30
|
|
|
26
31
|
return {
|
|
@@ -57,7 +62,6 @@ export var CalendarDesigner = function CalendarDesigner() {
|
|
|
57
62
|
|
|
58
63
|
var template = useSchemaTemplate();
|
|
59
64
|
var defaultFilter = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora === void 0 ? void 0 : (_fieldSchema$xDecora$ = _fieldSchema$xDecora.params) === null || _fieldSchema$xDecora$ === void 0 ? void 0 : _fieldSchema$xDecora$.filter) || {};
|
|
60
|
-
var options = useOptions();
|
|
61
65
|
var fieldNames = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora2 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora2 === void 0 ? void 0 : _fieldSchema$xDecora2['fieldNames']) || {};
|
|
62
66
|
var defaultResource = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora3 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora3 === void 0 ? void 0 : _fieldSchema$xDecora3.resource;
|
|
63
67
|
return /*#__PURE__*/React.createElement(GeneralSchemaDesigner, {
|
|
@@ -66,14 +70,16 @@ export var CalendarDesigner = function CalendarDesigner() {
|
|
|
66
70
|
}, /*#__PURE__*/React.createElement(SchemaSettings.BlockTitleItem, null), /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
|
|
67
71
|
title: t('Title field'),
|
|
68
72
|
value: fieldNames.title,
|
|
69
|
-
options:
|
|
73
|
+
options: useOptions('string'),
|
|
70
74
|
onChange: function onChange(title) {
|
|
71
75
|
var _schema;
|
|
72
76
|
|
|
73
77
|
var fieldNames = field.decoratorProps.fieldNames || {};
|
|
74
78
|
fieldNames['title'] = title;
|
|
75
79
|
field.decoratorProps.params = fieldNames;
|
|
76
|
-
fieldSchema['x-decorator-props']['params'] = fieldNames;
|
|
80
|
+
fieldSchema['x-decorator-props']['params'] = fieldNames; // Select切换option后value未按照预期切换,固增加以下代码
|
|
81
|
+
|
|
82
|
+
fieldSchema['x-decorator-props']['fieldNames'] = fieldNames;
|
|
77
83
|
service.refresh();
|
|
78
84
|
dn.emit('patch', {
|
|
79
85
|
schema: (_schema = {}, _defineProperty(_schema, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema, 'x-decorator-props', field.decoratorProps), _schema)
|
|
@@ -83,14 +89,14 @@ export var CalendarDesigner = function CalendarDesigner() {
|
|
|
83
89
|
}), /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
|
|
84
90
|
title: t('Start date field'),
|
|
85
91
|
value: fieldNames.start,
|
|
86
|
-
options:
|
|
92
|
+
options: useOptions('date'),
|
|
87
93
|
onChange: function onChange(start) {
|
|
88
94
|
var _schema2;
|
|
89
95
|
|
|
90
96
|
var fieldNames = field.decoratorProps.fieldNames || {};
|
|
91
97
|
fieldNames['start'] = start;
|
|
92
|
-
field.decoratorProps.
|
|
93
|
-
fieldSchema['x-decorator-props']['
|
|
98
|
+
field.decoratorProps.fieldNames = fieldNames;
|
|
99
|
+
fieldSchema['x-decorator-props']['fieldNames'] = fieldNames;
|
|
94
100
|
service.refresh();
|
|
95
101
|
dn.emit('patch', {
|
|
96
102
|
schema: (_schema2 = {}, _defineProperty(_schema2, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema2, 'x-decorator-props', field.decoratorProps), _schema2)
|
|
@@ -100,14 +106,14 @@ export var CalendarDesigner = function CalendarDesigner() {
|
|
|
100
106
|
}), /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
|
|
101
107
|
title: t('End date field'),
|
|
102
108
|
value: fieldNames.end,
|
|
103
|
-
options:
|
|
109
|
+
options: useOptions('date'),
|
|
104
110
|
onChange: function onChange(end) {
|
|
105
111
|
var _schema3;
|
|
106
112
|
|
|
107
113
|
var fieldNames = field.decoratorProps.fieldNames || {};
|
|
108
114
|
fieldNames['end'] = end;
|
|
109
|
-
field.decoratorProps.
|
|
110
|
-
fieldSchema['x-decorator-props']['
|
|
115
|
+
field.decoratorProps.fieldNames = fieldNames;
|
|
116
|
+
fieldSchema['x-decorator-props']['fieldNames'] = fieldNames;
|
|
111
117
|
service.refresh();
|
|
112
118
|
dn.emit('patch', {
|
|
113
119
|
schema: (_schema3 = {}, _defineProperty(_schema3, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema3, 'x-decorator-props', field.decoratorProps), _schema3)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { DatePickerProps as AntdDatePickerProps, RangePickerProps as AntdRangePickerProps } from 'antd/lib/date-picker';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
declare type ComposedDatePicker = React.FC<AntdDatePickerProps> & {
|
|
4
4
|
RangePicker?: React.FC<AntdRangePickerProps>;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DatePicker as AntdDatePicker } from 'antd';
|
|
2
1
|
import { connect, mapProps, mapReadPretty } from '@formily/react';
|
|
2
|
+
import { DatePicker as AntdDatePicker } from 'antd';
|
|
3
3
|
import { ReadPretty } from './ReadPretty';
|
|
4
4
|
import { mapDateFormat } from './util';
|
|
5
5
|
export var DatePicker = connect(AntdDatePicker, mapProps(mapDateFormat()), mapReadPretty(ReadPretty.DatePicker));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { usePrefixCls } from '@formily/antd/lib/__builtins__';
|
|
2
2
|
import { isArr } from '@formily/shared';
|
|
3
|
+
import { getDefaultFormat, str2moment } from '@nocobase/utils/client';
|
|
3
4
|
import cls from 'classnames';
|
|
4
5
|
import moment from 'moment';
|
|
5
6
|
import React from 'react';
|
|
6
|
-
import { getDefaultFormat, str2moment } from './util';
|
|
7
7
|
export var ReadPretty = function ReadPretty() {
|
|
8
8
|
return null;
|
|
9
9
|
};
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import type { DatePickerProps } from 'antd/lib/date-picker';
|
|
2
1
|
import moment from 'moment';
|
|
3
|
-
export interface Str2momentOptions {
|
|
4
|
-
gmt?: boolean;
|
|
5
|
-
picker?: 'year' | 'month' | 'week' | 'quarter';
|
|
6
|
-
}
|
|
7
|
-
export declare const str2moment: (value?: string | string[], options?: Str2momentOptions) => any;
|
|
8
2
|
export interface Moment2strOptions {
|
|
9
3
|
showTime?: boolean;
|
|
10
4
|
gmt?: boolean;
|
|
11
5
|
picker?: 'year' | 'month' | 'week' | 'quarter';
|
|
12
6
|
}
|
|
13
7
|
export declare const moment2str: (value?: moment.Moment | moment.Moment[], options?: Moment2strOptions) => string | string[] | moment.Moment | moment.Moment[];
|
|
14
|
-
export declare const getDefaultFormat: (props: DatePickerProps & {
|
|
15
|
-
dateFormat: string;
|
|
16
|
-
timeFormat: string;
|
|
17
|
-
}) => string | import("rc-picker/lib/interface").CustomFormat<moment.Moment> | (string | import("rc-picker/lib/interface").CustomFormat<moment.Moment>)[];
|
|
18
8
|
export declare const mapDateFormat: () => (props: any) => any;
|