@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.
Files changed (55) hide show
  1. package/dist/index.js +83668 -62966
  2. package/dist/src/components/charts/area-chart.d.ts +22 -9
  3. package/dist/src/components/charts/areamap-chart.d.ts +23 -17
  4. package/dist/src/components/charts/bar-chart.d.ts +23 -10
  5. package/dist/src/components/charts/boxplot-chart.d.ts +29 -15
  6. package/dist/src/components/charts/chart-widget.d.ts +42 -11
  7. package/dist/src/components/charts/chart.d.ts +16 -27
  8. package/dist/src/components/charts/column-chart.d.ts +23 -10
  9. package/dist/src/components/charts/dashboard-widget.d.ts +11 -11
  10. package/dist/src/components/charts/funnel-chart.d.ts +21 -7
  11. package/dist/src/components/charts/index.d.ts +1 -0
  12. package/dist/src/components/charts/indicator-chart.d.ts +20 -9
  13. package/dist/src/components/charts/line-chart.d.ts +20 -8
  14. package/dist/src/components/charts/pie-chart.d.ts +22 -10
  15. package/dist/src/components/charts/pivot-table.d.ts +41 -0
  16. package/dist/src/components/charts/polar-chart.d.ts +22 -10
  17. package/dist/src/components/charts/scatter-chart.d.ts +28 -10
  18. package/dist/src/components/charts/scattermap-chart.d.ts +22 -7
  19. package/dist/src/components/charts/sunburst-chart.d.ts +16 -8
  20. package/dist/src/components/charts/table-widget.d.ts +6 -4
  21. package/dist/src/components/charts/table.d.ts +6 -5
  22. package/dist/src/components/charts/treemap-chart.d.ts +21 -9
  23. package/dist/src/components/context-menu.d.ts +32 -0
  24. package/dist/src/components/drilldown-breadcrumbs.d.ts +41 -0
  25. package/dist/src/components/drilldown-widget.d.ts +44 -0
  26. package/dist/src/components/drilldown-widget.vue.d.ts +2 -44
  27. package/dist/src/components/filters/basic-member-filter-tile.d.ts +1 -0
  28. package/dist/src/components/filters/criteria-filter-tile.d.ts +19 -4
  29. package/dist/src/components/filters/date-range-filter-tile.d.ts +14 -5
  30. package/dist/src/components/filters/member-filter-tile.d.ts +16 -5
  31. package/dist/src/composables/index.d.ts +6 -0
  32. package/dist/src/{hooks → composables}/use-custom-drilldown.d.ts +21 -2
  33. package/dist/src/composables/use-execute-query-by-widget-id.d.ts +42 -0
  34. package/dist/src/composables/use-execute-query.d.ts +44 -0
  35. package/dist/src/composables/use-get-dashboard-model.d.ts +41 -0
  36. package/dist/src/composables/use-get-dashboard-models.d.ts +38 -0
  37. package/dist/src/composables/use-get-shared-formula.d.ts +45 -0
  38. package/dist/src/composables/use-get-widget-model.d.ts +41 -0
  39. package/dist/src/composables/use-tracking.d.ts +39 -0
  40. package/dist/src/helpers/use-reducer.d.ts +10 -0
  41. package/dist/src/lib.d.ts +2 -8
  42. package/dist/src/providers/index.d.ts +1 -1
  43. package/dist/src/providers/sisense-context-provider.d.ts +49 -9
  44. package/dist/src/providers/theme-provider.d.ts +60 -5
  45. package/dist/src/sdk-ui-core-exports.d.ts +5 -0
  46. package/dist/src/types.d.ts +5 -0
  47. package/dist/src/utils.d.ts +6 -0
  48. package/package.json +4 -1
  49. package/dist/src/hooks/index.d.ts +0 -6
  50. package/dist/src/hooks/use-execute-query-by-widget-id.d.ts +0 -9
  51. package/dist/src/hooks/use-execute-query.d.ts +0 -11
  52. package/dist/src/hooks/use-get-dashboard-model.d.ts +0 -4
  53. package/dist/src/hooks/use-get-dashboard-models.d.ts +0 -4
  54. package/dist/src/hooks/use-get-shared-formula.d.ts +0 -4
  55. package/dist/src/hooks/use-get-widget-model.d.ts +0 -4
@@ -1,18 +1,15 @@
1
- import type { PropType } from 'vue';
2
- import type { SisenseContextProviderProps } from '@sisense/sdk-ui-preact';
1
+ import type { PropType, Ref } from 'vue';
3
2
  import { ClientApplication } from '@sisense/sdk-ui-preact';
4
- /**
5
- * Gets Sisense context
6
- */
7
- export declare const getSisenseContext: () => SisenseContextProviderProps;
8
3
  /**
9
4
  * Gets Sisense application
5
+ * @internal
10
6
  */
11
- export declare const getApp: () => Promise<ClientApplication>;
7
+ export declare const getApp: () => Ref<ClientApplication | undefined>;
12
8
  /**
13
9
  * Creates Sisense context connector
10
+ * @internal
14
11
  */
15
- export declare const createSisenseContextConnector: () => {
12
+ export declare const createSisenseContextConnector: (app: ClientApplication) => {
16
13
  prepareContext(): Promise<{
17
14
  app: ClientApplication;
18
15
  isInitialized: boolean;
@@ -20,8 +17,51 @@ export declare const createSisenseContextConnector: () => {
20
17
  renderContextProvider: (contextData: import("@sisense/sdk-ui-preact").CustomSisenseContext | undefined, children: import("preact").VNode<{}>, error?: Error | undefined) => import("preact").VNode<{}>;
21
18
  };
22
19
  /**
23
- * Sisense Context Provider
20
+ * Sisense Context Provider Component allowing you to connect to
21
+ * a Sisense instance and provide that context
22
+ * to all Compose SDK components in your application.
23
+ *
24
+ * @example
25
+ * Here's how to use the `SisenseContextProvider` component to wrap your Sisense-enabled application:
26
+ * Add SisenseContextProvider to the main component of your app as below and then wrap
27
+ * other SDK components inside this component.
28
+ * ```vue
29
+ * <template>
30
+ * <SisenseContextProvider
31
+ * :url="sisenseUrl"
32
+ * :defaultDataSource="defaultDataSource"
33
+ * :ssoEnabled="true"
34
+ * :token="authToken"
35
+ * :wat="watToken"
36
+ * :appConfig="appConfigurations"
37
+ * :showRuntimeErrors="true"
38
+ * :enableTracking="false"
39
+ * >
40
+ * <!-- Your application components here -->
41
+ * </SisenseContextProvider>
42
+ * </template>
43
+ *
44
+ * <script>
45
+ * import { ref } from 'vue';
46
+ * import SisenseContextProvider from './SisenseContextProvider.vue';
47
+ *
48
+ * export default {
49
+ * components: { SisenseContextProvider },
50
+ * setup() {
51
+ * const sisenseUrl = ref('https://your-sisense-instance.com');
52
+ * const defaultDataSource = ref('default_datasource_id');
53
+ * const authToken = ref('your_auth_token');
54
+ * const watToken = ref('your_wat_token');
55
+ * const appConfigurations = ref({});
56
+ *
57
+ * return { sisenseUrl, defaultDataSource, authToken, watToken, appConfigurations };
58
+ * }
59
+ * };
60
+ * </script>
61
+ * ```
24
62
  *
63
+ * @param props - Sisense context provider props
64
+ * @returns A Sisense Context Provider Component
25
65
  */
26
66
  export declare const SisenseContextProvider: import("vue").DefineComponent<{
27
67
  defaultDataSource: PropType<string | undefined>;
@@ -1,8 +1,9 @@
1
- import type { PropType } from 'vue';
1
+ import type { PropType, Ref } from 'vue';
2
+ import type { CompleteThemeSettings } from '@sisense/sdk-ui-preact';
2
3
  /**
3
4
  * Gets Theme context
4
5
  */
5
- export declare const getThemeContext: () => {
6
+ export declare const getThemeContext: () => Ref<{
6
7
  chart: {
7
8
  textColor: string;
8
9
  secondaryTextColor: string;
@@ -23,11 +24,11 @@ export declare const getThemeContext: () => {
23
24
  primaryButtonTextColor: string;
24
25
  primaryButtonHoverColor: string;
25
26
  };
26
- };
27
+ }> | undefined;
27
28
  /**
28
29
  * Creates theme context connector
29
30
  */
30
- export declare const createThemeContextConnector: () => {
31
+ export declare const createThemeContextConnector: (themeSettings?: CompleteThemeSettings) => {
31
32
  prepareContext(): Promise<{
32
33
  themeSettings: {
33
34
  chart: {
@@ -80,7 +81,61 @@ export declare const createThemeContextConnector: () => {
80
81
  }, children: import("preact").VNode<{}>, error?: Error | undefined) => import("preact").VNode<{}>;
81
82
  };
82
83
  /**
83
- * Theme Provider
84
+ * Theme provider, which allows you to adjust the look and feel of child components.
85
+ *
86
+ * @example
87
+ * Example of a theme provider, which changes the colors and font of the nested indicator chart:
88
+ * ```vue
89
+ * <template>
90
+ * <ThemeProvider :theme="customTheme">
91
+ * <IndicatorChart .... />
92
+ * </ThemeProvider>
93
+ * </template>
94
+ *
95
+ * <script>
96
+ * import { ref } from 'vue';
97
+ * import ThemeProvider from './ThemeProvider.vue';
98
+ *
99
+ * export default {
100
+ * components: { ThemeProvider },
101
+ * setup() {
102
+ * const customTheme = ref({
103
+ chart: {
104
+ backgroundColor: '#333333',
105
+ textColor: 'orange',
106
+ secondaryTextColor: 'purple',
107
+ },
108
+ typography: {
109
+ fontFamily: 'impact',
110
+ },
111
+ * });
112
+ *
113
+ * return { customTheme };
114
+ * }
115
+ * };
116
+ * </script>
117
+ * ```
118
+ *
119
+ * Alternatively, to fetch theme settings based on a theme ID:
120
+ * ```vue
121
+ * <template>
122
+ * <ThemeProvider :theme="'theme_id_string'">
123
+ * <!-- Components that will use the fetched theme settings -->
124
+ * </ThemeProvider>
125
+ * </template>
126
+ * ```
127
+ *
128
+ * Indicator chart with custom theme settings:
129
+ * <img src="media://indicator-chart-example-2.png" width="400px" />
130
+ *
131
+ *
132
+ * For comparison, indicator chart with default theme settings:
133
+ *
134
+ * <img src="media://indicator-chart-example-1.png" width="400px" />
135
+ * @see {@link ThemeSettings} and {@link IndicatorChart}
136
+ * @param props - Theme provider props
137
+ * @returns A Theme Provider component * @prop {Object | String} theme - Theme settings object for custom themes or a string identifier to fetch theme settings. When provided as an object, it merges with the default theme settings. When provided as a string, it attempts to fetch theme settings using the provided ID.
138
+ * @prop {Boolean} skipTracking [internal] - Specifies whether to skip tracking of theme usage. Intended for internal use and debugging purposes.
84
139
  */
85
140
  export declare const ThemeProvider: import("vue").DefineComponent<{
86
141
  theme: PropType<string | import("@sisense/sdk-ui-preact").ThemeSettings | undefined>;
@@ -0,0 +1,5 @@
1
+ export { boxWhiskerProcessResult } from '@sisense/sdk-ui-preact';
2
+ export type { ChartType, CartesianChartType, CategoricalChartType, ScatterChartType, IndicatorChartType, BoxplotChartType, ScattermapChartType, AreamapChartType, TableType, AreaSubtype, LineSubtype, PieSubtype, PolarSubtype, StackableSubtype, BoxplotSubtype, WidgetType, CartesianWidgetType, CategoricalWidgetType, TabularWidgetType, AreaChartProps, BarChartProps, ChartProps, LineChartProps, ColumnChartProps, FunnelChartProps, PolarChartProps, ScatterChartProps, PieChartProps, TreemapChartProps, SunburstChartProps, IndicatorChartProps, MemberFilterTileProps, CriteriaFilterTileProps, DateRangeFilterTileProps, ChartWidgetProps, TableWidgetProps, TableProps, PivotTableProps, DrilldownBreadcrumbsProps, BoxplotChartProps, AreamapChartProps, ScattermapChartProps, SisenseContextProviderProps, ExecuteQueryByWidgetIdParams, ExecuteQueryParams, GetWidgetModelParams, ExecuteCsvQueryParams, GetSharedFormulaParams, GetDashboardModelParams, UseGetSharedFormulaParams, GetDashboardModelsParams, ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ScatterChartDataOptions, IndicatorChartDataOptions, BoxplotChartDataOptions, BoxplotChartCustomDataOptions, ScattermapChartDataOptions, AreamapChartDataOptions, TableDataOptions, PivotTableDataOptions, WidgetDataOptions, NumberFormatConfig, DecimalScale, DataColorCondition, ConditionalDataColorOptions, DataColorOptions, RangeDataColorOptions, UniformDataColorOptions, ValueToColorMap, MultiColumnValueToColorMap, SortDirection, BoxWhiskerType, ScattermapLocationLevel, StyledColumn, StyledMeasureColumn, ChartStyleOptions, LineStyleOptions, AreaStyleOptions, StackableStyleOptions, PieStyleOptions, FunnelStyleOptions, PolarStyleOptions, IndicatorStyleOptions, NumericSimpleIndicatorStyleOptions, NumericBarIndicatorStyleOptions, GaugeIndicatorStyleOptions, ScatterStyleOptions, TreemapStyleOptions, SunburstStyleOptions, BoxplotStyleOptions, ScattermapStyleOptions, AreamapStyleOptions, ChartWidgetStyleOptions, WidgetStyleOptions, DashboardWidgetStyleOptions, TableStyleOptions, PivotTableStyleOptions, DataLimits, Legend, Markers, Labels, IndicatorComponents, ScatterMarkerSize, LineWidth, AxisLabel, Convolution, SeriesLabels, X2Title, ScattermapMarkers, WidgetModel, DashboardModel, BeforeRenderHandler, DataPoint, ScatterDataPoint, HighchartsOptions, BoxplotDataPoint, AppConfig, DateConfig, MenuItemSection, MonthOfYear, DayOfWeek, DateLevel, ThemeOid, GetDashboardModelOptions, GetDashboardModelsOptions, SeriesChartType, MenuPosition, ThemeSettings, Color, ColorPaletteTheme, Navigator, DrilldownOptions, DrilldownSelection, CriteriaFilterType, Member, FilterVariant, } from '@sisense/sdk-ui-preact';
3
+ import type { ContextMenuProps as ContextMenuPropsPreact, ThemeProviderProps as ThemeProviderPropsPreact } from '@sisense/sdk-ui-preact';
4
+ export type ContextMenuProps = Omit<ContextMenuPropsPreact, 'children'>;
5
+ export type ThemeProviderProps = Omit<ThemeProviderPropsPreact, 'children'>;
@@ -0,0 +1,5 @@
1
+ import type { Ref } from 'vue';
2
+ export type MaybeRef<T> = Ref<T> | T;
3
+ export type MaybeWithRefs<T> = {
4
+ [Property in keyof T]: Ref<T[Property]> | T[Property];
5
+ };
@@ -0,0 +1,6 @@
1
+ import type { MaybeRef, MaybeWithRefs } from './types';
2
+ export declare function toPlainValue<T>(value: MaybeRef<T>): T;
3
+ export declare function toPlainValues<T extends object>(refObj: T): {
4
+ [K in keyof T]: T[K] extends MaybeRef<infer R> ? R : T[K];
5
+ };
6
+ export declare function collectRefs<T extends {}>(objectWithRefs: MaybeWithRefs<T>): unknown[];
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "Sisense",
12
12
  "Compose SDK"
13
13
  ],
14
- "version": "1.2.0",
14
+ "version": "1.4.0",
15
15
  "type": "module",
16
16
  "main": "./dist/index.js",
17
17
  "module": "./dist/index.js",
@@ -34,10 +34,13 @@
34
34
  "format:check": "prettier --check ."
35
35
  },
36
36
  "dependencies": {
37
+ "deepmerge": "^4.3.1",
38
+ "lodash": "^4.17.21",
37
39
  "vue": "^3.3.2"
38
40
  },
39
41
  "devDependencies": {
40
42
  "@rushstack/eslint-patch": "^1.2.0",
43
+ "@types/lodash": "^4.14.194",
41
44
  "@types/node": "^18.14.2",
42
45
  "@vitejs/plugin-vue": "^4.0.0",
43
46
  "@vue/eslint-config-prettier": "^7.1.0",
@@ -1,6 +0,0 @@
1
- export { useExecuteQuery } from './use-execute-query';
2
- export { useExecuteQueryByWidgetId } from './use-execute-query-by-widget-id';
3
- export { useGetDashboardModel } from './use-get-dashboard-model';
4
- export { useGetDashboardModels } from './use-get-dashboard-models';
5
- export { useGetSharedFormula } from './use-get-shared-formula';
6
- export { useGetWidgetModel } from './use-get-widget-model';
@@ -1,9 +0,0 @@
1
- import type { ExecuteQueryByWidgetIdParams } from '@sisense/sdk-ui-preact';
2
- export declare const useExecuteQueryByWidgetId: (params: ExecuteQueryByWidgetIdParams) => Promise<{
3
- data: {
4
- data: import("@sisense/sdk-data").QueryResultData;
5
- query: Omit<import("@sisense/sdk-ui-preact").ExecuteQueryParams, "filters"> & {
6
- filters?: import("@sisense/sdk-data").Filter[] | undefined;
7
- };
8
- };
9
- }>;
@@ -1,11 +0,0 @@
1
- import type { ExecuteQueryParams } from '@sisense/sdk-ui-preact';
2
- /**
3
- * A hook function that executes a data query.
4
- * TODO Document
5
- *
6
- *
7
- * @returns TODO
8
- */
9
- export declare const useExecuteQuery: (params: ExecuteQueryParams) => Promise<{
10
- data: import("@sisense/sdk-data").QueryResultData;
11
- }>;
@@ -1,4 +0,0 @@
1
- import type { GetDashboardModelParams } from '@sisense/sdk-ui-preact';
2
- export declare const useGetDashboardModel: (params: GetDashboardModelParams) => Promise<{
3
- data: import("@sisense/sdk-ui-preact").DashboardModelState;
4
- }>;
@@ -1,4 +0,0 @@
1
- import type { GetDashboardModelsParams } from '@sisense/sdk-ui-preact';
2
- export declare const useGetDashboardModels: (params: GetDashboardModelsParams) => Promise<{
3
- data: import("@sisense/sdk-ui-preact").DashboardModelsState;
4
- }>;
@@ -1,4 +0,0 @@
1
- import type { GetSharedFormulaParams } from '@sisense/sdk-ui-preact';
2
- export declare const useGetSharedFormula: (params: GetSharedFormulaParams) => Promise<{
3
- data: import("@sisense/sdk-ui-preact").SharedFormulaState;
4
- }>;
@@ -1,4 +0,0 @@
1
- import type { GetWidgetModelParams } from '@sisense/sdk-ui-preact';
2
- export declare const useGetWidgetModel: (params: GetWidgetModelParams) => Promise<{
3
- data: import("@sisense/sdk-ui-preact").WidgetModelState;
4
- }>;