@devtable/dashboard 0.0.1

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 (47) hide show
  1. package/dist/api-caller/index.d.ts +1 -0
  2. package/dist/api-caller/request.d.ts +2 -0
  3. package/dist/contexts/context-info-context.d.ts +5 -0
  4. package/dist/contexts/index.d.ts +3 -0
  5. package/dist/contexts/layout-state-context.d.ts +9 -0
  6. package/dist/contexts/panel-context.d.ts +16 -0
  7. package/dist/dashboard.es.js +82191 -0
  8. package/dist/dashboard.umd.js +4338 -0
  9. package/dist/index.d.ts +4 -0
  10. package/dist/layout/index.d.ts +16 -0
  11. package/dist/layout/toggle-mode.d.ts +8 -0
  12. package/dist/panel/index.d.ts +12 -0
  13. package/dist/panel/settings/common/mantine-color.d.ts +7 -0
  14. package/dist/panel/settings/common/mantine-size.d.ts +8 -0
  15. package/dist/panel/settings/common/mantine-weight.d.ts +8 -0
  16. package/dist/panel/settings/context-info/index.d.ts +5 -0
  17. package/dist/panel/settings/index.d.ts +5 -0
  18. package/dist/panel/settings/query-editor/index.d.ts +2 -0
  19. package/dist/panel/settings/query-editor/sql-query-editor/index.d.ts +5 -0
  20. package/dist/panel/settings/query-result/index.d.ts +5 -0
  21. package/dist/panel/settings/viz-config/description.d.ts +2 -0
  22. package/dist/panel/settings/viz-config/index.d.ts +5 -0
  23. package/dist/panel/settings/viz-config/title.d.ts +2 -0
  24. package/dist/panel/settings/viz-config/viz-conf.d.ts +2 -0
  25. package/dist/panel/title-bar.d.ts +5 -0
  26. package/dist/panel/viz/bar-3d/index.d.ts +9 -0
  27. package/dist/panel/viz/bar-3d/panel.d.ts +3 -0
  28. package/dist/panel/viz/bar-3d/type.d.ts +4 -0
  29. package/dist/panel/viz/index.d.ts +9 -0
  30. package/dist/panel/viz/line-bar/index.d.ts +9 -0
  31. package/dist/panel/viz/line-bar/panel.d.ts +3 -0
  32. package/dist/panel/viz/line-bar/type.d.ts +16 -0
  33. package/dist/panel/viz/sunburst/index.d.ts +9 -0
  34. package/dist/panel/viz/sunburst/panel.d.ts +3 -0
  35. package/dist/panel/viz/table/index.d.ts +10 -0
  36. package/dist/panel/viz/table/panel.d.ts +3 -0
  37. package/dist/panel/viz/table/type.d.ts +21 -0
  38. package/dist/panel/viz/table/value-type-selector.d.ts +10 -0
  39. package/dist/panel/viz/table/value.d.ts +8 -0
  40. package/dist/panel/viz/text/index.d.ts +9 -0
  41. package/dist/panel/viz/text/panel.d.ts +3 -0
  42. package/dist/style.css +1 -0
  43. package/dist/types/dashboard.d.ts +21 -0
  44. package/dist/types/index.d.ts +2 -0
  45. package/dist/types/viz-panel.d.ts +5 -0
  46. package/dist/vite-env.d.ts +1 -0
  47. package/package.json +72 -0
@@ -0,0 +1,4 @@
1
+ export * from './layout';
2
+ export * from './panel';
3
+ export * from './contexts';
4
+ export * from './types';
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { IDashboardItem } from "../types/dashboard";
3
+ interface IDashboardLayout {
4
+ dashboard: IDashboardItem[];
5
+ className?: string;
6
+ cols?: {
7
+ lg: number;
8
+ md: number;
9
+ sm: number;
10
+ xs: number;
11
+ xxs: number;
12
+ };
13
+ rowHeight?: number;
14
+ }
15
+ export declare function DashboardLayout({ dashboard, className, cols, rowHeight, }: IDashboardLayout): JSX.Element;
16
+ export {};
@@ -0,0 +1,8 @@
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 {};
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { IVizConfig } from '../types/dashboard';
3
+ interface IPanel {
4
+ layout: any;
5
+ destroy: () => void;
6
+ sql: string;
7
+ viz: IVizConfig;
8
+ title: string;
9
+ description: string;
10
+ }
11
+ export declare function Panel({ viz: initialViz, sql: initialSQL, title: initialTitle, description: initialDesc }: IPanel): JSX.Element;
12
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface IMantineColorSelector {
3
+ value: string;
4
+ onChange: (value: string) => void;
5
+ }
6
+ export declare function MantineColorSelector({ value, onChange }: IMantineColorSelector): JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface IMantineSizeSlider {
3
+ label: string;
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ }
7
+ export declare function MantineSizeSlider({ label, value, onChange }: IMantineSizeSlider): JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface IMantineFontSizeSlider {
3
+ label: string;
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ }
7
+ export declare function MantineFontSizeSlider({ label, value, onChange }: IMantineFontSizeSlider): JSX.Element;
8
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ interface IContextInfo {
3
+ }
4
+ export declare function ContextInfo({}: IContextInfo): JSX.Element;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ interface IPanelSettings {
3
+ }
4
+ export declare function PanelSettings({}: IPanelSettings): JSX.Element;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ import { SQLQueryEditor } from './sql-query-editor';
2
+ export declare const QueryEditor: typeof SQLQueryEditor;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ interface ISQLQueryEditor {
3
+ }
4
+ export declare function SQLQueryEditor({}: ISQLQueryEditor): JSX.Element;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ interface IQueryResult {
3
+ }
4
+ export declare function QueryResult({}: IQueryResult): JSX.Element;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function EditDescription(): JSX.Element;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ interface IVizConfig {
3
+ }
4
+ export declare function VizConfig({}: IVizConfig): JSX.Element;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function EditTitle(): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function EditVizConf(): JSX.Element;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ interface IPanelTitleBar {
3
+ }
4
+ export declare function PanelTitleBar({}: IPanelTitleBar): JSX.Element;
5
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface IVizBar3D {
3
+ conf: any;
4
+ data: any[];
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export declare function VizBar3D({ conf, data, width, height }: IVizBar3D): JSX.Element;
9
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { IVizBar3DPanel } from "./type";
3
+ export declare function VizBar3DPanel({ conf, setConf }: IVizBar3DPanel): JSX.Element;
@@ -0,0 +1,4 @@
1
+ export interface IVizBar3DPanel {
2
+ conf: any;
3
+ setConf: (values: any) => void;
4
+ }
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { IVizConfig } from "../../types/dashboard";
3
+ interface IViz {
4
+ viz: IVizConfig;
5
+ data: any;
6
+ loading: boolean;
7
+ }
8
+ export declare function Viz({ viz, data, loading }: IViz): JSX.Element;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface ILineBarChart {
3
+ conf: any;
4
+ data: any[];
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export declare function VizLineBarChart({ conf, data, width, height }: ILineBarChart): JSX.Element | null;
9
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { IVizLineBarChartPanel } from "./type";
3
+ export declare function VizLineBarChartPanel({ conf, setConf }: IVizLineBarChartPanel): JSX.Element;
@@ -0,0 +1,16 @@
1
+ export interface ILineBarChartSeriesItem {
2
+ type: 'line' | 'bar';
3
+ name: string;
4
+ showSymbol: false;
5
+ y_axis_data_key: string;
6
+ stack: string;
7
+ color?: string;
8
+ }
9
+ export interface ILineBarChartConf {
10
+ x_axis_data_key: string;
11
+ series: ILineBarChartSeriesItem[];
12
+ }
13
+ export interface IVizLineBarChartPanel {
14
+ conf: ILineBarChartConf;
15
+ setConf: (values: ILineBarChartConf) => void;
16
+ }
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface ISunbrust {
3
+ conf: any;
4
+ data: any[];
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export declare function Sunbrust({ conf, data, width, height }: ISunbrust): JSX.Element;
9
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { IVizPanelProps } from "../../../types/viz-panel";
3
+ export declare function SunburstPanel({ conf: { columns, ...restConf }, setConf }: IVizPanelProps): JSX.Element;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { ITableConf } from "./type";
3
+ interface IVizTable {
4
+ conf: ITableConf;
5
+ data: any;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export declare function VizTable({ conf, data, width, height }: IVizTable): JSX.Element;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { IVizPanelProps } from "../../../types/viz-panel";
3
+ export declare function VizTablePanel({ conf: { columns, ...restConf }, setConf }: IVizPanelProps): JSX.Element;
@@ -0,0 +1,21 @@
1
+ export declare enum ValueType {
2
+ string = "string",
3
+ number = "number",
4
+ eloc = "eloc",
5
+ percentage = "percentage"
6
+ }
7
+ export interface IColumnConf {
8
+ label: string;
9
+ value_field: string;
10
+ value_type: ValueType;
11
+ }
12
+ export interface ITableConf {
13
+ id_field: string;
14
+ use_raw_columns: boolean;
15
+ columns: IColumnConf[];
16
+ size: string;
17
+ horizontalSpacing: string;
18
+ verticalSpacing: string;
19
+ striped: boolean;
20
+ highlightOnHover: boolean;
21
+ }
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { Sx } from "@mantine/core";
3
+ interface IValueTypeSelector {
4
+ label: string;
5
+ value: string;
6
+ onChange: (value: string) => void;
7
+ sx?: Sx;
8
+ }
9
+ export declare function ValueTypeSelector({ label, value, onChange, sx }: IValueTypeSelector): JSX.Element;
10
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { ValueType } from "./type";
3
+ interface ICellValue {
4
+ value: any;
5
+ type: ValueType;
6
+ }
7
+ export declare function CellValue({ value, type }: ICellValue): JSX.Element;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface IVizText {
3
+ conf: any;
4
+ data: any;
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export declare function VizText({ conf: { paragraphs }, data }: IVizText): JSX.Element;
9
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { IVizPanelProps } from "../../../types/viz-panel";
3
+ export declare function VizTextPanel({ conf, setConf }: IVizPanelProps): JSX.Element;
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .react-grid-item{padding:0}.react-grid-item:not(.react-grid-placeholder){background:transparent;border-radius:5px;box-shadow:0 0 10px #0003}.remove-panel{position:absolute;right:2px;top:0;cursor:pointer}.react-grid-layout{position:relative;transition:height .2s ease}.react-grid-item{transition:all .2s ease;transition-property:left,top}.react-grid-item img{pointer-events:none;user-select:none}.react-grid-item.cssTransforms{transition-property:transform}.react-grid-item.resizing{z-index:1;will-change:width,height}.react-grid-item.react-draggable-dragging{transition:none;z-index:3;will-change:transform}.react-grid-item.dropping{visibility:hidden}.react-grid-item.react-grid-placeholder{background:red;opacity:.2;transition-duration:.1s;z-index:2;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.react-grid-item>.react-resizable-handle{position:absolute;width:20px;height:20px}.react-grid-item>.react-resizable-handle:after{content:"";position:absolute;right:3px;bottom:3px;width:5px;height:5px;border-right:2px solid rgba(0,0,0,.4);border-bottom:2px solid rgba(0,0,0,.4)}.react-resizable-hide>.react-resizable-handle{display:none}.react-grid-item>.react-resizable-handle.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-w,.react-grid-item>.react-resizable-handle.react-resizable-handle-e{top:50%;margin-top:-10px;cursor:ew-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-n,.react-grid-item>.react-resizable-handle.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}.react-resizable{position:relative}.react-resizable-handle{position:absolute;width:20px;height:20px;background-repeat:no-repeat;background-origin:content-box;box-sizing:border-box;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+);background-position:bottom right;padding:0 3px 3px 0}.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-resizable-handle-w,.react-resizable-handle-e{top:50%;margin-top:-10px;cursor:ew-resize}.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-resizable-handle-n,.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}.viz-root{width:100%;overflow:scroll;padding-top:10px;height:calc(100% - 30px);background-color:#fff}.sql-query-editor-root textarea{font-family:monospace}.panel-root{padding:5px;height:100%;width:100%;max-width:100%}.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}
@@ -0,0 +1,21 @@
1
+ export interface IVizConfig {
2
+ type: string;
3
+ conf: Record<string, any>;
4
+ }
5
+ export interface IDashboardItem {
6
+ id: string;
7
+ title: string;
8
+ description: string;
9
+ layout: {
10
+ x: number;
11
+ y: number;
12
+ w: number;
13
+ h: number;
14
+ };
15
+ sql: string;
16
+ viz: IVizConfig;
17
+ }
18
+ export declare enum DashboardMode {
19
+ Use = "use",
20
+ Edit = "edit"
21
+ }
@@ -0,0 +1,2 @@
1
+ export * from './dashboard';
2
+ export * from './viz-panel';
@@ -0,0 +1,5 @@
1
+ import { IVizConfig } from "./dashboard";
2
+ export interface IVizPanelProps {
3
+ conf: IVizConfig['conf'];
4
+ setConf: (conf: IVizConfig['conf']) => void;
5
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@devtable/dashboard",
3
+ "version": "0.0.1",
4
+ "publishConfig": {
5
+ "access": "public",
6
+ "registry": "https://registry.npmjs.org/"
7
+ },
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "main": "./dist/dashboard.umd.js",
12
+ "module": "./dist/dashboard.es.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/dashboard.es.js",
17
+ "require": "./dist/dashboard.umd.js"
18
+ },
19
+ "./dist/style.css": {
20
+ "import": "./dist/style.css",
21
+ "require": "./dist/style.css"
22
+ }
23
+ },
24
+ "scripts": {
25
+ "dev": "vite",
26
+ "build": "tsc && vite build",
27
+ "preview": "vite preview"
28
+ },
29
+ "dependencies": {
30
+ "ahooks": "^3.3.11",
31
+ "echarts": "^5.3.2",
32
+ "echarts-for-react": "^3.0.2",
33
+ "echarts-gl": "^2.0.9",
34
+ "numbro": "^2.3.6",
35
+ "react": "^18.0.0",
36
+ "react-dom": "^18.0.0",
37
+ "react-grid-layout": "^1.3.4",
38
+ "react-hook-form": "^7.31.2"
39
+ },
40
+ "devDependencies": {
41
+ "@mantine/core": "^4.2.5",
42
+ "@mantine/dates": "^4.2.5",
43
+ "@mantine/form": "^4.2.5",
44
+ "@mantine/hooks": "^4.2.5",
45
+ "@mantine/notifications": "^4.2.5",
46
+ "@mantine/prism": "^4.2.5",
47
+ "@types/lodash": "^4.14.182",
48
+ "@types/react": "^18.0.0",
49
+ "@types/react-dom": "^18.0.0",
50
+ "@types/react-grid-layout": "^1.3.2",
51
+ "@vitejs/plugin-react": "^1.3.0",
52
+ "axios": "^0.27.2",
53
+ "lodash": "^4.17.21",
54
+ "tabler-icons-react": "^1.48.0",
55
+ "typescript": "^4.6.3",
56
+ "vite": "^2.9.9",
57
+ "vite-plugin-dts": "^1.1.1"
58
+ },
59
+ "peerDependencies": {
60
+ "@mantine/core": "^4.2.5",
61
+ "@mantine/dates": "^4.2.5",
62
+ "@mantine/form": "^4.2.5",
63
+ "@mantine/hooks": "^4.2.5",
64
+ "@mantine/notifications": "^4.2.5",
65
+ "@mantine/prism": "^4.2.5",
66
+ "axios": "^0.27.2",
67
+ "lodash": "^4.17.21",
68
+ "react": "^16.8.0 || 17.x || 18.x",
69
+ "react-dom": "^16.8.0 || 17.x || 18.x",
70
+ "tabler-icons-react": "^1.48.0"
71
+ }
72
+ }