@sisense/sdk-ui 1.11.0 → 1.12.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 (72) hide show
  1. package/dist/ai/buttons/thumbs-down-button.d.ts +2 -1
  2. package/dist/ai/buttons/thumbs-up-button.d.ts +2 -1
  3. package/dist/ai/chat-config.d.ts +10 -0
  4. package/dist/ai/chat-dropup.d.ts +2 -1
  5. package/dist/ai/chat-input.d.ts +3 -1
  6. package/dist/ai/common/icon-button.d.ts +2 -3
  7. package/dist/ai/icons/light-bulb-icon.d.ts +1 -3
  8. package/dist/ai/index.d.ts +1 -0
  9. package/dist/ai/messages/clickable-message.d.ts +2 -1
  10. package/dist/ai/messages/feedback-wrapper.d.ts +2 -2
  11. package/dist/ai/messages/text-message.d.ts +5 -0
  12. package/dist/ai/use-last-nlq-response.d.ts +19 -0
  13. package/dist/ai.cjs +454 -0
  14. package/dist/ai.js +1073 -1074
  15. package/dist/api/types/dashboard-dto.d.ts +2 -1
  16. package/dist/app/client-application.d.ts +1 -0
  17. package/dist/chart/helpers/use-chart-renderer-props.d.ts +1 -0
  18. package/dist/chart-options-processor/translations/funnel-plot-options.d.ts +2 -1
  19. package/dist/chart-options-processor/translations/pie-plot-options.d.ts +2 -1
  20. package/dist/common/components/loading-indicator.d.ts +17 -4
  21. package/dist/common/hooks/use-fetch.d.ts +1 -1
  22. package/dist/common/hooks/use-has-changed.d.ts +9 -0
  23. package/dist/common/hooks/use-should-load.d.ts +12 -0
  24. package/dist/dashboard/components/content-panel.d.ts +41 -0
  25. package/dist/dashboard/components/dashboard-container.d.ts +2 -0
  26. package/dist/dashboard/components/dashboard-header.d.ts +2 -0
  27. package/dist/dashboard/components/plugin-service.d.ts +21 -0
  28. package/dist/dashboard/constants.d.ts +2 -0
  29. package/dist/dashboard/dashboard-by-id.d.ts +7 -0
  30. package/dist/dashboard/dashboard.d.ts +8 -0
  31. package/dist/dashboard/types.d.ts +41 -0
  32. package/dist/dashboard/utils.d.ts +5 -0
  33. package/dist/dynamic-size-container/dynamic-size-container.d.ts +8 -0
  34. package/dist/filters/components/common/date-range-field-button.d.ts +3 -6
  35. package/dist/filters/components/date-filter/date-filter/date-filter.d.ts +15 -0
  36. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-display.d.ts +6 -0
  37. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +6 -0
  38. package/dist/filters/components/date-filter/date-range-filter-tile/editable-date-range-filter.d.ts +14 -0
  39. package/dist/filters/components/date-filter/date-range-filter-tile/use-date-limits.d.ts +1 -2
  40. package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +2 -2
  41. package/dist/filters/components/icons/arrow-icon.d.ts +6 -0
  42. package/dist/filters/components/icons/double-arrow-icon.d.ts +6 -0
  43. package/dist/highcharts-memorized.d.ts +1 -1
  44. package/dist/index.cjs +784 -0
  45. package/dist/index.d.ts +1 -0
  46. package/dist/index.js +11798 -11496
  47. package/dist/models/dashboard/dashboard-model.d.ts +62 -0
  48. package/dist/models/dashboard/get-dashboard-model.d.ts +2 -1
  49. package/dist/models/dashboard/get-dashboard-models.d.ts +2 -1
  50. package/dist/models/dashboard/index.d.ts +1 -1
  51. package/dist/models/dashboard/translate-dashboard-utils.d.ts +5 -0
  52. package/dist/models/dashboard/types.d.ts +2 -14
  53. package/dist/models/dashboard/use-get-dashboard-model.d.ts +1 -1
  54. package/dist/models/dashboard/use-get-dashboard-models.d.ts +1 -1
  55. package/dist/query-execution/query-params-comparator.d.ts +1 -7
  56. package/dist/query-execution/use-execute-pivot-query.d.ts +2 -5
  57. package/dist/query-execution/use-execute-query-by-widget-id.d.ts +3 -4
  58. package/dist/translation/resources/en.d.ts +1 -0
  59. package/dist/translation/resources/index.d.ts +2 -0
  60. package/dist/types.d.ts +31 -10
  61. package/dist/{debounce-BbwkW3DX.js → useQuery-0UWck_2A.js} +12729 -12646
  62. package/dist/useQuery-DVHD0kJ-.cjs +603 -0
  63. package/dist/utils/create-cache.d.ts +0 -1
  64. package/dist/utils/utility-types.d.ts +1 -0
  65. package/dist/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +2 -2
  66. package/package.json +13 -9
  67. package/dist/ai/icons/thumbs-down-hovered-icon.d.ts +0 -2
  68. package/dist/ai/icons/thumbs-up-hovered-icon.d.ts +0 -2
  69. package/dist/ai/messages/clear-history-success-message.d.ts +0 -1
  70. package/dist/filters/components/icons/arrow-right-icon.d.ts +0 -2
  71. package/dist/filters/components/icons/double-arrow-right-icon.d.ts +0 -2
  72. package/dist/models/dashboard/translate-dashboard.d.ts +0 -4
@@ -5,7 +5,7 @@ import { AnyObject } from '../../utils/utility-types';
5
5
  export type Layout = {
6
6
  columns: {
7
7
  width: number;
8
- cells: {
8
+ cells?: {
9
9
  subcells: {
10
10
  width: number;
11
11
  elements: {
@@ -28,6 +28,7 @@ export type CascadingFilterDto = {
28
28
  instanceid?: string;
29
29
  disabled?: boolean;
30
30
  };
31
+ export declare const isCascadingFilterDto: (filter: FilterDto | CascadingFilterDto) => filter is CascadingFilterDto;
31
32
  export type DashboardDto = {
32
33
  oid: string;
33
34
  title: string;
@@ -43,6 +43,7 @@ export type AppConfig = {
43
43
  };
44
44
  /**
45
45
  * Query limit (max rows count that will be fetched in query)
46
+ *
46
47
  * @default 20000
47
48
  */
48
49
  queryLimit?: number;
@@ -19,6 +19,7 @@ type UnpreparedInternalChartProps = {
19
19
  };
20
20
  /**
21
21
  * Prepares the props for the chart renderer.
22
+ *
22
23
  * @param internalProps - unprepared internal chart props.
23
24
  * @returns Chart renderer props or null if the chart props is not ready yet
24
25
  * @internal
@@ -1,5 +1,6 @@
1
1
  import { PlotOptions } from '../chart-options-service';
2
2
  import { ValueLabelSettings } from './value-label-section';
3
+ import { CompleteThemeSettings } from '../../types';
3
4
  import { FunnelChartDesignOptions } from './design-options';
4
5
  import { ChartDataOptionsInternal } from '../../chart-data-options/types';
5
6
  export declare const DefaultFunnelLabels: FunnelLabels;
@@ -50,4 +51,4 @@ export declare const DEFAULT_SHIFT = 50;
50
51
  export declare const funnelWidthPercentage: (renderTo: RenderTo | null) => number;
51
52
  export declare const funnelNeckWidth: (widthPercentage: number, funnelSize: FunnelSize) => number;
52
53
  export declare const funnelNeckHeight: (type: FunnelType) => number;
53
- export declare const getFunnelPlotOptions: (funnelDesignOptions: FunnelChartDesignOptions, chartDataOptions: ChartDataOptionsInternal) => PlotOptions;
54
+ export declare const getFunnelPlotOptions: (funnelDesignOptions: FunnelChartDesignOptions, chartDataOptions: ChartDataOptionsInternal, themeSettings?: CompleteThemeSettings) => PlotOptions;
@@ -1,6 +1,7 @@
1
1
  import { PlotOptions } from '../chart-options-service';
2
2
  import { ValueLabelSettings } from './value-label-section';
3
3
  import { ChartDataOptionsInternal } from '../../chart-data-options/types';
4
+ import { CompleteThemeSettings } from '../../types';
4
5
  export declare const DefaultPieLabels: PieLabels;
5
6
  export type PieLabels = {
6
7
  enabled: boolean;
@@ -25,5 +26,5 @@ export type PieOptions = {
25
26
  innerSize?: InnerSize;
26
27
  };
27
28
  type InnerSize = '0%' | '40%' | '80%';
28
- export declare const getPiePlotOptions: (pieType: "classic" | "donut" | "ring" | undefined, pieLabels: PieLabels | undefined, chartDataOptions: ChartDataOptionsInternal) => PlotOptions;
29
+ export declare const getPiePlotOptions: (pieType: "classic" | "donut" | "ring" | undefined, pieLabels: PieLabels | undefined, chartDataOptions: ChartDataOptionsInternal, themeSettings?: CompleteThemeSettings) => PlotOptions;
29
30
  export {};
@@ -89,27 +89,40 @@ export declare const LoadingIndicator: ({ themeSettings, onCancel, }: {
89
89
  borderGradient: [string, string] | null;
90
90
  borderRadius: string;
91
91
  hover: {
92
- backgroundColor: string;
93
92
  textColor: string;
93
+ backgroundColor: string;
94
94
  };
95
95
  loadingGradient: [string, string];
96
96
  gap: string;
97
97
  };
98
98
  clickableMessages: {
99
- backgroundColor: string;
100
99
  textColor: string;
100
+ backgroundColor: string;
101
101
  border: string | false;
102
+ borderGradient: [string, string] | null;
102
103
  hover: {
103
104
  textColor: string;
104
105
  backgroundColor: string;
105
106
  };
106
107
  };
108
+ dataTopics: {
109
+ backgroundColor: string;
110
+ items: {
111
+ textColor: string;
112
+ backgroundColor: string;
113
+ };
114
+ };
107
115
  icons: {
108
116
  color: string;
109
- hover: {
110
- color: string;
117
+ feedbackIcons: {
118
+ hoverColor: string;
111
119
  };
112
120
  };
121
+ tooltips: {
122
+ backgroundColor: string;
123
+ textColor: string;
124
+ boxShadow: string;
125
+ };
113
126
  };
114
127
  } | undefined;
115
128
  onCancel?: (() => void) | undefined;
@@ -15,8 +15,8 @@ export type RequestConfig = {
15
15
  /**
16
16
  * The result of the `useFetch` hook.
17
17
  * Return value of the `useQuery` hook from `@tanstack/react-query`.
18
- * @link https://tanstack.com/query/v4/docs/framework/react/reference/useQuery
19
18
  *
19
+ * @link https://tanstack.com/query/v4/docs/framework/react/reference/useQuery
20
20
  * @template TData - The type of the data returned by the fetch request
21
21
  * @template TError - The type of the error returned by the fetch request
22
22
  */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Hook that returns if a value from the previous render has changed.
3
+ *
4
+ * @param value - Value for the current render.
5
+ * @param propNames - Names of keys to compare.
6
+ * @param [compare] - Optional comparison function
7
+ * @returns Has the value changed or not.
8
+ */
9
+ export declare function useHasChanged<T>(value: T, propNames: Array<keyof T>, compare?: (value: T, prev: T) => boolean): boolean;
@@ -0,0 +1,12 @@
1
+ import { ClientApplication } from '../../app/client-application.js';
2
+ /**
3
+ * Hook that generates a function for testing whether or not load
4
+ * should be performed for this render
5
+ *
6
+ * @param params - the component or hook params object
7
+ * @param isParamsChanged - have the params changed from previous invocation
8
+ * @returns generated render checking function
9
+ */
10
+ export declare function useShouldLoad<T extends {
11
+ enabled?: boolean;
12
+ }>({ enabled }: T, isParamsChanged: boolean): (app: ClientApplication | undefined, force?: boolean) => app is ClientApplication;
@@ -0,0 +1,41 @@
1
+ import { Layout, WidgetModel } from '../../models';
2
+ /**
3
+ * Props for the {@link ContentPanel} component.
4
+ *
5
+ * @internal
6
+ */
7
+ export interface ContentPanelProps {
8
+ /**
9
+ * An object defining how the widgets should be laid out.
10
+ */
11
+ layout: Layout;
12
+ /**
13
+ * A list of widget models to render.
14
+ */
15
+ widgets: WidgetModel[];
16
+ }
17
+ /**
18
+ * A React component used for rendering a layout of widgets.
19
+ *
20
+ * @example
21
+ * Example of using the component with the useGetDashboardModel hook:
22
+ * ```tsx
23
+ * const { dashboard, isLoading, isError } = useGetDashboardModel({
24
+ * dashboardOid: 'dashboard-oid',
25
+ * includeWidgets: true,
26
+ * });
27
+ *
28
+ * const { layout, widgets } = dashboard;
29
+ * if (!layout || !widgets) return null;
30
+ *
31
+ * return (
32
+ * <ContentPanel
33
+ * layout={layout}
34
+ * widgets={widgets}
35
+ * />
36
+ * );
37
+ * ```
38
+ * @param props - {@link ContentPanelProps}
39
+ * @internal
40
+ */
41
+ export declare const ContentPanel: ({ layout, widgets }: ContentPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { DashboardLayoutProps } from '../../dashboard/types';
2
+ export declare const DashboardContainer: ({ title, layout, widgets, filters, onFiltersChange, }: DashboardLayoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { DashboardHeaderProps } from '../../dashboard/types';
2
+ export declare const DashboardHeader: ({ title }: DashboardHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { WidgetModel } from '../../models';
2
+ import { CompleteThemeSettings } from '../../types';
3
+ /**
4
+ * @internal
5
+ */
6
+ export type ReactWidgetPlugin<P = {}> = {
7
+ name: string;
8
+ Plugin: any;
9
+ createChartProps(w: WidgetModel, themeSettings: CompleteThemeSettings): P;
10
+ };
11
+ /**
12
+ * POC - singleton plugin store. A widget from a Fusion dashboard can use this
13
+ * store to look up and render a chart from a third-party plugin that matches its type.
14
+ *
15
+ * @internal
16
+ */
17
+ export declare class PluginService {
18
+ static pluginMap: Map<string, ReactWidgetPlugin<{}>>;
19
+ static get(pluginType: string): ReactWidgetPlugin | undefined;
20
+ static register(pluginType: string, plugin: ReactWidgetPlugin): void;
21
+ }
@@ -0,0 +1,2 @@
1
+ export declare const DASHBOARD_DIVIDER_COLOR = "#d5d5d5";
2
+ export declare const DASHBOARD_DIVIDER_WIDTH = 1;
@@ -0,0 +1,7 @@
1
+ import { DashboardByIdProps } from './types';
2
+ /**
3
+ * React component that renders a dashboard created in Sisense Fusion Embed
4
+ *
5
+ * @internal
6
+ */
7
+ export declare const DashboardById: ({ dashboardOid }: DashboardByIdProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { DashboardProps } from '../dashboard/types';
2
+ /**
3
+ * React component that renders a dashboard
4
+ * Include inside logic of applying common filters to widgets
5
+ *
6
+ * @internal
7
+ */
8
+ export declare const Dashboard: ({ title, layout, widgets, filters }: DashboardProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { Layout, WidgetModel } from '../models';
2
+ import { Filter } from '@sisense/sdk-data';
3
+ /**
4
+ * Props for the DashboardById component
5
+ *
6
+ * @internal
7
+ */
8
+ export interface DashboardByIdProps {
9
+ dashboardOid: string;
10
+ }
11
+ /**
12
+ * Props for the DashboardLayout component
13
+ *
14
+ * @internal
15
+ */
16
+ export interface DashboardLayoutProps {
17
+ title: string;
18
+ layout: Layout;
19
+ widgets: WidgetModel[];
20
+ filters: Filter[];
21
+ onFiltersChange: (filters: Filter[]) => void;
22
+ }
23
+ /**
24
+ * Props for the Dashboard component
25
+ *
26
+ * @internal
27
+ */
28
+ export interface DashboardProps {
29
+ title: string;
30
+ layout: Layout;
31
+ widgets: WidgetModel[];
32
+ filters: Filter[];
33
+ }
34
+ /**
35
+ * Props for the Dashboard Header component
36
+ *
37
+ * @internal
38
+ */
39
+ export interface DashboardHeaderProps {
40
+ title: string;
41
+ }
@@ -0,0 +1,5 @@
1
+ import { Filter } from '@sisense/sdk-data';
2
+ import { WidgetModel } from '../models';
3
+ export declare function isSupportedWidgetTypeByDashboard(widgetType: string): boolean;
4
+ export declare function addFiltersToWidget(widget: WidgetModel, filters: Filter[]): WidgetModel;
5
+ export declare const getDividerStyle: (color: string, width: number) => string;
@@ -24,7 +24,15 @@ export type DynamicSizeContainerProps = {
24
24
  * (3) Then the container's size is used.
25
25
  * (4) Otherwise the "defaultSize" is used.
26
26
  *
27
+ * Component Structure:
28
+ * The component layout consists of multiple layers to address different requirements:
29
+ * - Container layer: The top `div` that handles inheriting the parent size.
30
+ * - Content layer: The middle `div` that represents the actual content size.
31
+ * - Detached content layer: The bottom `div` that detaches the internal content (using "absolute" positioning) from the layout to prevent the parent layout from being constrained by its content size.
27
32
  *
33
+ * Limitations:
34
+ * - It is not possible to determine if a parent element has no size to inherit or if its size has been explicitly set to "0px".
35
+ * Therefore, the default size will be applied when the parent element's size is set to "0px".
28
36
  *
29
37
  * @param {DynamicSizeContainerProps} props - DynamicSizeContainer properties.
30
38
  * @returns {JSX.Element} The DynamicSizeContainer component.
@@ -1,14 +1,11 @@
1
- import { CompleteThemeSettings } from '../../../types';
2
1
  import { type FunctionComponent, type ButtonHTMLAttributes } from 'react';
3
- type Variant = 'white' | 'grey';
2
+ import { Themable } from '../../../theme-provider/types';
3
+ export type Variant = 'white' | 'grey';
4
4
  type InputProps = {
5
5
  variant?: Variant;
6
6
  label?: string;
7
7
  isActive?: boolean;
8
8
  } & ButtonHTMLAttributes<HTMLButtonElement>;
9
- type ThemeMixin = {
10
- theme: CompleteThemeSettings;
11
- };
12
- export type DateRangeFieldButtonProps = InputProps & ThemeMixin;
9
+ export type DateRangeFieldButtonProps = InputProps & Themable;
13
10
  export declare const DateRangeFieldButton: FunctionComponent<DateRangeFieldButtonProps>;
14
11
  export {};
@@ -27,6 +27,21 @@ export type DateRangeFilterProps = {
27
27
  * Whether this is a dependent filter.
28
28
  */
29
29
  isDependent?: boolean;
30
+ /**
31
+ * The variant of the date range field button.
32
+ * To be compatible with the old DateRangeFilterTile.
33
+ *
34
+ * TODO: Remove this prop when the old DateRangeFilterTile is deprecated.
35
+ * @internal
36
+ * @default 'grey'
37
+ */
38
+ variant?: 'white' | 'grey';
39
+ /**
40
+ * Whether the filter is disabled.
41
+ *
42
+ * @internal
43
+ */
44
+ disabled?: boolean;
30
45
  };
31
46
  /**
32
47
  * Date Filter component for filtering data by date range.
@@ -0,0 +1,6 @@
1
+ import { DateRangeFilter } from '@sisense/sdk-data';
2
+ type DateRangeFilterDisplayProps = {
3
+ filter: DateRangeFilter;
4
+ };
5
+ export declare const DateRangeFilterDisplay: (props: DateRangeFilterDisplayProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -41,6 +41,12 @@ export interface DateRangeFilterTileProps {
41
41
  * List of filters this filter is dependent on.
42
42
  */
43
43
  parentFilters?: Filter[];
44
+ /**
45
+ * Whether to display the filter as a tiled version.
46
+ * @default false
47
+ * @internal
48
+ */
49
+ tiled?: boolean;
44
50
  }
45
51
  /**
46
52
  * Date Range Filter Tile component for filtering data by date range.
@@ -0,0 +1,14 @@
1
+ import { DateRangeFilter } from '@sisense/sdk-data';
2
+ import type { DateRangeFilterTileProps } from './date-range-filter-tile';
3
+ import { DateLimits } from './use-date-limits';
4
+ type EditableDateRangeFilterProps = DateRangeFilterTileProps & {
5
+ filter: DateRangeFilter;
6
+ dateLimits: Required<DateLimits>;
7
+ isOldDateRangeFilterTile?: boolean;
8
+ disabled?: boolean;
9
+ };
10
+ /**
11
+ * Editable Date Range Filter component for filtering data by date range.
12
+ */
13
+ export declare const EditableDateRangeFilter: (props: EditableDateRangeFilterProps) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -1,7 +1,6 @@
1
1
  import { DataSource, Filter, LevelAttribute } from '@sisense/sdk-data';
2
- type DateLimits = {
2
+ export type DateLimits = {
3
3
  minDate?: string;
4
4
  maxDate?: string;
5
5
  };
6
6
  export declare const useDateLimits: (userLimits: DateLimits, attribute: LevelAttribute, dataSource?: DataSource, parentFilters?: Filter[]) => Required<DateLimits> | null;
7
- export {};
@@ -19,8 +19,8 @@ export interface RelativeDateFilterProps {
19
19
  */
20
20
  export declare const RelativeDateFilter: FunctionComponent<RelativeDateFilterProps>;
21
21
  export declare const DATE_OPS_MAP: {
22
- [x: string]: string;
22
+ readonly [x: string]: "dateFilter.last" | "dateFilter.next";
23
23
  };
24
24
  export declare const DATE_LEVELS_MAP: {
25
- [x: string]: string;
25
+ readonly [x: string]: "dateFilter.days" | "dateFilter.weeks" | "dateFilter.months" | "dateFilter.quarters" | "dateFilter.years";
26
26
  };
@@ -0,0 +1,6 @@
1
+ import { Themable } from '../../../theme-provider/types';
2
+ import type { SVGProps } from 'react';
3
+ export declare const ArrowIcon: (props: Pick<SVGProps<SVGElement>, 'className' | 'width' | 'height' | 'fill' | 'onClick'> & {
4
+ direction: 'left' | 'right';
5
+ disabled?: boolean;
6
+ } & Themable) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { Themable } from '../../../theme-provider/types';
2
+ import type { SVGProps } from 'react';
3
+ export declare const DoubleArrowIcon: (props: Pick<SVGProps<SVGElement>, 'className' | 'width' | 'height' | 'fill' | 'onClick'> & {
4
+ direction: 'left' | 'right';
5
+ disabled?: boolean;
6
+ } & Themable) => import("react/jsx-runtime").JSX.Element;
@@ -3,5 +3,5 @@ import { HighchartsOptionsInternal } from './chart-options-processor/chart-optio
3
3
  type HighchartsReactMemoizedProps = {
4
4
  options: HighchartsOptionsInternal;
5
5
  };
6
- export declare const HighchartsReactMemoized: import("react").MemoExoticComponent<({ options }: HighchartsReactMemoizedProps) => import("react/jsx-runtime").JSX.Element>;
6
+ export declare const HighchartsReactMemoized: import("react").NamedExoticComponent<HighchartsReactMemoizedProps>;
7
7
  export {};