@campxdev/shared 2.0.28 → 2.0.29
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/package.json
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '@mui/material'
|
|
9
9
|
import { SxProps } from '@mui/system'
|
|
10
10
|
import _ from 'lodash'
|
|
11
|
-
import { useEffect, useState } from 'react'
|
|
11
|
+
import { ReactNode, useEffect, useState } from 'react'
|
|
12
12
|
import Spinner from '../../Spinner'
|
|
13
13
|
import NoRecordsFound from '../common/NoRecordsFound'
|
|
14
14
|
import { SortAscIcon, SortDescIcon, SortIcon } from '../common/icons'
|
|
@@ -212,7 +212,11 @@ export default function Table({
|
|
|
212
212
|
return onRowClick && onRowClick(row)
|
|
213
213
|
}}
|
|
214
214
|
>
|
|
215
|
-
<>
|
|
215
|
+
<>
|
|
216
|
+
{' '}
|
|
217
|
+
{showTotal &&
|
|
218
|
+
(calculateTotal(row) as unknown as ReactNode)}
|
|
219
|
+
</>
|
|
216
220
|
{columns.map((col, colIndex) => (
|
|
217
221
|
<StyledTableCell
|
|
218
222
|
key={colIndex}
|
|
@@ -226,11 +230,17 @@ export default function Table({
|
|
|
226
230
|
{col?.dataType && col?.dataType == 'currency' ? (
|
|
227
231
|
<>{convertToAmount(row[col.dataIndex])}</>
|
|
228
232
|
) : (
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
233
|
+
((
|
|
234
|
+
<>
|
|
235
|
+
{col?.render
|
|
236
|
+
? col.render(
|
|
237
|
+
row[col.dataIndex],
|
|
238
|
+
row,
|
|
239
|
+
rowIndex,
|
|
240
|
+
)
|
|
241
|
+
: _.get(row, col.dataIndex)}
|
|
242
|
+
</>
|
|
243
|
+
) as ReactNode)
|
|
234
244
|
)}
|
|
235
245
|
</StyledTableCell>
|
|
236
246
|
))}
|
|
@@ -239,27 +249,30 @@ export default function Table({
|
|
|
239
249
|
|
|
240
250
|
{showTotal && (
|
|
241
251
|
<StyledTableRow canRowClick={false}>
|
|
242
|
-
{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
252
|
+
{
|
|
253
|
+
columns.map((col, colIndex) => {
|
|
254
|
+
return (
|
|
255
|
+
<>
|
|
256
|
+
<StyledTableCell
|
|
257
|
+
key={colIndex}
|
|
258
|
+
columnsLength={columns.length}
|
|
259
|
+
columnIndex={colIndex + 1}
|
|
260
|
+
rowIndex={dataSource.length + 1}
|
|
261
|
+
col={col}
|
|
262
|
+
isBodyCell
|
|
263
|
+
sx={sx}
|
|
264
|
+
>
|
|
265
|
+
{col?.dataType &&
|
|
266
|
+
col?.dataType == 'currency' ? (
|
|
267
|
+
<>{convertToAmount(totalCount[colIndex])}</>
|
|
268
|
+
) : (
|
|
269
|
+
<>{totalCount[colIndex]}</>
|
|
270
|
+
)}
|
|
271
|
+
</StyledTableCell>
|
|
272
|
+
</>
|
|
273
|
+
)
|
|
274
|
+
}) as ReactNode
|
|
275
|
+
}
|
|
263
276
|
</StyledTableRow>
|
|
264
277
|
)}
|
|
265
278
|
</TableBody>
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '@mui/material'
|
|
9
9
|
import { SxProps } from '@mui/system'
|
|
10
10
|
import _ from 'lodash'
|
|
11
|
-
import { useEffect, useState } from 'react'
|
|
11
|
+
import { ReactNode, useEffect, useState } from 'react'
|
|
12
12
|
import Spinner from '../../Spinner'
|
|
13
13
|
import NoRecordsFound from '../common/NoRecordsFound'
|
|
14
14
|
import { SortAscIcon, SortDescIcon, SortIcon } from '../common/icons'
|
|
@@ -207,7 +207,11 @@ export default function Table<T>({
|
|
|
207
207
|
{rowIndex + 1}
|
|
208
208
|
</StyledTableCell>
|
|
209
209
|
)}
|
|
210
|
-
<>
|
|
210
|
+
<>
|
|
211
|
+
{' '}
|
|
212
|
+
{showTotal &&
|
|
213
|
+
(calculateTotal(row) as unknown as ReactNode)}
|
|
214
|
+
</>
|
|
211
215
|
{columns.map((col, colIndex) => (
|
|
212
216
|
<StyledTableCell
|
|
213
217
|
key={colIndex}
|
|
@@ -225,11 +229,17 @@ export default function Table<T>({
|
|
|
225
229
|
)}
|
|
226
230
|
</>
|
|
227
231
|
) : (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
232
|
+
((
|
|
233
|
+
<>
|
|
234
|
+
{col?.render
|
|
235
|
+
? col.render(
|
|
236
|
+
row[col.dataIndex],
|
|
237
|
+
row,
|
|
238
|
+
rowIndex,
|
|
239
|
+
)
|
|
240
|
+
: _.get(row, col.dataIndex)}
|
|
241
|
+
</>
|
|
242
|
+
) as ReactNode)
|
|
233
243
|
)}
|
|
234
244
|
</StyledTableCell>
|
|
235
245
|
))}
|