@softpak/components 0.0.0-beta.9 → 0.0.0-beta.90

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 (84) hide show
  1. package/esm2022/spx-alert/spx-alert.component.mjs +9 -4
  2. package/esm2022/spx-change-details/public-api.mjs +2 -0
  3. package/esm2022/spx-change-details/softpak-components-spx-change-details.mjs +5 -0
  4. package/esm2022/spx-change-details/spx-change-details-value.interface.mjs +2 -0
  5. package/esm2022/spx-change-details/spx-change-details.component.mjs +118 -0
  6. package/esm2022/spx-channel-selection/src/spx-channel-selection.component.mjs +5 -4
  7. package/esm2022/spx-channel-selection/src/spx-company-selection.component.mjs +5 -4
  8. package/esm2022/spx-check-digit/spx-check-digit.component.mjs +6 -4
  9. package/esm2022/spx-form-section/spx-form-section.component.mjs +7 -7
  10. package/esm2022/spx-form-view/public-api.mjs +4 -0
  11. package/esm2022/spx-form-view/softpak-components-spx-form-view.mjs +5 -0
  12. package/esm2022/spx-form-view/spx-form-field.interface.mjs +2 -0
  13. package/esm2022/spx-form-view/spx-form-section.interface.mjs +2 -0
  14. package/esm2022/spx-form-view/spx-form-view.component.mjs +163 -0
  15. package/esm2022/spx-inputs/public-api.mjs +2 -1
  16. package/esm2022/spx-inputs/spx-dropdown.component.mjs +95 -0
  17. package/esm2022/spx-inputs/spx-input-box.component.mjs +51 -44
  18. package/esm2022/spx-inputs/spx-input-text.component.mjs +20 -31
  19. package/esm2022/spx-inputs/spx-input-type.enum.mjs +14 -0
  20. package/esm2022/spx-inputs/spx-input.component.mjs +21 -11
  21. package/esm2022/spx-navigation/spx-home-tile.component.mjs +29 -10
  22. package/esm2022/spx-navigation/spx-navigation-item.interface.mjs +1 -1
  23. package/esm2022/spx-navigation/spx-navigation.component.mjs +11 -5
  24. package/esm2022/spx-number-check/public-api.mjs +2 -0
  25. package/esm2022/spx-number-check/softpak-components-spx-number-check.mjs +5 -0
  26. package/esm2022/spx-number-check/spx-number-check.component.mjs +262 -0
  27. package/esm2022/spx-progress-bar/spx-progress-bar.component.mjs +3 -3
  28. package/esm2022/spx-spinner/spx-spinner.component.mjs +5 -5
  29. package/esm2022/spx-suggestion/spx-suggestion.component.mjs +10 -6
  30. package/esm2022/spx-toaster/src/spx-toaster.component.mjs +33 -21
  31. package/fesm2022/softpak-components-spx-alert.mjs +8 -3
  32. package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
  33. package/fesm2022/softpak-components-spx-change-details.mjs +125 -0
  34. package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -0
  35. package/fesm2022/softpak-components-spx-channel-selection.mjs +7 -5
  36. package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
  37. package/fesm2022/softpak-components-spx-check-digit.mjs +5 -3
  38. package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
  39. package/fesm2022/softpak-components-spx-form-section.mjs +6 -6
  40. package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
  41. package/fesm2022/softpak-components-spx-form-view.mjs +170 -0
  42. package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -0
  43. package/fesm2022/softpak-components-spx-inputs.mjs +190 -81
  44. package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
  45. package/fesm2022/softpak-components-spx-navigation.mjs +37 -12
  46. package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
  47. package/fesm2022/softpak-components-spx-number-check.mjs +269 -0
  48. package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -0
  49. package/fesm2022/softpak-components-spx-progress-bar.mjs +2 -2
  50. package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
  51. package/fesm2022/softpak-components-spx-spinner.mjs +4 -4
  52. package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
  53. package/fesm2022/softpak-components-spx-suggestion.mjs +9 -5
  54. package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
  55. package/fesm2022/softpak-components-spx-toaster.mjs +32 -20
  56. package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
  57. package/package.json +29 -11
  58. package/spx-change-details/index.d.ts +5 -0
  59. package/spx-change-details/public-api.d.ts +1 -0
  60. package/spx-change-details/spx-change-details-value.interface.d.ts +7 -0
  61. package/spx-change-details/spx-change-details.component.d.ts +40 -0
  62. package/spx-channel-selection/src/spx-channel-selection.component.d.ts +2 -1
  63. package/spx-channel-selection/src/spx-company-selection.component.d.ts +2 -1
  64. package/spx-check-digit/spx-check-digit.component.d.ts +3 -0
  65. package/spx-form-view/index.d.ts +5 -0
  66. package/spx-form-view/public-api.d.ts +3 -0
  67. package/spx-form-view/spx-form-field.interface.d.ts +16 -0
  68. package/spx-form-view/spx-form-section.interface.d.ts +9 -0
  69. package/spx-form-view/spx-form-view.component.d.ts +27 -0
  70. package/spx-inputs/public-api.d.ts +1 -0
  71. package/spx-inputs/spx-dropdown.component.d.ts +18 -0
  72. package/spx-inputs/spx-input-box.component.d.ts +8 -5
  73. package/spx-inputs/spx-input-text.component.d.ts +2 -1
  74. package/spx-inputs/spx-input-type.enum.d.ts +12 -0
  75. package/spx-inputs/spx-input.component.d.ts +4 -2
  76. package/spx-navigation/spx-home-tile.component.d.ts +5 -1
  77. package/spx-navigation/spx-navigation-item.interface.d.ts +1 -0
  78. package/spx-navigation/spx-navigation.component.d.ts +4 -1
  79. package/spx-number-check/index.d.ts +5 -0
  80. package/spx-number-check/public-api.d.ts +1 -0
  81. package/spx-number-check/spx-number-check.component.d.ts +48 -0
  82. package/spx-suggestion/spx-suggestion.component.d.ts +1 -0
  83. package/spx-toaster/src/spx-toaster.component.d.ts +1 -1
  84. package/tailwind.css +1 -1
@@ -1,54 +1,37 @@
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';
11
15
 
12
16
  class SpxInputBoxComponent {
13
- constructor() {
14
- this.faEdit = faEdit;
15
- this.faSearch = faSearch;
16
- this.faQuestion = faQuestion;
17
- this.faTimes = faTimes;
18
- this.spxReadonly = false;
19
- this.spxShowClear = true;
20
- this.spxClear = new EventEmitter();
21
- this.spxSearchOutput = new EventEmitter();
22
- this.spxFocus = new EventEmitter();
23
- this.spxFocusOut = new EventEmitter();
24
- this.spxEdit = new EventEmitter();
25
- this.spxHelp = new EventEmitter();
26
- this.spxFocused = false;
17
+ handleFocusOut() {
18
+ this.spxFocusOut.emit();
27
19
  }
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;
20
+ handleWindowClick(ev) {
21
+ if (ev.composedPath().includes(this.elRef.nativeElement)) {
22
+ if (!this.spxFocused) {
23
+ this.spxFocus.emit();
24
+ }
25
+ }
26
+ else {
27
+ this.spxFocused = false;
28
+ }
46
29
  }
47
30
  onClear() {
48
31
  this.spxClear.emit();
49
32
  }
50
33
  onSearch() {
51
- this.spxSearchOutput.emit();
34
+ this.spxSearch.emit();
52
35
  }
53
36
  onEdit() {
54
37
  this.spxEdit.emit();
@@ -56,8 +39,25 @@ class SpxInputBoxComponent {
56
39
  onHelp() {
57
40
  this.spxHelp.emit();
58
41
  }
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 gap-3"
42
+ constructor(elRef) {
43
+ this.elRef = elRef;
44
+ this.faEdit = faEdit;
45
+ this.faSearch = faSearch;
46
+ this.faQuestion = faQuestion;
47
+ this.faTimes = faTimes;
48
+ // @Element() el: HTMLElement;
49
+ this.spxFocused = false;
50
+ this.spxReadonly = false;
51
+ this.spxShowClear = true;
52
+ this.spxClear = new EventEmitter();
53
+ this.spxSearch = new EventEmitter();
54
+ this.spxFocus = new EventEmitter();
55
+ this.spxFocusOut = new EventEmitter();
56
+ this.spxEdit = new EventEmitter();
57
+ this.spxHelp = new EventEmitter();
58
+ }
59
+ 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 }); }
60
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputBoxComponent, isStandalone: true, selector: "spx-input-box", inputs: { spxFocused: "spxFocused", spxLabel: "spxLabel", spxRequired: "spxRequired", spxReadonly: "spxReadonly", spxShowHelp: "spxShowHelp", spxCompact: "spxCompact", spxShowClear: "spxShowClear", spxShowEdit: "spxShowEdit", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxValue: "spxValue" }, outputs: { spxClear: "spxClear", spxSearch: "spxSearch", spxFocus: "spxFocus", spxFocusOut: "spxFocusOut", spxEdit: "spxEdit", spxHelp: "spxHelp" }, host: { listeners: { "focusout": "handleFocusOut()", "document:click": "handleWindowClick($event)" } }, ngImport: i0, template: `<div class="flex rounded w-full gap-3"
61
61
  [class.rounded-none]="this.spxShowValidationMessages"
62
62
  [class.rounded-t]="this.spxShowValidationMessages"
63
63
  [class.outline-none]="this.spxFocused && !this.spxReadonly"
@@ -84,7 +84,6 @@ class SpxInputBoxComponent {
84
84
  (spxClick)="onEdit()"
85
85
  [spxFullHeight]="true"
86
86
  [spxSize]="'xl'"
87
- [spxTabIndex]="-1"
88
87
  [spxType]="'button'">
89
88
  <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
90
89
  </spx-button>
@@ -92,6 +91,7 @@ class SpxInputBoxComponent {
92
91
  *ngIf="this.spxShowHelp"
93
92
  (spxClick)="onHelp()"
94
93
  [spxFullHeight]="true"
94
+ [spxDisabled]="this.spxReadonly"
95
95
  [spxSize]="'xl'"
96
96
  [spxTabIndex]="-1"
97
97
  [spxType]="'button'">
@@ -101,6 +101,7 @@ class SpxInputBoxComponent {
101
101
  *ngIf="this.spxShowSearch"
102
102
  (spxClick)="onSearch()"
103
103
  [spxFullHeight]="true"
104
+ [spxDisabled]="this.spxReadonly"
104
105
  [spxSize]="'xl'"
105
106
  [spxTabIndex]="-1"
106
107
  [spxType]="'button'">
@@ -159,7 +160,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
159
160
  (spxClick)="onEdit()"
160
161
  [spxFullHeight]="true"
161
162
  [spxSize]="'xl'"
162
- [spxTabIndex]="-1"
163
163
  [spxType]="'button'">
164
164
  <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
165
165
  </spx-button>
@@ -167,6 +167,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
167
167
  *ngIf="this.spxShowHelp"
168
168
  (spxClick)="onHelp()"
169
169
  [spxFullHeight]="true"
170
+ [spxDisabled]="this.spxReadonly"
170
171
  [spxSize]="'xl'"
171
172
  [spxTabIndex]="-1"
172
173
  [spxType]="'button'">
@@ -176,6 +177,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
176
177
  *ngIf="this.spxShowSearch"
177
178
  (spxClick)="onSearch()"
178
179
  [spxFullHeight]="true"
180
+ [spxDisabled]="this.spxReadonly"
179
181
  [spxSize]="'xl'"
180
182
  [spxTabIndex]="-1"
181
183
  [spxType]="'button'">
@@ -197,7 +199,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
197
199
  <ng-content select="[validation-messages]"></ng-content>
198
200
  </div>`,
199
201
  }]
200
- }], propDecorators: { spxLabel: [{
202
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { spxFocused: [{
203
+ type: Input
204
+ }], spxLabel: [{
201
205
  type: Input
202
206
  }], spxRequired: [{
203
207
  type: Input
@@ -219,7 +223,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
219
223
  type: Input
220
224
  }], spxClear: [{
221
225
  type: Output
222
- }], spxSearchOutput: [{
226
+ }], spxSearch: [{
223
227
  type: Output
224
228
  }], spxFocus: [{
225
229
  type: Output
@@ -229,8 +233,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
229
233
  type: Output
230
234
  }], spxHelp: [{
231
235
  type: Output
232
- }], spxFocused: [{
236
+ }], handleFocusOut: [{
237
+ type: HostListener,
238
+ args: ['focusout']
239
+ }], handleWindowClick: [{
240
+ type: HostListener,
241
+ args: ['document:click', ["$event"]]
242
+ }] } });
243
+
244
+ class SpxDropdownComponent {
245
+ constructor() {
246
+ this.focusPosition = 0;
247
+ this.spxSuggestions = [];
248
+ this.spxSelect = new EventEmitter();
249
+ }
250
+ ngOnInit() {
251
+ this.listenToKeyUp();
252
+ }
253
+ ngOnChanges(changes) {
254
+ this.focusPosition = 0;
255
+ }
256
+ ngOnDestroy() {
257
+ this.subscriptionKeyUp?.unsubscribe();
258
+ }
259
+ handleSuggestionClick(valuePair) {
260
+ this.select(valuePair);
261
+ }
262
+ listenToKeyUp() {
263
+ this.subscriptionKeyUp = fromEvent(window, 'keyup').subscribe((event) => {
264
+ if (event.key === 'ArrowUp' && this.focusPosition > 0) {
265
+ this.focusPosition = this.focusPosition - 1;
266
+ event.preventDefault();
267
+ }
268
+ if (event.key === 'ArrowDown' && this.focusPosition < this.spxSuggestions.length - 1) {
269
+ this.focusPosition = this.focusPosition + 1;
270
+ event.preventDefault();
271
+ }
272
+ if (event.key === 'Enter' && this.spxSuggestions.length > 0) {
273
+ this.select(this.spxSuggestions.at(this.focusPosition));
274
+ event.preventDefault();
275
+ }
276
+ console.log(this.focusPosition);
277
+ });
278
+ }
279
+ select(valuePair) {
280
+ this.focusPosition = 0;
281
+ this.spxSelect.emit(valuePair);
282
+ }
283
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
284
+ 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">
285
+ <div
286
+ class="absolute bg-gray-100 left-0 right-0 z-20">
287
+ <button
288
+ *ngFor="let valuePair of this.spxSuggestions; let i = index"
289
+ class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center"
290
+ [class.bg-gray-100]="i === this.focusPosition"
291
+ [class.bg-white]="i !== this.focusPosition"
292
+ (click)="this.handleSuggestionClick(valuePair)"
293
+ [attr.tabindex]="0"
294
+ [type]="'button'">
295
+ <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
296
+ <spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'">Select</spx-button>
297
+ </button>
298
+ </div>
299
+ </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"] }] }); }
300
+ }
301
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, decorators: [{
302
+ type: Component,
303
+ args: [{
304
+ selector: 'spx-dropdown',
305
+ standalone: true,
306
+ imports: [
307
+ NgIf,
308
+ NgFor,
309
+ SpxButtonComponent,
310
+ ],
311
+ template: `<div class="relative text-black">
312
+ <div
313
+ class="absolute bg-gray-100 left-0 right-0 z-20">
314
+ <button
315
+ *ngFor="let valuePair of this.spxSuggestions; let i = index"
316
+ class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center"
317
+ [class.bg-gray-100]="i === this.focusPosition"
318
+ [class.bg-white]="i !== this.focusPosition"
319
+ (click)="this.handleSuggestionClick(valuePair)"
320
+ [attr.tabindex]="0"
321
+ [type]="'button'">
322
+ <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
323
+ <spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'">Select</spx-button>
324
+ </button>
325
+ </div>
326
+ </div>`,
327
+ }]
328
+ }], propDecorators: { spxSuggestions: [{
233
329
  type: Input
330
+ }], spxSelect: [{
331
+ type: Output
234
332
  }] } });
235
333
 
236
334
  class SpxInputTextComponent {
@@ -247,7 +345,7 @@ class SpxInputTextComponent {
247
345
  this.spxWasInternalUpdate = false;
248
346
  }
249
347
  async spxSetFocus() {
250
- // this.elInput.focus();
348
+ this.inputRef?.nativeElement?.focus();
251
349
  }
252
350
  componentDidLoad() {
253
351
  if (this.spxAutofocus) {
@@ -279,8 +377,9 @@ class SpxInputTextComponent {
279
377
  this.spxFocused = true;
280
378
  }
281
379
  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 text-black">
380
+ 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
381
  <input
382
+ #input
284
383
  class="font-bold text-lg w-full outline-none"
285
384
  [class.bg-white]="!this.spxReadonly"
286
385
  [class.bg-gray-300]="this.spxReadonly"
@@ -292,27 +391,18 @@ class SpxInputTextComponent {
292
391
  [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
293
392
  [attr.name]="this.spxName"
294
393
  [attr.type]="this.spxType"
295
- [attr.value]="this.value?.description ? this.value?.description : this.value?.value"
394
+ [value]="this.value?.description ? this.value?.description : this.value?.value"
296
395
  (blur)="this.handleBlur()"
297
396
  (keyUp)="this.handleKeyUp()"
298
397
  (focus)="this.handleFocus()"
299
398
  (input)="this.handleDescriptionInput($event)"
300
399
  />
301
400
  <span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
302
- <div
401
+ <spx-dropdown
303
402
  *ngIf="this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')"
304
- class="absolute bg-gray-100 left-0 right-0 z-20">
305
- <div
306
- *ngFor="let valuePair of this.spxSuggestions"
307
- class="text-black block w-full p-2 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 flex items-center"
308
- (click)="this.handleSuggestionClick($event)"
309
- [attr.tabindex]="0"
310
- >
311
- <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
312
- <spx-button spxType="button">Select</spx-button>
313
- </div>
314
- </div>
315
- </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"] }] }); }
403
+ [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
404
+ </spx-dropdown>
405
+ </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"] }] }); }
316
406
  }
317
407
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputTextComponent, decorators: [{
318
408
  type: Component,
@@ -323,9 +413,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
323
413
  NgIf,
324
414
  NgFor,
325
415
  SpxButtonComponent,
416
+ SpxDropdownComponent,
326
417
  ],
327
418
  template: `<div class="relative text-black">
328
419
  <input
420
+ #input
329
421
  class="font-bold text-lg w-full outline-none"
330
422
  [class.bg-white]="!this.spxReadonly"
331
423
  [class.bg-gray-300]="this.spxReadonly"
@@ -337,26 +429,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
337
429
  [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
338
430
  [attr.name]="this.spxName"
339
431
  [attr.type]="this.spxType"
340
- [attr.value]="this.value?.description ? this.value?.description : this.value?.value"
432
+ [value]="this.value?.description ? this.value?.description : this.value?.value"
341
433
  (blur)="this.handleBlur()"
342
434
  (keyUp)="this.handleKeyUp()"
343
435
  (focus)="this.handleFocus()"
344
436
  (input)="this.handleDescriptionInput($event)"
345
437
  />
346
438
  <span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
347
- <div
439
+ <spx-dropdown
348
440
  *ngIf="this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')"
349
- class="absolute bg-gray-100 left-0 right-0 z-20">
350
- <div
351
- *ngFor="let valuePair of this.spxSuggestions"
352
- class="text-black block w-full p-2 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 flex items-center"
353
- (click)="this.handleSuggestionClick($event)"
354
- [attr.tabindex]="0"
355
- >
356
- <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
357
- <spx-button spxType="button">Select</spx-button>
358
- </div>
359
- </div>
441
+ [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
442
+ </spx-dropdown>
360
443
  </div>`,
361
444
  }]
362
445
  }], propDecorators: { spxName: [{
@@ -389,6 +472,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
389
472
  type: Output
390
473
  }], spxWasInternalUpdate: [{
391
474
  type: Input
475
+ }], inputRef: [{
476
+ type: ViewChild,
477
+ args: ['input', { static: true }]
392
478
  }] } });
393
479
 
394
480
  class SpxInputDateComponent {
@@ -968,6 +1054,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
968
1054
  type: Output
969
1055
  }] } });
970
1056
 
1057
+ var SpxInputTypeEnum;
1058
+ (function (SpxInputTypeEnum) {
1059
+ SpxInputTypeEnum["autocomplete"] = "autocomplete";
1060
+ SpxInputTypeEnum["date"] = "date";
1061
+ SpxInputTypeEnum["float"] = "float";
1062
+ SpxInputTypeEnum["overlay"] = "overlay";
1063
+ SpxInputTypeEnum["overlayNumber"] = "overlaynumber";
1064
+ SpxInputTypeEnum["radio"] = "radio";
1065
+ SpxInputTypeEnum["number"] = "number";
1066
+ SpxInputTypeEnum["password"] = "password";
1067
+ SpxInputTypeEnum["text"] = "text";
1068
+ SpxInputTypeEnum["textNumericKeyboard"] = "textNumericKeyboard";
1069
+ })(SpxInputTypeEnum || (SpxInputTypeEnum = {}));
1070
+
971
1071
  class SpxInputComponent {
972
1072
  constructor() {
973
1073
  this.spxLabel = 'label';
@@ -983,7 +1083,7 @@ class SpxInputComponent {
983
1083
  this.spxShowSearch = false;
984
1084
  this.spxShowValidationMessages = false;
985
1085
  this.spxSuggestions = [];
986
- this.spxType = 'text';
1086
+ this.spxType = SpxInputTypeEnum.text;
987
1087
  this.spxCapitalize = false;
988
1088
  this.spxBlur = new EventEmitter();
989
1089
  this.spxClear = new EventEmitter();
@@ -996,9 +1096,6 @@ class SpxInputComponent {
996
1096
  this.onChange = () => { };
997
1097
  this.onTouched = () => { };
998
1098
  }
999
- async spxSetFocus() {
1000
- this.passFocusToControl();
1001
- }
1002
1099
  handleBlur() {
1003
1100
  this.spxBlur.emit();
1004
1101
  }
@@ -1040,9 +1137,16 @@ class SpxInputComponent {
1040
1137
  this.spxFocused = true;
1041
1138
  }
1042
1139
  passFocusToControl() {
1140
+ switch (this.spxType) {
1141
+ case SpxInputTypeEnum.autocomplete:
1142
+ case SpxInputTypeEnum.text:
1143
+ case SpxInputTypeEnum.overlayNumber:
1144
+ this.textInput?.spxSetFocus();
1145
+ break;
1146
+ }
1043
1147
  }
1044
1148
  writeValue(value) {
1045
- this.value = this.lastValue = value == null ? '' : value;
1149
+ this.value = this.lastValue = value;
1046
1150
  }
1047
1151
  handleChangeEvent(value) {
1048
1152
  if (value !== this.lastValue) {
@@ -1066,7 +1170,8 @@ class SpxInputComponent {
1066
1170
  useExisting: SpxInputComponent,
1067
1171
  multi: true
1068
1172
  }
1069
- ], ngImport: i0, template: `<spx-input-box
1173
+ ], viewQueries: [{ propertyName: "textInput", first: true, predicate: SpxInputTextComponent, descendants: true }], ngImport: i0, template: `<spx-input-box
1174
+ [spxFocused]="this.spxFocused"
1070
1175
  [spxLabel]="this.spxLabel"
1071
1176
  [spxReadonly]="this.spxReadonly"
1072
1177
  [spxRequired]="this.spxRequired"
@@ -1082,7 +1187,7 @@ class SpxInputComponent {
1082
1187
  (spxHelp)="this.handleHelp()"
1083
1188
  (spxFocus)="this.setFocus()"
1084
1189
  (spxFocusOut)="this.setFocusOut()"
1085
- (spxSearchOutput)="this.handleSearch()">
1190
+ (spxSearch)="this.handleSearch()">
1086
1191
  <div controls>
1087
1192
  <spx-input-text
1088
1193
  *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
@@ -1155,7 +1260,7 @@ class SpxInputComponent {
1155
1260
  <div validation-messages>
1156
1261
  <ng-content></ng-content>
1157
1262
  </div>
1158
- </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"] }] }); }
1263
+ </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: ["spxFocused", "spxLabel", "spxRequired", "spxReadonly", "spxShowHelp", "spxCompact", "spxShowClear", "spxShowEdit", "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", "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"] }] }); }
1159
1264
  }
1160
1265
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, decorators: [{
1161
1266
  type: Component,
@@ -1182,6 +1287,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1182
1287
  }
1183
1288
  ],
1184
1289
  template: `<spx-input-box
1290
+ [spxFocused]="this.spxFocused"
1185
1291
  [spxLabel]="this.spxLabel"
1186
1292
  [spxReadonly]="this.spxReadonly"
1187
1293
  [spxRequired]="this.spxRequired"
@@ -1197,7 +1303,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1197
1303
  (spxHelp)="this.handleHelp()"
1198
1304
  (spxFocus)="this.setFocus()"
1199
1305
  (spxFocusOut)="this.setFocusOut()"
1200
- (spxSearchOutput)="this.handleSearch()">
1306
+ (spxSearch)="this.handleSearch()">
1201
1307
  <div controls>
1202
1308
  <spx-input-text
1203
1309
  *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
@@ -1332,6 +1438,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1332
1438
  type: Output
1333
1439
  }], spxSearch: [{
1334
1440
  type: Output
1441
+ }], textInput: [{
1442
+ type: ViewChild,
1443
+ args: [SpxInputTextComponent]
1335
1444
  }], spxFocused: [{
1336
1445
  type: Input
1337
1446
  }], _handleBlurEvent: [{
@@ -1343,5 +1452,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1343
1452
  * Generated bundle index. Do not edit.
1344
1453
  */
1345
1454
 
1346
- export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent };
1455
+ export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent, SpxInputTypeEnum };
1347
1456
  //# sourceMappingURL=softpak-components-spx-inputs.mjs.map