@rero/ng-core
Version:
RERO angular core library.
86 lines (85 loc) • 3.1 kB
TypeScript
import { OnDestroy, OnInit } from '@angular/core';
import { FormlyFieldConfig } from '@ngx-formly/core';
import { TranslateService } from '@ngx-translate/core';
import { MenuItem } from 'primeng/api';
import * as i0 from "@angular/core";
export declare class LabelComponent implements OnInit, OnDestroy {
protected translateService: TranslateService;
field: FormlyFieldConfig;
private subscriptions;
items: MenuItem[];
ngOnInit(): void;
ngOnDestroy(): void;
updateItems(): void;
/**
* Is the dropdown menu displayed?
* @param field - FormlyFieldConfig, the corresponding form field config
* @returns boolean, true if the menu should be displayed
*/
hasMenu(field: FormlyFieldConfig): boolean;
/** Get the current field index position in the parent array.
*
* @returns number - the index position in the parent array, null if the parent
* is not an array.
*/
getIndex(): number;
/** Get the list of children fields of a given field.
*
* This is more complicated for multischema, the formlyField should be extracted
* from the children of children.
*
* @param field FormlyFieldConfig - the field to get the fieldGroup.
* @returns Array of FormlyFieldConfig - the list of the children fields.
*/
getFieldGroup(field: FormlyFieldConfig): any[];
/**
* Filter the fieldGroup to return the list of hidden field.
* @param fieldGroup - FormlyFieldConfig[], the fieldGroup to filter
* @returns FormlyFieldConfig[], the filtered list
*/
hiddenFieldGroup(fieldGroup: FormlyFieldConfig[]): FormlyFieldConfig[];
/**
* Am I at the root of the form?
* @returns boolean, true if I'm the root
*/
isRoot(): boolean;
/**
* Hide the field
* @param field - FormlyFieldConfig, the field to hide
*/
remove(): void;
/**
* Show the field
* @param field - FormlyFieldConfig, the field to show
*/
show(field: FormlyFieldConfig): void;
/**
* Is the field can be hidden?
* @returns boolean, true if the field can be hidden
*/
canRemove(): boolean;
/**
* Is a new item can be added in an array?
* Note that this is true only if the array does not contains items, else the
* clone button should be used.
* @returns boolean, true if a new item can be added
*/
canAddItem(): boolean;
/**
* Add a new item element
* @param field - FormlyFieldConfig, the field to hide
*/
addItem(): any;
/**
* Is a array item can be cloned?
* @returns boolean, true if the field can be hidden
*/
canAdd(): any;
/**
* Add a array item after the current field.
* @param field - FormlyFieldConfig, the field to hide
*/
add(): any;
static ɵfac: i0.ɵɵFactoryDeclaration<LabelComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<LabelComponent, "ng-core-label-editor", never, { "field": { "alias": "field"; "required": false; }; }, {}, never, never, false, never>;
}