@gooddata/sdk-ui-pivot 11.60.0-alpha.3 → 11.60.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/esm/next/PivotTableNext.js +2 -6
- package/esm/next/PivotTableNextPluggable.js +1 -1
- package/esm/next/components/AvoidResizeFlickering.d.ts.map +1 -1
- package/esm/next/components/AvoidResizeFlickering.js +7 -2
- package/esm/next/context/PivotTableSizingContext.d.ts +3 -0
- package/esm/next/context/PivotTableSizingContext.d.ts.map +1 -1
- package/esm/next/context/PivotTableSizingContext.js +14 -4
- package/esm/next/context/TableReadyContext.js +1 -1
- package/esm/next/features/resizing/getColumnsPendingAutoResize.d.ts +10 -0
- package/esm/next/features/resizing/getColumnsPendingAutoResize.d.ts.map +1 -0
- package/esm/next/features/resizing/getColumnsPendingAutoResize.js +23 -0
- package/esm/next/hooks/resizing/useColumnSizingForFullHorizontalSpace.d.ts +3 -1
- package/esm/next/hooks/resizing/useColumnSizingForFullHorizontalSpace.d.ts.map +1 -1
- package/esm/next/hooks/resizing/useColumnSizingForFullHorizontalSpace.js +7 -2
- package/esm/next/hooks/resizing/useColumnSizingForFullHorizontalSpaceAndAutoResize.d.ts +3 -1
- package/esm/next/hooks/resizing/useColumnSizingForFullHorizontalSpaceAndAutoResize.d.ts.map +1 -1
- package/esm/next/hooks/resizing/useColumnSizingForFullHorizontalSpaceAndAutoResize.js +3 -2
- package/esm/next/hooks/resizing/useColumnSizingProps.d.ts +3 -1
- package/esm/next/hooks/resizing/useColumnSizingProps.d.ts.map +1 -1
- package/esm/next/hooks/resizing/useColumnSizingProps.js +3 -3
- package/esm/next/hooks/resizing/useInitialAutoResizeVisibility.d.ts.map +1 -1
- package/esm/next/hooks/resizing/useInitialAutoResizeVisibility.js +27 -3
- package/esm/next/hooks/resizing/useResizeOnGridSizeChanged.d.ts +16 -0
- package/esm/next/hooks/resizing/useResizeOnGridSizeChanged.d.ts.map +1 -0
- package/esm/next/hooks/resizing/useResizeOnGridSizeChanged.js +96 -0
- package/esm/next/hooks/resizing/useVirtualColumnAutoResize.d.ts +2 -1
- package/esm/next/hooks/resizing/useVirtualColumnAutoResize.d.ts.map +1 -1
- package/esm/next/hooks/resizing/useVirtualColumnAutoResize.js +4 -5
- package/esm/next/hooks/useAgGridReactProps.d.ts.map +1 -1
- package/esm/next/hooks/useAgGridReactProps.js +9 -3
- package/esm/next/types/internal.d.ts +7 -0
- package/esm/next/types/internal.d.ts.map +1 -1
- package/package.json +13 -13
|
@@ -17,7 +17,7 @@ import { DrillableItemsRefProvider } from "./context/DrillableItemsRefContext.js
|
|
|
17
17
|
import { HeaderMenuProvider } from "./context/HeaderMenuContext.js";
|
|
18
18
|
import { InitialExecutionContextProvider } from "./context/InitialExecutionContext.js";
|
|
19
19
|
import { PivotTablePropsProvider, usePivotTableProps } from "./context/PivotTablePropsContext.js";
|
|
20
|
-
import { PivotTableSizingProvider
|
|
20
|
+
import { PivotTableSizingProvider } from "./context/PivotTableSizingContext.js";
|
|
21
21
|
import { RuntimeErrorProvider, useRuntimeError } from "./context/RuntimeErrorContext.js";
|
|
22
22
|
import { TableReadyProvider } from "./context/TableReadyContext.js";
|
|
23
23
|
import { TotalLabelProvider } from "./context/TotalLabelContext.js";
|
|
@@ -84,7 +84,6 @@ function PivotTableNextWithInitialization() {
|
|
|
84
84
|
function RenderPivotTableNextAgGrid() {
|
|
85
85
|
const agGridReactProps = useAgGridReactProps();
|
|
86
86
|
const { config } = usePivotTableProps();
|
|
87
|
-
const { setContainerWidth } = usePivotTableSizingActions();
|
|
88
87
|
const clearCellSelection = useClearCellSelection();
|
|
89
88
|
useMemo(() => {
|
|
90
89
|
if (config.agGridToken) {
|
|
@@ -135,9 +134,6 @@ function RenderPivotTableNextAgGrid() {
|
|
|
135
134
|
overflowY: isAutoHeight ? "auto" : "hidden",
|
|
136
135
|
visibility: isReadyForInitialPaint ? "visible" : "hidden",
|
|
137
136
|
};
|
|
138
|
-
return (_jsx("div", {
|
|
139
|
-
if (element)
|
|
140
|
-
setContainerWidth(element.clientWidth);
|
|
141
|
-
}, className: b(), style: containerStyle, onMouseDown: stopEventOnResize, onDragStart: stopEventOnResize, onClick: stopEventAfterResize, onBlur: handleBlur, ...getPivotContainerTestIdProps(isReadyForInitialPaint), children: _jsx(AgGridReact, { ...agGridReactProps }, gridKey) }));
|
|
137
|
+
return (_jsx("div", { className: b(), style: containerStyle, onMouseDown: stopEventOnResize, onDragStart: stopEventOnResize, onClick: stopEventAfterResize, onBlur: handleBlur, ...getPivotContainerTestIdProps(isReadyForInitialPaint), children: _jsx(AgGridReact, { ...agGridReactProps }, gridKey) }));
|
|
142
138
|
} }));
|
|
143
139
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvoidResizeFlickering.d.ts","sourceRoot":"","sources":["../../../src/next/components/AvoidResizeFlickering.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AvoidResizeFlickering.d.ts","sourceRoot":"","sources":["../../../src/next/components/AvoidResizeFlickering.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAQpE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,sBAAsB,EAAE,OAAO,CAAA;KAAE,KAAK,SAAS,CAAC;CACvE;AAeD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE,2BAA2B,2CAqB9E"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2025-2026 GoodData Corporation
|
|
3
3
|
import { useMemo } from "react";
|
|
4
|
+
import { usePivotTableSizing } from "../context/PivotTableSizingContext.js";
|
|
4
5
|
import { useTableReady } from "../context/TableReadyContext.js";
|
|
5
6
|
import { useInitialAutoResizeVisibility } from "../hooks/resizing/useInitialAutoResizeVisibility.js";
|
|
6
7
|
import { LoadingComponent } from "./LoadingComponent.js";
|
|
@@ -26,8 +27,12 @@ const loadingContainerStyle = {
|
|
|
26
27
|
*/
|
|
27
28
|
export function AvoidResizeFlickering({ children }) {
|
|
28
29
|
const { onVisibilityReady } = useTableReady();
|
|
30
|
+
const { containerWidth, isContainerWidthMeasured } = usePivotTableSizing();
|
|
29
31
|
// Pass onReady callback to hook - called directly from effect when ready
|
|
30
32
|
const visibilityOptions = useMemo(() => ({ onReady: onVisibilityReady }), [onVisibilityReady]);
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
+
const isReadyAfterInitialSettle = useInitialAutoResizeVisibility(visibilityOptions);
|
|
34
|
+
const hasContainerWidth = containerWidth > 0;
|
|
35
|
+
const isReadyForInitialPaint = isReadyAfterInitialSettle && hasContainerWidth;
|
|
36
|
+
const isMeasuredAsHidden = isContainerWidthMeasured && !hasContainerWidth;
|
|
37
|
+
return (_jsxs("div", { style: containerStyle, children: [!isReadyForInitialPaint && !isMeasuredAsHidden ? (_jsx("div", { style: loadingContainerStyle, children: _jsx(LoadingComponent, {}) })) : null, children({ isReadyForInitialPaint })] }));
|
|
33
38
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
type IPivotTableSizingStateContext = {
|
|
3
3
|
containerWidth: number;
|
|
4
|
+
isContainerWidthMeasured: boolean;
|
|
5
|
+
resizeOnShowCount: number;
|
|
4
6
|
};
|
|
5
7
|
type IPivotTableSizingActionsContext = {
|
|
6
8
|
setContainerWidth: (width: number) => void;
|
|
9
|
+
markResizeOnShow: () => void;
|
|
7
10
|
};
|
|
8
11
|
/**
|
|
9
12
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PivotTableSizingContext.d.ts","sourceRoot":"","sources":["../../../src/next/context/PivotTableSizingContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"PivotTableSizingContext.d.ts","sourceRoot":"","sources":["../../../src/next/context/PivotTableSizingContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA6D,MAAM,OAAO,CAAC;AAElG,KAAK,6BAA6B,GAAG;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,wBAAwB,EAAE,OAAO,CAAC;IAClC,iBAAiB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,KAAK,+BAA+B,GAAG;IACnC,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAChC,CAAC;AAOF;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAmC7E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,6BAA6B,CAQnE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,+BAA+B,CAQ5E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2025-2026 GoodData Corporation
|
|
3
|
-
import { createContext, useContext, useMemo, useState } from "react";
|
|
3
|
+
import { createContext, useCallback, useContext, useMemo, useState } from "react";
|
|
4
4
|
// Keep state and actions in separate contexts so components that only dispatch
|
|
5
5
|
// (e.g. setContainerWidth) do not re-render on every sizing state change.
|
|
6
6
|
const PivotTableSizingStateContext = createContext(undefined);
|
|
@@ -9,13 +9,23 @@ const PivotTableSizingActionsContext = createContext(undefined);
|
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
11
|
export function PivotTableSizingProvider({ children }) {
|
|
12
|
-
const [containerWidth,
|
|
12
|
+
const [containerWidth, setContainerWidthState] = useState(0);
|
|
13
|
+
const [isContainerWidthMeasured, setIsContainerWidthMeasured] = useState(false);
|
|
14
|
+
const setContainerWidth = useCallback((width) => {
|
|
15
|
+
setContainerWidthState(width);
|
|
16
|
+
setIsContainerWidthMeasured(true);
|
|
17
|
+
}, []);
|
|
18
|
+
const [resizeOnShowCount, setResizeOnShowCount] = useState(0);
|
|
19
|
+
const markResizeOnShow = useCallback(() => setResizeOnShowCount((count) => count + 1), []);
|
|
13
20
|
const stateValue = useMemo(() => ({
|
|
14
21
|
containerWidth,
|
|
15
|
-
|
|
22
|
+
isContainerWidthMeasured,
|
|
23
|
+
resizeOnShowCount,
|
|
24
|
+
}), [containerWidth, isContainerWidthMeasured, resizeOnShowCount]);
|
|
16
25
|
const actionsValue = useMemo(() => ({
|
|
17
26
|
setContainerWidth,
|
|
18
|
-
|
|
27
|
+
markResizeOnShow,
|
|
28
|
+
}), [setContainerWidth, markResizeOnShow]);
|
|
19
29
|
return (_jsx(PivotTableSizingActionsContext.Provider, { value: actionsValue, children: _jsx(PivotTableSizingStateContext.Provider, { value: stateValue, children: children }) }));
|
|
20
30
|
}
|
|
21
31
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2025 GoodData Corporation
|
|
2
|
+
// (C) 2025-2026 GoodData Corporation
|
|
3
3
|
import { createContext, useCallback, useContext, useRef } from "react";
|
|
4
4
|
import { usePivotTableProps } from "./PivotTablePropsContext.js";
|
|
5
5
|
const TableReadyContext = createContext(undefined);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AgGridApi, type AgGridColumn } from "../../types/agGrid.js";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function getColumnsPendingAutoResize(columns: AgGridColumn[], processedColumnIds: ReadonlySet<string>): AgGridColumn[];
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function getColumnsWithinViewport(api: AgGridApi, viewportWidth: number): AgGridColumn[];
|
|
10
|
+
//# sourceMappingURL=getColumnsPendingAutoResize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getColumnsPendingAutoResize.d.ts","sourceRoot":"","sources":["../../../../src/next/features/resizing/getColumnsPendingAutoResize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1E;;GAEG;AACH,wBAAgB,2BAA2B,CACvC,OAAO,EAAE,YAAY,EAAE,EACvB,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,GACxC,YAAY,EAAE,CAMhB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,YAAY,EAAE,CAY9F"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export function getColumnsPendingAutoResize(columns, processedColumnIds) {
|
|
6
|
+
return columns.filter((col) => !processedColumnIds.has(col.getId()) &&
|
|
7
|
+
(col.getColDef().width === undefined || col.getColDef().width === null));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export function getColumnsWithinViewport(api, viewportWidth) {
|
|
13
|
+
const leftColumns = api.getDisplayedLeftColumns();
|
|
14
|
+
const rightColumns = api.getDisplayedRightColumns();
|
|
15
|
+
const pinnedWidth = [...leftColumns, ...rightColumns].reduce((acc, col) => acc + col.getActualWidth(), 0);
|
|
16
|
+
const { left } = api.getHorizontalPixelRange();
|
|
17
|
+
const right = left + viewportWidth - pinnedWidth;
|
|
18
|
+
const centerColumns = api.getDisplayedCenterColumns().filter((col) => {
|
|
19
|
+
const colLeft = col.getLeft() ?? 0;
|
|
20
|
+
return colLeft < right && colLeft + col.getActualWidth() > left;
|
|
21
|
+
});
|
|
22
|
+
return [...leftColumns, ...centerColumns, ...rightColumns];
|
|
23
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type IGridSizingState } from "../../types/internal.js";
|
|
1
3
|
/**
|
|
2
4
|
* Returns column sizing props for ag-grid when grid should fit full horizontal space (growToFit).
|
|
3
5
|
*
|
|
4
6
|
* @internal
|
|
5
7
|
*/
|
|
6
|
-
export declare function useColumnSizingForFullHorizontalSpace(): {
|
|
8
|
+
export declare function useColumnSizingForFullHorizontalSpace(gridSizingStateRef: RefObject<IGridSizingState>): {
|
|
7
9
|
autoSizeStrategy: import("ag-grid-community").AutoSizeStrategy | undefined;
|
|
8
10
|
initColumnWidths: (event: import("ag-grid-community").ColumnResizedEvent<import("../../types/internal.js").AgGridRowData, any>) => void;
|
|
9
11
|
} | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useColumnSizingForFullHorizontalSpace.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/resizing/useColumnSizingForFullHorizontalSpace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useColumnSizingForFullHorizontalSpace.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/resizing/useColumnSizingForFullHorizontalSpace.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAKpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAQhE;;;;GAIG;AACH,wBAAgB,qCAAqC,CAAC,kBAAkB,EAAE,SAAS,CAAC,gBAAgB,CAAC;;;SAqDpG"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// (C) 2025-2026 GoodData Corporation
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { usePivotTableProps } from "../../context/PivotTablePropsContext.js";
|
|
4
|
+
import { usePivotTableSizing } from "../../context/PivotTableSizingContext.js";
|
|
4
5
|
import { useGetAgGridColumns } from "../columns/useGetAgGridColumns.js";
|
|
5
6
|
import { useUpdateAgGridColumnDefs } from "../columns/useUpdateAgGridColumnDefs.js";
|
|
6
7
|
const autoSizeStrategy = {
|
|
@@ -11,13 +12,14 @@ const autoSizeStrategy = {
|
|
|
11
12
|
*
|
|
12
13
|
* @internal
|
|
13
14
|
*/
|
|
14
|
-
export function useColumnSizingForFullHorizontalSpace() {
|
|
15
|
+
export function useColumnSizingForFullHorizontalSpace(gridSizingStateRef) {
|
|
15
16
|
const { config } = usePivotTableProps();
|
|
16
17
|
const { columnSizing } = config;
|
|
17
18
|
const { defaultWidth, growToFit } = columnSizing;
|
|
18
19
|
const shouldAdaptSizeToCellContent = defaultWidth === "autoresizeAll" || defaultWidth === "viewport";
|
|
19
20
|
const shouldFillFullHorizontalSpace = growToFit ?? false;
|
|
20
21
|
const isColumnSizingForFullHorizontalSpace = shouldFillFullHorizontalSpace && !shouldAdaptSizeToCellContent;
|
|
22
|
+
const { containerWidth } = usePivotTableSizing();
|
|
21
23
|
const getAgGridColumns = useGetAgGridColumns();
|
|
22
24
|
const updateAgGridColumnDefs = useUpdateAgGridColumnDefs();
|
|
23
25
|
const initColumnWidths = useCallback((params) => {
|
|
@@ -41,7 +43,10 @@ export function useColumnSizingForFullHorizontalSpace() {
|
|
|
41
43
|
if (updatedColDefs) {
|
|
42
44
|
updateAgGridColumnDefs(updatedColDefs, params.api);
|
|
43
45
|
}
|
|
44
|
-
|
|
46
|
+
if (containerWidth > 0) {
|
|
47
|
+
gridSizingStateRef.current.isSized = true;
|
|
48
|
+
}
|
|
49
|
+
}, [containerWidth, getAgGridColumns, gridSizingStateRef, updateAgGridColumnDefs]);
|
|
45
50
|
return isColumnSizingForFullHorizontalSpace
|
|
46
51
|
? {
|
|
47
52
|
autoSizeStrategy,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type IGridSizingState } from "../../types/internal.js";
|
|
1
3
|
/**
|
|
2
4
|
* Returns column sizing props for ag-grid when grid should fit full horizontal space (growToFit) and adapt size to cell content (autoresizeAll or viewport).
|
|
3
5
|
* It keeps ratio of the cell/header content in responsive context.
|
|
4
6
|
*
|
|
5
7
|
* @internal
|
|
6
8
|
*/
|
|
7
|
-
export declare function useColumnSizingForFullHorizontalSpaceAndAutoResize(): {
|
|
9
|
+
export declare function useColumnSizingForFullHorizontalSpaceAndAutoResize(gridSizingStateRef: RefObject<IGridSizingState>): {
|
|
8
10
|
autoSizeStrategy: import("ag-grid-community").AutoSizeStrategy | undefined;
|
|
9
11
|
initColumnWidths: (event: import("ag-grid-community").ColumnResizedEvent<import("../../types/internal.js").AgGridRowData, any>) => void;
|
|
10
12
|
} | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useColumnSizingForFullHorizontalSpaceAndAutoResize.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/resizing/useColumnSizingForFullHorizontalSpaceAndAutoResize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useColumnSizingForFullHorizontalSpaceAndAutoResize.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/resizing/useColumnSizingForFullHorizontalSpaceAndAutoResize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAKpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAShE;;;;;GAKG;AACH,wBAAgB,kDAAkD,CAC9D,kBAAkB,EAAE,SAAS,CAAC,gBAAgB,CAAC;;;SAmElD"}
|
|
@@ -14,7 +14,7 @@ const autoSizeStrategy = {
|
|
|
14
14
|
*
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
|
-
export function useColumnSizingForFullHorizontalSpaceAndAutoResize() {
|
|
17
|
+
export function useColumnSizingForFullHorizontalSpaceAndAutoResize(gridSizingStateRef) {
|
|
18
18
|
const { config } = usePivotTableProps();
|
|
19
19
|
const { columnSizing } = config;
|
|
20
20
|
const { defaultWidth, growToFit } = columnSizing;
|
|
@@ -56,7 +56,8 @@ export function useColumnSizingForFullHorizontalSpaceAndAutoResize() {
|
|
|
56
56
|
if (updatedColDefs) {
|
|
57
57
|
updateAgGridColumnDefs(updatedColDefs, params.api);
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
gridSizingStateRef.current.isSized = true;
|
|
60
|
+
}, [containerWidth, getAgGridColumns, gridSizingStateRef, updateAgGridColumnDefs]);
|
|
60
61
|
return isColumnSizingForGrowToFitAndAutoResize
|
|
61
62
|
? {
|
|
62
63
|
autoSizeStrategy,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
1
2
|
import { type AgGridProps } from "../../types/agGrid.js";
|
|
3
|
+
import { type IGridSizingState } from "../../types/internal.js";
|
|
2
4
|
/**
|
|
3
5
|
* Returns ag-grid props with column sizing applied.
|
|
4
6
|
*
|
|
5
7
|
* @internal
|
|
6
8
|
*/
|
|
7
|
-
export declare function useColumnSizingProps(): (agGridReactProps: AgGridProps) => AgGridProps;
|
|
9
|
+
export declare function useColumnSizingProps(gridSizingStateRef: RefObject<IGridSizingState>): (agGridReactProps: AgGridProps) => AgGridProps;
|
|
8
10
|
//# sourceMappingURL=useColumnSizingProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useColumnSizingProps.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/resizing/useColumnSizingProps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useColumnSizingProps.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/resizing/useColumnSizingProps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAIpD,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAShE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAChC,kBAAkB,EAAE,SAAS,CAAC,gBAAgB,CAAC,GAChD,CAAC,gBAAgB,EAAE,WAAW,KAAK,WAAW,CA2ChD"}
|
|
@@ -12,12 +12,12 @@ import { useSyncColumnWidths } from "./useSyncColumnWidths.js";
|
|
|
12
12
|
*
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
|
-
export function useColumnSizingProps() {
|
|
15
|
+
export function useColumnSizingProps(gridSizingStateRef) {
|
|
16
16
|
const { initSyncColumnWidths } = useSyncColumnWidths();
|
|
17
17
|
const { handleManualResize } = useManualResize();
|
|
18
18
|
const columnSizingForAutoResize = useColumnSizingForAutoResize();
|
|
19
|
-
const columnSizingForFullHorizontalSpace = useColumnSizingForFullHorizontalSpace();
|
|
20
|
-
const columnSizingForFullHorizontalSpaceAndAutoResize = useColumnSizingForFullHorizontalSpaceAndAutoResize();
|
|
19
|
+
const columnSizingForFullHorizontalSpace = useColumnSizingForFullHorizontalSpace(gridSizingStateRef);
|
|
20
|
+
const columnSizingForFullHorizontalSpaceAndAutoResize = useColumnSizingForFullHorizontalSpaceAndAutoResize(gridSizingStateRef);
|
|
21
21
|
const columnSizingForDefault = useColumnSizingDefault();
|
|
22
22
|
const columnSizingProps = columnSizingForAutoResize ??
|
|
23
23
|
columnSizingForFullHorizontalSpace ??
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitialAutoResizeVisibility.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/resizing/useInitialAutoResizeVisibility.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useInitialAutoResizeVisibility.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/resizing/useInitialAutoResizeVisibility.ts"],"names":[],"mappings":"AAWA,UAAU,sCAAsC;IAC5C;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAMD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,CAAC,EAAE,sCAAsC,GAAG,OAAO,CAwExG"}
|
|
@@ -4,6 +4,10 @@ import { debounce } from "lodash-es";
|
|
|
4
4
|
import { useAgGridApi } from "../../context/AgGridApiContext.js";
|
|
5
5
|
import { useCurrentDataView } from "../../context/CurrentDataViewContext.js";
|
|
6
6
|
import { usePivotTableProps } from "../../context/PivotTablePropsContext.js";
|
|
7
|
+
import { usePivotTableSizing } from "../../context/PivotTableSizingContext.js";
|
|
8
|
+
// Pivoted tables take longer to complete resize.
|
|
9
|
+
const INITIAL_SETTLE_DEBOUNCE_PIVOTED_MS = 800;
|
|
10
|
+
const INITIAL_SETTLE_DEBOUNCE_MS = 400;
|
|
7
11
|
/**
|
|
8
12
|
* Returns flag indicating whether the pivot table container is ready to be displayed without flicker.
|
|
9
13
|
* For tables without autosizing, returns true immediately as no column width calculation is needed.
|
|
@@ -14,15 +18,25 @@ export function useInitialAutoResizeVisibility(options) {
|
|
|
14
18
|
const { agGridApi } = useAgGridApi();
|
|
15
19
|
const { config, rows, columns } = usePivotTableProps();
|
|
16
20
|
const { currentDataView } = useCurrentDataView();
|
|
21
|
+
const { containerWidth, resizeOnShowCount } = usePivotTableSizing();
|
|
17
22
|
const { growToFit, defaultWidth } = config.columnSizing;
|
|
18
23
|
const [readyForPaint, setReadyForPaint] = useState(false);
|
|
19
24
|
const onReadyCalledRef = useRef(false);
|
|
25
|
+
const [previousResizeOnShowCount, setPreviousResizeOnShowCount] = useState(resizeOnShowCount);
|
|
26
|
+
// Adjusted during render, not in the effect below, so React discards this commit before paint
|
|
27
|
+
// instead of briefly showing stale readyForPaint=true alongside the columns being re-sized on show.
|
|
28
|
+
if (resizeOnShowCount !== previousResizeOnShowCount) {
|
|
29
|
+
setPreviousResizeOnShowCount(resizeOnShowCount);
|
|
30
|
+
if (containerWidth > 0 && readyForPaint) {
|
|
31
|
+
setReadyForPaint(false);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
20
34
|
useEffect(() => {
|
|
21
35
|
const isCellSizing = defaultWidth === "autoresizeAll" || defaultWidth === "viewport";
|
|
22
36
|
const isGridSizing = growToFit;
|
|
23
37
|
const needsResize = isCellSizing || isGridSizing;
|
|
24
|
-
const debounceTime = columns.length > 0 ?
|
|
25
|
-
if (!agGridApi) {
|
|
38
|
+
const debounceTime = columns.length > 0 ? INITIAL_SETTLE_DEBOUNCE_PIVOTED_MS : INITIAL_SETTLE_DEBOUNCE_MS;
|
|
39
|
+
if (!agGridApi || containerWidth <= 0) {
|
|
26
40
|
return;
|
|
27
41
|
}
|
|
28
42
|
const markReady = () => {
|
|
@@ -49,6 +63,16 @@ export function useInitialAutoResizeVisibility(options) {
|
|
|
49
63
|
agGridApi.removeEventListener("virtualColumnsChanged", setIsReadyForPaint);
|
|
50
64
|
agGridApi.removeEventListener("columnResized", setIsReadyForPaint);
|
|
51
65
|
};
|
|
52
|
-
}, [
|
|
66
|
+
}, [
|
|
67
|
+
agGridApi,
|
|
68
|
+
defaultWidth,
|
|
69
|
+
growToFit,
|
|
70
|
+
readyForPaint,
|
|
71
|
+
currentDataView,
|
|
72
|
+
containerWidth,
|
|
73
|
+
columns,
|
|
74
|
+
rows,
|
|
75
|
+
options,
|
|
76
|
+
]);
|
|
53
77
|
return readyForPaint;
|
|
54
78
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type AgGridProps } from "../../types/agGrid.js";
|
|
3
|
+
import { type IGridSizingState } from "../../types/internal.js";
|
|
4
|
+
/**
|
|
5
|
+
* Returns ag-grid props enhanced with a `gridSizeChanged` handler that keeps `PivotTableSizingContext`'s
|
|
6
|
+
* `containerWidth` in sync with the grid width, and applies growToFit sizing when the grid's container
|
|
7
|
+
* transitions from zero to a positive width (e.g. an inactive Visualization Switcher tab becoming active)
|
|
8
|
+
* while this grid instance has not been sized at a positive width yet, retrying once first data renders
|
|
9
|
+
* if needed. Once sized, flex columns follow the container width on their own, so later re-shows skip it.
|
|
10
|
+
* It signals `markResizeOnShow` whenever such a re-show triggers a resize, either growToFit sizing here or
|
|
11
|
+
* virtual column auto-resize of columns that come into view unsized.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function useResizeOnGridSizeChanged(processedColumnsRef: RefObject<Set<string>>, gridSizingStateRef: RefObject<IGridSizingState>): (agGridReactProps: AgGridProps) => AgGridProps;
|
|
16
|
+
//# sourceMappingURL=useResizeOnGridSizeChanged.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizeOnGridSizeChanged.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/resizing/useResizeOnGridSizeChanged.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAkC,MAAM,OAAO,CAAC;AAcvE,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACtC,mBAAmB,EAAE,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAC3C,kBAAkB,EAAE,SAAS,CAAC,gBAAgB,CAAC,GAChD,CAAC,gBAAgB,EAAE,WAAW,KAAK,WAAW,CAuGhD"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
3
|
+
import { usePivotTableProps } from "../../context/PivotTablePropsContext.js";
|
|
4
|
+
import { usePivotTableSizingActions } from "../../context/PivotTableSizingContext.js";
|
|
5
|
+
import { agGridAutoSizeAllColumns, agGridAutosizeColumnsToFit, } from "../../features/resizing/agGridColumnSizingApi.js";
|
|
6
|
+
import { getColumnsPendingAutoResize, getColumnsWithinViewport, } from "../../features/resizing/getColumnsPendingAutoResize.js";
|
|
7
|
+
/**
|
|
8
|
+
* Returns ag-grid props enhanced with a `gridSizeChanged` handler that keeps `PivotTableSizingContext`'s
|
|
9
|
+
* `containerWidth` in sync with the grid width, and applies growToFit sizing when the grid's container
|
|
10
|
+
* transitions from zero to a positive width (e.g. an inactive Visualization Switcher tab becoming active)
|
|
11
|
+
* while this grid instance has not been sized at a positive width yet, retrying once first data renders
|
|
12
|
+
* if needed. Once sized, flex columns follow the container width on their own, so later re-shows skip it.
|
|
13
|
+
* It signals `markResizeOnShow` whenever such a re-show triggers a resize, either growToFit sizing here or
|
|
14
|
+
* virtual column auto-resize of columns that come into view unsized.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export function useResizeOnGridSizeChanged(processedColumnsRef, gridSizingStateRef) {
|
|
19
|
+
const { config } = usePivotTableProps();
|
|
20
|
+
const { setContainerWidth, markResizeOnShow } = usePivotTableSizingActions();
|
|
21
|
+
const { growToFit, defaultWidth } = config.columnSizing;
|
|
22
|
+
const shouldAdaptSizeToCellContent = defaultWidth === "autoresizeAll" || defaultWidth === "viewport";
|
|
23
|
+
const lastWidthRef = useRef(null);
|
|
24
|
+
const cancelPendingRetryRef = useRef(null);
|
|
25
|
+
const applyGrowToFit = useCallback((api) => {
|
|
26
|
+
if (shouldAdaptSizeToCellContent) {
|
|
27
|
+
agGridAutoSizeAllColumns(api);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
agGridAutosizeColumnsToFit(api);
|
|
31
|
+
}
|
|
32
|
+
}, [shouldAdaptSizeToCellContent]);
|
|
33
|
+
const handleGridSizeChanged = useCallback((event) => {
|
|
34
|
+
const previousWidth = lastWidthRef.current;
|
|
35
|
+
lastWidthRef.current = event.clientWidth;
|
|
36
|
+
if (previousWidth !== event.clientWidth) {
|
|
37
|
+
setContainerWidth(event.clientWidth);
|
|
38
|
+
}
|
|
39
|
+
const becameHidden = previousWidth !== null && previousWidth > 0 && event.clientWidth <= 0;
|
|
40
|
+
const becameVisible = previousWidth === 0 && event.clientWidth > 0;
|
|
41
|
+
if (becameHidden || becameVisible) {
|
|
42
|
+
cancelPendingRetryRef.current?.();
|
|
43
|
+
cancelPendingRetryRef.current = null;
|
|
44
|
+
}
|
|
45
|
+
if (!becameVisible) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (!growToFit || gridSizingStateRef.current.isSized) {
|
|
49
|
+
if (shouldAdaptSizeToCellContent &&
|
|
50
|
+
getColumnsPendingAutoResize(getColumnsWithinViewport(event.api, event.clientWidth), processedColumnsRef.current).length > 0) {
|
|
51
|
+
markResizeOnShow();
|
|
52
|
+
}
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
markResizeOnShow();
|
|
56
|
+
if (!gridSizingStateRef.current.hasRenderedFirstData) {
|
|
57
|
+
const api = event.api;
|
|
58
|
+
const retry = () => {
|
|
59
|
+
api.removeEventListener("firstDataRendered", retry);
|
|
60
|
+
cancelPendingRetryRef.current = null;
|
|
61
|
+
applyGrowToFit(api);
|
|
62
|
+
};
|
|
63
|
+
api.addEventListener("firstDataRendered", retry);
|
|
64
|
+
cancelPendingRetryRef.current = () => api.removeEventListener("firstDataRendered", retry);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
applyGrowToFit(event.api);
|
|
68
|
+
}, [
|
|
69
|
+
growToFit,
|
|
70
|
+
shouldAdaptSizeToCellContent,
|
|
71
|
+
setContainerWidth,
|
|
72
|
+
markResizeOnShow,
|
|
73
|
+
applyGrowToFit,
|
|
74
|
+
processedColumnsRef,
|
|
75
|
+
gridSizingStateRef,
|
|
76
|
+
]);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
return () => {
|
|
79
|
+
cancelPendingRetryRef.current?.();
|
|
80
|
+
cancelPendingRetryRef.current = null;
|
|
81
|
+
};
|
|
82
|
+
}, [handleGridSizeChanged]);
|
|
83
|
+
return useCallback((agGridReactProps) => {
|
|
84
|
+
return {
|
|
85
|
+
...agGridReactProps,
|
|
86
|
+
onGridSizeChanged: (event) => {
|
|
87
|
+
agGridReactProps.onGridSizeChanged?.(event);
|
|
88
|
+
handleGridSizeChanged(event);
|
|
89
|
+
},
|
|
90
|
+
onFirstDataRendered: (event) => {
|
|
91
|
+
gridSizingStateRef.current.hasRenderedFirstData = true;
|
|
92
|
+
agGridReactProps.onFirstDataRendered?.(event);
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}, [handleGridSizeChanged, gridSizingStateRef]);
|
|
96
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
1
2
|
import { type AgGridProps } from "../../types/agGrid.js";
|
|
2
3
|
/**
|
|
3
4
|
* Returns ag-grid props with virtual column auto resize applied.
|
|
@@ -8,5 +9,5 @@ import { type AgGridProps } from "../../types/agGrid.js";
|
|
|
8
9
|
*
|
|
9
10
|
* @internal
|
|
10
11
|
*/
|
|
11
|
-
export declare function useVirtualColumnAutoResize(): (agGridReactProps: AgGridProps) => AgGridProps;
|
|
12
|
+
export declare function useVirtualColumnAutoResize(processedColumnsRef: RefObject<Set<string>>): (agGridReactProps: AgGridProps) => AgGridProps;
|
|
12
13
|
//# sourceMappingURL=useVirtualColumnAutoResize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVirtualColumnAutoResize.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/resizing/useVirtualColumnAutoResize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useVirtualColumnAutoResize.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/resizing/useVirtualColumnAutoResize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAS5D,OAAO,EAGH,KAAK,WAAW,EACnB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACtC,mBAAmB,EAAE,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAC5C,CAAC,gBAAgB,EAAE,WAAW,KAAK,WAAW,CAyDhD"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// (C) 2025 GoodData Corporation
|
|
1
|
+
// (C) 2025-2026 GoodData Corporation
|
|
2
2
|
import { useCallback, useRef } from "react";
|
|
3
3
|
import { debounce } from "lodash-es";
|
|
4
4
|
import { usePrevious } from "@gooddata/sdk-ui";
|
|
5
5
|
import { usePivotTableProps } from "../../context/PivotTablePropsContext.js";
|
|
6
|
+
import { getColumnsPendingAutoResize } from "../../features/resizing/getColumnsPendingAutoResize.js";
|
|
6
7
|
/**
|
|
7
8
|
* Returns ag-grid props with virtual column auto resize applied.
|
|
8
9
|
*
|
|
@@ -12,12 +13,11 @@ import { usePivotTableProps } from "../../context/PivotTablePropsContext.js";
|
|
|
12
13
|
*
|
|
13
14
|
* @internal
|
|
14
15
|
*/
|
|
15
|
-
export function useVirtualColumnAutoResize() {
|
|
16
|
+
export function useVirtualColumnAutoResize(processedColumnsRef) {
|
|
16
17
|
const { config } = usePivotTableProps();
|
|
17
18
|
const { columnSizing, columnHeadersPosition } = config;
|
|
18
19
|
const { defaultWidth } = columnSizing;
|
|
19
20
|
const shouldAutoResizeDisplayedColumns = defaultWidth === "autoresizeAll" || defaultWidth === "viewport";
|
|
20
|
-
const processedColumnsRef = useRef(new Set());
|
|
21
21
|
const previousColumnHeadersPosition = usePrevious(columnHeadersPosition);
|
|
22
22
|
// Avoid skipping columns autosize on column headers position change
|
|
23
23
|
if (columnHeadersPosition !== previousColumnHeadersPosition) {
|
|
@@ -27,8 +27,7 @@ export function useVirtualColumnAutoResize() {
|
|
|
27
27
|
if (columns.length > 0) {
|
|
28
28
|
// Only auto-size columns that haven't been processed yet, help with lagging a bit
|
|
29
29
|
// Also skip columns that have a width set as it may be fixed by column config
|
|
30
|
-
const newColumns = columns
|
|
31
|
-
(col.getColDef().width === undefined || col.getColDef().width === null));
|
|
30
|
+
const newColumns = getColumnsPendingAutoResize(columns, processedColumnsRef.current);
|
|
32
31
|
if (newColumns.length > 0) {
|
|
33
32
|
api.autoSizeColumns(newColumns, false);
|
|
34
33
|
// Mark columns as processed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgGridReactProps.d.ts","sourceRoot":"","sources":["../../../src/next/hooks/useAgGridReactProps.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"useAgGridReactProps.d.ts","sourceRoot":"","sources":["../../../src/next/hooks/useAgGridReactProps.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAwBtD;;;;GAIG;AACH,wBAAgB,mBAAmB,gBAwElC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// (C) 2025-2026 GoodData Corporation
|
|
2
|
-
import { useMemo } from "react";
|
|
2
|
+
import { useMemo, useRef } from "react";
|
|
3
3
|
import { AG_GRID_DEFAULT_PROPS } from "../constants/agGridDefaultProps.js";
|
|
4
4
|
import { useColumnSizingProps } from "./resizing/useColumnSizingProps.js";
|
|
5
|
+
import { useResizeOnGridSizeChanged } from "./resizing/useResizeOnGridSizeChanged.js";
|
|
5
6
|
import { useVirtualColumnAutoResize } from "./resizing/useVirtualColumnAutoResize.js";
|
|
6
7
|
import { useAccessibilityModeProps } from "./useAccessibilityProps.js";
|
|
7
8
|
import { useAfterRenderCallback } from "./useAfterRenderCallback.js";
|
|
@@ -30,7 +31,8 @@ export function useAgGridReactProps() {
|
|
|
30
31
|
const enhanceWithServerSideRowModel = useDataLoadingProps();
|
|
31
32
|
const enhanceWithColumnDefs = useColumnDefsProps();
|
|
32
33
|
const enhanceWithPivoting = usePivotingProps();
|
|
33
|
-
const
|
|
34
|
+
const gridSizingStateRef = useRef({ hasRenderedFirstData: false, isSized: false });
|
|
35
|
+
const enhanceWithColumnSizing = useColumnSizingProps(gridSizingStateRef);
|
|
34
36
|
const enhanceWithSorting = useSortingProps();
|
|
35
37
|
const enhanceWithInteractions = useInteractionProps();
|
|
36
38
|
const enhanceWithCellSelection = useCellSelectionProps();
|
|
@@ -43,7 +45,9 @@ export function useAgGridReactProps() {
|
|
|
43
45
|
const enhanceWithTheme = useThemeProps();
|
|
44
46
|
const enhanceWithHeaderComponents = useHeaderComponents();
|
|
45
47
|
const enhanceWithAfterRender = useAfterRenderCallback();
|
|
46
|
-
const
|
|
48
|
+
const autoResizedColumnsRef = useRef(new Set());
|
|
49
|
+
const enhanceWithVirtualColumnAutoResize = useVirtualColumnAutoResize(autoResizedColumnsRef);
|
|
50
|
+
const enhanceWithResizeOnGridSizeChanged = useResizeOnGridSizeChanged(autoResizedColumnsRef, gridSizingStateRef);
|
|
47
51
|
const enhanceWithFocusManagement = useFocusManagementProps();
|
|
48
52
|
return useMemo(() => {
|
|
49
53
|
return [
|
|
@@ -65,6 +69,7 @@ export function useAgGridReactProps() {
|
|
|
65
69
|
enhanceWithHeaderComponents,
|
|
66
70
|
enhanceWithAfterRender,
|
|
67
71
|
enhanceWithVirtualColumnAutoResize,
|
|
72
|
+
enhanceWithResizeOnGridSizeChanged,
|
|
68
73
|
enhanceWithFocusManagement,
|
|
69
74
|
].reduce((acc, fn) => fn(acc), AG_GRID_DEFAULT_PROPS);
|
|
70
75
|
}, [
|
|
@@ -86,6 +91,7 @@ export function useAgGridReactProps() {
|
|
|
86
91
|
enhanceWithHeaderComponents,
|
|
87
92
|
enhanceWithAfterRender,
|
|
88
93
|
enhanceWithVirtualColumnAutoResize,
|
|
94
|
+
enhanceWithResizeOnGridSizeChanged,
|
|
89
95
|
enhanceWithFocusManagement,
|
|
90
96
|
]);
|
|
91
97
|
}
|
|
@@ -55,4 +55,11 @@ export interface IPivotTableNextResolvedProps extends Omit<IPivotTableNextProps,
|
|
|
55
55
|
sortBy?: ISortItem[];
|
|
56
56
|
totals?: ITotal[];
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export interface IGridSizingState {
|
|
62
|
+
hasRenderedFirstData: boolean;
|
|
63
|
+
isSized: boolean;
|
|
64
|
+
}
|
|
58
65
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/next/types/internal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EACH,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,MAAM,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG;IACxB,eAAe,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE,CAAC;IACtD,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,4BAA4B,GAC/D,uBAAuB,GAAG;IACtB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEN;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,sBAAsB,EAAE,gBAAgB,CAAC;IACzC,eAAe,EAAE,cAAc,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB,EAAE,qBAAqB;CAAG;AAEzG;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC1C,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,CAAC;CAC3C;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA6B,SAAQ,IAAI,CACtD,oBAAoB,EACpB,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CACpE;IACG,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB"}
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/next/types/internal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EACH,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,MAAM,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG;IACxB,eAAe,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE,CAAC;IACtD,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,4BAA4B,GAC/D,uBAAuB,GAAG;IACtB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEN;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,sBAAsB,EAAE,gBAAgB,CAAC;IACzC,eAAe,EAAE,cAAc,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB,EAAE,qBAAqB;CAAG;AAEzG;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC1C,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,CAAC;CAC3C;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA6B,SAAQ,IAAI,CACtD,oBAAoB,EACpB,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CACpE;IACG,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;CACpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-pivot",
|
|
3
|
-
"version": "11.60.0
|
|
3
|
+
"version": "11.60.0",
|
|
4
4
|
"description": "GoodData.UI SDK - Pivot Table",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"ts-invariant": "0.10.3",
|
|
43
43
|
"tslib": "2.8.1",
|
|
44
44
|
"uuid": "11.1.1",
|
|
45
|
-
"@gooddata/sdk-backend-spi": "11.60.0
|
|
46
|
-
"@gooddata/sdk-model": "11.60.0
|
|
47
|
-
"@gooddata/sdk-ui-kit": "11.60.0
|
|
48
|
-
"@gooddata/sdk-ui
|
|
49
|
-
"@gooddata/sdk-ui": "11.60.0
|
|
50
|
-
"@gooddata/sdk-ui-vis-commons": "11.60.0
|
|
45
|
+
"@gooddata/sdk-backend-spi": "11.60.0",
|
|
46
|
+
"@gooddata/sdk-model": "11.60.0",
|
|
47
|
+
"@gooddata/sdk-ui-kit": "11.60.0",
|
|
48
|
+
"@gooddata/sdk-ui": "11.60.0",
|
|
49
|
+
"@gooddata/sdk-ui-theme-provider": "11.60.0",
|
|
50
|
+
"@gooddata/sdk-ui-vis-commons": "11.60.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@microsoft/api-documenter": "7.30.16",
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
"typescript": "7.0.2",
|
|
86
86
|
"vitest": "4.1.11",
|
|
87
87
|
"vitest-dom": "0.1.1",
|
|
88
|
-
"@gooddata/
|
|
89
|
-
"@gooddata/
|
|
90
|
-
"@gooddata/reference-workspace": "11.60.0
|
|
91
|
-
"@gooddata/sdk-backend-
|
|
92
|
-
"@gooddata/sdk-backend-
|
|
93
|
-
"@gooddata/stylelint-config": "11.60.0
|
|
88
|
+
"@gooddata/eslint-config": "11.60.0",
|
|
89
|
+
"@gooddata/oxlint-config": "11.60.0",
|
|
90
|
+
"@gooddata/reference-workspace": "11.60.0",
|
|
91
|
+
"@gooddata/sdk-backend-mockingbird": "11.60.0",
|
|
92
|
+
"@gooddata/sdk-backend-base": "11.60.0",
|
|
93
|
+
"@gooddata/stylelint-config": "11.60.0"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
96
|
"react": "^18.0.0 || ^19.0.0",
|