ngx-st-qty-input 17.0.2 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation, } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, ViewEncapsulation, input, output, model, } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "@angular/common";
4
4
  import * as i2 from "@angular/forms";
@@ -9,45 +9,36 @@ import * as i6 from "@angular/material/icon";
9
9
  export class QtyInputComponent {
10
10
  constructor(changeDetectorRef) {
11
11
  this.changeDetectorRef = changeDetectorRef;
12
- this.allowNegative = false;
13
- this.disabled = false;
14
- this.showError = false;
15
- this.newValueEmitter = new EventEmitter();
12
+ this.qtyModel = model.required();
13
+ this.allowNegative = input(false);
14
+ this.disabled = input(false);
15
+ this.showError = input(false);
16
+ this.newValueEmitter = output();
16
17
  }
17
18
  ngOnInit() { }
18
19
  removeClicked(event) {
19
20
  event.stopImmediatePropagation();
20
- this.qtyModel -= 1;
21
- this.newValueEmitter.emit(this.qtyModel);
21
+ this.qtyModel.update(val => val - 1);
22
+ this.newValueEmitter.emit(this.qtyModel());
22
23
  this.changeDetectorRef.markForCheck();
23
24
  }
24
25
  addClicked(event) {
25
26
  event.stopImmediatePropagation();
26
- this.qtyModel += 1;
27
- this.newValueEmitter.emit(this.qtyModel);
27
+ this.qtyModel.update(val => val + 1);
28
+ this.newValueEmitter.emit(this.qtyModel());
28
29
  this.changeDetectorRef.markForCheck();
29
30
  }
30
31
  qtyModelChanged() {
31
- if (!this.allowNegative && this.qtyModel < 0) {
32
- this.qtyModel = 0;
32
+ if (!this.allowNegative() && this.qtyModel() < 0) {
33
+ this.qtyModel.set(0);
33
34
  }
34
- this.newValueEmitter.emit(this.qtyModel);
35
+ this.newValueEmitter.emit(this.qtyModel());
35
36
  }
36
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: QtyInputComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
37
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: QtyInputComponent, selector: "ngx-st-qty-input", inputs: { qtyModel: "qtyModel", allowNegative: "allowNegative", disabled: "disabled", showError: "showError" }, outputs: { newValueEmitter: "newValueEmitter" }, ngImport: i0, template: "<div class=\"row align-items-center st-qty-input\">\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeClicked($event)\"\r\n [disabled]=\"(!allowNegative && qtyModel === 0) || disabled\"\r\n >\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"col\">\r\n <mat-form-field style=\"width: 55px; margin-bottom: -15px\">\r\n <input\r\n matInput\r\n type=\"number\"\r\n [(ngModel)]=\"qtyModel\"\r\n [disabled]=\"disabled\"\r\n [ngClass]=\"{ 'qty-input-error': showError }\"\r\n (ngModelChange)=\"qtyModelChanged()\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"addClicked($event)\"\r\n [disabled]=\"disabled\"\r\n >\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".st-qty-input{min-width:120px;flex-wrap:nowrap!important}.st-qty-input .qty-input-error{color:red;font-weight:700}.st-qty-input .col-auto,.st-qty-input .col{padding:0}.st-qty-input mat-form-field input{text-align:right}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.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: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
37
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: QtyInputComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
38
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: QtyInputComponent, selector: "ngx-st-qty-input", inputs: { qtyModel: { classPropertyName: "qtyModel", publicName: "qtyModel", isSignal: true, isRequired: true, transformFunction: null }, allowNegative: { classPropertyName: "allowNegative", publicName: "allowNegative", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showError: { classPropertyName: "showError", publicName: "showError", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { qtyModel: "qtyModelChange", newValueEmitter: "newValueEmitter" }, ngImport: i0, template: "<div class=\"row align-items-center st-qty-input\">\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeClicked($event)\"\r\n [disabled]=\"(!allowNegative() && qtyModel() === 0) || disabled()\"\r\n >\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"col\">\r\n <mat-form-field style=\"width: 55px; margin-bottom: -15px\">\r\n <input\r\n matInput\r\n type=\"number\"\r\n [(ngModel)]=\"qtyModel\"\r\n [disabled]=\"disabled()\"\r\n [ngClass]=\"{ 'qty-input-error': showError() }\"\r\n (ngModelChange)=\"qtyModelChanged()\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"addClicked($event)\"\r\n [disabled]=\"disabled()\"\r\n >\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".st-qty-input{min-width:120px;flex-wrap:nowrap!important}.st-qty-input .qty-input-error{color:red;font-weight:700}.st-qty-input .col-auto,.st-qty-input .col{padding:0}.st-qty-input mat-form-field input{text-align:right}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.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: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
38
39
  }
39
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: QtyInputComponent, decorators: [{
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: QtyInputComponent, decorators: [{
40
41
  type: Component,
41
- args: [{ selector: 'ngx-st-qty-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"row align-items-center st-qty-input\">\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeClicked($event)\"\r\n [disabled]=\"(!allowNegative && qtyModel === 0) || disabled\"\r\n >\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"col\">\r\n <mat-form-field style=\"width: 55px; margin-bottom: -15px\">\r\n <input\r\n matInput\r\n type=\"number\"\r\n [(ngModel)]=\"qtyModel\"\r\n [disabled]=\"disabled\"\r\n [ngClass]=\"{ 'qty-input-error': showError }\"\r\n (ngModelChange)=\"qtyModelChanged()\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"addClicked($event)\"\r\n [disabled]=\"disabled\"\r\n >\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".st-qty-input{min-width:120px;flex-wrap:nowrap!important}.st-qty-input .qty-input-error{color:red;font-weight:700}.st-qty-input .col-auto,.st-qty-input .col{padding:0}.st-qty-input mat-form-field input{text-align:right}\n"] }]
42
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { qtyModel: [{
43
- type: Input
44
- }], allowNegative: [{
45
- type: Input
46
- }], disabled: [{
47
- type: Input
48
- }], showError: [{
49
- type: Input
50
- }], newValueEmitter: [{
51
- type: Output
52
- }] } });
53
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXR5LWlucHV0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1zdC1xdHktaW5wdXQvc3JjL2xpYi9jb21wb25lbnRzL3F0eS1pbnB1dC9xdHktaW5wdXQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXN0LXF0eS1pbnB1dC9zcmMvbGliL2NvbXBvbmVudHMvcXR5LWlucHV0L3F0eS1pbnB1dC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsdUJBQXVCLEVBRXZCLFNBQVMsRUFDVCxZQUFZLEVBQ1osS0FBSyxFQUVMLE1BQU0sRUFDTixpQkFBaUIsR0FDbEIsTUFBTSxlQUFlLENBQUM7Ozs7Ozs7O0FBU3ZCLE1BQU0sT0FBTyxpQkFBaUI7SUFnQjVCLFlBQW9CLGlCQUFvQztRQUFwQyxzQkFBaUIsR0FBakIsaUJBQWlCLENBQW1CO1FBWHhELGtCQUFhLEdBQVksS0FBS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sLXhzLWF1dG9cIj5cclxuICAgIDxidXR0b25cclxuICAgICAgbWF0LWljb24tYnV0dG9uXHJcbiAgICAgIGNvbG9yPVwiYWNjZW50XCJcclxuICAgICAgKGNsaWNrKT1cImFkZENsaWNrZWQoJGV2ZW50KVwiXHJcbiAgICAgIFtkaXNhYmxlZF09XCJkaXNhYmxlZFwiXHJcbiAgICA+XHJcbiAgICAgIDxtYXQtaWNvbj5hZGQ8L21hdC1pY29uPlxyXG4gICAgPC9idXR0b24+XHJcbiAgPC9kaXY+XHJcbjwvZGl2PlxyXG4iXX0=
42
+ args: [{ selector: 'ngx-st-qty-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"row align-items-center st-qty-input\">\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeClicked($event)\"\r\n [disabled]=\"(!allowNegative() && qtyModel() === 0) || disabled()\"\r\n >\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"col\">\r\n <mat-form-field style=\"width: 55px; margin-bottom: -15px\">\r\n <input\r\n matInput\r\n type=\"number\"\r\n [(ngModel)]=\"qtyModel\"\r\n [disabled]=\"disabled()\"\r\n [ngClass]=\"{ 'qty-input-error': showError() }\"\r\n (ngModelChange)=\"qtyModelChanged()\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"addClicked($event)\"\r\n [disabled]=\"disabled()\"\r\n >\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".st-qty-input{min-width:120px;flex-wrap:nowrap!important}.st-qty-input .qty-input-error{color:red;font-weight:700}.st-qty-input .col-auto,.st-qty-input .col{padding:0}.st-qty-input mat-form-field input{text-align:right}\n"] }]
43
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
44
+ //# sourceMappingURL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Nvbj5cclxuICAgIDwvYnV0dG9uPlxyXG4gIDwvZGl2PlxyXG48L2Rpdj5cclxuIl19
@@ -12,21 +12,21 @@ export class StQtyInputModule {
12
12
  this.matIconRegistry = matIconRegistry;
13
13
  this.matIconRegistry.setDefaultFontSetClass('material-symbols-outlined');
14
14
  }
15
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: StQtyInputModule, deps: [{ token: i1.MatIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule }); }
16
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: StQtyInputModule, declarations: [QtyInputComponent], imports: [CommonModule,
15
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StQtyInputModule, deps: [{ token: i1.MatIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule }); }
16
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: StQtyInputModule, declarations: [QtyInputComponent], imports: [CommonModule,
17
17
  FormsModule,
18
18
  ReactiveFormsModule,
19
19
  MatButtonModule,
20
20
  MatInputModule,
21
21
  MatIconModule], exports: [QtyInputComponent] }); }
22
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: StQtyInputModule, imports: [CommonModule,
22
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StQtyInputModule, imports: [CommonModule,
23
23
  FormsModule,
24
24
  ReactiveFormsModule,
25
25
  MatButtonModule,
26
26
  MatInputModule,
27
27
  MatIconModule] }); }
28
28
  }
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: StQtyInputModule, decorators: [{
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StQtyInputModule, decorators: [{
30
30
  type: NgModule,
31
31
  args: [{
32
32
  declarations: [QtyInputComponent],
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
2
+ import { model, input, output, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from '@angular/forms';
@@ -15,68 +15,59 @@ import { MatIconModule } from '@angular/material/icon';
15
15
  class QtyInputComponent {
16
16
  constructor(changeDetectorRef) {
17
17
  this.changeDetectorRef = changeDetectorRef;
18
- this.allowNegative = false;
19
- this.disabled = false;
20
- this.showError = false;
21
- this.newValueEmitter = new EventEmitter();
18
+ this.qtyModel = model.required();
19
+ this.allowNegative = input(false);
20
+ this.disabled = input(false);
21
+ this.showError = input(false);
22
+ this.newValueEmitter = output();
22
23
  }
23
24
  ngOnInit() { }
24
25
  removeClicked(event) {
25
26
  event.stopImmediatePropagation();
26
- this.qtyModel -= 1;
27
- this.newValueEmitter.emit(this.qtyModel);
27
+ this.qtyModel.update(val => val - 1);
28
+ this.newValueEmitter.emit(this.qtyModel());
28
29
  this.changeDetectorRef.markForCheck();
29
30
  }
30
31
  addClicked(event) {
31
32
  event.stopImmediatePropagation();
32
- this.qtyModel += 1;
33
- this.newValueEmitter.emit(this.qtyModel);
33
+ this.qtyModel.update(val => val + 1);
34
+ this.newValueEmitter.emit(this.qtyModel());
34
35
  this.changeDetectorRef.markForCheck();
35
36
  }
36
37
  qtyModelChanged() {
37
- if (!this.allowNegative && this.qtyModel < 0) {
38
- this.qtyModel = 0;
38
+ if (!this.allowNegative() && this.qtyModel() < 0) {
39
+ this.qtyModel.set(0);
39
40
  }
40
- this.newValueEmitter.emit(this.qtyModel);
41
+ this.newValueEmitter.emit(this.qtyModel());
41
42
  }
42
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: QtyInputComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
43
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: QtyInputComponent, selector: "ngx-st-qty-input", inputs: { qtyModel: "qtyModel", allowNegative: "allowNegative", disabled: "disabled", showError: "showError" }, outputs: { newValueEmitter: "newValueEmitter" }, ngImport: i0, template: "<div class=\"row align-items-center st-qty-input\">\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeClicked($event)\"\r\n [disabled]=\"(!allowNegative && qtyModel === 0) || disabled\"\r\n >\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"col\">\r\n <mat-form-field style=\"width: 55px; margin-bottom: -15px\">\r\n <input\r\n matInput\r\n type=\"number\"\r\n [(ngModel)]=\"qtyModel\"\r\n [disabled]=\"disabled\"\r\n [ngClass]=\"{ 'qty-input-error': showError }\"\r\n (ngModelChange)=\"qtyModelChanged()\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"addClicked($event)\"\r\n [disabled]=\"disabled\"\r\n >\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".st-qty-input{min-width:120px;flex-wrap:nowrap!important}.st-qty-input .qty-input-error{color:red;font-weight:700}.st-qty-input .col-auto,.st-qty-input .col{padding:0}.st-qty-input mat-form-field input{text-align:right}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.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: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
43
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: QtyInputComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
44
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: QtyInputComponent, selector: "ngx-st-qty-input", inputs: { qtyModel: { classPropertyName: "qtyModel", publicName: "qtyModel", isSignal: true, isRequired: true, transformFunction: null }, allowNegative: { classPropertyName: "allowNegative", publicName: "allowNegative", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showError: { classPropertyName: "showError", publicName: "showError", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { qtyModel: "qtyModelChange", newValueEmitter: "newValueEmitter" }, ngImport: i0, template: "<div class=\"row align-items-center st-qty-input\">\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeClicked($event)\"\r\n [disabled]=\"(!allowNegative() && qtyModel() === 0) || disabled()\"\r\n >\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"col\">\r\n <mat-form-field style=\"width: 55px; margin-bottom: -15px\">\r\n <input\r\n matInput\r\n type=\"number\"\r\n [(ngModel)]=\"qtyModel\"\r\n [disabled]=\"disabled()\"\r\n [ngClass]=\"{ 'qty-input-error': showError() }\"\r\n (ngModelChange)=\"qtyModelChanged()\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"addClicked($event)\"\r\n [disabled]=\"disabled()\"\r\n >\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".st-qty-input{min-width:120px;flex-wrap:nowrap!important}.st-qty-input .qty-input-error{color:red;font-weight:700}.st-qty-input .col-auto,.st-qty-input .col{padding:0}.st-qty-input mat-form-field input{text-align:right}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.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: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
44
45
  }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: QtyInputComponent, decorators: [{
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: QtyInputComponent, decorators: [{
46
47
  type: Component,
47
- args: [{ selector: 'ngx-st-qty-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"row align-items-center st-qty-input\">\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeClicked($event)\"\r\n [disabled]=\"(!allowNegative && qtyModel === 0) || disabled\"\r\n >\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"col\">\r\n <mat-form-field style=\"width: 55px; margin-bottom: -15px\">\r\n <input\r\n matInput\r\n type=\"number\"\r\n [(ngModel)]=\"qtyModel\"\r\n [disabled]=\"disabled\"\r\n [ngClass]=\"{ 'qty-input-error': showError }\"\r\n (ngModelChange)=\"qtyModelChanged()\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"addClicked($event)\"\r\n [disabled]=\"disabled\"\r\n >\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".st-qty-input{min-width:120px;flex-wrap:nowrap!important}.st-qty-input .qty-input-error{color:red;font-weight:700}.st-qty-input .col-auto,.st-qty-input .col{padding:0}.st-qty-input mat-form-field input{text-align:right}\n"] }]
48
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { qtyModel: [{
49
- type: Input
50
- }], allowNegative: [{
51
- type: Input
52
- }], disabled: [{
53
- type: Input
54
- }], showError: [{
55
- type: Input
56
- }], newValueEmitter: [{
57
- type: Output
58
- }] } });
48
+ args: [{ selector: 'ngx-st-qty-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"row align-items-center st-qty-input\">\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeClicked($event)\"\r\n [disabled]=\"(!allowNegative() && qtyModel() === 0) || disabled()\"\r\n >\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"col\">\r\n <mat-form-field style=\"width: 55px; margin-bottom: -15px\">\r\n <input\r\n matInput\r\n type=\"number\"\r\n [(ngModel)]=\"qtyModel\"\r\n [disabled]=\"disabled()\"\r\n [ngClass]=\"{ 'qty-input-error': showError() }\"\r\n (ngModelChange)=\"qtyModelChanged()\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"addClicked($event)\"\r\n [disabled]=\"disabled()\"\r\n >\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".st-qty-input{min-width:120px;flex-wrap:nowrap!important}.st-qty-input .qty-input-error{color:red;font-weight:700}.st-qty-input .col-auto,.st-qty-input .col{padding:0}.st-qty-input mat-form-field input{text-align:right}\n"] }]
49
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
59
50
 
60
51
  class StQtyInputModule {
61
52
  constructor(matIconRegistry) {
62
53
  this.matIconRegistry = matIconRegistry;
63
54
  this.matIconRegistry.setDefaultFontSetClass('material-symbols-outlined');
64
55
  }
65
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: StQtyInputModule, deps: [{ token: i1$1.MatIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule }); }
66
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: StQtyInputModule, declarations: [QtyInputComponent], imports: [CommonModule,
56
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StQtyInputModule, deps: [{ token: i1$1.MatIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule }); }
57
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: StQtyInputModule, declarations: [QtyInputComponent], imports: [CommonModule,
67
58
  FormsModule,
68
59
  ReactiveFormsModule,
69
60
  MatButtonModule,
70
61
  MatInputModule,
71
62
  MatIconModule], exports: [QtyInputComponent] }); }
72
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: StQtyInputModule, imports: [CommonModule,
63
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StQtyInputModule, imports: [CommonModule,
73
64
  FormsModule,
74
65
  ReactiveFormsModule,
75
66
  MatButtonModule,
76
67
  MatInputModule,
77
68
  MatIconModule] }); }
78
69
  }
79
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: StQtyInputModule, decorators: [{
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StQtyInputModule, decorators: [{
80
71
  type: NgModule,
81
72
  args: [{
82
73
  declarations: [QtyInputComponent],
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-st-qty-input.mjs","sources":["../../../projects/ngx-st-qty-input/src/lib/components/qty-input/qty-input.component.ts","../../../projects/ngx-st-qty-input/src/lib/components/qty-input/qty-input.component.html","../../../projects/ngx-st-qty-input/src/lib/ngx-st-qty-input.module.ts","../../../projects/ngx-st-qty-input/src/public-api.ts","../../../projects/ngx-st-qty-input/src/ngx-st-qty-input.ts"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n ViewEncapsulation,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'ngx-st-qty-input',\r\n templateUrl: './qty-input.component.html',\r\n styleUrls: ['./qty-input.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\nexport class QtyInputComponent implements OnInit {\r\n @Input()\r\n qtyModel: number;\r\n\r\n @Input()\r\n allowNegative: boolean = false;\r\n\r\n @Input()\r\n disabled: boolean = false;\r\n\r\n @Input()\r\n showError = false;\r\n\r\n @Output()\r\n newValueEmitter: EventEmitter<number> = new EventEmitter<number>();\r\n\r\n constructor(private changeDetectorRef: ChangeDetectorRef) {}\r\n\r\n ngOnInit(): void {}\r\n\r\n removeClicked(event: MouseEvent) {\r\n event.stopImmediatePropagation();\r\n\r\n this.qtyModel -= 1;\r\n this.newValueEmitter.emit(this.qtyModel);\r\n this.changeDetectorRef.markForCheck();\r\n }\r\n\r\n addClicked(event: MouseEvent) {\r\n event.stopImmediatePropagation();\r\n\r\n this.qtyModel += 1;\r\n this.newValueEmitter.emit(this.qtyModel);\r\n this.changeDetectorRef.markForCheck();\r\n }\r\n\r\n qtyModelChanged() {\r\n if (!this.allowNegative && this.qtyModel < 0) {\r\n this.qtyModel = 0;\r\n }\r\n\r\n this.newValueEmitter.emit(this.qtyModel);\r\n }\r\n}\r\n","<div class=\"row align-items-center st-qty-input\">\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeClicked($event)\"\r\n [disabled]=\"(!allowNegative && qtyModel === 0) || disabled\"\r\n >\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"col\">\r\n <mat-form-field style=\"width: 55px; margin-bottom: -15px\">\r\n <input\r\n matInput\r\n type=\"number\"\r\n [(ngModel)]=\"qtyModel\"\r\n [disabled]=\"disabled\"\r\n [ngClass]=\"{ 'qty-input-error': showError }\"\r\n (ngModelChange)=\"qtyModelChanged()\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"addClicked($event)\"\r\n [disabled]=\"disabled\"\r\n >\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { QtyInputComponent } from './components/qty-input/qty-input.component';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatIconModule, MatIconRegistry } from '@angular/material/icon';\r\n\r\n@NgModule({\r\n declarations: [QtyInputComponent],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatButtonModule,\r\n MatInputModule,\r\n MatIconModule,\r\n ],\r\n exports: [QtyInputComponent],\r\n})\r\nexport class StQtyInputModule {\r\n constructor(private matIconRegistry: MatIconRegistry) {\r\n this.matIconRegistry.setDefaultFontSetClass('material-symbols-outlined');\r\n }\r\n}\r\n","/*\r\n * Public API Surface of ngx-st-qty-input\r\n */\r\n\r\nexport * from './lib/components/qty-input/qty-input.component';\r\nexport * from './lib/ngx-st-qty-input.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i6","i1"],"mappings":";;;;;;;;;;;;;;MAkBa,iBAAiB,CAAA;AAgB5B,IAAA,WAAA,CAAoB,iBAAoC,EAAA;QAApC,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB;QAXrC,IAAa,CAAA,aAAA,GAAY,KAAK;QAG9B,IAAQ,CAAA,QAAA,GAAY,KAAK;QAGzB,IAAS,CAAA,SAAA,GAAG,KAAK;AAGjB,QAAA,IAAA,CAAA,eAAe,GAAyB,IAAI,YAAY,EAAU;;AAIlE,IAAA,QAAQ;AAER,IAAA,aAAa,CAAC,KAAiB,EAAA;QAC7B,KAAK,CAAC,wBAAwB,EAAE;AAEhC,QAAA,IAAI,CAAC,QAAQ,IAAI,CAAC;QAClB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AACxC,QAAA,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE;;AAGvC,IAAA,UAAU,CAAC,KAAiB,EAAA;QAC1B,KAAK,CAAC,wBAAwB,EAAE;AAEhC,QAAA,IAAI,CAAC,QAAQ,IAAI,CAAC;QAClB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AACxC,QAAA,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE;;IAGvC,eAAe,GAAA;QACb,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5C,YAAA,IAAI,CAAC,QAAQ,GAAG,CAAC;;QAGnB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;;+GAzC/B,iBAAiB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,iBAAA,EAAA,CAAA,E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A,IAAI,CAAC,eAAe,CAAC,sBAAsB,CAAC,2BAA2B,CAAC;;+GAF/D,gBAAgB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAC,IAAA,CAAA,eAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAhB,gBAAgB,EAAA,YAAA,EAAA,CAXZ,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAE9B,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,eAAe;YACf,cAAc;AACd,YAAA,aAAa,aAEL,iBAAiB,CAAA,EAAA,CAAA,CAAA;AAEhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YATzB,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,eAAe;YACf,cAAc;YACd,aAAa,CAAA,EAAA,CAAA,CAAA;;4FAIJ,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAZ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,eAAe;wBACf,cAAc;wBACd,aAAa;AACd,qBAAA;oBACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC7B,iBAAA;;;ACnBD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-st-qty-input.mjs","sources":["../../../projects/ngx-st-qty-input/src/lib/components/qty-input/qty-input.component.ts","../../../projects/ngx-st-qty-input/src/lib/components/qty-input/qty-input.component.html","../../../projects/ngx-st-qty-input/src/lib/ngx-st-qty-input.module.ts","../../../projects/ngx-st-qty-input/src/public-api.ts","../../../projects/ngx-st-qty-input/src/ngx-st-qty-input.ts"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n OnInit,\r\n ViewEncapsulation,\r\n input,\r\n output,\r\n model,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'ngx-st-qty-input',\r\n templateUrl: './qty-input.component.html',\r\n styleUrls: ['./qty-input.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\nexport class QtyInputComponent implements OnInit {\r\n qtyModel = model.required<number>();\r\n\r\n allowNegative = input<boolean>(false);\r\n\r\n disabled = input<boolean>(false);\r\n\r\n showError = input(false);\r\n\r\n newValueEmitter = output<number>();\r\n\r\n constructor(private changeDetectorRef: ChangeDetectorRef) {}\r\n\r\n ngOnInit(): void {}\r\n\r\n removeClicked(event: MouseEvent) {\r\n event.stopImmediatePropagation();\r\n\r\n this.qtyModel.update(val => val - 1);\r\n this.newValueEmitter.emit(this.qtyModel());\r\n this.changeDetectorRef.markForCheck();\r\n }\r\n\r\n addClicked(event: MouseEvent) {\r\n event.stopImmediatePropagation();\r\n\r\n this.qtyModel.update(val => val + 1);\r\n this.newValueEmitter.emit(this.qtyModel());\r\n this.changeDetectorRef.markForCheck();\r\n }\r\n\r\n qtyModelChanged() {\r\n if (!this.allowNegative() && this.qtyModel() < 0) {\r\n this.qtyModel.set(0);\r\n }\r\n\r\n this.newValueEmitter.emit(this.qtyModel());\r\n }\r\n}\r\n","<div class=\"row align-items-center st-qty-input\">\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeClicked($event)\"\r\n [disabled]=\"(!allowNegative() && qtyModel() === 0) || disabled()\"\r\n >\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"col\">\r\n <mat-form-field style=\"width: 55px; margin-bottom: -15px\">\r\n <input\r\n matInput\r\n type=\"number\"\r\n [(ngModel)]=\"qtyModel\"\r\n [disabled]=\"disabled()\"\r\n [ngClass]=\"{ 'qty-input-error': showError() }\"\r\n (ngModelChange)=\"qtyModelChanged()\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-xs-auto\">\r\n <button\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"addClicked($event)\"\r\n [disabled]=\"disabled()\"\r\n >\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { QtyInputComponent } from './components/qty-input/qty-input.component';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatIconModule, MatIconRegistry } from '@angular/material/icon';\r\n\r\n@NgModule({\r\n declarations: [QtyInputComponent],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatButtonModule,\r\n MatInputModule,\r\n MatIconModule,\r\n ],\r\n exports: [QtyInputComponent],\r\n})\r\nexport class StQtyInputModule {\r\n constructor(private matIconRegistry: MatIconRegistry) {\r\n this.matIconRegistry.setDefaultFontSetClass('material-symbols-outlined');\r\n }\r\n}\r\n","/*\r\n * Public API Surface of ngx-st-qty-input\r\n */\r\n\r\nexport * from './lib/components/qty-input/qty-input.component';\r\nexport * from './lib/ngx-st-qty-input.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i6","i1"],"mappings":";;;;;;;;;;;;;;MAkBa,iBAAiB,CAAA;AAW5B,IAAA,WAAA,CAAoB,iBAAoC,EAAA;QAApC,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAmB;AAVxD,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;AAEpC,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAU,KAAK,CAAC,CAAC;AAEtC,QAAA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AA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;gHAAhB,gBAAgB,EAAA,YAAA,EAAA,CAXZ,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAE9B,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,eAAe;YACf,cAAc;AACd,YAAA,aAAa,aAEL,iBAAiB,CAAA,EAAA,CAAA,CAAA,EAAA;AAEhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YATzB,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,eAAe;YACf,cAAc;YACd,aAAa,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAIJ,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAZ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,eAAe;wBACf,cAAc;wBACd,aAAa;AACd,qBAAA;oBACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC7B,iBAAA,CAAA;;;ACnBD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,17 +1,17 @@
1
- import { ChangeDetectorRef, EventEmitter, OnInit } from '@angular/core';
1
+ import { ChangeDetectorRef, OnInit } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class QtyInputComponent implements OnInit {
4
4
  private changeDetectorRef;
5
- qtyModel: number;
6
- allowNegative: boolean;
7
- disabled: boolean;
8
- showError: boolean;
9
- newValueEmitter: EventEmitter<number>;
5
+ qtyModel: import("@angular/core").ModelSignal<number>;
6
+ allowNegative: import("@angular/core").InputSignal<boolean>;
7
+ disabled: import("@angular/core").InputSignal<boolean>;
8
+ showError: import("@angular/core").InputSignal<boolean>;
9
+ newValueEmitter: import("@angular/core").OutputEmitterRef<number>;
10
10
  constructor(changeDetectorRef: ChangeDetectorRef);
11
11
  ngOnInit(): void;
12
12
  removeClicked(event: MouseEvent): void;
13
13
  addClicked(event: MouseEvent): void;
14
14
  qtyModelChanged(): void;
15
15
  static ɵfac: i0.ɵɵFactoryDeclaration<QtyInputComponent, never>;
16
- static ɵcmp: i0.ɵɵComponentDeclaration<QtyInputComponent, "ngx-st-qty-input", never, { "qtyModel": { "alias": "qtyModel"; "required": false; }; "allowNegative": { "alias": "allowNegative"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "showError": { "alias": "showError"; "required": false; }; }, { "newValueEmitter": "newValueEmitter"; }, never, never, false, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<QtyInputComponent, "ngx-st-qty-input", never, { "qtyModel": { "alias": "qtyModel"; "required": true; "isSignal": true; }; "allowNegative": { "alias": "allowNegative"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "showError": { "alias": "showError"; "required": false; "isSignal": true; }; }, { "qtyModel": "qtyModelChange"; "newValueEmitter": "newValueEmitter"; }, never, never, false, never>;
17
17
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "ngx-st-qty-input",
3
- "version": "17.0.2",
3
+ "version": "18.0.0",
4
4
  "peerDependencies": {
5
- "@angular/common": "^17.3.12",
6
- "@angular/core": "^17.3.12",
7
- "@angular/material": "^17.3.10"
5
+ "@angular/common": "^18.0.0",
6
+ "@angular/core": "^18.0.0",
7
+ "@angular/material": "^18.0.0"
8
8
  },
9
9
  "dependencies": {
10
10
  "tslib": "^2.3.0"