@douyinfe/semi-ui 2.51.2 → 2.51.4
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/umd/semi-ui.js +175 -118
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/cascader/index.d.ts +3 -2
- package/lib/cjs/cascader/index.js +28 -19
- package/lib/cjs/datePicker/datePicker.js +1 -1
- package/lib/cjs/datePicker/yearAndMonth.js +20 -16
- package/lib/cjs/form/hoc/withField.d.ts +3 -3
- package/lib/cjs/modal/Modal.js +2 -2
- package/lib/cjs/select/option.js +2 -1
- package/lib/cjs/table/Body/BaseRow.d.ts +44 -0
- package/lib/cjs/table/Body/BaseRow.js +47 -42
- package/lib/cjs/table/Body/SectionRow.d.ts +24 -0
- package/lib/cjs/table/Body/SectionRow.js +27 -22
- package/lib/cjs/table/Body/index.js +6 -4
- package/lib/cjs/table/ResizableTable.js +1 -1
- package/lib/es/cascader/index.d.ts +3 -2
- package/lib/es/cascader/index.js +28 -19
- package/lib/es/datePicker/datePicker.js +1 -1
- package/lib/es/datePicker/yearAndMonth.js +20 -16
- package/lib/es/form/hoc/withField.d.ts +3 -3
- package/lib/es/modal/Modal.js +2 -2
- package/lib/es/select/option.js +2 -1
- package/lib/es/table/Body/BaseRow.d.ts +44 -0
- package/lib/es/table/Body/BaseRow.js +45 -41
- package/lib/es/table/Body/SectionRow.d.ts +24 -0
- package/lib/es/table/Body/SectionRow.js +25 -21
- package/lib/es/table/Body/index.js +4 -4
- package/lib/es/table/ResizableTable.js +1 -1
- package/package.json +8 -8
|
@@ -463,7 +463,7 @@ export default class DatePicker extends BaseComponent {
|
|
|
463
463
|
return /range/i.test(type) && !_isFunction(triggerRender);
|
|
464
464
|
}
|
|
465
465
|
componentDidUpdate(prevProps) {
|
|
466
|
-
if (prevProps.value
|
|
466
|
+
if (!_isEqual(prevProps.value, this.props.value)) {
|
|
467
467
|
this.foundation.initFromProps(Object.assign({}, this.props));
|
|
468
468
|
} else if (this.props.timeZone !== prevProps.timeZone) {
|
|
469
469
|
this.foundation.initFromProps({
|
|
@@ -41,16 +41,6 @@ class YearAndMonth extends BaseComponent {
|
|
|
41
41
|
currentYear,
|
|
42
42
|
currentMonth
|
|
43
43
|
} = props;
|
|
44
|
-
const currentLeftYear = currentYear.left || now.getFullYear();
|
|
45
|
-
const currentLeftMonth = currentMonth.left || now.getMonth() + 1;
|
|
46
|
-
currentYear = {
|
|
47
|
-
left: currentLeftYear,
|
|
48
|
-
right: currentLeftYear
|
|
49
|
-
};
|
|
50
|
-
currentMonth = {
|
|
51
|
-
left: currentLeftMonth,
|
|
52
|
-
right: currentMonth.right || currentLeftMonth + 1
|
|
53
|
-
};
|
|
54
44
|
this.state = {
|
|
55
45
|
years: getYears(props.startYear, props.endYear).map(year => ({
|
|
56
46
|
value: year,
|
|
@@ -60,8 +50,14 @@ class YearAndMonth extends BaseComponent {
|
|
|
60
50
|
value: idx + 1,
|
|
61
51
|
month: idx + 1
|
|
62
52
|
})),
|
|
63
|
-
currentYear
|
|
64
|
-
|
|
53
|
+
currentYear: {
|
|
54
|
+
left: currentYear.left || now.getFullYear(),
|
|
55
|
+
right: currentYear.right || now.getFullYear()
|
|
56
|
+
},
|
|
57
|
+
currentMonth: {
|
|
58
|
+
left: currentMonth.left || now.getMonth() + 1,
|
|
59
|
+
right: currentMonth.right || now.getMonth() + 2
|
|
60
|
+
}
|
|
65
61
|
};
|
|
66
62
|
this.yearRef = /*#__PURE__*/React.createRef();
|
|
67
63
|
this.monthRef = /*#__PURE__*/React.createRef();
|
|
@@ -98,11 +94,19 @@ class YearAndMonth extends BaseComponent {
|
|
|
98
94
|
}
|
|
99
95
|
static getDerivedStateFromProps(props, state) {
|
|
100
96
|
const willUpdateStates = {};
|
|
101
|
-
if (!_isEqual(props.currentYear, state.currentYear)
|
|
102
|
-
|
|
97
|
+
if (!_isEqual(props.currentYear, state.currentYear)) {
|
|
98
|
+
const nowYear = new Date().getFullYear();
|
|
99
|
+
willUpdateStates.currentYear = {
|
|
100
|
+
left: props.currentYear.left || nowYear,
|
|
101
|
+
right: props.currentYear.right || nowYear
|
|
102
|
+
};
|
|
103
103
|
}
|
|
104
|
-
if (!_isEqual(props.currentMonth, state.currentMonth)
|
|
105
|
-
|
|
104
|
+
if (!_isEqual(props.currentMonth, state.currentMonth)) {
|
|
105
|
+
const nowMonth = new Date().getMonth();
|
|
106
|
+
willUpdateStates.currentMonth = {
|
|
107
|
+
left: props.currentMonth.left || nowMonth + 1,
|
|
108
|
+
right: props.currentMonth.right || nowMonth + 2
|
|
109
|
+
};
|
|
106
110
|
}
|
|
107
111
|
return willUpdateStates;
|
|
108
112
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WithFieldOption } from '@douyinfe/semi-foundation/lib/es/form/interface';
|
|
3
|
-
import { CommonFieldProps, CommonexcludeType } from '../interface';
|
|
4
|
-
import { Subtract } from 'utility-types';
|
|
2
|
+
import type { WithFieldOption } from '@douyinfe/semi-foundation/lib/es/form/interface';
|
|
3
|
+
import type { CommonFieldProps, CommonexcludeType } from '../interface';
|
|
4
|
+
import type { Subtract } from 'utility-types';
|
|
5
5
|
/**
|
|
6
6
|
* withFiled is used to inject components
|
|
7
7
|
* 1. Takes over the value and onChange of the component and synchronizes them to Form Foundation
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -26,6 +26,7 @@ export const destroyFns = [];
|
|
|
26
26
|
class Modal extends BaseComponent {
|
|
27
27
|
constructor(props) {
|
|
28
28
|
super(props);
|
|
29
|
+
this.bodyOverflow = null;
|
|
29
30
|
this.handleCancel = e => {
|
|
30
31
|
this.foundation.handleCancel(e);
|
|
31
32
|
};
|
|
@@ -165,7 +166,6 @@ class Modal extends BaseComponent {
|
|
|
165
166
|
};
|
|
166
167
|
this.foundation = new ModalFoundation(this.adapter);
|
|
167
168
|
this.modalRef = /*#__PURE__*/React.createRef();
|
|
168
|
-
this.bodyOverflow = '';
|
|
169
169
|
this.scrollBarWidth = 0;
|
|
170
170
|
this.originBodyWidth = '100%';
|
|
171
171
|
}
|
|
@@ -186,7 +186,7 @@ class Modal extends BaseComponent {
|
|
|
186
186
|
const {
|
|
187
187
|
getPopupContainer
|
|
188
188
|
} = this.props;
|
|
189
|
-
if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
|
|
189
|
+
if (!getPopupContainer && this.bodyOverflow !== null && this.bodyOverflow !== 'hidden') {
|
|
190
190
|
document.body.style.overflow = this.bodyOverflow;
|
|
191
191
|
document.body.style.width = this.originBodyWidth;
|
|
192
192
|
}
|
package/lib/es/select/option.js
CHANGED
|
@@ -46,6 +46,50 @@ export interface BaseRowProps {
|
|
|
46
46
|
/** whether display none */
|
|
47
47
|
displayNone?: boolean;
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* avoid affected by https://www.npmjs.com/package/babel-plugin-transform-react-remove-prop-types
|
|
51
|
+
*/
|
|
52
|
+
export declare const baseRowPropTypes: {
|
|
53
|
+
anyColumnFixed: PropTypes.Requireable<boolean>;
|
|
54
|
+
cellWidths: PropTypes.Validator<any[]>;
|
|
55
|
+
className: PropTypes.Requireable<string>;
|
|
56
|
+
columns: PropTypes.Validator<any[]>;
|
|
57
|
+
components: PropTypes.Validator<object>;
|
|
58
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
59
|
+
expandIcon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
60
|
+
expandableRow: PropTypes.Requireable<boolean>;
|
|
61
|
+
expanded: PropTypes.Requireable<boolean>;
|
|
62
|
+
displayNone: PropTypes.Requireable<boolean>;
|
|
63
|
+
expandedRow: PropTypes.Requireable<boolean>;
|
|
64
|
+
fixed: PropTypes.Requireable<NonNullable<string | boolean>>;
|
|
65
|
+
height: PropTypes.Requireable<NonNullable<string | number>>;
|
|
66
|
+
hideExpandedColumn: PropTypes.Requireable<boolean>;
|
|
67
|
+
hovered: PropTypes.Validator<boolean>;
|
|
68
|
+
indent: PropTypes.Requireable<number>;
|
|
69
|
+
indentSize: PropTypes.Requireable<number>;
|
|
70
|
+
index: PropTypes.Requireable<number>;
|
|
71
|
+
isSection: PropTypes.Requireable<boolean>;
|
|
72
|
+
level: PropTypes.Requireable<number>;
|
|
73
|
+
onDidUpdate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
|
+
onHover: PropTypes.Requireable<(...args: any[]) => any>;
|
|
75
|
+
onRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
76
|
+
onRowClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
77
|
+
onRowContextMenu: PropTypes.Requireable<(...args: any[]) => any>;
|
|
78
|
+
onRowDoubleClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
79
|
+
onRowMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
80
|
+
onRowMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
81
|
+
prefixCls: PropTypes.Requireable<string>;
|
|
82
|
+
record: PropTypes.Requireable<object>;
|
|
83
|
+
renderExpandIcon: PropTypes.Requireable<(...args: any[]) => any>;
|
|
84
|
+
replaceClassName: PropTypes.Requireable<string>;
|
|
85
|
+
rowExpandable: PropTypes.Requireable<(...args: any[]) => any>;
|
|
86
|
+
rowKey: PropTypes.Validator<NonNullable<NonNullable<string | number>>>;
|
|
87
|
+
selected: PropTypes.Requireable<boolean>;
|
|
88
|
+
store: PropTypes.Requireable<object>;
|
|
89
|
+
style: PropTypes.Requireable<object>;
|
|
90
|
+
virtualized: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
91
|
+
visible: PropTypes.Validator<boolean>;
|
|
92
|
+
};
|
|
49
93
|
export default class TableRow extends BaseComponent<BaseRowProps, Record<string, any>> {
|
|
50
94
|
static propTypes: {
|
|
51
95
|
anyColumnFixed: PropTypes.Requireable<boolean>;
|
|
@@ -22,6 +22,50 @@ import TableRowFoundation from '@douyinfe/semi-foundation/lib/es/table/tableRowF
|
|
|
22
22
|
import { isLastLeftFixed, arrayAdd, isFixedLeft, isFixedRight, isScrollbarColumn, isFirstFixedRight, isInnerColumnKey, isExpandedColumn } from '@douyinfe/semi-foundation/lib/es/table/utils';
|
|
23
23
|
import BaseComponent from '../../_base/baseComponent';
|
|
24
24
|
import TableCell from '../TableCell';
|
|
25
|
+
/**
|
|
26
|
+
* avoid affected by https://www.npmjs.com/package/babel-plugin-transform-react-remove-prop-types
|
|
27
|
+
*/
|
|
28
|
+
export const baseRowPropTypes = {
|
|
29
|
+
anyColumnFixed: PropTypes.bool,
|
|
30
|
+
cellWidths: PropTypes.array.isRequired,
|
|
31
|
+
className: PropTypes.string,
|
|
32
|
+
columns: PropTypes.array.isRequired,
|
|
33
|
+
components: PropTypes.object.isRequired,
|
|
34
|
+
disabled: PropTypes.bool,
|
|
35
|
+
expandIcon: PropTypes.oneOfType([PropTypes.bool, PropTypes.func, PropTypes.node]),
|
|
36
|
+
expandableRow: PropTypes.bool,
|
|
37
|
+
expanded: PropTypes.bool,
|
|
38
|
+
displayNone: PropTypes.bool,
|
|
39
|
+
expandedRow: PropTypes.bool,
|
|
40
|
+
fixed: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
41
|
+
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
42
|
+
hideExpandedColumn: PropTypes.bool,
|
|
43
|
+
hovered: PropTypes.bool.isRequired,
|
|
44
|
+
indent: PropTypes.number,
|
|
45
|
+
indentSize: PropTypes.number,
|
|
46
|
+
index: PropTypes.number,
|
|
47
|
+
isSection: PropTypes.bool,
|
|
48
|
+
level: PropTypes.number,
|
|
49
|
+
onDidUpdate: PropTypes.func,
|
|
50
|
+
onHover: PropTypes.func,
|
|
51
|
+
onRow: PropTypes.func,
|
|
52
|
+
onRowClick: PropTypes.func,
|
|
53
|
+
onRowContextMenu: PropTypes.func,
|
|
54
|
+
onRowDoubleClick: PropTypes.func,
|
|
55
|
+
onRowMouseEnter: PropTypes.func,
|
|
56
|
+
onRowMouseLeave: PropTypes.func,
|
|
57
|
+
prefixCls: PropTypes.string,
|
|
58
|
+
record: PropTypes.object,
|
|
59
|
+
renderExpandIcon: PropTypes.func,
|
|
60
|
+
replaceClassName: PropTypes.string,
|
|
61
|
+
rowExpandable: PropTypes.func,
|
|
62
|
+
rowKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
63
|
+
selected: PropTypes.bool,
|
|
64
|
+
store: PropTypes.object,
|
|
65
|
+
style: PropTypes.object,
|
|
66
|
+
virtualized: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
|
|
67
|
+
visible: PropTypes.bool.isRequired
|
|
68
|
+
};
|
|
25
69
|
export default class TableRow extends BaseComponent {
|
|
26
70
|
get adapter() {
|
|
27
71
|
var _this = this;
|
|
@@ -262,47 +306,7 @@ export default class TableRow extends BaseComponent {
|
|
|
262
306
|
}), this.renderCells());
|
|
263
307
|
}
|
|
264
308
|
}
|
|
265
|
-
TableRow.propTypes =
|
|
266
|
-
anyColumnFixed: PropTypes.bool,
|
|
267
|
-
cellWidths: PropTypes.array.isRequired,
|
|
268
|
-
className: PropTypes.string,
|
|
269
|
-
columns: PropTypes.array.isRequired,
|
|
270
|
-
components: PropTypes.object.isRequired,
|
|
271
|
-
disabled: PropTypes.bool,
|
|
272
|
-
expandIcon: PropTypes.oneOfType([PropTypes.bool, PropTypes.func, PropTypes.node]),
|
|
273
|
-
expandableRow: PropTypes.bool,
|
|
274
|
-
expanded: PropTypes.bool,
|
|
275
|
-
displayNone: PropTypes.bool,
|
|
276
|
-
expandedRow: PropTypes.bool,
|
|
277
|
-
fixed: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
278
|
-
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
279
|
-
hideExpandedColumn: PropTypes.bool,
|
|
280
|
-
hovered: PropTypes.bool.isRequired,
|
|
281
|
-
indent: PropTypes.number,
|
|
282
|
-
indentSize: PropTypes.number,
|
|
283
|
-
index: PropTypes.number,
|
|
284
|
-
isSection: PropTypes.bool,
|
|
285
|
-
level: PropTypes.number,
|
|
286
|
-
onDidUpdate: PropTypes.func,
|
|
287
|
-
onHover: PropTypes.func,
|
|
288
|
-
onRow: PropTypes.func,
|
|
289
|
-
onRowClick: PropTypes.func,
|
|
290
|
-
onRowContextMenu: PropTypes.func,
|
|
291
|
-
onRowDoubleClick: PropTypes.func,
|
|
292
|
-
onRowMouseEnter: PropTypes.func,
|
|
293
|
-
onRowMouseLeave: PropTypes.func,
|
|
294
|
-
prefixCls: PropTypes.string,
|
|
295
|
-
record: PropTypes.object,
|
|
296
|
-
renderExpandIcon: PropTypes.func,
|
|
297
|
-
replaceClassName: PropTypes.string,
|
|
298
|
-
rowExpandable: PropTypes.func,
|
|
299
|
-
rowKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
300
|
-
selected: PropTypes.bool,
|
|
301
|
-
store: PropTypes.object,
|
|
302
|
-
style: PropTypes.object,
|
|
303
|
-
virtualized: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
|
|
304
|
-
visible: PropTypes.bool.isRequired
|
|
305
|
-
};
|
|
309
|
+
TableRow.propTypes = baseRowPropTypes;
|
|
306
310
|
TableRow.defaultProps = {
|
|
307
311
|
columns: [],
|
|
308
312
|
rowExpandable: _stubTrue,
|
|
@@ -24,6 +24,30 @@ export interface SectionRowProps {
|
|
|
24
24
|
store?: Store;
|
|
25
25
|
rowKey?: RowKey<any>;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* avoid affected by https://www.npmjs.com/package/babel-plugin-transform-react-remove-prop-types
|
|
29
|
+
*/
|
|
30
|
+
export declare const sectionRowPropTypes: {
|
|
31
|
+
record: PropTypes.Requireable<object>;
|
|
32
|
+
index: PropTypes.Requireable<number>;
|
|
33
|
+
columns: PropTypes.Requireable<any[]>;
|
|
34
|
+
group: PropTypes.Validator<object>;
|
|
35
|
+
groupKey: PropTypes.Validator<NonNullable<NonNullable<string | number>>>;
|
|
36
|
+
data: PropTypes.Requireable<any[]>;
|
|
37
|
+
renderGroupSection: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
|
+
onGroupedRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
|
+
clickGroupedRowToExpand: PropTypes.Requireable<boolean>;
|
|
40
|
+
components: PropTypes.Requireable<object>;
|
|
41
|
+
expanded: PropTypes.Requireable<boolean>;
|
|
42
|
+
prefixCls: PropTypes.Requireable<string>;
|
|
43
|
+
onExpand: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
|
+
virtualized: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
45
|
+
style: PropTypes.Requireable<object>;
|
|
46
|
+
renderExpandIcon: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
+
className: PropTypes.Requireable<string>;
|
|
48
|
+
store: PropTypes.Requireable<object>;
|
|
49
|
+
rowKey: PropTypes.Requireable<NonNullable<string | number | ((...args: any[]) => any)>>;
|
|
50
|
+
};
|
|
27
51
|
/**
|
|
28
52
|
* Grouping component title row
|
|
29
53
|
*/
|
|
@@ -15,6 +15,30 @@ import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/table/cons
|
|
|
15
15
|
import { filterColumns } from '@douyinfe/semi-foundation/lib/es/table/utils';
|
|
16
16
|
import BaseRow from './BaseRow';
|
|
17
17
|
import TableContext from '../table-context';
|
|
18
|
+
/**
|
|
19
|
+
* avoid affected by https://www.npmjs.com/package/babel-plugin-transform-react-remove-prop-types
|
|
20
|
+
*/
|
|
21
|
+
export const sectionRowPropTypes = {
|
|
22
|
+
record: PropTypes.object,
|
|
23
|
+
index: PropTypes.number,
|
|
24
|
+
columns: PropTypes.array,
|
|
25
|
+
group: PropTypes.object.isRequired,
|
|
26
|
+
groupKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
27
|
+
data: PropTypes.array,
|
|
28
|
+
renderGroupSection: PropTypes.func,
|
|
29
|
+
onGroupedRow: PropTypes.func,
|
|
30
|
+
clickGroupedRowToExpand: PropTypes.bool,
|
|
31
|
+
components: PropTypes.object,
|
|
32
|
+
expanded: PropTypes.bool,
|
|
33
|
+
prefixCls: PropTypes.string,
|
|
34
|
+
onExpand: PropTypes.func,
|
|
35
|
+
virtualized: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
|
36
|
+
style: PropTypes.object,
|
|
37
|
+
renderExpandIcon: PropTypes.func,
|
|
38
|
+
className: PropTypes.string,
|
|
39
|
+
store: PropTypes.object,
|
|
40
|
+
rowKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.func])
|
|
41
|
+
};
|
|
18
42
|
/**
|
|
19
43
|
* Grouping component title row
|
|
20
44
|
*/
|
|
@@ -145,27 +169,7 @@ class SectionRow extends PureComponent {
|
|
|
145
169
|
}
|
|
146
170
|
}
|
|
147
171
|
SectionRow.contextType = TableContext;
|
|
148
|
-
SectionRow.propTypes =
|
|
149
|
-
record: PropTypes.object,
|
|
150
|
-
index: PropTypes.number,
|
|
151
|
-
columns: PropTypes.array,
|
|
152
|
-
group: PropTypes.object.isRequired,
|
|
153
|
-
groupKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
154
|
-
data: PropTypes.array,
|
|
155
|
-
renderGroupSection: PropTypes.func,
|
|
156
|
-
onGroupedRow: PropTypes.func,
|
|
157
|
-
clickGroupedRowToExpand: PropTypes.bool,
|
|
158
|
-
components: PropTypes.object,
|
|
159
|
-
expanded: PropTypes.bool,
|
|
160
|
-
prefixCls: PropTypes.string,
|
|
161
|
-
onExpand: PropTypes.func,
|
|
162
|
-
virtualized: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
|
163
|
-
style: PropTypes.object,
|
|
164
|
-
renderExpandIcon: PropTypes.func,
|
|
165
|
-
className: PropTypes.string,
|
|
166
|
-
store: PropTypes.object,
|
|
167
|
-
rowKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.func])
|
|
168
|
-
};
|
|
172
|
+
SectionRow.propTypes = sectionRowPropTypes;
|
|
169
173
|
SectionRow.defaultProps = {
|
|
170
174
|
prefixCls: cssClasses.PREFIX,
|
|
171
175
|
components: {
|
|
@@ -24,9 +24,9 @@ import { strings } from '@douyinfe/semi-foundation/lib/es/table/constants';
|
|
|
24
24
|
import BaseComponent from '../../_base/baseComponent';
|
|
25
25
|
import { logger } from '../utils';
|
|
26
26
|
import ColGroup from '../ColGroup';
|
|
27
|
-
import BaseRow from './BaseRow';
|
|
27
|
+
import BaseRow, { baseRowPropTypes } from './BaseRow';
|
|
28
28
|
import ExpandedRow from './ExpandedRow';
|
|
29
|
-
import SectionRow from './SectionRow';
|
|
29
|
+
import SectionRow, { sectionRowPropTypes } from './SectionRow';
|
|
30
30
|
import TableHeader from '../TableHeader';
|
|
31
31
|
import TableContext from '../table-context';
|
|
32
32
|
class Body extends BaseComponent {
|
|
@@ -271,7 +271,7 @@ class Body extends BaseComponent {
|
|
|
271
271
|
groupKey,
|
|
272
272
|
index
|
|
273
273
|
} = props;
|
|
274
|
-
const sectionRowPickKeys = Object.keys(
|
|
274
|
+
const sectionRowPickKeys = Object.keys(sectionRowPropTypes);
|
|
275
275
|
const sectionRowProps = _pick(props, sectionRowPickKeys);
|
|
276
276
|
const {
|
|
277
277
|
handleRowExpanded
|
|
@@ -595,7 +595,7 @@ class Body extends BaseComponent {
|
|
|
595
595
|
disabledRowKeysSet,
|
|
596
596
|
expandRowByClick
|
|
597
597
|
} = props;
|
|
598
|
-
const baseRowPickKeys = Object.keys(
|
|
598
|
+
const baseRowPickKeys = Object.keys(baseRowPropTypes);
|
|
599
599
|
const baseRowProps = _pick(props, baseRowPickKeys);
|
|
600
600
|
let key = getRecordKey(record, rowKey);
|
|
601
601
|
if (key == null) {
|
|
@@ -57,7 +57,7 @@ const ResizableTable = function () {
|
|
|
57
57
|
width: numbers.DEFAULT_WIDTH_COLUMN_EXPAND
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
if (props.rowSelection && !_find(rawColumns, item => item.key === strings.DEFAULT_KEY_COLUMN_SELECTION)) {
|
|
60
|
+
if (props.rowSelection && !_get(props.rowSelection, 'hidden') && !_find(rawColumns, item => item.key === strings.DEFAULT_KEY_COLUMN_SELECTION)) {
|
|
61
61
|
newColumns.unshift({
|
|
62
62
|
width: _get(props, 'rowSelection.width', numbers.DEFAULT_WIDTH_COLUMN_SELECTION),
|
|
63
63
|
key: strings.DEFAULT_KEY_COLUMN_SELECTION
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.51.
|
|
3
|
+
"version": "2.51.4",
|
|
4
4
|
"description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"@dnd-kit/core": "^6.0.8",
|
|
21
21
|
"@dnd-kit/sortable": "^7.0.2",
|
|
22
22
|
"@dnd-kit/utilities": "^3.2.1",
|
|
23
|
-
"@douyinfe/semi-animation": "2.51.
|
|
24
|
-
"@douyinfe/semi-animation-react": "2.51.
|
|
25
|
-
"@douyinfe/semi-foundation": "2.51.
|
|
26
|
-
"@douyinfe/semi-icons": "2.51.
|
|
27
|
-
"@douyinfe/semi-illustrations": "2.51.
|
|
28
|
-
"@douyinfe/semi-theme-default": "2.51.
|
|
23
|
+
"@douyinfe/semi-animation": "2.51.4",
|
|
24
|
+
"@douyinfe/semi-animation-react": "2.51.4",
|
|
25
|
+
"@douyinfe/semi-foundation": "2.51.4",
|
|
26
|
+
"@douyinfe/semi-icons": "2.51.4",
|
|
27
|
+
"@douyinfe/semi-illustrations": "2.51.4",
|
|
28
|
+
"@douyinfe/semi-theme-default": "2.51.4",
|
|
29
29
|
"async-validator": "^3.5.0",
|
|
30
30
|
"classnames": "^2.2.6",
|
|
31
31
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
],
|
|
76
76
|
"author": "",
|
|
77
77
|
"license": "MIT",
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "b8cad87796be9b6b10409a95d3a5b4cb8b9592e6",
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
81
81
|
"@babel/plugin-transform-runtime": "^7.15.8",
|