@databrainhq/plugin 0.4.2
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 -0
- package/dist/components/Button/index.d.ts +13 -0
- package/dist/components/ChartModal/ChartConfig.d.ts +18 -0
- package/dist/components/ChartModal/ChartModalOptions.d.ts +6 -0
- package/dist/components/ChartModal/SelectField.d.ts +2 -0
- package/dist/components/Charts/AreaChart.d.ts +2 -0
- package/dist/components/Charts/BarChart.d.ts +15 -0
- package/dist/components/Charts/BoxPlot.d.ts +2 -0
- package/dist/components/Charts/BubbleChart.d.ts +2 -0
- package/dist/components/Charts/ComboChart.d.ts +2 -0
- package/dist/components/Charts/DoughnutChart.d.ts +2 -0
- package/dist/components/Charts/FunnelChart.d.ts +2 -0
- package/dist/components/Charts/GaugeChart.d.ts +2 -0
- package/dist/components/Charts/Histogram.d.ts +2 -0
- package/dist/components/Charts/LineChart.d.ts +21 -0
- package/dist/components/Charts/PieChart.d.ts +2 -0
- package/dist/components/Charts/RowChart.d.ts +2 -0
- package/dist/components/Charts/SankeyChart.d.ts +2 -0
- package/dist/components/Charts/ScatterChart.d.ts +2 -0
- package/dist/components/Charts/SingleValueChart.d.ts +2 -0
- package/dist/components/Charts/StackedBarChart.d.ts +2 -0
- package/dist/components/Charts/SteppedAreaChart.d.ts +2 -0
- package/dist/components/Charts/TableChart.d.ts +2 -0
- package/dist/components/Charts/WaterfallChart.d.ts +2 -0
- package/dist/components/DataType/index.d.ts +3 -0
- package/dist/components/Error/index.d.ts +5 -0
- package/dist/components/ExternalMetricForm/index.d.ts +14 -0
- package/dist/components/FilterDropDown/index.d.ts +12 -0
- package/dist/components/FilterField/index.d.ts +20 -0
- package/dist/components/FloatingDropDown/index.d.ts +25 -0
- package/dist/components/FullScreenChart/index.d.ts +8 -0
- package/dist/components/InputField/index.d.ts +25 -0
- package/dist/components/MetricCard/index.d.ts +17 -0
- package/dist/components/MetricChart/CsvDownloadButton.d.ts +8 -0
- package/dist/components/MetricChart/index.d.ts +32 -0
- package/dist/components/MetricCreation/components/ConstructMetric/components/MetricForm/index.d.ts +4 -0
- package/dist/components/MetricCreation/components/ConstructMetric/index.d.ts +4 -0
- package/dist/components/MetricCreation/components/Dataset/index.d.ts +4 -0
- package/dist/components/MetricCreation/components/Header/index.d.ts +3 -0
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartConfigure/index.d.ts +17 -0
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartSettings/index.d.ts +19 -0
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +45 -0
- package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/components/InputTables/index.d.ts +2 -0
- package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +8 -0
- package/dist/components/MetricCreation/components/MetricOutput/index.d.ts +3 -0
- package/dist/components/MetricCreation/index.d.ts +3 -0
- package/dist/components/MetricFilters/index.d.ts +10 -0
- package/dist/components/MetricList/index.d.ts +41 -0
- package/dist/components/MetricTable/index.d.ts +6 -0
- package/dist/components/Modal/ModalFooter.d.ts +3 -0
- package/dist/components/Modal/index.d.ts +10 -0
- package/dist/components/PopoverMenu/index.d.ts +12 -0
- package/dist/components/SearchTab/index.d.ts +2 -0
- package/dist/components/Select/index.d.ts +45 -0
- package/dist/components/SingleValueCard/index.d.ts +4 -0
- package/dist/components/Tab/index.d.ts +8 -0
- package/dist/components/Table/index.d.ts +7 -0
- package/dist/components/Text/index.d.ts +10 -0
- package/dist/components/TextAreaField/index.d.ts +18 -0
- package/dist/components/TimeGrainField/index.d.ts +12 -0
- package/dist/components/ToggleButton/index.d.ts +12 -0
- package/dist/consts/index.d.ts +37 -0
- package/dist/consts/metricOptions.d.ts +17 -0
- package/dist/containers/Dashboard/index.d.ts +5 -0
- package/dist/containers/index.d.ts +1 -0
- package/dist/helpers/getTimeFilterValue.d.ts +8 -0
- package/dist/helpers/groupBy.d.ts +2 -0
- package/dist/hooks/useEmbeddedDashboard.d.ts +46 -0
- package/dist/hooks/useExternalMetric.d.ts +38 -0
- package/dist/hooks/useGenerateDatasetMetrics.d.ts +14 -0
- package/dist/hooks/useOutsideAlerter.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +101669 -0
- package/dist/index.umd.js +322 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +83 -0
- package/dist/types/metricCreate.d.ts +108 -0
- package/dist/typings.d.ts +17 -0
- package/dist/utils/arrayToCsvString.d.ts +7 -0
- package/dist/utils/colors.d.ts +2 -0
- package/dist/utils/fetcher.d.ts +1 -0
- package/dist/utils/generated/graphql.d.ts +1616 -0
- package/dist/utils/getChartAttributes.d.ts +27 -0
- package/dist/utils/getFormattedDataType.d.ts +2 -0
- package/package.json +99 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import type { Control } from 'react-hook-form';
|
|
4
|
+
declare type Option = {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
declare type SelectInput = {
|
|
9
|
+
label?: string;
|
|
10
|
+
value: any;
|
|
11
|
+
placeHolder?: string;
|
|
12
|
+
options: Option[] | undefined;
|
|
13
|
+
onChange?: (val: string | any) => void;
|
|
14
|
+
defaultValue?: string | number | boolean;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
isSearchEnabled?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare type HookSelectInput = Omit<SelectInput, 'value'> & {
|
|
20
|
+
control: Control;
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const Select: ({ label, options, onChange, value, defaultValue, children, placeHolder, className, isSearchEnabled }: SelectInput) => any;
|
|
24
|
+
declare const HookSelect: ({ control, name, options, label, defaultValue }: HookSelectInput) => any;
|
|
25
|
+
export declare const SelectWithSubValue: ({ label, options, onChange, value, defaultValue }: any) => any;
|
|
26
|
+
export declare const DropDown: ({ control, name, options, label, defaultValue }: HookSelectInput) => any;
|
|
27
|
+
declare type MultiSelectProps = {
|
|
28
|
+
options: Option[];
|
|
29
|
+
defaultValue?: Option['value'][];
|
|
30
|
+
value?: Option['value'][];
|
|
31
|
+
onChange?: (selected: Option['value'][]) => void;
|
|
32
|
+
label?: string;
|
|
33
|
+
name: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
placeHolder?: string;
|
|
37
|
+
onClick?: any;
|
|
38
|
+
isSearchEnabled?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export declare const MultiSelect: React.FC<MultiSelectProps>;
|
|
41
|
+
declare type HookMultiSelectProps = MultiSelectProps & {
|
|
42
|
+
control: Control<FieldValues>;
|
|
43
|
+
};
|
|
44
|
+
export declare const HookMultiSelect: React.FC<HookMultiSelectProps>;
|
|
45
|
+
export default HookSelect;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
className?: string;
|
|
4
|
+
variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
5
|
+
children?: React.ReactNode;
|
|
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';
|
|
8
|
+
}
|
|
9
|
+
declare const Text: ({ className, variant, styleClass, children, onClick }: Props) => any;
|
|
10
|
+
export default Text;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { UseFormRegisterReturn } from 'react-hook-form';
|
|
2
|
+
interface Props {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
rows: number;
|
|
7
|
+
cols?: number;
|
|
8
|
+
resizable?: boolean;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
register?: UseFormRegisterReturn;
|
|
12
|
+
error?: any;
|
|
13
|
+
onFocus?: any;
|
|
14
|
+
onBlur?: any;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const TextAreaField: ({ id, label, placeholder, rows, cols, resizable, register, error, defaultValue, value, onFocus, onBlur, className }: Props) => any;
|
|
18
|
+
export default TextAreaField;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FieldValues, UseFormRegister } from 'react-hook-form';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
isShowlabel?: boolean;
|
|
5
|
+
timeGrainValue: string;
|
|
6
|
+
setTimeGrainValue: React.Dispatch<React.SetStateAction<string>>;
|
|
7
|
+
register?: UseFormRegister<FieldValues>;
|
|
8
|
+
className?: string;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const TimeGrainField: ({ isShowlabel, timeGrainValue, setTimeGrainValue, register, className, isDisabled }: Props) => any;
|
|
12
|
+
export default TimeGrainField;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type SwitchButtonProps = {
|
|
3
|
+
onChange?: (enabled: boolean) => void;
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
labelClassName?: string;
|
|
9
|
+
defaultEnabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: React.NamedExoticComponent<SwitchButtonProps>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
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 DESTINATIONS: Record<string, string>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const operatorList: {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}[];
|
|
5
|
+
export declare const RowLimitList: {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const AggregateList: {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}[];
|
|
13
|
+
export declare const NUMBER_TYPES: string[];
|
|
14
|
+
export declare const STRING_TYPES: string[];
|
|
15
|
+
export declare const DATE_TYPES: string[];
|
|
16
|
+
export declare const ARRAY_TYPES: string[];
|
|
17
|
+
export declare const BOOLEAN_TYPES: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dashboard';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const groupByMultipleKeys: (rawData: any[] | undefined, keys: string[], measureKey: string) => any;
|
|
2
|
+
export declare const updateGroupData: (data: any[] | undefined, keys: string[], selectedGroupBy: string[], setGroupedData: (value: React.SetStateAction<Record<string, any>[]>) => void) => void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
declare const useEmbeddedDashboard: (token: string) => {
|
|
2
|
+
isLoading: boolean;
|
|
3
|
+
data: {
|
|
4
|
+
clientId: string | undefined;
|
|
5
|
+
companyId: any;
|
|
6
|
+
mode: any;
|
|
7
|
+
externalDashboardMetrics: {
|
|
8
|
+
__typename?: "externalDashboardMetrics" | undefined;
|
|
9
|
+
externalMetricId: any;
|
|
10
|
+
externalDashboardId: any;
|
|
11
|
+
externalMetric: {
|
|
12
|
+
__typename?: "externalMetrics" | undefined;
|
|
13
|
+
chartOptions: any;
|
|
14
|
+
clientId?: string | null | undefined;
|
|
15
|
+
companyId: any;
|
|
16
|
+
companyIntegrationId: any;
|
|
17
|
+
createdAt: any;
|
|
18
|
+
createdBy?: string | null | undefined;
|
|
19
|
+
description: string;
|
|
20
|
+
id: any;
|
|
21
|
+
inputFields?: any;
|
|
22
|
+
integrationName: string;
|
|
23
|
+
isCreatedByClient: boolean;
|
|
24
|
+
isLive: boolean;
|
|
25
|
+
metricId: string;
|
|
26
|
+
metricQuery?: string | null | undefined;
|
|
27
|
+
name: string;
|
|
28
|
+
outputColumns?: string | null | undefined;
|
|
29
|
+
query: string;
|
|
30
|
+
resizeAttributes: any;
|
|
31
|
+
timeGrain?: string | null | undefined;
|
|
32
|
+
updatedAt: any;
|
|
33
|
+
selectedGroupBy: any;
|
|
34
|
+
isEnableGroupBy: boolean;
|
|
35
|
+
groupBy: any;
|
|
36
|
+
};
|
|
37
|
+
}[] | undefined;
|
|
38
|
+
externalDashboard: {
|
|
39
|
+
__typename?: "externalDashboards" | undefined;
|
|
40
|
+
id: any;
|
|
41
|
+
filters: any;
|
|
42
|
+
} | undefined;
|
|
43
|
+
rlsSettings: any;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export default useEmbeddedDashboard;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { AxisSettings, DashboardType, GroupBy, LabelSettings, LegendSettings, RlsFilterObjectType, SelectedColumns } from '@/types';
|
|
4
|
+
declare type Params = {
|
|
5
|
+
companyIntegrationId: string | undefined;
|
|
6
|
+
selectedColumns: SelectedColumns[] | undefined;
|
|
7
|
+
query: string;
|
|
8
|
+
metricQuery: string | undefined;
|
|
9
|
+
outputColumns: string | undefined;
|
|
10
|
+
xAxis: string | undefined;
|
|
11
|
+
yAxisList: string[] | undefined;
|
|
12
|
+
chartType: string;
|
|
13
|
+
step: string | undefined;
|
|
14
|
+
measure: string | undefined;
|
|
15
|
+
id?: string;
|
|
16
|
+
sankeyValues: string[] | undefined;
|
|
17
|
+
singleValue: string | undefined;
|
|
18
|
+
margins: Record<string, number>;
|
|
19
|
+
legendSettings: LegendSettings;
|
|
20
|
+
labelSettings: LabelSettings;
|
|
21
|
+
axisSettings: AxisSettings;
|
|
22
|
+
integrationName: string | undefined;
|
|
23
|
+
setError?: React.Dispatch<React.SetStateAction<string>>;
|
|
24
|
+
clientId?: string | null;
|
|
25
|
+
isEmbedded?: boolean;
|
|
26
|
+
rlsFilters?: RlsFilterObjectType[];
|
|
27
|
+
companyId: string;
|
|
28
|
+
mode?: boolean;
|
|
29
|
+
timeGrain?: string;
|
|
30
|
+
dashboardIds: DashboardType['id'][];
|
|
31
|
+
isEnableGroupBy: boolean;
|
|
32
|
+
selectedGroupBy: string[];
|
|
33
|
+
groupBy: GroupBy | undefined;
|
|
34
|
+
};
|
|
35
|
+
declare const useExternalMetric: ({ companyIntegrationId, selectedColumns, query, metricQuery, integrationName, outputColumns, xAxis, yAxisList, chartType, step, measure, sankeyValues, singleValue, margins, legendSettings, labelSettings, axisSettings, setError, clientId, companyId, mode, timeGrain, dashboardIds, isEnableGroupBy, groupBy, selectedGroupBy, }: Params) => {
|
|
36
|
+
createExternalMetric: (data: FieldValues) => void;
|
|
37
|
+
};
|
|
38
|
+
export default useExternalMetric;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const useGenerateDatasetMetrics: () => {
|
|
2
|
+
generateDatasetMetric: import("react-query").UseMutateFunction<import("@/utils/generated/graphql").GenerateDatasetMetricsMutation, unknown, import("@/utils/generated/graphql").Exact<{
|
|
3
|
+
companyId?: import("@/utils/generated/graphql").InputMaybe<string> | undefined;
|
|
4
|
+
userInputs?: any;
|
|
5
|
+
}>, unknown>;
|
|
6
|
+
isGeneratingDataset: boolean;
|
|
7
|
+
generateError: unknown;
|
|
8
|
+
fetchColumnValues: import("react-query").UseMutateFunction<import("@/utils/generated/graphql").FetchColumnDataMutation, unknown, import("@/utils/generated/graphql").Exact<{
|
|
9
|
+
companyId?: import("@/utils/generated/graphql").InputMaybe<string> | undefined;
|
|
10
|
+
tableName?: import("@/utils/generated/graphql").InputMaybe<string> | undefined;
|
|
11
|
+
columnName?: import("@/utils/generated/graphql").InputMaybe<string> | undefined;
|
|
12
|
+
}>, unknown>;
|
|
13
|
+
};
|
|
14
|
+
export default useGenerateDatasetMetrics;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type UseOutsideAlerterProps = {
|
|
3
|
+
onOutsideClick: () => void;
|
|
4
|
+
wrapRef: React.RefObject<any>;
|
|
5
|
+
};
|
|
6
|
+
declare const useOutsideAlerter: ({ onOutsideClick, wrapRef, }: UseOutsideAlerterProps) => void;
|
|
7
|
+
export default useOutsideAlerter;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './containers';
|