@teamix/pro 1.2.4 → 1.2.8
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/dist/212.js +1 -1
- package/dist/pro.css +1 -1
- package/dist/pro.js +1182 -512
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-component.js +2 -1
- package/es/actions/dialog-form.js +2 -1
- package/es/actions/dialog.js +2 -1
- package/es/actions/index.js +3 -2
- package/es/actions/index.scss +3 -0
- package/es/actions/utils.d.ts +1 -0
- package/es/actions/utils.js +27 -0
- package/es/card/card-container.d.ts +18 -0
- package/es/card/card-container.js +24 -0
- package/es/card/divider.d.ts +6 -0
- package/es/card/divider.js +16 -0
- package/es/card/index.d.ts +68 -32
- package/es/card/index.js +194 -107
- package/es/card/index.scss +174 -9
- package/es/card/selectable.d.ts +13 -0
- package/es/card/selectable.js +45 -0
- package/es/card/utils.d.ts +9 -0
- package/es/card/utils.js +30 -0
- package/es/form/Components/ProField/index.js +2 -7
- package/es/form/Filter/index.js +5 -5
- package/es/form/ProForm/index.js +43 -17
- package/es/form/ProForm/index.scss +0 -1
- package/es/form/ProForm/useAutoSubmit.d.ts +1 -1
- package/es/form/ProForm/useAutoSubmit.js +3 -3
- package/es/form/ProForm/useInitialRequest.d.ts +1 -1
- package/es/form/ProForm/useInitialRequest.js +2 -2
- package/es/form/SchemaForm/initializeDataSource.js +1 -1
- package/es/form/SchemaForm/initializeFormButton.js +3 -2
- package/es/form/SchemaForm/initializeRequest.js +6 -3
- package/es/form/SchemaForm/initializeRules.js +1 -1
- package/es/form/SchemaForm/reactions.d.ts +5 -4
- package/es/form/SchemaForm/reactions.js +20 -11
- package/es/form/locales/validate.d.ts +159 -0
- package/es/form/locales/validate.js +158 -0
- package/es/form/typing.d.ts +4 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +7 -4
- package/es/info/components/InfoGroup/index.js +5 -2
- package/es/info/components/InfoValueItem/index.js +4 -6
- package/es/info/components/baseInfo/index.js +4 -2
- package/es/info/components/tableInfo/index.js +10 -6
- package/es/info/index.js +25 -11
- package/es/info/typing.d.ts +6 -0
- package/es/nocode/configurators/Card.js +39 -12
- package/es/sidebar/components/sidebar-container/index.d.ts +5 -0
- package/es/sidebar/components/sidebar-container/index.js +77 -0
- package/es/sidebar/components/sidebar-container/index.scss +18 -0
- package/es/sidebar/components/tree/index.d.ts +4 -0
- package/es/sidebar/components/tree/index.js +95 -0
- package/es/sidebar/index.d.ts +5 -0
- package/es/sidebar/index.js +66 -0
- package/es/sidebar/index.scss +3 -0
- package/es/sidebar/typing.d.ts +51 -0
- package/es/sidebar/typing.js +1 -0
- package/es/table/components/Layout/index.js +1 -1
- package/es/table/components/ToolBar/FilterColumnIcon.js +2 -24
- package/es/table/components/ToolBar/index.scss +0 -3
- package/es/table/index.js +26 -9
- package/es/table/index.scss +1 -0
- package/es/table/typing.d.ts +6 -4
- package/lib/actions/dialog-component.js +3 -1
- package/lib/actions/dialog-form.js +3 -1
- package/lib/actions/dialog.js +3 -1
- package/lib/actions/index.js +3 -2
- package/lib/actions/index.scss +3 -0
- package/lib/actions/utils.d.ts +1 -0
- package/lib/actions/utils.js +33 -0
- package/lib/card/card-container.d.ts +18 -0
- package/lib/card/card-container.js +37 -0
- package/lib/card/divider.d.ts +6 -0
- package/lib/card/divider.js +26 -0
- package/lib/card/index.d.ts +68 -32
- package/lib/card/index.js +215 -110
- package/lib/card/index.scss +174 -9
- package/lib/card/selectable.d.ts +13 -0
- package/lib/card/selectable.js +60 -0
- package/lib/card/utils.d.ts +9 -0
- package/lib/card/utils.js +41 -0
- package/lib/form/Components/ProField/index.js +1 -6
- package/lib/form/Filter/index.js +5 -6
- package/lib/form/ProForm/index.js +41 -14
- package/lib/form/ProForm/index.scss +0 -1
- package/lib/form/ProForm/useAutoSubmit.d.ts +1 -1
- package/lib/form/ProForm/useAutoSubmit.js +3 -3
- package/lib/form/ProForm/useInitialRequest.d.ts +1 -1
- package/lib/form/ProForm/useInitialRequest.js +2 -2
- package/lib/form/SchemaForm/initializeDataSource.js +1 -1
- package/lib/form/SchemaForm/initializeFormButton.js +5 -2
- package/lib/form/SchemaForm/initializeRequest.js +5 -2
- package/lib/form/SchemaForm/initializeRules.js +1 -1
- package/lib/form/SchemaForm/reactions.d.ts +5 -4
- package/lib/form/SchemaForm/reactions.js +23 -12
- package/lib/form/locales/validate.d.ts +159 -0
- package/lib/form/locales/validate.js +165 -0
- package/lib/form/typing.d.ts +4 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -1
- package/lib/info/components/InfoGroup/index.js +5 -2
- package/lib/info/components/InfoValueItem/index.js +4 -6
- package/lib/info/components/baseInfo/index.js +4 -2
- package/lib/info/components/tableInfo/index.js +10 -6
- package/lib/info/index.js +24 -10
- package/lib/info/typing.d.ts +6 -0
- package/lib/nocode/configurators/Card.js +39 -12
- package/lib/sidebar/components/sidebar-container/index.d.ts +5 -0
- package/lib/sidebar/components/sidebar-container/index.js +93 -0
- package/lib/sidebar/components/sidebar-container/index.scss +18 -0
- package/lib/sidebar/components/tree/index.d.ts +4 -0
- package/lib/sidebar/components/tree/index.js +112 -0
- package/lib/sidebar/index.d.ts +5 -0
- package/lib/sidebar/index.js +87 -0
- package/lib/sidebar/index.scss +3 -0
- package/lib/sidebar/typing.d.ts +51 -0
- package/lib/sidebar/typing.js +5 -0
- package/lib/table/components/Layout/index.js +1 -1
- package/lib/table/components/ToolBar/FilterColumnIcon.js +2 -24
- package/lib/table/components/ToolBar/index.scss +0 -3
- package/lib/table/index.js +27 -9
- package/lib/table/index.scss +1 -0
- package/lib/table/typing.d.ts +6 -4
- package/package.json +4 -4
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.$validator = exports.$request = exports.$dataSource = void 0;
|
6
|
+
exports.$validator = exports.$request = exports.$dataSource = exports.$context = void 0;
|
7
7
|
|
8
8
|
var _utils = require("@teamix/utils");
|
9
9
|
|
@@ -15,34 +15,45 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
15
15
|
|
16
16
|
// 配置请求
|
17
17
|
var $request = function $request(requestConfig) {
|
18
|
-
return function (field) {
|
18
|
+
return function (field, context) {
|
19
19
|
var _field$data;
|
20
20
|
|
21
21
|
var refresh = field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
22
22
|
var beforeRequest = requestConfig.beforeRequest,
|
23
23
|
onSuccess = requestConfig.onSuccess;
|
24
24
|
var refreshResult = (0, _utils.isPlainObj)(refresh) ? refresh : {};
|
25
|
-
var beforeRequestResult = (0, _utils.isFn)(beforeRequest) ? beforeRequest(field) : {};
|
25
|
+
var beforeRequestResult = (0, _utils.isFn)(beforeRequest) ? beforeRequest(field, context) : {};
|
26
26
|
return (0, _utils.doCommonRequest)(_objectSpread(_objectSpread({}, requestConfig), {}, {
|
27
27
|
params: _objectSpread(_objectSpread(_objectSpread({}, requestConfig.params), beforeRequestResult), refreshResult),
|
28
28
|
beforeRequest: function beforeRequest() {
|
29
29
|
return beforeRequestResult;
|
30
30
|
},
|
31
31
|
onSuccess: (0, _utils.isFn)(onSuccess) ? function (res) {
|
32
|
-
return onSuccess(res, field);
|
32
|
+
return onSuccess(res, field, context);
|
33
33
|
} : onSuccess
|
34
|
-
}),
|
34
|
+
}), context);
|
35
35
|
};
|
36
|
-
}; //
|
36
|
+
}; // 配置上下文
|
37
37
|
|
38
38
|
|
39
39
|
exports.$request = $request;
|
40
40
|
|
41
|
-
var $
|
41
|
+
var $context = function $context(services, onComplete, context) {
|
42
|
+
return function (field) {
|
43
|
+
return services(field, context).then(function (res) {
|
44
|
+
return onComplete && onComplete(res, field, context);
|
45
|
+
});
|
46
|
+
};
|
47
|
+
}; // 配置校验
|
48
|
+
|
49
|
+
|
50
|
+
exports.$context = $context;
|
51
|
+
|
52
|
+
var $validator = function $validator(services, onComplete, context) {
|
42
53
|
return function (value, rules, _ref) {
|
43
54
|
var field = _ref.field;
|
44
|
-
return services(field).then(function (res) {
|
45
|
-
return onComplete && onComplete(res, field);
|
55
|
+
return services(field, context).then(function (res) {
|
56
|
+
return onComplete && onComplete(res, field, context);
|
46
57
|
});
|
47
58
|
};
|
48
59
|
}; // 配置DataSource
|
@@ -50,13 +61,13 @@ var $validator = function $validator(services, onComplete) {
|
|
50
61
|
|
51
62
|
exports.$validator = $validator;
|
52
63
|
|
53
|
-
var $dataSource = function $dataSource(services, onComplete) {
|
64
|
+
var $dataSource = function $dataSource(services, onComplete, context) {
|
54
65
|
return function (field) {
|
55
66
|
field.setState({
|
56
67
|
loading: true,
|
57
68
|
readOnly: true
|
58
69
|
});
|
59
|
-
return services(field).then(function (res) {
|
70
|
+
return services(field, context).then(function (res) {
|
60
71
|
var _res$map;
|
61
72
|
|
62
73
|
var isValueInDataSource = res === null || res === void 0 ? void 0 : (_res$map = res.map(function (v) {
|
@@ -70,7 +81,7 @@ var $dataSource = function $dataSource(services, onComplete) {
|
|
70
81
|
loading: false,
|
71
82
|
readOnly: false
|
72
83
|
}, clearValue));
|
73
|
-
return onComplete && onComplete(res, field);
|
84
|
+
return onComplete && onComplete(res, field, context);
|
74
85
|
}).catch(function () {
|
75
86
|
field.setState({
|
76
87
|
loading: false,
|
@@ -0,0 +1,159 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
en: {
|
3
|
+
pattern: string;
|
4
|
+
required: string;
|
5
|
+
number: string;
|
6
|
+
integer: string;
|
7
|
+
url: string;
|
8
|
+
email: string;
|
9
|
+
ipv6: string;
|
10
|
+
ipv4: string;
|
11
|
+
idcard: string;
|
12
|
+
taodomain: string;
|
13
|
+
qq: string;
|
14
|
+
phone: string;
|
15
|
+
money: string;
|
16
|
+
zh: string;
|
17
|
+
date: string;
|
18
|
+
zip: string;
|
19
|
+
len: string;
|
20
|
+
min: string;
|
21
|
+
maximum: string;
|
22
|
+
exclusiveMaximum: string;
|
23
|
+
minimum: string;
|
24
|
+
exclusiveMinimum: string;
|
25
|
+
max: string;
|
26
|
+
whitespace: string;
|
27
|
+
};
|
28
|
+
'en-us': {
|
29
|
+
pattern: string;
|
30
|
+
required: string;
|
31
|
+
number: string;
|
32
|
+
integer: string;
|
33
|
+
url: string;
|
34
|
+
email: string;
|
35
|
+
ipv6: string;
|
36
|
+
ipv4: string;
|
37
|
+
idcard: string;
|
38
|
+
taodomain: string;
|
39
|
+
qq: string;
|
40
|
+
phone: string;
|
41
|
+
money: string;
|
42
|
+
zh: string;
|
43
|
+
date: string;
|
44
|
+
zip: string;
|
45
|
+
len: string;
|
46
|
+
min: string;
|
47
|
+
maximum: string;
|
48
|
+
exclusiveMaximum: string;
|
49
|
+
minimum: string;
|
50
|
+
exclusiveMinimum: string;
|
51
|
+
max: string;
|
52
|
+
whitespace: string;
|
53
|
+
};
|
54
|
+
zh: {
|
55
|
+
pattern: string;
|
56
|
+
required: string;
|
57
|
+
number: string;
|
58
|
+
integer: string;
|
59
|
+
url: string;
|
60
|
+
email: string;
|
61
|
+
ipv6: string;
|
62
|
+
ipv4: string;
|
63
|
+
idcard: string;
|
64
|
+
taodomain: string;
|
65
|
+
qq: string;
|
66
|
+
phone: string;
|
67
|
+
money: string;
|
68
|
+
zh: string;
|
69
|
+
date: string;
|
70
|
+
zip: string;
|
71
|
+
len: string;
|
72
|
+
min: string;
|
73
|
+
max: string;
|
74
|
+
maximum: string;
|
75
|
+
exclusiveMaximum: string;
|
76
|
+
minimum: string;
|
77
|
+
exclusiveMinimum: string;
|
78
|
+
whitespace: string;
|
79
|
+
};
|
80
|
+
'zh-cn': {
|
81
|
+
pattern: string;
|
82
|
+
required: string;
|
83
|
+
number: string;
|
84
|
+
integer: string;
|
85
|
+
url: string;
|
86
|
+
email: string;
|
87
|
+
ipv6: string;
|
88
|
+
ipv4: string;
|
89
|
+
idcard: string;
|
90
|
+
taodomain: string;
|
91
|
+
qq: string;
|
92
|
+
phone: string;
|
93
|
+
money: string;
|
94
|
+
zh: string;
|
95
|
+
date: string;
|
96
|
+
zip: string;
|
97
|
+
len: string;
|
98
|
+
min: string;
|
99
|
+
max: string;
|
100
|
+
maximum: string;
|
101
|
+
exclusiveMaximum: string;
|
102
|
+
minimum: string;
|
103
|
+
exclusiveMinimum: string;
|
104
|
+
whitespace: string;
|
105
|
+
};
|
106
|
+
'zh-tw': {
|
107
|
+
pattern: string;
|
108
|
+
required: string;
|
109
|
+
number: string;
|
110
|
+
integer: string;
|
111
|
+
url: string;
|
112
|
+
email: string;
|
113
|
+
ipv6: string;
|
114
|
+
ipv4: string;
|
115
|
+
idcard: string;
|
116
|
+
taodomain: string;
|
117
|
+
qq: string;
|
118
|
+
phone: string;
|
119
|
+
money: string;
|
120
|
+
zh: string;
|
121
|
+
date: string;
|
122
|
+
zip: string;
|
123
|
+
len: string;
|
124
|
+
min: string;
|
125
|
+
max: string;
|
126
|
+
maximum: string;
|
127
|
+
exclusiveMaximum: string;
|
128
|
+
minimum: string;
|
129
|
+
exclusiveMinimum: string;
|
130
|
+
whitespace: string;
|
131
|
+
};
|
132
|
+
ja: {
|
133
|
+
url: string;
|
134
|
+
whitespace: string;
|
135
|
+
zh: string;
|
136
|
+
zip: string;
|
137
|
+
date: string;
|
138
|
+
email: string;
|
139
|
+
exclusiveMaximum: string;
|
140
|
+
exclusiveMinimum: string;
|
141
|
+
idcard: string;
|
142
|
+
integer: string;
|
143
|
+
ipv4: string;
|
144
|
+
ipv6: string;
|
145
|
+
len: string;
|
146
|
+
max: string;
|
147
|
+
maximum: string;
|
148
|
+
min: string;
|
149
|
+
minimum: string;
|
150
|
+
money: string;
|
151
|
+
number: string;
|
152
|
+
pattern: string;
|
153
|
+
phone: string;
|
154
|
+
qq: string;
|
155
|
+
required: string;
|
156
|
+
taodomain: string;
|
157
|
+
};
|
158
|
+
};
|
159
|
+
export default _default;
|
@@ -0,0 +1,165 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _default = {
|
8
|
+
en: {
|
9
|
+
pattern: 'This field does not match any pattern',
|
10
|
+
required: 'This field is required',
|
11
|
+
number: 'This field is not a number',
|
12
|
+
integer: 'This field is not an integer number',
|
13
|
+
url: 'This field is a invalid url',
|
14
|
+
email: 'This field is not a email format',
|
15
|
+
ipv6: 'This field is not a ipv6 format',
|
16
|
+
ipv4: 'This field is not a ipv4 format',
|
17
|
+
idcard: 'This field is not an idcard format',
|
18
|
+
taodomain: 'This field is not a taobao domain format',
|
19
|
+
qq: 'This field is not a qq number format',
|
20
|
+
phone: 'This field is not a phone number format',
|
21
|
+
money: 'This field is not a currency format',
|
22
|
+
zh: 'This field is not a chinese string',
|
23
|
+
date: 'This field is not a valid date format',
|
24
|
+
zip: 'This field is not a zip format',
|
25
|
+
len: 'The length or number of entries must be {{len}}',
|
26
|
+
min: 'The length or number of entries must be at least {{min}}',
|
27
|
+
maximum: 'The value cannot be greater than {{maximum}}',
|
28
|
+
exclusiveMaximum: 'The value must be less than {{exclusiveMaximum}}',
|
29
|
+
minimum: 'The value cannot be less than {{minimum}}',
|
30
|
+
exclusiveMinimum: 'The value must be greater than {{exclusiveMinimum}}',
|
31
|
+
max: 'The length or number of entries must be at most {{max}}',
|
32
|
+
whitespace: 'This field cannot be blank string.'
|
33
|
+
},
|
34
|
+
'en-us': {
|
35
|
+
pattern: 'This field does not match any pattern',
|
36
|
+
required: 'This field is required',
|
37
|
+
number: 'This field is not a number',
|
38
|
+
integer: 'This field is not an integer number',
|
39
|
+
url: 'This field is a invalid url',
|
40
|
+
email: 'This field is not a email format',
|
41
|
+
ipv6: 'This field is not a ipv6 format',
|
42
|
+
ipv4: 'This field is not a ipv4 format',
|
43
|
+
idcard: 'This field is not an idcard format',
|
44
|
+
taodomain: 'This field is not a taobao domain format',
|
45
|
+
qq: 'This field is not a qq number format',
|
46
|
+
phone: 'This field is not a phone number format',
|
47
|
+
money: 'This field is not a currency format',
|
48
|
+
zh: 'This field is not a chinese string',
|
49
|
+
date: 'This field is not a valid date format',
|
50
|
+
zip: 'This field is not a zip format',
|
51
|
+
len: 'The length or number of entries must be {{len}}',
|
52
|
+
min: 'The length or number of entries must be at least {{min}}',
|
53
|
+
maximum: 'The value cannot be greater than {{maximum}}',
|
54
|
+
exclusiveMaximum: 'The value must be less than {{exclusiveMaximum}}',
|
55
|
+
minimum: 'The value cannot be less than {{minimum}}',
|
56
|
+
exclusiveMinimum: 'The value must be greater than {{exclusiveMinimum}}',
|
57
|
+
max: 'The length or number of entries must be at most {{max}}',
|
58
|
+
whitespace: 'This field cannot be blank string.'
|
59
|
+
},
|
60
|
+
zh: {
|
61
|
+
pattern: '该字段不是一个合法的字段',
|
62
|
+
required: '该字段是必填字段',
|
63
|
+
number: '该字段不是合法的数字',
|
64
|
+
integer: '该字段不是合法的整型数字',
|
65
|
+
url: '该字段不是合法的url',
|
66
|
+
email: '该字段不是合法的邮箱格式',
|
67
|
+
ipv6: '该字段不是合法的ipv6格式',
|
68
|
+
ipv4: '该字段不是合法的ipv4格式',
|
69
|
+
idcard: '该字段不是合法的身份证格式',
|
70
|
+
taodomain: '该字段不符合淘系域名规则',
|
71
|
+
qq: '该字段不符合QQ号格式',
|
72
|
+
phone: '该字段不是有效的手机号',
|
73
|
+
money: '该字段不是有效货币格式',
|
74
|
+
zh: '该字段不是合法的中文字符串',
|
75
|
+
date: '该字段不是合法的日期格式',
|
76
|
+
zip: '该字段不是合法的邮编格式',
|
77
|
+
len: '长度或条目数必须为{{len}}',
|
78
|
+
min: '长度或条目数不能小于{{min}}',
|
79
|
+
max: '长度或条目数不能大于{{max}}',
|
80
|
+
maximum: '数值不能大于{{maximum}}',
|
81
|
+
exclusiveMaximum: '数值必须小于{{exclusiveMaximum}}',
|
82
|
+
minimum: '数值不能小于{{minimum}}',
|
83
|
+
exclusiveMinimum: '数值必须大于{{exclusiveMinimum}}',
|
84
|
+
whitespace: '不能为纯空白字符串'
|
85
|
+
},
|
86
|
+
'zh-cn': {
|
87
|
+
pattern: '该字段不是一个合法的字段',
|
88
|
+
required: '该字段是必填字段',
|
89
|
+
number: '该字段不是合法的数字',
|
90
|
+
integer: '该字段不是合法的整型数字',
|
91
|
+
url: '该字段不是合法的url',
|
92
|
+
email: '该字段不是合法的邮箱格式',
|
93
|
+
ipv6: '该字段不是合法的ipv6格式',
|
94
|
+
ipv4: '该字段不是合法的ipv4格式',
|
95
|
+
idcard: '该字段不是合法的身份证格式',
|
96
|
+
taodomain: '该字段不符合淘系域名规则',
|
97
|
+
qq: '该字段不符合QQ号格式',
|
98
|
+
phone: '该字段不是有效的手机号',
|
99
|
+
money: '该字段不是有效货币格式',
|
100
|
+
zh: '该字段不是合法的中文字符串',
|
101
|
+
date: '该字段不是合法的日期格式',
|
102
|
+
zip: '该字段不是合法的邮编格式',
|
103
|
+
len: '长度或条目数必须为{{len}}',
|
104
|
+
min: '长度或条目数不能小于{{min}}',
|
105
|
+
max: '长度或条目数不能大于{{max}}',
|
106
|
+
maximum: '数值不能大于{{maximum}}',
|
107
|
+
exclusiveMaximum: '数值必须小于{{exclusiveMaximum}}',
|
108
|
+
minimum: '数值不能小于{{minimum}}',
|
109
|
+
exclusiveMinimum: '数值必须大于{{exclusiveMinimum}}',
|
110
|
+
whitespace: '不能为纯空白字符串'
|
111
|
+
},
|
112
|
+
'zh-tw': {
|
113
|
+
pattern: '該字段不是一個合法的字段',
|
114
|
+
required: '該字段是必填字段',
|
115
|
+
number: '該字段不是合法的數字',
|
116
|
+
integer: '該字段不是合法的整型數字',
|
117
|
+
url: '該字段不是合法的url',
|
118
|
+
email: '該字段不是合法的郵箱格式',
|
119
|
+
ipv6: '該字段不是合法的ipv6格式',
|
120
|
+
ipv4: '該字段不是合法的ipv4格式',
|
121
|
+
idcard: '該字段不是合法的身份證格式',
|
122
|
+
taodomain: '該字段不符合淘系域名規則',
|
123
|
+
qq: '該字段不符合QQ號格式',
|
124
|
+
phone: '該字段不是有效的手機號',
|
125
|
+
money: '該字段不是有效貨幣格式',
|
126
|
+
zh: '該字段不是合法的中文字符串',
|
127
|
+
date: '該字段不是合法的日期格式',
|
128
|
+
zip: '該字段不是合法的郵編格式',
|
129
|
+
len: '長度或條目數必須為{{len}}',
|
130
|
+
min: '長度或條目數不能小於{{min}}',
|
131
|
+
max: '長度或條目數不能大於{{max}}',
|
132
|
+
maximum: '數值不能大於{{maximum}}',
|
133
|
+
exclusiveMaximum: '數值必須小於{{exclusiveMaximum}}',
|
134
|
+
minimum: '數值不能小於{{minimum}}',
|
135
|
+
exclusiveMinimum: '數值必須大於{{exclusiveMinimum}}',
|
136
|
+
whitespace: '不能為純空白字符串'
|
137
|
+
},
|
138
|
+
ja: {
|
139
|
+
url: 'このフィールドは無効なURLです',
|
140
|
+
whitespace: 'このフィールドを空の文字列にすることはできません。',
|
141
|
+
zh: 'このフィールドは中国語の文字列ではありません',
|
142
|
+
zip: 'このフィールドはzip形式ではありません',
|
143
|
+
date: 'このフィールドは有効な日付形式ではありません',
|
144
|
+
email: 'このフィールドはメール形式ではありません',
|
145
|
+
exclusiveMaximum: '値は{{exclusiveMaximum}}未満である必要があります',
|
146
|
+
exclusiveMinimum: '値は{{exclusiveMinimum}}より大きい必要があります',
|
147
|
+
idcard: 'このフィールドはIDカード形式ではありません',
|
148
|
+
integer: 'このフィールドは整数ではありません',
|
149
|
+
ipv4: 'このフィールドはIPv4形式ではありません',
|
150
|
+
ipv6: 'このフィールドはIPv6形式ではありません',
|
151
|
+
len: 'エントリの長さまたは数は{{len}}でなければなりません',
|
152
|
+
max: 'エントリの長さまたは数は最大{{max}}でなければなりません',
|
153
|
+
maximum: '値は{{最大}}を超えることはできません',
|
154
|
+
min: 'エントリの長さまたは数は、少なくとも{{min}}である必要があります',
|
155
|
+
minimum: '値は{{minimum}}以上にする必要があります',
|
156
|
+
money: 'このフィールドは通貨形式ではありません',
|
157
|
+
number: 'このフィールドは数値ではありません',
|
158
|
+
pattern: 'このフィールドはどのパターンとも一致しません',
|
159
|
+
phone: 'このフィールドは電話番号の形式ではありません',
|
160
|
+
qq: 'このフィールドはqq数値形式ではありません',
|
161
|
+
required: 'この項目は必須です',
|
162
|
+
taodomain: 'このフィールドは淘宝網ドメイン形式ではありません'
|
163
|
+
}
|
164
|
+
};
|
165
|
+
exports.default = _default;
|
package/lib/form/typing.d.ts
CHANGED
@@ -14,9 +14,9 @@ declare type IButtonComponent = 'Submit' | 'Reset';
|
|
14
14
|
declare type IComboComponent = 'ArrayCards' | 'ArrayCards.Addition' | 'ArrayCards.Remove' | 'ArrayCards.MoveUp' | 'ArrayCards.MoveDown' | 'ArrayCards.Index' | 'ArrayCollapse' | 'ArrayCollapse.CollapsePanel' | 'ArrayCollapse.Addition' | 'ArrayCollapse.Remove' | 'ArrayCollapse.MoveUp' | 'ArrayCollapse.MoveDown' | 'ArrayCollapse.Index' | 'ArrayTable' | 'ArrayTable.Column' | 'ArrayTable.SortHandle' | 'ArrayTable.Addition' | 'ArrayTable.Remove' | 'ArrayTable.MoveDown' | 'ArrayTable.MoveUp' | 'ArrayTable.Index' | 'ArrayItems' | 'ArrayItems.Item' | 'ArrayItems.SortHandle' | 'ArrayItems.Addition' | 'ArrayItems.Remove' | 'ArrayItems.MoveDown' | 'ArrayItems.MoveUp' | 'ArrayItems.Index' | 'Editable' | 'Editable.Popover' | 'Editable.Dialog' | 'Editable.Drawer';
|
15
15
|
declare type ILayoutComponent = 'FormFlex' | 'FormGrid' | 'FormGroup' | 'FormGroup.GroupPanel' | 'Search' | 'Search.SearchPanel' | 'FormTab' | 'FormTab.TabPane' | 'FormStep' | 'FormStep.StepPane' | 'FormCollapse' | 'FormCollapse.CollapsePanel' | 'FormButtonGroup' | 'FormDialog' | 'FormDrawer' | 'FormDialog.Footer' | 'FormDrawer.Footer';
|
16
16
|
export interface ProFormRequestConfig extends CommonRequestConfig {
|
17
|
-
beforeRequest?: (field?: any) => any;
|
18
|
-
onSuccess?: (res?: any, field?: any) => any;
|
19
|
-
onComplete?: (res?: any, field?: any) => any;
|
17
|
+
beforeRequest?: (field?: any, context?: any) => any;
|
18
|
+
onSuccess?: (res?: any, field?: any, context?: any) => any;
|
19
|
+
onComplete?: (res?: any, field?: any, context?: any) => any;
|
20
20
|
}
|
21
21
|
export interface ProFormSchemaItem {
|
22
22
|
type?: string;
|
@@ -51,6 +51,7 @@ export interface ProFormProps extends IFormLayoutProps {
|
|
51
51
|
form?: FormType | false;
|
52
52
|
schema: ProFormSchema;
|
53
53
|
scope?: any;
|
54
|
+
context?: any;
|
54
55
|
components?: {
|
55
56
|
[key: string]: React.FC | React.ComponentClass;
|
56
57
|
};
|
package/lib/index.d.ts
CHANGED
@@ -21,5 +21,5 @@ export * from './page-container';
|
|
21
21
|
export * from './page-header';
|
22
22
|
export * from './skeleton';
|
23
23
|
export * from './table';
|
24
|
-
declare const version = "1.2.
|
24
|
+
declare const version = "1.2.7";
|
25
25
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils, };
|
package/lib/index.js
CHANGED
@@ -248,8 +248,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
248
248
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
249
249
|
|
250
250
|
// import ProLayout from './layout';
|
251
|
+
// import ProSidebar from './sidebar'
|
251
252
|
// 设置图标源
|
252
253
|
_icon.default.setConfig(_utils.default.getTeamixIconConfig());
|
253
254
|
|
254
|
-
|
255
|
+
// export * from './sidebar';
|
256
|
+
var version = '1.2.7';
|
255
257
|
exports.version = version;
|
@@ -19,7 +19,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
19
|
|
20
20
|
var _ = _interopRequireDefault(require("../.."));
|
21
21
|
|
22
|
-
var _excluded = ["children", "url", "method", "params", "formatResult", "onSuccess", "onError", "formatParams", "beforeRequest", "extendParams", "className", "compacted", "divider", "style", "backgroundColor"];
|
22
|
+
var _excluded = ["children", "url", "method", "params", "formatResult", "onSuccess", "onError", "formatParams", "beforeRequest", "extendParams", "className", "compacted", "divider", "style", "backgroundColor", "context"];
|
23
23
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
25
|
|
@@ -57,6 +57,8 @@ var ProInfoGroup = function ProInfoGroup(props) {
|
|
57
57
|
style = props.style,
|
58
58
|
_props$backgroundColo = props.backgroundColor,
|
59
59
|
backgroundColor = _props$backgroundColo === void 0 ? '' : _props$backgroundColo,
|
60
|
+
_props$context = props.context,
|
61
|
+
context = _props$context === void 0 ? {} : _props$context,
|
60
62
|
others = _objectWithoutProperties(props, _excluded);
|
61
63
|
|
62
64
|
var ref = (0, _react.useRef)();
|
@@ -82,7 +84,8 @@ var ProInfoGroup = function ProInfoGroup(props) {
|
|
82
84
|
onError: onError,
|
83
85
|
formatParams: formatParams,
|
84
86
|
beforeRequest: beforeRequest,
|
85
|
-
extendParams: extendParams
|
87
|
+
extendParams: extendParams,
|
88
|
+
context: context
|
86
89
|
};
|
87
90
|
var proInfoClassName = (0, _classnames.default)({
|
88
91
|
'teamix-pro-info-group-item': true,
|
@@ -25,7 +25,7 @@ var _components = require("@alicloudfe/components");
|
|
25
25
|
|
26
26
|
var _actions = require("../../../actions");
|
27
27
|
|
28
|
-
var _excluded = ["type", "value", "render", "infoItem", "record", "actionRef", "dataSource"];
|
28
|
+
var _excluded = ["type", "value", "render", "infoItem", "record", "actionRef", "dataSource", "context"];
|
29
29
|
|
30
30
|
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); }
|
31
31
|
|
@@ -75,6 +75,7 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
75
75
|
record = props.record,
|
76
76
|
actionRef = props.actionRef,
|
77
77
|
dataSource = props.dataSource,
|
78
|
+
context = props.context,
|
78
79
|
others = _objectWithoutProperties(props, _excluded);
|
79
80
|
|
80
81
|
var dataIndex = infoItem.dataIndex,
|
@@ -117,9 +118,8 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
117
118
|
v = _ref2[1];
|
118
119
|
|
119
120
|
return [k, (0, _utils.getTargetValue)(v, _objectSpread(_objectSpread({}, record), {}, {
|
120
|
-
record: record,
|
121
121
|
value: value
|
122
|
-
}))];
|
122
|
+
}, context))];
|
123
123
|
}));
|
124
124
|
});
|
125
125
|
}
|
@@ -158,9 +158,7 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
158
158
|
style: {
|
159
159
|
marginLeft: '8px'
|
160
160
|
},
|
161
|
-
context: {
|
162
|
-
record: record
|
163
|
-
}
|
161
|
+
context: _objectSpread({}, context)
|
164
162
|
});
|
165
163
|
}
|
166
164
|
|
@@ -35,7 +35,8 @@ var ProBaseInfo = function ProBaseInfo(props) {
|
|
35
35
|
result = props.result,
|
36
36
|
actionRef = props.actionRef,
|
37
37
|
layout = props.layout,
|
38
|
-
size = props.size
|
38
|
+
size = props.size,
|
39
|
+
context = props.context;
|
39
40
|
|
40
41
|
var defaultLayout = _layout.default[(0, _utils.getLayout)((_size$width = size === null || size === void 0 ? void 0 : size.width) !== null && _size$width !== void 0 ? _size$width : 0)]; // 获取列内的布局参数
|
41
42
|
|
@@ -90,7 +91,8 @@ var ProBaseInfo = function ProBaseInfo(props) {
|
|
90
91
|
dataSource: item.dataSource,
|
91
92
|
infoItem: item,
|
92
93
|
record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
|
93
|
-
actionRef: actionRef
|
94
|
+
actionRef: actionRef,
|
95
|
+
context: context
|
94
96
|
}),
|
95
97
|
baseInfoLayout: getFormItemLayout((_item$colSpan = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan !== void 0 ? _item$colSpan : 0),
|
96
98
|
tooltip: item.tooltip,
|
@@ -58,8 +58,9 @@ var ProTableInfo = function ProTableInfo(props) {
|
|
58
58
|
_layout$labelGutter = layout.labelGutter,
|
59
59
|
labelGutter = _layout$labelGutter === void 0 ? '80px' : _layout$labelGutter;
|
60
60
|
|
61
|
-
var
|
62
|
-
|
61
|
+
var getNewColumns = function getNewColumns() {
|
62
|
+
// 需要 fill 填充 否则有可能不执行
|
63
|
+
return _toConsumableArray(new Array(colNum)).fill(1).map(function (_, index) {
|
63
64
|
return [{
|
64
65
|
dataIndex: "label_".concat(index),
|
65
66
|
align: 'left',
|
@@ -104,9 +105,7 @@ var ProTableInfo = function ProTableInfo(props) {
|
|
104
105
|
var needCol = 1 + ((_columnsItem$colSpan = columnsItem === null || columnsItem === void 0 ? void 0 : columnsItem.colSpan) !== null && _columnsItem$colSpan !== void 0 ? _columnsItem$colSpan : 1); // 如果剩余的col能满足下一组数据那么就放在这一组
|
105
106
|
|
106
107
|
if (needCol <= col) {
|
107
|
-
|
108
|
-
|
109
|
-
col = col - 1 - ((_columnsItem$colSpan2 = columnsItem === null || columnsItem === void 0 ? void 0 : columnsItem.colSpan) !== null && _columnsItem$colSpan2 !== void 0 ? _columnsItem$colSpan2 : 1);
|
108
|
+
col = col - needCol;
|
110
109
|
filterColumns.push(columnsItem);
|
111
110
|
} else {
|
112
111
|
var _filterColumns$0$colS;
|
@@ -119,6 +118,11 @@ var ProTableInfo = function ProTableInfo(props) {
|
|
119
118
|
col = 0;
|
120
119
|
}
|
121
120
|
}
|
121
|
+
|
122
|
+
if (columnsCopy.length === 0) {
|
123
|
+
// 如果剩余仍有列数并且已经没有columns分配了
|
124
|
+
col = 0;
|
125
|
+
}
|
122
126
|
}
|
123
127
|
|
124
128
|
var itemData = filterColumns.map(function (item, index) {
|
@@ -185,7 +189,7 @@ var ProTableInfo = function ProTableInfo(props) {
|
|
185
189
|
return /*#__PURE__*/_react.default.createElement(_components.Table.StickyLock, {
|
186
190
|
className: "teamix-pro-info-table",
|
187
191
|
cellProps: setCellProps,
|
188
|
-
columns:
|
192
|
+
columns: getNewColumns(),
|
189
193
|
hasHeader: false,
|
190
194
|
hasBorder: true,
|
191
195
|
dataSource: newDataSource
|
package/lib/info/index.js
CHANGED
@@ -41,7 +41,8 @@ Object.keys(_typing).forEach(function (key) {
|
|
41
41
|
}
|
42
42
|
});
|
43
43
|
});
|
44
|
-
var _excluded = ["type", "url", "method", "formatResult", "formatParams", "params", "actionRef", "header", "onSuccess", "onError", "beforeRequest", "extendParams", "className", "style", "columns", "layout", "dataSource", "loading", "extra"]
|
44
|
+
var _excluded = ["type", "url", "method", "formatResult", "formatParams", "params", "actionRef", "header", "onSuccess", "onError", "beforeRequest", "extendParams", "className", "style", "columns", "layout", "dataSource", "loading", "extra", "context"],
|
45
|
+
_excluded2 = ["context"];
|
45
46
|
|
46
47
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
47
48
|
|
@@ -96,6 +97,7 @@ var ProInfo = function ProInfo(props) {
|
|
96
97
|
dataSource = props.dataSource,
|
97
98
|
userLoading = props.loading,
|
98
99
|
extra = props.extra,
|
100
|
+
infoContext = props.context,
|
99
101
|
others = _objectWithoutProperties(props, _excluded);
|
100
102
|
|
101
103
|
var _useContext = (0, _react.useContext)(_utils.ProInfoGroupContext),
|
@@ -109,7 +111,9 @@ var ProInfo = function ProInfo(props) {
|
|
109
111
|
contextOnError = _useContext.onError,
|
110
112
|
contextFormatParams = _useContext.formatParams,
|
111
113
|
contextBeforeRequest = _useContext.beforeRequest,
|
112
|
-
contextExtendParams = _useContext.extendParams
|
114
|
+
contextExtendParams = _useContext.extendParams,
|
115
|
+
_useContext$context = _useContext.context,
|
116
|
+
contextContext = _useContext$context === void 0 ? {} : _useContext$context; // 获取容器宽度
|
113
117
|
|
114
118
|
|
115
119
|
var ref = (0, _react.useRef)();
|
@@ -146,7 +150,12 @@ var ProInfo = function ProInfo(props) {
|
|
146
150
|
} else {
|
147
151
|
setLoading(false);
|
148
152
|
}
|
149
|
-
}, []);
|
153
|
+
}, []);
|
154
|
+
var context = (0, _react.useMemo)(function () {
|
155
|
+
return _objectSpread(_objectSpread({}, infoContext), {}, {
|
156
|
+
record: dataSource !== null && dataSource !== void 0 ? dataSource : data
|
157
|
+
}, contextContext);
|
158
|
+
}, [dataSource, data]); // 获取数据
|
150
159
|
|
151
160
|
var request = function request() {
|
152
161
|
setLoading(true);
|
@@ -179,10 +188,12 @@ var ProInfo = function ProInfo(props) {
|
|
179
188
|
return extra;
|
180
189
|
}
|
181
190
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
191
|
+
var _extra$context = extra.context,
|
192
|
+
actionContext = _extra$context === void 0 ? {} : _extra$context,
|
193
|
+
others = _objectWithoutProperties(extra, _excluded2);
|
194
|
+
|
195
|
+
return _objectSpread(_objectSpread({}, others), {}, {
|
196
|
+
context: _objectSpread(_objectSpread({}, context), actionContext)
|
186
197
|
});
|
187
198
|
};
|
188
199
|
|
@@ -203,7 +214,8 @@ var ProInfo = function ProInfo(props) {
|
|
203
214
|
loading: userLoading || loading,
|
204
215
|
result: data,
|
205
216
|
actionRef: actionRef,
|
206
|
-
layout: layout
|
217
|
+
layout: layout,
|
218
|
+
context: context
|
207
219
|
}), type === 'header' && /*#__PURE__*/_react.default.createElement(_headerInfo.default, {
|
208
220
|
dataSource: dataSource,
|
209
221
|
columns: columns,
|
@@ -212,7 +224,8 @@ var ProInfo = function ProInfo(props) {
|
|
212
224
|
result: data,
|
213
225
|
actionRef: actionRef,
|
214
226
|
layout: layout,
|
215
|
-
size: size
|
227
|
+
size: size,
|
228
|
+
context: context
|
216
229
|
}), type === 'base' && /*#__PURE__*/_react.default.createElement(_baseInfo.default, {
|
217
230
|
dataSource: dataSource,
|
218
231
|
columns: columns,
|
@@ -220,7 +233,8 @@ var ProInfo = function ProInfo(props) {
|
|
220
233
|
result: data,
|
221
234
|
actionRef: actionRef,
|
222
235
|
layout: layout,
|
223
|
-
size: size
|
236
|
+
size: size,
|
237
|
+
context: context
|
224
238
|
})));
|
225
239
|
};
|
226
240
|
|