@devtable/dashboard 2.5.0 → 3.1.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.
- package/README.md +25 -1
- package/dist/api-caller/index.d.ts +26 -0
- package/dist/api-caller/request.d.ts +5 -0
- package/dist/api-caller/types.d.ts +11 -0
- package/dist/contexts/dashboard-action-context.d.ts +9 -0
- package/dist/contexts/index.d.ts +3 -0
- package/dist/contexts/layout-state-context.d.ts +11 -0
- package/dist/contexts/model-context.d.ts +24165 -0
- package/dist/contexts/panel-context.d.ts +16 -0
- package/dist/dashboard.es.js +9526 -9191
- package/dist/dashboard.umd.js +22 -22
- package/dist/definition-editor/data-editor-modal.d.ts +7 -0
- package/dist/definition-editor/global-variables-guide.d.ts +8 -0
- package/dist/definition-editor/index.d.ts +1 -0
- package/dist/definition-editor/query-editor/data-preview.d.ts +4 -0
- package/dist/definition-editor/query-editor/editor.d.ts +7 -0
- package/dist/definition-editor/query-editor/form.d.ts +7 -0
- package/dist/definition-editor/query-editor/index.d.ts +5 -0
- package/dist/definition-editor/query-editor/preview-sql.d.ts +6 -0
- package/dist/definition-editor/query-editor/select-or-add-query.d.ts +7 -0
- package/dist/definition-editor/sql-snippet-editor/editor.d.ts +5 -0
- package/dist/definition-editor/sql-snippet-editor/index.d.ts +5 -0
- package/dist/definition-editor/sql-snippet-editor/preview-snippet.d.ts +6 -0
- package/dist/filter/filter-checkbox/editor.d.ts +8 -0
- package/dist/filter/filter-checkbox/render.d.ts +10 -0
- package/dist/filter/filter-date-range/editor.d.ts +7 -0
- package/dist/filter/filter-date-range/render.d.ts +10 -0
- package/dist/filter/filter-multi-select/editor.d.ts +7 -0
- package/dist/filter/filter-multi-select/render.d.ts +10 -0
- package/dist/filter/filter-query-field/index.d.ts +8 -0
- package/dist/filter/filter-query-field/select-data-source.d.ts +8 -0
- package/dist/filter/filter-query-field/test-query.d.ts +7 -0
- package/dist/filter/filter-select/editor.d.ts +7 -0
- package/dist/filter/filter-select/render.d.ts +10 -0
- package/dist/filter/filter-settings/filter-setting.d.ts +8 -0
- package/dist/filter/filter-settings/filter-settings.d.ts +5 -0
- package/dist/filter/filter-settings/index.d.ts +7 -0
- package/dist/filter/filter-settings/preview-filter.d.ts +7 -0
- package/dist/filter/filter-text-input/editor.d.ts +7 -0
- package/dist/filter/filter-text-input/render.d.ts +10 -0
- package/dist/filter/filter.d.ts +9 -0
- package/dist/filter/index.d.ts +5 -0
- package/dist/index.d.ts +6 -0
- package/dist/layout/index.d.ts +12 -0
- package/dist/layout/read-only.d.ts +9 -0
- package/dist/main/actions.d.ts +12 -0
- package/dist/main/full-screen-panel.d.ts +6 -0
- package/dist/main/index.d.ts +2 -0
- package/dist/main/main.d.ts +12 -0
- package/dist/main/read-only.d.ts +11 -0
- package/dist/main/toggle-mode.d.ts +8 -0
- package/dist/main/use-panel-full-screen.d.ts +7 -0
- package/dist/main/use-sticky-area-style.d.ts +1 -0
- package/dist/main/view-schema-modal.d.ts +8 -0
- package/dist/model/context.d.ts +11 -0
- package/dist/model/dashboard.d.ts +15998 -0
- package/dist/model/filters/filter/checkbox.d.ts +16 -0
- package/dist/model/filters/filter/common.d.ts +14 -0
- package/dist/model/filters/filter/date-range.d.ts +28 -0
- package/dist/model/filters/filter/index.d.ts +172 -0
- package/dist/model/filters/filter/multi-select.d.ts +81 -0
- package/dist/model/filters/filter/select.d.ts +95 -0
- package/dist/model/filters/filter/text-input.d.ts +22 -0
- package/dist/model/filters/index.d.ts +3542 -0
- package/dist/model/index.d.ts +5 -0
- package/dist/model/queries/index.d.ts +116 -0
- package/dist/model/queries/mute-query.d.ts +17 -0
- package/dist/model/queries/query.d.ts +31 -0
- package/dist/model/queries/types.d.ts +5 -0
- package/dist/model/sql-snippets/index.d.ts +26 -0
- package/dist/model/sql-snippets/sql-snippet.d.ts +9 -0
- package/dist/panel/error-boundary.d.ts +13 -0
- package/dist/panel/index.d.ts +7 -0
- package/dist/panel/panel-description.d.ts +5 -0
- package/dist/panel/plugin-adaptor.d.ts +7 -0
- package/dist/panel/settings/common/aggregation-selector.d.ts +9 -0
- package/dist/panel/settings/common/color-array-input.d.ts +8 -0
- package/dist/panel/settings/common/data-field-selector.d.ts +12 -0
- package/dist/panel/settings/common/mantine-color.d.ts +7 -0
- package/dist/panel/settings/common/mantine-font-weight.d.ts +8 -0
- package/dist/panel/settings/common/numbro-format-selector.d.ts +13 -0
- package/dist/panel/settings/common/text-array-input.d.ts +8 -0
- package/dist/panel/settings/index.d.ts +7 -0
- package/dist/panel/settings/panel-config/description.d.ts +2 -0
- package/dist/panel/settings/panel-config/index.d.ts +5 -0
- package/dist/panel/settings/panel-config/preview-panel.d.ts +2 -0
- package/dist/panel/settings/panel-config/title.d.ts +2 -0
- package/dist/panel/settings/pick-query/index.d.ts +5 -0
- package/dist/panel/settings/viz-config/index.d.ts +5 -0
- package/dist/panel/settings/viz-config/preview-viz.d.ts +5 -0
- package/dist/panel/settings/viz-config/viz-conf.d.ts +2 -0
- package/dist/panel/title-bar.d.ts +5 -0
- package/dist/panel/viz/bar-3d/index.d.ts +9 -0
- package/dist/panel/viz/bar-3d/panel.d.ts +3 -0
- package/dist/panel/viz/cartesian/index.d.ts +10 -0
- package/dist/panel/viz/cartesian/option/regression.d.ts +20 -0
- package/dist/panel/viz/cartesian/panel/index.d.ts +3 -0
- package/dist/panel/viz/cartesian/panel/regressions/index.d.ts +11 -0
- package/dist/panel/viz/cartesian/panel/regressions/regression-item.d.ts +16 -0
- package/dist/panel/viz/cartesian/panel/series/fields.bar.d.ts +9 -0
- package/dist/panel/viz/cartesian/panel/series/fields.line.d.ts +9 -0
- package/dist/panel/viz/cartesian/panel/series/fields.scatter.d.ts +9 -0
- package/dist/panel/viz/cartesian/panel/series/index.d.ts +11 -0
- package/dist/panel/viz/cartesian/panel/series/series-item.d.ts +16 -0
- package/dist/panel/viz/cartesian/panel/stats/index.d.ts +10 -0
- package/dist/panel/viz/cartesian/panel/stats/variable.d.ts +11 -0
- package/dist/panel/viz/cartesian/panel/y-axes.d.ts +9 -0
- package/dist/panel/viz/cartesian/type.d.ts +58 -0
- package/dist/panel/viz/index.d.ts +9 -0
- package/dist/panel/viz/pie/index.d.ts +9 -0
- package/dist/panel/viz/pie/panel.d.ts +3 -0
- package/dist/panel/viz/rich-text/index.d.ts +10 -0
- package/dist/panel/viz/rich-text/panel.d.ts +3 -0
- package/dist/panel/viz/rich-text/type.d.ts +8 -0
- package/dist/panel/viz/stats/index.d.ts +10 -0
- package/dist/panel/viz/stats/panel/index.d.ts +10 -0
- package/dist/panel/viz/stats/panel/variable.d.ts +11 -0
- package/dist/panel/viz/stats/panel/variables.d.ts +10 -0
- package/dist/panel/viz/stats/types.d.ts +6 -0
- package/dist/panel/viz/stats/update/index.d.ts +15 -0
- package/dist/panel/viz/sunburst/index.d.ts +9 -0
- package/dist/panel/viz/sunburst/panel.d.ts +3 -0
- package/dist/plugins/hooks/index.d.ts +2 -0
- package/dist/plugins/hooks/use-channel-event.d.ts +2 -0
- package/dist/plugins/hooks/use-storage-data.d.ts +6 -0
- package/dist/plugins/index.d.ts +4 -0
- package/dist/plugins/json-plugin-storage.d.ts +12 -0
- package/dist/plugins/message-channels.d.ts +7 -0
- package/dist/plugins/plugin-context.d.ts +12 -0
- package/dist/plugins/plugin-data-migrator/index.d.ts +1 -0
- package/dist/plugins/plugin-data-migrator/plugin-data-migrator.d.ts +13 -0
- package/dist/plugins/plugin-manager.d.ts +18 -0
- package/dist/plugins/viz-components/table/index.d.ts +2 -0
- package/dist/plugins/viz-components/table/type.d.ts +22 -0
- package/dist/plugins/viz-components/table/value-type-selector.d.ts +10 -0
- package/dist/plugins/viz-components/table/value.d.ts +8 -0
- package/dist/plugins/viz-components/table/viz-table-panel.d.ts +3 -0
- package/dist/plugins/viz-components/table/viz-table.d.ts +3 -0
- package/dist/plugins/viz-manager/components.d.ts +22 -0
- package/dist/plugins/viz-manager/impl.d.ts +10 -0
- package/dist/plugins/viz-manager/index.d.ts +4 -0
- package/dist/plugins/viz-manager/types.d.ts +12 -0
- package/dist/style.css +1 -1
- package/dist/types/dashboard.d.ts +41 -0
- package/dist/types/filter.d.ts +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/plugin/index.d.ts +101 -0
- package/dist/types/viz-panel.d.ts +6 -0
- package/dist/utils/aggregation.d.ts +2 -0
- package/dist/utils/color-mapping.d.ts +9 -0
- package/dist/utils/download.d.ts +6 -0
- package/dist/utils/sql.d.ts +9 -0
- package/dist/utils/template/editor.d.ts +16 -0
- package/dist/utils/template/render.d.ts +3 -0
- package/dist/utils/template/types.d.ts +21 -0
- package/dist/vite-env.d.ts +1 -0
- package/package.json +9 -4
package/README.md
CHANGED
|
@@ -7,6 +7,30 @@ cd devtable/dashboard && yarn
|
|
|
7
7
|
# 2. run demo
|
|
8
8
|
cd devtable/dashboard/packages/core && yarn build
|
|
9
9
|
```
|
|
10
|
+
|
|
10
11
|
see `package.json` for more scripts
|
|
11
12
|
|
|
12
|
-
use `../demo` for debugging
|
|
13
|
+
use `../demo` for debugging
|
|
14
|
+
|
|
15
|
+
## Testing
|
|
16
|
+
|
|
17
|
+
Use cypress for component testing.
|
|
18
|
+
|
|
19
|
+
```shell
|
|
20
|
+
$ nx cypress dashboard
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Use vitest for other types of testing.
|
|
24
|
+
|
|
25
|
+
```shell
|
|
26
|
+
$ nx vitest dashboard
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Use `-c ci` to run tests in headless mode.
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
$ nx cypress dashboard -c ci
|
|
33
|
+
$ nx vitest dashboard -c ci
|
|
34
|
+
# run both in parallel
|
|
35
|
+
$ nx test dashboard -c ci
|
|
36
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FilterValuesType } from '../model';
|
|
2
|
+
import { ContextInfoType } from '../model/context';
|
|
3
|
+
import { DataSourceType } from '../model/queries/types';
|
|
4
|
+
import { SQLSnippetModelInstance } from '../model/sql-snippets';
|
|
5
|
+
import { IDataSource } from './types';
|
|
6
|
+
interface IQueryByStaticSQL {
|
|
7
|
+
type: 'postgresql';
|
|
8
|
+
key: string;
|
|
9
|
+
sql: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const queryByStaticSQL: ({ type, key, sql }: IQueryByStaticSQL) => () => Promise<any>;
|
|
12
|
+
interface IQueryBySQL {
|
|
13
|
+
context: ContextInfoType;
|
|
14
|
+
sqlSnippets: SQLSnippetModelInstance[];
|
|
15
|
+
title: string;
|
|
16
|
+
query: {
|
|
17
|
+
type: DataSourceType;
|
|
18
|
+
key: string;
|
|
19
|
+
sql: string;
|
|
20
|
+
};
|
|
21
|
+
filterValues: FilterValuesType;
|
|
22
|
+
}
|
|
23
|
+
export declare function queryBySQL({ context, sqlSnippets, title, query, filterValues }: IQueryBySQL): Promise<any>;
|
|
24
|
+
export declare type TQuerySources = Record<string, string[]>;
|
|
25
|
+
export declare function listDataSources(): Promise<IDataSource[]>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
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>;
|
|
@@ -0,0 +1,11 @@
|
|
|
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>;
|