@sisense/sdk-ui 0.14.0 → 0.15.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 (91) hide show
  1. package/dist/ai/api/chat-api-context.d.ts +12 -0
  2. package/dist/ai/api/chat-rest-api.d.ts +28 -0
  3. package/dist/ai/api/hooks.d.ts +74 -0
  4. package/dist/ai/api/types.d.ts +139 -0
  5. package/dist/ai/chat-box.d.ts +6 -0
  6. package/dist/ai/chat-frame.d.ts +8 -0
  7. package/dist/ai/chat-home.d.ts +2 -0
  8. package/dist/ai/chat-input.d.ts +7 -0
  9. package/dist/ai/chatbot-context.d.ts +11 -0
  10. package/dist/ai/chatbot.d.ts +27 -0
  11. package/dist/ai/data-topics/data-topic-item.d.ts +8 -0
  12. package/dist/ai/data-topics/data-topic-list.d.ts +10 -0
  13. package/dist/ai/data-topics/index.d.ts +2 -0
  14. package/dist/ai/icons/arrow-left-icon.d.ts +2 -0
  15. package/dist/ai/icons/clear-chat-icon.d.ts +2 -0
  16. package/dist/ai/icons/close-dialog-icon.d.ts +2 -0
  17. package/dist/ai/icons/expand-icon.d.ts +2 -0
  18. package/dist/ai/icons/info-icon.d.ts +2 -0
  19. package/dist/ai/icons/light-bulb-icon.d.ts +2 -0
  20. package/dist/ai/icons/loading-dots-icon.d.ts +2 -0
  21. package/dist/ai/icons/magic-wand-icon.d.ts +2 -0
  22. package/dist/ai/icons/message-icon.d.ts +2 -0
  23. package/dist/ai/icons/refresh-icon.d.ts +2 -0
  24. package/dist/ai/icons/sisense-logo.d.ts +2 -0
  25. package/dist/ai/icons/three-dots-icon.d.ts +2 -0
  26. package/dist/ai/index.d.ts +4 -0
  27. package/dist/ai/magic-wand-dropdown.d.ts +7 -0
  28. package/dist/ai/messages/chart-message-toolbar.d.ts +8 -0
  29. package/dist/ai/messages/chart-message.d.ts +8 -0
  30. package/dist/ai/messages/clear-history-message.d.ts +6 -0
  31. package/dist/ai/messages/get-widget-options.d.ts +13 -0
  32. package/dist/ai/messages/insights-message.d.ts +10 -0
  33. package/dist/ai/messages/jaql-element.d.ts +25 -0
  34. package/dist/ai/messages/message-list-resolver.d.ts +7 -0
  35. package/dist/ai/messages/message-resolver.d.ts +11 -0
  36. package/dist/ai/messages/text-message.d.ts +8 -0
  37. package/dist/ai/nav-back-button.d.ts +6 -0
  38. package/dist/ai/nlg-query-result.d.ts +20 -0
  39. package/dist/ai/suggestions/index.d.ts +4 -0
  40. package/dist/ai/suggestions/suggestion-dropdown-item.d.ts +7 -0
  41. package/dist/ai/suggestions/suggestion-dropdown-list.d.ts +7 -0
  42. package/dist/ai/suggestions/suggestion-item.d.ts +7 -0
  43. package/dist/ai/suggestions/suggestion-list-skeleton.d.ts +2 -0
  44. package/dist/ai/suggestions/suggestion-list.d.ts +7 -0
  45. package/dist/ai/suggestions/suggestions-with-intro.d.ts +8 -0
  46. package/dist/ai/toolbar.d.ts +8 -0
  47. package/dist/ai/use-chat-session.d.ts +22 -0
  48. package/dist/ai.d.ts +1 -0
  49. package/dist/ai.js +3390 -0
  50. package/dist/api/types/dashboard-dto.d.ts +2 -1
  51. package/dist/charts/indicator/chart/indicator.d.ts +1 -1
  52. package/dist/charts/indicator/chart/ticker.d.ts +2 -2
  53. package/dist/charts/indicator/indicator-legacy-chart-options/default-options.d.ts +2 -1
  54. package/dist/charts/indicator/types.d.ts +47 -6
  55. package/dist/common/components/loading-indicator.d.ts +33 -0
  56. package/dist/common/icons/loading-icon.d.ts +6 -0
  57. package/dist/dashboard-widget/translate-dashboard-filters.d.ts +2 -2
  58. package/dist/dashboard-widget/translate-widget-data-options.d.ts +2 -2
  59. package/dist/dashboard-widget/translate-widget-filters.d.ts +4 -16
  60. package/dist/dashboard-widget/types.d.ts +1 -54
  61. package/dist/dashboard-widget/utils.d.ts +2 -2
  62. package/dist/filters/components/common/index.d.ts +2 -0
  63. package/dist/filters/components/common/triangle-indicator.d.ts +2 -0
  64. package/dist/filters/components/criteria-filter-tile/criteria-filter-display.d.ts +25 -0
  65. package/dist/filters/components/criteria-filter-tile/criteria-filter-menu.d.ts +20 -0
  66. package/dist/filters/components/criteria-filter-tile/criteria-filter-operations.d.ts +62 -0
  67. package/dist/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +27 -0
  68. package/dist/filters/components/criteria-filter-tile/index.d.ts +2 -0
  69. package/dist/filters/components/date-filter/date-filter/date-filter.d.ts +4 -0
  70. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +11 -3
  71. package/dist/filters/components/date-filter/date-range-filter-tile/use-date-limits.d.ts +2 -2
  72. package/dist/filters/components/filter-tile.d.ts +3 -0
  73. package/dist/filters/components/member-filter-tile/basic-member-filter-tile.d.ts +2 -0
  74. package/dist/filters/components/member-filter-tile/member-filter-tile.d.ts +3 -1
  75. package/dist/filters/index.d.ts +1 -0
  76. package/dist/formulas/fetch-formula.d.ts +16 -0
  77. package/dist/formulas/index.d.ts +1 -0
  78. package/dist/formulas/use-get-shared-formula.d.ts +95 -0
  79. package/dist/index.d.ts +2 -1
  80. package/dist/index.js +8180 -71481
  81. package/dist/models/dashboard/get-dashboard-models.d.ts +1 -1
  82. package/dist/models/dashboard/use-get-dashboard-model.d.ts +1 -1
  83. package/dist/props.d.ts +30 -11
  84. package/dist/table-widget-7b20ecf7.js +64167 -0
  85. package/dist/themes/colors.d.ts +86 -0
  86. package/dist/translation/resources/en.d.ts +25 -0
  87. package/dist/translation/resources/index.d.ts +50 -0
  88. package/dist/types.d.ts +6 -0
  89. package/dist/widgets/common/widget-header-info-button.d.ts +8 -0
  90. package/dist/widgets/common/widget-header.d.ts +1 -1
  91. package/package.json +18 -8
@@ -1,4 +1,5 @@
1
- import { WidgetDto, Datasource, FilterJaql } from '../../dashboard-widget/types';
1
+ import { WidgetDto, Datasource } from '../../dashboard-widget/types';
2
+ import { FilterJaql } from '@sisense/sdk-data';
2
3
  export type Filter = {
3
4
  isCascading?: false;
4
5
  jaql: FilterJaql;
@@ -35,5 +35,5 @@ export declare class Indicator {
35
35
  * @param {object} options
36
36
  * @param {string} size
37
37
  */
38
- setTextOptions(options: LegacyIndicatorChartOptions, size: string): void;
38
+ setTextOptions(options: LegacyIndicatorChartOptions, size?: string): void;
39
39
  }
@@ -1,5 +1,5 @@
1
1
  import { IndicatorLegacyChartDataOptions } from '../indicator-legacy-chart-data-options';
2
- import { LegacyIndicatorChartOptions } from '../types';
2
+ import { LegacyIndicatorChartOptions, TickerOptions } from '../types';
3
3
  export declare class Ticker {
4
4
  /**
5
5
  * Renders indicator ticker widget.
@@ -9,7 +9,7 @@ export declare class Ticker {
9
9
  * @param {object} options
10
10
  * @param {HTMLElement} container
11
11
  */
12
- render(canvas: HTMLCanvasElement, data: IndicatorLegacyChartDataOptions, options: LegacyIndicatorChartOptions | any, container: HTMLElement): void;
12
+ render(canvas: HTMLCanvasElement, data: IndicatorLegacyChartDataOptions, options: TickerOptions, container: HTMLElement): void;
13
13
  /**
14
14
  * Draws indicator ticker widget.
15
15
  *
@@ -1,4 +1,5 @@
1
- import { NumericSimpleOptions, NumericBarOptions, GaugeOptions } from '../types';
1
+ import { NumericSimpleOptions, NumericBarOptions, GaugeOptions, TickerOptions } from '../types';
2
2
  export declare const defaultNumericSimpleOptions: NumericSimpleOptions;
3
3
  export declare const defaultNumericBarOptions: NumericBarOptions;
4
4
  export declare const defaultGaugeOptions: GaugeOptions;
5
+ export declare const defaultTickerOptions: TickerOptions;
@@ -32,20 +32,21 @@ type CommonOptions = {
32
32
  fontFamily: string;
33
33
  title: {
34
34
  color: string;
35
- fontSizes: FontSizes;
35
+ fontSizes?: FontSizes;
36
36
  };
37
37
  value: {
38
38
  color?: string;
39
- fontSizes: FontSizes;
39
+ fontSizes?: FontSizes;
40
+ fontWeight?: number;
40
41
  };
41
42
  secondaryTitle: {
42
43
  color: string;
43
- fontSizes: FontSizes;
44
+ fontSizes?: FontSizes;
44
45
  };
45
46
  secondaryValue: {
46
- fontWeight: number;
47
+ fontWeight?: number;
47
48
  color: string;
48
- fontSizes: FontSizes;
49
+ fontSizes?: FontSizes;
49
50
  };
50
51
  textKeys: string[];
51
52
  backgroundColor: string;
@@ -114,5 +115,45 @@ export type GaugeOptions = CommonOptions & {
114
115
  gaugeHeights: BaseMeasure[];
115
116
  measureKeys: string[];
116
117
  };
117
- export type LegacyIndicatorChartOptions = NumericBarOptions | NumericSimpleOptions | GaugeOptions;
118
+ export type TickerOptions = CommonOptions & {
119
+ fontSize: number;
120
+ dividerColor: string;
121
+ barHandleColor: string;
122
+ height: number;
123
+ horizontalMargin: number;
124
+ barWidth: number;
125
+ barHeight: number;
126
+ barOpacity: number;
127
+ tickerBarWidth: number;
128
+ tickerBarHeight: number;
129
+ horizontalPadding: number;
130
+ textPadding: number;
131
+ sectionMinWidth: number;
132
+ dividerWidth: number;
133
+ dividerHeight: number;
134
+ valueFont?: string;
135
+ titleFont?: string;
136
+ secondaryValueFont?: string;
137
+ secondaryTitleFont?: string;
138
+ offsetX?: number;
139
+ showTickerBar?: boolean;
140
+ fitValueMeasure?: {
141
+ string: string;
142
+ width: number;
143
+ };
144
+ fitSecValueMeasure?: {
145
+ string: string;
146
+ width: number;
147
+ };
148
+ fitSecTitleMeasure?: {
149
+ string: string;
150
+ width: number;
151
+ };
152
+ fitTitleMeasure?: {
153
+ string: string;
154
+ width: number;
155
+ };
156
+ width?: number;
157
+ };
158
+ export type LegacyIndicatorChartOptions = NumericBarOptions | NumericSimpleOptions | GaugeOptions | TickerOptions;
118
159
  export {};
@@ -0,0 +1,33 @@
1
+ /// <reference types="react" />
2
+ import { CompleteThemeSettings } from '../../types';
3
+ /**
4
+ * Component that displays a loading indicator.
5
+ *
6
+ * @param onCancel - Function to call when cancel is clicked.
7
+ * @returns A loading indicator with optional cancel.
8
+ */
9
+ export declare const LoadingIndicator: ({ themeSettings, onCancel, }: {
10
+ themeSettings?: {
11
+ chart: {
12
+ textColor: string;
13
+ secondaryTextColor: string;
14
+ backgroundColor: string;
15
+ panelBackgroundColor: string;
16
+ };
17
+ palette: {
18
+ variantColors: import("../../types").Color[];
19
+ };
20
+ typography: {
21
+ fontFamily: string;
22
+ primaryTextColor: string;
23
+ secondaryTextColor: string;
24
+ };
25
+ general: {
26
+ brandColor: string;
27
+ backgroundColor: string;
28
+ primaryButtonTextColor: string;
29
+ primaryButtonHoverColor: string;
30
+ };
31
+ } | undefined;
32
+ onCancel?: (() => void) | undefined;
33
+ }) => JSX.Element;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ type LoadingIconProps = {
3
+ spin?: boolean;
4
+ };
5
+ export default function LoadingIcon({ spin }: LoadingIconProps): JSX.Element;
6
+ export {};
@@ -8,6 +8,6 @@ import { WidgetDto } from './types';
8
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
- filters: import("packages/sdk-data/dist").Filter[];
12
- highlights: import("packages/sdk-data/dist").Filter[];
11
+ filters: import("@sisense/sdk-data").Filter[];
12
+ highlights: import("@sisense/sdk-data").Filter[];
13
13
  };
@@ -1,6 +1,6 @@
1
- import { DimensionalBaseMeasure, DimensionalAttribute, DimensionalCalculatedMeasure } from '@sisense/sdk-data';
1
+ import { DimensionalBaseMeasure, DimensionalAttribute, DimensionalCalculatedMeasure, Jaql } from '@sisense/sdk-data';
2
2
  import { CategoricalChartDataOptions, ScatterChartDataOptions, IndicatorDataOptions, StyledMeasureColumn, StyledColumn, CompleteThemeSettings } from '../types';
3
- import { Panel, PanelItem, Jaql, WidgetType } from './types';
3
+ import { Panel, PanelItem, WidgetType } from './types';
4
4
  import { TableDataOptions } from '../chart-data-options/types';
5
5
  export declare function createDimensionalElementFromJaql(jaql: Jaql, format?: PanelItem['format']): import("@sisense/sdk-data").Filter | DimensionalCalculatedMeasure | DimensionalBaseMeasure | DimensionalAttribute;
6
6
  export declare function createDataColumn(item: PanelItem, themeSettings?: CompleteThemeSettings): StyledMeasureColumn | StyledColumn;
@@ -1,5 +1,5 @@
1
- import { Filter } from '@sisense/sdk-data';
2
- import { FilterJaql, Panel } from './types';
1
+ import { Filter, FilterJaql } from '@sisense/sdk-data';
2
+ import { Panel } from './types';
3
3
  /**
4
4
  * Extracts filter model components from a FilterJaql object.
5
5
  *
@@ -16,20 +16,8 @@ export declare function extractFilterModelFromJaql(jaql: FilterJaql): {
16
16
  members: string[];
17
17
  };
18
18
  };
19
- backgroundFilter: import("./types").BackgroundFilter | ({
20
- exclude: {
21
- members: string[];
22
- };
23
- } & {
24
- turnedOff: boolean;
25
- }) | undefined;
26
- turnOffMembersFilter: ({
27
- exclude: {
28
- members: string[];
29
- };
30
- } & {
31
- turnedOff: boolean;
32
- }) | undefined;
19
+ backgroundFilter: import("@sisense/sdk-data").BackgroundFilter | import("@sisense/sdk-data").TurnOffMembersFilter | undefined;
20
+ turnOffMembersFilter: import("@sisense/sdk-data").TurnOffMembersFilter | undefined;
33
21
  };
34
22
  /**
35
23
  * Creates a Filter from a FilterJaql object.
@@ -1,3 +1,4 @@
1
+ import { Jaql, SortDirection } from '@sisense/sdk-data';
1
2
  export declare const enum WidgetType {
2
3
  PieChart = "chart/pie",
3
4
  ColumnChart = "chart/column",
@@ -51,64 +52,10 @@ export type FiltersIgnoringRules = {
51
52
  ids: string[];
52
53
  all: boolean;
53
54
  };
54
- export declare const enum DataType {
55
- TEXT = "text",
56
- NUMERIC = "numeric",
57
- DATETIME = "datetime"
58
- }
59
55
  export type Panel = {
60
56
  name: string;
61
57
  items: PanelItem[];
62
58
  };
63
- export declare enum SortDirection {
64
- ASC = "asc",
65
- DESC = "desc"
66
- }
67
- export type BaseJaql = {
68
- agg?: string;
69
- datatype: DataType;
70
- dim: string;
71
- table: string;
72
- column: string;
73
- title: string;
74
- level?: 'years' | 'quarters' | 'months' | 'weeks' | 'minutes' | 'days';
75
- sort?: SortDirection;
76
- };
77
- type FormulaID = string;
78
- type FormulaContext = BaseJaql | FilterJaql;
79
- export type FormulaJaql = {
80
- type?: 'measure';
81
- sort?: SortDirection;
82
- title: string;
83
- formula: string;
84
- context?: Record<FormulaID, FormulaContext>;
85
- };
86
- export type IncludeAllFilter = {
87
- all: true;
88
- };
89
- export type IncludeMembersFilter = {
90
- members: string[];
91
- };
92
- type ExcludeMembersFilter = {
93
- exclude: {
94
- members: string[];
95
- };
96
- };
97
- export type MembersFilter = IncludeMembersFilter | ExcludeMembersFilter;
98
- type BaseFilter = IncludeAllFilter | MembersFilter;
99
- export type BackgroundFilter = BaseFilter & {
100
- level?: 'string';
101
- };
102
- type TurnOffMembersFilter = ExcludeMembersFilter & {
103
- turnedOff: boolean;
104
- };
105
- type Filter = BaseFilter & {
106
- filter?: BackgroundFilter | TurnOffMembersFilter;
107
- };
108
- export type FilterJaql = BaseJaql & {
109
- filter: Filter;
110
- };
111
- export type Jaql = BaseJaql | FormulaJaql | FilterJaql;
112
59
  type SeriesType = 'auto' | 'line' | 'spline' | 'areaspline' | 'bar' | 'area' | 'column';
113
60
  interface DecimalAbbreviations {
114
61
  k: boolean;
@@ -1,7 +1,7 @@
1
- import { type Filter } from '@sisense/sdk-data';
1
+ import { type Filter, SortDirection as JaqlSortDirection } from '@sisense/sdk-data';
2
2
  import { ChartSubtype } from '../chart-options-processor/subtype-to-design-options';
3
3
  import { ChartType, SortDirection } from '../types';
4
- import { FiltersMergeStrategy, Panel, PanelItem, SortDirection as JaqlSortDirection, WidgetSubtype, WidgetType } from './types';
4
+ import { FiltersMergeStrategy, Panel, PanelItem, WidgetSubtype, WidgetType } from './types';
5
5
  export declare function getChartType(widgetType: WidgetType): ChartType;
6
6
  export declare function getChartSubtype(widgetSubtype: WidgetSubtype): ChartSubtype | undefined;
7
7
  type WidgetTypeOrString = string | WidgetType;
@@ -4,3 +4,5 @@ export { BasicInput } from './basic-input';
4
4
  export { Input } from './input';
5
5
  export { Radio } from './radio';
6
6
  export { SisenseSwitchButton } from './switch';
7
+ export { TriangleIndicator } from './triangle-indicator';
8
+ export { DateRangeFieldButton } from './date-range-field-button';
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const TriangleIndicator: () => JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { FilterOptionType } from './criteria-filter-operations.js';
3
+ /**
4
+ * Props for {@link CriteriaFilterDisplay}
5
+ */
6
+ export interface CriteriaFilterDisplayProps {
7
+ filterType: FilterOptionType;
8
+ values?: (number | string)[];
9
+ }
10
+ /**
11
+ * UI component that provides a static, uneditable display of the criteria filter values, to be shown when vertically aligned filter tiles are collapsed.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * return (
16
+ * <CriteriaFilterDisplay
17
+ * filterType={FilterOption.BETWEEN}
18
+ * values={[0, 100]}
19
+ * />
20
+ * );
21
+ * ```
22
+ * @param props - Criteria filter menu props
23
+ * @returns Criteria filter menu component
24
+ */
25
+ export declare const CriteriaFilterDisplay: FunctionComponent<CriteriaFilterDisplayProps>;
@@ -0,0 +1,20 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { FilterOptionType, FilterVariant } from './criteria-filter-operations';
3
+ /**
4
+ * Props for {@link CriteriaFilterMenu}
5
+ *
6
+ * @internal
7
+ */
8
+ export interface CriteriaFilterMenuProps {
9
+ filterType: FilterOptionType;
10
+ arrangement?: FilterVariant;
11
+ defaultValues?: (number | string)[];
12
+ onUpdate?: (values: (number | string)[]) => void;
13
+ disabled?: boolean;
14
+ }
15
+ /**
16
+ * UI component that provides field(s) for the user to enter values for a numeric filter.
17
+ *
18
+ * @internal
19
+ */
20
+ export declare const CriteriaFilterMenu: FunctionComponent<CriteriaFilterMenuProps>;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Collection of filter options for the {@link CriteriaFilterMenu},
3
+ * to be provided to subcomponents as the `filterType` prop.
4
+ *
5
+ * @internal
6
+ */
7
+ export declare const FilterOption: {
8
+ BETWEEN: string;
9
+ EQUALS: string;
10
+ NOT_EQUALS: string;
11
+ LESS_THAN: string;
12
+ LESS_THAN_OR_EQUAL: string;
13
+ GREATER_THAN: string;
14
+ GREATER_THAN_OR_EQUAL: string;
15
+ IS: string;
16
+ IS_NOT: string;
17
+ CONTAINS: string;
18
+ NOT_CONTAIN: string;
19
+ STARTS_WITH: string;
20
+ NOT_STARTS_WITH: string;
21
+ ENDS_WITH: string;
22
+ NOT_ENDS_WITH: string;
23
+ LIKE: string;
24
+ };
25
+ export type FilterOptionType = keyof typeof FilterOption;
26
+ export type FilterVariant = 'vertical' | 'horizontal';
27
+ export type FilterInputType = 'text' | 'number';
28
+ /**
29
+ * Object containing related information for a filter option,
30
+ * including the function to be used for filtering, the number of inputs,
31
+ * and the symbols to be displayed in the UI as field labels.
32
+ * Ranked indicates whether the filter is ranked (e.g. Top 10).
33
+ *
34
+ * @internal
35
+ */
36
+ export type FilterInfo = {
37
+ fn: Function;
38
+ inputCount: number;
39
+ symbols: string[];
40
+ message: string;
41
+ ranked: boolean;
42
+ type: FilterInputType;
43
+ };
44
+ /**
45
+ * Map of {@link FilterOption} to {@link FilterInfo}
46
+ * for each type of filter available.
47
+ *
48
+ * @internal
49
+ */
50
+ export declare const CRITERIA_FILTER_MAP: {
51
+ [key: string]: FilterInfo;
52
+ };
53
+ /**
54
+ * Determines whether the arrangement of the filter menu is vertical.
55
+ *
56
+ * @param arrangement - Arrangement of the filter menu
57
+ * @returns True if the arrangement is vertical, false otherwise
58
+ * @internal
59
+ */
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 translatedMsgNoVal: (message: string, t: Function) => any;
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import { FilterVariant } from './criteria-filter-operations.js';
3
+ import { Filter, NumericFilter, TextFilter } from '@sisense/sdk-data';
4
+ /**
5
+ * Props for {@link CriteriaFilterTile}
6
+ */
7
+ export interface CriteriaFilterTileProps {
8
+ /** Title for the filter tile, which is rendered into the header */
9
+ title: string;
10
+ /** Text or numeric filter object to initialize filter type and default values */
11
+ filter: CriteriaFilterType;
12
+ /** Arrangement of the filter inputs. Use vertical for standard filter tiles and horizontal for toolbars */
13
+ arrangement?: FilterVariant;
14
+ /** Callback returning filter object, or null for failure */
15
+ onUpdate: (filter: Filter | null) => void;
16
+ }
17
+ export type CriteriaFilterType = NumericFilter | TextFilter;
18
+ /**
19
+ * 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}.
21
+ *
22
+ * 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
+ *
24
+ * @param props - Criteria filter tile props
25
+ * @returns Criteria filter tile component
26
+ */
27
+ export declare const CriteriaFilterTile: import("react").FunctionComponent<CriteriaFilterTileProps>;
@@ -0,0 +1,2 @@
1
+ export { CriteriaFilterTile, type CriteriaFilterTileProps, type CriteriaFilterType, } from './criteria-filter-tile';
2
+ export { type FilterVariant } from './criteria-filter-operations';
@@ -24,6 +24,10 @@ export type DateRangeFilterProps = {
24
24
  maxDate: string;
25
25
  minDate: string;
26
26
  };
27
+ /**
28
+ * Whether this is a dependent filter.
29
+ */
30
+ isDependent?: boolean;
27
31
  };
28
32
  /**
29
33
  * Date Filter component for filtering data by date range.
@@ -2,7 +2,7 @@
2
2
  import { LevelAttribute, DataSource, Filter } from '@sisense/sdk-data';
3
3
  export interface DateRangeFilterTileProps {
4
4
  /**
5
- * Title of the filter tile
5
+ * Filter tile title
6
6
  */
7
7
  title: string;
8
8
  /**
@@ -20,11 +20,15 @@ export interface DateRangeFilterTileProps {
20
20
  */
21
21
  filter: Filter;
22
22
  /**
23
- * Earliest valid date in date range select. If not specified a query will run.
23
+ * Earliest allowed date for selection.
24
+ *
25
+ * If not specified, the earliest date of the target date-level attribute will be used.
24
26
  */
25
27
  earliestDate?: string;
26
28
  /**
27
- * Last valid date in date range select. If not specified a query will run.
29
+ * Latest allowed date for selection.
30
+ *
31
+ * If not specified, the latest date of the target date-level attribute will be used.
28
32
  */
29
33
  lastDate?: string;
30
34
  /**
@@ -33,6 +37,10 @@ export interface DateRangeFilterTileProps {
33
37
  * @param filter - Date range filter
34
38
  */
35
39
  onChange: (filter: Filter) => void;
40
+ /**
41
+ * List of filters this filter is dependent on.
42
+ */
43
+ parentFilters?: Filter[];
36
44
  }
37
45
  /**
38
46
  * Date Range Filter Tile component for filtering data by date range.
@@ -1,7 +1,7 @@
1
- import { DataSource, LevelAttribute } from '@sisense/sdk-data';
1
+ import { DataSource, Filter, LevelAttribute } from '@sisense/sdk-data';
2
2
  type DateLimits = {
3
3
  minDate?: string;
4
4
  maxDate?: string;
5
5
  };
6
- export declare const useDateLimits: (userLimits: DateLimits, attribute: LevelAttribute, dataSource?: DataSource) => Required<DateLimits> | null;
6
+ export declare const useDateLimits: (userLimits: DateLimits, attribute: LevelAttribute, dataSource?: DataSource, parentFilters?: Filter[]) => Required<DateLimits> | null;
7
7
  export {};
@@ -1,8 +1,11 @@
1
1
  import type { FunctionComponent, ReactNode } from 'react';
2
+ import { FilterVariant } from './criteria-filter-tile/criteria-filter-operations';
2
3
  interface Props {
3
4
  title: string;
4
5
  renderContent: (collapsed: boolean, tileDisabled: boolean) => ReactNode;
6
+ arrangement?: FilterVariant;
5
7
  disabled?: boolean;
8
+ isDependent?: boolean;
6
9
  onToggleDisabled?: () => void;
7
10
  }
8
11
  /**
@@ -16,6 +16,8 @@ export interface BasicMemberFilterTileProps {
16
16
  onUpdateSelectedMembers?: (members: string[]) => void;
17
17
  /** Configurable limit on size of allowedMembers */
18
18
  maxAllowedMembers?: number;
19
+ /** Whether this is a dependent filter */
20
+ isDependent?: boolean;
19
21
  }
20
22
  /**
21
23
  * UI component that, given a list of members to select from and a list of
@@ -12,12 +12,14 @@ export interface MemberFilterTileProps {
12
12
  * If not specified, the query will use the `defaultDataSource` specified in the parent Sisense Context.
13
13
  */
14
14
  dataSource?: DataSource;
15
- /** Attribute to filter on. A query will be run to fetch all this attribute's members */
15
+ /** Attribute to filter on. A query will run to fetch all this attribute's members */
16
16
  attribute: Attribute;
17
17
  /** Source filter object. Caller is responsible for keeping track of filter state */
18
18
  filter: Filter | null;
19
19
  /** Callback indicating when the source member filter object should be updated */
20
20
  onChange: (filter: Filter | null) => void;
21
+ /** List of filters this filter is dependent on */
22
+ parentFilters?: Filter[];
21
23
  }
22
24
  /**
23
25
  * UI component that allows the user to select members to include/exclude in a
@@ -1,2 +1,3 @@
1
1
  export * from './components/member-filter-tile';
2
2
  export * from './components/date-filter';
3
+ export * from './components/criteria-filter-tile';
@@ -0,0 +1,16 @@
1
+ import { ClientApplication } from '../app/client-application.js';
2
+ import { DimensionalCalculatedMeasure } from '@sisense/sdk-data';
3
+ /**
4
+ * Fetch a formula by oid from the default Sisense instance
5
+ *
6
+ * @param oid - Formula identifier in Sisense instance
7
+ * @param app - Client application
8
+ */
9
+ export declare function fetchFormulaByOid(oid: string, app: ClientApplication): Promise<DimensionalCalculatedMeasure | null>;
10
+ /**
11
+ * Fetch a shared formula by name and data source from the Sisense instance
12
+ *
13
+ * @param name - Formula name/title in Sisense instance
14
+ * @param dataSource - Data source in Sisense instance
15
+ */
16
+ export declare function fetchFormula(name: string, dataSource: string, app: ClientApplication): Promise<DimensionalCalculatedMeasure | null>;
@@ -0,0 +1 @@
1
+ export * from './use-get-shared-formula';