@softpak/components 0.0.0-beta.8 → 0.0.0-beta.80

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 +82 -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 +25 -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 +181 -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 +30 -12
  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 +17 -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,89 @@ 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.spxSelect.emit(valuePair);
261
+ }
262
+ listenToKeyUp() {
263
+ this.subscriptionKeyUp = fromEvent(window, 'keyup').subscribe((event) => {
264
+ console.log(event.key);
265
+ if (event.key === 'Up' && this.focusPosition > 0) {
266
+ this.focusPosition--;
267
+ }
268
+ if (event.key === 'Down' && this.focusPosition < this.spxSuggestions.length) {
269
+ this.focusPosition++;
270
+ }
271
+ event.preventDefault();
272
+ });
273
+ }
274
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
275
+ 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">
276
+ <div
277
+ class="absolute bg-gray-100 left-0 right-0 z-20">
278
+ <div
279
+ *ngFor="let valuePair of this.spxSuggestions; let i = index"
280
+ class="text-black block w-full p-2 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center"
281
+ [class.bg-gray-100]="i === this.focusPosition"
282
+ (click)="this.handleSuggestionClick(valuePair)"
283
+ [attr.tabindex]="0">
284
+ <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
285
+ <spx-button [spxType]="'button'">Select</spx-button>
286
+ </div>
287
+ </div>
288
+ </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"] }] }); }
289
+ }
290
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, decorators: [{
291
+ type: Component,
292
+ args: [{
293
+ selector: 'spx-dropdown',
294
+ standalone: true,
295
+ imports: [
296
+ NgIf,
297
+ NgFor,
298
+ SpxButtonComponent,
299
+ ],
300
+ template: `<div class="relative text-black">
301
+ <div
302
+ class="absolute bg-gray-100 left-0 right-0 z-20">
303
+ <div
304
+ *ngFor="let valuePair of this.spxSuggestions; let i = index"
305
+ class="text-black block w-full p-2 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center"
306
+ [class.bg-gray-100]="i === this.focusPosition"
307
+ (click)="this.handleSuggestionClick(valuePair)"
308
+ [attr.tabindex]="0">
309
+ <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
310
+ <spx-button [spxType]="'button'">Select</spx-button>
311
+ </div>
312
+ </div>
313
+ </div>`,
314
+ }]
315
+ }], propDecorators: { spxSuggestions: [{
233
316
  type: Input
317
+ }], spxSelect: [{
318
+ type: Output
234
319
  }] } });
235
320
 
236
321
  class SpxInputTextComponent {
@@ -247,7 +332,7 @@ class SpxInputTextComponent {
247
332
  this.spxWasInternalUpdate = false;
248
333
  }
249
334
  async spxSetFocus() {
250
- // this.elInput.focus();
335
+ this.inputRef?.nativeElement?.focus();
251
336
  }
252
337
  componentDidLoad() {
253
338
  if (this.spxAutofocus) {
@@ -279,8 +364,9 @@ class SpxInputTextComponent {
279
364
  this.spxFocused = true;
280
365
  }
281
366
  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">
367
+ 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
368
  <input
369
+ #input
284
370
  class="font-bold text-lg w-full outline-none"
285
371
  [class.bg-white]="!this.spxReadonly"
286
372
  [class.bg-gray-300]="this.spxReadonly"
@@ -292,27 +378,18 @@ class SpxInputTextComponent {
292
378
  [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
293
379
  [attr.name]="this.spxName"
294
380
  [attr.type]="this.spxType"
295
- [attr.value]="this.value?.description ? this.value?.description : this.value?.value"
381
+ [value]="this.value?.description ? this.value?.description : this.value?.value"
296
382
  (blur)="this.handleBlur()"
297
383
  (keyUp)="this.handleKeyUp()"
298
384
  (focus)="this.handleFocus()"
299
385
  (input)="this.handleDescriptionInput($event)"
300
386
  />
301
387
  <span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
302
- <div
388
+ <spx-dropdown
303
389
  *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"] }] }); }
390
+ [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
391
+ </spx-dropdown>
392
+ </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
393
  }
317
394
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputTextComponent, decorators: [{
318
395
  type: Component,
@@ -323,9 +400,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
323
400
  NgIf,
324
401
  NgFor,
325
402
  SpxButtonComponent,
403
+ SpxDropdownComponent,
326
404
  ],
327
405
  template: `<div class="relative text-black">
328
406
  <input
407
+ #input
329
408
  class="font-bold text-lg w-full outline-none"
330
409
  [class.bg-white]="!this.spxReadonly"
331
410
  [class.bg-gray-300]="this.spxReadonly"
@@ -337,26 +416,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
337
416
  [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
338
417
  [attr.name]="this.spxName"
339
418
  [attr.type]="this.spxType"
340
- [attr.value]="this.value?.description ? this.value?.description : this.value?.value"
419
+ [value]="this.value?.description ? this.value?.description : this.value?.value"
341
420
  (blur)="this.handleBlur()"
342
421
  (keyUp)="this.handleKeyUp()"
343
422
  (focus)="this.handleFocus()"
344
423
  (input)="this.handleDescriptionInput($event)"
345
424
  />
346
425
  <span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
347
- <div
426
+ <spx-dropdown
348
427
  *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>
428
+ [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
429
+ </spx-dropdown>
360
430
  </div>`,
361
431
  }]
362
432
  }], propDecorators: { spxName: [{
@@ -389,6 +459,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
389
459
  type: Output
390
460
  }], spxWasInternalUpdate: [{
391
461
  type: Input
462
+ }], inputRef: [{
463
+ type: ViewChild,
464
+ args: ['input', { static: true }]
392
465
  }] } });
393
466
 
394
467
  class SpxInputDateComponent {
@@ -968,6 +1041,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
968
1041
  type: Output
969
1042
  }] } });
970
1043
 
1044
+ var SpxInputTypeEnum;
1045
+ (function (SpxInputTypeEnum) {
1046
+ SpxInputTypeEnum["autocomplete"] = "autocomplete";
1047
+ SpxInputTypeEnum["date"] = "date";
1048
+ SpxInputTypeEnum["float"] = "float";
1049
+ SpxInputTypeEnum["overlay"] = "overlay";
1050
+ SpxInputTypeEnum["overlayNumber"] = "overlaynumber";
1051
+ SpxInputTypeEnum["radio"] = "radio";
1052
+ SpxInputTypeEnum["number"] = "number";
1053
+ SpxInputTypeEnum["password"] = "password";
1054
+ SpxInputTypeEnum["text"] = "text";
1055
+ SpxInputTypeEnum["textNumericKeyboard"] = "textNumericKeyboard";
1056
+ })(SpxInputTypeEnum || (SpxInputTypeEnum = {}));
1057
+
971
1058
  class SpxInputComponent {
972
1059
  constructor() {
973
1060
  this.spxLabel = 'label';
@@ -983,7 +1070,7 @@ class SpxInputComponent {
983
1070
  this.spxShowSearch = false;
984
1071
  this.spxShowValidationMessages = false;
985
1072
  this.spxSuggestions = [];
986
- this.spxType = 'text';
1073
+ this.spxType = SpxInputTypeEnum.text;
987
1074
  this.spxCapitalize = false;
988
1075
  this.spxBlur = new EventEmitter();
989
1076
  this.spxClear = new EventEmitter();
@@ -996,9 +1083,6 @@ class SpxInputComponent {
996
1083
  this.onChange = () => { };
997
1084
  this.onTouched = () => { };
998
1085
  }
999
- async spxSetFocus() {
1000
- this.passFocusToControl();
1001
- }
1002
1086
  handleBlur() {
1003
1087
  this.spxBlur.emit();
1004
1088
  }
@@ -1007,6 +1091,7 @@ class SpxInputComponent {
1007
1091
  this.spxChange.emit(this.value);
1008
1092
  }
1009
1093
  handleClear() {
1094
+ this.spxClear.emit();
1010
1095
  this.spxFocused = true;
1011
1096
  this.passFocusToControl();
1012
1097
  this.value = {
@@ -1016,6 +1101,7 @@ class SpxInputComponent {
1016
1101
  this.spxChange.emit(this.value);
1017
1102
  }
1018
1103
  handleFocus() {
1104
+ this.spxFocus.emit();
1019
1105
  this.spxFocused = true;
1020
1106
  // this.elBox.spxSetFocus();
1021
1107
  }
@@ -1030,15 +1116,24 @@ class SpxInputComponent {
1030
1116
  this.spxFocused = false;
1031
1117
  }
1032
1118
  handleEdit() {
1119
+ this.spxEdit.emit();
1033
1120
  this.spxFocused = true;
1034
1121
  }
1035
1122
  handleHelp() {
1123
+ this.spxHelp.emit();
1036
1124
  this.spxFocused = true;
1037
1125
  }
1038
1126
  passFocusToControl() {
1127
+ switch (this.spxType) {
1128
+ case SpxInputTypeEnum.autocomplete:
1129
+ case SpxInputTypeEnum.text:
1130
+ case SpxInputTypeEnum.overlayNumber:
1131
+ this.textInput?.spxSetFocus();
1132
+ break;
1133
+ }
1039
1134
  }
1040
1135
  writeValue(value) {
1041
- this.value = this.lastValue = value == null ? '' : value;
1136
+ this.value = this.lastValue = value;
1042
1137
  }
1043
1138
  handleChangeEvent(value) {
1044
1139
  if (value !== this.lastValue) {
@@ -1062,7 +1157,8 @@ class SpxInputComponent {
1062
1157
  useExisting: SpxInputComponent,
1063
1158
  multi: true
1064
1159
  }
1065
- ], ngImport: i0, template: `<spx-input-box
1160
+ ], viewQueries: [{ propertyName: "textInput", first: true, predicate: SpxInputTextComponent, descendants: true }], ngImport: i0, template: `<spx-input-box
1161
+ [spxFocused]="this.spxFocused"
1066
1162
  [spxLabel]="this.spxLabel"
1067
1163
  [spxReadonly]="this.spxReadonly"
1068
1164
  [spxRequired]="this.spxRequired"
@@ -1078,7 +1174,7 @@ class SpxInputComponent {
1078
1174
  (spxHelp)="this.handleHelp()"
1079
1175
  (spxFocus)="this.setFocus()"
1080
1176
  (spxFocusOut)="this.setFocusOut()"
1081
- (spxSearchOutput)="this.handleSearch()">
1177
+ (spxSearch)="this.handleSearch()">
1082
1178
  <div controls>
1083
1179
  <spx-input-text
1084
1180
  *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
@@ -1151,7 +1247,7 @@ class SpxInputComponent {
1151
1247
  <div validation-messages>
1152
1248
  <ng-content></ng-content>
1153
1249
  </div>
1154
- </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"] }] }); }
1250
+ </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"] }] }); }
1155
1251
  }
1156
1252
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, decorators: [{
1157
1253
  type: Component,
@@ -1178,6 +1274,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1178
1274
  }
1179
1275
  ],
1180
1276
  template: `<spx-input-box
1277
+ [spxFocused]="this.spxFocused"
1181
1278
  [spxLabel]="this.spxLabel"
1182
1279
  [spxReadonly]="this.spxReadonly"
1183
1280
  [spxRequired]="this.spxRequired"
@@ -1193,7 +1290,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1193
1290
  (spxHelp)="this.handleHelp()"
1194
1291
  (spxFocus)="this.setFocus()"
1195
1292
  (spxFocusOut)="this.setFocusOut()"
1196
- (spxSearchOutput)="this.handleSearch()">
1293
+ (spxSearch)="this.handleSearch()">
1197
1294
  <div controls>
1198
1295
  <spx-input-text
1199
1296
  *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
@@ -1328,6 +1425,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1328
1425
  type: Output
1329
1426
  }], spxSearch: [{
1330
1427
  type: Output
1428
+ }], textInput: [{
1429
+ type: ViewChild,
1430
+ args: [SpxInputTextComponent]
1331
1431
  }], spxFocused: [{
1332
1432
  type: Input
1333
1433
  }], _handleBlurEvent: [{
@@ -1339,5 +1439,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1339
1439
  * Generated bundle index. Do not edit.
1340
1440
  */
1341
1441
 
1342
- export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent };
1442
+ export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent, SpxInputTypeEnum };
1343
1443
  //# sourceMappingURL=softpak-components-spx-inputs.mjs.map