import { ElementRef, EventEmitter, NgZone, OnDestroy, OnInit } from "@angular/core"; import { Branch, BranchLayout, Builder, Components, Condition, ConditionLayout, Contracts, DOM, IBuilderStyle, IBuilderTier, IDefinition, IHelpTopics, ILocale, INamespace, INestedDefinition, Layers, Node, NodeLayout, Section, SectionLayout, TBuilderEditData, TFormsList, TTranslation, } from "@tripetto/builder"; import * as i0 from "@angular/core"; export declare class TripettoBuilderComponent implements OnInit, OnDestroy { private element; private zone; private builderController?; private initialDefinition?; /** Retrieves a reference to the builder controller. */ get controller(): Builder; /** Specifies the form definition. */ set definition(definition: IDefinition | undefined); /** Retrieves the form definition. */ get definition(): IDefinition | undefined; /** * Specifies the path to the folder with the font files. This can be a relative path or an absolute URL or `inherit` if you take care * of the font loading yourself. */ fonts?: string | "inherit"; /** Contains the builder styles (can be used to create a custom skin). */ builderStyle?: IBuilderStyle; /** Specifies the locale. */ locale?: ILocale; /** Optional translations for the builder and the blocks. */ translations?: TTranslation | TTranslation[]; /** Specifies a blocks namespace to use or load. */ namespace?: { /** Contains the namespace identifier. */ readonly identifier: string; /** Contains the UMD bundle code for the namespace. */ readonly umd?: string; /** Contains the URL to the UMD bundle for the namespace. */ readonly url?: string; /** Invoked when a namespace is loaded. */ readonly onLoad?: (namespace: INamespace) => void; }; /** Specifies a tier for the builder. */ tier?: IBuilderTier; /** Specifies a license code for the builder. */ license?: string; /** Specifies the initial zoom state (defaults to `fit`). */ zoom?: "1:1" | "fit" | "fit-horizontal" | "fit-vertical"; /** Specifies if the content in the builder is centered (defaults to `true`). */ centering?: boolean; /** Specifies the location of the navigation and zoombar (defaults to `right`). */ controls?: "left" | "right"; /** * Specifies if the rubber band effect is enabled for the builder. Can be one * of the following values: * - `always`: Rubber band effect is always enabled, even when the content doesn't exceed the builder viewport (this is the default value); * - `true`: Rubber band effect is enabled when the content exceeds the builder viewport; * - `false`: Rubber band effect is disabled. */ rubberBandEffect?: "always" | true | false; /** Disables automatic resizing when the dimensions of the HTML element that holds the builder are changed. */ disableResizing?: boolean; /** Specifies if the prologue feature should be disabled. */ disablePrologue?: boolean; /** Specifies if the epilogue feature should be disabled. */ disableEpilogue?: boolean; /** Specifies if creating new nested branches should be disabled. */ disableNesting?: boolean; /** Specifies if section bookmarks are disabled. */ disableBookmarks?: boolean; /** Disables the zoombar. */ disableZoombar?: boolean; /** Disables the Tripetto logo in the navigation bar. */ disableLogo?: boolean; /** Disables the save button in the navigation bar. */ disableSaveButton?: boolean; /** Disables the restore button in the navigation bar (defaults to `true`). */ disableRestoreButton?: boolean; /** Disables the clear button in the navigation bar (defaults to `true`). */ disableClearButton?: boolean; /** Disables the edit button in the navigation bar. */ disableEditButton?: boolean; /** Disables the close button in the navigation bar. */ disableCloseButton?: boolean; /** Disables the tutorial button in the navigation bar. */ disableTutorialButton?: boolean; /** Disables the open and close animation of the builder layer. */ disableOpenCloseAnimation?: boolean; /** Shows the tutorial dialog on startup. */ showTutorial?: boolean; /** Specifies the URL of a preview page. */ previewURL?: string; /** Specifies an URL to a custom help or support page (supply `false` to disable this button). */ supportURL?: string | false; /** Specifies URLs to help topics. */ helpTopics?: IHelpTopics & { /** Help topic about welcome messages. */ readonly prologue?: string; /** Help topic about closing messages. */ readonly epilogue?: string; /** Help topic about using branches. */ readonly branches?: string; /** Help topic about using conditions. */ readonly conditions?: string; /** Help topic about branch culling modes. */ readonly culling?: string; /** Help topic about branch terminators. */ readonly terminators?: string; }; /** Invoked when the builder is loaded. */ onLoad: EventEmitter; /** Invoked when errors occured during loading. */ onError: EventEmitter<{ readonly erroneousBlocks: number; readonly missingBlockTypes: string[]; readonly builder: Builder; }>; /** Invoked when the builder is ready to use. */ onReady: EventEmitter; /** Invoked when the builder is opened. */ onOpen: EventEmitter; /** Invoked when the user clicks the save button (or when the `save()` command is called). */ onSave: EventEmitter; /** Invoked when the form definition is changed. */ onChange: EventEmitter; /** Invoked when a definition can be previewed. */ onPreview: EventEmitter; /** Invoked when the edit panel is opened or closed. */ onEdit: EventEmitter; /** Invoked when the builder is closed. */ onClose: EventEmitter; /** * Specifies if the builder should run in nested form mode. This disables * the use of a prologue or epilogue on the main branch and optimizes the * builder for editing forms that can be used as nested forms (subforms). */ nestedFormMode?: boolean; /** * Disables the possibility to abort the whole form in nested forms. Nested * forms can then only return to the parent form, but never end the whole * form. */ disableFormAbort?: boolean; /** Disables the possibility to create new (empty) nested forms. */ disableCreateEmptyForm?: boolean; /** Disables the possibility to convert sections into nested forms or vice-versa. */ disableConvertToForm?: boolean; /** Disables the possibility to move sections to existing nested forms. */ disableMoveToForm?: boolean; /** Invoked when the builder needs a menu for a node, section, branch, or condition. */ onMenu?: ( type: "node" | "section" | "branch" | "condition", options: Components.MenuOption[], context: Node | Section | Branch | Condition, layout: NodeLayout | SectionLayout | BranchLayout | ConditionLayout ) => Components.MenuOption[]; /** Invoked when the builder is about to open a subform. */ onOpenForm?: (definition: INestedDefinition, layer: Layers.Layer) => Promise | boolean | void; /** Invoked when the builder needs the list of forms that can be used as subform. */ onListForms?: TFormsList | (() => TFormsList | Promise); /** Invoked when the builder wants to browse for a subform. */ onBrowseForms?: (element: DOM.Element, layer: Layers.Layer) => Promise; /** Specifies an alternative label for the browse forms feature. */ browseFormsLabel?: string; /** Invoked when the builder wants to load a certain subform. */ onLoadForm?: (reference: string) => INestedDefinition | undefined | Promise; /** Invoked when the builder wants to know if there is an update available for a certain form. */ onUpdateForm?: (reference: string, version?: string) => boolean | Promise; /** Invoked when the builder wants to save a subform. */ onSaveForm?: ( definition: INestedDefinition, element: DOM.Element, layer: Layers.Layer ) => Promise< | { readonly reference: string; readonly version?: string; readonly readonly?: boolean; } | string >; /** Specifies an alternative label for the save fofeature. */ saveFormLabel?: string; /** * Invoked everytime when a nested subform is opened or closed in the builder. * When this event is implemented, the default navigation bar to close a * subform (this is a floating bar in the builder) will not be shown anymore. * So you should use this event to render an interactive breadcrumb with * controls to edit the name of the subform and to close the subform (so it * returns to the parent form). */ onBreadcrumb?: ( forms: { readonly name: string; readonly edit: () => void; readonly activate: () => void; readonly close: () => void; }[], back: (() => void) | undefined ) => void; constructor(element: ElementRef, zone: NgZone); ngOnInit(): void; ngOnDestroy(): void; /** * Invokes the styles editor for the supplied contract. * @param contract Specifies the styles contract. * @param styles Reference to the styles object to edit (if omitted a new object is created). You * can also supply a function that returns an object with a `styles` property. In that case, the function * will use that property for the initial styles and will also automatically reflect any style changes * to the property. * @param tier Specifies the features tier. * @param onChange Specifies a function that is invoked on each style change. * @param hideInaccessibleOptions Specifies if options that aren't available should be invisible * instead of disabled. * @param allowReset Allows a reset button to reset all styles. * @param onReset Specifies a function that is invoked when the styles are about to reset. */ stylesEditor( contract: | Contracts.TStylesContract | ((pgettext: (sContext: string, sId: string, ...pArguments: string[]) => string) => Contracts.TStylesContract), styles?: | Contracts.TStyles | (() => | { styles?: Contracts.TStyles; } | { controller: { styles?: Contracts.TStyles; }; }), tier?: Contracts.TStyleTiers, onChange?: (styles: Contracts.TStyles) => void, hideInaccessibleOptions?: boolean, allowReset?: boolean, onReset?: (fnDone: (bReset: boolean) => void) => void ): Components.StylesEditor; /** * Invokes the l10n editor for the supplied contract. * @param contract Specifies the l10n contract. * @param l10n Reference to the l10n object to edit (if omitted a new object is created). You * can also supply a function that returns an object with a `l10n` property. In that case, the function * will use that property for the initial l10n settings and will also automatically reflect any changes * to the property. * @param onChange Specifies a function that is invoked on each change. It receives two arguments: * - `l10n`: Reference to the l10n object; * - `currentL10n`: Copy of the l10n object where the current edit language is set as the default language. * @param onTranslation Specifies a function that should deliver translations for the given language. */ l10nEditor( contract: Contracts.TL10nContract | (() => Contracts.TL10nContract), l10n?: | Contracts.TL10n | (() => | { l10n?: Contracts.TL10n; } | { controller: { l10n?: Contracts.TL10n; }; }), onChange?: (l10n: Contracts.TL10n, currentL10n: Contracts.TL10n) => void, onTranslation?: (language: string) => TTranslation | TTranslation[] | Promise | undefined ): Components.L10nEditor; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration< TripettoBuilderComponent, "tripetto-builder", never, { definition: "definition"; fonts: "fonts"; builderStyle: "builderStyle"; locale: "locale"; translations: "translations"; namespace: "namespace"; tier: "tier"; license: "license"; zoom: "zoom"; centering: "centering"; controls: "controls"; rubberBandEffect: "rubberBandEffect"; disableResizing: "disableResizing"; disablePrologue: "disablePrologue"; disableEpilogue: "disableEpilogue"; disableNesting: "disableNesting"; disableBookmarks: "disableBookmarks"; disableZoombar: "disableZoombar"; disableLogo: "disableLogo"; disableSaveButton: "disableSaveButton"; disableRestoreButton: "disableRestoreButton"; disableClearButton: "disableClearButton"; disableEditButton: "disableEditButton"; disableCloseButton: "disableCloseButton"; disableTutorialButton: "disableTutorialButton"; disableOpenCloseAnimation: "disableOpenCloseAnimation"; showTutorial: "showTutorial"; previewURL: "previewURL"; supportURL: "supportURL"; helpTopics: "helpTopics"; nestedFormMode: "nestedFormMode"; disableFormAbort: "disableFormAbort"; disableCreateEmptyForm: "disableCreateEmptyForm"; disableConvertToForm: "disableConvertToForm"; disableMoveToForm: "disableMoveToForm"; onMenu: "onMenu"; onOpenForm: "onOpenForm"; onListForms: "onListForms"; onBrowseForms: "onBrowseForms"; browseFormsLabel: "browseFormsLabel"; onLoadForm: "onLoadForm"; onUpdateForm: "onUpdateForm"; onSaveForm: "onSaveForm"; saveFormLabel: "saveFormLabel"; onBreadcrumb: "onBreadcrumb"; }, { onLoad: "onLoad"; onError: "onError"; onReady: "onReady"; onOpen: "onOpen"; onSave: "onSave"; onChange: "onChange"; onPreview: "onPreview"; onEdit: "onEdit"; onClose: "onClose"; }, never, never, false, never >; }