@sisense/sdk-ui-vue 1.31.0 → 1.33.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.
- package/dist/ai.cjs +388 -0
- package/dist/ai.d.ts +1 -0
- package/dist/ai.js +3838 -0
- package/dist/index.cjs +1 -2052
- package/dist/index.js +1702 -106235
- package/dist/packages/sdk-ui-vue/src/ai/components/chatbot.d.ts +73 -0
- package/dist/packages/sdk-ui-vue/src/ai/components/get-nlg-insights.d.ts +90 -0
- package/dist/packages/sdk-ui-vue/src/ai/components/index.d.ts +2 -0
- package/dist/packages/sdk-ui-vue/src/ai/composables/index.d.ts +3 -0
- package/dist/packages/sdk-ui-vue/src/ai/composables/use-get-nlg-insights.d.ts +45 -0
- package/dist/packages/sdk-ui-vue/src/ai/composables/use-get-nlq-result.d.ts +42 -0
- package/dist/packages/sdk-ui-vue/src/ai/composables/use-get-query-recommendations.d.ts +50 -0
- package/dist/packages/sdk-ui-vue/src/ai/index.d.ts +4 -0
- package/dist/packages/sdk-ui-vue/src/ai/providers/ai-context-provider.d.ts +60 -0
- package/dist/packages/sdk-ui-vue/src/ai/providers/index.d.ts +1 -0
- package/dist/packages/sdk-ui-vue/src/ai/sdk-ui-core-exports.d.ts +1 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/area-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/area-range-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/areamap-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/bar-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/boxplot-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/chart.d.ts +6 -4
- package/dist/packages/sdk-ui-vue/src/components/charts/column-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/funnel-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/index.d.ts +18 -18
- package/dist/packages/sdk-ui-vue/src/components/charts/indicator-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/line-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/pie-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/pivot-table.d.ts +2 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/polar-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/scatter-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/scattermap-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/sunburst-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/table.d.ts +2 -0
- package/dist/packages/sdk-ui-vue/src/components/charts/treemap-chart.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/context-menu.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/dashboard/dashboard-by-id.d.ts +15 -8
- package/dist/packages/sdk-ui-vue/src/components/dashboard/dashboard.d.ts +13 -6
- package/dist/packages/sdk-ui-vue/src/components/dashboard/index.d.ts +2 -2
- package/dist/packages/sdk-ui-vue/src/components/drilldown-breadcrumbs.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/drilldown-widget.d.ts +13 -2
- package/dist/packages/sdk-ui-vue/src/components/filters/criteria-filter-tile.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/filters/date-range-filter-tile.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/filters/index.d.ts +4 -4
- package/dist/packages/sdk-ui-vue/src/components/filters/member-filter-tile.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/filters/relative-date-filter-tile.d.ts +6 -0
- package/dist/packages/sdk-ui-vue/src/components/widgets/chart-widget.d.ts +6 -4
- package/dist/packages/sdk-ui-vue/src/components/widgets/dashboard-widget.d.ts +13 -4
- package/dist/packages/sdk-ui-vue/src/components/widgets/index.d.ts +4 -4
- package/dist/packages/sdk-ui-vue/src/components/widgets/table-widget.d.ts +2 -0
- package/dist/packages/sdk-ui-vue/src/components/widgets/widget-by-id.d.ts +10 -4
- package/dist/packages/sdk-ui-vue/src/composables/use-plugins.d.ts +3 -3
- package/dist/packages/sdk-ui-vue/src/composables/use-tracking.d.ts +15 -15
- package/dist/packages/sdk-ui-vue/src/lib.d.ts +3 -1
- package/dist/packages/sdk-ui-vue/src/providers/index.d.ts +2 -2
- package/dist/packages/sdk-ui-vue/src/providers/plugins-provider.d.ts +10 -6
- package/dist/packages/sdk-ui-vue/src/providers/sisense-context-provider.d.ts +13 -4
- package/dist/packages/sdk-ui-vue/src/providers/theme-provider.d.ts +7 -11
- package/dist/packages/sdk-ui-vue/src/sdk-ui-core-exports.d.ts +2 -6
- package/dist/packages/sdk-ui-vue/src/setup-helper.d.ts +13 -1
- package/dist/packages/sdk-ui-vue/src/types/dashboard-config.d.ts +24 -0
- package/dist/packages/sdk-ui-vue/src/types/index.d.ts +2 -0
- package/dist/packages/sdk-ui-vue/src/types/maybe-ref.d.ts +14 -0
- package/dist/packages/sdk-ui-vue/src/utilities/dashboard-helpers.d.ts +105 -0
- package/dist/packages/sdk-ui-vue/src/utilities/dashboard-model-translator.d.ts +37 -0
- package/dist/packages/sdk-ui-vue/src/utilities/index.d.ts +23 -0
- package/dist/packages/sdk-ui-vue/src/utilities/widget-model-translator.d.ts +247 -0
- package/dist/use-tracking-2d715e05.js +105710 -0
- package/dist/use-tracking-bc424435.cjs +1066 -0
- package/package.json +15 -2
- package/dist/packages/sdk-ui-vue/src/types.d.ts +0 -6
@@ -0,0 +1,24 @@
|
|
1
|
+
import type { DashboardConfig as DashboardConfigPreact, DashboardByIdConfig as DashboardByIdConfigPreact, DashboardFiltersPanelConfig as DashboardFiltersPanelConfigPreact } from '@sisense/sdk-ui-preact';
|
2
|
+
/**
|
3
|
+
* {@inheritDoc @sisense/sdk-ui!DashboardFiltersPanelConfig}
|
4
|
+
*/
|
5
|
+
export interface DashboardFiltersPanelConfig extends Omit<DashboardFiltersPanelConfigPreact, 'actions'> {
|
6
|
+
}
|
7
|
+
/**
|
8
|
+
* {@inheritDoc @sisense/sdk-ui!DashboardConfig}
|
9
|
+
*/
|
10
|
+
export interface DashboardConfig extends Omit<DashboardConfigPreact, 'filtersPanel'> {
|
11
|
+
/**
|
12
|
+
* {@inheritDoc @sisense/sdk-ui!DashboardConfig.filtersPanel}
|
13
|
+
*/
|
14
|
+
filtersPanel?: DashboardFiltersPanelConfig;
|
15
|
+
}
|
16
|
+
/**
|
17
|
+
* {@inheritDoc @sisense/sdk-ui!DashboardByIdConfig}
|
18
|
+
*/
|
19
|
+
export interface DashboardByIdConfig extends Omit<DashboardByIdConfigPreact, 'filtersPanel'> {
|
20
|
+
/**
|
21
|
+
* {@inheritDoc @sisense/sdk-ui!DashboardByIdConfig.filtersPanel}
|
22
|
+
*/
|
23
|
+
filtersPanel?: DashboardFiltersPanelConfig;
|
24
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { Ref } from 'vue';
|
2
|
+
export type MaybeRef<T> = Ref<T> | T;
|
3
|
+
export type MaybeWithRefs<T extends object> = {
|
4
|
+
[Property in keyof T]: MaybeRef<T[Property]>;
|
5
|
+
};
|
6
|
+
export type MaybeRefOrWithRefs<T extends Object> = MaybeRef<T> | MaybeWithRefs<T>;
|
7
|
+
/**
|
8
|
+
* Converts all non-function properties of `T` into Vue refs while keeping function properties specified by `Fns` unchanged.
|
9
|
+
*
|
10
|
+
* @internal
|
11
|
+
*/
|
12
|
+
export type ToRefsExceptFns<T, Fns extends keyof T> = {
|
13
|
+
[K in keyof Omit<T, Fns>]: Ref<T[K]>;
|
14
|
+
} & Pick<T, Fns>;
|
@@ -0,0 +1,105 @@
|
|
1
|
+
import type { Filter, FilterRelations } from '@sisense/sdk-data';
|
2
|
+
import type { DashboardProps } from '../components/dashboard';
|
3
|
+
/**
|
4
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.replaceFilters}
|
5
|
+
*
|
6
|
+
* @example
|
7
|
+
* Replace all filters on a dashboard with a new set of filters.
|
8
|
+
* ```ts
|
9
|
+
* const existingDashboard: DashboardProps = {...}
|
10
|
+
* const newFilters: Filter[] = [{...}, {...}, ...];
|
11
|
+
* const updatedDashboard = dashboardHelpers.replaceFilters(existingDashboard, newFilters);
|
12
|
+
* ```
|
13
|
+
* @param dashboard - The original dashboard (`DashboardProps`) whose filters are to be replaced.
|
14
|
+
* @param newFilters - An array of new filters or filter relations to set on the dashboard.
|
15
|
+
* @returns A new dashboard instance with the updated filters.
|
16
|
+
*/
|
17
|
+
export declare const replaceFilters: (dashboard: DashboardProps, newFilters: Filter[] | FilterRelations) => DashboardProps;
|
18
|
+
/**
|
19
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.addFilter}
|
20
|
+
*
|
21
|
+
* @example
|
22
|
+
* Add a new filter to a dashboard.
|
23
|
+
* ```ts
|
24
|
+
* const existingDashboard: DashboardProps = {...};
|
25
|
+
* const newFilter: Filter = {...};
|
26
|
+
* const updatedDashboard = dashboardHelpers.addFilter(existingDashboard, newFilter);
|
27
|
+
* ```
|
28
|
+
* @param dashboard - The original dashboard (`DashboardProps`) to which the filter will be added.
|
29
|
+
* @param newFilter - The filter to add to the dashboard.
|
30
|
+
* @returns A new dashboard instance with the new filter added.
|
31
|
+
*/
|
32
|
+
export declare const addFilter: (dashboard: DashboardProps, newFilter: Filter) => DashboardProps;
|
33
|
+
/**
|
34
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.addFilters}
|
35
|
+
*
|
36
|
+
* @example
|
37
|
+
* Add multiple new filters to a dashboard.
|
38
|
+
* ```ts
|
39
|
+
* const existingDashboard: DashboardProps = {...};
|
40
|
+
* const newFilters: Filter[] = [{...}, {...}, ...];
|
41
|
+
* const updatedDashboard = dashboardHelpers.addFilters(existingDashboard, newFilters);
|
42
|
+
* ```
|
43
|
+
* @param dashboard - The original dashboard (`DashboardProps`) to which the filters will be added.
|
44
|
+
* @param newFilters - An array of filters to add to the dashboard.
|
45
|
+
* @returns A new dashboard instance with the new filters added.
|
46
|
+
*/
|
47
|
+
export declare const addFilters: (dashboard: DashboardProps, newFilters: Filter[]) => DashboardProps;
|
48
|
+
/**
|
49
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.replaceFilter}
|
50
|
+
*
|
51
|
+
* @example
|
52
|
+
* Replace a filter in a dashboard.
|
53
|
+
* ```ts
|
54
|
+
* const existingDashboard: DashboardProps = {...};
|
55
|
+
* const filterToReplace: Filter = {...};
|
56
|
+
* const newFilter: Filter = {...};
|
57
|
+
* const updatedDashboard = dashboardHelpers.replaceFilter(existingDashboard, filterToReplace, newFilter);
|
58
|
+
* ```
|
59
|
+
* @param dashboard - The original dashboard (`DashboardProps`) containing the filter to be replaced.
|
60
|
+
* @param filterToReplace - The existing filter to be replaced.
|
61
|
+
* @param newFilter - The new filter to replace the existing one.
|
62
|
+
* @returns A new dashboard instance with the specified filter replaced.
|
63
|
+
*/
|
64
|
+
export declare const replaceFilter: (dashboard: DashboardProps, filterToReplace: Filter, newFilter: Filter) => DashboardProps;
|
65
|
+
/**
|
66
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.modifyFilter}
|
67
|
+
*
|
68
|
+
* @deprecated Use {@link replaceFilter} instead
|
69
|
+
*
|
70
|
+
* @param dashboard - The original dashboard (`DashboardProps`) containing the filter to modify.
|
71
|
+
* @param filterToModify - The existing filter to be modified.
|
72
|
+
* @param newFilter - The new filter to replace the existing one.
|
73
|
+
* @returns A new dashboard instance with the specified filter modified.
|
74
|
+
*/
|
75
|
+
export declare const modifyFilter: (dashboard: DashboardProps, filterToModify: Filter, newFilter: Filter) => DashboardProps;
|
76
|
+
/**
|
77
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.removeFilter}
|
78
|
+
*
|
79
|
+
* @example
|
80
|
+
* Remove a filter from a dashboard.
|
81
|
+
* ```ts
|
82
|
+
* const existingDashboard: DashboardProps = {...};
|
83
|
+
* const filterToRemove: Filter = {...};
|
84
|
+
* const updatedDashboard = dashboardHelpers.removeFilter(existingDashboard, filterToRemove);
|
85
|
+
* ```
|
86
|
+
* @param dashboard - The original dashboard (`DashboardProps`) from which to remove the filter.
|
87
|
+
* @param filterToRemove - The filter to be removed.
|
88
|
+
* @returns A new dashboard instance with the specified filter removed.
|
89
|
+
*/
|
90
|
+
export declare const removeFilter: (dashboard: DashboardProps, filterToRemove: Filter) => DashboardProps;
|
91
|
+
/**
|
92
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.removeFilters}
|
93
|
+
*
|
94
|
+
* @example
|
95
|
+
* Remove multiple filters from a dashboard.
|
96
|
+
* ```ts
|
97
|
+
* const existingDashboard: DashboardProps = {...};
|
98
|
+
* const filtersToRemove: Filter[] = [{...}, {...}, ...];
|
99
|
+
* const updatedDashboard = dashboardHelpers.removeFilters(existingDashboard, filtersToRemove);
|
100
|
+
* ```
|
101
|
+
* @param dashboard - The original dashboard (`DashboardProps`) from which the specified filters are removed.
|
102
|
+
* @param filtersToRemove - An array of filters to remove.
|
103
|
+
* @returns A new dashboard instance with the specified filters removed.
|
104
|
+
*/
|
105
|
+
export declare const removeFilters: (dashboard: DashboardProps, filtersToRemove: Filter[]) => DashboardProps;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { type DashboardModel } from '@sisense/sdk-ui-preact';
|
2
|
+
import type { DashboardProps } from '../components/dashboard';
|
3
|
+
/**
|
4
|
+
* Translates {@link DashboardModel} to {@link DashboardProps}.
|
5
|
+
*
|
6
|
+
* @example
|
7
|
+
* ```vue
|
8
|
+
<script setup lang="ts">
|
9
|
+
import { dashboardModelTranslator, useGetDashboardModel, Dashboard } from '@sisense/sdk-ui-vue';
|
10
|
+
import { computed } from 'vue';
|
11
|
+
|
12
|
+
const { dashboard } = useGetDashboardModel({
|
13
|
+
dashboardOid: 'your-dashboard-oid',
|
14
|
+
includeWidgets: true,
|
15
|
+
includeFilters: true,
|
16
|
+
});
|
17
|
+
|
18
|
+
const dashboardProps = computed(() =>
|
19
|
+
dashboard.value ? dashboardModelTranslator.toDashboardProps(dashboard.value) : null,
|
20
|
+
);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<template>
|
24
|
+
<Dashboard
|
25
|
+
v-if="dashboardProps"
|
26
|
+
:title="dashboardProps.title"
|
27
|
+
:layoutOptions="dashboardProps.layoutOptions"
|
28
|
+
:widgets="dashboardProps.widgets"
|
29
|
+
:filters="dashboardProps.filters"
|
30
|
+
:defaultDataSource="dashboardProps.defaultDataSource"
|
31
|
+
:widgetsOptions="dashboardProps.widgetsOptions"
|
32
|
+
:styleOptions="dashboardProps.styleOptions"
|
33
|
+
/>
|
34
|
+
</template>
|
35
|
+
* ```
|
36
|
+
*/
|
37
|
+
export declare function toDashboardProps(dashboardModel: DashboardModel): DashboardProps;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardModelTranslator}
|
3
|
+
*
|
4
|
+
* @group Fusion Assets
|
5
|
+
* @fusionEmbed
|
6
|
+
* @shortDescription Utility functions to translate a Fusion dashboard model from and to other dashboard data structures
|
7
|
+
*/
|
8
|
+
export * as dashboardModelTranslator from './dashboard-model-translator';
|
9
|
+
/**
|
10
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers}
|
11
|
+
*
|
12
|
+
* @group Dashboards
|
13
|
+
* @shortDescription Utility functions to manipulate dashboard elements
|
14
|
+
*/
|
15
|
+
export * as dashboardHelpers from './dashboard-helpers';
|
16
|
+
/**
|
17
|
+
* {@inheritDoc @sisense/sdk-ui!widgetModelTranslator}
|
18
|
+
*
|
19
|
+
* @group Fusion Assets
|
20
|
+
* @fusionEmbed
|
21
|
+
* @shortDescription Utility functions to translate a Fusion widget model from and to other widget data structures
|
22
|
+
*/
|
23
|
+
export * as widgetModelTranslator from './widget-model-translator';
|
@@ -0,0 +1,247 @@
|
|
1
|
+
import { type WidgetModel, type TextWidgetProps, type ExecutePivotQueryParams, type ExecuteQueryParams, type PivotTableWidgetProps } from '@sisense/sdk-ui-preact';
|
2
|
+
import type { ChartProps, PivotTableProps, TableProps } from '../components/charts';
|
3
|
+
import type { ChartWidgetProps } from '../components/widgets';
|
4
|
+
/**
|
5
|
+
* Translates a {@link WidgetModel} to the parameters for executing a query for the widget.
|
6
|
+
*
|
7
|
+
* @example
|
8
|
+
* ```vue
|
9
|
+
<script setup lang="ts">
|
10
|
+
import { widgetModelTranslator, useGetWidgetModel, useExecuteQuery } from '@sisense/sdk-ui-vue';
|
11
|
+
import { computed } from 'vue';
|
12
|
+
|
13
|
+
const { data: widgetModel } = useGetWidgetModel({
|
14
|
+
dashboardOid: 'your-dashboard-oid',
|
15
|
+
widgetOid: 'your-widget-oid',
|
16
|
+
});
|
17
|
+
|
18
|
+
const executeQueryParams = computed(() =>
|
19
|
+
widgetModel.value
|
20
|
+
? widgetModelTranslator.toExecuteQueryParams(widgetModel.value)
|
21
|
+
: { enabled: false },
|
22
|
+
);
|
23
|
+
|
24
|
+
const { data, isLoading, isError } = useExecuteQuery(executeQueryParams);
|
25
|
+
</script>
|
26
|
+
* ```
|
27
|
+
*
|
28
|
+
* Note: this method is not supported for getting pivot query.
|
29
|
+
* Use {@link toExecutePivotQueryParams} instead for getting query parameters for the pivot widget.
|
30
|
+
*/
|
31
|
+
export declare const toExecuteQueryParams: (widgetModel: WidgetModel) => ExecuteQueryParams;
|
32
|
+
/**
|
33
|
+
* Translates a {@link WidgetModel} to the parameters for executing a query for the pivot widget.
|
34
|
+
*
|
35
|
+
* @example
|
36
|
+
* ```vue
|
37
|
+
<script setup lang="ts">
|
38
|
+
import { widgetModelTranslator, useGetWidgetModel, useExecuteQuery } from '@sisense/sdk-ui-vue';
|
39
|
+
import { computed } from 'vue';
|
40
|
+
|
41
|
+
const { data: widgetModel } = useGetWidgetModel({
|
42
|
+
dashboardOid: 'your-dashboard-oid',
|
43
|
+
widgetOid: 'your-widget-oid',
|
44
|
+
});
|
45
|
+
|
46
|
+
const executePivotQueryParams = computed(() =>
|
47
|
+
widgetModel.value ? widgetModelTranslator.toExecutePivotQueryParams(widgetModel.value): { enabled: false },
|
48
|
+
);
|
49
|
+
|
50
|
+
const { data, isLoading, isError } = useExecutePivotQuery(executePivotQueryParams);
|
51
|
+
</script>
|
52
|
+
* ```
|
53
|
+
*
|
54
|
+
* Note: this method is supported only for getting pivot query.
|
55
|
+
* Use {@link toExecuteQueryParams} instead for getting query parameters for non-pivot widgets.
|
56
|
+
*/
|
57
|
+
export declare const toExecutePivotQueryParams: (widgetModel: WidgetModel) => ExecutePivotQueryParams;
|
58
|
+
/**
|
59
|
+
* Translates a {@link WidgetModel} to the props for rendering a chart.
|
60
|
+
*
|
61
|
+
* @example
|
62
|
+
* ```vue
|
63
|
+
<script setup lang="ts">
|
64
|
+
import { widgetModelTranslator, useGetWidgetModel, Chart } from '@sisense/sdk-ui-vue';
|
65
|
+
import { computed } from 'vue';
|
66
|
+
|
67
|
+
const { data: widgetModel } = useGetWidgetModel({
|
68
|
+
dashboardOid: 'your-dashboard-oid',
|
69
|
+
widgetOid: 'your-widget-oid',
|
70
|
+
});
|
71
|
+
|
72
|
+
const chartProps = computed(() =>
|
73
|
+
widgetModel.value ? widgetModelTranslator.toChartProps(widgetModel.value) : null,
|
74
|
+
);
|
75
|
+
</script>
|
76
|
+
|
77
|
+
<template>
|
78
|
+
<Chart
|
79
|
+
v-if="chartProps"
|
80
|
+
:chartType="chartProps.chartType"
|
81
|
+
:dataSet="chartProps.dataSet"
|
82
|
+
:dataOptions="chartProps.dataOptions"
|
83
|
+
:filters="chartProps.filters"
|
84
|
+
:highlights="chartProps.highlights"
|
85
|
+
:styleOptions="chartProps.styleOptions"
|
86
|
+
/>
|
87
|
+
</template>
|
88
|
+
* ```
|
89
|
+
*
|
90
|
+
* Note: this method is not supported for pivot widgets.
|
91
|
+
* Use {@link toPivotTableProps} instead for getting props for the {@link PivotTable}.
|
92
|
+
*/
|
93
|
+
export declare function toChartProps(widgetModel: WidgetModel): ChartProps;
|
94
|
+
/**
|
95
|
+
* Translates a {@link WidgetModel} to the props for rendering a table.
|
96
|
+
*
|
97
|
+
* @example
|
98
|
+
* ```vue
|
99
|
+
<script setup lang="ts">
|
100
|
+
import { widgetModelTranslator, useGetWidgetModel, Table } from '@sisense/sdk-ui-vue';
|
101
|
+
import { computed } from 'vue';
|
102
|
+
|
103
|
+
const { data: widgetModel } = useGetWidgetModel({
|
104
|
+
dashboardOid: 'your-dashboard-oid',
|
105
|
+
widgetOid: 'your-widget-oid',
|
106
|
+
});
|
107
|
+
|
108
|
+
const tableProps = computed(() =>
|
109
|
+
widgetModel.value ? widgetModelTranslator.toTableProps(widgetModel.value) : null,
|
110
|
+
);
|
111
|
+
</script>
|
112
|
+
|
113
|
+
<template>
|
114
|
+
<Table
|
115
|
+
v-if="tableProps"
|
116
|
+
:dataSet="tableProps.dataSet"
|
117
|
+
:dataOptions="tableProps.dataOptions"
|
118
|
+
:filters="tableProps.filters"
|
119
|
+
:styleOptions="tableProps.styleOptions"
|
120
|
+
/>
|
121
|
+
</template>
|
122
|
+
* ```
|
123
|
+
*
|
124
|
+
* Note: this method is not supported for chart and pivot widgets.
|
125
|
+
* Use {@link toChartProps} instead for getting props for the {@link Chart}.
|
126
|
+
* Use {@link toPivotTableProps} instead for getting props for the {@link PivotTable}.
|
127
|
+
*/
|
128
|
+
export declare function toTableProps(widgetModel: WidgetModel): TableProps;
|
129
|
+
/**
|
130
|
+
* Translates a {@link WidgetModel} to the props for rendering a pivot table.
|
131
|
+
*
|
132
|
+
* @example
|
133
|
+
* ```vue
|
134
|
+
<script setup lang="ts">
|
135
|
+
import { widgetModelTranslator, useGetWidgetModel, PivotTable } from '@sisense/sdk-ui-vue';
|
136
|
+
import { computed } from 'vue';
|
137
|
+
|
138
|
+
const { data: widgetModel } = useGetWidgetModel({
|
139
|
+
dashboardOid: 'your-dashboard-oid',
|
140
|
+
widgetOid: 'your-widget-oid',
|
141
|
+
});
|
142
|
+
|
143
|
+
const pivotTableProps = computed(() =>
|
144
|
+
widgetModel.value ? widgetModelTranslator.toPivotTableProps(widgetModel.value) : null,
|
145
|
+
);
|
146
|
+
</script>
|
147
|
+
|
148
|
+
<template>
|
149
|
+
<PivotTable
|
150
|
+
v-if="pivotTableProps"
|
151
|
+
:dataSet="pivotTableProps.dataSet"
|
152
|
+
:dataOptions="pivotTableProps.dataOptions"
|
153
|
+
:filters="pivotTableProps.filters"
|
154
|
+
:styleOptions="pivotTableProps.styleOptions"
|
155
|
+
/>
|
156
|
+
</template>
|
157
|
+
* ```
|
158
|
+
*
|
159
|
+
* Note: this method is not supported for chart or table widgets.
|
160
|
+
* Use {@link toChartProps} instead for getting props for the {@link Chart}.
|
161
|
+
* Use {@link toTableProps} instead for getting props for the {@link Table}.
|
162
|
+
*/
|
163
|
+
export declare function toPivotTableProps(widgetModel: WidgetModel): PivotTableProps;
|
164
|
+
/**
|
165
|
+
* Translates a {@link WidgetModel} to the props for rendering a chart widget.
|
166
|
+
*
|
167
|
+
* @example
|
168
|
+
* ```vue
|
169
|
+
<script setup lang="ts">
|
170
|
+
import { widgetModelTranslator, useGetWidgetModel, ChartWidget } from '@sisense/sdk-ui-vue';
|
171
|
+
import { computed } from 'vue';
|
172
|
+
|
173
|
+
const { data: widgetModel } = useGetWidgetModel({
|
174
|
+
dashboardOid: 'your-dashboard-oid',
|
175
|
+
widgetOid: 'your-widget-oid',
|
176
|
+
});
|
177
|
+
|
178
|
+
const chartWidgetProps = computed(() =>
|
179
|
+
widgetModel.value ? widgetModelTranslator.toChartWidgetProps(widgetModel.value) : null,
|
180
|
+
);
|
181
|
+
</script>
|
182
|
+
|
183
|
+
<template>
|
184
|
+
<ChartWidget
|
185
|
+
v-if="chartWidgetProps"
|
186
|
+
:chartType="chartWidgetProps.chartType"
|
187
|
+
:dataSource="chartWidgetProps.dataSource"
|
188
|
+
:dataOptions="chartWidgetProps.dataOptions"
|
189
|
+
:filters="chartWidgetProps.filters"
|
190
|
+
:highlights="chartWidgetProps.highlights"
|
191
|
+
:styleOptions="chartWidgetProps.styleOptions"
|
192
|
+
/>
|
193
|
+
</template>
|
194
|
+
* ```
|
195
|
+
*
|
196
|
+
* Note: this method is not supported for pivot widgets.
|
197
|
+
*/
|
198
|
+
export declare function toChartWidgetProps(widgetModel: WidgetModel): ChartWidgetProps;
|
199
|
+
/**
|
200
|
+
* Translates a {@link WidgetModel} to the props for rendering a pivot table widget.
|
201
|
+
*
|
202
|
+
* @example
|
203
|
+
* ```vue
|
204
|
+
<script setup lang="ts">
|
205
|
+
import { widgetModelTranslator, useGetWidgetModel } from '@sisense/sdk-ui-vue';
|
206
|
+
import { computed } from 'vue';
|
207
|
+
|
208
|
+
const { data: widgetModel } = useGetWidgetModel({
|
209
|
+
dashboardOid: 'your-dashboard-oid',
|
210
|
+
widgetOid: 'your-widget-oid',
|
211
|
+
});
|
212
|
+
|
213
|
+
const pivotTableWidgetProps = computed(() =>
|
214
|
+
widgetModel.value ? widgetModelTranslator.toPivotTableWidgetProps(widgetModel.value) : null,
|
215
|
+
);
|
216
|
+
</script>
|
217
|
+
* ```
|
218
|
+
*
|
219
|
+
* Note: this method is not supported for chart or table widgets.
|
220
|
+
* Use {@link toChartWidgetProps} instead for getting props for the {@link ChartWidget}.
|
221
|
+
*/
|
222
|
+
export declare function toPivotTableWidgetProps(widgetModel: WidgetModel): PivotTableWidgetProps;
|
223
|
+
/**
|
224
|
+
* Translates a {@link WidgetModel} to the props for rendering a text widget.
|
225
|
+
*
|
226
|
+
* @example
|
227
|
+
* ```vue
|
228
|
+
<script setup lang="ts">
|
229
|
+
import { widgetModelTranslator, useGetWidgetModel } from '@sisense/sdk-ui-vue';
|
230
|
+
import { computed } from 'vue';
|
231
|
+
|
232
|
+
const { data: widgetModel } = useGetWidgetModel({
|
233
|
+
dashboardOid: 'your-dashboard-oid',
|
234
|
+
widgetOid: 'your-widget-oid',
|
235
|
+
});
|
236
|
+
|
237
|
+
const textWidgetProps = computed(() =>
|
238
|
+
widgetModel.value ? widgetModelTranslator.toTextWidgetProps(widgetModel.value) : null,
|
239
|
+
);
|
240
|
+
</script>
|
241
|
+
* ```
|
242
|
+
*
|
243
|
+
* Note: this method is not supported for chart or pivot widgets.
|
244
|
+
* Use {@link toChartWidgetProps} instead for getting props for the {@link ChartWidget}.
|
245
|
+
* Use {@link toPivotTableWidgetProps} instead for getting props for the pivot table widget.
|
246
|
+
*/
|
247
|
+
export declare function toTextWidgetProps(widgetModel: WidgetModel): TextWidgetProps;
|