@databrainhq/plugin 0.8.13 → 0.8.14

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 (37) hide show
  1. package/README.md +26 -26
  2. package/dist/components/ChartPopup/index.d.ts +5 -2
  3. package/dist/components/Charts/AreaChart.d.ts +1 -1
  4. package/dist/components/Charts/BarChart.d.ts +2 -6
  5. package/dist/components/Charts/BoxPlot.d.ts +1 -1
  6. package/dist/components/Charts/BubbleChart.d.ts +1 -1
  7. package/dist/components/Charts/ComboChart.d.ts +1 -1
  8. package/dist/components/Charts/DoughnutChart.d.ts +1 -1
  9. package/dist/components/Charts/FunnelChart.d.ts +1 -1
  10. package/dist/components/Charts/GaugeChart.d.ts +1 -1
  11. package/dist/components/Charts/Histogram.d.ts +1 -1
  12. package/dist/components/Charts/LineChart.d.ts +2 -6
  13. package/dist/components/Charts/PieChart.d.ts +1 -1
  14. package/dist/components/Charts/RowChart.d.ts +1 -1
  15. package/dist/components/Charts/SankeyChart.d.ts +1 -1
  16. package/dist/components/Charts/ScatterChart.d.ts +1 -1
  17. package/dist/components/Charts/StackedBarChart.d.ts +1 -1
  18. package/dist/components/Charts/SteppedAreaChart.d.ts +1 -1
  19. package/dist/components/Charts/WaterfallChart.d.ts +1 -1
  20. package/dist/components/DrillBreadCrumb/index.d.ts +6 -0
  21. package/dist/components/MetricChart/MetricChart.d.ts +2 -4
  22. package/dist/components/MetricCreation/components/ConstructMetric/ConstructMetric.d.ts +1 -1
  23. package/dist/components/MetricCreation/components/ConstructMetric/components/MetricForm/index.d.ts +1 -1
  24. package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
  25. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +5 -3
  26. package/dist/components/index.d.ts +2 -0
  27. package/dist/helpers/groupBy.d.ts +4 -0
  28. package/dist/hooks/index.d.ts +1 -0
  29. package/dist/hooks/useEmbeddedDashboard.d.ts +1 -0
  30. package/dist/hooks/useUnderlyingData.d.ts +1 -1
  31. package/dist/index.es.js +1114 -1428
  32. package/dist/index.umd.js +73 -72
  33. package/dist/style.css +1 -1
  34. package/dist/types/metricCreate.d.ts +5 -5
  35. package/dist/typings.d.ts +17 -17
  36. package/dist/utils/generated/graphql.d.ts +22 -1
  37. package/package.json +98 -98
@@ -44,9 +44,6 @@ export declare type ConstructMetricProps = {
44
44
  setQuery: React.Dispatch<React.SetStateAction<string>>;
45
45
  setData: React.Dispatch<React.SetStateAction<any[] | undefined>>;
46
46
  database: string;
47
- isEnableGroupBy: boolean;
48
- setEnableGroupBy?: React.Dispatch<React.SetStateAction<boolean>>;
49
- setSelectedGroupBy: React.Dispatch<React.SetStateAction<string[]>>;
50
47
  clientId: string;
51
48
  clientColumn?: string;
52
49
  };
@@ -106,8 +103,6 @@ export declare type MetricOutputProps = {
106
103
  setAxisSettings: React.Dispatch<React.SetStateAction<AxisSettings>>;
107
104
  customSettings: CustomSettings;
108
105
  setCustomSettings: React.Dispatch<React.SetStateAction<CustomSettings>>;
109
- updateGroup?: (value: string) => void;
110
- isEnableGroupBy?: boolean;
111
106
  enableQueryTab?: boolean;
112
107
  backGroundColor: BackgroundSettings;
113
108
  setBackGroundColor: React.Dispatch<React.SetStateAction<BackgroundSettings>>;
@@ -142,4 +137,9 @@ export declare type ClickActionsConfig = {
142
137
  routeType: string;
143
138
  };
144
139
  };
140
+ export declare type DrillDownSetting = {
141
+ selectedMeasures: string[];
142
+ selectedDimensions: string[];
143
+ isEnableGroupBy: boolean;
144
+ };
145
145
  export {};
package/dist/typings.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- /**
2
- * Default CSS definition for typescript,
3
- * will be overridden with file-specific definitions by rollup
4
- */
5
- declare module '*.css' {
6
- const content: Record<string, string>;
7
- export default content;
8
- }
9
-
10
- interface SvgrComponent extends React.FC<React.SVGAttributes<SVGElement>> {}
11
-
12
- declare module '*.svg' {
13
- const svgUrl: string;
14
- const svgComponent: SvgrComponent;
15
- export default svgUrl;
16
- export { svgComponent as ReactComponent };
17
- }
1
+ /**
2
+ * Default CSS definition for typescript,
3
+ * will be overridden with file-specific definitions by rollup
4
+ */
5
+ declare module '*.css' {
6
+ const content: Record<string, string>;
7
+ export default content;
8
+ }
9
+
10
+ interface SvgrComponent extends React.FC<React.SVGAttributes<SVGElement>> {}
11
+
12
+ declare module '*.svg' {
13
+ const svgUrl: string;
14
+ const svgComponent: SvgrComponent;
15
+ export default svgUrl;
16
+ export { svgComponent as ReactComponent };
17
+ }
@@ -766,7 +766,9 @@ export declare type ExternalMetrics = {
766
766
  companyIntegrationId: Scalars['uuid'];
767
767
  createdAt: Scalars['timestamptz'];
768
768
  createdBy?: Maybe<Scalars['String']>;
769
+ datasetMetricSettings?: Maybe<Scalars['jsonb']>;
769
770
  description: Scalars['String'];
771
+ drillDownSettings?: Maybe<Scalars['jsonb']>;
770
772
  /** An array relationship */
771
773
  externalDashboardMetrics: Array<ExternalDashboardMetrics>;
772
774
  /** An array relationship */
@@ -806,6 +808,14 @@ export declare type ExternalMetricsClientDeletedMetricsArgs = {
806
808
  where?: InputMaybe<ClientDeletedMetrics_Bool_Exp>;
807
809
  };
808
810
  /** extrnal metrics table for users client-based query */
811
+ export declare type ExternalMetricsDatasetMetricSettingsArgs = {
812
+ path?: InputMaybe<Scalars['String']>;
813
+ };
814
+ /** extrnal metrics table for users client-based query */
815
+ export declare type ExternalMetricsDrillDownSettingsArgs = {
816
+ path?: InputMaybe<Scalars['String']>;
817
+ };
818
+ /** extrnal metrics table for users client-based query */
809
819
  export declare type ExternalMetricsExternalDashboardMetricsArgs = {
810
820
  distinct_on?: InputMaybe<Array<ExternalDashboardMetrics_Select_Column>>;
811
821
  limit?: InputMaybe<Scalars['Int']>;
@@ -955,7 +965,9 @@ export declare type ExternalMetrics_Bool_Exp = {
955
965
  companyIntegrationId?: InputMaybe<Uuid_Comparison_Exp>;
956
966
  createdAt?: InputMaybe<Timestamptz_Comparison_Exp>;
957
967
  createdBy?: InputMaybe<String_Comparison_Exp>;
968
+ datasetMetricSettings?: InputMaybe<Jsonb_Comparison_Exp>;
958
969
  description?: InputMaybe<String_Comparison_Exp>;
970
+ drillDownSettings?: InputMaybe<Jsonb_Comparison_Exp>;
959
971
  externalDashboardMetrics?: InputMaybe<ExternalDashboardMetrics_Bool_Exp>;
960
972
  externalMetricsRlsFilters?: InputMaybe<ExternalMetricsRlsFilters_Bool_Exp>;
961
973
  groupBy?: InputMaybe<Jsonb_Comparison_Exp>;
@@ -1007,7 +1019,9 @@ export declare type ExternalMetrics_Insert_Input = {
1007
1019
  companyIntegrationId?: InputMaybe<Scalars['uuid']>;
1008
1020
  createdAt?: InputMaybe<Scalars['timestamptz']>;
1009
1021
  createdBy?: InputMaybe<Scalars['String']>;
1022
+ datasetMetricSettings?: InputMaybe<Scalars['jsonb']>;
1010
1023
  description?: InputMaybe<Scalars['String']>;
1024
+ drillDownSettings?: InputMaybe<Scalars['jsonb']>;
1011
1025
  externalDashboardMetrics?: InputMaybe<ExternalDashboardMetrics_Arr_Rel_Insert_Input>;
1012
1026
  externalMetricsRlsFilters?: InputMaybe<ExternalMetricsRlsFilters_Arr_Rel_Insert_Input>;
1013
1027
  groupBy?: InputMaybe<Scalars['jsonb']>;
@@ -1093,7 +1107,9 @@ export declare type ExternalMetrics_Order_By = {
1093
1107
  companyIntegrationId?: InputMaybe<Order_By>;
1094
1108
  createdAt?: InputMaybe<Order_By>;
1095
1109
  createdBy?: InputMaybe<Order_By>;
1110
+ datasetMetricSettings?: InputMaybe<Order_By>;
1096
1111
  description?: InputMaybe<Order_By>;
1112
+ drillDownSettings?: InputMaybe<Order_By>;
1097
1113
  externalDashboardMetrics_aggregate?: InputMaybe<ExternalDashboardMetrics_Aggregate_Order_By>;
1098
1114
  externalMetricsRlsFilters_aggregate?: InputMaybe<ExternalMetricsRlsFilters_Aggregate_Order_By>;
1099
1115
  groupBy?: InputMaybe<Order_By>;
@@ -1140,8 +1156,12 @@ export declare enum ExternalMetrics_Select_Column {
1140
1156
  /** column name */
1141
1157
  CreatedBy = "createdBy",
1142
1158
  /** column name */
1159
+ DatasetMetricSettings = "datasetMetricSettings",
1160
+ /** column name */
1143
1161
  Description = "description",
1144
1162
  /** column name */
1163
+ DrillDownSettings = "drillDownSettings",
1164
+ /** column name */
1145
1165
  GroupBy = "groupBy",
1146
1166
  /** column name */
1147
1167
  Id = "id",
@@ -2041,6 +2061,7 @@ export declare type EmbeddedDashboardMetricsQuery = {
2041
2061
  groupBy: any;
2042
2062
  rlsConditions: any;
2043
2063
  clickActions: any;
2064
+ drillDownSettings?: any | null;
2044
2065
  companyIntegration: {
2045
2066
  __typename?: 'companyIntegrations';
2046
2067
  name: string;
@@ -2369,7 +2390,7 @@ export declare const useCompanySubsetTableDataMutation: <TError = unknown, TCont
2369
2390
  companyId?: InputMaybe<string> | undefined;
2370
2391
  workspaceId?: InputMaybe<string> | undefined;
2371
2392
  }>, TContext>;
2372
- export declare const EmbeddedDashboardMetricsDocument = "\n query EmbeddedDashboardMetrics($externalDashboardId: String! = \"\", $clientId: String! = \"\") {\n externalDashboardMetrics(\n where: {externalDashboard: {externalDashboardId: {_eq: $externalDashboardId}}, _not: {externalMetric: {clientDeletedMetrics: {clientId: {_eq: $clientId}}}}}\n ) {\n externalMetricId\n externalDashboardId\n externalMetric {\n chartOptions\n clientId\n companyId\n companyIntegrationId\n createdAt\n createdBy\n description\n id\n inputFields\n integrationName\n isCreatedByClient\n isLive\n metricId\n metricQuery\n name\n outputColumns\n query\n resizeAttributes\n timeGrain\n updatedAt\n selectedGroupBy\n isEnableGroupBy\n groupBy\n rlsConditions\n companyIntegration {\n name\n }\n clickActions\n }\n }\n}\n ";
2393
+ export declare const EmbeddedDashboardMetricsDocument = "\n query EmbeddedDashboardMetrics($externalDashboardId: String! = \"\", $clientId: String! = \"\") {\n externalDashboardMetrics(\n where: {externalDashboard: {externalDashboardId: {_eq: $externalDashboardId}}, _not: {externalMetric: {clientDeletedMetrics: {clientId: {_eq: $clientId}}}}}\n ) {\n externalMetricId\n externalDashboardId\n externalMetric {\n chartOptions\n clientId\n companyId\n companyIntegrationId\n createdAt\n createdBy\n description\n id\n inputFields\n integrationName\n isCreatedByClient\n isLive\n metricId\n metricQuery\n name\n outputColumns\n query\n resizeAttributes\n timeGrain\n updatedAt\n selectedGroupBy\n isEnableGroupBy\n groupBy\n rlsConditions\n companyIntegration {\n name\n }\n clickActions\n drillDownSettings\n }\n }\n}\n ";
2373
2394
  export declare const useEmbeddedDashboardMetricsQuery: <TData = EmbeddedDashboardMetricsQuery, TError = unknown>(variables?: EmbeddedDashboardMetricsQueryVariables, options?: UseQueryOptions<EmbeddedDashboardMetricsQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
2374
2395
  export declare const GetExternalDashboardClientThemeDocument = "\n query GetExternalDashboardClientTheme($companyId: uuid!, $clientId: String!) {\n externalDashboardThemes(\n where: {companyId: {_eq: $companyId}, externalDashboardThemeClients: {clientId: {_eq: $clientId}}}\n limit: 1\n ) {\n colors\n createdAt\n id\n name\n }\n}\n ";
2375
2396
  export declare const useGetExternalDashboardClientThemeQuery: <TData = GetExternalDashboardClientThemeQuery, TError = unknown>(variables: GetExternalDashboardClientThemeQueryVariables, options?: UseQueryOptions<GetExternalDashboardClientThemeQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
package/package.json CHANGED
@@ -1,98 +1,98 @@
1
- {
2
- "name": "@databrainhq/plugin",
3
- "version": "0.8.13",
4
- "description": "Databrain app dashboard ui plugin.",
5
- "author": "",
6
- "license": "MIT",
7
- "repository": "databrainhq/plugin",
8
- "source": "src/index.ts",
9
- "main": "./dist/index.umd.js",
10
- "module": "./dist/index.es.js",
11
- "types": "./dist/index.d.ts",
12
- "exports": {
13
- ".": {
14
- "import": "./dist/index.es.js",
15
- "require": "./dist/index.umd.js"
16
- },
17
- "./dist/style.css": "./dist/style.css"
18
- },
19
- "engines": {
20
- "node": "^14.13.1 || >=16.15.1",
21
- "yarn": "please-use-npm"
22
- },
23
- "scripts": {
24
- "serve": "vite --port 3005",
25
- "build:css": "tailwindcss build -i src/index.css -o dist/index.css",
26
- "build": "tsc && vite build",
27
- "husky": "husky install",
28
- "predeploy": "cd example && npm install && npm run build",
29
- "lint": "eslint --ext .tsx,.ts --ignore-path .gitignore --fix src",
30
- "codegen": "graphql-codegen --config codegen.yml -r dotenv/config",
31
- "prepare": "npm run build"
32
- },
33
- "devDependencies": {
34
- "@commitlint/cli": "^17.0.3",
35
- "@commitlint/config-conventional": "^17.0.3",
36
- "@graphql-codegen/cli": "^2.16.4",
37
- "@graphql-codegen/introspection": "^2.2.3",
38
- "@graphql-codegen/typescript": "^2.8.7",
39
- "@graphql-codegen/typescript-operations": "^2.5.12",
40
- "@graphql-codegen/typescript-react-apollo": "^3.3.7",
41
- "@graphql-codegen/typescript-react-query": "^3.6.2",
42
- "@iconify/json": "^2.2.6",
43
- "@svgr/core": "^6.5.1",
44
- "@types/node": "^12.12.38",
45
- "@types/react": "^18.0.26",
46
- "@types/react-dom": "^18.0.10",
47
- "@types/react-grid-layout": "^1.3.2",
48
- "@typescript-eslint/eslint-plugin": "^4.31.1",
49
- "@typescript-eslint/parser": "^4.31.1",
50
- "@vitejs/plugin-react": "^1.3.0",
51
- "autoprefixer": "^10.4.7",
52
- "babel-eslint": "^10.0.3",
53
- "cross-env": "^7.0.2",
54
- "eslint": "^7.32.0",
55
- "eslint-config-airbnb": "^18.2.1",
56
- "eslint-config-airbnb-typescript": "^14.0.0",
57
- "eslint-config-prettier": "^8.3.0",
58
- "eslint-plugin-import": "^2.24.2",
59
- "eslint-plugin-jsx-a11y": "^6.6.0",
60
- "eslint-plugin-prettier": "^4.0.0",
61
- "eslint-plugin-react": "^7.30.1",
62
- "eslint-plugin-react-hooks": "^4.6.0",
63
- "eslint-plugin-unicorn": "^36.0.0",
64
- "graphql": "^16.6.0",
65
- "husky": "^8.0.1",
66
- "lint-staged": "^13.0.3",
67
- "postcss": "^8.4.21",
68
- "prettier": "^2.0.4",
69
- "react": "^18.2.0",
70
- "react-dom": "^18.2.0",
71
- "tailwindcss": "^3.2.4",
72
- "ts-node": "^10.9.1",
73
- "typescript": "^4.6.3",
74
- "unplugin-icons": "^0.14.7",
75
- "vite": "^2.9.9",
76
- "vite-plugin-dts": "^1.7.1",
77
- "vite-tsconfig-paths": "^4.0.3"
78
- },
79
- "files": [
80
- "dist"
81
- ],
82
- "dependencies": {
83
- "@headlessui/react": "^1.7.2",
84
- "@tanstack/match-sorter-utils": "^8.8.4",
85
- "@tanstack/react-table": "^8.7.9",
86
- "classnames": "^2.3.2",
87
- "echarts": "^5.4.1",
88
- "echarts-for-react": "^3.0.2",
89
- "react-error-boundary": "^3.1.4",
90
- "react-grid-layout": "^1.3.4",
91
- "react-hook-form": "^7.33.1",
92
- "react-query": "^3.39.2"
93
- },
94
- "peerDependencies": {
95
- "react": "^18.2.0",
96
- "react-dom": "^18.2.0"
97
- }
98
- }
1
+ {
2
+ "name": "@databrainhq/plugin",
3
+ "version": "0.8.14",
4
+ "description": "Databrain app dashboard ui plugin.",
5
+ "author": "",
6
+ "license": "MIT",
7
+ "repository": "databrainhq/plugin",
8
+ "source": "src/index.ts",
9
+ "main": "./dist/index.umd.js",
10
+ "module": "./dist/index.es.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.es.js",
15
+ "require": "./dist/index.umd.js"
16
+ },
17
+ "./dist/style.css": "./dist/style.css"
18
+ },
19
+ "engines": {
20
+ "node": "^14.13.1 || >=16.15.1",
21
+ "yarn": "please-use-npm"
22
+ },
23
+ "scripts": {
24
+ "serve": "vite --port 3005",
25
+ "build:css": "tailwindcss build -i src/index.css -o dist/index.css",
26
+ "build": "tsc && vite build",
27
+ "husky": "husky install",
28
+ "predeploy": "cd example && npm install && npm run build",
29
+ "lint": "eslint --ext .tsx,.ts --ignore-path .gitignore --fix src",
30
+ "codegen": "graphql-codegen --config codegen.yml -r dotenv/config",
31
+ "prepare": "npm run build"
32
+ },
33
+ "devDependencies": {
34
+ "@commitlint/cli": "^17.0.3",
35
+ "@commitlint/config-conventional": "^17.0.3",
36
+ "@graphql-codegen/cli": "^2.16.4",
37
+ "@graphql-codegen/introspection": "^2.2.3",
38
+ "@graphql-codegen/typescript": "^2.8.7",
39
+ "@graphql-codegen/typescript-operations": "^2.5.12",
40
+ "@graphql-codegen/typescript-react-apollo": "^3.3.7",
41
+ "@graphql-codegen/typescript-react-query": "^3.6.2",
42
+ "@iconify/json": "^2.2.6",
43
+ "@svgr/core": "^6.5.1",
44
+ "@types/node": "^12.12.38",
45
+ "@types/react": "^18.0.26",
46
+ "@types/react-dom": "^18.0.10",
47
+ "@types/react-grid-layout": "^1.3.2",
48
+ "@typescript-eslint/eslint-plugin": "^4.31.1",
49
+ "@typescript-eslint/parser": "^4.31.1",
50
+ "@vitejs/plugin-react": "^1.3.0",
51
+ "autoprefixer": "^10.4.7",
52
+ "babel-eslint": "^10.0.3",
53
+ "cross-env": "^7.0.2",
54
+ "eslint": "^7.32.0",
55
+ "eslint-config-airbnb": "^18.2.1",
56
+ "eslint-config-airbnb-typescript": "^14.0.0",
57
+ "eslint-config-prettier": "^8.3.0",
58
+ "eslint-plugin-import": "^2.24.2",
59
+ "eslint-plugin-jsx-a11y": "^6.6.0",
60
+ "eslint-plugin-prettier": "^4.0.0",
61
+ "eslint-plugin-react": "^7.30.1",
62
+ "eslint-plugin-react-hooks": "^4.6.0",
63
+ "eslint-plugin-unicorn": "^36.0.0",
64
+ "graphql": "^16.6.0",
65
+ "husky": "^8.0.1",
66
+ "lint-staged": "^13.0.3",
67
+ "postcss": "^8.4.21",
68
+ "prettier": "^2.0.4",
69
+ "react": "^18.2.0",
70
+ "react-dom": "^18.2.0",
71
+ "tailwindcss": "^3.2.4",
72
+ "ts-node": "^10.9.1",
73
+ "typescript": "^4.6.3",
74
+ "unplugin-icons": "^0.14.7",
75
+ "vite": "^2.9.9",
76
+ "vite-plugin-dts": "^1.7.1",
77
+ "vite-tsconfig-paths": "^4.0.3"
78
+ },
79
+ "files": [
80
+ "dist"
81
+ ],
82
+ "dependencies": {
83
+ "@headlessui/react": "^1.7.2",
84
+ "@tanstack/match-sorter-utils": "^8.8.4",
85
+ "@tanstack/react-table": "^8.7.9",
86
+ "classnames": "^2.3.2",
87
+ "echarts": "^5.4.1",
88
+ "echarts-for-react": "^3.0.2",
89
+ "react-error-boundary": "^3.1.4",
90
+ "react-grid-layout": "^1.3.4",
91
+ "react-hook-form": "^7.33.1",
92
+ "react-query": "^3.39.2"
93
+ },
94
+ "peerDependencies": {
95
+ "react": "^18.2.0",
96
+ "react-dom": "^18.2.0"
97
+ }
98
+ }