@mescius/activereportsnet-viewer 18.2.0 → 19.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mescius/activereportsnet-viewer",
3
- "version": "18.2.0",
3
+ "version": "19.0.0",
4
4
  "description": "Fast, full featured, JavaScript report viewer for ActiveReports report definition files. Features include printing, exporting, and searching.",
5
5
  "main": "./dist/jsViewer.min.js",
6
6
  "module": "./esm/jsViewer.min.js",
@@ -13,6 +13,7 @@
13
13
  "dist/custom-locale.json",
14
14
  "dist/jsViewer.chart.min.js",
15
15
  "dist/jsViewer.chart.min.css",
16
+ "dist/jsViewer.custom.styles.css",
16
17
  "esm/",
17
18
  "types/"
18
19
  ],
@@ -1,52 +1,5 @@
1
- declare class Color {
2
- R: number;
3
- G: number;
4
- B: number;
5
- A: number | undefined;
6
- constructor(r: number, g: number, b: number, a?: number | undefined);
7
- static fromHEX(color: string): Color;
8
- }
9
- type UITheme$1<T extends Record<string, string> = Record<string, string>> = {
10
- name: string;
11
- accent: Color;
12
- accentText: Color;
13
- accentSecondary: Color;
14
- accentWarning: Color;
15
- accentWarningText?: Color;
16
- accentError: Color;
17
- accentErrorText?: Color;
18
- colorContrast: Color;
19
- colorContrastText: Color;
20
- backgroundBody: Color;
21
- backgroundBodyOverlay?: Color;
22
- backgroundPanels: Color;
23
- backgroundPanelsSection?: Color;
24
- backgroundPanelsBorder?: Color;
25
- backgroundPanelsOverlay?: Color;
26
- shadow: string;
27
- shadowBorder: string;
28
- overlay: Color;
29
- textColor: Color;
30
- textFamily?: string;
31
- borderRadius: number;
32
- elemBackground: Color;
33
- elemBackgroundHover: Color;
34
- btnGroupHeader: Color;
35
- btnGroupHeaderHover: Color;
36
- dropdownBackground: Color;
37
- dropdownBackgroundHover?: Color;
38
- dropdownBorder?: Color;
39
- bindingModified?: Color;
40
- bindingBound?: Color;
41
- custom?: T;
42
- };
43
- declare const UIThemes: {
44
- default: UITheme$1<Record<string, string>> | undefined;
45
- defaultDark: UITheme$1<Record<string, string>> | undefined;
46
- darkOled: UITheme$1<Record<string, string>> | undefined;
47
- highContrast: UITheme$1<Record<string, string>> | undefined;
48
- highContrastDark: UITheme$1<Record<string, string>> | undefined;
49
- };
1
+ import { ColorTheme } from '@dt/core-ui';
2
+ export { ColorTheme, ColorThemeShades } from '@dt/core-ui';
50
3
 
51
4
  /** Type representing a viewer's sidebar instance. */
52
5
  interface Sidebar {
@@ -90,7 +43,9 @@ declare enum ToolbarButtons {
90
43
  /** Galley mode switcher button. */
91
44
  GalleyMode = "$galleymode",
92
45
  /** 'Print' button. */
93
- Print = "$print"
46
+ Print = "$print",
47
+ /** Theme switcher button. */
48
+ Theme = "$theme"
94
49
  }
95
50
  /**
96
51
  * Type representing a viewer's toolbar item.
@@ -246,7 +201,15 @@ interface Toolbar {
246
201
  fullscreen: ToolbarItems;
247
202
  }
248
203
 
249
- type UITheme = UITheme$1;
204
+ declare const ColorThemes: {
205
+ default: ColorTheme;
206
+ defaultDark: ColorTheme;
207
+ darkOled: ColorTheme;
208
+ highContrast: ColorTheme;
209
+ highContrastDark: ColorTheme;
210
+ activeReports: ColorTheme;
211
+ activeReportsDark: ColorTheme;
212
+ };
250
213
 
251
214
  /** Report types. */
252
215
  declare enum ReportType {
@@ -490,18 +453,18 @@ interface InitializationOptions {
490
453
  * // ESM usage
491
454
  * import { createViewer } from './jsViewer.min.js';
492
455
  * const viewer = createViewer({
493
- * action: (actionType, actionParams) => console.log('Action type: ' + actionType + '; Action parameters: ' + actionParams)
456
+ * action: (actionType, actionParams, actionTarget) => console.log('Action type: ' + actionType + '; Action parameters: ' + actionParams + '; Action target: ' + actionTarget);
494
457
  * });
495
458
  * ```
496
459
  * @example Usage example:
497
460
  * ```javascript
498
461
  * // UMD usage
499
462
  * var viewer = GrapeCity.ActiveReports.JSViewer.create({
500
- * action: (actionType, actionParams) => console.log('Action type: ' + actionType + '; Action parameters: ' + actionParams)
463
+ * action: (actionType, actionParams, actionTarget) => console.log('Action type: ' + actionType + '; Action parameters: ' + actionParams + '; Action target: ' + actionTarget);
501
464
  * });
502
465
  * ```
503
466
  */
504
- action?: (actionType: string, actionParams: any[]) => void;
467
+ action?: (actionType: string, actionParams: any[], actionTarget: string) => void;
505
468
  /** The report view animation options.
506
469
  * @example Usage example:
507
470
  * ```javascript
@@ -1063,26 +1026,86 @@ interface InitializationOptions {
1063
1026
  */
1064
1027
  silentPrint?: boolean;
1065
1028
  /**
1066
- * Viewer's UI theme.
1029
+ * Viewer's UI themes settings.
1067
1030
  * @example Pre-defined theme selection USM example:
1068
1031
  * ```javascript
1069
1032
  * // ESM usage
1070
- * import {createViewer, UIThemes} from './jsViewer.min.js';
1033
+ * import {createViewer} from './jsViewer.min.js';
1071
1034
  * const viewer = createViewer({
1072
- * element: '#root',
1073
- * theme: UIThemes.defaultDark
1035
+ * element: '#root',
1036
+ * themes: {
1037
+ * initialTheme: 'defaultDark',
1038
+ * }
1039
+ * },
1074
1040
  * });
1075
1041
  * ```
1076
1042
  *
1077
1043
  * @example Pre-defined theme selection example:
1078
1044
  * ```javascript
1079
1045
  * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1080
- * theme: GrapeCity.ActiveReports.JSViewer.Themes.darkOled
1046
+ * themes: {
1047
+ * initialTheme: 'defaultDark',
1048
+ * }
1081
1049
  * });
1082
1050
  * ```
1083
1051
  */
1084
- theme?: UITheme;
1052
+ themes?: ThemeSettings;
1053
+ /**
1054
+ * Specifies custom css styles that will be applied to the report items.
1055
+ * @example Usage example:
1056
+ * ```javascript
1057
+ * // ESM usage
1058
+ * import { createViewer } from './jsViewer.min.js';
1059
+ * const viewer = createViewer({
1060
+ * reportItemsStyles: {
1061
+ * cssUri: 'custom-styles.css'
1062
+ * }
1063
+ * });
1064
+ * ```
1065
+ * @example Usage example:
1066
+ * ```javascript
1067
+ * // UMD usage
1068
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1069
+ * reportItemsStyles: {
1070
+ * cssUri: 'custom-styles.css'
1071
+ * }
1072
+ * });
1073
+ * ```
1074
+ */
1075
+ reportItemsStyles?: ReportItemsStyles;
1085
1076
  }
1077
+ /** Defines the viewer's themes settings. */
1078
+ type ThemeSettings = {
1079
+ /**
1080
+ * The initial theme to be applied.
1081
+ * * @default "default"
1082
+ */
1083
+ initialTheme: string;
1084
+ themeSelector?: {
1085
+ /**
1086
+ * shows Theme Picker in UI
1087
+ *
1088
+ * @default true
1089
+ */
1090
+ enabled: boolean;
1091
+ /**
1092
+ * An array of available themes that can be picked by the user.
1093
+ * These themes can be either built-in themes or custom ones.
1094
+ *
1095
+ * @default ["default", "defaultDark", "darkOled", "highContrast", "highContrastDark", "activeReports"]
1096
+ */
1097
+ availableThemes: (string | ColorTheme)[];
1098
+ };
1099
+ };
1100
+ /** Defines the report item css styles. */
1101
+ type ReportItemsStyles = {
1102
+ /**
1103
+ * Specifies the URI of a custom css that will be applied to the report items.
1104
+ * @example
1105
+ * cssUri: 'custom-styles.css'
1106
+ */
1107
+ cssUri?: string;
1108
+ };
1086
1109
  /** The following options can be set during initialization or at run time while working with the JS Viewer. */
1087
1110
  interface ExportOptions extends PrintOptions {
1088
1111
  /**
@@ -1207,10 +1230,7 @@ interface PrintOptions {
1207
1230
  reportParameters?: Parameter[];
1208
1231
  /**
1209
1232
  * The callback that is invoked when an error occurs in the process of displaying the report.
1210
- * The default error panel does not appear if the callback returns true.
1211
- * The error parameter is an object that has a message property which allows the users to customize
1212
- * the error message and details property which allows to customize error details.
1213
- * @example To hide the default error panel:
1233
+ * @example To handle an error:
1214
1234
  * ```javascript
1215
1235
  * // ESM usage
1216
1236
  * import { printReport } from './jsViewer.min.js';
@@ -1219,25 +1239,11 @@ interface PrintOptions {
1219
1239
  * if (error.message) {
1220
1240
  * // show error message.
1221
1241
  * alert("Internal error! Please ask administrator.");
1222
- * // do not show default error message.
1223
- * }
1224
- * }
1225
- * }):
1226
- * ```
1227
- * * @example To customize the error message:
1228
- * ```javascript
1229
- * // ESM usage
1230
- * import { printReport } from './jsViewer.min.js';
1231
- * printReport({
1232
- * error: (error) => {
1233
- * if (error.message) {
1234
- * // show error message.
1235
- * return {message = "Custom message", caption = "Custom caption"};
1236
1242
  * }
1237
1243
  * }
1238
1244
  * }):
1239
1245
  * ```
1240
- * @example To hide the default error panel:
1246
+ * @example To handle an error:
1241
1247
  * ```javascript
1242
1248
  * // UMD usage
1243
1249
  * GrapeCity.ActiveReports.JSViewer.print({
@@ -1245,25 +1251,12 @@ interface PrintOptions {
1245
1251
  * if (error.message) {
1246
1252
  * // show error message.
1247
1253
  * alert("Internal error! Please ask administrator.");
1248
- * // do not show default error message.
1249
- * }
1250
- * }
1251
- * }):
1252
- * ```
1253
- * * @example To customize the error message:
1254
- * ```javascript
1255
- * // UMD usage
1256
- * GrapeCity.ActiveReports.JSViewer.print({
1257
- * error: (error) => {
1258
- * if (error.message) {
1259
- * // show error message.
1260
- * return {message = "Custom message", caption = "Custom caption"};
1261
1254
  * }
1262
1255
  * }
1263
1256
  * }):
1264
1257
  * ```
1265
1258
  */
1266
- error: (error: ErrorInfo) => ErrorInfo;
1259
+ error: (error: ErrorInfo) => void;
1267
1260
  /**
1268
1261
  * Set up the settings to connect the Web API.
1269
1262
  * @example Usage example:
@@ -1635,12 +1628,12 @@ interface JSViewer {
1635
1628
  * Gets or sets the viewer UI theme.
1636
1629
  * @example Usage example ESM:
1637
1630
  * ```javascript
1638
- * import {createViewer, UIThemes} from './jsViewer.min.js';
1631
+ * import {createViewer, ColorThemes} from './jsViewer.min.js';
1639
1632
  * const viewer = createViewer({
1640
1633
  * element: '#root',
1641
1634
  * });
1642
1635
  *
1643
- * viewer.theme = UIThemes.defaultDark;
1636
+ * viewer.theme = ColorThemes.defaultDark;
1644
1637
  * ```
1645
1638
  *
1646
1639
  * @example Usage example UMD:
@@ -1648,16 +1641,16 @@ interface JSViewer {
1648
1641
  * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1649
1642
  * element: '#root'
1650
1643
  * });
1651
- * viewer.theme: GrapeCity.ActiveReports.JSViewer.Themes.defaultDark
1644
+ * viewer.theme: ActiveReports.ColorThemes.defaultDark
1652
1645
  * ```
1653
1646
  */
1654
- theme?: UITheme;
1647
+ theme?: string | ColorTheme;
1655
1648
  }
1656
1649
 
1657
1650
  /**
1658
1651
  * Do export of the report without showing a viewer.
1659
1652
  * @param params The export options.
1660
- * @param isCancelRequested The function is periodically called with a check to cancel the export task.
1653
+ * @param isCancelRequested The function is periodically called with a check to cancel the export task.
1661
1654
  * @example Usage example:
1662
1655
  * ```javascript
1663
1656
  * // ESM usage
@@ -1705,4 +1698,4 @@ declare function createViewer(params: InitializationOptions): JSViewer;
1705
1698
  */
1706
1699
  declare function printReport(printOptions: PrintOptions, isCancelRequested?: () => boolean): Promise<void>;
1707
1700
 
1708
- export { type AnimationOptions, Color, type DefaultExportSettings, type ErrorInfo, type ErrorSeverity, type ExportCallback, type ExportOptions, type ExportTypes, type HoverChartAnimationOptions, type HoverTableAnimationOptions, type InitialZoomMode, type InitializationOptions, type JSViewer, type LoadChartAnimationOptions, type PageViewOptions, type PanelsLocation, type Parameter, type ParameterDescriptor, type ParametersPanelSettings, type Percentage, type PrintOptions, type RenderFormat, type RenderMode, type ReportInfo, type ReportServiceSettings, ReportType, type SearchOptions, type Sidebar, type SizeType, type Toolbar, ToolbarButtons, type UITheme, UIThemes, type ViewMode, type ViewerType, createViewer, exportReport, printReport };
1701
+ export { type AnimationOptions, ColorThemes, type DefaultExportSettings, type ErrorInfo, type ErrorSeverity, type ExportCallback, type ExportOptions, type ExportTypes, type HoverChartAnimationOptions, type HoverTableAnimationOptions, type InitialZoomMode, type InitializationOptions, type JSViewer, type LoadChartAnimationOptions, type PageViewOptions, type PanelsLocation, type Parameter, type ParameterDescriptor, type ParameterValue, type ParametersPanelSettings, type Percentage, type PrintOptions, type RenderFormat, type RenderMode, type ReportInfo, type ReportItemsStyles, type ReportServiceSettings, ReportType, type SearchOptions, type Sidebar, type SizeType, type ThemeSettings, type Toolbar, ToolbarButtons, type ViewMode, type ViewerType, createViewer, exportReport, printReport };