@sisense/sdk-ui 1.16.0 → 1.17.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 (65) hide show
  1. package/dist/ai.cjs +1 -1
  2. package/dist/ai.js +28 -28
  3. package/dist/analytics-composer.cjs +1 -1
  4. package/dist/analytics-composer.js +1 -1
  5. package/dist/app/client-application.d.ts +22 -2
  6. package/dist/chart-data/types.d.ts +1 -1
  7. package/dist/chart-data-options/types.d.ts +4 -2
  8. package/dist/chart-data-processor/table-processor.d.ts +1 -1
  9. package/dist/chart-options-processor/common-highcharts-option-service.d.ts +2 -1
  10. package/dist/charts/map-charts/scattermap/utils/map.d.ts +6 -2
  11. package/dist/charts/map-charts/scattermap/utils/markers.d.ts +1 -1
  12. package/dist/charts/table/data-table-wrapper.d.ts +1 -1
  13. package/dist/charts/table/helpers/calc-column-widths.d.ts +1 -1
  14. package/dist/charts/table/types.d.ts +0 -1
  15. package/dist/common/components/loading-indicator.d.ts +13 -0
  16. package/dist/common/hooks/use-has-changed.d.ts +1 -1
  17. package/dist/common/hooks/use-tracking.d.ts +7 -0
  18. package/dist/common-filters/selection-utils.d.ts +1 -1
  19. package/dist/common-filters/types.d.ts +9 -3
  20. package/dist/common-filters/utils.d.ts +0 -4
  21. package/dist/dashboard/dashboard-by-id.d.ts +6 -3
  22. package/dist/dashboard/dashboard.d.ts +6 -4
  23. package/dist/dashboard/index.d.ts +1 -1
  24. package/dist/dashboard/types.d.ts +11 -6
  25. package/dist/dashboard-widget/translate-widget-drilldown-options.d.ts +2 -2
  26. package/dist/dashboard-widget/types.d.ts +3 -0
  27. package/dist/decorators/component-decorators/with-tracking/error-tracker.d.ts +3 -0
  28. package/dist/filters/components/filters-panel/filters-panel.d.ts +2 -1
  29. package/dist/get-widget-options-D4UHj7o5.cjs +198 -0
  30. package/dist/get-widget-options-D88MkBTJ.js +37924 -0
  31. package/dist/index.cjs +181 -207
  32. package/dist/index.d.ts +3 -3
  33. package/dist/index.js +20411 -24315
  34. package/dist/models/dashboard/get-dashboard-model.d.ts +1 -1
  35. package/dist/models/dashboard/types.d.ts +17 -3
  36. package/dist/models/widget/get-widget-model.d.ts +1 -1
  37. package/dist/models/widget/translate-widget.d.ts +1 -0
  38. package/dist/pivot-table/helpers/prepare-pivot-styling-props.d.ts +16 -15
  39. package/dist/pivot-table/{use-apply-pivot-table-formatting.d.ts → hooks/use-apply-pivot-table-formatting.d.ts} +1 -1
  40. package/dist/pivot-table/{use-get-pivot-table-query.d.ts → hooks/use-get-pivot-table-query.d.ts} +2 -2
  41. package/dist/pivot-table/hooks/use-pivot-data-loading.d.ts +15 -0
  42. package/dist/pivot-table/hooks/use-pivot-data-service.d.ts +10 -0
  43. package/dist/pivot-table/{use-pivot-table-data-options-internal.d.ts → hooks/use-pivot-table-data-options-internal.d.ts} +2 -2
  44. package/dist/pivot-table/hooks/use-render-pivot.d.ts +24 -0
  45. package/dist/pivot-table/pivot-table.d.ts +2 -2
  46. package/dist/props.d.ts +32 -5
  47. package/dist/sisense-context/sisense-context.d.ts +2 -0
  48. package/dist/theme-provider/default-theme-settings.d.ts +2 -0
  49. package/dist/types.d.ts +38 -0
  50. package/dist/{useQuery-DeK1uDeJ.js → useQuery-C6PPvTP0.js} +11776 -11315
  51. package/dist/useQuery-ChZNmTT3.cjs +433 -0
  52. package/dist/utils/color/color-interpolation.d.ts +9 -0
  53. package/dist/utils/combine-handlers.d.ts +3 -0
  54. package/dist/utils/filters.d.ts +13 -1
  55. package/dist/widgets/common/drilldown-connector.d.ts +19 -0
  56. package/dist/widgets/common/{custom-drilldown.d.ts → use-drilldown.d.ts} +7 -3
  57. package/dist/widgets/use-highlight-selection.d.ts +10 -0
  58. package/package.json +7 -8
  59. package/dist/filters/utils.d.ts +0 -8
  60. package/dist/get-widget-options-D008Wku-.cjs +0 -172
  61. package/dist/get-widget-options-Xskksk4X.js +0 -34154
  62. package/dist/useQuery-aWnvBOTu.cjs +0 -433
  63. package/dist/widgets/chart-widget-deprecated.d.ts +0 -30
  64. package/dist/widgets/common/drilldown.d.ts +0 -25
  65. package/dist/widgets/common/use-widget-drilldown.d.ts +0 -2
@@ -20,13 +20,13 @@ export interface GetDashboardModelOptions {
20
20
  }
21
21
  /**
22
22
  * Retrieves a dashboard model by its OID.
23
+ *
23
24
  * @param http - The HTTP client
24
25
  * @param dashboardOid - The OID of the dashboard
25
26
  * @param options - The options to include widgets and filters in the dashboard model
26
27
  * @param themeSettings - Optional theme settings
27
28
  * @param appSettings - Optional application settings
28
29
  * @returns The dashboard model
29
- *
30
30
  * @internal
31
31
  */
32
32
  export declare function getDashboardModel(http: HttpClient, dashboardOid: string, options?: GetDashboardModelOptions, themeSettings?: CompleteThemeSettings, appSettings?: AppSettings): Promise<DashboardModel>;
@@ -1,6 +1,9 @@
1
1
  import { CommonFiltersOptions } from '../../common-filters/types';
2
2
  import { ColorPaletteTheme } from '../../types';
3
- /** @internal */
3
+ export type { CommonFiltersOptions, CommonFiltersApplyMode, FiltersIgnoringRules, } from '../../common-filters/types';
4
+ /**
5
+ * Layout of a dashboard.
6
+ */
4
7
  export interface Layout {
5
8
  columns: {
6
9
  widthPercentage: number;
@@ -13,9 +16,20 @@ export interface Layout {
13
16
  }[];
14
17
  }[];
15
18
  }
16
- /** @internal */
19
+ /**
20
+ * Options for how common filters defined at the dashboard level should be applied to widgets.
21
+ */
17
22
  export type WidgetFilterOptions = Record<string, CommonFiltersOptions>;
18
- /** @internal */
23
+ /**
24
+ * Style options for the dashboard.
25
+ */
19
26
  export type DashboardStyleOptions = {
27
+ /** Collection of colors used to color various elements */
20
28
  palette?: ColorPaletteTheme;
29
+ /** Background color */
30
+ backgroundColor?: string;
31
+ /** Width of the divider line between widgets */
32
+ dividerLineWidth?: number;
33
+ /** Divider line color */
34
+ dividerLineColor?: string;
21
35
  };
@@ -4,13 +4,13 @@ import { CompleteThemeSettings } from '../../types';
4
4
  import { AppSettings } from '../../app/settings/settings';
5
5
  /**
6
6
  * Retrieves a widget model by its OID.
7
+ *
7
8
  * @param httpClient - The HTTP client
8
9
  * @param dashboardOid - The OID of the dashboard
9
10
  * @param widgetOid - The OID of the widget
10
11
  * @param themeSettings - Optional theme settings
11
12
  * @param appSettings - Optional application settings
12
13
  * @returns The widget model
13
- *
14
14
  * @internal
15
15
  */
16
16
  export declare function getWidgetModel(httpClient: HttpClient, dashboardOid: string, widgetOid: string, themeSettings?: CompleteThemeSettings, appSettings?: AppSettings): Promise<WidgetModel>;
@@ -5,6 +5,7 @@ import { WidgetModel } from './widget-model';
5
5
  import { AppSettings } from '../../app/settings/settings';
6
6
  /**
7
7
  * Translates a widget DTO to a widget model.
8
+ *
8
9
  * @param widget - The widget DTO to be converted to a widget model
9
10
  * @param themeSettings - Optional theme settings
10
11
  * @param appSettings - Optional application settings
@@ -1,21 +1,22 @@
1
1
  import { CompleteThemeSettings, PivotTableStyleOptions } from '../../types';
2
- export declare function preparePivotStylingProps(styleOptions?: PivotTableStyleOptions, themeSettings?: CompleteThemeSettings): {
3
- fontFamily: string | undefined;
4
- textColor: string | undefined;
5
- backgroundColor: string | undefined;
6
- borderColor: string;
7
- fillColor: string | undefined;
8
- additionalFillColor: string | undefined;
2
+ export type PivotStylingProps = {
3
+ fontFamily?: string;
4
+ textColor?: string;
5
+ backgroundColor?: string;
6
+ borderColor?: string;
7
+ fillColor?: string;
8
+ additionalFillColor?: string;
9
9
  fillOptions: {
10
- alternatingRows: boolean | undefined;
11
- alternatingColumns: boolean | undefined;
12
- columnsHeaders: boolean | undefined;
13
- rowMembers: boolean | undefined;
14
- totals: boolean | undefined;
10
+ alternatingRows?: boolean;
11
+ alternatingColumns?: boolean;
12
+ columnsHeaders?: boolean;
13
+ rowMembers?: boolean;
14
+ totals?: boolean;
15
15
  };
16
- rowHeight: number | undefined;
16
+ rowHeight?: number;
17
17
  isAutoHeight: boolean;
18
- navigationPrimaryColor: string | undefined;
19
- navigationSecondaryColor: string | undefined;
18
+ navigationPrimaryColor?: string;
19
+ navigationSecondaryColor?: string;
20
20
  selectionColor: string;
21
21
  };
22
+ export declare function preparePivotStylingProps(styleOptions?: PivotTableStyleOptions, themeSettings?: CompleteThemeSettings): PivotStylingProps;
@@ -1,5 +1,5 @@
1
1
  import { type DataService } from '@sisense/sdk-pivot-client';
2
- import { type PivotTableDataOptions } from '../chart-data-options/types';
2
+ import { type PivotTableDataOptions } from '../../chart-data-options/types';
3
3
  /**
4
4
  * A hook that applies formatting over pivot table cells.
5
5
  *
@@ -1,7 +1,7 @@
1
1
  import { type JaqlRequest } from '@sisense/sdk-pivot-client';
2
2
  import type { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
3
- import { ExecutePivotQueryParams } from '../query-execution';
4
- import { PivotTableDataOptionsInternal } from '../chart-data-options/types';
3
+ import { ExecutePivotQueryParams } from '../../query-execution';
4
+ import { PivotTableDataOptionsInternal } from '../../chart-data-options/types';
5
5
  export declare const getPivotQueryOptions: (dataOptions: PivotTableDataOptionsInternal) => Pick<ExecutePivotQueryParams, 'rows' | 'columns' | 'values' | 'grandTotals'>;
6
6
  /**
7
7
  * A hook that returns the JAQL request object from pivot table props.
@@ -0,0 +1,15 @@
1
+ import { JaqlRequest, PivotBuilder } from '@sisense/sdk-pivot-client';
2
+ interface LoadingState {
3
+ isLoading: boolean;
4
+ isNoResults: boolean;
5
+ }
6
+ /**
7
+ * Hook that initiates loading if jaql is changed or force reload is triggered.
8
+ * Listens to query lifecycle events to update loading state and no results state.
9
+ */
10
+ export declare function usePivotDataLoading(options: {
11
+ jaql: JaqlRequest | undefined;
12
+ pivotBuilder: PivotBuilder;
13
+ isForceReload: boolean;
14
+ }): LoadingState;
15
+ export {};
@@ -0,0 +1,10 @@
1
+ import { DataService, PivotBuilder, PivotClient } from '@sisense/sdk-pivot-client';
2
+ /**
3
+ * Hook that recreates a new data service when new jaql request is needed to sent
4
+ * and updates the pivot builder with the new data service.
5
+ */
6
+ export declare function usePivotDataService(options: {
7
+ pivotClient: PivotClient;
8
+ pivotBuilder: PivotBuilder;
9
+ shouldBeRecreated: boolean;
10
+ }): DataService;
@@ -1,5 +1,5 @@
1
- import { PivotTableDataOptions, PivotTableDataOptionsInternal } from '../chart-data-options/types.js';
2
- import { PivotSortCriteria } from './sorting-utils.js';
1
+ import { PivotTableDataOptions, PivotTableDataOptionsInternal } from '../../chart-data-options/types.js';
2
+ import { PivotSortCriteria } from '../sorting-utils.js';
3
3
  type UsePivotTableDataOptionsInternalResult = {
4
4
  dataOptionsInternal: PivotTableDataOptionsInternal;
5
5
  updateSort: (sortCriteria: PivotSortCriteria) => void;
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ import type { PivotBuilder } from '@sisense/sdk-pivot-client';
3
+ import type { CompleteThemeSettings, PivotTableStyleOptions } from '../../types';
4
+ import type { PivotTableDataOptions } from '../../chart-data-options/types';
5
+ import type { ContainerSize } from '../../dynamic-size-container/dynamic-size-container';
6
+ type PivotRenderOptions = {
7
+ /** Reference to the pivot table container. */
8
+ nodeRef: React.RefObject<HTMLDivElement>;
9
+ /** The pivot builder instance. */
10
+ pivotBuilder: PivotBuilder;
11
+ /** The pivot table data options. */
12
+ dataOptions: PivotTableDataOptions;
13
+ /** The pivot table style options. */
14
+ styleOptions: PivotTableStyleOptions;
15
+ /** The theme settings. */
16
+ themeSettings: CompleteThemeSettings;
17
+ /** The size of the pivot table container. */
18
+ size: ContainerSize | null;
19
+ };
20
+ /**
21
+ * A hook that renders the pivot table.
22
+ */
23
+ export declare function useRenderPivot({ nodeRef, pivotBuilder, dataOptions, styleOptions, themeSettings, size, }: PivotRenderOptions): void;
24
+ export {};
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { PivotTableProps } from '../props';
3
3
  /**
4
4
  * Pivot table with pagination.
@@ -80,4 +80,4 @@ import { PivotTableProps } from '../props';
80
80
  * @group Data Grids
81
81
  * @beta
82
82
  */
83
- export declare const PivotTable: React.FunctionComponent<PivotTableProps>;
83
+ export declare const PivotTable: import("react").FunctionComponent<PivotTableProps>;
package/dist/props.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Attribute, Filter, Measure, DataSource, Data, QueryResultData, FilterRelations } from '@sisense/sdk-data';
2
- import { ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ThemeSettings, PolarStyleOptions, PieStyleOptions, StackableStyleOptions, LineStyleOptions, AreaStyleOptions, FunnelStyleOptions, ScatterStyleOptions, ChartStyleOptions, ChartType, IndicatorStyleOptions, DrilldownOptions, ThemeOid, TreemapStyleOptions, CustomDrilldownResult, MenuPosition, MenuItemSection, SunburstStyleOptions, ChartWidgetStyleOptions, TableWidgetStyleOptions, DashboardWidgetStyleOptions, BoxplotStyleOptions, ScattermapStyleOptions, AreamapStyleOptions, DataPoint, ScatterDataPoint, AreamapDataPoint, BoxplotDataPoint, ChartDataPoints, ScattermapDataPoint, PivotTableStyleOptions, PivotTableWidgetStyleOptions, RegularChartType, RegularChartStyleOptions, TabularChartStyleOptions, TableStyleOptions, AreaRangeStyleOptions } from './types';
2
+ import { ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ThemeSettings, PolarStyleOptions, PieStyleOptions, StackableStyleOptions, LineStyleOptions, AreaStyleOptions, FunnelStyleOptions, ScatterStyleOptions, ChartStyleOptions, ChartType, IndicatorStyleOptions, DrilldownOptions, ThemeOid, TreemapStyleOptions, CustomDrilldownResult, MenuPosition, MenuItemSection, SunburstStyleOptions, ChartWidgetStyleOptions, TableWidgetStyleOptions, DashboardWidgetStyleOptions, BoxplotStyleOptions, ScattermapStyleOptions, AreamapStyleOptions, DataPoint, ScatterDataPoint, AreamapDataPoint, BoxplotDataPoint, ChartDataPoints, ScattermapDataPoint, PivotTableStyleOptions, PivotTableWidgetStyleOptions, RegularChartType, RegularChartStyleOptions, TabularChartStyleOptions, TableStyleOptions, AreaRangeStyleOptions, DrilldownSelection } from './types';
3
3
  import { HighchartsOptions } from './chart-options-processor/chart-options-service';
4
4
  import { ComponentType, PropsWithChildren, ReactNode } from 'react';
5
5
  import { IndicatorChartDataOptions, BoxplotChartCustomDataOptions, BoxplotChartDataOptions, ScatterChartDataOptions, TableDataOptions, ScattermapChartDataOptions, AreamapChartDataOptions, PivotTableDataOptions, RegularChartDataOptions, TabularChartDataOptions, RangeChartDataOptions } from './chart-data-options/types';
@@ -42,15 +42,19 @@ export interface SisenseContextProviderProps {
42
42
  /**
43
43
  * Token for [bearer authentication](https://sisense.dev/guides/restApi/using-rest-api.html).
44
44
  *
45
+ * To signify that the token is pending (e.g., being generated), set the value to `null`. This is supported for React and Vue only.
46
+ *
45
47
  * @category Sisense Authentication
46
48
  */
47
- token?: string;
49
+ token?: string | null;
48
50
  /**
49
51
  * [Web Access Token](https://docs.sisense.com/main/SisenseLinux/using-web-access-token.htm).
50
52
  *
53
+ * To signify that the token is pending (e.g., being generated), set the value to `null`. This is supported for React and Vue only.
54
+ *
51
55
  * @category Sisense Authentication
52
56
  */
53
- wat?: string;
57
+ wat?: string | null;
54
58
  /**
55
59
  * Application specific configurations such as locale and date formats.
56
60
  *
@@ -61,17 +65,32 @@ export interface SisenseContextProviderProps {
61
65
  * Boolean flag to show or hide run-time errors that involve Sisense context in the UI.
62
66
  * Example errors include incorrect Sisense URL or invalid authentication.
63
67
  * Note that this flag does not hide run-time errors in the console.
68
+ * If disabled - it's recommended to specify an {@link onError} callback to handle errors.
64
69
  *
65
70
  * If not specified, the default value is `true`.
66
71
  *
67
- * @internal
72
+ * @category Sisense App Error Handling
68
73
  */
69
74
  showRuntimeErrors?: boolean;
75
+ /**
76
+ * Callback function that is triggered when an error occurs within the Sisense context.
77
+ *
78
+ * This callback is useful for handling errors that happen during the initialization or runtime of the Sisense context,
79
+ * such as incorrect configuration, invalid authentication, or network-related issues.
80
+ *
81
+ * @param error - The error object containing details about the issue.
82
+ *
83
+ * @category Sisense App Error Handling
84
+ */
85
+ onError?: (error: Error) => void;
70
86
  /**
71
87
  * Boolean flag to enable sending tracking events to the Sisense instance.
72
88
  *
73
89
  * If not specified, the default value is `true`.
74
90
  *
91
+ * Deprecated: Use {@link AppConfig.trackingConfig | trackingConfig.enabled }
92
+ *
93
+ * @deprecated Use {@link AppConfig.trackingConfig | trackingConfig.enabled }
75
94
  * @internal
76
95
  */
77
96
  enableTracking?: boolean;
@@ -1271,7 +1290,9 @@ export type DrilldownWidgetConfig = {
1271
1290
  */
1272
1291
  breadcrumbsComponent?: ComponentType<DrilldownBreadcrumbsProps>;
1273
1292
  /**
1274
- * Boolean to override default breadcrumbs location and instead only return them as a property of the 'children' function
1293
+ * React component to be rendered as context menu
1294
+ *
1295
+ * {@link ContextMenu} will be used if not provided
1275
1296
  *
1276
1297
  * @category Widget
1277
1298
  */
@@ -1293,6 +1314,12 @@ export interface DrilldownWidgetProps {
1293
1314
  * @category Widget
1294
1315
  */
1295
1316
  initialDimension: Attribute;
1317
+ /**
1318
+ * Initial drilldown selections
1319
+ *
1320
+ * @internal
1321
+ */
1322
+ drilldownSelections?: DrilldownSelection[];
1296
1323
  /**
1297
1324
  * An object that allows users to pass advanced configuration options as a prop for the `DrilldownWidget` component
1298
1325
  *
@@ -1,11 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import { ClientApplication } from '../app/client-application';
3
+ import { TrackingEventDetails } from '@sisense/sdk-tracking';
3
4
  export type SisenseContextPayload = {
4
5
  isInitialized: boolean;
5
6
  app?: ClientApplication;
6
7
  tracking: {
7
8
  enabled: boolean;
8
9
  packageName: string;
10
+ onTrackingEvent?: (payload: TrackingEventDetails) => void;
9
11
  };
10
12
  };
11
13
  export declare const SisenseContext: import("react").Context<SisenseContextPayload>;
@@ -1,4 +1,6 @@
1
1
  import { CompleteThemeSettings } from '../types';
2
+ export declare const DEFAULT_DIVIDER_COLOR = "#F2F2F2";
3
+ export declare const DEFAULT_DIVIDER_WIDTH = 4;
2
4
  /**
3
5
  * Returns default theme settings, which can be used as base for custom theme options.
4
6
  *
package/dist/types.d.ts CHANGED
@@ -634,6 +634,25 @@ export interface ChartThemeSettings {
634
634
  backgroundColor?: string;
635
635
  /** Toolbar Background color, can be used as a secondary background color */
636
636
  panelBackgroundColor?: string;
637
+ /** Animation options */
638
+ animation?: {
639
+ /** Chart initialization animation options */
640
+ init?: {
641
+ /**
642
+ * Animation duration in milliseconds.
643
+ * If not specified, the default value, `auto`, will be used with a different default value applied per chart type.
644
+ */
645
+ duration?: number | 'auto';
646
+ };
647
+ /** Chart redraw animation options */
648
+ redraw?: {
649
+ /**
650
+ * Animation duration in milliseconds.
651
+ * If not specified, the default value, `auto`, will be used with a different default value applied per chart type.
652
+ */
653
+ duration?: number | 'auto';
654
+ };
655
+ };
637
656
  }
638
657
  /**
639
658
  * Theme settings specific to the AI Chatbot component
@@ -863,6 +882,19 @@ export type WidgetThemeSettings = {
863
882
  backgroundColor?: string;
864
883
  };
865
884
  };
885
+ /**
886
+ * Dashboard theme settings
887
+ *
888
+ * @internal
889
+ */
890
+ export type DashboardThemeSettings = {
891
+ /** Background color */
892
+ backgroundColor?: string;
893
+ /** Width of the divider line between widgets */
894
+ dividerLineWidth?: number;
895
+ /** Divider line color */
896
+ dividerLineColor?: string;
897
+ };
866
898
  /** Theme settings defining the look and feel of components. */
867
899
  export interface ThemeSettings {
868
900
  /** Chart theme settings */
@@ -875,6 +907,12 @@ export interface ThemeSettings {
875
907
  general?: GeneralThemeSettings;
876
908
  /** Widget theme settings */
877
909
  widget?: WidgetThemeSettings;
910
+ /**
911
+ * Dashboard theme settings
912
+ *
913
+ * @internal
914
+ */
915
+ dashboard?: DashboardThemeSettings;
878
916
  /**
879
917
  * Theme settings specific to the AI Chatbot component
880
918
  */