@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
@@ -0,0 +1,2 @@
1
+ import { ScattermapChartLocation } from '../../../chart-data/types.js';
2
+ export declare function getLocationsMarkerSizes(locations: ScattermapChartLocation[], minsize?: number, maxsize?: number): number[];
@@ -0,0 +1,8 @@
1
+ import { ScattermapChartLocation } from '../../../chart-data/types';
2
+ import { ScattermapChartDataOptionsInternal } from '../../../chart-data-options/types.js';
3
+ export declare const enum TooltipShowDetails {
4
+ YES = 0,
5
+ NO = 1,
6
+ LOADING = 2
7
+ }
8
+ export declare const createScattermapTooltip: (location: ScattermapChartLocation, dataOptions: ScattermapChartDataOptionsInternal, showDetails?: TooltipShowDetails) => string;
@@ -0,0 +1,4 @@
1
+ export declare function getValuesMinMax(values: number[]): {
2
+ min: number;
3
+ max: number;
4
+ };
@@ -20,7 +20,7 @@ export type TableProps = {
20
20
  */
21
21
  dataOptions: TableDataOptionsInternal;
22
22
  /**
23
- * Configuration that define functional style of the various chart elements
23
+ * Configuration that defines functional style of the various chart elements
24
24
  *
25
25
  */
26
26
  designOptions?: TableDesignOptions;
@@ -12,10 +12,10 @@ import { ColumnChartProps } 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
  * breakBy: [DM.Commerce.Gender],
17
17
  * }}
18
- * filters={[filters.greaterThan(DM.Commerce.Revenue, 1000)]}
18
+ * filters={[filterFactory.greaterThan(DM.Commerce.Revenue, 1000)]}
19
19
  * onDataPointClick={(point, nativeEvent) => {
20
20
  * console.log('clicked', point, nativeEvent);
21
21
  * }}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const LoadingDots: ({ color }: {
3
+ color: string | undefined;
4
+ }) => JSX.Element;
@@ -5,7 +5,7 @@ import { WidgetDto } from './types';
5
5
  *
6
6
  * @param {DashboardDto} dashboard - The dashboard containing the filters.
7
7
  * @param {WidgetDto} widget - The widget to extract filters from.
8
- * @returns {Object} An object containing an array of filters and an array of highlights.
8
+ * @returns {object} An object containing an array of filters and an array of highlights.
9
9
  */
10
10
  export declare function extractDashboardFiltersForWidget(dashboard: DashboardDto, widget: WidgetDto): {
11
11
  filters: import("@sisense/sdk-data").Filter[];
@@ -1,6 +1,6 @@
1
- import { DataColorOptions } from '../chart-data/series-data-color-service';
2
- import { CompleteThemeSettings, ValueToColorMap, MultiColumnValueToColorMap } from '../types';
1
+ import { DataColorOptions } from '../chart-data/data-coloring';
2
+ import { ValueToColorMap, MultiColumnValueToColorMap, Color } from '../types';
3
3
  import { PanelColorFormat, PanelItem, PanelMembersFormat } from './types';
4
- export declare const createValueColorOptions: (format?: PanelColorFormat, themeSettings?: CompleteThemeSettings) => DataColorOptions | undefined;
4
+ export declare const createValueColorOptions: (format?: PanelColorFormat, customPaletteColors?: Color[]) => DataColorOptions | undefined;
5
5
  export declare const createValueToColorMap: (membersFormat: PanelMembersFormat) => ValueToColorMap;
6
6
  export declare const createValueToColorMultiColumnsMap: (items: PanelItem[]) => MultiColumnValueToColorMap;
@@ -1,7 +1,8 @@
1
1
  import { DimensionalBaseMeasure, DimensionalAttribute, DimensionalCalculatedMeasure, Jaql } from '@sisense/sdk-data';
2
- import { CategoricalChartDataOptions, ScatterChartDataOptions, IndicatorDataOptions, StyledMeasureColumn, StyledColumn, CompleteThemeSettings } from '../types';
3
- import { Panel, PanelItem, WidgetType } from './types';
4
- import { TableDataOptions } from '../chart-data-options/types';
2
+ import { StyledMeasureColumn, StyledColumn, Color } from '../types';
3
+ import { Panel, PanelItem, WidgetType, WidgetStyle, BoxplotWidgetStyle } from './types';
4
+ import { WidgetDataOptions } from '../models';
5
5
  export declare function createDimensionalElementFromJaql(jaql: Jaql, format?: PanelItem['format']): import("@sisense/sdk-data").Filter | DimensionalCalculatedMeasure | DimensionalBaseMeasure | DimensionalAttribute;
6
- export declare function createDataColumn(item: PanelItem, themeSettings?: CompleteThemeSettings): StyledMeasureColumn | StyledColumn;
7
- export declare function extractDataOptions(widgetType: WidgetType, panels: Panel[], themeSettings?: CompleteThemeSettings): CategoricalChartDataOptions | ScatterChartDataOptions | IndicatorDataOptions | TableDataOptions;
6
+ export declare function createDataColumn(item: PanelItem, customPaletteColors?: Color[]): StyledColumn | StyledMeasureColumn;
7
+ export declare function extractBoxplotBoxType(style: BoxplotWidgetStyle): "iqr" | "extremums" | "standardDeviation";
8
+ export declare function extractDataOptions(widgetType: WidgetType, panels: Panel[], style: WidgetStyle, customPaletteColors?: Color[]): WidgetDataOptions;
@@ -1,5 +1,5 @@
1
- import { StyleOptions, TableStyleOptions, NumericBarIndicatorStyleOptions, NumericSimpleIndicatorStyleOptions, GaugeIndicatorStyleOptions } from '../types';
1
+ import { ChartStyleOptions, TableStyleOptions, NumericBarIndicatorStyleOptions, NumericSimpleIndicatorStyleOptions, GaugeIndicatorStyleOptions } from '../types';
2
2
  import { Panel, WidgetStyle, WidgetSubtype, WidgetType, TableWidgetStyle, IndicatorWidgetStyle } from './types';
3
3
  export declare function extractTableChartStyleOptions(widgetStyle: TableWidgetStyle): TableStyleOptions;
4
4
  export declare const getIndicatorTypeSpecificOptions: (widgetSubtype: WidgetSubtype, widgetStyle: IndicatorWidgetStyle) => NumericSimpleIndicatorStyleOptions | NumericBarIndicatorStyleOptions | GaugeIndicatorStyleOptions;
5
- export declare function extractStyleOptions(widgetType: WidgetType, widgetSubtype: WidgetSubtype, style: WidgetStyle, panels: Panel[]): StyleOptions | TableStyleOptions;
5
+ export declare function extractStyleOptions<WType extends WidgetType>(widgetType: WType, widgetSubtype: WidgetSubtype, style: WidgetStyle, panels: Panel[]): ChartStyleOptions | TableStyleOptions;
@@ -1,20 +1,21 @@
1
1
  import { Jaql, SortDirection } from '@sisense/sdk-data';
2
- export declare const enum WidgetType {
3
- PieChart = "chart/pie",
4
- ColumnChart = "chart/column",
5
- BarChart = "chart/bar",
6
- LineChart = "chart/line",
7
- AreaChart = "chart/area",
8
- FunnelChart = "chart/funnel",
9
- TreemapChart = "treemap",
10
- SunburstChart = "sunburst",
11
- ScatterChart = "chart/scatter",
12
- IndicatorChart = "indicator",
13
- PolarChart = "chart/polar",
14
- Table = "tablewidget",
15
- TableWithAggregation = "tablewidgetagg"
16
- }
17
- export type WidgetSubtype = 'area/basic' | 'area/stacked' | 'area/stacked100' | 'area/spline' | 'area/stackedspline' | 'area/stackedspline100' | 'bar/classic' | 'bar/stacked' | 'bar/stacked100' | 'column/classic' | 'column/stackedcolumn' | 'column/stackedcolumn100' | 'line/basic' | 'line/spline' | 'pie/classic' | 'pie/donut' | 'pie/ring' | 'column/polar' | 'area/polar' | 'line/polar' | 'indicator/numeric' | 'indicator/gauge' | 'bubble/scatter' | 'treemap' | 'sunburst';
2
+ /**
3
+ * The type of a widget on a dashboard that is a variant of Cartesian widget.
4
+ */
5
+ export type CartesianWidgetType = 'chart/line' | 'chart/area' | 'chart/bar' | 'chart/column' | 'chart/polar';
6
+ /**
7
+ * The type of a widget on a dashboard that is a variant of Categorical widget.
8
+ */
9
+ export type CategoricalWidgetType = 'chart/pie' | 'chart/funnel' | 'treemap' | 'sunburst';
10
+ /**
11
+ * The type of a widget on a dashboard that is a variant of tabular widget.
12
+ */
13
+ export type TabularWidgetType = 'tablewidget' | 'tablewidgetagg';
14
+ /**
15
+ * The type of a widget on a dashboard.
16
+ */
17
+ export type WidgetType = CartesianWidgetType | CategoricalWidgetType | 'chart/scatter' | 'indicator' | TabularWidgetType | 'chart/boxplot' | 'map/scatter';
18
+ export type WidgetSubtype = 'area/basic' | 'area/stacked' | 'area/stacked100' | 'area/spline' | 'area/stackedspline' | 'area/stackedspline100' | 'bar/classic' | 'bar/stacked' | 'bar/stacked100' | 'column/classic' | 'column/stackedcolumn' | 'column/stackedcolumn100' | 'line/basic' | 'line/spline' | 'pie/classic' | 'pie/donut' | 'pie/ring' | 'column/polar' | 'area/polar' | 'line/polar' | 'indicator/numeric' | 'indicator/gauge' | 'bubble/scatter' | 'treemap' | 'sunburst' | 'boxplot/full' | 'boxplot/hollow' | 'map/scatter';
18
19
  export declare enum WidgetDashboardFilterMode {
19
20
  FILTER = "filter",
20
21
  SELECT = "select"
@@ -23,7 +24,9 @@ export type Datasource = {
23
24
  title: string;
24
25
  id: string;
25
26
  fullname?: string;
26
- live: boolean;
27
+ live?: boolean;
28
+ address?: string;
29
+ database?: string;
27
30
  };
28
31
  /**
29
32
  * The data transfer object (DTO) containing info of a widget on a dashboard.
@@ -42,7 +45,7 @@ export interface WidgetDto {
42
45
  };
43
46
  style: WidgetStyle;
44
47
  title: string;
45
- desc: string;
48
+ desc: string | null;
46
49
  options?: {
47
50
  dashboardFiltersMode: `${WidgetDashboardFilterMode}`;
48
51
  };
@@ -107,6 +110,7 @@ export type PanelItem = {
107
110
  singleSeriesType?: SeriesType;
108
111
  categoriesSorting?: SortDirection;
109
112
  isColored?: boolean;
113
+ geoLevel?: 'country' | 'state' | 'city';
110
114
  };
111
115
  export type PanelColorFormat = PanelColorFormatSingle | PanelColorFormatRange | PanelColorFormatConditional;
112
116
  export type PanelMembersFormat = Record<string, {
@@ -296,7 +300,29 @@ export type SunburstWidgetStyle = {
296
300
  'tooltip/contribution': boolean;
297
301
  'tooltip/value': boolean;
298
302
  };
299
- export type WidgetStyle = CartesianWidgetStyle | PolarWidgetStyle | FunnelWidgetStyle | ScatterWidgetStyle | TableWidgetStyle | IndicatorWidgetStyle | TreemapWidgetStyle | SunburstWidgetStyle;
303
+ export type BoxplotWidgetStyle = {
304
+ xAxis: AxisStyle;
305
+ yAxis: AxisStyle;
306
+ whisker: {
307
+ 'whisker/iqr': boolean;
308
+ 'whisker/extremums': boolean;
309
+ 'whisker/deviation': boolean;
310
+ };
311
+ outliers: {
312
+ enabled: boolean;
313
+ };
314
+ };
315
+ export type ScattermapWidgetStyle = {
316
+ markers: {
317
+ fill: 'filled' | 'filled-light' | 'hollow' | 'hollow-bold';
318
+ size: {
319
+ defaultSize: number;
320
+ min: number;
321
+ max: number;
322
+ };
323
+ };
324
+ };
325
+ export type WidgetStyle = CartesianWidgetStyle | PolarWidgetStyle | FunnelWidgetStyle | ScatterWidgetStyle | TableWidgetStyle | IndicatorWidgetStyle | TreemapWidgetStyle | SunburstWidgetStyle | BoxplotWidgetStyle | ScattermapWidgetStyle;
300
326
  export declare enum FiltersMergeStrategyEnum {
301
327
  WIDGET_FIRST = "widgetFirst",
302
328
  CODE_FIRST = "codeFirst",
@@ -5,8 +5,7 @@ import { WidgetDto } from './types';
5
5
  * Fetches a Widget DTO model and, optionally, a Dashboard DTO model.
6
6
  *
7
7
  * @internal
8
- *
9
- * @param {Object} options - The options for fetching the DTO models.
8
+ * @param {object} options - The options for fetching the DTO models.
10
9
  * @param {string} options.widgetOid - The OID of the widget to fetch.
11
10
  * @param {string} options.dashboardOid - The OID of the dashboard to which the widget belongs.
12
11
  * @param {boolean} [options.includeDashboard] - (Optional) Whether to include the associated dashboard.
@@ -20,14 +19,19 @@ export declare const fetchWidgetDtoModel: ({ widgetOid, dashboardOid, includeDas
20
19
  api: RestApi;
21
20
  }) => Promise<{
22
21
  widget: WidgetDto;
23
- dashboard: DashboardDto | undefined;
22
+ dashboard: ({
23
+ oid: string;
24
+ title: string;
25
+ datasource: import("./types").Datasource;
26
+ widgets?: WidgetDto[] | undefined;
27
+ filters?: (import("../api/types/dashboard-dto").Filter | import("../api/types/dashboard-dto").CascadingFilter)[] | undefined;
28
+ } & import("../utils/utility-types").AnyObject) | undefined;
24
29
  }>;
25
30
  /**
26
31
  * Custom hook for fetching Widget DTO and Dashboard DTO models.
27
32
  *
28
33
  * @internal
29
- *
30
- * @param {Object} options - The options for fetching the DTO models.
34
+ * @param {object} options - The options for fetching the DTO models.
31
35
  * @param {string} options.widgetOid - The OID of the widget to fetch.
32
36
  * @param {string} options.dashboardOid - The OID of the dashboard to which the widget belongs.
33
37
  * @param {boolean} [options.includeDashboard] - (Optional) Whether to include the associated dashboard.
@@ -6,7 +6,7 @@ export declare function getChartType(widgetType: WidgetType): ChartType;
6
6
  export declare function getChartSubtype(widgetSubtype: WidgetSubtype): ChartSubtype | undefined;
7
7
  type WidgetTypeOrString = string | WidgetType;
8
8
  export declare function isSupportedWidgetType(widgetType: WidgetTypeOrString): widgetType is WidgetType;
9
- export declare function isTableWidget(widgetType: WidgetTypeOrString): boolean;
9
+ export declare function isTabularWidget(widgetType: WidgetTypeOrString): boolean;
10
10
  export declare function getEnabledPanelItems(panels: Panel[], panelName: string): PanelItem[];
11
11
  export declare function getRootPanelItem(item: PanelItem): PanelItem;
12
12
  export declare function getSortType(jaqlSort: JaqlSortDirection | undefined): SortDirection;
@@ -15,6 +15,7 @@ export type SisenseComponentConfig = {
15
15
  export type ComponentDecorator<DecoratorConfig> = (decoratorConfig: DecoratorConfig) => <ComponentProps extends Record<string, any>>(Component: FunctionComponent<ComponentProps>) => FunctionComponent<ComponentProps>;
16
16
  /**
17
17
  * Decorator that adds sisense-specific functionality to a component
18
+ *
18
19
  * @param componentConfig - component configuration
19
20
  * @returns A component with sisense-specific functionality
20
21
  */
@@ -1,7 +1,7 @@
1
1
  import { type FunctionComponent, type InputHTMLAttributes } from 'react';
2
2
  type BasicInputProps = {
3
3
  variant?: 'white' | 'grey';
4
- label: string;
4
+ label?: string;
5
5
  callback: (value: string) => void;
6
6
  } & InputHTMLAttributes<HTMLInputElement>;
7
7
  export declare const BasicInput: FunctionComponent<BasicInputProps>;
@@ -1,8 +1,9 @@
1
1
  import { CompleteThemeSettings } from '../../../types';
2
2
  import { type FunctionComponent, type ButtonHTMLAttributes } from 'react';
3
+ type Variant = 'white' | 'grey';
3
4
  type InputProps = {
4
- variant?: 'white' | 'grey';
5
- label: string;
5
+ variant?: Variant;
6
+ label?: string;
6
7
  isActive?: boolean;
7
8
  } & ButtonHTMLAttributes<HTMLButtonElement>;
8
9
  type ThemeMixin = {
@@ -0,0 +1,9 @@
1
+ import { type FunctionComponent } from 'react';
2
+ import { MenuList } from '@mui/material';
3
+ export type DropdownProps = {
4
+ elements: JSX.Element[];
5
+ icon?: JSX.Element;
6
+ selectedIdx?: number;
7
+ disabled?: boolean;
8
+ } & React.ComponentProps<typeof MenuList>;
9
+ export declare const Dropdown: FunctionComponent<DropdownProps>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Orientation options for the filter tile. The filter tile can
3
+ * be arranged vertically, or horizontally to fit most toolbars.
4
+ */
5
+ export type FilterVariant = 'vertical' | 'horizontal';
6
+ /**
7
+ * Determines whether the arrangement of the filter menu is vertical.
8
+ *
9
+ * @param arrangement - Arrangement of the filter menu
10
+ * @returns True if the arrangement is vertical, false otherwise
11
+ * @internal
12
+ */
13
+ export declare const isVertical: (arrangement: FilterVariant) => boolean;
@@ -2,7 +2,9 @@ export { LinkButton, PrimaryButton, SecondaryButton } from './buttons';
2
2
  export { Checkbox } from './checkbox';
3
3
  export { BasicInput } from './basic-input';
4
4
  export { Input } from './input';
5
- export { Radio } from './radio';
5
+ export { Radio, RadioGroup, type RadioGroupProps } from './radio';
6
6
  export { SisenseSwitchButton } from './switch';
7
7
  export { TriangleIndicator } from './triangle-indicator';
8
8
  export { DateRangeFieldButton } from './date-range-field-button';
9
+ export { Dropdown } from './dropdown';
10
+ export { type FilterVariant } from './filter-utils';
@@ -3,4 +3,11 @@ type RadioProps = {
3
3
  label?: string;
4
4
  } & InputHTMLAttributes<HTMLInputElement>;
5
5
  export declare const Radio: FunctionComponent<RadioProps>;
6
+ export type RadioGroupProps = {
7
+ items: string[];
8
+ currentSelection?: string;
9
+ title?: string;
10
+ className?: string;
11
+ } & InputHTMLAttributes<HTMLInputElement>;
12
+ export declare const RadioGroup: FunctionComponent<RadioGroupProps>;
6
13
  export {};
@@ -1,11 +1,11 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { FilterOptionType } from './criteria-filter-operations.js';
2
+ import { FilterOptionType, CriteriaFilterValueType } from './criteria-filter-operations.js';
3
3
  /**
4
4
  * Props for {@link CriteriaFilterDisplay}
5
5
  */
6
6
  export interface CriteriaFilterDisplayProps {
7
7
  filterType: FilterOptionType;
8
- values?: (number | string)[];
8
+ values?: CriteriaFilterValueType[];
9
9
  }
10
10
  /**
11
11
  * UI component that provides a static, uneditable display of the criteria filter values, to be shown when vertically aligned filter tiles are collapsed.
@@ -1,5 +1,7 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { FilterOptionType, FilterVariant } from './criteria-filter-operations';
2
+ import { FilterOptionType, CriteriaFilterValueType } from './criteria-filter-operations';
3
+ import { Measure } from '@sisense/sdk-data';
4
+ import { FilterVariant } from '../common/filter-utils';
3
5
  /**
4
6
  * Props for {@link CriteriaFilterMenu}
5
7
  *
@@ -8,9 +10,10 @@ import { FilterOptionType, FilterVariant } from './criteria-filter-operations';
8
10
  export interface CriteriaFilterMenuProps {
9
11
  filterType: FilterOptionType;
10
12
  arrangement?: FilterVariant;
11
- defaultValues?: (number | string)[];
12
- onUpdate?: (values: (number | string)[]) => void;
13
+ defaultValues?: CriteriaFilterValueType[];
14
+ onUpdate?: (values: CriteriaFilterValueType[]) => void;
13
15
  disabled?: boolean;
16
+ measures?: Measure[];
14
17
  }
15
18
  /**
16
19
  * UI component that provides field(s) for the user to enter values for a numeric filter.
@@ -1,3 +1,5 @@
1
+ import { Measure } from '@sisense/sdk-data';
2
+ import { CriteriaFilterType } from './criteria-filter-tile';
1
3
  /**
2
4
  * Collection of filter options for the {@link CriteriaFilterMenu},
3
5
  * to be provided to subcomponents as the `filterType` prop.
@@ -5,6 +7,9 @@
5
7
  * @internal
6
8
  */
7
9
  export declare const FilterOption: {
10
+ NOT_BETWEEN: string;
11
+ TOP: string;
12
+ BOTTOM: string;
8
13
  BETWEEN: string;
9
14
  EQUALS: string;
10
15
  NOT_EQUALS: string;
@@ -23,8 +28,6 @@ export declare const FilterOption: {
23
28
  LIKE: string;
24
29
  };
25
30
  export type FilterOptionType = keyof typeof FilterOption;
26
- export type FilterVariant = 'vertical' | 'horizontal';
27
- export type FilterInputType = 'text' | 'number';
28
31
  /**
29
32
  * Object containing related information for a filter option,
30
33
  * including the function to be used for filtering, the number of inputs,
@@ -39,7 +42,7 @@ export type FilterInfo = {
39
42
  symbols: string[];
40
43
  message: string;
41
44
  ranked: boolean;
42
- type: FilterInputType;
45
+ type: string;
43
46
  };
44
47
  /**
45
48
  * Map of {@link FilterOption} to {@link FilterInfo}
@@ -51,12 +54,14 @@ export declare const CRITERIA_FILTER_MAP: {
51
54
  [key: string]: FilterInfo;
52
55
  };
53
56
  /**
54
- * Determines whether the arrangement of the filter menu is vertical.
57
+ * Given an input filter, use the filterType and operators to determine
58
+ * the corresponding {@link FilterOption} and {@link FilterInfo}.
55
59
  *
56
- * @param arrangement - Arrangement of the filter menu
57
- * @returns True if the arrangement is vertical, false otherwise
58
60
  * @internal
59
61
  */
60
- export declare const isVertical: (arrangement: FilterVariant) => boolean;
61
- export declare const operatorsToOption: (operatorA?: string, operatorB?: string) => "BETWEEN" | "EQUALS" | "NOT_EQUALS" | "LESS_THAN" | "LESS_THAN_OR_EQUAL" | "GREATER_THAN" | "GREATER_THAN_OR_EQUAL" | "IS" | "IS_NOT" | "CONTAINS" | "NOT_CONTAIN" | "STARTS_WITH" | "NOT_STARTS_WITH" | "ENDS_WITH" | "NOT_ENDS_WITH" | "LIKE";
62
+ export declare const filterToOption: (filter: CriteriaFilterType) => FilterOptionType;
63
+ export type CriteriaFilterValueType = string | number | Measure;
64
+ export declare const filterToDefaultValues: (filter: CriteriaFilterType) => CriteriaFilterValueType[];
65
+ export declare const valuesToDisplayValues: (values: CriteriaFilterValueType[]) => (string | number)[];
62
66
  export declare const translatedMsgNoVal: (message: string, t: Function) => any;
67
+ export declare const filterTypeToInputType: (filterType: string) => string;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { FilterVariant } from './criteria-filter-operations.js';
3
- import { Filter, NumericFilter, TextFilter } from '@sisense/sdk-data';
2
+ import { ExcludeFilter, Filter, Measure, NumericFilter, RankingFilter, TextFilter } from '@sisense/sdk-data';
3
+ import { FilterVariant } from '../common/filter-utils.js';
4
4
  /**
5
5
  * Props for {@link CriteriaFilterTile}
6
6
  */
@@ -13,14 +13,31 @@ export interface CriteriaFilterTileProps {
13
13
  arrangement?: FilterVariant;
14
14
  /** Callback returning filter object, or null for failure */
15
15
  onUpdate: (filter: Filter | null) => void;
16
+ /** List of available measures to rank by. Required only for ranking filters. */
17
+ measures?: Measure[];
16
18
  }
17
- export type CriteriaFilterType = NumericFilter | TextFilter;
19
+ export type CriteriaFilterType = NumericFilter | TextFilter | RankingFilter | ExcludeFilter;
18
20
  /**
19
21
  * UI component that allows the user to filter numeric or text attributes according to
20
- * a number of built-in operations defined in the {@link NumericFilter} or {@link TextFilter}.
22
+ * a number of built-in operations defined in the {@link NumericFilter}, {@link TextFilter}, or {@link RankingFilter}.
21
23
  *
22
24
  * The arrangement prop determines whether the filter is rendered vertically or horizontally, with the latter intended for toolbar use and omitting title, enable/disable, and collapse/expand functionality.
23
25
  *
26
+ * @example
27
+ * ```tsx
28
+ * const initialRevenueFilter = filterFactory.greaterThanOrEqual(DM.Commerce.Revenue, 10000);
29
+ * const [revenueFilter, setRevenueFilter] = useState<Filter | null>(initialRevenueFilter);
30
+ *
31
+ * return (
32
+ * <CriteriaFilterTile
33
+ * title={'Revenue'}
34
+ * filter={revenueFilter}
35
+ * onUpdate={setRevenueFilter}
36
+ * />
37
+ * );
38
+ * ```
39
+ *
40
+ * <img src="media://criteria-filter-tile-example-1.png" width="300px" />
24
41
  * @param props - Criteria filter tile props
25
42
  * @returns Criteria filter tile component
26
43
  */
@@ -1,2 +1 @@
1
1
  export { CriteriaFilterTile, type CriteriaFilterTileProps, type CriteriaFilterType, } from './criteria-filter-tile';
2
- export { type FilterVariant } from './criteria-filter-operations';
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import dayjs from 'dayjs';
3
- export type SelectorMode = 'fromSelector' | 'toSelector';
3
+ export type SelectorMode = 'fromSelector' | 'toSelector' | 'pointSelector';
4
4
  export type DateRangeLimits = {
5
- maxDate: dayjs.Dayjs;
6
- minDate: dayjs.Dayjs;
5
+ maxDate?: dayjs.Dayjs;
6
+ minDate?: dayjs.Dayjs;
7
7
  };
8
8
  type DayjsDateRange = {
9
9
  from: dayjs.Dayjs;
@@ -11,10 +11,12 @@ type DayjsDateRange = {
11
11
  };
12
12
  export type CalendarDateSelectorProps = {
13
13
  selectorMode: SelectorMode;
14
- limit: DateRangeLimits;
15
- onDateRangeChanged: (dateRange: DayjsDateRange) => void;
16
- onSelectorModeChanged: (newSelectorMode: SelectorMode) => void;
17
- selectedDateRange: DayjsDateRange;
14
+ limit?: DateRangeLimits;
15
+ onDateRangeChanged?: (dateRange: DayjsDateRange) => void;
16
+ onSelectorModeChanged?: (newSelectorMode: SelectorMode) => void;
17
+ selectedDateRange?: DayjsDateRange;
18
+ onDateChanged?: (selectedDate: dayjs.Dayjs) => void;
19
+ selectedDate?: dayjs.Dayjs;
18
20
  };
19
- export declare function CalendarDateSelector({ selectedDateRange, limit, onDateRangeChanged, selectorMode, onSelectorModeChanged, }: CalendarDateSelectorProps): JSX.Element;
21
+ export declare function CalendarDateSelector({ selectedDateRange, limit, onDateRangeChanged, selectorMode, onSelectorModeChanged, onDateChanged, selectedDate, }: CalendarDateSelectorProps): JSX.Element;
20
22
  export {};
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import dayjs from 'dayjs';
3
- type ButtonId = 'earliest' | 'today' | 'latest';
3
+ export type ButtonId = 'earliest' | 'today' | 'latest';
4
4
  type QuickDateSelectionButtonsProps = {
5
5
  onDateSelected: (selectedDate: dayjs.Dayjs) => void;
6
6
  enabledButtons: ButtonId[];
7
- limit: {
8
- maxDate: dayjs.Dayjs;
9
- minDate: dayjs.Dayjs;
7
+ limit?: {
8
+ maxDate?: dayjs.Dayjs;
9
+ minDate?: dayjs.Dayjs;
10
10
  };
11
11
  };
12
12
  export declare const QuickDateSelectionButtons: (props: QuickDateSelectionButtonsProps) => JSX.Element;
@@ -49,7 +49,7 @@ export interface DateRangeFilterTileProps {
49
49
  * React example of configuring the date min max values and handling onChange event.
50
50
  * ```tsx
51
51
  * const [dateRangeFilter, setDateRangeFilter] = useState<Filter>(
52
- * filters.dateRange(DM.Commerce.Date.Years),
52
+ * filterFactory.dateRange(DM.Commerce.Date.Years),
53
53
  * );
54
54
  *
55
55
  * return (
@@ -1,2 +1,3 @@
1
1
  export * from './date-filter';
2
2
  export * from './date-range-filter-tile';
3
+ export * from './relative-date-filter-tile';
@@ -0,0 +1 @@
1
+ export { RelativeDateFilterTile, type RelativeDateFilterTileProps, } from './relative-date-filter-tile.js';
@@ -0,0 +1,14 @@
1
+ import { RelativeDateFilter } from '@sisense/sdk-data';
2
+ import { FunctionComponent } from 'react';
3
+ /**
4
+ * @internal
5
+ */
6
+ export type RelativeDateFilterDisplayProps = {
7
+ filter: RelativeDateFilter;
8
+ };
9
+ /**
10
+ * Displays a relative date filter as a human-readable string.
11
+ *
12
+ * @internal
13
+ */
14
+ export declare const RelativeDateFilterDisplay: FunctionComponent<RelativeDateFilterDisplayProps>;
@@ -0,0 +1,36 @@
1
+ /// <reference types="react" />
2
+ import { Filter } from '@sisense/sdk-data';
3
+ import { FilterVariant } from '../../common/index.js';
4
+ /**
5
+ * Props for {@link RelativeDateFilterTile}
6
+ */
7
+ export interface RelativeDateFilterTileProps {
8
+ /**Filter tile title */
9
+ title: string;
10
+ /** Relative date filter. */
11
+ filter: Filter;
12
+ /** Arrangement of the filter inputs. Use vertical for standard filter tiles and horizontal for toolbars */
13
+ arrangement?: FilterVariant;
14
+ /**
15
+ * Callback function that is called when the relative date filter object should be updated.
16
+ *
17
+ * @param filter - Relative date filter, or null for failure/disabled
18
+ */
19
+ onUpdate: (filter: Filter | null) => void;
20
+ /**
21
+ * Limit of the date range that can be selected.
22
+ */
23
+ limit?: {
24
+ maxDate: string;
25
+ minDate: string;
26
+ };
27
+ }
28
+ /**
29
+ * UI component that allows the user to filter date attributes according to
30
+ * a number of built-in operations defined in the relative date filter.
31
+ * Useful for filtering data by relative date ranges, such as "last 7 days" or "next 30 days from Date".
32
+ *
33
+ * @param props - Relative date filter tile props
34
+ * @returns Relative date filter tile component
35
+ */
36
+ export declare const RelativeDateFilterTile: import("react").FunctionComponent<RelativeDateFilterTileProps>;
@@ -0,0 +1,26 @@
1
+ import { Filter, RelativeDateFilter as RelativeDateFilterType } from '@sisense/sdk-data';
2
+ import { FilterVariant } from '../../common/index.js';
3
+ import { FunctionComponent } from 'react';
4
+ /**
5
+ * @internal
6
+ */
7
+ export interface RelativeDateFilterProps {
8
+ filter: RelativeDateFilterType;
9
+ arrangement?: FilterVariant;
10
+ onUpdate: (filter: Filter | null) => void;
11
+ disabled: boolean;
12
+ limit?: {
13
+ maxDate: string;
14
+ minDate: string;
15
+ };
16
+ }
17
+ /**
18
+ * @internal
19
+ */
20
+ export declare const RelativeDateFilter: FunctionComponent<RelativeDateFilterProps>;
21
+ export declare const DATE_OPS_MAP: {
22
+ [x: string]: string;
23
+ };
24
+ export declare const DATE_LEVELS_MAP: {
25
+ [x: string]: string;
26
+ };
@@ -1,5 +1,5 @@
1
1
  import type { FunctionComponent, ReactNode } from 'react';
2
- import { FilterVariant } from './criteria-filter-tile/criteria-filter-operations';
2
+ import { FilterVariant } from './common/filter-utils';
3
3
  interface Props {
4
4
  title: string;
5
5
  renderContent: (collapsed: boolean, tileDisabled: boolean) => ReactNode;
@@ -18,6 +18,8 @@ export interface BasicMemberFilterTileProps {
18
18
  maxAllowedMembers?: number;
19
19
  /** Whether this is a dependent filter */
20
20
  isDependent?: boolean;
21
+ /** Flag to update selected members when caused by an external change */
22
+ shouldUpdateSelectedMembers?: boolean;
21
23
  }
22
24
  /**
23
25
  * UI component that, given a list of members to select from and a list of