@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.
- package/dist/step-ag-grid.cjs +26 -5
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +26 -5
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +5 -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 = () => {
|
|
@@ -61316,7 +61325,8 @@ const Grid = ({
|
|
|
61316
61325
|
cellClassRules: {
|
|
61317
61326
|
...colDef.cellClassRules,
|
|
61318
61327
|
"GridCell-readonly": (ccp) => !suppressReadOnlyStyle && !editable(ccp)
|
|
61319
|
-
}
|
|
61328
|
+
},
|
|
61329
|
+
width: colDef.minWidth || 120
|
|
61320
61330
|
};
|
|
61321
61331
|
}
|
|
61322
61332
|
},
|
|
@@ -61798,7 +61808,9 @@ const Grid = ({
|
|
|
61798
61808
|
const onGridSizeChanged = useCallback(
|
|
61799
61809
|
(event) => {
|
|
61800
61810
|
if (sizeColumns === "fit" || ["auto", "auto-skip-headers"].includes(sizeColumns) && hasSetContentSize.current) {
|
|
61801
|
-
|
|
61811
|
+
if (!isChromatic()) {
|
|
61812
|
+
event.api.sizeColumnsToFit();
|
|
61813
|
+
}
|
|
61802
61814
|
}
|
|
61803
61815
|
},
|
|
61804
61816
|
[sizeColumns]
|
|
@@ -64258,7 +64270,9 @@ const ButtonCellRenderer = (props) => {
|
|
|
64258
64270
|
};
|
|
64259
64271
|
api.addEventListener("cellFocused", checkFocus);
|
|
64260
64272
|
return () => {
|
|
64261
|
-
api.
|
|
64273
|
+
if (!api.isDestroyed()) {
|
|
64274
|
+
api.removeEventListener("cellFocused", checkFocus);
|
|
64275
|
+
}
|
|
64262
64276
|
};
|
|
64263
64277
|
}, [api, column, node.rowIndex]);
|
|
64264
64278
|
return /* @__PURE__ */ jsx(
|
|
@@ -64346,7 +64360,11 @@ const BooleanCellRenderer = (props) => {
|
|
|
64346
64360
|
}
|
|
64347
64361
|
};
|
|
64348
64362
|
api.addEventListener("cellFocused", checkFocus);
|
|
64349
|
-
return () =>
|
|
64363
|
+
return () => {
|
|
64364
|
+
if (!api.isDestroyed()) {
|
|
64365
|
+
api.removeEventListener("cellFocused", checkFocus);
|
|
64366
|
+
}
|
|
64367
|
+
};
|
|
64350
64368
|
}, [api, column, node.rowIndex]);
|
|
64351
64369
|
const isDisabled = !fnOrVar(colDef?.editable, props);
|
|
64352
64370
|
const toggleCheckbox = useCallback(() => {
|
|
@@ -64910,6 +64928,9 @@ const GridContextProvider = (props) => {
|
|
|
64910
64928
|
if (!gridApi || gridApi.isDestroyed() || !gridApi.getColumnState()) {
|
|
64911
64929
|
return null;
|
|
64912
64930
|
}
|
|
64931
|
+
if (isChromatic()) {
|
|
64932
|
+
return { width: sumBy(gridApi.getColumnState(), (colState) => colState.hide ? 0 : colState.width ?? 0) };
|
|
64933
|
+
}
|
|
64913
64934
|
try {
|
|
64914
64935
|
const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
|
|
64915
64936
|
const getVisibleColStates = () => {
|
|
@@ -64963,7 +64984,7 @@ const GridContextProvider = (props) => {
|
|
|
64963
64984
|
);
|
|
64964
64985
|
const sizeColumnsToFit = useCallback(
|
|
64965
64986
|
(paramsOrGridWidth) => {
|
|
64966
|
-
if (gridApi && !gridApi?.isDestroyed()) {
|
|
64987
|
+
if (gridApi && !gridApi?.isDestroyed() && !isChromatic()) {
|
|
64967
64988
|
gridApi.sizeColumnsToFit(paramsOrGridWidth);
|
|
64968
64989
|
}
|
|
64969
64990
|
},
|