|
|
@@ -21,7 +21,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight = true, |
|
|
hideFooterSelectedRowCount, rowModesModel, editMode, |
|
|
hideFooterSelectedRowCount, rowModesModel, editMode, |
|
|
pageSizeOptions, filterItems, customPageSize, doLoad, applyGridOnReady, applySearch, |
|
|
pageSizeOptions, filterItems, customPageSize, doLoad, applyGridOnReady, applySearch, |
|
|
tab, height, maxHeight, pagination = true, serverSorting = false, |
|
|
tab, height, maxHeight, pagination = true, serverSorting = false, |
|
|
disablePagingOnGazetteIssue = true, ...props }) { |
|
|
|
|
|
|
|
|
disablePagingOnGazetteIssue = true, hideRowsPerPage = false, ...props }) { |
|
|
const intl = useIntl(); |
|
|
const intl = useIntl(); |
|
|
const [_rows, set_rows] = useState([]); |
|
|
const [_rows, set_rows] = useState([]); |
|
|
const [_doLoad, set_doLoad] = useState({}); |
|
|
const [_doLoad, set_doLoad] = useState({}); |
|
|
@@ -359,7 +359,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight = true, |
|
|
count={total} |
|
|
count={total} |
|
|
page={pagerPage} |
|
|
page={pagerPage} |
|
|
rowsPerPage={pagerPageSize} |
|
|
rowsPerPage={pagerPageSize} |
|
|
rowsPerPageOptions={loadAllOnGazetteIssue ? [] : _pageSizeOptions} |
|
|
|
|
|
|
|
|
rowsPerPageOptions={(loadAllOnGazetteIssue || hideRowsPerPage) ? [] : _pageSizeOptions} |
|
|
labelDisplayedRows={() => { |
|
|
labelDisplayedRows={() => { |
|
|
if (!_rows?.length || total === 0) { |
|
|
if (!_rows?.length || total === 0) { |
|
|
return `0-0 ${intl.formatMessage({ id: "of" })} ${total}`; |
|
|
return `0-0 ${intl.formatMessage({ id: "of" })} ${total}`; |
|
|
@@ -370,7 +370,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight = true, |
|
|
: Math.min(page * pageSize + _rows.length, total); |
|
|
: Math.min(page * pageSize + _rows.length, total); |
|
|
return `${from}-${to} ${intl.formatMessage({ id: "of" })} ${total}`; |
|
|
return `${from}-${to} ${intl.formatMessage({ id: "of" })} ${total}`; |
|
|
}} |
|
|
}} |
|
|
labelRowsPerPage={intl.formatMessage({ id: "rowsPerPage" }) + ":"} |
|
|
|
|
|
|
|
|
labelRowsPerPage={hideRowsPerPage ? () => "" : intl.formatMessage({ id: "rowsPerPage" }) + ":"} |
|
|
getItemAriaLabel={(type) => { |
|
|
getItemAriaLabel={(type) => { |
|
|
if (type === 'previous') { |
|
|
if (type === 'previous') { |
|
|
return intl.formatMessage({ id: 'paginationPrev' }); |
|
|
return intl.formatMessage({ id: 'paginationPrev' }); |
|
|
@@ -381,7 +381,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight = true, |
|
|
return ''; |
|
|
return ''; |
|
|
}} |
|
|
}} |
|
|
onPageChange={loadAllOnGazetteIssue ? () => {} : handleChangePage} |
|
|
onPageChange={loadAllOnGazetteIssue ? () => {} : handleChangePage} |
|
|
onRowsPerPageChange={loadAllOnGazetteIssue ? () => {} : handleChangePageSize} |
|
|
|
|
|
|
|
|
onRowsPerPageChange={(loadAllOnGazetteIssue || hideRowsPerPage) ? () => {} : handleChangePageSize} |
|
|
/> |
|
|
/> |
|
|
); |
|
|
); |
|
|
}, |
|
|
}, |
|
|
|