UNPKG

@dotcms/angular

Version:

Official Angular Components library to render a dotCMS page.

129 lines 4.06 kB
import { EditorComponent } from '@tinymce/tinymce-angular'; import { EventObj } from '@tinymce/tinymce-angular/editor/Events'; import { OnChanges, OnInit } from '@angular/core'; import { DotCMSBasicContentlet } from '@dotcms/types'; import { DOT_EDITABLE_TEXT_FORMAT, DOT_EDITABLE_TEXT_MODE } from './utils'; import * as i0 from "@angular/core"; /** * Dot editable text component. * This component is responsible to render a text field that can be edited inline. * * @export * @class DotCMSEditableTextComponent * @implements {OnInit} * @implements {OnChanges} */ export declare class DotCMSEditableTextComponent<T extends DotCMSBasicContentlet> implements OnInit, OnChanges { #private; editorComponent: EditorComponent; /** * Represents the mode of the editor which can be `plain`, `minimal`, or `full` * * @type {DOT_EDITABLE_TEXT_MODE} * @memberof DotCMSEditableTextComponent */ mode: DOT_EDITABLE_TEXT_MODE; /** * Represents the format of the editor which can be `text` or `html` * * @type {DOT_EDITABLE_TEXT_FORMAT} * @memberof DotCMSEditableTextComponent */ format: DOT_EDITABLE_TEXT_FORMAT; /** * Represents the `contentlet` that can be inline edited * * @type {DotCMSContentlet} * @memberof DotCMSEditableTextComponent */ contentlet: T; /** * Represents the field name of the `contentlet` that can be edited * * @memberof DotCMSEditableTextComponent */ fieldName: keyof T; /** * Represents the content of the `contentlet` that can be edited * * @protected * @memberof DotCMSEditableTextComponent */ protected content: string; /** * Represents the configuration of the editor * * @protected * @type {EditorComponent['init']} * @memberof DotCMSEditableTextComponent */ protected init: EditorComponent['init']; /** * The TinyMCE editor * * @readonly * @memberof DotCMSEditableTextComponent */ get editor(): import("tinymce").Editor; /** * Represents if the component is inside the editor * * @protected * @type {boolean} * @memberof DotCMSEditableTextComponent */ protected get isEditMode(): string | false | null | undefined; /** * Returns the number of pages the contentlet is on * * @readonly * @memberof DotCMSEditableTextComponent */ get onNumberOfPages(): string | 1; /** * Handle copy contentlet inline editing success event * * @param {MessageEvent} { data } * @return {*} * @memberof DotCMSEditableTextComponent */ onMessage({ data }: MessageEvent): void; ngOnInit(): void; ngOnChanges(): void; /** * Handle mouse down event * * @param {EventObj<MouseEvent>} { event } * @return {*} * @memberof DotCMSEditableTextComponent */ onMouseDown({ event }: EventObj<MouseEvent>): void; /** * Handle focus out event * * @return {*} * @memberof DotCMSEditableTextComponent */ onFocusOut(): void; /** * inner HTML to element * * @private * @param {string} editedContent * @return {*} * @memberof DotCMSEditableTextComponent */ private innerHTMLToElement; /** * Check if the content has changed * * @private * @param {string} editedContent * @return {*} * @memberof DotCMSEditableTextComponent */ private didContentChange; static ɵfac: i0.ɵɵFactoryDeclaration<DotCMSEditableTextComponent<any>, never>; static ɵcmp: i0.ɵɵComponentDeclaration<DotCMSEditableTextComponent<any>, "dotcms-editable-text", never, { "mode": { "alias": "mode"; "required": false; }; "format": { "alias": "format"; "required": false; }; "contentlet": { "alias": "contentlet"; "required": false; }; "fieldName": { "alias": "fieldName"; "required": false; }; }, {}, never, never, true, never>; } //# sourceMappingURL=dotcms-editable-text.component.d.ts.map