@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 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
- /// <reference types="react" />
2
- declare const TableChart: ({ data, chartClickConfig, tableSettings }: any) => JSX.Element;
3
- export default TableChart;
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;
@@ -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 {};
@@ -42,5 +42,6 @@ export declare type ExternalMetricListProps = {
42
42
  }[] | undefined;
43
43
  params?: any;
44
44
  companyTenancyType: string;
45
+ externalDashboardId: string;
45
46
  };
46
47
  export declare const ExternalMetricList: React.FC<ExternalMetricListProps>;
@@ -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
+ };
@@ -3,3 +3,4 @@ export * from './useExternalMetric';
3
3
  export * from './useGenerateDatasetMetrics';
4
4
  export * from './useGenerateEmbeddedMetric';
5
5
  export * from './useOutsideAlerter';
6
+ export * from './useApplyAdminTheme';
@@ -0,0 +1,2 @@
1
+ import { Themes } from '@/utils/generated/graphql';
2
+ export declare const useApplyAdminTheme: (adminTheme?: Themes) => void;
@@ -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;
@@ -46,6 +46,7 @@ export declare const useEmbeddedDashboard: (token: string) => {
46
46
  id: any;
47
47
  filters: any;
48
48
  } | undefined;
49
+ externalDashboardId: any;
49
50
  rlsSettings: any;
50
51
  companyTenancyType: any;
51
52
  isAllowedToCreateMetrics: boolean;