@databrainhq/plugin 0.8.10 → 0.8.12

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 CHANGED
@@ -1,26 +1,26 @@
1
- # @databrainhq/plugin
2
-
3
- > Databrain app ui plugin.
4
-
5
- [![NPM](https://img.shields.io/npm/v/@databrainhq/plugin.svg)](https://www.npmjs.com/package/@databrainhq/plugin) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](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
+ [![NPM](https://img.shields.io/npm/v/@databrainhq/plugin.svg)](https://www.npmjs.com/package/@databrainhq/plugin) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](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, mode, externalDashboardId, variant, chartColors, workspaceId, }: EmbeddedMetricCreationProps) => JSX.Element;
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;
@@ -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,5 +1,5 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- export interface ModalProps extends PropsWithChildren<any> {
2
+ export interface ModalProps extends PropsWithChildren {
3
3
  isOpen: boolean;
4
4
  onClose: () => void;
5
5
  headerTitle?: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare type ModalFooterProps = React.PropsWithChildren<any> & {
2
+ export declare type ModalFooterProps = React.PropsWithChildren & {
3
3
  className?: string;
4
4
  };
5
5
  export declare const ModalFooter: React.FC<ModalFooterProps>;
@@ -3,7 +3,7 @@ export declare const useEmbeddedDashboard: (token: string) => {
3
3
  data: {
4
4
  clientId: string | undefined;
5
5
  companyId: any;
6
- mode: any;
6
+ isLiveMode: any;
7
7
  externalDashboardMetrics: {
8
8
  __typename?: "externalDashboardMetrics" | undefined;
9
9
  externalMetricId: any;
@@ -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
- sankeyValues: string[] | undefined;
16
- singleValue: string | undefined;
17
- margins: Record<string, number>;
18
- legendSettings: LegendSettings;
19
- labelSettings: LabelSettings;
20
- axisSettings: AxisSettings;
21
- customSettings?: CustomSettings;
22
- tableSettings?: TableSettings;
23
- backGroundColor?: BackgroundSettings;
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
- mode?: boolean;
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, xAxis, yAxisList, chartType, step, measure, sankeyValues, singleValue, margins, legendSettings, labelSettings, axisSettings, customSettings, tableSettings, backGroundColor, clientId, companyId, mode, timeGrain, dashboardIds, isEnableGroupBy, groupBy, selectedGroupBy, }: Params) => {
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 {};