UNPKG

@ng-doc/ui-kit

Version:

<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>

78 lines (74 loc) 7.01 kB
import { NgIf, NgTemplateOutlet } from '@angular/common'; import * as i0 from '@angular/core'; import { TemplateRef, Component, ChangeDetectionStrategy, Input, ContentChild } from '@angular/core'; import { NgDocComboboxHostComponent } from '@ng-doc/ui-kit/cdk/combobox-host'; import { NgDocListHost } from '@ng-doc/ui-kit/classes/list-host'; import { NgDocClearControlComponent } from '@ng-doc/ui-kit/components/clear-control'; import { NgDocDropdownComponent } from '@ng-doc/ui-kit/components/dropdown'; import { NgDocInputWrapperComponent } from '@ng-doc/ui-kit/components/input-wrapper'; import { NgDocDataDirective } from '@ng-doc/ui-kit/directives/data'; import { NgDocFocusCatcherDirective } from '@ng-doc/ui-kit/directives/focus-catcher'; import { NgDocInputStringDirective } from '@ng-doc/ui-kit/directives/input-string'; import * as i1 from '@tinkoff/ng-polymorpheus'; import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus'; import { DIControl, provideHostControl } from 'di-controls'; class NgDocComboboxComponent extends DIControl { constructor() { super(); this.readonly = false; this.placeholder = 'Chose the value'; this.clearButton = true; this.rightContent = ''; this.valueContent = ''; this.data = null; } get listHostOrigin() { return this.elementRef.nativeElement; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: NgDocComboboxComponent, isStandalone: true, selector: "ng-doc-combobox", inputs: { readonly: "readonly", placeholder: "placeholder", clearButton: "clearButton", rightContent: "rightContent", valueContent: "valueContent" }, providers: [ provideHostControl(NgDocComboboxComponent), { provide: NgDocListHost, useExisting: NgDocComboboxComponent, }, ], queries: [{ propertyName: "data", first: true, predicate: NgDocDataDirective, descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<ng-doc-combobox-host>\n <ng-doc-input-wrapper\n ngDocFocusCatcher\n [blurContent]=\"hasValue ? valueContent : ''\"\n [blurContext]=\"model()\">\n <input ngDocInputString [readonly]=\"readonly\" [placeholder]=\"placeholder\" />\n <ng-container ngDocInputWrapperRight>\n <ng-container *polymorpheusOutlet=\"rightContent\"></ng-container>\n <ng-doc-clear-control *ngIf=\"clearButton\"></ng-doc-clear-control>\n </ng-container>\n <ng-doc-dropdown [content]=\"dropdownContent\" [closeIfInnerClick]=\"true\">\n <ng-template #dropdownContent>\n <ng-container *ngTemplateOutlet=\"data\"></ng-container>\n </ng-template>\n </ng-doc-dropdown>\n </ng-doc-input-wrapper>\n</ng-doc-combobox-host>\n", styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "component", type: NgDocComboboxHostComponent, selector: "ng-doc-combobox-host", inputs: ["compareFn", "displayValueFn"] }, { kind: "component", type: NgDocInputWrapperComponent, selector: "ng-doc-input-wrapper", inputs: ["blurContent", "blurContext", "align"] }, { kind: "directive", type: NgDocFocusCatcherDirective, selector: "[ngDocFocusCatcher]", outputs: ["focusEvent", "blurEvent"], exportAs: ["ngDocFocusCatcher"] }, { kind: "directive", type: NgDocInputStringDirective, selector: "input[ngDocInputString]" }, { kind: "ngmodule", type: PolymorpheusModule }, { kind: "directive", type: i1.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NgDocClearControlComponent, selector: "ng-doc-clear-control" }, { kind: "component", type: NgDocDropdownComponent, selector: "ng-doc-dropdown", inputs: ["content", "origin", "closeIfOutsideClick", "closeIfInnerClick", "withArrow", "borderOffset", "panelClass", "contactBorder", "hasBackdrop", "positions", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocComboboxComponent, decorators: [{ type: Component, args: [{ selector: 'ng-doc-combobox', providers: [ provideHostControl(NgDocComboboxComponent), { provide: NgDocListHost, useExisting: NgDocComboboxComponent, }, ], changeDetection: ChangeDetectionStrategy.OnPush, imports: [ NgDocComboboxHostComponent, NgDocInputWrapperComponent, NgDocFocusCatcherDirective, NgDocInputStringDirective, PolymorpheusModule, NgIf, NgDocClearControlComponent, NgDocDropdownComponent, NgTemplateOutlet, ], template: "<ng-doc-combobox-host>\n <ng-doc-input-wrapper\n ngDocFocusCatcher\n [blurContent]=\"hasValue ? valueContent : ''\"\n [blurContext]=\"model()\">\n <input ngDocInputString [readonly]=\"readonly\" [placeholder]=\"placeholder\" />\n <ng-container ngDocInputWrapperRight>\n <ng-container *polymorpheusOutlet=\"rightContent\"></ng-container>\n <ng-doc-clear-control *ngIf=\"clearButton\"></ng-doc-clear-control>\n </ng-container>\n <ng-doc-dropdown [content]=\"dropdownContent\" [closeIfInnerClick]=\"true\">\n <ng-template #dropdownContent>\n <ng-container *ngTemplateOutlet=\"data\"></ng-container>\n </ng-template>\n </ng-doc-dropdown>\n </ng-doc-input-wrapper>\n</ng-doc-combobox-host>\n", styles: [":host{display:block;width:100%}\n"] }] }], ctorParameters: () => [], propDecorators: { readonly: [{ type: Input }], placeholder: [{ type: Input }], clearButton: [{ type: Input }], rightContent: [{ type: Input }], valueContent: [{ type: Input }], data: [{ type: ContentChild, args: [NgDocDataDirective, { read: TemplateRef }] }] } }); /** * Generated bundle index. Do not edit. */ export { NgDocComboboxComponent }; //# sourceMappingURL=ng-doc-ui-kit-components-combobox.mjs.map