@anglr/common 12.0.0-beta.20220414093434 → 12.0.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.
- package/changelog.md +29 -1
- package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js +3 -1
- package/es2015/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
- package/es2015/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +5 -15
- package/es2015/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -1
- package/es2015/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js +2 -2
- package/es2015/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js.map +1 -1
- package/es2015/forms/src/components/index.js +1 -0
- package/es2015/forms/src/components/index.js.map +1 -1
- package/es2015/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js +75 -0
- package/es2015/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js.map +1 -0
- package/es2015/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js +31 -0
- package/es2015/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js.map +1 -0
- package/es2015/forms/src/directives/hasError/hasError.directive.js +25 -5
- package/es2015/forms/src/directives/hasError/hasError.directive.js.map +1 -1
- package/es2015/forms/src/directives/index.js +3 -0
- package/es2015/forms/src/directives/index.js.map +1 -0
- package/es2015/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js +24 -0
- package/es2015/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js.map +1 -0
- package/es2015/forms/src/index.js +1 -0
- package/es2015/forms/src/index.js.map +1 -1
- package/es2015/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +3 -2
- package/es2015/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map +1 -1
- package/es2015/forms/src/modules/hasError.module.js +14 -3
- package/es2015/forms/src/modules/hasError.module.js.map +1 -1
- package/es2015/positions/src/index.js +0 -7
- package/es2015/positions/src/index.js.map +1 -1
- package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js +12 -8
- package/es2015/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -1
- package/es2015/src/services/position/position.interface.js.map +1 -1
- package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js +3 -1
- package/es2020/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
- package/es2020/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js +5 -15
- package/es2020/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.js.map +1 -1
- package/es2020/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js +2 -2
- package/es2020/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.js.map +1 -1
- package/es2020/forms/src/components/index.js +1 -0
- package/es2020/forms/src/components/index.js.map +1 -1
- package/es2020/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js +75 -0
- package/es2020/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.js.map +1 -0
- package/es2020/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js +31 -0
- package/es2020/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.js.map +1 -0
- package/es2020/forms/src/directives/hasError/hasError.directive.js +25 -5
- package/es2020/forms/src/directives/hasError/hasError.directive.js.map +1 -1
- package/es2020/forms/src/directives/index.js +3 -0
- package/es2020/forms/src/directives/index.js.map +1 -0
- package/es2020/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js +24 -0
- package/es2020/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js.map +1 -0
- package/es2020/forms/src/index.js +1 -0
- package/es2020/forms/src/index.js.map +1 -1
- package/es2020/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +3 -2
- package/es2020/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map +1 -1
- package/es2020/forms/src/modules/hasError.module.js +14 -3
- package/es2020/forms/src/modules/hasError.module.js.map +1 -1
- package/es2020/positions/src/index.js +0 -7
- package/es2020/positions/src/index.js.map +1 -1
- package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js +12 -8
- package/es2020/src/modules/position/directives/positionTo/positionTo.directive.js.map +1 -1
- package/es2020/src/services/position/position.interface.js.map +1 -1
- package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -1
- package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.d.ts.map +1 -1
- package/forms/src/components/index.d.ts +1 -0
- package/forms/src/components/index.d.ts.map +1 -1
- package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.css +4 -0
- package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.d.ts +53 -0
- package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.d.ts.map +1 -0
- package/forms/src/components/reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component.html +3 -0
- package/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.d.ts +10 -0
- package/forms/src/directives/groupHasErrorContainer/groupHasErrorContainer.directive.d.ts.map +1 -0
- package/forms/src/directives/hasError/hasError.directive.d.ts +16 -4
- package/forms/src/directives/hasError/hasError.directive.d.ts.map +1 -1
- package/forms/src/directives/index.d.ts +3 -0
- package/forms/src/directives/index.d.ts.map +1 -0
- package/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.d.ts +12 -0
- package/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.d.ts.map +1 -0
- package/forms/src/index.d.ts +1 -0
- package/forms/src/index.d.ts.map +1 -1
- package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.d.ts.map +1 -1
- package/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.html +1 -1
- package/forms/src/modules/hasError.module.d.ts +7 -4
- package/forms/src/modules/hasError.module.d.ts.map +1 -1
- package/package.json +3 -3
- package/positions/src/index.d.ts +0 -7
- package/positions/src/index.d.ts.map +1 -1
- package/src/modules/position/directives/positionTo/positionTo.directive.d.ts +6 -2
- package/src/modules/position/directives/positionTo/positionTo.directive.d.ts.map +1 -1
- package/src/services/position/position.interface.d.ts +4 -0
- package/src/services/position/position.interface.d.ts.map +1 -1
- package/version.bak +1 -1
- package/es2015/positions/src/modules/positions/directives/positionTo/positionTo.directive.js +0 -58
- package/es2015/positions/src/modules/positions/directives/positionTo/positionTo.directive.js.map +0 -1
- package/es2015/positions/src/modules/positions/modules/positions.module.js +0 -24
- package/es2015/positions/src/modules/positions/modules/positions.module.js.map +0 -1
- package/es2015/positions/src/modules/tooltip/components/tooltip/tooltip.component.js +0 -98
- package/es2015/positions/src/modules/tooltip/components/tooltip/tooltip.component.js.map +0 -1
- package/es2015/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js +0 -230
- package/es2015/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +0 -1
- package/es2015/positions/src/modules/tooltip/misc/tokens.js +0 -6
- package/es2015/positions/src/modules/tooltip/misc/tokens.js.map +0 -1
- package/es2015/positions/src/modules/tooltip/misc/tooltip.interface.js +0 -2
- package/es2015/positions/src/modules/tooltip/misc/tooltip.interface.js.map +0 -1
- package/es2015/positions/src/modules/tooltip/modules/tooltip.module.js +0 -32
- package/es2015/positions/src/modules/tooltip/modules/tooltip.module.js.map +0 -1
- package/es2020/positions/src/modules/positions/directives/positionTo/positionTo.directive.js +0 -58
- package/es2020/positions/src/modules/positions/directives/positionTo/positionTo.directive.js.map +0 -1
- package/es2020/positions/src/modules/positions/modules/positions.module.js +0 -24
- package/es2020/positions/src/modules/positions/modules/positions.module.js.map +0 -1
- package/es2020/positions/src/modules/tooltip/components/tooltip/tooltip.component.js +0 -98
- package/es2020/positions/src/modules/tooltip/components/tooltip/tooltip.component.js.map +0 -1
- package/es2020/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js +0 -229
- package/es2020/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +0 -1
- package/es2020/positions/src/modules/tooltip/misc/tokens.js +0 -6
- package/es2020/positions/src/modules/tooltip/misc/tokens.js.map +0 -1
- package/es2020/positions/src/modules/tooltip/misc/tooltip.interface.js +0 -2
- package/es2020/positions/src/modules/tooltip/misc/tooltip.interface.js.map +0 -1
- package/es2020/positions/src/modules/tooltip/modules/tooltip.module.js +0 -32
- package/es2020/positions/src/modules/tooltip/modules/tooltip.module.js.map +0 -1
- package/forms/src/components/defaultValidationErrorsContainer/defaultValidationErrorsContainer.component.html +0 -0
- package/positions/src/modules/positions/directives/positionTo/positionTo.directive.d.ts +0 -34
- package/positions/src/modules/positions/directives/positionTo/positionTo.directive.d.ts.map +0 -1
- package/positions/src/modules/positions/modules/positions.module.d.ts +0 -11
- package/positions/src/modules/positions/modules/positions.module.d.ts.map +0 -1
- package/positions/src/modules/tooltip/components/tooltip/tooltip.component.css +0 -10
- package/positions/src/modules/tooltip/components/tooltip/tooltip.component.d.ts +0 -63
- package/positions/src/modules/tooltip/components/tooltip/tooltip.component.d.ts.map +0 -1
- package/positions/src/modules/tooltip/components/tooltip/tooltip.component.html +0 -6
- package/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts +0 -106
- package/positions/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts.map +0 -1
- package/positions/src/modules/tooltip/misc/tokens.d.ts +0 -7
- package/positions/src/modules/tooltip/misc/tokens.d.ts.map +0 -1
- package/positions/src/modules/tooltip/misc/tooltip.interface.d.ts +0 -71
- package/positions/src/modules/tooltip/misc/tooltip.interface.d.ts.map +0 -1
- package/positions/src/modules/tooltip/modules/tooltip.module.d.ts +0 -13
- package/positions/src/modules/tooltip/modules/tooltip.module.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Directive, ElementRef, Optional, SkipSelf, Inject, Input, Injector, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { Directive, ElementRef, Optional, SkipSelf, Inject, Input, Injector, ViewContainerRef, Type, TemplateRef } from '@angular/core';
|
|
3
3
|
import { FormControlDirective, FormControlName, NgModel } from '@angular/forms';
|
|
4
4
|
import { STRING_LOCALIZATION } from '@anglr/common';
|
|
5
5
|
import { generateId, BindThis } from '@jscrpt/common';
|
|
@@ -66,14 +66,20 @@ export class HasErrorDirective {
|
|
|
66
66
|
this._containerView ?? (this._containerView = new ValidationErrorsContainerView());
|
|
67
67
|
(_a = this._containerView).viewContainer ?? (_a.viewContainer = this._viewContainer);
|
|
68
68
|
this._registerMutationObserver();
|
|
69
|
-
this.renderer = this._rendererFactory.create(this.control, this._containerView, this._injector, this._isSubmittedOrDirty);
|
|
70
69
|
this._subscriptions.add(this._stringLocalization.textsChange.subscribe(() => this._updateStatus()));
|
|
71
70
|
this._subscriptions.add(this.control.statusChanges.subscribe(() => this._updateStatus()));
|
|
72
|
-
this._updateStatus();
|
|
73
71
|
if (this._submittedSvc) {
|
|
74
72
|
this._subscriptions.add(this._submittedSvc.submittedChange.subscribe(() => this._isSubmittedOrDirty(() => this._updateStatus())));
|
|
75
73
|
}
|
|
76
74
|
}
|
|
75
|
+
//######################### public methods - implementation of AfterViewInit #########################
|
|
76
|
+
/**
|
|
77
|
+
* Called when view was initialized
|
|
78
|
+
*/
|
|
79
|
+
ngAfterViewInit() {
|
|
80
|
+
this.renderer = this._rendererFactory.create(this.control, this._containerView, this._injector, this._isSubmittedOrDirty);
|
|
81
|
+
this._updateStatus();
|
|
82
|
+
}
|
|
77
83
|
//######################### public methods - implementation of OnDestroy #########################
|
|
78
84
|
/**
|
|
79
85
|
* Called when component is destroyed
|
|
@@ -89,8 +95,18 @@ export class HasErrorDirective {
|
|
|
89
95
|
* Updates status of control and css classes
|
|
90
96
|
*/
|
|
91
97
|
_updateStatus() {
|
|
98
|
+
if (!this.renderer) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const opts = {};
|
|
102
|
+
if (this.errorsTemplate) {
|
|
103
|
+
opts.template = this.errorsTemplate;
|
|
104
|
+
}
|
|
105
|
+
else if (this.errorsComponent) {
|
|
106
|
+
opts.component = this.errorsComponent;
|
|
107
|
+
}
|
|
92
108
|
this._previousDirty = this.control.dirty;
|
|
93
|
-
this._hasErrors = this.renderer.update(
|
|
109
|
+
this._hasErrors = this.renderer.update(opts, this.errorMessages);
|
|
94
110
|
this._toggleGroupHasError();
|
|
95
111
|
}
|
|
96
112
|
/**
|
|
@@ -134,7 +150,7 @@ export class HasErrorDirective {
|
|
|
134
150
|
}
|
|
135
151
|
}
|
|
136
152
|
HasErrorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: HasErrorDirective, deps: [{ token: i0.ElementRef }, { token: i1.ValidationErrorRendererFactory }, { token: i0.ViewContainerRef }, { token: i2.GroupHasErrorDirective, optional: true, skipSelf: true }, { token: i3.FormControlDirective, optional: true }, { token: i3.FormControlName, optional: true }, { token: i3.NgModel, optional: true }, { token: i4.SubmittedService, optional: true }, { token: i5.ValidationErrorsContainerView, optional: true }, { token: STRING_LOCALIZATION }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
137
|
-
HasErrorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: HasErrorDirective, selector: "[hasError]", inputs: { errorMessages: "errorMessages" }, ngImport: i0 });
|
|
153
|
+
HasErrorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: HasErrorDirective, selector: "[hasError]", inputs: { errorMessages: "errorMessages", errorsComponent: "errorsComponent", errorsTemplate: "errorsTemplate" }, ngImport: i0 });
|
|
138
154
|
__decorate([
|
|
139
155
|
BindThis,
|
|
140
156
|
__metadata("design:type", Function),
|
|
@@ -165,5 +181,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
165
181
|
args: [STRING_LOCALIZATION]
|
|
166
182
|
}] }, { type: i0.Injector }]; }, propDecorators: { errorMessages: [{
|
|
167
183
|
type: Input
|
|
184
|
+
}], errorsComponent: [{
|
|
185
|
+
type: Input
|
|
186
|
+
}], errorsTemplate: [{
|
|
187
|
+
type: Input
|
|
168
188
|
}], _isSubmittedOrDirty: [] } });
|
|
169
189
|
//# sourceMappingURL=hasError.directive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasError.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/hasError/hasError.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAqB,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACtI,OAAO,EAAC,oBAAoB,EAAE,eAAe,EAAe,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAqB,mBAAmB,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,8BAA8B,EAAC,MAAM,wEAAwE,CAAC;AAEtH,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAC,sBAAsB,EAAC,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAC,6BAA6B,EAAC,MAAM,0CAA0C,CAAC;;;;;;;AAEvF,qEAAqE;AAErE;;GAEG;AAKH,MAAM,OAAO,iBAAiB;IAsD1B,iEAAiE;IACjE,YAAoB,QAAiC,EACjC,gBAAgD,EAChD,cAAgC,EACR,cAAsC,EAClD,YAAkC,EAClC,gBAAiC,EACjC,QAAiB,EACjB,aAA+B,E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EAZhC,aAAa;sBADnB,KAAK;gBA4FE,mBAAmB","sourcesContent":["import {Directive, ElementRef, Optional, SkipSelf, OnInit, OnDestroy, Inject, Input, Injector, ViewContainerRef} from '@angular/core';\nimport {FormControlDirective, FormControlName, FormControl, NgModel} from '@angular/forms';\nimport {StringLocalization, STRING_LOCALIZATION} from '@anglr/common';\nimport {generateId, BindThis, StringDictionary} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {ValidationErrorRendererFactory} from '../../services/validationErrorRenderer/validationErrorRenderer.service';\nimport {ValidationErrorRenderer} from '../../services/validationErrorRenderer/validationErrorRenderer.interface';\nimport {SubmittedService} from '../../services/submitted/submitted.service';\nimport {GroupHasErrorDirective} from '../groupHasError/groupHasError.directive';\nimport {ValidationErrorsContainerView} from '../../misc/validationErrorsContainerView';\n\n//TODO - add support for setting renderer factory options using input\n\n/**\n * Directive that is attached to control element and handles css classes that are added to this element\n */\n@Directive(\n{\n selector: '[hasError]'\n})\nexport class HasErrorDirective implements OnInit, OnDestroy\n{\n //######################### private fields #########################\n\n /**\n * Subscriptions that are destroyed with destruction of this directive\n */\n private _subscriptions: Subscription = new Subscription();\n\n /**\n * Unique generated id of control\n */\n private _id: string = generateId(10);\n\n /**\n * Last value of control pristine attribute\n */\n private _previousDirty: boolean = false;\n\n /**\n * Indication whether currently are any errors rendered\n */\n private _hasErrors: boolean = false;\n\n /**\n * Mutation observer used for observing changes on class of element\n */\n private _observer: MutationObserver;\n\n //######################### private properties #########################\n\n /**\n * Gets control which was assigned to this element\n */\n private get control(): FormControl\n {\n return this._formControl?.control || this._formControlName?.control || this._ngModel?.control;\n }\n\n //######################### public properties #########################\n\n /**\n * Instance of validation error renderer\n */\n public renderer: ValidationErrorRenderer;\n\n //######################### public propeties - inputs #########################\n\n /**\n * Customized error messages\n */\n @Input()\n public errorMessages: StringDictionary;\n\n //######################### constructor #########################\n constructor(private _element: ElementRef<HTMLElement>,\n private _rendererFactory: ValidationErrorRendererFactory,\n private _viewContainer: ViewContainerRef,\n @Optional() @SkipSelf() private _groupHasError: GroupHasErrorDirective,\n @Optional() private _formControl: FormControlDirective,\n @Optional() private _formControlName: FormControlName,\n @Optional() private _ngModel: NgModel,\n @Optional() private _submittedSvc: SubmittedService,\n @Optional() private _containerView: ValidationErrorsContainerView,\n @Inject(STRING_LOCALIZATION) protected _stringLocalization: StringLocalization,\n protected _injector: Injector)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._containerView ??= new ValidationErrorsContainerView();\n this._containerView.viewContainer ??= this._viewContainer;\n\n this._registerMutationObserver();\n\n this.renderer = this._rendererFactory.create(this.control,\n this._containerView,\n this._injector,\n this._isSubmittedOrDirty);\n\n this._subscriptions.add(this._stringLocalization.textsChange.subscribe(() => this._updateStatus()));\n this._subscriptions.add(this.control.statusChanges.subscribe(() => this._updateStatus()));\n\n this._updateStatus();\n\n if(this._submittedSvc)\n {\n this._subscriptions.add(this._submittedSvc.submittedChange.subscribe(() => this._isSubmittedOrDirty(() => this._updateStatus())));\n }\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this._subscriptions.unsubscribe();\n\n this._groupHasError?.unregisterControl(this._id);\n this._observer?.disconnect();\n this.renderer?.destroy();\n }\n\n //######################### private methods #########################\n\n /**\n * Updates status of control and css classes\n */\n private _updateStatus(): void\n {\n this._previousDirty = this.control.dirty;\n this._hasErrors = this.renderer.update({}, this.errorMessages);\n this._toggleGroupHasError();\n }\n\n /**\n * Toggles registration of control in parent group\n */\n private _toggleGroupHasError(): void\n {\n if(this._groupHasError)\n {\n this._isSubmittedOrDirty(() => this._groupHasError.registerControl(this._id),\n () => this._groupHasError.unregisterControl(this._id),\n this._hasErrors);\n }\n }\n\n /**\n * Calls action when form is submitted or control is dirty\n * @param action - Action to be called when form is submitted or control dirty\n * @param falseAction - Action to be called when form is not submitted and control is not dirty\n * @param additionalCondition - Additional condition to be evaluated\n */\n @BindThis\n private _isSubmittedOrDirty(action: () => void, falseAction: () => void = () => {}, additionalCondition: boolean = true): void\n {\n //submitted form or dirty control\n if((this._submittedSvc?.submitted ||\n this.control?.dirty) &&\n additionalCondition)\n {\n action();\n }\n else\n {\n falseAction();\n }\n }\n\n /**\n * Registers mutation observer which watch for changes of class list\n */\n private _registerMutationObserver(): void\n {\n this._observer = new MutationObserver(() =>\n {\n if(this.control.dirty != this._previousDirty)\n {\n this._updateStatus();\n }\n });\n\n this._observer.observe(this._element.nativeElement, \n {\n attributeFilter: ['class'],\n attributes: true\n });\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"hasError.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/hasError/hasError.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAqB,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAiB,IAAI,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AACxK,OAAO,EAAC,oBAAoB,EAAE,eAAe,EAAe,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAqB,mBAAmB,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,8BAA8B,EAAC,MAAM,wEAAwE,CAAC;AAEtH,OAAO,EAAC,gBAAgB,EAAC,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAC,sBAAsB,EAAC,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAC,6BAA6B,EAAC,MAAM,0CAA0C,CAAC;;;;;;;AAEvF,qEAAqE;AAErE;;GAEG;AAKH,MAAM,OAAO,iBAAiB;IAkE1B,iEAAiE;IACjE,YAAoB,QAAiC,EACjC,gBAAgD,E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CAAC,QAAQ,CAAC,aAAa,EAClD;YACI,eAAe,EAAE,CAAC,OAAO,CAAC;YAC1B,UAAU,EAAE,IAAI;SACnB,CAAC,CAAC;IACP,CAAC;;8GApNQ,iBAAiB,ubA4EN,mBAAmB;kGA5E9B,iBAAiB;AAmL1B;IADC,QAAQ;;;;4DAcR;2FAhMQ,iBAAiB;kBAJ7B,SAAS;mBACV;oBACI,QAAQ,EAAE,YAAY;iBACzB;;0BAuEgB,QAAQ;;0BAAI,QAAQ;;0BACpB,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;;0BACR,QAAQ;;0BACR,MAAM;2BAAC,mBAAmB;mEAxBhC,aAAa;sBADnB,KAAK;gBAOC,eAAe;sBADrB,KAAK;gBAOC,cAAc;sBADpB,KAAK;gBAoHE,mBAAmB","sourcesContent":["import {Directive, ElementRef, Optional, SkipSelf, OnInit, OnDestroy, Inject, Input, Injector, ViewContainerRef, AfterViewInit, Type, TemplateRef} from '@angular/core';\nimport {FormControlDirective, FormControlName, FormControl, NgModel} from '@angular/forms';\nimport {StringLocalization, STRING_LOCALIZATION} from '@anglr/common';\nimport {generateId, BindThis, StringDictionary} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {ValidationErrorRendererFactory} from '../../services/validationErrorRenderer/validationErrorRenderer.service';\nimport {ValidationErrorRenderer, ValidationErrorsComponent, ValidationErrorsRendererOptions, ValidationErrorsTemplateContext} from '../../services/validationErrorRenderer/validationErrorRenderer.interface';\nimport {SubmittedService} from '../../services/submitted/submitted.service';\nimport {GroupHasErrorDirective} from '../groupHasError/groupHasError.directive';\nimport {ValidationErrorsContainerView} from '../../misc/validationErrorsContainerView';\n\n//TODO - add support for setting renderer factory options using input\n\n/**\n * Directive that is attached to control element and handles css classes that are added to this element\n */\n@Directive(\n{\n selector: '[hasError]'\n})\nexport class HasErrorDirective implements OnInit, AfterViewInit, OnDestroy\n{\n //######################### private fields #########################\n\n /**\n * Subscriptions that are destroyed with destruction of this directive\n */\n private _subscriptions: Subscription = new Subscription();\n\n /**\n * Unique generated id of control\n */\n private _id: string = generateId(10);\n\n /**\n * Last value of control pristine attribute\n */\n private _previousDirty: boolean = false;\n\n /**\n * Indication whether currently are any errors rendered\n */\n private _hasErrors: boolean = false;\n\n /**\n * Mutation observer used for observing changes on class of element\n */\n private _observer: MutationObserver;\n\n //######################### private properties #########################\n\n /**\n * Gets control which was assigned to this element\n */\n private get control(): FormControl\n {\n return this._formControl?.control || this._formControlName?.control || this._ngModel?.control;\n }\n\n //######################### public properties #########################\n\n /**\n * Instance of validation error renderer\n */\n public renderer: ValidationErrorRenderer;\n\n //######################### public propeties - inputs #########################\n\n /**\n * Customized error messages\n */\n @Input()\n public errorMessages: StringDictionary;\n\n /**\n * Custom component used for rendering validation errors\n */\n @Input()\n public errorsComponent?: Type<ValidationErrorsComponent>;\n\n /**\n * Custom template used for rendering validation errors\n */\n @Input()\n public errorsTemplate?: TemplateRef<ValidationErrorsTemplateContext>;\n\n //######################### constructor #########################\n constructor(private _element: ElementRef<HTMLElement>,\n private _rendererFactory: ValidationErrorRendererFactory,\n private _viewContainer: ViewContainerRef,\n @Optional() @SkipSelf() private _groupHasError: GroupHasErrorDirective,\n @Optional() private _formControl: FormControlDirective,\n @Optional() private _formControlName: FormControlName,\n @Optional() private _ngModel: NgModel,\n @Optional() private _submittedSvc: SubmittedService,\n @Optional() private _containerView: ValidationErrorsContainerView,\n @Inject(STRING_LOCALIZATION) protected _stringLocalization: StringLocalization,\n protected _injector: Injector)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._containerView ??= new ValidationErrorsContainerView();\n this._containerView.viewContainer ??= this._viewContainer;\n\n this._registerMutationObserver();\n\n this._subscriptions.add(this._stringLocalization.textsChange.subscribe(() => this._updateStatus()));\n this._subscriptions.add(this.control.statusChanges.subscribe(() => this._updateStatus()));\n\n if(this._submittedSvc)\n {\n this._subscriptions.add(this._submittedSvc.submittedChange.subscribe(() => this._isSubmittedOrDirty(() => this._updateStatus())));\n }\n }\n\n //######################### public methods - implementation of AfterViewInit #########################\n \n /**\n * Called when view was initialized\n */\n public ngAfterViewInit(): void\n {\n this.renderer = this._rendererFactory.create(this.control,\n this._containerView,\n this._injector,\n this._isSubmittedOrDirty);\n\n this._updateStatus();\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this._subscriptions.unsubscribe();\n\n this._groupHasError?.unregisterControl(this._id);\n this._observer?.disconnect();\n this.renderer?.destroy();\n }\n\n //######################### private methods #########################\n\n /**\n * Updates status of control and css classes\n */\n private _updateStatus(): void\n {\n if(!this.renderer)\n {\n return;\n }\n\n const opts: ValidationErrorsRendererOptions = {};\n\n if(this.errorsTemplate)\n {\n opts.template = this.errorsTemplate;\n }\n else if(this.errorsComponent)\n {\n opts.component = this.errorsComponent;\n }\n\n this._previousDirty = this.control.dirty;\n this._hasErrors = this.renderer.update(opts, this.errorMessages);\n this._toggleGroupHasError();\n }\n\n /**\n * Toggles registration of control in parent group\n */\n private _toggleGroupHasError(): void\n {\n if(this._groupHasError)\n {\n this._isSubmittedOrDirty(() => this._groupHasError.registerControl(this._id),\n () => this._groupHasError.unregisterControl(this._id),\n this._hasErrors);\n }\n }\n\n /**\n * Calls action when form is submitted or control is dirty\n * @param action - Action to be called when form is submitted or control dirty\n * @param falseAction - Action to be called when form is not submitted and control is not dirty\n * @param additionalCondition - Additional condition to be evaluated\n */\n @BindThis\n private _isSubmittedOrDirty(action: () => void, falseAction: () => void = () => {}, additionalCondition: boolean = true): void\n {\n //submitted form or dirty control\n if((this._submittedSvc?.submitted ||\n this.control?.dirty) &&\n additionalCondition)\n {\n action();\n }\n else\n {\n falseAction();\n }\n }\n\n /**\n * Registers mutation observer which watch for changes of class list\n */\n private _registerMutationObserver(): void\n {\n this._observer = new MutationObserver(() =>\n {\n if(this.control.dirty != this._previousDirty)\n {\n this._updateStatus();\n }\n });\n\n this._observer.observe(this._element.nativeElement, \n {\n attributeFilter: ['class'],\n attributes: true\n });\n }\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../forms/src/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,2DAA2D,CAAC;AAC1E,cAAc,iEAAiE,CAAC","sourcesContent":["export * from './groupHasErrorContainer/groupHasErrorContainer.directive';\nexport * from './validationErrorsContainer/validationErrorsContainer.directive';\n"]}
|
package/es2020/forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Directive, SkipSelf, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { ValidationErrorsContainerView } from '../../misc/validationErrorsContainerView';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "../../misc/validationErrorsContainerView";
|
|
5
|
+
/**
|
|
6
|
+
* Directive that sets view container for validation errors for current element
|
|
7
|
+
*/
|
|
8
|
+
export class ValidationErrorsContainerDirective {
|
|
9
|
+
//######################### constructor #########################
|
|
10
|
+
constructor(containerView, viewContainer) {
|
|
11
|
+
containerView.viewContainer = viewContainer;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
ValidationErrorsContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ValidationErrorsContainerDirective, deps: [{ token: i1.ValidationErrorsContainerView, skipSelf: true }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
15
|
+
ValidationErrorsContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: ValidationErrorsContainerDirective, selector: "[validationErrorsContainer]", ngImport: i0 });
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ValidationErrorsContainerDirective, decorators: [{
|
|
17
|
+
type: Directive,
|
|
18
|
+
args: [{
|
|
19
|
+
selector: '[validationErrorsContainer]'
|
|
20
|
+
}]
|
|
21
|
+
}], ctorParameters: function () { return [{ type: i1.ValidationErrorsContainerView, decorators: [{
|
|
22
|
+
type: SkipSelf
|
|
23
|
+
}] }, { type: i0.ViewContainerRef }]; } });
|
|
24
|
+
//# sourceMappingURL=validationErrorsContainer.directive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validationErrorsContainer.directive.js","sourceRoot":"","sources":["../../../../../forms/src/directives/validationErrorsContainer/validationErrorsContainer.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAEpE,OAAO,EAAC,6BAA6B,EAAC,MAAM,0CAA0C,CAAC;;;AAEvF;;GAEG;AAKH,MAAM,OAAO,kCAAkC;IAE3C,iEAAiE;IACjE,YAAwB,aAA4C,EACxD,aAA+B;QAEvC,aAAa,CAAC,aAAa,GAAG,aAAa,CAAC;IAChD,CAAC;;+HAPQ,kCAAkC;mHAAlC,kCAAkC;2FAAlC,kCAAkC;kBAJ9C,SAAS;mBACV;oBACI,QAAQ,EAAE,6BAA6B;iBAC1C;;0BAIgB,QAAQ","sourcesContent":["import {Directive, SkipSelf, ViewContainerRef} from '@angular/core';\n\nimport {ValidationErrorsContainerView} from '../../misc/validationErrorsContainerView';\n\n/**\n * Directive that sets view container for validation errors for current element\n */\n@Directive(\n{\n selector: '[validationErrorsContainer]'\n})\nexport class ValidationErrorsContainerDirective\n{\n //######################### constructor #########################\n constructor(@SkipSelf() containerView: ValidationErrorsContainerView,\n viewContainer: ViewContainerRef,)\n {\n containerView.viewContainer = viewContainer;\n }\n}"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './components';
|
|
2
|
+
export * from './directives';
|
|
2
3
|
export * from './directives/numberInput/maxValueNumberValidator.directive';
|
|
3
4
|
export * from './directives/numberInput/minValueNumberValidator.directive';
|
|
4
5
|
export * from './directives/numberInput/numberInputValidator.directive';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../forms/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,yDAAyD,CAAC;AACxE,cAAc,oEAAoE,CAAC;AACnF,cAAc,0CAA0C,CAAC;AACzD,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,wCAAwC,CAAC;AACvD,cAAc,oEAAoE,CAAC;AACnF,cAAc,kEAAkE,CAAC;AACjF,cAAc,sEAAsE,CAAC;AACrF,cAAc,oEAAoE,CAAC;AACnF,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './components';\nexport * from './directives/numberInput/maxValueNumberValidator.directive';\nexport * from './directives/numberInput/minValueNumberValidator.directive';\nexport * from './directives/numberInput/numberInputValidator.directive';\nexport * from './directives/numberInput/numberInputControlValueAccessor.directive';\nexport * from './directives/hasError/hasError.directive';\nexport * from './directives/groupHasError/groupHasError.directive';\nexport * from './directives/requiredClass/requiredClass.directive';\nexport * from './services/submitted/submitted.service';\nexport * from './services/errorMessagesExtractor/errorMessagesExtractor.interface';\nexport * from './services/errorMessagesExtractor/errorMessagesExtractor.service';\nexport * from './services/validationErrorRenderer/validationErrorRenderer.interface';\nexport * from './services/validationErrorRenderer/validationErrorRenderer.service';\nexport * from './misc/validators';\nexport * from './misc/utils';\nexport * from './misc/tokens';\nexport * from './misc/validationErrorsContainerView';\nexport * from './modules/numberInput.module';\nexport * from './modules/hasError.module';\nexport * from './modules/requiredClass.module';\nexport * from './modules/formPipes';\nexport * from './modules/errorMessage';\nexport * from './misc/formModel';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../forms/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,yDAAyD,CAAC;AACxE,cAAc,oEAAoE,CAAC;AACnF,cAAc,0CAA0C,CAAC;AACzD,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,wCAAwC,CAAC;AACvD,cAAc,oEAAoE,CAAC;AACnF,cAAc,kEAAkE,CAAC;AACjF,cAAc,sEAAsE,CAAC;AACrF,cAAc,oEAAoE,CAAC;AACnF,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './components';\nexport * from './directives';\nexport * from './directives/numberInput/maxValueNumberValidator.directive';\nexport * from './directives/numberInput/minValueNumberValidator.directive';\nexport * from './directives/numberInput/numberInputValidator.directive';\nexport * from './directives/numberInput/numberInputControlValueAccessor.directive';\nexport * from './directives/hasError/hasError.directive';\nexport * from './directives/groupHasError/groupHasError.directive';\nexport * from './directives/requiredClass/requiredClass.directive';\nexport * from './services/submitted/submitted.service';\nexport * from './services/errorMessagesExtractor/errorMessagesExtractor.interface';\nexport * from './services/errorMessagesExtractor/errorMessagesExtractor.service';\nexport * from './services/validationErrorRenderer/validationErrorRenderer.interface';\nexport * from './services/validationErrorRenderer/validationErrorRenderer.service';\nexport * from './misc/validators';\nexport * from './misc/utils';\nexport * from './misc/tokens';\nexport * from './misc/validationErrorsContainerView';\nexport * from './modules/numberInput.module';\nexport * from './modules/hasError.module';\nexport * from './modules/requiredClass.module';\nexport * from './modules/formPipes';\nexport * from './modules/errorMessage';\nexport * from './misc/formModel';\n"]}
|
package/es2020/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, ChangeDetectionStrategy, Optional, ChangeDetectorRef, Input, ContentChild } from '@angular/core';
|
|
2
2
|
import { FormGroupDirective, FormGroupName } from '@angular/forms';
|
|
3
|
+
import { slideInOutTrigger } from '@anglr/animations';
|
|
3
4
|
import { Subscription } from 'rxjs';
|
|
4
5
|
import { GroupErrorsTemplateDirective } from '../../directives';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
@@ -55,10 +56,10 @@ export class GroupErrorsComponent {
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
GroupErrorsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: GroupErrorsComponent, deps: [{ token: i1.FormGroupDirective, optional: true }, { token: i1.FormGroupName, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
58
|
-
GroupErrorsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: GroupErrorsComponent, selector: "form-group-errors", inputs: { cssClass: "cssClass" }, queries: [{ propertyName: "template", first: true, predicate: GroupErrorsTemplateDirective, descendants: true }], ngImport: i0, template: "<ng-template #defaultTemplate let-errorName>\n <div [ngClass]=\"cssClass\" [errorMessage]=\"errorName\" [errors]=\"formGroup.errors\"></div>\n</ng-template>\n\n<ng-container *ngFor=\"let errorName of formGroup.errors | keys | withErrorMessage; let first=first; let last=last; let index=index\">\n <ng-container *ngTemplateOutlet=\"template?.template ?? defaultTemplate; context: {$implicit: errorName, first, last, index, errors: formGroup.errors}\"></ng-container>\n</ng-container>", directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.ErrorMessageDirective, selector: "[errorMessage]", inputs: ["errorMessage", "errors"], exportAs: ["errorMessage"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "withErrorMessage": i4.WithErrorMessagePipe, "keys": i5.KeysPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
59
|
+
GroupErrorsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: GroupErrorsComponent, selector: "form-group-errors", inputs: { cssClass: "cssClass" }, queries: [{ propertyName: "template", first: true, predicate: GroupErrorsTemplateDirective, descendants: true }], ngImport: i0, template: "<ng-template #defaultTemplate let-errorName>\n <div [ngClass]=\"cssClass\" [errorMessage]=\"errorName\" [errors]=\"formGroup.errors\" @slideInOut></div>\n</ng-template>\n\n<ng-container *ngFor=\"let errorName of formGroup.errors | keys | withErrorMessage; let first=first; let last=last; let index=index\">\n <ng-container *ngTemplateOutlet=\"template?.template ?? defaultTemplate; context: {$implicit: errorName, first, last, index, errors: formGroup.errors}\"></ng-container>\n</ng-container>", directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.ErrorMessageDirective, selector: "[errorMessage]", inputs: ["errorMessage", "errors"], exportAs: ["errorMessage"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "withErrorMessage": i4.WithErrorMessagePipe, "keys": i5.KeysPipe }, animations: [slideInOutTrigger], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
59
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: GroupErrorsComponent, decorators: [{
|
|
60
61
|
type: Component,
|
|
61
|
-
args: [{ selector: 'form-group-errors', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #defaultTemplate let-errorName>\n <div [ngClass]=\"cssClass\" [errorMessage]=\"errorName\" [errors]=\"formGroup.errors\"></div>\n</ng-template>\n\n<ng-container *ngFor=\"let errorName of formGroup.errors | keys | withErrorMessage; let first=first; let last=last; let index=index\">\n <ng-container *ngTemplateOutlet=\"template?.template ?? defaultTemplate; context: {$implicit: errorName, first, last, index, errors: formGroup.errors}\"></ng-container>\n</ng-container>" }]
|
|
62
|
+
args: [{ selector: 'form-group-errors', animations: [slideInOutTrigger], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #defaultTemplate let-errorName>\n <div [ngClass]=\"cssClass\" [errorMessage]=\"errorName\" [errors]=\"formGroup.errors\" @slideInOut></div>\n</ng-template>\n\n<ng-container *ngFor=\"let errorName of formGroup.errors | keys | withErrorMessage; let first=first; let last=last; let index=index\">\n <ng-container *ngTemplateOutlet=\"template?.template ?? defaultTemplate; context: {$implicit: errorName, first, last, index, errors: formGroup.errors}\"></ng-container>\n</ng-container>" }]
|
|
62
63
|
}], ctorParameters: function () { return [{ type: i1.FormGroupDirective, decorators: [{
|
|
63
64
|
type: Optional
|
|
64
65
|
}] }, { type: i1.FormGroupName, decorators: [{
|
package/es2020/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupErrors.component.js","sourceRoot":"","sources":["../../../../../../../forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.ts","../../../../../../../forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,QAAQ,EAAqB,iBAAiB,EAAE,KAAK,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACtI,OAAO,EAA+B,kBAAkB,EAAE,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,4BAA4B,EAAC,MAAM,kBAAkB,CAAC;;;;;;;AAE9D;;GAEG;
|
|
1
|
+
{"version":3,"file":"groupErrors.component.js","sourceRoot":"","sources":["../../../../../../../forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.ts","../../../../../../../forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,QAAQ,EAAqB,iBAAiB,EAAE,KAAK,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACtI,OAAO,EAA+B,kBAAkB,EAAE,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,4BAA4B,EAAC,MAAM,kBAAkB,CAAC;;;;;;;AAE9D;;GAEG;AAQH,MAAM,OAAO,oBAAoB;IA8C7B,iEAAiE;IACjE,YAAkC,kBAAsC,EACtC,aAA4B,EACxC,eAAkC;QAFtB,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,kBAAa,GAAb,aAAa,CAAe;QACxC,oBAAe,GAAf,eAAe,CAAmB;QAxCxD;;WAEG;QACO,uBAAkB,GAAiB,IAAI,YAAY,EAAE,CAAC;QAuC5D,IAAG,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,aAAa,EAClD;YACI,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;SAC9E;IACL,CAAC;IApCD,2FAA2F;IAE3F;;;OAGG;IACH,IAAW,SAAS;QAEhB,OAAO,CAAC,IAAI,CAAC,UAAU,KAAf,IAAI,CAAC,UAAU,GAAM,IAAI,CAAC,kBAAkB,EAAE,IAAI,IAAI,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,CAAC;IAChG,CAAC;IA6BD,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;YAEvE,IAAG,IAAI,CAAC,UAAU,IAAI,KAAK,IAAI,KAAK,IAAI,SAAS,EACjD;gBACI,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;gBACxB,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;aACxC;QACL,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,kBAAkB,EAAE,WAAW,EAAE,CAAC;QACvC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IACnC,CAAC;;iHAnFQ,oBAAoB;qGAApB,oBAAoB,iIA2Cf,4BAA4B,gDC5D9C,sfAMe,shBDQC,CAAC,iBAAiB,CAAC;2FAGtB,oBAAoB;kBAPhC,SAAS;+BAEI,mBAAmB,cAEjB,CAAC,iBAAiB,CAAC,mBACd,uBAAuB,CAAC,MAAM;;0BAiDlC,QAAQ;;0BACR,QAAQ;4EAZd,QAAQ;sBADd,KAAK;gBASC,QAAQ;sBADd,YAAY;uBAAC,4BAA4B","sourcesContent":["import {Component, ChangeDetectionStrategy, Optional, OnInit, OnDestroy, ChangeDetectorRef, Input, ContentChild} from '@angular/core';\nimport {FormControlStatus, FormGroup, FormGroupDirective, FormGroupName} from '@angular/forms';\nimport {slideInOutTrigger} from '@anglr/animations';\nimport {Subscription} from 'rxjs';\n\nimport {GroupErrorsTemplateDirective} from '../../directives';\n\n/**\n * Component used for rendering from group errors\n */\n@Component(\n{\n selector: 'form-group-errors',\n templateUrl: 'groupErrors.component.html',\n animations: [slideInOutTrigger],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class GroupErrorsComponent implements OnInit, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of currently used form group\n */\n protected _formGroup?: FormGroup;\n\n /**\n * Subscriptions created during initialization\n */\n protected _initSubscriptions: Subscription = new Subscription();\n\n /**\n * Last state of form control\n */\n protected _lastState?: FormControlStatus;\n\n //######################### public properties - template bindings #########################\n\n /**\n * Gets instance of currently used form group\n * @internal\n */\n public get formGroup(): FormGroup\n {\n return (this._formGroup ??= (this.formGroupDirective?.form ?? this.formGroupName?.control));\n }\n\n //######################### public properties - inputs #########################\n\n /**\n * Css classes that are applied to default rendered divs\n */\n @Input()\n public cssClass: string;\n\n //######################### public properties - children #########################\n\n /**\n * Custom template for rendering form group error\n */\n @ContentChild(GroupErrorsTemplateDirective)\n public template?: GroupErrorsTemplateDirective;\n\n //######################### constructor #########################\n constructor(@Optional() protected formGroupDirective: FormGroupDirective,\n @Optional() protected formGroupName: FormGroupName,\n protected _changeDetector: ChangeDetectorRef,)\n {\n if(!this.formGroupDirective && !this.formGroupName)\n {\n throw new Error('There is no parent formGroup or formGroupName directive');\n }\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._initSubscriptions.add(this.formGroup.statusChanges.subscribe(state =>\n {\n if(this._lastState != state || state == 'INVALID')\n {\n this._lastState = state;\n this._changeDetector.detectChanges();\n }\n }));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this._initSubscriptions?.unsubscribe();\n this._initSubscriptions = null;\n }\n}","<ng-template #defaultTemplate let-errorName>\n <div [ngClass]=\"cssClass\" [errorMessage]=\"errorName\" [errors]=\"formGroup.errors\" @slideInOut></div>\n</ng-template>\n\n<ng-container *ngFor=\"let errorName of formGroup.errors | keys | withErrorMessage; let first=first; let last=last; let index=index\">\n <ng-container *ngTemplateOutlet=\"template?.template ?? defaultTemplate; context: {$implicit: errorName, first, last, index, errors: formGroup.errors}\"></ng-container>\n</ng-container>"]}
|
|
@@ -2,7 +2,8 @@ import { NgModule } from '@angular/core';
|
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { HasErrorDirective } from '../directives/hasError/hasError.directive';
|
|
4
4
|
import { GroupHasErrorDirective } from '../directives/groupHasError/groupHasError.directive';
|
|
5
|
-
import {
|
|
5
|
+
import { GroupHasErrorContainerDirective, ValidationErrorsContainerDirective } from '../directives';
|
|
6
|
+
import { DefaultValidationErrorsComponent, DefaultValidationErrorsContainerComponent, ReservedSpaceValidationErrorsContainerComponent } from '../components';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
/**
|
|
8
9
|
* Module for input validation directives
|
|
@@ -12,9 +13,14 @@ export class HasErrorModule {
|
|
|
12
13
|
HasErrorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: HasErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
13
14
|
HasErrorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: HasErrorModule, declarations: [HasErrorDirective,
|
|
14
15
|
GroupHasErrorDirective,
|
|
16
|
+
GroupHasErrorContainerDirective,
|
|
17
|
+
ValidationErrorsContainerDirective,
|
|
15
18
|
DefaultValidationErrorsComponent,
|
|
16
|
-
DefaultValidationErrorsContainerComponent
|
|
17
|
-
|
|
19
|
+
DefaultValidationErrorsContainerComponent,
|
|
20
|
+
ReservedSpaceValidationErrorsContainerComponent], imports: [CommonModule], exports: [HasErrorDirective,
|
|
21
|
+
GroupHasErrorDirective,
|
|
22
|
+
GroupHasErrorContainerDirective,
|
|
23
|
+
ValidationErrorsContainerDirective] });
|
|
18
24
|
HasErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: HasErrorModule, imports: [[
|
|
19
25
|
CommonModule,
|
|
20
26
|
]] });
|
|
@@ -27,12 +33,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
27
33
|
declarations: [
|
|
28
34
|
HasErrorDirective,
|
|
29
35
|
GroupHasErrorDirective,
|
|
36
|
+
GroupHasErrorContainerDirective,
|
|
37
|
+
ValidationErrorsContainerDirective,
|
|
30
38
|
DefaultValidationErrorsComponent,
|
|
31
39
|
DefaultValidationErrorsContainerComponent,
|
|
40
|
+
ReservedSpaceValidationErrorsContainerComponent,
|
|
32
41
|
],
|
|
33
42
|
exports: [
|
|
34
43
|
HasErrorDirective,
|
|
35
44
|
GroupHasErrorDirective,
|
|
45
|
+
GroupHasErrorContainerDirective,
|
|
46
|
+
ValidationErrorsContainerDirective,
|
|
36
47
|
]
|
|
37
48
|
}]
|
|
38
49
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasError.module.js","sourceRoot":"","sources":["../../../../forms/src/modules/hasError.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAC,iBAAiB,EAAC,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAC,sBAAsB,EAAC,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAC,gCAAgC,EAAE,yCAAyC,EAAC,MAAM,eAAe,CAAC;;
|
|
1
|
+
{"version":3,"file":"hasError.module.js","sourceRoot":"","sources":["../../../../forms/src/modules/hasError.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAC,iBAAiB,EAAC,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAC,sBAAsB,EAAC,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAC,+BAA+B,EAAE,kCAAkC,EAAC,MAAM,eAAe,CAAC;AAClG,OAAO,EAAC,gCAAgC,EAAE,yCAAyC,EAAE,+CAA+C,EAAC,MAAM,eAAe,CAAC;;AAE3J;;GAEG;AAyBH,MAAM,OAAO,cAAc;;2GAAd,cAAc;4GAAd,cAAc,iBAhBnB,iBAAiB;QACjB,sBAAsB;QACtB,+BAA+B;QAC/B,kCAAkC;QAClC,gCAAgC;QAChC,yCAAyC;QACzC,+CAA+C,aAV/C,YAAY,aAcZ,iBAAiB;QACjB,sBAAsB;QACtB,+BAA+B;QAC/B,kCAAkC;4GAG7B,cAAc,YArBvB;YACI,YAAY;SACf;2FAmBQ,cAAc;kBAxB1B,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,YAAY;qBACf;oBACD,YAAY,EACZ;wBACI,iBAAiB;wBACjB,sBAAsB;wBACtB,+BAA+B;wBAC/B,kCAAkC;wBAClC,gCAAgC;wBAChC,yCAAyC;wBACzC,+CAA+C;qBAClD;oBACD,OAAO,EACP;wBACI,iBAAiB;wBACjB,sBAAsB;wBACtB,+BAA+B;wBAC/B,kCAAkC;qBACrC;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport {HasErrorDirective} from '../directives/hasError/hasError.directive';\nimport {GroupHasErrorDirective} from '../directives/groupHasError/groupHasError.directive';\nimport {GroupHasErrorContainerDirective, ValidationErrorsContainerDirective} from '../directives';\nimport {DefaultValidationErrorsComponent, DefaultValidationErrorsContainerComponent, ReservedSpaceValidationErrorsContainerComponent} from '../components';\n\n/**\n * Module for input validation directives\n */\n@NgModule(\n{\n imports:\n [\n CommonModule,\n ],\n declarations: \n [\n HasErrorDirective,\n GroupHasErrorDirective,\n GroupHasErrorContainerDirective,\n ValidationErrorsContainerDirective,\n DefaultValidationErrorsComponent,\n DefaultValidationErrorsContainerComponent,\n ReservedSpaceValidationErrorsContainerComponent,\n ],\n exports: \n [\n HasErrorDirective,\n GroupHasErrorDirective,\n GroupHasErrorContainerDirective,\n ValidationErrorsContainerDirective,\n ]\n})\nexport class HasErrorModule\n{\n}"]}
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
export * from './misc/utils';
|
|
2
|
-
export * from './modules/positions/directives/positionTo/positionTo.directive';
|
|
3
|
-
export * from './modules/positions/modules/positions.module';
|
|
4
|
-
export * from './modules/tooltip/components/tooltip/tooltip.component';
|
|
5
|
-
export * from './modules/tooltip/directives/tooltip/tooltip.directive';
|
|
6
|
-
export * from './modules/tooltip/misc/tokens';
|
|
7
|
-
export * from './modules/tooltip/misc/tooltip.interface';
|
|
8
|
-
export * from './modules/tooltip/modules/tooltip.module';
|
|
9
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../positions/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../positions/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC","sourcesContent":["export * from './misc/utils';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Directive, Input, ElementRef, Inject } from '@angular/core';
|
|
1
|
+
import { Directive, Input, ElementRef, Inject, Output, EventEmitter } from '@angular/core';
|
|
2
2
|
import { nameof, isPresent, isString } from '@jscrpt/common';
|
|
3
3
|
import { applyPositionResult, PositionPlacement } from '../../../../services/position';
|
|
4
4
|
import { POSITION } from '../../../../types/tokens';
|
|
@@ -7,16 +7,15 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
* Sets position of attached element relative to provided element
|
|
8
8
|
*/
|
|
9
9
|
export class PositionToDirective {
|
|
10
|
-
// //######################### public properties - outputs #########################
|
|
11
|
-
// /**
|
|
12
|
-
// * Occurs when flip occurs during positioning
|
|
13
|
-
// */
|
|
14
|
-
// @Output()
|
|
15
|
-
// public flip: EventEmitter<void> = new EventEmitter<void>();
|
|
16
10
|
//######################### constructor #########################
|
|
17
11
|
constructor(_target, _position) {
|
|
18
12
|
this._target = _target;
|
|
19
13
|
this._position = _position;
|
|
14
|
+
// //######################### public properties - outputs #########################
|
|
15
|
+
/**
|
|
16
|
+
* Occurs when flip occurs during positioning
|
|
17
|
+
*/
|
|
18
|
+
this.flip = new EventEmitter();
|
|
20
19
|
}
|
|
21
20
|
//######################### public properties - inputs #########################
|
|
22
21
|
/**
|
|
@@ -67,10 +66,13 @@ export class PositionToDirective {
|
|
|
67
66
|
}
|
|
68
67
|
const result = await this._position.placeElement(this._target.nativeElement, this._source, options).toPromise();
|
|
69
68
|
applyPositionResult(result);
|
|
69
|
+
if (result.flip) {
|
|
70
|
+
this.flip.next();
|
|
71
|
+
}
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
74
|
PositionToDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionToDirective, deps: [{ token: i0.ElementRef }, { token: POSITION }], target: i0.ɵɵFactoryTarget.Directive });
|
|
73
|
-
PositionToDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: PositionToDirective, selector: "[positionTo]", inputs: { source: ["positionTo", "source"], placement: "placement" }, usesOnChanges: true, ngImport: i0 });
|
|
75
|
+
PositionToDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: PositionToDirective, selector: "[positionTo]", inputs: { source: ["positionTo", "source"], placement: "placement" }, outputs: { flip: "flip" }, usesOnChanges: true, ngImport: i0 });
|
|
74
76
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PositionToDirective, decorators: [{
|
|
75
77
|
type: Directive,
|
|
76
78
|
args: [{
|
|
@@ -84,5 +86,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
84
86
|
args: ['positionTo']
|
|
85
87
|
}], placement: [{
|
|
86
88
|
type: Input
|
|
89
|
+
}], flip: [{
|
|
90
|
+
type: Output
|
|
87
91
|
}] } });
|
|
88
92
|
//# sourceMappingURL=positionTo.directive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positionTo.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/position/directives/positionTo/positionTo.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAA4B,MAAM,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"positionTo.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/position/directives/positionTo/positionTo.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAA4B,MAAM,EAAE,MAAM,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAC,mBAAmB,EAAY,iBAAiB,EAAkB,MAAM,+BAA+B,CAAC;AAChH,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;;AAElD;;GAEG;AAKH,MAAM,OAAO,mBAAmB;IAgE5B,iEAAiE;IACjE,YAAsB,OAAgC,EACd,SAAmB;QADrC,YAAO,GAAP,OAAO,CAAyB;QACd,cAAS,GAAT,SAAS,CAAU;QAV3D,oFAAoF;QAEpF;;WAEG;QAEI,SAAI,GAAuB,IAAI,YAAY,EAAQ,CAAC;IAM3D,CAAC;IAtDD,gFAAgF;IAEhF;;OAEG;IACH,IACW,MAAM;QAEb,OAA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AAE,CAAC;SACpB;IACL,CAAC;;gHA/GQ,mBAAmB,4CAkER,QAAQ;oGAlEnB,mBAAmB;2FAAnB,mBAAmB;kBAJ/B,SAAS;mBACV;oBACI,QAAQ,EAAE,cAAc;iBAC3B;;0BAmEgB,MAAM;2BAAC,QAAQ;4CA9CjB,MAAM;sBADhB,KAAK;uBAAC,YAAY;gBAqBR,SAAS;sBADnB,KAAK;gBAuBC,IAAI;sBADV,MAAM","sourcesContent":["import {Directive, Input, ElementRef, OnChanges, SimpleChanges, Inject, Output, EventEmitter} from '@angular/core';\nimport {nameof, isPresent, isString} from '@jscrpt/common';\n\nimport {applyPositionResult, Position, PositionPlacement, PositionOptions} from '../../../../services/position';\nimport {POSITION} from '../../../../types/tokens';\n\n/**\n * Sets position of attached element relative to provided element\n */\n@Directive(\n{\n selector: '[positionTo]'\n})\nexport class PositionToDirective implements OnChanges\n{\n //######################### protected fields #########################\n\n /**\n * Position placement value\n */\n protected _placement: PositionPlacement|null|undefined;\n\n /**\n * Html element which is used as source for positioning\n */\n protected _source!: HTMLElement;\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets html element which is used as source for positioning\n */\n @Input('positionTo')\n public get source(): HTMLElement\n {\n return this._source;\n }\n public set source(value: HTMLElement)\n {\n if(value instanceof ElementRef)\n {\n this._source = (value as ElementRef).nativeElement;\n\n return;\n }\n\n this._source = value;\n }\n\n /**\n * Gets or sets position placement value\n */\n @Input()\n public get placement(): PositionPlacement|null|undefined\n {\n return this._placement;\n }\n public set placement(value: PositionPlacement|null|undefined)\n {\n if(isString(value))\n {\n this._placement = PositionPlacement[value as keyof typeof PositionPlacement];\n\n return;\n }\n\n this._placement = value;\n }\n\n // //######################### public properties - outputs #########################\n\n /**\n * Occurs when flip occurs during positioning\n */\n @Output()\n public flip: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor(protected _target: ElementRef<HTMLElement>,\n @Inject(POSITION) protected _position: Position)\n {\n }\n\n //######################### public methods - implementation of OnChanges #########################\n\n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if((nameof<PositionToDirective>('source') in changes ||\n nameof<PositionToDirective>('placement') in changes) &&\n isPresent(this.source))\n {\n this._applyPosition();\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Applies position according to specified parameters to specified elements\n */\n protected async _applyPosition(): Promise<void>\n {\n const options: Partial<PositionOptions> =\n {\n };\n\n if(this._placement)\n {\n options.placement = this._placement;\n }\n\n const result = await this._position.placeElement(this._target.nativeElement,\n this._source,\n options).toPromise();\n\n applyPositionResult(result);\n\n if(result.flip)\n {\n this.flip.next();\n }\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `placement` input\n */\n public static ngAcceptInputType_placement: PositionPlacement|undefined|null|keyof typeof PositionPlacement;\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `positionTo` input\n */\n public static ngAcceptInputType_positionTo: HTMLElement|ElementRef<HTMLElement>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.interface.js","sourceRoot":"","sources":["../../../../src/services/position/position.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Observable} from 'rxjs';\n\nimport {PositionOffset, PositionPlacement} from './position.types';\n\n/**\n * Options for autoupdate specific functionality\n */\nexport interface AutoUpdateOptions\n{\n /**\n * Indication whether update position when ancestor scroll changes\n */\n ancestorScroll: boolean;\n\n /**\n * Indication whether update position when ancestor size changes\n */\n ancestorResize: boolean;\n\n /**\n * Indication whether update position when target element changes size\n */\n elementResize: boolean;\n}\n\n/**\n * Options that are passed to position service\n */\nexport interface PositionOptions\n{\n //######################### properties #########################\n\n /**\n * Placement of target element against source element\n */\n placement: PositionPlacement;\n\n /**\n * Offset which allows moving target element along the cross axis of placement\n */\n offset: PositionOffset;\n\n /**\n * Indication whether perform flip in case of collision (with view boundaries)\n */\n flip: boolean;\n\n /**\n * Indication whether set up 'auto updating' of position\n */\n autoUpdate: boolean|AutoUpdateOptions;\n\n /**\n * Mouse event that occured when positioning was called\n */\n mouseEvent?: MouseEvent;\n}\n\n/**\n * Result of positioning process, storing new coordinates\n */\nexport interface PositionResult<TElement extends Element = any>\n{\n /**\n * Target element to be positioned\n */\n target: TElement;\n\n /**\n * X coordinate of position of target\n */\n x: number;\n\n /**\n * Y coordinate of position of target\n */\n y: number;\n\n /**\n * Disposes instance of engine used for positioning\n */\n dispose(): void;\n}\n\n/**\n * Service that is used for positioning two elements against each other\n */\nexport interface Position\n{\n //######################### methods #########################\n\n /**\n * Places target element relatively to source element according options and returns result storing information about new position\n * @param target - Target element to be placed\n * @param source - Source element to be placed against\n * @param options - Optional options with informations about new position\n */\n placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"position.interface.js","sourceRoot":"","sources":["../../../../src/services/position/position.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Observable} from 'rxjs';\n\nimport {PositionOffset, PositionPlacement} from './position.types';\n\n/**\n * Options for autoupdate specific functionality\n */\nexport interface AutoUpdateOptions\n{\n /**\n * Indication whether update position when ancestor scroll changes\n */\n ancestorScroll: boolean;\n\n /**\n * Indication whether update position when ancestor size changes\n */\n ancestorResize: boolean;\n\n /**\n * Indication whether update position when target element changes size\n */\n elementResize: boolean;\n}\n\n/**\n * Options that are passed to position service\n */\nexport interface PositionOptions\n{\n //######################### properties #########################\n\n /**\n * Placement of target element against source element\n */\n placement: PositionPlacement;\n\n /**\n * Offset which allows moving target element along the cross axis of placement\n */\n offset: PositionOffset;\n\n /**\n * Indication whether perform flip in case of collision (with view boundaries)\n */\n flip: boolean;\n\n /**\n * Indication whether set up 'auto updating' of position\n */\n autoUpdate: boolean|AutoUpdateOptions;\n\n /**\n * Mouse event that occured when positioning was called\n */\n mouseEvent?: MouseEvent;\n}\n\n/**\n * Result of positioning process, storing new coordinates\n */\nexport interface PositionResult<TElement extends Element = any>\n{\n /**\n * Target element to be positioned\n */\n target: TElement;\n\n /**\n * X coordinate of position of target\n */\n x: number;\n\n /**\n * Y coordinate of position of target\n */\n y: number;\n\n /**\n * Indication whether there was flip applied\n */\n flip: boolean;\n\n /**\n * Disposes instance of engine used for positioning\n */\n dispose(): void;\n}\n\n/**\n * Service that is used for positioning two elements against each other\n */\nexport interface Position\n{\n //######################### methods #########################\n\n /**\n * Places target element relatively to source element according options and returns result storing information about new position\n * @param target - Target element to be placed\n * @param source - Source element to be placed against\n * @param options - Optional options with informations about new position\n */\n placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floatingUiDomPosition.service.d.ts","sourceRoot":"","sources":["floatingUiDomPosition.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAa,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAiE,MAAM,eAAe,CAAC;AAExI,OAAO,EAAkB,SAAS,EAAc,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;;AAahC;;GAEG;AACH,qBACa,qBAAsB,YAAW,QAAQ;IAIlD;;OAEG;IACI,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"floatingUiDomPosition.service.d.ts","sourceRoot":"","sources":["floatingUiDomPosition.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAa,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAiE,MAAM,eAAe,CAAC;AAExI,OAAO,EAAkB,SAAS,EAAc,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;;AAahC;;GAEG;AACH,qBACa,qBAAsB,YAAW,QAAQ;IAIlD;;OAEG;IACI,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC;IAmFrH;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAQ7E;;;;OAIG;IACH,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAkF/E;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS;yCAlMnD,qBAAqB;6CAArB,qBAAqB;CAyPjC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAIlC,CAAC"}
|
package/forms/src/components/defaultValidationErrors/defaultValidationErrors.component.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultValidationErrors.component.d.ts","sourceRoot":"","sources":["defaultValidationErrors.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,iBAAiB,EAAc,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"defaultValidationErrors.component.d.ts","sourceRoot":"","sources":["defaultValidationErrors.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,iBAAiB,EAAc,MAAM,eAAe,CAAC;AAGjG,OAAO,EAAC,sBAAsB,EAAC,MAAM,wEAAwE,CAAC;AAC9G,OAAO,EAAC,yBAAyB,EAAE,uBAAuB,EAAC,MAAM,0EAA0E,CAAC;;AAE5I;;GAEG;AACH,qBAYa,gCAAiC,YAAW,yBAAyB;IAyBlE,SAAS,CAAC,eAAe,EAAE,iBAAiB;IArBxD;;;OAGG;IACI,MAAM,EAAE,sBAAsB,CAAC;IAEtC;;;OAGG;IACI,OAAO,EAAE,uBAAuB,CAAC;IAIxC;;OAEG;IAEI,OAAO,EAAE,OAAO,CAAQ;gBAGT,eAAe,EAAE,iBAAiB;IAMxD;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,uBAAuB,GAAG,IAAI;yCAlC1E,gCAAgC;2CAAhC,gCAAgC;CAyC5C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from './defaultValidationErrors/defaultValidationErrors.component';
|
|
2
2
|
export * from './defaultValidationErrorsContainer/defaultValidationErrorsContainer.component';
|
|
3
|
+
export * from './reservedSpaceValidationErrorsContainer/reservedSpaceValidationErrorsContainer.component';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+EAA+E,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+EAA+E,CAAC;AAC9F,cAAc,2FAA2F,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ViewContainerRef, ComponentRef, EmbeddedViewRef } from '@angular/core';
|
|
2
|
+
import { ValidationErrorsResult } from '../../services/errorMessagesExtractor/errorMessagesExtractor.interface';
|
|
3
|
+
import { ValidationErrorsComponent, ValidationErrorsContainerComponent, ValidationErrorsContainerOptions, ValidationErrorsTemplateContext } from '../../services/validationErrorRenderer/validationErrorRenderer.interface';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Component that serves as container for validation errors, either component or templates with reserved space for errors
|
|
7
|
+
*/
|
|
8
|
+
export declare class ReservedSpaceValidationErrorsContainerComponent implements ValidationErrorsContainerComponent {
|
|
9
|
+
/**
|
|
10
|
+
* Errors to be shown
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
protected _errors: ValidationErrorsResult;
|
|
14
|
+
/**
|
|
15
|
+
* Options used for displaying validation errors
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
protected _options: ValidationErrorsContainerOptions;
|
|
19
|
+
/**
|
|
20
|
+
* Instance of component reference for rendered errors
|
|
21
|
+
*/
|
|
22
|
+
protected _component: ComponentRef<ValidationErrorsComponent>;
|
|
23
|
+
/**
|
|
24
|
+
* Instance of template reference for rendered errors
|
|
25
|
+
*/
|
|
26
|
+
protected _template: EmbeddedViewRef<ValidationErrorsTemplateContext>;
|
|
27
|
+
/**
|
|
28
|
+
* View container for rendering validation errors
|
|
29
|
+
*/
|
|
30
|
+
viewContainer: ViewContainerRef;
|
|
31
|
+
/**
|
|
32
|
+
* Shows validation errors
|
|
33
|
+
* @param errors - Errors to be shown
|
|
34
|
+
* @param options - Options used for displaying validation errors
|
|
35
|
+
* @param errorClasses - Array of css error classes
|
|
36
|
+
*/
|
|
37
|
+
show(errors: ValidationErrorsResult, options: ValidationErrorsContainerOptions): void;
|
|
38
|
+
/**
|
|
39
|
+
* Hides validation errors
|
|
40
|
+
*/
|
|
41
|
+
hide(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Renders validation errors component
|
|
44
|
+
*/
|
|
45
|
+
protected _renderComponent(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Renders validation errors template
|
|
48
|
+
*/
|
|
49
|
+
protected _renderTemplate(): void;
|
|
50
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ReservedSpaceValidationErrorsContainerComponent, never>;
|
|
51
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ReservedSpaceValidationErrorsContainerComponent, "reserved-space-validation-errors-container", never, {}, {}, never, never>;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=reservedSpaceValidationErrorsContainer.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reservedSpaceValidationErrorsContainer.component.d.ts","sourceRoot":"","sources":["reservedSpaceValidationErrorsContainer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAY,MAAM,eAAe,CAAC;AAE7H,OAAO,EAAC,sBAAsB,EAAC,MAAM,wEAAwE,CAAC;AAC9G,OAAO,EAAC,yBAAyB,EAAE,kCAAkC,EAAE,gCAAgC,EAAE,+BAA+B,EAAC,MAAM,0EAA0E,CAAC;;AAI1N;;GAEG;AACH,qBAOa,+CAAgD,YAAW,kCAAkC;IAItG;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,sBAAsB,CAAC;IAE1C;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,gCAAgC,CAAC;IAErD;;OAEG;IACH,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;IAE9D;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,eAAe,CAAC,+BAA+B,CAAC,CAAC;IAItE;;OAEG;IAEI,aAAa,EAAE,gBAAgB,CAAC;IAIvC;;;;;OAKG;IACI,IAAI,CAAC,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,gCAAgC,GAAG,IAAI;IAmB5F;;OAEG;IACI,IAAI,IAAI,IAAI;IASnB;;OAEG;IACH,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAUlC;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,IAAI;yCAzFxB,+CAA+C;2CAA/C,+CAA+C;CA8G3D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GroupHasErrorDirective } from '../groupHasError/groupHasError.directive';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Directive that is attached to parent element of inputs group and handles css class that is added to this element and registers provider for ValidationErrorsContainerView
|
|
5
|
+
*/
|
|
6
|
+
export declare class GroupHasErrorContainerDirective extends GroupHasErrorDirective {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GroupHasErrorContainerDirective, never>;
|
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GroupHasErrorContainerDirective, "[groupHasErrorContainer]", never, {}, {}, never>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=groupHasErrorContainer.directive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupHasErrorContainer.directive.d.ts","sourceRoot":"","sources":["groupHasErrorContainer.directive.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,sBAAsB,EAAC,MAAM,0CAA0C,CAAC;;AAEhF;;GAEG;AACH,qBAaa,+BAAgC,SAAQ,sBAAsB;yCAA9D,+BAA+B;2CAA/B,+BAA+B;CAE3C"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ElementRef, OnInit, OnDestroy, Injector, ViewContainerRef } from '@angular/core';
|
|
1
|
+
import { ElementRef, OnInit, OnDestroy, Injector, ViewContainerRef, AfterViewInit, Type, TemplateRef } from '@angular/core';
|
|
2
2
|
import { FormControlDirective, FormControlName, NgModel } from '@angular/forms';
|
|
3
3
|
import { StringLocalization } from '@anglr/common';
|
|
4
4
|
import { StringDictionary } from '@jscrpt/common';
|
|
5
5
|
import { ValidationErrorRendererFactory } from '../../services/validationErrorRenderer/validationErrorRenderer.service';
|
|
6
|
-
import { ValidationErrorRenderer } from '../../services/validationErrorRenderer/validationErrorRenderer.interface';
|
|
6
|
+
import { ValidationErrorRenderer, ValidationErrorsComponent, ValidationErrorsTemplateContext } from '../../services/validationErrorRenderer/validationErrorRenderer.interface';
|
|
7
7
|
import { SubmittedService } from '../../services/submitted/submitted.service';
|
|
8
8
|
import { GroupHasErrorDirective } from '../groupHasError/groupHasError.directive';
|
|
9
9
|
import { ValidationErrorsContainerView } from '../../misc/validationErrorsContainerView';
|
|
@@ -11,7 +11,7 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
/**
|
|
12
12
|
* Directive that is attached to control element and handles css classes that are added to this element
|
|
13
13
|
*/
|
|
14
|
-
export declare class HasErrorDirective implements OnInit, OnDestroy {
|
|
14
|
+
export declare class HasErrorDirective implements OnInit, AfterViewInit, OnDestroy {
|
|
15
15
|
private _element;
|
|
16
16
|
private _rendererFactory;
|
|
17
17
|
private _viewContainer;
|
|
@@ -55,11 +55,23 @@ export declare class HasErrorDirective implements OnInit, OnDestroy {
|
|
|
55
55
|
* Customized error messages
|
|
56
56
|
*/
|
|
57
57
|
errorMessages: StringDictionary;
|
|
58
|
+
/**
|
|
59
|
+
* Custom component used for rendering validation errors
|
|
60
|
+
*/
|
|
61
|
+
errorsComponent?: Type<ValidationErrorsComponent>;
|
|
62
|
+
/**
|
|
63
|
+
* Custom template used for rendering validation errors
|
|
64
|
+
*/
|
|
65
|
+
errorsTemplate?: TemplateRef<ValidationErrorsTemplateContext>;
|
|
58
66
|
constructor(_element: ElementRef<HTMLElement>, _rendererFactory: ValidationErrorRendererFactory, _viewContainer: ViewContainerRef, _groupHasError: GroupHasErrorDirective, _formControl: FormControlDirective, _formControlName: FormControlName, _ngModel: NgModel, _submittedSvc: SubmittedService, _containerView: ValidationErrorsContainerView, _stringLocalization: StringLocalization, _injector: Injector);
|
|
59
67
|
/**
|
|
60
68
|
* Initialize component
|
|
61
69
|
*/
|
|
62
70
|
ngOnInit(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Called when view was initialized
|
|
73
|
+
*/
|
|
74
|
+
ngAfterViewInit(): void;
|
|
63
75
|
/**
|
|
64
76
|
* Called when component is destroyed
|
|
65
77
|
*/
|
|
@@ -84,6 +96,6 @@ export declare class HasErrorDirective implements OnInit, OnDestroy {
|
|
|
84
96
|
*/
|
|
85
97
|
private _registerMutationObserver;
|
|
86
98
|
static ɵfac: i0.ɵɵFactoryDeclaration<HasErrorDirective, [null, null, null, { optional: true; skipSelf: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, null, null]>;
|
|
87
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<HasErrorDirective, "[hasError]", never, { "errorMessages": "errorMessages"; }, {}, never>;
|
|
99
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HasErrorDirective, "[hasError]", never, { "errorMessages": "errorMessages"; "errorsComponent": "errorsComponent"; "errorsTemplate": "errorsTemplate"; }, {}, never>;
|
|
88
100
|
}
|
|
89
101
|
//# sourceMappingURL=hasError.directive.d.ts.map
|