@sisense/sdk-ui 1.23.0 → 1.24.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 (74) hide show
  1. package/dist/ai.cjs +29 -29
  2. package/dist/ai.js +332 -325
  3. package/dist/analytics-composer.cjs +1 -1
  4. package/dist/analytics-composer.js +3 -3
  5. package/dist/index.cjs +119 -118
  6. package/dist/index.js +6943 -7725
  7. package/dist/packages/sdk-ui/src/ai/chart/chart-insights.d.ts +2 -1
  8. package/dist/packages/sdk-ui/src/ai/chart/nlq-chart-widget.d.ts +7 -2
  9. package/dist/packages/sdk-ui/src/ai/icons/exclamation-mark-brand-icon.d.ts +3 -0
  10. package/dist/packages/sdk-ui/src/analytics-composer/common/utils.d.ts +2 -0
  11. package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +5 -1
  12. package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-code.d.ts +2 -2
  13. package/dist/packages/sdk-ui/src/analytics-composer/widget/widget-composer.d.ts +1 -0
  14. package/dist/packages/sdk-ui/src/api/rest-api.d.ts +12 -1
  15. package/dist/packages/sdk-ui/src/chart/advanced-chart.d.ts +1 -1
  16. package/dist/packages/sdk-ui/src/chart/regular-chart.d.ts +3 -0
  17. package/dist/packages/sdk-ui/src/chart-options-processor/category-chart-options.d.ts +2 -1
  18. package/dist/packages/sdk-ui/src/chart-options-processor/translations/sunburst/sunburst-options.d.ts +2 -1
  19. package/dist/packages/sdk-ui/src/chart-options-processor/translations/treemap/treemap-options.d.ts +2 -1
  20. package/dist/packages/sdk-ui/src/chart-options-processor/translations/treemap/treemap-tooltip.d.ts +3 -2
  21. package/dist/packages/sdk-ui/src/chart-options-processor/translations/types.d.ts +2 -0
  22. package/dist/packages/sdk-ui/src/dashboard/components/dashboard-container.d.ts +1 -1
  23. package/dist/packages/sdk-ui/src/dashboard/components/horizontal-collapse.d.ts +6 -0
  24. package/dist/packages/sdk-ui/src/dashboard/dashboard.d.ts +6 -1
  25. package/dist/packages/sdk-ui/src/dashboard/hooks/use-filters-panel-collapsed-state.d.ts +8 -0
  26. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +19 -1
  27. package/dist/packages/sdk-ui/src/decorators/component-decorators/with-error-boundary.d.ts +3 -1
  28. package/dist/packages/sdk-ui/src/error-boundary/error-boundary.d.ts +4 -2
  29. package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +2 -0
  30. package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +2 -0
  31. package/dist/packages/sdk-ui/src/filters/components/custom-filter-tile.d.ts +2 -0
  32. package/dist/packages/sdk-ui/src/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +2 -0
  33. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/helpers.d.ts +6 -0
  34. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +2 -0
  35. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +2 -1
  36. package/dist/packages/sdk-ui/src/filters/components/filter-tile.d.ts +1 -0
  37. package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel-tile.d.ts +3 -1
  38. package/dist/packages/sdk-ui/src/filters/components/icons/trash-icon.d.ts +1 -1
  39. package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.d.ts +2 -0
  40. package/dist/packages/sdk-ui/src/filters/components/unsupported-filter-tile.d.ts +3 -1
  41. package/dist/packages/sdk-ui/src/index.d.ts +3 -1
  42. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dasboard-model-utils.d.ts +2 -4
  43. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +24 -16
  44. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts +1 -0
  45. package/dist/packages/sdk-ui/src/models/hierarchy/get-hierarchy-models.d.ts +6 -1
  46. package/dist/packages/sdk-ui/src/models/hierarchy/types.d.ts +3 -0
  47. package/dist/packages/sdk-ui/src/models/hierarchy/use-get-hierarchy-models.d.ts +4 -4
  48. package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +11 -1
  49. package/dist/packages/sdk-ui/src/pivot-table/hooks/use-render-pivot.d.ts +3 -1
  50. package/dist/packages/sdk-ui/src/props.d.ts +11 -3
  51. package/dist/packages/sdk-ui/src/sisense-context/sisense-context.d.ts +2 -0
  52. package/dist/packages/sdk-ui/src/table/table-component.d.ts +1 -1
  53. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +10 -0
  54. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +20 -0
  55. package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-data-options.d.ts +2 -2
  56. package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +9 -0
  57. package/dist/packages/sdk-ui/src/widgets/common/widget-container.d.ts +2 -0
  58. package/dist/packages/sdk-ui/src/widgets/common/widget-errors-and-warnings-context.d.ts +14 -0
  59. package/dist/packages/sdk-ui/src/widgets/common/widget-header-info-button.d.ts +3 -1
  60. package/dist/packages/sdk-ui/src/widgets/common/widget-header.d.ts +2 -0
  61. package/dist/useQuery-CIeSzN0Z.js +7945 -0
  62. package/dist/useQuery-LqaaNBLw.cjs +175 -0
  63. package/dist/widget-composer-CvgsMHyb.cjs +237 -0
  64. package/dist/widget-composer-L8kmRhgX.js +624 -0
  65. package/dist/widget-model-translator-CYeCKnTa.js +116687 -0
  66. package/dist/widget-model-translator-_Z-8UaTN.cjs +917 -0
  67. package/package.json +7 -7
  68. package/dist/derive-chart-family-CTpRObm1.js +0 -44117
  69. package/dist/derive-chart-family-DcALKnKU.cjs +0 -271
  70. package/dist/packages/sdk-ui/src/dashboard/components/HorizontalCollapse.d.ts +0 -5
  71. package/dist/useQuery-1xZMqnAI.js +0 -79308
  72. package/dist/useQuery-D9rZ58KS.cjs +0 -821
  73. package/dist/widget-composer-B17DVa2A.cjs +0 -101
  74. package/dist/widget-composer-DqjH_6dw.js +0 -448
@@ -1,10 +1,10 @@
1
1
  import { HookEnableParam } from '../../common/hooks/types.js';
2
2
  import { HierarchyModel } from '../../models/hierarchy/hierarchy-model';
3
- import { GetHierarchiesOptions } from './types.js';
3
+ import { GetHierarchyModelsOptions } from './get-hierarchy-models.js';
4
4
  /**
5
5
  * Parameters for {@link useGetHierarchyModels} hook.
6
6
  */
7
- export interface GetHierarchiesParams extends GetHierarchiesOptions, HookEnableParam {
7
+ export interface GetHierarchyModelsParams extends GetHierarchyModelsOptions, HookEnableParam {
8
8
  }
9
9
  /**
10
10
  * States of hierarchy models load.
@@ -87,11 +87,11 @@ export type HierarchyModelsSuccessState = {
87
87
  * @group Fusion Assets
88
88
  * @fusionEmbed
89
89
  */
90
- export declare const useGetHierarchyModels: (params: GetHierarchiesParams) => HierarchyModelsState;
90
+ export declare const useGetHierarchyModels: (params: GetHierarchyModelsParams) => HierarchyModelsState;
91
91
  /**
92
92
  * {@link useGetHierarchyModels} without tracking to be used inside other hooks or components in Compose SDK.
93
93
  *
94
94
  * @param params - Parameters of the hierarchies to be retrieved
95
95
  * @internal
96
96
  */
97
- export declare function useGetHierarchyModelsInternal(params: GetHierarchiesParams): HierarchyModelsState;
97
+ export declare function useGetHierarchyModelsInternal(params: GetHierarchyModelsParams): HierarchyModelsState;
@@ -152,6 +152,16 @@ export declare function fromWidgetDto(widgetDto: WidgetDto, themeSettings?: Comp
152
152
  * @internal
153
153
  */
154
154
  export declare function fromChartWidgetProps(chartWidgetProps: ChartWidgetProps): WidgetModel;
155
+ /**
156
+ * Data source as specified in the jaql
157
+ * but with required filelds
158
+ *
159
+ * @internal
160
+ */
161
+ export type JaqlDataSourceForWidgetDto = JaqlDataSource & {
162
+ id: string;
163
+ address: string;
164
+ };
155
165
  /**
156
166
  * Translates a {@link WidgetModel} to {@link WidgetDto}.
157
167
  *
@@ -160,4 +170,4 @@ export declare function fromChartWidgetProps(chartWidgetProps: ChartWidgetProps)
160
170
  * @returns WidgetDto
161
171
  * @internal
162
172
  */
163
- export declare function toWidgetDto(widgetModel: WidgetModel, dataSource: JaqlDataSource): WidgetDto;
173
+ export declare function toWidgetDto(widgetModel: WidgetModel, dataSource?: JaqlDataSourceForWidgetDto): WidgetDto;
@@ -16,9 +16,11 @@ type PivotRenderOptions = {
16
16
  themeSettings: CompleteThemeSettings;
17
17
  /** The size of the pivot table container. */
18
18
  size: ContainerSize | null;
19
+ /** Callback to handle total height change. */
20
+ onTotalHeightChange?: (totalHeight: number) => void;
19
21
  };
20
22
  /**
21
23
  * A hook that renders the pivot table.
22
24
  */
23
- export declare function useRenderPivot({ nodeRef, pivotBuilder, dataOptions, styleOptions, themeSettings, size, }: PivotRenderOptions): void;
25
+ export declare function useRenderPivot({ nodeRef, pivotBuilder, dataOptions, styleOptions, themeSettings, size, onTotalHeightChange, }: PivotRenderOptions): void;
24
26
  export {};
@@ -88,10 +88,18 @@ export interface SisenseContextProviderProps {
88
88
  * This callback is useful for handling errors that happen during the initialization or runtime of the Sisense context,
89
89
  * such as incorrect configuration, invalid authentication, or network-related issues.
90
90
  *
91
- * @param error - The error object containing details about the issue.
92
91
  * @category Sisense App Error Handling
93
92
  */
94
- onError?: (error: Error) => void;
93
+ onError?: (
94
+ /** The error object containing details about the issue. */
95
+ error: Error,
96
+ /** Additional details about the error, such as the component name and props that caused this error. */
97
+ errorDetails?: {
98
+ /** The name of the component that caused the error. */
99
+ componentName: string;
100
+ /** The props of the component that caused the error. */
101
+ componentProps: unknown;
102
+ }) => void;
95
103
  /**
96
104
  * Boolean flag to enable sending silent pre-authentication requests to the Sisense instance.
97
105
  * Used to check if user is already authenticated, check is performed in an ivisible iframe.
@@ -701,7 +709,7 @@ export interface IndicatorChartProps extends BaseChartProps {
701
709
  /**
702
710
  * Props of the {@link Table} component.
703
711
  */
704
- export interface TableProps {
712
+ export interface TableProps extends BaseChartEventProps {
705
713
  /**
706
714
  * {@inheritDoc ChartProps.dataSet}
707
715
  *
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ClientApplication } from '../app/client-application';
3
3
  import { TrackingEventDetails } from '@sisense/sdk-tracking';
4
+ import { SisenseContextProviderProps } from '..';
4
5
  export type SisenseContextPayload = {
5
6
  isInitialized: boolean;
6
7
  app?: ClientApplication;
@@ -11,6 +12,7 @@ export type SisenseContextPayload = {
11
12
  };
12
13
  errorBoundary: {
13
14
  showErrorBox: boolean;
15
+ onError?: SisenseContextProviderProps['onError'];
14
16
  };
15
17
  };
16
18
  export declare const SisenseContext: import("react").Context<SisenseContextPayload>;
@@ -5,4 +5,4 @@ export declare const PAGES_BATCH_SIZE = 10;
5
5
  /**
6
6
  * Component that renders a table with aggregation and pagination.
7
7
  */
8
- export declare const TableComponent: ({ dataSet, dataOptions, styleOptions, filters, }: TableProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const TableComponent: ({ dataSet, dataOptions, styleOptions, filters, onDataReady, }: TableProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,6 +1,7 @@
1
1
  export declare const translation: {
2
2
  errors: {
3
3
  noSisenseContext: string;
4
+ restApiNotReady: string;
4
5
  componentRenderError: string;
5
6
  sisenseContextNoAuthentication: string;
6
7
  chartNoSisenseContext: string;
@@ -28,6 +29,8 @@ export declare const translation: {
28
29
  failedToFetch: string;
29
30
  };
30
31
  widgetModel: {
32
+ incomleteWidget: string;
33
+ unsupportedWidgetTypeDto: string;
31
34
  pivotWidgetNotSupported: string;
32
35
  textWidgetNotSupported: string;
33
36
  onlyTableWidgetSupported: string;
@@ -60,6 +63,7 @@ export declare const translation: {
60
63
  cascadingFilterOriginalNotFound: string;
61
64
  dashboardLoadFailed: string;
62
65
  dashboardWithOidNotFound: string;
66
+ failedToAddWidget: string;
63
67
  widgetWithOidNotFound: string;
64
68
  widgetEmptyResponse: string;
65
69
  dateFilterIncorrectOperator: string;
@@ -132,6 +136,12 @@ export declare const translation: {
132
136
  max: string;
133
137
  };
134
138
  };
139
+ treemap: {
140
+ tooltip: {
141
+ ofTotal: string;
142
+ of: string;
143
+ };
144
+ };
135
145
  advanced: {
136
146
  tooltip: {
137
147
  min: string;
@@ -11,6 +11,7 @@ export declare const resources: {
11
11
  en: {
12
12
  errors: {
13
13
  noSisenseContext: string;
14
+ restApiNotReady: string;
14
15
  componentRenderError: string;
15
16
  sisenseContextNoAuthentication: string;
16
17
  chartNoSisenseContext: string;
@@ -38,6 +39,8 @@ export declare const resources: {
38
39
  failedToFetch: string;
39
40
  };
40
41
  widgetModel: {
42
+ incomleteWidget: string;
43
+ unsupportedWidgetTypeDto: string;
41
44
  pivotWidgetNotSupported: string;
42
45
  textWidgetNotSupported: string;
43
46
  onlyTableWidgetSupported: string;
@@ -70,6 +73,7 @@ export declare const resources: {
70
73
  cascadingFilterOriginalNotFound: string;
71
74
  dashboardLoadFailed: string;
72
75
  dashboardWithOidNotFound: string;
76
+ failedToAddWidget: string;
73
77
  widgetWithOidNotFound: string;
74
78
  widgetEmptyResponse: string;
75
79
  dateFilterIncorrectOperator: string;
@@ -142,6 +146,12 @@ export declare const resources: {
142
146
  max: string;
143
147
  };
144
148
  };
149
+ treemap: {
150
+ tooltip: {
151
+ ofTotal: string;
152
+ of: string;
153
+ };
154
+ };
145
155
  advanced: {
146
156
  tooltip: {
147
157
  min: string;
@@ -240,6 +250,7 @@ export declare const resources: {
240
250
  uk: {
241
251
  errors: {
242
252
  noSisenseContext: string;
253
+ restApiNotReady: string;
243
254
  componentRenderError: string;
244
255
  sisenseContextNoAuthentication: string;
245
256
  chartNoSisenseContext: string;
@@ -267,6 +278,8 @@ export declare const resources: {
267
278
  failedToFetch: string;
268
279
  };
269
280
  widgetModel: {
281
+ incomleteWidget: string;
282
+ unsupportedWidgetTypeDto: string;
270
283
  pivotWidgetNotSupported: string;
271
284
  textWidgetNotSupported: string;
272
285
  onlyTableWidgetSupported: string;
@@ -299,6 +312,7 @@ export declare const resources: {
299
312
  cascadingFilterOriginalNotFound: string;
300
313
  dashboardLoadFailed: string;
301
314
  dashboardWithOidNotFound: string;
315
+ failedToAddWidget: string;
302
316
  widgetWithOidNotFound: string;
303
317
  widgetEmptyResponse: string;
304
318
  dateFilterIncorrectOperator: string;
@@ -371,6 +385,12 @@ export declare const resources: {
371
385
  max: string;
372
386
  };
373
387
  };
388
+ treemap: {
389
+ tooltip: {
390
+ ofTotal: string;
391
+ of: string;
392
+ };
393
+ };
374
394
  advanced: {
375
395
  tooltip: {
376
396
  min: string;
@@ -1,8 +1,8 @@
1
- import { DimensionalBaseMeasure, DimensionalAttribute, DimensionalCalculatedMeasure, Jaql, JaqlDataSource, Filter } from '@sisense/sdk-data';
1
+ import { DimensionalBaseMeasure, DimensionalAttribute, DimensionalCalculatedMeasure, Jaql, JaqlDataSource } from '@sisense/sdk-data';
2
2
  import { StyledMeasureColumn, StyledColumn, Color } from '../types.js';
3
3
  import { Panel, PanelItem, WidgetType, WidgetStyle, BoxplotWidgetStyle } from './types.js';
4
4
  import { WidgetDataOptions } from '../models/index.js';
5
- export declare function createDimensionalElementFromJaql(jaql: Jaql, format?: PanelItem['format']): Filter | DimensionalAttribute | DimensionalCalculatedMeasure | DimensionalBaseMeasure;
5
+ export declare function createDimensionalElementFromJaql(jaql: Jaql, format?: PanelItem['format']): import("@sisense/sdk-data").Filter | DimensionalAttribute | DimensionalCalculatedMeasure | DimensionalBaseMeasure;
6
6
  /** @internal */
7
7
  export declare function applyStatisticalModels(dataOption: StyledMeasureColumn, statisticalModels?: {
8
8
  forecast?: {
@@ -4,6 +4,11 @@ import { ChartType } from '../types.js';
4
4
  import { FiltersMergeStrategy, Panel, PanelItem, TextWidgetDtoStyle, WidgetStyle, WidgetSubtype, WidgetType } from './types.js';
5
5
  import { ChartProps, ChartWidgetProps, PivotTableWidgetProps, PluginWidgetProps, RenderToolbarHandler, TextWidgetProps, CommonWidgetProps, WithWidgetType, WidgetProps } from '../index.js';
6
6
  import { WidgetTypeInternal } from '../models/widget/types';
7
+ /**
8
+ * Returns the corresponding chart type for a given widget type
9
+ *
10
+ * @internal
11
+ */
7
12
  export declare function getChartType(widgetType: WidgetType): ChartType;
8
13
  export declare function getWidgetTypeFromChartType(chartType: ChartType): WidgetType;
9
14
  export declare function getChartSubtype(widgetSubtype: WidgetSubtype): ChartSubtype | undefined;
@@ -20,6 +25,7 @@ export declare function isChartWidget(widgetType: WidgetTypeOrString): boolean;
20
25
  *
21
26
  * @param widgetProps - The widget props to check.
22
27
  * @returns whether the widget props is for a text widget
28
+ * @internal
23
29
  */
24
30
  export declare function isTextWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithWidgetType<TextWidgetProps, 'text'>;
25
31
  /**
@@ -27,6 +33,7 @@ export declare function isTextWidgetProps(widgetProps: CommonWidgetProps): widge
27
33
  *
28
34
  * @param widgetProps - The widget props to check.
29
35
  * @returns whether the widget props is for a pivot table widget
36
+ * @internal
30
37
  */
31
38
  export declare function isPivotTableWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithWidgetType<PivotTableWidgetProps, 'pivot'>;
32
39
  /**
@@ -34,6 +41,7 @@ export declare function isPivotTableWidgetProps(widgetProps: CommonWidgetProps):
34
41
  *
35
42
  * @param widgetProps - The widget props to check.
36
43
  * @returns whether the widget props is for a plugin widget
44
+ * @internal
37
45
  */
38
46
  export declare function isPluginWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithWidgetType<PluginWidgetProps, 'plugin'>;
39
47
  /**
@@ -41,6 +49,7 @@ export declare function isPluginWidgetProps(widgetProps: CommonWidgetProps): wid
41
49
  *
42
50
  * @param widgetProps - The widget props to check.
43
51
  * @returns whether the widget props is for a chart widget
52
+ * @internal
44
53
  */
45
54
  export declare function isChartWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithWidgetType<ChartWidgetProps, 'chart'>;
46
55
  export declare function translateWidgetTypeInternal(widgetProps: CommonWidgetProps): WidgetTypeInternal;
@@ -12,4 +12,6 @@ interface WidgetContainerProps {
12
12
  }
13
13
  /** @internal */
14
14
  export declare const WidgetContainer: React.FC<WidgetContainerProps>;
15
+ /** @internal */
16
+ export declare const RawWidgetContainer: React.FC<WidgetContainerProps>;
15
17
  export {};
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface WidgetErrorsAndWarnings {
3
+ errors: string[];
4
+ warnings: string[];
5
+ setErrors: React.Dispatch<React.SetStateAction<string[]>>;
6
+ setWarnings: React.Dispatch<React.SetStateAction<string[]>>;
7
+ clearError: () => void;
8
+ clearWarning: () => void;
9
+ }
10
+ export declare const WidgetErrorsAndWarningsProvider: React.FC<{
11
+ children: React.ReactNode;
12
+ }>;
13
+ export declare const useWidgetErrorsAndWarnings: () => WidgetErrorsAndWarnings;
14
+ export {};
@@ -1,7 +1,9 @@
1
1
  import { WidgetContainerStyleOptions } from '../../types';
2
- export default function WidgetHeaderInfoButton({ title, description, styleOptions, onRefresh, }: {
2
+ export default function WidgetHeaderInfoButton({ title, description, errorMessages, styleOptions, onRefresh, }: {
3
3
  title?: string;
4
4
  description?: string;
5
5
  styleOptions?: WidgetContainerStyleOptions['header'];
6
+ errorMessages?: string[];
7
+ warningMessages?: string[];
6
8
  onRefresh: () => void;
7
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -5,6 +5,8 @@ interface WidgetHeaderProps {
5
5
  title?: string;
6
6
  description?: string;
7
7
  dataSetName?: string;
8
+ errorMessages?: string[];
9
+ warningMessages?: string[];
8
10
  styleOptions?: WidgetContainerStyleOptions['header'];
9
11
  }
10
12
  export declare const WidgetHeader: React.FC<WidgetHeaderProps>;