@softpak/components 20.4.1 → 20.5.1
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.
- package/fesm2022/softpak-components-spx-404-page.mjs +3 -3
- package/fesm2022/softpak-components-spx-404-page.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-alert.mjs +10 -10
- package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-app-configuration.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-app-expiry.mjs +16 -16
- package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-button.mjs +16 -16
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-capitalize.mjs +3 -3
- package/fesm2022/softpak-components-spx-card.mjs +34 -34
- package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-change-details.mjs +19 -19
- package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-channel-selection.mjs +9 -9
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs +11 -11
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-confirm.mjs +11 -11
- package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-section.mjs +7 -7
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +20 -20
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-inputs.mjs +530 -395
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +20 -20
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-number-check.mjs +17 -17
- package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pagination.mjs +10 -10
- package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-patch.mjs +6 -6
- package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pipes.mjs +3 -3
- package/fesm2022/softpak-components-spx-progress-bar.mjs +5 -5
- package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-spinner.mjs +5 -5
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-stock-info.mjs +35 -35
- package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-storage.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-suggestion.mjs +7 -7
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-tabs.mjs +7 -7
- package/fesm2022/softpak-components-spx-tabs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +5 -5
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toggle.mjs +6 -6
- package/fesm2022/softpak-components-spx-toggle.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-translate.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-update.mjs +15 -15
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-validation-messages.mjs +20 -20
- package/fesm2022/softpak-components-spx-validation-messages.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-validation.mjs +23 -23
- package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-welcome.mjs +14 -14
- package/fesm2022/softpak-components-spx-welcome.mjs.map +1 -1
- package/package.json +41 -41
- package/spx-inputs/index.d.ts +103 -49
- package/spx-validation/index.d.ts +1 -1
- package/spx-validation-messages/index.d.ts +1 -1
- package/tailwind.css +1 -1
|
@@ -5,53 +5,53 @@ import { spxTextTooLong, spxTextTooShort, spxTextTooHigh, spxTextTooLow, spxText
|
|
|
5
5
|
|
|
6
6
|
class SpxValidationMessagesComponent {
|
|
7
7
|
constructor() {
|
|
8
|
-
this.errors = input.required();
|
|
9
|
-
this.touched = input.required();
|
|
10
|
-
this.formControlI = input(undefined);
|
|
11
|
-
this.fieldLabel = input(undefined);
|
|
12
|
-
this.submitTried = input(undefined);
|
|
8
|
+
this.errors = input.required(...(ngDevMode ? [{ debugName: "errors" }] : []));
|
|
9
|
+
this.touched = input.required(...(ngDevMode ? [{ debugName: "touched" }] : []));
|
|
10
|
+
this.formControlI = input(undefined, ...(ngDevMode ? [{ debugName: "formControlI" }] : []));
|
|
11
|
+
this.fieldLabel = input(undefined, ...(ngDevMode ? [{ debugName: "fieldLabel" }] : []));
|
|
12
|
+
this.submitTried = input(undefined, ...(ngDevMode ? [{ debugName: "submitTried" }] : []));
|
|
13
13
|
this.translateService = inject(TranslateService);
|
|
14
14
|
this.textTooLong = computed(() => {
|
|
15
15
|
return this.translateService.instant(spxTextTooLong, { fieldLabel: this.fieldLabel(), error: this.errors()["maxlength"].requiredLength });
|
|
16
|
-
});
|
|
16
|
+
}, ...(ngDevMode ? [{ debugName: "textTooLong" }] : []));
|
|
17
17
|
this.textTooShort = computed(() => {
|
|
18
18
|
return this.translateService.instant(spxTextTooShort, { fieldLabel: this.fieldLabel(), error: this.errors()["minlength"].requiredLength });
|
|
19
|
-
});
|
|
19
|
+
}, ...(ngDevMode ? [{ debugName: "textTooShort" }] : []));
|
|
20
20
|
this.textTooHigh = computed(() => {
|
|
21
21
|
return this.translateService.instant(spxTextTooHigh, { fieldLabel: this.fieldLabel(), error: this.errors()["max"].max });
|
|
22
|
-
});
|
|
22
|
+
}, ...(ngDevMode ? [{ debugName: "textTooHigh" }] : []));
|
|
23
23
|
this.textTooLow = computed(() => {
|
|
24
24
|
return this.translateService.instant(spxTextTooLow, { fieldLabel: this.fieldLabel(), error: this.errors()["min"].min });
|
|
25
|
-
});
|
|
25
|
+
}, ...(ngDevMode ? [{ debugName: "textTooLow" }] : []));
|
|
26
26
|
this.textPatternNotValid = computed(() => {
|
|
27
27
|
return this.translateService.instant(spxTextPatternNotValid, { fieldLabel: this.fieldLabel() });
|
|
28
|
-
});
|
|
28
|
+
}, ...(ngDevMode ? [{ debugName: "textPatternNotValid" }] : []));
|
|
29
29
|
this.textRequired = computed(() => {
|
|
30
30
|
return this.translateService.instant(spxTextRequired, { fieldLabel: this.fieldLabel() });
|
|
31
|
-
});
|
|
31
|
+
}, ...(ngDevMode ? [{ debugName: "textRequired" }] : []));
|
|
32
32
|
this.textChoosePast = computed(() => {
|
|
33
33
|
return this.translateService.instant(spxTextChoosePast);
|
|
34
|
-
});
|
|
34
|
+
}, ...(ngDevMode ? [{ debugName: "textChoosePast" }] : []));
|
|
35
35
|
this.textChooseFuture = computed(() => {
|
|
36
36
|
return this.translateService.instant(spxTextChooseFuture);
|
|
37
|
-
});
|
|
37
|
+
}, ...(ngDevMode ? [{ debugName: "textChooseFuture" }] : []));
|
|
38
38
|
this.textChooseValidMonth = computed(() => {
|
|
39
39
|
return this.translateService.instant(spxTextChooseValidMonth);
|
|
40
|
-
});
|
|
40
|
+
}, ...(ngDevMode ? [{ debugName: "textChooseValidMonth" }] : []));
|
|
41
41
|
this.textDateMayNotBeFuture = computed(() => {
|
|
42
42
|
return this.translateService.instant(spxTextDateMayNotBeFuture);
|
|
43
|
-
});
|
|
43
|
+
}, ...(ngDevMode ? [{ debugName: "textDateMayNotBeFuture" }] : []));
|
|
44
44
|
this.textDateMayNotBePast = computed(() => {
|
|
45
45
|
return this.translateService.instant(spxTextDateMayNotBePast);
|
|
46
|
-
});
|
|
46
|
+
}, ...(ngDevMode ? [{ debugName: "textDateMayNotBePast" }] : []));
|
|
47
47
|
this.textInvalidCode = computed(() => {
|
|
48
48
|
return this.translateService.instant(spxTextInvalidCode, { codeName: this.errors()["invalidCode"].name, codeCode: this.errors()["invalidCode"].code });
|
|
49
|
-
});
|
|
49
|
+
}, ...(ngDevMode ? [{ debugName: "textInvalidCode" }] : []));
|
|
50
50
|
}
|
|
51
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
52
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
51
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxValidationMessagesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
52
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", 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 }); }
|
|
53
53
|
}
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxValidationMessagesComponent, decorators: [{
|
|
55
55
|
type: Component,
|
|
56
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"] }]
|
|
57
57
|
}] });
|
|
@@ -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, 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,
|
|
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>{{ textDateMayNot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AA;;;AEVjD;;AAEG;;;;"}
|
|
@@ -132,61 +132,61 @@ const spxValidatorYearAndMonth = (future) => (control) => {
|
|
|
132
132
|
|
|
133
133
|
class SpxValidateControlComponent {
|
|
134
134
|
constructor() {
|
|
135
|
-
this.control = input.required();
|
|
136
|
-
this.label = input();
|
|
137
|
-
this.submitTried = input();
|
|
138
|
-
this.errors = input.required();
|
|
139
|
-
this.touched = input.required();
|
|
135
|
+
this.control = input.required(...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
136
|
+
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
137
|
+
this.submitTried = input(...(ngDevMode ? [undefined, { debugName: "submitTried" }] : []));
|
|
138
|
+
this.errors = input.required(...(ngDevMode ? [{ debugName: "errors" }] : []));
|
|
139
|
+
this.touched = input.required(...(ngDevMode ? [{ debugName: "touched" }] : []));
|
|
140
140
|
this.maxLength = computed(() => {
|
|
141
141
|
return this.errors() && this.errors()['maxlength'];
|
|
142
|
-
});
|
|
142
|
+
}, ...(ngDevMode ? [{ debugName: "maxLength" }] : []));
|
|
143
143
|
this.maxLengthRequiredLength = computed(() => {
|
|
144
144
|
return this.maxLength() && this.errors() && this.errors()['maxlength']['requiredLength'];
|
|
145
|
-
});
|
|
145
|
+
}, ...(ngDevMode ? [{ debugName: "maxLengthRequiredLength" }] : []));
|
|
146
146
|
this.minLength = computed(() => {
|
|
147
147
|
return this.errors() && this.errors()['minlength'];
|
|
148
|
-
});
|
|
148
|
+
}, ...(ngDevMode ? [{ debugName: "minLength" }] : []));
|
|
149
149
|
this.minLengthRequiredLength = computed(() => {
|
|
150
150
|
return this.minLength() && this.errors() && this.errors()['minlength']['requiredLength'];
|
|
151
|
-
});
|
|
151
|
+
}, ...(ngDevMode ? [{ debugName: "minLengthRequiredLength" }] : []));
|
|
152
152
|
this.max = computed(() => {
|
|
153
153
|
return this.errors() && this.errors()['max'];
|
|
154
|
-
});
|
|
154
|
+
}, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
155
155
|
this.maxRequiredMax = computed(() => {
|
|
156
156
|
return this.max() && this.errors() && this.errors()['max']['max'];
|
|
157
|
-
});
|
|
157
|
+
}, ...(ngDevMode ? [{ debugName: "maxRequiredMax" }] : []));
|
|
158
158
|
this.min = computed(() => {
|
|
159
159
|
return this.errors() && this.errors()['min'];
|
|
160
|
-
});
|
|
160
|
+
}, ...(ngDevMode ? [{ debugName: "min" }] : []));
|
|
161
161
|
this.minRequiredMin = computed(() => {
|
|
162
162
|
return this.min() && this.errors() && this.errors()['min']['min'];
|
|
163
|
-
});
|
|
163
|
+
}, ...(ngDevMode ? [{ debugName: "minRequiredMin" }] : []));
|
|
164
164
|
this.pattern = computed(() => {
|
|
165
165
|
return this.errors() && this.errors()['pattern'];
|
|
166
|
-
});
|
|
166
|
+
}, ...(ngDevMode ? [{ debugName: "pattern" }] : []));
|
|
167
167
|
this.required = computed(() => {
|
|
168
168
|
return this.errors() && this.errors()['required'];
|
|
169
|
-
});
|
|
169
|
+
}, ...(ngDevMode ? [{ debugName: "required" }] : []));
|
|
170
170
|
this.year = computed(() => {
|
|
171
171
|
return this.errors() && this.errors()['year'];
|
|
172
|
-
});
|
|
172
|
+
}, ...(ngDevMode ? [{ debugName: "year" }] : []));
|
|
173
173
|
this.yearFuture = computed(() => {
|
|
174
174
|
return this.errors() && this.errors()['yearFuture'];
|
|
175
|
-
});
|
|
175
|
+
}, ...(ngDevMode ? [{ debugName: "yearFuture" }] : []));
|
|
176
176
|
this.month = computed(() => {
|
|
177
177
|
return this.errors() && this.errors()['month'];
|
|
178
|
-
});
|
|
178
|
+
}, ...(ngDevMode ? [{ debugName: "month" }] : []));
|
|
179
179
|
this.future = computed(() => {
|
|
180
180
|
return this.errors() && this.errors()['future'];
|
|
181
|
-
});
|
|
181
|
+
}, ...(ngDevMode ? [{ debugName: "future" }] : []));
|
|
182
182
|
this.past = computed(() => {
|
|
183
183
|
return this.errors() && this.errors()['past'];
|
|
184
|
-
});
|
|
184
|
+
}, ...(ngDevMode ? [{ debugName: "past" }] : []));
|
|
185
185
|
}
|
|
186
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
187
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
186
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxValidateControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
187
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", 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
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxValidateControlComponent, decorators: [{
|
|
190
190
|
type: Component,
|
|
191
191
|
args: [{ selector: 'spx-validate-control', imports: [
|
|
192
192
|
FormsModule,
|
|
@@ -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';\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,OAAO,IAAI;AACf;;ACVO,MAAM,eAAe,GAAG,CAAC,GAAW,KAAK,CAAC,OAAwB,KAAqD;AAC1H,IAAA,IAAI,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,EAAE;AAClC,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC;QACtE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,GAAG,EAAE;YAC9B,OAAO;AACH,gBAAA,GAAG,EAAE;oBACD,GAAG;AACH,oBAAA,MAAM,EAAE;AACX;aACJ;;;AAGT,IAAA,OAAO,IAAI;AACf;;ACbO,MAAM,qBAAqB,GAAG,CAAC,aAAqB,EAAE,SAAqC,KAAK,CAAC,OAAwB,KAA4E;AACxM,IAAA,IAAI,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,EAAE;QAClC,IAAI,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC;QAC3C,IAAI,SAAS,EAAE;YACX,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,Q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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;;;;"}
|
|
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';\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":";;;;;;AAGO,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAwB,KAA6B;AAC5F,IAAA,IACI,OAAO;AACP,QAAA,gBAAgB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,CAAA;kBATvC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,sBAAsB,EAAA,OAAA,EAEvB;wBACL,WAAW;AACd,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,ypCAAA,EAAA;;;AEXnD;;AAEG;;;;"}
|
|
@@ -25,26 +25,26 @@ class SpxWelcomeComponent {
|
|
|
25
25
|
this.store = store;
|
|
26
26
|
this.formBuilder = formBuilder;
|
|
27
27
|
this.allChannels = toSignal(this.store.select(spxChannelReducer.default.selectChannels));
|
|
28
|
-
this.allBrands = computed(() => this.allChannels()?.filter(channel => channel.channelTypes.map(type => type.name).includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand })));
|
|
29
|
-
this.inputBrand = signal(null);
|
|
30
|
-
this.inputChannelType = signal(null);
|
|
31
|
-
this.selectedBrand = computed(() => this.allChannels()?.find(c => c.brand === this.inputBrand()));
|
|
28
|
+
this.allBrands = computed(() => this.allChannels()?.filter(channel => channel.channelTypes.map(type => type.name).includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand })), ...(ngDevMode ? [{ debugName: "allBrands" }] : []));
|
|
29
|
+
this.inputBrand = signal(null, ...(ngDevMode ? [{ debugName: "inputBrand" }] : []));
|
|
30
|
+
this.inputChannelType = signal(null, ...(ngDevMode ? [{ debugName: "inputChannelType" }] : []));
|
|
31
|
+
this.selectedBrand = computed(() => this.allChannels()?.find(c => c.brand === this.inputBrand()), ...(ngDevMode ? [{ debugName: "selectedBrand" }] : []));
|
|
32
32
|
this.channelTypeSuggestions = computed(() => this.selectedBrand()?.channelTypes?.filter(channelType => Capacitor.getPlatform() === 'web' ? channelType.webUrl !== undefined : channelType.webUrl === undefined)?.map(channelType => ({
|
|
33
33
|
description: channelType.name,
|
|
34
34
|
value: channelType.name
|
|
35
|
-
})));
|
|
36
|
-
this.formGroup = signal(undefined);
|
|
35
|
+
})), ...(ngDevMode ? [{ debugName: "channelTypeSuggestions" }] : []));
|
|
36
|
+
this.formGroup = signal(undefined, ...(ngDevMode ? [{ debugName: "formGroup" }] : []));
|
|
37
37
|
this.suggestions = signal({
|
|
38
38
|
[spxCtrlChannelType]: [],
|
|
39
39
|
[spxCtrlChannel]: [],
|
|
40
|
-
});
|
|
40
|
+
}, ...(ngDevMode ? [{ debugName: "suggestions" }] : []));
|
|
41
41
|
this.textChannel = spxTextChannel;
|
|
42
42
|
this.textCompany = spxTextCompany;
|
|
43
43
|
this.textSelect = spxTextSelect;
|
|
44
44
|
this.textSelectYourCompany = spxTextSelectYourCompany;
|
|
45
|
-
this.formSection = computed(() => this.formGroup()?.get(spxSectionWelcome));
|
|
46
|
-
this.ctrlChannel = computed(() => this.formSection()?.get(spxCtrlChannel));
|
|
47
|
-
this.ctrlChannelType = computed(() => this.formSection()?.get(spxCtrlChannelType));
|
|
45
|
+
this.formSection = computed(() => this.formGroup()?.get(spxSectionWelcome), ...(ngDevMode ? [{ debugName: "formSection" }] : []));
|
|
46
|
+
this.ctrlChannel = computed(() => this.formSection()?.get(spxCtrlChannel), ...(ngDevMode ? [{ debugName: "ctrlChannel" }] : []));
|
|
47
|
+
this.ctrlChannelType = computed(() => this.formSection()?.get(spxCtrlChannelType), ...(ngDevMode ? [{ debugName: "ctrlChannelType" }] : []));
|
|
48
48
|
this.subscriptions = {};
|
|
49
49
|
this.form = signal({
|
|
50
50
|
buttons: [
|
|
@@ -76,7 +76,7 @@ class SpxWelcomeComponent {
|
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
78
|
]
|
|
79
|
-
});
|
|
79
|
+
}, ...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
80
80
|
this.formGroup.set(this.formBuilder.group({
|
|
81
81
|
[spxSectionWelcome]: SpxFormViewComponent.createForm(this.form())
|
|
82
82
|
}));
|
|
@@ -111,10 +111,10 @@ class SpxWelcomeComponent {
|
|
|
111
111
|
}));
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
115
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
114
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxWelcomeComponent, deps: [{ token: i1.Store }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
115
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: SpxWelcomeComponent, isStandalone: true, selector: "spx-welcome", ngImport: i0, template: "<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ textSelectYourCompany | translate | capitalize }}\n </ion-title>\n <ion-buttons slot=\"end\">\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content class=\"ion-padding\">\n <form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxForm]=\"form()\"\n [spxFormGroup]=\"formSection()\"\n [spxSuggestions]=\"suggestions()\">\n </spx-form-view>\n </form>\n</ion-content>", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: SpxFormViewComponent, selector: "spx-form-view", inputs: ["spxFormGroup", "spxForm", "spxSuggestions"], outputs: ["spxBlur", "spxClick", "spxSearch"] }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
116
116
|
}
|
|
117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxWelcomeComponent, decorators: [{
|
|
118
118
|
type: Component,
|
|
119
119
|
args: [{ selector: 'spx-welcome', imports: [
|
|
120
120
|
FormsModule,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-welcome.mjs","sources":["../../../../projects/softpak/components/spx-welcome/spx-welcome.component.ts","../../../../projects/softpak/components/spx-welcome/spx-welcome.component.html","../../../../projects/softpak/components/spx-welcome/softpak-components-spx-welcome.ts"],"sourcesContent":["import { Component, OnInit, OnDestroy, signal, computed, ChangeDetectionStrategy } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Store } from '@ngrx/store';\nimport { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { SpxFormButtonTypeEnum, SpxFormI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\nimport { SpxSeverityEnum, unsubscribeSubscriptions, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxInputTypeEnum, SpxValuePair } from '@softpak/components/spx-inputs';\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { Subscription } from 'rxjs';\nimport { spxTextChannel, spxTextCompany, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';\nimport { IonHeader, IonToolbar, IonTitle, IonButtons, IonContent } from '@ionic/angular/standalone';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\nimport { spxChannelReducer, spxChannelActions } from '@softpak/components/spx-channel-selection';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { Capacitor } from '@capacitor/core';\n\nexport const spxSectionWelcome = 'welcome';\nexport const spxCtrlChannel = 'channel';\nexport const spxCtrlChannelType = 'channelType';\n\n@Component({\n selector: 'spx-welcome',\n templateUrl: './spx-welcome.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxCapitalizePipe,\n SpxFormViewComponent,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonButtons,\n IonContent,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxWelcomeComponent implements OnInit, OnDestroy {\n allChannels = toSignal(this.store.select(spxChannelReducer.default.selectChannels));\n allBrands = computed(() => this.allChannels()?.filter(channel => channel.channelTypes.map(type => type.name).includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand })));\n inputBrand = signal<string | null>(null);\n inputChannelType = signal<SpxAppChannelTypeEnum | null>(null);\n selectedBrand = computed(() => this.allChannels()?.find(c => c.brand === this.inputBrand()));\n channelTypeSuggestions = computed(() => this.selectedBrand()?.channelTypes?.filter(channelType => Capacitor.getPlatform() === 'web' ? channelType.webUrl !== undefined : channelType.webUrl === undefined)?.map(channelType => ({\n description: channelType.name,\n value: channelType.name\n })));\n\n protected readonly formGroup = signal<FormGroup | undefined>(undefined);\n protected readonly suggestions = signal<{\n [spxCtrlChannelType]?: SpxValuePair<string>[];\n [spxCtrlChannel]?: SpxValuePair<string>[];\n }>({\n [spxCtrlChannelType]: [],\n [spxCtrlChannel]: [],\n });\n\n textChannel = spxTextChannel;\n textCompany = spxTextCompany;\n textSelect = spxTextSelect;\n textSelectYourCompany = spxTextSelectYourCompany;\n\n protected readonly formSection = computed(() => this.formGroup()?.get(spxSectionWelcome) as FormGroup);\n private readonly ctrlChannel = computed(() => this.formSection()?.get(spxCtrlChannel) as FormControl);\n private readonly ctrlChannelType = computed(() => this.formSection()?.get(spxCtrlChannelType) as FormControl);\n private subscriptions: {\n channel?: Subscription;\n channelType?: Subscription;\n } = {};\n\n protected readonly form = signal<SpxFormI>({\n buttons: [\n {\n severity: SpxSeverityEnum.success,\n type: SpxFormButtonTypeEnum.submit,\n label: () => this.textSelect,\n }\n ],\n sections: [\n {\n key: spxSectionWelcome,\n showTitle: () => false,\n fields: [\n {\n key: spxCtrlChannel,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textCompany,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlChannelType,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textChannel,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlChannel().value),\n validators: () => [spxValidatorRequired()],\n },\n ]\n }\n ]\n });\n\n constructor(\n private readonly store: Store,\n private readonly formBuilder: FormBuilder\n ) {\n this.formGroup.set(this.formBuilder.group({\n [spxSectionWelcome]: SpxFormViewComponent.createForm(this.form())\n }));\n }\n\n ngOnDestroy(): void {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n ngOnInit(): void {\n this.suggestions()[spxCtrlChannel] = this.allBrands();\n\n this.subscriptions.channel = this.ctrlChannel().valueChanges.subscribe(valuePair => {\n this.inputBrand.set(valuePairToValue(valuePair));\n this.suggestions()[spxCtrlChannelType] = this.channelTypeSuggestions();\n this.ctrlChannelType().setValue({\n value: SpxAppChannelTypeEnum.production,\n });\n });\n\n this.subscriptions.channelType = this.ctrlChannelType().valueChanges.subscribe(valuePair => {\n this.inputChannelType.set(valuePairToValue(this.ctrlChannelType().value));\n });\n }\n\n protected onSubmit(): void {\n if (!this.selectedBrand() || !this.inputChannelType()) {\n this.store.dispatch(spxToasterActions.createWarning({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: 'Please select a company',\n }))\n } else {\n this.store.dispatch(spxChannelActions.choose({\n channel: this.selectedBrand()!,\n channelType: this.inputChannelType()!,\n }));\n }\n }\n}\n","<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ textSelectYourCompany | translate | capitalize }}\n </ion-title>\n <ion-buttons slot=\"end\">\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content class=\"ion-padding\">\n <form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxForm]=\"form()\"\n [spxFormGroup]=\"formSection()\"\n [spxSuggestions]=\"suggestions()\">\n </spx-form-view>\n </form>\n</ion-content>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAkBO,MAAM,iBAAiB,GAAG;AAC1B,MAAM,cAAc,GAAG;AACvB,MAAM,kBAAkB,GAAG;MAoBrB,mBAAmB,CAAA;IAiE9B,WACmB,CAAA,KAAY,EACZ,WAAwB,EAAA;QADxB,IAAK,CAAA,KAAA,GAAL,KAAK;QACL,IAAW,CAAA,WAAA,GAAX,WAAW;AAlE9B,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;AACnF,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAA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A,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAQ,iFACR,UAAU,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACV,UAAU,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,oBAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,cAAA,EAAA,SAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EACV,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKJ,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAlB/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAEd,OAAA,EAAA;wBACP,WAAW;wBACX,mBAAmB;wBACnB,iBAAiB;wBACjB,oBAAoB;wBACpB,SAAS;wBACT,UAAU;wBACV,QAAQ;wBACR,UAAU;wBACV,UAAU;wBACV,aAAa;AACd,qBAAA,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,4hBAAA,EAAA;;;AEtClB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-welcome.mjs","sources":["../../../../projects/softpak/components/spx-welcome/spx-welcome.component.ts","../../../../projects/softpak/components/spx-welcome/spx-welcome.component.html","../../../../projects/softpak/components/spx-welcome/softpak-components-spx-welcome.ts"],"sourcesContent":["import { Component, OnInit, OnDestroy, signal, computed, ChangeDetectionStrategy } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Store } from '@ngrx/store';\nimport { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { SpxFormButtonTypeEnum, SpxFormI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\nimport { SpxSeverityEnum, unsubscribeSubscriptions, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxInputTypeEnum, SpxValuePair } from '@softpak/components/spx-inputs';\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { Subscription } from 'rxjs';\nimport { spxTextChannel, spxTextCompany, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';\nimport { IonHeader, IonToolbar, IonTitle, IonButtons, IonContent } from '@ionic/angular/standalone';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\nimport { spxChannelReducer, spxChannelActions } from '@softpak/components/spx-channel-selection';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { Capacitor } from '@capacitor/core';\n\nexport const spxSectionWelcome = 'welcome';\nexport const spxCtrlChannel = 'channel';\nexport const spxCtrlChannelType = 'channelType';\n\n@Component({\n selector: 'spx-welcome',\n templateUrl: './spx-welcome.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxCapitalizePipe,\n SpxFormViewComponent,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonButtons,\n IonContent,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxWelcomeComponent implements OnInit, OnDestroy {\n allChannels = toSignal(this.store.select(spxChannelReducer.default.selectChannels));\n allBrands = computed(() => this.allChannels()?.filter(channel => channel.channelTypes.map(type => type.name).includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand })));\n inputBrand = signal<string | null>(null);\n inputChannelType = signal<SpxAppChannelTypeEnum | null>(null);\n selectedBrand = computed(() => this.allChannels()?.find(c => c.brand === this.inputBrand()));\n channelTypeSuggestions = computed(() => this.selectedBrand()?.channelTypes?.filter(channelType => Capacitor.getPlatform() === 'web' ? channelType.webUrl !== undefined : channelType.webUrl === undefined)?.map(channelType => ({\n description: channelType.name,\n value: channelType.name\n })));\n\n protected readonly formGroup = signal<FormGroup | undefined>(undefined);\n protected readonly suggestions = signal<{\n [spxCtrlChannelType]?: SpxValuePair<string>[];\n [spxCtrlChannel]?: SpxValuePair<string>[];\n }>({\n [spxCtrlChannelType]: [],\n [spxCtrlChannel]: [],\n });\n\n textChannel = spxTextChannel;\n textCompany = spxTextCompany;\n textSelect = spxTextSelect;\n textSelectYourCompany = spxTextSelectYourCompany;\n\n protected readonly formSection = computed(() => this.formGroup()?.get(spxSectionWelcome) as FormGroup);\n private readonly ctrlChannel = computed(() => this.formSection()?.get(spxCtrlChannel) as FormControl);\n private readonly ctrlChannelType = computed(() => this.formSection()?.get(spxCtrlChannelType) as FormControl);\n private subscriptions: {\n channel?: Subscription;\n channelType?: Subscription;\n } = {};\n\n protected readonly form = signal<SpxFormI>({\n buttons: [\n {\n severity: SpxSeverityEnum.success,\n type: SpxFormButtonTypeEnum.submit,\n label: () => this.textSelect,\n }\n ],\n sections: [\n {\n key: spxSectionWelcome,\n showTitle: () => false,\n fields: [\n {\n key: spxCtrlChannel,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textCompany,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlChannelType,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textChannel,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlChannel().value),\n validators: () => [spxValidatorRequired()],\n },\n ]\n }\n ]\n });\n\n constructor(\n private readonly store: Store,\n private readonly formBuilder: FormBuilder\n ) {\n this.formGroup.set(this.formBuilder.group({\n [spxSectionWelcome]: SpxFormViewComponent.createForm(this.form())\n }));\n }\n\n ngOnDestroy(): void {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n ngOnInit(): void {\n this.suggestions()[spxCtrlChannel] = this.allBrands();\n\n this.subscriptions.channel = this.ctrlChannel().valueChanges.subscribe(valuePair => {\n this.inputBrand.set(valuePairToValue(valuePair));\n this.suggestions()[spxCtrlChannelType] = this.channelTypeSuggestions();\n this.ctrlChannelType().setValue({\n value: SpxAppChannelTypeEnum.production,\n });\n });\n\n this.subscriptions.channelType = this.ctrlChannelType().valueChanges.subscribe(valuePair => {\n this.inputChannelType.set(valuePairToValue(this.ctrlChannelType().value));\n });\n }\n\n protected onSubmit(): void {\n if (!this.selectedBrand() || !this.inputChannelType()) {\n this.store.dispatch(spxToasterActions.createWarning({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: 'Please select a company',\n }))\n } else {\n this.store.dispatch(spxChannelActions.choose({\n channel: this.selectedBrand()!,\n channelType: this.inputChannelType()!,\n }));\n }\n }\n}\n","<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ textSelectYourCompany | translate | capitalize }}\n </ion-title>\n <ion-buttons slot=\"end\">\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content class=\"ion-padding\">\n <form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxForm]=\"form()\"\n [spxFormGroup]=\"formSection()\"\n [spxSuggestions]=\"suggestions()\">\n </spx-form-view>\n </form>\n</ion-content>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAkBO,MAAM,iBAAiB,GAAG;AAC1B,MAAM,cAAc,GAAG;AACvB,MAAM,kBAAkB,GAAG;MAoBrB,mBAAmB,CAAA;IAiE9B,WAAA,CACmB,KAAY,EACZ,WAAwB,EAAA;QADxB,IAAA,CAAA,KAAK,GAAL,KAAK;QACL,IAAA,CAAA,WAAW,GAAX,WAAW;AAlE9B,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,iBAA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