@majoo-ui/react 1.60.14 → 1.60.15
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/components/table/Table.d.ts +1 -0
- package/index.esm.js +6 -3
- package/index.umd.js +8 -7
- package/package.json +1 -1
|
@@ -1103,6 +1103,7 @@ export interface RowGroup {
|
|
|
1103
1103
|
headerRender?: (row: Row<object>, cell: CellProp) => React.ReactNode;
|
|
1104
1104
|
footerRender?: (row: Row<object>, cell: CellProp) => React.ReactNode;
|
|
1105
1105
|
showGroupingWhenSorted?: boolean;
|
|
1106
|
+
isManuallyFormatted?: boolean;
|
|
1106
1107
|
}
|
|
1107
1108
|
interface CustomRowsStyle {
|
|
1108
1109
|
predicate: boolean;
|
package/index.esm.js
CHANGED
|
@@ -23144,8 +23144,11 @@ const stickyShadowStyling = (column, tableScrollPosition, scrollAreaWidth) => {
|
|
|
23144
23144
|
}
|
|
23145
23145
|
return {};
|
|
23146
23146
|
};
|
|
23147
|
-
const formattingData = (rawData,
|
|
23148
|
-
if (groupKey) {
|
|
23147
|
+
const formattingData = (rawData, rowGroup) => {
|
|
23148
|
+
if ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.groupKey) && !(rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.isManuallyFormatted)) {
|
|
23149
|
+
const {
|
|
23150
|
+
groupKey
|
|
23151
|
+
} = rowGroup;
|
|
23149
23152
|
const modifiedData = [];
|
|
23150
23153
|
rawData.forEach((item, index) => {
|
|
23151
23154
|
if (item[groupKey] && item[groupKey].length > 0) {
|
|
@@ -23399,7 +23402,7 @@ function Table({
|
|
|
23399
23402
|
};
|
|
23400
23403
|
const instance = useTable({
|
|
23401
23404
|
columns,
|
|
23402
|
-
data: useMemo(() => formattingData(rawData, rowGroup
|
|
23405
|
+
data: useMemo(() => formattingData(rawData, rowGroup), [rawData, rowGroup]),
|
|
23403
23406
|
initialState: getInitialState(),
|
|
23404
23407
|
manualPagination: !!fetchData,
|
|
23405
23408
|
manualSortBy: !!fetchData,
|
package/index.umd.js
CHANGED
|
@@ -23473,16 +23473,17 @@
|
|
|
23473
23473
|
}
|
|
23474
23474
|
return {};
|
|
23475
23475
|
};
|
|
23476
|
-
var formattingData = function formattingData(rawData,
|
|
23477
|
-
if (groupKey) {
|
|
23476
|
+
var formattingData = function formattingData(rawData, rowGroup) {
|
|
23477
|
+
if ((rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.groupKey) && !(rowGroup === null || rowGroup === void 0 ? void 0 : rowGroup.isManuallyFormatted)) {
|
|
23478
|
+
var groupKey_1 = rowGroup.groupKey;
|
|
23478
23479
|
var modifiedData_1 = [];
|
|
23479
23480
|
rawData.forEach(function (item, index) {
|
|
23480
|
-
if (item[
|
|
23481
|
-
var newElement = item[
|
|
23481
|
+
if (item[groupKey_1] && item[groupKey_1].length > 0) {
|
|
23482
|
+
var newElement = item[groupKey_1].map(function (childItem, index) {
|
|
23482
23483
|
return __assign(__assign({}, childItem), {
|
|
23483
23484
|
isTopChild: index === 0,
|
|
23484
23485
|
parentOriginal: item,
|
|
23485
|
-
isBottomChild: index === item[
|
|
23486
|
+
isBottomChild: index === item[groupKey_1].length - 1
|
|
23486
23487
|
});
|
|
23487
23488
|
});
|
|
23488
23489
|
modifiedData_1.push.apply(modifiedData_1, newElement);
|
|
@@ -23781,8 +23782,8 @@
|
|
|
23781
23782
|
var instance = reactTable.useTable({
|
|
23782
23783
|
columns: columns,
|
|
23783
23784
|
data: React.useMemo(function () {
|
|
23784
|
-
return formattingData(rawData, rowGroup
|
|
23785
|
-
}, [rawData, rowGroup
|
|
23785
|
+
return formattingData(rawData, rowGroup);
|
|
23786
|
+
}, [rawData, rowGroup]),
|
|
23786
23787
|
initialState: getInitialState(),
|
|
23787
23788
|
manualPagination: !!fetchData,
|
|
23788
23789
|
manualSortBy: !!fetchData,
|