@softpak/components 19.17.0-beta.4 → 19.17.0

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 (82) hide show
  1. package/README.md +24 -24
  2. package/fesm2022/softpak-components-spx-alert.mjs +6 -7
  3. package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
  4. package/fesm2022/softpak-components-spx-app-configuration.mjs.map +1 -1
  5. package/fesm2022/softpak-components-spx-app-expiry.mjs +91 -23
  6. package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
  7. package/fesm2022/softpak-components-spx-button.mjs +22 -8
  8. package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
  9. package/fesm2022/softpak-components-spx-capitalize.mjs.map +1 -1
  10. package/fesm2022/softpak-components-spx-card.mjs +91 -20
  11. package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
  12. package/fesm2022/softpak-components-spx-change-details.mjs +64 -48
  13. package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
  14. package/fesm2022/softpak-components-spx-channel-selection.mjs +52 -52
  15. package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
  16. package/fesm2022/softpak-components-spx-check-digit.mjs +28 -24
  17. package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
  18. package/fesm2022/softpak-components-spx-confirm.mjs +4 -4
  19. package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
  20. package/fesm2022/softpak-components-spx-form-section.mjs +33 -8
  21. package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
  22. package/fesm2022/softpak-components-spx-form-view.mjs +53 -39
  23. package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
  24. package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
  25. package/fesm2022/softpak-components-spx-inputs.mjs +24 -33
  26. package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
  27. package/fesm2022/softpak-components-spx-navigation.mjs +89 -34
  28. package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
  29. package/fesm2022/softpak-components-spx-number-check.mjs +198 -91
  30. package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
  31. package/fesm2022/softpak-components-spx-pagination.mjs +21 -12
  32. package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
  33. package/fesm2022/softpak-components-spx-patch.mjs +39 -8
  34. package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
  35. package/fesm2022/softpak-components-spx-pipes.mjs.map +1 -1
  36. package/fesm2022/softpak-components-spx-progress-bar.mjs +22 -8
  37. package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
  38. package/fesm2022/softpak-components-spx-spinner.mjs +160 -15
  39. package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
  40. package/fesm2022/softpak-components-spx-stock-info.mjs +128 -71
  41. package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
  42. package/fesm2022/softpak-components-spx-storage.mjs.map +1 -1
  43. package/fesm2022/softpak-components-spx-suggestion.mjs +2 -2
  44. package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
  45. package/fesm2022/softpak-components-spx-toaster.mjs +162 -35
  46. package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
  47. package/fesm2022/softpak-components-spx-translate.mjs.map +1 -1
  48. package/fesm2022/softpak-components-spx-update.mjs +5 -5
  49. package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
  50. package/fesm2022/softpak-components-spx-validation.mjs +55 -56
  51. package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
  52. package/package.json +25 -25
  53. package/spx-alert/spx-alert.component.d.ts +1 -1
  54. package/spx-app-expiry/spx-app-expiry.component.d.ts +14 -14
  55. package/spx-button/spx-button.component.d.ts +3 -0
  56. package/spx-card/spx-card-item/spx-card-item.component.d.ts +1 -0
  57. package/spx-card/spx-card.component.d.ts +9 -8
  58. package/spx-change-details/spx-change-details.component.d.ts +23 -22
  59. package/spx-check-digit/spx-check-digit.component.d.ts +9 -9
  60. package/spx-form-section/spx-form-section.component.d.ts +5 -5
  61. package/spx-form-view/spx-autocomplete-search.component.d.ts +16 -15
  62. package/spx-form-view/spx-form-view.component.d.ts +1 -1
  63. package/spx-inputs/spx-input-text/spx-input-text.component.d.ts +1 -4
  64. package/spx-inputs/spx-input.component.d.ts +0 -1
  65. package/spx-navigation/public-api.d.ts +2 -2
  66. package/spx-navigation/spx-home-tile.component.d.ts +11 -0
  67. package/spx-navigation/{spx-home-tile/spx-home-tiles.component.d.ts → spx-home-tiles.component.d.ts} +2 -2
  68. package/spx-navigation/spx-navigation.component.d.ts +8 -11
  69. package/spx-navigation/store/spx-navigation/spx-navigation.actions.d.ts +3 -3
  70. package/spx-number-check/spx-number-check.component.d.ts +32 -26
  71. package/spx-pagination/spx-pagination.component.d.ts +10 -9
  72. package/spx-patch/spx-patch.component.d.ts +4 -4
  73. package/spx-progress-bar/spx-progress-bar.component.d.ts +3 -3
  74. package/spx-spinner/spx-spinner.component.d.ts +3 -3
  75. package/spx-stock-info/spx-stock-info.component.d.ts +49 -48
  76. package/spx-toaster/src/spx-toaster-message.interface.d.ts +1 -5
  77. package/spx-toaster/src/spx-toaster.component.d.ts +14 -6
  78. package/spx-update/store/spx-update-check/spx-update-check.actions.d.ts +5 -5
  79. package/spx-update/store/spx-update-pending/spx-update-pending.actions.d.ts +1 -1
  80. package/spx-validation/spx-validate-control.component.d.ts +20 -22
  81. package/tailwind.css +1 -1
  82. package/spx-navigation/spx-home-tile/spx-home-tile.component.d.ts +0 -11
@@ -1,20 +1,45 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, Component, ChangeDetectionStrategy } from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
3
3
 
4
4
  class SpxFormSectionComponent {
5
5
  constructor() {
6
- this.spxIndex = input();
7
- this.spxIndexSecondary = input();
8
- this.spxTitle = input();
9
- this.spxShowTitle = input(true);
6
+ this.spxShowTitle = true;
10
7
  }
11
8
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxFormSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxFormSectionComponent, isStandalone: true, selector: "spx-form-section", inputs: { spxIndex: { classPropertyName: "spxIndex", publicName: "spxIndex", isSignal: true, isRequired: false, transformFunction: null }, spxIndexSecondary: { classPropertyName: "spxIndexSecondary", publicName: "spxIndexSecondary", isSignal: true, isRequired: false, transformFunction: null }, spxTitle: { classPropertyName: "spxTitle", publicName: "spxTitle", isSignal: true, isRequired: false, transformFunction: null }, spxShowTitle: { classPropertyName: "spxShowTitle", publicName: "spxShowTitle", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (this.spxShowTitle()) {\r\n <div class=\"spx-form-section__title mb-3 flex gap-3 items-center\">\r\n <div class=\"spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded\">{{this.spxIndex()}}@if (this.spxIndexSecondary()) {\r\n {{ this.spxIndexSecondary() }}\r\n }</div>\r\n <div class=\"spx-form-section__content font-bold grow text-black dark:text-white\">{{this.spxTitle()}}</div>\r\n </div>\r\n}\r\n<div class=\"flex flex-col gap-3\">\r\n <ng-content></ng-content>\r\n</div>", styles: [":host{display:block}.spx-form-section__title-index{background-color:#000;display:inline-block;vertical-align:middle}.spx-form-section__title{color:var(--spx-form-section--color, #FFFFFF)}.spx-form-section__content{color:#000}@media (prefers-color-scheme: dark){.spx-form-section__title-index{background-color:var(--spx-form-section--color, #FFFFFF);color:#000}.spx-form-section__content{color:var(--spx-form-section--color, #FFFFFF)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
9
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxFormSectionComponent, isStandalone: true, selector: "spx-form-section", inputs: { spxIndex: "spxIndex", spxIndexSecondary: "spxIndexSecondary", spxTitle: "spxTitle", spxShowTitle: "spxShowTitle" }, ngImport: i0, template: `@if (this.spxShowTitle) {
10
+ <div class="spx-form-section__title mb-3 flex gap-3 items-center">
11
+ <div class="spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded">{{this.spxIndex}}@if (this.spxIndexSecondary) {
12
+ {{ this.spxIndexSecondary }}
13
+ }</div>
14
+ <div class="spx-form-section__content font-bold grow text-black dark:text-white">{{this.spxTitle}}</div>
15
+ </div>
16
+ }
17
+ <div class="flex flex-col gap-3">
18
+ <ng-content></ng-content>
19
+ </div>`, isInline: true, styles: [":host{display:block}.spx-form-section__title-index{background-color:#000;display:inline-block;vertical-align:middle}.spx-form-section__title{color:var(--spx-form-section--color, #FFFFFF)}.spx-form-section__content{color:#000}@media (prefers-color-scheme: dark){.spx-form-section__title-index{background-color:var(--spx-form-section--color, #FFFFFF);color:#000}.spx-form-section__content{color:var(--spx-form-section--color, #FFFFFF)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
13
20
  }
14
21
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxFormSectionComponent, decorators: [{
15
22
  type: Component,
16
- args: [{ selector: 'spx-form-section', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (this.spxShowTitle()) {\r\n <div class=\"spx-form-section__title mb-3 flex gap-3 items-center\">\r\n <div class=\"spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded\">{{this.spxIndex()}}@if (this.spxIndexSecondary()) {\r\n {{ this.spxIndexSecondary() }}\r\n }</div>\r\n <div class=\"spx-form-section__content font-bold grow text-black dark:text-white\">{{this.spxTitle()}}</div>\r\n </div>\r\n}\r\n<div class=\"flex flex-col gap-3\">\r\n <ng-content></ng-content>\r\n</div>", styles: [":host{display:block}.spx-form-section__title-index{background-color:#000;display:inline-block;vertical-align:middle}.spx-form-section__title{color:var(--spx-form-section--color, #FFFFFF)}.spx-form-section__content{color:#000}@media (prefers-color-scheme: dark){.spx-form-section__title-index{background-color:var(--spx-form-section--color, #FFFFFF);color:#000}.spx-form-section__content{color:var(--spx-form-section--color, #FFFFFF)}}\n"] }]
17
- }] });
23
+ args: [{ selector: 'spx-form-section', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: `@if (this.spxShowTitle) {
24
+ <div class="spx-form-section__title mb-3 flex gap-3 items-center">
25
+ <div class="spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded">{{this.spxIndex}}@if (this.spxIndexSecondary) {
26
+ {{ this.spxIndexSecondary }}
27
+ }</div>
28
+ <div class="spx-form-section__content font-bold grow text-black dark:text-white">{{this.spxTitle}}</div>
29
+ </div>
30
+ }
31
+ <div class="flex flex-col gap-3">
32
+ <ng-content></ng-content>
33
+ </div>`, styles: [":host{display:block}.spx-form-section__title-index{background-color:#000;display:inline-block;vertical-align:middle}.spx-form-section__title{color:var(--spx-form-section--color, #FFFFFF)}.spx-form-section__content{color:#000}@media (prefers-color-scheme: dark){.spx-form-section__title-index{background-color:var(--spx-form-section--color, #FFFFFF);color:#000}.spx-form-section__content{color:var(--spx-form-section--color, #FFFFFF)}}\n"] }]
34
+ }], propDecorators: { spxIndex: [{
35
+ type: Input
36
+ }], spxIndexSecondary: [{
37
+ type: Input
38
+ }], spxTitle: [{
39
+ type: Input
40
+ }], spxShowTitle: [{
41
+ type: Input
42
+ }] } });
18
43
 
19
44
  /**
20
45
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-form-section.mjs","sources":["../../../../projects/softpak/components/spx-form-section/spx-form-section.component.ts","../../../../projects/softpak/components/spx-form-section/spx-form-section.component.html","../../../../projects/softpak/components/spx-form-section/softpak-components-spx-form-section.ts"],"sourcesContent":["\r\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'spx-form-section',\r\n imports: [],\r\n templateUrl: './spx-form-section.component.html',\r\n styleUrl: './spx-form-section.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n})\r\nexport class SpxFormSectionComponent {\r\n readonly spxIndex = input<number>();\r\n readonly spxIndexSecondary = input<number>();\r\n readonly spxTitle = input<string>();\r\n readonly spxShowTitle = input<boolean>(true);\r\n}\r\n","@if (this.spxShowTitle()) {\r\n <div class=\"spx-form-section__title mb-3 flex gap-3 items-center\">\r\n <div class=\"spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded\">{{this.spxIndex()}}@if (this.spxIndexSecondary()) {\r\n {{ this.spxIndexSecondary() }}\r\n }</div>\r\n <div class=\"spx-form-section__content font-bold grow text-black dark:text-white\">{{this.spxTitle()}}</div>\r\n </div>\r\n}\r\n<div class=\"flex flex-col gap-3\">\r\n <ng-content></ng-content>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAWa,uBAAuB,CAAA;AARpC,IAAA,WAAA,GAAA;QASW,IAAQ,CAAA,QAAA,GAAG,KAAK,EAAU;QAC1B,IAAiB,CAAA,iBAAA,GAAG,KAAK,EAAU;QACnC,IAAQ,CAAA,QAAA,GAAG,KAAK,EAAU;AAC1B,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAU,IAAI,CAAC;AAC7C;8GALY,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,moBCXpC,uiBAUM,EAAA,MAAA,EAAA,CAAA,sbAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDCO,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBARnC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,WACnB,EAAE,EAAA,eAAA,EAGM,uBAAuB,CAAC,MAAM,cACnC,IAAI,EAAA,QAAA,EAAA,uiBAAA,EAAA,MAAA,EAAA,CAAA,sbAAA,CAAA,EAAA;;;AETpB;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-form-section.mjs","sources":["../../../../projects/softpak/components/spx-form-section/spx-form-section.component.ts","../../../../projects/softpak/components/spx-form-section/softpak-components-spx-form-section.ts"],"sourcesContent":["\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\n@Component({\n selector: 'spx-form-section',\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `@if (this.spxShowTitle) {\n <div class=\"spx-form-section__title mb-3 flex gap-3 items-center\">\n <div class=\"spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded\">{{this.spxIndex}}@if (this.spxIndexSecondary) {\n {{ this.spxIndexSecondary }}\n }</div>\n <div class=\"spx-form-section__content font-bold grow text-black dark:text-white\">{{this.spxTitle}}</div>\n </div>\n}\n<div class=\"flex flex-col gap-3\">\n <ng-content></ng-content>\n</div>`,\n styles: `\n :host {\n display: block;\n }\n \n .spx-form-section__title-index {\n background-color: #000000;\n display: inline-block;\n vertical-align: middle;\n }\n\n .spx-form-section__title {\n color: var(--spx-form-section--color, #FFFFFF);\n }\n\n .spx-form-section__content {\n color: #000000;\n }\n\n @media (prefers-color-scheme: dark) {\n .spx-form-section__title-index {\n background-color: var(--spx-form-section--color, #FFFFFF);\n color: #000000;\n }\n \n .spx-form-section__content {\n color: var(--spx-form-section--color, #FFFFFF);\n }\n}\n `\n})\nexport class SpxFormSectionComponent {\n @Input() spxIndex?: number;\n @Input() spxIndexSecondary?: number;\n @Input() spxTitle?: string;\n @Input() spxShowTitle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@@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, input, output, computed, Component, ChangeDetectionStrategy, viewChildren, ElementRef } from '@angular/core';
2
+ import { EventEmitter, Component, Input, Output, input, output, viewChildren, ElementRef, ChangeDetectionStrategy } 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, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';
7
+ import { SpxSeverityEnum } 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,18 +22,14 @@ 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); }
25
27
  constructor(formBuilder) {
26
28
  this.formBuilder = formBuilder;
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();
29
+ this.spxSuggestions = [];
30
+ this.spxCancel = new EventEmitter();
31
+ this.spxSearch = new EventEmitter();
32
+ this.spxSubmit = new EventEmitter();
37
33
  this.inputTypeRadio = SpxInputTypeEnum.radio;
38
34
  this.inputTypeText = SpxInputTypeEnum.text;
39
35
  this.SpxSeverity = SpxSeverityEnum;
@@ -45,37 +41,38 @@ class SpxAutocompleteSearchComponent {
45
41
  {
46
42
  key: ctrlQuery,
47
43
  type: () => SpxInputTypeEnum.text,
48
- label: () => this.txtQuery(),
44
+ label: () => this.txtQuery,
49
45
  capitalize: () => true,
50
46
  },
51
47
  {
52
48
  key: ctrlOptions,
53
49
  type: () => SpxInputTypeEnum.radio,
54
- label: () => this.txtOptions(),
50
+ label: () => this.txtOptions,
55
51
  },
56
52
  ]
57
53
  }
58
54
  ];
59
- this.ctrlQuery = computed(() => this.formGroup()?.get(ctrlQuery));
60
- this.ctrlOptions = computed(() => this.formGroup()?.get(ctrlOptions));
61
- this.subscriptions = {};
62
55
  this.createForm();
63
56
  }
64
57
  ngOnInit() {
65
58
  this.listenToSelection();
66
59
  this.listenToQuery();
67
- const spxValuePair = this.spxValuePair();
68
- this.ctrlQuery().setValue(spxValuePair, { emitEvent: false });
69
- this.spxSearch.emit(spxValuePair);
60
+ this.ctrlQuery.setValue(this.spxValuePair, { emitEvent: false });
61
+ this.spxSearch.emit(this.spxValuePair);
70
62
  }
71
63
  ngOnDestroy() {
72
- unsubscribeSubscriptions(this.subscriptions);
64
+ if (this.subSelection) {
65
+ this.subSelection.unsubscribe();
66
+ }
67
+ if (this.subQuery) {
68
+ this.subQuery.unsubscribe();
69
+ }
73
70
  }
74
71
  createForm() {
75
- this.formGroup.set(this.formBuilder.group({
72
+ this.formGroup = this.formBuilder.group({
76
73
  [ctrlQuery]: [null],
77
74
  [ctrlOptions]: [null],
78
- }));
75
+ });
79
76
  }
80
77
  getRawValidators(formControl) {
81
78
  return formControl._rawValidators;
@@ -84,20 +81,20 @@ class SpxAutocompleteSearchComponent {
84
81
  this.spxCancel.emit();
85
82
  }
86
83
  onSubmit() {
87
- this.spxSubmit.emit(this.ctrlQuery().value);
84
+ this.spxSubmit.emit(this.ctrlQuery.value);
88
85
  }
89
86
  listenToQuery() {
90
- this.subscriptions.subQuery = this.ctrlQuery().valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {
87
+ this.subQuery = this.ctrlQuery.valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {
91
88
  this.spxSearch.emit(valuePair);
92
89
  });
93
90
  }
94
91
  listenToSelection() {
95
- this.subscriptions.subSelection = this.ctrlOptions().valueChanges.subscribe(valuePair => {
96
- this.ctrlQuery().setValue(valuePair);
92
+ this.subSelection = this.ctrlOptions.valueChanges.subscribe(valuePair => {
93
+ this.ctrlQuery.setValue(valuePair);
97
94
  });
98
95
  }
99
96
  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 }); }
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 }); }
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()\">\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\n <spx-input [formControl]=\"ctrlQuery\" [spxLabel]=\"txtQuery\" [spxType]=\"inputTypeText\">\n </spx-input>\n <spx-input [formControl]=\"ctrlOptions\" [spxLabel]=\"txtOptions\" [spxSuggestions]=\"spxSuggestions\"\n [spxType]=\"inputTypeRadio\">\n </spx-input>\n </div>\n <div class=\"py-3 flex flex-col gap-3\">\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\n Save\n </spx-button>\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\n Cancel\n </spx-button>\n </div>\n </div>\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"] }] }); }
101
98
  }
102
99
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxAutocompleteSearchComponent, decorators: [{
103
100
  type: Component,
@@ -106,8 +103,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
106
103
  ReactiveFormsModule,
107
104
  SpxButtonComponent,
108
105
  SpxInputComponent,
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 }] });
106
+ ], template: "<form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup\" (ngSubmit)=\"onSubmit()\">\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\n <spx-input [formControl]=\"ctrlQuery\" [spxLabel]=\"txtQuery\" [spxType]=\"inputTypeText\">\n </spx-input>\n <spx-input [formControl]=\"ctrlOptions\" [spxLabel]=\"txtOptions\" [spxSuggestions]=\"spxSuggestions\"\n [spxType]=\"inputTypeRadio\">\n </spx-input>\n </div>\n <div class=\"py-3 flex flex-col gap-3\">\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\n Save\n </spx-button>\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\n Cancel\n </spx-button>\n </div>\n </div>\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
+ }] } });
111
126
 
112
127
  class SpxFormViewComponent {
113
128
  setAutofocus(key) {
@@ -128,22 +143,22 @@ class SpxFormViewComponent {
128
143
  });
129
144
  }
130
145
  onAutocompleteCancel() {
131
- this.autoCompleteField.set(null);
146
+ this.autocompleteField = undefined;
132
147
  }
133
148
  onAutocompleteSearch(valuePair) {
134
- if (this.autoCompleteField()) {
149
+ if (this.autocompleteField) {
135
150
  this.spxSearch.emit({
136
- field: this.autoCompleteField(),
151
+ field: this.autocompleteField,
137
152
  valuePair,
138
153
  });
139
154
  }
140
155
  }
141
156
  onAutocompleteSave(valuePair) {
142
- this.spxFormGroup().get(this.autoCompleteField().key)?.setValue(valuePair);
143
- this.autoCompleteField.set(null);
157
+ this.spxFormGroup().get(this.autocompleteField.key)?.setValue(valuePair);
158
+ this.autocompleteField = undefined;
144
159
  }
145
160
  onSearch(field) {
146
- this.autoCompleteField.set(field);
161
+ this.autocompleteField = field;
147
162
  }
148
163
  getRawValidators(formControl) {
149
164
  // eslint-disable-next-line no-underscore-dangle
@@ -188,7 +203,6 @@ class SpxFormViewComponent {
188
203
  this.spxClick = output();
189
204
  this.spxSearch = output();
190
205
  this.spxInputs = viewChildren((ElementRef));
191
- this.autoCompleteField = signal(null);
192
206
  this.typeAutocomplete = SpxInputTypeEnum.autocomplete;
193
207
  this.typeButton = SpxInputTypeEnum.button;
194
208
  this.typeFloat = SpxInputTypeEnum.float;
@@ -200,7 +214,7 @@ class SpxFormViewComponent {
200
214
  this.typeOverlayNumber = SpxInputTypeEnum.overlayNumber;
201
215
  }
202
216
  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 }); }
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 [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [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 [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [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", "errors", "touched"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
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) {\n <spx-autocomplete-search\n [spxField]=\"autocompleteField\"\n [spxSuggestions]=\"this.spxSuggestions()[autocompleteField.key]\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autocompleteField.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\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) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\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 (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\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-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\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 }); }
204
218
  }
205
219
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxFormViewComponent, decorators: [{
206
220
  type: Component,
@@ -214,7 +228,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
214
228
  SpxInputComponent,
215
229
  SpxValidateControlComponent,
216
230
  TranslateModule
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 [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [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 [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [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>" }]
231
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (autocompleteField) {\n <spx-autocomplete-search\n [spxField]=\"autocompleteField\"\n [spxSuggestions]=\"this.spxSuggestions()[autocompleteField.key]\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autocompleteField.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\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) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\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 (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\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-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>" }]
218
232
  }], ctorParameters: () => [{ type: i1.FormBuilder }] });
219
233
 
220
234
  /**
@@ -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 { 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 [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [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 [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [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,MAAM,WAAW,GAAG,SAAS;MAcvB,8BAA8B,CAAA;AA2CzC,IAAA,WAAA,CAAqB,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW;AA1ChC,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAmB,IAAI,CAAC;AACjC,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAsB,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BACjB,uBAAuB;wBACvB,iBAAiB;wBACjB,2BAA2B;wBAC3B;AACH,qBAAA,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,61KAAA,EAAA;;;AE5BpB;;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 {\n button = 'button',\n submit = 'submit',\n}\n","import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription, debounceTime } from 'rxjs';\n\nimport { SpxFormFieldI } from './spx-form-field.interface';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\n\nexport const sectionAutocompleteSearch = 'autocompleteSearch';\nexport const ctrlQuery = 'query';\nexport const ctrlOptions = 'options';\n\n@Component({\n selector: 'spx-autocomplete-search',\n templateUrl: './spx-autocomplete-search.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxButtonComponent,\n SpxInputComponent,\n ]\n})\nexport class SpxAutocompleteSearchComponent implements OnInit, OnDestroy {\n formGroup!: FormGroup;\n @Input() spxSuggestions: SpxValuePair<any>[] = [];\n @Input() spxField!: SpxFormFieldI;\n @Input() txtOptions!: string;\n @Input() txtQuery!: string;\n @Input() txtSubmit!: string;\n @Input() spxValuePair!: SpxValuePair<any>;\n @Output() spxCancel: EventEmitter<void> = new EventEmitter<void>();\n @Output() spxSearch: EventEmitter<SpxValuePair<any>> = new EventEmitter<SpxValuePair<any>>(); \n @Output() spxSubmit: EventEmitter<SpxValuePair<any>> = new EventEmitter<SpxValuePair<any>>();\n inputTypeRadio = SpxInputTypeEnum.radio;\n inputTypeText = SpxInputTypeEnum.text;\n SpxSeverity = SpxSeverityEnum;\n \n sections: SpxFormSectionI[] = [\n {\n key: sectionAutocompleteSearch,\n showTitle: () => false,\n fields: [\n {\n key: ctrlQuery,\n type: () => SpxInputTypeEnum.text,\n label: () => this.txtQuery,\n capitalize: () => true,\n },\n {\n key: ctrlOptions,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.txtOptions,\n },\n ]\n }\n ];\n\n get ctrlQuery(): FormControl { return this.formGroup.get(ctrlQuery) as FormControl; }\n get ctrlOptions(): FormControl { return this.formGroup.get(ctrlOptions) as FormControl; }\n\n private subSelection?: Subscription;\n private subQuery?: Subscription;\n\n constructor(readonly formBuilder: FormBuilder) {\n this.createForm();\n }\n\n ngOnInit(): void {\n this.listenToSelection();\n this.listenToQuery();\n this.ctrlQuery.setValue(this.spxValuePair, { emitEvent: false });\n this.spxSearch.emit(this.spxValuePair);\n }\n\n ngOnDestroy(): void {\n if (this.subSelection) {\n this.subSelection.unsubscribe();\n }\n if (this.subQuery) {\n this.subQuery.unsubscribe();\n }\n }\n\n private createForm(): void {\n this.formGroup = this.formBuilder.group({\n [ctrlQuery]: [null],\n [ctrlOptions]: [null],\n });\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n\n onCancel(): void {\n this.spxCancel.emit();\n }\n \n onSubmit(): void {\n this.spxSubmit.emit(this.ctrlQuery.value);\n }\n\n private listenToQuery(): void {\n this.subQuery = this.ctrlQuery.valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {\n this.spxSearch.emit(valuePair);\n });\n }\n\n private listenToSelection(): void {\n this.subSelection = this.ctrlOptions.valueChanges.subscribe(valuePair => {\n this.ctrlQuery.setValue(valuePair);\n });\n }\n}\n","<form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup\" (ngSubmit)=\"onSubmit()\">\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\n <spx-input [formControl]=\"ctrlQuery\" [spxLabel]=\"txtQuery\" [spxType]=\"inputTypeText\">\n </spx-input>\n <spx-input [formControl]=\"ctrlOptions\" [spxLabel]=\"txtOptions\" [spxSuggestions]=\"spxSuggestions\"\n [spxType]=\"inputTypeRadio\">\n </spx-input>\n </div>\n <div class=\"py-3 flex flex-col gap-3\">\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\n Save\n </spx-button>\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\n Cancel\n </spx-button>\n </div>\n </div>\n</form>","import { ChangeDetectionStrategy, Component, ElementRef, input, output, viewChildren } from '@angular/core';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { AbstractControl, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SpxFormFieldI } from './spx-form-field.interface';\nimport { SpxAutocompleteSearchComponent } from './spx-autocomplete-search.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { SpxFormI } from './spx-form.interface';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxFormSectionComponent } from '@softpak/components/spx-form-section';\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxValidateControlComponent } from '@softpak/components/spx-validation';\n\n@Component({\n selector: 'spx-form-view',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxAutocompleteSearchComponent,\n SpxButtonComponent,\n SpxCapitalizePipe,\n SpxFormSectionComponent,\n SpxInputComponent,\n SpxValidateControlComponent,\n TranslateModule\n ],\n templateUrl: './spx-form-view.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SpxFormViewComponent {\n readonly spxFormGroup = input.required<FormGroup>();\n readonly spxForm = input.required<SpxFormI>();\n readonly spxSuggestions = input.required<any>();\n spxBlur = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\n spxClick = output<{ field: SpxFormFieldI }>();\n spxSearch = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\n spxInputs = viewChildren(ElementRef<SpxInputComponent>);\n autocompleteField?: SpxFormFieldI;\n\n typeAutocomplete = SpxInputTypeEnum.autocomplete;\n typeButton = SpxInputTypeEnum.button;\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 setAutofocus(key: string): void {\n const field = this.spxInputs().find(input => input.nativeElement.spxName() === key);\n if (field) {\n field.nativeElement.setFocusIn();\n }\n }\n\n onBlur(field: SpxFormFieldI) {\n this.spxBlur.emit({\n field,\n valuePair: this.spxFormGroup().get(field.key)!.value,\n });\n }\n\n onClick(field: SpxFormFieldI) {\n this.spxClick.emit({\n field,\n });\n }\n\n onAutocompleteCancel(): void {\n this.autocompleteField = undefined;\n }\n\n onAutocompleteSearch(valuePair: SpxValuePair<any>): void {\n if (this.autocompleteField) {\n this.spxSearch.emit({\n field: this.autocompleteField,\n valuePair,\n });\n }\n }\n\n onAutocompleteSave(valuePair: SpxValuePair<any>) {\n this.spxFormGroup().get(this.autocompleteField!.key)?.setValue(valuePair);\n this.autocompleteField = undefined;\n }\n\n onSearch(field: SpxFormFieldI) {\n this.autocompleteField = field;\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","@if (autocompleteField) {\n <spx-autocomplete-search\n [spxField]=\"autocompleteField\"\n [spxSuggestions]=\"this.spxSuggestions()[autocompleteField.key]\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autocompleteField.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\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) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"hasRequiredField(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\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 (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\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-validate-control [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\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,MAAM,WAAW,GAAG,SAAS;MAYvB,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AAA,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,46JAAA,EAAA;;;AE3BnD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-helpers.mjs","sources":["../../../../projects/softpak/components/spx-helpers/calc-check-digit.function.ts","../../../../projects/softpak/components/spx-helpers/spx-severity.enum.ts","../../../../projects/softpak/components/spx-helpers/unsubscribe-subscriptions.function.ts","../../../../projects/softpak/components/spx-helpers/value-pair-to-value.function.ts","../../../../projects/softpak/components/spx-helpers/softpak-components-spx-helpers.ts"],"sourcesContent":["export const calcCheckDigit = (container: string): string => {\r\n container = container.toUpperCase();\r\n\r\n const mapping = {\r\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\r\n A: 10, B: 12, C: 13, D: 14, E: 15, F: 16, G: 17, H: 18, I: 19, J: 20, K: 21, L: 23, M: 24,\r\n N: 25, O: 26, P: 27, Q: 28, R: 29, S: 30, T: 31, U: 32, V: 34, W: 35, X: 36, Y: 37, Z: 38\r\n };\r\n\r\n let total = 0;\r\n\r\n for (let i = 0; i < container.length; i++) {\r\n const cChar = container.substr(i, 1);\r\n const value = (mapping as any)[cChar];\r\n const multiplier = Math.pow(2, i);\r\n total = total + (value * multiplier);\r\n }\r\n\r\n let outcome = total % 11;\r\n if (outcome === 10) {\r\n outcome = 0;\r\n }\r\n\r\n return outcome.toString();\r\n}\r\n","export enum SpxSeverityEnum {\r\n error = 'error',\r\n info = 'info',\r\n success = 'success',\r\n unknown = 'unknown',\r\n warning = 'warning',\r\n primary = 'primary',\r\n}\r\n","import { Subscription } from \"rxjs\";\r\n\r\nexport function unsubscribeSubscriptions(subscriptionObject: object): void {\r\n for (const key in subscriptionObject) {\r\n if ((subscriptionObject as any)[key]) {\r\n ((subscriptionObject as any)[key] as Subscription).unsubscribe();\r\n }\r\n }\r\n}","export const valuePairToValue = (pair: any) => {\r\n if (pair === null || (typeof pair === 'object' && pair.value === undefined)) {\r\n return null;\r\n }\r\n return pair?.value || pair?.value === false || pair?.value === null || pair?.value === '' || pair?.value === 0 ? pair?.value : pair;\r\n};\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAa,MAAA,cAAc,GAAG,CAAC,SAAiB,KAAY;AAC1D,IAAA,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE;AAEnC,IAAA,MAAM,OAAO,GAAG;AACd,QAAA,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC1D,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;QACzF,CAAC,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,CAAA,CAAA;;ACLK,SAAU,wBAAwB,CAAC,kBAA0B,EAAA;AAC/D,IAAA,KAAK,MAAM,GAAG,IAAI,kBAAkB,EAAE;AAClC,QAAA,IAAK,kBAA0B,CAAC,GAAG,CAAC,EAAE;AAChC,YAAA,kBAA0B,CAAC,GAAG,CAAkB,CAAC,WAAW,EAAE;;;AAG5E;;ACRa,MAAA,gBAAgB,GAAG,CAAC,IAAS,KAAI;AAC1C,IAAA,IAAI,IAAI,KAAK,IAAI,KAAK,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;AACzE,QAAA,OAAO,IAAI;;AAEf,IAAA,OAAO,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,IAAI,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,IAAI,EAAE,KAAK,GAAG,IAAI;AACvI;;ACLA;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-helpers.mjs","sources":["../../../../projects/softpak/components/spx-helpers/calc-check-digit.function.ts","../../../../projects/softpak/components/spx-helpers/spx-severity.enum.ts","../../../../projects/softpak/components/spx-helpers/unsubscribe-subscriptions.function.ts","../../../../projects/softpak/components/spx-helpers/value-pair-to-value.function.ts","../../../../projects/softpak/components/spx-helpers/softpak-components-spx-helpers.ts"],"sourcesContent":["export const calcCheckDigit = (container: string): string => {\n container = container.toUpperCase();\n\n const mapping = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n A: 10, B: 12, C: 13, D: 14, E: 15, F: 16, G: 17, H: 18, I: 19, J: 20, K: 21, L: 23, M: 24,\n N: 25, O: 26, P: 27, Q: 28, R: 29, S: 30, T: 31, U: 32, V: 34, W: 35, X: 36, Y: 37, Z: 38\n };\n\n let total = 0;\n\n for (let i = 0; i < container.length; i++) {\n const cChar = container.substr(i, 1);\n const value = (mapping as any)[cChar];\n const multiplier = Math.pow(2, i);\n total = total + (value * multiplier);\n }\n\n let outcome = total % 11;\n if (outcome === 10) {\n outcome = 0;\n }\n\n return outcome.toString();\n}\n","export enum SpxSeverityEnum {\n error = 'error',\n info = 'info',\n success = 'success',\n unknown = 'unknown',\n warning = 'warning',\n primary = 'primary',\n}\n","import { Subscription } from \"rxjs\";\n\nexport function unsubscribeSubscriptions(subscriptionObject: object): void {\n for (const key in subscriptionObject) {\n if ((subscriptionObject as any)[key]) {\n ((subscriptionObject as any)[key] as Subscription).unsubscribe();\n }\n }\n}","export const valuePairToValue = (pair: any) => {\n if (pair === null || (typeof pair === 'object' && pair.value === undefined)) {\n return null;\n }\n return pair?.value || pair?.value === false || pair?.value === null || pair?.value === '' || pair?.value === 0 ? pair?.value : pair;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAa,MAAA,cAAc,GAAG,CAAC,SAAiB,KAAY;AAC1D,IAAA,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE;AAEnC,IAAA,MAAM,OAAO,GAAG;AACd,QAAA,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC1D,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAA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