@databrainhq/plugin 0.6.10 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/components/Button/index.d.ts +2 -2
  2. package/dist/components/ChartModal/ChartConfig.d.ts +2 -2
  3. package/dist/components/ChartModal/ChartModalOptions.d.ts +2 -2
  4. package/dist/components/ChartModal/SelectField.d.ts +1 -2
  5. package/dist/components/ChartModal/index.d.ts +3 -0
  6. package/dist/components/Charts/LineChart.d.ts +1 -1
  7. package/dist/components/DataType/index.d.ts +2 -3
  8. package/dist/components/Error/index.d.ts +2 -2
  9. package/dist/components/ErrorFallback/index.d.ts +2 -3
  10. package/dist/components/ExternalMetricForm/index.d.ts +3 -3
  11. package/dist/components/FilterDropDown/index.d.ts +2 -3
  12. package/dist/components/FilterField/index.d.ts +4 -3
  13. package/dist/components/FloatingDropDown/index.d.ts +5 -7
  14. package/dist/components/FullScreenChart/index.d.ts +2 -2
  15. package/dist/components/GlobalFilters/index.d.ts +4 -4
  16. package/dist/components/InfoTooltip/index.d.ts +2 -5
  17. package/dist/components/InputField/index.d.ts +2 -2
  18. package/dist/components/MetricChart/CsvDownloadButton.d.ts +2 -2
  19. package/dist/components/MetricChart/MetricChart.d.ts +34 -0
  20. package/dist/components/MetricChart/index.d.ts +2 -35
  21. package/dist/components/MetricCreation/MetricCreation.d.ts +3 -0
  22. package/dist/components/MetricCreation/components/ConstructMetric/ConstructMetric.d.ts +3 -0
  23. package/dist/components/MetricCreation/components/ConstructMetric/components/MetricForm/index.d.ts +2 -3
  24. package/dist/components/MetricCreation/components/ConstructMetric/index.d.ts +2 -4
  25. package/dist/components/MetricCreation/components/Dataset/index.d.ts +2 -3
  26. package/dist/components/MetricCreation/components/Header/index.d.ts +1 -2
  27. package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +3 -0
  28. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartConfigure/index.d.ts +3 -3
  29. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartSettings/index.d.ts +3 -3
  30. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +3 -3
  31. package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/components/InputTables/index.d.ts +1 -2
  32. package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +2 -2
  33. package/dist/components/MetricCreation/components/MetricOutput/index.d.ts +3 -4
  34. package/dist/components/MetricCreation/index.d.ts +5 -4
  35. package/dist/components/{RlsFilters/index.d.ts → MetricFilters/MetricFilters.d.ts} +3 -3
  36. package/dist/components/{RlsFilters → MetricFilters}/MultipleTimeGrain.d.ts +2 -2
  37. package/dist/components/MetricFilters/index.d.ts +2 -0
  38. package/dist/components/MetricList/MetricList.d.ts +45 -0
  39. package/dist/components/MetricList/components/MetricCard.d.ts +2 -3
  40. package/dist/components/MetricList/components/SingleValueCard.d.ts +1 -2
  41. package/dist/components/MetricList/index.d.ts +3 -45
  42. package/dist/components/MetricTable/index.d.ts +2 -2
  43. package/dist/components/Modal/Modal.d.ts +9 -0
  44. package/dist/components/Modal/ModalFooter.d.ts +4 -2
  45. package/dist/components/Modal/index.d.ts +2 -10
  46. package/dist/components/PopoverMenu/index.d.ts +1 -2
  47. package/dist/components/SearchTab/index.d.ts +1 -2
  48. package/dist/components/Select/index.d.ts +2 -2
  49. package/dist/components/Tab/index.d.ts +2 -2
  50. package/dist/components/Table/index.d.ts +2 -2
  51. package/dist/components/Text/index.d.ts +3 -3
  52. package/dist/components/TextAreaField/index.d.ts +2 -2
  53. package/dist/components/TimeGrainField/index.d.ts +2 -2
  54. package/dist/components/ToggleButton/index.d.ts +2 -2
  55. package/dist/components/index.d.ts +28 -0
  56. package/dist/consts/app.d.ts +39 -0
  57. package/dist/consts/index.d.ts +2 -39
  58. package/dist/containers/Dashboard/Dashboard.d.ts +4 -0
  59. package/dist/containers/Dashboard/EmbededDashboard.d.ts +12 -0
  60. package/dist/containers/Dashboard/index.d.ts +2 -12
  61. package/dist/helpers/getModifiedQuery.d.ts +6 -0
  62. package/dist/helpers/getTimeFilterValue.d.ts +2 -2
  63. package/dist/helpers/groupArray.d.ts +1 -0
  64. package/dist/helpers/index.d.ts +4 -0
  65. package/dist/hooks/index.d.ts +5 -0
  66. package/dist/hooks/useEmbeddedDashboard.d.ts +1 -2
  67. package/dist/hooks/useExternalMetric.d.ts +3 -3
  68. package/dist/hooks/useGenerateDatasetMetrics.d.ts +1 -2
  69. package/dist/hooks/useGenerateEmbeddedMetric.d.ts +15 -0
  70. package/dist/hooks/useOutsideAlerter.d.ts +2 -2
  71. package/dist/index.d.ts +6 -0
  72. package/dist/index.es.js +3191 -2832
  73. package/dist/index.umd.js +124 -106
  74. package/dist/style.css +1 -1
  75. package/dist/types/app.d.ts +124 -0
  76. package/dist/types/index.d.ts +2 -124
  77. package/dist/types/metricCreate.d.ts +1 -9
  78. package/dist/utils/arrayToCsvString.d.ts +1 -2
  79. package/dist/utils/colors.d.ts +1 -2
  80. package/dist/utils/getChartAttributes.d.ts +2 -2
  81. package/dist/utils/getFormattedDataType.d.ts +1 -2
  82. package/dist/utils/index.d.ts +5 -0
  83. package/package.json +3 -3
@@ -0,0 +1,124 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare type ChildrenProps = {
3
+ children: ReactNode;
4
+ };
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
+ axisLabels: string;
19
+ };
20
+ export declare type BackgroundSettings = {
21
+ show: boolean;
22
+ };
23
+ export declare type LabelSettings = {
24
+ axis: string;
25
+ show: boolean;
26
+ position: string;
27
+ };
28
+ export declare type AxisSettings = {
29
+ axis: string;
30
+ };
31
+ export declare type SelectedColumns = {
32
+ column: string;
33
+ datatype: string;
34
+ schemaName: string;
35
+ tableName: string;
36
+ };
37
+ export declare type Schema = {
38
+ id: string;
39
+ schemaName: string;
40
+ tableName: string;
41
+ columns: string[];
42
+ columnsWithDataType: {
43
+ as: any;
44
+ dataType: string;
45
+ name: string;
46
+ }[];
47
+ };
48
+ export declare type RlsFilterObjectType = {
49
+ columnName: string;
50
+ condition: string;
51
+ createdAt: any;
52
+ defaultValue?: string | null | undefined;
53
+ value?: string;
54
+ id: any;
55
+ name: string;
56
+ tableName: string;
57
+ operator?: string | 'and' | 'or';
58
+ user: {
59
+ id: any;
60
+ firstName: string;
61
+ lastName: string;
62
+ };
63
+ };
64
+ export declare type SelectedTable = {
65
+ tableName: string;
66
+ columns: {
67
+ name: string;
68
+ datatype: string;
69
+ as: string;
70
+ }[] | [];
71
+ }[] | undefined;
72
+ export declare type GroupBy = {
73
+ column: string;
74
+ parentColumn?: {
75
+ column: string;
76
+ value: string;
77
+ };
78
+ };
79
+ export declare type ClientType = {
80
+ label: string;
81
+ value: string;
82
+ };
83
+ export declare type DashboardType = {
84
+ id: string;
85
+ name: string;
86
+ };
87
+ export declare type FloatingDropDownOption = {
88
+ key?: string;
89
+ label: string;
90
+ value: string;
91
+ };
92
+ export declare type FilterType = {
93
+ tableName: string;
94
+ columns: Schema['columnsWithDataType'];
95
+ };
96
+ export declare type JoinField = {
97
+ a: string;
98
+ b: string;
99
+ };
100
+ export declare type SqlError = {
101
+ errorMessage: string;
102
+ explanation: string;
103
+ solution: string;
104
+ };
105
+ export declare type RlsCondition = {
106
+ name: string;
107
+ columnName: string;
108
+ tableName: string;
109
+ datatype: string;
110
+ isAddOnMetrics: boolean;
111
+ options: string[] | number[];
112
+ value?: string;
113
+ };
114
+ export declare type MetricData = {
115
+ id: string;
116
+ name: string;
117
+ dashboards: {
118
+ name: string;
119
+ id: string;
120
+ }[];
121
+ description: string;
122
+ createdBy: string;
123
+ dateCreated: string;
124
+ };
@@ -1,124 +1,2 @@
1
- import type { ReactNode } from 'react';
2
- export declare type ChildrenProps = {
3
- children: ReactNode;
4
- };
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
- axisLabels: string;
19
- };
20
- export declare type BackgroundSettings = {
21
- show: boolean;
22
- };
23
- export declare type LabelSettings = {
24
- axis: string;
25
- show: boolean;
26
- position: string;
27
- };
28
- export declare type AxisSettings = {
29
- axis: string;
30
- };
31
- export declare type SelectedColumns = {
32
- column: string;
33
- datatype: string;
34
- schemaName: string;
35
- tableName: string;
36
- };
37
- export declare type Schema = {
38
- id: string;
39
- schemaName: string;
40
- tableName: string;
41
- columns: string[];
42
- columnsWithDataType: {
43
- as: any;
44
- dataType: string;
45
- name: string;
46
- }[];
47
- };
48
- export declare type RlsFilterObjectType = {
49
- columnName: string;
50
- condition: string;
51
- createdAt: any;
52
- defaultValue?: string | null | undefined;
53
- value?: string;
54
- id: any;
55
- name: string;
56
- tableName: string;
57
- operator?: string | 'and' | 'or';
58
- user: {
59
- id: any;
60
- firstName: string;
61
- lastName: string;
62
- };
63
- };
64
- export declare type SelectedTable = {
65
- tableName: string;
66
- columns: {
67
- name: string;
68
- datatype: string;
69
- as: string;
70
- }[] | [];
71
- }[] | undefined;
72
- export declare type GroupBy = {
73
- column: string;
74
- parentColumn?: {
75
- column: string;
76
- value: string;
77
- };
78
- };
79
- export declare type ClientType = {
80
- label: string;
81
- value: string;
82
- };
83
- export declare type DashboardType = {
84
- id: string;
85
- name: string;
86
- };
87
- export declare type FloatingDropDownOption = {
88
- key?: string;
89
- label: string;
90
- value: string;
91
- };
92
- export declare type FilterType = {
93
- tableName: string;
94
- columns: Schema['columnsWithDataType'];
95
- };
96
- export declare type JoinField = {
97
- a: string;
98
- b: string;
99
- };
100
- export declare type SqlError = {
101
- errorMessage: string;
102
- explanation: string;
103
- solution: string;
104
- };
105
- export declare type RlsCondition = {
106
- name: string;
107
- columnName: string;
108
- tableName: string;
109
- datatype: string;
110
- isAddOnMetrics: boolean;
111
- options: string[] | number[];
112
- value?: string;
113
- };
114
- export declare type MetricData = {
115
- id: string;
116
- name: string;
117
- dashboards: {
118
- name: string;
119
- id: string;
120
- }[];
121
- description: string;
122
- createdBy: string;
123
- dateCreated: string;
124
- };
1
+ export * from './app';
2
+ export * from './metricCreate';
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { AxisSettings, BackgroundSettings, CustomSettings, LabelSettings, LegendSettings, RlsCondition } from '.';
3
- import { FloatingDropDownOption } from '@/components/FloatingDropDown';
2
+ import { AxisSettings, BackgroundSettings, CustomSettings, LabelSettings, LegendSettings, RlsCondition, FloatingDropDownOption } from './app';
4
3
  declare type ColumnData = {
5
4
  name: string;
6
5
  datatype: string;
@@ -107,11 +106,4 @@ export declare type CompanyIntegration = {
107
106
  id: string;
108
107
  name: string;
109
108
  } | undefined;
110
- export declare type GroupBy = {
111
- column: string;
112
- parentColumn?: {
113
- column: string;
114
- value: string;
115
- };
116
- };
117
109
  export {};
@@ -3,5 +3,4 @@
3
3
  * @param array - array of objects with key value pairs
4
4
  * @returns uri encoded csv data string
5
5
  */
6
- declare const objectArrayToCsvString: (array: Record<string, string>[]) => string;
7
- export default objectArrayToCsvString;
6
+ export declare const objectArrayToCsvString: (array: Record<string, string>[]) => string;
@@ -1,2 +1 @@
1
- declare const colors: string[];
2
- export default colors;
1
+ export declare const colors: string[];
@@ -7,7 +7,7 @@ declare type Params = {
7
7
  sankeyValues: string[] | undefined;
8
8
  singleValue: string | undefined;
9
9
  };
10
- declare const getChartAttributes: ({ data, measure, sankeyValues, singleValue, step, xAxis, yAxisList, }: Params) => {
10
+ export declare const getChartAttributes: ({ data, measure, sankeyValues, singleValue, step, xAxis, yAxisList, }: Params) => {
11
11
  labels: string[];
12
12
  datasets: {
13
13
  label: string;
@@ -24,4 +24,4 @@ declare const getChartAttributes: ({ data, measure, sankeyValues, singleValue, s
24
24
  label: string;
25
25
  } | undefined)[];
26
26
  };
27
- export default getChartAttributes;
27
+ export {};
@@ -1,2 +1 @@
1
- declare const getFormattedDataType: (datatype: string) => 'text' | 'number' | 'boolean';
2
- export default getFormattedDataType;
1
+ export declare const getFormattedDataType: (datatype: string) => 'text' | 'number' | 'boolean';
@@ -0,0 +1,5 @@
1
+ export * from './theme';
2
+ export * from './getChartAttributes';
3
+ export * from './colors';
4
+ export * from './getFormattedDataType';
5
+ export * from './arrayToCsvString';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databrainhq/plugin",
3
- "version": "0.6.10",
3
+ "version": "0.7.1",
4
4
  "description": "Databrain app dashboard ui plugin.",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -80,13 +80,13 @@
80
80
  "dist"
81
81
  ],
82
82
  "dependencies": {
83
- "@headlessui/react": "^1.7.7",
83
+ "@headlessui/react": "^1.7.2",
84
84
  "classnames": "^2.3.2",
85
85
  "echarts": "^5.4.1",
86
86
  "echarts-for-react": "^3.0.2",
87
87
  "react-error-boundary": "^3.1.4",
88
88
  "react-grid-layout": "^1.3.4",
89
- "react-hook-form": "^7.42.1",
89
+ "react-hook-form": "^7.33.1",
90
90
  "react-query": "^3.39.2"
91
91
  },
92
92
  "peerDependencies": {