File tree Expand file tree Collapse file tree 5 files changed +11
-1
lines changed
pages/databases/collections/properties Expand file tree Collapse file tree 5 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import type { AttuGridType } from './Types';
2424 * @param title Render breadcrumbs
2525 * @param openCheckBox control checkbox display. default is true
2626 * @param disableSelect disable table row select. default false
27+ * @param enableSelectAll control select all checkbox display. default true
2728 * @param noData when table is empty, what tip we need to show.
2829 * @param showHoverStyle control table row hover style display
2930 * @param headEditable if true, user can edit header.
@@ -65,6 +66,7 @@ const AttuGrid: FC<AttuGridType> = props => {
6566 title,
6667 openCheckBox = true ,
6768 disableSelect = false ,
69+ enableSelectAll = true ,
6870 noData = commonTrans ( 'grid.noData' ) ,
6971 showHoverStyle = true ,
7072 headEditable = false ,
@@ -229,6 +231,7 @@ const AttuGrid: FC<AttuGridType> = props => {
229231 rowHeight = { rowHeight }
230232 rowDecorator = { rowDecorator }
231233 addSpacerColumn = { addSpacerColumn }
234+ enableSelectAll = { enableSelectAll }
232235 > </ Table >
233236 { rowCount && showPagination ? (
234237 < TablePagination
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ const EnhancedTable: FC<TableType> = props => {
4949 // set true as default
5050 openCheckBox = true ,
5151 disableSelect,
52+ enableSelectAll = true ,
5253 noData,
5354 // whether change table row background color when mouse hover
5455 // set true as default
@@ -119,6 +120,7 @@ const EnhancedTable: FC<TableType> = props => {
119120 rowCount = { rows . length }
120121 openCheckBox = { openCheckBox }
121122 disableSelect = { disableSelect }
123+ enableSelectAll = { enableSelectAll }
122124 />
123125 ) : (
124126 < EditableTableHead editHeads = { editHeads } />
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ const EnhancedTableHead: FC<TableHeadType> = props => {
5454 handleSort,
5555 openCheckBox,
5656 disableSelect,
57+ enableSelectAll = true ,
5758 } = props ;
5859
5960 const createSortHandler = ( property : string ) => ( event : React . MouseEvent ) => {
@@ -76,7 +77,7 @@ const EnhancedTableHead: FC<TableHeadType> = props => {
7677 indeterminate = { numSelected > 0 && numSelected < rowCount }
7778 checked = { rowCount > 0 && numSelected === rowCount }
7879 onChange = { onSelectAllClick }
79- disabled = { disableSelect }
80+ disabled = { disableSelect || ! enableSelectAll }
8081 inputProps = { {
8182 'aria-label' : 'select all desserts' ,
8283 role : 'checkbox' ,
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ export type TableHeadType = {
6565 handleSort ?: ( e : any , p : string , col ?: ColDefinitionsType ) => void ;
6666 openCheckBox ?: boolean ;
6767 disableSelect ?: boolean ;
68+ enableSelectAll ?: boolean ;
6869} ;
6970
7071export type TableEditableHeadType = {
@@ -87,6 +88,7 @@ export type TableType = {
8788 primaryKey : string ;
8889 openCheckBox ?: boolean ;
8990 disableSelect ?: boolean ;
91+ enableSelectAll ?: boolean ;
9092 rowDecorator ?: ( row : any ) => SxProps < Theme > | React . CSSProperties ;
9193 noData ?: string ;
9294 showHoverStyle ?: boolean ;
@@ -146,6 +148,7 @@ export type AttuGridType = ToolBarType & {
146148 title ?: string [ ] ;
147149 openCheckBox ?: boolean ;
148150 disableSelect ?: boolean ;
151+ enableSelectAll ?: boolean ;
149152 noData ?: string ;
150153 showHoverStyle ?: boolean ;
151154 headEditable ?: boolean ;
Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ const Properties = (props: PropertiesProps) => {
203203 order = { order }
204204 orderBy = { orderBy }
205205 handleSort = { handleGridSort }
206+ enableSelectAll = { false }
206207 labelDisplayedRows = { getLabelDisplayedRows (
207208 commonTrans ( data . length > 1 ? 'grid.properties' : 'grid.property' )
208209 ) }
You can’t perform that action at this time.
0 commit comments