@databrainhq/plugin 0.9.19 → 0.9.20

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 (89) hide show
  1. package/README.md +26 -26
  2. package/dist/components/Alert/index.d.ts +1 -1
  3. package/dist/components/Chart/SingleValueChart.d.ts +16 -0
  4. package/dist/components/Chart/index.d.ts +21 -0
  5. package/dist/components/ChartModal/ChartConfig.d.ts +6 -16
  6. package/dist/components/ChartModal/ChartModalOptions.d.ts +7 -5
  7. package/dist/components/ChartPopup/components/UnderlyingData/index.d.ts +1 -1
  8. package/dist/components/ChartPopup/index.d.ts +1 -1
  9. package/dist/components/ChartSettingsPopup/components/ChartConfigure/index.d.ts +8 -0
  10. package/dist/components/ChartSettingsPopup/components/ChartSettings/index.d.ts +9 -0
  11. package/dist/components/ChartSettingsPopup/index.d.ts +9 -0
  12. package/dist/components/Charts/BarChart.d.ts +1 -1
  13. package/dist/components/Charts/LineChart.d.ts +1 -1
  14. package/dist/components/DataType/index.d.ts +1 -1
  15. package/dist/components/DateRangePicker/index.d.ts +1 -1
  16. package/dist/components/Error/index.d.ts +1 -1
  17. package/dist/components/ExternalMetricForm/index.d.ts +1 -1
  18. package/dist/components/FilterDropDown/index.d.ts +2 -2
  19. package/dist/components/FilterField/index.d.ts +2 -2
  20. package/dist/components/FloatingDropDown/index.d.ts +2 -2
  21. package/dist/components/FullScreenChart/index.d.ts +3 -4
  22. package/dist/components/GlobalFilters/AddFilter.d.ts +2 -2
  23. package/dist/components/GlobalFilters/AppliedFilter.d.ts +1 -1
  24. package/dist/components/GlobalFilters/NumberFilterField.d.ts +1 -1
  25. package/dist/components/GlobalFilters/index.d.ts +2 -2
  26. package/dist/components/Icons/index.d.ts +1 -1
  27. package/dist/components/InfoTooltip/index.d.ts +1 -1
  28. package/dist/components/MetricChart/ChartImageDownloadButton.d.ts +4 -4
  29. package/dist/components/MetricChart/CsvDownloadButton.d.ts +1 -1
  30. package/dist/components/MetricChart/MetricChart.d.ts +1 -1
  31. package/dist/components/MetricChart/index.d.ts +1 -0
  32. package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
  33. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +6 -50
  34. package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +1 -1
  35. package/dist/components/MetricCreation/components/MetricOutput/components/index.d.ts +0 -1
  36. package/dist/components/MetricFilterDropDown/index.d.ts +1 -1
  37. package/dist/components/MetricList/MetricList.d.ts +3 -4
  38. package/dist/components/MetricList/components/{DownloadRawCsvModal.d.ts → DownloadRawCsvModal/index.d.ts} +1 -1
  39. package/dist/components/MetricList/components/FullScreenView/DownloadButton.d.ts +9 -0
  40. package/dist/components/MetricList/components/FullScreenView/index.d.ts +18 -0
  41. package/dist/components/MetricList/components/{LayoutAlert.d.ts → LayoutAlert/index.d.ts} +1 -1
  42. package/dist/components/MetricList/components/{MetricCard.d.ts → MetricCards/MetricCard.d.ts} +5 -6
  43. package/dist/components/MetricList/components/MetricCards/NoDataLoading.d.ts +7 -0
  44. package/dist/components/MetricList/components/{SingleValueCard.d.ts → MetricCards/SingleValueCard.d.ts} +1 -1
  45. package/dist/components/MetricList/components/{TableViewModal.d.ts → TableViewModal/index.d.ts} +1 -1
  46. package/dist/components/MetricList/components/index.d.ts +8 -0
  47. package/dist/components/MetricList/index.d.ts +1 -6
  48. package/dist/components/MetricTable/index.d.ts +1 -1
  49. package/dist/components/Modal/ModalFooter.d.ts +1 -1
  50. package/dist/components/PopoverMenu/index.d.ts +1 -1
  51. package/dist/components/ScheduleEmail/ScheduleEmailForm/index.d.ts +1 -1
  52. package/dist/components/Select/index.d.ts +5 -5
  53. package/dist/components/Tab/index.d.ts +1 -1
  54. package/dist/components/Table/DebouncedInput.d.ts +1 -1
  55. package/dist/components/Table/index.d.ts +4 -2
  56. package/dist/components/TagInputField/index.d.ts +1 -1
  57. package/dist/components/TimeGrainField/index.d.ts +1 -1
  58. package/dist/components/ToggleButton/SwitchInput.d.ts +1 -1
  59. package/dist/components/ToggleButton/ToggleInput.d.ts +1 -1
  60. package/dist/components/ToggleButton/index.d.ts +1 -1
  61. package/dist/components/index.d.ts +2 -0
  62. package/dist/consts/metricOptions.d.ts +4 -0
  63. package/dist/containers/Dashboard/Dashboard.d.ts +1 -1
  64. package/dist/containers/Dashboard/DashboardProvider.d.ts +1 -1
  65. package/dist/helpers/getTimeFilterValue.d.ts +1 -1
  66. package/dist/helpers/timeseries.d.ts +6 -6
  67. package/dist/hooks/index.d.ts +1 -0
  68. package/dist/hooks/useClientDashboardLayout.d.ts +1 -1
  69. package/dist/hooks/useExternalMetric.d.ts +3 -20
  70. package/dist/hooks/useGenerateEmbeddedMetric.d.ts +1 -1
  71. package/dist/hooks/useMetricCard.d.ts +37 -0
  72. package/dist/hooks/useOutsideAlerter.d.ts +1 -1
  73. package/dist/hooks/useScheduleEmail.d.ts +1 -1
  74. package/dist/index.es.js +86942 -128170
  75. package/dist/index.umd.js +298 -242
  76. package/dist/style.css +1 -1
  77. package/dist/types/app.d.ts +119 -61
  78. package/dist/types/metricCreate.d.ts +13 -87
  79. package/dist/utils/generated/graphql.d.ts +437 -437
  80. package/dist/utils/getChartAttributes.d.ts +5 -8
  81. package/dist/utils/getChartImage.d.ts +3 -0
  82. package/dist/utils/getChartOptions.d.ts +7 -0
  83. package/package.json +110 -98
  84. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartConfigure/index.d.ts +0 -26
  85. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartSettings/index.d.ts +0 -38
  86. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/index.d.ts +0 -2
  87. package/dist/typings.d.ts +0 -17
  88. package/dist/utils/handleSaveChartImage.d.ts +0 -3
  89. /package/dist/components/MetricList/components/{ArchiveMetricModal.d.ts → ArchiveMetricModal/index.d.ts} +0 -0
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { MetricCardProps } from '@/components/MetricList/components/MetricCard';
2
+ import { MetricCardProps } from '@/components/MetricList/components/MetricCards/MetricCard';
3
3
  export declare const SingleValueCard: React.FC<Omit<MetricCardProps, 'onMaximize'>>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare type Props = {
2
+ type Props = {
3
3
  metricData?: Record<string, any>[];
4
4
  isOpen: boolean;
5
5
  onClose: () => void;
@@ -0,0 +1,8 @@
1
+ export * from './ArchiveMetricModal';
2
+ export * from './DownloadRawCsvModal';
3
+ export * from './LayoutAlert';
4
+ export * from './TableViewModal';
5
+ export * from './MetricCards/MetricCard';
6
+ export * from './MetricCards/SingleValueCard';
7
+ export * from './MetricCards/NoDataLoading';
8
+ export * from './FullScreenView';
@@ -1,7 +1,2 @@
1
1
  export * from './MetricList';
2
- export * from './components/MetricCard';
3
- export * from './components/SingleValueCard';
4
- export * from './components/ArchiveMetricModal';
5
- export * from './components/LayoutAlert';
6
- export * from './components/TableViewModal';
7
- export * from './components/DownloadRawCsvModal';
2
+ export * from './components';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare type Props = {
2
+ type Props = {
3
3
  data: any;
4
4
  isError: boolean;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare type ModalFooterProps = React.PropsWithChildren & {
2
+ export type ModalFooterProps = React.PropsWithChildren & {
3
3
  className?: string;
4
4
  };
5
5
  export declare const ModalFooter: React.FC<ModalFooterProps>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare type PopoverMenuProps = React.PropsWithChildren & {
2
+ export type PopoverMenuProps = React.PropsWithChildren & {
3
3
  className?: string;
4
4
  menuClass?: string;
5
5
  buttonClass?: string;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare type Props = {
2
+ type Props = {
3
3
  onCancel: () => void;
4
4
  };
5
5
  declare const ScheduleEmailForm: ({ onCancel }: Props) => JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { FieldValues } from 'react-hook-form';
3
3
  import type { Control } from 'react-hook-form';
4
- declare type Option = {
4
+ type Option = {
5
5
  value: string;
6
6
  label: string;
7
7
  };
8
- declare type SelectInput = {
8
+ type SelectInput = {
9
9
  name?: string;
10
10
  label?: string;
11
11
  value: any;
@@ -21,7 +21,7 @@ declare type SelectInput = {
21
21
  textSize?: string;
22
22
  labelVariant?: 'floating' | 'static';
23
23
  };
24
- declare type HookSelectInput = Omit<SelectInput, 'value'> & {
24
+ type HookSelectInput = Omit<SelectInput, 'value'> & {
25
25
  control: Control;
26
26
  name: string;
27
27
  };
@@ -29,7 +29,7 @@ export declare const Select: ({ name, label, options, onChange, value, defaultVa
29
29
  export declare const HookSelect: ({ control, name, ...rest }: HookSelectInput) => JSX.Element;
30
30
  export declare const SelectWithSubValue: ({ label, options, onChange, value, defaultValue, }: any) => JSX.Element;
31
31
  export declare const DropDown: ({ control, name, options, label, defaultValue, }: HookSelectInput) => JSX.Element;
32
- declare type MultiSelectProps = {
32
+ type MultiSelectProps = {
33
33
  options: Option[];
34
34
  defaultValue?: Option['value'][];
35
35
  value?: Option['value'][];
@@ -46,7 +46,7 @@ declare type MultiSelectProps = {
46
46
  icon?: JSX.Element;
47
47
  };
48
48
  export declare const MultiSelect: React.FC<MultiSelectProps>;
49
- declare type HookMultiSelectProps = MultiSelectProps & {
49
+ type HookMultiSelectProps = MultiSelectProps & {
50
50
  control: Control<FieldValues>;
51
51
  name: string;
52
52
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type TabProps = {
2
+ type TabProps = {
3
3
  options: string[];
4
4
  activeTab: string;
5
5
  setActiveTab: React.Dispatch<React.SetStateAction<string>>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare const DebouncedInput: ({ value, onChange, debounce, ...props }: {
2
+ export declare const DebouncedInput: ({ value: initialValue, onChange, debounce, ...props }: {
3
3
  value: string | number;
4
4
  onChange: (value: string | number) => void;
5
5
  debounce?: number | undefined;
@@ -1,12 +1,14 @@
1
1
  /// <reference types="react" />
2
+ import { OnChangeFn, ColumnSizingState } from '@tanstack/react-table';
2
3
  import { TableSettings } from '@/types';
3
- declare type Props = {
4
+ type Props = {
4
5
  data?: any[];
5
6
  isLoading: boolean;
6
7
  error: string;
7
8
  tableSettings?: TableSettings;
8
9
  tableName?: string;
9
10
  className?: string;
11
+ onColumnSizingChange?: OnChangeFn<ColumnSizingState>;
10
12
  };
11
- export declare const Table: ({ data, isLoading, error, tableSettings, tableName, className, }: Props) => JSX.Element;
13
+ export declare const Table: ({ data, isLoading, error, tableSettings, tableName, className, onColumnSizingChange, }: Props) => JSX.Element;
12
14
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { FieldValues, Control } from 'react-hook-form';
3
- declare type Props = {
3
+ type Props = {
4
4
  control: Control<FieldValues, object>;
5
5
  placeholder?: string;
6
6
  name?: string;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { FieldValues, UseFormRegister } from 'react-hook-form';
3
- declare type Props = {
3
+ type Props = {
4
4
  isShowlabel?: boolean;
5
5
  timeGrainValue: string;
6
6
  setTimeGrainValue: React.Dispatch<React.SetStateAction<string>>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type SwitchProps = {
2
+ type SwitchProps = {
3
3
  name?: string;
4
4
  styles: Record<string, string>;
5
5
  placeholder?: string | [string, string];
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type ToggleProps = {
2
+ type ToggleProps = {
3
3
  name?: string;
4
4
  styles: Record<string, string>;
5
5
  placeholder?: string | [string, string];
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type SwitchButtonProps = {
2
+ type SwitchButtonProps = {
3
3
  onChange?: (enabled: boolean) => void;
4
4
  enabled?: boolean;
5
5
  variant?: 'switch' | 'toggle';
@@ -31,3 +31,5 @@ export * from './DrillBreadCrumb';
31
31
  export * from './MetricFilterDropDown';
32
32
  export * from './Alert';
33
33
  export * from './GlobalFilters/AppliedFilter';
34
+ export * from './Chart';
35
+ export * from './ChartSettingsPopup';
@@ -10,6 +10,10 @@ export declare const AggregateList: {
10
10
  value: string;
11
11
  label: string;
12
12
  }[];
13
+ export declare const TableRowsList: {
14
+ label: string;
15
+ value: string;
16
+ }[];
13
17
  export declare const NUMBER_TYPES: string[];
14
18
  export declare const STRING_TYPES: string[];
15
19
  export declare const DATE_TYPES: string[];
@@ -12,7 +12,7 @@ export interface DashboardProps {
12
12
  };
13
13
  theme?: ThemeType;
14
14
  }
15
- declare type PluginProviderProps = PropsWithChildren & Omit<DashboardProps, 'token'>;
15
+ type PluginProviderProps = PropsWithChildren & Omit<DashboardProps, 'token'>;
16
16
  export declare const PluginProvider: ({ children, theme }: PluginProviderProps) => JSX.Element;
17
17
  export declare const Dashboard: React.MemoExoticComponent<({ token, options, theme }: DashboardProps) => JSX.Element>;
18
18
  export {};
@@ -1,5 +1,5 @@
1
1
  import { PropsWithChildren } from 'react';
2
- declare type DashboardProviderProps = PropsWithChildren & {
2
+ type DashboardProviderProps = PropsWithChildren & {
3
3
  token: string;
4
4
  };
5
5
  declare const DashboardProvider: ({ token, children }: DashboardProviderProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- declare type Params = {
1
+ type Params = {
2
2
  timeGrainValue: string;
3
3
  isTimeStamp: boolean;
4
4
  col: string;
@@ -20,7 +20,7 @@ export declare const getTimeSeriesData: ({ dataArray, timeStampKey, type, valuek
20
20
  color: string;
21
21
  } | undefined;
22
22
  itemStyle?: {
23
- borderRadius: number;
23
+ borderRadius: number | undefined;
24
24
  } | undefined;
25
25
  areaStyle: {
26
26
  opacity?: undefined;
@@ -29,8 +29,8 @@ export declare const getTimeSeriesData: ({ dataArray, timeStampKey, type, valuek
29
29
  type: "line" | "bar";
30
30
  name: string;
31
31
  label: {
32
- show: boolean;
33
- position: string;
32
+ show: boolean | undefined;
33
+ position: string | undefined;
34
34
  };
35
35
  emphasis: {
36
36
  focus: string;
@@ -42,7 +42,7 @@ export declare const getTimeSeriesData: ({ dataArray, timeStampKey, type, valuek
42
42
  color: string;
43
43
  } | undefined;
44
44
  itemStyle?: {
45
- borderRadius: number;
45
+ borderRadius: number | undefined;
46
46
  } | undefined;
47
47
  areaStyle: {
48
48
  opacity: number;
@@ -51,8 +51,8 @@ export declare const getTimeSeriesData: ({ dataArray, timeStampKey, type, valuek
51
51
  type: "line" | "bar";
52
52
  name: string;
53
53
  label: {
54
- show: boolean;
55
- position: string;
54
+ show: boolean | undefined;
55
+ position: string | undefined;
56
56
  };
57
57
  emphasis: {
58
58
  focus: string;
@@ -6,3 +6,4 @@ export * from './useOutsideAlerter';
6
6
  export * from './useApplyAdminTheme';
7
7
  export * from './useClientDashboardLayout';
8
8
  export * from './useUnderlyingData';
9
+ export * from './useMetricCard';
@@ -1,5 +1,5 @@
1
1
  import { Layout } from 'react-grid-layout';
2
- export declare type UseClientDashboardLayoutProps = {
2
+ export type UseClientDashboardLayoutProps = {
3
3
  externalDashboardId: string;
4
4
  clientId: string;
5
5
  };
@@ -1,8 +1,7 @@
1
1
  import { FieldValues } from 'react-hook-form';
2
2
  import { ExternalMetrics } from '@/utils/generated/graphql';
3
- import { AxisSettings, CustomSettings, TableSettings, DashboardType, GroupBy, LabelSettings, LegendSettings, RlsFilterObjectType, SelectedColumns, BackgroundSettings } from '@/types/app';
4
- import { TimeSeriesSettingsType } from '@/types';
5
- declare type Params = {
3
+ import { DashboardType, GroupBy, RlsFilterObjectType, SelectedColumns, ChartSettingsType } from '@/types/app';
4
+ type Params = {
6
5
  onSuccess: () => void;
7
6
  companyIntegrationId: string | undefined;
8
7
  selectedColumns: SelectedColumns[] | undefined;
@@ -10,23 +9,7 @@ declare type Params = {
10
9
  metricQuery: string | undefined;
11
10
  outputColumns: string | undefined;
12
11
  id?: string;
13
- chartSettings: {
14
- xAxis: string | undefined;
15
- yAxisList: string[] | undefined;
16
- chartType: string;
17
- step: string | undefined;
18
- measure: string | undefined;
19
- sankeyValues: string[] | undefined;
20
- singleValue: string | undefined;
21
- margins: Record<string, number>;
22
- legendSettings: LegendSettings;
23
- labelSettings: LabelSettings;
24
- axisSettings: AxisSettings;
25
- customSettings?: CustomSettings;
26
- tableSettings?: TableSettings;
27
- backGroundColor?: BackgroundSettings;
28
- timeSeriesSettings?: TimeSeriesSettingsType;
29
- };
12
+ chartSettings: ChartSettingsType;
30
13
  integrationName: string | undefined;
31
14
  clientId?: string | null;
32
15
  isEmbedded?: boolean;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FieldValues } from 'react-hook-form';
3
- declare type Params = {
3
+ type Params = {
4
4
  clientId: string | null;
5
5
  companyId: string | null;
6
6
  setError: React.Dispatch<React.SetStateAction<string>>;
@@ -0,0 +1,37 @@
1
+ /// <reference types="react" />
2
+ import { ChartSettingsType, FloatingDropDownOption, RlsCondition } from '@/types';
3
+ import { ExternalMetrics } from '@/utils/generated/graphql';
4
+ import { MetricCardProps } from '@/components';
5
+ type UseMetricCardProps = {
6
+ metric: ExternalMetrics;
7
+ chartSettings: ChartSettingsType;
8
+ setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
9
+ clientId: string;
10
+ tenancyLevel: string;
11
+ globalFilters?: MetricCardProps['globalFilters'];
12
+ rlsFilters?: {
13
+ param: any;
14
+ filterValues: Record<string, any>;
15
+ };
16
+ };
17
+ export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, clientId, chartSettings, setChartSettings, tenancyLevel, }: UseMetricCardProps) => {
18
+ onDrillDown: () => void;
19
+ handleChartClick: (params: any) => void;
20
+ dataDb: Record<string, any>[];
21
+ getUnderlyingData: ({ columnName, value, setData, setLoading, }: {
22
+ columnName: string;
23
+ value: any;
24
+ setData: import("react").Dispatch<import("react").SetStateAction<any[]>>;
25
+ setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
26
+ }) => void;
27
+ onChangeFilterValue: (name: string, value: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void;
28
+ isShowChartPopup: boolean;
29
+ setShowChartPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
30
+ columnName: string | undefined;
31
+ chartParams: any;
32
+ isQueryLoading: boolean;
33
+ groupedData: Record<string, any>[];
34
+ drilledLevel: number;
35
+ rlsConditions: RlsCondition[];
36
+ };
37
+ export {};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare type UseOutsideAlerterProps = {
2
+ type UseOutsideAlerterProps = {
3
3
  onOutsideClick: () => void;
4
4
  wrapRef: React.RefObject<any>;
5
5
  };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FieldValues } from 'react-hook-form';
3
- declare type Params = {
3
+ type Params = {
4
4
  onCancel: () => void;
5
5
  };
6
6
  declare const useScheduleEmail: ({ onCancel }: Params) => {