import * as _angular_core from '@angular/core'; import { TemplateRef, OnInit, AfterViewInit, OnDestroy } from '@angular/core'; import { Situation, ObjectTypeField, ObjectFormControl } from '@yuuvis/client-core'; import { AbstractControl } from '@angular/forms'; import { Subject } from 'rxjs'; import * as i1 from '@yuuvis/client-framework/common'; /** * Object forms are used to render and edit metadata of DMS objects. Each property * of an object can be rendered in a diffenrent way, depending on the type of the property. * This service allows to register and retrieve templates for rendering these form elements. * * You can register templates for different situations like EDIT, SEARCH, and CREATE. * The templates will then be used to render the form elements in the object form component. * * So based on the property type you can register custom templates for rendering certain * form elements. This is useful if you want to render a property in a different way. * * Example: * Having a number property representing a rating, you might want to render it as * a list of stars instead of a simple input field. */ declare class MetadataFormElementRegistry { private _defaults; private _edit; private _search; private _create; private _rawDefaults; private _rawEdit; private _rawSearch; private _rawCreate; NAME_PROPERTY_PREFIX: string; /** * Get a template to render a certain form element * @param propertyType The internal type to get the template for * @param situation Form situation * @returns TemplateRef or undefined */ getElementTemplate(propertyType: string, situation?: string): TemplateRef | undefined; /** * Register an object form element for a certain internal type. You might add a new component * or overwrite an existung one. * @param propertyType The internal type to provide the component for * @param component The component * @param situation Form situation to provide thew form element for (defaults to EDIT) */ addElementTemplate(propertyType: string, templateRef: TemplateRef, situation?: Situation): void; /** * Remove a registered form element. * @param propertyType The internal type to remove the component for * @param situation Form situation to provide thew form element for (defaults to EDIT) */ removeElementTemplate(propertyType: string, situation?: Situation): void; /** * Register default form element component. Usually this will be done by the object * form component itself. * @param propertyType The internal type to provide the component for * @param component The default component */ _addDefaultElementTemplate(propertyType: string, templateRef: TemplateRef): void; /** * Remove a registered default form element. * @param propertyType The internal type to remove the component for */ _removeDefaultElementTemplate(propertyType: string): void; /** * Get a raw (unwrapped) form element template — only the inner widget, * without the surrounding `mat-form-field` / label / hint / error shell. * Use this when composing the widget into a custom layout (e.g. smart-search). * @param propertyType The internal type to get the template for * @param situation Form situation * @returns TemplateRef or undefined */ getRawElementTemplate(propertyType: string, situation?: string): TemplateRef | undefined; /** * Register a raw form element template for a certain internal type. * @param propertyType The internal type to provide the template for * @param templateRef The template * @param situation Form situation to provide the form element for (defaults to EDIT) */ addRawElementTemplate(propertyType: string, templateRef: TemplateRef, situation?: Situation): void; /** * Remove a registered raw form element template. * @param propertyType The internal type to remove the template for * @param situation Form situation */ removeRawElementTemplate(propertyType: string, situation?: Situation): void; /** * Register a default raw form element template (used across all situations). * @param propertyType The internal type to provide the template for * @param templateRef The default template */ _addDefaultRawElementTemplate(propertyType: string, templateRef: TemplateRef): void; /** * Remove a registered default raw form element template. * @param propertyType The internal type to remove the template for */ _removeDefaultRawElementTemplate(propertyType: string): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } /** * Context provided to each metadata form field. */ interface MetadataFormFieldContext { label?: string; situation: string; field: ObjectTypeField; ctrl?: AbstractControl; formChangedSubject?: Subject; } interface ParentFormChangedEvent { invalid: boolean; dirty: boolean; indexdataChanged: boolean; data?: any; } /** * Directive to apply styles to an object metadata element label based on its control status. * Depending on the state of the control (dirty, error, required), it will add or remove specific classes * to the label element. These classes could then be used to style the label accordingly. * * Could be placed on any HTML element, but is primarily intended for use on `` or `