@sisense/sdk-ui 2.28.0 → 2.29.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.
Files changed (98) hide show
  1. package/dist/ai.cjs +1 -1
  2. package/dist/ai.js +5 -5
  3. package/dist/analytics-composer/node.cjs +1 -1
  4. package/dist/analytics-composer/node.js +1256 -1203
  5. package/dist/analytics-composer.cjs +7 -7
  6. package/dist/analytics-composer.js +19 -18
  7. package/dist/apply-styled-options-to-query-CaP4IMrQ.js +6379 -0
  8. package/dist/apply-styled-options-to-query-D5D8pRl2.cjs +1 -0
  9. package/dist/index.cjs +398 -398
  10. package/dist/index.js +22490 -21772
  11. package/dist/index.umd.js +700 -700
  12. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/get-dashboard-model.d.ts +7 -0
  13. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +2 -2
  14. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +10 -1
  15. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +29 -1
  16. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-updates-persistence.d.ts +27 -0
  17. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/deep-merge.d.ts +17 -0
  18. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +15 -0
  19. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/update-types.d.ts +51 -0
  20. package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/data.d.ts +0 -1
  21. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/filter-and-aggregate-chart-data.d.ts +2 -2
  22. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +27 -23
  23. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/utils.d.ts +4 -4
  24. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/filter-to-readable-label.d.ts +14 -0
  25. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +1 -0
  26. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +5 -0
  27. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill.d.ts +5 -0
  28. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/truncate-pill-label.d.ts +10 -0
  29. package/dist/packages/sdk-ui/src/domains/widgets/change-events.d.ts +6 -0
  30. package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/types.d.ts +11 -0
  31. package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/pivot-table-widget.d.ts +15 -0
  32. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +41 -2
  33. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +6 -0
  34. package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-track-widget-init.d.ts +44 -0
  35. package/dist/packages/sdk-ui/src/domains/widgets/hooks/widget-entity-id.d.ts +30 -0
  36. package/dist/packages/sdk-ui/src/domains/widgets/hooks/widget-tracking-adapters.d.ts +41 -0
  37. package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-style-utils.d.ts +29 -0
  38. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +29 -1
  39. package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +2 -1
  40. package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +1 -7
  41. package/dist/packages/sdk-ui/src/infra/app/settings/types/features.d.ts +1 -9
  42. package/dist/packages/sdk-ui/src/infra/app/types.d.ts +14 -0
  43. package/dist/packages/sdk-ui/src/infra/contexts/sisense-context/sisense-context-provider.d.ts +1 -1
  44. package/dist/packages/sdk-ui/src/infra/formatting/format-data-set.d.ts +21 -0
  45. package/dist/packages/sdk-ui/src/infra/formatting/format-date.d.ts +67 -0
  46. package/dist/packages/sdk-ui/src/infra/formatting/format-number.d.ts +24 -0
  47. package/dist/packages/sdk-ui/src/infra/formatting/index.d.ts +5 -0
  48. package/dist/packages/sdk-ui/src/infra/modules/build-module-graph.d.ts +31 -0
  49. package/dist/packages/sdk-ui/src/infra/modules/build-module-registry.d.ts +31 -0
  50. package/dist/packages/sdk-ui/src/infra/modules/core-module-providers-tree.d.ts +11 -0
  51. package/dist/packages/sdk-ui/src/infra/modules/core-module.d.ts +26 -0
  52. package/dist/packages/sdk-ui/src/infra/modules/index.d.ts +3 -0
  53. package/dist/packages/sdk-ui/src/infra/modules/module-provider.d.ts +17 -0
  54. package/dist/packages/sdk-ui/src/infra/modules/modules-context.d.ts +20 -0
  55. package/dist/packages/sdk-ui/src/infra/modules/types.d.ts +79 -0
  56. package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +52 -2
  57. package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/widget-plugin-registry.d.ts +3 -3
  58. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/dimensions/get-dimension-name.d.ts +9 -0
  59. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/dimensions/translate-dimensions-to-json.d.ts +4 -3
  60. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/filters/get-filter-name.d.ts +10 -0
  61. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/filters/translate-filters-to-json.d.ts +3 -3
  62. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/get-query-element-summary.d.ts +23 -0
  63. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/measures/get-measure-name.d.ts +10 -0
  64. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/measures/translate-measures-to-json.d.ts +4 -3
  65. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/index.d.ts +3 -1
  66. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-from-json.d.ts +1 -1
  67. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-to-json.d.ts +4 -3
  68. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/adapters.d.ts +3 -2
  69. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/index.d.ts +1 -1
  70. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +70 -9
  71. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/to-widget-props.d.ts +3 -3
  72. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/translate-envelope-widget-from-json.d.ts +2 -3
  73. package/dist/packages/sdk-ui/src/modules/analytics-composer/types.d.ts +1 -18
  74. package/dist/packages/sdk-ui/src/props.d.ts +9 -0
  75. package/dist/packages/sdk-ui/src/public-api/alpha.d.ts +3 -0
  76. package/dist/packages/sdk-ui/src/public-api/public.d.ts +3 -1
  77. package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +1 -1
  78. package/dist/packages/sdk-ui/src/shared/components/loading-overlay.d.ts +1 -0
  79. package/dist/packages/sdk-ui/src/shared/hooks/use-element-height.d.ts +19 -0
  80. package/dist/packages/sdk-ui/src/shared/hooks/use-synced-state.d.ts +23 -2
  81. package/dist/packages/sdk-ui/src/shared/utils/filter-relations.d.ts +8 -0
  82. package/dist/packages/sdk-ui/src/shared/utils/gradient.d.ts +5 -0
  83. package/dist/types-7YG0uOzO.js +74 -0
  84. package/dist/{types-CzgBH2kL.cjs → types-DlYJ_DZ0.cjs} +1 -1
  85. package/dist/{use-hover-CaSOzp0i.cjs → use-hover-CANskYrn.cjs} +127 -127
  86. package/dist/{use-hover-B6VmMb06.js → use-hover-Dju4Dcv3.js} +11021 -10942
  87. package/dist/{utils-CsV-iYtb.js → utils-BKRpWUGm.js} +1061 -1058
  88. package/dist/{utils-BwGnDoB0.cjs → utils-C4PIba42.cjs} +10 -10
  89. package/dist/{widget-composer-C72Io-3c.cjs → widget-composer-BXEyx308.cjs} +1 -1
  90. package/dist/{widget-composer-Bv_OVu1o.js → widget-composer-DRDw1oBF.js} +3 -3
  91. package/package.json +9 -8
  92. package/dist/apply-styled-options-to-query-23D9br-S.cjs +0 -1
  93. package/dist/apply-styled-options-to-query-BagjzMqm.js +0 -5992
  94. package/dist/dimensions-Bn1EaWiP.js +0 -204
  95. package/dist/dimensions-D8r34WRI.cjs +0 -1
  96. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-scroll-persistence.d.ts +0 -16
  97. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/with-navigator-scroll-save.d.ts +0 -10
  98. package/dist/types-D3fPN43o.js +0 -74
@@ -30,6 +30,13 @@ export interface GetDashboardModelOptions {
30
30
  * @internal
31
31
  */
32
32
  useLegacyApiVersion?: boolean;
33
+ /**
34
+ * Whether to fetch the dashboard with admin-level access.
35
+ *
36
+ * @default false
37
+ * @sisenseInternal
38
+ */
39
+ adminAccess?: boolean;
33
40
  }
34
41
  /**
35
42
  * Retrieves a dashboard model by its OID.
@@ -1,4 +1,4 @@
1
- import { Dimension, Filter, FilterRelations, FilterRelationsModel, FilterRelationsModelNode, Measure } from '@sisense/sdk-data';
1
+ import { Dimension, Filter, FilterRelations, Measure } from '@sisense/sdk-data';
2
2
  import { JtdTarget, JumpToDashboardConfig, JumpToDashboardConfigForPivot, TriggerMethod } from '../../../domains/dashboarding/hooks/jtd/jtd-types';
3
3
  import { TabbersConfig } from '../../../domains/dashboarding/hooks/use-tabber';
4
4
  import { Panel, WidgetDto } from '../../../domains/widgets/components/widget-by-id/types';
@@ -7,7 +7,7 @@ import { type CascadingFilterDto, DashboardDto, type FilterDto, type LayoutDto }
7
7
  import type { SpecificWidgetOptions, WidgetsOptions, WidgetsPanelColumnLayout } from './types';
8
8
  type WidgetJtdDtoSlice = Pick<WidgetDto, 'oid' | 'type' | 'metadata' | 'drillToDashboardConfig'>;
9
9
  export declare const translateLayout: (layout: LayoutDto) => WidgetsPanelColumnLayout;
10
- export declare function extractDashboardFilters(dashboardFilters: Array<FilterDto | CascadingFilterDto>, filterRelationsModel?: FilterRelationsModel | FilterRelationsModelNode): Filter[] | FilterRelations;
10
+ export declare function extractDashboardFilters(dashboardFilters: Array<FilterDto | CascadingFilterDto>, filterRelationsDtoOptions?: DashboardDto['filterRelations']): Filter[] | FilterRelations;
11
11
  export declare const getJtdNavigateType: (widget: WidgetJtdDtoSlice) => TriggerMethod;
12
12
  export declare const convertDimensionsToDimIndexes: (widget: WidgetJtdDtoSlice, dimensionIds: string[]) => string[];
13
13
  /**
@@ -1,4 +1,5 @@
1
1
  import { DataSource } from '@sisense/sdk-data';
2
+ import { DashboardModel } from '../../../../../domains/dashboarding/dashboard-model';
2
3
  import { RestApi } from '../../../../../infra/api/rest-api';
3
4
  import { AppSettings } from '../../../../../infra/app/settings/settings';
4
5
  import { CompleteThemeSettingsInternal } from '../../../../../types';
@@ -22,6 +23,14 @@ export type PersistDashboardModelMiddlewareParams = {
22
23
  * still satisfies the server's datasource schema.
23
24
  */
24
25
  dashboardDataSource?: DataSource;
26
+ /**
27
+ * Pre-reducer dashboard model snapshot. Used by UPDATE_WIDGET to read
28
+ * `widgetsOptions[oid].partialDtoOptions.options` so the Fusion PATCH carries
29
+ * the full options object (Fusion replaces, not merges).
30
+ *
31
+ * @internal
32
+ */
33
+ model?: DashboardModel;
25
34
  };
26
35
  /**
27
36
  * Middleware that persists the dashboard model changes to the Sisense server.
@@ -29,4 +38,4 @@ export type PersistDashboardModelMiddlewareParams = {
29
38
  * @returns Promise resolving to the action (possibly transformed, e.g. for ADD_WIDGET)
30
39
  * @internal
31
40
  */
32
- export declare function persistDashboardModelMiddleware({ dashboardOid, action, restApi, sharedMode, appSettings, themeSettings, dashboardDataSource, }: PersistDashboardModelMiddlewareParams): Promise<UseDashboardModelInternalAction>;
41
+ export declare function persistDashboardModelMiddleware({ dashboardOid, action, restApi, sharedMode, appSettings, themeSettings, dashboardDataSource, model, }: PersistDashboardModelMiddlewareParams): Promise<UseDashboardModelInternalAction>;
@@ -1,5 +1,6 @@
1
1
  import { Filter, FilterRelations } from '@sisense/sdk-data';
2
2
  import { DashboardModel, SpecificWidgetOptions, WidgetsPanelLayout } from '../../../../../domains/dashboarding/dashboard-model';
3
+ import type { WidgetPropsUpdate } from '../../../../../domains/dashboarding/persistence/update-types.js';
3
4
  import type { WidgetDto } from '../../../../../domains/widgets/components/widget-by-id/types';
4
5
  import { WidgetModel } from '../../../../../domains/widgets/widget-model';
5
6
  export type UseDashboardModelState = DashboardModel | null;
@@ -21,6 +22,7 @@ export declare enum UseDashboardModelActionType {
21
22
  FILTERS_UPDATE = "FILTERS.UPDATE",
22
23
  ADD_WIDGET = "WIDGETS.ADD",
23
24
  PATCH_WIDGET = "WIDGETS.PATCH",
25
+ UPDATE_WIDGET = "WIDGETS.UPDATE",
24
26
  WIDGETS_PANEL_LAYOUT_UPDATE = "WIDGETS_PANEL_LAYOUT.UPDATE",
25
27
  WIDGETS_DELETE = "WIDGETS.DELETE"
26
28
  }
@@ -46,6 +48,18 @@ export type WidgetPatch = {
46
48
  max: number;
47
49
  };
48
50
  };
51
+ /**
52
+ * Full opaque widget style to send in the PATCH request. Used for custom
53
+ * (plugin) widgets whose `styleOptions` round-trip through `WidgetDto.style`.
54
+ * Must reconstruct the entire style object (the server replaces it on PATCH).
55
+ */
56
+ style?: WidgetDto['style'];
57
+ /**
58
+ * Full custom-widget options bag to send in the PATCH request.
59
+ * Must include all existing keys alongside the changed ones, because the
60
+ * server replaces the entire object rather than merging.
61
+ */
62
+ customOptions?: Record<string, unknown>;
49
63
  };
50
64
  /**
51
65
  * Internal actions for the dashboard model state used in {@link useDashboardModel}.
@@ -62,12 +76,26 @@ export type UseDashboardModelInternalAction = UseDashboardModelAction | {
62
76
  widgets: string[];
63
77
  };
64
78
  };
79
+ /**
80
+ * Props-shaped widget update action. Carries a partial `WidgetPropsUpdate` that
81
+ * the reducer applies to the in-memory `WidgetModel` and the persist middleware
82
+ * translates to a targeted DTO patch via its per-field mapping table.
83
+ *
84
+ * @internal
85
+ */
86
+ export type UseDashboardModelUpdateWidgetAction = {
87
+ type: UseDashboardModelActionType.UPDATE_WIDGET;
88
+ payload: {
89
+ widgetOid: string;
90
+ update: WidgetPropsUpdate;
91
+ };
92
+ };
65
93
  /**
66
94
  * Actions for the dashboard model state used in {@link useDashboardModel}.
67
95
  *
68
96
  * @internal
69
97
  */
70
- export type UseDashboardModelAction = UseDashboardModelFilterUpdateAction | UseDashboardModelAddWidgetAction | UseDashboardModelPatchWidgetAction | UseDashboardModelLayoutUpdateAction | UseDashboardWidgetsDeleteAction;
98
+ export type UseDashboardModelAction = UseDashboardModelFilterUpdateAction | UseDashboardModelAddWidgetAction | UseDashboardModelPatchWidgetAction | UseDashboardModelUpdateWidgetAction | UseDashboardModelLayoutUpdateAction | UseDashboardWidgetsDeleteAction;
71
99
  /**
72
100
  * Filter update actions for the dashboard model state used in {@link useDashboardModel}.
73
101
  *
@@ -0,0 +1,27 @@
1
+ import type { DashboardPersistenceManager } from '../../../domains/dashboarding/persistence/types';
2
+ import type { WidgetProps } from '../../../domains/widgets/components/widget/types';
3
+ type Persistence = Pick<DashboardPersistenceManager, 'updateWidget'> | undefined;
4
+ /**
5
+ * Composition middleware that adds persistable widget-update plumbing to a
6
+ * widget list. For each widget that exposes a known runtime-state callback
7
+ * (currently only `styleOptions.navigator.onScrollerChange` for charts with
8
+ * a navigator), the hook injects a handler that:
9
+ *
10
+ * 1. Applies the update optimistically to local widget state (the parent
11
+ * `useComposedDashboardInternal` re-renders with the new value).
12
+ * 2. Schedules a debounced (500 ms) call to `persistence.updateWidget` with
13
+ * a {@link WidgetPropsUpdate}-shaped payload.
14
+ *
15
+ * When `persistence` is `undefined`, the optimistic apply still runs (so
16
+ * visualizations behave correctly in read-only mode) and the persist call
17
+ * is skipped.
18
+ *
19
+ * Errors during persistence are logged via `console.error`; the hook does
20
+ * not roll back local state.
21
+ *
22
+ * @sisenseInternal
23
+ */
24
+ export declare function useWidgetUpdatesPersistence(widgets: WidgetProps[], setWidgets: (updater: (prev: WidgetProps[]) => WidgetProps[]) => void, persistence?: Persistence): {
25
+ widgets: WidgetProps[];
26
+ };
27
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Deep-merges a partial `update` into `base` for widget-update persistence.
3
+ *
4
+ * Merge semantics (shared by every merge point of the unified widget-update
5
+ * channel — pending-update accumulator, optimistic apply, model reducer and
6
+ * DTO patch):
7
+ * - nested plain objects are merged recursively at any depth;
8
+ * - arrays, primitives and non-plain objects (e.g. `Date`) are replaced
9
+ * wholesale (last-write-wins);
10
+ * - keys cannot be deleted via merge — overwrite with an explicit value
11
+ * (e.g. `null`) instead.
12
+ *
13
+ * Pure: returns a new object, never mutates the inputs.
14
+ *
15
+ * @internal
16
+ */
17
+ export declare function deepMerge<T extends object>(base: T, update: object): T;
@@ -1,5 +1,7 @@
1
1
  import type { SpecificWidgetOptions, WidgetPatch, WidgetsPanelLayout } from '../../../domains/dashboarding/dashboard-model';
2
2
  import type { WidgetProps } from '../../../domains/widgets/components/widget/types';
3
+ import type { WidgetPropsUpdate } from './update-types.js';
4
+ export type { WidgetPropsUpdate, OnWidgetUpdate } from './update-types.js';
3
5
  /**
4
6
  * Interface for persisting dashboard changes from the composition layer (e.g. add widget).
5
7
  *
@@ -49,4 +51,17 @@ export type DashboardPersistenceManager = {
49
51
  * The patch to apply to the widget.
50
52
  */
51
53
  patch: WidgetPatch) => Promise<void>;
54
+ /**
55
+ * Apply a props-shaped partial update to an existing widget. The composition
56
+ * layer's preferred write channel for visualization-originated state
57
+ * (scroll, customOptions, future title/description). Internally routed
58
+ * through the per-field DTO patch table in `persist-dashboard-model-middleware`.
59
+ *
60
+ * Fire-and-forget; errors are logged at the call site. The reducer applies
61
+ * the update to the canonical `WidgetModel` synchronously before the REST
62
+ * call fires.
63
+ *
64
+ * @sisenseInternal
65
+ */
66
+ updateWidget: (widgetOid: string, update: WidgetPropsUpdate) => Promise<void>;
52
67
  };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Narrow, props-shaped slice of widget state that can be persisted through the
3
+ * unified `DashboardPersistenceManager.updateWidget` channel. Intentionally
4
+ * narrow on first landing — extended only when a new field is paired with a
5
+ * row in the persist middleware's per-field DTO patch table AND an
6
+ * update→DTO-patch→re-read roundtrip test.
7
+ *
8
+ * For the persistable-vs-transient distinction, see
9
+ * [unified-widget-updates-persistence.md §6.4](./__dev-docs__/unified-widget-updates-persistence.md).
10
+ * Transient/interactive events (drilldown selections, in-progress title edits)
11
+ * stay on the {@link WidgetChangeEvent} channel.
12
+ *
13
+ * @sisenseInternal
14
+ */
15
+ export type WidgetPropsUpdate = {
16
+ readonly styleOptions?: {
17
+ readonly navigator?: {
18
+ readonly scrollerLocation?: {
19
+ readonly min: number;
20
+ readonly max: number;
21
+ };
22
+ };
23
+ /**
24
+ * For custom (plugin) widgets, `styleOptions` is an opaque deeply-partial
25
+ * bag — arbitrary keys are deep-merged into the widget's opaque DTO
26
+ * `style` (see `deepMerge` for the semantics). Chart widgets only use the
27
+ * typed `navigator` subtree above.
28
+ */
29
+ readonly [key: string]: unknown;
30
+ };
31
+ /**
32
+ * Custom-widget-specific runtime options to persist. Only meaningful for
33
+ * custom (plugin) widgets. The middleware deep-merges this into the widget
34
+ * DTO's `customOptions` bag, preserving any existing keys (at any depth) not
35
+ * present in the update.
36
+ *
37
+ * Only serializable values should be passed — non-serializable values cannot
38
+ * survive the DTO round-trip.
39
+ */
40
+ readonly customOptions?: Readonly<Record<string, unknown>>;
41
+ };
42
+ /**
43
+ * Callback signature used internally by `useWidgetUpdatesPersistence` to emit
44
+ * a persistable update for a specific widget. Not part of the public
45
+ * `WidgetProps` surface — composition layer injects handlers into the
46
+ * visualization's existing callback APIs (e.g.
47
+ * `styleOptions.navigator.onScrollerChange`).
48
+ *
49
+ * @internal
50
+ */
51
+ export type OnWidgetUpdate = (update: WidgetPropsUpdate) => void;
@@ -20,7 +20,6 @@ export type CalendarHeatmapChartData = {
20
20
  * @param chartDataOptions - Internal data options specifying which columns to use
21
21
  * @param dataTable - Raw data table containing the source data
22
22
  * @returns Formatted calendar heatmap chart data
23
-
24
23
  */
25
24
  export declare function getCalendarHeatmapChartData(chartDataOptions: CalendarHeatmapChartDataOptionsInternal, dataTable: DataTable): CalendarHeatmapChartData;
26
25
  /**
@@ -1,4 +1,4 @@
1
- import { CalculatedMeasureColumn, Column, MeasureColumn } from '@sisense/sdk-data';
1
+ import { CalculatedColumn, CalculatedMeasureColumn, Column, MeasureColumn } from '@sisense/sdk-data';
2
2
  import { DataColumnNamesMapping } from '../chart-data-options/validate-data-options';
3
3
  import { DataTable } from '../chart-data-processor/table-processor';
4
- export declare const filterAndAggregateChartData: (sourceTable: DataTable, attributes: Column[], measures: (MeasureColumn | CalculatedMeasureColumn)[], dataColumnNamesMapping?: DataColumnNamesMapping) => DataTable;
4
+ export declare const filterAndAggregateChartData: (sourceTable: DataTable, attributes: (Column | CalculatedColumn)[], measures: (MeasureColumn | CalculatedMeasureColumn)[], dataColumnNamesMapping?: DataColumnNamesMapping) => DataTable;
@@ -1,5 +1,5 @@
1
- import { CalculatedMeasureColumn, Column, ForecastFormulaOptions, MeasureColumn, PivotGrandTotals, TotalsCalculation, TrendFormulaOptions } from '@sisense/sdk-data';
2
- import type { LineWidth, Markers, MultiColumnValueToColorMap, NumberFormatConfig, PivotRowsSort, SeriesChartType, SortDirection, ValueToColorMap } from '../../../../types';
1
+ import { CalculatedColumn, CalculatedMeasureColumn, Column, ForecastFormulaOptions, MeasureColumn, PivotGrandTotals, TotalsCalculation, TrendFormulaOptions } from '@sisense/sdk-data';
2
+ import type { GenericDataOptions, LineWidth, Markers, MultiColumnValueToColorMap, NumberFormatConfig, PivotRowsSort, SeriesChartType, SortDirection, ValueToColorMap } from '../../../../types';
3
3
  import { ConditionalDataColorOptions, DataColorOptions, UniformDataColorOptions } from '../chart-data/data-coloring';
4
4
  /**
5
5
  * Styles for a category/column when visualized in a chart
@@ -99,8 +99,8 @@ export interface CategoryStyle {
99
99
  * Also, see {@link StyledMeasureColumn}.
100
100
  */
101
101
  export interface StyledColumn extends CategoryStyle {
102
- /** Wrapped Column */
103
- column: Column;
102
+ /** Wrapped Column or CalculatedColumn (calculated dimension) */
103
+ column: Column | CalculatedColumn;
104
104
  }
105
105
  /**
106
106
  * Styles for a value/measure when it is visualized in a chart.
@@ -237,7 +237,7 @@ export interface StyledMeasureColumn extends ValueStyle, SeriesStyle {
237
237
  /**
238
238
  * @internal
239
239
  */
240
- export type AnyColumn = Column | StyledColumn | MeasureColumn | StyledMeasureColumn | CalculatedMeasureColumn;
240
+ export type AnyColumn = Column | CalculatedColumn | StyledColumn | MeasureColumn | StyledMeasureColumn | CalculatedMeasureColumn;
241
241
  /**
242
242
  * Configuration for how to query aggregate data and assign data
243
243
  * to axes of a {@link CartesianChartType | Cartesian chart}.
@@ -251,7 +251,7 @@ export interface CartesianChartDataOptions {
251
251
  *
252
252
  * Typically, the X-axis represents descriptive data.
253
253
  */
254
- category: (Column | StyledColumn)[];
254
+ category: (Column | CalculatedColumn | StyledColumn)[];
255
255
  /**
256
256
  * Measure columns (or measures) whose values are scaled to the Y-axis of the chart.
257
257
  *
@@ -265,7 +265,7 @@ export interface CartesianChartDataOptions {
265
265
  * Each group is represented by a different visual encoding - for example, color of bars in a bar chart,
266
266
  * and is automatically added to the chart's legend.
267
267
  */
268
- breakBy: (Column | StyledColumn)[];
268
+ breakBy: (Column | CalculatedColumn | StyledColumn)[];
269
269
  /**
270
270
  * Optional mapping of each of the series to colors.
271
271
  */
@@ -288,7 +288,7 @@ export interface CategoricalChartDataOptions {
288
288
  *
289
289
  * For funnel charts, only the first 50 categories will be used.
290
290
  */
291
- category: (Column | StyledColumn)[];
291
+ category: (Column | CalculatedColumn | StyledColumn)[];
292
292
  /**
293
293
  * Optional mapping of each of the series to colors.
294
294
  * ({@link MultiColumnValueToColorMap} used only for the Sunburst Chart component)
@@ -323,14 +323,14 @@ export interface ScatterChartDataOptions {
323
323
  * Typically, the X-axis of a Scatter Chart is used to represent numeric data.
324
324
  * Alternatively, Descriptive data is also supported. At most one column is allowed.
325
325
  */
326
- x?: Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
326
+ x?: Column | CalculatedColumn | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
327
327
  /**
328
328
  * A column or measure column whose values are placed on the Y-axis.
329
329
  *
330
330
  * Typically, the Y-axis of a Scatter Chart is used to represent numeric data.
331
331
  * Alternatively, Descriptive data is also supported. At most one column is allowed.
332
332
  */
333
- y?: Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
333
+ y?: Column | CalculatedColumn | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
334
334
  /**
335
335
  * A column to be scattered across the chart as circles;
336
336
  * one point (circle) appears on the chart for each member of this column.
@@ -338,7 +338,7 @@ export interface ScatterChartDataOptions {
338
338
  *
339
339
  * You can only add a break-by point if either the X-axis or the Y-axis was defined to represent numeric data.
340
340
  */
341
- breakByPoint?: Column | StyledColumn;
341
+ breakByPoint?: Column | CalculatedColumn | StyledColumn;
342
342
  /**
343
343
  * Select a column by which to break (group) the columns in the chart.
344
344
  * This must be a descriptive column. If you select descriptive data,
@@ -353,7 +353,7 @@ export interface ScatterChartDataOptions {
353
353
  * the darkest color and the lowest value is the lightest color.
354
354
  *
355
355
  */
356
- breakByColor?: Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
356
+ breakByColor?: Column | CalculatedColumn | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
357
357
  /**
358
358
  * Column that determines the size of the circle. It must be numeric data.
359
359
  *
@@ -370,7 +370,7 @@ export interface ScatterChartDataOptions {
370
370
  */
371
371
  export interface AreamapChartDataOptions {
372
372
  /** Column or attribute representing the countries (or states) on the map. */
373
- geo: [Column | StyledColumn];
373
+ geo: [Column | CalculatedColumn | StyledColumn];
374
374
  /** Measure column (or measure) encoded by the color of the countries (or states) on the map. */
375
375
  color?: [MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn];
376
376
  }
@@ -380,7 +380,7 @@ export interface AreamapChartDataOptions {
380
380
  */
381
381
  export interface CalendarHeatmapChartDataOptions {
382
382
  /** Date column representing dates on the calendar heatmap. */
383
- date: Column | StyledColumn;
383
+ date: Column | CalculatedColumn | StyledColumn;
384
384
  /** Measure column (or measure) assigned to the calendar cells. */
385
385
  value: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
386
386
  }
@@ -391,7 +391,7 @@ export interface TableDataOptions {
391
391
  /**
392
392
  * Columns (or attributes) whose values represent data columns in table
393
393
  */
394
- columns: (Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
394
+ columns: (Column | CalculatedColumn | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn)[];
395
395
  }
396
396
  /**
397
397
  * Configuration for how to query data and assign data to tabular charts.
@@ -407,13 +407,13 @@ export interface PivotTableDataOptions {
407
407
  *
408
408
  * @category Data Options
409
409
  */
410
- rows?: (Column | StyledColumn)[];
410
+ rows?: (Column | CalculatedColumn | StyledColumn)[];
411
411
  /**
412
412
  * Dimensions for the columns of the pivot table
413
413
  *
414
414
  * @category Data Options
415
415
  */
416
- columns?: (Column | StyledColumn)[];
416
+ columns?: (Column | CalculatedColumn | StyledColumn)[];
417
417
  /**
418
418
  * Measures for the values of the pivot table
419
419
  *
@@ -446,7 +446,7 @@ export interface ScattermapChartDataOptions {
446
446
  * Support field(s) that contain geographic data (Country, City, State/Province, etc)
447
447
  * To visualize latitude and longitude data, you have to add one field containing latitude data, and another field containing longitude data, in this order.
448
448
  */
449
- geo: (Column | StyledColumn)[];
449
+ geo: (Column | CalculatedColumn | StyledColumn)[];
450
450
  /**
451
451
  * Measure column (or measure) representing the size of the points on the map.
452
452
  */
@@ -458,7 +458,7 @@ export interface ScattermapChartDataOptions {
458
458
  /**
459
459
  * Column or measure column representing the additional details for the points on the map.
460
460
  */
461
- details?: Column | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
461
+ details?: Column | CalculatedColumn | StyledColumn | MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
462
462
  }
463
463
  /**
464
464
  * Represents the type of box whisker data algorithm, which can be either `iqr`, `extremums`, or `standardDeviation`.
@@ -475,7 +475,7 @@ export type BoxplotChartDataOptions = {
475
475
  /**
476
476
  * Columns (or attributes) whose values represent categories in the chart.
477
477
  */
478
- category: [(Column | StyledColumn)?];
478
+ category: [(Column | CalculatedColumn | StyledColumn)?];
479
479
  /**
480
480
  * Columns (or attributes) whose values represent the target numeric value column for computing boxplot metrics according to the selected `boxType`
481
481
  */
@@ -500,7 +500,7 @@ export type BoxplotChartCustomDataOptions = {
500
500
  /**
501
501
  * Columns (or attributes) whose values represent categories in the chart.
502
502
  */
503
- category: [(Column | StyledColumn)?];
503
+ category: [(Column | CalculatedColumn | StyledColumn)?];
504
504
  /**
505
505
  * Measure columns (or measures) representing the target numeric values used for computing boxplot metrics.
506
506
  */
@@ -530,7 +530,7 @@ export interface RangeChartDataOptions {
530
530
  *
531
531
  * Typically, the X-axis represents descriptive data.
532
532
  */
533
- category: (Column | StyledColumn)[];
533
+ category: (Column | CalculatedColumn | StyledColumn)[];
534
534
  /**
535
535
  * An array of measure columns used to represent the target numeric values for computing the metrics
536
536
  * in an area range chart.
@@ -545,7 +545,7 @@ export interface RangeChartDataOptions {
545
545
  * Each group is represented by a different visual encoding - for example, color of bars in a bar chart,
546
546
  * and is automatically added to the chart's legend.
547
547
  */
548
- breakBy: (Column | StyledColumn)[];
548
+ breakBy: (Column | CalculatedColumn | StyledColumn)[];
549
549
  /**
550
550
  * Optional mapping of each of the series to colors.
551
551
  */
@@ -564,6 +564,10 @@ export interface RangeChartDataOptions {
564
564
  * {@link ScattermapChartDataOptions | Scattermap} charts.
565
565
  */
566
566
  export type ChartDataOptions = RegularChartDataOptions | TabularChartDataOptions;
567
+ /**
568
+ * Union of data options for all supported CSDK visualization (chart) types
569
+ */
570
+ export type CommonDataOptions = ChartDataOptions | PivotTableDataOptions | GenericDataOptions;
567
571
  /**
568
572
  * Configuration for how to query aggregate data and assigning data to chart encodings of regular charts.
569
573
  */
@@ -1,4 +1,4 @@
1
- import { Attribute, CalculatedMeasureColumn, Column, Measure, MeasureColumn } from '@sisense/sdk-data';
1
+ import { Attribute, CalculatedColumn, CalculatedMeasureColumn, Column, Measure, MeasureColumn } from '@sisense/sdk-data';
2
2
  import { AnyColumn, CategoryStyle, StyledColumn, StyledMeasureColumn, ValueStyle } from './types.js';
3
3
  type AnyObject = Record<string, any>;
4
4
  /**
@@ -21,7 +21,7 @@ export declare const safeMerge: <T extends AnyObject, S extends AnyObject>(sourc
21
21
  */
22
22
  export declare const safeCombine: <T extends AnyObject>(sourceWithInheritance: T, sourceToAbsorb: AnyObject) => T;
23
23
  export declare const splitColumn: <C extends AnyColumn>(targetColumn: C) => {
24
- column: Column | MeasureColumn | CalculatedMeasureColumn;
24
+ column: Column | MeasureColumn | CalculatedMeasureColumn | CalculatedColumn;
25
25
  style: CategoryStyle | ValueStyle;
26
26
  } | {
27
27
  column: C;
@@ -44,7 +44,7 @@ export declare function isMeasureColumn(arg: AnyColumn): arg is MeasureColumn |
44
44
  export declare const getDataOptionTitle: (styledColumn: StyledColumn | StyledMeasureColumn) => string;
45
45
  export declare const getDataOptionGranularity: ({ column, granularity }: StyledColumn) => string;
46
46
  /** @internal */
47
- export declare const translateColumnToAttribute: (c: Column | StyledColumn) => Attribute;
47
+ export declare const translateColumnToAttribute: (c: Column | CalculatedColumn | StyledColumn) => Attribute;
48
48
  export declare const translateColumnToMeasure: (c: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn) => Measure;
49
49
  /**
50
50
  * Checks if column is a StyledColumns.
@@ -60,7 +60,7 @@ export declare function isStyledColumn(targetColumn: AnyColumn): targetColumn is
60
60
  * @internal
61
61
  */
62
62
  export declare function isCategoryStyle(category: Column | CategoryStyle): category is CategoryStyle;
63
- export declare function normalizeColumn(targetColumn: Column | StyledColumn, defaultStyle?: CategoryStyle): StyledColumn;
63
+ export declare function normalizeColumn(targetColumn: Column | CalculatedColumn | StyledColumn, defaultStyle?: CategoryStyle): StyledColumn;
64
64
  export declare function normalizeMeasureColumn(targetColumn: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn, defaultStyle?: ValueStyle): StyledMeasureColumn;
65
65
  export declare function normalizeAnyColumn(targetColumn: AnyColumn, defaultStyle?: CategoryStyle | ValueStyle): StyledColumn | StyledMeasureColumn;
66
66
  export {};
@@ -0,0 +1,14 @@
1
+ import type { Filter } from '@sisense/sdk-data';
2
+ /**
3
+ * Builds a human-readable one-line label for a {@link Filter}, covering common
4
+ * `filterType` variants (`members`, `exclude`, `text`, `numeric`, `dateRange`, etc.).
5
+ *
6
+ * Discrimination uses the `filterType` string rather than `instanceof` so the helper
7
+ * stays robust when multiple `@sisense/sdk-data` copies exist in a workspace.
8
+ *
9
+ * @param filter - Filter instance to describe
10
+ * @param attributeName - Optional display name override (e.g. i18n date-level label)
11
+ * @returns Readable pill label; falls back to the attribute name when composition fails
12
+ * @sisenseInternal
13
+ */
14
+ export declare function toReadableFilterLabel(filter: Filter, attributeName?: string): string;
@@ -3,6 +3,7 @@ export type { QueryDefinitionProps } from './query-definition';
3
3
  export { QueryPill } from './query-pill';
4
4
  export type { QueryPillProps } from './query-pill';
5
5
  export { baseQueryParamsToViewModel } from './query-params-to-view-model';
6
+ export { toReadableFilterLabel } from './filter-to-readable-label';
6
7
  export { getQueryPillTooltipModel } from './compose-code-to-readable';
7
8
  export type { TooltipModel } from './compose-code-to-readable';
8
9
  export type { QueryPillCategory, QueryPillItem, ConnectorItem, QueryDefinitionViewModel, } from './types';
@@ -16,6 +16,11 @@ export interface QueryDefinitionProps {
16
16
  * root is only one row tall and must not be used as boundary (breaks vertical placement).
17
17
  */
18
18
  tooltipBoundaryElement?: HTMLElement | null;
19
+ /**
20
+ * Maximum number of characters shown in each pill label before truncation (default `25`).
21
+ * Pass `0` to show the full label.
22
+ */
23
+ maxPillLength?: number;
19
24
  }
20
25
  /**
21
26
  * Read-only query definition as colored pills above the widget.
@@ -9,6 +9,11 @@ export interface QueryPillProps {
9
9
  item: QueryPillItem;
10
10
  showTooltip?: boolean;
11
11
  tooltipBoundaryElement?: HTMLElement | null;
12
+ /**
13
+ * Maximum number of characters shown in the pill label before truncation.
14
+ * When `0` or omitted, the full label is shown.
15
+ */
16
+ maxLength?: number;
12
17
  }
13
18
  /**
14
19
  * Read-only query-definition pill; JSON tooltip is a portal bubble with a real triangle.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Truncates a pill label when it exceeds `maxLength`. When `maxLength` is zero or negative,
3
+ * the label is returned unchanged.
4
+ *
5
+ * @param label - Full pill label
6
+ * @param maxLength - Maximum number of characters before truncation; `0` disables truncation
7
+ * @returns Truncated label with an ellipsis suffix when shortened
8
+ * @internal
9
+ */
10
+ export declare function truncatePillLabel(label: string, maxLength: number): string;
@@ -69,5 +69,11 @@ export type PivotTableWidgetChangeEvent = PivotTableWidgetDrilldownSelectionsCha
69
69
  * }
70
70
  * }}
71
71
  * ```
72
+ *
73
+ * Persistable state changes (e.g. scroll position, future title/customOptions)
74
+ * flow through {@link WidgetPropsUpdate} and `DashboardPersistenceManager.updateWidget`,
75
+ * NOT through this channel. Use `WidgetChangeEvent` for transient/interactive
76
+ * events; use `WidgetPropsUpdate` for "if this is lost on reload, the user
77
+ * notices."
72
78
  */
73
79
  export type WidgetChangeEvent = ChartWidgetChangeEvent | PivotTableWidgetChangeEvent;
@@ -1,4 +1,5 @@
1
1
  import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
2
+ import type { VisualizationStateUpdate } from '../../../../infra/plugins/widget-plugins/types';
2
3
  import { CustomWidgetEventProps, CustomWidgetStyleOptions, GenericDataOptions } from '../../../../types';
3
4
  import { WidgetConfig } from '../widget/types';
4
5
  /**
@@ -77,4 +78,14 @@ export interface CustomWidgetProps extends CustomWidgetEventProps {
77
78
  * @category Widget
78
79
  */
79
80
  customOptions?: Record<string, any>;
81
+ /**
82
+ * Emit a partial state update to be persisted through the dashboard
83
+ * persistence layer. Injected by the dashboard composition layer
84
+ * (`useWidgetUpdatesPersistence`) and forwarded to the plugin visualization
85
+ * component as {@link CustomVisualizationProps.onChange}.
86
+ *
87
+ * @category Widget
88
+ * @internal
89
+ */
90
+ onChange?: (update: VisualizationStateUpdate) => void;
80
91
  }
@@ -1,5 +1,20 @@
1
1
  import { type FunctionComponent } from 'react';
2
2
  import { PivotTableWidgetProps } from './types';
3
+ /**
4
+ * Computes the outer widget height in auto-height mode.
5
+ *
6
+ * The inner pivot reports only its own table height. The widget reserves additional vertical
7
+ * space above the pivot — the container chrome (header + `spaceAround` padding, SNS-127785) and
8
+ * the optional top slot (e.g. drilldown breadcrumbs, SNS-128141). Callers must sum all such
9
+ * non-pivot reserved space into `reservedHeight` so that pagination at the bottom of the pivot
10
+ * remains reachable.
11
+ *
12
+ * @param pivotTableHeight - The measured content height of the pivot table.
13
+ * @param reservedHeight - The total non-pivot vertical space the widget reserves (chrome + topSlot).
14
+ * @returns The total widget height in pixels, or `undefined` when the content height is unknown.
15
+ * @internal
16
+ */
17
+ export declare function calcPivotTableWidgetHeight(pivotTableHeight: number | undefined, reservedHeight: number): number | undefined;
3
18
  /**
4
19
  * React component extending `PivotTable` to support widget style options.
5
20
  *