UNPKG

@ng-doc/app

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>

41 lines (37 loc) 5.1 kB
import { NgIf } from '@angular/common'; import * as i0 from '@angular/core'; import { Component, ChangeDetectionStrategy, Input } from '@angular/core'; import * as i1 from '@angular/forms'; import { FormsModule } from '@angular/forms'; import { NgDocInputWrapperComponent, NgDocInputNumberDirective, NgDocButtonIconComponent, NgDocFocusableDirective, NgDocIconComponent } from '@ng-doc/ui-kit'; import { DIControl, DIControlSilencerDirective } from 'di-controls'; class NgDocNumberControlComponent extends DIControl { constructor() { super(); } changeModel(value) { this.updateModel(value === null && this.default ? this.default : value); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocNumberControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: NgDocNumberControlComponent, isStandalone: true, selector: "ng-doc-number-control", inputs: { default: "default" }, usesInheritance: true, ngImport: i0, template: "<ng-doc-input-wrapper diControlSilencer>\n <input ngDocInputNumber type=\"number\" [ngModel]=\"model()\" (ngModelChange)=\"changeModel($event)\" />\n\n <button\n ng-doc-button-icon-transparent\n ngDocInputWrapperRight\n size=\"large\"\n [ngDocFocusable]=\"false\"\n [disabled]=\"disabled\"\n [rounded]=\"false\"\n (click)=\"updateModel(default ?? null)\"\n (focusout)=\"touch()\"\n *ngIf=\"model() && model() !== default\">\n <ng-doc-icon icon=\"x\"></ng-doc-icon>\n </button>\n</ng-doc-input-wrapper>\n", styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "component", type: NgDocInputWrapperComponent, selector: "ng-doc-input-wrapper", inputs: ["blurContent", "blurContext", "align"] }, { kind: "directive", type: DIControlSilencerDirective, selector: "[diControlSilencer]" }, { kind: "directive", type: NgDocInputNumberDirective, selector: "input[ngDocInputNumber]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NgDocButtonIconComponent, selector: "button[ng-doc-button-icon], a[ng-doc-button-icon], button[ng-doc-button-icon-raised], a[ng-doc-button-icon-raised], button[ng-doc-button-icon-transparent], a[ng-doc-button-icon-transparent]", inputs: ["size", "rounded"] }, { kind: "directive", type: NgDocFocusableDirective, selector: "[ngDocFocusable]", inputs: ["ngDocFocusable"], exportAs: ["ngDocFocusable"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgDocNumberControlComponent, decorators: [{ type: Component, args: [{ selector: 'ng-doc-number-control', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ NgDocInputWrapperComponent, DIControlSilencerDirective, NgDocInputNumberDirective, FormsModule, NgIf, NgDocButtonIconComponent, NgDocFocusableDirective, NgDocIconComponent, ], template: "<ng-doc-input-wrapper diControlSilencer>\n <input ngDocInputNumber type=\"number\" [ngModel]=\"model()\" (ngModelChange)=\"changeModel($event)\" />\n\n <button\n ng-doc-button-icon-transparent\n ngDocInputWrapperRight\n size=\"large\"\n [ngDocFocusable]=\"false\"\n [disabled]=\"disabled\"\n [rounded]=\"false\"\n (click)=\"updateModel(default ?? null)\"\n (focusout)=\"touch()\"\n *ngIf=\"model() && model() !== default\">\n <ng-doc-icon icon=\"x\"></ng-doc-icon>\n </button>\n</ng-doc-input-wrapper>\n", styles: [":host{display:block;width:100%}\n"] }] }], ctorParameters: () => [], propDecorators: { default: [{ type: Input }] } }); /** * Generated bundle index. Do not edit. */ export { NgDocNumberControlComponent }; //# sourceMappingURL=ng-doc-app-type-controls-number-control.mjs.map