@linzjs/step-ag-grid 32.3.0 → 32.4.1

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 = () => {
@@ -61087,6 +61096,9 @@ const Grid = ({
61087
61096
  // ─── Spread Remaining Params ──────────────────
61088
61097
  ...params
61089
61098
  }) => {
61099
+ if (isChromatic()) {
61100
+ sizeColumns = "none";
61101
+ }
61090
61102
  const {
61091
61103
  setApis,
61092
61104
  setExternallySelectedItemsAreInSync,
@@ -61318,7 +61330,8 @@ const Grid = ({
61318
61330
  cellClassRules: {
61319
61331
  ...colDef.cellClassRules,
61320
61332
  "GridCell-readonly": (ccp) => !suppressReadOnlyStyle && !editable(ccp)
61321
- }
61333
+ },
61334
+ width: colDef.minWidth || 120
61322
61335
  };
61323
61336
  }
61324
61337
  },
@@ -61800,7 +61813,9 @@ const Grid = ({
61800
61813
  const onGridSizeChanged = React13.useCallback(
61801
61814
  (event) => {
61802
61815
  if (sizeColumns === "fit" || ["auto", "auto-skip-headers"].includes(sizeColumns) && hasSetContentSize.current) {
61803
- event.api.sizeColumnsToFit();
61816
+ if (!isChromatic()) {
61817
+ event.api.sizeColumnsToFit();
61818
+ }
61804
61819
  }
61805
61820
  },
61806
61821
  [sizeColumns]
@@ -64260,7 +64275,9 @@ const ButtonCellRenderer = (props) => {
64260
64275
  };
64261
64276
  api.addEventListener("cellFocused", checkFocus);
64262
64277
  return () => {
64263
- api.removeEventListener("cellFocused", checkFocus);
64278
+ if (!api.isDestroyed()) {
64279
+ api.removeEventListener("cellFocused", checkFocus);
64280
+ }
64264
64281
  };
64265
64282
  }, [api, column, node.rowIndex]);
64266
64283
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -64348,7 +64365,11 @@ const BooleanCellRenderer = (props) => {
64348
64365
  }
64349
64366
  };
64350
64367
  api.addEventListener("cellFocused", checkFocus);
64351
- return () => void api.removeEventListener("cellFocused", checkFocus);
64368
+ return () => {
64369
+ if (!api.isDestroyed()) {
64370
+ api.removeEventListener("cellFocused", checkFocus);
64371
+ }
64372
+ };
64352
64373
  }, [api, column, node.rowIndex]);
64353
64374
  const isDisabled = !fnOrVar(colDef?.editable, props);
64354
64375
  const toggleCheckbox = React13.useCallback(() => {
@@ -64912,6 +64933,9 @@ const GridContextProvider = (props) => {
64912
64933
  if (!gridApi || gridApi.isDestroyed() || !gridApi.getColumnState()) {
64913
64934
  return null;
64914
64935
  }
64936
+ if (isChromatic()) {
64937
+ return { width: lodashEs.sumBy(gridApi.getColumnState(), (colState) => colState.hide ? 0 : colState.width ?? 0) };
64938
+ }
64915
64939
  try {
64916
64940
  const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
64917
64941
  const getVisibleColStates = () => {
@@ -64965,7 +64989,7 @@ const GridContextProvider = (props) => {
64965
64989
  );
64966
64990
  const sizeColumnsToFit = React13.useCallback(
64967
64991
  (paramsOrGridWidth) => {
64968
- if (gridApi && !gridApi?.isDestroyed()) {
64992
+ if (gridApi && !gridApi?.isDestroyed() && !isChromatic()) {
64969
64993
  gridApi.sizeColumnsToFit(paramsOrGridWidth);
64970
64994
  }
64971
64995
  },