@softpak/components 20.7.1 → 20.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { valuePairToValue } from '@softpak/components/spx-helpers';
|
|
2
2
|
import { DateTime } from 'luxon';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
3
|
import { FormsModule } from '@angular/forms';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { input, signal, computed, effect, inject, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
|
+
import { spxTextTooLong, spxTextTooShort, spxTextTooHigh, spxTextTooLow, spxTextPatternNotValid, spxTextRequired, spxTextChoosePast, spxTextChooseFuture, spxTextChooseValidMonth, spxTextDateMayNotBeFuture, spxTextDateMayNotBePast, spxTextInvalidCode } from '@softpak/components/spx-translate';
|
|
7
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
6
8
|
|
|
7
9
|
const spxValidatorRequired = () => (control) => {
|
|
8
10
|
if (control &&
|
|
@@ -137,6 +139,41 @@ class SpxValidateControlComponent {
|
|
|
137
139
|
this.submitTried = input(...(ngDevMode ? [undefined, { debugName: "submitTried" }] : []));
|
|
138
140
|
this.errors = input.required(...(ngDevMode ? [{ debugName: "errors" }] : []));
|
|
139
141
|
this.touched = input.required(...(ngDevMode ? [{ debugName: "touched" }] : []));
|
|
142
|
+
this.show = signal(false, ...(ngDevMode ? [{ debugName: "show" }] : []));
|
|
143
|
+
this.shouldShow = computed(() => this.control() && this.errors() && (this.touched() || this.submitTried()), ...(ngDevMode ? [{ debugName: "shouldShow" }] : []));
|
|
144
|
+
this.pending = null;
|
|
145
|
+
this.token = 0;
|
|
146
|
+
// Short delay to avoid growing DOM while clicking on something.
|
|
147
|
+
this._delayShow = effect((onCleanup) => {
|
|
148
|
+
const want = this.shouldShow();
|
|
149
|
+
// Invalidate any older timeouts.
|
|
150
|
+
this.token++;
|
|
151
|
+
// Cancel any in-flight timeout.
|
|
152
|
+
if (this.pending) {
|
|
153
|
+
clearTimeout(this.pending);
|
|
154
|
+
this.pending = null;
|
|
155
|
+
}
|
|
156
|
+
if (want) {
|
|
157
|
+
const myToken = this.token;
|
|
158
|
+
this.pending = setTimeout(() => {
|
|
159
|
+
// Only set true if no newer change happened AND the condition still holds.
|
|
160
|
+
if (myToken === this.token && this.shouldShow()) {
|
|
161
|
+
this.show.set(true);
|
|
162
|
+
}
|
|
163
|
+
}, 500); // your delay
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
// Turn off immediately.
|
|
167
|
+
this.show.set(false);
|
|
168
|
+
}
|
|
169
|
+
// Clean up if the effect is torn down.
|
|
170
|
+
onCleanup(() => {
|
|
171
|
+
if (this.pending) {
|
|
172
|
+
clearTimeout(this.pending);
|
|
173
|
+
this.pending = null;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}, ...(ngDevMode ? [{ debugName: "_delayShow" }] : []));
|
|
140
177
|
this.maxLength = computed(() => {
|
|
141
178
|
return this.errors() && this.errors()['maxlength'];
|
|
142
179
|
}, ...(ngDevMode ? [{ debugName: "maxLength" }] : []));
|
|
@@ -182,15 +219,52 @@ class SpxValidateControlComponent {
|
|
|
182
219
|
this.past = computed(() => {
|
|
183
220
|
return this.errors() && this.errors()['past'];
|
|
184
221
|
}, ...(ngDevMode ? [{ debugName: "past" }] : []));
|
|
222
|
+
this.translateService = inject(TranslateService);
|
|
223
|
+
this.textTooLong = computed(() => {
|
|
224
|
+
return this.translateService.instant(spxTextTooLong, { fieldLabel: this.label(), error: this.errors()?.["maxlength"].requiredLength });
|
|
225
|
+
}, ...(ngDevMode ? [{ debugName: "textTooLong" }] : []));
|
|
226
|
+
this.textTooShort = computed(() => {
|
|
227
|
+
return this.translateService.instant(spxTextTooShort, { fieldLabel: this.label(), error: this.errors()?.["minlength"].requiredLength });
|
|
228
|
+
}, ...(ngDevMode ? [{ debugName: "textTooShort" }] : []));
|
|
229
|
+
this.textTooHigh = computed(() => {
|
|
230
|
+
return this.translateService.instant(spxTextTooHigh, { fieldLabel: this.label(), error: this.errors()?.["max"].max });
|
|
231
|
+
}, ...(ngDevMode ? [{ debugName: "textTooHigh" }] : []));
|
|
232
|
+
this.textTooLow = computed(() => {
|
|
233
|
+
return this.translateService.instant(spxTextTooLow, { fieldLabel: this.label(), error: this.errors()?.["min"].min });
|
|
234
|
+
}, ...(ngDevMode ? [{ debugName: "textTooLow" }] : []));
|
|
235
|
+
this.textPatternNotValid = computed(() => {
|
|
236
|
+
return this.translateService.instant(spxTextPatternNotValid, { fieldLabel: this.label() });
|
|
237
|
+
}, ...(ngDevMode ? [{ debugName: "textPatternNotValid" }] : []));
|
|
238
|
+
this.textRequired = computed(() => {
|
|
239
|
+
return this.translateService.instant(spxTextRequired, { fieldLabel: this.label() });
|
|
240
|
+
}, ...(ngDevMode ? [{ debugName: "textRequired" }] : []));
|
|
241
|
+
this.textChoosePast = computed(() => {
|
|
242
|
+
return this.translateService.instant(spxTextChoosePast);
|
|
243
|
+
}, ...(ngDevMode ? [{ debugName: "textChoosePast" }] : []));
|
|
244
|
+
this.textChooseFuture = computed(() => {
|
|
245
|
+
return this.translateService.instant(spxTextChooseFuture);
|
|
246
|
+
}, ...(ngDevMode ? [{ debugName: "textChooseFuture" }] : []));
|
|
247
|
+
this.textChooseValidMonth = computed(() => {
|
|
248
|
+
return this.translateService.instant(spxTextChooseValidMonth);
|
|
249
|
+
}, ...(ngDevMode ? [{ debugName: "textChooseValidMonth" }] : []));
|
|
250
|
+
this.textDateMayNotBeFuture = computed(() => {
|
|
251
|
+
return this.translateService.instant(spxTextDateMayNotBeFuture);
|
|
252
|
+
}, ...(ngDevMode ? [{ debugName: "textDateMayNotBeFuture" }] : []));
|
|
253
|
+
this.textDateMayNotBePast = computed(() => {
|
|
254
|
+
return this.translateService.instant(spxTextDateMayNotBePast);
|
|
255
|
+
}, ...(ngDevMode ? [{ debugName: "textDateMayNotBePast" }] : []));
|
|
256
|
+
this.textInvalidCode = computed(() => {
|
|
257
|
+
return this.translateService.instant(spxTextInvalidCode, { codeName: this.errors()?.["invalidCode"].name, codeCode: this.errors()?.["invalidCode"].code });
|
|
258
|
+
}, ...(ngDevMode ? [{ debugName: "textInvalidCode" }] : []));
|
|
185
259
|
}
|
|
186
260
|
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 (
|
|
261
|
+
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 (show()) {\n<div class=\"bg-red-600 rounded-b p-3\">\n @if (maxLength()) {\n <div>{{ textTooLong() }}</div>\n }\n @if (minLength()) {\n <div>{{ textTooShort() }}</div>\n }\n @if (max()) {\n <div>{{ textTooHigh() }}</div>\n }\n @if (min()) {\n <div>{{ textTooLow() }}</div>\n }\n @if (pattern()) {\n <div>{{ textPatternNotValid() }}</div>\n }\n @if (required()) {\n <div>{{ textRequired() }}</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>{{ textChooseValidMonth() }}</div>\n }\n @if (future()) {\n <div>{{ textDateMayNotBeFuture() }}</div>\n }\n @if (past()) {\n <div>{{ textDateMayNotBePast() }}</div>\n }\n</div>\n}", dependencies: [{ kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
188
262
|
}
|
|
189
263
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxValidateControlComponent, decorators: [{
|
|
190
264
|
type: Component,
|
|
191
265
|
args: [{ selector: 'spx-validate-control', imports: [
|
|
192
266
|
FormsModule,
|
|
193
|
-
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (
|
|
267
|
+
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (show()) {\n<div class=\"bg-red-600 rounded-b p-3\">\n @if (maxLength()) {\n <div>{{ textTooLong() }}</div>\n }\n @if (minLength()) {\n <div>{{ textTooShort() }}</div>\n }\n @if (max()) {\n <div>{{ textTooHigh() }}</div>\n }\n @if (min()) {\n <div>{{ textTooLow() }}</div>\n }\n @if (pattern()) {\n <div>{{ textPatternNotValid() }}</div>\n }\n @if (required()) {\n <div>{{ textRequired() }}</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>{{ textChooseValidMonth() }}</div>\n }\n @if (future()) {\n <div>{{ textDateMayNotBeFuture() }}</div>\n }\n @if (past()) {\n <div>{{ textDateMayNotBePast() }}</div>\n }\n</div>\n}" }]
|
|
194
268
|
}] });
|
|
195
269
|
|
|
196
270
|
/**
|
|
@@ -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":";;;;;;AAGO,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAwB,KAA6B;AAC5F,IAAA,IACI,OAAO;AACP,QAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,SAAS;AA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AA,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;;;;"}
|
|
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 { AbstractControl, FormsModule, ValidationErrors } from '@angular/forms';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, input, signal } from '@angular/core';\nimport { spxTextChooseFuture, spxTextChoosePast, spxTextChooseValidMonth, spxTextDateMayNotBeFuture, spxTextDateMayNotBePast, spxTextInvalidCode, spxTextPatternNotValid, spxTextRequired, spxTextTooHigh, spxTextTooLong, spxTextTooLow, spxTextTooShort } from '@softpak/components/spx-translate';\n\nimport { TranslateService } from '@ngx-translate/core';\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 protected readonly show = signal(false);\n private readonly shouldShow = computed(() => this.control() && this.errors() && (this.touched() || this.submitTried()));\n\n private pending: ReturnType<typeof setTimeout> | null = null;\n private token = 0;\n\n // Short delay to avoid growing DOM while clicking on something.\n private _delayShow = effect((onCleanup) => {\n const want = this.shouldShow();\n\n // Invalidate any older timeouts.\n this.token++;\n\n // Cancel any in-flight timeout.\n if (this.pending) {\n clearTimeout(this.pending);\n this.pending = null;\n }\n\n if (want) {\n const myToken = this.token;\n this.pending = setTimeout(() => {\n // Only set true if no newer change happened AND the condition still holds.\n if (myToken === this.token && this.shouldShow()) {\n this.show.set(true);\n }\n }, 500); // your delay\n } else {\n // Turn off immediately.\n this.show.set(false);\n }\n\n // Clean up if the effect is torn down.\n onCleanup(() => {\n if (this.pending) {\n clearTimeout(this.pending);\n this.pending = null;\n }\n });\n });\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 translateService = inject(TranslateService);\n\n textTooLong = computed(() => {\n return this.translateService.instant(spxTextTooLong, { fieldLabel: this.label(), error: this.errors()?.[\"maxlength\"].requiredLength });\n });\n\n textTooShort = computed(() => {\n return this.translateService.instant(spxTextTooShort, { fieldLabel: this.label(), error: this.errors()?.[\"minlength\"].requiredLength });\n });\n\n textTooHigh = computed(() => {\n return this.translateService.instant(spxTextTooHigh, { fieldLabel: this.label(), error: this.errors()?.[\"max\"].max });\n });\n\n textTooLow = computed(() => {\n return this.translateService.instant(spxTextTooLow, { fieldLabel: this.label(), error: this.errors()?.[\"min\"].min });\n });\n\n textPatternNotValid = computed(() => {\n return this.translateService.instant(spxTextPatternNotValid, { fieldLabel: this.label() });\n });\n\n textRequired = computed(() => {\n return this.translateService.instant(spxTextRequired, { fieldLabel: this.label() });\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","@if (show()) {\n<div class=\"bg-red-600 rounded-b p-3\">\n @if (maxLength()) {\n <div>{{ textTooLong() }}</div>\n }\n @if (minLength()) {\n <div>{{ textTooShort() }}</div>\n }\n @if (max()) {\n <div>{{ textTooHigh() }}</div>\n }\n @if (min()) {\n <div>{{ textTooLow() }}</div>\n }\n @if (pattern()) {\n <div>{{ textPatternNotValid() }}</div>\n }\n @if (required()) {\n <div>{{ textRequired() }}</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>{{ textChooseValidMonth() }}</div>\n }\n @if (future()) {\n <div>{{ textDateMayNotBeFuture() }}</div>\n }\n @if (past()) {\n <div>{{ textDateMayNotBePast() }}</div>\n }\n</div>\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,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;Q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A,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECfxC,8zBAoCC,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,ED1BO,WAAW,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKN,2BAA2B,EAAA,UAAA,EAAA,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,8zBAAA,EAAA;;;AEbnD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softpak/components",
|
|
3
|
-
"version": "20.7.
|
|
3
|
+
"version": "20.7.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "20.x.x",
|
|
@@ -32,38 +32,34 @@
|
|
|
32
32
|
"types": "./index.d.ts",
|
|
33
33
|
"default": "./fesm2022/softpak-components.mjs"
|
|
34
34
|
},
|
|
35
|
-
"./spx-
|
|
36
|
-
"types": "./spx-
|
|
37
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
35
|
+
"./spx-404-page": {
|
|
36
|
+
"types": "./spx-404-page/index.d.ts",
|
|
37
|
+
"default": "./fesm2022/softpak-components-spx-404-page.mjs"
|
|
38
38
|
},
|
|
39
39
|
"./spx-app-expiry": {
|
|
40
40
|
"types": "./spx-app-expiry/index.d.ts",
|
|
41
41
|
"default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
|
|
42
42
|
},
|
|
43
|
-
"./spx-app-configuration": {
|
|
44
|
-
"types": "./spx-app-configuration/index.d.ts",
|
|
45
|
-
"default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
|
|
46
|
-
},
|
|
47
|
-
"./spx-404-page": {
|
|
48
|
-
"types": "./spx-404-page/index.d.ts",
|
|
49
|
-
"default": "./fesm2022/softpak-components-spx-404-page.mjs"
|
|
50
|
-
},
|
|
51
43
|
"./spx-button": {
|
|
52
44
|
"types": "./spx-button/index.d.ts",
|
|
53
45
|
"default": "./fesm2022/softpak-components-spx-button.mjs"
|
|
54
46
|
},
|
|
47
|
+
"./spx-alert": {
|
|
48
|
+
"types": "./spx-alert/index.d.ts",
|
|
49
|
+
"default": "./fesm2022/softpak-components-spx-alert.mjs"
|
|
50
|
+
},
|
|
55
51
|
"./spx-capitalize": {
|
|
56
52
|
"types": "./spx-capitalize/index.d.ts",
|
|
57
53
|
"default": "./fesm2022/softpak-components-spx-capitalize.mjs"
|
|
58
54
|
},
|
|
55
|
+
"./spx-app-configuration": {
|
|
56
|
+
"types": "./spx-app-configuration/index.d.ts",
|
|
57
|
+
"default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
|
|
58
|
+
},
|
|
59
59
|
"./spx-card": {
|
|
60
60
|
"types": "./spx-card/index.d.ts",
|
|
61
61
|
"default": "./fesm2022/softpak-components-spx-card.mjs"
|
|
62
62
|
},
|
|
63
|
-
"./spx-change-details": {
|
|
64
|
-
"types": "./spx-change-details/index.d.ts",
|
|
65
|
-
"default": "./fesm2022/softpak-components-spx-change-details.mjs"
|
|
66
|
-
},
|
|
67
63
|
"./spx-channel-selection": {
|
|
68
64
|
"types": "./spx-channel-selection/index.d.ts",
|
|
69
65
|
"default": "./fesm2022/softpak-components-spx-channel-selection.mjs"
|
|
@@ -72,25 +68,21 @@
|
|
|
72
68
|
"types": "./spx-check-digit/index.d.ts",
|
|
73
69
|
"default": "./fesm2022/softpak-components-spx-check-digit.mjs"
|
|
74
70
|
},
|
|
75
|
-
"./spx-form-section": {
|
|
76
|
-
"types": "./spx-form-section/index.d.ts",
|
|
77
|
-
"default": "./fesm2022/softpak-components-spx-form-section.mjs"
|
|
78
|
-
},
|
|
79
71
|
"./spx-confirm": {
|
|
80
72
|
"types": "./spx-confirm/index.d.ts",
|
|
81
73
|
"default": "./fesm2022/softpak-components-spx-confirm.mjs"
|
|
82
74
|
},
|
|
83
|
-
"./spx-form-
|
|
84
|
-
"types": "./spx-form-
|
|
85
|
-
"default": "./fesm2022/softpak-components-spx-form-
|
|
75
|
+
"./spx-form-section": {
|
|
76
|
+
"types": "./spx-form-section/index.d.ts",
|
|
77
|
+
"default": "./fesm2022/softpak-components-spx-form-section.mjs"
|
|
86
78
|
},
|
|
87
79
|
"./spx-helpers": {
|
|
88
80
|
"types": "./spx-helpers/index.d.ts",
|
|
89
81
|
"default": "./fesm2022/softpak-components-spx-helpers.mjs"
|
|
90
82
|
},
|
|
91
|
-
"./spx-
|
|
92
|
-
"types": "./spx-
|
|
93
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
83
|
+
"./spx-change-details": {
|
|
84
|
+
"types": "./spx-change-details/index.d.ts",
|
|
85
|
+
"default": "./fesm2022/softpak-components-spx-change-details.mjs"
|
|
94
86
|
},
|
|
95
87
|
"./spx-number-check": {
|
|
96
88
|
"types": "./spx-number-check/index.d.ts",
|
|
@@ -100,14 +92,18 @@
|
|
|
100
92
|
"types": "./spx-navigation/index.d.ts",
|
|
101
93
|
"default": "./fesm2022/softpak-components-spx-navigation.mjs"
|
|
102
94
|
},
|
|
95
|
+
"./spx-inputs": {
|
|
96
|
+
"types": "./spx-inputs/index.d.ts",
|
|
97
|
+
"default": "./fesm2022/softpak-components-spx-inputs.mjs"
|
|
98
|
+
},
|
|
99
|
+
"./spx-form-view": {
|
|
100
|
+
"types": "./spx-form-view/index.d.ts",
|
|
101
|
+
"default": "./fesm2022/softpak-components-spx-form-view.mjs"
|
|
102
|
+
},
|
|
103
103
|
"./spx-pagination": {
|
|
104
104
|
"types": "./spx-pagination/index.d.ts",
|
|
105
105
|
"default": "./fesm2022/softpak-components-spx-pagination.mjs"
|
|
106
106
|
},
|
|
107
|
-
"./spx-pipes": {
|
|
108
|
-
"types": "./spx-pipes/index.d.ts",
|
|
109
|
-
"default": "./fesm2022/softpak-components-spx-pipes.mjs"
|
|
110
|
-
},
|
|
111
107
|
"./spx-patch": {
|
|
112
108
|
"types": "./spx-patch/index.d.ts",
|
|
113
109
|
"default": "./fesm2022/softpak-components-spx-patch.mjs"
|
|
@@ -116,21 +112,21 @@
|
|
|
116
112
|
"types": "./spx-progress-bar/index.d.ts",
|
|
117
113
|
"default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
|
|
118
114
|
},
|
|
119
|
-
"./spx-spinner": {
|
|
120
|
-
"types": "./spx-spinner/index.d.ts",
|
|
121
|
-
"default": "./fesm2022/softpak-components-spx-spinner.mjs"
|
|
122
|
-
},
|
|
123
115
|
"./spx-stock-info": {
|
|
124
116
|
"types": "./spx-stock-info/index.d.ts",
|
|
125
117
|
"default": "./fesm2022/softpak-components-spx-stock-info.mjs"
|
|
126
118
|
},
|
|
119
|
+
"./spx-pipes": {
|
|
120
|
+
"types": "./spx-pipes/index.d.ts",
|
|
121
|
+
"default": "./fesm2022/softpak-components-spx-pipes.mjs"
|
|
122
|
+
},
|
|
127
123
|
"./spx-storage": {
|
|
128
124
|
"types": "./spx-storage/index.d.ts",
|
|
129
125
|
"default": "./fesm2022/softpak-components-spx-storage.mjs"
|
|
130
126
|
},
|
|
131
|
-
"./spx-
|
|
132
|
-
"types": "./spx-
|
|
133
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
127
|
+
"./spx-spinner": {
|
|
128
|
+
"types": "./spx-spinner/index.d.ts",
|
|
129
|
+
"default": "./fesm2022/softpak-components-spx-spinner.mjs"
|
|
134
130
|
},
|
|
135
131
|
"./spx-toaster": {
|
|
136
132
|
"types": "./spx-toaster/index.d.ts",
|
|
@@ -140,9 +136,9 @@
|
|
|
140
136
|
"types": "./spx-tabs/index.d.ts",
|
|
141
137
|
"default": "./fesm2022/softpak-components-spx-tabs.mjs"
|
|
142
138
|
},
|
|
143
|
-
"./spx-
|
|
144
|
-
"types": "./spx-
|
|
145
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
139
|
+
"./spx-suggestion": {
|
|
140
|
+
"types": "./spx-suggestion/index.d.ts",
|
|
141
|
+
"default": "./fesm2022/softpak-components-spx-suggestion.mjs"
|
|
146
142
|
},
|
|
147
143
|
"./spx-translate": {
|
|
148
144
|
"types": "./spx-translate/index.d.ts",
|
|
@@ -152,6 +148,10 @@
|
|
|
152
148
|
"types": "./spx-update/index.d.ts",
|
|
153
149
|
"default": "./fesm2022/softpak-components-spx-update.mjs"
|
|
154
150
|
},
|
|
151
|
+
"./spx-toggle": {
|
|
152
|
+
"types": "./spx-toggle/index.d.ts",
|
|
153
|
+
"default": "./fesm2022/softpak-components-spx-toggle.mjs"
|
|
154
|
+
},
|
|
155
155
|
"./spx-validation": {
|
|
156
156
|
"types": "./spx-validation/index.d.ts",
|
|
157
157
|
"default": "./fesm2022/softpak-components-spx-validation.mjs"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractControl, ValidationErrors } from '@angular/forms';
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
3
4
|
|
|
4
5
|
declare const spxValidatorMax: (max: number) => (control: AbstractControl) => {
|
|
5
6
|
max: {
|
|
@@ -41,6 +42,11 @@ declare class SpxValidateControlComponent {
|
|
|
41
42
|
readonly submitTried: _angular_core.InputSignal<boolean | undefined>;
|
|
42
43
|
readonly errors: _angular_core.InputSignal<ValidationErrors | null>;
|
|
43
44
|
readonly touched: _angular_core.InputSignal<boolean>;
|
|
45
|
+
protected readonly show: _angular_core.WritableSignal<boolean>;
|
|
46
|
+
private readonly shouldShow;
|
|
47
|
+
private pending;
|
|
48
|
+
private token;
|
|
49
|
+
private _delayShow;
|
|
44
50
|
maxLength: _angular_core.Signal<any>;
|
|
45
51
|
maxLengthRequiredLength: _angular_core.Signal<any>;
|
|
46
52
|
minLength: _angular_core.Signal<any>;
|
|
@@ -56,6 +62,19 @@ declare class SpxValidateControlComponent {
|
|
|
56
62
|
month: _angular_core.Signal<any>;
|
|
57
63
|
future: _angular_core.Signal<any>;
|
|
58
64
|
past: _angular_core.Signal<any>;
|
|
65
|
+
translateService: TranslateService;
|
|
66
|
+
textTooLong: _angular_core.Signal<any>;
|
|
67
|
+
textTooShort: _angular_core.Signal<any>;
|
|
68
|
+
textTooHigh: _angular_core.Signal<any>;
|
|
69
|
+
textTooLow: _angular_core.Signal<any>;
|
|
70
|
+
textPatternNotValid: _angular_core.Signal<any>;
|
|
71
|
+
textRequired: _angular_core.Signal<any>;
|
|
72
|
+
textChoosePast: _angular_core.Signal<any>;
|
|
73
|
+
textChooseFuture: _angular_core.Signal<any>;
|
|
74
|
+
textChooseValidMonth: _angular_core.Signal<any>;
|
|
75
|
+
textDateMayNotBeFuture: _angular_core.Signal<any>;
|
|
76
|
+
textDateMayNotBePast: _angular_core.Signal<any>;
|
|
77
|
+
textInvalidCode: _angular_core.Signal<any>;
|
|
59
78
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SpxValidateControlComponent, never>;
|
|
60
79
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpxValidateControlComponent, "spx-validate-control", never, { "control": { "alias": "control"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "submitTried": { "alias": "submitTried"; "required": false; "isSignal": true; }; "errors": { "alias": "errors"; "required": true; "isSignal": true; }; "touched": { "alias": "touched"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
61
80
|
}
|