@ng-modular-forms/material 0.7.8 → 0.8.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,23 +1,27 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, Directive, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { FormControlBase, CurrencyBehavior, formatNumber, parseNumber, TextBehavior } from '@ng-modular-forms/core';
2
+ import { input, Directive, computed, ChangeDetectionStrategy, Component, effect } from '@angular/core';
4
3
  import * as i3 from '@angular/forms';
5
- import { ReactiveFormsModule } from '@angular/forms';
4
+ import { FormControl, ReactiveFormsModule } from '@angular/forms';
5
+ import { FormControlBase, CurrencyBehavior, formatNumber, parseNumber, TextBehavior, LookupBehavior } from '@ng-modular-forms/core';
6
6
  import * as i1 from '@angular/common';
7
- import { CommonModule } from '@angular/common';
7
+ import { CommonModule, AsyncPipe } from '@angular/common';
8
8
  import { MatFormFieldModule } from '@angular/material/form-field';
9
9
  import * as i4 from '@angular/material/progress-spinner';
10
10
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
11
11
  import * as i2 from '@angular/material/input';
12
12
  import { MatInputModule } from '@angular/material/input';
13
+ import { toSignal } from '@angular/core/rxjs-interop';
13
14
  import { MatNativeDateModule } from '@angular/material/core';
14
15
  import * as i4$1 from '@angular/material/datepicker';
15
16
  import { MatDatepickerModule } from '@angular/material/datepicker';
16
17
  import * as i4$2 from '@angular/material/icon';
17
18
  import { MatIconModule } from '@angular/material/icon';
18
- import * as i6 from '@angular/material/button';
19
+ import * as i5 from '@angular/material/button';
19
20
  import { MatButtonModule } from '@angular/material/button';
20
- import * as i5 from '@angular/material/select';
21
+ import * as i3$1 from '@angular/material/autocomplete';
22
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
23
+ import { startWith } from 'rxjs';
24
+ import * as i5$1 from '@angular/material/select';
21
25
  import { MatSelectModule } from '@angular/material/select';
22
26
  import * as i4$3 from '@angular/material/timepicker';
23
27
  import { MatTimepickerModule } from '@angular/material/timepicker';
@@ -28,19 +32,55 @@ class MatFormControlBase extends FormControlBase {
28
32
  shouldLabelFloat = input('auto');
29
33
  hint = input();
30
34
  hintClassList = input('');
31
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatFormControlBase, deps: null, target: i0.ɵɵFactoryTarget.Directive });
32
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.21", type: MatFormControlBase, isStandalone: true, inputs: { detachLabel: { classPropertyName: "detachLabel", publicName: "detachLabel", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, shouldLabelFloat: { classPropertyName: "shouldLabelFloat", publicName: "shouldLabelFloat", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, hintClassList: { classPropertyName: "hintClassList", publicName: "hintClassList", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
35
+ // Purely a state carrier for mat-form-field, never drives value or internal state
36
+ displayControl = new FormControl({
37
+ value: null,
38
+ disabled: false,
39
+ });
40
+ writeValue(value) {
41
+ super.writeValue(value);
42
+ this.displayControl.setValue(value, {
43
+ emitEvent: false,
44
+ });
45
+ }
46
+ setDisabledState(isDisabled) {
47
+ super.setDisabledState(isDisabled);
48
+ if (isDisabled) {
49
+ this.displayControl.disable({ emitEvent: false });
50
+ }
51
+ else {
52
+ this.displayControl.enable({ emitEvent: false });
53
+ }
54
+ }
55
+ onControlStateChange() {
56
+ super.onControlStateChange();
57
+ const control = this.control;
58
+ if (!control) {
59
+ return;
60
+ }
61
+ if (control.touched) {
62
+ this.displayControl.markAsTouched();
63
+ }
64
+ if (control.dirty) {
65
+ this.displayControl.markAsDirty();
66
+ }
67
+ this.displayControl.setErrors(control.errors);
68
+ }
69
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatFormControlBase, deps: null, target: i0.ɵɵFactoryTarget.Directive });
70
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.25", type: MatFormControlBase, isStandalone: true, inputs: { detachLabel: { classPropertyName: "detachLabel", publicName: "detachLabel", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, shouldLabelFloat: { classPropertyName: "shouldLabelFloat", publicName: "shouldLabelFloat", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, hintClassList: { classPropertyName: "hintClassList", publicName: "hintClassList", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
33
71
  }
34
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatFormControlBase, decorators: [{
72
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatFormControlBase, decorators: [{
35
73
  type: Directive
36
74
  }] });
37
75
 
38
76
  class MatInputCurrencyComponent extends MatFormControlBase {
39
77
  behavior = new CurrencyBehavior();
40
- displayValue = signal(null);
78
+ displayValue = toSignal(this.displayControl.valueChanges, {
79
+ initialValue: this.displayControl.value,
80
+ });
41
81
  writeValue(value) {
42
82
  super.writeValue(value);
43
- this.displayValue.set(value != null ? formatNumber(value) : null);
83
+ this.displayControl.setValue(value != null ? formatNumber(value) : null);
44
84
  }
45
85
  handleKeyDown(event) {
46
86
  this.behavior.blockNonDigitKey(event);
@@ -48,7 +88,7 @@ class MatInputCurrencyComponent extends MatFormControlBase {
48
88
  onInput(event) {
49
89
  const rawValue = event.target.value;
50
90
  const value = parseNumber(rawValue);
51
- this.displayValue.set(value != null ? formatNumber(value) : null);
91
+ this.displayControl.setValue(value != null ? formatNumber(value) : null);
52
92
  this.onChange(value);
53
93
  }
54
94
  textColor = computed(() => {
@@ -60,8 +100,8 @@ class MatInputCurrencyComponent extends MatFormControlBase {
60
100
  const valid = parsedValue != null && parsedValue >= 0;
61
101
  return valid ? '' : 'red';
62
102
  });
63
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputCurrencyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
64
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: MatInputCurrencyComponent, isStandalone: true, selector: "nmf-mat-currency", usesInheritance: true, ngImport: i0, template: `
103
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputCurrencyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
104
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: MatInputCurrencyComponent, isStandalone: true, selector: "nmf-mat-currency", usesInheritance: true, ngImport: i0, template: `
65
105
  @if (label() && detachLabel()) {
66
106
  <label class="font-medium text-base">{{ label() }}</label>
67
107
  }
@@ -75,7 +115,7 @@ class MatInputCurrencyComponent extends MatFormControlBase {
75
115
  <mat-label>{{ label() }}</mat-label>
76
116
  }
77
117
 
78
- @if (displayValue()) {
118
+ @if (displayControl.value) {
79
119
  <span
80
120
  matTextPrefix
81
121
  [class.nmf-disabled]="disabled()"
@@ -86,16 +126,18 @@ class MatInputCurrencyComponent extends MatFormControlBase {
86
126
  }
87
127
 
88
128
  <input
129
+ #focusable
89
130
  matInput
90
131
  type="text"
91
132
  [ngClass]="classList()"
92
133
  [style.color]="textColor()"
93
134
  [style.opacity]="disabled() ? 0.6 : 1"
135
+ [id]="id()"
94
136
  [name]="name()"
95
- [value]="displayValue()"
96
137
  [required]="isRequired()"
97
138
  [placeholder]="placeholder()"
98
- [formControl]="formControl"
139
+ [autocomplete]="autocompleteAttr()"
140
+ [formControl]="displayControl"
99
141
  (blur)="onTouched()"
100
142
  (input)="onInput($event)"
101
143
  (keydown)="handleKeyDown($event)"
@@ -124,7 +166,7 @@ class MatInputCurrencyComponent extends MatFormControlBase {
124
166
  </mat-form-field>
125
167
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
126
168
  }
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputCurrencyComponent, decorators: [{
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputCurrencyComponent, decorators: [{
128
170
  type: Component,
129
171
  args: [{
130
172
  selector: 'nmf-mat-currency',
@@ -150,7 +192,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
150
192
  <mat-label>{{ label() }}</mat-label>
151
193
  }
152
194
 
153
- @if (displayValue()) {
195
+ @if (displayControl.value) {
154
196
  <span
155
197
  matTextPrefix
156
198
  [class.nmf-disabled]="disabled()"
@@ -161,16 +203,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
161
203
  }
162
204
 
163
205
  <input
206
+ #focusable
164
207
  matInput
165
208
  type="text"
166
209
  [ngClass]="classList()"
167
210
  [style.color]="textColor()"
168
211
  [style.opacity]="disabled() ? 0.6 : 1"
212
+ [id]="id()"
169
213
  [name]="name()"
170
- [value]="displayValue()"
171
214
  [required]="isRequired()"
172
215
  [placeholder]="placeholder()"
173
- [formControl]="formControl"
216
+ [autocomplete]="autocompleteAttr()"
217
+ [formControl]="displayControl"
174
218
  (blur)="onTouched()"
175
219
  (input)="onInput($event)"
176
220
  (keydown)="handleKeyDown($event)"
@@ -211,8 +255,13 @@ class MatInputDatepickerComponent extends MatFormControlBase {
211
255
  panelClass = input('');
212
256
  touchUi = input(false);
213
257
  placeholder = input('Select a date');
214
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputDatepickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
215
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: MatInputDatepickerComponent, isStandalone: true, selector: "nmf-mat-datepicker", inputs: { minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, dateClass: { classPropertyName: "dateClass", publicName: "dateClass", isSignal: true, isRequired: false, transformFunction: null }, dateFilter: { classPropertyName: "dateFilter", publicName: "dateFilter", isSignal: true, isRequired: false, transformFunction: null }, startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, startView: { classPropertyName: "startView", publicName: "startView", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, touchUi: { classPropertyName: "touchUi", publicName: "touchUi", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
258
+ onInput(event) {
259
+ const rawValue = event.targetElement.value;
260
+ const value = rawValue ? new Date(rawValue) : null;
261
+ this.onChange(value);
262
+ }
263
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputDatepickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
264
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: MatInputDatepickerComponent, isStandalone: true, selector: "nmf-mat-datepicker", inputs: { minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, dateClass: { classPropertyName: "dateClass", publicName: "dateClass", isSignal: true, isRequired: false, transformFunction: null }, dateFilter: { classPropertyName: "dateFilter", publicName: "dateFilter", isSignal: true, isRequired: false, transformFunction: null }, startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, startView: { classPropertyName: "startView", publicName: "startView", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, touchUi: { classPropertyName: "touchUi", publicName: "touchUi", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
216
265
  @if (label() && detachLabel()) {
217
266
  <label class="font-medium text-base">{{ label() }}</label>
218
267
  }
@@ -227,8 +276,9 @@ class MatInputDatepickerComponent extends MatFormControlBase {
227
276
  }
228
277
 
229
278
  <input
279
+ #focusable
230
280
  matInput
231
- autocomplete="off"
281
+ [id]="id()"
232
282
  [name]="name()"
233
283
  [min]="minDate()"
234
284
  [max]="maxDate()"
@@ -236,8 +286,11 @@ class MatInputDatepickerComponent extends MatFormControlBase {
236
286
  [matDatepickerFilter]="dateFilter()"
237
287
  [required]="isRequired()"
238
288
  [placeholder]="placeholder()"
239
- [formControl]="formControl"
289
+ [autocomplete]="autocompleteAttr()"
290
+ [formControl]="displayControl"
240
291
  (blur)="onTouched()"
292
+ (dateInput)="onInput($event)"
293
+ (dateChange)="onInput($event)"
241
294
  />
242
295
 
243
296
  <mat-datepicker-toggle
@@ -274,7 +327,7 @@ class MatInputDatepickerComponent extends MatFormControlBase {
274
327
  </mat-form-field>
275
328
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i4$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
276
329
  }
277
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputDatepickerComponent, decorators: [{
330
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputDatepickerComponent, decorators: [{
278
331
  type: Component,
279
332
  args: [{
280
333
  selector: 'nmf-mat-datepicker',
@@ -303,8 +356,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
303
356
  }
304
357
 
305
358
  <input
359
+ #focusable
306
360
  matInput
307
- autocomplete="off"
361
+ [id]="id()"
308
362
  [name]="name()"
309
363
  [min]="minDate()"
310
364
  [max]="maxDate()"
@@ -312,8 +366,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
312
366
  [matDatepickerFilter]="dateFilter()"
313
367
  [required]="isRequired()"
314
368
  [placeholder]="placeholder()"
315
- [formControl]="formControl"
369
+ [autocomplete]="autocompleteAttr()"
370
+ [formControl]="displayControl"
316
371
  (blur)="onTouched()"
372
+ (dateInput)="onInput($event)"
373
+ (dateChange)="onInput($event)"
317
374
  />
318
375
 
319
376
  <mat-datepicker-toggle
@@ -354,7 +411,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
354
411
 
355
412
  class MatInputNumberComponent extends MatFormControlBase {
356
413
  formatValue = input(false);
357
- displayValue = signal('');
358
414
  behavior = new TextBehavior();
359
415
  currencyBehavior = new CurrencyBehavior();
360
416
  writeValue(value) {
@@ -371,15 +427,18 @@ class MatInputNumberComponent extends MatFormControlBase {
371
427
  this.onChange(parsed);
372
428
  }
373
429
  updateDisplayValue(value) {
374
- if (this.formatValue() && value != null) {
375
- this.displayValue.set(formatNumber(value) ?? '');
376
- }
377
- else {
378
- this.displayValue.set(value != null ? String(value) : '');
379
- }
430
+ const shouldFormat = this.formatValue() && value != null;
431
+ const displayValue = shouldFormat
432
+ ? (formatNumber(value) ?? '')
433
+ : value != null
434
+ ? String(value)
435
+ : '';
436
+ this.displayControl.setValue(displayValue, {
437
+ emitEvent: false,
438
+ });
380
439
  }
381
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputNumberComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
382
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: MatInputNumberComponent, isStandalone: true, selector: "nmf-mat-number", inputs: { formatValue: { classPropertyName: "formatValue", publicName: "formatValue", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
440
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputNumberComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
441
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: MatInputNumberComponent, isStandalone: true, selector: "nmf-mat-number", inputs: { formatValue: { classPropertyName: "formatValue", publicName: "formatValue", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
383
442
  @if (label() && detachLabel()) {
384
443
  <label class="font-medium text-base">{{ label() }}</label>
385
444
  }
@@ -394,14 +453,16 @@ class MatInputNumberComponent extends MatFormControlBase {
394
453
  }
395
454
 
396
455
  <input
456
+ #focusable
397
457
  matInput
398
458
  [ngClass]="classList"
459
+ [id]="id()"
399
460
  [name]="name()"
400
461
  [type]="formatValue() ? 'text' : 'number'"
401
- [value]="displayValue()"
402
462
  [required]="isRequired()"
403
463
  [placeholder]="placeholder()"
404
- [formControl]="formControl"
464
+ [autocomplete]="autocompleteAttr()"
465
+ [formControl]="displayControl"
405
466
  (blur)="onTouched()"
406
467
  (input)="onInput($event)"
407
468
  (keydown)="handleKeyDown($event)"
@@ -426,7 +487,7 @@ class MatInputNumberComponent extends MatFormControlBase {
426
487
  </mat-form-field>
427
488
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatButtonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
428
489
  }
429
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputNumberComponent, decorators: [{
490
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputNumberComponent, decorators: [{
430
491
  type: Component,
431
492
  args: [{
432
493
  selector: 'nmf-mat-number',
@@ -455,14 +516,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
455
516
  }
456
517
 
457
518
  <input
519
+ #focusable
458
520
  matInput
459
521
  [ngClass]="classList"
522
+ [id]="id()"
460
523
  [name]="name()"
461
524
  [type]="formatValue() ? 'text' : 'number'"
462
- [value]="displayValue()"
463
525
  [required]="isRequired()"
464
526
  [placeholder]="placeholder()"
465
- [formControl]="formControl"
527
+ [autocomplete]="autocompleteAttr()"
528
+ [formControl]="displayControl"
466
529
  (blur)="onTouched()"
467
530
  (input)="onInput($event)"
468
531
  (keydown)="handleKeyDown($event)"
@@ -489,13 +552,268 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
489
552
  }]
490
553
  }] });
491
554
 
555
+ class MatInputLookupComponent extends MatFormControlBase {
556
+ autocompleteAttr = input('off');
557
+ /*
558
+ * Static options to display in the dropdown. This is for synchronous sources.
559
+ */
560
+ optionsSource = input([]);
561
+ /*
562
+ * Must return a cancellable observable. This is for asynchronous sources (API calls, etc).
563
+ */
564
+ optionsProvider = input();
565
+ /*
566
+ * When using a synchronous options source, or an asynchronous provider that returns an object where the shape is known,
567
+ * this function is used to determine the display value.
568
+ */
569
+ displayWith = input();
570
+ /*
571
+ * Used to determine the display value asynchronously when using primitive types for form values
572
+ * eg: countryCode instead of Country itself.
573
+ *
574
+ * If not provided, the raw value will be used. Only needed for patching/hydrating the form.
575
+ */
576
+ displayProvider = input();
577
+ /*
578
+ * Used to compare options during selection if object equality is not sufficient.
579
+ */
580
+ compareWith = input();
581
+ emptyOptionsLabel = input('No results found');
582
+ /*
583
+ * Search will be debounced by this many milliseconds.
584
+ */
585
+ debounceTime = input(500);
586
+ /*
587
+ * Search will not be triggered until the user has typed at least this many characters.
588
+ */
589
+ searchThreshold = input(2);
590
+ searchQuery = toSignal(this.displayControl.valueChanges.pipe(startWith(this.displayControl.value)));
591
+ behavior;
592
+ constructor() {
593
+ super();
594
+ this.behavior = new LookupBehavior({
595
+ destroyRef: this.destroyRef,
596
+ resolvers: {
597
+ compare: this.compareWith,
598
+ label: this.displayWith,
599
+ labelAsync: this.displayProvider,
600
+ search: this.optionsProvider,
601
+ },
602
+ });
603
+ effect(() => {
604
+ const currentOptions = this.optionsSource() ?? [];
605
+ this.behavior.updateOptions(currentOptions);
606
+ });
607
+ effect(() => {
608
+ const selectedOption = this.behavior.selectedOption();
609
+ this.onChange(selectedOption?.value ?? null);
610
+ });
611
+ }
612
+ ngOnInit() {
613
+ super.ngOnInit();
614
+ this.behavior.setupFilteredOptions(this.displayControl.valueChanges, this.searchQuery);
615
+ this.behavior.setupOptionsProvider(this.displayControl.valueChanges, 500, 2);
616
+ }
617
+ writeValue(value) {
618
+ super.writeValue(value);
619
+ this.behavior.selectedMatchedOption(value);
620
+ }
621
+ selectOption(result) {
622
+ const lookupOption = {
623
+ value: result.option.value,
624
+ label: result.option.viewValue,
625
+ };
626
+ this.behavior.selectOption(undefined, lookupOption);
627
+ }
628
+ clearSelectedOption() {
629
+ this.displayControl.setValue(null);
630
+ this.behavior.clearSelectedOption();
631
+ }
632
+ ngOnDestroy() {
633
+ this.behavior.optionsUpdated$.complete();
634
+ }
635
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputLookupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
636
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: MatInputLookupComponent, isStandalone: true, selector: "nmf-mat-lookup", inputs: { autocompleteAttr: { classPropertyName: "autocompleteAttr", publicName: "autocompleteAttr", isSignal: true, isRequired: false, transformFunction: null }, optionsSource: { classPropertyName: "optionsSource", publicName: "optionsSource", isSignal: true, isRequired: false, transformFunction: null }, optionsProvider: { classPropertyName: "optionsProvider", publicName: "optionsProvider", isSignal: true, isRequired: false, transformFunction: null }, displayWith: { classPropertyName: "displayWith", publicName: "displayWith", isSignal: true, isRequired: false, transformFunction: null }, displayProvider: { classPropertyName: "displayProvider", publicName: "displayProvider", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, emptyOptionsLabel: { classPropertyName: "emptyOptionsLabel", publicName: "emptyOptionsLabel", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null }, searchThreshold: { classPropertyName: "searchThreshold", publicName: "searchThreshold", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["nmfMatLookup"], usesInheritance: true, ngImport: i0, template: `
637
+ @if (label() && detachLabel()) {
638
+ <label class="font-medium text-base">{{ label() }}</label>
639
+ }
640
+
641
+ <div class="relative">
642
+ <mat-form-field
643
+ class="w-full"
644
+ [appearance]="appearance()"
645
+ [floatLabel]="shouldLabelFloat()"
646
+ >
647
+ @if (label() && !detachLabel()) {
648
+ <mat-label>{{ label() }}</mat-label>
649
+ }
650
+
651
+ <input
652
+ #focusable
653
+ matInput
654
+ type="text"
655
+ [class.cursor-not-allowed]="behavior.selectedOption() != null"
656
+ [attr.aria-label]="detachLabel() ? label() : null"
657
+ [ngClass]="classList"
658
+ [id]="id()"
659
+ [name]="name()"
660
+ [required]="isRequired()"
661
+ [readonly]="behavior.selectedOption() != null"
662
+ [placeholder]="placeholder()"
663
+ [formControl]="displayControl"
664
+ [matAutocomplete]="auto"
665
+ (blur)="onTouched()"
666
+ />
667
+
668
+ <mat-autocomplete
669
+ #auto="matAutocomplete"
670
+ [displayWith]="displayWith() ?? null"
671
+ (optionSelected)="selectOption($event)"
672
+ >
673
+ @for (option of behavior.filteredOptions | async; track option) {
674
+ <mat-option [value]="option.value">{{ option.label }}</mat-option>
675
+ }
676
+ </mat-autocomplete>
677
+
678
+ @if (behavior.status() === 'empty') {
679
+ <mat-hint>{{ emptyOptionsLabel() }}</mat-hint>
680
+ } @else if (hint()) {
681
+ <mat-hint [ngClass]="hintClassList()">{{ hint() }}</mat-hint>
682
+ }
683
+
684
+ <mat-error>{{ errorMessage() }}</mat-error>
685
+
686
+ <!-- Loading status is for lookups and async options, and loading() is for the form control itself -->
687
+ @if (behavior.status() === 'loading' || loading()) {
688
+ <mat-spinner
689
+ matSuffix
690
+ class="nmf-mat-loader"
691
+ diameter="24"
692
+ strokeWidth="3"
693
+ />
694
+ }
695
+
696
+ @if (behavior.selectedOption()) {
697
+ <button
698
+ matSuffix
699
+ mat-icon-button
700
+ aria-label="Clear selection"
701
+ (click)="clearSelectedOption()"
702
+ >
703
+ <mat-icon>close</mat-icon>
704
+ </button>
705
+ }
706
+ </mat-form-field>
707
+ </div>
708
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i3$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i3$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
709
+ }
710
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputLookupComponent, decorators: [{
711
+ type: Component,
712
+ args: [{
713
+ selector: 'nmf-mat-lookup',
714
+ exportAs: 'nmfMatLookup',
715
+ imports: [
716
+ CommonModule,
717
+ MatInputModule,
718
+ MatAutocompleteModule,
719
+ MatIconModule,
720
+ MatButtonModule,
721
+ MatFormFieldModule,
722
+ ReactiveFormsModule,
723
+ MatProgressSpinnerModule,
724
+ AsyncPipe,
725
+ ],
726
+ changeDetection: ChangeDetectionStrategy.OnPush,
727
+ template: `
728
+ @if (label() && detachLabel()) {
729
+ <label class="font-medium text-base">{{ label() }}</label>
730
+ }
731
+
732
+ <div class="relative">
733
+ <mat-form-field
734
+ class="w-full"
735
+ [appearance]="appearance()"
736
+ [floatLabel]="shouldLabelFloat()"
737
+ >
738
+ @if (label() && !detachLabel()) {
739
+ <mat-label>{{ label() }}</mat-label>
740
+ }
741
+
742
+ <input
743
+ #focusable
744
+ matInput
745
+ type="text"
746
+ [class.cursor-not-allowed]="behavior.selectedOption() != null"
747
+ [attr.aria-label]="detachLabel() ? label() : null"
748
+ [ngClass]="classList"
749
+ [id]="id()"
750
+ [name]="name()"
751
+ [required]="isRequired()"
752
+ [readonly]="behavior.selectedOption() != null"
753
+ [placeholder]="placeholder()"
754
+ [formControl]="displayControl"
755
+ [matAutocomplete]="auto"
756
+ (blur)="onTouched()"
757
+ />
758
+
759
+ <mat-autocomplete
760
+ #auto="matAutocomplete"
761
+ [displayWith]="displayWith() ?? null"
762
+ (optionSelected)="selectOption($event)"
763
+ >
764
+ @for (option of behavior.filteredOptions | async; track option) {
765
+ <mat-option [value]="option.value">{{ option.label }}</mat-option>
766
+ }
767
+ </mat-autocomplete>
768
+
769
+ @if (behavior.status() === 'empty') {
770
+ <mat-hint>{{ emptyOptionsLabel() }}</mat-hint>
771
+ } @else if (hint()) {
772
+ <mat-hint [ngClass]="hintClassList()">{{ hint() }}</mat-hint>
773
+ }
774
+
775
+ <mat-error>{{ errorMessage() }}</mat-error>
776
+
777
+ <!-- Loading status is for lookups and async options, and loading() is for the form control itself -->
778
+ @if (behavior.status() === 'loading' || loading()) {
779
+ <mat-spinner
780
+ matSuffix
781
+ class="nmf-mat-loader"
782
+ diameter="24"
783
+ strokeWidth="3"
784
+ />
785
+ }
786
+
787
+ @if (behavior.selectedOption()) {
788
+ <button
789
+ matSuffix
790
+ mat-icon-button
791
+ aria-label="Clear selection"
792
+ (click)="clearSelectedOption()"
793
+ >
794
+ <mat-icon>close</mat-icon>
795
+ </button>
796
+ }
797
+ </mat-form-field>
798
+ </div>
799
+ `,
800
+ }]
801
+ }], ctorParameters: () => [] });
802
+
492
803
  class MatInputSelectComponent extends MatFormControlBase {
493
804
  options = input([]);
494
805
  emptyOptionLabel = input('Select an option');
495
- clearOptionLabel = input('Clear selection');
806
+ allowEmptyOptionSelection = input(false);
496
807
  panelWidth = input('auto');
497
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
498
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: MatInputSelectComponent, isStandalone: true, selector: "nmf-mat-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, emptyOptionLabel: { classPropertyName: "emptyOptionLabel", publicName: "emptyOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, clearOptionLabel: { classPropertyName: "clearOptionLabel", publicName: "clearOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
808
+ onSelectionChange(event) {
809
+ if (this.disabled()) {
810
+ return;
811
+ }
812
+ const value = event.value;
813
+ this.onChange(value);
814
+ }
815
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
816
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: MatInputSelectComponent, isStandalone: true, selector: "nmf-mat-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, emptyOptionLabel: { classPropertyName: "emptyOptionLabel", publicName: "emptyOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, allowEmptyOptionSelection: { classPropertyName: "allowEmptyOptionSelection", publicName: "allowEmptyOptionSelection", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
499
817
  @if (label() && detachLabel()) {
500
818
  <label class="font-medium text-base">{{ label() }}</label>
501
819
  }
@@ -510,28 +828,26 @@ class MatInputSelectComponent extends MatFormControlBase {
510
828
  }
511
829
 
512
830
  <mat-select
831
+ #focusable
513
832
  [class.hide-select-arrow]="loading()"
833
+ [id]="id()"
514
834
  [panelWidth]="panelWidth()"
515
835
  [required]="isRequired()"
516
836
  [placeholder]="emptyOptionLabel()"
517
- [formControl]="formControl"
837
+ [formControl]="displayControl"
518
838
  (blur)="onTouched()"
839
+ (selectionChange)="onSelectionChange($event)"
519
840
  >
520
- <mat-option [value]="null" disabled>
841
+ <mat-option [value]="''" [disabled]="!allowEmptyOptionSelection()">
521
842
  {{ emptyOptionLabel() }}
522
843
  </mat-option>
523
844
 
524
845
  <!-- All Options -->
525
- @for (option of options(); track option.label) {
526
- <mat-option [value]="option.key" [disabled]="option.disabled">
846
+ @for (option of options(); track option.value) {
847
+ <mat-option [value]="option.value" [disabled]="option.disabled">
527
848
  {{ option.label }}
528
849
  </mat-option>
529
850
  }
530
-
531
- <!-- Clear Selection Option -->
532
- @if (clearOptionLabel()) {
533
- <mat-option [value]="null">{{ clearOptionLabel() }}</mat-option>
534
- }
535
851
  </mat-select>
536
852
 
537
853
  @if (loading()) {
@@ -549,9 +865,9 @@ class MatInputSelectComponent extends MatFormControlBase {
549
865
 
550
866
  <mat-error>{{ errorMessage() }}</mat-error>
551
867
  </mat-form-field>
552
- `, isInline: true, styles: [".mat-mdc-select-placeholder{transition:none!important}.hide-select-arrow .mat-mdc-select-arrow-wrapper{display:none!important}.nmf-mat-loader{margin-right:.7rem!important}.nmf-disabled{color:color-mix(in srgb,var(--mat-sys-on-surface) 38%,transparent)}.nmf-password-toggle{color:var(--mat-sys-on-surface-variant);padding-right:.5rem;background-color:transparent;border:none;cursor:pointer;&:disabled{color:color-mix(in srgb,var(--mat-sys-on-surface) 38%,transparent);cursor:default}}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{appearance:textfield;-moz-appearance:textfield}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
868
+ `, isInline: true, styles: [".mat-mdc-select-placeholder{transition:none!important}.hide-select-arrow .mat-mdc-select-arrow-wrapper{display:none!important}.nmf-mat-loader{margin-right:.5rem!important}.nmf-disabled{color:color-mix(in srgb,var(--mat-sys-on-surface) 38%,transparent)}.nmf-password-toggle{color:var(--mat-sys-on-surface-variant);padding-right:.5rem;background-color:transparent;border:none;cursor:pointer;&:disabled{color:color-mix(in srgb,var(--mat-sys-on-surface) 38%,transparent);cursor:default}}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{appearance:textfield;-moz-appearance:textfield}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
553
869
  }
554
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputSelectComponent, decorators: [{
870
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputSelectComponent, decorators: [{
555
871
  type: Component,
556
872
  args: [{ selector: 'nmf-mat-select', imports: [
557
873
  CommonModule,
@@ -574,28 +890,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
574
890
  }
575
891
 
576
892
  <mat-select
893
+ #focusable
577
894
  [class.hide-select-arrow]="loading()"
895
+ [id]="id()"
578
896
  [panelWidth]="panelWidth()"
579
897
  [required]="isRequired()"
580
898
  [placeholder]="emptyOptionLabel()"
581
- [formControl]="formControl"
899
+ [formControl]="displayControl"
582
900
  (blur)="onTouched()"
901
+ (selectionChange)="onSelectionChange($event)"
583
902
  >
584
- <mat-option [value]="null" disabled>
903
+ <mat-option [value]="''" [disabled]="!allowEmptyOptionSelection()">
585
904
  {{ emptyOptionLabel() }}
586
905
  </mat-option>
587
906
 
588
907
  <!-- All Options -->
589
- @for (option of options(); track option.label) {
590
- <mat-option [value]="option.key" [disabled]="option.disabled">
908
+ @for (option of options(); track option.value) {
909
+ <mat-option [value]="option.value" [disabled]="option.disabled">
591
910
  {{ option.label }}
592
911
  </mat-option>
593
912
  }
594
-
595
- <!-- Clear Selection Option -->
596
- @if (clearOptionLabel()) {
597
- <mat-option [value]="null">{{ clearOptionLabel() }}</mat-option>
598
- }
599
913
  </mat-select>
600
914
 
601
915
  @if (loading()) {
@@ -613,7 +927,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
613
927
 
614
928
  <mat-error>{{ errorMessage() }}</mat-error>
615
929
  </mat-form-field>
616
- `, styles: [".mat-mdc-select-placeholder{transition:none!important}.hide-select-arrow .mat-mdc-select-arrow-wrapper{display:none!important}.nmf-mat-loader{margin-right:.7rem!important}.nmf-disabled{color:color-mix(in srgb,var(--mat-sys-on-surface) 38%,transparent)}.nmf-password-toggle{color:var(--mat-sys-on-surface-variant);padding-right:.5rem;background-color:transparent;border:none;cursor:pointer;&:disabled{color:color-mix(in srgb,var(--mat-sys-on-surface) 38%,transparent);cursor:default}}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{appearance:textfield;-moz-appearance:textfield}\n"] }]
930
+ `, styles: [".mat-mdc-select-placeholder{transition:none!important}.hide-select-arrow .mat-mdc-select-arrow-wrapper{display:none!important}.nmf-mat-loader{margin-right:.5rem!important}.nmf-disabled{color:color-mix(in srgb,var(--mat-sys-on-surface) 38%,transparent)}.nmf-password-toggle{color:var(--mat-sys-on-surface-variant);padding-right:.5rem;background-color:transparent;border:none;cursor:pointer;&:disabled{color:color-mix(in srgb,var(--mat-sys-on-surface) 38%,transparent);cursor:default}}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{appearance:textfield;-moz-appearance:textfield}\n"] }]
617
931
  }] });
618
932
 
619
933
  class MatInputTextComponent extends MatFormControlBase {
@@ -622,8 +936,13 @@ class MatInputTextComponent extends MatFormControlBase {
622
936
  computedType = computed(() => this.behavior.showPassword() && this.type() === 'password'
623
937
  ? 'text'
624
938
  : this.type());
625
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
626
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: MatInputTextComponent, isStandalone: true, selector: "nmf-mat-text", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
939
+ onInput(event) {
940
+ const rawValue = event.target.value;
941
+ const value = rawValue ? rawValue : null;
942
+ this.onChange(value);
943
+ }
944
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
945
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: MatInputTextComponent, isStandalone: true, selector: "nmf-mat-text", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
627
946
  @if (label() && detachLabel()) {
628
947
  <label class="font-medium text-base">{{ label() }}</label>
629
948
  }
@@ -638,15 +957,18 @@ class MatInputTextComponent extends MatFormControlBase {
638
957
  }
639
958
 
640
959
  <input
960
+ #focusable
641
961
  matInput
642
- autocomplete="off"
643
962
  [ngClass]="classList"
963
+ [id]="id()"
644
964
  [name]="name()"
645
965
  [type]="computedType()"
646
966
  [required]="isRequired()"
647
967
  [placeholder]="placeholder()"
648
- [formControl]="formControl"
968
+ [autocomplete]="autocompleteAttr()"
969
+ [formControl]="displayControl"
649
970
  (blur)="onTouched()"
971
+ (input)="onInput($event)"
650
972
  />
651
973
 
652
974
  @if (loading()) {
@@ -681,9 +1003,9 @@ class MatInputTextComponent extends MatFormControlBase {
681
1003
 
682
1004
  <mat-error>{{ errorMessage() }}</mat-error>
683
1005
  </mat-form-field>
684
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1006
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
685
1007
  }
686
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputTextComponent, decorators: [{
1008
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputTextComponent, decorators: [{
687
1009
  type: Component,
688
1010
  args: [{
689
1011
  selector: 'nmf-mat-text',
@@ -712,15 +1034,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
712
1034
  }
713
1035
 
714
1036
  <input
1037
+ #focusable
715
1038
  matInput
716
- autocomplete="off"
717
1039
  [ngClass]="classList"
1040
+ [id]="id()"
718
1041
  [name]="name()"
719
1042
  [type]="computedType()"
720
1043
  [required]="isRequired()"
721
1044
  [placeholder]="placeholder()"
722
- [formControl]="formControl"
1045
+ [autocomplete]="autocompleteAttr()"
1046
+ [formControl]="displayControl"
723
1047
  (blur)="onTouched()"
1048
+ (input)="onInput($event)"
724
1049
  />
725
1050
 
726
1051
  @if (loading()) {
@@ -762,8 +1087,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
762
1087
  class MatInputTextareaComponent extends MatFormControlBase {
763
1088
  rows = input(5);
764
1089
  cols = input(5);
765
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputTextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
766
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: MatInputTextareaComponent, isStandalone: true, selector: "nmf-mat-textarea", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, cols: { classPropertyName: "cols", publicName: "cols", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
1090
+ onInput(event) {
1091
+ const rawValue = event.target.value;
1092
+ const value = rawValue ? rawValue : null;
1093
+ this.onChange(value);
1094
+ }
1095
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputTextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1096
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: MatInputTextareaComponent, isStandalone: true, selector: "nmf-mat-textarea", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, cols: { classPropertyName: "cols", publicName: "cols", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
767
1097
  @if (label() && detachLabel()) {
768
1098
  <label class="font-medium text-base">{{ label() }}</label>
769
1099
  }
@@ -778,13 +1108,17 @@ class MatInputTextareaComponent extends MatFormControlBase {
778
1108
  }
779
1109
 
780
1110
  <textarea
1111
+ #focusable
781
1112
  matInput
1113
+ [id]="id()"
782
1114
  [rows]="rows()"
783
1115
  [cols]="cols()"
784
1116
  [required]="isRequired()"
785
1117
  [placeholder]="placeholder()"
786
- [formControl]="formControl"
1118
+ [autocomplete]="autocompleteAttr()"
1119
+ [formControl]="displayControl"
787
1120
  (blur)="onTouched()"
1121
+ (input)="onInput($event)"
788
1122
  ></textarea>
789
1123
 
790
1124
  @if (loading()) {
@@ -806,7 +1140,7 @@ class MatInputTextareaComponent extends MatFormControlBase {
806
1140
  </mat-form-field>
807
1141
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
808
1142
  }
809
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputTextareaComponent, decorators: [{
1143
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputTextareaComponent, decorators: [{
810
1144
  type: Component,
811
1145
  args: [{
812
1146
  selector: 'nmf-mat-textarea',
@@ -833,13 +1167,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
833
1167
  }
834
1168
 
835
1169
  <textarea
1170
+ #focusable
836
1171
  matInput
1172
+ [id]="id()"
837
1173
  [rows]="rows()"
838
1174
  [cols]="cols()"
839
1175
  [required]="isRequired()"
840
1176
  [placeholder]="placeholder()"
841
- [formControl]="formControl"
1177
+ [autocomplete]="autocompleteAttr()"
1178
+ [formControl]="displayControl"
842
1179
  (blur)="onTouched()"
1180
+ (input)="onInput($event)"
843
1181
  ></textarea>
844
1182
 
845
1183
  @if (loading()) {
@@ -869,8 +1207,16 @@ class MatInputTimepickerComponent extends MatFormControlBase {
869
1207
  interval = input(null);
870
1208
  options = input(null);
871
1209
  placeholder = input('Select a time');
872
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputTimepickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
873
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: MatInputTimepickerComponent, isStandalone: true, selector: "nmf-mat-timepicker", inputs: { minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, interval: { classPropertyName: "interval", publicName: "interval", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
1210
+ onInput(event) {
1211
+ const rawValue = event.target.value;
1212
+ const value = rawValue ? new Date(rawValue) : null;
1213
+ this.onChange(value);
1214
+ }
1215
+ onSelected(event) {
1216
+ this.onChange(event.value);
1217
+ }
1218
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputTimepickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1219
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: MatInputTimepickerComponent, isStandalone: true, selector: "nmf-mat-timepicker", inputs: { minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, interval: { classPropertyName: "interval", publicName: "interval", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
874
1220
  @if (label() && detachLabel()) {
875
1221
  <label class="font-medium text-base">{{ label() }}</label>
876
1222
  }
@@ -885,16 +1231,19 @@ class MatInputTimepickerComponent extends MatFormControlBase {
885
1231
  }
886
1232
 
887
1233
  <input
1234
+ #focusable
888
1235
  matInput
889
- autocomplete="off"
1236
+ [id]="id()"
890
1237
  [name]="name()"
891
1238
  [matTimepicker]="picker"
892
1239
  [matTimepickerMin]="minDate()"
893
1240
  [matTimepickerMax]="maxDate()"
894
1241
  [required]="isRequired()"
895
1242
  [placeholder]="placeholder()"
896
- [formControl]="formControl"
1243
+ [autocomplete]="autocompleteAttr()"
1244
+ [formControl]="displayControl"
897
1245
  (blur)="onTouched()"
1246
+ (input)="onInput($event)"
898
1247
  />
899
1248
 
900
1249
  <mat-timepicker-toggle
@@ -908,6 +1257,7 @@ class MatInputTimepickerComponent extends MatFormControlBase {
908
1257
  [hidden]="loading()"
909
1258
  [interval]="interval()"
910
1259
  [options]="options()"
1260
+ (selected)="onSelected($event)"
911
1261
  #picker
912
1262
  />
913
1263
 
@@ -926,9 +1276,9 @@ class MatInputTimepickerComponent extends MatFormControlBase {
926
1276
 
927
1277
  <mat-error>{{ errorMessage() }}</mat-error>
928
1278
  </mat-form-field>
929
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatTimepickerModule }, { kind: "component", type: i4$3.MatTimepicker, selector: "mat-timepicker", inputs: ["interval", "options", "disableRipple", "aria-label", "aria-labelledby"], outputs: ["selected", "opened", "closed"], exportAs: ["matTimepicker"] }, { kind: "directive", type: i4$3.MatTimepickerInput, selector: "input[matTimepicker]", inputs: ["value", "matTimepicker", "matTimepickerMin", "matTimepickerMax", "disabled"], outputs: ["valueChange"], exportAs: ["matTimepickerInput"] }, { kind: "component", type: i4$3.MatTimepickerToggle, selector: "mat-timepicker-toggle", inputs: ["for", "aria-label", "aria-labelledby", "disabled", "tabIndex", "disableRipple"], exportAs: ["matTimepickerToggle"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1279
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatTimepickerModule }, { kind: "component", type: i4$3.MatTimepicker, selector: "mat-timepicker", inputs: ["interval", "options", "disableRipple", "aria-label", "aria-labelledby"], outputs: ["selected", "opened", "closed"], exportAs: ["matTimepicker"] }, { kind: "directive", type: i4$3.MatTimepickerInput, selector: "input[matTimepicker]", inputs: ["value", "matTimepicker", "matTimepickerMin", "matTimepickerMax", "disabled"], outputs: ["valueChange"], exportAs: ["matTimepickerInput"] }, { kind: "component", type: i4$3.MatTimepickerToggle, selector: "mat-timepicker-toggle", inputs: ["for", "aria-label", "aria-labelledby", "disabled", "tabIndex", "disableRipple"], exportAs: ["matTimepickerToggle"] }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
930
1280
  }
931
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: MatInputTimepickerComponent, decorators: [{
1281
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MatInputTimepickerComponent, decorators: [{
932
1282
  type: Component,
933
1283
  args: [{
934
1284
  selector: 'nmf-mat-timepicker',
@@ -938,6 +1288,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
938
1288
  MatFormFieldModule,
939
1289
  ReactiveFormsModule,
940
1290
  MatTimepickerModule,
1291
+ MatNativeDateModule,
941
1292
  MatProgressSpinnerModule,
942
1293
  ],
943
1294
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -956,16 +1307,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
956
1307
  }
957
1308
 
958
1309
  <input
1310
+ #focusable
959
1311
  matInput
960
- autocomplete="off"
1312
+ [id]="id()"
961
1313
  [name]="name()"
962
1314
  [matTimepicker]="picker"
963
1315
  [matTimepickerMin]="minDate()"
964
1316
  [matTimepickerMax]="maxDate()"
965
1317
  [required]="isRequired()"
966
1318
  [placeholder]="placeholder()"
967
- [formControl]="formControl"
1319
+ [autocomplete]="autocompleteAttr()"
1320
+ [formControl]="displayControl"
968
1321
  (blur)="onTouched()"
1322
+ (input)="onInput($event)"
969
1323
  />
970
1324
 
971
1325
  <mat-timepicker-toggle
@@ -979,6 +1333,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
979
1333
  [hidden]="loading()"
980
1334
  [interval]="interval()"
981
1335
  [options]="options()"
1336
+ (selected)="onSelected($event)"
982
1337
  #picker
983
1338
  />
984
1339
 
@@ -1009,5 +1364,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
1009
1364
  * Generated bundle index. Do not edit.
1010
1365
  */
1011
1366
 
1012
- export { MatFormControlBase, MatInputCurrencyComponent, MatInputDatepickerComponent, MatInputNumberComponent, MatInputSelectComponent, MatInputTextComponent, MatInputTextareaComponent, MatInputTimepickerComponent };
1367
+ export { MatFormControlBase, MatInputCurrencyComponent, MatInputDatepickerComponent, MatInputLookupComponent, MatInputNumberComponent, MatInputSelectComponent, MatInputTextComponent, MatInputTextareaComponent, MatInputTimepickerComponent };
1013
1368
  //# sourceMappingURL=ng-modular-forms-material.mjs.map