@sisense/sdk-ui 2.29.0 → 2.30.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/dist/ai.cjs +57 -57
- package/dist/ai.js +767 -797
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +723 -696
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/{apply-styled-options-to-query-CaP4IMrQ.js → apply-styled-options-to-query-BK1NnV4P.js} +1936 -1862
- package/dist/apply-styled-options-to-query-Dl8vVNxo.cjs +1 -0
- package/dist/{index-C77YCBVd.js → index-DCYw3JUB.js} +29 -7
- package/dist/index-DTvxJdqZ.cjs +1 -0
- package/dist/index.cjs +575 -482
- package/dist/index.js +26629 -25620
- package/dist/index.umd.js +925 -802
- package/dist/packages/sdk-ui/src/domains/dashboarding/common-filters/utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-container.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header-config.d.ts +127 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header-targets.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header-title.d.ts +20 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/components/dashboard-header.d.ts +10 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/constants.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-helpers.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +43 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/utils.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-module/dashboard-module.d.ts +34 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-module/types.d.ts +58 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-dashboard-header-menu-item.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +11 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +18 -7
- package/dist/packages/sdk-ui/src/domains/dashboarding/utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/add-measure-data-browser.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/add-measure-popover.d.ts +14 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/measure-ranking-title.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/add-measure-popover/measures.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/criteria-filter-tile/criteria-filter-menu.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/criteria-filter-tile/criteria-filter-operations.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/filter-editor-context.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/filter-editor-popover.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/filter-editor.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/numeric-condition-section/types.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/ranking-condition/index.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/ranking-condition/ranking-condition-controls.d.ts +33 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filter-editor-popover/sections/ranking-condition/ranking-condition-utils.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/filters/components/filters-panel/hooks/use-existing-filter-editing.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-collapsible.d.ts +22 -4
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-top-slot-shell.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-trigger-button.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative-interactive.d.ts +20 -2
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative.d.ts +11 -9
- package/dist/packages/sdk-ui/src/domains/narrative/core/build-narrative-request.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/narrative/core/get-narrative-dimensions-and-measures.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/narrative/core/get-widget-narrative-from-widget-props.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/to-nlg-api-verbosity.d.ts +7 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +101 -23
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +35 -32
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +11 -22
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-line-height.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +8 -9
- package/dist/packages/sdk-ui/src/domains/query-execution/core/execute-query.d.ts +34 -1
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-export/build-jaql-excel-export.d.ts +13 -5
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-excel-query/excel-export/build-xlsx-export-payload.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-query-by-widget-id/use-execute-query-by-widget-id.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/query-execution/types.d.ts +55 -3
- package/dist/packages/sdk-ui/src/domains/shared/header/header-item-size.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/header-items-renderer.d.ts +19 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/header-spacer-item.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/index.d.ts +6 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/resolve-header-items.d.ts +17 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/types.d.ts +98 -0
- package/dist/packages/sdk-ui/src/domains/shared/header/use-resolved-header-items.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/areamap-chart/data/areamap-data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/helpers/data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/stackable/streamgraph-chart/helpers/chart-data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/categoricals/helpers/data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/categoricals/sunburst-chart/data/index.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/categoricals/treemap-chart/data/index.d.ts +3 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/build-highchart-options.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/alerts/index.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/data/index.d.ts +22 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/data-options/index.d.ts +33 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/design-options/index.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/highchart-options/highcharts-options-builder.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/sankey-chart-builder.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/sankey-node-colors.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/sankey-chart/types.d.ts +38 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/types.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/types.d.ts +12 -9
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/formatters/data-cell-formatters/data-cell-value-formatter.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/hooks/use-pivot-data-loading.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pivot-table/resolve-pivot-container-size.d.ts +28 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/sankey-chart.d.ts +30 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/pure-table/helpers/format-numbers.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/cartesian-data.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/categorical-data.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/chart-data-service.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/scatter-data.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/types.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/apply-styled-options-to-query.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +47 -7
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/chart-options-service.d.ts +3 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/tooltip.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/design-options.d.ts +10 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/funnel-plot-options.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/number-format-config.d.ts +12 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/pie-plot-options.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-levels.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/sunburst/sunburst-options.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/treemap/treemap-tooltip.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/types.d.ts +12 -3
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/types.d.ts +8 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-chart-widget-excel-download.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/use-chart-widget-narrative.d.ts +28 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/use-custom-widget-excel-download.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/pivot-table-widget.d.ts +4 -4
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/types.d.ts +7 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/use-pivot-widget-excel-download.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/tabber.d.ts +17 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/widget-narrative-style.d.ts +31 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +30 -1
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/excel-export-map-dimensions-measures.d.ts +17 -2
- package/dist/packages/sdk-ui/src/domains/widgets/helpers/number-format-config-to-numeric-mask.d.ts +5 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-container/widget-container.d.ts +7 -1
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model.d.ts +6 -1
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-endpoints.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/app/types.d.ts +18 -0
- package/dist/packages/sdk-ui/src/infra/plugins/types.d.ts +34 -6
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +169 -49
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +22 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +44 -0
- package/dist/packages/sdk-ui/src/modules/ai/common/collapsible.d.ts +38 -2
- package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +4 -13
- package/dist/packages/sdk-ui/src/modules/ai/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/process-measured-value.d.ts +14 -0
- package/dist/packages/sdk-ui/src/props.d.ts +46 -2
- package/dist/packages/sdk-ui/src/public-api/alpha.d.ts +3 -1
- package/dist/packages/sdk-ui/src/public-api/beta.d.ts +6 -0
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +5 -3
- package/dist/packages/sdk-ui/src/types.d.ts +78 -6
- package/dist/{use-hover-Dju4Dcv3.js → quota-notification-DqabeDbO.js} +23733 -22015
- package/dist/quota-notification-gYE6PTWA.cjs +750 -0
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +27 -5
- package/dist/translations/en-us.cjs +1 -1
- package/dist/translations/en-us.js +1 -1
- package/dist/translations/es-ar.cjs +1 -1
- package/dist/translations/es-ar.js +27 -5
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +27 -5
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +27 -5
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +29 -7
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +27 -5
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +27 -5
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +29 -7
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +27 -5
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +27 -5
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +27 -5
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +27 -5
- package/dist/{types-DlYJ_DZ0.cjs → types-DSNnndG6.cjs} +1 -1
- package/dist/{types-7YG0uOzO.js → types-DecTaxy7.js} +1 -1
- package/dist/{utils-C4PIba42.cjs → utils-Cpeyj9TN.cjs} +52 -52
- package/dist/{utils-BKRpWUGm.js → utils-L-HO2pCd.js} +2518 -2469
- package/dist/{widget-composer-BXEyx308.cjs → widget-composer-CyWQaInf.cjs} +1 -1
- package/dist/{widget-composer-DRDw1oBF.js → widget-composer-u6NMLm1C.js} +3 -3
- package/package.json +8 -8
- package/dist/apply-styled-options-to-query-D5D8pRl2.cjs +0 -1
- package/dist/index-C9G8giSk.cjs +0 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-dashboard-header-toolbar.d.ts +0 -25
- package/dist/use-hover-CANskYrn.cjs +0 -720
|
@@ -1,42 +1,33 @@
|
|
|
1
1
|
import type { WidgetProps } from '../../../domains/widgets/components/widget/types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { HookEnableParam } from '../../../shared/hooks/types';
|
|
3
3
|
import { type WidgetNarrativeQueryState } from './use-widget-narrative-state.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Parameters for {@link useGetWidgetNarrative}.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
export type UseGetWidgetNarrativeOptions = WidgetNarrativeOptions & {
|
|
14
|
-
/**
|
|
15
|
-
* When `false`, skips the narrative request.
|
|
16
|
-
*
|
|
17
|
-
* @default true
|
|
18
|
-
*/
|
|
19
|
-
enabled?: boolean;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
8
|
+
* Narrative endpoint selection uses `app.settings.narrative.canGenerateNarrativeViaAI` from
|
|
9
|
+
* {@link useSisenseContext}. {@link WidgetNarrativeOptions} come from
|
|
10
|
+
* `widgetProps.aiOptions.narrative` (see {@link getCompleteWidgetNarrativeOptions}).
|
|
11
|
+
*
|
|
12
|
+
* The `enabled` flag follows {@link HookEnableParam} (defaults to `true` when omitted).
|
|
22
13
|
* @sisenseInternal
|
|
23
14
|
*/
|
|
24
15
|
export type UseGetWidgetNarrativeParams = {
|
|
25
16
|
/** Widget configuration whose query drives the narrative (chart or pivot). */
|
|
26
17
|
widgetProps: WidgetProps;
|
|
27
|
-
} &
|
|
18
|
+
} & HookEnableParam;
|
|
28
19
|
/**
|
|
29
20
|
* @sisenseInternal
|
|
30
21
|
*/
|
|
31
22
|
export type UseGetWidgetNarrativeResult = WidgetNarrativeQueryState & {
|
|
32
23
|
/**
|
|
33
24
|
* `true` when `widgetProps` is a chart or pivot widget and narrative params could be built
|
|
34
|
-
* (including resolving `dataSource` via `defaultDataSource`).
|
|
25
|
+
* (including resolving `dataSource` via context `defaultDataSource` when omitted on props).
|
|
35
26
|
*/
|
|
36
27
|
supported: boolean;
|
|
37
28
|
/**
|
|
38
|
-
*
|
|
39
|
-
* `data` is not populated from cache.
|
|
29
|
+
* Effective value after applying {@link HookEnableParam} defaults (always `true` or `false`).
|
|
30
|
+
* When `false`, narrative is opted out and `data` is not populated from cache.
|
|
40
31
|
*/
|
|
41
32
|
enabled: boolean;
|
|
42
33
|
};
|
|
@@ -53,8 +44,6 @@ export type UseGetWidgetNarrativeResult = WidgetNarrativeQueryState & {
|
|
|
53
44
|
* ```tsx
|
|
54
45
|
* const { data, isLoading, supported } = useGetWidgetNarrative({
|
|
55
46
|
* widgetProps,
|
|
56
|
-
* defaultDataSource: DM.DataSource,
|
|
57
|
-
* verbosity: 'Low',
|
|
58
47
|
* });
|
|
59
48
|
* ```
|
|
60
49
|
* @sisenseInternal
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Measures the line height of the element referenced by `ref` in pixels.
|
|
4
|
+
* Re-measures on resize and after fonts load. Returns `null` until measured.
|
|
5
|
+
*
|
|
6
|
+
* @param ref - Ref to the element whose line height should be measured.
|
|
7
|
+
* @returns The line height in pixels, or `null` if not yet measured.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function useLineHeight<T extends HTMLElement>(ref: React.RefObject<T | null>): number | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WidgetProps } from '../../../domains/widgets/components/widget/types';
|
|
2
2
|
import type { NarrativeRequest } from '../../../infra/api/narrative/narrative-api-types.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { HookEnableParam } from '../../../shared/hooks/types';
|
|
4
4
|
/**
|
|
5
5
|
* Hook state aligned with legacy {@link UseGetNlgInsightsState}; used by {@link useGetWidgetNarrative}.
|
|
6
6
|
*
|
|
@@ -16,24 +16,23 @@ export type WidgetNarrativeQueryState = {
|
|
|
16
16
|
};
|
|
17
17
|
export type UseWidgetNarrativeStateParams = {
|
|
18
18
|
widgetProps: WidgetProps;
|
|
19
|
-
|
|
20
|
-
} & WidgetNarrativeOptions;
|
|
19
|
+
} & HookEnableParam;
|
|
21
20
|
export type UseWidgetNarrativeStateResult = WidgetNarrativeQueryState & {
|
|
22
21
|
supported: boolean;
|
|
23
22
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* query rather than "no insights."
|
|
23
|
+
* Effective value after applying {@link HookEnableParam} defaults (always `true` or `false`).
|
|
24
|
+
* When `false`, narrative is opted out: `data` is cleared (no cached fallback), `narrativeRequest`
|
|
25
|
+
* is undefined, and loading/error flags reflect a disabled query rather than "no insights."
|
|
27
26
|
*/
|
|
28
27
|
enabled: boolean;
|
|
29
28
|
/** Present when `supported` and `enabled`; used by {@link WidgetNarrative} for feedback payload only. */
|
|
30
29
|
narrativeRequest: NarrativeRequest | undefined;
|
|
31
30
|
};
|
|
32
31
|
/**
|
|
33
|
-
* Resolves chart or pivot widget props to a
|
|
34
|
-
* Depends on {@link useSisenseContext} (`httpClient`,
|
|
32
|
+
* Resolves chart or pivot widget props to a narrative request and runs `getNarrative` via TanStack Query.
|
|
33
|
+
* Depends on {@link useSisenseContext} (`httpClient`, narrative settings) and a `QueryClientProvider`.
|
|
35
34
|
* Not exported from `@sisenseInternal` public API.
|
|
36
35
|
*
|
|
37
36
|
* @internal
|
|
38
37
|
*/
|
|
39
|
-
export declare function useWidgetNarrativeState({ widgetProps,
|
|
38
|
+
export declare function useWidgetNarrativeState({ widgetProps, enabled, }: UseWidgetNarrativeStateParams): UseWidgetNarrativeStateResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Attribute, DataSource, Measure, PivotAttribute, PivotMeasure, PivotQueryResultData, QueryResultData } from '@sisense/sdk-data';
|
|
2
2
|
import type { PivotQueryDescription as InternalPivotQueryDescription, QueryDescription as InternalQueryDescription, QueryExecutionConfig } from '@sisense/sdk-query-client';
|
|
3
|
-
import { CreateCacheKeyFn } from '../../../shared/utils/create-cache';
|
|
3
|
+
import { CacheKey, CreateCacheKeyFn } from '../../../shared/utils/create-cache';
|
|
4
4
|
import { type ClientApplication } from '../../../infra/app/types.js';
|
|
5
5
|
/**
|
|
6
6
|
* All the properties that fully describe a query you want to send.
|
|
@@ -30,9 +30,42 @@ export declare const prepareQueryParams: (queryDescription: QueryDescription, de
|
|
|
30
30
|
/** @internal */
|
|
31
31
|
export declare function executeQuery(queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig): Promise<QueryResultData>;
|
|
32
32
|
/** @internal */
|
|
33
|
+
export declare function executeRowCountQuery(queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig): Promise<number>;
|
|
34
|
+
/** Result of a data query executed together with its total row count. */
|
|
35
|
+
export type QueryResultWithRowCount = {
|
|
36
|
+
data: QueryResultData;
|
|
37
|
+
/**
|
|
38
|
+
* Total row count of the query, ignoring `count`/`offset` paging.
|
|
39
|
+
* Undefined when the total could not be retrieved.
|
|
40
|
+
*/
|
|
41
|
+
rowCount?: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Executes a data query together with a row count query and returns both the
|
|
45
|
+
* result data and the total row count.
|
|
46
|
+
*
|
|
47
|
+
* A row count failure does not fail the data query: `rowCount` is left
|
|
48
|
+
* undefined when the total cannot be retrieved (e.g. a Sisense instance
|
|
49
|
+
* without the row count API).
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export declare function executeQueryWithRowCount(queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig, baseExecuteQuery?: typeof executeQuery): Promise<QueryResultWithRowCount>;
|
|
54
|
+
/** @internal */
|
|
33
55
|
export declare const executeCsvQuery: (queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig) => Promise<Blob>;
|
|
34
56
|
/** @internal */
|
|
35
57
|
export declare const executePivotQuery: (queryDescription: PivotQueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig) => Promise<PivotQueryResultData>;
|
|
36
58
|
export declare const createExecuteQueryCacheKey: CreateCacheKeyFn<typeof executeQuery>;
|
|
37
59
|
export declare const executeQueryWithCache: typeof executeQuery;
|
|
38
60
|
export declare const clearExecuteQueryCache: (specificKey?: string | undefined) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Creates a cache key for a row count query.
|
|
63
|
+
*
|
|
64
|
+
* The key is page-independent: `count` and `offset` are excluded so the total
|
|
65
|
+
* row count is reused across pages of the same query.
|
|
66
|
+
*
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
export declare const createRowCountQueryCacheKey: CreateCacheKeyFn<typeof executeRowCountQuery>;
|
|
70
|
+
/** @internal */
|
|
71
|
+
export declare const clearRowCountQueryCache: (specificKey?: CacheKey) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Attribute, type DataSource, type Measure } from '@sisense/sdk-data';
|
|
1
|
+
import { type Attribute, type DataSource, type Filter, type FilterRelations, type Measure, type MetadataItem } from '@sisense/sdk-data';
|
|
2
2
|
/** `by` field for JAQL export requests. */
|
|
3
3
|
export declare const EXCEL_EXPORT_JAQL_BY = "export";
|
|
4
4
|
/**
|
|
@@ -16,6 +16,7 @@ type ExcelExportJaqlWidgetContext = {
|
|
|
16
16
|
type XlsxExportQueryParams = {
|
|
17
17
|
dimensions?: readonly Attribute[];
|
|
18
18
|
measures?: readonly Measure[];
|
|
19
|
+
filters?: readonly Filter[] | FilterRelations;
|
|
19
20
|
};
|
|
20
21
|
/**
|
|
21
22
|
* Resolves XLSX metadata `panel` for a dimension.
|
|
@@ -32,17 +33,24 @@ export declare function resolveExcelDimensionMetadataPanel(dimension: Attribute,
|
|
|
32
33
|
*/
|
|
33
34
|
export declare function createPanelsMetadataForXlsx(dimensions: XlsxExportQueryParams['dimensions'], measures: XlsxExportQueryParams['measures'], mergeRows: boolean): {
|
|
34
35
|
jaql: {
|
|
35
|
-
column:
|
|
36
|
-
title:
|
|
37
|
-
dim:
|
|
36
|
+
column: string | undefined;
|
|
37
|
+
title: string | undefined;
|
|
38
|
+
dim: string | undefined;
|
|
38
39
|
merged: boolean;
|
|
39
40
|
};
|
|
40
41
|
field: {
|
|
41
42
|
id: string;
|
|
42
43
|
index: number;
|
|
43
44
|
};
|
|
44
|
-
format: Record<string,
|
|
45
|
+
format: Record<string, unknown>;
|
|
45
46
|
panel: "measures" | ExcelExportDimensionPanel;
|
|
46
47
|
}[];
|
|
48
|
+
/**
|
|
49
|
+
* Returns `scope`-panel metadata for filters.
|
|
50
|
+
*
|
|
51
|
+
* @param filters - Scope filters (plain list or filter relations)
|
|
52
|
+
* @returns Filter metadata for the export JAQL
|
|
53
|
+
*/
|
|
54
|
+
export declare function createFiltersMetadataForXlsx(filters: readonly Filter[] | FilterRelations | undefined): MetadataItem[];
|
|
47
55
|
export declare function buildJaqlForExcelExport(params: XlsxExportQueryParams, context: ExcelExportJaqlWidgetContext): Record<string, unknown>;
|
|
48
56
|
export {};
|
|
@@ -21,6 +21,11 @@ export type XlsxExportRequestPayload = {
|
|
|
21
21
|
jaql: Record<string, unknown>;
|
|
22
22
|
mergeRows: boolean;
|
|
23
23
|
language: string;
|
|
24
|
+
widgetStyles?: {
|
|
25
|
+
coloringRules?: {
|
|
26
|
+
alternatingRows?: boolean;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
24
29
|
};
|
|
25
30
|
/**
|
|
26
31
|
* Builds the XLSX JAQL export request body shared by chart, pivot, and custom widgets.
|
|
@@ -46,8 +46,9 @@ export declare function useExecuteQueryByWidgetIdInternal(params: ExecuteQueryBy
|
|
|
46
46
|
*/
|
|
47
47
|
export declare function useParamsChanged(params: ExecuteQueryByWidgetIdParams): boolean;
|
|
48
48
|
/** @internal */
|
|
49
|
-
export declare function executeQueryByWidgetId({ widgetOid, dashboardOid, filters, highlights, filtersMergeStrategy, count, offset, includeDashboardFilters, app, onBeforeQuery, }: ExecuteQueryByWidgetIdParams & {
|
|
49
|
+
export declare function executeQueryByWidgetId({ widgetOid, dashboardOid, filters, highlights, filtersMergeStrategy, count, offset, includeRowCount, includeDashboardFilters, app, onBeforeQuery, }: ExecuteQueryByWidgetIdParams & {
|
|
50
50
|
app: ClientApplication;
|
|
51
51
|
}): Promise<{
|
|
52
52
|
data: QueryResultData;
|
|
53
|
+
rowCount?: number;
|
|
53
54
|
} & QueryByWidgetIdQueryParams>;
|
|
@@ -197,6 +197,23 @@ export interface ExecuteQueryByWidgetIdParams {
|
|
|
197
197
|
count?: number;
|
|
198
198
|
/** {@inheritDoc ExecuteQueryParams.offset} */
|
|
199
199
|
offset?: number;
|
|
200
|
+
/**
|
|
201
|
+
* Boolean flag whether to include the total row count of the query result,
|
|
202
|
+
* ignoring the `count` and `offset` paging.
|
|
203
|
+
*
|
|
204
|
+
* When enabled, the total is returned as `rowCount` in the query state
|
|
205
|
+
* ({@link QueryByWidgetIdState.rowCount}) and is reused for subsequent pages of the same query.
|
|
206
|
+
*
|
|
207
|
+
* Row count feature requires a Sisense instance version of 2026.3.0 or greater.
|
|
208
|
+
* On older versions, the query still succeeds and `rowCount` stays `undefined`.
|
|
209
|
+
*
|
|
210
|
+
* Not supported for pivot table widgets.
|
|
211
|
+
*
|
|
212
|
+
* If not specified, the default value is `false`
|
|
213
|
+
*
|
|
214
|
+
* @beta
|
|
215
|
+
*/
|
|
216
|
+
includeRowCount?: boolean;
|
|
200
217
|
/**
|
|
201
218
|
* Strategy for merging the existing widget filters (including highlights) with the filters provided via the `filters` and `highlights` props:
|
|
202
219
|
*
|
|
@@ -230,7 +247,17 @@ export type QueryByWidgetIdQueryParams = {
|
|
|
230
247
|
/**
|
|
231
248
|
* State of a query execution retrieving data of Fusion widget.
|
|
232
249
|
*/
|
|
233
|
-
export type QueryByWidgetIdState = QueryState & QueryByWidgetIdQueryParams
|
|
250
|
+
export type QueryByWidgetIdState = QueryState & QueryByWidgetIdQueryParams & {
|
|
251
|
+
/**
|
|
252
|
+
* Total row count of the query result, ignoring the `count` and `offset` paging.
|
|
253
|
+
*
|
|
254
|
+
* Populated only when {@link ExecuteQueryByWidgetIdParams.includeRowCount} is enabled and
|
|
255
|
+
* the Sisense instance supports the row count API; `undefined` otherwise.
|
|
256
|
+
*
|
|
257
|
+
* @beta
|
|
258
|
+
*/
|
|
259
|
+
rowCount?: number;
|
|
260
|
+
};
|
|
234
261
|
/**
|
|
235
262
|
* Base query parameters
|
|
236
263
|
*
|
|
@@ -287,6 +314,22 @@ export interface ExecuteQueryParams extends BaseQueryParams {
|
|
|
287
314
|
* If not specified, the default value is `false`
|
|
288
315
|
*/
|
|
289
316
|
ungroup?: boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Boolean flag whether to include the total row count of the query result,
|
|
319
|
+
* ignoring the `count` and `offset` paging.
|
|
320
|
+
*
|
|
321
|
+
* When enabled, an additional row count query is sent to the server alongside
|
|
322
|
+
* the data query, and the total is returned in {@link ExecuteQueryResult.rowCount}.
|
|
323
|
+
* The retrieved total is reused for subsequent pages of the same query.
|
|
324
|
+
*
|
|
325
|
+
* Row count feature requires a Sisense instance version of 2026.3.0 or greater.
|
|
326
|
+
* On older versions, the query still succeeds and `rowCount` stays `undefined`.
|
|
327
|
+
*
|
|
328
|
+
* If not specified, the default value is `false`
|
|
329
|
+
*
|
|
330
|
+
* @beta
|
|
331
|
+
*/
|
|
332
|
+
includeRowCount?: boolean;
|
|
290
333
|
/**
|
|
291
334
|
* Sync or async callback that allows to modify the JAQL payload before it is sent to the server.
|
|
292
335
|
*
|
|
@@ -318,6 +361,15 @@ export type ExecuteQueryResult = QueryState & {
|
|
|
318
361
|
* @internal
|
|
319
362
|
*/
|
|
320
363
|
isAllItemsLoaded: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* Total row count of the query result, ignoring the `count` and `offset` paging.
|
|
366
|
+
*
|
|
367
|
+
* Populated only when {@link ExecuteQueryParams.includeRowCount} is enabled and
|
|
368
|
+
* the Sisense instance supports the row count API; `undefined` otherwise.
|
|
369
|
+
*
|
|
370
|
+
* @beta
|
|
371
|
+
*/
|
|
372
|
+
rowCount?: number;
|
|
321
373
|
};
|
|
322
374
|
/** Configuration for {@link useExecuteCsvQuery} hook. */
|
|
323
375
|
export type ExecuteCSVQueryConfig = {
|
|
@@ -329,13 +381,13 @@ export type ExecuteCSVQueryConfig = {
|
|
|
329
381
|
/**
|
|
330
382
|
* Parameters for {@link useExecuteCsvQuery} hook.
|
|
331
383
|
*/
|
|
332
|
-
export interface ExecuteCsvQueryParams extends ExecuteQueryParams {
|
|
384
|
+
export interface ExecuteCsvQueryParams extends Omit<ExecuteQueryParams, 'includeRowCount'> {
|
|
333
385
|
config?: ExecuteCSVQueryConfig;
|
|
334
386
|
}
|
|
335
387
|
/**
|
|
336
388
|
* Parameters for {@link useExecuteExcelQueryInternal} (JAQL XLSX export).
|
|
337
389
|
*/
|
|
338
|
-
export interface ExecuteExcelQueryParams extends ExecuteQueryParams {
|
|
390
|
+
export interface ExecuteExcelQueryParams extends Omit<ExecuteQueryParams, 'includeRowCount'> {
|
|
339
391
|
/** `false` = repeat rows (Angular default); `true` = merge rows. */
|
|
340
392
|
mergeRows: boolean;
|
|
341
393
|
/** Suggested download file name (e.g. from widget title). */
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { HeaderItemFill, HeaderItemSize } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Default size (in pixels) for a header item dimension that is not specified.
|
|
5
|
+
*
|
|
6
|
+
* Each component can override this with its own default (e.g. the dashboard uses 28px) by passing
|
|
7
|
+
* `defaultSize` to the renderer.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_HEADER_ITEM_SIZE = 24;
|
|
10
|
+
/**
|
|
11
|
+
* Applies the default-size fallback to a (possibly partial) size.
|
|
12
|
+
*
|
|
13
|
+
* The result is what gets passed to a {@link HeaderItemComponent} via `props.size`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const resolveHeaderItemSize: (size?: HeaderItemSize, defaultSize?: number) => Required<HeaderItemSize>;
|
|
16
|
+
/**
|
|
17
|
+
* Maps a resolved size and the internal {@link HeaderItemFill} to the CSS for an item's wrapper.
|
|
18
|
+
*
|
|
19
|
+
* - `fill: 'grow'` → flexible, grows to fill the row (the center spacer).
|
|
20
|
+
* - `fill: 'truncate'` → natural content width, shrinkable (the title — enables ellipsis).
|
|
21
|
+
* - `fill: 'content'` → natural content width, never shrinks (built-in action buttons/menu — so a
|
|
22
|
+
* long title cannot squeeze and clip their icons).
|
|
23
|
+
* - no `fill` (external items) → fixed pixel `width` (provided or defaulted).
|
|
24
|
+
*
|
|
25
|
+
* `fill` is internal: it is set only on built-in items. External items never carry it, so they are
|
|
26
|
+
* always laid out at a fixed pixel width.
|
|
27
|
+
*
|
|
28
|
+
* `height` is applied as a fixed pixel height (provided or defaulted).
|
|
29
|
+
*/
|
|
30
|
+
export declare const getHeaderItemStyle: (size: Required<HeaderItemSize>, fill?: HeaderItemFill) => CSSProperties;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ResolvedHeaderItem } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link HeaderItemsRenderer}.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface HeaderItemsRendererProps {
|
|
8
|
+
/** The resolved, ordered header items to render. */
|
|
9
|
+
items: ResolvedHeaderItem[];
|
|
10
|
+
/**
|
|
11
|
+
* Default size (px) applied to items that don't specify one. Lets each component pick its own
|
|
12
|
+
* default (the dashboard uses 28). Defaults to {@link DEFAULT_HEADER_ITEM_SIZE}.
|
|
13
|
+
*/
|
|
14
|
+
defaultSize?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Renders a resolved list of header items as a single horizontal flex row.
|
|
18
|
+
*/
|
|
19
|
+
export declare const HeaderItemsRenderer: ({ items, defaultSize }: HeaderItemsRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HeaderItem } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a flexible, empty "spacer" header item.
|
|
4
|
+
*
|
|
5
|
+
* The spacer renders nothing but grows (`fill: 'grow'`) to fill the available width, separating the
|
|
6
|
+
* leading group of items (e.g. the title) from the trailing group (action buttons). It is also the
|
|
7
|
+
* anchor that `{ type: 'auto' }` items are placed after.
|
|
8
|
+
*/
|
|
9
|
+
export declare const createHeaderSpacerItem: (id: string) => HeaderItem;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { HeaderConfig, HeaderItem, HeaderItemComponent, HeaderItemComponentProps, HeaderItemFill, HeaderItemPosition, HeaderItemSize, HeaderItemsTransform, ResolvedHeaderItem, } from './types.js';
|
|
2
|
+
export { resolveHeaderItems, type ResolveHeaderItemsOptions } from './resolve-header-items.js';
|
|
3
|
+
export { useResolvedHeaderItems } from './use-resolved-header-items.js';
|
|
4
|
+
export { HeaderItemsRenderer, type HeaderItemsRendererProps } from './header-items-renderer.js';
|
|
5
|
+
export { getHeaderItemStyle, resolveHeaderItemSize, DEFAULT_HEADER_ITEM_SIZE, } from './header-item-size.js';
|
|
6
|
+
export { createHeaderSpacerItem } from './header-spacer-item.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HeaderConfig, HeaderItem, ResolvedHeaderItem } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Options for {@link resolveHeaderItems}.
|
|
4
|
+
*/
|
|
5
|
+
export interface ResolveHeaderItemsOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Id of the item that `{ type: 'auto' }` items are placed immediately after (the center spacer).
|
|
8
|
+
*
|
|
9
|
+
* If not provided or not present, auto items fall back to the end of the header.
|
|
10
|
+
*/
|
|
11
|
+
autoAnchorId?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the final, ordered list of header items from the built-in items and the user
|
|
15
|
+
* {@link HeaderConfig}.
|
|
16
|
+
*/
|
|
17
|
+
export declare const resolveHeaderItems: (builtInItems: HeaderItem[], config?: HeaderConfig, options?: ResolveHeaderItemsOptions) => ResolvedHeaderItem[];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Size configuration for a header item, in pixels.
|
|
4
|
+
*/
|
|
5
|
+
export interface HeaderItemSize {
|
|
6
|
+
/** Fixed width (px). Falls back to the component's default item size. */
|
|
7
|
+
width?: number;
|
|
8
|
+
/** Fixed height (px). Falls back to the component's default item size. */
|
|
9
|
+
height?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Props passed to a header item component when it is rendered.
|
|
13
|
+
*/
|
|
14
|
+
export interface HeaderItemComponentProps {
|
|
15
|
+
/** The size resolved for the item by the header layout, with defaults applied. */
|
|
16
|
+
size: {
|
|
17
|
+
/** Fixed width (px). */
|
|
18
|
+
width: number;
|
|
19
|
+
/** Fixed height (px). */
|
|
20
|
+
height: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A React component that renders the content of a header item.
|
|
25
|
+
*/
|
|
26
|
+
export type HeaderItemComponent = (props: HeaderItemComponentProps) => ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Internal layout behavior for built-in items whose width is not a fixed pixel value:
|
|
29
|
+
* - `content` — natural content width, never shrinks (built-in action buttons/menu).
|
|
30
|
+
* - `truncate` — natural content width that may shrink/ellipsize (the title).
|
|
31
|
+
* - `grow` — flexible width that absorbs the remaining space (the center spacer).
|
|
32
|
+
*
|
|
33
|
+
* Set only on built-in items; external (user-provided) items never carry it.
|
|
34
|
+
*/
|
|
35
|
+
export type HeaderItemFill = 'content' | 'truncate' | 'grow';
|
|
36
|
+
/**
|
|
37
|
+
* Describes where a header item is placed relative to the other items.
|
|
38
|
+
*/
|
|
39
|
+
export type HeaderItemPosition = {
|
|
40
|
+
type: 'auto';
|
|
41
|
+
} | {
|
|
42
|
+
type: 'before';
|
|
43
|
+
target: string;
|
|
44
|
+
} | {
|
|
45
|
+
type: 'after';
|
|
46
|
+
target: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: 'first';
|
|
49
|
+
} | {
|
|
50
|
+
type: 'last';
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* A single configurable item in a component header (title, button, menu, …).
|
|
54
|
+
*/
|
|
55
|
+
export interface HeaderItem {
|
|
56
|
+
/** Unique identifier of the item. */
|
|
57
|
+
id: string;
|
|
58
|
+
/** Component that renders the content of the item. */
|
|
59
|
+
component: HeaderItemComponent;
|
|
60
|
+
/** Where to place the item. Defaults to `{ type: 'auto' }`. */
|
|
61
|
+
position?: HeaderItemPosition;
|
|
62
|
+
/** Size configuration for the item. Each unspecified dimension falls back to the default. */
|
|
63
|
+
size?: HeaderItemSize;
|
|
64
|
+
/** Internal CSS fill behavior (built-ins only). */
|
|
65
|
+
fill?: HeaderItemFill;
|
|
66
|
+
/**
|
|
67
|
+
* Anchor-only flag (built-ins only). A hidden item takes part in `before`/`after` ordering as a
|
|
68
|
+
* stable anchor, but is removed before `onBeforeRender` and never rendered. This lets external
|
|
69
|
+
* items target a built-in (e.g. the filter toggle) by id even when the current configuration
|
|
70
|
+
* hides it, so positioning stays stable as built-ins appear/disappear. External items never set
|
|
71
|
+
* this — they are always rendered.
|
|
72
|
+
*/
|
|
73
|
+
hidden?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A header item after the built-in and user items have been merged and ordered. Same shape as
|
|
77
|
+
* {@link HeaderItem} but without `position`, which has already been applied.
|
|
78
|
+
*/
|
|
79
|
+
export type ResolvedHeaderItem = Omit<HeaderItem, 'position'>;
|
|
80
|
+
/**
|
|
81
|
+
* Transforms the fully ordered list of header items right before rendering.
|
|
82
|
+
*
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
export type HeaderItemsTransform = (items: ReadonlyArray<ResolvedHeaderItem>) => ResolvedHeaderItem[];
|
|
86
|
+
/**
|
|
87
|
+
* Internal header configuration consumed by the resolver. Components expose their own public config
|
|
88
|
+
* type (e.g. `DashboardHeaderConfig`) that is structurally assignable to this.
|
|
89
|
+
*/
|
|
90
|
+
export interface HeaderConfig {
|
|
91
|
+
/** Custom items to inject into the header. */
|
|
92
|
+
items?: HeaderItem[];
|
|
93
|
+
/**
|
|
94
|
+
* Advanced hook to inspect and rewrite the full, ordered list of header items (built-in + user)
|
|
95
|
+
* immediately before rendering. The only way to modify or remove built-in items.
|
|
96
|
+
*/
|
|
97
|
+
onBeforeRender?: HeaderItemsTransform;
|
|
98
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ResolveHeaderItemsOptions } from './resolve-header-items.js';
|
|
2
|
+
import { HeaderConfig, HeaderItem, ResolvedHeaderItem } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Memoized React hook wrapper around {@link resolveHeaderItems}.
|
|
5
|
+
*
|
|
6
|
+
* Recomputes only when the built-in items, the user config, or the auto-anchor change.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const useResolvedHeaderItems: (builtInItems: HeaderItem[], config?: HeaderConfig, options?: ResolveHeaderItemsOptions) => ResolvedHeaderItem[];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type AreamapChartDataOptionsInternal } from '../../../../../../../domains/visualizations/core/chart-data-options/types.js';
|
|
2
2
|
import { DataTable } from '../../../../../../../domains/visualizations/core/chart-data-processor/table-processor.js';
|
|
3
3
|
import { AreamapData } from '../types.js';
|
|
4
|
-
export declare const getAreamapData: (dataOptions: AreamapChartDataOptionsInternal, dataTable: DataTable
|
|
4
|
+
export declare const getAreamapData: (dataOptions: AreamapChartDataOptionsInternal, dataTable: DataTable, options?: {
|
|
5
|
+
defaultNumberFormattingEnabled?: boolean;
|
|
6
|
+
}) => AreamapData;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { CartesianChartDataOptionsInternal } from '../../../../../../../../domains/visualizations/core/chart-data-options/types';
|
|
2
2
|
import { DataTable } from '../../../../../../../../domains/visualizations/core/chart-data-processor/table-processor';
|
|
3
3
|
import { CartesianChartData } from '../../../../../../../../domains/visualizations/core/chart-data/types';
|
|
4
|
-
export declare function getCartesianChartData(chartDataOptions: CartesianChartDataOptionsInternal, dataTable: DataTable
|
|
4
|
+
export declare function getCartesianChartData(chartDataOptions: CartesianChartDataOptionsInternal, dataTable: DataTable, options?: {
|
|
5
|
+
defaultNumberFormattingEnabled?: boolean;
|
|
6
|
+
}): CartesianChartData;
|
|
@@ -5,4 +5,6 @@ import { CartesianChartData } from '../../../../../../../../../../domains/visual
|
|
|
5
5
|
* Composes the base cartesian chart data loader with the streamgraph-specific
|
|
6
6
|
* normalization transformer to ensure continuous flow.
|
|
7
7
|
*/
|
|
8
|
-
export declare const getStreamgraphChartData: (chartDataOptions: import("../../../../../../../../core/chart-data-options/types.js").CartesianChartDataOptionsInternal, dataTable: import("../../../../../../../../core/chart-data-processor/table-processor.js").DataTable
|
|
8
|
+
export declare const getStreamgraphChartData: (chartDataOptions: import("../../../../../../../../core/chart-data-options/types.js").CartesianChartDataOptionsInternal, dataTable: import("../../../../../../../../core/chart-data-processor/table-processor.js").DataTable, options?: {
|
|
9
|
+
defaultNumberFormattingEnabled?: boolean | undefined;
|
|
10
|
+
} | undefined) => CartesianChartData;
|
|
@@ -10,4 +10,6 @@ export declare const loadCategoricalData: typeof loadDataBySingleQuery;
|
|
|
10
10
|
/**
|
|
11
11
|
* Transforms data table to categorical chart data.
|
|
12
12
|
*/
|
|
13
|
-
export declare function getCategoricalChartDataFromTable(dataOptions: CategoricalChartDataOptionsInternal, dataTable: DataTable
|
|
13
|
+
export declare function getCategoricalChartDataFromTable(dataOptions: CategoricalChartDataOptionsInternal, dataTable: DataTable, options?: {
|
|
14
|
+
defaultNumberFormattingEnabled?: boolean;
|
|
15
|
+
}): CategoricalChartData;
|
|
@@ -3,5 +3,7 @@ import { loadDataBySingleQuery } from '../../../../helpers/data-loading.js';
|
|
|
3
3
|
import type { SunburstChartData, SunburstChartDataOptionsInternal } from '../types.js';
|
|
4
4
|
export declare const dataTranslators: {
|
|
5
5
|
loadData: typeof loadDataBySingleQuery;
|
|
6
|
-
getChartData: (dataOptions: SunburstChartDataOptionsInternal, dataTable: DataTable
|
|
6
|
+
getChartData: (dataOptions: SunburstChartDataOptionsInternal, dataTable: DataTable, options?: {
|
|
7
|
+
defaultNumberFormattingEnabled?: boolean;
|
|
8
|
+
}) => SunburstChartData;
|
|
7
9
|
};
|
|
@@ -3,5 +3,7 @@ import { loadDataBySingleQuery } from '../../../../helpers/data-loading.js';
|
|
|
3
3
|
import type { TreemapChartData, TreemapChartDataOptionsInternal } from '../types.js';
|
|
4
4
|
export declare const dataTranslators: {
|
|
5
5
|
loadData: typeof loadDataBySingleQuery;
|
|
6
|
-
getChartData: (dataOptions: TreemapChartDataOptionsInternal, dataTable: DataTable
|
|
6
|
+
getChartData: (dataOptions: TreemapChartDataOptionsInternal, dataTable: DataTable, options?: {
|
|
7
|
+
defaultNumberFormattingEnabled?: boolean;
|
|
8
|
+
}) => TreemapChartData;
|
|
7
9
|
};
|
|
@@ -20,6 +20,7 @@ export declare const buildHighchartsOptions: <CT extends HighchartBasedChartType
|
|
|
20
20
|
themeSettings: import("../../../../../../../types.js").CompleteThemeSettingsInternal;
|
|
21
21
|
dateFormatter: (date: Date, format: string) => string;
|
|
22
22
|
accessibilityEnabled: boolean;
|
|
23
|
+
defaultNumberFormattingEnabled: boolean;
|
|
23
24
|
};
|
|
24
25
|
onBeforeRender?: BeforeRenderHandler | undefined;
|
|
25
26
|
}) => HighchartsOptionsInternal;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DataTable } from '../../../../../../../../domains/visualizations/core/chart-data-processor/table-processor';
|
|
2
|
+
import { loadDataBySingleQuery } from '../../../helpers/data-loading';
|
|
3
|
+
import { SankeyChartData, SankeyChartDataOptionsInternal } from '../types';
|
|
4
|
+
/** Highcharts Sankey stops rendering beyond this many links (turboThreshold). */
|
|
5
|
+
export declare const SANKEY_LINKS_LIMIT = 1000;
|
|
6
|
+
/**
|
|
7
|
+
* Transforms a flat DataTable (grouped by all categories + value) into SankeyChartData.
|
|
8
|
+
*
|
|
9
|
+
* For each adjacent pair of categories (i, i+1), rows are aggregated to compute
|
|
10
|
+
* total flow weights between each unique (from, to) pair. This client-side aggregation
|
|
11
|
+
* allows a single query to power multi-stage Sankey diagrams.
|
|
12
|
+
*
|
|
13
|
+
* Example: categories=[Gender, Condition, AgeRange], value=Revenue
|
|
14
|
+
* - Gender→Condition links: group rows by (Gender, Condition), sum Revenue
|
|
15
|
+
* - Condition→AgeRange links: group rows by (Condition, AgeRange), sum Revenue
|
|
16
|
+
*/
|
|
17
|
+
declare function getSankeyChartData(dataOptions: SankeyChartDataOptionsInternal, dataTable: DataTable): SankeyChartData;
|
|
18
|
+
export declare const dataTranslators: {
|
|
19
|
+
loadData: typeof loadDataBySingleQuery;
|
|
20
|
+
getChartData: typeof getSankeyChartData;
|
|
21
|
+
};
|
|
22
|
+
export {};
|