@sisense/sdk-ui-vue 1.2.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +83668 -62966
- package/dist/src/components/charts/area-chart.d.ts +22 -9
- package/dist/src/components/charts/areamap-chart.d.ts +23 -17
- package/dist/src/components/charts/bar-chart.d.ts +23 -10
- package/dist/src/components/charts/boxplot-chart.d.ts +29 -15
- package/dist/src/components/charts/chart-widget.d.ts +42 -11
- package/dist/src/components/charts/chart.d.ts +16 -27
- package/dist/src/components/charts/column-chart.d.ts +23 -10
- package/dist/src/components/charts/dashboard-widget.d.ts +11 -11
- package/dist/src/components/charts/funnel-chart.d.ts +21 -7
- package/dist/src/components/charts/index.d.ts +1 -0
- package/dist/src/components/charts/indicator-chart.d.ts +20 -9
- package/dist/src/components/charts/line-chart.d.ts +20 -8
- package/dist/src/components/charts/pie-chart.d.ts +22 -10
- package/dist/src/components/charts/pivot-table.d.ts +41 -0
- package/dist/src/components/charts/polar-chart.d.ts +22 -10
- package/dist/src/components/charts/scatter-chart.d.ts +28 -10
- package/dist/src/components/charts/scattermap-chart.d.ts +22 -7
- package/dist/src/components/charts/sunburst-chart.d.ts +16 -8
- package/dist/src/components/charts/table-widget.d.ts +6 -4
- package/dist/src/components/charts/table.d.ts +6 -5
- package/dist/src/components/charts/treemap-chart.d.ts +21 -9
- package/dist/src/components/context-menu.d.ts +32 -0
- package/dist/src/components/drilldown-breadcrumbs.d.ts +41 -0
- package/dist/src/components/drilldown-widget.d.ts +44 -0
- package/dist/src/components/drilldown-widget.vue.d.ts +2 -44
- package/dist/src/components/filters/basic-member-filter-tile.d.ts +1 -0
- package/dist/src/components/filters/criteria-filter-tile.d.ts +19 -4
- package/dist/src/components/filters/date-range-filter-tile.d.ts +14 -5
- package/dist/src/components/filters/member-filter-tile.d.ts +16 -5
- package/dist/src/composables/index.d.ts +6 -0
- package/dist/src/{hooks → composables}/use-custom-drilldown.d.ts +21 -2
- package/dist/src/composables/use-execute-query-by-widget-id.d.ts +42 -0
- package/dist/src/composables/use-execute-query.d.ts +44 -0
- package/dist/src/composables/use-get-dashboard-model.d.ts +41 -0
- package/dist/src/composables/use-get-dashboard-models.d.ts +38 -0
- package/dist/src/composables/use-get-shared-formula.d.ts +45 -0
- package/dist/src/composables/use-get-widget-model.d.ts +41 -0
- package/dist/src/composables/use-tracking.d.ts +39 -0
- package/dist/src/helpers/use-reducer.d.ts +10 -0
- package/dist/src/lib.d.ts +2 -8
- package/dist/src/providers/index.d.ts +1 -1
- package/dist/src/providers/sisense-context-provider.d.ts +49 -9
- package/dist/src/providers/theme-provider.d.ts +60 -5
- package/dist/src/sdk-ui-core-exports.d.ts +5 -0
- package/dist/src/types.d.ts +5 -0
- package/dist/src/utils.d.ts +6 -0
- package/package.json +4 -1
- package/dist/src/hooks/index.d.ts +0 -6
- package/dist/src/hooks/use-execute-query-by-widget-id.d.ts +0 -9
- package/dist/src/hooks/use-execute-query.d.ts +0 -11
- package/dist/src/hooks/use-get-dashboard-model.d.ts +0 -4
- package/dist/src/hooks/use-get-dashboard-models.d.ts +0 -4
- package/dist/src/hooks/use-get-shared-formula.d.ts +0 -4
- package/dist/src/hooks/use-get-widget-model.d.ts +0 -4
@@ -1,4 +1,45 @@
|
|
1
1
|
import type { PropType } from 'vue';
|
2
|
+
/**
|
3
|
+
* `DrilldownBreadcrumbs` component from the `@sisense/sdk-ui-vue` package.
|
4
|
+
* This component provides a way to display and interact with the drilldown path in data visualization components,
|
5
|
+
* allowing users to navigate through different levels of data drilldowns. It includes functionalities to clear selections
|
6
|
+
* or slice through the drilldown selections for a more intuitive data exploration experience.
|
7
|
+
*
|
8
|
+
* @example
|
9
|
+
* Here's how to use the `DrilldownBreadcrumbs` component:
|
10
|
+
* ```vue
|
11
|
+
* <template>
|
12
|
+
* <DrilldownBreadcrumbs
|
13
|
+
* :clearDrilldownSelections="clearSelections"
|
14
|
+
* :currentDimension="currentDimension"
|
15
|
+
* :sliceDrilldownSelections="sliceSelections"
|
16
|
+
* :filtersDisplayValues="filtersDisplayValues"
|
17
|
+
* />
|
18
|
+
* </template>
|
19
|
+
*
|
20
|
+
* <script>
|
21
|
+
* import { ref } from 'vue';
|
22
|
+
* import DrilldownBreadcrumbs from './DrilldownBreadcrumbs.vue';
|
23
|
+
*
|
24
|
+
* export default {
|
25
|
+
* components: { DrilldownBreadcrumbs },
|
26
|
+
* setup() {
|
27
|
+
* const clearSelections = () => {};
|
28
|
+
* const currentDimension = ref({<current dimension object>});
|
29
|
+
* const sliceSelections = (index) => { <logic to slice selections up to index> };
|
30
|
+
* const filtersDisplayValues = ref({<object mapping filter values to display values>});
|
31
|
+
*
|
32
|
+
* return { clearSelections, currentDimension, sliceSelections, filtersDisplayValues };
|
33
|
+
* }
|
34
|
+
* };
|
35
|
+
* </script>
|
36
|
+
* ```
|
37
|
+
*
|
38
|
+
* @prop {Function} clearDrilldownSelections - Function to clear all drilldown selections made by the user.
|
39
|
+
* @prop {Object} currentDimension - Object representing the current dimension in the drilldown path.
|
40
|
+
* @prop {Function} sliceDrilldownSelections - Function to slice the drilldown selections up to a certain index, allowing the user to navigate back in the drilldown path.
|
41
|
+
* @prop {Object} filtersDisplayValues - Object mapping the internal filter values to human-readable display values, enhancing the usability of the breadcrumbs.
|
42
|
+
*/
|
2
43
|
export declare const DrilldownBreadcrumbs: import("vue").DefineComponent<{
|
3
44
|
clearDrilldownSelections: PropType<() => void>;
|
4
45
|
currentDimension: PropType<import("@sisense/sdk-data").Attribute>;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import type { Component, PropType } from 'vue';
|
2
|
+
import type { ContextMenuProps } from '@sisense/sdk-ui-preact';
|
3
|
+
export type DrilldownWidgetConfig = {
|
4
|
+
isBreadcrumbsDetached?: boolean;
|
5
|
+
breadcrumbsComponent?: Component;
|
6
|
+
contextMenuComponent?: (props: ContextMenuProps) => Component;
|
7
|
+
};
|
8
|
+
export declare const DrilldownWidgetTs: import("vue").DefineComponent<{
|
9
|
+
config: {
|
10
|
+
type: PropType<DrilldownWidgetConfig>;
|
11
|
+
required: false;
|
12
|
+
default: () => {};
|
13
|
+
};
|
14
|
+
drilldownDimensions: {
|
15
|
+
type: PropType<import("@sisense/sdk-data").Attribute[]>;
|
16
|
+
required: false;
|
17
|
+
default: () => never[];
|
18
|
+
};
|
19
|
+
initialDimension: {
|
20
|
+
type: PropType<import("@sisense/sdk-data").Attribute>;
|
21
|
+
required: false;
|
22
|
+
default: () => {};
|
23
|
+
};
|
24
|
+
}, void, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
25
|
+
config: {
|
26
|
+
type: PropType<DrilldownWidgetConfig>;
|
27
|
+
required: false;
|
28
|
+
default: () => {};
|
29
|
+
};
|
30
|
+
drilldownDimensions: {
|
31
|
+
type: PropType<import("@sisense/sdk-data").Attribute[]>;
|
32
|
+
required: false;
|
33
|
+
default: () => never[];
|
34
|
+
};
|
35
|
+
initialDimension: {
|
36
|
+
type: PropType<import("@sisense/sdk-data").Attribute>;
|
37
|
+
required: false;
|
38
|
+
default: () => {};
|
39
|
+
};
|
40
|
+
}>>, {
|
41
|
+
drilldownDimensions: import("@sisense/sdk-data").Attribute[];
|
42
|
+
initialDimension: import("@sisense/sdk-data").Attribute;
|
43
|
+
config: DrilldownWidgetConfig;
|
44
|
+
}, {}>;
|
@@ -1,46 +1,4 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
import type { Attribute } from '@sisense/sdk-data';
|
4
|
-
type DrilldownWidgetConfig = {
|
5
|
-
isBreadcrumbsDetached?: boolean;
|
6
|
-
breadcrumbsComponent?: Component;
|
7
|
-
contextMenuComponent?: (props: ContextMenuProps) => Component;
|
8
|
-
};
|
9
|
-
declare const _sfc_main: import("vue").DefineComponent<{
|
10
|
-
config: {
|
11
|
-
type: PropType<DrilldownWidgetConfig>;
|
12
|
-
required: false;
|
13
|
-
default: () => {};
|
14
|
-
};
|
15
|
-
drilldownDimensions: {
|
16
|
-
type: PropType<Attribute[]>;
|
17
|
-
required: false;
|
18
|
-
default: () => never[];
|
19
|
-
};
|
20
|
-
initialDimension: {
|
21
|
-
type: PropType<Attribute>;
|
22
|
-
required: false;
|
23
|
-
default: () => {};
|
24
|
-
};
|
25
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
26
|
-
config: {
|
27
|
-
type: PropType<DrilldownWidgetConfig>;
|
28
|
-
required: false;
|
29
|
-
default: () => {};
|
30
|
-
};
|
31
|
-
drilldownDimensions: {
|
32
|
-
type: PropType<Attribute[]>;
|
33
|
-
required: false;
|
34
|
-
default: () => never[];
|
35
|
-
};
|
36
|
-
initialDimension: {
|
37
|
-
type: PropType<Attribute>;
|
38
|
-
required: false;
|
39
|
-
default: () => {};
|
40
|
-
};
|
41
|
-
}>>, {
|
42
|
-
drilldownDimensions: Attribute[];
|
43
|
-
initialDimension: Attribute;
|
44
|
-
config: DrilldownWidgetConfig;
|
1
|
+
declare const _sfc_main: import("vue").DefineComponent<any, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<any>, {} | {
|
2
|
+
[x: string]: any;
|
45
3
|
}, {}>;
|
46
4
|
export default _sfc_main;
|
@@ -1,24 +1,39 @@
|
|
1
1
|
import type { PropType } from 'vue';
|
2
2
|
/**
|
3
|
-
*
|
4
|
-
*
|
3
|
+
* UI component that allows the user to filter numeric or text attributes according to
|
4
|
+
* a number of built-in operations defined in the {@link NumericFilter}, {@link TextFilter}, or {@link RankingFilter}.
|
5
|
+
*
|
6
|
+
* 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.
|
5
7
|
*
|
6
8
|
* @example
|
7
9
|
* Here's how you can use the CriteriaFilterTile component in a Vue application:
|
8
10
|
* ```vue
|
9
11
|
* <template>
|
10
|
-
* <CriteriaFilterTile
|
12
|
+
* <CriteriaFilterTile
|
13
|
+
* :title="criteriaFilterTileProps.title"
|
14
|
+
* :filter="criteriaFilterTileProps.filter"
|
15
|
+
* :onUpdate="onUpdate"
|
16
|
+
* />
|
11
17
|
* </template>
|
12
18
|
*
|
13
19
|
* <script setup lang="ts">
|
14
20
|
* import { ref } from 'vue';
|
15
21
|
* import {CriteriaFilterTile} from '@sisense/sdk-ui-vue';
|
22
|
+
* import { filterFactory } from '@sisense/sdk-data';
|
16
23
|
*
|
17
24
|
* const criteriaFilterTileProps = ref({
|
18
|
-
*
|
25
|
+
* title: 'Revenue',
|
26
|
+
* filter: filterFactory.greaterThanOrEqual(DM.Commerce.Revenue, 10000)
|
19
27
|
* });
|
28
|
+
*
|
29
|
+
* const onUpdate = (filter: Filter | null) => {
|
30
|
+
* ...
|
31
|
+
* }
|
20
32
|
* </script>
|
21
33
|
* ```
|
34
|
+
* <img src="media://criteria-filter-tile-example-1.png" width="300px" />
|
35
|
+
* @param props - Criteria filter tile props
|
36
|
+
* @returns Criteria filter tile component
|
22
37
|
*/
|
23
38
|
export declare const CriteriaFilterTile: import("vue").DefineComponent<{
|
24
39
|
arrangement: PropType<import("@sisense/sdk-ui-preact").FilterVariant | undefined>;
|
@@ -1,13 +1,16 @@
|
|
1
1
|
import type { PropType } from 'vue';
|
2
2
|
/**
|
3
|
-
*
|
4
|
-
* It maintains compatibility with Vue's reactivity system while preserving the functionality of the DateRangeFilterTile.
|
3
|
+
* Date Range Filter Tile component for filtering data by date range.
|
5
4
|
*
|
6
5
|
* @example
|
7
|
-
*
|
6
|
+
* Vue example of configuring the date min max values and handling onChange event.
|
8
7
|
* ```vue
|
9
8
|
* <template>
|
10
|
-
* <DateRangeFilterTile
|
9
|
+
* <DateRangeFilterTile
|
10
|
+
* :title="dateRangeFilterTileProps.title"
|
11
|
+
* :attribute="dateRangeFilterTileProps.attribute"
|
12
|
+
* :filter="dateRangeFilterTileProps.filter"
|
13
|
+
* :onChange="onChange" />
|
11
14
|
* </template>
|
12
15
|
*
|
13
16
|
* <script setup lang="ts">
|
@@ -15,8 +18,14 @@ import type { PropType } from 'vue';
|
|
15
18
|
* import {CriteriaFilterTile} from '@sisense/sdk-ui-vue';
|
16
19
|
*
|
17
20
|
* const dateRangeFilterTileProps = ref({
|
18
|
-
*
|
21
|
+
* title: 'Date Range',
|
22
|
+
* attribute: DM.Commerce.Date.Years,
|
23
|
+
* filter: filterFactory.dateRange(DM.Commerce.Date.Years),
|
19
24
|
* });
|
25
|
+
*
|
26
|
+
* const onChange = (filter: Filter) => {
|
27
|
+
* ...
|
28
|
+
* }
|
20
29
|
* </script>
|
21
30
|
* ```
|
22
31
|
*/
|
@@ -1,13 +1,19 @@
|
|
1
1
|
import type { PropType } from 'vue';
|
2
2
|
/**
|
3
|
-
*
|
4
|
-
*
|
3
|
+
* UI component that allows the user to select members to include/exclude in a
|
4
|
+
* filter. A query is executed against the provided data source to fetch
|
5
|
+
* all members that are selectable.
|
5
6
|
*
|
6
7
|
* @example
|
7
|
-
*
|
8
|
+
* Below is an example for filtering countries in the `Country` dimension of the `Sample ECommerce` data model.
|
8
9
|
* ```vue
|
9
10
|
* <template>
|
10
|
-
*
|
11
|
+
* <MemberFilterTile
|
12
|
+
* :title="memberFilterTileProps.title"
|
13
|
+
* :attribute="memberFilterTileProps.attribute"
|
14
|
+
* :filter="memberFilterTileProps.filter"
|
15
|
+
* :onChange={setCountryFilter}
|
16
|
+
* />
|
11
17
|
* </template>
|
12
18
|
*
|
13
19
|
* <script setup lang="ts">
|
@@ -15,8 +21,13 @@ import type { PropType } from 'vue';
|
|
15
21
|
* import MemberFilterTile from '@sisense/sdk-ui-vue/MemberFilterTile';
|
16
22
|
*
|
17
23
|
* const memberFilterTileProps = ref({
|
18
|
-
*
|
24
|
+
* title: 'Country',
|
25
|
+
* attribute: DM.Country.Country,
|
26
|
+
* filter: countryFilter,
|
19
27
|
* });
|
28
|
+
*
|
29
|
+
* const setCountryFilter = (filter: Filter | null) => {...}
|
30
|
+
*
|
20
31
|
* </script>
|
21
32
|
* ```
|
22
33
|
*/
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export { useExecuteQuery } from './use-execute-query.js';
|
2
|
+
export { useExecuteQueryByWidgetId } from './use-execute-query-by-widget-id.js';
|
3
|
+
export { useGetDashboardModel } from './use-get-dashboard-model.js';
|
4
|
+
export { useGetDashboardModels } from './use-get-dashboard-models.js';
|
5
|
+
export { useGetSharedFormula } from './use-get-shared-formula.js';
|
6
|
+
export { useGetWidgetModel } from './use-get-widget-model.js';
|
@@ -12,12 +12,31 @@ export declare const useCustomDrilldown: ({ drilldownDimensions, initialDimensio
|
|
12
12
|
sliceDrilldownSelections: (i: number) => void;
|
13
13
|
clearDrilldownSelections: () => void;
|
14
14
|
drilldownSelections: Ref<{
|
15
|
-
points: {
|
15
|
+
points: ({
|
16
16
|
value?: string | number | undefined;
|
17
17
|
categoryValue?: string | number | undefined;
|
18
18
|
categoryDisplayValue?: string | undefined;
|
19
19
|
seriesValue?: string | number | undefined;
|
20
|
-
}
|
20
|
+
} | {
|
21
|
+
x?: string | number | undefined;
|
22
|
+
y?: string | number | undefined;
|
23
|
+
size?: number | undefined;
|
24
|
+
breakByPoint?: string | undefined;
|
25
|
+
breakByColor?: string | undefined;
|
26
|
+
} | {
|
27
|
+
boxMin: number;
|
28
|
+
boxMedian: number;
|
29
|
+
boxMax: number;
|
30
|
+
whiskerMin: number;
|
31
|
+
whiskerMax: number;
|
32
|
+
categoryValue?: string | number | undefined;
|
33
|
+
categoryDisplayValue?: string | undefined;
|
34
|
+
} | {
|
35
|
+
geoName: string;
|
36
|
+
originalValue: number;
|
37
|
+
formattedOriginalValue: string;
|
38
|
+
color?: import("@sisense/sdk-ui-preact").Color | undefined;
|
39
|
+
})[];
|
21
40
|
nextDimension: {
|
22
41
|
readonly expression: string;
|
23
42
|
getSort: () => import("@sisense/sdk-data").Sort;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import type { ExecuteQueryByWidgetIdParams, QueryByWidgetIdState } from '@sisense/sdk-ui-preact';
|
2
|
+
import { type ToRefs } from 'vue';
|
3
|
+
import type { MaybeWithRefs } from '../types';
|
4
|
+
/**
|
5
|
+
* A Vue composable function `useExecuteQueryByWidgetId` for executing queries by widget ID using the Sisense SDK.
|
6
|
+
* It simplifies the process of fetching data related to a specific widget based on provided parameters and manages
|
7
|
+
* the query's loading, success, and error states. This composable integrates with the Sisense application context
|
8
|
+
* to perform queries and handle their results within Vue components.
|
9
|
+
*
|
10
|
+
* @param {ExecuteQueryByWidgetIdParams} params - Parameters for executing the query, including widget ID, filters,
|
11
|
+
* and other relevant query options. The `filters` parameter allows for specifying dynamic filters for the query.
|
12
|
+
*
|
13
|
+
* @example
|
14
|
+
* Here's how to use `useExecuteQueryByWidgetId` within a Vue component:
|
15
|
+
* ```vue
|
16
|
+
* <script setup>
|
17
|
+
* import { ref } from 'vue';
|
18
|
+
* import { useExecuteQueryByWidgetId } from './composables/useExecuteQueryByWidgetId';
|
19
|
+
*
|
20
|
+
* const widgetId = ref('your_widget_id_here');
|
21
|
+
* const filters = ref([...]); // Define filters if necessary
|
22
|
+
*
|
23
|
+
* const { data, isLoading, isError, isSuccess, error } = useExecuteQueryByWidgetId({
|
24
|
+
* widgetId,
|
25
|
+
* filters,
|
26
|
+
* enabled: true, // Optional: Use to enable/disable the query execution
|
27
|
+
* });
|
28
|
+
* </script>
|
29
|
+
* ```
|
30
|
+
*
|
31
|
+
* This composable returns an object containing reactive state management properties for the query:
|
32
|
+
* - `data`: The result of the query, undefined until the query completes successfully.
|
33
|
+
* - `isLoading`: A boolean indicating if the query is currently loading.
|
34
|
+
* - `isError`: A boolean indicating if an error occurred during the query execution.
|
35
|
+
* - `isSuccess`: A boolean indicating if the query executed successfully.
|
36
|
+
* - `error`: An Error object containing the error details if an error occurred.
|
37
|
+
* - `query`: The query object returned by the SDK, useful for debugging or advanced handling.
|
38
|
+
*
|
39
|
+
* Utilizing this composable allows for declarative and reactive handling of widget-specific queries within Vue applications,
|
40
|
+
* facilitating easier data fetching and state management with the Sisense SDK.
|
41
|
+
*/
|
42
|
+
export declare const useExecuteQueryByWidgetId: (params: MaybeWithRefs<ExecuteQueryByWidgetIdParams>) => ToRefs<QueryByWidgetIdState>;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { type ExecuteQueryParams } from '@sisense/sdk-ui-preact';
|
2
|
+
import type { MaybeWithRefs } from '../types';
|
3
|
+
/**
|
4
|
+
* A Vue composable function `useExecuteQuery` for executing Sisense queries with flexible parameters.
|
5
|
+
* It handles query execution, including loading, error, and success states, and enables dynamic query configuration
|
6
|
+
* through reactive parameters. This composable is particularly useful for applications requiring data from Sisense
|
7
|
+
* analytics, offering a reactive and declarative approach to data fetching and state management.
|
8
|
+
*
|
9
|
+
* @param {MaybeWithRefs<ExecuteQueryParams>} params - The parameters for the query, supporting reactive Vue refs.
|
10
|
+
* Includes details such as `dataSource`, `dimensions`, `measures`, `filters`, and more, allowing for comprehensive
|
11
|
+
* query configuration. The `filters` parameter supports dynamic filtering based on user interaction or other application
|
12
|
+
* state changes.
|
13
|
+
*
|
14
|
+
* @example
|
15
|
+
* How to use `useExecuteQuery` within a Vue component:
|
16
|
+
* ```vue
|
17
|
+
* <script setup>
|
18
|
+
* import { ref } from 'vue';
|
19
|
+
* import { useExecuteQuery } from './composables/useExecuteQuery';
|
20
|
+
*
|
21
|
+
* const dataSource = ref('your_data_source_id');
|
22
|
+
* // Set up other query parameters as needed (dimensions, measures, filters, etc.)
|
23
|
+
*
|
24
|
+
* const { data, isLoading, isError, isSuccess, error } = useExecuteQuery({
|
25
|
+
* dataSource,
|
26
|
+
* dimensions: [...],
|
27
|
+
* measures: [...],
|
28
|
+
* filters: [...],
|
29
|
+
* // Additional query parameters
|
30
|
+
* });
|
31
|
+
* </script>
|
32
|
+
* ```
|
33
|
+
*
|
34
|
+
* The composable returns an object with the following reactive properties to manage the query state:
|
35
|
+
* - `data`: The data returned from the query. It remains `undefined` until the query completes successfully.
|
36
|
+
* - `isLoading`: Indicates if the query is in progress.
|
37
|
+
* - `isError`: Indicates if an error occurred during query execution.
|
38
|
+
* - `isSuccess`: Indicates if the query executed successfully without errors.
|
39
|
+
* - `error`: Contains the error object if an error occurred during the query.
|
40
|
+
*
|
41
|
+
* This composable facilitates integrating Sisense data fetching into Vue applications, enabling developers
|
42
|
+
* to easily manage query states and dynamically adjust query parameters based on application needs.
|
43
|
+
*/
|
44
|
+
export declare const useExecuteQuery: (params: MaybeWithRefs<ExecuteQueryParams>) => import("vue").ToRefs<import("@sisense/sdk-ui-preact").QueryState>;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import type { MaybeWithRefs } from '../types';
|
2
|
+
import type { GetDashboardModelParams } from '@sisense/sdk-ui-preact';
|
3
|
+
/**
|
4
|
+
* A Vue composable function `useGetDashboardModel` for fetching a Sisense dashboard model.
|
5
|
+
* It simplifies the process of retrieving detailed dashboard data, including widgets if specified,
|
6
|
+
* by managing the loading, success, and error states of the request. This composable is especially useful
|
7
|
+
* for Vue applications that need to integrate Sisense dashboard analytics, providing a reactive way to fetch
|
8
|
+
* and display dashboard data.
|
9
|
+
*
|
10
|
+
* @param {GetDashboardModelParams} params - The parameters for fetching the dashboard model, including the
|
11
|
+
* dashboard OID and an option to include widgets within the dashboard. Supports dynamic parameter values through
|
12
|
+
* Vue refs, allowing for reactive dashboard loading based on user interactions or other application states.
|
13
|
+
*
|
14
|
+
* @example
|
15
|
+
* How to use `useGetDashboardModel` within a Vue component to fetch and display a Sisense dashboard:
|
16
|
+
* ```vue
|
17
|
+
* <script setup>
|
18
|
+
* import { ref } from 'vue';
|
19
|
+
* import { useGetDashboardModel } from './composables/useGetDashboardModel';
|
20
|
+
*
|
21
|
+
* const dashboardOid = ref('your_dashboard_oid');
|
22
|
+
* const includeWidgets = ref(true); // Decide whether to include widgets in the dashboard model
|
23
|
+
*
|
24
|
+
* const { data: dashboardModel, isLoading, isError, error } = useGetDashboardModel({
|
25
|
+
* dashboardOid,
|
26
|
+
* includeWidgets,
|
27
|
+
* });
|
28
|
+
* </script>
|
29
|
+
* ```
|
30
|
+
*
|
31
|
+
* The composable returns an object with reactive properties to manage the state of the dashboard model fetching process:
|
32
|
+
* - `dashboard`: The fetched dashboard model data, which is `undefined` until the fetch completes successfully.
|
33
|
+
* - `isLoading`: Indicates if the dashboard model is currently being fetched.
|
34
|
+
* - `isError`: Indicates if an error occurred during the fetch process.
|
35
|
+
* - `isSuccess`: Indicates if the dashboard model was successfully fetched without errors.
|
36
|
+
* - `error`: Contains the error object if an error occurred during the fetch.
|
37
|
+
*
|
38
|
+
* Utilizing this composable enables developers to declaratively integrate Sisense dashboard analytics into their Vue applications,
|
39
|
+
* managing data fetching and state with minimal boilerplate code.
|
40
|
+
*/
|
41
|
+
export declare const useGetDashboardModel: (params: MaybeWithRefs<GetDashboardModelParams>) => import("vue").ToRefs<import("@sisense/sdk-ui-preact").DashboardModelState>;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import type { GetDashboardModelsParams } from '@sisense/sdk-ui-preact';
|
2
|
+
import type { MaybeWithRefs } from '../types';
|
3
|
+
/**
|
4
|
+
* A Vue composable function `useGetDashboardModels` for fetching multiple Sisense dashboard models.
|
5
|
+
* This function abstracts the complexities of managing API calls and state management for fetching an array of
|
6
|
+
* dashboard models from Sisense. It provides a reactive interface to handle loading, success, and error states,
|
7
|
+
* making it easier to integrate Sisense analytics within Vue applications.
|
8
|
+
*
|
9
|
+
* @param {GetDashboardModelsParams} params - Parameters for fetching the dashboard models, which can include filters,
|
10
|
+
* sorting options, and pagination settings to customize the fetch operation. The parameters allow for precise control
|
11
|
+
* over which dashboards are retrieved and in what order.
|
12
|
+
*
|
13
|
+
* @example
|
14
|
+
* How to use `useGetDashboardModels` within a Vue component to fetch and list Sisense dashboards:
|
15
|
+
* ```vue
|
16
|
+
* <script setup>
|
17
|
+
* import { ref } from 'vue';
|
18
|
+
* import { useGetDashboardModels } from './composables/useGetDashboardModels';
|
19
|
+
*
|
20
|
+
* const params = ref({
|
21
|
+
* // Define your parameters here, such as pagination settings, filters, etc.
|
22
|
+
* });
|
23
|
+
*
|
24
|
+
* const { data: dashboardModels, isLoading, isError, error } = useGetDashboardModels(params);
|
25
|
+
* </script>
|
26
|
+
* ```
|
27
|
+
*
|
28
|
+
* The composable returns an object with reactive properties that represent the state of the fetch operation:
|
29
|
+
* - `data`: An array of dashboard models returned from the fetch operation. This is `undefined` until the operation completes successfully.
|
30
|
+
* - `isLoading`: A boolean indicating whether the fetch operation is currently in progress.
|
31
|
+
* - `isError`: A boolean indicating whether an error occurred during the fetch operation.
|
32
|
+
* - `isSuccess`: A boolean indicating whether the fetch operation completed successfully without any errors.
|
33
|
+
* - `error`: An error object containing details about any errors that occurred during the fetch operation.
|
34
|
+
*
|
35
|
+
* This composable is ideal for Vue applications requiring a list of Sisense dashboards, providing a streamlined, reactive
|
36
|
+
* way to fetch and manage the state of multiple dashboard models.
|
37
|
+
*/
|
38
|
+
export declare const useGetDashboardModels: (params: MaybeWithRefs<GetDashboardModelsParams>) => import("vue").ToRefs<import("@sisense/sdk-ui-preact").DashboardModelsState>;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import type { UseGetSharedFormulaParams } from '@sisense/sdk-ui-preact';
|
2
|
+
import type { MaybeWithRefs } from '../types';
|
3
|
+
/**
|
4
|
+
* A Vue composable function `useGetSharedFormula` for retrieving shared formulas from Sisense.
|
5
|
+
* This function enables fetching a shared formula either by its unique OID or by its name and associated data source,
|
6
|
+
* providing flexibility in how shared formulas are accessed. It manages the fetch operation's state, including loading,
|
7
|
+
* success, and error states, offering a reactive way to integrate Sisense formulas into Vue applications.
|
8
|
+
*
|
9
|
+
* @param {UseGetSharedFormulaParams} params - Parameters for fetching the shared formula, including the formula's OID,
|
10
|
+
* or its name and the data source. This allows for precise specification of the formula to be fetched, supporting dynamic
|
11
|
+
* values through Vue refs for reactive fetching based on user interactions or other application states.
|
12
|
+
*
|
13
|
+
* @example
|
14
|
+
* How to use `useGetSharedFormula` within a Vue component to fetch a shared formula:
|
15
|
+
* ```vue
|
16
|
+
* <script setup>
|
17
|
+
* import { ref } from 'vue';
|
18
|
+
* import { useGetSharedFormula } from './composables/useGetSharedFormula';
|
19
|
+
*
|
20
|
+
* // To fetch by OID
|
21
|
+
* const paramsByOid = ref({
|
22
|
+
* oid: 'your_formula_oid',
|
23
|
+
* });
|
24
|
+
*
|
25
|
+
* // Or to fetch by name and dataSource
|
26
|
+
* const paramsByName = ref({
|
27
|
+
* name: 'your_formula_name',
|
28
|
+
* dataSource: 'your_data_source_id',
|
29
|
+
* });
|
30
|
+
*
|
31
|
+
* const { data: formula, isLoading, isError, error } = useGetSharedFormula(paramsByOid);
|
32
|
+
* // Or use `paramsByName` instead of `paramsByOid` depending on the fetching method
|
33
|
+
* </script>
|
34
|
+
* ```
|
35
|
+
*
|
36
|
+
* The composable returns an object with reactive properties to manage the state of the shared formula fetching process:
|
37
|
+
* - `data`: The fetched shared formula, which is `undefined` until the operation completes successfully. It can be either a `CalculatedMeasure` or `DimensionalCalculatedMeasure` based on the fetch result.
|
38
|
+
* - `isLoading`: Indicates whether the fetch operation is currently in progress.
|
39
|
+
* - `isError`: Indicates whether an error occurred during the fetch operation.
|
40
|
+
* - `isSuccess`: Indicates whether the fetch operation completed successfully without any errors.
|
41
|
+
* - `error`: Contains the error object if an error occurred during the fetch.
|
42
|
+
*
|
43
|
+
* This composable provides a streamlined, reactive approach to fetching shared formulas from Sisense, facilitating their integration into Vue applications for enhanced data analytics capabilities.
|
44
|
+
*/
|
45
|
+
export declare const useGetSharedFormula: (params: MaybeWithRefs<UseGetSharedFormulaParams>) => import("vue").ToRefs<import("@sisense/sdk-ui-preact").SharedFormulaState>;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import type { GetWidgetModelParams, WidgetModel } from '@sisense/sdk-ui-preact';
|
2
|
+
import type { MaybeWithRefs } from '../types';
|
3
|
+
/**
|
4
|
+
* A Vue composable function `useGetWidgetModel` for retrieving widget models from a Sisense dashboard.
|
5
|
+
* It is designed to fetch a specific widget model based on the provided dashboard and widget OIDs, handling the loading,
|
6
|
+
* success, and error states of the fetch operation. This composable is particularly useful for Vue applications that
|
7
|
+
* require detailed information about a Sisense widget for data visualization or analytics purposes.
|
8
|
+
*
|
9
|
+
* @param {GetWidgetModelParams} params - The parameters for fetching the widget model, including the `dashboardOid`
|
10
|
+
* (the OID of the dashboard containing the widget) and the `widgetOid` (the OID of the widget to fetch). This allows for
|
11
|
+
* precise and dynamic fetching of widget models based on application needs.
|
12
|
+
*
|
13
|
+
* @example
|
14
|
+
* How to use `useGetWidgetModel` within a Vue component to fetch and display widget information:
|
15
|
+
* ```vue
|
16
|
+
* <script setup>
|
17
|
+
* import { ref } from 'vue';
|
18
|
+
* import { useGetWidgetModel } from './composables/useGetWidgetModel';
|
19
|
+
*
|
20
|
+
* const dashboardOid = ref('your_dashboard_oid');
|
21
|
+
* const widgetOid = ref('your_widget_oid');
|
22
|
+
*
|
23
|
+
* const { data: widgetModel, isLoading, isError, error } = useGetWidgetModel({
|
24
|
+
* dashboardOid,
|
25
|
+
* widgetOid,
|
26
|
+
* });
|
27
|
+
* </script>
|
28
|
+
* ```
|
29
|
+
*
|
30
|
+
* The composable returns an object with reactive properties that represent the state of the widget model fetch operation:
|
31
|
+
* - `data`: The fetched widget model, which is `undefined` until the operation is successfully completed. The widget model
|
32
|
+
* contains detailed information about the widget, such as its configuration, data, and settings.
|
33
|
+
* - `isLoading`: A boolean indicating whether the fetch operation is currently in progress.
|
34
|
+
* - `isError`: A boolean indicating whether an error occurred during the fetch operation.
|
35
|
+
* - `isSuccess`: A boolean indicating whether the fetch operation was successfully completed without any errors.
|
36
|
+
* - `error`: An error object containing details about any errors that occurred during the fetch operation.
|
37
|
+
*
|
38
|
+
* This composable streamlines the process of fetching and managing Sisense widget models within Vue applications, providing
|
39
|
+
* developers with a reactive and efficient way to integrate Sisense data visualizations and analytics.
|
40
|
+
*/
|
41
|
+
export declare const useGetWidgetModel: (params: MaybeWithRefs<GetWidgetModelParams>) => import("vue").ToRefs<import("@sisense/sdk-ui-preact").DataState<WidgetModel>>;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* @internal
|
3
|
+
* A Vue composable function `useTracking` designed to track the usage of hooks within Vue applications
|
4
|
+
* using the Sisense SDK. It sends tracking information to the server whenever a specified hook is used,
|
5
|
+
* helping in the analysis and optimization of application performance and usage patterns. This composable
|
6
|
+
* is intended for internal use and aids in monitoring the integration and efficiency of Sisense SDK hooks.
|
7
|
+
*
|
8
|
+
* @param {string} hookName - The name of the hook being tracked. This identifier is used to log the hook
|
9
|
+
* event uniquely, facilitating the collection of usage data for specific hooks within the application.
|
10
|
+
*
|
11
|
+
* @example
|
12
|
+
* How to use `useTracking` to track the usage of a custom hook:
|
13
|
+
* ```javascript
|
14
|
+
* import { useTracking } from './composables/useTracking';
|
15
|
+
*
|
16
|
+
* // Example hook that utilizes useTracking for monitoring its usage
|
17
|
+
* export const useCustomHook = () => {
|
18
|
+
* const { hasTrackedRef } = useTracking('useCustomHook');
|
19
|
+
*
|
20
|
+
* // Hook implementation...
|
21
|
+
*
|
22
|
+
* return {
|
23
|
+
* // Return values of your custom hook
|
24
|
+
* };
|
25
|
+
* };
|
26
|
+
* ```
|
27
|
+
*
|
28
|
+
* The composable returns an object containing:
|
29
|
+
* - `hasTrackedRef`: A Vue ref that indicates whether the tracking for the hook has been successfully
|
30
|
+
* sent to the server. It starts as `false` and is set to `true` once tracking is completed, preventing
|
31
|
+
* duplicate tracking events.
|
32
|
+
*
|
33
|
+
* This internal utility composable is essential for maintaining insights into the usage of custom hooks
|
34
|
+
* within applications leveraging the Sisense SDK, enabling developers and analysts to understand and optimize
|
35
|
+
* hook interactions and performance.
|
36
|
+
*/
|
37
|
+
export declare const useTracking: (hookName: string) => {
|
38
|
+
hasTrackedRef: import("vue").Ref<boolean>;
|
39
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { type Ref } from 'vue';
|
2
|
+
type State = Record<string, unknown>;
|
3
|
+
type Action = {
|
4
|
+
type: string;
|
5
|
+
};
|
6
|
+
type Dispatch<A extends Action> = (action: A) => void;
|
7
|
+
type Reducer<S extends State, A extends Action> = (state: S, action: A) => S;
|
8
|
+
type ReturnValue<S extends State, A extends Action> = [Ref<S>, Dispatch<A>];
|
9
|
+
export declare function useReducer<S extends State, A extends Action>(reducer: Reducer<S, A>, initialState: S): ReturnValue<S, A>;
|
10
|
+
export {};
|
package/dist/src/lib.d.ts
CHANGED
@@ -1,14 +1,8 @@
|
|
1
|
-
/**
|
2
|
-
* @packageDocumentation
|
3
|
-
* @alpha
|
4
|
-
*/
|
5
1
|
export { DrilldownBreadcrumbs } from './components/drilldown-breadcrumbs';
|
6
2
|
export * from './components/charts';
|
7
3
|
export * from './components/filters';
|
8
4
|
export * from './providers';
|
9
|
-
export * from './
|
5
|
+
export * from './composables';
|
10
6
|
export * from './components/context-menu';
|
11
7
|
export { default as DrilldownWidget } from './components/drilldown-widget.vue';
|
12
|
-
|
13
|
-
export type ContextMenuProps = Omit<ContextMenuPropsPreact, 'children'>;
|
14
|
-
export type { AreaChartProps, BarChartProps, ChartProps, LineChartProps, ColumnChartProps, FunnelChartProps, PolarChartProps, ScatterChartProps, PieChartProps, TreemapChartProps, SunburstChartProps, IndicatorChartProps, MemberFilterTileProps, CriteriaFilterTileProps, DateRangeFilterTileProps, ChartWidgetProps, TableWidgetProps, TableProps, CustomSisenseContextProviderProps, ExecuteQueryByWidgetIdParams, ExecuteQueryParams, GetWidgetModelParams, ExecuteCsvQueryParams, GetSharedFormulaParams, GetDashboardModelParams, UseGetSharedFormulaParams, GetDashboardModelsParams, DrilldownBreadcrumbsProps, BoxplotChartProps, AreamapChartProps, SisenseContextProviderProps, ThemeProviderProps, ScattermapChartProps, } from '@sisense/sdk-ui-preact';
|
8
|
+
export * from './sdk-ui-core-exports';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { SisenseContextProvider, createSisenseContextConnector } from './sisense-context-provider';
|
1
|
+
export { SisenseContextProvider, createSisenseContextConnector, getApp, } from './sisense-context-provider';
|
2
2
|
export { ThemeProvider, createThemeContextConnector } from './theme-provider';
|