stimulsoft-viewer-angular
Version:
Stimulsoft Viewer Angular
1 lines • 1.04 MB
Source Map (JSON)
{"version":3,"file":"stimulsoft-viewer-angular.mjs","sources":["../../../projects/stimulsoft-viewer-angular/src/lib/services/objects.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/model.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/animation.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/helper.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/file.saver.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/http-client.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/styles.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/page.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/mouse.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/menu.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/forms/form.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/full-screen.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/controller.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/collections.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/export.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/mail.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/find.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/api.angular.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/dashboard-proxy.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/api.dashboard.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/api.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/print.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/dashboard.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/tooltip.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/md5.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/drill-down.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/interactions.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/radio-button.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/editable-fields.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/services/toolbar.service.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/button.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/toolbar-separator.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/checkbox.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/parameters/parameter-checkbox.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/text-box.componet.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/page-control.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/toolbar-dop.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/toolbar.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/page.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/report-panel.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/meni-item.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/parameters/parameter-text-box.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/parameters/parameter-button.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/parameter-menu-item.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/parameter-menu-separator.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/parameter-menu-edit-list.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/text-block.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/parameters/parameter-find.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/parameter-menu-not-edit-list.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/parameter-menu-for-value.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/parameter-menu-for-range.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/drop-down-list.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/date-picker-day-button.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/date-picker-menu.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/vertical-menu-item.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/vertical-menu.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/double-date-picker-menu.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/drop-down-list-for-export-form.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/document-security-menu.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/digital-signature-menu.component copy.ts","../../../projects/stimulsoft-viewer-angular/src/lib/menu/menu.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/tooltip.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/find-panel.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/bookmarks-panel.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/form-button.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/parameters/parameter.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/interactions-panel.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/forms/base-form.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/forms/group-panel.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/radio-button.components.ts","../../../projects/stimulsoft-viewer-angular/src/lib/forms/export-form.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/text-area.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/forms/send-email-form.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/drill-down-panel.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/open-dialog.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/forms/password-form.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/forms/error-message-form.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/resources-panel.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/progress.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/navigate-panel.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/about-panel.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/center-text.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/forms/notification-form.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/controls/dashboard-panel-button.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/components/dashboards-panel.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/stimulsoft-viewer-angular.component.ts","../../../projects/stimulsoft-viewer-angular/src/lib/stimulsoft-viewer-angular.module.ts","../../../projects/stimulsoft-viewer-angular/src/public-api.ts","../../../projects/stimulsoft-viewer-angular/src/stimulsoft-viewer-angular.ts"],"sourcesContent":["import { MenuItem } from '../menu/meni-item.component';\r\nimport { ElementRef, Injectable, Optional } from '@angular/core';\r\nimport { Subject, Observable } from 'rxjs';\r\nimport { PageService } from './page.service';\r\n\r\nexport class ComponentDescription {\r\n constructor(public type: string, public caption?: string, public img?: string, public action?: string,\r\n public tooltip?: boolean, public arrow?: string, public menuItems?: MenuItem[], public margin?: string, public selected?: boolean) {\r\n this.selected = false;\r\n }\r\n}\r\n\r\n\r\nexport class ViewerEvent {\r\n constructor(public name: string, public value?: any, public bookmarkPage?: number, public bookmarkAnchor?: string, public componentGuid?: string) { }\r\n}\r\n\r\nexport class ControlClass {\r\n public toolbar: ControlProps = new ControlProps();\r\n public reportPanel: ControlProps = new ControlProps();\r\n public drillDownPanel: ControlProps = new ControlProps();\r\n public findPanel: ControlProps = new ControlProps();\r\n public resourcesPanel: ControlProps = new ControlProps();\r\n public bookmarksPanel: ControlProps = new ControlProps();\r\n public navigatePanel: ControlProps = new ControlProps();\r\n public parametersPanel: ControlProps = new ControlProps();\r\n public dashboardsPanel: ControlProps = new ControlProps();\r\n public viewer: ControlProps = new ControlProps();\r\n public tooltip: ControlProps = new ControlProps();\r\n public aboutPanel: ControlProps = new ControlProps();\r\n\r\n public bookmarksLabel: any;\r\n\r\n constructor() { }\r\n\r\n public get head(): HTMLHeadElement {\r\n return document.getElementsByTagName('head')[0];\r\n }\r\n}\r\n\r\nexport class ControlProps {\r\n private _visible = false;\r\n private subject = new Subject<any>();\r\n\r\n public enabled = true;\r\n\r\n public layout: Rectangle = new Rectangle();\r\n constructor(public pageService?: PageService, public el?: ElementRef) { }\r\n\r\n public get offsetHeight(): number {\r\n return this.el?.nativeElement.offsetHeight || 0;\r\n }\r\n\r\n public get offsetWidth(): number {\r\n return this.el?.nativeElement.offsetWidth || 0;\r\n }\r\n\r\n public set visible(value: boolean) {\r\n this._visible = value;\r\n this.subject.next(value);\r\n this.pageService?.calculateLayout();\r\n }\r\n\r\n public get visible(): boolean {\r\n return this._visible;\r\n }\r\n\r\n public getVisibility(): Observable<any> {\r\n return this.subject.asObservable();\r\n }\r\n\r\n public get exists(): boolean {\r\n return this.el != null;\r\n }\r\n}\r\n\r\nexport class Rectangle {\r\n\r\n private _top: number = 0;\r\n\r\n public set top(value: number) {\r\n this._top = value;\r\n }\r\n\r\n public get top(): number {\r\n return this._top;\r\n }\r\n\r\n constructor(public width: number = 0, public height: number = 0, public left: number = 0,\r\n public bottom: number = 0, public right: number = 0) { }\r\n}\r\n\r\nexport class BookmarkNode {\r\n\r\n constructor(public name?: string, public url?: string, public page?: number, public compunentGuid?: string, public nodes?: BookmarkNode[],\r\n public open?: boolean, public selected?: boolean) { }\r\n\r\n}\r\n\r\nexport class InteractionParams {\r\n\r\n constructor(public action?: string, public drillDownParameters?: any, public drillDownGuid?: string, public dashboardDrillDownGuid?: string,\r\n public variables?: any, public sortingParameters?: any, public collapsingParameters?: any, public isBindingVariable?: true) { }\r\n}\r\n\r\nexport class InteractionObject {\r\n constructor(public paramsVariables: any[], public countColumns: any[], public countInColumn: any[]) { }\r\n}\r\n\r\nexport class Variable {\r\n constructor(public name?: string, public alias?: string, public description?: string, public basicType?: string, public type?: string,\r\n public allowUserValues?: boolean, public dateTimeType?: string, public items?: Variable[], public key?: any, public value?: any,\r\n public keyTo?: any, public isChecked: boolean = true, public focusOnCreate?: boolean, public visible: boolean = true, public binding?: boolean,\r\n public isNull?: boolean, public isFirstInitialization?: boolean, public checkedStates?: boolean[], public isChanged?: boolean,\r\n public allowNullableString?: boolean) { }\r\n}\r\n\r\nexport class DateTimeObject {\r\n constructor(public year?: number, public month?: number, public day?: number, public hours?: number, public minutes?: number, public seconds?: number) { }\r\n}\r\n\r\nexport class Item {\r\n constructor(public name?: string, public caption?: string, public imageName?: string, public key?: any, public haveSubMenu?: boolean, public imageSizes?: any,\r\n public selected?: boolean, public type?: string) { }\r\n}\r\n\r\nexport class Message {\r\n constructor(public action: string, public data?: any, public subAction?: string) { }\r\n}\r\n\r\nexport class Form {\r\n constructor(public name: string, public left: number, public top: number, public isMooving = false, public level?: number,\r\n public formData?: any) { }\r\n}\r\n\r\nexport class ExportFormSettings {\r\n constructor(public components: ExportComponent[], public cSettings?: any, public openAfterExport?: boolean, public groups?: any,\r\n public update?: boolean) { }\r\n}\r\n\r\nexport class ExportGroup {\r\n constructor(public opened: boolean) { }\r\n}\r\n\r\nexport class ExportComponent {\r\n constructor(public name: string, public type: string, public margin: string, public label?: string, public tooltip?: string,\r\n public caption?: string, public checked?: boolean, public width?: number, public disabled?: boolean, public items?: Item[],\r\n public key?: any) { }\r\n}\r\n\r\n\r\nexport class DrillDown {\r\n constructor(public caption: string, public selected: boolean = false, public reportParams: any,\r\n public visible: boolean) { }\r\n}\r\n\r\nexport class ErrorMessage {\r\n constructor(public error: string, public type: any) { }\r\n}\r\n\r\nexport class Resource {\r\n constructor(public name: string, public type: string, public alias: string, public id?: string) { }\r\n}\r\n\r\nexport class NotificationFormOptions {\r\n constructor(public image?: string, public message?: string, public description?: string, public buttonCaption?: string,\r\n public cancelAction?: any, public action?: any) { }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { ControlClass, DrillDown, ErrorMessage, InteractionObject, BookmarkNode, Form, NotificationFormOptions } from './objects';\r\n\r\n@Injectable()\r\nexport class ModelService {\r\n private _options: any;\r\n private _reportParams: any = {};\r\n private _imagesForBookmark: any;\r\n\r\n public requestUrl: string;\r\n public action: string;\r\n public properties: any;\r\n public showDashboard = false;\r\n public proxyData: any;\r\n\r\n public localization: any;\r\n public controls: ControlClass = new ControlClass();\r\n public pages: any[] = [];\r\n public months: string[] = [];\r\n public dayOfWeek: string[] = [];\r\n public dateRanges: string[] = [];\r\n public encodingData: any[] = [];\r\n public pdfSecurityCertificates: any[] = [];\r\n public paperSizes: string[] = [];\r\n public viewerSize: any;\r\n public drillDownButtons: DrillDown[] = [];\r\n public openDialogFileMask: string;\r\n public images: any;\r\n public errorMessage: ErrorMessage;\r\n public httpError: any;\r\n public interactions: InteractionObject;\r\n public nodes: BookmarkNode[];\r\n public navigateNode: BookmarkNode;\r\n public fullScreenOptions: any;\r\n public showProgress = false;\r\n public timerAutoUpdateCache: any;\r\n public refreshReportTimer: any;\r\n public toolbarHideTimer: any;\r\n public form: Form;\r\n public notificationFormOptions: NotificationFormOptions;\r\n public postParametersFunction: any;\r\n public dashboards: string;\r\n\r\n\r\n constructor() { }\r\n\r\n public get reportParams() {\r\n return this._reportParams;\r\n }\r\n\r\n public set reportParams(parameters: any) {\r\n this._reportParams.pagesArray = parameters.pagesArray;\r\n\r\n // Apply new report parameters, if not update current page\r\n if (parameters.action && parameters.action !== 'GetPages') {\r\n this.reportParams.type = parameters.reportType;\r\n this.reportParams.drillDownGuid = parameters.drillDownGuid;\r\n this.reportParams.dashboardDrillDownGuid = parameters.dashboardDrillDownGuid;\r\n this.reportParams.pagesCount = parameters.pagesCount;\r\n if (parameters.pageNumber != null) { this.reportParams.pageNumber = parameters.pageNumber; }\r\n this.reportParams.zoom = parameters.zoom;\r\n this.reportParams.viewMode = parameters.viewMode;\r\n this.reportParams.reportFileName = parameters.reportFileName;\r\n this.reportParams.collapsingStates = parameters.collapsingStates;\r\n if (parameters.bookmarksContent) { this.reportParams.bookmarksContent = parameters.bookmarksContent; }\r\n if (parameters.resources) { this.reportParams.resources = parameters.resources; }\r\n this.reportParams.isCompilationMode = parameters.isCompilationMode;\r\n if (parameters.variablesValues) { this.reportParams.variablesValues = parameters.variablesValues; }\r\n if (parameters.parametersDateFormat) { this.options.appearance.parametersPanelDateFormat = parameters.parametersDateFormat; }\r\n if (parameters.tableOfContentsPointers) this.reportParams.tableOfContentsPointers = parameters.tableOfContentsPointers;\r\n this.reportParams.isEditableReport = parameters.isEditableReport;\r\n if (parameters.userValues) { this.options.userValues = parameters.userValues; }\r\n this.reportParams.dashboards = parameters.dashboards;\r\n this.reportParams.previewSettings = parameters.previewSettings;\r\n }\r\n }\r\n\r\n public setReportParams(parameters: any) {\r\n this._reportParams = parameters;\r\n }\r\n\r\n public getReportParams() {\r\n return this.copyObject(this._reportParams);\r\n }\r\n\r\n public copyObject(o: any): any {\r\n if (!o || 'object' !== typeof o) {\r\n return o;\r\n }\r\n const c = 'function' === typeof o.pop ? [] : {};\r\n let p;\r\n let v;\r\n for (p in o) {\r\n if (o.hasOwnProperty(p) && p !== 'pagesArray') {\r\n v = o[p];\r\n if (v && 'object' === typeof v) {\r\n c[p] = this.copyObject(v);\r\n } else {\r\n c[p] = v;\r\n }\r\n }\r\n }\r\n return c;\r\n }\r\n\r\n public set options(data: any) {\r\n this._options = this.toLower(data.options);\r\n if (data.jsOptions) {\r\n for (const key in data.jsOptions) {\r\n if (data.jsOptions.hasOwnProperty(key)) {\r\n this._options[key] = data.jsOptions[key];\r\n }\r\n }\r\n }\r\n\r\n if (data.defaultSettings?.StiExcelExportSettings?.ExcelType != null) {\r\n let excelType = data.defaultSettings.StiExcelExportSettings.ExcelType;\r\n if (excelType == 'Excel2007') {\r\n excelType = 'Excel';\r\n } else if (excelType == 'ExcelBinary') {\r\n excelType = 'ExcelBiff';\r\n }\r\n data.defaultSettings.StiExcelExportSettings.ExcelType = excelType;\r\n }\r\n\r\n this._options.exports.defaultSettings = data.defaultSettings;\r\n this.localization = data.loc;\r\n this.months = data.months;\r\n this.dayOfWeek = data.dayOfWeek;\r\n this.images = data.images;\r\n this.dateRanges = data.dateRanges;\r\n this.paperSizes = data.paperSizes;\r\n this.encodingData = data.encodingData;\r\n this.pdfSecurityCertificates = data.pdfSecurityCertificates;\r\n this.clearViewerState();\r\n this.setupOptions();\r\n }\r\n\r\n public get options() {\r\n return this._options;\r\n }\r\n\r\n public loc(attr: string): string {\r\n return this.localization[attr] ?? attr;\r\n }\r\n\r\n public img(name: string): string {\r\n if (name != null && name.length > 0 && !this.images[name]) {\r\n //console.warn(`Image: ${name} not found`);\r\n }\r\n return this.images[name] ?? '';\r\n }\r\n\r\n private toLower(obj: any): any {\r\n const result = {};\r\n Object.keys(obj).forEach(key => {\r\n result[key.substr(0, 1).toLowerCase() + key.substr(1)] = (typeof (obj[key]) === 'object' && obj[key] !== null) ? this.toLower(obj[key]) : obj[key];\r\n });\r\n return result;\r\n }\r\n\r\n public clear() {\r\n this._options = undefined;\r\n this._reportParams = {};\r\n this._imagesForBookmark = undefined;\r\n this.pages = [];\r\n this.form = null;\r\n }\r\n\r\n public clearViewerState() {\r\n this.reportParams = {};\r\n this.reportParams.type = 'Auto';\r\n this.reportParams.pageNumber = 0;\r\n this.reportParams.originalPageNumber = 0;\r\n this.reportParams.drillDownGuid = null;\r\n this.reportParams.dashboardDrillDownGuid = null;\r\n this.reportParams.collapsingStates = null;\r\n this.reportParams.bookmarksContent = null;\r\n this.reportParams.editableParameters = null;\r\n this.reportParams.resources = null;\r\n this.reportParams.drillDownParameters = [];\r\n this.reportParams.elementName = null;\r\n this.reportParams.variablesValues = null;\r\n this.reportParams.tableOfContentsPointers = [];\r\n this.reportParams.isEditableReport = false;\r\n\r\n //this.options.viewerId = this.newToken();\r\n this.options.clientGuid = this.newToken();\r\n this.options.paramsVariables = null;\r\n this.options.multiFilterStates = null;\r\n this.options.isParametersReceived = false;\r\n this.options.drillDownInProgress = false;\r\n this.options.displayModeFromReport = null;\r\n this.options.currentParameterWidth = null;\r\n this.options.currentParameterAlignment = \"Left\";\r\n // this.controls.mainPanel.style.background = '';\r\n // this.tableElementGridStates = {};\r\n\r\n // Restore current page number, if reload current report\r\n if (this.reportParams.prevPageNumber) {\r\n this.reportParams.pageNumber = this.reportParams.prevPageNumber;\r\n delete this.reportParams.prevPageNumber;\r\n }\r\n\r\n this.fullScreenOptions = null;\r\n this.drillDownButtons = [];\r\n this.controls.parametersPanel.visible = false;\r\n this.controls.bookmarksPanel.visible = false;\r\n this.interactions = null;\r\n /*\r\n this.controls.drillDownPanel.visible = false;\r\n this.controls.findPanel.visible = false;\r\n this.controls.parametersPanel.visible = false;\r\n this.controls.resourcesPanel.visible = false;*/\r\n }\r\n\r\n public style(value: string): string {\r\n return value !== '' && value != null ? value : '';\r\n }\r\n\r\n public createPostParameters(data?: any, asObject: boolean = true, useOptions: boolean = true): any {\r\n let params: any;\r\n\r\n // Object params\r\n const postParams = {\r\n stiweb_component: 'Viewer',\r\n stiweb_imagesScalingFactor: this.getImagesScalingFactor()\r\n };\r\n\r\n if (this.properties) {\r\n postParams['properties'] = this.encode(JSON.stringify(this.properties));\r\n }\r\n\r\n if (this.options && useOptions) {\r\n params = {\r\n viewerId: this.options.viewerId,\r\n routes: this.options.routes,\r\n formValues: this.options.formValues,\r\n clientGuid: this.options.clientGuid,\r\n drillDownGuid: this.reportParams.drillDownGuid,\r\n dashboardDrillDownGuid: this.reportParams.dashboardDrillDownGuid,\r\n cacheMode: this.options.server.cacheMode,\r\n cacheTimeout: this.options.server.cacheTimeout,\r\n cacheItemPriority: this.options.server.cacheItemPriority,\r\n pageNumber: this.reportParams.pageNumber,\r\n originalPageNumber: this.reportParams.originalPageNumber,\r\n reportType: this.reportParams.type,\r\n zoom: (this.reportParams.zoom && this.reportParams.zoom > 0) ? this.reportParams.zoom : (this.options?.toolbar?.zoom > 0 ? this.options?.toolbar?.zoom : 100),\r\n viewMode: this.reportParams.viewMode || this.options.toolbar.viewMode,\r\n multiPageWidthCount: this.reportParams.multiPageWidthCount,\r\n multiPageHeightCount: this.reportParams.multiPageHeightCount,\r\n multiPageContainerWidth: this.reportParams.multiPageContainerWidth,\r\n multiPageContainerHeight: this.reportParams.multiPageContainerHeight,\r\n multiPageMargins: this.reportParams.multiPageMargins,\r\n showBookmarks: this.options.toolbar.showBookmarksButton,\r\n openLinksWindow: this.options.appearance.openLinksWindow,\r\n chartRenderType: this.options.appearance.chartRenderType,\r\n reportDisplayMode: (this.options.displayModeFromReport || this.options.appearance.reportDisplayMode),\r\n drillDownParameters: this.reportParams.drillDownParameters,\r\n editableParameters: this.reportParams.editableParameters,\r\n useRelativeUrls: this.options.server.useRelativeUrls,\r\n passQueryParametersForResources: this.options.server.passQueryParametersForResources,\r\n passQueryParametersToReport: this.options.server.passQueryParametersToReport,\r\n version: this.options.shortProductVersion,\r\n reportDesignerMode: this.options.reportDesignerMode,\r\n imagesQuality: this.options.appearance.imagesQuality,\r\n parametersPanelSortDataItems: this.options.appearance.parametersPanelSortDataItems,\r\n combineReportPages: this.options.appearance.combineReportPages,\r\n isAngular: true,\r\n CSPNonce: this.options.cSPNonce,\r\n allowAutoUpdateCookies: this.options.server.allowAutoUpdateCookies\r\n };\r\n\r\n if (this.options.server.useLocalizedCache && this.options.localization) {\r\n params['useLocalizedCache'] = true;\r\n params['localization'] = this.options.localization;\r\n }\r\n\r\n if (this.options.userValues) {\r\n params['userValues'] = this.options.userValues;\r\n }\r\n\r\n } else {\r\n params = {};\r\n }\r\n\r\n if (data) {\r\n Object.keys(data).forEach(key => params[key] = data[key]);\r\n }\r\n\r\n // Object params\r\n if (params.action) {\r\n postParams['stiweb_action'] = params.action;\r\n delete params.action;\r\n }\r\n\r\n if (data?.viewerRequestUrl) {\r\n postParams['stiweb_viewerRequestUrl'] = data.viewerRequestUrl;\r\n }\r\n\r\n if (params.base64Data) {\r\n postParams['stiweb_data'] = params.base64Data;\r\n delete params.base64Data;\r\n }\r\n\r\n if (this.options && useOptions) {\r\n // Params\r\n const jsonParams = JSON.stringify(params);\r\n if (this.options.server.useCompression) {\r\n // postParams['stiweb_packed_parameters'] = StiGZipHelper.pack(jsonParams);\r\n postParams['stiweb_parameters'] = this.encode(jsonParams);\r\n } else {\r\n postParams['stiweb_parameters'] = this.encode(jsonParams);\r\n }\r\n }\r\n\r\n if (this.postParametersFunction) {\r\n let postParamsF = this.postParametersFunction(data);\r\n if (postParamsF) {\r\n Object.keys(postParamsF).forEach(key => postParams[key] = postParamsF[key]);\r\n }\r\n }\r\n\r\n if (asObject) { return postParams; }\r\n }\r\n\r\n private newToken(): string {\r\n const a = '1234567890abcdefghijklmnopqrstuvwxyz'.split('');\r\n const b = [];\r\n const length = 32;\r\n b[0] = \"s\";\r\n for (let i = 1; i < length; i++) {\r\n const j = (Math.random() * (a.length - 1)).toFixed(0);\r\n b[i] = a[j];\r\n }\r\n return b.join('');\r\n }\r\n\r\n private setupOptions() {\r\n if (!this.options.exports.showExportToPowerPoint && !this.options.exports.showExportToPdf && !this.options.exports.showExportToXps &&\r\n !this.options.exports.showExportToOpenDocumentWriter && !this.options.exports.showExportToOpenDocumentCalc && !this.options.exports.showExportToText &&\r\n !this.options.exports.showExportToRtf && !this.options.exports.showExportToWord && !this.options.exports.showExportToCsv && !this.options.exports.showExportToJson &&\r\n !this.options.exports.showExportToDbf && !this.options.exports.showExportToXml && !this.options.exports.showExportToDif && !this.options.exports.showExportToSylk &&\r\n !this.options.exports.showExportToExcelBiff && !this.options.exports.showExportToExcel && !this.options.exports.showExportToExcelXml && !this.options.exports.showExportToHtml &&\r\n !this.options.exports.showExportToHtml5 && !this.options.exports.showExportToMht && !this.options.exports.showExportToImageBmp && !this.options.exports.showExportToImageGif &&\r\n !this.options.exports.showExportToImageJpeg && !this.options.exports.showExportToImageMetafile && !this.options.exports.showExportToImagePcx &&\r\n !this.options.exports.showExportToImagePng && !this.options.exports.showExportToImageTiff && !this.options.exports.showExportToImageSvg && !this.options.exports.showExportToImageSvgz) {\r\n if (!this.options.exports.showExportToDocument) {\r\n this.options.toolbar.showSaveButton = false;\r\n }\r\n this.options.toolbar.showSendEmailButton = false;\r\n }\r\n // Options\r\n this.options.isTouchDevice = this.options.appearance.interfaceType === 'Auto'\r\n ? this.isTouchDevice() && this.isMobileDevice()\r\n : this.options.appearance.interfaceType === 'Touch';\r\n this.options.isMobileDevice = this.options.appearance.interfaceType === 'Auto' && !this.options.reportDesignerMode\r\n ? this.isTouchDevice() && this.isMobileDevice()\r\n : this.options.appearance.interfaceType === 'Mobile';\r\n\r\n if (this.options.isMobileDevice) {\r\n this.initializeMobile();\r\n } else {\r\n this.options.toolbar.showPinToolbarButton = false;\r\n }\r\n\r\n this.options.menuAnimDuration = 150;\r\n this.options.formAnimDuration = 200;\r\n this.options.scrollDuration = 350;\r\n this.options.menuHideDelay = 250;\r\n\r\n this.options.server.timeoutAutoUpdateCache = 180000;\r\n this.options.toolbar.backgroundColor = this.getHTMLColor(this.options.toolbar.backgroundColor);\r\n this.options.toolbar.borderColor = this.getHTMLColor(this.options.toolbar.borderColor);\r\n this.options.toolbar.fontColor = this.getHTMLColor(this.options.toolbar.fontColor);\r\n this.options.appearance.pageBorderColor = this.getHTMLColor(this.options.appearance.pageBorderColor);\r\n this.options.parametersValues = {};\r\n this.options.parameterRowHeight = this.options.isTouchDevice ? 35 : 30;\r\n\r\n // First Day Of Week\r\n if (this.options.appearance.datePickerFirstDayOfWeek === 'Sunday') {\r\n this.dayOfWeek.splice(6, 1);\r\n this.dayOfWeek.splice(0, 0, 'Sunday');\r\n }\r\n\r\n if (this.options?.toolbar?.zoom === -1 || this.options?.toolbar?.zoom === -2) {\r\n this.reportParams.autoZoom = this.options?.toolbar?.zoom;\r\n }\r\n\r\n // Actions\r\n if (!this.options.actions.getReport) { this.options.actions.getReport = this.options.actions.viewerEvent; }\r\n if (!this.options.actions.printReport) { this.options.actions.printReport = this.options.actions.viewerEvent; }\r\n if (!this.options.actions.openReport) { this.options.actions.openReport = this.options.actions.viewerEvent; }\r\n if (!this.options.actions.exportReport) { this.options.actions.exportReport = this.options.actions.viewerEvent; }\r\n if (!this.options.actions.interaction) { this.options.actions.interaction = this.options.actions.viewerEvent; }\r\n\r\n if (!(window.File && window.FileReader && window.FileList && window.Blob)) { this.options.toolbar.showOpenButton = false; }\r\n\r\n // Render JsViewer styles into HEAD\r\n if (this.options.requestResourcesUrl || this.options.appearance.customStylesUrl) {\r\n const viewerStyles = document.createElement('link');\r\n viewerStyles.setAttribute('type', 'text/css');\r\n viewerStyles.setAttribute('rel', 'stylesheet');\r\n viewerStyles.setAttribute('href', this.options.appearance.customStylesUrl || this.getResourceUrl('styles'));\r\n this.controls.head.appendChild(viewerStyles);\r\n }\r\n\r\n this.options.viewerId = this.options.viewerId || this.newToken();\r\n }\r\n\r\n public pagesNavigationIsActive(): boolean {\r\n return (this.options.appearance.fullScreenMode || this.options.appearance.scrollbarsMode) && this.reportParams.viewMode === 'Continuous';\r\n }\r\n\r\n get imagesForBookmark(): any {\r\n if (!this._imagesForBookmark) {\r\n const names = ['root', 'folder', 'folderOpen', 'node', 'empty', 'line', 'join', 'joinBottom', 'plus', 'plusBottom', 'minus', 'minusBottom'];\r\n const imagesForBookmarks = {};\r\n names.forEach(name => imagesForBookmarks[name] = this.images['Bookmarks' + name + '.png']);\r\n this._imagesForBookmark = imagesForBookmarks;\r\n }\r\n return this._imagesForBookmark;\r\n }\r\n\r\n public isTouchDevice() {\r\n return ('ontouchstart' in document.documentElement);\r\n }\r\n\r\n public isMobileDevice() {\r\n return /iPhone|iPad|iPod|Macintosh|Android|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\r\n }\r\n\r\n public initializeMobile() {\r\n let isViewPortExist = false;\r\n const metas: any = this.controls.head.getElementsByTagName('meta');\r\n for (const meta of metas) {\r\n if (meta.name && meta.name.toLowerCase() === 'viewport') {\r\n isViewPortExist = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!isViewPortExist) {\r\n const viewPortTag = document.createElement('meta');\r\n viewPortTag.id = 'viewport';\r\n viewPortTag.name = 'viewport';\r\n viewPortTag.content = 'initial-scale=1.0,width=device-width,user-scalable=0';\r\n this.controls.head.appendChild(viewPortTag);\r\n }\r\n\r\n this.options.appearance.fullScreenMode = true;\r\n this.options.appearance.scrollbarsMode = true;\r\n this.options.appearance.currentParametersPanelPosition = 'Left';\r\n this.options.appearance.parametersPanelPosition = 'Left';\r\n this.options.appearance.parametersPanelColumnsCount = 1;\r\n this.options.toolbar.displayMode = 'Separated';\r\n this.options.toolbar.viewMode = 'SinglePage';\r\n this.options.toolbar.showZoomButton = false;\r\n const defaultZoom = this.options.toolbar.zoom === -2 ? -2 : -1; // PageWidth or PageHeight\r\n this.options.toolbar.zoom = this.reportParams.zoom = defaultZoom;\r\n this.options.toolbar.showButtonCaptions = false;\r\n this.options.toolbar.showOpenButton = false;\r\n this.options.toolbar.showFindButton = false;\r\n this.options.toolbar.showEditorButton = false;\r\n this.options.toolbar.showFullScreenButton = false;\r\n this.options.toolbar.showAboutButton = false;\r\n this.options.toolbar.showViewModeButton = false;\r\n }\r\n\r\n public getImagesScalingFactor() {\r\n const wnd: any = window;\r\n const devicePixelRatio = window.devicePixelRatio || (wnd.deviceXDPI && wnd.logicalXDPI ? wnd.deviceXDPI / wnd.logicalXDPI : 1);\r\n if (!devicePixelRatio || devicePixelRatio <= 1) {\r\n return '1';\r\n } else {\r\n return devicePixelRatio.toString();\r\n }\r\n }\r\n\r\n public getHTMLColor(color: any) {\r\n if (color.indexOf(',') > 0 && color.indexOf('rgb') < 0) {\r\n return `rgb(${color})`;\r\n }\r\n return color;\r\n }\r\n\r\n public getResourceUrl(resourceParameter: string) {\r\n let url = this.getActionRequestUrl(this.options.requestResourcesUrl, this.options.actions.viewerEvent);\r\n url += url.indexOf('?') > 0 ? '&' : '?';\r\n url += 'stiweb_component=Viewer&stiweb_action=Resource&stiweb_data=' + resourceParameter + '&stiweb_theme=' + this.options.theme;\r\n url += '&stiweb_cachemode=' + (this.options.server.useCacheForResources\r\n ? this.options.server.cacheMode === 'ObjectSession' || this.options.server.cacheMode === 'StringSession'\r\n ? 'session'\r\n : 'cache'\r\n : 'none');\r\n url += '&stiweb_version=' + this.options.shortProductVersion;\r\n\r\n return url;\r\n }\r\n\r\n public getActionRequestUrl(requestUrl: string, action?: string) {\r\n if (!action) {\r\n return requestUrl;\r\n }\r\n\r\n if (action.indexOf('?') < 0) {\r\n return requestUrl.replace('{action}', action);\r\n }\r\n\r\n const query = action.substring(action.indexOf('?') + 1);\r\n action = action.substring(0, action.indexOf('?'));\r\n\r\n return requestUrl.replace('{action}', action) + (requestUrl.indexOf('?') > 0 ? '&' : '?') + query;\r\n }\r\n\r\n _keyStr: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\r\n\r\n public encode(input) {\r\n\r\n // Decode from UTF-8 text\r\n if (typeof unescape != 'undefined') {\r\n input = unescape(encodeURIComponent(input));\r\n }\r\n else {\r\n input = input.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n for (var n = 0; n < input.length; n++) {\r\n var c = input.charCodeAt(n);\r\n\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n }\r\n else if ((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n else {\r\n utftext += String.fromCharCode((c >> 12) | 224);\r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n }\r\n\r\n input = utftext;\r\n }\r\n\r\n // Encode to Base64 string\r\n if (typeof window.btoa != 'undefined') return window.btoa(input);\r\n\r\n var output = \"\";\r\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\r\n var i = 0;\r\n\r\n while (i < input.length) {\r\n chr1 = input.charCodeAt(i++);\r\n chr2 = input.charCodeAt(i++);\r\n chr3 = input.charCodeAt(i++);\r\n\r\n enc1 = chr1 >> 2;\r\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\r\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\r\n enc4 = chr3 & 63;\r\n\r\n if (isNaN(chr2)) enc3 = enc4 = 64;\r\n else if (isNaN(chr3)) enc4 = 64;\r\n\r\n output = output +\r\n this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +\r\n this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);\r\n }\r\n\r\n return output;\r\n }\r\n\r\n public decode(input) {\r\n var output = \"\";\r\n\r\n // Decode from Base64 string\r\n if (typeof window.atob != 'undefined') {\r\n output = window.atob(input);\r\n }\r\n else {\r\n var chr1, chr2, chr3;\r\n var enc1, enc2, enc3, enc4;\r\n var i = 0;\r\n\r\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\r\n while (i < input.length) {\r\n enc1 = this._keyStr.indexOf(input.charAt(i++));\r\n enc2 = this._keyStr.indexOf(input.charAt(i++));\r\n enc3 = this._keyStr.indexOf(input.charAt(i++));\r\n enc4 = this._keyStr.indexOf(input.charAt(i++));\r\n\r\n chr1 = (enc1 << 2) | (enc2 >> 4);\r\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\r\n chr3 = ((enc3 & 3) << 6) | enc4;\r\n\r\n output = output + String.fromCharCode(chr1);\r\n\r\n if (enc3 != 64) {\r\n output = output + String.fromCharCode(chr2);\r\n }\r\n if (enc4 != 64) {\r\n output = output + String.fromCharCode(chr3);\r\n }\r\n }\r\n }\r\n\r\n // Encode to UTF-8 string\r\n if (typeof escape != 'undefined') return decodeURIComponent(escape(output));\r\n\r\n var string = \"\";\r\n var i = 0;\r\n var c = 0;\r\n var c1 = 0\r\n var c2 = 0;\r\n var c3 = 0;\r\n\r\n while (i < output.length) {\r\n c = output.charCodeAt(i);\r\n\r\n if (c < 128) {\r\n string += String.fromCharCode(c);\r\n i++;\r\n }\r\n else if ((c > 191) && (c < 224)) {\r\n c2 = output.charCodeAt(i + 1);\r\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\r\n i += 2;\r\n }\r\n else {\r\n c2 = output.charCodeAt(i + 1);\r\n c3 = output.charCodeAt(i + 2);\r\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n i += 3;\r\n }\r\n }\r\n\r\n return string;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { ModelService } from './model.service';\r\n\r\n@Injectable()\r\nexport class AnimationService {\r\n constructor(private model: ModelService) { }\r\n\r\n public showAnimationForScroll(reportPanel, finishScrollTop, endTime, completeFunction) {\r\n if (!reportPanel) {\r\n return;\r\n }\r\n let currentScrollTop = 0;\r\n if (this.model.options.appearance.scrollbarsMode) {\r\n currentScrollTop = reportPanel.scrollTop;\r\n } else {\r\n currentScrollTop = document.documentElement.scrollTop;\r\n if (currentScrollTop === 0) {\r\n currentScrollTop = document.getElementsByTagName('BODY')[0].scrollTop;\r\n }\r\n }\r\n\r\n clearTimeout(reportPanel.animationTimer);\r\n const d = new Date();\r\n const t = d.getTime();\r\n let step = Math.round((finishScrollTop - currentScrollTop) / ((Math.abs(endTime - t) + 1) / 30));\r\n\r\n // Last step\r\n if (Math.abs(step) > Math.abs(finishScrollTop - currentScrollTop)) {\r\n step = finishScrollTop - currentScrollTop;\r\n }\r\n\r\n currentScrollTop += step;\r\n let resultScrollTop: number;\r\n\r\n if (t < endTime) {\r\n resultScrollTop = currentScrollTop;\r\n reportPanel.animationTimer = setTimeout(() => {\r\n this.showAnimationForScroll(reportPanel, finishScrollTop, endTime, completeFunction);\r\n }, 30);\r\n } else {\r\n resultScrollTop = finishScrollTop;\r\n if (completeFunction) {\r\n completeFunction();\r\n }\r\n }\r\n\r\n if (this.model.options.appearance.scrollbarsMode) {\r\n reportPanel.scrollTop = resultScrollTop;\r\n } else {\r\n window.scrollTo(0, resultScrollTop);\r\n }\r\n }\r\n\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { ModelService } from './model.service';\r\nimport { AnimationService } from './animation.service';\r\nimport { DateTimeObject } from './objects';\r\nimport { MenuItem } from '../menu/meni-item.component';\r\n\r\n@Injectable()\r\nexport class HelperService {\r\n\r\n constructor(private model: ModelService, private animationService: AnimationService) { }\r\n\r\n public val(value: string, def?: string): string {\r\n return value != null && value.trim() !== '' ? value : (def || '');\r\n }\r\n\r\n public findPosY(obj: any, mainClassName?: string, noScroll?: boolean) {\r\n let curtop = noScroll ? 0 : this.getScrollYOffset(obj, mainClassName);\r\n if (obj.offsetParent) {\r\n while (obj.className !== mainClassName) {\r\n curtop += obj.offsetTop;\r\n if (!obj.offsetParent) {\r\n break;\r\n }\r\n obj = obj.offsetParent;\r\n }\r\n } else if (obj.y) {\r\n curtop += obj.y;\r\n }\r\n return curtop;\r\n }\r\n\r\n public getScrollYOffset(obj: any, mainClassName: string): number {\r\n let scrolltop = 0;\r\n if (obj.parentElement) {\r\n while (obj.className !== mainClassName) {\r\n if ('scrollTop' in obj) {\r\n scrolltop -= obj.scrollTop;\r\n }\r\n if (!obj.parentElement) {\r\n break;\r\n }\r\n obj = obj.parentElement;\r\n }\r\n }\r\n\r\n return scrolltop;\r\n }\r\n\r\n public findPosX(obj: any, mainClassName: string, noScroll?: boolean) {\r\n let curleft = noScroll ? 0 : this.getScrollXOffset(obj, mainClassName);\r\n if (obj.offsetParent) {\r\n while (obj.className !== mainClassName) {\r\n curleft += obj.offsetLeft;\r\n if (!obj.offsetParent) {\r\n break;\r\n }\r\n obj = obj.offsetParent;\r\n }\r\n } else if (obj.x) {\r\n curleft += obj.x;\r\n }\r\n return curleft;\r\n }\r\n\r\n public getScrollXOffset(obj: any, mainClassName: string) {\r\n let scrollleft = 0;\r\n if (obj.parentElement) {\r\n while (obj.className !== mainClassName) {\r\n if ('scrollLeft' in obj) {\r\n scrollleft -= obj.scrollLeft;\r\n }\r\n if (!obj.parentElement) {\r\n break;\r\n }\r\n obj = obj.parentElement;\r\n }\r\n }\r\n\r\n return scrollleft;\r\n }\r\n\r\n public showHelpWindow(url: string) {\r\n let helpLanguage = 'en';\r\n switch (this.model.options.cultureName) {\r\n case 'ru': helpLanguage = 'ru';\r\n // case 'de': helpLanguage = 'de';\r\n }\r\n this.openNewWindow('https://www.stimulsoft.com/' + helpLanguage + '/documentation/online/' + url);\r\n }\r\n\r\n public openNewWindow(url: string, name?: string, specs?: string) {\r\n return window.open(url, name, specs);\r\n }\r\n\r\n public scrollToAnchor(anchorName: string, componentGuid?: string) {\r\n let aHyperlinks = this.model.controls.reportPanel.el.nativeElement.getElementsByTagName(\"a\");\r\n const identicalAnchors = [];\r\n if (anchorName) {\r\n anchorName = anchorName.replace(/!!#92/g, '\\\\');\r\n }\r\n\r\n if (componentGuid) {\r\n for (let i = 0; i < aHyperlinks.length; i++) {\r\n if (aHyperlinks[i].getAttribute('guid') === componentGuid) {\r\n identicalAnchors.push(aHyperlinks[i]);\r\n }\r\n }\r\n }\r\n\r\n if (identicalAnchors.length === 0) {\r\n let guidIndex = anchorName.indexOf(\"#GUID#\");\r\n\r\n if (identicalAnchors.length == 0) {\r\n let aHyperlinks = this.model.controls.reportPanel.el.nativeElement.getElementsByTagName(\"a\");\r\n for (var i = 0; i < aHyperlinks.length; i++) {\r\n if (aHyperlinks[i].name && ((guidIndex >= 0 && (aHyperlinks[i].name.indexOf(anchorName.substring(guidIndex + 6)) >= 0 || anchorName.substring(0, guidIndex) == aHyperlinks[i].name)) || aHyperlinks[i].name == anchorName))\r\n identicalAnchors.push(aHyperlinks[i]);\r\n }\r\n }\r\n }\r\n\r\n if (identicalAnchors.length > 0) {\r\n const anchor = identicalAnchors[0];\r\n const anchorParent = anchor.parentElement || anchor;\r\n let anchorHeight = anchorParent.offsetHeight;\r\n const anchorOffsetTop = anchorParent.offsetTop;\r\n\r\n identicalAnchors.forEach((identicalAnchor) => {\r\n const nextAnchorParent = identicalAnchor.parentElement || identicalAnchor;\r\n if (nextAnchorParent.offsetTop > anchorOffsetTop) {\r\n anchorHeight = Math.max(anchorHeight, nextAnchorParent.offsetTop - anchorOffsetTop + nextAnchorParent.offsetHeight);\r\n }\r\n });\r\n\r\n const date = new Date();\r\n const endTime = date.getTime() + this.model.options.scrollDuration;\r\n const targetTop = this.findPosY(anchor, this.model.options.appearance.scrollbarsMode ? 'stiJsViewerReportPanel' : null, true) - anchorParent.offsetHeight * 2;\r\n\r\n this.animationService.showAnimationForScroll(this.model.controls.reportPanel.el.nativeElement, targetTop, endTime, () => {\r\n const page = this.getPageFromAnchorElement(anchor);\r\n const anchorParentTopPos = this.findPosY(anchorParent, 'stiJsViewerReportPanel', true);\r\n const pageTopPos = page ? this.findPosY(page, 'stiJsViewerReportPanel', true) : anchorParentTopPos;\r\n\r\n this.removeBookmarksLabel();\r\n\r\n const label = document.createElement('div');\r\n this.model.controls.bookmarksLabel = label;\r\n label.className = 'stiJsViewerBookmarksLabel';\r\n\r\n const labelMargin = 20 * (this.model.reportParams.zoom / 100);\r\n const labelWidth = page ? page.offsetWidth - labelMargin - 6 : anchorParent.offsetWidth;\r\n const labelHeight = anchorHeight - 2;\r\n label.style.width = labelWidth + 'px';\r\n label.style.height = labelHeight + 'px';\r\n\r\n const margins = page.pageAttributes.margins?.replace('px', '').split(' ');\r\n const pageLeftMargin = page.pageAttributes.margins ? this.strToInt(margins[3]) : 0;\r\n const pageTopMargin = page.pageAttributes.margins ? this.strToInt(margins[0]) : 0;\r\n label.style.marginLeft = (labelMargin / 2 - pageLeftMargin) + 'px';\r\n label.style.marginTop = (anchorParentTopPos - pageTopPos - pageTopMargin - (this.model.reportParams.zoom / 100) - 1) + 'px';\r\n\r\n page.insertBefore(label, page.childNodes[0]);\r\n });\r\n }\r\n }\r\n\r\n public removeBookmarksLabel() {\r\n if (this.model.controls.bookmarksLabel) {\r\n this.model.controls.bookmarksLabel.parentElement.removeChild(this.model.controls.bookmarksLabel);\r\n this.model.controls.bookmarksLabel = null;\r\n }\r\n }\r\n\r\n public getPageFromAnchorElement(anchorElement: any) {\r\n let obj = anchorElement;\r\n while (obj.parentElement) {\r\n if (obj.className && obj.className.indexOf('stiJsViewerPage') === 0) {\r\n return obj;\r\n }\r\n obj = obj.parentElement;\r\n }\r\n return obj;\r\n }\r\n\r\n public strToInt(value: any): number {\r\n const result = parseInt(value, 10);\r\n return result || 0;\r\n }\r\n\r\n public strToDouble(value: any): number {\r\n if (value === null) {\r\n return null;\r\n }\r\n const result = parseFloat(value.toString().replace(',', '.').trim());\r\n return result || 0;\r\n }\r\n\r\n public copyObject(o: any): any {\r\n if (!o || 'object' !== typeof o) {\r\n return o;\r\n }\r\n const c = 'function' === typeof o.pop ? [] : {};\r\n let p;\r\n let v;\r\n for (p in o) {\r\n if (o.hasOwnProperty(p)) {\r\n v = o[p];\r\n if (v && 'object' === typeof v) {\r\n c[