@ceed/ads 1.32.2-next.1 → 1.32.2-next.3

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.cjs CHANGED
@@ -3598,12 +3598,13 @@ var BodyCell = (props) => {
3598
3598
  [props.editMode, isCellEditable, params]
3599
3599
  );
3600
3600
  const propsComponentProps = "componentProps" in props ? props.componentProps : null;
3601
+ const hasComponentProps = "componentProps" in props;
3601
3602
  const componentProps = (0, import_react24.useMemo)(
3602
3603
  () => ({
3603
- ..."componentProps" in props && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
3604
+ ...hasComponentProps && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
3604
3605
  size: "sm"
3605
3606
  }),
3606
- [props, propsComponentProps, params]
3607
+ [hasComponentProps, propsComponentProps, params]
3607
3608
  );
3608
3609
  const editModeComponentProps = (0, import_react24.useMemo)(
3609
3610
  () => ({
@@ -3667,9 +3668,11 @@ var BodyCell = (props) => {
3667
3668
  }),
3668
3669
  [params, row, field, value, componentProps, type, onCellEditStop, onCellEditStart]
3669
3670
  );
3671
+ const MemoizedRenderEditCell = (0, import_react24.useMemo)(() => renderEditCell ? (0, import_react24.memo)(renderEditCell) : null, [renderEditCell]);
3672
+ const MemoizedRenderCell = (0, import_react24.useMemo)(() => renderCell ? (0, import_react24.memo)(renderCell) : null, [renderCell]);
3670
3673
  const EditModeComponent = (0, import_react24.useMemo)(() => {
3671
- if (renderEditCell) {
3672
- return (0, import_react24.createElement)((0, import_react24.memo)(renderEditCell), params);
3674
+ if (MemoizedRenderEditCell) {
3675
+ return (0, import_react24.createElement)(MemoizedRenderEditCell, params);
3673
3676
  }
3674
3677
  return {
3675
3678
  date: /* @__PURE__ */ import_react24.default.createElement(DatePicker_default, { value, ...editModeComponentProps }),
@@ -3700,11 +3703,11 @@ var BodyCell = (props) => {
3700
3703
  }
3701
3704
  )
3702
3705
  }[type || "text"];
3703
- }, [value, editModeComponentProps, type, renderEditCell, params]);
3706
+ }, [value, editModeComponentProps, type, MemoizedRenderEditCell, params]);
3704
3707
  const linkComponentFromProps = props.component;
3705
3708
  const ReadModeComponent = (0, import_react24.useMemo)(() => {
3706
- if (renderCell) {
3707
- return (0, import_react24.createElement)((0, import_react24.memo)(renderCell), params);
3709
+ if (MemoizedRenderCell) {
3710
+ return (0, import_react24.createElement)(MemoizedRenderCell, params);
3708
3711
  }
3709
3712
  const innerText = value;
3710
3713
  const typedComponent = {
@@ -3714,7 +3717,7 @@ var BodyCell = (props) => {
3714
3717
  })
3715
3718
  }[type || "text"];
3716
3719
  return typedComponent || innerText;
3717
- }, [value, renderCell, params, type, componentProps, linkComponentFromProps]);
3720
+ }, [value, MemoizedRenderCell, params, type, componentProps, linkComponentFromProps]);
3718
3721
  const getActions = props.getActions;
3719
3722
  const CellComponent = (0, import_react24.useMemo)(() => {
3720
3723
  if (type === "actions") {
@@ -3795,7 +3798,9 @@ var VirtualizedTableRow = (0, import_react24.memo)(StyledTableRow2, (prevProps,
3795
3798
  prevProps["data-row-id"] === nextProps["data-row-id"] && // @ts-ignore
3796
3799
  prevProps["data-index"] === nextProps["data-index"] && prevProps.tabIndex === nextProps.tabIndex && prevProps["aria-checked"] === nextProps["aria-checked"] && // Track column structure changes (e.g. isCellEditable toggled, columns added/removed)
3797
3800
  // @ts-ignore
3798
- prevProps["data-columns-key"] === nextProps["data-columns-key"];
3801
+ prevProps["data-columns-key"] === nextProps["data-columns-key"] && // Track row data changes — ensures re-render when row object reference changes (e.g. after refetch)
3802
+ // @ts-ignore
3803
+ prevProps["data-row-key"] === nextProps["data-row-key"];
3799
3804
  });
3800
3805
 
3801
3806
  // src/components/DataTable/hooks.ts
@@ -4502,13 +4507,13 @@ Pagination.displayName = "Pagination";
4502
4507
  var Pagination_default = Pagination;
4503
4508
 
4504
4509
  // src/components/DataTable/DataTable.tsx
4505
- var _columnsVersionCache = /* @__PURE__ */ new WeakMap();
4506
- var _columnsVersionCounter = 0;
4507
- function getColumnsVersion(columns) {
4508
- if (!_columnsVersionCache.has(columns)) {
4509
- _columnsVersionCache.set(columns, ++_columnsVersionCounter);
4510
+ var _objectVersionCache = /* @__PURE__ */ new WeakMap();
4511
+ var _objectVersionCounter = 0;
4512
+ function getObjectVersion(obj) {
4513
+ if (!_objectVersionCache.has(obj)) {
4514
+ _objectVersionCache.set(obj, ++_objectVersionCounter);
4510
4515
  }
4511
- return _columnsVersionCache.get(columns);
4516
+ return _objectVersionCache.get(obj);
4512
4517
  }
4513
4518
  var EMPTY_CHECKBOX_PROPS = {};
4514
4519
  function Component(props, apiRef) {
@@ -4606,7 +4611,7 @@ function Component(props, apiRef) {
4606
4611
  overscan: 10
4607
4612
  });
4608
4613
  const paginationModel = (0, import_react28.useMemo)(() => ({ page, pageSize }), [page, pageSize]);
4609
- const columnsKey = getColumnsVersion(columns);
4614
+ const columnsKey = getObjectVersion(columns);
4610
4615
  const headerCheckboxElement = (0, import_react28.useMemo)(
4611
4616
  () => /* @__PURE__ */ import_react28.default.createElement(
4612
4617
  RenderCheckbox,
@@ -4930,6 +4935,7 @@ function Component(props, apiRef) {
4930
4935
  key: virtualizedRow.key,
4931
4936
  "data-row-id": rowId,
4932
4937
  "data-index": rowIndex,
4938
+ "data-row-key": getObjectVersion(row),
4933
4939
  "data-columns-key": columnsKey,
4934
4940
  "aria-rowindex": rowIndex + 1,
4935
4941
  role: checkboxSelection && !disableSelectionOnClick ? "checkbox" : void 0,
package/dist/index.js CHANGED
@@ -3473,12 +3473,13 @@ var BodyCell = (props) => {
3473
3473
  [props.editMode, isCellEditable, params]
3474
3474
  );
3475
3475
  const propsComponentProps = "componentProps" in props ? props.componentProps : null;
3476
+ const hasComponentProps = "componentProps" in props;
3476
3477
  const componentProps = useMemo8(
3477
3478
  () => ({
3478
- ..."componentProps" in props && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
3479
+ ...hasComponentProps && (typeof propsComponentProps === "function" ? propsComponentProps(params) : propsComponentProps || {}),
3479
3480
  size: "sm"
3480
3481
  }),
3481
- [props, propsComponentProps, params]
3482
+ [hasComponentProps, propsComponentProps, params]
3482
3483
  );
3483
3484
  const editModeComponentProps = useMemo8(
3484
3485
  () => ({
@@ -3542,9 +3543,11 @@ var BodyCell = (props) => {
3542
3543
  }),
3543
3544
  [params, row, field, value, componentProps, type, onCellEditStop, onCellEditStart]
3544
3545
  );
3546
+ const MemoizedRenderEditCell = useMemo8(() => renderEditCell ? memo(renderEditCell) : null, [renderEditCell]);
3547
+ const MemoizedRenderCell = useMemo8(() => renderCell ? memo(renderCell) : null, [renderCell]);
3545
3548
  const EditModeComponent = useMemo8(() => {
3546
- if (renderEditCell) {
3547
- return createElement(memo(renderEditCell), params);
3549
+ if (MemoizedRenderEditCell) {
3550
+ return createElement(MemoizedRenderEditCell, params);
3548
3551
  }
3549
3552
  return {
3550
3553
  date: /* @__PURE__ */ React22.createElement(DatePicker_default, { value, ...editModeComponentProps }),
@@ -3575,11 +3578,11 @@ var BodyCell = (props) => {
3575
3578
  }
3576
3579
  )
3577
3580
  }[type || "text"];
3578
- }, [value, editModeComponentProps, type, renderEditCell, params]);
3581
+ }, [value, editModeComponentProps, type, MemoizedRenderEditCell, params]);
3579
3582
  const linkComponentFromProps = props.component;
3580
3583
  const ReadModeComponent = useMemo8(() => {
3581
- if (renderCell) {
3582
- return createElement(memo(renderCell), params);
3584
+ if (MemoizedRenderCell) {
3585
+ return createElement(MemoizedRenderCell, params);
3583
3586
  }
3584
3587
  const innerText = value;
3585
3588
  const typedComponent = {
@@ -3589,7 +3592,7 @@ var BodyCell = (props) => {
3589
3592
  })
3590
3593
  }[type || "text"];
3591
3594
  return typedComponent || innerText;
3592
- }, [value, renderCell, params, type, componentProps, linkComponentFromProps]);
3595
+ }, [value, MemoizedRenderCell, params, type, componentProps, linkComponentFromProps]);
3593
3596
  const getActions = props.getActions;
3594
3597
  const CellComponent = useMemo8(() => {
3595
3598
  if (type === "actions") {
@@ -3670,7 +3673,9 @@ var VirtualizedTableRow = memo(StyledTableRow2, (prevProps, nextProps) => {
3670
3673
  prevProps["data-row-id"] === nextProps["data-row-id"] && // @ts-ignore
3671
3674
  prevProps["data-index"] === nextProps["data-index"] && prevProps.tabIndex === nextProps.tabIndex && prevProps["aria-checked"] === nextProps["aria-checked"] && // Track column structure changes (e.g. isCellEditable toggled, columns added/removed)
3672
3675
  // @ts-ignore
3673
- prevProps["data-columns-key"] === nextProps["data-columns-key"];
3676
+ prevProps["data-columns-key"] === nextProps["data-columns-key"] && // Track row data changes — ensures re-render when row object reference changes (e.g. after refetch)
3677
+ // @ts-ignore
3678
+ prevProps["data-row-key"] === nextProps["data-row-key"];
3674
3679
  });
3675
3680
 
3676
3681
  // src/components/DataTable/hooks.ts
@@ -4377,13 +4382,13 @@ Pagination.displayName = "Pagination";
4377
4382
  var Pagination_default = Pagination;
4378
4383
 
4379
4384
  // src/components/DataTable/DataTable.tsx
4380
- var _columnsVersionCache = /* @__PURE__ */ new WeakMap();
4381
- var _columnsVersionCounter = 0;
4382
- function getColumnsVersion(columns) {
4383
- if (!_columnsVersionCache.has(columns)) {
4384
- _columnsVersionCache.set(columns, ++_columnsVersionCounter);
4385
+ var _objectVersionCache = /* @__PURE__ */ new WeakMap();
4386
+ var _objectVersionCounter = 0;
4387
+ function getObjectVersion(obj) {
4388
+ if (!_objectVersionCache.has(obj)) {
4389
+ _objectVersionCache.set(obj, ++_objectVersionCounter);
4385
4390
  }
4386
- return _columnsVersionCache.get(columns);
4391
+ return _objectVersionCache.get(obj);
4387
4392
  }
4388
4393
  var EMPTY_CHECKBOX_PROPS = {};
4389
4394
  function Component(props, apiRef) {
@@ -4481,7 +4486,7 @@ function Component(props, apiRef) {
4481
4486
  overscan: 10
4482
4487
  });
4483
4488
  const paginationModel = useMemo10(() => ({ page, pageSize }), [page, pageSize]);
4484
- const columnsKey = getColumnsVersion(columns);
4489
+ const columnsKey = getObjectVersion(columns);
4485
4490
  const headerCheckboxElement = useMemo10(
4486
4491
  () => /* @__PURE__ */ React25.createElement(
4487
4492
  RenderCheckbox,
@@ -4805,6 +4810,7 @@ function Component(props, apiRef) {
4805
4810
  key: virtualizedRow.key,
4806
4811
  "data-row-id": rowId,
4807
4812
  "data-index": rowIndex,
4813
+ "data-row-key": getObjectVersion(row),
4808
4814
  "data-columns-key": columnsKey,
4809
4815
  "aria-rowindex": rowIndex + 1,
4810
4816
  role: checkboxSelection && !disableSelectionOnClick ? "checkbox" : void 0,