@softpak/components 19.0.0-beta.1 → 19.0.0-beta.10
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/esm2022/placeholder.mjs +2 -0
- package/esm2022/public_api.mjs +2 -0
- package/esm2022/softpak-components.mjs +5 -0
- package/esm2022/spx-alert/public-api.mjs +3 -0
- package/esm2022/spx-alert/softpak-components-spx-alert.mjs +5 -0
- package/esm2022/spx-alert/spx-alert.component.mjs +203 -0
- package/esm2022/spx-alert/spx-alert.interface.mjs +3 -0
- package/esm2022/spx-app-configuration/public-api.mjs +8 -0
- package/esm2022/spx-app-configuration/softpak-components-spx-app-configuration.mjs +5 -0
- package/esm2022/spx-app-configuration/spx-app-alert.interface.mjs +2 -0
- package/esm2022/spx-app-configuration/spx-app-bundle-set.interface.mjs +2 -0
- package/esm2022/spx-app-configuration/spx-app-channel-type.enum.mjs +8 -0
- package/esm2022/spx-app-configuration/spx-app-channel.interface.mjs +2 -0
- package/esm2022/spx-app-configuration/spx-app-config.interface.mjs +2 -0
- package/esm2022/spx-app-configuration/spx-app-id.enum.mjs +8 -0
- package/esm2022/spx-app-configuration/spx-app-lang.enum.mjs +6 -0
- package/esm2022/spx-app-configuration/spx-app-release-note.interface.mjs +2 -0
- package/esm2022/spx-app-expiry/public-api.mjs +6 -0
- package/esm2022/spx-app-expiry/softpak-components-spx-app-expiry.mjs +5 -0
- package/esm2022/spx-app-expiry/spx-app-expiry.component.mjs +107 -0
- package/esm2022/spx-app-expiry/spx-app-expiry.interface.mjs +2 -0
- package/esm2022/spx-app-expiry/spx-check-expiry-final-warning.interface.mjs +5 -0
- package/esm2022/spx-app-expiry/spx-check-expiry-happened.interface.mjs +5 -0
- package/esm2022/spx-app-expiry/spx-check-expiry-warning.interface.mjs +5 -0
- package/esm2022/spx-app-update/public-api.mjs +2 -0
- package/esm2022/spx-app-update/softpak-components-spx-app-update.mjs +5 -0
- package/esm2022/spx-app-update/spx-app-update.component.mjs +323 -0
- package/esm2022/spx-button/public-api.mjs +2 -0
- package/esm2022/spx-button/softpak-components-spx-button.mjs +5 -0
- package/esm2022/spx-button/spx-button.component.mjs +142 -0
- package/esm2022/spx-capitalize/public-api.mjs +2 -0
- package/esm2022/spx-capitalize/softpak-components-spx-capitalize.mjs +5 -0
- package/esm2022/spx-capitalize/spx-capitalize.pipe.mjs +20 -0
- package/esm2022/spx-card/public-api.mjs +5 -0
- package/esm2022/spx-card/softpak-components-spx-card.mjs +5 -0
- package/esm2022/spx-card/spx-card-grid.component.mjs +46 -0
- package/esm2022/spx-card/spx-card-item.component.mjs +117 -0
- package/esm2022/spx-card/spx-card-line.component.mjs +124 -0
- package/esm2022/spx-card/spx-card.component.mjs +96 -0
- package/esm2022/spx-change-details/public-api.mjs +2 -0
- package/esm2022/spx-change-details/softpak-components-spx-change-details.mjs +5 -0
- package/esm2022/spx-change-details/spx-change-details-value.interface.mjs +2 -0
- package/esm2022/spx-change-details/spx-change-details.component.mjs +197 -0
- package/esm2022/spx-channel-selection/public-api.mjs +3 -0
- package/esm2022/spx-channel-selection/softpak-components-spx-channel-selection.mjs +5 -0
- package/esm2022/spx-channel-selection/src/spx-channel-indicator.component.mjs +45 -0
- package/esm2022/spx-channel-selection/src/spx-welcome.component.mjs +132 -0
- package/esm2022/spx-check-digit/public-api.mjs +2 -0
- package/esm2022/spx-check-digit/softpak-components-spx-check-digit.mjs +5 -0
- package/esm2022/spx-check-digit/spx-check-digit.component.mjs +91 -0
- package/esm2022/spx-form-section/public-api.mjs +2 -0
- package/esm2022/spx-form-section/softpak-components-spx-form-section.mjs +5 -0
- package/esm2022/spx-form-section/spx-form-section.component.mjs +42 -0
- package/esm2022/spx-form-view/public-api.mjs +7 -0
- package/esm2022/spx-form-view/softpak-components-spx-form-view.mjs +5 -0
- package/esm2022/spx-form-view/spx-autocomplete-search.component.mjs +117 -0
- package/esm2022/spx-form-view/spx-form-button-type.enum.mjs +6 -0
- package/esm2022/spx-form-view/spx-form-button.interface.mjs +2 -0
- package/esm2022/spx-form-view/spx-form-field.interface.mjs +2 -0
- package/esm2022/spx-form-view/spx-form-section.interface.mjs +2 -0
- package/esm2022/spx-form-view/spx-form-view.component.mjs +297 -0
- package/esm2022/spx-form-view/spx-form.interface.mjs +2 -0
- package/esm2022/spx-helpers/calc-check-digit.function.mjs +21 -0
- package/esm2022/spx-helpers/public-api.mjs +4 -0
- package/esm2022/spx-helpers/softpak-components-spx-helpers.mjs +5 -0
- package/esm2022/spx-helpers/spx-severity.enum.mjs +10 -0
- package/esm2022/spx-helpers/value-pair-to-value.function.mjs +7 -0
- package/esm2022/spx-inputs/public-api.mjs +6 -0
- package/esm2022/spx-inputs/softpak-components-spx-inputs.mjs +5 -0
- package/esm2022/spx-inputs/spx-dropdown.component.mjs +93 -0
- package/esm2022/spx-inputs/spx-input-box.component.mjs +273 -0
- package/esm2022/spx-inputs/spx-input-date/spx-input-date.component.mjs +194 -0
- package/esm2022/spx-inputs/spx-input-float.component.mjs +157 -0
- package/esm2022/spx-inputs/spx-input-number.component.mjs +87 -0
- package/esm2022/spx-inputs/spx-input-radio.component.mjs +129 -0
- package/esm2022/spx-inputs/spx-input-text.component.mjs +160 -0
- package/esm2022/spx-inputs/spx-input-time-modal.component.mjs +131 -0
- package/esm2022/spx-inputs/spx-input-time.component.mjs +156 -0
- package/esm2022/spx-inputs/spx-input-type.enum.mjs +17 -0
- package/esm2022/spx-inputs/spx-input.component.mjs +461 -0
- package/esm2022/spx-inputs/spx-value-interface.mjs +2 -0
- package/esm2022/spx-navigation/public-api.mjs +5 -0
- package/esm2022/spx-navigation/softpak-components-spx-navigation.mjs +5 -0
- package/esm2022/spx-navigation/spx-home-tile.component.mjs +71 -0
- package/esm2022/spx-navigation/spx-home-tiles.component.mjs +24 -0
- package/esm2022/spx-navigation/spx-navigation-item.interface.mjs +2 -0
- package/esm2022/spx-navigation/spx-navigation.component.mjs +47 -0
- package/esm2022/spx-number-check/public-api.mjs +2 -0
- package/esm2022/spx-number-check/softpak-components-spx-number-check.mjs +5 -0
- package/esm2022/spx-number-check/spx-number-check.component.mjs +265 -0
- package/esm2022/spx-pagination/public-api.mjs +2 -0
- package/esm2022/spx-pagination/softpak-components-spx-pagination.mjs +5 -0
- package/esm2022/spx-pagination/spx-pagination.component.mjs +44 -0
- package/esm2022/spx-patch/patch-check.function.mjs +9 -0
- package/esm2022/spx-patch/public-api.mjs +4 -0
- package/esm2022/spx-patch/release-check.function.mjs +14 -0
- package/esm2022/spx-patch/softpak-components-spx-patch.mjs +5 -0
- package/esm2022/spx-patch/spx-patch.component.mjs +54 -0
- package/esm2022/spx-progress-bar/public-api.mjs +2 -0
- package/esm2022/spx-progress-bar/softpak-components-spx-progress-bar.mjs +5 -0
- package/esm2022/spx-progress-bar/spx-progress-bar.component.mjs +29 -0
- package/esm2022/spx-spinner/public-api.mjs +2 -0
- package/esm2022/spx-spinner/softpak-components-spx-spinner.mjs +5 -0
- package/esm2022/spx-spinner/spx-spinner.component.mjs +160 -0
- package/esm2022/spx-stock-info/public-api.mjs +3 -0
- package/esm2022/spx-stock-info/softpak-components-spx-stock-info.mjs +5 -0
- package/esm2022/spx-stock-info/spx-stock-info-value.interface.mjs +2 -0
- package/esm2022/spx-stock-info/spx-stock-info.component.mjs +324 -0
- package/esm2022/spx-storage/public-api.mjs +3 -0
- package/esm2022/spx-storage/softpak-components-spx-storage.mjs +5 -0
- package/esm2022/spx-storage/src/spx-storage-key.enum.mjs +13 -0
- package/esm2022/spx-storage/src/spx-storage.class.mjs +45 -0
- package/esm2022/spx-suggestion/public-api.mjs +2 -0
- package/esm2022/spx-suggestion/softpak-components-spx-suggestion.mjs +5 -0
- package/esm2022/spx-suggestion/spx-suggestion.component.mjs +61 -0
- package/esm2022/spx-toaster/public-api.mjs +4 -0
- package/esm2022/spx-toaster/softpak-components-spx-toaster.mjs +5 -0
- package/esm2022/spx-toaster/src/spx-toaster-autoclose-speed.mjs +23 -0
- package/esm2022/spx-toaster/src/spx-toaster-message.interface.mjs +3 -0
- package/esm2022/spx-toaster/src/spx-toaster.component.mjs +168 -0
- package/esm2022/spx-update/public-api.mjs +3 -0
- package/esm2022/spx-update/softpak-components-spx-update.mjs +5 -0
- package/esm2022/spx-update/src/spx-update-info.component.mjs +86 -0
- package/esm2022/spx-update/src/spx-update-progress.component.mjs +46 -0
- package/esm2022/spx-validation/max.validator.mjs +17 -0
- package/esm2022/spx-validation/maxlength.validator.mjs +20 -0
- package/esm2022/spx-validation/min.validator.mjs +17 -0
- package/esm2022/spx-validation/minlength.validator.mjs +20 -0
- package/esm2022/spx-validation/pattern.validator.mjs +12 -0
- package/esm2022/spx-validation/public-api.mjs +9 -0
- package/esm2022/spx-validation/required.validator.mjs +12 -0
- package/esm2022/spx-validation/softpak-components-spx-validation.mjs +5 -0
- package/esm2022/spx-validation/spx-validate-control.component.mjs +65 -0
- package/esm2022/spx-validation/year-and-month.validator.mjs +42 -0
- package/fesm2022/softpak-components-spx-alert.mjs +56 -45
- 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 +59 -41
- package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-app-update.mjs +74 -68
- package/fesm2022/softpak-components-spx-app-update.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-button.mjs +5 -4
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-capitalize.mjs +3 -3
- package/fesm2022/softpak-components-spx-capitalize.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-card.mjs +163 -127
- package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-change-details.mjs +5 -7
- package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-channel-selection.mjs +11 -12
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs +6 -9
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-section.mjs +20 -15
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +147 -139
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-helpers.mjs +1 -0
- package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-inputs.mjs +817 -862
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +53 -52
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-number-check.mjs +49 -42
- package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pagination.mjs +4 -4
- package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-patch.mjs +29 -22
- package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-progress-bar.mjs +3 -3
- package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-spinner.mjs +144 -143
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-stock-info.mjs +8 -11
- 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 +41 -49
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +94 -98
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-update.mjs +11 -11
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-validation.mjs +5 -8
- package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
- package/package.json +76 -23
- package/spx-app-update/spx-app-update.component.d.ts +3 -3
- package/spx-helpers/spx-severity.enum.d.ts +2 -1
- package/spx-inputs/spx-input-date/spx-input-date.component.d.ts +43 -0
- package/spx-inputs/spx-input-float.component.d.ts +5 -4
- package/spx-inputs/spx-input-text.component.d.ts +2 -1
- package/spx-inputs/spx-input-time.component.d.ts +1 -1
- package/spx-inputs/spx-input.component.d.ts +2 -1
- package/spx-suggestion/spx-suggestion.component.d.ts +5 -5
- package/tailwind.css +1 -1
- package/spx-inputs/spx-input-date.component.d.ts +0 -50
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { EventEmitter, Component, HostBinding, Input, Output } from '@angular/core';
|
|
3
3
|
import { SpxAlertComponent } from '@softpak/components/spx-alert';
|
|
4
|
-
import { NgIf, NgFor } from '@angular/common';
|
|
5
4
|
|
|
6
5
|
var SpxToasterSeverityEnum;
|
|
7
6
|
(function (SpxToasterSeverityEnum) {
|
|
@@ -74,113 +73,110 @@ class SpxToasterComponent {
|
|
|
74
73
|
return autoCloseSpeed;
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
78
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SpxToasterComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
77
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SpxToasterComponent, isStandalone: true, selector: "spx-toaster", inputs: { messages: "messages", spxAutoclose: "spxAutoclose" }, outputs: { spxClose: "spxClose" }, host: { properties: { "class.spx-toasts-displayer": "this.hostClass" } }, usesOnChanges: true, ngImport: i0, template: `
|
|
78
|
+
@if (messages && messages.length > 0) {
|
|
79
|
+
<div
|
|
81
80
|
class="flex flex-col gap-2 fixed bottom-16 left-0 right-0 mx-auto px-3 z-50">
|
|
82
81
|
<style>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
</div>`, isInline: true, styles: [".progress-bar-container{width:100%;height:5px;background-color:#ccc;margin-top:8px;border-radius:2px;overflow:hidden}.progress-bar{height:100%;background-color:#76c7c0;animation-name:progress;animation-timing-function:ease-in-out;animation-fill-mode:forwards;animation-duration:5000}@keyframes progress{0%{width:0%}to{width:100%}}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxAlertComponent, selector: "spx-alert", inputs: ["spxAutoclose", "spxCloseable", "spxHideTitle", "spxTitle", "spxMarginTop", "spxSeverity", "tick"], outputs: ["spxClose"] }] }); }
|
|
82
|
+
.progress-bar-container {
|
|
83
|
+
width: 100%;
|
|
84
|
+
height: 5px;
|
|
85
|
+
background-color: #ccc;
|
|
86
|
+
margin-top: 8px;
|
|
87
|
+
border-radius: 2px;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
}
|
|
90
|
+
.progress-bar {
|
|
91
|
+
height: 100%;
|
|
92
|
+
background-color: #76c7c0;
|
|
93
|
+
animation-name: progress;
|
|
94
|
+
animation-timing-function: ease-in-out;
|
|
95
|
+
animation-fill-mode: forwards;
|
|
96
|
+
animation-duration: 5000;
|
|
97
|
+
}
|
|
98
|
+
@keyframes progress {
|
|
99
|
+
from {
|
|
100
|
+
width: 0%;
|
|
101
|
+
}
|
|
102
|
+
to {
|
|
103
|
+
width: 100%;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
</style>
|
|
107
|
+
@for (message of messages; track message) {
|
|
108
|
+
<spx-alert
|
|
109
|
+
[spxAutoclose]="message.autoClose"
|
|
110
|
+
[spxCloseable]="message.closeable"
|
|
111
|
+
[spxSeverity]="message.severity"
|
|
112
|
+
[spxTitle]="message.title"
|
|
113
|
+
(spxClose)="handleClose(message.id)"
|
|
114
|
+
(click)="handleClose(message.id)"
|
|
115
|
+
[id]="message.id"
|
|
116
|
+
>{{message.message}}
|
|
117
|
+
<!-- <div *ngIf="message.autoClose" class="progress-bar-container">
|
|
118
|
+
<div class="progress-bar"></div>
|
|
119
|
+
</div> -->
|
|
120
|
+
</spx-alert>
|
|
121
|
+
}
|
|
122
|
+
</div>
|
|
123
|
+
}`, isInline: true, styles: ["\n .progress-bar-container {\n width: 100%;\n height: 5px;\n background-color: #ccc;\n margin-top: 8px;\n border-radius: 2px;\n overflow: hidden;\n }\n .progress-bar {\n height: 100%;\n background-color: #76c7c0;\n animation-name: progress;\n animation-timing-function: ease-in-out;\n animation-fill-mode: forwards;\n animation-duration: 5000;\n }\n @keyframes progress {\n from {\n width: 0%;\n }\n to {\n width: 100%;\n }\n }\n "], dependencies: [{ kind: "component", type: SpxAlertComponent, selector: "spx-alert", inputs: ["spxAutoclose", "spxCloseable", "spxHideTitle", "spxTitle", "spxMarginTop", "spxSeverity", "tick"], outputs: ["spxClose"] }] }); }
|
|
126
124
|
}
|
|
127
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SpxToasterComponent, decorators: [{
|
|
128
126
|
type: Component,
|
|
129
127
|
args: [{
|
|
130
128
|
selector: 'spx-toaster',
|
|
131
129
|
template: `
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
@if (messages && messages.length > 0) {
|
|
131
|
+
<div
|
|
134
132
|
class="flex flex-col gap-2 fixed bottom-16 left-0 right-0 mx-auto px-3 z-50">
|
|
135
133
|
<style>
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
134
|
+
.progress-bar-container {
|
|
135
|
+
width: 100%;
|
|
136
|
+
height: 5px;
|
|
137
|
+
background-color: #ccc;
|
|
138
|
+
margin-top: 8px;
|
|
139
|
+
border-radius: 2px;
|
|
140
|
+
overflow: hidden;
|
|
141
|
+
}
|
|
142
|
+
.progress-bar {
|
|
143
|
+
height: 100%;
|
|
144
|
+
background-color: #76c7c0;
|
|
145
|
+
animation-name: progress;
|
|
146
|
+
animation-timing-function: ease-in-out;
|
|
147
|
+
animation-fill-mode: forwards;
|
|
148
|
+
animation-duration: 5000;
|
|
149
|
+
}
|
|
150
|
+
@keyframes progress {
|
|
151
|
+
from {
|
|
152
|
+
width: 0%;
|
|
153
|
+
}
|
|
154
|
+
to {
|
|
155
|
+
width: 100%;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
</style>
|
|
159
|
+
@for (message of messages; track message) {
|
|
160
|
+
<spx-alert
|
|
161
|
+
[spxAutoclose]="message.autoClose"
|
|
162
|
+
[spxCloseable]="message.closeable"
|
|
163
|
+
[spxSeverity]="message.severity"
|
|
164
|
+
[spxTitle]="message.title"
|
|
165
|
+
(spxClose)="handleClose(message.id)"
|
|
166
|
+
(click)="handleClose(message.id)"
|
|
167
|
+
[id]="message.id"
|
|
168
|
+
>{{message.message}}
|
|
169
|
+
<!-- <div *ngIf="message.autoClose" class="progress-bar-container">
|
|
170
|
+
<div class="progress-bar"></div>
|
|
171
|
+
</div> -->
|
|
172
|
+
</spx-alert>
|
|
173
|
+
}
|
|
174
|
+
</div>
|
|
175
|
+
}`,
|
|
176
|
+
standalone: true,
|
|
179
177
|
imports: [
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
SpxAlertComponent,
|
|
183
|
-
]
|
|
178
|
+
SpxAlertComponent
|
|
179
|
+
],
|
|
184
180
|
}]
|
|
185
181
|
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { hostClass: [{
|
|
186
182
|
type: HostBinding,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-toaster.mjs","sources":["../../../../projects/softpak/components/spx-toaster/src/spx-toaster-autoclose-speed.ts","../../../../projects/softpak/components/spx-toaster/src/spx-toaster.component.ts","../../../../projects/softpak/components/spx-toaster/src/spx-toaster-message.interface.ts","../../../../projects/softpak/components/spx-toaster/softpak-components-spx-toaster.ts"],"sourcesContent":["export enum SpxToasterSeverityEnum {\n ERROR = 'error',\n INFO = 'info',\n SUCCESS = 'success',\n WARNING = 'warning',\n}\n\nexport enum SpxToasterAutoCloseSpeedEnum {\n DEFAULT = -1,\n SLOW = -2,\n}\n\nexport function toasterAutocloseSpeed(autoCloseSpeed: SpxToasterAutoCloseSpeedEnum, messageText: string) {\n switch (autoCloseSpeed) {\n case SpxToasterAutoCloseSpeedEnum.DEFAULT:\n return Math.min(Math.max(messageText.length * 50, 2000), 7000);\n case SpxToasterAutoCloseSpeedEnum.SLOW:\n return Math.min(Math.max(messageText.length * 60, 3000), 10000);\n default:\n return autoCloseSpeed;\n }\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n OnInit,\n Output,\n Renderer2\n} from '@angular/core';\nimport { SpxToasterMessageI } from './spx-toaster-message.interface';\nimport { SpxAlertComponent } from '@softpak/components/spx-alert';\nimport {
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-toaster.mjs","sources":["../../../../projects/softpak/components/spx-toaster/src/spx-toaster-autoclose-speed.ts","../../../../projects/softpak/components/spx-toaster/src/spx-toaster.component.ts","../../../../projects/softpak/components/spx-toaster/src/spx-toaster-message.interface.ts","../../../../projects/softpak/components/spx-toaster/softpak-components-spx-toaster.ts"],"sourcesContent":["export enum SpxToasterSeverityEnum {\n ERROR = 'error',\n INFO = 'info',\n SUCCESS = 'success',\n WARNING = 'warning',\n}\n\nexport enum SpxToasterAutoCloseSpeedEnum {\n DEFAULT = -1,\n SLOW = -2,\n}\n\nexport function toasterAutocloseSpeed(autoCloseSpeed: SpxToasterAutoCloseSpeedEnum, messageText: string) {\n switch (autoCloseSpeed) {\n case SpxToasterAutoCloseSpeedEnum.DEFAULT:\n return Math.min(Math.max(messageText.length * 50, 2000), 7000);\n case SpxToasterAutoCloseSpeedEnum.SLOW:\n return Math.min(Math.max(messageText.length * 60, 3000), 10000);\n default:\n return autoCloseSpeed;\n }\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n OnInit,\n Output,\n Renderer2\n} from '@angular/core';\nimport { SpxToasterMessageI } from './spx-toaster-message.interface';\nimport { SpxAlertComponent } from '@softpak/components/spx-alert';\n\nimport { SpxToasterAutoCloseSpeedEnum } from './spx-toaster-autoclose-speed';\n\n@Component({\n selector: 'spx-toaster',\n template: `\n @if (messages && messages.length > 0) {\n <div\n class=\"flex flex-col gap-2 fixed bottom-16 left-0 right-0 mx-auto px-3 z-50\">\n <style>\n .progress-bar-container {\n width: 100%;\n height: 5px;\n background-color: #ccc;\n margin-top: 8px;\n border-radius: 2px;\n overflow: hidden;\n }\n .progress-bar {\n height: 100%;\n background-color: #76c7c0;\n animation-name: progress;\n animation-timing-function: ease-in-out;\n animation-fill-mode: forwards;\n animation-duration: 5000;\n }\n @keyframes progress {\n from {\n width: 0%;\n }\n to {\n width: 100%;\n }\n }\n </style>\n @for (message of messages; track message) {\n <spx-alert\n [spxAutoclose]=\"message.autoClose\"\n [spxCloseable]=\"message.closeable\"\n [spxSeverity]=\"message.severity\"\n [spxTitle]=\"message.title\"\n (spxClose)=\"handleClose(message.id)\"\n (click)=\"handleClose(message.id)\"\n [id]=\"message.id\"\n >{{message.message}}\n <!-- <div *ngIf=\"message.autoClose\" class=\"progress-bar-container\">\n <div class=\"progress-bar\"></div>\n </div> -->\n </spx-alert>\n }\n </div>\n }`,\n standalone: true,\n imports: [\n SpxAlertComponent\n],\n})\nexport class SpxToasterComponent implements OnChanges {\n @HostBinding('class.spx-toasts-displayer') hostClass = true;\n @Input() messages!: SpxToasterMessageI[];\n @Output() spxClose: EventEmitter<number> = new EventEmitter<number>();\n @Input() spxAutoclose: number | undefined;\n count: number = 0;\n constructor(private renderer: Renderer2, private el: ElementRef) { \n\n }\n\n\n ngOnChanges() {\n this.messages = this.messages.map(m => ({ ...m, autoClose: this.calcToasterAutocloseSpeed(m.autoClose, m.message) }));\n if (this.messages.length > 0) {\n setTimeout(() => {\n this.messages = this.messages.map(message => {\n if (message.autoClose) {\n // console.log(message.autoClose);\n // this.showProgressBar(message.autoClose, message.id)\n // this.showProgressBar(600000, message.id)\n setTimeout(() => {\n this.handleClose(message.id)\n }, message.autoClose);\n }\n return message;\n });\n }, 0);\n }\n }\n \n\n showProgressBar(autoclose: number, id: number) {\n const alertElement = this.el.nativeElement.querySelector(`spx-alert[id=\"${id}\"]`);\n console.log(alertElement);\n if (alertElement) {\n \n } else {\n console.error(`spx-alert element with ID ${id} not found.`);\n }\n }\n \n\n public handleClose(id: number) {\n this.spxClose.emit(id);\n }\n\n private calcToasterAutocloseSpeed(autoCloseSpeed: SpxToasterAutoCloseSpeedEnum, messageText: string): number {\n switch (autoCloseSpeed) {\n case SpxToasterAutoCloseSpeedEnum.DEFAULT:\n return Math.min(Math.max(messageText.length * 50, 2000), 7000);\n case SpxToasterAutoCloseSpeedEnum.SLOW:\n return Math.min(Math.max(messageText.length * 60, 3000), 10000);\n default:\n return autoCloseSpeed;\n }\n }\n}\n","import { SpxSeverityEnum } from \"@softpak/components/spx-helpers\";\n\nexport class SpxToasterMessageI {\n autoClose?: any;\n title?: string;\n closeable?: boolean;\n id!: number;\n message!: string;\n severity!: SpxSeverityEnum;\n uniqueIdentifier?: string;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;IAAY,uBAKX;AALD,CAAA,UAAY,sBAAsB,EAAA;AAC9B,IAAA,sBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,sBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,sBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,sBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACvB,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,GAKjC,EAAA,CAAA,CAAA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EAAA,cAAA,EAAA,aAAA,EAAA,MAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAGR,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAtD/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CR,KAAA,CAAA;AACF,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE;wBACT,iBAAiB;AACpB,qBAAA;AACA,iBAAA,CAAA;uGAE8C,SAAS,EAAA,CAAA;sBAAnD,WAAW;uBAAC,4BAA4B,CAAA;gBAChC,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBACI,QAAQ,EAAA,CAAA;sBAAjB,MAAM;gBACE,YAAY,EAAA,CAAA;sBAApB,KAAK;;;MCzEG,kBAAkB,CAAA;AAQ9B;;ACVD;;AAEG;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
2
|
import { Component, Input } from '@angular/core';
|
|
4
3
|
import * as i1 from '@angular/forms';
|
|
@@ -39,8 +38,8 @@ class SpxUpdateInfoComponent {
|
|
|
39
38
|
value: appStoreVersion,
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
43
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SpxUpdateInfoComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
42
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SpxUpdateInfoComponent, isStandalone: true, selector: "spx-update-info", inputs: { txtAppStoreVersion: "txtAppStoreVersion", txtChannel: "txtChannel", txtNextVersion: "txtNextVersion", txtVersion: "txtVersion" }, ngImport: i0, template: `<form [formGroup]="form" class="mt-3">
|
|
44
43
|
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3">
|
|
45
44
|
<spx-input [formControl]="ctrlVersionNumber" [spxLabel]="txtVersion | capitalize"
|
|
46
45
|
[spxReadonly]="true"></spx-input>
|
|
@@ -51,9 +50,9 @@ class SpxUpdateInfoComponent {
|
|
|
51
50
|
<spx-input [formControl]="ctrlAppStoreVersion" [spxLabel]="txtAppStoreVersion | capitalize"
|
|
52
51
|
[spxReadonly]="true"></spx-input>
|
|
53
52
|
</div>
|
|
54
|
-
</form>`, isInline: true, dependencies: [{ kind: "ngmodule", type:
|
|
53
|
+
</form>`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "value", "spxCapitalize", "spxFocused"], outputs: ["spxBlur", "spxClear", "spxChange", "spxFocus", "spxEdit", "spxHelp", "spxSearch"] }] }); }
|
|
55
54
|
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SpxUpdateInfoComponent, decorators: [{
|
|
57
56
|
type: Component,
|
|
58
57
|
args: [{
|
|
59
58
|
selector: 'spx-update-info',
|
|
@@ -69,12 +68,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
69
68
|
[spxReadonly]="true"></spx-input>
|
|
70
69
|
</div>
|
|
71
70
|
</form>`,
|
|
71
|
+
standalone: true,
|
|
72
72
|
imports: [
|
|
73
|
-
CommonModule,
|
|
74
73
|
FormsModule,
|
|
75
74
|
ReactiveFormsModule,
|
|
76
75
|
SpxCapitalizePipe,
|
|
77
|
-
SpxInputComponent
|
|
76
|
+
SpxInputComponent
|
|
78
77
|
]
|
|
79
78
|
}]
|
|
80
79
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { txtAppStoreVersion: [{
|
|
@@ -107,20 +106,21 @@ class SpxUpdateProgressComponent {
|
|
|
107
106
|
this.syncTruckInterval = undefined;
|
|
108
107
|
}
|
|
109
108
|
}
|
|
110
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
111
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
109
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SpxUpdateProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
110
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SpxUpdateProgressComponent, isStandalone: true, selector: "spx-update-progress", inputs: { title: "title", percentage: "percentage" }, ngImport: i0, template: `<spx-progress-bar [spxPercentage]="delayedPercentage" [spxTitle]="title | capitalize">
|
|
112
111
|
</spx-progress-bar>`, isInline: true, dependencies: [{ kind: "component", type: SpxProgressBarComponent, selector: "spx-progress-bar", inputs: ["spxPercentage", "spxTitle"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }] }); }
|
|
113
112
|
}
|
|
114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SpxUpdateProgressComponent, decorators: [{
|
|
115
114
|
type: Component,
|
|
116
115
|
args: [{
|
|
117
116
|
selector: 'spx-update-progress',
|
|
118
117
|
template: `<spx-progress-bar [spxPercentage]="delayedPercentage" [spxTitle]="title | capitalize">
|
|
119
118
|
</spx-progress-bar>`,
|
|
119
|
+
standalone: true,
|
|
120
120
|
imports: [
|
|
121
121
|
SpxProgressBarComponent,
|
|
122
122
|
SpxCapitalizePipe,
|
|
123
|
-
]
|
|
123
|
+
],
|
|
124
124
|
}]
|
|
125
125
|
}], propDecorators: { title: [{
|
|
126
126
|
type: Input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-update.mjs","sources":["../../../../projects/softpak/components/spx-update/src/spx-update-info.component.ts","../../../../projects/softpak/components/spx-update/src/spx-update-progress.component.ts","../../../../projects/softpak/components/spx-update/softpak-components-spx-update.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-update.mjs","sources":["../../../../projects/softpak/components/spx-update/src/spx-update-info.component.ts","../../../../projects/softpak/components/spx-update/src/spx-update-progress.component.ts","../../../../projects/softpak/components/spx-update/softpak-components-spx-update.ts"],"sourcesContent":["\nimport { Component, Input } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxInputComponent } from '@softpak/components/spx-inputs';\n\nconst ctrlAppStoreVersion = 'appStoreVersion';\nconst ctrlChannel = 'channel';\nconst ctrlNextVersionNumber = 'nextVersionNumber';\nconst ctrlVersionNumber = 'versionNumber';\n\n@Component({\n selector: 'spx-update-info',\n template: `<form [formGroup]=\"form\" class=\"mt-3\">\n <div class=\"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3\">\n <spx-input [formControl]=\"ctrlVersionNumber\" [spxLabel]=\"txtVersion | capitalize\"\n [spxReadonly]=\"true\"></spx-input>\n <spx-input [formControl]=\"ctrlNextVersionNumber\" [spxLabel]=\"txtNextVersion | capitalize\"\n [spxReadonly]=\"true\"></spx-input>\n <spx-input [formControl]=\"ctrlConfiguredChannel\" [spxLabel]=\"txtChannel | capitalize\"\n [spxReadonly]=\"true\"></spx-input>\n <spx-input [formControl]=\"ctrlAppStoreVersion\" [spxLabel]=\"txtAppStoreVersion | capitalize\"\n [spxReadonly]=\"true\"></spx-input>\n </div>\n </form>`,\n standalone: true,\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxCapitalizePipe,\n SpxInputComponent\n]\n})\nexport class SpxUpdateInfoComponent {\n form!: FormGroup;\n @Input() txtAppStoreVersion!: string;\n @Input() txtChannel!: string;\n @Input() txtNextVersion!: string;\n @Input() txtVersion!: string;\n \n get ctrlVersionNumber(): FormControl { return this.form.get(ctrlVersionNumber) as FormControl; }\n get ctrlNextVersionNumber(): FormControl { return this.form.get(ctrlNextVersionNumber) as FormControl; }\n get ctrlConfiguredChannel(): FormControl { return this.form.get(ctrlChannel) as FormControl; }\n get ctrlAppStoreVersion(): FormControl { return this.form.get(ctrlAppStoreVersion) as FormControl; }\n\n constructor(\n private readonly formBuilder: FormBuilder,\n ) {\n this.form = this.formBuilder.group({\n [ctrlAppStoreVersion]: [null, []],\n [ctrlChannel]: [null, []],\n [ctrlNextVersionNumber]: [null, []],\n [ctrlVersionNumber]: [null, []],\n });\n }\n\n update(appStoreVersion: string, channel: string, nextVersion: string, version: string) {\n this.ctrlVersionNumber.setValue({\n value: version,\n });\n this.ctrlNextVersionNumber.setValue({\n value: nextVersion,\n });\n this.ctrlConfiguredChannel.setValue({\n value: channel,\n });\n this.ctrlAppStoreVersion.setValue({\n value: appStoreVersion,\n });\n }\n}\n","import { Component, Input, OnDestroy, OnInit } from '@angular/core';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxProgressBarComponent } from '@softpak/components/spx-progress-bar';\n\n@Component({\n selector: 'spx-update-progress',\n template: `<spx-progress-bar [spxPercentage]=\"delayedPercentage\" [spxTitle]=\"title | capitalize\">\n </spx-progress-bar>`,\n standalone: true,\n imports: [\n SpxProgressBarComponent,\n SpxCapitalizePipe,\n ],\n})\nexport class SpxUpdateProgressComponent implements OnInit, OnDestroy {\n @Input() title!: string;\n @Input() percentage!: number;\n delayedPercentage!: number;\n syncTruckInterval?: any;\n \n ngOnInit(): void {\n this.startLoaderSync();\n }\n\n ngOnDestroy(): void {\n this.stopLoaderSync();\n }\n\n private startLoaderSync() {\n if (this.syncTruckInterval === null) {\n this.syncTruckInterval = setInterval(() => {\n this.delayedPercentage = this.percentage;\n }, 200);\n }\n }\n\n private stopLoaderSync() {\n if (this.syncTruckInterval !== null) {\n clearInterval(this.syncTruckInterval);\n this.syncTruckInterval = undefined;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAMA,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAC9C,MAAM,WAAW,GAAG,SAAS,CAAC;AAC9B,MAAM,qBAAqB,GAAG,mBAAmB,CAAC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,EAAA,CAAA;sBACU,EAGlB,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,uBAAuB,+FACvB,iBAAiB,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAGR,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAVtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,CAAA;AACU,qBAAA,CAAA;AACpB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE;wBACP,uBAAuB;wBACvB,iBAAiB;AAClB,qBAAA;AACF,iBAAA,CAAA;8BAEU,KAAK,EAAA,CAAA;sBAAb,KAAK;gBACG,UAAU,EAAA,CAAA;sBAAlB,KAAK;;;AChBR;;AAEG;;;;"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { valuePairToValue } from '@softpak/components/spx-helpers';
|
|
2
2
|
import { DateTime } from 'luxon';
|
|
3
|
-
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
3
|
import * as i0 from '@angular/core';
|
|
6
4
|
import { Component, Input } from '@angular/core';
|
|
7
5
|
import { FormsModule } from '@angular/forms';
|
|
@@ -178,15 +176,14 @@ class SpxValidateControlComponent {
|
|
|
178
176
|
get past() {
|
|
179
177
|
return this.control.errors && this.control.errors['past'];
|
|
180
178
|
}
|
|
181
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
182
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
179
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SpxValidateControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
180
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SpxValidateControlComponent, isStandalone: true, selector: "spx-validate-control", inputs: { control: "control", label: "label", submitTried: "submitTried" }, ngImport: i0, template: "@if (control && control.errors && (control.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}", dependencies: [{ kind: "ngmodule", type: FormsModule }] }); }
|
|
183
181
|
}
|
|
184
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SpxValidateControlComponent, decorators: [{
|
|
185
183
|
type: Component,
|
|
186
184
|
args: [{ selector: 'spx-validate-control', imports: [
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
], template: "<ng-container *ngIf=\"control && control.errors && (control.touched || submitTried)\">\n <div *ngIf=\"maxLength\">'{{ label }}' is too long, the maximum length is {{ maxLengthRequiredLength }}.</div>\n <div *ngIf=\"minLength\">'{{ label }}' is too short, the minimum length is {{ minLengthRequiredLength }}.</div>\n <div *ngIf=\"max\">The value of '{{ label }}' is too high, the maximum is {{ maxRequiredMax }}.</div>\n <div *ngIf=\"min\">The value of '{{ label }}' is too low, the minimum is {{ minRequiredMin }}.</div>\n <div *ngIf=\"pattern\">The pattern of '{{ label }}' not valid.</div>\n <div *ngIf=\"required\">'{{ label }}' is required.</div>\n <div *ngIf=\"year\">Please choose a year between 1991 and the current year.</div>\n <div *ngIf=\"yearFuture\">Please choose a year between the current year and 2050.</div>\n <div *ngIf=\"month\">Please choose a valid month (a value between 01 and 12).</div>\n <div *ngIf=\"future\">The selected date may not be in the future.</div>\n <div *ngIf=\"past\">The selected date may not be in the past.</div>\n</ng-container>" }]
|
|
185
|
+
FormsModule
|
|
186
|
+
], standalone: true, template: "@if (control && control.errors && (control.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}" }]
|
|
190
187
|
}], propDecorators: { control: [{
|
|
191
188
|
type: Input
|
|
192
189
|
}], label: [{
|
|
@@ -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","import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { AbstractControl, FormsModule } from '@angular/forms';\n\n@Component({\n selector: 'spx-validate-control',\n templateUrl: './spx-validate-control.component.html',\n imports: [\n CommonModule,\n FormsModule,\n ]\n})\nexport class SpxValidateControlComponent {\n @Input() control!: AbstractControl;\n @Input() label: string | unknown;\n @Input() submitTried!: boolean;\n\n get maxLength() {\n return this.control.errors && this.control.errors['maxlength'];\n }\n\n get maxLengthRequiredLength() {\n return this.maxLength && this.control.errors && this.control.errors['maxlength']['requiredLength'];\n }\n\n get minLength() {\n return this.control.errors && this.control.errors['minlength'];\n }\n\n get minLengthRequiredLength() {\n return this.minLength && this.control.errors && this.control.errors['minlength']['requiredLength'];\n }\n\n get max() {\n return this.control.errors && this.control.errors['max'];\n }\n\n get maxRequiredMax() {\n return this.max && this.control.errors && this.control.errors['max']['max'];\n }\n\n get min() {\n return this.control.errors && this.control.errors['min'];\n }\n\n get minRequiredMin() {\n return this.min && this.control.errors && this.control.errors['min']['min'];\n }\n\n get pattern() {\n return this.control.errors && this.control.errors['pattern'];\n }\n\n get required() {\n return this.control.errors && this.control.errors['required'];\n }\n\n get year() {\n return this.control.errors && this.control.errors['year'];\n }\n\n get yearFuture() {\n return this.control.errors && this.control.errors['yearFuture'];\n }\n\n get month() {\n return this.control.errors && this.control.errors['month'];\n }\n\n get future() {\n return this.control.errors && this.control.errors['future'];\n }\n\n get past() {\n return this.control.errors && this.control.errors['past'];\n }\n}\n","<ng-container *ngIf=\"control && control.errors && (control.touched || submitTried)\">\n <div *ngIf=\"maxLength\">'{{ label }}' is too long, the maximum length is {{ maxLengthRequiredLength }}.</div>\n <div *ngIf=\"minLength\">'{{ label }}' is too short, the minimum length is {{ minLengthRequiredLength }}.</div>\n <div *ngIf=\"max\">The value of '{{ label }}' is too high, the maximum is {{ maxRequiredMax }}.</div>\n <div *ngIf=\"min\">The value of '{{ label }}' is too low, the minimum is {{ minRequiredMin }}.</div>\n <div *ngIf=\"pattern\">The pattern of '{{ label }}' not valid.</div>\n <div *ngIf=\"required\">'{{ label }}' is required.</div>\n <div *ngIf=\"year\">Please choose a year between 1991 and the current year.</div>\n <div *ngIf=\"yearFuture\">Please choose a year between the current year and 2050.</div>\n <div *ngIf=\"month\">Please choose a valid month (a value between 01 and 12).</div>\n <div *ngIf=\"future\">The selected date may not be in the future.</div>\n <div *ngIf=\"past\">The selected date may not be in the past.</div>\n</ng-container>","/**\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,EAA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A2B,ECZxC,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,KAAA,EAAA,OAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,4jCAYe,EDJP,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,YAAY,kIACZ,WAAW,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAGN,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBARvC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,sBAAsB,EAEvB,OAAA,EAAA;wBACL,YAAY;wBACZ,WAAW;AACd,qBAAA,EAAA,QAAA,EAAA,4jCAAA,EAAA;8BAGM,OAAO,EAAA,CAAA;sBAAf;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,WAAW,EAAA,CAAA;sBAAnB;;;AEfH;;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 { Component, Input } from '@angular/core';\nimport { AbstractControl, FormsModule } 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})\nexport class SpxValidateControlComponent {\n @Input() control!: AbstractControl;\n @Input() label: string | unknown;\n @Input() submitTried!: boolean;\n\n get maxLength() {\n return this.control.errors && this.control.errors['maxlength'];\n }\n\n get maxLengthRequiredLength() {\n return this.maxLength && this.control.errors && this.control.errors['maxlength']['requiredLength'];\n }\n\n get minLength() {\n return this.control.errors && this.control.errors['minlength'];\n }\n\n get minLengthRequiredLength() {\n return this.minLength && this.control.errors && this.control.errors['minlength']['requiredLength'];\n }\n\n get max() {\n return this.control.errors && this.control.errors['max'];\n }\n\n get maxRequiredMax() {\n return this.max && this.control.errors && this.control.errors['max']['max'];\n }\n\n get min() {\n return this.control.errors && this.control.errors['min'];\n }\n\n get minRequiredMin() {\n return this.min && this.control.errors && this.control.errors['min']['min'];\n }\n\n get pattern() {\n return this.control.errors && this.control.errors['pattern'];\n }\n\n get required() {\n return this.control.errors && this.control.errors['required'];\n }\n\n get year() {\n return this.control.errors && this.control.errors['year'];\n }\n\n get yearFuture() {\n return this.control.errors && this.control.errors['yearFuture'];\n }\n\n get month() {\n return this.control.errors && this.control.errors['month'];\n }\n\n get future() {\n return this.control.errors && this.control.errors['future'];\n }\n\n get past() {\n return this.control.errors && this.control.errors['past'];\n }\n}\n","@if (control && control.errors && (control.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 * 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,CAAC;KAC7B;AACD,IAAA,OAAO,IAAI,CAAC;AAChB;;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,CAAC;QACvE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,GAAG,EAAE;YAC9B,OAAO;AACH,gBAAA,GAAG,EAAE;oBACD,GAAG;AACH,oBAAA,MAAM,EAAE,KAAK;AAChB,iBAAA;aACJ,CAAC;SACL;KACJ;AACD,IAAA,OAAO,IAAI,CAAC;AAChB;;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,CAAC;QAC5C,IAAI,SA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