@softpak/components 0.0.0-beta.10 → 0.0.0-beta.100

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 +98 -0
  17. package/esm2022/spx-inputs/spx-input-box.component.mjs +58 -44
  18. package/esm2022/spx-inputs/spx-input-text.component.mjs +22 -32
  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 +33 -21
  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 +202 -82
  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 +32 -20
  53. package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
  54. package/package.json +30 -12
  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,41 @@
1
- import { NgIf, NgFor } from '@angular/common';
1
+ import { NgIf, NgFor, JsonPipe } 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
+ console.log('focusout', ev.composedPath());
22
+ this.spxFocusOut.emit();
23
+ }
24
+ handleWindowClick(ev) {
25
+ if (ev.composedPath().includes(this.elRef.nativeElement)) {
26
+ if (!this.spxFocused) {
27
+ this.spxFocus.emit();
28
+ }
29
+ }
30
+ else {
31
+ this.spxFocused = false;
32
+ }
33
+ }
47
34
  onClear() {
48
35
  this.spxClear.emit();
49
36
  }
50
37
  onSearch() {
51
- this.spxSearchOutput.emit();
38
+ this.spxSearch.emit();
52
39
  }
53
40
  onEdit() {
54
41
  this.spxEdit.emit();
@@ -56,8 +43,25 @@ class SpxInputBoxComponent {
56
43
  onHelp() {
57
44
  this.spxHelp.emit();
58
45
  }
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"
46
+ constructor(elRef) {
47
+ this.elRef = elRef;
48
+ this.faEdit = faEdit;
49
+ this.faSearch = faSearch;
50
+ this.faQuestion = faQuestion;
51
+ this.faTimes = faTimes;
52
+ // @Element() el: HTMLElement;
53
+ this.spxFocused = false;
54
+ this.spxReadonly = false;
55
+ this.spxShowClear = true;
56
+ this.spxClear = new EventEmitter();
57
+ this.spxSearch = new EventEmitter();
58
+ this.spxFocus = new EventEmitter();
59
+ this.spxFocusOut = new EventEmitter();
60
+ this.spxEdit = new EventEmitter();
61
+ this.spxHelp = new EventEmitter();
62
+ }
63
+ 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 }); }
64
+ 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($event)", "document:click": "handleWindowClick($event)" } }, ngImport: i0, template: `<div class="flex rounded w-full gap-3"
61
65
  [class.rounded-none]="this.spxShowValidationMessages"
62
66
  [class.rounded-t]="this.spxShowValidationMessages"
63
67
  [class.outline-none]="this.spxFocused && !this.spxReadonly"
@@ -84,7 +88,6 @@ class SpxInputBoxComponent {
84
88
  (spxClick)="onEdit()"
85
89
  [spxFullHeight]="true"
86
90
  [spxSize]="'xl'"
87
- [spxTabIndex]="-1"
88
91
  [spxType]="'button'">
89
92
  <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
90
93
  </spx-button>
@@ -92,6 +95,7 @@ class SpxInputBoxComponent {
92
95
  *ngIf="this.spxShowHelp"
93
96
  (spxClick)="onHelp()"
94
97
  [spxFullHeight]="true"
98
+ [spxDisabled]="this.spxReadonly"
95
99
  [spxSize]="'xl'"
96
100
  [spxTabIndex]="-1"
97
101
  [spxType]="'button'">
@@ -101,6 +105,7 @@ class SpxInputBoxComponent {
101
105
  *ngIf="this.spxShowSearch"
102
106
  (spxClick)="onSearch()"
103
107
  [spxFullHeight]="true"
108
+ [spxDisabled]="this.spxReadonly"
104
109
  [spxSize]="'xl'"
105
110
  [spxTabIndex]="-1"
106
111
  [spxType]="'button'">
@@ -159,7 +164,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
159
164
  (spxClick)="onEdit()"
160
165
  [spxFullHeight]="true"
161
166
  [spxSize]="'xl'"
162
- [spxTabIndex]="-1"
163
167
  [spxType]="'button'">
164
168
  <fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
165
169
  </spx-button>
@@ -167,6 +171,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
167
171
  *ngIf="this.spxShowHelp"
168
172
  (spxClick)="onHelp()"
169
173
  [spxFullHeight]="true"
174
+ [spxDisabled]="this.spxReadonly"
170
175
  [spxSize]="'xl'"
171
176
  [spxTabIndex]="-1"
172
177
  [spxType]="'button'">
@@ -176,6 +181,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
176
181
  *ngIf="this.spxShowSearch"
177
182
  (spxClick)="onSearch()"
178
183
  [spxFullHeight]="true"
184
+ [spxDisabled]="this.spxReadonly"
179
185
  [spxSize]="'xl'"
180
186
  [spxTabIndex]="-1"
181
187
  [spxType]="'button'">
@@ -197,7 +203,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
197
203
  <ng-content select="[validation-messages]"></ng-content>
198
204
  </div>`,
199
205
  }]
200
- }], propDecorators: { spxLabel: [{
206
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { spxFocused: [{
207
+ type: Input
208
+ }], spxLabel: [{
201
209
  type: Input
202
210
  }], spxRequired: [{
203
211
  type: Input
@@ -219,7 +227,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
219
227
  type: Input
220
228
  }], spxClear: [{
221
229
  type: Output
222
- }], spxSearchOutput: [{
230
+ }], spxSearch: [{
223
231
  type: Output
224
232
  }], spxFocus: [{
225
233
  type: Output
@@ -229,8 +237,108 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
229
237
  type: Output
230
238
  }], spxHelp: [{
231
239
  type: Output
232
- }], spxFocused: [{
240
+ }], handleFocusIn: [{
241
+ type: HostListener,
242
+ args: ['focusout', ["$event"]]
243
+ }], handleFocusOut: [{
244
+ type: HostListener,
245
+ args: ['focusout', ["$event"]]
246
+ }], handleWindowClick: [{
247
+ type: HostListener,
248
+ args: ['document:click', ["$event"]]
249
+ }] } });
250
+
251
+ class SpxDropdownComponent {
252
+ constructor() {
253
+ this.focusPosition = 0;
254
+ this.spxSuggestions = [];
255
+ this.spxSelect = new EventEmitter();
256
+ }
257
+ ngOnInit() {
258
+ this.listenToKeyUp();
259
+ }
260
+ ngOnChanges(changes) {
261
+ this.focusPosition = 0;
262
+ }
263
+ ngOnDestroy() {
264
+ this.subscriptionKeyUp?.unsubscribe();
265
+ }
266
+ handleSuggestionClick(valuePair) {
267
+ console.log('handleSuggestionClick', valuePair);
268
+ this.select(valuePair);
269
+ }
270
+ listenToKeyUp() {
271
+ this.subscriptionKeyUp = fromEvent(window, 'keyup').subscribe((event) => {
272
+ if (event.key === 'ArrowUp' && this.focusPosition > 0) {
273
+ this.focusPosition = this.focusPosition - 1;
274
+ event.preventDefault();
275
+ }
276
+ if (event.key === 'ArrowDown' && this.focusPosition < this.spxSuggestions.length - 1) {
277
+ this.focusPosition = this.focusPosition + 1;
278
+ event.preventDefault();
279
+ }
280
+ if (event.key === 'Enter' && this.spxSuggestions.length > 0) {
281
+ this.select(this.spxSuggestions.at(this.focusPosition));
282
+ event.preventDefault();
283
+ }
284
+ });
285
+ }
286
+ select(valuePair) {
287
+ this.focusPosition = 0;
288
+ this.spxSelect.emit(valuePair);
289
+ }
290
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
291
+ 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">
292
+ {{ this.spxSuggestions | json }}
293
+ <div
294
+ class="absolute bg-gray-100 left-0 right-0 z-20">
295
+ <button
296
+ *ngFor="let valuePair of this.spxSuggestions; let i = index"
297
+ class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center text-left"
298
+ [class.bg-gray-100]="i === this.focusPosition"
299
+ [class.bg-white]="i !== this.focusPosition"
300
+ (click)="this.handleSuggestionClick(valuePair)"
301
+ [attr.tabindex]="-1"
302
+ [type]="'button'">
303
+ <div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
304
+ <spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'" [spxTabIndex]="-1"]>Select</spx-button>
305
+ </button>
306
+ </div>
307
+ </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"] }, { kind: "pipe", type: JsonPipe, name: "json" }] }); }
308
+ }
309
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, decorators: [{
310
+ type: Component,
311
+ args: [{
312
+ selector: 'spx-dropdown',
313
+ standalone: true,
314
+ imports: [
315
+ NgIf,
316
+ NgFor,
317
+ SpxButtonComponent,
318
+ JsonPipe,
319
+ ],
320
+ template: `<div class="relative text-black">
321
+ {{ this.spxSuggestions | json }}
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
+ [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,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
323
423
  NgIf,
324
424
  NgFor,
325
425
  SpxButtonComponent,
426
+ SpxDropdownComponent,
427
+ JsonPipe,
326
428
  ],
327
429
  template: `<div class="relative text-black">
328
430
  <input
431
+ #input
329
432
  class="font-bold text-lg w-full outline-none"
330
433
  [class.bg-white]="!this.spxReadonly"
331
434
  [class.bg-gray-300]="this.spxReadonly"
@@ -337,26 +440,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
337
440
  [attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
338
441
  [attr.name]="this.spxName"
339
442
  [attr.type]="this.spxType"
340
- [attr.value]="this.value?.description ? this.value?.description : this.value?.value"
443
+ [value]="this.value?.description ? this.value?.description : this.value?.value"
341
444
  (blur)="this.handleBlur()"
342
445
  (keyUp)="this.handleKeyUp()"
343
446
  (focus)="this.handleFocus()"
344
447
  (input)="this.handleDescriptionInput($event)"
345
448
  />
346
449
  <span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
347
- <div
450
+ <spx-dropdown
348
451
  *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>
452
+ [spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
453
+ </spx-dropdown>
360
454
  </div>`,
361
455
  }]
362
456
  }], propDecorators: { spxName: [{
@@ -389,6 +483,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
389
483
  type: Output
390
484
  }], spxWasInternalUpdate: [{
391
485
  type: Input
486
+ }], inputRef: [{
487
+ type: ViewChild,
488
+ args: ['input', { static: true }]
392
489
  }] } });
393
490
 
394
491
  class SpxInputDateComponent {
@@ -968,6 +1065,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
968
1065
  type: Output
969
1066
  }] } });
970
1067
 
1068
+ var SpxInputTypeEnum;
1069
+ (function (SpxInputTypeEnum) {
1070
+ SpxInputTypeEnum["autocomplete"] = "autocomplete";
1071
+ SpxInputTypeEnum["date"] = "date";
1072
+ SpxInputTypeEnum["float"] = "float";
1073
+ SpxInputTypeEnum["overlay"] = "overlay";
1074
+ SpxInputTypeEnum["overlayNumber"] = "overlaynumber";
1075
+ SpxInputTypeEnum["radio"] = "radio";
1076
+ SpxInputTypeEnum["number"] = "number";
1077
+ SpxInputTypeEnum["password"] = "password";
1078
+ SpxInputTypeEnum["text"] = "text";
1079
+ SpxInputTypeEnum["textNumericKeyboard"] = "textNumericKeyboard";
1080
+ })(SpxInputTypeEnum || (SpxInputTypeEnum = {}));
1081
+
971
1082
  class SpxInputComponent {
972
1083
  constructor() {
973
1084
  this.spxLabel = 'label';
@@ -983,7 +1094,7 @@ class SpxInputComponent {
983
1094
  this.spxShowSearch = false;
984
1095
  this.spxShowValidationMessages = false;
985
1096
  this.spxSuggestions = [];
986
- this.spxType = 'text';
1097
+ this.spxType = SpxInputTypeEnum.text;
987
1098
  this.spxCapitalize = false;
988
1099
  this.spxBlur = new EventEmitter();
989
1100
  this.spxClear = new EventEmitter();
@@ -996,9 +1107,6 @@ class SpxInputComponent {
996
1107
  this.onChange = () => { };
997
1108
  this.onTouched = () => { };
998
1109
  }
999
- async spxSetFocus() {
1000
- this.passFocusToControl();
1001
- }
1002
1110
  handleBlur() {
1003
1111
  this.spxBlur.emit();
1004
1112
  }
@@ -1040,9 +1148,16 @@ class SpxInputComponent {
1040
1148
  this.spxFocused = true;
1041
1149
  }
1042
1150
  passFocusToControl() {
1151
+ switch (this.spxType) {
1152
+ case SpxInputTypeEnum.autocomplete:
1153
+ case SpxInputTypeEnum.text:
1154
+ case SpxInputTypeEnum.overlayNumber:
1155
+ this.textInput?.spxSetFocus();
1156
+ break;
1157
+ }
1043
1158
  }
1044
1159
  writeValue(value) {
1045
- this.value = this.lastValue = value == null ? '' : value;
1160
+ this.value = this.lastValue = value;
1046
1161
  }
1047
1162
  handleChangeEvent(value) {
1048
1163
  if (value !== this.lastValue) {
@@ -1066,7 +1181,8 @@ class SpxInputComponent {
1066
1181
  useExisting: SpxInputComponent,
1067
1182
  multi: true
1068
1183
  }
1069
- ], ngImport: i0, template: `<spx-input-box
1184
+ ], viewQueries: [{ propertyName: "textInput", first: true, predicate: SpxInputTextComponent, descendants: true }], ngImport: i0, template: `<spx-input-box
1185
+ [spxFocused]="this.spxFocused"
1070
1186
  [spxLabel]="this.spxLabel"
1071
1187
  [spxReadonly]="this.spxReadonly"
1072
1188
  [spxRequired]="this.spxRequired"
@@ -1082,7 +1198,7 @@ class SpxInputComponent {
1082
1198
  (spxHelp)="this.handleHelp()"
1083
1199
  (spxFocus)="this.setFocus()"
1084
1200
  (spxFocusOut)="this.setFocusOut()"
1085
- (spxSearchOutput)="this.handleSearch()">
1201
+ (spxSearch)="this.handleSearch()">
1086
1202
  <div controls>
1087
1203
  <spx-input-text
1088
1204
  *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
@@ -1155,7 +1271,7 @@ class SpxInputComponent {
1155
1271
  <div validation-messages>
1156
1272
  <ng-content></ng-content>
1157
1273
  </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"] }] }); }
1274
+ </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
1275
  }
1160
1276
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, decorators: [{
1161
1277
  type: Component,
@@ -1182,6 +1298,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1182
1298
  }
1183
1299
  ],
1184
1300
  template: `<spx-input-box
1301
+ [spxFocused]="this.spxFocused"
1185
1302
  [spxLabel]="this.spxLabel"
1186
1303
  [spxReadonly]="this.spxReadonly"
1187
1304
  [spxRequired]="this.spxRequired"
@@ -1197,7 +1314,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1197
1314
  (spxHelp)="this.handleHelp()"
1198
1315
  (spxFocus)="this.setFocus()"
1199
1316
  (spxFocusOut)="this.setFocusOut()"
1200
- (spxSearchOutput)="this.handleSearch()">
1317
+ (spxSearch)="this.handleSearch()">
1201
1318
  <div controls>
1202
1319
  <spx-input-text
1203
1320
  *ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
@@ -1332,6 +1449,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1332
1449
  type: Output
1333
1450
  }], spxSearch: [{
1334
1451
  type: Output
1452
+ }], textInput: [{
1453
+ type: ViewChild,
1454
+ args: [SpxInputTextComponent]
1335
1455
  }], spxFocused: [{
1336
1456
  type: Input
1337
1457
  }], _handleBlurEvent: [{
@@ -1343,5 +1463,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
1343
1463
  * Generated bundle index. Do not edit.
1344
1464
  */
1345
1465
 
1346
- export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent };
1466
+ export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent, SpxInputTypeEnum };
1347
1467
  //# sourceMappingURL=softpak-components-spx-inputs.mjs.map