UNPKG

ngx-json-ui

Version:

This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.0.

49 lines (48 loc) 2.45 kB
import { ComponentModel } from '../../core/models/component.model'; import { DomSanitizer } from '@angular/platform-browser'; import * as i0 from "@angular/core"; export declare abstract class BaseComponent<C extends ComponentModel = ComponentModel> { protected sanitizer: DomSanitizer; constructor(sanitizer: DomSanitizer); /** * Importing the ComponentModel interface to define the structure of the component's configuration * This interface is expected to be defined in the specified path * The ComponentModel interface is likely to contain properties that define the component's behavior and appearance (Accept this field's as JSON ). * The @Input decorator allows the component to receive data from its parent component */ config: C; /** Binds to the host element’s `class` attr */ hostClasses: string; /** Binds to the host element’s `style` attr */ hostStyles: string; /** Binds to the element’s `class` attr */ classes: string; /** Binds to the element’s `style` attr */ styles: { [prop: string]: any; } | null; /** * This method applies host configuration to the component. * It takes an object with hostClass and hostStyle properties. * It converts the hostClass to a string * and assigns it to the hostClasses property. * It also assigns the hostStyle to the hostStyles property. * @param {ComponentModel} param0 - The host configuration object. * @param {string} param0.hostClass - The class to be applied to the host element. * @param {string} param0.hostStyle - The style to be applied to the host element. * @returns {void} * @protected */ protected applyHostConfig({ hostClass, hostStyle }: C): void; protected applyHostConfigViaClassStyle(config: C): void; /** * Converts a style‐object to a CSS string for HostBinding * This is useful for applying styles dynamically to the host element. * @param {Record<string,string> | null} [styles] - The styles to be converted to a CSS string. * @return {string} - The CSS string representation of the styles. * @private */ private stringifyStyles; static ɵfac: i0.ɵɵFactoryDeclaration<BaseComponent<any>, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<BaseComponent<any>, never, never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>; }