Merge "feat: support component in the table header"
This commit is contained in:
commit
a2d170e285
@ -98,6 +98,7 @@ export class BaseTable extends React.Component {
|
|||||||
primaryActionsExtra: PropTypes.any,
|
primaryActionsExtra: PropTypes.any,
|
||||||
isAdminPage: PropTypes.bool,
|
isAdminPage: PropTypes.bool,
|
||||||
containerProps: PropTypes.any,
|
containerProps: PropTypes.any,
|
||||||
|
middleComponentInHeader: PropTypes.node,
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
@ -653,6 +654,14 @@ export class BaseTable extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderMiddleInHeader() {
|
||||||
|
const { middleComponentInHeader } = this.props;
|
||||||
|
if (middleComponentInHeader) {
|
||||||
|
return middleComponentInHeader;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
renderActions() {
|
renderActions() {
|
||||||
const {
|
const {
|
||||||
isAdminPage,
|
isAdminPage,
|
||||||
@ -791,6 +800,7 @@ export class BaseTable extends React.Component {
|
|||||||
{this.renderRefreshAuto()}
|
{this.renderRefreshAuto()}
|
||||||
</div>
|
</div>
|
||||||
{this.renderTimeFilter()}
|
{this.renderTimeFilter()}
|
||||||
|
{this.renderMiddleInHeader()}
|
||||||
{this.renderSearch()}
|
{this.renderSearch()}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -440,6 +440,10 @@ export default class BaseList extends React.Component {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get middleComponentInTableHeader() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
setRefreshDataTimerTransition = () => {
|
setRefreshDataTimerTransition = () => {
|
||||||
this.stopRefreshAuto();
|
this.stopRefreshAuto();
|
||||||
if (this.dataTimerTransition) {
|
if (this.dataTimerTransition) {
|
||||||
@ -557,6 +561,7 @@ export default class BaseList extends React.Component {
|
|||||||
primaryActionsExtra: this.primaryActionsExtra,
|
primaryActionsExtra: this.primaryActionsExtra,
|
||||||
isAdminPage: this.isAdminPage,
|
isAdminPage: this.isAdminPage,
|
||||||
initFilter: this.initFilter,
|
initFilter: this.initFilter,
|
||||||
|
middleComponentInHeader: this.middleComponentInTableHeader,
|
||||||
...this.getEnabledTableProps(),
|
...this.getEnabledTableProps(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user