@databrainhq/plugin 0.8.9 → 0.8.11
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/MetricCreation/MetricCreation.d.ts +1 -1
- package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
- package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +2 -1
- package/dist/components/MetricList/MetricList.d.ts +2 -0
- package/dist/components/MetricList/components/MetricCard.d.ts +2 -0
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/ModalFooter.d.ts +1 -1
- package/dist/hooks/useEmbeddedDashboard.d.ts +1 -1
- package/dist/hooks/useExternalMetric.d.ts +24 -16
- package/dist/index.es.js +764 -430
- package/dist/index.umd.js +111 -66
- package/dist/style.css +1 -1
- package/dist/types/metricCreate.d.ts +9 -2
- package/dist/typings.d.ts +17 -17
- package/dist/utils/generated/graphql.d.ts +90 -7
- package/package.json +98 -98
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
1
|
/// <reference types="react" />
|
|
2
2
|
import { EmbeddedMetricCreationProps } from '@/types/metricCreate';
|
|
3
|
-
export declare const EmbeddedMetricCreation: ({ clientId, companyId,
|
|
3
|
+
export declare const EmbeddedMetricCreation: ({ clientId, companyId, isLiveMode, externalDashboardId, userProvidedDashboardId, chartColors, isShowMetricCreateModal, setShowMetricCreateModal, metric, metricData, workspaceId, }: 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, chartColors, }: 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, isUpdateMetric, }: MetricOutputProps) => JSX.Element;
|
package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ declare type Props = {
|
|
|
4
4
|
outpuTableData: any[] | undefined;
|
|
5
5
|
isOutputLoading: boolean;
|
|
6
6
|
outputError: string;
|
|
7
|
+
isUpdateMetric?: boolean;
|
|
7
8
|
};
|
|
8
|
-
export declare const TableTab: ({ outpuTableData, outputError, isOutputLoading, previewTableDataList, }: Props) => JSX.Element;
|
|
9
|
+
export declare const TableTab: ({ outpuTableData, outputError, isOutputLoading, previewTableDataList, isUpdateMetric, }: Props) => JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -7,6 +7,7 @@ export declare type ExternalMetricListProps = {
|
|
|
7
7
|
chartColors?: string[];
|
|
8
8
|
globalFilters?: MetricCardProps['globalFilters'];
|
|
9
9
|
client: ClientType['value'];
|
|
10
|
+
companyId: string;
|
|
10
11
|
isAllowedToDeleteMetrics?: boolean;
|
|
11
12
|
isLiveMode: boolean;
|
|
12
13
|
isMetricListLoading?: boolean;
|
|
@@ -44,5 +45,6 @@ export declare type ExternalMetricListProps = {
|
|
|
44
45
|
companyTenancyType: string;
|
|
45
46
|
externalDashboardId: string;
|
|
46
47
|
externalDashboardPk: string;
|
|
48
|
+
workspaceId: string;
|
|
47
49
|
};
|
|
48
50
|
export declare const ExternalMetricList: React.FC<ExternalMetricListProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ExternalMetrics } from '@/utils/generated/graphql';
|
|
2
3
|
import { ClientType } from '@/types/app';
|
|
3
4
|
import { MetricChartProps } from '@/components/MetricChart';
|
|
4
5
|
import { FilterFieldType } from '@/components/FilterField';
|
|
@@ -15,5 +16,6 @@ export declare type MetricCardProps = {
|
|
|
15
16
|
companyTenancyType: string;
|
|
16
17
|
renderHeaderName?: (name: string) => JSX.Element;
|
|
17
18
|
onArchive?: (metricId: string) => void;
|
|
19
|
+
onEdit?: (metric: ExternalMetrics, metricData?: Record<string, any>[]) => void;
|
|
18
20
|
};
|
|
19
21
|
export declare const MetricCard: React.FC<MetricCardProps>;
|
|
@@ -1,40 +1,48 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { ExternalMetrics } from '@/utils/generated/graphql';
|
|
2
3
|
import { AxisSettings, CustomSettings, TableSettings, DashboardType, GroupBy, LabelSettings, LegendSettings, RlsFilterObjectType, SelectedColumns, BackgroundSettings } from '@/types/app';
|
|
3
4
|
declare type Params = {
|
|
5
|
+
onSuccess: () => void;
|
|
4
6
|
companyIntegrationId: string | undefined;
|
|
5
7
|
selectedColumns: SelectedColumns[] | undefined;
|
|
6
8
|
query: string;
|
|
7
9
|
metricQuery: string | undefined;
|
|
8
10
|
outputColumns: string | undefined;
|
|
9
|
-
xAxis: string | undefined;
|
|
10
|
-
yAxisList: string[] | undefined;
|
|
11
|
-
chartType: string;
|
|
12
|
-
step: string | undefined;
|
|
13
|
-
measure: string | undefined;
|
|
14
11
|
id?: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
chartSettings: {
|
|
13
|
+
xAxis: string | undefined;
|
|
14
|
+
yAxisList: string[] | undefined;
|
|
15
|
+
chartType: string;
|
|
16
|
+
step: string | undefined;
|
|
17
|
+
measure: string | undefined;
|
|
18
|
+
sankeyValues: string[] | undefined;
|
|
19
|
+
singleValue: string | undefined;
|
|
20
|
+
margins: Record<string, number>;
|
|
21
|
+
legendSettings: LegendSettings;
|
|
22
|
+
labelSettings: LabelSettings;
|
|
23
|
+
axisSettings: AxisSettings;
|
|
24
|
+
customSettings?: CustomSettings;
|
|
25
|
+
tableSettings?: TableSettings;
|
|
26
|
+
backGroundColor?: BackgroundSettings;
|
|
27
|
+
};
|
|
24
28
|
integrationName: string | undefined;
|
|
25
29
|
clientId?: string | null;
|
|
26
30
|
isEmbedded?: boolean;
|
|
27
31
|
rlsFilters?: RlsFilterObjectType[];
|
|
28
32
|
companyId: string;
|
|
29
|
-
|
|
33
|
+
isLiveMode?: boolean;
|
|
30
34
|
timeGrain?: string;
|
|
31
35
|
dashboardIds: DashboardType['id'][];
|
|
36
|
+
userProvidedDashboardId: string;
|
|
32
37
|
isEnableGroupBy: boolean;
|
|
33
38
|
selectedGroupBy: string[];
|
|
34
39
|
groupBy: GroupBy | undefined;
|
|
40
|
+
metric?: ExternalMetrics;
|
|
35
41
|
};
|
|
36
|
-
export declare const useExternalMetric: ({ companyIntegrationId, selectedColumns, query, metricQuery, integrationName, outputColumns,
|
|
42
|
+
export declare const useExternalMetric: ({ onSuccess, companyIntegrationId, selectedColumns, query, metricQuery, integrationName, outputColumns, chartSettings, clientId, companyId, isLiveMode, timeGrain, dashboardIds, isEnableGroupBy, groupBy, selectedGroupBy, userProvidedDashboardId, metric, }: Params) => {
|
|
37
43
|
createExternalMetric: (data: FieldValues) => void;
|
|
44
|
+
updateExternalMetric: (data: FieldValues) => void;
|
|
38
45
|
error: string;
|
|
46
|
+
isLoading: boolean;
|
|
39
47
|
};
|
|
40
48
|
export {};
|