@sisense/sdk-ui 0.13.0 → 0.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 (44) hide show
  1. package/dist/api/types/dashboard-dto.d.ts +11 -4
  2. package/dist/chart-data-options/types.d.ts +11 -5
  3. package/dist/chart-options-processor/translations/axis-section.d.ts +1 -0
  4. package/dist/chart-options-processor/translations/scatter-series.d.ts +1 -0
  5. package/dist/chart-options-processor/translations/sunburst/sunburst-series.d.ts +2 -1
  6. package/dist/chart-options-processor/translations/translations-to-highcharts.d.ts +3 -2
  7. package/dist/dashboard-widget/translate-dashboard-filters.d.ts +13 -0
  8. package/dist/dashboard-widget/translate-panel-color-format.d.ts +3 -2
  9. package/dist/dashboard-widget/translate-widget-filters.d.ts +31 -0
  10. package/dist/dashboard-widget/types.d.ts +17 -2
  11. package/dist/dashboard-widget/use-fetch-widget-dto-model.d.ts +48 -0
  12. package/dist/dashboard-widget/utils.d.ts +1 -1
  13. package/dist/decorators/{with-tracking → component-decorators/with-tracking}/error-tracker.d.ts +1 -1
  14. package/dist/decorators/hook-decorators/index.d.ts +1 -0
  15. package/dist/decorators/hook-decorators/with-tracking.d.ts +2 -0
  16. package/dist/filters/components/common/basic-input.d.ts +8 -0
  17. package/dist/filters/components/common/index.d.ts +1 -0
  18. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +1 -1
  19. package/dist/filters/components/filter-tile.d.ts +2 -2
  20. package/dist/filters/components/member-filter-tile/member-filter-tile.d.ts +1 -1
  21. package/dist/funnel-chart.d.ts +1 -1
  22. package/dist/highcharts-memorized.d.ts +6 -0
  23. package/dist/index.js +20253 -19999
  24. package/dist/indicator-chart.d.ts +1 -1
  25. package/dist/models/dashboard/use-get-dashboard-model.d.ts +5 -0
  26. package/dist/models/dashboard/use-get-dashboard-models.d.ts +6 -1
  27. package/dist/pie-chart.d.ts +1 -1
  28. package/dist/props.d.ts +36 -8
  29. package/dist/query-execution/use-execute-query-by-widget-id.d.ts +18 -5
  30. package/dist/query-execution/use-execute-query.d.ts +10 -6
  31. package/dist/scatter-chart.d.ts +1 -1
  32. package/dist/treemap-chart.d.ts +1 -2
  33. package/dist/types.d.ts +7 -3
  34. package/dist/widgets/chart-widget.d.ts +2 -2
  35. package/dist/widgets/common/drilldown.d.ts +1 -1
  36. package/dist/widgets/table-widget.d.ts +1 -2
  37. package/package.json +7 -6
  38. /package/dist/decorators/{as-sisense-component.d.ts → component-decorators/as-sisense-component.d.ts} +0 -0
  39. /package/dist/decorators/{with-default-translations.d.ts → component-decorators/with-default-translations.d.ts} +0 -0
  40. /package/dist/decorators/{with-error-boundary.d.ts → component-decorators/with-error-boundary.d.ts} +0 -0
  41. /package/dist/decorators/{with-sisense-context-validation.d.ts → component-decorators/with-sisense-context-validation.d.ts} +0 -0
  42. /package/dist/decorators/{with-tracking → component-decorators/with-tracking}/index.d.ts +0 -0
  43. /package/dist/decorators/{with-tracking → component-decorators/with-tracking}/use-track-component-init.d.ts +0 -0
  44. /package/dist/decorators/{with-tracking → component-decorators/with-tracking}/with-tracking.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { IndicatorChartProps } from './props';
3
3
  /**
4
- * A React component that displays a single value.
4
+ * A React component that provides various options for displaying one or two numeric values as a number, gauge or ticker.
5
5
  * See [Indicator](https://docs.sisense.com/main/SisenseLinux/indicator.htm) for more information.
6
6
  *
7
7
  * @example
@@ -97,3 +97,8 @@ export type DashboardModelSuccessState = {
97
97
  * @returns Dashboard load state that contains the status of the execution, the result dashboard model, or the error if any
98
98
  */
99
99
  export declare const useGetDashboardModel: (params: GetDashboardModelParams) => DashboardModelState;
100
+ /**
101
+ * {@link useGetDashboardModel} without tracking to be used inside other hooks or components in Compose SDK.
102
+ * @internal
103
+ */
104
+ export declare function useGetDashboardModelInternal(params: GetDashboardModelParams): DashboardModelState;
@@ -81,4 +81,9 @@ export type DashboardModelsSuccessState = {
81
81
  * @param params - Parameters of the dashboards to be retrieved
82
82
  * @returns Load state that contains the status of the execution, the result dashboards, or the error if any
83
83
  */
84
- export declare const useGetDashboardModels: (params?: GetDashboardModelsParams) => DashboardModelsState;
84
+ export declare const useGetDashboardModels: (params?: GetDashboardModelsParams | undefined) => DashboardModelsState;
85
+ /**
86
+ * {@link useGetDashboardModels} without tracking to be used inside other hooks or components in Compose SDK.
87
+ * @internal
88
+ */
89
+ export declare function useGetDashboardModelsInternal(params?: GetDashboardModelsParams): DashboardModelsState;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { PieChartProps } from './props';
3
3
  /**
4
- * A React component representing data in circular graph with the data shown as slices of a whole,
4
+ * A React component representing data in a circular graph with the data shown as slices of a whole,
5
5
  * with each slice representing a proportion of the total.
6
6
  * See [Pie Chart](https://docs.sisense.com/main/SisenseLinux/pie-chart.htm) for more information.
7
7
  *
package/dist/props.d.ts CHANGED
@@ -73,7 +73,7 @@ export interface ExecuteQueryProps {
73
73
  /**
74
74
  * Data source the query is run against - e.g. `Sample ECommerce`
75
75
  *
76
- * If not specified, the query will use the `defaultDataSource` specified in the parent {@link SisenseContextProvider} component.
76
+ * If not specified, the query will use the `defaultDataSource` specified in the parent Sisense Context.
77
77
  */
78
78
  dataSource?: DataSource;
79
79
  /** Dimensions of the query */
@@ -102,6 +102,14 @@ export interface ExecuteQueryProps {
102
102
  onDataChanged?: (data: QueryResultData) => void;
103
103
  /**
104
104
  * Sync or async callback that allows to modify the JAQL payload before it is sent to the server.
105
+ *
106
+ * **Note:** wrap this function in `useCallback` hook to avoid triggering query execution on each render.
107
+ * ```tsx
108
+ * const onBeforeQuery = useCallback((jaql) => {
109
+ * // modify jaql here
110
+ * return jaql;
111
+ * }, []);
112
+ * ```
105
113
  */
106
114
  onBeforeQuery?: (jaql: any) => any | Promise<any>;
107
115
  }
@@ -165,7 +173,7 @@ interface BaseChartEventProps {
165
173
  * Before render handler callback that allows adjusting
166
174
  * detail chart options prior to render
167
175
  *
168
- * This callback is not yet supported for {@link IndicatorChart}
176
+ * This callback is not yet supported for Indicator Chart
169
177
  *
170
178
  * @category Callbacks
171
179
  */
@@ -221,7 +229,7 @@ export interface BaseChartProps {
221
229
  * Data set for this component, which supports two options:
222
230
  *
223
231
  * (1) Data source name (as a `string`) - e.g. `Sample ECommerce`. Under the hood,
224
- * the chart will have an internal {@link ExecuteQuery} connect to the data source
232
+ * the chart will have an internal query connect to the data source
225
233
  * and load the data as specified in {@link dataOptions}, {@link filters}, and {@link highlights}.
226
234
  *
227
235
  * OR
@@ -233,7 +241,7 @@ export interface BaseChartProps {
233
241
  * with user-provided data.
234
242
  *
235
243
  * If neither option is specified,
236
- * the chart will use the `defaultDataSource` specified in the parent {@link SisenseContextProvider} component.
244
+ * the chart will use the `defaultDataSource` specified in the parent Sisense Context.
237
245
  *
238
246
  *
239
247
  * @category Data
@@ -493,6 +501,12 @@ export interface DashboardWidgetProps extends Omit<ChartWidgetProps, 'dataSource
493
501
  * @category Data
494
502
  */
495
503
  filtersMergeStrategy?: FiltersMergeStrategy;
504
+ /**
505
+ * {@inheritDoc ExecuteQueryByWidgetIdProps.includeDashboardFilters}
506
+ *
507
+ * @category Data
508
+ */
509
+ includeDashboardFilters?: boolean;
496
510
  /**
497
511
  * Title of the widget
498
512
  *
@@ -555,7 +569,7 @@ export interface ChartWidgetProps extends BaseChartEventProps {
555
569
  /**
556
570
  * Data source the query is run against - e.g. `Sample ECommerce`
557
571
  *
558
- * If not specified, the query will use the `defaultDataSource` specified in the parent {@link SisenseContextProvider} component.
572
+ * If not specified, the query will use the `defaultDataSource` specified in the parent Sisense Context.
559
573
  *
560
574
  * @category Data
561
575
  */
@@ -646,7 +660,7 @@ export interface ChartWidgetProps extends BaseChartEventProps {
646
660
  /**
647
661
  * Boolean flag whether selecting data points triggers highlight filter of the selected data
648
662
  *
649
- * Recommended to turn on when the ChartWidget is enhanced with data drilldown by {@link DrilldownWidget}
663
+ * Recommended to turn on when the Chart Widget component is enhanced with data drilldown by the Drilldown Widget component
650
664
  *
651
665
  * If not specified, the default value is `false`
652
666
  *
@@ -663,7 +677,7 @@ export interface TableWidgetProps {
663
677
  /**
664
678
  * Data source the query is run against - e.g. `Sample ECommerce`
665
679
  *
666
- * If not specified, the query will use the `defaultDataSource` specified in the parent {@link SisenseContextProvider} component.
680
+ * If not specified, the query will use the `defaultDataSource` specified in the parent Sisense Context.
667
681
  *
668
682
  * @category Data
669
683
  */
@@ -738,7 +752,7 @@ export interface ExecuteQueryByWidgetIdProps {
738
752
  /** {@inheritDoc ExecuteQueryProps.offset} */
739
753
  offset?: number;
740
754
  /**
741
- * Strategy for merging the existing widget filters with the filters provided via the `filters` prop:
755
+ * Strategy for merging the existing widget filters (including highlights) with the filters provided via the `filters` and `highlights` props:
742
756
  *
743
757
  * - `widgetFirst` - prioritizes the widget filters over the provided filters in case of filter conflicts by certain attributes.
744
758
  * - `codeFirst` - prioritizes the provided filters over the widget filters in case of filter conflicts by certain attributes.
@@ -747,12 +761,26 @@ export interface ExecuteQueryByWidgetIdProps {
747
761
  * If not specified, the default strategy is `codeFirst`.
748
762
  */
749
763
  filtersMergeStrategy?: FiltersMergeStrategy;
764
+ /**
765
+ * Boolean flag whether to include dashboard filters in the widget's `filters` and `highlights`
766
+ *
767
+ * If not specified, the default value is `false`.
768
+ */
769
+ includeDashboardFilters?: boolean;
750
770
  /** Function as child component that is called to render the query results */
751
771
  children?: (queryResult: QueryResultData, queryParams: ExecuteQueryParams) => ReactNode;
752
772
  /** Callback function that is evaluated when query results are ready */
753
773
  onDataChanged?: (data: QueryResultData, queryParams: ExecuteQueryParams) => void;
754
774
  /**
755
775
  * Sync or async callback that allows to modify the JAQL payload before it is sent to the server.
776
+ *
777
+ * **Note:** wrap this function in `useCallback` hook to avoid triggering query execution on each render.
778
+ * ```tsx
779
+ * const onBeforeQuery = useCallback((jaql) => {
780
+ * // modify jaql here
781
+ * return jaql;
782
+ * }, []);
783
+ * ```
756
784
  */
757
785
  onBeforeQuery?: (jaql: any) => any | Promise<any>;
758
786
  }
@@ -1,8 +1,8 @@
1
1
  import { type Filter } from '@sisense/sdk-data';
2
- import { ExecuteQueryParams } from './index.js';
3
- import { QueryState } from './query-state-reducer.js';
4
- import { FiltersMergeStrategy } from '../dashboard-widget/types.js';
5
- import { ClientApplication } from '../app/client-application.js';
2
+ import { ExecuteQueryParams } from './';
3
+ import { QueryState } from './query-state-reducer';
4
+ import { FiltersMergeStrategy } from '../dashboard-widget/types';
5
+ import { ClientApplication } from '../app/client-application';
6
6
  /**
7
7
  * Parameters for {@link useExecuteQueryByWidgetId} hook.
8
8
  */
@@ -21,8 +21,16 @@ export interface ExecuteQueryByWidgetIdParams {
21
21
  offset?: number;
22
22
  /** {@inheritDoc ExecuteQueryByWidgetIdProps.filtersMergeStrategy} */
23
23
  filtersMergeStrategy?: FiltersMergeStrategy;
24
+ /** {@inheritDoc ExecuteQueryByWidgetIdProps.includeDashboardFilters} */
25
+ includeDashboardFilters?: boolean;
24
26
  /** {@inheritDoc ExecuteQueryByWidgetIdProps.onBeforeQuery} */
25
27
  onBeforeQuery?: (jaql: any) => any | Promise<any>;
28
+ /**
29
+ * Boolean flag to control if query is executed
30
+ *
31
+ * If not specified, the default value is `true`
32
+ */
33
+ enabled?: boolean;
26
34
  }
27
35
  export type QueryByWidgetIdState = QueryState & {
28
36
  /** Query parameters constructed over the widget */
@@ -57,6 +65,11 @@ export type QueryByWidgetIdState = QueryState & {
57
65
  * @returns Query state that contains the status of the query execution, the result data, the constructed query parameters, or the error if any occurred
58
66
  */
59
67
  export declare const useExecuteQueryByWidgetId: (params: ExecuteQueryByWidgetIdParams) => QueryByWidgetIdState;
68
+ /**
69
+ * {@link useExecuteQueryByWidgetId} without tracking to be used inside other hooks or components in Compose SDK.
70
+ * @internal
71
+ */
72
+ export declare function useExecuteQueryByWidgetIdInternal(params: ExecuteQueryByWidgetIdParams): QueryByWidgetIdState;
60
73
  /**
61
74
  * Checks if the parameters have changed by deep comparison.
62
75
  *
@@ -65,7 +78,7 @@ export declare const useExecuteQueryByWidgetId: (params: ExecuteQueryByWidgetIdP
65
78
  */
66
79
  export declare function isParamsChanged(prevParams: ExecuteQueryByWidgetIdParams | undefined, newParams: ExecuteQueryByWidgetIdParams): boolean;
67
80
  /** @internal */
68
- export declare function executeQueryByWidgetId({ widgetOid, dashboardOid, filters, highlights, filtersMergeStrategy, count, offset, app, onBeforeQuery, }: ExecuteQueryByWidgetIdParams & {
81
+ export declare function executeQueryByWidgetId({ widgetOid, dashboardOid, filters, highlights, filtersMergeStrategy, count, offset, includeDashboardFilters, app, onBeforeQuery, }: ExecuteQueryByWidgetIdParams & {
69
82
  app: ClientApplication;
70
83
  }): Promise<{
71
84
  data: import("@sisense/sdk-data").QueryResultData;
@@ -3,11 +3,11 @@ import { QueryState } from './query-state-reducer';
3
3
  /**
4
4
  * Parameters for {@link useExecuteQuery} hook.
5
5
  */
6
- export type ExecuteQueryParams = {
6
+ export interface ExecuteQueryParams {
7
7
  /**
8
8
  * Data source the query is run against - e.g. `Sample ECommerce`
9
9
  *
10
- * If not specified, the query will use the `defaultDataSource` specified in the parent {@link SisenseContextProvider} component.
10
+ * If not specified, the query will use the `defaultDataSource` specified in the parent Sisense Context.
11
11
  */
12
12
  dataSource?: DataSource;
13
13
  /** Dimensions of the query */
@@ -28,11 +28,9 @@ export type ExecuteQueryParams = {
28
28
  * If not specified, the default value is `true`
29
29
  */
30
30
  enabled?: boolean;
31
- /**
32
- * Sync or async callback that allows to modify the JAQL payload before it is sent to the server.
33
- */
31
+ /** {@inheritDoc ExecuteQueryProps.onBeforeQuery} */
34
32
  onBeforeQuery?: (jaql: any) => any | Promise<any>;
35
- };
33
+ }
36
34
  /**
37
35
  * React hook that executes a data query.
38
36
  * This approach, which offers an alternative to {@link ExecuteQuery} component, is similar to React Query's `useQuery` hook.
@@ -65,3 +63,9 @@ export type ExecuteQueryParams = {
65
63
  * @returns Query state that contains the status of the query execution, the result data, or the error if any occurred
66
64
  */
67
65
  export declare const useExecuteQuery: (params: ExecuteQueryParams) => QueryState;
66
+ /**
67
+ * {@link useExecuteQuery} without tracking to be used inside other hooks or components in Compose SDK.
68
+ *
69
+ * @internal
70
+ */
71
+ export declare function useExecuteQueryInternal(params: ExecuteQueryParams): QueryState;
@@ -7,7 +7,7 @@ import { ScatterChartProps } from './props';
7
7
  * **Point**: A field that for each of its members a scatter point is drawn. The maximum amount of data points is 500.
8
8
  *
9
9
  * **Size**: An optional field represented by the size of the circles.
10
- * If omitted, all scatter points are equal in size. If used, the circle size is relative to their value.
10
+ * If omitted, all scatter points are equal in size. If used, the circle sizes are relative to their values.
11
11
  *
12
12
  * See [Scatter Chart](https://docs.sisense.com/main/SisenseLinux/scatter-chart.htm) for more information.
13
13
  *
@@ -2,8 +2,7 @@
2
2
  import { TreemapChartProps } from './props';
3
3
  /**
4
4
  * A React component displaying hierarchical data in the form of nested rectangles.
5
- * This type of chart can be used in different scenarios, for example,
6
- * instead of a column chart if you have to compare too many categories and sub-categories.
5
+ * This type of chart can be used instead of a column chart for comparing a large number of categories and sub-categories.
7
6
  * See [Treemap Chart](https://docs.sisense.com/main/SisenseLinux/treemap.htm) for more information.
8
7
  *
9
8
  * @example
package/dist/types.d.ts CHANGED
@@ -377,9 +377,13 @@ export interface SunburstStyleOptions extends BaseStyleOptions {
377
377
  */
378
378
  export type StyleOptions = LineStyleOptions | AreaStyleOptions | StackableStyleOptions | PieStyleOptions | FunnelStyleOptions | PolarStyleOptions | IndicatorStyleOptions | ScatterStyleOptions | TreemapStyleOptions | SunburstStyleOptions;
379
379
  /** Mapping of each of the chart value series to colors. */
380
- export type ValueToColorMap = Record<string, string>;
381
- /** Mapping of each of the chart value series to colors. */
382
- export type ValueToColorMultiColumnsMap = Record<string, Record<string, string>>;
380
+ export type ValueToColorMap = {
381
+ [value: string]: string;
382
+ };
383
+ /** Mapping of each of the chart columns with mapping of each value series to colors. */
384
+ export type MultiColumnValueToColorMap = {
385
+ [columnName: string]: ValueToColorMap;
386
+ };
383
387
  /**
384
388
  * Chart type of one of the supported chart families
385
389
  */
@@ -1,8 +1,8 @@
1
1
  import { type FunctionComponent } from 'react';
2
2
  import { ChartWidgetProps } from '../props';
3
3
  /**
4
- * The Chart Widget component extending the {@link Chart} component to support advanced BI
5
- * capabilities such as drilldown.
4
+ * The Chart Widget component extending the {@link Chart} component to support widget style options.
5
+ * It can be used along with the {@link DrilldownWidget} component to support advanced data drilldown.
6
6
  *
7
7
  * @example
8
8
  * Example of using the `ChartWidget` component to
@@ -22,7 +22,7 @@ export declare const useDrilldown: (dataOptions: ChartDataOptions, drilldownOpti
22
22
  } | {
23
23
  category: (import("@sisense/sdk-data").Column | import("../../types").StyledColumn)[];
24
24
  value: (import("@sisense/sdk-data").MeasureColumn | import("@sisense/sdk-data").CalculatedMeasureColumn | import("../../types").StyledMeasureColumn)[];
25
- seriesToColorMap?: import("../../types").ValueToColorMap | undefined;
25
+ seriesToColorMap?: import("../../types").ValueToColorMap | import("../../types").MultiColumnValueToColorMap | undefined;
26
26
  };
27
27
  selectDrilldown: (points: DataPoint[], nextDimension: Attribute) => void;
28
28
  sliceDrilldownSelections: (i: number) => void;
@@ -1,8 +1,7 @@
1
1
  import { type FunctionComponent } from 'react';
2
2
  import { TableWidgetProps } from '../props';
3
3
  /**
4
- * The TableWidget component extending the {@link Table} component to support advanced BI
5
- * capabilities such as header.
4
+ * The TableWidget component extending the {@link Table} component to support widget style options.
6
5
  *
7
6
  * @example
8
7
  * Example of using the `Widget` component to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sisense/sdk-ui",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "exports": "./dist/index.js",
6
6
  "main": "./dist/index.js",
@@ -12,10 +12,11 @@
12
12
  "@emotion/react": "^11.10.5",
13
13
  "@emotion/styled": "^11.10.5",
14
14
  "@mui/material": "^5.11.6",
15
- "@sisense/sdk-common": "^0.13.0",
16
- "@sisense/sdk-data": "^0.13.0",
17
- "@sisense/sdk-query-client": "^0.13.0",
18
- "@sisense/sdk-rest-client": "^0.13.0",
15
+ "@sisense/sdk-common": "^0.14.0",
16
+ "@sisense/sdk-data": "^0.14.0",
17
+ "@sisense/sdk-query-client": "^0.14.0",
18
+ "@sisense/sdk-rest-client": "^0.14.0",
19
+ "@sisense/sdk-tracking": "^0.14.0",
19
20
  "@sisense/sisense-charts": "5.1.0-alpha-04052758.0",
20
21
  "classnames": "^2.3.2",
21
22
  "colorjs.io": "^0.4.3",
@@ -31,6 +32,7 @@
31
32
  "react-datepicker": "^4.16.0",
32
33
  "react-i18next": "^13.2.2",
33
34
  "react-number-format": "^5.1.0",
35
+ "react-query": "^3.39.3",
34
36
  "ts-deepmerge": "6.0.2",
35
37
  "ts-essentials": "^9.3.0",
36
38
  "whatwg-fetch": "^3.6.2"
@@ -60,7 +62,6 @@
60
62
  "@babel/preset-env": "^7.20.2",
61
63
  "@mui/icons-material": "^5.14.9",
62
64
  "@mui/x-data-grid": "^6.16.0",
63
- "@mui/x-data-grid-generator": "^6.16.0",
64
65
  "@mui/x-data-grid-pro": "^6.16.0",
65
66
  "@storybook/addon-actions": "7.0.24",
66
67
  "@storybook/addon-docs": "7.0.24",