UNPKG

stimulsoft-viewer-angular

Version:
105 lines 12.3 kB
import { Component, Input, ViewChild } from '@angular/core'; import * as i0 from "@angular/core"; import * as i1 from "../services/model.service"; import * as i2 from "../services/controller.service"; import * as i3 from "../services/toolbar.service"; import * as i4 from "@angular/common"; import * as i5 from "../controls/button.component"; import * as i6 from "../controls/toolbar-separator.component"; import * as i7 from "../controls/page-control.component"; export class ToolbarDopComponent { constructor(model, controller, toolbarService) { this.model = model; this.controller = controller; this.toolbarService = toolbarService; this.marginLeft = '1px'; this.viewInit = false; } ngAfterViewInit() { this.viewInit = true; setTimeout(() => { const width = this.mainTable?.nativeElement?.offsetWidth; this.marginLeft = this.viewInit && this.model.options.toolbar.alignment === 'Center' && width ? `calc(50% - ${Math.trunc(width / 2)}px)` : '1px'; }); } ngOnInit() { } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToolbarDopComponent, deps: [{ token: i1.ModelService }, { token: i2.ControllerService }, { token: i3.ToolbarService }], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ToolbarDopComponent, selector: "sti-toolbar-dop", inputs: { comps: "comps", align: "align" }, viewQueries: [{ propertyName: "mainTable", first: true, predicate: ["mainTable"], descendants: true }], ngImport: i0, template: ` <table #mainTable class="stiJsViewerClearAllStyles" cellpadding="0" cellspacing="0" [style.margin.px]="1" [attr.align]="align" [style.marginLeft]="marginLeft"> <tbody> <tr class="stiJsViewerClearAllStyles"> <td *ngFor="let comp of comps" class="stiJsViewerClearAllStyles"> <sti-button *ngIf="comp.type=='button'" [caption]="model.options.toolbar.showButtonCaptions ? comp.caption : null" [imageName]="comp.img" [arrow]="!model.options.isMobileDevice ? comp.arrow : null" [menuItems]="comp.menuItems" [actionName]="comp.action" [tooltip]="comp.tooltip" [enabled]="toolbarService.enabled(comp)" [display]="toolbarService.display(comp)" [innerTableWidth]="toolbarService.getInnerTableWidth(comp)" [width]="toolbarService.getButonWidth(comp)" [height]="model.options.toolbar.displayMode == 'Separated' ? (model.options.isMobileDevice ? '0.5in' : '28px') : null" (action)="controller.action({ name: comp.action });" [selected]="toolbarService.selected(comp)"></sti-button> <sti-toolbar-separator *ngIf="comp.type=='separator'"></sti-toolbar-separator> <sti-page-control *ngIf="comp.type=='pageControl'" [enabled]="!(model.reportParams.pagesCount <= 1 || toolbarService.disableNaviButtons())" [count]="model.reportParams.pagesCount" ></sti-page-control> </td> </tr> </tbody> </table> `, isInline: true, dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.ButtonComponent, selector: "sti-button", inputs: ["caption", "caption2", "captionAlign", "captionPadding", "captionPaddingLeft", "captionWhiteSpace", "captionOverflow", "captionTextOverflow", "captionWidth", "captionMaxWidth", "captionLineHeight", "imageName", "arrow", "arrowMarginTop", "margin", "height", "selected", "minWidth", "innerTableWidth", "menuItems", "actionName", "tooltip", "imageCellTextAlign", "imageCellWidth", "imageCellPadding", "imageSizesWidth", "imageSizesHeight", "imageMargin", "width", "display", "closeButton", "resourceButton", "styleColors", "boxSizing", "navagationPanelTooltip", "cursor", "fontSize", "helpLink", "borderColor", "styleName", "enabled"], outputs: ["action", "closeButtonAction"] }, { kind: "component", type: i6.ToolbarSeparatorComponent, selector: "sti-toolbar-separator" }, { kind: "component", type: i7.PageControlComponent, selector: "sti-page-control", inputs: ["enabled", "count", "textBoxBorder", "margin"] }] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToolbarDopComponent, decorators: [{ type: Component, args: [{ selector: 'sti-toolbar-dop', template: ` <table #mainTable class="stiJsViewerClearAllStyles" cellpadding="0" cellspacing="0" [style.margin.px]="1" [attr.align]="align" [style.marginLeft]="marginLeft"> <tbody> <tr class="stiJsViewerClearAllStyles"> <td *ngFor="let comp of comps" class="stiJsViewerClearAllStyles"> <sti-button *ngIf="comp.type=='button'" [caption]="model.options.toolbar.showButtonCaptions ? comp.caption : null" [imageName]="comp.img" [arrow]="!model.options.isMobileDevice ? comp.arrow : null" [menuItems]="comp.menuItems" [actionName]="comp.action" [tooltip]="comp.tooltip" [enabled]="toolbarService.enabled(comp)" [display]="toolbarService.display(comp)" [innerTableWidth]="toolbarService.getInnerTableWidth(comp)" [width]="toolbarService.getButonWidth(comp)" [height]="model.options.toolbar.displayMode == 'Separated' ? (model.options.isMobileDevice ? '0.5in' : '28px') : null" (action)="controller.action({ name: comp.action });" [selected]="toolbarService.selected(comp)"></sti-button> <sti-toolbar-separator *ngIf="comp.type=='separator'"></sti-toolbar-separator> <sti-page-control *ngIf="comp.type=='pageControl'" [enabled]="!(model.reportParams.pagesCount <= 1 || toolbarService.disableNaviButtons())" [count]="model.reportParams.pagesCount" ></sti-page-control> </td> </tr> </tbody> </table> ` }] }], ctorParameters: () => [{ type: i1.ModelService }, { type: i2.ControllerService }, { type: i3.ToolbarService }], propDecorators: { mainTable: [{ type: ViewChild, args: ['mainTable'] }], comps: [{ type: Input }], align: [{ type: Input }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci1kb3AuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvc3RpbXVsc29mdC12aWV3ZXItYW5ndWxhci9zcmMvbGliL2NvbXBvbmVudHMvdG9vbGJhci1kb3AuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQVUsS0FBSyxFQUFjLFNBQVMsRUFBaUIsTUFBTSxlQUFlLENBQUM7Ozs7Ozs7OztBQTBDL0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WV3ZXJDbGVhckFsbFN0eWxlc1wiPlxyXG4gICAgICAgICAgPHRkICpuZ0Zvcj1cImxldCBjb21wIG9mIGNvbXBzXCIgY2xhc3M9XCJzdGlKc1ZpZXdlckNsZWFyQWxsU3R5bGVzXCI+XHJcbiAgICAgICAgICAgIDxzdGktYnV0dG9uICpuZ0lmPVwiY29tcC50eXBlPT0nYnV0dG9uJ1wiXHJcbiAgICAgICAgICAgICAgW2NhcHRpb25dPVwibW9kZWwub3B0aW9ucy50b29sYmFyLnNob3dCdXR0b25DYXB0aW9ucyA/IGNvbXAuY2FwdGlvbiA6IG51bGxcIlxyXG4gICAgICAgICAgICAgIFtpbWFnZU5hbWVdPVwiY29tcC5pbWdcIlxyXG4gICAgICAgICAgICAgIFthcnJvd109XCIhbW9kZWwub3B0aW9ucy5pc01vYmlsZURldmljZSA/IGNvbXAuYXJyb3cgOiBudWxsXCJcclxuICAgICAgICAgICAgICBbbWVudUl0ZW1zXT1cImNvbXAubWVudUl0ZW1zXCJcclxuICAgICAgICAgICAgICBbYWN0aW9uTmFtZV09XCJjb21wLmFjdGlvblwiXHJcbiAgICAgICAgICAgICAgW3Rvb2x0aXBdPVwiY29tcC50b29sdGlwXCJcclxuICAgICAgICAgICAgICBbZW5hYmxlZF09XCJ0b29sYmFyU2VydmljZS5lbmFibGVkKGNvbXApXCJcclxuICAgICAgICAgICAgICBbZGlzcGxheV09XCJ0b29sYmFyU2VydmljZS5kaXNwbGF5KGNvbXApXCJcclxuICAgICAgICAgICAgICBbaW5uZXJUYWJsZVdpZHRoXT1cInRvb2xiYXJTZXJ2aWNlLmdldElubmVyVGFibGVXaWR0aChjb21wKVwiXHJcbiAgICAgICAgICAgICAgW3dpZHRoXT1cInRvb2xiYXJTZXJ2aWNlLmdldEJ1dG9uV2lkdGgoY29tcClcIlxyXG4gICAgICAgICAgICAgIFtoZWlnaHRdPVwibW9kZWwub3B0aW9ucy50b29sYmFyLmRpc3BsYXlNb2RlID09ICdTZXBhcmF0Z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