@softpak/components 19.0.0-beta.1 → 19.0.0-beta.11

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.
Files changed (58) hide show
  1. package/fesm2022/softpak-components-spx-alert.mjs +54 -44
  2. package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
  3. package/fesm2022/softpak-components-spx-app-expiry.mjs +58 -41
  4. package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
  5. package/fesm2022/softpak-components-spx-app-update.mjs +73 -68
  6. package/fesm2022/softpak-components-spx-app-update.mjs.map +1 -1
  7. package/fesm2022/softpak-components-spx-button.mjs +3 -3
  8. package/fesm2022/softpak-components-spx-capitalize.mjs +3 -3
  9. package/fesm2022/softpak-components-spx-card.mjs +159 -126
  10. package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
  11. package/fesm2022/softpak-components-spx-change-details.mjs +4 -6
  12. package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
  13. package/fesm2022/softpak-components-spx-channel-selection.mjs +8 -11
  14. package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
  15. package/fesm2022/softpak-components-spx-check-digit.mjs +5 -8
  16. package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
  17. package/fesm2022/softpak-components-spx-form-section.mjs +20 -15
  18. package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
  19. package/fesm2022/softpak-components-spx-form-view.mjs +145 -138
  20. package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
  21. package/fesm2022/softpak-components-spx-helpers.mjs +1 -0
  22. package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
  23. package/fesm2022/softpak-components-spx-inputs.mjs +809 -860
  24. package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
  25. package/fesm2022/softpak-components-spx-navigation.mjs +51 -51
  26. package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
  27. package/fesm2022/softpak-components-spx-number-check.mjs +48 -42
  28. package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
  29. package/fesm2022/softpak-components-spx-pagination.mjs +3 -3
  30. package/fesm2022/softpak-components-spx-patch.mjs +28 -22
  31. package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
  32. package/fesm2022/softpak-components-spx-progress-bar.mjs +3 -3
  33. package/fesm2022/softpak-components-spx-spinner.mjs +144 -143
  34. package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
  35. package/fesm2022/softpak-components-spx-stock-info.mjs +7 -10
  36. package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
  37. package/fesm2022/softpak-components-spx-suggestion.mjs +41 -49
  38. package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
  39. package/fesm2022/softpak-components-spx-toaster.mjs +92 -97
  40. package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
  41. package/fesm2022/softpak-components-spx-update.mjs +8 -10
  42. package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
  43. package/fesm2022/softpak-components-spx-validation.mjs +5 -8
  44. package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
  45. package/package.json +23 -24
  46. package/spx-alert/spx-alert.component.d.ts +4 -4
  47. package/spx-app-update/spx-app-update.component.d.ts +3 -3
  48. package/spx-helpers/spx-severity.enum.d.ts +2 -1
  49. package/spx-inputs/spx-input-box.component.d.ts +4 -4
  50. package/spx-inputs/spx-input-date/spx-input-date.component.d.ts +43 -0
  51. package/spx-inputs/spx-input-float.component.d.ts +5 -4
  52. package/spx-inputs/spx-input-text.component.d.ts +2 -1
  53. package/spx-inputs/spx-input-time-modal.component.d.ts +1 -1
  54. package/spx-inputs/spx-input-time.component.d.ts +1 -1
  55. package/spx-inputs/spx-input.component.d.ts +2 -1
  56. package/spx-suggestion/spx-suggestion.component.d.ts +5 -5
  57. package/tailwind.css +1 -1
  58. package/spx-inputs/spx-input-date.component.d.ts +0 -50
@@ -1,17 +1,18 @@
1
- import { NgIf, NgFor } from '@angular/common';
2
1
  import * as i0 from '@angular/core';
3
- import { EventEmitter, Component, Input, Output, HostListener, ViewChild } from '@angular/core';
2
+ import { EventEmitter, Component, Input, Output, HostListener, ViewChild, input, model, output, signal, viewChild, computed } from '@angular/core';
4
3
  import { SpxButtonComponent } from '@softpak/components/spx-button';
5
4
  import * as i1 from '@fortawesome/angular-fontawesome';
6
5
  import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
7
6
  import { faEdit, faSearch, faQuestion, faTimes, faXmark } from '@fortawesome/free-solid-svg-icons';
8
7
  import { fromEvent } from 'rxjs';
9
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
+ import * as i1$1 from '@angular/forms';
9
+ import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
10
10
  import { SpxSuggestionComponent } from '@softpak/components/spx-suggestion';
11
- import { DateTime } from 'luxon';
12
11
  import { valuePairToValue, SpxSeverityEnum } from '@softpak/components/spx-helpers';
13
- import * as i1$1 from '@ionic/angular/standalone';
14
- import { IonButtons, IonContent, IonHeader, IonTitle, IonToolbar, IonButton } from '@ionic/angular/standalone';
12
+ import { DateTime } from 'luxon';
13
+ import * as i1$2 from '@ionic/angular/standalone';
14
+ import { IonButtons, IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular/standalone';
15
+ import * as i1$3 from '@ionic/angular';
15
16
 
16
17
  class SpxInputBoxComponent {
17
18
  handleFocusIn(ev) {
@@ -71,147 +72,166 @@ class SpxInputBoxComponent {
71
72
  this.spxFocusOut.emit();
72
73
  }
73
74
  }
74
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputBoxComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
75
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: SpxInputBoxComponent, isStandalone: true, selector: "spx-input-box", inputs: { spxCompact: "spxCompact", spxFocused: "spxFocused", spxLabel: "spxLabel", spxReadonly: "spxReadonly", spxRequired: "spxRequired", spxShowClear: "spxShowClear", spxShowEdit: "spxShowEdit", spxShowHelp: "spxShowHelp", spxShowLabel: "spxShowLabel", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxValue: "spxValue" }, outputs: { spxClear: "spxClear", spxSearch: "spxSearch", spxFocus: "spxFocus", spxFocusOut: "spxFocusOut", spxEdit: "spxEdit", spxHelp: "spxHelp" }, host: { listeners: { "focusin": "handleFocusIn($event)", "focusout": "handleFocusOut($event)", "document:click": "handleWindowClick($event)" } }, ngImport: i0, template: `<div class="flex rounded w-full gap-3"
76
- [class.rounded-none]="this.spxShowValidationMessages"
77
- [class.rounded-t]="this.spxShowValidationMessages"
78
- [class.outline-none]="this.spxFocused && !this.spxReadonly"
79
- [class.ring-2]="this.spxFocused && !this.spxReadonly"
80
- [class.ring-offset-2]="this.spxFocused && !this.spxReadonly"
81
- [class.ring-blue-500]="this.spxFocused && !this.spxReadonly"
82
- [class.bg-white]="!this.spxReadonly"
83
- [class.bg-gray-300]="this.spxReadonly"
84
- [class.cursor-not-allowed]="this.spxReadonly">
85
- <div class="flex-auto p-3"
86
- [class.p-0]="this.spxCompact"
87
- [class.flex]="this.spxCompact"
88
- [class.items-center]="this.spxCompact">
89
- <div *ngIf="this.spxShowLabel" class="font-bold text-sm mb-1 text-gray-800"
90
- [class.mb-0]="this.spxCompact"
91
- [class.px-3]="this.spxCompact">
92
- {{this.spxLabel}} <span *ngIf="spxRequired" class="text-red-800">*</span>
93
- </div>
75
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputBoxComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
76
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxInputBoxComponent, isStandalone: true, selector: "spx-input-box", inputs: { spxCompact: "spxCompact", spxFocused: "spxFocused", spxLabel: "spxLabel", spxReadonly: "spxReadonly", spxRequired: "spxRequired", spxShowClear: "spxShowClear", spxShowEdit: "spxShowEdit", spxShowHelp: "spxShowHelp", spxShowLabel: "spxShowLabel", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxValue: "spxValue" }, outputs: { spxClear: "spxClear", spxSearch: "spxSearch", spxFocus: "spxFocus", spxFocusOut: "spxFocusOut", spxEdit: "spxEdit", spxHelp: "spxHelp" }, host: { listeners: { "focusin": "handleFocusIn($event)", "focusout": "handleFocusOut($event)", "document:click": "handleWindowClick($event)" } }, ngImport: i0, template: `<div class="flex rounded w-full gap-3"
77
+ [class.rounded-none]="this.spxShowValidationMessages"
78
+ [class.rounded-t]="this.spxShowValidationMessages"
79
+ [class.outline-none]="this.spxFocused && !this.spxReadonly"
80
+ [class.ring-2]="this.spxFocused && !this.spxReadonly"
81
+ [class.ring-offset-2]="this.spxFocused && !this.spxReadonly"
82
+ [class.ring-blue-500]="this.spxFocused && !this.spxReadonly"
83
+ [class.bg-white]="!this.spxReadonly"
84
+ [class.bg-gray-300]="this.spxReadonly"
85
+ [class.cursor-not-allowed]="this.spxReadonly">
86
+ <div class="flex-auto p-3"
87
+ [class.p-0]="this.spxCompact"
88
+ [class.flex]="this.spxCompact"
89
+ [class.items-center]="this.spxCompact">
90
+ @if (this.spxShowLabel) {
91
+ <div class="font-bold text-sm mb-1 text-gray-800"
92
+ [class.mb-0]="this.spxCompact"
93
+ [class.px-3]="this.spxCompact">
94
+ {{this.spxLabel}} @if (spxRequired) {
95
+ <span class="text-red-800">*</span>
96
+ }
97
+ </div>
98
+ }
94
99
  <ng-content select="[controls]"></ng-content>
95
100
  </div>
96
101
  <div class="flex flex-none gap-1 p-1">
97
- <spx-button
98
- *ngIf="this.spxShowEdit"
99
- (spxClick)="onEdit()"
100
- [spxFullHeight]="true"
101
- [spxSize]="'xl'"
102
- [spxType]="'button'">
103
- <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
104
- </spx-button>
105
- <spx-button
106
- *ngIf="this.spxShowHelp"
107
- (spxClick)="onHelp()"
108
- [spxFullHeight]="true"
109
- [spxDisabled]="this.spxReadonly"
110
- [spxSize]="'xl'"
111
- [spxTabIndex]="-1"
112
- [spxType]="'button'">
113
- <fa-icon [icon]="faQuestion" class="block text-xl"></fa-icon>
114
- </spx-button>
115
- <spx-button
116
- *ngIf="this.spxShowSearch"
117
- (spxClick)="onSearch()"
118
- [spxFullHeight]="true"
119
- [spxDisabled]="this.spxReadonly"
120
- [spxSize]="'xl'"
121
- [spxTabIndex]="-1"
122
- [spxType]="'button'">
123
- <fa-icon [icon]="faSearch" class="block text-xl"></fa-icon>
124
- </spx-button>
125
- <spx-button
126
- *ngIf="this.spxShowClear"
127
- (spxClick)="onClear()"
128
- [spxDisabled]="this.spxReadonly || !this.spxValue?.value"
129
- [spxFullHeight]="true"
130
- [spxSize]="'xl'"
131
- [spxTabIndex]="-1"
132
- [spxType]="'button'">
133
- <fa-icon [icon]="faTimes" class="block text-xl"></fa-icon>
134
- </spx-button>
102
+ @if (this.spxShowEdit) {
103
+ <spx-button
104
+ (spxClick)="onEdit()"
105
+ [spxFullHeight]="true"
106
+ [spxSize]="'xl'"
107
+ [spxType]="'button'">
108
+ <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
109
+ </spx-button>
110
+ }
111
+ @if (this.spxShowHelp) {
112
+ <spx-button
113
+ (spxClick)="onHelp()"
114
+ [spxFullHeight]="true"
115
+ [spxDisabled]="this.spxReadonly"
116
+ [spxSize]="'xl'"
117
+ [spxTabIndex]="-1"
118
+ [spxType]="'button'">
119
+ <fa-icon [icon]="faQuestion" class="block text-xl"></fa-icon>
120
+ </spx-button>
121
+ }
122
+ @if (this.spxShowSearch) {
123
+ <spx-button
124
+ (spxClick)="onSearch()"
125
+ [spxFullHeight]="true"
126
+ [spxDisabled]="this.spxReadonly"
127
+ [spxSize]="'xl'"
128
+ [spxTabIndex]="-1"
129
+ [spxType]="'button'">
130
+ <fa-icon [icon]="faSearch" class="block text-xl"></fa-icon>
131
+ </spx-button>
132
+ }
133
+ @if (this.spxShowClear) {
134
+ <spx-button
135
+ (spxClick)="onClear()"
136
+ [spxDisabled]="this.spxReadonly || !this.spxValue?.value"
137
+ [spxFullHeight]="true"
138
+ [spxSize]="'xl'"
139
+ [spxTabIndex]="-1"
140
+ [spxType]="'button'">
141
+ <fa-icon [icon]="faTimes" class="block text-xl"></fa-icon>
142
+ </spx-button>
143
+ }
144
+ </div>
135
145
  </div>
136
- </div>
137
- <div *ngIf="this.spxShowValidationMessages" class="bg-red-600 rounded-b text-white p-3">
138
- <ng-content select="[validation-messages]"></ng-content>
139
- </div>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }] }); }
146
+ @if (this.spxShowValidationMessages) {
147
+ <div class="bg-red-600 rounded-b text-white p-3">
148
+ <ng-content select="[validation-messages]"></ng-content>
149
+ </div>
150
+ }`, isInline: true, dependencies: [{ kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }] }); }
140
151
  }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputBoxComponent, decorators: [{
152
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputBoxComponent, decorators: [{
142
153
  type: Component,
143
154
  args: [{
144
155
  selector: 'spx-input-box',
145
156
  imports: [
146
- NgIf,
147
157
  SpxButtonComponent,
148
- FontAwesomeModule,
158
+ FontAwesomeModule
149
159
  ],
150
160
  template: `<div class="flex rounded w-full gap-3"
151
- [class.rounded-none]="this.spxShowValidationMessages"
152
- [class.rounded-t]="this.spxShowValidationMessages"
153
- [class.outline-none]="this.spxFocused && !this.spxReadonly"
154
- [class.ring-2]="this.spxFocused && !this.spxReadonly"
155
- [class.ring-offset-2]="this.spxFocused && !this.spxReadonly"
156
- [class.ring-blue-500]="this.spxFocused && !this.spxReadonly"
157
- [class.bg-white]="!this.spxReadonly"
158
- [class.bg-gray-300]="this.spxReadonly"
159
- [class.cursor-not-allowed]="this.spxReadonly">
160
- <div class="flex-auto p-3"
161
- [class.p-0]="this.spxCompact"
162
- [class.flex]="this.spxCompact"
163
- [class.items-center]="this.spxCompact">
164
- <div *ngIf="this.spxShowLabel" class="font-bold text-sm mb-1 text-gray-800"
165
- [class.mb-0]="this.spxCompact"
166
- [class.px-3]="this.spxCompact">
167
- {{this.spxLabel}} <span *ngIf="spxRequired" class="text-red-800">*</span>
168
- </div>
161
+ [class.rounded-none]="this.spxShowValidationMessages"
162
+ [class.rounded-t]="this.spxShowValidationMessages"
163
+ [class.outline-none]="this.spxFocused && !this.spxReadonly"
164
+ [class.ring-2]="this.spxFocused && !this.spxReadonly"
165
+ [class.ring-offset-2]="this.spxFocused && !this.spxReadonly"
166
+ [class.ring-blue-500]="this.spxFocused && !this.spxReadonly"
167
+ [class.bg-white]="!this.spxReadonly"
168
+ [class.bg-gray-300]="this.spxReadonly"
169
+ [class.cursor-not-allowed]="this.spxReadonly">
170
+ <div class="flex-auto p-3"
171
+ [class.p-0]="this.spxCompact"
172
+ [class.flex]="this.spxCompact"
173
+ [class.items-center]="this.spxCompact">
174
+ @if (this.spxShowLabel) {
175
+ <div class="font-bold text-sm mb-1 text-gray-800"
176
+ [class.mb-0]="this.spxCompact"
177
+ [class.px-3]="this.spxCompact">
178
+ {{this.spxLabel}} @if (spxRequired) {
179
+ <span class="text-red-800">*</span>
180
+ }
181
+ </div>
182
+ }
169
183
  <ng-content select="[controls]"></ng-content>
170
184
  </div>
171
185
  <div class="flex flex-none gap-1 p-1">
172
- <spx-button
173
- *ngIf="this.spxShowEdit"
174
- (spxClick)="onEdit()"
175
- [spxFullHeight]="true"
176
- [spxSize]="'xl'"
177
- [spxType]="'button'">
178
- <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
179
- </spx-button>
180
- <spx-button
181
- *ngIf="this.spxShowHelp"
182
- (spxClick)="onHelp()"
183
- [spxFullHeight]="true"
184
- [spxDisabled]="this.spxReadonly"
185
- [spxSize]="'xl'"
186
- [spxTabIndex]="-1"
187
- [spxType]="'button'">
188
- <fa-icon [icon]="faQuestion" class="block text-xl"></fa-icon>
189
- </spx-button>
190
- <spx-button
191
- *ngIf="this.spxShowSearch"
192
- (spxClick)="onSearch()"
193
- [spxFullHeight]="true"
194
- [spxDisabled]="this.spxReadonly"
195
- [spxSize]="'xl'"
196
- [spxTabIndex]="-1"
197
- [spxType]="'button'">
198
- <fa-icon [icon]="faSearch" class="block text-xl"></fa-icon>
199
- </spx-button>
200
- <spx-button
201
- *ngIf="this.spxShowClear"
202
- (spxClick)="onClear()"
203
- [spxDisabled]="this.spxReadonly || !this.spxValue?.value"
204
- [spxFullHeight]="true"
205
- [spxSize]="'xl'"
206
- [spxTabIndex]="-1"
207
- [spxType]="'button'">
208
- <fa-icon [icon]="faTimes" class="block text-xl"></fa-icon>
209
- </spx-button>
186
+ @if (this.spxShowEdit) {
187
+ <spx-button
188
+ (spxClick)="onEdit()"
189
+ [spxFullHeight]="true"
190
+ [spxSize]="'xl'"
191
+ [spxType]="'button'">
192
+ <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
193
+ </spx-button>
194
+ }
195
+ @if (this.spxShowHelp) {
196
+ <spx-button
197
+ (spxClick)="onHelp()"
198
+ [spxFullHeight]="true"
199
+ [spxDisabled]="this.spxReadonly"
200
+ [spxSize]="'xl'"
201
+ [spxTabIndex]="-1"
202
+ [spxType]="'button'">
203
+ <fa-icon [icon]="faQuestion" class="block text-xl"></fa-icon>
204
+ </spx-button>
205
+ }
206
+ @if (this.spxShowSearch) {
207
+ <spx-button
208
+ (spxClick)="onSearch()"
209
+ [spxFullHeight]="true"
210
+ [spxDisabled]="this.spxReadonly"
211
+ [spxSize]="'xl'"
212
+ [spxTabIndex]="-1"
213
+ [spxType]="'button'">
214
+ <fa-icon [icon]="faSearch" class="block text-xl"></fa-icon>
215
+ </spx-button>
216
+ }
217
+ @if (this.spxShowClear) {
218
+ <spx-button
219
+ (spxClick)="onClear()"
220
+ [spxDisabled]="this.spxReadonly || !this.spxValue?.value"
221
+ [spxFullHeight]="true"
222
+ [spxSize]="'xl'"
223
+ [spxTabIndex]="-1"
224
+ [spxType]="'button'">
225
+ <fa-icon [icon]="faTimes" class="block text-xl"></fa-icon>
226
+ </spx-button>
227
+ }
210
228
  </div>
211
- </div>
212
- <div *ngIf="this.spxShowValidationMessages" class="bg-red-600 rounded-b text-white p-3">
213
- <ng-content select="[validation-messages]"></ng-content>
214
- </div>`
229
+ </div>
230
+ @if (this.spxShowValidationMessages) {
231
+ <div class="bg-red-600 rounded-b text-white p-3">
232
+ <ng-content select="[validation-messages]"></ng-content>
233
+ </div>
234
+ }`
215
235
  }]
216
236
  }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { spxCompact: [{
217
237
  type: Input
@@ -298,49 +318,49 @@ class SpxDropdownComponent {
298
318
  this.focusPosition = 0;
299
319
  this.spxSelect.emit(valuePair);
300
320
  }
301
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
302
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: SpxDropdownComponent, isStandalone: true, selector: "spx-dropdown", inputs: { spxSuggestions: "spxSuggestions" }, outputs: { spxSelect: "spxSelect" }, usesOnChanges: true, ngImport: i0, template: `<div class="relative text-black">
303
- <div
304
- class="absolute bg-gray-100 left-0 right-0 z-20">
305
- <button
306
- *ngFor="let valuePair of this.spxSuggestions; let i = index"
307
- class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center text-left"
308
- [class.bg-gray-100]="i === this.focusPosition"
309
- [class.bg-white]="i !== this.focusPosition"
310
- (click)="this.handleSuggestionClick(valuePair)"
311
- [attr.tabindex]="-1"
312
- [attr.type]="'button'">
313
- <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
314
- <spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'" [spxTabIndex]="-1">Select</spx-button>
315
- </button>
316
- </div>
317
- </div>`, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }] }); }
321
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
322
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxDropdownComponent, isStandalone: true, selector: "spx-dropdown", inputs: { spxSuggestions: "spxSuggestions" }, outputs: { spxSelect: "spxSelect" }, usesOnChanges: true, ngImport: i0, template: `<div class="relative text-black">
323
+ <div
324
+ class="absolute bg-gray-100 left-0 right-0 z-20">
325
+ @for (valuePair of this.spxSuggestions; track valuePair; let i = $index) {
326
+ <button
327
+ class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center text-left"
328
+ [class.bg-gray-100]="i === this.focusPosition"
329
+ [class.bg-white]="i !== this.focusPosition"
330
+ (click)="this.handleSuggestionClick(valuePair)"
331
+ [attr.tabindex]="-1"
332
+ [attr.type]="'button'">
333
+ <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
334
+ <spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'" [spxTabIndex]="-1">Select</spx-button>
335
+ </button>
336
+ }
337
+ </div>
338
+ </div>`, isInline: true, dependencies: [{ kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }] }); }
318
339
  }
319
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxDropdownComponent, decorators: [{
340
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxDropdownComponent, decorators: [{
320
341
  type: Component,
321
342
  args: [{
322
343
  selector: 'spx-dropdown',
323
344
  imports: [
324
- NgIf,
325
- NgFor,
326
- SpxButtonComponent,
345
+ SpxButtonComponent
327
346
  ],
328
347
  template: `<div class="relative text-black">
329
- <div
330
- class="absolute bg-gray-100 left-0 right-0 z-20">
331
- <button
332
- *ngFor="let valuePair of this.spxSuggestions; let i = index"
333
- class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center text-left"
334
- [class.bg-gray-100]="i === this.focusPosition"
335
- [class.bg-white]="i !== this.focusPosition"
336
- (click)="this.handleSuggestionClick(valuePair)"
337
- [attr.tabindex]="-1"
338
- [attr.type]="'button'">
339
- <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
340
- <spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'" [spxTabIndex]="-1">Select</spx-button>
341
- </button>
342
- </div>
343
- </div>`
348
+ <div
349
+ class="absolute bg-gray-100 left-0 right-0 z-20">
350
+ @for (valuePair of this.spxSuggestions; track valuePair; let i = $index) {
351
+ <button
352
+ class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center text-left"
353
+ [class.bg-gray-100]="i === this.focusPosition"
354
+ [class.bg-white]="i !== this.focusPosition"
355
+ (click)="this.handleSuggestionClick(valuePair)"
356
+ [attr.tabindex]="-1"
357
+ [attr.type]="'button'">
358
+ <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
359
+ <spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'" [spxTabIndex]="-1">Select</spx-button>
360
+ </button>
361
+ }
362
+ </div>
363
+ </div>`
344
364
  }]
345
365
  }], propDecorators: { spxSuggestions: [{
346
366
  type: Input
@@ -393,79 +413,86 @@ class SpxInputTextComponent {
393
413
  handleKeyUp() {
394
414
  this.spxFocused = true;
395
415
  }
396
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
397
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: SpxInputTextComponent, isStandalone: true, selector: "spx-input-text", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxPattern: "spxPattern", spxSuggestions: "spxSuggestions", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxCapitalize: "spxCapitalize", spxFocused: "spxFocused", spxType: "spxType", value: "value", spxWasInternalUpdate: "spxWasInternalUpdate" }, outputs: { spxBlurFromChild: "spxBlurFromChild", spxChange: "spxChange", spxFocus: "spxFocus" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: `<div class="relative text-black">
398
- <input
399
- #input
400
- class="font-bold text-lg w-full outline-none"
401
- autocomplete="off"
402
- spellcheck="false"
403
- [class.bg-white]="!this.spxReadonly"
404
- [class.bg-gray-300]="this.spxReadonly"
405
- [class.cursor-not-allowed]="this.spxReadonly"
406
- [class.uppercase]="this.spxCapitalize"
407
- [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
408
- [attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
409
- [attr.inputMode]="this.spxInputMode ? this.spxInputMode : undefined"
410
- [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
411
- [attr.name]="this.spxName"
412
- [attr.type]="this.spxType"
413
- [value]="this.value?.description ? this.value?.description : this.value?.value"
414
- (blur)="this.handleBlur()"
415
- (keyUp)="this.handleKeyUp()"
416
- (focus)="this.handleFocus()"
417
- (input)="this.handleDescriptionInput($event)"
418
- />
419
- <span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
420
- <spx-dropdown
421
- *ngIf="this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')"
422
- [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
423
- </spx-dropdown>
424
- </div>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SpxDropdownComponent, selector: "spx-dropdown", inputs: ["spxSuggestions"], outputs: ["spxSelect"] }] }); }
416
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
417
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxInputTextComponent, isStandalone: true, selector: "spx-input-text", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxAutocomplete: "spxAutocomplete", spxInputMode: "spxInputMode", spxPattern: "spxPattern", spxSuggestions: "spxSuggestions", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxCapitalize: "spxCapitalize", spxFocused: "spxFocused", spxType: "spxType", value: "value", spxWasInternalUpdate: "spxWasInternalUpdate" }, outputs: { spxBlurFromChild: "spxBlurFromChild", spxChange: "spxChange", spxFocus: "spxFocus" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: `<div class="relative text-black">
418
+ <input
419
+ #input
420
+ class="font-bold text-lg w-full outline-none"
421
+ autocomplete="off"
422
+ spellcheck="false"
423
+ [class.bg-white]="!this.spxReadonly"
424
+ [class.bg-gray-300]="this.spxReadonly"
425
+ [class.cursor-not-allowed]="this.spxReadonly"
426
+ [class.uppercase]="this.spxCapitalize"
427
+ [attr.autocomplete]="this.spxAutocomplete ? this.spxAutocomplete : undefined"
428
+ [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
429
+ [attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
430
+ [attr.inputMode]="this.spxInputMode ? this.spxInputMode : undefined"
431
+ [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
432
+ [attr.name]="this.spxName"
433
+ [attr.type]="this.spxType"
434
+ [value]="this.value?.description ? this.value?.description : this.value?.value"
435
+ (blur)="this.handleBlur()"
436
+ (keyUp)="this.handleKeyUp()"
437
+ (focus)="this.handleFocus()"
438
+ (input)="this.handleDescriptionInput($event)"
439
+ />
440
+ @if (this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()) {
441
+ <span>{{this.value?.value}}</span>
442
+ }
443
+ @if (this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')) {
444
+ <spx-dropdown
445
+ [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
446
+ </spx-dropdown>
447
+ }
448
+ </div>`, isInline: true, dependencies: [{ kind: "component", type: SpxDropdownComponent, selector: "spx-dropdown", inputs: ["spxSuggestions"], outputs: ["spxSelect"] }] }); }
425
449
  }
426
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputTextComponent, decorators: [{
450
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputTextComponent, decorators: [{
427
451
  type: Component,
428
452
  args: [{
429
453
  selector: 'spx-input-text',
430
454
  imports: [
431
- NgIf,
432
- NgFor,
433
- SpxButtonComponent,
434
- SpxDropdownComponent,
455
+ SpxDropdownComponent
435
456
  ],
436
457
  template: `<div class="relative text-black">
437
- <input
438
- #input
439
- class="font-bold text-lg w-full outline-none"
440
- autocomplete="off"
441
- spellcheck="false"
442
- [class.bg-white]="!this.spxReadonly"
443
- [class.bg-gray-300]="this.spxReadonly"
444
- [class.cursor-not-allowed]="this.spxReadonly"
445
- [class.uppercase]="this.spxCapitalize"
446
- [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
447
- [attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
448
- [attr.inputMode]="this.spxInputMode ? this.spxInputMode : undefined"
449
- [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
450
- [attr.name]="this.spxName"
451
- [attr.type]="this.spxType"
452
- [value]="this.value?.description ? this.value?.description : this.value?.value"
453
- (blur)="this.handleBlur()"
454
- (keyUp)="this.handleKeyUp()"
455
- (focus)="this.handleFocus()"
456
- (input)="this.handleDescriptionInput($event)"
457
- />
458
- <span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
459
- <spx-dropdown
460
- *ngIf="this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')"
461
- [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
462
- </spx-dropdown>
463
- </div>`
458
+ <input
459
+ #input
460
+ class="font-bold text-lg w-full outline-none"
461
+ autocomplete="off"
462
+ spellcheck="false"
463
+ [class.bg-white]="!this.spxReadonly"
464
+ [class.bg-gray-300]="this.spxReadonly"
465
+ [class.cursor-not-allowed]="this.spxReadonly"
466
+ [class.uppercase]="this.spxCapitalize"
467
+ [attr.autocomplete]="this.spxAutocomplete ? this.spxAutocomplete : undefined"
468
+ [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
469
+ [attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
470
+ [attr.inputMode]="this.spxInputMode ? this.spxInputMode : undefined"
471
+ [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
472
+ [attr.name]="this.spxName"
473
+ [attr.type]="this.spxType"
474
+ [value]="this.value?.description ? this.value?.description : this.value?.value"
475
+ (blur)="this.handleBlur()"
476
+ (keyUp)="this.handleKeyUp()"
477
+ (focus)="this.handleFocus()"
478
+ (input)="this.handleDescriptionInput($event)"
479
+ />
480
+ @if (this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()) {
481
+ <span>{{this.value?.value}}</span>
482
+ }
483
+ @if (this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')) {
484
+ <spx-dropdown
485
+ [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
486
+ </spx-dropdown>
487
+ }
488
+ </div>`
464
489
  }]
465
490
  }], propDecorators: { spxName: [{
466
491
  type: Input
467
492
  }], spxAutofocus: [{
468
493
  type: Input
494
+ }], spxAutocomplete: [{
495
+ type: Input
469
496
  }], spxInputMode: [{
470
497
  type: Input
471
498
  }], spxPattern: [{
@@ -497,298 +524,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
497
524
  args: ['input', { static: true }]
498
525
  }] } });
499
526
 
500
- class SpxInputDateComponent {
501
- async spxSetFocus() {
502
- // this.elYear.focus();
503
- }
504
- // @Watch('spxValidators') watchSpxValidators(newValue) {
505
- // console.log('validators', newValue);
506
- // }
507
- // @Watch('value') watchValue(newValue) {
508
- // if (this.spxWasInternalUpdate) {
509
- // this.spxWasInternalUpdate = false;
510
- // } else {
511
- // const parsedValue = DateTime.fromISO(newValue?.value);
512
- // this.spxInternalValue.years = parsedValue.year;
513
- // this.spxInternalValue.months = parsedValue.month;
514
- // this.spxInternalValue.days = parsedValue.day;
515
- // this.spxSelectStep = 'years';
516
- // }
517
- // }
518
- constructor() {
519
- this.spxReadonly = false;
520
- this.spxFocused = true;
521
- this.spxSelectMonth = true;
522
- this.spxSelectDay = true;
523
- this.spxChange = new EventEmitter();
524
- this.spxFocus = new EventEmitter();
525
- this.spxSelectStep = 'years';
526
- this.spxInternalValue = {};
527
- this.spxSuggestions = {
528
- years: [],
529
- months: [{
530
- description: 'Jan',
531
- value: 1,
532
- }, {
533
- description: 'Feb',
534
- value: 2,
535
- }, {
536
- description: 'Mar',
537
- value: 3,
538
- }, {
539
- description: 'Apr',
540
- value: 4,
541
- }, {
542
- description: 'May',
543
- value: 5,
544
- }, {
545
- description: 'Jun',
546
- value: 6,
547
- }, {
548
- description: 'Jul',
549
- value: 7,
550
- }, {
551
- description: 'Aug',
552
- value: 8,
553
- }, {
554
- description: 'Sep',
555
- value: 9,
556
- }, {
557
- description: 'Oct',
558
- value: 10,
559
- }, {
560
- description: 'Nov',
561
- value: 11,
562
- }, {
563
- description: 'Dec',
564
- value: 12,
565
- }],
566
- days: [],
567
- };
568
- this.spxWasInternalUpdate = false;
569
- this.suggestYears();
570
- }
571
- componentWillLoad() {
572
- const parsedValue = this.value ? DateTime.fromISO(this.value.value) : DateTime.now();
573
- this.spxInternalValue.years = parsedValue.year;
574
- this.spxInternalValue.months = parsedValue.month;
575
- this.spxInternalValue.days = parsedValue.day;
576
- }
577
- handleDayInput(event) {
578
- this.spxInternalValue.days = event.target ? event.target.value : null;
579
- this.updateValue();
580
- }
581
- handleMonthInput(event) {
582
- this.spxInternalValue.months = event.target ? event.target.value : null;
583
- this.afterMonthChange();
584
- }
585
- afterMonthChange() {
586
- if (this.spxInternalValue.months.toString().length === 2 && this.spxSelectDay && this.spxLastKeyPressed !== 38 && this.spxLastKeyPressed !== 40) {
587
- // this.elDay!.focus();
588
- }
589
- this.updateValue();
590
- }
591
- handleYearInput(event) {
592
- this.spxInternalValue.years = event.target ? event.target.value : null;
593
- this.afterYearChange();
594
- }
595
- afterYearChange() {
596
- if (this.spxInternalValue.years.toString().length === 4 && this.spxSelectMonth && this.spxLastKeyPressed !== 38 && this.spxLastKeyPressed !== 40) {
597
- // this.elMonth!.focus();
598
- }
599
- this.updateValue();
600
- }
601
- handleInput(event) {
602
- this.setValue(event.target ? event.target.value : null);
603
- }
604
- handleFocus(step) {
605
- this.spxSelectStep = step;
606
- this.spxFocus.emit();
607
- }
608
- handleKeyDown(event) {
609
- this.spxLastKeyPressed = event.which;
610
- }
611
- handleSuggestionClick(value) {
612
- this.spxLastKeyPressed = null;
613
- this.spxInternalValue[this.spxSelectStep] = value;
614
- this.updateValue();
615
- this.doneWithField();
616
- }
617
- updateValue() {
618
- const concatenatedValue = `${this.spxInternalValue.years ? this.spxInternalValue.years : ``}${this.spxInternalValue.months ? `-${this.spxInternalValue.months < 10 ? `0${this.spxInternalValue.months}` : this.spxInternalValue.months}` : ``}${this.spxInternalValue.days ? `-${this.spxInternalValue.days < 10 ? `0${this.spxInternalValue.days}` : this.spxInternalValue.days}` : ``}`;
619
- const parsedValue = DateTime.fromISO(concatenatedValue);
620
- this.spxWasInternalUpdate = true;
621
- this.value = {
622
- description: parsedValue.toISO(),
623
- value: parsedValue.toISO(),
624
- };
625
- this.spxChange.emit(this.value);
626
- }
627
- doneWithField() {
628
- if (this.spxSelectStep === 'days') {
629
- this.spxSelectStep = 'years';
630
- }
631
- else if (this.spxSelectStep === 'months') {
632
- this.spxSelectStep = this.spxSelectDay ? 'days' : 'years';
633
- this.afterMonthChange();
634
- }
635
- else if (this.spxSelectStep === 'years') {
636
- this.afterYearChange();
637
- this.spxSelectStep = this.spxSelectMonth ? 'months' : 'years';
638
- }
639
- }
640
- setValue(value) {
641
- this.spxInternalValue = value;
642
- const parsed = DateTime.fromISO(value);
643
- this.value = {
644
- description: parsed.toISO(),
645
- value: parsed.toISO(),
646
- };
647
- this.spxChange.emit(this.value);
648
- this.spxWasInternalUpdate = true;
649
- }
650
- suggestYears() {
651
- this.spxSuggestions.years = [];
652
- for (let year = DateTime.fromISO(this.spxMin).year; year <= DateTime.fromISO(this.spxMax).year; year++) {
653
- this.spxSuggestions.years.push({
654
- description: `'${year.toString().substring(2, 4)}`,
655
- value: year,
656
- });
657
- }
658
- }
659
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
660
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: SpxInputDateComponent, isStandalone: true, selector: "spx-input-date", inputs: { spxMax: "spxMax", spxMin: "spxMin", spxName: "spxName", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxFocused: "spxFocused", spxSelectMonth: "spxSelectMonth", spxSelectDay: "spxSelectDay", value: "value", spxLastKeyPressed: "spxLastKeyPressed", spxSelectStep: "spxSelectStep", spxInternalValue: "spxInternalValue", spxSuggestions: "spxSuggestions", spxWasInternalUpdate: "spxWasInternalUpdate" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, ngImport: i0, template: `<div class='spx-input-date__controls'>
661
- <input
662
- class='spx-input-date__input'
663
- [attr.value]="this.spxInternalValue.years"
664
- (focus)="this.handleFocus('years')"
665
- (input)="this.handleYearInput($event)"
666
- (keyDown)="this.handleKeyDown($event)"
667
- [attr.type]="'number'"
668
- [attr.min]="1900"
669
- [attr.max]="2100"
670
- [attr.step]="1"
671
- />
672
- <div class='spx-input-date__control-label'>Year</div>
673
- <input
674
- *ngIf="this.spxSelectMonth"
675
- class='spx-input-date__input'
676
- [attr.value]="this.spxInternalValue.months"
677
- (focus)="this.handleFocus('months')"
678
- (input)="this.handleMonthInput($event)"
679
- (keyDown)="this.handleKeyDown($event)"
680
- [attr.type]="'number'"
681
- [attr.min]="1"
682
- [attr.max]="12"
683
- [attr.step]="1" />
684
- <div class='spx-input-date__control-label'>Month</div>
685
- <input
686
- *ngIf="this.spxSelectDay"
687
- class='spx-input-date__input'
688
- [attr.value]="this.spxInternalValue.days"
689
- (focus)="this.handleFocus('days')"
690
- (input)="this.handleDayInput($event)"
691
- (keyDown)="this.handleKeyDown($event)"
692
- [attr.type]="'number'"
693
- [attr.min]="1"
694
- [attr.max]="31"
695
- [attr.step]="1" />
696
- <div class='spx-input-date__control-label'>Days</div>
697
- </div>
698
- <div class='spx-input-date__suggestions'>
699
- <spx-suggestion
700
- *ngFor="let valuePair of spxSuggestions[spxSelectStep]"
701
- (click)="this.handleSuggestionClick(valuePair.value)">{{valuePair?.description}}</spx-suggestion>
702
- </div>`, isInline: true, styles: [":host{display:block}.spx-input-date__input{background-color:transparent;border:1px solid #979797;border-radius:4px;color:var(--spx-input--color, rgba(0, 0, 0, .9));box-sizing:border-box;font-size:16px;margin-right:10px;padding:6px;text-align:center;width:100%}.spx-input-date__input:active{transform:scale(.95)}.spx-input-date__input:focus{border:var(--spx-input-box--focus--border, 1px solid rgb(115, 168, 210));border-radius:4px;outline:none}.spx-input-date__control-label{align-items:center;color:#000000b3;display:inline-grid;font-size:13px;letter-spacing:1px}.spx-input-date__input::-webkit-outer-spin-button,.spx-input-date__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.spx-input-date__input[type=number]{-moz-appearance:textfield}.spx-input-date__suggestions,.spx-input-date__controls{display:grid;grid-gap:8px;grid-template-columns:repeat(4,1fr);margin-top:8px}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxSuggestionComponent, selector: "spx-suggestion", inputs: ["spxDisabled", "spxFocused", "spxSelected", "spxTabbable"] }] }); }
703
- }
704
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputDateComponent, decorators: [{
705
- type: Component,
706
- args: [{ selector: 'spx-input-date', imports: [
707
- NgIf,
708
- NgFor,
709
- SpxButtonComponent,
710
- SpxSuggestionComponent
711
- ], template: `<div class='spx-input-date__controls'>
712
- <input
713
- class='spx-input-date__input'
714
- [attr.value]="this.spxInternalValue.years"
715
- (focus)="this.handleFocus('years')"
716
- (input)="this.handleYearInput($event)"
717
- (keyDown)="this.handleKeyDown($event)"
718
- [attr.type]="'number'"
719
- [attr.min]="1900"
720
- [attr.max]="2100"
721
- [attr.step]="1"
722
- />
723
- <div class='spx-input-date__control-label'>Year</div>
724
- <input
725
- *ngIf="this.spxSelectMonth"
726
- class='spx-input-date__input'
727
- [attr.value]="this.spxInternalValue.months"
728
- (focus)="this.handleFocus('months')"
729
- (input)="this.handleMonthInput($event)"
730
- (keyDown)="this.handleKeyDown($event)"
731
- [attr.type]="'number'"
732
- [attr.min]="1"
733
- [attr.max]="12"
734
- [attr.step]="1" />
735
- <div class='spx-input-date__control-label'>Month</div>
736
- <input
737
- *ngIf="this.spxSelectDay"
738
- class='spx-input-date__input'
739
- [attr.value]="this.spxInternalValue.days"
740
- (focus)="this.handleFocus('days')"
741
- (input)="this.handleDayInput($event)"
742
- (keyDown)="this.handleKeyDown($event)"
743
- [attr.type]="'number'"
744
- [attr.min]="1"
745
- [attr.max]="31"
746
- [attr.step]="1" />
747
- <div class='spx-input-date__control-label'>Days</div>
748
- </div>
749
- <div class='spx-input-date__suggestions'>
750
- <spx-suggestion
751
- *ngFor="let valuePair of spxSuggestions[spxSelectStep]"
752
- (click)="this.handleSuggestionClick(valuePair.value)">{{valuePair?.description}}</spx-suggestion>
753
- </div>`, styles: [":host{display:block}.spx-input-date__input{background-color:transparent;border:1px solid #979797;border-radius:4px;color:var(--spx-input--color, rgba(0, 0, 0, .9));box-sizing:border-box;font-size:16px;margin-right:10px;padding:6px;text-align:center;width:100%}.spx-input-date__input:active{transform:scale(.95)}.spx-input-date__input:focus{border:var(--spx-input-box--focus--border, 1px solid rgb(115, 168, 210));border-radius:4px;outline:none}.spx-input-date__control-label{align-items:center;color:#000000b3;display:inline-grid;font-size:13px;letter-spacing:1px}.spx-input-date__input::-webkit-outer-spin-button,.spx-input-date__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.spx-input-date__input[type=number]{-moz-appearance:textfield}.spx-input-date__suggestions,.spx-input-date__controls{display:grid;grid-gap:8px;grid-template-columns:repeat(4,1fr);margin-top:8px}\n"] }]
754
- }], ctorParameters: () => [], propDecorators: { spxMax: [{
755
- type: Input
756
- }], spxMin: [{
757
- type: Input
758
- }], spxName: [{
759
- type: Input
760
- }], spxReadonly: [{
761
- type: Input
762
- }], spxValidators: [{
763
- type: Input
764
- }], spxFocused: [{
765
- type: Input
766
- }], spxSelectMonth: [{
767
- type: Input
768
- }], spxSelectDay: [{
769
- type: Input
770
- }], value: [{
771
- type: Input
772
- }], spxChange: [{
773
- type: Output
774
- }], spxFocus: [{
775
- type: Output
776
- }], spxLastKeyPressed: [{
777
- type: Input
778
- }], spxSelectStep: [{
779
- type: Input
780
- }], spxInternalValue: [{
781
- type: Input
782
- }], spxSuggestions: [{
783
- type: Input
784
- }], spxWasInternalUpdate: [{
785
- type: Input
786
- }] } });
787
-
788
527
  class SpxInputFloatComponent {
789
528
  constructor() {
790
- // private elFirstInput?: HTMLElement;
791
- // private elSecondInput?: HTMLElement;
792
529
  this.internalValue = {
793
530
  first: null,
794
531
  second: null,
@@ -804,16 +541,18 @@ class SpxInputFloatComponent {
804
541
  spxSetFocus() {
805
542
  this.firstInputRef?.nativeElement?.focus();
806
543
  }
807
- // @Watch('value') onValueChanged(newValue: SpxValuePair<any>, _oldValue: SpxValuePair<any>) {
808
- // this.handleSetValue(newValue);
809
- // }
810
- componentDidLoad() {
544
+ ngOnInit() {
811
545
  if (this.spxAutofocus) {
812
546
  this.spxFocus.emit();
813
547
  this.spxSetFocus();
814
548
  }
815
549
  this.handleSetValue(this.value);
816
550
  }
551
+ ngOnChanges(changes) {
552
+ if (changes['value']) {
553
+ this.handleSetValue(changes['value'].currentValue);
554
+ }
555
+ }
817
556
  handleFocus() {
818
557
  this.spxFocus.emit();
819
558
  }
@@ -832,10 +571,10 @@ class SpxInputFloatComponent {
832
571
  }
833
572
  this.tick = {};
834
573
  }
835
- handleInput(event, position) {
574
+ handleInput(value, position) {
836
575
  this.internalValue = {
837
- first: position === 1 ? (event.target ? event.target.value : null) : this.internalValue.first,
838
- second: position === 2 ? (event.target ? event.target.value : null) : this.internalValue.second,
576
+ first: position === 1 ? value : this.internalValue.first,
577
+ second: position === 2 ? value : this.internalValue.second,
839
578
  };
840
579
  let result;
841
580
  if (this.internalValue.first === null && this.internalValue.second === null) {
@@ -853,8 +592,8 @@ class SpxInputFloatComponent {
853
592
  isNumeric(value) {
854
593
  return /^[+-]?\d+(\.\d+)?$/.test(value);
855
594
  }
856
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputFloatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
857
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: SpxInputFloatComponent, isStandalone: true, selector: "spx-input-float", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxFocused: "spxFocused", spxStep: "spxStep", value: "value", spxWasInternalUpdate: "spxWasInternalUpdate", tick: "tick" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, viewQueries: [{ propertyName: "firstInputRef", first: true, predicate: ["firstInputRef"], descendants: true, static: true }], ngImport: i0, template: `<div class="flex items-end">
595
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputFloatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
596
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SpxInputFloatComponent, isStandalone: true, selector: "spx-input-float", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxFocused: "spxFocused", spxStep: "spxStep", value: "value", spxWasInternalUpdate: "spxWasInternalUpdate", tick: "tick" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, viewQueries: [{ propertyName: "firstInputRef", first: true, predicate: ["firstInputRef"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `<div class="flex items-end">
858
597
  <input
859
598
  #firstInputRef
860
599
  class="spx-input-float__input"
@@ -863,30 +602,28 @@ class SpxInputFloatComponent {
863
602
  [attr.pattern]="'[0-9]*'"
864
603
  [attr.step]="1"
865
604
  [attr.type]="'text'"
866
- [attr.value]="this.internalValue?.first ? this.internalValue?.first : undefined"
867
605
  [class.spx-input-float--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
868
606
  (focus)="this.handleFocus()"
869
- (input)="this.handleInput($event, 1)" />
607
+ [ngModel]="this.internalValue?.first ? this.internalValue?.first : undefined"
608
+ (ngModelChange)="this.handleInput($event, 1)" />
870
609
  <span class="text-black font-bold text-2xl mx-4">,</span>
871
610
  <input
872
611
  [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
873
612
  class="spx-input-float__input"
874
613
  [class.spx-input-float--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
875
614
  [attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
876
- [attr.value]="this.internalValue?.second ? this.internalValue?.second : undefined"
877
615
  (focus)="this.handleFocus()"
878
- (input)="this.handleInput($event, 2)"
616
+ [ngModel]="this.internalValue?.second ? this.internalValue?.second : undefined"
617
+ (ngModelChange)="this.handleInput($event, 2)"
879
618
  [attr.step]="1"
880
619
  [attr.type]="'text'"
881
620
  [attr.pattern]="'[0-9]*'" />
882
- </div>`, isInline: true, styles: [":host{display:block}.spx-input-float__input{border:1px solid #333333;border-radius:8px;background-color:transparent;box-sizing:border-box;color:var(--spx-input--color, rgba(0, 0, 0, .9));flex:1;font-size:20px;font-weight:700;padding:8px;width:100%}.spx-input-float__input:focus{outline:none}\n"] }); }
621
+ </div>`, isInline: true, styles: [":host{display:block}.spx-input-float__input{border:1px solid #333333;border-radius:8px;background-color:transparent;box-sizing:border-box;color:var(--spx-input--color, rgba(0, 0, 0, .9));flex:1;font-size:20px;font-weight:700;padding:8px;width:100%}.spx-input-float__input:focus{outline:none}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
883
622
  }
884
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputFloatComponent, decorators: [{
623
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputFloatComponent, decorators: [{
885
624
  type: Component,
886
625
  args: [{ selector: 'spx-input-float', imports: [
887
- NgIf,
888
- NgFor,
889
- SpxButtonComponent,
626
+ FormsModule,
890
627
  ], template: `<div class="flex items-end">
891
628
  <input
892
629
  #firstInputRef
@@ -896,19 +633,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
896
633
  [attr.pattern]="'[0-9]*'"
897
634
  [attr.step]="1"
898
635
  [attr.type]="'text'"
899
- [attr.value]="this.internalValue?.first ? this.internalValue?.first : undefined"
900
636
  [class.spx-input-float--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
901
637
  (focus)="this.handleFocus()"
902
- (input)="this.handleInput($event, 1)" />
638
+ [ngModel]="this.internalValue?.first ? this.internalValue?.first : undefined"
639
+ (ngModelChange)="this.handleInput($event, 1)" />
903
640
  <span class="text-black font-bold text-2xl mx-4">,</span>
904
641
  <input
905
642
  [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
906
643
  class="spx-input-float__input"
907
644
  [class.spx-input-float--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
908
645
  [attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
909
- [attr.value]="this.internalValue?.second ? this.internalValue?.second : undefined"
910
646
  (focus)="this.handleFocus()"
911
- (input)="this.handleInput($event, 2)"
647
+ [ngModel]="this.internalValue?.second ? this.internalValue?.second : undefined"
648
+ (ngModelChange)="this.handleInput($event, 2)"
912
649
  [attr.step]="1"
913
650
  [attr.type]="'text'"
914
651
  [attr.pattern]="'[0-9]*'" />
@@ -968,8 +705,8 @@ class SpxInputNumberComponent {
968
705
  };
969
706
  this.spxChange.emit(this.value);
970
707
  }
971
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
972
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: SpxInputNumberComponent, isStandalone: true, selector: "spx-input-number", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxFocused: "spxFocused", spxStep: "spxStep", value: "value" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: `<div class="spx-input-number__controls">
708
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
709
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SpxInputNumberComponent, isStandalone: true, selector: "spx-input-number", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxFocused: "spxFocused", spxStep: "spxStep", value: "value" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: `<div class="spx-input-number__controls">
973
710
  <input
974
711
  #input
975
712
  class="spx-input-number__input"
@@ -984,7 +721,7 @@ class SpxInputNumberComponent {
984
721
  (input)="this.handleInput($event)" />
985
722
  </div>`, isInline: true, styles: [":host{display:block}.spx-input-number__input{border:0;background-color:transparent;box-sizing:border-box;color:var(--spx-input--color, rgba(0, 0, 0, .9));font-size:20px;font-weight:700;margin-right:10px;padding:0;width:100%}.spx-input-number__input:focus{outline:none}.spx-input-number__value{color:#0009;font-size:14px}\n"] }); }
986
723
  }
987
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputNumberComponent, decorators: [{
724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputNumberComponent, decorators: [{
988
725
  type: Component,
989
726
  args: [{ selector: 'spx-input-number', imports: [], template: `<div class="spx-input-number__controls">
990
727
  <input
@@ -1094,38 +831,39 @@ class SpxInputRadioComponent {
1094
831
  }
1095
832
  });
1096
833
  }
1097
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1098
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: SpxInputRadioComponent, isStandalone: true, selector: "spx-input-radio", inputs: { spxName: "spxName", spxValidators: "spxValidators", spxFocused: "spxFocused", spxShowLabel: "spxShowLabel", spxReadonly: "spxReadonly", spxSuggestions: "spxSuggestions", value: "value" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, usesOnChanges: true, ngImport: i0, template: `<div class="grid grid-cols-2 gap-2" [class.mt-3]="this.spxShowLabel">
1099
- <spx-suggestion
1100
- *ngFor="let valuePair of this.cachedSuggestions; let i = index"
1101
- [spxDisabled]="this.spxReadonly"
1102
- [spxFocused]="this.spxFocused && i === this.focusPosition"
1103
- [spxSelected]="this.value?.value === valuePair?.value"
1104
- [spxTabbable]="this.focusPosition === i"
1105
- (click)="this.handleSuggestionClick($event, valuePair)">
1106
- {{valuePair?.description}}
1107
- </spx-suggestion>
1108
- </div>`, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxSuggestionComponent, selector: "spx-suggestion", inputs: ["spxDisabled", "spxFocused", "spxSelected", "spxTabbable"] }] }); }
834
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
835
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxInputRadioComponent, isStandalone: true, selector: "spx-input-radio", inputs: { spxName: "spxName", spxValidators: "spxValidators", spxFocused: "spxFocused", spxShowLabel: "spxShowLabel", spxReadonly: "spxReadonly", spxSuggestions: "spxSuggestions", value: "value" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, usesOnChanges: true, ngImport: i0, template: `<div class="grid grid-cols-2 gap-2" [class.mt-3]="this.spxShowLabel">
836
+ @for (valuePair of this.cachedSuggestions; track valuePair; let i = $index) {
837
+ <spx-suggestion
838
+ [spxDisabled]="this.spxReadonly"
839
+ [spxFocused]="this.spxFocused && i === this.focusPosition"
840
+ [spxSelected]="this.value?.value === valuePair?.value"
841
+ [spxTabbable]="this.focusPosition === i"
842
+ (click)="this.handleSuggestionClick($event, valuePair)">
843
+ {{valuePair?.description}}
844
+ </spx-suggestion>
845
+ }
846
+ </div>`, isInline: true, dependencies: [{ kind: "component", type: SpxSuggestionComponent, selector: "spx-suggestion", inputs: ["spxDisabled", "spxFocused", "spxSelected", "spxTabbable"] }] }); }
1109
847
  }
1110
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputRadioComponent, decorators: [{
848
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputRadioComponent, decorators: [{
1111
849
  type: Component,
1112
850
  args: [{
1113
851
  selector: 'spx-input-radio',
1114
852
  imports: [
1115
- NgFor,
1116
- SpxSuggestionComponent,
853
+ SpxSuggestionComponent
1117
854
  ],
1118
855
  template: `<div class="grid grid-cols-2 gap-2" [class.mt-3]="this.spxShowLabel">
1119
- <spx-suggestion
1120
- *ngFor="let valuePair of this.cachedSuggestions; let i = index"
1121
- [spxDisabled]="this.spxReadonly"
1122
- [spxFocused]="this.spxFocused && i === this.focusPosition"
1123
- [spxSelected]="this.value?.value === valuePair?.value"
1124
- [spxTabbable]="this.focusPosition === i"
1125
- (click)="this.handleSuggestionClick($event, valuePair)">
1126
- {{valuePair?.description}}
1127
- </spx-suggestion>
1128
- </div>`
856
+ @for (valuePair of this.cachedSuggestions; track valuePair; let i = $index) {
857
+ <spx-suggestion
858
+ [spxDisabled]="this.spxReadonly"
859
+ [spxFocused]="this.spxFocused && i === this.focusPosition"
860
+ [spxSelected]="this.value?.value === valuePair?.value"
861
+ [spxTabbable]="this.focusPosition === i"
862
+ (click)="this.handleSuggestionClick($event, valuePair)">
863
+ {{valuePair?.description}}
864
+ </spx-suggestion>
865
+ }
866
+ </div>`
1129
867
  }]
1130
868
  }], propDecorators: { spxName: [{
1131
869
  type: Input
@@ -1183,89 +921,101 @@ class SpxInputTimeModalComponent {
1183
921
  console.log(value);
1184
922
  this.modalController.dismiss(value);
1185
923
  }
1186
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputTimeModalComponent, deps: [{ token: i1$1.ModalController }], target: i0.ɵɵFactoryTarget.Component }); }
1187
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: SpxInputTimeModalComponent, isStandalone: true, selector: "spx-input-time-modal", inputs: { view: "view", value: "value" }, outputs: { change: "change" }, ngImport: i0, template: `<ion-header>
1188
- <ion-toolbar>
1189
- <ion-title>Select {{view}}</ion-title>
1190
- <ion-buttons slot="end">
1191
- <spx-button [spxSeverity]="typeError" (spxClick)="closeDialog()">
1192
- <fa-icon [icon]="faXmark"></fa-icon>
1193
- </spx-button>
1194
- </ion-buttons>
1195
- </ion-toolbar>
1196
- </ion-header>
1197
- <ion-content class="ion-padding bg-white">
1198
- <!-- Uren -->
1199
- <div class="custom-bg grid grid-cols-1 gap-3">
1200
- <div *ngIf="view === 'hours'" class="flex-wrap gap-2">
1201
- <div class="grid grid-cols-3 md:grid-cols-4 gap-3">
1202
- <div *ngFor="let hour of hourOptions" class="text-center font-bold custom-square rounded text-gray-900 text-lg p-3 w-full truncate outline-none bg-sky-100 focus:ring-sky-300 hover:bg-sky-300 active:bg-sky-300" [class.selected]="value === hour" (click)="onChange(hour)">
1203
- {{ hour }}
924
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputTimeModalComponent, deps: [{ token: i1$2.ModalController }], target: i0.ɵɵFactoryTarget.Component }); }
925
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxInputTimeModalComponent, isStandalone: true, selector: "spx-input-time-modal", inputs: { view: "view", value: "value" }, outputs: { change: "change" }, ngImport: i0, template: `<ion-header>
926
+ <ion-toolbar>
927
+ <ion-title>Select {{view}}</ion-title>
928
+ <ion-buttons slot="end">
929
+ <spx-button [spxSeverity]="typeError" (spxClick)="closeDialog()">
930
+ <fa-icon [icon]="faXmark"></fa-icon>
931
+ </spx-button>
932
+ </ion-buttons>
933
+ </ion-toolbar>
934
+ </ion-header>
935
+ <ion-content class="ion-padding bg-white">
936
+ <!-- Uren -->
937
+ <div class="custom-bg grid grid-cols-1 gap-3">
938
+ @if (view === 'hours') {
939
+ <div class="flex-wrap gap-2">
940
+ <div class="grid grid-cols-3 md:grid-cols-4 gap-3">
941
+ @for (hour of hourOptions; track hour) {
942
+ <div class="text-center font-bold custom-square rounded text-gray-900 text-lg p-3 w-full truncate outline-none bg-sky-100 focus:ring-sky-300 hover:bg-sky-300 active:bg-sky-300" [class.selected]="value === hour" (click)="onChange(hour)">
943
+ {{ hour }}
944
+ </div>
945
+ }
946
+ </div>
1204
947
  </div>
1205
- </div>
1206
- </div>
1207
- <!-- Minuten -->
1208
- <div *ngIf="view === 'minutes'" class="grid grid-cols-1 gap-3">
1209
- <div class="grid grid-cols-4 md:grid-cols-5 gap-3">
1210
- <div *ngFor="let minute of minuteOptions" class="text-center font-bold custom-square rounded text-gray-900 text-lg p-3 w-ful truncate outline-none bg-sky-100 focus:ring-sky-300 hover:bg-sky-300 active:bg-sky-300" [class.selected]="value === minute" (click)="onChange(minute)">
1211
- {{ minute }}
948
+ }
949
+ <!-- Minuten -->
950
+ @if (view === 'minutes') {
951
+ <div class="grid grid-cols-1 gap-3">
952
+ <div class="grid grid-cols-4 md:grid-cols-5 gap-3">
953
+ @for (minute of minuteOptions; track minute) {
954
+ <div class="text-center font-bold custom-square rounded text-gray-900 text-lg p-3 w-ful truncate outline-none bg-sky-100 focus:ring-sky-300 hover:bg-sky-300 active:bg-sky-300" [class.selected]="value === minute" (click)="onChange(minute)">
955
+ {{ minute }}
956
+ </div>
957
+ }
958
+ </div>
1212
959
  </div>
1213
- </div>
960
+ }
1214
961
  </div>
1215
- </div>
1216
- </ion-content>
1217
- `, isInline: true, dependencies: [{ kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }] }); }
962
+ </ion-content>
963
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }] }); }
1218
964
  }
1219
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputTimeModalComponent, decorators: [{
965
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputTimeModalComponent, decorators: [{
1220
966
  type: Component,
1221
967
  args: [{
1222
968
  selector: 'spx-input-time-modal',
1223
969
  imports: [
1224
- IonButton,
970
+ FontAwesomeModule,
1225
971
  IonButtons,
1226
972
  IonContent,
1227
973
  IonHeader,
1228
974
  IonTitle,
1229
975
  IonToolbar,
1230
- NgIf,
1231
- NgFor,
1232
976
  SpxButtonComponent,
1233
- SpxDropdownComponent,
1234
- FontAwesomeModule,
1235
977
  ],
1236
978
  template: `<ion-header>
1237
- <ion-toolbar>
1238
- <ion-title>Select {{view}}</ion-title>
1239
- <ion-buttons slot="end">
1240
- <spx-button [spxSeverity]="typeError" (spxClick)="closeDialog()">
1241
- <fa-icon [icon]="faXmark"></fa-icon>
1242
- </spx-button>
1243
- </ion-buttons>
1244
- </ion-toolbar>
1245
- </ion-header>
1246
- <ion-content class="ion-padding bg-white">
1247
- <!-- Uren -->
1248
- <div class="custom-bg grid grid-cols-1 gap-3">
1249
- <div *ngIf="view === 'hours'" class="flex-wrap gap-2">
1250
- <div class="grid grid-cols-3 md:grid-cols-4 gap-3">
1251
- <div *ngFor="let hour of hourOptions" class="text-center font-bold custom-square rounded text-gray-900 text-lg p-3 w-full truncate outline-none bg-sky-100 focus:ring-sky-300 hover:bg-sky-300 active:bg-sky-300" [class.selected]="value === hour" (click)="onChange(hour)">
1252
- {{ hour }}
979
+ <ion-toolbar>
980
+ <ion-title>Select {{view}}</ion-title>
981
+ <ion-buttons slot="end">
982
+ <spx-button [spxSeverity]="typeError" (spxClick)="closeDialog()">
983
+ <fa-icon [icon]="faXmark"></fa-icon>
984
+ </spx-button>
985
+ </ion-buttons>
986
+ </ion-toolbar>
987
+ </ion-header>
988
+ <ion-content class="ion-padding bg-white">
989
+ <!-- Uren -->
990
+ <div class="custom-bg grid grid-cols-1 gap-3">
991
+ @if (view === 'hours') {
992
+ <div class="flex-wrap gap-2">
993
+ <div class="grid grid-cols-3 md:grid-cols-4 gap-3">
994
+ @for (hour of hourOptions; track hour) {
995
+ <div class="text-center font-bold custom-square rounded text-gray-900 text-lg p-3 w-full truncate outline-none bg-sky-100 focus:ring-sky-300 hover:bg-sky-300 active:bg-sky-300" [class.selected]="value === hour" (click)="onChange(hour)">
996
+ {{ hour }}
997
+ </div>
998
+ }
999
+ </div>
1253
1000
  </div>
1254
- </div>
1255
- </div>
1256
- <!-- Minuten -->
1257
- <div *ngIf="view === 'minutes'" class="grid grid-cols-1 gap-3">
1258
- <div class="grid grid-cols-4 md:grid-cols-5 gap-3">
1259
- <div *ngFor="let minute of minuteOptions" class="text-center font-bold custom-square rounded text-gray-900 text-lg p-3 w-ful truncate outline-none bg-sky-100 focus:ring-sky-300 hover:bg-sky-300 active:bg-sky-300" [class.selected]="value === minute" (click)="onChange(minute)">
1260
- {{ minute }}
1001
+ }
1002
+ <!-- Minuten -->
1003
+ @if (view === 'minutes') {
1004
+ <div class="grid grid-cols-1 gap-3">
1005
+ <div class="grid grid-cols-4 md:grid-cols-5 gap-3">
1006
+ @for (minute of minuteOptions; track minute) {
1007
+ <div class="text-center font-bold custom-square rounded text-gray-900 text-lg p-3 w-ful truncate outline-none bg-sky-100 focus:ring-sky-300 hover:bg-sky-300 active:bg-sky-300" [class.selected]="value === minute" (click)="onChange(minute)">
1008
+ {{ minute }}
1009
+ </div>
1010
+ }
1011
+ </div>
1261
1012
  </div>
1262
- </div>
1013
+ }
1263
1014
  </div>
1264
- </div>
1265
- </ion-content>
1266
- `
1015
+ </ion-content>
1016
+ `
1267
1017
  }]
1268
- }], ctorParameters: () => [{ type: i1$1.ModalController }], propDecorators: { view: [{
1018
+ }], ctorParameters: () => [{ type: i1$2.ModalController }], propDecorators: { view: [{
1269
1019
  type: Input
1270
1020
  }], value: [{
1271
1021
  type: Input
@@ -1370,8 +1120,8 @@ class SpxInputTimeComponent {
1370
1120
  this.spxChange.emit(this.value);
1371
1121
  }
1372
1122
  }
1373
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputTimeComponent, deps: [{ token: i1$1.ModalController }], target: i0.ɵɵFactoryTarget.Component }); }
1374
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: SpxInputTimeComponent, isStandalone: true, selector: "spx-input-time", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxPattern: "spxPattern", spxSuggestions: "spxSuggestions", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxCapitalize: "spxCapitalize", spxFocused: "spxFocused", spxType: "spxType", value: "value", spxWasInternalUpdate: "spxWasInternalUpdate" }, outputs: { spxBlurFromChild: "spxBlurFromChild", spxChange: "spxChange", spxFocus: "spxFocus" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: `<div class="relative text-black">
1123
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputTimeComponent, deps: [{ token: i1$3.ModalController }], target: i0.ɵɵFactoryTarget.Component }); }
1124
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SpxInputTimeComponent, isStandalone: true, selector: "spx-input-time", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxPattern: "spxPattern", spxSuggestions: "spxSuggestions", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxCapitalize: "spxCapitalize", spxFocused: "spxFocused", spxType: "spxType", value: "value", spxWasInternalUpdate: "spxWasInternalUpdate" }, outputs: { spxBlurFromChild: "spxBlurFromChild", spxChange: "spxChange", spxFocus: "spxFocus" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: `<div class="relative text-black">
1375
1125
  <div class="flex items-center justify-around gap-3">
1376
1126
  <div class="grow rounded bg-gray-100 p-3 text-xl text-center font-bold" (click)="openDialog('hours')">{{ formattedHour ?? '--' }}</div>
1377
1127
  <div class="text-gray text-xl">:</div>
@@ -1379,21 +1129,16 @@ class SpxInputTimeComponent {
1379
1129
  </div>
1380
1130
  </div>`, isInline: true, styles: [".custom-square.selected{background-color:#007bff;color:#fff;border-color:#007bff}.custom-bg{--background: #FFFFFF}\n"] }); }
1381
1131
  }
1382
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputTimeComponent, decorators: [{
1132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputTimeComponent, decorators: [{
1383
1133
  type: Component,
1384
- args: [{ selector: 'spx-input-time', imports: [
1385
- NgIf,
1386
- NgFor,
1387
- SpxButtonComponent,
1388
- SpxDropdownComponent,
1389
- ], template: `<div class="relative text-black">
1134
+ args: [{ selector: 'spx-input-time', imports: [], template: `<div class="relative text-black">
1390
1135
  <div class="flex items-center justify-around gap-3">
1391
1136
  <div class="grow rounded bg-gray-100 p-3 text-xl text-center font-bold" (click)="openDialog('hours')">{{ formattedHour ?? '--' }}</div>
1392
1137
  <div class="text-gray text-xl">:</div>
1393
1138
  <div class="grow rounded bg-gray-100 p-3 text-xl text-center font-bold" (click)="openDialog('minutes')">{{ formattedMinute ?? '--' }}</div>
1394
1139
  </div>
1395
1140
  </div>`, styles: [".custom-square.selected{background-color:#007bff;color:#fff;border-color:#007bff}.custom-bg{--background: #FFFFFF}\n"] }]
1396
- }], ctorParameters: () => [{ type: i1$1.ModalController }], propDecorators: { spxName: [{
1141
+ }], ctorParameters: () => [{ type: i1$3.ModalController }], propDecorators: { spxName: [{
1397
1142
  type: Input
1398
1143
  }], spxAutofocus: [{
1399
1144
  type: Input
@@ -1428,6 +1173,193 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
1428
1173
  args: ['input', { static: true }]
1429
1174
  }] } });
1430
1175
 
1176
+ var stepType;
1177
+ (function (stepType) {
1178
+ stepType["years"] = "years";
1179
+ stepType["months"] = "months";
1180
+ stepType["days"] = "days";
1181
+ })(stepType || (stepType = {}));
1182
+ class SpxInputDateComponent {
1183
+ constructor() {
1184
+ this.spxMax = input.required();
1185
+ this.spxMin = input.required();
1186
+ this.spxReadonly = input();
1187
+ this.spxValidators = input();
1188
+ this.value = model({
1189
+ description: "",
1190
+ value: "",
1191
+ });
1192
+ this.spxChange = output();
1193
+ this.spxFocused = input(true);
1194
+ this.spxFocus = output();
1195
+ this.spxSelectedStep = signal(stepType.years);
1196
+ this.spxSelectDay = input(false);
1197
+ this.spxSelectMonth = input(true);
1198
+ this.selectedYear = signal(null);
1199
+ this.selectedMonth = signal(null);
1200
+ this.selectedDay = signal(null);
1201
+ this.yearInputComponent = viewChild.required(stepType.years);
1202
+ this.monthInputComponent = viewChild.required(stepType.months);
1203
+ this.dayInputComponent = viewChild.required(stepType.days);
1204
+ this.spxSuggestionC = computed(() => {
1205
+ switch (this.spxSelectedStep()) {
1206
+ case stepType.years:
1207
+ return this.spxSuggestions().years;
1208
+ case stepType.months:
1209
+ return [...this.spxSuggestions().months];
1210
+ case stepType.days:
1211
+ return [...this.spxSuggestions().days];
1212
+ }
1213
+ });
1214
+ this.spxSuggestions = input({ years: [],
1215
+ months: [{
1216
+ description: 'Jan',
1217
+ value: 1,
1218
+ }, {
1219
+ description: 'Feb',
1220
+ value: 2,
1221
+ }, {
1222
+ description: 'Mar',
1223
+ value: 3,
1224
+ }, {
1225
+ description: 'Apr',
1226
+ value: 4,
1227
+ }, {
1228
+ description: 'May',
1229
+ value: 5,
1230
+ }, {
1231
+ description: 'Jun',
1232
+ value: 6,
1233
+ }, {
1234
+ description: 'Jul',
1235
+ value: 7,
1236
+ }, {
1237
+ description: 'Aug',
1238
+ value: 8,
1239
+ }, {
1240
+ description: 'Sep',
1241
+ value: 9,
1242
+ }, {
1243
+ description: 'Oct',
1244
+ value: 10,
1245
+ }, {
1246
+ description: 'Nov',
1247
+ value: 11,
1248
+ }, {
1249
+ description: 'Dec',
1250
+ value: 12,
1251
+ }],
1252
+ days: [], });
1253
+ }
1254
+ handleFocus(selectedStep) {
1255
+ switch (selectedStep) {
1256
+ case stepType.years:
1257
+ this.spxSelectedStep.set(stepType.years);
1258
+ break;
1259
+ case stepType.months:
1260
+ this.spxSelectedStep.set(stepType.months);
1261
+ this.monthInputComponent().nativeElement.focus();
1262
+ break;
1263
+ case stepType.days:
1264
+ this.spxSelectedStep.set(stepType.days);
1265
+ this.dayInputComponent().nativeElement.focus();
1266
+ break;
1267
+ }
1268
+ }
1269
+ onModelChange(newValue, selectedStep) {
1270
+ const parsedValue = +newValue; // Convert to number
1271
+ if (parsedValue == 0)
1272
+ return;
1273
+ switch (selectedStep) {
1274
+ case stepType.years:
1275
+ this.selectedYear.set(parsedValue);
1276
+ break;
1277
+ case stepType.months:
1278
+ this.selectedMonth.set(parsedValue);
1279
+ break;
1280
+ case stepType.days:
1281
+ this.selectedDay.set(parsedValue);
1282
+ break;
1283
+ }
1284
+ }
1285
+ ngOnInit() {
1286
+ this.suggestYears();
1287
+ if (valuePairToValue(this.value)) {
1288
+ const parsedValue = DateTime.fromISO(valuePairToValue(this.value));
1289
+ this.selectedYear.set(parsedValue.year);
1290
+ this.selectedMonth.set(parsedValue.month);
1291
+ this.selectedDay.set(parsedValue.day);
1292
+ }
1293
+ }
1294
+ handleSuggestionClick(value) {
1295
+ switch (this.spxSelectedStep()) {
1296
+ case stepType.years:
1297
+ this.selectedYear.set(value);
1298
+ break;
1299
+ case stepType.months:
1300
+ this.selectedMonth.set(value);
1301
+ break;
1302
+ case stepType.days:
1303
+ this.selectedDay.set(value);
1304
+ break;
1305
+ }
1306
+ this.updateValueAndEmit();
1307
+ this.changeSelectedStep();
1308
+ }
1309
+ updateValueAndEmit() {
1310
+ const concatenatedValue = `${this.selectedYear() ? this.selectedYear() : ``}${this.selectedMonth() ? `${this.selectedMonth() < 10 ? `0${this.selectedMonth()}` : this.selectedMonth()}` : ``}${this.selectedDay() ? `-${this.selectedDay() < 10 ? `0${this.selectedDay()}` : this.selectedDay()}` : ``}`;
1311
+ const parsedValue = DateTime.fromISO(concatenatedValue);
1312
+ this.value.set({ value: parsedValue.toISO(), description: parsedValue.toISO() });
1313
+ this.spxChange.emit(this.value());
1314
+ }
1315
+ changeSelectedStep() {
1316
+ switch (this.spxSelectedStep()) {
1317
+ case stepType.years:
1318
+ if (this.spxSelectMonth()) {
1319
+ this.spxSelectedStep.set(stepType.months);
1320
+ this.monthInputComponent().nativeElement.focus();
1321
+ }
1322
+ else {
1323
+ this.spxSelectedStep.set(stepType.years);
1324
+ this.yearInputComponent().nativeElement.focus();
1325
+ }
1326
+ break;
1327
+ case stepType.months:
1328
+ if (this.spxSelectDay()) {
1329
+ this.spxSelectedStep.set(stepType.days);
1330
+ this.dayInputComponent().nativeElement.focus();
1331
+ }
1332
+ else {
1333
+ this.spxSelectedStep.set(stepType.years);
1334
+ this.yearInputComponent().nativeElement.focus();
1335
+ }
1336
+ break;
1337
+ case stepType.days:
1338
+ this.spxSelectedStep.set(stepType.years);
1339
+ this.yearInputComponent().nativeElement.focus();
1340
+ break;
1341
+ }
1342
+ }
1343
+ suggestYears() {
1344
+ this.spxSuggestions().years = [];
1345
+ for (let year = DateTime.fromISO(this.spxMin()).year; year <= DateTime.fromISO(this.spxMax()).year; year++) {
1346
+ this.spxSuggestions().years.push({
1347
+ description: `'${year.toString().substring(2, 4)}`,
1348
+ value: year,
1349
+ });
1350
+ }
1351
+ }
1352
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1353
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxInputDateComponent, isStandalone: true, selector: "spx-input-date", inputs: { spxMax: { classPropertyName: "spxMax", publicName: "spxMax", isSignal: true, isRequired: true, transformFunction: null }, spxMin: { classPropertyName: "spxMin", publicName: "spxMin", isSignal: true, isRequired: true, transformFunction: null }, spxReadonly: { classPropertyName: "spxReadonly", publicName: "spxReadonly", isSignal: true, isRequired: false, transformFunction: null }, spxValidators: { classPropertyName: "spxValidators", publicName: "spxValidators", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, spxFocused: { classPropertyName: "spxFocused", publicName: "spxFocused", isSignal: true, isRequired: false, transformFunction: null }, spxSelectDay: { classPropertyName: "spxSelectDay", publicName: "spxSelectDay", isSignal: true, isRequired: false, transformFunction: null }, spxSelectMonth: { classPropertyName: "spxSelectMonth", publicName: "spxSelectMonth", isSignal: true, isRequired: false, transformFunction: null }, spxSuggestions: { classPropertyName: "spxSuggestions", publicName: "spxSuggestions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", spxChange: "spxChange", spxFocus: "spxFocus" }, viewQueries: [{ propertyName: "yearInputComponent", first: true, predicate: stepType.years, descendants: true, isSignal: true }, { propertyName: "monthInputComponent", first: true, predicate: stepType.months, descendants: true, isSignal: true }, { propertyName: "dayInputComponent", first: true, predicate: stepType.days, descendants: true, isSignal: true }], ngImport: i0, template: "<div class='spx-input-date__controls'>\n <input #years\n class='spx-input-date__input'\n [(ngModel)]=\"selectedYear\"\n [attr.type]=\"'number'\"\n (click)=\"this.handleFocus('years')\"\n (ngModelChange)=\"onModelChange($event, 'years')\"\n [attr.min]=\"1900\"\n [attr.max]=\"2100\"\n [attr.step]=\"1\"\n />\n <div class='spx-input-date__control-label'>Year</div>\n @if (this.spxSelectMonth()) {\n <input #months\n class='spx-input-date__input'\n [(ngModel)]=\"selectedMonth\"\n (ngModelChange)=\"onModelChange($event, 'months')\"\n (click)=\"this.handleFocus('months')\"\n [attr.type]=\"'number'\"\n [attr.min]=\"1\"\n [attr.max]=\"12\"\n [attr.step]=\"1\" />\n }\n <div class='spx-input-date__control-label'>Month</div>\n @if (this.spxSelectDay()) {\n <input #days\n class='spx-input-date__input'\n [(ngModel)]=\"selectedDay\"\n (ngModelChange)=\"onModelChange($event, 'days')\"\n (click)=\"this.handleFocus('days')\"\n [attr.type]=\"'number'\"\n [attr.min]=\"1\"\n [attr.max]=\"31\"\n [attr.step]=\"1\" />\n <div class='spx-input-date__control-label'>Days</div>\n }\n</div>\n<div class='spx-input-date__suggestions'>\n @for (valuePair of spxSuggestionC(); track valuePair.value) {\n <spx-suggestion [spxSelected]=\"\n (selectedYear() === valuePair.value) ||\n (selectedMonth() === valuePair.value) || \n (selectedDay() === valuePair.value)\"\n (click)=\"this.handleSuggestionClick(valuePair.value)\">{{valuePair?.description}}</spx-suggestion>\n }\n</div>", styles: [":host{display:block}.spx-input-date__input{background-color:transparent;border:1px solid #979797;border-radius:4px;color:var(--spx-input--color, rgba(0, 0, 0, .9));box-sizing:border-box;font-size:16px;margin-right:10px;padding:6px;text-align:center;width:100%}.spx-input-date__input:active{transform:scale(.95)}.spx-input-date__input:focus{border:var(--spx-input-box--focus--border, 1px solid rgb(115, 168, 210));border-radius:4px;outline:none}.spx-input-date__control-label{align-items:center;color:#000000b3;display:inline-grid;font-size:13px;letter-spacing:1px}.spx-input-date__input::-webkit-outer-spin-button,.spx-input-date__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.spx-input-date__input[type=number]{-moz-appearance:textfield}.spx-input-date__suggestions,.spx-input-date__controls{display:grid;grid-gap:8px;grid-template-columns:repeat(4,1fr);margin-top:8px}\n"], dependencies: [{ kind: "component", type: SpxSuggestionComponent, selector: "spx-suggestion", inputs: ["spxDisabled", "spxFocused", "spxSelected", "spxTabbable"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
1354
+ }
1355
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputDateComponent, decorators: [{
1356
+ type: Component,
1357
+ args: [{ selector: 'spx-input-date', imports: [
1358
+ SpxSuggestionComponent,
1359
+ FormsModule
1360
+ ], template: "<div class='spx-input-date__controls'>\n <input #years\n class='spx-input-date__input'\n [(ngModel)]=\"selectedYear\"\n [attr.type]=\"'number'\"\n (click)=\"this.handleFocus('years')\"\n (ngModelChange)=\"onModelChange($event, 'years')\"\n [attr.min]=\"1900\"\n [attr.max]=\"2100\"\n [attr.step]=\"1\"\n />\n <div class='spx-input-date__control-label'>Year</div>\n @if (this.spxSelectMonth()) {\n <input #months\n class='spx-input-date__input'\n [(ngModel)]=\"selectedMonth\"\n (ngModelChange)=\"onModelChange($event, 'months')\"\n (click)=\"this.handleFocus('months')\"\n [attr.type]=\"'number'\"\n [attr.min]=\"1\"\n [attr.max]=\"12\"\n [attr.step]=\"1\" />\n }\n <div class='spx-input-date__control-label'>Month</div>\n @if (this.spxSelectDay()) {\n <input #days\n class='spx-input-date__input'\n [(ngModel)]=\"selectedDay\"\n (ngModelChange)=\"onModelChange($event, 'days')\"\n (click)=\"this.handleFocus('days')\"\n [attr.type]=\"'number'\"\n [attr.min]=\"1\"\n [attr.max]=\"31\"\n [attr.step]=\"1\" />\n <div class='spx-input-date__control-label'>Days</div>\n }\n</div>\n<div class='spx-input-date__suggestions'>\n @for (valuePair of spxSuggestionC(); track valuePair.value) {\n <spx-suggestion [spxSelected]=\"\n (selectedYear() === valuePair.value) ||\n (selectedMonth() === valuePair.value) || \n (selectedDay() === valuePair.value)\"\n (click)=\"this.handleSuggestionClick(valuePair.value)\">{{valuePair?.description}}</spx-suggestion>\n }\n</div>", styles: [":host{display:block}.spx-input-date__input{background-color:transparent;border:1px solid #979797;border-radius:4px;color:var(--spx-input--color, rgba(0, 0, 0, .9));box-sizing:border-box;font-size:16px;margin-right:10px;padding:6px;text-align:center;width:100%}.spx-input-date__input:active{transform:scale(.95)}.spx-input-date__input:focus{border:var(--spx-input-box--focus--border, 1px solid rgb(115, 168, 210));border-radius:4px;outline:none}.spx-input-date__control-label{align-items:center;color:#000000b3;display:inline-grid;font-size:13px;letter-spacing:1px}.spx-input-date__input::-webkit-outer-spin-button,.spx-input-date__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.spx-input-date__input[type=number]{-moz-appearance:textfield}.spx-input-date__suggestions,.spx-input-date__controls{display:grid;grid-gap:8px;grid-template-columns:repeat(4,1fr);margin-top:8px}\n"] }]
1361
+ }] });
1362
+
1431
1363
  class SpxInputComponent {
1432
1364
  constructor() {
1433
1365
  this.spxLabel = 'label';
@@ -1482,14 +1414,18 @@ class SpxInputComponent {
1482
1414
  this.spxSearch.emit();
1483
1415
  }
1484
1416
  setFocusIn() {
1485
- this.spxFocused = true;
1486
- this.passFocusToControl();
1417
+ setTimeout(() => {
1418
+ this.spxFocused = true;
1419
+ this.passFocusToControl();
1420
+ }, 0);
1487
1421
  }
1488
1422
  setFocusOut() {
1489
- this.spxFocused = false;
1490
- if (this.spxType === SpxInputTypeEnum.radio) {
1491
- this.radioInput?.spxFocusOut();
1492
- }
1423
+ setTimeout(() => {
1424
+ this.spxFocused = false;
1425
+ if (this.spxType === SpxInputTypeEnum.radio) {
1426
+ this.radioInput?.spxFocusOut();
1427
+ }
1428
+ }, 0);
1493
1429
  }
1494
1430
  handleEdit() {
1495
1431
  this.spxEdit.emit();
@@ -1518,7 +1454,7 @@ class SpxInputComponent {
1518
1454
  }
1519
1455
  }
1520
1456
  writeValue(value) {
1521
- this.value = this.lastValue = value;
1457
+ this.value = this.lastValue = value; // hier komt initiele waarde van formcontrol binnen
1522
1458
  }
1523
1459
  handleChangeEvent(value) {
1524
1460
  if (value !== this.lastValue) {
@@ -1530,124 +1466,130 @@ class SpxInputComponent {
1530
1466
  this.onTouched();
1531
1467
  }
1532
1468
  registerOnChange(fn) {
1533
- this.onChange = fn;
1469
+ this.onChange = fn; // emit verandering aan formcontrol
1534
1470
  }
1535
1471
  registerOnTouched(fn) {
1536
1472
  this.onTouched = fn;
1537
1473
  }
1538
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1539
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: SpxInputComponent, isStandalone: true, selector: "spx-input", inputs: { spxLabel: "spxLabel", spxMax: "spxMax", spxMin: "spxMin", spxName: "spxName", spxReadonly: "spxReadonly", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxPattern: "spxPattern", spxRequired: "spxRequired", spxSelectMonth: "spxSelectMonth", spxSelectDay: "spxSelectDay", spxShowEdit: "spxShowEdit", spxShowHelp: "spxShowHelp", spxShowLabel: "spxShowLabel", spxCompact: "spxCompact", spxShowClear: "spxShowClear", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxStep: "spxStep", spxSuggestions: "spxSuggestions", spxType: "spxType", spxValidators: "spxValidators", value: "value", spxCapitalize: "spxCapitalize", spxFocused: "spxFocused" }, outputs: { spxBlur: "spxBlur", spxClear: "spxClear", spxChange: "spxChange", spxFocus: "spxFocus", spxEdit: "spxEdit", spxHelp: "spxHelp", spxSearch: "spxSearch" }, host: { listeners: { "spxChange": "handleChangeEvent($event)", "focusout": "_handleBlurEvent()" } }, providers: [
1474
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1475
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxInputComponent, isStandalone: true, selector: "spx-input", inputs: { spxLabel: "spxLabel", spxMax: "spxMax", spxMin: "spxMin", spxName: "spxName", spxReadonly: "spxReadonly", spxAutocomplete: "spxAutocomplete", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxPattern: "spxPattern", spxRequired: "spxRequired", spxSelectMonth: "spxSelectMonth", spxSelectDay: "spxSelectDay", spxShowEdit: "spxShowEdit", spxShowHelp: "spxShowHelp", spxShowLabel: "spxShowLabel", spxCompact: "spxCompact", spxShowClear: "spxShowClear", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxStep: "spxStep", spxSuggestions: "spxSuggestions", spxType: "spxType", spxValidators: "spxValidators", value: "value", spxCapitalize: "spxCapitalize", spxFocused: "spxFocused" }, outputs: { spxBlur: "spxBlur", spxClear: "spxClear", spxChange: "spxChange", spxFocus: "spxFocus", spxEdit: "spxEdit", spxHelp: "spxHelp", spxSearch: "spxSearch" }, host: { listeners: { "spxChange": "handleChangeEvent($event)", "focusout": "_handleBlurEvent()" } }, providers: [
1540
1476
  {
1541
1477
  provide: NG_VALUE_ACCESSOR,
1542
1478
  useExisting: SpxInputComponent,
1543
1479
  multi: true
1544
1480
  }
1545
1481
  ], viewQueries: [{ propertyName: "floatInput", first: true, predicate: SpxInputFloatComponent, descendants: true }, { propertyName: "numberInput", first: true, predicate: SpxInputNumberComponent, descendants: true }, { propertyName: "textInput", first: true, predicate: SpxInputTextComponent, descendants: true }, { propertyName: "timeInput", first: true, predicate: SpxInputTimeComponent, descendants: true }, { propertyName: "radioInput", first: true, predicate: SpxInputRadioComponent, descendants: true }], ngImport: i0, template: `<spx-input-box
1546
- [spxFocused]="this.spxFocused"
1547
- [spxLabel]="this.spxLabel"
1548
- [spxReadonly]="this.spxReadonly"
1549
- [spxRequired]="this.spxRequired"
1550
- [spxValue]="this.value"
1551
- [spxShowHelp]="this.spxShowHelp"
1552
- [spxCompact]="this.spxCompact"
1553
- [spxShowClear]="this.spxShowClear"
1554
- [spxShowEdit]="this.spxShowEdit"
1555
- [spxShowLabel]="this.spxShowLabel"
1556
- [spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
1557
- [spxShowValidationMessages]="this.spxShowValidationMessages"
1558
- (spxClear)="this.handleClear()"
1559
- (spxEdit)="this.handleEdit()"
1560
- (spxHelp)="this.handleHelp()"
1561
- (spxFocus)="this.setFocusIn()"
1562
- (spxFocusOut)="this.setFocusOut()"
1563
- (spxSearch)="this.handleSearch()">
1564
- <div controls>
1565
- <spx-input-text
1566
- *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
1567
- (spxBlurFromChild)="this.handleBlur()"
1568
- (spxChange)="this.handleChange($event)"
1569
- (spxFocus)="this.handleFocus()"
1570
- [spxAutofocus]="this.spxAutofocus"
1571
- [spxCapitalize]="this.spxCapitalize"
1572
- [spxFocused]="this.spxFocused"
1573
- [spxInputMode]="this.spxType === 'overlaynumber' ? 'numeric' : this.spxInputMode"
1574
- [spxName]="this.spxName"
1575
- [spxPattern]="this.spxType === 'overlaynumber' ? '[0-9]*' : this.spxPattern"
1576
- [spxReadonly]="this.spxReadonly"
1577
- [spxSuggestions]="this.spxSuggestions"
1578
- [spxType]="this.spxType"
1579
- [spxValidators]="this.spxValidators"
1580
- [value]="this.value"
1581
- ></spx-input-text>
1582
- <spx-input-date
1583
- *ngIf="this.spxType === 'date'"
1584
- (spxChange)="this.handleChange($event)"
1585
- (spxFocus)="this.handleFocus()"
1586
- [spxFocused]="this.spxFocused"
1587
- [spxMax]="this.spxMax"
1588
- [spxMin]="this.spxMin"
1589
- [spxName]="this.spxName"
1590
- [spxReadonly]="this.spxReadonly"
1591
- [spxSelectDay]="this.spxSelectDay"
1592
- [spxSelectMonth]="this.spxSelectMonth"
1593
- [spxValidators]="this.spxValidators"
1594
- [value]="this.value"
1595
- ></spx-input-date>
1596
- <spx-input-float
1597
- *ngIf="this.spxType === 'float'"
1598
- (spxChange)="this.handleChange($event)"
1599
- (spxFocus)="this.handleFocus()"
1600
- [spxAutofocus]="this.spxAutofocus"
1601
- [spxFocused]="this.spxFocused"
1602
- [spxName]="this.spxName"
1603
- [spxReadonly]="this.spxReadonly"
1604
- [spxStep]="this.spxStep"
1605
- [spxValidators]="this.spxValidators"
1606
- [value]="this.value"
1607
- ></spx-input-float>
1608
- <spx-input-number
1609
- *ngIf="this.spxType === 'number'"
1610
- (spxChange)="this.handleChange($event)"
1611
- (spxFocus)="this.handleFocus()"
1612
- [spxAutofocus]="this.spxAutofocus"
1613
- [spxFocused]="this.spxFocused"
1614
- [spxInputMode]="this.spxInputMode"
1615
- [spxName]="this.spxName"
1616
- [spxReadonly]="this.spxReadonly"
1617
- [spxStep]="this.spxStep"
1618
- [spxValidators]="this.spxValidators"
1619
- [value]="this.value"
1620
- ></spx-input-number>
1621
- <spx-input-radio
1622
- #radioInput
1623
- *ngIf="this.spxType === 'radio'"
1624
- (spxChange)="this.handleChange($event)"
1625
- [spxFocused]="this.spxFocused"
1626
- [spxName]="this.spxName"
1627
- [spxReadonly]="this.spxReadonly"
1628
- [spxShowLabel]="this.spxShowLabel"
1629
- [spxSuggestions]="this.spxSuggestions"
1630
- [spxValidators]="this.spxValidators"
1631
- [value]="this.value"
1632
- ></spx-input-radio>
1633
- <spx-input-time
1634
- #timeInput
1635
- *ngIf="this.spxType === 'time'"
1636
- (spxChange)="this.handleChange($event)"
1637
- (spxFocus)="this.handleFocus()"
1638
- [spxFocused]="this.spxFocused"
1639
- [spxName]="this.spxName"
1640
- [spxReadonly]="this.spxReadonly"
1641
- [spxValidators]="this.spxValidators"
1642
- [value]="this.value"
1643
- ></spx-input-time>
1644
- </div>
1645
- <div validation-messages>
1646
- <ng-content></ng-content>
1647
- </div>
1648
- </spx-input-box>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SpxInputBoxComponent, selector: "spx-input-box", inputs: ["spxCompact", "spxFocused", "spxLabel", "spxReadonly", "spxRequired", "spxShowClear", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxShowSearch", "spxShowValidationMessages", "spxValue"], outputs: ["spxClear", "spxSearch", "spxFocus", "spxFocusOut", "spxEdit", "spxHelp"] }, { kind: "component", type: SpxInputDateComponent, selector: "spx-input-date", inputs: ["spxMax", "spxMin", "spxName", "spxReadonly", "spxValidators", "spxFocused", "spxSelectMonth", "spxSelectDay", "value", "spxLastKeyPressed", "spxSelectStep", "spxInternalValue", "spxSuggestions", "spxWasInternalUpdate"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputFloatComponent, selector: "spx-input-float", inputs: ["spxName", "spxAutofocus", "spxReadonly", "spxValidators", "spxFocused", "spxStep", "value", "spxWasInternalUpdate", "tick"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputNumberComponent, selector: "spx-input-number", inputs: ["spxName", "spxAutofocus", "spxInputMode", "spxReadonly", "spxValidators", "spxFocused", "spxStep", "value"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputRadioComponent, selector: "spx-input-radio", inputs: ["spxName", "spxValidators", "spxFocused", "spxShowLabel", "spxReadonly", "spxSuggestions", "value"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputTextComponent, selector: "spx-input-text", inputs: ["spxName", "spxAutofocus", "spxInputMode", "spxPattern", "spxSuggestions", "spxReadonly", "spxValidators", "spxCapitalize", "spxFocused", "spxType", "value", "spxWasInternalUpdate"], outputs: ["spxBlurFromChild", "spxChange", "spxFocus"] }, { kind: "component", type: SpxInputTimeComponent, selector: "spx-input-time", inputs: ["spxName", "spxAutofocus", "spxInputMode", "spxPattern", "spxSuggestions", "spxReadonly", "spxValidators", "spxCapitalize", "spxFocused", "spxType", "value", "spxWasInternalUpdate"], outputs: ["spxBlurFromChild", "spxChange", "spxFocus"] }] }); }
1482
+ [spxFocused]="this.spxFocused"
1483
+ [spxLabel]="this.spxLabel"
1484
+ [spxReadonly]="this.spxReadonly"
1485
+ [spxRequired]="this.spxRequired"
1486
+ [spxValue]="this.value"
1487
+ [spxShowHelp]="this.spxShowHelp"
1488
+ [spxCompact]="this.spxCompact"
1489
+ [spxShowClear]="this.spxShowClear"
1490
+ [spxShowEdit]="this.spxShowEdit"
1491
+ [spxShowLabel]="this.spxShowLabel"
1492
+ [spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
1493
+ [spxShowValidationMessages]="this.spxShowValidationMessages"
1494
+ (spxClear)="this.handleClear()"
1495
+ (spxEdit)="this.handleEdit()"
1496
+ (spxHelp)="this.handleHelp()"
1497
+ (spxFocus)="this.setFocusIn()"
1498
+ (spxFocusOut)="this.setFocusOut()"
1499
+ (spxSearch)="this.handleSearch()">
1500
+ <div controls>
1501
+ @if (this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password') {
1502
+ <spx-input-text
1503
+ (spxBlurFromChild)="this.handleBlur()"
1504
+ (spxChange)="this.handleChange($event)"
1505
+ (spxFocus)="this.handleFocus()"
1506
+ [spxAutocomplete]="this.spxAutocomplete ? this.spxAutocomplete : undefined"
1507
+ [spxAutofocus]="this.spxAutofocus"
1508
+ [spxCapitalize]="this.spxCapitalize"
1509
+ [spxFocused]="this.spxFocused"
1510
+ [spxInputMode]="this.spxType === 'overlaynumber' ? 'numeric' : this.spxInputMode"
1511
+ [spxName]="this.spxName"
1512
+ [spxPattern]="this.spxType === 'overlaynumber' ? '[0-9]*' : this.spxPattern"
1513
+ [spxReadonly]="this.spxReadonly"
1514
+ [spxSuggestions]="this.spxSuggestions"
1515
+ [spxType]="this.spxType"
1516
+ [spxValidators]="this.spxValidators"
1517
+ [value]="this.value"
1518
+ ></spx-input-text>
1519
+ }
1520
+ @if (this.spxType === 'date') {
1521
+ <spx-input-date
1522
+ (spxChange)="this.handleChange($event)"
1523
+ (spxFocus)="this.handleFocus()"
1524
+ [spxFocused]="this.spxFocused"
1525
+ [spxMax]="this.spxMax!"
1526
+ [spxMin]="this.spxMin!"
1527
+ [spxReadonly]="this.spxReadonly"
1528
+ [spxSelectDay]="this.spxSelectDay"
1529
+ [spxSelectMonth]="this.spxSelectMonth"
1530
+ [spxValidators]="this.spxValidators"
1531
+ [(value)]="this.value"
1532
+ ></spx-input-date>
1533
+ }
1534
+ @if (this.spxType === 'float') {
1535
+ <spx-input-float
1536
+ (spxChange)="this.handleChange($event)"
1537
+ (spxFocus)="this.handleFocus()"
1538
+ [spxAutofocus]="this.spxAutofocus"
1539
+ [spxFocused]="this.spxFocused"
1540
+ [spxName]="this.spxName"
1541
+ [spxReadonly]="this.spxReadonly"
1542
+ [spxStep]="this.spxStep"
1543
+ [spxValidators]="this.spxValidators"
1544
+ [value]="this.value"
1545
+ ></spx-input-float>
1546
+ }
1547
+ @if (this.spxType === 'number') {
1548
+ <spx-input-number
1549
+ (spxChange)="this.handleChange($event)"
1550
+ (spxFocus)="this.handleFocus()"
1551
+ [spxAutofocus]="this.spxAutofocus"
1552
+ [spxFocused]="this.spxFocused"
1553
+ [spxInputMode]="this.spxInputMode"
1554
+ [spxName]="this.spxName"
1555
+ [spxReadonly]="this.spxReadonly"
1556
+ [spxStep]="this.spxStep"
1557
+ [spxValidators]="this.spxValidators"
1558
+ [value]="this.value"
1559
+ ></spx-input-number>
1560
+ }
1561
+ @if (this.spxType === 'radio') {
1562
+ <spx-input-radio
1563
+ #radioInput
1564
+ (spxChange)="this.handleChange($event)"
1565
+ [spxFocused]="this.spxFocused"
1566
+ [spxName]="this.spxName"
1567
+ [spxReadonly]="this.spxReadonly"
1568
+ [spxShowLabel]="this.spxShowLabel"
1569
+ [spxSuggestions]="this.spxSuggestions"
1570
+ [spxValidators]="this.spxValidators"
1571
+ [value]="this.value"
1572
+ ></spx-input-radio>
1573
+ }
1574
+ @if (this.spxType === 'time') {
1575
+ <spx-input-time
1576
+ #timeInput
1577
+ (spxChange)="this.handleChange($event)"
1578
+ (spxFocus)="this.handleFocus()"
1579
+ [spxFocused]="this.spxFocused"
1580
+ [spxName]="this.spxName"
1581
+ [spxReadonly]="this.spxReadonly"
1582
+ [spxValidators]="this.spxValidators"
1583
+ [value]="this.value"
1584
+ ></spx-input-time>
1585
+ }
1586
+ </div>
1587
+ <div validation-messages>
1588
+ <ng-content></ng-content>
1589
+ </div>
1590
+ </spx-input-box>`, isInline: true, dependencies: [{ kind: "component", type: SpxInputBoxComponent, selector: "spx-input-box", inputs: ["spxCompact", "spxFocused", "spxLabel", "spxReadonly", "spxRequired", "spxShowClear", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxShowSearch", "spxShowValidationMessages", "spxValue"], outputs: ["spxClear", "spxSearch", "spxFocus", "spxFocusOut", "spxEdit", "spxHelp"] }, { kind: "component", type: SpxInputDateComponent, selector: "spx-input-date", inputs: ["spxMax", "spxMin", "spxReadonly", "spxValidators", "value", "spxFocused", "spxSelectDay", "spxSelectMonth", "spxSuggestions"], outputs: ["valueChange", "spxChange", "spxFocus"] }, { kind: "component", type: SpxInputFloatComponent, selector: "spx-input-float", inputs: ["spxName", "spxAutofocus", "spxReadonly", "spxValidators", "spxFocused", "spxStep", "value", "spxWasInternalUpdate", "tick"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputNumberComponent, selector: "spx-input-number", inputs: ["spxName", "spxAutofocus", "spxInputMode", "spxReadonly", "spxValidators", "spxFocused", "spxStep", "value"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputRadioComponent, selector: "spx-input-radio", inputs: ["spxName", "spxValidators", "spxFocused", "spxShowLabel", "spxReadonly", "spxSuggestions", "value"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputTextComponent, selector: "spx-input-text", inputs: ["spxName", "spxAutofocus", "spxAutocomplete", "spxInputMode", "spxPattern", "spxSuggestions", "spxReadonly", "spxValidators", "spxCapitalize", "spxFocused", "spxType", "value", "spxWasInternalUpdate"], outputs: ["spxBlurFromChild", "spxChange", "spxFocus"] }, { kind: "component", type: SpxInputTimeComponent, selector: "spx-input-time", inputs: ["spxName", "spxAutofocus", "spxInputMode", "spxPattern", "spxSuggestions", "spxReadonly", "spxValidators", "spxCapitalize", "spxFocused", "spxType", "value", "spxWasInternalUpdate"], outputs: ["spxBlurFromChild", "spxChange", "spxFocus"] }] }); }
1649
1591
  }
1650
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SpxInputComponent, decorators: [{
1592
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputComponent, decorators: [{
1651
1593
  type: Component,
1652
1594
  args: [{
1653
1595
  selector: 'spx-input',
@@ -1655,14 +1597,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
1655
1597
  '(spxChange)': 'handleChangeEvent($event)'
1656
1598
  },
1657
1599
  imports: [
1658
- NgIf,
1659
1600
  SpxInputBoxComponent,
1660
1601
  SpxInputDateComponent,
1661
1602
  SpxInputFloatComponent,
1662
1603
  SpxInputNumberComponent,
1663
1604
  SpxInputRadioComponent,
1664
1605
  SpxInputTextComponent,
1665
- SpxInputTimeComponent,
1606
+ SpxInputTimeComponent
1666
1607
  ],
1667
1608
  providers: [
1668
1609
  {
@@ -1672,109 +1613,115 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
1672
1613
  }
1673
1614
  ],
1674
1615
  template: `<spx-input-box
1675
- [spxFocused]="this.spxFocused"
1676
- [spxLabel]="this.spxLabel"
1677
- [spxReadonly]="this.spxReadonly"
1678
- [spxRequired]="this.spxRequired"
1679
- [spxValue]="this.value"
1680
- [spxShowHelp]="this.spxShowHelp"
1681
- [spxCompact]="this.spxCompact"
1682
- [spxShowClear]="this.spxShowClear"
1683
- [spxShowEdit]="this.spxShowEdit"
1684
- [spxShowLabel]="this.spxShowLabel"
1685
- [spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
1686
- [spxShowValidationMessages]="this.spxShowValidationMessages"
1687
- (spxClear)="this.handleClear()"
1688
- (spxEdit)="this.handleEdit()"
1689
- (spxHelp)="this.handleHelp()"
1690
- (spxFocus)="this.setFocusIn()"
1691
- (spxFocusOut)="this.setFocusOut()"
1692
- (spxSearch)="this.handleSearch()">
1693
- <div controls>
1694
- <spx-input-text
1695
- *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
1696
- (spxBlurFromChild)="this.handleBlur()"
1697
- (spxChange)="this.handleChange($event)"
1698
- (spxFocus)="this.handleFocus()"
1699
- [spxAutofocus]="this.spxAutofocus"
1700
- [spxCapitalize]="this.spxCapitalize"
1701
- [spxFocused]="this.spxFocused"
1702
- [spxInputMode]="this.spxType === 'overlaynumber' ? 'numeric' : this.spxInputMode"
1703
- [spxName]="this.spxName"
1704
- [spxPattern]="this.spxType === 'overlaynumber' ? '[0-9]*' : this.spxPattern"
1705
- [spxReadonly]="this.spxReadonly"
1706
- [spxSuggestions]="this.spxSuggestions"
1707
- [spxType]="this.spxType"
1708
- [spxValidators]="this.spxValidators"
1709
- [value]="this.value"
1710
- ></spx-input-text>
1711
- <spx-input-date
1712
- *ngIf="this.spxType === 'date'"
1713
- (spxChange)="this.handleChange($event)"
1714
- (spxFocus)="this.handleFocus()"
1715
- [spxFocused]="this.spxFocused"
1716
- [spxMax]="this.spxMax"
1717
- [spxMin]="this.spxMin"
1718
- [spxName]="this.spxName"
1719
- [spxReadonly]="this.spxReadonly"
1720
- [spxSelectDay]="this.spxSelectDay"
1721
- [spxSelectMonth]="this.spxSelectMonth"
1722
- [spxValidators]="this.spxValidators"
1723
- [value]="this.value"
1724
- ></spx-input-date>
1725
- <spx-input-float
1726
- *ngIf="this.spxType === 'float'"
1727
- (spxChange)="this.handleChange($event)"
1728
- (spxFocus)="this.handleFocus()"
1729
- [spxAutofocus]="this.spxAutofocus"
1730
- [spxFocused]="this.spxFocused"
1731
- [spxName]="this.spxName"
1732
- [spxReadonly]="this.spxReadonly"
1733
- [spxStep]="this.spxStep"
1734
- [spxValidators]="this.spxValidators"
1735
- [value]="this.value"
1736
- ></spx-input-float>
1737
- <spx-input-number
1738
- *ngIf="this.spxType === 'number'"
1739
- (spxChange)="this.handleChange($event)"
1740
- (spxFocus)="this.handleFocus()"
1741
- [spxAutofocus]="this.spxAutofocus"
1742
- [spxFocused]="this.spxFocused"
1743
- [spxInputMode]="this.spxInputMode"
1744
- [spxName]="this.spxName"
1745
- [spxReadonly]="this.spxReadonly"
1746
- [spxStep]="this.spxStep"
1747
- [spxValidators]="this.spxValidators"
1748
- [value]="this.value"
1749
- ></spx-input-number>
1750
- <spx-input-radio
1751
- #radioInput
1752
- *ngIf="this.spxType === 'radio'"
1753
- (spxChange)="this.handleChange($event)"
1754
- [spxFocused]="this.spxFocused"
1755
- [spxName]="this.spxName"
1756
- [spxReadonly]="this.spxReadonly"
1757
- [spxShowLabel]="this.spxShowLabel"
1758
- [spxSuggestions]="this.spxSuggestions"
1759
- [spxValidators]="this.spxValidators"
1760
- [value]="this.value"
1761
- ></spx-input-radio>
1762
- <spx-input-time
1763
- #timeInput
1764
- *ngIf="this.spxType === 'time'"
1765
- (spxChange)="this.handleChange($event)"
1766
- (spxFocus)="this.handleFocus()"
1767
- [spxFocused]="this.spxFocused"
1768
- [spxName]="this.spxName"
1769
- [spxReadonly]="this.spxReadonly"
1770
- [spxValidators]="this.spxValidators"
1771
- [value]="this.value"
1772
- ></spx-input-time>
1773
- </div>
1774
- <div validation-messages>
1775
- <ng-content></ng-content>
1776
- </div>
1777
- </spx-input-box>`
1616
+ [spxFocused]="this.spxFocused"
1617
+ [spxLabel]="this.spxLabel"
1618
+ [spxReadonly]="this.spxReadonly"
1619
+ [spxRequired]="this.spxRequired"
1620
+ [spxValue]="this.value"
1621
+ [spxShowHelp]="this.spxShowHelp"
1622
+ [spxCompact]="this.spxCompact"
1623
+ [spxShowClear]="this.spxShowClear"
1624
+ [spxShowEdit]="this.spxShowEdit"
1625
+ [spxShowLabel]="this.spxShowLabel"
1626
+ [spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
1627
+ [spxShowValidationMessages]="this.spxShowValidationMessages"
1628
+ (spxClear)="this.handleClear()"
1629
+ (spxEdit)="this.handleEdit()"
1630
+ (spxHelp)="this.handleHelp()"
1631
+ (spxFocus)="this.setFocusIn()"
1632
+ (spxFocusOut)="this.setFocusOut()"
1633
+ (spxSearch)="this.handleSearch()">
1634
+ <div controls>
1635
+ @if (this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password') {
1636
+ <spx-input-text
1637
+ (spxBlurFromChild)="this.handleBlur()"
1638
+ (spxChange)="this.handleChange($event)"
1639
+ (spxFocus)="this.handleFocus()"
1640
+ [spxAutocomplete]="this.spxAutocomplete ? this.spxAutocomplete : undefined"
1641
+ [spxAutofocus]="this.spxAutofocus"
1642
+ [spxCapitalize]="this.spxCapitalize"
1643
+ [spxFocused]="this.spxFocused"
1644
+ [spxInputMode]="this.spxType === 'overlaynumber' ? 'numeric' : this.spxInputMode"
1645
+ [spxName]="this.spxName"
1646
+ [spxPattern]="this.spxType === 'overlaynumber' ? '[0-9]*' : this.spxPattern"
1647
+ [spxReadonly]="this.spxReadonly"
1648
+ [spxSuggestions]="this.spxSuggestions"
1649
+ [spxType]="this.spxType"
1650
+ [spxValidators]="this.spxValidators"
1651
+ [value]="this.value"
1652
+ ></spx-input-text>
1653
+ }
1654
+ @if (this.spxType === 'date') {
1655
+ <spx-input-date
1656
+ (spxChange)="this.handleChange($event)"
1657
+ (spxFocus)="this.handleFocus()"
1658
+ [spxFocused]="this.spxFocused"
1659
+ [spxMax]="this.spxMax!"
1660
+ [spxMin]="this.spxMin!"
1661
+ [spxReadonly]="this.spxReadonly"
1662
+ [spxSelectDay]="this.spxSelectDay"
1663
+ [spxSelectMonth]="this.spxSelectMonth"
1664
+ [spxValidators]="this.spxValidators"
1665
+ [(value)]="this.value"
1666
+ ></spx-input-date>
1667
+ }
1668
+ @if (this.spxType === 'float') {
1669
+ <spx-input-float
1670
+ (spxChange)="this.handleChange($event)"
1671
+ (spxFocus)="this.handleFocus()"
1672
+ [spxAutofocus]="this.spxAutofocus"
1673
+ [spxFocused]="this.spxFocused"
1674
+ [spxName]="this.spxName"
1675
+ [spxReadonly]="this.spxReadonly"
1676
+ [spxStep]="this.spxStep"
1677
+ [spxValidators]="this.spxValidators"
1678
+ [value]="this.value"
1679
+ ></spx-input-float>
1680
+ }
1681
+ @if (this.spxType === 'number') {
1682
+ <spx-input-number
1683
+ (spxChange)="this.handleChange($event)"
1684
+ (spxFocus)="this.handleFocus()"
1685
+ [spxAutofocus]="this.spxAutofocus"
1686
+ [spxFocused]="this.spxFocused"
1687
+ [spxInputMode]="this.spxInputMode"
1688
+ [spxName]="this.spxName"
1689
+ [spxReadonly]="this.spxReadonly"
1690
+ [spxStep]="this.spxStep"
1691
+ [spxValidators]="this.spxValidators"
1692
+ [value]="this.value"
1693
+ ></spx-input-number>
1694
+ }
1695
+ @if (this.spxType === 'radio') {
1696
+ <spx-input-radio
1697
+ #radioInput
1698
+ (spxChange)="this.handleChange($event)"
1699
+ [spxFocused]="this.spxFocused"
1700
+ [spxName]="this.spxName"
1701
+ [spxReadonly]="this.spxReadonly"
1702
+ [spxShowLabel]="this.spxShowLabel"
1703
+ [spxSuggestions]="this.spxSuggestions"
1704
+ [spxValidators]="this.spxValidators"
1705
+ [value]="this.value"
1706
+ ></spx-input-radio>
1707
+ }
1708
+ @if (this.spxType === 'time') {
1709
+ <spx-input-time
1710
+ #timeInput
1711
+ (spxChange)="this.handleChange($event)"
1712
+ (spxFocus)="this.handleFocus()"
1713
+ [spxFocused]="this.spxFocused"
1714
+ [spxName]="this.spxName"
1715
+ [spxReadonly]="this.spxReadonly"
1716
+ [spxValidators]="this.spxValidators"
1717
+ [value]="this.value"
1718
+ ></spx-input-time>
1719
+ }
1720
+ </div>
1721
+ <div validation-messages>
1722
+ <ng-content></ng-content>
1723
+ </div>
1724
+ </spx-input-box>`
1778
1725
  }]
1779
1726
  }], propDecorators: { spxLabel: [{
1780
1727
  type: Input
@@ -1786,6 +1733,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
1786
1733
  type: Input
1787
1734
  }], spxReadonly: [{
1788
1735
  type: Input
1736
+ }], spxAutocomplete: [{
1737
+ type: Input
1789
1738
  }], spxAutofocus: [{
1790
1739
  type: Input
1791
1740
  }], spxInputMode: [{