@devtable/dashboard 2.2.0 → 2.5.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 (122) hide show
  1. package/dist/dashboard.es.js +8052 -4307
  2. package/dist/dashboard.umd.js +41 -5
  3. package/package.json +22 -5
  4. package/dist/api-caller/index.d.ts +0 -20
  5. package/dist/api-caller/request.d.ts +0 -5
  6. package/dist/api-caller/types.d.ts +0 -11
  7. package/dist/contexts/context-info-context.d.ts +0 -5
  8. package/dist/contexts/dashboard-action-context.d.ts +0 -9
  9. package/dist/contexts/definition-context.d.ts +0 -7
  10. package/dist/contexts/filter-values-context.d.ts +0 -4
  11. package/dist/contexts/index.d.ts +0 -5
  12. package/dist/contexts/layout-state-context.d.ts +0 -11
  13. package/dist/contexts/panel-context.d.ts +0 -17
  14. package/dist/definition-editor/data-editor-modal.d.ts +0 -7
  15. package/dist/definition-editor/global-variables-guide.d.ts +0 -8
  16. package/dist/definition-editor/index.d.ts +0 -1
  17. package/dist/definition-editor/query-editor/data-preview.d.ts +0 -4
  18. package/dist/definition-editor/query-editor/editor.d.ts +0 -7
  19. package/dist/definition-editor/query-editor/form.d.ts +0 -8
  20. package/dist/definition-editor/query-editor/index.d.ts +0 -5
  21. package/dist/definition-editor/query-editor/preview-sql.d.ts +0 -6
  22. package/dist/definition-editor/query-editor/select-or-add-query.d.ts +0 -7
  23. package/dist/definition-editor/sql-snippet-editor/editor.d.ts +0 -5
  24. package/dist/definition-editor/sql-snippet-editor/index.d.ts +0 -5
  25. package/dist/definition-editor/sql-snippet-editor/preview-snippet.d.ts +0 -6
  26. package/dist/filter/filter-checkbox/editor.d.ts +0 -10
  27. package/dist/filter/filter-checkbox/render.d.ts +0 -9
  28. package/dist/filter/filter-date-range/editor.d.ts +0 -10
  29. package/dist/filter/filter-date-range/render.d.ts +0 -9
  30. package/dist/filter/filter-multi-select/editor.d.ts +0 -11
  31. package/dist/filter/filter-multi-select/render.d.ts +0 -9
  32. package/dist/filter/filter-query-field/index.d.ts +0 -8
  33. package/dist/filter/filter-query-field/select-data-source.d.ts +0 -8
  34. package/dist/filter/filter-select/editor.d.ts +0 -11
  35. package/dist/filter/filter-select/render.d.ts +0 -9
  36. package/dist/filter/filter-settings/filter-setting.d.ts +0 -11
  37. package/dist/filter/filter-settings/filter-settings.d.ts +0 -8
  38. package/dist/filter/filter-settings/index.d.ts +0 -10
  39. package/dist/filter/filter-settings/preview-filter.d.ts +0 -11
  40. package/dist/filter/filter-settings/types.d.ts +0 -4
  41. package/dist/filter/filter-text-input/editor.d.ts +0 -10
  42. package/dist/filter/filter-text-input/render.d.ts +0 -9
  43. package/dist/filter/filter.d.ts +0 -9
  44. package/dist/filter/index.d.ts +0 -9
  45. package/dist/index.d.ts +0 -5
  46. package/dist/layout/index.d.ts +0 -12
  47. package/dist/layout/read-only.d.ts +0 -9
  48. package/dist/main/actions.d.ts +0 -14
  49. package/dist/main/full-screen-panel.d.ts +0 -6
  50. package/dist/main/index.d.ts +0 -2
  51. package/dist/main/main.d.ts +0 -12
  52. package/dist/main/read-only.d.ts +0 -11
  53. package/dist/main/toggle-mode.d.ts +0 -8
  54. package/dist/main/use-filters.d.ts +0 -8
  55. package/dist/main/use-panel-full-screen.d.ts +0 -7
  56. package/dist/main/view-schema-modal.d.ts +0 -8
  57. package/dist/panel/error-boundary.d.ts +0 -13
  58. package/dist/panel/index.d.ts +0 -7
  59. package/dist/panel/panel-description.d.ts +0 -5
  60. package/dist/panel/settings/common/aggregation-selector.d.ts +0 -9
  61. package/dist/panel/settings/common/color-array-input.d.ts +0 -8
  62. package/dist/panel/settings/common/data-field-selector.d.ts +0 -12
  63. package/dist/panel/settings/common/mantine-color.d.ts +0 -7
  64. package/dist/panel/settings/common/mantine-font-weight.d.ts +0 -8
  65. package/dist/panel/settings/common/numbro-format-selector.d.ts +0 -13
  66. package/dist/panel/settings/common/text-array-input.d.ts +0 -8
  67. package/dist/panel/settings/index.d.ts +0 -7
  68. package/dist/panel/settings/panel-config/description.d.ts +0 -2
  69. package/dist/panel/settings/panel-config/index.d.ts +0 -5
  70. package/dist/panel/settings/panel-config/preview-panel.d.ts +0 -2
  71. package/dist/panel/settings/panel-config/title.d.ts +0 -2
  72. package/dist/panel/settings/pick-query/index.d.ts +0 -5
  73. package/dist/panel/settings/viz-config/index.d.ts +0 -5
  74. package/dist/panel/settings/viz-config/preview-viz.d.ts +0 -5
  75. package/dist/panel/settings/viz-config/viz-conf.d.ts +0 -2
  76. package/dist/panel/title-bar.d.ts +0 -5
  77. package/dist/panel/viz/bar-3d/index.d.ts +0 -9
  78. package/dist/panel/viz/bar-3d/panel.d.ts +0 -3
  79. package/dist/panel/viz/cartesian/index.d.ts +0 -10
  80. package/dist/panel/viz/cartesian/option/regression.d.ts +0 -20
  81. package/dist/panel/viz/cartesian/panel/index.d.ts +0 -3
  82. package/dist/panel/viz/cartesian/panel/regressions/index.d.ts +0 -11
  83. package/dist/panel/viz/cartesian/panel/regressions/regression-item.d.ts +0 -16
  84. package/dist/panel/viz/cartesian/panel/series/fields.bar.d.ts +0 -9
  85. package/dist/panel/viz/cartesian/panel/series/fields.line.d.ts +0 -9
  86. package/dist/panel/viz/cartesian/panel/series/fields.scatter.d.ts +0 -9
  87. package/dist/panel/viz/cartesian/panel/series/index.d.ts +0 -11
  88. package/dist/panel/viz/cartesian/panel/series/series-item.d.ts +0 -16
  89. package/dist/panel/viz/cartesian/panel/stats/index.d.ts +0 -10
  90. package/dist/panel/viz/cartesian/panel/stats/variable.d.ts +0 -11
  91. package/dist/panel/viz/cartesian/panel/y-axes.d.ts +0 -9
  92. package/dist/panel/viz/cartesian/type.d.ts +0 -58
  93. package/dist/panel/viz/index.d.ts +0 -9
  94. package/dist/panel/viz/pie/index.d.ts +0 -9
  95. package/dist/panel/viz/pie/panel.d.ts +0 -3
  96. package/dist/panel/viz/rich-text/index.d.ts +0 -10
  97. package/dist/panel/viz/rich-text/panel.d.ts +0 -3
  98. package/dist/panel/viz/rich-text/type.d.ts +0 -8
  99. package/dist/panel/viz/stats/index.d.ts +0 -10
  100. package/dist/panel/viz/stats/panel/index.d.ts +0 -10
  101. package/dist/panel/viz/stats/panel/variable.d.ts +0 -11
  102. package/dist/panel/viz/stats/panel/variables.d.ts +0 -10
  103. package/dist/panel/viz/stats/types.d.ts +0 -6
  104. package/dist/panel/viz/stats/update/index.d.ts +0 -15
  105. package/dist/panel/viz/sunburst/index.d.ts +0 -9
  106. package/dist/panel/viz/sunburst/panel.d.ts +0 -3
  107. package/dist/panel/viz/table/index.d.ts +0 -10
  108. package/dist/panel/viz/table/panel.d.ts +0 -3
  109. package/dist/panel/viz/table/type.d.ts +0 -21
  110. package/dist/panel/viz/table/value-type-selector.d.ts +0 -10
  111. package/dist/panel/viz/table/value.d.ts +0 -8
  112. package/dist/types/dashboard.d.ts +0 -49
  113. package/dist/types/filter.d.ts +0 -39
  114. package/dist/types/index.d.ts +0 -3
  115. package/dist/types/viz-panel.d.ts +0 -6
  116. package/dist/utils/aggregation.d.ts +0 -2
  117. package/dist/utils/color-mapping.d.ts +0 -9
  118. package/dist/utils/sql.d.ts +0 -8
  119. package/dist/utils/template/editor.d.ts +0 -16
  120. package/dist/utils/template/render.d.ts +0 -3
  121. package/dist/utils/template/types.d.ts +0 -21
  122. package/dist/vite-env.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtable/dashboard",
3
- "version": "2.2.0",
3
+ "version": "2.5.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,9 +24,15 @@
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
+ "jszip": "3.10.1",
30
36
  "popmotion": "^11.0.3"
31
37
  },
32
38
  "devDependencies": {
@@ -38,17 +44,24 @@
38
44
  "@mantine/notifications": "^5.0.2",
39
45
  "@mantine/prism": "^5.0.2",
40
46
  "@mantine/rte": "^5.0.2",
47
+ "@testing-library/jest-dom": "^5.16.4",
48
+ "@testing-library/react": "^13.3.0",
49
+ "@testing-library/react-hooks": "^8.0.1",
50
+ "@testing-library/user-event": "^14.3.0",
51
+ "@types/file-saver": "2.0.5",
41
52
  "@types/lodash": "^4.14.182",
42
53
  "@types/react": "^18.0.0",
43
54
  "@types/react-dom": "^18.0.0",
44
55
  "@types/react-grid-layout": "^1.3.2",
45
56
  "@vitejs/plugin-react": "^1.3.0",
57
+ "@vitest/ui": "^0.19.1",
46
58
  "ahooks": "^3.3.11",
47
59
  "axios": "^0.27.2",
48
60
  "echarts": "^5.3.2",
49
61
  "echarts-for-react": "^3.0.2",
50
62
  "echarts-gl": "^2.0.9",
51
63
  "echarts-stat": "1.2.0",
64
+ "jsdom": "^20.0.0",
52
65
  "lodash": "^4.17.21",
53
66
  "numbro": "^2.3.6",
54
67
  "react-grid-layout": "^1.3.4",
@@ -56,8 +69,9 @@
56
69
  "rollup-plugin-visualizer": "5.6.0",
57
70
  "tabler-icons-react": "^1.48.0",
58
71
  "typescript": "^4.6.3",
59
- "vite": "^2.9.9",
60
- "vite-plugin-dts": "^1.1.1"
72
+ "vite": "^3.0.3",
73
+ "vite-plugin-dts": "^1.1.1",
74
+ "vitest": "^0.19.1"
61
75
  },
62
76
  "peerDependencies": {
63
77
  "@emotion/react": "11.10.0",
@@ -76,6 +90,9 @@
76
90
  "echarts-gl": "^2.0.9",
77
91
  "echarts-stat": "1.2.0",
78
92
  "lodash": "^4.17.21",
93
+ "mobx": "^6.6.1",
94
+ "mobx-react-lite": "^3.4.0",
95
+ "mobx-state-tree": "^5.1.5",
79
96
  "numbro": "^2.3.6",
80
97
  "react": "^16.8.0 || 17.x || 18.x",
81
98
  "react-dom": "^16.8.0 || 17.x || 18.x",
@@ -83,4 +100,4 @@
83
100
  "react-hook-form": "^7.31.2",
84
101
  "tabler-icons-react": "^1.48.0"
85
102
  }
86
- }
103
+ }
@@ -1,20 +0,0 @@
1
- import { ContextInfoContextType, FilterValuesContextType } from "../contexts";
2
- import { IDashboardDefinition, IQuery } from "../types";
3
- import { IDataSource } from "./types";
4
- interface IQueryByStaticSQL {
5
- type: 'postgresql';
6
- key: string;
7
- sql: string;
8
- }
9
- export declare const queryByStaticSQL: ({ type, key, sql }: IQueryByStaticSQL) => () => Promise<any>;
10
- interface IQueryBySQL {
11
- context: ContextInfoContextType;
12
- definitions: IDashboardDefinition;
13
- title: string;
14
- query?: IQuery;
15
- filterValues: FilterValuesContextType;
16
- }
17
- export declare const queryBySQL: ({ context, definitions, title, query, filterValues }: IQueryBySQL) => () => Promise<any>;
18
- export declare type TQuerySources = Record<string, string[]>;
19
- export declare function listDataSources(): Promise<IDataSource[]>;
20
- export {};
@@ -1,5 +0,0 @@
1
- import { Method } from 'axios';
2
- export declare const APIClient: {
3
- baseURL: string;
4
- getRequest(method: Method): (url: string, data: any, options?: any) => Promise<any>;
5
- };
@@ -1,11 +0,0 @@
1
- export declare type PaginationResponse<T> = {
2
- total: number;
3
- offset: number;
4
- data: T[];
5
- };
6
- export declare type DataSourceType = 'postgresql' | 'mysql' | 'http';
7
- export interface IDataSource {
8
- id: string;
9
- type: DataSourceType;
10
- key: string;
11
- }
@@ -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,9 +0,0 @@
1
- import React from "react";
2
- export interface IDashboardActionContext {
3
- addPanel: () => void;
4
- duplidatePanel: (id: string) => void;
5
- removePanelByID: (id: string) => void;
6
- viewPanelInFullScreen: (id: string) => void;
7
- inFullScreen: boolean;
8
- }
9
- export declare const DashboardActionContext: React.Context<IDashboardActionContext>;
@@ -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,5 +0,0 @@
1
- export * from './definition-context';
2
- export * from './context-info-context';
3
- export * from './filter-values-context';
4
- export * from './layout-state-context';
5
- export * from './panel-context';
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- import { DashboardMode } from "../types/dashboard";
3
- export interface ILayoutStateContext {
4
- layoutFrozen: boolean;
5
- freezeLayout: React.Dispatch<React.SetStateAction<boolean>>;
6
- mode: DashboardMode;
7
- inEditMode: boolean;
8
- inLayoutMode: boolean;
9
- inUseMode: boolean;
10
- }
11
- export declare const LayoutStateContext: React.Context<ILayoutStateContext>;
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- import { IVizConfig } from "../types/dashboard";
3
- export interface IPanelContext {
4
- id: string;
5
- data: any[];
6
- loading: boolean;
7
- title: string;
8
- setTitle: React.Dispatch<React.SetStateAction<string>>;
9
- description: string;
10
- setDescription: React.Dispatch<React.SetStateAction<string>>;
11
- queryID: string;
12
- setQueryID: React.Dispatch<React.SetStateAction<string>>;
13
- viz: IVizConfig;
14
- setViz: React.Dispatch<React.SetStateAction<IVizConfig>>;
15
- refreshData: () => void;
16
- }
17
- export declare const PanelContext: React.Context<IPanelContext>;
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- interface IDataEditorModal {
3
- opened: boolean;
4
- close: () => void;
5
- }
6
- export declare function DataEditorModal({ opened, close }: IDataEditorModal): JSX.Element;
7
- export {};
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { Sx } from "@mantine/core";
3
- interface IGlobalVariablesGuide {
4
- showSQLSnippets?: boolean;
5
- sx?: Sx;
6
- }
7
- export declare function GlobalVariablesGuide({ showSQLSnippets, sx }: IGlobalVariablesGuide): JSX.Element;
8
- export {};
@@ -1 +0,0 @@
1
- export * from './data-editor-modal';
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function DataPreview({ id }: {
3
- id: string;
4
- }): JSX.Element;
@@ -1,7 +0,0 @@
1
- import React from "react";
2
- interface IQueryEditor {
3
- id: string;
4
- setID: React.Dispatch<React.SetStateAction<string>>;
5
- }
6
- export declare function QueryEditor({ id, setID }: IQueryEditor): JSX.Element | null;
7
- export {};
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { IQuery } from "../../types";
3
- interface IQueryForm {
4
- value: IQuery;
5
- onChange: any;
6
- }
7
- export declare function QueryForm({ value, onChange }: IQueryForm): JSX.Element;
8
- export {};
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- interface IEditQueries {
3
- }
4
- export declare function EditQueries({}: IEditQueries): JSX.Element;
5
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- interface IPreviewSQL {
3
- value: string;
4
- }
5
- export declare function PreviewSQL({ value }: IPreviewSQL): JSX.Element;
6
- export {};
@@ -1,7 +0,0 @@
1
- import React from "react";
2
- interface ISelectOrAddQuery {
3
- id: string;
4
- setID: React.Dispatch<React.SetStateAction<string>>;
5
- }
6
- export declare function SelectOrAddQuery({ id, setID }: ISelectOrAddQuery): JSX.Element;
7
- export {};
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- interface ISQLSnippetsEditor {
3
- }
4
- export declare function SQLSnippetsEditor({}: ISQLSnippetsEditor): JSX.Element;
5
- export {};
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- interface IEditSQLSnippets {
3
- }
4
- export declare function EditSQLSnippets({}: IEditSQLSnippets): JSX.Element;
5
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- interface IPreviewSnippet {
3
- value: string;
4
- }
5
- export declare function PreviewSnippet({ value }: IPreviewSnippet): JSX.Element;
6
- export {};
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { Control, FieldArrayWithId } from "react-hook-form";
3
- import { IFilterSettingsForm } from "../filter-settings/types";
4
- interface IFilterEditorCheckbox {
5
- field: FieldArrayWithId<IFilterSettingsForm, "filters", "id">;
6
- index: number;
7
- control: Control<IFilterSettingsForm, object>;
8
- }
9
- export declare function FilterEditorCheckbox({ field, index, control }: IFilterEditorCheckbox): JSX.Element;
10
- export {};
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardFilter, IFilterConfig_Checkbox } from "../../types";
3
- interface IFilterCheckbox extends Omit<IDashboardFilter, 'type' | 'config'> {
4
- config: IFilterConfig_Checkbox;
5
- value: any;
6
- onChange: (v: any) => void;
7
- }
8
- export declare function FilterCheckbox({ label, config: { default_value, ...rest }, value, onChange }: IFilterCheckbox): JSX.Element;
9
- export {};
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { Control, FieldArrayWithId } from "react-hook-form";
3
- import { IFilterSettingsForm } from "../filter-settings/types";
4
- interface IFilterEditorDateRange {
5
- field: FieldArrayWithId<IFilterSettingsForm, "filters", "id">;
6
- index: number;
7
- control: Control<IFilterSettingsForm, object>;
8
- }
9
- export declare function FilterEditorDateRange({ field, index, control }: IFilterEditorDateRange): JSX.Element;
10
- export {};
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardFilter, IFilterConfig_DateRange } from "../../types";
3
- interface IFilterDateRange extends Omit<IDashboardFilter, 'type' | 'config'> {
4
- config: IFilterConfig_DateRange;
5
- value: any;
6
- onChange: (v: any) => void;
7
- }
8
- export declare function FilterDateRange({ label, config, value, onChange }: IFilterDateRange): JSX.Element;
9
- export {};
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { Control, FieldArrayWithId, UseFormWatch } from "react-hook-form";
3
- import { IFilterSettingsForm } from "../filter-settings/types";
4
- interface IFilterEditorMultiSelect {
5
- field: FieldArrayWithId<IFilterSettingsForm, "filters", "id">;
6
- index: number;
7
- control: Control<IFilterSettingsForm, object>;
8
- watch: UseFormWatch<IFilterSettingsForm>;
9
- }
10
- export declare function FilterEditorMultiSelect({ field, index, control, watch }: IFilterEditorMultiSelect): JSX.Element;
11
- export {};
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardFilter, IFilterConfig_Select } from "../../types";
3
- interface IFilterMultiSelect extends Omit<IDashboardFilter, 'type' | 'config'> {
4
- config: IFilterConfig_Select;
5
- value: any;
6
- onChange: (v: any) => void;
7
- }
8
- export declare function FilterMultiSelect({ label, config, value, onChange }: IFilterMultiSelect): JSX.Element;
9
- export {};
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import { IDashboardFilterOptionQuery } from "../../types";
3
- interface IFilterQueryField {
4
- value: IDashboardFilterOptionQuery;
5
- onChange: (v: IDashboardFilterOptionQuery) => void;
6
- }
7
- export declare const FilterQueryField: React.ForwardRefExoticComponent<IFilterQueryField & React.RefAttributes<unknown>>;
8
- export {};
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardFilterOptionQuery } from "../../types";
3
- interface ISelectDataSource {
4
- value: IDashboardFilterOptionQuery;
5
- onChange: (v: IDashboardFilterOptionQuery) => void;
6
- }
7
- export declare function SelectDataSource({ value, onChange }: ISelectDataSource): JSX.Element;
8
- export {};
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { Control, FieldArrayWithId, UseFormWatch } from "react-hook-form";
3
- import { IFilterSettingsForm } from "../filter-settings/types";
4
- interface IFilterEditorSelect {
5
- field: FieldArrayWithId<IFilterSettingsForm, "filters", "id">;
6
- index: number;
7
- control: Control<IFilterSettingsForm, object>;
8
- watch: UseFormWatch<IFilterSettingsForm>;
9
- }
10
- export declare function FilterEditorSelect({ field, index, control, watch }: IFilterEditorSelect): JSX.Element;
11
- export {};
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardFilter, IFilterConfig_Select } from "../../types";
3
- interface IFilterSelect extends Omit<IDashboardFilter, 'type' | 'config'> {
4
- config: IFilterConfig_Select;
5
- value: any;
6
- onChange: (v: any) => void;
7
- }
8
- export declare function FilterSelect({ label, config, value, onChange }: IFilterSelect): JSX.Element;
9
- export {};
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { Control, FieldArrayWithId, UseFormWatch } from "react-hook-form";
3
- import { IFilterSettingsForm } from "./types";
4
- interface IFilterSetting {
5
- field: FieldArrayWithId<IFilterSettingsForm, "filters", "id">;
6
- index: number;
7
- control: Control<IFilterSettingsForm, object>;
8
- watch: UseFormWatch<IFilterSettingsForm>;
9
- }
10
- export declare function FilterSetting({ field, index, control, watch }: IFilterSetting): JSX.Element;
11
- export {};
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardFilter } from "../../types";
3
- interface FilterSettings {
4
- filters: IDashboardFilter[];
5
- setFilters: (v: IDashboardFilter[]) => void;
6
- }
7
- export declare function FilterSettings({ filters, setFilters }: FilterSettings): JSX.Element;
8
- export {};
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardFilter } from "../../types";
3
- interface FilterSettingsModal {
4
- opened: boolean;
5
- close: () => void;
6
- filters: IDashboardFilter[];
7
- setFilters: (v: IDashboardFilter[]) => void;
8
- }
9
- export declare function FilterSettingsModal({ opened, close, filters, setFilters }: FilterSettingsModal): JSX.Element;
10
- export {};
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardFilter } from "../../types";
3
- import { UseFormWatch } from "react-hook-form";
4
- import { IFilterSettingsForm } from "./types";
5
- interface IPreviewFilter {
6
- filter: IDashboardFilter;
7
- index: number;
8
- watch: UseFormWatch<IFilterSettingsForm>;
9
- }
10
- export declare function PreviewFilter({ filter, index, watch }: IPreviewFilter): JSX.Element;
11
- export {};
@@ -1,4 +0,0 @@
1
- import { IDashboardFilter } from "../../types";
2
- export interface IFilterSettingsForm {
3
- filters: IDashboardFilter[];
4
- }
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { Control, FieldArrayWithId } from "react-hook-form";
3
- import { IFilterSettingsForm } from "../filter-settings/types";
4
- interface IFilterEditorTextInput {
5
- field: FieldArrayWithId<IFilterSettingsForm, "filters", "id">;
6
- index: number;
7
- control: Control<IFilterSettingsForm, object>;
8
- }
9
- export declare function FilterEditorTextInput({ field, index, control }: IFilterEditorTextInput): JSX.Element;
10
- export {};
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardFilter, IFilterConfig_TextInput } from "../../types";
3
- interface IFilterTextInput extends Omit<IDashboardFilter, 'type' | 'config'> {
4
- config: IFilterConfig_TextInput;
5
- value: any;
6
- onChange: (v: any) => void;
7
- }
8
- export declare function FilterTextInput({ label, config, value, onChange }: IFilterTextInput): JSX.Element;
9
- export {};
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import { IDashboardFilter } from "../types";
3
- interface IFilter {
4
- filter: IDashboardFilter;
5
- value: any;
6
- onChange: (v: any) => void;
7
- }
8
- export declare const Filter: React.ForwardRefExoticComponent<IFilter & React.RefAttributes<unknown>>;
9
- export {};
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardFilter } from "../types";
3
- interface IFilters {
4
- filters: IDashboardFilter[];
5
- filterValues: Record<string, any>;
6
- setFilterValues: (v: Record<string, any>) => void;
7
- }
8
- export declare function Filters({ filters, filterValues, setFilterValues }: IFilters): JSX.Element | null;
9
- export {};
package/dist/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from './main';
2
- export * from './layout';
3
- export * from './panel';
4
- export * from './contexts';
5
- export * from './types';
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { IDashboardPanel } from "../types/dashboard";
3
- interface IDashboardLayout {
4
- panels: IDashboardPanel[];
5
- setPanels: React.Dispatch<React.SetStateAction<IDashboardPanel[]>>;
6
- className?: string;
7
- rowHeight?: number;
8
- isDraggable: boolean;
9
- isResizable: boolean;
10
- }
11
- export declare function DashboardLayout({ panels, setPanels, className, rowHeight, isDraggable, isResizable, }: IDashboardLayout): JSX.Element;
12
- export {};
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardPanel } from "../types/dashboard";
3
- interface IReadOnlyDashboardLayout {
4
- panels: IDashboardPanel[];
5
- className?: string;
6
- rowHeight?: number;
7
- }
8
- export declare function ReadOnlyDashboardLayout({ panels, className, rowHeight, }: IReadOnlyDashboardLayout): JSX.Element;
9
- export {};
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- import { DashboardMode, IDashboardFilter } from "../types";
3
- interface IDashboardActions {
4
- mode: DashboardMode;
5
- setMode: React.Dispatch<React.SetStateAction<DashboardMode>>;
6
- hasChanges: boolean;
7
- saveChanges: () => void;
8
- revertChanges: () => void;
9
- getCurrentSchema: () => any;
10
- filters: IDashboardFilter[];
11
- setFilters: (v: IDashboardFilter[]) => void;
12
- }
13
- export declare function DashboardActions({ mode, setMode, hasChanges, saveChanges, revertChanges, getCurrentSchema, filters, setFilters, }: IDashboardActions): JSX.Element;
14
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboardPanel } from "../types";
3
- export declare function FullScreenPanel({ panel, exitFullScreen }: {
4
- panel: IDashboardPanel;
5
- exitFullScreen: () => void;
6
- }): JSX.Element;
@@ -1,2 +0,0 @@
1
- export * from './main';
2
- export * from './read-only';
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboard, IDashboardConfig } from "../types/dashboard";
3
- import { ContextInfoContextType } from "../contexts";
4
- interface IDashboardProps {
5
- context: ContextInfoContextType;
6
- dashboard: IDashboard;
7
- className?: string;
8
- update: (dashboard: IDashboard) => Promise<void>;
9
- config: IDashboardConfig;
10
- }
11
- export declare function Dashboard({ context, dashboard, update, className, config, }: IDashboardProps): JSX.Element;
12
- export {};
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { IDashboard, IDashboardConfig } from "../types/dashboard";
3
- import { ContextInfoContextType } from "../contexts";
4
- interface IReadOnlyDashboard {
5
- context: ContextInfoContextType;
6
- dashboard: IDashboard;
7
- className?: string;
8
- config: IDashboardConfig;
9
- }
10
- export declare function ReadOnlyDashboard({ context, dashboard, className, config, }: IReadOnlyDashboard): JSX.Element;
11
- export {};
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import { DashboardMode } from "../types/dashboard";
3
- interface IModeToggler {
4
- mode: DashboardMode;
5
- setMode: React.Dispatch<React.SetStateAction<DashboardMode>>;
6
- }
7
- export declare function ModeToggler({ mode, setMode }: IModeToggler): JSX.Element;
8
- export {};
@@ -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
- };
@@ -1,7 +0,0 @@
1
- import { IDashboardPanel } from "../types";
2
- export declare function usePanelFullScreen(panels: IDashboardPanel[]): {
3
- viewPanelInFullScreen: (id: string) => void;
4
- exitFullScreen: () => void;
5
- inFullScreen: boolean;
6
- fullScreenPanel: IDashboardPanel | undefined;
7
- };
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- interface IViewSchemaModal {
3
- opened: boolean;
4
- close: () => void;
5
- getCurrentSchema: () => any;
6
- }
7
- export declare function ViewSchemaModal({ opened, close, getCurrentSchema }: IViewSchemaModal): JSX.Element;
8
- export {};
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- declare type PropType = {
3
- children: React.ReactNode;
4
- };
5
- declare type StateType = {
6
- error: null | any;
7
- };
8
- export declare class ErrorBoundary extends React.Component<PropType, StateType> {
9
- constructor(props: PropType);
10
- componentDidCatch(error: any): void;
11
- render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
12
- }
13
- export {};