warqadui 0.0.53 → 0.0.54

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 CHANGED
@@ -3343,10 +3343,10 @@ function PostTable({
3343
3343
  const [columnVisibility, setColumnVisibility] = (0, import_react16.useState)({});
3344
3344
  const [expanded, setExpanded] = (0, import_react16.useState)(() => {
3345
3345
  const initialState = {};
3346
- if (defaultExpanded && renderSubComponent && controlledData) {
3347
- controlledData.forEach((row, idx) => {
3346
+ if (defaultExpanded && renderSubComponent && (controlledData || []).length > 0) {
3347
+ (controlledData || []).forEach((row, idx) => {
3348
3348
  if (hasSubComponent(row)) {
3349
- initialState[idx] = true;
3349
+ initialState[idx.toString()] = true;
3350
3350
  }
3351
3351
  });
3352
3352
  }
@@ -3468,6 +3468,13 @@ function PostTable({
3468
3468
  if (editingIndex2 !== null) {
3469
3469
  setEditingIndex(null);
3470
3470
  } else {
3471
+ if (defaultExpanded && renderSubComponent && hasSubComponent(entryToPass)) {
3472
+ const newIndex = updated.length - 1;
3473
+ setExpanded((prev) => ({
3474
+ ...typeof prev === "object" ? prev : {},
3475
+ [newIndex.toString()]: true
3476
+ }));
3477
+ }
3471
3478
  setTimeout(() => focusAndScrollEntryRow(), 0);
3472
3479
  }
3473
3480
  }, []);
@@ -3602,7 +3609,7 @@ function PostTable({
3602
3609
  });
3603
3610
  }
3604
3611
  return finalColumns;
3605
- }, [userColumns, actionColumn, index]);
3612
+ }, [userColumns, actionColumn, index, renderSubComponent, hasSubComponent]);
3606
3613
  const table = (0, import_react_table2.useReactTable)({
3607
3614
  data,
3608
3615
  columns,
@@ -7619,7 +7626,6 @@ var Guard = () => {
7619
7626
  url: "/users/me",
7620
7627
  v: 1
7621
7628
  });
7622
- console.log("res", res);
7623
7629
  login(res?.data);
7624
7630
  setIsLoggedIn(true);
7625
7631
  setIsFetched(true);
package/dist/index.mjs CHANGED
@@ -3300,10 +3300,10 @@ function PostTable({
3300
3300
  const [columnVisibility, setColumnVisibility] = useState15({});
3301
3301
  const [expanded, setExpanded] = useState15(() => {
3302
3302
  const initialState = {};
3303
- if (defaultExpanded && renderSubComponent && controlledData) {
3304
- controlledData.forEach((row, idx) => {
3303
+ if (defaultExpanded && renderSubComponent && (controlledData || []).length > 0) {
3304
+ (controlledData || []).forEach((row, idx) => {
3305
3305
  if (hasSubComponent(row)) {
3306
- initialState[idx] = true;
3306
+ initialState[idx.toString()] = true;
3307
3307
  }
3308
3308
  });
3309
3309
  }
@@ -3425,6 +3425,13 @@ function PostTable({
3425
3425
  if (editingIndex2 !== null) {
3426
3426
  setEditingIndex(null);
3427
3427
  } else {
3428
+ if (defaultExpanded && renderSubComponent && hasSubComponent(entryToPass)) {
3429
+ const newIndex = updated.length - 1;
3430
+ setExpanded((prev) => ({
3431
+ ...typeof prev === "object" ? prev : {},
3432
+ [newIndex.toString()]: true
3433
+ }));
3434
+ }
3428
3435
  setTimeout(() => focusAndScrollEntryRow(), 0);
3429
3436
  }
3430
3437
  }, []);
@@ -3559,7 +3566,7 @@ function PostTable({
3559
3566
  });
3560
3567
  }
3561
3568
  return finalColumns;
3562
- }, [userColumns, actionColumn, index]);
3569
+ }, [userColumns, actionColumn, index, renderSubComponent, hasSubComponent]);
3563
3570
  const table = useReactTable2({
3564
3571
  data,
3565
3572
  columns,
@@ -7603,7 +7610,6 @@ var Guard = () => {
7603
7610
  url: "/users/me",
7604
7611
  v: 1
7605
7612
  });
7606
- console.log("res", res);
7607
7613
  login(res?.data);
7608
7614
  setIsLoggedIn(true);
7609
7615
  setIsFetched(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "warqadui",
3
- "version": "0.0.53",
3
+ "version": "0.0.54",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",