Skip to content

MetadataFormFieldComponent

component

Component to render a metadata form field within an object form. These forms are created to render and edit metadata of DMS objects. This component is used as a wrapper for the actual form element, which is defined by the formField input.

Selector: yuv-metadata-form-field

Standalone: Yes

Type: Subject<ParentFormChangedEvent>

Type: ObjectTypeField

Default Value: \{ alias: 'field' \}

Required: Yes

Type: string | undefined

Default Value: Situation.EDIT

Form situation, if not set default will be ‘EDIT’

Type: "default" | "raw"

Default Value: 'default'

Which template variant to render. default renders the wrapped form field (mat-form-field with label, hint, error). raw renders only the inner widget — useful for composing into custom layouts such as smart-search.

Type: unknown

Default Value: computed<MetadataFormFieldContext>(() => \{ const field = this.formField(); field.required = this.situation() !== Situation.SEARCH ? field.required : false; const label = this.#localization.getLocalizedLabel(field.name) || field.label || field.name; return \{ label, description: field.description, situation: this.situation() || Situation.EDIT, field, ctrl: this.#ngControl?.control || undefined, formChangedSubject: this.formChangedSubject(), object: this.#objectContext?.() \}; \})

Type: unknown

Default Value: computed<TemplateRef<any> | undefined>(() => \{ const field = this.formField(); // TODO: set readonly state based on ...????... schema? this.readonly = false; const isRaw = this.variant() === 'raw'; const lookup = isRaw ? (key: string): TemplateRef<any> | undefined => this.#registry.getRawElementTemplate(key, this.situation()) : (key: string): TemplateRef<any> | undefined => this.#registry.getElementTemplate(key, this.situation()); const templateByName = lookup(${this.#registry.NAME_PROPERTY_PREFIX}${field.name}); if (templateByName) \{ return templateByName; \} else \{ if (!field._internalType) \{ field._internalType = this.#system.getInternalFormElementType( field.propertyType, field.classifications, field.catalog ); \} return lookup(field._internalType); \} \})

Type: unknown

Default Value: false