@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.
- package/dist/step-ag-grid.cjs +29 -5
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +29 -5
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +9 -1
- package/src/components/gridPopoverEdit/GridButton.tsx +3 -1
- package/src/components/gridPopoverEdit/GridEditBoolean.tsx +5 -1
- package/src/contexts/GridContextProvider.tsx +15 -7
- package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +9 -8
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -57822,6 +57822,15 @@ var AgGridReact = class extends Component$1 {
|
|
|
57822
57822
|
}
|
|
57823
57823
|
};
|
|
57824
57824
|
|
|
57825
|
+
function isChromatic(windowArgument) {
|
|
57826
|
+
const windowToCheck = (globalThis.window !== undefined && globalThis);
|
|
57827
|
+
return !!(
|
|
57828
|
+
windowToCheck &&
|
|
57829
|
+
(/Chromatic/.test(windowToCheck.navigator.userAgent) ||
|
|
57830
|
+
/chromatic=true/.test(windowToCheck.location.href))
|
|
57831
|
+
);
|
|
57832
|
+
}
|
|
57833
|
+
|
|
57825
57834
|
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}
|
|
57826
57835
|
|
|
57827
57836
|
const NoContext = () => {
|
|
@@ -61085,6 +61094,9 @@ const Grid = ({
|
|
|
61085
61094
|
// ─── Spread Remaining Params ──────────────────
|
|
61086
61095
|
...params
|
|
61087
61096
|
}) => {
|
|
61097
|
+
if (isChromatic()) {
|
|
61098
|
+
sizeColumns = "none";
|
|
61099
|
+
}
|
|
61088
61100
|
const {
|
|
61089
61101
|
setApis,
|
|
61090
61102
|
setExternallySelectedItemsAreInSync,
|
|
@@ -61316,7 +61328,8 @@ const Grid = ({
|
|
|
61316
61328
|
cellClassRules: {
|
|
61317
61329
|
...colDef.cellClassRules,
|
|
61318
61330
|
"GridCell-readonly": (ccp) => !suppressReadOnlyStyle && !editable(ccp)
|
|
61319
|
-
}
|
|
61331
|
+
},
|
|
61332
|
+
width: colDef.minWidth || 120
|
|
61320
61333
|
};
|
|
61321
61334
|
}
|
|
61322
61335
|
},
|
|
@@ -61798,7 +61811,9 @@ const Grid = ({
|
|
|
61798
61811
|
const onGridSizeChanged = useCallback(
|
|
61799
61812
|
(event) => {
|
|
61800
61813
|
if (sizeColumns === "fit" || ["auto", "auto-skip-headers"].includes(sizeColumns) && hasSetContentSize.current) {
|
|
61801
|
-
|
|
61814
|
+
if (!isChromatic()) {
|
|
61815
|
+
event.api.sizeColumnsToFit();
|
|
61816
|
+
}
|
|
61802
61817
|
}
|
|
61803
61818
|
},
|
|
61804
61819
|
[sizeColumns]
|
|
@@ -64258,7 +64273,9 @@ const ButtonCellRenderer = (props) => {
|
|
|
64258
64273
|
};
|
|
64259
64274
|
api.addEventListener("cellFocused", checkFocus);
|
|
64260
64275
|
return () => {
|
|
64261
|
-
api.
|
|
64276
|
+
if (!api.isDestroyed()) {
|
|
64277
|
+
api.removeEventListener("cellFocused", checkFocus);
|
|
64278
|
+
}
|
|
64262
64279
|
};
|
|
64263
64280
|
}, [api, column, node.rowIndex]);
|
|
64264
64281
|
return /* @__PURE__ */ jsx(
|
|
@@ -64346,7 +64363,11 @@ const BooleanCellRenderer = (props) => {
|
|
|
64346
64363
|
}
|
|
64347
64364
|
};
|
|
64348
64365
|
api.addEventListener("cellFocused", checkFocus);
|
|
64349
|
-
return () =>
|
|
64366
|
+
return () => {
|
|
64367
|
+
if (!api.isDestroyed()) {
|
|
64368
|
+
api.removeEventListener("cellFocused", checkFocus);
|
|
64369
|
+
}
|
|
64370
|
+
};
|
|
64350
64371
|
}, [api, column, node.rowIndex]);
|
|
64351
64372
|
const isDisabled = !fnOrVar(colDef?.editable, props);
|
|
64352
64373
|
const toggleCheckbox = useCallback(() => {
|
|
@@ -64910,6 +64931,9 @@ const GridContextProvider = (props) => {
|
|
|
64910
64931
|
if (!gridApi || gridApi.isDestroyed() || !gridApi.getColumnState()) {
|
|
64911
64932
|
return null;
|
|
64912
64933
|
}
|
|
64934
|
+
if (isChromatic()) {
|
|
64935
|
+
return { width: sumBy(gridApi.getColumnState(), (colState) => colState.hide ? 0 : colState.width ?? 0) };
|
|
64936
|
+
}
|
|
64913
64937
|
try {
|
|
64914
64938
|
const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
|
|
64915
64939
|
const getVisibleColStates = () => {
|
|
@@ -64963,7 +64987,7 @@ const GridContextProvider = (props) => {
|
|
|
64963
64987
|
);
|
|
64964
64988
|
const sizeColumnsToFit = useCallback(
|
|
64965
64989
|
(paramsOrGridWidth) => {
|
|
64966
|
-
if (gridApi && !gridApi?.isDestroyed()) {
|
|
64990
|
+
if (gridApi && !gridApi?.isDestroyed() && !isChromatic()) {
|
|
64967
64991
|
gridApi.sizeColumnsToFit(paramsOrGridWidth);
|
|
64968
64992
|
}
|
|
64969
64993
|
},
|