@netgrif/components-core
Version:
Netgrif Application engine frontend core Angular library
87 lines (86 loc) • 4.63 kB
TypeScript
import { ElementRef, Injector, OnInit, TemplateRef } from '@angular/core';
import { WrappedBoolean } from './models/wrapped-boolean';
import { DataField } from '../models/abstract-data-field';
import { PaperViewService } from '../../navigation/quick-panel/components/paper-view.service';
import { ConfigurationService } from '../../configuration/configuration.service';
import { FormControl } from "@angular/forms";
import { ComponentPortal } from "@angular/cdk/portal";
import { ComponentRegistryService } from "../../registry/component-registry.service";
import * as i0 from "@angular/core";
/**
* Provides a responsive layout to data fields where their appearance can change based on the width of space they have available.
*
* If the width of the available space is less than the `layoutChangeWidthBreakpoint` then the provided `dataFieldTemplate` is displayed at
* 100% width. If the width is greater or equal to the breakpoint the datafield template occupies the right half and the left half contains
* it's title.
*
* If the datafield's layout is set to `TemplateAppearance.MATERIAL` the field always occupies 100% of the available space
* regardless of it's width.
*
* See {@link DataField} and {@link TemplateAppearance} for more information.
*/
export declare abstract class AbstractDataFieldTemplateComponent implements OnInit {
protected _paperView: PaperViewService;
protected _config: ConfigurationService;
protected _componentRegistry: ComponentRegistryService;
protected injector: Injector;
/**
* Content of the datafield that should be displayed in the template
*/
dataFieldTemplate: TemplateRef<any>;
/**
* If the available space has a width smaller that this breakpoint the datafield will fill 100% of the available space.
*
* The breakpoint is only taken into consideration if `TemplateAppearance.NETGRIF` is set on the data field.
*
* See [DataField.layout]{@link DataField#layout} for more information.
*/
layoutChangeWidthBreakpoint: number;
/**
* Field offset defined by task
*/
offset: number;
private _additionalFieldProperties;
container: ElementRef;
protected _dataField: DataField<any>;
protected _isConfiguredNetgrifTemplate: boolean;
protected _isNetgrifTemplate: boolean;
protected _componentPortal: ComponentPortal<any>;
/**
* @ignore
* The value determines whether the layout should be "small" or not. Data field fills 100% of the width in "small" layout.
*/
protected _showLargeLayout: WrappedBoolean;
protected constructor(_paperView: PaperViewService, _config: ConfigurationService, _componentRegistry: ComponentRegistryService, injector: Injector);
ngOnInit(): void;
get showLargeLayout(): WrappedBoolean;
/**
* Datafield model object that should be displayed in the template
*/
set dataField(dataField: DataField<any>);
get dataField(): DataField<any>;
get componentPortal(): ComponentPortal<any>;
get additionalFieldProperties(): {
[k: string]: string | number;
};
set additionalFieldProperties(value: {
[k: string]: string | number;
});
/**
* Function that is called when the Component changes dimension and
* determines whether the "small" or "large" layout should be displayed.
* @param event - event containing the new width of this Component
*/
evaluateTemplateCondition(): boolean;
hasComponent(): boolean;
resolveComponentPortal(dataField: DataField<any>, showLargeLayout: WrappedBoolean, formControlRef: FormControl, additionalFieldProperties?: {
[k: string]: string | number;
}): ComponentPortal<any>;
/**
* @returns `false` if the data field uses the `TemplateAppearance.MATERIAL` and `true` otherwise.
*/
protected evaluateTemplate(): boolean;
isPaperView(): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDataFieldTemplateComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractDataFieldTemplateComponent, "ncc-abstract-datafield-template", never, { "dataFieldTemplate": { "alias": "dataFieldTemplate"; "required": false; }; "layoutChangeWidthBreakpoint": { "alias": "layoutChangeWidthBreakpoint"; "required": false; }; "offset": { "alias": "offset"; "required": false; }; "_additionalFieldProperties": { "alias": "_additionalFieldProperties"; "required": false; }; "dataField": { "alias": "dataField"; "required": false; }; "additionalFieldProperties": { "alias": "additionalFieldProperties"; "required": false; }; }, {}, never, never, false, never>;
}