@linzjs/step-ag-grid 29.10.0 → 29.11.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/GridTheme.scss +7 -1
- package/dist/src/contexts/GridContext.d.ts +0 -1
- package/dist/step-ag-grid.cjs +19 -8
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +19 -8
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +18 -16
- package/src/components/Grid.tsx +0 -1
- package/src/contexts/GridContext.tsx +0 -1
- package/src/contexts/GridContextProvider.tsx +37 -13
- package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +2 -0
- package/src/styles/GridTheme.scss +7 -1
package/dist/GridTheme.scss
CHANGED
|
@@ -144,7 +144,7 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
.ag-icon-filter {
|
|
147
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%
|
|
147
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23007198'%3E%3Cpath d='M6 12.984v-1.969h12v1.969zM3 6h18v2.016H3zm6.984 12v-2.016h4.031V18z'/%3E%3C/svg%3E") !important;
|
|
148
148
|
background-repeat: no-repeat;
|
|
149
149
|
background-position: center;
|
|
150
150
|
background-size: contain;
|
|
@@ -154,6 +154,12 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
154
154
|
content: none !important;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
+
|
|
158
|
+
.ag-header-cell-filter-button.ag-has-popup-positioned-under .ag-icon-filter {
|
|
159
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M6 12.984v-1.969h12v1.969zM3 6h18v2.016H3zm6.984 12v-2.016h4.031V18z'/%3E%3C/svg%3E") !important;
|
|
160
|
+
background-color: #007198;
|
|
161
|
+
border-radius: 2px;
|
|
162
|
+
}
|
|
157
163
|
|
|
158
164
|
.ag-header-group-cell {
|
|
159
165
|
text-transform: uppercase;
|
package/dist/step-ag-grid.cjs
CHANGED
|
@@ -2814,7 +2814,6 @@ const Grid = ({ 'data-testid': dataTestId, defaultPostSort = true, rowSelection
|
|
|
2814
2814
|
autoSizeColumns({
|
|
2815
2815
|
skipHeader,
|
|
2816
2816
|
userSizedColIds: new Set(userSizedColIds.current.keys()),
|
|
2817
|
-
includeFlex: true,
|
|
2818
2817
|
});
|
|
2819
2818
|
// Auto-size failed retry later
|
|
2820
2819
|
if (!autoSizeResult) {
|
|
@@ -5346,6 +5345,8 @@ const waitForCondition = async (error, condition, timeoutMs) => {
|
|
|
5346
5345
|
return false;
|
|
5347
5346
|
};
|
|
5348
5347
|
|
|
5348
|
+
const colStateId = (colState) => colState.colId;
|
|
5349
|
+
const colStateFlexed = (colState) => !!colState.flex;
|
|
5349
5350
|
/**
|
|
5350
5351
|
* Context for AgGrid operations.
|
|
5351
5352
|
* Make sure you wrap AgGrid in this.
|
|
@@ -5627,20 +5628,30 @@ const GridContextProvider = (props) => {
|
|
|
5627
5628
|
}, [gridApiOp]);
|
|
5628
5629
|
/**
|
|
5629
5630
|
* Resize columns to fit container
|
|
5631
|
+
*
|
|
5632
|
+
* This is used to calculate the preferred size of columns.
|
|
5633
|
+
* It sizes the flex columns first and then clears the calculated width.
|
|
5634
|
+
* If you don't clear flex column widths ag-grid gets confused and does random sizing's.
|
|
5635
|
+
* Then we size the flexed columns.
|
|
5630
5636
|
*/
|
|
5631
|
-
const autoSizeColumns = React.useCallback(({ skipHeader, colIds, userSizedColIds
|
|
5637
|
+
const autoSizeColumns = React.useCallback(({ skipHeader, colIds, userSizedColIds } = {}) => {
|
|
5632
5638
|
if (!gridApi || !gridApi.getColumnState()) {
|
|
5633
5639
|
return null;
|
|
5634
5640
|
}
|
|
5635
5641
|
const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
|
|
5636
|
-
const
|
|
5642
|
+
const colStates = gridApi.getColumnState();
|
|
5643
|
+
const relevantCols = colStates?.filter((colState) => {
|
|
5637
5644
|
const colId = colState.colId;
|
|
5638
|
-
return (
|
|
5639
|
-
!userSizedColIds?.has(colId) &&
|
|
5640
|
-
(includeFlex || !colState.flex));
|
|
5645
|
+
return (lodashEs.isEmpty(colIdsSet) || colIdsSet.has(colId)) && !userSizedColIds?.has(colId);
|
|
5641
5646
|
});
|
|
5642
|
-
|
|
5643
|
-
|
|
5647
|
+
const [flexColumns, nonFlexColumns] = lodashEs.partition(relevantCols, colStateFlexed);
|
|
5648
|
+
// If we don't reset the flex columns auto size it causes issues with random resizing of flex columns
|
|
5649
|
+
if (!lodashEs.isEmpty(flexColumns)) {
|
|
5650
|
+
gridApi.autoSizeColumns(flexColumns.map(colStateId), skipHeader);
|
|
5651
|
+
gridApi.resetColumnState();
|
|
5652
|
+
}
|
|
5653
|
+
if (!lodashEs.isEmpty(nonFlexColumns)) {
|
|
5654
|
+
gridApi.autoSizeColumns(nonFlexColumns.map(colStateId), skipHeader);
|
|
5644
5655
|
}
|
|
5645
5656
|
return {
|
|
5646
5657
|
width: lodashEs.sumBy(gridApi.getColumnState().filter((col) => !col.hide), 'width'),
|