@teamix/pro 1.2.31 → 1.2.35
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/pro.css +1 -1
- package/dist/pro.js +16186 -16728
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.js +58 -9
- package/es/common.scss +22 -0
- package/es/form/Filter/index.d.ts +5 -9
- package/es/form/Filter/index.js +489 -152
- package/es/form/Filter/index.scss +33 -11
- package/es/form/Filter/index2.d.ts +9 -5
- package/es/form/Filter/index2.js +154 -370
- package/es/form/Filter/index2.scss +11 -33
- package/es/form/Filter/useSpecialProps.d.ts +1 -1
- package/es/form/Filter/useSpecialProps.js +9 -9
- package/es/form/ProForm/index.js +4 -4
- package/es/form/ProForm/index.scss +5 -0
- package/es/form/SchemaForm/index.js +5 -5
- package/es/form/SchemaForm/initializeDataSource.d.ts +1 -1
- package/es/form/SchemaForm/initializeDataSource.js +2 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/es/form/SchemaForm/initializeRequest.js +41 -5
- package/es/form/SchemaForm/reactions.d.ts +3 -3
- package/es/form/SchemaForm/reactions.js +39 -19
- package/es/form/index.d.ts +3 -3
- package/es/form/index.js +3 -3
- package/es/form/typing.d.ts +7 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/info/components/InfoValueItem/index.js +38 -12
- package/es/info/components/InfoValueItem/index.scss +1 -0
- package/es/info/components/ProInfoItem/index.js +6 -3
- package/es/info/components/ProInfoItem/index.scss +9 -0
- package/es/info/components/baseInfo/index.js +2 -1
- package/es/info/components/headerInfo/index.js +2 -1
- package/es/info/components/tableInfo/index.js +2 -1
- package/es/info/index.scss +2 -0
- package/es/info/typing.d.ts +3 -0
- package/es/page-header/index.js +3 -3
- package/es/table/components/Layout/index.js +29 -23
- package/es/table/components/Layout/index.scss +7 -0
- package/es/table/components/ToolBar/Fullscreen.js +39 -15
- package/es/table/components/ToolBar/index.scss +1 -0
- package/es/table/index.js +63 -40
- package/es/table/typing.d.ts +3 -0
- package/es/table/utils/columnRender.js +1 -1
- package/lib/actions/dialog-form.js +57 -10
- package/lib/common.scss +22 -0
- package/lib/form/Filter/index.d.ts +5 -9
- package/lib/form/Filter/index.js +504 -154
- package/lib/form/Filter/index.scss +33 -11
- package/lib/form/Filter/index2.d.ts +9 -5
- package/lib/form/Filter/index2.js +154 -383
- package/lib/form/Filter/index2.scss +11 -33
- package/lib/form/Filter/useSpecialProps.d.ts +1 -1
- package/lib/form/Filter/useSpecialProps.js +8 -8
- package/lib/form/ProForm/index.js +4 -4
- package/lib/form/ProForm/index.scss +5 -0
- package/lib/form/SchemaForm/index.js +5 -5
- package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -1
- package/lib/form/SchemaForm/initializeDataSource.js +2 -2
- package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/lib/form/SchemaForm/initializeRequest.js +41 -5
- package/lib/form/SchemaForm/reactions.d.ts +3 -3
- package/lib/form/SchemaForm/reactions.js +39 -19
- package/lib/form/index.d.ts +3 -3
- package/lib/form/index.js +8 -8
- package/lib/form/typing.d.ts +7 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/info/components/InfoValueItem/index.js +38 -12
- package/lib/info/components/InfoValueItem/index.scss +1 -0
- package/lib/info/components/ProInfoItem/index.js +6 -3
- package/lib/info/components/ProInfoItem/index.scss +9 -0
- package/lib/info/components/baseInfo/index.js +2 -1
- package/lib/info/components/headerInfo/index.js +2 -1
- package/lib/info/components/tableInfo/index.js +2 -1
- package/lib/info/index.scss +2 -0
- package/lib/info/typing.d.ts +3 -0
- package/lib/page-header/index.js +2 -2
- package/lib/table/components/Layout/index.js +29 -23
- package/lib/table/components/Layout/index.scss +7 -0
- package/lib/table/components/ToolBar/Fullscreen.js +37 -14
- package/lib/table/components/ToolBar/index.scss +1 -0
- package/lib/table/index.js +63 -40
- package/lib/table/typing.d.ts +3 -0
- package/lib/table/utils/columnRender.js +1 -1
- package/package.json +1 -1
- package/dist/212.js +0 -155705
- package/dist/fonts/codicon.ttf +0 -0
@@ -1,10 +1,11 @@
|
|
1
|
-
import {
|
1
|
+
import { isUsable, isStr, isPureObj } from '@teamix/utils'; // 获取Schema是否包含默认值、异步默认值、必选校验等
|
2
2
|
|
3
3
|
var useSpecialProps = function useSpecialProps(props) {
|
4
4
|
var initialValues = props.initialValues,
|
5
5
|
initialRequest = props.initialRequest;
|
6
|
-
var
|
7
|
-
|
6
|
+
var hasChangeDefault = !!initialValues || !!initialRequest; // 会触发onChange的默认值
|
7
|
+
|
8
|
+
var hasDefault = hasChangeDefault;
|
8
9
|
var hasRequired = false;
|
9
10
|
|
10
11
|
var hasDefaultOrRule = function hasDefaultOrRule(schema) {
|
@@ -12,13 +13,12 @@ var useSpecialProps = function useSpecialProps(props) {
|
|
12
13
|
var value = item.default,
|
13
14
|
required = item.required,
|
14
15
|
rules = item.rules,
|
15
|
-
request = item.request,
|
16
16
|
dataSource = item.dataSource,
|
17
|
-
children = item.children;
|
18
|
-
|
17
|
+
children = item.children; // 字符串变量配置default值会触发onChange
|
18
|
+
|
19
|
+
hasChangeDefault = hasChangeDefault || !!(isPureObj(dataSource) && isStr(value) && value.indexOf('.dataSource'));
|
20
|
+
hasDefault = hasDefault || isUsable(value);
|
19
21
|
hasRequired = hasRequired || required || !!rules;
|
20
|
-
hasAsyncDefault = hasAsyncDefault || !!request || // 如果dataSource是异步且default取自dataSource
|
21
|
-
!!(isPlainObj(dataSource) && isStr(value) && value.indexOf('.dataSource'));
|
22
22
|
|
23
23
|
if (children === null || children === void 0 ? void 0 : children.length) {
|
24
24
|
hasDefaultOrRule(children);
|
@@ -29,7 +29,7 @@ var useSpecialProps = function useSpecialProps(props) {
|
|
29
29
|
hasDefaultOrRule(props.schema);
|
30
30
|
return {
|
31
31
|
hasDefault: hasDefault,
|
32
|
-
|
32
|
+
hasChangeDefault: hasChangeDefault,
|
33
33
|
hasRequired: hasRequired
|
34
34
|
};
|
35
35
|
};
|
package/es/form/ProForm/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["form", "initialValues", "initialRequest", "schema", "scope", "context", "components", "children", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "onChange", "onSubmit", "onSubmitFailed", "className"];
|
1
|
+
var _excluded = ["form", "initialValues", "initialRequest", "schema", "scope", "context", "components", "children", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "onChange", "onSubmit", "onSubmitFailed", "onInitialComplete", "className"];
|
2
2
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
4
4
|
|
@@ -41,6 +41,7 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
41
41
|
onChange = _ref.onChange,
|
42
42
|
onSubmit = _ref.onSubmit,
|
43
43
|
onSubmitFailed = _ref.onSubmitFailed,
|
44
|
+
onInitialComplete = _ref.onInitialComplete,
|
44
45
|
className = _ref.className,
|
45
46
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
46
47
|
|
@@ -91,13 +92,12 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
91
92
|
useEffect(function () {
|
92
93
|
if (initialValues) {
|
93
94
|
form.setInitialValues(initialValues);
|
95
|
+
onInitialComplete === null || onInitialComplete === void 0 ? void 0 : onInitialComplete(form);
|
94
96
|
} else if (initialRequest) {
|
95
97
|
useInitialRequest(initialRequest).then(function (values) {
|
96
98
|
form.setInitialValues(values);
|
97
99
|
}).finally(function () {
|
98
|
-
|
99
|
-
form: form
|
100
|
-
});
|
100
|
+
onInitialComplete === null || onInitialComplete === void 0 ? void 0 : onInitialComplete(form);
|
101
101
|
});
|
102
102
|
}
|
103
103
|
}, []); // 配置国际化
|
@@ -198,18 +198,18 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
198
198
|
var defaultDecoratorProps = _objectSpread(_objectSpread({}, tooltipProps), decoratorProps); // 初始化request
|
199
199
|
|
200
200
|
|
201
|
-
var _initializeRequest = initializeRequest(request, suffix),
|
201
|
+
var _initializeRequest = initializeRequest(request, "".concat(suffix, "r")),
|
202
202
|
requestReactions = _initializeRequest.reactions,
|
203
|
-
requestScope = _initializeRequest.scope; // 初始化dataSource
|
203
|
+
requestScope = _initializeRequest.scope; // 初始化dataSource,如果readPretty为字符串表达式将失去loading等状态,仍可配置dataSource
|
204
204
|
|
205
205
|
|
206
|
-
var _initializeDataSource = initializeDataSource(dataSource, suffix),
|
206
|
+
var _initializeDataSource = initializeDataSource(dataSource, "".concat(suffix, "d"), newItem.readPretty),
|
207
207
|
defaultDataSource = _initializeDataSource.dataSource,
|
208
208
|
dataSourceReactions = _initializeDataSource.reactions,
|
209
|
-
dataSourceScope = _initializeDataSource.scope; // 初始化rules
|
209
|
+
dataSourceScope = _initializeDataSource.scope; // 初始化rules validator
|
210
210
|
|
211
211
|
|
212
|
-
var _initializeRules = initializeRules(rules, suffix),
|
212
|
+
var _initializeRules = initializeRules(rules, "".concat(suffix, "v")),
|
213
213
|
defaultRules = _initializeRules.rules,
|
214
214
|
rulesScope = _initializeRules.scope; // 合并reactions,初始化reactions
|
215
215
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ProFormRequestConfig } from '../typing';
|
2
2
|
interface IInitializeDataSource {
|
3
|
-
(requestConfig?: ProFormRequestConfig | any, suffix?: string): {
|
3
|
+
(requestConfig?: ProFormRequestConfig | any, suffix?: string, readPretty?: string | boolean): {
|
4
4
|
dataSource?: any[];
|
5
5
|
reactions: any[];
|
6
6
|
scope: {
|
@@ -2,12 +2,12 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
2
2
|
|
3
3
|
import { isPlainObj } from '@teamix/utils';
|
4
4
|
|
5
|
-
var initializeDataSource = function initializeDataSource(dataSource, suffix) {
|
5
|
+
var initializeDataSource = function initializeDataSource(dataSource, suffix, readPretty) {
|
6
6
|
if (isPlainObj(dataSource)) {
|
7
7
|
var requestConfig = dataSource;
|
8
8
|
var requestConfigName = "$requestConfig_".concat(suffix);
|
9
9
|
return {
|
10
|
-
reactions: ["{{$dataSource($request,".concat(requestConfigName, ",context)}}")],
|
10
|
+
reactions: ["{{$dataSource($request,".concat(requestConfigName, ",context,").concat(readPretty, ")}}")],
|
11
11
|
scope: _defineProperty({}, requestConfigName, requestConfig)
|
12
12
|
};
|
13
13
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ProFormRequestConfig } from '../typing';
|
2
2
|
interface IInitializeRequest {
|
3
|
-
(requestConfig?: ProFormRequestConfig, suffix?: string): {
|
3
|
+
(requestConfig?: ProFormRequestConfig | ProFormRequestConfig[], suffix?: string): {
|
4
4
|
reactions: any[];
|
5
5
|
scope: {
|
6
6
|
[x: string]: any;
|
@@ -1,12 +1,48 @@
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
|
+
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
|
+
|
1
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
6
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
8
|
+
|
9
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
10
|
+
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
12
|
+
|
13
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
14
|
+
|
15
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
16
|
+
|
17
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
18
|
+
|
19
|
+
import { isArr } from '@teamix/utils';
|
20
|
+
|
3
21
|
var initializeRequest = function initializeRequest(requestConfig, suffix) {
|
4
22
|
if (requestConfig) {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
23
|
+
if (isArr(requestConfig)) {
|
24
|
+
var reactionsMap = [];
|
25
|
+
var scopeMap = {};
|
26
|
+
requestConfig.forEach(function (item, index) {
|
27
|
+
var _initializeRequest = initializeRequest(item, "".concat(suffix).concat(index)),
|
28
|
+
reactions = _initializeRequest.reactions,
|
29
|
+
scope = _initializeRequest.scope;
|
30
|
+
|
31
|
+
reactionsMap = [].concat(_toConsumableArray(reactionsMap), _toConsumableArray(reactions));
|
32
|
+
scopeMap = _objectSpread(_objectSpread({}, scopeMap), scope);
|
33
|
+
});
|
34
|
+
return {
|
35
|
+
reactions: reactionsMap,
|
36
|
+
scope: scopeMap
|
37
|
+
};
|
38
|
+
} else {
|
39
|
+
var requestConfigName = "$requestConfig_".concat(suffix);
|
40
|
+
var requestIndex = (/\d{1,}\w(\d{0,})/g.exec(suffix) || [])[1];
|
41
|
+
return {
|
42
|
+
reactions: ["{{$common($request,".concat(requestConfigName, ",context,").concat(requestIndex, ")}}")],
|
43
|
+
scope: _defineProperty({}, requestConfigName, requestConfig)
|
44
|
+
};
|
45
|
+
}
|
10
46
|
}
|
11
47
|
|
12
48
|
return {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ProFormRequestConfig } from '../typing';
|
2
|
-
declare const $request: (field: any, requestConfig: ProFormRequestConfig, context: any) => Promise<unknown>;
|
3
|
-
declare const $common: (services: any, requestConfig: ProFormRequestConfig, context: any) => (field: any) => any;
|
2
|
+
declare const $request: (field: any, requestConfig: ProFormRequestConfig, context: any, type: string | number) => Promise<unknown>;
|
3
|
+
declare const $common: (services: any, requestConfig: ProFormRequestConfig, context: any, index: string) => (field: any) => any;
|
4
4
|
declare const $validator: (services: any, requestConfig: ProFormRequestConfig, context: any) => (value: any, rules: any, { field }: any) => any;
|
5
|
-
declare const $dataSource: (services: any, requestConfig: ProFormRequestConfig, context: any) => (field: any) => any;
|
5
|
+
declare const $dataSource: (services: any, requestConfig: ProFormRequestConfig, context: any, readPretty: any) => (field: any) => any;
|
6
6
|
export { $request, $common, $dataSource, $validator };
|
@@ -6,10 +6,17 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
6
6
|
|
7
7
|
import { isFn, isPlainObj, doCommonRequest, getValueByValue } from '@teamix/utils'; // 配置请求
|
8
8
|
|
9
|
-
var $request = function $request(field, requestConfig, context) {
|
9
|
+
var $request = function $request(field, requestConfig, context, type) {
|
10
10
|
var _field$data;
|
11
11
|
|
12
|
-
|
12
|
+
// let refresh
|
13
|
+
// if(isStr(type)){
|
14
|
+
// refresh = field.data?.refreshMap?.[type]
|
15
|
+
// }else if(isNum(type)){
|
16
|
+
// }else{
|
17
|
+
// refresh = field.data?.refresh;
|
18
|
+
// }
|
19
|
+
var refresh = (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
13
20
|
var beforeRequest = requestConfig.beforeRequest,
|
14
21
|
onSuccess = requestConfig.onSuccess;
|
15
22
|
var refreshResult = isPlainObj(refresh) ? refresh : {};
|
@@ -26,9 +33,9 @@ var $request = function $request(field, requestConfig, context) {
|
|
26
33
|
}; // 通用请求配置上下文
|
27
34
|
|
28
35
|
|
29
|
-
var $common = function $common(services, requestConfig, context) {
|
36
|
+
var $common = function $common(services, requestConfig, context, index) {
|
30
37
|
return function (field) {
|
31
|
-
return services(field, requestConfig, context).then(function (res) {
|
38
|
+
return services(field, requestConfig, context, index || 'common').then(function (res) {
|
32
39
|
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
33
40
|
});
|
34
41
|
};
|
@@ -38,35 +45,48 @@ var $common = function $common(services, requestConfig, context) {
|
|
38
45
|
var $validator = function $validator(services, requestConfig, context) {
|
39
46
|
return function (value, rules, _ref) {
|
40
47
|
var field = _ref.field;
|
41
|
-
return services(field, requestConfig, context).then(function (res) {
|
48
|
+
return services(field, requestConfig, context, 'validator').then(function (res) {
|
42
49
|
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
43
50
|
});
|
44
51
|
};
|
45
52
|
}; // 配置DataSource
|
46
53
|
|
47
54
|
|
48
|
-
var $dataSource = function $dataSource(services, requestConfig, context) {
|
55
|
+
var $dataSource = function $dataSource(services, requestConfig, context, readPretty) {
|
49
56
|
return function (field) {
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
57
|
+
if (!readPretty) {
|
58
|
+
field.setState({
|
59
|
+
loading: true,
|
60
|
+
readOnly: true
|
61
|
+
});
|
62
|
+
}
|
63
|
+
|
54
64
|
return services(field, requestConfig, context).then(function (res) {
|
55
65
|
var isValueInDataSource = getValueByValue(res, field.value);
|
56
66
|
var clearValue = isValueInDataSource ? {} : {
|
57
67
|
value: undefined
|
58
68
|
};
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
69
|
+
|
70
|
+
if (!readPretty) {
|
71
|
+
field.setState(_objectSpread({
|
72
|
+
dataSource: res,
|
73
|
+
loading: false,
|
74
|
+
readOnly: false
|
75
|
+
}, clearValue));
|
76
|
+
} else {
|
77
|
+
field.setState({
|
78
|
+
dataSource: res
|
79
|
+
});
|
80
|
+
}
|
81
|
+
|
64
82
|
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
65
83
|
}).catch(function () {
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
84
|
+
if (!readPretty) {
|
85
|
+
field.setState({
|
86
|
+
loading: false,
|
87
|
+
readOnly: false
|
88
|
+
});
|
89
|
+
}
|
70
90
|
});
|
71
91
|
};
|
72
92
|
};
|
package/es/form/index.d.ts
CHANGED
@@ -109,10 +109,10 @@ export { createForm, FormConsumer, FormDialog, FormDrawer, FormStep, FormTab, Fo
|
|
109
109
|
/**
|
110
110
|
* 导出 Filter 组件
|
111
111
|
*/
|
112
|
-
import {
|
113
|
-
import { QueryFilter } from './Filter/index2';
|
112
|
+
import { QueryFilter } from './Filter';
|
114
113
|
import { QueryFilterLayout } from './Filter/Layout';
|
115
|
-
|
114
|
+
import { AdvancedFilter, SimpleFilter } from './Filter/index2';
|
115
|
+
export { QueryFilter, QueryFilterLayout, AdvancedFilter, SimpleFilter };
|
116
116
|
/**
|
117
117
|
* 导出 ProForm 组件,支持快速搭建表单
|
118
118
|
*/
|
package/es/form/index.js
CHANGED
@@ -41,10 +41,10 @@ export { createForm, FormConsumer, FormDialog, FormDrawer, FormStep, FormTab, Fo
|
|
41
41
|
* 导出 Filter 组件
|
42
42
|
*/
|
43
43
|
|
44
|
-
import {
|
45
|
-
import { QueryFilter } from './Filter/index2';
|
44
|
+
import { QueryFilter } from './Filter';
|
46
45
|
import { QueryFilterLayout } from './Filter/Layout';
|
47
|
-
|
46
|
+
import { AdvancedFilter, SimpleFilter } from './Filter/index2';
|
47
|
+
export { QueryFilter, QueryFilterLayout, AdvancedFilter, SimpleFilter };
|
48
48
|
/**
|
49
49
|
* 导出 ProForm 组件,支持快速搭建表单
|
50
50
|
*/
|
package/es/form/typing.d.ts
CHANGED
@@ -44,7 +44,7 @@ export interface ProFormSchemaItem {
|
|
44
44
|
readPretty?: boolean | string;
|
45
45
|
pattern?: FieldPatternTypes;
|
46
46
|
default?: any;
|
47
|
-
request?: ProFormRequestConfig;
|
47
|
+
request?: ProFormRequestConfig | ProFormRequestConfig[];
|
48
48
|
data?: AnyObject;
|
49
49
|
}
|
50
50
|
export declare type ProFormSchema = ProFormSchemaItem[];
|
@@ -63,6 +63,7 @@ export interface ProFormProps extends IFormLayoutProps {
|
|
63
63
|
onChange?: (values: any, fieldValue?: any, fieldName?: any) => any;
|
64
64
|
onSubmit?: ((values: any) => any) | CommonRequestConfig;
|
65
65
|
onSubmitFailed?: (feedbacks: IFormFeedback[]) => void;
|
66
|
+
onInitialComplete?: (form: FormType) => void;
|
66
67
|
}
|
67
68
|
export interface FilterProps extends ProFormProps {
|
68
69
|
form: FormType;
|
@@ -88,6 +89,8 @@ export interface QueryFilterProps extends ProFormProps {
|
|
88
89
|
triggerType?: 'keydown' | 'change' | 'submit';
|
89
90
|
/** 表单展示形式 */
|
90
91
|
mode?: 'inline' | 'panel';
|
92
|
+
/** 面板模式下是否仅展示面板 */
|
93
|
+
purePanel?: boolean;
|
91
94
|
/** 面板是否默认展开,仅在 mode='panel' 时生效 */
|
92
95
|
expand?: boolean;
|
93
96
|
/** 顶部筛选区前缀 */
|
@@ -112,6 +115,9 @@ export interface QueryFilterProps extends ProFormProps {
|
|
112
115
|
/**
|
113
116
|
* 兼容性导出
|
114
117
|
*/
|
118
|
+
/**
|
119
|
+
* @deprecated 将在未来移除该组件,建议使用 QueryFilter 代替
|
120
|
+
*/
|
115
121
|
export interface IFilterProps extends ProFormProps {
|
116
122
|
triggerType?: 'keydown' | 'change' | 'submit';
|
117
123
|
onFilter?: (values: any) => void;
|
package/es/index.d.ts
CHANGED
@@ -24,5 +24,5 @@ export * from './skeleton';
|
|
24
24
|
export * from './table';
|
25
25
|
export * from './utils';
|
26
26
|
export * from './step';
|
27
|
-
declare const version = "1.2.
|
27
|
+
declare const version = "1.2.35";
|
28
28
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProStep, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -30,7 +30,7 @@ export * from './table';
|
|
30
30
|
export * from './utils'; // export * from './sidebar';
|
31
31
|
|
32
32
|
export * from './step';
|
33
|
-
var version = '1.2.
|
33
|
+
var version = '1.2.35';
|
34
34
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
35
35
|
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, // ProSidebar,
|
36
36
|
ProStep, hooks, nocode, templates, utils };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["type", "value", "render", "infoItem", "record", "actionRef", "dataSource", "context"];
|
1
|
+
var _excluded = ["type", "value", "render", "infoItem", "record", "actionRef", "dataSource", "context", "props"];
|
2
2
|
|
3
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
4
4
|
|
@@ -8,12 +8,6 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
8
8
|
|
9
9
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
10
10
|
|
11
|
-
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; }
|
12
|
-
|
13
|
-
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; }
|
14
|
-
|
15
|
-
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; }
|
16
|
-
|
17
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
18
12
|
|
19
13
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -26,6 +20,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
26
20
|
|
27
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
28
22
|
|
23
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
24
|
+
|
25
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
26
|
+
|
27
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
28
|
+
|
29
29
|
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; }
|
30
30
|
|
31
31
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
@@ -52,6 +52,7 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
52
52
|
actionRef = props.actionRef,
|
53
53
|
dataSource = props.dataSource,
|
54
54
|
context = props.context,
|
55
|
+
fieldProps = props.props,
|
55
56
|
others = _objectWithoutProperties(props, _excluded);
|
56
57
|
|
57
58
|
var dataIndex = infoItem.dataIndex,
|
@@ -65,7 +66,8 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
65
66
|
_infoItem$successMess = infoItem.successMessage,
|
66
67
|
successMessage = _infoItem$successMess === void 0 ? 'success' : _infoItem$successMess,
|
67
68
|
actions = infoItem.actions,
|
68
|
-
extra = infoItem.extra
|
69
|
+
extra = infoItem.extra,
|
70
|
+
valueType = infoItem.valueType; // 获取处理过的 render
|
69
71
|
|
70
72
|
var getRender = function getRender() {
|
71
73
|
var _processRenderFunctio;
|
@@ -77,7 +79,31 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
77
79
|
}
|
78
80
|
|
79
81
|
var newRender = processBuriedPoint((_processRenderFunctio = processRenderFunction(render !== null && render !== void 0 ? render : {}, value, record)) !== null && _processRenderFunctio !== void 0 ? _processRenderFunctio : {}, value, record);
|
82
|
+
|
83
|
+
if (valueType === 'selectGroup') {
|
84
|
+
newRender = _objectSpread(_objectSpread({
|
85
|
+
maxShowNumber: 'auto',
|
86
|
+
foldText: 'more'
|
87
|
+
}, newRender), {}, {
|
88
|
+
ellipsis: false
|
89
|
+
});
|
90
|
+
}
|
91
|
+
|
80
92
|
return newRender;
|
93
|
+
};
|
94
|
+
|
95
|
+
var getFieldProps = function getFieldProps() {
|
96
|
+
if (valueType === 'selectGroup') {
|
97
|
+
return _objectSpread({
|
98
|
+
valueAlias: {
|
99
|
+
value: 'TagValue',
|
100
|
+
key: 'TagKey'
|
101
|
+
},
|
102
|
+
layout: 'compact'
|
103
|
+
}, fieldProps);
|
104
|
+
}
|
105
|
+
|
106
|
+
return fieldProps;
|
81
107
|
}; // 获取处理过的 dataSource
|
82
108
|
|
83
109
|
|
@@ -275,12 +301,12 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
275
301
|
onMouseLeave: function onMouseLeave() {
|
276
302
|
setEditVisible(false);
|
277
303
|
}
|
278
|
-
}, /*#__PURE__*/React.createElement(ProField, _objectSpread({
|
304
|
+
}, /*#__PURE__*/React.createElement(ProField, _objectSpread(_objectSpread({
|
279
305
|
type: type,
|
280
306
|
value: value,
|
281
307
|
render: getRender(),
|
282
308
|
dataSource: getDataSource()
|
283
|
-
}, others)), /*#__PURE__*/React.createElement(PopConfirm, {
|
309
|
+
}, others), getFieldProps())), /*#__PURE__*/React.createElement(PopConfirm, {
|
284
310
|
visible: popConfirmVisible,
|
285
311
|
content: renderContent(),
|
286
312
|
triggerType: "click",
|
@@ -307,12 +333,12 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
307
333
|
|
308
334
|
return /*#__PURE__*/React.createElement("div", {
|
309
335
|
className: cls('item-value')
|
310
|
-
}, /*#__PURE__*/React.createElement(ProField, _objectSpread({
|
336
|
+
}, /*#__PURE__*/React.createElement(ProField, _objectSpread(_objectSpread({
|
311
337
|
type: type,
|
312
338
|
value: value,
|
313
339
|
render: getRender(),
|
314
340
|
dataSource: getDataSource()
|
315
|
-
}, others)), renderAction(), extra && extra);
|
341
|
+
}, others), getFieldProps())), renderAction(), extra && extra);
|
316
342
|
};
|
317
343
|
|
318
344
|
export default InfoValueItem;
|
@@ -22,7 +22,8 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
22
22
|
return /*#__PURE__*/React.createElement("div", {
|
23
23
|
className: cls()
|
24
24
|
}, /*#__PURE__*/React.createElement(Row, {
|
25
|
-
gutter: 10
|
25
|
+
gutter: 10,
|
26
|
+
className: cls('base-row')
|
26
27
|
}, /*#__PURE__*/React.createElement(Col, {
|
27
28
|
span: labelCol === null || labelCol === void 0 ? void 0 : labelCol.span,
|
28
29
|
className: cls('label')
|
@@ -37,7 +38,7 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
37
38
|
className: cls('value')
|
38
39
|
}, loading && /*#__PURE__*/React.createElement("div", {
|
39
40
|
className: cls('base-skeleton-box')
|
40
|
-
}, /*#__PURE__*/React.createElement(ProSkeletonRaw.Info.Item, null)), !loading &&
|
41
|
+
}, /*#__PURE__*/React.createElement(ProSkeletonRaw.Info.Item, null)), !loading && value)));
|
41
42
|
}
|
42
43
|
|
43
44
|
if (headerInfoLayout) {
|
@@ -45,7 +46,9 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
45
46
|
labelGutter = _headerInfoLayout$lab === void 0 ? '16px' : _headerInfoLayout$lab;
|
46
47
|
return /*#__PURE__*/React.createElement("div", {
|
47
48
|
className: cls()
|
48
|
-
}, /*#__PURE__*/React.createElement(Row,
|
49
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
50
|
+
className: cls('header-row')
|
51
|
+
}, /*#__PURE__*/React.createElement("div", {
|
49
52
|
className: cls('header-label')
|
50
53
|
}, /*#__PURE__*/React.createElement(LabelIconTip, {
|
51
54
|
label: label,
|
@@ -17,6 +17,15 @@ $item-padding-bottom: 8px;
|
|
17
17
|
.teamix-pro-field-info-form-item {
|
18
18
|
width: 100%;
|
19
19
|
padding-bottom: $item-padding-bottom;
|
20
|
+
|
21
|
+
&-header-row {
|
22
|
+
display: flex;
|
23
|
+
align-items: center;
|
24
|
+
}
|
25
|
+
&-base-row {
|
26
|
+
display: flex;
|
27
|
+
align-items: center;
|
28
|
+
}
|
20
29
|
}
|
21
30
|
|
22
31
|
.teamix-pro-field-info-form-item-label {
|
@@ -73,7 +73,8 @@ var ProBaseInfo = function ProBaseInfo(props) {
|
|
73
73
|
infoItem: item,
|
74
74
|
record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
|
75
75
|
actionRef: actionRef,
|
76
|
-
context: context
|
76
|
+
context: context,
|
77
|
+
props: item.props
|
77
78
|
}),
|
78
79
|
baseInfoLayout: getFormItemLayout((_item$colSpan = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan !== void 0 ? _item$colSpan : 0),
|
79
80
|
tooltip: item.tooltip,
|
@@ -50,7 +50,8 @@ var ProHeaderInfo = function ProHeaderInfo(props) {
|
|
50
50
|
dataSource: item.dataSource,
|
51
51
|
infoItem: item,
|
52
52
|
record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
|
53
|
-
actionRef: actionRef
|
53
|
+
actionRef: actionRef,
|
54
|
+
props: item.props
|
54
55
|
}),
|
55
56
|
headerInfoLayout: layout !== null && layout !== void 0 ? layout : defaultLayout,
|
56
57
|
tooltip: item.tooltip,
|
@@ -65,7 +65,8 @@ var ProTableInfo = function ProTableInfo(props) {
|
|
65
65
|
dataSource: item.dataSource,
|
66
66
|
infoItem: item,
|
67
67
|
record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
|
68
|
-
actionRef: actionRef
|
68
|
+
actionRef: actionRef,
|
69
|
+
props: item.props
|
69
70
|
});
|
70
71
|
};
|
71
72
|
|
package/es/info/index.scss
CHANGED
package/es/info/typing.d.ts
CHANGED
@@ -94,6 +94,8 @@ export interface ProInfoColumnsProps {
|
|
94
94
|
actions?: ProActionButtonProps[];
|
95
95
|
/** 追加在列后 */
|
96
96
|
extra?: React.ReactNode;
|
97
|
+
/** 其他 ProField 配置 */
|
98
|
+
props?: any;
|
97
99
|
}
|
98
100
|
export declare type ProInfoActionType = {
|
99
101
|
/** 刷新Info */
|
@@ -168,6 +170,7 @@ export declare type InfoValueItemProps = {
|
|
168
170
|
render?: ProInfoCellRender;
|
169
171
|
dataSource?: ProFieldDataSourceItem[] | ProInfoCellFunProp;
|
170
172
|
context?: object;
|
173
|
+
props?: any;
|
171
174
|
} & Omit<ProFieldProps, 'render' | 'dataSource'>;
|
172
175
|
export declare type ProInfoHeaderProps = Omit<ProCardProps, 'loading'>;
|
173
176
|
/** ProInfoGroupContextProps */
|