@sisense/sdk-ui 1.12.0 → 1.14.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 (89) hide show
  1. package/dist/ai/ai-context-provider.d.ts +1 -1
  2. package/dist/ai/api/chat-rest-api.d.ts +10 -11
  3. package/dist/ai/api/hooks.d.ts +2 -2
  4. package/dist/ai/api/types.d.ts +2 -16
  5. package/dist/ai/buttons/scroll-to-bottom-button.d.ts +3 -0
  6. package/dist/ai/chat-config.d.ts +12 -3
  7. package/dist/ai/chat-home.d.ts +2 -1
  8. package/dist/ai/chatbot.d.ts +1 -1
  9. package/dist/ai/common/constants.d.ts +1 -0
  10. package/dist/ai/common/tooltip.d.ts +2 -2
  11. package/dist/ai/data-topics/data-topic-list.d.ts +0 -1
  12. package/dist/ai/get-nlg-query-result.d.ts +1 -1
  13. package/dist/ai/icons/scroll-to-bottom-icon.d.ts +1 -0
  14. package/dist/ai/scroll-to-bottom.d.ts +7 -0
  15. package/dist/ai/use-get-nlg-query-result.d.ts +1 -1
  16. package/dist/ai/use-get-query-recommendations.d.ts +1 -1
  17. package/dist/ai.cjs +89 -80
  18. package/dist/ai.js +828 -933
  19. package/dist/api/rest-api.d.ts +7 -7
  20. package/dist/api/types/dashboard-dto.d.ts +2 -0
  21. package/dist/chart/helpers/use-synced-data.d.ts +1 -1
  22. package/dist/chart-options-processor/chart-options-service.d.ts +4 -0
  23. package/dist/chart-options-processor/subtype-to-design-options.d.ts +13 -1
  24. package/dist/chart-options-processor/translations/axis-section.d.ts +1 -0
  25. package/dist/chart-options-processor/translations/sunburst/sunburst-series.d.ts +2 -0
  26. package/dist/chart-options-processor/translations/tooltip-utils.d.ts +2 -0
  27. package/dist/chart-options-processor/translations/translations-to-highcharts.d.ts +2 -0
  28. package/dist/common/components/loading-overlay.d.ts +1 -0
  29. package/dist/common-filters/common-filters-connector.d.ts +9 -0
  30. package/dist/common-filters/selection-utils.d.ts +11 -0
  31. package/dist/common-filters/types.d.ts +18 -0
  32. package/dist/common-filters/use-common-filters.d.ts +13 -0
  33. package/dist/common-filters/utils.d.ts +9 -0
  34. package/dist/common-filters/widget-header-clear-selection-button.d.ts +3 -0
  35. package/dist/dashboard/components/dashboard-container.d.ts +1 -1
  36. package/dist/dashboard/dashboard.d.ts +1 -1
  37. package/dist/dashboard/index.d.ts +3 -0
  38. package/dist/dashboard/types.d.ts +5 -2
  39. package/dist/dashboard/utils.d.ts +0 -3
  40. package/dist/dashboard-widget/translate-dashboard-filters.d.ts +4772 -2
  41. package/dist/dashboard-widget/translate-widget-data-options.d.ts +1 -1
  42. package/dist/dashboard-widget/translate-widget-filters.d.ts +200 -37
  43. package/dist/dashboard-widget/types.d.ts +1 -0
  44. package/dist/dashboard-widget/use-fetch-widget-dto-model.d.ts +2 -12
  45. package/dist/dashboard-widget/utils.d.ts +3 -1
  46. package/dist/decorators/hook-decorators/with-tracking.d.ts +1 -2
  47. package/dist/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +31 -0
  48. package/dist/filters/components/cascading-filter-tile/cascading-level-filter.d.ts +27 -0
  49. package/dist/filters/components/cascading-filter-tile/index.d.ts +1 -0
  50. package/dist/filters/components/criteria-filter-tile/criteria-filter-operations.d.ts +2 -2
  51. package/dist/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +7 -0
  52. package/dist/filters/components/custom-filter-tile.d.ts +46 -0
  53. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +8 -0
  54. package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +9 -2
  55. package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +2 -2
  56. package/dist/filters/components/filter-tile.d.ts +24 -1
  57. package/dist/filters/components/filters-panel/filters-panel-tile.d.ts +4 -2
  58. package/dist/filters/components/filters-panel/filters-panel.d.ts +4 -2
  59. package/dist/filters/components/icons/background-filter-icon.d.ts +5 -0
  60. package/dist/filters/components/icons/index.d.ts +1 -0
  61. package/dist/filters/components/icons/lock-icon.d.ts +2 -0
  62. package/dist/filters/components/member-filter-tile/member-filter-tile.d.ts +4 -1
  63. package/dist/filters/components/member-filter-tile/member-list.d.ts +1 -1
  64. package/dist/filters/hooks/use-synchronized-filter.d.ts +12 -0
  65. package/dist/filters/index.d.ts +2 -0
  66. package/dist/filters/utils.d.ts +7 -0
  67. package/dist/index.cjs +261 -167
  68. package/dist/index.d.ts +3 -2
  69. package/dist/index.js +23372 -18888
  70. package/dist/models/dashboard/dashboard-model.d.ts +12 -8
  71. package/dist/models/dashboard/get-dashboard-model.d.ts +2 -1
  72. package/dist/models/dashboard/translate-dashboard-utils.d.ts +3 -1
  73. package/dist/models/dashboard/types.d.ts +3 -0
  74. package/dist/models/widget/get-widget-model.d.ts +2 -1
  75. package/dist/models/widget/translate-widget.d.ts +5 -2
  76. package/dist/models/widget/types.d.ts +9 -0
  77. package/dist/models/widget/widget-model.d.ts +31 -1
  78. package/dist/pivot-table/formatters/utils.d.ts +1 -1
  79. package/dist/props.d.ts +12 -12
  80. package/dist/table/hooks/use-table-data.d.ts +1 -1
  81. package/dist/table/table-component.d.ts +4 -4
  82. package/dist/theme-provider/theme-provider.d.ts +2 -0
  83. package/dist/translation/resources/en.d.ts +5 -0
  84. package/dist/translation/resources/index.d.ts +10 -0
  85. package/dist/types.d.ts +204 -186
  86. package/dist/{useQuery-0UWck_2A.js → useQuery-Cxcx_l05.js} +13983 -13662
  87. package/dist/{useQuery-DVHD0kJ-.cjs → useQuery-_biaqvma.cjs} +119 -119
  88. package/dist/utils/color/color-interpolation.d.ts +1 -0
  89. package/package.json +10 -10
@@ -1,6 +1,9 @@
1
1
  import { DataSource, Filter } from '@sisense/sdk-data';
2
2
  import { Layout, WidgetModel } from '../../models';
3
3
  import type { DashboardDto } from '../../api/types/dashboard-dto';
4
+ import { DashboardProps } from '../../dashboard/types';
5
+ import { type WidgetFilterOptions } from './types';
6
+ import { CompleteThemeSettings } from '../../types';
4
7
  /**
5
8
  * Model of Sisense dashboard defined in the abstractions of Compose SDK.
6
9
  *
@@ -36,13 +39,20 @@ export declare class DashboardModel {
36
39
  * @internal
37
40
  */
38
41
  filters: Filter[];
42
+ /**
43
+ * Dashboard filters options per each widget.
44
+ *
45
+ * @internal
46
+ */
47
+ widgetFilterOptions: WidgetFilterOptions;
39
48
  /**
40
49
  * Creates a new dashboard model.
41
50
  *
42
51
  * @param dashboardDto - The widget DTO to be converted to a widget model
52
+ * @param themeSettings - Optional theme settings
43
53
  * @internal
44
54
  */
45
- constructor(dashboardDto: DashboardDto);
55
+ constructor(dashboardDto: DashboardDto, themeSettings?: CompleteThemeSettings);
46
56
  /**
47
57
  * Returns the props to be used for rendering a dashboard.
48
58
  *
@@ -52,11 +62,5 @@ export declare class DashboardModel {
52
62
  * ```
53
63
  * @internal
54
64
  */
55
- getDashboardProps(): {
56
- title: string;
57
- dataSource: DataSource;
58
- widgets: WidgetModel[];
59
- layout: Layout;
60
- filters: Filter[];
61
- };
65
+ getDashboardProps(): DashboardProps;
62
66
  }
@@ -1,5 +1,6 @@
1
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
2
  import { DashboardModel } from '../../models/dashboard/dashboard-model';
3
+ import { CompleteThemeSettings } from '../../types';
3
4
  export interface GetDashboardModelOptions {
4
5
  /**
5
6
  * Boolean flag whether to include widgets in the dashboard model
@@ -17,4 +18,4 @@ export interface GetDashboardModelOptions {
17
18
  includeFilters?: boolean;
18
19
  }
19
20
  /** @internal */
20
- export declare function getDashboardModel(http: HttpClient, dashboardOid: string, options?: GetDashboardModelOptions): Promise<DashboardModel>;
21
+ export declare function getDashboardModel(http: HttpClient, dashboardOid: string, options?: GetDashboardModelOptions, themeSettings?: CompleteThemeSettings): Promise<DashboardModel>;
@@ -1,5 +1,7 @@
1
1
  import { type Layout as SisenseLayout, type FilterDto, type CascadingFilterDto } from '../../api/types/dashboard-dto';
2
- import type { Layout } from './types';
2
+ import type { Layout, WidgetFilterOptions } from './types';
3
3
  import { Filter } from '@sisense/sdk-data';
4
+ import { WidgetDto } from '../../dashboard-widget/types';
4
5
  export declare const translateLayout: (layout: SisenseLayout) => Layout;
5
6
  export declare function extractDashboardFilters(dashboardFilters: Array<FilterDto | CascadingFilterDto>): Filter[];
7
+ export declare function translateWidgetFilterOptions(widgets?: WidgetDto[]): WidgetFilterOptions;
@@ -1,3 +1,4 @@
1
+ import { CommonFiltersOptions } from '../../common-filters/types';
1
2
  /** @internal */
2
3
  export interface Layout {
3
4
  columns: {
@@ -11,3 +12,5 @@ export interface Layout {
11
12
  }[];
12
13
  }[];
13
14
  }
15
+ /** @internal */
16
+ export type WidgetFilterOptions = Record<string, CommonFiltersOptions>;
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
2
  import { WidgetModel } from './widget-model';
3
+ import { CompleteThemeSettings } from '../../types';
3
4
  /** @internal */
4
- export declare function getWidgetModel(httpClient: HttpClient, dashboardOid: string, widgetOid: string): Promise<WidgetModel>;
5
+ export declare function getWidgetModel(httpClient: HttpClient, dashboardOid: string, widgetOid: string, themeSettings?: CompleteThemeSettings): Promise<WidgetModel>;
@@ -1,3 +1,6 @@
1
- import { WidgetDto } from '../../dashboard-widget/types';
1
+ import { CompleteThemeSettings } from '../../types';
2
+ import { WidgetDto, WidgetType } from '../../dashboard-widget/types';
3
+ import { WidgetTypeInternal } from './types';
2
4
  import { WidgetModel } from './widget-model';
3
- export declare function translateWidget(widget: WidgetDto): WidgetModel;
5
+ export declare function translateWidget(widget: WidgetDto, themeSettings?: CompleteThemeSettings): WidgetModel;
6
+ export declare function translateWidgetType(widgetType: WidgetType): WidgetTypeInternal;
@@ -0,0 +1,9 @@
1
+ import { ChartType } from '../../index';
2
+ /**
3
+ * Widget type
4
+ *
5
+ * todo: as a future refactoring need to replace existing `WidgetType` by current one
6
+ *
7
+ * @internal
8
+ */
9
+ export type WidgetTypeInternal = ChartType | 'pivot' | 'plugin';
@@ -3,7 +3,7 @@ import { ChartDataOptions, PivotTableDataOptions } from '../../chart-data-option
3
3
  import { Panel, WidgetDto, WidgetType } from '../../dashboard-widget/types';
4
4
  import { ChartProps, ChartWidgetProps, PivotTableProps, TableProps, TableWidgetProps, PivotTableWidgetProps } from '../../props';
5
5
  import { ExecutePivotQueryParams, ExecuteQueryParams } from '../../query-execution';
6
- import { ChartType, DrilldownOptions, ChartStyleOptions, TableStyleOptions, CompleteThemeSettings } from '../../types';
6
+ import { ChartType, DrilldownOptions, ChartStyleOptions, TableStyleOptions, CompleteThemeSettings, RenderToolbarHandler } from '../../types';
7
7
  /**
8
8
  * Widget data options.
9
9
  */
@@ -65,6 +65,18 @@ export declare class WidgetModel {
65
65
  * Widget drilldown options.
66
66
  */
67
67
  drilldownOptions: DrilldownOptions;
68
+ /**
69
+ * "onDataPointClick" handler for the constructed component
70
+ *
71
+ * @internal
72
+ */
73
+ componentDataPointClickHandler?: ChartProps['onDataPointClick'];
74
+ /**
75
+ * "onDataPointsSelected" handler for the constructed component
76
+ *
77
+ * @internal
78
+ */
79
+ componentDataPointsSelectedHandler?: ChartProps['onDataPointsSelected'];
68
80
  /**
69
81
  * Creates a new widget model.
70
82
  *
@@ -174,4 +186,22 @@ export declare class WidgetModel {
174
186
  * @internal
175
187
  */
176
188
  getPivotTableWidgetProps(): PivotTableWidgetProps;
189
+ /**
190
+ * Registers new "onDataPointClick" handler for the constructed component
191
+ *
192
+ * @internal
193
+ */
194
+ registerComponentDataPointClickHandler?(handler: NonNullable<ChartProps['onDataPointClick']>): void;
195
+ /**
196
+ * Registers new "onDataPointsSelected" handler for the constructed component
197
+ *
198
+ * @internal
199
+ */
200
+ registerComponentDataPointsSelectedHandler?(handler: NonNullable<ChartProps['onDataPointsSelected']>): void;
201
+ /**
202
+ * Registers new "renderToolbar" handler for the constructed component
203
+ *
204
+ * @internal
205
+ */
206
+ registerComponentRenderToolbarHandler?(handler: RenderToolbarHandler): void;
177
207
  }
@@ -2,4 +2,4 @@ import { type Column } from '@sisense/sdk-data';
2
2
  import { type PivotTableDataOptions, type StyledColumn, type AnyColumn } from '../../chart-data-options/types';
3
3
  export declare const getPivotDataOptionByJaqlIndex: (dataOptions: PivotTableDataOptions, dataOptionIndex?: number) => AnyColumn | undefined;
4
4
  export declare const getNumberFormatConfig: (dataOption?: AnyColumn) => Required<import("../..").NumberFormatConfig>;
5
- export declare const getDateFormatConfig: (dataOption: Column | StyledColumn) => string;
5
+ export declare const getDateFormatConfig: (dataOption: Column | StyledColumn) => string | undefined;
package/dist/props.d.ts CHANGED
@@ -388,21 +388,21 @@ export interface BaseChartProps {
388
388
  */
389
389
  dataSet?: DataSource | Data;
390
390
  /**
391
- * Filters to apply to a chart’s data using one of the following options.
391
+ * Filters to limit (or slice) a chart’s data using one of the following options.
392
392
  *
393
- * (1) Array of filters returned from filter factory functions, such as
393
+ * (1) Array of {@link Filter} or {@link FilterRelations} returned from filter factory functions, such as
394
394
  * {@link @sisense/sdk-data!filterFactory.greaterThan | `greaterThan()`} and {@link @sisense/sdk-data!filterFactory.members | `members()`}.
395
395
  *
396
396
  * Use this option for filters that do not require a UI to set them
397
- * or for filters where you will supply your own UI using non-Sisense components.
397
+ * or for filters where you will supply your own UI components or use pre-built UI components. This is the most common option.
398
398
  *
399
399
  * To learn more about using filter factory functions to create filters, see the [Compose SDK Charts Guide](/guides/sdk/guides/charts/guide-compose-sdk-charts.html#filter-functions).
400
400
  *
401
- * (2) Array of filters controlled by Sisense filter components.
401
+ * (2) Array of {@link Filter} controlled by filter UI components – for example {@link MemberFilterTile}.
402
402
  *
403
- * Use this option for filters that you want your users to set using Sisense UI components.
403
+ * Use this option for filters that you want your users to set using pre-built UI components.
404
404
  *
405
- * To learn more about using filter components to create filters, see the [Compose SDK Charts Guide](/guides/sdk/guides/charts/guide-compose-sdk-charts.html#filter-components).
405
+ * To learn more about using filter UI components to create filters, see the [Compose SDK Charts Guide](/guides/sdk/guides/charts/guide-compose-sdk-charts.html#filter-components).
406
406
  *
407
407
  * @category Data
408
408
  */
@@ -410,21 +410,21 @@ export interface BaseChartProps {
410
410
  /**
411
411
  * Highlights based on filter criteria to apply to a chart using one of the following options.
412
412
  *
413
- * Note that the filter dimensions used in highlights must match those defined in the
414
- * {@link dataOptions} of the chart.
413
+ * NOTE that the filter dimensions used in highlights must match those defined in the
414
+ * {@link dataOptions} of the chart. Otherwise, the filters will be applied as regular slice filters.
415
415
  *
416
- * (1) Array of filters returned from filter factory functions, such as
416
+ * (1) Array of {@link Filter} returned from filter factory functions, such as
417
417
  * {@link @sisense/sdk-data!filterFactory.greaterThan | `greaterThan()`} and {@link @sisense/sdk-data!filterFactory.members | `members()`}.
418
418
  *
419
419
  * Use this option for highlights that do not require a UI to set them
420
- * or for highlights where you will supply your own UI using non-Sisense components.
420
+ * or for highlights where you will supply your own UI components or use pre-built UI components. This is the most common option.
421
421
  *
422
422
  * To learn more about using filter factory functions to create highlights, see the
423
423
  * [Compose SDK Charts Guide](/guides/sdk/guides/charts/guide-compose-sdk-charts.html#filter-functions-for-highlighting).
424
424
  *
425
- * (2) Array of filters controlled by Sisense filter components.
425
+ * (2) Array of {@link Filter} controlled by filter UI components – for example {@link MemberFilterTile}.
426
426
  *
427
- * Use this option for highlights that you want your users to set using Sisense UI components.
427
+ * Use this option for highlights that you want your users to set using pre-built UI components.
428
428
  *
429
429
  * To learn more about using filter components to create highlights, see the
430
430
  * [Compose SDK Charts Guide](/guides/sdk/guides/charts/guide-compose-sdk-charts.html#filter-components-for-highlighting).
@@ -12,5 +12,5 @@ export declare const getTableAttributesAndMeasures: (dataOptions: TableDataOptio
12
12
  attributes: Attribute[];
13
13
  measures: Measure[];
14
14
  };
15
- export declare const useTableData: ({ dataSet, dataOptions, filters, filterRelations, count, offset, }: UseDataProps) => Data | null;
15
+ export declare const useTableData: ({ dataSet, dataOptions: originalDataOptions, filters, filterRelations, count, offset, }: UseDataProps) => [Data | null, TableDataOptionsInternal | null];
16
16
  export {};
@@ -1,8 +1,8 @@
1
1
  import { TableProps } from '../props';
2
+ export declare const DEFAULT_TABLE_ROWS_PER_PAGE = 25;
3
+ /** How many pages of data will be loaded in one query */
4
+ export declare const PAGES_BATCH_SIZE = 10;
2
5
  /**
3
6
  * Component that renders a table with aggregation and pagination.
4
7
  */
5
- export declare const TableComponent: ({ dataSet, dataOptions, styleOptions, filters, refreshCounter, }: TableProps) => import("react/jsx-runtime").JSX.Element | null;
6
- export declare const DEFAULT_TABLE_ROWS_PER_PAGE: 25;
7
- /** How many pages of data will be loaded in one query */
8
- export declare const PAGES_BATCH_SIZE = 10;
8
+ export declare const TableComponent: ({ dataSet, dataOptions, styleOptions, filters, }: TableProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -3,6 +3,8 @@ import { ThemeProviderProps } from '../props';
3
3
  /**
4
4
  * Theme provider, which allows you to adjust the look and feel of child components.
5
5
  *
6
+ * Components not wrapped in a theme provider use the current theme from the connected Fusion instance by default.
7
+ *
6
8
  * @example
7
9
  * Example of a theme provider, which changes the colors and font of the nested indicator chart:
8
10
  * ```tsx
@@ -36,6 +36,7 @@ export declare const translation: {
36
36
  unknownFilterInFilterRelations: string;
37
37
  filterRelationsNotSupported: string;
38
38
  invalidFilterType: string;
39
+ secondsDateTimeLevelSupportedOnlyForLive: string;
39
40
  };
40
41
  errorBoxText: string;
41
42
  chartNoData: string;
@@ -96,5 +97,9 @@ export declare const translation: {
96
97
  title: string;
97
98
  message: string;
98
99
  };
100
+ commonFilter: {
101
+ clearSelectionButton: string;
102
+ };
103
+ customFilterTileMessage: string;
99
104
  };
100
105
  export type TranslationDictionary = typeof translation;
@@ -40,6 +40,7 @@ export declare const resources: {
40
40
  unknownFilterInFilterRelations: string;
41
41
  filterRelationsNotSupported: string;
42
42
  invalidFilterType: string;
43
+ secondsDateTimeLevelSupportedOnlyForLive: string;
43
44
  };
44
45
  errorBoxText: string;
45
46
  chartNoData: string;
@@ -100,6 +101,10 @@ export declare const resources: {
100
101
  title: string;
101
102
  message: string;
102
103
  };
104
+ commonFilter: {
105
+ clearSelectionButton: string;
106
+ };
107
+ customFilterTileMessage: string;
103
108
  };
104
109
  uk: {
105
110
  errors: {
@@ -139,6 +144,7 @@ export declare const resources: {
139
144
  unknownFilterInFilterRelations: string;
140
145
  filterRelationsNotSupported: string;
141
146
  invalidFilterType: string;
147
+ secondsDateTimeLevelSupportedOnlyForLive: string;
142
148
  };
143
149
  errorBoxText: string;
144
150
  chartNoData: string;
@@ -199,5 +205,9 @@ export declare const resources: {
199
205
  title: string;
200
206
  message: string;
201
207
  };
208
+ commonFilter: {
209
+ clearSelectionButton: string;
210
+ };
211
+ customFilterTileMessage: string;
202
212
  };
203
213
  };