@oneuptime/common 7.0.3198 → 7.0.3200
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/Server/Types/Markdown.ts +4 -0
- package/Types/Dashboard/Chart/ChartType.ts +5 -2
- package/Types/Dashboard/DashboardComponentType.ts +7 -0
- package/Types/Dashboard/DashboardComponents/DashboardBaseComponent.ts +6 -1
- package/Types/Dashboard/DashboardComponents/{ChartDashboardComponent.ts → DashboardChartComponent.ts} +3 -2
- package/Types/Dashboard/DashboardComponents/DashboardTextComponent.ts +9 -0
- package/Types/Dashboard/DashboardComponents/DashboardValueComponent.ts +8 -0
- package/Types/Dashboard/DashboardMode.ts +6 -0
- package/Types/Dashboard/DashboardSize.ts +8 -2
- package/Types/Dashboard/DashboardViewConfig.ts +3 -1
- package/Types/JSON.ts +7 -0
- package/UI/Components/Button/Button.tsx +21 -1
- package/UI/Components/MoreMenu/MoreMenu.tsx +11 -10
- package/Utils/Dashboard/Components/DashboardBaseComponent.ts +8 -0
- package/Utils/Dashboard/Components/DashboardChartComponent.ts +19 -0
- package/Utils/Dashboard/Components/DashboardTextComponent.ts +18 -0
- package/Utils/Dashboard/Components/DashboardValueComponent.ts +17 -0
- package/Utils/Dashboard/DashboardViewConfig.ts +59 -1
- package/build/dist/Server/Types/Markdown.js +3 -0
- package/build/dist/Server/Types/Markdown.js.map +1 -1
- package/build/dist/Types/Dashboard/Chart/ChartType.js +6 -1
- package/build/dist/Types/Dashboard/Chart/ChartType.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponentType.js +8 -0
- package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardChartComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardChartComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardTextComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardTextComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardValueComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardValueComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardMode.js +7 -0
- package/build/dist/Types/Dashboard/DashboardMode.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardSize.js +4 -1
- package/build/dist/Types/Dashboard/DashboardSize.js.map +1 -1
- package/build/dist/Types/JSON.js +5 -0
- package/build/dist/Types/JSON.js.map +1 -1
- package/build/dist/UI/Components/Button/Button.js +16 -1
- package/build/dist/UI/Components/Button/Button.js.map +1 -1
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js +4 -5
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js.map +1 -1
- package/build/dist/Utils/Dashboard/Components/DashboardBaseComponent.js +7 -0
- package/build/dist/Utils/Dashboard/Components/DashboardBaseComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardChartComponent.js +18 -0
- package/build/dist/Utils/Dashboard/Components/DashboardChartComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardTextComponent.js +17 -0
- package/build/dist/Utils/Dashboard/Components/DashboardTextComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardValueComponent.js +16 -0
- package/build/dist/Utils/Dashboard/Components/DashboardValueComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/DashboardViewConfig.js +33 -1
- package/build/dist/Utils/Dashboard/DashboardViewConfig.js.map +1 -1
- package/package.json +2 -2
- package/Types/Dashboard/DashboardComponents/ValueDashboardComponent.ts +0 -3
- package/build/dist/Types/Dashboard/DashboardComponents/ChartDashboardComponent.js +0 -2
- package/build/dist/Types/Dashboard/DashboardComponents/ChartDashboardComponent.js.map +0 -1
- package/build/dist/Types/Dashboard/DashboardComponents/ValueDashboardComponent.js +0 -2
- package/build/dist/Types/Dashboard/DashboardComponents/ValueDashboardComponent.js.map +0 -1
package/Server/Types/Markdown.ts
CHANGED
|
@@ -17,6 +17,10 @@ export default class Markdown {
|
|
|
17
17
|
markdown: string,
|
|
18
18
|
contentType: MarkdownContentType,
|
|
19
19
|
): Promise<string> {
|
|
20
|
+
// convert tags > and < to > and <
|
|
21
|
+
markdown = markdown.replace(/</g, "<");
|
|
22
|
+
markdown = markdown.replace(/>/g, ">");
|
|
23
|
+
|
|
20
24
|
let renderer: Renderer | null = null;
|
|
21
25
|
|
|
22
26
|
if (contentType === MarkdownContentType.Blog) {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { ObjectType } from "../../JSON";
|
|
1
2
|
import ObjectID from "../../ObjectID";
|
|
2
3
|
|
|
3
4
|
export default interface DashboardBaseComponent {
|
|
4
|
-
|
|
5
|
+
_type: ObjectType;
|
|
5
6
|
componentId: ObjectID;
|
|
7
|
+
topInDashboardUnits: number;
|
|
8
|
+
leftInDashboardUnits: number;
|
|
9
|
+
widthInDashboardUnits: number;
|
|
10
|
+
heightInDashboardUnits: number;
|
|
6
11
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { ObjectType } from "../../JSON";
|
|
1
2
|
import ObjectID from "../../ObjectID";
|
|
2
3
|
import ChartType from "../Chart/ChartType";
|
|
3
4
|
import BaseComponent from "./DashboardBaseComponent";
|
|
4
5
|
|
|
5
|
-
export default interface
|
|
6
|
-
|
|
6
|
+
export default interface DashboardChartComponent extends BaseComponent {
|
|
7
|
+
_type: ObjectType.DashboardChartComponent;
|
|
7
8
|
componentId: ObjectID;
|
|
8
9
|
chartType: ChartType;
|
|
9
10
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ObjectType } from "../../JSON";
|
|
2
|
+
import ObjectID from "../../ObjectID";
|
|
3
|
+
import BaseComponent from "./DashboardBaseComponent";
|
|
4
|
+
|
|
5
|
+
export default interface DashboardTextComponent extends BaseComponent {
|
|
6
|
+
_type: ObjectType.DashboardTextComponent;
|
|
7
|
+
componentId: ObjectID;
|
|
8
|
+
text: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ObjectType } from "../../JSON";
|
|
2
|
+
import ObjectID from "../../ObjectID";
|
|
3
|
+
import BaseComponent from "./DashboardBaseComponent";
|
|
4
|
+
|
|
5
|
+
export default interface DashboardValueComponent extends BaseComponent {
|
|
6
|
+
_type: ObjectType.DashboardValueComponent;
|
|
7
|
+
componentId: ObjectID;
|
|
8
|
+
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
export interface DashboardSize {
|
|
2
2
|
widthInDashboardUnits: number;
|
|
3
|
-
|
|
3
|
+
heightInDashboardUnits: number;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
const DefaultDashboardSize: DashboardSize = {
|
|
7
7
|
widthInDashboardUnits: 12,
|
|
8
|
-
|
|
8
|
+
heightInDashboardUnits: 60,
|
|
9
9
|
};
|
|
10
|
+
// 5 rem is the dashboard unit width, and 0.94 is margin between those units.
|
|
11
|
+
|
|
12
|
+
export const DashboardRemConversionFactor: number = 5.94;
|
|
13
|
+
|
|
14
|
+
export const TotalWidthOfDashboardInRem: number =
|
|
15
|
+
DefaultDashboardSize.widthInDashboardUnits * DashboardRemConversionFactor;
|
|
10
16
|
|
|
11
17
|
export default DefaultDashboardSize;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ObjectType } from "../JSON";
|
|
1
2
|
import DashboardBaseComponent from "./DashboardComponents/DashboardBaseComponent";
|
|
2
3
|
|
|
3
4
|
export default interface DashboardViewConfig {
|
|
4
|
-
_type:
|
|
5
|
+
_type: ObjectType.DashboardViewConfig;
|
|
5
6
|
components: Array<DashboardBaseComponent>;
|
|
7
|
+
heightInDashboardUnits: number;
|
|
6
8
|
}
|
package/Types/JSON.ts
CHANGED
|
@@ -64,6 +64,13 @@ export enum ObjectType {
|
|
|
64
64
|
NotNull = "NotNull",
|
|
65
65
|
IsNull = "IsNull",
|
|
66
66
|
Includes = "Includes",
|
|
67
|
+
|
|
68
|
+
// Dashboard Components.
|
|
69
|
+
|
|
70
|
+
DashboardViewConfig = "DashboardViewConfig",
|
|
71
|
+
DashboardTextComponent = "DashboardTextComponent",
|
|
72
|
+
DashboardValueComponent = "DashboardValueComponent",
|
|
73
|
+
DashboardChartComponent = "DashboardChartComponent",
|
|
67
74
|
}
|
|
68
75
|
|
|
69
76
|
export type JSONValue =
|
|
@@ -20,6 +20,9 @@ export enum ButtonStyleType {
|
|
|
20
20
|
LINK,
|
|
21
21
|
SECONDARY_LINK,
|
|
22
22
|
ICON,
|
|
23
|
+
HOVER_DANGER_OUTLINE,
|
|
24
|
+
HOVER_SUCCESS_OUTLINE,
|
|
25
|
+
HOVER_PRIMARY_OUTLINE,
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
export enum ButtonSize {
|
|
@@ -173,8 +176,25 @@ const Button: FunctionComponent<ComponentProps> = ({
|
|
|
173
176
|
} focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`;
|
|
174
177
|
}
|
|
175
178
|
|
|
176
|
-
if (
|
|
179
|
+
if (
|
|
180
|
+
buttonStyle === ButtonStyleType.OUTLINE ||
|
|
181
|
+
buttonStyle === ButtonStyleType.HOVER_DANGER_OUTLINE ||
|
|
182
|
+
buttonStyle === ButtonStyleType.HOVER_SUCCESS_OUTLINE ||
|
|
183
|
+
buttonStyle === ButtonStyleType.HOVER_PRIMARY_OUTLINE
|
|
184
|
+
) {
|
|
177
185
|
buttonStyleCssClass = `flex btn-outline-secondary background-very-light-Gray500-on-hover sm:text-sm ml-1`;
|
|
186
|
+
|
|
187
|
+
if (buttonStyle === ButtonStyleType.HOVER_DANGER_OUTLINE) {
|
|
188
|
+
buttonStyleCssClass += ` hover:text-red-500`;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (buttonStyle === ButtonStyleType.HOVER_SUCCESS_OUTLINE) {
|
|
192
|
+
buttonStyleCssClass += ` hover:text-green-500`;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (buttonStyle === ButtonStyleType.HOVER_PRIMARY_OUTLINE) {
|
|
196
|
+
buttonStyleCssClass += ` hover:text-indigo-500`;
|
|
197
|
+
}
|
|
178
198
|
}
|
|
179
199
|
|
|
180
200
|
if (buttonStyle === ButtonStyleType.SUCCESS) {
|
|
@@ -7,11 +7,13 @@ import React, {
|
|
|
7
7
|
} from "react";
|
|
8
8
|
import IconProp from "../../../Types/Icon/IconProp";
|
|
9
9
|
import useComponentOutsideClick from "../../Types/UseComponentOutsideClick";
|
|
10
|
-
import
|
|
10
|
+
import Button, { ButtonStyleType } from "../Button/Button";
|
|
11
11
|
|
|
12
12
|
export interface ComponentProps {
|
|
13
13
|
children: Array<ReactElement>;
|
|
14
14
|
elementToBeShownInsteadOfButton?: ReactElement | undefined;
|
|
15
|
+
menuIcon?: IconProp | undefined;
|
|
16
|
+
text?: string | undefined;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
const MoreMenu: React.ForwardRefExoticComponent<
|
|
@@ -44,15 +46,14 @@ const MoreMenu: React.ForwardRefExoticComponent<
|
|
|
44
46
|
return (
|
|
45
47
|
<div className="relative inline-block text-left">
|
|
46
48
|
{!props.elementToBeShownInsteadOfButton && (
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</div>
|
|
49
|
+
<Button
|
|
50
|
+
icon={props.menuIcon || IconProp.More}
|
|
51
|
+
title={props.text || ""}
|
|
52
|
+
buttonStyle={ButtonStyleType.OUTLINE}
|
|
53
|
+
onClick={() => {
|
|
54
|
+
setIsComponentVisible(!isDropdownVisible);
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
56
57
|
)}
|
|
57
58
|
|
|
58
59
|
{props.elementToBeShownInsteadOfButton && (
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import DashboardBaseComponent from "../../../Types/Dashboard/DashboardComponents/DashboardBaseComponent";
|
|
2
|
+
import NotImplementedException from "../../../Types/Exception/NotImplementedException";
|
|
3
|
+
|
|
4
|
+
export default class DashboardBaseComponentUtil {
|
|
5
|
+
public static getDefaultComponent(): DashboardBaseComponent {
|
|
6
|
+
throw new NotImplementedException();
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import DashboardChartComponent from "../../../Types/Dashboard/DashboardComponents/DashboardChartComponent";
|
|
2
|
+
import { ObjectType } from "../../../Types/JSON";
|
|
3
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
4
|
+
import DashboardBaseComponentUtil from "./DashboardBaseComponent";
|
|
5
|
+
import DashboardChartType from "../../../Types/Dashboard/Chart/ChartType";
|
|
6
|
+
|
|
7
|
+
export default class DashboardChartComponentUtil extends DashboardBaseComponentUtil {
|
|
8
|
+
public static override getDefaultComponent(): DashboardChartComponent {
|
|
9
|
+
return {
|
|
10
|
+
_type: ObjectType.DashboardChartComponent,
|
|
11
|
+
widthInDashboardUnits: 8,
|
|
12
|
+
heightInDashboardUnits: 6,
|
|
13
|
+
topInDashboardUnits: 0,
|
|
14
|
+
leftInDashboardUnits: 0,
|
|
15
|
+
componentId: ObjectID.generate(),
|
|
16
|
+
chartType: DashboardChartType.Line,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import DashboardTextComponent from "../../../Types/Dashboard/DashboardComponents/DashboardTextComponent";
|
|
2
|
+
import { ObjectType } from "../../../Types/JSON";
|
|
3
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
4
|
+
import DashboardBaseComponentUtil from "./DashboardBaseComponent";
|
|
5
|
+
|
|
6
|
+
export default class DashboardTextComponentUtil extends DashboardBaseComponentUtil {
|
|
7
|
+
public static override getDefaultComponent(): DashboardTextComponent {
|
|
8
|
+
return {
|
|
9
|
+
_type: ObjectType.DashboardTextComponent,
|
|
10
|
+
widthInDashboardUnits: 3,
|
|
11
|
+
heightInDashboardUnits: 1,
|
|
12
|
+
topInDashboardUnits: 0,
|
|
13
|
+
leftInDashboardUnits: 0,
|
|
14
|
+
text: "Hello, World!",
|
|
15
|
+
componentId: ObjectID.generate(),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import DashboardValueComponent from "../../../Types/Dashboard/DashboardComponents/DashboardValueComponent";
|
|
2
|
+
import { ObjectType } from "../../../Types/JSON";
|
|
3
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
4
|
+
import DashboardBaseComponentUtil from "./DashboardBaseComponent";
|
|
5
|
+
|
|
6
|
+
export default class DashboardValueComponentUtil extends DashboardBaseComponentUtil {
|
|
7
|
+
public static override getDefaultComponent(): DashboardValueComponent {
|
|
8
|
+
return {
|
|
9
|
+
_type: ObjectType.DashboardValueComponent,
|
|
10
|
+
widthInDashboardUnits: 3,
|
|
11
|
+
heightInDashboardUnits: 1,
|
|
12
|
+
topInDashboardUnits: 0,
|
|
13
|
+
leftInDashboardUnits: 0,
|
|
14
|
+
componentId: ObjectID.generate(),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,10 +1,68 @@
|
|
|
1
1
|
import DashboardViewConfig from "../../Types/Dashboard/DashboardViewConfig";
|
|
2
|
+
import { ObjectType } from "../../Types/JSON";
|
|
3
|
+
import DashboardSize from "../../Types/Dashboard/DashboardSize";
|
|
4
|
+
import DashboardBaseComponent from "../../Types/Dashboard/DashboardComponents/DashboardBaseComponent";
|
|
2
5
|
|
|
3
6
|
export default class DashboardViewConfigUtil {
|
|
4
7
|
public static createDefaultDashboardViewConfig(): DashboardViewConfig {
|
|
5
8
|
return {
|
|
6
|
-
_type:
|
|
9
|
+
_type: ObjectType.DashboardViewConfig,
|
|
7
10
|
components: [],
|
|
11
|
+
heightInDashboardUnits: DashboardSize.heightInDashboardUnits,
|
|
8
12
|
};
|
|
9
13
|
}
|
|
14
|
+
|
|
15
|
+
public static addComponentToDashboard(data: {
|
|
16
|
+
component: DashboardBaseComponent;
|
|
17
|
+
dashboardViewConfig: DashboardViewConfig;
|
|
18
|
+
}): DashboardViewConfig {
|
|
19
|
+
const heightOfComponent: number = data.component.heightInDashboardUnits;
|
|
20
|
+
|
|
21
|
+
// find the last row that has enough space to fit the component. If there is no such row, create a new row or rows to fit the component.
|
|
22
|
+
const allComponentsFromDashboard: Array<DashboardBaseComponent> =
|
|
23
|
+
data.dashboardViewConfig.components;
|
|
24
|
+
|
|
25
|
+
let componentTopPosition: number = 0;
|
|
26
|
+
let componentLeftPosition: number = 0;
|
|
27
|
+
|
|
28
|
+
// find the last row that has the component.
|
|
29
|
+
|
|
30
|
+
let lastRowThatHasComponent: number = -1;
|
|
31
|
+
|
|
32
|
+
for (const dashboardComponent of allComponentsFromDashboard) {
|
|
33
|
+
if (
|
|
34
|
+
componentTopPosition <
|
|
35
|
+
dashboardComponent.topInDashboardUnits +
|
|
36
|
+
dashboardComponent.heightInDashboardUnits
|
|
37
|
+
) {
|
|
38
|
+
lastRowThatHasComponent = componentTopPosition;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
componentTopPosition = lastRowThatHasComponent + 1;
|
|
43
|
+
|
|
44
|
+
// check height of the component. If it is bigger than the last row that has the component, create more rows and udate the height of dashboardViewConfig.
|
|
45
|
+
|
|
46
|
+
if (
|
|
47
|
+
componentTopPosition + heightOfComponent >
|
|
48
|
+
data.dashboardViewConfig.heightInDashboardUnits
|
|
49
|
+
) {
|
|
50
|
+
data.dashboardViewConfig.heightInDashboardUnits =
|
|
51
|
+
componentTopPosition + heightOfComponent;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// left position of the component is always 0.
|
|
55
|
+
componentLeftPosition = 0;
|
|
56
|
+
|
|
57
|
+
const newComponent: DashboardBaseComponent = {
|
|
58
|
+
...data.component,
|
|
59
|
+
topInDashboardUnits: componentTopPosition,
|
|
60
|
+
leftInDashboardUnits: componentLeftPosition,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Add the new component to the dashboard configuration
|
|
64
|
+
data.dashboardViewConfig.components.push(newComponent);
|
|
65
|
+
|
|
66
|
+
return { ...data.dashboardViewConfig };
|
|
67
|
+
}
|
|
10
68
|
}
|
|
@@ -7,6 +7,9 @@ export var MarkdownContentType;
|
|
|
7
7
|
})(MarkdownContentType || (MarkdownContentType = {}));
|
|
8
8
|
class Markdown {
|
|
9
9
|
static async convertToHTML(markdown, contentType) {
|
|
10
|
+
// convert tags > and < to > and <
|
|
11
|
+
markdown = markdown.replace(/</g, "<");
|
|
12
|
+
markdown = markdown.replace(/>/g, ">");
|
|
10
13
|
let renderer = null;
|
|
11
14
|
if (contentType === MarkdownContentType.Blog) {
|
|
12
15
|
renderer = this.getBlogRenderer();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../../../Server/Types/Markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAI1C,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,6DAAI,CAAA;IACJ,6DAAI,CAAA;IACJ,+DAAK,CAAA;AACP,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AAED,MAAqB,QAAQ;IAKpB,MAAM,CAAC,KAAK,CAAC,aAAa,CAC/B,QAAgB,EAChB,WAAgC;QAEhC,IAAI,QAAQ,GAAoB,IAAI,CAAC;QAErC,IAAI,WAAW,KAAK,mBAAmB,CAAC,IAAI,EAAE,CAAC;YAC7C,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACpC,CAAC;QAED,IAAI,WAAW,KAAK,mBAAmB,CAAC,IAAI,EAAE,CAAC;YAC7C,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACpC,CAAC;QAED,IAAI,WAAW,KA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AAE,QAAQ;YACtC,OAAO,wBAAwB,QAAQ,sCAAsC,QAAQ,gBAAgB,IAAI,eAAe,CAAC;QAC3H,CAAC,CAAC;QAEF,QAAQ,CAAC,OAAO,GAAG,UAAU,IAAI,EAAE,KAAK;YACtC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBAChB,OAAO,yEAAyE,IAAI,OAAO,CAAC;YAC9F,CAAC;iBAAM,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACvB,OAAO,0EAA0E,IAAI,OAAO,CAAC;YAC/F,CAAC;iBAAM,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACvB,OAAO,0EAA0E,IAAI,OAAO,CAAC;YAC/F,CAAC;iBAAM,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACvB,OAAO,yEAAyE,IAAI,OAAO,CAAC;YAC9F,CAAC;iBAAM,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACvB,OAAO,yEAAyE,IAAI,OAAO,CAAC;YAC9F,CAAC;YACD,OAAO,2DAA2D,IAAI,OAAO,CAAC;QAChF,CAAC,CAAC;QAEF,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;QAE7B,OAAO,QAAQ,CAAC;IAClB,CAAC;;AAjIc,qBAAY,GAAoB,IAAI,CAAC;AACrC,qBAAY,GAAoB,IAAI,CAAC;AACrC,sBAAa,GAAoB,IAAI,CAAC;eAHlC,QAAQ"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
var DashboardChartType;
|
|
2
|
+
(function (DashboardChartType) {
|
|
3
|
+
DashboardChartType["Line"] = "Line";
|
|
4
|
+
DashboardChartType["Bar"] = "Bar";
|
|
5
|
+
})(DashboardChartType || (DashboardChartType = {}));
|
|
6
|
+
export default DashboardChartType;
|
|
2
7
|
//# sourceMappingURL=ChartType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartType.js","sourceRoot":"","sources":["../../../../../Types/Dashboard/Chart/ChartType.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ChartType.js","sourceRoot":"","sources":["../../../../../Types/Dashboard/Chart/ChartType.ts"],"names":[],"mappings":"AAAA,IAAK,kBAGJ;AAHD,WAAK,kBAAkB;IACrB,mCAAa,CAAA;IACb,iCAAW,CAAA;AACb,CAAC,EAHI,kBAAkB,KAAlB,kBAAkB,QAGtB;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var DashboardComponentType;
|
|
2
|
+
(function (DashboardComponentType) {
|
|
3
|
+
DashboardComponentType["Chart"] = "Chart";
|
|
4
|
+
DashboardComponentType["Value"] = "Value";
|
|
5
|
+
DashboardComponentType["Text"] = "Text";
|
|
6
|
+
})(DashboardComponentType || (DashboardComponentType = {}));
|
|
7
|
+
export default DashboardComponentType;
|
|
8
|
+
//# sourceMappingURL=DashboardComponentType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardComponentType.js","sourceRoot":"","sources":["../../../../Types/Dashboard/DashboardComponentType.ts"],"names":[],"mappings":"AAAA,IAAK,sBAIJ;AAJD,WAAK,sBAAsB;IACzB,yCAAe,CAAA;IACf,yCAAe,CAAA;IACf,uCAAa,CAAA;AACf,CAAC,EAJI,sBAAsB,KAAtB,sBAAsB,QAI1B;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardChartComponent.js","sourceRoot":"","sources":["../../../../../Types/Dashboard/DashboardComponents/DashboardChartComponent.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardTextComponent.js","sourceRoot":"","sources":["../../../../../Types/Dashboard/DashboardComponents/DashboardTextComponent.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardValueComponent.js","sourceRoot":"","sources":["../../../../../Types/Dashboard/DashboardComponents/DashboardValueComponent.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardMode.js","sourceRoot":"","sources":["../../../../Types/Dashboard/DashboardMode.ts"],"names":[],"mappings":"AAAA,IAAK,aAGJ;AAHD,WAAK,aAAa;IAChB,8BAAa,CAAA;IACb,8BAAa,CAAA;AACf,CAAC,EAHI,aAAa,KAAb,aAAa,QAGjB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const DefaultDashboardSize = {
|
|
2
2
|
widthInDashboardUnits: 12,
|
|
3
|
-
|
|
3
|
+
heightInDashboardUnits: 60,
|
|
4
4
|
};
|
|
5
|
+
// 5 rem is the dashboard unit width, and 0.94 is margin between those units.
|
|
6
|
+
export const DashboardRemConversionFactor = 5.94;
|
|
7
|
+
export const TotalWidthOfDashboardInRem = DefaultDashboardSize.widthInDashboardUnits * DashboardRemConversionFactor;
|
|
5
8
|
export default DefaultDashboardSize;
|
|
6
9
|
//# sourceMappingURL=DashboardSize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardSize.js","sourceRoot":"","sources":["../../../../Types/Dashboard/DashboardSize.ts"],"names":[],"mappings":"AAKA,MAAM,oBAAoB,GAAkB;IAC1C,qBAAqB,EAAE,EAAE;IACzB,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"DashboardSize.js","sourceRoot":"","sources":["../../../../Types/Dashboard/DashboardSize.ts"],"names":[],"mappings":"AAKA,MAAM,oBAAoB,GAAkB;IAC1C,qBAAqB,EAAE,EAAE;IACzB,sBAAsB,EAAE,EAAE;CAC3B,CAAC;AACF,6EAA6E;AAE7E,MAAM,CAAC,MAAM,4BAA4B,GAAW,IAAI,CAAC;AAEzD,MAAM,CAAC,MAAM,0BAA0B,GACrC,oBAAoB,CAAC,qBAAqB,GAAG,4BAA4B,CAAC;AAE5E,eAAe,oBAAoB,CAAC"}
|
package/build/dist/Types/JSON.js
CHANGED
|
@@ -35,5 +35,10 @@ export var ObjectType;
|
|
|
35
35
|
ObjectType["NotNull"] = "NotNull";
|
|
36
36
|
ObjectType["IsNull"] = "IsNull";
|
|
37
37
|
ObjectType["Includes"] = "Includes";
|
|
38
|
+
// Dashboard Components.
|
|
39
|
+
ObjectType["DashboardViewConfig"] = "DashboardViewConfig";
|
|
40
|
+
ObjectType["DashboardTextComponent"] = "DashboardTextComponent";
|
|
41
|
+
ObjectType["DashboardValueComponent"] = "DashboardValueComponent";
|
|
42
|
+
ObjectType["DashboardChartComponent"] = "DashboardChartComponent";
|
|
38
43
|
})(ObjectType || (ObjectType = {}));
|
|
39
44
|
//# sourceMappingURL=JSON.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JSON.js","sourceRoot":"","sources":["../../../Types/JSON.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"JSON.js","sourceRoot":"","sources":["../../../Types/JSON.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAN,IAAY,UA2CX;AA3CD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,6CAA+B,CAAA;IAC/B,2CAA6B,CAAA;IAC7B,yCAA2B,CAAA;IAC3B,qCAAuB,CAAA;IACvB,mDAAqC,CAAA;IACrC,iDAAmC,CAAA;IACnC,+CAAiC,CAAA;IACjC,iEAAmD,CAAA;IACnD,mCAAqB,CAAA;IACrB,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,uBAAS,CAAA;IACT,6BAAe,CAAA;IACf,yBAAW,CAAA;IACX,uCAAyB,CAAA;IACzB,+BAAiB,CAAA;IACjB,yCAA2B,CAAA;IAC3B,uDAAyC,CAAA;IACzC,mCAAqB,CAAA;IACrB,iDAAmC,CAAA;IACnC,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,2CAA6B,CAAA;IAC7B,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;IACjB,qCAAuB,CAAA;IACvB,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IAErB,wBAAwB;IAExB,yDAA2C,CAAA;IAC3C,+DAAiD,CAAA;IACjD,iEAAmD,CAAA;IACnD,iEAAmD,CAAA;AACrD,CAAC,EA3CW,UAAU,KAAV,UAAU,QA2CrB"}
|
|
@@ -18,6 +18,9 @@ export var ButtonStyleType;
|
|
|
18
18
|
ButtonStyleType[ButtonStyleType["LINK"] = 11] = "LINK";
|
|
19
19
|
ButtonStyleType[ButtonStyleType["SECONDARY_LINK"] = 12] = "SECONDARY_LINK";
|
|
20
20
|
ButtonStyleType[ButtonStyleType["ICON"] = 13] = "ICON";
|
|
21
|
+
ButtonStyleType[ButtonStyleType["HOVER_DANGER_OUTLINE"] = 14] = "HOVER_DANGER_OUTLINE";
|
|
22
|
+
ButtonStyleType[ButtonStyleType["HOVER_SUCCESS_OUTLINE"] = 15] = "HOVER_SUCCESS_OUTLINE";
|
|
23
|
+
ButtonStyleType[ButtonStyleType["HOVER_PRIMARY_OUTLINE"] = 16] = "HOVER_PRIMARY_OUTLINE";
|
|
21
24
|
})(ButtonStyleType || (ButtonStyleType = {}));
|
|
22
25
|
export var ButtonSize;
|
|
23
26
|
(function (ButtonSize) {
|
|
@@ -103,8 +106,20 @@ const Button = ({ title, onClick, disabled, id, shortcutKey, type = ButtonType.B
|
|
|
103
106
|
if (buttonStyle === ButtonStyleType.ICON) {
|
|
104
107
|
buttonStyleCssClass = `rounded-md bg-white text-gray-600 ${disabled ? "hover:text-gray-900" : ""} focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`;
|
|
105
108
|
}
|
|
106
|
-
if (buttonStyle === ButtonStyleType.OUTLINE
|
|
109
|
+
if (buttonStyle === ButtonStyleType.OUTLINE ||
|
|
110
|
+
buttonStyle === ButtonStyleType.HOVER_DANGER_OUTLINE ||
|
|
111
|
+
buttonStyle === ButtonStyleType.HOVER_SUCCESS_OUTLINE ||
|
|
112
|
+
buttonStyle === ButtonStyleType.HOVER_PRIMARY_OUTLINE) {
|
|
107
113
|
buttonStyleCssClass = `flex btn-outline-secondary background-very-light-Gray500-on-hover sm:text-sm ml-1`;
|
|
114
|
+
if (buttonStyle === ButtonStyleType.HOVER_DANGER_OUTLINE) {
|
|
115
|
+
buttonStyleCssClass += ` hover:text-red-500`;
|
|
116
|
+
}
|
|
117
|
+
if (buttonStyle === ButtonStyleType.HOVER_SUCCESS_OUTLINE) {
|
|
118
|
+
buttonStyleCssClass += ` hover:text-green-500`;
|
|
119
|
+
}
|
|
120
|
+
if (buttonStyle === ButtonStyleType.HOVER_PRIMARY_OUTLINE) {
|
|
121
|
+
buttonStyleCssClass += ` hover:text-indigo-500`;
|
|
122
|
+
}
|
|
108
123
|
}
|
|
109
124
|
if (buttonStyle === ButtonStyleType.SUCCESS) {
|
|
110
125
|
buttonStyleCssClass = `inline-flex w-full justify-center rounded-md border border-transparent bg-green-600 text-base font-medium text-white shadow-sm ${disabled ? "hover:bg-green-700" : ""} focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 sm:ml-3 sm:w-auto sm:text-sm`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../UI/Components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,IAAkB,MAAM,cAAc,CAAC;AAE9C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,KAAK,EAAE,EAAmC,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1E,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../UI/Components/Button/Button.tsx"],"names":[],"mappings":"AACA,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C,CAAC,CAAC,EACpC,mHAAmH,CAAC;IACtH,CAAC;IAED,mBAAmB,IAAI,GAAG,GAAG,UAAU,CAAC;IAExC,IAAI,SAAS,EAAE,CAAC;QACd,mBAAmB,IAAI,GAAG,GAAG,SAAS,CAAC;IACzC,CAAC;IAED,OAAO,CACL,gCACE,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC,iBACY,UAAU,EACvB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,IAAI,SAAS,EAC/B,SAAS,EAAE,mBAAmB;QAE7B,SAAS,IAAI,WAAW,KAAK,eAAe,CAAC,IAAI,IAAI,CACpD,oBAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,oBAAoB,GAAI,CAClE;QAEA,CAAC,SAAS,IAAI,IAAI,IAAI,CACrB,oBAAC,IAAI,IACH,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,aAAa,EACxB,IAAI,EAAE,QAAQ,IAAI,SAAS,GAC3B,CACH;QAEA,KAAK,IAAI,WAAW,KAAK,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QAE1D,WAAW,IAAI,CACd,6BAAK,SAAS,EAAC,MAAM;YACnB,6BAAK,SAAS,EAAC,0GAA0G,IACtH,WAAW,CACR,CACF,CACP,CACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef, useEffect, useImperativeHandle, useState, } from "react";
|
|
2
2
|
import IconProp from "../../../Types/Icon/IconProp";
|
|
3
3
|
import useComponentOutsideClick from "../../Types/UseComponentOutsideClick";
|
|
4
|
-
import
|
|
4
|
+
import Button, { ButtonStyleType } from "../Button/Button";
|
|
5
5
|
const MoreMenu = forwardRef((props, componentRef) => {
|
|
6
6
|
const { ref, isComponentVisible, setIsComponentVisible } = useComponentOutsideClick(false);
|
|
7
7
|
useImperativeHandle(componentRef, () => {
|
|
@@ -22,10 +22,9 @@ const MoreMenu = forwardRef((props, componentRef) => {
|
|
|
22
22
|
setDropdownVisible(isComponentVisible);
|
|
23
23
|
}, [isComponentVisible]);
|
|
24
24
|
return (React.createElement("div", { className: "relative inline-block text-left" },
|
|
25
|
-
!props.elementToBeShownInsteadOfButton && (React.createElement(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} }))),
|
|
25
|
+
!props.elementToBeShownInsteadOfButton && (React.createElement(Button, { icon: props.menuIcon || IconProp.More, title: props.text || "", buttonStyle: ButtonStyleType.OUTLINE, onClick: () => {
|
|
26
|
+
setIsComponentVisible(!isDropdownVisible);
|
|
27
|
+
} })),
|
|
29
28
|
props.elementToBeShownInsteadOfButton && (React.createElement("div", null, props.elementToBeShownInsteadOfButton)),
|
|
30
29
|
isComponentVisible && (React.createElement("div", { ref: ref, className: "absolute right-0 z-10 mt-2 w-56 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none", role: "menu", "aria-orientation": "vertical", "aria-labelledby": "menu-button" }, props.children.map((child, index) => {
|
|
31
30
|
return (React.createElement("div", { key: index, role: "menuitem", onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoreMenu.js","sourceRoot":"","sources":["../../../../../UI/Components/MoreMenu/MoreMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,UAAU,EAEV,SAAS,EACT,mBAAmB,EACnB,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,wBAAwB,MAAM,sCAAsC,CAAC;AAC5E,OAAO,
|
|
1
|
+
{"version":3,"file":"MoreMenu.js","sourceRoot":"","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AAG,EAAE;gBACZ,qBAAqB,CAAC,CAAC,iBAAiB,CAAC,CAAC;YAC5C,CAAC,GACD,CACH;QAEA,KAAK,CAAC,+BAA+B,IAAI,CACxC,iCAAM,KAAK,CAAC,+BAA+B,CAAO,CACnD;QAEA,kBAAkB,IAAI,CACrB,6BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAC,6JAA6J,EACvK,IAAI,EAAC,MAAM,sBACM,UAAU,qBACX,aAAa,IAE5B,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAmB,EAAE,KAAa,EAAE,EAAE;YACzD,OAAO,CACL,6BACE,GAAG,EAAE,KAAK,EACV,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,GAAG,EAAE;oBACZ,IAAI,kBAAkB,EAAE,CAAC;wBACvB,qBAAqB,CAAC,KAAK,CAAC,CAAC;oBAC/B,CAAC;gBACH,CAAC,IAEA,KAAK,CACF,CACP,CAAC;QACJ,CAAC,CAAC,CACE,CACP,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import NotImplementedException from "../../../Types/Exception/NotImplementedException";
|
|
2
|
+
export default class DashboardBaseComponentUtil {
|
|
3
|
+
static getDefaultComponent() {
|
|
4
|
+
throw new NotImplementedException();
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=DashboardBaseComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardBaseComponent.js","sourceRoot":"","sources":["../../../../../Utils/Dashboard/Components/DashboardBaseComponent.ts"],"names":[],"mappings":"AACA,OAAO,uBAAuB,MAAM,kDAAkD,CAAC;AAEvF,MAAM,CAAC,OAAO,OAAO,0BAA0B;IACtC,MAAM,CAAC,mBAAmB;QAC/B,MAAM,IAAI,uBAAuB,EAAE,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ObjectType } from "../../../Types/JSON";
|
|
2
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
3
|
+
import DashboardBaseComponentUtil from "./DashboardBaseComponent";
|
|
4
|
+
import DashboardChartType from "../../../Types/Dashboard/Chart/ChartType";
|
|
5
|
+
export default class DashboardChartComponentUtil extends DashboardBaseComponentUtil {
|
|
6
|
+
static getDefaultComponent() {
|
|
7
|
+
return {
|
|
8
|
+
_type: ObjectType.DashboardChartComponent,
|
|
9
|
+
widthInDashboardUnits: 8,
|
|
10
|
+
heightInDashboardUnits: 6,
|
|
11
|
+
topInDashboardUnits: 0,
|
|
12
|
+
leftInDashboardUnits: 0,
|
|
13
|
+
componentId: ObjectID.generate(),
|
|
14
|
+
chartType: DashboardChartType.Line,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=DashboardChartComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardChartComponent.js","sourceRoot":"","sources":["../../../../../Utils/Dashboard/Components/DashboardChartComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,0BAA0B,MAAM,0BAA0B,CAAC;AAClE,OAAO,kBAAkB,MAAM,0CAA0C,CAAC;AAE1E,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,0BAA0B;IAC1E,MAAM,CAAU,mBAAmB;QACxC,OAAO;YACL,KAAK,EAAE,UAAU,CAAC,uBAAuB;YACzC,qBAAqB,EAAE,CAAC;YACxB,sBAAsB,EAAE,CAAC;YACzB,mBAAmB,EAAE,CAAC;YACtB,oBAAoB,EAAE,CAAC;YACvB,WAAW,EAAE,QAAQ,CAAC,QAAQ,EAAE;YAChC,SAAS,EAAE,kBAAkB,CAAC,IAAI;SACnC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ObjectType } from "../../../Types/JSON";
|
|
2
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
3
|
+
import DashboardBaseComponentUtil from "./DashboardBaseComponent";
|
|
4
|
+
export default class DashboardTextComponentUtil extends DashboardBaseComponentUtil {
|
|
5
|
+
static getDefaultComponent() {
|
|
6
|
+
return {
|
|
7
|
+
_type: ObjectType.DashboardTextComponent,
|
|
8
|
+
widthInDashboardUnits: 3,
|
|
9
|
+
heightInDashboardUnits: 1,
|
|
10
|
+
topInDashboardUnits: 0,
|
|
11
|
+
leftInDashboardUnits: 0,
|
|
12
|
+
text: "Hello, World!",
|
|
13
|
+
componentId: ObjectID.generate(),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=DashboardTextComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardTextComponent.js","sourceRoot":"","sources":["../../../../../Utils/Dashboard/Components/DashboardTextComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,0BAA0B,MAAM,0BAA0B,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,0BAA2B,SAAQ,0BAA0B;IACzE,MAAM,CAAU,mBAAmB;QACxC,OAAO;YACL,KAAK,EAAE,UAAU,CAAC,sBAAsB;YACxC,qBAAqB,EAAE,CAAC;YACxB,sBAAsB,EAAE,CAAC;YACzB,mBAAmB,EAAE,CAAC;YACtB,oBAAoB,EAAE,CAAC;YACvB,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,QAAQ,CAAC,QAAQ,EAAE;SACjC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ObjectType } from "../../../Types/JSON";
|
|
2
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
3
|
+
import DashboardBaseComponentUtil from "./DashboardBaseComponent";
|
|
4
|
+
export default class DashboardValueComponentUtil extends DashboardBaseComponentUtil {
|
|
5
|
+
static getDefaultComponent() {
|
|
6
|
+
return {
|
|
7
|
+
_type: ObjectType.DashboardValueComponent,
|
|
8
|
+
widthInDashboardUnits: 3,
|
|
9
|
+
heightInDashboardUnits: 1,
|
|
10
|
+
topInDashboardUnits: 0,
|
|
11
|
+
leftInDashboardUnits: 0,
|
|
12
|
+
componentId: ObjectID.generate(),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=DashboardValueComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardValueComponent.js","sourceRoot":"","sources":["../../../../../Utils/Dashboard/Components/DashboardValueComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,0BAA0B,MAAM,0BAA0B,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,0BAA0B;IAC1E,MAAM,CAAU,mBAAmB;QACxC,OAAO;YACL,KAAK,EAAE,UAAU,CAAC,uBAAuB;YACzC,qBAAqB,EAAE,CAAC;YACxB,sBAAsB,EAAE,CAAC;YACzB,mBAAmB,EAAE,CAAC;YACtB,oBAAoB,EAAE,CAAC;YACvB,WAAW,EAAE,QAAQ,CAAC,QAAQ,EAAE;SACjC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,9 +1,41 @@
|
|
|
1
|
+
import { ObjectType } from "../../Types/JSON";
|
|
2
|
+
import DashboardSize from "../../Types/Dashboard/DashboardSize";
|
|
1
3
|
export default class DashboardViewConfigUtil {
|
|
2
4
|
static createDefaultDashboardViewConfig() {
|
|
3
5
|
return {
|
|
4
|
-
_type:
|
|
6
|
+
_type: ObjectType.DashboardViewConfig,
|
|
5
7
|
components: [],
|
|
8
|
+
heightInDashboardUnits: DashboardSize.heightInDashboardUnits,
|
|
6
9
|
};
|
|
7
10
|
}
|
|
11
|
+
static addComponentToDashboard(data) {
|
|
12
|
+
const heightOfComponent = data.component.heightInDashboardUnits;
|
|
13
|
+
// find the last row that has enough space to fit the component. If there is no such row, create a new row or rows to fit the component.
|
|
14
|
+
const allComponentsFromDashboard = data.dashboardViewConfig.components;
|
|
15
|
+
let componentTopPosition = 0;
|
|
16
|
+
let componentLeftPosition = 0;
|
|
17
|
+
// find the last row that has the component.
|
|
18
|
+
let lastRowThatHasComponent = -1;
|
|
19
|
+
for (const dashboardComponent of allComponentsFromDashboard) {
|
|
20
|
+
if (componentTopPosition <
|
|
21
|
+
dashboardComponent.topInDashboardUnits +
|
|
22
|
+
dashboardComponent.heightInDashboardUnits) {
|
|
23
|
+
lastRowThatHasComponent = componentTopPosition;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
componentTopPosition = lastRowThatHasComponent + 1;
|
|
27
|
+
// check height of the component. If it is bigger than the last row that has the component, create more rows and udate the height of dashboardViewConfig.
|
|
28
|
+
if (componentTopPosition + heightOfComponent >
|
|
29
|
+
data.dashboardViewConfig.heightInDashboardUnits) {
|
|
30
|
+
data.dashboardViewConfig.heightInDashboardUnits =
|
|
31
|
+
componentTopPosition + heightOfComponent;
|
|
32
|
+
}
|
|
33
|
+
// left position of the component is always 0.
|
|
34
|
+
componentLeftPosition = 0;
|
|
35
|
+
const newComponent = Object.assign(Object.assign({}, data.component), { topInDashboardUnits: componentTopPosition, leftInDashboardUnits: componentLeftPosition });
|
|
36
|
+
// Add the new component to the dashboard configuration
|
|
37
|
+
data.dashboardViewConfig.components.push(newComponent);
|
|
38
|
+
return Object.assign({}, data.dashboardViewConfig);
|
|
39
|
+
}
|
|
8
40
|
}
|
|
9
41
|
//# sourceMappingURL=DashboardViewConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardViewConfig.js","sourceRoot":"","sources":["../../../../Utils/Dashboard/DashboardViewConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DashboardViewConfig.js","sourceRoot":"","sources":["../../../../Utils/Dashboard/DashboardViewConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,aAAa,MAAM,qCAAqC,CAAC;AAGhE,MAAM,CAAC,OAAO,OAAO,uBAAuB;IACnC,MAAM,CAAC,gCAAgC;QAC5C,OAAO;YACL,KAAK,EAAE,UAAU,CAAC,mBAAmB;YACrC,UAAU,EAAE,EAAE;YACd,sBAAsB,EAAE,aAAa,CAAC,sBAAsB;SAC7D,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,uBAAuB,CAAC,IAGrC;QACC,MAAM,iBAAiB,GAAW,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC;QAExE,wIAAwI;QACxI,MAAM,0BAA0B,GAC9B,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC;QAEtC,IAAI,oBAAoB,GAAW,CAAC,CAAC;QACrC,IAAI,qBAAqB,GAAW,CAAC,CAAC;QAEtC,4CAA4C;QAE5C,IAAI,uBAAuB,GAAW,CAAC,CAAC,CAAC;QAEzC,KAAK,MAAM,kBAAkB,IAAI,0BAA0B,EAAE,CAAC;YAC5D,IACE,oBAAoB;gBACpB,kBAAkB,CAAC,mBAAmB;oBACpC,kBAAkB,CAAC,sBAAsB,EAC3C,CAAC;gBACD,uBAAuB,GAAG,oBAAoB,CAAC;YACjD,CAAC;QACH,CAAC;QAED,oBAAoB,GAAG,uBAAuB,GAAG,CAAC,CAAC;QAEnD,yJAAyJ;QAEzJ,IACE,oBAAoB,GAAG,iBAAiB;YACxC,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,EAC/C,CAAC;YACD,IAAI,CAAC,mBAAmB,CAAC,sBAAsB;gBAC7C,oBAAoB,GAAG,iBAAiB,CAAC;QAC7C,CAAC;QAED,8CAA8C;QAC9C,qBAAqB,GAAG,CAAC,CAAC;QAE1B,MAAM,YAAY,mCACb,IAAI,CAAC,SAAS,KACjB,mBAAmB,EAAE,oBAAoB,EACzC,oBAAoB,EAAE,qBAAqB,GAC5C,CAAC;QAEF,uDAAuD;QACvD,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEvD,yBAAY,IAAI,CAAC,mBAAmB,EAAG;IACzC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneuptime/common",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3200",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"airtable": "^0.12.2",
|
|
78
78
|
"axios": "^1.7.2",
|
|
79
79
|
"bullmq": "^5.3.3",
|
|
80
|
-
"Common": "npm:@oneuptime/common@7.0.
|
|
80
|
+
"Common": "npm:@oneuptime/common@7.0.3200",
|
|
81
81
|
"cookie-parser": "^1.4.7",
|
|
82
82
|
"cors": "^2.8.5",
|
|
83
83
|
"cron-parser": "^4.8.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChartDashboardComponent.js","sourceRoot":"","sources":["../../../../../Types/Dashboard/DashboardComponents/ChartDashboardComponent.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ValueDashboardComponent.js","sourceRoot":"","sources":["../../../../../Types/Dashboard/DashboardComponents/ValueDashboardComponent.ts"],"names":[],"mappings":""}
|