@netgrif/components-core
Version:
Netgrif Application engine frontend core Angular library
35 lines (34 loc) • 1.77 kB
TypeScript
import { DataField } from '../data-fields/models/abstract-data-field';
import { DataGroup } from '../resources/interface/data-groups';
/**
* @param fields a collection of data fields
* @param fieldId the id of the desired field
* @returns a reference to the datafield with the specified id or `undefined` if such datafield could not be found
*/
export declare function getField(fields: Array<DataField<any>>, fieldId: string): DataField<any> | undefined;
/**
* @param fields a collection of data fields
* @param fieldId the id of the desired field
* @returns the index of the datafield with the specified id or `-1` if such datafield could not be found
*/
export declare function getFieldIndex(fields: Array<DataField<any>>, fieldId: string): number;
/**
* @param groups a list of searched data groups
* @param fieldId the id of the desired field
* @returns a reference to the first occurrence of the datafield with the specified id or `undefined` if such datafield could not be found
*/
export declare function getFieldFromDataGroups(groups: Array<DataGroup>, fieldId: string): DataField<any> | undefined;
/**
* @param groups a list of searched data groups
* @param fieldId the id of the desired field
* @returns an object containing the index of the data group and the field within it corresponding to the first occurrence of a
* datafield with the specified id or `undefined` if such datafield could not be found
*/
export declare function getFieldIndexFromDataGroups(groups: Array<DataGroup>, fieldId: string): DataGroupFieldIndex | undefined;
/**
* Contains the index of the data group and the index of the field within it that contains some data field
*/
export interface DataGroupFieldIndex {
dataGroupIndex: number;
fieldIndex: number;
}