@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,5 +1,5 @@
1
- declare type Params = {
2
- data: any[] | undefined;
1
+ type Params = {
2
+ data: Record<string, any>[] | undefined;
3
3
  yAxisList: string[] | undefined;
4
4
  xAxis: string | undefined;
5
5
  measure: string | undefined;
@@ -14,14 +14,11 @@ export declare const getChartAttributes: ({ data, measure, sankeyValues, singleV
14
14
  data: any[];
15
15
  borderColor: string;
16
16
  }[] | undefined;
17
- funnelData: ("" | {
17
+ funnelData: {
18
18
  value: any;
19
19
  name: any;
20
- } | undefined)[];
20
+ }[];
21
21
  sankeyData: any[][] | undefined;
22
- singleValueData: ("" | {
23
- value: any;
24
- label: string;
25
- } | undefined)[];
22
+ singleValueData: any[];
26
23
  };
27
24
  export {};
@@ -0,0 +1,3 @@
1
+ import EChartsReact from 'echarts-for-react';
2
+ declare const getChartImage: (chartRef: React.RefObject<EChartsReact>) => string;
3
+ export default getChartImage;
@@ -0,0 +1,7 @@
1
+ import { ChartSettingsType } from '@/types';
2
+ export type GetChartOptionsParams = {
3
+ chartOptions: ChartSettingsType;
4
+ data: Record<string, any>[];
5
+ colors?: string[];
6
+ };
7
+ export declare const getChartOptions: ({ chartOptions, data, colors, }: GetChartOptionsParams) => Record<string, any>;
package/package.json CHANGED
@@ -1,98 +1,110 @@
1
- {
2
- "name": "@databrainhq/plugin",
3
- "version": "0.9.21",
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
- "scripts": {
20
- "serve": "vite --port 3005",
21
- "build:css": "tailwindcss build -i src/index.css -o dist/index.css",
22
- "build": "tsc && vite build",
23
- "husky": "husky install",
24
- "predeploy": "cd example && npm install && npm run build",
25
- "lint": "eslint --ext .tsx,.ts --ignore-path .gitignore --fix src",
26
- "codegen": "graphql-codegen --config codegen.yml -r dotenv/config",
27
- "prepare": "npm run build"
28
- },
29
- "devDependencies": {
30
- "@commitlint/cli": "^17.0.3",
31
- "@commitlint/config-conventional": "^17.0.3",
32
- "@graphql-codegen/cli": "^2.16.4",
33
- "@graphql-codegen/introspection": "^2.2.3",
34
- "@graphql-codegen/typescript": "^2.8.7",
35
- "@graphql-codegen/typescript-operations": "^2.5.12",
36
- "@graphql-codegen/typescript-react-apollo": "^3.3.7",
37
- "@graphql-codegen/typescript-react-query": "^3.6.2",
38
- "@iconify/json": "^2.2.6",
39
- "@svgr/core": "^6.5.1",
40
- "@types/node": "^12.12.38",
41
- "@types/react": "^18.0.26",
42
- "@types/react-datepicker": "^4.11.2",
43
- "@types/react-dom": "^18.0.10",
44
- "@types/react-grid-layout": "^1.3.2",
45
- "@typescript-eslint/eslint-plugin": "^4.31.1",
46
- "@typescript-eslint/parser": "^4.31.1",
47
- "@vitejs/plugin-react": "^1.3.0",
48
- "autoprefixer": "^10.4.7",
49
- "babel-eslint": "^10.0.3",
50
- "cross-env": "^7.0.2",
51
- "eslint": "^7.32.0",
52
- "eslint-config-airbnb": "^18.2.1",
53
- "eslint-config-airbnb-typescript": "^14.0.0",
54
- "eslint-config-prettier": "^8.3.0",
55
- "eslint-plugin-import": "^2.24.2",
56
- "eslint-plugin-jsx-a11y": "^6.6.0",
57
- "eslint-plugin-prettier": "^4.0.0",
58
- "eslint-plugin-react": "^7.30.1",
59
- "eslint-plugin-react-hooks": "^4.6.0",
60
- "eslint-plugin-unicorn": "^36.0.0",
61
- "graphql": "^16.6.0",
62
- "husky": "^8.0.1",
63
- "lint-staged": "^13.0.3",
64
- "postcss": "^8.4.21",
65
- "prettier": "^2.0.4",
66
- "react": "^18.2.0",
67
- "react-dom": "^18.2.0",
68
- "tailwindcss": "^3.2.4",
69
- "ts-node": "^10.9.1",
70
- "typescript": "^4.6.3",
71
- "unplugin-icons": "^0.14.7",
72
- "vite": "^2.9.9",
73
- "vite-plugin-dts": "^1.7.1",
74
- "vite-tsconfig-paths": "^4.0.3"
75
- },
76
- "files": [
77
- "dist"
78
- ],
79
- "dependencies": {
80
- "@headlessui/react": "^1.7.2",
81
- "@tanstack/match-sorter-utils": "^8.8.4",
82
- "@tanstack/react-table": "^8.7.9",
83
- "ace-builds": "^1.17.0",
84
- "classnames": "^2.3.2",
85
- "echarts": "^5.4.1",
86
- "echarts-for-react": "^3.0.2",
87
- "react-ace": "^10.1.0",
88
- "react-datepicker": "^4.11.0",
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.9.23",
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
+ "scripts": {
20
+ "start:repl": "vite --host 0.0.0.0",
21
+ "serve": "vite --port 3005",
22
+ "build:css": "tailwindcss build -i src/index.css -o dist/index.css",
23
+ "build": "tsc && vite build",
24
+ "husky": "husky install",
25
+ "predeploy": "cd example && npm install && npm run build",
26
+ "lint": "eslint --ext .tsx,.ts --ignore-path .gitignore --fix src",
27
+ "codegen": "graphql-codegen --config codegen.yml -r dotenv/config",
28
+ "prepare": "npm run build",
29
+ "storybook:repl": "storybook dev -p 6006 --host 0.0.0.0",
30
+ "storybook": "storybook dev -p 6006",
31
+ "build-storybook": "storybook 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
+ "@storybook/addon-essentials": "^7.0.9",
44
+ "@storybook/addon-interactions": "^7.0.9",
45
+ "@storybook/addon-links": "^7.0.9",
46
+ "@storybook/blocks": "^7.0.9",
47
+ "@storybook/react": "^7.0.9",
48
+ "@storybook/react-vite": "^7.0.9",
49
+ "@storybook/testing-library": "^0.0.14-next.2",
50
+ "@svgr/core": "^6.5.1",
51
+ "@types/react": "^18.0.26",
52
+ "@types/react-datepicker": "^4.11.2",
53
+ "@types/react-dom": "^18.0.10",
54
+ "@types/react-grid-layout": "^1.3.2",
55
+ "@typescript-eslint/eslint-plugin": "^4.31.1",
56
+ "@typescript-eslint/parser": "^4.31.1",
57
+ "@vitejs/plugin-react": "^4.0",
58
+ "autoprefixer": "^10.4.7",
59
+ "babel-eslint": "^10.0.3",
60
+ "cross-env": "^7.0.2",
61
+ "eslint": "^7.32.0",
62
+ "eslint-config-airbnb": "^18.2.1",
63
+ "eslint-config-airbnb-typescript": "^14.0.0",
64
+ "eslint-config-prettier": "^8.3.0",
65
+ "eslint-plugin-import": "^2.24.2",
66
+ "eslint-plugin-jsx-a11y": "^6.6.0",
67
+ "eslint-plugin-prettier": "^4.0.0",
68
+ "eslint-plugin-react": "^7.30.1",
69
+ "eslint-plugin-react-hooks": "^4.6.0",
70
+ "eslint-plugin-unicorn": "^36.0.0",
71
+ "graphql": "^16.6.0",
72
+ "husky": "^8.0.1",
73
+ "lint-staged": "^13.0.3",
74
+ "postcss": "^8.4.21",
75
+ "prettier": "^2.0.4",
76
+ "prop-types": "^15.8.1",
77
+ "react": "^18.2.0",
78
+ "react-dom": "^18.2.0",
79
+ "storybook": "^7.0.9",
80
+ "tailwindcss": "^3.2.4",
81
+ "ts-node": "^10.9.1",
82
+ "typescript": "^4.6.3",
83
+ "unplugin-icons": "^0.14.7",
84
+ "vite": "^4.3",
85
+ "vite-plugin-dts": "^2.3",
86
+ "vite-tsconfig-paths": "^4.0.3"
87
+ },
88
+ "files": [
89
+ "dist"
90
+ ],
91
+ "dependencies": {
92
+ "@headlessui/react": "^1.7.2",
93
+ "@tanstack/match-sorter-utils": "^8.8.4",
94
+ "@tanstack/react-table": "^8.7.9",
95
+ "ace-builds": "^1.17.0",
96
+ "classnames": "^2.3.2",
97
+ "echarts": "^5.4.1",
98
+ "echarts-for-react": "^3.0.2",
99
+ "react-ace": "^10.1.0",
100
+ "react-datepicker": "^4.11.0",
101
+ "react-error-boundary": "^3.1.4",
102
+ "react-grid-layout": "^1.3.4",
103
+ "react-hook-form": "^7.33.1",
104
+ "react-query": "^3.39.2"
105
+ },
106
+ "peerDependencies": {
107
+ "react": "^18.2.0",
108
+ "react-dom": "^18.2.0"
109
+ }
110
+ }
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import { AxisSettings, BackgroundSettings, CustomSettings, LabelSettings, LegendSettings, TableSettings } from '@/types/app';
3
- import { TimeSeriesSettingsType } from '@/types';
4
- declare type Props = {
5
- setMargins: React.Dispatch<React.SetStateAction<Record<string, number>>>;
6
- margins: Record<string, number>;
7
- legendSettings: LegendSettings;
8
- setLegendSettings: React.Dispatch<React.SetStateAction<LegendSettings>>;
9
- labelSettings: LabelSettings;
10
- setLabelSettings: React.Dispatch<React.SetStateAction<LabelSettings>>;
11
- axisSettings: AxisSettings;
12
- setAxisSettings: React.Dispatch<React.SetStateAction<AxisSettings>>;
13
- customSettings: CustomSettings;
14
- setCustomSettings: React.Dispatch<React.SetStateAction<CustomSettings>>;
15
- chartType: any;
16
- setChartType: any;
17
- backGroundColor: BackgroundSettings;
18
- setBackGroundColor: React.Dispatch<React.SetStateAction<BackgroundSettings>>;
19
- tableSettings: TableSettings;
20
- setTableSettings: React.Dispatch<React.SetStateAction<TableSettings>>;
21
- timeSeriesSettings: TimeSeriesSettingsType;
22
- setTimeSeriesSettings: React.Dispatch<React.SetStateAction<TimeSeriesSettingsType>>;
23
- yAxisList: string[];
24
- };
25
- export declare const ChartConfigure: ({ setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, axisSettings, setAxisSettings, chartType, setChartType, customSettings, setCustomSettings, backGroundColor, setBackGroundColor, tableSettings, setTableSettings, setTimeSeriesSettings, timeSeriesSettings, yAxisList, }: Props) => JSX.Element;
26
- export {};
@@ -1,38 +0,0 @@
1
- import React from 'react';
2
- import { AxisSettings, BackgroundSettings, CustomSettings, LabelSettings, LegendSettings, TableSettings } from '@/types/app';
3
- import { TimeSeriesSettingsType } from '@/types';
4
- declare type Props = {
5
- data: any[] | undefined;
6
- chartType: string;
7
- setChartType: React.Dispatch<React.SetStateAction<string>>;
8
- setXAxis: React.Dispatch<React.SetStateAction<string | undefined>>;
9
- setYAxisList: React.Dispatch<React.SetStateAction<string[] | undefined>>;
10
- yAxisList?: string[];
11
- xAxis: string | undefined;
12
- setMeasure: React.Dispatch<React.SetStateAction<string | undefined>>;
13
- setStep: React.Dispatch<React.SetStateAction<string | undefined>>;
14
- step: string | undefined;
15
- measure: string | undefined;
16
- setSankeyValues: React.Dispatch<React.SetStateAction<string[] | undefined>>;
17
- singleValue: string | undefined;
18
- setSingleValue: React.Dispatch<React.SetStateAction<string | undefined>>;
19
- setSettingsShow: React.Dispatch<React.SetStateAction<boolean>>;
20
- setMargins: React.Dispatch<React.SetStateAction<Record<string, number>>>;
21
- margins: Record<string, number>;
22
- legendSettings: LegendSettings;
23
- setLegendSettings: React.Dispatch<React.SetStateAction<LegendSettings>>;
24
- labelSettings: LabelSettings;
25
- setLabelSettings: React.Dispatch<React.SetStateAction<LabelSettings>>;
26
- axisSettings: AxisSettings;
27
- setAxisSettings: React.Dispatch<React.SetStateAction<AxisSettings>>;
28
- customSettings: CustomSettings;
29
- setCustomSettings: React.Dispatch<React.SetStateAction<CustomSettings>>;
30
- backGroundColor: BackgroundSettings;
31
- setBackGroundColor: React.Dispatch<React.SetStateAction<BackgroundSettings>>;
32
- tableSettings: TableSettings;
33
- setTableSettings: React.Dispatch<React.SetStateAction<TableSettings>>;
34
- timeSeriesSettings: TimeSeriesSettingsType;
35
- setTimeSeriesSettings: React.Dispatch<React.SetStateAction<TimeSeriesSettingsType>>;
36
- };
37
- export declare const ChartSettings: ({ chartType, setChartType, data, setXAxis, setYAxisList, yAxisList, xAxis, setMeasure, setStep, step, measure, setSankeyValues, singleValue, setSingleValue, setSettingsShow, setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, axisSettings, setAxisSettings, customSettings, setCustomSettings, backGroundColor, setBackGroundColor, tableSettings, setTableSettings, setTimeSeriesSettings, timeSeriesSettings, }: Props) => JSX.Element;
38
- export {};
@@ -1,2 +0,0 @@
1
- export * from './ChartConfigure';
2
- export * from './ChartSettings';
package/dist/typings.d.ts DELETED
@@ -1,17 +0,0 @@
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,3 +0,0 @@
1
- import EChartsReact from 'echarts-for-react';
2
- declare const handleSaveChartImage: (chartRef: React.RefObject<EChartsReact>) => void;
3
- export default handleSaveChartImage;