@linzjs/step-ag-grid 32.3.0 → 32.4.0

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.
@@ -57824,6 +57824,15 @@ var AgGridReact = class extends React13.Component {
57824
57824
  }
57825
57825
  };
57826
57826
 
57827
+ function isChromatic(windowArgument) {
57828
+ const windowToCheck = (globalThis.window !== undefined && globalThis);
57829
+ return !!(
57830
+ windowToCheck &&
57831
+ (/Chromatic/.test(windowToCheck.navigator.userAgent) ||
57832
+ /chromatic=true/.test(windowToCheck.location.href))
57833
+ );
57834
+ }
57835
+
57827
57836
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
57828
57837
 
57829
57838
  const NoContext = () => {
@@ -61318,7 +61327,8 @@ const Grid = ({
61318
61327
  cellClassRules: {
61319
61328
  ...colDef.cellClassRules,
61320
61329
  "GridCell-readonly": (ccp) => !suppressReadOnlyStyle && !editable(ccp)
61321
- }
61330
+ },
61331
+ width: colDef.minWidth || 120
61322
61332
  };
61323
61333
  }
61324
61334
  },
@@ -61800,7 +61810,9 @@ const Grid = ({
61800
61810
  const onGridSizeChanged = React13.useCallback(
61801
61811
  (event) => {
61802
61812
  if (sizeColumns === "fit" || ["auto", "auto-skip-headers"].includes(sizeColumns) && hasSetContentSize.current) {
61803
- event.api.sizeColumnsToFit();
61813
+ if (!isChromatic()) {
61814
+ event.api.sizeColumnsToFit();
61815
+ }
61804
61816
  }
61805
61817
  },
61806
61818
  [sizeColumns]
@@ -64260,7 +64272,9 @@ const ButtonCellRenderer = (props) => {
64260
64272
  };
64261
64273
  api.addEventListener("cellFocused", checkFocus);
64262
64274
  return () => {
64263
- api.removeEventListener("cellFocused", checkFocus);
64275
+ if (!api.isDestroyed()) {
64276
+ api.removeEventListener("cellFocused", checkFocus);
64277
+ }
64264
64278
  };
64265
64279
  }, [api, column, node.rowIndex]);
64266
64280
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -64348,7 +64362,11 @@ const BooleanCellRenderer = (props) => {
64348
64362
  }
64349
64363
  };
64350
64364
  api.addEventListener("cellFocused", checkFocus);
64351
- return () => void api.removeEventListener("cellFocused", checkFocus);
64365
+ return () => {
64366
+ if (!api.isDestroyed()) {
64367
+ api.removeEventListener("cellFocused", checkFocus);
64368
+ }
64369
+ };
64352
64370
  }, [api, column, node.rowIndex]);
64353
64371
  const isDisabled = !fnOrVar(colDef?.editable, props);
64354
64372
  const toggleCheckbox = React13.useCallback(() => {
@@ -64912,6 +64930,9 @@ const GridContextProvider = (props) => {
64912
64930
  if (!gridApi || gridApi.isDestroyed() || !gridApi.getColumnState()) {
64913
64931
  return null;
64914
64932
  }
64933
+ if (isChromatic()) {
64934
+ return { width: lodashEs.sumBy(gridApi.getColumnState(), (colState) => colState.hide ? 0 : colState.width ?? 0) };
64935
+ }
64915
64936
  try {
64916
64937
  const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
64917
64938
  const getVisibleColStates = () => {
@@ -64965,7 +64986,7 @@ const GridContextProvider = (props) => {
64965
64986
  );
64966
64987
  const sizeColumnsToFit = React13.useCallback(
64967
64988
  (paramsOrGridWidth) => {
64968
- if (gridApi && !gridApi?.isDestroyed()) {
64989
+ if (gridApi && !gridApi?.isDestroyed() && !isChromatic()) {
64969
64990
  gridApi.sizeColumnsToFit(paramsOrGridWidth);
64970
64991
  }
64971
64992
  },