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

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 (58) 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/Chart/index.d.ts +2 -1
  4. package/dist/components/DraggableItem/index.d.ts +7 -0
  5. package/dist/components/DrillBreadCrumb/index.d.ts +9 -3
  6. package/dist/components/ExternalMetricForm/index.d.ts +1 -5
  7. package/dist/components/FilterDropDown/index.d.ts +8 -4
  8. package/dist/components/GlobalFilters/Filters.d.ts +3 -1
  9. package/dist/components/GlobalFilters/HorizontalFilters.d.ts +2 -1
  10. package/dist/components/GlobalFilters/index.d.ts +3 -1
  11. package/dist/components/Icons/Logos/index.d.ts +2 -0
  12. package/dist/components/InputField/index.d.ts +5 -4
  13. package/dist/components/List/index.d.ts +2 -1
  14. package/dist/components/MetricCreation/components/Dataset/index.d.ts +1 -1
  15. package/dist/components/MetricCreation/components/Header/index.d.ts +1 -1
  16. package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
  17. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +2 -1
  18. package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +1 -2
  19. package/dist/components/MetricCreation/components/Panels/ChartAppearancePanel.d.ts +18 -0
  20. package/dist/components/MetricCreation/components/Panels/FiltersPanel.d.ts +20 -0
  21. package/dist/components/MetricCreation/components/Panels/SortPanel.d.ts +15 -0
  22. package/dist/components/MetricFilterDropDown/index.d.ts +4 -2
  23. package/dist/components/MetricList/components/MetricCards/MetricCard.d.ts +2 -1
  24. package/dist/components/PopoverMenu/index.d.ts +1 -0
  25. package/dist/components/Table/index.d.ts +4 -1
  26. package/dist/components/Tabs/index.d.ts +4 -1
  27. package/dist/components/TextAreaField/index.d.ts +5 -2
  28. package/dist/components/index.d.ts +1 -0
  29. package/dist/consts/api.d.ts +2 -0
  30. package/dist/consts/app.d.ts +2 -0
  31. package/dist/consts/metricOptions.d.ts +67 -5
  32. package/dist/containers/Metric/EmbeddedMetric.d.ts +2 -1
  33. package/dist/containers/Metric/index.d.ts +1 -0
  34. package/dist/containers/index.d.ts +3 -0
  35. package/dist/helpers/areArraysEqual.d.ts +1 -0
  36. package/dist/helpers/generateTimeRangeWhereClause.d.ts +3 -1
  37. package/dist/helpers/index.d.ts +2 -0
  38. package/dist/hooks/index.d.ts +2 -0
  39. package/dist/hooks/useDatasetMetric.d.ts +50 -0
  40. package/dist/hooks/useDrag.d.ts +10 -0
  41. package/dist/hooks/useDragAndDropState.d.ts +10 -0
  42. package/dist/hooks/useDrop.d.ts +13 -0
  43. package/dist/hooks/useMetricCard.d.ts +10 -1
  44. package/dist/hooks/useMetricConfig.d.ts +57 -0
  45. package/dist/index.d.ts +7 -0
  46. package/dist/queries/externalDashboard.mutation.d.ts +7 -1
  47. package/dist/queries/metric.mutation.d.ts +1 -1
  48. package/dist/types/app.d.ts +31 -6
  49. package/dist/types/dragAndDropProps.d.ts +59 -0
  50. package/dist/types/index.d.ts +1 -0
  51. package/dist/types/metricCreate.d.ts +213 -2
  52. package/dist/types/queryTypes.d.ts +10 -0
  53. package/dist/utils/getChartAttributes.d.ts +2 -1
  54. package/dist/webcomponents.es.js +61811 -53334
  55. package/dist/webcomponents.umd.js +211 -211
  56. package/package.json +1 -1
  57. package/dist/components/InternetFailure/index.d.ts +0 -2
  58. package/dist/utils/checkIsOnline.d.ts +0 -2
@@ -0,0 +1,10 @@
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
+ setDraggables: (draggable: DndStateProp['active']) => void;
7
+ setDropables: (droppable: DndStateProp['over']) => void;
8
+ setDndState: (update: DndStateProp | ((prev: DndStateProp) => DndStateProp)) => void;
9
+ };
10
+ export default useDragAndDropState;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { UseDropProps } from '@/types';
3
+ declare const useDrop: ({ identifier, events, modifiers }: UseDropProps) => {
4
+ dragStatus: {
5
+ isDragOver: boolean;
6
+ isDrop: boolean;
7
+ };
8
+ isEnableDrop: boolean;
9
+ setIsEnableDrop: import("react").Dispatch<import("react").SetStateAction<boolean>>;
10
+ setDropNodeRef: import("react").MutableRefObject<any>;
11
+ };
12
+ export default useDrop;
13
+ export { useDrop };
@@ -17,7 +17,10 @@ type UseMetricCardProps = {
17
17
  };
18
18
  export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, clientId, tenancyLevel, isInternalApp, appFilters, setCrossDashboardFilters, crossDashboardFilters, metricFilterOptions, }: UseMetricCardProps) => {
19
19
  onDrillLevelClick: (index: number) => void;
20
- onDrillDown: (params: any) => void;
20
+ onDrillDown: (params: any, rowFilters?: {
21
+ columnName: string;
22
+ value: any;
23
+ }[] | undefined) => void;
21
24
  handleChartClick: (params: any) => void;
22
25
  dataDb: Record<string, any>[];
23
26
  getUnderlyingData: ({ columnName, value, setData, setLoading, isSingleValueChart, }: {
@@ -65,5 +68,11 @@ export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, client
65
68
  metricFilters: RlsCondition[];
66
69
  leftPositionedMetricFilters: RlsCondition[];
67
70
  rightPositionedMetricFilters: RlsCondition[];
71
+ drillFilters: {
72
+ columnName: string;
73
+ value: string | number;
74
+ }[];
75
+ drillType: any;
76
+ tableResultsDownloadData: Record<string, any>[];
68
77
  };
69
78
  export {};
@@ -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>;
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { ColumnSizingState } from '@tanstack/react-table';
3
- import { CHART_TYPES } from '@/consts';
3
+ import { CHART_TYPES, ICONS_LIST } from '@/consts';
4
4
  export type ChildrenProps = {
5
5
  children: ReactNode;
6
6
  };
@@ -63,6 +63,7 @@ export type CustomSettings = {
63
63
  barWidth?: number;
64
64
  barRadius?: number[];
65
65
  xRotation?: number;
66
+ customRotation?: number;
66
67
  hideXAxisLabels?: boolean;
67
68
  hideYAxisLabels?: boolean;
68
69
  fontSize?: number;
@@ -142,10 +143,10 @@ export type CustomSettings = {
142
143
  showStackLabels?: boolean;
143
144
  coloredBars?: boolean;
144
145
  };
145
- export type Colors = 'primary' | 'primary-dark' | 'secondary' | 'secondary-dark' | 'alert' | 'alert-dark' | 'alert-light' | 'success' | 'success-dark' | 'success-light' | 'warning' | 'warning-dark' | 'info' | 'info-light' | 'white' | 'gray' | 'gray-dark' | 'light' | 'dark';
146
- export type IconType = 'undo' | 'redo' | 'maximize' | 'minimize' | 'fullscreen' | 'download' | 'archive' | 'format' | 'company' | 'profile' | 'users' | 'bar-chart' | 'bar-chart-2' | 'kebab-menu-horizontal' | 'kebab-menu-vertical' | 'paint-brush' | 'funnel' | 'funnel-simple' | 'cross' | 'columns' | 'gear' | 'presentation-chart' | 'chevron-down' | 'plus' | 'info' | 'arrow-down' | 'arrow-up' | 'arrow-left' | 'arrow-right' | 'double-arrow-left' | 'double-arrow-right' | 'expand-arrows' | 'eye' | 'eye-slash' | 'database' | 'magnifying-glass' | 'pencil-simple-line' | 'pencil-simple' | 'file-sql' | 'code' | 'sign-out' | 'save' | 'delete' | 'align-space-even' | 'align-bottom' | 'align-left' | 'align-right' | 'align-top' | 'trend-up' | 'trend-up-chart' | 'caret-down-fill' | 'caret-up-fill' | 'caret-up-down' | 'pie-chart' | 'table-view' | 'task-done-file' | 'right-angle' | 'text-rotation-angle-up' | 'text-rotation-none' | 'text-rotation-up' | 'preview-file' | 'share' | 'image' | 'text' | 'color-palette' | 'shuffle' | 'table' | 'chart' | 'calendar' | 'horizontal-rule' | 'short-text' | 'subheader' | 'copy' | 'timer' | 'link' | 'not-found' | 'bar-chart-horizontal' | 'line-chart' | 'line-chart-trend-up' | 'globe' | 'map' | 'leaderboard' | 'radar' | 'scale' | 'scatter-plot' | 'tree' | 'donut-chart' | 'scatter-chart' | 'waterfall-chart' | 'area-chart' | 'bubble-chart' | 'candlestick-chart';
147
- export type LogoType = 'redshift' | 'postgres' | 'mysql' | 'mongodb' | 'bigquery' | 'snowflake' | 'microsoft' | 'google' | 'elasticsearch' | 'redis';
148
- export type IconSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
146
+ export type Colors = 'primary' | 'primary-dark' | 'secondary' | 'secondary-dark' | 'alert' | 'alert-dark' | 'alert-light' | 'success' | 'success-dark' | 'success-light' | 'warning' | 'warning-dark' | 'info' | 'info-light' | 'white' | 'gray' | 'gray-dark' | 'light' | 'dark' | 'infoAlert';
147
+ export type IconType = (typeof ICONS_LIST)[number];
148
+ export type LogoType = 'redshift' | 'postgres' | 'mysql' | 'mongodb' | 'bigquery' | 'snowflake' | 'microsoft' | 'google' | 'elasticsearch' | 'redis' | 'databricks' | 'clickhouse';
149
+ export type IconSizes = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
149
150
  export type IconConfig = {
150
151
  size: IconSizes;
151
152
  color: Colors;
@@ -180,6 +181,7 @@ export type TableSettings = {
180
181
  defaultRowSize?: string;
181
182
  columnSizing?: ColumnSizingState;
182
183
  isServerSidePagination?: boolean;
184
+ isSortAlphabetically?: boolean;
183
185
  conditionalFormatting?: {
184
186
  columnName: string;
185
187
  rules: {
@@ -196,6 +198,7 @@ export type TableSettings = {
196
198
  badgeSeparator?: string;
197
199
  listColumns?: string[];
198
200
  listSeparator?: string;
201
+ stackColAlias?: string;
199
202
  };
200
203
  export type BackgroundSettings = {
201
204
  show?: boolean;
@@ -264,6 +267,7 @@ export type ChartSettingsType = {
264
267
  selectedOption?: FloatingDropDownOption;
265
268
  };
266
269
  comboBarList: string[];
270
+ isGroupXAxis?: boolean;
267
271
  };
268
272
  export type SelectedColumns = {
269
273
  column: string;
@@ -290,6 +294,7 @@ export type Schema = {
290
294
  clientColumnType?: string;
291
295
  isManualOptions?: boolean;
292
296
  manualOptions?: string[];
297
+ dependOn?: FloatingDropDownOption[];
293
298
  }[];
294
299
  };
295
300
  export type RlsFilterObjectType = {
@@ -339,6 +344,9 @@ export type FloatingDropDownOption = {
339
344
  subValue?: string;
340
345
  icon?: string;
341
346
  columnList?: any;
347
+ labelType?: string;
348
+ aggregate?: string;
349
+ alias?: string;
342
350
  };
343
351
  export type FilterType = {
344
352
  tableName: string;
@@ -373,6 +381,7 @@ export type CustomOption = {
373
381
  endDate?: Date;
374
382
  value: string | number;
375
383
  label: string;
384
+ range?: string;
376
385
  };
377
386
  export type RlsCondition = {
378
387
  name: string;
@@ -398,6 +407,17 @@ export type RlsCondition = {
398
407
  optionColumnName?: string;
399
408
  optionTableName?: string;
400
409
  filterType?: string;
410
+ applyOnColumns?: {
411
+ columnName: FloatingDropDownOption;
412
+ logicalOperator: FloatingDropDownOption;
413
+ comparisonOperator: FloatingDropDownOption;
414
+ }[];
415
+ comparisonOperator?: FloatingDropDownOption;
416
+ dependOn?: FloatingDropDownOption;
417
+ selectedCustomOptionTable?: {
418
+ query: string;
419
+ columnName: string;
420
+ };
401
421
  };
402
422
  export type MetricData = {
403
423
  id: string;
@@ -426,7 +446,7 @@ export type ConditionalFormattingParam = {
426
446
  }[];
427
447
  };
428
448
  export type DateTypeOptionType = {
429
- range: 'Last' | 'This' | 'Custom';
449
+ range: 'Last' | 'This' | 'Custom' | 'Custom Date';
430
450
  time?: 'Day' | 'Week' | 'Month' | 'Quarter' | 'Year';
431
451
  name: string;
432
452
  count?: number;
@@ -439,3 +459,8 @@ export type MetricFilterOptionsType = Record<string, {
439
459
  options: string[] | number[] | DateTypeOptionType[];
440
460
  defaultOption?: string | number;
441
461
  }>;
462
+ export type FilterClausesType = (dependOn: FloatingDropDownOption[]) => {
463
+ as: string;
464
+ columnName: string;
465
+ value: string | string[];
466
+ }[];
@@ -0,0 +1,59 @@
1
+ export type UseDragProps = {
2
+ identifier: {
3
+ id: string;
4
+ type?: string;
5
+ };
6
+ data?: any;
7
+ modifiers?: {
8
+ highlightDrop?: {
9
+ onDrag?: boolean;
10
+ onDragOver?: boolean;
11
+ highlightClass?: string;
12
+ };
13
+ };
14
+ events?: {
15
+ onDragStart?: (event: DragEvent, data: DndStateProp) => void;
16
+ onDragEnd?: (event: DragEvent, data: DndStateProp) => void;
17
+ };
18
+ CustomDragPreview?: any;
19
+ };
20
+ export type UseDropProps = {
21
+ identifier: {
22
+ id: string;
23
+ accepts?: string[];
24
+ };
25
+ events?: {
26
+ onDragOver?: (event: DragEvent, data: DndStateProp) => void;
27
+ onDragEnter?: (event: DragEvent, data: DndStateProp) => void;
28
+ onDragLeave?: (event: DragEvent, data: DndStateProp) => void;
29
+ onDrop?: (event: DragEvent, data: DndStateProp) => void;
30
+ };
31
+ modifiers?: {
32
+ sorting?: {
33
+ isEnabled: boolean;
34
+ sortingType: 'vertical' | 'horizontal';
35
+ list?: any[];
36
+ setList?: any;
37
+ };
38
+ };
39
+ };
40
+ export type DndStateProp = {
41
+ active: (UseDragProps & {
42
+ DragNodeRef: any;
43
+ isEnableDrag: boolean;
44
+ isDragging: boolean;
45
+ rect: DOMRect | null;
46
+ }) | null;
47
+ over: (UseDropProps & {
48
+ setDropNodeRef: any;
49
+ isEnableDrop: boolean;
50
+ dragStatus: {
51
+ isDragOver: boolean;
52
+ isDrop: boolean;
53
+ };
54
+ rect: DOMRect | null;
55
+ }) | null;
56
+ DragPreviewCreateRoot?: any;
57
+ draggables?: DndStateProp['active'][];
58
+ droppables?: DndStateProp['over'][];
59
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './app';
2
2
  export * from './metricCreate';
3
+ export * from './dragAndDropProps';
@@ -21,7 +21,7 @@ export type EmbeddedMetricCreationProps = {
21
21
  workspaceId: string;
22
22
  };
23
23
  export type HeaderProps = {
24
- Heading: string;
24
+ heading: string;
25
25
  setShowMetricCreateModal: React.Dispatch<React.SetStateAction<boolean>>;
26
26
  isDisableSaveBtn: boolean;
27
27
  setShowSaveMetricModal: React.Dispatch<React.SetStateAction<boolean>>;
@@ -30,7 +30,18 @@ export type DatasetProps = {
30
30
  setselectTable: React.Dispatch<React.SetStateAction<FloatingDropDownOption>>;
31
31
  selectTable: FloatingDropDownOption;
32
32
  tableList: FloatingDropDownOption[];
33
- columnList: ColumnData[];
33
+ columnList: FloatingDropDownOption[];
34
+ column: FloatingDropDownOption;
35
+ setColumn: React.Dispatch<React.SetStateAction<FloatingDropDownOption[]>>;
36
+ onChangeTableSelection: (table: string) => void;
37
+ metrics: {
38
+ value: string;
39
+ label: string;
40
+ }[];
41
+ setMetrics: React.Dispatch<React.SetStateAction<{
42
+ value: string;
43
+ label: string;
44
+ }[]>>;
34
45
  };
35
46
  export type MetricsValue = {
36
47
  value: string;
@@ -78,11 +89,37 @@ export type MetricOutputProps = {
78
89
  isEnableGauge: boolean;
79
90
  groupbyList: any[];
80
91
  hasNumberKeys: boolean;
92
+ metrics: FloatingDropDownOption[];
93
+ dimensions: FloatingDropDownOption[];
94
+ createdCols: FloatingDropDownOption[];
95
+ configuration: DatasetMetricCreationConfiguration;
96
+ setCreatedCols: React.Dispatch<React.SetStateAction<FloatingDropDownOption[]>>;
97
+ createdMetrics: FloatingDropDownOption[];
98
+ setCreatedMetrics: React.Dispatch<React.SetStateAction<FloatingDropDownOption[]>>;
99
+ functionOptions: (col: any) => {
100
+ value: string;
101
+ label: string;
102
+ }[];
103
+ onGenerateChart: ({ param, metricParams, dimensionParams, createdDimensionParams, createdMetricParams, }: {
104
+ param?: DatasetMetricCreationConfiguration | undefined;
105
+ metricParams?: FloatingDropDownOption[] | undefined;
106
+ dimensionParams?: FloatingDropDownOption[] | undefined;
107
+ createdMetricParams?: FloatingDropDownOption[] | undefined;
108
+ createdDimensionParams?: FloatingDropDownOption[] | undefined;
109
+ }) => void;
81
110
  setQuery?: React.Dispatch<React.SetStateAction<string>>;
82
111
  setData?: React.Dispatch<React.SetStateAction<any[] | undefined>>;
83
112
  setLoading?: React.Dispatch<React.SetStateAction<boolean>>;
84
113
  setError?: React.Dispatch<React.SetStateAction<string>>;
114
+ isEnableSingleDimension?: boolean;
115
+ isEnableSingleMetrics?: boolean;
85
116
  destinationId?: string;
117
+ outputHeaderProps: {
118
+ setShowChartCustomProperties: React.Dispatch<React.SetStateAction<boolean>>;
119
+ setShowChartType: React.Dispatch<React.SetStateAction<boolean>>;
120
+ setShowSortPanel: React.Dispatch<React.SetStateAction<boolean>>;
121
+ setShowFilters: React.Dispatch<React.SetStateAction<boolean>>;
122
+ };
86
123
  dbName?: string;
87
124
  previewTableDataList: any[] | undefined;
88
125
  enableQueryTab?: boolean;
@@ -98,6 +135,11 @@ export type MetricOutputProps = {
98
135
  setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
99
136
  isDisableSqlBtn: boolean;
100
137
  setShowSqlModal: React.Dispatch<React.SetStateAction<boolean>>;
138
+ setMetrics: React.Dispatch<React.SetStateAction<{
139
+ value: string;
140
+ label: string;
141
+ }[]>>;
142
+ setColumn: React.Dispatch<React.SetStateAction<FloatingDropDownOption[]>>;
101
143
  };
102
144
  export type CompanyIntegration = {
103
145
  id: string;
@@ -129,4 +171,173 @@ export type ComparisonLagSettings = {
129
171
  timeGrain: FloatingDropDownOption;
130
172
  periodLag: number;
131
173
  };
174
+ export type CreatedNewColumn = {
175
+ columnName: FloatingDropDownOption;
176
+ function: FloatingDropDownOption;
177
+ alias: string;
178
+ };
179
+ export type SelectedJoin = {
180
+ tableName: FloatingDropDownOption;
181
+ conditions: {
182
+ firstOperand: FloatingDropDownOption;
183
+ secondOperand: FloatingDropDownOption;
184
+ operator: FloatingDropDownOption;
185
+ }[];
186
+ joinType: FloatingDropDownOption;
187
+ };
188
+ export type CreateNewFilter = {
189
+ tableName: FloatingDropDownOption;
190
+ columnName: FloatingDropDownOption;
191
+ operator: FloatingDropDownOption;
192
+ value: {
193
+ stringValue?: string;
194
+ numberValue?: number;
195
+ stringArray?: string[];
196
+ numberArray?: number[];
197
+ timeValue?: {
198
+ startDate: string;
199
+ endDate: string;
200
+ timeFilter: string;
201
+ };
202
+ };
203
+ relationOperator?: FloatingDropDownOption;
204
+ type: 'custom' | 'default' | 'client';
205
+ sql: string;
206
+ name: string;
207
+ isSaved?: boolean;
208
+ };
209
+ export type CreateNewSort = {
210
+ columnName: FloatingDropDownOption;
211
+ method: FloatingDropDownOption;
212
+ tableName: FloatingDropDownOption;
213
+ };
214
+ export type GetFilterDropDownType = ({ datatype, operator, }: {
215
+ datatype: string;
216
+ operator: string;
217
+ }) => 'TIME_FILTER' | 'MULTI_FILTER_DROPDOWN' | 'INPUT_NUMBER_FIELD' | 'FILTER_DROPDOWN';
218
+ export type JoinCondition = {
219
+ firstOperand: {
220
+ parentAlias: string;
221
+ columnName: string;
222
+ };
223
+ secondOperand: {
224
+ parentAlias: string;
225
+ columnName: string;
226
+ };
227
+ operator?: string;
228
+ };
229
+ export type Join = {
230
+ conditions: JoinCondition[];
231
+ name: string;
232
+ alias: string;
233
+ schema: string;
234
+ joinType?: string;
235
+ };
236
+ export type Table = {
237
+ name: string;
238
+ alias: string;
239
+ schema: string;
240
+ id: string;
241
+ joins: Join[];
242
+ };
243
+ export type Aggregate = {
244
+ method: string;
245
+ columnName: string;
246
+ alias: string;
247
+ parentAlias: string;
248
+ type: 'custom' | 'default';
249
+ dataType: string;
250
+ };
251
+ export type Dimension = {
252
+ columnName: string;
253
+ alias: string;
254
+ parentAlias: string;
255
+ timeGrain?: string;
256
+ type: 'custom' | 'default';
257
+ dataType: string;
258
+ helperFunction?: string;
259
+ };
260
+ export type Filter = {
261
+ method: string;
262
+ columnName: string;
263
+ alias: string;
264
+ parentAlias: string;
265
+ value: string | number | string[] | number[] | {
266
+ startDate: string;
267
+ endDate: string;
268
+ timeFilter: string;
269
+ };
270
+ type: 'custom' | 'default' | 'agr' | 'dimension' | 'time' | 'client' | 'rls_filter';
271
+ dataType: string;
272
+ relationOperator?: 'AND' | 'OR';
273
+ };
274
+ export type Order = {
275
+ method: string;
276
+ name: string;
277
+ };
278
+ export type Forcast = {
279
+ isEnable: boolean;
280
+ forecastPeriods: number;
281
+ modelName: string;
282
+ confidenceInterval: number;
283
+ timeColumnName: string;
284
+ measureColumnName: string;
285
+ timeGrain: string;
286
+ yearlySeasonality: boolean;
287
+ weeklySeasonality: boolean;
288
+ dailySeasonality: boolean;
289
+ orderP: number;
290
+ orderD: number;
291
+ orderQ: number;
292
+ trend: {
293
+ value: string;
294
+ label: string;
295
+ };
296
+ growth: string;
297
+ };
298
+ export type GroupByColumn = {
299
+ columnName: string;
300
+ alias: string;
301
+ parentAlias: string;
302
+ timeGrain?: string;
303
+ helperFunction?: string;
304
+ type: 'custom' | 'default';
305
+ dataType: string;
306
+ };
307
+ export type TableType = string;
308
+ export type DatasetMetricCreationConfiguration = {
309
+ table: Table;
310
+ aggregates: Aggregate[];
311
+ dimensions: Dimension[];
312
+ filters: Filter[];
313
+ orders: Order[];
314
+ limit: string;
315
+ isEnableDrill: boolean;
316
+ forecast?: Forcast;
317
+ rlsValues?: Record<string, string | number>;
318
+ groupByColumnList?: GroupByColumn[];
319
+ };
320
+ export type ConfigType = {
321
+ clientId: string;
322
+ companyId: string;
323
+ isLiveMode: boolean;
324
+ externalDashboardId: string;
325
+ userProvidedDashboardId: string;
326
+ chartColors: string[] | undefined;
327
+ isShowMetricCreateModal: boolean;
328
+ setShowMetricCreateModal: React.Dispatch<React.SetStateAction<boolean>>;
329
+ metric: ExternalMetrics | undefined;
330
+ metricData: Record<string, any>[] | undefined;
331
+ };
332
+ export type DatasetConfig = {
333
+ clientSubsetData: any;
334
+ clientId: string;
335
+ setError: React.Dispatch<React.SetStateAction<string>>;
336
+ setLoading: React.Dispatch<React.SetStateAction<boolean>>;
337
+ setData: React.Dispatch<React.SetStateAction<any[] | undefined>>;
338
+ setQuery: React.Dispatch<React.SetStateAction<string>>;
339
+ setGroupByList: React.Dispatch<React.SetStateAction<string[]>>;
340
+ chart: string;
341
+ setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
342
+ };
132
343
  export {};
@@ -1,3 +1,4 @@
1
+ import { DatasetMetricCreationConfiguration } from './metricCreate';
1
2
  export type UseDashboardDataQueryInputType = {
2
3
  token: string;
3
4
  dashboardId?: string;
@@ -60,6 +61,10 @@ export type UseMetricColumnMutationInputType = {
60
61
  columnName?: string;
61
62
  wId?: string;
62
63
  filter?: Record<string, any>;
64
+ customTable?: {
65
+ query: string;
66
+ alias: string;
67
+ };
63
68
  };
64
69
  export type UseMetricUnderlyingDataMutationInputType = {
65
70
  columnName?: string;
@@ -164,6 +169,11 @@ export type UseGenerateMetricMutationInputType = {
164
169
  integrationName?: string;
165
170
  integrationId?: string;
166
171
  };
172
+ export type UseDatatsetMetricMutationInputType = {
173
+ cId: string;
174
+ configuration: DatasetMetricCreationConfiguration;
175
+ id: string;
176
+ };
167
177
  export type UseCreateMetricMutationInputType = {
168
178
  chartOptions?: any;
169
179
  companyId?: string;
@@ -13,8 +13,9 @@ type Params = {
13
13
  isCumulativeBar: boolean;
14
14
  chartType: string;
15
15
  seriesType: string;
16
+ isGroupXAxis: boolean;
16
17
  };
17
- export declare const getChartAttributes: ({ data, measure, singleValue, step, xAxis, yAxisList, seriesField, isTimeSeries, selectedFormat, fillXAxis, isDynamicXaxis, isCumulativeBar, chartType, seriesType, }: Params) => {
18
+ export declare const getChartAttributes: ({ data, measure, singleValue, step, xAxis, yAxisList, seriesField, isTimeSeries, selectedFormat, fillXAxis, isDynamicXaxis, isCumulativeBar, chartType, seriesType, isGroupXAxis, }: Params) => {
18
19
  labels: string[];
19
20
  datasets: any;
20
21
  funnelData: {