@alfresco/adf-core
Version:
109 lines (108 loc) • 5.28 kB
TypeScript
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AppExtensionService, ViewerExtensionRef } from '@alfresco/adf-extensions';
import { EventEmitter, Injector, OnChanges, OnInit, TemplateRef } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Track } from '../../models/viewer.model';
import { ViewUtilService } from '../../services/view-util.service';
import * as i0 from "@angular/core";
export declare class ViewerRenderComponent implements OnChanges, OnInit {
private viewUtilService;
private extensionService;
dialog: MatDialog;
readonly injector: Injector;
/**
* If you want to load an external file that does not come from ACS you
* can use this URL to specify where to load the file from.
*/
urlFile: string;
/** Loads a Blob File */
blobFile: Blob;
/** Toggles the 'Full Screen' feature. */
allowFullScreen: boolean;
/** Toggles PDF thumbnails. */
allowThumbnails: boolean;
/** The template for the pdf thumbnails. */
thumbnailsTemplate: TemplateRef<any>;
/** MIME type of the file content (when not determined by the filename extension). */
mimeType: string;
/** Override Content filename. */
fileName: string;
/** Enable when where is possible the editing functionalities */
readOnly: boolean;
/**
* Controls which actions are enabled in the viewer.
* Example:
* { rotate: true, crop: false } will enable rotation but disable cropping.
*/
allowedEditActions: {
[key: string]: boolean;
};
/** media subtitles for the media player*/
tracks: Track[];
/** Identifier of a node that is opened by the viewer. */
nodeId: string;
/** Template containing ViewerExtensionDirective instances providing different viewer extensions based on supported file extension. */
viewerTemplateExtensions: TemplateRef<any>;
/** Custom error message to be displayed in the viewer. */
customError: string;
/** Emitted when the filename extension changes. */
extensionChange: EventEmitter<string>;
/** Emitted when the img is submitted in the img viewer. */
submitFile: EventEmitter<Blob>;
/** Emitted when the img is submitted in the img viewer. */
close: EventEmitter<boolean>;
/** Emitted when the img is saving. */
isSaving: EventEmitter<boolean>;
extensionTemplates: {
template: TemplateRef<any>;
isVisible: boolean;
}[];
extensionsSupportedByTemplates: string[];
extension: string;
internalFileName: string;
viewerType: string;
isLoading: boolean;
/**
* Returns a list of the active Viewer content extensions.
*
* @returns list of extension references
*/
get viewerExtensions(): ViewerExtensionRef[];
/**
* Provides a list of file extensions supported by external plugins.
*
* @returns list of extensions
*/
get externalExtensions(): string[];
private _externalViewer;
get externalViewer(): ViewerExtensionRef;
cacheTypeForContent: string;
constructor(viewUtilService: ViewUtilService, extensionService: AppExtensionService, dialog: MatDialog, injector: Injector);
ngOnInit(): void;
ngOnChanges(): void;
markAsLoaded(): void;
private setUpBlobData;
private setUpUrlFile;
scrollTop(): void;
checkExtensions(extensionAllowed: any): any;
onSubmitFile(newImageBlob: Blob): void;
onUnsupportedFile(): void;
onClose(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<ViewerRenderComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ViewerRenderComponent, "adf-viewer-render", never, { "urlFile": { "alias": "urlFile"; "required": false; }; "blobFile": { "alias": "blobFile"; "required": false; }; "allowFullScreen": { "alias": "allowFullScreen"; "required": false; }; "allowThumbnails": { "alias": "allowThumbnails"; "required": false; }; "thumbnailsTemplate": { "alias": "thumbnailsTemplate"; "required": false; }; "mimeType": { "alias": "mimeType"; "required": false; }; "fileName": { "alias": "fileName"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "allowedEditActions": { "alias": "allowedEditActions"; "required": false; }; "tracks": { "alias": "tracks"; "required": false; }; "nodeId": { "alias": "nodeId"; "required": false; }; "viewerTemplateExtensions": { "alias": "viewerTemplateExtensions"; "required": false; }; "customError": { "alias": "customError"; "required": false; }; }, { "extensionChange": "extensionChange"; "submitFile": "submitFile"; "close": "close"; "isSaving": "isSaving"; }, never, never, true, never>;
}