@softpak/components 0.0.0-beta.11 → 0.0.0-beta.110

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 (81) 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 +61 -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-spinner/spx-spinner.component.mjs +5 -5
  28. package/esm2022/spx-suggestion/spx-suggestion.component.mjs +10 -6
  29. package/esm2022/spx-toaster/src/spx-toaster.component.mjs +15 -10
  30. package/fesm2022/softpak-components-spx-alert.mjs +8 -3
  31. package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
  32. package/fesm2022/softpak-components-spx-change-details.mjs +125 -0
  33. package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -0
  34. package/fesm2022/softpak-components-spx-channel-selection.mjs +7 -5
  35. package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
  36. package/fesm2022/softpak-components-spx-check-digit.mjs +5 -3
  37. package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
  38. package/fesm2022/softpak-components-spx-form-section.mjs +6 -6
  39. package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
  40. package/fesm2022/softpak-components-spx-form-view.mjs +170 -0
  41. package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -0
  42. package/fesm2022/softpak-components-spx-inputs.mjs +200 -81
  43. package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
  44. package/fesm2022/softpak-components-spx-navigation.mjs +37 -12
  45. package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
  46. package/fesm2022/softpak-components-spx-number-check.mjs +269 -0
  47. package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -0
  48. package/fesm2022/softpak-components-spx-spinner.mjs +4 -4
  49. package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
  50. package/fesm2022/softpak-components-spx-suggestion.mjs +9 -5
  51. package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
  52. package/fesm2022/softpak-components-spx-toaster.mjs +14 -9
  53. package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
  54. package/package.json +31 -13
  55. package/spx-change-details/index.d.ts +5 -0
  56. package/spx-change-details/public-api.d.ts +1 -0
  57. package/spx-change-details/spx-change-details-value.interface.d.ts +7 -0
  58. package/spx-change-details/spx-change-details.component.d.ts +40 -0
  59. package/spx-channel-selection/src/spx-channel-selection.component.d.ts +2 -1
  60. package/spx-channel-selection/src/spx-company-selection.component.d.ts +2 -1
  61. package/spx-check-digit/spx-check-digit.component.d.ts +3 -0
  62. package/spx-form-view/index.d.ts +5 -0
  63. package/spx-form-view/public-api.d.ts +3 -0
  64. package/spx-form-view/spx-form-field.interface.d.ts +16 -0
  65. package/spx-form-view/spx-form-section.interface.d.ts +9 -0
  66. package/spx-form-view/spx-form-view.component.d.ts +27 -0
  67. package/spx-inputs/public-api.d.ts +1 -0
  68. package/spx-inputs/spx-dropdown.component.d.ts +18 -0
  69. package/spx-inputs/spx-input-box.component.d.ts +9 -5
  70. package/spx-inputs/spx-input-text.component.d.ts +2 -1
  71. package/spx-inputs/spx-input-type.enum.d.ts +12 -0
  72. package/spx-inputs/spx-input.component.d.ts +4 -2
  73. package/spx-navigation/spx-home-tile.component.d.ts +5 -1
  74. package/spx-navigation/spx-navigation-item.interface.d.ts +1 -0
  75. package/spx-navigation/spx-navigation.component.d.ts +4 -1
  76. package/spx-number-check/index.d.ts +5 -0
  77. package/spx-number-check/public-api.d.ts +1 -0
  78. package/spx-number-check/spx-number-check.component.d.ts +48 -0
  79. package/spx-suggestion/spx-suggestion.component.d.ts +1 -0
  80. package/spx-toaster/src/spx-toaster.component.d.ts +1 -1
  81. package/tailwind.css +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"softpak-components-spx-form-view.mjs","sources":["../../../../projects/softpak/components/spx-form-view/spx-form-view.component.ts","../../../../projects/softpak/components/spx-form-view/softpak-components-spx-form-view.ts"],"sourcesContent":["import { JsonPipe, NgFor, NgIf } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { SpxFormSectionComponent } from '@softpak/components/spx-form-section';\nimport { SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { AbstractControl, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SpxFormFieldI } from './spx-form-field.interface';\n\n@Component({\n selector: 'spx-form-view',\n standalone: true,\n imports: [\n FormsModule,\n ReactiveFormsModule,\n JsonPipe,\n NgIf,\n NgFor,\n SpxCapitalizePipe,\n SpxFormSectionComponent,\n SpxInputComponent,\n ],\n template: `<spx-form-section\n *ngFor=\"let spxSection of spxSections; let spxSectionIndex = index;\"\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? spxSection.title() : undefined\">\n <ng-container *ngFor=\"let spxField of spxSection.fields; let spxFieldIndex = index;\">\n <ng-container *ngIf=\"spxField.show === undefined || spxField.show()\">\n <spx-input\n *ngIf=\"spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard\"\n [formControl]=\"$any(this.spxFormGroup.get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | capitalize\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"hasRequiredField(this.spxFormGroup.get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup.get(spxField.key)! && this.spxFormGroup.get(spxField.key)!.errors && this.spxFormGroup.get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup.get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions[spxField.key]\"\n (spxBlur)=\"onBlur(spxField)\">\n </spx-input>\n\n <spx-input\n *ngIf=\"spxField.type() === typeRadio\"\n [formControl]=\"$any(this.spxFormGroup.get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | capitalize\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"hasRequiredField(this.spxFormGroup.get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup.get(spxField.key)! && this.spxFormGroup.get(spxField.key)!.errors && this.spxFormGroup.get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions[spxField.key]\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup.get(spxField.key)!)\">\n </spx-input>\n </ng-container>\n </ng-container>\n </spx-form-section>`,\n})\nexport class SpxFormViewComponent {\n @Input() spxFormGroup!: FormGroup;\n @Input() spxSections!: SpxFormSectionI[];\n @Input() spxSuggestions!: any;\n\n typeAutocomplete = SpxInputTypeEnum.autocomplete;\n typeFloat = SpxInputTypeEnum.float;\n typeNumber = SpxInputTypeEnum.number;\n typeRadio = SpxInputTypeEnum.radio;\n typeText = SpxInputTypeEnum.text;\n typeNumericKeyboard = SpxInputTypeEnum.textNumericKeyboard;\n typeOverlay = SpxInputTypeEnum.overlay;\n typeOverlayNumber = SpxInputTypeEnum.overlayNumber;\n\n onBlur(field: SpxFormFieldI) {\n return;\n }\n\n getRawValidators(formControl: AbstractControl) {\n // eslint-disable-next-line no-underscore-dangle\n return (formControl as any)._rawValidators;\n }\n\n hasRequiredField(abstractControl: AbstractControl): boolean {\n if (abstractControl.validator) {\n const validator = abstractControl.validator({} as AbstractControl);\n if (validator && validator['required']) {\n return true;\n }\n }\n if ((abstractControl as any)['controls']) {\n for (const controlName in (abstractControl as any)['controls']) {\n if ((abstractControl as any)['controls'][controlName]) {\n if (this.hasRequiredField((abstractControl as any)['controls'][controlName])) {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n static initialFormValue(sections: SpxFormSectionI[]) {\n const formObject: any = {};\n sections.forEach(section => {\n section.fields.forEach(field => {\n formObject[field.key] = [field.defaultValue ? field.defaultValue() : null, field.validators ? [...field.validators()] : []];\n });\n });\n return formObject;\n }\n\n static createForm(formBuilder: FormBuilder, sections: SpxFormSectionI[]): FormGroup {\n return formBuilder.group(this.initialFormValue(sections));\n }\n\n constructor(readonly formBuilder: FormBuilder) {\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA+Da,oBAAoB,CAAA;AAc/B,IAAA,MAAM,CAAC,KAAoB,EAAA;QACzB,OAAO;KACR;AAED,IAAA,gBAAgB,CAAC,WAA4B,EAAA;;QAE3C,OAAQ,WAAmB,CAAC,cAAc,CAAC;KAC5C;AAED,IAAA,gBAAgB,CAAC,eAAgC,EAAA;AAC/C,QAAA,IAAI,eAAe,CAAC,SAAS,EAAE;YAC7B,MAAM,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC,EAAqB,CAAC,CAAC;AACnE,YAAA,IAAI,SAAS,IAAI,SAAS,CAAC,UAAU,CAAC,EAAE;AACtC,gBAAA,OAAO,IAAI,CAAC;aACb;SACF;AACD,QAAA,IAAK,eAAuB,CAAC,UAAU,CAAC,EAAE;YACxC,KAAK,MAAM,WAAW,IAAK,eAAuB,CAAC,UAAU,CAAC,EAAE;gBAC9D,IAAK,eAAuB,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,EAAE;AACrD,oBAAA,IAAI,IAAI,CAAC,gBAAgB,CAAE,eAAuB,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE;AAC5E,wBAAA,OAAO,IAAI,CAAC;qBACb;iBACF;aACF;SACF;AACD,QAAA,OAAO,KA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AACD,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCU,qBAAA,CAAA;AACrB,iBAAA,CAAA;gFAEU,YAAY,EAAA,CAAA;sBAApB,KAAK;gBACG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBACG,cAAc,EAAA,CAAA;sBAAtB,KAAK;;;AClER;;AAEG;;;;"}
@@ -1,54 +1,44 @@
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;
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() {
17
+ handleFocusIn(ev) {
45
18
  this.spxFocused = true;
46
19
  }
20
+ handleFocusOut(ev) {
21
+ const thisEl = this.elRef.nativeElement;
22
+ const relatedElement = ev.relatedTarget;
23
+ if (!relatedElement || !thisEl.contains(relatedElement)) {
24
+ this.spxFocusOut.emit();
25
+ }
26
+ }
27
+ handleWindowClick(ev) {
28
+ if (ev.composedPath().includes(this.elRef.nativeElement)) {
29
+ if (!this.spxFocused) {
30
+ this.spxFocus.emit();
31
+ }
32
+ }
33
+ else {
34
+ this.spxFocused = false;
35
+ }
36
+ }
47
37
  onClear() {
48
38
  this.spxClear.emit();
49
39
  }
50
40
  onSearch() {
51
- this.spxSearchOutput.emit();
41
+ this.spxSearch.emit();
52
42
  }
53
43
  onEdit() {
54
44
  this.spxEdit.emit();
@@ -56,8 +46,25 @@ class SpxInputBoxComponent {
56
46
  onHelp() {
57
47
  this.spxHelp.emit();
58
48
  }
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"
49
+ constructor(elRef) {
50
+ this.elRef = elRef;
51
+ this.faEdit = faEdit;
52
+ this.faSearch = faSearch;
53
+ this.faQuestion = faQuestion;
54
+ this.faTimes = faTimes;
55
+ // @Element() el: HTMLElement;
56
+ this.spxFocused = false;
57
+ this.spxReadonly = false;
58
+ this.spxShowClear = true;
59
+ this.spxClear = new EventEmitter();
60
+ this.spxSearch = new EventEmitter();
61
+ this.spxFocus = new EventEmitter();
62
+ this.spxFocusOut = new EventEmitter();
63
+ this.spxEdit = new EventEmitter();
64
+ this.spxHelp = new EventEmitter();
65
+ }
66
+ 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 }); }
67
+ 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: { "focusin": "handleFocusIn($event)", "focusout": "handleFocusOut($event)", "document:click": "handleWindowClick($event)" } }, ngImport: i0, template: `<div class="flex rounded w-full gap-3"
61
68
  [class.rounded-none]="this.spxShowValidationMessages"
62
69
  [class.rounded-t]="this.spxShowValidationMessages"
63
70
  [class.outline-none]="this.spxFocused && !this.spxReadonly"
@@ -84,7 +91,6 @@ class SpxInputBoxComponent {
84
91
  (spxClick)="onEdit()"
85
92
  [spxFullHeight]="true"
86
93
  [spxSize]="'xl'"
87
- [spxTabIndex]="-1"
88
94
  [spxType]="'button'">
89
95
  <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
90
96
  </spx-button>
@@ -92,6 +98,7 @@ class SpxInputBoxComponent {
92
98
  *ngIf="this.spxShowHelp"
93
99
  (spxClick)="onHelp()"
94
100
  [spxFullHeight]="true"
101
+ [spxDisabled]="this.spxReadonly"
95
102
  [spxSize]="'xl'"
96
103
  [spxTabIndex]="-1"
97
104
  [spxType]="'button'">
@@ -101,6 +108,7 @@ class SpxInputBoxComponent {
101
108
  *ngIf="this.spxShowSearch"
102
109
  (spxClick)="onSearch()"
103
110
  [spxFullHeight]="true"
111
+ [spxDisabled]="this.spxReadonly"
104
112
  [spxSize]="'xl'"
105
113
  [spxTabIndex]="-1"
106
114
  [spxType]="'button'">
@@ -159,7 +167,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
159
167
  (spxClick)="onEdit()"
160
168
  [spxFullHeight]="true"
161
169
  [spxSize]="'xl'"
162
- [spxTabIndex]="-1"
163
170
  [spxType]="'button'">
164
171
  <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
165
172
  </spx-button>
@@ -167,6 +174,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
167
174
  *ngIf="this.spxShowHelp"
168
175
  (spxClick)="onHelp()"
169
176
  [spxFullHeight]="true"
177
+ [spxDisabled]="this.spxReadonly"
170
178
  [spxSize]="'xl'"
171
179
  [spxTabIndex]="-1"
172
180
  [spxType]="'button'">
@@ -176,6 +184,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
176
184
  *ngIf="this.spxShowSearch"
177
185
  (spxClick)="onSearch()"
178
186
  [spxFullHeight]="true"
187
+ [spxDisabled]="this.spxReadonly"
179
188
  [spxSize]="'xl'"
180
189
  [spxTabIndex]="-1"
181
190
  [spxType]="'button'">
@@ -197,7 +206,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
197
206
  <ng-content select="[validation-messages]"></ng-content>
198
207
  </div>`,
199
208
  }]
200
- }], propDecorators: { spxLabel: [{
209
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { spxFocused: [{
210
+ type: Input
211
+ }], spxLabel: [{
201
212
  type: Input
202
213
  }], spxRequired: [{
203
214
  type: Input
@@ -219,7 +230,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
219
230
  type: Input
220
231
  }], spxClear: [{
221
232
  type: Output
222
- }], spxSearchOutput: [{
233
+ }], spxSearch: [{
223
234
  type: Output
224
235
  }], spxFocus: [{
225
236
  type: Output
@@ -229,8 +240,105 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
229
240
  type: Output
230
241
  }], spxHelp: [{
231
242
  type: Output
232
- }], spxFocused: [{
243
+ }], handleFocusIn: [{
244
+ type: HostListener,
245
+ args: ['focusin', ["$event"]]
246
+ }], handleFocusOut: [{
247
+ type: HostListener,
248
+ args: ['focusout', ["$event"]]
249
+ }], handleWindowClick: [{
250
+ type: HostListener,
251
+ args: ['document:click', ["$event"]]
252
+ }] } });
253
+
254
+ class SpxDropdownComponent {
255
+ constructor() {
256
+ this.focusPosition = 0;
257
+ this.spxSuggestions = [];
258
+ this.spxSelect = new EventEmitter();
259
+ }
260
+ ngOnInit() {
261
+ this.listenToKeyUp();
262
+ }
263
+ ngOnChanges(changes) {
264
+ this.focusPosition = 0;
265
+ }
266
+ ngOnDestroy() {
267
+ this.subscriptionKeyUp?.unsubscribe();
268
+ }
269
+ handleSuggestionClick(valuePair) {
270
+ console.log('handleSuggestionClick', valuePair);
271
+ this.select(valuePair);
272
+ }
273
+ listenToKeyUp() {
274
+ this.subscriptionKeyUp = fromEvent(window, 'keyup').subscribe((event) => {
275
+ if (event.key === 'ArrowUp' && this.focusPosition > 0) {
276
+ this.focusPosition = this.focusPosition - 1;
277
+ event.preventDefault();
278
+ }
279
+ if (event.key === 'ArrowDown' && this.focusPosition < this.spxSuggestions.length - 1) {
280
+ this.focusPosition = this.focusPosition + 1;
281
+ event.preventDefault();
282
+ }
283
+ if (event.key === 'Enter' && this.spxSuggestions.length > 0) {
284
+ this.select(this.spxSuggestions.at(this.focusPosition));
285
+ event.preventDefault();
286
+ }
287
+ });
288
+ }
289
+ select(valuePair) {
290
+ this.focusPosition = 0;
291
+ this.spxSelect.emit(valuePair);
292
+ }
293
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
294
+ 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">
295
+ <div
296
+ class="absolute bg-gray-100 left-0 right-0 z-20">
297
+ <button
298
+ *ngFor="let valuePair of this.spxSuggestions; let i = index"
299
+ class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center text-left"
300
+ [class.bg-gray-100]="i === this.focusPosition"
301
+ [class.bg-white]="i !== this.focusPosition"
302
+ (click)="this.handleSuggestionClick(valuePair)"
303
+ [attr.tabindex]="-1"
304
+ [attr.type]="'button'">
305
+ <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
306
+ <spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'" [spxTabIndex]="-1">Select</spx-button>
307
+ </button>
308
+ </div>
309
+ </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"] }] }); }
310
+ }
311
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, decorators: [{
312
+ type: Component,
313
+ args: [{
314
+ selector: 'spx-dropdown',
315
+ standalone: true,
316
+ imports: [
317
+ NgIf,
318
+ NgFor,
319
+ SpxButtonComponent,
320
+ ],
321
+ template: `<div class="relative text-black">
322
+ <div
323
+ class="absolute bg-gray-100 left-0 right-0 z-20">
324
+ <button
325
+ *ngFor="let valuePair of this.spxSuggestions; let i = index"
326
+ class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center text-left"
327
+ [class.bg-gray-100]="i === this.focusPosition"
328
+ [class.bg-white]="i !== this.focusPosition"
329
+ (click)="this.handleSuggestionClick(valuePair)"
330
+ [attr.tabindex]="-1"
331
+ [attr.type]="'button'">
332
+ <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
333
+ <spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'" [spxTabIndex]="-1">Select</spx-button>
334
+ </button>
335
+ </div>
336
+ </div>`,
337
+ }]
338
+ }], propDecorators: { spxSuggestions: [{
233
339
  type: Input
340
+ }], spxSelect: [{
341
+ type: Output
234
342
  }] } });
235
343
 
236
344
  class SpxInputTextComponent {
@@ -247,7 +355,7 @@ class SpxInputTextComponent {
247
355
  this.spxWasInternalUpdate = false;
248
356
  }
249
357
  async spxSetFocus() {
250
- // this.elInput.focus();
358
+ this.inputRef?.nativeElement?.focus();
251
359
  }
252
360
  componentDidLoad() {
253
361
  if (this.spxAutofocus) {
@@ -279,8 +387,9 @@ class SpxInputTextComponent {
279
387
  this.spxFocused = true;
280
388
  }
281
389
  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">
390
+ 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
391
  <input
392
+ #input
284
393
  class="font-bold text-lg w-full outline-none"
285
394
  [class.bg-white]="!this.spxReadonly"
286
395
  [class.bg-gray-300]="this.spxReadonly"
@@ -292,27 +401,18 @@ class SpxInputTextComponent {
292
401
  [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
293
402
  [attr.name]="this.spxName"
294
403
  [attr.type]="this.spxType"
295
- [attr.value]="this.value?.description ? this.value?.description : this.value?.value"
404
+ [value]="this.value?.description ? this.value?.description : this.value?.value"
296
405
  (blur)="this.handleBlur()"
297
406
  (keyUp)="this.handleKeyUp()"
298
407
  (focus)="this.handleFocus()"
299
408
  (input)="this.handleDescriptionInput($event)"
300
409
  />
301
410
  <span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
302
- <div
411
+ <spx-dropdown
303
412
  *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"] }] }); }
413
+ [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
414
+ </spx-dropdown>
415
+ </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
416
  }
317
417
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputTextComponent, decorators: [{
318
418
  type: Component,
@@ -323,9 +423,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
323
423
  NgIf,
324
424
  NgFor,
325
425
  SpxButtonComponent,
426
+ SpxDropdownComponent,
326
427
  ],
327
428
  template: `<div class="relative text-black">
328
429
  <input
430
+ #input
329
431
  class="font-bold text-lg w-full outline-none"
330
432
  [class.bg-white]="!this.spxReadonly"
331
433
  [class.bg-gray-300]="this.spxReadonly"
@@ -337,26 +439,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
337
439
  [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
338
440
  [attr.name]="this.spxName"
339
441
  [attr.type]="this.spxType"
340
- [attr.value]="this.value?.description ? this.value?.description : this.value?.value"
442
+ [value]="this.value?.description ? this.value?.description : this.value?.value"
341
443
  (blur)="this.handleBlur()"
342
444
  (keyUp)="this.handleKeyUp()"
343
445
  (focus)="this.handleFocus()"
344
446
  (input)="this.handleDescriptionInput($event)"
345
447
  />
346
448
  <span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
347
- <div
449
+ <spx-dropdown
348
450
  *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>
451
+ [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
452
+ </spx-dropdown>
360
453
  </div>`,
361
454
  }]
362
455
  }], propDecorators: { spxName: [{
@@ -389,6 +482,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
389
482
  type: Output
390
483
  }], spxWasInternalUpdate: [{
391
484
  type: Input
485
+ }], inputRef: [{
486
+ type: ViewChild,
487
+ args: ['input', { static: true }]
392
488
  }] } });
393
489
 
394
490
  class SpxInputDateComponent {
@@ -968,6 +1064,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
968
1064
  type: Output
969
1065
  }] } });
970
1066
 
1067
+ var SpxInputTypeEnum;
1068
+ (function (SpxInputTypeEnum) {
1069
+ SpxInputTypeEnum["autocomplete"] = "autocomplete";
1070
+ SpxInputTypeEnum["date"] = "date";
1071
+ SpxInputTypeEnum["float"] = "float";
1072
+ SpxInputTypeEnum["overlay"] = "overlay";
1073
+ SpxInputTypeEnum["overlayNumber"] = "overlaynumber";
1074
+ SpxInputTypeEnum["radio"] = "radio";
1075
+ SpxInputTypeEnum["number"] = "number";
1076
+ SpxInputTypeEnum["password"] = "password";
1077
+ SpxInputTypeEnum["text"] = "text";
1078
+ SpxInputTypeEnum["textNumericKeyboard"] = "textNumericKeyboard";
1079
+ })(SpxInputTypeEnum || (SpxInputTypeEnum = {}));
1080
+
971
1081
  class SpxInputComponent {
972
1082
  constructor() {
973
1083
  this.spxLabel = 'label';
@@ -983,7 +1093,7 @@ class SpxInputComponent {
983
1093
  this.spxShowSearch = false;
984
1094
  this.spxShowValidationMessages = false;
985
1095
  this.spxSuggestions = [];
986
- this.spxType = 'text';
1096
+ this.spxType = SpxInputTypeEnum.text;
987
1097
  this.spxCapitalize = false;
988
1098
  this.spxBlur = new EventEmitter();
989
1099
  this.spxClear = new EventEmitter();
@@ -996,9 +1106,6 @@ class SpxInputComponent {
996
1106
  this.onChange = () => { };
997
1107
  this.onTouched = () => { };
998
1108
  }
999
- async spxSetFocus() {
1000
- this.passFocusToControl();
1001
- }
1002
1109
  handleBlur() {
1003
1110
  this.spxBlur.emit();
1004
1111
  }
@@ -1040,9 +1147,16 @@ class SpxInputComponent {
1040
1147
  this.spxFocused = true;
1041
1148
  }
1042
1149
  passFocusToControl() {
1150
+ switch (this.spxType) {
1151
+ case SpxInputTypeEnum.autocomplete:
1152
+ case SpxInputTypeEnum.text:
1153
+ case SpxInputTypeEnum.overlayNumber:
1154
+ this.textInput?.spxSetFocus();
1155
+ break;
1156
+ }
1043
1157
  }
1044
1158
  writeValue(value) {
1045
- this.value = this.lastValue = value == null ? '' : value;
1159
+ this.value = this.lastValue = value;
1046
1160
  }
1047
1161
  handleChangeEvent(value) {
1048
1162
  if (value !== this.lastValue) {
@@ -1066,7 +1180,8 @@ class SpxInputComponent {
1066
1180
  useExisting: SpxInputComponent,
1067
1181
  multi: true
1068
1182
  }
1069
- ], ngImport: i0, template: `<spx-input-box
1183
+ ], viewQueries: [{ propertyName: "textInput", first: true, predicate: SpxInputTextComponent, descendants: true }], ngImport: i0, template: `<spx-input-box
1184
+ [spxFocused]="this.spxFocused"
1070
1185
  [spxLabel]="this.spxLabel"
1071
1186
  [spxReadonly]="this.spxReadonly"
1072
1187
  [spxRequired]="this.spxRequired"
@@ -1082,7 +1197,7 @@ class SpxInputComponent {
1082
1197
  (spxHelp)="this.handleHelp()"
1083
1198
  (spxFocus)="this.setFocus()"
1084
1199
  (spxFocusOut)="this.setFocusOut()"
1085
- (spxSearchOutput)="this.handleSearch()">
1200
+ (spxSearch)="this.handleSearch()">
1086
1201
  <div controls>
1087
1202
  <spx-input-text
1088
1203
  *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
@@ -1155,7 +1270,7 @@ class SpxInputComponent {
1155
1270
  <div validation-messages>
1156
1271
  <ng-content></ng-content>
1157
1272
  </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"] }] }); }
1273
+ </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
1274
  }
1160
1275
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, decorators: [{
1161
1276
  type: Component,
@@ -1182,6 +1297,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1182
1297
  }
1183
1298
  ],
1184
1299
  template: `<spx-input-box
1300
+ [spxFocused]="this.spxFocused"
1185
1301
  [spxLabel]="this.spxLabel"
1186
1302
  [spxReadonly]="this.spxReadonly"
1187
1303
  [spxRequired]="this.spxRequired"
@@ -1197,7 +1313,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1197
1313
  (spxHelp)="this.handleHelp()"
1198
1314
  (spxFocus)="this.setFocus()"
1199
1315
  (spxFocusOut)="this.setFocusOut()"
1200
- (spxSearchOutput)="this.handleSearch()">
1316
+ (spxSearch)="this.handleSearch()">
1201
1317
  <div controls>
1202
1318
  <spx-input-text
1203
1319
  *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
@@ -1332,6 +1448,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1332
1448
  type: Output
1333
1449
  }], spxSearch: [{
1334
1450
  type: Output
1451
+ }], textInput: [{
1452
+ type: ViewChild,
1453
+ args: [SpxInputTextComponent]
1335
1454
  }], spxFocused: [{
1336
1455
  type: Input
1337
1456
  }], _handleBlurEvent: [{
@@ -1343,5 +1462,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1343
1462
  * Generated bundle index. Do not edit.
1344
1463
  */
1345
1464
 
1346
- export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent };
1465
+ export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent, SpxInputTypeEnum };
1347
1466
  //# sourceMappingURL=softpak-components-spx-inputs.mjs.map