warqadui 0.0.54 → 0.0.57
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/index.js +14 -1
- package/dist/index.mjs +14 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3314,7 +3314,7 @@ var TableRow = import_react16.default.memo(
|
|
|
3314
3314
|
] });
|
|
3315
3315
|
},
|
|
3316
3316
|
(prev, next) => {
|
|
3317
|
-
return prev.row.original === next.row.original && prev.row.getIsExpanded() === next.row.getIsExpanded() && prev.row.getIsSelected() === next.row.getIsSelected() && prev.rowPadding === next.rowPadding && prev.verticalLines === next.verticalLines;
|
|
3317
|
+
return prev.row.original === next.row.original && prev.row.getIsExpanded() === next.row.getIsExpanded() && prev.row.getIsSelected() === next.row.getIsSelected() && prev.rowPadding === next.rowPadding && prev.verticalLines === next.verticalLines && prev.renderSubComponent === next.renderSubComponent && prev.hasSubComponent === next.hasSubComponent;
|
|
3318
3318
|
}
|
|
3319
3319
|
);
|
|
3320
3320
|
function PostTable({
|
|
@@ -3356,6 +3356,19 @@ function PostTable({
|
|
|
3356
3356
|
const isControlled = controlledData !== void 0;
|
|
3357
3357
|
const data = isControlled ? controlledData : internalData;
|
|
3358
3358
|
const entryRowRef = (0, import_react16.useRef)(null);
|
|
3359
|
+
const hasInitializedExpansion = (0, import_react16.useRef)(false);
|
|
3360
|
+
(0, import_react16.useEffect)(() => {
|
|
3361
|
+
if (defaultExpanded && renderSubComponent && !hasInitializedExpansion.current && (data || []).length > 0) {
|
|
3362
|
+
const initialState = {};
|
|
3363
|
+
data.forEach((row, idx) => {
|
|
3364
|
+
if (hasSubComponent(row)) {
|
|
3365
|
+
initialState[idx.toString()] = true;
|
|
3366
|
+
}
|
|
3367
|
+
});
|
|
3368
|
+
setExpanded(initialState);
|
|
3369
|
+
hasInitializedExpansion.current = true;
|
|
3370
|
+
}
|
|
3371
|
+
}, [data, defaultExpanded, hasSubComponent, renderSubComponent]);
|
|
3359
3372
|
const focusAndScrollEntryRow = () => {
|
|
3360
3373
|
setTimeout(() => {
|
|
3361
3374
|
if (entryRowRef.current) {
|
package/dist/index.mjs
CHANGED
|
@@ -3271,7 +3271,7 @@ var TableRow = React9.memo(
|
|
|
3271
3271
|
] });
|
|
3272
3272
|
},
|
|
3273
3273
|
(prev, next) => {
|
|
3274
|
-
return prev.row.original === next.row.original && prev.row.getIsExpanded() === next.row.getIsExpanded() && prev.row.getIsSelected() === next.row.getIsSelected() && prev.rowPadding === next.rowPadding && prev.verticalLines === next.verticalLines;
|
|
3274
|
+
return prev.row.original === next.row.original && prev.row.getIsExpanded() === next.row.getIsExpanded() && prev.row.getIsSelected() === next.row.getIsSelected() && prev.rowPadding === next.rowPadding && prev.verticalLines === next.verticalLines && prev.renderSubComponent === next.renderSubComponent && prev.hasSubComponent === next.hasSubComponent;
|
|
3275
3275
|
}
|
|
3276
3276
|
);
|
|
3277
3277
|
function PostTable({
|
|
@@ -3313,6 +3313,19 @@ function PostTable({
|
|
|
3313
3313
|
const isControlled = controlledData !== void 0;
|
|
3314
3314
|
const data = isControlled ? controlledData : internalData;
|
|
3315
3315
|
const entryRowRef = useRef5(null);
|
|
3316
|
+
const hasInitializedExpansion = useRef5(false);
|
|
3317
|
+
useEffect10(() => {
|
|
3318
|
+
if (defaultExpanded && renderSubComponent && !hasInitializedExpansion.current && (data || []).length > 0) {
|
|
3319
|
+
const initialState = {};
|
|
3320
|
+
data.forEach((row, idx) => {
|
|
3321
|
+
if (hasSubComponent(row)) {
|
|
3322
|
+
initialState[idx.toString()] = true;
|
|
3323
|
+
}
|
|
3324
|
+
});
|
|
3325
|
+
setExpanded(initialState);
|
|
3326
|
+
hasInitializedExpansion.current = true;
|
|
3327
|
+
}
|
|
3328
|
+
}, [data, defaultExpanded, hasSubComponent, renderSubComponent]);
|
|
3316
3329
|
const focusAndScrollEntryRow = () => {
|
|
3317
3330
|
setTimeout(() => {
|
|
3318
3331
|
if (entryRowRef.current) {
|