@databrainhq/plugin 0.12.12 → 0.12.13
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/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/MetricList/components/FullScreenView/index.d.ts +3 -1
- package/dist/components/MetricList/components/MetricCards/MetricCard.d.ts +3 -2
- package/dist/components/Table/index.d.ts +4 -2
- package/dist/containers/Metric/EmbeddedMetric.d.ts +3 -1
- package/dist/containers/Metric/index.d.ts +5 -2
- package/dist/helpers/getValidRlsConditionOptions.d.ts +13 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/hooks/useMetricCard.d.ts +3 -2
- package/dist/types/app.d.ts +39 -0
- package/dist/utils/getValidJson.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/webcomponents.d.ts +1 -1
- package/dist/webcomponents.es.js +43669 -42829
- package/dist/webcomponents.umd.js +262 -262
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ExternalMetrics } from '@/types/queryTypes';
|
|
3
|
+
import { MetricFilterOptionsType } from '@/types';
|
|
3
4
|
export type FullScreenViewProps = {
|
|
4
5
|
metric: ExternalMetrics;
|
|
5
6
|
colors?: string[];
|
|
@@ -8,6 +9,7 @@ export type FullScreenViewProps = {
|
|
|
8
9
|
filterValues: Record<string, string>;
|
|
9
10
|
};
|
|
10
11
|
appFilters?: any;
|
|
12
|
+
metricFilterOptions?: MetricFilterOptionsType;
|
|
11
13
|
onMinimize: () => void;
|
|
12
14
|
clientId: string;
|
|
13
15
|
tenancyLevel: string;
|
|
@@ -21,4 +23,4 @@ export type FullScreenViewProps = {
|
|
|
21
23
|
isHideChartSettings?: boolean;
|
|
22
24
|
isHideTablePreview?: boolean;
|
|
23
25
|
};
|
|
24
|
-
export declare const FullScreenView: ({ metric, colors, rlsFilters, onMinimize, clientId, tenancyLevel, companyId, externalDashboardId, userProvidedDashboardId, isAllowedToUpdateMetrics, sharingSettingsId, appFilters, isInternalApp, isShowChartConfigTab, isHideChartSettings, isHideTablePreview, }: FullScreenViewProps) => React.JSX.Element;
|
|
26
|
+
export declare const FullScreenView: ({ metric, colors, rlsFilters, metricFilterOptions, onMinimize, clientId, tenancyLevel, companyId, externalDashboardId, userProvidedDashboardId, isAllowedToUpdateMetrics, sharingSettingsId, appFilters, isInternalApp, isShowChartConfigTab, isHideChartSettings, isHideTablePreview, }: FullScreenViewProps) => React.JSX.Element;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ExternalMetrics } from '@/types/queryTypes';
|
|
3
3
|
import { ClientType } from '@/types/app';
|
|
4
4
|
import { FilterFieldType } from '@/components/FilterField';
|
|
5
|
-
import { RlsCondition } from '@/types';
|
|
5
|
+
import { MetricFilterOptionsType, RlsCondition } from '@/types';
|
|
6
6
|
export type MetricCardProps = {
|
|
7
7
|
globalFilters?: {
|
|
8
8
|
tableName: string;
|
|
@@ -26,5 +26,6 @@ export type MetricCardProps = {
|
|
|
26
26
|
isInternalApp?: boolean;
|
|
27
27
|
setCrossDashboardFilters?: React.Dispatch<React.SetStateAction<RlsCondition[]>>;
|
|
28
28
|
crossDashboardFilters?: RlsCondition[];
|
|
29
|
+
metricFilterOptions?: MetricFilterOptionsType;
|
|
29
30
|
};
|
|
30
|
-
export declare const MetricCard: ({ globalFilters, metricItem, onMaximize, client, colors, param, companyTenancyType, renderHeaderName, isDisableCardClick, onArchive, chartRendererType, isDisableMorePopup, appFilters, isInternalApp, setCrossDashboardFilters, crossDashboardFilters, }: MetricCardProps) => React.JSX.Element;
|
|
31
|
+
export declare const MetricCard: ({ globalFilters, metricItem, onMaximize, client, colors, param, companyTenancyType, renderHeaderName, isDisableCardClick, onArchive, chartRendererType, isDisableMorePopup, appFilters, isInternalApp, setCrossDashboardFilters, crossDashboardFilters, metricFilterOptions }: MetricCardProps) => React.JSX.Element;
|
|
@@ -20,7 +20,9 @@ type Props = {
|
|
|
20
20
|
totalRecords: number;
|
|
21
21
|
};
|
|
22
22
|
setChartSettings?: (value: React.SetStateAction<ChartSettingsType>) => void;
|
|
23
|
-
|
|
23
|
+
isInfiniteScroll?: boolean;
|
|
24
|
+
onLoadMore?: () => void;
|
|
25
|
+
hasMoreData?: boolean;
|
|
24
26
|
};
|
|
25
|
-
export declare const Table: ({ data, isLoading, error, tableSettings, tableName, className, onColumnSizingChange, onChartReady, onChangePage, isExternalChart, isEnableNextBtn, isEnablePrevBtn, paginationInfo, setChartSettings,
|
|
27
|
+
export declare const Table: ({ data, isLoading, error, tableSettings, tableName, className, onColumnSizingChange, onChartReady, onChangePage, isExternalChart, isEnableNextBtn, isEnablePrevBtn, paginationInfo, setChartSettings, isInfiniteScroll, onLoadMore, hasMoreData, }: Props) => React.JSX.Element;
|
|
26
28
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { MetricFilterOptionsType } from '@/types';
|
|
2
3
|
export interface EmbeddedMetricProps {
|
|
3
4
|
token: string;
|
|
4
5
|
chartColors?: string[];
|
|
@@ -8,5 +9,6 @@ export interface EmbeddedMetricProps {
|
|
|
8
9
|
onMinimize?: () => void;
|
|
9
10
|
isHideChartSettings?: boolean;
|
|
10
11
|
isHideTablePreview?: boolean;
|
|
12
|
+
metricFilterOptions?: MetricFilterOptionsType;
|
|
11
13
|
}
|
|
12
|
-
export declare const EmbeddedMetric: React.MemoExoticComponent<({ token, chartColors, metricId, chartRendererType, variant, onMinimize, isHideChartSettings, isHideTablePreview, }: EmbeddedMetricProps) => React.JSX.Element>;
|
|
14
|
+
export declare const EmbeddedMetric: React.MemoExoticComponent<({ token, chartColors, metricId, chartRendererType, variant, onMinimize, isHideChartSettings, isHideTablePreview, metricFilterOptions, }: EmbeddedMetricProps) => React.JSX.Element>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
import { ThemeType } from '@/utils
|
|
2
|
+
import { ThemeType } from '@/utils';
|
|
3
|
+
import { MetricFilterOptionsType } from '@/types';
|
|
3
4
|
/**
|
|
4
5
|
* token - The client based guest token (required).
|
|
5
6
|
* metricId - The id of the dashboard you want to see.
|
|
@@ -26,6 +27,7 @@ export interface MetricProps extends HTMLAttributes<HTMLElement> {
|
|
|
26
27
|
height?: number;
|
|
27
28
|
className?: string;
|
|
28
29
|
style?: React.CSSProperties;
|
|
30
|
+
metricFilterOptions?: MetricFilterOptionsType;
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
33
|
* @name Metric - A react component to display a single metric card.
|
|
@@ -34,6 +36,7 @@ export interface MetricProps extends HTMLAttributes<HTMLElement> {
|
|
|
34
36
|
* @prop {boolean} isHideChartSettings - Whether to hide the chart settings in full screen view.
|
|
35
37
|
* @prop {boolean} isHideTablePreview - Whether to hide the table preview in full screen view.
|
|
36
38
|
* @prop {string} variant (optional) - The variant to render the metric it can be card (fullscreen included) or fullscreen.
|
|
39
|
+
* @prop {object} metricFilterOptions (optional) - An optional metric filter options to be displayed in the metric filters.
|
|
37
40
|
* @prop {function} onMinimize (optional) - An optional callback when minimize button is clicked.
|
|
38
41
|
* @prop {array} chartColors (optional) - An array of colors to be used to visualize the chart.
|
|
39
42
|
* @prop {string} chartRendererType (optional) - Whether to display chart as svg or canvas. In case of low end devices or in general svg is better and in case of frequent data changes or high size data visualization canvas is better. Defaults to canvas.
|
|
@@ -43,4 +46,4 @@ export interface MetricProps extends HTMLAttributes<HTMLElement> {
|
|
|
43
46
|
* @prop {object} style (optional) - The usual css style prop to provide inline styles.
|
|
44
47
|
* @prop {object} theme (optional) - Theme config object to apply to the UI.
|
|
45
48
|
*/
|
|
46
|
-
export declare const Metric: React.MemoExoticComponent<({ theme, width, height, style, className, ...metricProps }: MetricProps) => React.JSX.Element>;
|
|
49
|
+
export declare const Metric: React.MemoExoticComponent<({ theme, width, height, style, className, metricFilterOptions, ...metricProps }: MetricProps) => React.JSX.Element>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MetricFilterOptionsType, RlsCondition } from '@/types';
|
|
2
|
+
/**
|
|
3
|
+
* @name getValidRlsConditionOptions - Filters out invalid options and return valid options and value;
|
|
4
|
+
* @param {RlsCondition} rlsCondition (required) - A metric filter object.
|
|
5
|
+
* @param {MetricFilterOptionsType} filterOptions (required) - Metric filter options prop object.
|
|
6
|
+
* @returns value - A valid value or undefined.
|
|
7
|
+
* @returns options - A valid options or undefined.
|
|
8
|
+
* @returns 'undefined' - If not a valid props or options or value.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getValidRlsConditionOptions: (rlsCondition: RlsCondition, filterOptions: MetricFilterOptionsType) => {
|
|
11
|
+
value: string;
|
|
12
|
+
options: string[] | number[] | import("@/types").DateTypeOptionType[];
|
|
13
|
+
} | undefined;
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ChartSettingsType, FloatingDropDownOption, RlsCondition, DatasetSettings } from '@/types';
|
|
2
|
+
import { ChartSettingsType, FloatingDropDownOption, RlsCondition, DatasetSettings, MetricFilterOptionsType } from '@/types';
|
|
3
3
|
import { MetricCardProps } from '@/components';
|
|
4
4
|
type UseMetricCardProps = {
|
|
5
5
|
metric: Record<string, any>;
|
|
@@ -18,8 +18,9 @@ type UseMetricCardProps = {
|
|
|
18
18
|
isInternalApp?: boolean;
|
|
19
19
|
setCrossDashboardFilters?: React.Dispatch<React.SetStateAction<RlsCondition[]>>;
|
|
20
20
|
crossDashboardFilters?: RlsCondition[];
|
|
21
|
+
metricFilterOptions?: MetricFilterOptionsType;
|
|
21
22
|
};
|
|
22
|
-
export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, clientId, chartSettings, setChartSettings, tenancyLevel, isInternalApp, appFilters, setCrossDashboardFilters, crossDashboardFilters, }: UseMetricCardProps) => {
|
|
23
|
+
export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, clientId, chartSettings, setChartSettings, tenancyLevel, isInternalApp, appFilters, setCrossDashboardFilters, crossDashboardFilters, metricFilterOptions, }: UseMetricCardProps) => {
|
|
23
24
|
onDrillDown: (params: any) => void;
|
|
24
25
|
handleChartClick: (params: any) => void;
|
|
25
26
|
dataDb: Record<string, any>[];
|
package/dist/types/app.d.ts
CHANGED
|
@@ -85,6 +85,18 @@ export type CustomSettings = {
|
|
|
85
85
|
zoomAxis?: 'x' | 'y' | 'xy' | 'none';
|
|
86
86
|
zoomOnMouseWheel?: boolean;
|
|
87
87
|
};
|
|
88
|
+
showDynamicBehaviour?: boolean;
|
|
89
|
+
enableRoseType?: boolean;
|
|
90
|
+
roseType?: string;
|
|
91
|
+
selectedMode?: string;
|
|
92
|
+
selectedOffset?: number;
|
|
93
|
+
gradients?: {
|
|
94
|
+
startColor: string;
|
|
95
|
+
endColor: string;
|
|
96
|
+
offset1: number;
|
|
97
|
+
offset2: number;
|
|
98
|
+
direction: string;
|
|
99
|
+
}[];
|
|
88
100
|
};
|
|
89
101
|
export type TableSettings = {
|
|
90
102
|
contentAlignment?: string;
|
|
@@ -128,6 +140,19 @@ export type LabelSettings = {
|
|
|
128
140
|
position?: string;
|
|
129
141
|
truncateLabel?: boolean;
|
|
130
142
|
truncateLabelValue?: number;
|
|
143
|
+
showLabelLine?: boolean;
|
|
144
|
+
XAxisStyle?: {
|
|
145
|
+
size?: number;
|
|
146
|
+
family?: string;
|
|
147
|
+
weight?: number;
|
|
148
|
+
color?: string;
|
|
149
|
+
};
|
|
150
|
+
YAxisStyle?: {
|
|
151
|
+
size?: number;
|
|
152
|
+
family?: string;
|
|
153
|
+
weight?: number;
|
|
154
|
+
color?: string;
|
|
155
|
+
};
|
|
131
156
|
};
|
|
132
157
|
export type AxisSettings = {
|
|
133
158
|
axis?: string;
|
|
@@ -261,6 +286,8 @@ export type DateOptionType = {
|
|
|
261
286
|
count: number;
|
|
262
287
|
endDate?: Date;
|
|
263
288
|
startDate?: Date;
|
|
289
|
+
minDate?: Date;
|
|
290
|
+
maxDate?: Date;
|
|
264
291
|
};
|
|
265
292
|
export type RlsCondition = {
|
|
266
293
|
name: string;
|
|
@@ -306,3 +333,15 @@ export type ConditionalFormattingParam = {
|
|
|
306
333
|
styles: any;
|
|
307
334
|
}[];
|
|
308
335
|
};
|
|
336
|
+
export type DateTypeOptionType = {
|
|
337
|
+
range: 'Last' | 'This' | 'Custom';
|
|
338
|
+
time?: 'Day' | 'Week' | 'Month' | 'Quarter' | 'Year';
|
|
339
|
+
name: string;
|
|
340
|
+
count?: number;
|
|
341
|
+
minDate?: Date;
|
|
342
|
+
maxDate?: Date;
|
|
343
|
+
};
|
|
344
|
+
export type MetricFilterOptionsType = Record<string, {
|
|
345
|
+
options: string[] | number[] | DateTypeOptionType[];
|
|
346
|
+
defaultOption?: string | number;
|
|
347
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getValidJson: (json: string) => any;
|
package/dist/utils/index.d.ts
CHANGED
package/dist/webcomponents.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DashboardProps } from './containers/Dashboard';
|
|
2
2
|
import { Chart, ChartProps } from './components';
|
|
3
3
|
import { MetricProps } from './containers/Metric';
|
|
4
|
-
export type { CustomSettings, TableSettings, MarginSettings, AxisSettings, LegendSettings, LabelSettings, BackgroundSettings, PivotSettingsType, GaugeSettingsType, ChartSettingsType, TimeSeriesSettingsType, } from '@/types';
|
|
4
|
+
export type { CustomSettings, TableSettings, MarginSettings, AxisSettings, LegendSettings, LabelSettings, BackgroundSettings, PivotSettingsType, GaugeSettingsType, ChartSettingsType, TimeSeriesSettingsType, MetricFilterOptionsType, DateTypeOptionType, } from '@/types';
|
|
5
5
|
export declare namespace JSX {
|
|
6
6
|
interface IntrinsicElements {
|
|
7
7
|
Tag: any;
|