@databrainhq/plugin 0.6.10 → 0.7.1

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.
Files changed (83) hide show
  1. package/dist/components/Button/index.d.ts +2 -2
  2. package/dist/components/ChartModal/ChartConfig.d.ts +2 -2
  3. package/dist/components/ChartModal/ChartModalOptions.d.ts +2 -2
  4. package/dist/components/ChartModal/SelectField.d.ts +1 -2
  5. package/dist/components/ChartModal/index.d.ts +3 -0
  6. package/dist/components/Charts/LineChart.d.ts +1 -1
  7. package/dist/components/DataType/index.d.ts +2 -3
  8. package/dist/components/Error/index.d.ts +2 -2
  9. package/dist/components/ErrorFallback/index.d.ts +2 -3
  10. package/dist/components/ExternalMetricForm/index.d.ts +3 -3
  11. package/dist/components/FilterDropDown/index.d.ts +2 -3
  12. package/dist/components/FilterField/index.d.ts +4 -3
  13. package/dist/components/FloatingDropDown/index.d.ts +5 -7
  14. package/dist/components/FullScreenChart/index.d.ts +2 -2
  15. package/dist/components/GlobalFilters/index.d.ts +4 -4
  16. package/dist/components/InfoTooltip/index.d.ts +2 -5
  17. package/dist/components/InputField/index.d.ts +2 -2
  18. package/dist/components/MetricChart/CsvDownloadButton.d.ts +2 -2
  19. package/dist/components/MetricChart/MetricChart.d.ts +34 -0
  20. package/dist/components/MetricChart/index.d.ts +2 -35
  21. package/dist/components/MetricCreation/MetricCreation.d.ts +3 -0
  22. package/dist/components/MetricCreation/components/ConstructMetric/ConstructMetric.d.ts +3 -0
  23. package/dist/components/MetricCreation/components/ConstructMetric/components/MetricForm/index.d.ts +2 -3
  24. package/dist/components/MetricCreation/components/ConstructMetric/index.d.ts +2 -4
  25. package/dist/components/MetricCreation/components/Dataset/index.d.ts +2 -3
  26. package/dist/components/MetricCreation/components/Header/index.d.ts +1 -2
  27. package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +3 -0
  28. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartConfigure/index.d.ts +3 -3
  29. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartSettings/index.d.ts +3 -3
  30. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +3 -3
  31. package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/components/InputTables/index.d.ts +1 -2
  32. package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +2 -2
  33. package/dist/components/MetricCreation/components/MetricOutput/index.d.ts +3 -4
  34. package/dist/components/MetricCreation/index.d.ts +5 -4
  35. package/dist/components/{RlsFilters/index.d.ts → MetricFilters/MetricFilters.d.ts} +3 -3
  36. package/dist/components/{RlsFilters → MetricFilters}/MultipleTimeGrain.d.ts +2 -2
  37. package/dist/components/MetricFilters/index.d.ts +2 -0
  38. package/dist/components/MetricList/MetricList.d.ts +45 -0
  39. package/dist/components/MetricList/components/MetricCard.d.ts +2 -3
  40. package/dist/components/MetricList/components/SingleValueCard.d.ts +1 -2
  41. package/dist/components/MetricList/index.d.ts +3 -45
  42. package/dist/components/MetricTable/index.d.ts +2 -2
  43. package/dist/components/Modal/Modal.d.ts +9 -0
  44. package/dist/components/Modal/ModalFooter.d.ts +4 -2
  45. package/dist/components/Modal/index.d.ts +2 -10
  46. package/dist/components/PopoverMenu/index.d.ts +1 -2
  47. package/dist/components/SearchTab/index.d.ts +1 -2
  48. package/dist/components/Select/index.d.ts +2 -2
  49. package/dist/components/Tab/index.d.ts +2 -2
  50. package/dist/components/Table/index.d.ts +2 -2
  51. package/dist/components/Text/index.d.ts +3 -3
  52. package/dist/components/TextAreaField/index.d.ts +2 -2
  53. package/dist/components/TimeGrainField/index.d.ts +2 -2
  54. package/dist/components/ToggleButton/index.d.ts +2 -2
  55. package/dist/components/index.d.ts +28 -0
  56. package/dist/consts/app.d.ts +39 -0
  57. package/dist/consts/index.d.ts +2 -39
  58. package/dist/containers/Dashboard/Dashboard.d.ts +4 -0
  59. package/dist/containers/Dashboard/EmbededDashboard.d.ts +12 -0
  60. package/dist/containers/Dashboard/index.d.ts +2 -12
  61. package/dist/helpers/getModifiedQuery.d.ts +6 -0
  62. package/dist/helpers/getTimeFilterValue.d.ts +2 -2
  63. package/dist/helpers/groupArray.d.ts +1 -0
  64. package/dist/helpers/index.d.ts +4 -0
  65. package/dist/hooks/index.d.ts +5 -0
  66. package/dist/hooks/useEmbeddedDashboard.d.ts +1 -2
  67. package/dist/hooks/useExternalMetric.d.ts +3 -3
  68. package/dist/hooks/useGenerateDatasetMetrics.d.ts +1 -2
  69. package/dist/hooks/useGenerateEmbeddedMetric.d.ts +15 -0
  70. package/dist/hooks/useOutsideAlerter.d.ts +2 -2
  71. package/dist/index.d.ts +6 -0
  72. package/dist/index.es.js +3191 -2832
  73. package/dist/index.umd.js +124 -106
  74. package/dist/style.css +1 -1
  75. package/dist/types/app.d.ts +124 -0
  76. package/dist/types/index.d.ts +2 -124
  77. package/dist/types/metricCreate.d.ts +1 -9
  78. package/dist/utils/arrayToCsvString.d.ts +1 -2
  79. package/dist/utils/colors.d.ts +1 -2
  80. package/dist/utils/getChartAttributes.d.ts +2 -2
  81. package/dist/utils/getFormattedDataType.d.ts +1 -2
  82. package/dist/utils/index.d.ts +5 -0
  83. package/package.json +3 -3
@@ -1,3 +1,2 @@
1
1
  /// <reference types="react" />
2
- declare const SearchTab: ({ setSearchKeyword, className }: any) => JSX.Element;
3
- export default SearchTab;
2
+ export declare const SearchTab: ({ setSearchKeyword, className }: any) => JSX.Element;
@@ -21,7 +21,7 @@ declare type HookSelectInput = Omit<SelectInput, 'value'> & {
21
21
  name: string;
22
22
  };
23
23
  export declare const Select: ({ label, options, onChange, value, defaultValue, children, placeHolder, className, isSearchEnabled, }: SelectInput) => JSX.Element;
24
- declare const HookSelect: ({ control, name, options, label, defaultValue, }: HookSelectInput) => JSX.Element;
24
+ export declare const HookSelect: ({ control, name, options, label, defaultValue, }: HookSelectInput) => JSX.Element;
25
25
  export declare const SelectWithSubValue: ({ label, options, onChange, value, defaultValue, }: any) => JSX.Element;
26
26
  export declare const DropDown: ({ control, name, options, label, defaultValue, }: HookSelectInput) => JSX.Element;
27
27
  declare type MultiSelectProps = {
@@ -42,4 +42,4 @@ declare type HookMultiSelectProps = MultiSelectProps & {
42
42
  control: Control<FieldValues>;
43
43
  };
44
44
  export declare const HookMultiSelect: React.FC<HookMultiSelectProps>;
45
- export default HookSelect;
45
+ export {};
@@ -6,5 +6,5 @@ declare type TabProps = {
6
6
  className?: string;
7
7
  tabText?: string;
8
8
  };
9
- declare const Tab: ({ options, activeTab, setActiveTab, className, tabText, }: TabProps) => JSX.Element;
10
- export default Tab;
9
+ export declare const Tab: ({ options, activeTab, setActiveTab, className, tabText, }: TabProps) => JSX.Element;
10
+ export {};
@@ -4,5 +4,5 @@ declare type Props = {
4
4
  isLoading: boolean;
5
5
  error: string;
6
6
  };
7
- declare const Table: ({ data, isLoading, error }: Props) => JSX.Element;
8
- export default Table;
7
+ export declare const Table: ({ data, isLoading, error }: Props) => JSX.Element;
8
+ export {};
@@ -4,7 +4,7 @@ interface Props {
4
4
  variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
5
5
  children?: React.ReactNode;
6
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';
7
+ styleClass: 'primary' | 'secondary' | 'tertiary' | 'font-14' | 'font-14a' | 'font-14b' | 'font-14c' | 'font-14d' | 'font-15' | 'font-18' | 'font-20' | 'font-34' | 'custom';
8
8
  }
9
- declare const Text: ({ className, variant, styleClass, children, onClick, }: Props) => JSX.Element;
10
- export default Text;
9
+ export declare const Text: ({ className, variant, styleClass, children, onClick, }: Props) => JSX.Element;
10
+ export {};
@@ -15,5 +15,5 @@ interface Props {
15
15
  onBlur?: any;
16
16
  className?: string;
17
17
  }
18
- declare const TextAreaField: ({ id, label, placeholder, rows, cols, resizable, register, error, defaultValue, value, onFocus, onBlur, className, }: Props) => JSX.Element;
19
- export default TextAreaField;
18
+ export declare const TextAreaField: ({ id, label, placeholder, rows, cols, resizable, register, error, defaultValue, value, onFocus, onBlur, className, }: Props) => JSX.Element;
19
+ export {};
@@ -9,5 +9,5 @@ declare type Props = {
9
9
  isDisabled?: boolean;
10
10
  onChange?: (value: string) => void;
11
11
  };
12
- declare const TimeGrainField: ({ isShowlabel, timeGrainValue, setTimeGrainValue, register, className, isDisabled, onChange, }: Props) => JSX.Element;
13
- export default TimeGrainField;
12
+ export declare const TimeGrainField: ({ isShowlabel, timeGrainValue, setTimeGrainValue, register, className, isDisabled, onChange, }: Props) => JSX.Element;
13
+ export {};
@@ -8,5 +8,5 @@ declare type SwitchButtonProps = {
8
8
  labelClassName?: string;
9
9
  defaultEnabled?: boolean;
10
10
  };
11
- declare const _default: React.NamedExoticComponent<SwitchButtonProps>;
12
- export default _default;
11
+ export declare const ToggleButton: React.FC<SwitchButtonProps>;
12
+ export {};
@@ -0,0 +1,28 @@
1
+ export * from './Button';
2
+ export * from './ChartModal';
3
+ export * from './DataType';
4
+ export * from './Error';
5
+ export * from './ErrorFallback';
6
+ export * from './ExternalMetricForm';
7
+ export * from './FilterDropDown';
8
+ export * from './FloatingDropDown';
9
+ export * from './FullScreenChart';
10
+ export * from './FilterField';
11
+ export * from './GlobalFilters';
12
+ export * from './InfoTooltip';
13
+ export * from './InputField';
14
+ export * from './MetricChart';
15
+ export * from './MetricCreation';
16
+ export * from './MetricFilters';
17
+ export * from './MetricList';
18
+ export * from './MetricTable';
19
+ export * from './Modal';
20
+ export * from './PopoverMenu';
21
+ export * from './SearchTab';
22
+ export * from './Select';
23
+ export * from './Tab';
24
+ export * from './Table';
25
+ export * from './Text';
26
+ export * from './TextAreaField';
27
+ export * from './TimeGrainField';
28
+ export * from './ToggleButton';
@@ -0,0 +1,39 @@
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 GENERAL = "general";
38
+ export declare const CONFIG = "configuration";
39
+ export declare const DESTINATIONS: Record<string, string>;
@@ -1,39 +1,2 @@
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 GENERAL = "general";
38
- export declare const CONFIG = "configuration";
39
- export declare const DESTINATIONS: Record<string, string>;
1
+ export * from './app';
2
+ export * from './metricOptions';
@@ -0,0 +1,4 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { DashboardProps } from './EmbededDashboard';
3
+ export declare const PluginProvider: React.FC<PropsWithChildren>;
4
+ export declare const Dashboard: React.FC<DashboardProps>;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { ThemeType } from '@/utils';
3
+ export interface DashboardProps {
4
+ token: string;
5
+ options?: {
6
+ headerVariant?: 'static' | 'floating';
7
+ disableMetricCreation?: boolean;
8
+ chartColors?: string[];
9
+ };
10
+ theme?: ThemeType;
11
+ }
12
+ export declare const EmbeddedDashboard: React.FC<DashboardProps>;
@@ -1,12 +1,2 @@
1
- import React from 'react';
2
- import { ThemeType } from '@/utils/theme';
3
- export interface DashboardProps {
4
- token: string;
5
- options?: {
6
- headerVariant?: 'static' | 'floating';
7
- disableMetricCreation?: boolean;
8
- chartColors?: string[];
9
- };
10
- theme?: ThemeType;
11
- }
12
- export declare const Dashboard: React.FC<DashboardProps>;
1
+ export * from './Dashboard';
2
+ export * from './EmbededDashboard';
@@ -0,0 +1,6 @@
1
+ import { RlsCondition } from '@/types/app';
2
+ export declare const getModifiedQuery: ({ rlsConditions, dbName, query, }: {
3
+ rlsConditions: RlsCondition[];
4
+ dbName: string;
5
+ query: string;
6
+ }) => string;
@@ -4,5 +4,5 @@ declare type Params = {
4
4
  col: string;
5
5
  database: string;
6
6
  };
7
- declare const getTimeFilterValue: ({ timeGrainValue, isTimeStamp, col, database, }: Params) => string;
8
- export default getTimeFilterValue;
7
+ export declare const getTimeFilterValue: ({ timeGrainValue, isTimeStamp, col, database, }: Params) => string;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare const groupArray: <T extends Record<string, any>, K extends keyof T>(array: T[], key: K) => Record<T[K], T[]>;
@@ -0,0 +1,4 @@
1
+ export * from './getModifiedQuery';
2
+ export * from './getTimeFilterValue';
3
+ export * from './groupArray';
4
+ export * from './groupBy';
@@ -0,0 +1,5 @@
1
+ export * from './useEmbeddedDashboard';
2
+ export * from './useExternalMetric';
3
+ export * from './useGenerateDatasetMetrics';
4
+ export * from './useGenerateEmbeddedMetric';
5
+ export * from './useOutsideAlerter';
@@ -1,4 +1,4 @@
1
- declare const useEmbeddedDashboard: (token: string) => {
1
+ export declare const useEmbeddedDashboard: (token: string) => {
2
2
  isLoading: boolean;
3
3
  data: {
4
4
  clientId: string | undefined;
@@ -50,4 +50,3 @@ declare const useEmbeddedDashboard: (token: string) => {
50
50
  isAllowedToCreateMetrics: boolean;
51
51
  };
52
52
  };
53
- export default useEmbeddedDashboard;
@@ -1,5 +1,5 @@
1
1
  import { FieldValues } from 'react-hook-form';
2
- import { AxisSettings, CustomSettings, DashboardType, GroupBy, LabelSettings, LegendSettings, RlsFilterObjectType, SelectedColumns, BackgroundSettings } from '@/types';
2
+ import { AxisSettings, CustomSettings, DashboardType, GroupBy, LabelSettings, LegendSettings, RlsFilterObjectType, SelectedColumns, BackgroundSettings } from '@/types/app';
3
3
  declare type Params = {
4
4
  companyIntegrationId: string | undefined;
5
5
  selectedColumns: SelectedColumns[] | undefined;
@@ -32,8 +32,8 @@ declare type Params = {
32
32
  selectedGroupBy: string[];
33
33
  groupBy: GroupBy | undefined;
34
34
  };
35
- declare const useExternalMetric: ({ companyIntegrationId, selectedColumns, query, metricQuery, integrationName, outputColumns, xAxis, yAxisList, chartType, step, measure, sankeyValues, singleValue, margins, legendSettings, labelSettings, axisSettings, customSettings, backGroundColor, clientId, companyId, mode, timeGrain, dashboardIds, isEnableGroupBy, groupBy, selectedGroupBy, }: Params) => {
35
+ export declare const useExternalMetric: ({ companyIntegrationId, selectedColumns, query, metricQuery, integrationName, outputColumns, xAxis, yAxisList, chartType, step, measure, sankeyValues, singleValue, margins, legendSettings, labelSettings, axisSettings, customSettings, backGroundColor, clientId, companyId, mode, timeGrain, dashboardIds, isEnableGroupBy, groupBy, selectedGroupBy, }: Params) => {
36
36
  createExternalMetric: (data: FieldValues) => void;
37
37
  error: string;
38
38
  };
39
- export default useExternalMetric;
39
+ export {};
@@ -1,4 +1,4 @@
1
- declare const useGenerateDatasetMetrics: () => {
1
+ export declare const useGenerateDatasetMetrics: () => {
2
2
  generateDatasetMetric: import("react-query").UseMutateFunction<import("@/utils/generated/graphql").GenerateDatasetMetricsMutation, unknown, import("@/utils/generated/graphql").Exact<{
3
3
  companyId?: import("@/utils/generated/graphql").InputMaybe<string> | undefined;
4
4
  userInputs?: any;
@@ -11,4 +11,3 @@ declare const useGenerateDatasetMetrics: () => {
11
11
  columnName?: import("@/utils/generated/graphql").InputMaybe<string> | undefined;
12
12
  }>, unknown>;
13
13
  };
14
- export default useGenerateDatasetMetrics;
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { FieldValues } from 'react-hook-form';
3
+ declare type Params = {
4
+ clientId: string | null;
5
+ companyId: string | null;
6
+ setError: React.Dispatch<React.SetStateAction<string>>;
7
+ setLoading: React.Dispatch<React.SetStateAction<boolean>>;
8
+ setData: React.Dispatch<React.SetStateAction<any[] | undefined>>;
9
+ setQuery: React.Dispatch<React.SetStateAction<string>>;
10
+ setMetricQuery: React.Dispatch<React.SetStateAction<string | undefined>>;
11
+ };
12
+ export declare const useGenerateEmbeddedMetric: ({ clientId, companyId, setData, setError, setLoading, setQuery, setMetricQuery, }: Params) => {
13
+ generateEmbeddedMetric: (data: FieldValues) => void;
14
+ };
15
+ export {};
@@ -3,5 +3,5 @@ declare type UseOutsideAlerterProps = {
3
3
  onOutsideClick: () => void;
4
4
  wrapRef: React.RefObject<any>;
5
5
  };
6
- declare const useOutsideAlerter: ({ onOutsideClick, wrapRef, }: UseOutsideAlerterProps) => void;
7
- export default useOutsideAlerter;
6
+ export declare const useOutsideAlerter: ({ onOutsideClick, wrapRef, }: UseOutsideAlerterProps) => void;
7
+ export {};
package/dist/index.d.ts CHANGED
@@ -1 +1,7 @@
1
1
  export * from './containers';
2
+ export * as utils from './utils';
3
+ export * as consts from './consts';
4
+ export * as helpers from './helpers';
5
+ export * as hooks from './hooks';
6
+ export * as types from './types';
7
+ export * as Ui from './components';