@sisense/sdk-ui 0.15.0 → 1.0.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 (146) hide show
  1. package/dist/ai/messages/get-widget-options.d.ts +3 -3
  2. package/dist/ai.js +334 -308
  3. package/dist/api/types/dashboard-dto.d.ts +3 -2
  4. package/dist/area-chart.d.ts +2 -2
  5. package/dist/bar-chart.d.ts +2 -2
  6. package/dist/boxplot-chart.d.ts +38 -0
  7. package/dist/boxplot-utils.d.ts +30 -0
  8. package/dist/chart-data/boxplot-data.d.ts +11 -0
  9. package/dist/chart-data/cartesian-data.d.ts +6 -3
  10. package/dist/chart-data/data-coloring/create-data-coloring-function.d.ts +7 -0
  11. package/dist/chart-data/data-coloring/index.d.ts +3 -0
  12. package/dist/chart-data/{series-data-color-service → data-coloring}/legend-color.d.ts +1 -1
  13. package/dist/chart-data/data-coloring/series-data-coloring-function.d.ts +11 -0
  14. package/dist/chart-data/indicator-data.d.ts +2 -2
  15. package/dist/chart-data/scatter-data.d.ts +2 -2
  16. package/dist/chart-data/scattermap-data.d.ts +4 -0
  17. package/dist/chart-data/types.d.ts +46 -1
  18. package/dist/chart-data-options/coloring/consts.d.ts +3 -0
  19. package/dist/chart-data-options/coloring/utils.d.ts +6 -0
  20. package/dist/chart-data-options/get-translated-data-options.d.ts +6 -0
  21. package/dist/chart-data-options/translate-boxplot-data-options.d.ts +7 -0
  22. package/dist/chart-data-options/translate-scattermap-data-options.d.ts +3 -0
  23. package/dist/chart-data-options/types.d.ts +122 -10
  24. package/dist/chart-data-options/utils.d.ts +6 -1
  25. package/dist/chart-options-processor/boxplot-chart-options.d.ts +10 -0
  26. package/dist/chart-options-processor/chart-options-service.d.ts +21 -77
  27. package/dist/chart-options-processor/style-to-design-options-translator/translate-style-to-design-options.d.ts +2 -2
  28. package/dist/chart-options-processor/style-to-design-options-translator/translate-to-highcharts-options.d.ts +4 -2
  29. package/dist/chart-options-processor/subtype-to-design-options.d.ts +5 -2
  30. package/dist/chart-options-processor/theme-option-service.d.ts +0 -1
  31. package/dist/chart-options-processor/translations/axis-section.d.ts +4 -3
  32. package/dist/chart-options-processor/translations/boxplot/boxplot-axis.d.ts +10 -0
  33. package/dist/chart-options-processor/translations/boxplot/boxplot-plot-options.d.ts +3 -0
  34. package/dist/chart-options-processor/translations/boxplot/boxplot-series.d.ts +5 -0
  35. package/dist/chart-options-processor/translations/boxplot/boxplot-tooltip.d.ts +3 -0
  36. package/dist/chart-options-processor/translations/design-options.d.ts +9 -2
  37. package/dist/chart-options-processor/translations/funnel-series.d.ts +1 -2
  38. package/dist/chart-options-processor/translations/legend-section.d.ts +6 -4
  39. package/dist/chart-options-processor/translations/pie-series.d.ts +1 -2
  40. package/dist/chart-options-processor/translations/tooltip-utils.d.ts +5 -0
  41. package/dist/chart-options-processor/translations/translations-to-highcharts.d.ts +11 -3
  42. package/dist/chart-options-processor/translations/types.d.ts +10 -2
  43. package/dist/chart-options-processor/translations/value-label-section.d.ts +2 -1
  44. package/dist/chart.d.ts +2 -2
  45. package/dist/charts/indicator/indicator-legacy-chart-data-options.d.ts +2 -2
  46. package/dist/charts/indicator/indicator-legacy-chart-options/indicator-legacy-chart-options.d.ts +2 -2
  47. package/dist/charts/indicator/indicator-legacy-chart-options/override-with-value-color.d.ts +2 -2
  48. package/dist/charts/scattermap/hooks/use-locations.d.ts +3 -0
  49. package/dist/charts/scattermap/hooks/use-settings.d.ts +5 -0
  50. package/dist/charts/scattermap/hooks/use-tooltip-handler.d.ts +14 -0
  51. package/dist/charts/scattermap/scattermap.d.ts +13 -0
  52. package/dist/charts/scattermap/types.d.ts +16 -0
  53. package/dist/charts/scattermap/utils/color.d.ts +3 -0
  54. package/dist/charts/scattermap/utils/copyright.d.ts +2 -0
  55. package/dist/charts/scattermap/utils/location.d.ts +5 -0
  56. package/dist/charts/scattermap/utils/map.d.ts +2 -0
  57. package/dist/charts/scattermap/utils/markers.d.ts +28 -0
  58. package/dist/charts/scattermap/utils/size.d.ts +2 -0
  59. package/dist/charts/scattermap/utils/tooltip.d.ts +8 -0
  60. package/dist/charts/scattermap/utils/values.d.ts +4 -0
  61. package/dist/charts/table/types.d.ts +1 -1
  62. package/dist/column-chart.d.ts +2 -2
  63. package/dist/common/components/loading-dots.d.ts +4 -0
  64. package/dist/dashboard-widget/translate-dashboard-filters.d.ts +1 -1
  65. package/dist/dashboard-widget/translate-panel-color-format.d.ts +3 -3
  66. package/dist/dashboard-widget/translate-widget-data-options.d.ts +6 -5
  67. package/dist/dashboard-widget/translate-widget-style-options.d.ts +2 -2
  68. package/dist/dashboard-widget/types.d.ts +45 -19
  69. package/dist/dashboard-widget/use-fetch-widget-dto-model.d.ts +9 -5
  70. package/dist/dashboard-widget/utils.d.ts +1 -1
  71. package/dist/decorators/component-decorators/as-sisense-component.d.ts +1 -0
  72. package/dist/filters/components/common/basic-input.d.ts +1 -1
  73. package/dist/filters/components/common/date-range-field-button.d.ts +3 -2
  74. package/dist/filters/components/common/dropdown.d.ts +9 -0
  75. package/dist/filters/components/common/filter-utils.d.ts +13 -0
  76. package/dist/filters/components/common/index.d.ts +3 -1
  77. package/dist/filters/components/common/radio.d.ts +7 -0
  78. package/dist/filters/components/criteria-filter-tile/criteria-filter-display.d.ts +2 -2
  79. package/dist/filters/components/criteria-filter-tile/criteria-filter-menu.d.ts +6 -3
  80. package/dist/filters/components/criteria-filter-tile/criteria-filter-operations.d.ts +13 -8
  81. package/dist/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +21 -4
  82. package/dist/filters/components/criteria-filter-tile/index.d.ts +0 -1
  83. package/dist/filters/components/date-filter/date-filter/calendar-date-selector.d.ts +10 -8
  84. package/dist/filters/components/date-filter/date-filter/quick-date-selection-buttons.d.ts +4 -4
  85. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +1 -1
  86. package/dist/filters/components/date-filter/index.d.ts +1 -0
  87. package/dist/filters/components/date-filter/relative-date-filter-tile/index.d.ts +1 -0
  88. package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-display.d.ts +14 -0
  89. package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +36 -0
  90. package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +26 -0
  91. package/dist/filters/components/filter-tile.d.ts +1 -1
  92. package/dist/filters/components/member-filter-tile/basic-member-filter-tile.d.ts +2 -0
  93. package/dist/filters/components/member-filter-tile/members-reducer.d.ts +9 -1
  94. package/dist/filters/components/member-filter-tile/pill-section.d.ts +0 -1
  95. package/dist/filters/index.d.ts +1 -0
  96. package/dist/highcharts-memorized.d.ts +4 -3
  97. package/dist/index.d.ts +5 -2
  98. package/dist/index.js +5585 -4933
  99. package/dist/indicator-canvas.d.ts +3 -3
  100. package/dist/indicator-chart.d.ts +4 -4
  101. package/dist/line-chart.d.ts +2 -2
  102. package/dist/models/dashboard/types.d.ts +1 -1
  103. package/dist/models/dashboard/use-get-dashboard-model.d.ts +1 -0
  104. package/dist/models/dashboard/use-get-dashboard-models.d.ts +2 -1
  105. package/dist/models/widget/get-widget-model.d.ts +4 -0
  106. package/dist/models/widget/index.d.ts +3 -1
  107. package/dist/models/widget/translate-widget.d.ts +1 -1
  108. package/dist/models/widget/use-get-widget-model.d.ts +103 -0
  109. package/dist/models/widget/widget-model.d.ts +123 -0
  110. package/dist/pie-chart.d.ts +2 -2
  111. package/dist/polar-chart.d.ts +2 -2
  112. package/dist/props.d.ts +67 -62
  113. package/dist/query/execute-query.d.ts +3 -1
  114. package/dist/query-execution/csv-query-state-reducer.d.ts +2 -0
  115. package/dist/query-execution/execute-query-by-widget-id.d.ts +10 -2
  116. package/dist/query-execution/execute-query.d.ts +11 -4
  117. package/dist/query-execution/index.d.ts +4 -3
  118. package/dist/query-execution/query-state-reducer.d.ts +1 -58
  119. package/dist/query-execution/types.d.ts +192 -0
  120. package/dist/query-execution/use-execute-csv-query.d.ts +80 -0
  121. package/dist/query-execution/use-execute-query-by-widget-id.d.ts +6 -37
  122. package/dist/query-execution/use-execute-query.d.ts +10 -35
  123. package/dist/scatter-chart.d.ts +4 -4
  124. package/dist/scattermap-chart.d.ts +36 -0
  125. package/dist/sunburst-chart.d.ts +1 -1
  126. package/dist/table/hooks/use-table-data.d.ts +7 -2
  127. package/dist/table/table.d.ts +5 -2
  128. package/dist/table-widget-7936746a.js +72481 -0
  129. package/dist/themes/theme-loader.d.ts +0 -1
  130. package/dist/translation/resources/en.d.ts +21 -0
  131. package/dist/translation/resources/index.d.ts +42 -0
  132. package/dist/treemap-chart.d.ts +2 -2
  133. package/dist/types.d.ts +76 -7
  134. package/dist/utils/utility-types.d.ts +4 -0
  135. package/dist/widgets/chart-widget-deprecated.d.ts +1 -1
  136. package/dist/widgets/chart-widget.d.ts +1 -1
  137. package/dist/widgets/common/drilldown-breadcrumbs/drilldown-breadcrumbs-navigation.d.ts +8 -0
  138. package/dist/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +11 -0
  139. package/dist/widgets/common/drilldown.d.ts +12 -2
  140. package/dist/widgets/drilldown-widget.d.ts +2 -2
  141. package/package.json +28 -6
  142. package/dist/chart-data/series-data-color-service/index.d.ts +0 -3
  143. package/dist/chart-data/series-data-color-service/series-data-color-service.d.ts +0 -4
  144. package/dist/models/widget/types.d.ts +0 -6
  145. package/dist/table-widget-7b20ecf7.js +0 -64167
  146. /package/dist/chart-data/{series-data-color-service → data-coloring}/types.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { ChartDataOptionsInternal, IndicatorDataOptionsInternal } from './chart-data-options/types';
1
+ import { ChartDataOptionsInternal, IndicatorChartDataOptionsInternal } from './chart-data-options/types';
2
2
  import { type FunctionComponent } from 'react';
3
3
  import { IndicatorChartData } from './chart-data/types';
4
4
  import { IndicatorChartDesignOptions } from './chart-options-processor/translations/design-options';
@@ -7,7 +7,7 @@ import { ChartDesignOptions } from './chart-options-processor/translations/types
7
7
  import { ThemeSettings } from './types';
8
8
  interface Props {
9
9
  chartData: IndicatorChartData;
10
- dataOptions: IndicatorDataOptionsInternal;
10
+ dataOptions: IndicatorChartDataOptionsInternal;
11
11
  designOptions: IndicatorChartDesignOptions;
12
12
  themeSettings?: ThemeSettings;
13
13
  }
@@ -16,6 +16,6 @@ interface Props {
16
16
  */
17
17
  export declare const IndicatorCanvas: FunctionComponent<Props>;
18
18
  export declare const isIndicatorChartData: (chartData: ChartData) => chartData is IndicatorChartData;
19
- export declare const isIndicatorDataOptionsInternal: (dataOptions: ChartDataOptionsInternal) => dataOptions is IndicatorDataOptionsInternal;
19
+ export declare const isIndicatorChartDataOptionsInternal: (dataOptions: ChartDataOptionsInternal) => dataOptions is IndicatorChartDataOptionsInternal;
20
20
  export declare const isIndicatorDesignOptions: (designOptions: ChartDesignOptions) => designOptions is IndicatorChartDesignOptions;
21
21
  export {};
@@ -12,7 +12,7 @@ import { IndicatorChartProps } from './props';
12
12
  * dataOptions={{
13
13
  * value: [
14
14
  * {
15
- * column: measures.sum(DM.Commerce.Revenue),
15
+ * column: measureFactory.sum(DM.Commerce.Revenue),
16
16
  * numberFormatConfig: {
17
17
  * name: 'Numbers',
18
18
  * decimalScale: 2,
@@ -27,10 +27,10 @@ import { IndicatorChartProps } from './props';
27
27
  * },
28
28
  * ],
29
29
  * secondary: [],
30
- * min: [measures.constant(0)],
31
- * max: [measures.constant(125000000)],
30
+ * min: [measureFactory.constant(0)],
31
+ * max: [measureFactory.constant(125000000)],
32
32
  * }}
33
- * filters={[filters.greaterThan(DM.Commerce.Revenue, 1000)]}
33
+ * filters={[filterFactory.greaterThan(DM.Commerce.Revenue, 1000)]}
34
34
  * styleOptions={{
35
35
  * indicatorComponents: {
36
36
  * title: {
@@ -11,10 +11,10 @@ import { LineChartProps } from './props';
11
11
  * dataSet={DM.DataSource}
12
12
  * dataOptions={{
13
13
  * category: [DM.Commerce.Date.Years],
14
- * value: [measures.sum(DM.Commerce.Revenue)],
14
+ * value: [measureFactory.sum(DM.Commerce.Revenue)],
15
15
  * breakBy: [DM.Commerce.Gender],
16
16
  * }}
17
- * filters={[filters.greaterThan(DM.Commerce.Revenue, 1000)]}
17
+ * filters={[filterFactory.greaterThan(DM.Commerce.Revenue, 1000)]}
18
18
  * onDataPointClick= {(point, nativeEvent) => {
19
19
  * console.log('clicked', point, nativeEvent);
20
20
  * }}
@@ -1,5 +1,5 @@
1
1
  import { type DataSource } from '@sisense/sdk-data';
2
- import { type WidgetModel } from '../widget/types';
2
+ import { WidgetModel } from '../widget/widget-model';
3
3
  export type DashboardModel = {
4
4
  oid: string;
5
5
  title: string;
@@ -99,6 +99,7 @@ export type DashboardModelSuccessState = {
99
99
  export declare const useGetDashboardModel: (params: GetDashboardModelParams) => DashboardModelState;
100
100
  /**
101
101
  * {@link useGetDashboardModel} without tracking to be used inside other hooks or components in Compose SDK.
102
+ *
102
103
  * @internal
103
104
  */
104
105
  export declare function useGetDashboardModelInternal(params: GetDashboardModelParams): DashboardModelState;
@@ -62,7 +62,7 @@ export type DashboardModelsSuccessState = {
62
62
  status: 'success';
63
63
  };
64
64
  /**
65
- * React hook that retrieves existing dashboards that the user can access to from the Sisense instance.
65
+ * React hook that retrieves existing dashboards that the user can access to from the Sisense instance.
66
66
  *
67
67
  * @example
68
68
  ```tsx
@@ -84,6 +84,7 @@ export type DashboardModelsSuccessState = {
84
84
  export declare const useGetDashboardModels: (params?: GetDashboardModelsParams | undefined) => DashboardModelsState;
85
85
  /**
86
86
  * {@link useGetDashboardModels} without tracking to be used inside other hooks or components in Compose SDK.
87
+ *
87
88
  * @internal
88
89
  */
89
90
  export declare function useGetDashboardModelsInternal(params?: GetDashboardModelsParams): DashboardModelsState;
@@ -0,0 +1,4 @@
1
+ import { HttpClient } from '@sisense/sdk-rest-client';
2
+ import { WidgetModel } from './widget-model';
3
+ /** @internal */
4
+ export declare function getWidgetModel(httpClient: HttpClient, dashboardOid: string, widgetOid: string): Promise<WidgetModel>;
@@ -1,2 +1,4 @@
1
- export * from './types';
2
1
  export * from './translate-widget';
2
+ export * from './widget-model';
3
+ export * from './get-widget-model';
4
+ export * from './use-get-widget-model';
@@ -1,3 +1,3 @@
1
1
  import { WidgetDto } from '../../dashboard-widget/types';
2
- import { WidgetModel } from './types';
2
+ import { WidgetModel } from './widget-model';
3
3
  export declare function translateWidget(widget: WidgetDto): WidgetModel;
@@ -0,0 +1,103 @@
1
+ import { HookEnableParam } from '../../common/hooks/types';
2
+ import { WidgetModel } from './widget-model';
3
+ /**
4
+ * Parameters for {@link useGetWidgetModel} hook.
5
+ */
6
+ export interface GetWidgetModelParams extends HookEnableParam {
7
+ /**
8
+ * Identifier of the dashboard that contains the widget
9
+ */
10
+ dashboardOid: string;
11
+ /**
12
+ * Identifier of the widget to be retrieved
13
+ */
14
+ widgetOid: string;
15
+ }
16
+ /**
17
+ * States of a widget model load.
18
+ */
19
+ export type WidgetModelState = WidgetModelLoadingState | WidgetModelErrorState | WidgetModelSuccessState;
20
+ /**
21
+ * State of a widget model that is loading.
22
+ */
23
+ export type WidgetModelLoadingState = {
24
+ /** Whether the widget model is loading */
25
+ isLoading: true;
26
+ /** Whether the widget model load has failed */
27
+ isError: false;
28
+ /** Whether the widget model load has succeeded */
29
+ isSuccess: false;
30
+ /** Error, if one occurred */
31
+ error: undefined;
32
+ /** Widget model, if the load succeeded */
33
+ widget: WidgetModel | undefined;
34
+ /** Loading status */
35
+ status: 'loading';
36
+ };
37
+ /**
38
+ * State of a widget model load that has failed.
39
+ */
40
+ export type WidgetModelErrorState = {
41
+ /** Whether the widget model is loading */
42
+ isLoading: false;
43
+ /** Whether the widget model load has failed */
44
+ isError: true;
45
+ /** Whether the widget model load has succeeded */
46
+ isSuccess: false;
47
+ /** Error, if one occurred */
48
+ error: Error;
49
+ /** Widget model, if the load succeeded */
50
+ widget: undefined;
51
+ /** Loading status */
52
+ status: 'error';
53
+ };
54
+ /**
55
+ * State of a widget model load that has succeeded.
56
+ */
57
+ export type WidgetModelSuccessState = {
58
+ /** Whether the widget model is loading */
59
+ isLoading: false;
60
+ /** Whether the widget model load has failed */
61
+ isError: false;
62
+ /** Whether the widget model load has succeeded */
63
+ isSuccess: true;
64
+ /** Error, if one occurred */
65
+ error: undefined;
66
+ /** Widget model, if the load succeeded */
67
+ widget: WidgetModel;
68
+ /** Loading status */
69
+ status: 'success';
70
+ };
71
+ /**
72
+ * React hook that retrieves an existing widget model from the Sisense instance.
73
+ *
74
+ * @example
75
+ * An example of retrieving an existing widget model from the Sisense instance:
76
+ ```tsx
77
+ const { widget, isLoading, isError } = useGetWidgetModel({
78
+ dashboardOid: '6448665edac1920034bce7a8',
79
+ widgetOid: '6448665edac1920034bce7a8',
80
+ });
81
+ if (isLoading) {
82
+ return <div>Loading...</div>;
83
+ }
84
+ if (isError) {
85
+ return <div>Error</div>;
86
+ }
87
+ if (widget) {
88
+ return (
89
+ <Chart {...widget.getChartProps()} />
90
+ );
91
+ }
92
+ return null;
93
+ ```
94
+ * @param params - Parameters of the widget to be retrieved
95
+ * @returns Widget load state that contains the status of the execution, the result widget model, or the error if one has occurred
96
+ */
97
+ export declare const useGetWidgetModel: (params: GetWidgetModelParams) => WidgetModelState;
98
+ /**
99
+ * {@link useGetWidgetModel} without tracking to be used inside other hooks or components in Compose SDK.
100
+ *
101
+ * @internal
102
+ */
103
+ export declare function useGetWidgetModelInternal(params: GetWidgetModelParams): WidgetModelState;
@@ -0,0 +1,123 @@
1
+ import { Filter } from '@sisense/sdk-data';
2
+ import { ChartDataOptions, TableDataOptions } from '../../chart-data-options/types';
3
+ import { WidgetDto, WidgetType } from '../../dashboard-widget/types';
4
+ import { ChartProps, ChartWidgetProps, TableProps, TableWidgetProps } from '../../props';
5
+ import { ExecuteQueryParams } from '../../query-execution';
6
+ import { ChartType, DrilldownOptions, ChartStyleOptions, TableStyleOptions } from '../../types';
7
+ /**
8
+ * Widget data options.
9
+ */
10
+ export type WidgetDataOptions = ChartDataOptions | TableDataOptions;
11
+ /**
12
+ * Model of Sisense widget defined in the abstractions of Compose SDK.
13
+ */
14
+ export declare class WidgetModel {
15
+ /**
16
+ * Unique identifier of the widget.
17
+ */
18
+ oid: string;
19
+ /**
20
+ * Widget title.
21
+ */
22
+ title: string;
23
+ /**
24
+ * Widget description.
25
+ */
26
+ description: string;
27
+ /**
28
+ * Full name of the widget data source.
29
+ */
30
+ dataSource: string;
31
+ /**
32
+ * Widget type.
33
+ */
34
+ widgetType: WidgetType;
35
+ /**
36
+ * Widget data options.
37
+ */
38
+ dataOptions: WidgetDataOptions;
39
+ /**
40
+ * Widget style options.
41
+ */
42
+ styleOptions: ChartStyleOptions | TableStyleOptions;
43
+ /**
44
+ * Widget filters.
45
+ */
46
+ filters: Filter[];
47
+ /**
48
+ * Widget highlights.
49
+ */
50
+ highlights: Filter[];
51
+ /**
52
+ * Widget chart type.
53
+ */
54
+ chartType?: ChartType;
55
+ /**
56
+ * Widget drilldown options.
57
+ */
58
+ drilldownOptions: DrilldownOptions;
59
+ /**
60
+ * Creates a new widget model.
61
+ *
62
+ * @param widgetDto - The widget DTO to be converted to a widget model
63
+ * @internal
64
+ */
65
+ constructor(widgetDto: WidgetDto);
66
+ /**
67
+ * Returns the parameters to be used for executing a query for the widget.
68
+ *
69
+ * @example
70
+ * ```tsx
71
+ * const {data, isLoading, isError} = useExecuteQuery(widget.getExecuteQueryParams());
72
+ * ```
73
+ */
74
+ getExecuteQueryParams(): ExecuteQueryParams;
75
+ /**
76
+ * Returns the props to be used for rendering a chart.
77
+
78
+ * @example
79
+ * ```tsx
80
+ * <Chart {...widget.getChartProps()} />
81
+ * ```
82
+ *
83
+ * Note: this method is not supported for tabular widgets.
84
+ * Use {@link getTableProps} instead for getting props for the <Table> component.
85
+ */
86
+ getChartProps(): ChartProps;
87
+ /**
88
+ * Returns the props to be used for rendering a table.
89
+ *
90
+ * @example
91
+ * ```tsx
92
+ * <Table {...widget.getTableProps()} />
93
+ * ```
94
+ *
95
+ * Note: this method is not supported for chart widgets.
96
+ * Use {@link getChartProps} instead for getting props for the <Chart> component.
97
+ */
98
+ getTableProps(): TableProps;
99
+ /**
100
+ * Returns the props to be used for rendering a chart widget.
101
+ *
102
+ * @example
103
+ * ```tsx
104
+ * <ChartWidget {...widget.getChartWidgetProps()} />
105
+ * ```
106
+ *
107
+ * Note: this method is not supported for tabular widgets.
108
+ */
109
+ getChartWidgetProps(): ChartWidgetProps;
110
+ /**
111
+ * Returns the props to be used for rendering a table widget.
112
+ *
113
+ * @example
114
+ * ```tsx
115
+ * <TableWidget {...widget.getTableWidgetProps()} />
116
+ * ```
117
+ *
118
+ * Note: this method is not supported for chart widgets.
119
+ * Use {@link getChartWidgetProps} instead for getting props for the <ChartWidget> component.
120
+ * @internal
121
+ */
122
+ getTableWidgetProps(): TableWidgetProps;
123
+ }
@@ -12,9 +12,9 @@ import { PieChartProps } from './props';
12
12
  * dataSet={DM.DataSource}
13
13
  * dataOptions={{
14
14
  * category: [DM.Commerce.AgeRange],
15
- * value: [measures.sum(DM.Commerce.Revenue)],
15
+ * value: [measureFactory.sum(DM.Commerce.Revenue)],
16
16
  * }}
17
- * filters={[filters.greaterThan(DM.Commerce.Revenue, 1000)]}
17
+ * filters={[filterFactory.greaterThan(DM.Commerce.Revenue, 1000)]}
18
18
  * onDataPointClick= {(point, nativeEvent) => {
19
19
  * console.log('clicked', point, nativeEvent);
20
20
  * }}
@@ -11,10 +11,10 @@ import { PolarChartProps } from './props';
11
11
  * dataSet={DM.DataSource}
12
12
  * dataOptions={{
13
13
  * category: [DM.Commerce.AgeRange],
14
- * value: [measures.sum(DM.Commerce.Revenue)],
14
+ * value: [measureFactory.sum(DM.Commerce.Revenue)],
15
15
  * breakBy: [DM.Commerce.Gender],
16
16
  * }}
17
- * filters={[filters.greaterThan(DM.Commerce.Revenue, 1000)]}
17
+ * filters={[filterFactory.greaterThan(DM.Commerce.Revenue, 1000)]}
18
18
  * onDataPointClick= {(point, nativeEvent) => {
19
19
  * console.log('clicked', point, nativeEvent);
20
20
  * }}
package/dist/props.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { Attribute, Filter, Measure, DataSource, Data, QueryResultData } from '@sisense/sdk-data';
2
- import { ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ThemeSettings, PolarStyleOptions, PieStyleOptions, StackableStyleOptions, LineStyleOptions, AreaStyleOptions, FunnelStyleOptions, ScatterStyleOptions, StyleOptions, ChartType, IndicatorStyleOptions, DrilldownOptions, TableStyleOptions, ThemeOid, WidgetStyleOptions, TreemapStyleOptions, CustomDrilldownResult, MenuPosition, MenuItemSection, SunburstStyleOptions } from './types';
1
+ import { Attribute, Filter, Measure, DataSource, Data, QueryResultData, FilterRelation } from '@sisense/sdk-data';
2
+ import { ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ThemeSettings, PolarStyleOptions, PieStyleOptions, StackableStyleOptions, LineStyleOptions, AreaStyleOptions, FunnelStyleOptions, ScatterStyleOptions, ChartStyleOptions, ChartType, IndicatorStyleOptions, DrilldownOptions, TableStyleOptions, ThemeOid, TreemapStyleOptions, CustomDrilldownResult, MenuPosition, MenuItemSection, SunburstStyleOptions, ChartWidgetStyleOptions, TableWidgetStyleOptions, DashboardWidgetStyleOptions, BoxplotStyleOptions, ScattermapStyleOptions } from './types';
3
3
  import { HighchartsOptions } from './chart-options-processor/chart-options-service';
4
4
  import { ComponentType, PropsWithChildren, ReactNode } from 'react';
5
- import { IndicatorDataOptions, ScatterChartDataOptions, TableDataOptions } from './chart-data-options/types';
5
+ import { IndicatorChartDataOptions, BoxplotChartCustomDataOptions, BoxplotChartDataOptions, ScatterChartDataOptions, TableDataOptions, ScattermapChartDataOptions } from './chart-data-options/types';
6
6
  import { DataPointEventHandler, DataPointsEventHandler, ScatterDataPointEventHandler, ScatterDataPointsEventHandler } from './chart-options-processor/apply-event-handlers';
7
7
  import { AppConfig } from './app/client-application';
8
- import { ExecuteQueryParams } from './query-execution';
8
+ import { ExecuteQueryParams, QueryByWidgetIdState, QueryState } from './query-execution';
9
9
  import { FiltersMergeStrategy } from './dashboard-widget/types';
10
10
  import { HookEnableParam } from './common/hooks/types';
11
11
  export type { ScatterDataPointEventHandler, ScatterDataPointsEventHandler, DataPointEventHandler, DataPointsEventHandler, MenuItemSection, HighchartsOptions, };
@@ -82,7 +82,7 @@ export interface ExecuteQueryProps {
82
82
  /** Measures of the query */
83
83
  measures?: Measure[];
84
84
  /** Filters that will slice query results */
85
- filters?: Filter[];
85
+ filters?: Filter[] | FilterRelation;
86
86
  /** Highlight filters that will highlight results that pass filter criteria */
87
87
  highlights?: Filter[];
88
88
  /**
@@ -98,7 +98,7 @@ export interface ExecuteQueryProps {
98
98
  */
99
99
  offset?: number;
100
100
  /** Function as child component that is called to render the query results */
101
- children?: (queryResult: QueryResultData) => ReactNode;
101
+ children?: (queryState: QueryState) => ReactNode;
102
102
  /** Callback function that is evaluated when query results are ready */
103
103
  onDataChanged?: (data: QueryResultData) => void;
104
104
  /**
@@ -253,7 +253,7 @@ export interface BaseChartProps {
253
253
  *
254
254
  * @category Data
255
255
  */
256
- filters?: Filter[];
256
+ filters?: Filter[] | FilterRelation;
257
257
  /**
258
258
  * Highlight filters that will highlight results that pass filter criteria
259
259
  *
@@ -282,7 +282,7 @@ export interface ChartProps extends BaseChartProps, BaseChartEventProps {
282
282
  *
283
283
  * @category Chart
284
284
  */
285
- styleOptions?: StyleOptions;
285
+ styleOptions?: ChartStyleOptions;
286
286
  /**
287
287
  * Used to force a refresh of the chart from outside the chart component
288
288
  * Since added to dependencies of useEffect, will trigger a query execution
@@ -319,7 +319,7 @@ export interface BarChartProps extends BaseChartProps, ChartEventProps {
319
319
  */
320
320
  dataOptions: CartesianChartDataOptions;
321
321
  /**
322
- * Configuration that define functional style of the various chart elements
322
+ * Configuration that defines functional style of the various chart elements
323
323
  *
324
324
  * @category Chart
325
325
  */
@@ -336,7 +336,7 @@ export interface ColumnChartProps extends BaseChartProps, ChartEventProps {
336
336
  */
337
337
  dataOptions: CartesianChartDataOptions;
338
338
  /**
339
- * Configuration that define functional style of the various chart elements
339
+ * Configuration that defines functional style of the various chart elements
340
340
  *
341
341
  * @category Chart
342
342
  */
@@ -353,7 +353,7 @@ export interface FunnelChartProps extends BaseChartProps, ChartEventProps {
353
353
  */
354
354
  dataOptions: CategoricalChartDataOptions;
355
355
  /**
356
- * Configuration that define functional style of the various chart elements
356
+ * Configuration that defines functional style of the various chart elements
357
357
  *
358
358
  * @category Chart
359
359
  */
@@ -387,7 +387,7 @@ export interface PieChartProps extends BaseChartProps, ChartEventProps {
387
387
  */
388
388
  dataOptions: CategoricalChartDataOptions;
389
389
  /**
390
- * Configuration that define functional style of the various chart elements
390
+ * Configuration that defines functional style of the various chart elements
391
391
  *
392
392
  * @category Chart
393
393
  */
@@ -399,7 +399,7 @@ export interface PieChartProps extends BaseChartProps, ChartEventProps {
399
399
  export interface PolarChartProps extends BaseChartProps, ChartEventProps {
400
400
  /** Configurations for how to interpret and present the data passed to the chart */
401
401
  dataOptions: CartesianChartDataOptions;
402
- /** Configuration that define functional style of the various chart elements */
402
+ /** Configuration that defines functional style of the various chart elements */
403
403
  styleOptions?: PolarStyleOptions;
404
404
  }
405
405
  /**
@@ -407,8 +407,8 @@ export interface PolarChartProps extends BaseChartProps, ChartEventProps {
407
407
  */
408
408
  export interface IndicatorChartProps extends BaseChartProps {
409
409
  /** Configurations for how to interpret and present the data passed to the chart */
410
- dataOptions: IndicatorDataOptions;
411
- /** Configuration that define functional style of the various chart elements */
410
+ dataOptions: IndicatorChartDataOptions;
411
+ /** Configuration that defines functional style of the various chart elements */
412
412
  styleOptions?: IndicatorStyleOptions;
413
413
  }
414
414
  /**
@@ -433,7 +433,7 @@ export interface TableProps {
433
433
  *
434
434
  * @category Data
435
435
  */
436
- filters?: Filter[];
436
+ filters?: Filter[] | FilterRelation;
437
437
  /**
438
438
  * Configurations that define functional style of the various table elements
439
439
  *
@@ -459,7 +459,7 @@ export interface ScatterChartProps extends BaseChartProps, ScatterChartEventProp
459
459
  */
460
460
  dataOptions: ScatterChartDataOptions;
461
461
  /**
462
- * Configuration that define functional style of the various chart elements
462
+ * Configuration that defines functional style of the various chart elements
463
463
  *
464
464
  * @category Chart
465
465
  */
@@ -525,35 +525,12 @@ export interface DashboardWidgetProps extends Omit<ChartWidgetProps, 'dataSource
525
525
  */
526
526
  description?: string;
527
527
  /**
528
- * Style options for the widget container including the widget header
528
+ * Style options for the the widget including the widget container and the chart or table inside.
529
529
  *
530
- * @category Widget
531
- */
532
- widgetStyleOptions?: WidgetStyleOptions;
533
- /**
534
- * General style options for the visual component of the widget – for example, chart or table.
535
530
  *
536
531
  * @category Widget
537
532
  */
538
- styleOptions?: {
539
- /**
540
- * Total width of the component, which is considered in the following order of priority:
541
- *
542
- * 1. Value passed to this property (in pixels)
543
- * 2. Width of the container wrapping this component
544
- * 3. Default value as specified per chart type
545
- *
546
- */
547
- width?: number;
548
- /**
549
- * Total height of the component, which is considered in the following order of priority:
550
- *
551
- * 1. Value passed to this property (in pixels).
552
- * 2. Height of the container wrapping this component
553
- * 3. Default value as specified per chart type
554
- */
555
- height?: number;
556
- };
533
+ styleOptions?: DashboardWidgetStyleOptions;
557
534
  /**
558
535
  * {@inheritDoc ChartWidgetProps.drilldownOptions}
559
536
  *
@@ -581,6 +558,12 @@ export interface ChartWidgetProps extends BaseChartEventProps {
581
558
  * @category Data
582
559
  */
583
560
  filters?: Filter[];
561
+ /**
562
+ * Specifies the logical relationship between multiple filters (AND, OR)
563
+ *
564
+ * @category Data
565
+ */
566
+ filterRelations?: FilterRelation;
584
567
  /**
585
568
  * Highlight filters that will highlight results that pass filter criteria
586
569
  *
@@ -600,17 +583,11 @@ export interface ChartWidgetProps extends BaseChartEventProps {
600
583
  */
601
584
  dataOptions: ChartDataOptions;
602
585
  /**
603
- * Style options for both the widget as a whole and specifically for the widget header
586
+ * Style options for both the chart and widget including the widget header
604
587
  *
605
588
  * @category Widget
606
589
  */
607
- widgetStyleOptions?: WidgetStyleOptions;
608
- /**
609
- * Style options union across chart types
610
- *
611
- * @category Chart
612
- */
613
- styleOptions?: StyleOptions;
590
+ styleOptions?: ChartWidgetStyleOptions;
614
591
  /**
615
592
  * List of categories to allow drilldowns on
616
593
  *
@@ -687,7 +664,7 @@ export interface TableWidgetProps {
687
664
  *
688
665
  * @category Data
689
666
  */
690
- filters?: Filter[];
667
+ filters?: Filter[] | FilterRelation;
691
668
  /**
692
669
  * Configurations for how to interpret and present the data passed to the table
693
670
  *
@@ -695,17 +672,11 @@ export interface TableWidgetProps {
695
672
  */
696
673
  dataOptions: TableDataOptions;
697
674
  /**
698
- * Style options for both the widget as a whole and specifically for the widget header
675
+ * Style options for both the table and widget including the widget header
699
676
  *
700
677
  * @category Widget
701
678
  */
702
- widgetStyleOptions?: WidgetStyleOptions;
703
- /**
704
- * Style options for table
705
- *
706
- * @category Chart
707
- */
708
- styleOptions?: TableStyleOptions;
679
+ styleOptions?: TableWidgetStyleOptions;
709
680
  /**
710
681
  * React nodes to be rendered at the top of component, before the table
711
682
  *
@@ -768,7 +739,7 @@ export interface ExecuteQueryByWidgetIdProps {
768
739
  */
769
740
  includeDashboardFilters?: boolean;
770
741
  /** Function as child component that is called to render the query results */
771
- children?: (queryResult: QueryResultData, queryParams: ExecuteQueryParams) => ReactNode;
742
+ children?: (queryState: QueryByWidgetIdState) => ReactNode;
772
743
  /** Callback function that is evaluated when query results are ready */
773
744
  onDataChanged?: (data: QueryResultData, queryParams: ExecuteQueryParams) => void;
774
745
  /**
@@ -795,7 +766,7 @@ export interface TreemapChartProps extends BaseChartProps, ChartEventProps {
795
766
  */
796
767
  dataOptions: CategoricalChartDataOptions;
797
768
  /**
798
- * Configuration that define functional style of the various chart elements
769
+ * Configuration that defines functional style of the various chart elements
799
770
  *
800
771
  * @category Chart
801
772
  */
@@ -812,12 +783,46 @@ export interface SunburstChartProps extends BaseChartProps, ChartEventProps {
812
783
  */
813
784
  dataOptions: CategoricalChartDataOptions;
814
785
  /**
815
- * Configuration that define functional style of the various chart elements
786
+ * Configuration that defines functional style of the various chart elements
816
787
  *
817
788
  * @category Chart
818
789
  */
819
790
  styleOptions?: SunburstStyleOptions;
820
791
  }
792
+ /**
793
+ * Props of the {@link BoxplotChart} component.
794
+ */
795
+ export interface BoxplotChartProps extends BaseChartProps, ChartEventProps {
796
+ /**
797
+ * Configurations for how to interpret and present the data passed to the chart
798
+ *
799
+ * @category Chart
800
+ */
801
+ dataOptions: BoxplotChartDataOptions | BoxplotChartCustomDataOptions;
802
+ /**
803
+ * Configuration that defines functional style of the various chart elements
804
+ *
805
+ * @category Chart
806
+ */
807
+ styleOptions?: BoxplotStyleOptions;
808
+ }
809
+ /**
810
+ * Props of the {@link ScattermapChart} component.
811
+ */
812
+ export interface ScattermapChartProps extends BaseChartProps, ChartEventProps {
813
+ /**
814
+ * Configurations for how to interpret and present the data passed to the chart
815
+ *
816
+ * @category Chart
817
+ */
818
+ dataOptions: ScattermapChartDataOptions;
819
+ /**
820
+ * Configuration that defines functional style of the various chart elements
821
+ *
822
+ * @category Chart
823
+ */
824
+ styleOptions?: ScattermapStyleOptions;
825
+ }
821
826
  /**
822
827
  * Props for {@link ContextMenu} component.
823
828
  */
@@ -4,7 +4,7 @@ import { ClientApplication } from '../app/client-application';
4
4
  /**
5
5
  * All the properties that fully describe a query you want to send.
6
6
  *
7
- * We use "dimensions" it public interface because the term is closer to the query and charting
7
+ * We use "dimensions" in public interface because the term is closer to the query and charting
8
8
  * as used in the industry (Sisense included).
9
9
  * internally, "dimensions" are represented by attributes as the latter is closer to the data model.
10
10
  */
@@ -17,3 +17,5 @@ export declare const QUERY_DEFAULT_LIMIT = 20000;
17
17
  export declare const QUERY_DEFAULT_OFFSET = 0;
18
18
  /** @internal */
19
19
  export declare const executeQuery: (queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig) => Promise<QueryResultData>;
20
+ /** @internal */
21
+ export declare const executeCsvQuery: (queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig) => Promise<Blob>;
@@ -0,0 +1,2 @@
1
+ import { CsvQueryAction, CsvQueryState } from './types.js';
2
+ export declare function downloadCsvQueryStateReducer(state: CsvQueryState, action: CsvQueryAction): CsvQueryState;