@databrainhq/plugin 0.9.18 → 0.9.20

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 (88) hide show
  1. package/dist/components/Alert/index.d.ts +1 -1
  2. package/dist/components/Chart/SingleValueChart.d.ts +16 -0
  3. package/dist/components/Chart/index.d.ts +21 -0
  4. package/dist/components/ChartModal/ChartConfig.d.ts +6 -16
  5. package/dist/components/ChartModal/ChartModalOptions.d.ts +7 -5
  6. package/dist/components/ChartPopup/components/UnderlyingData/index.d.ts +1 -1
  7. package/dist/components/ChartPopup/index.d.ts +1 -1
  8. package/dist/components/ChartSettingsPopup/components/ChartConfigure/index.d.ts +8 -0
  9. package/dist/components/ChartSettingsPopup/components/ChartSettings/index.d.ts +9 -0
  10. package/dist/components/ChartSettingsPopup/index.d.ts +9 -0
  11. package/dist/components/Charts/BarChart.d.ts +1 -1
  12. package/dist/components/Charts/LineChart.d.ts +1 -1
  13. package/dist/components/DataType/index.d.ts +1 -1
  14. package/dist/components/DateRangePicker/index.d.ts +1 -1
  15. package/dist/components/Error/index.d.ts +1 -1
  16. package/dist/components/ExternalMetricForm/index.d.ts +1 -1
  17. package/dist/components/FilterDropDown/index.d.ts +2 -2
  18. package/dist/components/FilterField/index.d.ts +2 -2
  19. package/dist/components/FloatingDropDown/index.d.ts +2 -2
  20. package/dist/components/FullScreenChart/index.d.ts +3 -4
  21. package/dist/components/GlobalFilters/AddFilter.d.ts +2 -2
  22. package/dist/components/GlobalFilters/AppliedFilter.d.ts +1 -1
  23. package/dist/components/GlobalFilters/NumberFilterField.d.ts +1 -1
  24. package/dist/components/GlobalFilters/index.d.ts +2 -2
  25. package/dist/components/Icons/index.d.ts +1 -1
  26. package/dist/components/InfoTooltip/index.d.ts +1 -1
  27. package/dist/components/MetricChart/ChartImageDownloadButton.d.ts +4 -4
  28. package/dist/components/MetricChart/CsvDownloadButton.d.ts +1 -1
  29. package/dist/components/MetricChart/MetricChart.d.ts +1 -1
  30. package/dist/components/MetricChart/index.d.ts +1 -0
  31. package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
  32. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +6 -50
  33. package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +1 -1
  34. package/dist/components/MetricCreation/components/MetricOutput/components/index.d.ts +0 -1
  35. package/dist/components/MetricFilterDropDown/index.d.ts +1 -1
  36. package/dist/components/MetricList/MetricList.d.ts +3 -4
  37. package/dist/components/MetricList/components/{DownloadRawCsvModal.d.ts → DownloadRawCsvModal/index.d.ts} +1 -1
  38. package/dist/components/MetricList/components/FullScreenView/DownloadButton.d.ts +9 -0
  39. package/dist/components/MetricList/components/FullScreenView/index.d.ts +18 -0
  40. package/dist/components/MetricList/components/{LayoutAlert.d.ts → LayoutAlert/index.d.ts} +1 -1
  41. package/dist/components/MetricList/components/{MetricCard.d.ts → MetricCards/MetricCard.d.ts} +5 -6
  42. package/dist/components/MetricList/components/MetricCards/NoDataLoading.d.ts +7 -0
  43. package/dist/components/MetricList/components/{SingleValueCard.d.ts → MetricCards/SingleValueCard.d.ts} +1 -1
  44. package/dist/components/MetricList/components/{TableViewModal.d.ts → TableViewModal/index.d.ts} +1 -1
  45. package/dist/components/MetricList/components/index.d.ts +8 -0
  46. package/dist/components/MetricList/index.d.ts +1 -6
  47. package/dist/components/MetricTable/index.d.ts +1 -1
  48. package/dist/components/Modal/ModalFooter.d.ts +1 -1
  49. package/dist/components/PopoverMenu/index.d.ts +1 -1
  50. package/dist/components/ScheduleEmail/ScheduleEmailForm/index.d.ts +1 -1
  51. package/dist/components/Select/index.d.ts +5 -5
  52. package/dist/components/Tab/index.d.ts +1 -1
  53. package/dist/components/Table/DebouncedInput.d.ts +1 -1
  54. package/dist/components/Table/index.d.ts +4 -2
  55. package/dist/components/TagInputField/index.d.ts +1 -1
  56. package/dist/components/TimeGrainField/index.d.ts +1 -1
  57. package/dist/components/ToggleButton/SwitchInput.d.ts +1 -1
  58. package/dist/components/ToggleButton/ToggleInput.d.ts +1 -1
  59. package/dist/components/ToggleButton/index.d.ts +1 -1
  60. package/dist/components/index.d.ts +2 -0
  61. package/dist/consts/metricOptions.d.ts +4 -0
  62. package/dist/containers/Dashboard/Dashboard.d.ts +1 -1
  63. package/dist/containers/Dashboard/DashboardProvider.d.ts +1 -1
  64. package/dist/helpers/getTimeFilterValue.d.ts +1 -1
  65. package/dist/helpers/timeseries.d.ts +6 -6
  66. package/dist/hooks/index.d.ts +1 -0
  67. package/dist/hooks/useClientDashboardLayout.d.ts +1 -1
  68. package/dist/hooks/useExternalMetric.d.ts +3 -20
  69. package/dist/hooks/useGenerateEmbeddedMetric.d.ts +1 -1
  70. package/dist/hooks/useMetricCard.d.ts +37 -0
  71. package/dist/hooks/useOutsideAlerter.d.ts +1 -1
  72. package/dist/hooks/useScheduleEmail.d.ts +1 -1
  73. package/dist/index.es.js +86971 -128199
  74. package/dist/index.umd.js +298 -242
  75. package/dist/style.css +1 -1
  76. package/dist/types/app.d.ts +119 -61
  77. package/dist/types/metricCreate.d.ts +13 -87
  78. package/dist/utils/generated/graphql.d.ts +437 -437
  79. package/dist/utils/getChartAttributes.d.ts +5 -8
  80. package/dist/utils/getChartImage.d.ts +3 -0
  81. package/dist/utils/getChartOptions.d.ts +7 -0
  82. package/package.json +18 -6
  83. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartConfigure/index.d.ts +0 -26
  84. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartSettings/index.d.ts +0 -38
  85. package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/index.d.ts +0 -2
  86. package/dist/typings.d.ts +0 -17
  87. package/dist/utils/handleSaveChartImage.d.ts +0 -3
  88. /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,6 +1,6 @@
1
1
  {
2
2
  "name": "@databrainhq/plugin",
3
- "version": "0.9.18",
3
+ "version": "0.9.20",
4
4
  "description": "Databrain app dashboard ui plugin.",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -17,6 +17,7 @@
17
17
  "./dist/style.css": "./dist/style.css"
18
18
  },
19
19
  "scripts": {
20
+ "start:repl": "vite --host 0.0.0.0",
20
21
  "serve": "vite --port 3005",
21
22
  "build:css": "tailwindcss build -i src/index.css -o dist/index.css",
22
23
  "build": "tsc && vite build",
@@ -24,7 +25,10 @@
24
25
  "predeploy": "cd example && npm install && npm run build",
25
26
  "lint": "eslint --ext .tsx,.ts --ignore-path .gitignore --fix src",
26
27
  "codegen": "graphql-codegen --config codegen.yml -r dotenv/config",
27
- "prepare": "npm run build"
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"
28
32
  },
29
33
  "devDependencies": {
30
34
  "@commitlint/cli": "^17.0.3",
@@ -36,15 +40,21 @@
36
40
  "@graphql-codegen/typescript-react-apollo": "^3.3.7",
37
41
  "@graphql-codegen/typescript-react-query": "^3.6.2",
38
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",
39
50
  "@svgr/core": "^6.5.1",
40
- "@types/node": "^12.12.38",
41
51
  "@types/react": "^18.0.26",
42
52
  "@types/react-datepicker": "^4.11.2",
43
53
  "@types/react-dom": "^18.0.10",
44
54
  "@types/react-grid-layout": "^1.3.2",
45
55
  "@typescript-eslint/eslint-plugin": "^4.31.1",
46
56
  "@typescript-eslint/parser": "^4.31.1",
47
- "@vitejs/plugin-react": "^1.3.0",
57
+ "@vitejs/plugin-react": "^4.0",
48
58
  "autoprefixer": "^10.4.7",
49
59
  "babel-eslint": "^10.0.3",
50
60
  "cross-env": "^7.0.2",
@@ -63,14 +73,16 @@
63
73
  "lint-staged": "^13.0.3",
64
74
  "postcss": "^8.4.21",
65
75
  "prettier": "^2.0.4",
76
+ "prop-types": "^15.8.1",
66
77
  "react": "^18.2.0",
67
78
  "react-dom": "^18.2.0",
79
+ "storybook": "^7.0.9",
68
80
  "tailwindcss": "^3.2.4",
69
81
  "ts-node": "^10.9.1",
70
82
  "typescript": "^4.6.3",
71
83
  "unplugin-icons": "^0.14.7",
72
- "vite": "^2.9.9",
73
- "vite-plugin-dts": "^1.7.1",
84
+ "vite": "^4.3",
85
+ "vite-plugin-dts": "^2.3",
74
86
  "vite-tsconfig-paths": "^4.0.3"
75
87
  },
76
88
  "files": [
@@ -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;