@cuby-ui/core 0.0.285 → 0.0.286
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/utils/default-validators/create-default-validators.mjs +11 -4
- package/esm2022/utils/default-validators/create-default-validators.options.mjs +2 -0
- package/esm2022/utils/default-validators/index.mjs +1 -1
- package/esm2022/widgets/general-control-error-hint/general-control-error-hint.component.mjs +3 -3
- package/fesm2022/cuby-ui-core.mjs +12 -5
- package/fesm2022/cuby-ui-core.mjs.map +1 -1
- package/package.json +4 -4
- package/utils/default-validators/create-default-validators.d.ts +2 -2
- package/utils/default-validators/create-default-validators.options.d.ts +5 -0
- package/utils/default-validators/index.d.ts +1 -0
|
@@ -4,9 +4,16 @@ export function cuiCreateDefaultValidators({ maxLength = 100, asyncDelay = 700 }
|
|
|
4
4
|
// Need to offset because this delay must be before changing value
|
|
5
5
|
const OFFSET = 1;
|
|
6
6
|
const adjustedAsyncDelay = asyncDelay - OFFSET;
|
|
7
|
-
|
|
8
|
-
validators: [Validators.required, Validators.maxLength(maxLength)
|
|
9
|
-
asyncValidators: [
|
|
7
|
+
const validators = {
|
|
8
|
+
validators: [Validators.required, Validators.maxLength(maxLength)],
|
|
9
|
+
asyncValidators: []
|
|
10
10
|
};
|
|
11
|
+
if (asyncDelay) {
|
|
12
|
+
validators.asyncValidators.push(asyncExtraSpacesValidators(adjustedAsyncDelay));
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
validators.validators.push(syncExtraSpacesValidator());
|
|
16
|
+
}
|
|
17
|
+
return validators;
|
|
11
18
|
}
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlLWRlZmF1bHQtdmFsaWRhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY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xuICAgIH1cblxuICAgIHJldHVybiB2YWxpZGF0b3JzO1xufVxuIl19
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlLWRlZmF1bHQtdmFsaWRhdG9ycy5vcHRpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29yZS91dGlscy9kZWZhdWx0LXZhbGlkYXRvcnMvY3JlYXRlLWRlZmF1bHQtdmFsaWRhdG9ycy5vcHRpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBBc3luY1ZhbGlkYXRvckZuLCBWYWxpZGF0b3JGbiB9IGZyb20gXCJAYW5ndWxhci9mb3Jtc1wiO1xuXG5leHBvcnQgaW50ZXJmYWNlIEN1aURlZmF1bHRWYWxpZGF0b3JzT3B0aW9ucyB7XG4gICAgcmVhZG9ubHkgdmFsaWRhdG9yczogVmFsaWRhdG9yRm5bXTtcbiAgICByZWFkb25seSBhc3luY1ZhbGlkYXRvcnM6IEFzeW5jVmFsaWRhdG9yRm5bXTtcbn1cbiJdfQ==
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { cuiCreateDefaultValidators } from './create-default-validators';
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb3JlL3V0aWxzL2RlZmF1bHQtdmFsaWRhdG9ycy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IGN1aUNyZWF0ZURlZmF1bHRWYWxpZGF0b3JzIH0gZnJvbSAnLi9jcmVhdGUtZGVmYXVsdC12YWxpZGF0b3JzJztcbmV4cG9ydCB0eXBlIHsgQ3VpRGVmYXVsdFZhbGlkYXRvcnNPcHRpb25zIH0gZnJvbSAnLi9jcmVhdGUtZGVmYXVsdC12YWxpZGF0b3JzLm9wdGlvbnMnOyJdfQ==
|
|
@@ -12,10 +12,10 @@ export class CuiGeneralControlErrorHintComponent {
|
|
|
12
12
|
return this.isVisible() ?? (this.control().invalid && this.control().dirty);
|
|
13
13
|
}
|
|
14
14
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiGeneralControlErrorHintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CuiGeneralControlErrorHintComponent, isStandalone: true, selector: "cui-general-control-error-hint", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, isVisible: { classPropertyName: "isVisible", publicName: "isVisible", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n @if (isInvalid) {\n @if (control().errors; as errors) {\n <cui-hint hintType=\"error\">\n @if (errors['required']) {\n {{ t('FIELD_IS_REQUIRED') }}\n } @else if (errors['maxlength']) {\n {{ t('PLEASE_KEEP_FIELD_UNDER_CHARACTERS', { value: errors['maxlength'].requiredLength }) }}\n } @else if (errors['extraSpaces']) {\n {{ t('MUST_BE_WITHOUT_EXTRA_SPACES') }}\n } @else if (errors['min']) {\n {{ t('MIN_VALUE_MUST_BE_MORE_THAN', { value: errors['min'].min }) }}\n } @else if (errors['max']) {\n {{ t('MAX_VALUE_MUST_BE_LESS_THAN', { value: errors['max'].max }) }}\n }\n </cui-hint>\n }\n }\n</ng-container>\n", styles: [":host{display:inline-block}:host:empty{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CuiHintModule }, { kind: "component", type: i1.CuiHintComponent, selector: "cui-hint", inputs: ["hintType"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
|
|
15
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CuiGeneralControlErrorHintComponent, isStandalone: true, selector: "cui-general-control-error-hint", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, isVisible: { classPropertyName: "isVisible", publicName: "isVisible", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n @if (isInvalid) {\n @if (control().errors; as errors) {\n <cui-hint hintType=\"error\">\n @if (errors['required']) {\n {{ t('FIELD_IS_REQUIRED') }}\n } @else if (errors['maxlength']) {\n {{ t('PLEASE_KEEP_FIELD_UNDER_CHARACTERS', { value: errors['maxlength'].requiredLength }) }}\n } @else if (errors['extraSpaces']) {\n {{ t('MUST_BE_WITHOUT_EXTRA_SPACES') }}\n } @else if (errors['min']) {\n {{ t('MIN_VALUE_MUST_BE_MORE_THAN', { value: errors['min'].min }) }}\n } @else if (errors['max']) {\n {{ t('MAX_VALUE_MUST_BE_LESS_THAN', { value: errors['max'].max }) }}\n } @else if (errors['email']) {\n {{ t('INVALID_EMAIL_ADDRESS') }}\n }\n </cui-hint>\n }\n }\n</ng-container>\n", styles: [":host{display:inline-block}:host:empty{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CuiHintModule }, { kind: "component", type: i1.CuiHintComponent, selector: "cui-hint", inputs: ["hintType"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
|
|
16
16
|
}
|
|
17
17
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiGeneralControlErrorHintComponent, decorators: [{
|
|
18
18
|
type: Component,
|
|
19
|
-
args: [{ selector: 'cui-general-control-error-hint', imports: [CuiHintModule, TranslocoDirective], standalone: true, changeDetection: ChangeDetectionStrategy.Default, template: "<ng-container *transloco=\"let t\">\n @if (isInvalid) {\n @if (control().errors; as errors) {\n <cui-hint hintType=\"error\">\n @if (errors['required']) {\n {{ t('FIELD_IS_REQUIRED') }}\n } @else if (errors['maxlength']) {\n {{ t('PLEASE_KEEP_FIELD_UNDER_CHARACTERS', { value: errors['maxlength'].requiredLength }) }}\n } @else if (errors['extraSpaces']) {\n {{ t('MUST_BE_WITHOUT_EXTRA_SPACES') }}\n } @else if (errors['min']) {\n {{ t('MIN_VALUE_MUST_BE_MORE_THAN', { value: errors['min'].min }) }}\n } @else if (errors['max']) {\n {{ t('MAX_VALUE_MUST_BE_LESS_THAN', { value: errors['max'].max }) }}\n }\n </cui-hint>\n }\n }\n</ng-container>\n", styles: [":host{display:inline-block}:host:empty{display:none}\n"] }]
|
|
19
|
+
args: [{ selector: 'cui-general-control-error-hint', imports: [CuiHintModule, TranslocoDirective], standalone: true, changeDetection: ChangeDetectionStrategy.Default, template: "<ng-container *transloco=\"let t\">\n @if (isInvalid) {\n @if (control().errors; as errors) {\n <cui-hint hintType=\"error\">\n @if (errors['required']) {\n {{ t('FIELD_IS_REQUIRED') }}\n } @else if (errors['maxlength']) {\n {{ t('PLEASE_KEEP_FIELD_UNDER_CHARACTERS', { value: errors['maxlength'].requiredLength }) }}\n } @else if (errors['extraSpaces']) {\n {{ t('MUST_BE_WITHOUT_EXTRA_SPACES') }}\n } @else if (errors['min']) {\n {{ t('MIN_VALUE_MUST_BE_MORE_THAN', { value: errors['min'].min }) }}\n } @else if (errors['max']) {\n {{ t('MAX_VALUE_MUST_BE_LESS_THAN', { value: errors['max'].max }) }}\n } @else if (errors['email']) {\n {{ t('INVALID_EMAIL_ADDRESS') }}\n }\n </cui-hint>\n }\n }\n</ng-container>\n", styles: [":host{display:inline-block}:host:empty{display:none}\n"] }]
|
|
20
20
|
}] });
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJhbC1jb250cm9sLWVycm9yLWhpbnQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29yZS93aWRnZXRzL2dlbmVyYWwtY29udHJvbC1lcnJvci1oaW50L2dlbmVyYWwtY29udHJvbC1lcnJvci1oaW50LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NvcmUvd2lkZ2V0cy9nZW5lcmFsLWNvbnRyb2wtZXJyb3ItaGludC9nZW5lcmFsLWNvbnRyb2wtZXJyb3ItaGludC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUUxRSxPQUFPLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUV4RCxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7OztBQVVqRCxNQUFNLE9BQU8sbUNBQW1DO0lBUmhEO1FBU29CLFlBQU8sR0FBRyxLQUFLLENBQUMsUUFBUSxFQUFtQixDQUFDO1FBQzVDLGNBQVMsR0FBRyxLQUFLLEVBQVcsQ0FBQztLQUtoRDtJQUhHLElBQWMsU0FBU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nJvcnNbJ2V4dHJhU3BhY2VzJ10pIHtcbiAgICAgICAgICAgICAgICAgICAge3sgdCgnTVVTVF9CRV9XSVRIT1VUX0VYVFJBX1NQQUNFUycpIH19XG4gICAgICAgICAgICAgICAgfSBAZWxzZSBpZiAoZXJyb3JzWydtaW4nXSkge1xuICAgICAgICAgICAgICAgICAgICB7eyB0KCdNSU5fVkFMVUVfTVVTVF9CRV9NT1JFX1RIQU4nLCB7IHZhbHVlOiBlcnJvcnNbJ21pbiddLm1pbiB9KSB9fVxuICAgICAgICAgICAgICAgIH0gQGVsc2UgaWYgKGVycm9yc1snbWF4J10pIHtcbiAgICAgICAgICAgICAgICAgICAge3sgdCgnTUFYX1ZBTFVFX01VU1RfQkVfTEVTU19USEFOJywgeyB2YWx1ZTogZXJyb3JzWydtYXgnXS5tYXggfSkgfX1cbiAgICAgICAgICAgICAgICB9IEBlbHNlIGlmIChlcnJvcnNbJ2VtYWlsJ10pIHtcbiAgICAgICAgICAgICAgICAgICAge3sgdCgnSU5WQUxJRF9FTUFJTF9BRERSRVNTJykgfX1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICA8L2N1aS1oaW50PlxuICAgICAgICB9XG4gICAgfVxuPC9uZy1jb250YWluZXI+XG4iXX0=
|
|
@@ -1726,10 +1726,17 @@ function cuiCreateDefaultValidators({ maxLength = 100, asyncDelay = 700 } = {})
|
|
|
1726
1726
|
// Need to offset because this delay must be before changing value
|
|
1727
1727
|
const OFFSET = 1;
|
|
1728
1728
|
const adjustedAsyncDelay = asyncDelay - OFFSET;
|
|
1729
|
-
|
|
1730
|
-
validators: [Validators.required, Validators.maxLength(maxLength)
|
|
1731
|
-
asyncValidators: [
|
|
1729
|
+
const validators = {
|
|
1730
|
+
validators: [Validators.required, Validators.maxLength(maxLength)],
|
|
1731
|
+
asyncValidators: []
|
|
1732
1732
|
};
|
|
1733
|
+
if (asyncDelay) {
|
|
1734
|
+
validators.asyncValidators.push(asyncExtraSpacesValidators(adjustedAsyncDelay));
|
|
1735
|
+
}
|
|
1736
|
+
else {
|
|
1737
|
+
validators.validators.push(syncExtraSpacesValidator());
|
|
1738
|
+
}
|
|
1739
|
+
return validators;
|
|
1733
1740
|
}
|
|
1734
1741
|
|
|
1735
1742
|
/**
|
|
@@ -7724,11 +7731,11 @@ class CuiGeneralControlErrorHintComponent {
|
|
|
7724
7731
|
return this.isVisible() ?? (this.control().invalid && this.control().dirty);
|
|
7725
7732
|
}
|
|
7726
7733
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiGeneralControlErrorHintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7727
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CuiGeneralControlErrorHintComponent, isStandalone: true, selector: "cui-general-control-error-hint", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, isVisible: { classPropertyName: "isVisible", publicName: "isVisible", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n @if (isInvalid) {\n @if (control().errors; as errors) {\n <cui-hint hintType=\"error\">\n @if (errors['required']) {\n {{ t('FIELD_IS_REQUIRED') }}\n } @else if (errors['maxlength']) {\n {{ t('PLEASE_KEEP_FIELD_UNDER_CHARACTERS', { value: errors['maxlength'].requiredLength }) }}\n } @else if (errors['extraSpaces']) {\n {{ t('MUST_BE_WITHOUT_EXTRA_SPACES') }}\n } @else if (errors['min']) {\n {{ t('MIN_VALUE_MUST_BE_MORE_THAN', { value: errors['min'].min }) }}\n } @else if (errors['max']) {\n {{ t('MAX_VALUE_MUST_BE_LESS_THAN', { value: errors['max'].max }) }}\n }\n </cui-hint>\n }\n }\n</ng-container>\n", styles: [":host{display:inline-block}:host:empty{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CuiHintModule }, { kind: "component", type: CuiHintComponent, selector: "cui-hint", inputs: ["hintType"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
|
|
7734
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CuiGeneralControlErrorHintComponent, isStandalone: true, selector: "cui-general-control-error-hint", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, isVisible: { classPropertyName: "isVisible", publicName: "isVisible", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n @if (isInvalid) {\n @if (control().errors; as errors) {\n <cui-hint hintType=\"error\">\n @if (errors['required']) {\n {{ t('FIELD_IS_REQUIRED') }}\n } @else if (errors['maxlength']) {\n {{ t('PLEASE_KEEP_FIELD_UNDER_CHARACTERS', { value: errors['maxlength'].requiredLength }) }}\n } @else if (errors['extraSpaces']) {\n {{ t('MUST_BE_WITHOUT_EXTRA_SPACES') }}\n } @else if (errors['min']) {\n {{ t('MIN_VALUE_MUST_BE_MORE_THAN', { value: errors['min'].min }) }}\n } @else if (errors['max']) {\n {{ t('MAX_VALUE_MUST_BE_LESS_THAN', { value: errors['max'].max }) }}\n } @else if (errors['email']) {\n {{ t('INVALID_EMAIL_ADDRESS') }}\n }\n </cui-hint>\n }\n }\n</ng-container>\n", styles: [":host{display:inline-block}:host:empty{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CuiHintModule }, { kind: "component", type: CuiHintComponent, selector: "cui-hint", inputs: ["hintType"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
|
|
7728
7735
|
}
|
|
7729
7736
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiGeneralControlErrorHintComponent, decorators: [{
|
|
7730
7737
|
type: Component,
|
|
7731
|
-
args: [{ selector: 'cui-general-control-error-hint', imports: [CuiHintModule, TranslocoDirective], standalone: true, changeDetection: ChangeDetectionStrategy.Default, template: "<ng-container *transloco=\"let t\">\n @if (isInvalid) {\n @if (control().errors; as errors) {\n <cui-hint hintType=\"error\">\n @if (errors['required']) {\n {{ t('FIELD_IS_REQUIRED') }}\n } @else if (errors['maxlength']) {\n {{ t('PLEASE_KEEP_FIELD_UNDER_CHARACTERS', { value: errors['maxlength'].requiredLength }) }}\n } @else if (errors['extraSpaces']) {\n {{ t('MUST_BE_WITHOUT_EXTRA_SPACES') }}\n } @else if (errors['min']) {\n {{ t('MIN_VALUE_MUST_BE_MORE_THAN', { value: errors['min'].min }) }}\n } @else if (errors['max']) {\n {{ t('MAX_VALUE_MUST_BE_LESS_THAN', { value: errors['max'].max }) }}\n }\n </cui-hint>\n }\n }\n</ng-container>\n", styles: [":host{display:inline-block}:host:empty{display:none}\n"] }]
|
|
7738
|
+
args: [{ selector: 'cui-general-control-error-hint', imports: [CuiHintModule, TranslocoDirective], standalone: true, changeDetection: ChangeDetectionStrategy.Default, template: "<ng-container *transloco=\"let t\">\n @if (isInvalid) {\n @if (control().errors; as errors) {\n <cui-hint hintType=\"error\">\n @if (errors['required']) {\n {{ t('FIELD_IS_REQUIRED') }}\n } @else if (errors['maxlength']) {\n {{ t('PLEASE_KEEP_FIELD_UNDER_CHARACTERS', { value: errors['maxlength'].requiredLength }) }}\n } @else if (errors['extraSpaces']) {\n {{ t('MUST_BE_WITHOUT_EXTRA_SPACES') }}\n } @else if (errors['min']) {\n {{ t('MIN_VALUE_MUST_BE_MORE_THAN', { value: errors['min'].min }) }}\n } @else if (errors['max']) {\n {{ t('MAX_VALUE_MUST_BE_LESS_THAN', { value: errors['max'].max }) }}\n } @else if (errors['email']) {\n {{ t('INVALID_EMAIL_ADDRESS') }}\n }\n </cui-hint>\n }\n }\n</ng-container>\n", styles: [":host{display:inline-block}:host:empty{display:none}\n"] }]
|
|
7732
7739
|
}] });
|
|
7733
7740
|
|
|
7734
7741
|
class CuiCategoryFormComponent {
|