@gooddata/sdk-ui-pivot 11.65.0 → 11.66.0-alpha.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/CorePivotTable.d.ts.map +1 -1
- package/esm/CorePivotTable.js +4 -6
- package/esm/impl/eventHandlers/aggregationEventHandlers.d.ts +1 -2
- package/esm/impl/eventHandlers/aggregationEventHandlers.d.ts.map +1 -1
- package/esm/impl/eventHandlers/aggregationEventHandlers.js +3 -4
- package/esm/impl/eventHandlers/sortingEventHandlers.d.ts +2 -2
- package/esm/impl/eventHandlers/sortingEventHandlers.d.ts.map +1 -1
- package/esm/impl/eventHandlers/sortingEventHandlers.js +3 -6
- package/esm/impl/gridOptions.d.ts.map +1 -1
- package/esm/impl/gridOptions.js +1 -0
- package/esm/impl/structure/headers/AggregationsMenu.d.ts +3 -2
- package/esm/impl/structure/headers/AggregationsMenu.d.ts.map +1 -1
- package/esm/impl/structure/headers/AggregationsMenu.js +9 -3
- package/esm/impl/structure/headers/AggregationsSubMenu.d.ts +4 -2
- package/esm/impl/structure/headers/AggregationsSubMenu.d.ts.map +1 -1
- package/esm/impl/structure/headers/AggregationsSubMenu.js +2 -2
- package/esm/impl/structure/headers/AggregationsSubMenuItems.d.ts +4 -2
- package/esm/impl/structure/headers/AggregationsSubMenuItems.d.ts.map +1 -1
- package/esm/impl/structure/headers/AggregationsSubMenuItems.js +23 -11
- package/esm/impl/structure/headers/ColumnGroupHeader.d.ts +1 -1
- package/esm/impl/structure/headers/ColumnGroupHeader.d.ts.map +1 -1
- package/esm/impl/structure/headers/ColumnGroupHeader.js +2 -2
- package/esm/impl/structure/headers/ColumnHeader.d.ts.map +1 -1
- package/esm/impl/structure/headers/ColumnHeader.js +1 -1
- package/esm/impl/structure/headers/ColumnTotalHeader.d.ts +1 -1
- package/esm/impl/structure/headers/ColumnTotalHeader.d.ts.map +1 -1
- package/esm/impl/structure/headers/ColumnTotalHeader.js +2 -2
- package/esm/impl/structure/headers/HeaderCell.d.ts +3 -2
- package/esm/impl/structure/headers/HeaderCell.d.ts.map +1 -1
- package/esm/impl/structure/headers/HeaderCell.js +3 -2
- package/esm/impl/utils.d.ts +3 -8
- package/esm/impl/utils.d.ts.map +1 -1
- package/esm/impl/utils.js +5 -13
- package/esm/locales.d.ts.map +1 -1
- package/esm/locales.js +1 -0
- package/esm/next/components/Header/HeaderCell/HeaderMenuComponents.d.ts.map +1 -1
- package/esm/next/components/Header/HeaderCell/HeaderMenuComponents.js +2 -0
- package/esm/next/components/Header/utils/constructAggregationsMenuItems.d.ts +4 -2
- package/esm/next/components/Header/utils/constructAggregationsMenuItems.d.ts.map +1 -1
- package/esm/next/components/Header/utils/constructAggregationsMenuItems.js +23 -4
- package/esm/next/hooks/header/useHeaderMenuAggregations.d.ts.map +1 -1
- package/esm/next/hooks/header/useHeaderMenuAggregations.js +6 -3
- package/esm/next/hooks/totals/useUpdateTotals.d.ts.map +1 -1
- package/esm/next/hooks/totals/useUpdateTotals.js +9 -27
- package/esm/next/types/menu.d.ts +2 -0
- package/esm/next/types/menu.d.ts.map +1 -1
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CorePivotTable.d.ts","sourceRoot":"","sources":["../src/CorePivotTable.tsx"],"names":[],"mappings":"AAyEA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AA2E7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8GG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"CorePivotTable.d.ts","sourceRoot":"","sources":["../src/CorePivotTable.tsx"],"names":[],"mappings":"AAyEA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AA2E7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8GG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,2CA2+B/D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,oBAAoB,2CAQzD"}
|
package/esm/CorePivotTable.js
CHANGED
|
@@ -29,7 +29,7 @@ import { HeightCalculationManager } from "./impl/height/heightCalculationManager
|
|
|
29
29
|
import { StickyRowManager } from "./impl/stickyRow/stickyRowManager.js";
|
|
30
30
|
import { TableFacadeInitializer } from "./impl/tableFacadeInitializer.js";
|
|
31
31
|
import { ComponentUpdateAnalyzer } from "./impl/updates/componentUpdateAnalyzer.js";
|
|
32
|
-
import {
|
|
32
|
+
import { getTotalsForAttributeBucket, getTotalsForColumnsBucket } from "./impl/utils.js";
|
|
33
33
|
import { InternalTableState } from "./tableState.js";
|
|
34
34
|
// Register all Community features
|
|
35
35
|
ModuleRegistry.registerModules([AllCommunityModule]);
|
|
@@ -192,7 +192,7 @@ export function CorePivotTableAgImpl(props) {
|
|
|
192
192
|
const { execution, config } = resolvedProps;
|
|
193
193
|
return {
|
|
194
194
|
readyToRender: false,
|
|
195
|
-
columnTotals: cloneDeep(
|
|
195
|
+
columnTotals: cloneDeep(getTotalsForAttributeBucket(execution.definition)),
|
|
196
196
|
rowTotals: getTotalsForColumnsBucket(execution.definition),
|
|
197
197
|
desiredHeight: config.maxHeight,
|
|
198
198
|
resized: false,
|
|
@@ -594,13 +594,12 @@ export function CorePivotTableAgImpl(props) {
|
|
|
594
594
|
}),
|
|
595
595
|
sortingEventHandlers: new SortingEventHandlers({
|
|
596
596
|
internal,
|
|
597
|
-
|
|
597
|
+
getColumnTotals,
|
|
598
598
|
pushDataGuard,
|
|
599
599
|
setState,
|
|
600
600
|
}),
|
|
601
601
|
aggregationEventHandlers: new AggregationEventHandlers({
|
|
602
602
|
internal,
|
|
603
|
-
getExecutionDefinition,
|
|
604
603
|
getColumnTotals,
|
|
605
604
|
getRowTotals,
|
|
606
605
|
pushDataGuard,
|
|
@@ -617,7 +616,6 @@ export function CorePivotTableAgImpl(props) {
|
|
|
617
616
|
}, [
|
|
618
617
|
autoresizeColumns,
|
|
619
618
|
getColumnTotals,
|
|
620
|
-
getExecutionDefinition,
|
|
621
619
|
getGroupRows,
|
|
622
620
|
getLastSortedColId,
|
|
623
621
|
getResizingConfig,
|
|
@@ -728,7 +726,7 @@ export function CorePivotTableAgImpl(props) {
|
|
|
728
726
|
const reinitialize = useCallback((execution) => {
|
|
729
727
|
setState({
|
|
730
728
|
readyToRender: false,
|
|
731
|
-
columnTotals: cloneDeep(
|
|
729
|
+
columnTotals: cloneDeep(getTotalsForAttributeBucket(execution.definition)),
|
|
732
730
|
rowTotals: getTotalsForColumnsBucket(execution.definition),
|
|
733
731
|
error: undefined,
|
|
734
732
|
desiredHeight: propsRef.current.config.maxHeight,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ITotal } from "@gooddata/sdk-model";
|
|
2
2
|
import { type IPushData } from "@gooddata/sdk-ui";
|
|
3
3
|
import { type InternalTableState } from "../../tableState.js";
|
|
4
4
|
import { type IMenuAggregationClickConfig } from "../privateTypes.js";
|
|
5
5
|
export interface IAggregationEventHandlerContext {
|
|
6
6
|
internal: InternalTableState;
|
|
7
|
-
getExecutionDefinition: () => IExecutionDefinition;
|
|
8
7
|
getColumnTotals: () => ITotal[];
|
|
9
8
|
getRowTotals: () => ITotal[];
|
|
10
9
|
pushDataGuard: (data: IPushData) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregationEventHandlers.d.ts","sourceRoot":"","sources":["../../../src/impl/eventHandlers/aggregationEventHandlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aggregationEventHandlers.d.ts","sourceRoot":"","sources":["../../../src/impl/eventHandlers/aggregationEventHandlers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAGtE,MAAM,WAAW,+BAA+B;IAC5C,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,eAAe,EAAE,MAAM,MAAM,EAAE,CAAC;IAChC,YAAY,EAAE,MAAM,MAAM,EAAE,CAAC;IAC7B,aAAa,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CACzD;AAED,qBAAa,wBAAwB;IACrB,OAAO,CAAC,OAAO;IAA3B,YAAoB,OAAO,EAAE,+BAA+B,EAAI;IAEzD,sBAAsB,+BAAgC,2BAA2B,KAAG,IAAI,CAmC7F;CACL"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
+
// (C) 2007-2026 GoodData Corporation
|
|
1
2
|
import { BucketNames } from "@gooddata/sdk-ui";
|
|
2
3
|
import { getUpdatedColumnOrRowTotals } from "../structure/headers/aggregationsMenuHelper.js";
|
|
3
|
-
import { sanitizeDefTotals } from "../utils.js";
|
|
4
4
|
export class AggregationEventHandlers {
|
|
5
5
|
context;
|
|
6
6
|
constructor(context) {
|
|
7
7
|
this.context = context;
|
|
8
8
|
}
|
|
9
9
|
onMenuAggregationClick = (menuAggregationClickConfig) => {
|
|
10
|
-
const { internal,
|
|
11
|
-
const sortItems = internal.table?.getSortItems();
|
|
10
|
+
const { internal, getColumnTotals, getRowTotals, pushDataGuard, setState } = this.context;
|
|
12
11
|
const { isColumn } = menuAggregationClickConfig;
|
|
13
12
|
if (isColumn) {
|
|
14
|
-
const newColumnTotals =
|
|
13
|
+
const newColumnTotals = getUpdatedColumnOrRowTotals(getColumnTotals(), menuAggregationClickConfig);
|
|
15
14
|
pushDataGuard({
|
|
16
15
|
properties: {
|
|
17
16
|
totals: newColumnTotals,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type SortChangedEvent } from "ag-grid-community";
|
|
2
|
-
import { type
|
|
2
|
+
import { type ITotal } from "@gooddata/sdk-model";
|
|
3
3
|
import { type IPushData } from "@gooddata/sdk-ui";
|
|
4
4
|
import { type InternalTableState } from "../../tableState.js";
|
|
5
5
|
export interface ISortingEventHandlerContext {
|
|
6
6
|
internal: InternalTableState;
|
|
7
|
-
|
|
7
|
+
getColumnTotals: () => ITotal[];
|
|
8
8
|
pushDataGuard: (data: IPushData) => void;
|
|
9
9
|
setState: (state: any, callback?: () => void) => void;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortingEventHandlers.d.ts","sourceRoot":"","sources":["../../../src/impl/eventHandlers/sortingEventHandlers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"sortingEventHandlers.d.ts","sourceRoot":"","sources":["../../../src/impl/eventHandlers/sortingEventHandlers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,WAAW,2BAA2B;IACxC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,eAAe,EAAE,MAAM,MAAM,EAAE,CAAC;IAChC,aAAa,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CACzD;AAED,qBAAa,oBAAoB;IACjB,OAAO,CAAC,OAAO;IAA3B,YAAoB,OAAO,EAAE,2BAA2B,EAAI;IAErD,aAAa,UAAW,gBAAgB,KAAG,IAAI,CA2BpD;CACL"}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
// (C) 2007-2026 GoodData Corporation
|
|
2
2
|
import { BucketNames } from "@gooddata/sdk-ui";
|
|
3
|
-
import { sanitizeDefTotals } from "../utils.js";
|
|
4
3
|
export class SortingEventHandlers {
|
|
5
4
|
context;
|
|
6
5
|
constructor(context) {
|
|
7
6
|
this.context = context;
|
|
8
7
|
}
|
|
9
8
|
onSortChanged = (event) => {
|
|
10
|
-
const { internal,
|
|
9
|
+
const { internal, getColumnTotals, pushDataGuard, setState } = this.context;
|
|
11
10
|
if (!internal.table) {
|
|
12
11
|
console.warn("changing sorts without prior execution cannot work");
|
|
13
12
|
return;
|
|
14
13
|
}
|
|
15
14
|
const sortItems = internal.table.createSortItems(event.api.getAllGridColumns());
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
const executionDefinition = getExecutionDefinition();
|
|
19
|
-
const totals = sanitizeDefTotals(executionDefinition, sortItems);
|
|
15
|
+
// Sorting changes subtotal visibility, but must preserve the current selection.
|
|
16
|
+
const totals = getColumnTotals();
|
|
20
17
|
// oxlint-disable-next-line eslint-js/no-console
|
|
21
18
|
console.debug("onSortChanged", sortItems);
|
|
22
19
|
pushDataGuard({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridOptions.d.ts","sourceRoot":"","sources":["../../src/impl/gridOptions.ts"],"names":[],"mappings":"AAmBA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAC1B,MAAM,mBAAmB,CAAC;AAe3B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AASpD,wBAAgB,iBAAiB,CAC7B,KAAK,EAAE,WAAW,EAClB,YAAY,EAAE,oBAAoB,GAAG,oBAAoB,GAAG,kBAAkB,EAC9E,KAAK,EAAE,QAAQ,CAAC,4BAA4B,CAAC,GAC9C,kBAAkB,
|
|
1
|
+
{"version":3,"file":"gridOptions.d.ts","sourceRoot":"","sources":["../../src/impl/gridOptions.ts"],"names":[],"mappings":"AAmBA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAC1B,MAAM,mBAAmB,CAAC;AAe3B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AASpD,wBAAgB,iBAAiB,CAC7B,KAAK,EAAE,WAAW,EAClB,YAAY,EAAE,oBAAoB,GAAG,oBAAoB,GAAG,kBAAkB,EAC9E,KAAK,EAAE,QAAQ,CAAC,4BAA4B,CAAC,GAC9C,kBAAkB,CA8IpB"}
|
package/esm/impl/gridOptions.js
CHANGED
|
@@ -38,6 +38,7 @@ export function createGridOptions(table, tableMethods, props) {
|
|
|
38
38
|
onMenuAggregationClick: tableMethods.onMenuAggregationClick,
|
|
39
39
|
getTableDescriptor: () => table.tableDescriptor,
|
|
40
40
|
getExecutionDefinition: tableMethods.getExecutionDefinition,
|
|
41
|
+
getSortItems: table.getSortItems,
|
|
41
42
|
getColumnTotals: tableMethods.getColumnTotals,
|
|
42
43
|
getRowTotals: tableMethods.getRowTotals,
|
|
43
44
|
intl: props.intl,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IntlShape } from "react-intl";
|
|
2
|
-
import { type IExecutionDefinition, type ITheme, type ITotal, type TotalType } from "@gooddata/sdk-model";
|
|
2
|
+
import { type IExecutionDefinition, type ISortItem, type ITheme, type ITotal, type TotalType } from "@gooddata/sdk-model";
|
|
3
3
|
import { type IOnOpenedChangeParams } from "@gooddata/sdk-ui-kit";
|
|
4
4
|
import { type IMenuAggregationClickConfig } from "../../privateTypes.js";
|
|
5
5
|
import { type TableDescriptor } from "../tableDescriptor.js";
|
|
@@ -13,11 +13,12 @@ export interface IAggregationsMenuProps {
|
|
|
13
13
|
colId: string;
|
|
14
14
|
getTableDescriptor: () => TableDescriptor;
|
|
15
15
|
getExecutionDefinition: () => IExecutionDefinition;
|
|
16
|
+
getSortItems?: () => ISortItem[];
|
|
16
17
|
getColumnTotals?: () => ITotal[];
|
|
17
18
|
getRowTotals?: () => ITotal[];
|
|
18
19
|
onAggregationSelect: (clickConfig: IMenuAggregationClickConfig) => void;
|
|
19
20
|
onMenuOpenedChange: ({ opened, source }: IOnOpenedChangeParams) => void;
|
|
20
21
|
theme?: ITheme;
|
|
21
22
|
}
|
|
22
|
-
export declare function AggregationsMenu({ intl, colId, getTableDescriptor, isMenuOpened, onMenuOpenedChange, showColumnsSubMenu, isMenuButtonVisible, getColumnTotals, getRowTotals, getExecutionDefinition, onAggregationSelect, showSubmenu, availableTotalTypes, }: IAggregationsMenuProps): import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
export declare function AggregationsMenu({ intl, colId, getTableDescriptor, isMenuOpened, onMenuOpenedChange, showColumnsSubMenu, isMenuButtonVisible, getColumnTotals, getRowTotals, getExecutionDefinition, getSortItems, onAggregationSelect, showSubmenu, availableTotalTypes, }: IAggregationsMenuProps): import("react/jsx-runtime").JSX.Element | null;
|
|
23
24
|
//# sourceMappingURL=AggregationsMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregationsMenu.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/AggregationsMenu.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAEH,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"AggregationsMenu.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/AggregationsMenu.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAEH,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,SAAS,EAKjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIH,KAAK,qBAAqB,EAK7B,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAyB7D,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,SAAS,EAAE,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,eAAe,CAAC;IAC1C,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;IACnD,YAAY,CAAC,EAAE,MAAM,SAAS,EAAE,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,mBAAmB,EAAE,CAAC,WAAW,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACxE,kBAAkB,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD,wBAAgB,gBAAgB,CAAC,EAC7B,IAAI,EACJ,KAAK,EACL,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,mBAAmB,GACtB,EAAE,sBAAsB,kDAqOxB"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2019-2026 GoodData Corporation
|
|
3
3
|
import { useCallback } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import { hasMeasureValueFilterConditions, isMeasureValueFilter, isRankingFilter, } from "@gooddata/sdk-model";
|
|
5
|
+
import { hasMeasureValueFilterConditions, isMeasureSort, isMeasureValueFilter, isRankingFilter, } from "@gooddata/sdk-model";
|
|
6
6
|
import { Bubble, BubbleHoverTrigger, Header, IconBurgerMenu, Item, ItemsWrapper, Menu, } from "@gooddata/sdk-ui-kit";
|
|
7
7
|
import { useTheme } from "@gooddata/sdk-ui-theme-provider";
|
|
8
8
|
import { messages } from "../../../locales.js";
|
|
@@ -20,7 +20,11 @@ function MenuToggler() {
|
|
|
20
20
|
const theme = useTheme();
|
|
21
21
|
return (_jsx("div", { className: "menu-icon", children: _jsx(IconBurgerMenu, { color: theme?.palette?.complementary?.c8 }) }));
|
|
22
22
|
}
|
|
23
|
-
export function AggregationsMenu({ intl, colId, getTableDescriptor, isMenuOpened, onMenuOpenedChange, showColumnsSubMenu, isMenuButtonVisible, getColumnTotals, getRowTotals, getExecutionDefinition, onAggregationSelect, showSubmenu, availableTotalTypes, }) {
|
|
23
|
+
export function AggregationsMenu({ intl, colId, getTableDescriptor, isMenuOpened, onMenuOpenedChange, showColumnsSubMenu, isMenuButtonVisible, getColumnTotals, getRowTotals, getExecutionDefinition, getSortItems, onAggregationSelect, showSubmenu, availableTotalTypes, }) {
|
|
24
|
+
const isMetricSorted = (getSortItems?.() ?? getExecutionDefinition().sortBy).some(isMeasureSort);
|
|
25
|
+
const rowSubtotalTooltip = isMetricSorted
|
|
26
|
+
? intl.formatMessage(messages["disabled.measureSort"])
|
|
27
|
+
: undefined;
|
|
24
28
|
const getColumnTotalsWrapper = (measureLocalIdentifiers, isGroupedHeader, ignoreMeasures) => {
|
|
25
29
|
const columnTotals = getColumnTotals?.() ?? [];
|
|
26
30
|
if (isGroupedHeader) {
|
|
@@ -73,10 +77,12 @@ export function AggregationsMenu({ intl, colId, getTableDescriptor, isMenuOpened
|
|
|
73
77
|
const tooltipMessage = disabled ? intl.formatMessage(cause) : undefined;
|
|
74
78
|
const renderSubmenu = !disabled && showSubmenu;
|
|
75
79
|
const toggler = renderMenuItemContent(totalType, isSelected, renderSubmenu, disabled, tooltipMessage);
|
|
76
|
-
return (_jsx("div", { className: itemClassNames, children: renderSubmenu ? (_jsx(AggregationsSubMenu, { intl: intl, totalType: totalType, rowAttributeDescriptors: rowAttributeDescriptors, columnAttributeDescriptors: columnAttributeDescriptors, columnTotals: columnTotals, rowTotals: rowTotals, measureLocalIdentifiers: measureLocalIdentifiers, onAggregationSelect: onAggregationSelect, toggler: toggler, showColumnsSubMenu: showColumnsSubMenu })) : (toggler) }, totalType));
|
|
80
|
+
return (_jsx("div", { className: itemClassNames, children: renderSubmenu ? (_jsx(AggregationsSubMenu, { intl: intl, totalType: totalType, rowAttributeDescriptors: rowAttributeDescriptors, columnAttributeDescriptors: columnAttributeDescriptors, columnTotals: columnTotals, rowSubtotalTooltip: rowSubtotalTooltip, existingRowTotals: getColumnTotals?.(), rowTotals: rowTotals, measureLocalIdentifiers: measureLocalIdentifiers, onAggregationSelect: onAggregationSelect, toggler: toggler, showColumnsSubMenu: showColumnsSubMenu })) : (toggler) }, totalType));
|
|
77
81
|
});
|
|
78
82
|
}, [
|
|
79
83
|
availableTotalTypes,
|
|
84
|
+
rowSubtotalTooltip,
|
|
85
|
+
getColumnTotals,
|
|
80
86
|
getItemClassNames,
|
|
81
87
|
intl,
|
|
82
88
|
isTableFilteredByMeasureValue,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
2
|
import { type IntlShape } from "react-intl";
|
|
3
|
-
import { type IAttributeDescriptor, type TotalType } from "@gooddata/sdk-model";
|
|
3
|
+
import { type IAttributeDescriptor, type ITotal, type TotalType } from "@gooddata/sdk-model";
|
|
4
4
|
import { type IMenuAggregationClickConfig } from "../../privateTypes.js";
|
|
5
5
|
import { type IColumnTotal } from "./aggregationsMenuTypes.js";
|
|
6
6
|
export interface IAggregationsSubMenuProps {
|
|
@@ -12,9 +12,11 @@ export interface IAggregationsSubMenuProps {
|
|
|
12
12
|
columnAttributeDescriptors: IAttributeDescriptor[];
|
|
13
13
|
measureLocalIdentifiers: string[];
|
|
14
14
|
columnTotals: IColumnTotal[];
|
|
15
|
+
rowSubtotalTooltip?: string;
|
|
16
|
+
existingRowTotals?: ITotal[];
|
|
15
17
|
rowTotals: IColumnTotal[];
|
|
16
18
|
showColumnsSubMenu: boolean;
|
|
17
19
|
onAggregationSelect: (clickConfig: IMenuAggregationClickConfig) => void;
|
|
18
20
|
}
|
|
19
|
-
export declare function AggregationsSubMenu({ intl, totalType, toggler, isMenuOpened, rowAttributeDescriptors, columnAttributeDescriptors, measureLocalIdentifiers, columnTotals, rowTotals, showColumnsSubMenu, onAggregationSelect, }: IAggregationsSubMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function AggregationsSubMenu({ intl, totalType, toggler, isMenuOpened, rowAttributeDescriptors, columnAttributeDescriptors, measureLocalIdentifiers, columnTotals, rowSubtotalTooltip, existingRowTotals, rowTotals, showColumnsSubMenu, onAggregationSelect, }: IAggregationsSubMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
//# sourceMappingURL=AggregationsSubMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregationsSubMenu.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/AggregationsSubMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"AggregationsSubMenu.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/AggregationsSubMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAG7F,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAGzE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAO/D,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,YAAY,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uBAAuB,EAAE,oBAAoB,EAAE,CAAC;IAChD,0BAA0B,EAAE,oBAAoB,EAAE,CAAC;IACnD,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,CAAC,WAAW,EAAE,2BAA2B,KAAK,IAAI,CAAC;CAC3E;AAED,wBAAgB,mBAAmB,CAAC,EAChC,IAAI,EACJ,SAAS,EACT,OAAO,EACP,YAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC1B,uBAAuB,EACvB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,mBAAmB,GACtB,EAAE,yBAAyB,2CAqD3B"}
|
|
@@ -6,12 +6,12 @@ import { AggregationsSubMenuItems } from "./AggregationsSubMenuItems.js";
|
|
|
6
6
|
import { ColumnsHeaderIcon } from "./subMenuIcons/ColumnsIcon.js";
|
|
7
7
|
import { RowsHeaderIcon } from "./subMenuIcons/RowsIcon.js";
|
|
8
8
|
const MENU_HEADER_OFFSET = -36;
|
|
9
|
-
export function AggregationsSubMenu({ intl, totalType, toggler, isMenuOpened = false, rowAttributeDescriptors, columnAttributeDescriptors, measureLocalIdentifiers, columnTotals, rowTotals, showColumnsSubMenu, onAggregationSelect, }) {
|
|
9
|
+
export function AggregationsSubMenu({ intl, totalType, toggler, isMenuOpened = false, rowAttributeDescriptors, columnAttributeDescriptors, measureLocalIdentifiers, columnTotals, rowSubtotalTooltip, existingRowTotals, rowTotals, showColumnsSubMenu, onAggregationSelect, }) {
|
|
10
10
|
const menuOpenedProp = isMenuOpened ? { opened: true } : {};
|
|
11
11
|
const shouldRenderSeparator = tableHasRowAttributes(rowAttributeDescriptors) &&
|
|
12
12
|
tableHasColumnAttributes(columnAttributeDescriptors) &&
|
|
13
13
|
showColumnsSubMenu;
|
|
14
|
-
return (_jsx(SubMenu, { toggler: toggler, offset: MENU_HEADER_OFFSET, ...menuOpenedProp, children: _jsx(ItemsWrapper, { children: _jsxs("div", { className: "gd-aggregation-submenu s-table-header-submenu-content", children: [tableHasRowAttributes(rowAttributeDescriptors) ? (_jsx(AggregationsSubMenuItems, { intl: intl, attributeDescriptors: rowAttributeDescriptors, measureLocalIdentifiers: measureLocalIdentifiers, totalType: totalType, totals: columnTotals, isColumn: true, icon: _jsx(RowsHeaderIcon, {}), headerText: intl.formatMessage({
|
|
14
|
+
return (_jsx(SubMenu, { toggler: toggler, offset: MENU_HEADER_OFFSET, ...menuOpenedProp, children: _jsx(ItemsWrapper, { children: _jsxs("div", { className: "gd-aggregation-submenu s-table-header-submenu-content", children: [tableHasRowAttributes(rowAttributeDescriptors) ? (_jsx(AggregationsSubMenuItems, { intl: intl, attributeDescriptors: rowAttributeDescriptors, measureLocalIdentifiers: measureLocalIdentifiers, totalType: totalType, totals: columnTotals, subtotalTooltip: rowSubtotalTooltip, existingTotals: existingRowTotals, isColumn: true, icon: _jsx(RowsHeaderIcon, {}), headerText: intl.formatMessage({
|
|
15
15
|
id: "visualizations.menu.aggregations.rows",
|
|
16
16
|
}), onAggregationSelect: onAggregationSelect })) : null, _jsx("div", { className: cx("s-table-header-submenu-rows-separator", {
|
|
17
17
|
"gd-aggregation-submenu-rows-separator": shouldRenderSeparator,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
2
|
import { type IntlShape } from "react-intl";
|
|
3
|
-
import { type IAttributeDescriptor, type TotalType } from "@gooddata/sdk-model";
|
|
3
|
+
import { type IAttributeDescriptor, type ITotal, type TotalType } from "@gooddata/sdk-model";
|
|
4
4
|
import { type IMenuAggregationClickConfig } from "../../privateTypes.js";
|
|
5
5
|
import { type IColumnTotal } from "./aggregationsMenuTypes.js";
|
|
6
6
|
interface IAggregationsSubMenuItemsProps {
|
|
@@ -9,11 +9,13 @@ interface IAggregationsSubMenuItemsProps {
|
|
|
9
9
|
totalType: TotalType;
|
|
10
10
|
measureLocalIdentifiers: string[];
|
|
11
11
|
totals: IColumnTotal[];
|
|
12
|
+
subtotalTooltip?: string;
|
|
13
|
+
existingTotals?: ITotal[];
|
|
12
14
|
isColumn: boolean;
|
|
13
15
|
icon: ReactElement;
|
|
14
16
|
headerText: string;
|
|
15
17
|
onAggregationSelect: (clickConfig: IMenuAggregationClickConfig) => void;
|
|
16
18
|
}
|
|
17
|
-
export declare function AggregationsSubMenuItems({ attributeDescriptors, measureLocalIdentifiers, intl, totalType, totals, isColumn, icon, headerText, onAggregationSelect, }: IAggregationsSubMenuItemsProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function AggregationsSubMenuItems({ attributeDescriptors, measureLocalIdentifiers, intl, totalType, totals, subtotalTooltip, existingTotals, isColumn, icon, headerText, onAggregationSelect, }: IAggregationsSubMenuItemsProps): import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
export {};
|
|
19
21
|
//# sourceMappingURL=AggregationsSubMenuItems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregationsSubMenuItems.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/AggregationsSubMenuItems.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAGjB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAGzE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,UAAU,8BAA8B;IACpC,IAAI,EAAE,SAAS,CAAC;IAChB,oBAAoB,EAAE,oBAAoB,EAAE,CAAC;IAC7C,SAAS,EAAE,SAAS,CAAC;IACrB,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,CAAC,WAAW,EAAE,2BAA2B,KAAK,IAAI,CAAC;CAC3E;AA+BD,wBAAgB,wBAAwB,CAAC,EACrC,oBAAoB,EACpB,uBAAuB,EACvB,IAAI,EACJ,SAAS,EACT,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,mBAAmB,GACtB,EAAE,8BAA8B,
|
|
1
|
+
{"version":3,"file":"AggregationsSubMenuItems.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/AggregationsSubMenuItems.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACX,KAAK,SAAS,EAGjB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAGzE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,UAAU,8BAA8B;IACpC,IAAI,EAAE,SAAS,CAAC;IAChB,oBAAoB,EAAE,oBAAoB,EAAE,CAAC;IAC7C,SAAS,EAAE,SAAS,CAAC;IACrB,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,CAAC,WAAW,EAAE,2BAA2B,KAAK,IAAI,CAAC;CAC3E;AA+BD,wBAAgB,wBAAwB,CAAC,EACrC,oBAAoB,EACpB,uBAAuB,EACvB,IAAI,EACJ,SAAS,EACT,MAAM,EACN,eAAe,EACf,cAAc,EACd,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,mBAAmB,GACtB,EAAE,8BAA8B,2CAqEhC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { attributeDescriptorLocalId, attributeDescriptorName, } from "@gooddata/sdk-model";
|
|
4
|
-
import { Header, Item } from "@gooddata/sdk-ui-kit";
|
|
4
|
+
import { Bubble, BubbleHoverTrigger, Header, Item } from "@gooddata/sdk-ui-kit";
|
|
5
5
|
import { isTotalEnabledForSubMenuAttribute } from "./aggregationsMenuHelper.js";
|
|
6
6
|
const getPreviousAttributeName = (rowAttributeDescriptors, attributeHeaderIndex) => {
|
|
7
7
|
return attributeDescriptorName(rowAttributeDescriptors[attributeHeaderIndex - 1]);
|
|
@@ -22,23 +22,35 @@ const getSubtotalNameTestClass = (attributeLocalIdentifier) => {
|
|
|
22
22
|
const attributeClass = attributeLocalIdentifier.replace(/\./g, "-");
|
|
23
23
|
return `s-aggregation-item-${attributeClass}`;
|
|
24
24
|
};
|
|
25
|
-
export function AggregationsSubMenuItems({ attributeDescriptors, measureLocalIdentifiers, intl, totalType, totals, isColumn, icon, headerText, onAggregationSelect, }) {
|
|
25
|
+
export function AggregationsSubMenuItems({ attributeDescriptors, measureLocalIdentifiers, intl, totalType, totals, subtotalTooltip, existingTotals, isColumn, icon, headerText, onAggregationSelect, }) {
|
|
26
26
|
const attributeItems = attributeDescriptors.map((_attributeDescriptor, headerIndex) => {
|
|
27
27
|
const attributeLocalIdentifier = attributeDescriptorLocalId(attributeDescriptors[headerIndex]);
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
const tooltip = headerIndex > 0 ? subtotalTooltip : undefined;
|
|
29
|
+
const isSelected = tooltip
|
|
30
|
+
? (existingTotals ?? []).some((total) => total.attributeIdentifier === attributeLocalIdentifier &&
|
|
31
|
+
total.type === totalType &&
|
|
32
|
+
measureLocalIdentifiers.includes(total.measureIdentifier))
|
|
33
|
+
: isTotalEnabledForSubMenuAttribute(attributeLocalIdentifier, totalType, totals);
|
|
34
|
+
const isDisabled = !!tooltip && !isSelected;
|
|
35
|
+
const onClick = () => {
|
|
36
|
+
if (isDisabled) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
onAggregationSelect({
|
|
40
|
+
type: totalType,
|
|
41
|
+
measureIdentifiers: measureLocalIdentifiers,
|
|
42
|
+
include: !isSelected,
|
|
43
|
+
attributeIdentifier: attributeLocalIdentifier,
|
|
44
|
+
isColumn,
|
|
45
|
+
});
|
|
46
|
+
};
|
|
36
47
|
const attributeName = getAttributeName(intl, attributeDescriptors, headerIndex, isColumn);
|
|
37
|
-
|
|
48
|
+
const item = (_jsx(Item, { checked: isSelected, disabled: isDisabled, children: _jsx("div", { onClick: onClick, className: cx("gd-aggregation-menu-item-inner", "s-menu-aggregation-inner", getSubtotalNameTestClass(attributeLocalIdentifier), {
|
|
38
49
|
"s-menu-aggregation-inner-selected": isSelected,
|
|
39
50
|
"s-menu-aggregation-inner-column": !isColumn,
|
|
40
51
|
"s-menu-aggregation-inner-row": isColumn,
|
|
41
52
|
}), children: attributeName }) }, attributeLocalIdentifier));
|
|
53
|
+
return tooltip ? (_jsxs(BubbleHoverTrigger, { showDelay: 200, hideDelay: 0, children: [item, _jsx(Bubble, { className: "bubble-primary", alignPoints: [{ align: "bc tc" }], children: tooltip })] }, attributeLocalIdentifier)) : (item);
|
|
42
54
|
});
|
|
43
55
|
return (_jsxs(_Fragment, { children: [_jsxs(Header, { children: [icon, _jsx("span", { children: headerText })] }), attributeItems] }));
|
|
44
56
|
}
|
|
@@ -4,5 +4,5 @@ import { type ICommonHeaderParams } from "./HeaderCell.js";
|
|
|
4
4
|
export interface IProps extends ICommonHeaderParams, IHeaderGroupParams {
|
|
5
5
|
menu?: () => IMenu;
|
|
6
6
|
}
|
|
7
|
-
export declare function ColumnGroupHeader({ menu, columnGroup, intl, getTableDescriptor, displayName, onMenuAggregationClick, getExecutionDefinition, getColumnTotals, getRowTotals, }: IProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function ColumnGroupHeader({ menu, columnGroup, intl, getTableDescriptor, displayName, onMenuAggregationClick, getExecutionDefinition, getSortItems, getColumnTotals, getRowTotals, }: IProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=ColumnGroupHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnGroupHeader.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/ColumnGroupHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEnF,MAAM,WAAW,MAAO,SAAQ,mBAAmB,EAAE,kBAAkB;IACnE,IAAI,CAAC,EAAE,MAAM,KAAK,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,WAAW,EACX,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,YAAY,GACf,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ColumnGroupHeader.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/ColumnGroupHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEnF,MAAM,WAAW,MAAO,SAAQ,mBAAmB,EAAE,kBAAkB;IACnE,IAAI,CAAC,EAAE,MAAM,KAAK,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,WAAW,EACX,sBAAsB,EACtB,sBAAsB,EACtB,YAAY,EACZ,eAAe,EACf,YAAY,GACf,EAAE,MAAM,2CA4BR"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { agColId } from "../tableDescriptorTypes.js";
|
|
3
3
|
import { ALIGN_LEFT, HeaderCell } from "./HeaderCell.js";
|
|
4
|
-
export function ColumnGroupHeader({ menu, columnGroup, intl, getTableDescriptor, displayName, onMenuAggregationClick, getExecutionDefinition, getColumnTotals, getRowTotals, }) {
|
|
4
|
+
export function ColumnGroupHeader({ menu, columnGroup, intl, getTableDescriptor, displayName, onMenuAggregationClick, getExecutionDefinition, getSortItems, getColumnTotals, getRowTotals, }) {
|
|
5
5
|
const colGroupDef = columnGroup.getColGroupDef();
|
|
6
6
|
const colId = agColId(colGroupDef);
|
|
7
7
|
const parent = columnGroup.getParent();
|
|
@@ -9,5 +9,5 @@ export function ColumnGroupHeader({ menu, columnGroup, intl, getTableDescriptor,
|
|
|
9
9
|
// and also do not show when table is transposed => handled in rows
|
|
10
10
|
const isTransposed = getTableDescriptor().isTransposed();
|
|
11
11
|
const showMenu = !!parent && !!colGroupDef.headerName && !isTransposed;
|
|
12
|
-
return (_jsx(HeaderCell, { className: "s-pivot-table-column-group-header", displayText: displayName, enableSorting: false, menuPosition: ALIGN_LEFT, textAlign: ALIGN_LEFT, menu: showMenu ? menu?.() : undefined, onMenuAggregationClick: onMenuAggregationClick, colId: colId, getTableDescriptor: getTableDescriptor, getExecutionDefinition: getExecutionDefinition, getColumnTotals: getColumnTotals, getRowTotals: getRowTotals, intl: intl }));
|
|
12
|
+
return (_jsx(HeaderCell, { className: "s-pivot-table-column-group-header", displayText: displayName, enableSorting: false, menuPosition: ALIGN_LEFT, textAlign: ALIGN_LEFT, menu: showMenu ? menu?.() : undefined, onMenuAggregationClick: onMenuAggregationClick, colId: colId, getTableDescriptor: getTableDescriptor, getExecutionDefinition: getExecutionDefinition, getSortItems: getSortItems, getColumnTotals: getColumnTotals, getRowTotals: getRowTotals, intl: intl }));
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnHeader.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/ColumnHeader.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlG,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AASrD,OAAO,EAAuC,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEhG,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB,EAAE,aAAa;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,KAAK,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IAC/B,OAAO,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ColumnHeader.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/ColumnHeader.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlG,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AASrD,OAAO,EAAuC,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEhG,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB,EAAE,aAAa;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,KAAK,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IAC/B,OAAO,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,kBAAkB,2CA6IrD"}
|
|
@@ -95,5 +95,5 @@ export function ColumnHeader(props) {
|
|
|
95
95
|
}, [eGridHeader, column, isSortingEnabled, setLastSortedColId, showMenu, onSortRequested]);
|
|
96
96
|
const firstSortOrder = column.getColDef().sortingOrder?.[0];
|
|
97
97
|
const defaultSortDirection = firstSortOrder === "asc" || firstSortOrder === "desc" ? firstSortOrder : undefined;
|
|
98
|
-
return (_jsx(HeaderCell, { className: cx("s-pivot-table-column-header", className), textAlign: textAlign, displayText: displayName, enableSorting: isSortingEnabled, sortDirection: sorting, defaultSortDirection: defaultSortDirection, onSortClick: onSortRequested, onMenuAggregationClick: props.onMenuAggregationClick, menu: showMenu ? menu?.() : undefined, colId: column.getColDef().field, getTableDescriptor: getTableDescriptor, getExecutionDefinition: props.getExecutionDefinition, getColumnTotals: props.getColumnTotals, getRowTotals: props.getRowTotals, intl: props.intl, isFocused: isFocused }));
|
|
98
|
+
return (_jsx(HeaderCell, { className: cx("s-pivot-table-column-header", className), textAlign: textAlign, displayText: displayName, enableSorting: isSortingEnabled, sortDirection: sorting, defaultSortDirection: defaultSortDirection, onSortClick: onSortRequested, onMenuAggregationClick: props.onMenuAggregationClick, menu: showMenu ? menu?.() : undefined, colId: column.getColDef().field, getTableDescriptor: getTableDescriptor, getExecutionDefinition: props.getExecutionDefinition, getSortItems: props.getSortItems, getColumnTotals: props.getColumnTotals, getRowTotals: props.getRowTotals, intl: props.intl, isFocused: isFocused }));
|
|
99
99
|
}
|
|
@@ -4,5 +4,5 @@ import { type ICommonHeaderParams } from "./HeaderCell.js";
|
|
|
4
4
|
export interface IColumnHeaderProps extends ICommonHeaderParams, IHeaderParams {
|
|
5
5
|
menu?: () => IMenu;
|
|
6
6
|
}
|
|
7
|
-
export declare function ColumnTotalHeader({ getTableDescriptor, getExecutionDefinition, getColumnTotals, getRowTotals, displayName, column, intl, }: IColumnHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function ColumnTotalHeader({ getTableDescriptor, getExecutionDefinition, getSortItems, getColumnTotals, getRowTotals, displayName, column, intl, }: IColumnHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=ColumnTotalHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnTotalHeader.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/ColumnTotalHeader.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAuC,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEhG,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB,EAAE,aAAa;IAC1E,IAAI,CAAC,EAAE,MAAM,KAAK,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,MAAM,EACN,IAAI,GACP,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ColumnTotalHeader.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/ColumnTotalHeader.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAuC,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEhG,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB,EAAE,aAAa;IAC1E,IAAI,CAAC,EAAE,MAAM,KAAK,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,WAAW,EACX,MAAM,EACN,IAAI,GACP,EAAE,kBAAkB,2CAuBpB"}
|
|
@@ -3,11 +3,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useCallback } from "react";
|
|
4
4
|
import { isEmptyScopeCol, isSliceCol } from "../tableDescriptorTypes.js";
|
|
5
5
|
import { ALIGN_LEFT, ALIGN_RIGHT, HeaderCell } from "./HeaderCell.js";
|
|
6
|
-
export function ColumnTotalHeader({ getTableDescriptor, getExecutionDefinition, getColumnTotals, getRowTotals, displayName, column, intl, }) {
|
|
6
|
+
export function ColumnTotalHeader({ getTableDescriptor, getExecutionDefinition, getSortItems, getColumnTotals, getRowTotals, displayName, column, intl, }) {
|
|
7
7
|
const getColDescriptor = useCallback(() => {
|
|
8
8
|
return getTableDescriptor().getCol(column);
|
|
9
9
|
}, [column, getTableDescriptor]);
|
|
10
10
|
const col = getColDescriptor();
|
|
11
11
|
const textAlign = isSliceCol(col) || isEmptyScopeCol(col) ? ALIGN_LEFT : ALIGN_RIGHT;
|
|
12
|
-
return (_jsx(HeaderCell, { className: "gd-pivot-table-column-total-header s-pivot-table-column-total-header", textAlign: textAlign, displayText: displayName, enableSorting: false, colId: column.getColDef().field, getTableDescriptor: getTableDescriptor, getExecutionDefinition: getExecutionDefinition, getColumnTotals: getColumnTotals, getRowTotals: getRowTotals, intl: intl }));
|
|
12
|
+
return (_jsx(HeaderCell, { className: "gd-pivot-table-column-total-header s-pivot-table-column-total-header", textAlign: textAlign, displayText: displayName, enableSorting: false, colId: column.getColDef().field, getTableDescriptor: getTableDescriptor, getExecutionDefinition: getExecutionDefinition, getSortItems: getSortItems, getColumnTotals: getColumnTotals, getRowTotals: getRowTotals, intl: intl }));
|
|
13
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IntlShape } from "react-intl";
|
|
2
|
-
import { type IExecutionDefinition, type ITotal, type SortDirection } from "@gooddata/sdk-model";
|
|
2
|
+
import { type IExecutionDefinition, type ISortItem, type ITotal, type SortDirection } from "@gooddata/sdk-model";
|
|
3
3
|
import { type IMenu } from "../../../publicTypes.js";
|
|
4
4
|
import { type IMenuAggregationClickConfig } from "../../privateTypes.js";
|
|
5
5
|
import { type TableDescriptor } from "../tableDescriptor.js";
|
|
@@ -10,6 +10,7 @@ export interface ICommonHeaderParams {
|
|
|
10
10
|
getTableDescriptor: () => TableDescriptor;
|
|
11
11
|
onMenuAggregationClick?: (config: IMenuAggregationClickConfig) => void;
|
|
12
12
|
getExecutionDefinition?: () => IExecutionDefinition;
|
|
13
|
+
getSortItems?: () => ISortItem[];
|
|
13
14
|
getColumnTotals?: () => ITotal[];
|
|
14
15
|
getRowTotals?: () => ITotal[];
|
|
15
16
|
intl?: IntlShape;
|
|
@@ -28,5 +29,5 @@ export interface IHeaderCellProps extends ICommonHeaderParams {
|
|
|
28
29
|
colId?: string;
|
|
29
30
|
isFocused?: boolean;
|
|
30
31
|
}
|
|
31
|
-
export declare function HeaderCell({ sortDirection, textAlign, menuPosition, menu, enableSorting, onMenuAggregationClick, onSortClick, displayText, className, defaultSortDirection, intl, colId, getTableDescriptor, getExecutionDefinition, getColumnTotals, getRowTotals, isFocused, }: IHeaderCellProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function HeaderCell({ sortDirection, textAlign, menuPosition, menu, enableSorting, onMenuAggregationClick, onSortClick, displayText, className, defaultSortDirection, intl, colId, getTableDescriptor, getExecutionDefinition, getSortItems, getColumnTotals, getRowTotals, isFocused, }: IHeaderCellProps): import("react/jsx-runtime").JSX.Element;
|
|
32
33
|
//# sourceMappingURL=HeaderCell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderCell.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/HeaderCell.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,
|
|
1
|
+
{"version":3,"file":"HeaderCell.d.ts","sourceRoot":"","sources":["../../../../src/impl/structure/headers/HeaderCell.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,aAAa,EACrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AACzD,eAAO,MAAM,UAAU,SAAS,CAAC;AACjC,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,MAAM,WAAW,mBAAmB;IAChC,kBAAkB,EAAE,MAAM,eAAe,CAAC;IAC1C,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACvE,sBAAsB,CAAC,EAAE,MAAM,oBAAoB,CAAC;IACpD,YAAY,CAAC,EAAE,MAAM,SAAS,EAAE,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACvD;AAED,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,aAAa,CAAC;IACrC,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,EACvB,aAAoB,EACpB,SAAsB,EACtB,YAAyB,EACzB,IAAW,EACX,aAAqB,EACrB,sBAAmC,EACnC,WAAwB,EACxB,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,IAAI,EACJ,KAAK,EACL,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,SAAS,GACZ,EAAE,gBAAgB,2CA+MlB"}
|
|
@@ -6,7 +6,7 @@ import { AVAILABLE_TOTALS, HEADER_LABEL_CLASS } from "../../base/constants.js";
|
|
|
6
6
|
import { AggregationsMenu } from "./AggregationsMenu.js";
|
|
7
7
|
export const ALIGN_LEFT = "left";
|
|
8
8
|
export const ALIGN_RIGHT = "right";
|
|
9
|
-
export function HeaderCell({ sortDirection = null, textAlign = ALIGN_LEFT, menuPosition = ALIGN_LEFT, menu = null, enableSorting = false, onMenuAggregationClick = () => null, onSortClick = () => null, displayText, className, defaultSortDirection, intl, colId, getTableDescriptor, getExecutionDefinition, getColumnTotals, getRowTotals, isFocused, }) {
|
|
9
|
+
export function HeaderCell({ sortDirection = null, textAlign = ALIGN_LEFT, menuPosition = ALIGN_LEFT, menu = null, enableSorting = false, onMenuAggregationClick = () => null, onSortClick = () => null, displayText, className, defaultSortDirection, intl, colId, getTableDescriptor, getExecutionDefinition, getSortItems, getColumnTotals, getRowTotals, isFocused, }) {
|
|
10
10
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
11
11
|
const [isMenuButtonVisible, setIsMenuButtonVisible] = useState(false);
|
|
12
12
|
const [currentSortDirection, setCurrentSortDirection] = useState(null);
|
|
@@ -75,11 +75,12 @@ export function HeaderCell({ sortDirection = null, textAlign = ALIGN_LEFT, menuP
|
|
|
75
75
|
if (!menu?.aggregations) {
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
|
-
return (_jsx(AggregationsMenu, { intl: intl, colId: colId, isMenuOpened: isMenuOpen, isMenuButtonVisible: isMenuButtonVisible, showSubmenu: menu.aggregations ?? false, showColumnsSubMenu: menu.aggregationsSubMenuForRows ?? false, availableTotalTypes: menu.aggregationTypes ?? AVAILABLE_TOTALS, getTableDescriptor: getTableDescriptor, getExecutionDefinition: getExecutionDefinition, getColumnTotals: getColumnTotals, getRowTotals: getRowTotals, onMenuOpenedChange: handleMenuOpenedChange, onAggregationSelect: menuItemClick }));
|
|
78
|
+
return (_jsx(AggregationsMenu, { intl: intl, colId: colId, isMenuOpened: isMenuOpen, isMenuButtonVisible: isMenuButtonVisible, showSubmenu: menu.aggregations ?? false, showColumnsSubMenu: menu.aggregationsSubMenuForRows ?? false, availableTotalTypes: menu.aggregationTypes ?? AVAILABLE_TOTALS, getTableDescriptor: getTableDescriptor, getExecutionDefinition: getExecutionDefinition, getSortItems: getSortItems, getColumnTotals: getColumnTotals, getRowTotals: getRowTotals, onMenuOpenedChange: handleMenuOpenedChange, onAggregationSelect: menuItemClick }));
|
|
79
79
|
}, [
|
|
80
80
|
colId,
|
|
81
81
|
getColumnTotals,
|
|
82
82
|
getExecutionDefinition,
|
|
83
|
+
getSortItems,
|
|
83
84
|
getRowTotals,
|
|
84
85
|
getTableDescriptor,
|
|
85
86
|
handleMenuOpenedChange,
|
package/esm/impl/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IAttributeDescriptor, type IExecutionDefinition, type
|
|
1
|
+
import { type IAttributeDescriptor, type IExecutionDefinition, type ITotal } from "@gooddata/sdk-model";
|
|
2
2
|
import { type DataViewFacade } from "@gooddata/sdk-ui";
|
|
3
3
|
import { type ColumnWidthItem } from "../columnWidths.js";
|
|
4
4
|
declare function getScrollbarWidthBody(): number;
|
|
@@ -9,14 +9,9 @@ declare function getScrollbarWidthBody(): number;
|
|
|
9
9
|
export declare const getScrollbarWidth: typeof getScrollbarWidthBody;
|
|
10
10
|
export declare function sleep(delay: number): Promise<void>;
|
|
11
11
|
/**
|
|
12
|
-
* Get
|
|
13
|
-
* Use provided totals, if not given, use totals from ATTRIBUTE bucket
|
|
14
|
-
*
|
|
15
|
-
* @param definition - an execution definition to sanitize
|
|
16
|
-
* @param sortItems - a specification of the sort, if not provided definition.sortBy will be used
|
|
17
|
-
* @param totals - totals to be sanitized, if not provided ATTRIBUTE bucket totals will be used
|
|
12
|
+
* Get totals from an execution definition for the ATTRIBUTE bucket, independently of sorting.
|
|
18
13
|
*/
|
|
19
|
-
export declare function
|
|
14
|
+
export declare function getTotalsForAttributeBucket({ buckets }: IExecutionDefinition): ITotal[];
|
|
20
15
|
/**
|
|
21
16
|
* Get totals from an execution definition for COLUMNS bucket
|
|
22
17
|
*
|
package/esm/impl/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/impl/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/impl/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,MAAM,EAGd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EACH,KAAK,eAAe,EAKvB,MAAM,oBAAoB,CAAC;AAE5B,iBAAS,qBAAqB,IAAI,MAAM,CAqBvC;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,8BAA8B,CAAC;AAE7D,wBAAsB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIxD;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,OAAO,EAAE,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAGvF;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,OAAO,EAAE,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAGrF;AAED,eAAO,MAAM,qBAAqB,kBAAmB,oBAAoB,EAAE,KAAG,OAClD,CAAC;AAE7B,eAAO,MAAM,wBAAwB,qBAAsB,oBAAoB,EAAE,KAAG,OACrD,CAAC;AAEhC,eAAO,MAAM,uBAAuB,SAAU,eAAe,iPAO5D,CAAC;AAEF,eAAO,MAAM,4BAA4B,OAAQ,cAAc,sDAStD,CAAC"}
|
package/esm/impl/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// (C) 2007-
|
|
1
|
+
// (C) 2007-2026 GoodData Corporation
|
|
2
2
|
import { once } from "lodash-es";
|
|
3
|
-
import { bucketTotals, bucketsFind,
|
|
3
|
+
import { bucketTotals, bucketsFind, } from "@gooddata/sdk-model";
|
|
4
4
|
import { BucketNames } from "@gooddata/sdk-ui";
|
|
5
5
|
import { isAttributeColumnWidthItem, isMeasureColumnWidthItem, isMixedValuesColumnWidthItem, isSliceMeasureColumnWidthItem, } from "../columnWidths.js";
|
|
6
6
|
function getScrollbarWidthBody() {
|
|
@@ -31,19 +31,11 @@ export async function sleep(delay) {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Get
|
|
35
|
-
* Use provided totals, if not given, use totals from ATTRIBUTE bucket
|
|
36
|
-
*
|
|
37
|
-
* @param definition - an execution definition to sanitize
|
|
38
|
-
* @param sortItems - a specification of the sort, if not provided definition.sortBy will be used
|
|
39
|
-
* @param totals - totals to be sanitized, if not provided ATTRIBUTE bucket totals will be used
|
|
34
|
+
* Get totals from an execution definition for the ATTRIBUTE bucket, independently of sorting.
|
|
40
35
|
*/
|
|
41
|
-
export function
|
|
42
|
-
const { buckets, sortBy } = definition;
|
|
36
|
+
export function getTotalsForAttributeBucket({ buckets }) {
|
|
43
37
|
const attributeBucket = bucketsFind(buckets, BucketNames.ATTRIBUTE);
|
|
44
|
-
return attributeBucket
|
|
45
|
-
? sanitizeBucketTotals(attributeBucket, sortItems ?? sortBy, totals ?? bucketTotals(attributeBucket))
|
|
46
|
-
: [];
|
|
38
|
+
return attributeBucket ? bucketTotals(attributeBucket) : [];
|
|
47
39
|
}
|
|
48
40
|
/**
|
|
49
41
|
* Get totals from an execution definition for COLUMNS bucket
|
package/esm/locales.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../src/locales.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrD,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../src/locales.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrD,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CA+CrD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,iBAAiB,CAOlE,CAAC"}
|
package/esm/locales.js
CHANGED
|
@@ -10,6 +10,7 @@ export const messages = defineMessages({
|
|
|
10
10
|
med: { id: "visualizations.totals.dropdown.title.med" },
|
|
11
11
|
"disabled.mvf": { id: "visualizations.totals.dropdown.tooltip.nat.disabled.mvf" },
|
|
12
12
|
"disabled.ranking": { id: "visualizations.totals.dropdown.tooltip.nat.disabled.ranking" },
|
|
13
|
+
"disabled.measureSort": { id: "visualizations.totals.dropdown.tooltip.subtotal.disabled.measureSort" },
|
|
13
14
|
// Total label rename action menu / popover
|
|
14
15
|
totalLabelActions: { id: "visualizations.totals.labelActions.aria" },
|
|
15
16
|
renameTotalLabel: { id: "visualizations.totals.renameLabel.action" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderMenuComponents.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Header/HeaderCell/HeaderMenuComponents.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,YAAY,CAAC;AAErD,OAAO,EAIH,KAAK,2BAA2B,EAChC,KAAK,WAAW,EAGnB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC7B,MAAM,wBAAwB,CAAC;AAgDhC,KAAK,gBAAgB,GAAG;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,wBAAwB,GAAG;IACnC,MAAM,EAAE,SAAS,CAAC;IAClB,WAAW,EACL,wBAAwB,GACxB,qBAAqB,GACrB,gBAAgB,GAChB,gBAAgB,GAChB,IAAI,CAAC;CACd,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,2BAA2B,CAAC,wBAAwB,CAAC,2CAejG;
|
|
1
|
+
{"version":3,"file":"HeaderMenuComponents.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Header/HeaderCell/HeaderMenuComponents.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,YAAY,CAAC;AAErD,OAAO,EAIH,KAAK,2BAA2B,EAChC,KAAK,WAAW,EAGnB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC7B,MAAM,wBAAwB,CAAC;AAgDhC,KAAK,gBAAgB,GAAG;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,wBAAwB,GAAG;IACnC,MAAM,EAAE,SAAS,CAAC;IAClB,WAAW,EACL,wBAAwB,GACxB,qBAAqB,GACrB,gBAAgB,GAChB,gBAAgB,GAChB,IAAI,CAAC;CACd,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,2BAA2B,CAAC,wBAAwB,CAAC,2CAejG;AAuKD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC5B,iBAAiB,EAAE,qBAAqB,EAAE,EAC1C,iBAAiB,EAAE,qBAAqB,EAAE,EAC1C,YAAY,EAAE,gBAAgB,EAAE,EAChC,IAAI,EAAE,SAAS,GAChB,KAAK,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC,CAM9C"}
|
|
@@ -5,15 +5,17 @@ import { type IAggregationsMenuItem, type IMenu } from "../../../types/menu.js";
|
|
|
5
5
|
* Creates aggregation menu items for specified measures on a cell.
|
|
6
6
|
*
|
|
7
7
|
* @param measureIdentifiers - The identifiers of the measures
|
|
8
|
-
* @param availableTotalTypes - The available total types
|
|
9
8
|
* @param currentRowTotals - The current row totals
|
|
10
9
|
* @param currentColumnTotals - The current column totals
|
|
11
10
|
* @param rows - The rows
|
|
12
11
|
* @param columns - The columns
|
|
13
12
|
* @param rowAttributeDescriptors - The row attribute descriptors
|
|
14
13
|
* @param pivotAttributeDescriptors - The pivot attribute descriptors
|
|
14
|
+
* @param menu - The aggregation menu configuration
|
|
15
|
+
* @param intl - The localization formatter
|
|
15
16
|
* @param disabledTooltip - The disabled tooltip
|
|
17
|
+
* @param disabledRowSubtotalTooltip - Explanation for unavailable, unselected row subtotals
|
|
16
18
|
* @returns The aggregation menu items
|
|
17
19
|
*/
|
|
18
|
-
export declare const constructAggregationsMenuItems: (measureIdentifiers: string[], currentRowTotals: ITotal[], currentColumnTotals: ITotal[], rows: IAttribute[], columns: IAttribute[], rowAttributeDescriptors: IAttributeDescriptor[], pivotAttributeDescriptors: IAttributeDescriptor[], menu: IMenu, intl: IntlShape, disabledTooltip?: string) => IAggregationsMenuItem[];
|
|
20
|
+
export declare const constructAggregationsMenuItems: (measureIdentifiers: string[], currentRowTotals: ITotal[], currentColumnTotals: ITotal[], rows: IAttribute[], columns: IAttribute[], rowAttributeDescriptors: IAttributeDescriptor[], pivotAttributeDescriptors: IAttributeDescriptor[], menu: IMenu, intl: IntlShape, disabledTooltip?: string, disabledRowSubtotalTooltip?: string) => IAggregationsMenuItem[];
|
|
19
21
|
//# sourceMappingURL=constructAggregationsMenuItems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructAggregationsMenuItems.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Header/utils/constructAggregationsMenuItems.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,MAAM,EAGd,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACH,KAAK,qBAAqB,EAE1B,KAAK,KAAK,EACb,MAAM,wBAAwB,CAAC;AA+HhC
|
|
1
|
+
{"version":3,"file":"constructAggregationsMenuItems.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Header/utils/constructAggregationsMenuItems.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,MAAM,EAGd,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACH,KAAK,qBAAqB,EAE1B,KAAK,KAAK,EACb,MAAM,wBAAwB,CAAC;AA+HhC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,8BAA8B,uBACnB,MAAM,EAAE,oBACV,MAAM,EAAE,uBACL,MAAM,EAAE,QACvB,UAAU,EAAE,WACT,UAAU,EAAE,2BACI,oBAAoB,EAAE,6BACpB,oBAAoB,EAAE,QAC3C,KAAK,QACL,SAAS,oBACG,MAAM,+BACK,MAAM,KACpC,qBAAqB,EAwEvB,CAAC"}
|
|
@@ -64,7 +64,7 @@ const createOtherAttributeTotalItems = (attributes, descriptors, totalType, meas
|
|
|
64
64
|
* @param measureIdentifiers - The identifiers of the measures
|
|
65
65
|
* @param currentTotals - The current totals
|
|
66
66
|
* @param isColumn - Whether the total is for a column
|
|
67
|
-
* @param
|
|
67
|
+
* @param intl - The localization formatter
|
|
68
68
|
* @returns The aggregation menu items
|
|
69
69
|
*/
|
|
70
70
|
const constructAggregationsSubMenuItems = (mainAttribute, otherAttributes, descriptors, totalType, measureIdentifiers, currentTotals, isColumn, intl) => {
|
|
@@ -77,17 +77,19 @@ const constructAggregationsSubMenuItems = (mainAttribute, otherAttributes, descr
|
|
|
77
77
|
* Creates aggregation menu items for specified measures on a cell.
|
|
78
78
|
*
|
|
79
79
|
* @param measureIdentifiers - The identifiers of the measures
|
|
80
|
-
* @param availableTotalTypes - The available total types
|
|
81
80
|
* @param currentRowTotals - The current row totals
|
|
82
81
|
* @param currentColumnTotals - The current column totals
|
|
83
82
|
* @param rows - The rows
|
|
84
83
|
* @param columns - The columns
|
|
85
84
|
* @param rowAttributeDescriptors - The row attribute descriptors
|
|
86
85
|
* @param pivotAttributeDescriptors - The pivot attribute descriptors
|
|
86
|
+
* @param menu - The aggregation menu configuration
|
|
87
|
+
* @param intl - The localization formatter
|
|
87
88
|
* @param disabledTooltip - The disabled tooltip
|
|
89
|
+
* @param disabledRowSubtotalTooltip - Explanation for unavailable, unselected row subtotals
|
|
88
90
|
* @returns The aggregation menu items
|
|
89
91
|
*/
|
|
90
|
-
export const constructAggregationsMenuItems = (measureIdentifiers, currentRowTotals, currentColumnTotals, rows, columns, rowAttributeDescriptors, pivotAttributeDescriptors, menu, intl, disabledTooltip) => {
|
|
92
|
+
export const constructAggregationsMenuItems = (measureIdentifiers, currentRowTotals, currentColumnTotals, rows, columns, rowAttributeDescriptors, pivotAttributeDescriptors, menu, intl, disabledTooltip, disabledRowSubtotalTooltip) => {
|
|
91
93
|
// first row is the main row attribute
|
|
92
94
|
const mainRowAttribute = rows.length > 0 ? rows[0] : undefined;
|
|
93
95
|
const otherRowAttributes = rows.length > 0 ? rows.slice(1) : [];
|
|
@@ -98,7 +100,24 @@ export const constructAggregationsMenuItems = (measureIdentifiers, currentRowTot
|
|
|
98
100
|
const includeSubtotals = Boolean(menu.aggregationsSubMenu);
|
|
99
101
|
const includeColumns = Boolean(menu.aggregationsSubMenuForRows);
|
|
100
102
|
return availableTotalTypes.flatMap((totalType) => {
|
|
101
|
-
const rowItems = constructAggregationsSubMenuItems(mainRowAttribute, includeSubtotals ? otherRowAttributes : [], rowAttributeDescriptors, totalType, measureIdentifiers, currentRowTotals, false, intl)
|
|
103
|
+
const rowItems = constructAggregationsSubMenuItems(mainRowAttribute, includeSubtotals ? otherRowAttributes : [], rowAttributeDescriptors, totalType, measureIdentifiers, currentRowTotals, false, intl).map((item) => {
|
|
104
|
+
// Grand totals remain available, and existing subtotals can always be removed.
|
|
105
|
+
const isSubtotal = item.totalDefinitions.some((total) => total.attributeIdentifier !== mainRowAttribute?.attribute.localIdentifier);
|
|
106
|
+
if (!isSubtotal || !disabledRowSubtotalTooltip) {
|
|
107
|
+
return item;
|
|
108
|
+
}
|
|
109
|
+
const existingDefinitions = item.totalDefinitions.filter((definition) => currentRowTotals.some((total) => areTotalsSameDefinition(total, definition)));
|
|
110
|
+
// A group can have subtotals for only some measures. Offer removal of those definitions
|
|
111
|
+
// instead of trying to add the missing ones while metric sorting prevents subtotals.
|
|
112
|
+
return existingDefinitions.length > 0
|
|
113
|
+
? {
|
|
114
|
+
...item,
|
|
115
|
+
isActive: true,
|
|
116
|
+
totalDefinitions: existingDefinitions,
|
|
117
|
+
disabledTooltip: disabledRowSubtotalTooltip,
|
|
118
|
+
}
|
|
119
|
+
: { ...item, isDisabled: true, disabledTooltip: disabledRowSubtotalTooltip };
|
|
120
|
+
});
|
|
102
121
|
const columnItems = includeColumns
|
|
103
122
|
? constructAggregationsSubMenuItems(mainColumnAttribute, includeSubtotals ? otherColumnAttributes : [], pivotAttributeDescriptors, totalType, measureIdentifiers, currentColumnTotals, true, intl)
|
|
104
123
|
: [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeaderMenuAggregations.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/header/useHeaderMenuAggregations.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"useHeaderMenuAggregations.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/header/useHeaderMenuAggregations.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,oBAAoB,EAQ5B,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAGpE;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,uBACd,MAAM,EAAE,6BACD,oBAAoB,EAAE;;wCAyCN,wBAAwB;CAatE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2025-2026 GoodData Corporation
|
|
2
2
|
import { useIntl } from "react-intl";
|
|
3
|
-
import { hasMeasureValueFilterConditions, isMeasureValueFilter, isRankingFilter, } from "@gooddata/sdk-model";
|
|
3
|
+
import { hasMeasureValueFilterConditions, isMeasureSort, isMeasureValueFilter, isRankingFilter, } from "@gooddata/sdk-model";
|
|
4
4
|
import { BucketNames, isAttributeColumnDefinition } from "@gooddata/sdk-ui";
|
|
5
5
|
import { messages } from "../../../locales.js";
|
|
6
6
|
import { constructAggregationsMenuItems } from "../../components/Header/utils/constructAggregationsMenuItems.js";
|
|
@@ -18,7 +18,7 @@ import { useUpdateTotals } from "../totals/useUpdateTotals.js";
|
|
|
18
18
|
export const useHeaderMenuAggregations = (measureIdentifiers, pivotAttributeDescriptors) => {
|
|
19
19
|
const intl = useIntl();
|
|
20
20
|
const { currentDataView } = useCurrentDataView();
|
|
21
|
-
const { config, execution, rows, columns } = usePivotTableProps();
|
|
21
|
+
const { config, execution, rows, columns, sortBy } = usePivotTableProps();
|
|
22
22
|
const { onUpdateTotals } = useUpdateTotals();
|
|
23
23
|
const { rowTotals, columnTotals } = getTotalsFromExecutionDefinition(execution.definition);
|
|
24
24
|
const tableData = currentDataView?.data().asTable();
|
|
@@ -33,9 +33,12 @@ export const useHeaderMenuAggregations = (measureIdentifiers, pivotAttributeDesc
|
|
|
33
33
|
? intl.formatMessage(messages["disabled.ranking"])
|
|
34
34
|
: undefined;
|
|
35
35
|
const aggregationsItems = config.menu?.aggregations
|
|
36
|
-
? constructAggregationsMenuItems(measureIdentifiers, rowTotals, columnTotals, rows, columns, rowAttributeDescriptors, pivotAttributeDescriptors, config.menu, intl, disableRollupTotalTooltip)
|
|
36
|
+
? constructAggregationsMenuItems(measureIdentifiers, rowTotals, columnTotals, rows, columns, rowAttributeDescriptors, pivotAttributeDescriptors, config.menu, intl, disableRollupTotalTooltip, sortBy.some(isMeasureSort) ? intl.formatMessage(messages["disabled.measureSort"]) : undefined)
|
|
37
37
|
: [];
|
|
38
38
|
const handleAggregationsItemClick = (item) => {
|
|
39
|
+
if (item.isDisabled) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
39
42
|
const currentTotals = item.isColumn ? columnTotals : rowTotals;
|
|
40
43
|
onUpdateTotals(currentTotals, item.totalDefinitions, item.isActive, item.isColumn);
|
|
41
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdateTotals.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/totals/useUpdateTotals.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"useUpdateTotals.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/totals/useUpdateTotals.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQlD;;;;;GAKG;AACH,wBAAgB,eAAe;oCAKP,MAAM,EAAE,oBAAoB,MAAM,EAAE,YAAY,OAAO,YAAY,OAAO;EAoCjG"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// (C) 2025-2026 GoodData Corporation
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { uniqWith } from "lodash-es";
|
|
4
|
-
import { bucketsFind, sanitizeBucketTotals } from "@gooddata/sdk-model";
|
|
5
4
|
import { BucketNames } from "@gooddata/sdk-ui";
|
|
6
5
|
import { usePivotTableProps } from "../../context/PivotTablePropsContext.js";
|
|
7
6
|
import { orderTotals } from "../../features/aggregations/ordering.js";
|
|
@@ -14,7 +13,7 @@ import { useIsTransposed } from "../shared/useIsTransposed.js";
|
|
|
14
13
|
* @internal
|
|
15
14
|
*/
|
|
16
15
|
export function useUpdateTotals() {
|
|
17
|
-
const { pushData
|
|
16
|
+
const { pushData } = usePivotTableProps();
|
|
18
17
|
const isTransposed = useIsTransposed();
|
|
19
18
|
const onUpdateTotals = useCallback((currentTotals, totalDefinitions, isActive, isColumn) => {
|
|
20
19
|
if (!pushData) {
|
|
@@ -29,31 +28,14 @@ export function useUpdateTotals() {
|
|
|
29
28
|
], areTotalsSameDefinition);
|
|
30
29
|
// Apply consistent ordering to ensure external consumers receive properly ordered totals
|
|
31
30
|
const orderedTotals = orderTotals(updatedTotals);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
// Row totals (ATTRIBUTE bucket) need to be sanitized based on sorting.
|
|
43
|
-
// Changing sort may cause subtotals to no longer be reasonably placed - remove them if that is the case.
|
|
44
|
-
const { buckets, sortBy } = execution.definition;
|
|
45
|
-
const attributeBucket = bucketsFind(buckets, BucketNames.ATTRIBUTE);
|
|
46
|
-
const sanitizedTotals = attributeBucket
|
|
47
|
-
? sanitizeBucketTotals(attributeBucket, sortBy, orderedTotals)
|
|
48
|
-
: orderedTotals;
|
|
49
|
-
pushData({
|
|
50
|
-
properties: {
|
|
51
|
-
totals: sanitizedTotals,
|
|
52
|
-
bucketType: BucketNames.ATTRIBUTE,
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}, [pushData, execution, isTransposed]);
|
|
31
|
+
// Sorting determines subtotal placement in the execution result, not whether a total is valid.
|
|
32
|
+
pushData({
|
|
33
|
+
properties: {
|
|
34
|
+
totals: orderedTotals,
|
|
35
|
+
bucketType: isColumn ? BucketNames.COLUMNS : BucketNames.ATTRIBUTE,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}, [pushData, isTransposed]);
|
|
57
39
|
return {
|
|
58
40
|
onUpdateTotals,
|
|
59
41
|
};
|
package/esm/next/types/menu.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ export interface IAggregationsSubMenuItem {
|
|
|
86
86
|
isActive: boolean;
|
|
87
87
|
isColumn: boolean;
|
|
88
88
|
totalDefinitions: ITotal[];
|
|
89
|
+
isDisabled?: boolean;
|
|
90
|
+
disabledTooltip?: string;
|
|
89
91
|
}
|
|
90
92
|
/**
|
|
91
93
|
* Text wrapping menu item. Represents a single text wrapping option entry.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/next/types/menu.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,KAAK;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAE/B;;;;;;OAMG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,wBAAwB,EAAE,CAAC;IACjC,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,aAAa,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/next/types/menu.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,KAAK;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAE/B;;;;;;OAMG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,wBAAwB,EAAE,CAAC;IACjC,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,aAAa,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,cAAc,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-pivot",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.66.0-alpha.0",
|
|
4
4
|
"description": "GoodData.UI SDK - Pivot Table",
|
|
5
5
|
"license": "LicenseRef-LICENSE",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"ts-invariant": "0.10.3",
|
|
44
44
|
"tslib": "2.8.1",
|
|
45
45
|
"uuid": "11.1.1",
|
|
46
|
-
"@gooddata/sdk-backend-spi": "11.
|
|
47
|
-
"@gooddata/sdk-model": "11.
|
|
48
|
-
"@gooddata/sdk-ui": "11.
|
|
49
|
-
"@gooddata/sdk-ui-kit": "11.
|
|
50
|
-
"@gooddata/sdk-ui-theme-provider": "11.
|
|
51
|
-
"@gooddata/sdk-ui-vis-commons": "11.
|
|
46
|
+
"@gooddata/sdk-backend-spi": "11.66.0-alpha.0",
|
|
47
|
+
"@gooddata/sdk-model": "11.66.0-alpha.0",
|
|
48
|
+
"@gooddata/sdk-ui": "11.66.0-alpha.0",
|
|
49
|
+
"@gooddata/sdk-ui-kit": "11.66.0-alpha.0",
|
|
50
|
+
"@gooddata/sdk-ui-theme-provider": "11.66.0-alpha.0",
|
|
51
|
+
"@gooddata/sdk-ui-vis-commons": "11.66.0-alpha.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@microsoft/api-documenter": "7.30.16",
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
"stylelint": "16.26.1",
|
|
87
87
|
"typescript": "7.0.2",
|
|
88
88
|
"vitest": "5.0.4",
|
|
89
|
-
"@gooddata/eslint-config": "11.
|
|
90
|
-
"@gooddata/oxlint-config": "11.
|
|
91
|
-
"@gooddata/reference-workspace": "11.
|
|
92
|
-
"@gooddata/sdk-backend-base": "11.
|
|
93
|
-
"@gooddata/
|
|
94
|
-
"@gooddata/
|
|
89
|
+
"@gooddata/eslint-config": "11.66.0-alpha.0",
|
|
90
|
+
"@gooddata/oxlint-config": "11.66.0-alpha.0",
|
|
91
|
+
"@gooddata/reference-workspace": "11.66.0-alpha.0",
|
|
92
|
+
"@gooddata/sdk-backend-base": "11.66.0-alpha.0",
|
|
93
|
+
"@gooddata/stylelint-config": "11.66.0-alpha.0",
|
|
94
|
+
"@gooddata/sdk-backend-mockingbird": "11.66.0-alpha.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"react": "^18.0.0 || ^19.0.0",
|