@etsoo/react 1.4.23 → 1.4.24
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/lib/mu/DataGridEx.js +2 -2
- package/lib/mu/DataGridRenderers.js +11 -9
- package/package.json +1 -1
- package/src/mu/DataGridEx.tsx +2 -2
- package/src/mu/DataGridRenderers.tsx +10 -10
package/lib/mu/DataGridEx.js
CHANGED
|
@@ -86,7 +86,7 @@ export function DataGridEx(props) {
|
|
|
86
86
|
sortLabel = headerCellRenderer({
|
|
87
87
|
cellProps,
|
|
88
88
|
column,
|
|
89
|
-
columnIndex: index,
|
|
89
|
+
columnIndex: checkable ? index - 1 : index,
|
|
90
90
|
states
|
|
91
91
|
});
|
|
92
92
|
}
|
|
@@ -115,7 +115,7 @@ export function DataGridEx(props) {
|
|
|
115
115
|
const cell = footerItemRenderer
|
|
116
116
|
? footerItemRenderer(rows, {
|
|
117
117
|
column,
|
|
118
|
-
index,
|
|
118
|
+
index: checkable ? index - 1 : index,
|
|
119
119
|
states,
|
|
120
120
|
cellProps,
|
|
121
121
|
checkable
|
|
@@ -80,16 +80,18 @@ export var DataGridRenderers;
|
|
|
80
80
|
* @param location Renderer location (column index)
|
|
81
81
|
* @returns Component
|
|
82
82
|
*/
|
|
83
|
-
function defaultFooterItemRenderer(_rows, { index, states, checkable }, location =
|
|
83
|
+
function defaultFooterItemRenderer(_rows, { index, states, checkable }, location = 0) {
|
|
84
84
|
const { selectedItems, loadedItems, hasNextPage } = states;
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
if (index === location) {
|
|
86
|
+
if (checkable) {
|
|
87
|
+
return [
|
|
88
|
+
selectedItems.length,
|
|
89
|
+
loadedItems.toLocaleString() + (hasNextPage ? '+' : '')
|
|
90
|
+
].join(' / ');
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
return loadedItems.toLocaleString() + (hasNextPage ? '+' : '');
|
|
94
|
+
}
|
|
93
95
|
}
|
|
94
96
|
return undefined;
|
|
95
97
|
}
|
package/package.json
CHANGED
package/src/mu/DataGridEx.tsx
CHANGED
|
@@ -241,7 +241,7 @@ export function DataGridEx<T extends Record<string, any>>(
|
|
|
241
241
|
sortLabel = headerCellRenderer({
|
|
242
242
|
cellProps,
|
|
243
243
|
column,
|
|
244
|
-
columnIndex: index,
|
|
244
|
+
columnIndex: checkable ? index - 1 : index, // Ignore the checkbox case,
|
|
245
245
|
states
|
|
246
246
|
});
|
|
247
247
|
} else if (sortable && field != null) {
|
|
@@ -306,7 +306,7 @@ export function DataGridEx<T extends Record<string, any>>(
|
|
|
306
306
|
const cell = footerItemRenderer
|
|
307
307
|
? footerItemRenderer(rows, {
|
|
308
308
|
column,
|
|
309
|
-
index,
|
|
309
|
+
index: checkable ? index - 1 : index, // Ignore the checkbox case
|
|
310
310
|
states,
|
|
311
311
|
cellProps,
|
|
312
312
|
checkable
|
|
@@ -120,19 +120,19 @@ export namespace DataGridRenderers {
|
|
|
120
120
|
export function defaultFooterItemRenderer<T>(
|
|
121
121
|
_rows: T[],
|
|
122
122
|
{ index, states, checkable }: DataGridExFooterItemRendererProps<T>,
|
|
123
|
-
location: number =
|
|
123
|
+
location: number = 0
|
|
124
124
|
) {
|
|
125
125
|
const { selectedItems, loadedItems, hasNextPage } = states;
|
|
126
126
|
|
|
127
|
-
if (
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
if (index === location) {
|
|
128
|
+
if (checkable) {
|
|
129
|
+
return [
|
|
130
|
+
selectedItems.length,
|
|
131
|
+
loadedItems.toLocaleString() + (hasNextPage ? '+' : '')
|
|
132
|
+
].join(' / ');
|
|
133
|
+
} else {
|
|
134
|
+
return loadedItems.toLocaleString() + (hasNextPage ? '+' : '');
|
|
135
|
+
}
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
return undefined;
|