@skyux/forms 11.36.2 → 11.38.0
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,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input, inject, } from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, Component, HostBinding, Input, inject, } from '@angular/core';
|
|
2
2
|
import { SkyStatusIndicatorModule } from '@skyux/indicators';
|
|
3
3
|
import { SkyThemeComponentClassDirective } from '@skyux/theme';
|
|
4
4
|
import { SKY_FORM_ERRORS_ENABLED } from './form-errors-enabled-token';
|
|
@@ -12,6 +12,9 @@ import * as i2 from "@skyux/indicators";
|
|
|
12
12
|
* To display custom errors, include sky-form-error elements in the form field component.
|
|
13
13
|
*/
|
|
14
14
|
export class SkyFormErrorComponent {
|
|
15
|
+
get hostErrorName() {
|
|
16
|
+
return this.errorName;
|
|
17
|
+
}
|
|
15
18
|
constructor() {
|
|
16
19
|
this.formErrors = inject(SKY_FORM_ERRORS_ENABLED, {
|
|
17
20
|
optional: true,
|
|
@@ -21,7 +24,7 @@ export class SkyFormErrorComponent {
|
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SkyFormErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SkyFormErrorComponent, isStandalone: true, selector: "sky-form-error", inputs: { errorName: "errorName", errorText: "errorText" }, hostDirectives: [{ directive: i1.SkyThemeComponentClassDirective }], ngImport: i0, template: `
|
|
27
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SkyFormErrorComponent, isStandalone: true, selector: "sky-form-error", inputs: { errorName: "errorName", errorText: "errorText" }, host: { properties: { "attr.errorName": "this.hostErrorName" } }, hostDirectives: [{ directive: i1.SkyThemeComponentClassDirective }], ngImport: i0, template: `
|
|
25
28
|
@if (formErrors) {
|
|
26
29
|
<sky-status-indicator
|
|
27
30
|
class="sky-form-error"
|
|
@@ -52,5 +55,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
52
55
|
}], errorText: [{
|
|
53
56
|
type: Input,
|
|
54
57
|
args: [{ required: true }]
|
|
58
|
+
}], hostErrorName: [{
|
|
59
|
+
type: HostBinding,
|
|
60
|
+
args: ['attr.errorName']
|
|
55
61
|
}] } });
|
|
56
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
62
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1lcnJvci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvZm9ybXMvc3JjL2xpYi9tb2R1bGVzL2Zvcm0tZXJyb3IvZm9ybS1lcnJvci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsV0FBVyxFQUNYLEtBQUssRUFDTCxNQUFNLEdBQ1AsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLHdCQUF3QixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDN0QsT0FBTyxFQUFFLCtCQUErQixFQUFFLE1BQU0sY0FBYyxDQUFDO0FBRS9ELE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLDZCQUE2QixDQUFDOzs7O0FBRXRFOzs7OztHQUtHO0FBb0JILE1BQU0sT0FBTyxxQkFBcUI7SUFlaEMsSUFBMEMsYUFBYTtRQUNyRCxPQUFPLElBQUksQ0FBQyxTQUFTLEN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esm2022/skyux-forms.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i2 from '@angular/common';
|
|
2
2
|
import { CommonModule, formatNumber } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { NgModule, Pipe, Component, ChangeDetectionStrategy, Input, Directive, InjectionToken, inject,
|
|
4
|
+
import { NgModule, Pipe, Component, ChangeDetectionStrategy, Input, Directive, InjectionToken, inject, HostBinding, booleanAttribute, numberAttribute, EventEmitter, ChangeDetectorRef, ElementRef, Output, ViewChild, Injectable, Self, Optional, ContentChildren, RendererFactory2, Renderer2, ViewEncapsulation, ContentChild, forwardRef, HostListener } from '@angular/core';
|
|
5
5
|
import * as i2$2 from '@angular/forms';
|
|
6
6
|
import { NG_VALIDATORS, FormsModule, ReactiveFormsModule, Validators, NG_VALUE_ACCESSOR, FormControlDirective, FormControlName, NgModel, NgControl } from '@angular/forms';
|
|
7
7
|
import * as i1 from '@skyux/i18n';
|
|
@@ -376,6 +376,9 @@ const SKY_FORM_ERRORS_ENABLED = new InjectionToken('SKY_FORM_ERRORS_ENABLED');
|
|
|
376
376
|
* To display custom errors, include sky-form-error elements in the form field component.
|
|
377
377
|
*/
|
|
378
378
|
class SkyFormErrorComponent {
|
|
379
|
+
get hostErrorName() {
|
|
380
|
+
return this.errorName;
|
|
381
|
+
}
|
|
379
382
|
constructor() {
|
|
380
383
|
this.formErrors = inject(SKY_FORM_ERRORS_ENABLED, {
|
|
381
384
|
optional: true,
|
|
@@ -385,7 +388,7 @@ class SkyFormErrorComponent {
|
|
|
385
388
|
}
|
|
386
389
|
}
|
|
387
390
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SkyFormErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
388
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SkyFormErrorComponent, isStandalone: true, selector: "sky-form-error", inputs: { errorName: "errorName", errorText: "errorText" }, hostDirectives: [{ directive: i1$1.SkyThemeComponentClassDirective }], ngImport: i0, template: `
|
|
391
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SkyFormErrorComponent, isStandalone: true, selector: "sky-form-error", inputs: { errorName: "errorName", errorText: "errorText" }, host: { properties: { "attr.errorName": "this.hostErrorName" } }, hostDirectives: [{ directive: i1$1.SkyThemeComponentClassDirective }], ngImport: i0, template: `
|
|
389
392
|
@if (formErrors) {
|
|
390
393
|
<sky-status-indicator
|
|
391
394
|
class="sky-form-error"
|
|
@@ -416,6 +419,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
416
419
|
}], errorText: [{
|
|
417
420
|
type: Input,
|
|
418
421
|
args: [{ required: true }]
|
|
422
|
+
}], hostErrorName: [{
|
|
423
|
+
type: HostBinding,
|
|
424
|
+
args: ['attr.errorName']
|
|
419
425
|
}] } });
|
|
420
426
|
|
|
421
427
|
class SkyFormErrorModule {
|