@softpak/components 0.0.0-beta.2 → 0.0.0-beta.200

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 (109) hide show
  1. package/esm2022/spx-alert/spx-alert.component.mjs +9 -4
  2. package/esm2022/spx-button/spx-button.component.mjs +61 -38
  3. package/esm2022/spx-change-details/public-api.mjs +2 -0
  4. package/esm2022/spx-change-details/softpak-components-spx-change-details.mjs +5 -0
  5. package/esm2022/spx-change-details/spx-change-details-value.interface.mjs +2 -0
  6. package/esm2022/spx-change-details/spx-change-details.component.mjs +199 -0
  7. package/esm2022/spx-channel-selection/src/spx-channel-selection.component.mjs +6 -5
  8. package/esm2022/spx-channel-selection/src/spx-company-selection.component.mjs +6 -5
  9. package/esm2022/spx-check-digit/spx-check-digit.component.mjs +17 -8
  10. package/esm2022/spx-form-section/spx-form-section.component.mjs +11 -11
  11. package/esm2022/spx-form-view/public-api.mjs +4 -0
  12. package/esm2022/spx-form-view/softpak-components-spx-form-view.mjs +5 -0
  13. package/esm2022/spx-form-view/spx-autocomplete-search.component.mjs +119 -0
  14. package/esm2022/spx-form-view/spx-form-field.interface.mjs +2 -0
  15. package/esm2022/spx-form-view/spx-form-section.interface.mjs +2 -0
  16. package/esm2022/spx-form-view/spx-form-view.component.mjs +268 -0
  17. package/esm2022/spx-inputs/public-api.mjs +2 -1
  18. package/esm2022/spx-inputs/spx-dropdown.component.mjs +94 -0
  19. package/esm2022/spx-inputs/spx-input-box.component.mjs +87 -60
  20. package/esm2022/spx-inputs/spx-input-date.component.mjs +1 -1
  21. package/esm2022/spx-inputs/spx-input-float.component.mjs +10 -5
  22. package/esm2022/spx-inputs/spx-input-number.component.mjs +10 -5
  23. package/esm2022/spx-inputs/spx-input-radio.component.mjs +93 -27
  24. package/esm2022/spx-inputs/spx-input-text.component.mjs +32 -33
  25. package/esm2022/spx-inputs/spx-input-type.enum.mjs +16 -0
  26. package/esm2022/spx-inputs/spx-input.component.mjs +56 -19
  27. package/esm2022/spx-navigation/spx-home-tile.component.mjs +47 -12
  28. package/esm2022/spx-navigation/spx-home-tiles.component.mjs +3 -5
  29. package/esm2022/spx-navigation/spx-navigation-item.interface.mjs +1 -1
  30. package/esm2022/spx-navigation/spx-navigation.component.mjs +11 -5
  31. package/esm2022/spx-number-check/public-api.mjs +2 -0
  32. package/esm2022/spx-number-check/softpak-components-spx-number-check.mjs +5 -0
  33. package/esm2022/spx-number-check/spx-number-check.component.mjs +259 -0
  34. package/esm2022/spx-progress-bar/spx-progress-bar.component.mjs +3 -3
  35. package/esm2022/spx-spinner/spx-spinner.component.mjs +5 -5
  36. package/esm2022/spx-suggestion/spx-suggestion.component.mjs +28 -10
  37. package/esm2022/spx-toaster/src/spx-toaster.component.mjs +33 -21
  38. package/esm2022/spx-update/src/spx-update-info.component.mjs +1 -1
  39. package/esm2022/spx-validation/public-api.mjs +1 -2
  40. package/esm2022/spx-validation/spx-validate-control.component.mjs +8 -3
  41. package/fesm2022/softpak-components-spx-alert.mjs +8 -3
  42. package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
  43. package/fesm2022/softpak-components-spx-button.mjs +60 -37
  44. package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
  45. package/fesm2022/softpak-components-spx-change-details.mjs +206 -0
  46. package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -0
  47. package/fesm2022/softpak-components-spx-channel-selection.mjs +9 -7
  48. package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
  49. package/fesm2022/softpak-components-spx-check-digit.mjs +16 -7
  50. package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
  51. package/fesm2022/softpak-components-spx-form-section.mjs +10 -10
  52. package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
  53. package/fesm2022/softpak-components-spx-form-view.mjs +385 -0
  54. package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -0
  55. package/fesm2022/softpak-components-spx-inputs.mjs +382 -140
  56. package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
  57. package/fesm2022/softpak-components-spx-navigation.mjs +57 -19
  58. package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
  59. package/fesm2022/softpak-components-spx-number-check.mjs +266 -0
  60. package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -0
  61. package/fesm2022/softpak-components-spx-progress-bar.mjs +2 -2
  62. package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
  63. package/fesm2022/softpak-components-spx-spinner.mjs +4 -4
  64. package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
  65. package/fesm2022/softpak-components-spx-suggestion.mjs +27 -9
  66. package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
  67. package/fesm2022/softpak-components-spx-toaster.mjs +32 -20
  68. package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
  69. package/fesm2022/softpak-components-spx-update.mjs +1 -1
  70. package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
  71. package/fesm2022/softpak-components-spx-validation.mjs +8 -28
  72. package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
  73. package/package.json +34 -15
  74. package/spx-button/spx-button.component.d.ts +8 -2
  75. package/spx-change-details/index.d.ts +5 -0
  76. package/spx-change-details/public-api.d.ts +1 -0
  77. package/spx-change-details/spx-change-details-value.interface.d.ts +7 -0
  78. package/spx-change-details/spx-change-details.component.d.ts +63 -0
  79. package/spx-channel-selection/src/spx-channel-selection.component.d.ts +2 -1
  80. package/spx-channel-selection/src/spx-company-selection.component.d.ts +2 -1
  81. package/spx-check-digit/spx-check-digit.component.d.ts +5 -0
  82. package/spx-form-view/index.d.ts +5 -0
  83. package/spx-form-view/public-api.d.ts +3 -0
  84. package/spx-form-view/spx-autocomplete-search.component.d.ts +43 -0
  85. package/spx-form-view/spx-form-field.interface.d.ts +18 -0
  86. package/spx-form-view/spx-form-section.interface.d.ts +9 -0
  87. package/spx-form-view/spx-form-view.component.d.ts +48 -0
  88. package/spx-inputs/public-api.d.ts +1 -0
  89. package/spx-inputs/spx-dropdown.component.d.ts +18 -0
  90. package/spx-inputs/spx-input-box.component.d.ts +15 -8
  91. package/spx-inputs/spx-input-float.component.d.ts +3 -2
  92. package/spx-inputs/spx-input-number.component.d.ts +3 -2
  93. package/spx-inputs/spx-input-radio.component.d.ts +13 -5
  94. package/spx-inputs/spx-input-text.component.d.ts +3 -2
  95. package/spx-inputs/spx-input-type.enum.d.ts +14 -0
  96. package/spx-inputs/spx-input.component.d.ts +13 -5
  97. package/spx-navigation/spx-home-tile.component.d.ts +6 -1
  98. package/spx-navigation/spx-navigation-item.interface.d.ts +2 -0
  99. package/spx-navigation/spx-navigation.component.d.ts +4 -1
  100. package/spx-number-check/index.d.ts +5 -0
  101. package/spx-number-check/public-api.d.ts +1 -0
  102. package/spx-number-check/spx-number-check.component.d.ts +48 -0
  103. package/spx-suggestion/spx-suggestion.component.d.ts +3 -1
  104. package/spx-toaster/src/spx-toaster.component.d.ts +1 -1
  105. package/spx-validation/public-api.d.ts +0 -1
  106. package/spx-validation/spx-validate-control.component.d.ts +1 -1
  107. package/tailwind.css +1 -1
  108. package/esm2022/spx-validation/spx-validation.module.mjs +0 -28
  109. package/spx-validation/spx-validation.module.d.ts +0 -9
@@ -1,63 +1,79 @@
1
1
  import { NgIf, NgFor } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { EventEmitter, Component, Input, Output, HostListener } from '@angular/core';
3
+ import { EventEmitter, Component, Input, Output, HostListener, ViewChild } from '@angular/core';
4
4
  import { SpxButtonComponent } from '@softpak/components/spx-button';
5
5
  import * as i1 from '@fortawesome/angular-fontawesome';
6
6
  import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
7
- import { faEdit, faSearch, faQuestion, faTimes } from '@fortawesome/free-solid-svg-icons';
7
+ import { faEdit } from '@fortawesome/free-solid-svg-icons/faEdit';
8
+ import { faQuestion } from '@fortawesome/free-solid-svg-icons/faQuestion';
9
+ import { faSearch } from '@fortawesome/free-solid-svg-icons/faSearch';
10
+ import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
11
+ import { fromEvent } from 'rxjs';
8
12
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
9
13
  import { SpxSuggestionComponent } from '@softpak/components/spx-suggestion';
10
14
  import { DateTime } from 'luxon';
15
+ import { valuePairToValue } from '@softpak/components/spx-helpers';
11
16
 
12
17
  class SpxInputBoxComponent {
13
- constructor() {
18
+ handleFocusIn(ev) {
19
+ this.emitFocusIn();
20
+ }
21
+ handleFocusOut(ev) {
22
+ const thisEl = this.elRef.nativeElement;
23
+ const relatedElement = ev.relatedTarget;
24
+ if (!relatedElement || !thisEl.contains(relatedElement)) {
25
+ this.emitFocusOut();
26
+ }
27
+ }
28
+ handleWindowClick(ev) {
29
+ if (ev.composedPath().includes(this.elRef.nativeElement)) {
30
+ this.emitFocusIn();
31
+ }
32
+ else {
33
+ this.emitFocusOut();
34
+ }
35
+ }
36
+ onClear() {
37
+ this.spxClear.emit();
38
+ }
39
+ onSearch() {
40
+ this.spxSearch.emit();
41
+ }
42
+ onEdit() {
43
+ this.spxEdit.emit();
44
+ }
45
+ onHelp() {
46
+ this.spxHelp.emit();
47
+ }
48
+ constructor(elRef) {
49
+ this.elRef = elRef;
14
50
  this.faEdit = faEdit;
15
51
  this.faSearch = faSearch;
16
52
  this.faQuestion = faQuestion;
17
53
  this.faTimes = faTimes;
54
+ this.spxFocused = false;
18
55
  this.spxReadonly = false;
19
56
  this.spxShowClear = true;
57
+ this.spxShowLabel = true;
20
58
  this.spxClear = new EventEmitter();
21
- this.spxSearchOutput = new EventEmitter();
59
+ this.spxSearch = new EventEmitter();
22
60
  this.spxFocus = new EventEmitter();
23
61
  this.spxFocusOut = new EventEmitter();
24
62
  this.spxEdit = new EventEmitter();
25
63
  this.spxHelp = new EventEmitter();
26
- this.spxFocused = false;
27
- }
28
- // @Listen('focusout', { capture: true })
29
- // handleFocusOut() {
30
- // this.spxFocused = false;
31
- // this.spxFocusOut.emit();
32
- // }
33
- // @Listen('click', { target: 'window' })
34
- // handleWindowClick(ev) {
35
- // if (ev.composedPath().includes(this.el)) {
36
- // if (!this.spxFocused) {
37
- // this.spxFocused = true;
38
- // this.spxFocus.emit();
39
- // }
40
- // } else {
41
- // this.spxFocused = false;
42
- // }
43
- // }
44
- async spxSetFocus() {
45
- this.spxFocused = true;
46
- }
47
- onClear() {
48
- this.spxClear.emit();
49
64
  }
50
- onSearch() {
51
- this.spxSearchOutput.emit();
52
- }
53
- onEdit() {
54
- this.spxEdit.emit();
65
+ emitFocusIn() {
66
+ if (!this.spxFocused) {
67
+ this.spxFocus.emit();
68
+ }
55
69
  }
56
- onHelp() {
57
- this.spxHelp.emit();
70
+ emitFocusOut() {
71
+ if (this.spxFocused) {
72
+ this.spxFocusOut.emit();
73
+ }
58
74
  }
59
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
60
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputBoxComponent, isStandalone: true, selector: "spx-input-box", inputs: { spxLabel: "spxLabel", spxRequired: "spxRequired", spxReadonly: "spxReadonly", spxShowHelp: "spxShowHelp", spxCompact: "spxCompact", spxShowClear: "spxShowClear", spxShowEdit: "spxShowEdit", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxValue: "spxValue", spxFocused: "spxFocused" }, outputs: { spxClear: "spxClear", spxSearchOutput: "spxSearchOutput", spxFocus: "spxFocus", spxFocusOut: "spxFocusOut", spxEdit: "spxEdit", spxHelp: "spxHelp" }, ngImport: i0, template: `<div class="flex rounded w-full"
75
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputBoxComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
76
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", 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"
61
77
  [class.rounded-none]="this.spxShowValidationMessages"
62
78
  [class.rounded-t]="this.spxShowValidationMessages"
63
79
  [class.outline-none]="this.spxFocused && !this.spxReadonly"
@@ -71,40 +87,41 @@ class SpxInputBoxComponent {
71
87
  [class.p-0]="this.spxCompact"
72
88
  [class.flex]="this.spxCompact"
73
89
  [class.items-center]="this.spxCompact">
74
- <div class="text-sm mb-1 text-gray-800"
90
+ <div *ngIf="this.spxShowLabel" class="font-bold text-sm mb-1 text-gray-800"
75
91
  [class.mb-0]="this.spxCompact"
76
92
  [class.px-3]="this.spxCompact">
77
93
  {{this.spxLabel}} <span *ngIf="spxRequired" class="text-red-800">*</span>
78
94
  </div>
79
95
  <ng-content select="[controls]"></ng-content>
80
96
  </div>
81
- <div class="flex-none p-0.5 gap-3">
97
+ <div class="flex flex-none gap-1 p-1">
82
98
  <spx-button
83
99
  *ngIf="this.spxShowEdit"
84
100
  (spxClick)="onEdit()"
85
101
  [spxFullHeight]="true"
86
102
  [spxSize]="'xl'"
87
- [spxTabIndex]="-1"
88
103
  [spxType]="'button'">
89
- <fa-icon [icon]="faEdit" class="block h-4 w-4 text-xl"></fa-icon>
104
+ <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
90
105
  </spx-button>
91
106
  <spx-button
92
107
  *ngIf="this.spxShowHelp"
93
108
  (spxClick)="onHelp()"
94
109
  [spxFullHeight]="true"
110
+ [spxDisabled]="this.spxReadonly"
95
111
  [spxSize]="'xl'"
96
112
  [spxTabIndex]="-1"
97
113
  [spxType]="'button'">
98
- <fa-icon [icon]="faQuestion" class="block h-4 w-4 text-xl"></fa-icon>
114
+ <fa-icon [icon]="faQuestion" class="block text-xl"></fa-icon>
99
115
  </spx-button>
100
116
  <spx-button
101
117
  *ngIf="this.spxShowSearch"
102
118
  (spxClick)="onSearch()"
103
119
  [spxFullHeight]="true"
120
+ [spxDisabled]="this.spxReadonly"
104
121
  [spxSize]="'xl'"
105
122
  [spxTabIndex]="-1"
106
123
  [spxType]="'button'">
107
- <fa-icon [icon]="faSearch" class="block h-4 w-4 text-xl"></fa-icon>
124
+ <fa-icon [icon]="faSearch" class="block text-xl"></fa-icon>
108
125
  </spx-button>
109
126
  <spx-button
110
127
  *ngIf="this.spxShowClear"
@@ -114,7 +131,7 @@ class SpxInputBoxComponent {
114
131
  [spxSize]="'xl'"
115
132
  [spxTabIndex]="-1"
116
133
  [spxType]="'button'">
117
- <fa-icon [icon]="faTimes" class="block h-4 w-4 text-xl"></fa-icon>
134
+ <fa-icon [icon]="faTimes" class="block text-xl"></fa-icon>
118
135
  </spx-button>
119
136
  </div>
120
137
  </div>
@@ -132,7 +149,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
132
149
  SpxButtonComponent,
133
150
  FontAwesomeModule,
134
151
  ],
135
- template: `<div class="flex rounded w-full"
152
+ template: `<div class="flex rounded w-full gap-3"
136
153
  [class.rounded-none]="this.spxShowValidationMessages"
137
154
  [class.rounded-t]="this.spxShowValidationMessages"
138
155
  [class.outline-none]="this.spxFocused && !this.spxReadonly"
@@ -146,40 +163,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
146
163
  [class.p-0]="this.spxCompact"
147
164
  [class.flex]="this.spxCompact"
148
165
  [class.items-center]="this.spxCompact">
149
- <div class="text-sm mb-1 text-gray-800"
166
+ <div *ngIf="this.spxShowLabel" class="font-bold text-sm mb-1 text-gray-800"
150
167
  [class.mb-0]="this.spxCompact"
151
168
  [class.px-3]="this.spxCompact">
152
169
  {{this.spxLabel}} <span *ngIf="spxRequired" class="text-red-800">*</span>
153
170
  </div>
154
171
  <ng-content select="[controls]"></ng-content>
155
172
  </div>
156
- <div class="flex-none p-0.5 gap-3">
173
+ <div class="flex flex-none gap-1 p-1">
157
174
  <spx-button
158
175
  *ngIf="this.spxShowEdit"
159
176
  (spxClick)="onEdit()"
160
177
  [spxFullHeight]="true"
161
178
  [spxSize]="'xl'"
162
- [spxTabIndex]="-1"
163
179
  [spxType]="'button'">
164
- <fa-icon [icon]="faEdit" class="block h-4 w-4 text-xl"></fa-icon>
180
+ <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
165
181
  </spx-button>
166
182
  <spx-button
167
183
  *ngIf="this.spxShowHelp"
168
184
  (spxClick)="onHelp()"
169
185
  [spxFullHeight]="true"
186
+ [spxDisabled]="this.spxReadonly"
170
187
  [spxSize]="'xl'"
171
188
  [spxTabIndex]="-1"
172
189
  [spxType]="'button'">
173
- <fa-icon [icon]="faQuestion" class="block h-4 w-4 text-xl"></fa-icon>
190
+ <fa-icon [icon]="faQuestion" class="block text-xl"></fa-icon>
174
191
  </spx-button>
175
192
  <spx-button
176
193
  *ngIf="this.spxShowSearch"
177
194
  (spxClick)="onSearch()"
178
195
  [spxFullHeight]="true"
196
+ [spxDisabled]="this.spxReadonly"
179
197
  [spxSize]="'xl'"
180
198
  [spxTabIndex]="-1"
181
199
  [spxType]="'button'">
182
- <fa-icon [icon]="faSearch" class="block h-4 w-4 text-xl"></fa-icon>
200
+ <fa-icon [icon]="faSearch" class="block text-xl"></fa-icon>
183
201
  </spx-button>
184
202
  <spx-button
185
203
  *ngIf="this.spxShowClear"
@@ -189,7 +207,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
189
207
  [spxSize]="'xl'"
190
208
  [spxTabIndex]="-1"
191
209
  [spxType]="'button'">
192
- <fa-icon [icon]="faTimes" class="block h-4 w-4 text-xl"></fa-icon>
210
+ <fa-icon [icon]="faTimes" class="block text-xl"></fa-icon>
193
211
  </spx-button>
194
212
  </div>
195
213
  </div>
@@ -197,20 +215,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
197
215
  <ng-content select="[validation-messages]"></ng-content>
198
216
  </div>`,
199
217
  }]
200
- }], propDecorators: { spxLabel: [{
218
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { spxCompact: [{
201
219
  type: Input
202
- }], spxRequired: [{
220
+ }], spxFocused: [{
203
221
  type: Input
204
- }], spxReadonly: [{
222
+ }], spxLabel: [{
205
223
  type: Input
206
- }], spxShowHelp: [{
224
+ }], spxReadonly: [{
207
225
  type: Input
208
- }], spxCompact: [{
226
+ }], spxRequired: [{
209
227
  type: Input
210
228
  }], spxShowClear: [{
211
229
  type: Input
212
230
  }], spxShowEdit: [{
213
231
  type: Input
232
+ }], spxShowHelp: [{
233
+ type: Input
234
+ }], spxShowLabel: [{
235
+ type: Input
214
236
  }], spxShowSearch: [{
215
237
  type: Input
216
238
  }], spxShowValidationMessages: [{
@@ -219,7 +241,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
219
241
  type: Input
220
242
  }], spxClear: [{
221
243
  type: Output
222
- }], spxSearchOutput: [{
244
+ }], spxSearch: [{
223
245
  type: Output
224
246
  }], spxFocus: [{
225
247
  type: Output
@@ -229,8 +251,104 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
229
251
  type: Output
230
252
  }], spxHelp: [{
231
253
  type: Output
232
- }], spxFocused: [{
254
+ }], handleFocusIn: [{
255
+ type: HostListener,
256
+ args: ['focusin', ["$event"]]
257
+ }], handleFocusOut: [{
258
+ type: HostListener,
259
+ args: ['focusout', ["$event"]]
260
+ }], handleWindowClick: [{
261
+ type: HostListener,
262
+ args: ['document:click', ["$event"]]
263
+ }] } });
264
+
265
+ class SpxDropdownComponent {
266
+ constructor() {
267
+ this.focusPosition = 0;
268
+ this.spxSuggestions = [];
269
+ this.spxSelect = new EventEmitter();
270
+ }
271
+ ngOnInit() {
272
+ this.listenToKeyUp();
273
+ }
274
+ ngOnChanges(changes) {
275
+ this.focusPosition = 0;
276
+ }
277
+ ngOnDestroy() {
278
+ this.subscriptionKeyUp?.unsubscribe();
279
+ }
280
+ handleSuggestionClick(valuePair) {
281
+ this.select(valuePair);
282
+ }
283
+ listenToKeyUp() {
284
+ this.subscriptionKeyUp = fromEvent(window, 'keyup').subscribe((event) => {
285
+ if (event.key === 'ArrowUp' && this.focusPosition > 0) {
286
+ this.focusPosition = this.focusPosition - 1;
287
+ event.preventDefault();
288
+ }
289
+ if (event.key === 'ArrowDown' && this.focusPosition < this.spxSuggestions.length - 1) {
290
+ this.focusPosition = this.focusPosition + 1;
291
+ event.preventDefault();
292
+ }
293
+ if (event.key === 'Enter' && this.spxSuggestions.length > 0) {
294
+ this.select(this.spxSuggestions.at(this.focusPosition));
295
+ event.preventDefault();
296
+ }
297
+ });
298
+ }
299
+ select(valuePair) {
300
+ this.focusPosition = 0;
301
+ this.spxSelect.emit(valuePair);
302
+ }
303
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
304
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxDropdownComponent, isStandalone: true, selector: "spx-dropdown", inputs: { spxSuggestions: "spxSuggestions" }, outputs: { spxSelect: "spxSelect" }, usesOnChanges: true, ngImport: i0, template: `<div class="relative text-black">
305
+ <div
306
+ class="absolute bg-gray-100 left-0 right-0 z-20">
307
+ <button
308
+ *ngFor="let valuePair of this.spxSuggestions; let i = index"
309
+ class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center text-left"
310
+ [class.bg-gray-100]="i === this.focusPosition"
311
+ [class.bg-white]="i !== this.focusPosition"
312
+ (click)="this.handleSuggestionClick(valuePair)"
313
+ [attr.tabindex]="-1"
314
+ [attr.type]="'button'">
315
+ <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
316
+ <spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'" [spxTabIndex]="-1">Select</spx-button>
317
+ </button>
318
+ </div>
319
+ </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"] }] }); }
320
+ }
321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, decorators: [{
322
+ type: Component,
323
+ args: [{
324
+ selector: 'spx-dropdown',
325
+ standalone: true,
326
+ imports: [
327
+ NgIf,
328
+ NgFor,
329
+ SpxButtonComponent,
330
+ ],
331
+ template: `<div class="relative text-black">
332
+ <div
333
+ class="absolute bg-gray-100 left-0 right-0 z-20">
334
+ <button
335
+ *ngFor="let valuePair of this.spxSuggestions; let i = index"
336
+ class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center text-left"
337
+ [class.bg-gray-100]="i === this.focusPosition"
338
+ [class.bg-white]="i !== this.focusPosition"
339
+ (click)="this.handleSuggestionClick(valuePair)"
340
+ [attr.tabindex]="-1"
341
+ [attr.type]="'button'">
342
+ <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
343
+ <spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'" [spxTabIndex]="-1">Select</spx-button>
344
+ </button>
345
+ </div>
346
+ </div>`,
347
+ }]
348
+ }], propDecorators: { spxSuggestions: [{
233
349
  type: Input
350
+ }], spxSelect: [{
351
+ type: Output
234
352
  }] } });
235
353
 
236
354
  class SpxInputTextComponent {
@@ -246,8 +364,8 @@ class SpxInputTextComponent {
246
364
  this.spxFocus = new EventEmitter();
247
365
  this.spxWasInternalUpdate = false;
248
366
  }
249
- async spxSetFocus() {
250
- // this.elInput.focus();
367
+ spxSetFocus() {
368
+ this.inputRef?.nativeElement?.focus();
251
369
  }
252
370
  componentDidLoad() {
253
371
  if (this.spxAutofocus) {
@@ -279,9 +397,15 @@ class SpxInputTextComponent {
279
397
  this.spxFocused = true;
280
398
  }
281
399
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
282
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", 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" }, ngImport: i0, template: `<div class="relative">
400
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", 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">
283
401
  <input
402
+ #input
284
403
  class="font-bold text-lg w-full outline-none"
404
+ autocomplete="off"
405
+ spellcheck="false"
406
+ [class.bg-white]="!this.spxReadonly"
407
+ [class.bg-gray-300]="this.spxReadonly"
408
+ [class.cursor-not-allowed]="this.spxReadonly"
285
409
  [class.uppercase]="this.spxCapitalize"
286
410
  [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
287
411
  [attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
@@ -289,27 +413,18 @@ class SpxInputTextComponent {
289
413
  [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
290
414
  [attr.name]="this.spxName"
291
415
  [attr.type]="this.spxType"
292
- [attr.value]="this.value?.description ? this.value?.description : this.value?.value"
416
+ [value]="this.value?.description ? this.value?.description : this.value?.value"
293
417
  (blur)="this.handleBlur()"
294
418
  (keyUp)="this.handleKeyUp()"
295
419
  (focus)="this.handleFocus()"
296
420
  (input)="this.handleDescriptionInput($event)"
297
421
  />
298
422
  <span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
299
- <div
423
+ <spx-dropdown
300
424
  *ngIf="this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')"
301
- class="absolute bg-gray-100 left-0 right-0 z-20">
302
- <div
303
- *ngFor="let valuePair of this.spxSuggestions"
304
- class="text-black block w-full p-2 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 flex items-center"
305
- (click)="this.handleSuggestionClick($event)"
306
- [attr.tabindex]="0"
307
- >
308
- <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
309
- <spx-button spxType="button">Select</spx-button>
310
- </div>
311
- </div>
312
- </div>`, isInline: true, 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: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }] }); }
425
+ [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
426
+ </spx-dropdown>
427
+ </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"] }] }); }
313
428
  }
314
429
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputTextComponent, decorators: [{
315
430
  type: Component,
@@ -320,10 +435,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
320
435
  NgIf,
321
436
  NgFor,
322
437
  SpxButtonComponent,
438
+ SpxDropdownComponent,
323
439
  ],
324
- template: `<div class="relative">
440
+ template: `<div class="relative text-black">
325
441
  <input
442
+ #input
326
443
  class="font-bold text-lg w-full outline-none"
444
+ autocomplete="off"
445
+ spellcheck="false"
446
+ [class.bg-white]="!this.spxReadonly"
447
+ [class.bg-gray-300]="this.spxReadonly"
448
+ [class.cursor-not-allowed]="this.spxReadonly"
327
449
  [class.uppercase]="this.spxCapitalize"
328
450
  [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
329
451
  [attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
@@ -331,26 +453,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
331
453
  [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
332
454
  [attr.name]="this.spxName"
333
455
  [attr.type]="this.spxType"
334
- [attr.value]="this.value?.description ? this.value?.description : this.value?.value"
456
+ [value]="this.value?.description ? this.value?.description : this.value?.value"
335
457
  (blur)="this.handleBlur()"
336
458
  (keyUp)="this.handleKeyUp()"
337
459
  (focus)="this.handleFocus()"
338
460
  (input)="this.handleDescriptionInput($event)"
339
461
  />
340
462
  <span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
341
- <div
463
+ <spx-dropdown
342
464
  *ngIf="this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')"
343
- class="absolute bg-gray-100 left-0 right-0 z-20">
344
- <div
345
- *ngFor="let valuePair of this.spxSuggestions"
346
- class="text-black block w-full p-2 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 flex items-center"
347
- (click)="this.handleSuggestionClick($event)"
348
- [attr.tabindex]="0"
349
- >
350
- <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
351
- <spx-button spxType="button">Select</spx-button>
352
- </div>
353
- </div>
465
+ [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
466
+ </spx-dropdown>
354
467
  </div>`,
355
468
  }]
356
469
  }], propDecorators: { spxName: [{
@@ -383,6 +496,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
383
496
  type: Output
384
497
  }], spxWasInternalUpdate: [{
385
498
  type: Input
499
+ }], inputRef: [{
500
+ type: ViewChild,
501
+ args: ['input', { static: true }]
386
502
  }] } });
387
503
 
388
504
  class SpxInputDateComponent {
@@ -587,7 +703,7 @@ class SpxInputDateComponent {
587
703
  <spx-suggestion
588
704
  *ngFor="let valuePair of spxSuggestions[spxSelectStep]"
589
705
  (click)="this.handleSuggestionClick(valuePair.value)">{{valuePair?.description}}</spx-suggestion>
590
- </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", "spxSelected"] }] }); }
706
+ </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"] }] }); }
591
707
  }
592
708
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputDateComponent, decorators: [{
593
709
  type: Component,
@@ -689,8 +805,8 @@ class SpxInputFloatComponent {
689
805
  this.spxWasInternalUpdate = false;
690
806
  this.tick = {};
691
807
  }
692
- async spxSetFocus() {
693
- // this.elFirstInput.focus();
808
+ spxSetFocus() {
809
+ this.firstInputRef?.nativeElement?.focus();
694
810
  }
695
811
  // @Watch('value') onValueChanged(newValue: SpxValuePair<any>, _oldValue: SpxValuePair<any>) {
696
812
  // this.handleSetValue(newValue);
@@ -742,8 +858,9 @@ class SpxInputFloatComponent {
742
858
  return /^[+-]?\d+(\.\d+)?$/.test(value);
743
859
  }
744
860
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputFloatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
745
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", 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" }, ngImport: i0, template: `<div class="flex items-end">
861
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", 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">
746
862
  <input
863
+ #firstInputRef
747
864
  class="spx-input-float__input"
748
865
  [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
749
866
  [attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
@@ -776,6 +893,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
776
893
  SpxButtonComponent,
777
894
  ], template: `<div class="flex items-end">
778
895
  <input
896
+ #firstInputRef
779
897
  class="spx-input-float__input"
780
898
  [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
781
899
  [attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
@@ -821,6 +939,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
821
939
  type: Input
822
940
  }], tick: [{
823
941
  type: Input
942
+ }], firstInputRef: [{
943
+ type: ViewChild,
944
+ args: ['firstInputRef', { static: true }]
824
945
  }] } });
825
946
 
826
947
  class SpxInputNumberComponent {
@@ -832,8 +953,8 @@ class SpxInputNumberComponent {
832
953
  this.spxFocus = new EventEmitter();
833
954
  this.spxWasInternalUpdate = false;
834
955
  }
835
- async spxSetFocus() {
836
- // this.elInput.focus();
956
+ spxSetFocus() {
957
+ this.inputRef?.nativeElement?.focus();
837
958
  }
838
959
  componentDidLoad() {
839
960
  if (this.spxAutofocus) {
@@ -852,8 +973,9 @@ class SpxInputNumberComponent {
852
973
  this.spxChange.emit(this.value);
853
974
  }
854
975
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
855
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", 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" }, ngImport: i0, template: `<div class="spx-input-number__controls">
976
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", 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">
856
977
  <input
978
+ #input
857
979
  class="spx-input-number__input"
858
980
  [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
859
981
  [class.spx-input-number--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
@@ -870,6 +992,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
870
992
  type: Component,
871
993
  args: [{ selector: 'spx-input-number', standalone: true, imports: [], template: `<div class="spx-input-number__controls">
872
994
  <input
995
+ #input
873
996
  class="spx-input-number__input"
874
997
  [attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
875
998
  [class.spx-input-number--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
@@ -901,55 +1024,122 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
901
1024
  type: Output
902
1025
  }], spxFocus: [{
903
1026
  type: Output
1027
+ }], inputRef: [{
1028
+ type: ViewChild,
1029
+ args: ['input', { static: true }]
904
1030
  }] } });
905
1031
 
906
1032
  class SpxInputRadioComponent {
907
1033
  constructor() {
908
- this.spxFocused = true;
1034
+ this.focusPosition = 0;
1035
+ this.spxFocused = false;
1036
+ this.spxShowLabel = true;
909
1037
  this.spxReadonly = false;
910
1038
  this.spxSuggestions = [];
911
1039
  this.spxChange = new EventEmitter();
912
1040
  this.spxFocus = new EventEmitter();
913
- this.spxWasInternalUpdate = false;
914
1041
  }
915
- async spxSetFocus() {
916
- // this.elYear.focus();
1042
+ spxFocusIn() {
1043
+ this.listenToKeys();
1044
+ this.determineFocusPosition();
917
1045
  }
918
- handleSuggestionClick(value) {
919
- this.value = value;
920
- this.spxChange.emit(this.value);
1046
+ spxFocusOut() {
1047
+ this.subscriptionKeyDown?.unsubscribe();
1048
+ this.subscriptionKeyUp?.unsubscribe();
1049
+ }
1050
+ ngOnChanges(changes) {
1051
+ if ((changes['spxSuggestions'] && changes['spxSuggestions'].previousValue !== changes['spxSuggestions'].currentValue) ||
1052
+ (changes['value'] && changes['value'].previousValue !== changes['value'].currentValue)) {
1053
+ this.determineFocusPosition();
1054
+ }
1055
+ }
1056
+ handleSuggestionClick(valuePair) {
1057
+ if (this.spxReadonly) {
1058
+ console.log('spxInputRadio: clicked, but readonly');
1059
+ }
1060
+ else {
1061
+ console.log('spxInputRadio: clicked');
1062
+ this.select(valuePair);
1063
+ }
1064
+ }
1065
+ determineFocusPosition() {
1066
+ if (this.value && this.spxSuggestions?.length) {
1067
+ const index = this.spxSuggestions.findIndex(valuePair => valuePairToValue(valuePair) === valuePairToValue(this.value));
1068
+ this.focusPosition = index >= 0 ? index : 0;
1069
+ }
1070
+ else {
1071
+ this.focusPosition = 0;
1072
+ }
1073
+ }
1074
+ select(valuePair) {
1075
+ this.focusPosition = 0;
1076
+ this.value = valuePair;
1077
+ this.spxChange.emit(valuePair);
1078
+ }
1079
+ listenToKeys() {
1080
+ this.subscriptionKeyUp = fromEvent(window, 'keyup').subscribe((event) => {
1081
+ if ((event.key === 'ArrowUp' || event.key === 'ArrowLeft') && this.focusPosition > 0) {
1082
+ this.focusPosition = this.focusPosition - 1;
1083
+ this.select(this.spxSuggestions.at(this.focusPosition));
1084
+ event.preventDefault();
1085
+ }
1086
+ if ((event.key === 'ArrowDown' || event.key === 'ArrowRight') && this.focusPosition < this.spxSuggestions.length - 1) {
1087
+ this.focusPosition = this.focusPosition + 1;
1088
+ this.select(this.spxSuggestions.at(this.focusPosition));
1089
+ event.preventDefault();
1090
+ }
1091
+ });
1092
+ this.subscriptionKeyDown = fromEvent(window, 'keydown').subscribe((event) => {
1093
+ if (event.key === 'ArrowDown' ||
1094
+ event.key === 'ArrowLeft' ||
1095
+ event.key === 'ArrowRight' ||
1096
+ event.key === 'ArrowUp') {
1097
+ event.preventDefault();
1098
+ }
1099
+ });
921
1100
  }
922
1101
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
923
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputRadioComponent, isStandalone: true, selector: "spx-input-radio", inputs: { spxName: "spxName", spxValidators: "spxValidators", spxFocused: "spxFocused", spxReadonly: "spxReadonly", spxSuggestions: "spxSuggestions", value: "value" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, ngImport: i0, template: `<div class="spx-input-radio__suggestions">
924
- <spx-suggestion
925
- *ngFor="let valuePair of this.spxSuggestions"
926
- [spxDisabled]="this.spxReadonly"
927
- [spxSelected]="this.value?.value === this.valuePair?.value"
928
- (click)="this.spxReadonly ? undefined : this.handleSuggestionClick(valuePair)">
929
- {{this.valuePair?.description}}
930
- </spx-suggestion>
931
- </div>`, isInline: true, styles: [":host{display:block}.spx-input-radio__suggestions{display:grid;grid-gap:8px;grid-template-columns:repeat(2,1fr);margin-top:8px}.spx-input-radio--readonly{background-color:transparent;border:0;box-sizing:border-box;font-size:20px;font-weight:700;margin-right:10px;padding:0;width:100%}\n"], dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxSuggestionComponent, selector: "spx-suggestion", inputs: ["spxDisabled", "spxSelected"] }] }); }
1102
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", 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">
1103
+ <spx-suggestion
1104
+ *ngFor="let valuePair of this.spxSuggestions; let i = index"
1105
+ [spxDisabled]="this.spxReadonly"
1106
+ [spxFocused]="this.spxFocused && i === this.focusPosition"
1107
+ [spxSelected]="this.value?.value === this.valuePair?.value"
1108
+ [spxTabbable]="this.focusPosition === i"
1109
+ (pointerdown)="this.handleSuggestionClick(valuePair)">
1110
+ {{this.valuePair?.description}}
1111
+ </spx-suggestion>
1112
+ </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"] }] }); }
932
1113
  }
933
1114
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputRadioComponent, decorators: [{
934
1115
  type: Component,
935
- args: [{ selector: 'spx-input-radio', standalone: true, imports: [
1116
+ args: [{
1117
+ selector: 'spx-input-radio',
1118
+ standalone: true,
1119
+ imports: [
936
1120
  NgFor,
937
1121
  SpxSuggestionComponent,
938
- ], template: `<div class="spx-input-radio__suggestions">
939
- <spx-suggestion
940
- *ngFor="let valuePair of this.spxSuggestions"
941
- [spxDisabled]="this.spxReadonly"
942
- [spxSelected]="this.value?.value === this.valuePair?.value"
943
- (click)="this.spxReadonly ? undefined : this.handleSuggestionClick(valuePair)">
944
- {{this.valuePair?.description}}
945
- </spx-suggestion>
946
- </div>`, styles: [":host{display:block}.spx-input-radio__suggestions{display:grid;grid-gap:8px;grid-template-columns:repeat(2,1fr);margin-top:8px}.spx-input-radio--readonly{background-color:transparent;border:0;box-sizing:border-box;font-size:20px;font-weight:700;margin-right:10px;padding:0;width:100%}\n"] }]
1122
+ ],
1123
+ template: `<div class="grid grid-cols-2 gap-2" [class.mt-3]="this.spxShowLabel">
1124
+ <spx-suggestion
1125
+ *ngFor="let valuePair of this.spxSuggestions; let i = index"
1126
+ [spxDisabled]="this.spxReadonly"
1127
+ [spxFocused]="this.spxFocused && i === this.focusPosition"
1128
+ [spxSelected]="this.value?.value === this.valuePair?.value"
1129
+ [spxTabbable]="this.focusPosition === i"
1130
+ (pointerdown)="this.handleSuggestionClick(valuePair)">
1131
+ {{this.valuePair?.description}}
1132
+ </spx-suggestion>
1133
+ </div>`,
1134
+ }]
947
1135
  }], propDecorators: { spxName: [{
948
1136
  type: Input
949
1137
  }], spxValidators: [{
950
1138
  type: Input
951
1139
  }], spxFocused: [{
952
1140
  type: Input
1141
+ }], spxShowLabel: [{
1142
+ type: Input
953
1143
  }], spxReadonly: [{
954
1144
  type: Input
955
1145
  }], spxSuggestions: [{
@@ -962,6 +1152,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
962
1152
  type: Output
963
1153
  }] } });
964
1154
 
1155
+ var SpxInputTypeEnum;
1156
+ (function (SpxInputTypeEnum) {
1157
+ SpxInputTypeEnum["autocomplete"] = "autocomplete";
1158
+ SpxInputTypeEnum["button"] = "button";
1159
+ SpxInputTypeEnum["date"] = "date";
1160
+ SpxInputTypeEnum["float"] = "float";
1161
+ SpxInputTypeEnum["hidden"] = "hidden";
1162
+ SpxInputTypeEnum["overlay"] = "overlay";
1163
+ SpxInputTypeEnum["overlayNumber"] = "overlaynumber";
1164
+ SpxInputTypeEnum["radio"] = "radio";
1165
+ SpxInputTypeEnum["number"] = "number";
1166
+ SpxInputTypeEnum["password"] = "password";
1167
+ SpxInputTypeEnum["text"] = "text";
1168
+ SpxInputTypeEnum["textNumericKeyboard"] = "textNumericKeyboard";
1169
+ })(SpxInputTypeEnum || (SpxInputTypeEnum = {}));
1170
+
965
1171
  class SpxInputComponent {
966
1172
  constructor() {
967
1173
  this.spxLabel = 'label';
@@ -972,12 +1178,13 @@ class SpxInputComponent {
972
1178
  this.spxSelectDay = true;
973
1179
  this.spxShowEdit = false;
974
1180
  this.spxShowHelp = false;
1181
+ this.spxShowLabel = true;
975
1182
  this.spxCompact = false;
976
1183
  this.spxShowClear = true;
977
1184
  this.spxShowSearch = false;
978
1185
  this.spxShowValidationMessages = false;
979
1186
  this.spxSuggestions = [];
980
- this.spxType = 'text';
1187
+ this.spxType = SpxInputTypeEnum.text;
981
1188
  this.spxCapitalize = false;
982
1189
  this.spxBlur = new EventEmitter();
983
1190
  this.spxClear = new EventEmitter();
@@ -990,9 +1197,6 @@ class SpxInputComponent {
990
1197
  this.onChange = () => { };
991
1198
  this.onTouched = () => { };
992
1199
  }
993
- async spxSetFocus() {
994
- this.passFocusToControl();
995
- }
996
1200
  handleBlur() {
997
1201
  this.spxBlur.emit();
998
1202
  }
@@ -1001,6 +1205,7 @@ class SpxInputComponent {
1001
1205
  this.spxChange.emit(this.value);
1002
1206
  }
1003
1207
  handleClear() {
1208
+ this.spxClear.emit();
1004
1209
  this.spxFocused = true;
1005
1210
  this.passFocusToControl();
1006
1211
  this.value = {
@@ -1010,29 +1215,47 @@ class SpxInputComponent {
1010
1215
  this.spxChange.emit(this.value);
1011
1216
  }
1012
1217
  handleFocus() {
1218
+ this.spxFocus.emit();
1013
1219
  this.spxFocused = true;
1014
- // this.elBox.spxSetFocus();
1015
1220
  }
1016
1221
  handleSearch() {
1017
1222
  this.spxSearch.emit();
1018
1223
  }
1019
- setFocus() {
1224
+ setFocusIn() {
1020
1225
  this.spxFocused = true;
1021
1226
  this.passFocusToControl();
1022
1227
  }
1023
1228
  setFocusOut() {
1024
1229
  this.spxFocused = false;
1230
+ if (this.spxType === SpxInputTypeEnum.radio) {
1231
+ this.radioInput?.spxFocusOut();
1232
+ }
1025
1233
  }
1026
1234
  handleEdit() {
1235
+ this.spxEdit.emit();
1027
1236
  this.spxFocused = true;
1028
1237
  }
1029
1238
  handleHelp() {
1239
+ this.spxHelp.emit();
1030
1240
  this.spxFocused = true;
1031
1241
  }
1032
1242
  passFocusToControl() {
1243
+ switch (this.spxType) {
1244
+ case SpxInputTypeEnum.autocomplete:
1245
+ case SpxInputTypeEnum.text:
1246
+ case SpxInputTypeEnum.overlayNumber:
1247
+ this.textInput?.spxSetFocus();
1248
+ break;
1249
+ case SpxInputTypeEnum.number:
1250
+ this.numberInput?.spxSetFocus();
1251
+ break;
1252
+ case SpxInputTypeEnum.radio:
1253
+ this.radioInput?.spxFocusIn();
1254
+ break;
1255
+ }
1033
1256
  }
1034
1257
  writeValue(value) {
1035
- this.value = this.lastValue = value == null ? '' : value;
1258
+ this.value = this.lastValue = value;
1036
1259
  }
1037
1260
  handleChangeEvent(value) {
1038
1261
  if (value !== this.lastValue) {
@@ -1049,17 +1272,15 @@ class SpxInputComponent {
1049
1272
  registerOnTouched(fn) {
1050
1273
  this.onTouched = fn;
1051
1274
  }
1052
- setDisabledState(isDisabled) {
1053
- this.spxReadonly = isDisabled;
1054
- }
1055
1275
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1056
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", 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", 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: [
1276
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", 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: [
1057
1277
  {
1058
1278
  provide: NG_VALUE_ACCESSOR,
1059
1279
  useExisting: SpxInputComponent,
1060
1280
  multi: true
1061
1281
  }
1062
- ], ngImport: i0, template: `<spx-input-box
1282
+ ], 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: "radioInput", first: true, predicate: SpxInputRadioComponent, descendants: true }], ngImport: i0, template: `<spx-input-box
1283
+ [spxFocused]="this.spxFocused"
1063
1284
  [spxLabel]="this.spxLabel"
1064
1285
  [spxReadonly]="this.spxReadonly"
1065
1286
  [spxRequired]="this.spxRequired"
@@ -1068,14 +1289,15 @@ class SpxInputComponent {
1068
1289
  [spxCompact]="this.spxCompact"
1069
1290
  [spxShowClear]="this.spxShowClear"
1070
1291
  [spxShowEdit]="this.spxShowEdit"
1292
+ [spxShowLabel]="this.spxShowLabel"
1071
1293
  [spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
1072
1294
  [spxShowValidationMessages]="this.spxShowValidationMessages"
1073
1295
  (spxClear)="this.handleClear()"
1074
1296
  (spxEdit)="this.handleEdit()"
1075
1297
  (spxHelp)="this.handleHelp()"
1076
- (spxFocus)="this.setFocus()"
1298
+ (spxFocus)="this.setFocusIn()"
1077
1299
  (spxFocusOut)="this.setFocusOut()"
1078
- (spxSearchOutput)="this.handleSearch()">
1300
+ (spxSearch)="this.handleSearch()">
1079
1301
  <div controls>
1080
1302
  <spx-input-text
1081
1303
  *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
@@ -1134,12 +1356,14 @@ class SpxInputComponent {
1134
1356
  [value]="this.value"
1135
1357
  ></spx-input-number>
1136
1358
  <spx-input-radio
1359
+ #radioInput
1137
1360
  *ngIf="this.spxType === 'radio'"
1138
1361
  (spxChange)="this.handleChange($event)"
1139
1362
  (spxFocus)="this.handleFocus()"
1140
1363
  [spxFocused]="this.spxFocused"
1141
1364
  [spxName]="this.spxName"
1142
1365
  [spxReadonly]="this.spxReadonly"
1366
+ [spxShowLabel]="this.spxShowLabel"
1143
1367
  [spxSuggestions]="this.spxSuggestions"
1144
1368
  [spxValidators]="this.spxValidators"
1145
1369
  [value]="this.value"
@@ -1148,7 +1372,7 @@ class SpxInputComponent {
1148
1372
  <div validation-messages>
1149
1373
  <ng-content></ng-content>
1150
1374
  </div>
1151
- </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: ["spxLabel", "spxRequired", "spxReadonly", "spxShowHelp", "spxCompact", "spxShowClear", "spxShowEdit", "spxShowSearch", "spxShowValidationMessages", "spxValue", "spxFocused"], outputs: ["spxClear", "spxSearchOutput", "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", "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"] }] }); }
1375
+ </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"] }] }); }
1152
1376
  }
1153
1377
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, decorators: [{
1154
1378
  type: Component,
@@ -1175,6 +1399,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1175
1399
  }
1176
1400
  ],
1177
1401
  template: `<spx-input-box
1402
+ [spxFocused]="this.spxFocused"
1178
1403
  [spxLabel]="this.spxLabel"
1179
1404
  [spxReadonly]="this.spxReadonly"
1180
1405
  [spxRequired]="this.spxRequired"
@@ -1183,14 +1408,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1183
1408
  [spxCompact]="this.spxCompact"
1184
1409
  [spxShowClear]="this.spxShowClear"
1185
1410
  [spxShowEdit]="this.spxShowEdit"
1411
+ [spxShowLabel]="this.spxShowLabel"
1186
1412
  [spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
1187
1413
  [spxShowValidationMessages]="this.spxShowValidationMessages"
1188
1414
  (spxClear)="this.handleClear()"
1189
1415
  (spxEdit)="this.handleEdit()"
1190
1416
  (spxHelp)="this.handleHelp()"
1191
- (spxFocus)="this.setFocus()"
1417
+ (spxFocus)="this.setFocusIn()"
1192
1418
  (spxFocusOut)="this.setFocusOut()"
1193
- (spxSearchOutput)="this.handleSearch()">
1419
+ (spxSearch)="this.handleSearch()">
1194
1420
  <div controls>
1195
1421
  <spx-input-text
1196
1422
  *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
@@ -1249,12 +1475,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1249
1475
  [value]="this.value"
1250
1476
  ></spx-input-number>
1251
1477
  <spx-input-radio
1478
+ #radioInput
1252
1479
  *ngIf="this.spxType === 'radio'"
1253
1480
  (spxChange)="this.handleChange($event)"
1254
1481
  (spxFocus)="this.handleFocus()"
1255
1482
  [spxFocused]="this.spxFocused"
1256
1483
  [spxName]="this.spxName"
1257
1484
  [spxReadonly]="this.spxReadonly"
1485
+ [spxShowLabel]="this.spxShowLabel"
1258
1486
  [spxSuggestions]="this.spxSuggestions"
1259
1487
  [spxValidators]="this.spxValidators"
1260
1488
  [value]="this.value"
@@ -1291,6 +1519,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1291
1519
  type: Input
1292
1520
  }], spxShowHelp: [{
1293
1521
  type: Input
1522
+ }], spxShowLabel: [{
1523
+ type: Input
1294
1524
  }], spxCompact: [{
1295
1525
  type: Input
1296
1526
  }], spxShowClear: [{
@@ -1325,6 +1555,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1325
1555
  type: Output
1326
1556
  }], spxSearch: [{
1327
1557
  type: Output
1558
+ }], floatInput: [{
1559
+ type: ViewChild,
1560
+ args: [SpxInputFloatComponent]
1561
+ }], numberInput: [{
1562
+ type: ViewChild,
1563
+ args: [SpxInputNumberComponent]
1564
+ }], textInput: [{
1565
+ type: ViewChild,
1566
+ args: [SpxInputTextComponent]
1567
+ }], radioInput: [{
1568
+ type: ViewChild,
1569
+ args: [SpxInputRadioComponent]
1328
1570
  }], spxFocused: [{
1329
1571
  type: Input
1330
1572
  }], _handleBlurEvent: [{
@@ -1336,5 +1578,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1336
1578
  * Generated bundle index. Do not edit.
1337
1579
  */
1338
1580
 
1339
- export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent };
1581
+ export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent, SpxInputTypeEnum };
1340
1582
  //# sourceMappingURL=softpak-components-spx-inputs.mjs.map