@databrainhq/plugin 0.9.19 → 0.9.20
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/README.md +26 -26
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/Chart/SingleValueChart.d.ts +16 -0
- package/dist/components/Chart/index.d.ts +21 -0
- package/dist/components/ChartModal/ChartConfig.d.ts +6 -16
- package/dist/components/ChartModal/ChartModalOptions.d.ts +7 -5
- package/dist/components/ChartPopup/components/UnderlyingData/index.d.ts +1 -1
- package/dist/components/ChartPopup/index.d.ts +1 -1
- package/dist/components/ChartSettingsPopup/components/ChartConfigure/index.d.ts +8 -0
- package/dist/components/ChartSettingsPopup/components/ChartSettings/index.d.ts +9 -0
- package/dist/components/ChartSettingsPopup/index.d.ts +9 -0
- package/dist/components/Charts/BarChart.d.ts +1 -1
- package/dist/components/Charts/LineChart.d.ts +1 -1
- package/dist/components/DataType/index.d.ts +1 -1
- package/dist/components/DateRangePicker/index.d.ts +1 -1
- package/dist/components/Error/index.d.ts +1 -1
- package/dist/components/ExternalMetricForm/index.d.ts +1 -1
- package/dist/components/FilterDropDown/index.d.ts +2 -2
- package/dist/components/FilterField/index.d.ts +2 -2
- package/dist/components/FloatingDropDown/index.d.ts +2 -2
- package/dist/components/FullScreenChart/index.d.ts +3 -4
- package/dist/components/GlobalFilters/AddFilter.d.ts +2 -2
- package/dist/components/GlobalFilters/AppliedFilter.d.ts +1 -1
- package/dist/components/GlobalFilters/NumberFilterField.d.ts +1 -1
- package/dist/components/GlobalFilters/index.d.ts +2 -2
- package/dist/components/Icons/index.d.ts +1 -1
- package/dist/components/InfoTooltip/index.d.ts +1 -1
- package/dist/components/MetricChart/ChartImageDownloadButton.d.ts +4 -4
- package/dist/components/MetricChart/CsvDownloadButton.d.ts +1 -1
- package/dist/components/MetricChart/MetricChart.d.ts +1 -1
- package/dist/components/MetricChart/index.d.ts +1 -0
- package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +6 -50
- package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +1 -1
- package/dist/components/MetricCreation/components/MetricOutput/components/index.d.ts +0 -1
- package/dist/components/MetricFilterDropDown/index.d.ts +1 -1
- package/dist/components/MetricList/MetricList.d.ts +3 -4
- package/dist/components/MetricList/components/{DownloadRawCsvModal.d.ts → DownloadRawCsvModal/index.d.ts} +1 -1
- package/dist/components/MetricList/components/FullScreenView/DownloadButton.d.ts +9 -0
- package/dist/components/MetricList/components/FullScreenView/index.d.ts +18 -0
- package/dist/components/MetricList/components/{LayoutAlert.d.ts → LayoutAlert/index.d.ts} +1 -1
- package/dist/components/MetricList/components/{MetricCard.d.ts → MetricCards/MetricCard.d.ts} +5 -6
- package/dist/components/MetricList/components/MetricCards/NoDataLoading.d.ts +7 -0
- package/dist/components/MetricList/components/{SingleValueCard.d.ts → MetricCards/SingleValueCard.d.ts} +1 -1
- package/dist/components/MetricList/components/{TableViewModal.d.ts → TableViewModal/index.d.ts} +1 -1
- package/dist/components/MetricList/components/index.d.ts +8 -0
- package/dist/components/MetricList/index.d.ts +1 -6
- package/dist/components/MetricTable/index.d.ts +1 -1
- package/dist/components/Modal/ModalFooter.d.ts +1 -1
- package/dist/components/PopoverMenu/index.d.ts +1 -1
- package/dist/components/ScheduleEmail/ScheduleEmailForm/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts +5 -5
- package/dist/components/Tab/index.d.ts +1 -1
- package/dist/components/Table/DebouncedInput.d.ts +1 -1
- package/dist/components/Table/index.d.ts +4 -2
- package/dist/components/TagInputField/index.d.ts +1 -1
- package/dist/components/TimeGrainField/index.d.ts +1 -1
- package/dist/components/ToggleButton/SwitchInput.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleInput.d.ts +1 -1
- package/dist/components/ToggleButton/index.d.ts +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/consts/metricOptions.d.ts +4 -0
- package/dist/containers/Dashboard/Dashboard.d.ts +1 -1
- package/dist/containers/Dashboard/DashboardProvider.d.ts +1 -1
- package/dist/helpers/getTimeFilterValue.d.ts +1 -1
- package/dist/helpers/timeseries.d.ts +6 -6
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useClientDashboardLayout.d.ts +1 -1
- package/dist/hooks/useExternalMetric.d.ts +3 -20
- package/dist/hooks/useGenerateEmbeddedMetric.d.ts +1 -1
- package/dist/hooks/useMetricCard.d.ts +37 -0
- package/dist/hooks/useOutsideAlerter.d.ts +1 -1
- package/dist/hooks/useScheduleEmail.d.ts +1 -1
- package/dist/index.es.js +86942 -128170
- package/dist/index.umd.js +298 -242
- package/dist/style.css +1 -1
- package/dist/types/app.d.ts +119 -61
- package/dist/types/metricCreate.d.ts +13 -87
- package/dist/utils/generated/graphql.d.ts +437 -437
- package/dist/utils/getChartAttributes.d.ts +5 -8
- package/dist/utils/getChartImage.d.ts +3 -0
- package/dist/utils/getChartOptions.d.ts +7 -0
- package/package.json +110 -98
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartConfigure/index.d.ts +0 -26
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartSettings/index.d.ts +0 -38
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/index.d.ts +0 -2
- package/dist/typings.d.ts +0 -17
- package/dist/utils/handleSaveChartImage.d.ts +0 -3
- /package/dist/components/MetricList/components/{ArchiveMetricModal.d.ts → ArchiveMetricModal/index.d.ts} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MetricCardProps } from '@/components/MetricList/components/MetricCard';
|
|
2
|
+
import { MetricCardProps } from '@/components/MetricList/components/MetricCards/MetricCard';
|
|
3
3
|
export declare const SingleValueCard: React.FC<Omit<MetricCardProps, 'onMaximize'>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './ArchiveMetricModal';
|
|
2
|
+
export * from './DownloadRawCsvModal';
|
|
3
|
+
export * from './LayoutAlert';
|
|
4
|
+
export * from './TableViewModal';
|
|
5
|
+
export * from './MetricCards/MetricCard';
|
|
6
|
+
export * from './MetricCards/SingleValueCard';
|
|
7
|
+
export * from './MetricCards/NoDataLoading';
|
|
8
|
+
export * from './FullScreenView';
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
export * from './MetricList';
|
|
2
|
-
export * from './components
|
|
3
|
-
export * from './components/SingleValueCard';
|
|
4
|
-
export * from './components/ArchiveMetricModal';
|
|
5
|
-
export * from './components/LayoutAlert';
|
|
6
|
-
export * from './components/TableViewModal';
|
|
7
|
-
export * from './components/DownloadRawCsvModal';
|
|
2
|
+
export * from './components';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FieldValues } from 'react-hook-form';
|
|
3
3
|
import type { Control } from 'react-hook-form';
|
|
4
|
-
|
|
4
|
+
type Option = {
|
|
5
5
|
value: string;
|
|
6
6
|
label: string;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type SelectInput = {
|
|
9
9
|
name?: string;
|
|
10
10
|
label?: string;
|
|
11
11
|
value: any;
|
|
@@ -21,7 +21,7 @@ declare type SelectInput = {
|
|
|
21
21
|
textSize?: string;
|
|
22
22
|
labelVariant?: 'floating' | 'static';
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
type HookSelectInput = Omit<SelectInput, 'value'> & {
|
|
25
25
|
control: Control;
|
|
26
26
|
name: string;
|
|
27
27
|
};
|
|
@@ -29,7 +29,7 @@ export declare const Select: ({ name, label, options, onChange, value, defaultVa
|
|
|
29
29
|
export declare const HookSelect: ({ control, name, ...rest }: HookSelectInput) => JSX.Element;
|
|
30
30
|
export declare const SelectWithSubValue: ({ label, options, onChange, value, defaultValue, }: any) => JSX.Element;
|
|
31
31
|
export declare const DropDown: ({ control, name, options, label, defaultValue, }: HookSelectInput) => JSX.Element;
|
|
32
|
-
|
|
32
|
+
type MultiSelectProps = {
|
|
33
33
|
options: Option[];
|
|
34
34
|
defaultValue?: Option['value'][];
|
|
35
35
|
value?: Option['value'][];
|
|
@@ -46,7 +46,7 @@ declare type MultiSelectProps = {
|
|
|
46
46
|
icon?: JSX.Element;
|
|
47
47
|
};
|
|
48
48
|
export declare const MultiSelect: React.FC<MultiSelectProps>;
|
|
49
|
-
|
|
49
|
+
type HookMultiSelectProps = MultiSelectProps & {
|
|
50
50
|
control: Control<FieldValues>;
|
|
51
51
|
name: string;
|
|
52
52
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const DebouncedInput: ({ value, onChange, debounce, ...props }: {
|
|
2
|
+
export declare const DebouncedInput: ({ value: initialValue, onChange, debounce, ...props }: {
|
|
3
3
|
value: string | number;
|
|
4
4
|
onChange: (value: string | number) => void;
|
|
5
5
|
debounce?: number | undefined;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { OnChangeFn, ColumnSizingState } from '@tanstack/react-table';
|
|
2
3
|
import { TableSettings } from '@/types';
|
|
3
|
-
|
|
4
|
+
type Props = {
|
|
4
5
|
data?: any[];
|
|
5
6
|
isLoading: boolean;
|
|
6
7
|
error: string;
|
|
7
8
|
tableSettings?: TableSettings;
|
|
8
9
|
tableName?: string;
|
|
9
10
|
className?: string;
|
|
11
|
+
onColumnSizingChange?: OnChangeFn<ColumnSizingState>;
|
|
10
12
|
};
|
|
11
|
-
export declare const Table: ({ data, isLoading, error, tableSettings, tableName, className, }: Props) => JSX.Element;
|
|
13
|
+
export declare const Table: ({ data, isLoading, error, tableSettings, tableName, className, onColumnSizingChange, }: Props) => JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -10,6 +10,10 @@ export declare const AggregateList: {
|
|
|
10
10
|
value: string;
|
|
11
11
|
label: string;
|
|
12
12
|
}[];
|
|
13
|
+
export declare const TableRowsList: {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}[];
|
|
13
17
|
export declare const NUMBER_TYPES: string[];
|
|
14
18
|
export declare const STRING_TYPES: string[];
|
|
15
19
|
export declare const DATE_TYPES: string[];
|
|
@@ -12,7 +12,7 @@ export interface DashboardProps {
|
|
|
12
12
|
};
|
|
13
13
|
theme?: ThemeType;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
type PluginProviderProps = PropsWithChildren & Omit<DashboardProps, 'token'>;
|
|
16
16
|
export declare const PluginProvider: ({ children, theme }: PluginProviderProps) => JSX.Element;
|
|
17
17
|
export declare const Dashboard: React.MemoExoticComponent<({ token, options, theme }: DashboardProps) => JSX.Element>;
|
|
18
18
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
2
|
+
type DashboardProviderProps = PropsWithChildren & {
|
|
3
3
|
token: string;
|
|
4
4
|
};
|
|
5
5
|
declare const DashboardProvider: ({ token, children }: DashboardProviderProps) => JSX.Element;
|
|
@@ -20,7 +20,7 @@ export declare const getTimeSeriesData: ({ dataArray, timeStampKey, type, valuek
|
|
|
20
20
|
color: string;
|
|
21
21
|
} | undefined;
|
|
22
22
|
itemStyle?: {
|
|
23
|
-
borderRadius: number;
|
|
23
|
+
borderRadius: number | undefined;
|
|
24
24
|
} | undefined;
|
|
25
25
|
areaStyle: {
|
|
26
26
|
opacity?: undefined;
|
|
@@ -29,8 +29,8 @@ export declare const getTimeSeriesData: ({ dataArray, timeStampKey, type, valuek
|
|
|
29
29
|
type: "line" | "bar";
|
|
30
30
|
name: string;
|
|
31
31
|
label: {
|
|
32
|
-
show: boolean;
|
|
33
|
-
position: string;
|
|
32
|
+
show: boolean | undefined;
|
|
33
|
+
position: string | undefined;
|
|
34
34
|
};
|
|
35
35
|
emphasis: {
|
|
36
36
|
focus: string;
|
|
@@ -42,7 +42,7 @@ export declare const getTimeSeriesData: ({ dataArray, timeStampKey, type, valuek
|
|
|
42
42
|
color: string;
|
|
43
43
|
} | undefined;
|
|
44
44
|
itemStyle?: {
|
|
45
|
-
borderRadius: number;
|
|
45
|
+
borderRadius: number | undefined;
|
|
46
46
|
} | undefined;
|
|
47
47
|
areaStyle: {
|
|
48
48
|
opacity: number;
|
|
@@ -51,8 +51,8 @@ export declare const getTimeSeriesData: ({ dataArray, timeStampKey, type, valuek
|
|
|
51
51
|
type: "line" | "bar";
|
|
52
52
|
name: string;
|
|
53
53
|
label: {
|
|
54
|
-
show: boolean;
|
|
55
|
-
position: string;
|
|
54
|
+
show: boolean | undefined;
|
|
55
|
+
position: string | undefined;
|
|
56
56
|
};
|
|
57
57
|
emphasis: {
|
|
58
58
|
focus: string;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
2
|
import { ExternalMetrics } from '@/utils/generated/graphql';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
declare type Params = {
|
|
3
|
+
import { DashboardType, GroupBy, RlsFilterObjectType, SelectedColumns, ChartSettingsType } from '@/types/app';
|
|
4
|
+
type Params = {
|
|
6
5
|
onSuccess: () => void;
|
|
7
6
|
companyIntegrationId: string | undefined;
|
|
8
7
|
selectedColumns: SelectedColumns[] | undefined;
|
|
@@ -10,23 +9,7 @@ declare type Params = {
|
|
|
10
9
|
metricQuery: string | undefined;
|
|
11
10
|
outputColumns: string | undefined;
|
|
12
11
|
id?: string;
|
|
13
|
-
chartSettings:
|
|
14
|
-
xAxis: string | undefined;
|
|
15
|
-
yAxisList: string[] | undefined;
|
|
16
|
-
chartType: string;
|
|
17
|
-
step: string | undefined;
|
|
18
|
-
measure: string | undefined;
|
|
19
|
-
sankeyValues: string[] | undefined;
|
|
20
|
-
singleValue: string | undefined;
|
|
21
|
-
margins: Record<string, number>;
|
|
22
|
-
legendSettings: LegendSettings;
|
|
23
|
-
labelSettings: LabelSettings;
|
|
24
|
-
axisSettings: AxisSettings;
|
|
25
|
-
customSettings?: CustomSettings;
|
|
26
|
-
tableSettings?: TableSettings;
|
|
27
|
-
backGroundColor?: BackgroundSettings;
|
|
28
|
-
timeSeriesSettings?: TimeSeriesSettingsType;
|
|
29
|
-
};
|
|
12
|
+
chartSettings: ChartSettingsType;
|
|
30
13
|
integrationName: string | undefined;
|
|
31
14
|
clientId?: string | null;
|
|
32
15
|
isEmbedded?: boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ChartSettingsType, FloatingDropDownOption, RlsCondition } from '@/types';
|
|
3
|
+
import { ExternalMetrics } from '@/utils/generated/graphql';
|
|
4
|
+
import { MetricCardProps } from '@/components';
|
|
5
|
+
type UseMetricCardProps = {
|
|
6
|
+
metric: ExternalMetrics;
|
|
7
|
+
chartSettings: ChartSettingsType;
|
|
8
|
+
setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
|
|
9
|
+
clientId: string;
|
|
10
|
+
tenancyLevel: string;
|
|
11
|
+
globalFilters?: MetricCardProps['globalFilters'];
|
|
12
|
+
rlsFilters?: {
|
|
13
|
+
param: any;
|
|
14
|
+
filterValues: Record<string, any>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, clientId, chartSettings, setChartSettings, tenancyLevel, }: UseMetricCardProps) => {
|
|
18
|
+
onDrillDown: () => void;
|
|
19
|
+
handleChartClick: (params: any) => void;
|
|
20
|
+
dataDb: Record<string, any>[];
|
|
21
|
+
getUnderlyingData: ({ columnName, value, setData, setLoading, }: {
|
|
22
|
+
columnName: string;
|
|
23
|
+
value: any;
|
|
24
|
+
setData: import("react").Dispatch<import("react").SetStateAction<any[]>>;
|
|
25
|
+
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
26
|
+
}) => void;
|
|
27
|
+
onChangeFilterValue: (name: string, value: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void;
|
|
28
|
+
isShowChartPopup: boolean;
|
|
29
|
+
setShowChartPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
30
|
+
columnName: string | undefined;
|
|
31
|
+
chartParams: any;
|
|
32
|
+
isQueryLoading: boolean;
|
|
33
|
+
groupedData: Record<string, any>[];
|
|
34
|
+
drilledLevel: number;
|
|
35
|
+
rlsConditions: RlsCondition[];
|
|
36
|
+
};
|
|
37
|
+
export {};
|