@nocobase/client 0.7.2-alpha.7 → 0.7.4-alpha.4
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/FormBlockProvider.js +15 -3
- package/es/block-provider/TableFieldProvider.d.ts +1 -0
- package/es/block-provider/TableFieldProvider.js +5 -2
- package/es/block-provider/TableSelectorProvider.js +42 -14
- package/es/block-provider/hooks/index.d.ts +6 -0
- package/es/block-provider/hooks/index.js +159 -65
- package/es/collection-manager/CollectionField.js +11 -4
- package/es/collection-manager/Configuration/AddFieldAction.js +6 -0
- package/es/collection-manager/Configuration/EditFieldAction.js +7 -0
- package/es/collection-manager/Configuration/index.js +5 -1
- package/es/collection-manager/Configuration/schemas/collections.js +2 -1
- package/es/collection-manager/interfaces/checkbox.js +1 -0
- package/es/collection-manager/interfaces/checkboxGroup.js +1 -0
- package/es/collection-manager/interfaces/datetime.js +1 -0
- package/es/collection-manager/interfaces/email.js +1 -0
- package/es/collection-manager/interfaces/icon.js +1 -0
- package/es/collection-manager/interfaces/input.js +104 -0
- package/es/collection-manager/interfaces/integer.js +64 -0
- package/es/collection-manager/interfaces/m2m.js +2 -0
- package/es/collection-manager/interfaces/m2o.js +1 -0
- package/es/collection-manager/interfaces/markdown.js +35 -0
- package/es/collection-manager/interfaces/multipleSelect.js +1 -0
- package/es/collection-manager/interfaces/number.js +56 -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 +37 -1
- package/es/collection-manager/interfaces/percent.js +98 -0
- package/es/collection-manager/interfaces/phone.js +1 -0
- 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/collection-manager/interfaces/radioGroup.js +1 -0
- package/es/collection-manager/interfaces/richText.js +35 -0
- package/es/collection-manager/interfaces/select.js +1 -0
- package/es/collection-manager/interfaces/textarea.js +35 -0
- package/es/collection-manager/interfaces/time.js +1 -0
- package/es/file-manager/FileStorageShortcut.js +2 -2
- package/es/locale/en_US.d.ts +8 -2
- package/es/locale/en_US.js +9 -3
- package/es/locale/zh_CN.d.ts +28 -2
- package/es/locale/zh_CN.js +29 -3
- package/es/plugin-manager/PluginManager.d.ts +1 -0
- package/es/plugin-manager/PluginManager.js +20 -6
- package/es/schema-component/antd/action/Action.Modal.js +1 -1
- 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 +193 -10
- package/es/schema-component/antd/grid/Grid.js +72 -6
- package/es/schema-component/antd/input-number/InputNumber.d.ts +1 -5
- package/es/schema-component/antd/input-number/InputNumber.js +25 -1
- package/es/schema-component/antd/input-number/ReadPretty.js +2 -4
- package/es/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
- package/es/schema-component/antd/menu/Menu.js +6 -3
- package/es/schema-component/antd/percent/Percent.js +2 -2
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +27 -13
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +5 -3
- package/es/schema-component/antd/table/Table.Array.js +2 -2
- package/es/schema-component/antd/table/Table.Void.js +11 -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 +163 -92
- 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/antd/time-picker/ReadPretty.js +11 -5
- package/es/schema-component/core/DesignableSwitch.js +7 -1
- package/es/schema-component/hooks/useDesignable.js +21 -21
- package/es/schema-component/hooks/useProps.js +1 -1
- package/es/schema-initializer/buttons/FormItemInitializers.js +14 -3
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
- package/es/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -3
- package/es/schema-initializer/buttons/RecordBlockInitializers.js +32 -3
- package/es/schema-initializer/buttons/TabPaneInitializers.js +11 -3
- package/es/schema-initializer/buttons/TableActionInitializers.js +11 -0
- package/es/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
- package/es/schema-initializer/components/assigned-field/AssignedField.js +255 -69
- package/es/schema-initializer/items/index.d.ts +2 -0
- package/es/schema-initializer/items/index.js +48 -2
- package/es/schema-initializer/utils.js +22 -2
- package/es/schema-settings/SchemaSettings.js +7 -0
- package/es/system-settings/SystemSettingsShortcut.js +35 -12
- package/lib/application/Application.d.ts +1 -0
- package/lib/application/Application.js +11 -2
- package/lib/block-provider/FormBlockProvider.js +15 -2
- package/lib/block-provider/TableFieldProvider.d.ts +1 -0
- package/lib/block-provider/TableFieldProvider.js +4 -1
- package/lib/block-provider/TableSelectorProvider.js +42 -14
- package/lib/block-provider/hooks/index.d.ts +6 -0
- package/lib/block-provider/hooks/index.js +168 -67
- package/lib/collection-manager/CollectionField.js +12 -4
- package/lib/collection-manager/Configuration/AddFieldAction.js +6 -0
- package/lib/collection-manager/Configuration/EditFieldAction.js +7 -0
- package/lib/collection-manager/Configuration/index.js +5 -0
- package/lib/collection-manager/Configuration/schemas/collections.js +2 -1
- package/lib/collection-manager/interfaces/checkbox.js +1 -0
- package/lib/collection-manager/interfaces/checkboxGroup.js +1 -0
- package/lib/collection-manager/interfaces/datetime.js +1 -0
- package/lib/collection-manager/interfaces/email.js +1 -0
- package/lib/collection-manager/interfaces/icon.js +1 -0
- package/lib/collection-manager/interfaces/input.js +105 -0
- package/lib/collection-manager/interfaces/integer.js +66 -0
- package/lib/collection-manager/interfaces/m2m.js +2 -0
- package/lib/collection-manager/interfaces/m2o.js +1 -0
- package/lib/collection-manager/interfaces/markdown.js +36 -0
- package/lib/collection-manager/interfaces/multipleSelect.js +1 -0
- package/lib/collection-manager/interfaces/number.js +57 -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 +38 -1
- package/lib/collection-manager/interfaces/percent.js +100 -0
- package/lib/collection-manager/interfaces/phone.js +1 -0
- 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/collection-manager/interfaces/radioGroup.js +1 -0
- package/lib/collection-manager/interfaces/richText.js +36 -0
- package/lib/collection-manager/interfaces/select.js +1 -0
- package/lib/collection-manager/interfaces/textarea.js +36 -0
- package/lib/collection-manager/interfaces/time.js +1 -0
- package/lib/file-manager/FileStorageShortcut.js +1 -1
- package/lib/locale/en_US.d.ts +8 -2
- package/lib/locale/en_US.js +9 -3
- package/lib/locale/zh_CN.d.ts +28 -2
- package/lib/locale/zh_CN.js +29 -3
- package/lib/plugin-manager/PluginManager.d.ts +1 -0
- package/lib/plugin-manager/PluginManager.js +23 -5
- package/lib/schema-component/antd/action/Action.Modal.js +1 -1
- 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 +196 -12
- package/lib/schema-component/antd/grid/Grid.js +69 -3
- package/lib/schema-component/antd/input-number/InputNumber.d.ts +1 -5
- package/lib/schema-component/antd/input-number/InputNumber.js +28 -1
- package/lib/schema-component/antd/input-number/ReadPretty.js +2 -5
- package/lib/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
- package/lib/schema-component/antd/menu/Menu.js +6 -3
- package/lib/schema-component/antd/percent/Percent.js +2 -2
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +27 -12
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +4 -2
- package/lib/schema-component/antd/table/Table.Array.js +2 -2
- package/lib/schema-component/antd/table/Table.Void.js +11 -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 +172 -94
- 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/antd/time-picker/ReadPretty.js +10 -3
- package/lib/schema-component/core/DesignableSwitch.js +8 -1
- package/lib/schema-component/hooks/useDesignable.js +21 -21
- package/lib/schema-component/hooks/useProps.js +1 -1
- package/lib/schema-initializer/buttons/FormItemInitializers.js +14 -2
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -2
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +34 -4
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +11 -3
- package/lib/schema-initializer/buttons/TableActionInitializers.js +11 -0
- package/lib/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +257 -66
- package/lib/schema-initializer/items/index.d.ts +2 -0
- package/lib/schema-initializer/items/index.js +54 -2
- package/lib/schema-initializer/utils.js +22 -2
- package/lib/schema-settings/SchemaSettings.js +7 -0
- package/lib/system-settings/SystemSettingsShortcut.js +37 -13
- package/package.json +7 -4
|
@@ -95,11 +95,11 @@ var datetime = [{
|
|
|
95
95
|
value: '$dateNotAfter'
|
|
96
96
|
}, {
|
|
97
97
|
label: "{{ t('is empty') }}",
|
|
98
|
-
value: '$
|
|
98
|
+
value: '$empty',
|
|
99
99
|
noValue: true
|
|
100
100
|
}, {
|
|
101
101
|
label: "{{ t('is not empty') }}",
|
|
102
|
-
value: '$
|
|
102
|
+
value: '$notEmpty',
|
|
103
103
|
noValue: true
|
|
104
104
|
}];
|
|
105
105
|
exports.datetime = datetime;
|
|
@@ -213,11 +213,11 @@ var time = [{
|
|
|
213
213
|
value: '$neq'
|
|
214
214
|
}, {
|
|
215
215
|
label: '{{t("is empty")}}',
|
|
216
|
-
value: '$
|
|
216
|
+
value: '$empty',
|
|
217
217
|
noValue: true
|
|
218
218
|
}, {
|
|
219
219
|
label: '{{t("is not empty")}}',
|
|
220
|
-
value: '$
|
|
220
|
+
value: '$notEmpty',
|
|
221
221
|
noValue: true
|
|
222
222
|
}];
|
|
223
223
|
exports.time = time;
|
|
@@ -7,6 +7,8 @@ exports.richText = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _properties = require("./properties");
|
|
9
9
|
|
|
10
|
+
var _i18n = require("../../i18n");
|
|
11
|
+
|
|
10
12
|
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; }
|
|
11
13
|
|
|
12
14
|
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; }
|
|
@@ -28,6 +30,7 @@ var richText = {
|
|
|
28
30
|
'x-component': 'RichText'
|
|
29
31
|
}
|
|
30
32
|
},
|
|
33
|
+
hasDefaultValue: true,
|
|
31
34
|
properties: _objectSpread({}, _properties.defaultProps),
|
|
32
35
|
schemaInitialize: function schemaInitialize(schema, _ref) {
|
|
33
36
|
var block = _ref.block;
|
|
@@ -36,6 +39,39 @@ var richText = {
|
|
|
36
39
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
37
40
|
schema['x-component-props']['ellipsis'] = true;
|
|
38
41
|
}
|
|
42
|
+
},
|
|
43
|
+
validateSchema: function validateSchema(fieldSchema, formItemStyle) {
|
|
44
|
+
return {
|
|
45
|
+
max: {
|
|
46
|
+
type: 'number',
|
|
47
|
+
title: '{{ t("Max length") }}',
|
|
48
|
+
minimum: 0,
|
|
49
|
+
'x-decorator': 'FormItem',
|
|
50
|
+
'x-component': 'InputNumber',
|
|
51
|
+
'x-component-props': {
|
|
52
|
+
precision: 0
|
|
53
|
+
},
|
|
54
|
+
'x-reactions': "{{(field) => {\n const targetValue = field.query('.min').value();\n field.selfErrors =\n !!targetValue && !!field.value && targetValue > field.value ? '".concat(_i18n.i18n.t('Max length must greater than min length'), "' : ''\n }}}")
|
|
55
|
+
},
|
|
56
|
+
min: {
|
|
57
|
+
type: 'number',
|
|
58
|
+
title: '{{ t("Min length") }}',
|
|
59
|
+
minimum: 0,
|
|
60
|
+
'x-decorator': 'FormItem',
|
|
61
|
+
'x-component': 'InputNumber',
|
|
62
|
+
'x-component-props': {
|
|
63
|
+
precision: 0
|
|
64
|
+
},
|
|
65
|
+
'x-reactions': {
|
|
66
|
+
dependencies: ['.max'],
|
|
67
|
+
fulfill: {
|
|
68
|
+
state: {
|
|
69
|
+
selfErrors: "{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(_i18n.i18n.t('Min length must less than max length'), "' : ''}}")
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
39
75
|
}
|
|
40
76
|
};
|
|
41
77
|
exports.richText = richText;
|
|
@@ -7,6 +7,8 @@ exports.textarea = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _properties = require("./properties");
|
|
9
9
|
|
|
10
|
+
var _i18n = require("../../i18n");
|
|
11
|
+
|
|
10
12
|
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; }
|
|
11
13
|
|
|
12
14
|
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; }
|
|
@@ -28,6 +30,7 @@ var textarea = {
|
|
|
28
30
|
'x-component': 'Input.TextArea'
|
|
29
31
|
}
|
|
30
32
|
},
|
|
33
|
+
hasDefaultValue: true,
|
|
31
34
|
properties: _objectSpread({}, _properties.defaultProps),
|
|
32
35
|
schemaInitialize: function schemaInitialize(schema, _ref) {
|
|
33
36
|
var block = _ref.block;
|
|
@@ -36,6 +39,39 @@ var textarea = {
|
|
|
36
39
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
37
40
|
schema['x-component-props']['ellipsis'] = true;
|
|
38
41
|
}
|
|
42
|
+
},
|
|
43
|
+
validateSchema: function validateSchema(fieldSchema) {
|
|
44
|
+
return {
|
|
45
|
+
max: {
|
|
46
|
+
type: 'number',
|
|
47
|
+
title: '{{ t("Max length") }}',
|
|
48
|
+
minimum: 0,
|
|
49
|
+
'x-decorator': 'FormItem',
|
|
50
|
+
'x-component': 'InputNumber',
|
|
51
|
+
'x-component-props': {
|
|
52
|
+
precision: 0
|
|
53
|
+
},
|
|
54
|
+
'x-reactions': "{{(field) => {\n const targetValue = field.query('.min').value();\n field.selfErrors =\n !!targetValue && !!field.value && targetValue > field.value ? '".concat(_i18n.i18n.t('Max length must greater than min length'), "' : ''\n }}}")
|
|
55
|
+
},
|
|
56
|
+
min: {
|
|
57
|
+
type: 'number',
|
|
58
|
+
title: '{{ t("Min length") }}',
|
|
59
|
+
minimum: 0,
|
|
60
|
+
'x-decorator': 'FormItem',
|
|
61
|
+
'x-component': 'InputNumber',
|
|
62
|
+
'x-component-props': {
|
|
63
|
+
precision: 0
|
|
64
|
+
},
|
|
65
|
+
'x-reactions': {
|
|
66
|
+
dependencies: ['.max'],
|
|
67
|
+
fulfill: {
|
|
68
|
+
state: {
|
|
69
|
+
selfErrors: "{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(_i18n.i18n.t('Min length must less than max length'), "' : ''}}")
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
39
75
|
}
|
|
40
76
|
};
|
|
41
77
|
exports.textarea = textarea;
|
|
@@ -72,7 +72,7 @@ var FileStorageShortcut = function FileStorageShortcut() {
|
|
|
72
72
|
onClick: function onClick() {
|
|
73
73
|
setVisible(true);
|
|
74
74
|
},
|
|
75
|
-
icon: /*#__PURE__*/_react.default.createElement(_icons.
|
|
75
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.FileOutlined, null),
|
|
76
76
|
title: t('File storages')
|
|
77
77
|
}), /*#__PURE__*/_react.default.createElement(_schemaComponent.SchemaComponent, {
|
|
78
78
|
components: {
|
package/lib/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;
|
|
@@ -98,6 +98,7 @@ declare const _default: {
|
|
|
98
98
|
Update: string;
|
|
99
99
|
View: string;
|
|
100
100
|
"View record": string;
|
|
101
|
+
Refresh: string;
|
|
101
102
|
"Data changes": string;
|
|
102
103
|
"Field name": string;
|
|
103
104
|
"Before change": string;
|
|
@@ -372,7 +373,7 @@ declare const _default: {
|
|
|
372
373
|
"Reference template": string;
|
|
373
374
|
"Create calendar block": string;
|
|
374
375
|
"Create kanban block": string;
|
|
375
|
-
"
|
|
376
|
+
"Grouping field": string;
|
|
376
377
|
"Tab name": string;
|
|
377
378
|
"Current record blocks": string;
|
|
378
379
|
"Popup message": string;
|
|
@@ -549,5 +550,10 @@ declare const _default: {
|
|
|
549
550
|
"Field component": string;
|
|
550
551
|
Subtable: string;
|
|
551
552
|
Subform: string;
|
|
553
|
+
"Regular expression": string;
|
|
554
|
+
"Enabled languages": string;
|
|
555
|
+
"View all plugins": string;
|
|
556
|
+
Print: string;
|
|
557
|
+
'Single select and radio fields can be used as the grouping field': string;
|
|
552
558
|
};
|
|
553
559
|
export default _default;
|
package/lib/locale/en_US.js
CHANGED
|
@@ -60,7 +60,7 @@ var _default = {
|
|
|
60
60
|
"Select data source": "Select data source",
|
|
61
61
|
"Calendar": "Calendar",
|
|
62
62
|
"Kanban": "Kanban",
|
|
63
|
-
"Select
|
|
63
|
+
"Select grouping field": "Select grouping field",
|
|
64
64
|
"Media": "Media",
|
|
65
65
|
"Markdown": "Markdown",
|
|
66
66
|
"Wysiwyg": "Wysiwyg",
|
|
@@ -104,6 +104,7 @@ var _default = {
|
|
|
104
104
|
"Update": "Update",
|
|
105
105
|
"View": "View",
|
|
106
106
|
"View record": "View record",
|
|
107
|
+
"Refresh": "Refresh",
|
|
107
108
|
"Data changes": "Data changes",
|
|
108
109
|
"Field name": "Field name",
|
|
109
110
|
"Before change": "Before change",
|
|
@@ -378,7 +379,7 @@ var _default = {
|
|
|
378
379
|
"Reference template": "Reference template",
|
|
379
380
|
"Create calendar block": "Create calendar block",
|
|
380
381
|
"Create kanban block": "Create kanban block",
|
|
381
|
-
"
|
|
382
|
+
"Grouping field": "Grouping field",
|
|
382
383
|
"Tab name": "Tab name",
|
|
383
384
|
"Current record blocks": "Current record blocks",
|
|
384
385
|
"Popup message": "Popup message",
|
|
@@ -554,6 +555,11 @@ var _default = {
|
|
|
554
555
|
"Province/city/area name": "Province/city/area name",
|
|
555
556
|
"Field component": "Field component",
|
|
556
557
|
"Subtable": "Subtable",
|
|
557
|
-
"Subform": "Subform"
|
|
558
|
+
"Subform": "Subform",
|
|
559
|
+
"Regular expression": "Pattern",
|
|
560
|
+
"Enabled languages": "Enabled languages",
|
|
561
|
+
"View all plugins": "View all plugins",
|
|
562
|
+
"Print": "Print",
|
|
563
|
+
'Single select and radio fields can be used as the grouping field': 'Single select and radio fields can be used as the grouping field'
|
|
558
564
|
};
|
|
559
565
|
exports.default = _default;
|
package/lib/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;
|
|
@@ -98,6 +98,7 @@ declare const _default: {
|
|
|
98
98
|
Update: string;
|
|
99
99
|
View: string;
|
|
100
100
|
"View record": string;
|
|
101
|
+
Refresh: string;
|
|
101
102
|
"Data changes": string;
|
|
102
103
|
"Field name": string;
|
|
103
104
|
"Before change": string;
|
|
@@ -232,6 +233,26 @@ declare const _default: {
|
|
|
232
233
|
"Label field": string;
|
|
233
234
|
"Default is the ID field": string;
|
|
234
235
|
"Set default sorting rules": string;
|
|
236
|
+
"Set validation rules": string;
|
|
237
|
+
"Max length": string;
|
|
238
|
+
"Min length": string;
|
|
239
|
+
Maximum: string;
|
|
240
|
+
Minimum: string;
|
|
241
|
+
"Max length must greater than min length": string;
|
|
242
|
+
"Min length must less than max length": string;
|
|
243
|
+
"Maximum must greater than minimum": string;
|
|
244
|
+
"Minimum must less than maximum": string;
|
|
245
|
+
"Validation rule": string;
|
|
246
|
+
"Add validation rule": string;
|
|
247
|
+
Format: string;
|
|
248
|
+
"Regular expression": string;
|
|
249
|
+
"Error message": string;
|
|
250
|
+
Length: string;
|
|
251
|
+
"The field value cannot be greater than ": string;
|
|
252
|
+
"The field value cannot be less than ": string;
|
|
253
|
+
"The field value is not an integer number": string;
|
|
254
|
+
"Set default value": string;
|
|
255
|
+
"Default value": string;
|
|
235
256
|
"is before": string;
|
|
236
257
|
"is after": string;
|
|
237
258
|
"is on or after": string;
|
|
@@ -389,7 +410,8 @@ declare const _default: {
|
|
|
389
410
|
'Reference template': string;
|
|
390
411
|
'Create calendar block': string;
|
|
391
412
|
'Create kanban block': string;
|
|
392
|
-
'
|
|
413
|
+
'Grouping field': string;
|
|
414
|
+
'Single select and radio fields can be used as the grouping field': string;
|
|
393
415
|
'Tab name': string;
|
|
394
416
|
'Current record blocks': string;
|
|
395
417
|
'Popup message': string;
|
|
@@ -539,6 +561,7 @@ declare const _default: {
|
|
|
539
561
|
'Dynamic value': string;
|
|
540
562
|
'Current user': string;
|
|
541
563
|
'Current record': string;
|
|
564
|
+
'Current time': string;
|
|
542
565
|
'Popup close method': string;
|
|
543
566
|
'Automatic close': string;
|
|
544
567
|
'Manually close': string;
|
|
@@ -573,5 +596,8 @@ declare const _default: {
|
|
|
573
596
|
"One to one (belongs to)": string;
|
|
574
597
|
"Use the same time zone (GMT) for all users": string;
|
|
575
598
|
"Province/city/area name": string;
|
|
599
|
+
"Enabled languages": string;
|
|
600
|
+
"View all plugins": string;
|
|
601
|
+
Print: string;
|
|
576
602
|
};
|
|
577
603
|
export default _default;
|
package/lib/locale/zh_CN.js
CHANGED
|
@@ -60,7 +60,7 @@ var _default = {
|
|
|
60
60
|
"Select data source": "选择数据源",
|
|
61
61
|
"Calendar": "日历",
|
|
62
62
|
"Kanban": "看板",
|
|
63
|
-
"Select
|
|
63
|
+
"Select grouping field": "选择分组字段",
|
|
64
64
|
"Media": "多媒体",
|
|
65
65
|
"Markdown": "Markdown",
|
|
66
66
|
"Wysiwyg": "富文本",
|
|
@@ -104,6 +104,7 @@ var _default = {
|
|
|
104
104
|
"Update": "更新",
|
|
105
105
|
"View": "查看",
|
|
106
106
|
"View record": "查看数据",
|
|
107
|
+
"Refresh": "刷新",
|
|
107
108
|
"Data changes": "数据变更",
|
|
108
109
|
"Field name": "字段标识",
|
|
109
110
|
"Before change": "变更前",
|
|
@@ -238,6 +239,26 @@ var _default = {
|
|
|
238
239
|
"Label field": "标签字段",
|
|
239
240
|
"Default is the ID field": "默认为 ID 字段",
|
|
240
241
|
"Set default sorting rules": "设置排序规则",
|
|
242
|
+
"Set validation rules": "设置验证规则",
|
|
243
|
+
"Max length": "最大长度",
|
|
244
|
+
"Min length": "最小长度",
|
|
245
|
+
"Maximum": "最大值",
|
|
246
|
+
"Minimum": "最小值",
|
|
247
|
+
"Max length must greater than min length": "最大长度必须大于最小长度",
|
|
248
|
+
"Min length must less than max length": "最小长度必须小于最大长度",
|
|
249
|
+
"Maximum must greater than minimum": "最大值必须大于最小值",
|
|
250
|
+
"Minimum must less than maximum": "最小值必须小于最大值",
|
|
251
|
+
"Validation rule": "验证规则",
|
|
252
|
+
"Add validation rule": "新增验证规则",
|
|
253
|
+
"Format": "格式",
|
|
254
|
+
"Regular expression": "正则表达式",
|
|
255
|
+
"Error message": "错误消息",
|
|
256
|
+
"Length": "长度",
|
|
257
|
+
"The field value cannot be greater than ": "数值不能大于",
|
|
258
|
+
"The field value cannot be less than ": "数值不能小于",
|
|
259
|
+
"The field value is not an integer number": "数字不是整数",
|
|
260
|
+
"Set default value": "设置默认值",
|
|
261
|
+
"Default value": "默认值",
|
|
241
262
|
"is before": "早于",
|
|
242
263
|
"is after": "晚于",
|
|
243
264
|
"is on or after": "不早于",
|
|
@@ -395,7 +416,8 @@ var _default = {
|
|
|
395
416
|
'Reference template': '引用模板',
|
|
396
417
|
'Create calendar block': '创建日历区块',
|
|
397
418
|
'Create kanban block': '创建看板区块',
|
|
398
|
-
'
|
|
419
|
+
'Grouping field': '分组字段',
|
|
420
|
+
'Single select and radio fields can be used as the grouping field': '数据表的单选字段可以作为分组字段',
|
|
399
421
|
'Tab name': '标签名称',
|
|
400
422
|
'Current record blocks': '当前数据区块',
|
|
401
423
|
'Popup message': '弹窗提示消息',
|
|
@@ -546,6 +568,7 @@ var _default = {
|
|
|
546
568
|
'Dynamic value': '动态值',
|
|
547
569
|
'Current user': '当前用户',
|
|
548
570
|
'Current record': '当前记录',
|
|
571
|
+
'Current time': '当前时间',
|
|
549
572
|
'Popup close method': '弹窗关闭方式',
|
|
550
573
|
'Automatic close': '自动关闭',
|
|
551
574
|
'Manually close': '手动关闭',
|
|
@@ -580,6 +603,9 @@ var _default = {
|
|
|
580
603
|
"One to one (has one)": "一对一(has one)",
|
|
581
604
|
"One to one (belongs to)": "一对一(belongs to)",
|
|
582
605
|
"Use the same time zone (GMT) for all users": "所有用户使用同一时区 (格林尼治标准时间)",
|
|
583
|
-
"Province/city/area name": "省市区名称"
|
|
606
|
+
"Province/city/area name": "省市区名称",
|
|
607
|
+
"Enabled languages": "启用的语言",
|
|
608
|
+
"View all plugins": "查看所有插件",
|
|
609
|
+
"Print": "打印"
|
|
584
610
|
};
|
|
585
611
|
exports.default = _default;
|
|
@@ -9,6 +9,8 @@ exports.usePrefixCls = exports.RemotePluginManagerToolbar = exports.PluginManage
|
|
|
9
9
|
|
|
10
10
|
var _icons = require("@ant-design/icons");
|
|
11
11
|
|
|
12
|
+
var _css = require("@emotion/css");
|
|
13
|
+
|
|
12
14
|
var _antd = require("antd");
|
|
13
15
|
|
|
14
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -17,11 +19,15 @@ var _lodash = require("lodash");
|
|
|
17
19
|
|
|
18
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
21
|
|
|
22
|
+
var _reactI18next = require("react-i18next");
|
|
23
|
+
|
|
20
24
|
var _apiClient = require("../api-client");
|
|
21
25
|
|
|
22
26
|
var _context = require("./context");
|
|
23
27
|
|
|
24
|
-
var
|
|
28
|
+
var _templateObject;
|
|
29
|
+
|
|
30
|
+
var _excluded = ["selected", "icon", "title", "subtitle"];
|
|
25
31
|
|
|
26
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
33
|
|
|
@@ -33,6 +39,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
33
39
|
|
|
34
40
|
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; }
|
|
35
41
|
|
|
42
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
43
|
+
|
|
36
44
|
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; }
|
|
37
45
|
|
|
38
46
|
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; }
|
|
@@ -107,6 +115,9 @@ PluginManager.Toolbar = function (props) {
|
|
|
107
115
|
pinned = _splitItems2[0],
|
|
108
116
|
unpinned = _splitItems2[1];
|
|
109
117
|
|
|
118
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
119
|
+
t = _useTranslation.t;
|
|
120
|
+
|
|
110
121
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
111
122
|
style: {
|
|
112
123
|
display: 'inline-block'
|
|
@@ -127,7 +138,7 @@ PluginManager.Toolbar = function (props) {
|
|
|
127
138
|
}), unpinned.length > 0 && /*#__PURE__*/_react.default.createElement(_antd.Menu.SubMenu, {
|
|
128
139
|
popupClassName: 'pm-sub-menu',
|
|
129
140
|
key: 'more',
|
|
130
|
-
title: /*#__PURE__*/_react.default.createElement(_icons.
|
|
141
|
+
title: /*#__PURE__*/_react.default.createElement(_icons.EllipsisOutlined, null)
|
|
131
142
|
}, unpinned.map(function (item, index) {
|
|
132
143
|
var Action = (0, _lodash.get)(components, item.component);
|
|
133
144
|
return Action && /*#__PURE__*/_react.default.createElement(ToolbarItemContext.Provider, {
|
|
@@ -139,8 +150,8 @@ PluginManager.Toolbar = function (props) {
|
|
|
139
150
|
}), /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
140
151
|
key: 'plugins',
|
|
141
152
|
disabled: true,
|
|
142
|
-
icon: /*#__PURE__*/_react.default.createElement(_icons.
|
|
143
|
-
},
|
|
153
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.AppstoreOutlined, null)
|
|
154
|
+
}, t('View all plugins')))));
|
|
144
155
|
};
|
|
145
156
|
|
|
146
157
|
PluginManager.Toolbar.Item = function (props) {
|
|
@@ -149,14 +160,21 @@ PluginManager.Toolbar.Item = function (props) {
|
|
|
149
160
|
var selected = props.selected,
|
|
150
161
|
icon = props.icon,
|
|
151
162
|
title = props.title,
|
|
163
|
+
subtitle = props.subtitle,
|
|
152
164
|
others = _objectWithoutProperties(props, _excluded);
|
|
153
165
|
|
|
154
166
|
var prefix = usePrefixCls();
|
|
155
167
|
var className = (0, _classnames.default)(_defineProperty({}, "".concat(prefix, "-menu-item-selected"), selected));
|
|
156
168
|
|
|
157
169
|
if (item.pin) {
|
|
170
|
+
var subtitleComponent = subtitle && /*#__PURE__*/_react.default.createElement("div", {
|
|
171
|
+
className: (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: 12px;\n color: #999;\n "])))
|
|
172
|
+
}, subtitle);
|
|
173
|
+
|
|
174
|
+
var titleComponent = /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", null, title), subtitleComponent);
|
|
175
|
+
|
|
158
176
|
return /*#__PURE__*/_react.default.createElement(_antd.Tooltip, {
|
|
159
|
-
title:
|
|
177
|
+
title: titleComponent
|
|
160
178
|
}, /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, _objectSpread(_objectSpread({}, others), {}, {
|
|
161
179
|
className: className,
|
|
162
180
|
eventKey: item.component
|
|
@@ -68,7 +68,7 @@ var ActionModal = (0, _react.observer)(function (props) {
|
|
|
68
68
|
onCancel: function onCancel() {
|
|
69
69
|
return setVisible(false, true);
|
|
70
70
|
},
|
|
71
|
-
className: (0, _classnames.default)(others.className, (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.nb-action-popup {\n .ant-modal-body {\n background: #f0f2f5;\n }\n }\n "])))),
|
|
71
|
+
className: (0, _classnames.default)(others.className, (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.nb-action-popup {\n .ant-modal-header {\n display: none;\n }\n .ant-modal-body {\n padding-top: 16px;\n }\n .ant-modal-body {\n background: #f0f2f5;\n }\n .ant-modal-close-x {\n width: 32px;\n height: 32px;\n line-height: 32px;\n }\n }\n "])))),
|
|
72
72
|
footer: footerSchema ? /*#__PURE__*/_react2.default.createElement("div", {
|
|
73
73
|
className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n width: 100%;\n .ant-btn {\n margin-right: 8px;\n }\n "])))
|
|
74
74
|
}, /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
|
|
@@ -32,12 +32,17 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
32
32
|
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; }
|
|
33
33
|
|
|
34
34
|
var useOptions = function useOptions() {
|
|
35
|
+
var _fields$filter;
|
|
36
|
+
|
|
37
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'string';
|
|
35
38
|
var compile = (0, _.useCompile)();
|
|
36
39
|
|
|
37
40
|
var _useCollection = (0, _collectionManager.useCollection)(),
|
|
38
41
|
fields = _useCollection.fields;
|
|
39
42
|
|
|
40
|
-
var options = fields === null || fields === void 0 ? void 0 : fields.
|
|
43
|
+
var options = fields === null || fields === void 0 ? void 0 : (_fields$filter = fields.filter(function (field) {
|
|
44
|
+
return field.type === type;
|
|
45
|
+
})) === null || _fields$filter === void 0 ? void 0 : _fields$filter.map(function (field) {
|
|
41
46
|
var _field$uiSchema;
|
|
42
47
|
|
|
43
48
|
return {
|
|
@@ -74,7 +79,6 @@ var CalendarDesigner = function CalendarDesigner() {
|
|
|
74
79
|
|
|
75
80
|
var template = (0, _schemaTemplates.useSchemaTemplate)();
|
|
76
81
|
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) || {};
|
|
77
|
-
var options = useOptions();
|
|
78
82
|
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']) || {};
|
|
79
83
|
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;
|
|
80
84
|
return /*#__PURE__*/_react2.default.createElement(_schemaSettings.GeneralSchemaDesigner, {
|
|
@@ -83,14 +87,16 @@ var CalendarDesigner = function CalendarDesigner() {
|
|
|
83
87
|
}, /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.BlockTitleItem, null), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SelectItem, {
|
|
84
88
|
title: t('Title field'),
|
|
85
89
|
value: fieldNames.title,
|
|
86
|
-
options:
|
|
90
|
+
options: useOptions('string'),
|
|
87
91
|
onChange: function onChange(title) {
|
|
88
92
|
var _schema;
|
|
89
93
|
|
|
90
94
|
var fieldNames = field.decoratorProps.fieldNames || {};
|
|
91
95
|
fieldNames['title'] = title;
|
|
92
96
|
field.decoratorProps.params = fieldNames;
|
|
93
|
-
fieldSchema['x-decorator-props']['params'] = fieldNames;
|
|
97
|
+
fieldSchema['x-decorator-props']['params'] = fieldNames; // Select切换option后value未按照预期切换,固增加以下代码
|
|
98
|
+
|
|
99
|
+
fieldSchema['x-decorator-props']['fieldNames'] = fieldNames;
|
|
94
100
|
service.refresh();
|
|
95
101
|
dn.emit('patch', {
|
|
96
102
|
schema: (_schema = {}, _defineProperty(_schema, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema, 'x-decorator-props', field.decoratorProps), _schema)
|
|
@@ -100,14 +106,14 @@ var CalendarDesigner = function CalendarDesigner() {
|
|
|
100
106
|
}), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SelectItem, {
|
|
101
107
|
title: t('Start date field'),
|
|
102
108
|
value: fieldNames.start,
|
|
103
|
-
options:
|
|
109
|
+
options: useOptions('date'),
|
|
104
110
|
onChange: function onChange(start) {
|
|
105
111
|
var _schema2;
|
|
106
112
|
|
|
107
113
|
var fieldNames = field.decoratorProps.fieldNames || {};
|
|
108
114
|
fieldNames['start'] = start;
|
|
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: (_schema2 = {}, _defineProperty(_schema2, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema2, 'x-decorator-props', field.decoratorProps), _schema2)
|
|
@@ -117,14 +123,14 @@ var CalendarDesigner = function CalendarDesigner() {
|
|
|
117
123
|
}), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SelectItem, {
|
|
118
124
|
title: t('End date field'),
|
|
119
125
|
value: fieldNames.end,
|
|
120
|
-
options:
|
|
126
|
+
options: useOptions('date'),
|
|
121
127
|
onChange: function onChange(end) {
|
|
122
128
|
var _schema3;
|
|
123
129
|
|
|
124
130
|
var fieldNames = field.decoratorProps.fieldNames || {};
|
|
125
131
|
fieldNames['end'] = end;
|
|
126
|
-
field.decoratorProps.
|
|
127
|
-
fieldSchema['x-decorator-props']['
|
|
132
|
+
field.decoratorProps.fieldNames = fieldNames;
|
|
133
|
+
fieldSchema['x-decorator-props']['fieldNames'] = fieldNames;
|
|
128
134
|
service.refresh();
|
|
129
135
|
dn.emit('patch', {
|
|
130
136
|
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
|
};
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.DatePicker = void 0;
|
|
7
7
|
|
|
8
|
-
var _antd = require("antd");
|
|
9
|
-
|
|
10
8
|
var _react = require("@formily/react");
|
|
11
9
|
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
|
|
12
12
|
var _ReadPretty = require("./ReadPretty");
|
|
13
13
|
|
|
14
14
|
var _util = require("./util");
|
|
@@ -9,14 +9,14 @@ var _builtins__ = require("@formily/antd/lib/__builtins__");
|
|
|
9
9
|
|
|
10
10
|
var _shared = require("@formily/shared");
|
|
11
11
|
|
|
12
|
+
var _client = require("@nocobase/utils/client");
|
|
13
|
+
|
|
12
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
15
|
|
|
14
16
|
var _moment = _interopRequireDefault(require("moment"));
|
|
15
17
|
|
|
16
18
|
var _react = _interopRequireDefault(require("react"));
|
|
17
19
|
|
|
18
|
-
var _util = require("./util");
|
|
19
|
-
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
22
|
var ReadPretty = function ReadPretty() {
|
|
@@ -33,8 +33,8 @@ ReadPretty.DatePicker = function (props) {
|
|
|
33
33
|
var prefixCls = (0, _builtins__.usePrefixCls)('description-date-picker', props);
|
|
34
34
|
|
|
35
35
|
var getLabels = function getLabels() {
|
|
36
|
-
var format = (0,
|
|
37
|
-
var m = (0,
|
|
36
|
+
var format = (0, _client.getDefaultFormat)(props);
|
|
37
|
+
var m = (0, _client.str2moment)(props.value, props);
|
|
38
38
|
var labels = _moment.default.isMoment(m) ? m.format(format) : '';
|
|
39
39
|
return (0, _shared.isArr)(labels) ? labels.join('~') : labels;
|
|
40
40
|
};
|
|
@@ -46,10 +46,10 @@ ReadPretty.DatePicker = function (props) {
|
|
|
46
46
|
|
|
47
47
|
ReadPretty.DateRangePicker = function (props) {
|
|
48
48
|
var prefixCls = (0, _builtins__.usePrefixCls)('description-text', props);
|
|
49
|
-
var format = (0,
|
|
49
|
+
var format = (0, _client.getDefaultFormat)(props);
|
|
50
50
|
|
|
51
51
|
var getLabels = function getLabels() {
|
|
52
|
-
var m = (0,
|
|
52
|
+
var m = (0, _client.str2moment)(props.value, props);
|
|
53
53
|
|
|
54
54
|
if (!m) {
|
|
55
55
|
return '';
|