@databrainhq/plugin 0.6.10 → 0.7.1
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/Button/index.d.ts +2 -2
- package/dist/components/ChartModal/ChartConfig.d.ts +2 -2
- package/dist/components/ChartModal/ChartModalOptions.d.ts +2 -2
- package/dist/components/ChartModal/SelectField.d.ts +1 -2
- package/dist/components/ChartModal/index.d.ts +3 -0
- package/dist/components/Charts/LineChart.d.ts +1 -1
- package/dist/components/DataType/index.d.ts +2 -3
- package/dist/components/Error/index.d.ts +2 -2
- package/dist/components/ErrorFallback/index.d.ts +2 -3
- package/dist/components/ExternalMetricForm/index.d.ts +3 -3
- package/dist/components/FilterDropDown/index.d.ts +2 -3
- package/dist/components/FilterField/index.d.ts +4 -3
- package/dist/components/FloatingDropDown/index.d.ts +5 -7
- package/dist/components/FullScreenChart/index.d.ts +2 -2
- package/dist/components/GlobalFilters/index.d.ts +4 -4
- package/dist/components/InfoTooltip/index.d.ts +2 -5
- package/dist/components/InputField/index.d.ts +2 -2
- package/dist/components/MetricChart/CsvDownloadButton.d.ts +2 -2
- package/dist/components/MetricChart/MetricChart.d.ts +34 -0
- package/dist/components/MetricChart/index.d.ts +2 -35
- package/dist/components/MetricCreation/MetricCreation.d.ts +3 -0
- package/dist/components/MetricCreation/components/ConstructMetric/ConstructMetric.d.ts +3 -0
- package/dist/components/MetricCreation/components/ConstructMetric/components/MetricForm/index.d.ts +2 -3
- package/dist/components/MetricCreation/components/ConstructMetric/index.d.ts +2 -4
- package/dist/components/MetricCreation/components/Dataset/index.d.ts +2 -3
- package/dist/components/MetricCreation/components/Header/index.d.ts +1 -2
- package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +3 -0
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartConfigure/index.d.ts +3 -3
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartSettings/index.d.ts +3 -3
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +3 -3
- package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/components/InputTables/index.d.ts +1 -2
- package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +2 -2
- package/dist/components/MetricCreation/components/MetricOutput/index.d.ts +3 -4
- package/dist/components/MetricCreation/index.d.ts +5 -4
- package/dist/components/{RlsFilters/index.d.ts → MetricFilters/MetricFilters.d.ts} +3 -3
- package/dist/components/{RlsFilters → MetricFilters}/MultipleTimeGrain.d.ts +2 -2
- package/dist/components/MetricFilters/index.d.ts +2 -0
- package/dist/components/MetricList/MetricList.d.ts +45 -0
- package/dist/components/MetricList/components/MetricCard.d.ts +2 -3
- package/dist/components/MetricList/components/SingleValueCard.d.ts +1 -2
- package/dist/components/MetricList/index.d.ts +3 -45
- package/dist/components/MetricTable/index.d.ts +2 -2
- package/dist/components/Modal/Modal.d.ts +9 -0
- package/dist/components/Modal/ModalFooter.d.ts +4 -2
- package/dist/components/Modal/index.d.ts +2 -10
- package/dist/components/PopoverMenu/index.d.ts +1 -2
- package/dist/components/SearchTab/index.d.ts +1 -2
- package/dist/components/Select/index.d.ts +2 -2
- package/dist/components/Tab/index.d.ts +2 -2
- package/dist/components/Table/index.d.ts +2 -2
- package/dist/components/Text/index.d.ts +3 -3
- package/dist/components/TextAreaField/index.d.ts +2 -2
- package/dist/components/TimeGrainField/index.d.ts +2 -2
- package/dist/components/ToggleButton/index.d.ts +2 -2
- package/dist/components/index.d.ts +28 -0
- package/dist/consts/app.d.ts +39 -0
- package/dist/consts/index.d.ts +2 -39
- package/dist/containers/Dashboard/Dashboard.d.ts +4 -0
- package/dist/containers/Dashboard/EmbededDashboard.d.ts +12 -0
- package/dist/containers/Dashboard/index.d.ts +2 -12
- package/dist/helpers/getModifiedQuery.d.ts +6 -0
- package/dist/helpers/getTimeFilterValue.d.ts +2 -2
- package/dist/helpers/groupArray.d.ts +1 -0
- package/dist/helpers/index.d.ts +4 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useEmbeddedDashboard.d.ts +1 -2
- package/dist/hooks/useExternalMetric.d.ts +3 -3
- package/dist/hooks/useGenerateDatasetMetrics.d.ts +1 -2
- package/dist/hooks/useGenerateEmbeddedMetric.d.ts +15 -0
- package/dist/hooks/useOutsideAlerter.d.ts +2 -2
- package/dist/index.d.ts +6 -0
- package/dist/index.es.js +3191 -2832
- package/dist/index.umd.js +124 -106
- package/dist/style.css +1 -1
- package/dist/types/app.d.ts +124 -0
- package/dist/types/index.d.ts +2 -124
- package/dist/types/metricCreate.d.ts +1 -9
- package/dist/utils/arrayToCsvString.d.ts +1 -2
- package/dist/utils/colors.d.ts +1 -2
- package/dist/utils/getChartAttributes.d.ts +2 -2
- package/dist/utils/getFormattedDataType.d.ts +1 -2
- package/dist/utils/index.d.ts +5 -0
- package/package.json +3 -3
|
@@ -21,7 +21,7 @@ declare type HookSelectInput = Omit<SelectInput, 'value'> & {
|
|
|
21
21
|
name: string;
|
|
22
22
|
};
|
|
23
23
|
export declare const Select: ({ label, options, onChange, value, defaultValue, children, placeHolder, className, isSearchEnabled, }: SelectInput) => JSX.Element;
|
|
24
|
-
declare const HookSelect: ({ control, name, options, label, defaultValue, }: HookSelectInput) => JSX.Element;
|
|
24
|
+
export declare const HookSelect: ({ control, name, options, label, defaultValue, }: HookSelectInput) => JSX.Element;
|
|
25
25
|
export declare const SelectWithSubValue: ({ label, options, onChange, value, defaultValue, }: any) => JSX.Element;
|
|
26
26
|
export declare const DropDown: ({ control, name, options, label, defaultValue, }: HookSelectInput) => JSX.Element;
|
|
27
27
|
declare type MultiSelectProps = {
|
|
@@ -42,4 +42,4 @@ declare type HookMultiSelectProps = MultiSelectProps & {
|
|
|
42
42
|
control: Control<FieldValues>;
|
|
43
43
|
};
|
|
44
44
|
export declare const HookMultiSelect: React.FC<HookMultiSelectProps>;
|
|
45
|
-
export
|
|
45
|
+
export {};
|
|
@@ -6,5 +6,5 @@ declare type TabProps = {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
tabText?: string;
|
|
8
8
|
};
|
|
9
|
-
declare const Tab: ({ options, activeTab, setActiveTab, className, tabText, }: TabProps) => JSX.Element;
|
|
10
|
-
export
|
|
9
|
+
export declare const Tab: ({ options, activeTab, setActiveTab, className, tabText, }: TabProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -4,7 +4,7 @@ interface Props {
|
|
|
4
4
|
variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
onClick?: () => void;
|
|
7
|
-
styleClass: 'primary' | 'secondary' | 'tertiary' | 'font-14' | 'font-14a' | 'font-14b' | 'font-14c' | 'font-15' | 'font-18' | 'font-20' | 'font-34' | 'custom';
|
|
7
|
+
styleClass: 'primary' | 'secondary' | 'tertiary' | 'font-14' | 'font-14a' | 'font-14b' | 'font-14c' | 'font-14d' | 'font-15' | 'font-18' | 'font-20' | 'font-34' | 'custom';
|
|
8
8
|
}
|
|
9
|
-
declare const Text: ({ className, variant, styleClass, children, onClick, }: Props) => JSX.Element;
|
|
10
|
-
export
|
|
9
|
+
export declare const Text: ({ className, variant, styleClass, children, onClick, }: Props) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -15,5 +15,5 @@ interface Props {
|
|
|
15
15
|
onBlur?: any;
|
|
16
16
|
className?: string;
|
|
17
17
|
}
|
|
18
|
-
declare const TextAreaField: ({ id, label, placeholder, rows, cols, resizable, register, error, defaultValue, value, onFocus, onBlur, className, }: Props) => JSX.Element;
|
|
19
|
-
export
|
|
18
|
+
export declare const TextAreaField: ({ id, label, placeholder, rows, cols, resizable, register, error, defaultValue, value, onFocus, onBlur, className, }: Props) => JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -9,5 +9,5 @@ declare type Props = {
|
|
|
9
9
|
isDisabled?: boolean;
|
|
10
10
|
onChange?: (value: string) => void;
|
|
11
11
|
};
|
|
12
|
-
declare const TimeGrainField: ({ isShowlabel, timeGrainValue, setTimeGrainValue, register, className, isDisabled, onChange, }: Props) => JSX.Element;
|
|
13
|
-
export
|
|
12
|
+
export declare const TimeGrainField: ({ isShowlabel, timeGrainValue, setTimeGrainValue, register, className, isDisabled, onChange, }: Props) => JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -8,5 +8,5 @@ declare type SwitchButtonProps = {
|
|
|
8
8
|
labelClassName?: string;
|
|
9
9
|
defaultEnabled?: boolean;
|
|
10
10
|
};
|
|
11
|
-
declare const
|
|
12
|
-
export
|
|
11
|
+
export declare const ToggleButton: React.FC<SwitchButtonProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from './Button';
|
|
2
|
+
export * from './ChartModal';
|
|
3
|
+
export * from './DataType';
|
|
4
|
+
export * from './Error';
|
|
5
|
+
export * from './ErrorFallback';
|
|
6
|
+
export * from './ExternalMetricForm';
|
|
7
|
+
export * from './FilterDropDown';
|
|
8
|
+
export * from './FloatingDropDown';
|
|
9
|
+
export * from './FullScreenChart';
|
|
10
|
+
export * from './FilterField';
|
|
11
|
+
export * from './GlobalFilters';
|
|
12
|
+
export * from './InfoTooltip';
|
|
13
|
+
export * from './InputField';
|
|
14
|
+
export * from './MetricChart';
|
|
15
|
+
export * from './MetricCreation';
|
|
16
|
+
export * from './MetricFilters';
|
|
17
|
+
export * from './MetricList';
|
|
18
|
+
export * from './MetricTable';
|
|
19
|
+
export * from './Modal';
|
|
20
|
+
export * from './PopoverMenu';
|
|
21
|
+
export * from './SearchTab';
|
|
22
|
+
export * from './Select';
|
|
23
|
+
export * from './Tab';
|
|
24
|
+
export * from './Table';
|
|
25
|
+
export * from './Text';
|
|
26
|
+
export * from './TextAreaField';
|
|
27
|
+
export * from './TimeGrainField';
|
|
28
|
+
export * from './ToggleButton';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const SOMETHING_WENT_WRONG = "something went wrong, please try again";
|
|
2
|
+
export declare const CHART_TYPES: {
|
|
3
|
+
line: string;
|
|
4
|
+
stepped: string;
|
|
5
|
+
bar: string;
|
|
6
|
+
stack: string;
|
|
7
|
+
histogram: string;
|
|
8
|
+
bubble: string;
|
|
9
|
+
scatter: string;
|
|
10
|
+
row: string;
|
|
11
|
+
area: string;
|
|
12
|
+
combo: string;
|
|
13
|
+
pie: string;
|
|
14
|
+
doughnut: string;
|
|
15
|
+
waterfall: string;
|
|
16
|
+
funnel: string;
|
|
17
|
+
gauge: string;
|
|
18
|
+
sankey: string;
|
|
19
|
+
singleValue: string;
|
|
20
|
+
boxplot: string;
|
|
21
|
+
table: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const STATUS_TAB = "STATUS_TAB";
|
|
24
|
+
export declare const STREAM_TAB = "STREAM_TAB";
|
|
25
|
+
export declare const CLIENT_NAME_VAR = "client_id_variable";
|
|
26
|
+
export declare const RLS_CONDITIONS: Record<string, string>;
|
|
27
|
+
export declare const CHART_TAB = "CHART_TAB";
|
|
28
|
+
export declare const TABLE_TAB = "TABLE_TAB";
|
|
29
|
+
export declare const QUERY_TAB = "QUERY_TAB";
|
|
30
|
+
export declare const INPUT_TABLE = "INPUT_TABLE";
|
|
31
|
+
export declare const OUTPUT_TABLE = "OUTPUT_TABLE";
|
|
32
|
+
export declare const DOUGHNUT = "doughnut";
|
|
33
|
+
export declare const PIE = "pie";
|
|
34
|
+
export declare const SANKEY = "sankey";
|
|
35
|
+
export declare const BOXPLOT = "boxplot";
|
|
36
|
+
export declare const TABLE = "table";
|
|
37
|
+
export declare const GENERAL = "general";
|
|
38
|
+
export declare const CONFIG = "configuration";
|
|
39
|
+
export declare const DESTINATIONS: Record<string, string>;
|
package/dist/consts/index.d.ts
CHANGED
|
@@ -1,39 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
line: string;
|
|
4
|
-
stepped: string;
|
|
5
|
-
bar: string;
|
|
6
|
-
stack: string;
|
|
7
|
-
histogram: string;
|
|
8
|
-
bubble: string;
|
|
9
|
-
scatter: string;
|
|
10
|
-
row: string;
|
|
11
|
-
area: string;
|
|
12
|
-
combo: string;
|
|
13
|
-
pie: string;
|
|
14
|
-
doughnut: string;
|
|
15
|
-
waterfall: string;
|
|
16
|
-
funnel: string;
|
|
17
|
-
gauge: string;
|
|
18
|
-
sankey: string;
|
|
19
|
-
singleValue: string;
|
|
20
|
-
boxplot: string;
|
|
21
|
-
table: string;
|
|
22
|
-
};
|
|
23
|
-
export declare const STATUS_TAB = "STATUS_TAB";
|
|
24
|
-
export declare const STREAM_TAB = "STREAM_TAB";
|
|
25
|
-
export declare const CLIENT_NAME_VAR = "client_id_variable";
|
|
26
|
-
export declare const RLS_CONDITIONS: Record<string, string>;
|
|
27
|
-
export declare const CHART_TAB = "CHART_TAB";
|
|
28
|
-
export declare const TABLE_TAB = "TABLE_TAB";
|
|
29
|
-
export declare const QUERY_TAB = "QUERY_TAB";
|
|
30
|
-
export declare const INPUT_TABLE = "INPUT_TABLE";
|
|
31
|
-
export declare const OUTPUT_TABLE = "OUTPUT_TABLE";
|
|
32
|
-
export declare const DOUGHNUT = "doughnut";
|
|
33
|
-
export declare const PIE = "pie";
|
|
34
|
-
export declare const SANKEY = "sankey";
|
|
35
|
-
export declare const BOXPLOT = "boxplot";
|
|
36
|
-
export declare const TABLE = "table";
|
|
37
|
-
export declare const GENERAL = "general";
|
|
38
|
-
export declare const CONFIG = "configuration";
|
|
39
|
-
export declare const DESTINATIONS: Record<string, string>;
|
|
1
|
+
export * from './app';
|
|
2
|
+
export * from './metricOptions';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ThemeType } from '@/utils';
|
|
3
|
+
export interface DashboardProps {
|
|
4
|
+
token: string;
|
|
5
|
+
options?: {
|
|
6
|
+
headerVariant?: 'static' | 'floating';
|
|
7
|
+
disableMetricCreation?: boolean;
|
|
8
|
+
chartColors?: string[];
|
|
9
|
+
};
|
|
10
|
+
theme?: ThemeType;
|
|
11
|
+
}
|
|
12
|
+
export declare const EmbeddedDashboard: React.FC<DashboardProps>;
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface DashboardProps {
|
|
4
|
-
token: string;
|
|
5
|
-
options?: {
|
|
6
|
-
headerVariant?: 'static' | 'floating';
|
|
7
|
-
disableMetricCreation?: boolean;
|
|
8
|
-
chartColors?: string[];
|
|
9
|
-
};
|
|
10
|
-
theme?: ThemeType;
|
|
11
|
-
}
|
|
12
|
-
export declare const Dashboard: React.FC<DashboardProps>;
|
|
1
|
+
export * from './Dashboard';
|
|
2
|
+
export * from './EmbededDashboard';
|
|
@@ -4,5 +4,5 @@ declare type Params = {
|
|
|
4
4
|
col: string;
|
|
5
5
|
database: string;
|
|
6
6
|
};
|
|
7
|
-
declare const getTimeFilterValue: ({ timeGrainValue, isTimeStamp, col, database, }: Params) => string;
|
|
8
|
-
export
|
|
7
|
+
export declare const getTimeFilterValue: ({ timeGrainValue, isTimeStamp, col, database, }: Params) => string;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const groupArray: <T extends Record<string, any>, K extends keyof T>(array: T[], key: K) => Record<T[K], T[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const useEmbeddedDashboard: (token: string) => {
|
|
1
|
+
export declare const useEmbeddedDashboard: (token: string) => {
|
|
2
2
|
isLoading: boolean;
|
|
3
3
|
data: {
|
|
4
4
|
clientId: string | undefined;
|
|
@@ -50,4 +50,3 @@ declare const useEmbeddedDashboard: (token: string) => {
|
|
|
50
50
|
isAllowedToCreateMetrics: boolean;
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
export default useEmbeddedDashboard;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
|
-
import { AxisSettings, CustomSettings, DashboardType, GroupBy, LabelSettings, LegendSettings, RlsFilterObjectType, SelectedColumns, BackgroundSettings } from '@/types';
|
|
2
|
+
import { AxisSettings, CustomSettings, DashboardType, GroupBy, LabelSettings, LegendSettings, RlsFilterObjectType, SelectedColumns, BackgroundSettings } from '@/types/app';
|
|
3
3
|
declare type Params = {
|
|
4
4
|
companyIntegrationId: string | undefined;
|
|
5
5
|
selectedColumns: SelectedColumns[] | undefined;
|
|
@@ -32,8 +32,8 @@ declare type Params = {
|
|
|
32
32
|
selectedGroupBy: string[];
|
|
33
33
|
groupBy: GroupBy | undefined;
|
|
34
34
|
};
|
|
35
|
-
declare const useExternalMetric: ({ companyIntegrationId, selectedColumns, query, metricQuery, integrationName, outputColumns, xAxis, yAxisList, chartType, step, measure, sankeyValues, singleValue, margins, legendSettings, labelSettings, axisSettings, customSettings, backGroundColor, clientId, companyId, mode, timeGrain, dashboardIds, isEnableGroupBy, groupBy, selectedGroupBy, }: Params) => {
|
|
35
|
+
export declare const useExternalMetric: ({ companyIntegrationId, selectedColumns, query, metricQuery, integrationName, outputColumns, xAxis, yAxisList, chartType, step, measure, sankeyValues, singleValue, margins, legendSettings, labelSettings, axisSettings, customSettings, backGroundColor, clientId, companyId, mode, timeGrain, dashboardIds, isEnableGroupBy, groupBy, selectedGroupBy, }: Params) => {
|
|
36
36
|
createExternalMetric: (data: FieldValues) => void;
|
|
37
37
|
error: string;
|
|
38
38
|
};
|
|
39
|
-
export
|
|
39
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const useGenerateDatasetMetrics: () => {
|
|
1
|
+
export declare const useGenerateDatasetMetrics: () => {
|
|
2
2
|
generateDatasetMetric: import("react-query").UseMutateFunction<import("@/utils/generated/graphql").GenerateDatasetMetricsMutation, unknown, import("@/utils/generated/graphql").Exact<{
|
|
3
3
|
companyId?: import("@/utils/generated/graphql").InputMaybe<string> | undefined;
|
|
4
4
|
userInputs?: any;
|
|
@@ -11,4 +11,3 @@ declare const useGenerateDatasetMetrics: () => {
|
|
|
11
11
|
columnName?: import("@/utils/generated/graphql").InputMaybe<string> | undefined;
|
|
12
12
|
}>, unknown>;
|
|
13
13
|
};
|
|
14
|
-
export default useGenerateDatasetMetrics;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
declare type Params = {
|
|
4
|
+
clientId: string | null;
|
|
5
|
+
companyId: string | null;
|
|
6
|
+
setError: React.Dispatch<React.SetStateAction<string>>;
|
|
7
|
+
setLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
8
|
+
setData: React.Dispatch<React.SetStateAction<any[] | undefined>>;
|
|
9
|
+
setQuery: React.Dispatch<React.SetStateAction<string>>;
|
|
10
|
+
setMetricQuery: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
11
|
+
};
|
|
12
|
+
export declare const useGenerateEmbeddedMetric: ({ clientId, companyId, setData, setError, setLoading, setQuery, setMetricQuery, }: Params) => {
|
|
13
|
+
generateEmbeddedMetric: (data: FieldValues) => void;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -3,5 +3,5 @@ declare type UseOutsideAlerterProps = {
|
|
|
3
3
|
onOutsideClick: () => void;
|
|
4
4
|
wrapRef: React.RefObject<any>;
|
|
5
5
|
};
|
|
6
|
-
declare const useOutsideAlerter: ({ onOutsideClick, wrapRef, }: UseOutsideAlerterProps) => void;
|
|
7
|
-
export
|
|
6
|
+
export declare const useOutsideAlerter: ({ onOutsideClick, wrapRef, }: UseOutsideAlerterProps) => void;
|
|
7
|
+
export {};
|
package/dist/index.d.ts
CHANGED