@softpak/components 19.25.4 → 19.26.0-beta.2

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 (69) hide show
  1. package/README.md +24 -24
  2. package/fesm2022/softpak-components-spx-404-page.mjs +2 -2
  3. package/fesm2022/softpak-components-spx-404-page.mjs.map +1 -1
  4. package/fesm2022/softpak-components-spx-alert.mjs +2 -2
  5. package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
  6. package/fesm2022/softpak-components-spx-app-configuration.mjs.map +1 -1
  7. package/fesm2022/softpak-components-spx-app-expiry.mjs +2 -2
  8. package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
  9. package/fesm2022/softpak-components-spx-button.mjs +2 -2
  10. package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
  11. package/fesm2022/softpak-components-spx-capitalize.mjs.map +1 -1
  12. package/fesm2022/softpak-components-spx-card.mjs +8 -8
  13. package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
  14. package/fesm2022/softpak-components-spx-change-details.mjs +2 -2
  15. package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
  16. package/fesm2022/softpak-components-spx-channel-selection.mjs +52 -52
  17. package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
  18. package/fesm2022/softpak-components-spx-check-digit.mjs +2 -2
  19. package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
  20. package/fesm2022/softpak-components-spx-confirm.mjs +4 -4
  21. package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
  22. package/fesm2022/softpak-components-spx-form-section.mjs +2 -2
  23. package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
  24. package/fesm2022/softpak-components-spx-form-view.mjs +4 -4
  25. package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
  26. package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
  27. package/fesm2022/softpak-components-spx-inputs.mjs +20 -22
  28. package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
  29. package/fesm2022/softpak-components-spx-navigation.mjs +6 -6
  30. package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
  31. package/fesm2022/softpak-components-spx-number-check.mjs +2 -2
  32. package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
  33. package/fesm2022/softpak-components-spx-pagination.mjs +2 -2
  34. package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
  35. package/fesm2022/softpak-components-spx-patch.mjs +2 -2
  36. package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
  37. package/fesm2022/softpak-components-spx-pipes.mjs.map +1 -1
  38. package/fesm2022/softpak-components-spx-progress-bar.mjs +2 -2
  39. package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
  40. package/fesm2022/softpak-components-spx-spinner.mjs +2 -2
  41. package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
  42. package/fesm2022/softpak-components-spx-stock-info.mjs +2 -2
  43. package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
  44. package/fesm2022/softpak-components-spx-storage.mjs.map +1 -1
  45. package/fesm2022/softpak-components-spx-suggestion.mjs +2 -2
  46. package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
  47. package/fesm2022/softpak-components-spx-tabs.mjs +2 -2
  48. package/fesm2022/softpak-components-spx-tabs.mjs.map +1 -1
  49. package/fesm2022/softpak-components-spx-toaster.mjs +2 -2
  50. package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
  51. package/fesm2022/softpak-components-spx-toggle.mjs +2 -2
  52. package/fesm2022/softpak-components-spx-toggle.mjs.map +1 -1
  53. package/fesm2022/softpak-components-spx-translate.mjs +39 -3
  54. package/fesm2022/softpak-components-spx-translate.mjs.map +1 -1
  55. package/fesm2022/softpak-components-spx-update.mjs +196 -50
  56. package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
  57. package/fesm2022/softpak-components-spx-validation-messages.mjs +42 -3
  58. package/fesm2022/softpak-components-spx-validation-messages.mjs.map +1 -1
  59. package/fesm2022/softpak-components-spx-validation.mjs +2 -2
  60. package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
  61. package/package.json +24 -21
  62. package/spx-translate/spx-translate._const.d.ts +25 -0
  63. package/spx-update/public-api.d.ts +6 -1
  64. package/spx-update/store/spx-update-check-v2/spx-update-check.actions.d.ts +28 -0
  65. package/spx-update/store/spx-update-check-v2/spx-update-check.effects.d.ts +14 -0
  66. package/spx-update/store/spx-update-check-v2/spx-update-check.initial.d.ts +2 -0
  67. package/spx-update/store/spx-update-check-v2/spx-update-check.reducer.d.ts +10 -0
  68. package/spx-update/store/spx-update-check-v2/spx-update-check.state.d.ts +5 -0
  69. package/spx-validation-messages/spx-validation-messages.component.d.ts +14 -0
@@ -1,5 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { input, inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { TranslateService } from '@ngx-translate/core';
4
+ import { spxTextTooLong, spxTextTooShort, spxTextTooHigh, spxTextTooLow, spxTextPatternNotValid, spxTextRequired, spxTextChoosePast, spxTextChooseFuture, spxTextChooseValidMonth, spxTextDateMayNotBeFuture, spxTextDateMayNotBePast, spxTextInvalidCode } from '@softpak/components/spx-translate';
3
5
 
4
6
  class SpxValidationMessagesComponent {
5
7
  constructor() {
@@ -8,13 +10,50 @@ class SpxValidationMessagesComponent {
8
10
  this.formControlI = input(undefined);
9
11
  this.fieldLabel = input(undefined);
10
12
  this.submitTried = input(undefined);
13
+ this.translateService = inject(TranslateService);
14
+ this.textTooLong = computed(() => {
15
+ return this.translateService.instant(spxTextTooLong, { fieldLabel: this.fieldLabel, error: this.errors()["maxlength"].requiredLength });
16
+ });
17
+ this.textTooShort = computed(() => {
18
+ return this.translateService.instant(spxTextTooShort, { fieldLabel: this.fieldLabel, error: this.errors()["minlength"].requiredLength });
19
+ });
20
+ this.textTooHigh = computed(() => {
21
+ return this.translateService.instant(spxTextTooHigh, { fieldLabel: this.fieldLabel, error: this.errors()["max"].max });
22
+ });
23
+ this.textTooLow = computed(() => {
24
+ return this.translateService.instant(spxTextTooLow, { fieldLabel: this.fieldLabel, error: this.errors()["min"].min });
25
+ });
26
+ this.textPatternNotValid = computed(() => {
27
+ return this.translateService.instant(spxTextPatternNotValid, { fieldLabel: this.fieldLabel });
28
+ });
29
+ this.textRequired = computed(() => {
30
+ return this.translateService.instant(spxTextRequired, { fieldLabel: this.fieldLabel });
31
+ });
32
+ this.textChoosePast = computed(() => {
33
+ return this.translateService.instant(spxTextChoosePast);
34
+ });
35
+ this.textChooseFuture = computed(() => {
36
+ return this.translateService.instant(spxTextChooseFuture);
37
+ });
38
+ this.textChooseValidMonth = computed(() => {
39
+ return this.translateService.instant(spxTextChooseValidMonth);
40
+ });
41
+ this.textDateMayNotBeFuture = computed(() => {
42
+ return this.translateService.instant(spxTextDateMayNotBeFuture);
43
+ });
44
+ this.textDateMayNotBePast = computed(() => {
45
+ return this.translateService.instant(spxTextDateMayNotBePast);
46
+ });
47
+ this.textInvalidCode = computed(() => {
48
+ return this.translateService.instant(spxTextInvalidCode, { codeName: this.errors()["invalidCode"].name, codeCode: this.errors()["invalidCode"].code });
49
+ });
11
50
  }
12
51
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: SpxValidationMessagesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: SpxValidationMessagesComponent, isStandalone: true, selector: "spx-validation-messages", inputs: { errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: true, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: true, transformFunction: null }, formControlI: { classPropertyName: "formControlI", publicName: "formControlI", isSignal: true, isRequired: false, transformFunction: null }, fieldLabel: { classPropertyName: "fieldLabel", publicName: "fieldLabel", isSignal: true, isRequired: false, transformFunction: null }, submitTried: { classPropertyName: "submitTried", publicName: "submitTried", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "\r\n@if (formControlI() && errors() && (touched() || submitTried())) {\r\n @if (errors()[\"maxlength\"]) {\r\n <div>'{{fieldLabel()}}' is too long, the maximum length is {{errors()[\"maxlength\"].requiredLength}}.</div>\r\n }\r\n @if (errors()[\"minlength\"]) {\r\n <div>'{{fieldLabel()}}' is too short, the minimum length is {{errors()[\"minlength\"].requiredLength}}.</div>\r\n }\r\n @if (errors()[\"max\"]) {\r\n <div>The value of '{{fieldLabel()}}' is too high, the maximum is {{errors()[\"max\"].max}}.</div>\r\n }\r\n @if (errors()[\"min\"]) {\r\n <div>The value of '{{fieldLabel()}}' is too low, the minimum is {{errors()[\"min\"].min}}.</div>\r\n }\r\n @if (errors()[\"pattern\"]) {\r\n <div>The pattern of '{{fieldLabel()}}' not valid.</div>\r\n }\r\n @if (errors()[\"required\"]) {\r\n <div>'{{fieldLabel()}}' is required.</div>\r\n }\r\n @if (errors()[\"year\"]) {\r\n <div>Please choose a year between 1991 and the current year.</div>\r\n }\r\n @if (errors()[\"yearFuture\"]) {\r\n <div>Please choose a year between the current year and 2050.</div>\r\n }\r\n @if (errors()[\"month\"]) {\r\n <div>Please choose a valid month (a value between 01 and 12).</div>\r\n }\r\n @if (errors()[\"future\"]) {\r\n <div>The selected date may not be in the future.</div>\r\n }\r\n @if (errors()[\"past\"]) {\r\n <div>The selected date may not be in the past.</div>\r\n }\r\n @if (errors()[\"invalidCode\"]) {\r\n <div>The {{ errors()[\"invalidCode\"].name }} code {{ errors()[\"invalidCode\"].code }} does not exist.</div>\r\n }\r\n}", styles: [":host{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
52
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: SpxValidationMessagesComponent, isStandalone: true, selector: "spx-validation-messages", inputs: { errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: true, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: true, transformFunction: null }, formControlI: { classPropertyName: "formControlI", publicName: "formControlI", isSignal: true, isRequired: false, transformFunction: null }, fieldLabel: { classPropertyName: "fieldLabel", publicName: "fieldLabel", isSignal: true, isRequired: false, transformFunction: null }, submitTried: { classPropertyName: "submitTried", publicName: "submitTried", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "\n@if (formControlI() && errors() && (touched() || submitTried())) {\n @if (errors()[\"maxlength\"]) {\n <div>{{ textTooLong() }}</div>\n }\n @if (errors()[\"minlength\"]) {\n <div>{{ textTooShort() }}</div>\n }\n @if (errors()[\"max\"]) {\n <div>{{ textTooHigh() }}</div>\n }\n @if (errors()[\"min\"]) {\n <div>{{ textTooLow() }}</div>\n }\n @if (errors()[\"pattern\"]) {\n <div>{{ textPatternNotValid() }}</div>\n }\n @if (errors()[\"required\"]) {\n <div>{{ textRequired() }}</div>\n }\n @if (errors()[\"year\"]) {\n <div>{{ textChoosePast() }}</div>\n }\n @if (errors()[\"yearFuture\"]) {\n <div>{{ textChooseFuture() }}</div>\n }\n @if (errors()[\"month\"]) {\n <div>{{ textChooseValidMonth() }}</div>\n }\n @if (errors()[\"future\"]) {\n <div>{{ textDateMayNotBeFuture() }}</div>\n }\n @if (errors()[\"past\"]) {\n <div>{{ textDateMayNotBePast() }}</div>\n }\n @if (errors()[\"invalidCode\"]) {\n <div>{{ textInvalidCode() }}</div>\n }\n}", styles: [":host{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
14
53
  }
15
54
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: SpxValidationMessagesComponent, decorators: [{
16
55
  type: Component,
17
- args: [{ selector: 'spx-validation-messages', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "\r\n@if (formControlI() && errors() && (touched() || submitTried())) {\r\n @if (errors()[\"maxlength\"]) {\r\n <div>'{{fieldLabel()}}' is too long, the maximum length is {{errors()[\"maxlength\"].requiredLength}}.</div>\r\n }\r\n @if (errors()[\"minlength\"]) {\r\n <div>'{{fieldLabel()}}' is too short, the minimum length is {{errors()[\"minlength\"].requiredLength}}.</div>\r\n }\r\n @if (errors()[\"max\"]) {\r\n <div>The value of '{{fieldLabel()}}' is too high, the maximum is {{errors()[\"max\"].max}}.</div>\r\n }\r\n @if (errors()[\"min\"]) {\r\n <div>The value of '{{fieldLabel()}}' is too low, the minimum is {{errors()[\"min\"].min}}.</div>\r\n }\r\n @if (errors()[\"pattern\"]) {\r\n <div>The pattern of '{{fieldLabel()}}' not valid.</div>\r\n }\r\n @if (errors()[\"required\"]) {\r\n <div>'{{fieldLabel()}}' is required.</div>\r\n }\r\n @if (errors()[\"year\"]) {\r\n <div>Please choose a year between 1991 and the current year.</div>\r\n }\r\n @if (errors()[\"yearFuture\"]) {\r\n <div>Please choose a year between the current year and 2050.</div>\r\n }\r\n @if (errors()[\"month\"]) {\r\n <div>Please choose a valid month (a value between 01 and 12).</div>\r\n }\r\n @if (errors()[\"future\"]) {\r\n <div>The selected date may not be in the future.</div>\r\n }\r\n @if (errors()[\"past\"]) {\r\n <div>The selected date may not be in the past.</div>\r\n }\r\n @if (errors()[\"invalidCode\"]) {\r\n <div>The {{ errors()[\"invalidCode\"].name }} code {{ errors()[\"invalidCode\"].code }} does not exist.</div>\r\n }\r\n}", styles: [":host{display:block}\n"] }]
56
+ args: [{ selector: 'spx-validation-messages', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "\n@if (formControlI() && errors() && (touched() || submitTried())) {\n @if (errors()[\"maxlength\"]) {\n <div>{{ textTooLong() }}</div>\n }\n @if (errors()[\"minlength\"]) {\n <div>{{ textTooShort() }}</div>\n }\n @if (errors()[\"max\"]) {\n <div>{{ textTooHigh() }}</div>\n }\n @if (errors()[\"min\"]) {\n <div>{{ textTooLow() }}</div>\n }\n @if (errors()[\"pattern\"]) {\n <div>{{ textPatternNotValid() }}</div>\n }\n @if (errors()[\"required\"]) {\n <div>{{ textRequired() }}</div>\n }\n @if (errors()[\"year\"]) {\n <div>{{ textChoosePast() }}</div>\n }\n @if (errors()[\"yearFuture\"]) {\n <div>{{ textChooseFuture() }}</div>\n }\n @if (errors()[\"month\"]) {\n <div>{{ textChooseValidMonth() }}</div>\n }\n @if (errors()[\"future\"]) {\n <div>{{ textDateMayNotBeFuture() }}</div>\n }\n @if (errors()[\"past\"]) {\n <div>{{ textDateMayNotBePast() }}</div>\n }\n @if (errors()[\"invalidCode\"]) {\n <div>{{ textInvalidCode() }}</div>\n }\n}", styles: [":host{display:block}\n"] }]
18
57
  }] });
19
58
 
20
59
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-validation-messages.mjs","sources":["../../../../projects/softpak/components/spx-validation-messages/spx-validation-messages.component.ts","../../../../projects/softpak/components/spx-validation-messages/spx-validation-messages.component.html","../../../../projects/softpak/components/spx-validation-messages/softpak-components-spx-validation-messages.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { AbstractControl, ValidationErrors } from '@angular/forms';\r\n\r\n@Component({\r\n selector: 'spx-validation-messages',\r\n standalone: true,\r\n templateUrl: './spx-validation-messages.component.html',\r\n styleUrl: './spx-validation-messages.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SpxValidationMessagesComponent { \r\n readonly errors = input.required<ValidationErrors>();\r\n readonly touched = input.required<boolean>();\r\n readonly formControlI = input<AbstractControl<any,any> | undefined>(undefined);\r\n readonly fieldLabel = input<string | undefined>(undefined);\r\n readonly submitTried = input<boolean | undefined>(undefined);\r\n}\r\n","\r\n@if (formControlI() && errors() && (touched() || submitTried())) {\r\n @if (errors()[\"maxlength\"]) {\r\n <div>'{{fieldLabel()}}' is too long, the maximum length is {{errors()[\"maxlength\"].requiredLength}}.</div>\r\n }\r\n @if (errors()[\"minlength\"]) {\r\n <div>'{{fieldLabel()}}' is too short, the minimum length is {{errors()[\"minlength\"].requiredLength}}.</div>\r\n }\r\n @if (errors()[\"max\"]) {\r\n <div>The value of '{{fieldLabel()}}' is too high, the maximum is {{errors()[\"max\"].max}}.</div>\r\n }\r\n @if (errors()[\"min\"]) {\r\n <div>The value of '{{fieldLabel()}}' is too low, the minimum is {{errors()[\"min\"].min}}.</div>\r\n }\r\n @if (errors()[\"pattern\"]) {\r\n <div>The pattern of '{{fieldLabel()}}' not valid.</div>\r\n }\r\n @if (errors()[\"required\"]) {\r\n <div>'{{fieldLabel()}}' is required.</div>\r\n }\r\n @if (errors()[\"year\"]) {\r\n <div>Please choose a year between 1991 and the current year.</div>\r\n }\r\n @if (errors()[\"yearFuture\"]) {\r\n <div>Please choose a year between the current year and 2050.</div>\r\n }\r\n @if (errors()[\"month\"]) {\r\n <div>Please choose a valid month (a value between 01 and 12).</div>\r\n }\r\n @if (errors()[\"future\"]) {\r\n <div>The selected date may not be in the future.</div>\r\n }\r\n @if (errors()[\"past\"]) {\r\n <div>The selected date may not be in the past.</div>\r\n }\r\n @if (errors()[\"invalidCode\"]) {\r\n <div>The {{ errors()[\"invalidCode\"].name }} code {{ errors()[\"invalidCode\"].code }} does not exist.</div>\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAUa,8BAA8B,CAAA;AAP3C,IAAA,WAAA,GAAA;AAQW,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAoB;AAC3C,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAW;AACnC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAuC,SAAS,CAAC;AACrE,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAqB,SAAS,CAAC;AACjD,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAsB,SAAS,CAAC;AAC7D;+GANY,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA9B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,8BAA8B,ovBCV3C,yjDAsCC,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FD5BY,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAP1C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,yBAAyB,EACvB,UAAA,EAAA,IAAI,EAGC,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,yjDAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AERjD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-validation-messages.mjs","sources":["../../../../projects/softpak/components/spx-validation-messages/spx-validation-messages.component.ts","../../../../projects/softpak/components/spx-validation-messages/spx-validation-messages.component.html","../../../../projects/softpak/components/spx-validation-messages/softpak-components-spx-validation-messages.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { AbstractControl, ValidationErrors } from '@angular/forms';\nimport { TranslateService } from '@ngx-translate/core';\nimport { spxTextChooseFuture, spxTextChoosePast, spxTextChooseValidMonth, spxTextDateMayNotBeFuture, spxTextDateMayNotBePast, spxTextInvalidCode, spxTextPatternNotValid, spxTextRequired, spxTextTooHigh, spxTextTooLong, spxTextTooLow, spxTextTooShort } from '@softpak/components/spx-translate';\n\n@Component({\n selector: 'spx-validation-messages',\n standalone: true,\n templateUrl: './spx-validation-messages.component.html',\n styleUrl: './spx-validation-messages.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SpxValidationMessagesComponent { \n readonly errors = input.required<ValidationErrors>();\n readonly touched = input.required<boolean>();\n readonly formControlI = input<AbstractControl<any,any> | undefined>(undefined);\n readonly fieldLabel = input<string | undefined>(undefined);\n readonly submitTried = input<boolean | undefined>(undefined);\n\n translateService = inject(TranslateService);\n \n textTooLong = computed(() => {\n return this.translateService.instant(spxTextTooLong, { fieldLabel: this.fieldLabel, error: this.errors()[\"maxlength\"].requiredLength });\n });\n\n textTooShort = computed(() => {\n return this.translateService.instant(spxTextTooShort, { fieldLabel: this.fieldLabel, error: this.errors()[\"minlength\"].requiredLength });\n });\n\n textTooHigh = computed(() => {\n return this.translateService.instant(spxTextTooHigh, { fieldLabel: this.fieldLabel, error: this.errors()[\"max\"].max });\n });\n\n textTooLow = computed(() => {\n return this.translateService.instant(spxTextTooLow, { fieldLabel: this.fieldLabel, error: this.errors()[\"min\"].min });\n });\n\n textPatternNotValid = computed(() => {\n return this.translateService.instant(spxTextPatternNotValid, { fieldLabel: this.fieldLabel });\n });\n\n textRequired = computed(() => {\n return this.translateService.instant(spxTextRequired, { fieldLabel: this.fieldLabel });\n });\n\n textChoosePast = computed(() => {\n return this.translateService.instant(spxTextChoosePast);\n });\n\n textChooseFuture = computed(() => {\n return this.translateService.instant(spxTextChooseFuture);\n });\n\n textChooseValidMonth = computed(() => {\n return this.translateService.instant(spxTextChooseValidMonth);\n });\n\n textDateMayNotBeFuture = computed(() => {\n return this.translateService.instant(spxTextDateMayNotBeFuture);\n });\n\n textDateMayNotBePast = computed(() => {\n return this.translateService.instant(spxTextDateMayNotBePast);\n });\n\n textInvalidCode = computed(() => {\n return this.translateService.instant(spxTextInvalidCode, { codeName: this.errors()[\"invalidCode\"].name, codeCode: this.errors()[\"invalidCode\"].code });\n });\n\n}\n","\n@if (formControlI() && errors() && (touched() || submitTried())) {\n @if (errors()[\"maxlength\"]) {\n <div>{{ textTooLong() }}</div>\n }\n @if (errors()[\"minlength\"]) {\n <div>{{ textTooShort() }}</div>\n }\n @if (errors()[\"max\"]) {\n <div>{{ textTooHigh() }}</div>\n }\n @if (errors()[\"min\"]) {\n <div>{{ textTooLow() }}</div>\n }\n @if (errors()[\"pattern\"]) {\n <div>{{ textPatternNotValid() }}</div>\n }\n @if (errors()[\"required\"]) {\n <div>{{ textRequired() }}</div>\n }\n @if (errors()[\"year\"]) {\n <div>{{ textChoosePast() }}</div>\n }\n @if (errors()[\"yearFuture\"]) {\n <div>{{ textChooseFuture() }}</div>\n }\n @if (errors()[\"month\"]) {\n <div>{{ textChooseValidMonth() }}</div>\n }\n @if (errors()[\"future\"]) {\n <div>{{ textDateMayNotBeFuture() }}</div>\n }\n @if (errors()[\"past\"]) {\n <div>{{ textDateMayNotBePast() }}</div>\n }\n @if (errors()[\"invalidCode\"]) {\n <div>{{ textInvalidCode() }}</div>\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAYa,8BAA8B,CAAA;AAP3C,IAAA,WAAA,GAAA;AAQW,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAoB;AAC3C,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAW;AACnC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAuC,SAAS,CAAC;AACrE,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAqB,SAAS,CAAC;AACjD,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAsB,SAAS,CAAC;AAE5D,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAE3C,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;AAC1B,YAAA,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC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EAAA,SAAA,EAAA,IAAA,EAAA,8BAA8B,ovBCZ3C,8+BAsCC,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FD1BY,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAP1C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,yBAAyB,EACvB,UAAA,EAAA,IAAI,EAGC,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,8+BAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AEVjD;;AAEG;;;;"}
@@ -184,13 +184,13 @@ class SpxValidateControlComponent {
184
184
  });
185
185
  }
186
186
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: SpxValidateControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
187
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: SpxValidateControlComponent, isStandalone: true, selector: "spx-validate-control", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, submitTried: { classPropertyName: "submitTried", publicName: "submitTried", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: true, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (control() && errors() && (touched() || submitTried())) {\r\n @if (maxLength()) {\r\n <div>'{{ label() }}' is too long, the maximum length is {{ maxLengthRequiredLength() }}.</div>\r\n }\r\n @if (minLength()) {\r\n <div>'{{ label() }}' is too short, the minimum length is {{ minLengthRequiredLength() }}.</div>\r\n }\r\n @if (max()) {\r\n <div>The value of '{{ label() }}' is too high, the maximum is {{ maxRequiredMax() }}.</div>\r\n }\r\n @if (min()) {\r\n <div>The value of '{{ label() }}' is too low, the minimum is {{ minRequiredMin() }}.</div>\r\n }\r\n @if (pattern()) {\r\n <div>The pattern of '{{ label() }}' not valid.</div>\r\n }\r\n @if (required()) {\r\n <div>'{{ label() }}' is required.</div>\r\n }\r\n @if (year()) {\r\n <div>Please choose a year between 1991 and the current year.</div>\r\n }\r\n @if (yearFuture()) {\r\n <div>Please choose a year between the current year and 2050.</div>\r\n }\r\n @if (month()) {\r\n <div>Please choose a valid month (a value between 01 and 12).</div>\r\n }\r\n @if (future()) {\r\n <div>The selected date may not be in the future.</div>\r\n }\r\n @if (past()) {\r\n <div>The selected date may not be in the past.</div>\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
187
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: SpxValidateControlComponent, isStandalone: true, selector: "spx-validate-control", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, submitTried: { classPropertyName: "submitTried", publicName: "submitTried", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: true, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (control() && errors() && (touched() || submitTried())) {\n @if (maxLength()) {\n <div>'{{ label() }}' is too long, the maximum length is {{ maxLengthRequiredLength() }}.</div>\n }\n @if (minLength()) {\n <div>'{{ label() }}' is too short, the minimum length is {{ minLengthRequiredLength() }}.</div>\n }\n @if (max()) {\n <div>The value of '{{ label() }}' is too high, the maximum is {{ maxRequiredMax() }}.</div>\n }\n @if (min()) {\n <div>The value of '{{ label() }}' is too low, the minimum is {{ minRequiredMin() }}.</div>\n }\n @if (pattern()) {\n <div>The pattern of '{{ label() }}' not valid.</div>\n }\n @if (required()) {\n <div>'{{ label() }}' is required.</div>\n }\n @if (year()) {\n <div>Please choose a year between 1991 and the current year.</div>\n }\n @if (yearFuture()) {\n <div>Please choose a year between the current year and 2050.</div>\n }\n @if (month()) {\n <div>Please choose a valid month (a value between 01 and 12).</div>\n }\n @if (future()) {\n <div>The selected date may not be in the future.</div>\n }\n @if (past()) {\n <div>The selected date may not be in the past.</div>\n }\n}\n", dependencies: [{ kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
188
188
  }
189
189
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: SpxValidateControlComponent, decorators: [{
190
190
  type: Component,
191
191
  args: [{ selector: 'spx-validate-control', imports: [
192
192
  FormsModule,
193
- ], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (control() && errors() && (touched() || submitTried())) {\r\n @if (maxLength()) {\r\n <div>'{{ label() }}' is too long, the maximum length is {{ maxLengthRequiredLength() }}.</div>\r\n }\r\n @if (minLength()) {\r\n <div>'{{ label() }}' is too short, the minimum length is {{ minLengthRequiredLength() }}.</div>\r\n }\r\n @if (max()) {\r\n <div>The value of '{{ label() }}' is too high, the maximum is {{ maxRequiredMax() }}.</div>\r\n }\r\n @if (min()) {\r\n <div>The value of '{{ label() }}' is too low, the minimum is {{ minRequiredMin() }}.</div>\r\n }\r\n @if (pattern()) {\r\n <div>The pattern of '{{ label() }}' not valid.</div>\r\n }\r\n @if (required()) {\r\n <div>'{{ label() }}' is required.</div>\r\n }\r\n @if (year()) {\r\n <div>Please choose a year between 1991 and the current year.</div>\r\n }\r\n @if (yearFuture()) {\r\n <div>Please choose a year between the current year and 2050.</div>\r\n }\r\n @if (month()) {\r\n <div>Please choose a valid month (a value between 01 and 12).</div>\r\n }\r\n @if (future()) {\r\n <div>The selected date may not be in the future.</div>\r\n }\r\n @if (past()) {\r\n <div>The selected date may not be in the past.</div>\r\n }\r\n}\r\n" }]
193
+ ], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (control() && errors() && (touched() || submitTried())) {\n @if (maxLength()) {\n <div>'{{ label() }}' is too long, the maximum length is {{ maxLengthRequiredLength() }}.</div>\n }\n @if (minLength()) {\n <div>'{{ label() }}' is too short, the minimum length is {{ minLengthRequiredLength() }}.</div>\n }\n @if (max()) {\n <div>The value of '{{ label() }}' is too high, the maximum is {{ maxRequiredMax() }}.</div>\n }\n @if (min()) {\n <div>The value of '{{ label() }}' is too low, the minimum is {{ minRequiredMin() }}.</div>\n }\n @if (pattern()) {\n <div>The pattern of '{{ label() }}' not valid.</div>\n }\n @if (required()) {\n <div>'{{ label() }}' is required.</div>\n }\n @if (year()) {\n <div>Please choose a year between 1991 and the current year.</div>\n }\n @if (yearFuture()) {\n <div>Please choose a year between the current year and 2050.</div>\n }\n @if (month()) {\n <div>Please choose a valid month (a value between 01 and 12).</div>\n }\n @if (future()) {\n <div>The selected date may not be in the future.</div>\n }\n @if (past()) {\n <div>The selected date may not be in the past.</div>\n }\n}\n" }]
194
194
  }] });
195
195
 
196
196
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-validation.mjs","sources":["../../../../projects/softpak/components/spx-validation/required.validator.ts","../../../../projects/softpak/components/spx-validation/max.validator.ts","../../../../projects/softpak/components/spx-validation/maxlength.validator.ts","../../../../projects/softpak/components/spx-validation/min.validator.ts","../../../../projects/softpak/components/spx-validation/minlength.validator.ts","../../../../projects/softpak/components/spx-validation/pattern.validator.ts","../../../../projects/softpak/components/spx-validation/year-and-month.validator.ts","../../../../projects/softpak/components/spx-validation/spx-validate-control.component.ts","../../../../projects/softpak/components/spx-validation/spx-validate-control.component.html","../../../../projects/softpak/components/spx-validation/softpak-components-spx-validation.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors } from '@angular/forms';\r\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\r\n\r\nexport const spxValidatorRequired = () => (control: AbstractControl): ValidationErrors | null => {\r\n if (\r\n control &&\r\n valuePairToValue(control.value) === undefined ||\r\n valuePairToValue(control.value) === null ||\r\n valuePairToValue(control.value) === '' ||\r\n valuePairToValue(control.value) === 0\r\n ) {\r\n return { required: true };\r\n }\r\n return null;\r\n};\r\n","import { AbstractControl } from '@angular/forms';\r\nimport { spxValidatorRequired } from './required.validator';\r\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\r\n\r\nexport const spxValidatorMax = (max: number) => (control: AbstractControl): { max: { max: number; actual: number } } | null => {\r\n if (!spxValidatorRequired()(control)) {\r\n const value = parseInt(valuePairToValue(control.value).toString(), 10);\r\n if (!isNaN(value) && value > max) {\r\n return {\r\n max: {\r\n max,\r\n actual: value\r\n }\r\n };\r\n }\r\n }\r\n return null;\r\n};\r\n","import { AbstractControl } from '@angular/forms';\r\nimport { spxValidatorRequired } from './required.validator';\r\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\r\n\r\nexport const spxValidatorMaxLength = (maximumLength: number, sanitizer?: (input: string) => string) => (control: AbstractControl): { maxlength: { requiredLength: number; actualLength: number } } | null => {\r\n if (!spxValidatorRequired()(control)) {\r\n let value = valuePairToValue(control.value);\r\n if (sanitizer) {\r\n value = sanitizer(value.toString());\r\n }\r\n if (value.toString().length > maximumLength) {\r\n return {\r\n maxlength: {\r\n requiredLength: maximumLength,\r\n actualLength: value.toString().length\r\n }\r\n };\r\n }\r\n }\r\n return null;\r\n};\r\n","import { AbstractControl } from '@angular/forms';\r\nimport { spxValidatorRequired } from './required.validator';\r\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\r\n\r\nexport const spxValidatorMin = (min: number) => (control: AbstractControl): { min: { min: number; actual: number } } | null => {\r\n if (!spxValidatorRequired()(control)) {\r\n const value = parseInt(valuePairToValue(control.value).toString(), 10);\r\n\r\n if (!isNaN(value) && value < min) {\r\n return {\r\n min: {\r\n min,\r\n actual: value\r\n }\r\n };\r\n }\r\n }\r\n return null;\r\n};\r\n","import { AbstractControl } from '@angular/forms';\r\nimport { spxValidatorRequired } from './required.validator';\r\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\r\n\r\nexport const spxValidatorMinLength = (minimumLength: number, sanitizer?: (input: string) => string) => (control: AbstractControl): { minlength: { requiredLength: number; actualLength: number } } | null => {\r\n if (!spxValidatorRequired()(control)) {\r\n let value = valuePairToValue(control.value);\r\n if (sanitizer) {\r\n value = sanitizer(value.toString());\r\n }\r\n if (value.toString().length < minimumLength) {\r\n return {\r\n minlength: {\r\n requiredLength: minimumLength,\r\n actualLength: value.toString().length\r\n }\r\n };\r\n }\r\n }\r\n return null;\r\n};\r\n","import { AbstractControl, ValidationErrors } from '@angular/forms';\r\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\r\nimport { spxValidatorRequired } from './required.validator';\r\n\r\nexport const spxValidatorPattern = (matcher: RegExp) => (control: AbstractControl): ValidationErrors | null => {\r\n if (!spxValidatorRequired()(control)) {\r\n const matches = valuePairToValue(control.value).toString().match(matcher);\r\n if (matches === null || matches.length === 0) {\r\n return { pattern: true };\r\n }\r\n }\r\n return null;\r\n};\r\n","import { AbstractControl, ValidationErrors } from '@angular/forms';\r\n\r\nimport { DateTime } from 'luxon';\r\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\r\nimport { spxValidatorRequired } from './required.validator';\r\n\r\nexport const spxValidatorYearAndMonth = (future?: boolean) => (control: AbstractControl): ValidationErrors | null => {\r\n if (!spxValidatorRequired()(control)) {\r\n const val = valuePairToValue(control.value);\r\n if (val.toUpperCase() !== 'ACEP') {\r\n const date = DateTime.fromISO(val);\r\n const year = date.year;\r\n const month = date.month;\r\n if (val.length < 6) {\r\n return {\r\n minlength: {\r\n requiredLength: 6,\r\n actualLength: val.length\r\n }\r\n };\r\n }\r\n if (month < 1 || month > 12) {\r\n return { month: true };\r\n }\r\n if (future) {\r\n if (year > 2050 || year < DateTime.now().year) {\r\n return { yearFuture: true };\r\n }\r\n if (DateTime.now().set({ year: year, month: DateTime.now().month - 1 }).startOf('month') < DateTime.now()) {\r\n return { past: true };\r\n }\r\n } else {\r\n if (year < 1971 || year > DateTime.now().year) {\r\n return { year: true };\r\n }\r\n if (DateTime.now().set({ year: year, month: DateTime.now().month - 1 }).startOf('month') > DateTime.now()) {\r\n return { future: true };\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n};\r\n","\r\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\r\nimport { AbstractControl, FormsModule, ValidationErrors } from '@angular/forms';\r\n\r\n@Component({\r\n selector: 'spx-validate-control',\r\n templateUrl: './spx-validate-control.component.html',\r\n imports: [\r\n FormsModule,\r\n ],\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class SpxValidateControlComponent {\r\n readonly control = input.required<AbstractControl>();\r\n readonly label = input<string | unknown>();\r\n readonly submitTried = input<boolean>();\r\n readonly errors = input.required<ValidationErrors | null>();\r\n readonly touched = input.required<boolean>();\r\n\r\n maxLength = computed(() => {\r\n return this.errors() && this.errors()!['maxlength'];\r\n });\r\n\r\n maxLengthRequiredLength = computed(() => {\r\n return this.maxLength() && this.errors() && this.errors()!['maxlength']['requiredLength'];\r\n });\r\n\r\n minLength = computed(() => {\r\n return this.errors() && this.errors()!['minlength'];\r\n });\r\n\r\n minLengthRequiredLength = computed(() => {\r\n return this.minLength() && this.errors() && this.errors()!['minlength']['requiredLength'];\r\n });\r\n\r\n max = computed(() => {\r\n return this.errors() && this.errors()!['max'];\r\n });\r\n\r\n maxRequiredMax = computed(() => {\r\n return this.max() && this.errors() && this.errors()!['max']['max'];\r\n });\r\n\r\n min = computed(() => {\r\n return this.errors() && this.errors()!['min'];\r\n });\r\n\r\n minRequiredMin = computed(() => {\r\n return this.min() && this.errors() && this.errors()!['min']['min'];\r\n });\r\n\r\n pattern = computed(() => {\r\n return this.errors() && this.errors()!['pattern'];\r\n });\r\n\r\n required = computed(() => {\r\n return this.errors() && this.errors()!['required'];\r\n });\r\n\r\n year = computed(() => {\r\n return this.errors() && this.errors()!['year'];\r\n });\r\n\r\n yearFuture = computed(() => {\r\n return this.errors() && this.errors()!['yearFuture'];\r\n });\r\n\r\n month = computed(() => {\r\n return this.errors() && this.errors()!['month'];\r\n });\r\n\r\n future = computed(() => {\r\n return this.errors() && this.errors()!['future'];\r\n });\r\n\r\n past = computed(() => {\r\n return this.errors() && this.errors()!['past'];\r\n });\r\n}\r\n","@if (control() && errors() && (touched() || submitTried())) {\r\n @if (maxLength()) {\r\n <div>'{{ label() }}' is too long, the maximum length is {{ maxLengthRequiredLength() }}.</div>\r\n }\r\n @if (minLength()) {\r\n <div>'{{ label() }}' is too short, the minimum length is {{ minLengthRequiredLength() }}.</div>\r\n }\r\n @if (max()) {\r\n <div>The value of '{{ label() }}' is too high, the maximum is {{ maxRequiredMax() }}.</div>\r\n }\r\n @if (min()) {\r\n <div>The value of '{{ label() }}' is too low, the minimum is {{ minRequiredMin() }}.</div>\r\n }\r\n @if (pattern()) {\r\n <div>The pattern of '{{ label() }}' not valid.</div>\r\n }\r\n @if (required()) {\r\n <div>'{{ label() }}' is required.</div>\r\n }\r\n @if (year()) {\r\n <div>Please choose a year between 1991 and the current year.</div>\r\n }\r\n @if (yearFuture()) {\r\n <div>Please choose a year between the current year and 2050.</div>\r\n }\r\n @if (month()) {\r\n <div>Please choose a valid month (a value between 01 and 12).</div>\r\n }\r\n @if (future()) {\r\n <div>The selected date may not be in the future.</div>\r\n }\r\n @if (past()) {\r\n <div>The selected date may not be in the past.</div>\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAGa,MAAA,oBAAoB,GAAG,MAAM,CAAC,OAAwB,KAA6B;AAC5F,IAAA,IACI,OAAO;AACP,QAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,SAAS;AAC7C,QAAA,gBAAgB,CAAC,OAAO,C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spx-validation/required.validator.ts","../../../../projects/softpak/components/spx-validation/max.validator.ts","../../../../projects/softpak/components/spx-validation/maxlength.validator.ts","../../../../projects/softpak/components/spx-validation/min.validator.ts","../../../../projects/softpak/components/spx-validation/minlength.validator.ts","../../../../projects/softpak/components/spx-validation/pattern.validator.ts","../../../../projects/softpak/components/spx-validation/year-and-month.validator.ts","../../../../projects/softpak/components/spx-validation/spx-validate-control.component.ts","../../../../projects/softpak/components/spx-validation/spx-validate-control.component.html","../../../../projects/softpak/components/spx-validation/softpak-components-spx-validation.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors } from '@angular/forms';\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\n\nexport const spxValidatorRequired = () => (control: AbstractControl): ValidationErrors | null => {\n if (\n control &&\n valuePairToValue(control.value) === undefined ||\n valuePairToValue(control.value) === null ||\n valuePairToValue(control.value) === '' ||\n valuePairToValue(control.value) === 0\n ) {\n return { required: true };\n }\n return null;\n};\n","import { AbstractControl } from '@angular/forms';\nimport { spxValidatorRequired } from './required.validator';\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\n\nexport const spxValidatorMax = (max: number) => (control: AbstractControl): { max: { max: number; actual: number } } | null => {\n if (!spxValidatorRequired()(control)) {\n const value = parseInt(valuePairToValue(control.value).toString(), 10);\n if (!isNaN(value) && value > max) {\n return {\n max: {\n max,\n actual: value\n }\n };\n }\n }\n return null;\n};\n","import { AbstractControl } from '@angular/forms';\nimport { spxValidatorRequired } from './required.validator';\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\n\nexport const spxValidatorMaxLength = (maximumLength: number, sanitizer?: (input: string) => string) => (control: AbstractControl): { maxlength: { requiredLength: number; actualLength: number } } | null => {\n if (!spxValidatorRequired()(control)) {\n let value = valuePairToValue(control.value);\n if (sanitizer) {\n value = sanitizer(value.toString());\n }\n if (value.toString().length > maximumLength) {\n return {\n maxlength: {\n requiredLength: maximumLength,\n actualLength: value.toString().length\n }\n };\n }\n }\n return null;\n};\n","import { AbstractControl } from '@angular/forms';\nimport { spxValidatorRequired } from './required.validator';\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\n\nexport const spxValidatorMin = (min: number) => (control: AbstractControl): { min: { min: number; actual: number } } | null => {\n if (!spxValidatorRequired()(control)) {\n const value = parseInt(valuePairToValue(control.value).toString(), 10);\n\n if (!isNaN(value) && value < min) {\n return {\n min: {\n min,\n actual: value\n }\n };\n }\n }\n return null;\n};\n","import { AbstractControl } from '@angular/forms';\nimport { spxValidatorRequired } from './required.validator';\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\n\nexport const spxValidatorMinLength = (minimumLength: number, sanitizer?: (input: string) => string) => (control: AbstractControl): { minlength: { requiredLength: number; actualLength: number } } | null => {\n if (!spxValidatorRequired()(control)) {\n let value = valuePairToValue(control.value);\n if (sanitizer) {\n value = sanitizer(value.toString());\n }\n if (value.toString().length < minimumLength) {\n return {\n minlength: {\n requiredLength: minimumLength,\n actualLength: value.toString().length\n }\n };\n }\n }\n return null;\n};\n","import { AbstractControl, ValidationErrors } from '@angular/forms';\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\nimport { spxValidatorRequired } from './required.validator';\n\nexport const spxValidatorPattern = (matcher: RegExp) => (control: AbstractControl): ValidationErrors | null => {\n if (!spxValidatorRequired()(control)) {\n const matches = valuePairToValue(control.value).toString().match(matcher);\n if (matches === null || matches.length === 0) {\n return { pattern: true };\n }\n }\n return null;\n};\n","import { AbstractControl, ValidationErrors } from '@angular/forms';\n\nimport { DateTime } from 'luxon';\nimport { valuePairToValue } from '@softpak/components/spx-helpers';\nimport { spxValidatorRequired } from './required.validator';\n\nexport const spxValidatorYearAndMonth = (future?: boolean) => (control: AbstractControl): ValidationErrors | null => {\n if (!spxValidatorRequired()(control)) {\n const val = valuePairToValue(control.value);\n if (val.toUpperCase() !== 'ACEP') {\n const date = DateTime.fromISO(val);\n const year = date.year;\n const month = date.month;\n if (val.length < 6) {\n return {\n minlength: {\n requiredLength: 6,\n actualLength: val.length\n }\n };\n }\n if (month < 1 || month > 12) {\n return { month: true };\n }\n if (future) {\n if (year > 2050 || year < DateTime.now().year) {\n return { yearFuture: true };\n }\n if (DateTime.now().set({ year: year, month: DateTime.now().month - 1 }).startOf('month') < DateTime.now()) {\n return { past: true };\n }\n } else {\n if (year < 1971 || year > DateTime.now().year) {\n return { year: true };\n }\n if (DateTime.now().set({ year: year, month: DateTime.now().month - 1 }).startOf('month') > DateTime.now()) {\n return { future: true };\n }\n }\n }\n }\n return null;\n};\n","\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { AbstractControl, FormsModule, ValidationErrors } from '@angular/forms';\n\n@Component({\n selector: 'spx-validate-control',\n templateUrl: './spx-validate-control.component.html',\n imports: [\n FormsModule,\n ],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxValidateControlComponent {\n readonly control = input.required<AbstractControl>();\n readonly label = input<string | unknown>();\n readonly submitTried = input<boolean>();\n readonly errors = input.required<ValidationErrors | null>();\n readonly touched = input.required<boolean>();\n\n maxLength = computed(() => {\n return this.errors() && this.errors()!['maxlength'];\n });\n\n maxLengthRequiredLength = computed(() => {\n return this.maxLength() && this.errors() && this.errors()!['maxlength']['requiredLength'];\n });\n\n minLength = computed(() => {\n return this.errors() && this.errors()!['minlength'];\n });\n\n minLengthRequiredLength = computed(() => {\n return this.minLength() && this.errors() && this.errors()!['minlength']['requiredLength'];\n });\n\n max = computed(() => {\n return this.errors() && this.errors()!['max'];\n });\n\n maxRequiredMax = computed(() => {\n return this.max() && this.errors() && this.errors()!['max']['max'];\n });\n\n min = computed(() => {\n return this.errors() && this.errors()!['min'];\n });\n\n minRequiredMin = computed(() => {\n return this.min() && this.errors() && this.errors()!['min']['min'];\n });\n\n pattern = computed(() => {\n return this.errors() && this.errors()!['pattern'];\n });\n\n required = computed(() => {\n return this.errors() && this.errors()!['required'];\n });\n\n year = computed(() => {\n return this.errors() && this.errors()!['year'];\n });\n\n yearFuture = computed(() => {\n return this.errors() && this.errors()!['yearFuture'];\n });\n\n month = computed(() => {\n return this.errors() && this.errors()!['month'];\n });\n\n future = computed(() => {\n return this.errors() && this.errors()!['future'];\n });\n\n past = computed(() => {\n return this.errors() && this.errors()!['past'];\n });\n}\n","@if (control() && errors() && (touched() || submitTried())) {\n @if (maxLength()) {\n <div>'{{ label() }}' is too long, the maximum length is {{ maxLengthRequiredLength() }}.</div>\n }\n @if (minLength()) {\n <div>'{{ label() }}' is too short, the minimum length is {{ minLengthRequiredLength() }}.</div>\n }\n @if (max()) {\n <div>The value of '{{ label() }}' is too high, the maximum is {{ maxRequiredMax() }}.</div>\n }\n @if (min()) {\n <div>The value of '{{ label() }}' is too low, the minimum is {{ minRequiredMin() }}.</div>\n }\n @if (pattern()) {\n <div>The pattern of '{{ label() }}' not valid.</div>\n }\n @if (required()) {\n <div>'{{ label() }}' is required.</div>\n }\n @if (year()) {\n <div>Please choose a year between 1991 and the current year.</div>\n }\n @if (yearFuture()) {\n <div>Please choose a year between the current year and 2050.</div>\n }\n @if (month()) {\n <div>Please choose a valid month (a value between 01 and 12).</div>\n }\n @if (future()) {\n <div>The selected date may not be in the future.</div>\n }\n @if (past()) {\n <div>The selected date may not be in the past.</div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAGa,MAAA,oBAAoB,GAAG,MAAM,CAAC,OAAwB,KAA6B;AAC5F,IAAA,IACI,OAAO;AACP,QAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,SAAS;AAC7C,QAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI;AACxC,QAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE;QACtC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EACvC;AACE,QAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;;AAE7B,IAAA,OAA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,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECbxC,ypCAmCA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,ED3BQ,WAAW,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAKN,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBATvC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,sBAAsB,EAEvB,OAAA,EAAA;wBACL,WAAW;AACd,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,ypCAAA,EAAA;;;AEXnD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@softpak/components",
3
- "version": "19.25.4",
3
+ "version": "19.26.0-beta.2",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "19.x.x",
7
7
  "@angular/core": "19.x.x",
8
8
  "@capacitor/app": "6.x.x || 7.x.x",
9
9
  "@capacitor/device": "6.x.x || 7.x.x",
10
- "@capacitor/live-updates": "0.3.x || 0.4.x",
11
10
  "@fortawesome/free-solid-svg-icons": "6.x.x",
12
11
  "@ionic/angular": "8.x.x",
13
12
  "@ngrx/effects": "19.x.x",
@@ -15,6 +14,10 @@
15
14
  "@ngx-translate/core": "16.x.x",
16
15
  "@sentry/angular": "9.x.x"
17
16
  },
17
+ "optionalDependencies": {
18
+ "@capacitor/live-updates": "0.3.x || 0.4.x",
19
+ "@capawesome/capacitor-live-update": "7.2.x"
20
+ },
18
21
  "dependencies": {
19
22
  "tslib": "^2.3.0"
20
23
  },
@@ -33,22 +36,22 @@
33
36
  "types": "./spx-404-page/index.d.ts",
34
37
  "default": "./fesm2022/softpak-components-spx-404-page.mjs"
35
38
  },
36
- "./spx-button": {
37
- "types": "./spx-button/index.d.ts",
38
- "default": "./fesm2022/softpak-components-spx-button.mjs"
39
+ "./spx-alert": {
40
+ "types": "./spx-alert/index.d.ts",
41
+ "default": "./fesm2022/softpak-components-spx-alert.mjs"
39
42
  },
40
43
  "./spx-app-configuration": {
41
44
  "types": "./spx-app-configuration/index.d.ts",
42
45
  "default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
43
46
  },
47
+ "./spx-button": {
48
+ "types": "./spx-button/index.d.ts",
49
+ "default": "./fesm2022/softpak-components-spx-button.mjs"
50
+ },
44
51
  "./spx-app-expiry": {
45
52
  "types": "./spx-app-expiry/index.d.ts",
46
53
  "default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
47
54
  },
48
- "./spx-alert": {
49
- "types": "./spx-alert/index.d.ts",
50
- "default": "./fesm2022/softpak-components-spx-alert.mjs"
51
- },
52
55
  "./spx-capitalize": {
53
56
  "types": "./spx-capitalize/index.d.ts",
54
57
  "default": "./fesm2022/softpak-components-spx-capitalize.mjs"
@@ -65,6 +68,10 @@
65
68
  "types": "./spx-channel-selection/index.d.ts",
66
69
  "default": "./fesm2022/softpak-components-spx-channel-selection.mjs"
67
70
  },
71
+ "./spx-check-digit": {
72
+ "types": "./spx-check-digit/index.d.ts",
73
+ "default": "./fesm2022/softpak-components-spx-check-digit.mjs"
74
+ },
68
75
  "./spx-confirm": {
69
76
  "types": "./spx-confirm/index.d.ts",
70
77
  "default": "./fesm2022/softpak-components-spx-confirm.mjs"
@@ -73,10 +80,6 @@
73
80
  "types": "./spx-form-section/index.d.ts",
74
81
  "default": "./fesm2022/softpak-components-spx-form-section.mjs"
75
82
  },
76
- "./spx-check-digit": {
77
- "types": "./spx-check-digit/index.d.ts",
78
- "default": "./fesm2022/softpak-components-spx-check-digit.mjs"
79
- },
80
83
  "./spx-form-view": {
81
84
  "types": "./spx-form-view/index.d.ts",
82
85
  "default": "./fesm2022/softpak-components-spx-form-view.mjs"
@@ -89,14 +92,14 @@
89
92
  "types": "./spx-inputs/index.d.ts",
90
93
  "default": "./fesm2022/softpak-components-spx-inputs.mjs"
91
94
  },
92
- "./spx-number-check": {
93
- "types": "./spx-number-check/index.d.ts",
94
- "default": "./fesm2022/softpak-components-spx-number-check.mjs"
95
- },
96
95
  "./spx-navigation": {
97
96
  "types": "./spx-navigation/index.d.ts",
98
97
  "default": "./fesm2022/softpak-components-spx-navigation.mjs"
99
98
  },
99
+ "./spx-number-check": {
100
+ "types": "./spx-number-check/index.d.ts",
101
+ "default": "./fesm2022/softpak-components-spx-number-check.mjs"
102
+ },
100
103
  "./spx-pagination": {
101
104
  "types": "./spx-pagination/index.d.ts",
102
105
  "default": "./fesm2022/softpak-components-spx-pagination.mjs"
@@ -125,6 +128,10 @@
125
128
  "types": "./spx-storage/index.d.ts",
126
129
  "default": "./fesm2022/softpak-components-spx-storage.mjs"
127
130
  },
131
+ "./spx-suggestion": {
132
+ "types": "./spx-suggestion/index.d.ts",
133
+ "default": "./fesm2022/softpak-components-spx-suggestion.mjs"
134
+ },
128
135
  "./spx-tabs": {
129
136
  "types": "./spx-tabs/index.d.ts",
130
137
  "default": "./fesm2022/softpak-components-spx-tabs.mjs"
@@ -133,10 +140,6 @@
133
140
  "types": "./spx-toaster/index.d.ts",
134
141
  "default": "./fesm2022/softpak-components-spx-toaster.mjs"
135
142
  },
136
- "./spx-suggestion": {
137
- "types": "./spx-suggestion/index.d.ts",
138
- "default": "./fesm2022/softpak-components-spx-suggestion.mjs"
139
- },
140
143
  "./spx-toggle": {
141
144
  "types": "./spx-toggle/index.d.ts",
142
145
  "default": "./fesm2022/softpak-components-spx-toggle.mjs"
@@ -14,6 +14,18 @@ export declare const spxText404PageNotFound = "spxText404PageNotFound";
14
14
  export declare const spxTextPageNotFound = "spxTextPageNotFound";
15
15
  export declare const spxTextPageNotFoundDescription = "spxTextPageNotFoundDescription";
16
16
  export declare const spxTextGoHome = "spxTextGoHome";
17
+ export declare const spxTextTooLong = "spxTextTooLong";
18
+ export declare const spxTextTooShort = "spxTextTooShort";
19
+ export declare const spxTextTooHigh = "spxTextTooHigh";
20
+ export declare const spxTextTooLow = "spxTextTooLow";
21
+ export declare const spxTextPatternNotValid = "spxTextPatternNotValid";
22
+ export declare const spxTextRequired = "spxTextRequired";
23
+ export declare const spxTextChoosePast = "spxTextChoosePast";
24
+ export declare const spxTextChooseFuture = "spxTextChooseFuture";
25
+ export declare const spxTextChooseValidMonth = "spxTextChooseValidMonth";
26
+ export declare const spxTextDateMayNotBeFuture = "spxTextDateMayNotBeFuture";
27
+ export declare const spxTextDateMayNotBePast = "spxTextDateMayNotBePast";
28
+ export declare const spxTextInvalidCode = "spxTextInvalidCode";
17
29
  export interface SpxTranslateI {
18
30
  [spxTextChange]: string;
19
31
  [spxTextCheckingForUpdates]: string;
@@ -31,4 +43,17 @@ export interface SpxTranslateI {
31
43
  [spxTextPageNotFound]: string;
32
44
  [spxTextPageNotFoundDescription]: string;
33
45
  [spxTextGoHome]: string;
46
+ [spxTextInvalidCode]: string;
47
+ [spxTextTooLong]: string;
48
+ [spxTextTooShort]: string;
49
+ [spxTextTooHigh]: string;
50
+ [spxTextTooLow]: string;
51
+ [spxTextPatternNotValid]: string;
52
+ [spxTextRequired]: string;
53
+ [spxTextChoosePast]: string;
54
+ [spxTextChooseFuture]: string;
55
+ [spxTextChooseValidMonth]: string;
56
+ [spxTextDateMayNotBeFuture]: string;
57
+ [spxTextDateMayNotBePast]: string;
58
+ [spxTextInvalidCode]: string;
34
59
  }
@@ -5,7 +5,12 @@ export * as spxUpdateCheckActions from './store/spx-update-check/spx-update-chec
5
5
  export * as spxUpdateCheckEffects from './store/spx-update-check/spx-update-check.effects';
6
6
  export * as spxUpdateCheckInitial from './store/spx-update-check/spx-update-check.initial';
7
7
  export * as spxUpdateCheckReducer from './store/spx-update-check/spx-update-check.reducer';
8
- export * as spxUpdateCheckState from './store/spx-update-check/spx-update-check.state';
8
+ export * as spxUpdateCheckState from './store/spx-update-check-v2/spx-update-check.state';
9
+ export * as spxUpdateCheckV2Actions from './store/spx-update-check-v2/spx-update-check.actions';
10
+ export * as spxUpdateCheckV2Effects from './store/spx-update-check-v2/spx-update-check.effects';
11
+ export * as spxUpdateCheckV2Initial from './store/spx-update-check-v2/spx-update-check.initial';
12
+ export * as spxUpdateCheckV2Reducer from './store/spx-update-check-v2/spx-update-check.reducer';
13
+ export * as spxUpdateCheckV2State from './store/spx-update-check/spx-update-check.state';
9
14
  export * as spxUpdatePendingActions from './store/spx-update-pending/spx-update-pending.actions';
10
15
  export * as spxUpdatePendingEffects from './store/spx-update-pending/spx-update-pending.effects';
11
16
  export * as spxUpdatePendingInitial from './store/spx-update-pending/spx-update-pending.initial';
@@ -0,0 +1,28 @@
1
+ export declare const anUpdateIsReady: import("@ngrx/store").ActionCreator<"[SPX / Update Check V2] An update is ready", (props: Record<string, unknown>) => Record<string, unknown> & import("@ngrx/store").Action<"[SPX / Update Check V2] An update is ready">>;
2
+ export declare const clearError: import("@ngrx/store").ActionCreator<"[SPX / Update Check V2] Clear error", (props: Record<string, unknown>) => Record<string, unknown> & import("@ngrx/store").Action<"[SPX / Update Check V2] Clear error">>;
3
+ export declare const checkFailed: import("@ngrx/store").ActionCreator<"[SPX / Update Check V2] Error happened", (props: {
4
+ startUpdateAgainAfterTimeout?: boolean;
5
+ }) => {
6
+ startUpdateAgainAfterTimeout?: boolean;
7
+ } & import("@ngrx/store").Action<"[SPX / Update Check V2] Error happened">>;
8
+ export declare const initialize: import("@ngrx/store").ActionCreator<"[SPX / Update Check V2] Initialize", (props: Record<string, unknown>) => Record<string, unknown> & import("@ngrx/store").Action<"[SPX / Update Check V2] Initialize">>;
9
+ export declare const noUpdateWasFound: import("@ngrx/store").ActionCreator<"[SPX / Update Check V2] No update was found", (props: {
10
+ startUpdateAgainAfterTimeout?: boolean;
11
+ }) => {
12
+ startUpdateAgainAfterTimeout?: boolean;
13
+ } & import("@ngrx/store").Action<"[SPX / Update Check V2] No update was found">>;
14
+ export declare const notAvailableOnWeb: import("@ngrx/store").ActionCreator<"[SPX / Update Check V2] Not available on web", (props: Record<string, unknown>) => Record<string, unknown> & import("@ngrx/store").Action<"[SPX / Update Check V2] Not available on web">>;
15
+ export declare const runCheck: import("@ngrx/store").ActionCreator<"[SPX / Update Check V2] Run", (props: {
16
+ forceWaitForUpdate?: boolean;
17
+ }) => {
18
+ forceWaitForUpdate?: boolean;
19
+ } & import("@ngrx/store").Action<"[SPX / Update Check V2] Run">>;
20
+ declare const all: (Record<string, unknown> & import("@ngrx/store").Action<"[SPX / Update Check V2] An update is ready">) | (Record<string, unknown> & import("@ngrx/store").Action<"[SPX / Update Check V2] Clear error">) | ({
21
+ startUpdateAgainAfterTimeout?: boolean;
22
+ } & import("@ngrx/store").Action<"[SPX / Update Check V2] Error happened">) | (Record<string, unknown> & import("@ngrx/store").Action<"[SPX / Update Check V2] Initialize">) | ({
23
+ startUpdateAgainAfterTimeout?: boolean;
24
+ } & import("@ngrx/store").Action<"[SPX / Update Check V2] No update was found">) | (Record<string, unknown> & import("@ngrx/store").Action<"[SPX / Update Check V2] Not available on web">) | ({
25
+ forceWaitForUpdate?: boolean;
26
+ } & import("@ngrx/store").Action<"[SPX / Update Check V2] Run">);
27
+ export type Actions = typeof all;
28
+ export {};
@@ -0,0 +1,14 @@
1
+ import { Actions } from '@ngrx/effects';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ export declare class Effects {
5
+ private readonly actions$;
6
+ afterInitialize$: Observable<any>;
7
+ onRun$: Observable<any>;
8
+ constructor(actions$: Actions);
9
+ whenAndUpdateIsReady$: Observable<any>;
10
+ whenCheckHasFailed$: Observable<any>;
11
+ whenNoUpdateWasFound$: Observable<any>;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<Effects, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<Effects>;
14
+ }
@@ -0,0 +1,2 @@
1
+ import { StateI } from "./spx-update-check.state";
2
+ export declare const initialState: StateI;
@@ -0,0 +1,10 @@
1
+ import { StateI } from './spx-update-check.state';
2
+ declare const _default: {
3
+ name: "spxUpdateCheck";
4
+ reducer: import("@ngrx/store").ActionReducer<StateI, import("@ngrx/store").Action<string>>;
5
+ selectSpxUpdateCheckState: import("@ngrx/store").MemoizedSelector<Record<string, any>, StateI, (featureState: StateI) => StateI>;
6
+ selectForceWaitForUpdate: import("@ngrx/store").MemoizedSelector<Record<string, any>, boolean, (featureState: StateI) => boolean>;
7
+ selectLastCheck: import("@ngrx/store").MemoizedSelector<Record<string, any>, string | null, (featureState: StateI) => string | null>;
8
+ selectShowError: import("@ngrx/store").MemoizedSelector<Record<string, any>, boolean, (featureState: StateI) => boolean>;
9
+ };
10
+ export default _default;
@@ -0,0 +1,5 @@
1
+ export interface StateI {
2
+ forceWaitForUpdate: boolean;
3
+ lastCheck: string | null;
4
+ showError: boolean;
5
+ }
@@ -1,4 +1,5 @@
1
1
  import { AbstractControl, ValidationErrors } from '@angular/forms';
2
+ import { TranslateService } from '@ngx-translate/core';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class SpxValidationMessagesComponent {
4
5
  readonly errors: import("@angular/core").InputSignal<ValidationErrors>;
@@ -6,6 +7,19 @@ export declare class SpxValidationMessagesComponent {
6
7
  readonly formControlI: import("@angular/core").InputSignal<AbstractControl<any, any> | undefined>;
7
8
  readonly fieldLabel: import("@angular/core").InputSignal<string | undefined>;
8
9
  readonly submitTried: import("@angular/core").InputSignal<boolean | undefined>;
10
+ translateService: TranslateService;
11
+ textTooLong: import("@angular/core").Signal<any>;
12
+ textTooShort: import("@angular/core").Signal<any>;
13
+ textTooHigh: import("@angular/core").Signal<any>;
14
+ textTooLow: import("@angular/core").Signal<any>;
15
+ textPatternNotValid: import("@angular/core").Signal<any>;
16
+ textRequired: import("@angular/core").Signal<any>;
17
+ textChoosePast: import("@angular/core").Signal<any>;
18
+ textChooseFuture: import("@angular/core").Signal<any>;
19
+ textChooseValidMonth: import("@angular/core").Signal<any>;
20
+ textDateMayNotBeFuture: import("@angular/core").Signal<any>;
21
+ textDateMayNotBePast: import("@angular/core").Signal<any>;
22
+ textInvalidCode: import("@angular/core").Signal<any>;
9
23
  static ɵfac: i0.ɵɵFactoryDeclaration<SpxValidationMessagesComponent, never>;
10
24
  static ɵcmp: i0.ɵɵComponentDeclaration<SpxValidationMessagesComponent, "spx-validation-messages", never, { "errors": { "alias": "errors"; "required": true; "isSignal": true; }; "touched": { "alias": "touched"; "required": true; "isSignal": true; }; "formControlI": { "alias": "formControlI"; "required": false; "isSignal": true; }; "fieldLabel": { "alias": "fieldLabel"; "required": false; "isSignal": true; }; "submitTried": { "alias": "submitTried"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
11
25
  }