@nocobase/client 0.7.2-alpha.5 → 0.7.3-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/block-provider/FormBlockProvider.js +8 -3
- package/es/block-provider/TableSelectorProvider.js +41 -13
- package/es/block-provider/hooks/index.d.ts +6 -0
- package/es/block-provider/hooks/index.js +145 -63
- package/es/collection-manager/CollectionField.js +5 -3
- package/es/collection-manager/interfaces/input.js +103 -0
- package/es/collection-manager/interfaces/integer.js +63 -0
- package/es/collection-manager/interfaces/markdown.js +34 -0
- package/es/collection-manager/interfaces/number.js +55 -0
- package/es/collection-manager/interfaces/password.js +35 -1
- package/es/collection-manager/interfaces/percent.js +97 -0
- package/es/collection-manager/interfaces/richText.js +34 -0
- package/es/collection-manager/interfaces/textarea.js +34 -0
- package/es/file-manager/FileStorageShortcut.js +2 -2
- package/es/locale/en_US.d.ts +5 -0
- package/es/locale/en_US.js +6 -1
- package/es/locale/zh_CN.d.ts +23 -0
- package/es/locale/zh_CN.js +24 -1
- package/es/plugin-manager/PluginManager.js +8 -4
- package/es/schema-component/antd/action/Action.Modal.js +1 -1
- package/es/schema-component/antd/form-item/FormItem.js +156 -3
- 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/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 +4 -2
- 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.js +1 -4
- package/es/schema-component/antd/time-picker/ReadPretty.js +11 -5
- 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/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 +253 -69
- package/es/schema-initializer/items/index.d.ts +2 -0
- package/es/schema-initializer/items/index.js +46 -1
- package/es/schema-initializer/utils.js +6 -2
- package/es/system-settings/SystemSettingsShortcut.js +35 -12
- package/lib/block-provider/FormBlockProvider.js +7 -2
- package/lib/block-provider/TableSelectorProvider.js +41 -13
- package/lib/block-provider/hooks/index.d.ts +6 -0
- package/lib/block-provider/hooks/index.js +154 -65
- package/lib/collection-manager/CollectionField.js +5 -2
- package/lib/collection-manager/interfaces/input.js +104 -0
- package/lib/collection-manager/interfaces/integer.js +65 -0
- package/lib/collection-manager/interfaces/markdown.js +35 -0
- package/lib/collection-manager/interfaces/number.js +56 -0
- package/lib/collection-manager/interfaces/password.js +36 -1
- package/lib/collection-manager/interfaces/percent.js +99 -0
- package/lib/collection-manager/interfaces/richText.js +35 -0
- package/lib/collection-manager/interfaces/textarea.js +35 -0
- package/lib/file-manager/FileStorageShortcut.js +1 -1
- package/lib/locale/en_US.d.ts +5 -0
- package/lib/locale/en_US.js +6 -1
- package/lib/locale/zh_CN.d.ts +23 -0
- package/lib/locale/zh_CN.js +24 -1
- package/lib/plugin-manager/PluginManager.js +8 -3
- package/lib/schema-component/antd/action/Action.Modal.js +1 -1
- package/lib/schema-component/antd/form-item/FormItem.js +165 -5
- 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 +29 -2
- 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 +3 -1
- 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.js +1 -4
- package/lib/schema-component/antd/time-picker/ReadPretty.js +10 -3
- 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/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 +254 -66
- package/lib/schema-initializer/items/index.d.ts +2 -0
- package/lib/schema-initializer/items/index.js +52 -1
- package/lib/schema-initializer/utils.js +6 -2
- package/lib/system-settings/SystemSettingsShortcut.js +37 -13
- package/package.json +6 -4
|
@@ -7,6 +7,8 @@ exports.input = 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; }
|
|
@@ -39,6 +41,108 @@ var input = {
|
|
|
39
41
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
40
42
|
schema['x-component-props']['ellipsis'] = true;
|
|
41
43
|
}
|
|
44
|
+
},
|
|
45
|
+
validateSchema: function validateSchema(fieldSchema) {
|
|
46
|
+
return {
|
|
47
|
+
max: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
title: '{{ t("Max length") }}',
|
|
50
|
+
minimum: 0,
|
|
51
|
+
'x-decorator': 'FormItem',
|
|
52
|
+
'x-component': 'InputNumber',
|
|
53
|
+
'x-component-props': {
|
|
54
|
+
precision: 0
|
|
55
|
+
},
|
|
56
|
+
'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 }}}")
|
|
57
|
+
},
|
|
58
|
+
min: {
|
|
59
|
+
type: 'number',
|
|
60
|
+
title: '{{ t("Min length") }}',
|
|
61
|
+
minimum: 0,
|
|
62
|
+
'x-decorator': 'FormItem',
|
|
63
|
+
'x-component': 'InputNumber',
|
|
64
|
+
'x-component-props': {
|
|
65
|
+
precision: 0
|
|
66
|
+
},
|
|
67
|
+
'x-reactions': {
|
|
68
|
+
dependencies: ['.max'],
|
|
69
|
+
fulfill: {
|
|
70
|
+
state: {
|
|
71
|
+
selfErrors: "{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(_i18n.i18n.t('Min length must less than max length'), "' : ''}}")
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
len: {
|
|
77
|
+
type: 'number',
|
|
78
|
+
title: '{{ t("Length") }}',
|
|
79
|
+
minimum: 0,
|
|
80
|
+
'x-decorator': 'FormItem',
|
|
81
|
+
'x-component': 'InputNumber',
|
|
82
|
+
'x-component-props': {
|
|
83
|
+
precision: 0
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
format: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
title: '{{ t("Format") }}',
|
|
89
|
+
'x-decorator': 'FormItem',
|
|
90
|
+
'x-component': 'Select',
|
|
91
|
+
'x-component-props': {
|
|
92
|
+
allowClear: true
|
|
93
|
+
},
|
|
94
|
+
enum: [{
|
|
95
|
+
label: '{{ t("url") }}',
|
|
96
|
+
value: 'url'
|
|
97
|
+
}, {
|
|
98
|
+
label: '{{ t("email") }}',
|
|
99
|
+
value: 'email'
|
|
100
|
+
}, {
|
|
101
|
+
label: '{{ t("ipv6") }}',
|
|
102
|
+
value: 'ipv6'
|
|
103
|
+
}, {
|
|
104
|
+
label: '{{ t("ipv4") }}',
|
|
105
|
+
value: 'ipv4'
|
|
106
|
+
}, {
|
|
107
|
+
label: '{{ t("number") }}',
|
|
108
|
+
value: 'number'
|
|
109
|
+
}, {
|
|
110
|
+
label: '{{ t("integer") }}',
|
|
111
|
+
value: 'integer'
|
|
112
|
+
}, {
|
|
113
|
+
label: '{{ t("idcard") }}',
|
|
114
|
+
value: 'idcard'
|
|
115
|
+
}, {
|
|
116
|
+
label: '{{ t("qq") }}',
|
|
117
|
+
value: 'qq'
|
|
118
|
+
}, {
|
|
119
|
+
label: '{{ t("phone") }}',
|
|
120
|
+
value: 'phone'
|
|
121
|
+
}, {
|
|
122
|
+
label: '{{ t("money") }}',
|
|
123
|
+
value: 'money'
|
|
124
|
+
}, {
|
|
125
|
+
label: '{{ t("zh") }}',
|
|
126
|
+
value: 'zh'
|
|
127
|
+
}, {
|
|
128
|
+
label: '{{ t("date") }}',
|
|
129
|
+
value: 'date'
|
|
130
|
+
}, {
|
|
131
|
+
label: '{{ t("zip") }}',
|
|
132
|
+
value: 'zip'
|
|
133
|
+
}]
|
|
134
|
+
},
|
|
135
|
+
pattern: {
|
|
136
|
+
type: 'string',
|
|
137
|
+
title: '{{ t("Regular expression") }}',
|
|
138
|
+
'x-decorator': 'FormItem',
|
|
139
|
+
'x-component': 'Input',
|
|
140
|
+
'x-component-props': {
|
|
141
|
+
prefix: '/',
|
|
142
|
+
suffix: '/'
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
42
146
|
}
|
|
43
147
|
};
|
|
44
148
|
exports.input = input;
|
|
@@ -7,12 +7,20 @@ exports.integer = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _properties = require("./properties");
|
|
9
9
|
|
|
10
|
+
var _i18n = require("../../i18n");
|
|
11
|
+
|
|
12
|
+
var _core = require("@formily/core");
|
|
13
|
+
|
|
10
14
|
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
15
|
|
|
12
16
|
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; }
|
|
13
17
|
|
|
14
18
|
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; }
|
|
15
19
|
|
|
20
|
+
(0, _core.registerValidateFormats)({
|
|
21
|
+
odd: /^-?\d*[13579]$/,
|
|
22
|
+
even: /^-?\d*[02468]$/
|
|
23
|
+
});
|
|
16
24
|
var integer = {
|
|
17
25
|
name: 'integer',
|
|
18
26
|
type: 'object',
|
|
@@ -37,6 +45,63 @@ var integer = {
|
|
|
37
45
|
properties: _objectSpread({}, _properties.defaultProps),
|
|
38
46
|
filterable: {
|
|
39
47
|
operators: _properties.operators.number
|
|
48
|
+
},
|
|
49
|
+
validateSchema: function validateSchema(fieldSchema) {
|
|
50
|
+
return {
|
|
51
|
+
maximum: {
|
|
52
|
+
type: 'number',
|
|
53
|
+
title: '{{ t("Maximum") }}',
|
|
54
|
+
'x-decorator': 'FormItem',
|
|
55
|
+
'x-component': 'InputNumber',
|
|
56
|
+
'x-component-props': {
|
|
57
|
+
precision: 0
|
|
58
|
+
},
|
|
59
|
+
'x-reactions': "{{(field) => {\n const targetValue = field.query('.minimum').value();\n field.selfErrors =\n !!targetValue && !!field.value && targetValue > field.value ? '".concat(_i18n.i18n.t('Maximum must greater than minimum'), "' : ''\n }}}")
|
|
60
|
+
},
|
|
61
|
+
minimum: {
|
|
62
|
+
type: 'number',
|
|
63
|
+
title: '{{ t("Minimum") }}',
|
|
64
|
+
'x-decorator': 'FormItem',
|
|
65
|
+
'x-component': 'InputNumber',
|
|
66
|
+
'x-component-props': {
|
|
67
|
+
precision: 0
|
|
68
|
+
},
|
|
69
|
+
'x-reactions': {
|
|
70
|
+
dependencies: ['.maximum'],
|
|
71
|
+
fulfill: {
|
|
72
|
+
state: {
|
|
73
|
+
selfErrors: "{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(_i18n.i18n.t('Minimum must less than maximum'), "' : ''}}")
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
format: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
title: '{{ t("Format") }}',
|
|
81
|
+
'x-decorator': 'FormItem',
|
|
82
|
+
'x-component': 'Select',
|
|
83
|
+
'x-component-props': {
|
|
84
|
+
allowClear: true
|
|
85
|
+
},
|
|
86
|
+
enum: [{
|
|
87
|
+
label: '{{ t("Odd") }}',
|
|
88
|
+
value: 'odd'
|
|
89
|
+
}, {
|
|
90
|
+
label: '{{ t("Even") }}',
|
|
91
|
+
value: 'even'
|
|
92
|
+
}]
|
|
93
|
+
},
|
|
94
|
+
pattern: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
title: '{{ t("Regular expression") }}',
|
|
97
|
+
'x-decorator': 'FormItem',
|
|
98
|
+
'x-component': 'Input',
|
|
99
|
+
'x-component-props': {
|
|
100
|
+
prefix: '/',
|
|
101
|
+
suffix: '/'
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
40
105
|
}
|
|
41
106
|
};
|
|
42
107
|
exports.integer = integer;
|
|
@@ -7,6 +7,8 @@ exports.markdown = 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; }
|
|
@@ -35,6 +37,39 @@ var markdown = {
|
|
|
35
37
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
36
38
|
schema['x-component-props']['ellipsis'] = true;
|
|
37
39
|
}
|
|
40
|
+
},
|
|
41
|
+
validateSchema: function validateSchema(fieldSchema) {
|
|
42
|
+
return {
|
|
43
|
+
max: {
|
|
44
|
+
type: 'number',
|
|
45
|
+
title: '{{ t("Max length") }}',
|
|
46
|
+
minimum: 0,
|
|
47
|
+
'x-decorator': 'FormItem',
|
|
48
|
+
'x-component': 'InputNumber',
|
|
49
|
+
'x-component-props': {
|
|
50
|
+
precision: 0
|
|
51
|
+
},
|
|
52
|
+
'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 }}}")
|
|
53
|
+
},
|
|
54
|
+
min: {
|
|
55
|
+
type: 'number',
|
|
56
|
+
title: '{{ t("Min length") }}',
|
|
57
|
+
minimum: 0,
|
|
58
|
+
'x-decorator': 'FormItem',
|
|
59
|
+
'x-component': 'InputNumber',
|
|
60
|
+
'x-component-props': {
|
|
61
|
+
precision: 0
|
|
62
|
+
},
|
|
63
|
+
'x-reactions': {
|
|
64
|
+
dependencies: ['.max'],
|
|
65
|
+
fulfill: {
|
|
66
|
+
state: {
|
|
67
|
+
selfErrors: "{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(_i18n.i18n.t('Min length must less than max length'), "' : ''}}")
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
38
73
|
}
|
|
39
74
|
};
|
|
40
75
|
exports.markdown = markdown;
|
|
@@ -7,6 +7,8 @@ exports.number = 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; }
|
|
@@ -63,6 +65,60 @@ var number = {
|
|
|
63
65
|
}),
|
|
64
66
|
filterable: {
|
|
65
67
|
operators: _properties.operators.number
|
|
68
|
+
},
|
|
69
|
+
validateSchema: function validateSchema(fieldSchema) {
|
|
70
|
+
return {
|
|
71
|
+
maximum: {
|
|
72
|
+
type: 'number',
|
|
73
|
+
title: '{{ t("Maximum") }}',
|
|
74
|
+
'x-decorator': 'FormItem',
|
|
75
|
+
'x-component': 'InputNumber',
|
|
76
|
+
'x-reactions': "{{(field) => {\n const targetValue = field.query('.minimum').value();\n field.selfErrors =\n !!targetValue && !!field.value && targetValue > field.value ? '".concat(_i18n.i18n.t('Maximum must greater than minimum'), "' : ''\n }}}")
|
|
77
|
+
},
|
|
78
|
+
minimum: {
|
|
79
|
+
type: 'number',
|
|
80
|
+
title: '{{ t("Minimum") }}',
|
|
81
|
+
'x-decorator': 'FormItem',
|
|
82
|
+
'x-component': 'InputNumber',
|
|
83
|
+
'x-reactions': {
|
|
84
|
+
dependencies: ['.maximum'],
|
|
85
|
+
fulfill: {
|
|
86
|
+
state: {
|
|
87
|
+
selfErrors: "{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(_i18n.i18n.t('Minimum must less than maximum'), "' : ''}}")
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
format: {
|
|
93
|
+
type: 'string',
|
|
94
|
+
title: '{{ t("Format") }}',
|
|
95
|
+
'x-decorator': 'FormItem',
|
|
96
|
+
'x-component': 'Select',
|
|
97
|
+
'x-component-props': {
|
|
98
|
+
allowClear: true
|
|
99
|
+
},
|
|
100
|
+
enum: [{
|
|
101
|
+
label: '{{ t("Integer") }}',
|
|
102
|
+
value: 'integer'
|
|
103
|
+
}, {
|
|
104
|
+
label: '{{ t("Odd") }}',
|
|
105
|
+
value: 'odd'
|
|
106
|
+
}, {
|
|
107
|
+
label: '{{ t("Even") }}',
|
|
108
|
+
value: 'even'
|
|
109
|
+
}]
|
|
110
|
+
},
|
|
111
|
+
pattern: {
|
|
112
|
+
type: 'string',
|
|
113
|
+
title: '{{ t("Regular expression") }}',
|
|
114
|
+
'x-decorator': 'FormItem',
|
|
115
|
+
'x-component': 'Input',
|
|
116
|
+
'x-component-props': {
|
|
117
|
+
prefix: '/',
|
|
118
|
+
suffix: '/'
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
66
122
|
}
|
|
67
123
|
};
|
|
68
124
|
exports.number = number;
|
|
@@ -7,6 +7,8 @@ exports.password = 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,39 @@ var password = {
|
|
|
28
30
|
'x-component': 'Password'
|
|
29
31
|
}
|
|
30
32
|
},
|
|
31
|
-
properties: _objectSpread({}, _properties.defaultProps)
|
|
33
|
+
properties: _objectSpread({}, _properties.defaultProps),
|
|
34
|
+
validateSchema: function validateSchema(fieldSchema) {
|
|
35
|
+
return {
|
|
36
|
+
max: {
|
|
37
|
+
type: 'number',
|
|
38
|
+
title: '{{ t("Max length") }}',
|
|
39
|
+
minimum: 0,
|
|
40
|
+
'x-decorator': 'FormItem',
|
|
41
|
+
'x-component': 'InputNumber',
|
|
42
|
+
'x-component-props': {
|
|
43
|
+
precision: 0
|
|
44
|
+
},
|
|
45
|
+
'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 }}}")
|
|
46
|
+
},
|
|
47
|
+
min: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
title: '{{ t("Min length") }}',
|
|
50
|
+
minimum: 0,
|
|
51
|
+
'x-decorator': 'FormItem',
|
|
52
|
+
'x-component': 'InputNumber',
|
|
53
|
+
'x-component-props': {
|
|
54
|
+
precision: 0
|
|
55
|
+
},
|
|
56
|
+
'x-reactions': {
|
|
57
|
+
dependencies: ['.max'],
|
|
58
|
+
fulfill: {
|
|
59
|
+
state: {
|
|
60
|
+
selfErrors: "{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(_i18n.i18n.t('Min length must less than max length'), "' : ''}}")
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
32
67
|
};
|
|
33
68
|
exports.password = password;
|
|
@@ -7,12 +7,57 @@ exports.percent = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _properties = require("./properties");
|
|
9
9
|
|
|
10
|
+
var _i18n = require("../../i18n");
|
|
11
|
+
|
|
12
|
+
var _core = require("@formily/core");
|
|
13
|
+
|
|
10
14
|
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
15
|
|
|
12
16
|
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; }
|
|
13
17
|
|
|
14
18
|
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; }
|
|
15
19
|
|
|
20
|
+
(0, _core.registerValidateRules)({
|
|
21
|
+
percentMode: function percentMode(value, rule) {
|
|
22
|
+
var maxValue = rule.maxValue,
|
|
23
|
+
minValue = rule.minValue;
|
|
24
|
+
|
|
25
|
+
if (maxValue) {
|
|
26
|
+
if (value > maxValue) {
|
|
27
|
+
return {
|
|
28
|
+
type: 'error',
|
|
29
|
+
message: "".concat(_i18n.i18n.t('The field value cannot be greater than ')).concat(maxValue * 100, "%")
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (minValue) {
|
|
35
|
+
if (value < minValue) {
|
|
36
|
+
return {
|
|
37
|
+
type: 'error',
|
|
38
|
+
message: "".concat(_i18n.i18n.t('The field value cannot be less than ')).concat(minValue * 100, "%")
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return true;
|
|
44
|
+
},
|
|
45
|
+
percentFormats: function percentFormats(value, rule) {
|
|
46
|
+
var percentFormat = rule.percentFormat;
|
|
47
|
+
|
|
48
|
+
if (value && percentFormat === 'Integer' && /^-?[1-9]\d*$/.test((value * 100).toString()) === false) {
|
|
49
|
+
return {
|
|
50
|
+
type: 'error',
|
|
51
|
+
message: "".concat(_i18n.i18n.t('The field value is not an integer number'))
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
}); // registerValidateFormats({
|
|
58
|
+
// percentInteger: /^(\d+)(.\d{0,2})?$/,
|
|
59
|
+
// });
|
|
60
|
+
|
|
16
61
|
var percent = {
|
|
17
62
|
name: 'percent',
|
|
18
63
|
type: 'object',
|
|
@@ -64,6 +109,60 @@ var percent = {
|
|
|
64
109
|
}),
|
|
65
110
|
filterable: {
|
|
66
111
|
operators: _properties.operators.number
|
|
112
|
+
},
|
|
113
|
+
validateSchema: function validateSchema(fieldSchema) {
|
|
114
|
+
return {
|
|
115
|
+
maxValue: {
|
|
116
|
+
type: 'number',
|
|
117
|
+
title: '{{ t("Maximum") }}',
|
|
118
|
+
'x-decorator': 'FormItem',
|
|
119
|
+
'x-component': 'Percent',
|
|
120
|
+
'x-component-props': {
|
|
121
|
+
addonAfter: '%'
|
|
122
|
+
},
|
|
123
|
+
'x-reactions': "{{(field) => {\n const targetValue = field.query('.minimum').value();\n field.selfErrors =\n !!targetValue && !!field.value && targetValue > field.value ? '".concat(_i18n.i18n.t('Maximum must greater than minimum'), "' : ''\n }}}")
|
|
124
|
+
},
|
|
125
|
+
minValue: {
|
|
126
|
+
type: 'number',
|
|
127
|
+
title: '{{ t("Minimum") }}',
|
|
128
|
+
'x-decorator': 'FormItem',
|
|
129
|
+
'x-component': 'Percent',
|
|
130
|
+
'x-component-props': {
|
|
131
|
+
addonAfter: '%'
|
|
132
|
+
},
|
|
133
|
+
'x-reactions': {
|
|
134
|
+
dependencies: ['.maximum'],
|
|
135
|
+
fulfill: {
|
|
136
|
+
state: {
|
|
137
|
+
selfErrors: "{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(_i18n.i18n.t('Minimum must less than maximum'), "' : ''}}")
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
percentFormat: {
|
|
143
|
+
type: 'string',
|
|
144
|
+
title: '{{ t("Format") }}',
|
|
145
|
+
'x-decorator': 'FormItem',
|
|
146
|
+
'x-component': 'Select',
|
|
147
|
+
'x-component-props': {
|
|
148
|
+
allowClear: true
|
|
149
|
+
},
|
|
150
|
+
enum: [{
|
|
151
|
+
label: '{{ t("Integer") }}',
|
|
152
|
+
value: 'Integer'
|
|
153
|
+
}]
|
|
154
|
+
},
|
|
155
|
+
pattern: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
title: '{{ t("Regular expression") }}',
|
|
158
|
+
'x-decorator': 'FormItem',
|
|
159
|
+
'x-component': 'Input',
|
|
160
|
+
'x-component-props': {
|
|
161
|
+
prefix: '/',
|
|
162
|
+
suffix: '/'
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
67
166
|
}
|
|
68
167
|
};
|
|
69
168
|
exports.percent = percent;
|
|
@@ -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; }
|
|
@@ -36,6 +38,39 @@ var richText = {
|
|
|
36
38
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
37
39
|
schema['x-component-props']['ellipsis'] = true;
|
|
38
40
|
}
|
|
41
|
+
},
|
|
42
|
+
validateSchema: function validateSchema(fieldSchema, formItemStyle) {
|
|
43
|
+
return {
|
|
44
|
+
max: {
|
|
45
|
+
type: 'number',
|
|
46
|
+
title: '{{ t("Max length") }}',
|
|
47
|
+
minimum: 0,
|
|
48
|
+
'x-decorator': 'FormItem',
|
|
49
|
+
'x-component': 'InputNumber',
|
|
50
|
+
'x-component-props': {
|
|
51
|
+
precision: 0
|
|
52
|
+
},
|
|
53
|
+
'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 }}}")
|
|
54
|
+
},
|
|
55
|
+
min: {
|
|
56
|
+
type: 'number',
|
|
57
|
+
title: '{{ t("Min length") }}',
|
|
58
|
+
minimum: 0,
|
|
59
|
+
'x-decorator': 'FormItem',
|
|
60
|
+
'x-component': 'InputNumber',
|
|
61
|
+
'x-component-props': {
|
|
62
|
+
precision: 0
|
|
63
|
+
},
|
|
64
|
+
'x-reactions': {
|
|
65
|
+
dependencies: ['.max'],
|
|
66
|
+
fulfill: {
|
|
67
|
+
state: {
|
|
68
|
+
selfErrors: "{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(_i18n.i18n.t('Min length must less than max length'), "' : ''}}")
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
39
74
|
}
|
|
40
75
|
};
|
|
41
76
|
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; }
|
|
@@ -36,6 +38,39 @@ var textarea = {
|
|
|
36
38
|
schema['x-component-props'] = schema['x-component-props'] || {};
|
|
37
39
|
schema['x-component-props']['ellipsis'] = true;
|
|
38
40
|
}
|
|
41
|
+
},
|
|
42
|
+
validateSchema: function validateSchema(fieldSchema) {
|
|
43
|
+
return {
|
|
44
|
+
max: {
|
|
45
|
+
type: 'number',
|
|
46
|
+
title: '{{ t("Max length") }}',
|
|
47
|
+
minimum: 0,
|
|
48
|
+
'x-decorator': 'FormItem',
|
|
49
|
+
'x-component': 'InputNumber',
|
|
50
|
+
'x-component-props': {
|
|
51
|
+
precision: 0
|
|
52
|
+
},
|
|
53
|
+
'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 }}}")
|
|
54
|
+
},
|
|
55
|
+
min: {
|
|
56
|
+
type: 'number',
|
|
57
|
+
title: '{{ t("Min length") }}',
|
|
58
|
+
minimum: 0,
|
|
59
|
+
'x-decorator': 'FormItem',
|
|
60
|
+
'x-component': 'InputNumber',
|
|
61
|
+
'x-component-props': {
|
|
62
|
+
precision: 0
|
|
63
|
+
},
|
|
64
|
+
'x-reactions': {
|
|
65
|
+
dependencies: ['.max'],
|
|
66
|
+
fulfill: {
|
|
67
|
+
state: {
|
|
68
|
+
selfErrors: "{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(_i18n.i18n.t('Min length must less than max length'), "' : ''}}")
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
39
74
|
}
|
|
40
75
|
};
|
|
41
76
|
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
|
@@ -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;
|
|
@@ -549,5 +550,9 @@ 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;
|
|
552
557
|
};
|
|
553
558
|
export default _default;
|
package/lib/locale/en_US.js
CHANGED
|
@@ -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",
|
|
@@ -554,6 +555,10 @@ 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"
|
|
558
563
|
};
|
|
559
564
|
exports.default = _default;
|