@databrainhq/plugin 0.13.0-beta.0 → 0.13.0-beta.2

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 (45) hide show
  1. package/dist/components/Accordion/index.d.ts +1 -0
  2. package/dist/components/Alert/index.d.ts +3 -2
  3. package/dist/components/ChartSettingsPopup/components/ChartConfigure/index.d.ts +2 -1
  4. package/dist/components/DraggableItem/index.d.ts +7 -0
  5. package/dist/components/ExternalMetricForm/index.d.ts +1 -0
  6. package/dist/components/FilterDropDown/index.d.ts +8 -4
  7. package/dist/components/GlobalFilters/Filters.d.ts +2 -1
  8. package/dist/components/GlobalFilters/HorizontalFilters.d.ts +2 -1
  9. package/dist/components/GlobalFilters/index.d.ts +3 -1
  10. package/dist/components/Icons/Logos/index.d.ts +2 -0
  11. package/dist/components/InputField/index.d.ts +3 -3
  12. package/dist/components/List/index.d.ts +2 -1
  13. package/dist/components/MetricCreation/components/Dataset/index.d.ts +1 -1
  14. package/dist/components/MetricCreation/components/Header/index.d.ts +1 -1
  15. package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
  16. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +2 -1
  17. package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +1 -2
  18. package/dist/components/MetricCreation/components/Panels/ChartAppearancePanel.d.ts +18 -0
  19. package/dist/components/MetricCreation/components/Panels/FiltersPanel.d.ts +20 -0
  20. package/dist/components/MetricCreation/components/Panels/SortPanel.d.ts +15 -0
  21. package/dist/components/MetricFilterDropDown/index.d.ts +3 -1
  22. package/dist/components/Table/index.d.ts +2 -1
  23. package/dist/consts/api.d.ts +2 -0
  24. package/dist/consts/app.d.ts +1 -0
  25. package/dist/consts/metricOptions.d.ts +67 -5
  26. package/dist/containers/index.d.ts +3 -0
  27. package/dist/helpers/areArraysEqual.d.ts +1 -0
  28. package/dist/helpers/generateTimeRangeWhereClause.d.ts +3 -1
  29. package/dist/helpers/index.d.ts +2 -0
  30. package/dist/hooks/useDatasetMetric.d.ts +50 -0
  31. package/dist/hooks/useDrag.d.ts +9 -0
  32. package/dist/hooks/useDragAndDropState.d.ts +8 -0
  33. package/dist/hooks/useDrop.d.ts +14 -0
  34. package/dist/hooks/useMetricConfig.d.ts +57 -0
  35. package/dist/index.d.ts +7 -0
  36. package/dist/queries/externalDashboard.mutation.d.ts +7 -1
  37. package/dist/queries/metric.mutation.d.ts +1 -1
  38. package/dist/types/app.d.ts +20 -3
  39. package/dist/types/dragAndDropProps.d.ts +42 -0
  40. package/dist/types/index.d.ts +1 -0
  41. package/dist/types/metricCreate.d.ts +213 -2
  42. package/dist/types/queryTypes.d.ts +10 -0
  43. package/dist/webcomponents.es.js +60321 -52728
  44. package/dist/webcomponents.umd.js +207 -211
  45. package/package.json +1 -1
@@ -11,6 +11,7 @@ type AccordionProps = {
11
11
  export declare const Accordion: React.FC<AccordionProps>;
12
12
  type AccordionV2Props = {
13
13
  footer?: React.ReactNode;
14
+ isEnableEditBtn?: boolean;
14
15
  editBtnOnClick?: () => void;
15
16
  } & AccordionProps;
16
17
  export declare const AccordionV2: React.FC<AccordionV2Props>;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  export type AlertProps = {
3
3
  text: string;
4
4
  children?: React.ReactNode;
5
- variant?: 'primary' | 'warning' | 'error' | 'success';
5
+ variant?: 'primary' | 'warning' | 'error' | 'success' | 'info';
6
+ hideInfoIcon?: boolean;
6
7
  };
7
- export declare const Alert: ({ variant, text, children }: AlertProps) => React.JSX.Element;
8
+ export declare const Alert: ({ variant, text, children, hideInfoIcon, }: AlertProps) => React.JSX.Element;
@@ -15,6 +15,7 @@ type Props = {
15
15
  bottomRadius: number;
16
16
  }>>;
17
17
  comparisonLagProps?: ComparisonLagProps;
18
+ isEndUserSetting?: boolean;
18
19
  };
19
- export declare const ChartConfigure: ({ chartSettings, setChartSettings, setBarRadius, comparisonLagProps, }: Props) => React.JSX.Element;
20
+ export declare const ChartConfigure: ({ chartSettings, setChartSettings, setBarRadius, comparisonLagProps, isEndUserSetting, }: Props) => React.JSX.Element;
20
21
  export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { UseDragProps } from '@/types';
3
+ type DraggableItemProps = UseDragProps & {
4
+ renderItem: (DragNodeRef: React.MutableRefObject<any>, isDragging?: boolean) => JSX.Element;
5
+ };
6
+ declare const DraggableItem: React.FC<DraggableItemProps>;
7
+ export default DraggableItem;
@@ -10,6 +10,7 @@ type ExternalMetricProps = {
10
10
  onDashboardChange: (selected: DashboardType['id'][]) => void;
11
11
  options: FloatingDropDownOption[];
12
12
  error?: string;
13
+ isCreatingMetric?: boolean;
13
14
  };
14
15
  export declare const ExternalMetricForm: React.FC<ExternalMetricProps>;
15
16
  export {};
@@ -8,13 +8,17 @@ export type FilterDropDownProps = Omit<FloatingDropDownProps, 'options'> & {
8
8
  workspaceId: string;
9
9
  filterClause?: {
10
10
  columnName?: string;
11
- value?: string;
11
+ value?: string | string[];
12
12
  as?: string;
13
- };
13
+ }[];
14
14
  isDisableLabel?: boolean;
15
+ customTable?: {
16
+ query: string;
17
+ alias: string;
18
+ };
15
19
  };
16
- export declare const FilterDropDown: ({ filter, onChange, selectedOption, autoSelected, workspaceId, filterClause, isDisableLabel, ...rest }: FilterDropDownProps) => React.JSX.Element;
17
- export type MultiFilterDropDownProps = Pick<FilterDropDownProps, 'autoSelected' | 'filter' | 'label' | 'workspaceId' | 'filterClause'> & Omit<MultiSelectDropdownProps, 'options'> & {
20
+ export declare const FilterDropDown: ({ filter, onChange, selectedOption, autoSelected, workspaceId, filterClause, isDisableLabel, customTable, ...rest }: FilterDropDownProps) => React.JSX.Element;
21
+ export type MultiFilterDropDownProps = Pick<FilterDropDownProps, 'autoSelected' | 'filter' | 'label' | 'workspaceId' | 'filterClause' | 'customTable'> & Omit<MultiSelectDropdownProps, 'options'> & {
18
22
  isDisablelabel?: boolean;
19
23
  };
20
24
  export declare const MultiFilterDropdown: React.FC<MultiFilterDropDownProps>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { FilterFieldType } from '@/components';
3
- import { FilterType, FloatingDropDownOption } from '@/types/app';
3
+ import { FilterClausesType, FilterType, FloatingDropDownOption } from '@/types/app';
4
4
  export type FilterColumn = {
5
5
  as: string;
6
6
  dataType: string;
@@ -26,6 +26,7 @@ type FiltersProps = {
26
26
  workspaceId: string;
27
27
  };
28
28
  clientId?: string;
29
+ filterClauses: FilterClausesType;
29
30
  };
30
31
  export declare const Filters: React.FC<FiltersProps>;
31
32
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FilterType } from '@/types/app';
2
+ import { FilterClausesType, FilterType } from '@/types/app';
3
3
  import { FilterFieldType } from '@/components';
4
4
  type HorizontalFiltersProps = {
5
5
  appliedfilters: FilterFieldType[];
@@ -10,6 +10,7 @@ type HorizontalFiltersProps = {
10
10
  workspaceId: string;
11
11
  };
12
12
  clientId?: string;
13
+ filterClauses: FilterClausesType;
13
14
  };
14
15
  export declare const HorizontalFilters: React.FC<HorizontalFiltersProps>;
15
16
  export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { FilterColumn } from './Filters';
3
3
  import { FilterFieldType, MetricCardProps } from '@/components';
4
- import { FilterType } from '@/types/app';
4
+ import { FilterClausesType, FilterType } from '@/types/app';
5
5
  type GlobalFiltersProps = {
6
6
  filters: FilterType[];
7
7
  onApply: (filters: MetricCardProps['globalFilters']) => void;
@@ -11,6 +11,7 @@ type GlobalFiltersProps = {
11
11
  workspaceId: string;
12
12
  };
13
13
  clientId?: string;
14
+ globalFilters?: MetricCardProps['globalFilters'];
14
15
  };
15
16
  export declare const getFormattedFilterValue: (obj: {
16
17
  operator: string;
@@ -32,6 +33,7 @@ type FilterPopupProps = {
32
33
  workspaceId: string;
33
34
  };
34
35
  clientId?: string;
36
+ filterClauses: FilterClausesType;
35
37
  };
36
38
  export declare const FilterPopup: React.FC<FilterPopupProps>;
37
39
  export {};
@@ -9,4 +9,6 @@ export declare const logos: {
9
9
  google: string;
10
10
  elasticsearch: string;
11
11
  redis: string;
12
+ databrick: string;
13
+ clickhouse: string;
12
14
  };
@@ -1,4 +1,4 @@
1
- import { UseFormRegisterReturn } from 'react-hook-form';
1
+ import { FieldError, FieldErrorsImpl, Merge, UseFormRegisterReturn } from 'react-hook-form';
2
2
  import React from 'react';
3
3
  interface Props extends React.HTMLProps<HTMLInputElement> {
4
4
  label?: string;
@@ -6,8 +6,8 @@ interface Props extends React.HTMLProps<HTMLInputElement> {
6
6
  isDisabled?: boolean;
7
7
  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
8
8
  elementRef?: React.Ref<HTMLInputElement>;
9
- supportingText?: any;
10
- error?: any;
9
+ supportingText?: string | undefined;
10
+ error?: string | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
11
11
  leftIcon?: JSX.Element;
12
12
  rightIcon?: JSX.Element;
13
13
  }
@@ -15,5 +15,6 @@ export type ListProps = {
15
15
  className?: string;
16
16
  initialLimit?: number;
17
17
  isDataLoading?: boolean;
18
+ showLogo?: boolean;
18
19
  };
19
- export declare const List: ({ headers, data, variant, noDataText, loadMoreText, className, initialLimit, isDataLoading, }: ListProps) => React.JSX.Element;
20
+ export declare const List: ({ headers, data, variant, noDataText, loadMoreText, className, initialLimit, isDataLoading, showLogo, }: ListProps) => React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { DatasetProps } from '@/types/metricCreate';
3
- export declare const Dataset: ({ setselectTable, selectTable, tableList, columnList, }: DatasetProps) => React.JSX.Element;
3
+ export declare const Dataset: ({ setselectTable, selectTable, tableList, columnList, onChangeTableSelection, }: DatasetProps) => React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { HeaderProps } from '@/types/metricCreate';
3
- export declare const Header: ({ setShowMetricCreateModal, isDisableSaveBtn, Heading, setShowSaveMetricModal, }: HeaderProps) => React.JSX.Element;
3
+ export declare const Header: ({ setShowMetricCreateModal, isDisableSaveBtn, heading, setShowSaveMetricModal, }: HeaderProps) => React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { MetricOutputProps } from '@/types/metricCreate';
3
- export declare const MetricOutput: ({ data, error, isLoading, previewTableDataList, moreTabs, chartColors, chartSettings, setChartSettings, isUpdateMetric, isDisableSqlBtn, setShowSqlModal, isEnablePivotTable, groupbyList, hasNumberKeys, isEnableGauge, }: MetricOutputProps) => React.JSX.Element;
3
+ export declare const MetricOutput: ({ data, error, isLoading, previewTableDataList, moreTabs, chartColors, chartSettings, setChartSettings, isUpdateMetric, isDisableSqlBtn, setShowSqlModal, isEnablePivotTable, groupbyList, hasNumberKeys, isEnableGauge, outputHeaderProps, metrics, dimensions, onGenerateChart, setMetrics, setColumn, isEnableSingleDimension, isEnableSingleMetrics, functionOptions, createdCols, setCreatedCols, createdMetrics, setCreatedMetrics, configuration, }: MetricOutputProps) => React.JSX.Element;
@@ -14,6 +14,7 @@ type Props = {
14
14
  groupbyList: any[];
15
15
  hasNumberKeys: boolean;
16
16
  isEnableGauge: boolean;
17
+ error: string;
17
18
  };
18
- export declare const ChartTab: ({ data, isLoading, headerChild, chartSettings, setChartSettings, chartColors, handleChartRightClick, chartClickConfig, chartPopupChild, isEnablePivotTable, groupbyList, hasNumberKeys, isEnableGauge, }: Props) => React.JSX.Element;
19
+ export declare const ChartTab: ({ data, isLoading, headerChild, chartSettings, setChartSettings, chartColors, handleChartRightClick, chartClickConfig, chartPopupChild, isEnablePivotTable, groupbyList, hasNumberKeys, isEnableGauge, error, }: Props) => React.JSX.Element;
19
20
  export {};
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  type Props = {
3
- previewTableDataList: any[] | undefined;
4
3
  outpuTableData: any[] | undefined;
5
4
  isOutputLoading: boolean;
6
5
  outputError: string;
@@ -8,5 +7,5 @@ type Props = {
8
7
  isDisableSqlBtn: boolean;
9
8
  setShowSqlModal: React.Dispatch<React.SetStateAction<boolean>>;
10
9
  };
11
- export declare const TableTab: ({ outpuTableData, outputError, isOutputLoading, previewTableDataList, isUpdateMetric, isDisableSqlBtn, setShowSqlModal, }: Props) => React.JSX.Element;
10
+ export declare const TableTab: ({ outpuTableData, outputError, isOutputLoading, isUpdateMetric, isDisableSqlBtn, setShowSqlModal, }: Props) => React.JSX.Element;
12
11
  export {};
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { ChartSettingsType } from '@/types';
3
+ import { ComparisonLagProps } from '@/components/ChartSettingsPopup';
4
+ type Props = {
5
+ chartSettings: ChartSettingsType;
6
+ setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
7
+ isOpen: boolean;
8
+ onClose: () => void;
9
+ setBarRadius: React.Dispatch<React.SetStateAction<{
10
+ topRadius: number;
11
+ bottomRadius: number;
12
+ }>>;
13
+ comparisonLagProps?: ComparisonLagProps | undefined;
14
+ };
15
+ declare const ChartAppearancePanel: ({ ChartAppearancePanelProps: { chartSettings, isOpen, onClose, setChartSettings, setBarRadius, comparisonLagProps, }, }: {
16
+ ChartAppearancePanelProps: Props;
17
+ }) => React.JSX.Element;
18
+ export default ChartAppearancePanel;
@@ -0,0 +1,20 @@
1
+ import ReactAce from 'react-ace/lib/ace';
2
+ import React from 'react';
3
+ import { CreateNewFilter, FloatingDropDownOption, GetFilterDropDownType } from '@/types';
4
+ type Props = {
5
+ isOpen: boolean;
6
+ onClose: () => void;
7
+ filters: CreateNewFilter[];
8
+ setCreatedFilters: React.Dispatch<React.SetStateAction<CreateNewFilter[]>>;
9
+ columnOptions: FloatingDropDownOption[];
10
+ getFilterDropDownType: GetFilterDropDownType;
11
+ workspaceId: string;
12
+ editorRef: React.RefObject<ReactAce>;
13
+ onApplyFilter: (onComplete: () => void, isClear?: boolean, index?: number) => void;
14
+ savedFilterListOptions: FloatingDropDownOption[];
15
+ currentSelectedTable: FloatingDropDownOption;
16
+ };
17
+ declare const FiltersPanel: ({ filtersPanelProps: { isOpen, onClose, filters, setCreatedFilters, columnOptions, getFilterDropDownType, editorRef, workspaceId, onApplyFilter, savedFilterListOptions, currentSelectedTable, }, }: {
18
+ filtersPanelProps: Props;
19
+ }) => React.JSX.Element;
20
+ export default FiltersPanel;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { CreateNewSort, FloatingDropDownOption } from '@/types';
3
+ type Props = {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ createdSorts: CreateNewSort[];
7
+ setCreatedSorts: React.Dispatch<React.SetStateAction<CreateNewSort[]>>;
8
+ columnOptions: FloatingDropDownOption[];
9
+ onApplySort: (onComplete: () => void, isClear?: boolean, index?: number) => void;
10
+ selectedTable: FloatingDropDownOption;
11
+ };
12
+ declare const SortPanel: ({ SortPanelProps: { isOpen, onClose, createdSorts, setCreatedSorts, columnOptions, onApplySort, selectedTable, }, }: {
13
+ SortPanelProps: Props;
14
+ }) => React.JSX.Element;
15
+ export default SortPanel;
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
2
  import { FloatingDropDownOption, RlsCondition } from '@/types';
3
+ import { MetricCardProps } from '@/components/MetricList';
3
4
  type Props = {
4
5
  rlsConditions?: RlsCondition;
5
6
  onChangeFilterValue?: (name: string, value: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void;
6
7
  workspaceId: string;
7
8
  clientId?: string;
8
9
  className?: string;
10
+ globalFilters?: MetricCardProps['globalFilters'];
9
11
  };
10
- export declare const MetricFilterDropDown: ({ rlsConditions, onChangeFilterValue, workspaceId, clientId, className, }: Props) => React.JSX.Element;
12
+ export declare const MetricFilterDropDown: ({ rlsConditions, onChangeFilterValue, workspaceId, clientId, className, globalFilters, }: Props) => React.JSX.Element;
11
13
  export default MetricFilterDropDown;
@@ -26,6 +26,7 @@ type Props = {
26
26
  isShowFullScreen?: boolean;
27
27
  filterValues?: Record<string, any>;
28
28
  onMaximize?: () => void;
29
+ headerAlignment?: 'left' | 'center' | 'right';
29
30
  };
30
- export declare const Table: ({ data, isLoading, error, tableSettings, tableName, className, onColumnSizingChange, onChartReady, onChangePage, isExternalChart, isEnableNextBtn, isEnablePrevBtn, paginationInfo, setChartSettings, isInfiniteScroll, onLoadMore, hasMoreData, isShowFullScreen, onMaximize, }: Props) => React.JSX.Element;
31
+ export declare const Table: ({ data, isLoading, error, tableSettings, tableName, className, onColumnSizingChange, onChartReady, onChangePage, isExternalChart, isEnableNextBtn, isEnablePrevBtn, paginationInfo, setChartSettings, isInfiniteScroll, onLoadMore, hasMoreData, isShowFullScreen, onMaximize, headerAlignment, }: Props) => React.JSX.Element;
31
32
  export {};
@@ -21,6 +21,8 @@ export declare const DASHBOARD_UPDATE_ADMIN_METRIC_PATH: string;
21
21
  export declare const DASHBOARD_UPDATE_ADMIN_METRIC_MUTATION = "updateAdminMetric";
22
22
  export declare const DASHBOARD_GENERATE_METRIC_PATH: string;
23
23
  export declare const DASHBOARD_GENERATE_METRIC_MUTATION = "generateMetric";
24
+ export declare const DASHBOARD_DATASET_METRIC_PATH: string;
25
+ export declare const DASHBOARD_DATASET_METRIC_MUTATION = "datasetMetricCreation";
24
26
  export declare const DASHBOARD_PREVIEW_TABLE_PATH: string;
25
27
  export declare const DASHBOARD_PREVIEW_TABLE_MUTATION = "previewTable";
26
28
  export declare const METRIC_QUERY_PATH: string;
@@ -9,6 +9,7 @@ export declare const CHART_TYPES: {
9
9
  scatter: string;
10
10
  row: string;
11
11
  area: string;
12
+ stackedArea: string;
12
13
  combo: string;
13
14
  pie: string;
14
15
  doughnut: string;
@@ -1,8 +1,4 @@
1
- import { ChartSettingsType } from '@/types';
2
- export declare const operatorList: {
3
- value: string;
4
- label: string;
5
- }[];
1
+ import { ChartSettingsType, DatasetMetricCreationConfiguration } from '@/types';
6
2
  export declare const RowLimitList: {
7
3
  value: string;
8
4
  label: string;
@@ -30,3 +26,69 @@ export declare const TIME_GRAIN_OPTIONS: {
30
26
  value: string;
31
27
  label: string;
32
28
  }[];
29
+ export declare const DEFAULT_FORECAST_VALUES: {
30
+ isEnable: boolean;
31
+ forecastPeriods: number;
32
+ modelName: string;
33
+ confidenceInterval: number;
34
+ timeColumnName: string;
35
+ measureColumnName: string;
36
+ timeGrain: string;
37
+ yearlySeasonality: boolean;
38
+ weeklySeasonality: boolean;
39
+ dailySeasonality: boolean;
40
+ orderP: number;
41
+ orderD: number;
42
+ orderQ: number;
43
+ trend: {
44
+ value: string;
45
+ label: string;
46
+ };
47
+ growth: string;
48
+ };
49
+ export declare const DEFAULT_CREATE_DATSET_METRIC_CONFIG: DatasetMetricCreationConfiguration;
50
+ export declare const SORT_TYPE: {
51
+ value: string;
52
+ label: string;
53
+ }[];
54
+ export declare const operatorList: {
55
+ value: string;
56
+ label: string;
57
+ }[];
58
+ export declare const RELATION_OPERATOR_LIST: {
59
+ value: string;
60
+ label: string;
61
+ }[];
62
+ export declare const STRING_OPERATOR_LIST: {
63
+ value: string;
64
+ label: string;
65
+ }[];
66
+ export declare const NUMBER_OPERATOR_LIST: {
67
+ value: string;
68
+ label: string;
69
+ }[];
70
+ export declare const TIME_OPERATOR_LIST: {
71
+ value: string;
72
+ label: string;
73
+ }[];
74
+ export declare const DATASET_TIME_HELPER_FUNCTIONS: {
75
+ value: string;
76
+ label: string;
77
+ }[];
78
+ export declare const DATASET_STRING_HELPER_FUNCTIONS: {
79
+ value: string;
80
+ label: string;
81
+ }[];
82
+ export declare const DATASET_NUMBER_HELPER_FUNCTIONS: {
83
+ value: string;
84
+ label: string;
85
+ }[];
86
+ export declare const aggregateStrings: string[];
87
+ export declare const DATASET_OTHER_HELPER_FUNCTIONS: {
88
+ value: string;
89
+ label: string;
90
+ }[];
91
+ export declare const DATASET_NUM_HELPER_FUNCTIONS: {
92
+ value: string;
93
+ label: string;
94
+ }[];
@@ -0,0 +1,3 @@
1
+ export * from './Dashboard';
2
+ export * from './PluginProvider';
3
+ export * from './Metric';
@@ -0,0 +1 @@
1
+ export declare const areArraysEqual: (arr1: any, arr2: any) => any;
@@ -1,4 +1,5 @@
1
- declare const generateTimeRangeWhereClause: ({ isTimeColumn, timeColumnName, timeCount, timeGrain, timeRangeIndicator, databaseType, endDate, startDate, }: {
1
+ export declare const isValidDate: (date: any) => boolean;
2
+ declare const generateTimeRangeWhereClause: ({ isTimeColumn, timeColumnName, timeCount, timeGrain, timeRangeIndicator, databaseType, endDate, startDate, comparsionOperator, }: {
2
3
  timeColumnName: string;
3
4
  timeRangeIndicator: string;
4
5
  timeCount: number;
@@ -7,5 +8,6 @@ declare const generateTimeRangeWhereClause: ({ isTimeColumn, timeColumnName, tim
7
8
  startDate?: Date | undefined;
8
9
  endDate?: Date | undefined;
9
10
  databaseType?: string | undefined;
11
+ comparsionOperator?: string | undefined;
10
12
  }) => string;
11
13
  export default generateTimeRangeWhereClause;
@@ -5,3 +5,5 @@ export * from './groupBy';
5
5
  export * from './getValidRlsConditionOptions';
6
6
  export * from './timeseries';
7
7
  export * from './checkIsElementInViewport';
8
+ export * from './areArraysEqual';
9
+ export * from './generateTimeRangeWhereClause';
@@ -0,0 +1,50 @@
1
+ /// <reference types="react" />
2
+ import ReactAce from 'react-ace/lib/ace';
3
+ import { CreateNewFilter, CreateNewSort, DatasetConfig, DatasetMetricCreationConfiguration, FloatingDropDownOption, TableType } from '@/types';
4
+ declare const useDatasetMetric: ({ ...config }: DatasetConfig) => {
5
+ configuration: DatasetMetricCreationConfiguration;
6
+ setConfiguration: import("react").Dispatch<import("react").SetStateAction<DatasetMetricCreationConfiguration>>;
7
+ selectedDimensions: FloatingDropDownOption[];
8
+ setSelectedDimensions: import("react").Dispatch<import("react").SetStateAction<FloatingDropDownOption[]>>;
9
+ metrics: FloatingDropDownOption[];
10
+ setMetrics: import("react").Dispatch<import("react").SetStateAction<FloatingDropDownOption[]>>;
11
+ columnList: FloatingDropDownOption[];
12
+ onChangeTableSelection: (table: TableType) => void;
13
+ tableList: {
14
+ value: string;
15
+ label: string;
16
+ }[];
17
+ onGenerateChart: ({ param, metricParams, dimensionParams, createdDimensionParams, createdMetricParams, }: {
18
+ param?: DatasetMetricCreationConfiguration | undefined;
19
+ metricParams?: FloatingDropDownOption[] | undefined;
20
+ dimensionParams?: FloatingDropDownOption[] | undefined;
21
+ createdMetricParams?: FloatingDropDownOption[] | undefined;
22
+ createdDimensionParams?: FloatingDropDownOption[] | undefined;
23
+ }) => void;
24
+ createdSorts: CreateNewSort[];
25
+ setCreatedSorts: import("react").Dispatch<import("react").SetStateAction<CreateNewSort[]>>;
26
+ onApplySort: (onComplete: () => void, isClear?: boolean, index?: number) => void;
27
+ createdFilters: CreateNewFilter[];
28
+ setCreatedFilters: import("react").Dispatch<import("react").SetStateAction<CreateNewFilter[]>>;
29
+ getFilterDropDownType: ({ datatype, operator, }: {
30
+ datatype: string;
31
+ operator: string;
32
+ }) => "TIME_FILTER" | "MULTI_FILTER_DROPDOWN" | "INPUT_NUMBER_FIELD" | "FILTER_DROPDOWN";
33
+ workspaceId: any;
34
+ editorRef: import("react").RefObject<ReactAce>;
35
+ savedFilterListOptions: {
36
+ label: string;
37
+ value: string;
38
+ key: string;
39
+ }[];
40
+ onApplyFilter: (onComplete: () => void, isClear?: boolean, index?: number) => void;
41
+ functionOptions: (col: any) => {
42
+ value: string;
43
+ label: string;
44
+ }[];
45
+ createdCols: FloatingDropDownOption[];
46
+ setCreatedCols: import("react").Dispatch<import("react").SetStateAction<FloatingDropDownOption[]>>;
47
+ createdMetrics: FloatingDropDownOption[];
48
+ setCreatedMetrics: import("react").Dispatch<import("react").SetStateAction<FloatingDropDownOption[]>>;
49
+ };
50
+ export default useDatasetMetric;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { UseDragProps } from '@/types';
3
+ declare const useDrag: ({ identifier, data, modifiers, events, CustomDragPreview, }: UseDragProps) => {
4
+ isDragging: boolean;
5
+ isEnableDrag: boolean;
6
+ setIsEnableDrag: import("react").Dispatch<import("react").SetStateAction<boolean>>;
7
+ DragNodeRef: import("react").MutableRefObject<any>;
8
+ };
9
+ export default useDrag;
@@ -0,0 +1,8 @@
1
+ import { DndStateProp } from '@/types';
2
+ declare const useDragAndDropState: () => {
3
+ dndState: DndStateProp;
4
+ setActive: (active: DndStateProp['active']) => void;
5
+ setOver: (over: DndStateProp['over']) => void;
6
+ setDndState: (update: DndStateProp | ((prev: DndStateProp) => DndStateProp)) => void;
7
+ };
8
+ export default useDragAndDropState;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { UseDropProps } from '@/types';
3
+ declare const useDrop: ({ identifier, events, modifiers }: UseDropProps) => {
4
+ dragStatus: {
5
+ isDragOver: boolean;
6
+ isDragEnter: boolean;
7
+ isDragLeave: boolean;
8
+ isDrop: boolean;
9
+ };
10
+ isEnableDrop: boolean;
11
+ setIsEnableDrop: import("react").Dispatch<import("react").SetStateAction<boolean>>;
12
+ setDropNodeRef: import("react").MutableRefObject<any>;
13
+ };
14
+ export default useDrop;
@@ -0,0 +1,57 @@
1
+ /// <reference types="react" />
2
+ import { ChartSettingsType, ConfigType, FloatingDropDownOption } from '@/types';
3
+ export type CompanyIntegration = {
4
+ id: string;
5
+ name: string;
6
+ } | undefined;
7
+ declare const useMetricConfig: ({ ...config }: ConfigType) => {
8
+ isLoading: boolean;
9
+ chartSettings: ChartSettingsType;
10
+ setShowSaveMetricModal: import("react").Dispatch<import("react").SetStateAction<boolean>>;
11
+ setSelectTable: import("react").Dispatch<import("react").SetStateAction<FloatingDropDownOption>>;
12
+ selectTable: FloatingDropDownOption;
13
+ data: any[] | undefined;
14
+ error: string;
15
+ previewTableData: any[] | undefined;
16
+ query: string;
17
+ isShowSqlModal: boolean;
18
+ setShowSqlModal: import("react").Dispatch<import("react").SetStateAction<boolean>>;
19
+ isEnablePivotTable: boolean;
20
+ isEnableGauge: boolean;
21
+ groupByList: string[];
22
+ hasNumberKeys: boolean;
23
+ setShowChartCustomProperties: import("react").Dispatch<import("react").SetStateAction<boolean>>;
24
+ isShowFullScreen: boolean;
25
+ setShowFullScreen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
26
+ isShowChartType: boolean;
27
+ setShowChartType: import("react").Dispatch<import("react").SetStateAction<boolean>>;
28
+ isShowSaveMetricModal: boolean;
29
+ updateExternalMetric: (data: import("react-hook-form").FieldValues) => void;
30
+ createExternalMetric: (data: import("react-hook-form").FieldValues) => void;
31
+ dashboardOptions: {
32
+ value: any;
33
+ label: any;
34
+ }[];
35
+ saveError: string;
36
+ setChartSettings: import("react").Dispatch<import("react").SetStateAction<ChartSettingsType>>;
37
+ isShowChartCustomProperties: boolean;
38
+ setBarRadius: import("react").Dispatch<import("react").SetStateAction<{
39
+ topRadius: number;
40
+ bottomRadius: number;
41
+ }>>;
42
+ setError: import("react").Dispatch<import("react").SetStateAction<string>>;
43
+ setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
44
+ setData: import("react").Dispatch<import("react").SetStateAction<any[] | undefined>>;
45
+ setQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
46
+ setGroupByList: import("react").Dispatch<import("react").SetStateAction<string[]>>;
47
+ clientSubsetData: any;
48
+ isShowSortPanel: boolean;
49
+ setShowSortPanel: import("react").Dispatch<import("react").SetStateAction<boolean>>;
50
+ isShowFilters: boolean;
51
+ setShowFilters: import("react").Dispatch<import("react").SetStateAction<boolean>>;
52
+ isCreatingMetric: boolean;
53
+ isEnableSingleDimension: boolean;
54
+ isEnableSingleMetrics: boolean;
55
+ enabledCharts: string[];
56
+ };
57
+ export default useMetricConfig;
@@ -0,0 +1,7 @@
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';
@@ -1,4 +1,4 @@
1
- import { UseCreateMetricMutationInputType, UseDeleteDashboardScheduleReportMutationInputType, UseGenerateMetricMutationInputType, UsePreviewTableMutationInputType, UseSaveDashboardLayoutMutationInputType, UseSaveDashboardScheduleReportMutationInputType, UseUpdateAdminMetricMutationInputType, UseUpdateMetricMutationInputType } from '../types/queryTypes';
1
+ import { UseCreateMetricMutationInputType, UseDatatsetMetricMutationInputType, UseDeleteDashboardScheduleReportMutationInputType, UseGenerateMetricMutationInputType, UsePreviewTableMutationInputType, UseSaveDashboardLayoutMutationInputType, UseSaveDashboardScheduleReportMutationInputType, UseUpdateAdminMetricMutationInputType, UseUpdateMetricMutationInputType } from '@/types/queryTypes';
2
2
  export declare const useSaveDashboardLayoutMutation: () => import("react-query").UseMutationResult<{
3
3
  data: unknown;
4
4
  }, unknown, UseSaveDashboardLayoutMutationInputType, unknown>;
@@ -35,6 +35,12 @@ export declare const useGenerateMetricMutation: () => import("react-query").UseM
35
35
  data: UseGenerateMetricMutationInputType;
36
36
  token: string;
37
37
  }, unknown>;
38
+ export declare const useDatasetMetricMutation: () => import("react-query").UseMutationResult<{
39
+ data: unknown;
40
+ }, unknown, {
41
+ data: UseDatatsetMetricMutationInputType;
42
+ token: string;
43
+ }, unknown>;
38
44
  export declare const usePreviewTableMutation: () => import("react-query").UseMutationResult<{
39
45
  data: unknown;
40
46
  }, unknown, {
@@ -1,4 +1,4 @@
1
- import { UseMetricColumnMutationInputType, UseMetricUnderlyingDataMutationInputType, UseMetricShareCsvMutationInputType, UseMarkArchivedMutationInputType } from '../types/queryTypes';
1
+ import { UseMetricColumnMutationInputType, UseMetricUnderlyingDataMutationInputType, UseMetricShareCsvMutationInputType, UseMarkArchivedMutationInputType } from '@/types/queryTypes';
2
2
  export declare const useMetricColumnMutation: () => import("react-query").UseMutationResult<{
3
3
  data: unknown;
4
4
  }, unknown, UseMetricColumnMutationInputType, unknown>;