tp-react-elements 3.0.27 → 3.0.28
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/_virtual/index.esm11.js +2 -2
- package/dist/_virtual/index.esm12.js +2 -2
- package/dist/_virtual/index.esm14.js +2 -2
- package/dist/_virtual/index.esm4.js +2 -2
- package/dist/_virtual/index.esm5.js +2 -2
- package/dist/_virtual/index.esm6.js +2 -2
- package/dist/_virtual/index.esm7.js +2 -2
- package/dist/components/PaginatedGrid/GenericPaginatedGrid.esm.js +13 -3
- package/dist/components/PaginatedGrid/types.d.ts +18 -0
- package/dist/node_modules/react-date-range/dist/components/Calendar/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateInput/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateRange/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateRangePicker/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DayCell/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DefinedRange/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/InputRangeField/index.esm.js +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DayCell = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DayCell as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateInput = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateInput as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var InputRangeField = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { InputRangeField as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Calendar = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { Calendar as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateRange = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateRange as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateRangePicker = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateRangePicker as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DefinedRange = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DefinedRange as __exports };
|
|
@@ -548,14 +548,24 @@ function GenericPaginatedGrid({ columns, fetchPage, queryKey, serverFilterDefs,
|
|
|
548
548
|
const allowGrow = layoutMode === 'grid' || layoutMode === 'semantic';
|
|
549
549
|
return columns.map((col) => {
|
|
550
550
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
551
|
-
const { filterType, options, getSearchText, exportExcel, showTotal, ...mrtCol } = col;
|
|
551
|
+
const { filterType, options, getSearchText, exportExcel, showTotal, formatTotal, ...mrtCol } = col;
|
|
552
552
|
if (allowGrow && mrtCol.grow === undefined) {
|
|
553
553
|
mrtCol.grow = true;
|
|
554
554
|
}
|
|
555
|
-
|
|
555
|
+
// A column that already defines its own `Footer` keeps full control —
|
|
556
|
+
// never overwritten, even when `showTotal`/`displayTotals` are set.
|
|
557
|
+
if (displayTotals && !mrtCol.Footer) {
|
|
556
558
|
const colId = mrtCol.id ?? mrtCol.accessorKey;
|
|
557
559
|
if (showTotal) {
|
|
558
|
-
mrtCol.Footer = () =>
|
|
560
|
+
mrtCol.Footer = () => {
|
|
561
|
+
const sum = totalsRef.current[colId] ?? 0;
|
|
562
|
+
return jsx("span", { children: formatTotal ? formatTotal(sum) : sum.toLocaleString() });
|
|
563
|
+
};
|
|
564
|
+
// Right-align by default (totals are numeric) — the column can
|
|
565
|
+
// still override via its own `muiTableFooterCellProps`.
|
|
566
|
+
if (!mrtCol.muiTableFooterCellProps) {
|
|
567
|
+
mrtCol.muiTableFooterCellProps = { align: 'right' };
|
|
568
|
+
}
|
|
559
569
|
}
|
|
560
570
|
else if (colId === leadingColumnId) {
|
|
561
571
|
mrtCol.Footer = () => jsx("span", { style: { fontWeight: 700 }, children: "Total" });
|
|
@@ -129,6 +129,24 @@ export type TPColumnDef<TData extends object = object, TValue = any> = MRT_Colum
|
|
|
129
129
|
* 0), not coerced. Default: `false`.
|
|
130
130
|
*/
|
|
131
131
|
showTotal?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Format this column's computed sum for display in the totals row (see
|
|
134
|
+
* `showTotal`). Receives the raw numeric sum; return whatever `ReactNode`
|
|
135
|
+
* should appear in the footer cell (add a currency symbol, fixed decimals,
|
|
136
|
+
* a suffix, etc.).
|
|
137
|
+
*
|
|
138
|
+
* ```ts
|
|
139
|
+
* {
|
|
140
|
+
* accessorKey: 'amount',
|
|
141
|
+
* showTotal: true,
|
|
142
|
+
* formatTotal: (sum) =>
|
|
143
|
+
* new Intl.NumberFormat('en-IN', { style: 'currency', currency: 'INR' }).format(sum),
|
|
144
|
+
* }
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
* Default: `sum.toLocaleString()`.
|
|
148
|
+
*/
|
|
149
|
+
formatTotal?: (sum: number) => React.ReactNode;
|
|
132
150
|
};
|
|
133
151
|
export interface InvoiceDetail {
|
|
134
152
|
Data_from: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as Calendar } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as Calendar } from '../../../../../_virtual/index.esm4.js';
|
|
2
2
|
import require$$0__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireDayCell } from '../DayCell/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DateInput } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DateInput } from '../../../../../_virtual/index.esm12.js';
|
|
2
2
|
import require$$0__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireClassnames } from '../../../../classnames/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DateRange } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DateRange } from '../../../../../_virtual/index.esm5.js';
|
|
2
2
|
import require$$0__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireCalendar } from '../Calendar/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DateRangePicker } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DateRangePicker } from '../../../../../_virtual/index.esm6.js';
|
|
2
2
|
import require$$0__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireDateRange } from '../DateRange/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DayCell } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DayCell } from '../../../../../_virtual/index.esm11.js';
|
|
2
2
|
import require$$0__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireClassnames } from '../../../../classnames/index.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as DefinedRange } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as DefinedRange } from '../../../../../_virtual/index.esm7.js';
|
|
2
2
|
import require$$0__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
import { __require as requireStyles } from '../../styles.esm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as InputRangeField } from '../../../../../_virtual/index.
|
|
1
|
+
import { __exports as InputRangeField } from '../../../../../_virtual/index.esm14.js';
|
|
2
2
|
import require$$0__default from 'react';
|
|
3
3
|
import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
|
|
4
4
|
|