@isoftdata/utility-dashboard-backend 4.1.0 → 4.2.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.
@@ -1,4 +1,5 @@
1
1
  import type { NumberFormatOptions, MediumDateFormatOptions, LongDateFormatOptions } from '../formatting-templates.js';
2
+ import type { ReportBodyStyleOptions } from './report.js';
2
3
  export type GoogleDataTableCell = {
3
4
  v?: unknown;
4
5
  f?: string | undefined;
@@ -152,17 +153,8 @@ export type TableStyleTemplate = {
152
153
  [key: string]: string | undefined;
153
154
  };
154
155
  export type ChartSuperType = 'google' | 'table' | 'embed' | 'markdown';
155
- export interface ChartBase extends ChartJson {
156
- chartId: number;
157
- name: string;
158
- showChart: boolean;
159
- supertype: ChartSuperType;
160
- title: string;
161
- description?: string;
162
- dataSourceName?: string;
163
- rank?: number;
164
- reportChartId?: number;
165
- }
156
+ export type ChartCardStyleFields = 'backgroundColor' | 'backgroundAlpha';
157
+ export type ChartCardStyleOptions = Pick<ReportBodyStyleOptions, ChartCardStyleFields>;
166
158
  export interface ChartJson {
167
159
  allowExport?: boolean;
168
160
  chartWrapper: ChartWrapper | ChartDimensions;
@@ -179,6 +171,20 @@ export interface ChartJson {
179
171
  markdown?: {
180
172
  content: string;
181
173
  };
174
+ cardStyle?: ChartCardStyleOptions;
175
+ headerStyle?: ChartCardStyleOptions;
176
+ bodyStyle?: ChartCardStyleOptions;
177
+ }
178
+ export interface ChartBase extends ChartJson {
179
+ chartId: number;
180
+ name: string;
181
+ showChart: boolean;
182
+ supertype: ChartSuperType;
183
+ title: string;
184
+ description?: string;
185
+ dataSourceName?: string;
186
+ rank?: number;
187
+ reportChartId?: number;
182
188
  }
183
189
  interface GoogleChart extends ChartBase {
184
190
  query: string;
@@ -10,6 +10,7 @@ export interface Report {
10
10
  parameterValues: DashboardReportParameter[];
11
11
  autoRefreshInterval: number | null;
12
12
  hideParameters?: boolean;
13
+ bodyStyle?: ReportBodyStyleOptions;
13
14
  }
14
15
  export interface ReportInput {
15
16
  dashboardReportId: number;
@@ -21,5 +22,16 @@ export interface ReportInput {
21
22
  ownerId: number | null;
22
23
  autoRefreshInterval: number | null;
23
24
  parameters: DashboardReportParameter[];
25
+ bodyStyle?: ReportBodyStyleOptions;
24
26
  }
25
27
  export type ShareType = 'everyone' | 'store' | 'user' | 'group';
28
+ export type ReportBodyStyleOptions = {
29
+ backgroundColor: string | undefined;
30
+ backgroundAlpha: string | undefined;
31
+ backgroundImage: string | undefined;
32
+ backgroundPosition: 'top' | 'bottom' | 'left' | 'right' | 'center' | 'CUSTOM' | undefined;
33
+ backgroundPositionX: string | undefined;
34
+ backgroundPositionY: string | undefined;
35
+ backgroundSize: 'auto' | 'contain' | 'cover' | 'CUSTOM' | undefined;
36
+ backgroundSizePercent: string | undefined;
37
+ };
package/package.json CHANGED
@@ -1,55 +1,54 @@
1
- {
2
- "name": "@isoftdata/utility-dashboard-backend",
3
- "version": "4.1.0",
4
- "description": "A utility for formatting chart and report data to be usable by the frontend dashboard component.",
5
- "main": "dist/index.js",
6
- "type": "module",
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "build": "tsc",
10
- "prepublishOnly": "npm run build"
11
- },
12
- "author": "Charles Kaup",
13
- "license": "ISC",
14
- "files": [
15
- "dist/**/*.*"
16
- ],
17
- "types": "dist/index.d.ts",
18
- "exports": {
19
- ".": {
20
- "import": "./dist/index.js",
21
- "types": "./dist/index.d.ts"
22
- },
23
- "./chart-helper": {
24
- "import": "./dist/chart-helper.js",
25
- "types": "./dist/chart-helper.d.ts"
26
- }
27
- },
28
- "dependencies": {
29
- "@isoftdata/utility-date-time": "^4.3.1",
30
- "camelcase": "^6.3.0",
31
- "date-fns": "^4.1.0",
32
- "deepmerge": "^4.2.2",
33
- "klona": "^2.0.6",
34
- "mathjs": "^11.5.0",
35
- "to-snake-case": "^1.0.0"
36
- },
37
- "devDependencies": {
38
- "@isoftdata/eslint-config-typescript": "^3.1.4",
39
- "@isoftdata/prettier-config-base": "^1.0.3",
40
- "@types/google.visualization": "^0.0.68",
41
- "@types/node": "^18.19.130",
42
- "@types/to-snake-case": "^1.0.2",
43
- "package-preview": "^4.0.0",
44
- "prettier": "^3.7.4",
45
- "type-fest": "^4.41.0",
46
- "typescript": "^5.9.3"
47
- },
48
- "peerDependencies": {
49
- "@isoftdata/utility-db": ">4.2.0"
50
- },
51
- "prettier": "@isoftdata/prettier-config-base",
52
- "engines": {
53
- "pnpm": "10.x"
54
- }
55
- }
1
+ {
2
+ "name": "@isoftdata/utility-dashboard-backend",
3
+ "version": "4.2.1",
4
+ "description": "A utility for formatting chart and report data to be usable by the frontend dashboard component.",
5
+ "main": "dist/index.js",
6
+ "type": "module",
7
+ "author": "Charles Kaup",
8
+ "license": "ISC",
9
+ "files": [
10
+ "dist/**/*.*"
11
+ ],
12
+ "types": "dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/index.js",
16
+ "types": "./dist/index.d.ts"
17
+ },
18
+ "./chart-helper": {
19
+ "import": "./dist/chart-helper.js",
20
+ "types": "./dist/chart-helper.d.ts"
21
+ }
22
+ },
23
+ "dependencies": {
24
+ "@isoftdata/utility-date-time": "^4.3.1",
25
+ "camelcase": "^6.3.0",
26
+ "date-fns": "^4.1.0",
27
+ "deepmerge": "^4.2.2",
28
+ "klona": "^2.0.6",
29
+ "mathjs": "^11.5.0",
30
+ "to-snake-case": "^1.0.0"
31
+ },
32
+ "devDependencies": {
33
+ "@isoftdata/eslint-config-typescript": "^3.1.4",
34
+ "@isoftdata/prettier-config-base": "^1.0.3",
35
+ "@types/google.visualization": "^0.0.68",
36
+ "@types/node": "^18.19.130",
37
+ "@types/to-snake-case": "^1.0.2",
38
+ "package-preview": "^4.0.0",
39
+ "prettier": "^3.7.4",
40
+ "type-fest": "^4.41.0",
41
+ "typescript": "^5.9.3"
42
+ },
43
+ "peerDependencies": {
44
+ "@isoftdata/utility-db": ">4.2.0"
45
+ },
46
+ "prettier": "@isoftdata/prettier-config-base",
47
+ "engines": {
48
+ "pnpm": "10.x"
49
+ },
50
+ "scripts": {
51
+ "test": "echo \"Error: no test specified\" && exit 1",
52
+ "build": "tsc"
53
+ }
54
+ }