@mescius/activereportsnet-viewer 19.0.0 → 19.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mescius/activereportsnet-viewer",
3
- "version": "19.0.0",
3
+ "version": "19.1.1",
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",
@@ -1,6 +1,3 @@
1
- import { ColorTheme } from '@dt/core-ui';
2
- export { ColorTheme, ColorThemeShades } from '@dt/core-ui';
3
-
4
1
  /** Type representing a viewer's sidebar instance. */
5
2
  interface Sidebar {
6
3
  /**
@@ -201,6 +198,37 @@ interface Toolbar {
201
198
  fullscreen: ToolbarItems;
202
199
  }
203
200
 
201
+ /** Represents a color item with multiple shades. */
202
+ type ColorThemeShades = {
203
+ veryLight: string;
204
+ light: string;
205
+ lighter: string;
206
+ lightMedium: string;
207
+ medium: string;
208
+ base: string;
209
+ darkMedium: string;
210
+ darker: string;
211
+ dark: string;
212
+ veryDark: string;
213
+ };
214
+ /** Specifies the type of the color theme. */
215
+ type ColorThemeType = 'light' | 'dark';
216
+ /** Represents a color item in a color theme. */
217
+ type ColorThemeItem = string | ColorThemeShades;
218
+ /** Represents the UI theme settings for customizing the appearance. */
219
+ type ColorTheme = {
220
+ name: string;
221
+ type: ColorThemeType;
222
+ backgroundMain: string;
223
+ backgroundPanels: string;
224
+ primary?: ColorThemeItem;
225
+ secondary?: ColorThemeItem;
226
+ neutral?: ColorThemeItem;
227
+ error?: ColorThemeItem;
228
+ warning?: ColorThemeItem;
229
+ fontFamily?: string;
230
+ };
231
+ /** Represents the default themes */
204
232
  declare const ColorThemes: {
205
233
  default: ColorTheme;
206
234
  defaultDark: ColorTheme;
@@ -211,6 +239,36 @@ declare const ColorThemes: {
211
239
  activeReportsDark: ColorTheme;
212
240
  };
213
241
 
242
+ /** Result of an action. */
243
+ interface ActionResult {
244
+ /** Whether the action should be canceled. */
245
+ cancel: boolean;
246
+ }
247
+ /** Information about an action. */
248
+ interface ActionInfo {
249
+ /** Type of the action. */
250
+ type: ActionType;
251
+ /** Parameters associated with the action, if any. */
252
+ parameters?: ActionParameter[];
253
+ /** Target of the action, if any. */
254
+ target?: ActionTarget;
255
+ }
256
+ /** Possible action types. */
257
+ type ActionType = 'toggle' | 'sort' | 'bookmark' | 'hyperlink' | 'drillthrough' | 'applyParameters';
258
+ /** Parameters for an action. */
259
+ type ActionParameter = {
260
+ /** Parameter name. */
261
+ name: string;
262
+ /** Type of the apply parameter. */
263
+ type?: 'Set' | 'Reset' | 'Toggle';
264
+ /** Values associated with the parameter. */
265
+ values: any[];
266
+ };
267
+ /** Target of an action. */
268
+ type ActionTarget = {
269
+ pageNumber: number;
270
+ selector?: string;
271
+ } | string;
214
272
  /** Report types. */
215
273
  declare enum ReportType {
216
274
  Section = 0,
@@ -242,6 +300,7 @@ interface ParameterDescriptor {
242
300
  defaultValue: ParameterValue;
243
301
  displayFormat: string;
244
302
  actualDefaultValues: ParameterValue[];
303
+ enableEmptyArray: boolean;
245
304
  }
246
305
  /** Describes the report. */
247
306
  interface ReportInfo {
@@ -446,6 +505,9 @@ type HoverChartAnimationOptions = {
446
505
  /** The following options can be set during initialization or at run time while working with the JS Viewer. */
447
506
  interface InitializationOptions {
448
507
  /**
508
+ * * @deprecated This property is deprecated and will be removed in future versions.
509
+ * Use the new `onAction` property instead.
510
+ *
449
511
  * The callback that is invoked before the JS Viewer opens the hyperlink, bookmark link,
450
512
  * drill down report or toggles the report control visibility.
451
513
  * @example Usage example:
@@ -465,6 +527,39 @@ interface InitializationOptions {
465
527
  * ```
466
528
  */
467
529
  action?: (actionType: string, actionParams: any[], actionTarget: string) => void;
530
+ /**
531
+ * The callback that is triggered before the JS Viewer executes an action.
532
+ *
533
+ * @param action - An object containing details about the action being triggered.
534
+ * @returns A promise that resolves to an `ActionResult`, determining how the action should be handled.
535
+ *
536
+ * @example Usage example:
537
+ * ```javascript
538
+ * // ESM usage
539
+ * import { createViewer } from './jsViewer.min.js';
540
+ * const viewer = createViewer({
541
+ * onAction: async (action) => {
542
+ * if (action.type === 'hyperlink') {
543
+ * return { cancel: true }; // Prevent opening the link
544
+ * }
545
+ * return { cancel: false };
546
+ * }
547
+ * });
548
+ * ```
549
+ * @example Usage example:
550
+ * ```javascript
551
+ * // UMD usage
552
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
553
+ * onAction: async (action) => {
554
+ * if (action.type === 'hyperlink') {
555
+ * return { cancel: true }; // Prevent opening the link
556
+ * }
557
+ * return { cancel: false };
558
+ * }
559
+ * });
560
+ * ```
561
+ */
562
+ onAction?: (action: ActionInfo) => Promise<ActionResult>;
468
563
  /** The report view animation options.
469
564
  * @example Usage example:
470
565
  * ```javascript
@@ -1698,4 +1793,4 @@ declare function createViewer(params: InitializationOptions): JSViewer;
1698
1793
  */
1699
1794
  declare function printReport(printOptions: PrintOptions, isCancelRequested?: () => boolean): Promise<void>;
1700
1795
 
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 };
1796
+ export { type ActionInfo, type ActionParameter, type ActionResult, type ActionTarget, type ActionType, type AnimationOptions, type ColorTheme, type ColorThemeItem, type ColorThemeShades, type ColorThemeType, 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 ToolbarItem, type ToolbarItems, type ViewMode, type ViewerType, createViewer, exportReport, printReport };