@teamix/pro 1.2.30 → 1.2.34
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 +16740 -17360
- 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/SimpleFilter.js +10 -3
- package/es/form/Filter/index.d.ts +5 -9
- package/es/form/Filter/index.js +427 -154
- 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/ProForm/index.js +4 -4
- package/es/form/ProForm/index.scss +5 -0
- package/es/form/SchemaForm/index.js +4 -4
- package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/es/form/SchemaForm/initializeRequest.js +41 -5
- package/es/form/SchemaForm/reactions.d.ts +2 -2
- package/es/form/SchemaForm/reactions.js +13 -6
- package/es/form/index.d.ts +3 -3
- package/es/form/index.js +3 -3
- package/es/form/typing.d.ts +8 -2
- 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 +4 -2
- 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/table/components/Filter/index.js +6 -6
- 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 +122 -54
- package/es/table/typing.d.ts +3 -2
- package/es/table/utils/columnRender.js +2 -2
- package/es/table/utils/index.d.ts +2 -1
- package/es/table/utils/index.js +62 -113
- package/lib/actions/dialog-form.js +57 -10
- package/lib/common.scss +22 -0
- package/lib/form/Filter/SimpleFilter.js +8 -1
- package/lib/form/Filter/index.d.ts +5 -9
- package/lib/form/Filter/index.js +440 -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/ProForm/index.js +4 -4
- package/lib/form/ProForm/index.scss +5 -0
- package/lib/form/SchemaForm/index.js +4 -4
- package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/lib/form/SchemaForm/initializeRequest.js +41 -5
- package/lib/form/SchemaForm/reactions.d.ts +2 -2
- package/lib/form/SchemaForm/reactions.js +13 -6
- package/lib/form/index.d.ts +3 -3
- package/lib/form/index.js +8 -8
- package/lib/form/typing.d.ts +8 -2
- 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 +4 -2
- 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/table/components/Filter/index.js +6 -6
- 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 +121 -53
- package/lib/table/typing.d.ts +3 -2
- package/lib/table/utils/columnRender.js +2 -2
- package/lib/table/utils/index.d.ts +2 -1
- package/lib/table/utils/index.js +63 -112
- package/package.json +1 -1
- package/dist/212.js +0 -155705
- package/dist/fonts/codicon.ttf +0 -0
- package/es/form/Components/SelectTable/index.d.ts +0 -24
- package/es/form/Components/SelectTable/index.js +0 -135
- package/es/form/Components/SelectTable/index.scss +0 -28
- package/es/form/Components/SelectTable/table.d.ts +0 -6
- package/es/form/Components/SelectTable/table.js +0 -64
- package/lib/form/Components/SelectTable/index.d.ts +0 -24
- package/lib/form/Components/SelectTable/index.js +0 -157
- package/lib/form/Components/SelectTable/index.scss +0 -28
- package/lib/form/Components/SelectTable/table.d.ts +0 -6
- package/lib/form/Components/SelectTable/table.js +0 -76
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
203
|
requestScope = _initializeRequest.scope; // 初始化dataSource
|
204
204
|
|
205
205
|
|
206
|
-
var _initializeDataSource = initializeDataSource(dataSource, suffix),
|
206
|
+
var _initializeDataSource = initializeDataSource(dataSource, "".concat(suffix, "d")),
|
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 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
5
|
declare const $dataSource: (services: any, requestConfig: ProFormRequestConfig, context: 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,7 +45,7 @@ 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
|
};
|
@@ -51,7 +58,7 @@ var $dataSource = function $dataSource(services, requestConfig, context) {
|
|
51
58
|
loading: true,
|
52
59
|
readOnly: true
|
53
60
|
});
|
54
|
-
return services(field, requestConfig, context).then(function (res) {
|
61
|
+
return services(field, requestConfig, context, 'dataSource').then(function (res) {
|
55
62
|
var isValueInDataSource = getValueByValue(res, field.value);
|
56
63
|
var clearValue = isValueInDataSource ? {} : {
|
57
64
|
value: undefined
|
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
@@ -24,7 +24,7 @@ export interface ProFormSchemaItem {
|
|
24
24
|
name?: string;
|
25
25
|
description?: React.ReactNode;
|
26
26
|
title?: string;
|
27
|
-
component?: IBaseComponent | IButtonComponent | IComboComponent | ILayoutComponent |
|
27
|
+
component?: IBaseComponent | IButtonComponent | IComboComponent | ILayoutComponent | any;
|
28
28
|
props?: AnyObject | any;
|
29
29
|
decorator?: string | null;
|
30
30
|
decoratorProps?: AnyObject;
|
@@ -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.34";
|
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.34';
|
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,
|
@@ -84,7 +85,8 @@ var ProBaseInfo = function ProBaseInfo(props) {
|
|
84
85
|
|
85
86
|
return /*#__PURE__*/React.createElement(React.Fragment, null, (size === null || size === void 0 ? void 0 : size.width) && /*#__PURE__*/React.createElement(Row, {
|
86
87
|
wrap: true,
|
87
|
-
className: "teamix-pro-info-content-row"
|
88
|
+
className: "teamix-pro-info-content-row",
|
89
|
+
gutter: 20
|
88
90
|
}, renderContent()));
|
89
91
|
};
|
90
92
|
|
@@ -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 */
|
@@ -51,10 +51,10 @@ var Filter = function Filter(props) {
|
|
51
51
|
setVisible = _useState4[1];
|
52
52
|
|
53
53
|
useEffect(function () {
|
54
|
-
var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2, _actionRef$current$ge3, _actionRef$current$ge4;
|
54
|
+
var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2, _actionRef$current$ge3, _actionRef$current$ge4, _actionRef$current$ge5;
|
55
55
|
|
56
56
|
// 从全局状态中读取上次存储的条件
|
57
|
-
var rules = (_actionRef$current$ge = (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge2 = _actionRef$current.getState) === null || _actionRef$current$ge2 === void 0 ? void 0 : (_actionRef$current$ge3 = _actionRef$current$ge2.call(_actionRef$current)
|
57
|
+
var rules = (_actionRef$current$ge = (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge2 = _actionRef$current.getState) === null || _actionRef$current$ge2 === void 0 ? void 0 : (_actionRef$current$ge3 = _actionRef$current$ge2.call(_actionRef$current)) === null || _actionRef$current$ge3 === void 0 ? void 0 : (_actionRef$current$ge4 = _actionRef$current$ge3.filterRules) === null || _actionRef$current$ge4 === void 0 ? void 0 : (_actionRef$current$ge5 = _actionRef$current$ge4[column.dataIndex]) === null || _actionRef$current$ge5 === void 0 ? void 0 : _actionRef$current$ge5.rules) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : [];
|
58
58
|
setSelected(rules);
|
59
59
|
}, []); // 获取过滤项
|
60
60
|
|
@@ -172,7 +172,7 @@ var Filter = function Filter(props) {
|
|
172
172
|
btn: true
|
173
173
|
}),
|
174
174
|
onClick: function onClick() {
|
175
|
-
var _actionRef$current2, _actionRef$current2$f, _actionRef$current$
|
175
|
+
var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s;
|
176
176
|
|
177
177
|
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.filterDataSource) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2, column.dataIndex); // 先获取此列的param
|
178
178
|
|
@@ -187,7 +187,7 @@ var Filter = function Filter(props) {
|
|
187
187
|
} // 需要带上其他所有的信息
|
188
188
|
|
189
189
|
|
190
|
-
var rules = (_actionRef$current$
|
190
|
+
var rules = (_actionRef$current$ge6 = (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : (_actionRef$current3$g2 = _actionRef$current3$g.call(_actionRef$current3)) === null || _actionRef$current3$g2 === void 0 ? void 0 : _actionRef$current3$g2.filterRules) !== null && _actionRef$current$ge6 !== void 0 ? _actionRef$current$ge6 : {}; // 再设置所有的列筛选状态
|
191
191
|
|
192
192
|
(_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setFilterRules) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
|
193
193
|
rules: selected,
|
@@ -220,10 +220,10 @@ var Filter = function Filter(props) {
|
|
220
220
|
btn: true
|
221
221
|
}),
|
222
222
|
onClick: function onClick() {
|
223
|
-
var _actionRef$current$
|
223
|
+
var _actionRef$current$ge7, _actionRef$current9, _actionRef$current9$g, _actionRef$current9$g2, _actionRef$current10, _actionRef$current10$, _actionRef$current11, _actionRef$current11$;
|
224
224
|
|
225
225
|
setSelected([]);
|
226
|
-
var rules = (_actionRef$current$
|
226
|
+
var rules = (_actionRef$current$ge7 = (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$g = _actionRef$current9.getState) === null || _actionRef$current9$g === void 0 ? void 0 : (_actionRef$current9$g2 = _actionRef$current9$g.call(_actionRef$current9)) === null || _actionRef$current9$g2 === void 0 ? void 0 : _actionRef$current9$g2.filterRules) !== null && _actionRef$current$ge7 !== void 0 ? _actionRef$current$ge7 : {};
|
227
227
|
(_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.setFilterRules) === null || _actionRef$current10$ === void 0 ? void 0 : _actionRef$current10$.call(_actionRef$current10, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
|
228
228
|
rules: [],
|
229
229
|
params: ''
|