UNPKG

igniteui-angular-inputs

Version:

Ignite UI Angular input components for building rich data visualizations for modern web apps.

166 lines (163 loc) 7.2 kB
import { TemplateRef, Component, ViewContainerRef, ViewChild, Input, ChangeDetectionStrategy, HostBinding } from '@angular/core'; import { XSuffix } from "./XSuffix"; import { ensureBool, NamePatcher } from "igniteui-angular-core"; import { AngularRenderer, PortalManager } from "igniteui-angular-core"; import { IgxXInputGroupItemComponent } from './igx-x-input-group-item-component'; import * as i0 from "@angular/core"; export let IgxXSuffixComponent = /*@__PURE__*/ (() => { class IgxXSuffixComponent extends IgxXInputGroupItemComponent { constructor(renderer, _elRef, ngZone, injector, componentFactoryResolver) { super(); this.renderer = renderer; this._elRef = _elRef; this.ngZone = ngZone; this.injector = injector; this.componentFactoryResolver = componentFactoryResolver; this._wrapper = null; this._portalManager = null; this._root = null; if (this._styling) { NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this)); } this._implementation = this.createImplementation(); this._implementation.externalObject = this; if (renderer) { this.container = renderer.createElement("div"); renderer.appendChild(_elRef.element.nativeElement, this.container); renderer.setStyle(this.container, "display", "inline-block"); } var root; root = this.container; if (this.container != null) { root = this.container; } if (root && root.nativeElement) { root = root.nativeElement; } this._root = root; var suffix = this.i; this._suffix = suffix; if (renderer) { this._portalManager = new PortalManager("suffixContent", componentFactoryResolver); var ren = new AngularRenderer(root, this.renderer, window.document, this.ngZone, true, {}, this._portalManager); this._wrapper = ren; suffix.provideContainer(ren); } } // supports angular themes or custom properties set in CSS updateStyle() { this._styling(this._root, this); } ngOnDestroy() { this._suffix.destroy(); this._wrapper.destroy(); } ngAfterViewInit() { this._portalManager.dynamicContent = this._dynamicContent; this._portalManager.onChildContentChanged(this._childTemplateRef); this._styling(this._root, this); this.updateStyle(); } createImplementation() { return new XSuffix(); } get i() { return this._implementation; } /** * Gets or sets the id to use for the checkbox. */ get id() { return this.i.z; } set id(v) { this.i.z = v; } /** * Gets or sets the value of the aria-label attribute. */ get ariaLabel() { return this.i.w; } set ariaLabel(v) { this.i.w = v; } /** * Gets or sets whether the suffix is hovered. */ get isHover() { return this.i.q; } set isHover(v) { this.i.q = ensureBool(v); } /** * Gets or sets whether the checkbox is disabled. */ get disabled() { return this.i.disabled; } set disabled(v) { this.i.disabled = ensureBool(v); } onDetachedFromUI() { this.i.onDetachedFromUI(); } onAttachedToUI() { this.i.onAttachedToUI(); } /** * Exports visual information about the current state of the grid. */ exportVisualModel() { let iv = this.i.t(); return (iv); } /** * Returns a serialized copy of the exported visual model */ exportSerializedVisualModel() { let iv = this.i.y(); return (iv); } } IgxXSuffixComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxXSuffixComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ViewContainerRef }, { token: i0.NgZone }, { token: i0.Injector }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component }); IgxXSuffixComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxXSuffixComponent, selector: "igx-x-suffix", inputs: { id: "id", ariaLabel: ["aria-label", "ariaLabel"], isHover: "isHover", disabled: "disabled" }, host: { properties: { "attr.id": "this.id" }, classAttribute: "ig-x-suffix igx-x-suffix" }, providers: [], viewQueries: [{ propertyName: "_dynamicContent", first: true, predicate: ["dynamicContent"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "_childTemplateRef", first: true, predicate: ["childContent"], descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: `<ng-template #childContent><ng-content></ng-content></ng-template> <ng-container #dynamicContent></ng-container>`, isInline: true, styles: ["\n\t\t:host {\n\t\t\tdisplay: inline-block; \n vertical-align: middle; \n\t\t}\n\t"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); return IgxXSuffixComponent; })(); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxXSuffixComponent, decorators: [{ type: Component, args: [{ selector: 'igx-x-suffix', template: `<ng-template #childContent><ng-content></ng-content></ng-template> <ng-container #dynamicContent></ng-container>`, changeDetection: ChangeDetectionStrategy.OnPush, providers: [], host: { 'class': 'ig-x-suffix igx-x-suffix' }, styles: [` :host { display: inline-block; vertical-align: middle; } `] }] }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i0.NgZone }, { type: i0.Injector }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: { _dynamicContent: [{ type: ViewChild, args: ["dynamicContent", { read: ViewContainerRef, static: true }] }], _childTemplateRef: [{ type: ViewChild, args: ["childContent", { read: TemplateRef, static: false }] }], id: [{ type: HostBinding, args: ['attr.id'] }, { type: Input }], ariaLabel: [{ type: Input, args: ['aria-label'] }], isHover: [{ type: Input }], disabled: [{ type: Input }] } });