@devtable/dashboard 2.3.0 → 2.6.0

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 (124) hide show
  1. package/dist/api-caller/index.d.ts +14 -8
  2. package/dist/api-caller/types.d.ts +1 -1
  3. package/dist/contexts/dashboard-action-context.d.ts +1 -1
  4. package/dist/contexts/index.d.ts +1 -3
  5. package/dist/contexts/layout-state-context.d.ts +2 -2
  6. package/dist/contexts/model-context.d.ts +24165 -0
  7. package/dist/contexts/panel-context.d.ts +2 -3
  8. package/dist/dashboard.es.js +8102 -4305
  9. package/dist/dashboard.umd.js +41 -5
  10. package/dist/definition-editor/data-editor-modal.d.ts +2 -2
  11. package/dist/definition-editor/global-variables-guide.d.ts +3 -3
  12. package/dist/definition-editor/query-editor/data-preview.d.ts +3 -3
  13. package/dist/definition-editor/query-editor/editor.d.ts +2 -2
  14. package/dist/definition-editor/query-editor/form.d.ts +4 -5
  15. package/dist/definition-editor/query-editor/index.d.ts +2 -2
  16. package/dist/definition-editor/query-editor/select-or-add-query.d.ts +2 -2
  17. package/dist/definition-editor/sql-snippet-editor/editor.d.ts +2 -2
  18. package/dist/filter/filter-checkbox/editor.d.ts +3 -5
  19. package/dist/filter/filter-checkbox/render.d.ts +3 -2
  20. package/dist/filter/filter-date-range/editor.d.ts +3 -6
  21. package/dist/filter/filter-date-range/render.d.ts +3 -2
  22. package/dist/filter/filter-multi-select/editor.d.ts +3 -7
  23. package/dist/filter/filter-multi-select/render.d.ts +4 -3
  24. package/dist/filter/filter-query-field/index.d.ts +5 -5
  25. package/dist/filter/filter-query-field/select-data-source.d.ts +5 -5
  26. package/dist/filter/filter-query-field/test-query.d.ts +7 -0
  27. package/dist/filter/filter-select/editor.d.ts +3 -7
  28. package/dist/filter/filter-select/render.d.ts +3 -2
  29. package/dist/filter/filter-settings/filter-setting.d.ts +4 -7
  30. package/dist/filter/filter-settings/filter-settings.d.ts +2 -5
  31. package/dist/filter/filter-settings/index.d.ts +2 -5
  32. package/dist/filter/filter-settings/preview-filter.d.ts +4 -8
  33. package/dist/filter/filter-text-input/editor.d.ts +3 -6
  34. package/dist/filter/filter-text-input/render.d.ts +3 -2
  35. package/dist/filter/filter.d.ts +3 -3
  36. package/dist/filter/index.d.ts +2 -6
  37. package/dist/index.d.ts +1 -0
  38. package/dist/layout/index.d.ts +3 -3
  39. package/dist/layout/read-only.d.ts +3 -3
  40. package/dist/main/actions.d.ts +3 -5
  41. package/dist/main/full-screen-panel.d.ts +3 -3
  42. package/dist/main/main.d.ts +5 -5
  43. package/dist/main/read-only.d.ts +4 -4
  44. package/dist/main/toggle-mode.d.ts +2 -2
  45. package/dist/main/use-panel-full-screen.d.ts +1 -1
  46. package/dist/main/use-sticky-area-style.d.ts +1 -0
  47. package/dist/model/context.d.ts +11 -0
  48. package/dist/model/dashboard.d.ts +15998 -0
  49. package/dist/model/filters/filter/checkbox.d.ts +16 -0
  50. package/dist/model/filters/filter/common.d.ts +14 -0
  51. package/dist/model/filters/filter/date-range.d.ts +28 -0
  52. package/dist/model/filters/filter/index.d.ts +172 -0
  53. package/dist/model/filters/filter/multi-select.d.ts +81 -0
  54. package/dist/model/filters/filter/select.d.ts +95 -0
  55. package/dist/model/filters/filter/text-input.d.ts +22 -0
  56. package/dist/model/filters/index.d.ts +3542 -0
  57. package/dist/model/index.d.ts +5 -0
  58. package/dist/model/queries/index.d.ts +116 -0
  59. package/dist/model/queries/mute-query.d.ts +17 -0
  60. package/dist/model/queries/query.d.ts +31 -0
  61. package/dist/model/queries/types.d.ts +5 -0
  62. package/dist/model/sql-snippets/index.d.ts +26 -0
  63. package/dist/model/sql-snippets/sql-snippet.d.ts +9 -0
  64. package/dist/panel/error-boundary.d.ts +1 -1
  65. package/dist/panel/index.d.ts +2 -2
  66. package/dist/panel/settings/common/aggregation-selector.d.ts +2 -2
  67. package/dist/panel/settings/common/color-array-input.d.ts +1 -1
  68. package/dist/panel/settings/common/data-field-selector.d.ts +2 -2
  69. package/dist/panel/settings/common/mantine-color.d.ts +1 -1
  70. package/dist/panel/settings/common/mantine-font-weight.d.ts +1 -1
  71. package/dist/panel/settings/common/numbro-format-selector.d.ts +1 -1
  72. package/dist/panel/settings/common/text-array-input.d.ts +1 -1
  73. package/dist/panel/settings/index.d.ts +2 -2
  74. package/dist/panel/settings/pick-query/index.d.ts +2 -2
  75. package/dist/panel/title-bar.d.ts +2 -2
  76. package/dist/panel/viz/bar-3d/panel.d.ts +1 -1
  77. package/dist/panel/viz/cartesian/panel/index.d.ts +1 -1
  78. package/dist/panel/viz/cartesian/panel/regressions/index.d.ts +2 -2
  79. package/dist/panel/viz/cartesian/panel/regressions/regression-item.d.ts +2 -2
  80. package/dist/panel/viz/cartesian/panel/series/fields.bar.d.ts +3 -3
  81. package/dist/panel/viz/cartesian/panel/series/index.d.ts +2 -2
  82. package/dist/panel/viz/cartesian/panel/series/series-item.d.ts +2 -2
  83. package/dist/panel/viz/cartesian/panel/stats/index.d.ts +2 -2
  84. package/dist/panel/viz/cartesian/panel/stats/variable.d.ts +2 -2
  85. package/dist/panel/viz/cartesian/panel/y-axes.d.ts +2 -2
  86. package/dist/panel/viz/cartesian/type.d.ts +3 -3
  87. package/dist/panel/viz/index.d.ts +3 -3
  88. package/dist/panel/viz/pie/panel.d.ts +1 -1
  89. package/dist/panel/viz/rich-text/panel.d.ts +1 -1
  90. package/dist/panel/viz/rich-text/type.d.ts +1 -1
  91. package/dist/panel/viz/stats/panel/index.d.ts +3 -3
  92. package/dist/panel/viz/stats/panel/variable.d.ts +2 -2
  93. package/dist/panel/viz/stats/panel/variables.d.ts +2 -2
  94. package/dist/panel/viz/stats/types.d.ts +1 -1
  95. package/dist/panel/viz/stats/update/index.d.ts +2 -2
  96. package/dist/panel/viz/sunburst/panel.d.ts +1 -1
  97. package/dist/panel/viz/table/index.d.ts +1 -1
  98. package/dist/panel/viz/table/panel.d.ts +1 -1
  99. package/dist/panel/viz/table/value-type-selector.d.ts +1 -1
  100. package/dist/panel/viz/table/value.d.ts +1 -1
  101. package/dist/plugins/json-plugin-storage.d.ts +8 -0
  102. package/dist/plugins/message-channels.d.ts +8 -0
  103. package/dist/plugins/plugin-context.d.ts +12 -0
  104. package/dist/plugins/plugin-manager.d.ts +18 -0
  105. package/dist/plugins/viz-manager/components.d.ts +23 -0
  106. package/dist/plugins/viz-manager/impl.d.ts +10 -0
  107. package/dist/plugins/viz-manager/index.d.ts +3 -0
  108. package/dist/plugins/viz-manager/types.d.ts +12 -0
  109. package/dist/style.css +1 -1
  110. package/dist/types/dashboard.d.ts +6 -14
  111. package/dist/types/filter.d.ts +6 -38
  112. package/dist/types/plugin/index.d.ts +97 -0
  113. package/dist/types/viz-panel.d.ts +1 -1
  114. package/dist/utils/download.d.ts +6 -0
  115. package/dist/utils/sql.d.ts +7 -6
  116. package/dist/utils/template/editor.d.ts +3 -3
  117. package/dist/utils/template/render.d.ts +1 -1
  118. package/dist/utils/template/types.d.ts +2 -2
  119. package/package.json +22 -4
  120. package/dist/contexts/context-info-context.d.ts +0 -5
  121. package/dist/contexts/definition-context.d.ts +0 -7
  122. package/dist/contexts/filter-values-context.d.ts +0 -4
  123. package/dist/filter/filter-settings/types.d.ts +0 -4
  124. package/dist/main/use-filters.d.ts +0 -8
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ import { IPanelInfoEditor } from '../../types/plugin';
3
+ import { IPanelInfo, IVizManager } from './types';
4
+ export declare type IViewPanelInfo = IPanelInfo & {
5
+ layout: {
6
+ w: number;
7
+ h: number;
8
+ };
9
+ };
10
+ export declare type IViewComponentProps<TDebug = {}> = {
11
+ panel: IViewPanelInfo;
12
+ data: any;
13
+ vizManager: IVizManager;
14
+ } & TDebug;
15
+ export declare const VizViewComponent: <T>(props: IViewComponentProps<T>) => JSX.Element;
16
+ declare type IConfigComponentProps<TDebug = {}> = {
17
+ panel: IPanelInfo;
18
+ panelInfoEditor: IPanelInfoEditor;
19
+ vizManager: IVizManager;
20
+ data: any;
21
+ } & TDebug;
22
+ export declare const VizConfigComponent: <T>(props: IConfigComponentProps<T>) => JSX.Element;
23
+ export {};
@@ -0,0 +1,10 @@
1
+ import { IPluginManager, VizComponent } from '../../types/plugin';
2
+ import { IPanelInfo, IVizManager, VizInstanceInfo } from './types';
3
+ export declare class VizManager implements IVizManager {
4
+ private pluginManager;
5
+ private instances;
6
+ constructor(pluginManager: IPluginManager);
7
+ get availableVizList(): VizComponent[];
8
+ resolveComponent(name: string): VizComponent;
9
+ getOrCreateInstance(panel: IPanelInfo): VizInstanceInfo;
10
+ }
@@ -0,0 +1,3 @@
1
+ export { VizManager } from './impl';
2
+ export type { IVizManager, IPanelInfo } from './types';
3
+ export { VizConfigComponent, VizViewComponent } from './components';
@@ -0,0 +1,12 @@
1
+ import { IDashboardPanel } from '../../types';
2
+ import { IMessageChannels, PluginStorage, VizComponent, VizInstance } from '../../types/plugin';
3
+ export declare type IPanelInfo = Omit<IDashboardPanel, 'layout'>;
4
+ export interface IVizManager {
5
+ readonly availableVizList: VizComponent[];
6
+ resolveComponent(type: string): VizComponent;
7
+ getOrCreateInstance(panel: IPanelInfo): VizInstanceInfo;
8
+ }
9
+ export interface VizInstanceInfo extends VizInstance {
10
+ messageChannels: IMessageChannels;
11
+ instanceData: PluginStorage;
12
+ }
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .viz-root{width:100%;overflow:scroll;padding-top:5px;height:calc(100% - 25px);background-color:#fff}.panel-title-wrapper{text-align:center;transition:background-color .3s ease}.panel-title-wrapper:hover{cursor:pointer;background-color:#6464640d}.panel-root{padding:5px;height:100%;width:100%;max-width:100%;background:transparent;border-radius:5px;box-shadow:0 0 10px #0003}.mantine-Tabs-root{width:100%;height:calc(100% - 25px);overflow:hidden;display:flex;justify-content:flex-start;flex-direction:column;flex-wrap:nowrap}.mantine-Tabs-tabsListWrapper{flex:0}.mantine-Tabs-body{flex:1;overflow:scroll}.dashboard-layout{margin-left:-10px;margin-right:-10px}.react-grid-item{padding:0}.remove-panel{position:absolute;right:2px;top:0;cursor:pointer}.code-textarea textarea{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}
1
+ .viz-root{width:100%;overflow:scroll;padding-top:5px;height:calc(100% - 25px);background-color:#fff}.panel-title-wrapper{text-align:center;transition:background-color .3s ease}.panel-title-wrapper:hover{cursor:pointer;background-color:#6464640d}.panel-root{padding:5px;height:100%;width:100%;max-width:100%;background:transparent;border-radius:5px;box-shadow:0 0 10px #0003}.panel-settings-tabs{width:100%;height:100%}.panel-settings-tabs .mantine-Tabs-panel{height:calc(100% - 25px)}.panel-settings-tabs .mantine-Tabs-tabsListWrapper{flex:0}.panel-settings-tabs .mantine-Tabs-body{flex:1;overflow:scroll}.dashboard-layout{margin-left:-10px;margin-right:-10px}.react-grid-item{padding:0}.remove-panel{position:absolute;right:2px;top:0;cursor:pointer}.code-textarea textarea{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.filter-settings-tabs{width:100%;height:100%}.filter-settings-tabs .mantine-Tabs-panel{height:calc(100% - 25px)}.filter-settings-tabs .mantine-Tabs-tabsListWrapper{flex:0}.filter-settings-tabs .mantine-Tabs-body{flex:1;overflow:scroll}.dashboard-root{overflow:scroll;padding:0 10px 10px}.dashboard-sticky-area{z-index:100;background:white;margin:0 -10px;padding:0 10px 10px}
@@ -1,14 +1,10 @@
1
- import { IDashboardFilter } from "./filter";
1
+ import { FilterModelInstance } from '../model';
2
+ import { QueryModelInstance } from '../model/queries';
3
+ import { SQLSnippetModelInstance } from '../model/sql-snippets';
2
4
  export interface IVizConfig {
3
5
  type: string;
4
6
  conf: Record<string, any>;
5
7
  }
6
- export interface IQuery {
7
- type: 'postgresql';
8
- key: string;
9
- sql: string;
10
- id: string;
11
- }
12
8
  export interface IDashboardPanel {
13
9
  id: string;
14
10
  title: string;
@@ -29,20 +25,16 @@ export declare enum DashboardMode {
29
25
  Layout = "layout",
30
26
  Edit = "edit"
31
27
  }
32
- export interface ISQLSnippet {
33
- key: string;
34
- value: string;
35
- }
36
28
  export interface IDashboardDefinition {
37
- sqlSnippets: ISQLSnippet[];
38
- queries: IQuery[];
29
+ sqlSnippets: SQLSnippetModelInstance[];
30
+ queries: QueryModelInstance[];
39
31
  }
40
32
  export interface IDashboard {
41
33
  id: string;
42
34
  name: string;
43
35
  definition: IDashboardDefinition;
44
36
  panels: IDashboardPanel[];
45
- filters: IDashboardFilter[];
37
+ filters: FilterModelInstance[];
46
38
  }
47
39
  export interface IDashboardConfig {
48
40
  apiBaseURL: string;
@@ -1,39 +1,7 @@
1
- export interface IDashboardFilterOption {
2
- label: string;
3
- value: string;
4
- }
5
- export interface IDashboardFilterOptionQuery {
6
- type: 'postgresql';
7
- key: string;
8
- sql: string;
9
- }
10
- export interface IFilterConfig_Select {
11
- required: boolean;
12
- default_value: string;
13
- static_options: IDashboardFilterOption[];
14
- options_query: IDashboardFilterOptionQuery;
15
- }
16
- export interface IFilterConfig_MultiSelect {
17
- default_value: string[];
18
- static_options: IDashboardFilterOption[];
19
- options_query: IDashboardFilterOptionQuery;
20
- }
21
- export interface IFilterConfig_TextInput {
22
- required: boolean;
23
- default_value: string;
24
- }
25
- export interface IFilterConfig_DateRange {
26
- inputFormat: 'YYYY' | 'YYYY-MM' | 'YYYY-MM-DD';
27
- clearable: boolean;
28
- required: boolean;
29
- }
30
- export interface IFilterConfig_Checkbox {
31
- default_value: boolean;
32
- }
33
- export interface IDashboardFilter {
34
- key: string;
35
- label: string;
36
- order: number;
37
- type: 'select' | 'multi-select' | 'text-input' | 'checkbox' | 'date-range';
38
- config: IFilterConfig_Select | IFilterConfig_MultiSelect | IFilterConfig_TextInput | IFilterConfig_DateRange | IFilterConfig_Checkbox;
1
+ export declare enum DashboardFilterType {
2
+ Select = "select",
3
+ MultiSelect = "multi-select",
4
+ TextInput = "text-input",
5
+ Checkbox = "checkbox",
6
+ DateRange = "date-range"
39
7
  }
@@ -0,0 +1,97 @@
1
+ import EventEmitter2 from 'eventemitter2';
2
+ import React from 'react';
3
+ /**
4
+ * Basic information of a viz component instance
5
+ */
6
+ export interface VizInstance {
7
+ id: string;
8
+ name: string;
9
+ }
10
+ /**
11
+ * Props to render the view of viz component
12
+ */
13
+ export interface VizViewProps {
14
+ instance: VizInstance;
15
+ context: VizViewContext;
16
+ }
17
+ export interface PluginStorage {
18
+ getItem<T>(key: string): Promise<T>;
19
+ setItem<T>(key: string, item: T): Promise<T>;
20
+ deleteItem(key: string): Promise<void>;
21
+ }
22
+ export interface ColorPaletteItem {
23
+ name: string;
24
+ type: string;
25
+ category: string;
26
+ }
27
+ export interface SingleColor extends ColorPaletteItem {
28
+ type: 'single';
29
+ value: string;
30
+ }
31
+ export interface ColorInterpolation extends ColorPaletteItem {
32
+ type: 'interpolation';
33
+ interpolation: (value: number) => string;
34
+ }
35
+ export interface ColorPalette {
36
+ getColor(colorInfo: ColorPaletteItem): (value: unknown) => string;
37
+ }
38
+ export interface IMessageChannels {
39
+ globalChannel: EventEmitter2;
40
+ getChannel(name: string): EventEmitter2;
41
+ close(name: string): void;
42
+ }
43
+ export interface VizContext {
44
+ pluginData: PluginStorage;
45
+ instanceData: PluginStorage;
46
+ colorPalette: ColorPalette;
47
+ locale: string;
48
+ msgChannels: IMessageChannels;
49
+ data: unknown;
50
+ }
51
+ declare type Setter<T> = (val: string) => void;
52
+ export interface IPanelInfoEditor {
53
+ setTitle: Setter<string>;
54
+ setDescription: Setter<string>;
55
+ setQueryID: Setter<string>;
56
+ }
57
+ export interface VizConfigContext extends VizContext {
58
+ panelInfoEditor: IPanelInfoEditor;
59
+ }
60
+ export interface VizViewContext extends VizContext {
61
+ viewport: {
62
+ width: number;
63
+ height: number;
64
+ };
65
+ }
66
+ export interface VizConfigProps {
67
+ instance: VizInstance;
68
+ context: VizConfigContext;
69
+ }
70
+ export interface VizComponentMigrationContext {
71
+ pluginData: PluginStorage;
72
+ instanceData: PluginStorage;
73
+ }
74
+ export interface VizComponent {
75
+ name: string;
76
+ displayName?: string;
77
+ viewRender: React.ComponentType<VizViewProps>;
78
+ configRender: React.ComponentType<VizConfigProps>;
79
+ migration: (ctx: VizComponentMigrationContext) => Promise<void>;
80
+ }
81
+ export interface IPluginManifest {
82
+ viz: VizComponent[];
83
+ color: ColorPaletteItem[];
84
+ }
85
+ export interface IDashboardPlugin {
86
+ id: string;
87
+ version: string;
88
+ manifest: IPluginManifest;
89
+ }
90
+ export interface IPluginManager {
91
+ install(plugin: IDashboardPlugin): void;
92
+ installedPlugins: IDashboardPlugin[];
93
+ factory: {
94
+ viz: (name: string) => VizComponent;
95
+ };
96
+ }
97
+ export {};
@@ -1,4 +1,4 @@
1
- import { IVizConfig } from "./dashboard";
1
+ import { IVizConfig } from './dashboard';
2
2
  export interface IVizPanelProps {
3
3
  conf: IVizConfig['conf'];
4
4
  setConf: (conf: IVizConfig['conf']) => void;
@@ -0,0 +1,6 @@
1
+ export declare function downloadCSV(id: string, csv: string): void;
2
+ export declare function downloadDataListAsZip(idDataList: Array<{
3
+ id: string;
4
+ data: any[];
5
+ }>): void;
6
+ export declare function makeCSV(data: any | any[]): string;
@@ -1,8 +1,9 @@
1
- import { ContextInfoContextType, FilterValuesContextType } from "../contexts";
2
- import { IDashboardDefinition } from "../types";
3
- export declare function explainSQLSnippet(snippet: string, context: ContextInfoContextType): any;
1
+ import { FilterValuesType } from '../model';
2
+ import { ContextInfoType } from '../model/context';
3
+ import { SQLSnippetModelInstance } from '../model/sql-snippets';
4
+ export declare function explainSQLSnippet(snippet: string, context: ContextInfoType): any;
4
5
  export declare function formatSQL(sql: string, params: Record<string, any>): any;
5
- export declare function getSQLParams(context: ContextInfoContextType, definitions: IDashboardDefinition, filterValues: FilterValuesContextType): Record<string, any> & ContextInfoContextType & {
6
- filters: FilterValuesContextType;
6
+ export declare function getSQLParams(context: ContextInfoType, sqlSnippets: SQLSnippetModelInstance[], filterValues: FilterValuesType): Record<string, any> & ContextInfoType & {
7
+ filters: FilterValuesType;
7
8
  };
8
- export declare function explainSQL(sql: string, context: ContextInfoContextType, definitions: IDashboardDefinition, filterValues: FilterValuesContextType): any;
9
+ export declare function explainSQL(sql: string, context: ContextInfoType, sqlSnippets: SQLSnippetModelInstance[], filterValues: FilterValuesType): any;
@@ -1,6 +1,6 @@
1
- import { TextInputProps } from "@mantine/core";
2
- import React, { ChangeEventHandler } from "react";
3
- import { ITemplateVariable } from "./types";
1
+ import { TextInputProps } from '@mantine/core';
2
+ import React, { ChangeEventHandler } from 'react';
3
+ import { ITemplateVariable } from './types';
4
4
  export declare function getANewVariable(): ITemplateVariable;
5
5
  interface ITemplateInput extends Omit<TextInputProps, 'value' | 'onChange'> {
6
6
  value: string;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { ITemplateVariable } from "./types";
2
+ import { ITemplateVariable } from './types';
3
3
  export declare function templateToJSX(template: string, variables: ITemplateVariable[], data: Record<string, number>[]): (JSX.Element | import("react").ReactNode[])[];
@@ -1,5 +1,5 @@
1
- import { TNumbroFormat } from "../../panel/settings/common/numbro-format-selector";
2
- import { AggregationType } from "../aggregation";
1
+ import { TNumbroFormat } from '../../panel/settings/common/numbro-format-selector';
2
+ import { AggregationType } from '../aggregation';
3
3
  export declare type ColorConfType = {
4
4
  type: 'static';
5
5
  staticColor: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtable/dashboard",
3
- "version": "2.3.0",
3
+ "version": "2.6.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,9 +24,16 @@
24
24
  "scripts": {
25
25
  "dev-build": "tsc && vite build --watch",
26
26
  "build": "tsc && vite build",
27
- "preview": "vite preview"
27
+ "preview": "vite preview",
28
+ "test": "vitest",
29
+ "test:ui": "vitest --ui",
30
+ "coverage": "vitest --coverage"
28
31
  },
29
32
  "dependencies": {
33
+ "eventemitter2": "^6.4.6",
34
+ "file-saver": "2.0.5",
35
+ "stickybits": "3.7.11",
36
+ "jszip": "3.10.1",
30
37
  "popmotion": "^11.0.3"
31
38
  },
32
39
  "devDependencies": {
@@ -38,17 +45,24 @@
38
45
  "@mantine/notifications": "^5.0.2",
39
46
  "@mantine/prism": "^5.0.2",
40
47
  "@mantine/rte": "^5.0.2",
48
+ "@testing-library/jest-dom": "^5.16.4",
49
+ "@testing-library/react": "^13.3.0",
50
+ "@testing-library/react-hooks": "^8.0.1",
51
+ "@testing-library/user-event": "^14.3.0",
52
+ "@types/file-saver": "2.0.5",
41
53
  "@types/lodash": "^4.14.182",
42
54
  "@types/react": "^18.0.0",
43
55
  "@types/react-dom": "^18.0.0",
44
56
  "@types/react-grid-layout": "^1.3.2",
45
57
  "@vitejs/plugin-react": "^1.3.0",
58
+ "@vitest/ui": "^0.19.1",
46
59
  "ahooks": "^3.3.11",
47
60
  "axios": "^0.27.2",
48
61
  "echarts": "^5.3.2",
49
62
  "echarts-for-react": "^3.0.2",
50
63
  "echarts-gl": "^2.0.9",
51
64
  "echarts-stat": "1.2.0",
65
+ "jsdom": "^20.0.0",
52
66
  "lodash": "^4.17.21",
53
67
  "numbro": "^2.3.6",
54
68
  "react-grid-layout": "^1.3.4",
@@ -56,8 +70,9 @@
56
70
  "rollup-plugin-visualizer": "5.6.0",
57
71
  "tabler-icons-react": "^1.48.0",
58
72
  "typescript": "^4.6.3",
59
- "vite": "^2.9.9",
60
- "vite-plugin-dts": "^1.1.1"
73
+ "vite": "^3.0.3",
74
+ "vite-plugin-dts": "^1.1.1",
75
+ "vitest": "^0.19.1"
61
76
  },
62
77
  "peerDependencies": {
63
78
  "@emotion/react": "11.10.0",
@@ -76,6 +91,9 @@
76
91
  "echarts-gl": "^2.0.9",
77
92
  "echarts-stat": "1.2.0",
78
93
  "lodash": "^4.17.21",
94
+ "mobx": "^6.6.1",
95
+ "mobx-react-lite": "^3.4.0",
96
+ "mobx-state-tree": "^5.1.5",
79
97
  "numbro": "^2.3.6",
80
98
  "react": "^16.8.0 || 17.x || 18.x",
81
99
  "react-dom": "^16.8.0 || 17.x || 18.x",
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- export declare type TimeRangeType = [Date | null, Date | null];
3
- export declare type ContextInfoContextType = Record<string, TimeRangeType | any | any[]>;
4
- export declare const initialContextInfoContext: {};
5
- export declare const ContextInfoContext: React.Context<ContextInfoContextType>;
@@ -1,7 +0,0 @@
1
- import React from "react";
2
- import { IDashboardDefinition, IQuery, ISQLSnippet } from "../types";
3
- export interface IDefinitionContext extends IDashboardDefinition {
4
- setSQLSnippets: React.Dispatch<React.SetStateAction<ISQLSnippet[]>>;
5
- setQueries: React.Dispatch<React.SetStateAction<IQuery[]>>;
6
- }
7
- export declare const DefinitionContext: React.Context<IDefinitionContext>;
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- export declare type FilterValuesContextType = Record<string, any>;
3
- export declare const initialFilterValuesContext: {};
4
- export declare const FilterValuesContext: React.Context<FilterValuesContextType>;
@@ -1,4 +0,0 @@
1
- import { IDashboardFilter } from "../../types";
2
- export interface IFilterSettingsForm {
3
- filters: IDashboardFilter[];
4
- }
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import { IDashboard, IDashboardFilter } from "../types";
3
- export declare function useFilters(dashboard: IDashboard): {
4
- filters: IDashboardFilter[];
5
- setFilters: React.Dispatch<React.SetStateAction<IDashboardFilter[]>>;
6
- filterValues: Record<string, any>;
7
- setFilterValues: React.Dispatch<React.SetStateAction<Record<string, any>>>;
8
- };