@softpak/components 19.15.3 → 19.15.4-beta

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 (68) hide show
  1. package/fesm2022/softpak-components-spx-alert.mjs +7 -6
  2. package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
  3. package/fesm2022/softpak-components-spx-app-expiry.mjs +23 -91
  4. package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
  5. package/fesm2022/softpak-components-spx-button.mjs +8 -22
  6. package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
  7. package/fesm2022/softpak-components-spx-card.mjs +17 -88
  8. package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
  9. package/fesm2022/softpak-components-spx-change-details.mjs +50 -70
  10. package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
  11. package/fesm2022/softpak-components-spx-check-digit.mjs +23 -27
  12. package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
  13. package/fesm2022/softpak-components-spx-confirm.mjs +15 -10
  14. package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
  15. package/fesm2022/softpak-components-spx-form-section.mjs +8 -33
  16. package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
  17. package/fesm2022/softpak-components-spx-form-view.mjs +39 -53
  18. package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
  19. package/fesm2022/softpak-components-spx-inputs.mjs +2 -0
  20. package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
  21. package/fesm2022/softpak-components-spx-navigation.mjs +34 -89
  22. package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
  23. package/fesm2022/softpak-components-spx-number-check.mjs +91 -198
  24. package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
  25. package/fesm2022/softpak-components-spx-pagination.mjs +12 -21
  26. package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
  27. package/fesm2022/softpak-components-spx-patch.mjs +8 -39
  28. package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
  29. package/fesm2022/softpak-components-spx-progress-bar.mjs +8 -22
  30. package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
  31. package/fesm2022/softpak-components-spx-spinner.mjs +15 -160
  32. package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
  33. package/fesm2022/softpak-components-spx-stock-info.mjs +69 -124
  34. package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
  35. package/fesm2022/softpak-components-spx-toaster.mjs +36 -155
  36. package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
  37. package/fesm2022/softpak-components-spx-update.mjs +3 -3
  38. package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
  39. package/fesm2022/softpak-components-spx-validation.mjs +68 -54
  40. package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
  41. package/package.json +28 -28
  42. package/spx-alert/spx-alert.component.d.ts +1 -1
  43. package/spx-app-expiry/spx-app-expiry.component.d.ts +14 -14
  44. package/spx-button/spx-button.component.d.ts +0 -3
  45. package/spx-card/spx-card-item/spx-card-item.component.d.ts +0 -1
  46. package/spx-card/spx-card.component.d.ts +8 -9
  47. package/spx-change-details/spx-change-details.component.d.ts +22 -23
  48. package/spx-check-digit/spx-check-digit.component.d.ts +9 -9
  49. package/spx-confirm/store/spx-confirm.actions.d.ts +8 -1
  50. package/spx-confirm/store/spx-confirm.effects.d.ts +1 -1
  51. package/spx-form-section/spx-form-section.component.d.ts +5 -5
  52. package/spx-form-view/spx-autocomplete-search.component.d.ts +15 -16
  53. package/spx-form-view/spx-form-view.component.d.ts +1 -1
  54. package/spx-navigation/public-api.d.ts +2 -2
  55. package/spx-navigation/spx-home-tile/spx-home-tile.component.d.ts +11 -0
  56. package/spx-navigation/{spx-home-tiles.component.d.ts → spx-home-tile/spx-home-tiles.component.d.ts} +2 -2
  57. package/spx-navigation/spx-navigation.component.d.ts +11 -8
  58. package/spx-number-check/spx-number-check.component.d.ts +26 -32
  59. package/spx-pagination/spx-pagination.component.d.ts +9 -10
  60. package/spx-patch/spx-patch.component.d.ts +4 -4
  61. package/spx-progress-bar/spx-progress-bar.component.d.ts +3 -3
  62. package/spx-spinner/spx-spinner.component.d.ts +3 -3
  63. package/spx-stock-info/spx-stock-info.component.d.ts +45 -46
  64. package/spx-toaster/src/spx-toaster-message.interface.d.ts +3 -1
  65. package/spx-toaster/src/spx-toaster.component.d.ts +7 -13
  66. package/spx-validation/spx-validate-control.component.d.ts +19 -19
  67. package/tailwind.css +1 -1
  68. package/spx-navigation/spx-home-tile.component.d.ts +0 -11
@@ -1,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, Input, Output, input, output, viewChildren, ElementRef, ChangeDetectionStrategy } from '@angular/core';
2
+ import { signal, input, output, computed, Component, ChangeDetectionStrategy, viewChildren, ElementRef } from '@angular/core';
3
3
  import * as i1 from '@angular/forms';
4
4
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
5
5
  import { debounceTime } from 'rxjs';
6
6
  import { SpxButtonComponent } from '@softpak/components/spx-button';
7
- import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
7
+ import { SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';
8
8
  import { SpxInputTypeEnum, SpxInputComponent } from '@softpak/components/spx-inputs';
9
9
  import * as i2 from '@ngx-translate/core';
10
10
  import { TranslateModule } from '@ngx-translate/core';
@@ -22,14 +22,18 @@ const sectionAutocompleteSearch = 'autocompleteSearch';
22
22
  const ctrlQuery = 'query';
23
23
  const ctrlOptions = 'options';
24
24
  class SpxAutocompleteSearchComponent {
25
- get ctrlQuery() { return this.formGroup.get(ctrlQuery); }
26
- get ctrlOptions() { return this.formGroup.get(ctrlOptions); }
27
25
  constructor(formBuilder) {
28
26
  this.formBuilder = formBuilder;
29
- this.spxSuggestions = [];
30
- this.spxCancel = new EventEmitter();
31
- this.spxSearch = new EventEmitter();
32
- this.spxSubmit = new EventEmitter();
27
+ this.formGroup = signal(null);
28
+ this.spxSuggestions = input([]);
29
+ this.spxField = input.required();
30
+ this.txtOptions = input.required();
31
+ this.txtQuery = input.required();
32
+ this.txtSubmit = input.required();
33
+ this.spxValuePair = input.required();
34
+ this.spxCancel = output();
35
+ this.spxSearch = output();
36
+ this.spxSubmit = output();
33
37
  this.inputTypeRadio = SpxInputTypeEnum.radio;
34
38
  this.inputTypeText = SpxInputTypeEnum.text;
35
39
  this.SpxSeverity = SpxSeverityEnum;
@@ -41,38 +45,37 @@ class SpxAutocompleteSearchComponent {
41
45
  {
42
46
  key: ctrlQuery,
43
47
  type: () => SpxInputTypeEnum.text,
44
- label: () => this.txtQuery,
48
+ label: () => this.txtQuery(),
45
49
  capitalize: () => true,
46
50
  },
47
51
  {
48
52
  key: ctrlOptions,
49
53
  type: () => SpxInputTypeEnum.radio,
50
- label: () => this.txtOptions,
54
+ label: () => this.txtOptions(),
51
55
  },
52
56
  ]
53
57
  }
54
58
  ];
59
+ this.ctrlQuery = computed(() => this.formGroup()?.get(ctrlQuery));
60
+ this.ctrlOptions = computed(() => this.formGroup()?.get(ctrlOptions));
61
+ this.subscriptions = {};
55
62
  this.createForm();
56
63
  }
57
64
  ngOnInit() {
58
65
  this.listenToSelection();
59
66
  this.listenToQuery();
60
- this.ctrlQuery.setValue(this.spxValuePair, { emitEvent: false });
61
- this.spxSearch.emit(this.spxValuePair);
67
+ const spxValuePair = this.spxValuePair();
68
+ this.ctrlQuery().setValue(spxValuePair, { emitEvent: false });
69
+ this.spxSearch.emit(spxValuePair);
62
70
  }
63
71
  ngOnDestroy() {
64
- if (this.subSelection) {
65
- this.subSelection.unsubscribe();
66
- }
67
- if (this.subQuery) {
68
- this.subQuery.unsubscribe();
69
- }
72
+ unsubscribeSubscriptions(this.subscriptions);
70
73
  }
71
74
  createForm() {
72
- this.formGroup = this.formBuilder.group({
75
+ this.formGroup.set(this.formBuilder.group({
73
76
  [ctrlQuery]: [null],
74
77
  [ctrlOptions]: [null],
75
- });
78
+ }));
76
79
  }
77
80
  getRawValidators(formControl) {
78
81
  return formControl._rawValidators;
@@ -81,20 +84,20 @@ class SpxAutocompleteSearchComponent {
81
84
  this.spxCancel.emit();
82
85
  }
83
86
  onSubmit() {
84
- this.spxSubmit.emit(this.ctrlQuery.value);
87
+ this.spxSubmit.emit(this.ctrlQuery().value);
85
88
  }
86
89
  listenToQuery() {
87
- this.subQuery = this.ctrlQuery.valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {
90
+ this.subscriptions.subQuery = this.ctrlQuery().valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {
88
91
  this.spxSearch.emit(valuePair);
89
92
  });
90
93
  }
91
94
  listenToSelection() {
92
- this.subSelection = this.ctrlOptions.valueChanges.subscribe(valuePair => {
93
- this.ctrlQuery.setValue(valuePair);
95
+ this.subscriptions.subSelection = this.ctrlOptions().valueChanges.subscribe(valuePair => {
96
+ this.ctrlQuery().setValue(valuePair);
94
97
  });
95
98
  }
96
99
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxAutocompleteSearchComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
97
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SpxAutocompleteSearchComponent, isStandalone: true, selector: "spx-autocomplete-search", inputs: { spxSuggestions: "spxSuggestions", spxField: "spxField", txtOptions: "txtOptions", txtQuery: "txtQuery", txtSubmit: "txtSubmit", spxValuePair: "spxValuePair" }, outputs: { spxCancel: "spxCancel", spxSearch: "spxSearch", spxSubmit: "spxSubmit" }, ngImport: i0, template: "<form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\r\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\r\n <spx-input [formControl]=\"ctrlQuery\" [spxLabel]=\"txtQuery\" [spxType]=\"inputTypeText\">\r\n </spx-input>\r\n <spx-input [formControl]=\"ctrlOptions\" [spxLabel]=\"txtOptions\" [spxSuggestions]=\"spxSuggestions\"\r\n [spxType]=\"inputTypeRadio\">\r\n </spx-input>\r\n </div>\r\n <div class=\"py-3 flex flex-col gap-3\">\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\r\n Save\r\n </spx-button>\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\r\n Cancel\r\n </spx-button>\r\n </div>\r\n </div>\r\n</form>", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }] }); }
100
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxAutocompleteSearchComponent, isStandalone: true, selector: "spx-autocomplete-search", inputs: { spxSuggestions: { classPropertyName: "spxSuggestions", publicName: "spxSuggestions", isSignal: true, isRequired: false, transformFunction: null }, spxField: { classPropertyName: "spxField", publicName: "spxField", isSignal: true, isRequired: true, transformFunction: null }, txtOptions: { classPropertyName: "txtOptions", publicName: "txtOptions", isSignal: true, isRequired: true, transformFunction: null }, txtQuery: { classPropertyName: "txtQuery", publicName: "txtQuery", isSignal: true, isRequired: true, transformFunction: null }, txtSubmit: { classPropertyName: "txtSubmit", publicName: "txtSubmit", isSignal: true, isRequired: true, transformFunction: null }, spxValuePair: { classPropertyName: "spxValuePair", publicName: "spxValuePair", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxCancel: "spxCancel", spxSearch: "spxSearch", spxSubmit: "spxSubmit" }, ngImport: i0, template: "@if(formGroup()) {\r\n <form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup()!\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\r\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\r\n <spx-input [formControl]=\"ctrlQuery()\" [spxLabel]=\"txtQuery()\" [spxType]=\"inputTypeText\">\r\n </spx-input>\r\n <spx-input [formControl]=\"ctrlOptions()\" [spxLabel]=\"txtOptions()\" [spxSuggestions]=\"spxSuggestions()\"\r\n [spxType]=\"inputTypeRadio\">\r\n </spx-input>\r\n </div>\r\n <div class=\"py-3 flex flex-col gap-3\">\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\r\n Save\r\n </spx-button>\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\r\n Cancel\r\n </spx-button>\r\n </div>\r\n </div>\r\n </form>\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
98
101
  }
99
102
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxAutocompleteSearchComponent, decorators: [{
100
103
  type: Component,
@@ -103,26 +106,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
103
106
  ReactiveFormsModule,
104
107
  SpxButtonComponent,
105
108
  SpxInputComponent,
106
- ], template: "<form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\r\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\r\n <spx-input [formControl]=\"ctrlQuery\" [spxLabel]=\"txtQuery\" [spxType]=\"inputTypeText\">\r\n </spx-input>\r\n <spx-input [formControl]=\"ctrlOptions\" [spxLabel]=\"txtOptions\" [spxSuggestions]=\"spxSuggestions\"\r\n [spxType]=\"inputTypeRadio\">\r\n </spx-input>\r\n </div>\r\n <div class=\"py-3 flex flex-col gap-3\">\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\r\n Save\r\n </spx-button>\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\r\n Cancel\r\n </spx-button>\r\n </div>\r\n </div>\r\n</form>" }]
107
- }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { spxSuggestions: [{
108
- type: Input
109
- }], spxField: [{
110
- type: Input
111
- }], txtOptions: [{
112
- type: Input
113
- }], txtQuery: [{
114
- type: Input
115
- }], txtSubmit: [{
116
- type: Input
117
- }], spxValuePair: [{
118
- type: Input
119
- }], spxCancel: [{
120
- type: Output
121
- }], spxSearch: [{
122
- type: Output
123
- }], spxSubmit: [{
124
- type: Output
125
- }] } });
109
+ ], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if(formGroup()) {\r\n <form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup()!\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\r\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\r\n <spx-input [formControl]=\"ctrlQuery()\" [spxLabel]=\"txtQuery()\" [spxType]=\"inputTypeText\">\r\n </spx-input>\r\n <spx-input [formControl]=\"ctrlOptions()\" [spxLabel]=\"txtOptions()\" [spxSuggestions]=\"spxSuggestions()\"\r\n [spxType]=\"inputTypeRadio\">\r\n </spx-input>\r\n </div>\r\n <div class=\"py-3 flex flex-col gap-3\">\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\r\n Save\r\n </spx-button>\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\r\n Cancel\r\n </spx-button>\r\n </div>\r\n </div>\r\n </form>\r\n}\r\n" }]
110
+ }], ctorParameters: () => [{ type: i1.FormBuilder }] });
126
111
 
127
112
  class SpxFormViewComponent {
128
113
  setAutofocus(key) {
@@ -143,22 +128,22 @@ class SpxFormViewComponent {
143
128
  });
144
129
  }
145
130
  onAutocompleteCancel() {
146
- this.autocompleteField = undefined;
131
+ this.autoCompleteField.set(null);
147
132
  }
148
133
  onAutocompleteSearch(valuePair) {
149
- if (this.autocompleteField) {
134
+ if (this.autoCompleteField()) {
150
135
  this.spxSearch.emit({
151
- field: this.autocompleteField,
136
+ field: this.autoCompleteField(),
152
137
  valuePair,
153
138
  });
154
139
  }
155
140
  }
156
141
  onAutocompleteSave(valuePair) {
157
- this.spxFormGroup().get(this.autocompleteField.key)?.setValue(valuePair);
158
- this.autocompleteField = undefined;
142
+ this.spxFormGroup().get(this.autoCompleteField().key)?.setValue(valuePair);
143
+ this.autoCompleteField.set(null);
159
144
  }
160
145
  onSearch(field) {
161
- this.autocompleteField = field;
146
+ this.autoCompleteField.set(field);
162
147
  }
163
148
  getRawValidators(formControl) {
164
149
  // eslint-disable-next-line no-underscore-dangle
@@ -203,6 +188,7 @@ class SpxFormViewComponent {
203
188
  this.spxClick = output();
204
189
  this.spxSearch = output();
205
190
  this.spxInputs = viewChildren((ElementRef));
191
+ this.autoCompleteField = signal(null);
206
192
  this.typeAutocomplete = SpxInputTypeEnum.autocomplete;
207
193
  this.typeButton = SpxInputTypeEnum.button;
208
194
  this.typeFloat = SpxInputTypeEnum.float;
@@ -214,7 +200,7 @@ class SpxFormViewComponent {
214
200
  this.typeOverlayNumber = SpxInputTypeEnum.overlayNumber;
215
201
  }
216
202
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxFormViewComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
217
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxFormViewComponent, isStandalone: true, selector: "spx-form-view", inputs: { spxFormGroup: { classPropertyName: "spxFormGroup", publicName: "spxFormGroup", isSignal: true, isRequired: true, transformFunction: null }, spxForm: { classPropertyName: "spxForm", publicName: "spxForm", isSignal: true, isRequired: true, transformFunction: null }, spxSuggestions: { classPropertyName: "spxSuggestions", publicName: "spxSuggestions", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxBlur: "spxBlur", spxClick: "spxClick", spxSearch: "spxSearch" }, viewQueries: [{ propertyName: "spxInputs", predicate: (ElementRef), descendants: true, isSignal: true }], ngImport: i0, template: "@if (autocompleteField) {\r\n <spx-autocomplete-search\r\n [spxField]=\"autocompleteField\"\r\n [spxSuggestions]=\"this.spxSuggestions()[autocompleteField.key]\"\r\n [spxValuePair]=\"$any(this.spxFormGroup().get(autocompleteField.key)).value\"\r\n [txtOptions]=\"'Options'\"\r\n [txtQuery]=\"'Query'\"\r\n [txtSubmit]=\"'Save'\"\r\n (spxCancel)=\"onAutocompleteCancel()\"\r\n (spxSearch)=\"onAutocompleteSearch($event)\"\r\n (spxSubmit)=\"onAutocompleteSave($event)\">\r\n </spx-autocomplete-search>\r\n}\r\n<div class=\"flex flex-col gap-3\">\r\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\r\n <spx-form-section\r\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\r\n [spxIndex]=\"spxSectionIndex + 1\"\r\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\r\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\r\n @if (spxField.show === undefined || spxField.show()) {\r\n @if (spxField.type() === typeButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\r\n [spxType]=\"'button'\"\r\n (spxClick)=\"onClick(spxField)\"\r\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\r\n }\r\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\r\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\r\n [spxType]=\"spxField.type()\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n (spxBlur)=\"onBlur(spxField)\"\r\n (spxSearch)=\"onSearch(spxField)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n @if (spxField.type() === typeRadio) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n [spxType]=\"typeRadio\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n }\r\n \r\n }\r\n </spx-form-section>\r\n }\r\n\r\n @for (spxButton of spxForm().buttons; track spxButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxButton.severity\"\r\n [spxType]=\"spxButton.type\"\r\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\r\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\r\n </spx-button>\r\n }\r\n</div>", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: SpxAutocompleteSearchComponent, selector: "spx-autocomplete-search", inputs: ["spxSuggestions", "spxField", "txtOptions", "txtQuery", "txtSubmit", "spxValuePair"], outputs: ["spxCancel", "spxSearch", "spxSubmit"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "component", type: SpxFormSectionComponent, selector: "spx-form-section", inputs: ["spxIndex", "spxIndexSecondary", "spxTitle", "spxShowTitle"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
203
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxFormViewComponent, isStandalone: true, selector: "spx-form-view", inputs: { spxFormGroup: { classPropertyName: "spxFormGroup", publicName: "spxFormGroup", isSignal: true, isRequired: true, transformFunction: null }, spxForm: { classPropertyName: "spxForm", publicName: "spxForm", isSignal: true, isRequired: true, transformFunction: null }, spxSuggestions: { classPropertyName: "spxSuggestions", publicName: "spxSuggestions", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxBlur: "spxBlur", spxClick: "spxClick", spxSearch: "spxSearch" }, viewQueries: [{ propertyName: "spxInputs", predicate: (ElementRef), descendants: true, isSignal: true }], ngImport: i0, template: "@if (autoCompleteField()) {\r\n <spx-autocomplete-search\r\n [spxField]=\"autoCompleteField()!\"\r\n [spxSuggestions]=\"this.spxSuggestions()[autoCompleteField()!.key]\"\r\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\r\n [txtOptions]=\"'Options'\"\r\n [txtQuery]=\"'Query'\"\r\n [txtSubmit]=\"'Save'\"\r\n (spxCancel)=\"onAutocompleteCancel()\"\r\n (spxSearch)=\"onAutocompleteSearch($event)\"\r\n (spxSubmit)=\"onAutocompleteSave($event)\">\r\n </spx-autocomplete-search>\r\n}\r\n<div class=\"flex flex-col gap-3\">\r\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\r\n <spx-form-section\r\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\r\n [spxIndex]=\"spxSectionIndex + 1\"\r\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\r\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\r\n @if (spxField.show === undefined || spxField.show()) {\r\n @if (spxField.type() === typeButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\r\n [spxType]=\"'button'\"\r\n (spxClick)=\"onClick(spxField)\"\r\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\r\n }\r\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\r\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\r\n [spxType]=\"spxField.type()\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n (spxBlur)=\"onBlur(spxField)\"\r\n (spxSearch)=\"onSearch(spxField)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n @if (spxField.type() === typeRadio) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n [spxType]=\"typeRadio\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n }\r\n \r\n }\r\n </spx-form-section>\r\n }\r\n\r\n @for (spxButton of spxForm().buttons; track spxButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxButton.severity\"\r\n [spxType]=\"spxButton.type\"\r\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\r\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\r\n </spx-button>\r\n }\r\n</div>", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: SpxAutocompleteSearchComponent, selector: "spx-autocomplete-search", inputs: ["spxSuggestions", "spxField", "txtOptions", "txtQuery", "txtSubmit", "spxValuePair"], outputs: ["spxCancel", "spxSearch", "spxSubmit"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "component", type: SpxFormSectionComponent, selector: "spx-form-section", inputs: ["spxIndex", "spxIndexSecondary", "spxTitle", "spxShowTitle"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
218
204
  }
219
205
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxFormViewComponent, decorators: [{
220
206
  type: Component,
@@ -228,7 +214,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
228
214
  SpxInputComponent,
229
215
  SpxValidateControlComponent,
230
216
  TranslateModule
231
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (autocompleteField) {\r\n <spx-autocomplete-search\r\n [spxField]=\"autocompleteField\"\r\n [spxSuggestions]=\"this.spxSuggestions()[autocompleteField.key]\"\r\n [spxValuePair]=\"$any(this.spxFormGroup().get(autocompleteField.key)).value\"\r\n [txtOptions]=\"'Options'\"\r\n [txtQuery]=\"'Query'\"\r\n [txtSubmit]=\"'Save'\"\r\n (spxCancel)=\"onAutocompleteCancel()\"\r\n (spxSearch)=\"onAutocompleteSearch($event)\"\r\n (spxSubmit)=\"onAutocompleteSave($event)\">\r\n </spx-autocomplete-search>\r\n}\r\n<div class=\"flex flex-col gap-3\">\r\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\r\n <spx-form-section\r\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\r\n [spxIndex]=\"spxSectionIndex + 1\"\r\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\r\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\r\n @if (spxField.show === undefined || spxField.show()) {\r\n @if (spxField.type() === typeButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\r\n [spxType]=\"'button'\"\r\n (spxClick)=\"onClick(spxField)\"\r\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\r\n }\r\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\r\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\r\n [spxType]=\"spxField.type()\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n (spxBlur)=\"onBlur(spxField)\"\r\n (spxSearch)=\"onSearch(spxField)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n @if (spxField.type() === typeRadio) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n [spxType]=\"typeRadio\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n }\r\n \r\n }\r\n </spx-form-section>\r\n }\r\n\r\n @for (spxButton of spxForm().buttons; track spxButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxButton.severity\"\r\n [spxType]=\"spxButton.type\"\r\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\r\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\r\n </spx-button>\r\n }\r\n</div>" }]
217
+ ], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (autoCompleteField()) {\r\n <spx-autocomplete-search\r\n [spxField]=\"autoCompleteField()!\"\r\n [spxSuggestions]=\"this.spxSuggestions()[autoCompleteField()!.key]\"\r\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\r\n [txtOptions]=\"'Options'\"\r\n [txtQuery]=\"'Query'\"\r\n [txtSubmit]=\"'Save'\"\r\n (spxCancel)=\"onAutocompleteCancel()\"\r\n (spxSearch)=\"onAutocompleteSearch($event)\"\r\n (spxSubmit)=\"onAutocompleteSave($event)\">\r\n </spx-autocomplete-search>\r\n}\r\n<div class=\"flex flex-col gap-3\">\r\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\r\n <spx-form-section\r\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\r\n [spxIndex]=\"spxSectionIndex + 1\"\r\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\r\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\r\n @if (spxField.show === undefined || spxField.show()) {\r\n @if (spxField.type() === typeButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\r\n [spxType]=\"'button'\"\r\n (spxClick)=\"onClick(spxField)\"\r\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\r\n }\r\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\r\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\r\n [spxType]=\"spxField.type()\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n (spxBlur)=\"onBlur(spxField)\"\r\n (spxSearch)=\"onSearch(spxField)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n @if (spxField.type() === typeRadio) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n [spxType]=\"typeRadio\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n }\r\n \r\n }\r\n </spx-form-section>\r\n }\r\n\r\n @for (spxButton of spxForm().buttons; track spxButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxButton.severity\"\r\n [spxType]=\"spxButton.type\"\r\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\r\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\r\n </spx-button>\r\n }\r\n</div>" }]
232
218
  }], ctorParameters: () => [{ type: i1.FormBuilder }] });
233
219
 
234
220
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-form-view.mjs","sources":["../../../../projects/softpak/components/spx-form-view/spx-form-button-type.enum.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.html","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.ts","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.html","../../../../projects/softpak/components/spx-form-view/softpak-components-spx-form-view.ts"],"sourcesContent":["export enum SpxFormButtonTypeEnum {\r\n button = 'button',\r\n submit = 'submit',\r\n}\r\n","import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';\r\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { Subscription, debounceTime } from 'rxjs';\r\n\r\nimport { SpxFormFieldI } from './spx-form-field.interface';\r\nimport { SpxFormSectionI } from './spx-form-section.interface';\r\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\r\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\r\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\r\n\r\nexport const sectionAutocompleteSearch = 'autocompleteSearch';\r\nexport const ctrlQuery = 'query';\r\nexport const ctrlOptions = 'options';\r\n\r\n@Component({\r\n selector: 'spx-autocomplete-search',\r\n templateUrl: './spx-autocomplete-search.component.html',\r\n imports: [\r\n FormsModule,\r\n ReactiveFormsModule,\r\n SpxButtonComponent,\r\n SpxInputComponent,\r\n ]\r\n})\r\nexport class SpxAutocompleteSearchComponent implements OnInit, OnDestroy {\r\n formGroup!: FormGroup;\r\n @Input() spxSuggestions: SpxValuePair<any>[] = [];\r\n @Input() spxField!: SpxFormFieldI;\r\n @Input() txtOptions!: string;\r\n @Input() txtQuery!: string;\r\n @Input() txtSubmit!: string;\r\n @Input() spxValuePair!: SpxValuePair<any>;\r\n @Output() spxCancel: EventEmitter<void> = new EventEmitter<void>();\r\n @Output() spxSearch: EventEmitter<SpxValuePair<any>> = new EventEmitter<SpxValuePair<any>>(); \r\n @Output() spxSubmit: EventEmitter<SpxValuePair<any>> = new EventEmitter<SpxValuePair<any>>();\r\n inputTypeRadio = SpxInputTypeEnum.radio;\r\n inputTypeText = SpxInputTypeEnum.text;\r\n SpxSeverity = SpxSeverityEnum;\r\n \r\n sections: SpxFormSectionI[] = [\r\n {\r\n key: sectionAutocompleteSearch,\r\n showTitle: () => false,\r\n fields: [\r\n {\r\n key: ctrlQuery,\r\n type: () => SpxInputTypeEnum.text,\r\n label: () => this.txtQuery,\r\n capitalize: () => true,\r\n },\r\n {\r\n key: ctrlOptions,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.txtOptions,\r\n },\r\n ]\r\n }\r\n ];\r\n\r\n get ctrlQuery(): FormControl { return this.formGroup.get(ctrlQuery) as FormControl; }\r\n get ctrlOptions(): FormControl { return this.formGroup.get(ctrlOptions) as FormControl; }\r\n\r\n private subSelection?: Subscription;\r\n private subQuery?: Subscription;\r\n\r\n constructor(readonly formBuilder: FormBuilder) {\r\n this.createForm();\r\n }\r\n\r\n ngOnInit(): void {\r\n this.listenToSelection();\r\n this.listenToQuery();\r\n this.ctrlQuery.setValue(this.spxValuePair, { emitEvent: false });\r\n this.spxSearch.emit(this.spxValuePair);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n if (this.subSelection) {\r\n this.subSelection.unsubscribe();\r\n }\r\n if (this.subQuery) {\r\n this.subQuery.unsubscribe();\r\n }\r\n }\r\n\r\n private createForm(): void {\r\n this.formGroup = this.formBuilder.group({\r\n [ctrlQuery]: [null],\r\n [ctrlOptions]: [null],\r\n });\r\n }\r\n\r\n getRawValidators(formControl: FormControl) {\r\n return (formControl as any)._rawValidators;\r\n }\r\n\r\n onCancel(): void {\r\n this.spxCancel.emit();\r\n }\r\n \r\n onSubmit(): void {\r\n this.spxSubmit.emit(this.ctrlQuery.value);\r\n }\r\n\r\n private listenToQuery(): void {\r\n this.subQuery = this.ctrlQuery.valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {\r\n this.spxSearch.emit(valuePair);\r\n });\r\n }\r\n\r\n private listenToSelection(): void {\r\n this.subSelection = this.ctrlOptions.valueChanges.subscribe(valuePair => {\r\n this.ctrlQuery.setValue(valuePair);\r\n });\r\n }\r\n}\r\n","<form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\r\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\r\n <spx-input [formControl]=\"ctrlQuery\" [spxLabel]=\"txtQuery\" [spxType]=\"inputTypeText\">\r\n </spx-input>\r\n <spx-input [formControl]=\"ctrlOptions\" [spxLabel]=\"txtOptions\" [spxSuggestions]=\"spxSuggestions\"\r\n [spxType]=\"inputTypeRadio\">\r\n </spx-input>\r\n </div>\r\n <div class=\"py-3 flex flex-col gap-3\">\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\r\n Save\r\n </spx-button>\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\r\n Cancel\r\n </spx-button>\r\n </div>\r\n </div>\r\n</form>","import { ChangeDetectionStrategy, Component, ElementRef, input, output, viewChildren } from '@angular/core';\r\nimport { SpxFormSectionI } from './spx-form-section.interface';\r\nimport { AbstractControl, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { SpxFormFieldI } from './spx-form-field.interface';\r\nimport { SpxAutocompleteSearchComponent } from './spx-autocomplete-search.component';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\nimport { SpxFormI } from './spx-form.interface';\r\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\r\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\r\nimport { SpxFormSectionComponent } from '@softpak/components/spx-form-section';\r\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\r\nimport { SpxValidateControlComponent } from '@softpak/components/spx-validation';\r\n\r\n@Component({\r\n selector: 'spx-form-view',\r\n imports: [\r\n FormsModule,\r\n ReactiveFormsModule,\r\n SpxAutocompleteSearchComponent,\r\n SpxButtonComponent,\r\n SpxCapitalizePipe,\r\n SpxFormSectionComponent,\r\n SpxInputComponent,\r\n SpxValidateControlComponent,\r\n TranslateModule\r\n ],\r\n templateUrl: './spx-form-view.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SpxFormViewComponent {\r\n readonly spxFormGroup = input.required<FormGroup>();\r\n readonly spxForm = input.required<SpxFormI>();\r\n readonly spxSuggestions = input.required<any>();\r\n spxBlur = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\r\n spxClick = output<{ field: SpxFormFieldI }>();\r\n spxSearch = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\r\n spxInputs = viewChildren(ElementRef<SpxInputComponent>);\r\n autocompleteField?: SpxFormFieldI;\r\n\r\n typeAutocomplete = SpxInputTypeEnum.autocomplete;\r\n typeButton = SpxInputTypeEnum.button;\r\n typeFloat = SpxInputTypeEnum.float;\r\n typeNumber = SpxInputTypeEnum.number;\r\n typeRadio = SpxInputTypeEnum.radio;\r\n typeText = SpxInputTypeEnum.text;\r\n typeNumericKeyboard = SpxInputTypeEnum.textNumericKeyboard;\r\n typeOverlay = SpxInputTypeEnum.overlay;\r\n typeOverlayNumber = SpxInputTypeEnum.overlayNumber;\r\n\r\n setAutofocus(key: string): void {\r\n const field = this.spxInputs().find(input => input.nativeElement.spxName() === key);\r\n if (field) {\r\n field.nativeElement.setFocusIn();\r\n }\r\n }\r\n\r\n onBlur(field: SpxFormFieldI) {\r\n this.spxBlur.emit({\r\n field,\r\n valuePair: this.spxFormGroup().get(field.key)!.value,\r\n });\r\n }\r\n\r\n onClick(field: SpxFormFieldI) {\r\n this.spxClick.emit({\r\n field,\r\n });\r\n }\r\n\r\n onAutocompleteCancel(): void {\r\n this.autocompleteField = undefined;\r\n }\r\n\r\n onAutocompleteSearch(valuePair: SpxValuePair<any>): void {\r\n if (this.autocompleteField) {\r\n this.spxSearch.emit({\r\n field: this.autocompleteField,\r\n valuePair,\r\n });\r\n }\r\n }\r\n\r\n onAutocompleteSave(valuePair: SpxValuePair<any>) {\r\n this.spxFormGroup().get(this.autocompleteField!.key)?.setValue(valuePair);\r\n this.autocompleteField = undefined;\r\n }\r\n\r\n onSearch(field: SpxFormFieldI) {\r\n this.autocompleteField = field;\r\n }\r\n\r\n getRawValidators(formControl: AbstractControl) {\r\n // eslint-disable-next-line no-underscore-dangle\r\n return (formControl as any)._rawValidators;\r\n }\r\n\r\n hasRequiredField(abstractControl: AbstractControl): boolean {\r\n if (abstractControl.validator) {\r\n const validator = abstractControl.validator({} as AbstractControl);\r\n if (validator && validator['required']) {\r\n return true;\r\n }\r\n }\r\n if ((abstractControl as any)['controls']) {\r\n for (const controlName in (abstractControl as any)['controls']) {\r\n if ((abstractControl as any)['controls'][controlName]) {\r\n if (this.hasRequiredField((abstractControl as any)['controls'][controlName])) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n static initialFormValue(sections: SpxFormSectionI[]) {\r\n const formObject: any = {};\r\n sections.forEach(section => {\r\n section.fields.forEach(field => {\r\n formObject[field.key] = [field.defaultValue ? field.defaultValue() : null, field.validators ? [...field.validators()] : []];\r\n });\r\n });\r\n return formObject;\r\n }\r\n\r\n static createForm(formBuilder: FormBuilder, sections: SpxFormSectionI[]): FormGroup {\r\n return formBuilder.group(this.initialFormValue(sections));\r\n }\r\n\r\n constructor(readonly formBuilder: FormBuilder) {\r\n }\r\n}\r\n","@if (autocompleteField) {\r\n <spx-autocomplete-search\r\n [spxField]=\"autocompleteField\"\r\n [spxSuggestions]=\"this.spxSuggestions()[autocompleteField.key]\"\r\n [spxValuePair]=\"$any(this.spxFormGroup().get(autocompleteField.key)).value\"\r\n [txtOptions]=\"'Options'\"\r\n [txtQuery]=\"'Query'\"\r\n [txtSubmit]=\"'Save'\"\r\n (spxCancel)=\"onAutocompleteCancel()\"\r\n (spxSearch)=\"onAutocompleteSearch($event)\"\r\n (spxSubmit)=\"onAutocompleteSave($event)\">\r\n </spx-autocomplete-search>\r\n}\r\n<div class=\"flex flex-col gap-3\">\r\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\r\n <spx-form-section\r\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\r\n [spxIndex]=\"spxSectionIndex + 1\"\r\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\r\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\r\n @if (spxField.show === undefined || spxField.show()) {\r\n @if (spxField.type() === typeButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\r\n [spxType]=\"'button'\"\r\n (spxClick)=\"onClick(spxField)\"\r\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\r\n }\r\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\r\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\r\n [spxType]=\"spxField.type()\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n (spxBlur)=\"onBlur(spxField)\"\r\n (spxSearch)=\"onSearch(spxField)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n @if (spxField.type() === typeRadio) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n [spxType]=\"typeRadio\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n }\r\n \r\n }\r\n </spx-form-section>\r\n }\r\n\r\n @for (spxButton of spxForm().buttons; track spxButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxButton.severity\"\r\n [spxType]=\"spxButton.type\"\r\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\r\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\r\n </spx-button>\r\n }\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC7B,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACrB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,GAGhC,EAAA,CAAA,CAAA;;ACOM,MAAM,yBAAyB,GAAG,oBAAoB;AACtD,MAAM,SAA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AA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKV,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAhBhC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAChB,OAAA,EAAA;wBACL,WAAW;wBACX,mBAAmB;wBACnB,8BAA8B;wBAC9B,kBAAkB;wBAClB,iBAAiB;wBACjB,uBAAuB;wBACvB,iBAAiB;wBACjB,2BAA2B;wBAC3B;qBACH,EAEgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,8kKAAA,EAAA;;;AE3BnD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-form-view.mjs","sources":["../../../../projects/softpak/components/spx-form-view/spx-form-button-type.enum.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.html","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.ts","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.html","../../../../projects/softpak/components/spx-form-view/softpak-components-spx-form-view.ts"],"sourcesContent":["export enum SpxFormButtonTypeEnum {\r\n button = 'button',\r\n submit = 'submit',\r\n}\r\n","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, computed, input, output, signal } from '@angular/core';\r\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { Subscription, debounceTime } from 'rxjs';\r\n\r\nimport { SpxFormFieldI } from './spx-form-field.interface';\r\nimport { SpxFormSectionI } from './spx-form-section.interface';\r\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\r\nimport { SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';\r\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\r\n\r\nexport const sectionAutocompleteSearch = 'autocompleteSearch';\r\nexport const ctrlQuery = 'query';\r\nexport const ctrlOptions = 'options';\r\n\r\n@Component({\r\n selector: 'spx-autocomplete-search',\r\n templateUrl: './spx-autocomplete-search.component.html',\r\n imports: [\r\n FormsModule,\r\n ReactiveFormsModule,\r\n SpxButtonComponent,\r\n SpxInputComponent,\r\n ],\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class SpxAutocompleteSearchComponent implements OnInit, OnDestroy {\r\n formGroup = signal<FormGroup | null>(null);\r\n readonly spxSuggestions = input<SpxValuePair<any>[]>([]);\r\n readonly spxField = input.required<SpxFormFieldI>();\r\n readonly txtOptions = input.required<string>();\r\n readonly txtQuery = input.required<string>();\r\n readonly txtSubmit = input.required<string>();\r\n readonly spxValuePair = input.required<SpxValuePair<any>>();\r\n spxCancel = output();\r\n spxSearch = output<SpxValuePair<any>>();\r\n spxSubmit = output<SpxValuePair<any>>();\r\n inputTypeRadio = SpxInputTypeEnum.radio;\r\n inputTypeText = SpxInputTypeEnum.text;\r\n SpxSeverity = SpxSeverityEnum;\r\n \r\n sections: SpxFormSectionI[] = [\r\n {\r\n key: sectionAutocompleteSearch,\r\n showTitle: () => false,\r\n fields: [\r\n {\r\n key: ctrlQuery,\r\n type: () => SpxInputTypeEnum.text,\r\n label: () => this.txtQuery(),\r\n capitalize: () => true,\r\n },\r\n {\r\n key: ctrlOptions,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.txtOptions(),\r\n },\r\n ]\r\n }\r\n ];\r\n\r\n readonly ctrlQuery = computed(() => this.formGroup()?.get(ctrlQuery) as FormControl);\r\n readonly ctrlOptions = computed(() => this.formGroup()?.get(ctrlOptions) as FormControl);\r\n\r\n private subscriptions: {\r\n subSelection?: Subscription;\r\n subQuery?: Subscription;\r\n } = {};\r\n\r\n constructor(readonly formBuilder: FormBuilder) {\r\n this.createForm();\r\n }\r\n\r\n ngOnInit(): void {\r\n this.listenToSelection();\r\n this.listenToQuery();\r\n const spxValuePair = this.spxValuePair();\r\n this.ctrlQuery().setValue(spxValuePair, { emitEvent: false });\r\n this.spxSearch.emit(spxValuePair);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n unsubscribeSubscriptions(this.subscriptions);\r\n }\r\n\r\n private createForm(): void {\r\n this.formGroup.set(this.formBuilder.group({\r\n [ctrlQuery]: [null],\r\n [ctrlOptions]: [null],\r\n }));\r\n }\r\n\r\n getRawValidators(formControl: FormControl) {\r\n return (formControl as any)._rawValidators;\r\n }\r\n\r\n onCancel(): void {\r\n this.spxCancel.emit();\r\n }\r\n \r\n onSubmit(): void {\r\n this.spxSubmit.emit(this.ctrlQuery().value);\r\n }\r\n\r\n private listenToQuery(): void {\r\n this.subscriptions.subQuery = this.ctrlQuery().valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {\r\n this.spxSearch.emit(valuePair);\r\n });\r\n }\r\n\r\n private listenToSelection(): void {\r\n this.subscriptions.subSelection = this.ctrlOptions().valueChanges.subscribe(valuePair => {\r\n this.ctrlQuery().setValue(valuePair);\r\n });\r\n }\r\n}\r\n","@if(formGroup()) {\r\n <form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup()!\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\r\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\r\n <spx-input [formControl]=\"ctrlQuery()\" [spxLabel]=\"txtQuery()\" [spxType]=\"inputTypeText\">\r\n </spx-input>\r\n <spx-input [formControl]=\"ctrlOptions()\" [spxLabel]=\"txtOptions()\" [spxSuggestions]=\"spxSuggestions()\"\r\n [spxType]=\"inputTypeRadio\">\r\n </spx-input>\r\n </div>\r\n <div class=\"py-3 flex flex-col gap-3\">\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\r\n Save\r\n </spx-button>\r\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\r\n Cancel\r\n </spx-button>\r\n </div>\r\n </div>\r\n </form>\r\n}\r\n","import { ChangeDetectionStrategy, Component, ElementRef, input, output, signal, viewChildren } from '@angular/core';\r\nimport { SpxFormSectionI } from './spx-form-section.interface';\r\nimport { AbstractControl, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { SpxFormFieldI } from './spx-form-field.interface';\r\nimport { SpxAutocompleteSearchComponent } from './spx-autocomplete-search.component';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\nimport { SpxFormI } from './spx-form.interface';\r\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\r\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\r\nimport { SpxFormSectionComponent } from '@softpak/components/spx-form-section';\r\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\r\nimport { SpxValidateControlComponent } from '@softpak/components/spx-validation';\r\n\r\n@Component({\r\n selector: 'spx-form-view',\r\n imports: [\r\n FormsModule,\r\n ReactiveFormsModule,\r\n SpxAutocompleteSearchComponent,\r\n SpxButtonComponent,\r\n SpxCapitalizePipe,\r\n SpxFormSectionComponent,\r\n SpxInputComponent,\r\n SpxValidateControlComponent,\r\n TranslateModule\r\n ],\r\n templateUrl: './spx-form-view.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n})\r\nexport class SpxFormViewComponent {\r\n readonly spxFormGroup = input.required<FormGroup>();\r\n readonly spxForm = input.required<SpxFormI>();\r\n readonly spxSuggestions = input.required<any>();\r\n spxBlur = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\r\n spxClick = output<{ field: SpxFormFieldI }>();\r\n spxSearch = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\r\n spxInputs = viewChildren(ElementRef<SpxInputComponent>);\r\n autoCompleteField = signal<SpxFormFieldI | null>(null);\r\n typeAutocomplete = SpxInputTypeEnum.autocomplete;\r\n typeButton = SpxInputTypeEnum.button;\r\n typeFloat = SpxInputTypeEnum.float;\r\n typeNumber = SpxInputTypeEnum.number;\r\n typeRadio = SpxInputTypeEnum.radio;\r\n typeText = SpxInputTypeEnum.text;\r\n typeNumericKeyboard = SpxInputTypeEnum.textNumericKeyboard;\r\n typeOverlay = SpxInputTypeEnum.overlay;\r\n typeOverlayNumber = SpxInputTypeEnum.overlayNumber;\r\n\r\n setAutofocus(key: string): void {\r\n const field = this.spxInputs().find(input => input.nativeElement.spxName() === key);\r\n if (field) {\r\n field.nativeElement.setFocusIn();\r\n }\r\n }\r\n\r\n onBlur(field: SpxFormFieldI) {\r\n this.spxBlur.emit({\r\n field,\r\n valuePair: this.spxFormGroup().get(field.key)!.value,\r\n });\r\n }\r\n\r\n onClick(field: SpxFormFieldI) {\r\n this.spxClick.emit({\r\n field,\r\n });\r\n }\r\n\r\n onAutocompleteCancel(): void {\r\n this.autoCompleteField.set(null);\r\n }\r\n\r\n onAutocompleteSearch(valuePair: SpxValuePair<any>): void {\r\n if (this.autoCompleteField()) {\r\n this.spxSearch.emit({\r\n field: this.autoCompleteField()!,\r\n valuePair,\r\n });\r\n }\r\n }\r\n\r\n onAutocompleteSave(valuePair: SpxValuePair<any>) {\r\n this.spxFormGroup().get(this.autoCompleteField()!.key)?.setValue(valuePair);\r\n this.autoCompleteField.set(null);\r\n }\r\n\r\n onSearch(field: SpxFormFieldI) {\r\n this.autoCompleteField.set(field);\r\n }\r\n\r\n getRawValidators(formControl: AbstractControl) {\r\n // eslint-disable-next-line no-underscore-dangle\r\n return (formControl as any)._rawValidators;\r\n }\r\n\r\n hasRequiredField(abstractControl: AbstractControl): boolean {\r\n if (abstractControl.validator) {\r\n const validator = abstractControl.validator({} as AbstractControl);\r\n if (validator && validator['required']) {\r\n return true;\r\n }\r\n }\r\n if ((abstractControl as any)['controls']) {\r\n for (const controlName in (abstractControl as any)['controls']) {\r\n if ((abstractControl as any)['controls'][controlName]) {\r\n if (this.hasRequiredField((abstractControl as any)['controls'][controlName])) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n static initialFormValue(sections: SpxFormSectionI[]) {\r\n const formObject: any = {};\r\n sections.forEach(section => {\r\n section.fields.forEach(field => {\r\n formObject[field.key] = [field.defaultValue ? field.defaultValue() : null, field.validators ? [...field.validators()] : []];\r\n });\r\n });\r\n return formObject;\r\n }\r\n\r\n static createForm(formBuilder: FormBuilder, sections: SpxFormSectionI[]): FormGroup {\r\n return formBuilder.group(this.initialFormValue(sections));\r\n }\r\n\r\n constructor(readonly formBuilder: FormBuilder) {\r\n }\r\n}\r\n","@if (autoCompleteField()) {\r\n <spx-autocomplete-search\r\n [spxField]=\"autoCompleteField()!\"\r\n [spxSuggestions]=\"this.spxSuggestions()[autoCompleteField()!.key]\"\r\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\r\n [txtOptions]=\"'Options'\"\r\n [txtQuery]=\"'Query'\"\r\n [txtSubmit]=\"'Save'\"\r\n (spxCancel)=\"onAutocompleteCancel()\"\r\n (spxSearch)=\"onAutocompleteSearch($event)\"\r\n (spxSubmit)=\"onAutocompleteSave($event)\">\r\n </spx-autocomplete-search>\r\n}\r\n<div class=\"flex flex-col gap-3\">\r\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\r\n <spx-form-section\r\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\r\n [spxIndex]=\"spxSectionIndex + 1\"\r\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\r\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\r\n @if (spxField.show === undefined || spxField.show()) {\r\n @if (spxField.type() === typeButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\r\n [spxType]=\"'button'\"\r\n (spxClick)=\"onClick(spxField)\"\r\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\r\n }\r\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\r\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\r\n [spxType]=\"spxField.type()\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n (spxBlur)=\"onBlur(spxField)\"\r\n (spxSearch)=\"onSearch(spxField)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n @if (spxField.type() === typeRadio) {\r\n <spx-input\r\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\r\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\r\n [spxName]=\"spxField.key\"\r\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\r\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\r\n [spxShowHelp]=\"false\"\r\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\r\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\r\n [spxType]=\"typeRadio\"\r\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\r\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\r\n </spx-input>\r\n }\r\n }\r\n \r\n }\r\n </spx-form-section>\r\n }\r\n\r\n @for (spxButton of spxForm().buttons; track spxButton) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxButton.severity\"\r\n [spxType]=\"spxButton.type\"\r\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\r\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\r\n </spx-button>\r\n }\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC7B,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACrB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,GAGhC,EAAA,CAAA,CAAA;;ACOM,MAAM,yBAAyB,GAAG,oBAAoB;AACtD,MAAM,SAAS,GAAG,OAAO;AACzB,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AAA,CAAA;;2FAMV,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAjBhC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAChB,OAAA,EAAA;wBACL,WAAW;wBACX,mBAAmB;wBACnB,8BAA8B;wBAC9B,kBAAkB;wBAClB,iBAAiB;wBACjB,uBAAuB;wBACvB,iBAAiB;wBACjB,2BAA2B;wBAC3B;AACH,qBAAA,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,ylKAAA,EAAA;;;AE5BpB;;AAEG;;;;"}
@@ -239,6 +239,8 @@ class SpxInputTextComponent {
239
239
  handleSuggestionClick(value) {
240
240
  if (!this.spxReadonly()) {
241
241
  this.value.set(value);
242
+ this.spxIsFocused.set(false); // Update only if focused
243
+ this.spxSetFocus();
242
244
  }
243
245
  }
244
246
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxInputTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }