@gooddata/sdk-ui-pivot 11.53.0-alpha.0 → 11.53.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnDefsContext.d.ts","sourceRoot":"","sources":["../../../src/next/context/ColumnDefsContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAsC,MAAM,OAAO,CAAC;AAM3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAM1E,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAI/D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAuCvE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,kBAAkB,CAQlD"}
1
+ {"version":3,"file":"ColumnDefsContext.d.ts","sourceRoot":"","sources":["../../../src/next/context/ColumnDefsContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAsC,MAAM,OAAO,CAAC;AAM3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAM1E,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAI/D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CA0CvE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,kBAAkB,CAQlD"}
@@ -16,7 +16,7 @@ export function ColumnDefsProvider({ children }) {
16
16
  const initialExecutionData = useInitialExecution();
17
17
  const props = usePivotTableProps();
18
18
  const { config } = props;
19
- const { columnHeadersPosition, columnSizing: { columnWidths: initialColumnWidths }, textWrapping, separators, conditionalFormatting, } = config;
19
+ const { columnHeadersPosition, columnSizing: { columnWidths: initialColumnWidths }, textWrapping, separators, conditionalFormatting, enableSemanticConditionalFormatting, } = config;
20
20
  const { initialDataView } = initialExecutionData;
21
21
  const columnWidths = useInitialProp(initialColumnWidths);
22
22
  const drillableItemsRef = useDrillableItemsRef();
@@ -30,6 +30,7 @@ export function ColumnDefsProvider({ children }) {
30
30
  intl,
31
31
  separators,
32
32
  conditionalFormatting,
33
+ enableSemanticConditionalFormatting,
33
34
  });
34
35
  }, [
35
36
  initialDataView,
@@ -40,6 +41,7 @@ export function ColumnDefsProvider({ children }) {
40
41
  drillableItemsRef,
41
42
  separators,
42
43
  conditionalFormatting,
44
+ enableSemanticConditionalFormatting,
43
45
  ]);
44
46
  return _jsx(ColumnDefsContext.Provider, { value: columnDefs, children: children });
45
47
  }
@@ -13,7 +13,7 @@ import { type ColumnHeadersPosition } from "../../types/transposition.js";
13
13
  *
14
14
  * @internal
15
15
  */
16
- export declare function dataViewToColDefs({ dataView, columnHeadersPosition, columnWidths, drillableItemsRef, textWrapping, intl, separators, conditionalFormatting }: {
16
+ export declare function dataViewToColDefs({ dataView, columnHeadersPosition, columnWidths, drillableItemsRef, textWrapping, intl, separators, conditionalFormatting, enableSemanticConditionalFormatting }: {
17
17
  dataView: DataViewFacade;
18
18
  columnHeadersPosition: ColumnHeadersPosition;
19
19
  columnWidths: ColumnWidthItem[];
@@ -22,6 +22,8 @@ export declare function dataViewToColDefs({ dataView, columnHeadersPosition, col
22
22
  intl: IntlShape;
23
23
  separators?: ISeparators;
24
24
  conditionalFormatting?: IConditionalFormatting;
25
+ /** Off by default: descriptors may carry semantic rules the host has no other way to suppress. */
26
+ enableSemanticConditionalFormatting?: boolean;
25
27
  }): {
26
28
  columnDefinitionByColId: ITableColumnDefinitionByColId;
27
29
  columnDefs: (AgGridColumnDef | AgGridColumnGroupDef)[];
@@ -1 +1 @@
1
- {"version":3,"file":"dataViewToColDefs.d.ts","sourceRoot":"","sources":["../../../../src/next/features/data/dataViewToColDefs.ts"],"names":[],"mapp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G,mCAAmC,CAAC,EAAE,OAAO,CAAC;CACjD,GAAG;IACA,uBAAuB,EAAE,6BAA6B,CAAC;IACvD,UAAU,EAAE,CAAC,eAAe,GAAG,oBAAoB,CAAC,EAAE,CAAC;IACvD,cAAc,EAAE,eAAe,EAAE,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;CACtB,CA8EA"}
@@ -4,6 +4,7 @@ import { columnDefinitionToColId } from "../columns/colId.js";
4
4
  import { createColDef } from "../columns/createColDef.js";
5
5
  import { columnDefsToPivotGroups } from "../pivoting/columnDefsToPivotGroups.js";
6
6
  import { resolveConditionalFormattingDateBounds, resolveConditionalFormattingTriggers, } from "../styling/conditionalFormatting.js";
7
+ import { resolvePerTargetConditionalFormatting } from "../styling/semanticConditionalFormatting.js";
7
8
  import { applyTextWrappingToGroupDef } from "../textWrapping/applyTextWrappingToGroupDef.js";
8
9
  import { getTableData } from "./valueFormatter.js";
9
10
  /**
@@ -11,7 +12,7 @@ import { getTableData } from "./valueFormatter.js";
11
12
  *
12
13
  * @internal
13
14
  */
14
- export function dataViewToColDefs({ dataView, columnHeadersPosition, columnWidths, drillableItemsRef, textWrapping, intl, separators, conditionalFormatting, }) {
15
+ export function dataViewToColDefs({ dataView, columnHeadersPosition, columnWidths, drillableItemsRef, textWrapping, intl, separators, conditionalFormatting, enableSemanticConditionalFormatting, }) {
15
16
  const sortBy = dataView.definition.sortBy;
16
17
  const tableData = getTableData(dataView, separators);
17
18
  const columnDefinitionByColId = {};
@@ -19,14 +20,20 @@ export function dataViewToColDefs({ dataView, columnHeadersPosition, columnWidth
19
20
  const colId = columnDefinitionToColId(columnDefinition, columnHeadersPosition);
20
21
  columnDefinitionByColId[colId] = columnDefinition;
21
22
  });
23
+ // Descriptors may carry semantic rules regardless of `conditionalFormatting` (even `undefined`
24
+ // still inherits, per resolvePerTargetConditionalFormatting) — the host can't suppress that by
25
+ // omitting `conditionalFormatting` alone, so inheritance needs its own explicit opt-in.
26
+ const effectiveConditionalFormatting = enableSemanticConditionalFormatting
27
+ ? resolvePerTargetConditionalFormatting(conditionalFormatting, dataView.meta().attributeDescriptors(), dataView.meta().measureDescriptors())
28
+ : conditionalFormatting;
22
29
  // Resolve each rule's trigger column to a colId ONCE for this render pass, so the per-cell
23
30
  // cellStyle path is O(rules) lookups instead of re-matching every column on every cell.
24
- const conditionalFormattingTriggers = conditionalFormatting?.enabled
25
- ? resolveConditionalFormattingTriggers(conditionalFormatting, tableData.columnDefinitions, columnHeadersPosition)
31
+ const conditionalFormattingTriggers = effectiveConditionalFormatting?.enabled
32
+ ? resolveConditionalFormattingTriggers(effectiveConditionalFormatting, tableData.columnDefinitions, columnHeadersPosition)
26
33
  : [];
27
34
  // Resolved once per render like the triggers; relative periods anchor to render time.
28
- const conditionalFormattingDateBounds = conditionalFormatting?.enabled
29
- ? resolveConditionalFormattingDateBounds(conditionalFormatting, tableData.columnDefinitions)
35
+ const conditionalFormattingDateBounds = effectiveConditionalFormatting?.enabled
36
+ ? resolveConditionalFormattingDateBounds(effectiveConditionalFormatting, tableData.columnDefinitions)
30
37
  : {};
31
38
  const colDefs = tableData.columnDefinitions.map((columnDefinition) => {
32
39
  const colDef = createColDef(columnDefinition, columnHeadersPosition, intl, dataView);
@@ -36,7 +43,7 @@ export function dataViewToColDefs({ dataView, columnHeadersPosition, columnWidth
36
43
  textWrapping,
37
44
  drillableItemsRef,
38
45
  dataViewFacade: dataView,
39
- conditionalFormatting,
46
+ conditionalFormatting: effectiveConditionalFormatting,
40
47
  conditionalFormattingTriggers,
41
48
  conditionalFormattingDateBounds,
42
49
  })(colDef);
@@ -0,0 +1,12 @@
1
+ import { type IAttributeDescriptor, type IMeasureDescriptor } from "@gooddata/sdk-model";
2
+ import { type IConditionalFormatting } from "../../types/conditionalFormatting.js";
3
+ /**
4
+ * Blends the insight's own conditional-formatting config with rules inherited from the semantic
5
+ * layer (carried on the execution result's attribute/measure descriptors), resolving Inherited vs
6
+ * Custom per target. Returns an ordinary {@link IConditionalFormatting} that the rest of the
7
+ * engine (trigger resolution, date-bounds resolution, evaluation) consumes unmodified.
8
+ *
9
+ * @internal
10
+ */
11
+ export declare function resolvePerTargetConditionalFormatting(insightConfig: IConditionalFormatting | undefined, attributeDescriptors: readonly IAttributeDescriptor[], measureDescriptors: readonly IMeasureDescriptor[]): IConditionalFormatting | undefined;
12
+ //# sourceMappingURL=semanticConditionalFormatting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semanticConditionalFormatting.d.ts","sourceRoot":"","sources":["../../../../src/next/features/styling/semanticConditionalFormatting.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EAEH,KAAK,sBAAsB,EAE9B,MAAM,sCAAsC,CAAC;AA4C9C;;;;;;;GAOG;AACH,wBAAgB,qCAAqC,CACjD,aAAa,EAAE,sBAAsB,GAAG,SAAS,EACjD,oBAAoB,EAAE,SAAS,oBAAoB,EAAE,EACrD,kBAAkB,EAAE,SAAS,kBAAkB,EAAE,GAClD,sBAAsB,GAAG,SAAS,CA+BpC"}
@@ -0,0 +1,75 @@
1
+ // (C) 2026 GoodData Corporation
2
+ function targetKey(target) {
3
+ return target.kind === "attribute"
4
+ ? `attribute:${target.attributeIdentifier}`
5
+ : `measure:${target.measureIdentifier}`;
6
+ }
7
+ function materializeSemanticRules(attributeDescriptors, measureDescriptors) {
8
+ const attributeRules = attributeDescriptors.flatMap((descriptor) => {
9
+ const conditionalFormatting = descriptor.attributeHeader.conditionalFormatting;
10
+ if (!conditionalFormatting) {
11
+ return [];
12
+ }
13
+ return [
14
+ {
15
+ id: `semantic:attribute:${descriptor.attributeHeader.localIdentifier}`,
16
+ target: {
17
+ kind: "attribute",
18
+ attributeIdentifier: descriptor.attributeHeader.localIdentifier,
19
+ },
20
+ conditions: conditionalFormatting.conditions,
21
+ },
22
+ ];
23
+ });
24
+ const measureRules = measureDescriptors.flatMap((descriptor) => {
25
+ const conditionalFormatting = descriptor.measureHeaderItem.conditionalFormatting;
26
+ if (!conditionalFormatting) {
27
+ return [];
28
+ }
29
+ return [
30
+ {
31
+ id: `semantic:measure:${descriptor.measureHeaderItem.localIdentifier}`,
32
+ target: { kind: "measure", measureIdentifier: descriptor.measureHeaderItem.localIdentifier },
33
+ conditions: conditionalFormatting.conditions,
34
+ },
35
+ ];
36
+ });
37
+ return [...attributeRules, ...measureRules];
38
+ }
39
+ /**
40
+ * Blends the insight's own conditional-formatting config with rules inherited from the semantic
41
+ * layer (carried on the execution result's attribute/measure descriptors), resolving Inherited vs
42
+ * Custom per target. Returns an ordinary {@link IConditionalFormatting} that the rest of the
43
+ * engine (trigger resolution, date-bounds resolution, evaluation) consumes unmodified.
44
+ *
45
+ * @internal
46
+ */
47
+ export function resolvePerTargetConditionalFormatting(insightConfig, attributeDescriptors, measureDescriptors) {
48
+ const semanticRules = materializeSemanticRules(attributeDescriptors, measureDescriptors);
49
+ if (semanticRules.length === 0) {
50
+ return insightConfig;
51
+ }
52
+ // `enabled` predates per-target Inherited/Custom and only ever meant "my authored rules are
53
+ // active" — it must not also suppress targets the creator never touched (that's what
54
+ // `customTargets` is for). A Custom target (has an authored rule) whose rules are inactive
55
+ // shows nothing rather than silently falling back to its inherited rule: `customModeTargets`
56
+ // is built from ALL authored rules regardless of `enabled`, so a disabled target stays
57
+ // excluded from inheritance even though its (inactive) rule is excluded from the merge below.
58
+ const allInsightRules = insightConfig?.rules ?? [];
59
+ const activeInsightRules = insightConfig?.enabled ? allInsightRules : [];
60
+ const customModeTargets = new Set([
61
+ ...allInsightRules.map((rule) => targetKey(rule.target)),
62
+ ...(insightConfig?.customTargets ?? []).map(targetKey),
63
+ ]);
64
+ const inheritedRules = semanticRules.filter((rule) => !customModeTargets.has(targetKey(rule.target)));
65
+ const mergedRules = [...activeInsightRules, ...inheritedRules];
66
+ if (mergedRules.length === 0) {
67
+ return undefined;
68
+ }
69
+ return {
70
+ version: insightConfig?.version,
71
+ enabled: true,
72
+ rules: mergedRules,
73
+ customTargets: insightConfig?.customTargets,
74
+ };
75
+ }
@@ -1,149 +1,6 @@
1
- import { type ComparisonConditionOperator, type DateFilterGranularity, type RangeConditionOperator } from "@gooddata/sdk-model";
1
+ import type { ConditionalFormattingEmptinessOperator, ConditionalFormattingOperator, ConditionalFormattingTarget, ConditionalFormattingTextOperator, ConditionalFormattingValue, IConditionalFormatting, IConditionalFormattingCondition, IConditionalFormattingFormat, IConditionalFormattingRule } from "@gooddata/sdk-model";
2
2
  import { type PivotTableNextConfig } from "./public.js";
3
- /**
4
- * Identifies the measure or attribute a conditional-formatting rule targets. Layout-neutral on
5
- * purpose: the same target applies whether the item renders as a column or — when transposed — as a
6
- * row, so the rule survives a transpose without re-pointing.
7
- *
8
- * @alpha
9
- */
10
- export type ConditionalFormattingTarget = {
11
- kind: "attribute";
12
- attributeIdentifier: string;
13
- } | {
14
- kind: "measure";
15
- measureIdentifier: string;
16
- };
17
- /**
18
- * Substring operators specific to conditional formatting. No existing SDK enum covers text
19
- * matching (attribute filters are element-based IN/NOT_IN), so these are CF-specific.
20
- *
21
- * @alpha
22
- */
23
- export type ConditionalFormattingTextOperator = "CONTAINS" | "NOT_CONTAINS" | "STARTS_WITH" | "NOT_STARTS_WITH" | "ENDS_WITH" | "NOT_ENDS_WITH";
24
- /**
25
- * Emptiness operators — target-agnostic: an empty cell (null measure value, valueless attribute
26
- * element) is matched only by these, on any target kind.
27
- *
28
- * @alpha
29
- */
30
- export type ConditionalFormattingEmptinessOperator = "IS_EMPTY" | "IS_NOT_EMPTY";
31
- /**
32
- * Every operator a stored condition may carry. One shared, shape-grouped vocabulary: numeric and
33
- * range operators reuse the SDK measure-value-filter enums (`ComparisonConditionOperator`,
34
- * `RangeConditionOperator` from `@gooddata/sdk-model`); `"ALL"` always matches non-empty cells;
35
- * substring operators are {@link ConditionalFormattingTextOperator}; emptiness operators are
36
- * {@link ConditionalFormattingEmptinessOperator}. Which subset a target kind AUTHORS is editor
37
- * policy (see `operatorsForTarget` in sdk-ui-ext); the evaluation engine accepts any combination
38
- * and treats inapplicable ones as never matching.
39
- *
40
- * @alpha
41
- */
42
- export type ConditionalFormattingOperator = "ALL" | ComparisonConditionOperator | RangeConditionOperator | ConditionalFormattingTextOperator | ConditionalFormattingEmptinessOperator;
43
- /**
44
- * The operand a condition compares against. Discriminated so range / no-operand / date / (future
45
- * column-reference) shapes stay valid by construction.
46
- *
47
- * Date values target date attributes and express a period; a single date is a period whose bounds
48
- * coincide. "Is on" (EQUAL_TO) means the cell's period lies within the value period; "Is after"
49
- * (GREATER_THAN) means after the period ends; "Is before" (LESS_THAN) before it starts.
50
- *
51
- * @alpha
52
- */
53
- export type ConditionalFormattingValue = {
54
- kind: "none";
55
- } | {
56
- kind: "literal";
57
- value: string | number;
58
- } | {
59
- kind: "literalRange";
60
- from: number;
61
- to: number;
62
- } | {
63
- kind: "absoluteDate";
64
- /**
65
- * Period start as a platform date string: "YYYY-MM-DD", or "YYYY-MM-DD HH:mm" for
66
- * hour/minute-granularity targets. Snapped to the period start at save time.
67
- */
68
- from: string;
69
- /**
70
- * Inclusive period end — the last day (or minute) of the period, mirroring how absolute
71
- * date filters store their `to` bound.
72
- */
73
- to: string;
74
- } | {
75
- kind: "relativeDate";
76
- /**
77
- * Granularity the offsets count in (linear granularities only).
78
- */
79
- granularity: DateFilterGranularity;
80
- /**
81
- * Integer period offset of the range start; 0 = the period containing the anchor,
82
- * negative = past, positive = future.
83
- */
84
- from: number;
85
- /**
86
- * Integer period offset of the range end (inclusive), \>= `from`.
87
- */
88
- to: number;
89
- };
90
- /**
91
- * The visual format applied to a matched cell or row.
92
- *
93
- * @alpha
94
- */
95
- export interface IConditionalFormattingFormat {
96
- /**
97
- * Text color (raw hex, e.g. "#FFFFFF").
98
- */
99
- color?: string;
100
- /**
101
- * Fill / background color (raw hex, e.g. "#E54D40").
102
- */
103
- backgroundColor?: string;
104
- /**
105
- * Whether the format applies to the matched cell only or the whole row.
106
- */
107
- scope: "cell" | "row";
108
- }
109
- /**
110
- * A single condition: an operator + operand, and the format applied when it matches.
111
- *
112
- * @alpha
113
- */
114
- export interface IConditionalFormattingCondition {
115
- id: string;
116
- operator: ConditionalFormattingOperator;
117
- value: ConditionalFormattingValue;
118
- format: IConditionalFormattingFormat;
119
- }
120
- /**
121
- * A rule targeting one measure or attribute with one or more stacked conditions. The first matching
122
- * condition (top-down) wins.
123
- *
124
- * @alpha
125
- */
126
- export interface IConditionalFormattingRule {
127
- id: string;
128
- target: ConditionalFormattingTarget;
129
- conditions: readonly IConditionalFormattingCondition[];
130
- }
131
- /**
132
- * Conditional-formatting settings: an on/off toggle plus the ordered list of rules. Stored on the
133
- * table config and (when persisted) on the insight's `properties.controls.conditionalFormatting`.
134
- *
135
- * @alpha
136
- */
137
- export interface IConditionalFormatting {
138
- /**
139
- * Model version of the persisted shape (mirrors the dashboard model-version convention). Absent
140
- * is treated as `"1"`. Lets the persisted contract evolve for cross-stack readers (e.g. server
141
- * XLSX export) without breaking older saved insights.
142
- */
143
- version?: string;
144
- enabled: boolean;
145
- rules: readonly IConditionalFormattingRule[];
146
- }
3
+ export type { ConditionalFormattingEmptinessOperator, ConditionalFormattingOperator, ConditionalFormattingTarget, ConditionalFormattingTextOperator, ConditionalFormattingValue, IConditionalFormatting, IConditionalFormattingCondition, IConditionalFormattingFormat, IConditionalFormattingRule, };
147
4
  /**
148
5
  * Resolved trigger columns, aligned by index to {@link IConditionalFormatting.rules}: each rule maps
149
6
  * to the colIds of every column that may hold its target's value. One colId for a non-pivoted target,
@@ -184,6 +41,14 @@ export type PivotTableNextConditionalFormattingConfig = {
184
41
  * Rules that color cells/rows based on their values. Absent = no conditional formatting.
185
42
  */
186
43
  conditionalFormatting?: IConditionalFormatting;
44
+ /**
45
+ * Whether the engine may inherit conditional formatting from semantic-layer catalog objects
46
+ * (carried on execution result headers). Defaults to `false` — `conditionalFormatting` being
47
+ * absent/disabled is not enough to keep inheritance off, since it's resolved independently
48
+ * from descriptors the host can't otherwise suppress. Off by default so every consumer ships
49
+ * dark until it explicitly opts in.
50
+ */
51
+ enableSemanticConditionalFormatting?: boolean;
187
52
  };
188
53
  /**
189
54
  * {@link PivotTableNextConfig} extended with the conditional formatting configuration.
@@ -1 +1 @@
1
- {"version":3,"file":"conditionalFormatting.d.ts","sourceRoot":"","sources":["../../../src/next/types/conditionalFormatting.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC9B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,2BAA2B,GACjC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GACvC,UAAU,GACV,cAAc,GACd,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,eAAe,CAAC;AAEtB;;;;;GAKG;AACH,MAAM,MAAM,sCAAsC,GAAG,UAAU,GAAG,cAAc,CAAC;AAEjF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,6BAA6B,GACnC,KAAK,GACL,2BAA2B,GAC3B,sBAAsB,GACtB,iCAAiC,GACjC,sCAAsC,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,MAAM,0BAA0B,GAChC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAClD;IACI,IAAI,EA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MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACpD;;OAEG;IACH,qBAAqB,CAAC,EAAE,sBAAsB,CAAC;CAClD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,6CAA6C,GAAG,oBAAoB,GAC5E,yCAAyC,CAAC"}
1
+ {"version":3,"file":"conditionalFormatting.d.ts","sourceRoot":"","sources":["../../../src/next/types/conditionalFormatting.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,sCAAsC,EACtC,6BAA6B,EAC7B,2BAA2B,EAC3B,iCAAiC,EACjC,0BAA0B,EAC1B,sBAAsB,EACtB,+BAA+B,EAC/B,4BAA4B,EAC5B,0BAA0B,EAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,YAAY,EACR,sCAAsC,EACtC,6BAA6B,EAC7B,2BAA2B,EAC3B,iCAAiC,EACjC,0BAA0B,EAC1B,sBAAsB,EACtB,+BAA+B,EAC/B,4BAA4B,EAC5B,0BAA0B,GAC7B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,kCAAkC,GAAG,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;AAEhF;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,+BAA+B,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACpD;;OAEG;IACH,qBAAqB,CAAC,EAAE,sBAAsB,CAAC;IAC/C;;;;;;OAMG;IACH,mCAAmC,CAAC,EAAE,OAAO,CAAC;CACjD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,6CAA6C,GAAG,oBAAoB,GAC5E,yCAAyC,CAAC"}
@@ -9,13 +9,20 @@
9
9
 
10
10
  import { AttributesMeasuresOrPlaceholders } from '@gooddata/sdk-ui';
11
11
  import { AttributesOrPlaceholders } from '@gooddata/sdk-ui';
12
- import { ComparisonConditionOperator } from '@gooddata/sdk-model';
13
- import { DateFilterGranularity } from '@gooddata/sdk-model';
12
+ import type { ConditionalFormattingEmptinessOperator } from '@gooddata/sdk-model';
13
+ import type { ConditionalFormattingOperator } from '@gooddata/sdk-model';
14
+ import type { ConditionalFormattingTarget } from '@gooddata/sdk-model';
15
+ import type { ConditionalFormattingTextOperator } from '@gooddata/sdk-model';
16
+ import type { ConditionalFormattingValue } from '@gooddata/sdk-model';
14
17
  import { ExplicitDrill } from '@gooddata/sdk-ui';
15
18
  import { IAnalyticalBackend } from '@gooddata/sdk-backend-spi';
16
19
  import { IAttribute } from '@gooddata/sdk-model';
17
20
  import { IBackendCapabilities } from '@gooddata/sdk-backend-spi';
18
21
  import { IBucket } from '@gooddata/sdk-model';
22
+ import type { IConditionalFormatting } from '@gooddata/sdk-model';
23
+ import type { IConditionalFormattingCondition } from '@gooddata/sdk-model';
24
+ import type { IConditionalFormattingFormat } from '@gooddata/sdk-model';
25
+ import type { IConditionalFormattingRule } from '@gooddata/sdk-model';
19
26
  import { Identifier } from '@gooddata/sdk-model';
20
27
  import { IDimension } from '@gooddata/sdk-model';
21
28
  import { IExecutionConfig } from '@gooddata/sdk-model';
@@ -27,7 +34,6 @@ import { IVisualizationCallbacks } from '@gooddata/sdk-ui';
27
34
  import { IVisualizationProps } from '@gooddata/sdk-ui';
28
35
  import { JSX } from 'react/jsx-runtime';
29
36
  import { NullableFiltersOrPlaceholders } from '@gooddata/sdk-ui';
30
- import { RangeConditionOperator } from '@gooddata/sdk-model';
31
37
  import { SortsOrPlaceholders } from '@gooddata/sdk-ui';
32
38
  import { TotalsOrPlaceholders } from '@gooddata/sdk-ui';
33
39
  import { TotalType } from '@gooddata/sdk-model';
@@ -82,97 +88,15 @@ export declare type ColumnWidthItemNext = IAttributeColumnWidthItemNext | IMeasu
82
88
  */
83
89
  export declare type ColumnWidthNext = IAbsoluteColumnWidthNext | IAutoColumnWidthNext;
84
90
 
85
- /**
86
- * Emptiness operators — target-agnostic: an empty cell (null measure value, valueless attribute
87
- * element) is matched only by these, on any target kind.
88
- *
89
- * @alpha
90
- */
91
- export declare type ConditionalFormattingEmptinessOperator = "IS_EMPTY" | "IS_NOT_EMPTY";
91
+ export { ConditionalFormattingEmptinessOperator }
92
92
 
93
- /**
94
- * Every operator a stored condition may carry. One shared, shape-grouped vocabulary: numeric and
95
- * range operators reuse the SDK measure-value-filter enums (`ComparisonConditionOperator`,
96
- * `RangeConditionOperator` from `@gooddata/sdk-model`); `"ALL"` always matches non-empty cells;
97
- * substring operators are {@link ConditionalFormattingTextOperator}; emptiness operators are
98
- * {@link ConditionalFormattingEmptinessOperator}. Which subset a target kind AUTHORS is editor
99
- * policy (see `operatorsForTarget` in sdk-ui-ext); the evaluation engine accepts any combination
100
- * and treats inapplicable ones as never matching.
101
- *
102
- * @alpha
103
- */
104
- export declare type ConditionalFormattingOperator = "ALL" | ComparisonConditionOperator | RangeConditionOperator | ConditionalFormattingTextOperator | ConditionalFormattingEmptinessOperator;
93
+ export { ConditionalFormattingOperator }
105
94
 
106
- /**
107
- * Identifies the measure or attribute a conditional-formatting rule targets. Layout-neutral on
108
- * purpose: the same target applies whether the item renders as a column or — when transposed — as a
109
- * row, so the rule survives a transpose without re-pointing.
110
- *
111
- * @alpha
112
- */
113
- export declare type ConditionalFormattingTarget = {
114
- kind: "attribute";
115
- attributeIdentifier: string;
116
- } | {
117
- kind: "measure";
118
- measureIdentifier: string;
119
- };
95
+ export { ConditionalFormattingTarget }
120
96
 
121
- /**
122
- * Substring operators specific to conditional formatting. No existing SDK enum covers text
123
- * matching (attribute filters are element-based IN/NOT_IN), so these are CF-specific.
124
- *
125
- * @alpha
126
- */
127
- export declare type ConditionalFormattingTextOperator = "CONTAINS" | "NOT_CONTAINS" | "STARTS_WITH" | "NOT_STARTS_WITH" | "ENDS_WITH" | "NOT_ENDS_WITH";
97
+ export { ConditionalFormattingTextOperator }
128
98
 
129
- /**
130
- * The operand a condition compares against. Discriminated so range / no-operand / date / (future
131
- * column-reference) shapes stay valid by construction.
132
- *
133
- * Date values target date attributes and express a period; a single date is a period whose bounds
134
- * coincide. "Is on" (EQUAL_TO) means the cell's period lies within the value period; "Is after"
135
- * (GREATER_THAN) means after the period ends; "Is before" (LESS_THAN) before it starts.
136
- *
137
- * @alpha
138
- */
139
- export declare type ConditionalFormattingValue = {
140
- kind: "none";
141
- } | {
142
- kind: "literal";
143
- value: string | number;
144
- } | {
145
- kind: "literalRange";
146
- from: number;
147
- to: number;
148
- } | {
149
- kind: "absoluteDate";
150
- /**
151
- * Period start as a platform date string: "YYYY-MM-DD", or "YYYY-MM-DD HH:mm" for
152
- * hour/minute-granularity targets. Snapped to the period start at save time.
153
- */
154
- from: string;
155
- /**
156
- * Inclusive period end — the last day (or minute) of the period, mirroring how absolute
157
- * date filters store their `to` bound.
158
- */
159
- to: string;
160
- } | {
161
- kind: "relativeDate";
162
- /**
163
- * Granularity the offsets count in (linear granularities only).
164
- */
165
- granularity: DateFilterGranularity;
166
- /**
167
- * Integer period offset of the range start; 0 = the period containing the anchor,
168
- * negative = past, positive = future.
169
- */
170
- from: number;
171
- /**
172
- * Integer period offset of the range end (inclusive), \>= `from`.
173
- */
174
- to: number;
175
- };
99
+ export { ConditionalFormattingValue }
176
100
 
177
101
  /**
178
102
  * @internal
@@ -453,66 +377,13 @@ export declare interface IColumnTextWrappingItem {
453
377
  matchType?: "column" | "pivotGroup";
454
378
  }
455
379
 
456
- /**
457
- * Conditional-formatting settings: an on/off toggle plus the ordered list of rules. Stored on the
458
- * table config and (when persisted) on the insight's `properties.controls.conditionalFormatting`.
459
- *
460
- * @alpha
461
- */
462
- export declare interface IConditionalFormatting {
463
- /**
464
- * Model version of the persisted shape (mirrors the dashboard model-version convention). Absent
465
- * is treated as `"1"`. Lets the persisted contract evolve for cross-stack readers (e.g. server
466
- * XLSX export) without breaking older saved insights.
467
- */
468
- version?: string;
469
- enabled: boolean;
470
- rules: readonly IConditionalFormattingRule[];
471
- }
380
+ export { IConditionalFormatting }
472
381
 
473
- /**
474
- * A single condition: an operator + operand, and the format applied when it matches.
475
- *
476
- * @alpha
477
- */
478
- export declare interface IConditionalFormattingCondition {
479
- id: string;
480
- operator: ConditionalFormattingOperator;
481
- value: ConditionalFormattingValue;
482
- format: IConditionalFormattingFormat;
483
- }
382
+ export { IConditionalFormattingCondition }
484
383
 
485
- /**
486
- * The visual format applied to a matched cell or row.
487
- *
488
- * @alpha
489
- */
490
- export declare interface IConditionalFormattingFormat {
491
- /**
492
- * Text color (raw hex, e.g. "#FFFFFF").
493
- */
494
- color?: string;
495
- /**
496
- * Fill / background color (raw hex, e.g. "#E54D40").
497
- */
498
- backgroundColor?: string;
499
- /**
500
- * Whether the format applies to the matched cell only or the whole row.
501
- */
502
- scope: "cell" | "row";
503
- }
384
+ export { IConditionalFormattingFormat }
504
385
 
505
- /**
506
- * A rule targeting one measure or attribute with one or more stacked conditions. The first matching
507
- * condition (top-down) wins.
508
- *
509
- * @alpha
510
- */
511
- export declare interface IConditionalFormattingRule {
512
- id: string;
513
- target: ConditionalFormattingTarget;
514
- conditions: readonly IConditionalFormattingCondition[];
515
- }
386
+ export { IConditionalFormattingRule }
516
387
 
517
388
  /**
518
389
  * @internal
@@ -1386,6 +1257,14 @@ export declare type PivotTableNextConditionalFormattingConfig = {
1386
1257
  * Rules that color cells/rows based on their values. Absent = no conditional formatting.
1387
1258
  */
1388
1259
  conditionalFormatting?: IConditionalFormatting;
1260
+ /**
1261
+ * Whether the engine may inherit conditional formatting from semantic-layer catalog objects
1262
+ * (carried on execution result headers). Defaults to `false` — `conditionalFormatting` being
1263
+ * absent/disabled is not enough to keep inheritance off, since it's resolved independently
1264
+ * from descriptors the host can't otherwise suppress. Off by default so every consumer ships
1265
+ * dark until it explicitly opts in.
1266
+ */
1267
+ enableSemanticConditionalFormatting?: boolean;
1389
1268
  };
1390
1269
 
1391
1270
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-pivot",
3
- "version": "11.53.0-alpha.0",
3
+ "version": "11.53.0-alpha.1",
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.53.0-alpha.0",
46
- "@gooddata/sdk-model": "11.53.0-alpha.0",
47
- "@gooddata/sdk-ui": "11.53.0-alpha.0",
48
- "@gooddata/sdk-ui-kit": "11.53.0-alpha.0",
49
- "@gooddata/sdk-ui-theme-provider": "11.53.0-alpha.0",
50
- "@gooddata/sdk-ui-vis-commons": "11.53.0-alpha.0"
45
+ "@gooddata/sdk-backend-spi": "11.53.0-alpha.1",
46
+ "@gooddata/sdk-model": "11.53.0-alpha.1",
47
+ "@gooddata/sdk-ui-kit": "11.53.0-alpha.1",
48
+ "@gooddata/sdk-ui-theme-provider": "11.53.0-alpha.1",
49
+ "@gooddata/sdk-ui": "11.53.0-alpha.1",
50
+ "@gooddata/sdk-ui-vis-commons": "11.53.0-alpha.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@microsoft/api-documenter": "^7.17.0",
@@ -89,12 +89,12 @@
89
89
  "typescript": "5.9.3",
90
90
  "vitest": "4.1.8",
91
91
  "vitest-dom": "0.1.1",
92
- "@gooddata/eslint-config": "11.53.0-alpha.0",
93
- "@gooddata/oxlint-config": "11.53.0-alpha.0",
94
- "@gooddata/reference-workspace": "11.53.0-alpha.0",
95
- "@gooddata/sdk-backend-mockingbird": "11.53.0-alpha.0",
96
- "@gooddata/sdk-backend-base": "11.53.0-alpha.0",
97
- "@gooddata/stylelint-config": "11.53.0-alpha.0"
92
+ "@gooddata/eslint-config": "11.53.0-alpha.1",
93
+ "@gooddata/oxlint-config": "11.53.0-alpha.1",
94
+ "@gooddata/reference-workspace": "11.53.0-alpha.1",
95
+ "@gooddata/sdk-backend-mockingbird": "11.53.0-alpha.1",
96
+ "@gooddata/sdk-backend-base": "11.53.0-alpha.1",
97
+ "@gooddata/stylelint-config": "11.53.0-alpha.1"
98
98
  },
99
99
  "peerDependencies": {
100
100
  "react": "^18.0.0 || ^19.0.0",