@databrainhq/plugin 0.8.1 → 0.8.3
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/Charts/Table/TableChart.d.ts +3 -3
- package/dist/components/MetricChart/MetricChart.d.ts +2 -1
- package/dist/components/MetricCreation/MetricCreation.d.ts +1 -1
- package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +3 -1
- package/dist/components/MetricList/MetricList.d.ts +1 -0
- package/dist/components/MetricList/components/DeleteMetricModal.d.ts +1 -0
- package/dist/components/Table/DebouncedInput.d.ts +6 -0
- package/dist/components/Table/index.d.ts +4 -1
- package/dist/consts/validations.d.ts +24 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useApplyAdminTheme.d.ts +2 -0
- package/dist/hooks/useDownloadRawCsv.d.ts +18 -0
- package/dist/hooks/useEmbeddedDashboard.d.ts +1 -0
- package/dist/index.es.js +7222 -3460
- package/dist/index.umd.js +140 -62
- package/dist/style.css +1 -1
- package/dist/types/metricCreate.d.ts +2 -0
- package/dist/typings.d.ts +17 -17
- package/dist/utils/generated/graphql.d.ts +43 -2
- package/dist/utils/theme.d.ts +1 -0
- package/package.json +98 -96
- package/dist/contexts/globalTheme.d.ts +0 -9
package/README.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# @databrainhq/plugin
|
|
2
|
-
|
|
3
|
-
> Databrain app ui plugin.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@databrainhq/plugin) [](https://standardjs.com)
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @databrainhq/plugin
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
import { Dashboard } from '@databrainhq/plugin';
|
|
17
|
-
import '@databrainhq/plugin/dist/style.css';
|
|
18
|
-
|
|
19
|
-
const Example = () => {
|
|
20
|
-
return <Dashboard token={/* Your Guest Token */} />;
|
|
21
|
-
};
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## License
|
|
25
|
-
|
|
26
|
-
MIT © [databrainhq](https://github.com/databrainhq)
|
|
1
|
+
# @databrainhq/plugin
|
|
2
|
+
|
|
3
|
+
> Databrain app ui plugin.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@databrainhq/plugin) [](https://standardjs.com)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @databrainhq/plugin
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Dashboard } from '@databrainhq/plugin';
|
|
17
|
+
import '@databrainhq/plugin/dist/style.css';
|
|
18
|
+
|
|
19
|
+
const Example = () => {
|
|
20
|
+
return <Dashboard token={/* Your Guest Token */} />;
|
|
21
|
+
};
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
MIT © [databrainhq](https://github.com/databrainhq)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: React.MemoExoticComponent<({ data, chartClickConfig, tableSettings, tableName, }: any) => JSX.Element>;
|
|
3
|
+
export default _default;
|
|
@@ -35,6 +35,7 @@ export declare type MetricChartProps = {
|
|
|
35
35
|
chartClickConfig: ClickActionsConfig['chart'];
|
|
36
36
|
tableSettings: TableSettings;
|
|
37
37
|
chartRef: React.RefObject<EChartsReact>;
|
|
38
|
+
tableName?: string;
|
|
38
39
|
handleChartRightClick: (params: any) => void;
|
|
39
40
|
};
|
|
40
|
-
export declare const MetricChart: ({ labels, data, chartType, funnelData, sankeyData, singleValueData, margins, legendSettings, labelSettings, axisSettings, customSettings, enableSaveAs, colors, updateGroup, isEnableGroupBy, backGroundColor, chartClickConfig, tableSettings, chartRef, handleChartRightClick, }: MetricChartProps) => JSX.Element;
|
|
41
|
+
export declare const MetricChart: ({ labels, data, chartType, funnelData, sankeyData, singleValueData, margins, legendSettings, labelSettings, axisSettings, customSettings, enableSaveAs, colors, updateGroup, isEnableGroupBy, backGroundColor, chartClickConfig, tableSettings, chartRef, tableName, handleChartRightClick, }: MetricChartProps) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { EmbeddedMetricCreationProps } from '@/types/metricCreate';
|
|
3
|
-
export declare const EmbeddedMetricCreation: ({ clientId, companyId, mode, externalDashboardId, variant, }: EmbeddedMetricCreationProps) => JSX.Element;
|
|
3
|
+
export declare const EmbeddedMetricCreation: ({ clientId, companyId, mode, externalDashboardId, variant, chartColors, }: EmbeddedMetricCreationProps) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { MetricOutputProps } from '@/types/metricCreate';
|
|
3
|
-
export declare const MetricOutput: ({ data, error, isLoading, labels, funnelData, chartType, datasets, setChartType, setXAxis, setYAxisList, yAxisList, xAxis, setMeasure, setStep, step, measure, setSankeyValues, sankeyData, previewTableDataList, singleValue, setSingleValue, singleValueData, setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, axisSettings, setAxisSettings, customSettings, setCustomSettings, tableSettings, setTableSettings, updateGroup, isEnableGroupBy, backGroundColor, setBackGroundColor, moreTabs, }: MetricOutputProps) => JSX.Element;
|
|
3
|
+
export declare const MetricOutput: ({ data, error, isLoading, labels, funnelData, chartType, datasets, setChartType, setXAxis, setYAxisList, yAxisList, xAxis, setMeasure, setStep, step, measure, setSankeyValues, sankeyData, previewTableDataList, singleValue, setSingleValue, singleValueData, setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, axisSettings, setAxisSettings, customSettings, setCustomSettings, tableSettings, setTableSettings, updateGroup, isEnableGroupBy, backGroundColor, setBackGroundColor, moreTabs, chartColors, }: MetricOutputProps) => JSX.Element;
|
package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ declare type Props = {
|
|
|
48
48
|
headerChild?: JSX.Element;
|
|
49
49
|
tableSettings: TableSettings;
|
|
50
50
|
setTableSettings: React.Dispatch<React.SetStateAction<TableSettings>>;
|
|
51
|
+
tableName?: string;
|
|
52
|
+
chartColors?: string[];
|
|
51
53
|
};
|
|
52
|
-
export declare const ChartTab: ({ labels, datasets, funnelData, chartType, setChartType, data, setXAxis, setYAxisList, yAxisList, xAxis, setMeasure, setStep, step, measure, setSankeyValues, sankeyData, singleValue, setSingleValue, singleValueData, setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, customSettings, setCustomSettings, axisSettings, setAxisSettings, updateGroup, isLoading, isEnableGroupBy, backGroundColor, setBackGroundColor, headerChild, tableSettings, setTableSettings, }: Props) => JSX.Element;
|
|
54
|
+
export declare const ChartTab: ({ labels, datasets, funnelData, chartType, setChartType, data, setXAxis, setYAxisList, yAxisList, xAxis, setMeasure, setStep, step, measure, setSankeyValues, sankeyData, singleValue, setSingleValue, singleValueData, setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, customSettings, setCustomSettings, axisSettings, setAxisSettings, updateGroup, isLoading, isEnableGroupBy, backGroundColor, setBackGroundColor, headerChild, tableSettings, setTableSettings, tableName, chartColors, }: Props) => JSX.Element;
|
|
53
55
|
export {};
|
|
@@ -3,5 +3,6 @@ import { ModalProps } from '@/components/Modal';
|
|
|
3
3
|
export interface DeleteMetricModalProps extends Omit<ModalProps, 'headerTitle'> {
|
|
4
4
|
onSuccess: () => void;
|
|
5
5
|
metricId: string;
|
|
6
|
+
dashboardId: string;
|
|
6
7
|
}
|
|
7
8
|
export declare const DeleteMetricModal: React.FC<DeleteMetricModalProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const DebouncedInput: ({ value, onChange, debounce, ...props }: {
|
|
3
|
+
value: string | number;
|
|
4
|
+
onChange: (value: string | number) => void;
|
|
5
|
+
debounce?: number | undefined;
|
|
6
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange">) => JSX.Element;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { TableSettings } from '@/types';
|
|
2
3
|
declare type Props = {
|
|
3
4
|
data: any[] | undefined;
|
|
4
5
|
isLoading: boolean;
|
|
5
6
|
error: string;
|
|
7
|
+
tableSettings?: TableSettings;
|
|
8
|
+
tableName?: string;
|
|
6
9
|
};
|
|
7
|
-
export declare const Table: ({ data, isLoading, error }: Props) => JSX.Element;
|
|
10
|
+
export declare const Table: ({ data, isLoading, error, tableSettings, tableName, }: Props) => JSX.Element;
|
|
8
11
|
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const required: {
|
|
2
|
+
required: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const asEmail: {
|
|
5
|
+
pattern: {
|
|
6
|
+
value: RegExp;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
required: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const asPassword: {
|
|
12
|
+
minLength: {
|
|
13
|
+
value: number;
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
required: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const asName: {
|
|
19
|
+
minLength: {
|
|
20
|
+
value: number;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
required: string;
|
|
24
|
+
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
declare const useDownloadRawCsv: () => {
|
|
4
|
+
isShowRawCsvModal: boolean;
|
|
5
|
+
setRawCsvModal: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
downloadCsvError: string;
|
|
8
|
+
onSubmitDownloadCsv: ({ companyId, sqlQuery, values, clientName, tenancyType, }: {
|
|
9
|
+
values: FieldValues;
|
|
10
|
+
sqlQuery: string;
|
|
11
|
+
companyId: string;
|
|
12
|
+
clientName?: string | undefined;
|
|
13
|
+
tenancyType?: string | undefined;
|
|
14
|
+
}) => void;
|
|
15
|
+
handleSubmit: import("react-hook-form").UseFormHandleSubmit<FieldValues>;
|
|
16
|
+
register: import("react-hook-form").UseFormRegister<FieldValues>;
|
|
17
|
+
};
|
|
18
|
+
export default useDownloadRawCsv;
|