@databrainhq/plugin 0.9.21 → 0.9.23

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 (91) 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/ChartSettingsPopup.d.ts +9 -0
  10. package/dist/components/ChartSettingsPopup/components/ChartConfigure/index.d.ts +8 -0
  11. package/dist/components/ChartSettingsPopup/components/ChartSettings/index.d.ts +9 -0
  12. package/dist/components/ChartSettingsPopup/index.d.ts +3 -0
  13. package/dist/components/Charts/BarChart.d.ts +1 -1
  14. package/dist/components/Charts/LineChart.d.ts +1 -1
  15. package/dist/components/DataType/index.d.ts +1 -1
  16. package/dist/components/DateRangePicker/index.d.ts +1 -1
  17. package/dist/components/Error/index.d.ts +1 -1
  18. package/dist/components/ExternalMetricForm/index.d.ts +1 -1
  19. package/dist/components/FilterDropDown/index.d.ts +2 -2
  20. package/dist/components/FilterField/index.d.ts +2 -2
  21. package/dist/components/FloatingDropDown/index.d.ts +2 -2
  22. package/dist/components/FullScreenChart/index.d.ts +3 -4
  23. package/dist/components/GlobalFilters/AddFilter.d.ts +2 -2
  24. package/dist/components/GlobalFilters/AppliedFilter.d.ts +1 -1
  25. package/dist/components/GlobalFilters/NumberFilterField.d.ts +1 -1
  26. package/dist/components/GlobalFilters/index.d.ts +2 -2
  27. package/dist/components/Icons/index.d.ts +1 -1
  28. package/dist/components/InfoTooltip/index.d.ts +1 -1
  29. package/dist/components/MetricChart/ChartImageDownloadButton.d.ts +4 -4
  30. package/dist/components/MetricChart/CsvDownloadButton.d.ts +1 -1
  31. package/dist/components/MetricChart/MetricChart.d.ts +1 -1
  32. package/dist/components/MetricChart/index.d.ts +1 -0
  33. package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
  34. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +6 -50
  35. package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +1 -1
  36. package/dist/components/MetricCreation/components/MetricOutput/components/index.d.ts +0 -1
  37. package/dist/components/MetricFilterDropDown/index.d.ts +1 -1
  38. package/dist/components/MetricList/MetricList.d.ts +3 -4
  39. package/dist/components/MetricList/components/{DownloadRawCsvModal.d.ts → DownloadRawCsvModal/index.d.ts} +1 -1
  40. package/dist/components/MetricList/components/FullScreenView/DownloadButton.d.ts +9 -0
  41. package/dist/components/MetricList/components/FullScreenView/index.d.ts +18 -0
  42. package/dist/components/MetricList/components/{LayoutAlert.d.ts → LayoutAlert/index.d.ts} +1 -1
  43. package/dist/components/MetricList/components/{MetricCard.d.ts → MetricCards/MetricCard.d.ts} +5 -6
  44. package/dist/components/MetricList/components/MetricCards/NoDataLoading.d.ts +7 -0
  45. package/dist/components/MetricList/components/{SingleValueCard.d.ts → MetricCards/SingleValueCard.d.ts} +1 -1
  46. package/dist/components/MetricList/components/{TableViewModal.d.ts → TableViewModal/index.d.ts} +1 -1
  47. package/dist/components/MetricList/components/index.d.ts +8 -0
  48. package/dist/components/MetricList/index.d.ts +1 -6
  49. package/dist/components/MetricTable/index.d.ts +1 -1
  50. package/dist/components/Modal/ModalFooter.d.ts +1 -1
  51. package/dist/components/PopoverMenu/index.d.ts +1 -1
  52. package/dist/components/Portal/index.d.ts +2 -0
  53. package/dist/components/ScheduleEmail/ScheduleEmailForm/index.d.ts +1 -1
  54. package/dist/components/Select/index.d.ts +5 -5
  55. package/dist/components/Tab/index.d.ts +1 -1
  56. package/dist/components/Table/DebouncedInput.d.ts +1 -1
  57. package/dist/components/Table/index.d.ts +4 -2
  58. package/dist/components/TagInputField/index.d.ts +1 -1
  59. package/dist/components/TimeGrainField/index.d.ts +1 -1
  60. package/dist/components/ToggleButton/SwitchInput.d.ts +1 -1
  61. package/dist/components/ToggleButton/ToggleInput.d.ts +1 -1
  62. package/dist/components/ToggleButton/index.d.ts +1 -1
  63. package/dist/components/index.d.ts +3 -0
  64. package/dist/consts/metricOptions.d.ts +4 -0
  65. package/dist/containers/Dashboard/Dashboard.d.ts +1 -1
  66. package/dist/containers/Dashboard/DashboardProvider.d.ts +1 -1
  67. package/dist/helpers/getTimeFilterValue.d.ts +1 -1
  68. package/dist/helpers/timeseries.d.ts +6 -6
  69. package/dist/hooks/index.d.ts +1 -0
  70. package/dist/hooks/useClientDashboardLayout.d.ts +1 -1
  71. package/dist/hooks/useExternalMetric.d.ts +3 -20
  72. package/dist/hooks/useGenerateEmbeddedMetric.d.ts +1 -1
  73. package/dist/hooks/useMetricCard.d.ts +37 -0
  74. package/dist/hooks/useOutsideAlerter.d.ts +1 -1
  75. package/dist/hooks/useScheduleEmail.d.ts +1 -1
  76. package/dist/index.es.js +86009 -127226
  77. package/dist/index.umd.js +298 -242
  78. package/dist/style.css +1 -1
  79. package/dist/types/app.d.ts +119 -61
  80. package/dist/types/metricCreate.d.ts +13 -87
  81. package/dist/utils/generated/graphql.d.ts +437 -437
  82. package/dist/utils/getChartAttributes.d.ts +5 -8
  83. package/dist/utils/getChartImage.d.ts +3 -0
  84. package/dist/utils/getChartOptions.d.ts +7 -0
  85. package/package.json +110 -98
  86. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartConfigure/index.d.ts +0 -26
  87. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartSettings/index.d.ts +0 -38
  88. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/index.d.ts +0 -2
  89. package/dist/typings.d.ts +0 -17
  90. package/dist/utils/handleSaveChartImage.d.ts +0 -3
  91. /package/dist/components/MetricList/components/{ArchiveMetricModal.d.ts → ArchiveMetricModal/index.d.ts} +0 -0
@@ -1,65 +1,123 @@
1
1
  import type { ReactNode } from 'react';
2
- export declare type ChildrenProps = {
2
+ import { ColumnSizingState } from '@tanstack/react-table';
3
+ import { CHART_TYPES } from '@/consts';
4
+ export type ChildrenProps = {
3
5
  children: ReactNode;
4
6
  };
5
- export declare type LegendSettings = {
6
- show: boolean;
7
- top: number;
8
- bottom: number;
9
- left: number;
10
- right: number;
11
- position: string;
12
- };
13
- export declare type CustomSettings = {
14
- hideSplitLines: string;
15
- hideAxisLines: string;
16
- barWidth: number;
17
- barRadius: number;
18
- xRotation: number;
19
- axisLabels: string;
20
- fontSize: number;
21
- subHeaderShow: boolean;
22
- displayText: string;
23
- subHeaderFontSize: number;
24
- dateFormatter: string;
25
- numberFormatter: string;
26
- showLabelValues: boolean;
7
+ export type TimeSeriesGroupType = 'yearly' | 'monthly' | 'weekly' | 'daily';
8
+ export type TimeSeriesType = 'bar' | 'line' | 'area';
9
+ export type TimeSeriesSettingsType = {
10
+ seriesType: {
11
+ type: TimeSeriesType;
12
+ column: string;
13
+ }[];
14
+ groupBySettings: {
15
+ isDynamic: boolean;
16
+ options: string[];
17
+ value: TimeSeriesGroupType;
18
+ };
19
+ };
20
+ export type TimeSeriesSettingsProps = {
21
+ settings: TimeSeriesSettingsType;
22
+ onChange: (timeSeriesSettings: TimeSeriesSettingsType | ((ts: TimeSeriesSettingsType) => TimeSeriesSettingsType)) => void;
23
+ yAxisList: string[];
24
+ };
25
+ export type TimeSeriesChartProps = {
26
+ dataArray: Record<string, any>[];
27
+ timeStampKey: string;
28
+ valuekeys: string[];
29
+ type: TimeSeriesType;
30
+ groupBy: TimeSeriesGroupType;
31
+ margins: Record<string, number>;
32
+ legendSettings: LegendSettings;
33
+ labelSettings: LabelSettings;
34
+ axisSettings: AxisSettings;
35
+ colors?: string[];
36
+ customSettings: CustomSettings;
37
+ backGroundColor: BackgroundSettings;
38
+ };
39
+ export type LegendSettings = {
40
+ show?: boolean;
41
+ top?: number;
42
+ bottom?: number;
43
+ left?: number;
44
+ right?: number;
45
+ position?: string;
46
+ };
47
+ export type MarginSettings = {
48
+ marginTop?: number;
49
+ marginBottom?: number;
50
+ marginLeft?: number;
51
+ marginRight?: number;
52
+ };
53
+ export type CustomSettings = {
54
+ hideSplitLines?: string;
55
+ hideAxisLines?: string;
56
+ barWidth?: number;
57
+ barRadius?: number;
58
+ xRotation?: number;
59
+ axisLabels?: string;
60
+ fontSize?: number;
61
+ subHeaderShow?: boolean;
62
+ displayText?: string;
63
+ subHeaderFontSize?: number;
64
+ dateFormatter?: string;
65
+ numberFormatter?: string;
66
+ showLabelValues?: boolean;
27
67
  showFullStacked?: boolean;
28
68
  showConversionRate?: boolean;
29
69
  labelFormat?: string;
30
70
  };
31
- export declare type TableSettings = {
32
- contentAlignment: string;
33
- lineGap: string;
34
- hideVerticalDivider: boolean;
35
- enableStripedRows: boolean;
36
- showRowHover: boolean;
37
- showTableTitle: boolean;
38
- showTableDesc: boolean;
39
- enableTableSearch: boolean;
40
- enableFilter: boolean;
41
- enableSorting: boolean;
71
+ export type TableSettings = {
72
+ contentAlignment?: string;
73
+ lineGap?: string;
74
+ hideVerticalDivider?: boolean;
75
+ enableStripedRows?: boolean;
76
+ showRowHover?: boolean;
77
+ showTableTitle?: boolean;
78
+ showTableDesc?: boolean;
79
+ enableTableSearch?: boolean;
80
+ enableFilter?: boolean;
81
+ enableSorting?: boolean;
42
82
  disablePagination?: boolean;
43
83
  defaultRowSize?: string;
44
- };
45
- export declare type BackgroundSettings = {
46
- show: boolean;
47
- };
48
- export declare type LabelSettings = {
49
- axis: string;
50
- show: boolean;
51
- position: string;
52
- };
53
- export declare type AxisSettings = {
54
- axis: string;
55
- };
56
- export declare type SelectedColumns = {
84
+ columnSizing?: ColumnSizingState;
85
+ };
86
+ export type BackgroundSettings = {
87
+ show?: boolean;
88
+ };
89
+ export type LabelSettings = {
90
+ axis?: string;
91
+ show?: boolean;
92
+ position?: string;
93
+ };
94
+ export type AxisSettings = {
95
+ axis?: string;
96
+ };
97
+ export type ChartSettingsType = {
98
+ chartType: keyof typeof CHART_TYPES;
99
+ margins?: MarginSettings;
100
+ xAxis?: string;
101
+ yAxisList?: string[];
102
+ step?: string;
103
+ measure?: string;
104
+ singleValue?: string;
105
+ sankeyValues?: string[];
106
+ legendSettings?: LegendSettings;
107
+ labelSettings?: LabelSettings;
108
+ customSettings?: CustomSettings;
109
+ tableSettings?: TableSettings;
110
+ axisSettings?: AxisSettings;
111
+ backGroundColor?: BackgroundSettings;
112
+ timeSeriesSettings?: TimeSeriesSettingsType;
113
+ };
114
+ export type SelectedColumns = {
57
115
  column: string;
58
116
  datatype: string;
59
117
  schemaName: string;
60
118
  tableName: string;
61
119
  };
62
- export declare type Schema = {
120
+ export type Schema = {
63
121
  id: string;
64
122
  schemaName: string;
65
123
  tableName: string;
@@ -71,7 +129,7 @@ export declare type Schema = {
71
129
  isDefault?: boolean;
72
130
  }[];
73
131
  };
74
- export declare type RlsFilterObjectType = {
132
+ export type RlsFilterObjectType = {
75
133
  columnName: string;
76
134
  condition: string;
77
135
  createdAt: any;
@@ -87,7 +145,7 @@ export declare type RlsFilterObjectType = {
87
145
  lastName: string;
88
146
  };
89
147
  };
90
- export declare type SelectedTable = {
148
+ export type SelectedTable = {
91
149
  tableName: string;
92
150
  columns: {
93
151
  name: string;
@@ -95,40 +153,40 @@ export declare type SelectedTable = {
95
153
  as: string;
96
154
  }[] | [];
97
155
  }[] | undefined;
98
- export declare type GroupBy = {
156
+ export type GroupBy = {
99
157
  column: string;
100
158
  parentColumn?: {
101
159
  column: string;
102
160
  value: string;
103
161
  };
104
162
  };
105
- export declare type ClientType = {
163
+ export type ClientType = {
106
164
  label: string;
107
165
  value: string;
108
166
  };
109
- export declare type DashboardType = {
167
+ export type DashboardType = {
110
168
  id: string;
111
169
  name: string;
112
170
  };
113
- export declare type FloatingDropDownOption = {
171
+ export type FloatingDropDownOption = {
114
172
  key?: string;
115
173
  label: string;
116
174
  value: string;
117
175
  };
118
- export declare type FilterType = {
176
+ export type FilterType = {
119
177
  tableName: string;
120
178
  columns: Schema['columnsWithDataType'];
121
179
  };
122
- export declare type JoinField = {
180
+ export type JoinField = {
123
181
  a: string;
124
182
  b: string;
125
183
  };
126
- export declare type SqlError = {
184
+ export type SqlError = {
127
185
  errorMessage: string;
128
186
  explanation: string;
129
187
  solution: string;
130
188
  };
131
- export declare type DateOptionType = {
189
+ export type DateOptionType = {
132
190
  id: string;
133
191
  range: string;
134
192
  time: string;
@@ -136,7 +194,7 @@ export declare type DateOptionType = {
136
194
  name: string;
137
195
  count: number;
138
196
  };
139
- export declare type RlsCondition = {
197
+ export type RlsCondition = {
140
198
  name: string;
141
199
  columnName: string;
142
200
  tableName: string;
@@ -147,7 +205,7 @@ export declare type RlsCondition = {
147
205
  dimensionColumn?: string;
148
206
  measureColumn?: string;
149
207
  };
150
- export declare type MetricData = {
208
+ export type MetricData = {
151
209
  id: string;
152
210
  name: string;
153
211
  dashboards: {
@@ -158,7 +216,7 @@ export declare type MetricData = {
158
216
  createdBy: string;
159
217
  dateCreated: string;
160
218
  };
161
- export declare type GetUnderlyingData = ({ columnName, value, setData, setLoading, }: {
219
+ export type GetUnderlyingData = ({ columnName, value, setData, setLoading, }: {
162
220
  columnName: string;
163
221
  value: any;
164
222
  setData: React.Dispatch<React.SetStateAction<any[]>>;
@@ -1,30 +1,12 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
- import { AxisSettings, BackgroundSettings, CustomSettings, LabelSettings, LegendSettings, RlsCondition, FloatingDropDownOption, TableSettings } from './app';
2
+ import { RlsCondition, FloatingDropDownOption, ChartSettingsType } from './app';
3
3
  import { ExternalMetrics } from '@/utils/generated/graphql';
4
- declare type ColumnData = {
4
+ type ColumnData = {
5
5
  name: string;
6
6
  datatype: string;
7
7
  as: string;
8
8
  };
9
- export declare type TimeSeriesGroupType = 'yearly' | 'monthly' | 'weekly' | 'daily';
10
- export declare type TimeSeriesType = 'bar' | 'line' | 'area';
11
- export declare type TimeSeriesSettingsType = {
12
- seriesType: {
13
- type: TimeSeriesType;
14
- column: string;
15
- }[];
16
- groupBySettings: {
17
- isDynamic: boolean;
18
- options: string[];
19
- value: TimeSeriesGroupType;
20
- };
21
- };
22
- export declare type TimeSeriesSettingsProps = {
23
- settings: TimeSeriesSettingsType;
24
- onChange: React.Dispatch<React.SetStateAction<TimeSeriesSettingsType>>;
25
- yAxisList: string[];
26
- };
27
- export declare type EmbeddedMetricCreationProps = {
9
+ export type EmbeddedMetricCreationProps = {
28
10
  clientId: string;
29
11
  companyId: string;
30
12
  isLiveMode: boolean;
@@ -38,7 +20,7 @@ export declare type EmbeddedMetricCreationProps = {
38
20
  metricData?: Record<string, any>[];
39
21
  workspaceId: string;
40
22
  };
41
- export declare type HeaderProps = {
23
+ export type HeaderProps = {
42
24
  Heading: string;
43
25
  setShowMetricCreateModal: React.Dispatch<React.SetStateAction<boolean>>;
44
26
  isDisableSqlBtn: boolean;
@@ -46,13 +28,13 @@ export declare type HeaderProps = {
46
28
  setShowSqlModal: React.Dispatch<React.SetStateAction<boolean>>;
47
29
  setShowSaveMetricModal: React.Dispatch<React.SetStateAction<boolean>>;
48
30
  };
49
- export declare type DatasetProps = {
31
+ export type DatasetProps = {
50
32
  setselectTable: React.Dispatch<React.SetStateAction<FloatingDropDownOption>>;
51
33
  selectTable: FloatingDropDownOption;
52
34
  tableList: FloatingDropDownOption[];
53
35
  columnList: ColumnData[];
54
36
  };
55
- export declare type ConstructMetricProps = {
37
+ export type ConstructMetricProps = {
56
38
  columnList: FloatingDropDownOption[];
57
39
  dateTimeColumnList: ColumnData[];
58
40
  companyId: string;
@@ -66,11 +48,11 @@ export declare type ConstructMetricProps = {
66
48
  clientColumn?: string;
67
49
  databaseId: string;
68
50
  };
69
- export declare type MetricsValue = {
51
+ export type MetricsValue = {
70
52
  value: string;
71
53
  as: string;
72
54
  };
73
- export declare type MetricOutputProps = {
55
+ export type MetricOutputProps = {
74
56
  data: any[] | undefined;
75
57
  isUpdateMetric?: boolean;
76
58
  query?: string;
@@ -83,50 +65,8 @@ export declare type MetricOutputProps = {
83
65
  setError?: React.Dispatch<React.SetStateAction<string>>;
84
66
  destinationId?: string;
85
67
  dbName?: string;
86
- labels: string[] | undefined;
87
- funnelData: ('' | {
88
- value: any;
89
- name: any;
90
- } | undefined)[] | undefined;
91
- chartType: string;
92
- datasets: {
93
- label: string;
94
- data: any[] | undefined;
95
- borderColor: string;
96
- }[] | undefined;
97
- setChartType: React.Dispatch<React.SetStateAction<string>>;
98
- setXAxis: React.Dispatch<React.SetStateAction<string | undefined>>;
99
- setYAxisList: React.Dispatch<React.SetStateAction<string[] | undefined>>;
100
- yAxisList?: string[];
101
- xAxis: string | undefined;
102
- setMeasure: React.Dispatch<React.SetStateAction<string | undefined>>;
103
- setStep: React.Dispatch<React.SetStateAction<string | undefined>>;
104
- step: string | undefined;
105
- measure: string | undefined;
106
- setSankeyValues: React.Dispatch<React.SetStateAction<string[] | undefined>>;
107
- sankeyData: (any[] | undefined)[] | undefined;
108
68
  previewTableDataList: any[] | undefined;
109
- singleValue: string | undefined;
110
- setSingleValue: React.Dispatch<React.SetStateAction<string | undefined>>;
111
- singleValueData: ('' | {
112
- value: any;
113
- label: string;
114
- } | undefined)[] | undefined;
115
- setMargins: React.Dispatch<React.SetStateAction<Record<string, number>>>;
116
- margins: Record<string, number>;
117
- legendSettings: LegendSettings;
118
- setLegendSettings: React.Dispatch<React.SetStateAction<LegendSettings>>;
119
- labelSettings: LabelSettings;
120
- setLabelSettings: React.Dispatch<React.SetStateAction<LabelSettings>>;
121
- axisSettings: AxisSettings;
122
- setAxisSettings: React.Dispatch<React.SetStateAction<AxisSettings>>;
123
- customSettings: CustomSettings;
124
- setCustomSettings: React.Dispatch<React.SetStateAction<CustomSettings>>;
125
69
  enableQueryTab?: boolean;
126
- backGroundColor: BackgroundSettings;
127
- setBackGroundColor: React.Dispatch<React.SetStateAction<BackgroundSettings>>;
128
- tableSettings: TableSettings;
129
- setTableSettings: React.Dispatch<React.SetStateAction<TableSettings>>;
130
70
  rlsConditions?: RlsCondition[] | undefined;
131
71
  onChangeFilterValue?: (name: string, value: string) => void;
132
72
  moreTabs?: {
@@ -135,14 +75,14 @@ export declare type MetricOutputProps = {
135
75
  tabContent: JSX.Element;
136
76
  }[];
137
77
  chartColors?: string[];
138
- timeSeriesSettings: TimeSeriesSettingsType;
139
- setTimeSeriesSettings: React.Dispatch<React.SetStateAction<TimeSeriesSettingsType>>;
78
+ chartSettings: ChartSettingsType;
79
+ setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
140
80
  };
141
- export declare type CompanyIntegration = {
81
+ export type CompanyIntegration = {
142
82
  id: string;
143
83
  name: string;
144
84
  } | undefined;
145
- export declare type ClickActionsConfig = {
85
+ export type ClickActionsConfig = {
146
86
  card: {
147
87
  isEnable: boolean;
148
88
  baseUrl: string;
@@ -158,23 +98,9 @@ export declare type ClickActionsConfig = {
158
98
  routeType: string;
159
99
  };
160
100
  };
161
- export declare type DrillDownSetting = {
101
+ export type DrillDownSetting = {
162
102
  selectedMeasures: string[];
163
103
  selectedDimensions: string[];
164
104
  isEnableGroupBy: boolean;
165
105
  };
166
- export declare type TimeSeriesChartProps = {
167
- dataArray: Record<string, any>[];
168
- timeStampKey: string;
169
- valuekeys: string[];
170
- type: TimeSeriesType;
171
- groupBy: TimeSeriesGroupType;
172
- margins: Record<string, number>;
173
- legendSettings: LegendSettings;
174
- labelSettings: LabelSettings;
175
- axisSettings: AxisSettings;
176
- colors?: string[];
177
- customSettings: CustomSettings;
178
- backGroundColor: BackgroundSettings;
179
- };
180
106
  export {};