@sisense/sdk-ui 1.11.0 → 1.12.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 (72) hide show
  1. package/dist/ai/buttons/thumbs-down-button.d.ts +2 -1
  2. package/dist/ai/buttons/thumbs-up-button.d.ts +2 -1
  3. package/dist/ai/chat-config.d.ts +10 -0
  4. package/dist/ai/chat-dropup.d.ts +2 -1
  5. package/dist/ai/chat-input.d.ts +3 -1
  6. package/dist/ai/common/icon-button.d.ts +2 -3
  7. package/dist/ai/icons/light-bulb-icon.d.ts +1 -3
  8. package/dist/ai/index.d.ts +1 -0
  9. package/dist/ai/messages/clickable-message.d.ts +2 -1
  10. package/dist/ai/messages/feedback-wrapper.d.ts +2 -2
  11. package/dist/ai/messages/text-message.d.ts +5 -0
  12. package/dist/ai/use-last-nlq-response.d.ts +19 -0
  13. package/dist/ai.cjs +454 -0
  14. package/dist/ai.js +1073 -1074
  15. package/dist/api/types/dashboard-dto.d.ts +2 -1
  16. package/dist/app/client-application.d.ts +1 -0
  17. package/dist/chart/helpers/use-chart-renderer-props.d.ts +1 -0
  18. package/dist/chart-options-processor/translations/funnel-plot-options.d.ts +2 -1
  19. package/dist/chart-options-processor/translations/pie-plot-options.d.ts +2 -1
  20. package/dist/common/components/loading-indicator.d.ts +17 -4
  21. package/dist/common/hooks/use-fetch.d.ts +1 -1
  22. package/dist/common/hooks/use-has-changed.d.ts +9 -0
  23. package/dist/common/hooks/use-should-load.d.ts +12 -0
  24. package/dist/dashboard/components/content-panel.d.ts +41 -0
  25. package/dist/dashboard/components/dashboard-container.d.ts +2 -0
  26. package/dist/dashboard/components/dashboard-header.d.ts +2 -0
  27. package/dist/dashboard/components/plugin-service.d.ts +21 -0
  28. package/dist/dashboard/constants.d.ts +2 -0
  29. package/dist/dashboard/dashboard-by-id.d.ts +7 -0
  30. package/dist/dashboard/dashboard.d.ts +8 -0
  31. package/dist/dashboard/types.d.ts +41 -0
  32. package/dist/dashboard/utils.d.ts +5 -0
  33. package/dist/dynamic-size-container/dynamic-size-container.d.ts +8 -0
  34. package/dist/filters/components/common/date-range-field-button.d.ts +3 -6
  35. package/dist/filters/components/date-filter/date-filter/date-filter.d.ts +15 -0
  36. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-display.d.ts +6 -0
  37. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +6 -0
  38. package/dist/filters/components/date-filter/date-range-filter-tile/editable-date-range-filter.d.ts +14 -0
  39. package/dist/filters/components/date-filter/date-range-filter-tile/use-date-limits.d.ts +1 -2
  40. package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +2 -2
  41. package/dist/filters/components/icons/arrow-icon.d.ts +6 -0
  42. package/dist/filters/components/icons/double-arrow-icon.d.ts +6 -0
  43. package/dist/highcharts-memorized.d.ts +1 -1
  44. package/dist/index.cjs +784 -0
  45. package/dist/index.d.ts +1 -0
  46. package/dist/index.js +11798 -11496
  47. package/dist/models/dashboard/dashboard-model.d.ts +62 -0
  48. package/dist/models/dashboard/get-dashboard-model.d.ts +2 -1
  49. package/dist/models/dashboard/get-dashboard-models.d.ts +2 -1
  50. package/dist/models/dashboard/index.d.ts +1 -1
  51. package/dist/models/dashboard/translate-dashboard-utils.d.ts +5 -0
  52. package/dist/models/dashboard/types.d.ts +2 -14
  53. package/dist/models/dashboard/use-get-dashboard-model.d.ts +1 -1
  54. package/dist/models/dashboard/use-get-dashboard-models.d.ts +1 -1
  55. package/dist/query-execution/query-params-comparator.d.ts +1 -7
  56. package/dist/query-execution/use-execute-pivot-query.d.ts +2 -5
  57. package/dist/query-execution/use-execute-query-by-widget-id.d.ts +3 -4
  58. package/dist/translation/resources/en.d.ts +1 -0
  59. package/dist/translation/resources/index.d.ts +2 -0
  60. package/dist/types.d.ts +31 -10
  61. package/dist/{debounce-BbwkW3DX.js → useQuery-0UWck_2A.js} +12729 -12646
  62. package/dist/useQuery-DVHD0kJ-.cjs +603 -0
  63. package/dist/utils/create-cache.d.ts +0 -1
  64. package/dist/utils/utility-types.d.ts +1 -0
  65. package/dist/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +2 -2
  66. package/package.json +13 -9
  67. package/dist/ai/icons/thumbs-down-hovered-icon.d.ts +0 -2
  68. package/dist/ai/icons/thumbs-up-hovered-icon.d.ts +0 -2
  69. package/dist/ai/messages/clear-history-success-message.d.ts +0 -1
  70. package/dist/filters/components/icons/arrow-right-icon.d.ts +0 -2
  71. package/dist/filters/components/icons/double-arrow-right-icon.d.ts +0 -2
  72. package/dist/models/dashboard/translate-dashboard.d.ts +0 -4
@@ -0,0 +1,62 @@
1
+ import { DataSource, Filter } from '@sisense/sdk-data';
2
+ import { Layout, WidgetModel } from '../../models';
3
+ import type { DashboardDto } from '../../api/types/dashboard-dto';
4
+ /**
5
+ * Model of Sisense dashboard defined in the abstractions of Compose SDK.
6
+ *
7
+ * @group Fusion Embed
8
+ * @fusionEmbed
9
+ */
10
+ export declare class DashboardModel {
11
+ /**
12
+ * Unique identifier of the dashboard.
13
+ */
14
+ oid: string;
15
+ /**
16
+ * Dashboard title.
17
+ */
18
+ title: string;
19
+ /**
20
+ * Dashboard data source details.
21
+ */
22
+ dataSource: DataSource;
23
+ /**
24
+ * Dashboard widgets.
25
+ */
26
+ widgets: WidgetModel[];
27
+ /**
28
+ * Dashboard layout.
29
+ *
30
+ * @internal
31
+ */
32
+ layout: Layout;
33
+ /**
34
+ * Dashboard filters.
35
+ *
36
+ * @internal
37
+ */
38
+ filters: Filter[];
39
+ /**
40
+ * Creates a new dashboard model.
41
+ *
42
+ * @param dashboardDto - The widget DTO to be converted to a widget model
43
+ * @internal
44
+ */
45
+ constructor(dashboardDto: DashboardDto);
46
+ /**
47
+ * Returns the props to be used for rendering a dashboard.
48
+ *
49
+ * @example
50
+ * ```tsx
51
+ * <Dashboard {...dashboard.getDashboardProps()} />
52
+ * ```
53
+ * @internal
54
+ */
55
+ getDashboardProps(): {
56
+ title: string;
57
+ dataSource: DataSource;
58
+ widgets: WidgetModel[];
59
+ layout: Layout;
60
+ filters: Filter[];
61
+ };
62
+ }
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
+ import { DashboardModel } from '../../models/dashboard/dashboard-model';
2
3
  export interface GetDashboardModelOptions {
3
4
  /**
4
5
  * Boolean flag whether to include widgets in the dashboard model
@@ -16,4 +17,4 @@ export interface GetDashboardModelOptions {
16
17
  includeFilters?: boolean;
17
18
  }
18
19
  /** @internal */
19
- export declare function getDashboardModel(http: HttpClient, dashboardOid: string, options?: GetDashboardModelOptions): Promise<import("./types").DashboardModel>;
20
+ export declare function getDashboardModel(http: HttpClient, dashboardOid: string, options?: GetDashboardModelOptions): Promise<DashboardModel>;
@@ -1,4 +1,5 @@
1
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
+ import { DashboardModel } from '../../models/dashboard/dashboard-model';
2
3
  export interface GetDashboardModelsOptions {
3
4
  /**
4
5
  * Dashboard title to search by
@@ -12,4 +13,4 @@ export interface GetDashboardModelsOptions {
12
13
  includeWidgets?: boolean;
13
14
  }
14
15
  /** @internal */
15
- export declare function getDashboardModels(http: HttpClient, options?: GetDashboardModelsOptions): Promise<import("./types.js").DashboardModel[]>;
16
+ export declare function getDashboardModels(http: HttpClient, options?: GetDashboardModelsOptions): Promise<DashboardModel[]>;
@@ -1,6 +1,6 @@
1
1
  export * from './types';
2
2
  export * from './get-dashboard-model';
3
3
  export * from './get-dashboard-models';
4
- export * from './translate-dashboard';
5
4
  export * from './use-get-dashboard-model';
6
5
  export * from './use-get-dashboard-models';
6
+ export * from './dashboard-model';
@@ -0,0 +1,5 @@
1
+ import { type Layout as SisenseLayout, type FilterDto, type CascadingFilterDto } from '../../api/types/dashboard-dto';
2
+ import type { Layout } from './types';
3
+ import { Filter } from '@sisense/sdk-data';
4
+ export declare const translateLayout: (layout: SisenseLayout) => Layout;
5
+ export declare function extractDashboardFilters(dashboardFilters: Array<FilterDto | CascadingFilterDto>): Filter[];
@@ -1,11 +1,9 @@
1
- import { type DataSource, Filter } from '@sisense/sdk-data';
2
- import { WidgetModel } from '../widget/widget-model';
3
1
  /** @internal */
4
2
  export interface Layout {
5
3
  columns: {
6
4
  widthPercentage: number;
7
- cells: {
8
- subcells: {
5
+ rows: {
6
+ cells: {
9
7
  widthPercentage: number;
10
8
  height: number | string;
11
9
  widgetId: string;
@@ -13,13 +11,3 @@ export interface Layout {
13
11
  }[];
14
12
  }[];
15
13
  }
16
- export type DashboardModel = {
17
- oid: string;
18
- title: string;
19
- dataSource: DataSource;
20
- widgets?: WidgetModel[];
21
- /** @internal */
22
- layout?: Layout;
23
- /** @internal */
24
- filters?: Filter[];
25
- };
@@ -1,5 +1,5 @@
1
1
  import { DataState } from '../../common/hooks/data-load-state-reducer';
2
- import { type DashboardModel } from './types';
2
+ import { DashboardModel } from './dashboard-model';
3
3
  import { GetDashboardModelOptions } from './get-dashboard-model';
4
4
  import { HookEnableParam } from '../../common/hooks/types';
5
5
  /**
@@ -1,7 +1,7 @@
1
1
  import { DataState } from '../../common/hooks/data-load-state-reducer.js';
2
- import { type DashboardModel } from './types.js';
3
2
  import { HookEnableParam } from '../../common/hooks/types.js';
4
3
  import { GetDashboardModelsOptions } from './get-dashboard-models.js';
4
+ import { DashboardModel } from '../../models';
5
5
  /**
6
6
  * Parameters for {@link useGetDashboardModels} hook.
7
7
  */
@@ -1,8 +1,2 @@
1
1
  import { ExecuteQueryParams } from '../index.js';
2
- /**
3
- * Checks if the query parameters have changed by deep comparison.
4
- *
5
- * @param prevParams - Previous query parameters
6
- * @param newParams - New query parameters
7
- */
8
- export declare function isQueryParamsChanged(prevParams: ExecuteQueryParams | undefined, newParams: ExecuteQueryParams): boolean;
2
+ export declare function useQueryParamsChanged(params: ExecuteQueryParams): boolean;
@@ -29,9 +29,6 @@ export declare function useExecutePivotQueryInternal(params: ExecutePivotQueryPa
29
29
  /**
30
30
  * Checks if the query parameters have changed by deep comparison.
31
31
  *
32
- * TODO refactor to reuse isQueryParamsChanged
33
- *
34
- * @param prevParams - Previous query parameters
35
- * @param newParams - New query parameters
32
+ * @param params - New query parameters
36
33
  */
37
- export declare function isPivotQueryParamsChanged(prevParams: ExecutePivotQueryParams | undefined, newParams: ExecutePivotQueryParams): boolean;
34
+ export declare function usePivotQueryParamsChanged(params: ExecutePivotQueryParams): boolean;
@@ -39,12 +39,11 @@ export declare const useExecuteQueryByWidgetId: (params: ExecuteQueryByWidgetIdP
39
39
  */
40
40
  export declare function useExecuteQueryByWidgetIdInternal(params: ExecuteQueryByWidgetIdParams): QueryByWidgetIdState;
41
41
  /**
42
- * Checks if the parameters have changed by deep comparison.
42
+ * Checks if the query parameters have changed by deep comparison.
43
43
  *
44
- * @param prevParams - Previous query parameters
45
- * @param newParams - New query parameters
44
+ * @param params - New query parameters
46
45
  */
47
- export declare function isParamsChanged(prevParams: ExecuteQueryByWidgetIdParams | undefined, newParams: ExecuteQueryByWidgetIdParams): boolean;
46
+ export declare function useParamsChanged(params: ExecuteQueryByWidgetIdParams): boolean;
48
47
  /** @internal */
49
48
  export declare function executeQueryByWidgetId({ widgetOid, dashboardOid, filters, highlights, filtersMergeStrategy, count, offset, includeDashboardFilters, app, onBeforeQuery, }: ExecuteQueryByWidgetIdParams & {
50
49
  app: ClientApplication;
@@ -35,6 +35,7 @@ export declare const translation: {
35
35
  };
36
36
  unknownFilterInFilterRelations: string;
37
37
  filterRelationsNotSupported: string;
38
+ invalidFilterType: string;
38
39
  };
39
40
  errorBoxText: string;
40
41
  chartNoData: string;
@@ -39,6 +39,7 @@ export declare const resources: {
39
39
  };
40
40
  unknownFilterInFilterRelations: string;
41
41
  filterRelationsNotSupported: string;
42
+ invalidFilterType: string;
42
43
  };
43
44
  errorBoxText: string;
44
45
  chartNoData: string;
@@ -137,6 +138,7 @@ export declare const resources: {
137
138
  };
138
139
  unknownFilterInFilterRelations: string;
139
140
  filterRelationsNotSupported: string;
141
+ invalidFilterType: string;
140
142
  };
141
143
  errorBoxText: string;
142
144
  chartNoData: string;
package/dist/types.d.ts CHANGED
@@ -656,8 +656,6 @@ export interface ThemeSettings {
656
656
  };
657
657
  /**
658
658
  * Theme settings specific to the AI Chatbot component
659
- *
660
- * @internal
661
659
  */
662
660
  aiChat?: {
663
661
  /** Background color of the chatbot */
@@ -766,10 +764,10 @@ export interface ThemeSettings {
766
764
  borderRadius?: string;
767
765
  /** Setting to be applied on hover */
768
766
  hover?: {
769
- /** Background color of the chatbot suggestions on hover */
770
- backgroundColor?: string;
771
767
  /** Text color of the chatbot suggestions on hover */
772
768
  textColor?: string;
769
+ /** Background color of the chatbot suggestions on hover */
770
+ backgroundColor?: string;
773
771
  };
774
772
  /** 2-color gradient to be applied on suggestions loading animation */
775
773
  loadingGradient?: [string, string];
@@ -778,12 +776,14 @@ export interface ThemeSettings {
778
776
  };
779
777
  /** Settings for the chatbot clickable messages */
780
778
  clickableMessages?: {
781
- /** Background color of the chatbot clickable messages */
782
- backgroundColor?: string;
783
779
  /** Text color of the chatbot clickable messages */
784
780
  textColor?: string;
781
+ /** Background color of the chatbot clickable messages */
782
+ backgroundColor?: string;
785
783
  /** Border of the chatbot clickable messages */
786
784
  border?: false | string;
785
+ /** 2-color gradient to be applied on the border */
786
+ borderGradient?: [string, string] | null;
787
787
  /** Setting to be applied on hover */
788
788
  hover?: {
789
789
  /** Text color of the chatbot clickable messages on hover */
@@ -792,16 +792,37 @@ export interface ThemeSettings {
792
792
  backgroundColor?: string;
793
793
  };
794
794
  };
795
+ /** Settings for the data topics screen */
796
+ dataTopics?: {
797
+ /** Background color of the data topics screen */
798
+ backgroundColor?: string;
799
+ /** Settings for the individual data topic items */
800
+ items?: {
801
+ /** Text color of the data topic items */
802
+ textColor?: string;
803
+ /** Background color of the data topic items */
804
+ backgroundColor?: string;
805
+ };
806
+ };
795
807
  /** Settings for the chatbot icons */
796
808
  icons?: {
797
809
  /** Color of the chatbot icons */
798
810
  color?: string;
799
- /** Setting to be applied on hover */
800
- hover?: {
801
- /** Color of the chatbot icons on hover */
802
- color?: string;
811
+ /** Settings for feedback icons */
812
+ feedbackIcons?: {
813
+ /** Background color of the feedback icons on hover */
814
+ hoverColor?: string;
803
815
  };
804
816
  };
817
+ /** Settings for the chatbot tooltips */
818
+ tooltips?: {
819
+ /** Background color of the tooltips */
820
+ backgroundColor?: string;
821
+ /** Text color of the tooltips */
822
+ textColor?: string;
823
+ /** Box shadow of the tooltips */
824
+ boxShadow?: string;
825
+ };
805
826
  };
806
827
  }
807
828
  /**