@teamix/pro 1.2.20 → 1.2.24
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 +2138 -568
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog.js +13 -23
- package/es/actions/index.d.ts +10 -0
- package/es/actions/index.js +11 -16
- package/es/form/Components/LightFilter/componentMap.js +2 -1
- package/es/form/Components/LightFilter/index.js +15 -3
- package/es/form/Components/SelectTable/index.d.ts +24 -0
- package/es/form/Components/SelectTable/index.js +135 -0
- package/es/form/Components/SelectTable/index.scss +28 -0
- package/es/form/Components/SelectTable/table.d.ts +6 -0
- package/es/form/Components/SelectTable/table.js +64 -0
- package/es/form/Filter/AdvancedFilter.js +1 -0
- package/es/form/Filter/index2.js +8 -8
- package/es/form/ProForm/index.js +5 -4
- package/es/form/ProForm/index.scss +37 -6
- package/es/form/ProForm/useFormDisplayValues.js +4 -2
- package/es/form/SchemaForm/index.js +16 -10
- package/es/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/es/form/SchemaForm/initializeDataSource.js +4 -9
- package/es/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/es/form/SchemaForm/initializeRequest.js +4 -10
- package/es/form/SchemaForm/initializeRules.d.ts +7 -1
- package/es/form/SchemaForm/initializeRules.js +9 -13
- package/es/form/SchemaForm/reactions.d.ts +5 -5
- package/es/form/SchemaForm/reactions.js +27 -29
- package/es/form/global.scss +1 -0
- package/es/form/typing.d.ts +10 -1
- package/es/form/utils.d.ts +8 -7
- package/es/form/utils.js +5 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/table/components/Filter/index.js +1 -0
- package/es/table/components/Layout/index.js +22 -12
- package/es/table/components/Pagination/index.d.ts +5 -1
- package/es/table/components/Pagination/index.js +179 -17
- package/es/table/components/Pagination/index.scss +55 -0
- package/es/table/components/ToolBar/FilterColumnIcon.js +24 -3
- package/es/table/components/ToolBar/index.scss +9 -4
- package/es/table/index.js +79 -26
- package/es/table/index.scss +5 -5
- package/es/table/typing.d.ts +9 -9
- package/es/table/utils/columnRender.js +2 -1
- package/es/table/utils/index.d.ts +7 -0
- package/es/table/utils/index.js +38 -4
- package/lib/actions/dialog.js +12 -22
- package/lib/actions/index.d.ts +10 -0
- package/lib/actions/index.js +11 -16
- package/lib/form/Components/LightFilter/componentMap.js +2 -1
- package/lib/form/Components/LightFilter/index.js +14 -3
- package/lib/form/Components/SelectTable/index.d.ts +24 -0
- package/lib/form/Components/SelectTable/index.js +157 -0
- package/lib/form/Components/SelectTable/index.scss +28 -0
- package/lib/form/Components/SelectTable/table.d.ts +6 -0
- package/lib/form/Components/SelectTable/table.js +76 -0
- package/lib/form/Filter/AdvancedFilter.js +1 -0
- package/lib/form/Filter/index2.js +9 -8
- package/lib/form/ProForm/index.js +5 -5
- package/lib/form/ProForm/index.scss +37 -6
- package/lib/form/ProForm/useFormDisplayValues.js +3 -1
- package/lib/form/SchemaForm/index.js +16 -9
- package/lib/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/lib/form/SchemaForm/initializeDataSource.js +4 -11
- package/lib/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/lib/form/SchemaForm/initializeRequest.js +4 -11
- package/lib/form/SchemaForm/initializeRules.d.ts +7 -1
- package/lib/form/SchemaForm/initializeRules.js +9 -16
- package/lib/form/SchemaForm/reactions.d.ts +5 -5
- package/lib/form/SchemaForm/reactions.js +29 -31
- package/lib/form/global.scss +1 -0
- package/lib/form/typing.d.ts +10 -1
- package/lib/form/utils.d.ts +8 -7
- package/lib/form/utils.js +6 -5
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/table/components/Layout/index.js +21 -11
- package/lib/table/components/Pagination/index.d.ts +5 -1
- package/lib/table/components/Pagination/index.js +186 -17
- package/lib/table/components/Pagination/index.scss +55 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.js +23 -2
- package/lib/table/components/ToolBar/index.scss +9 -4
- package/lib/table/index.js +79 -24
- package/lib/table/index.scss +5 -5
- package/lib/table/typing.d.ts +9 -9
- package/lib/table/utils/columnRender.js +2 -1
- package/lib/table/utils/index.d.ts +7 -0
- package/lib/table/utils/index.js +46 -4
- package/package.json +1 -1
@@ -55,8 +55,9 @@ import initializeFormGroup from './initializeFormGroup';
|
|
55
55
|
import initializeFormStep from './initializeFormStep';
|
56
56
|
import initializeFormTab from './initializeFormTab';
|
57
57
|
import initializeFormCollapse from './initializeFormCollapse';
|
58
|
+
import { $request, $common, $dataSource, $validator } from './reactions';
|
58
59
|
import fieldTypeMap from '../fieldTypeMap';
|
59
|
-
import {
|
60
|
+
import { getFieldName, mapSchemaName } from '../utils';
|
60
61
|
import warning from '../warning';
|
61
62
|
export default /*#__PURE__*/memo(function (_ref) {
|
62
63
|
var schema = _ref.schema,
|
@@ -96,12 +97,17 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
96
97
|
}, []); // 合并 schema 中 request 的 scope
|
97
98
|
|
98
99
|
var mergedScope = useMemo(function () {
|
99
|
-
return _objectSpread({}, scope)
|
100
|
+
return _objectSpread(_objectSpread({}, scope), {}, {
|
101
|
+
$request: $request,
|
102
|
+
$common: $common,
|
103
|
+
$dataSource: $dataSource,
|
104
|
+
$validator: $validator
|
105
|
+
});
|
100
106
|
}, [scope]); // 格式化 schema
|
101
107
|
|
102
108
|
var formatSchema = useCallback(function (schema) {
|
103
109
|
var schemaProperties = {};
|
104
|
-
schema === null || schema === void 0 ? void 0 : schema.forEach(function (item) {
|
110
|
+
schema === null || schema === void 0 ? void 0 : schema.forEach(function (item, index) {
|
105
111
|
var newItem = warning(item);
|
106
112
|
var _newItem = newItem,
|
107
113
|
originalComponent = _newItem.component; // 根据component的不同,初始化为内置的item
|
@@ -165,7 +171,7 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
165
171
|
component = _newItem2.component,
|
166
172
|
type = _newItem2.type,
|
167
173
|
_newItem2$name = _newItem2.name,
|
168
|
-
name = _newItem2$name === void 0 ?
|
174
|
+
name = _newItem2$name === void 0 ? getFieldName(component === null || component === void 0 ? void 0 : component.replace(/\./g, ''), index) : _newItem2$name,
|
169
175
|
decorator = _newItem2.decorator,
|
170
176
|
decoratorProps = _newItem2.decoratorProps,
|
171
177
|
dataSource = _newItem2.dataSource,
|
@@ -190,18 +196,18 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
190
196
|
var defaultDecoratorProps = _objectSpread(_objectSpread({}, tooltipProps), decoratorProps); // 初始化request
|
191
197
|
|
192
198
|
|
193
|
-
var _initializeRequest = initializeRequest(request),
|
199
|
+
var _initializeRequest = initializeRequest(request, index),
|
194
200
|
requestReactions = _initializeRequest.reactions,
|
195
201
|
requestScope = _initializeRequest.scope; // 初始化dataSource
|
196
202
|
|
197
203
|
|
198
|
-
var _initializeDataSource = initializeDataSource(dataSource),
|
204
|
+
var _initializeDataSource = initializeDataSource(dataSource, index),
|
199
205
|
defaultDataSource = _initializeDataSource.dataSource,
|
200
206
|
dataSourceReactions = _initializeDataSource.reactions,
|
201
207
|
dataSourceScope = _initializeDataSource.scope; // 初始化rules
|
202
208
|
|
203
209
|
|
204
|
-
var _initializeRules = initializeRules(rules),
|
210
|
+
var _initializeRules = initializeRules(rules, index),
|
205
211
|
defaultRules = _initializeRules.rules,
|
206
212
|
rulesScope = _initializeRules.scope; // 合并reactions,初始化reactions
|
207
213
|
|
@@ -239,15 +245,15 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
239
245
|
});
|
240
246
|
return schemaProperties;
|
241
247
|
}, [mergedScope]);
|
242
|
-
var
|
248
|
+
var formilySchema = useMemo(function () {
|
243
249
|
return {
|
244
250
|
type: 'object',
|
245
251
|
properties: formatSchema(schema)
|
246
252
|
};
|
247
|
-
}, [schema]); // console.log(
|
253
|
+
}, [schema]); // console.log(formilySchema);
|
248
254
|
|
249
255
|
return /*#__PURE__*/React.createElement(SchemaField, {
|
250
|
-
schema:
|
256
|
+
schema: formilySchema,
|
251
257
|
components: components,
|
252
258
|
scope: mergedScope
|
253
259
|
});
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import type { ProFormRequestConfig } from '../';
|
1
|
+
import type { ProFormRequestConfig } from '../typing';
|
2
2
|
interface IInitializeDataSource {
|
3
|
-
(requestConfig?: ProFormRequestConfig | any): {
|
3
|
+
(requestConfig?: ProFormRequestConfig | any, index?: number): {
|
4
4
|
dataSource?: any[];
|
5
5
|
reactions: any[];
|
6
6
|
scope: {
|
@@ -1,19 +1,14 @@
|
|
1
1
|
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
2
|
|
3
3
|
import { isPlainObj } from '@teamix/utils';
|
4
|
-
import { $request, $dataSource } from './reactions';
|
5
|
-
import { getRandomName } from '../utils';
|
6
4
|
|
7
|
-
var initializeDataSource = function initializeDataSource(dataSource) {
|
5
|
+
var initializeDataSource = function initializeDataSource(dataSource, index) {
|
8
6
|
if (isPlainObj(dataSource)) {
|
9
|
-
var _scope;
|
10
|
-
|
11
7
|
var requestConfig = dataSource;
|
12
|
-
var
|
13
|
-
var dataSourceScopeName = getRandomName('$dataSource');
|
8
|
+
var requestConfigName = "$requestConfig_".concat(index);
|
14
9
|
return {
|
15
|
-
reactions: ["{{
|
16
|
-
scope: (
|
10
|
+
reactions: ["{{$dataSource($request,".concat(requestConfigName, ",context)}}")],
|
11
|
+
scope: _defineProperty({}, requestConfigName, requestConfig)
|
17
12
|
};
|
18
13
|
}
|
19
14
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import type { ProFormRequestConfig } from '../';
|
1
|
+
import type { ProFormRequestConfig } from '../typing';
|
2
2
|
interface IInitializeRequest {
|
3
|
-
(requestConfig?: ProFormRequestConfig): {
|
3
|
+
(requestConfig?: ProFormRequestConfig, index?: number): {
|
4
4
|
reactions: any[];
|
5
5
|
scope: {
|
6
6
|
[x: string]: any;
|
@@ -1,17 +1,11 @@
|
|
1
1
|
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
2
|
|
3
|
-
|
4
|
-
import { getRandomName } from '../utils';
|
5
|
-
|
6
|
-
var initializeRequest = function initializeRequest(requestConfig) {
|
3
|
+
var initializeRequest = function initializeRequest(requestConfig, index) {
|
7
4
|
if (requestConfig) {
|
8
|
-
var
|
9
|
-
|
10
|
-
var requestScopeName = getRandomName('$request');
|
11
|
-
var contextScopeName = getRandomName('$context');
|
5
|
+
var requestConfigName = "$requestConfig_".concat(index);
|
12
6
|
return {
|
13
|
-
reactions: ["{{
|
14
|
-
scope: (
|
7
|
+
reactions: ["{{$common($request,".concat(requestConfigName, ",context)}}")],
|
8
|
+
scope: _defineProperty({}, requestConfigName, requestConfig)
|
15
9
|
};
|
16
10
|
}
|
17
11
|
|
@@ -17,23 +17,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
17
17
|
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; }
|
18
18
|
|
19
19
|
import { isArr, isPlainObj } from '@teamix/utils';
|
20
|
-
import { $request } from '../SchemaForm/reactions';
|
21
|
-
import { getRandomName } from '../utils';
|
22
|
-
import { $validator } from './reactions';
|
23
20
|
|
24
|
-
var initializeRules = function initializeRules(rules) {
|
21
|
+
var initializeRules = function initializeRules(rules, index) {
|
25
22
|
var initializeValidator = function initializeValidator(rule) {
|
26
|
-
|
27
|
-
var _scope;
|
23
|
+
var subIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
28
24
|
|
29
|
-
|
30
|
-
var
|
31
|
-
var
|
25
|
+
if (isPlainObj(rule === null || rule === void 0 ? void 0 : rule.validator)) {
|
26
|
+
var requestConfig = rule.validator;
|
27
|
+
var requestConfigName = "$requestConfig_".concat(index, "_").concat(subIndex);
|
32
28
|
return {
|
33
29
|
rules: _objectSpread(_objectSpread({}, rule), {}, {
|
34
|
-
validator: "{{
|
30
|
+
validator: "{{$validator($request,".concat(requestConfigName, ",context)}}")
|
35
31
|
}),
|
36
|
-
scope: (
|
32
|
+
scope: _defineProperty({}, requestConfigName, requestConfig)
|
37
33
|
};
|
38
34
|
}
|
39
35
|
|
@@ -44,8 +40,8 @@ var initializeRules = function initializeRules(rules) {
|
|
44
40
|
};
|
45
41
|
|
46
42
|
if (isArr(rules)) {
|
47
|
-
return rules.reduce(function (prev, current) {
|
48
|
-
var result = initializeValidator(current);
|
43
|
+
return rules.reduce(function (prev, current, subIndex) {
|
44
|
+
var result = initializeValidator(current, subIndex);
|
49
45
|
prev.rules = [].concat(_toConsumableArray(prev.rules), [result.rules]);
|
50
46
|
prev.scope = _objectSpread(_objectSpread({}, prev.scope), result.scope);
|
51
47
|
return prev;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ProFormRequestConfig } from '../typing';
|
2
|
-
declare const $request: (
|
3
|
-
declare const $
|
4
|
-
declare const $validator: (services: any,
|
5
|
-
declare const $dataSource: (services: any,
|
6
|
-
export { $request, $
|
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;
|
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;
|
6
|
+
export { $request, $common, $dataSource, $validator };
|
@@ -6,54 +6,52 @@ 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(requestConfig) {
|
10
|
-
|
11
|
-
var _field$data;
|
9
|
+
var $request = function $request(field, requestConfig, context) {
|
10
|
+
var _field$data;
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}; // 配置上下文
|
12
|
+
var refresh = field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
13
|
+
var beforeRequest = requestConfig.beforeRequest,
|
14
|
+
onSuccess = requestConfig.onSuccess;
|
15
|
+
var refreshResult = isPlainObj(refresh) ? refresh : {};
|
16
|
+
var beforeRequestResult = isFn(beforeRequest) ? beforeRequest(field, context) : {};
|
17
|
+
return doCommonRequest(_objectSpread(_objectSpread({}, requestConfig), {}, {
|
18
|
+
params: _objectSpread(_objectSpread(_objectSpread({}, requestConfig.params), beforeRequestResult), refreshResult),
|
19
|
+
beforeRequest: function beforeRequest() {
|
20
|
+
return beforeRequestResult;
|
21
|
+
},
|
22
|
+
onSuccess: isFn(onSuccess) ? function (res) {
|
23
|
+
return onSuccess(res, field, context);
|
24
|
+
} : onSuccess
|
25
|
+
}), context);
|
26
|
+
}; // 通用请求配置上下文
|
29
27
|
|
30
28
|
|
31
|
-
var $
|
29
|
+
var $common = function $common(services, requestConfig, context) {
|
32
30
|
return function (field) {
|
33
|
-
return services(field, context).then(function (res) {
|
34
|
-
return onComplete && onComplete(res, field, context);
|
31
|
+
return services(field, requestConfig, context).then(function (res) {
|
32
|
+
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
35
33
|
});
|
36
34
|
};
|
37
35
|
}; // 配置校验
|
38
36
|
|
39
37
|
|
40
|
-
var $validator = function $validator(services,
|
38
|
+
var $validator = function $validator(services, requestConfig, context) {
|
41
39
|
return function (value, rules, _ref) {
|
42
40
|
var field = _ref.field;
|
43
|
-
return services(field, context).then(function (res) {
|
44
|
-
return onComplete && onComplete(res, field, context);
|
41
|
+
return services(field, requestConfig, context).then(function (res) {
|
42
|
+
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
45
43
|
});
|
46
44
|
};
|
47
45
|
}; // 配置DataSource
|
48
46
|
|
49
47
|
|
50
|
-
var $dataSource = function $dataSource(services,
|
48
|
+
var $dataSource = function $dataSource(services, requestConfig, context) {
|
51
49
|
return function (field) {
|
52
50
|
field.setState({
|
53
51
|
loading: true,
|
54
52
|
readOnly: true
|
55
53
|
});
|
56
|
-
return services(field, context).then(function (res) {
|
54
|
+
return services(field, requestConfig, context).then(function (res) {
|
57
55
|
var isValueInDataSource = getValueByValue(res, field.value);
|
58
56
|
var clearValue = isValueInDataSource ? {} : {
|
59
57
|
value: undefined
|
@@ -63,7 +61,7 @@ var $dataSource = function $dataSource(services, onComplete, context) {
|
|
63
61
|
loading: false,
|
64
62
|
readOnly: false
|
65
63
|
}, clearValue));
|
66
|
-
return onComplete && onComplete(res, field, context);
|
64
|
+
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
67
65
|
}).catch(function () {
|
68
66
|
field.setState({
|
69
67
|
loading: false,
|
@@ -73,4 +71,4 @@ var $dataSource = function $dataSource(services, onComplete, context) {
|
|
73
71
|
};
|
74
72
|
};
|
75
73
|
|
76
|
-
export { $request, $
|
74
|
+
export { $request, $common, $dataSource, $validator };
|
package/es/form/global.scss
CHANGED
package/es/form/typing.d.ts
CHANGED
@@ -60,7 +60,7 @@ export interface ProFormProps extends IFormLayoutProps {
|
|
60
60
|
initialValues?: AnyObject;
|
61
61
|
initialRequest?: ProFormRequestConfig;
|
62
62
|
previewTextPlaceholder?: ReactNode;
|
63
|
-
onChange?: (values: any, fieldValue?: any, fieldName?:
|
63
|
+
onChange?: (values: any, fieldValue?: any, fieldName?: any) => any;
|
64
64
|
onSubmit?: ((values: any) => any) | CommonRequestConfig;
|
65
65
|
onSubmitFailed?: (feedbacks: IFormFeedback[]) => void;
|
66
66
|
}
|
@@ -75,14 +75,23 @@ export interface QueryFilterProps extends ProFormProps {
|
|
75
75
|
* @deprecated triggerType已弃用
|
76
76
|
*/
|
77
77
|
triggerType?: 'keydown' | 'change' | 'submit';
|
78
|
+
/** 表单展示形式 */
|
78
79
|
mode?: 'inline' | 'panel';
|
80
|
+
/** 面板是否默认展开,仅在 mode='panel' 时生效 */
|
79
81
|
expand?: boolean;
|
82
|
+
/** 顶部筛选区前缀 */
|
80
83
|
addonBefore?: ReactNode;
|
84
|
+
/** 顶部筛选区后缀 */
|
81
85
|
addonAfter?: ReactNode;
|
86
|
+
/** 顶部筛选区默认筛选项 */
|
82
87
|
defaultFilterValue?: string;
|
88
|
+
/** 透出内部表单实例 */
|
83
89
|
formRef?: React.MutableRefObject<any>;
|
90
|
+
/** 表单初始化(含异步默认值)后回调函数 */
|
84
91
|
onInit?: (values: any) => boolean;
|
92
|
+
/** 表单筛选回调函数 */
|
85
93
|
onFilter?: (values: any) => void;
|
94
|
+
/** 表单重置回调函数 */
|
86
95
|
onReset?: (payload?: any) => void;
|
87
96
|
}
|
88
97
|
/**
|
package/es/form/utils.d.ts
CHANGED
@@ -15,14 +15,15 @@ declare const mapStatus: (props: any, field: any) => any;
|
|
15
15
|
declare const mapDataSource: (props: any, field: any) => any;
|
16
16
|
declare const mapMode: (props: any, field: any) => any;
|
17
17
|
/**
|
18
|
-
*
|
19
|
-
* @param prefix
|
20
|
-
* @
|
18
|
+
* 创建字段名称
|
19
|
+
* @param prefix 字段名称前缀,接收字段component名称,默认为FieldName
|
20
|
+
* @param index 字段索引
|
21
|
+
* @returns 字段唯一名称
|
21
22
|
*/
|
22
|
-
interface
|
23
|
-
(prefix?:
|
23
|
+
interface IGetFieldName {
|
24
|
+
(prefix: string, index?: number): string;
|
24
25
|
}
|
25
|
-
declare const
|
26
|
+
declare const getFieldName: IGetFieldName;
|
26
27
|
/**
|
27
28
|
* 将ProForm的key映射为formily的key,然后筛除掉无效的key/value
|
28
29
|
* @param obj
|
@@ -36,4 +37,4 @@ declare const mapSchemaName: (obj: any) => any;
|
|
36
37
|
* @returns 合并数组或合并其他值
|
37
38
|
*/
|
38
39
|
declare const mergeArrayValue: (arr: any[], v?: any) => any[];
|
39
|
-
export { mapSize, mapStatus, mapDataSource, mapMode, mergeArrayValue,
|
40
|
+
export { mapSize, mapStatus, mapDataSource, mapMode, mergeArrayValue, getFieldName, mapSchemaName, };
|
package/es/form/utils.js
CHANGED
@@ -113,9 +113,10 @@ var mapMode = function mapMode(props, field) {
|
|
113
113
|
});
|
114
114
|
};
|
115
115
|
|
116
|
-
var
|
117
|
-
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '
|
118
|
-
|
116
|
+
var getFieldName = function getFieldName() {
|
117
|
+
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'FieldName';
|
118
|
+
var index = arguments.length > 1 ? arguments[1] : undefined;
|
119
|
+
return "".concat(prefix, "-").concat(index);
|
119
120
|
};
|
120
121
|
/**
|
121
122
|
* 将ProForm的key映射为formily的key,然后筛除掉无效的key/value
|
@@ -168,4 +169,4 @@ var mergeArrayValue = function mergeArrayValue(arr, v) {
|
|
168
169
|
return [].concat(_toConsumableArray(arr), [v]);
|
169
170
|
};
|
170
171
|
|
171
|
-
export { mapSize, mapStatus, mapDataSource, mapMode, mergeArrayValue,
|
172
|
+
export { mapSize, mapStatus, mapDataSource, mapMode, mergeArrayValue, getFieldName, mapSchemaName };
|
package/es/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.24";
|
25
25
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -27,7 +27,7 @@ export * from './page-header';
|
|
27
27
|
export * from './skeleton';
|
28
28
|
export * from './table'; // export * from './sidebar';
|
29
29
|
|
30
|
-
var version = '1.2.
|
30
|
+
var version = '1.2.24';
|
31
31
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
32
32
|
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, // ProSidebar,
|
33
33
|
hooks, nocode, templates, utils };
|
@@ -24,6 +24,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
24
24
|
|
25
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
26
26
|
|
27
|
+
// 表格项列筛选
|
27
28
|
import React, { useEffect, useMemo, useState } from 'react';
|
28
29
|
import TeamixIcon from '@teamix/icon';
|
29
30
|
import { Button, Dropdown, Menu } from '@alicloudfe/components';
|
@@ -24,7 +24,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
24
24
|
|
25
25
|
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; }
|
26
26
|
|
27
|
-
import React, { useEffect, useState } from 'react';
|
27
|
+
import React, { useEffect, useState, isValidElement } from 'react';
|
28
28
|
import { Header, baseClass } from '@teamix/utils';
|
29
29
|
import { Button, Badge } from '@alicloudfe/components';
|
30
30
|
import TeamixIcon from '@teamix/icon';
|
@@ -48,7 +48,7 @@ var Layout = function Layout(props) {
|
|
48
48
|
rowSelection = props.rowSelection,
|
49
49
|
otherProps = _objectWithoutProperties(props, _excluded);
|
50
50
|
|
51
|
-
var mode =
|
51
|
+
var mode = dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.mode;
|
52
52
|
|
53
53
|
var _useState = useState((dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.expand) || false),
|
54
54
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -107,17 +107,27 @@ var Layout = function Layout(props) {
|
|
107
107
|
|
108
108
|
|
109
109
|
var renderPanelFilter = function renderPanelFilter() {
|
110
|
-
|
110
|
+
if (dataFilter) {
|
111
|
+
var _dataFilter$schema2;
|
111
112
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
}
|
113
|
+
if ( /*#__PURE__*/isValidElement(dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.content)) {
|
114
|
+
// 自定义渲染内容,当 `schema=[]` 时生效
|
115
|
+
return /*#__PURE__*/React.createElement("div", {
|
116
|
+
className: cls('panel-filter'),
|
117
|
+
style: {
|
118
|
+
display: expand ? 'block' : 'none'
|
119
|
+
}
|
120
|
+
}, dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.content);
|
121
|
+
} else if ((dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema2 = dataFilter.schema) === null || _dataFilter$schema2 === void 0 ? void 0 : _dataFilter$schema2.length) >= 0) {
|
122
|
+
return /*#__PURE__*/React.createElement("div", {
|
123
|
+
className: cls('panel-filter'),
|
124
|
+
style: {
|
125
|
+
display: expand ? 'block' : 'none'
|
126
|
+
}
|
127
|
+
}, /*#__PURE__*/React.createElement(AdvancedFilter, _objectSpread({
|
128
|
+
form: dataFilterForm
|
129
|
+
}, dataFilter)));
|
130
|
+
}
|
121
131
|
}
|
122
132
|
}; // 渲染过滤器按钮
|
123
133
|
|
@@ -1,3 +1,7 @@
|
|
1
1
|
import { PaginationProps } from '@alicloudfe/components/types/pagination';
|
2
|
-
|
2
|
+
import { responsivePaginationType } from '../../typing';
|
3
|
+
import './index.scss';
|
4
|
+
declare const _default: (props: PaginationProps & {
|
5
|
+
responsivePaginationType?: responsivePaginationType;
|
6
|
+
}) => JSX.Element;
|
3
7
|
export default _default;
|