@teamix/pro 1.2.34 → 1.3.2
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 +1542 -1149
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.d.ts +9 -4
- package/es/actions/dialog-form.js +16 -9
- package/es/form/Components/ProField/mapDateFormat.d.ts +3 -0
- package/es/form/Components/ProField/mapDateFormat.js +113 -0
- package/es/form/Filter/AdvancedFilter.js +4 -4
- package/es/form/Filter/LightFilter.js +22 -15
- package/es/form/Filter/index.js +171 -133
- package/es/form/Filter/useSpecialProps.d.ts +1 -1
- package/es/form/Filter/useSpecialProps.js +9 -9
- package/es/form/ProForm/customComponent.js +2 -1
- package/es/form/ProForm/index.scss +8 -8
- package/es/form/SchemaForm/index.js +2 -2
- package/es/form/SchemaForm/initializeRequest.js +1 -2
- package/es/form/SchemaForm/reactions.d.ts +2 -2
- package/es/form/SchemaForm/reactions.js +32 -21
- package/es/form/fieldTypeMap.d.ts +3 -0
- package/es/form/fieldTypeMap.js +3 -0
- package/es/form/typing.d.ts +8 -1
- package/es/index.d.ts +4 -4
- package/es/index.js +4 -4
- package/es/nocode/configurators/PageHeader.js +2 -2
- package/es/page-header/index.js +7 -3
- package/es/table/components/Layout/index.js +2 -2
- package/es/table/components/Pagination/index.js +11 -1
- package/es/table/components/ToolBar/DensityIcon.js +5 -3
- package/es/table/components/ToolBar/FilterColumnIcon.js +12 -3
- package/es/table/components/ToolBar/Fullscreen.js +6 -6
- package/es/table/components/ToolBar/index.scss +2 -2
- package/es/table/index.js +40 -21
- package/es/table/index.scss +6 -0
- package/es/table/typing.d.ts +13 -6
- package/es/table/utils/columnRender.js +6 -0
- package/es/timeline/ProTimeLineItem/index.d.ts +5 -0
- package/es/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.js +59 -72
- package/es/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.scss +34 -86
- package/es/timeline/index.d.ts +10 -0
- package/es/{step → timeline}/index.js +33 -57
- package/es/timeline/index.scss +7 -0
- package/es/timeline/typing.d.ts +101 -0
- package/es/{step → timeline}/typing.js +0 -0
- package/lib/actions/dialog-form.d.ts +9 -4
- package/lib/actions/dialog-form.js +16 -9
- package/lib/form/Components/ProField/mapDateFormat.d.ts +3 -0
- package/lib/form/Components/ProField/mapDateFormat.js +125 -0
- package/lib/form/Filter/AdvancedFilter.js +4 -4
- package/lib/form/Filter/LightFilter.js +21 -15
- package/lib/form/Filter/index.js +170 -132
- package/lib/form/Filter/useSpecialProps.d.ts +1 -1
- package/lib/form/Filter/useSpecialProps.js +8 -8
- package/lib/form/ProForm/customComponent.js +3 -1
- package/lib/form/ProForm/index.scss +8 -8
- package/lib/form/SchemaForm/index.js +2 -2
- package/lib/form/SchemaForm/initializeRequest.js +1 -2
- package/lib/form/SchemaForm/reactions.d.ts +2 -2
- package/lib/form/SchemaForm/reactions.js +31 -20
- package/lib/form/fieldTypeMap.d.ts +3 -0
- package/lib/form/fieldTypeMap.js +5 -1
- package/lib/form/typing.d.ts +8 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +10 -10
- package/lib/nocode/configurators/PageHeader.js +2 -2
- package/lib/page-header/index.js +6 -2
- package/lib/table/components/Layout/index.js +2 -2
- package/lib/table/components/Pagination/index.js +10 -0
- package/lib/table/components/ToolBar/DensityIcon.js +5 -3
- package/lib/table/components/ToolBar/FilterColumnIcon.js +11 -2
- package/lib/table/components/ToolBar/Fullscreen.js +6 -6
- package/lib/table/components/ToolBar/index.scss +2 -2
- package/lib/table/index.js +40 -21
- package/lib/table/index.scss +6 -0
- package/lib/table/typing.d.ts +13 -6
- package/lib/table/utils/columnRender.js +6 -0
- package/lib/timeline/ProTimeLineItem/index.d.ts +5 -0
- package/lib/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.js +58 -72
- package/lib/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.scss +34 -86
- package/lib/timeline/index.d.ts +10 -0
- package/lib/{step → timeline}/index.js +38 -58
- package/lib/timeline/index.scss +7 -0
- package/lib/timeline/typing.d.ts +101 -0
- package/lib/{step → timeline}/typing.js +0 -0
- package/package.json +1 -1
- package/es/step/ProStepItem/components/HozStepItem/index.d.ts +0 -5
- package/es/step/ProStepItem/components/HozStepItem/index.js +0 -235
- package/es/step/ProStepItem/components/HozStepItem/index.scss +0 -279
- package/es/step/ProStepItem/components/VerStepItem/index.d.ts +0 -5
- package/es/step/ProStepItem/index.d.ts +0 -4
- package/es/step/ProStepItem/index.js +0 -57
- package/es/step/index.d.ts +0 -9
- package/es/step/typing.d.ts +0 -96
- package/lib/step/ProStepItem/components/HozStepItem/index.d.ts +0 -5
- package/lib/step/ProStepItem/components/HozStepItem/index.js +0 -258
- package/lib/step/ProStepItem/components/HozStepItem/index.scss +0 -279
- package/lib/step/ProStepItem/components/VerStepItem/index.d.ts +0 -5
- package/lib/step/ProStepItem/index.d.ts +0 -4
- package/lib/step/ProStepItem/index.js +0 -69
- package/lib/step/index.d.ts +0 -9
- package/lib/step/typing.d.ts +0 -96
@@ -17,20 +17,19 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
17
17
|
var $request = function $request(field, requestConfig, context, type) {
|
18
18
|
var _field$data;
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
// refresh = field.data?.refreshMap?.[type]
|
23
|
-
// }else if(isNum(type)){
|
24
|
-
// }else{
|
25
|
-
// refresh = field.data?.refresh;
|
26
|
-
// }
|
27
|
-
var refresh = (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
28
|
-
var beforeRequest = requestConfig.beforeRequest,
|
20
|
+
var params = requestConfig.params,
|
21
|
+
beforeRequest = requestConfig.beforeRequest,
|
29
22
|
onSuccess = requestConfig.onSuccess;
|
30
|
-
var refreshResult = (0, _utils.isPlainObj)(refresh) ? refresh : {};
|
31
23
|
var beforeRequestResult = (0, _utils.isFn)(beforeRequest) ? beforeRequest(field, context) : {};
|
24
|
+
/**
|
25
|
+
* 主动触发的请求刷新
|
26
|
+
*/
|
27
|
+
// 触发所有配置的请求
|
28
|
+
|
29
|
+
var refresh = (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
30
|
+
var refreshResult = (0, _utils.isPureObj)(refresh) ? refresh : {};
|
32
31
|
return (0, _utils.doCommonRequest)(_objectSpread(_objectSpread({}, requestConfig), {}, {
|
33
|
-
params: _objectSpread(_objectSpread(_objectSpread({},
|
32
|
+
params: _objectSpread(_objectSpread(_objectSpread({}, params), beforeRequestResult), refreshResult),
|
34
33
|
beforeRequest: function beforeRequest() {
|
35
34
|
return beforeRequestResult;
|
36
35
|
},
|
@@ -43,10 +42,12 @@ var $request = function $request(field, requestConfig, context, type) {
|
|
43
42
|
|
44
43
|
exports.$request = $request;
|
45
44
|
|
46
|
-
var $common = function $common(services, requestConfig, context
|
45
|
+
var $common = function $common(services, requestConfig, context) {
|
47
46
|
return function (field) {
|
48
|
-
return services(field, requestConfig, context,
|
49
|
-
|
47
|
+
return services(field, requestConfig, context, 'request').then(function (res) {
|
48
|
+
var _requestConfig$onComp;
|
49
|
+
|
50
|
+
return (_requestConfig$onComp = requestConfig.onComplete) === null || _requestConfig$onComp === void 0 ? void 0 : _requestConfig$onComp.call(requestConfig, res, field, context);
|
50
51
|
});
|
51
52
|
};
|
52
53
|
}; // 配置校验
|
@@ -58,7 +59,9 @@ var $validator = function $validator(services, requestConfig, context) {
|
|
58
59
|
return function (value, rules, _ref) {
|
59
60
|
var field = _ref.field;
|
60
61
|
return services(field, requestConfig, context, 'validator').then(function (res) {
|
61
|
-
|
62
|
+
var _requestConfig$onComp2;
|
63
|
+
|
64
|
+
return (_requestConfig$onComp2 = requestConfig.onComplete) === null || _requestConfig$onComp2 === void 0 ? void 0 : _requestConfig$onComp2.call(requestConfig, res, field, context);
|
62
65
|
});
|
63
66
|
};
|
64
67
|
}; // 配置DataSource
|
@@ -69,23 +72,31 @@ exports.$validator = $validator;
|
|
69
72
|
var $dataSource = function $dataSource(services, requestConfig, context) {
|
70
73
|
return function (field) {
|
71
74
|
field.setState({
|
72
|
-
loading: true
|
75
|
+
loading: true
|
76
|
+
});
|
77
|
+
field.setComponentProps({
|
73
78
|
readOnly: true
|
74
79
|
});
|
75
80
|
return services(field, requestConfig, context, 'dataSource').then(function (res) {
|
81
|
+
var _requestConfig$onComp3;
|
82
|
+
|
76
83
|
var isValueInDataSource = (0, _utils.getValueByValue)(res, field.value);
|
77
84
|
var clearValue = isValueInDataSource ? {} : {
|
78
85
|
value: undefined
|
79
86
|
};
|
80
87
|
field.setState(_objectSpread({
|
81
88
|
dataSource: res,
|
82
|
-
loading: false
|
83
|
-
readOnly: false
|
89
|
+
loading: false
|
84
90
|
}, clearValue));
|
85
|
-
|
91
|
+
field.setComponentProps({
|
92
|
+
readOnly: false
|
93
|
+
});
|
94
|
+
return (_requestConfig$onComp3 = requestConfig.onComplete) === null || _requestConfig$onComp3 === void 0 ? void 0 : _requestConfig$onComp3.call(requestConfig, res, field, context);
|
86
95
|
}).catch(function () {
|
87
96
|
field.setState({
|
88
|
-
loading: false
|
97
|
+
loading: false
|
98
|
+
});
|
99
|
+
field.setComponentProps({
|
89
100
|
readOnly: false
|
90
101
|
});
|
91
102
|
});
|
package/lib/form/fieldTypeMap.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.default = void 0;
|
6
|
+
exports.timePicker2TypeArray = exports.default = exports.datePicker2TypeArray = void 0;
|
7
7
|
var fieldTypeMap = {
|
8
8
|
Input: 'text',
|
9
9
|
Password: 'password',
|
@@ -46,5 +46,9 @@ var fieldTypeMap = {
|
|
46
46
|
Search: 'search',
|
47
47
|
SelectGroup: 'selectGroup'
|
48
48
|
};
|
49
|
+
var datePicker2TypeArray = ['DatePicker', 'DateTimePicker', 'WeekPicker', 'MonthPicker', 'YearPicker', 'QuarterPicker', 'DateRangePicker', 'DateTimeRangePicker', 'WeekRangePicker', 'MonthRangePicker', 'YearRangePicker', 'QuarterRangePicker'];
|
50
|
+
exports.datePicker2TypeArray = datePicker2TypeArray;
|
51
|
+
var timePicker2TypeArray = ['TimePicker', 'TimeRangePicker'];
|
52
|
+
exports.timePicker2TypeArray = timePicker2TypeArray;
|
49
53
|
var _default = fieldTypeMap;
|
50
54
|
exports.default = _default;
|
package/lib/form/typing.d.ts
CHANGED
@@ -10,6 +10,10 @@ declare type FieldDisplayTypes = 'none' | 'hidden' | 'visible';
|
|
10
10
|
export interface ProFormInitializeItem {
|
11
11
|
(item: ProFormSchemaItem, props?: any): ProFormSchemaItem;
|
12
12
|
}
|
13
|
+
/**
|
14
|
+
* ProForm 实例类型
|
15
|
+
*/
|
16
|
+
export declare type ProFormType = FormType;
|
13
17
|
declare type IBaseComponent = 'Input' | 'Password' | 'TextArea' | 'NumberPicker' | 'Percent' | 'Money' | 'Select' | 'MultipleSelect' | 'TreeSelect' | 'Cascader' | 'MultipleCascader' | 'ArbitraryCascader' | 'Radio' | 'Checkbox' | 'Switch' | 'DatePicker' | 'TimePicker' | 'DateTimePicker' | 'WeekPicker' | 'MonthPicker' | 'YearPicker' | 'QuarterPicker' | 'DateRangePicker' | 'TimeRangePicker' | 'DateTimeRangePicker' | 'WeekRangePicker' | 'MonthRangePicker' | 'YearRangePicker' | 'QuarterRangePicker' | 'Transfer' | 'Upload' | 'ColorPicker' | 'ColorRadio' | 'IconPicker' | 'JsonInput' | 'TagPicker' | 'MultipleTagPicker' | 'Range' | 'Search' | 'SelectGroup';
|
14
18
|
declare type IButtonComponent = 'Submit' | 'Reset';
|
15
19
|
declare type IComboComponent = 'ArrayCards' | 'ArrayCards.Addition' | 'ArrayCards.Remove' | 'ArrayCards.MoveUp' | 'ArrayCards.MoveDown' | 'ArrayCards.Index' | 'ArrayCollapse' | 'ArrayCollapse.CollapsePanel' | 'ArrayCollapse.Addition' | 'ArrayCollapse.Remove' | 'ArrayCollapse.MoveUp' | 'ArrayCollapse.MoveDown' | 'ArrayCollapse.Index' | 'ArrayTable' | 'ArrayTable.Column' | 'ArrayTable.SortHandle' | 'ArrayTable.Addition' | 'ArrayTable.Remove' | 'ArrayTable.MoveDown' | 'ArrayTable.MoveUp' | 'ArrayTable.Index' | 'ArrayItems' | 'ArrayItems.Item' | 'ArrayItems.SortHandle' | 'ArrayItems.Addition' | 'ArrayItems.Remove' | 'ArrayItems.MoveDown' | 'ArrayItems.MoveUp' | 'ArrayItems.Index' | 'Editable' | 'Editable.Popover' | 'Editable.Dialog' | 'Editable.Drawer';
|
@@ -68,8 +72,9 @@ export interface ProFormProps extends IFormLayoutProps {
|
|
68
72
|
export interface FilterProps extends ProFormProps {
|
69
73
|
form: FormType;
|
70
74
|
defaultFilterValue?: string;
|
75
|
+
activeFilterValueRef?: React.MutableRefObject<any>;
|
76
|
+
forceClear?: boolean;
|
71
77
|
onReset?: (payload?: any) => void;
|
72
|
-
onResetClick?: () => void;
|
73
78
|
}
|
74
79
|
export interface QueryFilterLayoutProps {
|
75
80
|
prefixCls?: string;
|
@@ -93,6 +98,8 @@ export interface QueryFilterProps extends ProFormProps {
|
|
93
98
|
purePanel?: boolean;
|
94
99
|
/** 面板是否默认展开,仅在 mode='panel' 时生效 */
|
95
100
|
expand?: boolean;
|
101
|
+
/** 是否强制清除 */
|
102
|
+
forceClear?: boolean;
|
96
103
|
/** 顶部筛选区前缀 */
|
97
104
|
addonBefore?: ReactNode;
|
98
105
|
/** 顶部筛选区后缀 */
|
package/lib/index.d.ts
CHANGED
@@ -9,7 +9,7 @@ import ProPageHeader from './page-header';
|
|
9
9
|
import ProTable from './table';
|
10
10
|
import ProSkeleton from './skeleton';
|
11
11
|
import utils from './utils';
|
12
|
-
import {
|
12
|
+
import { ProTimeline } from './timeline';
|
13
13
|
import * as nocode from './nocode';
|
14
14
|
import * as templates from './templates';
|
15
15
|
export * from './actions';
|
@@ -23,6 +23,6 @@ export * from './page-header';
|
|
23
23
|
export * from './skeleton';
|
24
24
|
export * from './table';
|
25
25
|
export * from './utils';
|
26
|
-
export * from './
|
27
|
-
declare const version = "1.2
|
28
|
-
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable,
|
26
|
+
export * from './timeline';
|
27
|
+
declare const version = "1.3.2";
|
28
|
+
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProTimeline, hooks, nocode, templates, utils, };
|
package/lib/index.js
CHANGED
@@ -18,7 +18,7 @@ var _exportNames = {
|
|
18
18
|
ProTable: true,
|
19
19
|
ProSkeleton: true,
|
20
20
|
utils: true,
|
21
|
-
|
21
|
+
ProTimeline: true,
|
22
22
|
nocode: true,
|
23
23
|
templates: true
|
24
24
|
};
|
@@ -70,16 +70,16 @@ Object.defineProperty(exports, "ProSkeleton", {
|
|
70
70
|
return _skeleton.default;
|
71
71
|
}
|
72
72
|
});
|
73
|
-
Object.defineProperty(exports, "
|
73
|
+
Object.defineProperty(exports, "ProTable", {
|
74
74
|
enumerable: true,
|
75
75
|
get: function get() {
|
76
|
-
return
|
76
|
+
return _table.default;
|
77
77
|
}
|
78
78
|
});
|
79
|
-
Object.defineProperty(exports, "
|
79
|
+
Object.defineProperty(exports, "ProTimeline", {
|
80
80
|
enumerable: true,
|
81
81
|
get: function get() {
|
82
|
-
return
|
82
|
+
return _timeline.ProTimeline;
|
83
83
|
}
|
84
84
|
});
|
85
85
|
Object.defineProperty(exports, "hooks", {
|
@@ -239,16 +239,16 @@ Object.keys(_utils).forEach(function (key) {
|
|
239
239
|
});
|
240
240
|
});
|
241
241
|
|
242
|
-
var
|
242
|
+
var _timeline = require("./timeline");
|
243
243
|
|
244
|
-
Object.keys(
|
244
|
+
Object.keys(_timeline).forEach(function (key) {
|
245
245
|
if (key === "default" || key === "__esModule") return;
|
246
246
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
247
|
-
if (key in exports && exports[key] ===
|
247
|
+
if (key in exports && exports[key] === _timeline[key]) return;
|
248
248
|
Object.defineProperty(exports, key, {
|
249
249
|
enumerable: true,
|
250
250
|
get: function get() {
|
251
|
-
return
|
251
|
+
return _timeline[key];
|
252
252
|
}
|
253
253
|
});
|
254
254
|
});
|
@@ -285,5 +285,5 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
285
285
|
// 设置图标源
|
286
286
|
_icon.default.setConfig(_utils.default.getTeamixIconConfig());
|
287
287
|
|
288
|
-
var version = '1.2
|
288
|
+
var version = '1.3.2';
|
289
289
|
exports.version = version;
|
@@ -88,11 +88,11 @@ var schema = [{
|
|
88
88
|
}, {
|
89
89
|
name: 'iconColor',
|
90
90
|
title: '图标颜色',
|
91
|
-
component: '
|
91
|
+
component: 'ColorPicker'
|
92
92
|
}, {
|
93
93
|
name: 'iconBackgroundColor',
|
94
94
|
title: '图标背景颜色',
|
95
|
-
component: '
|
95
|
+
component: 'ColorPicker'
|
96
96
|
}, {
|
97
97
|
name: 'iconBackgroundType',
|
98
98
|
title: '图标背景形状',
|
package/lib/page-header/index.js
CHANGED
@@ -88,8 +88,12 @@ var getColorAndStyle = function getColorAndStyle(color, backgroundColor, backgro
|
|
88
88
|
var isColorPresetColor = (0, _utils.isPresetColor)(color);
|
89
89
|
var isBgColorPresetColor = (0, _utils.isPresetColor)(backgroundColor);
|
90
90
|
var className = (0, _classnames2.default)((_classnames = {}, _defineProperty(_classnames, "".concat((0, _utils.getColorClassName)(color)), isColorPresetColor), _defineProperty(_classnames, "".concat((0, _utils.getBackgroundColorClassName)(backgroundColor)), isBgColorPresetColor), _defineProperty(_classnames, "".concat(cls("bg-type-".concat(backgroundType))), !!backgroundType), _classnames));
|
91
|
-
var styleColor = isColorPresetColor ?
|
92
|
-
var styleBgColor = isBgColorPresetColor ?
|
91
|
+
var styleColor = isColorPresetColor ? (0, _utils.getColor)(color) : color;
|
92
|
+
var styleBgColor = isBgColorPresetColor ? (0, _utils.getColor)(backgroundColor) : backgroundColor; // debugger;
|
93
|
+
// console.log('color', color);
|
94
|
+
// console.log('backgroundColor', backgroundColor);
|
95
|
+
// console.log('styleBgColor', styleBgColor);
|
96
|
+
|
93
97
|
var style = {
|
94
98
|
color: styleColor,
|
95
99
|
backgroundColor: styleBgColor
|
@@ -172,13 +172,13 @@ var Layout = function Layout(props) {
|
|
172
172
|
className: cls('wrapper')
|
173
173
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
174
174
|
className: cls('left')
|
175
|
-
}, header && /*#__PURE__*/_react.default.createElement(_utils.Header, _objectSpread({}, header))
|
175
|
+
}, header && /*#__PURE__*/_react.default.createElement(_utils.Header, _objectSpread({}, header))), /*#__PURE__*/_react.default.createElement("div", {
|
176
176
|
className: cls('right')
|
177
177
|
}, extra && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
|
178
178
|
actionRef: actionRef,
|
179
179
|
quickAction: extra,
|
180
180
|
rowSelection: rowSelection
|
181
|
-
}), !(dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema4 = dataFilter.schema) === null || _dataFilter$schema4 === void 0 ? void 0 : _dataFilter$schema4.length) && renderQueryFilter())
|
181
|
+
}), !(dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema3 = dataFilter.schema) === null || _dataFilter$schema3 === void 0 ? void 0 : _dataFilter$schema3.length) && renderQueryFilter())), (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema4 = dataFilter.schema) === null || _dataFilter$schema4 === void 0 ? void 0 : _dataFilter$schema4.length) && renderQueryFilter());
|
182
182
|
} else if (!header && mainAction) {
|
183
183
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderQueryFilter());
|
184
184
|
} else if (!header && !mainAction) {
|
@@ -64,6 +64,13 @@ var _default = function _default(props) {
|
|
64
64
|
responsiveProps = _useResponsiveProps.responsiveProps,
|
65
65
|
paginationWrapperRef = _useResponsiveProps.ref;
|
66
66
|
|
67
|
+
(0, _react.useEffect)(function () {
|
68
|
+
// size='mini' 模式下 current 受控
|
69
|
+
if (responsiveProps === 'mini') {
|
70
|
+
setCurrentPage(current);
|
71
|
+
}
|
72
|
+
}, [current]);
|
73
|
+
|
67
74
|
var _useState = (0, _react.useState)(false),
|
68
75
|
_useState2 = _slicedToArray(_useState, 2),
|
69
76
|
visible = _useState2[0],
|
@@ -100,6 +107,9 @@ var _default = function _default(props) {
|
|
100
107
|
text: true,
|
101
108
|
onMouseEnter: function onMouseEnter() {
|
102
109
|
return setVisible(true);
|
110
|
+
},
|
111
|
+
style: {
|
112
|
+
lineHeight: '18px'
|
103
113
|
}
|
104
114
|
}, (0, _utils.getMessage)('total', {
|
105
115
|
total: total
|
@@ -39,9 +39,11 @@ var RadioItem = _components.Menu.RadioItem;
|
|
39
39
|
var cls = (0, _utils.baseClass)('teamix-pro-table-toolbar-icon');
|
40
40
|
|
41
41
|
var DensityIcon = function DensityIcon(props) {
|
42
|
+
var _actionRef$current;
|
43
|
+
|
42
44
|
var actionRef = props.actionRef;
|
43
45
|
|
44
|
-
var _useState = (0, _react.useState)('medium'),
|
46
|
+
var _useState = (0, _react.useState)(((_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.size) || 'medium'),
|
45
47
|
_useState2 = _slicedToArray(_useState, 2),
|
46
48
|
size = _useState2[0],
|
47
49
|
setSize = _useState2[1]; // const [fullscreen, setFullscreen] = useState<boolean>(false);
|
@@ -61,10 +63,10 @@ var DensityIcon = function DensityIcon(props) {
|
|
61
63
|
|
62
64
|
|
63
65
|
var radioOnchange = function radioOnchange(mode) {
|
64
|
-
var _actionRef$
|
66
|
+
var _actionRef$current2, _actionRef$current2$s;
|
65
67
|
|
66
68
|
setSize(mode);
|
67
|
-
(_actionRef$
|
69
|
+
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$s = _actionRef$current2.setSize) === null || _actionRef$current2$s === void 0 ? void 0 : _actionRef$current2$s.call(_actionRef$current2, mode);
|
68
70
|
}; // // 销毁监听函数
|
69
71
|
// useEffect(() => {
|
70
72
|
// return () => {
|
@@ -54,9 +54,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
54
54
|
var CheckboxItem = _components.Menu.CheckboxItem;
|
55
55
|
var Row = _components.Grid.Row,
|
56
56
|
Col = _components.Grid.Col;
|
57
|
-
var cls = (0, _utils.baseClass)('teamix-pro-table-toolbar-filter-column');
|
57
|
+
var cls = (0, _utils.baseClass)('teamix-pro-table-toolbar-filter-column'); // 判断是否是 root 组织
|
58
|
+
|
59
|
+
var isRoot = (0, _utils.getCookie)('organizationId') === '1';
|
58
60
|
|
59
61
|
var processColumns = function processColumns(columns) {
|
62
|
+
if (isRoot) {
|
63
|
+
// root 组织下不显示标签管理
|
64
|
+
columns = columns.filter(function (item) {
|
65
|
+
return item.valueType !== 'selectGroup';
|
66
|
+
});
|
67
|
+
}
|
68
|
+
|
60
69
|
return columns.map(function (item) {
|
61
70
|
if (item.columnFilters === false) {
|
62
71
|
return item;
|
@@ -313,7 +322,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
313
322
|
return onChangeColumns(check, dataIndex);
|
314
323
|
},
|
315
324
|
disabled: columnFiltersDisabled
|
316
|
-
}, title, !lock && /*#__PURE__*/_react.default.createElement("div", {
|
325
|
+
}, title, !lock && !columnFiltersDisabled && /*#__PURE__*/_react.default.createElement("div", {
|
317
326
|
className: cls({
|
318
327
|
sort: true
|
319
328
|
})
|
@@ -46,15 +46,15 @@ var FullScreen = function FullScreen(props) {
|
|
46
46
|
|
47
47
|
var afterClose = function afterClose() {
|
48
48
|
// 判断全屏前后筛选表单值是否有改变
|
49
|
-
var n = JSON.stringify((0, _utils.getValidValues)(normalDataFilterForm.values));
|
50
|
-
var f = JSON.stringify((0, _utils.getValidValues)(fullscreenDataFilterForm.values));
|
49
|
+
var n = JSON.stringify((0, _utils.getValidValues)(normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.values));
|
50
|
+
var f = JSON.stringify((0, _utils.getValidValues)(fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.values));
|
51
51
|
|
52
52
|
if (n === f) {
|
53
53
|
// 关闭全屏后,表单值未变化,开启普通表单onFilter
|
54
54
|
filterEnableRef.current.normal = true;
|
55
55
|
} else {
|
56
56
|
// 关闭全屏后,表单值有变化,修改表单值
|
57
|
-
normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.setValues(fullscreenDataFilterForm.values);
|
57
|
+
normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.setValues(fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.values);
|
58
58
|
} // 关闭全屏后,关闭全屏表单onFilter
|
59
59
|
|
60
60
|
|
@@ -64,15 +64,15 @@ var FullScreen = function FullScreen(props) {
|
|
64
64
|
|
65
65
|
var afterOpen = function afterOpen() {
|
66
66
|
// 判断全屏前后筛选表单值是否有改变
|
67
|
-
var n = JSON.stringify((0, _utils.getValidValues)(normalDataFilterForm.values));
|
68
|
-
var f = JSON.stringify((0, _utils.getValidValues)(fullscreenDataFilterForm.values));
|
67
|
+
var n = JSON.stringify((0, _utils.getValidValues)(normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.values));
|
68
|
+
var f = JSON.stringify((0, _utils.getValidValues)(fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.values));
|
69
69
|
|
70
70
|
if (n === f) {
|
71
71
|
// 全屏后,表单值未变化,开启全屏表单onFilter
|
72
72
|
filterEnableRef.current.fullscreen = true;
|
73
73
|
} else {
|
74
74
|
// 全屏后,表单值变化,修改表单值
|
75
|
-
fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.setValues(normalDataFilterForm.values);
|
75
|
+
fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.setValues(normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.values);
|
76
76
|
} // 全屏后,关闭普通表单onFilter
|
77
77
|
|
78
78
|
|
@@ -29,7 +29,7 @@
|
|
29
29
|
}
|
30
30
|
&-reset {
|
31
31
|
position: absolute;
|
32
|
-
right:
|
32
|
+
right: 0px;
|
33
33
|
top: 6px;
|
34
34
|
}
|
35
35
|
// .next-menu {
|
@@ -59,7 +59,7 @@
|
|
59
59
|
.teamix-pro-table-toolbar-filter-column-sort {
|
60
60
|
visibility: hidden;
|
61
61
|
position: absolute;
|
62
|
-
right:
|
62
|
+
right: 0px;
|
63
63
|
top: 0;
|
64
64
|
color: var(--color-text1-7);
|
65
65
|
i {
|
package/lib/table/index.js
CHANGED
@@ -55,7 +55,7 @@ Object.keys(_typing).forEach(function (key) {
|
|
55
55
|
}
|
56
56
|
});
|
57
57
|
});
|
58
|
-
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams"];
|
58
|
+
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords", "size", "disableSelectAll"];
|
59
59
|
|
60
60
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
61
61
|
|
@@ -220,6 +220,11 @@ var ProTable = function ProTable(props) {
|
|
220
220
|
_props$filterColumnTy = props.filterColumnType,
|
221
221
|
filterColumnType = _props$filterColumnTy === void 0 ? 'auto' : _props$filterColumnTy,
|
222
222
|
defaultFilterParams = props.defaultFilterParams,
|
223
|
+
_props$reserveSelecte = props.reserveSelectedRecords,
|
224
|
+
reserveSelectedRecords = _props$reserveSelecte === void 0 ? false : _props$reserveSelecte,
|
225
|
+
_props$size = props.size,
|
226
|
+
propsSize = _props$size === void 0 ? 'medium' : _props$size,
|
227
|
+
disableSelectAll = props.disableSelectAll,
|
223
228
|
otherProps = _objectWithoutProperties(props, _excluded);
|
224
229
|
|
225
230
|
var targetPageKey = pageKey || globalPageKey;
|
@@ -273,7 +278,7 @@ var ProTable = function ProTable(props) {
|
|
273
278
|
filteredColumns = _useState16[0],
|
274
279
|
setFilteredColumns = _useState16[1];
|
275
280
|
|
276
|
-
var _useState17 = (0, _react.useState)(
|
281
|
+
var _useState17 = (0, _react.useState)(propsSize),
|
277
282
|
_useState18 = _slicedToArray(_useState17, 2),
|
278
283
|
size = _useState18[0],
|
279
284
|
_setSize = _useState18[1];
|
@@ -344,8 +349,8 @@ var ProTable = function ProTable(props) {
|
|
344
349
|
var normalDataFilterForm = normalDataFilterFormRef.current;
|
345
350
|
var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current; // 传给 QueryFilter 的 formRef
|
346
351
|
|
347
|
-
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
|
348
|
-
|
352
|
+
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef; // let dataFilterForm = dataFilterFormRef.current;
|
353
|
+
// 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
|
349
354
|
|
350
355
|
var _useState29 = (0, _react.useState)(false),
|
351
356
|
_useState30 = _slicedToArray(_useState29, 2),
|
@@ -383,7 +388,7 @@ var ProTable = function ProTable(props) {
|
|
383
388
|
result = propsRowSelection.getProps(record, index);
|
384
389
|
}
|
385
390
|
|
386
|
-
if (showSkeleton) {
|
391
|
+
if (showSkeleton && result) {
|
387
392
|
result.disabled = true;
|
388
393
|
}
|
389
394
|
|
@@ -396,7 +401,7 @@ var ProTable = function ProTable(props) {
|
|
396
401
|
result = propsRowSelection.titleProps();
|
397
402
|
}
|
398
403
|
|
399
|
-
if (showSkeleton) {
|
404
|
+
if (showSkeleton || disableSelectAll) {
|
400
405
|
result.disabled = true;
|
401
406
|
}
|
402
407
|
|
@@ -431,7 +436,7 @@ var ProTable = function ProTable(props) {
|
|
431
436
|
return selectedRowKeys.includes(k);
|
432
437
|
});
|
433
438
|
return {
|
434
|
-
disabled: showLoading && !showSkeleton && (getData.loading || props.loading),
|
439
|
+
disabled: disableSelectAll || showLoading && !showSkeleton && (getData.loading || props.loading),
|
435
440
|
onChange: function onChange(check) {
|
436
441
|
if (check) {
|
437
442
|
var result = selectedRowKeys.concat([]);
|
@@ -535,6 +540,7 @@ var ProTable = function ProTable(props) {
|
|
535
540
|
(0, _utils2.emit)('refreshFilterState', newColumns);
|
536
541
|
}
|
537
542
|
},
|
543
|
+
size: size,
|
538
544
|
setSize: function setSize(mode) {
|
539
545
|
_setSize(mode);
|
540
546
|
},
|
@@ -554,12 +560,12 @@ var ProTable = function ProTable(props) {
|
|
554
560
|
_request(params);
|
555
561
|
},
|
556
562
|
reset: function reset() {
|
557
|
-
var _actionRef$current4, _actionRef$current4$s;
|
563
|
+
var _actionRef$current4, _actionRef$current4$s, _dataFilterFormRef$cu;
|
558
564
|
|
559
565
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset()); // 清空列过滤参数
|
560
566
|
|
561
567
|
(_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, {});
|
562
|
-
|
568
|
+
(_dataFilterFormRef$cu = dataFilterFormRef.current) === null || _dataFilterFormRef$cu === void 0 ? void 0 : _dataFilterFormRef$cu.reset();
|
563
569
|
setCurrentPage(1);
|
564
570
|
|
565
571
|
_request(_defineProperty({}, targetPageKey, 1));
|
@@ -581,7 +587,8 @@ var ProTable = function ProTable(props) {
|
|
581
587
|
pageSize: pageSize
|
582
588
|
},
|
583
589
|
data: data,
|
584
|
-
dataFilterForm:
|
590
|
+
dataFilterForm: dataFilterFormRef.current,
|
591
|
+
dataFilterFormRef: dataFilterFormRef,
|
585
592
|
normalDataFilterForm: normalDataFilterForm,
|
586
593
|
fullscreenDataFilterForm: fullscreenDataFilterForm,
|
587
594
|
filterEnableRef: filterEnableRef,
|
@@ -674,7 +681,7 @@ var ProTable = function ProTable(props) {
|
|
674
681
|
}); // 请求函数
|
675
682
|
|
676
683
|
function _request(params, noLoading, filterParams) {
|
677
|
-
var _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g, _objectSpread2;
|
684
|
+
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g, _objectSpread2;
|
678
685
|
|
679
686
|
// 如果没有传 url 且没有 customRequest,直接返回
|
680
687
|
if (!url && !customRequest) {
|
@@ -687,7 +694,7 @@ var ProTable = function ProTable(props) {
|
|
687
694
|
|
688
695
|
var sortParams = targetFormatSort(sort); // 筛选区请求参数
|
689
696
|
|
690
|
-
var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams :
|
697
|
+
var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : (_dataFilterFormRef$cu2 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu2 === void 0 ? void 0 : _dataFilterFormRef$cu2.values; // 列过滤请求参数
|
691
698
|
|
692
699
|
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$g = _actionRef$current5.getFilterRules) === null || _actionRef$current5$g === void 0 ? void 0 : _actionRef$current5$g.call(_actionRef$current5)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {}; // 格式化后的请求参数
|
693
700
|
|
@@ -781,7 +788,8 @@ var ProTable = function ProTable(props) {
|
|
781
788
|
|
782
789
|
|
783
790
|
var dataFilter = _objectSpread(_objectSpread({
|
784
|
-
mode: 'inline'
|
791
|
+
mode: 'inline',
|
792
|
+
forceClear: true
|
785
793
|
}, propsDataFilter), {}, {
|
786
794
|
onInit: function onInit(values) {
|
787
795
|
// 表单初始化请求处理
|
@@ -812,8 +820,10 @@ var ProTable = function ProTable(props) {
|
|
812
820
|
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
813
821
|
},
|
814
822
|
onReset: function onReset(values) {
|
823
|
+
var _dataFilterFormRef$cu3;
|
824
|
+
|
815
825
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
816
|
-
|
826
|
+
(_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
|
817
827
|
setCurrentPage(1);
|
818
828
|
|
819
829
|
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
@@ -900,21 +910,30 @@ var ProTable = function ProTable(props) {
|
|
900
910
|
|
901
911
|
var renderFooter = function renderFooter() {
|
902
912
|
function onChangePagination(currentPage) {
|
903
|
-
var _actionRef$current7, _actionRef$current7$c;
|
904
|
-
|
905
913
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
906
|
-
|
907
|
-
|
914
|
+
|
915
|
+
// 翻页默认清空选择
|
916
|
+
if (!reserveSelectedRecords) {
|
917
|
+
var _actionRef$current7, _actionRef$current7$c;
|
918
|
+
|
919
|
+
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
|
920
|
+
}
|
921
|
+
|
908
922
|
setCurrentPage(currentPage);
|
909
923
|
|
910
924
|
_request(_objectSpread(_defineProperty({}, targetPageKey, currentPage), params));
|
911
925
|
}
|
912
926
|
|
913
927
|
function onChangePaginationSize(currentPageSize) {
|
914
|
-
var
|
928
|
+
var _request5;
|
929
|
+
|
930
|
+
// 翻页默认清空选择
|
931
|
+
if (!reserveSelectedRecords) {
|
932
|
+
var _actionRef$current8, _actionRef$current8$c;
|
933
|
+
|
934
|
+
(_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
|
935
|
+
}
|
915
936
|
|
916
|
-
// 翻页暂时先清空选择
|
917
|
-
(_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
|
918
937
|
setPageSize(currentPageSize);
|
919
938
|
setCurrentPage(1);
|
920
939
|
|